@elementor/editor-controls 0.19.1 → 0.21.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 +27 -0
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +304 -294
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +240 -230
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -2
- package/src/components/control-form-label.tsx +6 -0
- package/src/components/control-label.tsx +12 -3
- package/src/components/repeater.tsx +9 -2
- package/src/components/text-field-inner-selection.tsx +4 -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 +6 -5
- 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 +18 -4
- package/src/controls/color-control.tsx +1 -1
- package/src/controls/equal-unequal-sizes-control.tsx +3 -1
- package/src/controls/font-family-control/font-family-control.tsx +4 -3
- package/src/controls/gap-control.tsx +3 -2
- package/src/controls/image-control.tsx +3 -3
- package/src/controls/link-control.tsx +6 -6
- package/src/controls/linked-dimensions-control.tsx +7 -6
- package/src/controls/select-control.tsx +4 -3
- package/src/controls/stroke-control.tsx +2 -2
- package/src/controls/svg-media-control.tsx +2 -2
- package/src/hooks/use-sync-external-state.tsx +1 -0
- package/src/index.ts +2 -1
- package/src/control-adornments/control-label-with-adornments.tsx +0 -15
- package/src/utils/link-restriction.ts +0 -47
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
|
|
|
@@ -350,7 +350,7 @@ function ControlActions({ children }) {
|
|
|
350
350
|
if (items.length === 0) {
|
|
351
351
|
return children;
|
|
352
352
|
}
|
|
353
|
-
const menuItems = items.map(({ MenuItem
|
|
353
|
+
const menuItems = items.map(({ MenuItem, id }) => /* @__PURE__ */ React7.createElement(MenuItem, { key: id }));
|
|
354
354
|
return /* @__PURE__ */ React7.createElement(FloatingBarContainer, null, /* @__PURE__ */ React7.createElement(import_ui3.UnstableFloatingActionBar, { actions: menuItems }, children));
|
|
355
355
|
}
|
|
356
356
|
|
|
@@ -399,6 +399,7 @@ var ImageMediaControl = createControl(({ mediaTypes = ["image"] }) => {
|
|
|
399
399
|
// src/controls/select-control.tsx
|
|
400
400
|
var React9 = __toESM(require("react"));
|
|
401
401
|
var import_editor_props2 = require("@elementor/editor-props");
|
|
402
|
+
var import_editor_ui = require("@elementor/editor-ui");
|
|
402
403
|
var import_ui5 = require("@elementor/ui");
|
|
403
404
|
var SelectControl = createControl(({ options, onChange }) => {
|
|
404
405
|
const { value, setValue } = useBoundProp(import_editor_props2.stringPropTypeUtil);
|
|
@@ -417,7 +418,7 @@ var SelectControl = createControl(({ options, onChange }) => {
|
|
|
417
418
|
onChange: handleChange,
|
|
418
419
|
fullWidth: true
|
|
419
420
|
},
|
|
420
|
-
options.map(({ label, ...props }) => /* @__PURE__ */ React9.createElement(
|
|
421
|
+
options.map(({ label, ...props }) => /* @__PURE__ */ React9.createElement(import_editor_ui.MenuListItem, { key: props.value, ...props, value: props.value ?? "" }, label))
|
|
421
422
|
));
|
|
422
423
|
});
|
|
423
424
|
|
|
@@ -427,7 +428,7 @@ var ImageControl = createControl(
|
|
|
427
428
|
const propContext = useBoundProp(import_editor_props3.imagePropTypeUtil);
|
|
428
429
|
const { data: allowSvgUpload } = useUnfilteredFilesUpload();
|
|
429
430
|
const mediaTypes = allowSvgUpload ? ["image", "svg"] : ["image"];
|
|
430
|
-
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 }))))));
|
|
431
432
|
}
|
|
432
433
|
);
|
|
433
434
|
|
|
@@ -481,6 +482,7 @@ var import_ui10 = require("@elementor/ui");
|
|
|
481
482
|
// src/components/text-field-inner-selection.tsx
|
|
482
483
|
var React13 = __toESM(require("react"));
|
|
483
484
|
var import_react5 = require("react");
|
|
485
|
+
var import_editor_ui2 = require("@elementor/editor-ui");
|
|
484
486
|
var import_ui9 = require("@elementor/ui");
|
|
485
487
|
var TextFieldInnerSelection = (0, import_react5.forwardRef)(
|
|
486
488
|
({ placeholder, type, value, onChange, endAdornment, startAdornment }, ref) => {
|
|
@@ -524,7 +526,7 @@ var SelectionEndAdornment = ({
|
|
|
524
526
|
...(0, import_ui9.bindTrigger)(popupState)
|
|
525
527
|
},
|
|
526
528
|
value.toUpperCase()
|
|
527
|
-
), /* @__PURE__ */ React13.createElement(import_ui9.Menu, { MenuListProps: { dense: true }, ...(0, import_ui9.bindMenu)(popupState) }, options.map((option, index) => /* @__PURE__ */ React13.createElement(
|
|
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()))));
|
|
528
530
|
};
|
|
529
531
|
|
|
530
532
|
// src/hooks/use-sync-external-state.tsx
|
|
@@ -670,7 +672,7 @@ var import_ui12 = require("@elementor/ui");
|
|
|
670
672
|
var ColorControl = createControl(({ propTypeUtil = import_editor_props7.colorPropTypeUtil, ...props }) => {
|
|
671
673
|
const { value, setValue } = useBoundProp(propTypeUtil);
|
|
672
674
|
const handleChange = (selectedColor) => {
|
|
673
|
-
setValue(selectedColor);
|
|
675
|
+
setValue(selectedColor || null);
|
|
674
676
|
};
|
|
675
677
|
return /* @__PURE__ */ React16.createElement(ControlActions, null, /* @__PURE__ */ React16.createElement(import_ui12.UnstableColorField, { size: "tiny", ...props, value: value ?? "", onChange: handleChange, fullWidth: true }));
|
|
676
678
|
});
|
|
@@ -681,10 +683,10 @@ var StrokeControl = createControl(() => {
|
|
|
681
683
|
const propContext = useBoundProp(import_editor_props8.strokePropTypeUtil);
|
|
682
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))));
|
|
683
685
|
});
|
|
684
|
-
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)));
|
|
685
687
|
|
|
686
688
|
// src/controls/box-shadow-repeater-control.tsx
|
|
687
|
-
var
|
|
689
|
+
var React24 = __toESM(require("react"));
|
|
688
690
|
var import_editor_props9 = require("@elementor/editor-props");
|
|
689
691
|
var import_ui18 = require("@elementor/ui");
|
|
690
692
|
var import_i18n5 = require("@wordpress/i18n");
|
|
@@ -705,21 +707,43 @@ var PopoverGridContainer = ({
|
|
|
705
707
|
}) => /* @__PURE__ */ React19.createElement(import_ui15.Grid, { container: true, gap, alignItems, flexWrap }, children);
|
|
706
708
|
|
|
707
709
|
// src/components/repeater.tsx
|
|
708
|
-
var
|
|
709
|
-
var
|
|
710
|
+
var React23 = __toESM(require("react"));
|
|
711
|
+
var import_react8 = require("react");
|
|
710
712
|
var import_icons3 = require("@elementor/icons");
|
|
711
713
|
var import_ui17 = require("@elementor/ui");
|
|
712
714
|
var import_i18n4 = require("@wordpress/i18n");
|
|
713
715
|
|
|
714
|
-
// src/
|
|
716
|
+
// src/control-adornments/control-adornments.tsx
|
|
717
|
+
var React21 = __toESM(require("react"));
|
|
718
|
+
|
|
719
|
+
// src/control-adornments/control-adornments-context.tsx
|
|
715
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"));
|
|
716
740
|
var import_icons2 = require("@elementor/icons");
|
|
717
741
|
var import_ui16 = require("@elementor/ui");
|
|
718
742
|
var SortableProvider = (props) => {
|
|
719
|
-
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 }));
|
|
720
744
|
};
|
|
721
745
|
var SortableItem = ({ id, children }) => {
|
|
722
|
-
return /* @__PURE__ */
|
|
746
|
+
return /* @__PURE__ */ React22.createElement(
|
|
723
747
|
import_ui16.UnstableSortableItem,
|
|
724
748
|
{
|
|
725
749
|
id,
|
|
@@ -732,16 +756,16 @@ var SortableItem = ({ id, children }) => {
|
|
|
732
756
|
showDropIndication,
|
|
733
757
|
dropIndicationStyle
|
|
734
758
|
}) => {
|
|
735
|
-
return /* @__PURE__ */
|
|
759
|
+
return /* @__PURE__ */ React22.createElement(
|
|
736
760
|
StyledListItem,
|
|
737
761
|
{
|
|
738
762
|
...itemProps,
|
|
739
763
|
style: itemStyle,
|
|
740
764
|
sx: { backgroundColor: isDragOverlay ? "background.paper" : void 0 }
|
|
741
765
|
},
|
|
742
|
-
/* @__PURE__ */
|
|
766
|
+
/* @__PURE__ */ React22.createElement(SortableTrigger, { ...triggerProps, style: triggerStyle }),
|
|
743
767
|
children,
|
|
744
|
-
showDropIndication && /* @__PURE__ */
|
|
768
|
+
showDropIndication && /* @__PURE__ */ React22.createElement(StyledDivider, { style: dropIndicationStyle })
|
|
745
769
|
);
|
|
746
770
|
}
|
|
747
771
|
}
|
|
@@ -771,7 +795,7 @@ var StyledListItem = (0, import_ui16.styled)(import_ui16.ListItem)`
|
|
|
771
795
|
}
|
|
772
796
|
}
|
|
773
797
|
`;
|
|
774
|
-
var SortableTrigger = (props) => /* @__PURE__ */
|
|
798
|
+
var SortableTrigger = (props) => /* @__PURE__ */ React22.createElement("div", { ...props, role: "button", className: "class-item-sortable-trigger" }, /* @__PURE__ */ React22.createElement(import_icons2.GripVerticalIcon, { fontSize: "tiny" }));
|
|
775
799
|
var StyledDivider = (0, import_ui16.styled)(import_ui16.Divider)`
|
|
776
800
|
height: 0px;
|
|
777
801
|
border: none;
|
|
@@ -799,14 +823,14 @@ var Repeater = ({
|
|
|
799
823
|
values: repeaterValues = [],
|
|
800
824
|
setValues: setRepeaterValues
|
|
801
825
|
}) => {
|
|
802
|
-
const [openItem, setOpenItem] = (0,
|
|
826
|
+
const [openItem, setOpenItem] = (0, import_react8.useState)(-1);
|
|
803
827
|
const [items, setItems] = useSyncExternalState({
|
|
804
828
|
external: repeaterValues,
|
|
805
829
|
// @ts-expect-error - as long as persistWhen => true, value will never be null
|
|
806
830
|
setExternal: setRepeaterValues,
|
|
807
831
|
persistWhen: () => true
|
|
808
832
|
});
|
|
809
|
-
const [uniqueKeys, setUniqueKeys] = (0,
|
|
833
|
+
const [uniqueKeys, setUniqueKeys] = (0, import_react8.useState)(items.map((_, index) => index));
|
|
810
834
|
const generateNextKey = (source) => {
|
|
811
835
|
return 1 + Math.max(0, ...source);
|
|
812
836
|
};
|
|
@@ -863,24 +887,33 @@ var Repeater = ({
|
|
|
863
887
|
});
|
|
864
888
|
});
|
|
865
889
|
};
|
|
866
|
-
return /* @__PURE__ */
|
|
890
|
+
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(
|
|
891
|
+
import_ui17.IconButton,
|
|
892
|
+
{
|
|
893
|
+
sx: { ml: "auto" },
|
|
894
|
+
size: SIZE,
|
|
895
|
+
onClick: addRepeaterItem,
|
|
896
|
+
"aria-label": (0, import_i18n4.__)("Add item", "elementor")
|
|
897
|
+
},
|
|
898
|
+
/* @__PURE__ */ React23.createElement(import_icons3.PlusIcon, { fontSize: SIZE })
|
|
899
|
+
)), 0 < uniqueKeys.length && /* @__PURE__ */ React23.createElement(SortableProvider, { value: uniqueKeys, onChange: onChangeOrder }, uniqueKeys.map((key, index) => {
|
|
867
900
|
const value = items[index];
|
|
868
901
|
if (!value) {
|
|
869
902
|
return null;
|
|
870
903
|
}
|
|
871
|
-
return /* @__PURE__ */
|
|
904
|
+
return /* @__PURE__ */ React23.createElement(SortableItem, { id: key, key: `sortable-${key}` }, /* @__PURE__ */ React23.createElement(
|
|
872
905
|
RepeaterItem,
|
|
873
906
|
{
|
|
874
907
|
bind: String(index),
|
|
875
908
|
disabled: value?.disabled,
|
|
876
|
-
label: /* @__PURE__ */
|
|
877
|
-
startIcon: /* @__PURE__ */
|
|
909
|
+
label: /* @__PURE__ */ React23.createElement(itemSettings.Label, { value }),
|
|
910
|
+
startIcon: /* @__PURE__ */ React23.createElement(itemSettings.Icon, { value }),
|
|
878
911
|
removeItem: () => removeRepeaterItem(index),
|
|
879
912
|
duplicateItem: () => duplicateRepeaterItem(index),
|
|
880
913
|
toggleDisableItem: () => toggleDisableRepeaterItem(index),
|
|
881
914
|
openOnMount: openOnAdd && openItem === key
|
|
882
915
|
},
|
|
883
|
-
(props) => /* @__PURE__ */
|
|
916
|
+
(props) => /* @__PURE__ */ React23.createElement(itemSettings.Content, { ...props, value, bind: String(index) })
|
|
884
917
|
));
|
|
885
918
|
})));
|
|
886
919
|
};
|
|
@@ -894,12 +927,12 @@ var RepeaterItem = ({
|
|
|
894
927
|
toggleDisableItem,
|
|
895
928
|
openOnMount
|
|
896
929
|
}) => {
|
|
897
|
-
const [anchorEl, setAnchorEl] = (0,
|
|
930
|
+
const [anchorEl, setAnchorEl] = (0, import_react8.useState)(null);
|
|
898
931
|
const { popoverState, popoverProps, ref, setRef } = usePopover(openOnMount);
|
|
899
932
|
const duplicateLabel = (0, import_i18n4.__)("Duplicate", "elementor");
|
|
900
933
|
const toggleLabel = disabled ? (0, import_i18n4.__)("Show", "elementor") : (0, import_i18n4.__)("Hide", "elementor");
|
|
901
934
|
const removeLabel = (0, import_i18n4.__)("Remove", "elementor");
|
|
902
|
-
return /* @__PURE__ */
|
|
935
|
+
return /* @__PURE__ */ React23.createElement(React23.Fragment, null, /* @__PURE__ */ React23.createElement(
|
|
903
936
|
import_ui17.UnstableTag,
|
|
904
937
|
{
|
|
905
938
|
label,
|
|
@@ -910,10 +943,10 @@ var RepeaterItem = ({
|
|
|
910
943
|
"aria-label": (0, import_i18n4.__)("Open item", "elementor"),
|
|
911
944
|
...(0, import_ui17.bindTrigger)(popoverState),
|
|
912
945
|
startIcon,
|
|
913
|
-
actions: /* @__PURE__ */
|
|
946
|
+
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 })))),
|
|
914
947
|
sx: { backgroundColor: "background.paper" }
|
|
915
948
|
}
|
|
916
|
-
), /* @__PURE__ */
|
|
949
|
+
), /* @__PURE__ */ React23.createElement(
|
|
917
950
|
import_ui17.Popover,
|
|
918
951
|
{
|
|
919
952
|
disablePortal: true,
|
|
@@ -927,14 +960,14 @@ var RepeaterItem = ({
|
|
|
927
960
|
...popoverProps,
|
|
928
961
|
anchorEl: ref
|
|
929
962
|
},
|
|
930
|
-
/* @__PURE__ */
|
|
963
|
+
/* @__PURE__ */ React23.createElement(import_ui17.Box, null, children({ anchorEl }))
|
|
931
964
|
));
|
|
932
965
|
};
|
|
933
966
|
var usePopover = (openOnMount) => {
|
|
934
|
-
const [ref, setRef] = (0,
|
|
967
|
+
const [ref, setRef] = (0, import_react8.useState)(null);
|
|
935
968
|
const popoverState = (0, import_ui17.usePopupState)({ variant: "popover" });
|
|
936
969
|
const popoverProps = (0, import_ui17.bindPopover)(popoverState);
|
|
937
|
-
(0,
|
|
970
|
+
(0, import_react8.useEffect)(() => {
|
|
938
971
|
if (openOnMount && ref) {
|
|
939
972
|
popoverState.open(ref);
|
|
940
973
|
}
|
|
@@ -950,7 +983,7 @@ var usePopover = (openOnMount) => {
|
|
|
950
983
|
// src/controls/box-shadow-repeater-control.tsx
|
|
951
984
|
var BoxShadowRepeaterControl = createControl(() => {
|
|
952
985
|
const { propType, value, setValue } = useBoundProp(import_editor_props9.boxShadowPropTypeUtil);
|
|
953
|
-
return /* @__PURE__ */
|
|
986
|
+
return /* @__PURE__ */ React24.createElement(PropProvider, { propType, value, setValue }, /* @__PURE__ */ React24.createElement(
|
|
954
987
|
Repeater,
|
|
955
988
|
{
|
|
956
989
|
openOnAdd: true,
|
|
@@ -966,13 +999,13 @@ var BoxShadowRepeaterControl = createControl(() => {
|
|
|
966
999
|
}
|
|
967
1000
|
));
|
|
968
1001
|
});
|
|
969
|
-
var ItemIcon = ({ value }) => /* @__PURE__ */
|
|
1002
|
+
var ItemIcon = ({ value }) => /* @__PURE__ */ React24.createElement(import_ui18.UnstableColorIndicator, { size: "inherit", component: "span", value: value.value.color.value });
|
|
970
1003
|
var ItemContent = ({ anchorEl, bind }) => {
|
|
971
|
-
return /* @__PURE__ */
|
|
1004
|
+
return /* @__PURE__ */ React24.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React24.createElement(Content, { anchorEl }));
|
|
972
1005
|
};
|
|
973
1006
|
var Content = ({ anchorEl }) => {
|
|
974
1007
|
const { propType, value, setValue } = useBoundProp(import_editor_props9.shadowPropTypeUtil);
|
|
975
|
-
return /* @__PURE__ */
|
|
1008
|
+
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(
|
|
976
1009
|
ColorControl,
|
|
977
1010
|
{
|
|
978
1011
|
slotProps: {
|
|
@@ -989,7 +1022,7 @@ var Content = ({ anchorEl }) => {
|
|
|
989
1022
|
}
|
|
990
1023
|
}
|
|
991
1024
|
}
|
|
992
|
-
)), /* @__PURE__ */
|
|
1025
|
+
)), /* @__PURE__ */ React24.createElement(Control2, { bind: "position", label: (0, import_i18n5.__)("Position", "elementor"), sx: { overflow: "hidden" } }, /* @__PURE__ */ React24.createElement(
|
|
993
1026
|
SelectControl,
|
|
994
1027
|
{
|
|
995
1028
|
options: [
|
|
@@ -997,14 +1030,14 @@ var Content = ({ anchorEl }) => {
|
|
|
997
1030
|
{ label: (0, import_i18n5.__)("Outset", "elementor"), value: null }
|
|
998
1031
|
]
|
|
999
1032
|
}
|
|
1000
|
-
))), /* @__PURE__ */
|
|
1033
|
+
))), /* @__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)))));
|
|
1001
1034
|
};
|
|
1002
1035
|
var Control2 = ({
|
|
1003
1036
|
label,
|
|
1004
1037
|
bind,
|
|
1005
1038
|
children,
|
|
1006
1039
|
sx
|
|
1007
|
-
}) => /* @__PURE__ */
|
|
1040
|
+
}) => /* @__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))));
|
|
1008
1041
|
var ItemLabel = ({ value }) => {
|
|
1009
1042
|
const { position, hOffset, vOffset, blur, spread } = value.value;
|
|
1010
1043
|
const { size: blurSize = "", unit: blurUnit = "" } = blur?.value || {};
|
|
@@ -1018,7 +1051,7 @@ var ItemLabel = ({ value }) => {
|
|
|
1018
1051
|
blurSize + blurUnit,
|
|
1019
1052
|
spreadSize + spreadUnit
|
|
1020
1053
|
].join(" ");
|
|
1021
|
-
return /* @__PURE__ */
|
|
1054
|
+
return /* @__PURE__ */ React24.createElement("span", { style: { textTransform: "capitalize" } }, positionLabel, ": ", sizes);
|
|
1022
1055
|
};
|
|
1023
1056
|
var initialShadow = {
|
|
1024
1057
|
$$type: "shadow",
|
|
@@ -1048,11 +1081,11 @@ var initialShadow = {
|
|
|
1048
1081
|
};
|
|
1049
1082
|
|
|
1050
1083
|
// src/controls/toggle-control.tsx
|
|
1051
|
-
var
|
|
1084
|
+
var React26 = __toESM(require("react"));
|
|
1052
1085
|
var import_editor_props10 = require("@elementor/editor-props");
|
|
1053
1086
|
|
|
1054
1087
|
// src/components/control-toggle-button-group.tsx
|
|
1055
|
-
var
|
|
1088
|
+
var React25 = __toESM(require("react"));
|
|
1056
1089
|
var import_ui19 = require("@elementor/ui");
|
|
1057
1090
|
var StyledToggleButtonGroup = (0, import_ui19.styled)(import_ui19.ToggleButtonGroup)`
|
|
1058
1091
|
${({ justify }) => `justify-content: ${justify};`}
|
|
@@ -1070,7 +1103,7 @@ var ControlToggleButtonGroup = ({
|
|
|
1070
1103
|
const handleChange = (_, newValue) => {
|
|
1071
1104
|
onChange(newValue);
|
|
1072
1105
|
};
|
|
1073
|
-
return /* @__PURE__ */
|
|
1106
|
+
return /* @__PURE__ */ React25.createElement(
|
|
1074
1107
|
StyledToggleButtonGroup,
|
|
1075
1108
|
{
|
|
1076
1109
|
justify,
|
|
@@ -1085,7 +1118,7 @@ var ControlToggleButtonGroup = ({
|
|
|
1085
1118
|
}
|
|
1086
1119
|
},
|
|
1087
1120
|
items.map(
|
|
1088
|
-
({ label, value: buttonValue, renderContent: Content3, showTooltip }) => showTooltip ? /* @__PURE__ */
|
|
1121
|
+
({ 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(
|
|
1089
1122
|
import_ui19.ToggleButton,
|
|
1090
1123
|
{
|
|
1091
1124
|
key: buttonValue,
|
|
@@ -1094,7 +1127,7 @@ var ControlToggleButtonGroup = ({
|
|
|
1094
1127
|
size,
|
|
1095
1128
|
fullWidth
|
|
1096
1129
|
},
|
|
1097
|
-
/* @__PURE__ */
|
|
1130
|
+
/* @__PURE__ */ React25.createElement(Content3, { size })
|
|
1098
1131
|
)
|
|
1099
1132
|
)
|
|
1100
1133
|
);
|
|
@@ -1121,7 +1154,7 @@ var ToggleControl = createControl(
|
|
|
1121
1154
|
fullWidth,
|
|
1122
1155
|
size
|
|
1123
1156
|
};
|
|
1124
|
-
return exclusive ? /* @__PURE__ */
|
|
1157
|
+
return exclusive ? /* @__PURE__ */ React26.createElement(
|
|
1125
1158
|
ControlToggleButtonGroup,
|
|
1126
1159
|
{
|
|
1127
1160
|
...toggleButtonGroupProps,
|
|
@@ -1129,7 +1162,7 @@ var ToggleControl = createControl(
|
|
|
1129
1162
|
onChange: setValue,
|
|
1130
1163
|
exclusive: true
|
|
1131
1164
|
}
|
|
1132
|
-
) : /* @__PURE__ */
|
|
1165
|
+
) : /* @__PURE__ */ React26.createElement(
|
|
1133
1166
|
ControlToggleButtonGroup,
|
|
1134
1167
|
{
|
|
1135
1168
|
...toggleButtonGroupProps,
|
|
@@ -1142,7 +1175,7 @@ var ToggleControl = createControl(
|
|
|
1142
1175
|
);
|
|
1143
1176
|
|
|
1144
1177
|
// src/controls/number-control.tsx
|
|
1145
|
-
var
|
|
1178
|
+
var React27 = __toESM(require("react"));
|
|
1146
1179
|
var import_editor_props11 = require("@elementor/editor-props");
|
|
1147
1180
|
var import_ui20 = require("@elementor/ui");
|
|
1148
1181
|
var isEmptyOrNaN = (value) => value === null || value === void 0 || value === "" || Number.isNaN(Number(value));
|
|
@@ -1164,7 +1197,7 @@ var NumberControl = createControl(
|
|
|
1164
1197
|
const formattedValue = shouldForceInt ? +parseInt(eventValue) : Number(eventValue);
|
|
1165
1198
|
setValue(Math.min(Math.max(formattedValue, min), max));
|
|
1166
1199
|
};
|
|
1167
|
-
return /* @__PURE__ */
|
|
1200
|
+
return /* @__PURE__ */ React27.createElement(ControlActions, null, /* @__PURE__ */ React27.createElement(
|
|
1168
1201
|
import_ui20.TextField,
|
|
1169
1202
|
{
|
|
1170
1203
|
size: "tiny",
|
|
@@ -1180,11 +1213,20 @@ var NumberControl = createControl(
|
|
|
1180
1213
|
);
|
|
1181
1214
|
|
|
1182
1215
|
// src/controls/equal-unequal-sizes-control.tsx
|
|
1183
|
-
var
|
|
1184
|
-
var
|
|
1216
|
+
var React29 = __toESM(require("react"));
|
|
1217
|
+
var import_react9 = require("react");
|
|
1185
1218
|
var import_editor_props12 = require("@elementor/editor-props");
|
|
1186
|
-
var
|
|
1219
|
+
var import_ui22 = require("@elementor/ui");
|
|
1187
1220
|
var import_i18n6 = require("@wordpress/i18n");
|
|
1221
|
+
|
|
1222
|
+
// src/components/control-label.tsx
|
|
1223
|
+
var React28 = __toESM(require("react"));
|
|
1224
|
+
var import_ui21 = require("@elementor/ui");
|
|
1225
|
+
var ControlLabel = ({ children }) => {
|
|
1226
|
+
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));
|
|
1227
|
+
};
|
|
1228
|
+
|
|
1229
|
+
// src/controls/equal-unequal-sizes-control.tsx
|
|
1188
1230
|
var isEqualSizes = (propValue, items) => {
|
|
1189
1231
|
const values = Object.values(propValue);
|
|
1190
1232
|
if (values.length !== items.length) {
|
|
@@ -1202,9 +1244,9 @@ function EqualUnequalSizesControl({
|
|
|
1202
1244
|
items,
|
|
1203
1245
|
multiSizePropTypeUtil
|
|
1204
1246
|
}) {
|
|
1205
|
-
const popupId = (0,
|
|
1206
|
-
const controlRef = (0,
|
|
1207
|
-
const popupState = (0,
|
|
1247
|
+
const popupId = (0, import_react9.useId)();
|
|
1248
|
+
const controlRef = (0, import_react9.useRef)(null);
|
|
1249
|
+
const popupState = (0, import_ui22.usePopupState)({ variant: "popover", popupId });
|
|
1208
1250
|
const {
|
|
1209
1251
|
propType: multiSizePropType,
|
|
1210
1252
|
value: multiSizeValue,
|
|
@@ -1238,19 +1280,19 @@ function EqualUnequalSizesControl({
|
|
|
1238
1280
|
return splitEqualValue() ?? null;
|
|
1239
1281
|
};
|
|
1240
1282
|
const isMixed = !!multiSizeValue;
|
|
1241
|
-
return /* @__PURE__ */
|
|
1242
|
-
|
|
1283
|
+
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(
|
|
1284
|
+
import_ui22.ToggleButton,
|
|
1243
1285
|
{
|
|
1244
1286
|
size: "tiny",
|
|
1245
1287
|
value: "check",
|
|
1246
1288
|
sx: { marginLeft: "auto" },
|
|
1247
|
-
...(0,
|
|
1289
|
+
...(0, import_ui22.bindToggle)(popupState),
|
|
1248
1290
|
selected: popupState.isOpen,
|
|
1249
1291
|
"aria-label": tooltipLabel
|
|
1250
1292
|
},
|
|
1251
1293
|
icon
|
|
1252
|
-
))))), /* @__PURE__ */
|
|
1253
|
-
|
|
1294
|
+
))))), /* @__PURE__ */ React29.createElement(
|
|
1295
|
+
import_ui22.Popover,
|
|
1254
1296
|
{
|
|
1255
1297
|
disablePortal: true,
|
|
1256
1298
|
disableScrollLock: true,
|
|
@@ -1262,21 +1304,22 @@ function EqualUnequalSizesControl({
|
|
|
1262
1304
|
vertical: "top",
|
|
1263
1305
|
horizontal: "right"
|
|
1264
1306
|
},
|
|
1265
|
-
...(0,
|
|
1307
|
+
...(0, import_ui22.bindPopover)(popupState),
|
|
1266
1308
|
slotProps: {
|
|
1309
|
+
// eslint-disable-next-line react-compiler/react-compiler
|
|
1267
1310
|
paper: { sx: { mt: 0.5, width: controlRef.current?.getBoundingClientRect().width } }
|
|
1268
1311
|
}
|
|
1269
1312
|
},
|
|
1270
|
-
/* @__PURE__ */
|
|
1313
|
+
/* @__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] }))))
|
|
1271
1314
|
));
|
|
1272
1315
|
}
|
|
1273
|
-
var MultiSizeValueControl = ({ item }) => /* @__PURE__ */
|
|
1316
|
+
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 })))));
|
|
1274
1317
|
|
|
1275
1318
|
// src/controls/linked-dimensions-control.tsx
|
|
1276
|
-
var
|
|
1319
|
+
var React30 = __toESM(require("react"));
|
|
1277
1320
|
var import_editor_props13 = require("@elementor/editor-props");
|
|
1278
1321
|
var import_icons4 = require("@elementor/icons");
|
|
1279
|
-
var
|
|
1322
|
+
var import_ui23 = require("@elementor/ui");
|
|
1280
1323
|
var import_i18n7 = require("@wordpress/i18n");
|
|
1281
1324
|
var LinkedDimensionsControl = createControl(
|
|
1282
1325
|
({
|
|
@@ -1308,8 +1351,8 @@ var LinkedDimensionsControl = createControl(
|
|
|
1308
1351
|
const LinkedIcon = isLinked ? import_icons4.LinkIcon : import_icons4.DetachIcon;
|
|
1309
1352
|
const linkedLabel = (0, import_i18n7.__)("Link %s", "elementor").replace("%s", tooltipLabel);
|
|
1310
1353
|
const unlinkedLabel = (0, import_i18n7.__)("Unlink %s", "elementor").replace("%s", tooltipLabel);
|
|
1311
|
-
return /* @__PURE__ */
|
|
1312
|
-
|
|
1354
|
+
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(
|
|
1355
|
+
import_ui23.ToggleButton,
|
|
1313
1356
|
{
|
|
1314
1357
|
"aria-label": isLinked ? unlinkedLabel : linkedLabel,
|
|
1315
1358
|
size: "tiny",
|
|
@@ -1318,36 +1361,36 @@ var LinkedDimensionsControl = createControl(
|
|
|
1318
1361
|
sx: { marginLeft: "auto" },
|
|
1319
1362
|
onChange: onLinkToggle
|
|
1320
1363
|
},
|
|
1321
|
-
/* @__PURE__ */
|
|
1322
|
-
))), /* @__PURE__ */
|
|
1364
|
+
/* @__PURE__ */ React30.createElement(LinkedIcon, { fontSize: "tiny" })
|
|
1365
|
+
))), /* @__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(
|
|
1323
1366
|
Control3,
|
|
1324
1367
|
{
|
|
1325
1368
|
bind: "block-start",
|
|
1326
|
-
startIcon: /* @__PURE__ */
|
|
1369
|
+
startIcon: /* @__PURE__ */ React30.createElement(import_icons4.SideTopIcon, { fontSize: "tiny" }),
|
|
1327
1370
|
isLinked,
|
|
1328
1371
|
extendedValues
|
|
1329
1372
|
}
|
|
1330
|
-
))), /* @__PURE__ */
|
|
1373
|
+
))), /* @__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(
|
|
1331
1374
|
Control3,
|
|
1332
1375
|
{
|
|
1333
1376
|
bind: "inline-end",
|
|
1334
|
-
startIcon: isSiteRtl ? /* @__PURE__ */
|
|
1377
|
+
startIcon: isSiteRtl ? /* @__PURE__ */ React30.createElement(import_icons4.SideLeftIcon, { fontSize: "tiny" }) : /* @__PURE__ */ React30.createElement(import_icons4.SideRightIcon, { fontSize: "tiny" }),
|
|
1335
1378
|
isLinked,
|
|
1336
1379
|
extendedValues
|
|
1337
1380
|
}
|
|
1338
|
-
)))), /* @__PURE__ */
|
|
1381
|
+
)))), /* @__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(
|
|
1339
1382
|
Control3,
|
|
1340
1383
|
{
|
|
1341
1384
|
bind: "block-end",
|
|
1342
|
-
startIcon: /* @__PURE__ */
|
|
1385
|
+
startIcon: /* @__PURE__ */ React30.createElement(import_icons4.SideBottomIcon, { fontSize: "tiny" }),
|
|
1343
1386
|
isLinked,
|
|
1344
1387
|
extendedValues
|
|
1345
1388
|
}
|
|
1346
|
-
))), /* @__PURE__ */
|
|
1389
|
+
))), /* @__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(
|
|
1347
1390
|
Control3,
|
|
1348
1391
|
{
|
|
1349
1392
|
bind: "inline-start",
|
|
1350
|
-
startIcon: isSiteRtl ? /* @__PURE__ */
|
|
1393
|
+
startIcon: isSiteRtl ? /* @__PURE__ */ React30.createElement(import_icons4.SideRightIcon, { fontSize: "tiny" }) : /* @__PURE__ */ React30.createElement(import_icons4.SideLeftIcon, { fontSize: "tiny" }),
|
|
1351
1394
|
isLinked,
|
|
1352
1395
|
extendedValues
|
|
1353
1396
|
}
|
|
@@ -1361,17 +1404,17 @@ var Control3 = ({
|
|
|
1361
1404
|
extendedValues
|
|
1362
1405
|
}) => {
|
|
1363
1406
|
if (isLinked) {
|
|
1364
|
-
return /* @__PURE__ */
|
|
1407
|
+
return /* @__PURE__ */ React30.createElement(SizeControl, { startIcon, extendedValues });
|
|
1365
1408
|
}
|
|
1366
|
-
return /* @__PURE__ */
|
|
1409
|
+
return /* @__PURE__ */ React30.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React30.createElement(SizeControl, { startIcon, extendedValues }));
|
|
1367
1410
|
};
|
|
1368
1411
|
|
|
1369
1412
|
// src/controls/font-family-control/font-family-control.tsx
|
|
1370
|
-
var
|
|
1371
|
-
var
|
|
1413
|
+
var React31 = __toESM(require("react"));
|
|
1414
|
+
var import_react10 = require("react");
|
|
1372
1415
|
var import_editor_props14 = require("@elementor/editor-props");
|
|
1373
1416
|
var import_icons5 = require("@elementor/icons");
|
|
1374
|
-
var
|
|
1417
|
+
var import_ui24 = require("@elementor/ui");
|
|
1375
1418
|
var import_utils2 = require("@elementor/utils");
|
|
1376
1419
|
var import_react_virtual = require("@tanstack/react-virtual");
|
|
1377
1420
|
var import_i18n8 = require("@wordpress/i18n");
|
|
@@ -1401,9 +1444,9 @@ var enqueueFont = (fontFamily, context = "editor") => {
|
|
|
1401
1444
|
// src/controls/font-family-control/font-family-control.tsx
|
|
1402
1445
|
var SIZE2 = "tiny";
|
|
1403
1446
|
var FontFamilyControl = createControl(({ fontFamilies }) => {
|
|
1404
|
-
const [searchValue, setSearchValue] = (0,
|
|
1447
|
+
const [searchValue, setSearchValue] = (0, import_react10.useState)("");
|
|
1405
1448
|
const { value: fontFamily, setValue: setFontFamily } = useBoundProp(import_editor_props14.stringPropTypeUtil);
|
|
1406
|
-
const popoverState = (0,
|
|
1449
|
+
const popoverState = (0, import_ui24.usePopupState)({ variant: "popover" });
|
|
1407
1450
|
const filteredFontFamilies = useFilteredFontFamilies(fontFamilies, searchValue);
|
|
1408
1451
|
const handleSearch = (event) => {
|
|
1409
1452
|
setSearchValue(event.target.value);
|
|
@@ -1412,26 +1455,26 @@ var FontFamilyControl = createControl(({ fontFamilies }) => {
|
|
|
1412
1455
|
setSearchValue("");
|
|
1413
1456
|
popoverState.close();
|
|
1414
1457
|
};
|
|
1415
|
-
return /* @__PURE__ */
|
|
1416
|
-
|
|
1458
|
+
return /* @__PURE__ */ React31.createElement(React31.Fragment, null, /* @__PURE__ */ React31.createElement(
|
|
1459
|
+
import_ui24.UnstableTag,
|
|
1417
1460
|
{
|
|
1418
1461
|
variant: "outlined",
|
|
1419
1462
|
label: fontFamily,
|
|
1420
|
-
endIcon: /* @__PURE__ */
|
|
1421
|
-
...(0,
|
|
1463
|
+
endIcon: /* @__PURE__ */ React31.createElement(import_icons5.ChevronDownIcon, { fontSize: "tiny" }),
|
|
1464
|
+
...(0, import_ui24.bindTrigger)(popoverState),
|
|
1422
1465
|
fullWidth: true
|
|
1423
1466
|
}
|
|
1424
|
-
), /* @__PURE__ */
|
|
1425
|
-
|
|
1467
|
+
), /* @__PURE__ */ React31.createElement(
|
|
1468
|
+
import_ui24.Popover,
|
|
1426
1469
|
{
|
|
1427
1470
|
disablePortal: true,
|
|
1428
1471
|
disableScrollLock: true,
|
|
1429
1472
|
anchorOrigin: { vertical: "bottom", horizontal: "left" },
|
|
1430
|
-
...(0,
|
|
1473
|
+
...(0, import_ui24.bindPopover)(popoverState),
|
|
1431
1474
|
onClose: handleClose
|
|
1432
1475
|
},
|
|
1433
|
-
/* @__PURE__ */
|
|
1434
|
-
|
|
1476
|
+
/* @__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(
|
|
1477
|
+
import_ui24.TextField,
|
|
1435
1478
|
{
|
|
1436
1479
|
fullWidth: true,
|
|
1437
1480
|
size: SIZE2,
|
|
@@ -1439,10 +1482,10 @@ var FontFamilyControl = createControl(({ fontFamilies }) => {
|
|
|
1439
1482
|
placeholder: (0, import_i18n8.__)("Search", "elementor"),
|
|
1440
1483
|
onChange: handleSearch,
|
|
1441
1484
|
InputProps: {
|
|
1442
|
-
startAdornment: /* @__PURE__ */
|
|
1485
|
+
startAdornment: /* @__PURE__ */ React31.createElement(import_ui24.InputAdornment, { position: "start" }, /* @__PURE__ */ React31.createElement(import_icons5.SearchIcon, { fontSize: SIZE2 }))
|
|
1443
1486
|
}
|
|
1444
1487
|
}
|
|
1445
|
-
)), /* @__PURE__ */
|
|
1488
|
+
)), /* @__PURE__ */ React31.createElement(import_ui24.Divider, null), filteredFontFamilies.length > 0 ? /* @__PURE__ */ React31.createElement(
|
|
1446
1489
|
FontList,
|
|
1447
1490
|
{
|
|
1448
1491
|
fontListItems: filteredFontFamilies,
|
|
@@ -1450,8 +1493,8 @@ var FontFamilyControl = createControl(({ fontFamilies }) => {
|
|
|
1450
1493
|
handleClose,
|
|
1451
1494
|
fontFamily
|
|
1452
1495
|
}
|
|
1453
|
-
) : /* @__PURE__ */
|
|
1454
|
-
|
|
1496
|
+
) : /* @__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(
|
|
1497
|
+
import_ui24.Typography,
|
|
1455
1498
|
{
|
|
1456
1499
|
variant: "subtitle2",
|
|
1457
1500
|
color: "text.secondary",
|
|
@@ -1461,17 +1504,17 @@ var FontFamilyControl = createControl(({ fontFamilies }) => {
|
|
|
1461
1504
|
justifyContent: "center"
|
|
1462
1505
|
}
|
|
1463
1506
|
},
|
|
1464
|
-
/* @__PURE__ */
|
|
1465
|
-
/* @__PURE__ */
|
|
1507
|
+
/* @__PURE__ */ React31.createElement("span", null, "\u201C"),
|
|
1508
|
+
/* @__PURE__ */ React31.createElement(
|
|
1466
1509
|
"span",
|
|
1467
1510
|
{
|
|
1468
1511
|
style: { maxWidth: "80%", overflow: "hidden", textOverflow: "ellipsis" }
|
|
1469
1512
|
},
|
|
1470
1513
|
searchValue
|
|
1471
1514
|
),
|
|
1472
|
-
/* @__PURE__ */
|
|
1473
|
-
)), /* @__PURE__ */
|
|
1474
|
-
|
|
1515
|
+
/* @__PURE__ */ React31.createElement("span", null, "\u201D.")
|
|
1516
|
+
)), /* @__PURE__ */ React31.createElement(import_ui24.Typography, { align: "center", variant: "caption", color: "text.secondary" }, (0, import_i18n8.__)("Try something else.", "elementor"), /* @__PURE__ */ React31.createElement(
|
|
1517
|
+
import_ui24.Link,
|
|
1475
1518
|
{
|
|
1476
1519
|
color: "secondary",
|
|
1477
1520
|
variant: "caption",
|
|
@@ -1485,7 +1528,7 @@ var FontFamilyControl = createControl(({ fontFamilies }) => {
|
|
|
1485
1528
|
var LIST_ITEM_HEIGHT = 36;
|
|
1486
1529
|
var LIST_ITEMS_BUFFER = 6;
|
|
1487
1530
|
var FontList = ({ fontListItems, setFontFamily, handleClose, fontFamily }) => {
|
|
1488
|
-
const containerRef = (0,
|
|
1531
|
+
const containerRef = (0, import_react10.useRef)(null);
|
|
1489
1532
|
const selectedItem = fontListItems.find((item) => item.value === fontFamily);
|
|
1490
1533
|
const debouncedVirtualizeChange = useDebounce(({ getVirtualIndexes }) => {
|
|
1491
1534
|
getVirtualIndexes().forEach((index) => {
|
|
@@ -1502,15 +1545,16 @@ var FontList = ({ fontListItems, setFontFamily, handleClose, fontFamily }) => {
|
|
|
1502
1545
|
overscan: LIST_ITEMS_BUFFER,
|
|
1503
1546
|
onChange: debouncedVirtualizeChange
|
|
1504
1547
|
});
|
|
1505
|
-
(0,
|
|
1548
|
+
(0, import_react10.useEffect)(
|
|
1506
1549
|
() => {
|
|
1507
1550
|
virtualizer.scrollToIndex(fontListItems.findIndex((item) => item.value === fontFamily));
|
|
1508
1551
|
},
|
|
1552
|
+
// eslint-disable-next-line react-compiler/react-compiler
|
|
1509
1553
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1510
1554
|
[fontFamily]
|
|
1511
1555
|
);
|
|
1512
|
-
return /* @__PURE__ */
|
|
1513
|
-
|
|
1556
|
+
return /* @__PURE__ */ React31.createElement(
|
|
1557
|
+
import_ui24.Box,
|
|
1514
1558
|
{
|
|
1515
1559
|
ref: containerRef,
|
|
1516
1560
|
sx: {
|
|
@@ -1519,7 +1563,7 @@ var FontList = ({ fontListItems, setFontFamily, handleClose, fontFamily }) => {
|
|
|
1519
1563
|
width: 220
|
|
1520
1564
|
}
|
|
1521
1565
|
},
|
|
1522
|
-
/* @__PURE__ */
|
|
1566
|
+
/* @__PURE__ */ React31.createElement(
|
|
1523
1567
|
StyledMenuList,
|
|
1524
1568
|
{
|
|
1525
1569
|
role: "listbox",
|
|
@@ -1535,8 +1579,8 @@ var FontList = ({ fontListItems, setFontFamily, handleClose, fontFamily }) => {
|
|
|
1535
1579
|
const isSelected = selectedItem?.value === item.value;
|
|
1536
1580
|
const tabIndexFallback = !selectedItem ? 0 : -1;
|
|
1537
1581
|
if (item.type === "category") {
|
|
1538
|
-
return /* @__PURE__ */
|
|
1539
|
-
|
|
1582
|
+
return /* @__PURE__ */ React31.createElement(
|
|
1583
|
+
import_ui24.MenuSubheader,
|
|
1540
1584
|
{
|
|
1541
1585
|
key: virtualRow.key,
|
|
1542
1586
|
style: {
|
|
@@ -1546,7 +1590,7 @@ var FontList = ({ fontListItems, setFontFamily, handleClose, fontFamily }) => {
|
|
|
1546
1590
|
item.value
|
|
1547
1591
|
);
|
|
1548
1592
|
}
|
|
1549
|
-
return /* @__PURE__ */
|
|
1593
|
+
return /* @__PURE__ */ React31.createElement(
|
|
1550
1594
|
"li",
|
|
1551
1595
|
{
|
|
1552
1596
|
key: virtualRow.key,
|
|
@@ -1582,7 +1626,7 @@ var FontList = ({ fontListItems, setFontFamily, handleClose, fontFamily }) => {
|
|
|
1582
1626
|
)
|
|
1583
1627
|
);
|
|
1584
1628
|
};
|
|
1585
|
-
var StyledMenuList = (0,
|
|
1629
|
+
var StyledMenuList = (0, import_ui24.styled)(import_ui24.MenuList)(({ theme }) => ({
|
|
1586
1630
|
"& > li": {
|
|
1587
1631
|
height: LIST_ITEM_HEIGHT,
|
|
1588
1632
|
position: "absolute",
|
|
@@ -1607,20 +1651,20 @@ var StyledMenuList = (0, import_ui23.styled)(import_ui23.MenuList)(({ theme }) =
|
|
|
1607
1651
|
position: "relative"
|
|
1608
1652
|
}));
|
|
1609
1653
|
var useDebounce = (fn, delay) => {
|
|
1610
|
-
const [debouncedFn] = (0,
|
|
1611
|
-
(0,
|
|
1654
|
+
const [debouncedFn] = (0, import_react10.useState)(() => (0, import_utils2.debounce)(fn, delay));
|
|
1655
|
+
(0, import_react10.useEffect)(() => () => debouncedFn.cancel(), [debouncedFn]);
|
|
1612
1656
|
return debouncedFn;
|
|
1613
1657
|
};
|
|
1614
1658
|
|
|
1615
1659
|
// src/controls/url-control.tsx
|
|
1616
|
-
var
|
|
1660
|
+
var React32 = __toESM(require("react"));
|
|
1617
1661
|
var import_editor_props15 = require("@elementor/editor-props");
|
|
1618
|
-
var
|
|
1662
|
+
var import_ui25 = require("@elementor/ui");
|
|
1619
1663
|
var UrlControl = createControl(({ placeholder }) => {
|
|
1620
1664
|
const { value, setValue } = useBoundProp(import_editor_props15.urlPropTypeUtil);
|
|
1621
1665
|
const handleChange = (event) => setValue(event.target.value);
|
|
1622
|
-
return /* @__PURE__ */
|
|
1623
|
-
|
|
1666
|
+
return /* @__PURE__ */ React32.createElement(ControlActions, null, /* @__PURE__ */ React32.createElement(
|
|
1667
|
+
import_ui25.TextField,
|
|
1624
1668
|
{
|
|
1625
1669
|
size: "tiny",
|
|
1626
1670
|
fullWidth: true,
|
|
@@ -1632,22 +1676,23 @@ var UrlControl = createControl(({ placeholder }) => {
|
|
|
1632
1676
|
});
|
|
1633
1677
|
|
|
1634
1678
|
// src/controls/link-control.tsx
|
|
1635
|
-
var
|
|
1636
|
-
var
|
|
1679
|
+
var React34 = __toESM(require("react"));
|
|
1680
|
+
var import_react12 = require("react");
|
|
1681
|
+
var import_editor_elements = require("@elementor/editor-elements");
|
|
1637
1682
|
var import_editor_props16 = require("@elementor/editor-props");
|
|
1638
1683
|
var import_http2 = require("@elementor/http");
|
|
1639
1684
|
var import_icons7 = require("@elementor/icons");
|
|
1640
1685
|
var import_session = require("@elementor/session");
|
|
1641
|
-
var
|
|
1686
|
+
var import_ui27 = require("@elementor/ui");
|
|
1642
1687
|
var import_utils3 = require("@elementor/utils");
|
|
1643
1688
|
var import_i18n9 = require("@wordpress/i18n");
|
|
1644
1689
|
|
|
1645
1690
|
// src/components/autocomplete.tsx
|
|
1646
|
-
var
|
|
1647
|
-
var
|
|
1691
|
+
var React33 = __toESM(require("react"));
|
|
1692
|
+
var import_react11 = require("react");
|
|
1648
1693
|
var import_icons6 = require("@elementor/icons");
|
|
1649
|
-
var
|
|
1650
|
-
var Autocomplete = (0,
|
|
1694
|
+
var import_ui26 = require("@elementor/ui");
|
|
1695
|
+
var Autocomplete = (0, import_react11.forwardRef)((props, ref) => {
|
|
1651
1696
|
const {
|
|
1652
1697
|
options,
|
|
1653
1698
|
onOptionChange,
|
|
@@ -1663,8 +1708,8 @@ var Autocomplete = (0, import_react10.forwardRef)((props, ref) => {
|
|
|
1663
1708
|
const muiWarningPreventer = allowCustomValues || !!value?.toString()?.length;
|
|
1664
1709
|
const isOptionEqualToValue = muiWarningPreventer ? void 0 : () => true;
|
|
1665
1710
|
const isValueFromOptions = typeof value === "number" && !!findMatchingOption(options, value);
|
|
1666
|
-
return /* @__PURE__ */
|
|
1667
|
-
|
|
1711
|
+
return /* @__PURE__ */ React33.createElement(
|
|
1712
|
+
import_ui26.Autocomplete,
|
|
1668
1713
|
{
|
|
1669
1714
|
...restProps,
|
|
1670
1715
|
ref,
|
|
@@ -1681,8 +1726,8 @@ var Autocomplete = (0, import_react10.forwardRef)((props, ref) => {
|
|
|
1681
1726
|
groupBy: isCategorizedOptionPool(options) ? (optionId) => findMatchingOption(options, optionId)?.groupLabel || optionId : void 0,
|
|
1682
1727
|
isOptionEqualToValue,
|
|
1683
1728
|
filterOptions: () => optionKeys,
|
|
1684
|
-
renderOption: (optionProps, optionId) => /* @__PURE__ */
|
|
1685
|
-
renderInput: (params) => /* @__PURE__ */
|
|
1729
|
+
renderOption: (optionProps, optionId) => /* @__PURE__ */ React33.createElement(import_ui26.Box, { component: "li", ...optionProps, key: optionProps.id }, findMatchingOption(options, optionId)?.label ?? optionId),
|
|
1730
|
+
renderInput: (params) => /* @__PURE__ */ React33.createElement(
|
|
1686
1731
|
TextInput,
|
|
1687
1732
|
{
|
|
1688
1733
|
params,
|
|
@@ -1705,8 +1750,8 @@ var TextInput = ({
|
|
|
1705
1750
|
const onChange = (event) => {
|
|
1706
1751
|
handleChange(event.target.value);
|
|
1707
1752
|
};
|
|
1708
|
-
return /* @__PURE__ */
|
|
1709
|
-
|
|
1753
|
+
return /* @__PURE__ */ React33.createElement(
|
|
1754
|
+
import_ui26.TextField,
|
|
1710
1755
|
{
|
|
1711
1756
|
...params,
|
|
1712
1757
|
placeholder,
|
|
@@ -1718,7 +1763,7 @@ var TextInput = ({
|
|
|
1718
1763
|
},
|
|
1719
1764
|
InputProps: {
|
|
1720
1765
|
...params.InputProps,
|
|
1721
|
-
endAdornment: /* @__PURE__ */
|
|
1766
|
+
endAdornment: /* @__PURE__ */ React33.createElement(ClearButton, { params, allowClear, handleChange })
|
|
1722
1767
|
}
|
|
1723
1768
|
}
|
|
1724
1769
|
);
|
|
@@ -1727,7 +1772,7 @@ var ClearButton = ({
|
|
|
1727
1772
|
allowClear,
|
|
1728
1773
|
handleChange,
|
|
1729
1774
|
params
|
|
1730
|
-
}) => /* @__PURE__ */
|
|
1775
|
+
}) => /* @__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 })));
|
|
1731
1776
|
function findMatchingOption(options, optionId = null) {
|
|
1732
1777
|
const formattedOption = (optionId || "").toString();
|
|
1733
1778
|
return options.find(({ id }) => formattedOption === id.toString());
|
|
@@ -1748,42 +1793,12 @@ function _factoryFilter(newValue, options, minInputLength) {
|
|
|
1748
1793
|
);
|
|
1749
1794
|
}
|
|
1750
1795
|
|
|
1751
|
-
// src/utils/link-restriction.ts
|
|
1752
|
-
var import_editor_elements = require("@elementor/editor-elements");
|
|
1753
|
-
function getLinkRestriction(elementId) {
|
|
1754
|
-
if (getAncestorAnchor(elementId)) {
|
|
1755
|
-
return {
|
|
1756
|
-
shouldRestrict: true,
|
|
1757
|
-
restrictReason: "ancestor"
|
|
1758
|
-
};
|
|
1759
|
-
}
|
|
1760
|
-
if (getDescendantAnchor(elementId)) {
|
|
1761
|
-
return {
|
|
1762
|
-
shouldRestrict: true,
|
|
1763
|
-
restrictReason: "descendant"
|
|
1764
|
-
};
|
|
1765
|
-
}
|
|
1766
|
-
return { shouldRestrict: false };
|
|
1767
|
-
}
|
|
1768
|
-
function getAncestorAnchor(elementId) {
|
|
1769
|
-
const element = getElementView(elementId);
|
|
1770
|
-
return element?.closest("a") || null;
|
|
1771
|
-
}
|
|
1772
|
-
function getDescendantAnchor(elementId) {
|
|
1773
|
-
const element = getElementView(elementId);
|
|
1774
|
-
return element?.querySelector("a") || null;
|
|
1775
|
-
}
|
|
1776
|
-
function getElementView(id) {
|
|
1777
|
-
const elementContainer = (0, import_editor_elements.getContainer)(id);
|
|
1778
|
-
return elementContainer?.view?.el || null;
|
|
1779
|
-
}
|
|
1780
|
-
|
|
1781
1796
|
// src/controls/link-control.tsx
|
|
1782
1797
|
var SIZE3 = "tiny";
|
|
1783
1798
|
var LinkControl = createControl((props) => {
|
|
1784
1799
|
const { value, path, setValue, ...propContext } = useBoundProp(import_editor_props16.linkPropTypeUtil);
|
|
1785
1800
|
const [linkSessionValue, setLinkSessionValue] = (0, import_session.useSessionStorage)(path.join("/"));
|
|
1786
|
-
const [isEnabled, setIsEnabled] = (0,
|
|
1801
|
+
const [isEnabled, setIsEnabled] = (0, import_react12.useState)(!!value);
|
|
1787
1802
|
const {
|
|
1788
1803
|
allowCustomValues,
|
|
1789
1804
|
queryOptions: { endpoint = "", requestParams = {} },
|
|
@@ -1791,11 +1806,11 @@ var LinkControl = createControl((props) => {
|
|
|
1791
1806
|
minInputLength = 2,
|
|
1792
1807
|
context: { elementId }
|
|
1793
1808
|
} = props || {};
|
|
1794
|
-
const [options, setOptions] = (0,
|
|
1809
|
+
const [options, setOptions] = (0, import_react12.useState)(
|
|
1795
1810
|
generateFirstLoadedOption(value)
|
|
1796
1811
|
);
|
|
1797
1812
|
const onEnabledChange = () => {
|
|
1798
|
-
const
|
|
1813
|
+
const shouldRestrict = (0, import_editor_elements.getAncestorWithAnchorTag)(elementId) || (0, import_editor_elements.getDescendantWithAnchorTag)(elementId);
|
|
1799
1814
|
if (shouldRestrict && !isEnabled) {
|
|
1800
1815
|
return;
|
|
1801
1816
|
}
|
|
@@ -1832,7 +1847,7 @@ var LinkControl = createControl((props) => {
|
|
|
1832
1847
|
}
|
|
1833
1848
|
debounceFetch({ ...requestParams, term: newValue });
|
|
1834
1849
|
};
|
|
1835
|
-
const debounceFetch = (0,
|
|
1850
|
+
const debounceFetch = (0, import_react12.useMemo)(
|
|
1836
1851
|
() => (0, import_utils3.debounce)(
|
|
1837
1852
|
(params) => fetchOptions(endpoint, params).then((newOptions) => {
|
|
1838
1853
|
setOptions(formatOptions(newOptions));
|
|
@@ -1841,8 +1856,8 @@ var LinkControl = createControl((props) => {
|
|
|
1841
1856
|
),
|
|
1842
1857
|
[endpoint]
|
|
1843
1858
|
);
|
|
1844
|
-
return /* @__PURE__ */
|
|
1845
|
-
|
|
1859
|
+
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(
|
|
1860
|
+
import_ui27.Stack,
|
|
1846
1861
|
{
|
|
1847
1862
|
direction: "row",
|
|
1848
1863
|
sx: {
|
|
@@ -1850,8 +1865,8 @@ var LinkControl = createControl((props) => {
|
|
|
1850
1865
|
alignItems: "center"
|
|
1851
1866
|
}
|
|
1852
1867
|
},
|
|
1853
|
-
/* @__PURE__ */
|
|
1854
|
-
/* @__PURE__ */
|
|
1868
|
+
/* @__PURE__ */ React34.createElement(ControlFormLabel, null, (0, import_i18n9.__)("Link", "elementor")),
|
|
1869
|
+
/* @__PURE__ */ React34.createElement(
|
|
1855
1870
|
ToggleIconControl,
|
|
1856
1871
|
{
|
|
1857
1872
|
enabled: isEnabled,
|
|
@@ -1859,28 +1874,28 @@ var LinkControl = createControl((props) => {
|
|
|
1859
1874
|
label: (0, import_i18n9.__)("Toggle link", "elementor")
|
|
1860
1875
|
}
|
|
1861
1876
|
)
|
|
1862
|
-
), /* @__PURE__ */
|
|
1877
|
+
), /* @__PURE__ */ React34.createElement(import_ui27.Collapse, { in: isEnabled, 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(
|
|
1863
1878
|
Autocomplete,
|
|
1864
1879
|
{
|
|
1865
1880
|
options,
|
|
1866
1881
|
allowCustomValues,
|
|
1867
1882
|
placeholder,
|
|
1868
|
-
value: value?.destination?.value,
|
|
1883
|
+
value: value?.destination?.value?.settings?.label || value?.destination?.value,
|
|
1869
1884
|
onOptionChange,
|
|
1870
1885
|
onTextChange,
|
|
1871
1886
|
minInputLength
|
|
1872
1887
|
}
|
|
1873
|
-
))), /* @__PURE__ */
|
|
1888
|
+
))), /* @__PURE__ */ React34.createElement(PropKeyProvider, { bind: "isTargetBlank" }, /* @__PURE__ */ React34.createElement(SwitchControl, null))))));
|
|
1874
1889
|
});
|
|
1875
1890
|
var ToggleIconControl = ({ enabled, onIconClick, label }) => {
|
|
1876
|
-
return /* @__PURE__ */
|
|
1891
|
+
return /* @__PURE__ */ React34.createElement(import_ui27.IconButton, { size: SIZE3, onClick: onIconClick, "aria-label": label }, enabled ? /* @__PURE__ */ React34.createElement(import_icons7.MinusIcon, { fontSize: SIZE3 }) : /* @__PURE__ */ React34.createElement(import_icons7.PlusIcon, { fontSize: SIZE3 }));
|
|
1877
1892
|
};
|
|
1878
1893
|
var SwitchControl = () => {
|
|
1879
1894
|
const { value = false, setValue } = useBoundProp(import_editor_props16.booleanPropTypeUtil);
|
|
1880
1895
|
const onClick = () => {
|
|
1881
1896
|
setValue(!value);
|
|
1882
1897
|
};
|
|
1883
|
-
return /* @__PURE__ */
|
|
1898
|
+
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 })));
|
|
1884
1899
|
};
|
|
1885
1900
|
async function fetchOptions(ajaxUrl, params) {
|
|
1886
1901
|
if (!params || !ajaxUrl) {
|
|
@@ -1912,10 +1927,10 @@ function generateFirstLoadedOption(unionValue) {
|
|
|
1912
1927
|
}
|
|
1913
1928
|
|
|
1914
1929
|
// src/controls/gap-control.tsx
|
|
1915
|
-
var
|
|
1930
|
+
var React35 = __toESM(require("react"));
|
|
1916
1931
|
var import_editor_props17 = require("@elementor/editor-props");
|
|
1917
1932
|
var import_icons8 = require("@elementor/icons");
|
|
1918
|
-
var
|
|
1933
|
+
var import_ui28 = require("@elementor/ui");
|
|
1919
1934
|
var import_i18n10 = require("@wordpress/i18n");
|
|
1920
1935
|
var GapControl = createControl(({ label }) => {
|
|
1921
1936
|
const {
|
|
@@ -1940,8 +1955,8 @@ var GapControl = createControl(({ label }) => {
|
|
|
1940
1955
|
const LinkedIcon = isLinked ? import_icons8.LinkIcon : import_icons8.DetachIcon;
|
|
1941
1956
|
const linkedLabel = (0, import_i18n10.__)("Link %s", "elementor").replace("%s", tooltipLabel);
|
|
1942
1957
|
const unlinkedLabel = (0, import_i18n10.__)("Unlink %s", "elementor").replace("%s", tooltipLabel);
|
|
1943
|
-
return /* @__PURE__ */
|
|
1944
|
-
|
|
1958
|
+
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(
|
|
1959
|
+
import_ui28.ToggleButton,
|
|
1945
1960
|
{
|
|
1946
1961
|
"aria-label": isLinked ? unlinkedLabel : linkedLabel,
|
|
1947
1962
|
size: "tiny",
|
|
@@ -1950,30 +1965,30 @@ var GapControl = createControl(({ label }) => {
|
|
|
1950
1965
|
sx: { marginLeft: "auto" },
|
|
1951
1966
|
onChange: onLinkToggle
|
|
1952
1967
|
},
|
|
1953
|
-
/* @__PURE__ */
|
|
1954
|
-
))), /* @__PURE__ */
|
|
1968
|
+
/* @__PURE__ */ React35.createElement(LinkedIcon, { fontSize: "tiny" })
|
|
1969
|
+
))), /* @__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 })))));
|
|
1955
1970
|
});
|
|
1956
1971
|
var Control4 = ({ bind, isLinked }) => {
|
|
1957
1972
|
if (isLinked) {
|
|
1958
|
-
return /* @__PURE__ */
|
|
1973
|
+
return /* @__PURE__ */ React35.createElement(SizeControl, null);
|
|
1959
1974
|
}
|
|
1960
|
-
return /* @__PURE__ */
|
|
1975
|
+
return /* @__PURE__ */ React35.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React35.createElement(SizeControl, null));
|
|
1961
1976
|
};
|
|
1962
1977
|
|
|
1963
1978
|
// src/controls/svg-media-control.tsx
|
|
1964
|
-
var
|
|
1965
|
-
var
|
|
1979
|
+
var React37 = __toESM(require("react"));
|
|
1980
|
+
var import_react14 = require("react");
|
|
1966
1981
|
var import_editor_props18 = require("@elementor/editor-props");
|
|
1967
1982
|
var import_icons9 = require("@elementor/icons");
|
|
1968
|
-
var
|
|
1983
|
+
var import_ui30 = require("@elementor/ui");
|
|
1969
1984
|
var import_wp_media2 = require("@elementor/wp-media");
|
|
1970
1985
|
var import_i18n12 = require("@wordpress/i18n");
|
|
1971
1986
|
|
|
1972
1987
|
// src/components/enable-unfiltered-modal.tsx
|
|
1973
|
-
var
|
|
1974
|
-
var
|
|
1988
|
+
var React36 = __toESM(require("react"));
|
|
1989
|
+
var import_react13 = require("react");
|
|
1975
1990
|
var import_editor_current_user = require("@elementor/editor-current-user");
|
|
1976
|
-
var
|
|
1991
|
+
var import_ui29 = require("@elementor/ui");
|
|
1977
1992
|
var import_i18n11 = require("@wordpress/i18n");
|
|
1978
1993
|
var ADMIN_TITLE_TEXT = (0, import_i18n11.__)("Enable Unfiltered Uploads", "elementor");
|
|
1979
1994
|
var ADMIN_CONTENT_TEXT = (0, import_i18n11.__)(
|
|
@@ -1994,7 +2009,7 @@ var WAIT_FOR_CLOSE_TIMEOUT_MS = 300;
|
|
|
1994
2009
|
var EnableUnfilteredModal = (props) => {
|
|
1995
2010
|
const { mutateAsync, isPending } = useUpdateUnfilteredFilesUpload();
|
|
1996
2011
|
const { canUser } = (0, import_editor_current_user.useCurrentUserCapabilities)();
|
|
1997
|
-
const [isError, setIsError] = (0,
|
|
2012
|
+
const [isError, setIsError] = (0, import_react13.useState)(false);
|
|
1998
2013
|
const canManageOptions = canUser("manage_options");
|
|
1999
2014
|
const onClose = (enabled) => {
|
|
2000
2015
|
props.onClose(enabled);
|
|
@@ -2013,10 +2028,10 @@ var EnableUnfilteredModal = (props) => {
|
|
|
2013
2028
|
}
|
|
2014
2029
|
};
|
|
2015
2030
|
const dialogProps = { ...props, isPending, handleEnable, isError, onClose };
|
|
2016
|
-
return canManageOptions ? /* @__PURE__ */
|
|
2031
|
+
return canManageOptions ? /* @__PURE__ */ React36.createElement(AdminDialog, { ...dialogProps }) : /* @__PURE__ */ React36.createElement(NonAdminDialog, { ...dialogProps });
|
|
2017
2032
|
};
|
|
2018
|
-
var AdminDialog = ({ open, onClose, handleEnable, isPending, isError }) => /* @__PURE__ */
|
|
2019
|
-
|
|
2033
|
+
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(
|
|
2034
|
+
import_ui29.Button,
|
|
2020
2035
|
{
|
|
2021
2036
|
size: "medium",
|
|
2022
2037
|
onClick: () => handleEnable(),
|
|
@@ -2024,16 +2039,16 @@ var AdminDialog = ({ open, onClose, handleEnable, isPending, isError }) => /* @_
|
|
|
2024
2039
|
color: "primary",
|
|
2025
2040
|
disabled: isPending
|
|
2026
2041
|
},
|
|
2027
|
-
isPending ? /* @__PURE__ */
|
|
2042
|
+
isPending ? /* @__PURE__ */ React36.createElement(import_ui29.CircularProgress, { size: 24 }) : (0, import_i18n11.__)("Enable", "elementor")
|
|
2028
2043
|
)));
|
|
2029
|
-
var NonAdminDialog = ({ open, onClose }) => /* @__PURE__ */
|
|
2044
|
+
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"))));
|
|
2030
2045
|
|
|
2031
2046
|
// src/controls/svg-media-control.tsx
|
|
2032
2047
|
var TILE_SIZE = 8;
|
|
2033
2048
|
var TILE_WHITE = "transparent";
|
|
2034
2049
|
var TILE_BLACK = "#c1c1c1";
|
|
2035
2050
|
var TILES_GRADIENT_FORMULA = `linear-gradient(45deg, ${TILE_BLACK} 25%, ${TILE_WHITE} 0, ${TILE_WHITE} 75%, ${TILE_BLACK} 0, ${TILE_BLACK})`;
|
|
2036
|
-
var StyledCard = (0,
|
|
2051
|
+
var StyledCard = (0, import_ui30.styled)(import_ui30.Card)`
|
|
2037
2052
|
background-color: white;
|
|
2038
2053
|
background-image: ${TILES_GRADIENT_FORMULA}, ${TILES_GRADIENT_FORMULA};
|
|
2039
2054
|
background-size: ${TILE_SIZE}px ${TILE_SIZE}px;
|
|
@@ -2042,7 +2057,7 @@ var StyledCard = (0, import_ui29.styled)(import_ui29.Card)`
|
|
|
2042
2057
|
${TILE_SIZE / 2}px ${TILE_SIZE / 2}px;
|
|
2043
2058
|
border: none;
|
|
2044
2059
|
`;
|
|
2045
|
-
var StyledCardMediaContainer = (0,
|
|
2060
|
+
var StyledCardMediaContainer = (0, import_ui30.styled)(import_ui30.Stack)`
|
|
2046
2061
|
position: relative;
|
|
2047
2062
|
height: 140px;
|
|
2048
2063
|
object-fit: contain;
|
|
@@ -2059,7 +2074,7 @@ var SvgMediaControl = createControl(() => {
|
|
|
2059
2074
|
const { data: attachment, isFetching } = (0, import_wp_media2.useWpMediaAttachment)(id?.value || null);
|
|
2060
2075
|
const src = attachment?.url ?? url?.value ?? null;
|
|
2061
2076
|
const { data: allowSvgUpload } = useUnfilteredFilesUpload();
|
|
2062
|
-
const [unfilteredModalOpenState, setUnfilteredModalOpenState] = (0,
|
|
2077
|
+
const [unfilteredModalOpenState, setUnfilteredModalOpenState] = (0, import_react14.useState)(false);
|
|
2063
2078
|
const { open } = (0, import_wp_media2.useWpMediaFrame)({
|
|
2064
2079
|
mediaTypes: ["svg"],
|
|
2065
2080
|
multiple: false,
|
|
@@ -2087,16 +2102,16 @@ var SvgMediaControl = createControl(() => {
|
|
|
2087
2102
|
open(openOptions);
|
|
2088
2103
|
}
|
|
2089
2104
|
};
|
|
2090
|
-
return /* @__PURE__ */
|
|
2091
|
-
|
|
2105
|
+
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(
|
|
2106
|
+
import_ui30.CardMedia,
|
|
2092
2107
|
{
|
|
2093
2108
|
component: "img",
|
|
2094
2109
|
image: src,
|
|
2095
2110
|
alt: (0, import_i18n12.__)("Preview SVG", "elementor"),
|
|
2096
2111
|
sx: { maxHeight: "140px", width: "50px" }
|
|
2097
2112
|
}
|
|
2098
|
-
)), /* @__PURE__ */
|
|
2099
|
-
|
|
2113
|
+
)), /* @__PURE__ */ React37.createElement(
|
|
2114
|
+
import_ui30.CardOverlay,
|
|
2100
2115
|
{
|
|
2101
2116
|
sx: {
|
|
2102
2117
|
"&:hover": {
|
|
@@ -2104,8 +2119,8 @@ var SvgMediaControl = createControl(() => {
|
|
|
2104
2119
|
}
|
|
2105
2120
|
}
|
|
2106
2121
|
},
|
|
2107
|
-
/* @__PURE__ */
|
|
2108
|
-
|
|
2122
|
+
/* @__PURE__ */ React37.createElement(import_ui30.Stack, { gap: 1 }, /* @__PURE__ */ React37.createElement(
|
|
2123
|
+
import_ui30.Button,
|
|
2109
2124
|
{
|
|
2110
2125
|
size: "tiny",
|
|
2111
2126
|
color: "inherit",
|
|
@@ -2113,13 +2128,13 @@ var SvgMediaControl = createControl(() => {
|
|
|
2113
2128
|
onClick: () => handleClick(MODE_BROWSE)
|
|
2114
2129
|
},
|
|
2115
2130
|
(0, import_i18n12.__)("Select SVG", "elementor")
|
|
2116
|
-
), /* @__PURE__ */
|
|
2117
|
-
|
|
2131
|
+
), /* @__PURE__ */ React37.createElement(
|
|
2132
|
+
import_ui30.Button,
|
|
2118
2133
|
{
|
|
2119
2134
|
size: "tiny",
|
|
2120
2135
|
variant: "text",
|
|
2121
2136
|
color: "inherit",
|
|
2122
|
-
startIcon: /* @__PURE__ */
|
|
2137
|
+
startIcon: /* @__PURE__ */ React37.createElement(import_icons9.UploadIcon, null),
|
|
2123
2138
|
onClick: () => handleClick(MODE_UPLOAD)
|
|
2124
2139
|
},
|
|
2125
2140
|
(0, import_i18n12.__)("Upload", "elementor")
|
|
@@ -2128,15 +2143,15 @@ var SvgMediaControl = createControl(() => {
|
|
|
2128
2143
|
});
|
|
2129
2144
|
|
|
2130
2145
|
// src/controls/background-control/background-control.tsx
|
|
2131
|
-
var
|
|
2146
|
+
var React44 = __toESM(require("react"));
|
|
2132
2147
|
var import_editor_props24 = require("@elementor/editor-props");
|
|
2133
|
-
var
|
|
2148
|
+
var import_ui38 = require("@elementor/ui");
|
|
2134
2149
|
var import_i18n18 = require("@wordpress/i18n");
|
|
2135
2150
|
|
|
2136
2151
|
// src/controls/background-control/background-overlay/background-overlay-repeater-control.tsx
|
|
2137
|
-
var
|
|
2152
|
+
var React43 = __toESM(require("react"));
|
|
2138
2153
|
var import_editor_props23 = require("@elementor/editor-props");
|
|
2139
|
-
var
|
|
2154
|
+
var import_ui37 = require("@elementor/ui");
|
|
2140
2155
|
var import_wp_media3 = require("@elementor/wp-media");
|
|
2141
2156
|
var import_i18n17 = require("@wordpress/i18n");
|
|
2142
2157
|
|
|
@@ -2145,9 +2160,9 @@ var import_env = require("@elementor/env");
|
|
|
2145
2160
|
var { env } = (0, import_env.parseEnv)("@elementor/editor-controls");
|
|
2146
2161
|
|
|
2147
2162
|
// src/controls/background-control/background-gradient-color-control.tsx
|
|
2148
|
-
var
|
|
2163
|
+
var React38 = __toESM(require("react"));
|
|
2149
2164
|
var import_editor_props19 = require("@elementor/editor-props");
|
|
2150
|
-
var
|
|
2165
|
+
var import_ui31 = require("@elementor/ui");
|
|
2151
2166
|
var BackgroundGradientColorControl = createControl(() => {
|
|
2152
2167
|
const { value, setValue } = useBoundProp(import_editor_props19.backgroundGradientOverlayPropTypeUtil);
|
|
2153
2168
|
const handleChange = (newValue) => {
|
|
@@ -2185,8 +2200,8 @@ var BackgroundGradientColorControl = createControl(() => {
|
|
|
2185
2200
|
positions: positions?.value.split(" ")
|
|
2186
2201
|
};
|
|
2187
2202
|
};
|
|
2188
|
-
return /* @__PURE__ */
|
|
2189
|
-
|
|
2203
|
+
return /* @__PURE__ */ React38.createElement(ControlActions, null, /* @__PURE__ */ React38.createElement(
|
|
2204
|
+
import_ui31.UnstableGradientBox,
|
|
2190
2205
|
{
|
|
2191
2206
|
sx: { width: "auto", padding: 1.5 },
|
|
2192
2207
|
value: normalizeValue(),
|
|
@@ -2210,33 +2225,34 @@ var initialBackgroundGradientOverlay = import_editor_props19.backgroundGradientO
|
|
|
2210
2225
|
});
|
|
2211
2226
|
|
|
2212
2227
|
// src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-attachment.tsx
|
|
2213
|
-
var
|
|
2228
|
+
var React39 = __toESM(require("react"));
|
|
2214
2229
|
var import_icons10 = require("@elementor/icons");
|
|
2215
|
-
var
|
|
2230
|
+
var import_ui32 = require("@elementor/ui");
|
|
2216
2231
|
var import_i18n13 = require("@wordpress/i18n");
|
|
2217
2232
|
var attachmentControlOptions = [
|
|
2218
2233
|
{
|
|
2219
2234
|
value: "fixed",
|
|
2220
2235
|
label: (0, import_i18n13.__)("Fixed", "elementor"),
|
|
2221
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2236
|
+
renderContent: ({ size }) => /* @__PURE__ */ React39.createElement(import_icons10.PinIcon, { fontSize: size }),
|
|
2222
2237
|
showTooltip: true
|
|
2223
2238
|
},
|
|
2224
2239
|
{
|
|
2225
2240
|
value: "scroll",
|
|
2226
2241
|
label: (0, import_i18n13.__)("Scroll", "elementor"),
|
|
2227
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2242
|
+
renderContent: ({ size }) => /* @__PURE__ */ React39.createElement(import_icons10.PinnedOffIcon, { fontSize: size }),
|
|
2228
2243
|
showTooltip: true
|
|
2229
2244
|
}
|
|
2230
2245
|
];
|
|
2231
2246
|
var BackgroundImageOverlayAttachment = () => {
|
|
2232
|
-
return /* @__PURE__ */
|
|
2247
|
+
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 })));
|
|
2233
2248
|
};
|
|
2234
2249
|
|
|
2235
2250
|
// src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-position.tsx
|
|
2236
|
-
var
|
|
2251
|
+
var React40 = __toESM(require("react"));
|
|
2237
2252
|
var import_editor_props20 = require("@elementor/editor-props");
|
|
2253
|
+
var import_editor_ui3 = require("@elementor/editor-ui");
|
|
2238
2254
|
var import_icons11 = require("@elementor/icons");
|
|
2239
|
-
var
|
|
2255
|
+
var import_ui33 = require("@elementor/ui");
|
|
2240
2256
|
var import_i18n14 = require("@wordpress/i18n");
|
|
2241
2257
|
var backgroundPositionOptions = [
|
|
2242
2258
|
{ label: (0, import_i18n14.__)("Center center", "elementor"), value: "center center" },
|
|
@@ -2262,82 +2278,82 @@ var BackgroundImageOverlayPosition = () => {
|
|
|
2262
2278
|
stringPropContext.setValue(value);
|
|
2263
2279
|
}
|
|
2264
2280
|
};
|
|
2265
|
-
return /* @__PURE__ */
|
|
2266
|
-
|
|
2281
|
+
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(
|
|
2282
|
+
import_ui33.Select,
|
|
2267
2283
|
{
|
|
2268
2284
|
size: "tiny",
|
|
2269
2285
|
value: (backgroundImageOffsetContext.value ? "custom" : stringPropContext.value) ?? "",
|
|
2270
2286
|
onChange: handlePositionChange,
|
|
2271
2287
|
fullWidth: true
|
|
2272
2288
|
},
|
|
2273
|
-
backgroundPositionOptions.map(({ label, value }) => /* @__PURE__ */
|
|
2274
|
-
)))), isCustom ? /* @__PURE__ */
|
|
2289
|
+
backgroundPositionOptions.map(({ label, value }) => /* @__PURE__ */ React40.createElement(import_editor_ui3.MenuListItem, { key: value, value: value ?? "" }, label))
|
|
2290
|
+
)))), 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);
|
|
2275
2291
|
};
|
|
2276
2292
|
|
|
2277
2293
|
// src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-repeat.tsx
|
|
2278
|
-
var
|
|
2294
|
+
var React41 = __toESM(require("react"));
|
|
2279
2295
|
var import_icons12 = require("@elementor/icons");
|
|
2280
|
-
var
|
|
2296
|
+
var import_ui34 = require("@elementor/ui");
|
|
2281
2297
|
var import_i18n15 = require("@wordpress/i18n");
|
|
2282
2298
|
var repeatControlOptions = [
|
|
2283
2299
|
{
|
|
2284
2300
|
value: "repeat",
|
|
2285
2301
|
label: (0, import_i18n15.__)("Repeat", "elementor"),
|
|
2286
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2302
|
+
renderContent: ({ size }) => /* @__PURE__ */ React41.createElement(import_icons12.GridDotsIcon, { fontSize: size }),
|
|
2287
2303
|
showTooltip: true
|
|
2288
2304
|
},
|
|
2289
2305
|
{
|
|
2290
2306
|
value: "repeat-x",
|
|
2291
2307
|
label: (0, import_i18n15.__)("Repeat-x", "elementor"),
|
|
2292
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2308
|
+
renderContent: ({ size }) => /* @__PURE__ */ React41.createElement(import_icons12.DotsHorizontalIcon, { fontSize: size }),
|
|
2293
2309
|
showTooltip: true
|
|
2294
2310
|
},
|
|
2295
2311
|
{
|
|
2296
2312
|
value: "repeat-y",
|
|
2297
2313
|
label: (0, import_i18n15.__)("Repeat-y", "elementor"),
|
|
2298
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2314
|
+
renderContent: ({ size }) => /* @__PURE__ */ React41.createElement(import_icons12.DotsVerticalIcon, { fontSize: size }),
|
|
2299
2315
|
showTooltip: true
|
|
2300
2316
|
},
|
|
2301
2317
|
{
|
|
2302
2318
|
value: "no-repeat",
|
|
2303
2319
|
label: (0, import_i18n15.__)("No-repeat", "elementor"),
|
|
2304
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2320
|
+
renderContent: ({ size }) => /* @__PURE__ */ React41.createElement(import_icons12.XIcon, { fontSize: size }),
|
|
2305
2321
|
showTooltip: true
|
|
2306
2322
|
}
|
|
2307
2323
|
];
|
|
2308
2324
|
var BackgroundImageOverlayRepeat = () => {
|
|
2309
|
-
return /* @__PURE__ */
|
|
2325
|
+
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 })));
|
|
2310
2326
|
};
|
|
2311
2327
|
|
|
2312
2328
|
// src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-size.tsx
|
|
2313
|
-
var
|
|
2329
|
+
var React42 = __toESM(require("react"));
|
|
2314
2330
|
var import_editor_props21 = require("@elementor/editor-props");
|
|
2315
2331
|
var import_icons13 = require("@elementor/icons");
|
|
2316
|
-
var
|
|
2332
|
+
var import_ui35 = require("@elementor/ui");
|
|
2317
2333
|
var import_i18n16 = require("@wordpress/i18n");
|
|
2318
2334
|
var sizeControlOptions = [
|
|
2319
2335
|
{
|
|
2320
2336
|
value: "auto",
|
|
2321
2337
|
label: (0, import_i18n16.__)("Auto", "elementor"),
|
|
2322
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2338
|
+
renderContent: ({ size }) => /* @__PURE__ */ React42.createElement(import_icons13.LetterAIcon, { fontSize: size }),
|
|
2323
2339
|
showTooltip: true
|
|
2324
2340
|
},
|
|
2325
2341
|
{
|
|
2326
2342
|
value: "cover",
|
|
2327
2343
|
label: (0, import_i18n16.__)("Cover", "elementor"),
|
|
2328
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2344
|
+
renderContent: ({ size }) => /* @__PURE__ */ React42.createElement(import_icons13.ArrowsMaximizeIcon, { fontSize: size }),
|
|
2329
2345
|
showTooltip: true
|
|
2330
2346
|
},
|
|
2331
2347
|
{
|
|
2332
2348
|
value: "contain",
|
|
2333
2349
|
label: (0, import_i18n16.__)("Contain", "elementor"),
|
|
2334
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2350
|
+
renderContent: ({ size }) => /* @__PURE__ */ React42.createElement(import_icons13.ArrowBarBothIcon, { fontSize: size }),
|
|
2335
2351
|
showTooltip: true
|
|
2336
2352
|
},
|
|
2337
2353
|
{
|
|
2338
2354
|
value: "custom",
|
|
2339
2355
|
label: (0, import_i18n16.__)("Custom", "elementor"),
|
|
2340
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2356
|
+
renderContent: ({ size }) => /* @__PURE__ */ React42.createElement(import_icons13.PencilIcon, { fontSize: size }),
|
|
2341
2357
|
showTooltip: true
|
|
2342
2358
|
}
|
|
2343
2359
|
];
|
|
@@ -2352,7 +2368,7 @@ var BackgroundImageOverlaySize = () => {
|
|
|
2352
2368
|
stringPropContext.setValue(size);
|
|
2353
2369
|
}
|
|
2354
2370
|
};
|
|
2355
|
-
return /* @__PURE__ */
|
|
2371
|
+
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(
|
|
2356
2372
|
ControlToggleButtonGroup,
|
|
2357
2373
|
{
|
|
2358
2374
|
exclusive: true,
|
|
@@ -2360,25 +2376,25 @@ var BackgroundImageOverlaySize = () => {
|
|
|
2360
2376
|
value: backgroundImageScaleContext.value ? "custom" : stringPropContext.value,
|
|
2361
2377
|
onChange: handleSizeChange
|
|
2362
2378
|
}
|
|
2363
|
-
)))), isCustom ? /* @__PURE__ */
|
|
2379
|
+
)))), 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(
|
|
2364
2380
|
SizeControl,
|
|
2365
2381
|
{
|
|
2366
|
-
startIcon: /* @__PURE__ */
|
|
2382
|
+
startIcon: /* @__PURE__ */ React42.createElement(import_icons13.ArrowsMoveHorizontalIcon, { fontSize: "tiny" }),
|
|
2367
2383
|
extendedValues: ["auto"]
|
|
2368
2384
|
}
|
|
2369
|
-
))), /* @__PURE__ */
|
|
2385
|
+
))), /* @__PURE__ */ React42.createElement(import_ui35.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React42.createElement(PropKeyProvider, { bind: "height" }, /* @__PURE__ */ React42.createElement(
|
|
2370
2386
|
SizeControl,
|
|
2371
2387
|
{
|
|
2372
|
-
startIcon: /* @__PURE__ */
|
|
2388
|
+
startIcon: /* @__PURE__ */ React42.createElement(import_icons13.ArrowsMoveVerticalIcon, { fontSize: "tiny" }),
|
|
2373
2389
|
extendedValues: ["auto"]
|
|
2374
2390
|
}
|
|
2375
2391
|
)))))) : null);
|
|
2376
2392
|
};
|
|
2377
2393
|
|
|
2378
2394
|
// src/controls/background-control/background-overlay/use-background-tabs-history.ts
|
|
2379
|
-
var
|
|
2395
|
+
var import_react15 = require("react");
|
|
2380
2396
|
var import_editor_props22 = require("@elementor/editor-props");
|
|
2381
|
-
var
|
|
2397
|
+
var import_ui36 = require("@elementor/ui");
|
|
2382
2398
|
var useBackgroundTabsHistory = ({
|
|
2383
2399
|
color: initialBackgroundColorOverlay2,
|
|
2384
2400
|
image: initialBackgroundImageOverlay,
|
|
@@ -2396,8 +2412,8 @@ var useBackgroundTabsHistory = ({
|
|
|
2396
2412
|
}
|
|
2397
2413
|
return "image";
|
|
2398
2414
|
};
|
|
2399
|
-
const { getTabsProps, getTabProps, getTabPanelProps } = (0,
|
|
2400
|
-
const valuesHistory = (0,
|
|
2415
|
+
const { getTabsProps, getTabProps, getTabPanelProps } = (0, import_ui36.useTabs)(getCurrentOverlayType());
|
|
2416
|
+
const valuesHistory = (0, import_react15.useRef)({
|
|
2401
2417
|
image: initialBackgroundImageOverlay,
|
|
2402
2418
|
color: initialBackgroundColorOverlay2,
|
|
2403
2419
|
gradient: initialBackgroundGradientOverlay2
|
|
@@ -2472,7 +2488,7 @@ var backgroundResolutionOptions = [
|
|
|
2472
2488
|
];
|
|
2473
2489
|
var BackgroundOverlayRepeaterControl = createControl(() => {
|
|
2474
2490
|
const { propType, value: overlayValues, setValue } = useBoundProp(import_editor_props23.backgroundOverlayPropTypeUtil);
|
|
2475
|
-
return /* @__PURE__ */
|
|
2491
|
+
return /* @__PURE__ */ React43.createElement(PropProvider, { propType, value: overlayValues, setValue }, /* @__PURE__ */ React43.createElement(
|
|
2476
2492
|
Repeater,
|
|
2477
2493
|
{
|
|
2478
2494
|
openOnAdd: true,
|
|
@@ -2489,7 +2505,7 @@ var BackgroundOverlayRepeaterControl = createControl(() => {
|
|
|
2489
2505
|
));
|
|
2490
2506
|
});
|
|
2491
2507
|
var ItemContent2 = ({ bind }) => {
|
|
2492
|
-
return /* @__PURE__ */
|
|
2508
|
+
return /* @__PURE__ */ React43.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React43.createElement(Content2, null));
|
|
2493
2509
|
};
|
|
2494
2510
|
var Content2 = () => {
|
|
2495
2511
|
const { getTabsProps, getTabProps, getTabPanelProps } = useBackgroundTabsHistory({
|
|
@@ -2497,27 +2513,27 @@ var Content2 = () => {
|
|
|
2497
2513
|
color: initialBackgroundColorOverlay.value,
|
|
2498
2514
|
gradient: initialBackgroundGradientOverlay.value
|
|
2499
2515
|
});
|
|
2500
|
-
return /* @__PURE__ */
|
|
2501
|
-
|
|
2516
|
+
return /* @__PURE__ */ React43.createElement(import_ui37.Box, { sx: { width: "100%" } }, /* @__PURE__ */ React43.createElement(import_ui37.Box, { sx: { borderBottom: 1, borderColor: "divider" } }, /* @__PURE__ */ React43.createElement(
|
|
2517
|
+
import_ui37.Tabs,
|
|
2502
2518
|
{
|
|
2503
2519
|
size: "small",
|
|
2504
2520
|
variant: "fullWidth",
|
|
2505
2521
|
...getTabsProps(),
|
|
2506
2522
|
"aria-label": (0, import_i18n17.__)("Background Overlay", "elementor")
|
|
2507
2523
|
},
|
|
2508
|
-
/* @__PURE__ */
|
|
2509
|
-
/* @__PURE__ */
|
|
2510
|
-
/* @__PURE__ */
|
|
2511
|
-
)), /* @__PURE__ */
|
|
2524
|
+
/* @__PURE__ */ React43.createElement(import_ui37.Tab, { label: (0, import_i18n17.__)("Image", "elementor"), ...getTabProps("image") }),
|
|
2525
|
+
/* @__PURE__ */ React43.createElement(import_ui37.Tab, { label: (0, import_i18n17.__)("Gradient", "elementor"), ...getTabProps("gradient") }),
|
|
2526
|
+
/* @__PURE__ */ React43.createElement(import_ui37.Tab, { label: (0, import_i18n17.__)("Color", "elementor"), ...getTabProps("color") })
|
|
2527
|
+
)), /* @__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))));
|
|
2512
2528
|
};
|
|
2513
2529
|
var ItemIcon2 = ({ value }) => {
|
|
2514
2530
|
switch (value.$$type) {
|
|
2515
2531
|
case "background-image-overlay":
|
|
2516
|
-
return /* @__PURE__ */
|
|
2532
|
+
return /* @__PURE__ */ React43.createElement(ItemIconImage, { value });
|
|
2517
2533
|
case "background-color-overlay":
|
|
2518
|
-
return /* @__PURE__ */
|
|
2534
|
+
return /* @__PURE__ */ React43.createElement(ItemIconColor, { value });
|
|
2519
2535
|
case "background-gradient-overlay":
|
|
2520
|
-
return /* @__PURE__ */
|
|
2536
|
+
return /* @__PURE__ */ React43.createElement(ItemIconGradient, { value });
|
|
2521
2537
|
default:
|
|
2522
2538
|
return null;
|
|
2523
2539
|
}
|
|
@@ -2530,56 +2546,70 @@ var extractColorFrom = (prop) => {
|
|
|
2530
2546
|
};
|
|
2531
2547
|
var ItemIconColor = ({ value: prop }) => {
|
|
2532
2548
|
const color = extractColorFrom(prop);
|
|
2533
|
-
return /* @__PURE__ */
|
|
2549
|
+
return /* @__PURE__ */ React43.createElement(StyledUnstableColorIndicator, { size: "inherit", component: "span", value: color });
|
|
2534
2550
|
};
|
|
2535
2551
|
var ItemIconImage = ({ value }) => {
|
|
2536
2552
|
const { imageUrl } = useImage(value);
|
|
2537
|
-
return /* @__PURE__ */
|
|
2553
|
+
return /* @__PURE__ */ React43.createElement(
|
|
2554
|
+
import_ui37.CardMedia,
|
|
2555
|
+
{
|
|
2556
|
+
image: imageUrl,
|
|
2557
|
+
sx: (theme) => ({
|
|
2558
|
+
height: "1em",
|
|
2559
|
+
width: "1em",
|
|
2560
|
+
borderRadius: `${theme.shape.borderRadius / 2}px`,
|
|
2561
|
+
outline: `1px solid ${theme.palette.action.disabled}`
|
|
2562
|
+
})
|
|
2563
|
+
}
|
|
2564
|
+
);
|
|
2538
2565
|
};
|
|
2539
2566
|
var ItemIconGradient = ({ value }) => {
|
|
2540
2567
|
const gradient = getGradientValue(value);
|
|
2541
|
-
return /* @__PURE__ */
|
|
2568
|
+
return /* @__PURE__ */ React43.createElement(StyledUnstableColorIndicator, { size: "inherit", component: "span", value: gradient });
|
|
2542
2569
|
};
|
|
2543
2570
|
var ItemLabel2 = ({ value }) => {
|
|
2544
2571
|
switch (value.$$type) {
|
|
2545
2572
|
case "background-image-overlay":
|
|
2546
|
-
return /* @__PURE__ */
|
|
2573
|
+
return /* @__PURE__ */ React43.createElement(ItemLabelImage, { value });
|
|
2547
2574
|
case "background-color-overlay":
|
|
2548
|
-
return /* @__PURE__ */
|
|
2575
|
+
return /* @__PURE__ */ React43.createElement(ItemLabelColor, { value });
|
|
2549
2576
|
case "background-gradient-overlay":
|
|
2550
|
-
return /* @__PURE__ */
|
|
2577
|
+
return /* @__PURE__ */ React43.createElement(ItemLabelGradient, { value });
|
|
2551
2578
|
default:
|
|
2552
2579
|
return null;
|
|
2553
2580
|
}
|
|
2554
2581
|
};
|
|
2555
2582
|
var ItemLabelColor = ({ value: prop }) => {
|
|
2556
2583
|
const color = extractColorFrom(prop);
|
|
2557
|
-
return /* @__PURE__ */
|
|
2584
|
+
return /* @__PURE__ */ React43.createElement("span", null, color);
|
|
2558
2585
|
};
|
|
2559
2586
|
var ItemLabelImage = ({ value }) => {
|
|
2560
2587
|
const { imageTitle } = useImage(value);
|
|
2561
|
-
return /* @__PURE__ */
|
|
2588
|
+
return /* @__PURE__ */ React43.createElement("span", null, imageTitle);
|
|
2562
2589
|
};
|
|
2563
2590
|
var ItemLabelGradient = ({ value }) => {
|
|
2564
2591
|
if (value.value.type.value === "linear") {
|
|
2565
|
-
return /* @__PURE__ */
|
|
2592
|
+
return /* @__PURE__ */ React43.createElement("span", null, (0, import_i18n17.__)("Linear Gradient", "elementor"));
|
|
2566
2593
|
}
|
|
2567
|
-
return /* @__PURE__ */
|
|
2594
|
+
return /* @__PURE__ */ React43.createElement("span", null, (0, import_i18n17.__)("Radial Gradient", "elementor"));
|
|
2568
2595
|
};
|
|
2569
2596
|
var ColorOverlayContent = () => {
|
|
2570
2597
|
const propContext = useBoundProp(import_editor_props23.backgroundColorOverlayPropTypeUtil);
|
|
2571
|
-
return /* @__PURE__ */
|
|
2598
|
+
return /* @__PURE__ */ React43.createElement(PropProvider, { ...propContext }, /* @__PURE__ */ React43.createElement(PropKeyProvider, { bind: "color" }, /* @__PURE__ */ React43.createElement(ColorControl, null)));
|
|
2572
2599
|
};
|
|
2573
2600
|
var ImageOverlayContent = () => {
|
|
2574
2601
|
const propContext = useBoundProp(import_editor_props23.backgroundImageOverlayPropTypeUtil);
|
|
2575
|
-
return /* @__PURE__ */
|
|
2602
|
+
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(
|
|
2576
2603
|
ImageControl,
|
|
2577
2604
|
{
|
|
2578
2605
|
resolutionLabel: (0, import_i18n17.__)("Resolution", "elementor"),
|
|
2579
2606
|
sizes: backgroundResolutionOptions
|
|
2580
2607
|
}
|
|
2581
|
-
)))), /* @__PURE__ */
|
|
2608
|
+
)))), /* @__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)));
|
|
2582
2609
|
};
|
|
2610
|
+
var StyledUnstableColorIndicator = (0, import_ui37.styled)(import_ui37.UnstableColorIndicator)(({ theme }) => ({
|
|
2611
|
+
borderRadius: `${theme.shape.borderRadius / 2}px`
|
|
2612
|
+
}));
|
|
2583
2613
|
var useImage = (image) => {
|
|
2584
2614
|
let imageTitle, imageUrl = null;
|
|
2585
2615
|
const imageSrc = image?.value.image.value?.src.value;
|
|
@@ -2606,28 +2636,8 @@ var getGradientValue = (value) => {
|
|
|
2606
2636
|
// src/controls/background-control/background-control.tsx
|
|
2607
2637
|
var BackgroundControl = createControl(() => {
|
|
2608
2638
|
const propContext = useBoundProp(import_editor_props24.backgroundPropTypeUtil);
|
|
2609
|
-
return /* @__PURE__ */
|
|
2639
|
+
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))))));
|
|
2610
2640
|
});
|
|
2611
|
-
|
|
2612
|
-
// src/control-adornments/control-adornments-context.tsx
|
|
2613
|
-
var React42 = __toESM(require("react"));
|
|
2614
|
-
var import_react15 = require("react");
|
|
2615
|
-
var Context2 = (0, import_react15.createContext)(null);
|
|
2616
|
-
var ControlAdornmentsProvider = ({ children, items }) => /* @__PURE__ */ React42.createElement(Context2.Provider, { value: { items } }, children);
|
|
2617
|
-
var useControlAdornments = () => {
|
|
2618
|
-
const context = (0, import_react15.useContext)(Context2);
|
|
2619
|
-
return context?.items ?? [];
|
|
2620
|
-
};
|
|
2621
|
-
|
|
2622
|
-
// src/control-adornments/control-adornments.tsx
|
|
2623
|
-
var React43 = __toESM(require("react"));
|
|
2624
|
-
function ControlAdornments() {
|
|
2625
|
-
const items = useControlAdornments();
|
|
2626
|
-
if (items?.length === 0) {
|
|
2627
|
-
return null;
|
|
2628
|
-
}
|
|
2629
|
-
return /* @__PURE__ */ React43.createElement(React43.Fragment, null, items.map(({ Adornment, id }) => /* @__PURE__ */ React43.createElement(Adornment, { key: id })));
|
|
2630
|
-
}
|
|
2631
2641
|
// Annotate the CommonJS export names for ESM import in node:
|
|
2632
2642
|
0 && (module.exports = {
|
|
2633
2643
|
BackgroundControl,
|
|
@@ -2636,7 +2646,7 @@ function ControlAdornments() {
|
|
|
2636
2646
|
ControlActionsProvider,
|
|
2637
2647
|
ControlAdornments,
|
|
2638
2648
|
ControlAdornmentsProvider,
|
|
2639
|
-
|
|
2649
|
+
ControlFormLabel,
|
|
2640
2650
|
ControlReplacementProvider,
|
|
2641
2651
|
ControlToggleButtonGroup,
|
|
2642
2652
|
EqualUnequalSizesControl,
|