@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.d.mts +2 -3
- package/dist/index.d.ts +2 -3
- package/dist/index.js +40 -42
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +38 -40
- 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/transition-control/data.ts +3 -3
- package/src/controls/transition-control/transition-repeater-control.tsx +8 -2
- package/src/controls/size-control/utils/has-size-value.ts +0 -5
package/dist/index.d.mts
CHANGED
|
@@ -666,7 +666,7 @@ type UnitSelectorProps<T extends string> = {
|
|
|
666
666
|
options: T[];
|
|
667
667
|
value: T;
|
|
668
668
|
onSelect: (value: T) => void;
|
|
669
|
-
|
|
669
|
+
isUnitHighlighted: boolean;
|
|
670
670
|
menuItemsAttributes?: {
|
|
671
671
|
[key in T]?: Record<string, unknown>;
|
|
672
672
|
};
|
|
@@ -698,12 +698,11 @@ type SizeValue = SizePropValue['value'];
|
|
|
698
698
|
type SizeUnit = SizePropValue['value']['unit'];
|
|
699
699
|
type Props$1 = SizeFieldProps<SizeValue, SizeUnit> & {
|
|
700
700
|
anchorRef?: RefObject<HTMLDivElement | null>;
|
|
701
|
-
isUnitActive?: boolean;
|
|
702
701
|
SizeFieldWrapper?: React$1.ComponentType<{
|
|
703
702
|
children: React$1.ReactNode;
|
|
704
703
|
}>;
|
|
705
704
|
};
|
|
706
|
-
declare const SizeComponent: ({ anchorRef,
|
|
705
|
+
declare const SizeComponent: ({ anchorRef, SizeFieldWrapper, ...sizeFieldProps }: Props$1) => React$1.JSX.Element;
|
|
707
706
|
|
|
708
707
|
type AnyComponentType = ComponentType<any>;
|
|
709
708
|
declare const brandSymbol: unique symbol;
|
package/dist/index.d.ts
CHANGED
|
@@ -666,7 +666,7 @@ type UnitSelectorProps<T extends string> = {
|
|
|
666
666
|
options: T[];
|
|
667
667
|
value: T;
|
|
668
668
|
onSelect: (value: T) => void;
|
|
669
|
-
|
|
669
|
+
isUnitHighlighted: boolean;
|
|
670
670
|
menuItemsAttributes?: {
|
|
671
671
|
[key in T]?: Record<string, unknown>;
|
|
672
672
|
};
|
|
@@ -698,12 +698,11 @@ type SizeValue = SizePropValue['value'];
|
|
|
698
698
|
type SizeUnit = SizePropValue['value']['unit'];
|
|
699
699
|
type Props$1 = SizeFieldProps<SizeValue, SizeUnit> & {
|
|
700
700
|
anchorRef?: RefObject<HTMLDivElement | null>;
|
|
701
|
-
isUnitActive?: boolean;
|
|
702
701
|
SizeFieldWrapper?: React$1.ComponentType<{
|
|
703
702
|
children: React$1.ReactNode;
|
|
704
703
|
}>;
|
|
705
704
|
};
|
|
706
|
-
declare const SizeComponent: ({ anchorRef,
|
|
705
|
+
declare const SizeComponent: ({ anchorRef, SizeFieldWrapper, ...sizeFieldProps }: Props$1) => React$1.JSX.Element;
|
|
707
706
|
|
|
708
707
|
type AnyComponentType = ComponentType<any>;
|
|
709
708
|
declare const brandSymbol: unique symbol;
|
package/dist/index.js
CHANGED
|
@@ -5789,6 +5789,7 @@ var import_react50 = require("react");
|
|
|
5789
5789
|
var import_editor_props50 = require("@elementor/editor-props");
|
|
5790
5790
|
var import_icons33 = require("@elementor/icons");
|
|
5791
5791
|
var import_ui84 = require("@elementor/ui");
|
|
5792
|
+
var import_utils7 = require("@elementor/utils");
|
|
5792
5793
|
var import_i18n50 = require("@wordpress/i18n");
|
|
5793
5794
|
|
|
5794
5795
|
// src/controls/selection-size-control.tsx
|
|
@@ -5842,9 +5843,9 @@ var MIN_PRO_VERSION = "3.35";
|
|
|
5842
5843
|
var getIsSiteRtl = () => {
|
|
5843
5844
|
return !!window.elementorFrontend?.config?.is_rtl;
|
|
5844
5845
|
};
|
|
5845
|
-
var
|
|
5846
|
+
var shouldShowAllTransitionProperties = () => {
|
|
5846
5847
|
if (!(0, import_utils6.hasProInstalled)()) {
|
|
5847
|
-
return
|
|
5848
|
+
return true;
|
|
5848
5849
|
}
|
|
5849
5850
|
const proVersion = window.elementorPro?.config?.version;
|
|
5850
5851
|
if (!proVersion) {
|
|
@@ -5981,7 +5982,7 @@ var createTransitionPropertiesList = () => {
|
|
|
5981
5982
|
]
|
|
5982
5983
|
}
|
|
5983
5984
|
];
|
|
5984
|
-
return
|
|
5985
|
+
return shouldShowAllTransitionProperties() ? baseProperties : [baseProperties[0]];
|
|
5985
5986
|
};
|
|
5986
5987
|
var transitionProperties = createTransitionPropertiesList();
|
|
5987
5988
|
var transitionsItemsList = transitionProperties.map((category) => ({
|
|
@@ -6330,6 +6331,7 @@ var TransitionRepeaterControl = createControl(
|
|
|
6330
6331
|
}) => {
|
|
6331
6332
|
const currentStyleIsNormal = currentStyleState === null;
|
|
6332
6333
|
const [recentlyUsedList, setRecentlyUsedList] = (0, import_react50.useState)([]);
|
|
6334
|
+
const proInstalled = (0, import_utils7.hasProInstalled)();
|
|
6333
6335
|
const { value, setValue } = useBoundProp(childArrayPropTypeUtil);
|
|
6334
6336
|
const { allDisabled: disabledItems, proDisabled: proDisabledItems } = (0, import_react50.useMemo)(
|
|
6335
6337
|
() => getDisabledItemLabels(value),
|
|
@@ -6338,10 +6340,14 @@ var TransitionRepeaterControl = createControl(
|
|
|
6338
6340
|
const allowedTransitionSet = (0, import_react50.useMemo)(() => {
|
|
6339
6341
|
const set = /* @__PURE__ */ new Set();
|
|
6340
6342
|
transitionProperties.forEach((category) => {
|
|
6341
|
-
category.properties.forEach((prop) =>
|
|
6343
|
+
category.properties.forEach((prop) => {
|
|
6344
|
+
if (!prop.isDisabled || proInstalled) {
|
|
6345
|
+
set.add(prop.value);
|
|
6346
|
+
}
|
|
6347
|
+
});
|
|
6342
6348
|
});
|
|
6343
6349
|
return set;
|
|
6344
|
-
}, []);
|
|
6350
|
+
}, [proInstalled]);
|
|
6345
6351
|
(0, import_react50.useEffect)(() => {
|
|
6346
6352
|
if (!value || value.length === 0) {
|
|
6347
6353
|
return;
|
|
@@ -6466,7 +6472,7 @@ var React101 = __toESM(require("react"));
|
|
|
6466
6472
|
var import_react53 = require("react");
|
|
6467
6473
|
var import_editor_props53 = require("@elementor/editor-props");
|
|
6468
6474
|
var import_ui87 = require("@elementor/ui");
|
|
6469
|
-
var
|
|
6475
|
+
var import_utils8 = require("@elementor/utils");
|
|
6470
6476
|
|
|
6471
6477
|
// src/components/inline-editor.tsx
|
|
6472
6478
|
var React100 = __toESM(require("react"));
|
|
@@ -6649,7 +6655,7 @@ var InlineEditingControl = createControl(
|
|
|
6649
6655
|
const { value, setValue } = useBoundProp(import_editor_props53.htmlV3PropTypeUtil);
|
|
6650
6656
|
const content = import_editor_props53.stringPropTypeUtil.extract(value?.content ?? null) ?? "";
|
|
6651
6657
|
const debouncedParse = (0, import_react53.useMemo)(
|
|
6652
|
-
() => (0,
|
|
6658
|
+
() => (0, import_utils8.debounce)((html) => {
|
|
6653
6659
|
const parsed = (0, import_editor_props53.parseHtmlChildren)(html);
|
|
6654
6660
|
setValue({
|
|
6655
6661
|
content: parsed.content ? import_editor_props53.stringPropTypeUtil.create(parsed.content) : null,
|
|
@@ -7024,7 +7030,7 @@ var menuItemContentStyles = {
|
|
|
7024
7030
|
};
|
|
7025
7031
|
var UnitSelector = ({
|
|
7026
7032
|
value,
|
|
7027
|
-
|
|
7033
|
+
isUnitHighlighted,
|
|
7028
7034
|
onSelect,
|
|
7029
7035
|
options,
|
|
7030
7036
|
disabled,
|
|
@@ -7039,7 +7045,16 @@ var UnitSelector = ({
|
|
|
7039
7045
|
onSelect(option);
|
|
7040
7046
|
popupState.close();
|
|
7041
7047
|
};
|
|
7042
|
-
return /* @__PURE__ */ React104.createElement(React104.Fragment, null, /* @__PURE__ */ React104.createElement(
|
|
7048
|
+
return /* @__PURE__ */ React104.createElement(React104.Fragment, null, /* @__PURE__ */ React104.createElement(
|
|
7049
|
+
StyledButton2,
|
|
7050
|
+
{
|
|
7051
|
+
isHighlighted: isUnitHighlighted,
|
|
7052
|
+
disabled,
|
|
7053
|
+
size: "small",
|
|
7054
|
+
...(0, import_ui89.bindTrigger)(popupState)
|
|
7055
|
+
},
|
|
7056
|
+
optionLabelOverrides[value] ?? value
|
|
7057
|
+
), /* @__PURE__ */ React104.createElement(import_ui89.Menu, { MenuListProps: { dense: true }, ...(0, import_ui89.bindMenu)(popupState) }, options.map((option) => /* @__PURE__ */ React104.createElement(
|
|
7043
7058
|
import_editor_ui14.MenuListItem,
|
|
7044
7059
|
{
|
|
7045
7060
|
key: option,
|
|
@@ -7060,19 +7075,14 @@ var UnitSelector = ({
|
|
|
7060
7075
|
))));
|
|
7061
7076
|
};
|
|
7062
7077
|
var StyledButton2 = (0, import_ui89.styled)(import_ui89.Button, {
|
|
7063
|
-
shouldForwardProp: (prop) => prop !== "
|
|
7064
|
-
})(({
|
|
7065
|
-
color:
|
|
7078
|
+
shouldForwardProp: (prop) => prop !== "isHighlighted"
|
|
7079
|
+
})(({ isHighlighted, theme }) => ({
|
|
7080
|
+
color: isHighlighted ? theme.palette.text.primary : theme.palette.text.tertiary,
|
|
7066
7081
|
font: "inherit",
|
|
7067
7082
|
minWidth: "initial",
|
|
7068
7083
|
textTransform: "uppercase"
|
|
7069
7084
|
}));
|
|
7070
7085
|
|
|
7071
|
-
// src/controls/size-control/utils/has-size-value.ts
|
|
7072
|
-
var hasSizeValue = (size) => {
|
|
7073
|
-
return Boolean(size) || size === 0;
|
|
7074
|
-
};
|
|
7075
|
-
|
|
7076
7086
|
// src/controls/size-control/size-field.tsx
|
|
7077
7087
|
var UNIT_DISPLAY_LABELS_OVERRIDES = {
|
|
7078
7088
|
custom: /* @__PURE__ */ React105.createElement(import_icons34.MathFunctionIcon, { fontSize: "tiny" })
|
|
@@ -7132,7 +7142,7 @@ var SizeField = ({
|
|
|
7132
7142
|
options: units2,
|
|
7133
7143
|
value: unit,
|
|
7134
7144
|
onSelect: handleUnitChange,
|
|
7135
|
-
|
|
7145
|
+
isUnitHighlighted: shouldHighlightUnit({ size, unit }),
|
|
7136
7146
|
...unitSelectorProps,
|
|
7137
7147
|
optionLabelOverrides: UNIT_DISPLAY_LABELS_OVERRIDES
|
|
7138
7148
|
}
|
|
@@ -7142,6 +7152,15 @@ var SizeField = ({
|
|
|
7142
7152
|
}
|
|
7143
7153
|
);
|
|
7144
7154
|
};
|
|
7155
|
+
var shouldHighlightUnit = (value) => {
|
|
7156
|
+
if (!value) {
|
|
7157
|
+
return false;
|
|
7158
|
+
}
|
|
7159
|
+
if (value.unit === EXTENDED_UNITS.auto) {
|
|
7160
|
+
return true;
|
|
7161
|
+
}
|
|
7162
|
+
return Boolean(value.size) || value.size === 0;
|
|
7163
|
+
};
|
|
7145
7164
|
|
|
7146
7165
|
// src/controls/size-control/ui/text-field-popover.tsx
|
|
7147
7166
|
var React106 = __toESM(require("react"));
|
|
@@ -7215,12 +7234,7 @@ var TextFieldPopover2 = ({ popupState, anchorRef, value, onChange, onClose }) =>
|
|
|
7215
7234
|
};
|
|
7216
7235
|
|
|
7217
7236
|
// src/controls/size-control/size-component.tsx
|
|
7218
|
-
var SizeComponent = ({
|
|
7219
|
-
anchorRef,
|
|
7220
|
-
isUnitActive,
|
|
7221
|
-
SizeFieldWrapper = React107.Fragment,
|
|
7222
|
-
...sizeFieldProps
|
|
7223
|
-
}) => {
|
|
7237
|
+
var SizeComponent = ({ anchorRef, SizeFieldWrapper = React107.Fragment, ...sizeFieldProps }) => {
|
|
7224
7238
|
const popupState = (0, import_ui92.usePopupState)({ variant: "popover" });
|
|
7225
7239
|
const activeBreakpoint = (0, import_editor_responsive4.useActiveBreakpoint)();
|
|
7226
7240
|
const isCustomUnit = sizeFieldProps?.value?.unit === EXTENDED_UNITS.custom;
|
|
@@ -7260,8 +7274,7 @@ var SizeComponent = ({
|
|
|
7260
7274
|
onClick: handleSizeFieldClick
|
|
7261
7275
|
},
|
|
7262
7276
|
unitSelectorProps: {
|
|
7263
|
-
menuItemsAttributes: hasCustomUnitOption ? { custom: popupAttributes } : void 0
|
|
7264
|
-
isActive: isUnitActive
|
|
7277
|
+
menuItemsAttributes: hasCustomUnitOption ? { custom: popupAttributes } : void 0
|
|
7265
7278
|
},
|
|
7266
7279
|
...sizeFieldProps
|
|
7267
7280
|
}
|
|
@@ -7289,7 +7302,6 @@ var resolveBoundPropValue = (value, boundPropPlaceholder, propPlaceholder) => {
|
|
|
7289
7302
|
}
|
|
7290
7303
|
return {
|
|
7291
7304
|
sizeValue,
|
|
7292
|
-
isUnitHighlighted: shouldHighlightUnit(value),
|
|
7293
7305
|
placeholder: resolvePlaceholder(propPlaceholder, boundPropPlaceholder)
|
|
7294
7306
|
};
|
|
7295
7307
|
};
|
|
@@ -7313,15 +7325,6 @@ var resolvePlaceholder = (propPlaceholder, boundPropPlaceholder) => {
|
|
|
7313
7325
|
}
|
|
7314
7326
|
return size;
|
|
7315
7327
|
};
|
|
7316
|
-
var shouldHighlightUnit = (value) => {
|
|
7317
|
-
if (!value) {
|
|
7318
|
-
return false;
|
|
7319
|
-
}
|
|
7320
|
-
if (value.unit === EXTENDED_UNITS.auto) {
|
|
7321
|
-
return true;
|
|
7322
|
-
}
|
|
7323
|
-
return hasSizeValue(value.size);
|
|
7324
|
-
};
|
|
7325
7328
|
|
|
7326
7329
|
// src/controls/size-control/utils/settings/get-prop-type-settings.ts
|
|
7327
7330
|
var getPropTypeSettings = (propType) => {
|
|
@@ -7369,11 +7372,7 @@ var UnstableSizeControl = createControl(
|
|
|
7369
7372
|
placeholder: boundPropPlaceholder,
|
|
7370
7373
|
restoreValue
|
|
7371
7374
|
} = useBoundProp(import_editor_props56.sizePropTypeUtil);
|
|
7372
|
-
const { sizeValue,
|
|
7373
|
-
value,
|
|
7374
|
-
boundPropPlaceholder,
|
|
7375
|
-
propPlaceholder
|
|
7376
|
-
);
|
|
7375
|
+
const { sizeValue, placeholder } = resolveBoundPropValue(value, boundPropPlaceholder, propPlaceholder);
|
|
7377
7376
|
const units2 = getSizeUnits(propType, variant);
|
|
7378
7377
|
const defaultUnit = getDefaultUnit(propType);
|
|
7379
7378
|
const handleBlur = () => {
|
|
@@ -7404,7 +7403,6 @@ var UnstableSizeControl = createControl(
|
|
|
7404
7403
|
anchorRef,
|
|
7405
7404
|
placeholder,
|
|
7406
7405
|
defaultUnit,
|
|
7407
|
-
isUnitActive: isUnitHighlighted,
|
|
7408
7406
|
onBlur: handleBlur,
|
|
7409
7407
|
setValue: handleChange,
|
|
7410
7408
|
SizeFieldWrapper: ControlActions,
|