@elementor/editor-controls 4.1.0-725 → 4.1.0-726
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.d.mts +2 -3
- package/dist/index.d.ts +2 -3
- package/dist/index.js +27 -35
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +27 -35
- package/dist/index.mjs.map +1 -1
- package/package.json +15 -15
- package/src/controls/size-control/size-component.tsx +1 -8
- package/src/controls/size-control/size-field.tsx +14 -2
- package/src/controls/size-control/ui/unit-selector.tsx +11 -6
- package/src/controls/size-control/unstable-size-control.tsx +1 -6
- package/src/controls/size-control/utils/resolve-bound-prop-value.ts +0 -17
- package/src/controls/size-control/utils/has-size-value.ts +0 -5
package/dist/index.mjs
CHANGED
|
@@ -7009,7 +7009,7 @@ var menuItemContentStyles = {
|
|
|
7009
7009
|
};
|
|
7010
7010
|
var UnitSelector = ({
|
|
7011
7011
|
value,
|
|
7012
|
-
|
|
7012
|
+
isUnitHighlighted,
|
|
7013
7013
|
onSelect,
|
|
7014
7014
|
options,
|
|
7015
7015
|
disabled,
|
|
@@ -7024,7 +7024,16 @@ var UnitSelector = ({
|
|
|
7024
7024
|
onSelect(option);
|
|
7025
7025
|
popupState.close();
|
|
7026
7026
|
};
|
|
7027
|
-
return /* @__PURE__ */ React104.createElement(React104.Fragment, null, /* @__PURE__ */ React104.createElement(
|
|
7027
|
+
return /* @__PURE__ */ React104.createElement(React104.Fragment, null, /* @__PURE__ */ React104.createElement(
|
|
7028
|
+
StyledButton2,
|
|
7029
|
+
{
|
|
7030
|
+
isHighlighted: isUnitHighlighted,
|
|
7031
|
+
disabled,
|
|
7032
|
+
size: "small",
|
|
7033
|
+
...bindTrigger6(popupState)
|
|
7034
|
+
},
|
|
7035
|
+
optionLabelOverrides[value] ?? value
|
|
7036
|
+
), /* @__PURE__ */ React104.createElement(Menu3, { MenuListProps: { dense: true }, ...bindMenu2(popupState) }, options.map((option) => /* @__PURE__ */ React104.createElement(
|
|
7028
7037
|
MenuListItem7,
|
|
7029
7038
|
{
|
|
7030
7039
|
key: option,
|
|
@@ -7045,19 +7054,14 @@ var UnitSelector = ({
|
|
|
7045
7054
|
))));
|
|
7046
7055
|
};
|
|
7047
7056
|
var StyledButton2 = styled9(Button6, {
|
|
7048
|
-
shouldForwardProp: (prop) => prop !== "
|
|
7049
|
-
})(({
|
|
7050
|
-
color:
|
|
7057
|
+
shouldForwardProp: (prop) => prop !== "isHighlighted"
|
|
7058
|
+
})(({ isHighlighted, theme }) => ({
|
|
7059
|
+
color: isHighlighted ? theme.palette.text.primary : theme.palette.text.tertiary,
|
|
7051
7060
|
font: "inherit",
|
|
7052
7061
|
minWidth: "initial",
|
|
7053
7062
|
textTransform: "uppercase"
|
|
7054
7063
|
}));
|
|
7055
7064
|
|
|
7056
|
-
// src/controls/size-control/utils/has-size-value.ts
|
|
7057
|
-
var hasSizeValue = (size) => {
|
|
7058
|
-
return Boolean(size) || size === 0;
|
|
7059
|
-
};
|
|
7060
|
-
|
|
7061
7065
|
// src/controls/size-control/size-field.tsx
|
|
7062
7066
|
var UNIT_DISPLAY_LABELS_OVERRIDES = {
|
|
7063
7067
|
custom: /* @__PURE__ */ React105.createElement(MathFunctionIcon3, { fontSize: "tiny" })
|
|
@@ -7117,7 +7121,7 @@ var SizeField = ({
|
|
|
7117
7121
|
options: units2,
|
|
7118
7122
|
value: unit,
|
|
7119
7123
|
onSelect: handleUnitChange,
|
|
7120
|
-
|
|
7124
|
+
isUnitHighlighted: shouldHighlightUnit({ size, unit }),
|
|
7121
7125
|
...unitSelectorProps,
|
|
7122
7126
|
optionLabelOverrides: UNIT_DISPLAY_LABELS_OVERRIDES
|
|
7123
7127
|
}
|
|
@@ -7127,6 +7131,15 @@ var SizeField = ({
|
|
|
7127
7131
|
}
|
|
7128
7132
|
);
|
|
7129
7133
|
};
|
|
7134
|
+
var shouldHighlightUnit = (value) => {
|
|
7135
|
+
if (!value) {
|
|
7136
|
+
return false;
|
|
7137
|
+
}
|
|
7138
|
+
if (value.unit === EXTENDED_UNITS.auto) {
|
|
7139
|
+
return true;
|
|
7140
|
+
}
|
|
7141
|
+
return Boolean(value.size) || value.size === 0;
|
|
7142
|
+
};
|
|
7130
7143
|
|
|
7131
7144
|
// src/controls/size-control/ui/text-field-popover.tsx
|
|
7132
7145
|
import * as React106 from "react";
|
|
@@ -7200,12 +7213,7 @@ var TextFieldPopover2 = ({ popupState, anchorRef, value, onChange, onClose }) =>
|
|
|
7200
7213
|
};
|
|
7201
7214
|
|
|
7202
7215
|
// src/controls/size-control/size-component.tsx
|
|
7203
|
-
var SizeComponent = ({
|
|
7204
|
-
anchorRef,
|
|
7205
|
-
isUnitActive,
|
|
7206
|
-
SizeFieldWrapper = React107.Fragment,
|
|
7207
|
-
...sizeFieldProps
|
|
7208
|
-
}) => {
|
|
7216
|
+
var SizeComponent = ({ anchorRef, SizeFieldWrapper = React107.Fragment, ...sizeFieldProps }) => {
|
|
7209
7217
|
const popupState = usePopupState9({ variant: "popover" });
|
|
7210
7218
|
const activeBreakpoint = useActiveBreakpoint4();
|
|
7211
7219
|
const isCustomUnit = sizeFieldProps?.value?.unit === EXTENDED_UNITS.custom;
|
|
@@ -7245,8 +7253,7 @@ var SizeComponent = ({
|
|
|
7245
7253
|
onClick: handleSizeFieldClick
|
|
7246
7254
|
},
|
|
7247
7255
|
unitSelectorProps: {
|
|
7248
|
-
menuItemsAttributes: hasCustomUnitOption ? { custom: popupAttributes } : void 0
|
|
7249
|
-
isActive: isUnitActive
|
|
7256
|
+
menuItemsAttributes: hasCustomUnitOption ? { custom: popupAttributes } : void 0
|
|
7250
7257
|
},
|
|
7251
7258
|
...sizeFieldProps
|
|
7252
7259
|
}
|
|
@@ -7274,7 +7281,6 @@ var resolveBoundPropValue = (value, boundPropPlaceholder, propPlaceholder) => {
|
|
|
7274
7281
|
}
|
|
7275
7282
|
return {
|
|
7276
7283
|
sizeValue,
|
|
7277
|
-
isUnitHighlighted: shouldHighlightUnit(value),
|
|
7278
7284
|
placeholder: resolvePlaceholder(propPlaceholder, boundPropPlaceholder)
|
|
7279
7285
|
};
|
|
7280
7286
|
};
|
|
@@ -7298,15 +7304,6 @@ var resolvePlaceholder = (propPlaceholder, boundPropPlaceholder) => {
|
|
|
7298
7304
|
}
|
|
7299
7305
|
return size;
|
|
7300
7306
|
};
|
|
7301
|
-
var shouldHighlightUnit = (value) => {
|
|
7302
|
-
if (!value) {
|
|
7303
|
-
return false;
|
|
7304
|
-
}
|
|
7305
|
-
if (value.unit === EXTENDED_UNITS.auto) {
|
|
7306
|
-
return true;
|
|
7307
|
-
}
|
|
7308
|
-
return hasSizeValue(value.size);
|
|
7309
|
-
};
|
|
7310
7307
|
|
|
7311
7308
|
// src/controls/size-control/utils/settings/get-prop-type-settings.ts
|
|
7312
7309
|
var getPropTypeSettings = (propType) => {
|
|
@@ -7354,11 +7351,7 @@ var UnstableSizeControl = createControl(
|
|
|
7354
7351
|
placeholder: boundPropPlaceholder,
|
|
7355
7352
|
restoreValue
|
|
7356
7353
|
} = useBoundProp(sizePropTypeUtil6);
|
|
7357
|
-
const { sizeValue,
|
|
7358
|
-
value,
|
|
7359
|
-
boundPropPlaceholder,
|
|
7360
|
-
propPlaceholder
|
|
7361
|
-
);
|
|
7354
|
+
const { sizeValue, placeholder } = resolveBoundPropValue(value, boundPropPlaceholder, propPlaceholder);
|
|
7362
7355
|
const units2 = getSizeUnits(propType, variant);
|
|
7363
7356
|
const defaultUnit = getDefaultUnit(propType);
|
|
7364
7357
|
const handleBlur = () => {
|
|
@@ -7389,7 +7382,6 @@ var UnstableSizeControl = createControl(
|
|
|
7389
7382
|
anchorRef,
|
|
7390
7383
|
placeholder,
|
|
7391
7384
|
defaultUnit,
|
|
7392
|
-
isUnitActive: isUnitHighlighted,
|
|
7393
7385
|
onBlur: handleBlur,
|
|
7394
7386
|
setValue: handleChange,
|
|
7395
7387
|
SizeFieldWrapper: ControlActions,
|