@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.mjs CHANGED
@@ -1172,7 +1172,7 @@ var SizeControl = createControl(
1172
1172
  const actualUnits = resolveUnits(propType, enablePropTypeUnits, variant, units2, actualExtendedOptions);
1173
1173
  const popupState = usePopupState2({ variant: "popover" });
1174
1174
  const memorizedExternalState = useMemo2(
1175
- () => sizeValue ? createStateFromSizeProp(sizeValue, actualDefaultUnit) : null,
1175
+ () => createStateFromSizeProp(sizeValue, actualDefaultUnit),
1176
1176
  [sizeValue, actualDefaultUnit]
1177
1177
  );
1178
1178
  const [state, setState] = useSyncExternalState({
@@ -1186,12 +1186,6 @@ var SizeControl = createControl(
1186
1186
  })
1187
1187
  });
1188
1188
  const { size: controlSize = DEFAULT_SIZE, unit: controlUnit = actualDefaultUnit } = extractValueFromState(state, true) || {};
1189
- const handleBlur = () => {
1190
- if (!extractValueFromState(state)) {
1191
- setState((prev) => ({ ...prev, unit: actualDefaultUnit }));
1192
- }
1193
- restoreValue();
1194
- };
1195
1189
  const handleUnitChange = (newUnit) => {
1196
1190
  if (newUnit === "custom") {
1197
1191
  popupState.open(anchorRef?.current);
@@ -1239,7 +1233,7 @@ var SizeControl = createControl(
1239
1233
  startIcon,
1240
1234
  handleSizeChange,
1241
1235
  handleUnitChange,
1242
- onBlur: handleBlur,
1236
+ onBlur: restoreValue,
1243
1237
  onClick: onInputClick,
1244
1238
  popupState,
1245
1239
  min,
@@ -3681,7 +3675,7 @@ var LinkedDimensionsControl = ({ label, isSiteRtl = false, min }) => {
3681
3675
  const linkedLabel = __20("Link %s", "elementor").replace("%s", tooltipLabel);
3682
3676
  const unlinkedLabel = __20("Unlink %s", "elementor").replace("%s", tooltipLabel);
3683
3677
  const disabled = sizeDisabled || dimensionsDisabled;
3684
- const effectiveDimensionsPlaceholder = dimensionsPlaceholder ?? (sizePropTypeUtil5.extract(masterPlaceholder) ? {
3678
+ const effectiveDimensionsPlaceholder = dimensionsPlaceholder ?? (!isLinked ? {
3685
3679
  "block-start": masterPlaceholder,
3686
3680
  "block-end": masterPlaceholder,
3687
3681
  "inline-start": masterPlaceholder,
@@ -4695,7 +4689,7 @@ var GapControl = ({ label }) => {
4695
4689
  const disabled = sizeDisabled || directionDisabled;
4696
4690
  const propProviderProps = {
4697
4691
  propType,
4698
- value: directionValue,
4692
+ value: directionValue ?? (!isLinked ? { row: masterPlaceholder, column: masterPlaceholder } : null),
4699
4693
  setValue: (directions) => {
4700
4694
  const entries = Object.entries(directions);
4701
4695
  const filtered = entries.filter(([, value]) => Boolean(value));