@elementor/editor-controls 4.1.0-724 → 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.mjs CHANGED
@@ -5765,6 +5765,7 @@ import {
5765
5765
  } from "@elementor/editor-props";
5766
5766
  import { InfoCircleFilledIcon as InfoCircleFilledIcon3 } from "@elementor/icons";
5767
5767
  import { Alert as Alert2, AlertTitle as AlertTitle3, Box as Box20, Typography as Typography8 } from "@elementor/ui";
5768
+ import { hasProInstalled as hasProInstalled2 } from "@elementor/utils";
5768
5769
  import { __ as __50 } from "@wordpress/i18n";
5769
5770
 
5770
5771
  // src/controls/selection-size-control.tsx
@@ -5818,9 +5819,9 @@ var MIN_PRO_VERSION = "3.35";
5818
5819
  var getIsSiteRtl = () => {
5819
5820
  return !!window.elementorFrontend?.config?.is_rtl;
5820
5821
  };
5821
- var shouldExtendTransitionProperties = () => {
5822
+ var shouldShowAllTransitionProperties = () => {
5822
5823
  if (!hasProInstalled()) {
5823
- return false;
5824
+ return true;
5824
5825
  }
5825
5826
  const proVersion = window.elementorPro?.config?.version;
5826
5827
  if (!proVersion) {
@@ -5957,7 +5958,7 @@ var createTransitionPropertiesList = () => {
5957
5958
  ]
5958
5959
  }
5959
5960
  ];
5960
- return shouldExtendTransitionProperties() ? baseProperties : [baseProperties[0]];
5961
+ return shouldShowAllTransitionProperties() ? baseProperties : [baseProperties[0]];
5961
5962
  };
5962
5963
  var transitionProperties = createTransitionPropertiesList();
