PluginProbe
Elementor Website Builder – more than just a page builder / 3.32.0-dev3
Elementor Website Builder – more than just a page builder v3.32.0-dev3
4.3.0-beta3 4.3.0-beta2 4.3.0-beta1 4.2.4 4.2.3 4.2.2 4.2.1 4.2.0 4.1.5 4.2.0-beta2 4.2.0-dev2 4.2.0-beta1 4.1.4 4.1.3 4.1.2 4.1.1 4.1.0 4.1.0-beta3 4.1.0-dev3 4.0.9 4.1.0-beta2 4.1.0-dev2 4.0.8 4.1.0-beta1 4.1.0-dev1 All 452 releases
← All changes | assets/js/atomic-widgets-editor.js +402 -1334 4.1.23.32.0-dev3 View file →
@@ -1,4 +1,5 @@
1 +/*! elementor - v3.32.0 - 08-09-2025 */
1 2 /******/ (() => { // webpackBootstrap
2 3 /******/ var __webpack_modules__ = ({
3 4
4 5 /***/ "../assets/dev/js/editor/elements/views/behaviors/sortable.js":
@@ -302,413 +303,23 @@
302 303 value: true
303 304 }));
304 305 exports["default"] = EmptyComponent;
305 306 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 307 /* eslint-disable jsx-a11y/no-static-element-interactions */
308 308 /* eslint-disable jsx-a11y/click-events-have-key-events */
309 -
310 309 function EmptyComponent() {
311 - var handleClick = function handleClick() {
312 - _editorOneEvents.EditorOneEventManager.sendCanvasEmptyBoxAction({
313 - targetName: 'add_container'
314 - });
315 - $e.route('panel/elements/categories');
316 - };
317 310 return /*#__PURE__*/_react.default.createElement("div", {
318 311 className: "elementor-first-add"
319 312 }, /*#__PURE__*/_react.default.createElement("div", {
320 313 className: "elementor-icon eicon-plus",
321 - onClick: handleClick
314 + onClick: function onClick() {
315 + return $e.route('panel/elements/categories');
316 + }
322 317 }));
323 318 }
324 319
325 320 /***/ }),
326 321
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 - if (!this.isEventsManagerAvailable() || !this.canSendEvents()) {
378 - return false;
379 - }
380 - try {
381 - return this.getEventsManager().dispatchEvent(eventName, payload);
382 - } catch (error) {
383 - return false;
384 - }
385 - }
386 - }, {
387 - key: "toLowerSnake",
388 - value: function toLowerSnake(value) {
389 - if (!value || 'string' !== typeof value) {
390 - return value;
391 - }
392 - return value.replace(/\s+/g, '_').toLowerCase();
393 - }
394 - }, {
395 - key: "decodeHtmlEntities",
396 - value: function decodeHtmlEntities(text) {
397 - if (!text || 'string' !== typeof text) {
398 - return text;
399 - }
400 - var doc = new DOMParser().parseFromString(text, 'text/html');
401 - return doc.body.textContent || text;
402 - }
403 - }, {
404 - key: "isInEditorContext",
405 - value: function isInEditorContext() {
406 - var _window$elementor;
407 - return 'undefined' !== typeof window.elementor && !!((_window$elementor = window.elementor) !== null && _window$elementor !== void 0 && _window$elementor.documents);
408 - }
409 - }, {
410 - key: "getFinderContext",
411 - value: function getFinderContext() {
412 - var _config$appTypes, _config$appTypes2, _config$locations, _config$locations2;
413 - var config = this.getConfig();
414 - var isEditor = this.isInEditorContext();
415 - return {
416 - 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,
417 - 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)
418 - };
419 - }
420 - }, {
421 - key: "createBasePayload",
422 - value: function createBasePayload() {
423 - var _config$appTypes$edit, _config$appTypes3, _config$appTypes$edit2, _config$appTypes4;
424 - var overrides = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
425 - var config = this.getConfig();
426 - return _objectSpread({
427 - 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',
428 - 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'
429 - }, overrides);
430 - }
431 - }, {
432 - key: "sendTopBarPublishDropdown",
433 - value: function sendTopBarPublishDropdown(targetName) {
434 - var _config$names, _config$triggers, _config$targetTypes, _config$interactionRe, _config$locations3, _config$secondaryLoca, _config$targetTypes2;
435 - var config = this.getConfig();
436 - 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({
437 - interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers = config.triggers) === null || _config$triggers === void 0 ? void 0 : _config$triggers.click),
438 - target_type: config === null || config === void 0 || (_config$targetTypes = config.targetTypes) === null || _config$targetTypes === void 0 ? void 0 : _config$targetTypes.dropdownItem,
439 - target_name: targetName,
440 - interaction_result: config === null || config === void 0 || (_config$interactionRe = config.interactionResults) === null || _config$interactionRe === void 0 ? void 0 : _config$interactionRe.actionSelected,
441 - target_location: this.toLowerSnake(config === null || config === void 0 || (_config$locations3 = config.locations) === null || _config$locations3 === void 0 ? void 0 : _config$locations3.topBar),
442 - location_l1: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca = config.secondaryLocations) === null || _config$secondaryLoca === void 0 ? void 0 : _config$secondaryLoca.publishDropdown),
443 - location_l2: config === null || config === void 0 || (_config$targetTypes2 = config.targetTypes) === null || _config$targetTypes2 === void 0 ? void 0 : _config$targetTypes2.dropdownItem,
444 - interaction_description: 'User selected an action from the publish dropdown'
445 - }));
446 - }
447 - }, {
448 - key: "sendTopBarPageList",
449 - value: function sendTopBarPageList(targetName) {
450 - var _config$names2, _config$triggers2, _config$targetTypes3, _config$interactionRe2, _config$interactionRe3, _config$locations4, _config$secondaryLoca2, _config$targetTypes4;
451 - var isCreate = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
452 - var config = this.getConfig();
453 - 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({
454 - interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers2 = config.triggers) === null || _config$triggers2 === void 0 ? void 0 : _config$triggers2.click),
455 - target_type: config === null || config === void 0 || (_config$targetTypes3 = config.targetTypes) === null || _config$targetTypes3 === void 0 ? void 0 : _config$targetTypes3.dropdownItem,
456 - target_name: targetName,
457 - 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,
458 - target_location: this.toLowerSnake(config === null || config === void 0 || (_config$locations4 = config.locations) === null || _config$locations4 === void 0 ? void 0 : _config$locations4.topBar),
459 - location_l1: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca2 = config.secondaryLocations) === null || _config$secondaryLoca2 === void 0 ? void 0 : _config$secondaryLoca2.pageListDropdown),
460 - location_l2: config === null || config === void 0 || (_config$targetTypes4 = config.targetTypes) === null || _config$targetTypes4 === void 0 ? void 0 : _config$targetTypes4.dropdownItem,
461 - interaction_description: 'User selected an action from the page list dropdown'
462 - }));
463 - }
464 - }, {
465 - key: "sendSiteSettingsSession",
466 - value: function sendSiteSettingsSession(_ref) {
467 - var _config$names3, _config$triggers3, _config$interactionRe4, _config$locations5, _config$secondaryLoca3;
468 - var targetType = _ref.targetType,
469 - _ref$visitedItems = _ref.visitedItems,
470 - visitedItems = _ref$visitedItems === void 0 ? [] : _ref$visitedItems,
471 - _ref$savedItems = _ref.savedItems,
472 - savedItems = _ref$savedItems === void 0 ? [] : _ref$savedItems,
473 - state = _ref.state;
474 - var config = this.getConfig();
475 - 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({
476 - interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers3 = config.triggers) === null || _config$triggers3 === void 0 ? void 0 : _config$triggers3.click),
477 - target_type: targetType,
478 - target_name: 'site_settings',
479 - interaction_result: config === null || config === void 0 || (_config$interactionRe4 = config.interactionResults) === null || _config$interactionRe4 === void 0 ? void 0 : _config$interactionRe4.sessionEnd,
480 - target_location: this.toLowerSnake(config === null || config === void 0 || (_config$locations5 = config.locations) === null || _config$locations5 === void 0 ? void 0 : _config$locations5.leftPanel),
481 - location_l1: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca3 = config.secondaryLocations) === null || _config$secondaryLoca3 === void 0 ? void 0 : _config$secondaryLoca3.siteSettings),
482 - interaction_description: 'Records areas visited as part of the site setting session',
483 - metadata: {
484 - visited_items: visitedItems,
485 - saved_items: savedItems
486 - },
487 - state: state
488 - }));
489 - }
490 - }, {
491 - key: "sendELibraryNav",
492 - value: function sendELibraryNav(tabName) {
493 - var _config$names4, _config$triggers4, _config$targetTypes5, _config$interactionRe5, _config$locations6, _config$secondaryLoca4;
494 - var config = this.getConfig();
495 - 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({
496 - interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers4 = config.triggers) === null || _config$triggers4 === void 0 ? void 0 : _config$triggers4.tabSelect),
497 - target_type: config === null || config === void 0 || (_config$targetTypes5 = config.targetTypes) === null || _config$targetTypes5 === void 0 ? void 0 : _config$targetTypes5.tab,
498 - target_name: this.toLowerSnake(tabName),
499 - interaction_result: config === null || config === void 0 || (_config$interactionRe5 = config.interactionResults) === null || _config$interactionRe5 === void 0 ? void 0 : _config$interactionRe5.tabChanged,
500 - target_location: this.toLowerSnake(config === null || config === void 0 || (_config$locations6 = config.locations) === null || _config$locations6 === void 0 ? void 0 : _config$locations6.elementorLibrary),
501 - location_l1: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca4 = config.secondaryLocations) === null || _config$secondaryLoca4 === void 0 ? void 0 : _config$secondaryLoca4.libraryTabs),
502 - interaction_description: 'User navigates within elementor library'
503 - }));
504 - }
505 - }, {
506 - key: "sendELibraryInsert",
507 - value: function sendELibraryInsert(_ref2) {
508 - var _config$triggers5, _config$targetTypes6, _config$interactionRe6, _config$locations7, _config$secondaryLoca5, _config$names5;
509 - var assetId = _ref2.assetId,
510 - assetName = _ref2.assetName,
511 - libraryType = _ref2.libraryType,
512 - _ref2$proRequired = _ref2.proRequired,
513 - proRequired = _ref2$proRequired === void 0 ? false : _ref2$proRequired;
514 - var config = this.getConfig();
515 - var payload = this.createBasePayload({
516 - interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers5 = config.triggers) === null || _config$triggers5 === void 0 ? void 0 : _config$triggers5.insert),
517 - target_type: config === null || config === void 0 || (_config$targetTypes6 = config.targetTypes) === null || _config$targetTypes6 === void 0 ? void 0 : _config$targetTypes6.button,
518 - target_name: String(assetId),
519 - interaction_result: config === null || config === void 0 || (_config$interactionRe6 = config.interactionResults) === null || _config$interactionRe6 === void 0 ? void 0 : _config$interactionRe6.assetInserted,
520 - target_location: this.toLowerSnake(config === null || config === void 0 || (_config$locations7 = config.locations) === null || _config$locations7 === void 0 ? void 0 : _config$locations7.elementorLibrary),
521 - location_l1: this.toLowerSnake(libraryType),
522 - location_l2: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca5 = config.secondaryLocations) === null || _config$secondaryLoca5 === void 0 ? void 0 : _config$secondaryLoca5.assetCard),
523 - interaction_description: 'User inserts block/pages from elementor library',
524 - metadata: {
525 - template_id: String(assetId),
526 - template_name: this.decodeHtmlEntities(assetName) || ''
527 - }
528 - });
529 - if (proRequired) {
530 - payload.state = 'pro_plan_required';
531 - }
532 - 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);
533 - }
534 - }, {
535 - key: "sendELibraryFavorite",
536 - value: function sendELibraryFavorite(_ref3) {
537 - var _config$triggers6, _config$targetTypes7, _config$interactionRe7, _config$locations8, _config$secondaryLoca6, _config$names6;
538 - var assetId = _ref3.assetId,
539 - assetName = _ref3.assetName,
540 - libraryType = _ref3.libraryType,
541 - isFavorite = _ref3.isFavorite,
542 - _ref3$proRequired = _ref3.proRequired,
543 - proRequired = _ref3$proRequired === void 0 ? false : _ref3$proRequired;
544 - var config = this.getConfig();
545 - var payload = this.createBasePayload({
546 - interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers6 = config.triggers) === null || _config$triggers6 === void 0 ? void 0 : _config$triggers6.click),
547 - target_type: config === null || config === void 0 || (_config$targetTypes7 = config.targetTypes) === null || _config$targetTypes7 === void 0 ? void 0 : _config$targetTypes7.toggle,
548 - target_name: String(assetId),
549 - interaction_result: config === null || config === void 0 || (_config$interactionRe7 = config.interactionResults) === null || _config$interactionRe7 === void 0 ? void 0 : _config$interactionRe7.assetFavorite,
550 - target_value: Boolean(isFavorite),
551 - target_location: this.toLowerSnake(config === null || config === void 0 || (_config$locations8 = config.locations) === null || _config$locations8 === void 0 ? void 0 : _config$locations8.elementorLibrary),
552 - location_l1: this.toLowerSnake(libraryType),
553 - location_l2: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca6 = config.secondaryLocations) === null || _config$secondaryLoca6 === void 0 ? void 0 : _config$secondaryLoca6.assetCard),
554 - interaction_description: 'User favorite block/pages from elementor library',
555 - metadata: {
556 - template_id: String(assetId),
557 - template_name: this.decodeHtmlEntities(assetName) || ''
558 - }
559 - });
560 - if (proRequired) {
561 - payload.state = 'pro_plan_required';
562 - }
563 - 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);
564 - }
565 - }, {
566 - key: "sendELibraryGenerateAi",
567 - value: function sendELibraryGenerateAi(_ref4) {
568 - var _config$names7, _config$triggers7, _config$targetTypes8, _config$interactionRe8, _config$locations9, _config$secondaryLoca7;
569 - var assetId = _ref4.assetId,
570 - assetName = _ref4.assetName,
571 - libraryType = _ref4.libraryType;
572 - var config = this.getConfig();
573 - 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({
574 - interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers7 = config.triggers) === null || _config$triggers7 === void 0 ? void 0 : _config$triggers7.click),
575 - target_type: config === null || config === void 0 || (_config$targetTypes8 = config.targetTypes) === null || _config$targetTypes8 === void 0 ? void 0 : _config$targetTypes8.button,
576 - target_name: String(assetId),
577 - interaction_result: config === null || config === void 0 || (_config$interactionRe8 = config.interactionResults) === null || _config$interactionRe8 === void 0 ? void 0 : _config$interactionRe8.aiGenerate,
578 - target_location: this.toLowerSnake(config === null || config === void 0 || (_config$locations9 = config.locations) === null || _config$locations9 === void 0 ? void 0 : _config$locations9.elementorLibrary),
579 - location_l1: this.toLowerSnake(libraryType),
580 - location_l2: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca7 = config.secondaryLocations) === null || _config$secondaryLoca7 === void 0 ? void 0 : _config$secondaryLoca7.assetCard),
581 - interaction_description: 'User generated block/page based on a library asset',
582 - metadata: {
583 - template_id: String(assetId),
584 - template_name: this.decodeHtmlEntities(assetName) || ''
585 - }
586 - }));
587 - }
588 - }, {
589 - key: "sendFinderSearchInput",
590 - value: function sendFinderSearchInput(_ref5) {
591 - var _config$triggers8, _config$targetTypes9, _config$interactionRe9, _config$interactionRe0, _config$secondaryLoca8, _config$names8;
592 - var resultsCount = _ref5.resultsCount,
593 - _ref5$searchTerm = _ref5.searchTerm,
594 - searchTerm = _ref5$searchTerm === void 0 ? null : _ref5$searchTerm;
595 - var config = this.getConfig();
596 - var hasResults = resultsCount > 0;
597 - var finderContext = this.getFinderContext();
598 - var payload = this.createBasePayload({
599 - window_name: finderContext.windowName,
600 - interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers8 = config.triggers) === null || _config$triggers8 === void 0 ? void 0 : _config$triggers8.typing),
601 - target_type: config === null || config === void 0 || (_config$targetTypes9 = config.targetTypes) === null || _config$targetTypes9 === void 0 ? void 0 : _config$targetTypes9.searchInput,
602 - target_name: 'finder',
603 - 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,
604 - target_location: finderContext.targetLocation,
605 - location_l1: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca8 = config.secondaryLocations) === null || _config$secondaryLoca8 === void 0 ? void 0 : _config$secondaryLoca8.finder),
606 - interaction_description: 'Finder search input, follows debounce behavior',
607 - metadata: {
608 - results_count: resultsCount
609 - }
610 - });
611 - if (!hasResults && searchTerm) {
612 - payload.metadata.search_term = searchTerm;
613 - }
614 - 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);
615 - }
616 - }, {
617 - key: "sendFinderResultSelect",
618 - value: function sendFinderResultSelect(choice) {
619 - var _config$names9, _config$triggers9, _config$targetTypes0, _config$interactionRe1, _config$secondaryLoca9, _config$secondaryLoca0;
620 - var config = this.getConfig();
621 - var finderContext = this.getFinderContext();
622 - 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({
623 - window_name: finderContext.windowName,
624 - interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers9 = config.triggers) === null || _config$triggers9 === void 0 ? void 0 : _config$triggers9.click),
625 - target_type: config === null || config === void 0 || (_config$targetTypes0 = config.targetTypes) === null || _config$targetTypes0 === void 0 ? void 0 : _config$targetTypes0.searchResult,
626 - target_name: choice,
627 - interaction_result: config === null || config === void 0 || (_config$interactionRe1 = config.interactionResults) === null || _config$interactionRe1 === void 0 ? void 0 : _config$interactionRe1.selected,
628 - target_location: finderContext.targetLocation,
629 - location_l1: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca9 = config.secondaryLocations) === null || _config$secondaryLoca9 === void 0 ? void 0 : _config$secondaryLoca9.finder),
630 - location_l2: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca0 = config.secondaryLocations) === null || _config$secondaryLoca0 === void 0 ? void 0 : _config$secondaryLoca0.finderResults),
631 - interaction_description: 'Finder search results was selected'
632 - }));
633 - }
634 - }, {
635 - key: "sendCanvasEmptyBoxAction",
636 - value: function sendCanvasEmptyBoxAction(_ref6) {
637 - var _config$triggers0, _config$targetTypes1, _config$interactionRe10, _config$locations0, _config$secondaryLoca1, _config$names0;
638 - var targetName = _ref6.targetName,
639 - _ref6$metadata = _ref6.metadata,
640 - metadata = _ref6$metadata === void 0 ? {} : _ref6$metadata,
641 - _ref6$containerCreate = _ref6.containerCreated,
642 - containerCreated = _ref6$containerCreate === void 0 ? null : _ref6$containerCreate;
643 - var config = this.getConfig();
644 - var payload = this.createBasePayload({
645 - interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers0 = config.triggers) === null || _config$triggers0 === void 0 ? void 0 : _config$triggers0.click),
646 - target_type: config === null || config === void 0 || (_config$targetTypes1 = config.targetTypes) === null || _config$targetTypes1 === void 0 ? void 0 : _config$targetTypes1.buttons,
647 - target_name: targetName,
648 - interaction_result: config === null || config === void 0 || (_config$interactionRe10 = config.interactionResults) === null || _config$interactionRe10 === void 0 ? void 0 : _config$interactionRe10.selected,
649 - target_location: this.toLowerSnake(config === null || config === void 0 || (_config$locations0 = config.locations) === null || _config$locations0 === void 0 ? void 0 : _config$locations0.canvas),
650 - location_l1: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca1 = config.secondaryLocations) === null || _config$secondaryLoca1 === void 0 ? void 0 : _config$secondaryLoca1.emptyBox),
651 - interaction_description: 'Empty box on canvas actions'
652 - });
653 - if (Object.keys(metadata).length > 0) {
654 - payload.metadata = metadata;
655 - }
656 - if (containerCreated !== null) {
657 - payload.state = containerCreated;
658 - }
659 - 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);
660 - }
661 - }, {
662 - key: "sendWidgetPanelSearch",
663 - value: function sendWidgetPanelSearch(_ref7) {
664 - var _config$triggers1, _config$targetTypes10, _config$interactionRe11, _config$interactionRe12, _config$locations1, _config$locations10, _config$secondaryLoca10, _config$names1;
665 - var resultsCount = _ref7.resultsCount,
666 - _ref7$userInput = _ref7.userInput,
667 - userInput = _ref7$userInput === void 0 ? null : _ref7$userInput;
668 - var config = this.getConfig();
669 - var hasResults = resultsCount > 0;
670 - var payload = this.createBasePayload({
671 - interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers1 = config.triggers) === null || _config$triggers1 === void 0 ? void 0 : _config$triggers1.typing),
672 - target_type: config === null || config === void 0 || (_config$targetTypes10 = config.targetTypes) === null || _config$targetTypes10 === void 0 ? void 0 : _config$targetTypes10.searchWidget,
673 - target_name: 'search_widget',
674 - 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,
675 - target_location: this.toLowerSnake(config === null || config === void 0 || (_config$locations1 = config.locations) === null || _config$locations1 === void 0 ? void 0 : _config$locations1.leftPanel),
676 - location_l1: this.toLowerSnake(config === null || config === void 0 || (_config$locations10 = config.locations) === null || _config$locations10 === void 0 ? void 0 : _config$locations10.widgetPanel),
677 - location_l2: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca10 = config.secondaryLocations) === null || _config$secondaryLoca10 === void 0 ? void 0 : _config$secondaryLoca10.searchBar),
678 - interaction_description: 'Widget search input, follows debounce behavior'
679 - });
680 - if (!hasResults && userInput) {
681 - payload.metadata = {
682 - user_input: userInput
683 - };
684 - }
685 - return this.dispatchEvent(config === null || config === void 0 || (_config$names1 = config.names) === null || _config$names1 === void 0 || (_config$names1 = _config$names1.editorOne) === null || _config$names1 === void 0 ? void 0 : _config$names1.widgetPanelSearch, payload);
686 - }
687 - }]);
688 -}();
689 -var createDebouncedFinderSearch = exports.createDebouncedFinderSearch = function createDebouncedFinderSearch() {
690 - var delay = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 300;
691 - return _.debounce(function (resultsCount, searchTerm) {
692 - EditorOneEventManager.sendFinderSearchInput({
693 - resultsCount: resultsCount,
694 - searchTerm: searchTerm
695 - });
696 - }, delay);
697 -};
698 -var createDebouncedWidgetPanelSearch = exports.createDebouncedWidgetPanelSearch = function createDebouncedWidgetPanelSearch() {
699 - var delay = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 2000;
700 - return _.debounce(function (resultsCount, userInput) {
701 - EditorOneEventManager.sendWidgetPanelSearch({
702 - resultsCount: resultsCount,
703 - userInput: userInput
704 - });
705 - }, delay);
706 -};
707 -var _default = exports["default"] = EditorOneEventManager;
708 -
709 -/***/ }),
710 -
711 322 /***/ "../assets/dev/js/editor/utils/element-types.js":
712 323 /*!******************************************************!*\
713 324 !*** ../assets/dev/js/editor/utils/element-types.js ***!
714 325 \******************************************************/
@@ -783,12 +394,12 @@
783 394 };
784 395
785 396 /***/ }),
786 397
787 -/***/ "../modules/atomic-widgets/assets/js/editor/atomic-element-base-model.js":
788 -/*!*******************************************************************************!*\
789 - !*** ../modules/atomic-widgets/assets/js/editor/atomic-element-base-model.js ***!
790 - \*******************************************************************************/
398 +/***/ "../modules/atomic-widgets/assets/js/editor/atomic-element-model.js":
399 +/*!**************************************************************************!*\
400 + !*** ../modules/atomic-widgets/assets/js/editor/atomic-element-model.js ***!
401 + \**************************************************************************/
791 402 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
792 403
793 404 "use strict";
794 405
@@ -806,15 +417,15 @@
806 417 var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
807 418 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)); }
808 419 function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
809 420 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; }
810 -var AtomicElementBaseModel = exports["default"] = /*#__PURE__*/function (_elementor$modules$el) {
811 - function AtomicElementBaseModel() {
812 - (0, _classCallCheck2.default)(this, AtomicElementBaseModel);
813 - return _callSuper(this, AtomicElementBaseModel, arguments);
421 +var AtomicContainer = exports["default"] = /*#__PURE__*/function (_elementor$modules$el) {
422 + function AtomicContainer() {
423 + (0, _classCallCheck2.default)(this, AtomicContainer);
424 + return _callSuper(this, AtomicContainer, arguments);
814 425 }
815 - (0, _inherits2.default)(AtomicElementBaseModel, _elementor$modules$el);
816 - return (0, _createClass2.default)(AtomicElementBaseModel, [{
426 + (0, _inherits2.default)(AtomicContainer, _elementor$modules$el);
427 + return (0, _createClass2.default)(AtomicContainer, [{
817 428 key: "isValidChild",
818 429 value:
819 430 /**
820 431 * Do not allow section, column or container be placed in the Atomic container.
@@ -827,298 +438,48 @@
827 438 }
828 439 }, {
829 440 key: "initialize",
830 441 value: function initialize(attributes, options) {
831 - var _this$config;
832 442 var elementType = this.get('elType');
833 443 this.config = elementor.config.elements[elementType];
834 - if ((_this$config = this.config) !== null && _this$config !== void 0 && (_this$config = _this$config.meta) !== null && _this$config !== void 0 && _this$config.permanently_locked) {
835 - this.set('isLocked', true);
836 - }
837 444 var isNewElementCreate = 0 === this.get('elements').length && $e.commands.currentTrace.includes('document/elements/create');
838 445 if (isNewElementCreate) {
839 446 this.onElementCreate();
840 447 }
841 - _superPropGet(AtomicElementBaseModel, "initialize", this, 3)([attributes, options]);
448 + _superPropGet(AtomicContainer, "initialize", this, 3)([attributes, options]);
842 449 }
843 450 }, {
844 451 key: "getDefaultChildren",
845 452 value: function getDefaultChildren() {
846 453 var defaultChildren = this.config.default_children;
847 - return this.modifyDefaultChildren(defaultChildren);
454 + return defaultChildren.map(function (element) {
455 + return {
456 + elType: element.elType,
457 + widgetType: element.widgetType,
458 + id: elementorCommon.helpers.getUniqueId(),
459 + settings: element.settings || {},
460 + elements: element.elements || [],
461 + isLocked: element.isLocked || false
462 + };
463 + });
848 464 }
849 465 }, {
850 466 key: "onElementCreate",
851 467 value: function onElementCreate() {
852 - var _this = this;
853 - if (this.get('skipDefaultChildren')) {
854 - this.unset('skipDefaultChildren', {
855 - silent: true
856 - });
857 - return;
858 - }
859 - this.set('elements', this.getDefaultChildren().map(function (element) {
860 - return _this.buildElement(element);
861 - }));
468 + this.set('elements', this.getDefaultChildren());
862 469 }
863 - }, {
864 - key: "modifyDefaultChildren",
865 - value: function modifyDefaultChildren(element) {
866 - return element;
867 - }
868 - }, {
869 - key: "buildElement",
870 - value: function buildElement(element) {
871 - var _this2 = this,
872 - _element$settings;
873 - var id = elementorCommon.helpers.getUniqueId();
874 - var elements = (element.elements || []).map(function (el) {
875 - return _this2.buildElement(el);
876 - });
877 - return {
878 - elType: element.elType,
879 - widgetType: element.widgetType,
880 - id: id,
881 - settings: (_element$settings = element.settings) !== null && _element$settings !== void 0 ? _element$settings : {},
882 - elements: elements,
883 - isLocked: element.isLocked || false,
884 - editor_settings: element.editor_settings || {},
885 - meta: element.meta || {}
886 - };
887 - }
888 470 }]);
889 471 }(elementor.modules.elements.models.Element);
890 472
891 473 /***/ }),
892 474
893 -/***/ "../modules/atomic-widgets/assets/js/editor/atomic-element-base-type.js":
894 -/*!******************************************************************************!*\
895 - !*** ../modules/atomic-widgets/assets/js/editor/atomic-element-base-type.js ***!
896 - \******************************************************************************/
475 +/***/ "../modules/atomic-widgets/assets/js/editor/atomic-element-view.js":
476 +/*!*************************************************************************!*\
477 + !*** ../modules/atomic-widgets/assets/js/editor/atomic-element-view.js ***!
478 + \*************************************************************************/
897 479 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
898 480
899 481 "use strict";
900 -
901 -
902 -var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
903 -Object.defineProperty(exports, "__esModule", ({
904 - value: true
905 -}));
906 -exports["default"] = void 0;
907 -var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
908 -var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
909 -var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
910 -var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
911 -var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
912 -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)); }
913 -function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
914 -var AtomicElementBaseType = exports["default"] = /*#__PURE__*/function (_elementor$modules$el) {
915 - function AtomicElementBaseType(elementType, viewClass) {
916 - var _this;
917 - var modelClass = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
918 - var emptyViewClass = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
919 - (0, _classCallCheck2.default)(this, AtomicElementBaseType);
920 - _this = _callSuper(this, AtomicElementBaseType);
921 - _this.elementType = elementType;
922 - _this.viewClass = viewClass;
923 - _this.modelClass = modelClass;
924 - _this.emptyViewClass = emptyViewClass;
925 - return _this;
926 - }
927 - (0, _inherits2.default)(AtomicElementBaseType, _elementor$modules$el);
928 - return (0, _createClass2.default)(AtomicElementBaseType, [{
929 - key: "getType",
930 - value: function getType() {
931 - return this.elementType;
932 - }
933 - }, {
934 - key: "getView",
935 - value: function getView() {
936 - return this.viewClass;
937 - }
938 - }, {
939 - key: "getEmptyView",
940 - value: function getEmptyView() {
941 - return this.emptyViewClass || elementor.modules.elements.views.EmptyComponent;
942 - }
943 - }, {
944 - key: "getModel",
945 - value: function getModel() {
946 - return this.modelClass || elementor.modules.elements.models.AtomicElementBase;
947 - }
948 - }]);
949 -}(elementor.modules.elements.types.Base);
950 -
951 -/***/ }),
952 -
953 -/***/ "../modules/atomic-widgets/assets/js/editor/atomic-element-types/create-div-block-type.js":
954 -/*!************************************************************************************************!*\
955 - !*** ../modules/atomic-widgets/assets/js/editor/atomic-element-types/create-div-block-type.js ***!
956 - \************************************************************************************************/
957 -/***/ ((__unused_webpack_module, exports) => {
958 -
959 -"use strict";
960 -
961 -
962 -Object.defineProperty(exports, "__esModule", ({
963 - value: true
964 -}));
965 -exports["default"] = void 0;
966 -var createDivBlockType = function createDivBlockType() {
967 - var DivBlockView = elementor.modules.elements.views.createAtomicElementBase('e-div-block');
968 - return new elementor.modules.elements.types.AtomicElementBase('e-div-block', DivBlockView);
969 -};
970 -var _default = exports["default"] = createDivBlockType;
971 -
972 -/***/ }),
973 -
974 -/***/ "../modules/atomic-widgets/assets/js/editor/atomic-element-types/create-flexbox-type.js":
975 -/*!**********************************************************************************************!*\
976 - !*** ../modules/atomic-widgets/assets/js/editor/atomic-element-types/create-flexbox-type.js ***!
977 - \**********************************************************************************************/
978 -/***/ ((__unused_webpack_module, exports) => {
979 -
980 -"use strict";
981 -
982 -
983 -Object.defineProperty(exports, "__esModule", ({
984 - value: true
985 -}));
986 -exports["default"] = void 0;
987 -var createFlexboxType = function createFlexboxType() {
988 - var FlexboxView = elementor.modules.elements.views.createAtomicElementBase('e-flexbox');
989 - return new elementor.modules.elements.types.AtomicElementBase('e-flexbox', FlexboxView);
990 -};
991 -var _default = exports["default"] = createFlexboxType;
992 -
993 -/***/ }),
994 -
995 -/***/ "../modules/atomic-widgets/assets/js/editor/component.js":
996 -/*!***************************************************************!*\
997 - !*** ../modules/atomic-widgets/assets/js/editor/component.js ***!
998 - \***************************************************************/
999 -/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
1000 -
1001 -"use strict";
1002 -
1003 -
1004 -var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
1005 -var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ "../node_modules/@babel/runtime/helpers/typeof.js");
1006 -Object.defineProperty(exports, "__esModule", ({
1007 - value: true
1008 -}));
1009 -exports["default"] = void 0;
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 hooks = _interopRequireWildcard(__webpack_require__(/*! ./hooks */ "../modules/atomic-widgets/assets/js/editor/hooks/index.js"));
1016 -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); }
1017 -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)); }
1018 -function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
1019 -var Component = exports["default"] = /*#__PURE__*/function (_$e$modules$Component) {
1020 - function Component() {
1021 - (0, _classCallCheck2.default)(this, Component);
1022 - return _callSuper(this, Component, arguments);
1023 - }
1024 - (0, _inherits2.default)(Component, _$e$modules$Component);
1025 - return (0, _createClass2.default)(Component, [{
1026 - key: "getNamespace",
1027 - value: function getNamespace() {
1028 - return 'document/atomic-widgets';
1029 - }
1030 - }, {
1031 - key: "defaultHooks",
1032 - value: function defaultHooks() {
1033 - return this.importHooks(hooks);
1034 - }
1035 - }]);
1036 -}($e.modules.ComponentBase);
1037 -
1038 -/***/ }),
1039 -
1040 -/***/ "../modules/atomic-widgets/assets/js/editor/container/atomic-element-empty-view.js":
1041 -/*!*****************************************************************************************!*\
1042 - !*** ../modules/atomic-widgets/assets/js/editor/container/atomic-element-empty-view.js ***!
1043 - \*****************************************************************************************/
1044 -/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
1045 -
1046 -"use strict";
1047 -
1048 -
1049 -var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
1050 -Object.defineProperty(exports, "__esModule", ({
1051 - value: true
1052 -}));
1053 -exports["default"] = void 0;
1054 -var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react"));
1055 -var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
1056 -var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
1057 -var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
1058 -var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
1059 -var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
1060 -var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js"));
1061 -var _react2 = _interopRequireDefault(__webpack_require__(/*! elementor-utils/react */ "../assets/dev/js/utils/react.js"));
1062 -var _emptyComponent = _interopRequireDefault(__webpack_require__(/*! elementor-elements/views/container/empty-component */ "../assets/dev/js/editor/elements/views/container/empty-component.js"));
1063 -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)); }
1064 -function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
1065 -var AtomicElementEmptyView = exports["default"] = /*#__PURE__*/function (_Marionette$ItemView) {
1066 - function AtomicElementEmptyView() {
1067 - var _this;
1068 - (0, _classCallCheck2.default)(this, AtomicElementEmptyView);
1069 - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
1070 - args[_key] = arguments[_key];
1071 - }
1072 - _this = _callSuper(this, AtomicElementEmptyView, [].concat(args));
1073 - (0, _defineProperty2.default)(_this, "template", '<div></div>');
1074 - (0, _defineProperty2.default)(_this, "className", 'elementor-empty-view');
1075 - (0, _defineProperty2.default)(_this, "unmount", null);
1076 - return _this;
1077 - }
1078 - (0, _inherits2.default)(AtomicElementEmptyView, _Marionette$ItemView);
1079 - return (0, _createClass2.default)(AtomicElementEmptyView, [{
1080 - key: "renderReactDefaultElement",
1081 - value: function renderReactDefaultElement(container) {
1082 - var _ReactUtils$render = _react2.default.render(/*#__PURE__*/_react.default.createElement(_emptyComponent.default, {
1083 - container: container
1084 - }), this.el),
1085 - unmount = _ReactUtils$render.unmount;
1086 - this.unmount = unmount;
1087 - }
1088 - }, {
1089 - key: "onBeforeRender",
1090 - value: function onBeforeRender() {
1091 - // In case the element is being rendered again, we need to unmount the previous React component.
1092 - if (this.unmount) {
1093 - this.unmount();
1094 - this.unmount = null;
1095 - }
1096 - }
1097 - }, {
1098 - key: "onRender",
1099 - value: function onRender() {
1100 - this.$el.addClass(this.className);
1101 - this.renderReactDefaultElement();
1102 - }
1103 - }, {
1104 - key: "onDestroy",
1105 - value: function onDestroy() {
1106 - var _this$unmount;
1107 - (_this$unmount = this.unmount) === null || _this$unmount === void 0 || _this$unmount.call(this);
1108 - }
1109 - }]);
1110 -}(Marionette.ItemView);
1111 -
1112 -/***/ }),
1113 -
1114 -/***/ "../modules/atomic-widgets/assets/js/editor/create-atomic-element-base-view.js":
1115 -/*!*************************************************************************************!*\
1116 - !*** ../modules/atomic-widgets/assets/js/editor/create-atomic-element-base-view.js ***!
1117 - \*************************************************************************************/
1118 -/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
1119 -
1120 -"use strict";
1121 482 /* provided dependency */ var __ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n")["__"];
1122 483 /* provided dependency */ var sprintf = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n")["sprintf"];
1123 484
1124 485
@@ -1125,28 +486,28 @@
1125 486 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
1126 487 Object.defineProperty(exports, "__esModule", ({
1127 488 value: true
1128 489 }));
1129 -exports["default"] = createAtomicElementBaseView;
1130 -var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ "../node_modules/@babel/runtime/regenerator/index.js"));
1131 -var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "../node_modules/@babel/runtime/helpers/asyncToGenerator.js"));
490 +exports["default"] = createAtomicElementView;
491 +var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js"));
1132 492 var _toConsumableArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/toConsumableArray */ "../node_modules/@babel/runtime/helpers/toConsumableArray.js"));
1133 493 var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "../node_modules/@babel/runtime/helpers/slicedToArray.js"));
494 +var _atomicElementEmptyView = _interopRequireDefault(__webpack_require__(/*! ./container/atomic-element-empty-view */ "../modules/atomic-widgets/assets/js/editor/container/atomic-element-empty-view.js"));
1134 495 var _elementTypes = __webpack_require__(/*! elementor-editor/utils/element-types */ "../assets/dev/js/editor/utils/element-types.js");
1135 -var _atomicElementEmptyView = _interopRequireDefault(__webpack_require__(/*! ./container/atomic-element-empty-view */ "../modules/atomic-widgets/assets/js/editor/container/atomic-element-empty-view.js"));
496 +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; }
497 +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; }
1136 498 var BaseElementView = elementor.modules.elements.views.BaseElement;
1137 -function createAtomicElementBaseView(type) {
499 +function createAtomicElementView(type) {
1138 500 var AtomicElementView = BaseElementView.extend({
1139 501 template: Marionette.TemplateCache.get("#tmpl-elementor-".concat(type, "-content")),
1140 502 emptyView: _atomicElementEmptyView.default,
1141 - _childrenRenderPromises: [],
1142 - _createElement: function _createElement(tag) {
1143 - var _elementor$$preview;
1144 - 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;
1145 - if (previewDocument) {
1146 - return previewDocument.createElement(tag);
503 + tagName: function tagName() {
504 + if (this.haveLink()) {
505 + return 'a';
1147 506 }
1148 - return document.createElement(tag);
507 + var tagControl = this.model.getSetting('tag');
508 + var tagControlValue = (tagControl === null || tagControl === void 0 ? void 0 : tagControl.value) || tagControl;
509 + return tagControlValue || 'div';
1149 510 },
1150 511 getChildViewContainer: function getChildViewContainer() {
1151 512 this.childViewContainer = '';
1152 513 return Marionette.CompositeView.prototype.getChildViewContainer.apply(this, arguments);
@@ -1162,129 +523,141 @@
1162 523 return elType;
1163 524 });
1164 525 return ['widget', 'container'].concat((0, _toConsumableArray2.default)(atomicElements));
1165 526 },
1166 - getRenderContext: function getRenderContext() {
1167 - var _this$_parent, _this$_parent$getRend;
1168 - 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);
527 + className: function className() {
528 + return "".concat(BaseElementView.prototype.className.apply(this), " e-con e-atomic-element ").concat(this.getClassString());
1169 529 },
1170 - getResolverRenderContext: function getResolverRenderContext() {
1171 - var _this$_parent2, _this$_parent2$getRes;
1172 - 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);
530 + // TODO: Copied from `views/column.js`.
531 + ui: function ui() {
532 + var ui = BaseElementView.prototype.ui.apply(this, arguments);
533 + ui.percentsTooltip = '> .elementor-element-overlay .elementor-column-percents-tooltip';
534 + return ui;
1173 535 },
1174 - render: function render() {
1175 - var _this = this;
1176 - this._currentRenderPromise = new Promise(function (resolve) {
1177 - // Optimize rendering by reusing existing child views instead of recreating them.
1178 - if (_this._shouldSkipFullRender()) {
1179 - _this._renderWithoutDomRecreation(resolve);
1180 - } else {
1181 - _this._renderWithDomRecreation(resolve);
536 + attributes: function attributes() {
537 + var _this$model$getSettin, _this$model$getSettin2;
538 + var attr = BaseElementView.prototype.attributes.apply(this);
539 + var local = {};
540 + var cssId = this.model.getSetting('_cssid');
541 + var customAttributes = (_this$model$getSettin = (_this$model$getSettin2 = this.model.getSetting('attributes')) === null || _this$model$getSettin2 === void 0 ? void 0 : _this$model$getSettin2.value) !== null && _this$model$getSettin !== void 0 ? _this$model$getSettin : [];
542 + if (cssId) {
543 + local.id = cssId.value;
544 + }
545 + var href = this.getHref();
546 + if (href) {
547 + local.href = href;
548 + }
549 + customAttributes.forEach(function (attribute) {
550 + var _attribute$value, _attribute$value2;
551 + var key = (_attribute$value = attribute.value) === null || _attribute$value === void 0 || (_attribute$value = _attribute$value.key) === null || _attribute$value === void 0 ? void 0 : _attribute$value.value;
552 + var value = (_attribute$value2 = attribute.value) === null || _attribute$value2 === void 0 || (_attribute$value2 = _attribute$value2.value) === null || _attribute$value2 === void 0 ? void 0 : _attribute$value2.value;
553 + if (key && value) {
554 + local[key] = value;
1182 555 }
1183 556 });
1184 - return this;
557 + return _objectSpread(_objectSpread({}, attr), local);
1185 558 },
1186 - _shouldSkipFullRender: function _shouldSkipFullRender() {
1187 - return this.isRendered && this._hasConnectedChildren();
559 + // TODO: Copied from `views/column.js`.
560 + attachElContent: function attachElContent() {
561 + BaseElementView.prototype.attachElContent.apply(this, arguments);
562 + var $tooltip = jQuery('<div>', {
563 + class: 'elementor-column-percents-tooltip',
564 + 'data-side': elementorCommon.config.isRTL ? 'right' : 'left'
565 + });
566 + this.$el.children('.elementor-element-overlay').append($tooltip);
1188 567 },
1189 - _hasConnectedChildren: function _hasConnectedChildren() {
1190 - var _this$children, _firstChild$$el$get$i, _firstChild$$el;
1191 - if (!((_this$children = this.children) !== null && _this$children !== void 0 && _this$children.length)) {
1192 - return false;
568 + // TODO: Copied from `views/column.js`.
569 + getPercentSize: function getPercentSize(size) {
570 + if (!size) {
571 + size = this.el.getBoundingClientRect().width;
1193 572 }
1194 -
1195 - // If the parent's innerHTML was replaced, all children are detached together.
1196 - var firstChild = this.children.findByIndex(0);
1197 - 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;
573 + return +(size / this.$el.parent().width() * 100).toFixed(3);
1198 574 },
1199 - _renderWithoutDomRecreation: function _renderWithoutDomRecreation(resolve) {
1200 - var _this2 = this;
1201 - this._beforeRender();
1202 - this._renderChildren();
1203 - this._waitForChildrenToComplete().then(function () {
1204 - _this2._afterRender();
1205 - resolve();
1206 - });
575 + // TODO: Copied from `views/column.js`.
576 + getPercentsForDisplay: function getPercentsForDisplay() {
577 + var width = +this.model.getSetting('width') || this.getPercentSize();
578 + return width.toFixed(1) + '%';
1207 579 },
1208 - _renderWithDomRecreation: function _renderWithDomRecreation(resolve) {
1209 - BaseElementView.prototype.render.apply(this, arguments);
1210 - this._waitForChildrenToComplete().then(function () {
1211 - resolve();
580 + renderOnChange: function renderOnChange(settings) {
581 + var _this = this;
582 + var changed = settings.changedAttributes();
583 + setTimeout(function () {
584 + _this.updateHandlesPosition();
1212 585 });
1213 - },
1214 - _beforeRender: function _beforeRender() {
1215 - this._isRendering = true;
1216 - this.triggerMethod('before:render', this);
1217 - },
1218 - _afterRender: function _afterRender() {
1219 - this._isRendering = false;
1220 - this.isRendered = true;
1221 - this.triggerMethod('render', this);
1222 - },
1223 - _waitForChildrenToComplete: function _waitForChildrenToComplete() {
1224 - var _this3 = this;
1225 - return (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee() {
1226 - return _regenerator.default.wrap(function (_context) {
1227 - while (1) switch (_context.prev = _context.next) {
1228 - case 0:
1229 - if (!(_this3._childrenRenderPromises.length > 0)) {
1230 - _context.next = 1;
1231 - break;
1232 - }
1233 - _context.next = 1;
1234 - return Promise.all(_this3._childrenRenderPromises);
1235 - case 1:
1236 - case "end":
1237 - return _context.stop();
586 + if (!changed) {
587 + return;
588 + }
589 + BaseElementView.prototype.renderOnChange.apply(this, settings);
590 + if (changed.attributes) {
591 + var _this$model$getSettin3;
592 + var preserveAttrs = ['id', 'class', 'href'];
593 + var $elAttrs = this.$el[0].attributes;
594 + for (var i = $elAttrs.length - 1; i >= 0; i--) {
595 + var attrName = $elAttrs[i].name;
596 + if (!preserveAttrs.includes(attrName)) {
597 + this.$el.removeAttr(attrName);
1238 598 }
1239 - }, _callee);
1240 - }))();
1241 - },
1242 - _renderChildren: function _renderChildren() {
1243 - if (this._shouldSkipFullRender()) {
1244 - var _this$children2;
1245 - (_this$children2 = this.children) === null || _this$children2 === void 0 || _this$children2.each(function (childView) {
1246 - return childView.render();
599 + }
600 + var attrs = ((_this$model$getSettin3 = this.model.getSetting('attributes')) === null || _this$model$getSettin3 === void 0 ? void 0 : _this$model$getSettin3.value) || [];
601 + attrs.forEach(function (attribute) {
602 + var _attribute$value3, _attribute$value4;
603 + var key = attribute === null || attribute === void 0 || (_attribute$value3 = attribute.value) === null || _attribute$value3 === void 0 || (_attribute$value3 = _attribute$value3.key) === null || _attribute$value3 === void 0 ? void 0 : _attribute$value3.value;
604 + var value = attribute === null || attribute === void 0 || (_attribute$value4 = attribute.value) === null || _attribute$value4 === void 0 || (_attribute$value4 = _attribute$value4.value) === null || _attribute$value4 === void 0 ? void 0 : _attribute$value4.value;
605 + if (key && value) {
606 + _this.$el.attr(key, value);
607 + }
1247 608 });
1248 - } else {
1249 - BaseElementView.prototype._renderChildren.apply(this, arguments);
609 + return;
1250 610 }
1251 - this._collectChildrenRenderPromises();
611 + if (changed.classes) {
612 + this.$el.attr('class', this.className());
613 + return;
614 + }
615 + if (changed._cssid) {
616 + if (changed._cssid.value) {
617 + this.$el.attr('id', changed._cssid.value);
618 + } else {
619 + this.$el.removeAttr('id');
620 + }
621 + return;
622 + }
623 + this.$el.addClass(this.getClasses());
624 + if (this.isTagChanged(changed)) {
625 + this.rerenderEntireView();
626 + }
1252 627 },
1253 - _collectChildrenRenderPromises: function _collectChildrenRenderPromises() {
1254 - var _this$children3,
1255 - _this4 = this;
1256 - this._childrenRenderPromises = [];
1257 - (_this$children3 = this.children) === null || _this$children3 === void 0 || _this$children3.each(function (childView) {
1258 - if (childView._currentRenderPromise) {
1259 - _this4._childrenRenderPromises.push(childView._currentRenderPromise);
1260 - }
1261 - });
628 + isTagChanged: function isTagChanged(changed) {
629 + return ((changed === null || changed === void 0 ? void 0 : changed.tag) !== undefined || (changed === null || changed === void 0 ? void 0 : changed.link) !== undefined) && this._parent && this.tagName() !== this.el.tagName;
1262 630 },
631 + rerenderEntireView: function rerenderEntireView() {
632 + var parent = this._parent;
633 + this._parent.removeChildView(this);
634 + parent.addChild(this.model, AtomicElementView, this._index);
635 + },
1263 636 onRender: function onRender() {
1264 - var _this5 = this;
1265 - this.dispatchPreviewEvent('elementor/element/render');
637 + var _this2 = this;
1266 638 BaseElementView.prototype.onRender.apply(this, arguments);
1267 639
1268 640 // Defer to wait for everything to render.
1269 641 setTimeout(function () {
1270 - _this5.droppableInitialize();
1271 - _this5.updateHandlesPosition();
642 + _this2.droppableInitialize();
643 + _this2.updateHandlesPosition();
1272 644 });
1273 645 },
1274 - onDestroy: function onDestroy() {
1275 - BaseElementView.prototype.onDestroy.apply(this, arguments);
1276 - this.dispatchPreviewEvent('elementor/element/destroy');
646 + haveLink: function haveLink() {
647 + var _this$model$getSettin4;
648 + return !!((_this$model$getSettin4 = this.model.getSetting('link')) !== null && _this$model$getSettin4 !== void 0 && (_this$model$getSettin4 = _this$model$getSettin4.value) !== null && _this$model$getSettin4 !== void 0 && (_this$model$getSettin4 = _this$model$getSettin4.destination) !== null && _this$model$getSettin4 !== void 0 && _this$model$getSettin4.value);
1277 649 },
1278 - dispatchPreviewEvent: function dispatchPreviewEvent(eventType) {
1279 - var _elementor;
1280 - (_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, {
1281 - detail: {
1282 - id: this.model.get('id'),
1283 - type: this.model.get('elType'),
1284 - element: this.getDomElement().get(0)
1285 - }
1286 - }));
650 + getHref: function getHref() {
651 + if (!this.haveLink()) {
652 + return;
653 + }
654 + var _this$model$getSettin5 = this.model.getSetting('link').value.destination,
655 + $$type = _this$model$getSettin5.$$type,
656 + value = _this$model$getSettin5.value;
657 + var isPostId = 'number' === $$type;
658 + var hrefPrefix = isPostId ? elementor.config.home_url + '/?p=' : '';
659 + return hrefPrefix + value;
1287 660 },
1288 661 droppableInitialize: function droppableInitialize() {
1289 662 this.$el.html5Droppable(this.getDroppableOptions());
1290 663 },
@@ -1293,37 +666,27 @@
1293 666 *
1294 667 * @return {Object} groups
1295 668 */
1296 669 getContextMenuGroups: function getContextMenuGroups() {
1297 - var _this6 = this,
670 + var _this3 = this,
1298 671 _elementorCommon$conf;
1299 672 var saveActions = [{
1300 673 name: 'save',
1301 674 title: __('Save as a template', 'elementor'),
675 + shortcut: "<span class=\"elementor-context-menu-list__item__shortcut__new-badge\">".concat(__('New', 'elementor'), "</span>"),
1302 676 callback: this.saveAsTemplate.bind(this),
1303 677 isEnabled: function isEnabled() {
1304 - return !_this6.getContainer().isLocked();
678 + return !_this3.getContainer().isLocked();
1305 679 }
1306 680 }];
1307 - var isAdministrator = elementor.config.user.is_administrator;
1308 - var isExperimentalFeaturesEnabled = (_elementorCommon$conf = elementorCommon.config.experimentalFeatures) === null || _elementorCommon$conf === void 0 ? void 0 : _elementorCommon$conf.e_components;
1309 - if (isExperimentalFeaturesEnabled && isAdministrator) {
1310 - 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;
1311 - 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;
1312 - 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;
1313 - 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);
1314 - var showPromoBadge = !isProActive && !isProOutdated;
1315 - var newBadge = "<span class=\"elementor-context-menu-list__item__shortcut__new-badge\">".concat(__('New', 'elementor'), "</span>");
1316 - var badgeClass = 'elementor-context-menu-list__item__shortcut__promotion-badge';
1317 - 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>");
681 + if ((_elementorCommon$conf = elementorCommon.config.experimentalFeatures) !== null && _elementorCommon$conf !== void 0 && _elementorCommon$conf.e_components) {
1318 682 saveActions.unshift({
1319 683 name: 'save-component',
1320 - title: __('Create component', 'elementor'),
1321 - shortcut: isProActive || isProOutdated ? newBadge : proBadge,
1322 - hasShortcutAction: showPromoBadge,
684 + title: __('Save as a component', 'elementor'),
685 + shortcut: "<span class=\"elementor-context-menu-list__item__shortcut__new-badge\">".concat(__('New', 'elementor'), "</span>"),
1323 686 callback: this.saveAsComponent.bind(this),
1324 687 isEnabled: function isEnabled() {
1325 - return (isProActive || isProOutdated) && !_this6.getContainer().isLocked();
688 + return !_this3.getContainer().isLocked();
1326 689 }
1327 690 });
1328 691 }
1329 692 var groups = BaseElementView.prototype.getContextMenuGroups.apply(this, arguments),
@@ -1336,39 +699,13 @@
1336 699 });
1337 700 return groups;
1338 701 },
1339 702 saveAsTemplate: function saveAsTemplate() {
1340 - elementor.templates.eventManager.sendNewSaveTemplateClickedEvent();
1341 703 $e.route('library/save-template', {
1342 704 model: this.model
1343 705 });
1344 706 },
1345 - saveAsComponent: function saveAsComponent(openContextMenuEvent, options) {
1346 - 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;
1347 - 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;
1348 - 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);
1349 - if (isProOutdated) {
1350 - var _window$elementorV6, _window$elementorV6$n;
1351 - (_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, {
1352 - type: 'info',
1353 - id: 'component-create-update',
1354 - message: __('To create new components, update Elementor Pro to the latest version.', 'elementor'),
1355 - additionalActionProps: [{
1356 - size: 'small',
1357 - variant: 'contained',
1358 - color: 'info',
1359 - href: '/wp-admin/plugins.php',
1360 - target: '_blank',
1361 - children: __('Update Now', 'elementor')
1362 - }]
1363 - });
1364 - return;
1365 - }
1366 - 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;
1367 - if (!isProActive) {
1368 - return;
1369 - }
1370 -
707 + saveAsComponent: function saveAsComponent(openContextMenuEvent) {
1371 708 // Calculate the absolute position where the context menu was opened.
1372 709 var openMenuOriginalEvent = openContextMenuEvent.originalEvent;
1373 710 var iframeRect = elementor.$preview[0].getBoundingClientRect();
1374 711 var anchorPosition = {
@@ -1376,18 +713,15 @@
1376 713 top: openMenuOriginalEvent.clientY + iframeRect.top
1377 714 };
1378 715 window.dispatchEvent(new CustomEvent('elementor/editor/open-save-as-component-form', {
1379 716 detail: {
1380 - element: elementor.getContainer(this.model.id).model.toJSON({
1381 - remove: ['default']
1382 - }),
1383 - anchorPosition: anchorPosition,
1384 - options: options
717 + element: elementor.getContainer(this.model.id),
718 + anchorPosition: anchorPosition
1385 719 }
1386 720 }));
1387 721 },
1388 722 isDroppingAllowed: function isDroppingAllowed() {
1389 - return this.getContainer().isEditable();
723 + return true;
1390 724 },
1391 725 behaviors: function behaviors() {
1392 726 var behaviors = BaseElementView.prototype.behaviors.apply(this, arguments);
1393 727 _.extend(behaviors, {
@@ -1406,9 +740,9 @@
1406 740 preventInit: true
1407 741 };
1408 742 },
1409 743 getDroppableOptions: function getDroppableOptions() {
1410 - var _this7 = this;
744 + var _this4 = this;
1411 745 var items = '> .elementor-element, > .elementor-empty-view .elementor-first-add';
1412 746 return {
1413 747 axis: null,
1414 748 items: items,
@@ -1418,9 +752,9 @@
1418 752 currentElementClass: 'elementor-html5dnd-current-element',
1419 753 placeholderClass: 'elementor-sortable-placeholder elementor-widget-placeholder',
1420 754 hasDraggingOnChildClass: 'e-dragging-over',
1421 755 getDropContainer: function getDropContainer() {
1422 - return _this7.getContainer();
756 + return _this4.getContainer();
1423 757 },
1424 758 onDropping: function onDropping(side, event) {
1425 759 event.stopPropagation();
1426 760
@@ -1430,41 +764,25 @@
1430 764 draggedElement = draggedView === null || draggedView === void 0 ? void 0 : draggedView.getContainer().view.el,
1431 765 containerElement = event.currentTarget.parentElement,
1432 766 elements = Array.from((containerElement === null || containerElement === void 0 ? void 0 : containerElement.querySelectorAll(':scope > .elementor-element')) || []);
1433 767 var targetIndex = elements.indexOf(event.currentTarget);
1434 - if (_this7.isPanelElement(draggedView, draggedElement)) {
1435 - var _elementorCommon;
1436 - if (_this7.draggingOnBottomOrRightSide(side) && !_this7.emptyViewIsCurrentlyBeingDraggedOver()) {
768 + if (_this4.isPanelElement(draggedView, draggedElement)) {
769 + if (_this4.draggingOnBottomOrRightSide(side) && !_this4.emptyViewIsCurrentlyBeingDraggedOver()) {
1437 770 targetIndex++;
1438 771 }
1439 - _this7.onDrop(event, {
772 + _this4.onDrop(event, {
1440 773 at: targetIndex
1441 774 });
1442 - if ((_elementorCommon = elementorCommon) !== null && _elementorCommon !== void 0 && (_elementorCommon = _elementorCommon.eventsManager) !== null && _elementorCommon !== void 0 && _elementorCommon.dispatchEvent) {
1443 - var selectedElement = elementor.channels.panelElements.request('element:selected');
1444 - if (selectedElement) {
1445 - var _selectedElement$mode, _selectedElement$mode2, _selectedElement$mode3, _selectedElement$mode4;
1446 - var elType = (_selectedElement$mode = (_selectedElement$mode2 = selectedElement.model) === null || _selectedElement$mode2 === void 0 ? void 0 : _selectedElement$mode2.get('elType')) !== null && _selectedElement$mode !== void 0 ? _selectedElement$mode : '';
1447 - var widgetType = (_selectedElement$mode3 = (_selectedElement$mode4 = selectedElement.model) === null || _selectedElement$mode4 === void 0 ? void 0 : _selectedElement$mode4.get('widgetType')) !== null && _selectedElement$mode3 !== void 0 ? _selectedElement$mode3 : '';
1448 - var elementName = 'widget' === elType ? widgetType : elType;
1449 - elementorCommon.eventsManager.dispatchEvent('add_element', {
1450 - location: 'editor_panel',
1451 - element_name: elementName,
1452 - element_type: elType,
1453 - widget_type: widgetType
1454 - });
1455 - }
1456 - }
1457 775 return;
1458 776 }
1459 - if (_this7.isParentElement(draggedView.getContainer().id)) {
777 + if (_this4.isParentElement(draggedView.getContainer().id)) {
1460 778 return;
1461 779 }
1462 - if (_this7.emptyViewIsCurrentlyBeingDraggedOver()) {
1463 - _this7.moveDroppedItem(draggedView, 0);
780 + if (_this4.emptyViewIsCurrentlyBeingDraggedOver()) {
781 + _this4.moveDroppedItem(draggedView, 0);
1464 782 return;
1465 783 }
1466 - _this7.moveExistingElement(side, draggedView, containerElement, elements, targetIndex, draggedElement);
784 + _this4.moveExistingElement(side, draggedView, containerElement, elements, targetIndex, draggedElement);
1467 785 }
1468 786 };
1469 787 },
1470 788 moveExistingElement: function moveExistingElement(side, draggedView, containerElement, elements, targetIndex, draggedElement) {
@@ -1582,8 +900,26 @@
1582 900 });
1583 901 });
1584 902 this.addSectionView = addSectionView;
1585 903 },
904 + getClasses: function getClasses() {
905 + var _window, _window$get, _this$options;
906 + var transformer = (_window = window) === null || _window === void 0 || (_window = _window.elementorV2) === null || _window === void 0 || (_window = _window.editorCanvas) === null || _window === void 0 || (_window = _window.settingsTransformersRegistry) === null || _window === void 0 || (_window$get = _window.get) === null || _window$get === void 0 ? void 0 : _window$get.call(_window, 'classes');
907 + if (!transformer) {
908 + return [];
909 + }
910 + return transformer(((_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) || []);
911 + },
912 + getClassString: function getClassString() {
913 + var classes = this.getClasses();
914 + var base = this.getBaseClass();
915 + return [base].concat((0, _toConsumableArray2.default)(classes)).join(' ');
916 + },
917 + getBaseClass: function getBaseClass() {
918 + var _this$options2, _Object$keys$;
919 + var baseStyles = elementor.helpers.getAtomicWidgetBaseStyles((_this$options2 = this.options) === null || _this$options2 === void 0 ? void 0 : _this$options2.model);
920 + return (_Object$keys$ = Object.keys(baseStyles !== null && baseStyles !== void 0 ? baseStyles : {})[0]) !== null && _Object$keys$ !== void 0 ? _Object$keys$ : '';
921 + },
1586 922 isOverflowHidden: function isOverflowHidden() {
1587 923 var elementStyles = window.getComputedStyle(this.el);
1588 924 var overflowStyles = [elementStyles.overflowX, elementStyles.overflowY, elementStyles.overflow];
1589 925 return overflowStyles.includes('hidden') || overflowStyles.includes('auto');
@@ -1603,17 +939,9 @@
1603 939 isTopLevelElement: function isTopLevelElement() {
1604 940 return this.container.parent && 'document' === this.container.parent.id;
1605 941 },
1606 942 isFirstElementInStructure: function isFirstElementInStructure() {
1607 - if (!this.model.collection) {
1608 - return true;
1609 - }
1610 943 return 0 === this.model.collection.indexOf(this.model);
1611 - },
1612 - getInteractionId: function getInteractionId() {
1613 - var originId = this.model.get('originId');
1614 - var id = this.model.get('id');
1615 - return originId !== null && originId !== void 0 ? originId : id;
1616 944 }
1617 945 });
1618 946 return AtomicElementView;
1619 947 }
@@ -1619,8 +947,116 @@
1619 947 }
1620 948
1621 949 /***/ }),
1622 950
951 +/***/ "../modules/atomic-widgets/assets/js/editor/component.js":
952 +/*!***************************************************************!*\
953 + !*** ../modules/atomic-widgets/assets/js/editor/component.js ***!
954 + \***************************************************************/
955 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
956 +
957 +"use strict";
958 +
959 +
960 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
961 +var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ "../node_modules/@babel/runtime/helpers/typeof.js");
962 +Object.defineProperty(exports, "__esModule", ({
963 + value: true
964 +}));
965 +exports["default"] = void 0;
966 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
967 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
968 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
969 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
970 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
971 +var hooks = _interopRequireWildcard(__webpack_require__(/*! ./hooks */ "../modules/atomic-widgets/assets/js/editor/hooks/index.js"));
972 +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); }
973 +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)); }
974 +function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
975 +var Component = exports["default"] = /*#__PURE__*/function (_$e$modules$Component) {
976 + function Component() {
977 + (0, _classCallCheck2.default)(this, Component);
978 + return _callSuper(this, Component, arguments);
979 + }
980 + (0, _inherits2.default)(Component, _$e$modules$Component);
981 + return (0, _createClass2.default)(Component, [{
982 + key: "getNamespace",
983 + value: function getNamespace() {
984 + return 'document/atomic-widgets';
985 + }
986 + }, {
987 + key: "defaultHooks",
988 + value: function defaultHooks() {
989 + return this.importHooks(hooks);
990 + }
991 + }]);
992 +}($e.modules.ComponentBase);
993 +
994 +/***/ }),
995 +
996 +/***/ "../modules/atomic-widgets/assets/js/editor/container/atomic-element-empty-view.js":
997 +/*!*****************************************************************************************!*\
998 + !*** ../modules/atomic-widgets/assets/js/editor/container/atomic-element-empty-view.js ***!
999 + \*****************************************************************************************/
1000 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
1001 +
1002 +"use strict";
1003 +
1004 +
1005 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
1006 +Object.defineProperty(exports, "__esModule", ({
1007 + value: true
1008 +}));
1009 +exports["default"] = void 0;
1010 +var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react"));
1011 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
1012 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
1013 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
1014 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
1015 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
1016 +var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js"));
1017 +var _react2 = _interopRequireDefault(__webpack_require__(/*! elementor-utils/react */ "../assets/dev/js/utils/react.js"));
1018 +var _emptyComponent = _interopRequireDefault(__webpack_require__(/*! elementor-elements/views/container/empty-component */ "../assets/dev/js/editor/elements/views/container/empty-component.js"));
1019 +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)); }
1020 +function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
1021 +var AtomicElementEmptyView = exports["default"] = /*#__PURE__*/function (_Marionette$ItemView) {
1022 + function AtomicElementEmptyView() {
1023 + var _this;
1024 + (0, _classCallCheck2.default)(this, AtomicElementEmptyView);
1025 + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
1026 + args[_key] = arguments[_key];
1027 + }
1028 + _this = _callSuper(this, AtomicElementEmptyView, [].concat(args));
1029 + (0, _defineProperty2.default)(_this, "template", '<div></div>');
1030 + (0, _defineProperty2.default)(_this, "className", 'elementor-empty-view');
1031 + return _this;
1032 + }
1033 + (0, _inherits2.default)(AtomicElementEmptyView, _Marionette$ItemView);
1034 + return (0, _createClass2.default)(AtomicElementEmptyView, [{
1035 + key: "renderReactDefaultElement",
1036 + value: function renderReactDefaultElement(container) {
1037 + var _ReactUtils$render = _react2.default.render(/*#__PURE__*/_react.default.createElement(_emptyComponent.default, {
1038 + container: container
1039 + }), this.el),
1040 + unmount = _ReactUtils$render.unmount;
1041 + this.unmount = unmount;
1042 + }
1043 + }, {
1044 + key: "onRender",
1045 + value: function onRender() {
1046 + this.$el.addClass(this.className);
1047 + this.renderReactDefaultElement();
1048 + }
1049 + }, {
1050 + key: "onDestroy",
1051 + value: function onDestroy() {
1052 + this.unmount();
1053 + }
1054 + }]);
1055 +}(Marionette.ItemView);
1056 +
1057 +/***/ }),
1058 +
1623 1059 /***/ "../modules/atomic-widgets/assets/js/editor/hooks/data/regenerate-local-style-ids/duplicate-element.js":
1624 1060 /*!*************************************************************************************************************!*\
1625 1061 !*** ../modules/atomic-widgets/assets/js/editor/hooks/data/regenerate-local-style-ids/duplicate-element.js ***!
1626 1062 \*************************************************************************************************************/
@@ -1817,13 +1253,25 @@
1817 1253 value: true
1818 1254 }));
1819 1255 exports.getElementChildren = getElementChildren;
1820 1256 var _toConsumableArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/toConsumableArray */ "../node_modules/@babel/runtime/helpers/toConsumableArray.js"));
1257 +/**
1258 + * @typedef {import('assets/dev/js/editor/container/container')} Container
1259 + */
1260 +
1261 +/**
1262 + * return all recursively nested elements in a flat array
1263 + *
1264 + * @param {Container} model
1265 + * @return {Container[]}
1266 + */
1821 1267 function getElementChildren(model) {
1822 - var _model$get$models, _model$get;
1823 - var childModels = (_model$get$models = model === null || model === void 0 || (_model$get = model.get('elements')) === null || _model$get === void 0 ? void 0 : _model$get.models) !== null && _model$get$models !== void 0 ? _model$get$models : [];
1824 - var children = childModels.flatMap(getElementChildren);
1825 - return [model].concat((0, _toConsumableArray2.default)(children));
1268 + var _flatMap, _container$model$get$, _container$model;
1269 + var container = window.elementor.getContainer(model.id);
1270 + var children = (_flatMap = ((_container$model$get$ = (_container$model = container.model) === null || _container$model === void 0 || (_container$model = _container$model.get('elements')) === null || _container$model === void 0 ? void 0 : _container$model.models) !== null && _container$model$get$ !== void 0 ? _container$model$get$ : []).flatMap(function (child) {
1271 + return getElementChildren(child);
1272 + })) !== null && _flatMap !== void 0 ? _flatMap : [];
1273 + return [container].concat((0, _toConsumableArray2.default)(children));
1826 1274 }
1827 1275
1828 1276 /***/ }),
1829 1277
@@ -1879,35 +1327,38 @@
1879 1327 var _getElementChildren = __webpack_require__(/*! ./get-element-children */ "../modules/atomic-widgets/assets/js/editor/utils/get-element-children.js");
1880 1328 var _getRandomStyleId = __webpack_require__(/*! ./get-random-style-id */ "../modules/atomic-widgets/assets/js/editor/utils/get-random-style-id.js");
1881 1329 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; }
1882 1330 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; }
1883 -function regenerateLocalStyleIds(container) {
1884 - var allElements = (0, _getElementChildren.getElementChildren)(container.model);
1885 - var styledElements = allElements.filter(function (model) {
1886 - var _model$get;
1887 - return Object.keys((_model$get = model.get('styles')) !== null && _model$get !== void 0 ? _model$get : {}).length > 0;
1888 - });
1889 - updateElementsStyleIdsInsideOut(styledElements);
1890 -}
1331 +/**
1332 + * @typedef {import('assets/dev/js/editor/container/container')} Container
1333 + */
1334 +
1891 1335 function isClassesProp(prop) {
1892 1336 return prop.$$type && 'classes' === prop.$$type && Array.isArray(prop.value) && prop.value.length > 0;
1893 1337 }
1894 -function calculateNewStylesAndSettings(element, model, settings) {
1895 - var _settings$toJSON;
1896 - var originalStyles = model.get('styles');
1897 - var settingsJson = (_settings$toJSON = settings === null || settings === void 0 ? void 0 : settings.toJSON()) !== null && _settings$toJSON !== void 0 ? _settings$toJSON : {};
1898 - var classesProps = Object.entries(settingsJson).filter(function (_ref) {
1338 +
1339 +/**
1340 + * Update the style id of the container.
1341 + *
1342 + * @param {Container} container
1343 + */
1344 +function updateStyleId(container) {
1345 + var _container$settings$t, _container$settings;
1346 + var originalStyles = container.model.get('styles');
1347 + var settings = (_container$settings$t = (_container$settings = container.settings) === null || _container$settings === void 0 ? void 0 : _container$settings.toJSON()) !== null && _container$settings$t !== void 0 ? _container$settings$t : {};
1348 + var classesProps = Object.entries(settings).filter(function (_ref) {
1899 1349 var _ref2 = (0, _slicedToArray2.default)(_ref, 2),
1900 1350 propValue = _ref2[1];
1901 1351 return isClassesProp(propValue);
1902 1352 });
1903 1353 var newStyles = {};
1904 - var changedIds = {};
1354 + var changedIds = {}; // Conversion map - {[originalId: string]: newId: string}
1355 +
1905 1356 Object.entries(originalStyles).forEach(function (_ref3) {
1906 1357 var _ref4 = (0, _slicedToArray2.default)(_ref3, 2),
1907 1358 originalStyleId = _ref4[0],
1908 1359 style = _ref4[1];
1909 - var newStyleId = (0, _getRandomStyleId.getRandomStyleId)(element, newStyles);
1360 + var newStyleId = (0, _getRandomStyleId.getRandomStyleId)(container, newStyles);
1910 1361 newStyles[newStyleId] = structuredClone(_objectSpread(_objectSpread({}, style), {}, {
1911 1362 id: newStyleId
1912 1363 }));
1913 1364 changedIds[originalStyleId] = newStyleId;
@@ -1922,59 +1373,35 @@
1922 1373 return (_changedIds$className = changedIds[className]) !== null && _changedIds$className !== void 0 ? _changedIds$className : className;
1923 1374 })
1924 1375 })];
1925 1376 }, {});
1926 - return {
1927 - newStyles: newStyles,
1928 - newSettings: Object.fromEntries(newClassesProps)
1929 - };
1930 -}
1931 -function updateStyleIdForContainer(container) {
1932 - var model = container.model,
1933 - settings = container.settings;
1934 - var _calculateNewStylesAn = calculateNewStylesAndSettings(container, model, settings),
1935 - newStyles = _calculateNewStylesAn.newStyles,
1936 - newSettings = _calculateNewStylesAn.newSettings;
1377 +
1378 + // Update classes array
1937 1379 $e.internal('document/elements/set-settings', {
1938 1380 container: container,
1939 - settings: newSettings
1381 + settings: Object.fromEntries(newClassesProps)
1940 1382 });
1941 - model.set('styles', newStyles);
1942 -}
1943 -function updateStyleIdForModel(model) {
1944 - var settings = model.get('settings');
1945 - var _calculateNewStylesAn2 = calculateNewStylesAndSettings(model, model, settings),
1946 - newStyles = _calculateNewStylesAn2.newStyles,
1947 - newSettings = _calculateNewStylesAn2.newSettings;
1948 - settings.set(newSettings);
1949 - model.set('styles', newStyles);
1950 -}
1951 -function updateStyleId(model) {
1952 - var container = window.elementor.getContainer(model.get('id'));
1953 1383
1954 - // If view exists, update the styles via the container
1955 - if (container) {
1956 - updateStyleIdForContainer(container);
1957 - return;
1958 - }
1959 - updateStyleIdForModel(model);
1384 + // Update local styles
1385 + container.model.set('styles', newStyles);
1960 1386 }
1961 1387 function updateElementsStyleIdsInsideOut(styledElements) {
1962 1388 styledElements === null || styledElements === void 0 || styledElements.reverse().forEach(updateStyleId);
1963 1389 }
1964 1390
1965 -/***/ }),
1966 -
1967 -/***/ "../node_modules/@babel/runtime/helpers/OverloadYield.js":
1968 -/*!***************************************************************!*\
1969 - !*** ../node_modules/@babel/runtime/helpers/OverloadYield.js ***!
1970 - \***************************************************************/
1971 -/***/ ((module) => {
1972 -
1973 -function _OverloadYield(e, d) {
1974 - this.v = e, this.k = d;
1391 +/**
1392 + * Get a container - iterate over its children, find all styled atomic widgets and update their style ids
1393 + *
1394 + * @param {Container} container
1395 + */
1396 +function regenerateLocalStyleIds(container) {
1397 + var allElements = (0, _getElementChildren.getElementChildren)(container);
1398 + var styledElements = allElements.filter(function (element) {
1399 + var _element$model$get;
1400 + return Object.keys((_element$model$get = element.model.get('styles')) !== null && _element$model$get !== void 0 ? _element$model$get : {}).length > 0;
1401 + });
1402 + updateElementsStyleIdsInsideOut(styledElements);
1975 1403 }
1976 -module.exports = _OverloadYield, module.exports.__esModule = true, module.exports["default"] = module.exports;
1977 1404
1978 1405 /***/ }),
1979 1406
1980 1407 /***/ "../node_modules/@babel/runtime/helpers/arrayLikeToArray.js":
@@ -2032,43 +1459,8 @@
2032 1459 module.exports = _assertThisInitialized, module.exports.__esModule = true, module.exports["default"] = module.exports;
2033 1460
2034 1461 /***/ }),
2035 1462
2036 -/***/ "../node_modules/@babel/runtime/helpers/asyncToGenerator.js":
2037 -/*!******************************************************************!*\
2038 - !*** ../node_modules/@babel/runtime/helpers/asyncToGenerator.js ***!
2039 - \******************************************************************/
2040 -/***/ ((module) => {
2041 -
2042 -function asyncGeneratorStep(n, t, e, r, o, a, c) {
2043 - try {
2044 - var i = n[a](c),
2045 - u = i.value;
2046 - } catch (n) {
2047 - return void e(n);
2048 - }
2049 - i.done ? t(u) : Promise.resolve(u).then(r, o);
2050 -}
2051 -function _asyncToGenerator(n) {
2052 - return function () {
2053 - var t = this,
2054 - e = arguments;
2055 - return new Promise(function (r, o) {
2056 - var a = n.apply(t, e);
2057 - function _next(n) {
2058 - asyncGeneratorStep(a, r, o, _next, _throw, "next", n);
2059 - }
2060 - function _throw(n) {
2061 - asyncGeneratorStep(a, r, o, _next, _throw, "throw", n);
2062 - }
2063 - _next(void 0);
2064 - });
2065 - };
2066 -}
2067 -module.exports = _asyncToGenerator, module.exports.__esModule = true, module.exports["default"] = module.exports;
2068 -
2069 -/***/ }),
2070 -
2071 1463 /***/ "../node_modules/@babel/runtime/helpers/classCallCheck.js":
2072 1464 /*!****************************************************************!*\
2073 1465 !*** ../node_modules/@babel/runtime/helpers/classCallCheck.js ***!
2074 1466 \****************************************************************/
@@ -2287,344 +1679,8 @@
2287 1679 module.exports = _possibleConstructorReturn, module.exports.__esModule = true, module.exports["default"] = module.exports;
2288 1680
2289 1681 /***/ }),
2290 1682
2291 -/***/ "../node_modules/@babel/runtime/helpers/regenerator.js":
2292 -/*!*************************************************************!*\
2293 - !*** ../node_modules/@babel/runtime/helpers/regenerator.js ***!
2294 - \*************************************************************/
2295 -/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
2296 -
2297 -var regeneratorDefine = __webpack_require__(/*! ./regeneratorDefine.js */ "../node_modules/@babel/runtime/helpers/regeneratorDefine.js");
2298 -function _regenerator() {
2299 - /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
2300 - var e,
2301 - t,
2302 - r = "function" == typeof Symbol ? Symbol : {},
2303 - n = r.iterator || "@@iterator",
2304 - o = r.toStringTag || "@@toStringTag";
2305 - function i(r, n, o, i) {
2306 - var c = n && n.prototype instanceof Generator ? n : Generator,
2307 - u = Object.create(c.prototype);
2308 - return regeneratorDefine(u, "_invoke", function (r, n, o) {
2309 - var i,
2310 - c,
2311 - u,
2312 - f = 0,
2313 - p = o || [],
2314 - y = !1,
2315 - G = {
2316 - p: 0,
2317 - n: 0,
2318 - v: e,
2319 - a: d,
2320 - f: d.bind(e, 4),
2321 - d: function d(t, r) {
2322 - return i = t, c = 0, u = e, G.n = r, a;
2323 - }
2324 - };
2325 - function d(r, n) {
2326 - for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) {
2327 - var o,
2328 - i = p[t],
2329 - d = G.p,
2330 - l = i[2];
2331 - 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));
2332 - }
2333 - if (o || r > 1) return a;
2334 - throw y = !0, n;
2335 - }
2336 - return function (o, p, l) {
2337 - if (f > 1) throw TypeError("Generator is already running");
2338 - for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) {
2339 - i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u);
2340 - try {
2341 - if (f = 2, i) {
2342 - if (c || (o = "next"), t = i[o]) {
2343 - if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object");
2344 - if (!t.done) return t;
2345 - u = t.value, c < 2 && (c = 0);
2346 - } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1);
2347 - i = e;
2348 - } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break;
2349 - } catch (t) {
2350 - i = e, c = 1, u = t;
2351 - } finally {
2352 - f = 1;
2353 - }
2354 - }
2355 - return {
2356 - value: t,
2357 - done: y
2358 - };
2359 - };
2360 - }(r, o, i), !0), u;
2361 - }
2362 - var a = {};
2363 - function Generator() {}
2364 - function GeneratorFunction() {}
2365 - function GeneratorFunctionPrototype() {}
2366 - t = Object.getPrototypeOf;
2367 - var c = [][n] ? t(t([][n]())) : (regeneratorDefine(t = {}, n, function () {
2368 - return this;
2369 - }), t),
2370 - u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c);
2371 - function f(e) {
2372 - return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, regeneratorDefine(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e;
2373 - }
2374 - 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 () {
2375 - return this;
2376 - }), regeneratorDefine(u, "toString", function () {
2377 - return "[object Generator]";
2378 - }), (module.exports = _regenerator = function _regenerator() {
2379 - return {
2380 - w: i,
2381 - m: f
2382 - };
2383 - }, module.exports.__esModule = true, module.exports["default"] = module.exports)();
2384 -}
2385 -module.exports = _regenerator, module.exports.__esModule = true, module.exports["default"] = module.exports;
2386 -
2387 -/***/ }),
2388 -
2389 -/***/ "../node_modules/@babel/runtime/helpers/regeneratorAsync.js":
2390 -/*!******************************************************************!*\
2391 - !*** ../node_modules/@babel/runtime/helpers/regeneratorAsync.js ***!
2392 - \******************************************************************/
2393 -/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
2394 -
2395 -var regeneratorAsyncGen = __webpack_require__(/*! ./regeneratorAsyncGen.js */ "../node_modules/@babel/runtime/helpers/regeneratorAsyncGen.js");
2396 -function _regeneratorAsync(n, e, r, t, o) {
2397 - var a = regeneratorAsyncGen(n, e, r, t, o);
2398 - return a.next().then(function (n) {
2399 - return n.done ? n.value : a.next();
2400 - });
2401 -}
2402 -module.exports = _regeneratorAsync, module.exports.__esModule = true, module.exports["default"] = module.exports;
2403 -
2404 -/***/ }),
2405 -
2406 -/***/ "../node_modules/@babel/runtime/helpers/regeneratorAsyncGen.js":
2407 -/*!*********************************************************************!*\
2408 - !*** ../node_modules/@babel/runtime/helpers/regeneratorAsyncGen.js ***!
2409 - \*********************************************************************/
2410 -/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
2411 -
2412 -var regenerator = __webpack_require__(/*! ./regenerator.js */ "../node_modules/@babel/runtime/helpers/regenerator.js");
2413 -var regeneratorAsyncIterator = __webpack_require__(/*! ./regeneratorAsyncIterator.js */ "../node_modules/@babel/runtime/helpers/regeneratorAsyncIterator.js");
2414 -function _regeneratorAsyncGen(r, e, t, o, n) {
2415 - return new regeneratorAsyncIterator(regenerator().w(r, e, t, o), n || Promise);
2416 -}
2417 -module.exports = _regeneratorAsyncGen, module.exports.__esModule = true, module.exports["default"] = module.exports;
2418 -
2419 -/***/ }),
2420 -
2421 -/***/ "../node_modules/@babel/runtime/helpers/regeneratorAsyncIterator.js":
2422 -/*!**************************************************************************!*\
2423 - !*** ../node_modules/@babel/runtime/helpers/regeneratorAsyncIterator.js ***!
2424 - \**************************************************************************/
2425 -/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
2426 -
2427 -var OverloadYield = __webpack_require__(/*! ./OverloadYield.js */ "../node_modules/@babel/runtime/helpers/OverloadYield.js");
2428 -var regeneratorDefine = __webpack_require__(/*! ./regeneratorDefine.js */ "../node_modules/@babel/runtime/helpers/regeneratorDefine.js");
2429 -function AsyncIterator(t, e) {
2430 - function n(r, o, i, f) {
2431 - try {
2432 - var c = t[r](o),
2433 - u = c.value;
2434 - return u instanceof OverloadYield ? e.resolve(u.v).then(function (t) {
2435 - n("next", t, i, f);
2436 - }, function (t) {
2437 - n("throw", t, i, f);
2438 - }) : e.resolve(u).then(function (t) {
2439 - c.value = t, i(c);
2440 - }, function (t) {
2441 - return n("throw", t, i, f);
2442 - });
2443 - } catch (t) {
2444 - f(t);
2445 - }
2446 - }
2447 - var r;
2448 - this.next || (regeneratorDefine(AsyncIterator.prototype), regeneratorDefine(AsyncIterator.prototype, "function" == typeof Symbol && Symbol.asyncIterator || "@asyncIterator", function () {
2449 - return this;
2450 - })), regeneratorDefine(this, "_invoke", function (t, o, i) {
2451 - function f() {
2452 - return new e(function (e, r) {
2453 - n(t, i, e, r);
2454 - });
2455 - }
2456 - return r = r ? r.then(f, f) : f();
2457 - }, !0);
2458 -}
2459 -module.exports = AsyncIterator, module.exports.__esModule = true, module.exports["default"] = module.exports;
2460 -
2461 -/***/ }),
2462 -
2463 -/***/ "../node_modules/@babel/runtime/helpers/regeneratorDefine.js":
2464 -/*!*******************************************************************!*\
2465 - !*** ../node_modules/@babel/runtime/helpers/regeneratorDefine.js ***!
2466 - \*******************************************************************/
2467 -/***/ ((module) => {
2468 -
2469 -function _regeneratorDefine(e, r, n, t) {
2470 - var i = Object.defineProperty;
2471 - try {
2472 - i({}, "", {});
2473 - } catch (e) {
2474 - i = 0;
2475 - }
2476 - module.exports = _regeneratorDefine = function regeneratorDefine(e, r, n, t) {
2477 - function o(r, n) {
2478 - _regeneratorDefine(e, r, function (e) {
2479 - return this._invoke(r, n, e);
2480 - });
2481 - }
2482 - r ? i ? i(e, r, {
2483 - value: n,
2484 - enumerable: !t,
2485 - configurable: !t,
2486 - writable: !t
2487 - }) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2));
2488 - }, module.exports.__esModule = true, module.exports["default"] = module.exports, _regeneratorDefine(e, r, n, t);
2489 -}
2490 -module.exports = _regeneratorDefine, module.exports.__esModule = true, module.exports["default"] = module.exports;
2491 -
2492 -/***/ }),
2493 -
2494 -/***/ "../node_modules/@babel/runtime/helpers/regeneratorKeys.js":
2495 -/*!*****************************************************************!*\
2496 - !*** ../node_modules/@babel/runtime/helpers/regeneratorKeys.js ***!
2497 - \*****************************************************************/
2498 -/***/ ((module) => {
2499 -
2500 -function _regeneratorKeys(e) {
2501 - var n = Object(e),
2502 - r = [];
2503 - for (var t in n) r.unshift(t);
2504 - return function e() {
2505 - for (; r.length;) if ((t = r.pop()) in n) return e.value = t, e.done = !1, e;
2506 - return e.done = !0, e;
2507 - };
2508 -}
2509 -module.exports = _regeneratorKeys, module.exports.__esModule = true, module.exports["default"] = module.exports;
2510 -
2511 -/***/ }),
2512 -
2513 -/***/ "../node_modules/@babel/runtime/helpers/regeneratorRuntime.js":
2514 -/*!********************************************************************!*\
2515 - !*** ../node_modules/@babel/runtime/helpers/regeneratorRuntime.js ***!
2516 - \********************************************************************/
2517 -/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
2518 -
2519 -var OverloadYield = __webpack_require__(/*! ./OverloadYield.js */ "../node_modules/@babel/runtime/helpers/OverloadYield.js");
2520 -var regenerator = __webpack_require__(/*! ./regenerator.js */ "../node_modules/@babel/runtime/helpers/regenerator.js");
2521 -var regeneratorAsync = __webpack_require__(/*! ./regeneratorAsync.js */ "../node_modules/@babel/runtime/helpers/regeneratorAsync.js");
2522 -var regeneratorAsyncGen = __webpack_require__(/*! ./regeneratorAsyncGen.js */ "../node_modules/@babel/runtime/helpers/regeneratorAsyncGen.js");
2523 -var regeneratorAsyncIterator = __webpack_require__(/*! ./regeneratorAsyncIterator.js */ "../node_modules/@babel/runtime/helpers/regeneratorAsyncIterator.js");
2524 -var regeneratorKeys = __webpack_require__(/*! ./regeneratorKeys.js */ "../node_modules/@babel/runtime/helpers/regeneratorKeys.js");
2525 -var regeneratorValues = __webpack_require__(/*! ./regeneratorValues.js */ "../node_modules/@babel/runtime/helpers/regeneratorValues.js");
2526 -function _regeneratorRuntime() {
2527 - "use strict";
2528 -
2529 - var r = regenerator(),
2530 - e = r.m(_regeneratorRuntime),
2531 - t = (Object.getPrototypeOf ? Object.getPrototypeOf(e) : e.__proto__).constructor;
2532 - function n(r) {
2533 - var e = "function" == typeof r && r.constructor;
2534 - return !!e && (e === t || "GeneratorFunction" === (e.displayName || e.name));
2535 - }
2536 - var o = {
2537 - "throw": 1,
2538 - "return": 2,
2539 - "break": 3,
2540 - "continue": 3
2541 - };
2542 - function a(r) {
2543 - var e, t;
2544 - return function (n) {
2545 - e || (e = {
2546 - stop: function stop() {
2547 - return t(n.a, 2);
2548 - },
2549 - "catch": function _catch() {
2550 - return n.v;
2551 - },
2552 - abrupt: function abrupt(r, e) {
2553 - return t(n.a, o[r], e);
2554 - },
2555 - delegateYield: function delegateYield(r, o, a) {
2556 - return e.resultName = o, t(n.d, regeneratorValues(r), a);
2557 - },
2558 - finish: function finish(r) {
2559 - return t(n.f, r);
2560 - }
2561 - }, t = function t(r, _t, o) {
2562 - n.p = e.prev, n.n = e.next;
2563 - try {
2564 - return r(_t, o);
2565 - } finally {
2566 - e.next = n.n;
2567 - }
2568 - }), e.resultName && (e[e.resultName] = n.v, e.resultName = void 0), e.sent = n.v, e.next = n.n;
2569 - try {
2570 - return r.call(this, e);
2571 - } finally {
2572 - n.p = e.prev, n.n = e.next;
2573 - }
2574 - };
2575 - }
2576 - return (module.exports = _regeneratorRuntime = function _regeneratorRuntime() {
2577 - return {
2578 - wrap: function wrap(e, t, n, o) {
2579 - return r.w(a(e), t, n, o && o.reverse());
2580 - },
2581 - isGeneratorFunction: n,
2582 - mark: r.m,
2583 - awrap: function awrap(r, e) {
2584 - return new OverloadYield(r, e);
2585 - },
2586 - AsyncIterator: regeneratorAsyncIterator,
2587 - async: function async(r, e, t, o, u) {
2588 - return (n(e) ? regeneratorAsyncGen : regeneratorAsync)(a(r), e, t, o, u);
2589 - },
2590 - keys: regeneratorKeys,
2591 - values: regeneratorValues
2592 - };
2593 - }, module.exports.__esModule = true, module.exports["default"] = module.exports)();
2594 -}
2595 -module.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports["default"] = module.exports;
2596 -
2597 -/***/ }),
2598 -
2599 -/***/ "../node_modules/@babel/runtime/helpers/regeneratorValues.js":
2600 -/*!*******************************************************************!*\
2601 - !*** ../node_modules/@babel/runtime/helpers/regeneratorValues.js ***!
2602 - \*******************************************************************/
2603 -/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
2604 -
2605 -var _typeof = (__webpack_require__(/*! ./typeof.js */ "../node_modules/@babel/runtime/helpers/typeof.js")["default"]);
2606 -function _regeneratorValues(e) {
2607 - if (null != e) {
2608 - var t = e["function" == typeof Symbol && Symbol.iterator || "@@iterator"],
2609 - r = 0;
2610 - if (t) return t.call(e);
2611 - if ("function" == typeof e.next) return e;
2612 - if (!isNaN(e.length)) return {
2613 - next: function next() {
2614 - return e && r >= e.length && (e = void 0), {
2615 - value: e && e[r++],
2616 - done: !e
2617 - };
2618 - }
2619 - };
2620 - }
2621 - throw new TypeError(_typeof(e) + " is not iterable");
2622 -}
2623 -module.exports = _regeneratorValues, module.exports.__esModule = true, module.exports["default"] = module.exports;
2624 -
2625 -/***/ }),
2626 -
2627 1683 /***/ "../node_modules/@babel/runtime/helpers/setPrototypeOf.js":
2628 1684 /*!****************************************************************!*\
2629 1685 !*** ../node_modules/@babel/runtime/helpers/setPrototypeOf.js ***!
2630 1686 \****************************************************************/
@@ -2761,33 +1817,8 @@
2761 1817 module.exports = _unsupportedIterableToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
2762 1818
2763 1819 /***/ }),
2764 1820
2765 -/***/ "../node_modules/@babel/runtime/regenerator/index.js":
2766 -/*!***********************************************************!*\
2767 - !*** ../node_modules/@babel/runtime/regenerator/index.js ***!
2768 - \***********************************************************/
2769 -/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
2770 -
2771 -// TODO(Babel 8): Remove this file.
2772 -
2773 -var runtime = __webpack_require__(/*! ../helpers/regeneratorRuntime */ "../node_modules/@babel/runtime/helpers/regeneratorRuntime.js")();
2774 -module.exports = runtime;
2775 -
2776 -// Copied from https://github.com/facebook/regenerator/blob/main/packages/runtime/runtime.js#L736=
2777 -try {
2778 - regeneratorRuntime = runtime;
2779 -} catch (accidentalStrictMode) {
2780 - if (typeof globalThis === "object") {
2781 - globalThis.regeneratorRuntime = runtime;
2782 - } else {
2783 - Function("r", "regeneratorRuntime = r")(runtime);
2784 - }
2785 -}
2786 -
2787 -
2788 -/***/ }),
2789 -
2790 1821 /***/ "../node_modules/react-dom/client.js":
2791 1822 /*!*******************************************!*\
2792 1823 !*** ../node_modules/react-dom/client.js ***!
2793 1824 \*******************************************/
@@ -2890,8 +1921,9 @@
2890 1921 \************************************************************/
2891 1922
2892 1923
2893 1924 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
1925 +var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "../node_modules/@babel/runtime/helpers/slicedToArray.js"));
2894 1926 var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
2895 1927 var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
2896 1928 var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
2897 1929 var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
@@ -2896,15 +1928,45 @@
2896 1928 var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
2897 1929 var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
2898 1930 var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
2899 1931 var _component = _interopRequireDefault(__webpack_require__(/*! ./component */ "../modules/atomic-widgets/assets/js/editor/component.js"));
2900 -var _atomicElementBaseType = _interopRequireDefault(__webpack_require__(/*! ./atomic-element-base-type */ "../modules/atomic-widgets/assets/js/editor/atomic-element-base-type.js"));
2901 -var _createAtomicElementBaseView = _interopRequireDefault(__webpack_require__(/*! ./create-atomic-element-base-view */ "../modules/atomic-widgets/assets/js/editor/create-atomic-element-base-view.js"));
2902 -var _atomicElementBaseModel = _interopRequireDefault(__webpack_require__(/*! ./atomic-element-base-model */ "../modules/atomic-widgets/assets/js/editor/atomic-element-base-model.js"));
2903 -var _createDivBlockType = _interopRequireDefault(__webpack_require__(/*! ./atomic-element-types/create-div-block-type */ "../modules/atomic-widgets/assets/js/editor/atomic-element-types/create-div-block-type.js"));
2904 -var _createFlexboxType = _interopRequireDefault(__webpack_require__(/*! ./atomic-element-types/create-flexbox-type */ "../modules/atomic-widgets/assets/js/editor/atomic-element-types/create-flexbox-type.js"));
1932 +var _emptyComponent = _interopRequireDefault(__webpack_require__(/*! elementor-elements/views/container/empty-component */ "../assets/dev/js/editor/elements/views/container/empty-component.js"));
1933 +var _atomicElementModel = _interopRequireDefault(__webpack_require__(/*! ./atomic-element-model */ "../modules/atomic-widgets/assets/js/editor/atomic-element-model.js"));
1934 +var _atomicElementView = _interopRequireDefault(__webpack_require__(/*! ./atomic-element-view */ "../modules/atomic-widgets/assets/js/editor/atomic-element-view.js"));
2905 1935 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)); }
2906 1936 function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
1937 +var DynamicAtomicElementType = /*#__PURE__*/function (_elementor$modules$el) {
1938 + function DynamicAtomicElementType(elementType, view) {
1939 + var _this;
1940 + (0, _classCallCheck2.default)(this, DynamicAtomicElementType);
1941 + _this = _callSuper(this, DynamicAtomicElementType);
1942 + _this.elementType = elementType;
1943 + _this.view = view;
1944 + return _this;
1945 + }
1946 + (0, _inherits2.default)(DynamicAtomicElementType, _elementor$modules$el);
1947 + return (0, _createClass2.default)(DynamicAtomicElementType, [{
1948 + key: "getType",
1949 + value: function getType() {
1950 + return this.elementType;
1951 + }
1952 + }, {
1953 + key: "getView",
1954 + value: function getView() {
1955 + return this.view;
1956 + }
1957 + }, {
1958 + key: "getEmptyView",
1959 + value: function getEmptyView() {
1960 + return _emptyComponent.default;
1961 + }
1962 + }, {
1963 + key: "getModel",
1964 + value: function getModel() {
1965 + return _atomicElementModel.default;
1966 + }
1967 + }]);
1968 +}(elementor.modules.elements.types.Base);
2907 1969 var Module = /*#__PURE__*/function (_elementorModules$edi) {
2908 1970 function Module() {
2909 1971 (0, _classCallCheck2.default)(this, Module);
2910 1972 return _callSuper(this, Module, arguments);
@@ -2913,23 +1975,29 @@
2913 1975 return (0, _createClass2.default)(Module, [{
2914 1976 key: "onInit",
2915 1977 value: function onInit() {
2916 1978 $e.components.register(new _component.default());
2917 - this.exposeAtomicElementClasses();
2918 - this.registerAtomicElements();
1979 + this.registerAtomicWidgetTypes();
2919 1980 }
2920 1981 }, {
2921 - key: "exposeAtomicElementClasses",
2922 - value: function exposeAtomicElementClasses() {
2923 - elementor.modules.elements.types.AtomicElementBase = _atomicElementBaseType.default;
2924 - elementor.modules.elements.views.createAtomicElementBase = _createAtomicElementBaseView.default;
2925 - elementor.modules.elements.models.AtomicElementBase = _atomicElementBaseModel.default;
1982 + key: "registerAtomicWidgetTypes",
1983 + value: function registerAtomicWidgetTypes() {
1984 + this.registerDynamicAtomicTypes();
2926 1985 }
2927 1986 }, {
2928 - key: "registerAtomicElements",
2929 - value: function registerAtomicElements() {
2930 - elementor.elementsManager.registerElementType((0, _createDivBlockType.default)());
2931 - elementor.elementsManager.registerElementType((0, _createFlexboxType.default)());
1987 + key: "registerDynamicAtomicTypes",
1988 + value: function registerDynamicAtomicTypes() {
1989 + Object.entries(elementor.config.elements).filter(function (_ref) {
1990 + var _ref2 = (0, _slicedToArray2.default)(_ref, 2),
1991 + element = _ref2[1];
1992 + return !!(element !== null && element !== void 0 && element.atomic_props_schema);
1993 + }).forEach(function (_ref3) {
1994 + var _ref4 = (0, _slicedToArray2.default)(_ref3, 1),
1995 + elementType = _ref4[0];
1996 + var view = (0, _atomicElementView.default)(elementType);
1997 + var dynamicType = new DynamicAtomicElementType(elementType, view);
1998 + elementor.elementsManager.registerElementType(dynamicType);
1999 + });
2932 2000 }
2933 2001 }]);
2934 2002 }(elementorModules.editor.utils.Module);
2935 2003 new Module();