@elementor/editor-controls 4.0.0-683 → 4.0.0-beta5
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 +138 -74
- package/dist/index.d.ts +138 -74
- package/dist/index.js +822 -203
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +799 -185
- package/dist/index.mjs.map +1 -1
- package/package.json +15 -15
- package/src/components/inline-editor.tsx +16 -57
- package/src/controls/email-form-action-control.tsx +5 -5
- 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/controls/svg-media-control.tsx +5 -4
- package/src/controls/transition-control/data.ts +3 -3
- package/src/controls/transition-control/transition-repeater-control.tsx +8 -2
- 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,
|
|
@@ -4132,8 +4134,9 @@ var StyledCardMediaContainer = (0, import_ui56.styled)(import_ui56.Stack)`
|
|
|
4132
4134
|
var MODE_BROWSE = { mode: "browse" };
|
|
4133
4135
|
var MODE_UPLOAD = { mode: "upload" };
|
|
4134
4136
|
var SvgMediaControl = createControl(() => {
|
|
4135
|
-
const { value, setValue } = useBoundProp(import_editor_props28.
|
|
4136
|
-
const
|
|
4137
|
+
const { value, setValue } = useBoundProp(import_editor_props28.svgSrcPropTypeUtil);
|
|
4138
|
+
const id = value?.id;
|
|
4139
|
+
const url = value?.url;
|
|
4137
4140
|
const { data: attachment, isFetching } = (0, import_wp_media2.useWpMediaAttachment)(id?.value || null);
|
|
4138
4141
|
const src = attachment?.url ?? url?.value ?? null;
|
|
4139
4142
|
const { data: allowSvgUpload } = useUnfilteredFilesUpload();
|
|
@@ -4149,7 +4152,7 @@ var SvgMediaControl = createControl(() => {
|
|
|
4149
4152
|
$$type: "image-attachment-id",
|
|
4150
4153
|
value: selectedAttachment.id
|
|
4151
4154
|
},
|
|
4152
|
-
url:
|
|
4155
|
+
url: import_editor_props28.urlPropTypeUtil.create(selectedAttachment.url)
|
|
4153
4156
|
});
|
|
4154
4157
|
}
|
|
4155
4158
|
});
|
|
@@ -5761,6 +5764,7 @@ var import_react50 = require("react");
|
|
|
5761
5764
|
var import_editor_props50 = require("@elementor/editor-props");
|
|
5762
5765
|
var import_icons33 = require("@elementor/icons");
|
|
5763
5766
|
var import_ui84 = require("@elementor/ui");
|
|
5767
|
+
var import_utils7 = require("@elementor/utils");
|
|
5764
5768
|
var import_i18n50 = require("@wordpress/i18n");
|
|
5765
5769
|
|
|
5766
5770
|
// src/controls/selection-size-control.tsx
|
|
@@ -5814,9 +5818,9 @@ var MIN_PRO_VERSION = "3.35";
|
|
|
5814
5818
|
var getIsSiteRtl = () => {
|
|
5815
5819
|
return !!window.elementorFrontend?.config?.is_rtl;
|
|
5816
5820
|
};
|
|
5817
|
-
var
|
|
5821
|
+
var shouldShowAllTransitionProperties = () => {
|
|
5818
5822
|
if (!(0, import_utils6.hasProInstalled)()) {
|
|
5819
|
-
return
|
|
5823
|
+
return true;
|
|
5820
5824
|
}
|
|
5821
5825
|
const proVersion = window.elementorPro?.config?.version;
|
|
5822
5826
|
if (!proVersion) {
|
|
@@ -5953,7 +5957,7 @@ var createTransitionPropertiesList = () => {
|
|
|
5953
5957
|
]
|
|
5954
5958
|
}
|
|
5955
5959
|
];
|
|
5956
|
-
return
|
|
5960
|
+
return shouldShowAllTransitionProperties() ? baseProperties : [baseProperties[0]];
|
|
5957
5961
|
};
|
|
5958
5962
|
var transitionProperties = createTransitionPropertiesList();
|
|
5959
5963
|
var transitionsItemsList = transitionProperties.map((category) => ({
|
|
@@ -6302,6 +6306,7 @@ var TransitionRepeaterControl = createControl(
|
|
|
6302
6306
|
}) => {
|
|
6303
6307
|
const currentStyleIsNormal = currentStyleState === null;
|
|
6304
6308
|
const [recentlyUsedList, setRecentlyUsedList] = (0, import_react50.useState)([]);
|
|
6309
|
+
const proInstalled = (0, import_utils7.hasProInstalled)();
|
|
6305
6310
|
const { value, setValue } = useBoundProp(childArrayPropTypeUtil);
|
|
6306
6311
|
const { allDisabled: disabledItems, proDisabled: proDisabledItems } = (0, import_react50.useMemo)(
|
|
6307
6312
|
() => getDisabledItemLabels(value),
|
|
@@ -6310,10 +6315,14 @@ var TransitionRepeaterControl = createControl(
|
|
|
6310
6315
|
const allowedTransitionSet = (0, import_react50.useMemo)(() => {
|
|
6311
6316
|
const set = /* @__PURE__ */ new Set();
|
|
6312
6317
|
transitionProperties.forEach((category) => {
|
|
6313
|
-
category.properties.forEach((prop) =>
|
|
6318
|
+
category.properties.forEach((prop) => {
|
|
6319
|
+
if (!prop.isDisabled || proInstalled) {
|
|
6320
|
+
set.add(prop.value);
|
|
6321
|
+
}
|
|
6322
|
+
});
|
|
6314
6323
|
});
|
|
6315
6324
|
return set;
|
|
6316
|
-
}, []);
|
|
6325
|
+
}, [proInstalled]);
|
|
6317
6326
|
(0, import_react50.useEffect)(() => {
|
|
6318
6327
|
if (!value || value.length === 0) {
|
|
6319
6328
|
return;
|
|
@@ -6438,7 +6447,7 @@ var React101 = __toESM(require("react"));
|
|
|
6438
6447
|
var import_react53 = require("react");
|
|
6439
6448
|
var import_editor_props53 = require("@elementor/editor-props");
|
|
6440
6449
|
var import_ui87 = require("@elementor/ui");
|
|
6441
|
-
var
|
|
6450
|
+
var import_utils8 = require("@elementor/utils");
|
|
6442
6451
|
|
|
6443
6452
|
// src/components/inline-editor.tsx
|
|
6444
6453
|
var React100 = __toESM(require("react"));
|
|
@@ -6484,9 +6493,12 @@ var InlineEditor = React100.forwardRef((props, ref) => {
|
|
|
6484
6493
|
expectedTag = null,
|
|
6485
6494
|
onEditorCreate,
|
|
6486
6495
|
wrapperClassName,
|
|
6487
|
-
onSelectionEnd
|
|
6496
|
+
onSelectionEnd,
|
|
6497
|
+
mountElement = null
|
|
6488
6498
|
} = props;
|
|
6489
6499
|
const containerRef = (0, import_react51.useRef)(null);
|
|
6500
|
+
const onBlurRef = (0, import_react51.useRef)(onBlur);
|
|
6501
|
+
onBlurRef.current = onBlur;
|
|
6490
6502
|
const documentContentSettings = !!expectedTag ? "block+" : "inline*";
|
|
6491
6503
|
const onUpdate = ({ editor: updatedEditor }) => {
|
|
6492
6504
|
const newValue = updatedEditor.getHTML();
|
|
@@ -6494,7 +6506,7 @@ var InlineEditor = React100.forwardRef((props, ref) => {
|
|
|
6494
6506
|
};
|
|
6495
6507
|
const onKeyDown = (_, event) => {
|
|
6496
6508
|
if (event.key === "Escape") {
|
|
6497
|
-
|
|
6509
|
+
onBlurRef.current?.();
|
|
6498
6510
|
}
|
|
6499
6511
|
if (!event.metaKey && !event.ctrlKey || event.altKey) {
|
|
6500
6512
|
return;
|
|
@@ -6508,6 +6520,7 @@ var InlineEditor = React100.forwardRef((props, ref) => {
|
|
|
6508
6520
|
class: elementClasses
|
|
6509
6521
|
});
|
|
6510
6522
|
const editor = (0, import_react52.useEditor)({
|
|
6523
|
+
...mountElement ? { element: mountElement } : {},
|
|
6511
6524
|
extensions: [
|
|
6512
6525
|
import_extension_document.default.extend({
|
|
6513
6526
|
content: documentContentSettings
|
|
@@ -6561,6 +6574,7 @@ var InlineEditor = React100.forwardRef((props, ref) => {
|
|
|
6561
6574
|
}
|
|
6562
6575
|
},
|
|
6563
6576
|
onCreate: onEditorCreate ? ({ editor: mountedEditor }) => onEditorCreate(mountedEditor) : void 0,
|
|
6577
|
+
onBlur: mountElement ? void 0 : () => onBlurRef.current?.(),
|
|
6564
6578
|
onSelectionUpdate: onSelectionEnd ? ({ editor: updatedEditor }) => onSelectionEnd(updatedEditor.view) : void 0
|
|
6565
6579
|
});
|
|
6566
6580
|
useOnUpdate(() => {
|
|
@@ -6572,33 +6586,11 @@ var InlineEditor = React100.forwardRef((props, ref) => {
|
|
|
6572
6586
|
editor.commands.setContent(value, { emitUpdate: false });
|
|
6573
6587
|
}
|
|
6574
6588
|
}, [editor, value]);
|
|
6575
|
-
|
|
6576
|
-
|
|
6577
|
-
|
|
6578
|
-
|
|
6579
|
-
editor,
|
|
6580
|
-
sx,
|
|
6581
|
-
onBlur,
|
|
6582
|
-
className: wrapperClassName
|
|
6583
|
-
},
|
|
6584
|
-
/* @__PURE__ */ React100.createElement(import_react52.EditorContent, { ref, editor })
|
|
6585
|
-
));
|
|
6589
|
+
if (mountElement) {
|
|
6590
|
+
return null;
|
|
6591
|
+
}
|
|
6592
|
+
return /* @__PURE__ */ React100.createElement(import_ui86.Box, { ref: containerRef, sx, className: wrapperClassName }, /* @__PURE__ */ React100.createElement(import_react52.EditorContent, { ref, editor }));
|
|
6586
6593
|
});
|
|
6587
|
-
var Wrapper = ({ children, containerRef, editor, sx, onBlur, className }) => {
|
|
6588
|
-
const wrappedChildren = /* @__PURE__ */ React100.createElement(import_ui86.Box, { ref: containerRef, ...sx, className }, children);
|
|
6589
|
-
return onBlur ? /* @__PURE__ */ React100.createElement(
|
|
6590
|
-
import_ui86.ClickAwayListener,
|
|
6591
|
-
{
|
|
6592
|
-
onClickAway: (event) => {
|
|
6593
|
-
if (containerRef.current?.contains(event.target) || editor.view.dom.contains(event.target)) {
|
|
6594
|
-
return;
|
|
6595
|
-
}
|
|
6596
|
-
onBlur?.();
|
|
6597
|
-
}
|
|
6598
|
-
},
|
|
6599
|
-
wrappedChildren
|
|
6600
|
-
) : /* @__PURE__ */ React100.createElement(React100.Fragment, null, wrappedChildren);
|
|
6601
|
-
};
|
|
6602
6594
|
var useOnUpdate = (callback, dependencies) => {
|
|
6603
6595
|
const hasMounted = (0, import_react51.useRef)(false);
|
|
6604
6596
|
(0, import_react51.useEffect)(() => {
|
|
@@ -6621,7 +6613,7 @@ var InlineEditingControl = createControl(
|
|
|
6621
6613
|
const { value, setValue } = useBoundProp(import_editor_props53.htmlV3PropTypeUtil);
|
|
6622
6614
|
const content = import_editor_props53.stringPropTypeUtil.extract(value?.content ?? null) ?? "";
|
|
6623
6615
|
const debouncedParse = (0, import_react53.useMemo)(
|
|
6624
|
-
() => (0,
|
|
6616
|
+
() => (0, import_utils8.debounce)((html) => {
|
|
6625
6617
|
const parsed = (0, import_editor_props53.parseHtmlChildren)(html);
|
|
6626
6618
|
setValue({
|
|
6627
6619
|
content: parsed.content ? import_editor_props53.stringPropTypeUtil.create(parsed.content) : null,
|
|
@@ -6696,7 +6688,7 @@ var SendToField = () => /* @__PURE__ */ React102.createElement(
|
|
|
6696
6688
|
EmailField,
|
|
6697
6689
|
{
|
|
6698
6690
|
bind: "to",
|
|
6699
|
-
label: (0, import_i18n51.__)("Send
|
|
6691
|
+
label: (0, import_i18n51.__)("Send to", "elementor"),
|
|
6700
6692
|
placeholder: (0, import_i18n51.__)("Where should we send new submissions?", "elementor")
|
|
6701
6693
|
}
|
|
6702
6694
|
);
|
|
@@ -6704,7 +6696,7 @@ var SubjectField = () => /* @__PURE__ */ React102.createElement(
|
|
|
6704
6696
|
EmailField,
|
|
6705
6697
|
{
|
|
6706
6698
|
bind: "subject",
|
|
6707
|
-
label: (0, import_i18n51.__)("Email
|
|
6699
|
+
label: (0, import_i18n51.__)("Email subject", "elementor"),
|
|
6708
6700
|
placeholder: (0, import_i18n51.__)("New form submission", "elementor")
|
|
6709
6701
|
}
|
|
6710
6702
|
);
|
|
@@ -6722,7 +6714,7 @@ var FromEmailField = () => /* @__PURE__ */ React102.createElement(
|
|
|
6722
6714
|
{
|
|
6723
6715
|
bind: "from",
|
|
6724
6716
|
label: (0, import_i18n51.__)("From email", "elementor"),
|
|
6725
|
-
placeholder: (0, import_i18n51.__)("What email
|
|
6717
|
+
placeholder: (0, import_i18n51.__)("What email should appear as the sender?", "elementor")
|
|
6726
6718
|
}
|
|
6727
6719
|
);
|
|
6728
6720
|
var FromNameField = () => /* @__PURE__ */ React102.createElement(
|
|
@@ -6736,7 +6728,7 @@ var FromNameField = () => /* @__PURE__ */ React102.createElement(
|
|
|
6736
6728
|
var ReplyToField = () => /* @__PURE__ */ React102.createElement(EmailField, { bind: "reply-to", label: (0, import_i18n51.__)("Reply-to", "elementor") });
|
|
6737
6729
|
var CcField = () => /* @__PURE__ */ React102.createElement(EmailField, { bind: "cc", label: (0, import_i18n51.__)("Cc", "elementor") });
|
|
6738
6730
|
var BccField = () => /* @__PURE__ */ React102.createElement(EmailField, { bind: "bcc", label: (0, import_i18n51.__)("Bcc", "elementor") });
|
|
6739
|
-
var MetaDataField = () => /* @__PURE__ */ React102.createElement(PropKeyProvider, { bind: "meta-data" }, /* @__PURE__ */ React102.createElement(import_ui88.Stack, { gap: 0.5 }, /* @__PURE__ */ React102.createElement(ControlLabel, null, (0, import_i18n51.__)("
|
|
6731
|
+
var MetaDataField = () => /* @__PURE__ */ React102.createElement(PropKeyProvider, { bind: "meta-data" }, /* @__PURE__ */ React102.createElement(import_ui88.Stack, { gap: 0.5 }, /* @__PURE__ */ React102.createElement(ControlLabel, null, (0, import_i18n51.__)("Metadata", "elementor")), /* @__PURE__ */ React102.createElement(
|
|
6740
6732
|
ChipsControl,
|
|
6741
6733
|
{
|
|
6742
6734
|
options: [
|
|
@@ -6760,29 +6752,654 @@ var SendAsField = () => /* @__PURE__ */ React102.createElement(PropKeyProvider,
|
|
|
6760
6752
|
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))));
|
|
6761
6753
|
var EmailFormActionControl = createControl(() => {
|
|
6762
6754
|
const { value, setValue, ...propContext } = useBoundProp(import_editor_props54.emailPropTypeUtil);
|
|
6763
|
-
return /* @__PURE__ */ React102.createElement(PropProvider, { ...propContext, value, setValue }, /* @__PURE__ */ React102.createElement(import_ui88.Stack, { gap: 2 }, /* @__PURE__ */ React102.createElement(
|
|
6755
|
+
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)));
|
|
6764
6756
|
});
|
|
6765
6757
|
|
|
6766
|
-
// src/
|
|
6767
|
-
var
|
|
6768
|
-
var
|
|
6758
|
+
// src/controls/size-control/unstable-size-control.tsx
|
|
6759
|
+
var React108 = __toESM(require("react"));
|
|
6760
|
+
var import_editor_props56 = require("@elementor/editor-props");
|
|
6761
|
+
|
|
6762
|
+
// src/controls/size-control/size-component.tsx
|
|
6763
|
+
var React107 = __toESM(require("react"));
|
|
6764
|
+
var import_react58 = require("react");
|
|
6765
|
+
var import_editor_responsive4 = require("@elementor/editor-responsive");
|
|
6766
|
+
var import_ui92 = require("@elementor/ui");
|
|
6767
|
+
|
|
6768
|
+
// src/controls/size-control/size-field.tsx
|
|
6769
|
+
var React105 = __toESM(require("react"));
|
|
6769
6770
|
var import_icons34 = require("@elementor/icons");
|
|
6770
6771
|
var import_ui90 = require("@elementor/ui");
|
|
6771
|
-
var import_i18n52 = require("@wordpress/i18n");
|
|
6772
6772
|
|
|
6773
|
-
// src/
|
|
6774
|
-
var
|
|
6773
|
+
// src/controls/size-control/sync/get-units.ts
|
|
6774
|
+
var getLengthUnits = () => {
|
|
6775
|
+
return window.elementor?.config?.size_units?.length ?? [];
|
|
6776
|
+
};
|
|
6777
|
+
var getAngleUnits = () => {
|
|
6778
|
+
return window.elementor?.config?.size_units?.angle ?? [];
|
|
6779
|
+
};
|
|
6780
|
+
var getTimeUnits = () => {
|
|
6781
|
+
return window.elementor?.config?.size_units?.time ?? [];
|
|
6782
|
+
};
|
|
6783
|
+
var getExtendedUnits = () => {
|
|
6784
|
+
return window.elementor?.config?.size_units?.extended_units ?? [];
|
|
6785
|
+
};
|
|
6786
|
+
|
|
6787
|
+
// src/controls/size-control/utils/is-extended-unit.ts
|
|
6788
|
+
var isExtendedUnit = (unit) => {
|
|
6789
|
+
const extendedUnits = getExtendedUnits();
|
|
6790
|
+
return extendedUnits.includes(unit);
|
|
6791
|
+
};
|
|
6792
|
+
|
|
6793
|
+
// src/controls/size-control/hooks/use-size-unit-keyboard.tsx
|
|
6794
|
+
var UNIT_KEY_PATTERN = /^[a-zA-Z%]$/;
|
|
6795
|
+
var useSizeUnitKeyboard = ({ unit, units: units2, onUnitChange }) => {
|
|
6796
|
+
const { appendKey, startsWith } = useTypingBuffer();
|
|
6797
|
+
const onUnitKeyDown = (event) => {
|
|
6798
|
+
if (units2.length === 0) {
|
|
6799
|
+
return;
|
|
6800
|
+
}
|
|
6801
|
+
const { key, altKey, ctrlKey, metaKey } = event;
|
|
6802
|
+
if (altKey || ctrlKey || metaKey) {
|
|
6803
|
+
return;
|
|
6804
|
+
}
|
|
6805
|
+
if (isExtendedUnit(unit) && isNumericValue(key)) {
|
|
6806
|
+
const [defaultUnit] = units2;
|
|
6807
|
+
if (defaultUnit) {
|
|
6808
|
+
onUnitChange(defaultUnit);
|
|
6809
|
+
}
|
|
6810
|
+
return;
|
|
6811
|
+
}
|
|
6812
|
+
if (!UNIT_KEY_PATTERN.test(key)) {
|
|
6813
|
+
return;
|
|
6814
|
+
}
|
|
6815
|
+
event.preventDefault();
|
|
6816
|
+
const updatedBuffer = appendKey(key.toLowerCase());
|
|
6817
|
+
const matchedUnit = units2.find((u) => startsWith(u, updatedBuffer));
|
|
6818
|
+
if (matchedUnit) {
|
|
6819
|
+
onUnitChange(matchedUnit);
|
|
6820
|
+
}
|
|
6821
|
+
};
|
|
6822
|
+
return { onUnitKeyDown };
|
|
6823
|
+
};
|
|
6824
|
+
var isNumericValue = (value) => {
|
|
6825
|
+
if (typeof value === "number") {
|
|
6826
|
+
return !isNaN(value);
|
|
6827
|
+
}
|
|
6828
|
+
if (typeof value === "string") {
|
|
6829
|
+
return value.trim() !== "" && !isNaN(Number(value));
|
|
6830
|
+
}
|
|
6831
|
+
return false;
|
|
6832
|
+
};
|
|
6833
|
+
|
|
6834
|
+
// src/controls/size-control/hooks/use-size-value.ts
|
|
6775
6835
|
var import_react54 = require("react");
|
|
6836
|
+
|
|
6837
|
+
// src/controls/size-control/utils/resolve-size-value.ts
|
|
6838
|
+
var DEFAULT_SIZE2 = "";
|
|
6839
|
+
var EXTENDED_UNITS = {
|
|
6840
|
+
auto: "auto",
|
|
6841
|
+
custom: "custom"
|
|
6842
|
+
};
|
|
6843
|
+
var resolveSizeValue = (value, context) => {
|
|
6844
|
+
if (!value) {
|
|
6845
|
+
return value;
|
|
6846
|
+
}
|
|
6847
|
+
const { units: units2, defaultUnit } = context;
|
|
6848
|
+
const unit = resolveFallbackUnit(value.unit, units2, defaultUnit);
|
|
6849
|
+
if (unit === EXTENDED_UNITS.auto) {
|
|
6850
|
+
return { size: DEFAULT_SIZE2, unit };
|
|
6851
|
+
}
|
|
6852
|
+
if (unit === EXTENDED_UNITS.custom) {
|
|
6853
|
+
return { size: String(value.size ?? DEFAULT_SIZE2), unit };
|
|
6854
|
+
}
|
|
6855
|
+
return {
|
|
6856
|
+
size: sanitizeSize(value.size) ?? DEFAULT_SIZE2,
|
|
6857
|
+
unit
|
|
6858
|
+
};
|
|
6859
|
+
};
|
|
6860
|
+
var resolveSizeOnUnitChange = (size, unit) => {
|
|
6861
|
+
return isExtendedUnit(unit) ? DEFAULT_SIZE2 : size;
|
|
6862
|
+
};
|
|
6863
|
+
var createDefaultSizeValue = (units2, defaultUnit) => {
|
|
6864
|
+
let [unit] = units2;
|
|
6865
|
+
if (defaultUnit !== void 0) {
|
|
6866
|
+
unit = resolveFallbackUnit(defaultUnit, units2);
|
|
6867
|
+
}
|
|
6868
|
+
return { size: DEFAULT_SIZE2, unit };
|
|
6869
|
+
};
|
|
6870
|
+
var resolveFallbackUnit = (unit, units2, defaultUnit) => {
|
|
6871
|
+
if (units2.includes(unit)) {
|
|
6872
|
+
return unit;
|
|
6873
|
+
}
|
|
6874
|
+
if (defaultUnit && units2.includes(defaultUnit)) {
|
|
6875
|
+
return defaultUnit;
|
|
6876
|
+
}
|
|
6877
|
+
return units2[0] ?? "";
|
|
6878
|
+
};
|
|
6879
|
+
var sanitizeSize = (size) => {
|
|
6880
|
+
if (typeof size === "number" && isNaN(size)) {
|
|
6881
|
+
return DEFAULT_SIZE2;
|
|
6882
|
+
}
|
|
6883
|
+
return size;
|
|
6884
|
+
};
|
|
6885
|
+
|
|
6886
|
+
// src/controls/size-control/hooks/use-size-value.ts
|
|
6887
|
+
var useSizeValue = ({
|
|
6888
|
+
value,
|
|
6889
|
+
setValue,
|
|
6890
|
+
units: units2,
|
|
6891
|
+
defaultUnit
|
|
6892
|
+
}) => {
|
|
6893
|
+
const resolvedValue = (0, import_react54.useMemo)(
|
|
6894
|
+
() => resolveSizeValue(value, { units: units2, defaultUnit }),
|
|
6895
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
6896
|
+
[value?.size, value?.unit, defaultUnit]
|
|
6897
|
+
);
|
|
6898
|
+
const [sizeValue, setSizeValue] = useSyncExternalState({
|
|
6899
|
+
external: resolvedValue,
|
|
6900
|
+
setExternal: (newState, options, meta) => {
|
|
6901
|
+
if (newState !== null) {
|
|
6902
|
+
setValue(newState, options, meta);
|
|
6903
|
+
}
|
|
6904
|
+
},
|
|
6905
|
+
persistWhen: (next) => hasChanged(next, resolvedValue),
|
|
6906
|
+
fallback: () => createDefaultSizeValue(units2, defaultUnit)
|
|
6907
|
+
});
|
|
6908
|
+
const setSize = (newSize, isInputValid = true) => {
|
|
6909
|
+
if (isExtendedUnit(sizeValue.unit)) {
|
|
6910
|
+
return;
|
|
6911
|
+
}
|
|
6912
|
+
const trimmed = newSize.trim();
|
|
6913
|
+
const parsed = Number(trimmed);
|
|
6914
|
+
const newState = {
|
|
6915
|
+
...sizeValue,
|
|
6916
|
+
size: trimmed && !isNaN(parsed) ? parsed : ""
|
|
6917
|
+
};
|
|
6918
|
+
setSizeValue(newState, void 0, { validation: () => isInputValid });
|
|
6919
|
+
};
|
|
6920
|
+
const setUnit = (unit) => {
|
|
6921
|
+
setSizeValue({ unit, size: resolveSizeOnUnitChange(sizeValue.size, unit) });
|
|
6922
|
+
};
|
|
6923
|
+
return {
|
|
6924
|
+
size: sizeValue.size,
|
|
6925
|
+
unit: sizeValue.unit,
|
|
6926
|
+
setSize,
|
|
6927
|
+
setUnit
|
|
6928
|
+
};
|
|
6929
|
+
};
|
|
6930
|
+
var hasChanged = (next, current) => {
|
|
6931
|
+
return next?.size !== current?.size || next?.unit !== current?.unit;
|
|
6932
|
+
};
|
|
6933
|
+
|
|
6934
|
+
// src/controls/size-control/ui/size-input.tsx
|
|
6935
|
+
var React103 = __toESM(require("react"));
|
|
6936
|
+
var import_react55 = require("react");
|
|
6937
|
+
var SizeInput2 = (0, import_react55.forwardRef)(
|
|
6938
|
+
({
|
|
6939
|
+
id,
|
|
6940
|
+
type,
|
|
6941
|
+
value,
|
|
6942
|
+
onBlur,
|
|
6943
|
+
onKeyUp,
|
|
6944
|
+
focused,
|
|
6945
|
+
disabled,
|
|
6946
|
+
onChange,
|
|
6947
|
+
onKeyDown,
|
|
6948
|
+
InputProps,
|
|
6949
|
+
inputProps,
|
|
6950
|
+
placeholder
|
|
6951
|
+
}, ref) => {
|
|
6952
|
+
return /* @__PURE__ */ React103.createElement(
|
|
6953
|
+
NumberInput,
|
|
6954
|
+
{
|
|
6955
|
+
id,
|
|
6956
|
+
ref,
|
|
6957
|
+
size: "tiny",
|
|
6958
|
+
fullWidth: true,
|
|
6959
|
+
type,
|
|
6960
|
+
value,
|
|
6961
|
+
placeholder,
|
|
6962
|
+
onKeyUp,
|
|
6963
|
+
focused,
|
|
6964
|
+
disabled,
|
|
6965
|
+
onKeyDown,
|
|
6966
|
+
onInput: onChange,
|
|
6967
|
+
onBlur,
|
|
6968
|
+
InputProps,
|
|
6969
|
+
inputProps,
|
|
6970
|
+
sx: getCursorStyle(InputProps?.readOnly ?? false)
|
|
6971
|
+
}
|
|
6972
|
+
);
|
|
6973
|
+
}
|
|
6974
|
+
);
|
|
6975
|
+
var getCursorStyle = (readOnly) => ({
|
|
6976
|
+
input: { cursor: readOnly ? "default !important" : void 0 }
|
|
6977
|
+
});
|
|
6978
|
+
|
|
6979
|
+
// src/controls/size-control/ui/unit-selector.tsx
|
|
6980
|
+
var React104 = __toESM(require("react"));
|
|
6981
|
+
var import_react56 = require("react");
|
|
6776
6982
|
var import_editor_ui14 = require("@elementor/editor-ui");
|
|
6777
6983
|
var import_ui89 = require("@elementor/ui");
|
|
6984
|
+
var menuItemContentStyles = {
|
|
6985
|
+
display: "flex",
|
|
6986
|
+
flexDirection: "column",
|
|
6987
|
+
justifyContent: "center"
|
|
6988
|
+
};
|
|
6989
|
+
var UnitSelector = ({
|
|
6990
|
+
value,
|
|
6991
|
+
isActive,
|
|
6992
|
+
onSelect,
|
|
6993
|
+
options,
|
|
6994
|
+
disabled,
|
|
6995
|
+
menuItemsAttributes = {},
|
|
6996
|
+
optionLabelOverrides = {}
|
|
6997
|
+
}) => {
|
|
6998
|
+
const popupState = (0, import_ui89.usePopupState)({
|
|
6999
|
+
variant: "popover",
|
|
7000
|
+
popupId: (0, import_react56.useId)()
|
|
7001
|
+
});
|
|
7002
|
+
const handleMenuItemClick = (option) => {
|
|
7003
|
+
onSelect(option);
|
|
7004
|
+
popupState.close();
|
|
7005
|
+
};
|
|
7006
|
+
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(
|
|
7007
|
+
import_editor_ui14.MenuListItem,
|
|
7008
|
+
{
|
|
7009
|
+
key: option,
|
|
7010
|
+
onClick: () => handleMenuItemClick(option),
|
|
7011
|
+
...menuItemsAttributes?.[option],
|
|
7012
|
+
primaryTypographyProps: {
|
|
7013
|
+
variant: "caption",
|
|
7014
|
+
sx: {
|
|
7015
|
+
...menuItemContentStyles,
|
|
7016
|
+
lineHeight: "1"
|
|
7017
|
+
}
|
|
7018
|
+
},
|
|
7019
|
+
menuItemTextProps: {
|
|
7020
|
+
sx: menuItemContentStyles
|
|
7021
|
+
}
|
|
7022
|
+
},
|
|
7023
|
+
optionLabelOverrides[option] ?? option.toUpperCase()
|
|
7024
|
+
))));
|
|
7025
|
+
};
|
|
7026
|
+
var StyledButton2 = (0, import_ui89.styled)(import_ui89.Button, {
|
|
7027
|
+
shouldForwardProp: (prop) => prop !== "isActive"
|
|
7028
|
+
})(({ isActive, theme }) => ({
|
|
7029
|
+
color: isActive ? theme.palette.text.primary : theme.palette.text.tertiary,
|
|
7030
|
+
font: "inherit",
|
|
7031
|
+
minWidth: "initial",
|
|
7032
|
+
textTransform: "uppercase"
|
|
7033
|
+
}));
|
|
7034
|
+
|
|
7035
|
+
// src/controls/size-control/utils/has-size-value.ts
|
|
7036
|
+
var hasSizeValue = (size) => {
|
|
7037
|
+
return Boolean(size) || size === 0;
|
|
7038
|
+
};
|
|
7039
|
+
|
|
7040
|
+
// src/controls/size-control/size-field.tsx
|
|
7041
|
+
var UNIT_DISPLAY_LABELS_OVERRIDES = {
|
|
7042
|
+
custom: /* @__PURE__ */ React105.createElement(import_icons34.MathFunctionIcon, { fontSize: "tiny" })
|
|
7043
|
+
};
|
|
7044
|
+
var SizeField = ({
|
|
7045
|
+
value,
|
|
7046
|
+
focused,
|
|
7047
|
+
disabled,
|
|
7048
|
+
InputProps,
|
|
7049
|
+
defaultUnit,
|
|
7050
|
+
placeholder,
|
|
7051
|
+
onUnitChange,
|
|
7052
|
+
startIcon,
|
|
7053
|
+
ariaLabel,
|
|
7054
|
+
onKeyDown,
|
|
7055
|
+
setValue,
|
|
7056
|
+
onBlur,
|
|
7057
|
+
units: units2,
|
|
7058
|
+
min,
|
|
7059
|
+
unitSelectorProps
|
|
7060
|
+
}) => {
|
|
7061
|
+
const { size, unit, setSize, setUnit } = useSizeValue({ value, setValue, units: units2, defaultUnit });
|
|
7062
|
+
const handleUnitChange = (newUnit) => {
|
|
7063
|
+
setUnit(newUnit);
|
|
7064
|
+
onUnitChange?.(newUnit);
|
|
7065
|
+
};
|
|
7066
|
+
const { onUnitKeyDown } = useSizeUnitKeyboard({ unit, onUnitChange: handleUnitChange, units: units2 });
|
|
7067
|
+
const handleKeyDown = (event) => {
|
|
7068
|
+
onUnitKeyDown(event);
|
|
7069
|
+
onKeyDown?.(event);
|
|
7070
|
+
};
|
|
7071
|
+
const handleChange = (event) => {
|
|
7072
|
+
const newSize = event.target.value;
|
|
7073
|
+
const isInputValid = event.target.validity.valid;
|
|
7074
|
+
setSize(newSize, isInputValid);
|
|
7075
|
+
};
|
|
7076
|
+
const inputType = isExtendedUnit(unit) ? "text" : "number";
|
|
7077
|
+
return /* @__PURE__ */ React105.createElement(
|
|
7078
|
+
SizeInput2,
|
|
7079
|
+
{
|
|
7080
|
+
disabled,
|
|
7081
|
+
focused,
|
|
7082
|
+
type: inputType,
|
|
7083
|
+
value: size,
|
|
7084
|
+
placeholder,
|
|
7085
|
+
onBlur,
|
|
7086
|
+
onKeyDown: handleKeyDown,
|
|
7087
|
+
onChange: handleChange,
|
|
7088
|
+
InputProps: {
|
|
7089
|
+
...InputProps,
|
|
7090
|
+
autoComplete: "off",
|
|
7091
|
+
readOnly: isExtendedUnit(unit),
|
|
7092
|
+
startAdornment: startIcon && /* @__PURE__ */ React105.createElement(import_ui90.InputAdornment, { position: "start", disabled }, startIcon),
|
|
7093
|
+
endAdornment: /* @__PURE__ */ React105.createElement(import_ui90.InputAdornment, { position: "end" }, /* @__PURE__ */ React105.createElement(
|
|
7094
|
+
UnitSelector,
|
|
7095
|
+
{
|
|
7096
|
+
options: units2,
|
|
7097
|
+
value: unit,
|
|
7098
|
+
onSelect: handleUnitChange,
|
|
7099
|
+
isActive: unitSelectorProps?.isActive ?? hasSizeValue(size),
|
|
7100
|
+
...unitSelectorProps,
|
|
7101
|
+
optionLabelOverrides: UNIT_DISPLAY_LABELS_OVERRIDES
|
|
7102
|
+
}
|
|
7103
|
+
))
|
|
7104
|
+
},
|
|
7105
|
+
inputProps: { min, step: "any", "arial-label": ariaLabel }
|
|
7106
|
+
}
|
|
7107
|
+
);
|
|
7108
|
+
};
|
|
7109
|
+
|
|
7110
|
+
// src/controls/size-control/ui/text-field-popover.tsx
|
|
7111
|
+
var React106 = __toESM(require("react"));
|
|
7112
|
+
var import_react57 = require("react");
|
|
7113
|
+
var import_editor_ui15 = require("@elementor/editor-ui");
|
|
7114
|
+
var import_icons35 = require("@elementor/icons");
|
|
7115
|
+
var import_ui91 = require("@elementor/ui");
|
|
7116
|
+
var import_i18n52 = require("@wordpress/i18n");
|
|
7117
|
+
var SIZE10 = "tiny";
|
|
7118
|
+
var TextFieldPopover2 = ({ popupState, anchorRef, value, onChange, onClose }) => {
|
|
7119
|
+
const inputRef = (0, import_react57.useRef)(null);
|
|
7120
|
+
(0, import_react57.useEffect)(() => {
|
|
7121
|
+
if (popupState.isOpen) {
|
|
7122
|
+
requestAnimationFrame(() => {
|
|
7123
|
+
if (inputRef.current) {
|
|
7124
|
+
inputRef.current.focus();
|
|
7125
|
+
}
|
|
7126
|
+
});
|
|
7127
|
+
}
|
|
7128
|
+
}, [popupState.isOpen]);
|
|
7129
|
+
const handleKeyDown = (event) => {
|
|
7130
|
+
if (event.key.toLowerCase() === "enter") {
|
|
7131
|
+
handleClose();
|
|
7132
|
+
}
|
|
7133
|
+
};
|
|
7134
|
+
const handleClose = () => {
|
|
7135
|
+
onClose?.();
|
|
7136
|
+
popupState.close();
|
|
7137
|
+
};
|
|
7138
|
+
return /* @__PURE__ */ React106.createElement(
|
|
7139
|
+
import_ui91.Popover,
|
|
7140
|
+
{
|
|
7141
|
+
disablePortal: true,
|
|
7142
|
+
slotProps: {
|
|
7143
|
+
paper: {
|
|
7144
|
+
sx: {
|
|
7145
|
+
borderRadius: 2,
|
|
7146
|
+
width: anchorRef.current?.offsetWidth + "px"
|
|
7147
|
+
}
|
|
7148
|
+
}
|
|
7149
|
+
},
|
|
7150
|
+
...(0, import_ui91.bindPopover)(popupState),
|
|
7151
|
+
anchorOrigin: { vertical: "bottom", horizontal: "center" },
|
|
7152
|
+
transformOrigin: { vertical: "top", horizontal: "center" },
|
|
7153
|
+
onClose: handleClose
|
|
7154
|
+
},
|
|
7155
|
+
/* @__PURE__ */ React106.createElement(
|
|
7156
|
+
import_editor_ui15.PopoverHeader,
|
|
7157
|
+
{
|
|
7158
|
+
title: (0, import_i18n52.__)("CSS function", "elementor"),
|
|
7159
|
+
onClose: handleClose,
|
|
7160
|
+
icon: /* @__PURE__ */ React106.createElement(import_icons35.MathFunctionIcon, { fontSize: SIZE10 })
|
|
7161
|
+
}
|
|
7162
|
+
),
|
|
7163
|
+
/* @__PURE__ */ React106.createElement(
|
|
7164
|
+
import_ui91.TextField,
|
|
7165
|
+
{
|
|
7166
|
+
value,
|
|
7167
|
+
onChange,
|
|
7168
|
+
onKeyDown: handleKeyDown,
|
|
7169
|
+
size: "tiny",
|
|
7170
|
+
type: "text",
|
|
7171
|
+
fullWidth: true,
|
|
7172
|
+
inputProps: {
|
|
7173
|
+
ref: inputRef
|
|
7174
|
+
},
|
|
7175
|
+
sx: { pt: 0, pr: 1.5, pb: 1.5, pl: 1.5 }
|
|
7176
|
+
}
|
|
7177
|
+
)
|
|
7178
|
+
);
|
|
7179
|
+
};
|
|
7180
|
+
|
|
7181
|
+
// src/controls/size-control/size-component.tsx
|
|
7182
|
+
var SizeComponent = ({
|
|
7183
|
+
anchorRef,
|
|
7184
|
+
isUnitActive,
|
|
7185
|
+
SizeFieldWrapper = React107.Fragment,
|
|
7186
|
+
...sizeFieldProps
|
|
7187
|
+
}) => {
|
|
7188
|
+
const popupState = (0, import_ui92.usePopupState)({ variant: "popover" });
|
|
7189
|
+
const activeBreakpoint = (0, import_editor_responsive4.useActiveBreakpoint)();
|
|
7190
|
+
const isCustomUnit = sizeFieldProps?.value?.unit === EXTENDED_UNITS.custom;
|
|
7191
|
+
const hasCustomUnitOption = sizeFieldProps.units.includes(EXTENDED_UNITS.custom);
|
|
7192
|
+
(0, import_react58.useEffect)(() => {
|
|
7193
|
+
if (popupState && popupState.isOpen) {
|
|
7194
|
+
popupState.close();
|
|
7195
|
+
}
|
|
7196
|
+
}, [activeBreakpoint]);
|
|
7197
|
+
const handleCustomSizeChange = (event) => {
|
|
7198
|
+
sizeFieldProps.setValue({
|
|
7199
|
+
size: event.target.value,
|
|
7200
|
+
unit: EXTENDED_UNITS.custom
|
|
7201
|
+
});
|
|
7202
|
+
};
|
|
7203
|
+
const handleSizeFieldClick = (event) => {
|
|
7204
|
+
if (event.target.closest("input") && isCustomUnit) {
|
|
7205
|
+
popupState.open(anchorRef?.current);
|
|
7206
|
+
}
|
|
7207
|
+
};
|
|
7208
|
+
const handleUnitChange = (unit) => {
|
|
7209
|
+
if (unit === EXTENDED_UNITS.custom && anchorRef?.current) {
|
|
7210
|
+
popupState.open(anchorRef.current);
|
|
7211
|
+
}
|
|
7212
|
+
};
|
|
7213
|
+
const popupAttributes = {
|
|
7214
|
+
"aria-controls": popupState.isOpen ? popupState.popupId : void 0,
|
|
7215
|
+
"aria-haspopup": true
|
|
7216
|
+
};
|
|
7217
|
+
return /* @__PURE__ */ React107.createElement(React107.Fragment, null, /* @__PURE__ */ React107.createElement(SizeFieldWrapper, null, /* @__PURE__ */ React107.createElement(import_ui92.Box, null, /* @__PURE__ */ React107.createElement(
|
|
7218
|
+
SizeField,
|
|
7219
|
+
{
|
|
7220
|
+
focused: popupState.isOpen ? true : void 0,
|
|
7221
|
+
onUnitChange: handleUnitChange,
|
|
7222
|
+
InputProps: {
|
|
7223
|
+
...popupAttributes,
|
|
7224
|
+
onClick: handleSizeFieldClick
|
|
7225
|
+
},
|
|
7226
|
+
unitSelectorProps: {
|
|
7227
|
+
menuItemsAttributes: hasCustomUnitOption ? { custom: popupAttributes } : void 0,
|
|
7228
|
+
isActive: isUnitActive
|
|
7229
|
+
},
|
|
7230
|
+
...sizeFieldProps
|
|
7231
|
+
}
|
|
7232
|
+
))), popupState.isOpen && anchorRef?.current && /* @__PURE__ */ React107.createElement(
|
|
7233
|
+
TextFieldPopover2,
|
|
7234
|
+
{
|
|
7235
|
+
popupState,
|
|
7236
|
+
anchorRef,
|
|
7237
|
+
value: String(sizeFieldProps?.value?.size ?? ""),
|
|
7238
|
+
onChange: handleCustomSizeChange,
|
|
7239
|
+
onClose: () => {
|
|
7240
|
+
}
|
|
7241
|
+
}
|
|
7242
|
+
));
|
|
7243
|
+
};
|
|
7244
|
+
|
|
7245
|
+
// src/controls/size-control/utils/resolve-bound-prop-value.ts
|
|
7246
|
+
var import_editor_props55 = require("@elementor/editor-props");
|
|
7247
|
+
var resolveBoundPropValue = (value, boundPropPlaceholder, propPlaceholder) => {
|
|
7248
|
+
let sizeValue = null;
|
|
7249
|
+
if (validateSizeValue(value)) {
|
|
7250
|
+
sizeValue = value;
|
|
7251
|
+
} else if (validateSizeValue(boundPropPlaceholder)) {
|
|
7252
|
+
sizeValue = { size: "", unit: boundPropPlaceholder?.unit };
|
|
7253
|
+
}
|
|
7254
|
+
return {
|
|
7255
|
+
sizeValue,
|
|
7256
|
+
isUnitHighlighted: shouldHighlightUnit(value),
|
|
7257
|
+
placeholder: resolvePlaceholder(propPlaceholder, boundPropPlaceholder)
|
|
7258
|
+
};
|
|
7259
|
+
};
|
|
7260
|
+
var validateSizeValue = (value) => {
|
|
7261
|
+
if (!value) {
|
|
7262
|
+
return false;
|
|
7263
|
+
}
|
|
7264
|
+
const sizePropValue = import_editor_props55.sizePropTypeUtil.create(value);
|
|
7265
|
+
return import_editor_props55.sizePropTypeUtil.isValid(sizePropValue);
|
|
7266
|
+
};
|
|
7267
|
+
var resolvePlaceholder = (propPlaceholder, boundPropPlaceholder) => {
|
|
7268
|
+
if (propPlaceholder) {
|
|
7269
|
+
return propPlaceholder;
|
|
7270
|
+
}
|
|
7271
|
+
const size = boundPropPlaceholder?.size;
|
|
7272
|
+
if (size === void 0) {
|
|
7273
|
+
return void 0;
|
|
7274
|
+
}
|
|
7275
|
+
if (typeof size === "number") {
|
|
7276
|
+
return size.toString();
|
|
7277
|
+
}
|
|
7278
|
+
return size;
|
|
7279
|
+
};
|
|
7280
|
+
var shouldHighlightUnit = (value) => {
|
|
7281
|
+
if (!value) {
|
|
7282
|
+
return false;
|
|
7283
|
+
}
|
|
7284
|
+
if (value.unit === EXTENDED_UNITS.auto) {
|
|
7285
|
+
return true;
|
|
7286
|
+
}
|
|
7287
|
+
return hasSizeValue(value.size);
|
|
7288
|
+
};
|
|
7289
|
+
|
|
7290
|
+
// src/controls/size-control/utils/settings/get-prop-type-settings.ts
|
|
7291
|
+
var getPropTypeSettings = (propType) => {
|
|
7292
|
+
return propType.settings;
|
|
7293
|
+
};
|
|
7294
|
+
|
|
7295
|
+
// src/controls/size-control/utils/settings/get-default-unit.ts
|
|
7296
|
+
var getDefaultUnit = (propType) => {
|
|
7297
|
+
return getPropTypeSettings(propType)?.default_unit;
|
|
7298
|
+
};
|
|
7299
|
+
|
|
7300
|
+
// src/controls/size-control/utils/settings/get-size-units.ts
|
|
7301
|
+
var getVariantUnits = (variant) => {
|
|
7302
|
+
const map = {
|
|
7303
|
+
length: getLengthUnits,
|
|
7304
|
+
angle: getAngleUnits,
|
|
7305
|
+
time: getTimeUnits
|
|
7306
|
+
};
|
|
7307
|
+
return map[variant]();
|
|
7308
|
+
};
|
|
7309
|
+
var getSettingsUnits = (propType) => {
|
|
7310
|
+
return getPropTypeSettings(propType)?.units;
|
|
7311
|
+
};
|
|
7312
|
+
var getSizeUnits = (propType, variant) => {
|
|
7313
|
+
return getSettingsUnits(propType) ?? getVariantUnits(variant);
|
|
7314
|
+
};
|
|
7315
|
+
|
|
7316
|
+
// src/controls/size-control/utils/should-nullify-value.ts
|
|
7317
|
+
var conditions = [
|
|
7318
|
+
(value) => value?.size === null || value?.size === void 0 || value?.size === "",
|
|
7319
|
+
(value) => value?.unit !== EXTENDED_UNITS.auto,
|
|
7320
|
+
(value) => value?.unit !== EXTENDED_UNITS.custom
|
|
7321
|
+
];
|
|
7322
|
+
var shouldNullifyValue = (value) => {
|
|
7323
|
+
return conditions.every((condition) => condition(value));
|
|
7324
|
+
};
|
|
7325
|
+
|
|
7326
|
+
// src/controls/size-control/unstable-size-control.tsx
|
|
7327
|
+
var UnstableSizeControl = createControl(
|
|
7328
|
+
({ variant = "length", placeholder: propPlaceholder, anchorRef, startIcon, ariaLabel, min }) => {
|
|
7329
|
+
const {
|
|
7330
|
+
value,
|
|
7331
|
+
setValue,
|
|
7332
|
+
propType,
|
|
7333
|
+
placeholder: boundPropPlaceholder,
|
|
7334
|
+
restoreValue
|
|
7335
|
+
} = useBoundProp(import_editor_props56.sizePropTypeUtil);
|
|
7336
|
+
const { sizeValue, isUnitHighlighted, placeholder } = resolveBoundPropValue(
|
|
7337
|
+
value,
|
|
7338
|
+
boundPropPlaceholder,
|
|
7339
|
+
propPlaceholder
|
|
7340
|
+
);
|
|
7341
|
+
const units2 = getSizeUnits(propType, variant);
|
|
7342
|
+
const defaultUnit = getDefaultUnit(propType);
|
|
7343
|
+
const handleBlur = () => {
|
|
7344
|
+
const isRequired = propType.settings.required;
|
|
7345
|
+
if (shouldNullifyValue(value) && !isRequired) {
|
|
7346
|
+
setValue(null);
|
|
7347
|
+
}
|
|
7348
|
+
if (isRequired) {
|
|
7349
|
+
restoreValue();
|
|
7350
|
+
}
|
|
7351
|
+
};
|
|
7352
|
+
const handleChange = (newValue, options, meta) => {
|
|
7353
|
+
setValue(newValue, options, {
|
|
7354
|
+
...meta,
|
|
7355
|
+
validation: () => {
|
|
7356
|
+
if (propType.settings.required) {
|
|
7357
|
+
return newValue.size !== "";
|
|
7358
|
+
}
|
|
7359
|
+
return meta?.validation ? meta.validation(newValue) : true;
|
|
7360
|
+
}
|
|
7361
|
+
});
|
|
7362
|
+
};
|
|
7363
|
+
return /* @__PURE__ */ React108.createElement(
|
|
7364
|
+
SizeComponent,
|
|
7365
|
+
{
|
|
7366
|
+
units: units2,
|
|
7367
|
+
value: sizeValue,
|
|
7368
|
+
anchorRef,
|
|
7369
|
+
placeholder,
|
|
7370
|
+
defaultUnit,
|
|
7371
|
+
isUnitActive: isUnitHighlighted,
|
|
7372
|
+
onBlur: handleBlur,
|
|
7373
|
+
setValue: handleChange,
|
|
7374
|
+
SizeFieldWrapper: ControlActions,
|
|
7375
|
+
startIcon,
|
|
7376
|
+
ariaLabel,
|
|
7377
|
+
min
|
|
7378
|
+
}
|
|
7379
|
+
);
|
|
7380
|
+
}
|
|
7381
|
+
);
|
|
7382
|
+
|
|
7383
|
+
// src/components/promotions/display-conditions-control.tsx
|
|
7384
|
+
var React110 = __toESM(require("react"));
|
|
7385
|
+
var import_react60 = require("react");
|
|
7386
|
+
var import_icons36 = require("@elementor/icons");
|
|
7387
|
+
var import_ui94 = require("@elementor/ui");
|
|
7388
|
+
var import_i18n53 = require("@wordpress/i18n");
|
|
7389
|
+
|
|
7390
|
+
// src/components/promotions/promotion-trigger.tsx
|
|
7391
|
+
var React109 = __toESM(require("react"));
|
|
7392
|
+
var import_react59 = require("react");
|
|
7393
|
+
var import_editor_ui16 = require("@elementor/editor-ui");
|
|
7394
|
+
var import_ui93 = require("@elementor/ui");
|
|
6778
7395
|
function getV4Promotion(key) {
|
|
6779
7396
|
return window.elementor?.config?.v4Promotions?.[key];
|
|
6780
7397
|
}
|
|
6781
|
-
var PromotionTrigger = (0,
|
|
7398
|
+
var PromotionTrigger = (0, import_react59.forwardRef)(
|
|
6782
7399
|
({ promotionKey, children, trackingData }, ref) => {
|
|
6783
|
-
const [isOpen, setIsOpen] = (0,
|
|
7400
|
+
const [isOpen, setIsOpen] = (0, import_react59.useState)(false);
|
|
6784
7401
|
const promotion = getV4Promotion(promotionKey);
|
|
6785
|
-
const toggle = (0,
|
|
7402
|
+
const toggle = (0, import_react59.useCallback)(() => {
|
|
6786
7403
|
setIsOpen((prev) => {
|
|
6787
7404
|
if (!prev) {
|
|
6788
7405
|
trackViewPromotion(trackingData);
|
|
@@ -6790,9 +7407,9 @@ var PromotionTrigger = (0, import_react54.forwardRef)(
|
|
|
6790
7407
|
return !prev;
|
|
6791
7408
|
});
|
|
6792
7409
|
}, [trackingData]);
|
|
6793
|
-
(0,
|
|
6794
|
-
return /* @__PURE__ */
|
|
6795
|
-
|
|
7410
|
+
(0, import_react59.useImperativeHandle)(ref, () => ({ toggle }), [toggle]);
|
|
7411
|
+
return /* @__PURE__ */ React109.createElement(React109.Fragment, null, promotion && /* @__PURE__ */ React109.createElement(
|
|
7412
|
+
import_editor_ui16.PromotionInfotip,
|
|
6796
7413
|
{
|
|
6797
7414
|
title: promotion.title,
|
|
6798
7415
|
content: promotion.content,
|
|
@@ -6805,8 +7422,8 @@ var PromotionTrigger = (0, import_react54.forwardRef)(
|
|
|
6805
7422
|
},
|
|
6806
7423
|
onCtaClick: () => trackUpgradePromotionClick(trackingData)
|
|
6807
7424
|
},
|
|
6808
|
-
/* @__PURE__ */
|
|
6809
|
-
|
|
7425
|
+
/* @__PURE__ */ React109.createElement(
|
|
7426
|
+
import_ui93.Box,
|
|
6810
7427
|
{
|
|
6811
7428
|
onClick: (e) => {
|
|
6812
7429
|
e.stopPropagation();
|
|
@@ -6814,19 +7431,19 @@ var PromotionTrigger = (0, import_react54.forwardRef)(
|
|
|
6814
7431
|
},
|
|
6815
7432
|
sx: { cursor: "pointer", display: "inline-flex" }
|
|
6816
7433
|
},
|
|
6817
|
-
children ?? /* @__PURE__ */
|
|
7434
|
+
children ?? /* @__PURE__ */ React109.createElement(import_editor_ui16.PromotionChip, null)
|
|
6818
7435
|
)
|
|
6819
7436
|
));
|
|
6820
7437
|
}
|
|
6821
7438
|
);
|
|
6822
7439
|
|
|
6823
7440
|
// src/components/promotions/display-conditions-control.tsx
|
|
6824
|
-
var ARIA_LABEL = (0,
|
|
7441
|
+
var ARIA_LABEL = (0, import_i18n53.__)("Display Conditions", "elementor");
|
|
6825
7442
|
var TRACKING_DATA = { target_name: "display_conditions", location_l2: "general" };
|
|
6826
7443
|
var DisplayConditionsControl = createControl(() => {
|
|
6827
|
-
const triggerRef = (0,
|
|
6828
|
-
return /* @__PURE__ */
|
|
6829
|
-
|
|
7444
|
+
const triggerRef = (0, import_react60.useRef)(null);
|
|
7445
|
+
return /* @__PURE__ */ React110.createElement(
|
|
7446
|
+
import_ui94.Stack,
|
|
6830
7447
|
{
|
|
6831
7448
|
direction: "row",
|
|
6832
7449
|
spacing: 2,
|
|
@@ -6835,9 +7452,9 @@ var DisplayConditionsControl = createControl(() => {
|
|
|
6835
7452
|
alignItems: "center"
|
|
6836
7453
|
}
|
|
6837
7454
|
},
|
|
6838
|
-
/* @__PURE__ */
|
|
6839
|
-
/* @__PURE__ */
|
|
6840
|
-
|
|
7455
|
+
/* @__PURE__ */ React110.createElement(PromotionTrigger, { ref: triggerRef, promotionKey: "displayConditions", trackingData: TRACKING_DATA }),
|
|
7456
|
+
/* @__PURE__ */ React110.createElement(import_ui94.Tooltip, { title: ARIA_LABEL, placement: "top" }, /* @__PURE__ */ React110.createElement(
|
|
7457
|
+
import_ui94.IconButton,
|
|
6841
7458
|
{
|
|
6842
7459
|
size: "tiny",
|
|
6843
7460
|
"aria-label": ARIA_LABEL,
|
|
@@ -6849,23 +7466,23 @@ var DisplayConditionsControl = createControl(() => {
|
|
|
6849
7466
|
borderRadius: 1
|
|
6850
7467
|
}
|
|
6851
7468
|
},
|
|
6852
|
-
/* @__PURE__ */
|
|
7469
|
+
/* @__PURE__ */ React110.createElement(import_icons36.SitemapIcon, { fontSize: "tiny", color: "disabled" })
|
|
6853
7470
|
))
|
|
6854
7471
|
);
|
|
6855
7472
|
});
|
|
6856
7473
|
|
|
6857
7474
|
// src/components/promotions/attributes-control.tsx
|
|
6858
|
-
var
|
|
6859
|
-
var
|
|
6860
|
-
var
|
|
6861
|
-
var
|
|
6862
|
-
var
|
|
6863
|
-
var ARIA_LABEL2 = (0,
|
|
7475
|
+
var React111 = __toESM(require("react"));
|
|
7476
|
+
var import_react61 = require("react");
|
|
7477
|
+
var import_icons37 = require("@elementor/icons");
|
|
7478
|
+
var import_ui95 = require("@elementor/ui");
|
|
7479
|
+
var import_i18n54 = require("@wordpress/i18n");
|
|
7480
|
+
var ARIA_LABEL2 = (0, import_i18n54.__)("Attributes", "elementor");
|
|
6864
7481
|
var TRACKING_DATA2 = { target_name: "attributes", location_l2: "general" };
|
|
6865
7482
|
var AttributesControl = createControl(() => {
|
|
6866
|
-
const triggerRef = (0,
|
|
6867
|
-
return /* @__PURE__ */
|
|
6868
|
-
|
|
7483
|
+
const triggerRef = (0, import_react61.useRef)(null);
|
|
7484
|
+
return /* @__PURE__ */ React111.createElement(
|
|
7485
|
+
import_ui95.Stack,
|
|
6869
7486
|
{
|
|
6870
7487
|
direction: "row",
|
|
6871
7488
|
spacing: 2,
|
|
@@ -6874,9 +7491,9 @@ var AttributesControl = createControl(() => {
|
|
|
6874
7491
|
alignItems: "center"
|
|
6875
7492
|
}
|
|
6876
7493
|
},
|
|
6877
|
-
/* @__PURE__ */
|
|
6878
|
-
/* @__PURE__ */
|
|
6879
|
-
|
|
7494
|
+
/* @__PURE__ */ React111.createElement(PromotionTrigger, { ref: triggerRef, promotionKey: "attributes", trackingData: TRACKING_DATA2 }),
|
|
7495
|
+
/* @__PURE__ */ React111.createElement(import_ui95.Tooltip, { title: ARIA_LABEL2, placement: "top" }, /* @__PURE__ */ React111.createElement(
|
|
7496
|
+
import_icons37.PlusIcon,
|
|
6880
7497
|
{
|
|
6881
7498
|
"aria-label": ARIA_LABEL2,
|
|
6882
7499
|
fontSize: "tiny",
|
|
@@ -6889,22 +7506,22 @@ var AttributesControl = createControl(() => {
|
|
|
6889
7506
|
});
|
|
6890
7507
|
|
|
6891
7508
|
// src/components/icon-buttons/clear-icon-button.tsx
|
|
6892
|
-
var
|
|
6893
|
-
var
|
|
6894
|
-
var
|
|
6895
|
-
var CustomIconButton = (0,
|
|
7509
|
+
var React112 = __toESM(require("react"));
|
|
7510
|
+
var import_icons38 = require("@elementor/icons");
|
|
7511
|
+
var import_ui96 = require("@elementor/ui");
|
|
7512
|
+
var CustomIconButton = (0, import_ui96.styled)(import_ui96.IconButton)(({ theme }) => ({
|
|
6896
7513
|
width: theme.spacing(2.5),
|
|
6897
7514
|
height: theme.spacing(2.5)
|
|
6898
7515
|
}));
|
|
6899
|
-
var ClearIconButton = ({ tooltipText, onClick, disabled, size = "tiny" }) => /* @__PURE__ */
|
|
7516
|
+
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 })));
|
|
6900
7517
|
|
|
6901
7518
|
// src/components/repeater/repeater.tsx
|
|
6902
|
-
var
|
|
6903
|
-
var
|
|
6904
|
-
var
|
|
6905
|
-
var
|
|
6906
|
-
var
|
|
6907
|
-
var
|
|
7519
|
+
var React113 = __toESM(require("react"));
|
|
7520
|
+
var import_react62 = require("react");
|
|
7521
|
+
var import_icons39 = require("@elementor/icons");
|
|
7522
|
+
var import_ui97 = require("@elementor/ui");
|
|
7523
|
+
var import_i18n55 = require("@wordpress/i18n");
|
|
7524
|
+
var SIZE11 = "tiny";
|
|
6908
7525
|
var EMPTY_OPEN_ITEM2 = -1;
|
|
6909
7526
|
var Repeater3 = ({
|
|
6910
7527
|
label,
|
|
@@ -6921,7 +7538,7 @@ var Repeater3 = ({
|
|
|
6921
7538
|
openItem: initialOpenItem = EMPTY_OPEN_ITEM2,
|
|
6922
7539
|
isSortable = true
|
|
6923
7540
|
}) => {
|
|
6924
|
-
const [openItem, setOpenItem] = (0,
|
|
7541
|
+
const [openItem, setOpenItem] = (0, import_react62.useState)(initialOpenItem);
|
|
6925
7542
|
const uniqueKeys = items2.map(
|
|
6926
7543
|
(item, index) => isSortable && "getId" in itemSettings ? itemSettings.getId({ item, index }) : String(index)
|
|
6927
7544
|
);
|
|
@@ -6984,41 +7601,41 @@ var Repeater3 = ({
|
|
|
6984
7601
|
};
|
|
6985
7602
|
const isButtonDisabled = disabled || disableAddItemButton;
|
|
6986
7603
|
const shouldShowInfotip = isButtonDisabled && addButtonInfotipContent;
|
|
6987
|
-
const addButton = /* @__PURE__ */
|
|
6988
|
-
|
|
7604
|
+
const addButton = /* @__PURE__ */ React113.createElement(
|
|
7605
|
+
import_ui97.IconButton,
|
|
6989
7606
|
{
|
|
6990
|
-
size:
|
|
7607
|
+
size: SIZE11,
|
|
6991
7608
|
sx: {
|
|
6992
7609
|
ml: "auto"
|
|
6993
7610
|
},
|
|
6994
7611
|
disabled: isButtonDisabled,
|
|
6995
7612
|
onClick: addRepeaterItem,
|
|
6996
|
-
"aria-label": (0,
|
|
7613
|
+
"aria-label": (0, import_i18n55.__)("Add item", "elementor")
|
|
6997
7614
|
},
|
|
6998
|
-
/* @__PURE__ */
|
|
7615
|
+
/* @__PURE__ */ React113.createElement(import_icons39.PlusIcon, { fontSize: SIZE11 })
|
|
6999
7616
|
);
|
|
7000
|
-
return /* @__PURE__ */
|
|
7001
|
-
|
|
7617
|
+
return /* @__PURE__ */ React113.createElement(SectionContent, { gap: 2 }, /* @__PURE__ */ React113.createElement(RepeaterHeader, { label, adornment: ControlAdornments }, shouldShowInfotip ? /* @__PURE__ */ React113.createElement(
|
|
7618
|
+
import_ui97.Infotip,
|
|
7002
7619
|
{
|
|
7003
7620
|
placement: "right",
|
|
7004
7621
|
content: addButtonInfotipContent,
|
|
7005
7622
|
color: "secondary",
|
|
7006
7623
|
slotProps: { popper: { sx: { width: 300 } } }
|
|
7007
7624
|
},
|
|
7008
|
-
/* @__PURE__ */
|
|
7009
|
-
) : addButton), 0 < uniqueKeys.length && /* @__PURE__ */
|
|
7625
|
+
/* @__PURE__ */ React113.createElement(import_ui97.Box, { sx: { ...isButtonDisabled ? { cursor: "not-allowed" } : {} } }, addButton)
|
|
7626
|
+
) : addButton), 0 < uniqueKeys.length && /* @__PURE__ */ React113.createElement(SortableProvider, { value: uniqueKeys, onChange: onChangeOrder }, uniqueKeys.map((key) => {
|
|
7010
7627
|
const index = uniqueKeys.indexOf(key);
|
|
7011
7628
|
const value = items2[index];
|
|
7012
7629
|
if (!value) {
|
|
7013
7630
|
return null;
|
|
7014
7631
|
}
|
|
7015
|
-
return /* @__PURE__ */
|
|
7632
|
+
return /* @__PURE__ */ React113.createElement(SortableItem, { id: key, key: `sortable-${key}`, disabled: !isSortable }, /* @__PURE__ */ React113.createElement(
|
|
7016
7633
|
RepeaterItem,
|
|
7017
7634
|
{
|
|
7018
7635
|
disabled,
|
|
7019
7636
|
propDisabled: value?.disabled,
|
|
7020
|
-
label: /* @__PURE__ */
|
|
7021
|
-
startIcon: /* @__PURE__ */
|
|
7637
|
+
label: /* @__PURE__ */ React113.createElement(RepeaterItemLabelSlot, { value }, /* @__PURE__ */ React113.createElement(itemSettings.Label, { value, index })),
|
|
7638
|
+
startIcon: /* @__PURE__ */ React113.createElement(RepeaterItemIconSlot, { value }, /* @__PURE__ */ React113.createElement(itemSettings.Icon, { value })),
|
|
7022
7639
|
removeItem: () => removeRepeaterItem(index),
|
|
7023
7640
|
duplicateItem: () => duplicateRepeaterItem(index),
|
|
7024
7641
|
toggleDisableItem: () => toggleDisableRepeaterItem(index),
|
|
@@ -7030,7 +7647,7 @@ var Repeater3 = ({
|
|
|
7030
7647
|
actions: itemSettings.actions,
|
|
7031
7648
|
value
|
|
7032
7649
|
},
|
|
7033
|
-
(props) => /* @__PURE__ */
|
|
7650
|
+
(props) => /* @__PURE__ */ React113.createElement(
|
|
7034
7651
|
itemSettings.Content,
|
|
7035
7652
|
{
|
|
7036
7653
|
...props,
|
|
@@ -7060,27 +7677,27 @@ var RepeaterItem = ({
|
|
|
7060
7677
|
value
|
|
7061
7678
|
}) => {
|
|
7062
7679
|
const { popoverState, popoverProps, ref, setRef } = usePopover(openOnMount, onOpen);
|
|
7063
|
-
const duplicateLabel = (0,
|
|
7064
|
-
const toggleLabel = propDisabled ? (0,
|
|
7065
|
-
const removeLabel = (0,
|
|
7066
|
-
return /* @__PURE__ */
|
|
7680
|
+
const duplicateLabel = (0, import_i18n55.__)("Duplicate", "elementor");
|
|
7681
|
+
const toggleLabel = propDisabled ? (0, import_i18n55.__)("Show", "elementor") : (0, import_i18n55.__)("Hide", "elementor");
|
|
7682
|
+
const removeLabel = (0, import_i18n55.__)("Remove", "elementor");
|
|
7683
|
+
return /* @__PURE__ */ React113.createElement(React113.Fragment, null, /* @__PURE__ */ React113.createElement(
|
|
7067
7684
|
RepeaterTag,
|
|
7068
7685
|
{
|
|
7069
7686
|
disabled,
|
|
7070
7687
|
label,
|
|
7071
7688
|
ref: setRef,
|
|
7072
|
-
"aria-label": (0,
|
|
7073
|
-
...(0,
|
|
7689
|
+
"aria-label": (0, import_i18n55.__)("Open item", "elementor"),
|
|
7690
|
+
...(0, import_ui97.bindTrigger)(popoverState),
|
|
7074
7691
|
startIcon,
|
|
7075
|
-
actions: /* @__PURE__ */
|
|
7692
|
+
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 }))))
|
|
7076
7693
|
}
|
|
7077
|
-
), /* @__PURE__ */
|
|
7694
|
+
), /* @__PURE__ */ React113.createElement(RepeaterPopover, { width: ref?.getBoundingClientRect().width, ...popoverProps, anchorEl: ref }, /* @__PURE__ */ React113.createElement(import_ui97.Box, null, children({ anchorEl: ref }))));
|
|
7078
7695
|
};
|
|
7079
7696
|
var usePopover = (openOnMount, onOpen) => {
|
|
7080
|
-
const [ref, setRef] = (0,
|
|
7081
|
-
const popoverState = (0,
|
|
7082
|
-
const popoverProps = (0,
|
|
7083
|
-
(0,
|
|
7697
|
+
const [ref, setRef] = (0, import_react62.useState)(null);
|
|
7698
|
+
const popoverState = (0, import_ui97.usePopupState)({ variant: "popover" });
|
|
7699
|
+
const popoverProps = (0, import_ui97.bindPopover)(popoverState);
|
|
7700
|
+
(0, import_react62.useEffect)(() => {
|
|
7084
7701
|
if (openOnMount && ref) {
|
|
7085
7702
|
popoverState.open(ref);
|
|
7086
7703
|
onOpen?.();
|
|
@@ -7095,20 +7712,20 @@ var usePopover = (openOnMount, onOpen) => {
|
|
|
7095
7712
|
};
|
|
7096
7713
|
|
|
7097
7714
|
// src/components/inline-editor-toolbar.tsx
|
|
7098
|
-
var
|
|
7099
|
-
var
|
|
7715
|
+
var React115 = __toESM(require("react"));
|
|
7716
|
+
var import_react64 = require("react");
|
|
7100
7717
|
var import_editor_elements6 = require("@elementor/editor-elements");
|
|
7101
|
-
var
|
|
7102
|
-
var
|
|
7103
|
-
var
|
|
7104
|
-
var
|
|
7718
|
+
var import_icons41 = require("@elementor/icons");
|
|
7719
|
+
var import_ui99 = require("@elementor/ui");
|
|
7720
|
+
var import_react65 = require("@tiptap/react");
|
|
7721
|
+
var import_i18n57 = require("@wordpress/i18n");
|
|
7105
7722
|
|
|
7106
7723
|
// src/components/url-popover.tsx
|
|
7107
|
-
var
|
|
7108
|
-
var
|
|
7109
|
-
var
|
|
7110
|
-
var
|
|
7111
|
-
var
|
|
7724
|
+
var React114 = __toESM(require("react"));
|
|
7725
|
+
var import_react63 = require("react");
|
|
7726
|
+
var import_icons40 = require("@elementor/icons");
|
|
7727
|
+
var import_ui98 = require("@elementor/ui");
|
|
7728
|
+
var import_i18n56 = require("@wordpress/i18n");
|
|
7112
7729
|
var UrlPopover = ({
|
|
7113
7730
|
popupState,
|
|
7114
7731
|
restoreValue,
|
|
@@ -7118,8 +7735,8 @@ var UrlPopover = ({
|
|
|
7118
7735
|
openInNewTab,
|
|
7119
7736
|
onToggleNewTab
|
|
7120
7737
|
}) => {
|
|
7121
|
-
const inputRef = (0,
|
|
7122
|
-
(0,
|
|
7738
|
+
const inputRef = (0, import_react63.useRef)(null);
|
|
7739
|
+
(0, import_react63.useEffect)(() => {
|
|
7123
7740
|
if (popupState.isOpen) {
|
|
7124
7741
|
requestAnimationFrame(() => inputRef.current?.focus());
|
|
7125
7742
|
}
|
|
@@ -7128,57 +7745,57 @@ var UrlPopover = ({
|
|
|
7128
7745
|
restoreValue();
|
|
7129
7746
|
popupState.close();
|
|
7130
7747
|
};
|
|
7131
|
-
return /* @__PURE__ */
|
|
7132
|
-
|
|
7748
|
+
return /* @__PURE__ */ React114.createElement(
|
|
7749
|
+
import_ui98.Popover,
|
|
7133
7750
|
{
|
|
7134
7751
|
slotProps: {
|
|
7135
7752
|
paper: { sx: { borderRadius: "16px", width: anchorRef.current?.offsetWidth + "px", marginTop: -1 } }
|
|
7136
7753
|
},
|
|
7137
|
-
...(0,
|
|
7754
|
+
...(0, import_ui98.bindPopover)(popupState),
|
|
7138
7755
|
anchorOrigin: { vertical: "top", horizontal: "left" },
|
|
7139
7756
|
transformOrigin: { vertical: "top", horizontal: "left" },
|
|
7140
7757
|
onClose: handleClose
|
|
7141
7758
|
},
|
|
7142
|
-
/* @__PURE__ */
|
|
7143
|
-
|
|
7759
|
+
/* @__PURE__ */ React114.createElement(import_ui98.Stack, { direction: "row", alignItems: "center", gap: 1, sx: { p: 1.5 } }, /* @__PURE__ */ React114.createElement(
|
|
7760
|
+
import_ui98.TextField,
|
|
7144
7761
|
{
|
|
7145
7762
|
value,
|
|
7146
7763
|
onChange,
|
|
7147
7764
|
size: "tiny",
|
|
7148
7765
|
fullWidth: true,
|
|
7149
|
-
placeholder: (0,
|
|
7766
|
+
placeholder: (0, import_i18n56.__)("Type a URL", "elementor"),
|
|
7150
7767
|
inputProps: { ref: inputRef },
|
|
7151
7768
|
color: "secondary",
|
|
7152
7769
|
InputProps: { sx: { borderRadius: "8px" } },
|
|
7153
7770
|
onKeyUp: (event) => event.key === "Enter" && handleClose()
|
|
7154
7771
|
}
|
|
7155
|
-
), /* @__PURE__ */
|
|
7156
|
-
|
|
7772
|
+
), /* @__PURE__ */ React114.createElement(import_ui98.Tooltip, { title: (0, import_i18n56.__)("Open in a new tab", "elementor") }, /* @__PURE__ */ React114.createElement(
|
|
7773
|
+
import_ui98.ToggleButton,
|
|
7157
7774
|
{
|
|
7158
7775
|
size: "tiny",
|
|
7159
7776
|
value: "newTab",
|
|
7160
7777
|
selected: openInNewTab,
|
|
7161
7778
|
onClick: onToggleNewTab,
|
|
7162
|
-
"aria-label": (0,
|
|
7779
|
+
"aria-label": (0, import_i18n56.__)("Open in a new tab", "elementor"),
|
|
7163
7780
|
sx: { borderRadius: "8px" }
|
|
7164
7781
|
},
|
|
7165
|
-
/* @__PURE__ */
|
|
7782
|
+
/* @__PURE__ */ React114.createElement(import_icons40.ExternalLinkIcon, { fontSize: "tiny" })
|
|
7166
7783
|
)))
|
|
7167
7784
|
);
|
|
7168
7785
|
};
|
|
7169
7786
|
|
|
7170
7787
|
// src/components/inline-editor-toolbar.tsx
|
|
7171
7788
|
var InlineEditorToolbar = ({ editor, elementId, sx = {} }) => {
|
|
7172
|
-
const [urlValue, setUrlValue] = (0,
|
|
7173
|
-
const [openInNewTab, setOpenInNewTab] = (0,
|
|
7174
|
-
const toolbarRef = (0,
|
|
7175
|
-
const linkPopupState = (0,
|
|
7789
|
+
const [urlValue, setUrlValue] = (0, import_react64.useState)("");
|
|
7790
|
+
const [openInNewTab, setOpenInNewTab] = (0, import_react64.useState)(false);
|
|
7791
|
+
const toolbarRef = (0, import_react64.useRef)(null);
|
|
7792
|
+
const linkPopupState = (0, import_ui99.usePopupState)({ variant: "popover" });
|
|
7176
7793
|
const isElementClickable = elementId ? checkIfElementIsClickable(elementId) : false;
|
|
7177
|
-
const editorState = (0,
|
|
7794
|
+
const editorState = (0, import_react65.useEditorState)({
|
|
7178
7795
|
editor,
|
|
7179
7796
|
selector: (ctx) => possibleFormats.filter((format) => ctx.editor.isActive(format))
|
|
7180
7797
|
});
|
|
7181
|
-
const formatButtonsList = (0,
|
|
7798
|
+
const formatButtonsList = (0, import_react64.useMemo)(() => {
|
|
7182
7799
|
const buttons = Object.values(formatButtons);
|
|
7183
7800
|
if (isElementClickable) {
|
|
7184
7801
|
return buttons.filter((button) => button.action !== "link");
|
|
@@ -7215,11 +7832,11 @@ var InlineEditorToolbar = ({ editor, elementId, sx = {} }) => {
|
|
|
7215
7832
|
}
|
|
7216
7833
|
linkPopupState.close();
|
|
7217
7834
|
};
|
|
7218
|
-
|
|
7835
|
+
React115.useEffect(() => {
|
|
7219
7836
|
editor?.commands?.focus();
|
|
7220
7837
|
}, [editor]);
|
|
7221
|
-
return /* @__PURE__ */
|
|
7222
|
-
|
|
7838
|
+
return /* @__PURE__ */ React115.createElement(
|
|
7839
|
+
import_ui99.Box,
|
|
7223
7840
|
{
|
|
7224
7841
|
ref: toolbarRef,
|
|
7225
7842
|
sx: {
|
|
@@ -7235,9 +7852,9 @@ var InlineEditorToolbar = ({ editor, elementId, sx = {} }) => {
|
|
|
7235
7852
|
...sx
|
|
7236
7853
|
}
|
|
7237
7854
|
},
|
|
7238
|
-
/* @__PURE__ */
|
|
7239
|
-
/* @__PURE__ */
|
|
7240
|
-
|
|
7855
|
+
/* @__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)),
|
|
7856
|
+
/* @__PURE__ */ React115.createElement(
|
|
7857
|
+
import_ui99.ToggleButtonGroup,
|
|
7241
7858
|
{
|
|
7242
7859
|
value: editorState,
|
|
7243
7860
|
size: "tiny",
|
|
@@ -7245,7 +7862,7 @@ var InlineEditorToolbar = ({ editor, elementId, sx = {} }) => {
|
|
|
7245
7862
|
display: "flex",
|
|
7246
7863
|
gap: 0.5,
|
|
7247
7864
|
border: "none",
|
|
7248
|
-
[`& .${
|
|
7865
|
+
[`& .${import_ui99.toggleButtonGroupClasses.firstButton}, & .${import_ui99.toggleButtonGroupClasses.middleButton}, & .${import_ui99.toggleButtonGroupClasses.lastButton}`]: {
|
|
7249
7866
|
borderRadius: "8px",
|
|
7250
7867
|
border: "none",
|
|
7251
7868
|
marginLeft: 0,
|
|
@@ -7258,8 +7875,8 @@ var InlineEditorToolbar = ({ editor, elementId, sx = {} }) => {
|
|
|
7258
7875
|
}
|
|
7259
7876
|
}
|
|
7260
7877
|
},
|
|
7261
|
-
formatButtonsList.map((button) => /* @__PURE__ */
|
|
7262
|
-
|
|
7878
|
+
formatButtonsList.map((button) => /* @__PURE__ */ React115.createElement(import_ui99.Tooltip, { title: button.label, key: button.action, placement: "top" }, /* @__PURE__ */ React115.createElement(
|
|
7879
|
+
import_ui99.ToggleButton,
|
|
7263
7880
|
{
|
|
7264
7881
|
value: button.action,
|
|
7265
7882
|
"aria-label": button.label,
|
|
@@ -7276,7 +7893,7 @@ var InlineEditorToolbar = ({ editor, elementId, sx = {} }) => {
|
|
|
7276
7893
|
button.icon
|
|
7277
7894
|
)))
|
|
7278
7895
|
),
|
|
7279
|
-
/* @__PURE__ */
|
|
7896
|
+
/* @__PURE__ */ React115.createElement(
|
|
7280
7897
|
UrlPopover,
|
|
7281
7898
|
{
|
|
7282
7899
|
popupState: linkPopupState,
|
|
@@ -7299,64 +7916,64 @@ var checkIfElementIsClickable = (elementId) => {
|
|
|
7299
7916
|
};
|
|
7300
7917
|
var toolbarButtons = {
|
|
7301
7918
|
clear: {
|
|
7302
|
-
label: (0,
|
|
7303
|
-
icon: /* @__PURE__ */
|
|
7919
|
+
label: (0, import_i18n57.__)("Clear", "elementor"),
|
|
7920
|
+
icon: /* @__PURE__ */ React115.createElement(import_icons41.MinusIcon, { fontSize: "tiny" }),
|
|
7304
7921
|
action: "clear",
|
|
7305
7922
|
method: (editor) => {
|
|
7306
7923
|
editor.chain().focus().clearNodes().unsetAllMarks().run();
|
|
7307
7924
|
}
|
|
7308
7925
|
},
|
|
7309
7926
|
bold: {
|
|
7310
|
-
label: (0,
|
|
7311
|
-
icon: /* @__PURE__ */
|
|
7927
|
+
label: (0, import_i18n57.__)("Bold", "elementor"),
|
|
7928
|
+
icon: /* @__PURE__ */ React115.createElement(import_icons41.BoldIcon, { fontSize: "tiny" }),
|
|
7312
7929
|
action: "bold",
|
|
7313
7930
|
method: (editor) => {
|
|
7314
7931
|
editor.chain().focus().toggleBold().run();
|
|
7315
7932
|
}
|
|
7316
7933
|
},
|
|
7317
7934
|
italic: {
|
|
7318
|
-
label: (0,
|
|
7319
|
-
icon: /* @__PURE__ */
|
|
7935
|
+
label: (0, import_i18n57.__)("Italic", "elementor"),
|
|
7936
|
+
icon: /* @__PURE__ */ React115.createElement(import_icons41.ItalicIcon, { fontSize: "tiny" }),
|
|
7320
7937
|
action: "italic",
|
|
7321
7938
|
method: (editor) => {
|
|
7322
7939
|
editor.chain().focus().toggleItalic().run();
|
|
7323
7940
|
}
|
|
7324
7941
|
},
|
|
7325
7942
|
underline: {
|
|
7326
|
-
label: (0,
|
|
7327
|
-
icon: /* @__PURE__ */
|
|
7943
|
+
label: (0, import_i18n57.__)("Underline", "elementor"),
|
|
7944
|
+
icon: /* @__PURE__ */ React115.createElement(import_icons41.UnderlineIcon, { fontSize: "tiny" }),
|
|
7328
7945
|
action: "underline",
|
|
7329
7946
|
method: (editor) => {
|
|
7330
7947
|
editor.chain().focus().toggleUnderline().run();
|
|
7331
7948
|
}
|
|
7332
7949
|
},
|
|
7333
7950
|
strike: {
|
|
7334
|
-
label: (0,
|
|
7335
|
-
icon: /* @__PURE__ */
|
|
7951
|
+
label: (0, import_i18n57.__)("Strikethrough", "elementor"),
|
|
7952
|
+
icon: /* @__PURE__ */ React115.createElement(import_icons41.StrikethroughIcon, { fontSize: "tiny" }),
|
|
7336
7953
|
action: "strike",
|
|
7337
7954
|
method: (editor) => {
|
|
7338
7955
|
editor.chain().focus().toggleStrike().run();
|
|
7339
7956
|
}
|
|
7340
7957
|
},
|
|
7341
7958
|
superscript: {
|
|
7342
|
-
label: (0,
|
|
7343
|
-
icon: /* @__PURE__ */
|
|
7959
|
+
label: (0, import_i18n57.__)("Superscript", "elementor"),
|
|
7960
|
+
icon: /* @__PURE__ */ React115.createElement(import_icons41.SuperscriptIcon, { fontSize: "tiny" }),
|
|
7344
7961
|
action: "superscript",
|
|
7345
7962
|
method: (editor) => {
|
|
7346
7963
|
editor.chain().focus().toggleSuperscript().run();
|
|
7347
7964
|
}
|
|
7348
7965
|
},
|
|
7349
7966
|
subscript: {
|
|
7350
|
-
label: (0,
|
|
7351
|
-
icon: /* @__PURE__ */
|
|
7967
|
+
label: (0, import_i18n57.__)("Subscript", "elementor"),
|
|
7968
|
+
icon: /* @__PURE__ */ React115.createElement(import_icons41.SubscriptIcon, { fontSize: "tiny" }),
|
|
7352
7969
|
action: "subscript",
|
|
7353
7970
|
method: (editor) => {
|
|
7354
7971
|
editor.chain().focus().toggleSubscript().run();
|
|
7355
7972
|
}
|
|
7356
7973
|
},
|
|
7357
7974
|
link: {
|
|
7358
|
-
label: (0,
|
|
7359
|
-
icon: /* @__PURE__ */
|
|
7975
|
+
label: (0, import_i18n57.__)("Link", "elementor"),
|
|
7976
|
+
icon: /* @__PURE__ */ React115.createElement(import_icons41.LinkIcon, { fontSize: "tiny" }),
|
|
7360
7977
|
action: "link",
|
|
7361
7978
|
method: null
|
|
7362
7979
|
}
|
|
@@ -7365,13 +7982,13 @@ var { clear: clearButton, ...formatButtons } = toolbarButtons;
|
|
|
7365
7982
|
var possibleFormats = Object.keys(formatButtons);
|
|
7366
7983
|
|
|
7367
7984
|
// src/components/size/unstable-size-field.tsx
|
|
7368
|
-
var
|
|
7369
|
-
var
|
|
7985
|
+
var React118 = __toESM(require("react"));
|
|
7986
|
+
var import_ui101 = require("@elementor/ui");
|
|
7370
7987
|
|
|
7371
7988
|
// src/hooks/use-size-value.ts
|
|
7372
7989
|
var DEFAULT_UNIT2 = "px";
|
|
7373
|
-
var
|
|
7374
|
-
var
|
|
7990
|
+
var DEFAULT_SIZE3 = "";
|
|
7991
|
+
var useSizeValue2 = (externalValue, onChange, defaultUnit) => {
|
|
7375
7992
|
const [sizeValue, setSizeValue] = useSyncExternalState({
|
|
7376
7993
|
external: externalValue,
|
|
7377
7994
|
setExternal: (newState) => {
|
|
@@ -7380,7 +7997,7 @@ var useSizeValue = (externalValue, onChange, defaultUnit) => {
|
|
|
7380
7997
|
}
|
|
7381
7998
|
},
|
|
7382
7999
|
persistWhen: (newState) => differsFromExternal(newState, externalValue),
|
|
7383
|
-
fallback: () => ({ size:
|
|
8000
|
+
fallback: () => ({ size: DEFAULT_SIZE3, unit: defaultUnit ?? DEFAULT_UNIT2 })
|
|
7384
8001
|
});
|
|
7385
8002
|
const setSize = (value) => {
|
|
7386
8003
|
const newState = {
|
|
@@ -7408,44 +8025,44 @@ var differsFromExternal = (newState, externalState) => {
|
|
|
7408
8025
|
};
|
|
7409
8026
|
|
|
7410
8027
|
// src/components/size/unit-select.tsx
|
|
7411
|
-
var
|
|
7412
|
-
var
|
|
7413
|
-
var
|
|
7414
|
-
var
|
|
7415
|
-
var
|
|
8028
|
+
var React116 = __toESM(require("react"));
|
|
8029
|
+
var import_react66 = require("react");
|
|
8030
|
+
var import_editor_ui17 = require("@elementor/editor-ui");
|
|
8031
|
+
var import_ui100 = require("@elementor/ui");
|
|
8032
|
+
var menuItemContentStyles2 = {
|
|
7416
8033
|
display: "flex",
|
|
7417
8034
|
flexDirection: "column",
|
|
7418
8035
|
justifyContent: "center"
|
|
7419
8036
|
};
|
|
7420
8037
|
var UnitSelect = ({ value, showPrimaryColor, onClick, options }) => {
|
|
7421
|
-
const popupState = (0,
|
|
8038
|
+
const popupState = (0, import_ui100.usePopupState)({
|
|
7422
8039
|
variant: "popover",
|
|
7423
|
-
popupId: (0,
|
|
8040
|
+
popupId: (0, import_react66.useId)()
|
|
7424
8041
|
});
|
|
7425
8042
|
const handleMenuItemClick = (index) => {
|
|
7426
8043
|
onClick(options[index]);
|
|
7427
8044
|
popupState.close();
|
|
7428
8045
|
};
|
|
7429
|
-
return /* @__PURE__ */
|
|
7430
|
-
|
|
8046
|
+
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(
|
|
8047
|
+
import_editor_ui17.MenuListItem,
|
|
7431
8048
|
{
|
|
7432
8049
|
key: option,
|
|
7433
8050
|
onClick: () => handleMenuItemClick(index),
|
|
7434
8051
|
primaryTypographyProps: {
|
|
7435
8052
|
variant: "caption",
|
|
7436
8053
|
sx: {
|
|
7437
|
-
...
|
|
8054
|
+
...menuItemContentStyles2,
|
|
7438
8055
|
lineHeight: "1"
|
|
7439
8056
|
}
|
|
7440
8057
|
},
|
|
7441
8058
|
menuItemTextProps: {
|
|
7442
|
-
sx:
|
|
8059
|
+
sx: menuItemContentStyles2
|
|
7443
8060
|
}
|
|
7444
8061
|
},
|
|
7445
8062
|
option.toUpperCase()
|
|
7446
8063
|
))));
|
|
7447
8064
|
};
|
|
7448
|
-
var
|
|
8065
|
+
var StyledButton3 = (0, import_ui100.styled)(import_ui100.Button, {
|
|
7449
8066
|
shouldForwardProp: (prop) => prop !== "isPrimaryColor"
|
|
7450
8067
|
})(({ isPrimaryColor, theme }) => ({
|
|
7451
8068
|
color: isPrimaryColor ? theme.palette.text.primary : theme.palette.text.tertiary,
|
|
@@ -7455,11 +8072,11 @@ var StyledButton2 = (0, import_ui96.styled)(import_ui96.Button, {
|
|
|
7455
8072
|
}));
|
|
7456
8073
|
|
|
7457
8074
|
// src/components/size/unstable-size-input.tsx
|
|
7458
|
-
var
|
|
7459
|
-
var
|
|
7460
|
-
var UnstableSizeInput = (0,
|
|
8075
|
+
var React117 = __toESM(require("react"));
|
|
8076
|
+
var import_react67 = require("react");
|
|
8077
|
+
var UnstableSizeInput = (0, import_react67.forwardRef)(
|
|
7461
8078
|
({ type, value, onChange, onKeyDown, onKeyUp, InputProps, onBlur, focused, disabled }, ref) => {
|
|
7462
|
-
return /* @__PURE__ */
|
|
8079
|
+
return /* @__PURE__ */ React117.createElement(
|
|
7463
8080
|
NumberInput,
|
|
7464
8081
|
{
|
|
7465
8082
|
ref,
|
|
@@ -7474,12 +8091,12 @@ var UnstableSizeInput = (0, import_react62.forwardRef)(
|
|
|
7474
8091
|
onInput: onChange,
|
|
7475
8092
|
onBlur,
|
|
7476
8093
|
InputProps,
|
|
7477
|
-
sx:
|
|
8094
|
+
sx: getCursorStyle2(InputProps?.readOnly ?? false)
|
|
7478
8095
|
}
|
|
7479
8096
|
);
|
|
7480
8097
|
}
|
|
7481
8098
|
);
|
|
7482
|
-
var
|
|
8099
|
+
var getCursorStyle2 = (readOnly) => ({
|
|
7483
8100
|
input: { cursor: readOnly ? "default !important" : void 0 }
|
|
7484
8101
|
});
|
|
7485
8102
|
|
|
@@ -7493,11 +8110,11 @@ var UnstableSizeField = ({
|
|
|
7493
8110
|
defaultUnit,
|
|
7494
8111
|
startIcon
|
|
7495
8112
|
}) => {
|
|
7496
|
-
const { size, unit, setSize, setUnit } =
|
|
7497
|
-
const
|
|
8113
|
+
const { size, unit, setSize, setUnit } = useSizeValue2(value, onChange, defaultUnit);
|
|
8114
|
+
const shouldHighlightUnit2 = () => {
|
|
7498
8115
|
return hasValue(size);
|
|
7499
8116
|
};
|
|
7500
|
-
return /* @__PURE__ */
|
|
8117
|
+
return /* @__PURE__ */ React118.createElement(
|
|
7501
8118
|
UnstableSizeInput,
|
|
7502
8119
|
{
|
|
7503
8120
|
type: "number",
|
|
@@ -7506,14 +8123,14 @@ var UnstableSizeField = ({
|
|
|
7506
8123
|
onChange: (event) => setSize(event.target.value),
|
|
7507
8124
|
InputProps: {
|
|
7508
8125
|
...InputProps,
|
|
7509
|
-
startAdornment: startIcon && /* @__PURE__ */
|
|
7510
|
-
endAdornment: /* @__PURE__ */
|
|
8126
|
+
startAdornment: startIcon && /* @__PURE__ */ React118.createElement(import_ui101.InputAdornment, { position: "start" }, startIcon),
|
|
8127
|
+
endAdornment: /* @__PURE__ */ React118.createElement(import_ui101.InputAdornment, { position: "end" }, /* @__PURE__ */ React118.createElement(
|
|
7511
8128
|
UnitSelect,
|
|
7512
8129
|
{
|
|
7513
8130
|
options: units2,
|
|
7514
8131
|
value: unit,
|
|
7515
8132
|
onClick: setUnit,
|
|
7516
|
-
showPrimaryColor:
|
|
8133
|
+
showPrimaryColor: shouldHighlightUnit2()
|
|
7517
8134
|
}
|
|
7518
8135
|
))
|
|
7519
8136
|
}
|
|
@@ -7525,7 +8142,7 @@ var hasValue = (value) => {
|
|
|
7525
8142
|
};
|
|
7526
8143
|
|
|
7527
8144
|
// src/hooks/use-font-families.ts
|
|
7528
|
-
var
|
|
8145
|
+
var import_react68 = require("react");
|
|
7529
8146
|
var import_editor_v1_adapters = require("@elementor/editor-v1-adapters");
|
|
7530
8147
|
var getFontControlConfig = () => {
|
|
7531
8148
|
const { controls } = (0, import_editor_v1_adapters.getElementorConfig)();
|
|
@@ -7533,7 +8150,7 @@ var getFontControlConfig = () => {
|
|
|
7533
8150
|
};
|
|
7534
8151
|
var useFontFamilies = () => {
|
|
7535
8152
|
const { groups, options } = getFontControlConfig();
|
|
7536
|
-
return (0,
|
|
8153
|
+
return (0, import_react68.useMemo)(() => {
|
|
7537
8154
|
if (!groups || !options) {
|
|
7538
8155
|
return [];
|
|
7539
8156
|
}
|
|
@@ -7599,6 +8216,7 @@ var useFontFamilies = () => {
|
|
|
7599
8216
|
Repeater,
|
|
7600
8217
|
SelectControl,
|
|
7601
8218
|
SelectControlWrapper,
|
|
8219
|
+
SizeComponent,
|
|
7602
8220
|
SizeControl,
|
|
7603
8221
|
StrokeControl,
|
|
7604
8222
|
SvgMediaControl,
|
|
@@ -7610,6 +8228,7 @@ var useFontFamilies = () => {
|
|
|
7610
8228
|
TransformRepeaterControl,
|
|
7611
8229
|
TransformSettingsControl,
|
|
7612
8230
|
TransitionRepeaterControl,
|
|
8231
|
+
UnstableSizeControl,
|
|
7613
8232
|
UnstableSizeField,
|
|
7614
8233
|
UrlControl,
|
|
7615
8234
|
VideoMediaControl,
|