@elementor/editor-controls 0.32.0 → 0.34.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 -2
- package/dist/index.d.ts +6 -2
- package/dist/index.js +154 -84
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +152 -82
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
- package/src/bound-prop-context/prop-context.tsx +3 -0
- package/src/bound-prop-context/prop-key-context.tsx +1 -0
- package/src/bound-prop-context/use-bound-prop.ts +1 -0
- package/src/components/control-toggle-button-group.tsx +6 -2
- package/src/components/popover-content.tsx +4 -2
- package/src/components/repeater.tsx +19 -10
- package/src/components/text-field-inner-selection.tsx +6 -0
- package/src/control-actions/control-actions.tsx +10 -2
- package/src/controls/aspect-ratio-control.tsx +14 -6
- package/src/controls/background-control/background-control.tsx +16 -19
- package/src/controls/background-control/background-overlay/background-overlay-repeater-control.tsx +2 -1
- package/src/controls/box-shadow-repeater-control.tsx +2 -1
- package/src/controls/color-control.tsx +2 -1
- package/src/controls/equal-unequal-sizes-control.tsx +25 -14
- package/src/controls/font-family-control/font-family-control.tsx +2 -1
- package/src/controls/gap-control.tsx +4 -1
- package/src/controls/linked-dimensions-control.tsx +36 -10
- package/src/controls/number-control.tsx +2 -1
- package/src/controls/select-control.tsx +2 -1
- package/src/controls/size-control.tsx +35 -27
- package/src/controls/switch-control.tsx +2 -2
- package/src/controls/text-area-control.tsx +2 -1
- package/src/controls/text-control.tsx +2 -1
- package/src/controls/toggle-control.tsx +3 -1
- package/src/controls/url-control.tsx +2 -1
package/dist/index.mjs
CHANGED
|
@@ -30,7 +30,8 @@ var PropProvider = ({
|
|
|
30
30
|
value,
|
|
31
31
|
setValue,
|
|
32
32
|
propType,
|
|
33
|
-
placeholder
|
|
33
|
+
placeholder,
|
|
34
|
+
disabled
|
|
34
35
|
}) => {
|
|
35
36
|
return /* @__PURE__ */ React.createElement(
|
|
36
37
|
PropContext.Provider,
|
|
@@ -39,7 +40,8 @@ var PropProvider = ({
|
|
|
39
40
|
value,
|
|
40
41
|
propType,
|
|
41
42
|
setValue,
|
|
42
|
-
placeholder
|
|
43
|
+
placeholder,
|
|
44
|
+
disabled
|
|
43
45
|
}
|
|
44
46
|
},
|
|
45
47
|
children
|
|
@@ -301,14 +303,19 @@ var FloatingBarContainer = styled("span")`
|
|
|
301
303
|
.MuiFloatingActionBar-popper:has( .MuiFloatingActionBar-actions:empty ) {
|
|
302
304
|
display: none;
|
|
303
305
|
}
|
|
306
|
+
|
|
307
|
+
.MuiFloatingActionBar-popper {
|
|
308
|
+
z-index: 1000;
|
|
309
|
+
}
|
|
304
310
|
`;
|
|
305
311
|
function ControlActions({ children }) {
|
|
306
312
|
const { items } = useControlActions();
|
|
307
|
-
|
|
313
|
+
const { disabled } = useBoundProp();
|
|
314
|
+
if (items.length === 0 || disabled) {
|
|
308
315
|
return children;
|
|
309
316
|
}
|
|
310
317
|
const menuItems = items.map(({ MenuItem: MenuItem2, id }) => /* @__PURE__ */ React7.createElement(MenuItem2, { key: id }));
|
|
311
|
-
return /* @__PURE__ */ React7.createElement(FloatingBarContainer, null, /* @__PURE__ */ React7.createElement(UnstableFloatingActionBar, { actions: menuItems }, children));
|
|
318
|
+
return /* @__PURE__ */ React7.createElement(FloatingBarContainer, null, /* @__PURE__ */ React7.createElement(UnstableFloatingActionBar, { actions: menuItems, placement: "bottom-start" }, children));
|
|
312
319
|
}
|
|
313
320
|
|
|
314
321
|
// src/controls/image-media-control.tsx
|
|
@@ -359,7 +366,7 @@ import { stringPropTypeUtil } from "@elementor/editor-props";
|
|
|
359
366
|
import { MenuListItem } from "@elementor/editor-ui";
|
|
360
367
|
import { Select } from "@elementor/ui";
|
|
361
368
|
var SelectControl = createControl(({ options, onChange }) => {
|
|
362
|
-
const { value, setValue } = useBoundProp(stringPropTypeUtil);
|
|
369
|
+
const { value, setValue, disabled } = useBoundProp(stringPropTypeUtil);
|
|
363
370
|
const handleChange = (event) => {
|
|
364
371
|
const newValue = event.target.value || null;
|
|
365
372
|
onChange?.(newValue, value);
|
|
@@ -373,6 +380,7 @@ var SelectControl = createControl(({ options, onChange }) => {
|
|
|
373
380
|
size: "tiny",
|
|
374
381
|
value: value ?? "",
|
|
375
382
|
onChange: handleChange,
|
|
383
|
+
disabled,
|
|
376
384
|
fullWidth: true
|
|
377
385
|
},
|
|
378
386
|
options.map(({ label, ...props }) => /* @__PURE__ */ React9.createElement(MenuListItem, { key: props.value, ...props, value: props.value ?? "" }, label))
|
|
@@ -394,13 +402,14 @@ import * as React11 from "react";
|
|
|
394
402
|
import { stringPropTypeUtil as stringPropTypeUtil2 } from "@elementor/editor-props";
|
|
395
403
|
import { TextField } from "@elementor/ui";
|
|
396
404
|
var TextControl = createControl(({ placeholder }) => {
|
|
397
|
-
const { value, setValue } = useBoundProp(stringPropTypeUtil2);
|
|
405
|
+
const { value, setValue, disabled } = useBoundProp(stringPropTypeUtil2);
|
|
398
406
|
const handleChange = (event) => setValue(event.target.value);
|
|
399
407
|
return /* @__PURE__ */ React11.createElement(ControlActions, null, /* @__PURE__ */ React11.createElement(
|
|
400
408
|
TextField,
|
|
401
409
|
{
|
|
402
410
|
size: "tiny",
|
|
403
411
|
fullWidth: true,
|
|
412
|
+
disabled,
|
|
404
413
|
value: value ?? "",
|
|
405
414
|
onChange: handleChange,
|
|
406
415
|
placeholder
|
|
@@ -413,7 +422,7 @@ import * as React12 from "react";
|
|
|
413
422
|
import { stringPropTypeUtil as stringPropTypeUtil3 } from "@elementor/editor-props";
|
|
414
423
|
import { TextField as TextField2 } from "@elementor/ui";
|
|
415
424
|
var TextAreaControl = createControl(({ placeholder }) => {
|
|
416
|
-
const { value, setValue } = useBoundProp(stringPropTypeUtil3);
|
|
425
|
+
const { value, setValue, disabled } = useBoundProp(stringPropTypeUtil3);
|
|
417
426
|
const handleChange = (event) => {
|
|
418
427
|
setValue(event.target.value);
|
|
419
428
|
};
|
|
@@ -424,6 +433,7 @@ var TextAreaControl = createControl(({ placeholder }) => {
|
|
|
424
433
|
multiline: true,
|
|
425
434
|
fullWidth: true,
|
|
426
435
|
minRows: 5,
|
|
436
|
+
disabled,
|
|
427
437
|
value: value ?? "",
|
|
428
438
|
onChange: handleChange,
|
|
429
439
|
placeholder
|
|
@@ -435,7 +445,7 @@ var TextAreaControl = createControl(({ placeholder }) => {
|
|
|
435
445
|
import * as React14 from "react";
|
|
436
446
|
import { useRef } from "react";
|
|
437
447
|
import { sizePropTypeUtil, stringPropTypeUtil as stringPropTypeUtil4 } from "@elementor/editor-props";
|
|
438
|
-
import { InputAdornment as InputAdornment2 } from "@elementor/ui";
|
|
448
|
+
import { Box, InputAdornment as InputAdornment2 } from "@elementor/ui";
|
|
439
449
|
|
|
440
450
|
// src/components/text-field-inner-selection.tsx
|
|
441
451
|
import * as React13 from "react";
|
|
@@ -452,7 +462,8 @@ var TextFieldInnerSelection = forwardRef(
|
|
|
452
462
|
onKeyDown,
|
|
453
463
|
onKeyUp,
|
|
454
464
|
endAdornment,
|
|
455
|
-
startAdornment
|
|
465
|
+
startAdornment,
|
|
466
|
+
disabled
|
|
456
467
|
}, ref) => {
|
|
457
468
|
return /* @__PURE__ */ React13.createElement(
|
|
458
469
|
TextField3,
|
|
@@ -462,6 +473,7 @@ var TextFieldInnerSelection = forwardRef(
|
|
|
462
473
|
fullWidth: true,
|
|
463
474
|
type,
|
|
464
475
|
value,
|
|
476
|
+
disabled,
|
|
465
477
|
onChange,
|
|
466
478
|
onKeyDown,
|
|
467
479
|
onKeyUp,
|
|
@@ -478,7 +490,8 @@ var TextFieldInnerSelection = forwardRef(
|
|
|
478
490
|
var SelectionEndAdornment = ({
|
|
479
491
|
options,
|
|
480
492
|
onClick,
|
|
481
|
-
value
|
|
493
|
+
value,
|
|
494
|
+
disabled
|
|
482
495
|
}) => {
|
|
483
496
|
const popupState = usePopupState({
|
|
484
497
|
variant: "popover",
|
|
@@ -493,6 +506,7 @@ var SelectionEndAdornment = ({
|
|
|
493
506
|
{
|
|
494
507
|
size: "small",
|
|
495
508
|
color: "secondary",
|
|
509
|
+
disabled,
|
|
496
510
|
sx: { font: "inherit", minWidth: "initial", textTransform: "uppercase" },
|
|
497
511
|
...bindTrigger(popupState)
|
|
498
512
|
},
|
|
@@ -539,7 +553,7 @@ var defaultUnit = "px";
|
|
|
539
553
|
var defaultSize = NaN;
|
|
540
554
|
var SizeControl = createControl(
|
|
541
555
|
({ units: units2 = defaultUnits, extendedValues = [], placeholder, startIcon }) => {
|
|
542
|
-
const { value: sizeValue, setValue: setSizeValue, restoreValue } = useBoundProp(sizePropTypeUtil);
|
|
556
|
+
const { value: sizeValue, setValue: setSizeValue, restoreValue, disabled } = useBoundProp(sizePropTypeUtil);
|
|
543
557
|
const [state, setState] = useSyncExternalState({
|
|
544
558
|
external: sizeValue,
|
|
545
559
|
setExternal: setSizeValue,
|
|
@@ -563,6 +577,7 @@ var SizeControl = createControl(
|
|
|
563
577
|
return /* @__PURE__ */ React14.createElement(
|
|
564
578
|
Input,
|
|
565
579
|
{
|
|
580
|
+
disabled,
|
|
566
581
|
size: state.size,
|
|
567
582
|
unit: state.unit,
|
|
568
583
|
placeholder,
|
|
@@ -606,7 +621,8 @@ var SizeInput = ({
|
|
|
606
621
|
startIcon,
|
|
607
622
|
onBlur,
|
|
608
623
|
size,
|
|
609
|
-
unit
|
|
624
|
+
unit,
|
|
625
|
+
disabled
|
|
610
626
|
}) => {
|
|
611
627
|
const unitInputBufferRef = useRef("");
|
|
612
628
|
const handleKeyUp = (event) => {
|
|
@@ -623,26 +639,25 @@ var SizeInput = ({
|
|
|
623
639
|
handleUnitChange(matchedUnit);
|
|
624
640
|
}
|
|
625
641
|
};
|
|
626
|
-
return /* @__PURE__ */ React14.createElement(ControlActions, null, /* @__PURE__ */ React14.createElement(
|
|
642
|
+
return /* @__PURE__ */ React14.createElement(ControlActions, null, /* @__PURE__ */ React14.createElement(Box, null, /* @__PURE__ */ React14.createElement(
|
|
627
643
|
TextFieldInnerSelection,
|
|
628
644
|
{
|
|
645
|
+
disabled,
|
|
629
646
|
endAdornment: /* @__PURE__ */ React14.createElement(
|
|
630
647
|
SelectionEndAdornment,
|
|
631
648
|
{
|
|
649
|
+
disabled,
|
|
632
650
|
options: units2,
|
|
633
651
|
onClick: handleUnitChange,
|
|
634
652
|
value: unit ?? defaultUnit
|
|
635
653
|
}
|
|
636
654
|
),
|
|
637
655
|
placeholder,
|
|
638
|
-
startAdornment: startIcon ? /* @__PURE__ */ React14.createElement(InputAdornment2, { position: "start" }, startIcon) : void 0,
|
|
656
|
+
startAdornment: startIcon ? /* @__PURE__ */ React14.createElement(InputAdornment2, { position: "start", disabled }, startIcon) : void 0,
|
|
639
657
|
type: "number",
|
|
640
658
|
value: Number.isNaN(size) ? "" : size,
|
|
641
659
|
onChange: handleSizeChange,
|
|
642
|
-
onBlur
|
|
643
|
-
unitInputBufferRef.current = "";
|
|
644
|
-
onBlur?.(event);
|
|
645
|
-
},
|
|
660
|
+
onBlur,
|
|
646
661
|
onKeyDown: (event) => {
|
|
647
662
|
if (RESTRICTED_INPUT_KEYS.includes(event.key)) {
|
|
648
663
|
event.preventDefault();
|
|
@@ -650,7 +665,7 @@ var SizeInput = ({
|
|
|
650
665
|
},
|
|
651
666
|
onKeyUp: handleKeyUp
|
|
652
667
|
}
|
|
653
|
-
));
|
|
668
|
+
)));
|
|
654
669
|
};
|
|
655
670
|
|
|
656
671
|
// src/controls/stroke-control.tsx
|
|
@@ -670,7 +685,7 @@ import { colorPropTypeUtil } from "@elementor/editor-props";
|
|
|
670
685
|
import { UnstableColorField } from "@elementor/ui";
|
|
671
686
|
var ColorControl = createControl(
|
|
672
687
|
({ propTypeUtil = colorPropTypeUtil, anchorEl, slotProps = {}, ...props }) => {
|
|
673
|
-
const { value, setValue } = useBoundProp(propTypeUtil);
|
|
688
|
+
const { value, setValue, disabled } = useBoundProp(propTypeUtil);
|
|
674
689
|
const handleChange = (selectedColor) => {
|
|
675
690
|
setValue(selectedColor || null);
|
|
676
691
|
};
|
|
@@ -682,6 +697,7 @@ var ColorControl = createControl(
|
|
|
682
697
|
value: value ?? "",
|
|
683
698
|
onChange: handleChange,
|
|
684
699
|
...props,
|
|
700
|
+
disabled,
|
|
685
701
|
slotProps: {
|
|
686
702
|
...slotProps,
|
|
687
703
|
colorPicker: {
|
|
@@ -718,7 +734,7 @@ import { __ as __5 } from "@wordpress/i18n";
|
|
|
718
734
|
// src/components/popover-content.tsx
|
|
719
735
|
import * as React18 from "react";
|
|
720
736
|
import { Stack as Stack4 } from "@elementor/ui";
|
|
721
|
-
var PopoverContent = ({ alignItems, gap = 1.5, p, children }) => /* @__PURE__ */ React18.createElement(Stack4, { alignItems, gap, p }, children);
|
|
737
|
+
var PopoverContent = ({ alignItems, gap = 1.5, p, pt, pb, children }) => /* @__PURE__ */ React18.createElement(Stack4, { alignItems, gap, p, pt, pb }, children);
|
|
722
738
|
|
|
723
739
|
// src/components/popover-grid-container.tsx
|
|
724
740
|
import * as React19 from "react";
|
|
@@ -737,7 +753,7 @@ import { CopyIcon, EyeIcon, EyeOffIcon, PlusIcon, XIcon } from "@elementor/icons
|
|
|
737
753
|
import {
|
|
738
754
|
bindPopover,
|
|
739
755
|
bindTrigger as bindTrigger2,
|
|
740
|
-
Box,
|
|
756
|
+
Box as Box2,
|
|
741
757
|
IconButton,
|
|
742
758
|
Popover,
|
|
743
759
|
Stack as Stack5,
|
|
@@ -860,6 +876,7 @@ var EMPTY_OPEN_ITEM = -1;
|
|
|
860
876
|
var Repeater = ({
|
|
861
877
|
label,
|
|
862
878
|
itemSettings,
|
|
879
|
+
disabled = false,
|
|
863
880
|
openOnAdd = false,
|
|
864
881
|
addToBottom = false,
|
|
865
882
|
values: repeaterValues = [],
|
|
@@ -913,8 +930,8 @@ var Repeater = ({
|
|
|
913
930
|
setItems(
|
|
914
931
|
items.map((value, pos) => {
|
|
915
932
|
if (pos === index) {
|
|
916
|
-
const { disabled, ...rest } = value;
|
|
917
|
-
return { ...rest, ...
|
|
933
|
+
const { disabled: propDisabled, ...rest } = value;
|
|
934
|
+
return { ...rest, ...propDisabled ? {} : { disabled: true } };
|
|
918
935
|
}
|
|
919
936
|
return value;
|
|
920
937
|
})
|
|
@@ -929,6 +946,7 @@ var Repeater = ({
|
|
|
929
946
|
});
|
|
930
947
|
});
|
|
931
948
|
};
|
|
949
|
+
const ItemWrapper = disabled ? React23.Fragment : SortableItem;
|
|
932
950
|
return /* @__PURE__ */ React23.createElement(SectionContent, null, /* @__PURE__ */ React23.createElement(
|
|
933
951
|
Stack5,
|
|
934
952
|
{
|
|
@@ -943,8 +961,9 @@ var Repeater = ({
|
|
|
943
961
|
/* @__PURE__ */ React23.createElement(
|
|
944
962
|
IconButton,
|
|
945
963
|
{
|
|
946
|
-
sx: { ml: "auto" },
|
|
947
964
|
size: SIZE,
|
|
965
|
+
sx: { ml: "auto" },
|
|
966
|
+
disabled,
|
|
948
967
|
onClick: addRepeaterItem,
|
|
949
968
|
"aria-label": __4("Add item", "elementor")
|
|
950
969
|
},
|
|
@@ -955,10 +974,11 @@ var Repeater = ({
|
|
|
955
974
|
if (!value) {
|
|
956
975
|
return null;
|
|
957
976
|
}
|
|
958
|
-
return /* @__PURE__ */ React23.createElement(
|
|
977
|
+
return /* @__PURE__ */ React23.createElement(ItemWrapper, { id: key, key: `sortable-${key}` }, /* @__PURE__ */ React23.createElement(
|
|
959
978
|
RepeaterItem,
|
|
960
979
|
{
|
|
961
|
-
disabled
|
|
980
|
+
disabled,
|
|
981
|
+
propDisabled: value?.disabled,
|
|
962
982
|
label: /* @__PURE__ */ React23.createElement(RepeaterItemLabelSlot, { value }, /* @__PURE__ */ React23.createElement(itemSettings.Label, { value })),
|
|
963
983
|
startIcon: /* @__PURE__ */ React23.createElement(RepeaterItemIconSlot, { value }, /* @__PURE__ */ React23.createElement(itemSettings.Icon, { value })),
|
|
964
984
|
removeItem: () => removeRepeaterItem(index),
|
|
@@ -973,23 +993,25 @@ var Repeater = ({
|
|
|
973
993
|
};
|
|
974
994
|
var RepeaterItem = ({
|
|
975
995
|
label,
|
|
976
|
-
|
|
996
|
+
propDisabled,
|
|
977
997
|
startIcon,
|
|
978
998
|
children,
|
|
979
999
|
removeItem,
|
|
980
1000
|
duplicateItem,
|
|
981
1001
|
toggleDisableItem,
|
|
982
1002
|
openOnMount,
|
|
983
|
-
onOpen
|
|
1003
|
+
onOpen,
|
|
1004
|
+
disabled
|
|
984
1005
|
}) => {
|
|
985
1006
|
const [anchorEl, setAnchorEl] = useState3(null);
|
|
986
1007
|
const { popoverState, popoverProps, ref, setRef } = usePopover(openOnMount, onOpen);
|
|
987
1008
|
const duplicateLabel = __4("Duplicate", "elementor");
|
|
988
|
-
const toggleLabel =
|
|
1009
|
+
const toggleLabel = propDisabled ? __4("Show", "elementor") : __4("Hide", "elementor");
|
|
989
1010
|
const removeLabel = __4("Remove", "elementor");
|
|
990
1011
|
return /* @__PURE__ */ React23.createElement(React23.Fragment, null, /* @__PURE__ */ React23.createElement(
|
|
991
1012
|
UnstableTag,
|
|
992
1013
|
{
|
|
1014
|
+
disabled,
|
|
993
1015
|
label,
|
|
994
1016
|
showActionsOnHover: true,
|
|
995
1017
|
fullWidth: true,
|
|
@@ -998,7 +1020,7 @@ var RepeaterItem = ({
|
|
|
998
1020
|
"aria-label": __4("Open item", "elementor"),
|
|
999
1021
|
...bindTrigger2(popoverState),
|
|
1000
1022
|
startIcon,
|
|
1001
|
-
actions: /* @__PURE__ */ React23.createElement(React23.Fragment, null, /* @__PURE__ */ React23.createElement(Tooltip, { title: duplicateLabel, placement: "top" }, /* @__PURE__ */ React23.createElement(IconButton, { size: SIZE, onClick: duplicateItem, "aria-label": duplicateLabel }, /* @__PURE__ */ React23.createElement(CopyIcon, { fontSize: SIZE }))), /* @__PURE__ */ React23.createElement(Tooltip, { title: toggleLabel, placement: "top" }, /* @__PURE__ */ React23.createElement(IconButton, { size: SIZE, onClick: toggleDisableItem, "aria-label": toggleLabel },
|
|
1023
|
+
actions: /* @__PURE__ */ React23.createElement(React23.Fragment, null, /* @__PURE__ */ React23.createElement(Tooltip, { title: duplicateLabel, placement: "top" }, /* @__PURE__ */ React23.createElement(IconButton, { size: SIZE, onClick: duplicateItem, "aria-label": duplicateLabel }, /* @__PURE__ */ React23.createElement(CopyIcon, { fontSize: SIZE }))), /* @__PURE__ */ React23.createElement(Tooltip, { title: toggleLabel, placement: "top" }, /* @__PURE__ */ React23.createElement(IconButton, { size: SIZE, onClick: toggleDisableItem, "aria-label": toggleLabel }, propDisabled ? /* @__PURE__ */ React23.createElement(EyeOffIcon, { fontSize: SIZE }) : /* @__PURE__ */ React23.createElement(EyeIcon, { fontSize: SIZE }))), /* @__PURE__ */ React23.createElement(Tooltip, { title: removeLabel, placement: "top" }, /* @__PURE__ */ React23.createElement(IconButton, { size: SIZE, onClick: removeItem, "aria-label": removeLabel }, /* @__PURE__ */ React23.createElement(XIcon, { fontSize: SIZE }))))
|
|
1002
1024
|
}
|
|
1003
1025
|
), /* @__PURE__ */ React23.createElement(
|
|
1004
1026
|
Popover,
|
|
@@ -1014,7 +1036,7 @@ var RepeaterItem = ({
|
|
|
1014
1036
|
...popoverProps,
|
|
1015
1037
|
anchorEl: ref
|
|
1016
1038
|
},
|
|
1017
|
-
/* @__PURE__ */ React23.createElement(
|
|
1039
|
+
/* @__PURE__ */ React23.createElement(Box2, null, children({ anchorEl }))
|
|
1018
1040
|
));
|
|
1019
1041
|
};
|
|
1020
1042
|
var usePopover = (openOnMount, onOpen) => {
|
|
@@ -1037,11 +1059,12 @@ var usePopover = (openOnMount, onOpen) => {
|
|
|
1037
1059
|
|
|
1038
1060
|
// src/controls/box-shadow-repeater-control.tsx
|
|
1039
1061
|
var BoxShadowRepeaterControl = createControl(() => {
|
|
1040
|
-
const { propType, value, setValue } = useBoundProp(boxShadowPropTypeUtil);
|
|
1062
|
+
const { propType, value, setValue, disabled } = useBoundProp(boxShadowPropTypeUtil);
|
|
1041
1063
|
return /* @__PURE__ */ React24.createElement(PropProvider, { propType, value, setValue }, /* @__PURE__ */ React24.createElement(
|
|
1042
1064
|
Repeater,
|
|
1043
1065
|
{
|
|
1044
1066
|
openOnAdd: true,
|
|
1067
|
+
disabled,
|
|
1045
1068
|
values: value ?? [],
|
|
1046
1069
|
setValues: setValue,
|
|
1047
1070
|
label: __5("Box shadow", "elementor"),
|
|
@@ -1172,7 +1195,8 @@ var ControlToggleButtonGroup = ({
|
|
|
1172
1195
|
items,
|
|
1173
1196
|
maxItems,
|
|
1174
1197
|
exclusive = false,
|
|
1175
|
-
fullWidth = false
|
|
1198
|
+
fullWidth = false,
|
|
1199
|
+
disabled
|
|
1176
1200
|
}) => {
|
|
1177
1201
|
const shouldSliceItems = exclusive && maxItems !== void 0 && items.length > maxItems;
|
|
1178
1202
|
const menuItems = shouldSliceItems ? items.slice(maxItems - 1) : [];
|
|
@@ -1187,13 +1211,14 @@ var ControlToggleButtonGroup = ({
|
|
|
1187
1211
|
const templateColumnsSuffix = isOffLimits ? "auto" : "";
|
|
1188
1212
|
return `repeat(${itemsCount}, minmax(0, 25%)) ${templateColumnsSuffix}`;
|
|
1189
1213
|
}, [menuItems?.length, fixedItems.length]);
|
|
1190
|
-
return /* @__PURE__ */ React26.createElement(
|
|
1214
|
+
return /* @__PURE__ */ React26.createElement(ControlActions, null, /* @__PURE__ */ React26.createElement(
|
|
1191
1215
|
StyledToggleButtonGroup,
|
|
1192
1216
|
{
|
|
1193
1217
|
justify,
|
|
1194
1218
|
value,
|
|
1195
1219
|
onChange: handleChange,
|
|
1196
1220
|
exclusive,
|
|
1221
|
+
disabled,
|
|
1197
1222
|
sx: {
|
|
1198
1223
|
direction: isRtl ? "rtl /* @noflip */" : "ltr /* @noflip */",
|
|
1199
1224
|
display: "grid",
|
|
@@ -1321,7 +1346,7 @@ var ToggleControl = createControl(
|
|
|
1321
1346
|
exclusive = true,
|
|
1322
1347
|
maxItems
|
|
1323
1348
|
}) => {
|
|
1324
|
-
const { value, setValue, placeholder } = useBoundProp(stringPropTypeUtil5);
|
|
1349
|
+
const { value, setValue, placeholder, disabled } = useBoundProp(stringPropTypeUtil5);
|
|
1325
1350
|
const exclusiveValues = options.filter((option) => option.exclusive).map((option) => option.value);
|
|
1326
1351
|
const handleNonExclusiveToggle = (selectedValues) => {
|
|
1327
1352
|
const newSelectedValue = selectedValues[selectedValues.length - 1];
|
|
@@ -1341,6 +1366,7 @@ var ToggleControl = createControl(
|
|
|
1341
1366
|
...toggleButtonGroupProps,
|
|
1342
1367
|
value: value ?? placeholder ?? null,
|
|
1343
1368
|
onChange: setValue,
|
|
1369
|
+
disabled,
|
|
1344
1370
|
exclusive: true
|
|
1345
1371
|
}
|
|
1346
1372
|
) : /* @__PURE__ */ React27.createElement(
|
|
@@ -1349,6 +1375,7 @@ var ToggleControl = createControl(
|
|
|
1349
1375
|
...toggleButtonGroupProps,
|
|
1350
1376
|
value: (value ?? placeholder)?.split(" ") ?? [],
|
|
1351
1377
|
onChange: handleNonExclusiveToggle,
|
|
1378
|
+
disabled,
|
|
1352
1379
|
exclusive: false
|
|
1353
1380
|
}
|
|
1354
1381
|
);
|
|
@@ -1369,7 +1396,7 @@ var NumberControl = createControl(
|
|
|
1369
1396
|
step = 1,
|
|
1370
1397
|
shouldForceInt = false
|
|
1371
1398
|
}) => {
|
|
1372
|
-
const { value, setValue } = useBoundProp(numberPropTypeUtil);
|
|
1399
|
+
const { value, setValue, disabled } = useBoundProp(numberPropTypeUtil);
|
|
1373
1400
|
const handleChange = (event) => {
|
|
1374
1401
|
const eventValue = event.target.value;
|
|
1375
1402
|
if (isEmptyOrNaN(eventValue)) {
|
|
@@ -1385,6 +1412,7 @@ var NumberControl = createControl(
|
|
|
1385
1412
|
size: "tiny",
|
|
1386
1413
|
type: "number",
|
|
1387
1414
|
fullWidth: true,
|
|
1415
|
+
disabled,
|
|
1388
1416
|
value: isEmptyOrNaN(value) ? "" : value,
|
|
1389
1417
|
onChange: handleChange,
|
|
1390
1418
|
placeholder,
|
|
@@ -1403,6 +1431,7 @@ var NumberControl = createControl(
|
|
|
1403
1431
|
import * as React30 from "react";
|
|
1404
1432
|
import { useId as useId2, useRef as useRef3 } from "react";
|
|
1405
1433
|
import { sizePropTypeUtil as sizePropTypeUtil2 } from "@elementor/editor-props";
|
|
1434
|
+
import { isExperimentActive } from "@elementor/editor-v1-adapters";
|
|
1406
1435
|
import { bindPopover as bindPopover2, bindToggle, Grid as Grid5, Popover as Popover2, Stack as Stack7, ToggleButton as ToggleButton2, Tooltip as Tooltip3, usePopupState as usePopupState3 } from "@elementor/ui";
|
|
1407
1436
|
import { __ as __6 } from "@wordpress/i18n";
|
|
1408
1437
|
|
|
@@ -1437,9 +1466,10 @@ function EqualUnequalSizesControl({
|
|
|
1437
1466
|
const {
|
|
1438
1467
|
propType: multiSizePropType,
|
|
1439
1468
|
value: multiSizeValue,
|
|
1440
|
-
setValue: setMultiSizeValue
|
|
1469
|
+
setValue: setMultiSizeValue,
|
|
1470
|
+
disabled: multiSizeDisabled
|
|
1441
1471
|
} = useBoundProp(multiSizePropTypeUtil);
|
|
1442
|
-
const { value: sizeValue, setValue: setSizeValue } = useBoundProp(sizePropTypeUtil2);
|
|
1472
|
+
const { value: sizeValue, setValue: setSizeValue, disabled: sizeDisabled } = useBoundProp(sizePropTypeUtil2);
|
|
1443
1473
|
const splitEqualValue = () => {
|
|
1444
1474
|
if (!sizeValue) {
|
|
1445
1475
|
return null;
|
|
@@ -1475,7 +1505,8 @@ function EqualUnequalSizesControl({
|
|
|
1475
1505
|
sx: { marginLeft: "auto" },
|
|
1476
1506
|
...bindToggle(popupState),
|
|
1477
1507
|
selected: popupState.isOpen,
|
|
1478
|
-
"aria-label": tooltipLabel
|
|
1508
|
+
"aria-label": tooltipLabel,
|
|
1509
|
+
disabled: multiSizeDisabled || sizeDisabled
|
|
1479
1510
|
},
|
|
1480
1511
|
icon
|
|
1481
1512
|
))))), /* @__PURE__ */ React30.createElement(
|
|
@@ -1496,14 +1527,18 @@ function EqualUnequalSizesControl({
|
|
|
1496
1527
|
paper: { sx: { mt: 0.5, width: controlRef.current?.getBoundingClientRect().width } }
|
|
1497
1528
|
}
|
|
1498
1529
|
},
|
|
1499
|
-
/* @__PURE__ */ React30.createElement(PropProvider, { propType: multiSizePropType, value: getMultiSizeValues(), setValue: setNestedProp }, /* @__PURE__ */ React30.createElement(PopoverContent, { p: 1.5 }, /* @__PURE__ */ React30.createElement(PopoverGridContainer, null, /* @__PURE__ */ React30.createElement(MultiSizeValueControl, { item: items[0] }), /* @__PURE__ */ React30.createElement(MultiSizeValueControl, { item: items[1] })), /* @__PURE__ */ React30.createElement(PopoverGridContainer, null, /* @__PURE__ */ React30.createElement(MultiSizeValueControl, { item: items[2] }), /* @__PURE__ */ React30.createElement(MultiSizeValueControl, { item: items[3] }))))
|
|
1530
|
+
/* @__PURE__ */ React30.createElement(PropProvider, { propType: multiSizePropType, value: getMultiSizeValues(), setValue: setNestedProp }, /* @__PURE__ */ React30.createElement(PopoverContent, { p: 1.5, pt: 2.5, pb: 3 }, /* @__PURE__ */ React30.createElement(PopoverGridContainer, null, /* @__PURE__ */ React30.createElement(MultiSizeValueControl, { item: items[0] }), /* @__PURE__ */ React30.createElement(MultiSizeValueControl, { item: items[1] })), /* @__PURE__ */ React30.createElement(PopoverGridContainer, null, /* @__PURE__ */ React30.createElement(MultiSizeValueControl, { item: items[2] }), /* @__PURE__ */ React30.createElement(MultiSizeValueControl, { item: items[3] }))))
|
|
1500
1531
|
));
|
|
1501
1532
|
}
|
|
1502
|
-
var MultiSizeValueControl = ({ item }) =>
|
|
1533
|
+
var MultiSizeValueControl = ({ item }) => {
|
|
1534
|
+
const isUsingNestedProps = isExperimentActive("e_v_3_30");
|
|
1535
|
+
return /* @__PURE__ */ React30.createElement(PropKeyProvider, { bind: item.bind }, /* @__PURE__ */ React30.createElement(Grid5, { item: true, xs: 6 }, /* @__PURE__ */ React30.createElement(Grid5, { container: true, gap: 0.75, alignItems: "center" }, /* @__PURE__ */ React30.createElement(Grid5, { item: true, xs: 12 }, isUsingNestedProps ? /* @__PURE__ */ React30.createElement(ControlLabel, null, item.label) : /* @__PURE__ */ React30.createElement(ControlFormLabel, null, item.label)), /* @__PURE__ */ React30.createElement(Grid5, { item: true, xs: 12 }, /* @__PURE__ */ React30.createElement(SizeControl, { startIcon: item.icon })))));
|
|
1536
|
+
};
|
|
1503
1537
|
|
|
1504
1538
|
// src/controls/linked-dimensions-control.tsx
|
|
1505
1539
|
import * as React31 from "react";
|
|
1506
1540
|
import { dimensionsPropTypeUtil, sizePropTypeUtil as sizePropTypeUtil3 } from "@elementor/editor-props";
|
|
1541
|
+
import { isExperimentActive as isExperimentActive2 } from "@elementor/editor-v1-adapters";
|
|
1507
1542
|
import { DetachIcon, LinkIcon, SideBottomIcon, SideLeftIcon, SideRightIcon, SideTopIcon } from "@elementor/icons";
|
|
1508
1543
|
import { Grid as Grid6, Stack as Stack8, ToggleButton as ToggleButton3, Tooltip as Tooltip4 } from "@elementor/ui";
|
|
1509
1544
|
import { __ as __7 } from "@wordpress/i18n";
|
|
@@ -1513,13 +1548,15 @@ var LinkedDimensionsControl = createControl(
|
|
|
1513
1548
|
isSiteRtl = false,
|
|
1514
1549
|
extendedValues
|
|
1515
1550
|
}) => {
|
|
1551
|
+
const { value: sizeValue, setValue: setSizeValue, disabled: sizeDisabled } = useBoundProp(sizePropTypeUtil3);
|
|
1516
1552
|
const {
|
|
1517
1553
|
value: dimensionsValue,
|
|
1518
1554
|
setValue: setDimensionsValue,
|
|
1519
|
-
propType
|
|
1555
|
+
propType,
|
|
1556
|
+
disabled: dimensionsDisabled
|
|
1520
1557
|
} = useBoundProp(dimensionsPropTypeUtil);
|
|
1521
|
-
const { value: sizeValue, setValue: setSizeValue } = useBoundProp(sizePropTypeUtil3);
|
|
1522
1558
|
const isLinked = !dimensionsValue && !sizeValue ? true : !!sizeValue;
|
|
1559
|
+
const isUsingNestedProps = isExperimentActive2("e_v_3_30");
|
|
1523
1560
|
const onLinkToggle = () => {
|
|
1524
1561
|
if (!isLinked) {
|
|
1525
1562
|
setSizeValue(dimensionsValue["block-start"]?.value ?? null);
|
|
@@ -1537,7 +1574,7 @@ var LinkedDimensionsControl = createControl(
|
|
|
1537
1574
|
const LinkedIcon = isLinked ? LinkIcon : DetachIcon;
|
|
1538
1575
|
const linkedLabel = __7("Link %s", "elementor").replace("%s", tooltipLabel);
|
|
1539
1576
|
const unlinkedLabel = __7("Unlink %s", "elementor").replace("%s", tooltipLabel);
|
|
1540
|
-
return /* @__PURE__ */ React31.createElement(PropProvider, { propType, value: dimensionsValue, setValue: setDimensionsValue }, /* @__PURE__ */ React31.createElement(Stack8, { direction: "row", gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React31.createElement(ControlLabel, null, label), /* @__PURE__ */ React31.createElement(Tooltip4, { title: isLinked ? unlinkedLabel : linkedLabel, placement: "top" }, /* @__PURE__ */ React31.createElement(
|
|
1577
|
+
return /* @__PURE__ */ React31.createElement(PropProvider, { propType, value: dimensionsValue, setValue: setDimensionsValue }, /* @__PURE__ */ React31.createElement(Stack8, { direction: "row", gap: 2, flexWrap: "nowrap" }, isUsingNestedProps ? /* @__PURE__ */ React31.createElement(ControlFormLabel, null, label) : /* @__PURE__ */ React31.createElement(ControlLabel, null, label), /* @__PURE__ */ React31.createElement(Tooltip4, { title: isLinked ? unlinkedLabel : linkedLabel, placement: "top" }, /* @__PURE__ */ React31.createElement(
|
|
1541
1578
|
ToggleButton3,
|
|
1542
1579
|
{
|
|
1543
1580
|
"aria-label": isLinked ? unlinkedLabel : linkedLabel,
|
|
@@ -1545,10 +1582,11 @@ var LinkedDimensionsControl = createControl(
|
|
|
1545
1582
|
value: "check",
|
|
1546
1583
|
selected: isLinked,
|
|
1547
1584
|
sx: { marginLeft: "auto" },
|
|
1548
|
-
onChange: onLinkToggle
|
|
1585
|
+
onChange: onLinkToggle,
|
|
1586
|
+
disabled: sizeDisabled || dimensionsDisabled
|
|
1549
1587
|
},
|
|
1550
1588
|
/* @__PURE__ */ React31.createElement(LinkedIcon, { fontSize: "tiny" })
|
|
1551
|
-
))), /* @__PURE__ */ React31.createElement(Stack8, { direction: "row", gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React31.createElement(Grid6, { container: true, gap: 0.75, alignItems: "center" }, /* @__PURE__ */ React31.createElement(Grid6, { item: true, xs: 12 }, /* @__PURE__ */ React31.createElement(
|
|
1589
|
+
))), /* @__PURE__ */ React31.createElement(Stack8, { direction: "row", gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React31.createElement(Grid6, { container: true, gap: 0.75, alignItems: "center" }, /* @__PURE__ */ React31.createElement(Grid6, { item: true, xs: 12 }, /* @__PURE__ */ React31.createElement(Label, { bind: "block-start", label: __7("Top", "elementor") })), /* @__PURE__ */ React31.createElement(Grid6, { item: true, xs: 12 }, /* @__PURE__ */ React31.createElement(
|
|
1552
1590
|
Control3,
|
|
1553
1591
|
{
|
|
1554
1592
|
bind: "block-start",
|
|
@@ -1556,7 +1594,13 @@ var LinkedDimensionsControl = createControl(
|
|
|
1556
1594
|
isLinked,
|
|
1557
1595
|
extendedValues
|
|
1558
1596
|
}
|
|
1559
|
-
))), /* @__PURE__ */ React31.createElement(Grid6, { container: true, gap: 0.75, alignItems: "center" }, /* @__PURE__ */ React31.createElement(Grid6, { item: true, xs: 12 }, /* @__PURE__ */ React31.createElement(
|
|
1597
|
+
))), /* @__PURE__ */ React31.createElement(Grid6, { container: true, gap: 0.75, alignItems: "center" }, /* @__PURE__ */ React31.createElement(Grid6, { item: true, xs: 12 }, /* @__PURE__ */ React31.createElement(
|
|
1598
|
+
Label,
|
|
1599
|
+
{
|
|
1600
|
+
bind: "inline-end",
|
|
1601
|
+
label: isSiteRtl ? __7("Left", "elementor") : __7("Right", "elementor")
|
|
1602
|
+
}
|
|
1603
|
+
)), /* @__PURE__ */ React31.createElement(Grid6, { item: true, xs: 12 }, /* @__PURE__ */ React31.createElement(
|
|
1560
1604
|
Control3,
|
|
1561
1605
|
{
|
|
1562
1606
|
bind: "inline-end",
|
|
@@ -1564,7 +1608,7 @@ var LinkedDimensionsControl = createControl(
|
|
|
1564
1608
|
isLinked,
|
|
1565
1609
|
extendedValues
|
|
1566
1610
|
}
|
|
1567
|
-
)))), /* @__PURE__ */ React31.createElement(Stack8, { direction: "row", gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React31.createElement(Grid6, { container: true, gap: 0.75, alignItems: "center" }, /* @__PURE__ */ React31.createElement(Grid6, { item: true, xs: 12 }, /* @__PURE__ */ React31.createElement(
|
|
1611
|
+
)))), /* @__PURE__ */ React31.createElement(Stack8, { direction: "row", gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React31.createElement(Grid6, { container: true, gap: 0.75, alignItems: "center" }, /* @__PURE__ */ React31.createElement(Grid6, { item: true, xs: 12 }, /* @__PURE__ */ React31.createElement(Label, { bind: "block-end", label: __7("Bottom", "elementor") })), /* @__PURE__ */ React31.createElement(Grid6, { item: true, xs: 12 }, /* @__PURE__ */ React31.createElement(
|
|
1568
1612
|
Control3,
|
|
1569
1613
|
{
|
|
1570
1614
|
bind: "block-end",
|
|
@@ -1572,7 +1616,13 @@ var LinkedDimensionsControl = createControl(
|
|
|
1572
1616
|
isLinked,
|
|
1573
1617
|
extendedValues
|
|
1574
1618
|
}
|
|
1575
|
-
))), /* @__PURE__ */ React31.createElement(Grid6, { container: true, gap: 0.75, alignItems: "center" }, /* @__PURE__ */ React31.createElement(Grid6, { item: true, xs: 12 }, /* @__PURE__ */ React31.createElement(
|
|
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(
|
|
1576
1626
|
Control3,
|
|
1577
1627
|
{
|
|
1578
1628
|
bind: "inline-start",
|
|
@@ -1594,6 +1644,13 @@ var Control3 = ({
|
|
|
1594
1644
|
}
|
|
1595
1645
|
return /* @__PURE__ */ React31.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React31.createElement(SizeControl, { startIcon, extendedValues }));
|
|
1596
1646
|
};
|
|
1647
|
+
var Label = ({ label, bind }) => {
|
|
1648
|
+
const isUsingNestedProps = isExperimentActive2("e_v_3_30");
|
|
1649
|
+
if (!isUsingNestedProps) {
|
|
1650
|
+
return /* @__PURE__ */ React31.createElement(ControlFormLabel, null, label);
|
|
1651
|
+
}
|
|
1652
|
+
return /* @__PURE__ */ React31.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React31.createElement(ControlLabel, null, label));
|
|
1653
|
+
};
|
|
1597
1654
|
|
|
1598
1655
|
// src/controls/font-family-control/font-family-control.tsx
|
|
1599
1656
|
import * as React32 from "react";
|
|
@@ -1603,7 +1660,7 @@ import { ChevronDownIcon as ChevronDownIcon2, SearchIcon, TextIcon, XIcon as XIc
|
|
|
1603
1660
|
import {
|
|
1604
1661
|
bindPopover as bindPopover3,
|
|
1605
1662
|
bindTrigger as bindTrigger3,
|
|
1606
|
-
Box as
|
|
1663
|
+
Box as Box3,
|
|
1607
1664
|
Divider as Divider2,
|
|
1608
1665
|
IconButton as IconButton2,
|
|
1609
1666
|
InputAdornment as InputAdornment3,
|
|
@@ -1648,7 +1705,7 @@ var enqueueFont = (fontFamily, context = "editor") => {
|
|
|
1648
1705
|
var SIZE2 = "tiny";
|
|
1649
1706
|
var FontFamilyControl = createControl(({ fontFamilies }) => {
|
|
1650
1707
|
const [searchValue, setSearchValue] = useState5("");
|
|
1651
|
-
const { value: fontFamily, setValue: setFontFamily } = useBoundProp(stringPropTypeUtil6);
|
|
1708
|
+
const { value: fontFamily, setValue: setFontFamily, disabled } = useBoundProp(stringPropTypeUtil6);
|
|
1652
1709
|
const popoverState = usePopupState4({ variant: "popover" });
|
|
1653
1710
|
const filteredFontFamilies = useFilteredFontFamilies(fontFamilies, searchValue);
|
|
1654
1711
|
const handleSearch = (event) => {
|
|
@@ -1665,7 +1722,8 @@ var FontFamilyControl = createControl(({ fontFamilies }) => {
|
|
|
1665
1722
|
label: fontFamily,
|
|
1666
1723
|
endIcon: /* @__PURE__ */ React32.createElement(ChevronDownIcon2, { fontSize: "tiny" }),
|
|
1667
1724
|
...bindTrigger3(popoverState),
|
|
1668
|
-
fullWidth: true
|
|
1725
|
+
fullWidth: true,
|
|
1726
|
+
disabled
|
|
1669
1727
|
}
|
|
1670
1728
|
)), /* @__PURE__ */ React32.createElement(
|
|
1671
1729
|
Popover3,
|
|
@@ -1676,7 +1734,7 @@ var FontFamilyControl = createControl(({ fontFamilies }) => {
|
|
|
1676
1734
|
...bindPopover3(popoverState),
|
|
1677
1735
|
onClose: handleClose
|
|
1678
1736
|
},
|
|
1679
|
-
/* @__PURE__ */ React32.createElement(Stack9, null, /* @__PURE__ */ React32.createElement(Stack9, { direction: "row", alignItems: "center", pl: 1.5, pr: 0.5, py: 1.5 }, /* @__PURE__ */ React32.createElement(TextIcon, { fontSize: SIZE2, sx: { mr: 0.5 } }), /* @__PURE__ */ React32.createElement(Typography3, { variant: "subtitle2" }, __8("Font Family", "elementor")), /* @__PURE__ */ React32.createElement(IconButton2, { size: SIZE2, sx: { ml: "auto" }, onClick: handleClose }, /* @__PURE__ */ React32.createElement(XIcon2, { fontSize: SIZE2 }))), /* @__PURE__ */ React32.createElement(
|
|
1737
|
+
/* @__PURE__ */ React32.createElement(Stack9, null, /* @__PURE__ */ React32.createElement(Stack9, { direction: "row", alignItems: "center", pl: 1.5, pr: 0.5, py: 1.5 }, /* @__PURE__ */ React32.createElement(TextIcon, { fontSize: SIZE2, sx: { mr: 0.5 } }), /* @__PURE__ */ React32.createElement(Typography3, { variant: "subtitle2" }, __8("Font Family", "elementor")), /* @__PURE__ */ React32.createElement(IconButton2, { size: SIZE2, sx: { ml: "auto" }, onClick: handleClose }, /* @__PURE__ */ React32.createElement(XIcon2, { fontSize: SIZE2 }))), /* @__PURE__ */ React32.createElement(Box3, { px: 1.5, pb: 1 }, /* @__PURE__ */ React32.createElement(
|
|
1680
1738
|
TextField5,
|
|
1681
1739
|
{
|
|
1682
1740
|
autoFocus: true,
|
|
@@ -1697,7 +1755,7 @@ var FontFamilyControl = createControl(({ fontFamilies }) => {
|
|
|
1697
1755
|
handleClose,
|
|
1698
1756
|
fontFamily
|
|
1699
1757
|
}
|
|
1700
|
-
) : /* @__PURE__ */ React32.createElement(
|
|
1758
|
+
) : /* @__PURE__ */ React32.createElement(Box3, { sx: { overflowY: "auto", height: 260, width: 220 } }, /* @__PURE__ */ React32.createElement(Stack9, { alignItems: "center", p: 2.5, gap: 1.5, overflow: "hidden" }, /* @__PURE__ */ React32.createElement(TextIcon, { fontSize: "large" }), /* @__PURE__ */ React32.createElement(Box3, { sx: { maxWidth: 160, overflow: "hidden" } }, /* @__PURE__ */ React32.createElement(Typography3, { align: "center", variant: "subtitle2", color: "text.secondary" }, __8("Sorry, nothing matched", "elementor")), /* @__PURE__ */ React32.createElement(
|
|
1701
1759
|
Typography3,
|
|
1702
1760
|
{
|
|
1703
1761
|
variant: "subtitle2",
|
|
@@ -1758,7 +1816,7 @@ var FontList = ({ fontListItems, setFontFamily, handleClose, fontFamily }) => {
|
|
|
1758
1816
|
[fontFamily]
|
|
1759
1817
|
);
|
|
1760
1818
|
return /* @__PURE__ */ React32.createElement(
|
|
1761
|
-
|
|
1819
|
+
Box3,
|
|
1762
1820
|
{
|
|
1763
1821
|
ref: containerRef,
|
|
1764
1822
|
sx: {
|
|
@@ -1867,7 +1925,7 @@ import * as React33 from "react";
|
|
|
1867
1925
|
import { urlPropTypeUtil } from "@elementor/editor-props";
|
|
1868
1926
|
import { TextField as TextField6 } from "@elementor/ui";
|
|
1869
1927
|
var UrlControl = createControl(({ placeholder }) => {
|
|
1870
|
-
const { value, setValue } = useBoundProp(urlPropTypeUtil);
|
|
1928
|
+
const { value, setValue, disabled } = useBoundProp(urlPropTypeUtil);
|
|
1871
1929
|
const handleChange = (event) => setValue(event.target.value);
|
|
1872
1930
|
return /* @__PURE__ */ React33.createElement(ControlActions, null, /* @__PURE__ */ React33.createElement(
|
|
1873
1931
|
TextField6,
|
|
@@ -1875,6 +1933,7 @@ var UrlControl = createControl(({ placeholder }) => {
|
|
|
1875
1933
|
size: "tiny",
|
|
1876
1934
|
fullWidth: true,
|
|
1877
1935
|
value: value ?? "",
|
|
1936
|
+
disabled,
|
|
1878
1937
|
onChange: handleChange,
|
|
1879
1938
|
placeholder
|
|
1880
1939
|
}
|
|
@@ -1896,7 +1955,7 @@ import { InfoTipCard } from "@elementor/editor-ui";
|
|
|
1896
1955
|
import { httpService as httpService2 } from "@elementor/http-client";
|
|
1897
1956
|
import { AlertTriangleIcon, MinusIcon, PlusIcon as PlusIcon2 } from "@elementor/icons";
|
|
1898
1957
|
import { useSessionStorage } from "@elementor/session";
|
|
1899
|
-
import { Box as
|
|
1958
|
+
import { Box as Box5, Collapse, Grid as Grid7, IconButton as IconButton4, Infotip, Stack as Stack10, Switch } from "@elementor/ui";
|
|
1900
1959
|
import { debounce as debounce2 } from "@elementor/utils";
|
|
1901
1960
|
import { __ as __9 } from "@wordpress/i18n";
|
|
1902
1961
|
|
|
@@ -1906,7 +1965,7 @@ import { forwardRef as forwardRef2 } from "react";
|
|
|
1906
1965
|
import { XIcon as XIcon3 } from "@elementor/icons";
|
|
1907
1966
|
import {
|
|
1908
1967
|
Autocomplete as AutocompleteBase,
|
|
1909
|
-
Box as
|
|
1968
|
+
Box as Box4,
|
|
1910
1969
|
IconButton as IconButton3,
|
|
1911
1970
|
InputAdornment as InputAdornment4,
|
|
1912
1971
|
TextField as TextField7
|
|
@@ -1945,7 +2004,7 @@ var Autocomplete = forwardRef2((props, ref) => {
|
|
|
1945
2004
|
groupBy: isCategorizedOptionPool(options) ? (optionId) => findMatchingOption(options, optionId)?.groupLabel || optionId : void 0,
|
|
1946
2005
|
isOptionEqualToValue,
|
|
1947
2006
|
filterOptions: () => optionKeys,
|
|
1948
|
-
renderOption: (optionProps, optionId) => /* @__PURE__ */ React34.createElement(
|
|
2007
|
+
renderOption: (optionProps, optionId) => /* @__PURE__ */ React34.createElement(Box4, { component: "li", ...optionProps, key: optionProps.id }, findMatchingOption(options, optionId)?.label ?? optionId),
|
|
1949
2008
|
renderInput: (params) => /* @__PURE__ */ React34.createElement(
|
|
1950
2009
|
TextInput,
|
|
1951
2010
|
{
|
|
@@ -2190,7 +2249,7 @@ var ConditionalInfoTip = ({ linkInLinkRestriction, isVisible, children }) => {
|
|
|
2190
2249
|
}
|
|
2191
2250
|
)
|
|
2192
2251
|
},
|
|
2193
|
-
/* @__PURE__ */ React35.createElement(
|
|
2252
|
+
/* @__PURE__ */ React35.createElement(Box5, null, children)
|
|
2194
2253
|
) : /* @__PURE__ */ React35.createElement(React35.Fragment, null, children);
|
|
2195
2254
|
};
|
|
2196
2255
|
var INFOTIP_CONTENT = {
|
|
@@ -2208,9 +2267,10 @@ var GapControl = createControl(({ label }) => {
|
|
|
2208
2267
|
const {
|
|
2209
2268
|
value: directionValue,
|
|
2210
2269
|
setValue: setDirectionValue,
|
|
2211
|
-
propType
|
|
2270
|
+
propType,
|
|
2271
|
+
disabled: directionDisabled
|
|
2212
2272
|
} = useBoundProp(layoutDirectionPropTypeUtil);
|
|
2213
|
-
const { value: sizeValue, setValue: setSizeValue } = useBoundProp(sizePropTypeUtil4);
|
|
2273
|
+
const { value: sizeValue, setValue: setSizeValue, disabled: sizeDisabled } = useBoundProp(sizePropTypeUtil4);
|
|
2214
2274
|
const isLinked = !directionValue && !sizeValue ? true : !!sizeValue;
|
|
2215
2275
|
const onLinkToggle = () => {
|
|
2216
2276
|
if (!isLinked) {
|
|
@@ -2235,7 +2295,8 @@ var GapControl = createControl(({ label }) => {
|
|
|
2235
2295
|
value: "check",
|
|
2236
2296
|
selected: isLinked,
|
|
2237
2297
|
sx: { marginLeft: "auto" },
|
|
2238
|
-
onChange: onLinkToggle
|
|
2298
|
+
onChange: onLinkToggle,
|
|
2299
|
+
disabled: sizeDisabled || directionDisabled
|
|
2239
2300
|
},
|
|
2240
2301
|
/* @__PURE__ */ React36.createElement(LinkedIcon, { fontSize: "tiny" })
|
|
2241
2302
|
))), /* @__PURE__ */ React36.createElement(Stack11, { direction: "row", gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React36.createElement(Grid8, { container: true, gap: 0.75, alignItems: "center" }, /* @__PURE__ */ React36.createElement(Grid8, { item: true, xs: 12 }, /* @__PURE__ */ React36.createElement(ControlFormLabel, null, __10("Column", "elementor"))), /* @__PURE__ */ React36.createElement(Grid8, { item: true, xs: 12 }, /* @__PURE__ */ React36.createElement(Control4, { bind: "column", isLinked }))), /* @__PURE__ */ React36.createElement(Grid8, { container: true, gap: 0.75, alignItems: "center" }, /* @__PURE__ */ React36.createElement(Grid8, { item: true, xs: 12 }, /* @__PURE__ */ React36.createElement(ControlFormLabel, null, __10("Row", "elementor"))), /* @__PURE__ */ React36.createElement(Grid8, { item: true, xs: 12 }, /* @__PURE__ */ React36.createElement(Control4, { bind: "row", isLinked })))));
|
|
@@ -2252,6 +2313,7 @@ import * as React37 from "react";
|
|
|
2252
2313
|
import { useState as useState7 } from "react";
|
|
2253
2314
|
import { stringPropTypeUtil as stringPropTypeUtil8 } from "@elementor/editor-props";
|
|
2254
2315
|
import { MenuListItem as MenuListItem3 } from "@elementor/editor-ui";
|
|
2316
|
+
import { ArrowsMoveHorizontalIcon, ArrowsMoveVerticalIcon } from "@elementor/icons";
|
|
2255
2317
|
import { Grid as Grid9, Select as Select2, Stack as Stack12, TextField as TextField8 } from "@elementor/ui";
|
|
2256
2318
|
import { __ as __11 } from "@wordpress/i18n";
|
|
2257
2319
|
var RATIO_OPTIONS = [
|
|
@@ -2266,7 +2328,7 @@ var RATIO_OPTIONS = [
|
|
|
2266
2328
|
];
|
|
2267
2329
|
var CUSTOM_RATIO = "custom";
|
|
2268
2330
|
var AspectRatioControl = createControl(({ label }) => {
|
|
2269
|
-
const { value: aspectRatioValue, setValue: setAspectRatioValue } = useBoundProp(stringPropTypeUtil8);
|
|
2331
|
+
const { value: aspectRatioValue, setValue: setAspectRatioValue, disabled } = useBoundProp(stringPropTypeUtil8);
|
|
2270
2332
|
const isCustomSelected = aspectRatioValue && !RATIO_OPTIONS.some((option) => option.value === aspectRatioValue);
|
|
2271
2333
|
const [initialWidth, initialHeight] = isCustomSelected ? aspectRatioValue.split("/") : ["", ""];
|
|
2272
2334
|
const [isCustom, setIsCustom] = useState7(isCustomSelected);
|
|
@@ -2299,12 +2361,13 @@ var AspectRatioControl = createControl(({ label }) => {
|
|
|
2299
2361
|
setAspectRatioValue(`${customWidth}/${newHeight}`);
|
|
2300
2362
|
}
|
|
2301
2363
|
};
|
|
2302
|
-
return /* @__PURE__ */ React37.createElement(Stack12, { direction: "column", gap: 2 }, /* @__PURE__ */ React37.createElement(Grid9, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React37.createElement(Grid9, { item: true, xs: 6 }, /* @__PURE__ */ React37.createElement(ControlLabel, null, label)), /* @__PURE__ */ React37.createElement(Grid9, { item: true, xs: 6 }, /* @__PURE__ */ React37.createElement(
|
|
2364
|
+
return /* @__PURE__ */ React37.createElement(Stack12, { direction: "column", pt: 2, gap: 2 }, /* @__PURE__ */ React37.createElement(Grid9, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React37.createElement(Grid9, { item: true, xs: 6 }, /* @__PURE__ */ React37.createElement(ControlLabel, null, label)), /* @__PURE__ */ React37.createElement(Grid9, { item: true, xs: 6 }, /* @__PURE__ */ React37.createElement(
|
|
2303
2365
|
Select2,
|
|
2304
2366
|
{
|
|
2305
|
-
sx: { overflow: "hidden" },
|
|
2306
|
-
displayEmpty: true,
|
|
2307
2367
|
size: "tiny",
|
|
2368
|
+
displayEmpty: true,
|
|
2369
|
+
sx: { overflow: "hidden" },
|
|
2370
|
+
disabled,
|
|
2308
2371
|
value: selectedValue,
|
|
2309
2372
|
onChange: handleSelectChange,
|
|
2310
2373
|
fullWidth: true
|
|
@@ -2318,9 +2381,12 @@ var AspectRatioControl = createControl(({ label }) => {
|
|
|
2318
2381
|
size: "tiny",
|
|
2319
2382
|
type: "number",
|
|
2320
2383
|
fullWidth: true,
|
|
2384
|
+
disabled,
|
|
2321
2385
|
value: customWidth,
|
|
2322
2386
|
onChange: handleCustomWidthChange,
|
|
2323
|
-
|
|
2387
|
+
InputProps: {
|
|
2388
|
+
startAdornment: /* @__PURE__ */ React37.createElement(ArrowsMoveHorizontalIcon, { fontSize: "tiny" })
|
|
2389
|
+
}
|
|
2324
2390
|
}
|
|
2325
2391
|
)), /* @__PURE__ */ React37.createElement(Grid9, { item: true, xs: 6 }, /* @__PURE__ */ React37.createElement(
|
|
2326
2392
|
TextField8,
|
|
@@ -2328,9 +2394,12 @@ var AspectRatioControl = createControl(({ label }) => {
|
|
|
2328
2394
|
size: "tiny",
|
|
2329
2395
|
type: "number",
|
|
2330
2396
|
fullWidth: true,
|
|
2397
|
+
disabled,
|
|
2331
2398
|
value: customHeight,
|
|
2332
2399
|
onChange: handleCustomHeightChange,
|
|
2333
|
-
|
|
2400
|
+
InputProps: {
|
|
2401
|
+
startAdornment: /* @__PURE__ */ React37.createElement(ArrowsMoveVerticalIcon, { fontSize: "tiny" })
|
|
2402
|
+
}
|
|
2334
2403
|
}
|
|
2335
2404
|
))));
|
|
2336
2405
|
});
|
|
@@ -2515,7 +2584,7 @@ var SvgMediaControl = createControl(() => {
|
|
|
2515
2584
|
// src/controls/background-control/background-control.tsx
|
|
2516
2585
|
import * as React46 from "react";
|
|
2517
2586
|
import { backgroundPropTypeUtil } from "@elementor/editor-props";
|
|
2518
|
-
import { isExperimentActive } from "@elementor/editor-v1-adapters";
|
|
2587
|
+
import { isExperimentActive as isExperimentActive3 } from "@elementor/editor-v1-adapters";
|
|
2519
2588
|
import { Grid as Grid15 } from "@elementor/ui";
|
|
2520
2589
|
import { __ as __19 } from "@wordpress/i18n";
|
|
2521
2590
|
|
|
@@ -2527,7 +2596,7 @@ import {
|
|
|
2527
2596
|
backgroundOverlayPropTypeUtil,
|
|
2528
2597
|
colorPropTypeUtil as colorPropTypeUtil3
|
|
2529
2598
|
} from "@elementor/editor-props";
|
|
2530
|
-
import { Box as
|
|
2599
|
+
import { Box as Box6, CardMedia as CardMedia3, Grid as Grid14, styled as styled6, Tab, TabPanel, Tabs, UnstableColorIndicator as UnstableColorIndicator2 } from "@elementor/ui";
|
|
2531
2600
|
import { useWpMediaAttachment as useWpMediaAttachment3 } from "@elementor/wp-media";
|
|
2532
2601
|
import { __ as __18 } from "@wordpress/i18n";
|
|
2533
2602
|
|
|
@@ -2714,8 +2783,8 @@ import { backgroundImageSizeScalePropTypeUtil, stringPropTypeUtil as stringPropT
|
|
|
2714
2783
|
import {
|
|
2715
2784
|
ArrowBarBothIcon,
|
|
2716
2785
|
ArrowsMaximizeIcon,
|
|
2717
|
-
ArrowsMoveHorizontalIcon,
|
|
2718
|
-
ArrowsMoveVerticalIcon,
|
|
2786
|
+
ArrowsMoveHorizontalIcon as ArrowsMoveHorizontalIcon2,
|
|
2787
|
+
ArrowsMoveVerticalIcon as ArrowsMoveVerticalIcon2,
|
|
2719
2788
|
LetterAIcon,
|
|
2720
2789
|
PencilIcon
|
|
2721
2790
|
} from "@elementor/icons";
|
|
@@ -2769,13 +2838,13 @@ var BackgroundImageOverlaySize = () => {
|
|
|
2769
2838
|
)))), isCustom ? /* @__PURE__ */ React44.createElement(PropProvider, { ...backgroundImageScaleContext }, /* @__PURE__ */ React44.createElement(Grid13, { item: true, xs: 12 }, /* @__PURE__ */ React44.createElement(PopoverGridContainer, null, /* @__PURE__ */ React44.createElement(Grid13, { item: true, xs: 6 }, /* @__PURE__ */ React44.createElement(PropKeyProvider, { bind: "width" }, /* @__PURE__ */ React44.createElement(
|
|
2770
2839
|
SizeControl,
|
|
2771
2840
|
{
|
|
2772
|
-
startIcon: /* @__PURE__ */ React44.createElement(
|
|
2841
|
+
startIcon: /* @__PURE__ */ React44.createElement(ArrowsMoveHorizontalIcon2, { fontSize: "tiny" }),
|
|
2773
2842
|
extendedValues: ["auto"]
|
|
2774
2843
|
}
|
|
2775
2844
|
))), /* @__PURE__ */ React44.createElement(Grid13, { item: true, xs: 6 }, /* @__PURE__ */ React44.createElement(PropKeyProvider, { bind: "height" }, /* @__PURE__ */ React44.createElement(
|
|
2776
2845
|
SizeControl,
|
|
2777
2846
|
{
|
|
2778
|
-
startIcon: /* @__PURE__ */ React44.createElement(
|
|
2847
|
+
startIcon: /* @__PURE__ */ React44.createElement(ArrowsMoveVerticalIcon2, { fontSize: "tiny" }),
|
|
2779
2848
|
extendedValues: ["auto"]
|
|
2780
2849
|
}
|
|
2781
2850
|
)))))) : null);
|
|
@@ -2881,11 +2950,12 @@ var backgroundResolutionOptions = [
|
|
|
2881
2950
|
{ label: __18("Full", "elementor"), value: "full" }
|
|
2882
2951
|
];
|
|
2883
2952
|
var BackgroundOverlayRepeaterControl = createControl(() => {
|
|
2884
|
-
const { propType, value: overlayValues, setValue } = useBoundProp(backgroundOverlayPropTypeUtil);
|
|
2953
|
+
const { propType, value: overlayValues, setValue, disabled } = useBoundProp(backgroundOverlayPropTypeUtil);
|
|
2885
2954
|
return /* @__PURE__ */ React45.createElement(PropProvider, { propType, value: overlayValues, setValue }, /* @__PURE__ */ React45.createElement(
|
|
2886
2955
|
Repeater,
|
|
2887
2956
|
{
|
|
2888
2957
|
openOnAdd: true,
|
|
2958
|
+
disabled,
|
|
2889
2959
|
values: overlayValues ?? [],
|
|
2890
2960
|
setValues: setValue,
|
|
2891
2961
|
label: __18("Overlay", "elementor"),
|
|
@@ -2907,7 +2977,7 @@ var Content2 = ({ anchorEl }) => {
|
|
|
2907
2977
|
color: initialBackgroundColorOverlay.value,
|
|
2908
2978
|
gradient: initialBackgroundGradientOverlay.value
|
|
2909
2979
|
});
|
|
2910
|
-
return /* @__PURE__ */ React45.createElement(
|
|
2980
|
+
return /* @__PURE__ */ React45.createElement(Box6, { sx: { width: "100%" } }, /* @__PURE__ */ React45.createElement(Box6, { sx: { borderBottom: 1, borderColor: "divider" } }, /* @__PURE__ */ React45.createElement(
|
|
2911
2981
|
Tabs,
|
|
2912
2982
|
{
|
|
2913
2983
|
size: "small",
|
|
@@ -3037,9 +3107,9 @@ var getGradientValue = (value) => {
|
|
|
3037
3107
|
// src/controls/background-control/background-control.tsx
|
|
3038
3108
|
var BackgroundControl = createControl(() => {
|
|
3039
3109
|
const propContext = useBoundProp(backgroundPropTypeUtil);
|
|
3040
|
-
const isUsingNestedProps =
|
|
3110
|
+
const isUsingNestedProps = isExperimentActive3("e_v_3_30");
|
|
3041
3111
|
const colorLabel = __19("Color", "elementor");
|
|
3042
|
-
return /* @__PURE__ */ React46.createElement(PropProvider, { ...propContext }, /* @__PURE__ */ React46.createElement(
|
|
3112
|
+
return /* @__PURE__ */ React46.createElement(PropProvider, { ...propContext }, /* @__PURE__ */ React46.createElement(PropKeyProvider, { bind: "background-overlay" }, /* @__PURE__ */ React46.createElement(BackgroundOverlayRepeaterControl, null)), /* @__PURE__ */ React46.createElement(PropKeyProvider, { bind: "color" }, /* @__PURE__ */ React46.createElement(Grid15, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React46.createElement(Grid15, { item: true, xs: 6 }, isUsingNestedProps ? /* @__PURE__ */ React46.createElement(ControlLabel, null, colorLabel) : /* @__PURE__ */ React46.createElement(ControlFormLabel, null, colorLabel)), /* @__PURE__ */ React46.createElement(Grid15, { item: true, xs: 6 }, /* @__PURE__ */ React46.createElement(ColorControl, null)))));
|
|
3043
3113
|
});
|
|
3044
3114
|
|
|
3045
3115
|
// src/controls/switch-control.tsx
|
|
@@ -3047,11 +3117,11 @@ import * as React47 from "react";
|
|
|
3047
3117
|
import { booleanPropTypeUtil as booleanPropTypeUtil2 } from "@elementor/editor-props";
|
|
3048
3118
|
import { Switch as Switch2 } from "@elementor/ui";
|
|
3049
3119
|
var SwitchControl2 = createControl(() => {
|
|
3050
|
-
const { value, setValue } = useBoundProp(booleanPropTypeUtil2);
|
|
3120
|
+
const { value, setValue, disabled } = useBoundProp(booleanPropTypeUtil2);
|
|
3051
3121
|
const handleChange = (event) => {
|
|
3052
3122
|
setValue(event.target.checked);
|
|
3053
3123
|
};
|
|
3054
|
-
return /* @__PURE__ */ React47.createElement("div", { style: { display: "flex", justifyContent: "flex-end" } }, /* @__PURE__ */ React47.createElement(Switch2, { checked: !!value, onChange: handleChange, size: "small" }));
|
|
3124
|
+
return /* @__PURE__ */ React47.createElement("div", { style: { display: "flex", justifyContent: "flex-end" } }, /* @__PURE__ */ React47.createElement(Switch2, { checked: !!value, onChange: handleChange, size: "small", disabled }));
|
|
3055
3125
|
});
|
|
3056
3126
|
export {
|
|
3057
3127
|
AspectRatioControl,
|