5963
5964
  var transitionsItemsList = transitionProperties.map((category) => ({
@@ -6306,6 +6307,7 @@ var TransitionRepeaterControl = createControl(
6306
6307
  }) => {
6307
6308
  const currentStyleIsNormal = currentStyleState === null;
6308
6309
  const [recentlyUsedList, setRecentlyUsedList] = useState16([]);
6310
+ const proInstalled = hasProInstalled2();
6309
6311
  const { value, setValue } = useBoundProp(childArrayPropTypeUtil);
6310
6312
  const { allDisabled: disabledItems, proDisabled: proDisabledItems } = useMemo13(
6311
6313
  () => getDisabledItemLabels(value),
@@ -6314,10 +6316,14 @@ var TransitionRepeaterControl = createControl(
6314
6316
  const allowedTransitionSet = useMemo13(() => {
6315
6317
  const set = /* @__PURE__ */ new Set();
6316
6318
  transitionProperties.forEach((category) => {
6317
- category.properties.forEach((prop) => set.add(prop.value));
6319
+ category.properties.forEach((prop) => {
6320
+ if (!prop.isDisabled || proInstalled) {
6321
+ set.add(prop.value);
6322
+ }
6323
+ });
6318
6324
  });
6319
6325
  return set;
6320
- }, []);
6326
+ }, [proInstalled]);
6321
6327
  useEffect11(() => {
6322
6328
  if (!value || value.length === 0) {
6323
6329
  return;
@@ -7003,7 +7009,7 @@ var menuItemContentStyles = {
7003
7009
  };
7004
7010
  var UnitSelector = ({
7005
7011
  value,
7006
- isActive,
7012
+ isUnitHighlighted,
7007
7013
  onSelect,
7008
7014
  options,
7009
7015
  disabled,
@@ -7018,7 +7024,16 @@ var UnitSelector = ({
7018
7024
  onSelect(option);
7019
7025
  popupState.close();
7020
7026
  };
7021
- return /* @__PURE__ */ React104.createElement(React104.Fragment, null, /* @__PURE__ */ React104.createElement(StyledButton2, { isActive, disabled, size: "small", ...bindTrigger6(popupState) }, optionLabelOverrides[value] ?? value), /* @__PURE__ */ React104.createElement(Menu3, { MenuListProps: { dense: true }, ...bindMenu2(popupState) }, options.map((option) => /* @__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(
7022
7037
  MenuListItem7,
7023
7038
  {
7024
7039
  key: option,
@@ -7039,19 +7054,14 @@ var UnitSelector = ({
7039
7054
  ))));
7040
7055
  };
7041
7056
  var StyledButton2 = styled9(Button6, {
7042
- shouldForwardProp: (prop) => prop !== "isActive"
7043
- })(({ isActive, theme }) => ({
7044
- color: isActive ? theme.palette.text.primary : theme.palette.text.tertiary,
7057
+ shouldForwardProp: (prop) => prop !== "isHighlighted"
7058
+ })(({ isHighlighted, theme }) => ({
7059
+ color: isHighlighted ? theme.palette.text.primary : theme.palette.text.tertiary,
7045
7060
  font: "inherit",
7046
7061
  minWidth: "initial",
7047
7062
  textTransform: "uppercase"
7048
7063
  }));
7049
7064
 
7050
- // src/controls/size-control/utils/has-size-value.ts
7051
- var hasSizeValue = (size) => {
7052
- return Boolean(size) || size === 0;
7053
- };
7054
-
7055
7065
  // src/controls/size-control/size-field.tsx
7056
7066
  var UNIT_DISPLAY_LABELS_OVERRIDES = {
7057
7067
  custom: /* @__PURE__ */ React105.createElement(MathFunctionIcon3, { fontSize: "tiny" })
@@ -7111,7 +7121,7 @@ var SizeField = ({
7111
7121
  options: units2,
7112
7122
  value: unit,
7113
7123
  onSelect: handleUnitChange,
7114
- isActive: unitSelectorProps?.isActive ?? hasSizeValue(size),
7124
+ isUnitHighlighted: shouldHighlightUnit({ size, unit }),
7115
7125
  ...unitSelectorProps,
7116
7126
  optionLabelOverrides: UNIT_DISPLAY_LABELS_OVERRIDES
7117
7127
  }
@@ -7121,6 +7131,15 @@ var SizeField = ({
7121
7131
  }
7122
7132
  );
7123
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
+ };
7124
7143
 
7125
7144
  // src/controls/size-control/ui/text-field-popover.tsx
7126
7145
  import * as React106 from "react";
@@ -7194,12 +7213,7 @@ var TextFieldPopover2 = ({ popupState, anchorRef, value, onChange, onClose }) =>
7194
7213
  };
7195
7214
 
7196
7215
  // src/controls/size-control/size-component.tsx
7197
- var SizeComponent = ({
7198
- anchorRef,
7199
- isUnitActive,
7200
- SizeFieldWrapper = React107.Fragment,
7201
- ...sizeFieldProps
7202
- }) => {
7216
+ var SizeComponent = ({ anchorRef, SizeFieldWrapper = React107.Fragment, ...sizeFieldProps }) => {
7203
7217
  const popupState = usePopupState9({ variant: "popover" });
7204
7218
  const activeBreakpoint = useActiveBreakpoint4();
7205
7219
  const isCustomUnit = sizeFieldProps?.value?.unit === EXTENDED_UNITS.custom;
@@ -7239,8 +7253,7 @@ var SizeComponent = ({
7239
7253
  onClick: handleSizeFieldClick
7240
7254
  },
7241
7255
  unitSelectorProps: {
7242
- menuItemsAttributes: hasCustomUnitOption ? { custom: popupAttributes } : void 0,
7243
- isActive: isUnitActive
7256
+ menuItemsAttributes: hasCustomUnitOption ? { custom: popupAttributes } : void 0
7244
7257
  },
7245
7258
  ...sizeFieldProps
7246
7259
  }
@@ -7268,7 +7281,6 @@ var resolveBoundPropValue = (value, boundPropPlaceholder, propPlaceholder) => {
7268
7281
  }
7269
7282
  return {
7270
7283
  sizeValue,
7271
- isUnitHighlighted: shouldHighlightUnit(value),
7272
7284
  placeholder: resolvePlaceholder(propPlaceholder, boundPropPlaceholder)
7273
7285
  };
7274
7286
  };
@@ -7292,15 +7304,6 @@ var resolvePlaceholder = (propPlaceholder, boundPropPlaceholder) => {
7292
7304
  }
7293
7305
  return size;
7294
7306
  };
7295
- var shouldHighlightUnit = (value) => {
7296
- if (!value) {
7297
- return false;
7298
- }
7299
- if (value.unit === EXTENDED_UNITS.auto) {
7300
- return true;
7301
- }
7302
- return hasSizeValue(value.size);
7303
- };
7304
7307
 
7305
7308
  // src/controls/size-control/utils/settings/get-prop-type-settings.ts
7306
7309
  var getPropTypeSettings = (propType) => {
@@ -7348,11 +7351,7 @@ var UnstableSizeControl = createControl(
7348
7351
  placeholder: boundPropPlaceholder,
7349
7352
  restoreValue
7350
7353
  } = useBoundProp(sizePropTypeUtil6);
7351
- const { sizeValue, isUnitHighlighted, placeholder } = resolveBoundPropValue(
7352
- value,
7353
- boundPropPlaceholder,
7354
- propPlaceholder
7355
- );
7354
+ const { sizeValue, placeholder } = resolveBoundPropValue(value, boundPropPlaceholder, propPlaceholder);
7356
7355
  const units2 = getSizeUnits(propType, variant);
7357
7356
  const defaultUnit = getDefaultUnit(propType);
7358
7357
  const handleBlur = () => {
@@ -7383,7 +7382,6 @@ var UnstableSizeControl = createControl(
7383
7382
  anchorRef,
7384
7383
  placeholder,
7385
7384
  defaultUnit,
7386
- isUnitActive: isUnitHighlighted,
7387
7385
  onBlur: handleBlur,
7388
7386
  setValue: handleChange,
7389
7387
  SizeFieldWrapper: ControlActions,