| @@ -52548,9 +52548,12 @@ | ||
| 52548 | 52548 | Object.entries(elementor.widgetsCache).forEach(function(_ref) { |
| 52549 | 52549 | var _ref2 = _slicedToArray(_ref, 2); |
| 52550 | 52550 | var widgetName = _ref2[0]; |
| 52551 | 52551 | var widgetData = _ref2[1]; |
| 52552 | - if (widgetData.deprecation && elementor.widgetsCache[widgetData.deprecation.replacement]) elementor.widgetsCache[widgetName].show_in_panel = false; | |
| 52552 | + if (widgetData.deprecation && elementor.widgetsCache[widgetData.deprecation.replacement]) { | |
| 52553 | + elementor.widgetsCache[widgetName].show_in_panel = false; | |
| 52554 | + elementor.widgetsCache[widgetName].hide_on_search = true; | |
| 52555 | + } | |
| 52553 | 52556 | }); |
| 52554 | 52557 | _.each(elementor.widgetsCache, function(widget) { |
| 52555 | 52558 | if (elementor.config.document.panel.widgets_settings[widget.widget_type]) widget = _.extend(widget, elementor.config.document.panel.widgets_settings[widget.widget_type]); |
| 52556 | 52559 | if (!_this.shouldAddWidget(widget)) return; |
| @@ -52615,8 +52618,9 @@ | ||
| 52615 | 52618 | icon: item.icon, |
| 52616 | 52619 | widgetType: item.widget_type, |
| 52617 | 52620 | custom: item.custom, |
| 52618 | 52621 | editable: item.editable, |
| 52622 | + showInPanel: item.show_in_panel, | |
| 52619 | 52623 | hideOnSearch: item.hide_on_search, |
| 52620 | 52624 | isNew: this.isWidgetNew(item), |
| 52621 | 52625 | atomic: !!item.atomic |
| 52622 | 52626 | }; |
| @@ -52623,8 +52627,9 @@ | ||
| 52623 | 52627 | }, |
| 52624 | 52628 | initCategoriesCollection: function initCategoriesCollection() { |
| 52625 | 52629 | var categories = {}; |
| 52626 | 52630 | this.elementsCollection.each(function(element) { |
| 52631 | + if (false === element.get("showInPanel")) return; | |
| 52627 | 52632 | _.each(element.get("categories"), function(category) { |
| 52628 | 52633 | if (!categories[category]) categories[category] = []; |
| 52629 | 52634 | categories[category].push(element); |
| 52630 | 52635 | }); |
| @@ -52648,9 +52653,11 @@ | ||
| 52648 | 52653 | this.categoriesCollection = categoriesCollection; |
| 52649 | 52654 | }, |
| 52650 | 52655 | shouldAddWidget: function shouldAddWidget(widget) { |
| 52651 | 52656 | var isContainerActive = elementorCommon.config.experimentalFeatures.container; |
| 52652 | - return widget.show_in_panel && ("inner-section" !== widget.name || !isContainerActive); | |
| 52657 | + if ("inner-section" === widget.name && isContainerActive) return false; | |
| 52658 | + if (!widget.show_in_panel) return Array.isArray(widget.categories) && widget.categories.includes("wordpress"); | |
| 52659 | + return true; | |
| 52653 | 52660 | }, |
| 52654 | 52661 | deepMerge: function deepMerge(originalObj, replacementObj) { |
| 52655 | 52662 | var mergedObj = _objectSpread({}, originalObj); |
| 52656 | 52663 | for (var key in replacementObj) this.deepMergeKey(mergedObj, originalObj, replacementObj, key); |