@elementor/editor-controls 0.35.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 +31 -0
- package/dist/index.d.mts +24 -13
- package/dist/index.d.ts +24 -13
- package/dist/index.js +809 -558
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +748 -491
- package/dist/index.mjs.map +1 -1
- package/package.json +5 -4
- package/src/bound-prop-context/use-bound-prop.ts +4 -1
- package/src/components/control-form-label.tsx +3 -3
- package/src/components/control-label.tsx +1 -1
- package/src/components/font-family-selector.tsx +8 -10
- package/src/components/popover-grid-container.tsx +7 -10
- package/src/components/repeater.tsx +2 -4
- 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/sortable.tsx +4 -2
- package/src/components/text-field-popover.tsx +47 -0
- package/src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-position.tsx +14 -5
- package/src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-size.tsx +9 -4
- package/src/controls/background-control/background-overlay/background-overlay-repeater-control.tsx +1 -1
- package/src/controls/box-shadow-repeater-control.tsx +11 -9
- package/src/controls/equal-unequal-sizes-control.tsx +38 -18
- package/src/controls/font-family-control/font-family-control.tsx +3 -1
- package/src/controls/gap-control.tsx +20 -7
- package/src/controls/image-control.tsx +2 -2
- package/src/controls/link-control.tsx +1 -1
- package/src/controls/linked-dimensions-control.tsx +71 -83
- 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 +2 -1
- package/src/utils/size-control.ts +10 -0
package/dist/index.mjs
CHANGED
|
@@ -187,8 +187,8 @@ var resolveUnionPropType = (propType, key) => {
|
|
|
187
187
|
// src/components/control-form-label.tsx
|
|
188
188
|
import * as React3 from "react";
|
|
189
189
|
import { FormLabel } from "@elementor/ui";
|
|
190
|
-
var ControlFormLabel = (
|
|
191
|
-
return /* @__PURE__ */ React3.createElement(FormLabel, { size: "tiny" }
|
|
190
|
+
var ControlFormLabel = (props) => {
|
|
191
|
+
return /* @__PURE__ */ React3.createElement(FormLabel, { size: "tiny", ...props });
|
|
192
192
|
};
|
|
193
193
|
|
|
194
194
|
// src/create-control.tsx
|
|
@@ -393,7 +393,7 @@ var ImageControl = createControl(
|
|
|
393
393
|
const propContext = useBoundProp(imagePropTypeUtil);
|
|
394
394
|
const { data: allowSvgUpload } = useUnfilteredFilesUpload();
|
|
395
395
|
const mediaTypes = allowSvgUpload ? ["image", "svg"] : ["image"];
|
|
396
|
-
return /* @__PURE__ */ React10.createElement(PropProvider, { ...propContext }, /* @__PURE__ */ React10.createElement(Stack2, { gap: 1.5 }, ["all", "media"].includes(showMode) ? /* @__PURE__ */ React10.createElement(PropKeyProvider, { bind: "src" }, /* @__PURE__ */ React10.createElement(ControlFormLabel, null,
|
|
396
|
+
return /* @__PURE__ */ React10.createElement(PropProvider, { ...propContext }, /* @__PURE__ */ React10.createElement(Stack2, { gap: 1.5 }, ["all", "media"].includes(showMode) ? /* @__PURE__ */ React10.createElement(PropKeyProvider, { bind: "src" }, /* @__PURE__ */ React10.createElement(ControlFormLabel, null, __2("Image", "elementor")), /* @__PURE__ */ React10.createElement(ImageMediaControl, { mediaTypes })) : null, ["all", "sizes"].includes(showMode) ? /* @__PURE__ */ React10.createElement(PropKeyProvider, { bind: "size" }, /* @__PURE__ */ React10.createElement(Grid, { container: true, gap: 1.5, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React10.createElement(Grid, { item: true, xs: 6 }, /* @__PURE__ */ React10.createElement(ControlFormLabel, null, resolutionLabel)), /* @__PURE__ */ React10.createElement(Grid, { item: true, xs: 6, sx: { overflow: "hidden" } }, /* @__PURE__ */ React10.createElement(SelectControl, { options: sizes })))) : null));
|
|
397
397
|
}
|
|
398
398
|
);
|
|
399
399
|
|
|
@@ -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
|
+
))));
|
|
515
545
|
};
|
|
516
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
|
+
)));
|
|
625
|
+
};
|
|
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,13 +998,14 @@ 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
|
-
var SortableItem = ({ id, children }) => {
|
|
809
|
-
return /* @__PURE__ */
|
|
1003
|
+
var SortableItem = ({ id, children, disabled }) => {
|
|
1004
|
+
return /* @__PURE__ */ React24.createElement(
|
|
810
1005
|
UnstableSortableItem,
|
|
811
1006
|
{
|
|
812
1007
|
id,
|
|
1008
|
+
disabled,
|
|
813
1009
|
render: ({
|
|
814
1010
|
itemProps,
|
|
815
1011
|
triggerProps,
|
|
@@ -818,7 +1014,7 @@ var SortableItem = ({ id, children }) => {
|
|
|
818
1014
|
showDropIndication,
|
|
819
1015
|
dropIndicationStyle
|
|
820
1016
|
}) => {
|
|
821
|
-
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 }));
|
|
822
1018
|
}
|
|
823
1019
|
}
|
|
824
1020
|
);
|
|
@@ -852,7 +1048,7 @@ var StyledListItem = styled2(ListItem)`
|
|
|
852
1048
|
}
|
|
853
1049
|
}
|
|
854
1050
|
`;
|
|
855
|
-
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" }));
|
|
856
1052
|
var StyledDivider = styled2(Divider)`
|
|
857
1053
|
height: 0px;
|
|
858
1054
|
border: none;
|
|
@@ -882,14 +1078,14 @@ var Repeater = ({
|
|
|
882
1078
|
values: repeaterValues = [],
|
|
883
1079
|
setValues: setRepeaterValues
|
|
884
1080
|
}) => {
|
|
885
|
-
const [openItem, setOpenItem] =
|
|
1081
|
+
const [openItem, setOpenItem] = useState4(EMPTY_OPEN_ITEM);
|
|
886
1082
|
const [items, setItems] = useSyncExternalState({
|
|
887
1083
|
external: repeaterValues,
|
|
888
1084
|
// @ts-expect-error - as long as persistWhen => true, value will never be null
|
|
889
1085
|
setExternal: setRepeaterValues,
|
|
890
1086
|
persistWhen: () => true
|
|
891
1087
|
});
|
|
892
|
-
const [uniqueKeys, setUniqueKeys] =
|
|
1088
|
+
const [uniqueKeys, setUniqueKeys] = useState4(items.map((_, index) => index));
|
|
893
1089
|
const generateNextKey = (source) => {
|
|
894
1090
|
return 1 + Math.max(0, ...source);
|
|
895
1091
|
};
|
|
@@ -946,8 +1142,7 @@ var Repeater = ({
|
|
|
946
1142
|
});
|
|
947
1143
|
});
|
|
948
1144
|
};
|
|
949
|
-
|
|
950
|
-
return /* @__PURE__ */ React23.createElement(SectionContent, null, /* @__PURE__ */ React23.createElement(
|
|
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
|
-
const
|
|
1086
|
-
|
|
1280
|
+
const context = useBoundProp(shadowPropTypeUtil);
|
|
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,15 +1657,15 @@ 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,
|
|
1469
1664
|
setValue: setMultiSizeValue,
|
|
1470
1665
|
disabled: multiSizeDisabled
|
|
1471
1666
|
} = useBoundProp(multiSizePropTypeUtil);
|
|
1472
|
-
const { value: sizeValue, setValue: setSizeValue
|
|
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,8 +1692,15 @@ function EqualUnequalSizesControl({
|
|
|
1496
1692
|
}
|
|
1497
1693
|
return splitEqualValue() ?? null;
|
|
1498
1694
|
};
|
|
1695
|
+
const isShowingGeneralIndicator = !isExperimentActive2("e_v_3_30") || !popupState.isOpen;
|
|
1499
1696
|
const isMixed = !!multiSizeValue;
|
|
1500
|
-
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(
|
|
1501
1704
|
ToggleButton2,
|
|
1502
1705
|
{
|
|
1503
1706
|
size: "tiny",
|
|
@@ -1505,12 +1708,11 @@ function EqualUnequalSizesControl({
|
|
|
1505
1708
|
sx: { marginLeft: "auto" },
|
|
1506
1709
|
...bindToggle(popupState),
|
|
1507
1710
|
selected: popupState.isOpen,
|
|
1508
|
-
"aria-label": tooltipLabel
|
|
1509
|
-
disabled: multiSizeDisabled || sizeDisabled
|
|
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,23 +1724,36 @@ 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(
|
|
1733
|
+
PropProvider,
|
|
1734
|
+
{
|
|
1735
|
+
propType: multiSizePropType,
|
|
1736
|
+
value: getMultiSizeValues(),
|
|
1737
|
+
setValue: setNestedProp,
|
|
1738
|
+
disabled: multiSizeDisabled
|
|
1739
|
+
},
|
|
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] })))
|
|
1741
|
+
)
|
|
1531
1742
|
));
|
|
1532
1743
|
}
|
|
1533
|
-
var MultiSizeValueControl = ({
|
|
1534
|
-
|
|
1535
|
-
|
|
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 })))));
|
|
1536
1750
|
};
|
|
1537
1751
|
|
|
1538
1752
|
// src/controls/linked-dimensions-control.tsx
|
|
1539
|
-
import * as
|
|
1753
|
+
import * as React33 from "react";
|
|
1754
|
+
import { useRef as useRef6 } from "react";
|
|
1540
1755
|
import { dimensionsPropTypeUtil, sizePropTypeUtil as sizePropTypeUtil3 } from "@elementor/editor-props";
|
|
1541
|
-
import { isExperimentActive as
|
|
1756
|
+
import { isExperimentActive as isExperimentActive3 } from "@elementor/editor-v1-adapters";
|
|
1542
1757
|
import { DetachIcon, LinkIcon, SideBottomIcon, SideLeftIcon, SideRightIcon, SideTopIcon } from "@elementor/icons";
|
|
1543
1758
|
import { Grid as Grid6, Stack as Stack8, ToggleButton as ToggleButton3, Tooltip as Tooltip4 } from "@elementor/ui";
|
|
1544
1759
|
import { __ as __7 } from "@wordpress/i18n";
|
|
@@ -1546,9 +1761,10 @@ var LinkedDimensionsControl = createControl(
|
|
|
1546
1761
|
({
|
|
1547
1762
|
label,
|
|
1548
1763
|
isSiteRtl = false,
|
|
1549
|
-
|
|
1764
|
+
extendedOptions
|
|
1550
1765
|
}) => {
|
|
1551
1766
|
const { value: sizeValue, setValue: setSizeValue, disabled: sizeDisabled } = useBoundProp(sizePropTypeUtil3);
|
|
1767
|
+
const gridRowRefs = [useRef6(), useRef6()];
|
|
1552
1768
|
const {
|
|
1553
1769
|
value: dimensionsValue,
|
|
1554
1770
|
setValue: setDimensionsValue,
|
|
@@ -1556,7 +1772,7 @@ var LinkedDimensionsControl = createControl(
|
|
|
1556
1772
|
disabled: dimensionsDisabled
|
|
1557
1773
|
} = useBoundProp(dimensionsPropTypeUtil);
|
|
1558
1774
|
const isLinked = !dimensionsValue && !sizeValue ? true : !!sizeValue;
|
|
1559
|
-
const isUsingNestedProps =
|
|
1775
|
+
const isUsingNestedProps = isExperimentActive3("e_v_3_30");
|
|
1560
1776
|
const onLinkToggle = () => {
|
|
1561
1777
|
if (!isLinked) {
|
|
1562
1778
|
setSizeValue(dimensionsValue["block-start"]?.value ?? null);
|
|
@@ -1574,105 +1790,110 @@ var LinkedDimensionsControl = createControl(
|
|
|
1574
1790
|
const LinkedIcon = isLinked ? LinkIcon : DetachIcon;
|
|
1575
1791
|
const linkedLabel = __7("Link %s", "elementor").replace("%s", tooltipLabel);
|
|
1576
1792
|
const unlinkedLabel = __7("Unlink %s", "elementor").replace("%s", tooltipLabel);
|
|
1577
|
-
|
|
1578
|
-
|
|
1793
|
+
const disabled = sizeDisabled || dimensionsDisabled;
|
|
1794
|
+
return /* @__PURE__ */ React33.createElement(
|
|
1795
|
+
PropProvider,
|
|
1579
1796
|
{
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
sx: { marginLeft: "auto" },
|
|
1585
|
-
onChange: onLinkToggle,
|
|
1586
|
-
disabled: sizeDisabled || dimensionsDisabled
|
|
1797
|
+
propType,
|
|
1798
|
+
value: dimensionsValue,
|
|
1799
|
+
setValue: setDimensionsValue,
|
|
1800
|
+
disabled
|
|
1587
1801
|
},
|
|
1588
|
-
/* @__PURE__ */
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
)
|
|
1612
|
-
Control3,
|
|
1613
|
-
{
|
|
1614
|
-
bind: "block-end",
|
|
1615
|
-
startIcon: /* @__PURE__ */ React31.createElement(SideBottomIcon, { fontSize: "tiny" }),
|
|
1616
|
-
isLinked,
|
|
1617
|
-
extendedValues
|
|
1618
|
-
}
|
|
1619
|
-
))), /* @__PURE__ */ React31.createElement(Grid6, { container: true, gap: 0.75, alignItems: "center" }, /* @__PURE__ */ React31.createElement(Grid6, { item: true, xs: 12 }, /* @__PURE__ */ React31.createElement(
|
|
1620
|
-
Label,
|
|
1621
|
-
{
|
|
1622
|
-
bind: "inline-start",
|
|
1623
|
-
label: isSiteRtl ? __7("Right", "elementor") : __7("Left", "elementor")
|
|
1624
|
-
}
|
|
1625
|
-
)), /* @__PURE__ */ React31.createElement(Grid6, { item: true, xs: 12 }, /* @__PURE__ */ React31.createElement(
|
|
1626
|
-
Control3,
|
|
1627
|
-
{
|
|
1628
|
-
bind: "inline-start",
|
|
1629
|
-
startIcon: isSiteRtl ? /* @__PURE__ */ React31.createElement(SideRightIcon, { fontSize: "tiny" }) : /* @__PURE__ */ React31.createElement(SideLeftIcon, { fontSize: "tiny" }),
|
|
1630
|
-
isLinked,
|
|
1631
|
-
extendedValues
|
|
1632
|
-
}
|
|
1633
|
-
)))));
|
|
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(
|
|
1803
|
+
ToggleButton3,
|
|
1804
|
+
{
|
|
1805
|
+
"aria-label": isLinked ? unlinkedLabel : linkedLabel,
|
|
1806
|
+
size: "tiny",
|
|
1807
|
+
value: "check",
|
|
1808
|
+
selected: isLinked,
|
|
1809
|
+
sx: { marginLeft: "auto" },
|
|
1810
|
+
onChange: onLinkToggle,
|
|
1811
|
+
disabled
|
|
1812
|
+
},
|
|
1813
|
+
/* @__PURE__ */ React33.createElement(LinkedIcon, { fontSize: "tiny" })
|
|
1814
|
+
))),
|
|
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(
|
|
1816
|
+
Control3,
|
|
1817
|
+
{
|
|
1818
|
+
bind: props.bind,
|
|
1819
|
+
startIcon: icon,
|
|
1820
|
+
isLinked,
|
|
1821
|
+
extendedOptions,
|
|
1822
|
+
anchorRef: gridRowRefs[index]
|
|
1823
|
+
}
|
|
1824
|
+
))))))
|
|
1825
|
+
);
|
|
1634
1826
|
}
|
|
1635
1827
|
);
|
|
1636
1828
|
var Control3 = ({
|
|
1637
1829
|
bind,
|
|
1638
1830
|
startIcon,
|
|
1639
1831
|
isLinked,
|
|
1640
|
-
|
|
1832
|
+
extendedOptions,
|
|
1833
|
+
anchorRef
|
|
1641
1834
|
}) => {
|
|
1642
1835
|
if (isLinked) {
|
|
1643
|
-
return /* @__PURE__ */
|
|
1836
|
+
return /* @__PURE__ */ React33.createElement(SizeControl, { startIcon, extendedOptions, anchorRef });
|
|
1644
1837
|
}
|
|
1645
|
-
return /* @__PURE__ */
|
|
1838
|
+
return /* @__PURE__ */ React33.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React33.createElement(SizeControl, { startIcon, extendedOptions, anchorRef }));
|
|
1646
1839
|
};
|
|
1647
1840
|
var Label = ({ label, bind }) => {
|
|
1648
|
-
const isUsingNestedProps =
|
|
1841
|
+
const isUsingNestedProps = isExperimentActive3("e_v_3_30");
|
|
1649
1842
|
if (!isUsingNestedProps) {
|
|
1650
|
-
return /* @__PURE__ */
|
|
1843
|
+
return /* @__PURE__ */ React33.createElement(ControlFormLabel, null, label);
|
|
1651
1844
|
}
|
|
1652
|
-
return /* @__PURE__ */
|
|
1845
|
+
return /* @__PURE__ */ React33.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React33.createElement(ControlLabel, null, label));
|
|
1653
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
|
+
}
|
|
1654
1875
|
|
|
1655
1876
|
// src/controls/font-family-control/font-family-control.tsx
|
|
1656
|
-
import * as
|
|
1657
|
-
import { stringPropTypeUtil as
|
|
1877
|
+
import * as React35 from "react";
|
|
1878
|
+
import { stringPropTypeUtil as stringPropTypeUtil5 } from "@elementor/editor-props";
|
|
1658
1879
|
import { ChevronDownIcon as ChevronDownIcon2 } from "@elementor/icons";
|
|
1659
|
-
import { bindPopover as
|
|
1880
|
+
import { bindPopover as bindPopover4, bindTrigger as bindTrigger3, Popover as Popover4, UnstableTag as UnstableTag2, usePopupState as usePopupState5 } from "@elementor/ui";
|
|
1660
1881
|
|
|
1661
1882
|
// src/components/font-family-selector.tsx
|
|
1662
|
-
import { useEffect as
|
|
1663
|
-
import * as
|
|
1664
|
-
import {
|
|
1883
|
+
import { useEffect as useEffect5, useRef as useRef7, useState as useState6 } from "react";
|
|
1884
|
+
import * as React34 from "react";
|
|
1885
|
+
import { PopoverHeader } from "@elementor/editor-ui";
|
|
1886
|
+
import { SearchIcon, TextIcon } from "@elementor/icons";
|
|
1665
1887
|
import {
|
|
1666
1888
|
Box as Box3,
|
|
1667
1889
|
Divider as Divider2,
|
|
1668
|
-
IconButton as IconButton2,
|
|
1669
1890
|
InputAdornment as InputAdornment3,
|
|
1670
1891
|
Link,
|
|
1671
1892
|
MenuList,
|
|
1672
1893
|
MenuSubheader,
|
|
1673
1894
|
Stack as Stack9,
|
|
1674
1895
|
styled as styled4,
|
|
1675
|
-
TextField as
|
|
1896
|
+
TextField as TextField6,
|
|
1676
1897
|
Typography as Typography3
|
|
1677
1898
|
} from "@elementor/ui";
|
|
1678
1899
|
import { debounce } from "@elementor/utils";
|
|
@@ -1709,7 +1930,7 @@ var FontFamilySelector = ({
|
|
|
1709
1930
|
onFontFamilyChange,
|
|
1710
1931
|
onClose
|
|
1711
1932
|
}) => {
|
|
1712
|
-
const [searchValue, setSearchValue] =
|
|
1933
|
+
const [searchValue, setSearchValue] = useState6("");
|
|
1713
1934
|
const filteredFontFamilies = useFilteredFontFamilies(fontFamilies, searchValue);
|
|
1714
1935
|
const handleSearch = (event) => {
|
|
1715
1936
|
setSearchValue(event.target.value);
|
|
@@ -1718,8 +1939,15 @@ var FontFamilySelector = ({
|
|
|
1718
1939
|
setSearchValue("");
|
|
1719
1940
|
onClose();
|
|
1720
1941
|
};
|
|
1721
|
-
return /* @__PURE__ */
|
|
1722
|
-
|
|
1942
|
+
return /* @__PURE__ */ React34.createElement(Stack9, null, /* @__PURE__ */ React34.createElement(
|
|
1943
|
+
PopoverHeader,
|
|
1944
|
+
{
|
|
1945
|
+
title: __8("Font Family", "elementor"),
|
|
1946
|
+
onClose: handleClose,
|
|
1947
|
+
icon: /* @__PURE__ */ React34.createElement(TextIcon, { fontSize: SIZE2 })
|
|
1948
|
+
}
|
|
1949
|
+
), /* @__PURE__ */ React34.createElement(Box3, { px: 1.5, pb: 1 }, /* @__PURE__ */ React34.createElement(
|
|
1950
|
+
TextField6,
|
|
1723
1951
|
{
|
|
1724
1952
|
autoFocus: true,
|
|
1725
1953
|
fullWidth: true,
|
|
@@ -1728,10 +1956,10 @@ var FontFamilySelector = ({
|
|
|
1728
1956
|
placeholder: __8("Search", "elementor"),
|
|
1729
1957
|
onChange: handleSearch,
|
|
1730
1958
|
InputProps: {
|
|
1731
|
-
startAdornment: /* @__PURE__ */
|
|
1959
|
+
startAdornment: /* @__PURE__ */ React34.createElement(InputAdornment3, { position: "start" }, /* @__PURE__ */ React34.createElement(SearchIcon, { fontSize: SIZE2 }))
|
|
1732
1960
|
}
|
|
1733
1961
|
}
|
|
1734
|
-
)), /* @__PURE__ */
|
|
1962
|
+
)), /* @__PURE__ */ React34.createElement(Divider2, null), filteredFontFamilies.length > 0 ? /* @__PURE__ */ React34.createElement(
|
|
1735
1963
|
FontList,
|
|
1736
1964
|
{
|
|
1737
1965
|
fontListItems: filteredFontFamilies,
|
|
@@ -1739,7 +1967,7 @@ var FontFamilySelector = ({
|
|
|
1739
1967
|
handleClose,
|
|
1740
1968
|
fontFamily
|
|
1741
1969
|
}
|
|
1742
|
-
) : /* @__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(
|
|
1743
1971
|
Typography3,
|
|
1744
1972
|
{
|
|
1745
1973
|
variant: "subtitle2",
|
|
@@ -1750,10 +1978,10 @@ var FontFamilySelector = ({
|
|
|
1750
1978
|
justifyContent: "center"
|
|
1751
1979
|
}
|
|
1752
1980
|
},
|
|
1753
|
-
/* @__PURE__ */
|
|
1754
|
-
/* @__PURE__ */
|
|
1755
|
-
/* @__PURE__ */
|
|
1756
|
-
)), /* @__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(
|
|
1757
1985
|
Link,
|
|
1758
1986
|
{
|
|
1759
1987
|
color: "secondary",
|
|
@@ -1767,7 +1995,7 @@ var FontFamilySelector = ({
|
|
|
1767
1995
|
var LIST_ITEM_HEIGHT = 36;
|
|
1768
1996
|
var LIST_ITEMS_BUFFER = 6;
|
|
1769
1997
|
var FontList = ({ fontListItems, setFontFamily, handleClose, fontFamily }) => {
|
|
1770
|
-
const containerRef =
|
|
1998
|
+
const containerRef = useRef7(null);
|
|
1771
1999
|
const selectedItem = fontListItems.find((item) => item.value === fontFamily);
|
|
1772
2000
|
const debouncedVirtualizeChange = useDebounce(({ getVirtualIndexes }) => {
|
|
1773
2001
|
getVirtualIndexes().forEach((index) => {
|
|
@@ -1784,7 +2012,7 @@ var FontList = ({ fontListItems, setFontFamily, handleClose, fontFamily }) => {
|
|
|
1784
2012
|
overscan: LIST_ITEMS_BUFFER,
|
|
1785
2013
|
onChange: debouncedVirtualizeChange
|
|
1786
2014
|
});
|
|
1787
|
-
|
|
2015
|
+
useEffect5(
|
|
1788
2016
|
() => {
|
|
1789
2017
|
virtualizer.scrollToIndex(fontListItems.findIndex((item) => item.value === fontFamily));
|
|
1790
2018
|
},
|
|
@@ -1792,7 +2020,7 @@ var FontList = ({ fontListItems, setFontFamily, handleClose, fontFamily }) => {
|
|
|
1792
2020
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1793
2021
|
[fontFamily]
|
|
1794
2022
|
);
|
|
1795
|
-
return /* @__PURE__ */
|
|
2023
|
+
return /* @__PURE__ */ React34.createElement(
|
|
1796
2024
|
Box3,
|
|
1797
2025
|
{
|
|
1798
2026
|
ref: containerRef,
|
|
@@ -1802,7 +2030,7 @@ var FontList = ({ fontListItems, setFontFamily, handleClose, fontFamily }) => {
|
|
|
1802
2030
|
width: 220
|
|
1803
2031
|
}
|
|
1804
2032
|
},
|
|
1805
|
-
/* @__PURE__ */
|
|
2033
|
+
/* @__PURE__ */ React34.createElement(
|
|
1806
2034
|
StyledMenuList,
|
|
1807
2035
|
{
|
|
1808
2036
|
role: "listbox",
|
|
@@ -1818,7 +2046,7 @@ var FontList = ({ fontListItems, setFontFamily, handleClose, fontFamily }) => {
|
|
|
1818
2046
|
const isSelected = selectedItem?.value === item.value;
|
|
1819
2047
|
const tabIndexFallback = !selectedItem ? 0 : -1;
|
|
1820
2048
|
if (item.type === "category") {
|
|
1821
|
-
return /* @__PURE__ */
|
|
2049
|
+
return /* @__PURE__ */ React34.createElement(
|
|
1822
2050
|
MenuSubheader,
|
|
1823
2051
|
{
|
|
1824
2052
|
key: virtualRow.key,
|
|
@@ -1829,7 +2057,7 @@ var FontList = ({ fontListItems, setFontFamily, handleClose, fontFamily }) => {
|
|
|
1829
2057
|
item.value
|
|
1830
2058
|
);
|
|
1831
2059
|
}
|
|
1832
|
-
return /* @__PURE__ */
|
|
2060
|
+
return /* @__PURE__ */ React34.createElement(
|
|
1833
2061
|
"li",
|
|
1834
2062
|
{
|
|
1835
2063
|
key: virtualRow.key,
|
|
@@ -1892,34 +2120,35 @@ var StyledMenuList = styled4(MenuList)(({ theme }) => ({
|
|
|
1892
2120
|
position: "relative"
|
|
1893
2121
|
}));
|
|
1894
2122
|
var useDebounce = (fn, delay) => {
|
|
1895
|
-
const [debouncedFn] =
|
|
1896
|
-
|
|
2123
|
+
const [debouncedFn] = useState6(() => debounce(fn, delay));
|
|
2124
|
+
useEffect5(() => () => debouncedFn.cancel(), [debouncedFn]);
|
|
1897
2125
|
return debouncedFn;
|
|
1898
2126
|
};
|
|
1899
2127
|
|
|
1900
2128
|
// src/controls/font-family-control/font-family-control.tsx
|
|
2129
|
+
var SIZE3 = "tiny";
|
|
1901
2130
|
var FontFamilyControl = createControl(({ fontFamilies }) => {
|
|
1902
|
-
const { value: fontFamily, setValue: setFontFamily, disabled } = useBoundProp(
|
|
1903
|
-
const popoverState =
|
|
1904
|
-
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(
|
|
1905
2134
|
UnstableTag2,
|
|
1906
2135
|
{
|
|
1907
2136
|
variant: "outlined",
|
|
1908
2137
|
label: fontFamily,
|
|
1909
|
-
endIcon: /* @__PURE__ */
|
|
2138
|
+
endIcon: /* @__PURE__ */ React35.createElement(ChevronDownIcon2, { fontSize: SIZE3 }),
|
|
1910
2139
|
...bindTrigger3(popoverState),
|
|
1911
2140
|
fullWidth: true,
|
|
1912
2141
|
disabled
|
|
1913
2142
|
}
|
|
1914
|
-
)), /* @__PURE__ */
|
|
1915
|
-
|
|
2143
|
+
)), /* @__PURE__ */ React35.createElement(
|
|
2144
|
+
Popover4,
|
|
1916
2145
|
{
|
|
1917
2146
|
disablePortal: true,
|
|
1918
2147
|
disableScrollLock: true,
|
|
1919
2148
|
anchorOrigin: { vertical: "bottom", horizontal: "left" },
|
|
1920
|
-
...
|
|
2149
|
+
...bindPopover4(popoverState)
|
|
1921
2150
|
},
|
|
1922
|
-
/* @__PURE__ */
|
|
2151
|
+
/* @__PURE__ */ React35.createElement(
|
|
1923
2152
|
FontFamilySelector,
|
|
1924
2153
|
{
|
|
1925
2154
|
fontFamilies,
|
|
@@ -1932,14 +2161,14 @@ var FontFamilyControl = createControl(({ fontFamilies }) => {
|
|
|
1932
2161
|
});
|
|
1933
2162
|
|
|
1934
2163
|
// src/controls/url-control.tsx
|
|
1935
|
-
import * as
|
|
2164
|
+
import * as React36 from "react";
|
|
1936
2165
|
import { urlPropTypeUtil } from "@elementor/editor-props";
|
|
1937
|
-
import { TextField as
|
|
2166
|
+
import { TextField as TextField7 } from "@elementor/ui";
|
|
1938
2167
|
var UrlControl = createControl(({ placeholder }) => {
|
|
1939
2168
|
const { value, setValue, disabled } = useBoundProp(urlPropTypeUtil);
|
|
1940
2169
|
const handleChange = (event) => setValue(event.target.value);
|
|
1941
|
-
return /* @__PURE__ */
|
|
1942
|
-
|
|
2170
|
+
return /* @__PURE__ */ React36.createElement(ControlActions, null, /* @__PURE__ */ React36.createElement(
|
|
2171
|
+
TextField7,
|
|
1943
2172
|
{
|
|
1944
2173
|
size: "tiny",
|
|
1945
2174
|
fullWidth: true,
|
|
@@ -1952,36 +2181,36 @@ var UrlControl = createControl(({ placeholder }) => {
|
|
|
1952
2181
|
});
|
|
1953
2182
|
|
|
1954
2183
|
// src/controls/link-control.tsx
|
|
1955
|
-
import * as
|
|
1956
|
-
import { useMemo as
|
|
2184
|
+
import * as React38 from "react";
|
|
2185
|
+
import { useMemo as useMemo3, useState as useState7 } from "react";
|
|
1957
2186
|
import { getLinkInLinkRestriction, selectElement } from "@elementor/editor-elements";
|
|
1958
2187
|
import {
|
|
1959
2188
|
booleanPropTypeUtil,
|
|
1960
2189
|
linkPropTypeUtil,
|
|
1961
2190
|
numberPropTypeUtil as numberPropTypeUtil2,
|
|
1962
|
-
stringPropTypeUtil as
|
|
2191
|
+
stringPropTypeUtil as stringPropTypeUtil6,
|
|
1963
2192
|
urlPropTypeUtil as urlPropTypeUtil2
|
|
1964
2193
|
} from "@elementor/editor-props";
|
|
1965
2194
|
import { InfoTipCard } from "@elementor/editor-ui";
|
|
1966
2195
|
import { httpService as httpService2 } from "@elementor/http-client";
|
|
1967
2196
|
import { AlertTriangleIcon, MinusIcon, PlusIcon as PlusIcon2 } from "@elementor/icons";
|
|
1968
2197
|
import { useSessionStorage } from "@elementor/session";
|
|
1969
|
-
import { Box as Box5, Collapse, Grid as Grid7, IconButton as
|
|
2198
|
+
import { Box as Box5, Collapse, Grid as Grid7, IconButton as IconButton3, Infotip, Stack as Stack10, Switch } from "@elementor/ui";
|
|
1970
2199
|
import { debounce as debounce2 } from "@elementor/utils";
|
|
1971
2200
|
import { __ as __9 } from "@wordpress/i18n";
|
|
1972
2201
|
|
|
1973
2202
|
// src/components/autocomplete.tsx
|
|
1974
|
-
import * as
|
|
1975
|
-
import { forwardRef as
|
|
1976
|
-
import { XIcon as
|
|
2203
|
+
import * as React37 from "react";
|
|
2204
|
+
import { forwardRef as forwardRef4 } from "react";
|
|
2205
|
+
import { XIcon as XIcon2 } from "@elementor/icons";
|
|
1977
2206
|
import {
|
|
1978
2207
|
Autocomplete as AutocompleteBase,
|
|
1979
2208
|
Box as Box4,
|
|
1980
|
-
IconButton as
|
|
2209
|
+
IconButton as IconButton2,
|
|
1981
2210
|
InputAdornment as InputAdornment4,
|
|
1982
|
-
TextField as
|
|
2211
|
+
TextField as TextField8
|
|
1983
2212
|
} from "@elementor/ui";
|
|
1984
|
-
var Autocomplete =
|
|
2213
|
+
var Autocomplete = forwardRef4((props, ref) => {
|
|
1985
2214
|
const {
|
|
1986
2215
|
options,
|
|
1987
2216
|
onOptionChange,
|
|
@@ -1997,7 +2226,7 @@ var Autocomplete = forwardRef2((props, ref) => {
|
|
|
1997
2226
|
const muiWarningPreventer = allowCustomValues || !!value?.toString()?.length;
|
|
1998
2227
|
const isOptionEqualToValue = muiWarningPreventer ? void 0 : () => true;
|
|
1999
2228
|
const isValueFromOptions = typeof value === "number" && !!findMatchingOption(options, value);
|
|
2000
|
-
return /* @__PURE__ */
|
|
2229
|
+
return /* @__PURE__ */ React37.createElement(
|
|
2001
2230
|
AutocompleteBase,
|
|
2002
2231
|
{
|
|
2003
2232
|
...restProps,
|
|
@@ -2015,8 +2244,8 @@ var Autocomplete = forwardRef2((props, ref) => {
|
|
|
2015
2244
|
groupBy: isCategorizedOptionPool(options) ? (optionId) => findMatchingOption(options, optionId)?.groupLabel || optionId : void 0,
|
|
2016
2245
|
isOptionEqualToValue,
|
|
2017
2246
|
filterOptions: () => optionKeys,
|
|
2018
|
-
renderOption: (optionProps, optionId) => /* @__PURE__ */
|
|
2019
|
-
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(
|
|
2020
2249
|
TextInput,
|
|
2021
2250
|
{
|
|
2022
2251
|
params,
|
|
@@ -2039,8 +2268,8 @@ var TextInput = ({
|
|
|
2039
2268
|
const onChange = (event) => {
|
|
2040
2269
|
handleChange(event.target.value);
|
|
2041
2270
|
};
|
|
2042
|
-
return /* @__PURE__ */
|
|
2043
|
-
|
|
2271
|
+
return /* @__PURE__ */ React37.createElement(
|
|
2272
|
+
TextField8,
|
|
2044
2273
|
{
|
|
2045
2274
|
...params,
|
|
2046
2275
|
placeholder,
|
|
@@ -2052,7 +2281,7 @@ var TextInput = ({
|
|
|
2052
2281
|
},
|
|
2053
2282
|
InputProps: {
|
|
2054
2283
|
...params.InputProps,
|
|
2055
|
-
endAdornment: /* @__PURE__ */
|
|
2284
|
+
endAdornment: /* @__PURE__ */ React37.createElement(ClearButton, { params, allowClear, handleChange })
|
|
2056
2285
|
}
|
|
2057
2286
|
}
|
|
2058
2287
|
);
|
|
@@ -2061,7 +2290,7 @@ var ClearButton = ({
|
|
|
2061
2290
|
allowClear,
|
|
2062
2291
|
handleChange,
|
|
2063
2292
|
params
|
|
2064
|
-
}) => /* @__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 })));
|
|
2065
2294
|
function findMatchingOption(options, optionId = null) {
|
|
2066
2295
|
const formattedOption = (optionId || "").toString();
|
|
2067
2296
|
return options.find(({ id }) => formattedOption === id.toString());
|
|
@@ -2083,7 +2312,7 @@ function _factoryFilter(newValue, options, minInputLength) {
|
|
|
2083
2312
|
}
|
|
2084
2313
|
|
|
2085
2314
|
// src/controls/link-control.tsx
|
|
2086
|
-
var
|
|
2315
|
+
var SIZE4 = "tiny";
|
|
2087
2316
|
var learnMoreButton = {
|
|
2088
2317
|
label: __9("Learn More", "elementor"),
|
|
2089
2318
|
href: "https://go.elementor.com/element-link-inside-link-infotip"
|
|
@@ -2091,7 +2320,7 @@ var learnMoreButton = {
|
|
|
2091
2320
|
var LinkControl = createControl((props) => {
|
|
2092
2321
|
const { value, path, setValue, ...propContext } = useBoundProp(linkPropTypeUtil);
|
|
2093
2322
|
const [linkSessionValue, setLinkSessionValue] = useSessionStorage(path.join("/"));
|
|
2094
|
-
const [isActive, setIsActive] =
|
|
2323
|
+
const [isActive, setIsActive] = useState7(!!value);
|
|
2095
2324
|
const {
|
|
2096
2325
|
allowCustomValues,
|
|
2097
2326
|
queryOptions: { endpoint = "", requestParams = {} },
|
|
@@ -2099,8 +2328,8 @@ var LinkControl = createControl((props) => {
|
|
|
2099
2328
|
minInputLength = 2,
|
|
2100
2329
|
context: { elementId }
|
|
2101
2330
|
} = props || {};
|
|
2102
|
-
const [linkInLinkRestriction, setLinkInLinkRestriction] =
|
|
2103
|
-
const [options, setOptions] =
|
|
2331
|
+
const [linkInLinkRestriction, setLinkInLinkRestriction] = useState7(getLinkInLinkRestriction(elementId));
|
|
2332
|
+
const [options, setOptions] = useState7(
|
|
2104
2333
|
generateFirstLoadedOption(value)
|
|
2105
2334
|
);
|
|
2106
2335
|
const shouldDisableAddingLink = !isActive && linkInLinkRestriction.shouldRestrict;
|
|
@@ -2126,7 +2355,7 @@ var LinkControl = createControl((props) => {
|
|
|
2126
2355
|
const valueToSave = newValue ? {
|
|
2127
2356
|
...value,
|
|
2128
2357
|
destination: numberPropTypeUtil2.create(newValue),
|
|
2129
|
-
label:
|
|
2358
|
+
label: stringPropTypeUtil6.create(findMatchingOption(options, newValue)?.label || null)
|
|
2130
2359
|
} : null;
|
|
2131
2360
|
onSaveNewValue(valueToSave);
|
|
2132
2361
|
};
|
|
@@ -2135,7 +2364,7 @@ var LinkControl = createControl((props) => {
|
|
|
2135
2364
|
const valueToSave = newValue ? {
|
|
2136
2365
|
...value,
|
|
2137
2366
|
destination: urlPropTypeUtil2.create(newValue),
|
|
2138
|
-
label:
|
|
2367
|
+
label: stringPropTypeUtil6.create("")
|
|
2139
2368
|
} : null;
|
|
2140
2369
|
onSaveNewValue(valueToSave);
|
|
2141
2370
|
updateOptions(newValue);
|
|
@@ -2151,7 +2380,7 @@ var LinkControl = createControl((props) => {
|
|
|
2151
2380
|
}
|
|
2152
2381
|
debounceFetch({ ...requestParams, term: newValue });
|
|
2153
2382
|
};
|
|
2154
|
-
const debounceFetch =
|
|
2383
|
+
const debounceFetch = useMemo3(
|
|
2155
2384
|
() => debounce2(
|
|
2156
2385
|
(params) => fetchOptions(endpoint, params).then((newOptions) => {
|
|
2157
2386
|
setOptions(formatOptions(newOptions));
|
|
@@ -2160,7 +2389,7 @@ var LinkControl = createControl((props) => {
|
|
|
2160
2389
|
),
|
|
2161
2390
|
[endpoint]
|
|
2162
2391
|
);
|
|
2163
|
-
return /* @__PURE__ */
|
|
2392
|
+
return /* @__PURE__ */ React38.createElement(PropProvider, { ...propContext, value, setValue }, /* @__PURE__ */ React38.createElement(Stack10, { gap: 1.5 }, /* @__PURE__ */ React38.createElement(
|
|
2164
2393
|
Stack10,
|
|
2165
2394
|
{
|
|
2166
2395
|
direction: "row",
|
|
@@ -2170,8 +2399,8 @@ var LinkControl = createControl((props) => {
|
|
|
2170
2399
|
marginInlineEnd: -0.75
|
|
2171
2400
|
}
|
|
2172
2401
|
},
|
|
2173
|
-
/* @__PURE__ */
|
|
2174
|
-
/* @__PURE__ */
|
|
2402
|
+
/* @__PURE__ */ React38.createElement(ControlFormLabel, null, __9("Link", "elementor")),
|
|
2403
|
+
/* @__PURE__ */ React38.createElement(ConditionalInfoTip, { isVisible: !isActive, linkInLinkRestriction }, /* @__PURE__ */ React38.createElement(
|
|
2175
2404
|
ToggleIconControl,
|
|
2176
2405
|
{
|
|
2177
2406
|
disabled: shouldDisableAddingLink,
|
|
@@ -2180,7 +2409,7 @@ var LinkControl = createControl((props) => {
|
|
|
2180
2409
|
label: __9("Toggle link", "elementor")
|
|
2181
2410
|
}
|
|
2182
2411
|
))
|
|
2183
|
-
), /* @__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(
|
|
2184
2413
|
Autocomplete,
|
|
2185
2414
|
{
|
|
2186
2415
|
options,
|
|
@@ -2191,10 +2420,10 @@ var LinkControl = createControl((props) => {
|
|
|
2191
2420
|
onTextChange,
|
|
2192
2421
|
minInputLength
|
|
2193
2422
|
}
|
|
2194
|
-
))), /* @__PURE__ */
|
|
2423
|
+
))), /* @__PURE__ */ React38.createElement(PropKeyProvider, { bind: "isTargetBlank" }, /* @__PURE__ */ React38.createElement(SwitchControl, { disabled: propContext.disabled || !value }))))));
|
|
2195
2424
|
});
|
|
2196
2425
|
var ToggleIconControl = ({ disabled, active, onIconClick, label }) => {
|
|
2197
|
-
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 }));
|
|
2198
2427
|
};
|
|
2199
2428
|
var SwitchControl = ({ disabled }) => {
|
|
2200
2429
|
const { value = false, setValue } = useBoundProp(booleanPropTypeUtil);
|
|
@@ -2206,7 +2435,7 @@ var SwitchControl = ({ disabled }) => {
|
|
|
2206
2435
|
opacity: 0
|
|
2207
2436
|
}
|
|
2208
2437
|
} : {};
|
|
2209
|
-
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 })));
|
|
2210
2439
|
};
|
|
2211
2440
|
async function fetchOptions(ajaxUrl, params) {
|
|
2212
2441
|
if (!params || !ajaxUrl) {
|
|
@@ -2243,15 +2472,15 @@ var ConditionalInfoTip = ({ linkInLinkRestriction, isVisible, children }) => {
|
|
|
2243
2472
|
selectElement(elementId);
|
|
2244
2473
|
}
|
|
2245
2474
|
};
|
|
2246
|
-
return shouldRestrict && isVisible ? /* @__PURE__ */
|
|
2475
|
+
return shouldRestrict && isVisible ? /* @__PURE__ */ React38.createElement(
|
|
2247
2476
|
Infotip,
|
|
2248
2477
|
{
|
|
2249
2478
|
placement: "right",
|
|
2250
|
-
content: /* @__PURE__ */
|
|
2479
|
+
content: /* @__PURE__ */ React38.createElement(
|
|
2251
2480
|
InfoTipCard,
|
|
2252
2481
|
{
|
|
2253
2482
|
content: INFOTIP_CONTENT[reason],
|
|
2254
|
-
svgIcon: /* @__PURE__ */
|
|
2483
|
+
svgIcon: /* @__PURE__ */ React38.createElement(AlertTriangleIcon, null),
|
|
2255
2484
|
learnMoreButton,
|
|
2256
2485
|
ctaButton: {
|
|
2257
2486
|
label: __9("Take me there", "elementor"),
|
|
@@ -2260,16 +2489,17 @@ var ConditionalInfoTip = ({ linkInLinkRestriction, isVisible, children }) => {
|
|
|
2260
2489
|
}
|
|
2261
2490
|
)
|
|
2262
2491
|
},
|
|
2263
|
-
/* @__PURE__ */
|
|
2264
|
-
) : /* @__PURE__ */
|
|
2492
|
+
/* @__PURE__ */ React38.createElement(Box5, null, children)
|
|
2493
|
+
) : /* @__PURE__ */ React38.createElement(React38.Fragment, null, children);
|
|
2265
2494
|
};
|
|
2266
2495
|
var INFOTIP_CONTENT = {
|
|
2267
|
-
descendant: /* @__PURE__ */
|
|
2268
|
-
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"))
|
|
2269
2498
|
};
|
|
2270
2499
|
|
|
2271
2500
|
// src/controls/gap-control.tsx
|
|
2272
|
-
import * as
|
|
2501
|
+
import * as React39 from "react";
|
|
2502
|
+
import { useRef as useRef8 } from "react";
|
|
2273
2503
|
import { layoutDirectionPropTypeUtil, sizePropTypeUtil as sizePropTypeUtil4 } from "@elementor/editor-props";
|
|
2274
2504
|
import { DetachIcon as DetachIcon2, LinkIcon as LinkIcon2 } from "@elementor/icons";
|
|
2275
2505
|
import { Grid as Grid8, Stack as Stack11, ToggleButton as ToggleButton4, Tooltip as Tooltip5 } from "@elementor/ui";
|
|
@@ -2281,6 +2511,7 @@ var GapControl = createControl(({ label }) => {
|
|
|
2281
2511
|
propType,
|
|
2282
2512
|
disabled: directionDisabled
|
|
2283
2513
|
} = useBoundProp(layoutDirectionPropTypeUtil);
|
|
2514
|
+
const stackRef = useRef8();
|
|
2284
2515
|
const { value: sizeValue, setValue: setSizeValue, disabled: sizeDisabled } = useBoundProp(sizePropTypeUtil4);
|
|
2285
2516
|
const isLinked = !directionValue && !sizeValue ? true : !!sizeValue;
|
|
2286
2517
|
const onLinkToggle = () => {
|
|
@@ -2298,7 +2529,8 @@ var GapControl = createControl(({ label }) => {
|
|
|
2298
2529
|
const LinkedIcon = isLinked ? LinkIcon2 : DetachIcon2;
|
|
2299
2530
|
const linkedLabel = __10("Link %s", "elementor").replace("%s", tooltipLabel);
|
|
2300
2531
|
const unlinkedLabel = __10("Unlink %s", "elementor").replace("%s", tooltipLabel);
|
|
2301
|
-
|
|
2532
|
+
const disabled = sizeDisabled || directionDisabled;
|
|
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(
|
|
2302
2534
|
ToggleButton4,
|
|
2303
2535
|
{
|
|
2304
2536
|
"aria-label": isLinked ? unlinkedLabel : linkedLabel,
|
|
@@ -2307,25 +2539,29 @@ var GapControl = createControl(({ label }) => {
|
|
|
2307
2539
|
selected: isLinked,
|
|
2308
2540
|
sx: { marginLeft: "auto" },
|
|
2309
2541
|
onChange: onLinkToggle,
|
|
2310
|
-
disabled
|
|
2542
|
+
disabled
|
|
2311
2543
|
},
|
|
2312
|
-
/* @__PURE__ */
|
|
2313
|
-
))), /* @__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 })))));
|
|
2314
2546
|
});
|
|
2315
|
-
var Control4 = ({
|
|
2547
|
+
var Control4 = ({
|
|
2548
|
+
bind,
|
|
2549
|
+
isLinked,
|
|
2550
|
+
anchorRef
|
|
2551
|
+
}) => {
|
|
2316
2552
|
if (isLinked) {
|
|
2317
|
-
return /* @__PURE__ */
|
|
2553
|
+
return /* @__PURE__ */ React39.createElement(SizeControl, { anchorRef });
|
|
2318
2554
|
}
|
|
2319
|
-
return /* @__PURE__ */
|
|
2555
|
+
return /* @__PURE__ */ React39.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React39.createElement(SizeControl, { anchorRef }));
|
|
2320
2556
|
};
|
|
2321
2557
|
|
|
2322
2558
|
// src/controls/aspect-ratio-control.tsx
|
|
2323
|
-
import * as
|
|
2324
|
-
import { useState as
|
|
2325
|
-
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";
|
|
2326
2562
|
import { MenuListItem as MenuListItem3 } from "@elementor/editor-ui";
|
|
2327
2563
|
import { ArrowsMoveHorizontalIcon, ArrowsMoveVerticalIcon } from "@elementor/icons";
|
|
2328
|
-
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";
|
|
2329
2565
|
import { __ as __11 } from "@wordpress/i18n";
|
|
2330
2566
|
var RATIO_OPTIONS = [
|
|
2331
2567
|
{ label: __11("Auto", "elementor"), value: "auto" },
|
|
@@ -2339,13 +2575,13 @@ var RATIO_OPTIONS = [
|
|
|
2339
2575
|
];
|
|
2340
2576
|
var CUSTOM_RATIO = "custom";
|
|
2341
2577
|
var AspectRatioControl = createControl(({ label }) => {
|
|
2342
|
-
const { value: aspectRatioValue, setValue: setAspectRatioValue, disabled } = useBoundProp(
|
|
2578
|
+
const { value: aspectRatioValue, setValue: setAspectRatioValue, disabled } = useBoundProp(stringPropTypeUtil7);
|
|
2343
2579
|
const isCustomSelected = aspectRatioValue && !RATIO_OPTIONS.some((option) => option.value === aspectRatioValue);
|
|
2344
2580
|
const [initialWidth, initialHeight] = isCustomSelected ? aspectRatioValue.split("/") : ["", ""];
|
|
2345
|
-
const [isCustom, setIsCustom] =
|
|
2346
|
-
const [customWidth, setCustomWidth] =
|
|
2347
|
-
const [customHeight, setCustomHeight] =
|
|
2348
|
-
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(
|
|
2349
2585
|
isCustomSelected ? CUSTOM_RATIO : aspectRatioValue || ""
|
|
2350
2586
|
);
|
|
2351
2587
|
const handleSelectChange = (event) => {
|
|
@@ -2372,7 +2608,7 @@ var AspectRatioControl = createControl(({ label }) => {
|
|
|
2372
2608
|
setAspectRatioValue(`${customWidth}/${newHeight}`);
|
|
2373
2609
|
}
|
|
2374
2610
|
};
|
|
2375
|
-
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(
|
|
2376
2612
|
Select2,
|
|
2377
2613
|
{
|
|
2378
2614
|
size: "tiny",
|
|
@@ -2384,10 +2620,10 @@ var AspectRatioControl = createControl(({ label }) => {
|
|
|
2384
2620
|
fullWidth: true
|
|
2385
2621
|
},
|
|
2386
2622
|
[...RATIO_OPTIONS, { label: __11("Custom", "elementor"), value: CUSTOM_RATIO }].map(
|
|
2387
|
-
({ label: optionLabel, ...props }) => /* @__PURE__ */
|
|
2623
|
+
({ label: optionLabel, ...props }) => /* @__PURE__ */ React40.createElement(MenuListItem3, { key: props.value, ...props, value: props.value ?? "" }, optionLabel)
|
|
2388
2624
|
)
|
|
2389
|
-
))), isCustom && /* @__PURE__ */
|
|
2390
|
-
|
|
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,
|
|
2391
2627
|
{
|
|
2392
2628
|
size: "tiny",
|
|
2393
2629
|
type: "number",
|
|
@@ -2396,11 +2632,11 @@ var AspectRatioControl = createControl(({ label }) => {
|
|
|
2396
2632
|
value: customWidth,
|
|
2397
2633
|
onChange: handleCustomWidthChange,
|
|
2398
2634
|
InputProps: {
|
|
2399
|
-
startAdornment: /* @__PURE__ */
|
|
2635
|
+
startAdornment: /* @__PURE__ */ React40.createElement(ArrowsMoveHorizontalIcon, { fontSize: "tiny" })
|
|
2400
2636
|
}
|
|
2401
2637
|
}
|
|
2402
|
-
)), /* @__PURE__ */
|
|
2403
|
-
|
|
2638
|
+
)), /* @__PURE__ */ React40.createElement(Grid9, { item: true, xs: 6 }, /* @__PURE__ */ React40.createElement(
|
|
2639
|
+
TextField9,
|
|
2404
2640
|
{
|
|
2405
2641
|
size: "tiny",
|
|
2406
2642
|
type: "number",
|
|
@@ -2409,15 +2645,15 @@ var AspectRatioControl = createControl(({ label }) => {
|
|
|
2409
2645
|
value: customHeight,
|
|
2410
2646
|
onChange: handleCustomHeightChange,
|
|
2411
2647
|
InputProps: {
|
|
2412
|
-
startAdornment: /* @__PURE__ */
|
|
2648
|
+
startAdornment: /* @__PURE__ */ React40.createElement(ArrowsMoveVerticalIcon, { fontSize: "tiny" })
|
|
2413
2649
|
}
|
|
2414
2650
|
}
|
|
2415
2651
|
)))));
|
|
2416
2652
|
});
|
|
2417
2653
|
|
|
2418
2654
|
// src/controls/svg-media-control.tsx
|
|
2419
|
-
import * as
|
|
2420
|
-
import { useState as
|
|
2655
|
+
import * as React42 from "react";
|
|
2656
|
+
import { useState as useState10 } from "react";
|
|
2421
2657
|
import { imageSrcPropTypeUtil as imageSrcPropTypeUtil2 } from "@elementor/editor-props";
|
|
2422
2658
|
import { UploadIcon as UploadIcon2 } from "@elementor/icons";
|
|
2423
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";
|
|
@@ -2425,8 +2661,8 @@ import { useWpMediaAttachment as useWpMediaAttachment2, useWpMediaFrame as useWp
|
|
|
2425
2661
|
import { __ as __13 } from "@wordpress/i18n";
|
|
2426
2662
|
|
|
2427
2663
|
// src/components/enable-unfiltered-modal.tsx
|
|
2428
|
-
import * as
|
|
2429
|
-
import { useState as
|
|
2664
|
+
import * as React41 from "react";
|
|
2665
|
+
import { useState as useState9 } from "react";
|
|
2430
2666
|
import { useCurrentUserCapabilities } from "@elementor/editor-current-user";
|
|
2431
2667
|
import {
|
|
2432
2668
|
Button as Button3,
|
|
@@ -2459,7 +2695,7 @@ var WAIT_FOR_CLOSE_TIMEOUT_MS = 300;
|
|
|
2459
2695
|
var EnableUnfilteredModal = (props) => {
|
|
2460
2696
|
const { mutateAsync, isPending } = useUpdateUnfilteredFilesUpload();
|
|
2461
2697
|
const { canUser } = useCurrentUserCapabilities();
|
|
2462
|
-
const [isError, setIsError] =
|
|
2698
|
+
const [isError, setIsError] = useState9(false);
|
|
2463
2699
|
const canManageOptions = canUser("manage_options");
|
|
2464
2700
|
const onClose = (enabled) => {
|
|
2465
2701
|
props.onClose(enabled);
|
|
@@ -2478,9 +2714,9 @@ var EnableUnfilteredModal = (props) => {
|
|
|
2478
2714
|
}
|
|
2479
2715
|
};
|
|
2480
2716
|
const dialogProps = { ...props, isPending, handleEnable, isError, onClose };
|
|
2481
|
-
return canManageOptions ? /* @__PURE__ */
|
|
2717
|
+
return canManageOptions ? /* @__PURE__ */ React41.createElement(AdminDialog, { ...dialogProps }) : /* @__PURE__ */ React41.createElement(NonAdminDialog, { ...dialogProps });
|
|
2482
2718
|
};
|
|
2483
|
-
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(
|
|
2484
2720
|
Button3,
|
|
2485
2721
|
{
|
|
2486
2722
|
size: "medium",
|
|
@@ -2489,9 +2725,9 @@ var AdminDialog = ({ open, onClose, handleEnable, isPending, isError }) => /* @_
|
|
|
2489
2725
|
color: "primary",
|
|
2490
2726
|
disabled: isPending
|
|
2491
2727
|
},
|
|
2492
|
-
isPending ? /* @__PURE__ */
|
|
2728
|
+
isPending ? /* @__PURE__ */ React41.createElement(CircularProgress2, { size: 24 }) : __12("Enable", "elementor")
|
|
2493
2729
|
)));
|
|
2494
|
-
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"))));
|
|
2495
2731
|
|
|
2496
2732
|
// src/controls/svg-media-control.tsx
|
|
2497
2733
|
var TILE_SIZE = 8;
|
|
@@ -2524,7 +2760,7 @@ var SvgMediaControl = createControl(() => {
|
|
|
2524
2760
|
const { data: attachment, isFetching } = useWpMediaAttachment2(id?.value || null);
|
|
2525
2761
|
const src = attachment?.url ?? url?.value ?? null;
|
|
2526
2762
|
const { data: allowSvgUpload } = useUnfilteredFilesUpload();
|
|
2527
|
-
const [unfilteredModalOpenState, setUnfilteredModalOpenState] =
|
|
2763
|
+
const [unfilteredModalOpenState, setUnfilteredModalOpenState] = useState10(false);
|
|
2528
2764
|
const { open } = useWpMediaFrame2({
|
|
2529
2765
|
mediaTypes: ["svg"],
|
|
2530
2766
|
multiple: false,
|
|
@@ -2552,7 +2788,7 @@ var SvgMediaControl = createControl(() => {
|
|
|
2552
2788
|
open(openOptions);
|
|
2553
2789
|
}
|
|
2554
2790
|
};
|
|
2555
|
-
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(
|
|
2556
2792
|
CardMedia2,
|
|
2557
2793
|
{
|
|
2558
2794
|
component: "img",
|
|
@@ -2560,7 +2796,7 @@ var SvgMediaControl = createControl(() => {
|
|
|
2560
2796
|
alt: __13("Preview SVG", "elementor"),
|
|
2561
2797
|
sx: { maxHeight: "140px", width: "50px" }
|
|
2562
2798
|
}
|
|
2563
|
-
)), /* @__PURE__ */
|
|
2799
|
+
)), /* @__PURE__ */ React42.createElement(
|
|
2564
2800
|
CardOverlay2,
|
|
2565
2801
|
{
|
|
2566
2802
|
sx: {
|
|
@@ -2569,7 +2805,7 @@ var SvgMediaControl = createControl(() => {
|
|
|
2569
2805
|
}
|
|
2570
2806
|
}
|
|
2571
2807
|
},
|
|
2572
|
-
/* @__PURE__ */
|
|
2808
|
+
/* @__PURE__ */ React42.createElement(Stack13, { gap: 1 }, /* @__PURE__ */ React42.createElement(
|
|
2573
2809
|
Button4,
|
|
2574
2810
|
{
|
|
2575
2811
|
size: "tiny",
|
|
@@ -2578,13 +2814,13 @@ var SvgMediaControl = createControl(() => {
|
|
|
2578
2814
|
onClick: () => handleClick(MODE_BROWSE)
|
|
2579
2815
|
},
|
|
2580
2816
|
__13("Select SVG", "elementor")
|
|
2581
|
-
), /* @__PURE__ */
|
|
2817
|
+
), /* @__PURE__ */ React42.createElement(
|
|
2582
2818
|
Button4,
|
|
2583
2819
|
{
|
|
2584
2820
|
size: "tiny",
|
|
2585
2821
|
variant: "text",
|
|
2586
2822
|
color: "inherit",
|
|
2587
|
-
startIcon: /* @__PURE__ */
|
|
2823
|
+
startIcon: /* @__PURE__ */ React42.createElement(UploadIcon2, null),
|
|
2588
2824
|
onClick: () => handleClick(MODE_UPLOAD)
|
|
2589
2825
|
},
|
|
2590
2826
|
__13("Upload", "elementor")
|
|
@@ -2593,14 +2829,14 @@ var SvgMediaControl = createControl(() => {
|
|
|
2593
2829
|
});
|
|
2594
2830
|
|
|
2595
2831
|
// src/controls/background-control/background-control.tsx
|
|
2596
|
-
import * as
|
|
2832
|
+
import * as React49 from "react";
|
|
2597
2833
|
import { backgroundPropTypeUtil } from "@elementor/editor-props";
|
|
2598
|
-
import { isExperimentActive as
|
|
2834
|
+
import { isExperimentActive as isExperimentActive4 } from "@elementor/editor-v1-adapters";
|
|
2599
2835
|
import { Grid as Grid15 } from "@elementor/ui";
|
|
2600
2836
|
import { __ as __19 } from "@wordpress/i18n";
|
|
2601
2837
|
|
|
2602
2838
|
// src/controls/background-control/background-overlay/background-overlay-repeater-control.tsx
|
|
2603
|
-
import * as
|
|
2839
|
+
import * as React48 from "react";
|
|
2604
2840
|
import {
|
|
2605
2841
|
backgroundColorOverlayPropTypeUtil as backgroundColorOverlayPropTypeUtil2,
|
|
2606
2842
|
backgroundImageOverlayPropTypeUtil as backgroundImageOverlayPropTypeUtil2,
|
|
@@ -2616,14 +2852,14 @@ import { parseEnv } from "@elementor/env";
|
|
|
2616
2852
|
var { env } = parseEnv("@elementor/editor-controls");
|
|
2617
2853
|
|
|
2618
2854
|
// src/controls/background-control/background-gradient-color-control.tsx
|
|
2619
|
-
import * as
|
|
2855
|
+
import * as React43 from "react";
|
|
2620
2856
|
import {
|
|
2621
2857
|
backgroundGradientOverlayPropTypeUtil,
|
|
2622
2858
|
colorPropTypeUtil as colorPropTypeUtil2,
|
|
2623
2859
|
colorStopPropTypeUtil,
|
|
2624
2860
|
gradientColorStopPropTypeUtil,
|
|
2625
2861
|
numberPropTypeUtil as numberPropTypeUtil3,
|
|
2626
|
-
stringPropTypeUtil as
|
|
2862
|
+
stringPropTypeUtil as stringPropTypeUtil8
|
|
2627
2863
|
} from "@elementor/editor-props";
|
|
2628
2864
|
import { UnstableGradientBox } from "@elementor/ui";
|
|
2629
2865
|
var BackgroundGradientColorControl = createControl(() => {
|
|
@@ -2631,13 +2867,13 @@ var BackgroundGradientColorControl = createControl(() => {
|
|
|
2631
2867
|
const handleChange = (newValue) => {
|
|
2632
2868
|
const transformedValue = createTransformableValue(newValue);
|
|
2633
2869
|
if (transformedValue.positions) {
|
|
2634
|
-
transformedValue.positions =
|
|
2870
|
+
transformedValue.positions = stringPropTypeUtil8.create(newValue.positions.join(" "));
|
|
2635
2871
|
}
|
|
2636
2872
|
setValue(transformedValue);
|
|
2637
2873
|
};
|
|
2638
2874
|
const createTransformableValue = (newValue) => ({
|
|
2639
2875
|
...newValue,
|
|
2640
|
-
type:
|
|
2876
|
+
type: stringPropTypeUtil8.create(newValue.type),
|
|
2641
2877
|
angle: numberPropTypeUtil3.create(newValue.angle),
|
|
2642
2878
|
stops: gradientColorStopPropTypeUtil.create(
|
|
2643
2879
|
newValue.stops.map(
|
|
@@ -2663,7 +2899,7 @@ var BackgroundGradientColorControl = createControl(() => {
|
|
|
2663
2899
|
positions: positions?.value.split(" ")
|
|
2664
2900
|
};
|
|
2665
2901
|
};
|
|
2666
|
-
return /* @__PURE__ */
|
|
2902
|
+
return /* @__PURE__ */ React43.createElement(ControlActions, null, /* @__PURE__ */ React43.createElement(
|
|
2667
2903
|
UnstableGradientBox,
|
|
2668
2904
|
{
|
|
2669
2905
|
sx: { width: "auto", padding: 1.5 },
|
|
@@ -2673,7 +2909,7 @@ var BackgroundGradientColorControl = createControl(() => {
|
|
|
2673
2909
|
));
|
|
2674
2910
|
});
|
|
2675
2911
|
var initialBackgroundGradientOverlay = backgroundGradientOverlayPropTypeUtil.create({
|
|
2676
|
-
type:
|
|
2912
|
+
type: stringPropTypeUtil8.create("linear"),
|
|
2677
2913
|
angle: numberPropTypeUtil3.create(180),
|
|
2678
2914
|
stops: gradientColorStopPropTypeUtil.create([
|
|
2679
2915
|
colorStopPropTypeUtil.create({
|
|
@@ -2688,7 +2924,7 @@ var initialBackgroundGradientOverlay = backgroundGradientOverlayPropTypeUtil.cre
|
|
|
2688
2924
|
});
|
|
2689
2925
|
|
|
2690
2926
|
// src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-attachment.tsx
|
|
2691
|
-
import * as
|
|
2927
|
+
import * as React44 from "react";
|
|
2692
2928
|
import { PinIcon, PinnedOffIcon } from "@elementor/icons";
|
|
2693
2929
|
import { Grid as Grid10 } from "@elementor/ui";
|
|
2694
2930
|
import { __ as __14 } from "@wordpress/i18n";
|
|
@@ -2696,23 +2932,24 @@ var attachmentControlOptions = [
|
|
|
2696
2932
|
{
|
|
2697
2933
|
value: "fixed",
|
|
2698
2934
|
label: __14("Fixed", "elementor"),
|
|
2699
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2935
|
+
renderContent: ({ size }) => /* @__PURE__ */ React44.createElement(PinIcon, { fontSize: size }),
|
|
2700
2936
|
showTooltip: true
|
|
2701
2937
|
},
|
|
2702
2938
|
{
|
|
2703
2939
|
value: "scroll",
|
|
2704
2940
|
label: __14("Scroll", "elementor"),
|
|
2705
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2941
|
+
renderContent: ({ size }) => /* @__PURE__ */ React44.createElement(PinnedOffIcon, { fontSize: size }),
|
|
2706
2942
|
showTooltip: true
|
|
2707
2943
|
}
|
|
2708
2944
|
];
|
|
2709
2945
|
var BackgroundImageOverlayAttachment = () => {
|
|
2710
|
-
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 })));
|
|
2711
2947
|
};
|
|
2712
2948
|
|
|
2713
2949
|
// src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-position.tsx
|
|
2714
|
-
import * as
|
|
2715
|
-
import {
|
|
2950
|
+
import * as React45 from "react";
|
|
2951
|
+
import { useRef as useRef9 } from "react";
|
|
2952
|
+
import { backgroundImagePositionOffsetPropTypeUtil, stringPropTypeUtil as stringPropTypeUtil9 } from "@elementor/editor-props";
|
|
2716
2953
|
import { MenuListItem as MenuListItem4 } from "@elementor/editor-ui";
|
|
2717
2954
|
import { LetterXIcon, LetterYIcon } from "@elementor/icons";
|
|
2718
2955
|
import { Grid as Grid11, Select as Select3 } from "@elementor/ui";
|
|
@@ -2731,8 +2968,9 @@ var backgroundPositionOptions = [
|
|
|
2731
2968
|
];
|
|
2732
2969
|
var BackgroundImageOverlayPosition = () => {
|
|
2733
2970
|
const backgroundImageOffsetContext = useBoundProp(backgroundImagePositionOffsetPropTypeUtil);
|
|
2734
|
-
const stringPropContext = useBoundProp(
|
|
2971
|
+
const stringPropContext = useBoundProp(stringPropTypeUtil9);
|
|
2735
2972
|
const isCustom = !!backgroundImageOffsetContext.value;
|
|
2973
|
+
const rowRef = useRef9();
|
|
2736
2974
|
const handlePositionChange = (event) => {
|
|
2737
2975
|
const value = event.target.value || null;
|
|
2738
2976
|
if (value === "custom") {
|
|
@@ -2741,63 +2979,77 @@ var BackgroundImageOverlayPosition = () => {
|
|
|
2741
2979
|
stringPropContext.setValue(value);
|
|
2742
2980
|
}
|
|
2743
2981
|
};
|
|
2744
|
-
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(
|
|
2745
2983
|
Select3,
|
|
2746
2984
|
{
|
|
2985
|
+
fullWidth: true,
|
|
2747
2986
|
size: "tiny",
|
|
2748
|
-
value: (backgroundImageOffsetContext.value ? "custom" : stringPropContext.value) ?? "",
|
|
2749
2987
|
onChange: handlePositionChange,
|
|
2750
|
-
|
|
2988
|
+
disabled: stringPropContext.disabled,
|
|
2989
|
+
value: (backgroundImageOffsetContext.value ? "custom" : stringPropContext.value) ?? ""
|
|
2751
2990
|
},
|
|
2752
|
-
backgroundPositionOptions.map(({ label, value }) => /* @__PURE__ */
|
|
2753
|
-
)))), 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);
|
|
2754
3005
|
};
|
|
2755
3006
|
|
|
2756
3007
|
// src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-repeat.tsx
|
|
2757
|
-
import * as
|
|
2758
|
-
import { DotsHorizontalIcon, DotsVerticalIcon, GridDotsIcon, XIcon as
|
|
3008
|
+
import * as React46 from "react";
|
|
3009
|
+
import { DotsHorizontalIcon, DotsVerticalIcon, GridDotsIcon, XIcon as XIcon3 } from "@elementor/icons";
|
|
2759
3010
|
import { Grid as Grid12 } from "@elementor/ui";
|
|
2760
3011
|
import { __ as __16 } from "@wordpress/i18n";
|
|
2761
3012
|
var repeatControlOptions = [
|
|
2762
3013
|
{
|
|
2763
3014
|
value: "repeat",
|
|
2764
3015
|
label: __16("Repeat", "elementor"),
|
|
2765
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
3016
|
+
renderContent: ({ size }) => /* @__PURE__ */ React46.createElement(GridDotsIcon, { fontSize: size }),
|
|
2766
3017
|
showTooltip: true
|
|
2767
3018
|
},
|
|
2768
3019
|
{
|
|
2769
3020
|
value: "repeat-x",
|
|
2770
3021
|
label: __16("Repeat-x", "elementor"),
|
|
2771
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
3022
|
+
renderContent: ({ size }) => /* @__PURE__ */ React46.createElement(DotsHorizontalIcon, { fontSize: size }),
|
|
2772
3023
|
showTooltip: true
|
|
2773
3024
|
},
|
|
2774
3025
|
{
|
|
2775
3026
|
value: "repeat-y",
|
|
2776
3027
|
label: __16("Repeat-y", "elementor"),
|
|
2777
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
3028
|
+
renderContent: ({ size }) => /* @__PURE__ */ React46.createElement(DotsVerticalIcon, { fontSize: size }),
|
|
2778
3029
|
showTooltip: true
|
|
2779
3030
|
},
|
|
2780
3031
|
{
|
|
2781
3032
|
value: "no-repeat",
|
|
2782
3033
|
label: __16("No-repeat", "elementor"),
|
|
2783
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
3034
|
+
renderContent: ({ size }) => /* @__PURE__ */ React46.createElement(XIcon3, { fontSize: size }),
|
|
2784
3035
|
showTooltip: true
|
|
2785
3036
|
}
|
|
2786
3037
|
];
|
|
2787
3038
|
var BackgroundImageOverlayRepeat = () => {
|
|
2788
|
-
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 })));
|
|
2789
3040
|
};
|
|
2790
3041
|
|
|
2791
3042
|
// src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-size.tsx
|
|
2792
|
-
import * as
|
|
2793
|
-
import {
|
|
3043
|
+
import * as React47 from "react";
|
|
3044
|
+
import { useRef as useRef10 } from "react";
|
|
3045
|
+
import { backgroundImageSizeScalePropTypeUtil, stringPropTypeUtil as stringPropTypeUtil10 } from "@elementor/editor-props";
|
|
2794
3046
|
import {
|
|
2795
3047
|
ArrowBarBothIcon,
|
|
2796
3048
|
ArrowsMaximizeIcon,
|
|
2797
3049
|
ArrowsMoveHorizontalIcon as ArrowsMoveHorizontalIcon2,
|
|
2798
3050
|
ArrowsMoveVerticalIcon as ArrowsMoveVerticalIcon2,
|
|
2799
3051
|
LetterAIcon,
|
|
2800
|
-
PencilIcon
|
|
3052
|
+
PencilIcon as PencilIcon2
|
|
2801
3053
|
} from "@elementor/icons";
|
|
2802
3054
|
import { Grid as Grid13 } from "@elementor/ui";
|
|
2803
3055
|
import { __ as __17 } from "@wordpress/i18n";
|
|
@@ -2805,32 +3057,33 @@ var sizeControlOptions = [
|
|
|
2805
3057
|
{
|
|
2806
3058
|
value: "auto",
|
|
2807
3059
|
label: __17("Auto", "elementor"),
|
|
2808
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
3060
|
+
renderContent: ({ size }) => /* @__PURE__ */ React47.createElement(LetterAIcon, { fontSize: size }),
|
|
2809
3061
|
showTooltip: true
|
|
2810
3062
|
},
|
|
2811
3063
|
{
|
|
2812
3064
|
value: "cover",
|
|
2813
3065
|
label: __17("Cover", "elementor"),
|
|
2814
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
3066
|
+
renderContent: ({ size }) => /* @__PURE__ */ React47.createElement(ArrowsMaximizeIcon, { fontSize: size }),
|
|
2815
3067
|
showTooltip: true
|
|
2816
3068
|
},
|
|
2817
3069
|
{
|
|
2818
3070
|
value: "contain",
|
|
2819
3071
|
label: __17("Contain", "elementor"),
|
|
2820
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
3072
|
+
renderContent: ({ size }) => /* @__PURE__ */ React47.createElement(ArrowBarBothIcon, { fontSize: size }),
|
|
2821
3073
|
showTooltip: true
|
|
2822
3074
|
},
|
|
2823
3075
|
{
|
|
2824
3076
|
value: "custom",
|
|
2825
3077
|
label: __17("Custom", "elementor"),
|
|
2826
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
3078
|
+
renderContent: ({ size }) => /* @__PURE__ */ React47.createElement(PencilIcon2, { fontSize: size }),
|
|
2827
3079
|
showTooltip: true
|
|
2828
3080
|
}
|
|
2829
3081
|
];
|
|
2830
3082
|
var BackgroundImageOverlaySize = () => {
|
|
2831
3083
|
const backgroundImageScaleContext = useBoundProp(backgroundImageSizeScalePropTypeUtil);
|
|
2832
|
-
const stringPropContext = useBoundProp(
|
|
3084
|
+
const stringPropContext = useBoundProp(stringPropTypeUtil10);
|
|
2833
3085
|
const isCustom = !!backgroundImageScaleContext.value;
|
|
3086
|
+
const rowRef = useRef10();
|
|
2834
3087
|
const handleSizeChange = (size) => {
|
|
2835
3088
|
if (size === "custom") {
|
|
2836
3089
|
backgroundImageScaleContext.setValue({ width: null, height: null });
|
|
@@ -2838,31 +3091,34 @@ var BackgroundImageOverlaySize = () => {
|
|
|
2838
3091
|
stringPropContext.setValue(size);
|
|
2839
3092
|
}
|
|
2840
3093
|
};
|
|
2841
|
-
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(
|
|
2842
3095
|
ControlToggleButtonGroup,
|
|
2843
3096
|
{
|
|
2844
3097
|
exclusive: true,
|
|
2845
3098
|
items: sizeControlOptions,
|
|
2846
|
-
|
|
2847
|
-
|
|
3099
|
+
onChange: handleSizeChange,
|
|
3100
|
+
disabled: stringPropContext.disabled,
|
|
3101
|
+
value: backgroundImageScaleContext.value ? "custom" : stringPropContext.value
|
|
2848
3102
|
}
|
|
2849
|
-
)))), 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(
|
|
2850
3104
|
SizeControl,
|
|
2851
3105
|
{
|
|
2852
|
-
startIcon: /* @__PURE__ */
|
|
2853
|
-
|
|
3106
|
+
startIcon: /* @__PURE__ */ React47.createElement(ArrowsMoveHorizontalIcon2, { fontSize: "tiny" }),
|
|
3107
|
+
extendedOptions: ["auto"],
|
|
3108
|
+
anchorRef: rowRef
|
|
2854
3109
|
}
|
|
2855
|
-
))), /* @__PURE__ */
|
|
3110
|
+
))), /* @__PURE__ */ React47.createElement(Grid13, { item: true, xs: 6 }, /* @__PURE__ */ React47.createElement(PropKeyProvider, { bind: "height" }, /* @__PURE__ */ React47.createElement(
|
|
2856
3111
|
SizeControl,
|
|
2857
3112
|
{
|
|
2858
|
-
startIcon: /* @__PURE__ */
|
|
2859
|
-
|
|
3113
|
+
startIcon: /* @__PURE__ */ React47.createElement(ArrowsMoveVerticalIcon2, { fontSize: "tiny" }),
|
|
3114
|
+
extendedOptions: ["auto"],
|
|
3115
|
+
anchorRef: rowRef
|
|
2860
3116
|
}
|
|
2861
3117
|
)))))) : null);
|
|
2862
3118
|
};
|
|
2863
3119
|
|
|
2864
3120
|
// src/controls/background-control/background-overlay/use-background-tabs-history.ts
|
|
2865
|
-
import { useRef as
|
|
3121
|
+
import { useRef as useRef11 } from "react";
|
|
2866
3122
|
import {
|
|
2867
3123
|
backgroundColorOverlayPropTypeUtil,
|
|
2868
3124
|
backgroundGradientOverlayPropTypeUtil as backgroundGradientOverlayPropTypeUtil2,
|
|
@@ -2887,7 +3143,7 @@ var useBackgroundTabsHistory = ({
|
|
|
2887
3143
|
return "image";
|
|
2888
3144
|
};
|
|
2889
3145
|
const { getTabsProps, getTabProps, getTabPanelProps } = useTabs(getCurrentOverlayType());
|
|
2890
|
-
const valuesHistory =
|
|
3146
|
+
const valuesHistory = useRef11({
|
|
2891
3147
|
image: initialBackgroundImageOverlay,
|
|
2892
3148
|
color: initialBackgroundColorOverlay2,
|
|
2893
3149
|
gradient: initialBackgroundGradientOverlay2
|
|
@@ -2962,7 +3218,7 @@ var backgroundResolutionOptions = [
|
|
|
2962
3218
|
];
|
|
2963
3219
|
var BackgroundOverlayRepeaterControl = createControl(() => {
|
|
2964
3220
|
const { propType, value: overlayValues, setValue, disabled } = useBoundProp(backgroundOverlayPropTypeUtil);
|
|
2965
|
-
return /* @__PURE__ */
|
|
3221
|
+
return /* @__PURE__ */ React48.createElement(PropProvider, { propType, value: overlayValues, setValue, disabled }, /* @__PURE__ */ React48.createElement(
|
|
2966
3222
|
Repeater,
|
|
2967
3223
|
{
|
|
2968
3224
|
openOnAdd: true,
|
|
@@ -2980,7 +3236,7 @@ var BackgroundOverlayRepeaterControl = createControl(() => {
|
|
|
2980
3236
|
));
|
|
2981
3237
|
});
|
|
2982
3238
|
var ItemContent2 = ({ anchorEl = null, bind }) => {
|
|
2983
|
-
return /* @__PURE__ */
|
|
3239
|
+
return /* @__PURE__ */ React48.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React48.createElement(Content2, { anchorEl }));
|
|
2984
3240
|
};
|
|
2985
3241
|
var Content2 = ({ anchorEl }) => {
|
|
2986
3242
|
const { getTabsProps, getTabProps, getTabPanelProps } = useBackgroundTabsHistory({
|
|
@@ -2988,7 +3244,7 @@ var Content2 = ({ anchorEl }) => {
|
|
|
2988
3244
|
color: initialBackgroundColorOverlay.value,
|
|
2989
3245
|
gradient: initialBackgroundGradientOverlay.value
|
|
2990
3246
|
});
|
|
2991
|
-
return /* @__PURE__ */
|
|
3247
|
+
return /* @__PURE__ */ React48.createElement(Box6, { sx: { width: "100%" } }, /* @__PURE__ */ React48.createElement(Box6, { sx: { borderBottom: 1, borderColor: "divider" } }, /* @__PURE__ */ React48.createElement(
|
|
2992
3248
|
Tabs,
|
|
2993
3249
|
{
|
|
2994
3250
|
size: "small",
|
|
@@ -2996,19 +3252,19 @@ var Content2 = ({ anchorEl }) => {
|
|
|
2996
3252
|
...getTabsProps(),
|
|
2997
3253
|
"aria-label": __18("Background Overlay", "elementor")
|
|
2998
3254
|
},
|
|
2999
|
-
/* @__PURE__ */
|
|
3000
|
-
/* @__PURE__ */
|
|
3001
|
-
/* @__PURE__ */
|
|
3002
|
-
)), /* @__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 }))));
|
|
3003
3259
|
};
|
|
3004
3260
|
var ItemIcon2 = ({ value }) => {
|
|
3005
3261
|
switch (value.$$type) {
|
|
3006
3262
|
case "background-image-overlay":
|
|
3007
|
-
return /* @__PURE__ */
|
|
3263
|
+
return /* @__PURE__ */ React48.createElement(ItemIconImage, { value });
|
|
3008
3264
|
case "background-color-overlay":
|
|
3009
|
-
return /* @__PURE__ */
|
|
3265
|
+
return /* @__PURE__ */ React48.createElement(ItemIconColor, { value });
|
|
3010
3266
|
case "background-gradient-overlay":
|
|
3011
|
-
return /* @__PURE__ */
|
|
3267
|
+
return /* @__PURE__ */ React48.createElement(ItemIconGradient, { value });
|
|
3012
3268
|
default:
|
|
3013
3269
|
return null;
|
|
3014
3270
|
}
|
|
@@ -3021,11 +3277,11 @@ var extractColorFrom = (prop) => {
|
|
|
3021
3277
|
};
|
|
3022
3278
|
var ItemIconColor = ({ value: prop }) => {
|
|
3023
3279
|
const color = extractColorFrom(prop);
|
|
3024
|
-
return /* @__PURE__ */
|
|
3280
|
+
return /* @__PURE__ */ React48.createElement(StyledUnstableColorIndicator, { size: "inherit", component: "span", value: color });
|
|
3025
3281
|
};
|
|
3026
3282
|
var ItemIconImage = ({ value }) => {
|
|
3027
3283
|
const { imageUrl } = useImage(value);
|
|
3028
|
-
return /* @__PURE__ */
|
|
3284
|
+
return /* @__PURE__ */ React48.createElement(
|
|
3029
3285
|
CardMedia3,
|
|
3030
3286
|
{
|
|
3031
3287
|
image: imageUrl,
|
|
@@ -3040,47 +3296,47 @@ var ItemIconImage = ({ value }) => {
|
|
|
3040
3296
|
};
|
|
3041
3297
|
var ItemIconGradient = ({ value }) => {
|
|
3042
3298
|
const gradient = getGradientValue(value);
|
|
3043
|
-
return /* @__PURE__ */
|
|
3299
|
+
return /* @__PURE__ */ React48.createElement(StyledUnstableColorIndicator, { size: "inherit", component: "span", value: gradient });
|
|
3044
3300
|
};
|
|
3045
3301
|
var ItemLabel2 = ({ value }) => {
|
|
3046
3302
|
switch (value.$$type) {
|
|
3047
3303
|
case "background-image-overlay":
|
|
3048
|
-
return /* @__PURE__ */
|
|
3304
|
+
return /* @__PURE__ */ React48.createElement(ItemLabelImage, { value });
|
|
3049
3305
|
case "background-color-overlay":
|
|
3050
|
-
return /* @__PURE__ */
|
|
3306
|
+
return /* @__PURE__ */ React48.createElement(ItemLabelColor, { value });
|
|
3051
3307
|
case "background-gradient-overlay":
|
|
3052
|
-
return /* @__PURE__ */
|
|
3308
|
+
return /* @__PURE__ */ React48.createElement(ItemLabelGradient, { value });
|
|
3053
3309
|
default:
|
|
3054
3310
|
return null;
|
|
3055
3311
|
}
|
|
3056
3312
|
};
|
|
3057
3313
|
var ItemLabelColor = ({ value: prop }) => {
|
|
3058
3314
|
const color = extractColorFrom(prop);
|
|
3059
|
-
return /* @__PURE__ */
|
|
3315
|
+
return /* @__PURE__ */ React48.createElement("span", null, color);
|
|
3060
3316
|
};
|
|
3061
3317
|
var ItemLabelImage = ({ value }) => {
|
|
3062
3318
|
const { imageTitle } = useImage(value);
|
|
3063
|
-
return /* @__PURE__ */
|
|
3319
|
+
return /* @__PURE__ */ React48.createElement("span", null, imageTitle);
|
|
3064
3320
|
};
|
|
3065
3321
|
var ItemLabelGradient = ({ value }) => {
|
|
3066
3322
|
if (value.value.type.value === "linear") {
|
|
3067
|
-
return /* @__PURE__ */
|
|
3323
|
+
return /* @__PURE__ */ React48.createElement("span", null, __18("Linear Gradient", "elementor"));
|
|
3068
3324
|
}
|
|
3069
|
-
return /* @__PURE__ */
|
|
3325
|
+
return /* @__PURE__ */ React48.createElement("span", null, __18("Radial Gradient", "elementor"));
|
|
3070
3326
|
};
|
|
3071
3327
|
var ColorOverlayContent = ({ anchorEl }) => {
|
|
3072
3328
|
const propContext = useBoundProp(backgroundColorOverlayPropTypeUtil2);
|
|
3073
|
-
return /* @__PURE__ */
|
|
3329
|
+
return /* @__PURE__ */ React48.createElement(PropProvider, { ...propContext }, /* @__PURE__ */ React48.createElement(PropKeyProvider, { bind: "color" }, /* @__PURE__ */ React48.createElement(ColorControl, { anchorEl })));
|
|
3074
3330
|
};
|
|
3075
3331
|
var ImageOverlayContent = () => {
|
|
3076
3332
|
const propContext = useBoundProp(backgroundImageOverlayPropTypeUtil2);
|
|
3077
|
-
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(
|
|
3078
3334
|
ImageControl,
|
|
3079
3335
|
{
|
|
3080
3336
|
resolutionLabel: __18("Resolution", "elementor"),
|
|
3081
3337
|
sizes: backgroundResolutionOptions
|
|
3082
3338
|
}
|
|
3083
|
-
)))), /* @__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)));
|
|
3084
3340
|
};
|
|
3085
3341
|
var StyledUnstableColorIndicator = styled6(UnstableColorIndicator2)(({ theme }) => ({
|
|
3086
3342
|
borderRadius: `${theme.shape.borderRadius / 2}px`
|
|
@@ -3118,13 +3374,13 @@ var getGradientValue = (value) => {
|
|
|
3118
3374
|
// src/controls/background-control/background-control.tsx
|
|
3119
3375
|
var BackgroundControl = createControl(() => {
|
|
3120
3376
|
const propContext = useBoundProp(backgroundPropTypeUtil);
|
|
3121
|
-
const isUsingNestedProps =
|
|
3377
|
+
const isUsingNestedProps = isExperimentActive4("e_v_3_30");
|
|
3122
3378
|
const colorLabel = __19("Color", "elementor");
|
|
3123
|
-
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)))));
|
|
3124
3380
|
});
|
|
3125
3381
|
|
|
3126
3382
|
// src/controls/switch-control.tsx
|
|
3127
|
-
import * as
|
|
3383
|
+
import * as React50 from "react";
|
|
3128
3384
|
import { booleanPropTypeUtil as booleanPropTypeUtil2 } from "@elementor/editor-props";
|
|
3129
3385
|
import { Switch as Switch2 } from "@elementor/ui";
|
|
3130
3386
|
var SwitchControl2 = createControl(() => {
|
|
@@ -3132,7 +3388,7 @@ var SwitchControl2 = createControl(() => {
|
|
|
3132
3388
|
const handleChange = (event) => {
|
|
3133
3389
|
setValue(event.target.checked);
|
|
3134
3390
|
};
|
|
3135
|
-
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 }));
|
|
3136
3392
|
});
|
|
3137
3393
|
export {
|
|
3138
3394
|
AspectRatioControl,
|
|
@@ -3147,6 +3403,7 @@ export {
|
|
|
3147
3403
|
ControlToggleButtonGroup,
|
|
3148
3404
|
EqualUnequalSizesControl,
|
|
3149
3405
|
FontFamilyControl,
|
|
3406
|
+
FontFamilySelector,
|
|
3150
3407
|
GapControl,
|
|
3151
3408
|
ImageControl,
|
|
3152
3409
|
LinkControl,
|