PluginProbe
Elementor Website Builder – more than just a page builder / 4.0.0-beta1
Elementor Website Builder – more than just a page builder v4.0.0-beta1
4.3.2 4.3.1 4.3.0 4.3.0-beta3 4.3.0-beta2 4.3.0-beta1 4.2.4 4.2.3 4.2.2 4.2.1 4.2.0 4.1.5 4.2.0-beta2 4.2.0-dev2 4.2.0-beta1 4.1.4 4.1.3 4.1.2 4.1.1 4.1.0 4.1.0-beta3 4.1.0-dev3 4.0.9 4.1.0-beta2 4.1.0-dev2 All 455 releases
← All changes | assets/js/atomic-widgets-editor.js +47 -68 4.0.9 → 4.0.0-beta1 View file →
@@ -1132,31 +1132,22 @@
1132 1132 var AtomicElementView = BaseElementView.extend({
1133 1133 template: Marionette.TemplateCache.get("#tmpl-elementor-".concat(type, "-content")),
1134 1134 emptyView: _atomicElementEmptyView.default,
1135 1135 _childrenRenderPromises: [],
1136 - _createElement: function _createElement(tag) {
1137 - var _elementor$$preview;
1138 - 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;
1139 - if (previewDocument) {
1140 - return previewDocument.createElement(tag);
1141 - }
1142 - return document.createElement(tag);
1143 - },
1144 1136 tagName: function tagName() {
1145 1137 var _resolvedTagCache$get;
1146 1138 return (_resolvedTagCache$get = resolvedTagCache.get(this.model)) !== null && _resolvedTagCache$get !== void 0 ? _resolvedTagCache$get : this._resolveTag();
1147 1139 },
1148 1140 _resolveTag: function _resolveTag() {
1149 - var _this$getResolverRend, _linkSetting$value, _resolvedLinkTag$valu, _resolvedTag$value;
1141 + var _this$getResolverRend, _resolvedTag$value;
1150 1142 var renderContext = (_this$getResolverRend = this.getResolverRenderContext) === null || _this$getResolverRend === void 0 ? void 0 : _this$getResolverRend.call(this);
1151 1143 var tagSetting = this.model.getSetting('tag');
1152 1144 var resolvedTag = this._resolvePropValue(tagSetting, renderContext);
1153 - var linkSetting = this.model.getSetting('link');
1154 - var resolvedLinkTag = this._resolvePropValue(linkSetting === null || linkSetting === void 0 || (_linkSetting$value = linkSetting.value) === null || _linkSetting$value === void 0 ? void 0 : _linkSetting$value.tag, renderContext);
1155 - var linkTag = (_resolvedLinkTag$valu = resolvedLinkTag === null || resolvedLinkTag === void 0 ? void 0 : resolvedLinkTag.value) !== null && _resolvedLinkTag$valu !== void 0 ? _resolvedLinkTag$valu : resolvedLinkTag;
1156 - var baseTag = (_resolvedTag$value = resolvedTag === null || resolvedTag === void 0 ? void 0 : resolvedTag.value) !== null && _resolvedTag$value !== void 0 ? _resolvedTag$value : resolvedTag;
1157 - var resultTag = linkTag !== null && linkTag !== void 0 ? linkTag : baseTag;
1158 - return resultTag || this.model.config.default_html_tag || 'div';
1145 + var tagValue = (_resolvedTag$value = resolvedTag === null || resolvedTag === void 0 ? void 0 : resolvedTag.value) !== null && _resolvedTag$value !== void 0 ? _resolvedTag$value : resolvedTag;
1146 + if (this._hasLink(renderContext)) {
1147 + return 'a';
1148 + }
1149 + return tagValue || this.model.config.default_html_tag || 'div';
1159 1150 },
1160 1151 getChildViewContainer: function getChildViewContainer() {
1161 1152 this.childViewContainer = '';
1162 1153 return Marionette.CompositeView.prototype.getChildViewContainer.apply(this, arguments);
@@ -1334,20 +1325,11 @@
1334 1325 });
1335 1326 return this;
1336 1327 },
1337 1328 _shouldSkipFullRender: function _shouldSkipFullRender() {
1338 - return this.isRendered && this._hasConnectedChildren();
1329 + var _this$children;
1330 + return this.isRendered && ((_this$children = this.children) === null || _this$children === void 0 ? void 0 : _this$children.length) > 0;
1339 1331 },
1340 - _hasConnectedChildren: function _hasConnectedChildren() {
1341 - var _this$children, _firstChild$$el$get$i, _firstChild$$el;
1342 - if (!((_this$children = this.children) !== null && _this$children !== void 0 && _this$children.length)) {
1343 - return false;
1344 - }
1345 -
1346 - // If the parent's innerHTML was replaced, all children are detached together.
1347 - var firstChild = this.children.findByIndex(0);
1348 - 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;
1349 - },
1350 1332 _renderWithoutDomRecreation: function _renderWithoutDomRecreation(resolve) {
1351 1333 var _this4 = this;
1352 1334 this._beforeRender();
1353 1335 this._renderChildren();
@@ -1400,34 +1382,27 @@
1400 1382 this.rerenderEntireView();
1401 1383 return true;
1402 1384 },
1403 1385 _applyLinkAttributes: function _applyLinkAttributes() {
1404 - var _this6 = this;
1405 1386 this.$el.removeAttr('href');
1406 1387 this.$el.removeAttr('data-action-link');
1407 - var link = this.getLinkAttributes();
1408 - if (!link) {
1409 - return;
1388 + var link = this.getLink();
1389 + if (link) {
1390 + this.$el.attr(link.attr, link.value);
1410 1391 }
1411 - Object.entries(link).forEach(function (_ref7) {
1412 - var _ref8 = (0, _slicedToArray2.default)(_ref7, 2),
1413 - key = _ref8[0],
1414 - value = _ref8[1];
1415 - _this6.$el.attr(key, value);
1416 - });
1417 1392 },
1418 1393 _waitForChildrenToComplete: function _waitForChildrenToComplete() {
1419 - var _this7 = this;
1394 + var _this6 = this;
1420 1395 return (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee() {
1421 1396 return _regenerator.default.wrap(function (_context) {
1422 1397 while (1) switch (_context.prev = _context.next) {
1423 1398 case 0:
1424 - if (!(_this7._childrenRenderPromises.length > 0)) {
1399 + if (!(_this6._childrenRenderPromises.length > 0)) {
1425 1400 _context.next = 1;
1426 1401 break;
1427 1402 }
1428 1403 _context.next = 1;
1429 - return Promise.all(_this7._childrenRenderPromises);
1404 + return Promise.all(_this6._childrenRenderPromises);
1430 1405 case 1:
1431 1406 case "end":
1432 1407 return _context.stop();
1433 1408 }
@@ -1446,25 +1421,25 @@
1446 1421 this._collectChildrenRenderPromises();
1447 1422 },
1448 1423 _collectChildrenRenderPromises: function _collectChildrenRenderPromises() {
1449 1424 var _this$children3,
1450 - _this8 = this;
1425 + _this7 = this;
1451 1426 this._childrenRenderPromises = [];
1452 1427 (_this$children3 = this.children) === null || _this$children3 === void 0 || _this$children3.each(function (childView) {
1453 1428 if (childView._currentRenderPromise) {
1454 - _this8._childrenRenderPromises.push(childView._currentRenderPromise);
1429 + _this7._childrenRenderPromises.push(childView._currentRenderPromise);
1455 1430 }
1456 1431 });
1457 1432 },
1458 1433 onRender: function onRender() {
1459 - var _this9 = this;
1434 + var _this8 = this;
1460 1435 this.dispatchPreviewEvent('elementor/element/render');
1461 1436 BaseElementView.prototype.onRender.apply(this, arguments);
1462 1437
1463 1438 // Defer to wait for everything to render.
1464 1439 setTimeout(function () {
1465 - _this9.droppableInitialize();
1466 - _this9.updateHandlesPosition();
1440 + _this8.droppableInitialize();
1441 + _this8.updateHandlesPosition();
1467 1442 });
1468 1443 },
1469 1444 onDestroy: function onDestroy() {
1470 1445 BaseElementView.prototype.onDestroy.apply(this, arguments);
@@ -1489,9 +1464,9 @@
1489 1464 }
1490 1465 var destination = this._resolvePropValue((_resolvedLink$value = resolvedLink.value) === null || _resolvedLink$value === void 0 ? void 0 : _resolvedLink$value.destination, renderContext);
1491 1466 return !!(destination !== null && destination !== void 0 && destination.value);
1492 1467 },
1493 - getLinkAttributes: function getLinkAttributes() {
1468 + getLink: function getLink() {
1494 1469 var _this$getResolverRend2, _resolvedLink$value2;
1495 1470 var renderContext = (_this$getResolverRend2 = this.getResolverRenderContext) === null || _this$getResolverRend2 === void 0 ? void 0 : _this$getResolverRend2.call(this);
1496 1471 var linkSetting = this.model.getSetting('link');
1497 1472 var resolvedLink = this._resolvePropValue(linkSetting, renderContext);
@@ -1504,19 +1479,23 @@
1504 1479 }
1505 1480 var $$type = destination.$$type,
1506 1481 value = destination.value;
1507 1482 if ('dynamic' === $$type) {
1483 + var _value$settings;
1508 1484 var resolvedValue = this.handleDynamicLink(value);
1509 1485 if (!resolvedValue) {
1510 1486 return null;
1511 1487 }
1512 - var attributeKey = 'action' === (value === null || value === void 0 ? void 0 : value.group) ? 'data-action-link' : 'href';
1513 - return (0, _defineProperty2.default)({}, attributeKey, resolvedValue);
1488 + return {
1489 + attr: 'action' === ((_value$settings = value.settings) === null || _value$settings === void 0 ? void 0 : _value$settings.group) ? 'data-action-link' : 'href',
1490 + value: resolvedValue
1491 + };
1514 1492 }
1515 1493 var isPostId = 'number' === $$type;
1516 1494 var hrefPrefix = isPostId ? elementor.config.home_url + '/?p=' : '';
1517 1495 return {
1518 - href: hrefPrefix + value
1496 + attr: 'href',
1497 + value: hrefPrefix + value
1519 1498 };
1520 1499 },
1521 1500 droppableInitialize: function droppableInitialize() {
1522 1501 this.$el.html5Droppable(this.getDroppableOptions());
@@ -1526,9 +1505,9 @@
1526 1505 *
1527 1506 * @return {Object} groups
1528 1507 */
1529 1508 getContextMenuGroups: function getContextMenuGroups() {
1530 - var _this0 = this,
1509 + var _this9 = this,
1531 1510 _elementorCommon$conf;
1532 1511 var saveActions = [{
1533 1512 name: 'save',
1534 1513 title: __('Save as a template', 'elementor'),
@@ -1533,9 +1512,9 @@
1533 1512 name: 'save',
1534 1513 title: __('Save as a template', 'elementor'),
1535 1514 callback: this.saveAsTemplate.bind(this),
1536 1515 isEnabled: function isEnabled() {
1537 - return !_this0.getContainer().isLocked();
1516 + return !_this9.getContainer().isLocked();
1538 1517 }
1539 1518 }];
1540 1519 var isAdministrator = elementor.config.user.is_administrator;
1541 1520 var isExperimentalFeaturesEnabled = (_elementorCommon$conf = elementorCommon.config.experimentalFeatures) === null || _elementorCommon$conf === void 0 ? void 0 : _elementorCommon$conf.e_components;
@@ -1554,9 +1533,9 @@
1554 1533 shortcut: isProActive || isProOutdated ? newBadge : proBadge,
1555 1534 hasShortcutAction: showPromoBadge,
1556 1535 callback: this.saveAsComponent.bind(this),
1557 1536 isEnabled: function isEnabled() {
1558 - return (isProActive || isProOutdated) && !_this0.getContainer().isLocked();
1537 + return (isProActive || isProOutdated) && !_this9.getContainer().isLocked();
1559 1538 }
1560 1539 });
1561 1540 }
1562 1541 var groups = BaseElementView.prototype.getContextMenuGroups.apply(this, arguments),
@@ -1639,9 +1618,9 @@
1639 1618 preventInit: true
1640 1619 };
1641 1620 },
1642 1621 getDroppableOptions: function getDroppableOptions() {
1643 - var _this1 = this;
1622 + var _this0 = this;
1644 1623 var items = '> .elementor-element, > .elementor-empty-view .elementor-first-add';
1645 1624 return {
1646 1625 axis: null,
1647 1626 items: items,
@@ -1651,9 +1630,9 @@
1651 1630 currentElementClass: 'elementor-html5dnd-current-element',
1652 1631 placeholderClass: 'elementor-sortable-placeholder elementor-widget-placeholder',
1653 1632 hasDraggingOnChildClass: 'e-dragging-over',
1654 1633 getDropContainer: function getDropContainer() {
1655 - return _this1.getContainer();
1634 + return _this0.getContainer();
1656 1635 },
1657 1636 onDropping: function onDropping(side, event) {
1658 1637 event.stopPropagation();
1659 1638
@@ -1663,14 +1642,14 @@
1663 1642 draggedElement = draggedView === null || draggedView === void 0 ? void 0 : draggedView.getContainer().view.el,
1664 1643 containerElement = event.currentTarget.parentElement,
1665 1644 elements = Array.from((containerElement === null || containerElement === void 0 ? void 0 : containerElement.querySelectorAll(':scope > .elementor-element')) || []);
1666 1645 var targetIndex = elements.indexOf(event.currentTarget);
1667 - if (_this1.isPanelElement(draggedView, draggedElement)) {
1646 + if (_this0.isPanelElement(draggedView, draggedElement)) {
1668 1647 var _elementorCommon;
1669 - if (_this1.draggingOnBottomOrRightSide(side) && !_this1.emptyViewIsCurrentlyBeingDraggedOver()) {
1648 + if (_this0.draggingOnBottomOrRightSide(side) && !_this0.emptyViewIsCurrentlyBeingDraggedOver()) {
1670 1649 targetIndex++;
1671 1650 }
1672 - _this1.onDrop(event, {
1651 + _this0.onDrop(event, {
1673 1652 at: targetIndex
1674 1653 });
1675 1654 if ((_elementorCommon = elementorCommon) !== null && _elementorCommon !== void 0 && (_elementorCommon = _elementorCommon.eventsManager) !== null && _elementorCommon !== void 0 && _elementorCommon.dispatchEvent) {
1676 1655 var selectedElement = elementor.channels.panelElements.request('element:selected');
@@ -1688,16 +1667,16 @@
1688 1667 }
1689 1668 }
1690 1669 return;
1691 1670 }
1692 - if (_this1.isParentElement(draggedView.getContainer().id)) {
1671 + if (_this0.isParentElement(draggedView.getContainer().id)) {
1693 1672 return;
1694 1673 }
1695 - if (_this1.emptyViewIsCurrentlyBeingDraggedOver()) {
1696 - _this1.moveDroppedItem(draggedView, 0);
1674 + if (_this0.emptyViewIsCurrentlyBeingDraggedOver()) {
1675 + _this0.moveDroppedItem(draggedView, 0);
1697 1676 return;
1698 1677 }
1699 - _this1.moveExistingElement(side, draggedView, containerElement, elements, targetIndex, draggedElement);
1678 + _this0.moveExistingElement(side, draggedView, containerElement, elements, targetIndex, draggedElement);
1700 1679 }
1701 1680 };
1702 1681 },
1703 1682 moveExistingElement: function moveExistingElement(side, draggedView, containerElement, elements, targetIndex, draggedElement) {
@@ -1861,12 +1840,12 @@
1861 1840 return 0 === this.model.collection.indexOf(this.model);
1862 1841 },
1863 1842 getDynamicLinkValue: function getDynamicLinkValue(name, settings) {
1864 1843 var simpleTransform = function simpleTransform(props) {
1865 - var transformed = Object.entries(props).map(function (_ref0) {
1866 - var _ref1 = (0, _slicedToArray2.default)(_ref0, 2),
1867 - settingKey = _ref1[0],
1868 - settingValue = _ref1[1];
1844 + var transformed = Object.entries(props).map(function (_ref7) {
1845 + var _ref8 = (0, _slicedToArray2.default)(_ref7, 2),
1846 + settingKey = _ref8[0],
1847 + settingValue = _ref8[1];
1869 1848 var value = 'object' === (0, _typeof2.default)(settingValue) && 'value' in settingValue ? settingValue.value : settingValue;
1870 1849 return [settingKey, value];
1871 1850 });
1872 1851 return Object.fromEntries(transformed);
@@ -1889,9 +1868,9 @@
1889 1868 });
1890 1869 });
1891 1870 },
1892 1871 handleDynamicLink: function handleDynamicLink(linkValue) {
1893 - var _this10 = this;
1872 + var _this1 = this;
1894 1873 var result = this.getDynamicLinkValue(linkValue.name, linkValue.settings);
1895 1874 if (!result) {
1896 1875 return null;
1897 1876 }
@@ -1898,13 +1877,13 @@
1898 1877 if ('string' === typeof result) {
1899 1878 return result;
1900 1879 }
1901 1880 result.then(function (href) {
1902 - _this10.el.removeAttribute('href');
1881 + _this1.el.removeAttribute('href');
1903 1882 var attribute = 'action' === linkValue.group ? 'data-action-link' : 'href';
1904 - _this10.el.setAttribute(attribute, href);
1883 + _this1.el.setAttribute(attribute, href);
1905 1884 }).then(function () {
1906 - return _this10.dispatchPreviewEvent('elementor/element/render');
1885 + return _this1.dispatchPreviewEvent('elementor/element/render');
1907 1886 });
1908 1887 return null;
1909 1888 },
1910 1889 _resolvePropValue: function _resolvePropValue(prop, renderContext) {