@elementor/editor-controls 0.12.1 → 0.14.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 +24 -0
- package/dist/index.d.mts +6 -3
- package/dist/index.d.ts +6 -3
- package/dist/index.js +497 -304
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +452 -252
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -4
- package/src/components/repeater.tsx +84 -28
- package/src/components/sortable.tsx +108 -0
- package/src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-repeat.tsx +1 -1
- package/src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-size.tsx +8 -2
- package/src/controls/font-family-control.tsx +2 -2
- package/src/controls/gap-control.tsx +1 -1
- package/src/controls/image-control.tsx +1 -1
- package/src/controls/image-media-control.tsx +1 -1
- package/src/controls/link-control.tsx +2 -13
- package/src/controls/linked-dimensions-control.tsx +108 -88
- package/src/controls/size-control.tsx +91 -26
- package/src/controls/svg-media-control.tsx +2 -2
- package/src/index.ts +1 -0
package/dist/index.mjs
CHANGED
|
@@ -289,7 +289,7 @@ var ImageMediaControl = createControl((props) => {
|
|
|
289
289
|
startIcon: /* @__PURE__ */ React8.createElement(UploadIcon, null),
|
|
290
290
|
onClick: () => open({ mode: "upload" })
|
|
291
291
|
},
|
|
292
|
-
__("Upload
|
|
292
|
+
__("Upload", "elementor")
|
|
293
293
|
)))));
|
|
294
294
|
});
|
|
295
295
|
|
|
@@ -322,7 +322,7 @@ var SelectControl = createControl(({ options, onChange }) => {
|
|
|
322
322
|
var ImageControl = createControl(
|
|
323
323
|
({ sizes, resolutionLabel = __2("Image resolution", "elementor") }) => {
|
|
324
324
|
const propContext = useBoundProp(imagePropTypeUtil);
|
|
325
|
-
return /* @__PURE__ */ React10.createElement(PropProvider, { ...propContext }, /* @__PURE__ */ React10.createElement(Stack2, { gap: 1.5 }, /* @__PURE__ */ React10.createElement(PropKeyProvider, { bind: "src" }, /* @__PURE__ */ React10.createElement(ControlLabel, null, " ", __2("
|
|
325
|
+
return /* @__PURE__ */ React10.createElement(PropProvider, { ...propContext }, /* @__PURE__ */ React10.createElement(Stack2, { gap: 1.5 }, /* @__PURE__ */ React10.createElement(PropKeyProvider, { bind: "src" }, /* @__PURE__ */ React10.createElement(ControlLabel, null, " ", __2("Image", "elementor"), " "), /* @__PURE__ */ React10.createElement(ImageMediaControl, null)), /* @__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(ControlLabel, null, " ", resolutionLabel, " ")), /* @__PURE__ */ React10.createElement(Grid, { item: true, xs: 6, sx: { overflow: "hidden" } }, /* @__PURE__ */ React10.createElement(SelectControl, { options: sizes }))))));
|
|
326
326
|
}
|
|
327
327
|
);
|
|
328
328
|
|
|
@@ -370,7 +370,7 @@ var TextAreaControl = createControl(({ placeholder }) => {
|
|
|
370
370
|
|
|
371
371
|
// src/controls/size-control.tsx
|
|
372
372
|
import * as React14 from "react";
|
|
373
|
-
import { sizePropTypeUtil } from "@elementor/editor-props";
|
|
373
|
+
import { sizePropTypeUtil, stringPropTypeUtil as stringPropTypeUtil4 } from "@elementor/editor-props";
|
|
374
374
|
import { InputAdornment as InputAdornment2 } from "@elementor/ui";
|
|
375
375
|
|
|
376
376
|
// src/components/text-field-inner-selection.tsx
|
|
@@ -459,27 +459,74 @@ var useSyncExternalState = ({
|
|
|
459
459
|
var defaultUnits = ["px", "%", "em", "rem", "vw", "vh"];
|
|
460
460
|
var defaultUnit = "px";
|
|
461
461
|
var defaultSize = NaN;
|
|
462
|
-
var SizeControl = createControl(
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
const
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
462
|
+
var SizeControl = createControl(
|
|
463
|
+
({ units: units2 = defaultUnits, extendedValues = [], placeholder, startIcon }) => {
|
|
464
|
+
const { value: sizeValue, setValue: setSizeValue } = useBoundProp(sizePropTypeUtil);
|
|
465
|
+
const [state, setState] = useSyncExternalState({
|
|
466
|
+
external: sizeValue,
|
|
467
|
+
setExternal: setSizeValue,
|
|
468
|
+
persistWhen: (controlValue) => !!controlValue?.size || controlValue?.size === 0,
|
|
469
|
+
fallback: (controlValue) => ({ unit: controlValue?.unit || defaultUnit, size: defaultSize })
|
|
470
|
+
});
|
|
471
|
+
const handleUnitChange = (unit) => {
|
|
472
|
+
setState((prev) => ({
|
|
473
|
+
size: prev?.size ?? defaultSize,
|
|
474
|
+
unit
|
|
475
|
+
}));
|
|
476
|
+
};
|
|
477
|
+
const handleSizeChange = (event) => {
|
|
478
|
+
const { value: size } = event.target;
|
|
479
|
+
setState((prev) => ({
|
|
480
|
+
...prev,
|
|
481
|
+
size: size || size === "0" ? parseFloat(size) : defaultSize
|
|
482
|
+
}));
|
|
483
|
+
};
|
|
484
|
+
const inputProps = {
|
|
485
|
+
size: state.size,
|
|
486
|
+
unit: state.unit,
|
|
487
|
+
placeholder,
|
|
488
|
+
startIcon,
|
|
489
|
+
units: units2,
|
|
490
|
+
extendedValues,
|
|
491
|
+
handleSizeChange,
|
|
492
|
+
handleUnitChange
|
|
493
|
+
};
|
|
494
|
+
if (extendedValues?.length) {
|
|
495
|
+
return /* @__PURE__ */ React14.createElement(ExtendedSizeInput, { ...inputProps });
|
|
496
|
+
}
|
|
497
|
+
return /* @__PURE__ */ React14.createElement(SizeInput, { ...inputProps });
|
|
498
|
+
}
|
|
499
|
+
);
|
|
500
|
+
var ExtendedSizeInput = (props) => {
|
|
501
|
+
const { value: stringValue, setValue: setStringValue } = useBoundProp(stringPropTypeUtil4);
|
|
502
|
+
const { extendedValues = [] } = props;
|
|
503
|
+
const unit = stringValue ?? props.unit;
|
|
504
|
+
const handleUnitChange = (newUnit) => {
|
|
505
|
+
if (extendedValues.includes(newUnit)) {
|
|
506
|
+
setStringValue(newUnit);
|
|
507
|
+
} else {
|
|
508
|
+
props.handleUnitChange(newUnit);
|
|
509
|
+
}
|
|
482
510
|
};
|
|
511
|
+
return /* @__PURE__ */ React14.createElement(
|
|
512
|
+
SizeInput,
|
|
513
|
+
{
|
|
514
|
+
...props,
|
|
515
|
+
units: [...props.units, ...extendedValues],
|
|
516
|
+
handleUnitChange,
|
|
517
|
+
unit
|
|
518
|
+
}
|
|
519
|
+
);
|
|
520
|
+
};
|
|
521
|
+
var SizeInput = ({
|
|
522
|
+
units: units2,
|
|
523
|
+
handleUnitChange,
|
|
524
|
+
handleSizeChange,
|
|
525
|
+
placeholder,
|
|
526
|
+
startIcon,
|
|
527
|
+
size,
|
|
528
|
+
unit
|
|
529
|
+
}) => {
|
|
483
530
|
return /* @__PURE__ */ React14.createElement(ControlActions, null, /* @__PURE__ */ React14.createElement(
|
|
484
531
|
TextFieldInnerSelection,
|
|
485
532
|
{
|
|
@@ -488,17 +535,17 @@ var SizeControl = createControl(({ units: units2 = defaultUnits, placeholder, st
|
|
|
488
535
|
{
|
|
489
536
|
options: units2,
|
|
490
537
|
onClick: handleUnitChange,
|
|
491
|
-
value:
|
|
538
|
+
value: unit ?? defaultUnit
|
|
492
539
|
}
|
|
493
540
|
),
|
|
494
541
|
placeholder,
|
|
495
542
|
startAdornment: startIcon ? /* @__PURE__ */ React14.createElement(InputAdornment2, { position: "start" }, startIcon) : void 0,
|
|
496
543
|
type: "number",
|
|
497
|
-
value: Number.isNaN(
|
|
544
|
+
value: Number.isNaN(size) ? "" : size,
|
|
498
545
|
onChange: handleSizeChange
|
|
499
546
|
}
|
|
500
547
|
));
|
|
501
|
-
}
|
|
548
|
+
};
|
|
502
549
|
|
|
503
550
|
// src/controls/stroke-control.tsx
|
|
504
551
|
import * as React17 from "react";
|
|
@@ -532,7 +579,7 @@ var StrokeControl = createControl(() => {
|
|
|
532
579
|
var Control = ({ bind, label, children }) => /* @__PURE__ */ React17.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React17.createElement(Grid2, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React17.createElement(Grid2, { item: true, xs: 6 }, /* @__PURE__ */ React17.createElement(ControlLabel, null, label)), /* @__PURE__ */ React17.createElement(Grid2, { item: true, xs: 6 }, children)));
|
|
533
580
|
|
|
534
581
|
// src/controls/box-shadow-repeater-control.tsx
|
|
535
|
-
import * as
|
|
582
|
+
import * as React22 from "react";
|
|
536
583
|
import { boxShadowPropTypeUtil, shadowPropTypeUtil } from "@elementor/editor-props";
|
|
537
584
|
import { Grid as Grid4, Typography as Typography3, UnstableColorIndicator } from "@elementor/ui";
|
|
538
585
|
import { __ as __5 } from "@wordpress/i18n";
|
|
@@ -553,7 +600,7 @@ var PopoverGridContainer = ({
|
|
|
553
600
|
}) => /* @__PURE__ */ React19.createElement(Grid3, { container: true, gap, alignItems, flexWrap }, children);
|
|
554
601
|
|
|
555
602
|
// src/components/repeater.tsx
|
|
556
|
-
import * as
|
|
603
|
+
import * as React21 from "react";
|
|
557
604
|
import { useRef, useState as useState2 } from "react";
|
|
558
605
|
import { CopyIcon, EyeIcon, EyeOffIcon, PlusIcon, XIcon } from "@elementor/icons";
|
|
559
606
|
import {
|
|
@@ -568,6 +615,101 @@ import {
|
|
|
568
615
|
usePopupState as usePopupState2
|
|
569
616
|
} from "@elementor/ui";
|
|
570
617
|
import { __ as __4 } from "@wordpress/i18n";
|
|
618
|
+
|
|
619
|
+
// src/components/sortable.tsx
|
|
620
|
+
import * as React20 from "react";
|
|
621
|
+
import { GripVerticalIcon } from "@elementor/icons";
|
|
622
|
+
import {
|
|
623
|
+
Divider,
|
|
624
|
+
List,
|
|
625
|
+
ListItem,
|
|
626
|
+
styled as styled2,
|
|
627
|
+
UnstableSortableItem,
|
|
628
|
+
UnstableSortableProvider
|
|
629
|
+
} from "@elementor/ui";
|
|
630
|
+
var SortableProvider = (props) => {
|
|
631
|
+
return /* @__PURE__ */ React20.createElement(List, { sx: { p: 0, m: 0 } }, /* @__PURE__ */ React20.createElement(
|
|
632
|
+
UnstableSortableProvider,
|
|
633
|
+
{
|
|
634
|
+
restrictAxis: true,
|
|
635
|
+
disableDragOverlay: false,
|
|
636
|
+
variant: "static",
|
|
637
|
+
...props
|
|
638
|
+
}
|
|
639
|
+
));
|
|
640
|
+
};
|
|
641
|
+
var SortableItem = ({ id, children }) => {
|
|
642
|
+
return /* @__PURE__ */ React20.createElement(
|
|
643
|
+
UnstableSortableItem,
|
|
644
|
+
{
|
|
645
|
+
id,
|
|
646
|
+
render: ({
|
|
647
|
+
itemProps,
|
|
648
|
+
triggerProps,
|
|
649
|
+
itemStyle,
|
|
650
|
+
triggerStyle,
|
|
651
|
+
isDragOverlay,
|
|
652
|
+
showDropIndication,
|
|
653
|
+
dropIndicationStyle
|
|
654
|
+
}) => {
|
|
655
|
+
return /* @__PURE__ */ React20.createElement(
|
|
656
|
+
StyledListItem,
|
|
657
|
+
{
|
|
658
|
+
...itemProps,
|
|
659
|
+
style: itemStyle,
|
|
660
|
+
sx: { backgroundColor: isDragOverlay ? "background.paper" : void 0 }
|
|
661
|
+
},
|
|
662
|
+
/* @__PURE__ */ React20.createElement(SortableTrigger, { ...triggerProps, style: triggerStyle }),
|
|
663
|
+
children,
|
|
664
|
+
showDropIndication && /* @__PURE__ */ React20.createElement(StyledDivider, { style: dropIndicationStyle })
|
|
665
|
+
);
|
|
666
|
+
}
|
|
667
|
+
}
|
|
668
|
+
);
|
|
669
|
+
};
|
|
670
|
+
var StyledListItem = styled2(ListItem)`
|
|
671
|
+
position: relative;
|
|
672
|
+
margin-inline: 0px;
|
|
673
|
+
padding-inline: 0px;
|
|
674
|
+
padding-block: ${({ theme }) => theme.spacing(0.5)};
|
|
675
|
+
|
|
676
|
+
& .class-item-sortable-trigger {
|
|
677
|
+
color: ${({ theme }) => theme.palette.action.active};
|
|
678
|
+
height: 100%;
|
|
679
|
+
display: flex;
|
|
680
|
+
align-items: center;
|
|
681
|
+
visibility: hidden;
|
|
682
|
+
position: absolute;
|
|
683
|
+
top: 50%;
|
|
684
|
+
padding-inline-end: ${({ theme }) => theme.spacing(0.5)};
|
|
685
|
+
transform: translate( -75%, -50% );
|
|
686
|
+
}
|
|
687
|
+
|
|
688
|
+
&:hover {
|
|
689
|
+
& .class-item-sortable-trigger {
|
|
690
|
+
visibility: visible;
|
|
691
|
+
}
|
|
692
|
+
}
|
|
693
|
+
`;
|
|
694
|
+
var SortableTrigger = (props) => /* @__PURE__ */ React20.createElement("div", { ...props, role: "button", className: "class-item-sortable-trigger" }, /* @__PURE__ */ React20.createElement(GripVerticalIcon, { fontSize: "tiny" }));
|
|
695
|
+
var StyledDivider = styled2(Divider)`
|
|
696
|
+
height: 0px;
|
|
697
|
+
border: none;
|
|
698
|
+
overflow: visible;
|
|
699
|
+
|
|
700
|
+
&:after {
|
|
701
|
+
--height: 2px;
|
|
702
|
+
content: '';
|
|
703
|
+
display: block;
|
|
704
|
+
width: 100%;
|
|
705
|
+
height: var( --height );
|
|
706
|
+
margin-block: calc( -1 * var( --height ) / 2 );
|
|
707
|
+
border-radius: ${({ theme }) => theme.spacing(0.5)};
|
|
708
|
+
background-color: ${({ theme }) => theme.palette.text.primary};
|
|
709
|
+
}
|
|
710
|
+
`;
|
|
711
|
+
|
|
712
|
+
// src/components/repeater.tsx
|
|
571
713
|
var SIZE = "tiny";
|
|
572
714
|
var Repeater = ({
|
|
573
715
|
label,
|
|
@@ -576,27 +718,50 @@ var Repeater = ({
|
|
|
576
718
|
values: repeaterValues = [],
|
|
577
719
|
setValues: setRepeaterValues
|
|
578
720
|
}) => {
|
|
721
|
+
const [items, setItems] = useSyncExternalState({
|
|
722
|
+
external: repeaterValues,
|
|
723
|
+
// @ts-expect-error - as long as persistWhen => true, value will never be null
|
|
724
|
+
setExternal: setRepeaterValues,
|
|
725
|
+
persistWhen: () => true
|
|
726
|
+
});
|
|
727
|
+
const [uniqueKeys, setUniqueKeys] = useState2(items.map((_, index) => index));
|
|
728
|
+
const generateNextKey = (source) => {
|
|
729
|
+
return 1 + Math.max(0, ...source);
|
|
730
|
+
};
|
|
579
731
|
const addRepeaterItem = () => {
|
|
580
732
|
const newItem = structuredClone(itemSettings.initialValues);
|
|
733
|
+
const newKey = generateNextKey(uniqueKeys);
|
|
581
734
|
if (addToBottom) {
|
|
582
|
-
|
|
735
|
+
setItems([...items, newItem]);
|
|
736
|
+
setUniqueKeys([...uniqueKeys, newKey]);
|
|
737
|
+
} else {
|
|
738
|
+
setItems([newItem, ...items]);
|
|
739
|
+
setUniqueKeys([newKey, ...uniqueKeys]);
|
|
583
740
|
}
|
|
584
|
-
setRepeaterValues([newItem, ...repeaterValues]);
|
|
585
741
|
};
|
|
586
742
|
const duplicateRepeaterItem = (index) => {
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
]);
|
|
743
|
+
const newItem = structuredClone(items[index]);
|
|
744
|
+
const newKey = generateNextKey(uniqueKeys);
|
|
745
|
+
const atPosition = 1 + index;
|
|
746
|
+
setItems([...items.slice(0, atPosition), newItem, ...items.slice(atPosition)]);
|
|
747
|
+
setUniqueKeys([...uniqueKeys.slice(0, atPosition), newKey, ...uniqueKeys.slice(atPosition)]);
|
|
592
748
|
};
|
|
593
749
|
const removeRepeaterItem = (index) => {
|
|
594
|
-
|
|
750
|
+
setUniqueKeys(
|
|
751
|
+
uniqueKeys.filter((_, pos) => {
|
|
752
|
+
return pos !== index;
|
|
753
|
+
})
|
|
754
|
+
);
|
|
755
|
+
setItems(
|
|
756
|
+
items.filter((_, pos) => {
|
|
757
|
+
return pos !== index;
|
|
758
|
+
})
|
|
759
|
+
);
|
|
595
760
|
};
|
|
596
761
|
const toggleDisableRepeaterItem = (index) => {
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
if (
|
|
762
|
+
setItems(
|
|
763
|
+
items.map((value, pos) => {
|
|
764
|
+
if (pos === index) {
|
|
600
765
|
const { disabled, ...rest } = value;
|
|
601
766
|
return { ...rest, ...disabled ? {} : { disabled: true } };
|
|
602
767
|
}
|
|
@@ -604,20 +769,34 @@ var Repeater = ({
|
|
|
604
769
|
})
|
|
605
770
|
);
|
|
606
771
|
};
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
{
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
772
|
+
const onChangeOrder = (reorderedKeys) => {
|
|
773
|
+
setUniqueKeys(reorderedKeys);
|
|
774
|
+
setItems((prevItems) => {
|
|
775
|
+
return reorderedKeys.map((keyValue) => {
|
|
776
|
+
const index = uniqueKeys.indexOf(keyValue);
|
|
777
|
+
return prevItems[index];
|
|
778
|
+
});
|
|
779
|
+
});
|
|
780
|
+
};
|
|
781
|
+
return /* @__PURE__ */ React21.createElement(SectionContent, null, /* @__PURE__ */ React21.createElement(Stack5, { direction: "row", justifyContent: "space-between", alignItems: "center" }, /* @__PURE__ */ React21.createElement(Typography2, { component: "label", variant: "caption", color: "text.secondary" }, label), /* @__PURE__ */ React21.createElement(IconButton, { size: SIZE, onClick: addRepeaterItem, "aria-label": __4("Add item", "elementor") }, /* @__PURE__ */ React21.createElement(PlusIcon, { fontSize: SIZE }))), 0 < uniqueKeys.length && /* @__PURE__ */ React21.createElement(SortableProvider, { value: uniqueKeys, onChange: onChangeOrder }, uniqueKeys.map((key, index) => {
|
|
782
|
+
const value = items[index];
|
|
783
|
+
if (!value) {
|
|
784
|
+
return null;
|
|
785
|
+
}
|
|
786
|
+
return /* @__PURE__ */ React21.createElement(SortableItem, { id: key, key: `sortable-${key}` }, /* @__PURE__ */ React21.createElement(
|
|
787
|
+
RepeaterItem,
|
|
788
|
+
{
|
|
789
|
+
bind: String(index),
|
|
790
|
+
disabled: value?.disabled,
|
|
791
|
+
label: /* @__PURE__ */ React21.createElement(itemSettings.Label, { value }),
|
|
792
|
+
startIcon: /* @__PURE__ */ React21.createElement(itemSettings.Icon, { value }),
|
|
793
|
+
removeItem: () => removeRepeaterItem(index),
|
|
794
|
+
duplicateItem: () => duplicateRepeaterItem(index),
|
|
795
|
+
toggleDisableItem: () => toggleDisableRepeaterItem(index)
|
|
796
|
+
},
|
|
797
|
+
(props) => /* @__PURE__ */ React21.createElement(itemSettings.Content, { ...props, value, bind: String(index) })
|
|
798
|
+
));
|
|
799
|
+
})));
|
|
621
800
|
};
|
|
622
801
|
var RepeaterItem = ({
|
|
623
802
|
label,
|
|
@@ -634,43 +813,45 @@ var RepeaterItem = ({
|
|
|
634
813
|
const [anchorEl, setAnchorEl] = useState2(null);
|
|
635
814
|
const popoverState = usePopupState2({ popupId, variant: "popover" });
|
|
636
815
|
const popoverProps = bindPopover(popoverState);
|
|
637
|
-
return /* @__PURE__ */
|
|
816
|
+
return /* @__PURE__ */ React21.createElement(React21.Fragment, null, /* @__PURE__ */ React21.createElement(
|
|
638
817
|
UnstableTag,
|
|
639
818
|
{
|
|
640
819
|
label,
|
|
641
820
|
showActionsOnHover: true,
|
|
821
|
+
fullWidth: true,
|
|
642
822
|
ref: controlRef,
|
|
643
823
|
variant: "outlined",
|
|
644
824
|
"aria-label": __4("Open item", "elementor"),
|
|
645
825
|
...bindTrigger2(popoverState),
|
|
646
826
|
startIcon,
|
|
647
|
-
actions: /* @__PURE__ */
|
|
827
|
+
actions: /* @__PURE__ */ React21.createElement(React21.Fragment, null, /* @__PURE__ */ React21.createElement(
|
|
648
828
|
IconButton,
|
|
649
829
|
{
|
|
650
830
|
size: SIZE,
|
|
651
831
|
onClick: duplicateItem,
|
|
652
832
|
"aria-label": __4("Duplicate item", "elementor")
|
|
653
833
|
},
|
|
654
|
-
/* @__PURE__ */
|
|
655
|
-
), /* @__PURE__ */
|
|
834
|
+
/* @__PURE__ */ React21.createElement(CopyIcon, { fontSize: SIZE })
|
|
835
|
+
), /* @__PURE__ */ React21.createElement(
|
|
656
836
|
IconButton,
|
|
657
837
|
{
|
|
658
838
|
size: SIZE,
|
|
659
839
|
onClick: toggleDisableItem,
|
|
660
840
|
"aria-label": disabled ? __4("Enable item", "elementor") : __4("Disable item", "elementor")
|
|
661
841
|
},
|
|
662
|
-
disabled ? /* @__PURE__ */
|
|
663
|
-
), /* @__PURE__ */
|
|
842
|
+
disabled ? /* @__PURE__ */ React21.createElement(EyeOffIcon, { fontSize: SIZE }) : /* @__PURE__ */ React21.createElement(EyeIcon, { fontSize: SIZE })
|
|
843
|
+
), /* @__PURE__ */ React21.createElement(
|
|
664
844
|
IconButton,
|
|
665
845
|
{
|
|
666
846
|
size: SIZE,
|
|
667
847
|
onClick: removeItem,
|
|
668
848
|
"aria-label": __4("Remove item", "elementor")
|
|
669
849
|
},
|
|
670
|
-
/* @__PURE__ */
|
|
671
|
-
))
|
|
850
|
+
/* @__PURE__ */ React21.createElement(XIcon, { fontSize: SIZE })
|
|
851
|
+
)),
|
|
852
|
+
sx: { backgroundColor: "background.paper" }
|
|
672
853
|
}
|
|
673
|
-
), /* @__PURE__ */
|
|
854
|
+
), /* @__PURE__ */ React21.createElement(
|
|
674
855
|
Popover,
|
|
675
856
|
{
|
|
676
857
|
disablePortal: true,
|
|
@@ -683,14 +864,14 @@ var RepeaterItem = ({
|
|
|
683
864
|
anchorOrigin: { vertical: "bottom", horizontal: "left" },
|
|
684
865
|
...popoverProps
|
|
685
866
|
},
|
|
686
|
-
/* @__PURE__ */
|
|
867
|
+
/* @__PURE__ */ React21.createElement(Box, null, children({ anchorEl }))
|
|
687
868
|
));
|
|
688
869
|
};
|
|
689
870
|
|
|
690
871
|
// src/controls/box-shadow-repeater-control.tsx
|
|
691
872
|
var BoxShadowRepeaterControl = createControl(() => {
|
|
692
873
|
const { propType, value, setValue } = useBoundProp(boxShadowPropTypeUtil);
|
|
693
|
-
return /* @__PURE__ */
|
|
874
|
+
return /* @__PURE__ */ React22.createElement(PropProvider, { propType, value, setValue }, /* @__PURE__ */ React22.createElement(
|
|
694
875
|
Repeater,
|
|
695
876
|
{
|
|
696
877
|
values: value ?? [],
|
|
@@ -705,13 +886,13 @@ var BoxShadowRepeaterControl = createControl(() => {
|
|
|
705
886
|
}
|
|
706
887
|
));
|
|
707
888
|
});
|
|
708
|
-
var ItemIcon = ({ value }) => /* @__PURE__ */
|
|
889
|
+
var ItemIcon = ({ value }) => /* @__PURE__ */ React22.createElement(UnstableColorIndicator, { size: "inherit", component: "span", value: value.value.color.value });
|
|
709
890
|
var ItemContent = ({ anchorEl, bind }) => {
|
|
710
|
-
return /* @__PURE__ */
|
|
891
|
+
return /* @__PURE__ */ React22.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React22.createElement(Content, { anchorEl }));
|
|
711
892
|
};
|
|
712
893
|
var Content = ({ anchorEl }) => {
|
|
713
894
|
const { propType, value, setValue } = useBoundProp(shadowPropTypeUtil);
|
|
714
|
-
return /* @__PURE__ */
|
|
895
|
+
return /* @__PURE__ */ React22.createElement(PropProvider, { propType, value, setValue }, /* @__PURE__ */ React22.createElement(PopoverContent, { p: 1.5 }, /* @__PURE__ */ React22.createElement(PopoverGridContainer, null, /* @__PURE__ */ React22.createElement(Control2, { bind: "color", label: __5("Color", "elementor") }, /* @__PURE__ */ React22.createElement(
|
|
715
896
|
ColorControl,
|
|
716
897
|
{
|
|
717
898
|
slotProps: {
|
|
@@ -728,7 +909,7 @@ var Content = ({ anchorEl }) => {
|
|
|
728
909
|
}
|
|
729
910
|
}
|
|
730
911
|
}
|
|
731
|
-
)), /* @__PURE__ */
|
|
912
|
+
)), /* @__PURE__ */ React22.createElement(Control2, { bind: "position", label: __5("Position", "elementor") }, /* @__PURE__ */ React22.createElement(
|
|
732
913
|
SelectControl,
|
|
733
914
|
{
|
|
734
915
|
options: [
|
|
@@ -736,9 +917,9 @@ var Content = ({ anchorEl }) => {
|
|
|
736
917
|
{ label: __5("Outset", "elementor"), value: null }
|
|
737
918
|
]
|
|
738
919
|
}
|
|
739
|
-
))), /* @__PURE__ */
|
|
920
|
+
))), /* @__PURE__ */ React22.createElement(PopoverGridContainer, null, /* @__PURE__ */ React22.createElement(Control2, { bind: "hOffset", label: __5("Horizontal", "elementor") }, /* @__PURE__ */ React22.createElement(SizeControl, null)), /* @__PURE__ */ React22.createElement(Control2, { bind: "vOffset", label: __5("Vertical", "elementor") }, /* @__PURE__ */ React22.createElement(SizeControl, null))), /* @__PURE__ */ React22.createElement(PopoverGridContainer, null, /* @__PURE__ */ React22.createElement(Control2, { bind: "blur", label: __5("Blur", "elementor") }, /* @__PURE__ */ React22.createElement(SizeControl, null)), /* @__PURE__ */ React22.createElement(Control2, { bind: "spread", label: __5("Spread", "elementor") }, /* @__PURE__ */ React22.createElement(SizeControl, null)))));
|
|
740
921
|
};
|
|
741
|
-
var Control2 = ({ label, bind, children }) => /* @__PURE__ */
|
|
922
|
+
var Control2 = ({ label, bind, children }) => /* @__PURE__ */ React22.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React22.createElement(Grid4, { item: true, xs: 6, sx: { overflow: "hidden" } }, /* @__PURE__ */ React22.createElement(Grid4, { container: true, gap: 1, alignItems: "center" }, /* @__PURE__ */ React22.createElement(Grid4, { item: true, xs: 12 }, /* @__PURE__ */ React22.createElement(Typography3, { component: "label", variant: "caption", color: "text.secondary" }, label)), /* @__PURE__ */ React22.createElement(Grid4, { item: true, xs: 12 }, children))));
|
|
742
923
|
var ItemLabel = ({ value }) => {
|
|
743
924
|
const { position, hOffset, vOffset, blur, spread } = value.value;
|
|
744
925
|
const { size: blurSize = "", unit: blurUnit = "" } = blur?.value || {};
|
|
@@ -752,7 +933,7 @@ var ItemLabel = ({ value }) => {
|
|
|
752
933
|
blurSize + blurUnit,
|
|
753
934
|
spreadSize + spreadUnit
|
|
754
935
|
].join(" ");
|
|
755
|
-
return /* @__PURE__ */
|
|
936
|
+
return /* @__PURE__ */ React22.createElement("span", { style: { textTransform: "capitalize" } }, positionLabel, ": ", sizes);
|
|
756
937
|
};
|
|
757
938
|
var initialShadow = {
|
|
758
939
|
$$type: "shadow",
|
|
@@ -782,19 +963,19 @@ var initialShadow = {
|
|
|
782
963
|
};
|
|
783
964
|
|
|
784
965
|
// src/controls/toggle-control.tsx
|
|
785
|
-
import * as
|
|
786
|
-
import { stringPropTypeUtil as
|
|
966
|
+
import * as React24 from "react";
|
|
967
|
+
import { stringPropTypeUtil as stringPropTypeUtil5 } from "@elementor/editor-props";
|
|
787
968
|
|
|
788
969
|
// src/components/control-toggle-button-group.tsx
|
|
789
|
-
import * as
|
|
970
|
+
import * as React23 from "react";
|
|
790
971
|
import {
|
|
791
|
-
styled as
|
|
972
|
+
styled as styled3,
|
|
792
973
|
ToggleButton,
|
|
793
974
|
ToggleButtonGroup,
|
|
794
975
|
Tooltip,
|
|
795
976
|
useTheme
|
|
796
977
|
} from "@elementor/ui";
|
|
797
|
-
var StyledToggleButtonGroup =
|
|
978
|
+
var StyledToggleButtonGroup = styled3(ToggleButtonGroup)`
|
|
798
979
|
${({ justify }) => `justify-content: ${justify};`}
|
|
799
980
|
`;
|
|
800
981
|
var ControlToggleButtonGroup = ({
|
|
@@ -810,7 +991,7 @@ var ControlToggleButtonGroup = ({
|
|
|
810
991
|
const handleChange = (_, newValue) => {
|
|
811
992
|
onChange(newValue);
|
|
812
993
|
};
|
|
813
|
-
return /* @__PURE__ */
|
|
994
|
+
return /* @__PURE__ */ React23.createElement(
|
|
814
995
|
StyledToggleButtonGroup,
|
|
815
996
|
{
|
|
816
997
|
justify,
|
|
@@ -822,7 +1003,7 @@ var ControlToggleButtonGroup = ({
|
|
|
822
1003
|
}
|
|
823
1004
|
},
|
|
824
1005
|
items.map(
|
|
825
|
-
({ label, value: buttonValue, renderContent: Content3, showTooltip }) => showTooltip ? /* @__PURE__ */
|
|
1006
|
+
({ label, value: buttonValue, renderContent: Content3, showTooltip }) => showTooltip ? /* @__PURE__ */ React23.createElement(Tooltip, { key: buttonValue, title: label, disableFocusListener: true, placement: "top" }, /* @__PURE__ */ React23.createElement(ToggleButton, { value: buttonValue, "aria-label": label, size, fullWidth }, /* @__PURE__ */ React23.createElement(Content3, { size }))) : /* @__PURE__ */ React23.createElement(
|
|
826
1007
|
ToggleButton,
|
|
827
1008
|
{
|
|
828
1009
|
key: buttonValue,
|
|
@@ -831,7 +1012,7 @@ var ControlToggleButtonGroup = ({
|
|
|
831
1012
|
size,
|
|
832
1013
|
fullWidth
|
|
833
1014
|
},
|
|
834
|
-
/* @__PURE__ */
|
|
1015
|
+
/* @__PURE__ */ React23.createElement(Content3, { size })
|
|
835
1016
|
)
|
|
836
1017
|
)
|
|
837
1018
|
);
|
|
@@ -840,11 +1021,11 @@ var ControlToggleButtonGroup = ({
|
|
|
840
1021
|
// src/controls/toggle-control.tsx
|
|
841
1022
|
var ToggleControl = createControl(
|
|
842
1023
|
({ options, fullWidth = false, size = "tiny" }) => {
|
|
843
|
-
const { value, setValue } = useBoundProp(
|
|
1024
|
+
const { value, setValue } = useBoundProp(stringPropTypeUtil5);
|
|
844
1025
|
const handleToggle = (option) => {
|
|
845
1026
|
setValue(option);
|
|
846
1027
|
};
|
|
847
|
-
return /* @__PURE__ */
|
|
1028
|
+
return /* @__PURE__ */ React24.createElement(
|
|
848
1029
|
ControlToggleButtonGroup,
|
|
849
1030
|
{
|
|
850
1031
|
items: options,
|
|
@@ -859,7 +1040,7 @@ var ToggleControl = createControl(
|
|
|
859
1040
|
);
|
|
860
1041
|
|
|
861
1042
|
// src/controls/number-control.tsx
|
|
862
|
-
import * as
|
|
1043
|
+
import * as React25 from "react";
|
|
863
1044
|
import { numberPropTypeUtil } from "@elementor/editor-props";
|
|
864
1045
|
import { TextField as TextField4 } from "@elementor/ui";
|
|
865
1046
|
var isEmptyOrNaN = (value) => value === null || value === void 0 || value === "" || Number.isNaN(Number(value));
|
|
@@ -881,7 +1062,7 @@ var NumberControl = createControl(
|
|
|
881
1062
|
const formattedValue = shouldForceInt ? +parseInt(eventValue) : Number(eventValue);
|
|
882
1063
|
setValue(Math.min(Math.max(formattedValue, min), max));
|
|
883
1064
|
};
|
|
884
|
-
return /* @__PURE__ */
|
|
1065
|
+
return /* @__PURE__ */ React25.createElement(ControlActions, null, /* @__PURE__ */ React25.createElement(
|
|
885
1066
|
TextField4,
|
|
886
1067
|
{
|
|
887
1068
|
size: "tiny",
|
|
@@ -897,7 +1078,7 @@ var NumberControl = createControl(
|
|
|
897
1078
|
);
|
|
898
1079
|
|
|
899
1080
|
// src/controls/equal-unequal-sizes-control.tsx
|
|
900
|
-
import * as
|
|
1081
|
+
import * as React26 from "react";
|
|
901
1082
|
import { useId as useId2, useRef as useRef2 } from "react";
|
|
902
1083
|
import { sizePropTypeUtil as sizePropTypeUtil2 } from "@elementor/editor-props";
|
|
903
1084
|
import { bindPopover as bindPopover2, bindToggle, Grid as Grid5, Popover as Popover2, Stack as Stack6, ToggleButton as ToggleButton2, usePopupState as usePopupState3 } from "@elementor/ui";
|
|
@@ -954,7 +1135,7 @@ function EqualUnequalSizesControl({
|
|
|
954
1135
|
return splitEqualValue() ?? null;
|
|
955
1136
|
};
|
|
956
1137
|
const isMixed = !!multiSizeValue;
|
|
957
|
-
return /* @__PURE__ */
|
|
1138
|
+
return /* @__PURE__ */ React26.createElement(React26.Fragment, null, /* @__PURE__ */ React26.createElement(Grid5, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap", ref: controlRef }, /* @__PURE__ */ React26.createElement(Grid5, { item: true, xs: 6 }, /* @__PURE__ */ React26.createElement(ControlLabel, null, label)), /* @__PURE__ */ React26.createElement(Grid5, { item: true, xs: 6 }, /* @__PURE__ */ React26.createElement(Stack6, { direction: "row", alignItems: "center", gap: 1 }, /* @__PURE__ */ React26.createElement(SizeControl, { placeholder: isMixed ? __6("Mixed", "elementor") : void 0 }), /* @__PURE__ */ React26.createElement(
|
|
958
1139
|
ToggleButton2,
|
|
959
1140
|
{
|
|
960
1141
|
size: "tiny",
|
|
@@ -964,7 +1145,7 @@ function EqualUnequalSizesControl({
|
|
|
964
1145
|
selected: popupState.isOpen
|
|
965
1146
|
},
|
|
966
1147
|
icon
|
|
967
|
-
)))), /* @__PURE__ */
|
|
1148
|
+
)))), /* @__PURE__ */ React26.createElement(
|
|
968
1149
|
Popover2,
|
|
969
1150
|
{
|
|
970
1151
|
disablePortal: true,
|
|
@@ -982,93 +1163,108 @@ function EqualUnequalSizesControl({
|
|
|
982
1163
|
paper: { sx: { mt: 0.5, width: controlRef.current?.getBoundingClientRect().width } }
|
|
983
1164
|
}
|
|
984
1165
|
},
|
|
985
|
-
/* @__PURE__ */
|
|
1166
|
+
/* @__PURE__ */ React26.createElement(PropProvider, { propType: multiSizePropType, value: getMultiSizeValues(), setValue: setNestedProp }, /* @__PURE__ */ React26.createElement(PopoverContent, { p: 1.5 }, /* @__PURE__ */ React26.createElement(PopoverGridContainer, null, /* @__PURE__ */ React26.createElement(MultiSizeValueControl, { item: items[0] }), /* @__PURE__ */ React26.createElement(MultiSizeValueControl, { item: items[1] })), /* @__PURE__ */ React26.createElement(PopoverGridContainer, null, /* @__PURE__ */ React26.createElement(MultiSizeValueControl, { item: items[3] }), /* @__PURE__ */ React26.createElement(MultiSizeValueControl, { item: items[2] }))))
|
|
986
1167
|
));
|
|
987
1168
|
}
|
|
988
|
-
var MultiSizeValueControl = ({ item }) => /* @__PURE__ */
|
|
1169
|
+
var MultiSizeValueControl = ({ item }) => /* @__PURE__ */ React26.createElement(PropKeyProvider, { bind: item.bind }, /* @__PURE__ */ React26.createElement(Grid5, { item: true, xs: 6 }, /* @__PURE__ */ React26.createElement(Grid5, { container: true, gap: 1, alignItems: "center" }, /* @__PURE__ */ React26.createElement(Grid5, { item: true, xs: 12 }, /* @__PURE__ */ React26.createElement(ControlLabel, null, item.label)), /* @__PURE__ */ React26.createElement(Grid5, { item: true, xs: 12 }, /* @__PURE__ */ React26.createElement(SizeControl, { startIcon: item.icon })))));
|
|
989
1170
|
|
|
990
1171
|
// src/controls/linked-dimensions-control.tsx
|
|
991
|
-
import * as
|
|
1172
|
+
import * as React27 from "react";
|
|
992
1173
|
import { dimensionsPropTypeUtil, sizePropTypeUtil as sizePropTypeUtil3 } from "@elementor/editor-props";
|
|
993
1174
|
import { DetachIcon, LinkIcon, SideBottomIcon, SideLeftIcon, SideRightIcon, SideTopIcon } from "@elementor/icons";
|
|
994
1175
|
import { Grid as Grid6, Stack as Stack7, ToggleButton as ToggleButton3 } from "@elementor/ui";
|
|
995
1176
|
import { __ as __7 } from "@wordpress/i18n";
|
|
996
|
-
var LinkedDimensionsControl = createControl(
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
const
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
}
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
})
|
|
1055
|
-
|
|
1177
|
+
var LinkedDimensionsControl = createControl(
|
|
1178
|
+
({ label, extendedValues }) => {
|
|
1179
|
+
const {
|
|
1180
|
+
value: dimensionsValue,
|
|
1181
|
+
setValue: setDimensionsValue,
|
|
1182
|
+
propType
|
|
1183
|
+
} = useBoundProp(dimensionsPropTypeUtil);
|
|
1184
|
+
const { value: sizeValue, setValue: setSizeValue } = useBoundProp(sizePropTypeUtil3);
|
|
1185
|
+
const isLinked = !dimensionsValue && !sizeValue ? true : !!sizeValue;
|
|
1186
|
+
const onLinkToggle = () => {
|
|
1187
|
+
if (!isLinked) {
|
|
1188
|
+
setSizeValue(dimensionsValue?.top?.value);
|
|
1189
|
+
return;
|
|
1190
|
+
}
|
|
1191
|
+
const value = sizeValue ? sizePropTypeUtil3.create(sizeValue) : null;
|
|
1192
|
+
setDimensionsValue({
|
|
1193
|
+
top: value,
|
|
1194
|
+
right: value,
|
|
1195
|
+
bottom: value,
|
|
1196
|
+
left: value
|
|
1197
|
+
});
|
|
1198
|
+
};
|
|
1199
|
+
const LinkedIcon = isLinked ? LinkIcon : DetachIcon;
|
|
1200
|
+
return /* @__PURE__ */ React27.createElement(PropProvider, { propType, value: dimensionsValue, setValue: setDimensionsValue }, /* @__PURE__ */ React27.createElement(Stack7, { direction: "row", gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React27.createElement(ControlLabel, null, label), /* @__PURE__ */ React27.createElement(
|
|
1201
|
+
ToggleButton3,
|
|
1202
|
+
{
|
|
1203
|
+
"aria-label": __7("Link Inputs", "elementor"),
|
|
1204
|
+
size: "tiny",
|
|
1205
|
+
value: "check",
|
|
1206
|
+
selected: isLinked,
|
|
1207
|
+
sx: { marginLeft: "auto" },
|
|
1208
|
+
onChange: onLinkToggle
|
|
1209
|
+
},
|
|
1210
|
+
/* @__PURE__ */ React27.createElement(LinkedIcon, { fontSize: "tiny" })
|
|
1211
|
+
)), /* @__PURE__ */ React27.createElement(Stack7, { direction: "row", gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React27.createElement(Grid6, { container: true, gap: 1, alignItems: "center" }, /* @__PURE__ */ React27.createElement(Grid6, { item: true, xs: 12 }, /* @__PURE__ */ React27.createElement(ControlLabel, null, __7("Top", "elementor"))), /* @__PURE__ */ React27.createElement(Grid6, { item: true, xs: 12 }, /* @__PURE__ */ React27.createElement(
|
|
1212
|
+
Control3,
|
|
1213
|
+
{
|
|
1214
|
+
bind: "top",
|
|
1215
|
+
startIcon: /* @__PURE__ */ React27.createElement(SideTopIcon, { fontSize: "tiny" }),
|
|
1216
|
+
isLinked,
|
|
1217
|
+
extendedValues
|
|
1218
|
+
}
|
|
1219
|
+
))), /* @__PURE__ */ React27.createElement(Grid6, { container: true, gap: 1, alignItems: "center" }, /* @__PURE__ */ React27.createElement(Grid6, { item: true, xs: 12 }, /* @__PURE__ */ React27.createElement(ControlLabel, null, __7("Right", "elementor"))), /* @__PURE__ */ React27.createElement(Grid6, { item: true, xs: 12 }, /* @__PURE__ */ React27.createElement(
|
|
1220
|
+
Control3,
|
|
1221
|
+
{
|
|
1222
|
+
bind: "right",
|
|
1223
|
+
startIcon: /* @__PURE__ */ React27.createElement(SideRightIcon, { fontSize: "tiny" }),
|
|
1224
|
+
isLinked,
|
|
1225
|
+
extendedValues
|
|
1226
|
+
}
|
|
1227
|
+
)))), /* @__PURE__ */ React27.createElement(Stack7, { direction: "row", gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React27.createElement(Grid6, { container: true, gap: 1, alignItems: "center" }, /* @__PURE__ */ React27.createElement(Grid6, { item: true, xs: 12 }, /* @__PURE__ */ React27.createElement(ControlLabel, null, __7("Bottom", "elementor"))), /* @__PURE__ */ React27.createElement(Grid6, { item: true, xs: 12 }, /* @__PURE__ */ React27.createElement(
|
|
1228
|
+
Control3,
|
|
1229
|
+
{
|
|
1230
|
+
bind: "bottom",
|
|
1231
|
+
startIcon: /* @__PURE__ */ React27.createElement(SideBottomIcon, { fontSize: "tiny" }),
|
|
1232
|
+
isLinked,
|
|
1233
|
+
extendedValues
|
|
1234
|
+
}
|
|
1235
|
+
))), /* @__PURE__ */ React27.createElement(Grid6, { container: true, gap: 1, alignItems: "center" }, /* @__PURE__ */ React27.createElement(Grid6, { item: true, xs: 12 }, /* @__PURE__ */ React27.createElement(ControlLabel, null, __7("Left", "elementor"))), /* @__PURE__ */ React27.createElement(Grid6, { item: true, xs: 12 }, /* @__PURE__ */ React27.createElement(
|
|
1236
|
+
Control3,
|
|
1237
|
+
{
|
|
1238
|
+
bind: "left",
|
|
1239
|
+
startIcon: /* @__PURE__ */ React27.createElement(SideLeftIcon, { fontSize: "tiny" }),
|
|
1240
|
+
isLinked,
|
|
1241
|
+
extendedValues
|
|
1242
|
+
}
|
|
1243
|
+
)))));
|
|
1244
|
+
}
|
|
1245
|
+
);
|
|
1246
|
+
var Control3 = ({
|
|
1247
|
+
bind,
|
|
1248
|
+
startIcon,
|
|
1249
|
+
isLinked,
|
|
1250
|
+
extendedValues
|
|
1251
|
+
}) => {
|
|
1056
1252
|
if (isLinked) {
|
|
1057
|
-
return /* @__PURE__ */
|
|
1253
|
+
return /* @__PURE__ */ React27.createElement(SizeControl, { startIcon, extendedValues });
|
|
1058
1254
|
}
|
|
1059
|
-
return /* @__PURE__ */
|
|
1255
|
+
return /* @__PURE__ */ React27.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React27.createElement(SizeControl, { startIcon, extendedValues }));
|
|
1060
1256
|
};
|
|
1061
1257
|
|
|
1062
1258
|
// src/controls/font-family-control.tsx
|
|
1063
1259
|
import { Fragment as Fragment4, useId as useId3, useState as useState3 } from "react";
|
|
1064
|
-
import * as
|
|
1065
|
-
import { stringPropTypeUtil as
|
|
1260
|
+
import * as React28 from "react";
|
|
1261
|
+
import { stringPropTypeUtil as stringPropTypeUtil6 } from "@elementor/editor-props";
|
|
1066
1262
|
import { ChevronDownIcon, EditIcon, PhotoIcon, SearchIcon, XIcon as XIcon2 } from "@elementor/icons";
|
|
1067
1263
|
import {
|
|
1068
1264
|
bindPopover as bindPopover3,
|
|
1069
1265
|
bindTrigger as bindTrigger3,
|
|
1070
1266
|
Box as Box2,
|
|
1071
|
-
Divider,
|
|
1267
|
+
Divider as Divider2,
|
|
1072
1268
|
IconButton as IconButton2,
|
|
1073
1269
|
InputAdornment as InputAdornment3,
|
|
1074
1270
|
Link,
|
|
@@ -1118,7 +1314,7 @@ var useFilteredFontFamilies = (fontFamilies, searchValue) => {
|
|
|
1118
1314
|
var SIZE2 = "tiny";
|
|
1119
1315
|
var FontFamilyControl = createControl(({ fontFamilies }) => {
|
|
1120
1316
|
const [searchValue, setSearchValue] = useState3("");
|
|
1121
|
-
const { value: fontFamily, setValue: setFontFamily } = useBoundProp(
|
|
1317
|
+
const { value: fontFamily, setValue: setFontFamily } = useBoundProp(stringPropTypeUtil6);
|
|
1122
1318
|
const popupId = useId3();
|
|
1123
1319
|
const popoverState = usePopupState4({ variant: "popover", popupId });
|
|
1124
1320
|
const filteredFontFamilies = useFilteredFontFamilies(fontFamilies, searchValue);
|
|
@@ -1132,16 +1328,16 @@ var FontFamilyControl = createControl(({ fontFamilies }) => {
|
|
|
1132
1328
|
setSearchValue("");
|
|
1133
1329
|
popoverState.close();
|
|
1134
1330
|
};
|
|
1135
|
-
return /* @__PURE__ */
|
|
1331
|
+
return /* @__PURE__ */ React28.createElement(React28.Fragment, null, /* @__PURE__ */ React28.createElement(
|
|
1136
1332
|
UnstableTag2,
|
|
1137
1333
|
{
|
|
1138
1334
|
variant: "outlined",
|
|
1139
1335
|
label: fontFamily,
|
|
1140
|
-
endIcon: /* @__PURE__ */
|
|
1336
|
+
endIcon: /* @__PURE__ */ React28.createElement(ChevronDownIcon, { fontSize: "tiny" }),
|
|
1141
1337
|
...bindTrigger3(popoverState),
|
|
1142
1338
|
fullWidth: true
|
|
1143
1339
|
}
|
|
1144
|
-
), /* @__PURE__ */
|
|
1340
|
+
), /* @__PURE__ */ React28.createElement(
|
|
1145
1341
|
Popover3,
|
|
1146
1342
|
{
|
|
1147
1343
|
disablePortal: true,
|
|
@@ -1150,19 +1346,19 @@ var FontFamilyControl = createControl(({ fontFamilies }) => {
|
|
|
1150
1346
|
...bindPopover3(popoverState),
|
|
1151
1347
|
onClose: handleClose
|
|
1152
1348
|
},
|
|
1153
|
-
/* @__PURE__ */
|
|
1349
|
+
/* @__PURE__ */ React28.createElement(Stack8, null, /* @__PURE__ */ React28.createElement(Stack8, { direction: "row", alignItems: "center", pl: 1.5, pr: 0.5, py: 1.5 }, /* @__PURE__ */ React28.createElement(EditIcon, { fontSize: SIZE2, sx: { mr: 0.5 } }), /* @__PURE__ */ React28.createElement(Typography4, { variant: "subtitle2" }, __9("Font family", "elementor")), /* @__PURE__ */ React28.createElement(IconButton2, { size: SIZE2, sx: { ml: "auto" }, onClick: handleClose }, /* @__PURE__ */ React28.createElement(XIcon2, { fontSize: SIZE2 }))), /* @__PURE__ */ React28.createElement(Box2, { px: 1.5, pb: 1 }, /* @__PURE__ */ React28.createElement(
|
|
1154
1350
|
TextField5,
|
|
1155
1351
|
{
|
|
1156
1352
|
fullWidth: true,
|
|
1157
1353
|
size: SIZE2,
|
|
1158
1354
|
value: searchValue,
|
|
1159
|
-
placeholder: __9("Search", "elementor"),
|
|
1355
|
+
placeholder: __9("Search fonts\u2026", "elementor"),
|
|
1160
1356
|
onChange: handleSearch,
|
|
1161
1357
|
InputProps: {
|
|
1162
|
-
startAdornment: /* @__PURE__ */
|
|
1358
|
+
startAdornment: /* @__PURE__ */ React28.createElement(InputAdornment3, { position: "start" }, /* @__PURE__ */ React28.createElement(SearchIcon, { fontSize: SIZE2 }))
|
|
1163
1359
|
}
|
|
1164
1360
|
}
|
|
1165
|
-
)), /* @__PURE__ */
|
|
1361
|
+
)), /* @__PURE__ */ React28.createElement(Divider2, null), /* @__PURE__ */ React28.createElement(Box2, { sx: { overflowY: "auto", height: 260, width: 220 } }, filteredFontFamilies.length > 0 ? /* @__PURE__ */ React28.createElement(MenuList, { role: "listbox", tabIndex: 0 }, filteredFontFamilies.map(([category, items], index) => /* @__PURE__ */ React28.createElement(Fragment4, { key: index }, /* @__PURE__ */ React28.createElement(
|
|
1166
1362
|
ListSubheader,
|
|
1167
1363
|
{
|
|
1168
1364
|
sx: { px: 1.5, typography: "caption", color: "text.tertiary" }
|
|
@@ -1170,7 +1366,7 @@ var FontFamilyControl = createControl(({ fontFamilies }) => {
|
|
|
1170
1366
|
category
|
|
1171
1367
|
), items.map((item) => {
|
|
1172
1368
|
const isSelected = item === fontFamily;
|
|
1173
|
-
return /* @__PURE__ */
|
|
1369
|
+
return /* @__PURE__ */ React28.createElement(
|
|
1174
1370
|
MenuItem3,
|
|
1175
1371
|
{
|
|
1176
1372
|
key: item,
|
|
@@ -1185,7 +1381,7 @@ var FontFamilyControl = createControl(({ fontFamilies }) => {
|
|
|
1185
1381
|
},
|
|
1186
1382
|
item
|
|
1187
1383
|
);
|
|
1188
|
-
})))) : /* @__PURE__ */
|
|
1384
|
+
})))) : /* @__PURE__ */ React28.createElement(Stack8, { alignItems: "center", p: 2.5, gap: 1.5 }, /* @__PURE__ */ React28.createElement(PhotoIcon, { fontSize: "large" }), /* @__PURE__ */ React28.createElement(Typography4, { align: "center", variant: "caption", color: "text.secondary" }, __9("Sorry, nothing matched", "elementor"), /* @__PURE__ */ React28.createElement("br", null), "\u201C", searchValue, "\u201D."), /* @__PURE__ */ React28.createElement(Typography4, { align: "center", variant: "caption", color: "text.secondary" }, /* @__PURE__ */ React28.createElement(
|
|
1189
1385
|
Link,
|
|
1190
1386
|
{
|
|
1191
1387
|
color: "secondary",
|
|
@@ -1199,13 +1395,13 @@ var FontFamilyControl = createControl(({ fontFamilies }) => {
|
|
|
1199
1395
|
});
|
|
1200
1396
|
|
|
1201
1397
|
// src/controls/url-control.tsx
|
|
1202
|
-
import * as
|
|
1398
|
+
import * as React29 from "react";
|
|
1203
1399
|
import { urlPropTypeUtil } from "@elementor/editor-props";
|
|
1204
1400
|
import { TextField as TextField6 } from "@elementor/ui";
|
|
1205
1401
|
var UrlControl = createControl(({ placeholder }) => {
|
|
1206
1402
|
const { value, setValue } = useBoundProp(urlPropTypeUtil);
|
|
1207
1403
|
const handleChange = (event) => setValue(event.target.value);
|
|
1208
|
-
return /* @__PURE__ */
|
|
1404
|
+
return /* @__PURE__ */ React29.createElement(ControlActions, null, /* @__PURE__ */ React29.createElement(
|
|
1209
1405
|
TextField6,
|
|
1210
1406
|
{
|
|
1211
1407
|
size: "tiny",
|
|
@@ -1218,23 +1414,24 @@ var UrlControl = createControl(({ placeholder }) => {
|
|
|
1218
1414
|
});
|
|
1219
1415
|
|
|
1220
1416
|
// src/controls/link-control.tsx
|
|
1221
|
-
import * as
|
|
1417
|
+
import * as React31 from "react";
|
|
1222
1418
|
import { useMemo, useState as useState4 } from "react";
|
|
1223
1419
|
import {
|
|
1224
1420
|
booleanPropTypeUtil,
|
|
1225
1421
|
linkPropTypeUtil,
|
|
1226
1422
|
numberPropTypeUtil as numberPropTypeUtil2,
|
|
1227
|
-
stringPropTypeUtil as
|
|
1423
|
+
stringPropTypeUtil as stringPropTypeUtil7,
|
|
1228
1424
|
urlPropTypeUtil as urlPropTypeUtil2
|
|
1229
1425
|
} from "@elementor/editor-props";
|
|
1230
1426
|
import { httpService } from "@elementor/http";
|
|
1231
1427
|
import { MinusIcon, PlusIcon as PlusIcon2 } from "@elementor/icons";
|
|
1232
1428
|
import { useSessionStorage } from "@elementor/session";
|
|
1233
|
-
import { Collapse, Divider as
|
|
1429
|
+
import { Collapse, Divider as Divider3, Grid as Grid7, IconButton as IconButton4, Stack as Stack9, Switch } from "@elementor/ui";
|
|
1430
|
+
import { debounce } from "@elementor/utils";
|
|
1234
1431
|
import { __ as __10 } from "@wordpress/i18n";
|
|
1235
1432
|
|
|
1236
1433
|
// src/components/autocomplete.tsx
|
|
1237
|
-
import * as
|
|
1434
|
+
import * as React30 from "react";
|
|
1238
1435
|
import { forwardRef as forwardRef2 } from "react";
|
|
1239
1436
|
import { XIcon as XIcon3 } from "@elementor/icons";
|
|
1240
1437
|
import {
|
|
@@ -1260,7 +1457,7 @@ var Autocomplete = forwardRef2((props, ref) => {
|
|
|
1260
1457
|
const muiWarningPreventer = allowCustomValues || !!value?.toString()?.length;
|
|
1261
1458
|
const isOptionEqualToValue = muiWarningPreventer ? void 0 : () => true;
|
|
1262
1459
|
const isValueFromOptions = typeof value === "number" && !!findMatchingOption(options, value);
|
|
1263
|
-
return /* @__PURE__ */
|
|
1460
|
+
return /* @__PURE__ */ React30.createElement(
|
|
1264
1461
|
AutocompleteBase,
|
|
1265
1462
|
{
|
|
1266
1463
|
...restProps,
|
|
@@ -1278,8 +1475,8 @@ var Autocomplete = forwardRef2((props, ref) => {
|
|
|
1278
1475
|
groupBy: isCategorizedOptionPool(options) ? (optionId) => findMatchingOption(options, optionId)?.groupLabel || optionId : void 0,
|
|
1279
1476
|
isOptionEqualToValue,
|
|
1280
1477
|
filterOptions: () => optionKeys,
|
|
1281
|
-
renderOption: (optionProps, optionId) => /* @__PURE__ */
|
|
1282
|
-
renderInput: (params) => /* @__PURE__ */
|
|
1478
|
+
renderOption: (optionProps, optionId) => /* @__PURE__ */ React30.createElement(Box3, { component: "li", ...optionProps, key: optionProps.id }, findMatchingOption(options, optionId)?.label ?? optionId),
|
|
1479
|
+
renderInput: (params) => /* @__PURE__ */ React30.createElement(
|
|
1283
1480
|
TextInput,
|
|
1284
1481
|
{
|
|
1285
1482
|
params,
|
|
@@ -1302,7 +1499,7 @@ var TextInput = ({
|
|
|
1302
1499
|
const onChange = (event) => {
|
|
1303
1500
|
handleChange(event.target.value);
|
|
1304
1501
|
};
|
|
1305
|
-
return /* @__PURE__ */
|
|
1502
|
+
return /* @__PURE__ */ React30.createElement(
|
|
1306
1503
|
TextField7,
|
|
1307
1504
|
{
|
|
1308
1505
|
...params,
|
|
@@ -1315,7 +1512,7 @@ var TextInput = ({
|
|
|
1315
1512
|
},
|
|
1316
1513
|
InputProps: {
|
|
1317
1514
|
...params.InputProps,
|
|
1318
|
-
endAdornment: /* @__PURE__ */
|
|
1515
|
+
endAdornment: /* @__PURE__ */ React30.createElement(ClearButton, { params, allowClear, handleChange })
|
|
1319
1516
|
}
|
|
1320
1517
|
}
|
|
1321
1518
|
);
|
|
@@ -1324,7 +1521,7 @@ var ClearButton = ({
|
|
|
1324
1521
|
allowClear,
|
|
1325
1522
|
handleChange,
|
|
1326
1523
|
params
|
|
1327
|
-
}) => /* @__PURE__ */
|
|
1524
|
+
}) => /* @__PURE__ */ React30.createElement(InputAdornment4, { position: "end" }, allowClear && /* @__PURE__ */ React30.createElement(IconButton3, { size: params.size, onClick: () => handleChange(null), sx: { cursor: "pointer" } }, /* @__PURE__ */ React30.createElement(XIcon3, { fontSize: params.size })));
|
|
1328
1525
|
function findMatchingOption(options, optionId = null) {
|
|
1329
1526
|
const formattedOption = (optionId || "").toString();
|
|
1330
1527
|
return options.find(({ id }) => formattedOption === id.toString());
|
|
@@ -1369,7 +1566,7 @@ var LinkControl = createControl((props) => {
|
|
|
1369
1566
|
const valueToSave = newValue ? {
|
|
1370
1567
|
...value,
|
|
1371
1568
|
destination: numberPropTypeUtil2.create(newValue),
|
|
1372
|
-
label:
|
|
1569
|
+
label: stringPropTypeUtil7.create(findMatchingOption(options, newValue)?.label || null)
|
|
1373
1570
|
} : null;
|
|
1374
1571
|
onSaveNewValue(valueToSave);
|
|
1375
1572
|
};
|
|
@@ -1403,7 +1600,7 @@ var LinkControl = createControl((props) => {
|
|
|
1403
1600
|
),
|
|
1404
1601
|
[endpoint]
|
|
1405
1602
|
);
|
|
1406
|
-
return /* @__PURE__ */
|
|
1603
|
+
return /* @__PURE__ */ React31.createElement(PropProvider, { ...propContext, value, setValue }, /* @__PURE__ */ React31.createElement(Stack9, { gap: 1.5 }, /* @__PURE__ */ React31.createElement(Divider3, null), /* @__PURE__ */ React31.createElement(
|
|
1407
1604
|
Stack9,
|
|
1408
1605
|
{
|
|
1409
1606
|
direction: "row",
|
|
@@ -1412,8 +1609,8 @@ var LinkControl = createControl((props) => {
|
|
|
1412
1609
|
alignItems: "center"
|
|
1413
1610
|
}
|
|
1414
1611
|
},
|
|
1415
|
-
/* @__PURE__ */
|
|
1416
|
-
/* @__PURE__ */
|
|
1612
|
+
/* @__PURE__ */ React31.createElement(ControlLabel, null, __10("Link", "elementor")),
|
|
1613
|
+
/* @__PURE__ */ React31.createElement(
|
|
1417
1614
|
ToggleIconControl,
|
|
1418
1615
|
{
|
|
1419
1616
|
enabled: isEnabled,
|
|
@@ -1421,7 +1618,7 @@ var LinkControl = createControl((props) => {
|
|
|
1421
1618
|
label: __10("Toggle link", "elementor")
|
|
1422
1619
|
}
|
|
1423
1620
|
)
|
|
1424
|
-
), /* @__PURE__ */
|
|
1621
|
+
), /* @__PURE__ */ React31.createElement(Collapse, { in: isEnabled, timeout: "auto", unmountOnExit: true }, /* @__PURE__ */ React31.createElement(Stack9, { gap: 1.5 }, /* @__PURE__ */ React31.createElement(PropKeyProvider, { bind: "destination" }, /* @__PURE__ */ React31.createElement(ControlActions, null, /* @__PURE__ */ React31.createElement(
|
|
1425
1622
|
Autocomplete,
|
|
1426
1623
|
{
|
|
1427
1624
|
options,
|
|
@@ -1432,17 +1629,17 @@ var LinkControl = createControl((props) => {
|
|
|
1432
1629
|
onTextChange,
|
|
1433
1630
|
minInputLength
|
|
1434
1631
|
}
|
|
1435
|
-
))), /* @__PURE__ */
|
|
1632
|
+
))), /* @__PURE__ */ React31.createElement(PropKeyProvider, { bind: "isTargetBlank" }, /* @__PURE__ */ React31.createElement(SwitchControl, null))))));
|
|
1436
1633
|
});
|
|
1437
1634
|
var ToggleIconControl = ({ enabled, onIconClick, label }) => {
|
|
1438
|
-
return /* @__PURE__ */
|
|
1635
|
+
return /* @__PURE__ */ React31.createElement(IconButton4, { size: SIZE3, onClick: onIconClick, "aria-label": label }, enabled ? /* @__PURE__ */ React31.createElement(MinusIcon, { fontSize: SIZE3 }) : /* @__PURE__ */ React31.createElement(PlusIcon2, { fontSize: SIZE3 }));
|
|
1439
1636
|
};
|
|
1440
1637
|
var SwitchControl = () => {
|
|
1441
1638
|
const { value = false, setValue } = useBoundProp(booleanPropTypeUtil);
|
|
1442
1639
|
const onClick = () => {
|
|
1443
1640
|
setValue(!value);
|
|
1444
1641
|
};
|
|
1445
|
-
return /* @__PURE__ */
|
|
1642
|
+
return /* @__PURE__ */ React31.createElement(Grid7, { container: true, alignItems: "center", flexWrap: "nowrap", justifyContent: "space-between" }, /* @__PURE__ */ React31.createElement(Grid7, { item: true }, /* @__PURE__ */ React31.createElement(ControlLabel, null, __10("Open in a new tab", "elementor"))), /* @__PURE__ */ React31.createElement(Grid7, { item: true }, /* @__PURE__ */ React31.createElement(Switch, { checked: value, onClick })));
|
|
1446
1643
|
};
|
|
1447
1644
|
async function fetchOptions(ajaxUrl, params) {
|
|
1448
1645
|
if (!params || !ajaxUrl) {
|
|
@@ -1472,18 +1669,9 @@ function generateFirstLoadedOption(unionValue) {
|
|
|
1472
1669
|
}
|
|
1473
1670
|
] : [];
|
|
1474
1671
|
}
|
|
1475
|
-
function debounce(fn, timeout) {
|
|
1476
|
-
let timer;
|
|
1477
|
-
return (...args) => {
|
|
1478
|
-
clearTimeout(timer);
|
|
1479
|
-
timer = setTimeout(() => {
|
|
1480
|
-
fn(...args);
|
|
1481
|
-
}, timeout);
|
|
1482
|
-
};
|
|
1483
|
-
}
|
|
1484
1672
|
|
|
1485
1673
|
// src/controls/gap-control.tsx
|
|
1486
|
-
import * as
|
|
1674
|
+
import * as React32 from "react";
|
|
1487
1675
|
import { layoutDirectionPropTypeUtil, sizePropTypeUtil as sizePropTypeUtil4 } from "@elementor/editor-props";
|
|
1488
1676
|
import { DetachIcon as DetachIcon2, LinkIcon as LinkIcon2 } from "@elementor/icons";
|
|
1489
1677
|
import { Grid as Grid8, Stack as Stack10, ToggleButton as ToggleButton4 } from "@elementor/ui";
|
|
@@ -1498,7 +1686,7 @@ var GapControl = createControl(({ label }) => {
|
|
|
1498
1686
|
const isLinked = !directionValue && !sizeValue ? true : !!sizeValue;
|
|
1499
1687
|
const onLinkToggle = () => {
|
|
1500
1688
|
if (!isLinked) {
|
|
1501
|
-
setSizeValue(directionValue?.column
|
|
1689
|
+
setSizeValue(directionValue?.column?.value);
|
|
1502
1690
|
return;
|
|
1503
1691
|
}
|
|
1504
1692
|
const value = sizeValue ? sizePropTypeUtil4.create(sizeValue) : null;
|
|
@@ -1508,7 +1696,7 @@ var GapControl = createControl(({ label }) => {
|
|
|
1508
1696
|
});
|
|
1509
1697
|
};
|
|
1510
1698
|
const LinkedIcon = isLinked ? LinkIcon2 : DetachIcon2;
|
|
1511
|
-
return /* @__PURE__ */
|
|
1699
|
+
return /* @__PURE__ */ React32.createElement(PropProvider, { propType, value: directionValue, setValue: setDirectionValue }, /* @__PURE__ */ React32.createElement(Stack10, { direction: "row", gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React32.createElement(ControlLabel, null, label), /* @__PURE__ */ React32.createElement(
|
|
1512
1700
|
ToggleButton4,
|
|
1513
1701
|
{
|
|
1514
1702
|
"aria-label": __11("Link inputs", "elementor"),
|
|
@@ -1518,28 +1706,28 @@ var GapControl = createControl(({ label }) => {
|
|
|
1518
1706
|
sx: { marginLeft: "auto" },
|
|
1519
1707
|
onChange: onLinkToggle
|
|
1520
1708
|
},
|
|
1521
|
-
/* @__PURE__ */
|
|
1522
|
-
)), /* @__PURE__ */
|
|
1709
|
+
/* @__PURE__ */ React32.createElement(LinkedIcon, { fontSize: "tiny" })
|
|
1710
|
+
)), /* @__PURE__ */ React32.createElement(Stack10, { direction: "row", gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React32.createElement(Grid8, { container: true, gap: 1, alignItems: "center" }, /* @__PURE__ */ React32.createElement(Grid8, { item: true, xs: 12 }, /* @__PURE__ */ React32.createElement(ControlLabel, null, __11("Column", "elementor"))), /* @__PURE__ */ React32.createElement(Grid8, { item: true, xs: 12 }, /* @__PURE__ */ React32.createElement(Control4, { bind: "column", isLinked }))), /* @__PURE__ */ React32.createElement(Grid8, { container: true, gap: 1, alignItems: "center" }, /* @__PURE__ */ React32.createElement(Grid8, { item: true, xs: 12 }, /* @__PURE__ */ React32.createElement(ControlLabel, null, __11("Row", "elementor"))), /* @__PURE__ */ React32.createElement(Grid8, { item: true, xs: 12 }, /* @__PURE__ */ React32.createElement(Control4, { bind: "row", isLinked })))));
|
|
1523
1711
|
});
|
|
1524
1712
|
var Control4 = ({ bind, isLinked }) => {
|
|
1525
1713
|
if (isLinked) {
|
|
1526
|
-
return /* @__PURE__ */
|
|
1714
|
+
return /* @__PURE__ */ React32.createElement(SizeControl, null);
|
|
1527
1715
|
}
|
|
1528
|
-
return /* @__PURE__ */
|
|
1716
|
+
return /* @__PURE__ */ React32.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React32.createElement(SizeControl, null));
|
|
1529
1717
|
};
|
|
1530
1718
|
|
|
1531
1719
|
// src/controls/svg-media-control.tsx
|
|
1532
|
-
import * as
|
|
1720
|
+
import * as React33 from "react";
|
|
1533
1721
|
import { imageSrcPropTypeUtil as imageSrcPropTypeUtil2 } from "@elementor/editor-props";
|
|
1534
1722
|
import { UploadIcon as UploadIcon2 } from "@elementor/icons";
|
|
1535
|
-
import { Button as Button3, Card as Card2, CardMedia as CardMedia2, CardOverlay as CardOverlay2, CircularProgress as CircularProgress2, Stack as Stack11, styled as
|
|
1723
|
+
import { Button as Button3, Card as Card2, CardMedia as CardMedia2, CardOverlay as CardOverlay2, CircularProgress as CircularProgress2, Stack as Stack11, styled as styled4 } from "@elementor/ui";
|
|
1536
1724
|
import { useWpMediaAttachment as useWpMediaAttachment2, useWpMediaFrame as useWpMediaFrame2 } from "@elementor/wp-media";
|
|
1537
1725
|
import { __ as __12 } from "@wordpress/i18n";
|
|
1538
1726
|
var TILE_SIZE = 8;
|
|
1539
1727
|
var TILE_WHITE = "transparent";
|
|
1540
1728
|
var TILE_BLACK = "#c1c1c1";
|
|
1541
1729
|
var TILES_GRADIENT_FORMULA = `linear-gradient(45deg, ${TILE_BLACK} 25%, ${TILE_WHITE} 0, ${TILE_WHITE} 75%, ${TILE_BLACK} 0, ${TILE_BLACK})`;
|
|
1542
|
-
var StyledCard =
|
|
1730
|
+
var StyledCard = styled4(Card2)`
|
|
1543
1731
|
background-color: white;
|
|
1544
1732
|
background-image: ${TILES_GRADIENT_FORMULA}, ${TILES_GRADIENT_FORMULA};
|
|
1545
1733
|
background-size: ${TILE_SIZE}px ${TILE_SIZE}px;
|
|
@@ -1548,7 +1736,7 @@ var StyledCard = styled3(Card2)`
|
|
|
1548
1736
|
${TILE_SIZE / 2}px ${TILE_SIZE / 2}px;
|
|
1549
1737
|
border: none;
|
|
1550
1738
|
`;
|
|
1551
|
-
var StyledCardMediaContainer =
|
|
1739
|
+
var StyledCardMediaContainer = styled4(Stack11)`
|
|
1552
1740
|
position: relative;
|
|
1553
1741
|
height: 140px;
|
|
1554
1742
|
object-fit: contain;
|
|
@@ -1577,7 +1765,7 @@ var SvgMediaControl = createControl(() => {
|
|
|
1577
1765
|
});
|
|
1578
1766
|
}
|
|
1579
1767
|
});
|
|
1580
|
-
return /* @__PURE__ */
|
|
1768
|
+
return /* @__PURE__ */ React33.createElement(Stack11, { gap: 1 }, /* @__PURE__ */ React33.createElement(ControlLabel, null, " ", __12("SVG", "elementor"), " "), /* @__PURE__ */ React33.createElement(ControlActions, null, /* @__PURE__ */ React33.createElement(StyledCard, { variant: "outlined" }, /* @__PURE__ */ React33.createElement(StyledCardMediaContainer, null, isFetching ? /* @__PURE__ */ React33.createElement(CircularProgress2, { role: "progressbar" }) : /* @__PURE__ */ React33.createElement(
|
|
1581
1769
|
CardMedia2,
|
|
1582
1770
|
{
|
|
1583
1771
|
component: "img",
|
|
@@ -1585,7 +1773,7 @@ var SvgMediaControl = createControl(() => {
|
|
|
1585
1773
|
alt: __12("Preview SVG", "elementor"),
|
|
1586
1774
|
sx: { maxHeight: "140px", width: "50px" }
|
|
1587
1775
|
}
|
|
1588
|
-
)), /* @__PURE__ */
|
|
1776
|
+
)), /* @__PURE__ */ React33.createElement(
|
|
1589
1777
|
CardOverlay2,
|
|
1590
1778
|
{
|
|
1591
1779
|
sx: {
|
|
@@ -1594,7 +1782,7 @@ var SvgMediaControl = createControl(() => {
|
|
|
1594
1782
|
}
|
|
1595
1783
|
}
|
|
1596
1784
|
},
|
|
1597
|
-
/* @__PURE__ */
|
|
1785
|
+
/* @__PURE__ */ React33.createElement(Stack11, { gap: 1 }, /* @__PURE__ */ React33.createElement(
|
|
1598
1786
|
Button3,
|
|
1599
1787
|
{
|
|
1600
1788
|
size: "tiny",
|
|
@@ -1603,28 +1791,28 @@ var SvgMediaControl = createControl(() => {
|
|
|
1603
1791
|
onClick: () => open({ mode: "browse" })
|
|
1604
1792
|
},
|
|
1605
1793
|
__12("Select SVG", "elementor")
|
|
1606
|
-
), /* @__PURE__ */
|
|
1794
|
+
), /* @__PURE__ */ React33.createElement(
|
|
1607
1795
|
Button3,
|
|
1608
1796
|
{
|
|
1609
1797
|
size: "tiny",
|
|
1610
1798
|
variant: "text",
|
|
1611
1799
|
color: "inherit",
|
|
1612
|
-
startIcon: /* @__PURE__ */
|
|
1800
|
+
startIcon: /* @__PURE__ */ React33.createElement(UploadIcon2, null),
|
|
1613
1801
|
onClick: () => open({ mode: "upload" })
|
|
1614
1802
|
},
|
|
1615
|
-
__12("Upload
|
|
1803
|
+
__12("Upload", "elementor")
|
|
1616
1804
|
))
|
|
1617
1805
|
))));
|
|
1618
1806
|
});
|
|
1619
1807
|
|
|
1620
1808
|
// src/controls/background-control/background-control.tsx
|
|
1621
|
-
import * as
|
|
1809
|
+
import * as React39 from "react";
|
|
1622
1810
|
import { backgroundPropTypeUtil } from "@elementor/editor-props";
|
|
1623
1811
|
import { Grid as Grid14 } from "@elementor/ui";
|
|
1624
1812
|
import { __ as __18 } from "@wordpress/i18n";
|
|
1625
1813
|
|
|
1626
1814
|
// src/controls/background-control/background-overlay/background-overlay-repeater-control.tsx
|
|
1627
|
-
import * as
|
|
1815
|
+
import * as React38 from "react";
|
|
1628
1816
|
import {
|
|
1629
1817
|
backgroundColorOverlayPropTypeUtil as backgroundColorOverlayPropTypeUtil2,
|
|
1630
1818
|
backgroundImageOverlayPropTypeUtil as backgroundImageOverlayPropTypeUtil2,
|
|
@@ -1639,7 +1827,7 @@ import { parseEnv } from "@elementor/env";
|
|
|
1639
1827
|
var { env } = parseEnv("@elementor/editor-controls");
|
|
1640
1828
|
|
|
1641
1829
|
// src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-attachment.tsx
|
|
1642
|
-
import * as
|
|
1830
|
+
import * as React34 from "react";
|
|
1643
1831
|
import { PinIcon, PinnedOffIcon } from "@elementor/icons";
|
|
1644
1832
|
import { Grid as Grid9 } from "@elementor/ui";
|
|
1645
1833
|
import { __ as __13 } from "@wordpress/i18n";
|
|
@@ -1647,23 +1835,23 @@ var attachmentControlOptions = [
|
|
|
1647
1835
|
{
|
|
1648
1836
|
value: "fixed",
|
|
1649
1837
|
label: __13("Fixed", "elementor"),
|
|
1650
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1838
|
+
renderContent: ({ size }) => /* @__PURE__ */ React34.createElement(PinIcon, { fontSize: size }),
|
|
1651
1839
|
showTooltip: true
|
|
1652
1840
|
},
|
|
1653
1841
|
{
|
|
1654
1842
|
value: "scroll",
|
|
1655
1843
|
label: __13("Scroll", "elementor"),
|
|
1656
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1844
|
+
renderContent: ({ size }) => /* @__PURE__ */ React34.createElement(PinnedOffIcon, { fontSize: size }),
|
|
1657
1845
|
showTooltip: true
|
|
1658
1846
|
}
|
|
1659
1847
|
];
|
|
1660
1848
|
var BackgroundImageOverlayAttachment = () => {
|
|
1661
|
-
return /* @__PURE__ */
|
|
1849
|
+
return /* @__PURE__ */ React34.createElement(PopoverGridContainer, null, /* @__PURE__ */ React34.createElement(Grid9, { item: true, xs: 6 }, /* @__PURE__ */ React34.createElement(ControlLabel, null, __13("Attachment", "elementor"))), /* @__PURE__ */ React34.createElement(Grid9, { item: true, xs: 6, sx: { display: "flex", justifyContent: "flex-end", overflow: "hidden" } }, /* @__PURE__ */ React34.createElement(ToggleControl, { options: attachmentControlOptions })));
|
|
1662
1850
|
};
|
|
1663
1851
|
|
|
1664
1852
|
// src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-position.tsx
|
|
1665
|
-
import * as
|
|
1666
|
-
import { backgroundImagePositionOffsetPropTypeUtil, stringPropTypeUtil as
|
|
1853
|
+
import * as React35 from "react";
|
|
1854
|
+
import { backgroundImagePositionOffsetPropTypeUtil, stringPropTypeUtil as stringPropTypeUtil8 } from "@elementor/editor-props";
|
|
1667
1855
|
import { LetterXIcon, LetterYIcon } from "@elementor/icons";
|
|
1668
1856
|
import { Grid as Grid10, MenuItem as MenuItem4, Select as Select2 } from "@elementor/ui";
|
|
1669
1857
|
import { __ as __14 } from "@wordpress/i18n";
|
|
@@ -1681,7 +1869,7 @@ var backgroundPositionOptions = [
|
|
|
1681
1869
|
];
|
|
1682
1870
|
var BackgroundImageOverlayPosition = () => {
|
|
1683
1871
|
const backgroundImageOffsetContext = useBoundProp(backgroundImagePositionOffsetPropTypeUtil);
|
|
1684
|
-
const stringPropContext = useBoundProp(
|
|
1872
|
+
const stringPropContext = useBoundProp(stringPropTypeUtil8);
|
|
1685
1873
|
const isCustom = !!backgroundImageOffsetContext.value;
|
|
1686
1874
|
const handlePositionChange = (event) => {
|
|
1687
1875
|
const value = event.target.value || null;
|
|
@@ -1691,7 +1879,7 @@ var BackgroundImageOverlayPosition = () => {
|
|
|
1691
1879
|
stringPropContext.setValue(value);
|
|
1692
1880
|
}
|
|
1693
1881
|
};
|
|
1694
|
-
return /* @__PURE__ */
|
|
1882
|
+
return /* @__PURE__ */ React35.createElement(Grid10, { container: true, spacing: 1.5 }, /* @__PURE__ */ React35.createElement(Grid10, { item: true, xs: 12 }, /* @__PURE__ */ React35.createElement(PopoverGridContainer, null, /* @__PURE__ */ React35.createElement(Grid10, { item: true, xs: 6 }, /* @__PURE__ */ React35.createElement(ControlLabel, null, __14("Position", "elementor"))), /* @__PURE__ */ React35.createElement(Grid10, { item: true, xs: 6, sx: { display: "flex", justifyContent: "flex-end", overflow: "hidden" } }, /* @__PURE__ */ React35.createElement(
|
|
1695
1883
|
Select2,
|
|
1696
1884
|
{
|
|
1697
1885
|
size: "tiny",
|
|
@@ -1699,12 +1887,12 @@ var BackgroundImageOverlayPosition = () => {
|
|
|
1699
1887
|
onChange: handlePositionChange,
|
|
1700
1888
|
fullWidth: true
|
|
1701
1889
|
},
|
|
1702
|
-
backgroundPositionOptions.map(({ label, value }) => /* @__PURE__ */
|
|
1703
|
-
)))), isCustom ? /* @__PURE__ */
|
|
1890
|
+
backgroundPositionOptions.map(({ label, value }) => /* @__PURE__ */ React35.createElement(MenuItem4, { key: value, value: value ?? "" }, label))
|
|
1891
|
+
)))), isCustom ? /* @__PURE__ */ React35.createElement(PropProvider, { ...backgroundImageOffsetContext }, /* @__PURE__ */ React35.createElement(Grid10, { item: true, xs: 12 }, /* @__PURE__ */ React35.createElement(Grid10, { container: true, spacing: 1.5 }, /* @__PURE__ */ React35.createElement(Grid10, { item: true, xs: 6 }, /* @__PURE__ */ React35.createElement(PropKeyProvider, { bind: "x" }, /* @__PURE__ */ React35.createElement(SizeControl, { startIcon: /* @__PURE__ */ React35.createElement(LetterXIcon, { fontSize: "tiny" }) }))), /* @__PURE__ */ React35.createElement(Grid10, { item: true, xs: 6 }, /* @__PURE__ */ React35.createElement(PropKeyProvider, { bind: "y" }, /* @__PURE__ */ React35.createElement(SizeControl, { startIcon: /* @__PURE__ */ React35.createElement(LetterYIcon, { fontSize: "tiny" }) })))))) : null);
|
|
1704
1892
|
};
|
|
1705
1893
|
|
|
1706
1894
|
// src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-repeat.tsx
|
|
1707
|
-
import * as
|
|
1895
|
+
import * as React36 from "react";
|
|
1708
1896
|
import { DotsHorizontalIcon, DotsVerticalIcon, GridDotsIcon, XIcon as XIcon4 } from "@elementor/icons";
|
|
1709
1897
|
import { Grid as Grid11 } from "@elementor/ui";
|
|
1710
1898
|
import { __ as __15 } from "@wordpress/i18n";
|
|
@@ -1712,35 +1900,35 @@ var repeatControlOptions = [
|
|
|
1712
1900
|
{
|
|
1713
1901
|
value: "repeat",
|
|
1714
1902
|
label: __15("Repeat", "elementor"),
|
|
1715
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1903
|
+
renderContent: ({ size }) => /* @__PURE__ */ React36.createElement(GridDotsIcon, { fontSize: size }),
|
|
1716
1904
|
showTooltip: true
|
|
1717
1905
|
},
|
|
1718
1906
|
{
|
|
1719
1907
|
value: "repeat-x",
|
|
1720
1908
|
label: __15("Repeat-x", "elementor"),
|
|
1721
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1909
|
+
renderContent: ({ size }) => /* @__PURE__ */ React36.createElement(DotsHorizontalIcon, { fontSize: size }),
|
|
1722
1910
|
showTooltip: true
|
|
1723
1911
|
},
|
|
1724
1912
|
{
|
|
1725
1913
|
value: "repeat-y",
|
|
1726
1914
|
label: __15("Repeat-y", "elementor"),
|
|
1727
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1915
|
+
renderContent: ({ size }) => /* @__PURE__ */ React36.createElement(DotsVerticalIcon, { fontSize: size }),
|
|
1728
1916
|
showTooltip: true
|
|
1729
1917
|
},
|
|
1730
1918
|
{
|
|
1731
1919
|
value: "no-repeat",
|
|
1732
|
-
label: __15("No-
|
|
1733
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1920
|
+
label: __15("No-repeat", "elementor"),
|
|
1921
|
+
renderContent: ({ size }) => /* @__PURE__ */ React36.createElement(XIcon4, { fontSize: size }),
|
|
1734
1922
|
showTooltip: true
|
|
1735
1923
|
}
|
|
1736
1924
|
];
|
|
1737
1925
|
var BackgroundImageOverlayRepeat = () => {
|
|
1738
|
-
return /* @__PURE__ */
|
|
1926
|
+
return /* @__PURE__ */ React36.createElement(PopoverGridContainer, null, /* @__PURE__ */ React36.createElement(Grid11, { item: true, xs: 6 }, /* @__PURE__ */ React36.createElement(ControlLabel, null, __15("Repeat", "elementor"))), /* @__PURE__ */ React36.createElement(Grid11, { item: true, xs: 6, sx: { display: "flex", justifyContent: "flex-end" } }, /* @__PURE__ */ React36.createElement(ToggleControl, { options: repeatControlOptions })));
|
|
1739
1927
|
};
|
|
1740
1928
|
|
|
1741
1929
|
// src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-size.tsx
|
|
1742
|
-
import * as
|
|
1743
|
-
import { backgroundImageSizeScalePropTypeUtil, stringPropTypeUtil as
|
|
1930
|
+
import * as React37 from "react";
|
|
1931
|
+
import { backgroundImageSizeScalePropTypeUtil, stringPropTypeUtil as stringPropTypeUtil9 } from "@elementor/editor-props";
|
|
1744
1932
|
import {
|
|
1745
1933
|
ArrowBarBothIcon,
|
|
1746
1934
|
ArrowsMaximizeIcon,
|
|
@@ -1755,31 +1943,31 @@ var sizeControlOptions = [
|
|
|
1755
1943
|
{
|
|
1756
1944
|
value: "auto",
|
|
1757
1945
|
label: __16("Auto", "elementor"),
|
|
1758
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1946
|
+
renderContent: ({ size }) => /* @__PURE__ */ React37.createElement(LetterAIcon, { fontSize: size }),
|
|
1759
1947
|
showTooltip: true
|
|
1760
1948
|
},
|
|
1761
1949
|
{
|
|
1762
1950
|
value: "cover",
|
|
1763
1951
|
label: __16("Cover", "elementor"),
|
|
1764
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1952
|
+
renderContent: ({ size }) => /* @__PURE__ */ React37.createElement(ArrowsMaximizeIcon, { fontSize: size }),
|
|
1765
1953
|
showTooltip: true
|
|
1766
1954
|
},
|
|
1767
1955
|
{
|
|
1768
1956
|
value: "contain",
|
|
1769
1957
|
label: __16("Contain", "elementor"),
|
|
1770
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1958
|
+
renderContent: ({ size }) => /* @__PURE__ */ React37.createElement(ArrowBarBothIcon, { fontSize: size }),
|
|
1771
1959
|
showTooltip: true
|
|
1772
1960
|
},
|
|
1773
1961
|
{
|
|
1774
1962
|
value: "custom",
|
|
1775
1963
|
label: __16("Custom", "elementor"),
|
|
1776
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1964
|
+
renderContent: ({ size }) => /* @__PURE__ */ React37.createElement(PencilIcon, { fontSize: size }),
|
|
1777
1965
|
showTooltip: true
|
|
1778
1966
|
}
|
|
1779
1967
|
];
|
|
1780
1968
|
var BackgroundImageOverlaySize = () => {
|
|
1781
1969
|
const backgroundImageScaleContext = useBoundProp(backgroundImageSizeScalePropTypeUtil);
|
|
1782
|
-
const stringPropContext = useBoundProp(
|
|
1970
|
+
const stringPropContext = useBoundProp(stringPropTypeUtil9);
|
|
1783
1971
|
const isCustom = !!backgroundImageScaleContext.value;
|
|
1784
1972
|
const handleSizeChange = (size) => {
|
|
1785
1973
|
if (size === "custom") {
|
|
@@ -1788,7 +1976,7 @@ var BackgroundImageOverlaySize = () => {
|
|
|
1788
1976
|
stringPropContext.setValue(size);
|
|
1789
1977
|
}
|
|
1790
1978
|
};
|
|
1791
|
-
return /* @__PURE__ */
|
|
1979
|
+
return /* @__PURE__ */ React37.createElement(Grid12, { container: true, spacing: 1.5 }, /* @__PURE__ */ React37.createElement(Grid12, { item: true, xs: 12 }, /* @__PURE__ */ React37.createElement(PopoverGridContainer, null, /* @__PURE__ */ React37.createElement(Grid12, { item: true, xs: 6 }, /* @__PURE__ */ React37.createElement(ControlLabel, null, __16("Size", "elementor"))), /* @__PURE__ */ React37.createElement(Grid12, { item: true, xs: 6, sx: { display: "flex", justifyContent: "flex-end" } }, /* @__PURE__ */ React37.createElement(
|
|
1792
1980
|
ControlToggleButtonGroup,
|
|
1793
1981
|
{
|
|
1794
1982
|
exclusive: true,
|
|
@@ -1796,7 +1984,19 @@ var BackgroundImageOverlaySize = () => {
|
|
|
1796
1984
|
value: backgroundImageScaleContext.value ? "custom" : stringPropContext.value,
|
|
1797
1985
|
onChange: handleSizeChange
|
|
1798
1986
|
}
|
|
1799
|
-
)))), isCustom ? /* @__PURE__ */
|
|
1987
|
+
)))), isCustom ? /* @__PURE__ */ React37.createElement(PropProvider, { ...backgroundImageScaleContext }, /* @__PURE__ */ React37.createElement(Grid12, { item: true, xs: 12 }, /* @__PURE__ */ React37.createElement(PopoverGridContainer, null, /* @__PURE__ */ React37.createElement(Grid12, { item: true, xs: 6 }, /* @__PURE__ */ React37.createElement(PropKeyProvider, { bind: "width" }, /* @__PURE__ */ React37.createElement(
|
|
1988
|
+
SizeControl,
|
|
1989
|
+
{
|
|
1990
|
+
startIcon: /* @__PURE__ */ React37.createElement(ArrowsMoveHorizontalIcon, { fontSize: "tiny" }),
|
|
1991
|
+
extendedValues: ["auto"]
|
|
1992
|
+
}
|
|
1993
|
+
))), /* @__PURE__ */ React37.createElement(Grid12, { item: true, xs: 6 }, /* @__PURE__ */ React37.createElement(PropKeyProvider, { bind: "height" }, /* @__PURE__ */ React37.createElement(
|
|
1994
|
+
SizeControl,
|
|
1995
|
+
{
|
|
1996
|
+
startIcon: /* @__PURE__ */ React37.createElement(ArrowsMoveVerticalIcon, { fontSize: "tiny" }),
|
|
1997
|
+
extendedValues: ["auto"]
|
|
1998
|
+
}
|
|
1999
|
+
)))))) : null);
|
|
1800
2000
|
};
|
|
1801
2001
|
|
|
1802
2002
|
// src/controls/background-control/background-overlay/use-background-tabs-history.ts
|
|
@@ -1878,7 +2078,7 @@ var backgroundResolutionOptions = [
|
|
|
1878
2078
|
];
|
|
1879
2079
|
var BackgroundOverlayRepeaterControl = createControl(() => {
|
|
1880
2080
|
const { propType, value: overlayValues, setValue } = useBoundProp(backgroundOverlayPropTypeUtil);
|
|
1881
|
-
return /* @__PURE__ */
|
|
2081
|
+
return /* @__PURE__ */ React38.createElement(PropProvider, { propType, value: overlayValues, setValue }, /* @__PURE__ */ React38.createElement(
|
|
1882
2082
|
Repeater,
|
|
1883
2083
|
{
|
|
1884
2084
|
values: overlayValues ?? [],
|
|
@@ -1894,58 +2094,58 @@ var BackgroundOverlayRepeaterControl = createControl(() => {
|
|
|
1894
2094
|
));
|
|
1895
2095
|
});
|
|
1896
2096
|
var ItemContent2 = ({ bind }) => {
|
|
1897
|
-
return /* @__PURE__ */
|
|
2097
|
+
return /* @__PURE__ */ React38.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React38.createElement(Content2, null));
|
|
1898
2098
|
};
|
|
1899
2099
|
var Content2 = () => {
|
|
1900
2100
|
const { getTabsProps, getTabProps, getTabPanelProps } = useBackgroundTabsHistory({
|
|
1901
2101
|
image: getInitialBackgroundOverlay().value,
|
|
1902
2102
|
color: initialBackgroundColorOverlay.value
|
|
1903
2103
|
});
|
|
1904
|
-
return /* @__PURE__ */
|
|
2104
|
+
return /* @__PURE__ */ React38.createElement(Box4, { sx: { width: "100%" } }, /* @__PURE__ */ React38.createElement(Box4, { sx: { borderBottom: 1, borderColor: "divider" } }, /* @__PURE__ */ React38.createElement(Tabs, { ...getTabsProps(), "aria-label": __17("Background Overlay", "elementor") }, /* @__PURE__ */ React38.createElement(Tab, { label: __17("Image", "elementor"), ...getTabProps("image") }), /* @__PURE__ */ React38.createElement(Tab, { label: __17("Color", "elementor"), ...getTabProps("color") }))), /* @__PURE__ */ React38.createElement(TabPanel, { sx: { p: 1.5 }, ...getTabPanelProps("image") }, /* @__PURE__ */ React38.createElement(PopoverContent, null, /* @__PURE__ */ React38.createElement(ImageOverlayContent, null))), /* @__PURE__ */ React38.createElement(TabPanel, { ...getTabPanelProps("color"), sx: { p: 1.5 } }, /* @__PURE__ */ React38.createElement(Grid13, { container: true, spacing: 1, alignItems: "center" }, /* @__PURE__ */ React38.createElement(Grid13, { item: true, xs: 12 }, /* @__PURE__ */ React38.createElement(ColorControl, { propTypeUtil: backgroundColorOverlayPropTypeUtil2 })))));
|
|
1905
2105
|
};
|
|
1906
2106
|
var ItemIcon2 = ({ value }) => {
|
|
1907
2107
|
switch (value.$$type) {
|
|
1908
2108
|
case "background-image-overlay":
|
|
1909
|
-
return /* @__PURE__ */
|
|
2109
|
+
return /* @__PURE__ */ React38.createElement(ItemIconImage, { value });
|
|
1910
2110
|
case "background-color-overlay":
|
|
1911
|
-
return /* @__PURE__ */
|
|
2111
|
+
return /* @__PURE__ */ React38.createElement(ItemIconColor, { value });
|
|
1912
2112
|
default:
|
|
1913
2113
|
return null;
|
|
1914
2114
|
}
|
|
1915
2115
|
};
|
|
1916
2116
|
var ItemIconColor = ({ value }) => {
|
|
1917
|
-
return /* @__PURE__ */
|
|
2117
|
+
return /* @__PURE__ */ React38.createElement(UnstableColorIndicator2, { size: "inherit", component: "span", value: value.value });
|
|
1918
2118
|
};
|
|
1919
2119
|
var ItemIconImage = ({ value }) => {
|
|
1920
2120
|
const { imageUrl } = useImage(value);
|
|
1921
|
-
return /* @__PURE__ */
|
|
2121
|
+
return /* @__PURE__ */ React38.createElement(CardMedia3, { image: imageUrl, sx: { height: 13, width: 13, borderRadius: "4px" } });
|
|
1922
2122
|
};
|
|
1923
2123
|
var ItemLabel2 = ({ value }) => {
|
|
1924
2124
|
switch (value.$$type) {
|
|
1925
2125
|
case "background-image-overlay":
|
|
1926
|
-
return /* @__PURE__ */
|
|
2126
|
+
return /* @__PURE__ */ React38.createElement(ItemLabelImage, { value });
|
|
1927
2127
|
case "background-color-overlay":
|
|
1928
|
-
return /* @__PURE__ */
|
|
2128
|
+
return /* @__PURE__ */ React38.createElement(ItemLabelColor, { value });
|
|
1929
2129
|
default:
|
|
1930
2130
|
return null;
|
|
1931
2131
|
}
|
|
1932
2132
|
};
|
|
1933
2133
|
var ItemLabelColor = ({ value }) => {
|
|
1934
|
-
return /* @__PURE__ */
|
|
2134
|
+
return /* @__PURE__ */ React38.createElement("span", null, value.value);
|
|
1935
2135
|
};
|
|
1936
2136
|
var ItemLabelImage = ({ value }) => {
|
|
1937
2137
|
const { imageTitle } = useImage(value);
|
|
1938
|
-
return /* @__PURE__ */
|
|
2138
|
+
return /* @__PURE__ */ React38.createElement("span", null, imageTitle);
|
|
1939
2139
|
};
|
|
1940
2140
|
var ImageOverlayContent = () => {
|
|
1941
2141
|
const propContext = useBoundProp(backgroundImageOverlayPropTypeUtil2);
|
|
1942
|
-
return /* @__PURE__ */
|
|
2142
|
+
return /* @__PURE__ */ React38.createElement(PropProvider, { ...propContext }, /* @__PURE__ */ React38.createElement(PropKeyProvider, { bind: "image" }, /* @__PURE__ */ React38.createElement(Grid13, { container: true, spacing: 1, alignItems: "center" }, /* @__PURE__ */ React38.createElement(Grid13, { item: true, xs: 12 }, /* @__PURE__ */ React38.createElement(
|
|
1943
2143
|
ImageControl,
|
|
1944
2144
|
{
|
|
1945
2145
|
resolutionLabel: __17("Resolution", "elementor"),
|
|
1946
2146
|
sizes: backgroundResolutionOptions
|
|
1947
2147
|
}
|
|
1948
|
-
)))), /* @__PURE__ */
|
|
2148
|
+
)))), /* @__PURE__ */ React38.createElement(PropKeyProvider, { bind: "position" }, /* @__PURE__ */ React38.createElement(BackgroundImageOverlayPosition, null)), /* @__PURE__ */ React38.createElement(PropKeyProvider, { bind: "repeat" }, /* @__PURE__ */ React38.createElement(BackgroundImageOverlayRepeat, null)), /* @__PURE__ */ React38.createElement(PropKeyProvider, { bind: "size" }, /* @__PURE__ */ React38.createElement(BackgroundImageOverlaySize, null)), /* @__PURE__ */ React38.createElement(PropKeyProvider, { bind: "attachment" }, /* @__PURE__ */ React38.createElement(BackgroundImageOverlayAttachment, null)));
|
|
1949
2149
|
};
|
|
1950
2150
|
var useImage = (image) => {
|
|
1951
2151
|
let imageTitle, imageUrl = null;
|
|
@@ -1965,7 +2165,7 @@ var useImage = (image) => {
|
|
|
1965
2165
|
// src/controls/background-control/background-control.tsx
|
|
1966
2166
|
var BackgroundControl = createControl(() => {
|
|
1967
2167
|
const propContext = useBoundProp(backgroundPropTypeUtil);
|
|
1968
|
-
return /* @__PURE__ */
|
|
2168
|
+
return /* @__PURE__ */ React39.createElement(PropProvider, { ...propContext }, /* @__PURE__ */ React39.createElement(SectionContent, null, /* @__PURE__ */ React39.createElement(PropKeyProvider, { bind: "background-overlay" }, /* @__PURE__ */ React39.createElement(BackgroundOverlayRepeaterControl, null)), /* @__PURE__ */ React39.createElement(PropKeyProvider, { bind: "color" }, /* @__PURE__ */ React39.createElement(Grid14, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React39.createElement(Grid14, { item: true, xs: 6 }, /* @__PURE__ */ React39.createElement(ControlLabel, null, __18("Color", "elementor"))), /* @__PURE__ */ React39.createElement(Grid14, { item: true, xs: 6 }, /* @__PURE__ */ React39.createElement(ColorControl, null))))));
|
|
1969
2169
|
});
|
|
1970
2170
|
export {
|
|
1971
2171
|
BackgroundControl,
|