@elementor/editor-controls 0.12.0 → 0.13.0
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/CHANGELOG.md +12 -0
- package/dist/index.js +343 -217
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +286 -153
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/components/repeater.tsx +83 -28
- package/src/components/sortable.tsx +108 -0
- package/src/controls/text-area-control.tsx +1 -1
package/dist/index.js
CHANGED
|
@@ -423,7 +423,7 @@ var TextAreaControl = createControl(({ placeholder }) => {
|
|
|
423
423
|
size: "tiny",
|
|
424
424
|
multiline: true,
|
|
425
425
|
fullWidth: true,
|
|
426
|
-
|
|
426
|
+
minRows: 5,
|
|
427
427
|
value: value ?? "",
|
|
428
428
|
onChange: handleChange,
|
|
429
429
|
placeholder
|
|
@@ -595,9 +595,9 @@ var StrokeControl = createControl(() => {
|
|
|
595
595
|
var Control = ({ bind, label, children }) => /* @__PURE__ */ React17.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React17.createElement(import_ui13.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React17.createElement(import_ui13.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React17.createElement(ControlLabel, null, label)), /* @__PURE__ */ React17.createElement(import_ui13.Grid, { item: true, xs: 6 }, children)));
|
|
596
596
|
|
|
597
597
|
// src/controls/box-shadow-repeater-control.tsx
|
|
598
|
-
var
|
|
598
|
+
var React22 = __toESM(require("react"));
|
|
599
599
|
var import_editor_props9 = require("@elementor/editor-props");
|
|
600
|
-
var
|
|
600
|
+
var import_ui18 = require("@elementor/ui");
|
|
601
601
|
var import_i18n5 = require("@wordpress/i18n");
|
|
602
602
|
|
|
603
603
|
// src/components/popover-content.tsx
|
|
@@ -616,11 +616,99 @@ var PopoverGridContainer = ({
|
|
|
616
616
|
}) => /* @__PURE__ */ React19.createElement(import_ui15.Grid, { container: true, gap, alignItems, flexWrap }, children);
|
|
617
617
|
|
|
618
618
|
// src/components/repeater.tsx
|
|
619
|
-
var
|
|
619
|
+
var React21 = __toESM(require("react"));
|
|
620
620
|
var import_react7 = require("react");
|
|
621
|
+
var import_icons3 = require("@elementor/icons");
|
|
622
|
+
var import_ui17 = require("@elementor/ui");
|
|
623
|
+
var import_i18n4 = require("@wordpress/i18n");
|
|
624
|
+
|
|
625
|
+
// src/components/sortable.tsx
|
|
626
|
+
var React20 = __toESM(require("react"));
|
|
621
627
|
var import_icons2 = require("@elementor/icons");
|
|
622
628
|
var import_ui16 = require("@elementor/ui");
|
|
623
|
-
var
|
|
629
|
+
var SortableProvider = (props) => {
|
|
630
|
+
return /* @__PURE__ */ React20.createElement(import_ui16.List, { sx: { p: 0, m: 0 } }, /* @__PURE__ */ React20.createElement(
|
|
631
|
+
import_ui16.UnstableSortableProvider,
|
|
632
|
+
{
|
|
633
|
+
restrictAxis: true,
|
|
634
|
+
disableDragOverlay: false,
|
|
635
|
+
variant: "static",
|
|
636
|
+
...props
|
|
637
|
+
}
|
|
638
|
+
));
|
|
639
|
+
};
|
|
640
|
+
var SortableItem = ({ id, children }) => {
|
|
641
|
+
return /* @__PURE__ */ React20.createElement(
|
|
642
|
+
import_ui16.UnstableSortableItem,
|
|
643
|
+
{
|
|
644
|
+
id,
|
|
645
|
+
render: ({
|
|
646
|
+
itemProps,
|
|
647
|
+
triggerProps,
|
|
648
|
+
itemStyle,
|
|
649
|
+
triggerStyle,
|
|
650
|
+
isDragOverlay,
|
|
651
|
+
showDropIndication,
|
|
652
|
+
dropIndicationStyle
|
|
653
|
+
}) => {
|
|
654
|
+
return /* @__PURE__ */ React20.createElement(
|
|
655
|
+
StyledListItem,
|
|
656
|
+
{
|
|
657
|
+
...itemProps,
|
|
658
|
+
style: itemStyle,
|
|
659
|
+
sx: { backgroundColor: isDragOverlay ? "background.paper" : void 0 }
|
|
660
|
+
},
|
|
661
|
+
/* @__PURE__ */ React20.createElement(SortableTrigger, { ...triggerProps, style: triggerStyle }),
|
|
662
|
+
children,
|
|
663
|
+
showDropIndication && /* @__PURE__ */ React20.createElement(StyledDivider, { style: dropIndicationStyle })
|
|
664
|
+
);
|
|
665
|
+
}
|
|
666
|
+
}
|
|
667
|
+
);
|
|
668
|
+
};
|
|
669
|
+
var StyledListItem = (0, import_ui16.styled)(import_ui16.ListItem)`
|
|
670
|
+
position: relative;
|
|
671
|
+
margin-inline: 0px;
|
|
672
|
+
padding-inline: 0px;
|
|
673
|
+
padding-block: ${({ theme }) => theme.spacing(0.5)};
|
|
674
|
+
|
|
675
|
+
& .class-item-sortable-trigger {
|
|
676
|
+
color: ${({ theme }) => theme.palette.action.active};
|
|
677
|
+
height: 100%;
|
|
678
|
+
display: flex;
|
|
679
|
+
align-items: center;
|
|
680
|
+
visibility: hidden;
|
|
681
|
+
position: absolute;
|
|
682
|
+
top: 50%;
|
|
683
|
+
padding-inline-end: ${({ theme }) => theme.spacing(0.5)};
|
|
684
|
+
transform: translate( -75%, -50% );
|
|
685
|
+
}
|
|
686
|
+
|
|
687
|
+
&:hover {
|
|
688
|
+
& .class-item-sortable-trigger {
|
|
689
|
+
visibility: visible;
|
|
690
|
+
}
|
|
691
|
+
}
|
|
692
|
+
`;
|
|
693
|
+
var SortableTrigger = (props) => /* @__PURE__ */ React20.createElement("div", { ...props, role: "button", className: "class-item-sortable-trigger" }, /* @__PURE__ */ React20.createElement(import_icons2.GripVerticalIcon, { fontSize: "tiny" }));
|
|
694
|
+
var StyledDivider = (0, import_ui16.styled)(import_ui16.Divider)`
|
|
695
|
+
height: 0px;
|
|
696
|
+
border: none;
|
|
697
|
+
overflow: visible;
|
|
698
|
+
|
|
699
|
+
&:after {
|
|
700
|
+
--height: 2px;
|
|
701
|
+
content: '';
|
|
702
|
+
display: block;
|
|
703
|
+
width: 100%;
|
|
704
|
+
height: var( --height );
|
|
705
|
+
margin-block: calc( -1 * var( --height ) / 2 );
|
|
706
|
+
border-radius: ${({ theme }) => theme.spacing(0.5)};
|
|
707
|
+
background-color: ${({ theme }) => theme.palette.text.primary};
|
|
708
|
+
}
|
|
709
|
+
`;
|
|
710
|
+
|
|
711
|
+
// src/components/repeater.tsx
|
|
624
712
|
var SIZE = "tiny";
|
|
625
713
|
var Repeater = ({
|
|
626
714
|
label,
|
|
@@ -629,27 +717,50 @@ var Repeater = ({
|
|
|
629
717
|
values: repeaterValues = [],
|
|
630
718
|
setValues: setRepeaterValues
|
|
631
719
|
}) => {
|
|
720
|
+
const [items, setItems] = useSyncExternalState({
|
|
721
|
+
external: repeaterValues,
|
|
722
|
+
// @ts-expect-error - as long as persistWhen => true, value will never be null
|
|
723
|
+
setExternal: setRepeaterValues,
|
|
724
|
+
persistWhen: () => true
|
|
725
|
+
});
|
|
726
|
+
const [uniqueKeys, setUniqueKeys] = (0, import_react7.useState)(items.map((_, index) => index));
|
|
727
|
+
const generateNextKey = (source) => {
|
|
728
|
+
return 1 + Math.max(0, ...source);
|
|
729
|
+
};
|
|
632
730
|
const addRepeaterItem = () => {
|
|
633
731
|
const newItem = structuredClone(itemSettings.initialValues);
|
|
732
|
+
const newKey = generateNextKey(uniqueKeys);
|
|
634
733
|
if (addToBottom) {
|
|
635
|
-
|
|
734
|
+
setItems([...items, newItem]);
|
|
735
|
+
setUniqueKeys([...uniqueKeys, newKey]);
|
|
736
|
+
} else {
|
|
737
|
+
setItems([newItem, ...items]);
|
|
738
|
+
setUniqueKeys([newKey, ...uniqueKeys]);
|
|
636
739
|
}
|
|
637
|
-
setRepeaterValues([newItem, ...repeaterValues]);
|
|
638
740
|
};
|
|
639
741
|
const duplicateRepeaterItem = (index) => {
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
]);
|
|
742
|
+
const newItem = structuredClone(items[index]);
|
|
743
|
+
const newKey = generateNextKey(uniqueKeys);
|
|
744
|
+
const atPosition = 1 + index;
|
|
745
|
+
setItems([...items.slice(0, atPosition), newItem, ...items.slice(atPosition)]);
|
|
746
|
+
setUniqueKeys([...uniqueKeys.slice(0, atPosition), newKey, ...uniqueKeys.slice(atPosition)]);
|
|
645
747
|
};
|
|
646
748
|
const removeRepeaterItem = (index) => {
|
|
647
|
-
|
|
749
|
+
setUniqueKeys(
|
|
750
|
+
uniqueKeys.filter((_, pos) => {
|
|
751
|
+
return pos !== index;
|
|
752
|
+
})
|
|
753
|
+
);
|
|
754
|
+
setItems(
|
|
755
|
+
items.filter((_, pos) => {
|
|
756
|
+
return pos !== index;
|
|
757
|
+
})
|
|
758
|
+
);
|
|
648
759
|
};
|
|
649
760
|
const toggleDisableRepeaterItem = (index) => {
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
if (
|
|
761
|
+
setItems(
|
|
762
|
+
items.map((value, pos) => {
|
|
763
|
+
if (pos === index) {
|
|
653
764
|
const { disabled, ...rest } = value;
|
|
654
765
|
return { ...rest, ...disabled ? {} : { disabled: true } };
|
|
655
766
|
}
|
|
@@ -657,20 +768,34 @@ var Repeater = ({
|
|
|
657
768
|
})
|
|
658
769
|
);
|
|
659
770
|
};
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
{
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
771
|
+
const onChangeOrder = (reorderedKeys) => {
|
|
772
|
+
setUniqueKeys(reorderedKeys);
|
|
773
|
+
setItems((prevItems) => {
|
|
774
|
+
return reorderedKeys.map((keyValue) => {
|
|
775
|
+
const index = uniqueKeys.indexOf(keyValue);
|
|
776
|
+
return prevItems[index];
|
|
777
|
+
});
|
|
778
|
+
});
|
|
779
|
+
};
|
|
780
|
+
return /* @__PURE__ */ React21.createElement(SectionContent, null, /* @__PURE__ */ React21.createElement(import_ui17.Stack, { direction: "row", justifyContent: "space-between", alignItems: "center" }, /* @__PURE__ */ React21.createElement(import_ui17.Typography, { component: "label", variant: "caption", color: "text.secondary" }, label), /* @__PURE__ */ React21.createElement(import_ui17.IconButton, { size: SIZE, onClick: addRepeaterItem, "aria-label": (0, import_i18n4.__)("Add item", "elementor") }, /* @__PURE__ */ React21.createElement(import_icons3.PlusIcon, { fontSize: SIZE }))), 0 < uniqueKeys.length && /* @__PURE__ */ React21.createElement(SortableProvider, { value: uniqueKeys, onChange: onChangeOrder }, uniqueKeys.map((key, index) => {
|
|
781
|
+
const value = items[index];
|
|
782
|
+
if (!value) {
|
|
783
|
+
return null;
|
|
784
|
+
}
|
|
785
|
+
return /* @__PURE__ */ React21.createElement(SortableItem, { id: key, key: `sortable-${key}` }, /* @__PURE__ */ React21.createElement(
|
|
786
|
+
RepeaterItem,
|
|
787
|
+
{
|
|
788
|
+
bind: String(index),
|
|
789
|
+
disabled: value?.disabled,
|
|
790
|
+
label: /* @__PURE__ */ React21.createElement(itemSettings.Label, { value }),
|
|
791
|
+
startIcon: /* @__PURE__ */ React21.createElement(itemSettings.Icon, { value }),
|
|
792
|
+
removeItem: () => removeRepeaterItem(index),
|
|
793
|
+
duplicateItem: () => duplicateRepeaterItem(index),
|
|
794
|
+
toggleDisableItem: () => toggleDisableRepeaterItem(index)
|
|
795
|
+
},
|
|
796
|
+
(props) => /* @__PURE__ */ React21.createElement(itemSettings.Content, { ...props, value, bind: String(index) })
|
|
797
|
+
));
|
|
798
|
+
})));
|
|
674
799
|
};
|
|
675
800
|
var RepeaterItem = ({
|
|
676
801
|
label,
|
|
@@ -685,46 +810,47 @@ var RepeaterItem = ({
|
|
|
685
810
|
const popupId = `repeater-popup-${bind}`;
|
|
686
811
|
const controlRef = (0, import_react7.useRef)(null);
|
|
687
812
|
const [anchorEl, setAnchorEl] = (0, import_react7.useState)(null);
|
|
688
|
-
const popoverState = (0,
|
|
689
|
-
const popoverProps = (0,
|
|
690
|
-
return /* @__PURE__ */
|
|
691
|
-
|
|
813
|
+
const popoverState = (0, import_ui17.usePopupState)({ popupId, variant: "popover" });
|
|
814
|
+
const popoverProps = (0, import_ui17.bindPopover)(popoverState);
|
|
815
|
+
return /* @__PURE__ */ React21.createElement(React21.Fragment, null, /* @__PURE__ */ React21.createElement(
|
|
816
|
+
import_ui17.UnstableTag,
|
|
692
817
|
{
|
|
693
818
|
label,
|
|
694
819
|
showActionsOnHover: true,
|
|
820
|
+
fullWidth: true,
|
|
695
821
|
ref: controlRef,
|
|
696
822
|
variant: "outlined",
|
|
697
823
|
"aria-label": (0, import_i18n4.__)("Open item", "elementor"),
|
|
698
|
-
...(0,
|
|
824
|
+
...(0, import_ui17.bindTrigger)(popoverState),
|
|
699
825
|
startIcon,
|
|
700
|
-
actions: /* @__PURE__ */
|
|
701
|
-
|
|
826
|
+
actions: /* @__PURE__ */ React21.createElement(React21.Fragment, null, /* @__PURE__ */ React21.createElement(
|
|
827
|
+
import_ui17.IconButton,
|
|
702
828
|
{
|
|
703
829
|
size: SIZE,
|
|
704
830
|
onClick: duplicateItem,
|
|
705
831
|
"aria-label": (0, import_i18n4.__)("Duplicate item", "elementor")
|
|
706
832
|
},
|
|
707
|
-
/* @__PURE__ */
|
|
708
|
-
), /* @__PURE__ */
|
|
709
|
-
|
|
833
|
+
/* @__PURE__ */ React21.createElement(import_icons3.CopyIcon, { fontSize: SIZE })
|
|
834
|
+
), /* @__PURE__ */ React21.createElement(
|
|
835
|
+
import_ui17.IconButton,
|
|
710
836
|
{
|
|
711
837
|
size: SIZE,
|
|
712
838
|
onClick: toggleDisableItem,
|
|
713
839
|
"aria-label": disabled ? (0, import_i18n4.__)("Enable item", "elementor") : (0, import_i18n4.__)("Disable item", "elementor")
|
|
714
840
|
},
|
|
715
|
-
disabled ? /* @__PURE__ */
|
|
716
|
-
), /* @__PURE__ */
|
|
717
|
-
|
|
841
|
+
disabled ? /* @__PURE__ */ React21.createElement(import_icons3.EyeOffIcon, { fontSize: SIZE }) : /* @__PURE__ */ React21.createElement(import_icons3.EyeIcon, { fontSize: SIZE })
|
|
842
|
+
), /* @__PURE__ */ React21.createElement(
|
|
843
|
+
import_ui17.IconButton,
|
|
718
844
|
{
|
|
719
845
|
size: SIZE,
|
|
720
846
|
onClick: removeItem,
|
|
721
847
|
"aria-label": (0, import_i18n4.__)("Remove item", "elementor")
|
|
722
848
|
},
|
|
723
|
-
/* @__PURE__ */
|
|
849
|
+
/* @__PURE__ */ React21.createElement(import_icons3.XIcon, { fontSize: SIZE })
|
|
724
850
|
))
|
|
725
851
|
}
|
|
726
|
-
), /* @__PURE__ */
|
|
727
|
-
|
|
852
|
+
), /* @__PURE__ */ React21.createElement(
|
|
853
|
+
import_ui17.Popover,
|
|
728
854
|
{
|
|
729
855
|
disablePortal: true,
|
|
730
856
|
slotProps: {
|
|
@@ -736,14 +862,14 @@ var RepeaterItem = ({
|
|
|
736
862
|
anchorOrigin: { vertical: "bottom", horizontal: "left" },
|
|
737
863
|
...popoverProps
|
|
738
864
|
},
|
|
739
|
-
/* @__PURE__ */
|
|
865
|
+
/* @__PURE__ */ React21.createElement(import_ui17.Box, null, children({ anchorEl }))
|
|
740
866
|
));
|
|
741
867
|
};
|
|
742
868
|
|
|
743
869
|
// src/controls/box-shadow-repeater-control.tsx
|
|
744
870
|
var BoxShadowRepeaterControl = createControl(() => {
|
|
745
871
|
const { propType, value, setValue } = useBoundProp(import_editor_props9.boxShadowPropTypeUtil);
|
|
746
|
-
return /* @__PURE__ */
|
|
872
|
+
return /* @__PURE__ */ React22.createElement(PropProvider, { propType, value, setValue }, /* @__PURE__ */ React22.createElement(
|
|
747
873
|
Repeater,
|
|
748
874
|
{
|
|
749
875
|
values: value ?? [],
|
|
@@ -758,13 +884,13 @@ var BoxShadowRepeaterControl = createControl(() => {
|
|
|
758
884
|
}
|
|
759
885
|
));
|
|
760
886
|
});
|
|
761
|
-
var ItemIcon = ({ value }) => /* @__PURE__ */
|
|
887
|
+
var ItemIcon = ({ value }) => /* @__PURE__ */ React22.createElement(import_ui18.UnstableColorIndicator, { size: "inherit", component: "span", value: value.value.color.value });
|
|
762
888
|
var ItemContent = ({ anchorEl, bind }) => {
|
|
763
|
-
return /* @__PURE__ */
|
|
889
|
+
return /* @__PURE__ */ React22.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React22.createElement(Content, { anchorEl }));
|
|
764
890
|
};
|
|
765
891
|
var Content = ({ anchorEl }) => {
|
|
766
892
|
const { propType, value, setValue } = useBoundProp(import_editor_props9.shadowPropTypeUtil);
|
|
767
|
-
return /* @__PURE__ */
|
|
893
|
+
return /* @__PURE__ */ React22.createElement(PropProvider, { propType, value, setValue }, /* @__PURE__ */ React22.createElement(PopoverContent, { p: 1.5 }, /* @__PURE__ */ React22.createElement(PopoverGridContainer, null, /* @__PURE__ */ React22.createElement(Control2, { bind: "color", label: (0, import_i18n5.__)("Color", "elementor") }, /* @__PURE__ */ React22.createElement(
|
|
768
894
|
ColorControl,
|
|
769
895
|
{
|
|
770
896
|
slotProps: {
|
|
@@ -781,7 +907,7 @@ var Content = ({ anchorEl }) => {
|
|
|
781
907
|
}
|
|
782
908
|
}
|
|
783
909
|
}
|
|
784
|
-
)), /* @__PURE__ */
|
|
910
|
+
)), /* @__PURE__ */ React22.createElement(Control2, { bind: "position", label: (0, import_i18n5.__)("Position", "elementor") }, /* @__PURE__ */ React22.createElement(
|
|
785
911
|
SelectControl,
|
|
786
912
|
{
|
|
787
913
|
options: [
|
|
@@ -789,9 +915,9 @@ var Content = ({ anchorEl }) => {
|
|
|
789
915
|
{ label: (0, import_i18n5.__)("Outset", "elementor"), value: null }
|
|
790
916
|
]
|
|
791
917
|
}
|
|
792
|
-
))), /* @__PURE__ */
|
|
918
|
+
))), /* @__PURE__ */ React22.createElement(PopoverGridContainer, null, /* @__PURE__ */ React22.createElement(Control2, { bind: "hOffset", label: (0, import_i18n5.__)("Horizontal", "elementor") }, /* @__PURE__ */ React22.createElement(SizeControl, null)), /* @__PURE__ */ React22.createElement(Control2, { bind: "vOffset", label: (0, import_i18n5.__)("Vertical", "elementor") }, /* @__PURE__ */ React22.createElement(SizeControl, null))), /* @__PURE__ */ React22.createElement(PopoverGridContainer, null, /* @__PURE__ */ React22.createElement(Control2, { bind: "blur", label: (0, import_i18n5.__)("Blur", "elementor") }, /* @__PURE__ */ React22.createElement(SizeControl, null)), /* @__PURE__ */ React22.createElement(Control2, { bind: "spread", label: (0, import_i18n5.__)("Spread", "elementor") }, /* @__PURE__ */ React22.createElement(SizeControl, null)))));
|
|
793
919
|
};
|
|
794
|
-
var Control2 = ({ label, bind, children }) => /* @__PURE__ */
|
|
920
|
+
var Control2 = ({ label, bind, children }) => /* @__PURE__ */ React22.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React22.createElement(import_ui18.Grid, { item: true, xs: 6, sx: { overflow: "hidden" } }, /* @__PURE__ */ React22.createElement(import_ui18.Grid, { container: true, gap: 1, alignItems: "center" }, /* @__PURE__ */ React22.createElement(import_ui18.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React22.createElement(import_ui18.Typography, { component: "label", variant: "caption", color: "text.secondary" }, label)), /* @__PURE__ */ React22.createElement(import_ui18.Grid, { item: true, xs: 12 }, children))));
|
|
795
921
|
var ItemLabel = ({ value }) => {
|
|
796
922
|
const { position, hOffset, vOffset, blur, spread } = value.value;
|
|
797
923
|
const { size: blurSize = "", unit: blurUnit = "" } = blur?.value || {};
|
|
@@ -805,7 +931,7 @@ var ItemLabel = ({ value }) => {
|
|
|
805
931
|
blurSize + blurUnit,
|
|
806
932
|
spreadSize + spreadUnit
|
|
807
933
|
].join(" ");
|
|
808
|
-
return /* @__PURE__ */
|
|
934
|
+
return /* @__PURE__ */ React22.createElement("span", { style: { textTransform: "capitalize" } }, positionLabel, ": ", sizes);
|
|
809
935
|
};
|
|
810
936
|
var initialShadow = {
|
|
811
937
|
$$type: "shadow",
|
|
@@ -835,13 +961,13 @@ var initialShadow = {
|
|
|
835
961
|
};
|
|
836
962
|
|
|
837
963
|
// src/controls/toggle-control.tsx
|
|
838
|
-
var
|
|
964
|
+
var React24 = __toESM(require("react"));
|
|
839
965
|
var import_editor_props10 = require("@elementor/editor-props");
|
|
840
966
|
|
|
841
967
|
// src/components/control-toggle-button-group.tsx
|
|
842
|
-
var
|
|
843
|
-
var
|
|
844
|
-
var StyledToggleButtonGroup = (0,
|
|
968
|
+
var React23 = __toESM(require("react"));
|
|
969
|
+
var import_ui19 = require("@elementor/ui");
|
|
970
|
+
var StyledToggleButtonGroup = (0, import_ui19.styled)(import_ui19.ToggleButtonGroup)`
|
|
845
971
|
${({ justify }) => `justify-content: ${justify};`}
|
|
846
972
|
`;
|
|
847
973
|
var ControlToggleButtonGroup = ({
|
|
@@ -853,11 +979,11 @@ var ControlToggleButtonGroup = ({
|
|
|
853
979
|
exclusive = false,
|
|
854
980
|
fullWidth = false
|
|
855
981
|
}) => {
|
|
856
|
-
const isRtl = "rtl" === (0,
|
|
982
|
+
const isRtl = "rtl" === (0, import_ui19.useTheme)().direction;
|
|
857
983
|
const handleChange = (_, newValue) => {
|
|
858
984
|
onChange(newValue);
|
|
859
985
|
};
|
|
860
|
-
return /* @__PURE__ */
|
|
986
|
+
return /* @__PURE__ */ React23.createElement(
|
|
861
987
|
StyledToggleButtonGroup,
|
|
862
988
|
{
|
|
863
989
|
justify,
|
|
@@ -869,8 +995,8 @@ var ControlToggleButtonGroup = ({
|
|
|
869
995
|
}
|
|
870
996
|
},
|
|
871
997
|
items.map(
|
|
872
|
-
({ label, value: buttonValue, renderContent: Content3, showTooltip }) => showTooltip ? /* @__PURE__ */
|
|
873
|
-
|
|
998
|
+
({ label, value: buttonValue, renderContent: Content3, showTooltip }) => showTooltip ? /* @__PURE__ */ React23.createElement(import_ui19.Tooltip, { key: buttonValue, title: label, disableFocusListener: true, placement: "top" }, /* @__PURE__ */ React23.createElement(import_ui19.ToggleButton, { value: buttonValue, "aria-label": label, size, fullWidth }, /* @__PURE__ */ React23.createElement(Content3, { size }))) : /* @__PURE__ */ React23.createElement(
|
|
999
|
+
import_ui19.ToggleButton,
|
|
874
1000
|
{
|
|
875
1001
|
key: buttonValue,
|
|
876
1002
|
value: buttonValue,
|
|
@@ -878,7 +1004,7 @@ var ControlToggleButtonGroup = ({
|
|
|
878
1004
|
size,
|
|
879
1005
|
fullWidth
|
|
880
1006
|
},
|
|
881
|
-
/* @__PURE__ */
|
|
1007
|
+
/* @__PURE__ */ React23.createElement(Content3, { size })
|
|
882
1008
|
)
|
|
883
1009
|
)
|
|
884
1010
|
);
|
|
@@ -891,7 +1017,7 @@ var ToggleControl = createControl(
|
|
|
891
1017
|
const handleToggle = (option) => {
|
|
892
1018
|
setValue(option);
|
|
893
1019
|
};
|
|
894
|
-
return /* @__PURE__ */
|
|
1020
|
+
return /* @__PURE__ */ React24.createElement(
|
|
895
1021
|
ControlToggleButtonGroup,
|
|
896
1022
|
{
|
|
897
1023
|
items: options,
|
|
@@ -906,9 +1032,9 @@ var ToggleControl = createControl(
|
|
|
906
1032
|
);
|
|
907
1033
|
|
|
908
1034
|
// src/controls/number-control.tsx
|
|
909
|
-
var
|
|
1035
|
+
var React25 = __toESM(require("react"));
|
|
910
1036
|
var import_editor_props11 = require("@elementor/editor-props");
|
|
911
|
-
var
|
|
1037
|
+
var import_ui20 = require("@elementor/ui");
|
|
912
1038
|
var isEmptyOrNaN = (value) => value === null || value === void 0 || value === "" || Number.isNaN(Number(value));
|
|
913
1039
|
var NumberControl = createControl(
|
|
914
1040
|
({
|
|
@@ -928,8 +1054,8 @@ var NumberControl = createControl(
|
|
|
928
1054
|
const formattedValue = shouldForceInt ? +parseInt(eventValue) : Number(eventValue);
|
|
929
1055
|
setValue(Math.min(Math.max(formattedValue, min), max));
|
|
930
1056
|
};
|
|
931
|
-
return /* @__PURE__ */
|
|
932
|
-
|
|
1057
|
+
return /* @__PURE__ */ React25.createElement(ControlActions, null, /* @__PURE__ */ React25.createElement(
|
|
1058
|
+
import_ui20.TextField,
|
|
933
1059
|
{
|
|
934
1060
|
size: "tiny",
|
|
935
1061
|
type: "number",
|
|
@@ -944,10 +1070,10 @@ var NumberControl = createControl(
|
|
|
944
1070
|
);
|
|
945
1071
|
|
|
946
1072
|
// src/controls/equal-unequal-sizes-control.tsx
|
|
947
|
-
var
|
|
1073
|
+
var React26 = __toESM(require("react"));
|
|
948
1074
|
var import_react8 = require("react");
|
|
949
1075
|
var import_editor_props12 = require("@elementor/editor-props");
|
|
950
|
-
var
|
|
1076
|
+
var import_ui21 = require("@elementor/ui");
|
|
951
1077
|
var import_i18n6 = require("@wordpress/i18n");
|
|
952
1078
|
var isEqualSizes = (propValue, items) => {
|
|
953
1079
|
const values = Object.values(propValue);
|
|
@@ -967,7 +1093,7 @@ function EqualUnequalSizesControl({
|
|
|
967
1093
|
}) {
|
|
968
1094
|
const popupId = (0, import_react8.useId)();
|
|
969
1095
|
const controlRef = (0, import_react8.useRef)(null);
|
|
970
|
-
const popupState = (0,
|
|
1096
|
+
const popupState = (0, import_ui21.usePopupState)({ variant: "popover", popupId });
|
|
971
1097
|
const {
|
|
972
1098
|
propType: multiSizePropType,
|
|
973
1099
|
value: multiSizeValue,
|
|
@@ -1001,18 +1127,18 @@ function EqualUnequalSizesControl({
|
|
|
1001
1127
|
return splitEqualValue() ?? null;
|
|
1002
1128
|
};
|
|
1003
1129
|
const isMixed = !!multiSizeValue;
|
|
1004
|
-
return /* @__PURE__ */
|
|
1005
|
-
|
|
1130
|
+
return /* @__PURE__ */ React26.createElement(React26.Fragment, null, /* @__PURE__ */ React26.createElement(import_ui21.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap", ref: controlRef }, /* @__PURE__ */ React26.createElement(import_ui21.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React26.createElement(ControlLabel, null, label)), /* @__PURE__ */ React26.createElement(import_ui21.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React26.createElement(import_ui21.Stack, { direction: "row", alignItems: "center", gap: 1 }, /* @__PURE__ */ React26.createElement(SizeControl, { placeholder: isMixed ? (0, import_i18n6.__)("Mixed", "elementor") : void 0 }), /* @__PURE__ */ React26.createElement(
|
|
1131
|
+
import_ui21.ToggleButton,
|
|
1006
1132
|
{
|
|
1007
1133
|
size: "tiny",
|
|
1008
1134
|
value: "check",
|
|
1009
1135
|
sx: { marginLeft: "auto" },
|
|
1010
|
-
...(0,
|
|
1136
|
+
...(0, import_ui21.bindToggle)(popupState),
|
|
1011
1137
|
selected: popupState.isOpen
|
|
1012
1138
|
},
|
|
1013
1139
|
icon
|
|
1014
|
-
)))), /* @__PURE__ */
|
|
1015
|
-
|
|
1140
|
+
)))), /* @__PURE__ */ React26.createElement(
|
|
1141
|
+
import_ui21.Popover,
|
|
1016
1142
|
{
|
|
1017
1143
|
disablePortal: true,
|
|
1018
1144
|
disableScrollLock: true,
|
|
@@ -1024,21 +1150,21 @@ function EqualUnequalSizesControl({
|
|
|
1024
1150
|
vertical: "top",
|
|
1025
1151
|
horizontal: "right"
|
|
1026
1152
|
},
|
|
1027
|
-
...(0,
|
|
1153
|
+
...(0, import_ui21.bindPopover)(popupState),
|
|
1028
1154
|
slotProps: {
|
|
1029
1155
|
paper: { sx: { mt: 0.5, width: controlRef.current?.getBoundingClientRect().width } }
|
|
1030
1156
|
}
|
|
1031
1157
|
},
|
|
1032
|
-
/* @__PURE__ */
|
|
1158
|
+
/* @__PURE__ */ React26.createElement(PropProvider, { propType: multiSizePropType, value: getMultiSizeValues(), setValue: setNestedProp }, /* @__PURE__ */ React26.createElement(PopoverContent, { p: 1.5 }, /* @__PURE__ */ React26.createElement(PopoverGridContainer, null, /* @__PURE__ */ React26.createElement(MultiSizeValueControl, { item: items[0] }), /* @__PURE__ */ React26.createElement(MultiSizeValueControl, { item: items[1] })), /* @__PURE__ */ React26.createElement(PopoverGridContainer, null, /* @__PURE__ */ React26.createElement(MultiSizeValueControl, { item: items[3] }), /* @__PURE__ */ React26.createElement(MultiSizeValueControl, { item: items[2] }))))
|
|
1033
1159
|
));
|
|
1034
1160
|
}
|
|
1035
|
-
var MultiSizeValueControl = ({ item }) => /* @__PURE__ */
|
|
1161
|
+
var MultiSizeValueControl = ({ item }) => /* @__PURE__ */ React26.createElement(PropKeyProvider, { bind: item.bind }, /* @__PURE__ */ React26.createElement(import_ui21.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React26.createElement(import_ui21.Grid, { container: true, gap: 1, alignItems: "center" }, /* @__PURE__ */ React26.createElement(import_ui21.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React26.createElement(ControlLabel, null, item.label)), /* @__PURE__ */ React26.createElement(import_ui21.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React26.createElement(SizeControl, { startIcon: item.icon })))));
|
|
1036
1162
|
|
|
1037
1163
|
// src/controls/linked-dimensions-control.tsx
|
|
1038
|
-
var
|
|
1164
|
+
var React27 = __toESM(require("react"));
|
|
1039
1165
|
var import_editor_props13 = require("@elementor/editor-props");
|
|
1040
|
-
var
|
|
1041
|
-
var
|
|
1166
|
+
var import_icons4 = require("@elementor/icons");
|
|
1167
|
+
var import_ui22 = require("@elementor/ui");
|
|
1042
1168
|
var import_i18n7 = require("@wordpress/i18n");
|
|
1043
1169
|
var LinkedDimensionsControl = createControl(({ label }) => {
|
|
1044
1170
|
const { value: dimensionsValue, setValue: setDimensionsValue, propType } = useBoundProp(import_editor_props13.dimensionsPropTypeUtil);
|
|
@@ -1057,9 +1183,9 @@ var LinkedDimensionsControl = createControl(({ label }) => {
|
|
|
1057
1183
|
left: value
|
|
1058
1184
|
});
|
|
1059
1185
|
};
|
|
1060
|
-
const LinkedIcon = isLinked ?
|
|
1061
|
-
return /* @__PURE__ */
|
|
1062
|
-
|
|
1186
|
+
const LinkedIcon = isLinked ? import_icons4.LinkIcon : import_icons4.DetachIcon;
|
|
1187
|
+
return /* @__PURE__ */ React27.createElement(PropProvider, { propType, value: dimensionsValue, setValue: setDimensionsValue }, /* @__PURE__ */ React27.createElement(import_ui22.Stack, { direction: "row", gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React27.createElement(ControlLabel, null, label), /* @__PURE__ */ React27.createElement(
|
|
1188
|
+
import_ui22.ToggleButton,
|
|
1063
1189
|
{
|
|
1064
1190
|
"aria-label": (0, import_i18n7.__)("Link inputs", "elementor"),
|
|
1065
1191
|
size: "tiny",
|
|
@@ -1068,50 +1194,50 @@ var LinkedDimensionsControl = createControl(({ label }) => {
|
|
|
1068
1194
|
sx: { marginLeft: "auto" },
|
|
1069
1195
|
onChange: onLinkToggle
|
|
1070
1196
|
},
|
|
1071
|
-
/* @__PURE__ */
|
|
1072
|
-
)), /* @__PURE__ */
|
|
1197
|
+
/* @__PURE__ */ React27.createElement(LinkedIcon, { fontSize: "tiny" })
|
|
1198
|
+
)), /* @__PURE__ */ React27.createElement(import_ui22.Stack, { direction: "row", gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React27.createElement(import_ui22.Grid, { container: true, gap: 1, alignItems: "center" }, /* @__PURE__ */ React27.createElement(import_ui22.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React27.createElement(ControlLabel, null, (0, import_i18n7.__)("Top", "elementor"))), /* @__PURE__ */ React27.createElement(import_ui22.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React27.createElement(
|
|
1073
1199
|
Control3,
|
|
1074
1200
|
{
|
|
1075
1201
|
bind: "top",
|
|
1076
|
-
startIcon: /* @__PURE__ */
|
|
1202
|
+
startIcon: /* @__PURE__ */ React27.createElement(import_icons4.SideTopIcon, { fontSize: "tiny" }),
|
|
1077
1203
|
isLinked
|
|
1078
1204
|
}
|
|
1079
|
-
))), /* @__PURE__ */
|
|
1205
|
+
))), /* @__PURE__ */ React27.createElement(import_ui22.Grid, { container: true, gap: 1, alignItems: "center" }, /* @__PURE__ */ React27.createElement(import_ui22.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React27.createElement(ControlLabel, null, (0, import_i18n7.__)("Right", "elementor"))), /* @__PURE__ */ React27.createElement(import_ui22.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React27.createElement(
|
|
1080
1206
|
Control3,
|
|
1081
1207
|
{
|
|
1082
1208
|
bind: "right",
|
|
1083
|
-
startIcon: /* @__PURE__ */
|
|
1209
|
+
startIcon: /* @__PURE__ */ React27.createElement(import_icons4.SideRightIcon, { fontSize: "tiny" }),
|
|
1084
1210
|
isLinked
|
|
1085
1211
|
}
|
|
1086
|
-
)))), /* @__PURE__ */
|
|
1212
|
+
)))), /* @__PURE__ */ React27.createElement(import_ui22.Stack, { direction: "row", gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React27.createElement(import_ui22.Grid, { container: true, gap: 1, alignItems: "center" }, /* @__PURE__ */ React27.createElement(import_ui22.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React27.createElement(ControlLabel, null, (0, import_i18n7.__)("Bottom", "elementor"))), /* @__PURE__ */ React27.createElement(import_ui22.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React27.createElement(
|
|
1087
1213
|
Control3,
|
|
1088
1214
|
{
|
|
1089
1215
|
bind: "bottom",
|
|
1090
|
-
startIcon: /* @__PURE__ */
|
|
1216
|
+
startIcon: /* @__PURE__ */ React27.createElement(import_icons4.SideBottomIcon, { fontSize: "tiny" }),
|
|
1091
1217
|
isLinked
|
|
1092
1218
|
}
|
|
1093
|
-
))), /* @__PURE__ */
|
|
1219
|
+
))), /* @__PURE__ */ React27.createElement(import_ui22.Grid, { container: true, gap: 1, alignItems: "center" }, /* @__PURE__ */ React27.createElement(import_ui22.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React27.createElement(ControlLabel, null, (0, import_i18n7.__)("Left", "elementor"))), /* @__PURE__ */ React27.createElement(import_ui22.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React27.createElement(
|
|
1094
1220
|
Control3,
|
|
1095
1221
|
{
|
|
1096
1222
|
bind: "left",
|
|
1097
|
-
startIcon: /* @__PURE__ */
|
|
1223
|
+
startIcon: /* @__PURE__ */ React27.createElement(import_icons4.SideLeftIcon, { fontSize: "tiny" }),
|
|
1098
1224
|
isLinked
|
|
1099
1225
|
}
|
|
1100
1226
|
)))));
|
|
1101
1227
|
});
|
|
1102
1228
|
var Control3 = ({ bind, startIcon, isLinked }) => {
|
|
1103
1229
|
if (isLinked) {
|
|
1104
|
-
return /* @__PURE__ */
|
|
1230
|
+
return /* @__PURE__ */ React27.createElement(SizeControl, { startIcon });
|
|
1105
1231
|
}
|
|
1106
|
-
return /* @__PURE__ */
|
|
1232
|
+
return /* @__PURE__ */ React27.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React27.createElement(SizeControl, { startIcon }));
|
|
1107
1233
|
};
|
|
1108
1234
|
|
|
1109
1235
|
// src/controls/font-family-control.tsx
|
|
1110
1236
|
var import_react9 = require("react");
|
|
1111
|
-
var
|
|
1237
|
+
var React28 = __toESM(require("react"));
|
|
1112
1238
|
var import_editor_props14 = require("@elementor/editor-props");
|
|
1113
|
-
var
|
|
1114
|
-
var
|
|
1239
|
+
var import_icons5 = require("@elementor/icons");
|
|
1240
|
+
var import_ui23 = require("@elementor/ui");
|
|
1115
1241
|
var import_i18n9 = require("@wordpress/i18n");
|
|
1116
1242
|
|
|
1117
1243
|
// src/hooks/use-filtered-font-families.ts
|
|
@@ -1150,7 +1276,7 @@ var FontFamilyControl = createControl(({ fontFamilies }) => {
|
|
|
1150
1276
|
const [searchValue, setSearchValue] = (0, import_react9.useState)("");
|
|
1151
1277
|
const { value: fontFamily, setValue: setFontFamily } = useBoundProp(import_editor_props14.stringPropTypeUtil);
|
|
1152
1278
|
const popupId = (0, import_react9.useId)();
|
|
1153
|
-
const popoverState = (0,
|
|
1279
|
+
const popoverState = (0, import_ui23.usePopupState)({ variant: "popover", popupId });
|
|
1154
1280
|
const filteredFontFamilies = useFilteredFontFamilies(fontFamilies, searchValue);
|
|
1155
1281
|
if (!filteredFontFamilies) {
|
|
1156
1282
|
return null;
|
|
@@ -1162,26 +1288,26 @@ var FontFamilyControl = createControl(({ fontFamilies }) => {
|
|
|
1162
1288
|
setSearchValue("");
|
|
1163
1289
|
popoverState.close();
|
|
1164
1290
|
};
|
|
1165
|
-
return /* @__PURE__ */
|
|
1166
|
-
|
|
1291
|
+
return /* @__PURE__ */ React28.createElement(React28.Fragment, null, /* @__PURE__ */ React28.createElement(
|
|
1292
|
+
import_ui23.UnstableTag,
|
|
1167
1293
|
{
|
|
1168
1294
|
variant: "outlined",
|
|
1169
1295
|
label: fontFamily,
|
|
1170
|
-
endIcon: /* @__PURE__ */
|
|
1171
|
-
...(0,
|
|
1296
|
+
endIcon: /* @__PURE__ */ React28.createElement(import_icons5.ChevronDownIcon, { fontSize: "tiny" }),
|
|
1297
|
+
...(0, import_ui23.bindTrigger)(popoverState),
|
|
1172
1298
|
fullWidth: true
|
|
1173
1299
|
}
|
|
1174
|
-
), /* @__PURE__ */
|
|
1175
|
-
|
|
1300
|
+
), /* @__PURE__ */ React28.createElement(
|
|
1301
|
+
import_ui23.Popover,
|
|
1176
1302
|
{
|
|
1177
1303
|
disablePortal: true,
|
|
1178
1304
|
disableScrollLock: true,
|
|
1179
1305
|
anchorOrigin: { vertical: "bottom", horizontal: "left" },
|
|
1180
|
-
...(0,
|
|
1306
|
+
...(0, import_ui23.bindPopover)(popoverState),
|
|
1181
1307
|
onClose: handleClose
|
|
1182
1308
|
},
|
|
1183
|
-
/* @__PURE__ */
|
|
1184
|
-
|
|
1309
|
+
/* @__PURE__ */ React28.createElement(import_ui23.Stack, null, /* @__PURE__ */ React28.createElement(import_ui23.Stack, { direction: "row", alignItems: "center", pl: 1.5, pr: 0.5, py: 1.5 }, /* @__PURE__ */ React28.createElement(import_icons5.EditIcon, { fontSize: SIZE2, sx: { mr: 0.5 } }), /* @__PURE__ */ React28.createElement(import_ui23.Typography, { variant: "subtitle2" }, (0, import_i18n9.__)("Font Family", "elementor")), /* @__PURE__ */ React28.createElement(import_ui23.IconButton, { size: SIZE2, sx: { ml: "auto" }, onClick: handleClose }, /* @__PURE__ */ React28.createElement(import_icons5.XIcon, { fontSize: SIZE2 }))), /* @__PURE__ */ React28.createElement(import_ui23.Box, { px: 1.5, pb: 1 }, /* @__PURE__ */ React28.createElement(
|
|
1310
|
+
import_ui23.TextField,
|
|
1185
1311
|
{
|
|
1186
1312
|
fullWidth: true,
|
|
1187
1313
|
size: SIZE2,
|
|
@@ -1189,19 +1315,19 @@ var FontFamilyControl = createControl(({ fontFamilies }) => {
|
|
|
1189
1315
|
placeholder: (0, import_i18n9.__)("Search", "elementor"),
|
|
1190
1316
|
onChange: handleSearch,
|
|
1191
1317
|
InputProps: {
|
|
1192
|
-
startAdornment: /* @__PURE__ */
|
|
1318
|
+
startAdornment: /* @__PURE__ */ React28.createElement(import_ui23.InputAdornment, { position: "start" }, /* @__PURE__ */ React28.createElement(import_icons5.SearchIcon, { fontSize: SIZE2 }))
|
|
1193
1319
|
}
|
|
1194
1320
|
}
|
|
1195
|
-
)), /* @__PURE__ */
|
|
1196
|
-
|
|
1321
|
+
)), /* @__PURE__ */ React28.createElement(import_ui23.Divider, null), /* @__PURE__ */ React28.createElement(import_ui23.Box, { sx: { overflowY: "auto", height: 260, width: 220 } }, filteredFontFamilies.length > 0 ? /* @__PURE__ */ React28.createElement(import_ui23.MenuList, { role: "listbox", tabIndex: 0 }, filteredFontFamilies.map(([category, items], index) => /* @__PURE__ */ React28.createElement(import_react9.Fragment, { key: index }, /* @__PURE__ */ React28.createElement(
|
|
1322
|
+
import_ui23.ListSubheader,
|
|
1197
1323
|
{
|
|
1198
1324
|
sx: { px: 1.5, typography: "caption", color: "text.tertiary" }
|
|
1199
1325
|
},
|
|
1200
1326
|
category
|
|
1201
1327
|
), items.map((item) => {
|
|
1202
1328
|
const isSelected = item === fontFamily;
|
|
1203
|
-
return /* @__PURE__ */
|
|
1204
|
-
|
|
1329
|
+
return /* @__PURE__ */ React28.createElement(
|
|
1330
|
+
import_ui23.MenuItem,
|
|
1205
1331
|
{
|
|
1206
1332
|
key: item,
|
|
1207
1333
|
selected: isSelected,
|
|
@@ -1215,8 +1341,8 @@ var FontFamilyControl = createControl(({ fontFamilies }) => {
|
|
|
1215
1341
|
},
|
|
1216
1342
|
item
|
|
1217
1343
|
);
|
|
1218
|
-
})))) : /* @__PURE__ */
|
|
1219
|
-
|
|
1344
|
+
})))) : /* @__PURE__ */ React28.createElement(import_ui23.Stack, { alignItems: "center", p: 2.5, gap: 1.5 }, /* @__PURE__ */ React28.createElement(import_icons5.PhotoIcon, { fontSize: "large" }), /* @__PURE__ */ React28.createElement(import_ui23.Typography, { align: "center", variant: "caption", color: "text.secondary" }, (0, import_i18n9.__)("Sorry, nothing matched", "elementor"), /* @__PURE__ */ React28.createElement("br", null), "\u201C", searchValue, "\u201D."), /* @__PURE__ */ React28.createElement(import_ui23.Typography, { align: "center", variant: "caption", color: "text.secondary" }, /* @__PURE__ */ React28.createElement(
|
|
1345
|
+
import_ui23.Link,
|
|
1220
1346
|
{
|
|
1221
1347
|
color: "secondary",
|
|
1222
1348
|
variant: "caption",
|
|
@@ -1229,14 +1355,14 @@ var FontFamilyControl = createControl(({ fontFamilies }) => {
|
|
|
1229
1355
|
});
|
|
1230
1356
|
|
|
1231
1357
|
// src/controls/url-control.tsx
|
|
1232
|
-
var
|
|
1358
|
+
var React29 = __toESM(require("react"));
|
|
1233
1359
|
var import_editor_props15 = require("@elementor/editor-props");
|
|
1234
|
-
var
|
|
1360
|
+
var import_ui24 = require("@elementor/ui");
|
|
1235
1361
|
var UrlControl = createControl(({ placeholder }) => {
|
|
1236
1362
|
const { value, setValue } = useBoundProp(import_editor_props15.urlPropTypeUtil);
|
|
1237
1363
|
const handleChange = (event) => setValue(event.target.value);
|
|
1238
|
-
return /* @__PURE__ */
|
|
1239
|
-
|
|
1364
|
+
return /* @__PURE__ */ React29.createElement(ControlActions, null, /* @__PURE__ */ React29.createElement(
|
|
1365
|
+
import_ui24.TextField,
|
|
1240
1366
|
{
|
|
1241
1367
|
size: "tiny",
|
|
1242
1368
|
fullWidth: true,
|
|
@@ -1248,20 +1374,20 @@ var UrlControl = createControl(({ placeholder }) => {
|
|
|
1248
1374
|
});
|
|
1249
1375
|
|
|
1250
1376
|
// src/controls/link-control.tsx
|
|
1251
|
-
var
|
|
1377
|
+
var React31 = __toESM(require("react"));
|
|
1252
1378
|
var import_react11 = require("react");
|
|
1253
1379
|
var import_editor_props16 = require("@elementor/editor-props");
|
|
1254
1380
|
var import_http = require("@elementor/http");
|
|
1255
|
-
var
|
|
1381
|
+
var import_icons7 = require("@elementor/icons");
|
|
1256
1382
|
var import_session = require("@elementor/session");
|
|
1257
|
-
var
|
|
1383
|
+
var import_ui26 = require("@elementor/ui");
|
|
1258
1384
|
var import_i18n10 = require("@wordpress/i18n");
|
|
1259
1385
|
|
|
1260
1386
|
// src/components/autocomplete.tsx
|
|
1261
|
-
var
|
|
1387
|
+
var React30 = __toESM(require("react"));
|
|
1262
1388
|
var import_react10 = require("react");
|
|
1263
|
-
var
|
|
1264
|
-
var
|
|
1389
|
+
var import_icons6 = require("@elementor/icons");
|
|
1390
|
+
var import_ui25 = require("@elementor/ui");
|
|
1265
1391
|
var Autocomplete = (0, import_react10.forwardRef)((props, ref) => {
|
|
1266
1392
|
const {
|
|
1267
1393
|
options,
|
|
@@ -1278,8 +1404,8 @@ var Autocomplete = (0, import_react10.forwardRef)((props, ref) => {
|
|
|
1278
1404
|
const muiWarningPreventer = allowCustomValues || !!value?.toString()?.length;
|
|
1279
1405
|
const isOptionEqualToValue = muiWarningPreventer ? void 0 : () => true;
|
|
1280
1406
|
const isValueFromOptions = typeof value === "number" && !!findMatchingOption(options, value);
|
|
1281
|
-
return /* @__PURE__ */
|
|
1282
|
-
|
|
1407
|
+
return /* @__PURE__ */ React30.createElement(
|
|
1408
|
+
import_ui25.Autocomplete,
|
|
1283
1409
|
{
|
|
1284
1410
|
...restProps,
|
|
1285
1411
|
ref,
|
|
@@ -1296,8 +1422,8 @@ var Autocomplete = (0, import_react10.forwardRef)((props, ref) => {
|
|
|
1296
1422
|
groupBy: isCategorizedOptionPool(options) ? (optionId) => findMatchingOption(options, optionId)?.groupLabel || optionId : void 0,
|
|
1297
1423
|
isOptionEqualToValue,
|
|
1298
1424
|
filterOptions: () => optionKeys,
|
|
1299
|
-
renderOption: (optionProps, optionId) => /* @__PURE__ */
|
|
1300
|
-
renderInput: (params) => /* @__PURE__ */
|
|
1425
|
+
renderOption: (optionProps, optionId) => /* @__PURE__ */ React30.createElement(import_ui25.Box, { component: "li", ...optionProps, key: optionProps.id }, findMatchingOption(options, optionId)?.label ?? optionId),
|
|
1426
|
+
renderInput: (params) => /* @__PURE__ */ React30.createElement(
|
|
1301
1427
|
TextInput,
|
|
1302
1428
|
{
|
|
1303
1429
|
params,
|
|
@@ -1320,8 +1446,8 @@ var TextInput = ({
|
|
|
1320
1446
|
const onChange = (event) => {
|
|
1321
1447
|
handleChange(event.target.value);
|
|
1322
1448
|
};
|
|
1323
|
-
return /* @__PURE__ */
|
|
1324
|
-
|
|
1449
|
+
return /* @__PURE__ */ React30.createElement(
|
|
1450
|
+
import_ui25.TextField,
|
|
1325
1451
|
{
|
|
1326
1452
|
...params,
|
|
1327
1453
|
placeholder,
|
|
@@ -1333,7 +1459,7 @@ var TextInput = ({
|
|
|
1333
1459
|
},
|
|
1334
1460
|
InputProps: {
|
|
1335
1461
|
...params.InputProps,
|
|
1336
|
-
endAdornment: /* @__PURE__ */
|
|
1462
|
+
endAdornment: /* @__PURE__ */ React30.createElement(ClearButton, { params, allowClear, handleChange })
|
|
1337
1463
|
}
|
|
1338
1464
|
}
|
|
1339
1465
|
);
|
|
@@ -1342,7 +1468,7 @@ var ClearButton = ({
|
|
|
1342
1468
|
allowClear,
|
|
1343
1469
|
handleChange,
|
|
1344
1470
|
params
|
|
1345
|
-
}) => /* @__PURE__ */
|
|
1471
|
+
}) => /* @__PURE__ */ React30.createElement(import_ui25.InputAdornment, { position: "end" }, allowClear && /* @__PURE__ */ React30.createElement(import_ui25.IconButton, { size: params.size, onClick: () => handleChange(null), sx: { cursor: "pointer" } }, /* @__PURE__ */ React30.createElement(import_icons6.XIcon, { fontSize: params.size })));
|
|
1346
1472
|
function findMatchingOption(options, optionId = null) {
|
|
1347
1473
|
const formattedOption = (optionId || "").toString();
|
|
1348
1474
|
return options.find(({ id }) => formattedOption === id.toString());
|
|
@@ -1421,8 +1547,8 @@ var LinkControl = createControl((props) => {
|
|
|
1421
1547
|
),
|
|
1422
1548
|
[endpoint]
|
|
1423
1549
|
);
|
|
1424
|
-
return /* @__PURE__ */
|
|
1425
|
-
|
|
1550
|
+
return /* @__PURE__ */ React31.createElement(PropProvider, { ...propContext, value, setValue }, /* @__PURE__ */ React31.createElement(import_ui26.Stack, { gap: 1.5 }, /* @__PURE__ */ React31.createElement(import_ui26.Divider, null), /* @__PURE__ */ React31.createElement(
|
|
1551
|
+
import_ui26.Stack,
|
|
1426
1552
|
{
|
|
1427
1553
|
direction: "row",
|
|
1428
1554
|
sx: {
|
|
@@ -1430,8 +1556,8 @@ var LinkControl = createControl((props) => {
|
|
|
1430
1556
|
alignItems: "center"
|
|
1431
1557
|
}
|
|
1432
1558
|
},
|
|
1433
|
-
/* @__PURE__ */
|
|
1434
|
-
/* @__PURE__ */
|
|
1559
|
+
/* @__PURE__ */ React31.createElement(ControlLabel, null, (0, import_i18n10.__)("Link", "elementor")),
|
|
1560
|
+
/* @__PURE__ */ React31.createElement(
|
|
1435
1561
|
ToggleIconControl,
|
|
1436
1562
|
{
|
|
1437
1563
|
enabled: isEnabled,
|
|
@@ -1439,7 +1565,7 @@ var LinkControl = createControl((props) => {
|
|
|
1439
1565
|
label: (0, import_i18n10.__)("Toggle link", "elementor")
|
|
1440
1566
|
}
|
|
1441
1567
|
)
|
|
1442
|
-
), /* @__PURE__ */
|
|
1568
|
+
), /* @__PURE__ */ React31.createElement(import_ui26.Collapse, { in: isEnabled, timeout: "auto", unmountOnExit: true }, /* @__PURE__ */ React31.createElement(import_ui26.Stack, { gap: 1.5 }, /* @__PURE__ */ React31.createElement(PropKeyProvider, { bind: "destination" }, /* @__PURE__ */ React31.createElement(ControlActions, null, /* @__PURE__ */ React31.createElement(
|
|
1443
1569
|
Autocomplete,
|
|
1444
1570
|
{
|
|
1445
1571
|
options,
|
|
@@ -1450,17 +1576,17 @@ var LinkControl = createControl((props) => {
|
|
|
1450
1576
|
onTextChange,
|
|
1451
1577
|
minInputLength
|
|
1452
1578
|
}
|
|
1453
|
-
))), /* @__PURE__ */
|
|
1579
|
+
))), /* @__PURE__ */ React31.createElement(PropKeyProvider, { bind: "isTargetBlank" }, /* @__PURE__ */ React31.createElement(SwitchControl, null))))));
|
|
1454
1580
|
});
|
|
1455
1581
|
var ToggleIconControl = ({ enabled, onIconClick, label }) => {
|
|
1456
|
-
return /* @__PURE__ */
|
|
1582
|
+
return /* @__PURE__ */ React31.createElement(import_ui26.IconButton, { size: SIZE3, onClick: onIconClick, "aria-label": label }, enabled ? /* @__PURE__ */ React31.createElement(import_icons7.MinusIcon, { fontSize: SIZE3 }) : /* @__PURE__ */ React31.createElement(import_icons7.PlusIcon, { fontSize: SIZE3 }));
|
|
1457
1583
|
};
|
|
1458
1584
|
var SwitchControl = () => {
|
|
1459
1585
|
const { value = false, setValue } = useBoundProp(import_editor_props16.booleanPropTypeUtil);
|
|
1460
1586
|
const onClick = () => {
|
|
1461
1587
|
setValue(!value);
|
|
1462
1588
|
};
|
|
1463
|
-
return /* @__PURE__ */
|
|
1589
|
+
return /* @__PURE__ */ React31.createElement(import_ui26.Grid, { container: true, alignItems: "center", flexWrap: "nowrap", justifyContent: "space-between" }, /* @__PURE__ */ React31.createElement(import_ui26.Grid, { item: true }, /* @__PURE__ */ React31.createElement(ControlLabel, null, (0, import_i18n10.__)("Open in new tab", "elementor"))), /* @__PURE__ */ React31.createElement(import_ui26.Grid, { item: true }, /* @__PURE__ */ React31.createElement(import_ui26.Switch, { checked: value, onClick })));
|
|
1464
1590
|
};
|
|
1465
1591
|
async function fetchOptions(ajaxUrl, params) {
|
|
1466
1592
|
if (!params || !ajaxUrl) {
|
|
@@ -1501,10 +1627,10 @@ function debounce(fn, timeout) {
|
|
|
1501
1627
|
}
|
|
1502
1628
|
|
|
1503
1629
|
// src/controls/gap-control.tsx
|
|
1504
|
-
var
|
|
1630
|
+
var React32 = __toESM(require("react"));
|
|
1505
1631
|
var import_editor_props17 = require("@elementor/editor-props");
|
|
1506
|
-
var
|
|
1507
|
-
var
|
|
1632
|
+
var import_icons8 = require("@elementor/icons");
|
|
1633
|
+
var import_ui27 = require("@elementor/ui");
|
|
1508
1634
|
var import_i18n11 = require("@wordpress/i18n");
|
|
1509
1635
|
var GapControl = createControl(({ label }) => {
|
|
1510
1636
|
const {
|
|
@@ -1525,9 +1651,9 @@ var GapControl = createControl(({ label }) => {
|
|
|
1525
1651
|
column: value
|
|
1526
1652
|
});
|
|
1527
1653
|
};
|
|
1528
|
-
const LinkedIcon = isLinked ?
|
|
1529
|
-
return /* @__PURE__ */
|
|
1530
|
-
|
|
1654
|
+
const LinkedIcon = isLinked ? import_icons8.LinkIcon : import_icons8.DetachIcon;
|
|
1655
|
+
return /* @__PURE__ */ React32.createElement(PropProvider, { propType, value: directionValue, setValue: setDirectionValue }, /* @__PURE__ */ React32.createElement(import_ui27.Stack, { direction: "row", gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React32.createElement(ControlLabel, null, label), /* @__PURE__ */ React32.createElement(
|
|
1656
|
+
import_ui27.ToggleButton,
|
|
1531
1657
|
{
|
|
1532
1658
|
"aria-label": (0, import_i18n11.__)("Link inputs", "elementor"),
|
|
1533
1659
|
size: "tiny",
|
|
@@ -1536,28 +1662,28 @@ var GapControl = createControl(({ label }) => {
|
|
|
1536
1662
|
sx: { marginLeft: "auto" },
|
|
1537
1663
|
onChange: onLinkToggle
|
|
1538
1664
|
},
|
|
1539
|
-
/* @__PURE__ */
|
|
1540
|
-
)), /* @__PURE__ */
|
|
1665
|
+
/* @__PURE__ */ React32.createElement(LinkedIcon, { fontSize: "tiny" })
|
|
1666
|
+
)), /* @__PURE__ */ React32.createElement(import_ui27.Stack, { direction: "row", gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React32.createElement(import_ui27.Grid, { container: true, gap: 1, alignItems: "center" }, /* @__PURE__ */ React32.createElement(import_ui27.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React32.createElement(ControlLabel, null, (0, import_i18n11.__)("Column", "elementor"))), /* @__PURE__ */ React32.createElement(import_ui27.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React32.createElement(Control4, { bind: "column", isLinked }))), /* @__PURE__ */ React32.createElement(import_ui27.Grid, { container: true, gap: 1, alignItems: "center" }, /* @__PURE__ */ React32.createElement(import_ui27.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React32.createElement(ControlLabel, null, (0, import_i18n11.__)("Row", "elementor"))), /* @__PURE__ */ React32.createElement(import_ui27.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React32.createElement(Control4, { bind: "row", isLinked })))));
|
|
1541
1667
|
});
|
|
1542
1668
|
var Control4 = ({ bind, isLinked }) => {
|
|
1543
1669
|
if (isLinked) {
|
|
1544
|
-
return /* @__PURE__ */
|
|
1670
|
+
return /* @__PURE__ */ React32.createElement(SizeControl, null);
|
|
1545
1671
|
}
|
|
1546
|
-
return /* @__PURE__ */
|
|
1672
|
+
return /* @__PURE__ */ React32.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React32.createElement(SizeControl, null));
|
|
1547
1673
|
};
|
|
1548
1674
|
|
|
1549
1675
|
// src/controls/svg-media-control.tsx
|
|
1550
|
-
var
|
|
1676
|
+
var React33 = __toESM(require("react"));
|
|
1551
1677
|
var import_editor_props18 = require("@elementor/editor-props");
|
|
1552
|
-
var
|
|
1553
|
-
var
|
|
1678
|
+
var import_icons9 = require("@elementor/icons");
|
|
1679
|
+
var import_ui28 = require("@elementor/ui");
|
|
1554
1680
|
var import_wp_media2 = require("@elementor/wp-media");
|
|
1555
1681
|
var import_i18n12 = require("@wordpress/i18n");
|
|
1556
1682
|
var TILE_SIZE = 8;
|
|
1557
1683
|
var TILE_WHITE = "transparent";
|
|
1558
1684
|
var TILE_BLACK = "#c1c1c1";
|
|
1559
1685
|
var TILES_GRADIENT_FORMULA = `linear-gradient(45deg, ${TILE_BLACK} 25%, ${TILE_WHITE} 0, ${TILE_WHITE} 75%, ${TILE_BLACK} 0, ${TILE_BLACK})`;
|
|
1560
|
-
var StyledCard = (0,
|
|
1686
|
+
var StyledCard = (0, import_ui28.styled)(import_ui28.Card)`
|
|
1561
1687
|
background-color: white;
|
|
1562
1688
|
background-image: ${TILES_GRADIENT_FORMULA}, ${TILES_GRADIENT_FORMULA};
|
|
1563
1689
|
background-size: ${TILE_SIZE}px ${TILE_SIZE}px;
|
|
@@ -1566,7 +1692,7 @@ var StyledCard = (0, import_ui27.styled)(import_ui27.Card)`
|
|
|
1566
1692
|
${TILE_SIZE / 2}px ${TILE_SIZE / 2}px;
|
|
1567
1693
|
border: none;
|
|
1568
1694
|
`;
|
|
1569
|
-
var StyledCardMediaContainer = (0,
|
|
1695
|
+
var StyledCardMediaContainer = (0, import_ui28.styled)(import_ui28.Stack)`
|
|
1570
1696
|
position: relative;
|
|
1571
1697
|
height: 140px;
|
|
1572
1698
|
object-fit: contain;
|
|
@@ -1595,16 +1721,16 @@ var SvgMediaControl = createControl(() => {
|
|
|
1595
1721
|
});
|
|
1596
1722
|
}
|
|
1597
1723
|
});
|
|
1598
|
-
return /* @__PURE__ */
|
|
1599
|
-
|
|
1724
|
+
return /* @__PURE__ */ React33.createElement(import_ui28.Stack, { gap: 1 }, /* @__PURE__ */ React33.createElement(ControlLabel, null, " ", (0, import_i18n12.__)("Choose SVG", "elementor"), " "), /* @__PURE__ */ React33.createElement(ControlActions, null, /* @__PURE__ */ React33.createElement(StyledCard, { variant: "outlined" }, /* @__PURE__ */ React33.createElement(StyledCardMediaContainer, null, isFetching ? /* @__PURE__ */ React33.createElement(import_ui28.CircularProgress, { role: "progressbar" }) : /* @__PURE__ */ React33.createElement(
|
|
1725
|
+
import_ui28.CardMedia,
|
|
1600
1726
|
{
|
|
1601
1727
|
component: "img",
|
|
1602
1728
|
image: src,
|
|
1603
1729
|
alt: (0, import_i18n12.__)("Preview SVG", "elementor"),
|
|
1604
1730
|
sx: { maxHeight: "140px", width: "50px" }
|
|
1605
1731
|
}
|
|
1606
|
-
)), /* @__PURE__ */
|
|
1607
|
-
|
|
1732
|
+
)), /* @__PURE__ */ React33.createElement(
|
|
1733
|
+
import_ui28.CardOverlay,
|
|
1608
1734
|
{
|
|
1609
1735
|
sx: {
|
|
1610
1736
|
"&:hover": {
|
|
@@ -1612,8 +1738,8 @@ var SvgMediaControl = createControl(() => {
|
|
|
1612
1738
|
}
|
|
1613
1739
|
}
|
|
1614
1740
|
},
|
|
1615
|
-
/* @__PURE__ */
|
|
1616
|
-
|
|
1741
|
+
/* @__PURE__ */ React33.createElement(import_ui28.Stack, { gap: 1 }, /* @__PURE__ */ React33.createElement(
|
|
1742
|
+
import_ui28.Button,
|
|
1617
1743
|
{
|
|
1618
1744
|
size: "tiny",
|
|
1619
1745
|
color: "inherit",
|
|
@@ -1621,13 +1747,13 @@ var SvgMediaControl = createControl(() => {
|
|
|
1621
1747
|
onClick: () => open({ mode: "browse" })
|
|
1622
1748
|
},
|
|
1623
1749
|
(0, import_i18n12.__)("Select SVG", "elementor")
|
|
1624
|
-
), /* @__PURE__ */
|
|
1625
|
-
|
|
1750
|
+
), /* @__PURE__ */ React33.createElement(
|
|
1751
|
+
import_ui28.Button,
|
|
1626
1752
|
{
|
|
1627
1753
|
size: "tiny",
|
|
1628
1754
|
variant: "text",
|
|
1629
1755
|
color: "inherit",
|
|
1630
|
-
startIcon: /* @__PURE__ */
|
|
1756
|
+
startIcon: /* @__PURE__ */ React33.createElement(import_icons9.UploadIcon, null),
|
|
1631
1757
|
onClick: () => open({ mode: "upload" })
|
|
1632
1758
|
},
|
|
1633
1759
|
(0, import_i18n12.__)("Upload SVG", "elementor")
|
|
@@ -1636,15 +1762,15 @@ var SvgMediaControl = createControl(() => {
|
|
|
1636
1762
|
});
|
|
1637
1763
|
|
|
1638
1764
|
// src/controls/background-control/background-control.tsx
|
|
1639
|
-
var
|
|
1765
|
+
var React39 = __toESM(require("react"));
|
|
1640
1766
|
var import_editor_props23 = require("@elementor/editor-props");
|
|
1641
|
-
var
|
|
1767
|
+
var import_ui35 = require("@elementor/ui");
|
|
1642
1768
|
var import_i18n18 = require("@wordpress/i18n");
|
|
1643
1769
|
|
|
1644
1770
|
// src/controls/background-control/background-overlay/background-overlay-repeater-control.tsx
|
|
1645
|
-
var
|
|
1771
|
+
var React38 = __toESM(require("react"));
|
|
1646
1772
|
var import_editor_props22 = require("@elementor/editor-props");
|
|
1647
|
-
var
|
|
1773
|
+
var import_ui34 = require("@elementor/ui");
|
|
1648
1774
|
var import_wp_media3 = require("@elementor/wp-media");
|
|
1649
1775
|
var import_i18n17 = require("@wordpress/i18n");
|
|
1650
1776
|
|
|
@@ -1653,33 +1779,33 @@ var import_env = require("@elementor/env");
|
|
|
1653
1779
|
var { env } = (0, import_env.parseEnv)("@elementor/editor-controls");
|
|
1654
1780
|
|
|
1655
1781
|
// src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-attachment.tsx
|
|
1656
|
-
var
|
|
1657
|
-
var
|
|
1658
|
-
var
|
|
1782
|
+
var React34 = __toESM(require("react"));
|
|
1783
|
+
var import_icons10 = require("@elementor/icons");
|
|
1784
|
+
var import_ui29 = require("@elementor/ui");
|
|
1659
1785
|
var import_i18n13 = require("@wordpress/i18n");
|
|
1660
1786
|
var attachmentControlOptions = [
|
|
1661
1787
|
{
|
|
1662
1788
|
value: "fixed",
|
|
1663
1789
|
label: (0, import_i18n13.__)("Fixed", "elementor"),
|
|
1664
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1790
|
+
renderContent: ({ size }) => /* @__PURE__ */ React34.createElement(import_icons10.PinIcon, { fontSize: size }),
|
|
1665
1791
|
showTooltip: true
|
|
1666
1792
|
},
|
|
1667
1793
|
{
|
|
1668
1794
|
value: "scroll",
|
|
1669
1795
|
label: (0, import_i18n13.__)("Scroll", "elementor"),
|
|
1670
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1796
|
+
renderContent: ({ size }) => /* @__PURE__ */ React34.createElement(import_icons10.PinnedOffIcon, { fontSize: size }),
|
|
1671
1797
|
showTooltip: true
|
|
1672
1798
|
}
|
|
1673
1799
|
];
|
|
1674
1800
|
var BackgroundImageOverlayAttachment = () => {
|
|
1675
|
-
return /* @__PURE__ */
|
|
1801
|
+
return /* @__PURE__ */ React34.createElement(PopoverGridContainer, null, /* @__PURE__ */ React34.createElement(import_ui29.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React34.createElement(ControlLabel, null, (0, import_i18n13.__)("Attachment", "elementor"))), /* @__PURE__ */ React34.createElement(import_ui29.Grid, { item: true, xs: 6, sx: { display: "flex", justifyContent: "flex-end", overflow: "hidden" } }, /* @__PURE__ */ React34.createElement(ToggleControl, { options: attachmentControlOptions })));
|
|
1676
1802
|
};
|
|
1677
1803
|
|
|
1678
1804
|
// src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-position.tsx
|
|
1679
|
-
var
|
|
1805
|
+
var React35 = __toESM(require("react"));
|
|
1680
1806
|
var import_editor_props19 = require("@elementor/editor-props");
|
|
1681
|
-
var
|
|
1682
|
-
var
|
|
1807
|
+
var import_icons11 = require("@elementor/icons");
|
|
1808
|
+
var import_ui30 = require("@elementor/ui");
|
|
1683
1809
|
var import_i18n14 = require("@wordpress/i18n");
|
|
1684
1810
|
var backgroundPositionOptions = [
|
|
1685
1811
|
{ label: (0, import_i18n14.__)("Center center", "elementor"), value: "center center" },
|
|
@@ -1705,82 +1831,82 @@ var BackgroundImageOverlayPosition = () => {
|
|
|
1705
1831
|
stringPropContext.setValue(value);
|
|
1706
1832
|
}
|
|
1707
1833
|
};
|
|
1708
|
-
return /* @__PURE__ */
|
|
1709
|
-
|
|
1834
|
+
return /* @__PURE__ */ React35.createElement(import_ui30.Grid, { container: true, spacing: 1.5 }, /* @__PURE__ */ React35.createElement(import_ui30.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React35.createElement(PopoverGridContainer, null, /* @__PURE__ */ React35.createElement(import_ui30.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React35.createElement(ControlLabel, null, (0, import_i18n14.__)("Position", "elementor"))), /* @__PURE__ */ React35.createElement(import_ui30.Grid, { item: true, xs: 6, sx: { display: "flex", justifyContent: "flex-end", overflow: "hidden" } }, /* @__PURE__ */ React35.createElement(
|
|
1835
|
+
import_ui30.Select,
|
|
1710
1836
|
{
|
|
1711
1837
|
size: "tiny",
|
|
1712
1838
|
value: (backgroundImageOffsetContext.value ? "custom" : stringPropContext.value) ?? "",
|
|
1713
1839
|
onChange: handlePositionChange,
|
|
1714
1840
|
fullWidth: true
|
|
1715
1841
|
},
|
|
1716
|
-
backgroundPositionOptions.map(({ label, value }) => /* @__PURE__ */
|
|
1717
|
-
)))), isCustom ? /* @__PURE__ */
|
|
1842
|
+
backgroundPositionOptions.map(({ label, value }) => /* @__PURE__ */ React35.createElement(import_ui30.MenuItem, { key: value, value: value ?? "" }, label))
|
|
1843
|
+
)))), isCustom ? /* @__PURE__ */ React35.createElement(PropProvider, { ...backgroundImageOffsetContext }, /* @__PURE__ */ React35.createElement(import_ui30.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React35.createElement(import_ui30.Grid, { container: true, spacing: 1.5 }, /* @__PURE__ */ React35.createElement(import_ui30.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React35.createElement(PropKeyProvider, { bind: "x" }, /* @__PURE__ */ React35.createElement(SizeControl, { startIcon: /* @__PURE__ */ React35.createElement(import_icons11.LetterXIcon, { fontSize: "tiny" }) }))), /* @__PURE__ */ React35.createElement(import_ui30.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React35.createElement(PropKeyProvider, { bind: "y" }, /* @__PURE__ */ React35.createElement(SizeControl, { startIcon: /* @__PURE__ */ React35.createElement(import_icons11.LetterYIcon, { fontSize: "tiny" }) })))))) : null);
|
|
1718
1844
|
};
|
|
1719
1845
|
|
|
1720
1846
|
// src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-repeat.tsx
|
|
1721
|
-
var
|
|
1722
|
-
var
|
|
1723
|
-
var
|
|
1847
|
+
var React36 = __toESM(require("react"));
|
|
1848
|
+
var import_icons12 = require("@elementor/icons");
|
|
1849
|
+
var import_ui31 = require("@elementor/ui");
|
|
1724
1850
|
var import_i18n15 = require("@wordpress/i18n");
|
|
1725
1851
|
var repeatControlOptions = [
|
|
1726
1852
|
{
|
|
1727
1853
|
value: "repeat",
|
|
1728
1854
|
label: (0, import_i18n15.__)("Repeat", "elementor"),
|
|
1729
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1855
|
+
renderContent: ({ size }) => /* @__PURE__ */ React36.createElement(import_icons12.GridDotsIcon, { fontSize: size }),
|
|
1730
1856
|
showTooltip: true
|
|
1731
1857
|
},
|
|
1732
1858
|
{
|
|
1733
1859
|
value: "repeat-x",
|
|
1734
1860
|
label: (0, import_i18n15.__)("Repeat-x", "elementor"),
|
|
1735
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1861
|
+
renderContent: ({ size }) => /* @__PURE__ */ React36.createElement(import_icons12.DotsHorizontalIcon, { fontSize: size }),
|
|
1736
1862
|
showTooltip: true
|
|
1737
1863
|
},
|
|
1738
1864
|
{
|
|
1739
1865
|
value: "repeat-y",
|
|
1740
1866
|
label: (0, import_i18n15.__)("Repeat-y", "elementor"),
|
|
1741
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1867
|
+
renderContent: ({ size }) => /* @__PURE__ */ React36.createElement(import_icons12.DotsVerticalIcon, { fontSize: size }),
|
|
1742
1868
|
showTooltip: true
|
|
1743
1869
|
},
|
|
1744
1870
|
{
|
|
1745
1871
|
value: "no-repeat",
|
|
1746
1872
|
label: (0, import_i18n15.__)("No-Repeat", "elementor"),
|
|
1747
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1873
|
+
renderContent: ({ size }) => /* @__PURE__ */ React36.createElement(import_icons12.XIcon, { fontSize: size }),
|
|
1748
1874
|
showTooltip: true
|
|
1749
1875
|
}
|
|
1750
1876
|
];
|
|
1751
1877
|
var BackgroundImageOverlayRepeat = () => {
|
|
1752
|
-
return /* @__PURE__ */
|
|
1878
|
+
return /* @__PURE__ */ React36.createElement(PopoverGridContainer, null, /* @__PURE__ */ React36.createElement(import_ui31.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React36.createElement(ControlLabel, null, (0, import_i18n15.__)("Repeat", "elementor"))), /* @__PURE__ */ React36.createElement(import_ui31.Grid, { item: true, xs: 6, sx: { display: "flex", justifyContent: "flex-end" } }, /* @__PURE__ */ React36.createElement(ToggleControl, { options: repeatControlOptions })));
|
|
1753
1879
|
};
|
|
1754
1880
|
|
|
1755
1881
|
// src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-size.tsx
|
|
1756
|
-
var
|
|
1882
|
+
var React37 = __toESM(require("react"));
|
|
1757
1883
|
var import_editor_props20 = require("@elementor/editor-props");
|
|
1758
|
-
var
|
|
1759
|
-
var
|
|
1884
|
+
var import_icons13 = require("@elementor/icons");
|
|
1885
|
+
var import_ui32 = require("@elementor/ui");
|
|
1760
1886
|
var import_i18n16 = require("@wordpress/i18n");
|
|
1761
1887
|
var sizeControlOptions = [
|
|
1762
1888
|
{
|
|
1763
1889
|
value: "auto",
|
|
1764
1890
|
label: (0, import_i18n16.__)("Auto", "elementor"),
|
|
1765
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1891
|
+
renderContent: ({ size }) => /* @__PURE__ */ React37.createElement(import_icons13.LetterAIcon, { fontSize: size }),
|
|
1766
1892
|
showTooltip: true
|
|
1767
1893
|
},
|
|
1768
1894
|
{
|
|
1769
1895
|
value: "cover",
|
|
1770
1896
|
label: (0, import_i18n16.__)("Cover", "elementor"),
|
|
1771
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1897
|
+
renderContent: ({ size }) => /* @__PURE__ */ React37.createElement(import_icons13.ArrowsMaximizeIcon, { fontSize: size }),
|
|
1772
1898
|
showTooltip: true
|
|
1773
1899
|
},
|
|
1774
1900
|
{
|
|
1775
1901
|
value: "contain",
|
|
1776
1902
|
label: (0, import_i18n16.__)("Contain", "elementor"),
|
|
1777
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1903
|
+
renderContent: ({ size }) => /* @__PURE__ */ React37.createElement(import_icons13.ArrowBarBothIcon, { fontSize: size }),
|
|
1778
1904
|
showTooltip: true
|
|
1779
1905
|
},
|
|
1780
1906
|
{
|
|
1781
1907
|
value: "custom",
|
|
1782
1908
|
label: (0, import_i18n16.__)("Custom", "elementor"),
|
|
1783
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1909
|
+
renderContent: ({ size }) => /* @__PURE__ */ React37.createElement(import_icons13.PencilIcon, { fontSize: size }),
|
|
1784
1910
|
showTooltip: true
|
|
1785
1911
|
}
|
|
1786
1912
|
];
|
|
@@ -1795,7 +1921,7 @@ var BackgroundImageOverlaySize = () => {
|
|
|
1795
1921
|
stringPropContext.setValue(size);
|
|
1796
1922
|
}
|
|
1797
1923
|
};
|
|
1798
|
-
return /* @__PURE__ */
|
|
1924
|
+
return /* @__PURE__ */ React37.createElement(import_ui32.Grid, { container: true, spacing: 1.5 }, /* @__PURE__ */ React37.createElement(import_ui32.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React37.createElement(PopoverGridContainer, null, /* @__PURE__ */ React37.createElement(import_ui32.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React37.createElement(ControlLabel, null, (0, import_i18n16.__)("Size", "elementor"))), /* @__PURE__ */ React37.createElement(import_ui32.Grid, { item: true, xs: 6, sx: { display: "flex", justifyContent: "flex-end" } }, /* @__PURE__ */ React37.createElement(
|
|
1799
1925
|
ControlToggleButtonGroup,
|
|
1800
1926
|
{
|
|
1801
1927
|
exclusive: true,
|
|
@@ -1803,20 +1929,20 @@ var BackgroundImageOverlaySize = () => {
|
|
|
1803
1929
|
value: backgroundImageScaleContext.value ? "custom" : stringPropContext.value,
|
|
1804
1930
|
onChange: handleSizeChange
|
|
1805
1931
|
}
|
|
1806
|
-
)))), isCustom ? /* @__PURE__ */
|
|
1932
|
+
)))), isCustom ? /* @__PURE__ */ React37.createElement(PropProvider, { ...backgroundImageScaleContext }, /* @__PURE__ */ React37.createElement(import_ui32.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React37.createElement(PopoverGridContainer, null, /* @__PURE__ */ React37.createElement(import_ui32.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React37.createElement(PropKeyProvider, { bind: "width" }, /* @__PURE__ */ React37.createElement(SizeControl, { startIcon: /* @__PURE__ */ React37.createElement(import_icons13.ArrowsMoveHorizontalIcon, { fontSize: "tiny" }) }))), /* @__PURE__ */ React37.createElement(import_ui32.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React37.createElement(PropKeyProvider, { bind: "height" }, /* @__PURE__ */ React37.createElement(SizeControl, { startIcon: /* @__PURE__ */ React37.createElement(import_icons13.ArrowsMoveVerticalIcon, { fontSize: "tiny" }) })))))) : null);
|
|
1807
1933
|
};
|
|
1808
1934
|
|
|
1809
1935
|
// src/controls/background-control/background-overlay/use-background-tabs-history.ts
|
|
1810
1936
|
var import_react12 = require("react");
|
|
1811
1937
|
var import_editor_props21 = require("@elementor/editor-props");
|
|
1812
|
-
var
|
|
1938
|
+
var import_ui33 = require("@elementor/ui");
|
|
1813
1939
|
var useBackgroundTabsHistory = ({
|
|
1814
1940
|
color: initialBackgroundColorOverlay2,
|
|
1815
1941
|
image: initialBackgroundImageOverlay
|
|
1816
1942
|
}) => {
|
|
1817
1943
|
const { value: imageValue, setValue: setImageValue } = useBoundProp(import_editor_props21.backgroundImageOverlayPropTypeUtil);
|
|
1818
1944
|
const { value: colorValue, setValue: setColorValue } = useBoundProp(import_editor_props21.backgroundColorOverlayPropTypeUtil);
|
|
1819
|
-
const { getTabsProps, getTabProps, getTabPanelProps } = (0,
|
|
1945
|
+
const { getTabsProps, getTabProps, getTabPanelProps } = (0, import_ui33.useTabs)(colorValue ? "color" : "image");
|
|
1820
1946
|
const valuesHistory = (0, import_react12.useRef)({
|
|
1821
1947
|
image: initialBackgroundImageOverlay,
|
|
1822
1948
|
color: initialBackgroundColorOverlay2
|
|
@@ -1882,7 +2008,7 @@ var backgroundResolutionOptions = [
|
|
|
1882
2008
|
];
|
|
1883
2009
|
var BackgroundOverlayRepeaterControl = createControl(() => {
|
|
1884
2010
|
const { propType, value: overlayValues, setValue } = useBoundProp(import_editor_props22.backgroundOverlayPropTypeUtil);
|
|
1885
|
-
return /* @__PURE__ */
|
|
2011
|
+
return /* @__PURE__ */ React38.createElement(PropProvider, { propType, value: overlayValues, setValue }, /* @__PURE__ */ React38.createElement(
|
|
1886
2012
|
Repeater,
|
|
1887
2013
|
{
|
|
1888
2014
|
values: overlayValues ?? [],
|
|
@@ -1898,58 +2024,58 @@ var BackgroundOverlayRepeaterControl = createControl(() => {
|
|
|
1898
2024
|
));
|
|
1899
2025
|
});
|
|
1900
2026
|
var ItemContent2 = ({ bind }) => {
|
|
1901
|
-
return /* @__PURE__ */
|
|
2027
|
+
return /* @__PURE__ */ React38.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React38.createElement(Content2, null));
|
|
1902
2028
|
};
|
|
1903
2029
|
var Content2 = () => {
|
|
1904
2030
|
const { getTabsProps, getTabProps, getTabPanelProps } = useBackgroundTabsHistory({
|
|
1905
2031
|
image: getInitialBackgroundOverlay().value,
|
|
1906
2032
|
color: initialBackgroundColorOverlay.value
|
|
1907
2033
|
});
|
|
1908
|
-
return /* @__PURE__ */
|
|
2034
|
+
return /* @__PURE__ */ React38.createElement(import_ui34.Box, { sx: { width: "100%" } }, /* @__PURE__ */ React38.createElement(import_ui34.Box, { sx: { borderBottom: 1, borderColor: "divider" } }, /* @__PURE__ */ React38.createElement(import_ui34.Tabs, { ...getTabsProps(), "aria-label": (0, import_i18n17.__)("Background Overlay", "elementor") }, /* @__PURE__ */ React38.createElement(import_ui34.Tab, { label: (0, import_i18n17.__)("Image", "elementor"), ...getTabProps("image") }), /* @__PURE__ */ React38.createElement(import_ui34.Tab, { label: (0, import_i18n17.__)("Color", "elementor"), ...getTabProps("color") }))), /* @__PURE__ */ React38.createElement(import_ui34.TabPanel, { sx: { p: 1.5 }, ...getTabPanelProps("image") }, /* @__PURE__ */ React38.createElement(PopoverContent, null, /* @__PURE__ */ React38.createElement(ImageOverlayContent, null))), /* @__PURE__ */ React38.createElement(import_ui34.TabPanel, { ...getTabPanelProps("color"), sx: { p: 1.5 } }, /* @__PURE__ */ React38.createElement(import_ui34.Grid, { container: true, spacing: 1, alignItems: "center" }, /* @__PURE__ */ React38.createElement(import_ui34.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React38.createElement(ColorControl, { propTypeUtil: import_editor_props22.backgroundColorOverlayPropTypeUtil })))));
|
|
1909
2035
|
};
|
|
1910
2036
|
var ItemIcon2 = ({ value }) => {
|
|
1911
2037
|
switch (value.$$type) {
|
|
1912
2038
|
case "background-image-overlay":
|
|
1913
|
-
return /* @__PURE__ */
|
|
2039
|
+
return /* @__PURE__ */ React38.createElement(ItemIconImage, { value });
|
|
1914
2040
|
case "background-color-overlay":
|
|
1915
|
-
return /* @__PURE__ */
|
|
2041
|
+
return /* @__PURE__ */ React38.createElement(ItemIconColor, { value });
|
|
1916
2042
|
default:
|
|
1917
2043
|
return null;
|
|
1918
2044
|
}
|
|
1919
2045
|
};
|
|
1920
2046
|
var ItemIconColor = ({ value }) => {
|
|
1921
|
-
return /* @__PURE__ */
|
|
2047
|
+
return /* @__PURE__ */ React38.createElement(import_ui34.UnstableColorIndicator, { size: "inherit", component: "span", value: value.value });
|
|
1922
2048
|
};
|
|
1923
2049
|
var ItemIconImage = ({ value }) => {
|
|
1924
2050
|
const { imageUrl } = useImage(value);
|
|
1925
|
-
return /* @__PURE__ */
|
|
2051
|
+
return /* @__PURE__ */ React38.createElement(import_ui34.CardMedia, { image: imageUrl, sx: { height: 13, width: 13, borderRadius: "4px" } });
|
|
1926
2052
|
};
|
|
1927
2053
|
var ItemLabel2 = ({ value }) => {
|
|
1928
2054
|
switch (value.$$type) {
|
|
1929
2055
|
case "background-image-overlay":
|
|
1930
|
-
return /* @__PURE__ */
|
|
2056
|
+
return /* @__PURE__ */ React38.createElement(ItemLabelImage, { value });
|
|
1931
2057
|
case "background-color-overlay":
|
|
1932
|
-
return /* @__PURE__ */
|
|
2058
|
+
return /* @__PURE__ */ React38.createElement(ItemLabelColor, { value });
|
|
1933
2059
|
default:
|
|
1934
2060
|
return null;
|
|
1935
2061
|
}
|
|
1936
2062
|
};
|
|
1937
2063
|
var ItemLabelColor = ({ value }) => {
|
|
1938
|
-
return /* @__PURE__ */
|
|
2064
|
+
return /* @__PURE__ */ React38.createElement("span", null, value.value);
|
|
1939
2065
|
};
|
|
1940
2066
|
var ItemLabelImage = ({ value }) => {
|
|
1941
2067
|
const { imageTitle } = useImage(value);
|
|
1942
|
-
return /* @__PURE__ */
|
|
2068
|
+
return /* @__PURE__ */ React38.createElement("span", null, imageTitle);
|
|
1943
2069
|
};
|
|
1944
2070
|
var ImageOverlayContent = () => {
|
|
1945
2071
|
const propContext = useBoundProp(import_editor_props22.backgroundImageOverlayPropTypeUtil);
|
|
1946
|
-
return /* @__PURE__ */
|
|
2072
|
+
return /* @__PURE__ */ React38.createElement(PropProvider, { ...propContext }, /* @__PURE__ */ React38.createElement(PropKeyProvider, { bind: "image" }, /* @__PURE__ */ React38.createElement(import_ui34.Grid, { container: true, spacing: 1, alignItems: "center" }, /* @__PURE__ */ React38.createElement(import_ui34.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React38.createElement(
|
|
1947
2073
|
ImageControl,
|
|
1948
2074
|
{
|
|
1949
2075
|
resolutionLabel: (0, import_i18n17.__)("Resolution", "elementor"),
|
|
1950
2076
|
sizes: backgroundResolutionOptions
|
|
1951
2077
|
}
|
|
1952
|
-
)))), /* @__PURE__ */
|
|
2078
|
+
)))), /* @__PURE__ */ React38.createElement(PropKeyProvider, { bind: "position" }, /* @__PURE__ */ React38.createElement(BackgroundImageOverlayPosition, null)), /* @__PURE__ */ React38.createElement(PropKeyProvider, { bind: "repeat" }, /* @__PURE__ */ React38.createElement(BackgroundImageOverlayRepeat, null)), /* @__PURE__ */ React38.createElement(PropKeyProvider, { bind: "size" }, /* @__PURE__ */ React38.createElement(BackgroundImageOverlaySize, null)), /* @__PURE__ */ React38.createElement(PropKeyProvider, { bind: "attachment" }, /* @__PURE__ */ React38.createElement(BackgroundImageOverlayAttachment, null)));
|
|
1953
2079
|
};
|
|
1954
2080
|
var useImage = (image) => {
|
|
1955
2081
|
let imageTitle, imageUrl = null;
|
|
@@ -1969,7 +2095,7 @@ var useImage = (image) => {
|
|
|
1969
2095
|
// src/controls/background-control/background-control.tsx
|
|
1970
2096
|
var BackgroundControl = createControl(() => {
|
|
1971
2097
|
const propContext = useBoundProp(import_editor_props23.backgroundPropTypeUtil);
|
|
1972
|
-
return /* @__PURE__ */
|
|
2098
|
+
return /* @__PURE__ */ React39.createElement(PropProvider, { ...propContext }, /* @__PURE__ */ React39.createElement(SectionContent, null, /* @__PURE__ */ React39.createElement(PropKeyProvider, { bind: "background-overlay" }, /* @__PURE__ */ React39.createElement(BackgroundOverlayRepeaterControl, null)), /* @__PURE__ */ React39.createElement(PropKeyProvider, { bind: "color" }, /* @__PURE__ */ React39.createElement(import_ui35.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React39.createElement(import_ui35.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React39.createElement(ControlLabel, null, (0, import_i18n18.__)("Color", "elementor"))), /* @__PURE__ */ React39.createElement(import_ui35.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React39.createElement(ColorControl, null))))));
|
|
1973
2099
|
});
|
|
1974
2100
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1975
2101
|
0 && (module.exports = {
|