@elementor/editor-controls 4.1.0-791 → 4.1.0-793
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 +4 -10
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +4 -10
- package/dist/index.mjs.map +1 -1
- package/package.json +15 -15
- package/src/controls/gap-control.tsx +1 -1
- package/src/controls/linked-dimensions-control.tsx +1 -1
- package/src/controls/size-control.tsx +2 -10
package/dist/index.js
CHANGED
|
@@ -1279,7 +1279,7 @@ var SizeControl = createControl(
|
|
|
1279
1279
|
const actualUnits = resolveUnits(propType, enablePropTypeUnits, variant, units2, actualExtendedOptions);
|
|
1280
1280
|
const popupState = (0, import_ui14.usePopupState)({ variant: "popover" });
|
|
1281
1281
|
const memorizedExternalState = (0, import_react14.useMemo)(
|
|
1282
|
-
() =>
|
|
1282
|
+
() => createStateFromSizeProp(sizeValue, actualDefaultUnit),
|
|
1283
1283
|
[sizeValue, actualDefaultUnit]
|
|
1284
1284
|
);
|
|
1285
1285
|
const [state, setState] = useSyncExternalState({
|
|
@@ -1293,12 +1293,6 @@ var SizeControl = createControl(
|
|
|
1293
1293
|
})
|
|
1294
1294
|
});
|
|
1295
1295
|
const { size: controlSize = DEFAULT_SIZE, unit: controlUnit = actualDefaultUnit } = extractValueFromState(state, true) || {};
|
|
1296
|
-
const handleBlur = () => {
|
|
1297
|
-
if (!extractValueFromState(state)) {
|
|
1298
|
-
setState((prev) => ({ ...prev, unit: actualDefaultUnit }));
|
|
1299
|
-
}
|
|
1300
|
-
restoreValue();
|
|
1301
|
-
};
|
|
1302
1296
|
const handleUnitChange = (newUnit) => {
|
|
1303
1297
|
if (newUnit === "custom") {
|
|
1304
1298
|
popupState.open(anchorRef?.current);
|
|
@@ -1346,7 +1340,7 @@ var SizeControl = createControl(
|
|
|
1346
1340
|
startIcon,
|
|
1347
1341
|
handleSizeChange,
|
|
1348
1342
|
handleUnitChange,
|
|
1349
|
-
onBlur:
|
|
1343
|
+
onBlur: restoreValue,
|
|
1350
1344
|
onClick: onInputClick,
|
|
1351
1345
|
popupState,
|
|
1352
1346
|
min,
|
|
@@ -3759,7 +3753,7 @@ var LinkedDimensionsControl = ({ label, isSiteRtl = false, min }) => {
|
|
|
3759
3753
|
const linkedLabel = (0, import_i18n20.__)("Link %s", "elementor").replace("%s", tooltipLabel);
|
|
3760
3754
|
const unlinkedLabel = (0, import_i18n20.__)("Unlink %s", "elementor").replace("%s", tooltipLabel);
|
|
3761
3755
|
const disabled = sizeDisabled || dimensionsDisabled;
|
|
3762
|
-
const effectiveDimensionsPlaceholder = dimensionsPlaceholder ?? (
|
|
3756
|
+
const effectiveDimensionsPlaceholder = dimensionsPlaceholder ?? (!isLinked ? {
|
|
3763
3757
|
"block-start": masterPlaceholder,
|
|
3764
3758
|
"block-end": masterPlaceholder,
|
|
3765
3759
|
"inline-start": masterPlaceholder,
|
|
@@ -4759,7 +4753,7 @@ var GapControl = ({ label }) => {
|
|
|
4759
4753
|
const disabled = sizeDisabled || directionDisabled;
|
|
4760
4754
|
const propProviderProps = {
|
|
4761
4755
|
propType,
|
|
4762
|
-
value: directionValue,
|
|
4756
|
+
value: directionValue ?? (!isLinked ? { row: masterPlaceholder, column: masterPlaceholder } : null),
|
|
4763
4757
|
setValue: (directions) => {
|
|
4764
4758
|
const entries = Object.entries(directions);
|
|
4765
4759
|
const filtered = entries.filter(([, value]) => Boolean(value));
|