@elementor/editor-controls 0.20.0 → 0.24.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 +48 -0
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +373 -290
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +307 -224
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
- package/src/components/control-form-label.tsx +6 -0
- package/src/components/control-label.tsx +12 -3
- package/src/components/repeater.tsx +18 -8
- package/src/components/sortable.tsx +6 -6
- package/src/components/text-field-inner-selection.tsx +3 -3
- package/src/controls/background-control/background-control.tsx +2 -2
- package/src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-attachment.tsx +2 -2
- package/src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-position.tsx +2 -2
- package/src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-repeat.tsx +2 -2
- package/src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-size.tsx +2 -2
- package/src/controls/background-control/background-overlay/background-overlay-repeater-control.tsx +30 -5
- package/src/controls/color-control.tsx +1 -1
- package/src/controls/equal-unequal-sizes-control.tsx +2 -1
- package/src/controls/font-family-control/font-family-control.tsx +2 -0
- package/src/controls/gap-control.tsx +3 -2
- package/src/controls/image-control.tsx +3 -3
- package/src/controls/link-control.tsx +99 -27
- package/src/controls/linked-dimensions-control.tsx +7 -6
- package/src/controls/stroke-control.tsx +2 -2
- package/src/controls/svg-media-control.tsx +2 -2
- package/src/index.ts +2 -1
- package/src/control-adornments/control-label-with-adornments.tsx +0 -15
package/dist/index.js
CHANGED
|
@@ -36,7 +36,7 @@ __export(index_exports, {
|
|
|
36
36
|
ControlActionsProvider: () => ControlActionsProvider,
|
|
37
37
|
ControlAdornments: () => ControlAdornments,
|
|
38
38
|
ControlAdornmentsProvider: () => ControlAdornmentsProvider,
|
|
39
|
-
|
|
39
|
+
ControlFormLabel: () => ControlFormLabel,
|
|
40
40
|
ControlReplacementProvider: () => ControlReplacementProvider,
|
|
41
41
|
ControlToggleButtonGroup: () => ControlToggleButtonGroup,
|
|
42
42
|
EqualUnequalSizesControl: () => EqualUnequalSizesControl,
|
|
@@ -218,10 +218,10 @@ var resolveUnionPropType = (propType, key) => {
|
|
|
218
218
|
return resolvedPropType;
|
|
219
219
|
};
|
|
220
220
|
|
|
221
|
-
// src/components/control-label.tsx
|
|
221
|
+
// src/components/control-form-label.tsx
|
|
222
222
|
var React3 = __toESM(require("react"));
|
|
223
223
|
var import_ui = require("@elementor/ui");
|
|
224
|
-
var
|
|
224
|
+
var ControlFormLabel = ({ children }) => {
|
|
225
225
|
return /* @__PURE__ */ React3.createElement(import_ui.FormLabel, { size: "tiny" }, children);
|
|
226
226
|
};
|
|
227
227
|
|
|
@@ -428,7 +428,7 @@ var ImageControl = createControl(
|
|
|
428
428
|
const propContext = useBoundProp(import_editor_props3.imagePropTypeUtil);
|
|
429
429
|
const { data: allowSvgUpload } = useUnfilteredFilesUpload();
|
|
430
430
|
const mediaTypes = allowSvgUpload ? ["image", "svg"] : ["image"];
|
|
431
|
-
return /* @__PURE__ */ React10.createElement(PropProvider, { ...propContext }, /* @__PURE__ */ React10.createElement(import_ui6.Stack, { gap: 1.5 }, /* @__PURE__ */ React10.createElement(PropKeyProvider, { bind: "src" }, /* @__PURE__ */ React10.createElement(
|
|
431
|
+
return /* @__PURE__ */ React10.createElement(PropProvider, { ...propContext }, /* @__PURE__ */ React10.createElement(import_ui6.Stack, { gap: 1.5 }, /* @__PURE__ */ React10.createElement(PropKeyProvider, { bind: "src" }, /* @__PURE__ */ React10.createElement(ControlFormLabel, null, " ", (0, import_i18n2.__)("Image", "elementor"), " "), /* @__PURE__ */ React10.createElement(ImageMediaControl, { mediaTypes })), /* @__PURE__ */ React10.createElement(PropKeyProvider, { bind: "size" }, /* @__PURE__ */ React10.createElement(import_ui6.Grid, { container: true, gap: 1.5, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React10.createElement(import_ui6.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React10.createElement(ControlFormLabel, null, " ", resolutionLabel, " ")), /* @__PURE__ */ React10.createElement(import_ui6.Grid, { item: true, xs: 6, sx: { overflow: "hidden" } }, /* @__PURE__ */ React10.createElement(SelectControl, { options: sizes }))))));
|
|
432
432
|
}
|
|
433
433
|
);
|
|
434
434
|
|
|
@@ -521,11 +521,11 @@ var SelectionEndAdornment = ({
|
|
|
521
521
|
import_ui9.Button,
|
|
522
522
|
{
|
|
523
523
|
size: "small",
|
|
524
|
-
color: "
|
|
525
|
-
sx: { font: "inherit", minWidth: "initial" },
|
|
524
|
+
color: "secondary",
|
|
525
|
+
sx: { font: "inherit", minWidth: "initial", textTransform: "uppercase" },
|
|
526
526
|
...(0, import_ui9.bindTrigger)(popupState)
|
|
527
527
|
},
|
|
528
|
-
value
|
|
528
|
+
value
|
|
529
529
|
), /* @__PURE__ */ React13.createElement(import_ui9.Menu, { MenuListProps: { dense: true }, ...(0, import_ui9.bindMenu)(popupState) }, options.map((option, index) => /* @__PURE__ */ React13.createElement(import_editor_ui2.MenuListItem, { key: option, onClick: () => handleMenuItemClick(index) }, option.toUpperCase()))));
|
|
530
530
|
};
|
|
531
531
|
|
|
@@ -672,7 +672,7 @@ var import_ui12 = require("@elementor/ui");
|
|
|
672
672
|
var ColorControl = createControl(({ propTypeUtil = import_editor_props7.colorPropTypeUtil, ...props }) => {
|
|
673
673
|
const { value, setValue } = useBoundProp(propTypeUtil);
|
|
674
674
|
const handleChange = (selectedColor) => {
|
|
675
|
-
setValue(selectedColor);
|
|
675
|
+
setValue(selectedColor || null);
|
|
676
676
|
};
|
|
677
677
|
return /* @__PURE__ */ React16.createElement(ControlActions, null, /* @__PURE__ */ React16.createElement(import_ui12.UnstableColorField, { size: "tiny", ...props, value: value ?? "", onChange: handleChange, fullWidth: true }));
|
|
678
678
|
});
|
|
@@ -683,10 +683,10 @@ var StrokeControl = createControl(() => {
|
|
|
683
683
|
const propContext = useBoundProp(import_editor_props8.strokePropTypeUtil);
|
|
684
684
|
return /* @__PURE__ */ React17.createElement(PropProvider, { ...propContext }, /* @__PURE__ */ React17.createElement(SectionContent, null, /* @__PURE__ */ React17.createElement(Control, { bind: "width", label: (0, import_i18n3.__)("Stroke width", "elementor") }, /* @__PURE__ */ React17.createElement(SizeControl, { units })), /* @__PURE__ */ React17.createElement(Control, { bind: "color", label: (0, import_i18n3.__)("Stroke color", "elementor") }, /* @__PURE__ */ React17.createElement(ColorControl, null))));
|
|
685
685
|
});
|
|
686
|
-
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(
|
|
686
|
+
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(ControlFormLabel, null, label)), /* @__PURE__ */ React17.createElement(import_ui13.Grid, { item: true, xs: 6 }, children)));
|
|
687
687
|
|
|
688
688
|
// src/controls/box-shadow-repeater-control.tsx
|
|
689
|
-
var
|
|
689
|
+
var React24 = __toESM(require("react"));
|
|
690
690
|
var import_editor_props9 = require("@elementor/editor-props");
|
|
691
691
|
var import_ui18 = require("@elementor/ui");
|
|
692
692
|
var import_i18n5 = require("@wordpress/i18n");
|
|
@@ -707,21 +707,43 @@ var PopoverGridContainer = ({
|
|
|
707
707
|
}) => /* @__PURE__ */ React19.createElement(import_ui15.Grid, { container: true, gap, alignItems, flexWrap }, children);
|
|
708
708
|
|
|
709
709
|
// src/components/repeater.tsx
|
|
710
|
-
var
|
|
711
|
-
var
|
|
710
|
+
var React23 = __toESM(require("react"));
|
|
711
|
+
var import_react8 = require("react");
|
|
712
712
|
var import_icons3 = require("@elementor/icons");
|
|
713
713
|
var import_ui17 = require("@elementor/ui");
|
|
714
714
|
var import_i18n4 = require("@wordpress/i18n");
|
|
715
715
|
|
|
716
|
-
// src/
|
|
716
|
+
// src/control-adornments/control-adornments.tsx
|
|
717
|
+
var React21 = __toESM(require("react"));
|
|
718
|
+
|
|
719
|
+
// src/control-adornments/control-adornments-context.tsx
|
|
717
720
|
var React20 = __toESM(require("react"));
|
|
721
|
+
var import_react7 = require("react");
|
|
722
|
+
var Context2 = (0, import_react7.createContext)(null);
|
|
723
|
+
var ControlAdornmentsProvider = ({ children, items }) => /* @__PURE__ */ React20.createElement(Context2.Provider, { value: { items } }, children);
|
|
724
|
+
var useControlAdornments = () => {
|
|
725
|
+
const context = (0, import_react7.useContext)(Context2);
|
|
726
|
+
return context?.items ?? [];
|
|
727
|
+
};
|
|
728
|
+
|
|
729
|
+
// src/control-adornments/control-adornments.tsx
|
|
730
|
+
function ControlAdornments() {
|
|
731
|
+
const items = useControlAdornments();
|
|
732
|
+
if (items?.length === 0) {
|
|
733
|
+
return null;
|
|
734
|
+
}
|
|
735
|
+
return /* @__PURE__ */ React21.createElement(React21.Fragment, null, items.map(({ Adornment, id }) => /* @__PURE__ */ React21.createElement(Adornment, { key: id })));
|
|
736
|
+
}
|
|
737
|
+
|
|
738
|
+
// src/components/sortable.tsx
|
|
739
|
+
var React22 = __toESM(require("react"));
|
|
718
740
|
var import_icons2 = require("@elementor/icons");
|
|
719
741
|
var import_ui16 = require("@elementor/ui");
|
|
720
742
|
var SortableProvider = (props) => {
|
|
721
|
-
return /* @__PURE__ */
|
|
743
|
+
return /* @__PURE__ */ React22.createElement(import_ui16.List, { sx: { p: 0, my: -0.5, mx: 0 } }, /* @__PURE__ */ React22.createElement(import_ui16.UnstableSortableProvider, { restrictAxis: true, disableDragOverlay: false, variant: "static", ...props }));
|
|
722
744
|
};
|
|
723
745
|
var SortableItem = ({ id, children }) => {
|
|
724
|
-
return /* @__PURE__ */
|
|
746
|
+
return /* @__PURE__ */ React22.createElement(
|
|
725
747
|
import_ui16.UnstableSortableItem,
|
|
726
748
|
{
|
|
727
749
|
id,
|
|
@@ -730,21 +752,10 @@ var SortableItem = ({ id, children }) => {
|
|
|
730
752
|
triggerProps,
|
|
731
753
|
itemStyle,
|
|
732
754
|
triggerStyle,
|
|
733
|
-
isDragOverlay,
|
|
734
755
|
showDropIndication,
|
|
735
756
|
dropIndicationStyle
|
|
736
757
|
}) => {
|
|
737
|
-
return /* @__PURE__ */
|
|
738
|
-
StyledListItem,
|
|
739
|
-
{
|
|
740
|
-
...itemProps,
|
|
741
|
-
style: itemStyle,
|
|
742
|
-
sx: { backgroundColor: isDragOverlay ? "background.paper" : void 0 }
|
|
743
|
-
},
|
|
744
|
-
/* @__PURE__ */ React20.createElement(SortableTrigger, { ...triggerProps, style: triggerStyle }),
|
|
745
|
-
children,
|
|
746
|
-
showDropIndication && /* @__PURE__ */ React20.createElement(StyledDivider, { style: dropIndicationStyle })
|
|
747
|
-
);
|
|
758
|
+
return /* @__PURE__ */ React22.createElement(StyledListItem, { ...itemProps, style: itemStyle }, /* @__PURE__ */ React22.createElement(SortableTrigger, { ...triggerProps, style: triggerStyle }), children, showDropIndication && /* @__PURE__ */ React22.createElement(StyledDivider, { style: dropIndicationStyle }));
|
|
748
759
|
}
|
|
749
760
|
}
|
|
750
761
|
);
|
|
@@ -767,13 +778,18 @@ var StyledListItem = (0, import_ui16.styled)(import_ui16.ListItem)`
|
|
|
767
778
|
transform: translate( -75%, -50% );
|
|
768
779
|
}
|
|
769
780
|
|
|
781
|
+
&[aria-describedby=''] > .MuiTag-root {
|
|
782
|
+
background-color: ${({ theme }) => theme.palette.background.paper};
|
|
783
|
+
box-shadow: ${({ theme }) => theme.shadows[3]};
|
|
784
|
+
}
|
|
785
|
+
|
|
770
786
|
&:hover {
|
|
771
787
|
& .class-item-sortable-trigger {
|
|
772
788
|
visibility: visible;
|
|
773
789
|
}
|
|
774
790
|
}
|
|
775
791
|
`;
|
|
776
|
-
var SortableTrigger = (props) => /* @__PURE__ */
|
|
792
|
+
var SortableTrigger = (props) => /* @__PURE__ */ React22.createElement("div", { ...props, role: "button", className: "class-item-sortable-trigger" }, /* @__PURE__ */ React22.createElement(import_icons2.GripVerticalIcon, { fontSize: "tiny" }));
|
|
777
793
|
var StyledDivider = (0, import_ui16.styled)(import_ui16.Divider)`
|
|
778
794
|
height: 0px;
|
|
779
795
|
border: none;
|
|
@@ -793,6 +809,7 @@ var StyledDivider = (0, import_ui16.styled)(import_ui16.Divider)`
|
|
|
793
809
|
|
|
794
810
|
// src/components/repeater.tsx
|
|
795
811
|
var SIZE = "tiny";
|
|
812
|
+
var EMPTY_OPEN_ITEM = -1;
|
|
796
813
|
var Repeater = ({
|
|
797
814
|
label,
|
|
798
815
|
itemSettings,
|
|
@@ -801,14 +818,14 @@ var Repeater = ({
|
|
|
801
818
|
values: repeaterValues = [],
|
|
802
819
|
setValues: setRepeaterValues
|
|
803
820
|
}) => {
|
|
804
|
-
const [openItem, setOpenItem] = (0,
|
|
821
|
+
const [openItem, setOpenItem] = (0, import_react8.useState)(EMPTY_OPEN_ITEM);
|
|
805
822
|
const [items, setItems] = useSyncExternalState({
|
|
806
823
|
external: repeaterValues,
|
|
807
824
|
// @ts-expect-error - as long as persistWhen => true, value will never be null
|
|
808
825
|
setExternal: setRepeaterValues,
|
|
809
826
|
persistWhen: () => true
|
|
810
827
|
});
|
|
811
|
-
const [uniqueKeys, setUniqueKeys] = (0,
|
|
828
|
+
const [uniqueKeys, setUniqueKeys] = (0, import_react8.useState)(items.map((_, index) => index));
|
|
812
829
|
const generateNextKey = (source) => {
|
|
813
830
|
return 1 + Math.max(0, ...source);
|
|
814
831
|
};
|
|
@@ -865,24 +882,33 @@ var Repeater = ({
|
|
|
865
882
|
});
|
|
866
883
|
});
|
|
867
884
|
};
|
|
868
|
-
return /* @__PURE__ */
|
|
885
|
+
return /* @__PURE__ */ React23.createElement(SectionContent, null, /* @__PURE__ */ React23.createElement(import_ui17.Stack, { direction: "row", justifyContent: "start", alignItems: "center", gap: 1 }, /* @__PURE__ */ React23.createElement(import_ui17.Typography, { component: "label", variant: "caption", color: "text.secondary" }, label), /* @__PURE__ */ React23.createElement(ControlAdornments, null), /* @__PURE__ */ React23.createElement(
|
|
886
|
+
import_ui17.IconButton,
|
|
887
|
+
{
|
|
888
|
+
sx: { ml: "auto" },
|
|
889
|
+
size: SIZE,
|
|
890
|
+
onClick: addRepeaterItem,
|
|
891
|
+
"aria-label": (0, import_i18n4.__)("Add item", "elementor")
|
|
892
|
+
},
|
|
893
|
+
/* @__PURE__ */ React23.createElement(import_icons3.PlusIcon, { fontSize: SIZE })
|
|
894
|
+
)), 0 < uniqueKeys.length && /* @__PURE__ */ React23.createElement(SortableProvider, { value: uniqueKeys, onChange: onChangeOrder }, uniqueKeys.map((key, index) => {
|
|
869
895
|
const value = items[index];
|
|
870
896
|
if (!value) {
|
|
871
897
|
return null;
|
|
872
898
|
}
|
|
873
|
-
return /* @__PURE__ */
|
|
899
|
+
return /* @__PURE__ */ React23.createElement(SortableItem, { id: key, key: `sortable-${key}` }, /* @__PURE__ */ React23.createElement(
|
|
874
900
|
RepeaterItem,
|
|
875
901
|
{
|
|
876
|
-
bind: String(index),
|
|
877
902
|
disabled: value?.disabled,
|
|
878
|
-
label: /* @__PURE__ */
|
|
879
|
-
startIcon: /* @__PURE__ */
|
|
903
|
+
label: /* @__PURE__ */ React23.createElement(itemSettings.Label, { value }),
|
|
904
|
+
startIcon: /* @__PURE__ */ React23.createElement(itemSettings.Icon, { value }),
|
|
880
905
|
removeItem: () => removeRepeaterItem(index),
|
|
881
906
|
duplicateItem: () => duplicateRepeaterItem(index),
|
|
882
907
|
toggleDisableItem: () => toggleDisableRepeaterItem(index),
|
|
883
|
-
openOnMount: openOnAdd && openItem === key
|
|
908
|
+
openOnMount: openOnAdd && openItem === key,
|
|
909
|
+
onOpen: () => setOpenItem(EMPTY_OPEN_ITEM)
|
|
884
910
|
},
|
|
885
|
-
(props) => /* @__PURE__ */
|
|
911
|
+
(props) => /* @__PURE__ */ React23.createElement(itemSettings.Content, { ...props, value, bind: String(index) })
|
|
886
912
|
));
|
|
887
913
|
})));
|
|
888
914
|
};
|
|
@@ -894,14 +920,15 @@ var RepeaterItem = ({
|
|
|
894
920
|
removeItem,
|
|
895
921
|
duplicateItem,
|
|
896
922
|
toggleDisableItem,
|
|
897
|
-
openOnMount
|
|
923
|
+
openOnMount,
|
|
924
|
+
onOpen
|
|
898
925
|
}) => {
|
|
899
|
-
const [anchorEl, setAnchorEl] = (0,
|
|
900
|
-
const { popoverState, popoverProps, ref, setRef } = usePopover(openOnMount);
|
|
926
|
+
const [anchorEl, setAnchorEl] = (0, import_react8.useState)(null);
|
|
927
|
+
const { popoverState, popoverProps, ref, setRef } = usePopover(openOnMount, onOpen);
|
|
901
928
|
const duplicateLabel = (0, import_i18n4.__)("Duplicate", "elementor");
|
|
902
929
|
const toggleLabel = disabled ? (0, import_i18n4.__)("Show", "elementor") : (0, import_i18n4.__)("Hide", "elementor");
|
|
903
930
|
const removeLabel = (0, import_i18n4.__)("Remove", "elementor");
|
|
904
|
-
return /* @__PURE__ */
|
|
931
|
+
return /* @__PURE__ */ React23.createElement(React23.Fragment, null, /* @__PURE__ */ React23.createElement(
|
|
905
932
|
import_ui17.UnstableTag,
|
|
906
933
|
{
|
|
907
934
|
label,
|
|
@@ -912,10 +939,9 @@ var RepeaterItem = ({
|
|
|
912
939
|
"aria-label": (0, import_i18n4.__)("Open item", "elementor"),
|
|
913
940
|
...(0, import_ui17.bindTrigger)(popoverState),
|
|
914
941
|
startIcon,
|
|
915
|
-
actions: /* @__PURE__ */
|
|
916
|
-
sx: { backgroundColor: "background.paper" }
|
|
942
|
+
actions: /* @__PURE__ */ React23.createElement(React23.Fragment, null, /* @__PURE__ */ React23.createElement(import_ui17.Tooltip, { title: duplicateLabel, placement: "top" }, /* @__PURE__ */ React23.createElement(import_ui17.IconButton, { size: SIZE, onClick: duplicateItem, "aria-label": duplicateLabel }, /* @__PURE__ */ React23.createElement(import_icons3.CopyIcon, { fontSize: SIZE }))), /* @__PURE__ */ React23.createElement(import_ui17.Tooltip, { title: toggleLabel, placement: "top" }, /* @__PURE__ */ React23.createElement(import_ui17.IconButton, { size: SIZE, onClick: toggleDisableItem, "aria-label": toggleLabel }, disabled ? /* @__PURE__ */ React23.createElement(import_icons3.EyeOffIcon, { fontSize: SIZE }) : /* @__PURE__ */ React23.createElement(import_icons3.EyeIcon, { fontSize: SIZE }))), /* @__PURE__ */ React23.createElement(import_ui17.Tooltip, { title: removeLabel, placement: "top" }, /* @__PURE__ */ React23.createElement(import_ui17.IconButton, { size: SIZE, onClick: removeItem, "aria-label": removeLabel }, /* @__PURE__ */ React23.createElement(import_icons3.XIcon, { fontSize: SIZE }))))
|
|
917
943
|
}
|
|
918
|
-
), /* @__PURE__ */
|
|
944
|
+
), /* @__PURE__ */ React23.createElement(
|
|
919
945
|
import_ui17.Popover,
|
|
920
946
|
{
|
|
921
947
|
disablePortal: true,
|
|
@@ -929,16 +955,17 @@ var RepeaterItem = ({
|
|
|
929
955
|
...popoverProps,
|
|
930
956
|
anchorEl: ref
|
|
931
957
|
},
|
|
932
|
-
/* @__PURE__ */
|
|
958
|
+
/* @__PURE__ */ React23.createElement(import_ui17.Box, null, children({ anchorEl }))
|
|
933
959
|
));
|
|
934
960
|
};
|
|
935
|
-
var usePopover = (openOnMount) => {
|
|
936
|
-
const [ref, setRef] = (0,
|
|
961
|
+
var usePopover = (openOnMount, onOpen) => {
|
|
962
|
+
const [ref, setRef] = (0, import_react8.useState)(null);
|
|
937
963
|
const popoverState = (0, import_ui17.usePopupState)({ variant: "popover" });
|
|
938
964
|
const popoverProps = (0, import_ui17.bindPopover)(popoverState);
|
|
939
|
-
(0,
|
|
965
|
+
(0, import_react8.useEffect)(() => {
|
|
940
966
|
if (openOnMount && ref) {
|
|
941
967
|
popoverState.open(ref);
|
|
968
|
+
onOpen?.();
|
|
942
969
|
}
|
|
943
970
|
}, [ref]);
|
|
944
971
|
return {
|
|
@@ -952,7 +979,7 @@ var usePopover = (openOnMount) => {
|
|
|
952
979
|
// src/controls/box-shadow-repeater-control.tsx
|
|
953
980
|
var BoxShadowRepeaterControl = createControl(() => {
|
|
954
981
|
const { propType, value, setValue } = useBoundProp(import_editor_props9.boxShadowPropTypeUtil);
|
|
955
|
-
return /* @__PURE__ */
|
|
982
|
+
return /* @__PURE__ */ React24.createElement(PropProvider, { propType, value, setValue }, /* @__PURE__ */ React24.createElement(
|
|
956
983
|
Repeater,
|
|
957
984
|
{
|
|
958
985
|
openOnAdd: true,
|
|
@@ -968,13 +995,13 @@ var BoxShadowRepeaterControl = createControl(() => {
|
|
|
968
995
|
}
|
|
969
996
|
));
|
|
970
997
|
});
|
|
971
|
-
var ItemIcon = ({ value }) => /* @__PURE__ */
|
|
998
|
+
var ItemIcon = ({ value }) => /* @__PURE__ */ React24.createElement(import_ui18.UnstableColorIndicator, { size: "inherit", component: "span", value: value.value.color.value });
|
|
972
999
|
var ItemContent = ({ anchorEl, bind }) => {
|
|
973
|
-
return /* @__PURE__ */
|
|
1000
|
+
return /* @__PURE__ */ React24.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React24.createElement(Content, { anchorEl }));
|
|
974
1001
|
};
|
|
975
1002
|
var Content = ({ anchorEl }) => {
|
|
976
1003
|
const { propType, value, setValue } = useBoundProp(import_editor_props9.shadowPropTypeUtil);
|
|
977
|
-
return /* @__PURE__ */
|
|
1004
|
+
return /* @__PURE__ */ React24.createElement(PropProvider, { propType, value, setValue }, /* @__PURE__ */ React24.createElement(PopoverContent, { p: 1.5 }, /* @__PURE__ */ React24.createElement(PopoverGridContainer, null, /* @__PURE__ */ React24.createElement(Control2, { bind: "color", label: (0, import_i18n5.__)("Color", "elementor") }, /* @__PURE__ */ React24.createElement(
|
|
978
1005
|
ColorControl,
|
|
979
1006
|
{
|
|
980
1007
|
slotProps: {
|
|
@@ -991,7 +1018,7 @@ var Content = ({ anchorEl }) => {
|
|
|
991
1018
|
}
|
|
992
1019
|
}
|
|
993
1020
|
}
|
|
994
|
-
)), /* @__PURE__ */
|
|
1021
|
+
)), /* @__PURE__ */ React24.createElement(Control2, { bind: "position", label: (0, import_i18n5.__)("Position", "elementor"), sx: { overflow: "hidden" } }, /* @__PURE__ */ React24.createElement(
|
|
995
1022
|
SelectControl,
|
|
996
1023
|
{
|
|
997
1024
|
options: [
|
|
@@ -999,14 +1026,14 @@ var Content = ({ anchorEl }) => {
|
|
|
999
1026
|
{ label: (0, import_i18n5.__)("Outset", "elementor"), value: null }
|
|
1000
1027
|
]
|
|
1001
1028
|
}
|
|
1002
|
-
))), /* @__PURE__ */
|
|
1029
|
+
))), /* @__PURE__ */ React24.createElement(PopoverGridContainer, null, /* @__PURE__ */ React24.createElement(Control2, { bind: "hOffset", label: (0, import_i18n5.__)("Horizontal", "elementor") }, /* @__PURE__ */ React24.createElement(SizeControl, null)), /* @__PURE__ */ React24.createElement(Control2, { bind: "vOffset", label: (0, import_i18n5.__)("Vertical", "elementor") }, /* @__PURE__ */ React24.createElement(SizeControl, null))), /* @__PURE__ */ React24.createElement(PopoverGridContainer, null, /* @__PURE__ */ React24.createElement(Control2, { bind: "blur", label: (0, import_i18n5.__)("Blur", "elementor") }, /* @__PURE__ */ React24.createElement(SizeControl, null)), /* @__PURE__ */ React24.createElement(Control2, { bind: "spread", label: (0, import_i18n5.__)("Spread", "elementor") }, /* @__PURE__ */ React24.createElement(SizeControl, null)))));
|
|
1003
1030
|
};
|
|
1004
1031
|
var Control2 = ({
|
|
1005
1032
|
label,
|
|
1006
1033
|
bind,
|
|
1007
1034
|
children,
|
|
1008
1035
|
sx
|
|
1009
|
-
}) => /* @__PURE__ */
|
|
1036
|
+
}) => /* @__PURE__ */ React24.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React24.createElement(import_ui18.Grid, { item: true, xs: 6, sx }, /* @__PURE__ */ React24.createElement(import_ui18.Grid, { container: true, gap: 0.75, alignItems: "center" }, /* @__PURE__ */ React24.createElement(import_ui18.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React24.createElement(import_ui18.FormLabel, { size: "tiny" }, label)), /* @__PURE__ */ React24.createElement(import_ui18.Grid, { item: true, xs: 12 }, children))));
|
|
1010
1037
|
var ItemLabel = ({ value }) => {
|
|
1011
1038
|
const { position, hOffset, vOffset, blur, spread } = value.value;
|
|
1012
1039
|
const { size: blurSize = "", unit: blurUnit = "" } = blur?.value || {};
|
|
@@ -1020,7 +1047,7 @@ var ItemLabel = ({ value }) => {
|
|
|
1020
1047
|
blurSize + blurUnit,
|
|
1021
1048
|
spreadSize + spreadUnit
|
|
1022
1049
|
].join(" ");
|
|
1023
|
-
return /* @__PURE__ */
|
|
1050
|
+
return /* @__PURE__ */ React24.createElement("span", { style: { textTransform: "capitalize" } }, positionLabel, ": ", sizes);
|
|
1024
1051
|
};
|
|
1025
1052
|
var initialShadow = {
|
|
1026
1053
|
$$type: "shadow",
|
|
@@ -1050,11 +1077,11 @@ var initialShadow = {
|
|
|
1050
1077
|
};
|
|
1051
1078
|
|
|
1052
1079
|
// src/controls/toggle-control.tsx
|
|
1053
|
-
var
|
|
1080
|
+
var React26 = __toESM(require("react"));
|
|
1054
1081
|
var import_editor_props10 = require("@elementor/editor-props");
|
|
1055
1082
|
|
|
1056
1083
|
// src/components/control-toggle-button-group.tsx
|
|
1057
|
-
var
|
|
1084
|
+
var React25 = __toESM(require("react"));
|
|
1058
1085
|
var import_ui19 = require("@elementor/ui");
|
|
1059
1086
|
var StyledToggleButtonGroup = (0, import_ui19.styled)(import_ui19.ToggleButtonGroup)`
|
|
1060
1087
|
${({ justify }) => `justify-content: ${justify};`}
|
|
@@ -1072,7 +1099,7 @@ var ControlToggleButtonGroup = ({
|
|
|
1072
1099
|
const handleChange = (_, newValue) => {
|
|
1073
1100
|
onChange(newValue);
|
|
1074
1101
|
};
|
|
1075
|
-
return /* @__PURE__ */
|
|
1102
|
+
return /* @__PURE__ */ React25.createElement(
|
|
1076
1103
|
StyledToggleButtonGroup,
|
|
1077
1104
|
{
|
|
1078
1105
|
justify,
|
|
@@ -1087,7 +1114,7 @@ var ControlToggleButtonGroup = ({
|
|
|
1087
1114
|
}
|
|
1088
1115
|
},
|
|
1089
1116
|
items.map(
|
|
1090
|
-
({ label, value: buttonValue, renderContent: Content3, showTooltip }) => showTooltip ? /* @__PURE__ */
|
|
1117
|
+
({ label, value: buttonValue, renderContent: Content3, showTooltip }) => showTooltip ? /* @__PURE__ */ React25.createElement(import_ui19.Tooltip, { key: buttonValue, title: label, disableFocusListener: true, placement: "top" }, /* @__PURE__ */ React25.createElement(import_ui19.ToggleButton, { value: buttonValue, "aria-label": label, size, fullWidth }, /* @__PURE__ */ React25.createElement(Content3, { size }))) : /* @__PURE__ */ React25.createElement(
|
|
1091
1118
|
import_ui19.ToggleButton,
|
|
1092
1119
|
{
|
|
1093
1120
|
key: buttonValue,
|
|
@@ -1096,7 +1123,7 @@ var ControlToggleButtonGroup = ({
|
|
|
1096
1123
|
size,
|
|
1097
1124
|
fullWidth
|
|
1098
1125
|
},
|
|
1099
|
-
/* @__PURE__ */
|
|
1126
|
+
/* @__PURE__ */ React25.createElement(Content3, { size })
|
|
1100
1127
|
)
|
|
1101
1128
|
)
|
|
1102
1129
|
);
|
|
@@ -1123,7 +1150,7 @@ var ToggleControl = createControl(
|
|
|
1123
1150
|
fullWidth,
|
|
1124
1151
|
size
|
|
1125
1152
|
};
|
|
1126
|
-
return exclusive ? /* @__PURE__ */
|
|
1153
|
+
return exclusive ? /* @__PURE__ */ React26.createElement(
|
|
1127
1154
|
ControlToggleButtonGroup,
|
|
1128
1155
|
{
|
|
1129
1156
|
...toggleButtonGroupProps,
|
|
@@ -1131,7 +1158,7 @@ var ToggleControl = createControl(
|
|
|
1131
1158
|
onChange: setValue,
|
|
1132
1159
|
exclusive: true
|
|
1133
1160
|
}
|
|
1134
|
-
) : /* @__PURE__ */
|
|
1161
|
+
) : /* @__PURE__ */ React26.createElement(
|
|
1135
1162
|
ControlToggleButtonGroup,
|
|
1136
1163
|
{
|
|
1137
1164
|
...toggleButtonGroupProps,
|
|
@@ -1144,7 +1171,7 @@ var ToggleControl = createControl(
|
|
|
1144
1171
|
);
|
|
1145
1172
|
|
|
1146
1173
|
// src/controls/number-control.tsx
|
|
1147
|
-
var
|
|
1174
|
+
var React27 = __toESM(require("react"));
|
|
1148
1175
|
var import_editor_props11 = require("@elementor/editor-props");
|
|
1149
1176
|
var import_ui20 = require("@elementor/ui");
|
|
1150
1177
|
var isEmptyOrNaN = (value) => value === null || value === void 0 || value === "" || Number.isNaN(Number(value));
|
|
@@ -1166,7 +1193,7 @@ var NumberControl = createControl(
|
|
|
1166
1193
|
const formattedValue = shouldForceInt ? +parseInt(eventValue) : Number(eventValue);
|
|
1167
1194
|
setValue(Math.min(Math.max(formattedValue, min), max));
|
|
1168
1195
|
};
|
|
1169
|
-
return /* @__PURE__ */
|
|
1196
|
+
return /* @__PURE__ */ React27.createElement(ControlActions, null, /* @__PURE__ */ React27.createElement(
|
|
1170
1197
|
import_ui20.TextField,
|
|
1171
1198
|
{
|
|
1172
1199
|
size: "tiny",
|
|
@@ -1182,11 +1209,20 @@ var NumberControl = createControl(
|
|
|
1182
1209
|
);
|
|
1183
1210
|
|
|
1184
1211
|
// src/controls/equal-unequal-sizes-control.tsx
|
|
1185
|
-
var
|
|
1186
|
-
var
|
|
1212
|
+
var React29 = __toESM(require("react"));
|
|
1213
|
+
var import_react9 = require("react");
|
|
1187
1214
|
var import_editor_props12 = require("@elementor/editor-props");
|
|
1188
|
-
var
|
|
1215
|
+
var import_ui22 = require("@elementor/ui");
|
|
1189
1216
|
var import_i18n6 = require("@wordpress/i18n");
|
|
1217
|
+
|
|
1218
|
+
// src/components/control-label.tsx
|
|
1219
|
+
var React28 = __toESM(require("react"));
|
|
1220
|
+
var import_ui21 = require("@elementor/ui");
|
|
1221
|
+
var ControlLabel = ({ children }) => {
|
|
1222
|
+
return /* @__PURE__ */ React28.createElement(import_ui21.Stack, { direction: "row", alignItems: "center", justifyItems: "start", gap: 1 }, /* @__PURE__ */ React28.createElement(ControlFormLabel, null, children), /* @__PURE__ */ React28.createElement(ControlAdornments, null));
|
|
1223
|
+
};
|
|
1224
|
+
|
|
1225
|
+
// src/controls/equal-unequal-sizes-control.tsx
|
|
1190
1226
|
var isEqualSizes = (propValue, items) => {
|
|
1191
1227
|
const values = Object.values(propValue);
|
|
1192
1228
|
if (values.length !== items.length) {
|
|
@@ -1204,9 +1240,9 @@ function EqualUnequalSizesControl({
|
|
|
1204
1240
|
items,
|
|
1205
1241
|
multiSizePropTypeUtil
|
|
1206
1242
|
}) {
|
|
1207
|
-
const popupId = (0,
|
|
1208
|
-
const controlRef = (0,
|
|
1209
|
-
const popupState = (0,
|
|
1243
|
+
const popupId = (0, import_react9.useId)();
|
|
1244
|
+
const controlRef = (0, import_react9.useRef)(null);
|
|
1245
|
+
const popupState = (0, import_ui22.usePopupState)({ variant: "popover", popupId });
|
|
1210
1246
|
const {
|
|
1211
1247
|
propType: multiSizePropType,
|
|
1212
1248
|
value: multiSizeValue,
|
|
@@ -1240,19 +1276,19 @@ function EqualUnequalSizesControl({
|
|
|
1240
1276
|
return splitEqualValue() ?? null;
|
|
1241
1277
|
};
|
|
1242
1278
|
const isMixed = !!multiSizeValue;
|
|
1243
|
-
return /* @__PURE__ */
|
|
1244
|
-
|
|
1279
|
+
return /* @__PURE__ */ React29.createElement(React29.Fragment, null, /* @__PURE__ */ React29.createElement(import_ui22.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap", ref: controlRef }, /* @__PURE__ */ React29.createElement(import_ui22.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React29.createElement(ControlLabel, null, label)), /* @__PURE__ */ React29.createElement(import_ui22.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React29.createElement(import_ui22.Stack, { direction: "row", alignItems: "center", gap: 1 }, /* @__PURE__ */ React29.createElement(SizeControl, { placeholder: isMixed ? (0, import_i18n6.__)("Mixed", "elementor") : void 0 }), /* @__PURE__ */ React29.createElement(import_ui22.Tooltip, { title: tooltipLabel, placement: "top" }, /* @__PURE__ */ React29.createElement(
|
|
1280
|
+
import_ui22.ToggleButton,
|
|
1245
1281
|
{
|
|
1246
1282
|
size: "tiny",
|
|
1247
1283
|
value: "check",
|
|
1248
1284
|
sx: { marginLeft: "auto" },
|
|
1249
|
-
...(0,
|
|
1285
|
+
...(0, import_ui22.bindToggle)(popupState),
|
|
1250
1286
|
selected: popupState.isOpen,
|
|
1251
1287
|
"aria-label": tooltipLabel
|
|
1252
1288
|
},
|
|
1253
1289
|
icon
|
|
1254
|
-
))))), /* @__PURE__ */
|
|
1255
|
-
|
|
1290
|
+
))))), /* @__PURE__ */ React29.createElement(
|
|
1291
|
+
import_ui22.Popover,
|
|
1256
1292
|
{
|
|
1257
1293
|
disablePortal: true,
|
|
1258
1294
|
disableScrollLock: true,
|
|
@@ -1264,22 +1300,22 @@ function EqualUnequalSizesControl({
|
|
|
1264
1300
|
vertical: "top",
|
|
1265
1301
|
horizontal: "right"
|
|
1266
1302
|
},
|
|
1267
|
-
...(0,
|
|
1303
|
+
...(0, import_ui22.bindPopover)(popupState),
|
|
1268
1304
|
slotProps: {
|
|
1269
1305
|
// eslint-disable-next-line react-compiler/react-compiler
|
|
1270
1306
|
paper: { sx: { mt: 0.5, width: controlRef.current?.getBoundingClientRect().width } }
|
|
1271
1307
|
}
|
|
1272
1308
|
},
|
|
1273
|
-
/* @__PURE__ */
|
|
1309
|
+
/* @__PURE__ */ React29.createElement(PropProvider, { propType: multiSizePropType, value: getMultiSizeValues(), setValue: setNestedProp }, /* @__PURE__ */ React29.createElement(PopoverContent, { p: 1.5 }, /* @__PURE__ */ React29.createElement(PopoverGridContainer, null, /* @__PURE__ */ React29.createElement(MultiSizeValueControl, { item: items[0] }), /* @__PURE__ */ React29.createElement(MultiSizeValueControl, { item: items[1] })), /* @__PURE__ */ React29.createElement(PopoverGridContainer, null, /* @__PURE__ */ React29.createElement(MultiSizeValueControl, { item: items[2] }), /* @__PURE__ */ React29.createElement(MultiSizeValueControl, { item: items[3] }))))
|
|
1274
1310
|
));
|
|
1275
1311
|
}
|
|
1276
|
-
var MultiSizeValueControl = ({ item }) => /* @__PURE__ */
|
|
1312
|
+
var MultiSizeValueControl = ({ item }) => /* @__PURE__ */ React29.createElement(PropKeyProvider, { bind: item.bind }, /* @__PURE__ */ React29.createElement(import_ui22.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React29.createElement(import_ui22.Grid, { container: true, gap: 0.75, alignItems: "center" }, /* @__PURE__ */ React29.createElement(import_ui22.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React29.createElement(ControlFormLabel, null, item.label)), /* @__PURE__ */ React29.createElement(import_ui22.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React29.createElement(SizeControl, { startIcon: item.icon })))));
|
|
1277
1313
|
|
|
1278
1314
|
// src/controls/linked-dimensions-control.tsx
|
|
1279
|
-
var
|
|
1315
|
+
var React30 = __toESM(require("react"));
|
|
1280
1316
|
var import_editor_props13 = require("@elementor/editor-props");
|
|
1281
1317
|
var import_icons4 = require("@elementor/icons");
|
|
1282
|
-
var
|
|
1318
|
+
var import_ui23 = require("@elementor/ui");
|
|
1283
1319
|
var import_i18n7 = require("@wordpress/i18n");
|
|
1284
1320
|
var LinkedDimensionsControl = createControl(
|
|
1285
1321
|
({
|
|
@@ -1311,8 +1347,8 @@ var LinkedDimensionsControl = createControl(
|
|
|
1311
1347
|
const LinkedIcon = isLinked ? import_icons4.LinkIcon : import_icons4.DetachIcon;
|
|
1312
1348
|
const linkedLabel = (0, import_i18n7.__)("Link %s", "elementor").replace("%s", tooltipLabel);
|
|
1313
1349
|
const unlinkedLabel = (0, import_i18n7.__)("Unlink %s", "elementor").replace("%s", tooltipLabel);
|
|
1314
|
-
return /* @__PURE__ */
|
|
1315
|
-
|
|
1350
|
+
return /* @__PURE__ */ React30.createElement(PropProvider, { propType, value: dimensionsValue, setValue: setDimensionsValue }, /* @__PURE__ */ React30.createElement(import_ui23.Stack, { direction: "row", gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React30.createElement(ControlLabel, null, label), /* @__PURE__ */ React30.createElement(import_ui23.Tooltip, { title: isLinked ? unlinkedLabel : linkedLabel, placement: "top" }, /* @__PURE__ */ React30.createElement(
|
|
1351
|
+
import_ui23.ToggleButton,
|
|
1316
1352
|
{
|
|
1317
1353
|
"aria-label": isLinked ? unlinkedLabel : linkedLabel,
|
|
1318
1354
|
size: "tiny",
|
|
@@ -1321,36 +1357,36 @@ var LinkedDimensionsControl = createControl(
|
|
|
1321
1357
|
sx: { marginLeft: "auto" },
|
|
1322
1358
|
onChange: onLinkToggle
|
|
1323
1359
|
},
|
|
1324
|
-
/* @__PURE__ */
|
|
1325
|
-
))), /* @__PURE__ */
|
|
1360
|
+
/* @__PURE__ */ React30.createElement(LinkedIcon, { fontSize: "tiny" })
|
|
1361
|
+
))), /* @__PURE__ */ React30.createElement(import_ui23.Stack, { direction: "row", gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React30.createElement(import_ui23.Grid, { container: true, gap: 0.75, alignItems: "center" }, /* @__PURE__ */ React30.createElement(import_ui23.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React30.createElement(ControlFormLabel, null, (0, import_i18n7.__)("Top", "elementor"))), /* @__PURE__ */ React30.createElement(import_ui23.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React30.createElement(
|
|
1326
1362
|
Control3,
|
|
1327
1363
|
{
|
|
1328
1364
|
bind: "block-start",
|
|
1329
|
-
startIcon: /* @__PURE__ */
|
|
1365
|
+
startIcon: /* @__PURE__ */ React30.createElement(import_icons4.SideTopIcon, { fontSize: "tiny" }),
|
|
1330
1366
|
isLinked,
|
|
1331
1367
|
extendedValues
|
|
1332
1368
|
}
|
|
1333
|
-
))), /* @__PURE__ */
|
|
1369
|
+
))), /* @__PURE__ */ React30.createElement(import_ui23.Grid, { container: true, gap: 0.75, alignItems: "center" }, /* @__PURE__ */ React30.createElement(import_ui23.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React30.createElement(ControlFormLabel, null, isSiteRtl ? (0, import_i18n7.__)("Left", "elementor") : (0, import_i18n7.__)("Right", "elementor"))), /* @__PURE__ */ React30.createElement(import_ui23.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React30.createElement(
|
|
1334
1370
|
Control3,
|
|
1335
1371
|
{
|
|
1336
1372
|
bind: "inline-end",
|
|
1337
|
-
startIcon: isSiteRtl ? /* @__PURE__ */
|
|
1373
|
+
startIcon: isSiteRtl ? /* @__PURE__ */ React30.createElement(import_icons4.SideLeftIcon, { fontSize: "tiny" }) : /* @__PURE__ */ React30.createElement(import_icons4.SideRightIcon, { fontSize: "tiny" }),
|
|
1338
1374
|
isLinked,
|
|
1339
1375
|
extendedValues
|
|
1340
1376
|
}
|
|
1341
|
-
)))), /* @__PURE__ */
|
|
1377
|
+
)))), /* @__PURE__ */ React30.createElement(import_ui23.Stack, { direction: "row", gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React30.createElement(import_ui23.Grid, { container: true, gap: 0.75, alignItems: "center" }, /* @__PURE__ */ React30.createElement(import_ui23.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React30.createElement(ControlFormLabel, null, (0, import_i18n7.__)("Bottom", "elementor"))), /* @__PURE__ */ React30.createElement(import_ui23.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React30.createElement(
|
|
1342
1378
|
Control3,
|
|
1343
1379
|
{
|
|
1344
1380
|
bind: "block-end",
|
|
1345
|
-
startIcon: /* @__PURE__ */
|
|
1381
|
+
startIcon: /* @__PURE__ */ React30.createElement(import_icons4.SideBottomIcon, { fontSize: "tiny" }),
|
|
1346
1382
|
isLinked,
|
|
1347
1383
|
extendedValues
|
|
1348
1384
|
}
|
|
1349
|
-
))), /* @__PURE__ */
|
|
1385
|
+
))), /* @__PURE__ */ React30.createElement(import_ui23.Grid, { container: true, gap: 0.75, alignItems: "center" }, /* @__PURE__ */ React30.createElement(import_ui23.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React30.createElement(ControlFormLabel, null, isSiteRtl ? (0, import_i18n7.__)("Right", "elementor") : (0, import_i18n7.__)("Left", "elementor"))), /* @__PURE__ */ React30.createElement(import_ui23.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React30.createElement(
|
|
1350
1386
|
Control3,
|
|
1351
1387
|
{
|
|
1352
1388
|
bind: "inline-start",
|
|
1353
|
-
startIcon: isSiteRtl ? /* @__PURE__ */
|
|
1389
|
+
startIcon: isSiteRtl ? /* @__PURE__ */ React30.createElement(import_icons4.SideRightIcon, { fontSize: "tiny" }) : /* @__PURE__ */ React30.createElement(import_icons4.SideLeftIcon, { fontSize: "tiny" }),
|
|
1354
1390
|
isLinked,
|
|
1355
1391
|
extendedValues
|
|
1356
1392
|
}
|
|
@@ -1364,17 +1400,17 @@ var Control3 = ({
|
|
|
1364
1400
|
extendedValues
|
|
1365
1401
|
}) => {
|
|
1366
1402
|
if (isLinked) {
|
|
1367
|
-
return /* @__PURE__ */
|
|
1403
|
+
return /* @__PURE__ */ React30.createElement(SizeControl, { startIcon, extendedValues });
|
|
1368
1404
|
}
|
|
1369
|
-
return /* @__PURE__ */
|
|
1405
|
+
return /* @__PURE__ */ React30.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React30.createElement(SizeControl, { startIcon, extendedValues }));
|
|
1370
1406
|
};
|
|
1371
1407
|
|
|
1372
1408
|
// src/controls/font-family-control/font-family-control.tsx
|
|
1373
|
-
var
|
|
1374
|
-
var
|
|
1409
|
+
var React31 = __toESM(require("react"));
|
|
1410
|
+
var import_react10 = require("react");
|
|
1375
1411
|
var import_editor_props14 = require("@elementor/editor-props");
|
|
1376
1412
|
var import_icons5 = require("@elementor/icons");
|
|
1377
|
-
var
|
|
1413
|
+
var import_ui24 = require("@elementor/ui");
|
|
1378
1414
|
var import_utils2 = require("@elementor/utils");
|
|
1379
1415
|
var import_react_virtual = require("@tanstack/react-virtual");
|
|
1380
1416
|
var import_i18n8 = require("@wordpress/i18n");
|
|
@@ -1404,9 +1440,9 @@ var enqueueFont = (fontFamily, context = "editor") => {
|
|
|
1404
1440
|
// src/controls/font-family-control/font-family-control.tsx
|
|
1405
1441
|
var SIZE2 = "tiny";
|
|
1406
1442
|
var FontFamilyControl = createControl(({ fontFamilies }) => {
|
|
1407
|
-
const [searchValue, setSearchValue] = (0,
|
|
1443
|
+
const [searchValue, setSearchValue] = (0, import_react10.useState)("");
|
|
1408
1444
|
const { value: fontFamily, setValue: setFontFamily } = useBoundProp(import_editor_props14.stringPropTypeUtil);
|
|
1409
|
-
const popoverState = (0,
|
|
1445
|
+
const popoverState = (0, import_ui24.usePopupState)({ variant: "popover" });
|
|
1410
1446
|
const filteredFontFamilies = useFilteredFontFamilies(fontFamilies, searchValue);
|
|
1411
1447
|
const handleSearch = (event) => {
|
|
1412
1448
|
setSearchValue(event.target.value);
|
|
@@ -1415,26 +1451,26 @@ var FontFamilyControl = createControl(({ fontFamilies }) => {
|
|
|
1415
1451
|
setSearchValue("");
|
|
1416
1452
|
popoverState.close();
|
|
1417
1453
|
};
|
|
1418
|
-
return /* @__PURE__ */
|
|
1419
|
-
|
|
1454
|
+
return /* @__PURE__ */ React31.createElement(React31.Fragment, null, /* @__PURE__ */ React31.createElement(
|
|
1455
|
+
import_ui24.UnstableTag,
|
|
1420
1456
|
{
|
|
1421
1457
|
variant: "outlined",
|
|
1422
1458
|
label: fontFamily,
|
|
1423
|
-
endIcon: /* @__PURE__ */
|
|
1424
|
-
...(0,
|
|
1459
|
+
endIcon: /* @__PURE__ */ React31.createElement(import_icons5.ChevronDownIcon, { fontSize: "tiny" }),
|
|
1460
|
+
...(0, import_ui24.bindTrigger)(popoverState),
|
|
1425
1461
|
fullWidth: true
|
|
1426
1462
|
}
|
|
1427
|
-
), /* @__PURE__ */
|
|
1428
|
-
|
|
1463
|
+
), /* @__PURE__ */ React31.createElement(
|
|
1464
|
+
import_ui24.Popover,
|
|
1429
1465
|
{
|
|
1430
1466
|
disablePortal: true,
|
|
1431
1467
|
disableScrollLock: true,
|
|
1432
1468
|
anchorOrigin: { vertical: "bottom", horizontal: "left" },
|
|
1433
|
-
...(0,
|
|
1469
|
+
...(0, import_ui24.bindPopover)(popoverState),
|
|
1434
1470
|
onClose: handleClose
|
|
1435
1471
|
},
|
|
1436
|
-
/* @__PURE__ */
|
|
1437
|
-
|
|
1472
|
+
/* @__PURE__ */ React31.createElement(import_ui24.Stack, null, /* @__PURE__ */ React31.createElement(import_ui24.Stack, { direction: "row", alignItems: "center", pl: 1.5, pr: 0.5, py: 1.5 }, /* @__PURE__ */ React31.createElement(import_icons5.TextIcon, { fontSize: SIZE2, sx: { mr: 0.5 } }), /* @__PURE__ */ React31.createElement(import_ui24.Typography, { variant: "subtitle2" }, (0, import_i18n8.__)("Font Family", "elementor")), /* @__PURE__ */ React31.createElement(import_ui24.IconButton, { size: SIZE2, sx: { ml: "auto" }, onClick: handleClose }, /* @__PURE__ */ React31.createElement(import_icons5.XIcon, { fontSize: SIZE2 }))), /* @__PURE__ */ React31.createElement(import_ui24.Box, { px: 1.5, pb: 1 }, /* @__PURE__ */ React31.createElement(
|
|
1473
|
+
import_ui24.TextField,
|
|
1438
1474
|
{
|
|
1439
1475
|
fullWidth: true,
|
|
1440
1476
|
size: SIZE2,
|
|
@@ -1442,10 +1478,10 @@ var FontFamilyControl = createControl(({ fontFamilies }) => {
|
|
|
1442
1478
|
placeholder: (0, import_i18n8.__)("Search", "elementor"),
|
|
1443
1479
|
onChange: handleSearch,
|
|
1444
1480
|
InputProps: {
|
|
1445
|
-
startAdornment: /* @__PURE__ */
|
|
1481
|
+
startAdornment: /* @__PURE__ */ React31.createElement(import_ui24.InputAdornment, { position: "start" }, /* @__PURE__ */ React31.createElement(import_icons5.SearchIcon, { fontSize: SIZE2 }))
|
|
1446
1482
|
}
|
|
1447
1483
|
}
|
|
1448
|
-
)), /* @__PURE__ */
|
|
1484
|
+
)), /* @__PURE__ */ React31.createElement(import_ui24.Divider, null), filteredFontFamilies.length > 0 ? /* @__PURE__ */ React31.createElement(
|
|
1449
1485
|
FontList,
|
|
1450
1486
|
{
|
|
1451
1487
|
fontListItems: filteredFontFamilies,
|
|
@@ -1453,8 +1489,8 @@ var FontFamilyControl = createControl(({ fontFamilies }) => {
|
|
|
1453
1489
|
handleClose,
|
|
1454
1490
|
fontFamily
|
|
1455
1491
|
}
|
|
1456
|
-
) : /* @__PURE__ */
|
|
1457
|
-
|
|
1492
|
+
) : /* @__PURE__ */ React31.createElement(import_ui24.Box, { sx: { overflowY: "auto", height: 260, width: 220 } }, /* @__PURE__ */ React31.createElement(import_ui24.Stack, { alignItems: "center", p: 2.5, gap: 1.5, overflow: "hidden" }, /* @__PURE__ */ React31.createElement(import_icons5.TextIcon, { fontSize: "large" }), /* @__PURE__ */ React31.createElement(import_ui24.Box, { sx: { maxWidth: 160, overflow: "hidden" } }, /* @__PURE__ */ React31.createElement(import_ui24.Typography, { align: "center", variant: "subtitle2", color: "text.secondary" }, (0, import_i18n8.__)("Sorry, nothing matched", "elementor")), /* @__PURE__ */ React31.createElement(
|
|
1493
|
+
import_ui24.Typography,
|
|
1458
1494
|
{
|
|
1459
1495
|
variant: "subtitle2",
|
|
1460
1496
|
color: "text.secondary",
|
|
@@ -1464,17 +1500,17 @@ var FontFamilyControl = createControl(({ fontFamilies }) => {
|
|
|
1464
1500
|
justifyContent: "center"
|
|
1465
1501
|
}
|
|
1466
1502
|
},
|
|
1467
|
-
/* @__PURE__ */
|
|
1468
|
-
/* @__PURE__ */
|
|
1503
|
+
/* @__PURE__ */ React31.createElement("span", null, "\u201C"),
|
|
1504
|
+
/* @__PURE__ */ React31.createElement(
|
|
1469
1505
|
"span",
|
|
1470
1506
|
{
|
|
1471
1507
|
style: { maxWidth: "80%", overflow: "hidden", textOverflow: "ellipsis" }
|
|
1472
1508
|
},
|
|
1473
1509
|
searchValue
|
|
1474
1510
|
),
|
|
1475
|
-
/* @__PURE__ */
|
|
1476
|
-
)), /* @__PURE__ */
|
|
1477
|
-
|
|
1511
|
+
/* @__PURE__ */ React31.createElement("span", null, "\u201D.")
|
|
1512
|
+
)), /* @__PURE__ */ React31.createElement(import_ui24.Typography, { align: "center", variant: "caption", color: "text.secondary" }, (0, import_i18n8.__)("Try something else.", "elementor"), /* @__PURE__ */ React31.createElement(
|
|
1513
|
+
import_ui24.Link,
|
|
1478
1514
|
{
|
|
1479
1515
|
color: "secondary",
|
|
1480
1516
|
variant: "caption",
|
|
@@ -1488,7 +1524,7 @@ var FontFamilyControl = createControl(({ fontFamilies }) => {
|
|
|
1488
1524
|
var LIST_ITEM_HEIGHT = 36;
|
|
1489
1525
|
var LIST_ITEMS_BUFFER = 6;
|
|
1490
1526
|
var FontList = ({ fontListItems, setFontFamily, handleClose, fontFamily }) => {
|
|
1491
|
-
const containerRef = (0,
|
|
1527
|
+
const containerRef = (0, import_react10.useRef)(null);
|
|
1492
1528
|
const selectedItem = fontListItems.find((item) => item.value === fontFamily);
|
|
1493
1529
|
const debouncedVirtualizeChange = useDebounce(({ getVirtualIndexes }) => {
|
|
1494
1530
|
getVirtualIndexes().forEach((index) => {
|
|
@@ -1505,7 +1541,7 @@ var FontList = ({ fontListItems, setFontFamily, handleClose, fontFamily }) => {
|
|
|
1505
1541
|
overscan: LIST_ITEMS_BUFFER,
|
|
1506
1542
|
onChange: debouncedVirtualizeChange
|
|
1507
1543
|
});
|
|
1508
|
-
(0,
|
|
1544
|
+
(0, import_react10.useEffect)(
|
|
1509
1545
|
() => {
|
|
1510
1546
|
virtualizer.scrollToIndex(fontListItems.findIndex((item) => item.value === fontFamily));
|
|
1511
1547
|
},
|
|
@@ -1513,8 +1549,8 @@ var FontList = ({ fontListItems, setFontFamily, handleClose, fontFamily }) => {
|
|
|
1513
1549
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1514
1550
|
[fontFamily]
|
|
1515
1551
|
);
|
|
1516
|
-
return /* @__PURE__ */
|
|
1517
|
-
|
|
1552
|
+
return /* @__PURE__ */ React31.createElement(
|
|
1553
|
+
import_ui24.Box,
|
|
1518
1554
|
{
|
|
1519
1555
|
ref: containerRef,
|
|
1520
1556
|
sx: {
|
|
@@ -1523,7 +1559,7 @@ var FontList = ({ fontListItems, setFontFamily, handleClose, fontFamily }) => {
|
|
|
1523
1559
|
width: 220
|
|
1524
1560
|
}
|
|
1525
1561
|
},
|
|
1526
|
-
/* @__PURE__ */
|
|
1562
|
+
/* @__PURE__ */ React31.createElement(
|
|
1527
1563
|
StyledMenuList,
|
|
1528
1564
|
{
|
|
1529
1565
|
role: "listbox",
|
|
@@ -1539,8 +1575,8 @@ var FontList = ({ fontListItems, setFontFamily, handleClose, fontFamily }) => {
|
|
|
1539
1575
|
const isSelected = selectedItem?.value === item.value;
|
|
1540
1576
|
const tabIndexFallback = !selectedItem ? 0 : -1;
|
|
1541
1577
|
if (item.type === "category") {
|
|
1542
|
-
return /* @__PURE__ */
|
|
1543
|
-
|
|
1578
|
+
return /* @__PURE__ */ React31.createElement(
|
|
1579
|
+
import_ui24.MenuSubheader,
|
|
1544
1580
|
{
|
|
1545
1581
|
key: virtualRow.key,
|
|
1546
1582
|
style: {
|
|
@@ -1550,7 +1586,7 @@ var FontList = ({ fontListItems, setFontFamily, handleClose, fontFamily }) => {
|
|
|
1550
1586
|
item.value
|
|
1551
1587
|
);
|
|
1552
1588
|
}
|
|
1553
|
-
return /* @__PURE__ */
|
|
1589
|
+
return /* @__PURE__ */ React31.createElement(
|
|
1554
1590
|
"li",
|
|
1555
1591
|
{
|
|
1556
1592
|
key: virtualRow.key,
|
|
@@ -1586,13 +1622,15 @@ var FontList = ({ fontListItems, setFontFamily, handleClose, fontFamily }) => {
|
|
|
1586
1622
|
)
|
|
1587
1623
|
);
|
|
1588
1624
|
};
|
|
1589
|
-
var StyledMenuList = (0,
|
|
1625
|
+
var StyledMenuList = (0, import_ui24.styled)(import_ui24.MenuList)(({ theme }) => ({
|
|
1590
1626
|
"& > li": {
|
|
1591
1627
|
height: LIST_ITEM_HEIGHT,
|
|
1592
1628
|
position: "absolute",
|
|
1593
1629
|
top: 0,
|
|
1594
1630
|
left: 0,
|
|
1595
|
-
width: "100%"
|
|
1631
|
+
width: "100%",
|
|
1632
|
+
display: "flex",
|
|
1633
|
+
alignItems: "center"
|
|
1596
1634
|
},
|
|
1597
1635
|
'& > [role="option"]': {
|
|
1598
1636
|
...theme.typography.caption,
|
|
@@ -1611,20 +1649,20 @@ var StyledMenuList = (0, import_ui23.styled)(import_ui23.MenuList)(({ theme }) =
|
|
|
1611
1649
|
position: "relative"
|
|
1612
1650
|
}));
|
|
1613
1651
|
var useDebounce = (fn, delay) => {
|
|
1614
|
-
const [debouncedFn] = (0,
|
|
1615
|
-
(0,
|
|
1652
|
+
const [debouncedFn] = (0, import_react10.useState)(() => (0, import_utils2.debounce)(fn, delay));
|
|
1653
|
+
(0, import_react10.useEffect)(() => () => debouncedFn.cancel(), [debouncedFn]);
|
|
1616
1654
|
return debouncedFn;
|
|
1617
1655
|
};
|
|
1618
1656
|
|
|
1619
1657
|
// src/controls/url-control.tsx
|
|
1620
|
-
var
|
|
1658
|
+
var React32 = __toESM(require("react"));
|
|
1621
1659
|
var import_editor_props15 = require("@elementor/editor-props");
|
|
1622
|
-
var
|
|
1660
|
+
var import_ui25 = require("@elementor/ui");
|
|
1623
1661
|
var UrlControl = createControl(({ placeholder }) => {
|
|
1624
1662
|
const { value, setValue } = useBoundProp(import_editor_props15.urlPropTypeUtil);
|
|
1625
1663
|
const handleChange = (event) => setValue(event.target.value);
|
|
1626
|
-
return /* @__PURE__ */
|
|
1627
|
-
|
|
1664
|
+
return /* @__PURE__ */ React32.createElement(ControlActions, null, /* @__PURE__ */ React32.createElement(
|
|
1665
|
+
import_ui25.TextField,
|
|
1628
1666
|
{
|
|
1629
1667
|
size: "tiny",
|
|
1630
1668
|
fullWidth: true,
|
|
@@ -1636,23 +1674,24 @@ var UrlControl = createControl(({ placeholder }) => {
|
|
|
1636
1674
|
});
|
|
1637
1675
|
|
|
1638
1676
|
// src/controls/link-control.tsx
|
|
1639
|
-
var
|
|
1640
|
-
var
|
|
1677
|
+
var React34 = __toESM(require("react"));
|
|
1678
|
+
var import_react12 = require("react");
|
|
1641
1679
|
var import_editor_elements = require("@elementor/editor-elements");
|
|
1642
1680
|
var import_editor_props16 = require("@elementor/editor-props");
|
|
1681
|
+
var import_editor_ui3 = require("@elementor/editor-ui");
|
|
1643
1682
|
var import_http2 = require("@elementor/http");
|
|
1644
1683
|
var import_icons7 = require("@elementor/icons");
|
|
1645
1684
|
var import_session = require("@elementor/session");
|
|
1646
|
-
var
|
|
1685
|
+
var import_ui27 = require("@elementor/ui");
|
|
1647
1686
|
var import_utils3 = require("@elementor/utils");
|
|
1648
1687
|
var import_i18n9 = require("@wordpress/i18n");
|
|
1649
1688
|
|
|
1650
1689
|
// src/components/autocomplete.tsx
|
|
1651
|
-
var
|
|
1652
|
-
var
|
|
1690
|
+
var React33 = __toESM(require("react"));
|
|
1691
|
+
var import_react11 = require("react");
|
|
1653
1692
|
var import_icons6 = require("@elementor/icons");
|
|
1654
|
-
var
|
|
1655
|
-
var Autocomplete = (0,
|
|
1693
|
+
var import_ui26 = require("@elementor/ui");
|
|
1694
|
+
var Autocomplete = (0, import_react11.forwardRef)((props, ref) => {
|
|
1656
1695
|
const {
|
|
1657
1696
|
options,
|
|
1658
1697
|
onOptionChange,
|
|
@@ -1668,8 +1707,8 @@ var Autocomplete = (0, import_react10.forwardRef)((props, ref) => {
|
|
|
1668
1707
|
const muiWarningPreventer = allowCustomValues || !!value?.toString()?.length;
|
|
1669
1708
|
const isOptionEqualToValue = muiWarningPreventer ? void 0 : () => true;
|
|
1670
1709
|
const isValueFromOptions = typeof value === "number" && !!findMatchingOption(options, value);
|
|
1671
|
-
return /* @__PURE__ */
|
|
1672
|
-
|
|
1710
|
+
return /* @__PURE__ */ React33.createElement(
|
|
1711
|
+
import_ui26.Autocomplete,
|
|
1673
1712
|
{
|
|
1674
1713
|
...restProps,
|
|
1675
1714
|
ref,
|
|
@@ -1686,8 +1725,8 @@ var Autocomplete = (0, import_react10.forwardRef)((props, ref) => {
|
|
|
1686
1725
|
groupBy: isCategorizedOptionPool(options) ? (optionId) => findMatchingOption(options, optionId)?.groupLabel || optionId : void 0,
|
|
1687
1726
|
isOptionEqualToValue,
|
|
1688
1727
|
filterOptions: () => optionKeys,
|
|
1689
|
-
renderOption: (optionProps, optionId) => /* @__PURE__ */
|
|
1690
|
-
renderInput: (params) => /* @__PURE__ */
|
|
1728
|
+
renderOption: (optionProps, optionId) => /* @__PURE__ */ React33.createElement(import_ui26.Box, { component: "li", ...optionProps, key: optionProps.id }, findMatchingOption(options, optionId)?.label ?? optionId),
|
|
1729
|
+
renderInput: (params) => /* @__PURE__ */ React33.createElement(
|
|
1691
1730
|
TextInput,
|
|
1692
1731
|
{
|
|
1693
1732
|
params,
|
|
@@ -1710,8 +1749,8 @@ var TextInput = ({
|
|
|
1710
1749
|
const onChange = (event) => {
|
|
1711
1750
|
handleChange(event.target.value);
|
|
1712
1751
|
};
|
|
1713
|
-
return /* @__PURE__ */
|
|
1714
|
-
|
|
1752
|
+
return /* @__PURE__ */ React33.createElement(
|
|
1753
|
+
import_ui26.TextField,
|
|
1715
1754
|
{
|
|
1716
1755
|
...params,
|
|
1717
1756
|
placeholder,
|
|
@@ -1723,7 +1762,7 @@ var TextInput = ({
|
|
|
1723
1762
|
},
|
|
1724
1763
|
InputProps: {
|
|
1725
1764
|
...params.InputProps,
|
|
1726
|
-
endAdornment: /* @__PURE__ */
|
|
1765
|
+
endAdornment: /* @__PURE__ */ React33.createElement(ClearButton, { params, allowClear, handleChange })
|
|
1727
1766
|
}
|
|
1728
1767
|
}
|
|
1729
1768
|
);
|
|
@@ -1732,7 +1771,7 @@ var ClearButton = ({
|
|
|
1732
1771
|
allowClear,
|
|
1733
1772
|
handleChange,
|
|
1734
1773
|
params
|
|
1735
|
-
}) => /* @__PURE__ */
|
|
1774
|
+
}) => /* @__PURE__ */ React33.createElement(import_ui26.InputAdornment, { position: "end" }, allowClear && /* @__PURE__ */ React33.createElement(import_ui26.IconButton, { size: params.size, onClick: () => handleChange(null), sx: { cursor: "pointer" } }, /* @__PURE__ */ React33.createElement(import_icons6.XIcon, { fontSize: params.size })));
|
|
1736
1775
|
function findMatchingOption(options, optionId = null) {
|
|
1737
1776
|
const formattedOption = (optionId || "").toString();
|
|
1738
1777
|
return options.find(({ id }) => formattedOption === id.toString());
|
|
@@ -1755,10 +1794,14 @@ function _factoryFilter(newValue, options, minInputLength) {
|
|
|
1755
1794
|
|
|
1756
1795
|
// src/controls/link-control.tsx
|
|
1757
1796
|
var SIZE3 = "tiny";
|
|
1797
|
+
var learnMoreButton = {
|
|
1798
|
+
label: (0, import_i18n9.__)("Learn More", "elementor"),
|
|
1799
|
+
href: "https://go.elementor.com/element-link-inside-link-infotip"
|
|
1800
|
+
};
|
|
1758
1801
|
var LinkControl = createControl((props) => {
|
|
1759
1802
|
const { value, path, setValue, ...propContext } = useBoundProp(import_editor_props16.linkPropTypeUtil);
|
|
1760
1803
|
const [linkSessionValue, setLinkSessionValue] = (0, import_session.useSessionStorage)(path.join("/"));
|
|
1761
|
-
const [
|
|
1804
|
+
const [isActive, setIsActive] = (0, import_react12.useState)(!!value);
|
|
1762
1805
|
const {
|
|
1763
1806
|
allowCustomValues,
|
|
1764
1807
|
queryOptions: { endpoint = "", requestParams = {} },
|
|
@@ -1766,17 +1809,19 @@ var LinkControl = createControl((props) => {
|
|
|
1766
1809
|
minInputLength = 2,
|
|
1767
1810
|
context: { elementId }
|
|
1768
1811
|
} = props || {};
|
|
1769
|
-
const [
|
|
1812
|
+
const [linkInLinkRestriction, setLinkInLinkRestriction] = (0, import_react12.useState)((0, import_editor_elements.getLinkInLinkRestriction)(elementId));
|
|
1813
|
+
const [options, setOptions] = (0, import_react12.useState)(
|
|
1770
1814
|
generateFirstLoadedOption(value)
|
|
1771
1815
|
);
|
|
1816
|
+
const shouldDisableAddingLink = !isActive && linkInLinkRestriction.shouldRestrict;
|
|
1772
1817
|
const onEnabledChange = () => {
|
|
1773
|
-
|
|
1774
|
-
if (shouldRestrict && !
|
|
1818
|
+
setLinkInLinkRestriction((0, import_editor_elements.getLinkInLinkRestriction)(elementId));
|
|
1819
|
+
if (linkInLinkRestriction.shouldRestrict && !isActive) {
|
|
1775
1820
|
return;
|
|
1776
1821
|
}
|
|
1777
|
-
|
|
1778
|
-
setValue(
|
|
1779
|
-
setLinkSessionValue({ value, meta: { isEnabled: !
|
|
1822
|
+
setIsActive((prevState) => !prevState);
|
|
1823
|
+
setValue(isActive ? null : linkSessionValue?.value ?? null);
|
|
1824
|
+
setLinkSessionValue({ value, meta: { isEnabled: !isActive } });
|
|
1780
1825
|
};
|
|
1781
1826
|
const onOptionChange = (newValue) => {
|
|
1782
1827
|
const valueToSave = newValue ? {
|
|
@@ -1807,7 +1852,7 @@ var LinkControl = createControl((props) => {
|
|
|
1807
1852
|
}
|
|
1808
1853
|
debounceFetch({ ...requestParams, term: newValue });
|
|
1809
1854
|
};
|
|
1810
|
-
const debounceFetch = (0,
|
|
1855
|
+
const debounceFetch = (0, import_react12.useMemo)(
|
|
1811
1856
|
() => (0, import_utils3.debounce)(
|
|
1812
1857
|
(params) => fetchOptions(endpoint, params).then((newOptions) => {
|
|
1813
1858
|
setOptions(formatOptions(newOptions));
|
|
@@ -1816,8 +1861,8 @@ var LinkControl = createControl((props) => {
|
|
|
1816
1861
|
),
|
|
1817
1862
|
[endpoint]
|
|
1818
1863
|
);
|
|
1819
|
-
return /* @__PURE__ */
|
|
1820
|
-
|
|
1864
|
+
return /* @__PURE__ */ React34.createElement(PropProvider, { ...propContext, value, setValue }, /* @__PURE__ */ React34.createElement(import_ui27.Stack, { gap: 1.5 }, /* @__PURE__ */ React34.createElement(import_ui27.Divider, null), /* @__PURE__ */ React34.createElement(
|
|
1865
|
+
import_ui27.Stack,
|
|
1821
1866
|
{
|
|
1822
1867
|
direction: "row",
|
|
1823
1868
|
sx: {
|
|
@@ -1825,37 +1870,43 @@ var LinkControl = createControl((props) => {
|
|
|
1825
1870
|
alignItems: "center"
|
|
1826
1871
|
}
|
|
1827
1872
|
},
|
|
1828
|
-
/* @__PURE__ */
|
|
1829
|
-
/* @__PURE__ */
|
|
1873
|
+
/* @__PURE__ */ React34.createElement(ControlFormLabel, null, (0, import_i18n9.__)("Link", "elementor")),
|
|
1874
|
+
/* @__PURE__ */ React34.createElement(ConditionalInfoTip, { isVisible: !isActive, linkInLinkRestriction }, /* @__PURE__ */ React34.createElement(
|
|
1830
1875
|
ToggleIconControl,
|
|
1831
1876
|
{
|
|
1832
|
-
|
|
1877
|
+
disabled: shouldDisableAddingLink,
|
|
1878
|
+
active: isActive,
|
|
1833
1879
|
onIconClick: onEnabledChange,
|
|
1834
1880
|
label: (0, import_i18n9.__)("Toggle link", "elementor")
|
|
1835
1881
|
}
|
|
1836
|
-
)
|
|
1837
|
-
), /* @__PURE__ */
|
|
1882
|
+
))
|
|
1883
|
+
), /* @__PURE__ */ React34.createElement(import_ui27.Collapse, { in: isActive, timeout: "auto", unmountOnExit: true }, /* @__PURE__ */ React34.createElement(import_ui27.Stack, { gap: 1.5 }, /* @__PURE__ */ React34.createElement(PropKeyProvider, { bind: "destination" }, /* @__PURE__ */ React34.createElement(ControlActions, null, /* @__PURE__ */ React34.createElement(
|
|
1838
1884
|
Autocomplete,
|
|
1839
1885
|
{
|
|
1840
1886
|
options,
|
|
1841
1887
|
allowCustomValues,
|
|
1842
1888
|
placeholder,
|
|
1843
|
-
value: value?.destination?.value,
|
|
1889
|
+
value: value?.destination?.value?.settings?.label || value?.destination?.value,
|
|
1844
1890
|
onOptionChange,
|
|
1845
1891
|
onTextChange,
|
|
1846
1892
|
minInputLength
|
|
1847
1893
|
}
|
|
1848
|
-
))), /* @__PURE__ */
|
|
1894
|
+
))), /* @__PURE__ */ React34.createElement(PropKeyProvider, { bind: "isTargetBlank" }, /* @__PURE__ */ React34.createElement(SwitchControl, { disabled: !value }))))));
|
|
1849
1895
|
});
|
|
1850
|
-
var ToggleIconControl = ({
|
|
1851
|
-
return /* @__PURE__ */
|
|
1896
|
+
var ToggleIconControl = ({ disabled, active, onIconClick, label }) => {
|
|
1897
|
+
return /* @__PURE__ */ React34.createElement(import_ui27.IconButton, { size: SIZE3, onClick: onIconClick, "aria-label": label, disabled }, active ? /* @__PURE__ */ React34.createElement(import_icons7.MinusIcon, { fontSize: SIZE3 }) : /* @__PURE__ */ React34.createElement(import_icons7.PlusIcon, { fontSize: SIZE3 }));
|
|
1852
1898
|
};
|
|
1853
|
-
var SwitchControl = () => {
|
|
1899
|
+
var SwitchControl = ({ disabled }) => {
|
|
1854
1900
|
const { value = false, setValue } = useBoundProp(import_editor_props16.booleanPropTypeUtil);
|
|
1855
1901
|
const onClick = () => {
|
|
1856
1902
|
setValue(!value);
|
|
1857
1903
|
};
|
|
1858
|
-
|
|
1904
|
+
const inputProps = disabled ? {
|
|
1905
|
+
style: {
|
|
1906
|
+
opacity: 0
|
|
1907
|
+
}
|
|
1908
|
+
} : {};
|
|
1909
|
+
return /* @__PURE__ */ React34.createElement(import_ui27.Grid, { container: true, alignItems: "center", flexWrap: "nowrap", justifyContent: "space-between" }, /* @__PURE__ */ React34.createElement(import_ui27.Grid, { item: true }, /* @__PURE__ */ React34.createElement(ControlFormLabel, null, (0, import_i18n9.__)("Open in a new tab", "elementor"))), /* @__PURE__ */ React34.createElement(import_ui27.Grid, { item: true }, /* @__PURE__ */ React34.createElement(import_ui27.Switch, { checked: value, onClick, disabled, inputProps })));
|
|
1859
1910
|
};
|
|
1860
1911
|
async function fetchOptions(ajaxUrl, params) {
|
|
1861
1912
|
if (!params || !ajaxUrl) {
|
|
@@ -1885,12 +1936,43 @@ function generateFirstLoadedOption(unionValue) {
|
|
|
1885
1936
|
}
|
|
1886
1937
|
] : [];
|
|
1887
1938
|
}
|
|
1939
|
+
var ConditionalInfoTip = ({ linkInLinkRestriction, isVisible, children }) => {
|
|
1940
|
+
const { shouldRestrict, reason, elementId } = linkInLinkRestriction;
|
|
1941
|
+
const handleTakeMeClick = () => {
|
|
1942
|
+
if (elementId) {
|
|
1943
|
+
(0, import_editor_elements.selectElement)(elementId);
|
|
1944
|
+
}
|
|
1945
|
+
};
|
|
1946
|
+
return shouldRestrict && isVisible ? /* @__PURE__ */ React34.createElement(
|
|
1947
|
+
import_ui27.Infotip,
|
|
1948
|
+
{
|
|
1949
|
+
placement: "right",
|
|
1950
|
+
content: /* @__PURE__ */ React34.createElement(
|
|
1951
|
+
import_editor_ui3.InfoTipCard,
|
|
1952
|
+
{
|
|
1953
|
+
content: INFOTIP_CONTENT[reason],
|
|
1954
|
+
svgIcon: /* @__PURE__ */ React34.createElement(import_icons7.AlertTriangleIcon, null),
|
|
1955
|
+
learnMoreButton,
|
|
1956
|
+
ctaButton: {
|
|
1957
|
+
label: (0, import_i18n9.__)("Take me there", "elementor"),
|
|
1958
|
+
onClick: handleTakeMeClick
|
|
1959
|
+
}
|
|
1960
|
+
}
|
|
1961
|
+
)
|
|
1962
|
+
},
|
|
1963
|
+
/* @__PURE__ */ React34.createElement(import_ui27.Box, null, children)
|
|
1964
|
+
) : /* @__PURE__ */ React34.createElement(React34.Fragment, null, children);
|
|
1965
|
+
};
|
|
1966
|
+
var INFOTIP_CONTENT = {
|
|
1967
|
+
descendant: /* @__PURE__ */ React34.createElement(React34.Fragment, null, (0, import_i18n9.__)("To add a link to this container,", "elementor"), /* @__PURE__ */ React34.createElement("br", null), (0, import_i18n9.__)("first remove the link from the elements inside of it.", "elementor")),
|
|
1968
|
+
ancestor: /* @__PURE__ */ React34.createElement(React34.Fragment, null, (0, import_i18n9.__)("To add a link to this element,", "elementor"), /* @__PURE__ */ React34.createElement("br", null), (0, import_i18n9.__)("first remove the link from its parent container.", "elementor"))
|
|
1969
|
+
};
|
|
1888
1970
|
|
|
1889
1971
|
// src/controls/gap-control.tsx
|
|
1890
|
-
var
|
|
1972
|
+
var React35 = __toESM(require("react"));
|
|
1891
1973
|
var import_editor_props17 = require("@elementor/editor-props");
|
|
1892
1974
|
var import_icons8 = require("@elementor/icons");
|
|
1893
|
-
var
|
|
1975
|
+
var import_ui28 = require("@elementor/ui");
|
|
1894
1976
|
var import_i18n10 = require("@wordpress/i18n");
|
|
1895
1977
|
var GapControl = createControl(({ label }) => {
|
|
1896
1978
|
const {
|
|
@@ -1915,8 +1997,8 @@ var GapControl = createControl(({ label }) => {
|
|
|
1915
1997
|
const LinkedIcon = isLinked ? import_icons8.LinkIcon : import_icons8.DetachIcon;
|
|
1916
1998
|
const linkedLabel = (0, import_i18n10.__)("Link %s", "elementor").replace("%s", tooltipLabel);
|
|
1917
1999
|
const unlinkedLabel = (0, import_i18n10.__)("Unlink %s", "elementor").replace("%s", tooltipLabel);
|
|
1918
|
-
return /* @__PURE__ */
|
|
1919
|
-
|
|
2000
|
+
return /* @__PURE__ */ React35.createElement(PropProvider, { propType, value: directionValue, setValue: setDirectionValue }, /* @__PURE__ */ React35.createElement(import_ui28.Stack, { direction: "row", gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React35.createElement(ControlLabel, null, label), /* @__PURE__ */ React35.createElement(import_ui28.Tooltip, { title: isLinked ? unlinkedLabel : linkedLabel, placement: "top" }, /* @__PURE__ */ React35.createElement(
|
|
2001
|
+
import_ui28.ToggleButton,
|
|
1920
2002
|
{
|
|
1921
2003
|
"aria-label": isLinked ? unlinkedLabel : linkedLabel,
|
|
1922
2004
|
size: "tiny",
|
|
@@ -1925,30 +2007,30 @@ var GapControl = createControl(({ label }) => {
|
|
|
1925
2007
|
sx: { marginLeft: "auto" },
|
|
1926
2008
|
onChange: onLinkToggle
|
|
1927
2009
|
},
|
|
1928
|
-
/* @__PURE__ */
|
|
1929
|
-
))), /* @__PURE__ */
|
|
2010
|
+
/* @__PURE__ */ React35.createElement(LinkedIcon, { fontSize: "tiny" })
|
|
2011
|
+
))), /* @__PURE__ */ React35.createElement(import_ui28.Stack, { direction: "row", gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React35.createElement(import_ui28.Grid, { container: true, gap: 0.75, alignItems: "center" }, /* @__PURE__ */ React35.createElement(import_ui28.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React35.createElement(ControlFormLabel, null, (0, import_i18n10.__)("Column", "elementor"))), /* @__PURE__ */ React35.createElement(import_ui28.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React35.createElement(Control4, { bind: "column", isLinked }))), /* @__PURE__ */ React35.createElement(import_ui28.Grid, { container: true, gap: 0.75, alignItems: "center" }, /* @__PURE__ */ React35.createElement(import_ui28.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React35.createElement(ControlFormLabel, null, (0, import_i18n10.__)("Row", "elementor"))), /* @__PURE__ */ React35.createElement(import_ui28.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React35.createElement(Control4, { bind: "row", isLinked })))));
|
|
1930
2012
|
});
|
|
1931
2013
|
var Control4 = ({ bind, isLinked }) => {
|
|
1932
2014
|
if (isLinked) {
|
|
1933
|
-
return /* @__PURE__ */
|
|
2015
|
+
return /* @__PURE__ */ React35.createElement(SizeControl, null);
|
|
1934
2016
|
}
|
|
1935
|
-
return /* @__PURE__ */
|
|
2017
|
+
return /* @__PURE__ */ React35.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React35.createElement(SizeControl, null));
|
|
1936
2018
|
};
|
|
1937
2019
|
|
|
1938
2020
|
// src/controls/svg-media-control.tsx
|
|
1939
|
-
var
|
|
1940
|
-
var
|
|
2021
|
+
var React37 = __toESM(require("react"));
|
|
2022
|
+
var import_react14 = require("react");
|
|
1941
2023
|
var import_editor_props18 = require("@elementor/editor-props");
|
|
1942
2024
|
var import_icons9 = require("@elementor/icons");
|
|
1943
|
-
var
|
|
2025
|
+
var import_ui30 = require("@elementor/ui");
|
|
1944
2026
|
var import_wp_media2 = require("@elementor/wp-media");
|
|
1945
2027
|
var import_i18n12 = require("@wordpress/i18n");
|
|
1946
2028
|
|
|
1947
2029
|
// src/components/enable-unfiltered-modal.tsx
|
|
1948
|
-
var
|
|
1949
|
-
var
|
|
2030
|
+
var React36 = __toESM(require("react"));
|
|
2031
|
+
var import_react13 = require("react");
|
|
1950
2032
|
var import_editor_current_user = require("@elementor/editor-current-user");
|
|
1951
|
-
var
|
|
2033
|
+
var import_ui29 = require("@elementor/ui");
|
|
1952
2034
|
var import_i18n11 = require("@wordpress/i18n");
|
|
1953
2035
|
var ADMIN_TITLE_TEXT = (0, import_i18n11.__)("Enable Unfiltered Uploads", "elementor");
|
|
1954
2036
|
var ADMIN_CONTENT_TEXT = (0, import_i18n11.__)(
|
|
@@ -1969,7 +2051,7 @@ var WAIT_FOR_CLOSE_TIMEOUT_MS = 300;
|
|
|
1969
2051
|
var EnableUnfilteredModal = (props) => {
|
|
1970
2052
|
const { mutateAsync, isPending } = useUpdateUnfilteredFilesUpload();
|
|
1971
2053
|
const { canUser } = (0, import_editor_current_user.useCurrentUserCapabilities)();
|
|
1972
|
-
const [isError, setIsError] = (0,
|
|
2054
|
+
const [isError, setIsError] = (0, import_react13.useState)(false);
|
|
1973
2055
|
const canManageOptions = canUser("manage_options");
|
|
1974
2056
|
const onClose = (enabled) => {
|
|
1975
2057
|
props.onClose(enabled);
|
|
@@ -1988,10 +2070,10 @@ var EnableUnfilteredModal = (props) => {
|
|
|
1988
2070
|
}
|
|
1989
2071
|
};
|
|
1990
2072
|
const dialogProps = { ...props, isPending, handleEnable, isError, onClose };
|
|
1991
|
-
return canManageOptions ? /* @__PURE__ */
|
|
2073
|
+
return canManageOptions ? /* @__PURE__ */ React36.createElement(AdminDialog, { ...dialogProps }) : /* @__PURE__ */ React36.createElement(NonAdminDialog, { ...dialogProps });
|
|
1992
2074
|
};
|
|
1993
|
-
var AdminDialog = ({ open, onClose, handleEnable, isPending, isError }) => /* @__PURE__ */
|
|
1994
|
-
|
|
2075
|
+
var AdminDialog = ({ open, onClose, handleEnable, isPending, isError }) => /* @__PURE__ */ React36.createElement(import_ui29.Dialog, { open, maxWidth: "sm", onClose: () => onClose(false) }, /* @__PURE__ */ React36.createElement(import_ui29.DialogHeader, { logo: false }, /* @__PURE__ */ React36.createElement(import_ui29.DialogTitle, null, ADMIN_TITLE_TEXT)), /* @__PURE__ */ React36.createElement(import_ui29.Divider, null), /* @__PURE__ */ React36.createElement(import_ui29.DialogContent, null, /* @__PURE__ */ React36.createElement(import_ui29.DialogContentText, null, isError ? /* @__PURE__ */ React36.createElement(React36.Fragment, null, ADMIN_FAILED_CONTENT_TEXT_PT1, " ", /* @__PURE__ */ React36.createElement("br", null), " ", ADMIN_FAILED_CONTENT_TEXT_PT2) : ADMIN_CONTENT_TEXT)), /* @__PURE__ */ React36.createElement(import_ui29.DialogActions, null, /* @__PURE__ */ React36.createElement(import_ui29.Button, { size: "medium", color: "secondary", onClick: () => onClose(false) }, (0, import_i18n11.__)("Cancel", "elementor")), /* @__PURE__ */ React36.createElement(
|
|
2076
|
+
import_ui29.Button,
|
|
1995
2077
|
{
|
|
1996
2078
|
size: "medium",
|
|
1997
2079
|
onClick: () => handleEnable(),
|
|
@@ -1999,16 +2081,16 @@ var AdminDialog = ({ open, onClose, handleEnable, isPending, isError }) => /* @_
|
|
|
1999
2081
|
color: "primary",
|
|
2000
2082
|
disabled: isPending
|
|
2001
2083
|
},
|
|
2002
|
-
isPending ? /* @__PURE__ */
|
|
2084
|
+
isPending ? /* @__PURE__ */ React36.createElement(import_ui29.CircularProgress, { size: 24 }) : (0, import_i18n11.__)("Enable", "elementor")
|
|
2003
2085
|
)));
|
|
2004
|
-
var NonAdminDialog = ({ open, onClose }) => /* @__PURE__ */
|
|
2086
|
+
var NonAdminDialog = ({ open, onClose }) => /* @__PURE__ */ React36.createElement(import_ui29.Dialog, { open, maxWidth: "sm", onClose: () => onClose(false) }, /* @__PURE__ */ React36.createElement(import_ui29.DialogHeader, { logo: false }, /* @__PURE__ */ React36.createElement(import_ui29.DialogTitle, null, NON_ADMIN_TITLE_TEXT)), /* @__PURE__ */ React36.createElement(import_ui29.Divider, null), /* @__PURE__ */ React36.createElement(import_ui29.DialogContent, null, /* @__PURE__ */ React36.createElement(import_ui29.DialogContentText, null, NON_ADMIN_CONTENT_TEXT)), /* @__PURE__ */ React36.createElement(import_ui29.DialogActions, null, /* @__PURE__ */ React36.createElement(import_ui29.Button, { size: "medium", onClick: () => onClose(false), variant: "contained", color: "primary" }, (0, import_i18n11.__)("Got it", "elementor"))));
|
|
2005
2087
|
|
|
2006
2088
|
// src/controls/svg-media-control.tsx
|
|
2007
2089
|
var TILE_SIZE = 8;
|
|
2008
2090
|
var TILE_WHITE = "transparent";
|
|
2009
2091
|
var TILE_BLACK = "#c1c1c1";
|
|
2010
2092
|
var TILES_GRADIENT_FORMULA = `linear-gradient(45deg, ${TILE_BLACK} 25%, ${TILE_WHITE} 0, ${TILE_WHITE} 75%, ${TILE_BLACK} 0, ${TILE_BLACK})`;
|
|
2011
|
-
var StyledCard = (0,
|
|
2093
|
+
var StyledCard = (0, import_ui30.styled)(import_ui30.Card)`
|
|
2012
2094
|
background-color: white;
|
|
2013
2095
|
background-image: ${TILES_GRADIENT_FORMULA}, ${TILES_GRADIENT_FORMULA};
|
|
2014
2096
|
background-size: ${TILE_SIZE}px ${TILE_SIZE}px;
|
|
@@ -2017,7 +2099,7 @@ var StyledCard = (0, import_ui29.styled)(import_ui29.Card)`
|
|
|
2017
2099
|
${TILE_SIZE / 2}px ${TILE_SIZE / 2}px;
|
|
2018
2100
|
border: none;
|
|
2019
2101
|
`;
|
|
2020
|
-
var StyledCardMediaContainer = (0,
|
|
2102
|
+
var StyledCardMediaContainer = (0, import_ui30.styled)(import_ui30.Stack)`
|
|
2021
2103
|
position: relative;
|
|
2022
2104
|
height: 140px;
|
|
2023
2105
|
object-fit: contain;
|
|
@@ -2034,7 +2116,7 @@ var SvgMediaControl = createControl(() => {
|
|
|
2034
2116
|
const { data: attachment, isFetching } = (0, import_wp_media2.useWpMediaAttachment)(id?.value || null);
|
|
2035
2117
|
const src = attachment?.url ?? url?.value ?? null;
|
|
2036
2118
|
const { data: allowSvgUpload } = useUnfilteredFilesUpload();
|
|
2037
|
-
const [unfilteredModalOpenState, setUnfilteredModalOpenState] = (0,
|
|
2119
|
+
const [unfilteredModalOpenState, setUnfilteredModalOpenState] = (0, import_react14.useState)(false);
|
|
2038
2120
|
const { open } = (0, import_wp_media2.useWpMediaFrame)({
|
|
2039
2121
|
mediaTypes: ["svg"],
|
|
2040
2122
|
multiple: false,
|
|
@@ -2062,16 +2144,16 @@ var SvgMediaControl = createControl(() => {
|
|
|
2062
2144
|
open(openOptions);
|
|
2063
2145
|
}
|
|
2064
2146
|
};
|
|
2065
|
-
return /* @__PURE__ */
|
|
2066
|
-
|
|
2147
|
+
return /* @__PURE__ */ React37.createElement(import_ui30.Stack, { gap: 1 }, /* @__PURE__ */ React37.createElement(EnableUnfilteredModal, { open: unfilteredModalOpenState, onClose: onCloseUnfilteredModal }), /* @__PURE__ */ React37.createElement(ControlFormLabel, null, " ", (0, import_i18n12.__)("SVG", "elementor"), " "), /* @__PURE__ */ React37.createElement(ControlActions, null, /* @__PURE__ */ React37.createElement(StyledCard, { variant: "outlined" }, /* @__PURE__ */ React37.createElement(StyledCardMediaContainer, null, isFetching ? /* @__PURE__ */ React37.createElement(import_ui30.CircularProgress, { role: "progressbar" }) : /* @__PURE__ */ React37.createElement(
|
|
2148
|
+
import_ui30.CardMedia,
|
|
2067
2149
|
{
|
|
2068
2150
|
component: "img",
|
|
2069
2151
|
image: src,
|
|
2070
2152
|
alt: (0, import_i18n12.__)("Preview SVG", "elementor"),
|
|
2071
2153
|
sx: { maxHeight: "140px", width: "50px" }
|
|
2072
2154
|
}
|
|
2073
|
-
)), /* @__PURE__ */
|
|
2074
|
-
|
|
2155
|
+
)), /* @__PURE__ */ React37.createElement(
|
|
2156
|
+
import_ui30.CardOverlay,
|
|
2075
2157
|
{
|
|
2076
2158
|
sx: {
|
|
2077
2159
|
"&:hover": {
|
|
@@ -2079,8 +2161,8 @@ var SvgMediaControl = createControl(() => {
|
|
|
2079
2161
|
}
|
|
2080
2162
|
}
|
|
2081
2163
|
},
|
|
2082
|
-
/* @__PURE__ */
|
|
2083
|
-
|
|
2164
|
+
/* @__PURE__ */ React37.createElement(import_ui30.Stack, { gap: 1 }, /* @__PURE__ */ React37.createElement(
|
|
2165
|
+
import_ui30.Button,
|
|
2084
2166
|
{
|
|
2085
2167
|
size: "tiny",
|
|
2086
2168
|
color: "inherit",
|
|
@@ -2088,13 +2170,13 @@ var SvgMediaControl = createControl(() => {
|
|
|
2088
2170
|
onClick: () => handleClick(MODE_BROWSE)
|
|
2089
2171
|
},
|
|
2090
2172
|
(0, import_i18n12.__)("Select SVG", "elementor")
|
|
2091
|
-
), /* @__PURE__ */
|
|
2092
|
-
|
|
2173
|
+
), /* @__PURE__ */ React37.createElement(
|
|
2174
|
+
import_ui30.Button,
|
|
2093
2175
|
{
|
|
2094
2176
|
size: "tiny",
|
|
2095
2177
|
variant: "text",
|
|
2096
2178
|
color: "inherit",
|
|
2097
|
-
startIcon: /* @__PURE__ */
|
|
2179
|
+
startIcon: /* @__PURE__ */ React37.createElement(import_icons9.UploadIcon, null),
|
|
2098
2180
|
onClick: () => handleClick(MODE_UPLOAD)
|
|
2099
2181
|
},
|
|
2100
2182
|
(0, import_i18n12.__)("Upload", "elementor")
|
|
@@ -2103,15 +2185,15 @@ var SvgMediaControl = createControl(() => {
|
|
|
2103
2185
|
});
|
|
2104
2186
|
|
|
2105
2187
|
// src/controls/background-control/background-control.tsx
|
|
2106
|
-
var
|
|
2188
|
+
var React44 = __toESM(require("react"));
|
|
2107
2189
|
var import_editor_props24 = require("@elementor/editor-props");
|
|
2108
|
-
var
|
|
2190
|
+
var import_ui38 = require("@elementor/ui");
|
|
2109
2191
|
var import_i18n18 = require("@wordpress/i18n");
|
|
2110
2192
|
|
|
2111
2193
|
// src/controls/background-control/background-overlay/background-overlay-repeater-control.tsx
|
|
2112
|
-
var
|
|
2194
|
+
var React43 = __toESM(require("react"));
|
|
2113
2195
|
var import_editor_props23 = require("@elementor/editor-props");
|
|
2114
|
-
var
|
|
2196
|
+
var import_ui37 = require("@elementor/ui");
|
|
2115
2197
|
var import_wp_media3 = require("@elementor/wp-media");
|
|
2116
2198
|
var import_i18n17 = require("@wordpress/i18n");
|
|
2117
2199
|
|
|
@@ -2120,9 +2202,9 @@ var import_env = require("@elementor/env");
|
|
|
2120
2202
|
var { env } = (0, import_env.parseEnv)("@elementor/editor-controls");
|
|
2121
2203
|
|
|
2122
2204
|
// src/controls/background-control/background-gradient-color-control.tsx
|
|
2123
|
-
var
|
|
2205
|
+
var React38 = __toESM(require("react"));
|
|
2124
2206
|
var import_editor_props19 = require("@elementor/editor-props");
|
|
2125
|
-
var
|
|
2207
|
+
var import_ui31 = require("@elementor/ui");
|
|
2126
2208
|
var BackgroundGradientColorControl = createControl(() => {
|
|
2127
2209
|
const { value, setValue } = useBoundProp(import_editor_props19.backgroundGradientOverlayPropTypeUtil);
|
|
2128
2210
|
const handleChange = (newValue) => {
|
|
@@ -2160,8 +2242,8 @@ var BackgroundGradientColorControl = createControl(() => {
|
|
|
2160
2242
|
positions: positions?.value.split(" ")
|
|
2161
2243
|
};
|
|
2162
2244
|
};
|
|
2163
|
-
return /* @__PURE__ */
|
|
2164
|
-
|
|
2245
|
+
return /* @__PURE__ */ React38.createElement(ControlActions, null, /* @__PURE__ */ React38.createElement(
|
|
2246
|
+
import_ui31.UnstableGradientBox,
|
|
2165
2247
|
{
|
|
2166
2248
|
sx: { width: "auto", padding: 1.5 },
|
|
2167
2249
|
value: normalizeValue(),
|
|
@@ -2185,34 +2267,34 @@ var initialBackgroundGradientOverlay = import_editor_props19.backgroundGradientO
|
|
|
2185
2267
|
});
|
|
2186
2268
|
|
|
2187
2269
|
// src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-attachment.tsx
|
|
2188
|
-
var
|
|
2270
|
+
var React39 = __toESM(require("react"));
|
|
2189
2271
|
var import_icons10 = require("@elementor/icons");
|
|
2190
|
-
var
|
|
2272
|
+
var import_ui32 = require("@elementor/ui");
|
|
2191
2273
|
var import_i18n13 = require("@wordpress/i18n");
|
|
2192
2274
|
var attachmentControlOptions = [
|
|
2193
2275
|
{
|
|
2194
2276
|
value: "fixed",
|
|
2195
2277
|
label: (0, import_i18n13.__)("Fixed", "elementor"),
|
|
2196
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2278
|
+
renderContent: ({ size }) => /* @__PURE__ */ React39.createElement(import_icons10.PinIcon, { fontSize: size }),
|
|
2197
2279
|
showTooltip: true
|
|
2198
2280
|
},
|
|
2199
2281
|
{
|
|
2200
2282
|
value: "scroll",
|
|
2201
2283
|
label: (0, import_i18n13.__)("Scroll", "elementor"),
|
|
2202
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2284
|
+
renderContent: ({ size }) => /* @__PURE__ */ React39.createElement(import_icons10.PinnedOffIcon, { fontSize: size }),
|
|
2203
2285
|
showTooltip: true
|
|
2204
2286
|
}
|
|
2205
2287
|
];
|
|
2206
2288
|
var BackgroundImageOverlayAttachment = () => {
|
|
2207
|
-
return /* @__PURE__ */
|
|
2289
|
+
return /* @__PURE__ */ React39.createElement(PopoverGridContainer, null, /* @__PURE__ */ React39.createElement(import_ui32.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React39.createElement(ControlFormLabel, null, (0, import_i18n13.__)("Attachment", "elementor"))), /* @__PURE__ */ React39.createElement(import_ui32.Grid, { item: true, xs: 6, sx: { display: "flex", justifyContent: "flex-end", overflow: "hidden" } }, /* @__PURE__ */ React39.createElement(ToggleControl, { options: attachmentControlOptions })));
|
|
2208
2290
|
};
|
|
2209
2291
|
|
|
2210
2292
|
// src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-position.tsx
|
|
2211
|
-
var
|
|
2293
|
+
var React40 = __toESM(require("react"));
|
|
2212
2294
|
var import_editor_props20 = require("@elementor/editor-props");
|
|
2213
|
-
var
|
|
2295
|
+
var import_editor_ui4 = require("@elementor/editor-ui");
|
|
2214
2296
|
var import_icons11 = require("@elementor/icons");
|
|
2215
|
-
var
|
|
2297
|
+
var import_ui33 = require("@elementor/ui");
|
|
2216
2298
|
var import_i18n14 = require("@wordpress/i18n");
|
|
2217
2299
|
var backgroundPositionOptions = [
|
|
2218
2300
|
{ label: (0, import_i18n14.__)("Center center", "elementor"), value: "center center" },
|
|
@@ -2238,82 +2320,82 @@ var BackgroundImageOverlayPosition = () => {
|
|
|
2238
2320
|
stringPropContext.setValue(value);
|
|
2239
2321
|
}
|
|
2240
2322
|
};
|
|
2241
|
-
return /* @__PURE__ */
|
|
2242
|
-
|
|
2323
|
+
return /* @__PURE__ */ React40.createElement(import_ui33.Grid, { container: true, spacing: 1.5 }, /* @__PURE__ */ React40.createElement(import_ui33.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React40.createElement(PopoverGridContainer, null, /* @__PURE__ */ React40.createElement(import_ui33.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React40.createElement(ControlFormLabel, null, (0, import_i18n14.__)("Position", "elementor"))), /* @__PURE__ */ React40.createElement(import_ui33.Grid, { item: true, xs: 6, sx: { display: "flex", justifyContent: "flex-end", overflow: "hidden" } }, /* @__PURE__ */ React40.createElement(
|
|
2324
|
+
import_ui33.Select,
|
|
2243
2325
|
{
|
|
2244
2326
|
size: "tiny",
|
|
2245
2327
|
value: (backgroundImageOffsetContext.value ? "custom" : stringPropContext.value) ?? "",
|
|
2246
2328
|
onChange: handlePositionChange,
|
|
2247
2329
|
fullWidth: true
|
|
2248
2330
|
},
|
|
2249
|
-
backgroundPositionOptions.map(({ label, value }) => /* @__PURE__ */
|
|
2250
|
-
)))), isCustom ? /* @__PURE__ */
|
|
2331
|
+
backgroundPositionOptions.map(({ label, value }) => /* @__PURE__ */ React40.createElement(import_editor_ui4.MenuListItem, { key: value, value: value ?? "" }, label))
|
|
2332
|
+
)))), isCustom ? /* @__PURE__ */ React40.createElement(PropProvider, { ...backgroundImageOffsetContext }, /* @__PURE__ */ React40.createElement(import_ui33.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React40.createElement(import_ui33.Grid, { container: true, spacing: 1.5 }, /* @__PURE__ */ React40.createElement(import_ui33.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React40.createElement(PropKeyProvider, { bind: "x" }, /* @__PURE__ */ React40.createElement(SizeControl, { startIcon: /* @__PURE__ */ React40.createElement(import_icons11.LetterXIcon, { fontSize: "tiny" }) }))), /* @__PURE__ */ React40.createElement(import_ui33.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React40.createElement(PropKeyProvider, { bind: "y" }, /* @__PURE__ */ React40.createElement(SizeControl, { startIcon: /* @__PURE__ */ React40.createElement(import_icons11.LetterYIcon, { fontSize: "tiny" }) })))))) : null);
|
|
2251
2333
|
};
|
|
2252
2334
|
|
|
2253
2335
|
// src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-repeat.tsx
|
|
2254
|
-
var
|
|
2336
|
+
var React41 = __toESM(require("react"));
|
|
2255
2337
|
var import_icons12 = require("@elementor/icons");
|
|
2256
|
-
var
|
|
2338
|
+
var import_ui34 = require("@elementor/ui");
|
|
2257
2339
|
var import_i18n15 = require("@wordpress/i18n");
|
|
2258
2340
|
var repeatControlOptions = [
|
|
2259
2341
|
{
|
|
2260
2342
|
value: "repeat",
|
|
2261
2343
|
label: (0, import_i18n15.__)("Repeat", "elementor"),
|
|
2262
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2344
|
+
renderContent: ({ size }) => /* @__PURE__ */ React41.createElement(import_icons12.GridDotsIcon, { fontSize: size }),
|
|
2263
2345
|
showTooltip: true
|
|
2264
2346
|
},
|
|
2265
2347
|
{
|
|
2266
2348
|
value: "repeat-x",
|
|
2267
2349
|
label: (0, import_i18n15.__)("Repeat-x", "elementor"),
|
|
2268
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2350
|
+
renderContent: ({ size }) => /* @__PURE__ */ React41.createElement(import_icons12.DotsHorizontalIcon, { fontSize: size }),
|
|
2269
2351
|
showTooltip: true
|
|
2270
2352
|
},
|
|
2271
2353
|
{
|
|
2272
2354
|
value: "repeat-y",
|
|
2273
2355
|
label: (0, import_i18n15.__)("Repeat-y", "elementor"),
|
|
2274
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2356
|
+
renderContent: ({ size }) => /* @__PURE__ */ React41.createElement(import_icons12.DotsVerticalIcon, { fontSize: size }),
|
|
2275
2357
|
showTooltip: true
|
|
2276
2358
|
},
|
|
2277
2359
|
{
|
|
2278
2360
|
value: "no-repeat",
|
|
2279
2361
|
label: (0, import_i18n15.__)("No-repeat", "elementor"),
|
|
2280
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2362
|
+
renderContent: ({ size }) => /* @__PURE__ */ React41.createElement(import_icons12.XIcon, { fontSize: size }),
|
|
2281
2363
|
showTooltip: true
|
|
2282
2364
|
}
|
|
2283
2365
|
];
|
|
2284
2366
|
var BackgroundImageOverlayRepeat = () => {
|
|
2285
|
-
return /* @__PURE__ */
|
|
2367
|
+
return /* @__PURE__ */ React41.createElement(PopoverGridContainer, null, /* @__PURE__ */ React41.createElement(import_ui34.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React41.createElement(ControlFormLabel, null, (0, import_i18n15.__)("Repeat", "elementor"))), /* @__PURE__ */ React41.createElement(import_ui34.Grid, { item: true, xs: 6, sx: { display: "flex", justifyContent: "flex-end" } }, /* @__PURE__ */ React41.createElement(ToggleControl, { options: repeatControlOptions })));
|
|
2286
2368
|
};
|
|
2287
2369
|
|
|
2288
2370
|
// src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-size.tsx
|
|
2289
|
-
var
|
|
2371
|
+
var React42 = __toESM(require("react"));
|
|
2290
2372
|
var import_editor_props21 = require("@elementor/editor-props");
|
|
2291
2373
|
var import_icons13 = require("@elementor/icons");
|
|
2292
|
-
var
|
|
2374
|
+
var import_ui35 = require("@elementor/ui");
|
|
2293
2375
|
var import_i18n16 = require("@wordpress/i18n");
|
|
2294
2376
|
var sizeControlOptions = [
|
|
2295
2377
|
{
|
|
2296
2378
|
value: "auto",
|
|
2297
2379
|
label: (0, import_i18n16.__)("Auto", "elementor"),
|
|
2298
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2380
|
+
renderContent: ({ size }) => /* @__PURE__ */ React42.createElement(import_icons13.LetterAIcon, { fontSize: size }),
|
|
2299
2381
|
showTooltip: true
|
|
2300
2382
|
},
|
|
2301
2383
|
{
|
|
2302
2384
|
value: "cover",
|
|
2303
2385
|
label: (0, import_i18n16.__)("Cover", "elementor"),
|
|
2304
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2386
|
+
renderContent: ({ size }) => /* @__PURE__ */ React42.createElement(import_icons13.ArrowsMaximizeIcon, { fontSize: size }),
|
|
2305
2387
|
showTooltip: true
|
|
2306
2388
|
},
|
|
2307
2389
|
{
|
|
2308
2390
|
value: "contain",
|
|
2309
2391
|
label: (0, import_i18n16.__)("Contain", "elementor"),
|
|
2310
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2392
|
+
renderContent: ({ size }) => /* @__PURE__ */ React42.createElement(import_icons13.ArrowBarBothIcon, { fontSize: size }),
|
|
2311
2393
|
showTooltip: true
|
|
2312
2394
|
},
|
|
2313
2395
|
{
|
|
2314
2396
|
value: "custom",
|
|
2315
2397
|
label: (0, import_i18n16.__)("Custom", "elementor"),
|
|
2316
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2398
|
+
renderContent: ({ size }) => /* @__PURE__ */ React42.createElement(import_icons13.PencilIcon, { fontSize: size }),
|
|
2317
2399
|
showTooltip: true
|
|
2318
2400
|
}
|
|
2319
2401
|
];
|
|
@@ -2328,7 +2410,7 @@ var BackgroundImageOverlaySize = () => {
|
|
|
2328
2410
|
stringPropContext.setValue(size);
|
|
2329
2411
|
}
|
|
2330
2412
|
};
|
|
2331
|
-
return /* @__PURE__ */
|
|
2413
|
+
return /* @__PURE__ */ React42.createElement(import_ui35.Grid, { container: true, spacing: 1.5 }, /* @__PURE__ */ React42.createElement(import_ui35.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React42.createElement(PopoverGridContainer, null, /* @__PURE__ */ React42.createElement(import_ui35.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React42.createElement(ControlFormLabel, null, (0, import_i18n16.__)("Size", "elementor"))), /* @__PURE__ */ React42.createElement(import_ui35.Grid, { item: true, xs: 6, sx: { display: "flex", justifyContent: "flex-end" } }, /* @__PURE__ */ React42.createElement(
|
|
2332
2414
|
ControlToggleButtonGroup,
|
|
2333
2415
|
{
|
|
2334
2416
|
exclusive: true,
|
|
@@ -2336,25 +2418,25 @@ var BackgroundImageOverlaySize = () => {
|
|
|
2336
2418
|
value: backgroundImageScaleContext.value ? "custom" : stringPropContext.value,
|
|
2337
2419
|
onChange: handleSizeChange
|
|
2338
2420
|
}
|
|
2339
|
-
)))), isCustom ? /* @__PURE__ */
|
|
2421
|
+
)))), isCustom ? /* @__PURE__ */ React42.createElement(PropProvider, { ...backgroundImageScaleContext }, /* @__PURE__ */ React42.createElement(import_ui35.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React42.createElement(PopoverGridContainer, null, /* @__PURE__ */ React42.createElement(import_ui35.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React42.createElement(PropKeyProvider, { bind: "width" }, /* @__PURE__ */ React42.createElement(
|
|
2340
2422
|
SizeControl,
|
|
2341
2423
|
{
|
|
2342
|
-
startIcon: /* @__PURE__ */
|
|
2424
|
+
startIcon: /* @__PURE__ */ React42.createElement(import_icons13.ArrowsMoveHorizontalIcon, { fontSize: "tiny" }),
|
|
2343
2425
|
extendedValues: ["auto"]
|
|
2344
2426
|
}
|
|
2345
|
-
))), /* @__PURE__ */
|
|
2427
|
+
))), /* @__PURE__ */ React42.createElement(import_ui35.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React42.createElement(PropKeyProvider, { bind: "height" }, /* @__PURE__ */ React42.createElement(
|
|
2346
2428
|
SizeControl,
|
|
2347
2429
|
{
|
|
2348
|
-
startIcon: /* @__PURE__ */
|
|
2430
|
+
startIcon: /* @__PURE__ */ React42.createElement(import_icons13.ArrowsMoveVerticalIcon, { fontSize: "tiny" }),
|
|
2349
2431
|
extendedValues: ["auto"]
|
|
2350
2432
|
}
|
|
2351
2433
|
)))))) : null);
|
|
2352
2434
|
};
|
|
2353
2435
|
|
|
2354
2436
|
// src/controls/background-control/background-overlay/use-background-tabs-history.ts
|
|
2355
|
-
var
|
|
2437
|
+
var import_react15 = require("react");
|
|
2356
2438
|
var import_editor_props22 = require("@elementor/editor-props");
|
|
2357
|
-
var
|
|
2439
|
+
var import_ui36 = require("@elementor/ui");
|
|
2358
2440
|
var useBackgroundTabsHistory = ({
|
|
2359
2441
|
color: initialBackgroundColorOverlay2,
|
|
2360
2442
|
image: initialBackgroundImageOverlay,
|
|
@@ -2372,8 +2454,8 @@ var useBackgroundTabsHistory = ({
|
|
|
2372
2454
|
}
|
|
2373
2455
|
return "image";
|
|
2374
2456
|
};
|
|
2375
|
-
const { getTabsProps, getTabProps, getTabPanelProps } = (0,
|
|
2376
|
-
const valuesHistory = (0,
|
|
2457
|
+
const { getTabsProps, getTabProps, getTabPanelProps } = (0, import_ui36.useTabs)(getCurrentOverlayType());
|
|
2458
|
+
const valuesHistory = (0, import_react15.useRef)({
|
|
2377
2459
|
image: initialBackgroundImageOverlay,
|
|
2378
2460
|
color: initialBackgroundColorOverlay2,
|
|
2379
2461
|
gradient: initialBackgroundGradientOverlay2
|
|
@@ -2448,7 +2530,7 @@ var backgroundResolutionOptions = [
|
|
|
2448
2530
|
];
|
|
2449
2531
|
var BackgroundOverlayRepeaterControl = createControl(() => {
|
|
2450
2532
|
const { propType, value: overlayValues, setValue } = useBoundProp(import_editor_props23.backgroundOverlayPropTypeUtil);
|
|
2451
|
-
return /* @__PURE__ */
|
|
2533
|
+
return /* @__PURE__ */ React43.createElement(PropProvider, { propType, value: overlayValues, setValue }, /* @__PURE__ */ React43.createElement(
|
|
2452
2534
|
Repeater,
|
|
2453
2535
|
{
|
|
2454
2536
|
openOnAdd: true,
|
|
@@ -2465,7 +2547,7 @@ var BackgroundOverlayRepeaterControl = createControl(() => {
|
|
|
2465
2547
|
));
|
|
2466
2548
|
});
|
|
2467
2549
|
var ItemContent2 = ({ bind }) => {
|
|
2468
|
-
return /* @__PURE__ */
|
|
2550
|
+
return /* @__PURE__ */ React43.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React43.createElement(Content2, null));
|
|
2469
2551
|
};
|
|
2470
2552
|
var Content2 = () => {
|
|
2471
2553
|
const { getTabsProps, getTabProps, getTabPanelProps } = useBackgroundTabsHistory({
|
|
@@ -2473,27 +2555,27 @@ var Content2 = () => {
|
|
|
2473
2555
|
color: initialBackgroundColorOverlay.value,
|
|
2474
2556
|
gradient: initialBackgroundGradientOverlay.value
|
|
2475
2557
|
});
|
|
2476
|
-
return /* @__PURE__ */
|
|
2477
|
-
|
|
2558
|
+
return /* @__PURE__ */ React43.createElement(import_ui37.Box, { sx: { width: "100%" } }, /* @__PURE__ */ React43.createElement(import_ui37.Box, { sx: { borderBottom: 1, borderColor: "divider" } }, /* @__PURE__ */ React43.createElement(
|
|
2559
|
+
import_ui37.Tabs,
|
|
2478
2560
|
{
|
|
2479
2561
|
size: "small",
|
|
2480
2562
|
variant: "fullWidth",
|
|
2481
2563
|
...getTabsProps(),
|
|
2482
2564
|
"aria-label": (0, import_i18n17.__)("Background Overlay", "elementor")
|
|
2483
2565
|
},
|
|
2484
|
-
/* @__PURE__ */
|
|
2485
|
-
/* @__PURE__ */
|
|
2486
|
-
/* @__PURE__ */
|
|
2487
|
-
)), /* @__PURE__ */
|
|
2566
|
+
/* @__PURE__ */ React43.createElement(import_ui37.Tab, { label: (0, import_i18n17.__)("Image", "elementor"), ...getTabProps("image") }),
|
|
2567
|
+
/* @__PURE__ */ React43.createElement(import_ui37.Tab, { label: (0, import_i18n17.__)("Gradient", "elementor"), ...getTabProps("gradient") }),
|
|
2568
|
+
/* @__PURE__ */ React43.createElement(import_ui37.Tab, { label: (0, import_i18n17.__)("Color", "elementor"), ...getTabProps("color") })
|
|
2569
|
+
)), /* @__PURE__ */ React43.createElement(import_ui37.TabPanel, { sx: { p: 1.5 }, ...getTabPanelProps("image") }, /* @__PURE__ */ React43.createElement(PopoverContent, null, /* @__PURE__ */ React43.createElement(ImageOverlayContent, null))), /* @__PURE__ */ React43.createElement(import_ui37.TabPanel, { sx: { p: 1.5 }, ...getTabPanelProps("gradient") }, /* @__PURE__ */ React43.createElement(BackgroundGradientColorControl, null)), /* @__PURE__ */ React43.createElement(import_ui37.TabPanel, { sx: { p: 1.5 }, ...getTabPanelProps("color") }, /* @__PURE__ */ React43.createElement(PopoverContent, null, /* @__PURE__ */ React43.createElement(ColorOverlayContent, null))));
|
|
2488
2570
|
};
|
|
2489
2571
|
var ItemIcon2 = ({ value }) => {
|
|
2490
2572
|
switch (value.$$type) {
|
|
2491
2573
|
case "background-image-overlay":
|
|
2492
|
-
return /* @__PURE__ */
|
|
2574
|
+
return /* @__PURE__ */ React43.createElement(ItemIconImage, { value });
|
|
2493
2575
|
case "background-color-overlay":
|
|
2494
|
-
return /* @__PURE__ */
|
|
2576
|
+
return /* @__PURE__ */ React43.createElement(ItemIconColor, { value });
|
|
2495
2577
|
case "background-gradient-overlay":
|
|
2496
|
-
return /* @__PURE__ */
|
|
2578
|
+
return /* @__PURE__ */ React43.createElement(ItemIconGradient, { value });
|
|
2497
2579
|
default:
|
|
2498
2580
|
return null;
|
|
2499
2581
|
}
|
|
@@ -2506,62 +2588,76 @@ var extractColorFrom = (prop) => {
|
|
|
2506
2588
|
};
|
|
2507
2589
|
var ItemIconColor = ({ value: prop }) => {
|
|
2508
2590
|
const color = extractColorFrom(prop);
|
|
2509
|
-
return /* @__PURE__ */
|
|
2591
|
+
return /* @__PURE__ */ React43.createElement(StyledUnstableColorIndicator, { size: "inherit", component: "span", value: color });
|
|
2510
2592
|
};
|
|
2511
2593
|
var ItemIconImage = ({ value }) => {
|
|
2512
2594
|
const { imageUrl } = useImage(value);
|
|
2513
|
-
return /* @__PURE__ */
|
|
2595
|
+
return /* @__PURE__ */ React43.createElement(
|
|
2596
|
+
import_ui37.CardMedia,
|
|
2597
|
+
{
|
|
2598
|
+
image: imageUrl,
|
|
2599
|
+
sx: (theme) => ({
|
|
2600
|
+
height: "1em",
|
|
2601
|
+
width: "1em",
|
|
2602
|
+
borderRadius: `${theme.shape.borderRadius / 2}px`,
|
|
2603
|
+
outline: `1px solid ${theme.palette.action.disabled}`
|
|
2604
|
+
})
|
|
2605
|
+
}
|
|
2606
|
+
);
|
|
2514
2607
|
};
|
|
2515
2608
|
var ItemIconGradient = ({ value }) => {
|
|
2516
2609
|
const gradient = getGradientValue(value);
|
|
2517
|
-
return /* @__PURE__ */
|
|
2610
|
+
return /* @__PURE__ */ React43.createElement(StyledUnstableColorIndicator, { size: "inherit", component: "span", value: gradient });
|
|
2518
2611
|
};
|
|
2519
2612
|
var ItemLabel2 = ({ value }) => {
|
|
2520
2613
|
switch (value.$$type) {
|
|
2521
2614
|
case "background-image-overlay":
|
|
2522
|
-
return /* @__PURE__ */
|
|
2615
|
+
return /* @__PURE__ */ React43.createElement(ItemLabelImage, { value });
|
|
2523
2616
|
case "background-color-overlay":
|
|
2524
|
-
return /* @__PURE__ */
|
|
2617
|
+
return /* @__PURE__ */ React43.createElement(ItemLabelColor, { value });
|
|
2525
2618
|
case "background-gradient-overlay":
|
|
2526
|
-
return /* @__PURE__ */
|
|
2619
|
+
return /* @__PURE__ */ React43.createElement(ItemLabelGradient, { value });
|
|
2527
2620
|
default:
|
|
2528
2621
|
return null;
|
|
2529
2622
|
}
|
|
2530
2623
|
};
|
|
2531
2624
|
var ItemLabelColor = ({ value: prop }) => {
|
|
2532
2625
|
const color = extractColorFrom(prop);
|
|
2533
|
-
return /* @__PURE__ */
|
|
2626
|
+
return /* @__PURE__ */ React43.createElement("span", null, color);
|
|
2534
2627
|
};
|
|
2535
2628
|
var ItemLabelImage = ({ value }) => {
|
|
2536
2629
|
const { imageTitle } = useImage(value);
|
|
2537
|
-
return /* @__PURE__ */
|
|
2630
|
+
return /* @__PURE__ */ React43.createElement("span", null, imageTitle);
|
|
2538
2631
|
};
|
|
2539
2632
|
var ItemLabelGradient = ({ value }) => {
|
|
2540
2633
|
if (value.value.type.value === "linear") {
|
|
2541
|
-
return /* @__PURE__ */
|
|
2634
|
+
return /* @__PURE__ */ React43.createElement("span", null, (0, import_i18n17.__)("Linear Gradient", "elementor"));
|
|
2542
2635
|
}
|
|
2543
|
-
return /* @__PURE__ */
|
|
2636
|
+
return /* @__PURE__ */ React43.createElement("span", null, (0, import_i18n17.__)("Radial Gradient", "elementor"));
|
|
2544
2637
|
};
|
|
2545
2638
|
var ColorOverlayContent = () => {
|
|
2546
2639
|
const propContext = useBoundProp(import_editor_props23.backgroundColorOverlayPropTypeUtil);
|
|
2547
|
-
return /* @__PURE__ */
|
|
2640
|
+
return /* @__PURE__ */ React43.createElement(PropProvider, { ...propContext }, /* @__PURE__ */ React43.createElement(PropKeyProvider, { bind: "color" }, /* @__PURE__ */ React43.createElement(ColorControl, null)));
|
|
2548
2641
|
};
|
|
2549
2642
|
var ImageOverlayContent = () => {
|
|
2550
2643
|
const propContext = useBoundProp(import_editor_props23.backgroundImageOverlayPropTypeUtil);
|
|
2551
|
-
return /* @__PURE__ */
|
|
2644
|
+
return /* @__PURE__ */ React43.createElement(PropProvider, { ...propContext }, /* @__PURE__ */ React43.createElement(PropKeyProvider, { bind: "image" }, /* @__PURE__ */ React43.createElement(import_ui37.Grid, { container: true, spacing: 1, alignItems: "center" }, /* @__PURE__ */ React43.createElement(import_ui37.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React43.createElement(
|
|
2552
2645
|
ImageControl,
|
|
2553
2646
|
{
|
|
2554
2647
|
resolutionLabel: (0, import_i18n17.__)("Resolution", "elementor"),
|
|
2555
2648
|
sizes: backgroundResolutionOptions
|
|
2556
2649
|
}
|
|
2557
|
-
)))), /* @__PURE__ */
|
|
2650
|
+
)))), /* @__PURE__ */ React43.createElement(PropKeyProvider, { bind: "position" }, /* @__PURE__ */ React43.createElement(BackgroundImageOverlayPosition, null)), /* @__PURE__ */ React43.createElement(PropKeyProvider, { bind: "repeat" }, /* @__PURE__ */ React43.createElement(BackgroundImageOverlayRepeat, null)), /* @__PURE__ */ React43.createElement(PropKeyProvider, { bind: "size" }, /* @__PURE__ */ React43.createElement(BackgroundImageOverlaySize, null)), /* @__PURE__ */ React43.createElement(PropKeyProvider, { bind: "attachment" }, /* @__PURE__ */ React43.createElement(BackgroundImageOverlayAttachment, null)));
|
|
2558
2651
|
};
|
|
2652
|
+
var StyledUnstableColorIndicator = (0, import_ui37.styled)(import_ui37.UnstableColorIndicator)(({ theme }) => ({
|
|
2653
|
+
borderRadius: `${theme.shape.borderRadius / 2}px`
|
|
2654
|
+
}));
|
|
2559
2655
|
var useImage = (image) => {
|
|
2560
2656
|
let imageTitle, imageUrl = null;
|
|
2561
2657
|
const imageSrc = image?.value.image.value?.src.value;
|
|
2562
2658
|
const { data: attachment } = (0, import_wp_media3.useWpMediaAttachment)(imageSrc.id?.value || null);
|
|
2563
2659
|
if (imageSrc.id) {
|
|
2564
|
-
const imageFileTypeExtension = attachment?.
|
|
2660
|
+
const imageFileTypeExtension = getFileExtensionFromFilename(attachment?.filename);
|
|
2565
2661
|
imageTitle = `${attachment?.title}${imageFileTypeExtension}` || null;
|
|
2566
2662
|
imageUrl = attachment?.url || null;
|
|
2567
2663
|
} else if (imageSrc.url) {
|
|
@@ -2570,6 +2666,13 @@ var useImage = (image) => {
|
|
|
2570
2666
|
}
|
|
2571
2667
|
return { imageTitle, imageUrl };
|
|
2572
2668
|
};
|
|
2669
|
+
var getFileExtensionFromFilename = (filename) => {
|
|
2670
|
+
if (!filename) {
|
|
2671
|
+
return "";
|
|
2672
|
+
}
|
|
2673
|
+
const extension = filename.substring(filename.lastIndexOf(".") + 1);
|
|
2674
|
+
return `.${extension}`;
|
|
2675
|
+
};
|
|
2573
2676
|
var getGradientValue = (value) => {
|
|
2574
2677
|
const gradient = value.value;
|
|
2575
2678
|
const stops = gradient.stops.value?.map(({ value: { color, offset } }) => `${color.value} ${offset.value ?? 0}%`)?.join(",");
|
|
@@ -2582,28 +2685,8 @@ var getGradientValue = (value) => {
|
|
|
2582
2685
|
// src/controls/background-control/background-control.tsx
|
|
2583
2686
|
var BackgroundControl = createControl(() => {
|
|
2584
2687
|
const propContext = useBoundProp(import_editor_props24.backgroundPropTypeUtil);
|
|
2585
|
-
return /* @__PURE__ */
|
|
2688
|
+
return /* @__PURE__ */ React44.createElement(PropProvider, { ...propContext }, /* @__PURE__ */ React44.createElement(SectionContent, null, /* @__PURE__ */ React44.createElement(PropKeyProvider, { bind: "background-overlay" }, /* @__PURE__ */ React44.createElement(BackgroundOverlayRepeaterControl, null)), /* @__PURE__ */ React44.createElement(PropKeyProvider, { bind: "color" }, /* @__PURE__ */ React44.createElement(import_ui38.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React44.createElement(import_ui38.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React44.createElement(ControlFormLabel, null, (0, import_i18n18.__)("Color", "elementor"))), /* @__PURE__ */ React44.createElement(import_ui38.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React44.createElement(ColorControl, null))))));
|
|
2586
2689
|
});
|
|
2587
|
-
|
|
2588
|
-
// src/control-adornments/control-adornments-context.tsx
|
|
2589
|
-
var React42 = __toESM(require("react"));
|
|
2590
|
-
var import_react15 = require("react");
|
|
2591
|
-
var Context2 = (0, import_react15.createContext)(null);
|
|
2592
|
-
var ControlAdornmentsProvider = ({ children, items }) => /* @__PURE__ */ React42.createElement(Context2.Provider, { value: { items } }, children);
|
|
2593
|
-
var useControlAdornments = () => {
|
|
2594
|
-
const context = (0, import_react15.useContext)(Context2);
|
|
2595
|
-
return context?.items ?? [];
|
|
2596
|
-
};
|
|
2597
|
-
|
|
2598
|
-
// src/control-adornments/control-adornments.tsx
|
|
2599
|
-
var React43 = __toESM(require("react"));
|
|
2600
|
-
function ControlAdornments() {
|
|
2601
|
-
const items = useControlAdornments();
|
|
2602
|
-
if (items?.length === 0) {
|
|
2603
|
-
return null;
|
|
2604
|
-
}
|
|
2605
|
-
return /* @__PURE__ */ React43.createElement(React43.Fragment, null, items.map(({ Adornment, id }) => /* @__PURE__ */ React43.createElement(Adornment, { key: id })));
|
|
2606
|
-
}
|
|
2607
2690
|
// Annotate the CommonJS export names for ESM import in node:
|
|
2608
2691
|
0 && (module.exports = {
|
|
2609
2692
|
BackgroundControl,
|
|
@@ -2612,7 +2695,7 @@ function ControlAdornments() {
|
|
|
2612
2695
|
ControlActionsProvider,
|
|
2613
2696
|
ControlAdornments,
|
|
2614
2697
|
ControlAdornmentsProvider,
|
|
2615
|
-
|
|
2698
|
+
ControlFormLabel,
|
|
2616
2699
|
ControlReplacementProvider,
|
|
2617
2700
|
ControlToggleButtonGroup,
|
|
2618
2701
|
EqualUnequalSizesControl,
|