@elementor/editor-controls 0.36.0 → 1.0.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 +17 -0
- package/dist/index.d.mts +14 -9
- package/dist/index.d.ts +14 -9
- package/dist/index.js +750 -534
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +688 -464
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -3
- package/src/bound-prop-context/use-bound-prop.ts +4 -1
- package/src/components/popover-grid-container.tsx +7 -10
- package/src/components/size-control/size-input.tsx +125 -0
- package/src/components/{text-field-inner-selection.tsx → size-control/text-field-inner-selection.tsx} +33 -16
- package/src/components/text-field-popover.tsx +47 -0
- package/src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-position.tsx +11 -3
- package/src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-size.tsx +7 -3
- package/src/controls/box-shadow-repeater-control.tsx +8 -6
- package/src/controls/equal-unequal-sizes-control.tsx +24 -14
- package/src/controls/gap-control.tsx +17 -6
- package/src/controls/linked-dimensions-control.tsx +62 -81
- package/src/controls/size-control.tsx +179 -149
- package/src/controls/stroke-control.tsx +9 -6
- package/src/hooks/use-size-extended-options.ts +21 -0
- package/src/index.ts +1 -1
- package/src/utils/size-control.ts +10 -0
package/dist/index.mjs
CHANGED
|
@@ -442,16 +442,38 @@ var TextAreaControl = createControl(({ placeholder }) => {
|
|
|
442
442
|
});
|
|
443
443
|
|
|
444
444
|
// src/controls/size-control.tsx
|
|
445
|
+
import * as React16 from "react";
|
|
446
|
+
import { useEffect as useEffect2, useState as useState3 } from "react";
|
|
447
|
+
import { sizePropTypeUtil } from "@elementor/editor-props";
|
|
448
|
+
import { useActiveBreakpoint } from "@elementor/editor-responsive";
|
|
449
|
+
import { usePopupState as usePopupState2 } from "@elementor/ui";
|
|
450
|
+
|
|
451
|
+
// src/components/size-control/size-input.tsx
|
|
445
452
|
import * as React14 from "react";
|
|
446
453
|
import { useRef } from "react";
|
|
447
|
-
import {
|
|
454
|
+
import { PencilIcon } from "@elementor/icons";
|
|
448
455
|
import { Box, InputAdornment as InputAdornment2 } from "@elementor/ui";
|
|
449
456
|
|
|
450
|
-
// src/
|
|
457
|
+
// src/utils/size-control.ts
|
|
458
|
+
var defaultUnits = ["px", "%", "em", "rem", "vw", "vh"];
|
|
459
|
+
var defaultExtendedOptions = ["auto", "custom"];
|
|
460
|
+
function isUnitExtendedOption(unit) {
|
|
461
|
+
return defaultExtendedOptions.includes(unit);
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
// src/components/size-control/text-field-inner-selection.tsx
|
|
451
465
|
import * as React13 from "react";
|
|
452
466
|
import { forwardRef, useId } from "react";
|
|
453
467
|
import { MenuListItem as MenuListItem2 } from "@elementor/editor-ui";
|
|
454
|
-
import {
|
|
468
|
+
import {
|
|
469
|
+
bindMenu,
|
|
470
|
+
bindTrigger,
|
|
471
|
+
Button as Button2,
|
|
472
|
+
InputAdornment,
|
|
473
|
+
Menu,
|
|
474
|
+
TextField as TextField3,
|
|
475
|
+
usePopupState
|
|
476
|
+
} from "@elementor/ui";
|
|
455
477
|
var TextFieldInnerSelection = forwardRef(
|
|
456
478
|
({
|
|
457
479
|
placeholder,
|
|
@@ -461,36 +483,36 @@ var TextFieldInnerSelection = forwardRef(
|
|
|
461
483
|
onBlur,
|
|
462
484
|
onKeyDown,
|
|
463
485
|
onKeyUp,
|
|
464
|
-
|
|
465
|
-
|
|
486
|
+
shouldBlockInput = false,
|
|
487
|
+
inputProps,
|
|
466
488
|
disabled
|
|
467
489
|
}, ref) => {
|
|
468
490
|
return /* @__PURE__ */ React13.createElement(
|
|
469
491
|
TextField3,
|
|
470
492
|
{
|
|
471
493
|
ref,
|
|
494
|
+
sx: { input: { cursor: shouldBlockInput ? "default !important" : void 0 } },
|
|
472
495
|
size: "tiny",
|
|
473
496
|
fullWidth: true,
|
|
474
|
-
type,
|
|
497
|
+
type: shouldBlockInput ? void 0 : type,
|
|
475
498
|
value,
|
|
499
|
+
onChange: shouldBlockInput ? void 0 : onChange,
|
|
500
|
+
onKeyDown: shouldBlockInput ? void 0 : onKeyDown,
|
|
501
|
+
onKeyUp: shouldBlockInput ? void 0 : onKeyUp,
|
|
476
502
|
disabled,
|
|
477
|
-
onChange,
|
|
478
|
-
onKeyDown,
|
|
479
|
-
onKeyUp,
|
|
480
503
|
onBlur,
|
|
481
504
|
placeholder,
|
|
482
|
-
InputProps:
|
|
483
|
-
endAdornment,
|
|
484
|
-
startAdornment
|
|
485
|
-
}
|
|
505
|
+
InputProps: inputProps
|
|
486
506
|
}
|
|
487
507
|
);
|
|
488
508
|
}
|
|
489
509
|
);
|
|
490
510
|
var SelectionEndAdornment = ({
|
|
491
511
|
options,
|
|
512
|
+
alternativeOptionLabels = {},
|
|
492
513
|
onClick,
|
|
493
514
|
value,
|
|
515
|
+
menuItemsAttributes = {},
|
|
494
516
|
disabled
|
|
495
517
|
}) => {
|
|
496
518
|
const popupState = usePopupState({
|
|
@@ -510,10 +532,159 @@ var SelectionEndAdornment = ({
|
|
|
510
532
|
sx: { font: "inherit", minWidth: "initial", textTransform: "uppercase" },
|
|
511
533
|
...bindTrigger(popupState)
|
|
512
534
|
},
|
|
513
|
-
value
|
|
514
|
-
), /* @__PURE__ */ React13.createElement(Menu, { MenuListProps: { dense: true }, ...bindMenu(popupState) }, options.map((option, index) => /* @__PURE__ */ React13.createElement(
|
|
535
|
+
alternativeOptionLabels[value] ?? value
|
|
536
|
+
), /* @__PURE__ */ React13.createElement(Menu, { MenuListProps: { dense: true }, ...bindMenu(popupState) }, options.map((option, index) => /* @__PURE__ */ React13.createElement(
|
|
537
|
+
MenuListItem2,
|
|
538
|
+
{
|
|
539
|
+
key: option,
|
|
540
|
+
onClick: () => handleMenuItemClick(index),
|
|
541
|
+
...menuItemsAttributes?.[option]
|
|
542
|
+
},
|
|
543
|
+
alternativeOptionLabels[option] ?? option.toUpperCase()
|
|
544
|
+
))));
|
|
545
|
+
};
|
|
546
|
+
|
|
547
|
+
// src/components/size-control/size-input.tsx
|
|
548
|
+
var RESTRICTED_INPUT_KEYS = ["e", "E", "+", "-"];
|
|
549
|
+
var SizeInput = ({
|
|
550
|
+
units: units2,
|
|
551
|
+
handleUnitChange,
|
|
552
|
+
handleSizeChange,
|
|
553
|
+
placeholder,
|
|
554
|
+
startIcon,
|
|
555
|
+
onBlur,
|
|
556
|
+
onFocus,
|
|
557
|
+
onClick,
|
|
558
|
+
size,
|
|
559
|
+
unit,
|
|
560
|
+
popupState,
|
|
561
|
+
disabled
|
|
562
|
+
}) => {
|
|
563
|
+
const unitInputBufferRef = useRef("");
|
|
564
|
+
const inputType = isUnitExtendedOption(unit) ? "text" : "number";
|
|
565
|
+
const inputValue = !isUnitExtendedOption(unit) && Number.isNaN(size) ? "" : size ?? "";
|
|
566
|
+
const handleKeyUp = (event) => {
|
|
567
|
+
const { key } = event;
|
|
568
|
+
if (!/^[a-zA-Z%]$/.test(key)) {
|
|
569
|
+
return;
|
|
570
|
+
}
|
|
571
|
+
event.preventDefault();
|
|
572
|
+
const newChar = key.toLowerCase();
|
|
573
|
+
const updatedBuffer = (unitInputBufferRef.current + newChar).slice(-3);
|
|
574
|
+
unitInputBufferRef.current = updatedBuffer;
|
|
575
|
+
const matchedUnit = units2.find((u) => u.includes(updatedBuffer)) || units2.find((u) => u.startsWith(newChar)) || units2.find((u) => u.includes(newChar));
|
|
576
|
+
if (matchedUnit) {
|
|
577
|
+
handleUnitChange(matchedUnit);
|
|
578
|
+
}
|
|
579
|
+
};
|
|
580
|
+
const popupAttributes = {
|
|
581
|
+
"aria-controls": popupState.isOpen ? popupState.popupId : void 0,
|
|
582
|
+
"aria-haspopup": true
|
|
583
|
+
};
|
|
584
|
+
const inputProps = {
|
|
585
|
+
...popupAttributes,
|
|
586
|
+
autoComplete: "off",
|
|
587
|
+
onClick,
|
|
588
|
+
onFocus,
|
|
589
|
+
startAdornment: startIcon ? /* @__PURE__ */ React14.createElement(InputAdornment2, { position: "start", disabled }, startIcon) : void 0,
|
|
590
|
+
endAdornment: /* @__PURE__ */ React14.createElement(
|
|
591
|
+
SelectionEndAdornment,
|
|
592
|
+
{
|
|
593
|
+
disabled,
|
|
594
|
+
options: units2,
|
|
595
|
+
onClick: handleUnitChange,
|
|
596
|
+
value: unit,
|
|
597
|
+
alternativeOptionLabels: {
|
|
598
|
+
custom: /* @__PURE__ */ React14.createElement(PencilIcon, { fontSize: "small" })
|
|
599
|
+
},
|
|
600
|
+
menuItemsAttributes: units2.includes("custom") ? {
|
|
601
|
+
custom: popupAttributes
|
|
602
|
+
} : void 0
|
|
603
|
+
}
|
|
604
|
+
)
|
|
605
|
+
};
|
|
606
|
+
return /* @__PURE__ */ React14.createElement(ControlActions, null, /* @__PURE__ */ React14.createElement(Box, null, /* @__PURE__ */ React14.createElement(
|
|
607
|
+
TextFieldInnerSelection,
|
|
608
|
+
{
|
|
609
|
+
disabled,
|
|
610
|
+
placeholder,
|
|
611
|
+
type: inputType,
|
|
612
|
+
value: inputValue,
|
|
613
|
+
onChange: handleSizeChange,
|
|
614
|
+
onKeyDown: (event) => {
|
|
615
|
+
if (RESTRICTED_INPUT_KEYS.includes(event.key)) {
|
|
616
|
+
event.preventDefault();
|
|
617
|
+
}
|
|
618
|
+
},
|
|
619
|
+
onKeyUp: handleKeyUp,
|
|
620
|
+
onBlur,
|
|
621
|
+
shouldBlockInput: isUnitExtendedOption(unit),
|
|
622
|
+
inputProps
|
|
623
|
+
}
|
|
624
|
+
)));
|
|
515
625
|
};
|
|
516
626
|
|
|
627
|
+
// src/components/text-field-popover.tsx
|
|
628
|
+
import * as React15 from "react";
|
|
629
|
+
import { bindPopover, Paper, Popover, TextField as TextField4 } from "@elementor/ui";
|
|
630
|
+
var TextFieldPopover = (props) => {
|
|
631
|
+
const { popupState, restoreValue, anchorRef, value, onChange } = props;
|
|
632
|
+
return /* @__PURE__ */ React15.createElement(
|
|
633
|
+
Popover,
|
|
634
|
+
{
|
|
635
|
+
disablePortal: true,
|
|
636
|
+
...bindPopover(popupState),
|
|
637
|
+
anchorOrigin: { vertical: "bottom", horizontal: "center" },
|
|
638
|
+
transformOrigin: { vertical: "top", horizontal: "center" },
|
|
639
|
+
onClose: () => {
|
|
640
|
+
restoreValue();
|
|
641
|
+
popupState.close();
|
|
642
|
+
}
|
|
643
|
+
},
|
|
644
|
+
/* @__PURE__ */ React15.createElement(
|
|
645
|
+
Paper,
|
|
646
|
+
{
|
|
647
|
+
sx: {
|
|
648
|
+
width: anchorRef.current.offsetWidth + "px",
|
|
649
|
+
borderRadius: 2,
|
|
650
|
+
p: 1.5
|
|
651
|
+
}
|
|
652
|
+
},
|
|
653
|
+
/* @__PURE__ */ React15.createElement(
|
|
654
|
+
TextField4,
|
|
655
|
+
{
|
|
656
|
+
value,
|
|
657
|
+
onChange,
|
|
658
|
+
size: "tiny",
|
|
659
|
+
type: "text",
|
|
660
|
+
fullWidth: true,
|
|
661
|
+
inputProps: {
|
|
662
|
+
autoFocus: true
|
|
663
|
+
}
|
|
664
|
+
}
|
|
665
|
+
)
|
|
666
|
+
)
|
|
667
|
+
);
|
|
668
|
+
};
|
|
669
|
+
|
|
670
|
+
// src/hooks/use-size-extended-options.ts
|
|
671
|
+
import { useMemo } from "react";
|
|
672
|
+
import { isExperimentActive } from "@elementor/editor-v1-adapters";
|
|
673
|
+
var EXPERIMENT_ID = "e_v_3_30";
|
|
674
|
+
function useSizeExtendedOptions(options, disableCustom) {
|
|
675
|
+
return useMemo(() => {
|
|
676
|
+
const isVersion330Active = isExperimentActive(EXPERIMENT_ID);
|
|
677
|
+
const shouldDisableCustom = !isVersion330Active || disableCustom;
|
|
678
|
+
const extendedOptions = [...options];
|
|
679
|
+
if (!shouldDisableCustom && !extendedOptions.includes("custom")) {
|
|
680
|
+
extendedOptions.push("custom");
|
|
681
|
+
} else if (options.includes("custom")) {
|
|
682
|
+
extendedOptions.splice(extendedOptions.indexOf("custom"), 1);
|
|
683
|
+
}
|
|
684
|
+
return extendedOptions;
|
|
685
|
+
}, [options, disableCustom]);
|
|
686
|
+
}
|
|
687
|
+
|
|
517
688
|
// src/hooks/use-sync-external-state.tsx
|
|
518
689
|
import { useEffect, useState as useState2 } from "react";
|
|
519
690
|
var useSyncExternalState = ({
|
|
@@ -548,139 +719,163 @@ var useSyncExternalState = ({
|
|
|
548
719
|
};
|
|
549
720
|
|
|
550
721
|
// src/controls/size-control.tsx
|
|
551
|
-
var
|
|
552
|
-
var
|
|
553
|
-
var
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
unit
|
|
567
|
-
}));
|
|
568
|
-
};
|
|
569
|
-
const handleSizeChange = (event) => {
|
|
570
|
-
const { value: size } = event.target;
|
|
571
|
-
setState((prev) => ({
|
|
572
|
-
...prev,
|
|
573
|
-
size: size || size === "0" ? parseFloat(size) : defaultSize
|
|
574
|
-
}));
|
|
575
|
-
};
|
|
576
|
-
const Input = extendedValues?.length ? ExtendedSizeInput : SizeInput;
|
|
577
|
-
return /* @__PURE__ */ React14.createElement(
|
|
578
|
-
Input,
|
|
579
|
-
{
|
|
580
|
-
disabled,
|
|
581
|
-
size: state.size,
|
|
582
|
-
unit: state.unit,
|
|
583
|
-
placeholder,
|
|
584
|
-
startIcon,
|
|
585
|
-
units: units2,
|
|
586
|
-
extendedValues,
|
|
587
|
-
handleSizeChange,
|
|
588
|
-
handleUnitChange,
|
|
589
|
-
onBlur: restoreValue
|
|
722
|
+
var DEFAULT_UNIT = "px";
|
|
723
|
+
var DEFAULT_SIZE = NaN;
|
|
724
|
+
var SizeControl = createControl((props) => {
|
|
725
|
+
const { units: units2 = [...defaultUnits], placeholder, startIcon, anchorRef } = props;
|
|
726
|
+
const { value: sizeValue, setValue: setSizeValue, disabled, restoreValue } = useBoundProp(sizePropTypeUtil);
|
|
727
|
+
const [internalState, setInternalState] = useState3(createStateFromSizeProp(sizeValue));
|
|
728
|
+
const activeBreakpoint = useActiveBreakpoint();
|
|
729
|
+
const extendedOptions = useSizeExtendedOptions(props.extendedOptions || [], props.disableCustom ?? false);
|
|
730
|
+
const popupState = usePopupState2({ variant: "popover" });
|
|
731
|
+
const [state, setState] = useSyncExternalState({
|
|
732
|
+
external: internalState,
|
|
733
|
+
setExternal: (newState) => setSizeValue(extractValueFromState(newState)),
|
|
734
|
+
persistWhen: (newState) => {
|
|
735
|
+
if (!newState?.unit) {
|
|
736
|
+
return false;
|
|
590
737
|
}
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
738
|
+
if (isUnitExtendedOption(newState.unit)) {
|
|
739
|
+
return newState.unit === "auto" ? true : !!newState.custom;
|
|
740
|
+
}
|
|
741
|
+
return !!newState?.numeric || newState?.numeric === 0;
|
|
742
|
+
},
|
|
743
|
+
fallback: (newState) => ({
|
|
744
|
+
unit: newState?.unit ?? DEFAULT_UNIT,
|
|
745
|
+
numeric: newState?.numeric ?? DEFAULT_SIZE,
|
|
746
|
+
custom: newState?.custom ?? ""
|
|
747
|
+
})
|
|
748
|
+
});
|
|
749
|
+
const { size: controlSize = DEFAULT_SIZE, unit: controlUnit = DEFAULT_UNIT } = extractValueFromState(state) || {};
|
|
598
750
|
const handleUnitChange = (newUnit) => {
|
|
599
|
-
if (
|
|
600
|
-
|
|
601
|
-
} else {
|
|
602
|
-
props.handleUnitChange(newUnit);
|
|
751
|
+
if (newUnit === "custom") {
|
|
752
|
+
popupState.open(anchorRef?.current);
|
|
603
753
|
}
|
|
754
|
+
setState((prev) => ({ ...prev, unit: newUnit }));
|
|
604
755
|
};
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
{
|
|
608
|
-
...
|
|
609
|
-
units: [...props.units, ...extendedValues],
|
|
610
|
-
handleUnitChange,
|
|
611
|
-
unit
|
|
612
|
-
}
|
|
613
|
-
);
|
|
614
|
-
};
|
|
615
|
-
var RESTRICTED_INPUT_KEYS = ["e", "E", "+", "-"];
|
|
616
|
-
var SizeInput = ({
|
|
617
|
-
units: units2,
|
|
618
|
-
handleUnitChange,
|
|
619
|
-
handleSizeChange,
|
|
620
|
-
placeholder,
|
|
621
|
-
startIcon,
|
|
622
|
-
onBlur,
|
|
623
|
-
size,
|
|
624
|
-
unit,
|
|
625
|
-
disabled
|
|
626
|
-
}) => {
|
|
627
|
-
const unitInputBufferRef = useRef("");
|
|
628
|
-
const handleKeyUp = (event) => {
|
|
629
|
-
const { key } = event;
|
|
630
|
-
if (!/^[a-zA-Z%]$/.test(key)) {
|
|
756
|
+
const handleSizeChange = (event) => {
|
|
757
|
+
const { value: size } = event.target;
|
|
758
|
+
if (controlUnit === "auto") {
|
|
759
|
+
setState((prev) => ({ ...prev, unit: controlUnit }));
|
|
631
760
|
return;
|
|
632
761
|
}
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
762
|
+
setState((prev) => ({
|
|
763
|
+
...prev,
|
|
764
|
+
[controlUnit === "custom" ? "custom" : "numeric"]: formatSize(size, controlUnit),
|
|
765
|
+
unit: controlUnit
|
|
766
|
+
}));
|
|
767
|
+
};
|
|
768
|
+
const onInputFocus = (event) => {
|
|
769
|
+
if (isUnitExtendedOption(state.unit)) {
|
|
770
|
+
event.target?.blur();
|
|
640
771
|
}
|
|
641
772
|
};
|
|
642
|
-
|
|
643
|
-
|
|
773
|
+
const onInputClick = (event) => {
|
|
774
|
+
if (event.target.closest("input") && "custom" === state.unit) {
|
|
775
|
+
popupState.open(anchorRef?.current);
|
|
776
|
+
}
|
|
777
|
+
};
|
|
778
|
+
useEffect2(() => {
|
|
779
|
+
const newState = createStateFromSizeProp(sizeValue);
|
|
780
|
+
const currentUnit = isUnitExtendedOption(state.unit) ? "custom" : "numeric";
|
|
781
|
+
const mergedStates = { ...state, [currentUnit]: newState[currentUnit] };
|
|
782
|
+
if (mergedStates.unit !== "auto" && areStatesEqual(state, mergedStates)) {
|
|
783
|
+
return;
|
|
784
|
+
}
|
|
785
|
+
if (state.unit === newState.unit) {
|
|
786
|
+
setInternalState(mergedStates);
|
|
787
|
+
return;
|
|
788
|
+
}
|
|
789
|
+
setState(newState);
|
|
790
|
+
}, [sizeValue]);
|
|
791
|
+
useEffect2(() => {
|
|
792
|
+
const newState = createStateFromSizeProp(sizeValue);
|
|
793
|
+
if (activeBreakpoint && !areStatesEqual(newState, state)) {
|
|
794
|
+
setState(newState);
|
|
795
|
+
}
|
|
796
|
+
}, [activeBreakpoint]);
|
|
797
|
+
return /* @__PURE__ */ React16.createElement(React16.Fragment, null, /* @__PURE__ */ React16.createElement(
|
|
798
|
+
SizeInput,
|
|
644
799
|
{
|
|
645
800
|
disabled,
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
disabled,
|
|
650
|
-
options: units2,
|
|
651
|
-
onClick: handleUnitChange,
|
|
652
|
-
value: unit ?? defaultUnit
|
|
653
|
-
}
|
|
654
|
-
),
|
|
801
|
+
size: controlSize,
|
|
802
|
+
unit: controlUnit,
|
|
803
|
+
units: [...units2, ...extendedOptions || []],
|
|
655
804
|
placeholder,
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
event.preventDefault();
|
|
664
|
-
}
|
|
665
|
-
},
|
|
666
|
-
onKeyUp: handleKeyUp
|
|
805
|
+
startIcon,
|
|
806
|
+
handleSizeChange,
|
|
807
|
+
handleUnitChange,
|
|
808
|
+
onBlur: restoreValue,
|
|
809
|
+
onFocus: onInputFocus,
|
|
810
|
+
onClick: onInputClick,
|
|
811
|
+
popupState
|
|
667
812
|
}
|
|
668
|
-
)
|
|
669
|
-
|
|
813
|
+
), anchorRef?.current && /* @__PURE__ */ React16.createElement(
|
|
814
|
+
TextFieldPopover,
|
|
815
|
+
{
|
|
816
|
+
popupState,
|
|
817
|
+
anchorRef,
|
|
818
|
+
restoreValue,
|
|
819
|
+
value: controlSize,
|
|
820
|
+
onChange: handleSizeChange
|
|
821
|
+
}
|
|
822
|
+
));
|
|
823
|
+
});
|
|
824
|
+
function formatSize(size, unit) {
|
|
825
|
+
if (isUnitExtendedOption(unit)) {
|
|
826
|
+
return unit === "auto" ? "" : String(size ?? "");
|
|
827
|
+
}
|
|
828
|
+
return size || size === 0 ? Number(size) : NaN;
|
|
829
|
+
}
|
|
830
|
+
function createStateFromSizeProp(sizeValue) {
|
|
831
|
+
const unit = sizeValue?.unit ?? DEFAULT_UNIT;
|
|
832
|
+
const size = sizeValue?.size ?? "";
|
|
833
|
+
return {
|
|
834
|
+
numeric: !isUnitExtendedOption(unit) && !isNaN(Number(size)) && (size || size === 0) ? Number(size) : DEFAULT_SIZE,
|
|
835
|
+
custom: unit === "custom" ? String(size) : "",
|
|
836
|
+
unit
|
|
837
|
+
};
|
|
838
|
+
}
|
|
839
|
+
function extractValueFromState(state) {
|
|
840
|
+
if (!state) {
|
|
841
|
+
return null;
|
|
842
|
+
}
|
|
843
|
+
if (!state?.unit) {
|
|
844
|
+
return { size: DEFAULT_SIZE, unit: DEFAULT_UNIT };
|
|
845
|
+
}
|
|
846
|
+
const { unit } = state;
|
|
847
|
+
if (unit === "auto") {
|
|
848
|
+
return { size: "", unit };
|
|
849
|
+
}
|
|
850
|
+
return {
|
|
851
|
+
size: state[unit === "custom" ? "custom" : "numeric"],
|
|
852
|
+
unit
|
|
853
|
+
};
|
|
854
|
+
}
|
|
855
|
+
function areStatesEqual(state1, state2) {
|
|
856
|
+
if (state1.unit !== state2.unit || state1.custom !== state2.custom) {
|
|
857
|
+
return false;
|
|
858
|
+
}
|
|
859
|
+
if (isUnitExtendedOption(state1.unit)) {
|
|
860
|
+
return state1.custom === state2.custom;
|
|
861
|
+
}
|
|
862
|
+
return state1.numeric === state2.numeric || isNaN(state1.numeric) && isNaN(state2.numeric);
|
|
863
|
+
}
|
|
670
864
|
|
|
671
865
|
// src/controls/stroke-control.tsx
|
|
672
|
-
import * as
|
|
866
|
+
import * as React19 from "react";
|
|
867
|
+
import { forwardRef as forwardRef2, useRef as useRef2 } from "react";
|
|
673
868
|
import { strokePropTypeUtil } from "@elementor/editor-props";
|
|
674
869
|
import { Grid as Grid2 } from "@elementor/ui";
|
|
675
870
|
import { __ as __3 } from "@wordpress/i18n";
|
|
676
871
|
|
|
677
872
|
// src/components/section-content.tsx
|
|
678
|
-
import * as
|
|
873
|
+
import * as React17 from "react";
|
|
679
874
|
import { Stack as Stack3 } from "@elementor/ui";
|
|
680
|
-
var SectionContent = ({ gap = 2, sx, children }) => /* @__PURE__ */
|
|
875
|
+
var SectionContent = ({ gap = 2, sx, children }) => /* @__PURE__ */ React17.createElement(Stack3, { gap, sx: { ...sx } }, children);
|
|
681
876
|
|
|
682
877
|
// src/controls/color-control.tsx
|
|
683
|
-
import * as
|
|
878
|
+
import * as React18 from "react";
|
|
684
879
|
import { colorPropTypeUtil } from "@elementor/editor-props";
|
|
685
880
|
import { UnstableColorField } from "@elementor/ui";
|
|
686
881
|
var ColorControl = createControl(
|
|
@@ -689,7 +884,7 @@ var ColorControl = createControl(
|
|
|
689
884
|
const handleChange = (selectedColor) => {
|
|
690
885
|
setValue(selectedColor || null);
|
|
691
886
|
};
|
|
692
|
-
return /* @__PURE__ */
|
|
887
|
+
return /* @__PURE__ */ React18.createElement(ControlActions, null, /* @__PURE__ */ React18.createElement(
|
|
693
888
|
UnstableColorField,
|
|
694
889
|
{
|
|
695
890
|
size: "tiny",
|
|
@@ -721,57 +916,57 @@ var ColorControl = createControl(
|
|
|
721
916
|
var units = ["px", "em", "rem"];
|
|
722
917
|
var StrokeControl = createControl(() => {
|
|
723
918
|
const propContext = useBoundProp(strokePropTypeUtil);
|
|
724
|
-
|
|
919
|
+
const rowRef = useRef2();
|
|
920
|
+
return /* @__PURE__ */ React19.createElement(PropProvider, { ...propContext }, /* @__PURE__ */ React19.createElement(SectionContent, null, /* @__PURE__ */ React19.createElement(Control, { bind: "width", label: __3("Stroke width", "elementor"), ref: rowRef }, /* @__PURE__ */ React19.createElement(SizeControl, { units, anchorRef: rowRef })), /* @__PURE__ */ React19.createElement(Control, { bind: "color", label: __3("Stroke color", "elementor") }, /* @__PURE__ */ React19.createElement(ColorControl, null))));
|
|
725
921
|
});
|
|
726
|
-
var Control = ({ bind, label, children }) => /* @__PURE__ */
|
|
922
|
+
var Control = forwardRef2(({ bind, label, children }, ref) => /* @__PURE__ */ React19.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React19.createElement(Grid2, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap", ref }, /* @__PURE__ */ React19.createElement(Grid2, { item: true, xs: 6 }, /* @__PURE__ */ React19.createElement(ControlFormLabel, null, label)), /* @__PURE__ */ React19.createElement(Grid2, { item: true, xs: 6 }, children))));
|
|
727
923
|
|
|
728
924
|
// src/controls/box-shadow-repeater-control.tsx
|
|
729
|
-
import * as
|
|
925
|
+
import * as React26 from "react";
|
|
926
|
+
import { useRef as useRef3 } from "react";
|
|
730
927
|
import { boxShadowPropTypeUtil, shadowPropTypeUtil } from "@elementor/editor-props";
|
|
731
928
|
import { FormLabel as FormLabel2, Grid as Grid4, UnstableColorIndicator } from "@elementor/ui";
|
|
732
929
|
import { __ as __5 } from "@wordpress/i18n";
|
|
733
930
|
|
|
734
931
|
// src/components/popover-content.tsx
|
|
735
|
-
import * as
|
|
932
|
+
import * as React20 from "react";
|
|
736
933
|
import { Stack as Stack4 } from "@elementor/ui";
|
|
737
|
-
var PopoverContent = ({ alignItems, gap = 1.5, p, pt, pb, children }) => /* @__PURE__ */
|
|
934
|
+
var PopoverContent = ({ alignItems, gap = 1.5, p, pt, pb, children }) => /* @__PURE__ */ React20.createElement(Stack4, { alignItems, gap, p, pt, pb }, children);
|
|
738
935
|
|
|
739
936
|
// src/components/popover-grid-container.tsx
|
|
740
|
-
import
|
|
937
|
+
import { forwardRef as forwardRef3 } from "react";
|
|
938
|
+
import * as React21 from "react";
|
|
741
939
|
import { Grid as Grid3 } from "@elementor/ui";
|
|
742
|
-
var PopoverGridContainer = (
|
|
743
|
-
gap = 1.5,
|
|
744
|
-
|
|
745
|
-
flexWrap = "nowrap",
|
|
746
|
-
children
|
|
747
|
-
}) => /* @__PURE__ */ React19.createElement(Grid3, { container: true, gap, alignItems, flexWrap }, children);
|
|
940
|
+
var PopoverGridContainer = forwardRef3(
|
|
941
|
+
({ gap = 1.5, alignItems = "center", flexWrap = "nowrap", children }, ref) => /* @__PURE__ */ React21.createElement(Grid3, { container: true, gap, alignItems, flexWrap, ref }, children)
|
|
942
|
+
);
|
|
748
943
|
|
|
749
944
|
// src/components/repeater.tsx
|
|
750
|
-
import * as
|
|
751
|
-
import { useEffect as
|
|
945
|
+
import * as React25 from "react";
|
|
946
|
+
import { useEffect as useEffect3, useState as useState4 } from "react";
|
|
752
947
|
import { CopyIcon, EyeIcon, EyeOffIcon, PlusIcon, XIcon } from "@elementor/icons";
|
|
753
948
|
import {
|
|
754
|
-
bindPopover,
|
|
949
|
+
bindPopover as bindPopover2,
|
|
755
950
|
bindTrigger as bindTrigger2,
|
|
756
951
|
Box as Box2,
|
|
757
952
|
IconButton,
|
|
758
|
-
Popover,
|
|
953
|
+
Popover as Popover2,
|
|
759
954
|
Stack as Stack5,
|
|
760
955
|
Tooltip,
|
|
761
956
|
Typography,
|
|
762
957
|
UnstableTag,
|
|
763
|
-
usePopupState as
|
|
958
|
+
usePopupState as usePopupState3
|
|
764
959
|
} from "@elementor/ui";
|
|
765
960
|
import { __ as __4 } from "@wordpress/i18n";
|
|
766
961
|
|
|
767
962
|
// src/control-adornments/control-adornments.tsx
|
|
768
|
-
import * as
|
|
963
|
+
import * as React23 from "react";
|
|
769
964
|
|
|
770
965
|
// src/control-adornments/control-adornments-context.tsx
|
|
771
|
-
import * as
|
|
966
|
+
import * as React22 from "react";
|
|
772
967
|
import { createContext as createContext5, useContext as useContext5 } from "react";
|
|
773
968
|
var Context2 = createContext5(null);
|
|
774
|
-
var ControlAdornmentsProvider = ({ children, items }) => /* @__PURE__ */
|
|
969
|
+
var ControlAdornmentsProvider = ({ children, items }) => /* @__PURE__ */ React22.createElement(Context2.Provider, { value: { items } }, children);
|
|
775
970
|
var useControlAdornments = () => {
|
|
776
971
|
const context = useContext5(Context2);
|
|
777
972
|
return context?.items ?? [];
|
|
@@ -783,7 +978,7 @@ function ControlAdornments() {
|
|
|
783
978
|
if (items?.length === 0) {
|
|
784
979
|
return null;
|
|
785
980
|
}
|
|
786
|
-
return /* @__PURE__ */
|
|
981
|
+
return /* @__PURE__ */ React23.createElement(React23.Fragment, null, items.map(({ Adornment, id }) => /* @__PURE__ */ React23.createElement(Adornment, { key: id })));
|
|
787
982
|
}
|
|
788
983
|
|
|
789
984
|
// src/locations.ts
|
|
@@ -792,7 +987,7 @@ var { Slot: RepeaterItemIconSlot, inject: injectIntoRepeaterItemIcon } = createR
|
|
|
792
987
|
var { Slot: RepeaterItemLabelSlot, inject: injectIntoRepeaterItemLabel } = createReplaceableLocation();
|
|
793
988
|
|
|
794
989
|
// src/components/sortable.tsx
|
|
795
|
-
import * as
|
|
990
|
+
import * as React24 from "react";
|
|
796
991
|
import { GripVerticalIcon } from "@elementor/icons";
|
|
797
992
|
import {
|
|
798
993
|
Divider,
|
|
@@ -803,10 +998,10 @@ import {
|
|
|
803
998
|
UnstableSortableProvider
|
|
804
999
|
} from "@elementor/ui";
|
|
805
1000
|
var SortableProvider = (props) => {
|
|
806
|
-
return /* @__PURE__ */
|
|
1001
|
+
return /* @__PURE__ */ React24.createElement(List, { sx: { p: 0, my: -0.5, mx: 0 } }, /* @__PURE__ */ React24.createElement(UnstableSortableProvider, { restrictAxis: true, disableDragOverlay: false, variant: "static", ...props }));
|
|
807
1002
|
};
|
|
808
1003
|
var SortableItem = ({ id, children, disabled }) => {
|
|
809
|
-
return /* @__PURE__ */
|
|
1004
|
+
return /* @__PURE__ */ React24.createElement(
|
|
810
1005
|
UnstableSortableItem,
|
|
811
1006
|
{
|
|
812
1007
|
id,
|
|
@@ -819,7 +1014,7 @@ var SortableItem = ({ id, children, disabled }) => {
|
|
|
819
1014
|
showDropIndication,
|
|
820
1015
|
dropIndicationStyle
|
|
821
1016
|
}) => {
|
|
822
|
-
return /* @__PURE__ */
|
|
1017
|
+
return /* @__PURE__ */ React24.createElement(StyledListItem, { ...itemProps, style: itemStyle }, !disabled && /* @__PURE__ */ React24.createElement(SortableTrigger, { ...triggerProps, style: triggerStyle }), children, showDropIndication && /* @__PURE__ */ React24.createElement(StyledDivider, { style: dropIndicationStyle }));
|
|
823
1018
|
}
|
|
824
1019
|
}
|
|
825
1020
|
);
|
|
@@ -853,7 +1048,7 @@ var StyledListItem = styled2(ListItem)`
|
|
|
853
1048
|
}
|
|
854
1049
|
}
|
|
855
1050
|
`;
|
|
856
|
-
var SortableTrigger = (props) => /* @__PURE__ */
|
|
1051
|
+
var SortableTrigger = (props) => /* @__PURE__ */ React24.createElement("div", { ...props, role: "button", className: "class-item-sortable-trigger" }, /* @__PURE__ */ React24.createElement(GripVerticalIcon, { fontSize: "tiny" }));
|
|
857
1052
|
var StyledDivider = styled2(Divider)`
|
|
858
1053
|
height: 0px;
|
|
859
1054
|
border: none;
|
|
@@ -883,14 +1078,14 @@ var Repeater = ({
|
|
|
883
1078
|
values: repeaterValues = [],
|
|
884
1079
|
setValues: setRepeaterValues
|
|
885
1080
|
}) => {
|
|
886
|
-
const [openItem, setOpenItem] =
|
|
1081
|
+
const [openItem, setOpenItem] = useState4(EMPTY_OPEN_ITEM);
|
|
887
1082
|
const [items, setItems] = useSyncExternalState({
|
|
888
1083
|
external: repeaterValues,
|
|
889
1084
|
// @ts-expect-error - as long as persistWhen => true, value will never be null
|
|
890
1085
|
setExternal: setRepeaterValues,
|
|
891
1086
|
persistWhen: () => true
|
|
892
1087
|
});
|
|
893
|
-
const [uniqueKeys, setUniqueKeys] =
|
|
1088
|
+
const [uniqueKeys, setUniqueKeys] = useState4(items.map((_, index) => index));
|
|
894
1089
|
const generateNextKey = (source) => {
|
|
895
1090
|
return 1 + Math.max(0, ...source);
|
|
896
1091
|
};
|
|
@@ -947,7 +1142,7 @@ var Repeater = ({
|
|
|
947
1142
|
});
|
|
948
1143
|
});
|
|
949
1144
|
};
|
|
950
|
-
return /* @__PURE__ */
|
|
1145
|
+
return /* @__PURE__ */ React25.createElement(SectionContent, null, /* @__PURE__ */ React25.createElement(
|
|
951
1146
|
Stack5,
|
|
952
1147
|
{
|
|
953
1148
|
direction: "row",
|
|
@@ -956,9 +1151,9 @@ var Repeater = ({
|
|
|
956
1151
|
gap: 1,
|
|
957
1152
|
sx: { marginInlineEnd: -0.75 }
|
|
958
1153
|
},
|
|
959
|
-
/* @__PURE__ */
|
|
960
|
-
/* @__PURE__ */
|
|
961
|
-
/* @__PURE__ */
|
|
1154
|
+
/* @__PURE__ */ React25.createElement(Typography, { component: "label", variant: "caption", color: "text.secondary" }, label),
|
|
1155
|
+
/* @__PURE__ */ React25.createElement(ControlAdornments, null),
|
|
1156
|
+
/* @__PURE__ */ React25.createElement(
|
|
962
1157
|
IconButton,
|
|
963
1158
|
{
|
|
964
1159
|
size: SIZE,
|
|
@@ -967,27 +1162,27 @@ var Repeater = ({
|
|
|
967
1162
|
onClick: addRepeaterItem,
|
|
968
1163
|
"aria-label": __4("Add item", "elementor")
|
|
969
1164
|
},
|
|
970
|
-
/* @__PURE__ */
|
|
1165
|
+
/* @__PURE__ */ React25.createElement(PlusIcon, { fontSize: SIZE })
|
|
971
1166
|
)
|
|
972
|
-
), 0 < uniqueKeys.length && /* @__PURE__ */
|
|
1167
|
+
), 0 < uniqueKeys.length && /* @__PURE__ */ React25.createElement(SortableProvider, { value: uniqueKeys, onChange: onChangeOrder }, uniqueKeys.map((key, index) => {
|
|
973
1168
|
const value = items[index];
|
|
974
1169
|
if (!value) {
|
|
975
1170
|
return null;
|
|
976
1171
|
}
|
|
977
|
-
return /* @__PURE__ */
|
|
1172
|
+
return /* @__PURE__ */ React25.createElement(SortableItem, { id: key, key: `sortable-${key}`, disabled }, /* @__PURE__ */ React25.createElement(
|
|
978
1173
|
RepeaterItem,
|
|
979
1174
|
{
|
|
980
1175
|
disabled,
|
|
981
1176
|
propDisabled: value?.disabled,
|
|
982
|
-
label: /* @__PURE__ */
|
|
983
|
-
startIcon: /* @__PURE__ */
|
|
1177
|
+
label: /* @__PURE__ */ React25.createElement(RepeaterItemLabelSlot, { value }, /* @__PURE__ */ React25.createElement(itemSettings.Label, { value })),
|
|
1178
|
+
startIcon: /* @__PURE__ */ React25.createElement(RepeaterItemIconSlot, { value }, /* @__PURE__ */ React25.createElement(itemSettings.Icon, { value })),
|
|
984
1179
|
removeItem: () => removeRepeaterItem(index),
|
|
985
1180
|
duplicateItem: () => duplicateRepeaterItem(index),
|
|
986
1181
|
toggleDisableItem: () => toggleDisableRepeaterItem(index),
|
|
987
1182
|
openOnMount: openOnAdd && openItem === key,
|
|
988
1183
|
onOpen: () => setOpenItem(EMPTY_OPEN_ITEM)
|
|
989
1184
|
},
|
|
990
|
-
(props) => /* @__PURE__ */
|
|
1185
|
+
(props) => /* @__PURE__ */ React25.createElement(itemSettings.Content, { ...props, value, bind: String(index) })
|
|
991
1186
|
));
|
|
992
1187
|
})));
|
|
993
1188
|
};
|
|
@@ -1003,12 +1198,12 @@ var RepeaterItem = ({
|
|
|
1003
1198
|
onOpen,
|
|
1004
1199
|
disabled
|
|
1005
1200
|
}) => {
|
|
1006
|
-
const [anchorEl, setAnchorEl] =
|
|
1201
|
+
const [anchorEl, setAnchorEl] = useState4(null);
|
|
1007
1202
|
const { popoverState, popoverProps, ref, setRef } = usePopover(openOnMount, onOpen);
|
|
1008
1203
|
const duplicateLabel = __4("Duplicate", "elementor");
|
|
1009
1204
|
const toggleLabel = propDisabled ? __4("Show", "elementor") : __4("Hide", "elementor");
|
|
1010
1205
|
const removeLabel = __4("Remove", "elementor");
|
|
1011
|
-
return /* @__PURE__ */
|
|
1206
|
+
return /* @__PURE__ */ React25.createElement(React25.Fragment, null, /* @__PURE__ */ React25.createElement(
|
|
1012
1207
|
UnstableTag,
|
|
1013
1208
|
{
|
|
1014
1209
|
disabled,
|
|
@@ -1020,10 +1215,10 @@ var RepeaterItem = ({
|
|
|
1020
1215
|
"aria-label": __4("Open item", "elementor"),
|
|
1021
1216
|
...bindTrigger2(popoverState),
|
|
1022
1217
|
startIcon,
|
|
1023
|
-
actions: /* @__PURE__ */
|
|
1218
|
+
actions: /* @__PURE__ */ React25.createElement(React25.Fragment, null, /* @__PURE__ */ React25.createElement(Tooltip, { title: duplicateLabel, placement: "top" }, /* @__PURE__ */ React25.createElement(IconButton, { size: SIZE, onClick: duplicateItem, "aria-label": duplicateLabel }, /* @__PURE__ */ React25.createElement(CopyIcon, { fontSize: SIZE }))), /* @__PURE__ */ React25.createElement(Tooltip, { title: toggleLabel, placement: "top" }, /* @__PURE__ */ React25.createElement(IconButton, { size: SIZE, onClick: toggleDisableItem, "aria-label": toggleLabel }, propDisabled ? /* @__PURE__ */ React25.createElement(EyeOffIcon, { fontSize: SIZE }) : /* @__PURE__ */ React25.createElement(EyeIcon, { fontSize: SIZE }))), /* @__PURE__ */ React25.createElement(Tooltip, { title: removeLabel, placement: "top" }, /* @__PURE__ */ React25.createElement(IconButton, { size: SIZE, onClick: removeItem, "aria-label": removeLabel }, /* @__PURE__ */ React25.createElement(XIcon, { fontSize: SIZE }))))
|
|
1024
1219
|
}
|
|
1025
|
-
), /* @__PURE__ */
|
|
1026
|
-
|
|
1220
|
+
), /* @__PURE__ */ React25.createElement(
|
|
1221
|
+
Popover2,
|
|
1027
1222
|
{
|
|
1028
1223
|
disablePortal: true,
|
|
1029
1224
|
slotProps: {
|
|
@@ -1036,14 +1231,14 @@ var RepeaterItem = ({
|
|
|
1036
1231
|
...popoverProps,
|
|
1037
1232
|
anchorEl: ref
|
|
1038
1233
|
},
|
|
1039
|
-
/* @__PURE__ */
|
|
1234
|
+
/* @__PURE__ */ React25.createElement(Box2, null, children({ anchorEl }))
|
|
1040
1235
|
));
|
|
1041
1236
|
};
|
|
1042
1237
|
var usePopover = (openOnMount, onOpen) => {
|
|
1043
|
-
const [ref, setRef] =
|
|
1044
|
-
const popoverState =
|
|
1045
|
-
const popoverProps =
|
|
1046
|
-
|
|
1238
|
+
const [ref, setRef] = useState4(null);
|
|
1239
|
+
const popoverState = usePopupState3({ variant: "popover" });
|
|
1240
|
+
const popoverProps = bindPopover2(popoverState);
|
|
1241
|
+
useEffect3(() => {
|
|
1047
1242
|
if (openOnMount && ref) {
|
|
1048
1243
|
popoverState.open(ref);
|
|
1049
1244
|
onOpen?.();
|
|
@@ -1060,7 +1255,7 @@ var usePopover = (openOnMount, onOpen) => {
|
|
|
1060
1255
|
// src/controls/box-shadow-repeater-control.tsx
|
|
1061
1256
|
var BoxShadowRepeaterControl = createControl(() => {
|
|
1062
1257
|
const { propType, value, setValue, disabled } = useBoundProp(boxShadowPropTypeUtil);
|
|
1063
|
-
return /* @__PURE__ */
|
|
1258
|
+
return /* @__PURE__ */ React26.createElement(PropProvider, { propType, value, setValue, disabled }, /* @__PURE__ */ React26.createElement(
|
|
1064
1259
|
Repeater,
|
|
1065
1260
|
{
|
|
1066
1261
|
openOnAdd: true,
|
|
@@ -1077,13 +1272,14 @@ var BoxShadowRepeaterControl = createControl(() => {
|
|
|
1077
1272
|
}
|
|
1078
1273
|
));
|
|
1079
1274
|
});
|
|
1080
|
-
var ItemIcon = ({ value }) => /* @__PURE__ */
|
|
1275
|
+
var ItemIcon = ({ value }) => /* @__PURE__ */ React26.createElement(UnstableColorIndicator, { size: "inherit", component: "span", value: value.value.color?.value });
|
|
1081
1276
|
var ItemContent = ({ anchorEl, bind }) => {
|
|
1082
|
-
return /* @__PURE__ */
|
|
1277
|
+
return /* @__PURE__ */ React26.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React26.createElement(Content, { anchorEl }));
|
|
1083
1278
|
};
|
|
1084
1279
|
var Content = ({ anchorEl }) => {
|
|
1085
1280
|
const context = useBoundProp(shadowPropTypeUtil);
|
|
1086
|
-
|
|
1281
|
+
const rowRef = [useRef3(), useRef3()];
|
|
1282
|
+
return /* @__PURE__ */ React26.createElement(PropProvider, { ...context }, /* @__PURE__ */ React26.createElement(PopoverContent, { p: 1.5 }, /* @__PURE__ */ React26.createElement(PopoverGridContainer, null, /* @__PURE__ */ React26.createElement(Control2, { bind: "color", label: __5("Color", "elementor") }, /* @__PURE__ */ React26.createElement(ColorControl, { anchorEl })), /* @__PURE__ */ React26.createElement(Control2, { bind: "position", label: __5("Position", "elementor"), sx: { overflow: "hidden" } }, /* @__PURE__ */ React26.createElement(
|
|
1087
1283
|
SelectControl,
|
|
1088
1284
|
{
|
|
1089
1285
|
options: [
|
|
@@ -1091,14 +1287,14 @@ var Content = ({ anchorEl }) => {
|
|
|
1091
1287
|
{ label: __5("Outset", "elementor"), value: null }
|
|
1092
1288
|
]
|
|
1093
1289
|
}
|
|
1094
|
-
))), /* @__PURE__ */
|
|
1290
|
+
))), /* @__PURE__ */ React26.createElement(PopoverGridContainer, { ref: rowRef[0] }, /* @__PURE__ */ React26.createElement(Control2, { bind: "hOffset", label: __5("Horizontal", "elementor") }, /* @__PURE__ */ React26.createElement(SizeControl, { anchorRef: rowRef[0] })), /* @__PURE__ */ React26.createElement(Control2, { bind: "vOffset", label: __5("Vertical", "elementor") }, /* @__PURE__ */ React26.createElement(SizeControl, { anchorRef: rowRef[0] }))), /* @__PURE__ */ React26.createElement(PopoverGridContainer, { ref: rowRef[1] }, /* @__PURE__ */ React26.createElement(Control2, { bind: "blur", label: __5("Blur", "elementor") }, /* @__PURE__ */ React26.createElement(SizeControl, { anchorRef: rowRef[1] })), /* @__PURE__ */ React26.createElement(Control2, { bind: "spread", label: __5("Spread", "elementor") }, /* @__PURE__ */ React26.createElement(SizeControl, { anchorRef: rowRef[1] })))));
|
|
1095
1291
|
};
|
|
1096
1292
|
var Control2 = ({
|
|
1097
1293
|
label,
|
|
1098
1294
|
bind,
|
|
1099
1295
|
children,
|
|
1100
1296
|
sx
|
|
1101
|
-
}) => /* @__PURE__ */
|
|
1297
|
+
}) => /* @__PURE__ */ React26.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React26.createElement(Grid4, { item: true, xs: 6, sx }, /* @__PURE__ */ React26.createElement(Grid4, { container: true, gap: 0.75, alignItems: "center" }, /* @__PURE__ */ React26.createElement(Grid4, { item: true, xs: 12 }, /* @__PURE__ */ React26.createElement(FormLabel2, { size: "tiny" }, label)), /* @__PURE__ */ React26.createElement(Grid4, { item: true, xs: 12 }, children))));
|
|
1102
1298
|
var ItemLabel = ({ value }) => {
|
|
1103
1299
|
const { position, hOffset, vOffset, blur, spread } = value.value;
|
|
1104
1300
|
const { size: blurSize = "", unit: blurUnit = "" } = blur?.value || {};
|
|
@@ -1112,7 +1308,7 @@ var ItemLabel = ({ value }) => {
|
|
|
1112
1308
|
blurSize + blurUnit,
|
|
1113
1309
|
spreadSize + spreadUnit
|
|
1114
1310
|
].join(" ");
|
|
1115
|
-
return /* @__PURE__ */
|
|
1311
|
+
return /* @__PURE__ */ React26.createElement("span", { style: { textTransform: "capitalize" } }, positionLabel, ": ", sizes);
|
|
1116
1312
|
};
|
|
1117
1313
|
var initialShadow = {
|
|
1118
1314
|
$$type: "shadow",
|
|
@@ -1142,12 +1338,12 @@ var initialShadow = {
|
|
|
1142
1338
|
};
|
|
1143
1339
|
|
|
1144
1340
|
// src/controls/toggle-control.tsx
|
|
1145
|
-
import * as
|
|
1146
|
-
import { stringPropTypeUtil as
|
|
1341
|
+
import * as React29 from "react";
|
|
1342
|
+
import { stringPropTypeUtil as stringPropTypeUtil4 } from "@elementor/editor-props";
|
|
1147
1343
|
|
|
1148
1344
|
// src/components/control-toggle-button-group.tsx
|
|
1149
|
-
import * as
|
|
1150
|
-
import { useEffect as
|
|
1345
|
+
import * as React28 from "react";
|
|
1346
|
+
import { useEffect as useEffect4, useMemo as useMemo2, useRef as useRef4, useState as useState5 } from "react";
|
|
1151
1347
|
import { ChevronDownIcon } from "@elementor/icons";
|
|
1152
1348
|
import {
|
|
1153
1349
|
ListItemText,
|
|
@@ -1161,14 +1357,14 @@ import {
|
|
|
1161
1357
|
} from "@elementor/ui";
|
|
1162
1358
|
|
|
1163
1359
|
// src/components/conditional-tooltip.tsx
|
|
1164
|
-
import * as
|
|
1360
|
+
import * as React27 from "react";
|
|
1165
1361
|
import { Tooltip as Tooltip2 } from "@elementor/ui";
|
|
1166
1362
|
var ConditionalTooltip = ({
|
|
1167
1363
|
showTooltip,
|
|
1168
1364
|
children,
|
|
1169
1365
|
label
|
|
1170
1366
|
}) => {
|
|
1171
|
-
return showTooltip && label ? /* @__PURE__ */
|
|
1367
|
+
return showTooltip && label ? /* @__PURE__ */ React27.createElement(Tooltip2, { title: label, disableFocusListener: true, placement: "top" }, children) : children;
|
|
1172
1368
|
};
|
|
1173
1369
|
|
|
1174
1370
|
// src/components/control-toggle-button-group.tsx
|
|
@@ -1205,13 +1401,13 @@ var ControlToggleButtonGroup = ({
|
|
|
1205
1401
|
const handleChange = (_, newValue) => {
|
|
1206
1402
|
onChange(newValue);
|
|
1207
1403
|
};
|
|
1208
|
-
const getGridTemplateColumns =
|
|
1404
|
+
const getGridTemplateColumns = useMemo2(() => {
|
|
1209
1405
|
const isOffLimits = menuItems?.length;
|
|
1210
1406
|
const itemsCount = isOffLimits ? fixedItems.length + 1 : fixedItems.length;
|
|
1211
1407
|
const templateColumnsSuffix = isOffLimits ? "auto" : "";
|
|
1212
1408
|
return `repeat(${itemsCount}, minmax(0, 25%)) ${templateColumnsSuffix}`;
|
|
1213
1409
|
}, [menuItems?.length, fixedItems.length]);
|
|
1214
|
-
return /* @__PURE__ */
|
|
1410
|
+
return /* @__PURE__ */ React28.createElement(ControlActions, null, /* @__PURE__ */ React28.createElement(
|
|
1215
1411
|
StyledToggleButtonGroup,
|
|
1216
1412
|
{
|
|
1217
1413
|
justify,
|
|
@@ -1226,16 +1422,16 @@ var ControlToggleButtonGroup = ({
|
|
|
1226
1422
|
width: `100%`
|
|
1227
1423
|
}
|
|
1228
1424
|
},
|
|
1229
|
-
fixedItems.map(({ label, value: buttonValue, renderContent: Content3, showTooltip }) => /* @__PURE__ */
|
|
1425
|
+
fixedItems.map(({ label, value: buttonValue, renderContent: Content3, showTooltip }) => /* @__PURE__ */ React28.createElement(
|
|
1230
1426
|
ConditionalTooltip,
|
|
1231
1427
|
{
|
|
1232
1428
|
key: buttonValue,
|
|
1233
1429
|
label,
|
|
1234
1430
|
showTooltip: showTooltip || false
|
|
1235
1431
|
},
|
|
1236
|
-
/* @__PURE__ */
|
|
1432
|
+
/* @__PURE__ */ React28.createElement(ToggleButton, { value: buttonValue, "aria-label": label, size, fullWidth }, /* @__PURE__ */ React28.createElement(Content3, { size }))
|
|
1237
1433
|
)),
|
|
1238
|
-
menuItems.length && exclusive && /* @__PURE__ */
|
|
1434
|
+
menuItems.length && exclusive && /* @__PURE__ */ React28.createElement(
|
|
1239
1435
|
SplitButtonGroup,
|
|
1240
1436
|
{
|
|
1241
1437
|
size,
|
|
@@ -1255,8 +1451,8 @@ var SplitButtonGroup = ({
|
|
|
1255
1451
|
value
|
|
1256
1452
|
}) => {
|
|
1257
1453
|
const previewButton = usePreviewButton(items, value);
|
|
1258
|
-
const [isMenuOpen, setIsMenuOpen] =
|
|
1259
|
-
const menuButtonRef =
|
|
1454
|
+
const [isMenuOpen, setIsMenuOpen] = useState5(false);
|
|
1455
|
+
const menuButtonRef = useRef4(null);
|
|
1260
1456
|
const onMenuToggle = (ev) => {
|
|
1261
1457
|
setIsMenuOpen((prev) => !prev);
|
|
1262
1458
|
ev.preventDefault();
|
|
@@ -1269,7 +1465,7 @@ var SplitButtonGroup = ({
|
|
|
1269
1465
|
const shouldRemove = newValue === value;
|
|
1270
1466
|
onChange(shouldRemove ? null : newValue);
|
|
1271
1467
|
};
|
|
1272
|
-
return /* @__PURE__ */
|
|
1468
|
+
return /* @__PURE__ */ React28.createElement(React28.Fragment, null, /* @__PURE__ */ React28.createElement(
|
|
1273
1469
|
ToggleButton,
|
|
1274
1470
|
{
|
|
1275
1471
|
value: previewButton.value,
|
|
@@ -1283,7 +1479,7 @@ var SplitButtonGroup = ({
|
|
|
1283
1479
|
ref: menuButtonRef
|
|
1284
1480
|
},
|
|
1285
1481
|
previewButton.renderContent({ size })
|
|
1286
|
-
), /* @__PURE__ */
|
|
1482
|
+
), /* @__PURE__ */ React28.createElement(
|
|
1287
1483
|
ToggleButton,
|
|
1288
1484
|
{
|
|
1289
1485
|
size,
|
|
@@ -1294,8 +1490,8 @@ var SplitButtonGroup = ({
|
|
|
1294
1490
|
ref: menuButtonRef,
|
|
1295
1491
|
value: "__chevron-icon-button__"
|
|
1296
1492
|
},
|
|
1297
|
-
/* @__PURE__ */
|
|
1298
|
-
), /* @__PURE__ */
|
|
1493
|
+
/* @__PURE__ */ React28.createElement(ChevronDownIcon, { fontSize: size })
|
|
1494
|
+
), /* @__PURE__ */ React28.createElement(
|
|
1299
1495
|
Menu2,
|
|
1300
1496
|
{
|
|
1301
1497
|
open: isMenuOpen,
|
|
@@ -1313,22 +1509,22 @@ var SplitButtonGroup = ({
|
|
|
1313
1509
|
mt: 0.5
|
|
1314
1510
|
}
|
|
1315
1511
|
},
|
|
1316
|
-
items.map(({ label, value: buttonValue }) => /* @__PURE__ */
|
|
1512
|
+
items.map(({ label, value: buttonValue }) => /* @__PURE__ */ React28.createElement(
|
|
1317
1513
|
MenuItem,
|
|
1318
1514
|
{
|
|
1319
1515
|
key: buttonValue,
|
|
1320
1516
|
selected: buttonValue === value,
|
|
1321
1517
|
onClick: () => onMenuItemClick(buttonValue)
|
|
1322
1518
|
},
|
|
1323
|
-
/* @__PURE__ */
|
|
1519
|
+
/* @__PURE__ */ React28.createElement(ListItemText, null, /* @__PURE__ */ React28.createElement(Typography2, { sx: { fontSize: "14px" } }, label))
|
|
1324
1520
|
))
|
|
1325
1521
|
));
|
|
1326
1522
|
};
|
|
1327
1523
|
var usePreviewButton = (items, value) => {
|
|
1328
|
-
const [previewButton, setPreviewButton] =
|
|
1524
|
+
const [previewButton, setPreviewButton] = useState5(
|
|
1329
1525
|
items.find((item) => item.value === value) ?? items[0]
|
|
1330
1526
|
);
|
|
1331
|
-
|
|
1527
|
+
useEffect4(() => {
|
|
1332
1528
|
const selectedButton = items.find((item) => item.value === value);
|
|
1333
1529
|
if (selectedButton) {
|
|
1334
1530
|
setPreviewButton(selectedButton);
|
|
@@ -1346,7 +1542,7 @@ var ToggleControl = createControl(
|
|
|
1346
1542
|
exclusive = true,
|
|
1347
1543
|
maxItems
|
|
1348
1544
|
}) => {
|
|
1349
|
-
const { value, setValue, placeholder, disabled } = useBoundProp(
|
|
1545
|
+
const { value, setValue, placeholder, disabled } = useBoundProp(stringPropTypeUtil4);
|
|
1350
1546
|
const exclusiveValues = options.filter((option) => option.exclusive).map((option) => option.value);
|
|
1351
1547
|
const handleNonExclusiveToggle = (selectedValues) => {
|
|
1352
1548
|
const newSelectedValue = selectedValues[selectedValues.length - 1];
|
|
@@ -1360,7 +1556,7 @@ var ToggleControl = createControl(
|
|
|
1360
1556
|
fullWidth,
|
|
1361
1557
|
size
|
|
1362
1558
|
};
|
|
1363
|
-
return exclusive ? /* @__PURE__ */
|
|
1559
|
+
return exclusive ? /* @__PURE__ */ React29.createElement(
|
|
1364
1560
|
ControlToggleButtonGroup,
|
|
1365
1561
|
{
|
|
1366
1562
|
...toggleButtonGroupProps,
|
|
@@ -1369,7 +1565,7 @@ var ToggleControl = createControl(
|
|
|
1369
1565
|
disabled,
|
|
1370
1566
|
exclusive: true
|
|
1371
1567
|
}
|
|
1372
|
-
) : /* @__PURE__ */
|
|
1568
|
+
) : /* @__PURE__ */ React29.createElement(
|
|
1373
1569
|
ControlToggleButtonGroup,
|
|
1374
1570
|
{
|
|
1375
1571
|
...toggleButtonGroupProps,
|
|
@@ -1383,9 +1579,9 @@ var ToggleControl = createControl(
|
|
|
1383
1579
|
);
|
|
1384
1580
|
|
|
1385
1581
|
// src/controls/number-control.tsx
|
|
1386
|
-
import * as
|
|
1582
|
+
import * as React30 from "react";
|
|
1387
1583
|
import { numberPropTypeUtil } from "@elementor/editor-props";
|
|
1388
|
-
import { TextField as
|
|
1584
|
+
import { TextField as TextField5 } from "@elementor/ui";
|
|
1389
1585
|
var isEmptyOrNaN = (value) => value === null || value === void 0 || value === "" || Number.isNaN(Number(value));
|
|
1390
1586
|
var RESTRICTED_INPUT_KEYS2 = ["e", "E", "+", "-"];
|
|
1391
1587
|
var NumberControl = createControl(
|
|
@@ -1406,8 +1602,8 @@ var NumberControl = createControl(
|
|
|
1406
1602
|
const formattedValue = shouldForceInt ? +parseInt(eventValue) : Number(eventValue);
|
|
1407
1603
|
setValue(Math.min(Math.max(formattedValue, min), max));
|
|
1408
1604
|
};
|
|
1409
|
-
return /* @__PURE__ */
|
|
1410
|
-
|
|
1605
|
+
return /* @__PURE__ */ React30.createElement(ControlActions, null, /* @__PURE__ */ React30.createElement(
|
|
1606
|
+
TextField5,
|
|
1411
1607
|
{
|
|
1412
1608
|
size: "tiny",
|
|
1413
1609
|
type: "number",
|
|
@@ -1428,18 +1624,18 @@ var NumberControl = createControl(
|
|
|
1428
1624
|
);
|
|
1429
1625
|
|
|
1430
1626
|
// src/controls/equal-unequal-sizes-control.tsx
|
|
1431
|
-
import * as
|
|
1432
|
-
import { useId as useId2, useRef as
|
|
1627
|
+
import * as React32 from "react";
|
|
1628
|
+
import { useId as useId2, useRef as useRef5 } from "react";
|
|
1433
1629
|
import { sizePropTypeUtil as sizePropTypeUtil2 } from "@elementor/editor-props";
|
|
1434
|
-
import { isExperimentActive } from "@elementor/editor-v1-adapters";
|
|
1435
|
-
import { bindPopover as
|
|
1630
|
+
import { isExperimentActive as isExperimentActive2 } from "@elementor/editor-v1-adapters";
|
|
1631
|
+
import { bindPopover as bindPopover3, bindToggle, Grid as Grid5, Popover as Popover3, Stack as Stack7, ToggleButton as ToggleButton2, Tooltip as Tooltip3, usePopupState as usePopupState4 } from "@elementor/ui";
|
|
1436
1632
|
import { __ as __6 } from "@wordpress/i18n";
|
|
1437
1633
|
|
|
1438
1634
|
// src/components/control-label.tsx
|
|
1439
|
-
import * as
|
|
1635
|
+
import * as React31 from "react";
|
|
1440
1636
|
import { Stack as Stack6 } from "@elementor/ui";
|
|
1441
1637
|
var ControlLabel = ({ children }) => {
|
|
1442
|
-
return /* @__PURE__ */
|
|
1638
|
+
return /* @__PURE__ */ React31.createElement(Stack6, { direction: "row", alignItems: "center", justifyItems: "start", gap: 0.25 }, /* @__PURE__ */ React31.createElement(ControlFormLabel, null, children), /* @__PURE__ */ React31.createElement(ControlAdornments, null));
|
|
1443
1639
|
};
|
|
1444
1640
|
|
|
1445
1641
|
// src/controls/equal-unequal-sizes-control.tsx
|
|
@@ -1461,8 +1657,7 @@ function EqualUnequalSizesControl({
|
|
|
1461
1657
|
multiSizePropTypeUtil
|
|
1462
1658
|
}) {
|
|
1463
1659
|
const popupId = useId2();
|
|
1464
|
-
const
|
|
1465
|
-
const popupState = usePopupState3({ variant: "popover", popupId });
|
|
1660
|
+
const popupState = usePopupState4({ variant: "popover", popupId });
|
|
1466
1661
|
const {
|
|
1467
1662
|
propType: multiSizePropType,
|
|
1468
1663
|
value: multiSizeValue,
|
|
@@ -1470,6 +1665,7 @@ function EqualUnequalSizesControl({
|
|
|
1470
1665
|
disabled: multiSizeDisabled
|
|
1471
1666
|
} = useBoundProp(multiSizePropTypeUtil);
|
|
1472
1667
|
const { value: sizeValue, setValue: setSizeValue } = useBoundProp(sizePropTypeUtil2);
|
|
1668
|
+
const rowRefs = [useRef5(), useRef5()];
|
|
1473
1669
|
const splitEqualValue = () => {
|
|
1474
1670
|
if (!sizeValue) {
|
|
1475
1671
|
return null;
|
|
@@ -1496,9 +1692,15 @@ function EqualUnequalSizesControl({
|
|
|
1496
1692
|
}
|
|
1497
1693
|
return splitEqualValue() ?? null;
|
|
1498
1694
|
};
|
|
1499
|
-
const isShowingGeneralIndicator = !
|
|
1695
|
+
const isShowingGeneralIndicator = !isExperimentActive2("e_v_3_30") || !popupState.isOpen;
|
|
1500
1696
|
const isMixed = !!multiSizeValue;
|
|
1501
|
-
return /* @__PURE__ */
|
|
1697
|
+
return /* @__PURE__ */ React32.createElement(React32.Fragment, null, /* @__PURE__ */ React32.createElement(Grid5, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap", ref: rowRefs[0] }, /* @__PURE__ */ React32.createElement(Grid5, { item: true, xs: 6 }, !isShowingGeneralIndicator ? /* @__PURE__ */ React32.createElement(ControlFormLabel, null, label) : /* @__PURE__ */ React32.createElement(ControlLabel, null, label)), /* @__PURE__ */ React32.createElement(Grid5, { item: true, xs: 6 }, /* @__PURE__ */ React32.createElement(Stack7, { direction: "row", alignItems: "center", gap: 1 }, /* @__PURE__ */ React32.createElement(
|
|
1698
|
+
SizeControl,
|
|
1699
|
+
{
|
|
1700
|
+
placeholder: isMixed ? __6("Mixed", "elementor") : void 0,
|
|
1701
|
+
anchorRef: rowRefs[0]
|
|
1702
|
+
}
|
|
1703
|
+
), /* @__PURE__ */ React32.createElement(Tooltip3, { title: tooltipLabel, placement: "top" }, /* @__PURE__ */ React32.createElement(
|
|
1502
1704
|
ToggleButton2,
|
|
1503
1705
|
{
|
|
1504
1706
|
size: "tiny",
|
|
@@ -1509,8 +1711,8 @@ function EqualUnequalSizesControl({
|
|
|
1509
1711
|
"aria-label": tooltipLabel
|
|
1510
1712
|
},
|
|
1511
1713
|
icon
|
|
1512
|
-
))))), /* @__PURE__ */
|
|
1513
|
-
|
|
1714
|
+
))))), /* @__PURE__ */ React32.createElement(
|
|
1715
|
+
Popover3,
|
|
1514
1716
|
{
|
|
1515
1717
|
disablePortal: true,
|
|
1516
1718
|
disableScrollLock: true,
|
|
@@ -1522,12 +1724,12 @@ function EqualUnequalSizesControl({
|
|
|
1522
1724
|
vertical: "top",
|
|
1523
1725
|
horizontal: "right"
|
|
1524
1726
|
},
|
|
1525
|
-
...
|
|
1727
|
+
...bindPopover3(popupState),
|
|
1526
1728
|
slotProps: {
|
|
1527
|
-
paper: { sx: { mt: 0.5, width:
|
|
1729
|
+
paper: { sx: { mt: 0.5, width: rowRefs[0].current?.getBoundingClientRect().width } }
|
|
1528
1730
|
}
|
|
1529
1731
|
},
|
|
1530
|
-
/* @__PURE__ */
|
|
1732
|
+
/* @__PURE__ */ React32.createElement(
|
|
1531
1733
|
PropProvider,
|
|
1532
1734
|
{
|
|
1533
1735
|
propType: multiSizePropType,
|
|
@@ -1535,19 +1737,23 @@ function EqualUnequalSizesControl({
|
|
|
1535
1737
|
setValue: setNestedProp,
|
|
1536
1738
|
disabled: multiSizeDisabled
|
|
1537
1739
|
},
|
|
1538
|
-
/* @__PURE__ */
|
|
1740
|
+
/* @__PURE__ */ React32.createElement(PopoverContent, { p: 1.5 }, /* @__PURE__ */ React32.createElement(PopoverGridContainer, { ref: rowRefs[1] }, /* @__PURE__ */ React32.createElement(MultiSizeValueControl, { item: items[0], rowRef: rowRefs[1] }), /* @__PURE__ */ React32.createElement(MultiSizeValueControl, { item: items[1], rowRef: rowRefs[1] })), /* @__PURE__ */ React32.createElement(PopoverGridContainer, { ref: rowRefs[2] }, /* @__PURE__ */ React32.createElement(MultiSizeValueControl, { item: items[2], rowRef: rowRefs[2] }), /* @__PURE__ */ React32.createElement(MultiSizeValueControl, { item: items[3], rowRef: rowRefs[2] })))
|
|
1539
1741
|
)
|
|
1540
1742
|
));
|
|
1541
1743
|
}
|
|
1542
|
-
var MultiSizeValueControl = ({
|
|
1543
|
-
|
|
1544
|
-
|
|
1744
|
+
var MultiSizeValueControl = ({
|
|
1745
|
+
item,
|
|
1746
|
+
rowRef
|
|
1747
|
+
}) => {
|
|
1748
|
+
const isUsingNestedProps = isExperimentActive2("e_v_3_30");
|
|
1749
|
+
return /* @__PURE__ */ React32.createElement(PropKeyProvider, { bind: item.bind }, /* @__PURE__ */ React32.createElement(Grid5, { item: true, xs: 6 }, /* @__PURE__ */ React32.createElement(Grid5, { container: true, gap: 0.75, alignItems: "center" }, /* @__PURE__ */ React32.createElement(Grid5, { item: true, xs: 12 }, isUsingNestedProps ? /* @__PURE__ */ React32.createElement(ControlLabel, null, item.label) : /* @__PURE__ */ React32.createElement(ControlFormLabel, null, item.label)), /* @__PURE__ */ React32.createElement(Grid5, { item: true, xs: 12 }, /* @__PURE__ */ React32.createElement(SizeControl, { startIcon: item.icon, anchorRef: rowRef })))));
|
|
1545
1750
|
};
|
|
1546
1751
|
|
|
1547
1752
|
// src/controls/linked-dimensions-control.tsx
|
|
1548
|
-
import * as
|
|
1753
|
+
import * as React33 from "react";
|
|
1754
|
+
import { useRef as useRef6 } from "react";
|
|
1549
1755
|
import { dimensionsPropTypeUtil, sizePropTypeUtil as sizePropTypeUtil3 } from "@elementor/editor-props";
|
|
1550
|
-
import { isExperimentActive as
|
|
1756
|
+
import { isExperimentActive as isExperimentActive3 } from "@elementor/editor-v1-adapters";
|
|
1551
1757
|
import { DetachIcon, LinkIcon, SideBottomIcon, SideLeftIcon, SideRightIcon, SideTopIcon } from "@elementor/icons";
|
|
1552
1758
|
import { Grid as Grid6, Stack as Stack8, ToggleButton as ToggleButton3, Tooltip as Tooltip4 } from "@elementor/ui";
|
|
1553
1759
|
import { __ as __7 } from "@wordpress/i18n";
|
|
@@ -1555,9 +1761,10 @@ var LinkedDimensionsControl = createControl(
|
|
|
1555
1761
|
({
|
|
1556
1762
|
label,
|
|
1557
1763
|
isSiteRtl = false,
|
|
1558
|
-
|
|
1764
|
+
extendedOptions
|
|
1559
1765
|
}) => {
|
|
1560
1766
|
const { value: sizeValue, setValue: setSizeValue, disabled: sizeDisabled } = useBoundProp(sizePropTypeUtil3);
|
|
1767
|
+
const gridRowRefs = [useRef6(), useRef6()];
|
|
1561
1768
|
const {
|
|
1562
1769
|
value: dimensionsValue,
|
|
1563
1770
|
setValue: setDimensionsValue,
|
|
@@ -1565,7 +1772,7 @@ var LinkedDimensionsControl = createControl(
|
|
|
1565
1772
|
disabled: dimensionsDisabled
|
|
1566
1773
|
} = useBoundProp(dimensionsPropTypeUtil);
|
|
1567
1774
|
const isLinked = !dimensionsValue && !sizeValue ? true : !!sizeValue;
|
|
1568
|
-
const isUsingNestedProps =
|
|
1775
|
+
const isUsingNestedProps = isExperimentActive3("e_v_3_30");
|
|
1569
1776
|
const onLinkToggle = () => {
|
|
1570
1777
|
if (!isLinked) {
|
|
1571
1778
|
setSizeValue(dimensionsValue["block-start"]?.value ?? null);
|
|
@@ -1584,7 +1791,7 @@ var LinkedDimensionsControl = createControl(
|
|
|
1584
1791
|
const linkedLabel = __7("Link %s", "elementor").replace("%s", tooltipLabel);
|
|
1585
1792
|
const unlinkedLabel = __7("Unlink %s", "elementor").replace("%s", tooltipLabel);
|
|
1586
1793
|
const disabled = sizeDisabled || dimensionsDisabled;
|
|
1587
|
-
return /* @__PURE__ */
|
|
1794
|
+
return /* @__PURE__ */ React33.createElement(
|
|
1588
1795
|
PropProvider,
|
|
1589
1796
|
{
|
|
1590
1797
|
propType,
|
|
@@ -1592,7 +1799,7 @@ var LinkedDimensionsControl = createControl(
|
|
|
1592
1799
|
setValue: setDimensionsValue,
|
|
1593
1800
|
disabled
|
|
1594
1801
|
},
|
|
1595
|
-
/* @__PURE__ */
|
|
1802
|
+
/* @__PURE__ */ React33.createElement(Stack8, { direction: "row", gap: 2, flexWrap: "nowrap" }, isUsingNestedProps ? /* @__PURE__ */ React33.createElement(ControlFormLabel, null, label) : /* @__PURE__ */ React33.createElement(ControlLabel, null, label), /* @__PURE__ */ React33.createElement(Tooltip4, { title: isLinked ? unlinkedLabel : linkedLabel, placement: "top" }, /* @__PURE__ */ React33.createElement(
|
|
1596
1803
|
ToggleButton3,
|
|
1597
1804
|
{
|
|
1598
1805
|
"aria-label": isLinked ? unlinkedLabel : linkedLabel,
|
|
@@ -1603,54 +1810,18 @@ var LinkedDimensionsControl = createControl(
|
|
|
1603
1810
|
onChange: onLinkToggle,
|
|
1604
1811
|
disabled
|
|
1605
1812
|
},
|
|
1606
|
-
/* @__PURE__ */
|
|
1813
|
+
/* @__PURE__ */ React33.createElement(LinkedIcon, { fontSize: "tiny" })
|
|
1607
1814
|
))),
|
|
1608
|
-
/* @__PURE__ */
|
|
1609
|
-
Control3,
|
|
1610
|
-
{
|
|
1611
|
-
bind: "block-start",
|
|
1612
|
-
startIcon: /* @__PURE__ */ React31.createElement(SideTopIcon, { fontSize: "tiny" }),
|
|
1613
|
-
isLinked,
|
|
1614
|
-
extendedValues
|
|
1615
|
-
}
|
|
1616
|
-
))), /* @__PURE__ */ React31.createElement(Grid6, { container: true, gap: 0.75, alignItems: "center" }, /* @__PURE__ */ React31.createElement(Grid6, { item: true, xs: 12 }, /* @__PURE__ */ React31.createElement(
|
|
1617
|
-
Label,
|
|
1618
|
-
{
|
|
1619
|
-
bind: "inline-end",
|
|
1620
|
-
label: isSiteRtl ? __7("Left", "elementor") : __7("Right", "elementor")
|
|
1621
|
-
}
|
|
1622
|
-
)), /* @__PURE__ */ React31.createElement(Grid6, { item: true, xs: 12 }, /* @__PURE__ */ React31.createElement(
|
|
1623
|
-
Control3,
|
|
1624
|
-
{
|
|
1625
|
-
bind: "inline-end",
|
|
1626
|
-
startIcon: isSiteRtl ? /* @__PURE__ */ React31.createElement(SideLeftIcon, { fontSize: "tiny" }) : /* @__PURE__ */ React31.createElement(SideRightIcon, { fontSize: "tiny" }),
|
|
1627
|
-
isLinked,
|
|
1628
|
-
extendedValues
|
|
1629
|
-
}
|
|
1630
|
-
)))),
|
|
1631
|
-
/* @__PURE__ */ React31.createElement(Stack8, { direction: "row", gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React31.createElement(Grid6, { container: true, gap: 0.75, alignItems: "center" }, /* @__PURE__ */ React31.createElement(Grid6, { item: true, xs: 12 }, /* @__PURE__ */ React31.createElement(Label, { bind: "block-end", label: __7("Bottom", "elementor") })), /* @__PURE__ */ React31.createElement(Grid6, { item: true, xs: 12 }, /* @__PURE__ */ React31.createElement(
|
|
1632
|
-
Control3,
|
|
1633
|
-
{
|
|
1634
|
-
bind: "block-end",
|
|
1635
|
-
startIcon: /* @__PURE__ */ React31.createElement(SideBottomIcon, { fontSize: "tiny" }),
|
|
1636
|
-
isLinked,
|
|
1637
|
-
extendedValues
|
|
1638
|
-
}
|
|
1639
|
-
))), /* @__PURE__ */ React31.createElement(Grid6, { container: true, gap: 0.75, alignItems: "center" }, /* @__PURE__ */ React31.createElement(Grid6, { item: true, xs: 12 }, /* @__PURE__ */ React31.createElement(
|
|
1640
|
-
Label,
|
|
1641
|
-
{
|
|
1642
|
-
bind: "inline-start",
|
|
1643
|
-
label: isSiteRtl ? __7("Right", "elementor") : __7("Left", "elementor")
|
|
1644
|
-
}
|
|
1645
|
-
)), /* @__PURE__ */ React31.createElement(Grid6, { item: true, xs: 12 }, /* @__PURE__ */ React31.createElement(
|
|
1815
|
+
getCssMarginProps(isSiteRtl).map((row, index) => /* @__PURE__ */ React33.createElement(Stack8, { direction: "row", gap: 2, flexWrap: "nowrap", key: index, ref: gridRowRefs[index] }, row.map(({ icon, ...props }) => /* @__PURE__ */ React33.createElement(Grid6, { container: true, gap: 0.75, alignItems: "center", key: props.bind }, /* @__PURE__ */ React33.createElement(Grid6, { item: true, xs: 12 }, /* @__PURE__ */ React33.createElement(Label, { ...props })), /* @__PURE__ */ React33.createElement(Grid6, { item: true, xs: 12 }, /* @__PURE__ */ React33.createElement(
|
|
1646
1816
|
Control3,
|
|
1647
1817
|
{
|
|
1648
|
-
bind:
|
|
1818
|
+
bind: props.bind,
|
|
1819
|
+
startIcon: icon,
|
|
1649
1820
|
isLinked,
|
|
1650
|
-
|
|
1651
|
-
|
|
1821
|
+
extendedOptions,
|
|
1822
|
+
anchorRef: gridRowRefs[index]
|
|
1652
1823
|
}
|
|
1653
|
-
))))
|
|
1824
|
+
))))))
|
|
1654
1825
|
);
|
|
1655
1826
|
}
|
|
1656
1827
|
);
|
|
@@ -1658,30 +1829,59 @@ var Control3 = ({
|
|
|
1658
1829
|
bind,
|
|
1659
1830
|
startIcon,
|
|
1660
1831
|
isLinked,
|
|
1661
|
-
|
|
1832
|
+
extendedOptions,
|
|
1833
|
+
anchorRef
|
|
1662
1834
|
}) => {
|
|
1663
1835
|
if (isLinked) {
|
|
1664
|
-
return /* @__PURE__ */
|
|
1836
|
+
return /* @__PURE__ */ React33.createElement(SizeControl, { startIcon, extendedOptions, anchorRef });
|
|
1665
1837
|
}
|
|
1666
|
-
return /* @__PURE__ */
|
|
1838
|
+
return /* @__PURE__ */ React33.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React33.createElement(SizeControl, { startIcon, extendedOptions, anchorRef }));
|
|
1667
1839
|
};
|
|
1668
1840
|
var Label = ({ label, bind }) => {
|
|
1669
|
-
const isUsingNestedProps =
|
|
1841
|
+
const isUsingNestedProps = isExperimentActive3("e_v_3_30");
|
|
1670
1842
|
if (!isUsingNestedProps) {
|
|
1671
|
-
return /* @__PURE__ */
|
|
1843
|
+
return /* @__PURE__ */ React33.createElement(ControlFormLabel, null, label);
|
|
1672
1844
|
}
|
|
1673
|
-
return /* @__PURE__ */
|
|
1845
|
+
return /* @__PURE__ */ React33.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React33.createElement(ControlLabel, null, label));
|
|
1674
1846
|
};
|
|
1847
|
+
function getCssMarginProps(isSiteRtl) {
|
|
1848
|
+
return [
|
|
1849
|
+
[
|
|
1850
|
+
{
|
|
1851
|
+
bind: "block-start",
|
|
1852
|
+
label: __7("Top", "elementor"),
|
|
1853
|
+
icon: /* @__PURE__ */ React33.createElement(SideTopIcon, { fontSize: "tiny" })
|
|
1854
|
+
},
|
|
1855
|
+
{
|
|
1856
|
+
bind: "inline-end",
|
|
1857
|
+
label: isSiteRtl ? __7("Left", "elementor") : __7("Right", "elementor"),
|
|
1858
|
+
icon: isSiteRtl ? /* @__PURE__ */ React33.createElement(SideLeftIcon, { fontSize: "tiny" }) : /* @__PURE__ */ React33.createElement(SideRightIcon, { fontSize: "tiny" })
|
|
1859
|
+
}
|
|
1860
|
+
],
|
|
1861
|
+
[
|
|
1862
|
+
{
|
|
1863
|
+
bind: "block-end",
|
|
1864
|
+
label: __7("Bottom", "elementor"),
|
|
1865
|
+
icon: /* @__PURE__ */ React33.createElement(SideBottomIcon, { fontSize: "tiny" })
|
|
1866
|
+
},
|
|
1867
|
+
{
|
|
1868
|
+
bind: "inline-start",
|
|
1869
|
+
label: isSiteRtl ? __7("Right", "elementor") : __7("Left", "elementor"),
|
|
1870
|
+
icon: isSiteRtl ? /* @__PURE__ */ React33.createElement(SideRightIcon, { fontSize: "tiny" }) : /* @__PURE__ */ React33.createElement(SideLeftIcon, { fontSize: "tiny" })
|
|
1871
|
+
}
|
|
1872
|
+
]
|
|
1873
|
+
];
|
|
1874
|
+
}
|
|
1675
1875
|
|
|
1676
1876
|
// src/controls/font-family-control/font-family-control.tsx
|
|
1677
|
-
import * as
|
|
1678
|
-
import { stringPropTypeUtil as
|
|
1877
|
+
import * as React35 from "react";
|
|
1878
|
+
import { stringPropTypeUtil as stringPropTypeUtil5 } from "@elementor/editor-props";
|
|
1679
1879
|
import { ChevronDownIcon as ChevronDownIcon2 } from "@elementor/icons";
|
|
1680
|
-
import { bindPopover as
|
|
1880
|
+
import { bindPopover as bindPopover4, bindTrigger as bindTrigger3, Popover as Popover4, UnstableTag as UnstableTag2, usePopupState as usePopupState5 } from "@elementor/ui";
|
|
1681
1881
|
|
|
1682
1882
|
// src/components/font-family-selector.tsx
|
|
1683
|
-
import { useEffect as
|
|
1684
|
-
import * as
|
|
1883
|
+
import { useEffect as useEffect5, useRef as useRef7, useState as useState6 } from "react";
|
|
1884
|
+
import * as React34 from "react";
|
|
1685
1885
|
import { PopoverHeader } from "@elementor/editor-ui";
|
|
1686
1886
|
import { SearchIcon, TextIcon } from "@elementor/icons";
|
|
1687
1887
|
import {
|
|
@@ -1693,7 +1893,7 @@ import {
|
|
|
1693
1893
|
MenuSubheader,
|
|
1694
1894
|
Stack as Stack9,
|
|
1695
1895
|
styled as styled4,
|
|
1696
|
-
TextField as
|
|
1896
|
+
TextField as TextField6,
|
|
1697
1897
|
Typography as Typography3
|
|
1698
1898
|
} from "@elementor/ui";
|
|
1699
1899
|
import { debounce } from "@elementor/utils";
|
|
@@ -1730,7 +1930,7 @@ var FontFamilySelector = ({
|
|
|
1730
1930
|
onFontFamilyChange,
|
|
1731
1931
|
onClose
|
|
1732
1932
|
}) => {
|
|
1733
|
-
const [searchValue, setSearchValue] =
|
|
1933
|
+
const [searchValue, setSearchValue] = useState6("");
|
|
1734
1934
|
const filteredFontFamilies = useFilteredFontFamilies(fontFamilies, searchValue);
|
|
1735
1935
|
const handleSearch = (event) => {
|
|
1736
1936
|
setSearchValue(event.target.value);
|
|
@@ -1739,15 +1939,15 @@ var FontFamilySelector = ({
|
|
|
1739
1939
|
setSearchValue("");
|
|
1740
1940
|
onClose();
|
|
1741
1941
|
};
|
|
1742
|
-
return /* @__PURE__ */
|
|
1942
|
+
return /* @__PURE__ */ React34.createElement(Stack9, null, /* @__PURE__ */ React34.createElement(
|
|
1743
1943
|
PopoverHeader,
|
|
1744
1944
|
{
|
|
1745
1945
|
title: __8("Font Family", "elementor"),
|
|
1746
1946
|
onClose: handleClose,
|
|
1747
|
-
icon: /* @__PURE__ */
|
|
1947
|
+
icon: /* @__PURE__ */ React34.createElement(TextIcon, { fontSize: SIZE2 })
|
|
1748
1948
|
}
|
|
1749
|
-
), /* @__PURE__ */
|
|
1750
|
-
|
|
1949
|
+
), /* @__PURE__ */ React34.createElement(Box3, { px: 1.5, pb: 1 }, /* @__PURE__ */ React34.createElement(
|
|
1950
|
+
TextField6,
|
|
1751
1951
|
{
|
|
1752
1952
|
autoFocus: true,
|
|
1753
1953
|
fullWidth: true,
|
|
@@ -1756,10 +1956,10 @@ var FontFamilySelector = ({
|
|
|
1756
1956
|
placeholder: __8("Search", "elementor"),
|
|
1757
1957
|
onChange: handleSearch,
|
|
1758
1958
|
InputProps: {
|
|
1759
|
-
startAdornment: /* @__PURE__ */
|
|
1959
|
+
startAdornment: /* @__PURE__ */ React34.createElement(InputAdornment3, { position: "start" }, /* @__PURE__ */ React34.createElement(SearchIcon, { fontSize: SIZE2 }))
|
|
1760
1960
|
}
|
|
1761
1961
|
}
|
|
1762
|
-
)), /* @__PURE__ */
|
|
1962
|
+
)), /* @__PURE__ */ React34.createElement(Divider2, null), filteredFontFamilies.length > 0 ? /* @__PURE__ */ React34.createElement(
|
|
1763
1963
|
FontList,
|
|
1764
1964
|
{
|
|
1765
1965
|
fontListItems: filteredFontFamilies,
|
|
@@ -1767,7 +1967,7 @@ var FontFamilySelector = ({
|
|
|
1767
1967
|
handleClose,
|
|
1768
1968
|
fontFamily
|
|
1769
1969
|
}
|
|
1770
|
-
) : /* @__PURE__ */
|
|
1970
|
+
) : /* @__PURE__ */ React34.createElement(Box3, { sx: { overflowY: "auto", height: 260, width: 220 } }, /* @__PURE__ */ React34.createElement(Stack9, { alignItems: "center", p: 2.5, gap: 1.5, overflow: "hidden" }, /* @__PURE__ */ React34.createElement(TextIcon, { fontSize: "large" }), /* @__PURE__ */ React34.createElement(Box3, { sx: { maxWidth: 160, overflow: "hidden" } }, /* @__PURE__ */ React34.createElement(Typography3, { align: "center", variant: "subtitle2", color: "text.secondary" }, __8("Sorry, nothing matched", "elementor")), /* @__PURE__ */ React34.createElement(
|
|
1771
1971
|
Typography3,
|
|
1772
1972
|
{
|
|
1773
1973
|
variant: "subtitle2",
|
|
@@ -1778,10 +1978,10 @@ var FontFamilySelector = ({
|
|
|
1778
1978
|
justifyContent: "center"
|
|
1779
1979
|
}
|
|
1780
1980
|
},
|
|
1781
|
-
/* @__PURE__ */
|
|
1782
|
-
/* @__PURE__ */
|
|
1783
|
-
/* @__PURE__ */
|
|
1784
|
-
)), /* @__PURE__ */
|
|
1981
|
+
/* @__PURE__ */ React34.createElement("span", null, "\u201C"),
|
|
1982
|
+
/* @__PURE__ */ React34.createElement("span", { style: { maxWidth: "80%", overflow: "hidden", textOverflow: "ellipsis" } }, searchValue),
|
|
1983
|
+
/* @__PURE__ */ React34.createElement("span", null, "\u201D.")
|
|
1984
|
+
)), /* @__PURE__ */ React34.createElement(Typography3, { align: "center", variant: "caption", color: "text.secondary" }, __8("Try something else.", "elementor"), /* @__PURE__ */ React34.createElement(
|
|
1785
1985
|
Link,
|
|
1786
1986
|
{
|
|
1787
1987
|
color: "secondary",
|
|
@@ -1795,7 +1995,7 @@ var FontFamilySelector = ({
|
|
|
1795
1995
|
var LIST_ITEM_HEIGHT = 36;
|
|
1796
1996
|
var LIST_ITEMS_BUFFER = 6;
|
|
1797
1997
|
var FontList = ({ fontListItems, setFontFamily, handleClose, fontFamily }) => {
|
|
1798
|
-
const containerRef =
|
|
1998
|
+
const containerRef = useRef7(null);
|
|
1799
1999
|
const selectedItem = fontListItems.find((item) => item.value === fontFamily);
|
|
1800
2000
|
const debouncedVirtualizeChange = useDebounce(({ getVirtualIndexes }) => {
|
|
1801
2001
|
getVirtualIndexes().forEach((index) => {
|
|
@@ -1812,7 +2012,7 @@ var FontList = ({ fontListItems, setFontFamily, handleClose, fontFamily }) => {
|
|
|
1812
2012
|
overscan: LIST_ITEMS_BUFFER,
|
|
1813
2013
|
onChange: debouncedVirtualizeChange
|
|
1814
2014
|
});
|
|
1815
|
-
|
|
2015
|
+
useEffect5(
|
|
1816
2016
|
() => {
|
|
1817
2017
|
virtualizer.scrollToIndex(fontListItems.findIndex((item) => item.value === fontFamily));
|
|
1818
2018
|
},
|
|
@@ -1820,7 +2020,7 @@ var FontList = ({ fontListItems, setFontFamily, handleClose, fontFamily }) => {
|
|
|
1820
2020
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1821
2021
|
[fontFamily]
|
|
1822
2022
|
);
|
|
1823
|
-
return /* @__PURE__ */
|
|
2023
|
+
return /* @__PURE__ */ React34.createElement(
|
|
1824
2024
|
Box3,
|
|
1825
2025
|
{
|
|
1826
2026
|
ref: containerRef,
|
|
@@ -1830,7 +2030,7 @@ var FontList = ({ fontListItems, setFontFamily, handleClose, fontFamily }) => {
|
|
|
1830
2030
|
width: 220
|
|
1831
2031
|
}
|
|
1832
2032
|
},
|
|
1833
|
-
/* @__PURE__ */
|
|
2033
|
+
/* @__PURE__ */ React34.createElement(
|
|
1834
2034
|
StyledMenuList,
|
|
1835
2035
|
{
|
|
1836
2036
|
role: "listbox",
|
|
@@ -1846,7 +2046,7 @@ var FontList = ({ fontListItems, setFontFamily, handleClose, fontFamily }) => {
|
|
|
1846
2046
|
const isSelected = selectedItem?.value === item.value;
|
|
1847
2047
|
const tabIndexFallback = !selectedItem ? 0 : -1;
|
|
1848
2048
|
if (item.type === "category") {
|
|
1849
|
-
return /* @__PURE__ */
|
|
2049
|
+
return /* @__PURE__ */ React34.createElement(
|
|
1850
2050
|
MenuSubheader,
|
|
1851
2051
|
{
|
|
1852
2052
|
key: virtualRow.key,
|
|
@@ -1857,7 +2057,7 @@ var FontList = ({ fontListItems, setFontFamily, handleClose, fontFamily }) => {
|
|
|
1857
2057
|
item.value
|
|
1858
2058
|
);
|
|
1859
2059
|
}
|
|
1860
|
-
return /* @__PURE__ */
|
|
2060
|
+
return /* @__PURE__ */ React34.createElement(
|
|
1861
2061
|
"li",
|
|
1862
2062
|
{
|
|
1863
2063
|
key: virtualRow.key,
|
|
@@ -1920,35 +2120,35 @@ var StyledMenuList = styled4(MenuList)(({ theme }) => ({
|
|
|
1920
2120
|
position: "relative"
|
|
1921
2121
|
}));
|
|
1922
2122
|
var useDebounce = (fn, delay) => {
|
|
1923
|
-
const [debouncedFn] =
|
|
1924
|
-
|
|
2123
|
+
const [debouncedFn] = useState6(() => debounce(fn, delay));
|
|
2124
|
+
useEffect5(() => () => debouncedFn.cancel(), [debouncedFn]);
|
|
1925
2125
|
return debouncedFn;
|
|
1926
2126
|
};
|
|
1927
2127
|
|
|
1928
2128
|
// src/controls/font-family-control/font-family-control.tsx
|
|
1929
2129
|
var SIZE3 = "tiny";
|
|
1930
2130
|
var FontFamilyControl = createControl(({ fontFamilies }) => {
|
|
1931
|
-
const { value: fontFamily, setValue: setFontFamily, disabled } = useBoundProp(
|
|
1932
|
-
const popoverState =
|
|
1933
|
-
return /* @__PURE__ */
|
|
2131
|
+
const { value: fontFamily, setValue: setFontFamily, disabled } = useBoundProp(stringPropTypeUtil5);
|
|
2132
|
+
const popoverState = usePopupState5({ variant: "popover" });
|
|
2133
|
+
return /* @__PURE__ */ React35.createElement(React35.Fragment, null, /* @__PURE__ */ React35.createElement(ControlActions, null, /* @__PURE__ */ React35.createElement(
|
|
1934
2134
|
UnstableTag2,
|
|
1935
2135
|
{
|
|
1936
2136
|
variant: "outlined",
|
|
1937
2137
|
label: fontFamily,
|
|
1938
|
-
endIcon: /* @__PURE__ */
|
|
2138
|
+
endIcon: /* @__PURE__ */ React35.createElement(ChevronDownIcon2, { fontSize: SIZE3 }),
|
|
1939
2139
|
...bindTrigger3(popoverState),
|
|
1940
2140
|
fullWidth: true,
|
|
1941
2141
|
disabled
|
|
1942
2142
|
}
|
|
1943
|
-
)), /* @__PURE__ */
|
|
1944
|
-
|
|
2143
|
+
)), /* @__PURE__ */ React35.createElement(
|
|
2144
|
+
Popover4,
|
|
1945
2145
|
{
|
|
1946
2146
|
disablePortal: true,
|
|
1947
2147
|
disableScrollLock: true,
|
|
1948
2148
|
anchorOrigin: { vertical: "bottom", horizontal: "left" },
|
|
1949
|
-
...
|
|
2149
|
+
...bindPopover4(popoverState)
|
|
1950
2150
|
},
|
|
1951
|
-
/* @__PURE__ */
|
|
2151
|
+
/* @__PURE__ */ React35.createElement(
|
|
1952
2152
|
FontFamilySelector,
|
|
1953
2153
|
{
|
|
1954
2154
|
fontFamilies,
|
|
@@ -1961,14 +2161,14 @@ var FontFamilyControl = createControl(({ fontFamilies }) => {
|
|
|
1961
2161
|
});
|
|
1962
2162
|
|
|
1963
2163
|
// src/controls/url-control.tsx
|
|
1964
|
-
import * as
|
|
2164
|
+
import * as React36 from "react";
|
|
1965
2165
|
import { urlPropTypeUtil } from "@elementor/editor-props";
|
|
1966
|
-
import { TextField as
|
|
2166
|
+
import { TextField as TextField7 } from "@elementor/ui";
|
|
1967
2167
|
var UrlControl = createControl(({ placeholder }) => {
|
|
1968
2168
|
const { value, setValue, disabled } = useBoundProp(urlPropTypeUtil);
|
|
1969
2169
|
const handleChange = (event) => setValue(event.target.value);
|
|
1970
|
-
return /* @__PURE__ */
|
|
1971
|
-
|
|
2170
|
+
return /* @__PURE__ */ React36.createElement(ControlActions, null, /* @__PURE__ */ React36.createElement(
|
|
2171
|
+
TextField7,
|
|
1972
2172
|
{
|
|
1973
2173
|
size: "tiny",
|
|
1974
2174
|
fullWidth: true,
|
|
@@ -1981,14 +2181,14 @@ var UrlControl = createControl(({ placeholder }) => {
|
|
|
1981
2181
|
});
|
|
1982
2182
|
|
|
1983
2183
|
// src/controls/link-control.tsx
|
|
1984
|
-
import * as
|
|
1985
|
-
import { useMemo as
|
|
2184
|
+
import * as React38 from "react";
|
|
2185
|
+
import { useMemo as useMemo3, useState as useState7 } from "react";
|
|
1986
2186
|
import { getLinkInLinkRestriction, selectElement } from "@elementor/editor-elements";
|
|
1987
2187
|
import {
|
|
1988
2188
|
booleanPropTypeUtil,
|
|
1989
2189
|
linkPropTypeUtil,
|
|
1990
2190
|
numberPropTypeUtil as numberPropTypeUtil2,
|
|
1991
|
-
stringPropTypeUtil as
|
|
2191
|
+
stringPropTypeUtil as stringPropTypeUtil6,
|
|
1992
2192
|
urlPropTypeUtil as urlPropTypeUtil2
|
|
1993
2193
|
} from "@elementor/editor-props";
|
|
1994
2194
|
import { InfoTipCard } from "@elementor/editor-ui";
|
|
@@ -2000,17 +2200,17 @@ import { debounce as debounce2 } from "@elementor/utils";
|
|
|
2000
2200
|
import { __ as __9 } from "@wordpress/i18n";
|
|
2001
2201
|
|
|
2002
2202
|
// src/components/autocomplete.tsx
|
|
2003
|
-
import * as
|
|
2004
|
-
import { forwardRef as
|
|
2203
|
+
import * as React37 from "react";
|
|
2204
|
+
import { forwardRef as forwardRef4 } from "react";
|
|
2005
2205
|
import { XIcon as XIcon2 } from "@elementor/icons";
|
|
2006
2206
|
import {
|
|
2007
2207
|
Autocomplete as AutocompleteBase,
|
|
2008
2208
|
Box as Box4,
|
|
2009
2209
|
IconButton as IconButton2,
|
|
2010
2210
|
InputAdornment as InputAdornment4,
|
|
2011
|
-
TextField as
|
|
2211
|
+
TextField as TextField8
|
|
2012
2212
|
} from "@elementor/ui";
|
|
2013
|
-
var Autocomplete =
|
|
2213
|
+
var Autocomplete = forwardRef4((props, ref) => {
|
|
2014
2214
|
const {
|
|
2015
2215
|
options,
|
|
2016
2216
|
onOptionChange,
|
|
@@ -2026,7 +2226,7 @@ var Autocomplete = forwardRef2((props, ref) => {
|
|
|
2026
2226
|
const muiWarningPreventer = allowCustomValues || !!value?.toString()?.length;
|
|
2027
2227
|
const isOptionEqualToValue = muiWarningPreventer ? void 0 : () => true;
|
|
2028
2228
|
const isValueFromOptions = typeof value === "number" && !!findMatchingOption(options, value);
|
|
2029
|
-
return /* @__PURE__ */
|
|
2229
|
+
return /* @__PURE__ */ React37.createElement(
|
|
2030
2230
|
AutocompleteBase,
|
|
2031
2231
|
{
|
|
2032
2232
|
...restProps,
|
|
@@ -2044,8 +2244,8 @@ var Autocomplete = forwardRef2((props, ref) => {
|
|
|
2044
2244
|
groupBy: isCategorizedOptionPool(options) ? (optionId) => findMatchingOption(options, optionId)?.groupLabel || optionId : void 0,
|
|
2045
2245
|
isOptionEqualToValue,
|
|
2046
2246
|
filterOptions: () => optionKeys,
|
|
2047
|
-
renderOption: (optionProps, optionId) => /* @__PURE__ */
|
|
2048
|
-
renderInput: (params) => /* @__PURE__ */
|
|
2247
|
+
renderOption: (optionProps, optionId) => /* @__PURE__ */ React37.createElement(Box4, { component: "li", ...optionProps, key: optionProps.id }, findMatchingOption(options, optionId)?.label ?? optionId),
|
|
2248
|
+
renderInput: (params) => /* @__PURE__ */ React37.createElement(
|
|
2049
2249
|
TextInput,
|
|
2050
2250
|
{
|
|
2051
2251
|
params,
|
|
@@ -2068,8 +2268,8 @@ var TextInput = ({
|
|
|
2068
2268
|
const onChange = (event) => {
|
|
2069
2269
|
handleChange(event.target.value);
|
|
2070
2270
|
};
|
|
2071
|
-
return /* @__PURE__ */
|
|
2072
|
-
|
|
2271
|
+
return /* @__PURE__ */ React37.createElement(
|
|
2272
|
+
TextField8,
|
|
2073
2273
|
{
|
|
2074
2274
|
...params,
|
|
2075
2275
|
placeholder,
|
|
@@ -2081,7 +2281,7 @@ var TextInput = ({
|
|
|
2081
2281
|
},
|
|
2082
2282
|
InputProps: {
|
|
2083
2283
|
...params.InputProps,
|
|
2084
|
-
endAdornment: /* @__PURE__ */
|
|
2284
|
+
endAdornment: /* @__PURE__ */ React37.createElement(ClearButton, { params, allowClear, handleChange })
|
|
2085
2285
|
}
|
|
2086
2286
|
}
|
|
2087
2287
|
);
|
|
@@ -2090,7 +2290,7 @@ var ClearButton = ({
|
|
|
2090
2290
|
allowClear,
|
|
2091
2291
|
handleChange,
|
|
2092
2292
|
params
|
|
2093
|
-
}) => /* @__PURE__ */
|
|
2293
|
+
}) => /* @__PURE__ */ React37.createElement(InputAdornment4, { position: "end" }, allowClear && /* @__PURE__ */ React37.createElement(IconButton2, { size: params.size, onClick: () => handleChange(null), sx: { cursor: "pointer" } }, /* @__PURE__ */ React37.createElement(XIcon2, { fontSize: params.size })));
|
|
2094
2294
|
function findMatchingOption(options, optionId = null) {
|
|
2095
2295
|
const formattedOption = (optionId || "").toString();
|
|
2096
2296
|
return options.find(({ id }) => formattedOption === id.toString());
|
|
@@ -2120,7 +2320,7 @@ var learnMoreButton = {
|
|
|
2120
2320
|
var LinkControl = createControl((props) => {
|
|
2121
2321
|
const { value, path, setValue, ...propContext } = useBoundProp(linkPropTypeUtil);
|
|
2122
2322
|
const [linkSessionValue, setLinkSessionValue] = useSessionStorage(path.join("/"));
|
|
2123
|
-
const [isActive, setIsActive] =
|
|
2323
|
+
const [isActive, setIsActive] = useState7(!!value);
|
|
2124
2324
|
const {
|
|
2125
2325
|
allowCustomValues,
|
|
2126
2326
|
queryOptions: { endpoint = "", requestParams = {} },
|
|
@@ -2128,8 +2328,8 @@ var LinkControl = createControl((props) => {
|
|
|
2128
2328
|
minInputLength = 2,
|
|
2129
2329
|
context: { elementId }
|
|
2130
2330
|
} = props || {};
|
|
2131
|
-
const [linkInLinkRestriction, setLinkInLinkRestriction] =
|
|
2132
|
-
const [options, setOptions] =
|
|
2331
|
+
const [linkInLinkRestriction, setLinkInLinkRestriction] = useState7(getLinkInLinkRestriction(elementId));
|
|
2332
|
+
const [options, setOptions] = useState7(
|
|
2133
2333
|
generateFirstLoadedOption(value)
|
|
2134
2334
|
);
|
|
2135
2335
|
const shouldDisableAddingLink = !isActive && linkInLinkRestriction.shouldRestrict;
|
|
@@ -2155,7 +2355,7 @@ var LinkControl = createControl((props) => {
|
|
|
2155
2355
|
const valueToSave = newValue ? {
|
|
2156
2356
|
...value,
|
|
2157
2357
|
destination: numberPropTypeUtil2.create(newValue),
|
|
2158
|
-
label:
|
|
2358
|
+
label: stringPropTypeUtil6.create(findMatchingOption(options, newValue)?.label || null)
|
|
2159
2359
|
} : null;
|
|
2160
2360
|
onSaveNewValue(valueToSave);
|
|
2161
2361
|
};
|
|
@@ -2164,7 +2364,7 @@ var LinkControl = createControl((props) => {
|
|
|
2164
2364
|
const valueToSave = newValue ? {
|
|
2165
2365
|
...value,
|
|
2166
2366
|
destination: urlPropTypeUtil2.create(newValue),
|
|
2167
|
-
label:
|
|
2367
|
+
label: stringPropTypeUtil6.create("")
|
|
2168
2368
|
} : null;
|
|
2169
2369
|
onSaveNewValue(valueToSave);
|
|
2170
2370
|
updateOptions(newValue);
|
|
@@ -2180,7 +2380,7 @@ var LinkControl = createControl((props) => {
|
|
|
2180
2380
|
}
|
|
2181
2381
|
debounceFetch({ ...requestParams, term: newValue });
|
|
2182
2382
|
};
|
|
2183
|
-
const debounceFetch =
|
|
2383
|
+
const debounceFetch = useMemo3(
|
|
2184
2384
|
() => debounce2(
|
|
2185
2385
|
(params) => fetchOptions(endpoint, params).then((newOptions) => {
|
|
2186
2386
|
setOptions(formatOptions(newOptions));
|
|
@@ -2189,7 +2389,7 @@ var LinkControl = createControl((props) => {
|
|
|
2189
2389
|
),
|
|
2190
2390
|
[endpoint]
|
|
2191
2391
|
);
|
|
2192
|
-
return /* @__PURE__ */
|
|
2392
|
+
return /* @__PURE__ */ React38.createElement(PropProvider, { ...propContext, value, setValue }, /* @__PURE__ */ React38.createElement(Stack10, { gap: 1.5 }, /* @__PURE__ */ React38.createElement(
|
|
2193
2393
|
Stack10,
|
|
2194
2394
|
{
|
|
2195
2395
|
direction: "row",
|
|
@@ -2199,8 +2399,8 @@ var LinkControl = createControl((props) => {
|
|
|
2199
2399
|
marginInlineEnd: -0.75
|
|
2200
2400
|
}
|
|
2201
2401
|
},
|
|
2202
|
-
/* @__PURE__ */
|
|
2203
|
-
/* @__PURE__ */
|
|
2402
|
+
/* @__PURE__ */ React38.createElement(ControlFormLabel, null, __9("Link", "elementor")),
|
|
2403
|
+
/* @__PURE__ */ React38.createElement(ConditionalInfoTip, { isVisible: !isActive, linkInLinkRestriction }, /* @__PURE__ */ React38.createElement(
|
|
2204
2404
|
ToggleIconControl,
|
|
2205
2405
|
{
|
|
2206
2406
|
disabled: shouldDisableAddingLink,
|
|
@@ -2209,7 +2409,7 @@ var LinkControl = createControl((props) => {
|
|
|
2209
2409
|
label: __9("Toggle link", "elementor")
|
|
2210
2410
|
}
|
|
2211
2411
|
))
|
|
2212
|
-
), /* @__PURE__ */
|
|
2412
|
+
), /* @__PURE__ */ React38.createElement(Collapse, { in: isActive, timeout: "auto", unmountOnExit: true }, /* @__PURE__ */ React38.createElement(Stack10, { gap: 1.5 }, /* @__PURE__ */ React38.createElement(PropKeyProvider, { bind: "destination" }, /* @__PURE__ */ React38.createElement(ControlActions, null, /* @__PURE__ */ React38.createElement(
|
|
2213
2413
|
Autocomplete,
|
|
2214
2414
|
{
|
|
2215
2415
|
options,
|
|
@@ -2220,10 +2420,10 @@ var LinkControl = createControl((props) => {
|
|
|
2220
2420
|
onTextChange,
|
|
2221
2421
|
minInputLength
|
|
2222
2422
|
}
|
|
2223
|
-
))), /* @__PURE__ */
|
|
2423
|
+
))), /* @__PURE__ */ React38.createElement(PropKeyProvider, { bind: "isTargetBlank" }, /* @__PURE__ */ React38.createElement(SwitchControl, { disabled: propContext.disabled || !value }))))));
|
|
2224
2424
|
});
|
|
2225
2425
|
var ToggleIconControl = ({ disabled, active, onIconClick, label }) => {
|
|
2226
|
-
return /* @__PURE__ */
|
|
2426
|
+
return /* @__PURE__ */ React38.createElement(IconButton3, { size: SIZE4, onClick: onIconClick, "aria-label": label, disabled }, active ? /* @__PURE__ */ React38.createElement(MinusIcon, { fontSize: SIZE4 }) : /* @__PURE__ */ React38.createElement(PlusIcon2, { fontSize: SIZE4 }));
|
|
2227
2427
|
};
|
|
2228
2428
|
var SwitchControl = ({ disabled }) => {
|
|
2229
2429
|
const { value = false, setValue } = useBoundProp(booleanPropTypeUtil);
|
|
@@ -2235,7 +2435,7 @@ var SwitchControl = ({ disabled }) => {
|
|
|
2235
2435
|
opacity: 0
|
|
2236
2436
|
}
|
|
2237
2437
|
} : {};
|
|
2238
|
-
return /* @__PURE__ */
|
|
2438
|
+
return /* @__PURE__ */ React38.createElement(Grid7, { container: true, alignItems: "center", flexWrap: "nowrap", justifyContent: "space-between" }, /* @__PURE__ */ React38.createElement(Grid7, { item: true }, /* @__PURE__ */ React38.createElement(ControlFormLabel, null, __9("Open in a new tab", "elementor"))), /* @__PURE__ */ React38.createElement(Grid7, { item: true, sx: { marginInlineEnd: -1 } }, /* @__PURE__ */ React38.createElement(Switch, { checked: value, onClick, disabled, inputProps })));
|
|
2239
2439
|
};
|
|
2240
2440
|
async function fetchOptions(ajaxUrl, params) {
|
|
2241
2441
|
if (!params || !ajaxUrl) {
|
|
@@ -2272,15 +2472,15 @@ var ConditionalInfoTip = ({ linkInLinkRestriction, isVisible, children }) => {
|
|
|
2272
2472
|
selectElement(elementId);
|
|
2273
2473
|
}
|
|
2274
2474
|
};
|
|
2275
|
-
return shouldRestrict && isVisible ? /* @__PURE__ */
|
|
2475
|
+
return shouldRestrict && isVisible ? /* @__PURE__ */ React38.createElement(
|
|
2276
2476
|
Infotip,
|
|
2277
2477
|
{
|
|
2278
2478
|
placement: "right",
|
|
2279
|
-
content: /* @__PURE__ */
|
|
2479
|
+
content: /* @__PURE__ */ React38.createElement(
|
|
2280
2480
|
InfoTipCard,
|
|
2281
2481
|
{
|
|
2282
2482
|
content: INFOTIP_CONTENT[reason],
|
|
2283
|
-
svgIcon: /* @__PURE__ */
|
|
2483
|
+
svgIcon: /* @__PURE__ */ React38.createElement(AlertTriangleIcon, null),
|
|
2284
2484
|
learnMoreButton,
|
|
2285
2485
|
ctaButton: {
|
|
2286
2486
|
label: __9("Take me there", "elementor"),
|
|
@@ -2289,16 +2489,17 @@ var ConditionalInfoTip = ({ linkInLinkRestriction, isVisible, children }) => {
|
|
|
2289
2489
|
}
|
|
2290
2490
|
)
|
|
2291
2491
|
},
|
|
2292
|
-
/* @__PURE__ */
|
|
2293
|
-
) : /* @__PURE__ */
|
|
2492
|
+
/* @__PURE__ */ React38.createElement(Box5, null, children)
|
|
2493
|
+
) : /* @__PURE__ */ React38.createElement(React38.Fragment, null, children);
|
|
2294
2494
|
};
|
|
2295
2495
|
var INFOTIP_CONTENT = {
|
|
2296
|
-
descendant: /* @__PURE__ */
|
|
2297
|
-
ancestor: /* @__PURE__ */
|
|
2496
|
+
descendant: /* @__PURE__ */ React38.createElement(React38.Fragment, null, __9("To add a link to this container,", "elementor"), /* @__PURE__ */ React38.createElement("br", null), __9("first remove the link from the elements inside of it.", "elementor")),
|
|
2497
|
+
ancestor: /* @__PURE__ */ React38.createElement(React38.Fragment, null, __9("To add a link to this element,", "elementor"), /* @__PURE__ */ React38.createElement("br", null), __9("first remove the link from its parent container.", "elementor"))
|
|
2298
2498
|
};
|
|
2299
2499
|
|
|
2300
2500
|
// src/controls/gap-control.tsx
|
|
2301
|
-
import * as
|
|
2501
|
+
import * as React39 from "react";
|
|
2502
|
+
import { useRef as useRef8 } from "react";
|
|
2302
2503
|
import { layoutDirectionPropTypeUtil, sizePropTypeUtil as sizePropTypeUtil4 } from "@elementor/editor-props";
|
|
2303
2504
|
import { DetachIcon as DetachIcon2, LinkIcon as LinkIcon2 } from "@elementor/icons";
|
|
2304
2505
|
import { Grid as Grid8, Stack as Stack11, ToggleButton as ToggleButton4, Tooltip as Tooltip5 } from "@elementor/ui";
|
|
@@ -2310,6 +2511,7 @@ var GapControl = createControl(({ label }) => {
|
|
|
2310
2511
|
propType,
|
|
2311
2512
|
disabled: directionDisabled
|
|
2312
2513
|
} = useBoundProp(layoutDirectionPropTypeUtil);
|
|
2514
|
+
const stackRef = useRef8();
|
|
2313
2515
|
const { value: sizeValue, setValue: setSizeValue, disabled: sizeDisabled } = useBoundProp(sizePropTypeUtil4);
|
|
2314
2516
|
const isLinked = !directionValue && !sizeValue ? true : !!sizeValue;
|
|
2315
2517
|
const onLinkToggle = () => {
|
|
@@ -2328,7 +2530,7 @@ var GapControl = createControl(({ label }) => {
|
|
|
2328
2530
|
const linkedLabel = __10("Link %s", "elementor").replace("%s", tooltipLabel);
|
|
2329
2531
|
const unlinkedLabel = __10("Unlink %s", "elementor").replace("%s", tooltipLabel);
|
|
2330
2532
|
const disabled = sizeDisabled || directionDisabled;
|
|
2331
|
-
return /* @__PURE__ */
|
|
2533
|
+
return /* @__PURE__ */ React39.createElement(PropProvider, { propType, value: directionValue, setValue: setDirectionValue }, /* @__PURE__ */ React39.createElement(Stack11, { direction: "row", gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React39.createElement(ControlLabel, null, label), /* @__PURE__ */ React39.createElement(Tooltip5, { title: isLinked ? unlinkedLabel : linkedLabel, placement: "top" }, /* @__PURE__ */ React39.createElement(
|
|
2332
2534
|
ToggleButton4,
|
|
2333
2535
|
{
|
|
2334
2536
|
"aria-label": isLinked ? unlinkedLabel : linkedLabel,
|
|
@@ -2339,23 +2541,27 @@ var GapControl = createControl(({ label }) => {
|
|
|
2339
2541
|
onChange: onLinkToggle,
|
|
2340
2542
|
disabled
|
|
2341
2543
|
},
|
|
2342
|
-
/* @__PURE__ */
|
|
2343
|
-
))), /* @__PURE__ */
|
|
2544
|
+
/* @__PURE__ */ React39.createElement(LinkedIcon, { fontSize: "tiny" })
|
|
2545
|
+
))), /* @__PURE__ */ React39.createElement(Stack11, { direction: "row", gap: 2, flexWrap: "nowrap", ref: stackRef }, /* @__PURE__ */ React39.createElement(Grid8, { container: true, gap: 0.75, alignItems: "center" }, /* @__PURE__ */ React39.createElement(Grid8, { item: true, xs: 12 }, /* @__PURE__ */ React39.createElement(ControlFormLabel, null, __10("Column", "elementor"))), /* @__PURE__ */ React39.createElement(Grid8, { item: true, xs: 12 }, /* @__PURE__ */ React39.createElement(Control4, { bind: "column", isLinked, anchorRef: stackRef }))), /* @__PURE__ */ React39.createElement(Grid8, { container: true, gap: 0.75, alignItems: "center" }, /* @__PURE__ */ React39.createElement(Grid8, { item: true, xs: 12 }, /* @__PURE__ */ React39.createElement(ControlFormLabel, null, __10("Row", "elementor"))), /* @__PURE__ */ React39.createElement(Grid8, { item: true, xs: 12 }, /* @__PURE__ */ React39.createElement(Control4, { bind: "row", isLinked, anchorRef: stackRef })))));
|
|
2344
2546
|
});
|
|
2345
|
-
var Control4 = ({
|
|
2547
|
+
var Control4 = ({
|
|
2548
|
+
bind,
|
|
2549
|
+
isLinked,
|
|
2550
|
+
anchorRef
|
|
2551
|
+
}) => {
|
|
2346
2552
|
if (isLinked) {
|
|
2347
|
-
return /* @__PURE__ */
|
|
2553
|
+
return /* @__PURE__ */ React39.createElement(SizeControl, { anchorRef });
|
|
2348
2554
|
}
|
|
2349
|
-
return /* @__PURE__ */
|
|
2555
|
+
return /* @__PURE__ */ React39.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React39.createElement(SizeControl, { anchorRef }));
|
|
2350
2556
|
};
|
|
2351
2557
|
|
|
2352
2558
|
// src/controls/aspect-ratio-control.tsx
|
|
2353
|
-
import * as
|
|
2354
|
-
import { useState as
|
|
2355
|
-
import { stringPropTypeUtil as
|
|
2559
|
+
import * as React40 from "react";
|
|
2560
|
+
import { useState as useState8 } from "react";
|
|
2561
|
+
import { stringPropTypeUtil as stringPropTypeUtil7 } from "@elementor/editor-props";
|
|
2356
2562
|
import { MenuListItem as MenuListItem3 } from "@elementor/editor-ui";
|
|
2357
2563
|
import { ArrowsMoveHorizontalIcon, ArrowsMoveVerticalIcon } from "@elementor/icons";
|
|
2358
|
-
import { Grid as Grid9, Select as Select2, Stack as Stack12, TextField as
|
|
2564
|
+
import { Grid as Grid9, Select as Select2, Stack as Stack12, TextField as TextField9 } from "@elementor/ui";
|
|
2359
2565
|
import { __ as __11 } from "@wordpress/i18n";
|
|
2360
2566
|
var RATIO_OPTIONS = [
|
|
2361
2567
|
{ label: __11("Auto", "elementor"), value: "auto" },
|
|
@@ -2369,13 +2575,13 @@ var RATIO_OPTIONS = [
|
|
|
2369
2575
|
];
|
|
2370
2576
|
var CUSTOM_RATIO = "custom";
|
|
2371
2577
|
var AspectRatioControl = createControl(({ label }) => {
|
|
2372
|
-
const { value: aspectRatioValue, setValue: setAspectRatioValue, disabled } = useBoundProp(
|
|
2578
|
+
const { value: aspectRatioValue, setValue: setAspectRatioValue, disabled } = useBoundProp(stringPropTypeUtil7);
|
|
2373
2579
|
const isCustomSelected = aspectRatioValue && !RATIO_OPTIONS.some((option) => option.value === aspectRatioValue);
|
|
2374
2580
|
const [initialWidth, initialHeight] = isCustomSelected ? aspectRatioValue.split("/") : ["", ""];
|
|
2375
|
-
const [isCustom, setIsCustom] =
|
|
2376
|
-
const [customWidth, setCustomWidth] =
|
|
2377
|
-
const [customHeight, setCustomHeight] =
|
|
2378
|
-
const [selectedValue, setSelectedValue] =
|
|
2581
|
+
const [isCustom, setIsCustom] = useState8(isCustomSelected);
|
|
2582
|
+
const [customWidth, setCustomWidth] = useState8(initialWidth);
|
|
2583
|
+
const [customHeight, setCustomHeight] = useState8(initialHeight);
|
|
2584
|
+
const [selectedValue, setSelectedValue] = useState8(
|
|
2379
2585
|
isCustomSelected ? CUSTOM_RATIO : aspectRatioValue || ""
|
|
2380
2586
|
);
|
|
2381
2587
|
const handleSelectChange = (event) => {
|
|
@@ -2402,7 +2608,7 @@ var AspectRatioControl = createControl(({ label }) => {
|
|
|
2402
2608
|
setAspectRatioValue(`${customWidth}/${newHeight}`);
|
|
2403
2609
|
}
|
|
2404
2610
|
};
|
|
2405
|
-
return /* @__PURE__ */
|
|
2611
|
+
return /* @__PURE__ */ React40.createElement(ControlActions, null, /* @__PURE__ */ React40.createElement(Stack12, { direction: "column", pt: 2, gap: 2 }, /* @__PURE__ */ React40.createElement(Grid9, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React40.createElement(Grid9, { item: true, xs: 6 }, /* @__PURE__ */ React40.createElement(ControlLabel, null, label)), /* @__PURE__ */ React40.createElement(Grid9, { item: true, xs: 6 }, /* @__PURE__ */ React40.createElement(
|
|
2406
2612
|
Select2,
|
|
2407
2613
|
{
|
|
2408
2614
|
size: "tiny",
|
|
@@ -2414,10 +2620,10 @@ var AspectRatioControl = createControl(({ label }) => {
|
|
|
2414
2620
|
fullWidth: true
|
|
2415
2621
|
},
|
|
2416
2622
|
[...RATIO_OPTIONS, { label: __11("Custom", "elementor"), value: CUSTOM_RATIO }].map(
|
|
2417
|
-
({ label: optionLabel, ...props }) => /* @__PURE__ */
|
|
2623
|
+
({ label: optionLabel, ...props }) => /* @__PURE__ */ React40.createElement(MenuListItem3, { key: props.value, ...props, value: props.value ?? "" }, optionLabel)
|
|
2418
2624
|
)
|
|
2419
|
-
))), isCustom && /* @__PURE__ */
|
|
2420
|
-
|
|
2625
|
+
))), isCustom && /* @__PURE__ */ React40.createElement(Grid9, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React40.createElement(Grid9, { item: true, xs: 6 }, /* @__PURE__ */ React40.createElement(
|
|
2626
|
+
TextField9,
|
|
2421
2627
|
{
|
|
2422
2628
|
size: "tiny",
|
|
2423
2629
|
type: "number",
|
|
@@ -2426,11 +2632,11 @@ var AspectRatioControl = createControl(({ label }) => {
|
|
|
2426
2632
|
value: customWidth,
|
|
2427
2633
|
onChange: handleCustomWidthChange,
|
|
2428
2634
|
InputProps: {
|
|
2429
|
-
startAdornment: /* @__PURE__ */
|
|
2635
|
+
startAdornment: /* @__PURE__ */ React40.createElement(ArrowsMoveHorizontalIcon, { fontSize: "tiny" })
|
|
2430
2636
|
}
|
|
2431
2637
|
}
|
|
2432
|
-
)), /* @__PURE__ */
|
|
2433
|
-
|
|
2638
|
+
)), /* @__PURE__ */ React40.createElement(Grid9, { item: true, xs: 6 }, /* @__PURE__ */ React40.createElement(
|
|
2639
|
+
TextField9,
|
|
2434
2640
|
{
|
|
2435
2641
|
size: "tiny",
|
|
2436
2642
|
type: "number",
|
|
@@ -2439,15 +2645,15 @@ var AspectRatioControl = createControl(({ label }) => {
|
|
|
2439
2645
|
value: customHeight,
|
|
2440
2646
|
onChange: handleCustomHeightChange,
|
|
2441
2647
|
InputProps: {
|
|
2442
|
-
startAdornment: /* @__PURE__ */
|
|
2648
|
+
startAdornment: /* @__PURE__ */ React40.createElement(ArrowsMoveVerticalIcon, { fontSize: "tiny" })
|
|
2443
2649
|
}
|
|
2444
2650
|
}
|
|
2445
2651
|
)))));
|
|
2446
2652
|
});
|
|
2447
2653
|
|
|
2448
2654
|
// src/controls/svg-media-control.tsx
|
|
2449
|
-
import * as
|
|
2450
|
-
import { useState as
|
|
2655
|
+
import * as React42 from "react";
|
|
2656
|
+
import { useState as useState10 } from "react";
|
|
2451
2657
|
import { imageSrcPropTypeUtil as imageSrcPropTypeUtil2 } from "@elementor/editor-props";
|
|
2452
2658
|
import { UploadIcon as UploadIcon2 } from "@elementor/icons";
|
|
2453
2659
|
import { Button as Button4, Card as Card2, CardMedia as CardMedia2, CardOverlay as CardOverlay2, CircularProgress as CircularProgress3, Stack as Stack13, styled as styled5 } from "@elementor/ui";
|
|
@@ -2455,8 +2661,8 @@ import { useWpMediaAttachment as useWpMediaAttachment2, useWpMediaFrame as useWp
|
|
|
2455
2661
|
import { __ as __13 } from "@wordpress/i18n";
|
|
2456
2662
|
|
|
2457
2663
|
// src/components/enable-unfiltered-modal.tsx
|
|
2458
|
-
import * as
|
|
2459
|
-
import { useState as
|
|
2664
|
+
import * as React41 from "react";
|
|
2665
|
+
import { useState as useState9 } from "react";
|
|
2460
2666
|
import { useCurrentUserCapabilities } from "@elementor/editor-current-user";
|
|
2461
2667
|
import {
|
|
2462
2668
|
Button as Button3,
|
|
@@ -2489,7 +2695,7 @@ var WAIT_FOR_CLOSE_TIMEOUT_MS = 300;
|
|
|
2489
2695
|
var EnableUnfilteredModal = (props) => {
|
|
2490
2696
|
const { mutateAsync, isPending } = useUpdateUnfilteredFilesUpload();
|
|
2491
2697
|
const { canUser } = useCurrentUserCapabilities();
|
|
2492
|
-
const [isError, setIsError] =
|
|
2698
|
+
const [isError, setIsError] = useState9(false);
|
|
2493
2699
|
const canManageOptions = canUser("manage_options");
|
|
2494
2700
|
const onClose = (enabled) => {
|
|
2495
2701
|
props.onClose(enabled);
|
|
@@ -2508,9 +2714,9 @@ var EnableUnfilteredModal = (props) => {
|
|
|
2508
2714
|
}
|
|
2509
2715
|
};
|
|
2510
2716
|
const dialogProps = { ...props, isPending, handleEnable, isError, onClose };
|
|
2511
|
-
return canManageOptions ? /* @__PURE__ */
|
|
2717
|
+
return canManageOptions ? /* @__PURE__ */ React41.createElement(AdminDialog, { ...dialogProps }) : /* @__PURE__ */ React41.createElement(NonAdminDialog, { ...dialogProps });
|
|
2512
2718
|
};
|
|
2513
|
-
var AdminDialog = ({ open, onClose, handleEnable, isPending, isError }) => /* @__PURE__ */
|
|
2719
|
+
var AdminDialog = ({ open, onClose, handleEnable, isPending, isError }) => /* @__PURE__ */ React41.createElement(Dialog, { open, maxWidth: "sm", onClose: () => onClose(false) }, /* @__PURE__ */ React41.createElement(DialogHeader, { logo: false }, /* @__PURE__ */ React41.createElement(DialogTitle, null, ADMIN_TITLE_TEXT)), /* @__PURE__ */ React41.createElement(Divider3, null), /* @__PURE__ */ React41.createElement(DialogContent, null, /* @__PURE__ */ React41.createElement(DialogContentText, null, isError ? /* @__PURE__ */ React41.createElement(React41.Fragment, null, ADMIN_FAILED_CONTENT_TEXT_PT1, " ", /* @__PURE__ */ React41.createElement("br", null), " ", ADMIN_FAILED_CONTENT_TEXT_PT2) : ADMIN_CONTENT_TEXT)), /* @__PURE__ */ React41.createElement(DialogActions, null, /* @__PURE__ */ React41.createElement(Button3, { size: "medium", color: "secondary", onClick: () => onClose(false) }, __12("Cancel", "elementor")), /* @__PURE__ */ React41.createElement(
|
|
2514
2720
|
Button3,
|
|
2515
2721
|
{
|
|
2516
2722
|
size: "medium",
|
|
@@ -2519,9 +2725,9 @@ var AdminDialog = ({ open, onClose, handleEnable, isPending, isError }) => /* @_
|
|
|
2519
2725
|
color: "primary",
|
|
2520
2726
|
disabled: isPending
|
|
2521
2727
|
},
|
|
2522
|
-
isPending ? /* @__PURE__ */
|
|
2728
|
+
isPending ? /* @__PURE__ */ React41.createElement(CircularProgress2, { size: 24 }) : __12("Enable", "elementor")
|
|
2523
2729
|
)));
|
|
2524
|
-
var NonAdminDialog = ({ open, onClose }) => /* @__PURE__ */
|
|
2730
|
+
var NonAdminDialog = ({ open, onClose }) => /* @__PURE__ */ React41.createElement(Dialog, { open, maxWidth: "sm", onClose: () => onClose(false) }, /* @__PURE__ */ React41.createElement(DialogHeader, { logo: false }, /* @__PURE__ */ React41.createElement(DialogTitle, null, NON_ADMIN_TITLE_TEXT)), /* @__PURE__ */ React41.createElement(Divider3, null), /* @__PURE__ */ React41.createElement(DialogContent, null, /* @__PURE__ */ React41.createElement(DialogContentText, null, NON_ADMIN_CONTENT_TEXT)), /* @__PURE__ */ React41.createElement(DialogActions, null, /* @__PURE__ */ React41.createElement(Button3, { size: "medium", onClick: () => onClose(false), variant: "contained", color: "primary" }, __12("Got it", "elementor"))));
|
|
2525
2731
|
|
|
2526
2732
|
// src/controls/svg-media-control.tsx
|
|
2527
2733
|
var TILE_SIZE = 8;
|
|
@@ -2554,7 +2760,7 @@ var SvgMediaControl = createControl(() => {
|
|
|
2554
2760
|
const { data: attachment, isFetching } = useWpMediaAttachment2(id?.value || null);
|
|
2555
2761
|
const src = attachment?.url ?? url?.value ?? null;
|
|
2556
2762
|
const { data: allowSvgUpload } = useUnfilteredFilesUpload();
|
|
2557
|
-
const [unfilteredModalOpenState, setUnfilteredModalOpenState] =
|
|
2763
|
+
const [unfilteredModalOpenState, setUnfilteredModalOpenState] = useState10(false);
|
|
2558
2764
|
const { open } = useWpMediaFrame2({
|
|
2559
2765
|
mediaTypes: ["svg"],
|
|
2560
2766
|
multiple: false,
|
|
@@ -2582,7 +2788,7 @@ var SvgMediaControl = createControl(() => {
|
|
|
2582
2788
|
open(openOptions);
|
|
2583
2789
|
}
|
|
2584
2790
|
};
|
|
2585
|
-
return /* @__PURE__ */
|
|
2791
|
+
return /* @__PURE__ */ React42.createElement(Stack13, { gap: 1 }, /* @__PURE__ */ React42.createElement(EnableUnfilteredModal, { open: unfilteredModalOpenState, onClose: onCloseUnfilteredModal }), /* @__PURE__ */ React42.createElement(ControlFormLabel, null, " ", __13("SVG", "elementor"), " "), /* @__PURE__ */ React42.createElement(ControlActions, null, /* @__PURE__ */ React42.createElement(StyledCard, { variant: "outlined" }, /* @__PURE__ */ React42.createElement(StyledCardMediaContainer, null, isFetching ? /* @__PURE__ */ React42.createElement(CircularProgress3, { role: "progressbar" }) : /* @__PURE__ */ React42.createElement(
|
|
2586
2792
|
CardMedia2,
|
|
2587
2793
|
{
|
|
2588
2794
|
component: "img",
|
|
@@ -2590,7 +2796,7 @@ var SvgMediaControl = createControl(() => {
|
|
|
2590
2796
|
alt: __13("Preview SVG", "elementor"),
|
|
2591
2797
|
sx: { maxHeight: "140px", width: "50px" }
|
|
2592
2798
|
}
|
|
2593
|
-
)), /* @__PURE__ */
|
|
2799
|
+
)), /* @__PURE__ */ React42.createElement(
|
|
2594
2800
|
CardOverlay2,
|
|
2595
2801
|
{
|
|
2596
2802
|
sx: {
|
|
@@ -2599,7 +2805,7 @@ var SvgMediaControl = createControl(() => {
|
|
|
2599
2805
|
}
|
|
2600
2806
|
}
|
|
2601
2807
|
},
|
|
2602
|
-
/* @__PURE__ */
|
|
2808
|
+
/* @__PURE__ */ React42.createElement(Stack13, { gap: 1 }, /* @__PURE__ */ React42.createElement(
|
|
2603
2809
|
Button4,
|
|
2604
2810
|
{
|
|
2605
2811
|
size: "tiny",
|
|
@@ -2608,13 +2814,13 @@ var SvgMediaControl = createControl(() => {
|
|
|
2608
2814
|
onClick: () => handleClick(MODE_BROWSE)
|
|
2609
2815
|
},
|
|
2610
2816
|
__13("Select SVG", "elementor")
|
|
2611
|
-
), /* @__PURE__ */
|
|
2817
|
+
), /* @__PURE__ */ React42.createElement(
|
|
2612
2818
|
Button4,
|
|
2613
2819
|
{
|
|
2614
2820
|
size: "tiny",
|
|
2615
2821
|
variant: "text",
|
|
2616
2822
|
color: "inherit",
|
|
2617
|
-
startIcon: /* @__PURE__ */
|
|
2823
|
+
startIcon: /* @__PURE__ */ React42.createElement(UploadIcon2, null),
|
|
2618
2824
|
onClick: () => handleClick(MODE_UPLOAD)
|
|
2619
2825
|
},
|
|
2620
2826
|
__13("Upload", "elementor")
|
|
@@ -2623,14 +2829,14 @@ var SvgMediaControl = createControl(() => {
|
|
|
2623
2829
|
});
|
|
2624
2830
|
|
|
2625
2831
|
// src/controls/background-control/background-control.tsx
|
|
2626
|
-
import * as
|
|
2832
|
+
import * as React49 from "react";
|
|
2627
2833
|
import { backgroundPropTypeUtil } from "@elementor/editor-props";
|
|
2628
|
-
import { isExperimentActive as
|
|
2834
|
+
import { isExperimentActive as isExperimentActive4 } from "@elementor/editor-v1-adapters";
|
|
2629
2835
|
import { Grid as Grid15 } from "@elementor/ui";
|
|
2630
2836
|
import { __ as __19 } from "@wordpress/i18n";
|
|
2631
2837
|
|
|
2632
2838
|
// src/controls/background-control/background-overlay/background-overlay-repeater-control.tsx
|
|
2633
|
-
import * as
|
|
2839
|
+
import * as React48 from "react";
|
|
2634
2840
|
import {
|
|
2635
2841
|
backgroundColorOverlayPropTypeUtil as backgroundColorOverlayPropTypeUtil2,
|
|
2636
2842
|
backgroundImageOverlayPropTypeUtil as backgroundImageOverlayPropTypeUtil2,
|
|
@@ -2646,14 +2852,14 @@ import { parseEnv } from "@elementor/env";
|
|
|
2646
2852
|
var { env } = parseEnv("@elementor/editor-controls");
|
|
2647
2853
|
|
|
2648
2854
|
// src/controls/background-control/background-gradient-color-control.tsx
|
|
2649
|
-
import * as
|
|
2855
|
+
import * as React43 from "react";
|
|
2650
2856
|
import {
|
|
2651
2857
|
backgroundGradientOverlayPropTypeUtil,
|
|
2652
2858
|
colorPropTypeUtil as colorPropTypeUtil2,
|
|
2653
2859
|
colorStopPropTypeUtil,
|
|
2654
2860
|
gradientColorStopPropTypeUtil,
|
|
2655
2861
|
numberPropTypeUtil as numberPropTypeUtil3,
|
|
2656
|
-
stringPropTypeUtil as
|
|
2862
|
+
stringPropTypeUtil as stringPropTypeUtil8
|
|
2657
2863
|
} from "@elementor/editor-props";
|
|
2658
2864
|
import { UnstableGradientBox } from "@elementor/ui";
|
|
2659
2865
|
var BackgroundGradientColorControl = createControl(() => {
|
|
@@ -2661,13 +2867,13 @@ var BackgroundGradientColorControl = createControl(() => {
|
|
|
2661
2867
|
const handleChange = (newValue) => {
|
|
2662
2868
|
const transformedValue = createTransformableValue(newValue);
|
|
2663
2869
|
if (transformedValue.positions) {
|
|
2664
|
-
transformedValue.positions =
|
|
2870
|
+
transformedValue.positions = stringPropTypeUtil8.create(newValue.positions.join(" "));
|
|
2665
2871
|
}
|
|
2666
2872
|
setValue(transformedValue);
|
|
2667
2873
|
};
|
|
2668
2874
|
const createTransformableValue = (newValue) => ({
|
|
2669
2875
|
...newValue,
|
|
2670
|
-
type:
|
|
2876
|
+
type: stringPropTypeUtil8.create(newValue.type),
|
|
2671
2877
|
angle: numberPropTypeUtil3.create(newValue.angle),
|
|
2672
2878
|
stops: gradientColorStopPropTypeUtil.create(
|
|
2673
2879
|
newValue.stops.map(
|
|
@@ -2693,7 +2899,7 @@ var BackgroundGradientColorControl = createControl(() => {
|
|
|
2693
2899
|
positions: positions?.value.split(" ")
|
|
2694
2900
|
};
|
|
2695
2901
|
};
|
|
2696
|
-
return /* @__PURE__ */
|
|
2902
|
+
return /* @__PURE__ */ React43.createElement(ControlActions, null, /* @__PURE__ */ React43.createElement(
|
|
2697
2903
|
UnstableGradientBox,
|
|
2698
2904
|
{
|
|
2699
2905
|
sx: { width: "auto", padding: 1.5 },
|
|
@@ -2703,7 +2909,7 @@ var BackgroundGradientColorControl = createControl(() => {
|
|
|
2703
2909
|
));
|
|
2704
2910
|
});
|
|
2705
2911
|
var initialBackgroundGradientOverlay = backgroundGradientOverlayPropTypeUtil.create({
|
|
2706
|
-
type:
|
|
2912
|
+
type: stringPropTypeUtil8.create("linear"),
|
|
2707
2913
|
angle: numberPropTypeUtil3.create(180),
|
|
2708
2914
|
stops: gradientColorStopPropTypeUtil.create([
|
|
2709
2915
|
colorStopPropTypeUtil.create({
|
|
@@ -2718,7 +2924,7 @@ var initialBackgroundGradientOverlay = backgroundGradientOverlayPropTypeUtil.cre
|
|
|
2718
2924
|
});
|
|
2719
2925
|
|
|
2720
2926
|
// src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-attachment.tsx
|
|
2721
|
-
import * as
|
|
2927
|
+
import * as React44 from "react";
|
|
2722
2928
|
import { PinIcon, PinnedOffIcon } from "@elementor/icons";
|
|
2723
2929
|
import { Grid as Grid10 } from "@elementor/ui";
|
|
2724
2930
|
import { __ as __14 } from "@wordpress/i18n";
|
|
@@ -2726,23 +2932,24 @@ var attachmentControlOptions = [
|
|
|
2726
2932
|
{
|
|
2727
2933
|
value: "fixed",
|
|
2728
2934
|
label: __14("Fixed", "elementor"),
|
|
2729
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2935
|
+
renderContent: ({ size }) => /* @__PURE__ */ React44.createElement(PinIcon, { fontSize: size }),
|
|
2730
2936
|
showTooltip: true
|
|
2731
2937
|
},
|
|
2732
2938
|
{
|
|
2733
2939
|
value: "scroll",
|
|
2734
2940
|
label: __14("Scroll", "elementor"),
|
|
2735
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2941
|
+
renderContent: ({ size }) => /* @__PURE__ */ React44.createElement(PinnedOffIcon, { fontSize: size }),
|
|
2736
2942
|
showTooltip: true
|
|
2737
2943
|
}
|
|
2738
2944
|
];
|
|
2739
2945
|
var BackgroundImageOverlayAttachment = () => {
|
|
2740
|
-
return /* @__PURE__ */
|
|
2946
|
+
return /* @__PURE__ */ React44.createElement(PopoverGridContainer, null, /* @__PURE__ */ React44.createElement(Grid10, { item: true, xs: 6 }, /* @__PURE__ */ React44.createElement(ControlFormLabel, null, __14("Attachment", "elementor"))), /* @__PURE__ */ React44.createElement(Grid10, { item: true, xs: 6, sx: { display: "flex", justifyContent: "flex-end", overflow: "hidden" } }, /* @__PURE__ */ React44.createElement(ToggleControl, { options: attachmentControlOptions })));
|
|
2741
2947
|
};
|
|
2742
2948
|
|
|
2743
2949
|
// src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-position.tsx
|
|
2744
|
-
import * as
|
|
2745
|
-
import {
|
|
2950
|
+
import * as React45 from "react";
|
|
2951
|
+
import { useRef as useRef9 } from "react";
|
|
2952
|
+
import { backgroundImagePositionOffsetPropTypeUtil, stringPropTypeUtil as stringPropTypeUtil9 } from "@elementor/editor-props";
|
|
2746
2953
|
import { MenuListItem as MenuListItem4 } from "@elementor/editor-ui";
|
|
2747
2954
|
import { LetterXIcon, LetterYIcon } from "@elementor/icons";
|
|
2748
2955
|
import { Grid as Grid11, Select as Select3 } from "@elementor/ui";
|
|
@@ -2761,8 +2968,9 @@ var backgroundPositionOptions = [
|
|
|
2761
2968
|
];
|
|
2762
2969
|
var BackgroundImageOverlayPosition = () => {
|
|
2763
2970
|
const backgroundImageOffsetContext = useBoundProp(backgroundImagePositionOffsetPropTypeUtil);
|
|
2764
|
-
const stringPropContext = useBoundProp(
|
|
2971
|
+
const stringPropContext = useBoundProp(stringPropTypeUtil9);
|
|
2765
2972
|
const isCustom = !!backgroundImageOffsetContext.value;
|
|
2973
|
+
const rowRef = useRef9();
|
|
2766
2974
|
const handlePositionChange = (event) => {
|
|
2767
2975
|
const value = event.target.value || null;
|
|
2768
2976
|
if (value === "custom") {
|
|
@@ -2771,7 +2979,7 @@ var BackgroundImageOverlayPosition = () => {
|
|
|
2771
2979
|
stringPropContext.setValue(value);
|
|
2772
2980
|
}
|
|
2773
2981
|
};
|
|
2774
|
-
return /* @__PURE__ */
|
|
2982
|
+
return /* @__PURE__ */ React45.createElement(Grid11, { container: true, spacing: 1.5 }, /* @__PURE__ */ React45.createElement(Grid11, { item: true, xs: 12 }, /* @__PURE__ */ React45.createElement(PopoverGridContainer, null, /* @__PURE__ */ React45.createElement(Grid11, { item: true, xs: 6 }, /* @__PURE__ */ React45.createElement(ControlFormLabel, null, __15("Position", "elementor"))), /* @__PURE__ */ React45.createElement(Grid11, { item: true, xs: 6, sx: { display: "flex", justifyContent: "flex-end", overflow: "hidden" } }, /* @__PURE__ */ React45.createElement(
|
|
2775
2983
|
Select3,
|
|
2776
2984
|
{
|
|
2777
2985
|
fullWidth: true,
|
|
@@ -2780,12 +2988,24 @@ var BackgroundImageOverlayPosition = () => {
|
|
|
2780
2988
|
disabled: stringPropContext.disabled,
|
|
2781
2989
|
value: (backgroundImageOffsetContext.value ? "custom" : stringPropContext.value) ?? ""
|
|
2782
2990
|
},
|
|
2783
|
-
backgroundPositionOptions.map(({ label, value }) => /* @__PURE__ */
|
|
2784
|
-
)))), isCustom ? /* @__PURE__ */
|
|
2991
|
+
backgroundPositionOptions.map(({ label, value }) => /* @__PURE__ */ React45.createElement(MenuListItem4, { key: value, value: value ?? "" }, label))
|
|
2992
|
+
)))), isCustom ? /* @__PURE__ */ React45.createElement(PropProvider, { ...backgroundImageOffsetContext }, /* @__PURE__ */ React45.createElement(Grid11, { item: true, xs: 12 }, /* @__PURE__ */ React45.createElement(Grid11, { container: true, spacing: 1.5, ref: rowRef }, /* @__PURE__ */ React45.createElement(Grid11, { item: true, xs: 6 }, /* @__PURE__ */ React45.createElement(PropKeyProvider, { bind: "x" }, /* @__PURE__ */ React45.createElement(
|
|
2993
|
+
SizeControl,
|
|
2994
|
+
{
|
|
2995
|
+
startIcon: /* @__PURE__ */ React45.createElement(LetterXIcon, { fontSize: "tiny" }),
|
|
2996
|
+
anchorRef: rowRef
|
|
2997
|
+
}
|
|
2998
|
+
))), /* @__PURE__ */ React45.createElement(Grid11, { item: true, xs: 6 }, /* @__PURE__ */ React45.createElement(PropKeyProvider, { bind: "y" }, /* @__PURE__ */ React45.createElement(
|
|
2999
|
+
SizeControl,
|
|
3000
|
+
{
|
|
3001
|
+
startIcon: /* @__PURE__ */ React45.createElement(LetterYIcon, { fontSize: "tiny" }),
|
|
3002
|
+
anchorRef: rowRef
|
|
3003
|
+
}
|
|
3004
|
+
)))))) : null);
|
|
2785
3005
|
};
|
|
2786
3006
|
|
|
2787
3007
|
// src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-repeat.tsx
|
|
2788
|
-
import * as
|
|
3008
|
+
import * as React46 from "react";
|
|
2789
3009
|
import { DotsHorizontalIcon, DotsVerticalIcon, GridDotsIcon, XIcon as XIcon3 } from "@elementor/icons";
|
|
2790
3010
|
import { Grid as Grid12 } from "@elementor/ui";
|
|
2791
3011
|
import { __ as __16 } from "@wordpress/i18n";
|
|
@@ -2793,42 +3013,43 @@ var repeatControlOptions = [
|
|
|
2793
3013
|
{
|
|
2794
3014
|
value: "repeat",
|
|
2795
3015
|
label: __16("Repeat", "elementor"),
|
|
2796
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
3016
|
+
renderContent: ({ size }) => /* @__PURE__ */ React46.createElement(GridDotsIcon, { fontSize: size }),
|
|
2797
3017
|
showTooltip: true
|
|
2798
3018
|
},
|
|
2799
3019
|
{
|
|
2800
3020
|
value: "repeat-x",
|
|
2801
3021
|
label: __16("Repeat-x", "elementor"),
|
|
2802
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
3022
|
+
renderContent: ({ size }) => /* @__PURE__ */ React46.createElement(DotsHorizontalIcon, { fontSize: size }),
|
|
2803
3023
|
showTooltip: true
|
|
2804
3024
|
},
|
|
2805
3025
|
{
|
|
2806
3026
|
value: "repeat-y",
|
|
2807
3027
|
label: __16("Repeat-y", "elementor"),
|
|
2808
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
3028
|
+
renderContent: ({ size }) => /* @__PURE__ */ React46.createElement(DotsVerticalIcon, { fontSize: size }),
|
|
2809
3029
|
showTooltip: true
|
|
2810
3030
|
},
|
|
2811
3031
|
{
|
|
2812
3032
|
value: "no-repeat",
|
|
2813
3033
|
label: __16("No-repeat", "elementor"),
|
|
2814
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
3034
|
+
renderContent: ({ size }) => /* @__PURE__ */ React46.createElement(XIcon3, { fontSize: size }),
|
|
2815
3035
|
showTooltip: true
|
|
2816
3036
|
}
|
|
2817
3037
|
];
|
|
2818
3038
|
var BackgroundImageOverlayRepeat = () => {
|
|
2819
|
-
return /* @__PURE__ */
|
|
3039
|
+
return /* @__PURE__ */ React46.createElement(PopoverGridContainer, null, /* @__PURE__ */ React46.createElement(Grid12, { item: true, xs: 6 }, /* @__PURE__ */ React46.createElement(ControlFormLabel, null, __16("Repeat", "elementor"))), /* @__PURE__ */ React46.createElement(Grid12, { item: true, xs: 6, sx: { display: "flex", justifyContent: "flex-end" } }, /* @__PURE__ */ React46.createElement(ToggleControl, { options: repeatControlOptions })));
|
|
2820
3040
|
};
|
|
2821
3041
|
|
|
2822
3042
|
// src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-size.tsx
|
|
2823
|
-
import * as
|
|
2824
|
-
import {
|
|
3043
|
+
import * as React47 from "react";
|
|
3044
|
+
import { useRef as useRef10 } from "react";
|
|
3045
|
+
import { backgroundImageSizeScalePropTypeUtil, stringPropTypeUtil as stringPropTypeUtil10 } from "@elementor/editor-props";
|
|
2825
3046
|
import {
|
|
2826
3047
|
ArrowBarBothIcon,
|
|
2827
3048
|
ArrowsMaximizeIcon,
|
|
2828
3049
|
ArrowsMoveHorizontalIcon as ArrowsMoveHorizontalIcon2,
|
|
2829
3050
|
ArrowsMoveVerticalIcon as ArrowsMoveVerticalIcon2,
|
|
2830
3051
|
LetterAIcon,
|
|
2831
|
-
PencilIcon
|
|
3052
|
+
PencilIcon as PencilIcon2
|
|
2832
3053
|
} from "@elementor/icons";
|
|
2833
3054
|
import { Grid as Grid13 } from "@elementor/ui";
|
|
2834
3055
|
import { __ as __17 } from "@wordpress/i18n";
|
|
@@ -2836,32 +3057,33 @@ var sizeControlOptions = [
|
|
|
2836
3057
|
{
|
|
2837
3058
|
value: "auto",
|
|
2838
3059
|
label: __17("Auto", "elementor"),
|
|
2839
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
3060
|
+
renderContent: ({ size }) => /* @__PURE__ */ React47.createElement(LetterAIcon, { fontSize: size }),
|
|
2840
3061
|
showTooltip: true
|
|
2841
3062
|
},
|
|
2842
3063
|
{
|
|
2843
3064
|
value: "cover",
|
|
2844
3065
|
label: __17("Cover", "elementor"),
|
|
2845
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
3066
|
+
renderContent: ({ size }) => /* @__PURE__ */ React47.createElement(ArrowsMaximizeIcon, { fontSize: size }),
|
|
2846
3067
|
showTooltip: true
|
|
2847
3068
|
},
|
|
2848
3069
|
{
|
|
2849
3070
|
value: "contain",
|
|
2850
3071
|
label: __17("Contain", "elementor"),
|
|
2851
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
3072
|
+
renderContent: ({ size }) => /* @__PURE__ */ React47.createElement(ArrowBarBothIcon, { fontSize: size }),
|
|
2852
3073
|
showTooltip: true
|
|
2853
3074
|
},
|
|
2854
3075
|
{
|
|
2855
3076
|
value: "custom",
|
|
2856
3077
|
label: __17("Custom", "elementor"),
|
|
2857
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
3078
|
+
renderContent: ({ size }) => /* @__PURE__ */ React47.createElement(PencilIcon2, { fontSize: size }),
|
|
2858
3079
|
showTooltip: true
|
|
2859
3080
|
}
|
|
2860
3081
|
];
|
|
2861
3082
|
var BackgroundImageOverlaySize = () => {
|
|
2862
3083
|
const backgroundImageScaleContext = useBoundProp(backgroundImageSizeScalePropTypeUtil);
|
|
2863
|
-
const stringPropContext = useBoundProp(
|
|
3084
|
+
const stringPropContext = useBoundProp(stringPropTypeUtil10);
|
|
2864
3085
|
const isCustom = !!backgroundImageScaleContext.value;
|
|
3086
|
+
const rowRef = useRef10();
|
|
2865
3087
|
const handleSizeChange = (size) => {
|
|
2866
3088
|
if (size === "custom") {
|
|
2867
3089
|
backgroundImageScaleContext.setValue({ width: null, height: null });
|
|
@@ -2869,7 +3091,7 @@ var BackgroundImageOverlaySize = () => {
|
|
|
2869
3091
|
stringPropContext.setValue(size);
|
|
2870
3092
|
}
|
|
2871
3093
|
};
|
|
2872
|
-
return /* @__PURE__ */
|
|
3094
|
+
return /* @__PURE__ */ React47.createElement(Grid13, { container: true, spacing: 1.5 }, /* @__PURE__ */ React47.createElement(Grid13, { item: true, xs: 12 }, /* @__PURE__ */ React47.createElement(PopoverGridContainer, null, /* @__PURE__ */ React47.createElement(Grid13, { item: true, xs: 6 }, /* @__PURE__ */ React47.createElement(ControlFormLabel, null, __17("Size", "elementor"))), /* @__PURE__ */ React47.createElement(Grid13, { item: true, xs: 6, sx: { display: "flex", justifyContent: "flex-end" } }, /* @__PURE__ */ React47.createElement(
|
|
2873
3095
|
ControlToggleButtonGroup,
|
|
2874
3096
|
{
|
|
2875
3097
|
exclusive: true,
|
|
@@ -2878,23 +3100,25 @@ var BackgroundImageOverlaySize = () => {
|
|
|
2878
3100
|
disabled: stringPropContext.disabled,
|
|
2879
3101
|
value: backgroundImageScaleContext.value ? "custom" : stringPropContext.value
|
|
2880
3102
|
}
|
|
2881
|
-
)))), isCustom ? /* @__PURE__ */
|
|
3103
|
+
)))), isCustom ? /* @__PURE__ */ React47.createElement(PropProvider, { ...backgroundImageScaleContext }, /* @__PURE__ */ React47.createElement(Grid13, { item: true, xs: 12, ref: rowRef }, /* @__PURE__ */ React47.createElement(PopoverGridContainer, null, /* @__PURE__ */ React47.createElement(Grid13, { item: true, xs: 6 }, /* @__PURE__ */ React47.createElement(PropKeyProvider, { bind: "width" }, /* @__PURE__ */ React47.createElement(
|
|
2882
3104
|
SizeControl,
|
|
2883
3105
|
{
|
|
2884
|
-
startIcon: /* @__PURE__ */
|
|
2885
|
-
|
|
3106
|
+
startIcon: /* @__PURE__ */ React47.createElement(ArrowsMoveHorizontalIcon2, { fontSize: "tiny" }),
|
|
3107
|
+
extendedOptions: ["auto"],
|
|
3108
|
+
anchorRef: rowRef
|
|
2886
3109
|
}
|
|
2887
|
-
))), /* @__PURE__ */
|
|
3110
|
+
))), /* @__PURE__ */ React47.createElement(Grid13, { item: true, xs: 6 }, /* @__PURE__ */ React47.createElement(PropKeyProvider, { bind: "height" }, /* @__PURE__ */ React47.createElement(
|
|
2888
3111
|
SizeControl,
|
|
2889
3112
|
{
|
|
2890
|
-
startIcon: /* @__PURE__ */
|
|
2891
|
-
|
|
3113
|
+
startIcon: /* @__PURE__ */ React47.createElement(ArrowsMoveVerticalIcon2, { fontSize: "tiny" }),
|
|
3114
|
+
extendedOptions: ["auto"],
|
|
3115
|
+
anchorRef: rowRef
|
|
2892
3116
|
}
|
|
2893
3117
|
)))))) : null);
|
|
2894
3118
|
};
|
|
2895
3119
|
|
|
2896
3120
|
// src/controls/background-control/background-overlay/use-background-tabs-history.ts
|
|
2897
|
-
import { useRef as
|
|
3121
|
+
import { useRef as useRef11 } from "react";
|
|
2898
3122
|
import {
|
|
2899
3123
|
backgroundColorOverlayPropTypeUtil,
|
|
2900
3124
|
backgroundGradientOverlayPropTypeUtil as backgroundGradientOverlayPropTypeUtil2,
|
|
@@ -2919,7 +3143,7 @@ var useBackgroundTabsHistory = ({
|
|
|
2919
3143
|
return "image";
|
|
2920
3144
|
};
|
|
2921
3145
|
const { getTabsProps, getTabProps, getTabPanelProps } = useTabs(getCurrentOverlayType());
|
|
2922
|
-
const valuesHistory =
|
|
3146
|
+
const valuesHistory = useRef11({
|
|
2923
3147
|
image: initialBackgroundImageOverlay,
|
|
2924
3148
|
color: initialBackgroundColorOverlay2,
|
|
2925
3149
|
gradient: initialBackgroundGradientOverlay2
|
|
@@ -2994,7 +3218,7 @@ var backgroundResolutionOptions = [
|
|
|
2994
3218
|
];
|
|
2995
3219
|
var BackgroundOverlayRepeaterControl = createControl(() => {
|
|
2996
3220
|
const { propType, value: overlayValues, setValue, disabled } = useBoundProp(backgroundOverlayPropTypeUtil);
|
|
2997
|
-
return /* @__PURE__ */
|
|
3221
|
+
return /* @__PURE__ */ React48.createElement(PropProvider, { propType, value: overlayValues, setValue, disabled }, /* @__PURE__ */ React48.createElement(
|
|
2998
3222
|
Repeater,
|
|
2999
3223
|
{
|
|
3000
3224
|
openOnAdd: true,
|
|
@@ -3012,7 +3236,7 @@ var BackgroundOverlayRepeaterControl = createControl(() => {
|
|
|
3012
3236
|
));
|
|
3013
3237
|
});
|
|
3014
3238
|
var ItemContent2 = ({ anchorEl = null, bind }) => {
|
|
3015
|
-
return /* @__PURE__ */
|
|
3239
|
+
return /* @__PURE__ */ React48.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React48.createElement(Content2, { anchorEl }));
|
|
3016
3240
|
};
|
|
3017
3241
|
var Content2 = ({ anchorEl }) => {
|
|
3018
3242
|
const { getTabsProps, getTabProps, getTabPanelProps } = useBackgroundTabsHistory({
|
|
@@ -3020,7 +3244,7 @@ var Content2 = ({ anchorEl }) => {
|
|
|
3020
3244
|
color: initialBackgroundColorOverlay.value,
|
|
3021
3245
|
gradient: initialBackgroundGradientOverlay.value
|
|
3022
3246
|
});
|
|
3023
|
-
return /* @__PURE__ */
|
|
3247
|
+
return /* @__PURE__ */ React48.createElement(Box6, { sx: { width: "100%" } }, /* @__PURE__ */ React48.createElement(Box6, { sx: { borderBottom: 1, borderColor: "divider" } }, /* @__PURE__ */ React48.createElement(
|
|
3024
3248
|
Tabs,
|
|
3025
3249
|
{
|
|
3026
3250
|
size: "small",
|
|
@@ -3028,19 +3252,19 @@ var Content2 = ({ anchorEl }) => {
|
|
|
3028
3252
|
...getTabsProps(),
|
|
3029
3253
|
"aria-label": __18("Background Overlay", "elementor")
|
|
3030
3254
|
},
|
|
3031
|
-
/* @__PURE__ */
|
|
3032
|
-
/* @__PURE__ */
|
|
3033
|
-
/* @__PURE__ */
|
|
3034
|
-
)), /* @__PURE__ */
|
|
3255
|
+
/* @__PURE__ */ React48.createElement(Tab, { label: __18("Image", "elementor"), ...getTabProps("image") }),
|
|
3256
|
+
/* @__PURE__ */ React48.createElement(Tab, { label: __18("Gradient", "elementor"), ...getTabProps("gradient") }),
|
|
3257
|
+
/* @__PURE__ */ React48.createElement(Tab, { label: __18("Color", "elementor"), ...getTabProps("color") })
|
|
3258
|
+
)), /* @__PURE__ */ React48.createElement(TabPanel, { sx: { p: 1.5 }, ...getTabPanelProps("image") }, /* @__PURE__ */ React48.createElement(PopoverContent, null, /* @__PURE__ */ React48.createElement(ImageOverlayContent, null))), /* @__PURE__ */ React48.createElement(TabPanel, { sx: { p: 1.5 }, ...getTabPanelProps("gradient") }, /* @__PURE__ */ React48.createElement(BackgroundGradientColorControl, null)), /* @__PURE__ */ React48.createElement(TabPanel, { sx: { p: 1.5 }, ...getTabPanelProps("color") }, /* @__PURE__ */ React48.createElement(PopoverContent, null, /* @__PURE__ */ React48.createElement(ColorOverlayContent, { anchorEl }))));
|
|
3035
3259
|
};
|
|
3036
3260
|
var ItemIcon2 = ({ value }) => {
|
|
3037
3261
|
switch (value.$$type) {
|
|
3038
3262
|
case "background-image-overlay":
|
|
3039
|
-
return /* @__PURE__ */
|
|
3263
|
+
return /* @__PURE__ */ React48.createElement(ItemIconImage, { value });
|
|
3040
3264
|
case "background-color-overlay":
|
|
3041
|
-
return /* @__PURE__ */
|
|
3265
|
+
return /* @__PURE__ */ React48.createElement(ItemIconColor, { value });
|
|
3042
3266
|
case "background-gradient-overlay":
|
|
3043
|
-
return /* @__PURE__ */
|
|
3267
|
+
return /* @__PURE__ */ React48.createElement(ItemIconGradient, { value });
|
|
3044
3268
|
default:
|
|
3045
3269
|
return null;
|
|
3046
3270
|
}
|
|
@@ -3053,11 +3277,11 @@ var extractColorFrom = (prop) => {
|
|
|
3053
3277
|
};
|
|
3054
3278
|
var ItemIconColor = ({ value: prop }) => {
|
|
3055
3279
|
const color = extractColorFrom(prop);
|
|
3056
|
-
return /* @__PURE__ */
|
|
3280
|
+
return /* @__PURE__ */ React48.createElement(StyledUnstableColorIndicator, { size: "inherit", component: "span", value: color });
|
|
3057
3281
|
};
|
|
3058
3282
|
var ItemIconImage = ({ value }) => {
|
|
3059
3283
|
const { imageUrl } = useImage(value);
|
|
3060
|
-
return /* @__PURE__ */
|
|
3284
|
+
return /* @__PURE__ */ React48.createElement(
|
|
3061
3285
|
CardMedia3,
|
|
3062
3286
|
{
|
|
3063
3287
|
image: imageUrl,
|
|
@@ -3072,47 +3296,47 @@ var ItemIconImage = ({ value }) => {
|
|
|
3072
3296
|
};
|
|
3073
3297
|
var ItemIconGradient = ({ value }) => {
|
|
3074
3298
|
const gradient = getGradientValue(value);
|
|
3075
|
-
return /* @__PURE__ */
|
|
3299
|
+
return /* @__PURE__ */ React48.createElement(StyledUnstableColorIndicator, { size: "inherit", component: "span", value: gradient });
|
|
3076
3300
|
};
|
|
3077
3301
|
var ItemLabel2 = ({ value }) => {
|
|
3078
3302
|
switch (value.$$type) {
|
|
3079
3303
|
case "background-image-overlay":
|
|
3080
|
-
return /* @__PURE__ */
|
|
3304
|
+
return /* @__PURE__ */ React48.createElement(ItemLabelImage, { value });
|
|
3081
3305
|
case "background-color-overlay":
|
|
3082
|
-
return /* @__PURE__ */
|
|
3306
|
+
return /* @__PURE__ */ React48.createElement(ItemLabelColor, { value });
|
|
3083
3307
|
case "background-gradient-overlay":
|
|
3084
|
-
return /* @__PURE__ */
|
|
3308
|
+
return /* @__PURE__ */ React48.createElement(ItemLabelGradient, { value });
|
|
3085
3309
|
default:
|
|
3086
3310
|
return null;
|
|
3087
3311
|
}
|
|
3088
3312
|
};
|
|
3089
3313
|
var ItemLabelColor = ({ value: prop }) => {
|
|
3090
3314
|
const color = extractColorFrom(prop);
|
|
3091
|
-
return /* @__PURE__ */
|
|
3315
|
+
return /* @__PURE__ */ React48.createElement("span", null, color);
|
|
3092
3316
|
};
|
|
3093
3317
|
var ItemLabelImage = ({ value }) => {
|
|
3094
3318
|
const { imageTitle } = useImage(value);
|
|
3095
|
-
return /* @__PURE__ */
|
|
3319
|
+
return /* @__PURE__ */ React48.createElement("span", null, imageTitle);
|
|
3096
3320
|
};
|
|
3097
3321
|
var ItemLabelGradient = ({ value }) => {
|
|
3098
3322
|
if (value.value.type.value === "linear") {
|
|
3099
|
-
return /* @__PURE__ */
|
|
3323
|
+
return /* @__PURE__ */ React48.createElement("span", null, __18("Linear Gradient", "elementor"));
|
|
3100
3324
|
}
|
|
3101
|
-
return /* @__PURE__ */
|
|
3325
|
+
return /* @__PURE__ */ React48.createElement("span", null, __18("Radial Gradient", "elementor"));
|
|
3102
3326
|
};
|
|
3103
3327
|
var ColorOverlayContent = ({ anchorEl }) => {
|
|
3104
3328
|
const propContext = useBoundProp(backgroundColorOverlayPropTypeUtil2);
|
|
3105
|
-
return /* @__PURE__ */
|
|
3329
|
+
return /* @__PURE__ */ React48.createElement(PropProvider, { ...propContext }, /* @__PURE__ */ React48.createElement(PropKeyProvider, { bind: "color" }, /* @__PURE__ */ React48.createElement(ColorControl, { anchorEl })));
|
|
3106
3330
|
};
|
|
3107
3331
|
var ImageOverlayContent = () => {
|
|
3108
3332
|
const propContext = useBoundProp(backgroundImageOverlayPropTypeUtil2);
|
|
3109
|
-
return /* @__PURE__ */
|
|
3333
|
+
return /* @__PURE__ */ React48.createElement(PropProvider, { ...propContext }, /* @__PURE__ */ React48.createElement(PropKeyProvider, { bind: "image" }, /* @__PURE__ */ React48.createElement(Grid14, { container: true, spacing: 1, alignItems: "center" }, /* @__PURE__ */ React48.createElement(Grid14, { item: true, xs: 12 }, /* @__PURE__ */ React48.createElement(
|
|
3110
3334
|
ImageControl,
|
|
3111
3335
|
{
|
|
3112
3336
|
resolutionLabel: __18("Resolution", "elementor"),
|
|
3113
3337
|
sizes: backgroundResolutionOptions
|
|
3114
3338
|
}
|
|
3115
|
-
)))), /* @__PURE__ */
|
|
3339
|
+
)))), /* @__PURE__ */ React48.createElement(PropKeyProvider, { bind: "position" }, /* @__PURE__ */ React48.createElement(BackgroundImageOverlayPosition, null)), /* @__PURE__ */ React48.createElement(PropKeyProvider, { bind: "repeat" }, /* @__PURE__ */ React48.createElement(BackgroundImageOverlayRepeat, null)), /* @__PURE__ */ React48.createElement(PropKeyProvider, { bind: "size" }, /* @__PURE__ */ React48.createElement(BackgroundImageOverlaySize, null)), /* @__PURE__ */ React48.createElement(PropKeyProvider, { bind: "attachment" }, /* @__PURE__ */ React48.createElement(BackgroundImageOverlayAttachment, null)));
|
|
3116
3340
|
};
|
|
3117
3341
|
var StyledUnstableColorIndicator = styled6(UnstableColorIndicator2)(({ theme }) => ({
|
|
3118
3342
|
borderRadius: `${theme.shape.borderRadius / 2}px`
|
|
@@ -3150,13 +3374,13 @@ var getGradientValue = (value) => {
|
|
|
3150
3374
|
// src/controls/background-control/background-control.tsx
|
|
3151
3375
|
var BackgroundControl = createControl(() => {
|
|
3152
3376
|
const propContext = useBoundProp(backgroundPropTypeUtil);
|
|
3153
|
-
const isUsingNestedProps =
|
|
3377
|
+
const isUsingNestedProps = isExperimentActive4("e_v_3_30");
|
|
3154
3378
|
const colorLabel = __19("Color", "elementor");
|
|
3155
|
-
return /* @__PURE__ */
|
|
3379
|
+
return /* @__PURE__ */ React49.createElement(PropProvider, { ...propContext }, /* @__PURE__ */ React49.createElement(PropKeyProvider, { bind: "background-overlay" }, /* @__PURE__ */ React49.createElement(BackgroundOverlayRepeaterControl, null)), /* @__PURE__ */ React49.createElement(PropKeyProvider, { bind: "color" }, /* @__PURE__ */ React49.createElement(Grid15, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React49.createElement(Grid15, { item: true, xs: 6 }, isUsingNestedProps ? /* @__PURE__ */ React49.createElement(ControlLabel, null, colorLabel) : /* @__PURE__ */ React49.createElement(ControlFormLabel, null, colorLabel)), /* @__PURE__ */ React49.createElement(Grid15, { item: true, xs: 6 }, /* @__PURE__ */ React49.createElement(ColorControl, null)))));
|
|
3156
3380
|
});
|
|
3157
3381
|
|
|
3158
3382
|
// src/controls/switch-control.tsx
|
|
3159
|
-
import * as
|
|
3383
|
+
import * as React50 from "react";
|
|
3160
3384
|
import { booleanPropTypeUtil as booleanPropTypeUtil2 } from "@elementor/editor-props";
|
|
3161
3385
|
import { Switch as Switch2 } from "@elementor/ui";
|
|
3162
3386
|
var SwitchControl2 = createControl(() => {
|
|
@@ -3164,7 +3388,7 @@ var SwitchControl2 = createControl(() => {
|
|
|
3164
3388
|
const handleChange = (event) => {
|
|
3165
3389
|
setValue(event.target.checked);
|
|
3166
3390
|
};
|
|
3167
|
-
return /* @__PURE__ */
|
|
3391
|
+
return /* @__PURE__ */ React50.createElement("div", { style: { display: "flex", justifyContent: "flex-end" } }, /* @__PURE__ */ React50.createElement(Switch2, { checked: !!value, onChange: handleChange, size: "small", disabled }));
|
|
3168
3392
|
});
|
|
3169
3393
|
export {
|
|
3170
3394
|
AspectRatioControl,
|