@elementor/editor-controls 4.1.0-710 → 4.1.0-712
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 +137 -74
- package/dist/index.d.ts +137 -74
- package/dist/index.js +791 -162
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +767 -140
- package/dist/index.mjs.map +1 -1
- package/package.json +15 -15
- package/src/controls/email-form-action-control.tsx +2 -2
- package/src/controls/size-control/hooks/use-size-unit-keyboard.tsx +12 -1
- package/src/controls/size-control/hooks/use-size-value.ts +12 -16
- package/src/controls/size-control/size-component.tsx +38 -17
- package/src/controls/size-control/size-field.tsx +37 -13
- package/src/controls/size-control/sync/get-units.ts +15 -1
- package/src/controls/size-control/types.ts +8 -0
- package/src/controls/size-control/unstable-size-control.tsx +86 -0
- package/src/controls/size-control/utils/has-size-value.ts +5 -0
- package/src/controls/size-control/utils/resolve-bound-prop-value.ts +72 -0
- package/src/controls/size-control/utils/resolve-size-value.ts +4 -3
- package/src/controls/size-control/utils/settings/get-default-unit.ts +7 -0
- package/src/controls/size-control/utils/settings/get-prop-type-settings.ts +12 -0
- package/src/controls/size-control/utils/settings/get-size-units.ts +23 -0
- package/src/controls/size-control/utils/should-nullify-value.ts +15 -0
- package/src/index.ts +2 -0
- package/src/controls/size-control/utils/is-numeric-value.ts +0 -11
package/dist/index.js
CHANGED
|
@@ -72,6 +72,7 @@ __export(index_exports, {
|
|
|
72
72
|
Repeater: () => Repeater3,
|
|
73
73
|
SelectControl: () => SelectControl,
|
|
74
74
|
SelectControlWrapper: () => SelectControlWrapper,
|
|
75
|
+
SizeComponent: () => SizeComponent,
|
|
75
76
|
SizeControl: () => SizeControl,
|
|
76
77
|
StrokeControl: () => StrokeControl,
|
|
77
78
|
SvgMediaControl: () => SvgMediaControl,
|
|
@@ -83,6 +84,7 @@ __export(index_exports, {
|
|
|
83
84
|
TransformRepeaterControl: () => TransformRepeaterControl,
|
|
84
85
|
TransformSettingsControl: () => TransformSettingsControl,
|
|
85
86
|
TransitionRepeaterControl: () => TransitionRepeaterControl,
|
|
87
|
+
UnstableSizeControl: () => UnstableSizeControl,
|
|
86
88
|
UnstableSizeField: () => UnstableSizeField,
|
|
87
89
|
UrlControl: () => UrlControl,
|
|
88
90
|
VideoMediaControl: () => VideoMediaControl,
|
|
@@ -755,14 +757,14 @@ var TextFieldInnerSelection = (0, import_react9.forwardRef)(
|
|
|
755
757
|
id
|
|
756
758
|
}, ref) => {
|
|
757
759
|
const { placeholder: boundPropPlaceholder } = useBoundProp(import_editor_props6.sizePropTypeUtil);
|
|
758
|
-
const
|
|
760
|
+
const getCursorStyle3 = () => ({
|
|
759
761
|
input: { cursor: InputProps.readOnly ? "default !important" : void 0 }
|
|
760
762
|
});
|
|
761
763
|
return /* @__PURE__ */ React17.createElement(
|
|
762
764
|
NumberInput,
|
|
763
765
|
{
|
|
764
766
|
ref,
|
|
765
|
-
sx:
|
|
767
|
+
sx: getCursorStyle3(),
|
|
766
768
|
size: "tiny",
|
|
767
769
|
fullWidth: true,
|
|
768
770
|
type,
|
|
@@ -6754,7 +6756,7 @@ var FromNameField = () => /* @__PURE__ */ React102.createElement(
|
|
|
6754
6756
|
var ReplyToField = () => /* @__PURE__ */ React102.createElement(EmailField, { bind: "reply-to", label: (0, import_i18n51.__)("Reply-to", "elementor") });
|
|
6755
6757
|
var CcField = () => /* @__PURE__ */ React102.createElement(EmailField, { bind: "cc", label: (0, import_i18n51.__)("Cc", "elementor") });
|
|
6756
6758
|
var BccField = () => /* @__PURE__ */ React102.createElement(EmailField, { bind: "bcc", label: (0, import_i18n51.__)("Bcc", "elementor") });
|
|
6757
|
-
var MetaDataField = () => /* @__PURE__ */ React102.createElement(PropKeyProvider, { bind: "meta-data" }, /* @__PURE__ */ React102.createElement(import_ui88.Stack, { gap: 0.5 }, /* @__PURE__ */ React102.createElement(
|
|
6759
|
+
var MetaDataField = () => /* @__PURE__ */ React102.createElement(PropKeyProvider, { bind: "meta-data" }, /* @__PURE__ */ React102.createElement(import_ui88.Stack, { gap: 0.5 }, /* @__PURE__ */ React102.createElement(ControlFormLabel, null, (0, import_i18n51.__)("Metadata", "elementor")), /* @__PURE__ */ React102.createElement(
|
|
6758
6760
|
ChipsControl,
|
|
6759
6761
|
{
|
|
6760
6762
|
options: [
|
|
@@ -6778,29 +6780,654 @@ var SendAsField = () => /* @__PURE__ */ React102.createElement(PropKeyProvider,
|
|
|
6778
6780
|
var AdvancedSettings = () => /* @__PURE__ */ React102.createElement(import_editor_ui13.CollapsibleContent, { defaultOpen: false }, /* @__PURE__ */ React102.createElement(import_ui88.Box, { sx: { pt: 2 } }, /* @__PURE__ */ React102.createElement(import_ui88.Stack, { gap: 2 }, /* @__PURE__ */ React102.createElement(FromNameField, null), /* @__PURE__ */ React102.createElement(ReplyToField, null), /* @__PURE__ */ React102.createElement(CcField, null), /* @__PURE__ */ React102.createElement(BccField, null), /* @__PURE__ */ React102.createElement(import_ui88.Divider, null), /* @__PURE__ */ React102.createElement(MetaDataField, null), /* @__PURE__ */ React102.createElement(SendAsField, null))));
|
|
6779
6781
|
var EmailFormActionControl = createControl(() => {
|
|
6780
6782
|
const { value, setValue, ...propContext } = useBoundProp(import_editor_props54.emailPropTypeUtil);
|
|
6781
|
-
return /* @__PURE__ */ React102.createElement(PropProvider, { ...propContext, value, setValue }, /* @__PURE__ */ React102.createElement(import_ui88.Stack, { gap: 2 }, /* @__PURE__ */ React102.createElement(
|
|
6783
|
+
return /* @__PURE__ */ React102.createElement(PropProvider, { ...propContext, value, setValue }, /* @__PURE__ */ React102.createElement(import_ui88.Stack, { gap: 2 }, /* @__PURE__ */ React102.createElement(ControlLabel, null, (0, import_i18n51.__)("Email settings", "elementor")), /* @__PURE__ */ React102.createElement(SendToField, null), /* @__PURE__ */ React102.createElement(SubjectField, null), /* @__PURE__ */ React102.createElement(MessageField, null), /* @__PURE__ */ React102.createElement(FromEmailField, null), /* @__PURE__ */ React102.createElement(AdvancedSettings, null)));
|
|
6782
6784
|
});
|
|
6783
6785
|
|
|
6784
|
-
// src/
|
|
6785
|
-
var
|
|
6786
|
-
var
|
|
6786
|
+
// src/controls/size-control/unstable-size-control.tsx
|
|
6787
|
+
var React108 = __toESM(require("react"));
|
|
6788
|
+
var import_editor_props56 = require("@elementor/editor-props");
|
|
6789
|
+
|
|
6790
|
+
// src/controls/size-control/size-component.tsx
|
|
6791
|
+
var React107 = __toESM(require("react"));
|
|
6792
|
+
var import_react58 = require("react");
|
|
6793
|
+
var import_editor_responsive4 = require("@elementor/editor-responsive");
|
|
6794
|
+
var import_ui92 = require("@elementor/ui");
|
|
6795
|
+
|
|
6796
|
+
// src/controls/size-control/size-field.tsx
|
|
6797
|
+
var React105 = __toESM(require("react"));
|
|
6787
6798
|
var import_icons34 = require("@elementor/icons");
|
|
6788
6799
|
var import_ui90 = require("@elementor/ui");
|
|
6789
|
-
var import_i18n52 = require("@wordpress/i18n");
|
|
6790
6800
|
|
|
6791
|
-
// src/
|
|
6792
|
-
var
|
|
6801
|
+
// src/controls/size-control/sync/get-units.ts
|
|
6802
|
+
var getLengthUnits = () => {
|
|
6803
|
+
return window.elementor?.config?.size_units?.length ?? [];
|
|
6804
|
+
};
|
|
6805
|
+
var getAngleUnits = () => {
|
|
6806
|
+
return window.elementor?.config?.size_units?.angle ?? [];
|
|
6807
|
+
};
|
|
6808
|
+
var getTimeUnits = () => {
|
|
6809
|
+
return window.elementor?.config?.size_units?.time ?? [];
|
|
6810
|
+
};
|
|
6811
|
+
var getExtendedUnits = () => {
|
|
6812
|
+
return window.elementor?.config?.size_units?.extended_units ?? [];
|
|
6813
|
+
};
|
|
6814
|
+
|
|
6815
|
+
// src/controls/size-control/utils/is-extended-unit.ts
|
|
6816
|
+
var isExtendedUnit = (unit) => {
|
|
6817
|
+
const extendedUnits = getExtendedUnits();
|
|
6818
|
+
return extendedUnits.includes(unit);
|
|
6819
|
+
};
|
|
6820
|
+
|
|
6821
|
+
// src/controls/size-control/hooks/use-size-unit-keyboard.tsx
|
|
6822
|
+
var UNIT_KEY_PATTERN = /^[a-zA-Z%]$/;
|
|
6823
|
+
var useSizeUnitKeyboard = ({ unit, units: units2, onUnitChange }) => {
|
|
6824
|
+
const { appendKey, startsWith } = useTypingBuffer();
|
|
6825
|
+
const onUnitKeyDown = (event) => {
|
|
6826
|
+
if (units2.length === 0) {
|
|
6827
|
+
return;
|
|
6828
|
+
}
|
|
6829
|
+
const { key, altKey, ctrlKey, metaKey } = event;
|
|
6830
|
+
if (altKey || ctrlKey || metaKey) {
|
|
6831
|
+
return;
|
|
6832
|
+
}
|
|
6833
|
+
if (isExtendedUnit(unit) && isNumericValue(key)) {
|
|
6834
|
+
const [defaultUnit] = units2;
|
|
6835
|
+
if (defaultUnit) {
|
|
6836
|
+
onUnitChange(defaultUnit);
|
|
6837
|
+
}
|
|
6838
|
+
return;
|
|
6839
|
+
}
|
|
6840
|
+
if (!UNIT_KEY_PATTERN.test(key)) {
|
|
6841
|
+
return;
|
|
6842
|
+
}
|
|
6843
|
+
event.preventDefault();
|
|
6844
|
+
const updatedBuffer = appendKey(key.toLowerCase());
|
|
6845
|
+
const matchedUnit = units2.find((u) => startsWith(u, updatedBuffer));
|
|
6846
|
+
if (matchedUnit) {
|
|
6847
|
+
onUnitChange(matchedUnit);
|
|
6848
|
+
}
|
|
6849
|
+
};
|
|
6850
|
+
return { onUnitKeyDown };
|
|
6851
|
+
};
|
|
6852
|
+
var isNumericValue = (value) => {
|
|
6853
|
+
if (typeof value === "number") {
|
|
6854
|
+
return !isNaN(value);
|
|
6855
|
+
}
|
|
6856
|
+
if (typeof value === "string") {
|
|
6857
|
+
return value.trim() !== "" && !isNaN(Number(value));
|
|
6858
|
+
}
|
|
6859
|
+
return false;
|
|
6860
|
+
};
|
|
6861
|
+
|
|
6862
|
+
// src/controls/size-control/hooks/use-size-value.ts
|
|
6793
6863
|
var import_react54 = require("react");
|
|
6864
|
+
|
|
6865
|
+
// src/controls/size-control/utils/resolve-size-value.ts
|
|
6866
|
+
var DEFAULT_SIZE2 = "";
|
|
6867
|
+
var EXTENDED_UNITS = {
|
|
6868
|
+
auto: "auto",
|
|
6869
|
+
custom: "custom"
|
|
6870
|
+
};
|
|
6871
|
+
var resolveSizeValue = (value, context) => {
|
|
6872
|
+
if (!value) {
|
|
6873
|
+
return value;
|
|
6874
|
+
}
|
|
6875
|
+
const { units: units2, defaultUnit } = context;
|
|
6876
|
+
const unit = resolveFallbackUnit(value.unit, units2, defaultUnit);
|
|
6877
|
+
if (unit === EXTENDED_UNITS.auto) {
|
|
6878
|
+
return { size: DEFAULT_SIZE2, unit };
|
|
6879
|
+
}
|
|
6880
|
+
if (unit === EXTENDED_UNITS.custom) {
|
|
6881
|
+
return { size: String(value.size ?? DEFAULT_SIZE2), unit };
|
|
6882
|
+
}
|
|
6883
|
+
return {
|
|
6884
|
+
size: sanitizeSize(value.size) ?? DEFAULT_SIZE2,
|
|
6885
|
+
unit
|
|
6886
|
+
};
|
|
6887
|
+
};
|
|
6888
|
+
var resolveSizeOnUnitChange = (size, unit) => {
|
|
6889
|
+
return isExtendedUnit(unit) ? DEFAULT_SIZE2 : size;
|
|
6890
|
+
};
|
|
6891
|
+
var createDefaultSizeValue = (units2, defaultUnit) => {
|
|
6892
|
+
let [unit] = units2;
|
|
6893
|
+
if (defaultUnit !== void 0) {
|
|
6894
|
+
unit = resolveFallbackUnit(defaultUnit, units2);
|
|
6895
|
+
}
|
|
6896
|
+
return { size: DEFAULT_SIZE2, unit };
|
|
6897
|
+
};
|
|
6898
|
+
var resolveFallbackUnit = (unit, units2, defaultUnit) => {
|
|
6899
|
+
if (units2.includes(unit)) {
|
|
6900
|
+
return unit;
|
|
6901
|
+
}
|
|
6902
|
+
if (defaultUnit && units2.includes(defaultUnit)) {
|
|
6903
|
+
return defaultUnit;
|
|
6904
|
+
}
|
|
6905
|
+
return units2[0] ?? "";
|
|
6906
|
+
};
|
|
6907
|
+
var sanitizeSize = (size) => {
|
|
6908
|
+
if (typeof size === "number" && isNaN(size)) {
|
|
6909
|
+
return DEFAULT_SIZE2;
|
|
6910
|
+
}
|
|
6911
|
+
return size;
|
|
6912
|
+
};
|
|
6913
|
+
|
|
6914
|
+
// src/controls/size-control/hooks/use-size-value.ts
|
|
6915
|
+
var useSizeValue = ({
|
|
6916
|
+
value,
|
|
6917
|
+
setValue,
|
|
6918
|
+
units: units2,
|
|
6919
|
+
defaultUnit
|
|
6920
|
+
}) => {
|
|
6921
|
+
const resolvedValue = (0, import_react54.useMemo)(
|
|
6922
|
+
() => resolveSizeValue(value, { units: units2, defaultUnit }),
|
|
6923
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
6924
|
+
[value?.size, value?.unit, defaultUnit]
|
|
6925
|
+
);
|
|
6926
|
+
const [sizeValue, setSizeValue] = useSyncExternalState({
|
|
6927
|
+
external: resolvedValue,
|
|
6928
|
+
setExternal: (newState, options, meta) => {
|
|
6929
|
+
if (newState !== null) {
|
|
6930
|
+
setValue(newState, options, meta);
|
|
6931
|
+
}
|
|
6932
|
+
},
|
|
6933
|
+
persistWhen: (next) => hasChanged(next, resolvedValue),
|
|
6934
|
+
fallback: () => createDefaultSizeValue(units2, defaultUnit)
|
|
6935
|
+
});
|
|
6936
|
+
const setSize = (newSize, isInputValid = true) => {
|
|
6937
|
+
if (isExtendedUnit(sizeValue.unit)) {
|
|
6938
|
+
return;
|
|
6939
|
+
}
|
|
6940
|
+
const trimmed = newSize.trim();
|
|
6941
|
+
const parsed = Number(trimmed);
|
|
6942
|
+
const newState = {
|
|
6943
|
+
...sizeValue,
|
|
6944
|
+
size: trimmed && !isNaN(parsed) ? parsed : ""
|
|
6945
|
+
};
|
|
6946
|
+
setSizeValue(newState, void 0, { validation: () => isInputValid });
|
|
6947
|
+
};
|
|
6948
|
+
const setUnit = (unit) => {
|
|
6949
|
+
setSizeValue({ unit, size: resolveSizeOnUnitChange(sizeValue.size, unit) });
|
|
6950
|
+
};
|
|
6951
|
+
return {
|
|
6952
|
+
size: sizeValue.size,
|
|
6953
|
+
unit: sizeValue.unit,
|
|
6954
|
+
setSize,
|
|
6955
|
+
setUnit
|
|
6956
|
+
};
|
|
6957
|
+
};
|
|
6958
|
+
var hasChanged = (next, current) => {
|
|
6959
|
+
return next?.size !== current?.size || next?.unit !== current?.unit;
|
|
6960
|
+
};
|
|
6961
|
+
|
|
6962
|
+
// src/controls/size-control/ui/size-input.tsx
|
|
6963
|
+
var React103 = __toESM(require("react"));
|
|
6964
|
+
var import_react55 = require("react");
|
|
6965
|
+
var SizeInput2 = (0, import_react55.forwardRef)(
|
|
6966
|
+
({
|
|
6967
|
+
id,
|
|
6968
|
+
type,
|
|
6969
|
+
value,
|
|
6970
|
+
onBlur,
|
|
6971
|
+
onKeyUp,
|
|
6972
|
+
focused,
|
|
6973
|
+
disabled,
|
|
6974
|
+
onChange,
|
|
6975
|
+
onKeyDown,
|
|
6976
|
+
InputProps,
|
|
6977
|
+
inputProps,
|
|
6978
|
+
placeholder
|
|
6979
|
+
}, ref) => {
|
|
6980
|
+
return /* @__PURE__ */ React103.createElement(
|
|
6981
|
+
NumberInput,
|
|
6982
|
+
{
|
|
6983
|
+
id,
|
|
6984
|
+
ref,
|
|
6985
|
+
size: "tiny",
|
|
6986
|
+
fullWidth: true,
|
|
6987
|
+
type,
|
|
6988
|
+
value,
|
|
6989
|
+
placeholder,
|
|
6990
|
+
onKeyUp,
|
|
6991
|
+
focused,
|
|
6992
|
+
disabled,
|
|
6993
|
+
onKeyDown,
|
|
6994
|
+
onInput: onChange,
|
|
6995
|
+
onBlur,
|
|
6996
|
+
InputProps,
|
|
6997
|
+
inputProps,
|
|
6998
|
+
sx: getCursorStyle(InputProps?.readOnly ?? false)
|
|
6999
|
+
}
|
|
7000
|
+
);
|
|
7001
|
+
}
|
|
7002
|
+
);
|
|
7003
|
+
var getCursorStyle = (readOnly) => ({
|
|
7004
|
+
input: { cursor: readOnly ? "default !important" : void 0 }
|
|
7005
|
+
});
|
|
7006
|
+
|
|
7007
|
+
// src/controls/size-control/ui/unit-selector.tsx
|
|
7008
|
+
var React104 = __toESM(require("react"));
|
|
7009
|
+
var import_react56 = require("react");
|
|
6794
7010
|
var import_editor_ui14 = require("@elementor/editor-ui");
|
|
6795
7011
|
var import_ui89 = require("@elementor/ui");
|
|
7012
|
+
var menuItemContentStyles = {
|
|
7013
|
+
display: "flex",
|
|
7014
|
+
flexDirection: "column",
|
|
7015
|
+
justifyContent: "center"
|
|
7016
|
+
};
|
|
7017
|
+
var UnitSelector = ({
|
|
7018
|
+
value,
|
|
7019
|
+
isActive,
|
|
7020
|
+
onSelect,
|
|
7021
|
+
options,
|
|
7022
|
+
disabled,
|
|
7023
|
+
menuItemsAttributes = {},
|
|
7024
|
+
optionLabelOverrides = {}
|
|
7025
|
+
}) => {
|
|
7026
|
+
const popupState = (0, import_ui89.usePopupState)({
|
|
7027
|
+
variant: "popover",
|
|
7028
|
+
popupId: (0, import_react56.useId)()
|
|
7029
|
+
});
|
|
7030
|
+
const handleMenuItemClick = (option) => {
|
|
7031
|
+
onSelect(option);
|
|
7032
|
+
popupState.close();
|
|
7033
|
+
};
|
|
7034
|
+
return /* @__PURE__ */ React104.createElement(React104.Fragment, null, /* @__PURE__ */ React104.createElement(StyledButton2, { isActive, disabled, size: "small", ...(0, import_ui89.bindTrigger)(popupState) }, optionLabelOverrides[value] ?? value), /* @__PURE__ */ React104.createElement(import_ui89.Menu, { MenuListProps: { dense: true }, ...(0, import_ui89.bindMenu)(popupState) }, options.map((option) => /* @__PURE__ */ React104.createElement(
|
|
7035
|
+
import_editor_ui14.MenuListItem,
|
|
7036
|
+
{
|
|
7037
|
+
key: option,
|
|
7038
|
+
onClick: () => handleMenuItemClick(option),
|
|
7039
|
+
...menuItemsAttributes?.[option],
|
|
7040
|
+
primaryTypographyProps: {
|
|
7041
|
+
variant: "caption",
|
|
7042
|
+
sx: {
|
|
7043
|
+
...menuItemContentStyles,
|
|
7044
|
+
lineHeight: "1"
|
|
7045
|
+
}
|
|
7046
|
+
},
|
|
7047
|
+
menuItemTextProps: {
|
|
7048
|
+
sx: menuItemContentStyles
|
|
7049
|
+
}
|
|
7050
|
+
},
|
|
7051
|
+
optionLabelOverrides[option] ?? option.toUpperCase()
|
|
7052
|
+
))));
|
|
7053
|
+
};
|
|
7054
|
+
var StyledButton2 = (0, import_ui89.styled)(import_ui89.Button, {
|
|
7055
|
+
shouldForwardProp: (prop) => prop !== "isActive"
|
|
7056
|
+
})(({ isActive, theme }) => ({
|
|
7057
|
+
color: isActive ? theme.palette.text.primary : theme.palette.text.tertiary,
|
|
7058
|
+
font: "inherit",
|
|
7059
|
+
minWidth: "initial",
|
|
7060
|
+
textTransform: "uppercase"
|
|
7061
|
+
}));
|
|
7062
|
+
|
|
7063
|
+
// src/controls/size-control/utils/has-size-value.ts
|
|
7064
|
+
var hasSizeValue = (size) => {
|
|
7065
|
+
return Boolean(size) || size === 0;
|
|
7066
|
+
};
|
|
7067
|
+
|
|
7068
|
+
// src/controls/size-control/size-field.tsx
|
|
7069
|
+
var UNIT_DISPLAY_LABELS_OVERRIDES = {
|
|
7070
|
+
custom: /* @__PURE__ */ React105.createElement(import_icons34.MathFunctionIcon, { fontSize: "tiny" })
|
|
7071
|
+
};
|
|
7072
|
+
var SizeField = ({
|
|
7073
|
+
value,
|
|
7074
|
+
focused,
|
|
7075
|
+
disabled,
|
|
7076
|
+
InputProps,
|
|
7077
|
+
defaultUnit,
|
|
7078
|
+
placeholder,
|
|
7079
|
+
onUnitChange,
|
|
7080
|
+
startIcon,
|
|
7081
|
+
ariaLabel,
|
|
7082
|
+
onKeyDown,
|
|
7083
|
+
setValue,
|
|
7084
|
+
onBlur,
|
|
7085
|
+
units: units2,
|
|
7086
|
+
min,
|
|
7087
|
+
unitSelectorProps
|
|
7088
|
+
}) => {
|
|
7089
|
+
const { size, unit, setSize, setUnit } = useSizeValue({ value, setValue, units: units2, defaultUnit });
|
|
7090
|
+
const handleUnitChange = (newUnit) => {
|
|
7091
|
+
setUnit(newUnit);
|
|
7092
|
+
onUnitChange?.(newUnit);
|
|
7093
|
+
};
|
|
7094
|
+
const { onUnitKeyDown } = useSizeUnitKeyboard({ unit, onUnitChange: handleUnitChange, units: units2 });
|
|
7095
|
+
const handleKeyDown = (event) => {
|
|
7096
|
+
onUnitKeyDown(event);
|
|
7097
|
+
onKeyDown?.(event);
|
|
7098
|
+
};
|
|
7099
|
+
const handleChange = (event) => {
|
|
7100
|
+
const newSize = event.target.value;
|
|
7101
|
+
const isInputValid = event.target.validity.valid;
|
|
7102
|
+
setSize(newSize, isInputValid);
|
|
7103
|
+
};
|
|
7104
|
+
const inputType = isExtendedUnit(unit) ? "text" : "number";
|
|
7105
|
+
return /* @__PURE__ */ React105.createElement(
|
|
7106
|
+
SizeInput2,
|
|
7107
|
+
{
|
|
7108
|
+
disabled,
|
|
7109
|
+
focused,
|
|
7110
|
+
type: inputType,
|
|
7111
|
+
value: size,
|
|
7112
|
+
placeholder,
|
|
7113
|
+
onBlur,
|
|
7114
|
+
onKeyDown: handleKeyDown,
|
|
7115
|
+
onChange: handleChange,
|
|
7116
|
+
InputProps: {
|
|
7117
|
+
...InputProps,
|
|
7118
|
+
autoComplete: "off",
|
|
7119
|
+
readOnly: isExtendedUnit(unit),
|
|
7120
|
+
startAdornment: startIcon && /* @__PURE__ */ React105.createElement(import_ui90.InputAdornment, { position: "start", disabled }, startIcon),
|
|
7121
|
+
endAdornment: /* @__PURE__ */ React105.createElement(import_ui90.InputAdornment, { position: "end" }, /* @__PURE__ */ React105.createElement(
|
|
7122
|
+
UnitSelector,
|
|
7123
|
+
{
|
|
7124
|
+
options: units2,
|
|
7125
|
+
value: unit,
|
|
7126
|
+
onSelect: handleUnitChange,
|
|
7127
|
+
isActive: unitSelectorProps?.isActive ?? hasSizeValue(size),
|
|
7128
|
+
...unitSelectorProps,
|
|
7129
|
+
optionLabelOverrides: UNIT_DISPLAY_LABELS_OVERRIDES
|
|
7130
|
+
}
|
|
7131
|
+
))
|
|
7132
|
+
},
|
|
7133
|
+
inputProps: { min, step: "any", "arial-label": ariaLabel }
|
|
7134
|
+
}
|
|
7135
|
+
);
|
|
7136
|
+
};
|
|
7137
|
+
|
|
7138
|
+
// src/controls/size-control/ui/text-field-popover.tsx
|
|
7139
|
+
var React106 = __toESM(require("react"));
|
|
7140
|
+
var import_react57 = require("react");
|
|
7141
|
+
var import_editor_ui15 = require("@elementor/editor-ui");
|
|
7142
|
+
var import_icons35 = require("@elementor/icons");
|
|
7143
|
+
var import_ui91 = require("@elementor/ui");
|
|
7144
|
+
var import_i18n52 = require("@wordpress/i18n");
|
|
7145
|
+
var SIZE10 = "tiny";
|
|
7146
|
+
var TextFieldPopover2 = ({ popupState, anchorRef, value, onChange, onClose }) => {
|
|
7147
|
+
const inputRef = (0, import_react57.useRef)(null);
|
|
7148
|
+
(0, import_react57.useEffect)(() => {
|
|
7149
|
+
if (popupState.isOpen) {
|
|
7150
|
+
requestAnimationFrame(() => {
|
|
7151
|
+
if (inputRef.current) {
|
|
7152
|
+
inputRef.current.focus();
|
|
7153
|
+
}
|
|
7154
|
+
});
|
|
7155
|
+
}
|
|
7156
|
+
}, [popupState.isOpen]);
|
|
7157
|
+
const handleKeyDown = (event) => {
|
|
7158
|
+
if (event.key.toLowerCase() === "enter") {
|
|
7159
|
+
handleClose();
|
|
7160
|
+
}
|
|
7161
|
+
};
|
|
7162
|
+
const handleClose = () => {
|
|
7163
|
+
onClose?.();
|
|
7164
|
+
popupState.close();
|
|
7165
|
+
};
|
|
7166
|
+
return /* @__PURE__ */ React106.createElement(
|
|
7167
|
+
import_ui91.Popover,
|
|
7168
|
+
{
|
|
7169
|
+
disablePortal: true,
|
|
7170
|
+
slotProps: {
|
|
7171
|
+
paper: {
|
|
7172
|
+
sx: {
|
|
7173
|
+
borderRadius: 2,
|
|
7174
|
+
width: anchorRef.current?.offsetWidth + "px"
|
|
7175
|
+
}
|
|
7176
|
+
}
|
|
7177
|
+
},
|
|
7178
|
+
...(0, import_ui91.bindPopover)(popupState),
|
|
7179
|
+
anchorOrigin: { vertical: "bottom", horizontal: "center" },
|
|
7180
|
+
transformOrigin: { vertical: "top", horizontal: "center" },
|
|
7181
|
+
onClose: handleClose
|
|
7182
|
+
},
|
|
7183
|
+
/* @__PURE__ */ React106.createElement(
|
|
7184
|
+
import_editor_ui15.PopoverHeader,
|
|
7185
|
+
{
|
|
7186
|
+
title: (0, import_i18n52.__)("CSS function", "elementor"),
|
|
7187
|
+
onClose: handleClose,
|
|
7188
|
+
icon: /* @__PURE__ */ React106.createElement(import_icons35.MathFunctionIcon, { fontSize: SIZE10 })
|
|
7189
|
+
}
|
|
7190
|
+
),
|
|
7191
|
+
/* @__PURE__ */ React106.createElement(
|
|
7192
|
+
import_ui91.TextField,
|
|
7193
|
+
{
|
|
7194
|
+
value,
|
|
7195
|
+
onChange,
|
|
7196
|
+
onKeyDown: handleKeyDown,
|
|
7197
|
+
size: "tiny",
|
|
7198
|
+
type: "text",
|
|
7199
|
+
fullWidth: true,
|
|
7200
|
+
inputProps: {
|
|
7201
|
+
ref: inputRef
|
|
7202
|
+
},
|
|
7203
|
+
sx: { pt: 0, pr: 1.5, pb: 1.5, pl: 1.5 }
|
|
7204
|
+
}
|
|
7205
|
+
)
|
|
7206
|
+
);
|
|
7207
|
+
};
|
|
7208
|
+
|
|
7209
|
+
// src/controls/size-control/size-component.tsx
|
|
7210
|
+
var SizeComponent = ({
|
|
7211
|
+
anchorRef,
|
|
7212
|
+
isUnitActive,
|
|
7213
|
+
SizeFieldWrapper = React107.Fragment,
|
|
7214
|
+
...sizeFieldProps
|
|
7215
|
+
}) => {
|
|
7216
|
+
const popupState = (0, import_ui92.usePopupState)({ variant: "popover" });
|
|
7217
|
+
const activeBreakpoint = (0, import_editor_responsive4.useActiveBreakpoint)();
|
|
7218
|
+
const isCustomUnit = sizeFieldProps?.value?.unit === EXTENDED_UNITS.custom;
|
|
7219
|
+
const hasCustomUnitOption = sizeFieldProps.units.includes(EXTENDED_UNITS.custom);
|
|
7220
|
+
(0, import_react58.useEffect)(() => {
|
|
7221
|
+
if (popupState && popupState.isOpen) {
|
|
7222
|
+
popupState.close();
|
|
7223
|
+
}
|
|
7224
|
+
}, [activeBreakpoint]);
|
|
7225
|
+
const handleCustomSizeChange = (event) => {
|
|
7226
|
+
sizeFieldProps.setValue({
|
|
7227
|
+
size: event.target.value,
|
|
7228
|
+
unit: EXTENDED_UNITS.custom
|
|
7229
|
+
});
|
|
7230
|
+
};
|
|
7231
|
+
const handleSizeFieldClick = (event) => {
|
|
7232
|
+
if (event.target.closest("input") && isCustomUnit) {
|
|
7233
|
+
popupState.open(anchorRef?.current);
|
|
7234
|
+
}
|
|
7235
|
+
};
|
|
7236
|
+
const handleUnitChange = (unit) => {
|
|
7237
|
+
if (unit === EXTENDED_UNITS.custom && anchorRef?.current) {
|
|
7238
|
+
popupState.open(anchorRef.current);
|
|
7239
|
+
}
|
|
7240
|
+
};
|
|
7241
|
+
const popupAttributes = {
|
|
7242
|
+
"aria-controls": popupState.isOpen ? popupState.popupId : void 0,
|
|
7243
|
+
"aria-haspopup": true
|
|
7244
|
+
};
|
|
7245
|
+
return /* @__PURE__ */ React107.createElement(React107.Fragment, null, /* @__PURE__ */ React107.createElement(SizeFieldWrapper, null, /* @__PURE__ */ React107.createElement(import_ui92.Box, null, /* @__PURE__ */ React107.createElement(
|
|
7246
|
+
SizeField,
|
|
7247
|
+
{
|
|
7248
|
+
focused: popupState.isOpen ? true : void 0,
|
|
7249
|
+
onUnitChange: handleUnitChange,
|
|
7250
|
+
InputProps: {
|
|
7251
|
+
...popupAttributes,
|
|
7252
|
+
onClick: handleSizeFieldClick
|
|
7253
|
+
},
|
|
7254
|
+
unitSelectorProps: {
|
|
7255
|
+
menuItemsAttributes: hasCustomUnitOption ? { custom: popupAttributes } : void 0,
|
|
7256
|
+
isActive: isUnitActive
|
|
7257
|
+
},
|
|
7258
|
+
...sizeFieldProps
|
|
7259
|
+
}
|
|
7260
|
+
))), popupState.isOpen && anchorRef?.current && /* @__PURE__ */ React107.createElement(
|
|
7261
|
+
TextFieldPopover2,
|
|
7262
|
+
{
|
|
7263
|
+
popupState,
|
|
7264
|
+
anchorRef,
|
|
7265
|
+
value: String(sizeFieldProps?.value?.size ?? ""),
|
|
7266
|
+
onChange: handleCustomSizeChange,
|
|
7267
|
+
onClose: () => {
|
|
7268
|
+
}
|
|
7269
|
+
}
|
|
7270
|
+
));
|
|
7271
|
+
};
|
|
7272
|
+
|
|
7273
|
+
// src/controls/size-control/utils/resolve-bound-prop-value.ts
|
|
7274
|
+
var import_editor_props55 = require("@elementor/editor-props");
|
|
7275
|
+
var resolveBoundPropValue = (value, boundPropPlaceholder, propPlaceholder) => {
|
|
7276
|
+
let sizeValue = null;
|
|
7277
|
+
if (validateSizeValue(value)) {
|
|
7278
|
+
sizeValue = value;
|
|
7279
|
+
} else if (validateSizeValue(boundPropPlaceholder)) {
|
|
7280
|
+
sizeValue = { size: "", unit: boundPropPlaceholder?.unit };
|
|
7281
|
+
}
|
|
7282
|
+
return {
|
|
7283
|
+
sizeValue,
|
|
7284
|
+
isUnitHighlighted: shouldHighlightUnit(value),
|
|
7285
|
+
placeholder: resolvePlaceholder(propPlaceholder, boundPropPlaceholder)
|
|
7286
|
+
};
|
|
7287
|
+
};
|
|
7288
|
+
var validateSizeValue = (value) => {
|
|
7289
|
+
if (!value) {
|
|
7290
|
+
return false;
|
|
7291
|
+
}
|
|
7292
|
+
const sizePropValue = import_editor_props55.sizePropTypeUtil.create(value);
|
|
7293
|
+
return import_editor_props55.sizePropTypeUtil.isValid(sizePropValue);
|
|
7294
|
+
};
|
|
7295
|
+
var resolvePlaceholder = (propPlaceholder, boundPropPlaceholder) => {
|
|
7296
|
+
if (propPlaceholder) {
|
|
7297
|
+
return propPlaceholder;
|
|
7298
|
+
}
|
|
7299
|
+
const size = boundPropPlaceholder?.size;
|
|
7300
|
+
if (size === void 0) {
|
|
7301
|
+
return void 0;
|
|
7302
|
+
}
|
|
7303
|
+
if (typeof size === "number") {
|
|
7304
|
+
return size.toString();
|
|
7305
|
+
}
|
|
7306
|
+
return size;
|
|
7307
|
+
};
|
|
7308
|
+
var shouldHighlightUnit = (value) => {
|
|
7309
|
+
if (!value) {
|
|
7310
|
+
return false;
|
|
7311
|
+
}
|
|
7312
|
+
if (value.unit === EXTENDED_UNITS.auto) {
|
|
7313
|
+
return true;
|
|
7314
|
+
}
|
|
7315
|
+
return hasSizeValue(value.size);
|
|
7316
|
+
};
|
|
7317
|
+
|
|
7318
|
+
// src/controls/size-control/utils/settings/get-prop-type-settings.ts
|
|
7319
|
+
var getPropTypeSettings = (propType) => {
|
|
7320
|
+
return propType.settings;
|
|
7321
|
+
};
|
|
7322
|
+
|
|
7323
|
+
// src/controls/size-control/utils/settings/get-default-unit.ts
|
|
7324
|
+
var getDefaultUnit = (propType) => {
|
|
7325
|
+
return getPropTypeSettings(propType)?.default_unit;
|
|
7326
|
+
};
|
|
7327
|
+
|
|
7328
|
+
// src/controls/size-control/utils/settings/get-size-units.ts
|
|
7329
|
+
var getVariantUnits = (variant) => {
|
|
7330
|
+
const map = {
|
|
7331
|
+
length: getLengthUnits,
|
|
7332
|
+
angle: getAngleUnits,
|
|
7333
|
+
time: getTimeUnits
|
|
7334
|
+
};
|
|
7335
|
+
return map[variant]();
|
|
7336
|
+
};
|
|
7337
|
+
var getSettingsUnits = (propType) => {
|
|
7338
|
+
return getPropTypeSettings(propType)?.units;
|
|
7339
|
+
};
|
|
7340
|
+
var getSizeUnits = (propType, variant) => {
|
|
7341
|
+
return getSettingsUnits(propType) ?? getVariantUnits(variant);
|
|
7342
|
+
};
|
|
7343
|
+
|
|
7344
|
+
// src/controls/size-control/utils/should-nullify-value.ts
|
|
7345
|
+
var conditions = [
|
|
7346
|
+
(value) => value?.size === null || value?.size === void 0 || value?.size === "",
|
|
7347
|
+
(value) => value?.unit !== EXTENDED_UNITS.auto,
|
|
7348
|
+
(value) => value?.unit !== EXTENDED_UNITS.custom
|
|
7349
|
+
];
|
|
7350
|
+
var shouldNullifyValue = (value) => {
|
|
7351
|
+
return conditions.every((condition) => condition(value));
|
|
7352
|
+
};
|
|
7353
|
+
|
|
7354
|
+
// src/controls/size-control/unstable-size-control.tsx
|
|
7355
|
+
var UnstableSizeControl = createControl(
|
|
7356
|
+
({ variant = "length", placeholder: propPlaceholder, anchorRef, startIcon, ariaLabel, min }) => {
|
|
7357
|
+
const {
|
|
7358
|
+
value,
|
|
7359
|
+
setValue,
|
|
7360
|
+
propType,
|
|
7361
|
+
placeholder: boundPropPlaceholder,
|
|
7362
|
+
restoreValue
|
|
7363
|
+
} = useBoundProp(import_editor_props56.sizePropTypeUtil);
|
|
7364
|
+
const { sizeValue, isUnitHighlighted, placeholder } = resolveBoundPropValue(
|
|
7365
|
+
value,
|
|
7366
|
+
boundPropPlaceholder,
|
|
7367
|
+
propPlaceholder
|
|
7368
|
+
);
|
|
7369
|
+
const units2 = getSizeUnits(propType, variant);
|
|
7370
|
+
const defaultUnit = getDefaultUnit(propType);
|
|
7371
|
+
const handleBlur = () => {
|
|
7372
|
+
const isRequired = propType.settings.required;
|
|
7373
|
+
if (shouldNullifyValue(value) && !isRequired) {
|
|
7374
|
+
setValue(null);
|
|
7375
|
+
}
|
|
7376
|
+
if (isRequired) {
|
|
7377
|
+
restoreValue();
|
|
7378
|
+
}
|
|
7379
|
+
};
|
|
7380
|
+
const handleChange = (newValue, options, meta) => {
|
|
7381
|
+
setValue(newValue, options, {
|
|
7382
|
+
...meta,
|
|
7383
|
+
validation: () => {
|
|
7384
|
+
if (propType.settings.required) {
|
|
7385
|
+
return newValue.size !== "";
|
|
7386
|
+
}
|
|
7387
|
+
return meta?.validation ? meta.validation(newValue) : true;
|
|
7388
|
+
}
|
|
7389
|
+
});
|
|
7390
|
+
};
|
|
7391
|
+
return /* @__PURE__ */ React108.createElement(
|
|
7392
|
+
SizeComponent,
|
|
7393
|
+
{
|
|
7394
|
+
units: units2,
|
|
7395
|
+
value: sizeValue,
|
|
7396
|
+
anchorRef,
|
|
7397
|
+
placeholder,
|
|
7398
|
+
defaultUnit,
|
|
7399
|
+
isUnitActive: isUnitHighlighted,
|
|
7400
|
+
onBlur: handleBlur,
|
|
7401
|
+
setValue: handleChange,
|
|
7402
|
+
SizeFieldWrapper: ControlActions,
|
|
7403
|
+
startIcon,
|
|
7404
|
+
ariaLabel,
|
|
7405
|
+
min
|
|
7406
|
+
}
|
|
7407
|
+
);
|
|
7408
|
+
}
|
|
7409
|
+
);
|
|
7410
|
+
|
|
7411
|
+
// src/components/promotions/display-conditions-control.tsx
|
|
7412
|
+
var React110 = __toESM(require("react"));
|
|
7413
|
+
var import_react60 = require("react");
|
|
7414
|
+
var import_icons36 = require("@elementor/icons");
|
|
7415
|
+
var import_ui94 = require("@elementor/ui");
|
|
7416
|
+
var import_i18n53 = require("@wordpress/i18n");
|
|
7417
|
+
|
|
7418
|
+
// src/components/promotions/promotion-trigger.tsx
|
|
7419
|
+
var React109 = __toESM(require("react"));
|
|
7420
|
+
var import_react59 = require("react");
|
|
7421
|
+
var import_editor_ui16 = require("@elementor/editor-ui");
|
|
7422
|
+
var import_ui93 = require("@elementor/ui");
|
|
6796
7423
|
function getV4Promotion(key) {
|
|
6797
7424
|
return window.elementor?.config?.v4Promotions?.[key];
|
|
6798
7425
|
}
|
|
6799
|
-
var PromotionTrigger = (0,
|
|
7426
|
+
var PromotionTrigger = (0, import_react59.forwardRef)(
|
|
6800
7427
|
({ promotionKey, children, trackingData }, ref) => {
|
|
6801
|
-
const [isOpen, setIsOpen] = (0,
|
|
7428
|
+
const [isOpen, setIsOpen] = (0, import_react59.useState)(false);
|
|
6802
7429
|
const promotion = getV4Promotion(promotionKey);
|
|
6803
|
-
const toggle = (0,
|
|
7430
|
+
const toggle = (0, import_react59.useCallback)(() => {
|
|
6804
7431
|
setIsOpen((prev) => {
|
|
6805
7432
|
if (!prev) {
|
|
6806
7433
|
trackViewPromotion(trackingData);
|
|
@@ -6808,9 +7435,9 @@ var PromotionTrigger = (0, import_react54.forwardRef)(
|
|
|
6808
7435
|
return !prev;
|
|
6809
7436
|
});
|
|
6810
7437
|
}, [trackingData]);
|
|
6811
|
-
(0,
|
|
6812
|
-
return /* @__PURE__ */
|
|
6813
|
-
|
|
7438
|
+
(0, import_react59.useImperativeHandle)(ref, () => ({ toggle }), [toggle]);
|
|
7439
|
+
return /* @__PURE__ */ React109.createElement(React109.Fragment, null, promotion && /* @__PURE__ */ React109.createElement(
|
|
7440
|
+
import_editor_ui16.PromotionInfotip,
|
|
6814
7441
|
{
|
|
6815
7442
|
title: promotion.title,
|
|
6816
7443
|
content: promotion.content,
|
|
@@ -6823,8 +7450,8 @@ var PromotionTrigger = (0, import_react54.forwardRef)(
|
|
|
6823
7450
|
},
|
|
6824
7451
|
onCtaClick: () => trackUpgradePromotionClick(trackingData)
|
|
6825
7452
|
},
|
|
6826
|
-
/* @__PURE__ */
|
|
6827
|
-
|
|
7453
|
+
/* @__PURE__ */ React109.createElement(
|
|
7454
|
+
import_ui93.Box,
|
|
6828
7455
|
{
|
|
6829
7456
|
onClick: (e) => {
|
|
6830
7457
|
e.stopPropagation();
|
|
@@ -6832,19 +7459,19 @@ var PromotionTrigger = (0, import_react54.forwardRef)(
|
|
|
6832
7459
|
},
|
|
6833
7460
|
sx: { cursor: "pointer", display: "inline-flex" }
|
|
6834
7461
|
},
|
|
6835
|
-
children ?? /* @__PURE__ */
|
|
7462
|
+
children ?? /* @__PURE__ */ React109.createElement(import_editor_ui16.PromotionChip, null)
|
|
6836
7463
|
)
|
|
6837
7464
|
));
|
|
6838
7465
|
}
|
|
6839
7466
|
);
|
|
6840
7467
|
|
|
6841
7468
|
// src/components/promotions/display-conditions-control.tsx
|
|
6842
|
-
var ARIA_LABEL = (0,
|
|
7469
|
+
var ARIA_LABEL = (0, import_i18n53.__)("Display Conditions", "elementor");
|
|
6843
7470
|
var TRACKING_DATA = { target_name: "display_conditions", location_l2: "general" };
|
|
6844
7471
|
var DisplayConditionsControl = createControl(() => {
|
|
6845
|
-
const triggerRef = (0,
|
|
6846
|
-
return /* @__PURE__ */
|
|
6847
|
-
|
|
7472
|
+
const triggerRef = (0, import_react60.useRef)(null);
|
|
7473
|
+
return /* @__PURE__ */ React110.createElement(
|
|
7474
|
+
import_ui94.Stack,
|
|
6848
7475
|
{
|
|
6849
7476
|
direction: "row",
|
|
6850
7477
|
spacing: 2,
|
|
@@ -6853,9 +7480,9 @@ var DisplayConditionsControl = createControl(() => {
|
|
|
6853
7480
|
alignItems: "center"
|
|
6854
7481
|
}
|
|
6855
7482
|
},
|
|
6856
|
-
/* @__PURE__ */
|
|
6857
|
-
/* @__PURE__ */
|
|
6858
|
-
|
|
7483
|
+
/* @__PURE__ */ React110.createElement(PromotionTrigger, { ref: triggerRef, promotionKey: "displayConditions", trackingData: TRACKING_DATA }),
|
|
7484
|
+
/* @__PURE__ */ React110.createElement(import_ui94.Tooltip, { title: ARIA_LABEL, placement: "top" }, /* @__PURE__ */ React110.createElement(
|
|
7485
|
+
import_ui94.IconButton,
|
|
6859
7486
|
{
|
|
6860
7487
|
size: "tiny",
|
|
6861
7488
|
"aria-label": ARIA_LABEL,
|
|
@@ -6867,23 +7494,23 @@ var DisplayConditionsControl = createControl(() => {
|
|
|
6867
7494
|
borderRadius: 1
|
|
6868
7495
|
}
|
|
6869
7496
|
},
|
|
6870
|
-
/* @__PURE__ */
|
|
7497
|
+
/* @__PURE__ */ React110.createElement(import_icons36.SitemapIcon, { fontSize: "tiny", color: "disabled" })
|
|
6871
7498
|
))
|
|
6872
7499
|
);
|
|
6873
7500
|
});
|
|
6874
7501
|
|
|
6875
7502
|
// src/components/promotions/attributes-control.tsx
|
|
6876
|
-
var
|
|
6877
|
-
var
|
|
6878
|
-
var
|
|
6879
|
-
var
|
|
6880
|
-
var
|
|
6881
|
-
var ARIA_LABEL2 = (0,
|
|
7503
|
+
var React111 = __toESM(require("react"));
|
|
7504
|
+
var import_react61 = require("react");
|
|
7505
|
+
var import_icons37 = require("@elementor/icons");
|
|
7506
|
+
var import_ui95 = require("@elementor/ui");
|
|
7507
|
+
var import_i18n54 = require("@wordpress/i18n");
|
|
7508
|
+
var ARIA_LABEL2 = (0, import_i18n54.__)("Attributes", "elementor");
|
|
6882
7509
|
var TRACKING_DATA2 = { target_name: "attributes", location_l2: "general" };
|
|
6883
7510
|
var AttributesControl = createControl(() => {
|
|
6884
|
-
const triggerRef = (0,
|
|
6885
|
-
return /* @__PURE__ */
|
|
6886
|
-
|
|
7511
|
+
const triggerRef = (0, import_react61.useRef)(null);
|
|
7512
|
+
return /* @__PURE__ */ React111.createElement(
|
|
7513
|
+
import_ui95.Stack,
|
|
6887
7514
|
{
|
|
6888
7515
|
direction: "row",
|
|
6889
7516
|
spacing: 2,
|
|
@@ -6892,9 +7519,9 @@ var AttributesControl = createControl(() => {
|
|
|
6892
7519
|
alignItems: "center"
|
|
6893
7520
|
}
|
|
6894
7521
|
},
|
|
6895
|
-
/* @__PURE__ */
|
|
6896
|
-
/* @__PURE__ */
|
|
6897
|
-
|
|
7522
|
+
/* @__PURE__ */ React111.createElement(PromotionTrigger, { ref: triggerRef, promotionKey: "attributes", trackingData: TRACKING_DATA2 }),
|
|
7523
|
+
/* @__PURE__ */ React111.createElement(import_ui95.Tooltip, { title: ARIA_LABEL2, placement: "top" }, /* @__PURE__ */ React111.createElement(
|
|
7524
|
+
import_icons37.PlusIcon,
|
|
6898
7525
|
{
|
|
6899
7526
|
"aria-label": ARIA_LABEL2,
|
|
6900
7527
|
fontSize: "tiny",
|
|
@@ -6907,22 +7534,22 @@ var AttributesControl = createControl(() => {
|
|
|
6907
7534
|
});
|
|
6908
7535
|
|
|
6909
7536
|
// src/components/icon-buttons/clear-icon-button.tsx
|
|
6910
|
-
var
|
|
6911
|
-
var
|
|
6912
|
-
var
|
|
6913
|
-
var CustomIconButton = (0,
|
|
7537
|
+
var React112 = __toESM(require("react"));
|
|
7538
|
+
var import_icons38 = require("@elementor/icons");
|
|
7539
|
+
var import_ui96 = require("@elementor/ui");
|
|
7540
|
+
var CustomIconButton = (0, import_ui96.styled)(import_ui96.IconButton)(({ theme }) => ({
|
|
6914
7541
|
width: theme.spacing(2.5),
|
|
6915
7542
|
height: theme.spacing(2.5)
|
|
6916
7543
|
}));
|
|
6917
|
-
var ClearIconButton = ({ tooltipText, onClick, disabled, size = "tiny" }) => /* @__PURE__ */
|
|
7544
|
+
var ClearIconButton = ({ tooltipText, onClick, disabled, size = "tiny" }) => /* @__PURE__ */ React112.createElement(import_ui96.Tooltip, { title: tooltipText, placement: "top", disableInteractive: true }, /* @__PURE__ */ React112.createElement(CustomIconButton, { "aria-label": tooltipText, size, onClick, disabled }, /* @__PURE__ */ React112.createElement(import_icons38.BrushBigIcon, { fontSize: size })));
|
|
6918
7545
|
|
|
6919
7546
|
// src/components/repeater/repeater.tsx
|
|
6920
|
-
var
|
|
6921
|
-
var
|
|
6922
|
-
var
|
|
6923
|
-
var
|
|
6924
|
-
var
|
|
6925
|
-
var
|
|
7547
|
+
var React113 = __toESM(require("react"));
|
|
7548
|
+
var import_react62 = require("react");
|
|
7549
|
+
var import_icons39 = require("@elementor/icons");
|
|
7550
|
+
var import_ui97 = require("@elementor/ui");
|
|
7551
|
+
var import_i18n55 = require("@wordpress/i18n");
|
|
7552
|
+
var SIZE11 = "tiny";
|
|
6926
7553
|
var EMPTY_OPEN_ITEM2 = -1;
|
|
6927
7554
|
var Repeater3 = ({
|
|
6928
7555
|
label,
|
|
@@ -6939,7 +7566,7 @@ var Repeater3 = ({
|
|
|
6939
7566
|
openItem: initialOpenItem = EMPTY_OPEN_ITEM2,
|
|
6940
7567
|
isSortable = true
|
|
6941
7568
|
}) => {
|
|
6942
|
-
const [openItem, setOpenItem] = (0,
|
|
7569
|
+
const [openItem, setOpenItem] = (0, import_react62.useState)(initialOpenItem);
|
|
6943
7570
|
const uniqueKeys = items2.map(
|
|
6944
7571
|
(item, index) => isSortable && "getId" in itemSettings ? itemSettings.getId({ item, index }) : String(index)
|
|
6945
7572
|
);
|
|
@@ -7002,41 +7629,41 @@ var Repeater3 = ({
|
|
|
7002
7629
|
};
|
|
7003
7630
|
const isButtonDisabled = disabled || disableAddItemButton;
|
|
7004
7631
|
const shouldShowInfotip = isButtonDisabled && addButtonInfotipContent;
|
|
7005
|
-
const addButton = /* @__PURE__ */
|
|
7006
|
-
|
|
7632
|
+
const addButton = /* @__PURE__ */ React113.createElement(
|
|
7633
|
+
import_ui97.IconButton,
|
|
7007
7634
|
{
|
|
7008
|
-
size:
|
|
7635
|
+
size: SIZE11,
|
|
7009
7636
|
sx: {
|
|
7010
7637
|
ml: "auto"
|
|
7011
7638
|
},
|
|
7012
7639
|
disabled: isButtonDisabled,
|
|
7013
7640
|
onClick: addRepeaterItem,
|
|
7014
|
-
"aria-label": (0,
|
|
7641
|
+
"aria-label": (0, import_i18n55.__)("Add item", "elementor")
|
|
7015
7642
|
},
|
|
7016
|
-
/* @__PURE__ */
|
|
7643
|
+
/* @__PURE__ */ React113.createElement(import_icons39.PlusIcon, { fontSize: SIZE11 })
|
|
7017
7644
|
);
|
|
7018
|
-
return /* @__PURE__ */
|
|
7019
|
-
|
|
7645
|
+
return /* @__PURE__ */ React113.createElement(SectionContent, { gap: 2 }, /* @__PURE__ */ React113.createElement(RepeaterHeader, { label, adornment: ControlAdornments }, shouldShowInfotip ? /* @__PURE__ */ React113.createElement(
|
|
7646
|
+
import_ui97.Infotip,
|
|
7020
7647
|
{
|
|
7021
7648
|
placement: "right",
|
|
7022
7649
|
content: addButtonInfotipContent,
|
|
7023
7650
|
color: "secondary",
|
|
7024
7651
|
slotProps: { popper: { sx: { width: 300 } } }
|
|
7025
7652
|
},
|
|
7026
|
-
/* @__PURE__ */
|
|
7027
|
-
) : addButton), 0 < uniqueKeys.length && /* @__PURE__ */
|
|
7653
|
+
/* @__PURE__ */ React113.createElement(import_ui97.Box, { sx: { ...isButtonDisabled ? { cursor: "not-allowed" } : {} } }, addButton)
|
|
7654
|
+
) : addButton), 0 < uniqueKeys.length && /* @__PURE__ */ React113.createElement(SortableProvider, { value: uniqueKeys, onChange: onChangeOrder }, uniqueKeys.map((key) => {
|
|
7028
7655
|
const index = uniqueKeys.indexOf(key);
|
|
7029
7656
|
const value = items2[index];
|
|
7030
7657
|
if (!value) {
|
|
7031
7658
|
return null;
|
|
7032
7659
|
}
|
|
7033
|
-
return /* @__PURE__ */
|
|
7660
|
+
return /* @__PURE__ */ React113.createElement(SortableItem, { id: key, key: `sortable-${key}`, disabled: !isSortable }, /* @__PURE__ */ React113.createElement(
|
|
7034
7661
|
RepeaterItem,
|
|
7035
7662
|
{
|
|
7036
7663
|
disabled,
|
|
7037
7664
|
propDisabled: value?.disabled,
|
|
7038
|
-
label: /* @__PURE__ */
|
|
7039
|
-
startIcon: /* @__PURE__ */
|
|
7665
|
+
label: /* @__PURE__ */ React113.createElement(RepeaterItemLabelSlot, { value }, /* @__PURE__ */ React113.createElement(itemSettings.Label, { value, index })),
|
|
7666
|
+
startIcon: /* @__PURE__ */ React113.createElement(RepeaterItemIconSlot, { value }, /* @__PURE__ */ React113.createElement(itemSettings.Icon, { value })),
|
|
7040
7667
|
removeItem: () => removeRepeaterItem(index),
|
|
7041
7668
|
duplicateItem: () => duplicateRepeaterItem(index),
|
|
7042
7669
|
toggleDisableItem: () => toggleDisableRepeaterItem(index),
|
|
@@ -7048,7 +7675,7 @@ var Repeater3 = ({
|
|
|
7048
7675
|
actions: itemSettings.actions,
|
|
7049
7676
|
value
|
|
7050
7677
|
},
|
|
7051
|
-
(props) => /* @__PURE__ */
|
|
7678
|
+
(props) => /* @__PURE__ */ React113.createElement(
|
|
7052
7679
|
itemSettings.Content,
|
|
7053
7680
|
{
|
|
7054
7681
|
...props,
|
|
@@ -7078,27 +7705,27 @@ var RepeaterItem = ({
|
|
|
7078
7705
|
value
|
|
7079
7706
|
}) => {
|
|
7080
7707
|
const { popoverState, popoverProps, ref, setRef } = usePopover(openOnMount, onOpen);
|
|
7081
|
-
const duplicateLabel = (0,
|
|
7082
|
-
const toggleLabel = propDisabled ? (0,
|
|
7083
|
-
const removeLabel = (0,
|
|
7084
|
-
return /* @__PURE__ */
|
|
7708
|
+
const duplicateLabel = (0, import_i18n55.__)("Duplicate", "elementor");
|
|
7709
|
+
const toggleLabel = propDisabled ? (0, import_i18n55.__)("Show", "elementor") : (0, import_i18n55.__)("Hide", "elementor");
|
|
7710
|
+
const removeLabel = (0, import_i18n55.__)("Remove", "elementor");
|
|
7711
|
+
return /* @__PURE__ */ React113.createElement(React113.Fragment, null, /* @__PURE__ */ React113.createElement(
|
|
7085
7712
|
RepeaterTag,
|
|
7086
7713
|
{
|
|
7087
7714
|
disabled,
|
|
7088
7715
|
label,
|
|
7089
7716
|
ref: setRef,
|
|
7090
|
-
"aria-label": (0,
|
|
7091
|
-
...(0,
|
|
7717
|
+
"aria-label": (0, import_i18n55.__)("Open item", "elementor"),
|
|
7718
|
+
...(0, import_ui97.bindTrigger)(popoverState),
|
|
7092
7719
|
startIcon,
|
|
7093
|
-
actions: /* @__PURE__ */
|
|
7720
|
+
actions: /* @__PURE__ */ React113.createElement(React113.Fragment, null, showDuplicate && /* @__PURE__ */ React113.createElement(import_ui97.Tooltip, { title: duplicateLabel, placement: "top" }, /* @__PURE__ */ React113.createElement(import_ui97.IconButton, { size: SIZE11, onClick: duplicateItem, "aria-label": duplicateLabel }, /* @__PURE__ */ React113.createElement(import_icons39.CopyIcon, { fontSize: SIZE11 }))), showToggle && /* @__PURE__ */ React113.createElement(import_ui97.Tooltip, { title: toggleLabel, placement: "top" }, /* @__PURE__ */ React113.createElement(import_ui97.IconButton, { size: SIZE11, onClick: toggleDisableItem, "aria-label": toggleLabel }, propDisabled ? /* @__PURE__ */ React113.createElement(import_icons39.EyeOffIcon, { fontSize: SIZE11 }) : /* @__PURE__ */ React113.createElement(import_icons39.EyeIcon, { fontSize: SIZE11 }))), actions?.(value), showRemove && /* @__PURE__ */ React113.createElement(import_ui97.Tooltip, { title: removeLabel, placement: "top" }, /* @__PURE__ */ React113.createElement(import_ui97.IconButton, { size: SIZE11, onClick: removeItem, "aria-label": removeLabel }, /* @__PURE__ */ React113.createElement(import_icons39.XIcon, { fontSize: SIZE11 }))))
|
|
7094
7721
|
}
|
|
7095
|
-
), /* @__PURE__ */
|
|
7722
|
+
), /* @__PURE__ */ React113.createElement(RepeaterPopover, { width: ref?.getBoundingClientRect().width, ...popoverProps, anchorEl: ref }, /* @__PURE__ */ React113.createElement(import_ui97.Box, null, children({ anchorEl: ref }))));
|
|
7096
7723
|
};
|
|
7097
7724
|
var usePopover = (openOnMount, onOpen) => {
|
|
7098
|
-
const [ref, setRef] = (0,
|
|
7099
|
-
const popoverState = (0,
|
|
7100
|
-
const popoverProps = (0,
|
|
7101
|
-
(0,
|
|
7725
|
+
const [ref, setRef] = (0, import_react62.useState)(null);
|
|
7726
|
+
const popoverState = (0, import_ui97.usePopupState)({ variant: "popover" });
|
|
7727
|
+
const popoverProps = (0, import_ui97.bindPopover)(popoverState);
|
|
7728
|
+
(0, import_react62.useEffect)(() => {
|
|
7102
7729
|
if (openOnMount && ref) {
|
|
7103
7730
|
popoverState.open(ref);
|
|
7104
7731
|
onOpen?.();
|
|
@@ -7113,20 +7740,20 @@ var usePopover = (openOnMount, onOpen) => {
|
|
|
7113
7740
|
};
|
|
7114
7741
|
|
|
7115
7742
|
// src/components/inline-editor-toolbar.tsx
|
|
7116
|
-
var
|
|
7117
|
-
var
|
|
7743
|
+
var React115 = __toESM(require("react"));
|
|
7744
|
+
var import_react64 = require("react");
|
|
7118
7745
|
var import_editor_elements6 = require("@elementor/editor-elements");
|
|
7119
|
-
var
|
|
7120
|
-
var
|
|
7121
|
-
var
|
|
7122
|
-
var
|
|
7746
|
+
var import_icons41 = require("@elementor/icons");
|
|
7747
|
+
var import_ui99 = require("@elementor/ui");
|
|
7748
|
+
var import_react65 = require("@tiptap/react");
|
|
7749
|
+
var import_i18n57 = require("@wordpress/i18n");
|
|
7123
7750
|
|
|
7124
7751
|
// src/components/url-popover.tsx
|
|
7125
|
-
var
|
|
7126
|
-
var
|
|
7127
|
-
var
|
|
7128
|
-
var
|
|
7129
|
-
var
|
|
7752
|
+
var React114 = __toESM(require("react"));
|
|
7753
|
+
var import_react63 = require("react");
|
|
7754
|
+
var import_icons40 = require("@elementor/icons");
|
|
7755
|
+
var import_ui98 = require("@elementor/ui");
|
|
7756
|
+
var import_i18n56 = require("@wordpress/i18n");
|
|
7130
7757
|
var UrlPopover = ({
|
|
7131
7758
|
popupState,
|
|
7132
7759
|
restoreValue,
|
|
@@ -7136,8 +7763,8 @@ var UrlPopover = ({
|
|
|
7136
7763
|
openInNewTab,
|
|
7137
7764
|
onToggleNewTab
|
|
7138
7765
|
}) => {
|
|
7139
|
-
const inputRef = (0,
|
|
7140
|
-
(0,
|
|
7766
|
+
const inputRef = (0, import_react63.useRef)(null);
|
|
7767
|
+
(0, import_react63.useEffect)(() => {
|
|
7141
7768
|
if (popupState.isOpen) {
|
|
7142
7769
|
requestAnimationFrame(() => inputRef.current?.focus());
|
|
7143
7770
|
}
|
|
@@ -7146,57 +7773,57 @@ var UrlPopover = ({
|
|
|
7146
7773
|
restoreValue();
|
|
7147
7774
|
popupState.close();
|
|
7148
7775
|
};
|
|
7149
|
-
return /* @__PURE__ */
|
|
7150
|
-
|
|
7776
|
+
return /* @__PURE__ */ React114.createElement(
|
|
7777
|
+
import_ui98.Popover,
|
|
7151
7778
|
{
|
|
7152
7779
|
slotProps: {
|
|
7153
7780
|
paper: { sx: { borderRadius: "16px", width: anchorRef.current?.offsetWidth + "px", marginTop: -1 } }
|
|
7154
7781
|
},
|
|
7155
|
-
...(0,
|
|
7782
|
+
...(0, import_ui98.bindPopover)(popupState),
|
|
7156
7783
|
anchorOrigin: { vertical: "top", horizontal: "left" },
|
|
7157
7784
|
transformOrigin: { vertical: "top", horizontal: "left" },
|
|
7158
7785
|
onClose: handleClose
|
|
7159
7786
|
},
|
|
7160
|
-
/* @__PURE__ */
|
|
7161
|
-
|
|
7787
|
+
/* @__PURE__ */ React114.createElement(import_ui98.Stack, { direction: "row", alignItems: "center", gap: 1, sx: { p: 1.5 } }, /* @__PURE__ */ React114.createElement(
|
|
7788
|
+
import_ui98.TextField,
|
|
7162
7789
|
{
|
|
7163
7790
|
value,
|
|
7164
7791
|
onChange,
|
|
7165
7792
|
size: "tiny",
|
|
7166
7793
|
fullWidth: true,
|
|
7167
|
-
placeholder: (0,
|
|
7794
|
+
placeholder: (0, import_i18n56.__)("Type a URL", "elementor"),
|
|
7168
7795
|
inputProps: { ref: inputRef },
|
|
7169
7796
|
color: "secondary",
|
|
7170
7797
|
InputProps: { sx: { borderRadius: "8px" } },
|
|
7171
7798
|
onKeyUp: (event) => event.key === "Enter" && handleClose()
|
|
7172
7799
|
}
|
|
7173
|
-
), /* @__PURE__ */
|
|
7174
|
-
|
|
7800
|
+
), /* @__PURE__ */ React114.createElement(import_ui98.Tooltip, { title: (0, import_i18n56.__)("Open in a new tab", "elementor") }, /* @__PURE__ */ React114.createElement(
|
|
7801
|
+
import_ui98.ToggleButton,
|
|
7175
7802
|
{
|
|
7176
7803
|
size: "tiny",
|
|
7177
7804
|
value: "newTab",
|
|
7178
7805
|
selected: openInNewTab,
|
|
7179
7806
|
onClick: onToggleNewTab,
|
|
7180
|
-
"aria-label": (0,
|
|
7807
|
+
"aria-label": (0, import_i18n56.__)("Open in a new tab", "elementor"),
|
|
7181
7808
|
sx: { borderRadius: "8px" }
|
|
7182
7809
|
},
|
|
7183
|
-
/* @__PURE__ */
|
|
7810
|
+
/* @__PURE__ */ React114.createElement(import_icons40.ExternalLinkIcon, { fontSize: "tiny" })
|
|
7184
7811
|
)))
|
|
7185
7812
|
);
|
|
7186
7813
|
};
|
|
7187
7814
|
|
|
7188
7815
|
// src/components/inline-editor-toolbar.tsx
|
|
7189
7816
|
var InlineEditorToolbar = ({ editor, elementId, sx = {} }) => {
|
|
7190
|
-
const [urlValue, setUrlValue] = (0,
|
|
7191
|
-
const [openInNewTab, setOpenInNewTab] = (0,
|
|
7192
|
-
const toolbarRef = (0,
|
|
7193
|
-
const linkPopupState = (0,
|
|
7817
|
+
const [urlValue, setUrlValue] = (0, import_react64.useState)("");
|
|
7818
|
+
const [openInNewTab, setOpenInNewTab] = (0, import_react64.useState)(false);
|
|
7819
|
+
const toolbarRef = (0, import_react64.useRef)(null);
|
|
7820
|
+
const linkPopupState = (0, import_ui99.usePopupState)({ variant: "popover" });
|
|
7194
7821
|
const isElementClickable = elementId ? checkIfElementIsClickable(elementId) : false;
|
|
7195
|
-
const editorState = (0,
|
|
7822
|
+
const editorState = (0, import_react65.useEditorState)({
|
|
7196
7823
|
editor,
|
|
7197
7824
|
selector: (ctx) => possibleFormats.filter((format) => ctx.editor.isActive(format))
|
|
7198
7825
|
});
|
|
7199
|
-
const formatButtonsList = (0,
|
|
7826
|
+
const formatButtonsList = (0, import_react64.useMemo)(() => {
|
|
7200
7827
|
const buttons = Object.values(formatButtons);
|
|
7201
7828
|
if (isElementClickable) {
|
|
7202
7829
|
return buttons.filter((button) => button.action !== "link");
|
|
@@ -7233,11 +7860,11 @@ var InlineEditorToolbar = ({ editor, elementId, sx = {} }) => {
|
|
|
7233
7860
|
}
|
|
7234
7861
|
linkPopupState.close();
|
|
7235
7862
|
};
|
|
7236
|
-
|
|
7863
|
+
React115.useEffect(() => {
|
|
7237
7864
|
editor?.commands?.focus();
|
|
7238
7865
|
}, [editor]);
|
|
7239
|
-
return /* @__PURE__ */
|
|
7240
|
-
|
|
7866
|
+
return /* @__PURE__ */ React115.createElement(
|
|
7867
|
+
import_ui99.Box,
|
|
7241
7868
|
{
|
|
7242
7869
|
ref: toolbarRef,
|
|
7243
7870
|
sx: {
|
|
@@ -7253,9 +7880,9 @@ var InlineEditorToolbar = ({ editor, elementId, sx = {} }) => {
|
|
|
7253
7880
|
...sx
|
|
7254
7881
|
}
|
|
7255
7882
|
},
|
|
7256
|
-
/* @__PURE__ */
|
|
7257
|
-
/* @__PURE__ */
|
|
7258
|
-
|
|
7883
|
+
/* @__PURE__ */ React115.createElement(import_ui99.Tooltip, { title: clearButton.label, placement: "top", sx: { borderRadius: "8px" } }, /* @__PURE__ */ React115.createElement(import_ui99.IconButton, { "aria-label": clearButton.label, onClick: () => clearButton.method(editor), size: "tiny" }, clearButton.icon)),
|
|
7884
|
+
/* @__PURE__ */ React115.createElement(
|
|
7885
|
+
import_ui99.ToggleButtonGroup,
|
|
7259
7886
|
{
|
|
7260
7887
|
value: editorState,
|
|
7261
7888
|
size: "tiny",
|
|
@@ -7263,7 +7890,7 @@ var InlineEditorToolbar = ({ editor, elementId, sx = {} }) => {
|
|
|
7263
7890
|
display: "flex",
|
|
7264
7891
|
gap: 0.5,
|
|
7265
7892
|
border: "none",
|
|
7266
|
-
[`& .${
|
|
7893
|
+
[`& .${import_ui99.toggleButtonGroupClasses.firstButton}, & .${import_ui99.toggleButtonGroupClasses.middleButton}, & .${import_ui99.toggleButtonGroupClasses.lastButton}`]: {
|
|
7267
7894
|
borderRadius: "8px",
|
|
7268
7895
|
border: "none",
|
|
7269
7896
|
marginLeft: 0,
|
|
@@ -7276,8 +7903,8 @@ var InlineEditorToolbar = ({ editor, elementId, sx = {} }) => {
|
|
|
7276
7903
|
}
|
|
7277
7904
|
}
|
|
7278
7905
|
},
|
|
7279
|
-
formatButtonsList.map((button) => /* @__PURE__ */
|
|
7280
|
-
|
|
7906
|
+
formatButtonsList.map((button) => /* @__PURE__ */ React115.createElement(import_ui99.Tooltip, { title: button.label, key: button.action, placement: "top" }, /* @__PURE__ */ React115.createElement(
|
|
7907
|
+
import_ui99.ToggleButton,
|
|
7281
7908
|
{
|
|
7282
7909
|
value: button.action,
|
|
7283
7910
|
"aria-label": button.label,
|
|
@@ -7294,7 +7921,7 @@ var InlineEditorToolbar = ({ editor, elementId, sx = {} }) => {
|
|
|
7294
7921
|
button.icon
|
|
7295
7922
|
)))
|
|
7296
7923
|
),
|
|
7297
|
-
/* @__PURE__ */
|
|
7924
|
+
/* @__PURE__ */ React115.createElement(
|
|
7298
7925
|
UrlPopover,
|
|
7299
7926
|
{
|
|
7300
7927
|
popupState: linkPopupState,
|
|
@@ -7317,64 +7944,64 @@ var checkIfElementIsClickable = (elementId) => {
|
|
|
7317
7944
|
};
|
|
7318
7945
|
var toolbarButtons = {
|
|
7319
7946
|
clear: {
|
|
7320
|
-
label: (0,
|
|
7321
|
-
icon: /* @__PURE__ */
|
|
7947
|
+
label: (0, import_i18n57.__)("Clear", "elementor"),
|
|
7948
|
+
icon: /* @__PURE__ */ React115.createElement(import_icons41.MinusIcon, { fontSize: "tiny" }),
|
|
7322
7949
|
action: "clear",
|
|
7323
7950
|
method: (editor) => {
|
|
7324
7951
|
editor.chain().focus().clearNodes().unsetAllMarks().run();
|
|
7325
7952
|
}
|
|
7326
7953
|
},
|
|
7327
7954
|
bold: {
|
|
7328
|
-
label: (0,
|
|
7329
|
-
icon: /* @__PURE__ */
|
|
7955
|
+
label: (0, import_i18n57.__)("Bold", "elementor"),
|
|
7956
|
+
icon: /* @__PURE__ */ React115.createElement(import_icons41.BoldIcon, { fontSize: "tiny" }),
|
|
7330
7957
|
action: "bold",
|
|
7331
7958
|
method: (editor) => {
|
|
7332
7959
|
editor.chain().focus().toggleBold().run();
|
|
7333
7960
|
}
|
|
7334
7961
|
},
|
|
7335
7962
|
italic: {
|
|
7336
|
-
label: (0,
|
|
7337
|
-
icon: /* @__PURE__ */
|
|
7963
|
+
label: (0, import_i18n57.__)("Italic", "elementor"),
|
|
7964
|
+
icon: /* @__PURE__ */ React115.createElement(import_icons41.ItalicIcon, { fontSize: "tiny" }),
|
|
7338
7965
|
action: "italic",
|
|
7339
7966
|
method: (editor) => {
|
|
7340
7967
|
editor.chain().focus().toggleItalic().run();
|
|
7341
7968
|
}
|
|
7342
7969
|
},
|
|
7343
7970
|
underline: {
|
|
7344
|
-
label: (0,
|
|
7345
|
-
icon: /* @__PURE__ */
|
|
7971
|
+
label: (0, import_i18n57.__)("Underline", "elementor"),
|
|
7972
|
+
icon: /* @__PURE__ */ React115.createElement(import_icons41.UnderlineIcon, { fontSize: "tiny" }),
|
|
7346
7973
|
action: "underline",
|
|
7347
7974
|
method: (editor) => {
|
|
7348
7975
|
editor.chain().focus().toggleUnderline().run();
|
|
7349
7976
|
}
|
|
7350
7977
|
},
|
|
7351
7978
|
strike: {
|
|
7352
|
-
label: (0,
|
|
7353
|
-
icon: /* @__PURE__ */
|
|
7979
|
+
label: (0, import_i18n57.__)("Strikethrough", "elementor"),
|
|
7980
|
+
icon: /* @__PURE__ */ React115.createElement(import_icons41.StrikethroughIcon, { fontSize: "tiny" }),
|
|
7354
7981
|
action: "strike",
|
|
7355
7982
|
method: (editor) => {
|
|
7356
7983
|
editor.chain().focus().toggleStrike().run();
|
|
7357
7984
|
}
|
|
7358
7985
|
},
|
|
7359
7986
|
superscript: {
|
|
7360
|
-
label: (0,
|
|
7361
|
-
icon: /* @__PURE__ */
|
|
7987
|
+
label: (0, import_i18n57.__)("Superscript", "elementor"),
|
|
7988
|
+
icon: /* @__PURE__ */ React115.createElement(import_icons41.SuperscriptIcon, { fontSize: "tiny" }),
|
|
7362
7989
|
action: "superscript",
|
|
7363
7990
|
method: (editor) => {
|
|
7364
7991
|
editor.chain().focus().toggleSuperscript().run();
|
|
7365
7992
|
}
|
|
7366
7993
|
},
|
|
7367
7994
|
subscript: {
|
|
7368
|
-
label: (0,
|
|
7369
|
-
icon: /* @__PURE__ */
|
|
7995
|
+
label: (0, import_i18n57.__)("Subscript", "elementor"),
|
|
7996
|
+
icon: /* @__PURE__ */ React115.createElement(import_icons41.SubscriptIcon, { fontSize: "tiny" }),
|
|
7370
7997
|
action: "subscript",
|
|
7371
7998
|
method: (editor) => {
|
|
7372
7999
|
editor.chain().focus().toggleSubscript().run();
|
|
7373
8000
|
}
|
|
7374
8001
|
},
|
|
7375
8002
|
link: {
|
|
7376
|
-
label: (0,
|
|
7377
|
-
icon: /* @__PURE__ */
|
|
8003
|
+
label: (0, import_i18n57.__)("Link", "elementor"),
|
|
8004
|
+
icon: /* @__PURE__ */ React115.createElement(import_icons41.LinkIcon, { fontSize: "tiny" }),
|
|
7378
8005
|
action: "link",
|
|
7379
8006
|
method: null
|
|
7380
8007
|
}
|
|
@@ -7383,13 +8010,13 @@ var { clear: clearButton, ...formatButtons } = toolbarButtons;
|
|
|
7383
8010
|
var possibleFormats = Object.keys(formatButtons);
|
|
7384
8011
|
|
|
7385
8012
|
// src/components/size/unstable-size-field.tsx
|
|
7386
|
-
var
|
|
7387
|
-
var
|
|
8013
|
+
var React118 = __toESM(require("react"));
|
|
8014
|
+
var import_ui101 = require("@elementor/ui");
|
|
7388
8015
|
|
|
7389
8016
|
// src/hooks/use-size-value.ts
|
|
7390
8017
|
var DEFAULT_UNIT2 = "px";
|
|
7391
|
-
var
|
|
7392
|
-
var
|
|
8018
|
+
var DEFAULT_SIZE3 = "";
|
|
8019
|
+
var useSizeValue2 = (externalValue, onChange, defaultUnit) => {
|
|
7393
8020
|
const [sizeValue, setSizeValue] = useSyncExternalState({
|
|
7394
8021
|
external: externalValue,
|
|
7395
8022
|
setExternal: (newState) => {
|
|
@@ -7398,7 +8025,7 @@ var useSizeValue = (externalValue, onChange, defaultUnit) => {
|
|
|
7398
8025
|
}
|
|
7399
8026
|
},
|
|
7400
8027
|
persistWhen: (newState) => differsFromExternal(newState, externalValue),
|
|
7401
|
-
fallback: () => ({ size:
|
|
8028
|
+
fallback: () => ({ size: DEFAULT_SIZE3, unit: defaultUnit ?? DEFAULT_UNIT2 })
|
|
7402
8029
|
});
|
|
7403
8030
|
const setSize = (value) => {
|
|
7404
8031
|
const newState = {
|
|
@@ -7426,44 +8053,44 @@ var differsFromExternal = (newState, externalState) => {
|
|
|
7426
8053
|
};
|
|
7427
8054
|
|
|
7428
8055
|
// src/components/size/unit-select.tsx
|
|
7429
|
-
var
|
|
7430
|
-
var
|
|
7431
|
-
var
|
|
7432
|
-
var
|
|
7433
|
-
var
|
|
8056
|
+
var React116 = __toESM(require("react"));
|
|
8057
|
+
var import_react66 = require("react");
|
|
8058
|
+
var import_editor_ui17 = require("@elementor/editor-ui");
|
|
8059
|
+
var import_ui100 = require("@elementor/ui");
|
|
8060
|
+
var menuItemContentStyles2 = {
|
|
7434
8061
|
display: "flex",
|
|
7435
8062
|
flexDirection: "column",
|
|
7436
8063
|
justifyContent: "center"
|
|
7437
8064
|
};
|
|
7438
8065
|
var UnitSelect = ({ value, showPrimaryColor, onClick, options }) => {
|
|
7439
|
-
const popupState = (0,
|
|
8066
|
+
const popupState = (0, import_ui100.usePopupState)({
|
|
7440
8067
|
variant: "popover",
|
|
7441
|
-
popupId: (0,
|
|
8068
|
+
popupId: (0, import_react66.useId)()
|
|
7442
8069
|
});
|
|
7443
8070
|
const handleMenuItemClick = (index) => {
|
|
7444
8071
|
onClick(options[index]);
|
|
7445
8072
|
popupState.close();
|
|
7446
8073
|
};
|
|
7447
|
-
return /* @__PURE__ */
|
|
7448
|
-
|
|
8074
|
+
return /* @__PURE__ */ React116.createElement(React116.Fragment, null, /* @__PURE__ */ React116.createElement(StyledButton3, { isPrimaryColor: showPrimaryColor, size: "small", ...(0, import_ui100.bindTrigger)(popupState) }, value), /* @__PURE__ */ React116.createElement(import_ui100.Menu, { MenuListProps: { dense: true }, ...(0, import_ui100.bindMenu)(popupState) }, options.map((option, index) => /* @__PURE__ */ React116.createElement(
|
|
8075
|
+
import_editor_ui17.MenuListItem,
|
|
7449
8076
|
{
|
|
7450
8077
|
key: option,
|
|
7451
8078
|
onClick: () => handleMenuItemClick(index),
|
|
7452
8079
|
primaryTypographyProps: {
|
|
7453
8080
|
variant: "caption",
|
|
7454
8081
|
sx: {
|
|
7455
|
-
...
|
|
8082
|
+
...menuItemContentStyles2,
|
|
7456
8083
|
lineHeight: "1"
|
|
7457
8084
|
}
|
|
7458
8085
|
},
|
|
7459
8086
|
menuItemTextProps: {
|
|
7460
|
-
sx:
|
|
8087
|
+
sx: menuItemContentStyles2
|
|
7461
8088
|
}
|
|
7462
8089
|
},
|
|
7463
8090
|
option.toUpperCase()
|
|
7464
8091
|
))));
|
|
7465
8092
|
};
|
|
7466
|
-
var
|
|
8093
|
+
var StyledButton3 = (0, import_ui100.styled)(import_ui100.Button, {
|
|
7467
8094
|
shouldForwardProp: (prop) => prop !== "isPrimaryColor"
|
|
7468
8095
|
})(({ isPrimaryColor, theme }) => ({
|
|
7469
8096
|
color: isPrimaryColor ? theme.palette.text.primary : theme.palette.text.tertiary,
|
|
@@ -7473,11 +8100,11 @@ var StyledButton2 = (0, import_ui96.styled)(import_ui96.Button, {
|
|
|
7473
8100
|
}));
|
|
7474
8101
|
|
|
7475
8102
|
// src/components/size/unstable-size-input.tsx
|
|
7476
|
-
var
|
|
7477
|
-
var
|
|
7478
|
-
var UnstableSizeInput = (0,
|
|
8103
|
+
var React117 = __toESM(require("react"));
|
|
8104
|
+
var import_react67 = require("react");
|
|
8105
|
+
var UnstableSizeInput = (0, import_react67.forwardRef)(
|
|
7479
8106
|
({ type, value, onChange, onKeyDown, onKeyUp, InputProps, onBlur, focused, disabled }, ref) => {
|
|
7480
|
-
return /* @__PURE__ */
|
|
8107
|
+
return /* @__PURE__ */ React117.createElement(
|
|
7481
8108
|
NumberInput,
|
|
7482
8109
|
{
|
|
7483
8110
|
ref,
|
|
@@ -7492,12 +8119,12 @@ var UnstableSizeInput = (0, import_react62.forwardRef)(
|
|
|
7492
8119
|
onInput: onChange,
|
|
7493
8120
|
onBlur,
|
|
7494
8121
|
InputProps,
|
|
7495
|
-
sx:
|
|
8122
|
+
sx: getCursorStyle2(InputProps?.readOnly ?? false)
|
|
7496
8123
|
}
|
|
7497
8124
|
);
|
|
7498
8125
|
}
|
|
7499
8126
|
);
|
|
7500
|
-
var
|
|
8127
|
+
var getCursorStyle2 = (readOnly) => ({
|
|
7501
8128
|
input: { cursor: readOnly ? "default !important" : void 0 }
|
|
7502
8129
|
});
|
|
7503
8130
|
|
|
@@ -7511,11 +8138,11 @@ var UnstableSizeField = ({
|
|
|
7511
8138
|
defaultUnit,
|
|
7512
8139
|
startIcon
|
|
7513
8140
|
}) => {
|
|
7514
|
-
const { size, unit, setSize, setUnit } =
|
|
7515
|
-
const
|
|
8141
|
+
const { size, unit, setSize, setUnit } = useSizeValue2(value, onChange, defaultUnit);
|
|
8142
|
+
const shouldHighlightUnit2 = () => {
|
|
7516
8143
|
return hasValue(size);
|
|
7517
8144
|
};
|
|
7518
|
-
return /* @__PURE__ */
|
|
8145
|
+
return /* @__PURE__ */ React118.createElement(
|
|
7519
8146
|
UnstableSizeInput,
|
|
7520
8147
|
{
|
|
7521
8148
|
type: "number",
|
|
@@ -7524,14 +8151,14 @@ var UnstableSizeField = ({
|
|
|
7524
8151
|
onChange: (event) => setSize(event.target.value),
|
|
7525
8152
|
InputProps: {
|
|
7526
8153
|
...InputProps,
|
|
7527
|
-
startAdornment: startIcon && /* @__PURE__ */
|
|
7528
|
-
endAdornment: /* @__PURE__ */
|
|
8154
|
+
startAdornment: startIcon && /* @__PURE__ */ React118.createElement(import_ui101.InputAdornment, { position: "start" }, startIcon),
|
|
8155
|
+
endAdornment: /* @__PURE__ */ React118.createElement(import_ui101.InputAdornment, { position: "end" }, /* @__PURE__ */ React118.createElement(
|
|
7529
8156
|
UnitSelect,
|
|
7530
8157
|
{
|
|
7531
8158
|
options: units2,
|
|
7532
8159
|
value: unit,
|
|
7533
8160
|
onClick: setUnit,
|
|
7534
|
-
showPrimaryColor:
|
|
8161
|
+
showPrimaryColor: shouldHighlightUnit2()
|
|
7535
8162
|
}
|
|
7536
8163
|
))
|
|
7537
8164
|
}
|
|
@@ -7543,7 +8170,7 @@ var hasValue = (value) => {
|
|
|
7543
8170
|
};
|
|
7544
8171
|
|
|
7545
8172
|
// src/hooks/use-font-families.ts
|
|
7546
|
-
var
|
|
8173
|
+
var import_react68 = require("react");
|
|
7547
8174
|
var import_editor_v1_adapters = require("@elementor/editor-v1-adapters");
|
|
7548
8175
|
var getFontControlConfig = () => {
|
|
7549
8176
|
const { controls } = (0, import_editor_v1_adapters.getElementorConfig)();
|
|
@@ -7551,7 +8178,7 @@ var getFontControlConfig = () => {
|
|
|
7551
8178
|
};
|
|
7552
8179
|
var useFontFamilies = () => {
|
|
7553
8180
|
const { groups, options } = getFontControlConfig();
|
|
7554
|
-
return (0,
|
|
8181
|
+
return (0, import_react68.useMemo)(() => {
|
|
7555
8182
|
if (!groups || !options) {
|
|
7556
8183
|
return [];
|
|
7557
8184
|
}
|
|
@@ -7617,6 +8244,7 @@ var useFontFamilies = () => {
|
|
|
7617
8244
|
Repeater,
|
|
7618
8245
|
SelectControl,
|
|
7619
8246
|
SelectControlWrapper,
|
|
8247
|
+
SizeComponent,
|
|
7620
8248
|
SizeControl,
|
|
7621
8249
|
StrokeControl,
|
|
7622
8250
|
SvgMediaControl,
|
|
@@ -7628,6 +8256,7 @@ var useFontFamilies = () => {
|
|
|
7628
8256
|
TransformRepeaterControl,
|
|
7629
8257
|
TransformSettingsControl,
|
|
7630
8258
|
TransitionRepeaterControl,
|
|
8259
|
+
UnstableSizeControl,
|
|
7631
8260
|
UnstableSizeField,
|
|
7632
8261
|
UrlControl,
|
|
7633
8262
|
VideoMediaControl,
|