@elementor/editor-controls 4.1.0-769 → 4.1.0-770
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 +14 -2
- package/dist/index.d.ts +14 -2
- package/dist/index.js +1294 -1109
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +817 -633
- package/dist/index.mjs.map +1 -1
- package/package.json +20 -19
- package/src/controls/email-form-action-control.tsx +45 -18
- package/src/controls/mention-text-area-control.tsx +151 -0
- package/src/hooks/use-form-field-suggestions.ts +55 -0
- package/src/index.ts +1 -0
package/dist/index.mjs
CHANGED
|
@@ -561,15 +561,145 @@ var TextAreaControl = createControl(({ placeholder: propPlaceholder, ariaLabel }
|
|
|
561
561
|
));
|
|
562
562
|
});
|
|
563
563
|
|
|
564
|
+
// src/controls/mention-text-area-control.tsx
|
|
565
|
+
import * as React16 from "react";
|
|
566
|
+
import { useCallback, useState as useState2 } from "react";
|
|
567
|
+
import { Mention } from "primereact/mention";
|
|
568
|
+
import { stringPropTypeUtil as stringPropTypeUtil4 } from "@elementor/editor-props";
|
|
569
|
+
import { styled } from "@elementor/ui";
|
|
570
|
+
var MentionWrapper = styled("div")(({ theme }) => ({
|
|
571
|
+
position: "relative",
|
|
572
|
+
"& .p-mention": {
|
|
573
|
+
width: "100%",
|
|
574
|
+
position: "relative"
|
|
575
|
+
},
|
|
576
|
+
"& textarea": {
|
|
577
|
+
width: "100%",
|
|
578
|
+
boxSizing: "border-box",
|
|
579
|
+
fontFamily: "inherit",
|
|
580
|
+
fontSize: theme.typography.pxToRem(12),
|
|
581
|
+
lineHeight: 1.4375,
|
|
582
|
+
padding: "4px 8px",
|
|
583
|
+
borderRadius: theme.shape.borderRadius,
|
|
584
|
+
border: `1px solid ${theme.palette.divider}`,
|
|
585
|
+
backgroundColor: "transparent",
|
|
586
|
+
color: "inherit",
|
|
587
|
+
resize: "vertical",
|
|
588
|
+
outline: "none",
|
|
589
|
+
transition: "border-color 150ms ease-in-out",
|
|
590
|
+
"&:hover": {
|
|
591
|
+
borderColor: theme.palette.action.active
|
|
592
|
+
},
|
|
593
|
+
"&:focus": {
|
|
594
|
+
borderColor: theme.palette.primary.main,
|
|
595
|
+
borderWidth: 2,
|
|
596
|
+
padding: "3px 7px"
|
|
597
|
+
},
|
|
598
|
+
"&:disabled": {
|
|
599
|
+
opacity: 0.38,
|
|
600
|
+
cursor: "default"
|
|
601
|
+
},
|
|
602
|
+
"&::placeholder": {
|
|
603
|
+
color: "inherit",
|
|
604
|
+
opacity: 0.5
|
|
605
|
+
}
|
|
606
|
+
},
|
|
607
|
+
"& .p-mention-panel": {
|
|
608
|
+
fontFamily: "inherit",
|
|
609
|
+
fontSize: theme.typography.pxToRem(12),
|
|
610
|
+
backgroundColor: theme.palette.background.paper,
|
|
611
|
+
border: `1px solid ${theme.palette.divider}`,
|
|
612
|
+
borderRadius: theme.shape.borderRadius,
|
|
613
|
+
boxShadow: theme.shadows[4],
|
|
614
|
+
maxHeight: "200px",
|
|
615
|
+
overflow: "auto",
|
|
616
|
+
zIndex: theme.zIndex.modal,
|
|
617
|
+
maxWidth: "100%",
|
|
618
|
+
right: 0,
|
|
619
|
+
left: "auto !important"
|
|
620
|
+
},
|
|
621
|
+
"& .p-mention-items": {
|
|
622
|
+
listStyle: "none",
|
|
623
|
+
margin: 0,
|
|
624
|
+
padding: "4px 0"
|
|
625
|
+
},
|
|
626
|
+
"& .p-mention-item": {
|
|
627
|
+
padding: "6px 12px",
|
|
628
|
+
cursor: "pointer",
|
|
629
|
+
color: theme.palette.text.primary,
|
|
630
|
+
"&:hover": {
|
|
631
|
+
backgroundColor: theme.palette.action.hover
|
|
632
|
+
},
|
|
633
|
+
"&.p-highlight": {
|
|
634
|
+
backgroundColor: theme.palette.action.selected
|
|
635
|
+
}
|
|
636
|
+
}
|
|
637
|
+
}));
|
|
638
|
+
var MentionTextAreaControl = createControl(
|
|
639
|
+
({ placeholder, ariaLabel, suggestions: allSuggestions }) => {
|
|
640
|
+
const { value, setValue, disabled } = useBoundProp(stringPropTypeUtil4);
|
|
641
|
+
const [filteredSuggestions, setFilteredSuggestions] = useState2([]);
|
|
642
|
+
const transformMentionsToShortcodes = useCallback(
|
|
643
|
+
(text) => {
|
|
644
|
+
let result = text;
|
|
645
|
+
for (const suggestion of allSuggestions) {
|
|
646
|
+
const mentionPattern = new RegExp(
|
|
647
|
+
`@${suggestion.value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}(?=\\s|$|[^a-zA-Z0-9_-])`,
|
|
648
|
+
"g"
|
|
649
|
+
);
|
|
650
|
+
result = result.replace(mentionPattern, `[${suggestion.value}]`);
|
|
651
|
+
}
|
|
652
|
+
return result;
|
|
653
|
+
},
|
|
654
|
+
[allSuggestions]
|
|
655
|
+
);
|
|
656
|
+
const handleChange = useCallback(
|
|
657
|
+
(e) => {
|
|
658
|
+
const rawValue = e.target.value;
|
|
659
|
+
const transformed = transformMentionsToShortcodes(rawValue);
|
|
660
|
+
setValue(transformed);
|
|
661
|
+
},
|
|
662
|
+
[setValue, transformMentionsToShortcodes]
|
|
663
|
+
);
|
|
664
|
+
const handleSearch = useCallback(
|
|
665
|
+
(event) => {
|
|
666
|
+
const query = event.query.toLowerCase();
|
|
667
|
+
const filtered = allSuggestions.filter(
|
|
668
|
+
(item) => item.label.toLowerCase().includes(query) || item.value.toLowerCase().includes(query)
|
|
669
|
+
);
|
|
670
|
+
setFilteredSuggestions(filtered);
|
|
671
|
+
},
|
|
672
|
+
[allSuggestions]
|
|
673
|
+
);
|
|
674
|
+
return /* @__PURE__ */ React16.createElement(ControlActions, null, /* @__PURE__ */ React16.createElement(MentionWrapper, null, /* @__PURE__ */ React16.createElement(
|
|
675
|
+
Mention,
|
|
676
|
+
{
|
|
677
|
+
value: value ?? "",
|
|
678
|
+
onChange: handleChange,
|
|
679
|
+
suggestions: filteredSuggestions,
|
|
680
|
+
onSearch: handleSearch,
|
|
681
|
+
field: "value",
|
|
682
|
+
trigger: "@",
|
|
683
|
+
rows: 5,
|
|
684
|
+
disabled,
|
|
685
|
+
placeholder,
|
|
686
|
+
itemTemplate: SuggestionItem,
|
|
687
|
+
...ariaLabel ? { "aria-label": ariaLabel } : {}
|
|
688
|
+
}
|
|
689
|
+
)));
|
|
690
|
+
}
|
|
691
|
+
);
|
|
692
|
+
var SuggestionItem = (suggestion) => /* @__PURE__ */ React16.createElement("span", null, suggestion.label);
|
|
693
|
+
|
|
564
694
|
// src/controls/size-control.tsx
|
|
565
|
-
import * as
|
|
566
|
-
import { useCallback, useEffect as useEffect4, useMemo as useMemo2 } from "react";
|
|
695
|
+
import * as React21 from "react";
|
|
696
|
+
import { useCallback as useCallback2, useEffect as useEffect4, useMemo as useMemo2 } from "react";
|
|
567
697
|
import { sizePropTypeUtil as sizePropTypeUtil2 } from "@elementor/editor-props";
|
|
568
698
|
import { useActiveBreakpoint } from "@elementor/editor-responsive";
|
|
569
699
|
import { usePopupState as usePopupState2 } from "@elementor/ui";
|
|
570
700
|
|
|
571
701
|
// src/components/size-control/size-input.tsx
|
|
572
|
-
import * as
|
|
702
|
+
import * as React19 from "react";
|
|
573
703
|
import { MathFunctionIcon } from "@elementor/icons";
|
|
574
704
|
import { Box, InputAdornment as InputAdornment2 } from "@elementor/ui";
|
|
575
705
|
|
|
@@ -624,7 +754,7 @@ function isUnitExtendedOption(unit) {
|
|
|
624
754
|
}
|
|
625
755
|
|
|
626
756
|
// src/components/size-control/text-field-inner-selection.tsx
|
|
627
|
-
import * as
|
|
757
|
+
import * as React18 from "react";
|
|
628
758
|
import { forwardRef as forwardRef2, useId } from "react";
|
|
629
759
|
import { sizePropTypeUtil } from "@elementor/editor-props";
|
|
630
760
|
import { MenuListItem as MenuListItem2 } from "@elementor/editor-ui";
|
|
@@ -634,17 +764,17 @@ import {
|
|
|
634
764
|
Button as Button2,
|
|
635
765
|
InputAdornment,
|
|
636
766
|
Menu,
|
|
637
|
-
styled,
|
|
767
|
+
styled as styled2,
|
|
638
768
|
usePopupState
|
|
639
769
|
} from "@elementor/ui";
|
|
640
770
|
|
|
641
771
|
// src/components/number-input.tsx
|
|
642
|
-
import * as
|
|
643
|
-
import { forwardRef, useState as
|
|
772
|
+
import * as React17 from "react";
|
|
773
|
+
import { forwardRef, useState as useState3 } from "react";
|
|
644
774
|
import { TextField as TextField3 } from "@elementor/ui";
|
|
645
775
|
var RESTRICTED_INPUT_KEYS = ["e", "E", "+"];
|
|
646
776
|
var NumberInput = forwardRef((props, ref) => {
|
|
647
|
-
const [key, setKey] =
|
|
777
|
+
const [key, setKey] = useState3(0);
|
|
648
778
|
const handleKeyDown = (event) => {
|
|
649
779
|
blockRestrictedKeys(event, props.inputProps?.min);
|
|
650
780
|
props.onKeyDown?.(event);
|
|
@@ -656,7 +786,7 @@ var NumberInput = forwardRef((props, ref) => {
|
|
|
656
786
|
setKey((prev) => prev + 1);
|
|
657
787
|
}
|
|
658
788
|
};
|
|
659
|
-
return /* @__PURE__ */
|
|
789
|
+
return /* @__PURE__ */ React17.createElement(TextField3, { ...props, ref, key, onKeyDown: handleKeyDown, onBlur: handleBlur });
|
|
660
790
|
});
|
|
661
791
|
function blockRestrictedKeys(event, min) {
|
|
662
792
|
const restrictedInputKeys = [...RESTRICTED_INPUT_KEYS];
|
|
@@ -688,7 +818,7 @@ var TextFieldInnerSelection = forwardRef2(
|
|
|
688
818
|
const getCursorStyle3 = () => ({
|
|
689
819
|
input: { cursor: InputProps.readOnly ? "default !important" : void 0 }
|
|
690
820
|
});
|
|
691
|
-
return /* @__PURE__ */
|
|
821
|
+
return /* @__PURE__ */ React18.createElement(
|
|
692
822
|
NumberInput,
|
|
693
823
|
{
|
|
694
824
|
ref,
|
|
@@ -733,7 +863,7 @@ var SelectionEndAdornment = ({
|
|
|
733
863
|
flexDirection: "column",
|
|
734
864
|
justifyContent: "center"
|
|
735
865
|
};
|
|
736
|
-
return /* @__PURE__ */
|
|
866
|
+
return /* @__PURE__ */ React18.createElement(InputAdornment, { position: "end" }, /* @__PURE__ */ React18.createElement(
|
|
737
867
|
StyledButton,
|
|
738
868
|
{
|
|
739
869
|
isPrimaryColor: showPrimaryColor,
|
|
@@ -742,7 +872,7 @@ var SelectionEndAdornment = ({
|
|
|
742
872
|
...bindTrigger(popupState)
|
|
743
873
|
},
|
|
744
874
|
placeholder ?? alternativeOptionLabels[value] ?? value
|
|
745
|
-
), /* @__PURE__ */
|
|
875
|
+
), /* @__PURE__ */ React18.createElement(Menu, { MenuListProps: { dense: true }, ...bindMenu(popupState) }, options.map((option, index) => /* @__PURE__ */ React18.createElement(
|
|
746
876
|
MenuListItem2,
|
|
747
877
|
{
|
|
748
878
|
key: option,
|
|
@@ -782,7 +912,7 @@ function useUnitPlaceholder(value) {
|
|
|
782
912
|
showPrimaryColor
|
|
783
913
|
};
|
|
784
914
|
}
|
|
785
|
-
var StyledButton =
|
|
915
|
+
var StyledButton = styled2(Button2, {
|
|
786
916
|
shouldForwardProp: (prop) => prop !== "isPrimaryColor"
|
|
787
917
|
})(({ isPrimaryColor, theme }) => ({
|
|
788
918
|
color: isPrimaryColor ? theme.palette.text.primary : theme.palette.text.tertiary,
|
|
@@ -843,7 +973,7 @@ var SizeInput = ({
|
|
|
843
973
|
custom: popupAttributes
|
|
844
974
|
} : void 0;
|
|
845
975
|
const alternativeOptionLabels = {
|
|
846
|
-
custom: /* @__PURE__ */
|
|
976
|
+
custom: /* @__PURE__ */ React19.createElement(MathFunctionIcon, { fontSize: "tiny" })
|
|
847
977
|
};
|
|
848
978
|
const InputProps = {
|
|
849
979
|
...popupAttributes,
|
|
@@ -851,8 +981,8 @@ var SizeInput = ({
|
|
|
851
981
|
autoComplete: "off",
|
|
852
982
|
onClick,
|
|
853
983
|
onFocus,
|
|
854
|
-
startAdornment: startIcon ? /* @__PURE__ */
|
|
855
|
-
endAdornment: /* @__PURE__ */
|
|
984
|
+
startAdornment: startIcon ? /* @__PURE__ */ React19.createElement(InputAdornment2, { position: "start", disabled }, startIcon) : void 0,
|
|
985
|
+
endAdornment: /* @__PURE__ */ React19.createElement(
|
|
856
986
|
SelectionEndAdornment,
|
|
857
987
|
{
|
|
858
988
|
disabled,
|
|
@@ -864,7 +994,7 @@ var SizeInput = ({
|
|
|
864
994
|
}
|
|
865
995
|
)
|
|
866
996
|
};
|
|
867
|
-
return /* @__PURE__ */
|
|
997
|
+
return /* @__PURE__ */ React19.createElement(ControlActions, null, /* @__PURE__ */ React19.createElement(Box, null, /* @__PURE__ */ React19.createElement(
|
|
868
998
|
TextFieldInnerSelection,
|
|
869
999
|
{
|
|
870
1000
|
disabled,
|
|
@@ -883,7 +1013,7 @@ var SizeInput = ({
|
|
|
883
1013
|
};
|
|
884
1014
|
|
|
885
1015
|
// src/components/text-field-popover.tsx
|
|
886
|
-
import * as
|
|
1016
|
+
import * as React20 from "react";
|
|
887
1017
|
import { useEffect as useEffect2, useRef as useRef2 } from "react";
|
|
888
1018
|
import { PopoverHeader } from "@elementor/editor-ui";
|
|
889
1019
|
import { MathFunctionIcon as MathFunctionIcon2 } from "@elementor/icons";
|
|
@@ -911,7 +1041,7 @@ var TextFieldPopover = (props) => {
|
|
|
911
1041
|
restoreValue();
|
|
912
1042
|
popupState.close();
|
|
913
1043
|
};
|
|
914
|
-
return /* @__PURE__ */
|
|
1044
|
+
return /* @__PURE__ */ React20.createElement(
|
|
915
1045
|
Popover,
|
|
916
1046
|
{
|
|
917
1047
|
disablePortal: true,
|
|
@@ -928,15 +1058,15 @@ var TextFieldPopover = (props) => {
|
|
|
928
1058
|
transformOrigin: { vertical: "top", horizontal: "center" },
|
|
929
1059
|
onClose: handleClose
|
|
930
1060
|
},
|
|
931
|
-
/* @__PURE__ */
|
|
1061
|
+
/* @__PURE__ */ React20.createElement(
|
|
932
1062
|
PopoverHeader,
|
|
933
1063
|
{
|
|
934
1064
|
title: __3("CSS function", "elementor"),
|
|
935
1065
|
onClose: handleClose,
|
|
936
|
-
icon: /* @__PURE__ */
|
|
1066
|
+
icon: /* @__PURE__ */ React20.createElement(MathFunctionIcon2, { fontSize: SIZE })
|
|
937
1067
|
}
|
|
938
1068
|
),
|
|
939
|
-
/* @__PURE__ */
|
|
1069
|
+
/* @__PURE__ */ React20.createElement(
|
|
940
1070
|
TextField4,
|
|
941
1071
|
{
|
|
942
1072
|
value,
|
|
@@ -969,7 +1099,7 @@ function useSizeExtendedOptions(options, disableCustom) {
|
|
|
969
1099
|
}
|
|
970
1100
|
|
|
971
1101
|
// src/hooks/use-sync-external-state.tsx
|
|
972
|
-
import { useEffect as useEffect3, useState as
|
|
1102
|
+
import { useEffect as useEffect3, useState as useState4 } from "react";
|
|
973
1103
|
var useSyncExternalState = ({
|
|
974
1104
|
external,
|
|
975
1105
|
setExternal,
|
|
@@ -988,7 +1118,7 @@ var useSyncExternalState = ({
|
|
|
988
1118
|
}
|
|
989
1119
|
return externalValue;
|
|
990
1120
|
}
|
|
991
|
-
const [internal, setInternal] =
|
|
1121
|
+
const [internal, setInternal] = useState4(toInternal(external, null));
|
|
992
1122
|
useEffect3(() => {
|
|
993
1123
|
setInternal((prevInternal) => toInternal(external, prevInternal));
|
|
994
1124
|
}, [external]);
|
|
@@ -1084,7 +1214,7 @@ var SizeControl = createControl(
|
|
|
1084
1214
|
popupState.open(anchorRef?.current);
|
|
1085
1215
|
}
|
|
1086
1216
|
};
|
|
1087
|
-
const maybeClosePopup =
|
|
1217
|
+
const maybeClosePopup = useCallback2(() => {
|
|
1088
1218
|
if (popupState && popupState.isOpen) {
|
|
1089
1219
|
popupState.close();
|
|
1090
1220
|
}
|
|
@@ -1092,7 +1222,7 @@ var SizeControl = createControl(
|
|
|
1092
1222
|
useEffect4(() => {
|
|
1093
1223
|
maybeClosePopup();
|
|
1094
1224
|
}, [activeBreakpoint]);
|
|
1095
|
-
return /* @__PURE__ */
|
|
1225
|
+
return /* @__PURE__ */ React21.createElement(React21.Fragment, null, /* @__PURE__ */ React21.createElement(
|
|
1096
1226
|
SizeInput,
|
|
1097
1227
|
{
|
|
1098
1228
|
disabled,
|
|
@@ -1110,7 +1240,7 @@ var SizeControl = createControl(
|
|
|
1110
1240
|
id,
|
|
1111
1241
|
ariaLabel
|
|
1112
1242
|
}
|
|
1113
|
-
), anchorRef?.current && popupState.isOpen && /* @__PURE__ */
|
|
1243
|
+
), anchorRef?.current && popupState.isOpen && /* @__PURE__ */ React21.createElement(
|
|
1114
1244
|
TextFieldPopover,
|
|
1115
1245
|
{
|
|
1116
1246
|
popupState,
|
|
@@ -1169,19 +1299,19 @@ function extractValueFromState(state, allowEmpty = false) {
|
|
|
1169
1299
|
}
|
|
1170
1300
|
|
|
1171
1301
|
// src/controls/stroke-control.tsx
|
|
1172
|
-
import * as
|
|
1302
|
+
import * as React24 from "react";
|
|
1173
1303
|
import { forwardRef as forwardRef3, useRef as useRef3 } from "react";
|
|
1174
1304
|
import { strokePropTypeUtil } from "@elementor/editor-props";
|
|
1175
1305
|
import { Grid as Grid2 } from "@elementor/ui";
|
|
1176
1306
|
import { __ as __4 } from "@wordpress/i18n";
|
|
1177
1307
|
|
|
1178
1308
|
// src/components/section-content.tsx
|
|
1179
|
-
import * as
|
|
1309
|
+
import * as React22 from "react";
|
|
1180
1310
|
import { Stack as Stack4 } from "@elementor/ui";
|
|
1181
|
-
var SectionContent = ({ gap = 0.5, sx, children }) => /* @__PURE__ */
|
|
1311
|
+
var SectionContent = ({ gap = 0.5, sx, children }) => /* @__PURE__ */ React22.createElement(Stack4, { gap, sx: { ...sx } }, children);
|
|
1182
1312
|
|
|
1183
1313
|
// src/controls/color-control.tsx
|
|
1184
|
-
import * as
|
|
1314
|
+
import * as React23 from "react";
|
|
1185
1315
|
import { colorPropTypeUtil } from "@elementor/editor-props";
|
|
1186
1316
|
import { UnstableColorField } from "@elementor/ui";
|
|
1187
1317
|
var ColorControl = createControl(
|
|
@@ -1191,7 +1321,7 @@ var ColorControl = createControl(
|
|
|
1191
1321
|
const handleChange = (selectedColor) => {
|
|
1192
1322
|
setValue(selectedColor || null);
|
|
1193
1323
|
};
|
|
1194
|
-
return /* @__PURE__ */
|
|
1324
|
+
return /* @__PURE__ */ React23.createElement(ControlActions, null, /* @__PURE__ */ React23.createElement(
|
|
1195
1325
|
UnstableColorField,
|
|
1196
1326
|
{
|
|
1197
1327
|
id,
|
|
@@ -1234,26 +1364,26 @@ var units = ["px", "em", "rem"];
|
|
|
1234
1364
|
var StrokeControl = createControl(() => {
|
|
1235
1365
|
const propContext = useBoundProp(strokePropTypeUtil);
|
|
1236
1366
|
const rowRef = useRef3(null);
|
|
1237
|
-
return /* @__PURE__ */
|
|
1367
|
+
return /* @__PURE__ */ React24.createElement(PropProvider, { ...propContext }, /* @__PURE__ */ React24.createElement(SectionContent, null, /* @__PURE__ */ React24.createElement(Control, { bind: "width", label: __4("Stroke width", "elementor"), ref: rowRef }, /* @__PURE__ */ React24.createElement(SizeControl, { units, anchorRef: rowRef })), /* @__PURE__ */ React24.createElement(Control, { bind: "color", label: __4("Stroke color", "elementor") }, /* @__PURE__ */ React24.createElement(ColorControl, null))));
|
|
1238
1368
|
});
|
|
1239
|
-
var Control = forwardRef3(({ bind, label, children }, ref) => /* @__PURE__ */
|
|
1369
|
+
var Control = forwardRef3(({ bind, label, children }, ref) => /* @__PURE__ */ React24.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React24.createElement(Grid2, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap", ref }, /* @__PURE__ */ React24.createElement(Grid2, { item: true, xs: 6 }, /* @__PURE__ */ React24.createElement(ControlFormLabel, null, label)), /* @__PURE__ */ React24.createElement(Grid2, { item: true, xs: 6 }, children))));
|
|
1240
1370
|
|
|
1241
1371
|
// src/controls/box-shadow-repeater-control.tsx
|
|
1242
|
-
import * as
|
|
1372
|
+
import * as React40 from "react";
|
|
1243
1373
|
import { useRef as useRef4 } from "react";
|
|
1244
1374
|
import { boxShadowPropTypeUtil, shadowPropTypeUtil } from "@elementor/editor-props";
|
|
1245
|
-
import { FormLabel as FormLabel2, Grid as Grid4, styled as
|
|
1375
|
+
import { FormLabel as FormLabel2, Grid as Grid4, styled as styled4, UnstableColorIndicator } from "@elementor/ui";
|
|
1246
1376
|
import { __ as __11 } from "@wordpress/i18n";
|
|
1247
1377
|
|
|
1248
1378
|
// src/components/control-repeater/actions/tooltip-add-item-action.tsx
|
|
1249
|
-
import * as
|
|
1379
|
+
import * as React26 from "react";
|
|
1250
1380
|
import { PlusIcon } from "@elementor/icons";
|
|
1251
1381
|
import { Box as Box2, IconButton, Infotip } from "@elementor/ui";
|
|
1252
1382
|
import { __ as __5, sprintf } from "@wordpress/i18n";
|
|
1253
1383
|
|
|
1254
1384
|
// src/components/control-repeater/context/repeater-context.tsx
|
|
1255
|
-
import * as
|
|
1256
|
-
import { createContext as createContext7, useContext as useContext6, useEffect as useEffect5, useMemo as useMemo3, useState as
|
|
1385
|
+
import * as React25 from "react";
|
|
1386
|
+
import { createContext as createContext7, useContext as useContext6, useEffect as useEffect5, useMemo as useMemo3, useState as useState5 } from "react";
|
|
1257
1387
|
import { usePopupState as usePopupState3 } from "@elementor/ui";
|
|
1258
1388
|
|
|
1259
1389
|
// src/services/event-bus.ts
|
|
@@ -1321,7 +1451,7 @@ var RepeaterContextProvider = ({
|
|
|
1321
1451
|
setExternal: setRepeaterValues,
|
|
1322
1452
|
persistWhen: () => true
|
|
1323
1453
|
});
|
|
1324
|
-
const [uniqueKeys, setUniqueKeys] =
|
|
1454
|
+
const [uniqueKeys, setUniqueKeys] = useState5(() => {
|
|
1325
1455
|
return items2?.map(() => generateUniqueKey()) ?? [];
|
|
1326
1456
|
});
|
|
1327
1457
|
useEffect5(() => {
|
|
@@ -1347,8 +1477,8 @@ var RepeaterContextProvider = ({
|
|
|
1347
1477
|
const handleSetItems = (newItemsWithKeys) => {
|
|
1348
1478
|
setItems(newItemsWithKeys.map(({ item }) => item));
|
|
1349
1479
|
};
|
|
1350
|
-
const [openItemIndex, setOpenItemIndex] =
|
|
1351
|
-
const [rowRef, setRowRef] =
|
|
1480
|
+
const [openItemIndex, setOpenItemIndex] = useState5(EMPTY_OPEN_ITEM);
|
|
1481
|
+
const [rowRef, setRowRef] = useState5(null);
|
|
1352
1482
|
const isOpen = openItemIndex !== EMPTY_OPEN_ITEM;
|
|
1353
1483
|
const popoverState = usePopupState3({ variant: "popover" });
|
|
1354
1484
|
const addItem = (ev, config) => {
|
|
@@ -1377,7 +1507,7 @@ var RepeaterContextProvider = ({
|
|
|
1377
1507
|
const newItems = [...items2.slice(0, index), updatedItem, ...items2.slice(index + 1)];
|
|
1378
1508
|
setItems(newItems);
|
|
1379
1509
|
};
|
|
1380
|
-
return /* @__PURE__ */
|
|
1510
|
+
return /* @__PURE__ */ React25.createElement(
|
|
1381
1511
|
RepeaterContext.Provider,
|
|
1382
1512
|
{
|
|
1383
1513
|
value: {
|
|
@@ -1414,7 +1544,7 @@ var TooltipAddItemAction = ({
|
|
|
1414
1544
|
}) => {
|
|
1415
1545
|
const { addItem } = useRepeaterContext();
|
|
1416
1546
|
const onClick = (ev) => addItem(ev, { index: newItemIndex });
|
|
1417
|
-
return /* @__PURE__ */
|
|
1547
|
+
return /* @__PURE__ */ React26.createElement(ConditionalToolTip, { content: tooltipContent, enable: enableTooltip }, /* @__PURE__ */ React26.createElement(Box2, { component: "span", sx: { cursor: disabled ? "not-allowed" : "pointer" } }, /* @__PURE__ */ React26.createElement(
|
|
1418
1548
|
IconButton,
|
|
1419
1549
|
{
|
|
1420
1550
|
size: SIZE2,
|
|
@@ -1422,35 +1552,35 @@ var TooltipAddItemAction = ({
|
|
|
1422
1552
|
onClick,
|
|
1423
1553
|
"aria-label": sprintf(__5("Add %s item", "elementor"), ariaLabel?.toLowerCase())
|
|
1424
1554
|
},
|
|
1425
|
-
/* @__PURE__ */
|
|
1555
|
+
/* @__PURE__ */ React26.createElement(PlusIcon, { fontSize: SIZE2 })
|
|
1426
1556
|
)));
|
|
1427
1557
|
};
|
|
1428
1558
|
var ConditionalToolTip = ({
|
|
1429
1559
|
children,
|
|
1430
1560
|
enable,
|
|
1431
1561
|
content
|
|
1432
|
-
}) => enable && content ? /* @__PURE__ */
|
|
1562
|
+
}) => enable && content ? /* @__PURE__ */ React26.createElement(Infotip, { placement: "right", color: "secondary", content }, children) : children;
|
|
1433
1563
|
|
|
1434
1564
|
// src/components/control-repeater/items/items-container.tsx
|
|
1435
|
-
import * as
|
|
1565
|
+
import * as React28 from "react";
|
|
1436
1566
|
|
|
1437
1567
|
// src/components/repeater/sortable.tsx
|
|
1438
|
-
import * as
|
|
1568
|
+
import * as React27 from "react";
|
|
1439
1569
|
import { GripVerticalIcon } from "@elementor/icons";
|
|
1440
1570
|
import {
|
|
1441
1571
|
Divider,
|
|
1442
1572
|
List,
|
|
1443
1573
|
ListItem,
|
|
1444
|
-
styled as
|
|
1574
|
+
styled as styled3,
|
|
1445
1575
|
UnstableSortableItem,
|
|
1446
1576
|
UnstableSortableProvider
|
|
1447
1577
|
} from "@elementor/ui";
|
|
1448
1578
|
import { __ as __6 } from "@wordpress/i18n";
|
|
1449
1579
|
var SortableProvider = (props) => {
|
|
1450
|
-
return /* @__PURE__ */
|
|
1580
|
+
return /* @__PURE__ */ React27.createElement(List, { sx: { p: 0, my: -0.5, mx: 0 } }, /* @__PURE__ */ React27.createElement(UnstableSortableProvider, { restrictAxis: true, disableDragOverlay: false, variant: "static", ...props }));
|
|
1451
1581
|
};
|
|
1452
1582
|
var SortableItem = ({ id, children, disabled }) => {
|
|
1453
|
-
return /* @__PURE__ */
|
|
1583
|
+
return /* @__PURE__ */ React27.createElement(
|
|
1454
1584
|
UnstableSortableItem,
|
|
1455
1585
|
{
|
|
1456
1586
|
id,
|
|
@@ -1463,12 +1593,12 @@ var SortableItem = ({ id, children, disabled }) => {
|
|
|
1463
1593
|
showDropIndication,
|
|
1464
1594
|
dropIndicationStyle
|
|
1465
1595
|
}) => {
|
|
1466
|
-
return /* @__PURE__ */
|
|
1596
|
+
return /* @__PURE__ */ React27.createElement(StyledListItem, { ...itemProps, style: itemStyle, tabIndex: -1 }, !disabled && /* @__PURE__ */ React27.createElement(SortableTrigger, { ...triggerProps, style: triggerStyle }), children, showDropIndication && /* @__PURE__ */ React27.createElement(StyledDivider, { style: dropIndicationStyle }));
|
|
1467
1597
|
}
|
|
1468
1598
|
}
|
|
1469
1599
|
);
|
|
1470
1600
|
};
|
|
1471
|
-
var StyledListItem =
|
|
1601
|
+
var StyledListItem = styled3(ListItem)`
|
|
1472
1602
|
position: relative;
|
|
1473
1603
|
margin-inline: 0px;
|
|
1474
1604
|
padding-inline: 0px;
|
|
@@ -1498,7 +1628,7 @@ var StyledListItem = styled2(ListItem)`
|
|
|
1498
1628
|
}
|
|
1499
1629
|
}
|
|
1500
1630
|
`;
|
|
1501
|
-
var SortableTrigger = (props) => /* @__PURE__ */
|
|
1631
|
+
var SortableTrigger = (props) => /* @__PURE__ */ React27.createElement(
|
|
1502
1632
|
"div",
|
|
1503
1633
|
{
|
|
1504
1634
|
...props,
|
|
@@ -1507,9 +1637,9 @@ var SortableTrigger = (props) => /* @__PURE__ */ React26.createElement(
|
|
|
1507
1637
|
tabIndex: 0,
|
|
1508
1638
|
"aria-label": __6("Drag item", "elementor")
|
|
1509
1639
|
},
|
|
1510
|
-
/* @__PURE__ */
|
|
1640
|
+
/* @__PURE__ */ React27.createElement(GripVerticalIcon, { fontSize: "tiny" })
|
|
1511
1641
|
);
|
|
1512
|
-
var StyledDivider =
|
|
1642
|
+
var StyledDivider = styled3(Divider)`
|
|
1513
1643
|
height: 0px;
|
|
1514
1644
|
border: none;
|
|
1515
1645
|
overflow: visible;
|
|
@@ -1544,14 +1674,14 @@ var ItemsContainer = ({
|
|
|
1544
1674
|
})
|
|
1545
1675
|
);
|
|
1546
1676
|
};
|
|
1547
|
-
return /* @__PURE__ */
|
|
1677
|
+
return /* @__PURE__ */ React28.createElement(React28.Fragment, null, /* @__PURE__ */ React28.createElement(SortableProvider, { value: keys, onChange: onChangeOrder }, keys.map((key, index) => {
|
|
1548
1678
|
const value = items2[index].item;
|
|
1549
|
-
return /* @__PURE__ */
|
|
1679
|
+
return /* @__PURE__ */ React28.createElement(SortableItem, { id: key, key: `sortable-${key}`, disabled: !isSortable }, /* @__PURE__ */ React28.createElement(ItemContext.Provider, { value: { index, value } }, children));
|
|
1550
1680
|
})));
|
|
1551
1681
|
};
|
|
1552
1682
|
|
|
1553
1683
|
// src/components/control-repeater/items/item.tsx
|
|
1554
|
-
import * as
|
|
1684
|
+
import * as React30 from "react";
|
|
1555
1685
|
import { useContext as useContext8 } from "react";
|
|
1556
1686
|
import { bindTrigger as bindTrigger2 } from "@elementor/ui";
|
|
1557
1687
|
import { __ as __7 } from "@wordpress/i18n";
|
|
@@ -1568,11 +1698,11 @@ var useRepeatableControlContext = () => {
|
|
|
1568
1698
|
};
|
|
1569
1699
|
|
|
1570
1700
|
// src/components/repeater/repeater-tag.tsx
|
|
1571
|
-
import * as
|
|
1701
|
+
import * as React29 from "react";
|
|
1572
1702
|
import { forwardRef as forwardRef4 } from "react";
|
|
1573
1703
|
import { UnstableTag } from "@elementor/ui";
|
|
1574
1704
|
var RepeaterTag = forwardRef4((props, ref) => {
|
|
1575
|
-
return /* @__PURE__ */
|
|
1705
|
+
return /* @__PURE__ */ React29.createElement(
|
|
1576
1706
|
UnstableTag,
|
|
1577
1707
|
{
|
|
1578
1708
|
ref,
|
|
@@ -1619,15 +1749,15 @@ var Item = ({ Label: Label3, Icon, actions }) => {
|
|
|
1619
1749
|
setRowRef(ref);
|
|
1620
1750
|
popoverState.setAnchorEl(ref);
|
|
1621
1751
|
};
|
|
1622
|
-
return /* @__PURE__ */
|
|
1752
|
+
return /* @__PURE__ */ React30.createElement(
|
|
1623
1753
|
RepeaterTag,
|
|
1624
1754
|
{
|
|
1625
1755
|
ref: setRef,
|
|
1626
|
-
label: /* @__PURE__ */
|
|
1756
|
+
label: /* @__PURE__ */ React30.createElement(RepeaterItemLabelSlot, { value }, /* @__PURE__ */ React30.createElement(Label3, { value })),
|
|
1627
1757
|
"aria-label": __7("Open item", "elementor"),
|
|
1628
1758
|
...triggerProps,
|
|
1629
1759
|
onClick,
|
|
1630
|
-
startIcon: /* @__PURE__ */
|
|
1760
|
+
startIcon: /* @__PURE__ */ React30.createElement(RepeaterItemIconSlot, { value }, /* @__PURE__ */ React30.createElement(Icon, { value })),
|
|
1631
1761
|
sx: {
|
|
1632
1762
|
minHeight: (theme) => theme.spacing(3.5),
|
|
1633
1763
|
...isItemDisabled2(index) && {
|
|
@@ -1636,20 +1766,20 @@ var Item = ({ Label: Label3, Icon, actions }) => {
|
|
|
1636
1766
|
}
|
|
1637
1767
|
}
|
|
1638
1768
|
},
|
|
1639
|
-
actions: /* @__PURE__ */
|
|
1769
|
+
actions: /* @__PURE__ */ React30.createElement(React30.Fragment, null, /* @__PURE__ */ React30.createElement(RepeaterItemActionsSlot, { index: index ?? -1 }), actions)
|
|
1640
1770
|
}
|
|
1641
1771
|
);
|
|
1642
1772
|
};
|
|
1643
1773
|
|
|
1644
1774
|
// src/components/control-repeater/control-repeater.tsx
|
|
1645
|
-
import * as
|
|
1775
|
+
import * as React31 from "react";
|
|
1646
1776
|
var ControlRepeater = ({
|
|
1647
1777
|
children,
|
|
1648
1778
|
initial,
|
|
1649
1779
|
propTypeUtil,
|
|
1650
1780
|
isItemDisabled: isItemDisabled2
|
|
1651
1781
|
}) => {
|
|
1652
|
-
return /* @__PURE__ */
|
|
1782
|
+
return /* @__PURE__ */ React31.createElement(SectionContent, null, /* @__PURE__ */ React31.createElement(
|
|
1653
1783
|
RepeaterContextProvider,
|
|
1654
1784
|
{
|
|
1655
1785
|
initial,
|
|
@@ -1661,7 +1791,7 @@ var ControlRepeater = ({
|
|
|
1661
1791
|
};
|
|
1662
1792
|
|
|
1663
1793
|
// src/components/control-repeater/actions/disable-item-action.tsx
|
|
1664
|
-
import * as
|
|
1794
|
+
import * as React32 from "react";
|
|
1665
1795
|
import { EyeIcon, EyeOffIcon } from "@elementor/icons";
|
|
1666
1796
|
import { IconButton as IconButton2, Tooltip } from "@elementor/ui";
|
|
1667
1797
|
import { __ as __8 } from "@wordpress/i18n";
|
|
@@ -1681,11 +1811,11 @@ var DisableItemAction = () => {
|
|
|
1681
1811
|
}
|
|
1682
1812
|
updateItem(self, index);
|
|
1683
1813
|
};
|
|
1684
|
-
return /* @__PURE__ */
|
|
1814
|
+
return /* @__PURE__ */ React32.createElement(Tooltip, { title: toggleLabel, placement: "top" }, /* @__PURE__ */ React32.createElement(IconButton2, { size: SIZE3, onClick, "aria-label": toggleLabel }, propDisabled ? /* @__PURE__ */ React32.createElement(EyeOffIcon, { fontSize: SIZE3 }) : /* @__PURE__ */ React32.createElement(EyeIcon, { fontSize: SIZE3 })));
|
|
1685
1815
|
};
|
|
1686
1816
|
|
|
1687
1817
|
// src/components/control-repeater/actions/duplicate-item-action.tsx
|
|
1688
|
-
import * as
|
|
1818
|
+
import * as React33 from "react";
|
|
1689
1819
|
import { CopyIcon } from "@elementor/icons";
|
|
1690
1820
|
import { IconButton as IconButton3, Tooltip as Tooltip2 } from "@elementor/ui";
|
|
1691
1821
|
import { __ as __9 } from "@wordpress/i18n";
|
|
@@ -1701,7 +1831,7 @@ var DuplicateItemAction = () => {
|
|
|
1701
1831
|
const newItem = structuredClone(item);
|
|
1702
1832
|
addItem(ev, { item: newItem, index: index + 1 });
|
|
1703
1833
|
};
|
|
1704
|
-
return /* @__PURE__ */
|
|
1834
|
+
return /* @__PURE__ */ React33.createElement(Tooltip2, { title: duplicateLabel, placement: "top" }, /* @__PURE__ */ React33.createElement(
|
|
1705
1835
|
IconButton3,
|
|
1706
1836
|
{
|
|
1707
1837
|
size: SIZE4,
|
|
@@ -1709,12 +1839,12 @@ var DuplicateItemAction = () => {
|
|
|
1709
1839
|
"aria-label": duplicateLabel,
|
|
1710
1840
|
disabled: isItemDisabled2(index)
|
|
1711
1841
|
},
|
|
1712
|
-
/* @__PURE__ */
|
|
1842
|
+
/* @__PURE__ */ React33.createElement(CopyIcon, { fontSize: SIZE4 })
|
|
1713
1843
|
));
|
|
1714
1844
|
};
|
|
1715
1845
|
|
|
1716
1846
|
// src/components/control-repeater/actions/remove-item-action.tsx
|
|
1717
|
-
import * as
|
|
1847
|
+
import * as React34 from "react";
|
|
1718
1848
|
import { XIcon } from "@elementor/icons";
|
|
1719
1849
|
import { IconButton as IconButton4, Tooltip as Tooltip3 } from "@elementor/ui";
|
|
1720
1850
|
import { __ as __10 } from "@wordpress/i18n";
|
|
@@ -1726,18 +1856,18 @@ var RemoveItemAction = () => {
|
|
|
1726
1856
|
}
|
|
1727
1857
|
const removeLabel = __10("Remove", "elementor");
|
|
1728
1858
|
const onClick = () => removeItem(index);
|
|
1729
|
-
return /* @__PURE__ */
|
|
1859
|
+
return /* @__PURE__ */ React34.createElement(Tooltip3, { title: removeLabel, placement: "top" }, /* @__PURE__ */ React34.createElement(IconButton4, { size: SIZE5, onClick, "aria-label": removeLabel }, /* @__PURE__ */ React34.createElement(XIcon, { fontSize: SIZE5 })));
|
|
1730
1860
|
};
|
|
1731
1861
|
|
|
1732
1862
|
// src/components/control-repeater/items/edit-item-popover.tsx
|
|
1733
|
-
import * as
|
|
1863
|
+
import * as React36 from "react";
|
|
1734
1864
|
import { bindPopover as bindPopover2, Box as Box3 } from "@elementor/ui";
|
|
1735
1865
|
|
|
1736
1866
|
// src/components/repeater/repeater-popover.tsx
|
|
1737
|
-
import * as
|
|
1867
|
+
import * as React35 from "react";
|
|
1738
1868
|
import { Popover as Popover2 } from "@elementor/ui";
|
|
1739
1869
|
var RepeaterPopover = ({ children, width, ...props }) => {
|
|
1740
|
-
return /* @__PURE__ */
|
|
1870
|
+
return /* @__PURE__ */ React35.createElement(
|
|
1741
1871
|
Popover2,
|
|
1742
1872
|
{
|
|
1743
1873
|
disablePortal: true,
|
|
@@ -1765,24 +1895,24 @@ var EditItemPopover = ({ children }) => {
|
|
|
1765
1895
|
popoverState.setAnchorEl(null);
|
|
1766
1896
|
setOpenItemIndex(EMPTY_OPEN_ITEM);
|
|
1767
1897
|
};
|
|
1768
|
-
return /* @__PURE__ */
|
|
1898
|
+
return /* @__PURE__ */ React36.createElement(RepeaterPopover, { width: rowRef.offsetWidth, ...bindPopover2(popoverState), onClose }, /* @__PURE__ */ React36.createElement(PropKeyProvider, { bind: String(openItemIndex) }, /* @__PURE__ */ React36.createElement(Box3, null, children)));
|
|
1769
1899
|
};
|
|
1770
1900
|
|
|
1771
1901
|
// src/components/popover-content.tsx
|
|
1772
|
-
import * as
|
|
1902
|
+
import * as React37 from "react";
|
|
1773
1903
|
import { Stack as Stack5 } from "@elementor/ui";
|
|
1774
|
-
var PopoverContent = ({ gap = 1.5, children, ...props }) => /* @__PURE__ */
|
|
1904
|
+
var PopoverContent = ({ gap = 1.5, children, ...props }) => /* @__PURE__ */ React37.createElement(Stack5, { ...props, gap }, children);
|
|
1775
1905
|
|
|
1776
1906
|
// src/components/popover-grid-container.tsx
|
|
1777
1907
|
import { forwardRef as forwardRef5 } from "react";
|
|
1778
|
-
import * as
|
|
1908
|
+
import * as React38 from "react";
|
|
1779
1909
|
import { Grid as Grid3 } from "@elementor/ui";
|
|
1780
1910
|
var PopoverGridContainer = forwardRef5(
|
|
1781
|
-
({ gap = 1.5, alignItems = "center", flexWrap = "nowrap", children }, ref) => /* @__PURE__ */
|
|
1911
|
+
({ gap = 1.5, alignItems = "center", flexWrap = "nowrap", children }, ref) => /* @__PURE__ */ React38.createElement(Grid3, { container: true, gap, alignItems, flexWrap, ref }, children)
|
|
1782
1912
|
);
|
|
1783
1913
|
|
|
1784
1914
|
// src/components/repeater/repeater-header.tsx
|
|
1785
|
-
import * as
|
|
1915
|
+
import * as React39 from "react";
|
|
1786
1916
|
import { forwardRef as forwardRef6 } from "react";
|
|
1787
1917
|
import { Box as Box4, Stack as Stack6, Typography as Typography2 } from "@elementor/ui";
|
|
1788
1918
|
var RepeaterHeader = forwardRef6(
|
|
@@ -1791,7 +1921,7 @@ var RepeaterHeader = forwardRef6(
|
|
|
1791
1921
|
children,
|
|
1792
1922
|
adornment: Adornment = ControlAdornments
|
|
1793
1923
|
}, ref) => {
|
|
1794
|
-
return /* @__PURE__ */
|
|
1924
|
+
return /* @__PURE__ */ React39.createElement(
|
|
1795
1925
|
Stack6,
|
|
1796
1926
|
{
|
|
1797
1927
|
direction: "row",
|
|
@@ -1800,7 +1930,7 @@ var RepeaterHeader = forwardRef6(
|
|
|
1800
1930
|
sx: { marginInlineEnd: -0.75, py: 0.25 },
|
|
1801
1931
|
ref
|
|
1802
1932
|
},
|
|
1803
|
-
/* @__PURE__ */
|
|
1933
|
+
/* @__PURE__ */ React39.createElement(Box4, { display: "flex", alignItems: "center", gap: 1, sx: { flexGrow: 1 } }, /* @__PURE__ */ React39.createElement(Typography2, { component: "label", variant: "caption", color: "text.secondary", sx: { lineHeight: 1 } }, label), /* @__PURE__ */ React39.createElement(Adornment, null)),
|
|
1804
1934
|
children
|
|
1805
1935
|
);
|
|
1806
1936
|
}
|
|
@@ -1809,26 +1939,26 @@ var RepeaterHeader = forwardRef6(
|
|
|
1809
1939
|
// src/controls/box-shadow-repeater-control.tsx
|
|
1810
1940
|
var BoxShadowRepeaterControl = createControl(() => {
|
|
1811
1941
|
const { propType, value, setValue, disabled } = useBoundProp(boxShadowPropTypeUtil);
|
|
1812
|
-
return /* @__PURE__ */
|
|
1942
|
+
return /* @__PURE__ */ React40.createElement(PropProvider, { propType, value, setValue, isDisabled: () => disabled }, /* @__PURE__ */ React40.createElement(ControlRepeater, { initial: initialShadow, propTypeUtil: boxShadowPropTypeUtil }, /* @__PURE__ */ React40.createElement(RepeaterHeader, { label: __11("Box shadow", "elementor") }, /* @__PURE__ */ React40.createElement(TooltipAddItemAction, { newItemIndex: 0, disabled, ariaLabel: "Box shadow" })), /* @__PURE__ */ React40.createElement(ItemsContainer, null, /* @__PURE__ */ React40.createElement(
|
|
1813
1943
|
Item,
|
|
1814
1944
|
{
|
|
1815
1945
|
Icon: ItemIcon,
|
|
1816
1946
|
Label: ItemLabel,
|
|
1817
|
-
actions: /* @__PURE__ */
|
|
1947
|
+
actions: /* @__PURE__ */ React40.createElement(React40.Fragment, null, /* @__PURE__ */ React40.createElement(DuplicateItemAction, null), /* @__PURE__ */ React40.createElement(DisableItemAction, null), /* @__PURE__ */ React40.createElement(RemoveItemAction, null))
|
|
1818
1948
|
}
|
|
1819
|
-
)), /* @__PURE__ */
|
|
1949
|
+
)), /* @__PURE__ */ React40.createElement(EditItemPopover, null, /* @__PURE__ */ React40.createElement(Content, null))));
|
|
1820
1950
|
});
|
|
1821
|
-
var StyledUnstableColorIndicator =
|
|
1951
|
+
var StyledUnstableColorIndicator = styled4(UnstableColorIndicator)(({ theme }) => ({
|
|
1822
1952
|
height: "1rem",
|
|
1823
1953
|
width: "1rem",
|
|
1824
1954
|
borderRadius: `${theme.shape.borderRadius / 2}px`
|
|
1825
1955
|
}));
|
|
1826
|
-
var ItemIcon = ({ value }) => /* @__PURE__ */
|
|
1956
|
+
var ItemIcon = ({ value }) => /* @__PURE__ */ React40.createElement(StyledUnstableColorIndicator, { size: "inherit", component: "span", value: value.value.color?.value });
|
|
1827
1957
|
var Content = () => {
|
|
1828
1958
|
const context = useBoundProp(shadowPropTypeUtil);
|
|
1829
1959
|
const rowRef = [useRef4(null), useRef4(null)];
|
|
1830
1960
|
const { rowRef: anchorEl } = useRepeaterContext();
|
|
1831
|
-
return /* @__PURE__ */
|
|
1961
|
+
return /* @__PURE__ */ React40.createElement(PropProvider, { ...context }, /* @__PURE__ */ React40.createElement(PopoverContent, { p: 1.5 }, /* @__PURE__ */ React40.createElement(PopoverGridContainer, null, /* @__PURE__ */ React40.createElement(Control2, { bind: "color", label: __11("Color", "elementor") }, /* @__PURE__ */ React40.createElement(ColorControl, { anchorEl })), /* @__PURE__ */ React40.createElement(Control2, { bind: "position", label: __11("Position", "elementor"), sx: { overflow: "hidden" } }, /* @__PURE__ */ React40.createElement(
|
|
1832
1962
|
SelectControl,
|
|
1833
1963
|
{
|
|
1834
1964
|
options: [
|
|
@@ -1836,14 +1966,14 @@ var Content = () => {
|
|
|
1836
1966
|
{ label: __11("Outset", "elementor"), value: null }
|
|
1837
1967
|
]
|
|
1838
1968
|
}
|
|
1839
|
-
))), /* @__PURE__ */
|
|
1969
|
+
))), /* @__PURE__ */ React40.createElement(PopoverGridContainer, { ref: rowRef[0] }, /* @__PURE__ */ React40.createElement(Control2, { bind: "hOffset", label: __11("Horizontal", "elementor") }, /* @__PURE__ */ React40.createElement(SizeControl, { anchorRef: rowRef[0] })), /* @__PURE__ */ React40.createElement(Control2, { bind: "vOffset", label: __11("Vertical", "elementor") }, /* @__PURE__ */ React40.createElement(SizeControl, { anchorRef: rowRef[0] }))), /* @__PURE__ */ React40.createElement(PopoverGridContainer, { ref: rowRef[1] }, /* @__PURE__ */ React40.createElement(Control2, { bind: "blur", label: __11("Blur", "elementor") }, /* @__PURE__ */ React40.createElement(SizeControl, { anchorRef: rowRef[1] })), /* @__PURE__ */ React40.createElement(Control2, { bind: "spread", label: __11("Spread", "elementor") }, /* @__PURE__ */ React40.createElement(SizeControl, { anchorRef: rowRef[1] })))));
|
|
1840
1970
|
};
|
|
1841
1971
|
var Control2 = ({
|
|
1842
1972
|
label,
|
|
1843
1973
|
bind,
|
|
1844
1974
|
children,
|
|
1845
1975
|
sx
|
|
1846
|
-
}) => /* @__PURE__ */
|
|
1976
|
+
}) => /* @__PURE__ */ React40.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React40.createElement(Grid4, { item: true, xs: 6, sx }, /* @__PURE__ */ React40.createElement(Grid4, { container: true, gap: 0.75, alignItems: "center" }, /* @__PURE__ */ React40.createElement(Grid4, { item: true, xs: 12 }, /* @__PURE__ */ React40.createElement(FormLabel2, { size: "tiny" }, label)), /* @__PURE__ */ React40.createElement(Grid4, { item: true, xs: 12 }, children))));
|
|
1847
1977
|
var ItemLabel = ({ value }) => {
|
|
1848
1978
|
const { position, hOffset, vOffset, blur, spread } = value.value;
|
|
1849
1979
|
const { size: blurSize = "", unit: blurUnit = "" } = blur?.value || {};
|
|
@@ -1862,7 +1992,7 @@ var ItemLabel = ({ value }) => {
|
|
|
1862
1992
|
}
|
|
1863
1993
|
return !size ? CUSTOM_SIZE_LABEL : size;
|
|
1864
1994
|
}).join(" ");
|
|
1865
|
-
return /* @__PURE__ */
|
|
1995
|
+
return /* @__PURE__ */ React40.createElement("span", { style: { textTransform: "capitalize" } }, positionLabel, ": ", sizes);
|
|
1866
1996
|
};
|
|
1867
1997
|
var initialShadow = {
|
|
1868
1998
|
$$type: "shadow",
|
|
@@ -1892,7 +2022,7 @@ var initialShadow = {
|
|
|
1892
2022
|
};
|
|
1893
2023
|
|
|
1894
2024
|
// src/controls/filter-control/filter-repeater-control.tsx
|
|
1895
|
-
import * as
|
|
2025
|
+
import * as React49 from "react";
|
|
1896
2026
|
import {
|
|
1897
2027
|
backdropFilterPropTypeUtil,
|
|
1898
2028
|
filterPropTypeUtil
|
|
@@ -1900,7 +2030,7 @@ import {
|
|
|
1900
2030
|
import { __ as __16 } from "@wordpress/i18n";
|
|
1901
2031
|
|
|
1902
2032
|
// src/controls/filter-control/context/filter-config-context.tsx
|
|
1903
|
-
import * as
|
|
2033
|
+
import * as React41 from "react";
|
|
1904
2034
|
import { createContext as createContext9, useContext as useContext9, useMemo as useMemo4 } from "react";
|
|
1905
2035
|
import { cssFilterFunctionPropUtil } from "@elementor/editor-props";
|
|
1906
2036
|
|
|
@@ -2016,7 +2146,7 @@ function FilterConfigProvider({ children }) {
|
|
|
2016
2146
|
getInitialValue: () => config.blur.defaultValue
|
|
2017
2147
|
};
|
|
2018
2148
|
}, [propContext.propType]);
|
|
2019
|
-
return /* @__PURE__ */
|
|
2149
|
+
return /* @__PURE__ */ React41.createElement(FilterConfigContext.Provider, { value: contextValue }, children);
|
|
2020
2150
|
}
|
|
2021
2151
|
function useFilterConfig() {
|
|
2022
2152
|
const context = useContext9(FilterConfigContext);
|
|
@@ -2027,7 +2157,7 @@ function useFilterConfig() {
|
|
|
2027
2157
|
}
|
|
2028
2158
|
|
|
2029
2159
|
// src/controls/filter-control/filter-content.tsx
|
|
2030
|
-
import * as
|
|
2160
|
+
import * as React44 from "react";
|
|
2031
2161
|
import {
|
|
2032
2162
|
cssFilterFunctionPropUtil as cssFilterFunctionPropUtil2
|
|
2033
2163
|
} from "@elementor/editor-props";
|
|
@@ -2035,7 +2165,7 @@ import { Grid as Grid7 } from "@elementor/ui";
|
|
|
2035
2165
|
import { __ as __15 } from "@wordpress/i18n";
|
|
2036
2166
|
|
|
2037
2167
|
// src/controls/filter-control/drop-shadow/drop-shadow-item-content.tsx
|
|
2038
|
-
import * as
|
|
2168
|
+
import * as React42 from "react";
|
|
2039
2169
|
import { useRef as useRef5 } from "react";
|
|
2040
2170
|
import { dropShadowFilterPropTypeUtil } from "@elementor/editor-props";
|
|
2041
2171
|
import { Grid as Grid5 } from "@elementor/ui";
|
|
@@ -2065,7 +2195,7 @@ var items = [
|
|
|
2065
2195
|
var DropShadowItemContent = ({ anchorEl }) => {
|
|
2066
2196
|
const context = useBoundProp(dropShadowFilterPropTypeUtil);
|
|
2067
2197
|
const rowRefs = [useRef5(null), useRef5(null)];
|
|
2068
|
-
return /* @__PURE__ */
|
|
2198
|
+
return /* @__PURE__ */ React42.createElement(PropProvider, { ...context }, items.map((item) => /* @__PURE__ */ React42.createElement(PopoverGridContainer, { key: item.bind, ref: rowRefs[item.rowIndex] ?? null }, /* @__PURE__ */ React42.createElement(PropKeyProvider, { bind: item.bind }, /* @__PURE__ */ React42.createElement(Grid5, { item: true, xs: 6 }, /* @__PURE__ */ React42.createElement(ControlFormLabel, null, item.label)), /* @__PURE__ */ React42.createElement(Grid5, { item: true, xs: 6 }, item.bind === "color" ? /* @__PURE__ */ React42.createElement(ColorControl, { anchorEl }) : /* @__PURE__ */ React42.createElement(
|
|
2069
2199
|
SizeControl,
|
|
2070
2200
|
{
|
|
2071
2201
|
anchorRef: rowRefs[item.rowIndex],
|
|
@@ -2078,7 +2208,7 @@ var DropShadowItemContent = ({ anchorEl }) => {
|
|
|
2078
2208
|
|
|
2079
2209
|
// src/controls/filter-control/single-size/single-size-item-content.tsx
|
|
2080
2210
|
import { useRef as useRef6 } from "react";
|
|
2081
|
-
import * as
|
|
2211
|
+
import * as React43 from "react";
|
|
2082
2212
|
import {
|
|
2083
2213
|
blurFilterPropTypeUtil,
|
|
2084
2214
|
colorToneFilterPropTypeUtil,
|
|
@@ -2097,7 +2227,7 @@ var SingleSizeItemContent = ({ filterFunc }) => {
|
|
|
2097
2227
|
const { getFilterFunctionConfig } = useFilterConfig();
|
|
2098
2228
|
const { valueName, filterFunctionGroup } = getFilterFunctionConfig(filterFunc);
|
|
2099
2229
|
const context = useBoundProp(propTypeMap[filterFunctionGroup]);
|
|
2100
|
-
return /* @__PURE__ */
|
|
2230
|
+
return /* @__PURE__ */ React43.createElement(PropProvider, { ...context }, /* @__PURE__ */ React43.createElement(PropKeyProvider, { bind: filterFunctionGroup }, /* @__PURE__ */ React43.createElement(PropKeyProvider, { bind: "size" }, /* @__PURE__ */ React43.createElement(PopoverGridContainer, { ref: rowRef }, /* @__PURE__ */ React43.createElement(Grid6, { item: true, xs: 6 }, /* @__PURE__ */ React43.createElement(ControlFormLabel, null, valueName)), /* @__PURE__ */ React43.createElement(Grid6, { item: true, xs: 6 }, /* @__PURE__ */ React43.createElement(SizeControl, { anchorRef: rowRef, enablePropTypeUnits: true }))))));
|
|
2101
2231
|
};
|
|
2102
2232
|
|
|
2103
2233
|
// src/controls/filter-control/filter-content.tsx
|
|
@@ -2115,7 +2245,7 @@ var FilterContent = () => {
|
|
|
2115
2245
|
}
|
|
2116
2246
|
propContext.setValue(newValue);
|
|
2117
2247
|
};
|
|
2118
|
-
return /* @__PURE__ */
|
|
2248
|
+
return /* @__PURE__ */ React44.createElement(PropProvider, { ...propContext, setValue: handleValueChange }, /* @__PURE__ */ React44.createElement(PropKeyProvider, { bind: "css-filter-func" }, /* @__PURE__ */ React44.createElement(PopoverContent, { p: 1.5 }, /* @__PURE__ */ React44.createElement(PopoverGridContainer, null, /* @__PURE__ */ React44.createElement(Grid7, { item: true, xs: 6 }, /* @__PURE__ */ React44.createElement(ControlFormLabel, null, __15("Filter", "elementor"))), /* @__PURE__ */ React44.createElement(Grid7, { item: true, xs: 6 }, /* @__PURE__ */ React44.createElement(PropKeyProvider, { bind: "func" }, /* @__PURE__ */ React44.createElement(SelectControl, { options: filterOptions })))), /* @__PURE__ */ React44.createElement(PropKeyProvider, { bind: "args" }, /* @__PURE__ */ React44.createElement(FilterValueContent, null)))));
|
|
2119
2249
|
};
|
|
2120
2250
|
var FilterValueContent = () => {
|
|
2121
2251
|
const { openItemIndex, items: items2 } = useRepeaterContext();
|
|
@@ -2123,19 +2253,19 @@ var FilterValueContent = () => {
|
|
|
2123
2253
|
const filterFunc = currentItem.item.value.func.value;
|
|
2124
2254
|
const isDropShadow = filterFunc === "drop-shadow";
|
|
2125
2255
|
if (isDropShadow) {
|
|
2126
|
-
return /* @__PURE__ */
|
|
2256
|
+
return /* @__PURE__ */ React44.createElement(DropShadowItemContent, null);
|
|
2127
2257
|
}
|
|
2128
|
-
return /* @__PURE__ */
|
|
2258
|
+
return /* @__PURE__ */ React44.createElement(SingleSizeItemContent, { filterFunc });
|
|
2129
2259
|
};
|
|
2130
2260
|
|
|
2131
2261
|
// src/controls/filter-control/filter-icon.tsx
|
|
2132
|
-
import * as
|
|
2133
|
-
import { styled as
|
|
2262
|
+
import * as React45 from "react";
|
|
2263
|
+
import { styled as styled5, UnstableColorIndicator as UnstableColorIndicator2 } from "@elementor/ui";
|
|
2134
2264
|
var FilterIcon = ({ value }) => {
|
|
2135
2265
|
if (value.value.func.value !== "drop-shadow") {
|
|
2136
2266
|
return null;
|
|
2137
2267
|
}
|
|
2138
|
-
return /* @__PURE__ */
|
|
2268
|
+
return /* @__PURE__ */ React45.createElement(
|
|
2139
2269
|
StyledUnstableColorIndicator2,
|
|
2140
2270
|
{
|
|
2141
2271
|
size: "inherit",
|
|
@@ -2144,15 +2274,15 @@ var FilterIcon = ({ value }) => {
|
|
|
2144
2274
|
}
|
|
2145
2275
|
);
|
|
2146
2276
|
};
|
|
2147
|
-
var StyledUnstableColorIndicator2 =
|
|
2277
|
+
var StyledUnstableColorIndicator2 = styled5(UnstableColorIndicator2)(({ theme }) => ({
|
|
2148
2278
|
borderRadius: `${theme.shape.borderRadius / 2}px`
|
|
2149
2279
|
}));
|
|
2150
2280
|
|
|
2151
2281
|
// src/controls/filter-control/filter-label.tsx
|
|
2152
|
-
import * as
|
|
2282
|
+
import * as React48 from "react";
|
|
2153
2283
|
|
|
2154
2284
|
// src/controls/filter-control/drop-shadow/drop-shadow-item-label.tsx
|
|
2155
|
-
import * as
|
|
2285
|
+
import * as React46 from "react";
|
|
2156
2286
|
import { Box as Box5 } from "@elementor/ui";
|
|
2157
2287
|
var DropShadowItemLabel = ({ value }) => {
|
|
2158
2288
|
const values = value.value.args.value;
|
|
@@ -2160,11 +2290,11 @@ var DropShadowItemLabel = ({ value }) => {
|
|
|
2160
2290
|
const labels = keys.map(
|
|
2161
2291
|
(key) => values[key]?.value?.unit !== "custom" ? `${values[key]?.value?.size ?? 0}${values[key]?.value?.unit ?? "px"}` : values[key]?.value?.size || CUSTOM_SIZE_LABEL
|
|
2162
2292
|
);
|
|
2163
|
-
return /* @__PURE__ */
|
|
2293
|
+
return /* @__PURE__ */ React46.createElement(Box5, { component: "span" }, /* @__PURE__ */ React46.createElement(Box5, { component: "span", style: { textTransform: "capitalize" } }, "Drop shadow:"), ` ${labels.join(" ")}`);
|
|
2164
2294
|
};
|
|
2165
2295
|
|
|
2166
2296
|
// src/controls/filter-control/single-size/single-size-item-label.tsx
|
|
2167
|
-
import * as
|
|
2297
|
+
import * as React47 from "react";
|
|
2168
2298
|
import { Box as Box6 } from "@elementor/ui";
|
|
2169
2299
|
var SingleSizeItemLabel = ({ value }) => {
|
|
2170
2300
|
const { func, args } = value.value;
|
|
@@ -2172,16 +2302,16 @@ var SingleSizeItemLabel = ({ value }) => {
|
|
|
2172
2302
|
const { defaultValue } = getFilterFunctionConfig(func.value ?? "");
|
|
2173
2303
|
const defaultUnit = defaultValue.value.args.value?.size?.value?.unit ?? lengthUnits[0];
|
|
2174
2304
|
const { unit, size } = args.value.size?.value ?? { unit: defaultUnit, size: 0 };
|
|
2175
|
-
const label = /* @__PURE__ */
|
|
2176
|
-
return /* @__PURE__ */
|
|
2305
|
+
const label = /* @__PURE__ */ React47.createElement(Box6, { component: "span", style: { textTransform: "capitalize" } }, func.value ?? "", ":");
|
|
2306
|
+
return /* @__PURE__ */ React47.createElement(Box6, { component: "span" }, label, " " + (unit !== "custom" ? `${size ?? 0}${unit ?? defaultUnit}` : size || CUSTOM_SIZE_LABEL));
|
|
2177
2307
|
};
|
|
2178
2308
|
|
|
2179
2309
|
// src/controls/filter-control/filter-label.tsx
|
|
2180
2310
|
var FilterLabel = ({ value }) => {
|
|
2181
2311
|
if (value.value.func.value === "drop-shadow") {
|
|
2182
|
-
return /* @__PURE__ */
|
|
2312
|
+
return /* @__PURE__ */ React48.createElement(DropShadowItemLabel, { value });
|
|
2183
2313
|
}
|
|
2184
|
-
return /* @__PURE__ */
|
|
2314
|
+
return /* @__PURE__ */ React48.createElement(SingleSizeItemLabel, { value });
|
|
2185
2315
|
};
|
|
2186
2316
|
|
|
2187
2317
|
// src/controls/filter-control/filter-repeater-control.tsx
|
|
@@ -2198,7 +2328,7 @@ var FILTER_CONFIG = {
|
|
|
2198
2328
|
var FilterRepeaterControl = createControl(({ filterPropName = "filter" }) => {
|
|
2199
2329
|
const { propTypeUtil, label } = ensureFilterConfig(filterPropName);
|
|
2200
2330
|
const { propType, value: filterValues, setValue } = useBoundProp(propTypeUtil);
|
|
2201
|
-
return /* @__PURE__ */
|
|
2331
|
+
return /* @__PURE__ */ React49.createElement(FilterConfigProvider, null, /* @__PURE__ */ React49.createElement(PropProvider, { propType, value: filterValues, setValue }, /* @__PURE__ */ React49.createElement(
|
|
2202
2332
|
Repeater,
|
|
2203
2333
|
{
|
|
2204
2334
|
propTypeUtil,
|
|
@@ -2209,20 +2339,20 @@ var FilterRepeaterControl = createControl(({ filterPropName = "filter" }) => {
|
|
|
2209
2339
|
});
|
|
2210
2340
|
var Repeater = ({ propTypeUtil, label, filterPropName }) => {
|
|
2211
2341
|
const { getInitialValue: getInitialValue2 } = useFilterConfig();
|
|
2212
|
-
return /* @__PURE__ */
|
|
2342
|
+
return /* @__PURE__ */ React49.createElement(ControlRepeater, { initial: getInitialValue2(), propTypeUtil }, /* @__PURE__ */ React49.createElement(RepeaterHeader, { label }, /* @__PURE__ */ React49.createElement(
|
|
2213
2343
|
TooltipAddItemAction,
|
|
2214
2344
|
{
|
|
2215
2345
|
newItemIndex: 0,
|
|
2216
2346
|
ariaLabel: filterPropName === "backdrop-filter" ? "backdrop filter" : "filter"
|
|
2217
2347
|
}
|
|
2218
|
-
)), /* @__PURE__ */
|
|
2348
|
+
)), /* @__PURE__ */ React49.createElement(ItemsContainer, null, /* @__PURE__ */ React49.createElement(
|
|
2219
2349
|
Item,
|
|
2220
2350
|
{
|
|
2221
2351
|
Label: FilterLabel,
|
|
2222
2352
|
Icon: FilterIcon,
|
|
2223
|
-
actions: /* @__PURE__ */
|
|
2353
|
+
actions: /* @__PURE__ */ React49.createElement(React49.Fragment, null, /* @__PURE__ */ React49.createElement(DuplicateItemAction, null), /* @__PURE__ */ React49.createElement(DisableItemAction, null), /* @__PURE__ */ React49.createElement(RemoveItemAction, null))
|
|
2224
2354
|
}
|
|
2225
|
-
)), /* @__PURE__ */
|
|
2355
|
+
)), /* @__PURE__ */ React49.createElement(EditItemPopover, null, /* @__PURE__ */ React49.createElement(FilterContent, null)));
|
|
2226
2356
|
};
|
|
2227
2357
|
function ensureFilterConfig(name) {
|
|
2228
2358
|
if (name && name in FILTER_CONFIG) {
|
|
@@ -2232,8 +2362,8 @@ function ensureFilterConfig(name) {
|
|
|
2232
2362
|
}
|
|
2233
2363
|
|
|
2234
2364
|
// src/controls/select-control-wrapper.tsx
|
|
2235
|
-
import * as
|
|
2236
|
-
import { useEffect as useEffect6, useState as
|
|
2365
|
+
import * as React50 from "react";
|
|
2366
|
+
import { useEffect as useEffect6, useState as useState6 } from "react";
|
|
2237
2367
|
var getOffCanvasElements = () => {
|
|
2238
2368
|
const extendedWindow = window;
|
|
2239
2369
|
const documentId = extendedWindow.elementor.config.document.id;
|
|
@@ -2269,7 +2399,7 @@ var collectionMethods = {
|
|
|
2269
2399
|
"form-elements": getFormElements
|
|
2270
2400
|
};
|
|
2271
2401
|
var useDynamicOptions = (collectionId, initialOptions) => {
|
|
2272
|
-
const [options, setOptions] =
|
|
2402
|
+
const [options, setOptions] = useState6(initialOptions ?? []);
|
|
2273
2403
|
useEffect6(() => {
|
|
2274
2404
|
if (!collectionId || !collectionMethods[collectionId]) {
|
|
2275
2405
|
setOptions(initialOptions ?? []);
|
|
@@ -2282,24 +2412,24 @@ var useDynamicOptions = (collectionId, initialOptions) => {
|
|
|
2282
2412
|
var SelectControlWrapper = createControl(
|
|
2283
2413
|
({ collectionId, options, ...props }) => {
|
|
2284
2414
|
const actualOptions = useDynamicOptions(collectionId, options);
|
|
2285
|
-
return /* @__PURE__ */
|
|
2415
|
+
return /* @__PURE__ */ React50.createElement(SelectControl, { options: actualOptions, ...props });
|
|
2286
2416
|
}
|
|
2287
2417
|
);
|
|
2288
2418
|
|
|
2289
2419
|
// src/controls/chips-control.tsx
|
|
2290
|
-
import * as
|
|
2291
|
-
import { stringArrayPropTypeUtil, stringPropTypeUtil as
|
|
2420
|
+
import * as React51 from "react";
|
|
2421
|
+
import { stringArrayPropTypeUtil, stringPropTypeUtil as stringPropTypeUtil5 } from "@elementor/editor-props";
|
|
2292
2422
|
import { Autocomplete, Chip, TextField as TextField5 } from "@elementor/ui";
|
|
2293
2423
|
var SIZE6 = "tiny";
|
|
2294
2424
|
var ChipsControl = createControl(({ options }) => {
|
|
2295
2425
|
const { value, setValue, disabled } = useBoundProp(stringArrayPropTypeUtil);
|
|
2296
|
-
const selectedValues = (value || []).map((item) =>
|
|
2426
|
+
const selectedValues = (value || []).map((item) => stringPropTypeUtil5.extract(item)).filter((val) => val !== null);
|
|
2297
2427
|
const selectedOptions = selectedValues.map((val) => options.find((opt) => opt.value === val)).filter((opt) => opt !== void 0);
|
|
2298
2428
|
const handleChange = (_, newValue) => {
|
|
2299
|
-
const values = newValue.map((option) =>
|
|
2429
|
+
const values = newValue.map((option) => stringPropTypeUtil5.create(option.value));
|
|
2300
2430
|
setValue(values);
|
|
2301
2431
|
};
|
|
2302
|
-
return /* @__PURE__ */
|
|
2432
|
+
return /* @__PURE__ */ React51.createElement(ControlActions, null, /* @__PURE__ */ React51.createElement(
|
|
2303
2433
|
Autocomplete,
|
|
2304
2434
|
{
|
|
2305
2435
|
fullWidth: true,
|
|
@@ -2311,28 +2441,28 @@ var ChipsControl = createControl(({ options }) => {
|
|
|
2311
2441
|
options,
|
|
2312
2442
|
getOptionLabel: (option) => option.label,
|
|
2313
2443
|
isOptionEqualToValue: (option, val) => option.value === val.value,
|
|
2314
|
-
renderInput: (params) => /* @__PURE__ */
|
|
2444
|
+
renderInput: (params) => /* @__PURE__ */ React51.createElement(TextField5, { ...params }),
|
|
2315
2445
|
renderTags: (values, getTagProps) => values.map((option, index) => {
|
|
2316
2446
|
const { key, ...chipProps } = getTagProps({ index });
|
|
2317
|
-
return /* @__PURE__ */
|
|
2447
|
+
return /* @__PURE__ */ React51.createElement(Chip, { key, size: "tiny", label: option.label, ...chipProps });
|
|
2318
2448
|
})
|
|
2319
2449
|
}
|
|
2320
2450
|
));
|
|
2321
2451
|
});
|
|
2322
2452
|
|
|
2323
2453
|
// src/controls/toggle-control.tsx
|
|
2324
|
-
import * as
|
|
2325
|
-
import { stringPropTypeUtil as
|
|
2454
|
+
import * as React55 from "react";
|
|
2455
|
+
import { stringPropTypeUtil as stringPropTypeUtil6 } from "@elementor/editor-props";
|
|
2326
2456
|
|
|
2327
2457
|
// src/components/control-toggle-button-group.tsx
|
|
2328
|
-
import * as
|
|
2329
|
-
import { useEffect as useEffect7, useMemo as useMemo5, useRef as useRef7, useState as
|
|
2458
|
+
import * as React53 from "react";
|
|
2459
|
+
import { useEffect as useEffect7, useMemo as useMemo5, useRef as useRef7, useState as useState7 } from "react";
|
|
2330
2460
|
import { ChevronDownIcon } from "@elementor/icons";
|
|
2331
2461
|
import {
|
|
2332
2462
|
ListItemText,
|
|
2333
2463
|
Menu as Menu2,
|
|
2334
2464
|
MenuItem,
|
|
2335
|
-
styled as
|
|
2465
|
+
styled as styled6,
|
|
2336
2466
|
ToggleButton,
|
|
2337
2467
|
ToggleButtonGroup,
|
|
2338
2468
|
Typography as Typography3,
|
|
@@ -2340,18 +2470,18 @@ import {
|
|
|
2340
2470
|
} from "@elementor/ui";
|
|
2341
2471
|
|
|
2342
2472
|
// src/components/conditional-tooltip.tsx
|
|
2343
|
-
import * as
|
|
2473
|
+
import * as React52 from "react";
|
|
2344
2474
|
import { Tooltip as Tooltip4 } from "@elementor/ui";
|
|
2345
2475
|
var ConditionalTooltip = ({
|
|
2346
2476
|
showTooltip,
|
|
2347
2477
|
children,
|
|
2348
2478
|
label
|
|
2349
2479
|
}) => {
|
|
2350
|
-
return showTooltip && label ? /* @__PURE__ */
|
|
2480
|
+
return showTooltip && label ? /* @__PURE__ */ React52.createElement(Tooltip4, { title: label, disableFocusListener: true, placement: "top" }, children) : children;
|
|
2351
2481
|
};
|
|
2352
2482
|
|
|
2353
2483
|
// src/components/control-toggle-button-group.tsx
|
|
2354
|
-
var StyledToggleButtonGroup =
|
|
2484
|
+
var StyledToggleButtonGroup = styled6(ToggleButtonGroup)`
|
|
2355
2485
|
${({ justify }) => `justify-content: ${justify};`}
|
|
2356
2486
|
button:not( :last-of-type ) {
|
|
2357
2487
|
border-start-end-radius: 0;
|
|
@@ -2366,7 +2496,7 @@ var StyledToggleButtonGroup = styled5(ToggleButtonGroup)`
|
|
|
2366
2496
|
border-end-end-radius: 8px;
|
|
2367
2497
|
}
|
|
2368
2498
|
`;
|
|
2369
|
-
var StyledToggleButton =
|
|
2499
|
+
var StyledToggleButton = styled6(ToggleButton, {
|
|
2370
2500
|
shouldForwardProp: (prop) => prop !== "isPlaceholder"
|
|
2371
2501
|
})`
|
|
2372
2502
|
${({ theme, isPlaceholder }) => isPlaceholder && `
|
|
@@ -2378,7 +2508,7 @@ var StyledToggleButton = styled5(ToggleButton, {
|
|
|
2378
2508
|
}
|
|
2379
2509
|
`}
|
|
2380
2510
|
`;
|
|
2381
|
-
var ToggleButtonGroupUi =
|
|
2511
|
+
var ToggleButtonGroupUi = React53.forwardRef(
|
|
2382
2512
|
({
|
|
2383
2513
|
justify = "end",
|
|
2384
2514
|
size = "tiny",
|
|
@@ -2426,7 +2556,7 @@ var ToggleButtonGroupUi = React52.forwardRef(
|
|
|
2426
2556
|
return [];
|
|
2427
2557
|
};
|
|
2428
2558
|
const placeholderArray = getPlaceholderArray(placeholder);
|
|
2429
|
-
return /* @__PURE__ */
|
|
2559
|
+
return /* @__PURE__ */ React53.createElement(
|
|
2430
2560
|
StyledToggleButtonGroup,
|
|
2431
2561
|
{
|
|
2432
2562
|
ref,
|
|
@@ -2451,14 +2581,14 @@ var ToggleButtonGroupUi = React52.forwardRef(
|
|
|
2451
2581
|
disabled: optionDisabled = false
|
|
2452
2582
|
}) => {
|
|
2453
2583
|
const isPlaceholder = placeholderArray.length > 0 && placeholderArray.includes(buttonValue) && (shouldShowExclusivePlaceholder || shouldShowNonExclusivePlaceholder);
|
|
2454
|
-
return /* @__PURE__ */
|
|
2584
|
+
return /* @__PURE__ */ React53.createElement(
|
|
2455
2585
|
ConditionalTooltip,
|
|
2456
2586
|
{
|
|
2457
2587
|
key: buttonValue,
|
|
2458
2588
|
label,
|
|
2459
2589
|
showTooltip: showTooltip || false
|
|
2460
2590
|
},
|
|
2461
|
-
/* @__PURE__ */
|
|
2591
|
+
/* @__PURE__ */ React53.createElement(
|
|
2462
2592
|
StyledToggleButton,
|
|
2463
2593
|
{
|
|
2464
2594
|
value: buttonValue,
|
|
@@ -2468,12 +2598,12 @@ var ToggleButtonGroupUi = React52.forwardRef(
|
|
|
2468
2598
|
isPlaceholder,
|
|
2469
2599
|
disabled: optionDisabled
|
|
2470
2600
|
},
|
|
2471
|
-
/* @__PURE__ */
|
|
2601
|
+
/* @__PURE__ */ React53.createElement(Content3, { size })
|
|
2472
2602
|
)
|
|
2473
2603
|
);
|
|
2474
2604
|
}
|
|
2475
2605
|
),
|
|
2476
|
-
menuItems.length && exclusive && /* @__PURE__ */
|
|
2606
|
+
menuItems.length && exclusive && /* @__PURE__ */ React53.createElement(
|
|
2477
2607
|
SplitButtonGroup,
|
|
2478
2608
|
{
|
|
2479
2609
|
size,
|
|
@@ -2487,7 +2617,7 @@ var ToggleButtonGroupUi = React52.forwardRef(
|
|
|
2487
2617
|
}
|
|
2488
2618
|
);
|
|
2489
2619
|
var ControlToggleButtonGroup = (props) => {
|
|
2490
|
-
return /* @__PURE__ */
|
|
2620
|
+
return /* @__PURE__ */ React53.createElement(ControlActions, null, /* @__PURE__ */ React53.createElement(ToggleButtonGroupUi, { ...props }));
|
|
2491
2621
|
};
|
|
2492
2622
|
var SplitButtonGroup = ({
|
|
2493
2623
|
size = "tiny",
|
|
@@ -2497,7 +2627,7 @@ var SplitButtonGroup = ({
|
|
|
2497
2627
|
value
|
|
2498
2628
|
}) => {
|
|
2499
2629
|
const previewButton = usePreviewButton(items2, value);
|
|
2500
|
-
const [isMenuOpen, setIsMenuOpen] =
|
|
2630
|
+
const [isMenuOpen, setIsMenuOpen] = useState7(false);
|
|
2501
2631
|
const menuButtonRef = useRef7(null);
|
|
2502
2632
|
const onMenuToggle = (ev) => {
|
|
2503
2633
|
setIsMenuOpen((prev) => !prev);
|
|
@@ -2511,7 +2641,7 @@ var SplitButtonGroup = ({
|
|
|
2511
2641
|
const shouldRemove = newValue === value;
|
|
2512
2642
|
onChange(shouldRemove ? null : newValue);
|
|
2513
2643
|
};
|
|
2514
|
-
return /* @__PURE__ */
|
|
2644
|
+
return /* @__PURE__ */ React53.createElement(React53.Fragment, null, /* @__PURE__ */ React53.createElement(
|
|
2515
2645
|
ToggleButton,
|
|
2516
2646
|
{
|
|
2517
2647
|
value: previewButton.value,
|
|
@@ -2524,7 +2654,7 @@ var SplitButtonGroup = ({
|
|
|
2524
2654
|
}
|
|
2525
2655
|
},
|
|
2526
2656
|
previewButton.renderContent({ size })
|
|
2527
|
-
), /* @__PURE__ */
|
|
2657
|
+
), /* @__PURE__ */ React53.createElement(
|
|
2528
2658
|
ToggleButton,
|
|
2529
2659
|
{
|
|
2530
2660
|
size,
|
|
@@ -2535,8 +2665,8 @@ var SplitButtonGroup = ({
|
|
|
2535
2665
|
ref: menuButtonRef,
|
|
2536
2666
|
value: "__chevron-icon-button__"
|
|
2537
2667
|
},
|
|
2538
|
-
/* @__PURE__ */
|
|
2539
|
-
), /* @__PURE__ */
|
|
2668
|
+
/* @__PURE__ */ React53.createElement(ChevronDownIcon, { fontSize: size })
|
|
2669
|
+
), /* @__PURE__ */ React53.createElement(
|
|
2540
2670
|
Menu2,
|
|
2541
2671
|
{
|
|
2542
2672
|
open: isMenuOpen,
|
|
@@ -2554,19 +2684,19 @@ var SplitButtonGroup = ({
|
|
|
2554
2684
|
mt: 0.5
|
|
2555
2685
|
}
|
|
2556
2686
|
},
|
|
2557
|
-
items2.map(({ label, value: buttonValue }) => /* @__PURE__ */
|
|
2687
|
+
items2.map(({ label, value: buttonValue }) => /* @__PURE__ */ React53.createElement(
|
|
2558
2688
|
MenuItem,
|
|
2559
2689
|
{
|
|
2560
2690
|
key: buttonValue,
|
|
2561
2691
|
selected: buttonValue === value,
|
|
2562
2692
|
onClick: () => onMenuItemClick(buttonValue)
|
|
2563
2693
|
},
|
|
2564
|
-
/* @__PURE__ */
|
|
2694
|
+
/* @__PURE__ */ React53.createElement(ListItemText, null, /* @__PURE__ */ React53.createElement(Typography3, { sx: { fontSize: "14px" } }, label))
|
|
2565
2695
|
))
|
|
2566
2696
|
));
|
|
2567
2697
|
};
|
|
2568
2698
|
var usePreviewButton = (items2, value) => {
|
|
2569
|
-
const [previewButton, setPreviewButton] =
|
|
2699
|
+
const [previewButton, setPreviewButton] = useState7(
|
|
2570
2700
|
items2.find((item) => item.value === value) ?? items2[0]
|
|
2571
2701
|
);
|
|
2572
2702
|
useEffect7(() => {
|
|
@@ -2579,7 +2709,7 @@ var usePreviewButton = (items2, value) => {
|
|
|
2579
2709
|
};
|
|
2580
2710
|
|
|
2581
2711
|
// src/utils/convert-toggle-options-to-atomic.tsx
|
|
2582
|
-
import * as
|
|
2712
|
+
import * as React54 from "react";
|
|
2583
2713
|
import * as Icons from "@elementor/icons";
|
|
2584
2714
|
var convertToggleOptionsToAtomic = (options) => {
|
|
2585
2715
|
return options.map((option) => {
|
|
@@ -2590,7 +2720,7 @@ var convertToggleOptionsToAtomic = (options) => {
|
|
|
2590
2720
|
label: option.label,
|
|
2591
2721
|
renderContent: ({ size }) => {
|
|
2592
2722
|
if (IconComponent) {
|
|
2593
|
-
return /* @__PURE__ */
|
|
2723
|
+
return /* @__PURE__ */ React54.createElement(IconComponent, { fontSize: size });
|
|
2594
2724
|
}
|
|
2595
2725
|
return option.label;
|
|
2596
2726
|
},
|
|
@@ -2610,7 +2740,7 @@ var ToggleControl = createControl(
|
|
|
2610
2740
|
maxItems,
|
|
2611
2741
|
convertOptions = false
|
|
2612
2742
|
}) => {
|
|
2613
|
-
const { value, setValue, placeholder, disabled } = useBoundProp(
|
|
2743
|
+
const { value, setValue, placeholder, disabled } = useBoundProp(stringPropTypeUtil6);
|
|
2614
2744
|
const processedOptions = convertOptions ? convertToggleOptionsToAtomic(options) : options;
|
|
2615
2745
|
const exclusiveValues = processedOptions.filter((option) => option.exclusive).map((option) => option.value);
|
|
2616
2746
|
const handleNonExclusiveToggle = (selectedValues) => {
|
|
@@ -2626,7 +2756,7 @@ var ToggleControl = createControl(
|
|
|
2626
2756
|
size,
|
|
2627
2757
|
placeholder
|
|
2628
2758
|
};
|
|
2629
|
-
return exclusive ? /* @__PURE__ */
|
|
2759
|
+
return exclusive ? /* @__PURE__ */ React55.createElement(
|
|
2630
2760
|
ControlToggleButtonGroup,
|
|
2631
2761
|
{
|
|
2632
2762
|
...toggleButtonGroupProps,
|
|
@@ -2635,7 +2765,7 @@ var ToggleControl = createControl(
|
|
|
2635
2765
|
disabled,
|
|
2636
2766
|
exclusive: true
|
|
2637
2767
|
}
|
|
2638
|
-
) : /* @__PURE__ */
|
|
2768
|
+
) : /* @__PURE__ */ React55.createElement(
|
|
2639
2769
|
ControlToggleButtonGroup,
|
|
2640
2770
|
{
|
|
2641
2771
|
...toggleButtonGroupProps,
|
|
@@ -2649,15 +2779,15 @@ var ToggleControl = createControl(
|
|
|
2649
2779
|
);
|
|
2650
2780
|
|
|
2651
2781
|
// src/controls/number-control.tsx
|
|
2652
|
-
import * as
|
|
2782
|
+
import * as React56 from "react";
|
|
2653
2783
|
import { numberPropTypeUtil } from "@elementor/editor-props";
|
|
2654
2784
|
import { InputAdornment as InputAdornment3, Typography as Typography4 } from "@elementor/ui";
|
|
2655
2785
|
var isEmptyOrNaN = (value) => value === null || value === void 0 || value === "" || Number.isNaN(Number(value));
|
|
2656
2786
|
var renderSuffix = (propType) => {
|
|
2657
2787
|
if (propType.meta?.suffix) {
|
|
2658
|
-
return /* @__PURE__ */
|
|
2788
|
+
return /* @__PURE__ */ React56.createElement(InputAdornment3, { position: "end" }, /* @__PURE__ */ React56.createElement(Typography4, { variant: "caption", color: "text.secondary" }, propType.meta.suffix));
|
|
2659
2789
|
}
|
|
2660
|
-
return /* @__PURE__ */
|
|
2790
|
+
return /* @__PURE__ */ React56.createElement(React56.Fragment, null);
|
|
2661
2791
|
};
|
|
2662
2792
|
var NumberControl = createControl(
|
|
2663
2793
|
({
|
|
@@ -2686,7 +2816,7 @@ var NumberControl = createControl(
|
|
|
2686
2816
|
}
|
|
2687
2817
|
setValue(updatedValue, void 0, { validation: () => isInputValid });
|
|
2688
2818
|
};
|
|
2689
|
-
return /* @__PURE__ */
|
|
2819
|
+
return /* @__PURE__ */ React56.createElement(ControlActions, null, /* @__PURE__ */ React56.createElement(
|
|
2690
2820
|
NumberInput,
|
|
2691
2821
|
{
|
|
2692
2822
|
size: "tiny",
|
|
@@ -2699,7 +2829,7 @@ var NumberControl = createControl(
|
|
|
2699
2829
|
placeholder: labelPlaceholder ?? (isEmptyOrNaN(placeholder) ? "" : String(placeholder)),
|
|
2700
2830
|
inputProps: { step, min },
|
|
2701
2831
|
InputProps: {
|
|
2702
|
-
startAdornment: startIcon ? /* @__PURE__ */
|
|
2832
|
+
startAdornment: startIcon ? /* @__PURE__ */ React56.createElement(InputAdornment3, { position: "start", disabled }, startIcon) : void 0,
|
|
2703
2833
|
endAdornment: renderSuffix(propType)
|
|
2704
2834
|
}
|
|
2705
2835
|
}
|
|
@@ -2708,7 +2838,7 @@ var NumberControl = createControl(
|
|
|
2708
2838
|
);
|
|
2709
2839
|
|
|
2710
2840
|
// src/controls/equal-unequal-sizes-control.tsx
|
|
2711
|
-
import * as
|
|
2841
|
+
import * as React57 from "react";
|
|
2712
2842
|
import { useId as useId2, useRef as useRef8 } from "react";
|
|
2713
2843
|
import { bindPopover as bindPopover3, bindToggle, Box as Box7, Grid as Grid8, Popover as Popover3, Stack as Stack7, Tooltip as Tooltip5, usePopupState as usePopupState4 } from "@elementor/ui";
|
|
2714
2844
|
import { __ as __17 } from "@wordpress/i18n";
|
|
@@ -2759,14 +2889,14 @@ function EqualUnequalSizesControl({
|
|
|
2759
2889
|
}
|
|
2760
2890
|
setMasterValue(Object.values(newValue)?.pop() ?? null);
|
|
2761
2891
|
};
|
|
2762
|
-
return /* @__PURE__ */
|
|
2892
|
+
return /* @__PURE__ */ React57.createElement(React57.Fragment, null, /* @__PURE__ */ React57.createElement(Grid8, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap", ref: rowRefs[0] }, /* @__PURE__ */ React57.createElement(Grid8, { item: true, xs: 6 }, !isShowingGeneralIndicator ? /* @__PURE__ */ React57.createElement(ControlFormLabel, null, label) : /* @__PURE__ */ React57.createElement(ControlLabel, null, label)), /* @__PURE__ */ React57.createElement(Grid8, { item: true, xs: 6 }, /* @__PURE__ */ React57.createElement(Stack7, { direction: "row", alignItems: "center", gap: 1 }, /* @__PURE__ */ React57.createElement(Box7, { flexGrow: 1 }, /* @__PURE__ */ React57.createElement(
|
|
2763
2893
|
SizeControl,
|
|
2764
2894
|
{
|
|
2765
2895
|
placeholder: isMixed ? __17("Mixed", "elementor") : void 0,
|
|
2766
2896
|
enablePropTypeUnits: !isMixed || !isMixedPlaceholder,
|
|
2767
2897
|
anchorRef: rowRefs[0]
|
|
2768
2898
|
}
|
|
2769
|
-
)), /* @__PURE__ */
|
|
2899
|
+
)), /* @__PURE__ */ React57.createElement(Tooltip5, { title: tooltipLabel, placement: "top" }, /* @__PURE__ */ React57.createElement(
|
|
2770
2900
|
StyledToggleButton,
|
|
2771
2901
|
{
|
|
2772
2902
|
size: "tiny",
|
|
@@ -2778,7 +2908,7 @@ function EqualUnequalSizesControl({
|
|
|
2778
2908
|
"aria-label": tooltipLabel
|
|
2779
2909
|
},
|
|
2780
2910
|
icon
|
|
2781
|
-
))))), /* @__PURE__ */
|
|
2911
|
+
))))), /* @__PURE__ */ React57.createElement(
|
|
2782
2912
|
Popover3,
|
|
2783
2913
|
{
|
|
2784
2914
|
disablePortal: true,
|
|
@@ -2796,7 +2926,7 @@ function EqualUnequalSizesControl({
|
|
|
2796
2926
|
paper: { sx: { mt: 0.5, width: rowRefs[0].current?.getBoundingClientRect().width } }
|
|
2797
2927
|
}
|
|
2798
2928
|
},
|
|
2799
|
-
/* @__PURE__ */
|
|
2929
|
+
/* @__PURE__ */ React57.createElement(
|
|
2800
2930
|
PropProvider,
|
|
2801
2931
|
{
|
|
2802
2932
|
propType: multiSizePropType,
|
|
@@ -2805,18 +2935,18 @@ function EqualUnequalSizesControl({
|
|
|
2805
2935
|
setValue: applyMultiSizeValue,
|
|
2806
2936
|
isDisabled: () => multiSizeDisabled
|
|
2807
2937
|
},
|
|
2808
|
-
/* @__PURE__ */
|
|
2938
|
+
/* @__PURE__ */ React57.createElement(PopoverContent, { p: 1.5 }, /* @__PURE__ */ React57.createElement(PopoverGridContainer, { ref: rowRefs[1] }, /* @__PURE__ */ React57.createElement(MultiSizeValueControl, { item: items2[0], rowRef: rowRefs[1] }), /* @__PURE__ */ React57.createElement(MultiSizeValueControl, { item: items2[1], rowRef: rowRefs[1] })), /* @__PURE__ */ React57.createElement(PopoverGridContainer, { ref: rowRefs[2] }, /* @__PURE__ */ React57.createElement(MultiSizeValueControl, { item: items2[2], rowRef: rowRefs[2] }), /* @__PURE__ */ React57.createElement(MultiSizeValueControl, { item: items2[3], rowRef: rowRefs[2] })))
|
|
2809
2939
|
)
|
|
2810
2940
|
));
|
|
2811
2941
|
}
|
|
2812
2942
|
var MultiSizeValueControl = ({ item, rowRef }) => {
|
|
2813
2943
|
const { bind, label, icon, ariaLabel } = item;
|
|
2814
|
-
return /* @__PURE__ */
|
|
2944
|
+
return /* @__PURE__ */ React57.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React57.createElement(Grid8, { item: true, xs: 6 }, /* @__PURE__ */ React57.createElement(Grid8, { container: true, gap: 0.75, alignItems: "center" }, /* @__PURE__ */ React57.createElement(Grid8, { item: true, xs: 12 }, /* @__PURE__ */ React57.createElement(ControlLabel, null, label)), /* @__PURE__ */ React57.createElement(Grid8, { item: true, xs: 12 }, /* @__PURE__ */ React57.createElement(SizeControl, { startIcon: icon, ariaLabel, anchorRef: rowRef })))));
|
|
2815
2945
|
};
|
|
2816
2946
|
|
|
2817
2947
|
// src/controls/linked-dimensions-control.tsx
|
|
2818
|
-
import * as
|
|
2819
|
-
import { useLayoutEffect, useRef as useRef9, useState as
|
|
2948
|
+
import * as React58 from "react";
|
|
2949
|
+
import { useLayoutEffect, useRef as useRef9, useState as useState8 } from "react";
|
|
2820
2950
|
import { dimensionsPropTypeUtil, sizePropTypeUtil as sizePropTypeUtil3 } from "@elementor/editor-props";
|
|
2821
2951
|
import { useActiveBreakpoint as useActiveBreakpoint2 } from "@elementor/editor-responsive";
|
|
2822
2952
|
import { DetachIcon, LinkIcon, SideBottomIcon, SideLeftIcon, SideRightIcon, SideTopIcon } from "@elementor/icons";
|
|
@@ -2842,7 +2972,7 @@ var LinkedDimensionsControl = ({ label, isSiteRtl = false, extendedOptions, min
|
|
|
2842
2972
|
}
|
|
2843
2973
|
return true;
|
|
2844
2974
|
};
|
|
2845
|
-
const [isLinked, setIsLinked] =
|
|
2975
|
+
const [isLinked, setIsLinked] = useState8(() => inferIsLinked());
|
|
2846
2976
|
const activeBreakpoint = useActiveBreakpoint2();
|
|
2847
2977
|
useLayoutEffect(() => {
|
|
2848
2978
|
setIsLinked(inferIsLinked);
|
|
@@ -2891,7 +3021,7 @@ var LinkedDimensionsControl = ({ label, isSiteRtl = false, extendedOptions, min
|
|
|
2891
3021
|
isDisabled: () => dimensionsDisabled
|
|
2892
3022
|
};
|
|
2893
3023
|
const hasPlaceholders = !masterValue && (dimensionsPlaceholder || masterPlaceholder);
|
|
2894
|
-
return /* @__PURE__ */
|
|
3024
|
+
return /* @__PURE__ */ React58.createElement(PropProvider, { ...propProviderProps }, /* @__PURE__ */ React58.createElement(Stack8, { direction: "row", gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React58.createElement(ControlFormLabel, null, label), /* @__PURE__ */ React58.createElement(Tooltip6, { title: isLinked ? unlinkedLabel : linkedLabel, placement: "top" }, /* @__PURE__ */ React58.createElement(
|
|
2895
3025
|
StyledToggleButton,
|
|
2896
3026
|
{
|
|
2897
3027
|
"aria-label": isLinked ? unlinkedLabel : linkedLabel,
|
|
@@ -2903,8 +3033,8 @@ var LinkedDimensionsControl = ({ label, isSiteRtl = false, extendedOptions, min
|
|
|
2903
3033
|
disabled,
|
|
2904
3034
|
isPlaceholder: hasPlaceholders
|
|
2905
3035
|
},
|
|
2906
|
-
/* @__PURE__ */
|
|
2907
|
-
))), getCssDimensionProps(label, isSiteRtl).map((row, index) => /* @__PURE__ */
|
|
3036
|
+
/* @__PURE__ */ React58.createElement(LinkedIcon, { fontSize: "tiny" })
|
|
3037
|
+
))), getCssDimensionProps(label, isSiteRtl).map((row, index) => /* @__PURE__ */ React58.createElement(Stack8, { direction: "row", gap: 2, flexWrap: "nowrap", key: index, ref: gridRowRefs[index] }, row.map(({ icon, ...props }) => /* @__PURE__ */ React58.createElement(Grid9, { container: true, gap: 0.75, alignItems: "center", key: props.bind }, /* @__PURE__ */ React58.createElement(Grid9, { item: true, xs: 12 }, /* @__PURE__ */ React58.createElement(Label, { ...props })), /* @__PURE__ */ React58.createElement(Grid9, { item: true, xs: 12 }, /* @__PURE__ */ React58.createElement(
|
|
2908
3038
|
Control3,
|
|
2909
3039
|
{
|
|
2910
3040
|
bind: props.bind,
|
|
@@ -2927,7 +3057,7 @@ var Control3 = ({
|
|
|
2927
3057
|
min
|
|
2928
3058
|
}) => {
|
|
2929
3059
|
if (isLinked) {
|
|
2930
|
-
return /* @__PURE__ */
|
|
3060
|
+
return /* @__PURE__ */ React58.createElement(
|
|
2931
3061
|
SizeControl,
|
|
2932
3062
|
{
|
|
2933
3063
|
ariaLabel,
|
|
@@ -2938,7 +3068,7 @@ var Control3 = ({
|
|
|
2938
3068
|
}
|
|
2939
3069
|
);
|
|
2940
3070
|
}
|
|
2941
|
-
return /* @__PURE__ */
|
|
3071
|
+
return /* @__PURE__ */ React58.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React58.createElement(
|
|
2942
3072
|
SizeControl,
|
|
2943
3073
|
{
|
|
2944
3074
|
ariaLabel,
|
|
@@ -2950,7 +3080,7 @@ var Control3 = ({
|
|
|
2950
3080
|
));
|
|
2951
3081
|
};
|
|
2952
3082
|
var Label = ({ label, bind }) => {
|
|
2953
|
-
return /* @__PURE__ */
|
|
3083
|
+
return /* @__PURE__ */ React58.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React58.createElement(ControlLabel, null, label));
|
|
2954
3084
|
};
|
|
2955
3085
|
function getCssDimensionProps(label, isSiteRtl) {
|
|
2956
3086
|
return [
|
|
@@ -2960,7 +3090,7 @@ function getCssDimensionProps(label, isSiteRtl) {
|
|
|
2960
3090
|
label: __18("Top", "elementor"),
|
|
2961
3091
|
/* translators: %s is the name of the main group (margin or padding) */
|
|
2962
3092
|
ariaLabel: sprintf2(__18("%s top", "elementor"), label),
|
|
2963
|
-
icon: /* @__PURE__ */
|
|
3093
|
+
icon: /* @__PURE__ */ React58.createElement(SideTopIcon, { fontSize: "tiny" })
|
|
2964
3094
|
},
|
|
2965
3095
|
{
|
|
2966
3096
|
bind: "inline-end",
|
|
@@ -2972,7 +3102,7 @@ function getCssDimensionProps(label, isSiteRtl) {
|
|
|
2972
3102
|
/* translators: %s is the name of the main group (margin or padding) */
|
|
2973
3103
|
sprintf2(__18("%s right", "elementor"), label)
|
|
2974
3104
|
),
|
|
2975
|
-
icon: isSiteRtl ? /* @__PURE__ */
|
|
3105
|
+
icon: isSiteRtl ? /* @__PURE__ */ React58.createElement(SideLeftIcon, { fontSize: "tiny" }) : /* @__PURE__ */ React58.createElement(SideRightIcon, { fontSize: "tiny" })
|
|
2976
3106
|
}
|
|
2977
3107
|
],
|
|
2978
3108
|
[
|
|
@@ -2981,7 +3111,7 @@ function getCssDimensionProps(label, isSiteRtl) {
|
|
|
2981
3111
|
label: __18("Bottom", "elementor"),
|
|
2982
3112
|
/* translators: %s is the name of the main group (margin or padding) */
|
|
2983
3113
|
ariaLabel: sprintf2(__18("%s bottom", "elementor"), label),
|
|
2984
|
-
icon: /* @__PURE__ */
|
|
3114
|
+
icon: /* @__PURE__ */ React58.createElement(SideBottomIcon, { fontSize: "tiny" })
|
|
2985
3115
|
},
|
|
2986
3116
|
{
|
|
2987
3117
|
bind: "inline-start",
|
|
@@ -2993,23 +3123,23 @@ function getCssDimensionProps(label, isSiteRtl) {
|
|
|
2993
3123
|
/* translators: %s is the name of the main group (margin or padding) */
|
|
2994
3124
|
sprintf2(__18("%s left", "elementor"), label)
|
|
2995
3125
|
),
|
|
2996
|
-
icon: isSiteRtl ? /* @__PURE__ */
|
|
3126
|
+
icon: isSiteRtl ? /* @__PURE__ */ React58.createElement(SideRightIcon, { fontSize: "tiny" }) : /* @__PURE__ */ React58.createElement(SideLeftIcon, { fontSize: "tiny" })
|
|
2997
3127
|
}
|
|
2998
3128
|
]
|
|
2999
3129
|
];
|
|
3000
3130
|
}
|
|
3001
3131
|
|
|
3002
3132
|
// src/controls/font-family-control/font-family-control.tsx
|
|
3003
|
-
import * as
|
|
3133
|
+
import * as React60 from "react";
|
|
3004
3134
|
import { useMemo as useMemo6 } from "react";
|
|
3005
|
-
import { stringPropTypeUtil as
|
|
3135
|
+
import { stringPropTypeUtil as stringPropTypeUtil7 } from "@elementor/editor-props";
|
|
3006
3136
|
import { ChevronDownIcon as ChevronDownIcon2, TextIcon } from "@elementor/icons";
|
|
3007
3137
|
import { bindPopover as bindPopover4, bindTrigger as bindTrigger3, Popover as Popover4, UnstableTag as UnstableTag2, usePopupState as usePopupState5 } from "@elementor/ui";
|
|
3008
3138
|
import { __ as __20 } from "@wordpress/i18n";
|
|
3009
3139
|
|
|
3010
3140
|
// src/components/item-selector.tsx
|
|
3011
|
-
import * as
|
|
3012
|
-
import { useCallback as
|
|
3141
|
+
import * as React59 from "react";
|
|
3142
|
+
import { useCallback as useCallback3, useEffect as useEffect8, useState as useState9 } from "react";
|
|
3013
3143
|
import { PopoverBody, PopoverHeader as PopoverHeader2, PopoverMenuList, SearchField } from "@elementor/editor-ui";
|
|
3014
3144
|
import { Box as Box8, Divider as Divider2, Link, Stack as Stack9, Typography as Typography5 } from "@elementor/ui";
|
|
3015
3145
|
import { debounce } from "@elementor/utils";
|
|
@@ -3048,7 +3178,7 @@ var ItemSelector = ({
|
|
|
3048
3178
|
footer,
|
|
3049
3179
|
categoryItemContentTemplate
|
|
3050
3180
|
}) => {
|
|
3051
|
-
const [searchValue, setSearchValue] =
|
|
3181
|
+
const [searchValue, setSearchValue] = useState9("");
|
|
3052
3182
|
const filteredItemsList = useFilteredItemsList(itemsList, searchValue, disabledItems);
|
|
3053
3183
|
const IconComponent = icon;
|
|
3054
3184
|
const handleSearch = (value) => {
|
|
@@ -3058,7 +3188,7 @@ var ItemSelector = ({
|
|
|
3058
3188
|
setSearchValue("");
|
|
3059
3189
|
onClose();
|
|
3060
3190
|
};
|
|
3061
|
-
return /* @__PURE__ */
|
|
3191
|
+
return /* @__PURE__ */ React59.createElement(PopoverBody, { width: sectionWidth, id }, /* @__PURE__ */ React59.createElement(PopoverHeader2, { title, onClose: handleClose, icon: /* @__PURE__ */ React59.createElement(IconComponent, { fontSize: "tiny" }) }), /* @__PURE__ */ React59.createElement(
|
|
3062
3192
|
SearchField,
|
|
3063
3193
|
{
|
|
3064
3194
|
value: searchValue,
|
|
@@ -3066,7 +3196,7 @@ var ItemSelector = ({
|
|
|
3066
3196
|
placeholder: __19("Search", "elementor"),
|
|
3067
3197
|
id: id + "-search"
|
|
3068
3198
|
}
|
|
3069
|
-
), /* @__PURE__ */
|
|
3199
|
+
), /* @__PURE__ */ React59.createElement(Divider2, null), /* @__PURE__ */ React59.createElement(Box8, { sx: { flex: 1, overflow: "auto", minHeight: 0 } }, filteredItemsList.length > 0 ? /* @__PURE__ */ React59.createElement(
|
|
3070
3200
|
ItemList,
|
|
3071
3201
|
{
|
|
3072
3202
|
itemListItems: filteredItemsList,
|
|
@@ -3077,7 +3207,7 @@ var ItemSelector = ({
|
|
|
3077
3207
|
onDebounce,
|
|
3078
3208
|
categoryItemContentTemplate
|
|
3079
3209
|
}
|
|
3080
|
-
) : /* @__PURE__ */
|
|
3210
|
+
) : /* @__PURE__ */ React59.createElement(
|
|
3081
3211
|
Stack9,
|
|
3082
3212
|
{
|
|
3083
3213
|
alignItems: "center",
|
|
@@ -3087,16 +3217,16 @@ var ItemSelector = ({
|
|
|
3087
3217
|
gap: 1.5,
|
|
3088
3218
|
overflow: "hidden"
|
|
3089
3219
|
},
|
|
3090
|
-
/* @__PURE__ */
|
|
3091
|
-
/* @__PURE__ */
|
|
3220
|
+
/* @__PURE__ */ React59.createElement(IconComponent, { fontSize: "large" }),
|
|
3221
|
+
/* @__PURE__ */ React59.createElement(Box8, { sx: { maxWidth: 160, overflow: "hidden" } }, /* @__PURE__ */ React59.createElement(Typography5, { align: "center", variant: "subtitle2", color: "text.secondary" }, __19("Sorry, nothing matched", "elementor")), /* @__PURE__ */ React59.createElement(
|
|
3092
3222
|
Typography5,
|
|
3093
3223
|
{
|
|
3094
3224
|
variant: "subtitle2",
|
|
3095
3225
|
color: "text.secondary",
|
|
3096
3226
|
sx: { display: "flex", width: "100%", justifyContent: "center" }
|
|
3097
3227
|
},
|
|
3098
|
-
/* @__PURE__ */
|
|
3099
|
-
/* @__PURE__ */
|
|
3228
|
+
/* @__PURE__ */ React59.createElement("span", null, "\u201C"),
|
|
3229
|
+
/* @__PURE__ */ React59.createElement(
|
|
3100
3230
|
Box8,
|
|
3101
3231
|
{
|
|
3102
3232
|
component: "span",
|
|
@@ -3104,9 +3234,9 @@ var ItemSelector = ({
|
|
|
3104
3234
|
},
|
|
3105
3235
|
searchValue
|
|
3106
3236
|
),
|
|
3107
|
-
/* @__PURE__ */
|
|
3237
|
+
/* @__PURE__ */ React59.createElement("span", null, "\u201D.")
|
|
3108
3238
|
)),
|
|
3109
|
-
/* @__PURE__ */
|
|
3239
|
+
/* @__PURE__ */ React59.createElement(
|
|
3110
3240
|
Typography5,
|
|
3111
3241
|
{
|
|
3112
3242
|
align: "center",
|
|
@@ -3115,7 +3245,7 @@ var ItemSelector = ({
|
|
|
3115
3245
|
sx: { display: "flex", flexDirection: "column" }
|
|
3116
3246
|
},
|
|
3117
3247
|
__19("Try something else.", "elementor"),
|
|
3118
|
-
/* @__PURE__ */
|
|
3248
|
+
/* @__PURE__ */ React59.createElement(
|
|
3119
3249
|
Link,
|
|
3120
3250
|
{
|
|
3121
3251
|
color: "secondary",
|
|
@@ -3146,8 +3276,8 @@ var ItemList = ({
|
|
|
3146
3276
|
}
|
|
3147
3277
|
});
|
|
3148
3278
|
}, 100);
|
|
3149
|
-
const memoizedItemStyle =
|
|
3150
|
-
return /* @__PURE__ */
|
|
3279
|
+
const memoizedItemStyle = useCallback3((item) => itemStyle(item), [itemStyle]);
|
|
3280
|
+
return /* @__PURE__ */ React59.createElement(
|
|
3151
3281
|
PopoverMenuList,
|
|
3152
3282
|
{
|
|
3153
3283
|
items: itemListItems,
|
|
@@ -3162,7 +3292,7 @@ var ItemList = ({
|
|
|
3162
3292
|
);
|
|
3163
3293
|
};
|
|
3164
3294
|
var useDebounce = (fn, delay) => {
|
|
3165
|
-
const [debouncedFn] =
|
|
3295
|
+
const [debouncedFn] = useState9(() => debounce(fn, delay));
|
|
3166
3296
|
useEffect8(() => () => debouncedFn.cancel(), [debouncedFn]);
|
|
3167
3297
|
return debouncedFn;
|
|
3168
3298
|
};
|
|
@@ -3181,7 +3311,7 @@ var FontFamilyControl = createControl(
|
|
|
3181
3311
|
setValue: setFontFamily,
|
|
3182
3312
|
disabled,
|
|
3183
3313
|
placeholder
|
|
3184
|
-
} = useBoundProp(
|
|
3314
|
+
} = useBoundProp(stringPropTypeUtil7);
|
|
3185
3315
|
const popoverState = usePopupState5({ variant: "popover" });
|
|
3186
3316
|
const isShowingPlaceholder = !fontFamily && placeholder;
|
|
3187
3317
|
const mapFontSubs = useMemo6(() => {
|
|
@@ -3190,13 +3320,13 @@ var FontFamilyControl = createControl(
|
|
|
3190
3320
|
items: fonts
|
|
3191
3321
|
}));
|
|
3192
3322
|
}, [fontFamilies]);
|
|
3193
|
-
return /* @__PURE__ */
|
|
3323
|
+
return /* @__PURE__ */ React60.createElement(React60.Fragment, null, /* @__PURE__ */ React60.createElement(ControlActions, null, /* @__PURE__ */ React60.createElement(
|
|
3194
3324
|
UnstableTag2,
|
|
3195
3325
|
{
|
|
3196
3326
|
id: "font-family-control",
|
|
3197
3327
|
variant: "outlined",
|
|
3198
3328
|
label: fontFamily || placeholder,
|
|
3199
|
-
endIcon: /* @__PURE__ */
|
|
3329
|
+
endIcon: /* @__PURE__ */ React60.createElement(ChevronDownIcon2, { fontSize: "tiny" }),
|
|
3200
3330
|
...bindTrigger3(popoverState),
|
|
3201
3331
|
fullWidth: true,
|
|
3202
3332
|
disabled,
|
|
@@ -3208,7 +3338,7 @@ var FontFamilyControl = createControl(
|
|
|
3208
3338
|
textTransform: "capitalize"
|
|
3209
3339
|
} : void 0
|
|
3210
3340
|
}
|
|
3211
|
-
)), /* @__PURE__ */
|
|
3341
|
+
)), /* @__PURE__ */ React60.createElement(
|
|
3212
3342
|
Popover4,
|
|
3213
3343
|
{
|
|
3214
3344
|
disablePortal: true,
|
|
@@ -3218,7 +3348,7 @@ var FontFamilyControl = createControl(
|
|
|
3218
3348
|
sx: { my: 1.5 },
|
|
3219
3349
|
...bindPopover4(popoverState)
|
|
3220
3350
|
},
|
|
3221
|
-
/* @__PURE__ */
|
|
3351
|
+
/* @__PURE__ */ React60.createElement(
|
|
3222
3352
|
ItemSelector,
|
|
3223
3353
|
{
|
|
3224
3354
|
id: "font-family-selector",
|
|
@@ -3238,7 +3368,7 @@ var FontFamilyControl = createControl(
|
|
|
3238
3368
|
);
|
|
3239
3369
|
|
|
3240
3370
|
// src/controls/url-control.tsx
|
|
3241
|
-
import * as
|
|
3371
|
+
import * as React61 from "react";
|
|
3242
3372
|
import { urlPropTypeUtil } from "@elementor/editor-props";
|
|
3243
3373
|
import { TextField as TextField6 } from "@elementor/ui";
|
|
3244
3374
|
var UrlControl = createControl(
|
|
@@ -3246,7 +3376,7 @@ var UrlControl = createControl(
|
|
|
3246
3376
|
const { value, setValue, disabled, placeholder: boundPlaceholder } = useBoundProp(urlPropTypeUtil);
|
|
3247
3377
|
const handleChange = (event) => setValue(event.target.value);
|
|
3248
3378
|
const placeholder = propPlaceholder ?? boundPlaceholder ?? void 0;
|
|
3249
|
-
return /* @__PURE__ */
|
|
3379
|
+
return /* @__PURE__ */ React61.createElement(ControlActions, null, /* @__PURE__ */ React61.createElement(
|
|
3250
3380
|
TextField6,
|
|
3251
3381
|
{
|
|
3252
3382
|
size: "tiny",
|
|
@@ -3264,8 +3394,8 @@ var UrlControl = createControl(
|
|
|
3264
3394
|
);
|
|
3265
3395
|
|
|
3266
3396
|
// src/controls/link-control.tsx
|
|
3267
|
-
import * as
|
|
3268
|
-
import { useEffect as useEffect9, useMemo as useMemo8, useState as
|
|
3397
|
+
import * as React66 from "react";
|
|
3398
|
+
import { useEffect as useEffect9, useMemo as useMemo8, useState as useState11 } from "react";
|
|
3269
3399
|
import { getLinkInLinkRestriction } from "@elementor/editor-elements";
|
|
3270
3400
|
import { linkPropTypeUtil } from "@elementor/editor-props";
|
|
3271
3401
|
import { MinusIcon, PlusIcon as PlusIcon2 } from "@elementor/icons";
|
|
@@ -3275,7 +3405,7 @@ import { debounce as debounce3 } from "@elementor/utils";
|
|
|
3275
3405
|
import { __ as __23 } from "@wordpress/i18n";
|
|
3276
3406
|
|
|
3277
3407
|
// src/components/restricted-link-infotip.tsx
|
|
3278
|
-
import * as
|
|
3408
|
+
import * as React62 from "react";
|
|
3279
3409
|
import { selectElement } from "@elementor/editor-elements";
|
|
3280
3410
|
import { InfoCircleFilledIcon } from "@elementor/icons";
|
|
3281
3411
|
import { Alert, AlertAction, AlertTitle, Box as Box9, Infotip as Infotip2, Link as Link2 } from "@elementor/ui";
|
|
@@ -3305,12 +3435,12 @@ var RestrictedLinkInfotip = ({
|
|
|
3305
3435
|
selectElement(elementId);
|
|
3306
3436
|
}
|
|
3307
3437
|
};
|
|
3308
|
-
const content = /* @__PURE__ */
|
|
3438
|
+
const content = /* @__PURE__ */ React62.createElement(
|
|
3309
3439
|
Alert,
|
|
3310
3440
|
{
|
|
3311
3441
|
color: "secondary",
|
|
3312
|
-
icon: /* @__PURE__ */
|
|
3313
|
-
action: /* @__PURE__ */
|
|
3442
|
+
icon: /* @__PURE__ */ React62.createElement(InfoCircleFilledIcon, null),
|
|
3443
|
+
action: /* @__PURE__ */ React62.createElement(
|
|
3314
3444
|
AlertAction,
|
|
3315
3445
|
{
|
|
3316
3446
|
sx: { width: "fit-content" },
|
|
@@ -3321,10 +3451,10 @@ var RestrictedLinkInfotip = ({
|
|
|
3321
3451
|
__21("Take me there", "elementor")
|
|
3322
3452
|
)
|
|
3323
3453
|
},
|
|
3324
|
-
/* @__PURE__ */
|
|
3325
|
-
/* @__PURE__ */
|
|
3454
|
+
/* @__PURE__ */ React62.createElement(AlertTitle, null, __21("Nested links", "elementor")),
|
|
3455
|
+
/* @__PURE__ */ React62.createElement(Box9, { component: "span" }, INFOTIP_CONTENT[reason ?? "descendant"], " ", /* @__PURE__ */ React62.createElement(Link2, { href: learnMoreButton.href, target: "_blank", color: "info.main" }, learnMoreButton.label))
|
|
3326
3456
|
);
|
|
3327
|
-
return shouldRestrict && isVisible ? /* @__PURE__ */
|
|
3457
|
+
return shouldRestrict && isVisible ? /* @__PURE__ */ React62.createElement(
|
|
3328
3458
|
Infotip2,
|
|
3329
3459
|
{
|
|
3330
3460
|
placement: "right",
|
|
@@ -3332,17 +3462,17 @@ var RestrictedLinkInfotip = ({
|
|
|
3332
3462
|
color: "secondary",
|
|
3333
3463
|
slotProps: { popper: { sx: { width: 300 } } }
|
|
3334
3464
|
},
|
|
3335
|
-
/* @__PURE__ */
|
|
3336
|
-
) : /* @__PURE__ */
|
|
3465
|
+
/* @__PURE__ */ React62.createElement(Box9, null, children)
|
|
3466
|
+
) : /* @__PURE__ */ React62.createElement(React62.Fragment, null, children);
|
|
3337
3467
|
};
|
|
3338
3468
|
|
|
3339
3469
|
// src/controls/query-control.tsx
|
|
3340
|
-
import * as
|
|
3341
|
-
import { useMemo as useMemo7, useState as
|
|
3470
|
+
import * as React64 from "react";
|
|
3471
|
+
import { useMemo as useMemo7, useState as useState10 } from "react";
|
|
3342
3472
|
import {
|
|
3343
3473
|
numberPropTypeUtil as numberPropTypeUtil2,
|
|
3344
3474
|
queryPropTypeUtil,
|
|
3345
|
-
stringPropTypeUtil as
|
|
3475
|
+
stringPropTypeUtil as stringPropTypeUtil8,
|
|
3346
3476
|
urlPropTypeUtil as urlPropTypeUtil2
|
|
3347
3477
|
} from "@elementor/editor-props";
|
|
3348
3478
|
import { httpService as httpService2 } from "@elementor/http-client";
|
|
@@ -3351,7 +3481,7 @@ import { debounce as debounce2 } from "@elementor/utils";
|
|
|
3351
3481
|
import { __ as __22 } from "@wordpress/i18n";
|
|
3352
3482
|
|
|
3353
3483
|
// src/components/autocomplete.tsx
|
|
3354
|
-
import * as
|
|
3484
|
+
import * as React63 from "react";
|
|
3355
3485
|
import { forwardRef as forwardRef8 } from "react";
|
|
3356
3486
|
import { XIcon as XIcon2 } from "@elementor/icons";
|
|
3357
3487
|
import {
|
|
@@ -3383,7 +3513,7 @@ var Autocomplete2 = forwardRef8((props, ref) => {
|
|
|
3383
3513
|
const valueLength = value?.toString()?.length ?? 0;
|
|
3384
3514
|
const meetsMinLength = valueLength >= minInputLength;
|
|
3385
3515
|
const shouldOpen = meetsMinLength && (allowCustomValues ? optionKeys.length > 0 : true);
|
|
3386
|
-
return /* @__PURE__ */
|
|
3516
|
+
return /* @__PURE__ */ React63.createElement(
|
|
3387
3517
|
AutocompleteBase,
|
|
3388
3518
|
{
|
|
3389
3519
|
...restProps,
|
|
@@ -3404,8 +3534,8 @@ var Autocomplete2 = forwardRef8((props, ref) => {
|
|
|
3404
3534
|
groupBy: isCategorizedOptionPool(options) ? (optionId) => findMatchingOption(options, optionId)?.groupLabel || optionId : void 0,
|
|
3405
3535
|
isOptionEqualToValue,
|
|
3406
3536
|
filterOptions: () => optionKeys,
|
|
3407
|
-
renderOption: (optionProps, optionId) => /* @__PURE__ */
|
|
3408
|
-
renderInput: (params) => /* @__PURE__ */
|
|
3537
|
+
renderOption: (optionProps, optionId) => /* @__PURE__ */ React63.createElement(Box10, { component: "li", ...optionProps, key: optionProps.id }, findMatchingOption(options, optionId)?.label ?? optionId),
|
|
3538
|
+
renderInput: (params) => /* @__PURE__ */ React63.createElement(
|
|
3409
3539
|
TextInput,
|
|
3410
3540
|
{
|
|
3411
3541
|
params,
|
|
@@ -3432,7 +3562,7 @@ var TextInput = ({
|
|
|
3432
3562
|
const onChange = (event) => {
|
|
3433
3563
|
handleChange(event.target.value);
|
|
3434
3564
|
};
|
|
3435
|
-
return /* @__PURE__ */
|
|
3565
|
+
return /* @__PURE__ */ React63.createElement(
|
|
3436
3566
|
TextField7,
|
|
3437
3567
|
{
|
|
3438
3568
|
...params,
|
|
@@ -3447,7 +3577,7 @@ var TextInput = ({
|
|
|
3447
3577
|
InputProps: {
|
|
3448
3578
|
...params.InputProps,
|
|
3449
3579
|
startAdornment: startAdornment || params.InputProps.startAdornment,
|
|
3450
|
-
endAdornment: /* @__PURE__ */
|
|
3580
|
+
endAdornment: /* @__PURE__ */ React63.createElement(ClearButton, { params, allowClear, handleChange })
|
|
3451
3581
|
}
|
|
3452
3582
|
}
|
|
3453
3583
|
);
|
|
@@ -3456,7 +3586,7 @@ var ClearButton = ({
|
|
|
3456
3586
|
allowClear,
|
|
3457
3587
|
handleChange,
|
|
3458
3588
|
params
|
|
3459
|
-
}) => /* @__PURE__ */
|
|
3589
|
+
}) => /* @__PURE__ */ React63.createElement(InputAdornment4, { position: "end" }, allowClear && /* @__PURE__ */ React63.createElement(IconButton5, { size: params.size, onClick: () => handleChange(null), sx: { cursor: "pointer" } }, /* @__PURE__ */ React63.createElement(XIcon2, { fontSize: params.size })));
|
|
3460
3590
|
function findMatchingOption(options, optionId = null) {
|
|
3461
3591
|
const formattedOption = (optionId || "").toString();
|
|
3462
3592
|
return options.find(({ id }) => formattedOption === id.toString());
|
|
@@ -3493,7 +3623,7 @@ var QueryControl = createControl((props) => {
|
|
|
3493
3623
|
onSetValue,
|
|
3494
3624
|
ariaLabel
|
|
3495
3625
|
} = props || {};
|
|
3496
|
-
const [options, setOptions] =
|
|
3626
|
+
const [options, setOptions] = useState10(
|
|
3497
3627
|
generateFirstLoadedOption(queryValue)
|
|
3498
3628
|
);
|
|
3499
3629
|
const onOptionChange = (newValue) => {
|
|
@@ -3504,7 +3634,7 @@ var QueryControl = createControl((props) => {
|
|
|
3504
3634
|
}
|
|
3505
3635
|
const newQueryValue = {
|
|
3506
3636
|
id: numberPropTypeUtil2.create(newValue),
|
|
3507
|
-
label:
|
|
3637
|
+
label: stringPropTypeUtil8.create(findMatchingOption(options, newValue)?.label || null)
|
|
3508
3638
|
};
|
|
3509
3639
|
setQueryValue(newQueryValue);
|
|
3510
3640
|
onSetValue?.(queryPropTypeUtil.create(newQueryValue));
|
|
@@ -3537,13 +3667,13 @@ var QueryControl = createControl((props) => {
|
|
|
3537
3667
|
[url]
|
|
3538
3668
|
);
|
|
3539
3669
|
const displayValue = queryValue?.id?.value ?? urlValue;
|
|
3540
|
-
return /* @__PURE__ */
|
|
3670
|
+
return /* @__PURE__ */ React64.createElement(ControlActions, null, /* @__PURE__ */ React64.createElement(
|
|
3541
3671
|
Autocomplete2,
|
|
3542
3672
|
{
|
|
3543
3673
|
options,
|
|
3544
3674
|
allowCustomValues,
|
|
3545
3675
|
placeholder: urlPlaceholder ?? placeholder,
|
|
3546
|
-
startAdornment: /* @__PURE__ */
|
|
3676
|
+
startAdornment: /* @__PURE__ */ React64.createElement(SearchIcon, { fontSize: "tiny" }),
|
|
3547
3677
|
value: displayValue,
|
|
3548
3678
|
onOptionChange,
|
|
3549
3679
|
onTextChange,
|
|
@@ -3583,7 +3713,7 @@ function generateFirstLoadedOption(queryValue) {
|
|
|
3583
3713
|
}
|
|
3584
3714
|
|
|
3585
3715
|
// src/controls/switch-control.tsx
|
|
3586
|
-
import * as
|
|
3716
|
+
import * as React65 from "react";
|
|
3587
3717
|
import { booleanPropTypeUtil } from "@elementor/editor-props";
|
|
3588
3718
|
import { Box as Box11, Switch } from "@elementor/ui";
|
|
3589
3719
|
var SwitchControl = createControl(() => {
|
|
@@ -3591,7 +3721,7 @@ var SwitchControl = createControl(() => {
|
|
|
3591
3721
|
const handleChange = (event) => {
|
|
3592
3722
|
setValue(event.target.checked);
|
|
3593
3723
|
};
|
|
3594
|
-
return /* @__PURE__ */
|
|
3724
|
+
return /* @__PURE__ */ React65.createElement(Box11, { sx: { display: "flex", justifyContent: "flex-end" } }, /* @__PURE__ */ React65.createElement(
|
|
3595
3725
|
Switch,
|
|
3596
3726
|
{
|
|
3597
3727
|
checked: !!(value || placeholder),
|
|
@@ -3611,7 +3741,7 @@ var LinkControl = createControl((props) => {
|
|
|
3611
3741
|
const { value, path, setValue, ...propContext } = useBoundProp(linkPropTypeUtil);
|
|
3612
3742
|
const linkPlaceholder = propContext.placeholder;
|
|
3613
3743
|
const [linkSessionValue, setLinkSessionValue] = useSessionStorage(path.join("/"));
|
|
3614
|
-
const [isActive, setIsActive] =
|
|
3744
|
+
const [isActive, setIsActive] = useState11(!!value || !!linkPlaceholder);
|
|
3615
3745
|
const {
|
|
3616
3746
|
allowCustomValues = true,
|
|
3617
3747
|
queryOptions,
|
|
@@ -3621,7 +3751,7 @@ var LinkControl = createControl((props) => {
|
|
|
3621
3751
|
label = __23("Link", "elementor"),
|
|
3622
3752
|
ariaLabel
|
|
3623
3753
|
} = props || {};
|
|
3624
|
-
const [linkInLinkRestriction, setLinkInLinkRestriction] =
|
|
3754
|
+
const [linkInLinkRestriction, setLinkInLinkRestriction] = useState11(
|
|
3625
3755
|
getLinkInLinkRestriction(elementId, value ?? linkPlaceholder)
|
|
3626
3756
|
);
|
|
3627
3757
|
const shouldDisableAddingLink = !isActive && linkInLinkRestriction.shouldRestrict;
|
|
@@ -3674,7 +3804,7 @@ var LinkControl = createControl((props) => {
|
|
|
3674
3804
|
} : null;
|
|
3675
3805
|
setLinkSessionValue({ ...linkSessionValue, value: valueToSave });
|
|
3676
3806
|
};
|
|
3677
|
-
return /* @__PURE__ */
|
|
3807
|
+
return /* @__PURE__ */ React66.createElement(PropProvider, { ...propContext, value, setValue }, /* @__PURE__ */ React66.createElement(Stack10, { gap: 1.5 }, /* @__PURE__ */ React66.createElement(
|
|
3678
3808
|
Stack10,
|
|
3679
3809
|
{
|
|
3680
3810
|
direction: "row",
|
|
@@ -3684,8 +3814,8 @@ var LinkControl = createControl((props) => {
|
|
|
3684
3814
|
marginInlineEnd: -0.75
|
|
3685
3815
|
}
|
|
3686
3816
|
},
|
|
3687
|
-
/* @__PURE__ */
|
|
3688
|
-
/* @__PURE__ */
|
|
3817
|
+
/* @__PURE__ */ React66.createElement(ControlLabel, null, label),
|
|
3818
|
+
/* @__PURE__ */ React66.createElement(RestrictedLinkInfotip, { isVisible: !isActive, linkInLinkRestriction }, /* @__PURE__ */ React66.createElement(
|
|
3689
3819
|
IconButton6,
|
|
3690
3820
|
{
|
|
3691
3821
|
size: SIZE7,
|
|
@@ -3693,9 +3823,9 @@ var LinkControl = createControl((props) => {
|
|
|
3693
3823
|
"aria-label": __23("Toggle link", "elementor"),
|
|
3694
3824
|
disabled: shouldDisableAddingLink
|
|
3695
3825
|
},
|
|
3696
|
-
isActive ? /* @__PURE__ */
|
|
3826
|
+
isActive ? /* @__PURE__ */ React66.createElement(MinusIcon, { fontSize: SIZE7 }) : /* @__PURE__ */ React66.createElement(PlusIcon2, { fontSize: SIZE7 })
|
|
3697
3827
|
))
|
|
3698
|
-
), /* @__PURE__ */
|
|
3828
|
+
), /* @__PURE__ */ React66.createElement(Collapse, { in: isActive, timeout: "auto", unmountOnExit: true }, /* @__PURE__ */ React66.createElement(Stack10, { gap: 1.5 }, /* @__PURE__ */ React66.createElement(PropKeyProvider, { bind: "destination" }, /* @__PURE__ */ React66.createElement(
|
|
3699
3829
|
QueryControl,
|
|
3700
3830
|
{
|
|
3701
3831
|
queryOptions,
|
|
@@ -3705,29 +3835,29 @@ var LinkControl = createControl((props) => {
|
|
|
3705
3835
|
onSetValue: onSaveValueToSession,
|
|
3706
3836
|
ariaLabel: ariaLabel || label
|
|
3707
3837
|
}
|
|
3708
|
-
)), /* @__PURE__ */
|
|
3838
|
+
)), /* @__PURE__ */ React66.createElement(PropKeyProvider, { bind: "isTargetBlank" }, /* @__PURE__ */ React66.createElement(Grid10, { container: true, alignItems: "center", flexWrap: "nowrap", justifyContent: "space-between" }, /* @__PURE__ */ React66.createElement(Grid10, { item: true }, /* @__PURE__ */ React66.createElement(ControlFormLabel, null, __23("Open in a new tab", "elementor"))), /* @__PURE__ */ React66.createElement(Grid10, { item: true, sx: { marginInlineEnd: -1 } }, /* @__PURE__ */ React66.createElement(SwitchControl, null))))))));
|
|
3709
3839
|
});
|
|
3710
3840
|
|
|
3711
3841
|
// src/controls/html-tag-control.tsx
|
|
3712
|
-
import * as
|
|
3842
|
+
import * as React68 from "react";
|
|
3713
3843
|
import { getElementLabel } from "@elementor/editor-elements";
|
|
3714
|
-
import { stringPropTypeUtil as
|
|
3844
|
+
import { stringPropTypeUtil as stringPropTypeUtil9 } from "@elementor/editor-props";
|
|
3715
3845
|
import { MenuListItem as MenuListItem3 } from "@elementor/editor-ui";
|
|
3716
|
-
import { Select as Select2, styled as
|
|
3846
|
+
import { Select as Select2, styled as styled7, Typography as Typography6 } from "@elementor/ui";
|
|
3717
3847
|
import { __ as __24 } from "@wordpress/i18n";
|
|
3718
3848
|
|
|
3719
3849
|
// src/components/conditional-control-infotip.tsx
|
|
3720
|
-
import * as
|
|
3850
|
+
import * as React67 from "react";
|
|
3721
3851
|
import { InfoAlert } from "@elementor/editor-ui";
|
|
3722
3852
|
import { AlertTitle as AlertTitle2, Box as Box12, Infotip as Infotip3, useTheme as useTheme2 } from "@elementor/ui";
|
|
3723
3853
|
import { DirectionProvider } from "@elementor/ui";
|
|
3724
3854
|
var DEFAULT_COLOR = "secondary";
|
|
3725
|
-
var ConditionalControlInfotip =
|
|
3855
|
+
var ConditionalControlInfotip = React67.forwardRef(
|
|
3726
3856
|
({ children, title, description, alertProps, infotipProps, ...props }, ref) => {
|
|
3727
3857
|
const theme = useTheme2();
|
|
3728
3858
|
const isUiRtl = "rtl" === theme.direction;
|
|
3729
3859
|
const isEnabled = props.isEnabled && (title || description);
|
|
3730
|
-
return /* @__PURE__ */
|
|
3860
|
+
return /* @__PURE__ */ React67.createElement(Box12, { ref }, isEnabled ? /* @__PURE__ */ React67.createElement(DirectionProvider, { rtl: isUiRtl }, /* @__PURE__ */ React67.createElement(
|
|
3731
3861
|
Infotip3,
|
|
3732
3862
|
{
|
|
3733
3863
|
placement: "right",
|
|
@@ -3745,14 +3875,14 @@ var ConditionalControlInfotip = React66.forwardRef(
|
|
|
3745
3875
|
}
|
|
3746
3876
|
},
|
|
3747
3877
|
...infotipProps,
|
|
3748
|
-
content: /* @__PURE__ */
|
|
3878
|
+
content: /* @__PURE__ */ React67.createElement(
|
|
3749
3879
|
InfoAlert,
|
|
3750
3880
|
{
|
|
3751
3881
|
color: DEFAULT_COLOR,
|
|
3752
3882
|
sx: { width: 300, px: 1.5, py: 2 },
|
|
3753
3883
|
...alertProps
|
|
3754
3884
|
},
|
|
3755
|
-
/* @__PURE__ */
|
|
3885
|
+
/* @__PURE__ */ React67.createElement(Box12, { sx: { flexDirection: "column", display: "flex", gap: 0.5 } }, /* @__PURE__ */ React67.createElement(AlertTitle2, null, title), /* @__PURE__ */ React67.createElement(Box12, null, description))
|
|
3756
3886
|
)
|
|
3757
3887
|
},
|
|
3758
3888
|
children
|
|
@@ -3761,7 +3891,7 @@ var ConditionalControlInfotip = React66.forwardRef(
|
|
|
3761
3891
|
);
|
|
3762
3892
|
|
|
3763
3893
|
// src/controls/html-tag-control.tsx
|
|
3764
|
-
var StyledSelect =
|
|
3894
|
+
var StyledSelect = styled7(Select2)(() => ({ ".MuiSelect-select.Mui-disabled": { cursor: "not-allowed" } }));
|
|
3765
3895
|
var HtmlTagControl = createControl((props) => {
|
|
3766
3896
|
const {
|
|
3767
3897
|
options,
|
|
@@ -3769,7 +3899,7 @@ var HtmlTagControl = createControl((props) => {
|
|
|
3769
3899
|
fallbackLabels = {},
|
|
3770
3900
|
context: { elementId }
|
|
3771
3901
|
} = props;
|
|
3772
|
-
const { value, setValue, disabled, placeholder } = useBoundProp(
|
|
3902
|
+
const { value, setValue, disabled, placeholder } = useBoundProp(stringPropTypeUtil9);
|
|
3773
3903
|
const handleChange = (event) => {
|
|
3774
3904
|
const newValue = event.target.value || null;
|
|
3775
3905
|
onChange?.(newValue, value);
|
|
@@ -3794,10 +3924,10 @@ var HtmlTagControl = createControl((props) => {
|
|
|
3794
3924
|
}
|
|
3795
3925
|
const placeholderOption = findOptionByValue(placeholder);
|
|
3796
3926
|
const displayText = placeholderOption?.label || placeholder;
|
|
3797
|
-
return /* @__PURE__ */
|
|
3927
|
+
return /* @__PURE__ */ React68.createElement(Typography6, { component: "span", variant: "caption", color: "text.tertiary" }, displayText);
|
|
3798
3928
|
};
|
|
3799
3929
|
const findOptionByValue = (searchValue) => options.find((opt) => opt.value === searchValue);
|
|
3800
|
-
return /* @__PURE__ */
|
|
3930
|
+
return /* @__PURE__ */ React68.createElement(ControlActions, null, /* @__PURE__ */ React68.createElement(ConditionalControlInfotip, { ...infoTipProps }, /* @__PURE__ */ React68.createElement(
|
|
3801
3931
|
StyledSelect,
|
|
3802
3932
|
{
|
|
3803
3933
|
sx: { overflow: "hidden", cursor: disabled ? "not-allowed" : void 0 },
|
|
@@ -3809,13 +3939,13 @@ var HtmlTagControl = createControl((props) => {
|
|
|
3809
3939
|
disabled,
|
|
3810
3940
|
fullWidth: true
|
|
3811
3941
|
},
|
|
3812
|
-
options.map(({ label, ...itemProps }) => /* @__PURE__ */
|
|
3942
|
+
options.map(({ label, ...itemProps }) => /* @__PURE__ */ React68.createElement(MenuListItem3, { key: itemProps.value, ...itemProps, value: itemProps.value ?? "" }, label))
|
|
3813
3943
|
)));
|
|
3814
3944
|
});
|
|
3815
3945
|
|
|
3816
3946
|
// src/controls/gap-control.tsx
|
|
3817
|
-
import * as
|
|
3818
|
-
import { useLayoutEffect as useLayoutEffect2, useRef as useRef10, useState as
|
|
3947
|
+
import * as React69 from "react";
|
|
3948
|
+
import { useLayoutEffect as useLayoutEffect2, useRef as useRef10, useState as useState12 } from "react";
|
|
3819
3949
|
import { layoutDirectionPropTypeUtil, sizePropTypeUtil as sizePropTypeUtil4 } from "@elementor/editor-props";
|
|
3820
3950
|
import { useActiveBreakpoint as useActiveBreakpoint3 } from "@elementor/editor-responsive";
|
|
3821
3951
|
import { DetachIcon as DetachIcon2, LinkIcon as LinkIcon2 } from "@elementor/icons";
|
|
@@ -3841,7 +3971,7 @@ var GapControl = ({ label }) => {
|
|
|
3841
3971
|
}
|
|
3842
3972
|
return true;
|
|
3843
3973
|
};
|
|
3844
|
-
const [isLinked, setIsLinked] =
|
|
3974
|
+
const [isLinked, setIsLinked] = useState12(() => inferIsLinked());
|
|
3845
3975
|
const activeBreakpoint = useActiveBreakpoint3();
|
|
3846
3976
|
useLayoutEffect2(() => {
|
|
3847
3977
|
setIsLinked(inferIsLinked());
|
|
@@ -3877,7 +4007,7 @@ var GapControl = ({ label }) => {
|
|
|
3877
4007
|
placeholder: directionPlaceholder
|
|
3878
4008
|
};
|
|
3879
4009
|
const hasPlaceholders = !masterValue && (directionPlaceholder || masterPlaceholder);
|
|
3880
|
-
return /* @__PURE__ */
|
|
4010
|
+
return /* @__PURE__ */ React69.createElement(PropProvider, { ...propProviderProps }, /* @__PURE__ */ React69.createElement(Stack11, { direction: "row", gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React69.createElement(ControlLabel, null, label), /* @__PURE__ */ React69.createElement(Tooltip7, { title: isLinked ? unlinkedLabel : linkedLabel, placement: "top" }, /* @__PURE__ */ React69.createElement(
|
|
3881
4011
|
StyledToggleButton,
|
|
3882
4012
|
{
|
|
3883
4013
|
"aria-label": isLinked ? unlinkedLabel : linkedLabel,
|
|
@@ -3889,8 +4019,8 @@ var GapControl = ({ label }) => {
|
|
|
3889
4019
|
disabled,
|
|
3890
4020
|
isPlaceholder: hasPlaceholders
|
|
3891
4021
|
},
|
|
3892
|
-
/* @__PURE__ */
|
|
3893
|
-
))), /* @__PURE__ */
|
|
4022
|
+
/* @__PURE__ */ React69.createElement(LinkedIcon, { fontSize: "tiny" })
|
|
4023
|
+
))), /* @__PURE__ */ React69.createElement(Stack11, { direction: "row", gap: 2, flexWrap: "nowrap", ref: stackRef }, /* @__PURE__ */ React69.createElement(Grid11, { container: true, gap: 0.75, alignItems: "center" }, /* @__PURE__ */ React69.createElement(Grid11, { item: true, xs: 12 }, /* @__PURE__ */ React69.createElement(ControlFormLabel, null, __25("Column", "elementor"))), /* @__PURE__ */ React69.createElement(Grid11, { item: true, xs: 12 }, /* @__PURE__ */ React69.createElement(
|
|
3894
4024
|
Control4,
|
|
3895
4025
|
{
|
|
3896
4026
|
bind: "column",
|
|
@@ -3898,7 +4028,7 @@ var GapControl = ({ label }) => {
|
|
|
3898
4028
|
isLinked,
|
|
3899
4029
|
anchorRef: stackRef
|
|
3900
4030
|
}
|
|
3901
|
-
))), /* @__PURE__ */
|
|
4031
|
+
))), /* @__PURE__ */ React69.createElement(Grid11, { container: true, gap: 0.75, alignItems: "center" }, /* @__PURE__ */ React69.createElement(Grid11, { item: true, xs: 12 }, /* @__PURE__ */ React69.createElement(ControlFormLabel, null, __25("Row", "elementor"))), /* @__PURE__ */ React69.createElement(Grid11, { item: true, xs: 12 }, /* @__PURE__ */ React69.createElement(
|
|
3902
4032
|
Control4,
|
|
3903
4033
|
{
|
|
3904
4034
|
bind: "row",
|
|
@@ -3915,15 +4045,15 @@ var Control4 = ({
|
|
|
3915
4045
|
anchorRef
|
|
3916
4046
|
}) => {
|
|
3917
4047
|
if (isLinked) {
|
|
3918
|
-
return /* @__PURE__ */
|
|
4048
|
+
return /* @__PURE__ */ React69.createElement(SizeControl, { anchorRef, ariaLabel });
|
|
3919
4049
|
}
|
|
3920
|
-
return /* @__PURE__ */
|
|
4050
|
+
return /* @__PURE__ */ React69.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React69.createElement(SizeControl, { anchorRef, ariaLabel }));
|
|
3921
4051
|
};
|
|
3922
4052
|
|
|
3923
4053
|
// src/controls/aspect-ratio-control.tsx
|
|
3924
|
-
import * as
|
|
3925
|
-
import { useEffect as useEffect10, useState as
|
|
3926
|
-
import { stringPropTypeUtil as
|
|
4054
|
+
import * as React70 from "react";
|
|
4055
|
+
import { useEffect as useEffect10, useState as useState13 } from "react";
|
|
4056
|
+
import { stringPropTypeUtil as stringPropTypeUtil10 } from "@elementor/editor-props";
|
|
3927
4057
|
import { MenuListItem as MenuListItem4 } from "@elementor/editor-ui";
|
|
3928
4058
|
import { ArrowsMoveHorizontalIcon, ArrowsMoveVerticalIcon } from "@elementor/icons";
|
|
3929
4059
|
import { Grid as Grid12, Select as Select3, Stack as Stack12, TextField as TextField8 } from "@elementor/ui";
|
|
@@ -3945,14 +4075,14 @@ var AspectRatioControl = createControl(({ label }) => {
|
|
|
3945
4075
|
setValue: setAspectRatioValue,
|
|
3946
4076
|
disabled,
|
|
3947
4077
|
placeholder: externalPlaceholder
|
|
3948
|
-
} = useBoundProp(
|
|
4078
|
+
} = useBoundProp(stringPropTypeUtil10);
|
|
3949
4079
|
const aspectRatioValue = currentPropValue ?? externalPlaceholder;
|
|
3950
4080
|
const isCustomSelected = aspectRatioValue && !RATIO_OPTIONS.some((option) => option.value === aspectRatioValue);
|
|
3951
4081
|
const [initialWidth, initialHeight] = isCustomSelected ? aspectRatioValue.split("/") : ["", ""];
|
|
3952
|
-
const [isCustom, setIsCustom] =
|
|
3953
|
-
const [customWidth, setCustomWidth] =
|
|
3954
|
-
const [customHeight, setCustomHeight] =
|
|
3955
|
-
const [selectedValue, setSelectedValue] =
|
|
4082
|
+
const [isCustom, setIsCustom] = useState13(isCustomSelected);
|
|
4083
|
+
const [customWidth, setCustomWidth] = useState13(initialWidth);
|
|
4084
|
+
const [customHeight, setCustomHeight] = useState13(initialHeight);
|
|
4085
|
+
const [selectedValue, setSelectedValue] = useState13(
|
|
3956
4086
|
isCustomSelected ? CUSTOM_RATIO : aspectRatioValue || ""
|
|
3957
4087
|
);
|
|
3958
4088
|
useEffect10(() => {
|
|
@@ -3996,7 +4126,7 @@ var AspectRatioControl = createControl(({ label }) => {
|
|
|
3996
4126
|
};
|
|
3997
4127
|
const lookup = currentPropValue ?? externalPlaceholder;
|
|
3998
4128
|
const selectedOption = RATIO_OPTIONS.find((option) => option.value === lookup);
|
|
3999
|
-
return /* @__PURE__ */
|
|
4129
|
+
return /* @__PURE__ */ React70.createElement(ControlActions, null, /* @__PURE__ */ React70.createElement(Stack12, { direction: "column", gap: 2 }, /* @__PURE__ */ React70.createElement(Grid12, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React70.createElement(Grid12, { item: true, xs: 6 }, /* @__PURE__ */ React70.createElement(ControlLabel, null, label)), /* @__PURE__ */ React70.createElement(Grid12, { item: true, xs: 6 }, /* @__PURE__ */ React70.createElement(
|
|
4000
4130
|
Select3,
|
|
4001
4131
|
{
|
|
4002
4132
|
size: "tiny",
|
|
@@ -4009,9 +4139,9 @@ var AspectRatioControl = createControl(({ label }) => {
|
|
|
4009
4139
|
fullWidth: true
|
|
4010
4140
|
},
|
|
4011
4141
|
[...RATIO_OPTIONS, { label: __26("Custom", "elementor"), value: CUSTOM_RATIO }].map(
|
|
4012
|
-
({ label: optionLabel, ...props }) => /* @__PURE__ */
|
|
4142
|
+
({ label: optionLabel, ...props }) => /* @__PURE__ */ React70.createElement(MenuListItem4, { key: props.value, ...props, value: props.value ?? "" }, optionLabel)
|
|
4013
4143
|
)
|
|
4014
|
-
))), isCustom && /* @__PURE__ */
|
|
4144
|
+
))), isCustom && /* @__PURE__ */ React70.createElement(Grid12, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React70.createElement(Grid12, { item: true, xs: 6 }, /* @__PURE__ */ React70.createElement(
|
|
4015
4145
|
TextField8,
|
|
4016
4146
|
{
|
|
4017
4147
|
size: "tiny",
|
|
@@ -4021,10 +4151,10 @@ var AspectRatioControl = createControl(({ label }) => {
|
|
|
4021
4151
|
value: customWidth,
|
|
4022
4152
|
onChange: handleCustomWidthChange,
|
|
4023
4153
|
InputProps: {
|
|
4024
|
-
startAdornment: /* @__PURE__ */
|
|
4154
|
+
startAdornment: /* @__PURE__ */ React70.createElement(ArrowsMoveHorizontalIcon, { fontSize: "tiny" })
|
|
4025
4155
|
}
|
|
4026
4156
|
}
|
|
4027
|
-
)), /* @__PURE__ */
|
|
4157
|
+
)), /* @__PURE__ */ React70.createElement(Grid12, { item: true, xs: 6 }, /* @__PURE__ */ React70.createElement(
|
|
4028
4158
|
TextField8,
|
|
4029
4159
|
{
|
|
4030
4160
|
size: "tiny",
|
|
@@ -4034,25 +4164,25 @@ var AspectRatioControl = createControl(({ label }) => {
|
|
|
4034
4164
|
value: customHeight,
|
|
4035
4165
|
onChange: handleCustomHeightChange,
|
|
4036
4166
|
InputProps: {
|
|
4037
|
-
startAdornment: /* @__PURE__ */
|
|
4167
|
+
startAdornment: /* @__PURE__ */ React70.createElement(ArrowsMoveVerticalIcon, { fontSize: "tiny" })
|
|
4038
4168
|
}
|
|
4039
4169
|
}
|
|
4040
4170
|
)))));
|
|
4041
4171
|
});
|
|
4042
4172
|
|
|
4043
4173
|
// src/controls/svg-media-control.tsx
|
|
4044
|
-
import * as
|
|
4045
|
-
import { useState as
|
|
4174
|
+
import * as React72 from "react";
|
|
4175
|
+
import { useState as useState15 } from "react";
|
|
4046
4176
|
import { useCurrentUserCapabilities } from "@elementor/editor-current-user";
|
|
4047
4177
|
import { svgSrcPropTypeUtil, urlPropTypeUtil as urlPropTypeUtil3 } from "@elementor/editor-props";
|
|
4048
4178
|
import { UploadIcon as UploadIcon2 } from "@elementor/icons";
|
|
4049
|
-
import { Button as Button4, Card as Card2, CardMedia as CardMedia2, CardOverlay as CardOverlay2, CircularProgress as CircularProgress3, Stack as Stack13, styled as
|
|
4179
|
+
import { Button as Button4, Card as Card2, CardMedia as CardMedia2, CardOverlay as CardOverlay2, CircularProgress as CircularProgress3, Stack as Stack13, styled as styled8, ThemeProvider } from "@elementor/ui";
|
|
4050
4180
|
import { useWpMediaAttachment as useWpMediaAttachment2, useWpMediaFrame as useWpMediaFrame2 } from "@elementor/wp-media";
|
|
4051
4181
|
import { __ as __28 } from "@wordpress/i18n";
|
|
4052
4182
|
|
|
4053
4183
|
// src/components/enable-unfiltered-modal.tsx
|
|
4054
|
-
import * as
|
|
4055
|
-
import { useState as
|
|
4184
|
+
import * as React71 from "react";
|
|
4185
|
+
import { useState as useState14 } from "react";
|
|
4056
4186
|
import {
|
|
4057
4187
|
Button as Button3,
|
|
4058
4188
|
CircularProgress as CircularProgress2,
|
|
@@ -4078,7 +4208,7 @@ var ADMIN_FAILED_CONTENT_TEXT_PT2 = __27(
|
|
|
4078
4208
|
var WAIT_FOR_CLOSE_TIMEOUT_MS = 300;
|
|
4079
4209
|
var EnableUnfilteredModal = (props) => {
|
|
4080
4210
|
const { mutateAsync, isPending } = useUpdateUnfilteredFilesUpload();
|
|
4081
|
-
const [isError, setIsError] =
|
|
4211
|
+
const [isError, setIsError] = useState14(false);
|
|
4082
4212
|
const onClose = (enabled) => {
|
|
4083
4213
|
props.onClose(enabled);
|
|
4084
4214
|
setTimeout(() => setIsError(false), WAIT_FOR_CLOSE_TIMEOUT_MS);
|
|
@@ -4096,9 +4226,9 @@ var EnableUnfilteredModal = (props) => {
|
|
|
4096
4226
|
}
|
|
4097
4227
|
};
|
|
4098
4228
|
const dialogProps = { ...props, isPending, handleEnable, isError, onClose };
|
|
4099
|
-
return /* @__PURE__ */
|
|
4229
|
+
return /* @__PURE__ */ React71.createElement(AdminDialog, { ...dialogProps });
|
|
4100
4230
|
};
|
|
4101
|
-
var AdminDialog = ({ open, onClose, handleEnable, isPending, isError }) => /* @__PURE__ */
|
|
4231
|
+
var AdminDialog = ({ open, onClose, handleEnable, isPending, isError }) => /* @__PURE__ */ React71.createElement(Dialog, { open, maxWidth: "sm", onClose: () => onClose(false) }, /* @__PURE__ */ React71.createElement(DialogHeader, { logo: false }, /* @__PURE__ */ React71.createElement(DialogTitle, null, ADMIN_TITLE_TEXT)), /* @__PURE__ */ React71.createElement(Divider3, null), /* @__PURE__ */ React71.createElement(DialogContent, null, /* @__PURE__ */ React71.createElement(DialogContentText, null, isError ? /* @__PURE__ */ React71.createElement(React71.Fragment, null, ADMIN_FAILED_CONTENT_TEXT_PT1, " ", /* @__PURE__ */ React71.createElement("br", null), " ", ADMIN_FAILED_CONTENT_TEXT_PT2) : ADMIN_CONTENT_TEXT)), /* @__PURE__ */ React71.createElement(DialogActions, null, /* @__PURE__ */ React71.createElement(Button3, { size: "medium", color: "secondary", onClick: () => onClose(false) }, __27("Cancel", "elementor")), /* @__PURE__ */ React71.createElement(
|
|
4102
4232
|
Button3,
|
|
4103
4233
|
{
|
|
4104
4234
|
size: "medium",
|
|
@@ -4107,7 +4237,7 @@ var AdminDialog = ({ open, onClose, handleEnable, isPending, isError }) => /* @_
|
|
|
4107
4237
|
color: "primary",
|
|
4108
4238
|
disabled: isPending
|
|
4109
4239
|
},
|
|
4110
|
-
isPending ? /* @__PURE__ */
|
|
4240
|
+
isPending ? /* @__PURE__ */ React71.createElement(CircularProgress2, { size: 24 }) : __27("Enable", "elementor")
|
|
4111
4241
|
)));
|
|
4112
4242
|
|
|
4113
4243
|
// src/controls/svg-media-control.tsx
|
|
@@ -4115,7 +4245,7 @@ var TILE_SIZE = 8;
|
|
|
4115
4245
|
var TILE_WHITE = "transparent";
|
|
4116
4246
|
var TILE_BLACK = "#c1c1c1";
|
|
4117
4247
|
var TILES_GRADIENT_FORMULA = `linear-gradient(45deg, ${TILE_BLACK} 25%, ${TILE_WHITE} 0, ${TILE_WHITE} 75%, ${TILE_BLACK} 0, ${TILE_BLACK})`;
|
|
4118
|
-
var StyledCard =
|
|
4248
|
+
var StyledCard = styled8(Card2)`
|
|
4119
4249
|
background-color: white;
|
|
4120
4250
|
background-image: ${TILES_GRADIENT_FORMULA}, ${TILES_GRADIENT_FORMULA};
|
|
4121
4251
|
background-size: ${TILE_SIZE}px ${TILE_SIZE}px;
|
|
@@ -4124,7 +4254,7 @@ var StyledCard = styled7(Card2)`
|
|
|
4124
4254
|
${TILE_SIZE / 2}px ${TILE_SIZE / 2}px;
|
|
4125
4255
|
border: none;
|
|
4126
4256
|
`;
|
|
4127
|
-
var StyledCardMediaContainer =
|
|
4257
|
+
var StyledCardMediaContainer = styled8(Stack13)`
|
|
4128
4258
|
position: relative;
|
|
4129
4259
|
height: 140px;
|
|
4130
4260
|
object-fit: contain;
|
|
@@ -4142,7 +4272,7 @@ var SvgMediaControl = createControl(() => {
|
|
|
4142
4272
|
const { data: attachment, isFetching } = useWpMediaAttachment2(id?.value || null);
|
|
4143
4273
|
const src = attachment?.url ?? url?.value ?? null;
|
|
4144
4274
|
const { data: allowSvgUpload } = useUnfilteredFilesUpload();
|
|
4145
|
-
const [unfilteredModalOpenState, setUnfilteredModalOpenState] =
|
|
4275
|
+
const [unfilteredModalOpenState, setUnfilteredModalOpenState] = useState15(false);
|
|
4146
4276
|
const { isAdmin } = useCurrentUserCapabilities();
|
|
4147
4277
|
const { open } = useWpMediaFrame2({
|
|
4148
4278
|
mediaTypes: ["svg"],
|
|
@@ -4173,10 +4303,10 @@ var SvgMediaControl = createControl(() => {
|
|
|
4173
4303
|
};
|
|
4174
4304
|
const infotipProps = {
|
|
4175
4305
|
title: __28("Sorry, you can't upload that file yet.", "elementor"),
|
|
4176
|
-
description: /* @__PURE__ */
|
|
4306
|
+
description: /* @__PURE__ */ React72.createElement(React72.Fragment, null, __28("To upload them anyway, ask the site administrator to enable unfiltered", "elementor"), /* @__PURE__ */ React72.createElement("br", null), __28("file uploads.", "elementor")),
|
|
4177
4307
|
isEnabled: !isAdmin
|
|
4178
4308
|
};
|
|
4179
|
-
return /* @__PURE__ */
|
|
4309
|
+
return /* @__PURE__ */ React72.createElement(Stack13, { gap: 1, "aria-label": "SVG Control" }, /* @__PURE__ */ React72.createElement(EnableUnfilteredModal, { open: unfilteredModalOpenState, onClose: onCloseUnfilteredModal }), /* @__PURE__ */ React72.createElement(ControlActions, null, /* @__PURE__ */ React72.createElement(StyledCard, { variant: "outlined" }, /* @__PURE__ */ React72.createElement(StyledCardMediaContainer, null, isFetching ? /* @__PURE__ */ React72.createElement(CircularProgress3, { role: "progressbar" }) : /* @__PURE__ */ React72.createElement(
|
|
4180
4310
|
CardMedia2,
|
|
4181
4311
|
{
|
|
4182
4312
|
component: "img",
|
|
@@ -4184,7 +4314,7 @@ var SvgMediaControl = createControl(() => {
|
|
|
4184
4314
|
alt: __28("Preview SVG", "elementor"),
|
|
4185
4315
|
sx: { maxHeight: "140px", width: "50px" }
|
|
4186
4316
|
}
|
|
4187
|
-
)), /* @__PURE__ */
|
|
4317
|
+
)), /* @__PURE__ */ React72.createElement(
|
|
4188
4318
|
CardOverlay2,
|
|
4189
4319
|
{
|
|
4190
4320
|
sx: {
|
|
@@ -4193,7 +4323,7 @@ var SvgMediaControl = createControl(() => {
|
|
|
4193
4323
|
}
|
|
4194
4324
|
}
|
|
4195
4325
|
},
|
|
4196
|
-
/* @__PURE__ */
|
|
4326
|
+
/* @__PURE__ */ React72.createElement(Stack13, { gap: 1 }, /* @__PURE__ */ React72.createElement(
|
|
4197
4327
|
Button4,
|
|
4198
4328
|
{
|
|
4199
4329
|
size: "tiny",
|
|
@@ -4203,13 +4333,13 @@ var SvgMediaControl = createControl(() => {
|
|
|
4203
4333
|
"aria-label": "Select SVG"
|
|
4204
4334
|
},
|
|
4205
4335
|
__28("Select SVG", "elementor")
|
|
4206
|
-
), /* @__PURE__ */
|
|
4336
|
+
), /* @__PURE__ */ React72.createElement(ConditionalControlInfotip, { ...infotipProps }, /* @__PURE__ */ React72.createElement("span", null, /* @__PURE__ */ React72.createElement(ThemeProvider, { colorScheme: isAdmin ? "light" : "dark" }, /* @__PURE__ */ React72.createElement(
|
|
4207
4337
|
Button4,
|
|
4208
4338
|
{
|
|
4209
4339
|
size: "tiny",
|
|
4210
4340
|
variant: "text",
|
|
4211
4341
|
color: "inherit",
|
|
4212
|
-
startIcon: /* @__PURE__ */
|
|
4342
|
+
startIcon: /* @__PURE__ */ React72.createElement(UploadIcon2, null),
|
|
4213
4343
|
disabled: !isAdmin,
|
|
4214
4344
|
onClick: () => isAdmin && handleClick(MODE_UPLOAD),
|
|
4215
4345
|
"aria-label": "Upload SVG"
|
|
@@ -4220,7 +4350,7 @@ var SvgMediaControl = createControl(() => {
|
|
|
4220
4350
|
});
|
|
4221
4351
|
|
|
4222
4352
|
// src/controls/video-media-control.tsx
|
|
4223
|
-
import * as
|
|
4353
|
+
import * as React73 from "react";
|
|
4224
4354
|
import { videoSrcPropTypeUtil } from "@elementor/editor-props";
|
|
4225
4355
|
import { UploadIcon as UploadIcon3 } from "@elementor/icons";
|
|
4226
4356
|
import { Button as Button5, Card as Card3, CardMedia as CardMedia3, CardOverlay as CardOverlay3, CircularProgress as CircularProgress4, Stack as Stack14 } from "@elementor/ui";
|
|
@@ -4246,7 +4376,7 @@ var VideoMediaControl = createControl(() => {
|
|
|
4246
4376
|
});
|
|
4247
4377
|
}
|
|
4248
4378
|
});
|
|
4249
|
-
return /* @__PURE__ */
|
|
4379
|
+
return /* @__PURE__ */ React73.createElement(ControlActions, null, /* @__PURE__ */ React73.createElement(Card3, { variant: "outlined" }, /* @__PURE__ */ React73.createElement(
|
|
4250
4380
|
CardMedia3,
|
|
4251
4381
|
{
|
|
4252
4382
|
sx: {
|
|
@@ -4261,8 +4391,8 @@ var VideoMediaControl = createControl(() => {
|
|
|
4261
4391
|
alignItems: "center"
|
|
4262
4392
|
}
|
|
4263
4393
|
},
|
|
4264
|
-
/* @__PURE__ */
|
|
4265
|
-
), /* @__PURE__ */
|
|
4394
|
+
/* @__PURE__ */ React73.createElement(VideoPreview, { isFetching, videoUrl })
|
|
4395
|
+
), /* @__PURE__ */ React73.createElement(CardOverlay3, null, /* @__PURE__ */ React73.createElement(Stack14, { gap: 1 }, /* @__PURE__ */ React73.createElement(
|
|
4266
4396
|
Button5,
|
|
4267
4397
|
{
|
|
4268
4398
|
size: "tiny",
|
|
@@ -4271,13 +4401,13 @@ var VideoMediaControl = createControl(() => {
|
|
|
4271
4401
|
onClick: () => open({ mode: "browse" })
|
|
4272
4402
|
},
|
|
4273
4403
|
__29("Select video", "elementor")
|
|
4274
|
-
), /* @__PURE__ */
|
|
4404
|
+
), /* @__PURE__ */ React73.createElement(
|
|
4275
4405
|
Button5,
|
|
4276
4406
|
{
|
|
4277
4407
|
size: "tiny",
|
|
4278
4408
|
variant: "text",
|
|
4279
4409
|
color: "inherit",
|
|
4280
|
-
startIcon: /* @__PURE__ */
|
|
4410
|
+
startIcon: /* @__PURE__ */ React73.createElement(UploadIcon3, null),
|
|
4281
4411
|
onClick: () => open({ mode: "upload" })
|
|
4282
4412
|
},
|
|
4283
4413
|
__29("Upload", "elementor")
|
|
@@ -4285,10 +4415,10 @@ var VideoMediaControl = createControl(() => {
|
|
|
4285
4415
|
});
|
|
4286
4416
|
var VideoPreview = ({ isFetching = false, videoUrl }) => {
|
|
4287
4417
|
if (isFetching) {
|
|
4288
|
-
return /* @__PURE__ */
|
|
4418
|
+
return /* @__PURE__ */ React73.createElement(CircularProgress4, null);
|
|
4289
4419
|
}
|
|
4290
4420
|
if (videoUrl) {
|
|
4291
|
-
return /* @__PURE__ */
|
|
4421
|
+
return /* @__PURE__ */ React73.createElement(
|
|
4292
4422
|
"video",
|
|
4293
4423
|
{
|
|
4294
4424
|
src: videoUrl,
|
|
@@ -4303,24 +4433,24 @@ var VideoPreview = ({ isFetching = false, videoUrl }) => {
|
|
|
4303
4433
|
}
|
|
4304
4434
|
);
|
|
4305
4435
|
}
|
|
4306
|
-
return /* @__PURE__ */
|
|
4436
|
+
return /* @__PURE__ */ React73.createElement("img", { src: PLACEHOLDER_IMAGE, alt: "No video selected" });
|
|
4307
4437
|
};
|
|
4308
4438
|
|
|
4309
4439
|
// src/controls/background-control/background-control.tsx
|
|
4310
|
-
import * as
|
|
4440
|
+
import * as React80 from "react";
|
|
4311
4441
|
import { backgroundPropTypeUtil } from "@elementor/editor-props";
|
|
4312
4442
|
import { Grid as Grid17 } from "@elementor/ui";
|
|
4313
4443
|
import { __ as __35 } from "@wordpress/i18n";
|
|
4314
4444
|
|
|
4315
4445
|
// src/controls/background-control/background-overlay/background-overlay-repeater-control.tsx
|
|
4316
|
-
import * as
|
|
4446
|
+
import * as React79 from "react";
|
|
4317
4447
|
import {
|
|
4318
4448
|
backgroundColorOverlayPropTypeUtil as backgroundColorOverlayPropTypeUtil2,
|
|
4319
4449
|
backgroundImageOverlayPropTypeUtil as backgroundImageOverlayPropTypeUtil2,
|
|
4320
4450
|
backgroundOverlayPropTypeUtil,
|
|
4321
4451
|
colorPropTypeUtil as colorPropTypeUtil3
|
|
4322
4452
|
} from "@elementor/editor-props";
|
|
4323
|
-
import { Box as Box13, CardMedia as CardMedia4, styled as
|
|
4453
|
+
import { Box as Box13, CardMedia as CardMedia4, styled as styled9, Tab, TabPanel, Tabs, UnstableColorIndicator as UnstableColorIndicator3 } from "@elementor/ui";
|
|
4324
4454
|
import { useWpMediaAttachment as useWpMediaAttachment4 } from "@elementor/wp-media";
|
|
4325
4455
|
import { __ as __34 } from "@wordpress/i18n";
|
|
4326
4456
|
|
|
@@ -4329,14 +4459,14 @@ import { parseEnv } from "@elementor/env";
|
|
|
4329
4459
|
var { env } = parseEnv("@elementor/editor-controls");
|
|
4330
4460
|
|
|
4331
4461
|
// src/controls/background-control/background-gradient-color-control.tsx
|
|
4332
|
-
import * as
|
|
4462
|
+
import * as React74 from "react";
|
|
4333
4463
|
import {
|
|
4334
4464
|
backgroundGradientOverlayPropTypeUtil,
|
|
4335
4465
|
colorPropTypeUtil as colorPropTypeUtil2,
|
|
4336
4466
|
colorStopPropTypeUtil,
|
|
4337
4467
|
gradientColorStopPropTypeUtil,
|
|
4338
4468
|
numberPropTypeUtil as numberPropTypeUtil3,
|
|
4339
|
-
stringPropTypeUtil as
|
|
4469
|
+
stringPropTypeUtil as stringPropTypeUtil11
|
|
4340
4470
|
} from "@elementor/editor-props";
|
|
4341
4471
|
import { UnstableGradientBox } from "@elementor/ui";
|
|
4342
4472
|
var BackgroundGradientColorControl = createControl(() => {
|
|
@@ -4344,13 +4474,13 @@ var BackgroundGradientColorControl = createControl(() => {
|
|
|
4344
4474
|
const handleChange = (newValue) => {
|
|
4345
4475
|
const transformedValue = createTransformableValue(newValue);
|
|
4346
4476
|
if (transformedValue.positions) {
|
|
4347
|
-
transformedValue.positions =
|
|
4477
|
+
transformedValue.positions = stringPropTypeUtil11.create(newValue.positions.join(" "));
|
|
4348
4478
|
}
|
|
4349
4479
|
setValue(transformedValue);
|
|
4350
4480
|
};
|
|
4351
4481
|
const createTransformableValue = (newValue) => ({
|
|
4352
4482
|
...newValue,
|
|
4353
|
-
type:
|
|
4483
|
+
type: stringPropTypeUtil11.create(newValue.type),
|
|
4354
4484
|
angle: numberPropTypeUtil3.create(newValue.angle),
|
|
4355
4485
|
stops: gradientColorStopPropTypeUtil.create(
|
|
4356
4486
|
newValue.stops.map(
|
|
@@ -4376,7 +4506,7 @@ var BackgroundGradientColorControl = createControl(() => {
|
|
|
4376
4506
|
positions: positions?.value.split(" ")
|
|
4377
4507
|
};
|
|
4378
4508
|
};
|
|
4379
|
-
return /* @__PURE__ */
|
|
4509
|
+
return /* @__PURE__ */ React74.createElement(
|
|
4380
4510
|
UnstableGradientBox,
|
|
4381
4511
|
{
|
|
4382
4512
|
sx: { width: "auto", padding: 1.5 },
|
|
@@ -4386,7 +4516,7 @@ var BackgroundGradientColorControl = createControl(() => {
|
|
|
4386
4516
|
);
|
|
4387
4517
|
});
|
|
4388
4518
|
var initialBackgroundGradientOverlay = backgroundGradientOverlayPropTypeUtil.create({
|
|
4389
|
-
type:
|
|
4519
|
+
type: stringPropTypeUtil11.create("linear"),
|
|
4390
4520
|
angle: numberPropTypeUtil3.create(180),
|
|
4391
4521
|
stops: gradientColorStopPropTypeUtil.create([
|
|
4392
4522
|
colorStopPropTypeUtil.create({
|
|
@@ -4401,7 +4531,7 @@ var initialBackgroundGradientOverlay = backgroundGradientOverlayPropTypeUtil.cre
|
|
|
4401
4531
|
});
|
|
4402
4532
|
|
|
4403
4533
|
// src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-attachment.tsx
|
|
4404
|
-
import * as
|
|
4534
|
+
import * as React75 from "react";
|
|
4405
4535
|
import { PinIcon, PinnedOffIcon } from "@elementor/icons";
|
|
4406
4536
|
import { Grid as Grid13 } from "@elementor/ui";
|
|
4407
4537
|
import { __ as __30 } from "@wordpress/i18n";
|
|
@@ -4409,24 +4539,24 @@ var attachmentControlOptions = [
|
|
|
4409
4539
|
{
|
|
4410
4540
|
value: "fixed",
|
|
4411
4541
|
label: __30("Fixed", "elementor"),
|
|
4412
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
4542
|
+
renderContent: ({ size }) => /* @__PURE__ */ React75.createElement(PinIcon, { fontSize: size }),
|
|
4413
4543
|
showTooltip: true
|
|
4414
4544
|
},
|
|
4415
4545
|
{
|
|
4416
4546
|
value: "scroll",
|
|
4417
4547
|
label: __30("Scroll", "elementor"),
|
|
4418
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
4548
|
+
renderContent: ({ size }) => /* @__PURE__ */ React75.createElement(PinnedOffIcon, { fontSize: size }),
|
|
4419
4549
|
showTooltip: true
|
|
4420
4550
|
}
|
|
4421
4551
|
];
|
|
4422
4552
|
var BackgroundImageOverlayAttachment = () => {
|
|
4423
|
-
return /* @__PURE__ */
|
|
4553
|
+
return /* @__PURE__ */ React75.createElement(PopoverGridContainer, null, /* @__PURE__ */ React75.createElement(Grid13, { item: true, xs: 6 }, /* @__PURE__ */ React75.createElement(ControlFormLabel, null, __30("Attachment", "elementor"))), /* @__PURE__ */ React75.createElement(Grid13, { item: true, xs: 6, sx: { display: "flex", justifyContent: "flex-end", overflow: "hidden" } }, /* @__PURE__ */ React75.createElement(ToggleControl, { options: attachmentControlOptions })));
|
|
4424
4554
|
};
|
|
4425
4555
|
|
|
4426
4556
|
// src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-position.tsx
|
|
4427
|
-
import * as
|
|
4557
|
+
import * as React76 from "react";
|
|
4428
4558
|
import { useRef as useRef11 } from "react";
|
|
4429
|
-
import { backgroundImagePositionOffsetPropTypeUtil, stringPropTypeUtil as
|
|
4559
|
+
import { backgroundImagePositionOffsetPropTypeUtil, stringPropTypeUtil as stringPropTypeUtil12 } from "@elementor/editor-props";
|
|
4430
4560
|
import { MenuListItem as MenuListItem5 } from "@elementor/editor-ui";
|
|
4431
4561
|
import { LetterXIcon, LetterYIcon } from "@elementor/icons";
|
|
4432
4562
|
import { Grid as Grid14, Select as Select4 } from "@elementor/ui";
|
|
@@ -4445,7 +4575,7 @@ var backgroundPositionOptions = [
|
|
|
4445
4575
|
];
|
|
4446
4576
|
var BackgroundImageOverlayPosition = () => {
|
|
4447
4577
|
const backgroundImageOffsetContext = useBoundProp(backgroundImagePositionOffsetPropTypeUtil);
|
|
4448
|
-
const stringPropContext = useBoundProp(
|
|
4578
|
+
const stringPropContext = useBoundProp(stringPropTypeUtil12);
|
|
4449
4579
|
const isCustom = !!backgroundImageOffsetContext.value;
|
|
4450
4580
|
const rowRef = useRef11(null);
|
|
4451
4581
|
const handlePositionChange = (event) => {
|
|
@@ -4456,7 +4586,7 @@ var BackgroundImageOverlayPosition = () => {
|
|
|
4456
4586
|
stringPropContext.setValue(value);
|
|
4457
4587
|
}
|
|
4458
4588
|
};
|
|
4459
|
-
return /* @__PURE__ */
|
|
4589
|
+
return /* @__PURE__ */ React76.createElement(Grid14, { container: true, spacing: 1.5 }, /* @__PURE__ */ React76.createElement(Grid14, { item: true, xs: 12 }, /* @__PURE__ */ React76.createElement(PopoverGridContainer, null, /* @__PURE__ */ React76.createElement(Grid14, { item: true, xs: 6 }, /* @__PURE__ */ React76.createElement(ControlFormLabel, null, __31("Position", "elementor"))), /* @__PURE__ */ React76.createElement(Grid14, { item: true, xs: 6, sx: { display: "flex", justifyContent: "flex-end", overflow: "hidden" } }, /* @__PURE__ */ React76.createElement(ControlActions, null, /* @__PURE__ */ React76.createElement(
|
|
4460
4590
|
Select4,
|
|
4461
4591
|
{
|
|
4462
4592
|
fullWidth: true,
|
|
@@ -4465,18 +4595,18 @@ var BackgroundImageOverlayPosition = () => {
|
|
|
4465
4595
|
disabled: stringPropContext.disabled,
|
|
4466
4596
|
value: (backgroundImageOffsetContext.value ? "custom" : stringPropContext.value) ?? ""
|
|
4467
4597
|
},
|
|
4468
|
-
backgroundPositionOptions.map(({ label, value }) => /* @__PURE__ */
|
|
4469
|
-
))))), isCustom ? /* @__PURE__ */
|
|
4598
|
+
backgroundPositionOptions.map(({ label, value }) => /* @__PURE__ */ React76.createElement(MenuListItem5, { key: value, value: value ?? "" }, label))
|
|
4599
|
+
))))), isCustom ? /* @__PURE__ */ React76.createElement(PropProvider, { ...backgroundImageOffsetContext }, /* @__PURE__ */ React76.createElement(Grid14, { item: true, xs: 12 }, /* @__PURE__ */ React76.createElement(Grid14, { container: true, spacing: 1.5, ref: rowRef }, /* @__PURE__ */ React76.createElement(Grid14, { item: true, xs: 6 }, /* @__PURE__ */ React76.createElement(PropKeyProvider, { bind: "x" }, /* @__PURE__ */ React76.createElement(
|
|
4470
4600
|
SizeControl,
|
|
4471
4601
|
{
|
|
4472
|
-
startIcon: /* @__PURE__ */
|
|
4602
|
+
startIcon: /* @__PURE__ */ React76.createElement(LetterXIcon, { fontSize: "tiny" }),
|
|
4473
4603
|
anchorRef: rowRef,
|
|
4474
4604
|
min: -Number.MAX_SAFE_INTEGER
|
|
4475
4605
|
}
|
|
4476
|
-
))), /* @__PURE__ */
|
|
4606
|
+
))), /* @__PURE__ */ React76.createElement(Grid14, { item: true, xs: 6 }, /* @__PURE__ */ React76.createElement(PropKeyProvider, { bind: "y" }, /* @__PURE__ */ React76.createElement(
|
|
4477
4607
|
SizeControl,
|
|
4478
4608
|
{
|
|
4479
|
-
startIcon: /* @__PURE__ */
|
|
4609
|
+
startIcon: /* @__PURE__ */ React76.createElement(LetterYIcon, { fontSize: "tiny" }),
|
|
4480
4610
|
anchorRef: rowRef,
|
|
4481
4611
|
min: -Number.MAX_SAFE_INTEGER
|
|
4482
4612
|
}
|
|
@@ -4484,7 +4614,7 @@ var BackgroundImageOverlayPosition = () => {
|
|
|
4484
4614
|
};
|
|
4485
4615
|
|
|
4486
4616
|
// src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-repeat.tsx
|
|
4487
|
-
import * as
|
|
4617
|
+
import * as React77 from "react";
|
|
4488
4618
|
import { DotsHorizontalIcon, DotsVerticalIcon, GridDotsIcon, XIcon as XIcon3 } from "@elementor/icons";
|
|
4489
4619
|
import { Grid as Grid15 } from "@elementor/ui";
|
|
4490
4620
|
import { __ as __32 } from "@wordpress/i18n";
|
|
@@ -4492,36 +4622,36 @@ var repeatControlOptions = [
|
|
|
4492
4622
|
{
|
|
4493
4623
|
value: "repeat",
|
|
4494
4624
|
label: __32("Repeat", "elementor"),
|
|
4495
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
4625
|
+
renderContent: ({ size }) => /* @__PURE__ */ React77.createElement(GridDotsIcon, { fontSize: size }),
|
|
4496
4626
|
showTooltip: true
|
|
4497
4627
|
},
|
|
4498
4628
|
{
|
|
4499
4629
|
value: "repeat-x",
|
|
4500
4630
|
label: __32("Repeat-x", "elementor"),
|
|
4501
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
4631
|
+
renderContent: ({ size }) => /* @__PURE__ */ React77.createElement(DotsHorizontalIcon, { fontSize: size }),
|
|
4502
4632
|
showTooltip: true
|
|
4503
4633
|
},
|
|
4504
4634
|
{
|
|
4505
4635
|
value: "repeat-y",
|
|
4506
4636
|
label: __32("Repeat-y", "elementor"),
|
|
4507
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
4637
|
+
renderContent: ({ size }) => /* @__PURE__ */ React77.createElement(DotsVerticalIcon, { fontSize: size }),
|
|
4508
4638
|
showTooltip: true
|
|
4509
4639
|
},
|
|
4510
4640
|
{
|
|
4511
4641
|
value: "no-repeat",
|
|
4512
4642
|
label: __32("No-repeat", "elementor"),
|
|
4513
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
4643
|
+
renderContent: ({ size }) => /* @__PURE__ */ React77.createElement(XIcon3, { fontSize: size }),
|
|
4514
4644
|
showTooltip: true
|
|
4515
4645
|
}
|
|
4516
4646
|
];
|
|
4517
4647
|
var BackgroundImageOverlayRepeat = () => {
|
|
4518
|
-
return /* @__PURE__ */
|
|
4648
|
+
return /* @__PURE__ */ React77.createElement(PopoverGridContainer, null, /* @__PURE__ */ React77.createElement(Grid15, { item: true, xs: 6 }, /* @__PURE__ */ React77.createElement(ControlFormLabel, null, __32("Repeat", "elementor"))), /* @__PURE__ */ React77.createElement(Grid15, { item: true, xs: 6, sx: { display: "flex", justifyContent: "flex-end" } }, /* @__PURE__ */ React77.createElement(ToggleControl, { options: repeatControlOptions })));
|
|
4519
4649
|
};
|
|
4520
4650
|
|
|
4521
4651
|
// src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-size.tsx
|
|
4522
|
-
import * as
|
|
4652
|
+
import * as React78 from "react";
|
|
4523
4653
|
import { useRef as useRef12 } from "react";
|
|
4524
|
-
import { backgroundImageSizeScalePropTypeUtil, stringPropTypeUtil as
|
|
4654
|
+
import { backgroundImageSizeScalePropTypeUtil, stringPropTypeUtil as stringPropTypeUtil13 } from "@elementor/editor-props";
|
|
4525
4655
|
import {
|
|
4526
4656
|
ArrowBarBothIcon,
|
|
4527
4657
|
ArrowsMaximizeIcon,
|
|
@@ -4536,31 +4666,31 @@ var sizeControlOptions = [
|
|
|
4536
4666
|
{
|
|
4537
4667
|
value: "auto",
|
|
4538
4668
|
label: __33("Auto", "elementor"),
|
|
4539
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
4669
|
+
renderContent: ({ size }) => /* @__PURE__ */ React78.createElement(LetterAIcon, { fontSize: size }),
|
|
4540
4670
|
showTooltip: true
|
|
4541
4671
|
},
|
|
4542
4672
|
{
|
|
4543
4673
|
value: "cover",
|
|
4544
4674
|
label: __33("Cover", "elementor"),
|
|
4545
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
4675
|
+
renderContent: ({ size }) => /* @__PURE__ */ React78.createElement(ArrowsMaximizeIcon, { fontSize: size }),
|
|
4546
4676
|
showTooltip: true
|
|
4547
4677
|
},
|
|
4548
4678
|
{
|
|
4549
4679
|
value: "contain",
|
|
4550
4680
|
label: __33("Contain", "elementor"),
|
|
4551
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
4681
|
+
renderContent: ({ size }) => /* @__PURE__ */ React78.createElement(ArrowBarBothIcon, { fontSize: size }),
|
|
4552
4682
|
showTooltip: true
|
|
4553
4683
|
},
|
|
4554
4684
|
{
|
|
4555
4685
|
value: "custom",
|
|
4556
4686
|
label: __33("Custom", "elementor"),
|
|
4557
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
4687
|
+
renderContent: ({ size }) => /* @__PURE__ */ React78.createElement(PencilIcon, { fontSize: size }),
|
|
4558
4688
|
showTooltip: true
|
|
4559
4689
|
}
|
|
4560
4690
|
];
|
|
4561
4691
|
var BackgroundImageOverlaySize = () => {
|
|
4562
4692
|
const backgroundImageScaleContext = useBoundProp(backgroundImageSizeScalePropTypeUtil);
|
|
4563
|
-
const stringPropContext = useBoundProp(
|
|
4693
|
+
const stringPropContext = useBoundProp(stringPropTypeUtil13);
|
|
4564
4694
|
const isCustom = !!backgroundImageScaleContext.value;
|
|
4565
4695
|
const rowRef = useRef12(null);
|
|
4566
4696
|
const handleSizeChange = (size) => {
|
|
@@ -4570,7 +4700,7 @@ var BackgroundImageOverlaySize = () => {
|
|
|
4570
4700
|
stringPropContext.setValue(size);
|
|
4571
4701
|
}
|
|
4572
4702
|
};
|
|
4573
|
-
return /* @__PURE__ */
|
|
4703
|
+
return /* @__PURE__ */ React78.createElement(Grid16, { container: true, spacing: 1.5 }, /* @__PURE__ */ React78.createElement(Grid16, { item: true, xs: 12 }, /* @__PURE__ */ React78.createElement(PopoverGridContainer, null, /* @__PURE__ */ React78.createElement(Grid16, { item: true, xs: 6 }, /* @__PURE__ */ React78.createElement(ControlFormLabel, null, __33("Size", "elementor"))), /* @__PURE__ */ React78.createElement(Grid16, { item: true, xs: 6, sx: { display: "flex", justifyContent: "flex-end" } }, /* @__PURE__ */ React78.createElement(
|
|
4574
4704
|
ControlToggleButtonGroup,
|
|
4575
4705
|
{
|
|
4576
4706
|
exclusive: true,
|
|
@@ -4579,17 +4709,17 @@ var BackgroundImageOverlaySize = () => {
|
|
|
4579
4709
|
disabled: stringPropContext.disabled,
|
|
4580
4710
|
value: backgroundImageScaleContext.value ? "custom" : stringPropContext.value
|
|
4581
4711
|
}
|
|
4582
|
-
)))), isCustom ? /* @__PURE__ */
|
|
4712
|
+
)))), isCustom ? /* @__PURE__ */ React78.createElement(PropProvider, { ...backgroundImageScaleContext }, /* @__PURE__ */ React78.createElement(Grid16, { item: true, xs: 12, ref: rowRef }, /* @__PURE__ */ React78.createElement(PopoverGridContainer, null, /* @__PURE__ */ React78.createElement(Grid16, { item: true, xs: 6 }, /* @__PURE__ */ React78.createElement(PropKeyProvider, { bind: "width" }, /* @__PURE__ */ React78.createElement(
|
|
4583
4713
|
SizeControl,
|
|
4584
4714
|
{
|
|
4585
|
-
startIcon: /* @__PURE__ */
|
|
4715
|
+
startIcon: /* @__PURE__ */ React78.createElement(ArrowsMoveHorizontalIcon2, { fontSize: "tiny" }),
|
|
4586
4716
|
extendedOptions: ["auto"],
|
|
4587
4717
|
anchorRef: rowRef
|
|
4588
4718
|
}
|
|
4589
|
-
))), /* @__PURE__ */
|
|
4719
|
+
))), /* @__PURE__ */ React78.createElement(Grid16, { item: true, xs: 6 }, /* @__PURE__ */ React78.createElement(PropKeyProvider, { bind: "height" }, /* @__PURE__ */ React78.createElement(
|
|
4590
4720
|
SizeControl,
|
|
4591
4721
|
{
|
|
4592
|
-
startIcon: /* @__PURE__ */
|
|
4722
|
+
startIcon: /* @__PURE__ */ React78.createElement(ArrowsMoveVerticalIcon2, { fontSize: "tiny" }),
|
|
4593
4723
|
extendedOptions: ["auto"],
|
|
4594
4724
|
anchorRef: rowRef
|
|
4595
4725
|
}
|
|
@@ -4697,22 +4827,22 @@ var backgroundResolutionOptions = [
|
|
|
4697
4827
|
];
|
|
4698
4828
|
var BackgroundOverlayRepeaterControl = createControl(() => {
|
|
4699
4829
|
const { propType, value: overlayValues, setValue } = useBoundProp(backgroundOverlayPropTypeUtil);
|
|
4700
|
-
return /* @__PURE__ */
|
|
4830
|
+
return /* @__PURE__ */ React79.createElement(PropProvider, { propType, value: overlayValues, setValue }, /* @__PURE__ */ React79.createElement(
|
|
4701
4831
|
ControlRepeater,
|
|
4702
4832
|
{
|
|
4703
4833
|
initial: getInitialBackgroundOverlay(),
|
|
4704
4834
|
propTypeUtil: backgroundOverlayPropTypeUtil
|
|
4705
4835
|
},
|
|
4706
|
-
/* @__PURE__ */
|
|
4707
|
-
/* @__PURE__ */
|
|
4836
|
+
/* @__PURE__ */ React79.createElement(RepeaterHeader, { label: __34("Overlay", "elementor") }, /* @__PURE__ */ React79.createElement(TooltipAddItemAction, { newItemIndex: 0 })),
|
|
4837
|
+
/* @__PURE__ */ React79.createElement(ItemsContainer, null, /* @__PURE__ */ React79.createElement(
|
|
4708
4838
|
Item,
|
|
4709
4839
|
{
|
|
4710
4840
|
Icon: ItemIcon2,
|
|
4711
4841
|
Label: ItemLabel2,
|
|
4712
|
-
actions: /* @__PURE__ */
|
|
4842
|
+
actions: /* @__PURE__ */ React79.createElement(React79.Fragment, null, /* @__PURE__ */ React79.createElement(DuplicateItemAction, null), /* @__PURE__ */ React79.createElement(DisableItemAction, null), /* @__PURE__ */ React79.createElement(RemoveItemAction, null))
|
|
4713
4843
|
}
|
|
4714
4844
|
)),
|
|
4715
|
-
/* @__PURE__ */
|
|
4845
|
+
/* @__PURE__ */ React79.createElement(EditItemPopover, null, /* @__PURE__ */ React79.createElement(ItemContent, null))
|
|
4716
4846
|
));
|
|
4717
4847
|
});
|
|
4718
4848
|
var ItemContent = () => {
|
|
@@ -4722,7 +4852,7 @@ var ItemContent = () => {
|
|
|
4722
4852
|
gradient: initialBackgroundGradientOverlay.value
|
|
4723
4853
|
});
|
|
4724
4854
|
const { rowRef } = useRepeaterContext();
|
|
4725
|
-
return /* @__PURE__ */
|
|
4855
|
+
return /* @__PURE__ */ React79.createElement(Box13, { sx: { width: "100%" } }, /* @__PURE__ */ React79.createElement(Box13, { sx: { borderBottom: 1, borderColor: "divider" } }, /* @__PURE__ */ React79.createElement(
|
|
4726
4856
|
Tabs,
|
|
4727
4857
|
{
|
|
4728
4858
|
size: "small",
|
|
@@ -4730,19 +4860,19 @@ var ItemContent = () => {
|
|
|
4730
4860
|
...getTabsProps(),
|
|
4731
4861
|
"aria-label": __34("Background Overlay", "elementor")
|
|
4732
4862
|
},
|
|
4733
|
-
/* @__PURE__ */
|
|
4734
|
-
/* @__PURE__ */
|
|
4735
|
-
/* @__PURE__ */
|
|
4736
|
-
)), /* @__PURE__ */
|
|
4863
|
+
/* @__PURE__ */ React79.createElement(Tab, { label: __34("Image", "elementor"), ...getTabProps("image") }),
|
|
4864
|
+
/* @__PURE__ */ React79.createElement(Tab, { label: __34("Gradient", "elementor"), ...getTabProps("gradient") }),
|
|
4865
|
+
/* @__PURE__ */ React79.createElement(Tab, { label: __34("Color", "elementor"), ...getTabProps("color") })
|
|
4866
|
+
)), /* @__PURE__ */ React79.createElement(TabPanel, { sx: { p: 1.5 }, ...getTabPanelProps("image") }, /* @__PURE__ */ React79.createElement(PopoverContent, null, /* @__PURE__ */ React79.createElement(ImageOverlayContent, null))), /* @__PURE__ */ React79.createElement(TabPanel, { sx: { p: 1.5 }, ...getTabPanelProps("gradient") }, /* @__PURE__ */ React79.createElement(BackgroundGradientColorControl, null)), /* @__PURE__ */ React79.createElement(TabPanel, { sx: { p: 1.5 }, ...getTabPanelProps("color") }, /* @__PURE__ */ React79.createElement(PopoverContent, null, /* @__PURE__ */ React79.createElement(ColorOverlayContent, { anchorEl: rowRef }))));
|
|
4737
4867
|
};
|
|
4738
4868
|
var ItemIcon2 = ({ value }) => {
|
|
4739
4869
|
switch (value.$$type) {
|
|
4740
4870
|
case "background-image-overlay":
|
|
4741
|
-
return /* @__PURE__ */
|
|
4871
|
+
return /* @__PURE__ */ React79.createElement(ItemIconImage, { value });
|
|
4742
4872
|
case "background-color-overlay":
|
|
4743
|
-
return /* @__PURE__ */
|
|
4873
|
+
return /* @__PURE__ */ React79.createElement(ItemIconColor, { value });
|
|
4744
4874
|
case "background-gradient-overlay":
|
|
4745
|
-
return /* @__PURE__ */
|
|
4875
|
+
return /* @__PURE__ */ React79.createElement(ItemIconGradient, { value });
|
|
4746
4876
|
default:
|
|
4747
4877
|
return null;
|
|
4748
4878
|
}
|
|
@@ -4755,11 +4885,11 @@ var extractColorFrom = (prop) => {
|
|
|
4755
4885
|
};
|
|
4756
4886
|
var ItemIconColor = ({ value: prop }) => {
|
|
4757
4887
|
const color = extractColorFrom(prop);
|
|
4758
|
-
return /* @__PURE__ */
|
|
4888
|
+
return /* @__PURE__ */ React79.createElement(StyledUnstableColorIndicator3, { size: "inherit", component: "span", value: color });
|
|
4759
4889
|
};
|
|
4760
4890
|
var ItemIconImage = ({ value }) => {
|
|
4761
4891
|
const { imageUrl } = useImage(value);
|
|
4762
|
-
return /* @__PURE__ */
|
|
4892
|
+
return /* @__PURE__ */ React79.createElement(
|
|
4763
4893
|
CardMedia4,
|
|
4764
4894
|
{
|
|
4765
4895
|
image: imageUrl,
|
|
@@ -4774,43 +4904,43 @@ var ItemIconImage = ({ value }) => {
|
|
|
4774
4904
|
};
|
|
4775
4905
|
var ItemIconGradient = ({ value }) => {
|
|
4776
4906
|
const gradient = getGradientValue(value);
|
|
4777
|
-
return /* @__PURE__ */
|
|
4907
|
+
return /* @__PURE__ */ React79.createElement(StyledUnstableColorIndicator3, { size: "inherit", component: "span", value: gradient });
|
|
4778
4908
|
};
|
|
4779
4909
|
var ItemLabel2 = ({ value }) => {
|
|
4780
4910
|
switch (value.$$type) {
|
|
4781
4911
|
case "background-image-overlay":
|
|
4782
|
-
return /* @__PURE__ */
|
|
4912
|
+
return /* @__PURE__ */ React79.createElement(ItemLabelImage, { value });
|
|
4783
4913
|
case "background-color-overlay":
|
|
4784
|
-
return /* @__PURE__ */
|
|
4914
|
+
return /* @__PURE__ */ React79.createElement(ItemLabelColor, { value });
|
|
4785
4915
|
case "background-gradient-overlay":
|
|
4786
|
-
return /* @__PURE__ */
|
|
4916
|
+
return /* @__PURE__ */ React79.createElement(ItemLabelGradient, { value });
|
|
4787
4917
|
default:
|
|
4788
4918
|
return null;
|
|
4789
4919
|
}
|
|
4790
4920
|
};
|
|
4791
4921
|
var ItemLabelColor = ({ value: prop }) => {
|
|
4792
4922
|
const color = extractColorFrom(prop);
|
|
4793
|
-
return /* @__PURE__ */
|
|
4923
|
+
return /* @__PURE__ */ React79.createElement("span", null, color);
|
|
4794
4924
|
};
|
|
4795
4925
|
var ItemLabelImage = ({ value }) => {
|
|
4796
4926
|
const { imageTitle } = useImage(value);
|
|
4797
|
-
return /* @__PURE__ */
|
|
4927
|
+
return /* @__PURE__ */ React79.createElement("span", null, imageTitle);
|
|
4798
4928
|
};
|
|
4799
4929
|
var ItemLabelGradient = ({ value }) => {
|
|
4800
4930
|
if (value.value.type.value === "linear") {
|
|
4801
|
-
return /* @__PURE__ */
|
|
4931
|
+
return /* @__PURE__ */ React79.createElement("span", null, __34("Linear Gradient", "elementor"));
|
|
4802
4932
|
}
|
|
4803
|
-
return /* @__PURE__ */
|
|
4933
|
+
return /* @__PURE__ */ React79.createElement("span", null, __34("Radial Gradient", "elementor"));
|
|
4804
4934
|
};
|
|
4805
4935
|
var ColorOverlayContent = ({ anchorEl }) => {
|
|
4806
4936
|
const propContext = useBoundProp(backgroundColorOverlayPropTypeUtil2);
|
|
4807
|
-
return /* @__PURE__ */
|
|
4937
|
+
return /* @__PURE__ */ React79.createElement(PropProvider, { ...propContext }, /* @__PURE__ */ React79.createElement(PropKeyProvider, { bind: "color" }, /* @__PURE__ */ React79.createElement(ColorControl, { anchorEl })));
|
|
4808
4938
|
};
|
|
4809
4939
|
var ImageOverlayContent = () => {
|
|
4810
4940
|
const propContext = useBoundProp(backgroundImageOverlayPropTypeUtil2);
|
|
4811
|
-
return /* @__PURE__ */
|
|
4941
|
+
return /* @__PURE__ */ React79.createElement(PropProvider, { ...propContext }, /* @__PURE__ */ React79.createElement(PropKeyProvider, { bind: "image" }, /* @__PURE__ */ React79.createElement(ImageControl, { sizes: backgroundResolutionOptions })), /* @__PURE__ */ React79.createElement(PropKeyProvider, { bind: "position" }, /* @__PURE__ */ React79.createElement(BackgroundImageOverlayPosition, null)), /* @__PURE__ */ React79.createElement(PropKeyProvider, { bind: "repeat" }, /* @__PURE__ */ React79.createElement(BackgroundImageOverlayRepeat, null)), /* @__PURE__ */ React79.createElement(PropKeyProvider, { bind: "size" }, /* @__PURE__ */ React79.createElement(BackgroundImageOverlaySize, null)), /* @__PURE__ */ React79.createElement(PropKeyProvider, { bind: "attachment" }, /* @__PURE__ */ React79.createElement(BackgroundImageOverlayAttachment, null)));
|
|
4812
4942
|
};
|
|
4813
|
-
var StyledUnstableColorIndicator3 =
|
|
4943
|
+
var StyledUnstableColorIndicator3 = styled9(UnstableColorIndicator3)(({ theme }) => ({
|
|
4814
4944
|
height: "1rem",
|
|
4815
4945
|
width: "1rem",
|
|
4816
4946
|
borderRadius: `${theme.shape.borderRadius / 2}px`
|
|
@@ -4856,17 +4986,17 @@ var colorLabel = __35("Color", "elementor");
|
|
|
4856
4986
|
var clipLabel = __35("Clipping", "elementor");
|
|
4857
4987
|
var BackgroundControl = createControl(() => {
|
|
4858
4988
|
const propContext = useBoundProp(backgroundPropTypeUtil);
|
|
4859
|
-
return /* @__PURE__ */
|
|
4989
|
+
return /* @__PURE__ */ React80.createElement(PropProvider, { ...propContext }, /* @__PURE__ */ React80.createElement(PropKeyProvider, { bind: "background-overlay" }, /* @__PURE__ */ React80.createElement(BackgroundOverlayRepeaterControl, null)), /* @__PURE__ */ React80.createElement(BackgroundColorField, null), /* @__PURE__ */ React80.createElement(BackgroundClipField, null));
|
|
4860
4990
|
});
|
|
4861
4991
|
var BackgroundColorField = () => {
|
|
4862
|
-
return /* @__PURE__ */
|
|
4992
|
+
return /* @__PURE__ */ React80.createElement(PropKeyProvider, { bind: "color" }, /* @__PURE__ */ React80.createElement(Grid17, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React80.createElement(Grid17, { item: true, xs: 6 }, /* @__PURE__ */ React80.createElement(ControlLabel, null, colorLabel)), /* @__PURE__ */ React80.createElement(Grid17, { item: true, xs: 6 }, /* @__PURE__ */ React80.createElement(ColorControl, null))));
|
|
4863
4993
|
};
|
|
4864
4994
|
var BackgroundClipField = () => {
|
|
4865
|
-
return /* @__PURE__ */
|
|
4995
|
+
return /* @__PURE__ */ React80.createElement(PropKeyProvider, { bind: "clip" }, /* @__PURE__ */ React80.createElement(Grid17, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React80.createElement(Grid17, { item: true, xs: 6 }, /* @__PURE__ */ React80.createElement(ControlLabel, null, clipLabel)), /* @__PURE__ */ React80.createElement(Grid17, { item: true, xs: 6 }, /* @__PURE__ */ React80.createElement(SelectControl, { options: clipOptions }))));
|
|
4866
4996
|
};
|
|
4867
4997
|
|
|
4868
4998
|
// src/controls/repeatable-control.tsx
|
|
4869
|
-
import * as
|
|
4999
|
+
import * as React81 from "react";
|
|
4870
5000
|
import { useMemo as useMemo9 } from "react";
|
|
4871
5001
|
import { createArrayPropUtils } from "@elementor/editor-props";
|
|
4872
5002
|
import { Box as Box14 } from "@elementor/ui";
|
|
@@ -4900,14 +5030,14 @@ var RepeatableControl = createControl(
|
|
|
4900
5030
|
[childControlConfig, placeholder, patternLabel]
|
|
4901
5031
|
);
|
|
4902
5032
|
const { propType, value, setValue } = useBoundProp(childArrayPropTypeUtil2);
|
|
4903
|
-
return /* @__PURE__ */
|
|
5033
|
+
return /* @__PURE__ */ React81.createElement(PropProvider, { propType, value, setValue }, /* @__PURE__ */ React81.createElement(RepeatableControlContext.Provider, { value: contextValue }, /* @__PURE__ */ React81.createElement(
|
|
4904
5034
|
ControlRepeater,
|
|
4905
5035
|
{
|
|
4906
5036
|
initial: childPropTypeUtil.create(initialValues || null),
|
|
4907
5037
|
propTypeUtil: childArrayPropTypeUtil2,
|
|
4908
5038
|
isItemDisabled: isItemDisabled2
|
|
4909
5039
|
},
|
|
4910
|
-
/* @__PURE__ */
|
|
5040
|
+
/* @__PURE__ */ React81.createElement(RepeaterHeader, { label: repeaterLabel }, /* @__PURE__ */ React81.createElement(
|
|
4911
5041
|
TooltipAddItemAction,
|
|
4912
5042
|
{
|
|
4913
5043
|
...addItemTooltipProps,
|
|
@@ -4915,22 +5045,22 @@ var RepeatableControl = createControl(
|
|
|
4915
5045
|
ariaLabel: repeaterLabel
|
|
4916
5046
|
}
|
|
4917
5047
|
)),
|
|
4918
|
-
/* @__PURE__ */
|
|
5048
|
+
/* @__PURE__ */ React81.createElement(ItemsContainer, { isSortable: false }, /* @__PURE__ */ React81.createElement(
|
|
4919
5049
|
Item,
|
|
4920
5050
|
{
|
|
4921
5051
|
Icon: ItemIcon3,
|
|
4922
5052
|
Label: ItemLabel3,
|
|
4923
|
-
actions: /* @__PURE__ */
|
|
5053
|
+
actions: /* @__PURE__ */ React81.createElement(React81.Fragment, null, showDuplicate && /* @__PURE__ */ React81.createElement(DuplicateItemAction, null), showToggle && /* @__PURE__ */ React81.createElement(DisableItemAction, null), /* @__PURE__ */ React81.createElement(RemoveItemAction, null))
|
|
4924
5054
|
}
|
|
4925
5055
|
)),
|
|
4926
|
-
/* @__PURE__ */
|
|
5056
|
+
/* @__PURE__ */ React81.createElement(EditItemPopover, null, /* @__PURE__ */ React81.createElement(Content2, null))
|
|
4927
5057
|
)));
|
|
4928
5058
|
}
|
|
4929
5059
|
);
|
|
4930
|
-
var ItemIcon3 = () => /* @__PURE__ */
|
|
5060
|
+
var ItemIcon3 = () => /* @__PURE__ */ React81.createElement(React81.Fragment, null);
|
|
4931
5061
|
var Content2 = () => {
|
|
4932
5062
|
const { component: ChildControl, props = {} } = useRepeatableControlContext();
|
|
4933
|
-
return /* @__PURE__ */
|
|
5063
|
+
return /* @__PURE__ */ React81.createElement(PopoverContent, { p: 1.5 }, /* @__PURE__ */ React81.createElement(PopoverGridContainer, null, /* @__PURE__ */ React81.createElement(ChildControl, { ...props })));
|
|
4934
5064
|
};
|
|
4935
5065
|
var interpolate = (template, data) => {
|
|
4936
5066
|
if (!data) {
|
|
@@ -5013,7 +5143,7 @@ var ItemLabel3 = ({ value }) => {
|
|
|
5013
5143
|
const label = showPlaceholder ? placeholder : interpolate(patternLabel, value);
|
|
5014
5144
|
const isReadOnly = !!childProps?.readOnly;
|
|
5015
5145
|
const color = getTextColor(isReadOnly, showPlaceholder);
|
|
5016
|
-
return /* @__PURE__ */
|
|
5146
|
+
return /* @__PURE__ */ React81.createElement(Box14, { component: "span", color }, label);
|
|
5017
5147
|
};
|
|
5018
5148
|
var getAllProperties = (pattern) => {
|
|
5019
5149
|
const properties = pattern.match(PLACEHOLDER_REGEX)?.map((match) => match.slice(2, -1)) || [];
|
|
@@ -5021,12 +5151,12 @@ var getAllProperties = (pattern) => {
|
|
|
5021
5151
|
};
|
|
5022
5152
|
|
|
5023
5153
|
// src/controls/key-value-control.tsx
|
|
5024
|
-
import * as
|
|
5025
|
-
import { useMemo as useMemo10, useState as
|
|
5154
|
+
import * as React82 from "react";
|
|
5155
|
+
import { useMemo as useMemo10, useState as useState16 } from "react";
|
|
5026
5156
|
import {
|
|
5027
5157
|
isTransformable,
|
|
5028
5158
|
keyValuePropTypeUtil,
|
|
5029
|
-
stringPropTypeUtil as
|
|
5159
|
+
stringPropTypeUtil as stringPropTypeUtil14
|
|
5030
5160
|
} from "@elementor/editor-props";
|
|
5031
5161
|
import { FormHelperText, FormLabel as FormLabel3, Grid as Grid18 } from "@elementor/ui";
|
|
5032
5162
|
import { __ as __36 } from "@wordpress/i18n";
|
|
@@ -5053,9 +5183,9 @@ var getInitialFieldValue = (fieldValue) => {
|
|
|
5053
5183
|
};
|
|
5054
5184
|
var KeyValueControl = createControl((props = {}) => {
|
|
5055
5185
|
const { value, setValue, ...propContext } = useBoundProp(keyValuePropTypeUtil);
|
|
5056
|
-
const [keyError, setKeyError] =
|
|
5057
|
-
const [valueError, setValueError] =
|
|
5058
|
-
const [sessionState, setSessionState] =
|
|
5186
|
+
const [keyError, setKeyError] = useState16("");
|
|
5187
|
+
const [valueError, setValueError] = useState16("");
|
|
5188
|
+
const [sessionState, setSessionState] = useState16({
|
|
5059
5189
|
key: getInitialFieldValue(value?.key),
|
|
5060
5190
|
value: getInitialFieldValue(value?.value)
|
|
5061
5191
|
});
|
|
@@ -5098,7 +5228,7 @@ var KeyValueControl = createControl((props = {}) => {
|
|
|
5098
5228
|
});
|
|
5099
5229
|
return;
|
|
5100
5230
|
}
|
|
5101
|
-
const extractedValue =
|
|
5231
|
+
const extractedValue = stringPropTypeUtil14.extract(newChangedValue);
|
|
5102
5232
|
setSessionState((prev) => ({
|
|
5103
5233
|
...prev,
|
|
5104
5234
|
[fieldType]: extractedValue
|
|
@@ -5118,14 +5248,14 @@ var KeyValueControl = createControl((props = {}) => {
|
|
|
5118
5248
|
});
|
|
5119
5249
|
}
|
|
5120
5250
|
};
|
|
5121
|
-
return /* @__PURE__ */
|
|
5251
|
+
return /* @__PURE__ */ React82.createElement(PropProvider, { ...propContext, value, setValue: handleChange }, /* @__PURE__ */ React82.createElement(Grid18, { container: true, gap: 1.5 }, /* @__PURE__ */ React82.createElement(Grid18, { item: true, xs: 12, display: "flex", flexDirection: "column" }, /* @__PURE__ */ React82.createElement(FormLabel3, { size: "tiny", sx: { pb: 1 } }, keyLabel), /* @__PURE__ */ React82.createElement(PropKeyProvider, { bind: "key" }, /* @__PURE__ */ React82.createElement(
|
|
5122
5252
|
TextControl,
|
|
5123
5253
|
{
|
|
5124
5254
|
inputValue: props.escapeHtml ? escapeHtmlAttr(sessionState.key) : sessionState.key,
|
|
5125
5255
|
error: !!keyError,
|
|
5126
5256
|
helperText: keyHelper
|
|
5127
5257
|
}
|
|
5128
|
-
)), !!keyError && /* @__PURE__ */
|
|
5258
|
+
)), !!keyError && /* @__PURE__ */ React82.createElement(FormHelperText, { error: true }, keyError)), /* @__PURE__ */ React82.createElement(Grid18, { item: true, xs: 12, display: "flex", flexDirection: "column" }, /* @__PURE__ */ React82.createElement(FormLabel3, { size: "tiny", sx: { pb: 1 } }, valueLabel), /* @__PURE__ */ React82.createElement(PropKeyProvider, { bind: "value" }, /* @__PURE__ */ React82.createElement(
|
|
5129
5259
|
TextControl,
|
|
5130
5260
|
{
|
|
5131
5261
|
inputValue: props.escapeHtml ? escapeHtmlAttr(sessionState.value) : sessionState.value,
|
|
@@ -5133,12 +5263,12 @@ var KeyValueControl = createControl((props = {}) => {
|
|
|
5133
5263
|
inputDisabled: !!keyError,
|
|
5134
5264
|
helperText: valueHelper
|
|
5135
5265
|
}
|
|
5136
|
-
)), !!valueError && /* @__PURE__ */
|
|
5266
|
+
)), !!valueError && /* @__PURE__ */ React82.createElement(FormHelperText, { error: true }, valueError))));
|
|
5137
5267
|
});
|
|
5138
5268
|
|
|
5139
5269
|
// src/controls/position-control.tsx
|
|
5140
|
-
import * as
|
|
5141
|
-
import { positionPropTypeUtil, stringPropTypeUtil as
|
|
5270
|
+
import * as React83 from "react";
|
|
5271
|
+
import { positionPropTypeUtil, stringPropTypeUtil as stringPropTypeUtil15 } from "@elementor/editor-props";
|
|
5142
5272
|
import { MenuListItem as MenuListItem6 } from "@elementor/editor-ui";
|
|
5143
5273
|
import { LetterXIcon as LetterXIcon2, LetterYIcon as LetterYIcon2 } from "@elementor/icons";
|
|
5144
5274
|
import { Grid as Grid19, Select as Select5 } from "@elementor/ui";
|
|
@@ -5157,7 +5287,7 @@ var positionOptions = [
|
|
|
5157
5287
|
];
|
|
5158
5288
|
var PositionControl = () => {
|
|
5159
5289
|
const positionContext = useBoundProp(positionPropTypeUtil);
|
|
5160
|
-
const stringPropContext = useBoundProp(
|
|
5290
|
+
const stringPropContext = useBoundProp(stringPropTypeUtil15);
|
|
5161
5291
|
const isCustom = !!positionContext.value;
|
|
5162
5292
|
const handlePositionChange = (event) => {
|
|
5163
5293
|
const value = event.target.value || null;
|
|
@@ -5167,7 +5297,7 @@ var PositionControl = () => {
|
|
|
5167
5297
|
stringPropContext.setValue(value);
|
|
5168
5298
|
}
|
|
5169
5299
|
};
|
|
5170
|
-
return /* @__PURE__ */
|
|
5300
|
+
return /* @__PURE__ */ React83.createElement(Grid19, { container: true, spacing: 1.5 }, /* @__PURE__ */ React83.createElement(Grid19, { item: true, xs: 12 }, /* @__PURE__ */ React83.createElement(Grid19, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React83.createElement(Grid19, { item: true, xs: 6 }, /* @__PURE__ */ React83.createElement(ControlFormLabel, null, __37("Object position", "elementor"))), /* @__PURE__ */ React83.createElement(Grid19, { item: true, xs: 6, sx: { overflow: "hidden" } }, /* @__PURE__ */ React83.createElement(
|
|
5171
5301
|
Select5,
|
|
5172
5302
|
{
|
|
5173
5303
|
size: "tiny",
|
|
@@ -5176,24 +5306,24 @@ var PositionControl = () => {
|
|
|
5176
5306
|
onChange: handlePositionChange,
|
|
5177
5307
|
fullWidth: true
|
|
5178
5308
|
},
|
|
5179
|
-
positionOptions.map(({ label, value }) => /* @__PURE__ */
|
|
5180
|
-
)))), isCustom && /* @__PURE__ */
|
|
5309
|
+
positionOptions.map(({ label, value }) => /* @__PURE__ */ React83.createElement(MenuListItem6, { key: value, value: value ?? "" }, label))
|
|
5310
|
+
)))), isCustom && /* @__PURE__ */ React83.createElement(PropProvider, { ...positionContext }, /* @__PURE__ */ React83.createElement(Grid19, { item: true, xs: 12 }, /* @__PURE__ */ React83.createElement(Grid19, { container: true, spacing: 1.5 }, /* @__PURE__ */ React83.createElement(Grid19, { item: true, xs: 6 }, /* @__PURE__ */ React83.createElement(PropKeyProvider, { bind: "x" }, /* @__PURE__ */ React83.createElement(
|
|
5181
5311
|
SizeControl,
|
|
5182
5312
|
{
|
|
5183
|
-
startIcon: /* @__PURE__ */
|
|
5313
|
+
startIcon: /* @__PURE__ */ React83.createElement(LetterXIcon2, { fontSize: "tiny" }),
|
|
5184
5314
|
min: -Number.MAX_SAFE_INTEGER
|
|
5185
5315
|
}
|
|
5186
|
-
))), /* @__PURE__ */
|
|
5316
|
+
))), /* @__PURE__ */ React83.createElement(Grid19, { item: true, xs: 6 }, /* @__PURE__ */ React83.createElement(PropKeyProvider, { bind: "y" }, /* @__PURE__ */ React83.createElement(
|
|
5187
5317
|
SizeControl,
|
|
5188
5318
|
{
|
|
5189
|
-
startIcon: /* @__PURE__ */
|
|
5319
|
+
startIcon: /* @__PURE__ */ React83.createElement(LetterYIcon2, { fontSize: "tiny" }),
|
|
5190
5320
|
min: -Number.MAX_SAFE_INTEGER
|
|
5191
5321
|
}
|
|
5192
5322
|
)))))));
|
|
5193
5323
|
};
|
|
5194
5324
|
|
|
5195
5325
|
// src/controls/transform-control/transform-repeater-control.tsx
|
|
5196
|
-
import * as
|
|
5326
|
+
import * as React96 from "react";
|
|
5197
5327
|
import { useRef as useRef21 } from "react";
|
|
5198
5328
|
import { transformFunctionsPropTypeUtil, transformPropTypeUtil } from "@elementor/editor-props";
|
|
5199
5329
|
import { AdjustmentsIcon as AdjustmentsIcon2, InfoCircleFilledIcon as InfoCircleFilledIcon2 } from "@elementor/icons";
|
|
@@ -5252,12 +5382,12 @@ var initialSkewValue = skewTransformPropTypeUtil.create({
|
|
|
5252
5382
|
});
|
|
5253
5383
|
|
|
5254
5384
|
// src/controls/transform-control/transform-content.tsx
|
|
5255
|
-
import * as
|
|
5385
|
+
import * as React90 from "react";
|
|
5256
5386
|
import { Box as Box15, Tab as Tab2, TabPanel as TabPanel2, Tabs as Tabs2 } from "@elementor/ui";
|
|
5257
5387
|
import { __ as __42 } from "@wordpress/i18n";
|
|
5258
5388
|
|
|
5259
5389
|
// src/controls/transform-control/functions/move.tsx
|
|
5260
|
-
import * as
|
|
5390
|
+
import * as React85 from "react";
|
|
5261
5391
|
import { useRef as useRef14 } from "react";
|
|
5262
5392
|
import { moveTransformPropTypeUtil } from "@elementor/editor-props";
|
|
5263
5393
|
import { ArrowDownLeftIcon, ArrowDownSmallIcon, ArrowRightIcon } from "@elementor/icons";
|
|
@@ -5265,11 +5395,11 @@ import { Grid as Grid21 } from "@elementor/ui";
|
|
|
5265
5395
|
import { __ as __38 } from "@wordpress/i18n";
|
|
5266
5396
|
|
|
5267
5397
|
// src/controls/transform-control/functions/axis-row.tsx
|
|
5268
|
-
import * as
|
|
5398
|
+
import * as React84 from "react";
|
|
5269
5399
|
import { Grid as Grid20 } from "@elementor/ui";
|
|
5270
5400
|
var AxisRow = ({ label, bind, startIcon, anchorRef, units: units2, variant = "angle" }) => {
|
|
5271
5401
|
const safeId = label.replace(/\s+/g, "-").toLowerCase();
|
|
5272
|
-
return /* @__PURE__ */
|
|
5402
|
+
return /* @__PURE__ */ React84.createElement(Grid20, { item: true, xs: 12 }, /* @__PURE__ */ React84.createElement(PopoverGridContainer, { ref: anchorRef }, /* @__PURE__ */ React84.createElement(Grid20, { item: true, xs: 6 }, /* @__PURE__ */ React84.createElement(ControlLabel, { htmlFor: safeId }, label)), /* @__PURE__ */ React84.createElement(Grid20, { item: true, xs: 6 }, /* @__PURE__ */ React84.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React84.createElement(
|
|
5273
5403
|
SizeControl,
|
|
5274
5404
|
{
|
|
5275
5405
|
anchorRef,
|
|
@@ -5287,26 +5417,26 @@ var moveAxisControls = [
|
|
|
5287
5417
|
{
|
|
5288
5418
|
label: __38("Move X", "elementor"),
|
|
5289
5419
|
bind: "x",
|
|
5290
|
-
startIcon: /* @__PURE__ */
|
|
5420
|
+
startIcon: /* @__PURE__ */ React85.createElement(ArrowRightIcon, { fontSize: "tiny" }),
|
|
5291
5421
|
units: ["px", "%", "em", "rem", "vw"]
|
|
5292
5422
|
},
|
|
5293
5423
|
{
|
|
5294
5424
|
label: __38("Move Y", "elementor"),
|
|
5295
5425
|
bind: "y",
|
|
5296
|
-
startIcon: /* @__PURE__ */
|
|
5426
|
+
startIcon: /* @__PURE__ */ React85.createElement(ArrowDownSmallIcon, { fontSize: "tiny" }),
|
|
5297
5427
|
units: ["px", "%", "em", "rem", "vh"]
|
|
5298
5428
|
},
|
|
5299
5429
|
{
|
|
5300
5430
|
label: __38("Move Z", "elementor"),
|
|
5301
5431
|
bind: "z",
|
|
5302
|
-
startIcon: /* @__PURE__ */
|
|
5432
|
+
startIcon: /* @__PURE__ */ React85.createElement(ArrowDownLeftIcon, { fontSize: "tiny" }),
|
|
5303
5433
|
units: ["px", "%", "em", "rem", "vw", "vh"]
|
|
5304
5434
|
}
|
|
5305
5435
|
];
|
|
5306
5436
|
var Move = () => {
|
|
5307
5437
|
const context = useBoundProp(moveTransformPropTypeUtil);
|
|
5308
5438
|
const rowRefs = [useRef14(null), useRef14(null), useRef14(null)];
|
|
5309
|
-
return /* @__PURE__ */
|
|
5439
|
+
return /* @__PURE__ */ React85.createElement(Grid21, { container: true, spacing: 1.5 }, /* @__PURE__ */ React85.createElement(PropProvider, { ...context }, /* @__PURE__ */ React85.createElement(PropKeyProvider, { bind: TransformFunctionKeys.move }, moveAxisControls.map((control, index) => /* @__PURE__ */ React85.createElement(
|
|
5310
5440
|
AxisRow,
|
|
5311
5441
|
{
|
|
5312
5442
|
key: control.bind,
|
|
@@ -5319,7 +5449,7 @@ var Move = () => {
|
|
|
5319
5449
|
};
|
|
5320
5450
|
|
|
5321
5451
|
// src/controls/transform-control/functions/rotate.tsx
|
|
5322
|
-
import * as
|
|
5452
|
+
import * as React86 from "react";
|
|
5323
5453
|
import { useRef as useRef15 } from "react";
|
|
5324
5454
|
import { rotateTransformPropTypeUtil as rotateTransformPropTypeUtil2 } from "@elementor/editor-props";
|
|
5325
5455
|
import { Arrow360Icon, RotateClockwiseIcon } from "@elementor/icons";
|
|
@@ -5329,24 +5459,24 @@ var rotateAxisControls = [
|
|
|
5329
5459
|
{
|
|
5330
5460
|
label: __39("Rotate X", "elementor"),
|
|
5331
5461
|
bind: "x",
|
|
5332
|
-
startIcon: /* @__PURE__ */
|
|
5462
|
+
startIcon: /* @__PURE__ */ React86.createElement(Arrow360Icon, { fontSize: "tiny" })
|
|
5333
5463
|
},
|
|
5334
5464
|
{
|
|
5335
5465
|
label: __39("Rotate Y", "elementor"),
|
|
5336
5466
|
bind: "y",
|
|
5337
|
-
startIcon: /* @__PURE__ */
|
|
5467
|
+
startIcon: /* @__PURE__ */ React86.createElement(Arrow360Icon, { fontSize: "tiny", style: { transform: "scaleX(-1) rotate(-90deg)" } })
|
|
5338
5468
|
},
|
|
5339
5469
|
{
|
|
5340
5470
|
label: __39("Rotate Z", "elementor"),
|
|
5341
5471
|
bind: "z",
|
|
5342
|
-
startIcon: /* @__PURE__ */
|
|
5472
|
+
startIcon: /* @__PURE__ */ React86.createElement(RotateClockwiseIcon, { fontSize: "tiny" })
|
|
5343
5473
|
}
|
|
5344
5474
|
];
|
|
5345
5475
|
var rotateUnits = ["deg", "rad", "grad", "turn"];
|
|
5346
5476
|
var Rotate = () => {
|
|
5347
5477
|
const context = useBoundProp(rotateTransformPropTypeUtil2);
|
|
5348
5478
|
const rowRefs = [useRef15(null), useRef15(null), useRef15(null)];
|
|
5349
|
-
return /* @__PURE__ */
|
|
5479
|
+
return /* @__PURE__ */ React86.createElement(Grid22, { container: true, spacing: 1.5 }, /* @__PURE__ */ React86.createElement(PropProvider, { ...context }, /* @__PURE__ */ React86.createElement(PropKeyProvider, { bind: TransformFunctionKeys.rotate }, rotateAxisControls.map((control, index) => /* @__PURE__ */ React86.createElement(
|
|
5350
5480
|
AxisRow,
|
|
5351
5481
|
{
|
|
5352
5482
|
key: control.bind,
|
|
@@ -5358,7 +5488,7 @@ var Rotate = () => {
|
|
|
5358
5488
|
};
|
|
5359
5489
|
|
|
5360
5490
|
// src/controls/transform-control/functions/scale.tsx
|
|
5361
|
-
import * as
|
|
5491
|
+
import * as React88 from "react";
|
|
5362
5492
|
import { useRef as useRef16 } from "react";
|
|
5363
5493
|
import { scaleTransformPropTypeUtil as scaleTransformPropTypeUtil2 } from "@elementor/editor-props";
|
|
5364
5494
|
import { ArrowDownLeftIcon as ArrowDownLeftIcon2, ArrowDownSmallIcon as ArrowDownSmallIcon2, ArrowRightIcon as ArrowRightIcon2 } from "@elementor/icons";
|
|
@@ -5366,10 +5496,10 @@ import { Grid as Grid24 } from "@elementor/ui";
|
|
|
5366
5496
|
import { __ as __40 } from "@wordpress/i18n";
|
|
5367
5497
|
|
|
5368
5498
|
// src/controls/transform-control/functions/scale-axis-row.tsx
|
|
5369
|
-
import * as
|
|
5499
|
+
import * as React87 from "react";
|
|
5370
5500
|
import { Grid as Grid23 } from "@elementor/ui";
|
|
5371
5501
|
var ScaleAxisRow = ({ label, bind, startIcon, anchorRef }) => {
|
|
5372
|
-
return /* @__PURE__ */
|
|
5502
|
+
return /* @__PURE__ */ React87.createElement(Grid23, { item: true, xs: 12 }, /* @__PURE__ */ React87.createElement(PopoverGridContainer, { ref: anchorRef }, /* @__PURE__ */ React87.createElement(Grid23, { item: true, xs: 6 }, /* @__PURE__ */ React87.createElement(ControlLabel, null, label)), /* @__PURE__ */ React87.createElement(Grid23, { item: true, xs: 6 }, /* @__PURE__ */ React87.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React87.createElement(NumberControl, { step: 0.1, placeholder: "1", startIcon })))));
|
|
5373
5503
|
};
|
|
5374
5504
|
|
|
5375
5505
|
// src/controls/transform-control/functions/scale.tsx
|
|
@@ -5377,27 +5507,27 @@ var scaleAxisControls = [
|
|
|
5377
5507
|
{
|
|
5378
5508
|
label: __40("Scale X", "elementor"),
|
|
5379
5509
|
bind: "x",
|
|
5380
|
-
startIcon: /* @__PURE__ */
|
|
5510
|
+
startIcon: /* @__PURE__ */ React88.createElement(ArrowRightIcon2, { fontSize: "tiny" })
|
|
5381
5511
|
},
|
|
5382
5512
|
{
|
|
5383
5513
|
label: __40("Scale Y", "elementor"),
|
|
5384
5514
|
bind: "y",
|
|
5385
|
-
startIcon: /* @__PURE__ */
|
|
5515
|
+
startIcon: /* @__PURE__ */ React88.createElement(ArrowDownSmallIcon2, { fontSize: "tiny" })
|
|
5386
5516
|
},
|
|
5387
5517
|
{
|
|
5388
5518
|
label: __40("Scale Z", "elementor"),
|
|
5389
5519
|
bind: "z",
|
|
5390
|
-
startIcon: /* @__PURE__ */
|
|
5520
|
+
startIcon: /* @__PURE__ */ React88.createElement(ArrowDownLeftIcon2, { fontSize: "tiny" })
|
|
5391
5521
|
}
|
|
5392
5522
|
];
|
|
5393
5523
|
var Scale = () => {
|
|
5394
5524
|
const context = useBoundProp(scaleTransformPropTypeUtil2);
|
|
5395
5525
|
const rowRefs = [useRef16(null), useRef16(null), useRef16(null)];
|
|
5396
|
-
return /* @__PURE__ */
|
|
5526
|
+
return /* @__PURE__ */ React88.createElement(Grid24, { container: true, spacing: 1.5 }, /* @__PURE__ */ React88.createElement(PropProvider, { ...context }, /* @__PURE__ */ React88.createElement(PropKeyProvider, { bind: TransformFunctionKeys.scale }, scaleAxisControls.map((control, index) => /* @__PURE__ */ React88.createElement(ScaleAxisRow, { key: control.bind, ...control, anchorRef: rowRefs[index] })))));
|
|
5397
5527
|
};
|
|
5398
5528
|
|
|
5399
5529
|
// src/controls/transform-control/functions/skew.tsx
|
|
5400
|
-
import * as
|
|
5530
|
+
import * as React89 from "react";
|
|
5401
5531
|
import { useRef as useRef17 } from "react";
|
|
5402
5532
|
import { skewTransformPropTypeUtil as skewTransformPropTypeUtil2 } from "@elementor/editor-props";
|
|
5403
5533
|
import { ArrowLeftIcon, ArrowRightIcon as ArrowRightIcon3 } from "@elementor/icons";
|
|
@@ -5407,19 +5537,19 @@ var skewAxisControls = [
|
|
|
5407
5537
|
{
|
|
5408
5538
|
label: __41("Skew X", "elementor"),
|
|
5409
5539
|
bind: "x",
|
|
5410
|
-
startIcon: /* @__PURE__ */
|
|
5540
|
+
startIcon: /* @__PURE__ */ React89.createElement(ArrowRightIcon3, { fontSize: "tiny" })
|
|
5411
5541
|
},
|
|
5412
5542
|
{
|
|
5413
5543
|
label: __41("Skew Y", "elementor"),
|
|
5414
5544
|
bind: "y",
|
|
5415
|
-
startIcon: /* @__PURE__ */
|
|
5545
|
+
startIcon: /* @__PURE__ */ React89.createElement(ArrowLeftIcon, { fontSize: "tiny", style: { transform: "scaleX(-1) rotate(-90deg)" } })
|
|
5416
5546
|
}
|
|
5417
5547
|
];
|
|
5418
5548
|
var skewUnits = ["deg", "rad", "grad", "turn"];
|
|
5419
5549
|
var Skew = () => {
|
|
5420
5550
|
const context = useBoundProp(skewTransformPropTypeUtil2);
|
|
5421
5551
|
const rowRefs = [useRef17(null), useRef17(null), useRef17(null)];
|
|
5422
|
-
return /* @__PURE__ */
|
|
5552
|
+
return /* @__PURE__ */ React89.createElement(Grid25, { container: true, spacing: 1.5 }, /* @__PURE__ */ React89.createElement(PropProvider, { ...context }, /* @__PURE__ */ React89.createElement(PropKeyProvider, { bind: TransformFunctionKeys.skew }, skewAxisControls.map((control, index) => /* @__PURE__ */ React89.createElement(
|
|
5423
5553
|
AxisRow,
|
|
5424
5554
|
{
|
|
5425
5555
|
key: control.bind,
|
|
@@ -5524,7 +5654,7 @@ var TransformContent = () => {
|
|
|
5524
5654
|
rotate: initialRotateValue.value,
|
|
5525
5655
|
skew: initialSkewValue.value
|
|
5526
5656
|
});
|
|
5527
|
-
return /* @__PURE__ */
|
|
5657
|
+
return /* @__PURE__ */ React90.createElement(PopoverContent, null, /* @__PURE__ */ React90.createElement(Box15, { sx: { width: "100%" } }, /* @__PURE__ */ React90.createElement(Box15, { sx: { borderBottom: 1, borderColor: "divider" } }, /* @__PURE__ */ React90.createElement(
|
|
5528
5658
|
Tabs2,
|
|
5529
5659
|
{
|
|
5530
5660
|
size: "small",
|
|
@@ -5537,33 +5667,33 @@ var TransformContent = () => {
|
|
|
5537
5667
|
...getTabsProps(),
|
|
5538
5668
|
"aria-label": __42("Transform", "elementor")
|
|
5539
5669
|
},
|
|
5540
|
-
/* @__PURE__ */
|
|
5541
|
-
/* @__PURE__ */
|
|
5542
|
-
/* @__PURE__ */
|
|
5543
|
-
/* @__PURE__ */
|
|
5544
|
-
)), /* @__PURE__ */
|
|
5670
|
+
/* @__PURE__ */ React90.createElement(Tab2, { label: __42("Move", "elementor"), ...getTabProps(TransformFunctionKeys.move) }),
|
|
5671
|
+
/* @__PURE__ */ React90.createElement(Tab2, { label: __42("Scale", "elementor"), ...getTabProps(TransformFunctionKeys.scale) }),
|
|
5672
|
+
/* @__PURE__ */ React90.createElement(Tab2, { label: __42("Rotate", "elementor"), ...getTabProps(TransformFunctionKeys.rotate) }),
|
|
5673
|
+
/* @__PURE__ */ React90.createElement(Tab2, { label: __42("Skew", "elementor"), ...getTabProps(TransformFunctionKeys.skew) })
|
|
5674
|
+
)), /* @__PURE__ */ React90.createElement(TabPanel2, { sx: { p: 1.5 }, ...getTabPanelProps(TransformFunctionKeys.move) }, /* @__PURE__ */ React90.createElement(Move, null)), /* @__PURE__ */ React90.createElement(TabPanel2, { sx: { p: 1.5 }, ...getTabPanelProps(TransformFunctionKeys.scale) }, /* @__PURE__ */ React90.createElement(Scale, null)), /* @__PURE__ */ React90.createElement(TabPanel2, { sx: { p: 1.5 }, ...getTabPanelProps(TransformFunctionKeys.rotate) }, /* @__PURE__ */ React90.createElement(Rotate, null)), /* @__PURE__ */ React90.createElement(TabPanel2, { sx: { p: 1.5 }, ...getTabPanelProps(TransformFunctionKeys.skew) }, /* @__PURE__ */ React90.createElement(Skew, null))));
|
|
5545
5675
|
};
|
|
5546
5676
|
|
|
5547
5677
|
// src/controls/transform-control/transform-icon.tsx
|
|
5548
|
-
import * as
|
|
5678
|
+
import * as React91 from "react";
|
|
5549
5679
|
import { ArrowAutofitHeightIcon, ArrowsMaximizeIcon as ArrowsMaximizeIcon2, RotateClockwise2Icon, SkewXIcon } from "@elementor/icons";
|
|
5550
5680
|
var TransformIcon = ({ value }) => {
|
|
5551
5681
|
switch (value.$$type) {
|
|
5552
5682
|
case TransformFunctionKeys.move:
|
|
5553
|
-
return /* @__PURE__ */
|
|
5683
|
+
return /* @__PURE__ */ React91.createElement(ArrowsMaximizeIcon2, { fontSize: "tiny" });
|
|
5554
5684
|
case TransformFunctionKeys.scale:
|
|
5555
|
-
return /* @__PURE__ */
|
|
5685
|
+
return /* @__PURE__ */ React91.createElement(ArrowAutofitHeightIcon, { fontSize: "tiny" });
|
|
5556
5686
|
case TransformFunctionKeys.rotate:
|
|
5557
|
-
return /* @__PURE__ */
|
|
5687
|
+
return /* @__PURE__ */ React91.createElement(RotateClockwise2Icon, { fontSize: "tiny" });
|
|
5558
5688
|
case TransformFunctionKeys.skew:
|
|
5559
|
-
return /* @__PURE__ */
|
|
5689
|
+
return /* @__PURE__ */ React91.createElement(SkewXIcon, { fontSize: "tiny" });
|
|
5560
5690
|
default:
|
|
5561
5691
|
return null;
|
|
5562
5692
|
}
|
|
5563
5693
|
};
|
|
5564
5694
|
|
|
5565
5695
|
// src/controls/transform-control/transform-label.tsx
|
|
5566
|
-
import * as
|
|
5696
|
+
import * as React92 from "react";
|
|
5567
5697
|
import { Box as Box16 } from "@elementor/ui";
|
|
5568
5698
|
import { __ as __43 } from "@wordpress/i18n";
|
|
5569
5699
|
var orderedAxis = ["x", "y", "z"];
|
|
@@ -5583,30 +5713,30 @@ var TransformLabel = (props) => {
|
|
|
5583
5713
|
const { $$type, value } = props.value;
|
|
5584
5714
|
switch ($$type) {
|
|
5585
5715
|
case TransformFunctionKeys.move:
|
|
5586
|
-
return /* @__PURE__ */
|
|
5716
|
+
return /* @__PURE__ */ React92.createElement(Label2, { label: __43("Move", "elementor"), value: formatLabel(value, "move") });
|
|
5587
5717
|
case TransformFunctionKeys.scale:
|
|
5588
|
-
return /* @__PURE__ */
|
|
5718
|
+
return /* @__PURE__ */ React92.createElement(Label2, { label: __43("Scale", "elementor"), value: formatLabel(value, "scale") });
|
|
5589
5719
|
case TransformFunctionKeys.rotate:
|
|
5590
|
-
return /* @__PURE__ */
|
|
5720
|
+
return /* @__PURE__ */ React92.createElement(Label2, { label: __43("Rotate", "elementor"), value: formatLabel(value, "rotate") });
|
|
5591
5721
|
case TransformFunctionKeys.skew:
|
|
5592
|
-
return /* @__PURE__ */
|
|
5722
|
+
return /* @__PURE__ */ React92.createElement(Label2, { label: __43("Skew", "elementor"), value: formatLabel(value, "skew") });
|
|
5593
5723
|
default:
|
|
5594
5724
|
return "";
|
|
5595
5725
|
}
|
|
5596
5726
|
};
|
|
5597
5727
|
var Label2 = ({ label, value }) => {
|
|
5598
|
-
return /* @__PURE__ */
|
|
5728
|
+
return /* @__PURE__ */ React92.createElement(Box16, { component: "span" }, label, ": ", value);
|
|
5599
5729
|
};
|
|
5600
5730
|
|
|
5601
5731
|
// src/controls/transform-control/transform-settings-control.tsx
|
|
5602
|
-
import * as
|
|
5732
|
+
import * as React95 from "react";
|
|
5603
5733
|
import { PopoverHeader as PopoverHeader3 } from "@elementor/editor-ui";
|
|
5604
5734
|
import { AdjustmentsIcon } from "@elementor/icons";
|
|
5605
5735
|
import { bindPopover as bindPopover5, Box as Box17, Divider as Divider4, Popover as Popover5 } from "@elementor/ui";
|
|
5606
5736
|
import { __ as __46 } from "@wordpress/i18n";
|
|
5607
5737
|
|
|
5608
5738
|
// src/controls/transform-control/transform-base-controls/children-perspective-control.tsx
|
|
5609
|
-
import * as
|
|
5739
|
+
import * as React93 from "react";
|
|
5610
5740
|
import { useRef as useRef19 } from "react";
|
|
5611
5741
|
import { perspectiveOriginPropTypeUtil } from "@elementor/editor-props";
|
|
5612
5742
|
import { Grid as Grid26, Stack as Stack15 } from "@elementor/ui";
|
|
@@ -5630,21 +5760,21 @@ var CHILDREN_PERSPECTIVE_FIELDS = [
|
|
|
5630
5760
|
}
|
|
5631
5761
|
];
|
|
5632
5762
|
var ChildrenPerspectiveControl = () => {
|
|
5633
|
-
return /* @__PURE__ */
|
|
5763
|
+
return /* @__PURE__ */ React93.createElement(Stack15, { direction: "column", spacing: 1.5 }, /* @__PURE__ */ React93.createElement(ControlFormLabel, null, __44("Children perspective", "elementor")), /* @__PURE__ */ React93.createElement(PerspectiveControl, null), /* @__PURE__ */ React93.createElement(PerspectiveOriginControl, null));
|
|
5634
5764
|
};
|
|
5635
|
-
var PerspectiveControl = () => /* @__PURE__ */
|
|
5636
|
-
var PerspectiveOriginControl = () => /* @__PURE__ */
|
|
5765
|
+
var PerspectiveControl = () => /* @__PURE__ */ React93.createElement(PropKeyProvider, { bind: "perspective" }, /* @__PURE__ */ React93.createElement(ControlFields, { control: PERSPECTIVE_CONTROL_FIELD, key: PERSPECTIVE_CONTROL_FIELD.bind }));
|
|
5766
|
+
var PerspectiveOriginControl = () => /* @__PURE__ */ React93.createElement(PropKeyProvider, { bind: "perspective-origin" }, /* @__PURE__ */ React93.createElement(PerspectiveOriginControlProvider, null));
|
|
5637
5767
|
var PerspectiveOriginControlProvider = () => {
|
|
5638
5768
|
const context = useBoundProp(perspectiveOriginPropTypeUtil);
|
|
5639
|
-
return /* @__PURE__ */
|
|
5769
|
+
return /* @__PURE__ */ React93.createElement(PropProvider, { ...context }, CHILDREN_PERSPECTIVE_FIELDS.map((control) => /* @__PURE__ */ React93.createElement(PropKeyProvider, { bind: control.bind, key: control.bind }, /* @__PURE__ */ React93.createElement(ControlFields, { control }))));
|
|
5640
5770
|
};
|
|
5641
5771
|
var ControlFields = ({ control }) => {
|
|
5642
5772
|
const rowRef = useRef19(null);
|
|
5643
|
-
return /* @__PURE__ */
|
|
5773
|
+
return /* @__PURE__ */ React93.createElement(PopoverGridContainer, { ref: rowRef }, /* @__PURE__ */ React93.createElement(Grid26, { item: true, xs: 6 }, /* @__PURE__ */ React93.createElement(ControlFormLabel, null, control.label)), /* @__PURE__ */ React93.createElement(Grid26, { item: true, xs: 6 }, /* @__PURE__ */ React93.createElement(SizeControl, { variant: "length", units: control.units, anchorRef: rowRef, disableCustom: true })));
|
|
5644
5774
|
};
|
|
5645
5775
|
|
|
5646
5776
|
// src/controls/transform-control/transform-base-controls/transform-origin-control.tsx
|
|
5647
|
-
import * as
|
|
5777
|
+
import * as React94 from "react";
|
|
5648
5778
|
import { useRef as useRef20 } from "react";
|
|
5649
5779
|
import { transformOriginPropTypeUtil } from "@elementor/editor-props";
|
|
5650
5780
|
import { Grid as Grid27, Stack as Stack16 } from "@elementor/ui";
|
|
@@ -5669,12 +5799,12 @@ var TRANSFORM_ORIGIN_FIELDS = [
|
|
|
5669
5799
|
}
|
|
5670
5800
|
];
|
|
5671
5801
|
var TransformOriginControl = () => {
|
|
5672
|
-
return /* @__PURE__ */
|
|
5802
|
+
return /* @__PURE__ */ React94.createElement(Stack16, { direction: "column", spacing: 1.5 }, /* @__PURE__ */ React94.createElement(ControlFormLabel, null, __45("Transform", "elementor")), TRANSFORM_ORIGIN_FIELDS.map((control) => /* @__PURE__ */ React94.createElement(ControlFields2, { control, key: control.bind })));
|
|
5673
5803
|
};
|
|
5674
5804
|
var ControlFields2 = ({ control }) => {
|
|
5675
5805
|
const context = useBoundProp(transformOriginPropTypeUtil);
|
|
5676
5806
|
const rowRef = useRef20(null);
|
|
5677
|
-
return /* @__PURE__ */
|
|
5807
|
+
return /* @__PURE__ */ React94.createElement(PropProvider, { ...context }, /* @__PURE__ */ React94.createElement(PropKeyProvider, { bind: control.bind }, /* @__PURE__ */ React94.createElement(PopoverGridContainer, { ref: rowRef }, /* @__PURE__ */ React94.createElement(Grid27, { item: true, xs: 6 }, /* @__PURE__ */ React94.createElement(ControlFormLabel, null, control.label)), /* @__PURE__ */ React94.createElement(Grid27, { item: true, xs: 6 }, /* @__PURE__ */ React94.createElement(SizeControl, { variant: "length", units: control.units, anchorRef: rowRef, disableCustom: true })))));
|
|
5678
5808
|
};
|
|
5679
5809
|
|
|
5680
5810
|
// src/controls/transform-control/transform-settings-control.tsx
|
|
@@ -5688,7 +5818,7 @@ var TransformSettingsControl = ({
|
|
|
5688
5818
|
...popupState,
|
|
5689
5819
|
anchorEl: anchorRef.current ?? void 0
|
|
5690
5820
|
});
|
|
5691
|
-
return /* @__PURE__ */
|
|
5821
|
+
return /* @__PURE__ */ React95.createElement(
|
|
5692
5822
|
Popover5,
|
|
5693
5823
|
{
|
|
5694
5824
|
disablePortal: true,
|
|
@@ -5703,16 +5833,16 @@ var TransformSettingsControl = ({
|
|
|
5703
5833
|
},
|
|
5704
5834
|
...popupProps
|
|
5705
5835
|
},
|
|
5706
|
-
/* @__PURE__ */
|
|
5836
|
+
/* @__PURE__ */ React95.createElement(
|
|
5707
5837
|
PopoverHeader3,
|
|
5708
5838
|
{
|
|
5709
5839
|
title: __46("Transform settings", "elementor"),
|
|
5710
5840
|
onClose: popupState.close,
|
|
5711
|
-
icon: /* @__PURE__ */
|
|
5841
|
+
icon: /* @__PURE__ */ React95.createElement(AdjustmentsIcon, { fontSize: SIZE8 })
|
|
5712
5842
|
}
|
|
5713
5843
|
),
|
|
5714
|
-
/* @__PURE__ */
|
|
5715
|
-
/* @__PURE__ */
|
|
5844
|
+
/* @__PURE__ */ React95.createElement(Divider4, null),
|
|
5845
|
+
/* @__PURE__ */ React95.createElement(PopoverContent, { sx: { px: 2, py: 1.5 } }, /* @__PURE__ */ React95.createElement(PropKeyProvider, { bind: "transform-origin" }, /* @__PURE__ */ React95.createElement(TransformOriginControl, null)), showChildrenPerspective && /* @__PURE__ */ React95.createElement(React95.Fragment, null, /* @__PURE__ */ React95.createElement(Box17, { sx: { my: 0.5 } }, /* @__PURE__ */ React95.createElement(Divider4, null)), /* @__PURE__ */ React95.createElement(ChildrenPerspectiveControl, null)))
|
|
5716
5846
|
);
|
|
5717
5847
|
};
|
|
5718
5848
|
|
|
@@ -5723,25 +5853,25 @@ var TransformRepeaterControl = createControl(
|
|
|
5723
5853
|
const context = useBoundProp(transformPropTypeUtil);
|
|
5724
5854
|
const headerRef = useRef21(null);
|
|
5725
5855
|
const popupState = usePopupState6({ variant: "popover" });
|
|
5726
|
-
return /* @__PURE__ */
|
|
5856
|
+
return /* @__PURE__ */ React96.createElement(PropProvider, { ...context }, /* @__PURE__ */ React96.createElement(
|
|
5727
5857
|
TransformSettingsControl,
|
|
5728
5858
|
{
|
|
5729
5859
|
popupState,
|
|
5730
5860
|
anchorRef: headerRef,
|
|
5731
5861
|
showChildrenPerspective
|
|
5732
5862
|
}
|
|
5733
|
-
), /* @__PURE__ */
|
|
5863
|
+
), /* @__PURE__ */ React96.createElement(PropKeyProvider, { bind: "transform-functions" }, /* @__PURE__ */ React96.createElement(Repeater2, { headerRef, propType: context.propType, popupState })));
|
|
5734
5864
|
}
|
|
5735
5865
|
);
|
|
5736
|
-
var ToolTip = /* @__PURE__ */
|
|
5866
|
+
var ToolTip = /* @__PURE__ */ React96.createElement(
|
|
5737
5867
|
Box18,
|
|
5738
5868
|
{
|
|
5739
5869
|
component: "span",
|
|
5740
5870
|
"aria-label": void 0,
|
|
5741
5871
|
sx: { display: "flex", gap: 0.5, p: 2, width: 320, borderRadius: 1 }
|
|
5742
5872
|
},
|
|
5743
|
-
/* @__PURE__ */
|
|
5744
|
-
/* @__PURE__ */
|
|
5873
|
+
/* @__PURE__ */ React96.createElement(InfoCircleFilledIcon2, { sx: { color: "secondary.main" } }),
|
|
5874
|
+
/* @__PURE__ */ React96.createElement(Typography7, { variant: "body2", color: "text.secondary", fontSize: "14px" }, __47("You can use each kind of transform only once per element.", "elementor"))
|
|
5745
5875
|
);
|
|
5746
5876
|
var Repeater2 = ({
|
|
5747
5877
|
headerRef,
|
|
@@ -5755,21 +5885,21 @@ var Repeater2 = ({
|
|
|
5755
5885
|
return availableValues.find((value) => !transformValues?.some((item) => item.$$type === value.$$type));
|
|
5756
5886
|
};
|
|
5757
5887
|
const shouldDisableAddItem = !getInitialValue2();
|
|
5758
|
-
return /* @__PURE__ */
|
|
5888
|
+
return /* @__PURE__ */ React96.createElement(PropProvider, { ...transformFunctionsContext }, /* @__PURE__ */ React96.createElement(
|
|
5759
5889
|
ControlRepeater,
|
|
5760
5890
|
{
|
|
5761
5891
|
initial: getInitialValue2() ?? initialTransformValue,
|
|
5762
5892
|
propTypeUtil: transformFunctionsPropTypeUtil
|
|
5763
5893
|
},
|
|
5764
|
-
/* @__PURE__ */
|
|
5894
|
+
/* @__PURE__ */ React96.createElement(
|
|
5765
5895
|
RepeaterHeader,
|
|
5766
5896
|
{
|
|
5767
5897
|
label: __47("Transform", "elementor"),
|
|
5768
|
-
adornment: () => /* @__PURE__ */
|
|
5898
|
+
adornment: () => /* @__PURE__ */ React96.createElement(ControlAdornments, { customContext: { path: ["transform"], propType } }),
|
|
5769
5899
|
ref: headerRef
|
|
5770
5900
|
},
|
|
5771
|
-
/* @__PURE__ */
|
|
5772
|
-
/* @__PURE__ */
|
|
5901
|
+
/* @__PURE__ */ React96.createElement(TransformBasePopoverTrigger, { popupState, repeaterBindKey: bind }),
|
|
5902
|
+
/* @__PURE__ */ React96.createElement(
|
|
5773
5903
|
TooltipAddItemAction,
|
|
5774
5904
|
{
|
|
5775
5905
|
disabled: shouldDisableAddItem,
|
|
@@ -5779,15 +5909,15 @@ var Repeater2 = ({
|
|
|
5779
5909
|
}
|
|
5780
5910
|
)
|
|
5781
5911
|
),
|
|
5782
|
-
/* @__PURE__ */
|
|
5912
|
+
/* @__PURE__ */ React96.createElement(ItemsContainer, null, /* @__PURE__ */ React96.createElement(
|
|
5783
5913
|
Item,
|
|
5784
5914
|
{
|
|
5785
5915
|
Icon: TransformIcon,
|
|
5786
5916
|
Label: TransformLabel,
|
|
5787
|
-
actions: /* @__PURE__ */
|
|
5917
|
+
actions: /* @__PURE__ */ React96.createElement(React96.Fragment, null, /* @__PURE__ */ React96.createElement(DisableItemAction, null), /* @__PURE__ */ React96.createElement(RemoveItemAction, null))
|
|
5788
5918
|
}
|
|
5789
5919
|
)),
|
|
5790
|
-
/* @__PURE__ */
|
|
5920
|
+
/* @__PURE__ */ React96.createElement(EditItemPopover, null, /* @__PURE__ */ React96.createElement(TransformContent, null))
|
|
5791
5921
|
));
|
|
5792
5922
|
};
|
|
5793
5923
|
var TransformBasePopoverTrigger = ({
|
|
@@ -5796,12 +5926,12 @@ var TransformBasePopoverTrigger = ({
|
|
|
5796
5926
|
}) => {
|
|
5797
5927
|
const { bind } = useBoundProp();
|
|
5798
5928
|
const titleLabel = __47("Transform settings", "elementor");
|
|
5799
|
-
return bind !== repeaterBindKey ? null : /* @__PURE__ */
|
|
5929
|
+
return bind !== repeaterBindKey ? null : /* @__PURE__ */ React96.createElement(Tooltip8, { title: titleLabel, placement: "top" }, /* @__PURE__ */ React96.createElement(IconButton7, { size: SIZE9, "aria-label": titleLabel, ...bindTrigger4(popupState) }, /* @__PURE__ */ React96.createElement(AdjustmentsIcon2, { fontSize: SIZE9 })));
|
|
5800
5930
|
};
|
|
5801
5931
|
|
|
5802
5932
|
// src/controls/transition-control/transition-repeater-control.tsx
|
|
5803
|
-
import * as
|
|
5804
|
-
import { useEffect as useEffect11, useMemo as useMemo13, useState as
|
|
5933
|
+
import * as React99 from "react";
|
|
5934
|
+
import { useEffect as useEffect11, useMemo as useMemo13, useState as useState17 } from "react";
|
|
5805
5935
|
import {
|
|
5806
5936
|
createArrayPropUtils as createArrayPropUtils2,
|
|
5807
5937
|
selectionSizePropTypeUtil as selectionSizePropTypeUtil2
|
|
@@ -5812,7 +5942,7 @@ import { hasProInstalled as hasProInstalled2 } from "@elementor/utils";
|
|
|
5812
5942
|
import { __ as __50 } from "@wordpress/i18n";
|
|
5813
5943
|
|
|
5814
5944
|
// src/controls/selection-size-control.tsx
|
|
5815
|
-
import * as
|
|
5945
|
+
import * as React97 from "react";
|
|
5816
5946
|
import { useMemo as useMemo11, useRef as useRef22 } from "react";
|
|
5817
5947
|
import { selectionSizePropTypeUtil } from "@elementor/editor-props";
|
|
5818
5948
|
import { Grid as Grid28 } from "@elementor/ui";
|
|
@@ -5832,7 +5962,7 @@ var SelectionSizeControl = createControl(
|
|
|
5832
5962
|
}
|
|
5833
5963
|
}, [value, sizeConfigMap]);
|
|
5834
5964
|
const SelectionComponent = selectionConfig.component;
|
|
5835
|
-
return /* @__PURE__ */
|
|
5965
|
+
return /* @__PURE__ */ React97.createElement(PropProvider, { value, setValue, propType }, /* @__PURE__ */ React97.createElement(Grid28, { container: true, spacing: 1.5, ref: rowRef }, /* @__PURE__ */ React97.createElement(Grid28, { item: true, xs: 6, sx: { display: "flex", alignItems: "center" } }, /* @__PURE__ */ React97.createElement(ControlFormLabel, null, selectionLabel)), /* @__PURE__ */ React97.createElement(Grid28, { item: true, xs: 6 }, /* @__PURE__ */ React97.createElement(PropKeyProvider, { bind: "selection" }, /* @__PURE__ */ React97.createElement(SelectionComponent, { ...selectionConfig.props }))), currentSizeConfig && /* @__PURE__ */ React97.createElement(React97.Fragment, null, /* @__PURE__ */ React97.createElement(Grid28, { item: true, xs: 6, sx: { display: "flex", alignItems: "center" } }, /* @__PURE__ */ React97.createElement(ControlFormLabel, { htmlFor: sizeFieldId }, sizeLabel)), /* @__PURE__ */ React97.createElement(Grid28, { item: true, xs: 6 }, /* @__PURE__ */ React97.createElement(PropKeyProvider, { bind: "size" }, /* @__PURE__ */ React97.createElement(
|
|
5836
5966
|
SizeControl,
|
|
5837
5967
|
{
|
|
5838
5968
|
anchorRef: rowRef,
|
|
@@ -6033,7 +6163,7 @@ function subscribeToTransitionEvent() {
|
|
|
6033
6163
|
}
|
|
6034
6164
|
|
|
6035
6165
|
// src/controls/transition-control/transition-selector.tsx
|
|
6036
|
-
import * as
|
|
6166
|
+
import * as React98 from "react";
|
|
6037
6167
|
import { useMemo as useMemo12, useRef as useRef23 } from "react";
|
|
6038
6168
|
import { keyValuePropTypeUtil as keyValuePropTypeUtil2 } from "@elementor/editor-props";
|
|
6039
6169
|
import { PromotionAlert, PromotionChip } from "@elementor/editor-ui";
|
|
@@ -6167,16 +6297,16 @@ var TransitionSelector = ({
|
|
|
6167
6297
|
left: rect.right + 36
|
|
6168
6298
|
};
|
|
6169
6299
|
};
|
|
6170
|
-
return /* @__PURE__ */
|
|
6300
|
+
return /* @__PURE__ */ React98.createElement(Box19, { ref: defaultRef }, /* @__PURE__ */ React98.createElement(ControlActions, null, /* @__PURE__ */ React98.createElement(
|
|
6171
6301
|
UnstableTag3,
|
|
6172
6302
|
{
|
|
6173
6303
|
variant: "outlined",
|
|
6174
6304
|
label: transitionLabel,
|
|
6175
|
-
endIcon: /* @__PURE__ */
|
|
6305
|
+
endIcon: /* @__PURE__ */ React98.createElement(ChevronDownIcon3, { fontSize: "tiny" }),
|
|
6176
6306
|
...bindTrigger5(popoverState),
|
|
6177
6307
|
fullWidth: true
|
|
6178
6308
|
}
|
|
6179
|
-
)), /* @__PURE__ */
|
|
6309
|
+
)), /* @__PURE__ */ React98.createElement(
|
|
6180
6310
|
Popover6,
|
|
6181
6311
|
{
|
|
6182
6312
|
disablePortal: true,
|
|
@@ -6187,7 +6317,7 @@ var TransitionSelector = ({
|
|
|
6187
6317
|
anchorOrigin: { vertical: "top", horizontal: "right" },
|
|
6188
6318
|
transformOrigin: { vertical: "top", horizontal: "left" }
|
|
6189
6319
|
},
|
|
6190
|
-
/* @__PURE__ */
|
|
6320
|
+
/* @__PURE__ */ React98.createElement(
|
|
6191
6321
|
ItemSelector,
|
|
6192
6322
|
{
|
|
6193
6323
|
itemsList: getItemList(),
|
|
@@ -6198,7 +6328,7 @@ var TransitionSelector = ({
|
|
|
6198
6328
|
title: __49("Transition Property", "elementor"),
|
|
6199
6329
|
icon: VariationsIcon,
|
|
6200
6330
|
disabledItems: includeCurrentValueInOptions(value, disabledItems),
|
|
6201
|
-
categoryItemContentTemplate: (item) => /* @__PURE__ */
|
|
6331
|
+
categoryItemContentTemplate: (item) => /* @__PURE__ */ React98.createElement(
|
|
6202
6332
|
Box19,
|
|
6203
6333
|
{
|
|
6204
6334
|
sx: {
|
|
@@ -6208,10 +6338,10 @@ var TransitionSelector = ({
|
|
|
6208
6338
|
width: "100%"
|
|
6209
6339
|
}
|
|
6210
6340
|
},
|
|
6211
|
-
/* @__PURE__ */
|
|
6212
|
-
showPromotion && disabledCategories.has(item.value) && /* @__PURE__ */
|
|
6341
|
+
/* @__PURE__ */ React98.createElement("span", null, item.value),
|
|
6342
|
+
showPromotion && disabledCategories.has(item.value) && /* @__PURE__ */ React98.createElement(PromotionChip, null)
|
|
6213
6343
|
),
|
|
6214
|
-
footer: showPromotion ? /* @__PURE__ */
|
|
6344
|
+
footer: showPromotion ? /* @__PURE__ */ React98.createElement(
|
|
6215
6345
|
PromotionAlert,
|
|
6216
6346
|
{
|
|
6217
6347
|
message: __49(
|
|
@@ -6330,7 +6460,7 @@ var getInitialValue = (values = []) => {
|
|
|
6330
6460
|
}
|
|
6331
6461
|
return initialTransitionValue;
|
|
6332
6462
|
};
|
|
6333
|
-
var disableAddItemTooltipContent = /* @__PURE__ */
|
|
6463
|
+
var disableAddItemTooltipContent = /* @__PURE__ */ React99.createElement(
|
|
6334
6464
|
Alert2,
|
|
6335
6465
|
{
|
|
6336
6466
|
sx: {
|
|
@@ -6338,10 +6468,10 @@ var disableAddItemTooltipContent = /* @__PURE__ */ React98.createElement(
|
|
|
6338
6468
|
gap: 0.5
|
|
6339
6469
|
},
|
|
6340
6470
|
color: "secondary",
|
|
6341
|
-
icon: /* @__PURE__ */
|
|
6471
|
+
icon: /* @__PURE__ */ React99.createElement(InfoCircleFilledIcon3, null)
|
|
6342
6472
|
},
|
|
6343
|
-
/* @__PURE__ */
|
|
6344
|
-
/* @__PURE__ */
|
|
6473
|
+
/* @__PURE__ */ React99.createElement(AlertTitle3, null, __50("Transitions", "elementor")),
|
|
6474
|
+
/* @__PURE__ */ React99.createElement(Box20, { component: "span" }, /* @__PURE__ */ React99.createElement(Typography8, { variant: "body2" }, __50("Switch to 'Normal' state to add a transition.", "elementor")))
|
|
6345
6475
|
);
|
|
6346
6476
|
var TransitionRepeaterControl = createControl(
|
|
6347
6477
|
({
|
|
@@ -6349,7 +6479,7 @@ var TransitionRepeaterControl = createControl(
|
|
|
6349
6479
|
currentStyleState
|
|
6350
6480
|
}) => {
|
|
6351
6481
|
const currentStyleIsNormal = currentStyleState === null;
|
|
6352
|
-
const [recentlyUsedList, setRecentlyUsedList] =
|
|
6482
|
+
const [recentlyUsedList, setRecentlyUsedList] = useState17([]);
|
|
6353
6483
|
const proInstalled = hasProInstalled2();
|
|
6354
6484
|
const { value, setValue } = useBoundProp(childArrayPropTypeUtil);
|
|
6355
6485
|
const { allDisabled: disabledItems, proDisabled: proDisabledItems } = useMemo13(
|
|
@@ -6384,7 +6514,7 @@ var TransitionRepeaterControl = createControl(
|
|
|
6384
6514
|
}, [recentlyUsedListGetter]);
|
|
6385
6515
|
const allPropertiesUsed = useMemo13(() => areAllPropertiesUsed(value), [value]);
|
|
6386
6516
|
const isAddItemDisabled = !currentStyleIsNormal || allPropertiesUsed;
|
|
6387
|
-
return /* @__PURE__ */
|
|
6517
|
+
return /* @__PURE__ */ React99.createElement(
|
|
6388
6518
|
RepeatableControl,
|
|
6389
6519
|
{
|
|
6390
6520
|
label: __50("Transitions", "elementor"),
|
|
@@ -6411,9 +6541,9 @@ var TransitionRepeaterControl = createControl(
|
|
|
6411
6541
|
);
|
|
6412
6542
|
|
|
6413
6543
|
// src/controls/date-time-control.tsx
|
|
6414
|
-
import * as
|
|
6544
|
+
import * as React100 from "react";
|
|
6415
6545
|
import * as dayjs from "dayjs";
|
|
6416
|
-
import { isTransformable as isTransformable2, stringPropTypeUtil as
|
|
6546
|
+
import { isTransformable as isTransformable2, stringPropTypeUtil as stringPropTypeUtil16 } from "@elementor/editor-props";
|
|
6417
6547
|
import { DateTimePropTypeUtil } from "@elementor/editor-props";
|
|
6418
6548
|
import { Box as Box21, DatePicker, LocalizationProvider, TimePicker } from "@elementor/ui";
|
|
6419
6549
|
var DATE_FORMAT = "YYYY-MM-DD";
|
|
@@ -6459,10 +6589,10 @@ var DateTimeControl = createControl(({ inputDisabled }) => {
|
|
|
6459
6589
|
const base = dayjs.default();
|
|
6460
6590
|
return base.hour(h).minute(m).second(0).millisecond(0);
|
|
6461
6591
|
};
|
|
6462
|
-
return /* @__PURE__ */
|
|
6592
|
+
return /* @__PURE__ */ React100.createElement(PropProvider, { ...propContext, value, setValue }, /* @__PURE__ */ React100.createElement(ControlActions, null, /* @__PURE__ */ React100.createElement(LocalizationProvider, null, /* @__PURE__ */ React100.createElement(Box21, { display: "flex", gap: 1, alignItems: "center" }, /* @__PURE__ */ React100.createElement(PropKeyProvider, { bind: "date" }, /* @__PURE__ */ React100.createElement(
|
|
6463
6593
|
DatePicker,
|
|
6464
6594
|
{
|
|
6465
|
-
value: parseDateValue(
|
|
6595
|
+
value: parseDateValue(stringPropTypeUtil16.extract(value?.date)),
|
|
6466
6596
|
onChange: (v) => handleChange({ date: v }, { bind: "date" }),
|
|
6467
6597
|
disabled: inputDisabled,
|
|
6468
6598
|
slotProps: {
|
|
@@ -6471,10 +6601,10 @@ var DateTimeControl = createControl(({ inputDisabled }) => {
|
|
|
6471
6601
|
openPickerIcon: { fontSize: "tiny" }
|
|
6472
6602
|
}
|
|
6473
6603
|
}
|
|
6474
|
-
)), /* @__PURE__ */
|
|
6604
|
+
)), /* @__PURE__ */ React100.createElement(PropKeyProvider, { bind: "time" }, /* @__PURE__ */ React100.createElement(
|
|
6475
6605
|
TimePicker,
|
|
6476
6606
|
{
|
|
6477
|
-
value: parseTimeValue(
|
|
6607
|
+
value: parseTimeValue(stringPropTypeUtil16.extract(value?.time)),
|
|
6478
6608
|
onChange: (v) => handleChange({ time: v }, { bind: "time" }),
|
|
6479
6609
|
disabled: inputDisabled,
|
|
6480
6610
|
slotProps: {
|
|
@@ -6487,14 +6617,14 @@ var DateTimeControl = createControl(({ inputDisabled }) => {
|
|
|
6487
6617
|
});
|
|
6488
6618
|
|
|
6489
6619
|
// src/controls/inline-editing-control.tsx
|
|
6490
|
-
import * as
|
|
6491
|
-
import { useCallback as
|
|
6492
|
-
import { htmlV3PropTypeUtil, parseHtmlChildren, stringPropTypeUtil as
|
|
6620
|
+
import * as React102 from "react";
|
|
6621
|
+
import { useCallback as useCallback4, useEffect as useEffect13, useMemo as useMemo14 } from "react";
|
|
6622
|
+
import { htmlV3PropTypeUtil, parseHtmlChildren, stringPropTypeUtil as stringPropTypeUtil17 } from "@elementor/editor-props";
|
|
6493
6623
|
import { Box as Box23 } from "@elementor/ui";
|
|
6494
6624
|
import { debounce as debounce4 } from "@elementor/utils";
|
|
6495
6625
|
|
|
6496
6626
|
// src/components/inline-editor.tsx
|
|
6497
|
-
import * as
|
|
6627
|
+
import * as React101 from "react";
|
|
6498
6628
|
import { useEffect as useEffect12, useRef as useRef24 } from "react";
|
|
6499
6629
|
import { Box as Box22 } from "@elementor/ui";
|
|
6500
6630
|
import Bold from "@tiptap/extension-bold";
|
|
@@ -6533,7 +6663,7 @@ function htmlToPlainText(html) {
|
|
|
6533
6663
|
var ITALIC_KEYBOARD_SHORTCUT = "i";
|
|
6534
6664
|
var BOLD_KEYBOARD_SHORTCUT = "b";
|
|
6535
6665
|
var UNDERLINE_KEYBOARD_SHORTCUT = "u";
|
|
6536
|
-
var InlineEditor =
|
|
6666
|
+
var InlineEditor = React101.forwardRef((props, ref) => {
|
|
6537
6667
|
const {
|
|
6538
6668
|
value,
|
|
6539
6669
|
setValue,
|
|
@@ -6644,7 +6774,7 @@ var InlineEditor = React100.forwardRef((props, ref) => {
|
|
|
6644
6774
|
if (mountElement) {
|
|
6645
6775
|
return null;
|
|
6646
6776
|
}
|
|
6647
|
-
return /* @__PURE__ */
|
|
6777
|
+
return /* @__PURE__ */ React101.createElement(Box22, { ref: containerRef, sx, className: wrapperClassName }, /* @__PURE__ */ React101.createElement(EditorContent, { ref, editor }));
|
|
6648
6778
|
});
|
|
6649
6779
|
var useOnUpdate = (callback, dependencies) => {
|
|
6650
6780
|
const hasMounted = useRef24(false);
|
|
@@ -6666,22 +6796,22 @@ var InlineEditingControl = createControl(
|
|
|
6666
6796
|
props
|
|
6667
6797
|
}) => {
|
|
6668
6798
|
const { value, setValue, placeholder } = useBoundProp(htmlV3PropTypeUtil);
|
|
6669
|
-
const content =
|
|
6799
|
+
const content = stringPropTypeUtil17.extract(value?.content ?? null) ?? "";
|
|
6670
6800
|
const debouncedParse = useMemo14(
|
|
6671
6801
|
() => debounce4((html) => {
|
|
6672
6802
|
const parsed = parseHtmlChildren(html);
|
|
6673
6803
|
setValue({
|
|
6674
|
-
content: parsed.content ?
|
|
6804
|
+
content: parsed.content ? stringPropTypeUtil17.create(parsed.content) : null,
|
|
6675
6805
|
children: parsed.children
|
|
6676
6806
|
});
|
|
6677
6807
|
}, CHILDREN_PARSE_DEBOUNCE_MS),
|
|
6678
6808
|
[setValue]
|
|
6679
6809
|
);
|
|
6680
|
-
const handleChange =
|
|
6810
|
+
const handleChange = useCallback4(
|
|
6681
6811
|
(newValue) => {
|
|
6682
6812
|
const html = newValue ?? "";
|
|
6683
6813
|
setValue({
|
|
6684
|
-
content: html ?
|
|
6814
|
+
content: html ? stringPropTypeUtil17.create(html) : null,
|
|
6685
6815
|
children: value?.children ?? []
|
|
6686
6816
|
});
|
|
6687
6817
|
debouncedParse(html);
|
|
@@ -6689,7 +6819,7 @@ var InlineEditingControl = createControl(
|
|
|
6689
6819
|
[setValue, value?.children, debouncedParse]
|
|
6690
6820
|
);
|
|
6691
6821
|
useEffect13(() => () => debouncedParse.cancel(), [debouncedParse]);
|
|
6692
|
-
return /* @__PURE__ */
|
|
6822
|
+
return /* @__PURE__ */ React102.createElement(ControlActions, null, /* @__PURE__ */ React102.createElement(
|
|
6693
6823
|
Box23,
|
|
6694
6824
|
{
|
|
6695
6825
|
sx: {
|
|
@@ -6734,7 +6864,7 @@ var InlineEditingControl = createControl(
|
|
|
6734
6864
|
...attributes,
|
|
6735
6865
|
...props
|
|
6736
6866
|
},
|
|
6737
|
-
/* @__PURE__ */
|
|
6867
|
+
/* @__PURE__ */ React102.createElement(
|
|
6738
6868
|
InlineEditor,
|
|
6739
6869
|
{
|
|
6740
6870
|
value: content,
|
|
@@ -6747,14 +6877,58 @@ var InlineEditingControl = createControl(
|
|
|
6747
6877
|
);
|
|
6748
6878
|
|
|
6749
6879
|
// src/controls/email-form-action-control.tsx
|
|
6750
|
-
import * as
|
|
6880
|
+
import * as React103 from "react";
|
|
6751
6881
|
import { emailPropTypeUtil } from "@elementor/editor-props";
|
|
6752
|
-
import { CollapsibleContent } from "@elementor/editor-ui";
|
|
6882
|
+
import { CollapsibleContent, InfoAlert as InfoAlert2 } from "@elementor/editor-ui";
|
|
6753
6883
|
import { Box as Box24, Divider as Divider5, Grid as Grid29, Stack as Stack17 } from "@elementor/ui";
|
|
6884
|
+
import { hasProInstalled as hasProInstalled3, isVersionGreaterOrEqual as isVersionGreaterOrEqual2 } from "@elementor/utils";
|
|
6754
6885
|
import { __ as __51 } from "@wordpress/i18n";
|
|
6755
|
-
|
|
6756
|
-
|
|
6757
|
-
|
|
6886
|
+
|
|
6887
|
+
// src/hooks/use-form-field-suggestions.ts
|
|
6888
|
+
import { getContainer, getSelectedElements as getSelectedElements3 } from "@elementor/editor-elements";
|
|
6889
|
+
import { isTransformable as isTransformable3 } from "@elementor/editor-props";
|
|
6890
|
+
import { __privateUseListenTo as useListenTo, commandEndEvent, v1ReadyEvent } from "@elementor/editor-v1-adapters";
|
|
6891
|
+
var FORM_FIELD_WIDGET_TYPES = ["e-form-input", "e-form-textarea", "e-form-checkbox"];
|
|
6892
|
+
function useFormFieldSuggestions() {
|
|
6893
|
+
return useListenTo(
|
|
6894
|
+
[
|
|
6895
|
+
v1ReadyEvent(),
|
|
6896
|
+
commandEndEvent("document/elements/create"),
|
|
6897
|
+
commandEndEvent("document/elements/delete"),
|
|
6898
|
+
commandEndEvent("document/elements/set-settings")
|
|
6899
|
+
],
|
|
6900
|
+
() => {
|
|
6901
|
+
const selectedElements = getSelectedElements3();
|
|
6902
|
+
const formElement = selectedElements[0];
|
|
6903
|
+
if (!formElement) {
|
|
6904
|
+
return [];
|
|
6905
|
+
}
|
|
6906
|
+
const container = getContainer(formElement.id);
|
|
6907
|
+
if (!container?.children) {
|
|
6908
|
+
return [];
|
|
6909
|
+
}
|
|
6910
|
+
const suggestions = [];
|
|
6911
|
+
container.children.forEachRecursive?.((child) => {
|
|
6912
|
+
const widgetType = child.model.get("widgetType");
|
|
6913
|
+
if (!widgetType || !FORM_FIELD_WIDGET_TYPES.includes(widgetType)) {
|
|
6914
|
+
return;
|
|
6915
|
+
}
|
|
6916
|
+
const cssIdProp = child.settings.get("_cssid");
|
|
6917
|
+
const fieldId = isTransformable3(cssIdProp) ? cssIdProp.value : cssIdProp;
|
|
6918
|
+
if (fieldId && typeof fieldId === "string") {
|
|
6919
|
+
suggestions.push({ label: fieldId, value: fieldId });
|
|
6920
|
+
}
|
|
6921
|
+
});
|
|
6922
|
+
return suggestions;
|
|
6923
|
+
},
|
|
6924
|
+
[]
|
|
6925
|
+
);
|
|
6926
|
+
}
|
|
6927
|
+
|
|
6928
|
+
// src/controls/email-form-action-control.tsx
|
|
6929
|
+
var EmailField = ({ bind, label, placeholder }) => /* @__PURE__ */ React103.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React103.createElement(Grid29, { container: true, direction: "column", gap: 0.5 }, /* @__PURE__ */ React103.createElement(Grid29, { item: true }, /* @__PURE__ */ React103.createElement(ControlFormLabel, null, label)), /* @__PURE__ */ React103.createElement(Grid29, { item: true }, /* @__PURE__ */ React103.createElement(TextControl, { placeholder }))));
|
|
6930
|
+
var SendToField = ({ placeholder }) => /* @__PURE__ */ React103.createElement(EmailField, { bind: "to", label: __51("Send to", "elementor"), placeholder });
|
|
6931
|
+
var SubjectField = () => /* @__PURE__ */ React103.createElement(
|
|
6758
6932
|
EmailField,
|
|
6759
6933
|
{
|
|
6760
6934
|
bind: "subject",
|
|
@@ -6762,16 +6936,25 @@ var SubjectField = () => /* @__PURE__ */ React102.createElement(
|
|
|
6762
6936
|
placeholder: __51("New form submission", "elementor")
|
|
6763
6937
|
}
|
|
6764
6938
|
);
|
|
6765
|
-
var
|
|
6766
|
-
|
|
6767
|
-
{
|
|
6768
|
-
|
|
6769
|
-
"By default, all form fields are sent via [all-fields] shortcode.",
|
|
6770
|
-
"elementor"
|
|
6771
|
-
)
|
|
6939
|
+
var MIN_PRO_VERSION_FOR_MENTIONS = "4.1.0";
|
|
6940
|
+
var shouldShowMentionsInfo = () => {
|
|
6941
|
+
if (!hasProInstalled3()) {
|
|
6942
|
+
return true;
|
|
6772
6943
|
}
|
|
6773
|
-
|
|
6774
|
-
|
|
6944
|
+
const proVersion = window.elementorPro?.config?.version;
|
|
6945
|
+
if (!proVersion) {
|
|
6946
|
+
return false;
|
|
6947
|
+
}
|
|
6948
|
+
return isVersionGreaterOrEqual2(proVersion, MIN_PRO_VERSION_FOR_MENTIONS);
|
|
6949
|
+
};
|
|
6950
|
+
var MessageField = () => {
|
|
6951
|
+
const suggestions = useFormFieldSuggestions();
|
|
6952
|
+
return /* @__PURE__ */ React103.createElement(PropKeyProvider, { bind: "message" }, /* @__PURE__ */ React103.createElement(Grid29, { container: true, direction: "column", gap: 0.5 }, /* @__PURE__ */ React103.createElement(Grid29, { item: true }, /* @__PURE__ */ React103.createElement(ControlFormLabel, null, __51("Message", "elementor"))), /* @__PURE__ */ React103.createElement(Grid29, { item: true }, /* @__PURE__ */ React103.createElement(MentionTextAreaControl, { suggestions })), /* @__PURE__ */ React103.createElement(Grid29, { item: true }, /* @__PURE__ */ React103.createElement(InfoAlert2, null, shouldShowMentionsInfo() ? __51(
|
|
6953
|
+
"[all-fields] shortcode sends all fields. Type @ to insert specific fields and customize your message.",
|
|
6954
|
+
"elementor"
|
|
6955
|
+
) : __51("[all-fields] shortcode sends all fields.", "elementor")))));
|
|
6956
|
+
};
|
|
6957
|
+
var FromEmailField = () => /* @__PURE__ */ React103.createElement(
|
|
6775
6958
|
EmailField,
|
|
6776
6959
|
{
|
|
6777
6960
|
bind: "from",
|
|
@@ -6779,7 +6962,7 @@ var FromEmailField = () => /* @__PURE__ */ React102.createElement(
|
|
|
6779
6962
|
placeholder: __51("What email should appear as the sender?", "elementor")
|
|
6780
6963
|
}
|
|
6781
6964
|
);
|
|
6782
|
-
var FromNameField = () => /* @__PURE__ */
|
|
6965
|
+
var FromNameField = () => /* @__PURE__ */ React103.createElement(
|
|
6783
6966
|
EmailField,
|
|
6784
6967
|
{
|
|
6785
6968
|
bind: "from-name",
|
|
@@ -6787,10 +6970,10 @@ var FromNameField = () => /* @__PURE__ */ React102.createElement(
|
|
|
6787
6970
|
placeholder: __51("What name should appear as the sender?", "elementor")
|
|
6788
6971
|
}
|
|
6789
6972
|
);
|
|
6790
|
-
var ReplyToField = () => /* @__PURE__ */
|
|
6791
|
-
var CcField = () => /* @__PURE__ */
|
|
6792
|
-
var BccField = () => /* @__PURE__ */
|
|
6793
|
-
var MetaDataField = () => /* @__PURE__ */
|
|
6973
|
+
var ReplyToField = () => /* @__PURE__ */ React103.createElement(EmailField, { bind: "reply-to", label: __51("Reply-to", "elementor") });
|
|
6974
|
+
var CcField = () => /* @__PURE__ */ React103.createElement(EmailField, { bind: "cc", label: __51("Cc", "elementor") });
|
|
6975
|
+
var BccField = () => /* @__PURE__ */ React103.createElement(EmailField, { bind: "bcc", label: __51("Bcc", "elementor") });
|
|
6976
|
+
var MetaDataField = () => /* @__PURE__ */ React103.createElement(PropKeyProvider, { bind: "meta-data" }, /* @__PURE__ */ React103.createElement(Stack17, { gap: 0.5 }, /* @__PURE__ */ React103.createElement(ControlFormLabel, null, __51("Metadata", "elementor")), /* @__PURE__ */ React103.createElement(
|
|
6794
6977
|
ChipsControl,
|
|
6795
6978
|
{
|
|
6796
6979
|
options: [
|
|
@@ -6802,7 +6985,7 @@ var MetaDataField = () => /* @__PURE__ */ React102.createElement(PropKeyProvider
|
|
|
6802
6985
|
]
|
|
6803
6986
|
}
|
|
6804
6987
|
)));
|
|
6805
|
-
var SendAsField = () => /* @__PURE__ */
|
|
6988
|
+
var SendAsField = () => /* @__PURE__ */ React103.createElement(PropKeyProvider, { bind: "send-as" }, /* @__PURE__ */ React103.createElement(Grid29, { container: true, direction: "column", gap: 0.5 }, /* @__PURE__ */ React103.createElement(Grid29, { item: true }, /* @__PURE__ */ React103.createElement(ControlFormLabel, null, __51("Send as", "elementor"))), /* @__PURE__ */ React103.createElement(Grid29, { item: true }, /* @__PURE__ */ React103.createElement(
|
|
6806
6989
|
SelectControl,
|
|
6807
6990
|
{
|
|
6808
6991
|
options: [
|
|
@@ -6811,24 +6994,24 @@ var SendAsField = () => /* @__PURE__ */ React102.createElement(PropKeyProvider,
|
|
|
6811
6994
|
]
|
|
6812
6995
|
}
|
|
6813
6996
|
))));
|
|
6814
|
-
var AdvancedSettings = () => /* @__PURE__ */
|
|
6997
|
+
var AdvancedSettings = () => /* @__PURE__ */ React103.createElement(CollapsibleContent, { defaultOpen: false }, /* @__PURE__ */ React103.createElement(Box24, { sx: { pt: 2 } }, /* @__PURE__ */ React103.createElement(Stack17, { gap: 2 }, /* @__PURE__ */ React103.createElement(FromNameField, null), /* @__PURE__ */ React103.createElement(ReplyToField, null), /* @__PURE__ */ React103.createElement(CcField, null), /* @__PURE__ */ React103.createElement(BccField, null), /* @__PURE__ */ React103.createElement(Divider5, null), /* @__PURE__ */ React103.createElement(MetaDataField, null), /* @__PURE__ */ React103.createElement(SendAsField, null))));
|
|
6815
6998
|
var EmailFormActionControl = createControl(({ toPlaceholder }) => {
|
|
6816
6999
|
const { value, setValue, ...propContext } = useBoundProp(emailPropTypeUtil);
|
|
6817
|
-
return /* @__PURE__ */
|
|
7000
|
+
return /* @__PURE__ */ React103.createElement(PropProvider, { ...propContext, value, setValue }, /* @__PURE__ */ React103.createElement(Stack17, { gap: 2 }, /* @__PURE__ */ React103.createElement(ControlLabel, null, __51("Email settings", "elementor")), /* @__PURE__ */ React103.createElement(SendToField, { placeholder: toPlaceholder }), /* @__PURE__ */ React103.createElement(SubjectField, null), /* @__PURE__ */ React103.createElement(MessageField, null), /* @__PURE__ */ React103.createElement(FromEmailField, null), /* @__PURE__ */ React103.createElement(AdvancedSettings, null)));
|
|
6818
7001
|
});
|
|
6819
7002
|
|
|
6820
7003
|
// src/controls/size-control/unstable-size-control.tsx
|
|
6821
|
-
import * as
|
|
7004
|
+
import * as React109 from "react";
|
|
6822
7005
|
import { sizePropTypeUtil as sizePropTypeUtil6 } from "@elementor/editor-props";
|
|
6823
7006
|
|
|
6824
7007
|
// src/controls/size-control/size-component.tsx
|
|
6825
|
-
import * as
|
|
7008
|
+
import * as React108 from "react";
|
|
6826
7009
|
import { useEffect as useEffect16 } from "react";
|
|
6827
7010
|
import { useActiveBreakpoint as useActiveBreakpoint4 } from "@elementor/editor-responsive";
|
|
6828
7011
|
import { Box as Box25, usePopupState as usePopupState9 } from "@elementor/ui";
|
|
6829
7012
|
|
|
6830
7013
|
// src/controls/size-control/size-field.tsx
|
|
6831
|
-
import * as
|
|
7014
|
+
import * as React106 from "react";
|
|
6832
7015
|
import { MathFunctionIcon as MathFunctionIcon3 } from "@elementor/icons";
|
|
6833
7016
|
import { InputAdornment as InputAdornment5 } from "@elementor/ui";
|
|
6834
7017
|
|
|
@@ -6946,9 +7129,9 @@ var sanitizeSize = (size) => {
|
|
|
6946
7129
|
};
|
|
6947
7130
|
|
|
6948
7131
|
// src/controls/size-control/hooks/use-unit-sync.ts
|
|
6949
|
-
import { useEffect as useEffect14, useState as
|
|
7132
|
+
import { useEffect as useEffect14, useState as useState18 } from "react";
|
|
6950
7133
|
var useUnitSync = ({ unit, setUnit, persistWhen }) => {
|
|
6951
|
-
const [state, setState] =
|
|
7134
|
+
const [state, setState] = useState18(unit);
|
|
6952
7135
|
useEffect14(() => {
|
|
6953
7136
|
if (unit !== state) {
|
|
6954
7137
|
setState(unit);
|
|
@@ -7024,7 +7207,7 @@ var hasChanged = (next, current) => {
|
|
|
7024
7207
|
};
|
|
7025
7208
|
|
|
7026
7209
|
// src/controls/size-control/ui/size-input.tsx
|
|
7027
|
-
import * as
|
|
7210
|
+
import * as React104 from "react";
|
|
7028
7211
|
import { forwardRef as forwardRef11 } from "react";
|
|
7029
7212
|
var SizeInput2 = forwardRef11(
|
|
7030
7213
|
({
|
|
@@ -7041,7 +7224,7 @@ var SizeInput2 = forwardRef11(
|
|
|
7041
7224
|
inputProps,
|
|
7042
7225
|
placeholder
|
|
7043
7226
|
}, ref) => {
|
|
7044
|
-
return /* @__PURE__ */
|
|
7227
|
+
return /* @__PURE__ */ React104.createElement(
|
|
7045
7228
|
NumberInput,
|
|
7046
7229
|
{
|
|
7047
7230
|
id,
|
|
@@ -7069,10 +7252,10 @@ var getCursorStyle = (readOnly) => ({
|
|
|
7069
7252
|
});
|
|
7070
7253
|
|
|
7071
7254
|
// src/controls/size-control/ui/unit-selector.tsx
|
|
7072
|
-
import * as
|
|
7255
|
+
import * as React105 from "react";
|
|
7073
7256
|
import { useId as useId3 } from "react";
|
|
7074
7257
|
import { MenuListItem as MenuListItem7 } from "@elementor/editor-ui";
|
|
7075
|
-
import { bindMenu as bindMenu2, bindTrigger as bindTrigger6, Button as Button6, Menu as Menu3, styled as
|
|
7258
|
+
import { bindMenu as bindMenu2, bindTrigger as bindTrigger6, Button as Button6, Menu as Menu3, styled as styled10, usePopupState as usePopupState8 } from "@elementor/ui";
|
|
7076
7259
|
var menuItemContentStyles = {
|
|
7077
7260
|
display: "flex",
|
|
7078
7261
|
flexDirection: "column",
|
|
@@ -7095,7 +7278,7 @@ var UnitSelector = ({
|
|
|
7095
7278
|
onSelect(option);
|
|
7096
7279
|
popupState.close();
|
|
7097
7280
|
};
|
|
7098
|
-
return /* @__PURE__ */
|
|
7281
|
+
return /* @__PURE__ */ React105.createElement(React105.Fragment, null, /* @__PURE__ */ React105.createElement(
|
|
7099
7282
|
StyledButton2,
|
|
7100
7283
|
{
|
|
7101
7284
|
isHighlighted: isUnitHighlighted,
|
|
@@ -7104,7 +7287,7 @@ var UnitSelector = ({
|
|
|
7104
7287
|
...bindTrigger6(popupState)
|
|
7105
7288
|
},
|
|
7106
7289
|
optionLabelOverrides[value] ?? value
|
|
7107
|
-
), /* @__PURE__ */
|
|
7290
|
+
), /* @__PURE__ */ React105.createElement(Menu3, { MenuListProps: { dense: true }, ...bindMenu2(popupState) }, options.map((option) => /* @__PURE__ */ React105.createElement(
|
|
7108
7291
|
MenuListItem7,
|
|
7109
7292
|
{
|
|
7110
7293
|
key: option,
|
|
@@ -7124,7 +7307,7 @@ var UnitSelector = ({
|
|
|
7124
7307
|
optionLabelOverrides[option] ?? option.toUpperCase()
|
|
7125
7308
|
))));
|
|
7126
7309
|
};
|
|
7127
|
-
var StyledButton2 =
|
|
7310
|
+
var StyledButton2 = styled10(Button6, {
|
|
7128
7311
|
shouldForwardProp: (prop) => prop !== "isHighlighted"
|
|
7129
7312
|
})(({ isHighlighted, theme }) => ({
|
|
7130
7313
|
color: isHighlighted ? theme.palette.text.primary : theme.palette.text.tertiary,
|
|
@@ -7135,7 +7318,7 @@ var StyledButton2 = styled9(Button6, {
|
|
|
7135
7318
|
|
|
7136
7319
|
// src/controls/size-control/size-field.tsx
|
|
7137
7320
|
var UNIT_DISPLAY_LABELS_OVERRIDES = {
|
|
7138
|
-
custom: /* @__PURE__ */
|
|
7321
|
+
custom: /* @__PURE__ */ React106.createElement(MathFunctionIcon3, { fontSize: "tiny" })
|
|
7139
7322
|
};
|
|
7140
7323
|
var SizeField = ({
|
|
7141
7324
|
value,
|
|
@@ -7170,7 +7353,7 @@ var SizeField = ({
|
|
|
7170
7353
|
setSize(newSize, isInputValid);
|
|
7171
7354
|
};
|
|
7172
7355
|
const inputType = isExtendedUnit(unit) ? "text" : "number";
|
|
7173
|
-
return /* @__PURE__ */
|
|
7356
|
+
return /* @__PURE__ */ React106.createElement(
|
|
7174
7357
|
SizeInput2,
|
|
7175
7358
|
{
|
|
7176
7359
|
disabled,
|
|
@@ -7185,8 +7368,8 @@ var SizeField = ({
|
|
|
7185
7368
|
...InputProps,
|
|
7186
7369
|
autoComplete: "off",
|
|
7187
7370
|
readOnly: isExtendedUnit(unit),
|
|
7188
|
-
startAdornment: startIcon && /* @__PURE__ */
|
|
7189
|
-
endAdornment: /* @__PURE__ */
|
|
7371
|
+
startAdornment: startIcon && /* @__PURE__ */ React106.createElement(InputAdornment5, { position: "start", disabled }, startIcon),
|
|
7372
|
+
endAdornment: /* @__PURE__ */ React106.createElement(InputAdornment5, { position: "end" }, /* @__PURE__ */ React106.createElement(
|
|
7190
7373
|
UnitSelector,
|
|
7191
7374
|
{
|
|
7192
7375
|
options: units2,
|
|
@@ -7213,7 +7396,7 @@ var shouldHighlightUnit = (value) => {
|
|
|
7213
7396
|
};
|
|
7214
7397
|
|
|
7215
7398
|
// src/controls/size-control/ui/text-field-popover.tsx
|
|
7216
|
-
import * as
|
|
7399
|
+
import * as React107 from "react";
|
|
7217
7400
|
import { useEffect as useEffect15, useRef as useRef25 } from "react";
|
|
7218
7401
|
import { PopoverHeader as PopoverHeader4 } from "@elementor/editor-ui";
|
|
7219
7402
|
import { MathFunctionIcon as MathFunctionIcon4 } from "@elementor/icons";
|
|
@@ -7240,7 +7423,7 @@ var TextFieldPopover2 = ({ popupState, anchorRef, value, onChange, onClose }) =>
|
|
|
7240
7423
|
onClose?.();
|
|
7241
7424
|
popupState.close();
|
|
7242
7425
|
};
|
|
7243
|
-
return /* @__PURE__ */
|
|
7426
|
+
return /* @__PURE__ */ React107.createElement(
|
|
7244
7427
|
Popover7,
|
|
7245
7428
|
{
|
|
7246
7429
|
disablePortal: true,
|
|
@@ -7257,15 +7440,15 @@ var TextFieldPopover2 = ({ popupState, anchorRef, value, onChange, onClose }) =>
|
|
|
7257
7440
|
transformOrigin: { vertical: "top", horizontal: "center" },
|
|
7258
7441
|
onClose: handleClose
|
|
7259
7442
|
},
|
|
7260
|
-
/* @__PURE__ */
|
|
7443
|
+
/* @__PURE__ */ React107.createElement(
|
|
7261
7444
|
PopoverHeader4,
|
|
7262
7445
|
{
|
|
7263
7446
|
title: __52("CSS function", "elementor"),
|
|
7264
7447
|
onClose: handleClose,
|
|
7265
|
-
icon: /* @__PURE__ */
|
|
7448
|
+
icon: /* @__PURE__ */ React107.createElement(MathFunctionIcon4, { fontSize: SIZE10 })
|
|
7266
7449
|
}
|
|
7267
7450
|
),
|
|
7268
|
-
/* @__PURE__ */
|
|
7451
|
+
/* @__PURE__ */ React107.createElement(
|
|
7269
7452
|
TextField9,
|
|
7270
7453
|
{
|
|
7271
7454
|
value,
|
|
@@ -7284,7 +7467,7 @@ var TextFieldPopover2 = ({ popupState, anchorRef, value, onChange, onClose }) =>
|
|
|
7284
7467
|
};
|
|
7285
7468
|
|
|
7286
7469
|
// src/controls/size-control/size-component.tsx
|
|
7287
|
-
var SizeComponent = ({ anchorRef, SizeFieldWrapper =
|
|
7470
|
+
var SizeComponent = ({ anchorRef, SizeFieldWrapper = React108.Fragment, ...sizeFieldProps }) => {
|
|
7288
7471
|
const popupState = usePopupState9({ variant: "popover" });
|
|
7289
7472
|
const activeBreakpoint = useActiveBreakpoint4();
|
|
7290
7473
|
const isCustomUnit = sizeFieldProps?.value?.unit === EXTENDED_UNITS.custom;
|
|
@@ -7314,7 +7497,7 @@ var SizeComponent = ({ anchorRef, SizeFieldWrapper = React107.Fragment, ...sizeF
|
|
|
7314
7497
|
"aria-controls": popupState.isOpen ? popupState.popupId : void 0,
|
|
7315
7498
|
"aria-haspopup": true
|
|
7316
7499
|
};
|
|
7317
|
-
return /* @__PURE__ */
|
|
7500
|
+
return /* @__PURE__ */ React108.createElement(React108.Fragment, null, /* @__PURE__ */ React108.createElement(SizeFieldWrapper, null, /* @__PURE__ */ React108.createElement(Box25, null, /* @__PURE__ */ React108.createElement(
|
|
7318
7501
|
SizeField,
|
|
7319
7502
|
{
|
|
7320
7503
|
focused: popupState.isOpen ? true : void 0,
|
|
@@ -7328,7 +7511,7 @@ var SizeComponent = ({ anchorRef, SizeFieldWrapper = React107.Fragment, ...sizeF
|
|
|
7328
7511
|
},
|
|
7329
7512
|
...sizeFieldProps
|
|
7330
7513
|
}
|
|
7331
|
-
))), popupState.isOpen && anchorRef?.current && /* @__PURE__ */
|
|
7514
|
+
))), popupState.isOpen && anchorRef?.current && /* @__PURE__ */ React108.createElement(
|
|
7332
7515
|
TextFieldPopover2,
|
|
7333
7516
|
{
|
|
7334
7517
|
popupState,
|
|
@@ -7448,7 +7631,7 @@ var UnstableSizeControl = createControl(
|
|
|
7448
7631
|
}
|
|
7449
7632
|
});
|
|
7450
7633
|
};
|
|
7451
|
-
return /* @__PURE__ */
|
|
7634
|
+
return /* @__PURE__ */ React109.createElement(
|
|
7452
7635
|
SizeComponent,
|
|
7453
7636
|
{
|
|
7454
7637
|
units: units2,
|
|
@@ -7468,15 +7651,15 @@ var UnstableSizeControl = createControl(
|
|
|
7468
7651
|
);
|
|
7469
7652
|
|
|
7470
7653
|
// src/components/promotions/display-conditions-control.tsx
|
|
7471
|
-
import * as
|
|
7654
|
+
import * as React111 from "react";
|
|
7472
7655
|
import { useRef as useRef26 } from "react";
|
|
7473
7656
|
import { SitemapIcon } from "@elementor/icons";
|
|
7474
7657
|
import { IconButton as IconButton8, Stack as Stack18, Tooltip as Tooltip9 } from "@elementor/ui";
|
|
7475
7658
|
import { __ as __53 } from "@wordpress/i18n";
|
|
7476
7659
|
|
|
7477
7660
|
// src/components/promotions/promotion-trigger.tsx
|
|
7478
|
-
import * as
|
|
7479
|
-
import { forwardRef as forwardRef12, useCallback as
|
|
7661
|
+
import * as React110 from "react";
|
|
7662
|
+
import { forwardRef as forwardRef12, useCallback as useCallback5, useImperativeHandle, useState as useState19 } from "react";
|
|
7480
7663
|
import { PromotionChip as PromotionChip2, PromotionInfotip } from "@elementor/editor-ui";
|
|
7481
7664
|
import { Box as Box26 } from "@elementor/ui";
|
|
7482
7665
|
function getV4Promotion(key) {
|
|
@@ -7484,9 +7667,9 @@ function getV4Promotion(key) {
|
|
|
7484
7667
|
}
|
|
7485
7668
|
var PromotionTrigger = forwardRef12(
|
|
7486
7669
|
({ promotionKey, children, trackingData }, ref) => {
|
|
7487
|
-
const [isOpen, setIsOpen] =
|
|
7670
|
+
const [isOpen, setIsOpen] = useState19(false);
|
|
7488
7671
|
const promotion = getV4Promotion(promotionKey);
|
|
7489
|
-
const toggle =
|
|
7672
|
+
const toggle = useCallback5(() => {
|
|
7490
7673
|
setIsOpen((prev) => {
|
|
7491
7674
|
if (!prev) {
|
|
7492
7675
|
trackViewPromotion(trackingData);
|
|
@@ -7495,7 +7678,7 @@ var PromotionTrigger = forwardRef12(
|
|
|
7495
7678
|
});
|
|
7496
7679
|
}, [trackingData]);
|
|
7497
7680
|
useImperativeHandle(ref, () => ({ toggle }), [toggle]);
|
|
7498
|
-
return /* @__PURE__ */
|
|
7681
|
+
return /* @__PURE__ */ React110.createElement(React110.Fragment, null, promotion && /* @__PURE__ */ React110.createElement(
|
|
7499
7682
|
PromotionInfotip,
|
|
7500
7683
|
{
|
|
7501
7684
|
title: promotion.title,
|
|
@@ -7509,7 +7692,7 @@ var PromotionTrigger = forwardRef12(
|
|
|
7509
7692
|
},
|
|
7510
7693
|
onCtaClick: () => trackUpgradePromotionClick(trackingData)
|
|
7511
7694
|
},
|
|
7512
|
-
/* @__PURE__ */
|
|
7695
|
+
/* @__PURE__ */ React110.createElement(
|
|
7513
7696
|
Box26,
|
|
7514
7697
|
{
|
|
7515
7698
|
onClick: (e) => {
|
|
@@ -7518,7 +7701,7 @@ var PromotionTrigger = forwardRef12(
|
|
|
7518
7701
|
},
|
|
7519
7702
|
sx: { cursor: "pointer", display: "inline-flex" }
|
|
7520
7703
|
},
|
|
7521
|
-
children ?? /* @__PURE__ */
|
|
7704
|
+
children ?? /* @__PURE__ */ React110.createElement(PromotionChip2, null)
|
|
7522
7705
|
)
|
|
7523
7706
|
));
|
|
7524
7707
|
}
|
|
@@ -7529,7 +7712,7 @@ var ARIA_LABEL = __53("Display Conditions", "elementor");
|
|
|
7529
7712
|
var TRACKING_DATA = { target_name: "display_conditions", location_l2: "general" };
|
|
7530
7713
|
var DisplayConditionsControl = createControl(() => {
|
|
7531
7714
|
const triggerRef = useRef26(null);
|
|
7532
|
-
return /* @__PURE__ */
|
|
7715
|
+
return /* @__PURE__ */ React111.createElement(
|
|
7533
7716
|
Stack18,
|
|
7534
7717
|
{
|
|
7535
7718
|
direction: "row",
|
|
@@ -7539,8 +7722,8 @@ var DisplayConditionsControl = createControl(() => {
|
|
|
7539
7722
|
alignItems: "center"
|
|
7540
7723
|
}
|
|
7541
7724
|
},
|
|
7542
|
-
/* @__PURE__ */
|
|
7543
|
-
/* @__PURE__ */
|
|
7725
|
+
/* @__PURE__ */ React111.createElement(PromotionTrigger, { ref: triggerRef, promotionKey: "displayConditions", trackingData: TRACKING_DATA }),
|
|
7726
|
+
/* @__PURE__ */ React111.createElement(Tooltip9, { title: ARIA_LABEL, placement: "top" }, /* @__PURE__ */ React111.createElement(
|
|
7544
7727
|
IconButton8,
|
|
7545
7728
|
{
|
|
7546
7729
|
size: "tiny",
|
|
@@ -7553,13 +7736,13 @@ var DisplayConditionsControl = createControl(() => {
|
|
|
7553
7736
|
borderRadius: 1
|
|
7554
7737
|
}
|
|
7555
7738
|
},
|
|
7556
|
-
/* @__PURE__ */
|
|
7739
|
+
/* @__PURE__ */ React111.createElement(SitemapIcon, { fontSize: "tiny", color: "disabled" })
|
|
7557
7740
|
))
|
|
7558
7741
|
);
|
|
7559
7742
|
});
|
|
7560
7743
|
|
|
7561
7744
|
// src/components/promotions/attributes-control.tsx
|
|
7562
|
-
import * as
|
|
7745
|
+
import * as React112 from "react";
|
|
7563
7746
|
import { useRef as useRef27 } from "react";
|
|
7564
7747
|
import { PlusIcon as PlusIcon3 } from "@elementor/icons";
|
|
7565
7748
|
import { Stack as Stack19, Tooltip as Tooltip10 } from "@elementor/ui";
|
|
@@ -7568,7 +7751,7 @@ var ARIA_LABEL2 = __54("Attributes", "elementor");
|
|
|
7568
7751
|
var TRACKING_DATA2 = { target_name: "attributes", location_l2: "general" };
|
|
7569
7752
|
var AttributesControl = createControl(() => {
|
|
7570
7753
|
const triggerRef = useRef27(null);
|
|
7571
|
-
return /* @__PURE__ */
|
|
7754
|
+
return /* @__PURE__ */ React112.createElement(
|
|
7572
7755
|
Stack19,
|
|
7573
7756
|
{
|
|
7574
7757
|
direction: "row",
|
|
@@ -7578,8 +7761,8 @@ var AttributesControl = createControl(() => {
|
|
|
7578
7761
|
alignItems: "center"
|
|
7579
7762
|
}
|
|
7580
7763
|
},
|
|
7581
|
-
/* @__PURE__ */
|
|
7582
|
-
/* @__PURE__ */
|
|
7764
|
+
/* @__PURE__ */ React112.createElement(PromotionTrigger, { ref: triggerRef, promotionKey: "attributes", trackingData: TRACKING_DATA2 }),
|
|
7765
|
+
/* @__PURE__ */ React112.createElement(Tooltip10, { title: ARIA_LABEL2, placement: "top" }, /* @__PURE__ */ React112.createElement(
|
|
7583
7766
|
PlusIcon3,
|
|
7584
7767
|
{
|
|
7585
7768
|
"aria-label": ARIA_LABEL2,
|
|
@@ -7593,18 +7776,18 @@ var AttributesControl = createControl(() => {
|
|
|
7593
7776
|
});
|
|
7594
7777
|
|
|
7595
7778
|
// src/components/icon-buttons/clear-icon-button.tsx
|
|
7596
|
-
import * as
|
|
7779
|
+
import * as React113 from "react";
|
|
7597
7780
|
import { BrushBigIcon } from "@elementor/icons";
|
|
7598
|
-
import { IconButton as IconButton9, styled as
|
|
7599
|
-
var CustomIconButton =
|
|
7781
|
+
import { IconButton as IconButton9, styled as styled11, Tooltip as Tooltip11 } from "@elementor/ui";
|
|
7782
|
+
var CustomIconButton = styled11(IconButton9)(({ theme }) => ({
|
|
7600
7783
|
width: theme.spacing(2.5),
|
|
7601
7784
|
height: theme.spacing(2.5)
|
|
7602
7785
|
}));
|
|
7603
|
-
var ClearIconButton = ({ tooltipText, onClick, disabled, size = "tiny" }) => /* @__PURE__ */
|
|
7786
|
+
var ClearIconButton = ({ tooltipText, onClick, disabled, size = "tiny" }) => /* @__PURE__ */ React113.createElement(Tooltip11, { title: tooltipText, placement: "top", disableInteractive: true }, /* @__PURE__ */ React113.createElement(CustomIconButton, { "aria-label": tooltipText, size, onClick, disabled }, /* @__PURE__ */ React113.createElement(BrushBigIcon, { fontSize: size })));
|
|
7604
7787
|
|
|
7605
7788
|
// src/components/repeater/repeater.tsx
|
|
7606
|
-
import * as
|
|
7607
|
-
import { useEffect as useEffect17, useState as
|
|
7789
|
+
import * as React114 from "react";
|
|
7790
|
+
import { useEffect as useEffect17, useState as useState20 } from "react";
|
|
7608
7791
|
import { CopyIcon as CopyIcon2, EyeIcon as EyeIcon2, EyeOffIcon as EyeOffIcon2, PlusIcon as PlusIcon4, XIcon as XIcon4 } from "@elementor/icons";
|
|
7609
7792
|
import {
|
|
7610
7793
|
bindPopover as bindPopover8,
|
|
@@ -7634,7 +7817,7 @@ var Repeater3 = ({
|
|
|
7634
7817
|
openItem: initialOpenItem = EMPTY_OPEN_ITEM2,
|
|
7635
7818
|
isSortable = true
|
|
7636
7819
|
}) => {
|
|
7637
|
-
const [openItem, setOpenItem] =
|
|
7820
|
+
const [openItem, setOpenItem] = useState20(initialOpenItem);
|
|
7638
7821
|
const uniqueKeys = items2.map(
|
|
7639
7822
|
(item, index) => isSortable && "getId" in itemSettings ? itemSettings.getId({ item, index }) : String(index)
|
|
7640
7823
|
);
|
|
@@ -7697,7 +7880,7 @@ var Repeater3 = ({
|
|
|
7697
7880
|
};
|
|
7698
7881
|
const isButtonDisabled = disabled || disableAddItemButton;
|
|
7699
7882
|
const shouldShowInfotip = isButtonDisabled && addButtonInfotipContent;
|
|
7700
|
-
const addButton = /* @__PURE__ */
|
|
7883
|
+
const addButton = /* @__PURE__ */ React114.createElement(
|
|
7701
7884
|
IconButton10,
|
|
7702
7885
|
{
|
|
7703
7886
|
size: SIZE11,
|
|
@@ -7708,9 +7891,9 @@ var Repeater3 = ({
|
|
|
7708
7891
|
onClick: addRepeaterItem,
|
|
7709
7892
|
"aria-label": __55("Add item", "elementor")
|
|
7710
7893
|
},
|
|
7711
|
-
/* @__PURE__ */
|
|
7894
|
+
/* @__PURE__ */ React114.createElement(PlusIcon4, { fontSize: SIZE11 })
|
|
7712
7895
|
);
|
|
7713
|
-
return /* @__PURE__ */
|
|
7896
|
+
return /* @__PURE__ */ React114.createElement(SectionContent, { gap: 2 }, /* @__PURE__ */ React114.createElement(RepeaterHeader, { label, adornment: ControlAdornments }, shouldShowInfotip ? /* @__PURE__ */ React114.createElement(
|
|
7714
7897
|
Infotip4,
|
|
7715
7898
|
{
|
|
7716
7899
|
placement: "right",
|
|
@@ -7718,20 +7901,20 @@ var Repeater3 = ({
|
|
|
7718
7901
|
color: "secondary",
|
|
7719
7902
|
slotProps: { popper: { sx: { width: 300 } } }
|
|
7720
7903
|
},
|
|
7721
|
-
/* @__PURE__ */
|
|
7722
|
-
) : addButton), 0 < uniqueKeys.length && /* @__PURE__ */
|
|
7904
|
+
/* @__PURE__ */ React114.createElement(Box27, { sx: { ...isButtonDisabled ? { cursor: "not-allowed" } : {} } }, addButton)
|
|
7905
|
+
) : addButton), 0 < uniqueKeys.length && /* @__PURE__ */ React114.createElement(SortableProvider, { value: uniqueKeys, onChange: onChangeOrder }, uniqueKeys.map((key) => {
|
|
7723
7906
|
const index = uniqueKeys.indexOf(key);
|
|
7724
7907
|
const value = items2[index];
|
|
7725
7908
|
if (!value) {
|
|
7726
7909
|
return null;
|
|
7727
7910
|
}
|
|
7728
|
-
return /* @__PURE__ */
|
|
7911
|
+
return /* @__PURE__ */ React114.createElement(SortableItem, { id: key, key: `sortable-${key}`, disabled: !isSortable }, /* @__PURE__ */ React114.createElement(
|
|
7729
7912
|
RepeaterItem,
|
|
7730
7913
|
{
|
|
7731
7914
|
disabled,
|
|
7732
7915
|
propDisabled: value?.disabled,
|
|
7733
|
-
label: /* @__PURE__ */
|
|
7734
|
-
startIcon: /* @__PURE__ */
|
|
7916
|
+
label: /* @__PURE__ */ React114.createElement(RepeaterItemLabelSlot, { value }, /* @__PURE__ */ React114.createElement(itemSettings.Label, { value, index })),
|
|
7917
|
+
startIcon: /* @__PURE__ */ React114.createElement(RepeaterItemIconSlot, { value }, /* @__PURE__ */ React114.createElement(itemSettings.Icon, { value })),
|
|
7735
7918
|
removeItem: () => removeRepeaterItem(index),
|
|
7736
7919
|
duplicateItem: () => duplicateRepeaterItem(index),
|
|
7737
7920
|
toggleDisableItem: () => toggleDisableRepeaterItem(index),
|
|
@@ -7745,7 +7928,7 @@ var Repeater3 = ({
|
|
|
7745
7928
|
actions: itemSettings.actions,
|
|
7746
7929
|
value
|
|
7747
7930
|
},
|
|
7748
|
-
(props) => /* @__PURE__ */
|
|
7931
|
+
(props) => /* @__PURE__ */ React114.createElement(
|
|
7749
7932
|
itemSettings.Content,
|
|
7750
7933
|
{
|
|
7751
7934
|
...props,
|
|
@@ -7789,7 +7972,7 @@ var RepeaterItem = ({
|
|
|
7789
7972
|
const duplicateLabel = __55("Duplicate", "elementor");
|
|
7790
7973
|
const toggleLabel = propDisabled ? __55("Show", "elementor") : __55("Hide", "elementor");
|
|
7791
7974
|
const removeLabel = __55("Remove", "elementor");
|
|
7792
|
-
return /* @__PURE__ */
|
|
7975
|
+
return /* @__PURE__ */ React114.createElement(React114.Fragment, null, /* @__PURE__ */ React114.createElement(
|
|
7793
7976
|
RepeaterTag,
|
|
7794
7977
|
{
|
|
7795
7978
|
disabled,
|
|
@@ -7804,20 +7987,20 @@ var RepeaterItem = ({
|
|
|
7804
7987
|
}
|
|
7805
7988
|
},
|
|
7806
7989
|
startIcon,
|
|
7807
|
-
actions: /* @__PURE__ */
|
|
7990
|
+
actions: /* @__PURE__ */ React114.createElement(React114.Fragment, null, showDuplicate && /* @__PURE__ */ React114.createElement(Tooltip12, { title: duplicateLabel, placement: "top" }, /* @__PURE__ */ React114.createElement(IconButton10, { size: SIZE11, onClick: duplicateItem, "aria-label": duplicateLabel }, /* @__PURE__ */ React114.createElement(CopyIcon2, { fontSize: SIZE11 }))), showToggle && /* @__PURE__ */ React114.createElement(Tooltip12, { title: toggleLabel, placement: "top" }, /* @__PURE__ */ React114.createElement(IconButton10, { size: SIZE11, onClick: toggleDisableItem, "aria-label": toggleLabel }, propDisabled ? /* @__PURE__ */ React114.createElement(EyeOffIcon2, { fontSize: SIZE11 }) : /* @__PURE__ */ React114.createElement(EyeIcon2, { fontSize: SIZE11 }))), actions?.(value), showRemove && /* @__PURE__ */ React114.createElement(Tooltip12, { title: removeLabel, placement: "top" }, /* @__PURE__ */ React114.createElement(IconButton10, { size: SIZE11, onClick: removeItem, "aria-label": removeLabel }, /* @__PURE__ */ React114.createElement(XIcon4, { fontSize: SIZE11 }))))
|
|
7808
7991
|
}
|
|
7809
|
-
), /* @__PURE__ */
|
|
7992
|
+
), /* @__PURE__ */ React114.createElement(RepeaterPopover, { width: ref?.getBoundingClientRect().width, ...popoverProps, anchorEl: ref }, /* @__PURE__ */ React114.createElement(
|
|
7810
7993
|
ClickAwayListener,
|
|
7811
7994
|
{
|
|
7812
7995
|
mouseEvent: "onMouseDown",
|
|
7813
7996
|
touchEvent: "onTouchStart",
|
|
7814
7997
|
onClickAway: popoverProps.onClose
|
|
7815
7998
|
},
|
|
7816
|
-
/* @__PURE__ */
|
|
7999
|
+
/* @__PURE__ */ React114.createElement(Box27, null, children({ anchorEl: ref }))
|
|
7817
8000
|
)));
|
|
7818
8001
|
};
|
|
7819
8002
|
var usePopover = (openOnMount, onOpen, onPopoverClose) => {
|
|
7820
|
-
const [ref, setRef] =
|
|
8003
|
+
const [ref, setRef] = useState20(null);
|
|
7821
8004
|
const popoverState = usePopupState10({ variant: "popover" });
|
|
7822
8005
|
const popoverProps = bindPopover8(popoverState);
|
|
7823
8006
|
useEffect17(() => {
|
|
@@ -7839,9 +8022,9 @@ var usePopover = (openOnMount, onOpen, onPopoverClose) => {
|
|
|
7839
8022
|
};
|
|
7840
8023
|
|
|
7841
8024
|
// src/components/inline-editor-toolbar.tsx
|
|
7842
|
-
import * as
|
|
7843
|
-
import { useEffect as useEffect19, useMemo as useMemo16, useRef as useRef29, useState as
|
|
7844
|
-
import { getContainer, getElementSetting } from "@elementor/editor-elements";
|
|
8025
|
+
import * as React116 from "react";
|
|
8026
|
+
import { useEffect as useEffect19, useMemo as useMemo16, useRef as useRef29, useState as useState21 } from "react";
|
|
8027
|
+
import { getContainer as getContainer2, getElementSetting } from "@elementor/editor-elements";
|
|
7845
8028
|
import {
|
|
7846
8029
|
BoldIcon,
|
|
7847
8030
|
ItalicIcon,
|
|
@@ -7865,7 +8048,7 @@ import { useEditorState } from "@tiptap/react";
|
|
|
7865
8048
|
import { __ as __57 } from "@wordpress/i18n";
|
|
7866
8049
|
|
|
7867
8050
|
// src/components/url-popover.tsx
|
|
7868
|
-
import * as
|
|
8051
|
+
import * as React115 from "react";
|
|
7869
8052
|
import { useEffect as useEffect18, useRef as useRef28 } from "react";
|
|
7870
8053
|
import { ExternalLinkIcon } from "@elementor/icons";
|
|
7871
8054
|
import { bindPopover as bindPopover9, Popover as Popover8, Stack as Stack20, TextField as TextField10, ToggleButton as ToggleButton2, Tooltip as Tooltip13 } from "@elementor/ui";
|
|
@@ -7889,7 +8072,7 @@ var UrlPopover = ({
|
|
|
7889
8072
|
restoreValue();
|
|
7890
8073
|
popupState.close();
|
|
7891
8074
|
};
|
|
7892
|
-
return /* @__PURE__ */
|
|
8075
|
+
return /* @__PURE__ */ React115.createElement(
|
|
7893
8076
|
Popover8,
|
|
7894
8077
|
{
|
|
7895
8078
|
slotProps: {
|
|
@@ -7900,7 +8083,7 @@ var UrlPopover = ({
|
|
|
7900
8083
|
transformOrigin: { vertical: "top", horizontal: "left" },
|
|
7901
8084
|
onClose: handleClose
|
|
7902
8085
|
},
|
|
7903
|
-
/* @__PURE__ */
|
|
8086
|
+
/* @__PURE__ */ React115.createElement(Stack20, { direction: "row", alignItems: "center", gap: 1, sx: { p: 1.5 } }, /* @__PURE__ */ React115.createElement(
|
|
7904
8087
|
TextField10,
|
|
7905
8088
|
{
|
|
7906
8089
|
value,
|
|
@@ -7913,7 +8096,7 @@ var UrlPopover = ({
|
|
|
7913
8096
|
InputProps: { sx: { borderRadius: "8px" } },
|
|
7914
8097
|
onKeyUp: (event) => event.key === "Enter" && handleClose()
|
|
7915
8098
|
}
|
|
7916
|
-
), /* @__PURE__ */
|
|
8099
|
+
), /* @__PURE__ */ React115.createElement(Tooltip13, { title: __56("Open in a new tab", "elementor") }, /* @__PURE__ */ React115.createElement(
|
|
7917
8100
|
ToggleButton2,
|
|
7918
8101
|
{
|
|
7919
8102
|
size: "tiny",
|
|
@@ -7923,15 +8106,15 @@ var UrlPopover = ({
|
|
|
7923
8106
|
"aria-label": __56("Open in a new tab", "elementor"),
|
|
7924
8107
|
sx: { borderRadius: "8px" }
|
|
7925
8108
|
},
|
|
7926
|
-
/* @__PURE__ */
|
|
8109
|
+
/* @__PURE__ */ React115.createElement(ExternalLinkIcon, { fontSize: "tiny" })
|
|
7927
8110
|
)))
|
|
7928
8111
|
);
|
|
7929
8112
|
};
|
|
7930
8113
|
|
|
7931
8114
|
// src/components/inline-editor-toolbar.tsx
|
|
7932
8115
|
var InlineEditorToolbar = ({ editor, elementId, sx = {} }) => {
|
|
7933
|
-
const [urlValue, setUrlValue] =
|
|
7934
|
-
const [openInNewTab, setOpenInNewTab] =
|
|
8116
|
+
const [urlValue, setUrlValue] = useState21("");
|
|
8117
|
+
const [openInNewTab, setOpenInNewTab] = useState21(false);
|
|
7935
8118
|
const toolbarRef = useRef29(null);
|
|
7936
8119
|
const linkPopupState = usePopupState11({ variant: "popover" });
|
|
7937
8120
|
const isElementClickable = elementId ? checkIfElementIsClickable(elementId) : false;
|
|
@@ -7979,7 +8162,7 @@ var InlineEditorToolbar = ({ editor, elementId, sx = {} }) => {
|
|
|
7979
8162
|
useEffect19(() => {
|
|
7980
8163
|
editor?.commands?.focus();
|
|
7981
8164
|
}, [editor]);
|
|
7982
|
-
return /* @__PURE__ */
|
|
8165
|
+
return /* @__PURE__ */ React116.createElement(
|
|
7983
8166
|
Box28,
|
|
7984
8167
|
{
|
|
7985
8168
|
ref: toolbarRef,
|
|
@@ -7996,8 +8179,8 @@ var InlineEditorToolbar = ({ editor, elementId, sx = {} }) => {
|
|
|
7996
8179
|
...sx
|
|
7997
8180
|
}
|
|
7998
8181
|
},
|
|
7999
|
-
/* @__PURE__ */
|
|
8000
|
-
/* @__PURE__ */
|
|
8182
|
+
/* @__PURE__ */ React116.createElement(Tooltip14, { title: clearButton.label, placement: "top", sx: { borderRadius: "8px" } }, /* @__PURE__ */ React116.createElement(IconButton11, { "aria-label": clearButton.label, onClick: () => clearButton.method(editor), size: "tiny" }, clearButton.icon)),
|
|
8183
|
+
/* @__PURE__ */ React116.createElement(
|
|
8001
8184
|
ToggleButtonGroup2,
|
|
8002
8185
|
{
|
|
8003
8186
|
value: editorState,
|
|
@@ -8019,7 +8202,7 @@ var InlineEditorToolbar = ({ editor, elementId, sx = {} }) => {
|
|
|
8019
8202
|
}
|
|
8020
8203
|
}
|
|
8021
8204
|
},
|
|
8022
|
-
formatButtonsList.map((button) => /* @__PURE__ */
|
|
8205
|
+
formatButtonsList.map((button) => /* @__PURE__ */ React116.createElement(Tooltip14, { title: button.label, key: button.action, placement: "top" }, /* @__PURE__ */ React116.createElement(
|
|
8023
8206
|
ToggleButton3,
|
|
8024
8207
|
{
|
|
8025
8208
|
value: button.action,
|
|
@@ -8037,7 +8220,7 @@ var InlineEditorToolbar = ({ editor, elementId, sx = {} }) => {
|
|
|
8037
8220
|
button.icon
|
|
8038
8221
|
)))
|
|
8039
8222
|
),
|
|
8040
|
-
/* @__PURE__ */
|
|
8223
|
+
/* @__PURE__ */ React116.createElement(
|
|
8041
8224
|
UrlPopover,
|
|
8042
8225
|
{
|
|
8043
8226
|
popupState: linkPopupState,
|
|
@@ -8052,7 +8235,7 @@ var InlineEditorToolbar = ({ editor, elementId, sx = {} }) => {
|
|
|
8052
8235
|
);
|
|
8053
8236
|
};
|
|
8054
8237
|
var checkIfElementIsClickable = (elementId) => {
|
|
8055
|
-
const container =
|
|
8238
|
+
const container = getContainer2(elementId);
|
|
8056
8239
|
const type = container?.model.get("widgetType");
|
|
8057
8240
|
const isButton = type === "e-button";
|
|
8058
8241
|
const hasLink = !!getElementSetting(elementId, "link")?.value?.destination;
|
|
@@ -8061,7 +8244,7 @@ var checkIfElementIsClickable = (elementId) => {
|
|
|
8061
8244
|
var toolbarButtons = {
|
|
8062
8245
|
clear: {
|
|
8063
8246
|
label: __57("Clear", "elementor"),
|
|
8064
|
-
icon: /* @__PURE__ */
|
|
8247
|
+
icon: /* @__PURE__ */ React116.createElement(MinusIcon2, { fontSize: "tiny" }),
|
|
8065
8248
|
action: "clear",
|
|
8066
8249
|
method: (editor) => {
|
|
8067
8250
|
editor.chain().focus().clearNodes().unsetAllMarks().run();
|
|
@@ -8069,7 +8252,7 @@ var toolbarButtons = {
|
|
|
8069
8252
|
},
|
|
8070
8253
|
bold: {
|
|
8071
8254
|
label: __57("Bold", "elementor"),
|
|
8072
|
-
icon: /* @__PURE__ */
|
|
8255
|
+
icon: /* @__PURE__ */ React116.createElement(BoldIcon, { fontSize: "tiny" }),
|
|
8073
8256
|
action: "bold",
|
|
8074
8257
|
method: (editor) => {
|
|
8075
8258
|
editor.chain().focus().toggleBold().run();
|
|
@@ -8077,7 +8260,7 @@ var toolbarButtons = {
|
|
|
8077
8260
|
},
|
|
8078
8261
|
italic: {
|
|
8079
8262
|
label: __57("Italic", "elementor"),
|
|
8080
|
-
icon: /* @__PURE__ */
|
|
8263
|
+
icon: /* @__PURE__ */ React116.createElement(ItalicIcon, { fontSize: "tiny" }),
|
|
8081
8264
|
action: "italic",
|
|
8082
8265
|
method: (editor) => {
|
|
8083
8266
|
editor.chain().focus().toggleItalic().run();
|
|
@@ -8085,7 +8268,7 @@ var toolbarButtons = {
|
|
|
8085
8268
|
},
|
|
8086
8269
|
underline: {
|
|
8087
8270
|
label: __57("Underline", "elementor"),
|
|
8088
|
-
icon: /* @__PURE__ */
|
|
8271
|
+
icon: /* @__PURE__ */ React116.createElement(UnderlineIcon, { fontSize: "tiny" }),
|
|
8089
8272
|
action: "underline",
|
|
8090
8273
|
method: (editor) => {
|
|
8091
8274
|
editor.chain().focus().toggleUnderline().run();
|
|
@@ -8093,7 +8276,7 @@ var toolbarButtons = {
|
|
|
8093
8276
|
},
|
|
8094
8277
|
strike: {
|
|
8095
8278
|
label: __57("Strikethrough", "elementor"),
|
|
8096
|
-
icon: /* @__PURE__ */
|
|
8279
|
+
icon: /* @__PURE__ */ React116.createElement(StrikethroughIcon, { fontSize: "tiny" }),
|
|
8097
8280
|
action: "strike",
|
|
8098
8281
|
method: (editor) => {
|
|
8099
8282
|
editor.chain().focus().toggleStrike().run();
|
|
@@ -8101,7 +8284,7 @@ var toolbarButtons = {
|
|
|
8101
8284
|
},
|
|
8102
8285
|
superscript: {
|
|
8103
8286
|
label: __57("Superscript", "elementor"),
|
|
8104
|
-
icon: /* @__PURE__ */
|
|
8287
|
+
icon: /* @__PURE__ */ React116.createElement(SuperscriptIcon, { fontSize: "tiny" }),
|
|
8105
8288
|
action: "superscript",
|
|
8106
8289
|
method: (editor) => {
|
|
8107
8290
|
editor.chain().focus().toggleSuperscript().run();
|
|
@@ -8109,7 +8292,7 @@ var toolbarButtons = {
|
|
|
8109
8292
|
},
|
|
8110
8293
|
subscript: {
|
|
8111
8294
|
label: __57("Subscript", "elementor"),
|
|
8112
|
-
icon: /* @__PURE__ */
|
|
8295
|
+
icon: /* @__PURE__ */ React116.createElement(SubscriptIcon, { fontSize: "tiny" }),
|
|
8113
8296
|
action: "subscript",
|
|
8114
8297
|
method: (editor) => {
|
|
8115
8298
|
editor.chain().focus().toggleSubscript().run();
|
|
@@ -8117,7 +8300,7 @@ var toolbarButtons = {
|
|
|
8117
8300
|
},
|
|
8118
8301
|
link: {
|
|
8119
8302
|
label: __57("Link", "elementor"),
|
|
8120
|
-
icon: /* @__PURE__ */
|
|
8303
|
+
icon: /* @__PURE__ */ React116.createElement(LinkIcon3, { fontSize: "tiny" }),
|
|
8121
8304
|
action: "link",
|
|
8122
8305
|
method: null
|
|
8123
8306
|
}
|
|
@@ -8126,7 +8309,7 @@ var { clear: clearButton, ...formatButtons } = toolbarButtons;
|
|
|
8126
8309
|
var possibleFormats = Object.keys(formatButtons);
|
|
8127
8310
|
|
|
8128
8311
|
// src/components/size/unstable-size-field.tsx
|
|
8129
|
-
import * as
|
|
8312
|
+
import * as React119 from "react";
|
|
8130
8313
|
import { InputAdornment as InputAdornment6 } from "@elementor/ui";
|
|
8131
8314
|
|
|
8132
8315
|
// src/hooks/use-size-value.ts
|
|
@@ -8169,10 +8352,10 @@ var differsFromExternal = (newState, externalState) => {
|
|
|
8169
8352
|
};
|
|
8170
8353
|
|
|
8171
8354
|
// src/components/size/unit-select.tsx
|
|
8172
|
-
import * as
|
|
8355
|
+
import * as React117 from "react";
|
|
8173
8356
|
import { useId as useId4 } from "react";
|
|
8174
8357
|
import { MenuListItem as MenuListItem8 } from "@elementor/editor-ui";
|
|
8175
|
-
import { bindMenu as bindMenu3, bindTrigger as bindTrigger8, Button as Button7, Menu as Menu4, styled as
|
|
8358
|
+
import { bindMenu as bindMenu3, bindTrigger as bindTrigger8, Button as Button7, Menu as Menu4, styled as styled12, usePopupState as usePopupState12 } from "@elementor/ui";
|
|
8176
8359
|
var menuItemContentStyles2 = {
|
|
8177
8360
|
display: "flex",
|
|
8178
8361
|
flexDirection: "column",
|
|
@@ -8187,7 +8370,7 @@ var UnitSelect = ({ value, showPrimaryColor, onClick, options }) => {
|
|
|
8187
8370
|
onClick(options[index]);
|
|
8188
8371
|
popupState.close();
|
|
8189
8372
|
};
|
|
8190
|
-
return /* @__PURE__ */
|
|
8373
|
+
return /* @__PURE__ */ React117.createElement(React117.Fragment, null, /* @__PURE__ */ React117.createElement(StyledButton3, { isPrimaryColor: showPrimaryColor, size: "small", ...bindTrigger8(popupState) }, value), /* @__PURE__ */ React117.createElement(Menu4, { MenuListProps: { dense: true }, ...bindMenu3(popupState) }, options.map((option, index) => /* @__PURE__ */ React117.createElement(
|
|
8191
8374
|
MenuListItem8,
|
|
8192
8375
|
{
|
|
8193
8376
|
key: option,
|
|
@@ -8206,7 +8389,7 @@ var UnitSelect = ({ value, showPrimaryColor, onClick, options }) => {
|
|
|
8206
8389
|
option.toUpperCase()
|
|
8207
8390
|
))));
|
|
8208
8391
|
};
|
|
8209
|
-
var StyledButton3 =
|
|
8392
|
+
var StyledButton3 = styled12(Button7, {
|
|
8210
8393
|
shouldForwardProp: (prop) => prop !== "isPrimaryColor"
|
|
8211
8394
|
})(({ isPrimaryColor, theme }) => ({
|
|
8212
8395
|
color: isPrimaryColor ? theme.palette.text.primary : theme.palette.text.tertiary,
|
|
@@ -8216,11 +8399,11 @@ var StyledButton3 = styled11(Button7, {
|
|
|
8216
8399
|
}));
|
|
8217
8400
|
|
|
8218
8401
|
// src/components/size/unstable-size-input.tsx
|
|
8219
|
-
import * as
|
|
8402
|
+
import * as React118 from "react";
|
|
8220
8403
|
import { forwardRef as forwardRef13 } from "react";
|
|
8221
8404
|
var UnstableSizeInput = forwardRef13(
|
|
8222
8405
|
({ type, value, onChange, onKeyDown, onKeyUp, InputProps, onBlur, focused, disabled }, ref) => {
|
|
8223
|
-
return /* @__PURE__ */
|
|
8406
|
+
return /* @__PURE__ */ React118.createElement(
|
|
8224
8407
|
NumberInput,
|
|
8225
8408
|
{
|
|
8226
8409
|
ref,
|
|
@@ -8258,7 +8441,7 @@ var UnstableSizeField = ({
|
|
|
8258
8441
|
const shouldHighlightUnit2 = () => {
|
|
8259
8442
|
return hasValue(size);
|
|
8260
8443
|
};
|
|
8261
|
-
return /* @__PURE__ */
|
|
8444
|
+
return /* @__PURE__ */ React119.createElement(
|
|
8262
8445
|
UnstableSizeInput,
|
|
8263
8446
|
{
|
|
8264
8447
|
type: "number",
|
|
@@ -8267,8 +8450,8 @@ var UnstableSizeField = ({
|
|
|
8267
8450
|
onChange: (event) => setSize(event.target.value),
|
|
8268
8451
|
InputProps: {
|
|
8269
8452
|
...InputProps,
|
|
8270
|
-
startAdornment: startIcon && /* @__PURE__ */
|
|
8271
|
-
endAdornment: /* @__PURE__ */
|
|
8453
|
+
startAdornment: startIcon && /* @__PURE__ */ React119.createElement(InputAdornment6, { position: "start" }, startIcon),
|
|
8454
|
+
endAdornment: /* @__PURE__ */ React119.createElement(InputAdornment6, { position: "end" }, /* @__PURE__ */ React119.createElement(
|
|
8272
8455
|
UnitSelect,
|
|
8273
8456
|
{
|
|
8274
8457
|
options: units2,
|
|
@@ -8346,6 +8529,7 @@ export {
|
|
|
8346
8529
|
KeyValueControl,
|
|
8347
8530
|
LinkControl,
|
|
8348
8531
|
LinkedDimensionsControl,
|
|
8532
|
+
MentionTextAreaControl,
|
|
8349
8533
|
NumberControl,
|
|
8350
8534
|
NumberInput,
|
|
8351
8535
|
PopoverContent,
|