@elementor/editor-editing-panel 3.33.0-205 → 3.33.0-207
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +7 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +7 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +19 -19
- package/src/reset-style-props.tsx +10 -3
package/dist/index.js
CHANGED
|
@@ -6118,6 +6118,7 @@ var import_editor_controls62 = require("@elementor/editor-controls");
|
|
|
6118
6118
|
var import_icons30 = require("@elementor/icons");
|
|
6119
6119
|
var import_i18n68 = require("@wordpress/i18n");
|
|
6120
6120
|
var { registerAction } = controlActionsMenu;
|
|
6121
|
+
var REPEATERS_SUPPORTED_FOR_RESET = ["background"];
|
|
6121
6122
|
function initResetStyleProps() {
|
|
6122
6123
|
registerAction({
|
|
6123
6124
|
id: "reset-style-value",
|
|
@@ -6126,13 +6127,16 @@ function initResetStyleProps() {
|
|
|
6126
6127
|
}
|
|
6127
6128
|
function useResetStyleValueProps() {
|
|
6128
6129
|
const isStyle = useIsStyle();
|
|
6129
|
-
const { value,
|
|
6130
|
+
const { value, resetValue, path, propType } = (0, import_editor_controls62.useBoundProp)();
|
|
6130
6131
|
const isInRepeater = path?.some((key) => !isNaN(Number(key)));
|
|
6132
|
+
const isRepeaterTypeSupported = REPEATERS_SUPPORTED_FOR_RESET.includes(path?.[0]);
|
|
6133
|
+
const isRequired = propType?.settings?.required;
|
|
6134
|
+
const shouldShowResetForRepeater = !isRequired && (!isInRepeater || isRepeaterTypeSupported);
|
|
6131
6135
|
return {
|
|
6132
|
-
visible: isStyle && value !== null && value !== void 0 &&
|
|
6136
|
+
visible: isStyle && value !== null && value !== void 0 && shouldShowResetForRepeater,
|
|
6133
6137
|
title: (0, import_i18n68.__)("Clear", "elementor"),
|
|
6134
6138
|
icon: import_icons30.BrushBigIcon,
|
|
6135
|
-
onClick: () =>
|
|
6139
|
+
onClick: () => resetValue()
|
|
6136
6140
|
};
|
|
6137
6141
|
}
|
|
6138
6142
|
|