@elementor/editor-controls 0.5.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -0
- package/dist/index.d.mts +37 -13
- package/dist/index.d.ts +37 -13
- package/dist/index.js +390 -212
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +331 -147
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -2
- package/src/bound-prop-context/prop-context.tsx +11 -2
- package/src/bound-prop-context/prop-key-context.tsx +9 -2
- package/src/bound-prop-context/use-bound-prop.ts +1 -0
- package/src/components/repeater.tsx +5 -2
- package/src/controls/autocomplete-control.tsx +181 -0
- package/src/controls/background-control/background-overlay/background-overlay-repeater-control.tsx +32 -2
- package/src/controls/link-control.tsx +56 -26
- package/src/controls/url-control.tsx +7 -2
- package/src/index.ts +1 -0
package/dist/index.mjs
CHANGED
|
@@ -31,7 +31,17 @@ var PropProvider = ({
|
|
|
31
31
|
setValue,
|
|
32
32
|
propType
|
|
33
33
|
}) => {
|
|
34
|
-
return /* @__PURE__ */ React.createElement(
|
|
34
|
+
return /* @__PURE__ */ React.createElement(
|
|
35
|
+
PropContext.Provider,
|
|
36
|
+
{
|
|
37
|
+
value: {
|
|
38
|
+
value,
|
|
39
|
+
propType,
|
|
40
|
+
setValue
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
children
|
|
44
|
+
);
|
|
35
45
|
};
|
|
36
46
|
var usePropContext = () => {
|
|
37
47
|
const context = useContext(PropContext);
|
|
@@ -65,6 +75,7 @@ var PropKeyProvider = ({ children, bind }) => {
|
|
|
65
75
|
};
|
|
66
76
|
var ObjectPropKeyProvider = ({ children, bind }) => {
|
|
67
77
|
const context = usePropContext();
|
|
78
|
+
const { path } = useContext2(PropKeyContext) ?? {};
|
|
68
79
|
const setValue = (value2, options, meta) => {
|
|
69
80
|
const newValue = {
|
|
70
81
|
...context.value,
|
|
@@ -74,10 +85,17 @@ var ObjectPropKeyProvider = ({ children, bind }) => {
|
|
|
74
85
|
};
|
|
75
86
|
const value = context.value?.[bind];
|
|
76
87
|
const propType = context.propType.shape[bind];
|
|
77
|
-
return /* @__PURE__ */ React2.createElement(
|
|
88
|
+
return /* @__PURE__ */ React2.createElement(
|
|
89
|
+
PropKeyContext.Provider,
|
|
90
|
+
{
|
|
91
|
+
value: { ...context, value, setValue, bind, propType, path: [...path ?? [], bind] }
|
|
92
|
+
},
|
|
93
|
+
children
|
|
94
|
+
);
|
|
78
95
|
};
|
|
79
96
|
var ArrayPropKeyProvider = ({ children, bind }) => {
|
|
80
97
|
const context = usePropContext();
|
|
98
|
+
const { path } = useContext2(PropKeyContext) ?? {};
|
|
81
99
|
const setValue = (value2, options) => {
|
|
82
100
|
const newValue = [...context.value ?? []];
|
|
83
101
|
newValue[Number(bind)] = value2;
|
|
@@ -85,7 +103,13 @@ var ArrayPropKeyProvider = ({ children, bind }) => {
|
|
|
85
103
|
};
|
|
86
104
|
const value = context.value?.[Number(bind)];
|
|
87
105
|
const propType = context.propType.item_prop_type;
|
|
88
|
-
return /* @__PURE__ */ React2.createElement(
|
|
106
|
+
return /* @__PURE__ */ React2.createElement(
|
|
107
|
+
PropKeyContext.Provider,
|
|
108
|
+
{
|
|
109
|
+
value: { ...context, value, setValue, bind, propType, path: [...path ?? [], bind] }
|
|
110
|
+
},
|
|
111
|
+
children
|
|
112
|
+
);
|
|
89
113
|
};
|
|
90
114
|
var usePropKeyContext = () => {
|
|
91
115
|
const context = useContext2(PropKeyContext);
|
|
@@ -287,15 +311,129 @@ var ImageControl = createControl((props) => {
|
|
|
287
311
|
return /* @__PURE__ */ React10.createElement(PropProvider, { ...propContext }, /* @__PURE__ */ React10.createElement(Stack2, { gap: 1.5 }, /* @__PURE__ */ React10.createElement(PropKeyProvider, { bind: "src" }, /* @__PURE__ */ React10.createElement(ImageMediaControl, null)), /* @__PURE__ */ React10.createElement(PropKeyProvider, { bind: "size" }, /* @__PURE__ */ React10.createElement(Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React10.createElement(Grid, { item: true, xs: 6 }, /* @__PURE__ */ React10.createElement(ControlLabel, null, " ", __2("Image Resolution", "elementor"))), /* @__PURE__ */ React10.createElement(Grid, { item: true, xs: 6 }, /* @__PURE__ */ React10.createElement(SelectControl, { options: props.sizes }))))));
|
|
288
312
|
});
|
|
289
313
|
|
|
290
|
-
// src/controls/
|
|
314
|
+
// src/controls/autocomplete-control.tsx
|
|
291
315
|
import * as React11 from "react";
|
|
316
|
+
import { useState } from "react";
|
|
292
317
|
import { stringPropTypeUtil as stringPropTypeUtil2 } from "@elementor/editor-props";
|
|
293
|
-
import {
|
|
318
|
+
import { XIcon } from "@elementor/icons";
|
|
319
|
+
import {
|
|
320
|
+
Autocomplete,
|
|
321
|
+
Box,
|
|
322
|
+
IconButton,
|
|
323
|
+
InputAdornment,
|
|
324
|
+
TextField
|
|
325
|
+
} from "@elementor/ui";
|
|
326
|
+
var AutocompleteControl = createControl(
|
|
327
|
+
({
|
|
328
|
+
options,
|
|
329
|
+
placeholder = "",
|
|
330
|
+
allowCustomValues = false,
|
|
331
|
+
propType = stringPropTypeUtil2,
|
|
332
|
+
minInputLength = 2
|
|
333
|
+
}) => {
|
|
334
|
+
const { value = "", setValue } = useBoundProp(propType);
|
|
335
|
+
const [inputValue, setInputValue] = useState(
|
|
336
|
+
value && options[value]?.label ? options[value]?.label : value
|
|
337
|
+
);
|
|
338
|
+
const hasSelectedValue = !!(inputValue && (options[inputValue] || Object.values(options).find(({ label }) => label === inputValue)));
|
|
339
|
+
const allowClear = !!inputValue;
|
|
340
|
+
const formattedOptions = Object.keys(options);
|
|
341
|
+
const handleChange = (_, newValue = null) => {
|
|
342
|
+
const formattedInputValue = newValue && options[newValue]?.label ? options[newValue]?.label : newValue;
|
|
343
|
+
setInputValue(formattedInputValue || "");
|
|
344
|
+
if (!allowCustomValues && newValue && !options[newValue]) {
|
|
345
|
+
return;
|
|
346
|
+
}
|
|
347
|
+
setValue(newValue);
|
|
348
|
+
};
|
|
349
|
+
const filterOptions = () => {
|
|
350
|
+
const formattedValue = inputValue?.toLowerCase() || "";
|
|
351
|
+
if (formattedValue.length < minInputLength) {
|
|
352
|
+
return [];
|
|
353
|
+
}
|
|
354
|
+
return formattedOptions.filter(
|
|
355
|
+
(optionValue) => optionValue.toLowerCase().indexOf(formattedValue) !== -1 || options[optionValue].label.toLowerCase().indexOf(formattedValue) !== -1
|
|
356
|
+
);
|
|
357
|
+
};
|
|
358
|
+
const isOptionEqualToValue = () => {
|
|
359
|
+
return muiWarningPreventer() ? void 0 : () => true;
|
|
360
|
+
};
|
|
361
|
+
const muiWarningPreventer = () => allowCustomValues || !!filterOptions().length;
|
|
362
|
+
return /* @__PURE__ */ React11.createElement(ControlActions, null, /* @__PURE__ */ React11.createElement(
|
|
363
|
+
Autocomplete,
|
|
364
|
+
{
|
|
365
|
+
forcePopupIcon: false,
|
|
366
|
+
disableClearable: true,
|
|
367
|
+
freeSolo: muiWarningPreventer(),
|
|
368
|
+
value: inputValue || "",
|
|
369
|
+
size: "tiny",
|
|
370
|
+
onChange: handleChange,
|
|
371
|
+
onInputChange: handleChange,
|
|
372
|
+
onBlur: allowCustomValues ? void 0 : () => handleChange(null, value),
|
|
373
|
+
readOnly: hasSelectedValue,
|
|
374
|
+
options: formattedOptions,
|
|
375
|
+
getOptionKey: (option) => option,
|
|
376
|
+
getOptionLabel: (option) => options[option]?.label ?? option,
|
|
377
|
+
groupBy: shouldGroupOptions(options) ? (option) => options[option]?.groupLabel : void 0,
|
|
378
|
+
isOptionEqualToValue: isOptionEqualToValue(),
|
|
379
|
+
filterOptions,
|
|
380
|
+
renderOption: (optionProps, option) => /* @__PURE__ */ React11.createElement(Box, { component: "li", ...optionProps, key: optionProps.id }, options[option]?.label ?? option),
|
|
381
|
+
renderInput: (params) => /* @__PURE__ */ React11.createElement(
|
|
382
|
+
TextInput,
|
|
383
|
+
{
|
|
384
|
+
params,
|
|
385
|
+
handleChange,
|
|
386
|
+
allowClear,
|
|
387
|
+
placeholder,
|
|
388
|
+
hasSelectedValue
|
|
389
|
+
}
|
|
390
|
+
)
|
|
391
|
+
}
|
|
392
|
+
));
|
|
393
|
+
}
|
|
394
|
+
);
|
|
395
|
+
var TextInput = ({
|
|
396
|
+
params,
|
|
397
|
+
allowClear,
|
|
398
|
+
placeholder,
|
|
399
|
+
handleChange,
|
|
400
|
+
hasSelectedValue
|
|
401
|
+
}) => {
|
|
402
|
+
return /* @__PURE__ */ React11.createElement(
|
|
403
|
+
TextField,
|
|
404
|
+
{
|
|
405
|
+
...params,
|
|
406
|
+
placeholder,
|
|
407
|
+
sx: {
|
|
408
|
+
"& .MuiInputBase-input": {
|
|
409
|
+
cursor: hasSelectedValue ? "default" : void 0
|
|
410
|
+
}
|
|
411
|
+
},
|
|
412
|
+
InputProps: {
|
|
413
|
+
...params.InputProps,
|
|
414
|
+
endAdornment: /* @__PURE__ */ React11.createElement(ClearButton, { params, allowClear, handleChange })
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
);
|
|
418
|
+
};
|
|
419
|
+
var ClearButton = ({
|
|
420
|
+
allowClear,
|
|
421
|
+
handleChange,
|
|
422
|
+
params
|
|
423
|
+
}) => /* @__PURE__ */ React11.createElement(InputAdornment, { position: "end" }, allowClear && /* @__PURE__ */ React11.createElement(IconButton, { size: params.size, onClick: handleChange, sx: { cursor: "pointer" } }, /* @__PURE__ */ React11.createElement(XIcon, { fontSize: params.size })));
|
|
424
|
+
function shouldGroupOptions(options) {
|
|
425
|
+
return Object.values(options).every((option) => "groupLabel" in option);
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
// src/controls/text-control.tsx
|
|
429
|
+
import * as React12 from "react";
|
|
430
|
+
import { stringPropTypeUtil as stringPropTypeUtil3 } from "@elementor/editor-props";
|
|
431
|
+
import { TextField as TextField2 } from "@elementor/ui";
|
|
294
432
|
var TextControl = createControl(({ placeholder }) => {
|
|
295
|
-
const { value, setValue } = useBoundProp(
|
|
433
|
+
const { value, setValue } = useBoundProp(stringPropTypeUtil3);
|
|
296
434
|
const handleChange = (event) => setValue(event.target.value);
|
|
297
|
-
return /* @__PURE__ */
|
|
298
|
-
|
|
435
|
+
return /* @__PURE__ */ React12.createElement(ControlActions, null, /* @__PURE__ */ React12.createElement(
|
|
436
|
+
TextField2,
|
|
299
437
|
{
|
|
300
438
|
size: "tiny",
|
|
301
439
|
fullWidth: true,
|
|
@@ -307,16 +445,16 @@ var TextControl = createControl(({ placeholder }) => {
|
|
|
307
445
|
});
|
|
308
446
|
|
|
309
447
|
// src/controls/text-area-control.tsx
|
|
310
|
-
import * as
|
|
311
|
-
import { stringPropTypeUtil as
|
|
312
|
-
import { TextField as
|
|
448
|
+
import * as React13 from "react";
|
|
449
|
+
import { stringPropTypeUtil as stringPropTypeUtil4 } from "@elementor/editor-props";
|
|
450
|
+
import { TextField as TextField3 } from "@elementor/ui";
|
|
313
451
|
var TextAreaControl = createControl(({ placeholder }) => {
|
|
314
|
-
const { value, setValue } = useBoundProp(
|
|
452
|
+
const { value, setValue } = useBoundProp(stringPropTypeUtil4);
|
|
315
453
|
const handleChange = (event) => {
|
|
316
454
|
setValue(event.target.value);
|
|
317
455
|
};
|
|
318
|
-
return /* @__PURE__ */
|
|
319
|
-
|
|
456
|
+
return /* @__PURE__ */ React13.createElement(ControlActions, null, /* @__PURE__ */ React13.createElement(
|
|
457
|
+
TextField3,
|
|
320
458
|
{
|
|
321
459
|
size: "tiny",
|
|
322
460
|
multiline: true,
|
|
@@ -330,18 +468,18 @@ var TextAreaControl = createControl(({ placeholder }) => {
|
|
|
330
468
|
});
|
|
331
469
|
|
|
332
470
|
// src/controls/size-control.tsx
|
|
333
|
-
import * as
|
|
471
|
+
import * as React15 from "react";
|
|
334
472
|
import { sizePropTypeUtil } from "@elementor/editor-props";
|
|
335
|
-
import { InputAdornment as
|
|
473
|
+
import { InputAdornment as InputAdornment3 } from "@elementor/ui";
|
|
336
474
|
|
|
337
475
|
// src/components/text-field-inner-selection.tsx
|
|
338
|
-
import * as
|
|
476
|
+
import * as React14 from "react";
|
|
339
477
|
import { forwardRef, useId } from "react";
|
|
340
|
-
import { bindMenu, bindTrigger, Button as Button2, InputAdornment, Menu, MenuItem as MenuItem2, TextField as
|
|
478
|
+
import { bindMenu, bindTrigger, Button as Button2, InputAdornment as InputAdornment2, Menu, MenuItem as MenuItem2, TextField as TextField4, usePopupState } from "@elementor/ui";
|
|
341
479
|
var TextFieldInnerSelection = forwardRef(
|
|
342
480
|
({ placeholder, type, value, onChange, endAdornment, startAdornment }, ref) => {
|
|
343
|
-
return /* @__PURE__ */
|
|
344
|
-
|
|
481
|
+
return /* @__PURE__ */ React14.createElement(
|
|
482
|
+
TextField4,
|
|
345
483
|
{
|
|
346
484
|
size: "tiny",
|
|
347
485
|
fullWidth: true,
|
|
@@ -371,7 +509,7 @@ var SelectionEndAdornment = ({
|
|
|
371
509
|
onClick(options[index]);
|
|
372
510
|
popupState.close();
|
|
373
511
|
};
|
|
374
|
-
return /* @__PURE__ */
|
|
512
|
+
return /* @__PURE__ */ React14.createElement(InputAdornment2, { position: "end" }, /* @__PURE__ */ React14.createElement(
|
|
375
513
|
Button2,
|
|
376
514
|
{
|
|
377
515
|
size: "small",
|
|
@@ -380,11 +518,11 @@ var SelectionEndAdornment = ({
|
|
|
380
518
|
...bindTrigger(popupState)
|
|
381
519
|
},
|
|
382
520
|
value.toUpperCase()
|
|
383
|
-
), /* @__PURE__ */
|
|
521
|
+
), /* @__PURE__ */ React14.createElement(Menu, { MenuListProps: { dense: true }, ...bindMenu(popupState) }, options.map((option, index) => /* @__PURE__ */ React14.createElement(MenuItem2, { key: option, onClick: () => handleMenuItemClick(index) }, option.toUpperCase()))));
|
|
384
522
|
};
|
|
385
523
|
|
|
386
524
|
// src/hooks/use-sync-external-state.tsx
|
|
387
|
-
import { useEffect, useState } from "react";
|
|
525
|
+
import { useEffect, useState as useState2 } from "react";
|
|
388
526
|
var useSyncExternalState = ({
|
|
389
527
|
external,
|
|
390
528
|
setExternal,
|
|
@@ -403,7 +541,7 @@ var useSyncExternalState = ({
|
|
|
403
541
|
}
|
|
404
542
|
return externalValue;
|
|
405
543
|
}
|
|
406
|
-
const [internal, setInternal] =
|
|
544
|
+
const [internal, setInternal] = useState2(toInternal(external, null));
|
|
407
545
|
useEffect(() => {
|
|
408
546
|
setInternal((prevInternal) => toInternal(external, prevInternal));
|
|
409
547
|
}, [external]);
|
|
@@ -441,10 +579,10 @@ var SizeControl = createControl(({ units: units2 = defaultUnits, placeholder, st
|
|
|
441
579
|
size: size || size === "0" ? parseFloat(size) : defaultSize
|
|
442
580
|
}));
|
|
443
581
|
};
|
|
444
|
-
return /* @__PURE__ */
|
|
582
|
+
return /* @__PURE__ */ React15.createElement(ControlActions, null, /* @__PURE__ */ React15.createElement(
|
|
445
583
|
TextFieldInnerSelection,
|
|
446
584
|
{
|
|
447
|
-
endAdornment: /* @__PURE__ */
|
|
585
|
+
endAdornment: /* @__PURE__ */ React15.createElement(
|
|
448
586
|
SelectionEndAdornment,
|
|
449
587
|
{
|
|
450
588
|
options: units2,
|
|
@@ -453,7 +591,7 @@ var SizeControl = createControl(({ units: units2 = defaultUnits, placeholder, st
|
|
|
453
591
|
}
|
|
454
592
|
),
|
|
455
593
|
placeholder,
|
|
456
|
-
startAdornment: startIcon ?? /* @__PURE__ */
|
|
594
|
+
startAdornment: startIcon ?? /* @__PURE__ */ React15.createElement(InputAdornment3, { position: "start" }, startIcon),
|
|
457
595
|
type: "number",
|
|
458
596
|
value: Number.isNaN(state?.size) ? "" : state?.size,
|
|
459
597
|
onChange: handleSizeChange
|
|
@@ -462,13 +600,13 @@ var SizeControl = createControl(({ units: units2 = defaultUnits, placeholder, st
|
|
|
462
600
|
});
|
|
463
601
|
|
|
464
602
|
// src/controls/stroke-control.tsx
|
|
465
|
-
import * as
|
|
603
|
+
import * as React17 from "react";
|
|
466
604
|
import { strokePropTypeUtil } from "@elementor/editor-props";
|
|
467
605
|
import { Grid as Grid2, Stack as Stack3 } from "@elementor/ui";
|
|
468
606
|
import { __ as __3 } from "@wordpress/i18n";
|
|
469
607
|
|
|
470
608
|
// src/controls/color-control.tsx
|
|
471
|
-
import * as
|
|
609
|
+
import * as React16 from "react";
|
|
472
610
|
import { colorPropTypeUtil } from "@elementor/editor-props";
|
|
473
611
|
import { UnstableColorField } from "@elementor/ui";
|
|
474
612
|
var ColorControl = createControl(({ propTypeUtil = colorPropTypeUtil, ...props }) => {
|
|
@@ -476,32 +614,32 @@ var ColorControl = createControl(({ propTypeUtil = colorPropTypeUtil, ...props }
|
|
|
476
614
|
const handleChange = (selectedColor) => {
|
|
477
615
|
setValue(selectedColor);
|
|
478
616
|
};
|
|
479
|
-
return /* @__PURE__ */
|
|
617
|
+
return /* @__PURE__ */ React16.createElement(ControlActions, null, /* @__PURE__ */ React16.createElement(UnstableColorField, { size: "tiny", ...props, value: value ?? "", onChange: handleChange, fullWidth: true }));
|
|
480
618
|
});
|
|
481
619
|
|
|
482
620
|
// src/controls/stroke-control.tsx
|
|
483
621
|
var units = ["px", "em", "rem"];
|
|
484
622
|
var StrokeControl = createControl(() => {
|
|
485
623
|
const propContext = useBoundProp(strokePropTypeUtil);
|
|
486
|
-
return /* @__PURE__ */
|
|
624
|
+
return /* @__PURE__ */ React17.createElement(PropProvider, { ...propContext }, /* @__PURE__ */ React17.createElement(Stack3, { gap: 1.5 }, /* @__PURE__ */ React17.createElement(Control, { bind: "width", label: __3("Stroke Width", "elementor") }, /* @__PURE__ */ React17.createElement(SizeControl, { units })), /* @__PURE__ */ React17.createElement(Control, { bind: "color", label: __3("Stroke Color", "elementor") }, /* @__PURE__ */ React17.createElement(ColorControl, null))));
|
|
487
625
|
});
|
|
488
|
-
var Control = ({ bind, label, children }) => /* @__PURE__ */
|
|
626
|
+
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)));
|
|
489
627
|
|
|
490
628
|
// src/controls/box-shadow-repeater-control.tsx
|
|
491
|
-
import * as
|
|
629
|
+
import * as React19 from "react";
|
|
492
630
|
import { boxShadowPropTypeUtil, shadowPropTypeUtil } from "@elementor/editor-props";
|
|
493
631
|
import { Grid as Grid3, Stack as Stack5, Typography as Typography3, UnstableColorIndicator } from "@elementor/ui";
|
|
494
632
|
import { __ as __5 } from "@wordpress/i18n";
|
|
495
633
|
|
|
496
634
|
// src/components/repeater.tsx
|
|
497
|
-
import * as
|
|
498
|
-
import {
|
|
499
|
-
import { CopyIcon, EyeIcon, EyeOffIcon, PlusIcon, XIcon } from "@elementor/icons";
|
|
635
|
+
import * as React18 from "react";
|
|
636
|
+
import { useRef, useState as useState3 } from "react";
|
|
637
|
+
import { CopyIcon, EyeIcon, EyeOffIcon, PlusIcon, XIcon as XIcon2 } from "@elementor/icons";
|
|
500
638
|
import {
|
|
501
639
|
bindPopover,
|
|
502
640
|
bindTrigger as bindTrigger2,
|
|
503
|
-
Box,
|
|
504
|
-
IconButton,
|
|
641
|
+
Box as Box2,
|
|
642
|
+
IconButton as IconButton2,
|
|
505
643
|
Popover,
|
|
506
644
|
Stack as Stack4,
|
|
507
645
|
Typography as Typography2,
|
|
@@ -541,22 +679,24 @@ var Repeater = ({
|
|
|
541
679
|
})
|
|
542
680
|
);
|
|
543
681
|
};
|
|
544
|
-
return /* @__PURE__ */
|
|
682
|
+
return /* @__PURE__ */ React18.createElement(Stack4, null, /* @__PURE__ */ React18.createElement(Stack4, { direction: "row", justifyContent: "space-between", alignItems: "center", sx: { pb: 1 } }, /* @__PURE__ */ React18.createElement(Typography2, { component: "label", variant: "caption", color: "text.secondary" }, label), /* @__PURE__ */ React18.createElement(IconButton2, { size: SIZE, onClick: addRepeaterItem, "aria-label": __4("Add item", "elementor") }, /* @__PURE__ */ React18.createElement(PlusIcon, { fontSize: SIZE }))), /* @__PURE__ */ React18.createElement(Stack4, { gap: 1 }, repeaterValues.map((value, index) => /* @__PURE__ */ React18.createElement(
|
|
545
683
|
RepeaterItem,
|
|
546
684
|
{
|
|
547
685
|
key: index,
|
|
686
|
+
bind: String(index),
|
|
548
687
|
disabled: value.disabled,
|
|
549
|
-
label: /* @__PURE__ */
|
|
550
|
-
startIcon: /* @__PURE__ */
|
|
688
|
+
label: /* @__PURE__ */ React18.createElement(itemSettings.Label, { value }),
|
|
689
|
+
startIcon: /* @__PURE__ */ React18.createElement(itemSettings.Icon, { value }),
|
|
551
690
|
removeItem: () => removeRepeaterItem(index),
|
|
552
691
|
duplicateItem: () => duplicateRepeaterItem(index),
|
|
553
692
|
toggleDisableItem: () => toggleDisableRepeaterItem(index)
|
|
554
693
|
},
|
|
555
|
-
(props) => /* @__PURE__ */
|
|
694
|
+
(props) => /* @__PURE__ */ React18.createElement(itemSettings.Content, { ...props, bind: String(index) })
|
|
556
695
|
))));
|
|
557
696
|
};
|
|
558
697
|
var RepeaterItem = ({
|
|
559
698
|
label,
|
|
699
|
+
bind,
|
|
560
700
|
disabled,
|
|
561
701
|
startIcon,
|
|
562
702
|
children,
|
|
@@ -564,12 +704,12 @@ var RepeaterItem = ({
|
|
|
564
704
|
duplicateItem,
|
|
565
705
|
toggleDisableItem
|
|
566
706
|
}) => {
|
|
567
|
-
const popupId =
|
|
707
|
+
const popupId = `repeater-popup-${bind}`;
|
|
568
708
|
const controlRef = useRef(null);
|
|
569
|
-
const [anchorEl, setAnchorEl] =
|
|
709
|
+
const [anchorEl, setAnchorEl] = useState3(null);
|
|
570
710
|
const popoverState = usePopupState2({ popupId, variant: "popover" });
|
|
571
711
|
const popoverProps = bindPopover(popoverState);
|
|
572
|
-
return /* @__PURE__ */
|
|
712
|
+
return /* @__PURE__ */ React18.createElement(React18.Fragment, null, /* @__PURE__ */ React18.createElement(
|
|
573
713
|
UnstableTag,
|
|
574
714
|
{
|
|
575
715
|
label,
|
|
@@ -579,33 +719,33 @@ var RepeaterItem = ({
|
|
|
579
719
|
"aria-label": __4("Open item", "elementor"),
|
|
580
720
|
...bindTrigger2(popoverState),
|
|
581
721
|
startIcon,
|
|
582
|
-
actions: /* @__PURE__ */
|
|
583
|
-
|
|
722
|
+
actions: /* @__PURE__ */ React18.createElement(React18.Fragment, null, /* @__PURE__ */ React18.createElement(
|
|
723
|
+
IconButton2,
|
|
584
724
|
{
|
|
585
725
|
size: SIZE,
|
|
586
726
|
onClick: duplicateItem,
|
|
587
727
|
"aria-label": __4("Duplicate item", "elementor")
|
|
588
728
|
},
|
|
589
|
-
/* @__PURE__ */
|
|
590
|
-
), /* @__PURE__ */
|
|
591
|
-
|
|
729
|
+
/* @__PURE__ */ React18.createElement(CopyIcon, { fontSize: SIZE })
|
|
730
|
+
), /* @__PURE__ */ React18.createElement(
|
|
731
|
+
IconButton2,
|
|
592
732
|
{
|
|
593
733
|
size: SIZE,
|
|
594
734
|
onClick: toggleDisableItem,
|
|
595
735
|
"aria-label": disabled ? __4("Enable item", "elementor") : __4("Disable item", "elementor")
|
|
596
736
|
},
|
|
597
|
-
disabled ? /* @__PURE__ */
|
|
598
|
-
), /* @__PURE__ */
|
|
599
|
-
|
|
737
|
+
disabled ? /* @__PURE__ */ React18.createElement(EyeOffIcon, { fontSize: SIZE }) : /* @__PURE__ */ React18.createElement(EyeIcon, { fontSize: SIZE })
|
|
738
|
+
), /* @__PURE__ */ React18.createElement(
|
|
739
|
+
IconButton2,
|
|
600
740
|
{
|
|
601
741
|
size: SIZE,
|
|
602
742
|
onClick: removeItem,
|
|
603
743
|
"aria-label": __4("Remove item", "elementor")
|
|
604
744
|
},
|
|
605
|
-
/* @__PURE__ */
|
|
745
|
+
/* @__PURE__ */ React18.createElement(XIcon2, { fontSize: SIZE })
|
|
606
746
|
))
|
|
607
747
|
}
|
|
608
|
-
), /* @__PURE__ */
|
|
748
|
+
), /* @__PURE__ */ React18.createElement(
|
|
609
749
|
Popover,
|
|
610
750
|
{
|
|
611
751
|
disablePortal: true,
|
|
@@ -618,14 +758,14 @@ var RepeaterItem = ({
|
|
|
618
758
|
anchorOrigin: { vertical: "bottom", horizontal: "left" },
|
|
619
759
|
...popoverProps
|
|
620
760
|
},
|
|
621
|
-
/* @__PURE__ */
|
|
761
|
+
/* @__PURE__ */ React18.createElement(Box2, { p: 0.5 }, children({ anchorEl }))
|
|
622
762
|
));
|
|
623
763
|
};
|
|
624
764
|
|
|
625
765
|
// src/controls/box-shadow-repeater-control.tsx
|
|
626
766
|
var BoxShadowRepeaterControl = createControl(() => {
|
|
627
767
|
const { propType, value, setValue } = useBoundProp(boxShadowPropTypeUtil);
|
|
628
|
-
return /* @__PURE__ */
|
|
768
|
+
return /* @__PURE__ */ React19.createElement(PropProvider, { propType, value, setValue }, /* @__PURE__ */ React19.createElement(
|
|
629
769
|
Repeater,
|
|
630
770
|
{
|
|
631
771
|
values: value ?? [],
|
|
@@ -640,13 +780,13 @@ var BoxShadowRepeaterControl = createControl(() => {
|
|
|
640
780
|
}
|
|
641
781
|
));
|
|
642
782
|
});
|
|
643
|
-
var ItemIcon = ({ value }) => /* @__PURE__ */
|
|
783
|
+
var ItemIcon = ({ value }) => /* @__PURE__ */ React19.createElement(UnstableColorIndicator, { size: "inherit", component: "span", value: value.value.color.value });
|
|
644
784
|
var ItemContent = ({ anchorEl, bind }) => {
|
|
645
|
-
return /* @__PURE__ */
|
|
785
|
+
return /* @__PURE__ */ React19.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React19.createElement(Content, { anchorEl }));
|
|
646
786
|
};
|
|
647
787
|
var Content = ({ anchorEl }) => {
|
|
648
788
|
const { propType, value, setValue } = useBoundProp(shadowPropTypeUtil);
|
|
649
|
-
return /* @__PURE__ */
|
|
789
|
+
return /* @__PURE__ */ React19.createElement(PropProvider, { propType, value, setValue }, /* @__PURE__ */ React19.createElement(Stack5, { gap: 1.5 }, /* @__PURE__ */ React19.createElement(Grid3, { container: true, gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React19.createElement(Control2, { bind: "color", label: __5("Color", "elementor") }, /* @__PURE__ */ React19.createElement(
|
|
650
790
|
ColorControl,
|
|
651
791
|
{
|
|
652
792
|
slotProps: {
|
|
@@ -663,7 +803,7 @@ var Content = ({ anchorEl }) => {
|
|
|
663
803
|
}
|
|
664
804
|
}
|
|
665
805
|
}
|
|
666
|
-
)), /* @__PURE__ */
|
|
806
|
+
)), /* @__PURE__ */ React19.createElement(Control2, { bind: "position", label: __5("Position", "elementor") }, /* @__PURE__ */ React19.createElement(
|
|
667
807
|
SelectControl,
|
|
668
808
|
{
|
|
669
809
|
options: [
|
|
@@ -671,9 +811,9 @@ var Content = ({ anchorEl }) => {
|
|
|
671
811
|
{ label: __5("Outset", "elementor"), value: "" }
|
|
672
812
|
]
|
|
673
813
|
}
|
|
674
|
-
))), /* @__PURE__ */
|
|
814
|
+
))), /* @__PURE__ */ React19.createElement(Grid3, { container: true, gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React19.createElement(Control2, { bind: "hOffset", label: __5("Horizontal", "elementor") }, /* @__PURE__ */ React19.createElement(SizeControl, null)), /* @__PURE__ */ React19.createElement(Control2, { bind: "vOffset", label: __5("Vertical", "elementor") }, /* @__PURE__ */ React19.createElement(SizeControl, null))), /* @__PURE__ */ React19.createElement(Grid3, { container: true, gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React19.createElement(Control2, { bind: "blur", label: __5("Blur", "elementor") }, /* @__PURE__ */ React19.createElement(SizeControl, null)), /* @__PURE__ */ React19.createElement(Control2, { bind: "spread", label: __5("Spread", "elementor") }, /* @__PURE__ */ React19.createElement(SizeControl, null)))));
|
|
675
815
|
};
|
|
676
|
-
var Control2 = ({ label, bind, children }) => /* @__PURE__ */
|
|
816
|
+
var Control2 = ({ label, bind, children }) => /* @__PURE__ */ React19.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React19.createElement(Grid3, { item: true, xs: 6 }, /* @__PURE__ */ React19.createElement(Grid3, { container: true, gap: 1, alignItems: "center" }, /* @__PURE__ */ React19.createElement(Grid3, { item: true, xs: 12 }, /* @__PURE__ */ React19.createElement(Typography3, { component: "label", variant: "caption", color: "text.secondary" }, label)), /* @__PURE__ */ React19.createElement(Grid3, { item: true, xs: 12 }, children))));
|
|
677
817
|
var ItemLabel = ({ value }) => {
|
|
678
818
|
const { position, hOffset, vOffset, blur, spread } = value.value;
|
|
679
819
|
const { size: blurSize = "", unit: blurUnit = "" } = blur?.value || {};
|
|
@@ -686,7 +826,7 @@ var ItemLabel = ({ value }) => {
|
|
|
686
826
|
blurSize + blurUnit,
|
|
687
827
|
spreadSize + spreadUnit
|
|
688
828
|
].join(" ");
|
|
689
|
-
return /* @__PURE__ */
|
|
829
|
+
return /* @__PURE__ */ React19.createElement("span", { style: { textTransform: "capitalize" } }, position ?? "outset", ": ", sizes);
|
|
690
830
|
};
|
|
691
831
|
var initialShadow = {
|
|
692
832
|
$$type: "shadow",
|
|
@@ -716,11 +856,11 @@ var initialShadow = {
|
|
|
716
856
|
};
|
|
717
857
|
|
|
718
858
|
// src/controls/toggle-control.tsx
|
|
719
|
-
import * as
|
|
720
|
-
import { stringPropTypeUtil as
|
|
859
|
+
import * as React21 from "react";
|
|
860
|
+
import { stringPropTypeUtil as stringPropTypeUtil5 } from "@elementor/editor-props";
|
|
721
861
|
|
|
722
862
|
// src/components/control-toggle-button-group.tsx
|
|
723
|
-
import * as
|
|
863
|
+
import * as React20 from "react";
|
|
724
864
|
import {
|
|
725
865
|
styled as styled2,
|
|
726
866
|
ToggleButton,
|
|
@@ -744,7 +884,7 @@ var ControlToggleButtonGroup = ({
|
|
|
744
884
|
const handleChange = (_, newValue) => {
|
|
745
885
|
onChange(newValue);
|
|
746
886
|
};
|
|
747
|
-
return /* @__PURE__ */
|
|
887
|
+
return /* @__PURE__ */ React20.createElement(
|
|
748
888
|
StyledToggleButtonGroup,
|
|
749
889
|
{
|
|
750
890
|
justify,
|
|
@@ -756,7 +896,7 @@ var ControlToggleButtonGroup = ({
|
|
|
756
896
|
}
|
|
757
897
|
},
|
|
758
898
|
items.map(
|
|
759
|
-
({ label, value: buttonValue, renderContent: Content3, showTooltip }) => showTooltip ? /* @__PURE__ */
|
|
899
|
+
({ label, value: buttonValue, renderContent: Content3, showTooltip }) => showTooltip ? /* @__PURE__ */ React20.createElement(Tooltip, { key: buttonValue, title: label, disableFocusListener: true, placement: "top" }, /* @__PURE__ */ React20.createElement(ToggleButton, { value: buttonValue, "aria-label": label, size, fullWidth }, /* @__PURE__ */ React20.createElement(Content3, { size }))) : /* @__PURE__ */ React20.createElement(
|
|
760
900
|
ToggleButton,
|
|
761
901
|
{
|
|
762
902
|
key: buttonValue,
|
|
@@ -765,7 +905,7 @@ var ControlToggleButtonGroup = ({
|
|
|
765
905
|
size,
|
|
766
906
|
fullWidth
|
|
767
907
|
},
|
|
768
|
-
/* @__PURE__ */
|
|
908
|
+
/* @__PURE__ */ React20.createElement(Content3, { size })
|
|
769
909
|
)
|
|
770
910
|
)
|
|
771
911
|
);
|
|
@@ -774,11 +914,11 @@ var ControlToggleButtonGroup = ({
|
|
|
774
914
|
// src/controls/toggle-control.tsx
|
|
775
915
|
var ToggleControl = createControl(
|
|
776
916
|
({ options, fullWidth = false, size = "tiny" }) => {
|
|
777
|
-
const { value, setValue } = useBoundProp(
|
|
917
|
+
const { value, setValue } = useBoundProp(stringPropTypeUtil5);
|
|
778
918
|
const handleToggle = (option) => {
|
|
779
919
|
setValue(option);
|
|
780
920
|
};
|
|
781
|
-
return /* @__PURE__ */
|
|
921
|
+
return /* @__PURE__ */ React21.createElement(
|
|
782
922
|
ControlToggleButtonGroup,
|
|
783
923
|
{
|
|
784
924
|
items: options,
|
|
@@ -793,9 +933,9 @@ var ToggleControl = createControl(
|
|
|
793
933
|
);
|
|
794
934
|
|
|
795
935
|
// src/controls/number-control.tsx
|
|
796
|
-
import * as
|
|
936
|
+
import * as React22 from "react";
|
|
797
937
|
import { numberPropTypeUtil } from "@elementor/editor-props";
|
|
798
|
-
import { TextField as
|
|
938
|
+
import { TextField as TextField5 } from "@elementor/ui";
|
|
799
939
|
var isEmptyOrNaN = (value) => value === null || value === void 0 || value === "" || Number.isNaN(Number(value));
|
|
800
940
|
var NumberControl = createControl(
|
|
801
941
|
({
|
|
@@ -815,8 +955,8 @@ var NumberControl = createControl(
|
|
|
815
955
|
const formattedValue = shouldForceInt ? +parseInt(eventValue) : Number(eventValue);
|
|
816
956
|
setValue(Math.min(Math.max(formattedValue, min), max));
|
|
817
957
|
};
|
|
818
|
-
return /* @__PURE__ */
|
|
819
|
-
|
|
958
|
+
return /* @__PURE__ */ React22.createElement(ControlActions, null, /* @__PURE__ */ React22.createElement(
|
|
959
|
+
TextField5,
|
|
820
960
|
{
|
|
821
961
|
size: "tiny",
|
|
822
962
|
type: "number",
|
|
@@ -831,8 +971,8 @@ var NumberControl = createControl(
|
|
|
831
971
|
);
|
|
832
972
|
|
|
833
973
|
// src/controls/equal-unequal-sizes-control.tsx
|
|
834
|
-
import * as
|
|
835
|
-
import { useId as
|
|
974
|
+
import * as React23 from "react";
|
|
975
|
+
import { useId as useId2, useRef as useRef2 } from "react";
|
|
836
976
|
import { sizePropTypeUtil as sizePropTypeUtil2 } from "@elementor/editor-props";
|
|
837
977
|
import { bindPopover as bindPopover2, bindToggle, Grid as Grid4, Popover as Popover2, Stack as Stack6, ToggleButton as ToggleButton2, usePopupState as usePopupState3 } from "@elementor/ui";
|
|
838
978
|
import { __ as __6 } from "@wordpress/i18n";
|
|
@@ -852,7 +992,7 @@ function EqualUnequalSizesControl({
|
|
|
852
992
|
items,
|
|
853
993
|
multiSizePropTypeUtil
|
|
854
994
|
}) {
|
|
855
|
-
const popupId =
|
|
995
|
+
const popupId = useId2();
|
|
856
996
|
const controlRef = useRef2(null);
|
|
857
997
|
const popupState = usePopupState3({ variant: "popover", popupId });
|
|
858
998
|
const {
|
|
@@ -887,7 +1027,7 @@ function EqualUnequalSizesControl({
|
|
|
887
1027
|
}
|
|
888
1028
|
return splitEqualValue() ?? null;
|
|
889
1029
|
};
|
|
890
|
-
return /* @__PURE__ */
|
|
1030
|
+
return /* @__PURE__ */ React23.createElement(React23.Fragment, null, /* @__PURE__ */ React23.createElement(Grid4, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap", ref: controlRef }, /* @__PURE__ */ React23.createElement(Grid4, { item: true, xs: 6 }, /* @__PURE__ */ React23.createElement(ControlLabel, null, label)), /* @__PURE__ */ React23.createElement(Grid4, { item: true, xs: 6 }, /* @__PURE__ */ React23.createElement(Stack6, { direction: "row", alignItems: "center", gap: 1 }, /* @__PURE__ */ React23.createElement(SizeControl, { placeholder: __6("MIXED", "elementor") }), /* @__PURE__ */ React23.createElement(
|
|
891
1031
|
ToggleButton2,
|
|
892
1032
|
{
|
|
893
1033
|
size: "tiny",
|
|
@@ -897,7 +1037,7 @@ function EqualUnequalSizesControl({
|
|
|
897
1037
|
selected: popupState.isOpen
|
|
898
1038
|
},
|
|
899
1039
|
icon
|
|
900
|
-
)))), /* @__PURE__ */
|
|
1040
|
+
)))), /* @__PURE__ */ React23.createElement(
|
|
901
1041
|
Popover2,
|
|
902
1042
|
{
|
|
903
1043
|
disablePortal: true,
|
|
@@ -915,13 +1055,13 @@ function EqualUnequalSizesControl({
|
|
|
915
1055
|
paper: { sx: { mt: 0.5, p: 2, pt: 1, width: controlRef.current?.getBoundingClientRect().width } }
|
|
916
1056
|
}
|
|
917
1057
|
},
|
|
918
|
-
/* @__PURE__ */
|
|
1058
|
+
/* @__PURE__ */ React23.createElement(PropProvider, { propType: multiSizePropType, value: getMultiSizeValues(), setValue: setNestedProp }, /* @__PURE__ */ React23.createElement(Stack6, { gap: 1.5 }, /* @__PURE__ */ React23.createElement(Grid4, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React23.createElement(MultiSizeValueControl, { item: items[0] }), /* @__PURE__ */ React23.createElement(MultiSizeValueControl, { item: items[1] })), /* @__PURE__ */ React23.createElement(Grid4, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React23.createElement(MultiSizeValueControl, { item: items[3] }), /* @__PURE__ */ React23.createElement(MultiSizeValueControl, { item: items[2] }))))
|
|
919
1059
|
));
|
|
920
1060
|
}
|
|
921
|
-
var MultiSizeValueControl = ({ item }) => /* @__PURE__ */
|
|
1061
|
+
var MultiSizeValueControl = ({ item }) => /* @__PURE__ */ React23.createElement(PropKeyProvider, { bind: item.bind }, /* @__PURE__ */ React23.createElement(Grid4, { item: true, xs: 6 }, /* @__PURE__ */ React23.createElement(Grid4, { container: true, gap: 1, alignItems: "center" }, /* @__PURE__ */ React23.createElement(Grid4, { item: true, xs: 12 }, /* @__PURE__ */ React23.createElement(ControlLabel, null, item.label)), /* @__PURE__ */ React23.createElement(Grid4, { item: true, xs: 12 }, /* @__PURE__ */ React23.createElement(SizeControl, { startIcon: item.icon })))));
|
|
922
1062
|
|
|
923
1063
|
// src/controls/linked-dimensions-control.tsx
|
|
924
|
-
import * as
|
|
1064
|
+
import * as React24 from "react";
|
|
925
1065
|
import { linkedDimensionsPropTypeUtil } from "@elementor/editor-props";
|
|
926
1066
|
import { DetachIcon, LinkIcon, SideBottomIcon, SideLeftIcon, SideRightIcon, SideTopIcon } from "@elementor/icons";
|
|
927
1067
|
import { Grid as Grid5, Stack as Stack7, ToggleButton as ToggleButton3 } from "@elementor/ui";
|
|
@@ -953,7 +1093,7 @@ var LinkedDimensionsControl = createControl(({ label }) => {
|
|
|
953
1093
|
setValue(updatedValue);
|
|
954
1094
|
};
|
|
955
1095
|
const LinkedIcon = isLinked ? LinkIcon : DetachIcon;
|
|
956
|
-
return /* @__PURE__ */
|
|
1096
|
+
return /* @__PURE__ */ React24.createElement(PropProvider, { propType, value, setValue: setLinkedValue }, /* @__PURE__ */ React24.createElement(Stack7, { direction: "row", gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React24.createElement(ControlLabel, null, label), /* @__PURE__ */ React24.createElement(
|
|
957
1097
|
ToggleButton3,
|
|
958
1098
|
{
|
|
959
1099
|
"aria-label": __7("Link Inputs", "elementor"),
|
|
@@ -963,30 +1103,30 @@ var LinkedDimensionsControl = createControl(({ label }) => {
|
|
|
963
1103
|
sx: { marginLeft: "auto" },
|
|
964
1104
|
onChange: toggleLinked
|
|
965
1105
|
},
|
|
966
|
-
/* @__PURE__ */
|
|
967
|
-
)), /* @__PURE__ */
|
|
1106
|
+
/* @__PURE__ */ React24.createElement(LinkedIcon, { fontSize: "tiny" })
|
|
1107
|
+
)), /* @__PURE__ */ React24.createElement(Stack7, { direction: "row", gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React24.createElement(Grid5, { container: true, gap: 1, alignItems: "center" }, /* @__PURE__ */ React24.createElement(Grid5, { item: true, xs: 12 }, /* @__PURE__ */ React24.createElement(ControlLabel, null, __7("Top", "elementor"))), /* @__PURE__ */ React24.createElement(Grid5, { item: true, xs: 12 }, /* @__PURE__ */ React24.createElement(Control3, { bind: "top", startIcon: /* @__PURE__ */ React24.createElement(SideTopIcon, { fontSize: "tiny" }) }))), /* @__PURE__ */ React24.createElement(Grid5, { container: true, gap: 1, alignItems: "center" }, /* @__PURE__ */ React24.createElement(Grid5, { item: true, xs: 12 }, /* @__PURE__ */ React24.createElement(ControlLabel, null, __7("Right", "elementor"))), /* @__PURE__ */ React24.createElement(Grid5, { item: true, xs: 12 }, /* @__PURE__ */ React24.createElement(Control3, { bind: "right", startIcon: /* @__PURE__ */ React24.createElement(SideRightIcon, { fontSize: "tiny" }) })))), /* @__PURE__ */ React24.createElement(Stack7, { direction: "row", gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React24.createElement(Grid5, { container: true, gap: 1, alignItems: "center" }, /* @__PURE__ */ React24.createElement(Grid5, { item: true, xs: 12 }, /* @__PURE__ */ React24.createElement(ControlLabel, null, __7("Bottom", "elementor"))), /* @__PURE__ */ React24.createElement(Grid5, { item: true, xs: 12 }, /* @__PURE__ */ React24.createElement(Control3, { bind: "bottom", startIcon: /* @__PURE__ */ React24.createElement(SideBottomIcon, { fontSize: "tiny" }) }))), /* @__PURE__ */ React24.createElement(Grid5, { container: true, gap: 1, alignItems: "center" }, /* @__PURE__ */ React24.createElement(Grid5, { item: true, xs: 12 }, /* @__PURE__ */ React24.createElement(ControlLabel, null, __7("Left", "elementor"))), /* @__PURE__ */ React24.createElement(Grid5, { item: true, xs: 12 }, /* @__PURE__ */ React24.createElement(Control3, { bind: "left", startIcon: /* @__PURE__ */ React24.createElement(SideLeftIcon, { fontSize: "tiny" }) })))));
|
|
968
1108
|
});
|
|
969
|
-
var Control3 = ({ bind, startIcon }) => /* @__PURE__ */
|
|
1109
|
+
var Control3 = ({ bind, startIcon }) => /* @__PURE__ */ React24.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React24.createElement(SizeControl, { startIcon }));
|
|
970
1110
|
|
|
971
1111
|
// src/controls/font-family-control.tsx
|
|
972
|
-
import { Fragment as Fragment3, useId as
|
|
973
|
-
import * as
|
|
974
|
-
import { stringPropTypeUtil as
|
|
975
|
-
import { ChevronDownIcon, EditIcon, PhotoIcon, SearchIcon, XIcon as
|
|
1112
|
+
import { Fragment as Fragment3, useId as useId3, useState as useState4 } from "react";
|
|
1113
|
+
import * as React25 from "react";
|
|
1114
|
+
import { stringPropTypeUtil as stringPropTypeUtil6 } from "@elementor/editor-props";
|
|
1115
|
+
import { ChevronDownIcon, EditIcon, PhotoIcon, SearchIcon, XIcon as XIcon3 } from "@elementor/icons";
|
|
976
1116
|
import {
|
|
977
1117
|
bindPopover as bindPopover3,
|
|
978
1118
|
bindTrigger as bindTrigger3,
|
|
979
|
-
Box as
|
|
1119
|
+
Box as Box3,
|
|
980
1120
|
Divider,
|
|
981
|
-
IconButton as
|
|
982
|
-
InputAdornment as
|
|
1121
|
+
IconButton as IconButton3,
|
|
1122
|
+
InputAdornment as InputAdornment4,
|
|
983
1123
|
Link,
|
|
984
1124
|
ListSubheader,
|
|
985
1125
|
MenuItem as MenuItem3,
|
|
986
1126
|
MenuList,
|
|
987
1127
|
Popover as Popover3,
|
|
988
1128
|
Stack as Stack8,
|
|
989
|
-
TextField as
|
|
1129
|
+
TextField as TextField6,
|
|
990
1130
|
Typography as Typography4,
|
|
991
1131
|
UnstableTag as UnstableTag2,
|
|
992
1132
|
usePopupState as usePopupState4
|
|
@@ -1026,9 +1166,9 @@ var useFilteredFontFamilies = (fontFamilies, searchValue) => {
|
|
|
1026
1166
|
// src/controls/font-family-control.tsx
|
|
1027
1167
|
var SIZE2 = "tiny";
|
|
1028
1168
|
var FontFamilyControl = createControl(({ fontFamilies }) => {
|
|
1029
|
-
const [searchValue, setSearchValue] =
|
|
1030
|
-
const { value: fontFamily, setValue: setFontFamily } = useBoundProp(
|
|
1031
|
-
const popupId =
|
|
1169
|
+
const [searchValue, setSearchValue] = useState4("");
|
|
1170
|
+
const { value: fontFamily, setValue: setFontFamily } = useBoundProp(stringPropTypeUtil6);
|
|
1171
|
+
const popupId = useId3();
|
|
1032
1172
|
const popoverState = usePopupState4({ variant: "popover", popupId });
|
|
1033
1173
|
const filteredFontFamilies = useFilteredFontFamilies(fontFamilies, searchValue);
|
|
1034
1174
|
if (!filteredFontFamilies) {
|
|
@@ -1041,16 +1181,16 @@ var FontFamilyControl = createControl(({ fontFamilies }) => {
|
|
|
1041
1181
|
setSearchValue("");
|
|
1042
1182
|
popoverState.close();
|
|
1043
1183
|
};
|
|
1044
|
-
return /* @__PURE__ */
|
|
1184
|
+
return /* @__PURE__ */ React25.createElement(React25.Fragment, null, /* @__PURE__ */ React25.createElement(
|
|
1045
1185
|
UnstableTag2,
|
|
1046
1186
|
{
|
|
1047
1187
|
variant: "outlined",
|
|
1048
1188
|
label: fontFamily,
|
|
1049
|
-
endIcon: /* @__PURE__ */
|
|
1189
|
+
endIcon: /* @__PURE__ */ React25.createElement(ChevronDownIcon, { fontSize: "tiny" }),
|
|
1050
1190
|
...bindTrigger3(popoverState),
|
|
1051
1191
|
fullWidth: true
|
|
1052
1192
|
}
|
|
1053
|
-
), /* @__PURE__ */
|
|
1193
|
+
), /* @__PURE__ */ React25.createElement(
|
|
1054
1194
|
Popover3,
|
|
1055
1195
|
{
|
|
1056
1196
|
disablePortal: true,
|
|
@@ -1059,8 +1199,8 @@ var FontFamilyControl = createControl(({ fontFamilies }) => {
|
|
|
1059
1199
|
...bindPopover3(popoverState),
|
|
1060
1200
|
onClose: handleClose
|
|
1061
1201
|
},
|
|
1062
|
-
/* @__PURE__ */
|
|
1063
|
-
|
|
1202
|
+
/* @__PURE__ */ React25.createElement(Stack8, null, /* @__PURE__ */ React25.createElement(Stack8, { direction: "row", alignItems: "center", pl: 1.5, pr: 0.5, py: 1.5 }, /* @__PURE__ */ React25.createElement(EditIcon, { fontSize: SIZE2, sx: { mr: 0.5 } }), /* @__PURE__ */ React25.createElement(Typography4, { variant: "subtitle2" }, __9("Font Family", "elementor")), /* @__PURE__ */ React25.createElement(IconButton3, { size: SIZE2, sx: { ml: "auto" }, onClick: handleClose }, /* @__PURE__ */ React25.createElement(XIcon3, { fontSize: SIZE2 }))), /* @__PURE__ */ React25.createElement(Box3, { px: 1.5, pb: 1 }, /* @__PURE__ */ React25.createElement(
|
|
1203
|
+
TextField6,
|
|
1064
1204
|
{
|
|
1065
1205
|
fullWidth: true,
|
|
1066
1206
|
size: SIZE2,
|
|
@@ -1068,12 +1208,12 @@ var FontFamilyControl = createControl(({ fontFamilies }) => {
|
|
|
1068
1208
|
placeholder: __9("Search", "elementor"),
|
|
1069
1209
|
onChange: handleSearch,
|
|
1070
1210
|
InputProps: {
|
|
1071
|
-
startAdornment: /* @__PURE__ */
|
|
1211
|
+
startAdornment: /* @__PURE__ */ React25.createElement(InputAdornment4, { position: "start" }, /* @__PURE__ */ React25.createElement(SearchIcon, { fontSize: SIZE2 }))
|
|
1072
1212
|
}
|
|
1073
1213
|
}
|
|
1074
|
-
)), /* @__PURE__ */
|
|
1214
|
+
)), /* @__PURE__ */ React25.createElement(Divider, null), /* @__PURE__ */ React25.createElement(Box3, { sx: { overflowY: "auto", height: 260, width: 220 } }, filteredFontFamilies.length > 0 ? /* @__PURE__ */ React25.createElement(MenuList, { role: "listbox", tabIndex: 0 }, filteredFontFamilies.map(([category, items], index) => /* @__PURE__ */ React25.createElement(Fragment3, { key: index }, /* @__PURE__ */ React25.createElement(ListSubheader, { sx: { typography: "caption", color: "text.tertiary" } }, category), items.map((item) => {
|
|
1075
1215
|
const isSelected = item === fontFamily;
|
|
1076
|
-
return /* @__PURE__ */
|
|
1216
|
+
return /* @__PURE__ */ React25.createElement(
|
|
1077
1217
|
MenuItem3,
|
|
1078
1218
|
{
|
|
1079
1219
|
key: item,
|
|
@@ -1088,7 +1228,7 @@ var FontFamilyControl = createControl(({ fontFamilies }) => {
|
|
|
1088
1228
|
},
|
|
1089
1229
|
item
|
|
1090
1230
|
);
|
|
1091
|
-
})))) : /* @__PURE__ */
|
|
1231
|
+
})))) : /* @__PURE__ */ React25.createElement(Stack8, { alignItems: "center", p: 2.5, gap: 1.5 }, /* @__PURE__ */ React25.createElement(PhotoIcon, { fontSize: "large" }), /* @__PURE__ */ React25.createElement(Typography4, { align: "center", variant: "caption", color: "text.secondary" }, __9("Sorry, nothing matched", "elementor"), /* @__PURE__ */ React25.createElement("br", null), "\u201C", searchValue, "\u201D."), /* @__PURE__ */ React25.createElement(Typography4, { align: "center", variant: "caption", color: "text.secondary" }, /* @__PURE__ */ React25.createElement(
|
|
1092
1232
|
Link,
|
|
1093
1233
|
{
|
|
1094
1234
|
color: "secondary",
|
|
@@ -1102,33 +1242,47 @@ var FontFamilyControl = createControl(({ fontFamilies }) => {
|
|
|
1102
1242
|
});
|
|
1103
1243
|
|
|
1104
1244
|
// src/controls/url-control.tsx
|
|
1105
|
-
import * as
|
|
1245
|
+
import * as React26 from "react";
|
|
1106
1246
|
import { urlPropTypeUtil } from "@elementor/editor-props";
|
|
1107
|
-
import { TextField as
|
|
1247
|
+
import { TextField as TextField7 } from "@elementor/ui";
|
|
1108
1248
|
var UrlControl = createControl(({ placeholder }) => {
|
|
1109
1249
|
const { value, setValue } = useBoundProp(urlPropTypeUtil);
|
|
1110
1250
|
const handleChange = (event) => setValue(event.target.value);
|
|
1111
|
-
return /* @__PURE__ */
|
|
1251
|
+
return /* @__PURE__ */ React26.createElement(ControlActions, null, /* @__PURE__ */ React26.createElement(
|
|
1252
|
+
TextField7,
|
|
1253
|
+
{
|
|
1254
|
+
size: "tiny",
|
|
1255
|
+
fullWidth: true,
|
|
1256
|
+
value: value ?? "",
|
|
1257
|
+
onChange: handleChange,
|
|
1258
|
+
placeholder
|
|
1259
|
+
}
|
|
1260
|
+
));
|
|
1112
1261
|
});
|
|
1113
1262
|
|
|
1114
1263
|
// src/controls/link-control.tsx
|
|
1115
|
-
import * as
|
|
1116
|
-
import { linkPropTypeUtil } from "@elementor/editor-props";
|
|
1264
|
+
import * as React27 from "react";
|
|
1265
|
+
import { booleanPropTypeUtil, linkPropTypeUtil, stringPropTypeUtil as stringPropTypeUtil7 } from "@elementor/editor-props";
|
|
1117
1266
|
import { MinusIcon, PlusIcon as PlusIcon2 } from "@elementor/icons";
|
|
1118
|
-
import {
|
|
1267
|
+
import { useSessionStorage } from "@elementor/session";
|
|
1268
|
+
import { Collapse, Divider as Divider2, Grid as Grid6, IconButton as IconButton4, Stack as Stack9, Switch } from "@elementor/ui";
|
|
1119
1269
|
import { __ as __10 } from "@wordpress/i18n";
|
|
1120
1270
|
var SIZE3 = "tiny";
|
|
1121
|
-
var
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1271
|
+
var LinkControl = createControl((props) => {
|
|
1272
|
+
const { value, path, setValue, ...propContext } = useBoundProp(linkPropTypeUtil);
|
|
1273
|
+
const [linkSessionValue, setLinkSessionValue] = useSessionStorage(path.join("/"));
|
|
1274
|
+
const { allowCustomValues = false, options = {}, placeholder } = props || {};
|
|
1275
|
+
const onEnabledChange = () => {
|
|
1276
|
+
const { meta } = linkSessionValue ?? {};
|
|
1277
|
+
const { isEnabled } = meta ?? {};
|
|
1278
|
+
if (isEnabled && value) {
|
|
1279
|
+
setValue(null);
|
|
1280
|
+
} else if (linkSessionValue?.value) {
|
|
1281
|
+
setValue(linkSessionValue?.value ?? null);
|
|
1282
|
+
}
|
|
1283
|
+
setLinkSessionValue({ value, meta: { isEnabled: !isEnabled } });
|
|
1284
|
+
};
|
|
1285
|
+
return /* @__PURE__ */ React27.createElement(PropProvider, { ...propContext, value, setValue }, /* @__PURE__ */ React27.createElement(Stack9, { gap: 1.5 }, /* @__PURE__ */ React27.createElement(Divider2, null), /* @__PURE__ */ React27.createElement(
|
|
1132
1286
|
Stack9,
|
|
1133
1287
|
{
|
|
1134
1288
|
direction: "row",
|
|
@@ -1137,25 +1291,38 @@ var LinkControl = createControl(() => {
|
|
|
1137
1291
|
alignItems: "center"
|
|
1138
1292
|
}
|
|
1139
1293
|
},
|
|
1140
|
-
/* @__PURE__ */
|
|
1141
|
-
/* @__PURE__ */
|
|
1142
|
-
|
|
1294
|
+
/* @__PURE__ */ React27.createElement(ControlLabel, null, __10("Link", "elementor")),
|
|
1295
|
+
/* @__PURE__ */ React27.createElement(
|
|
1296
|
+
ToggleIconControl,
|
|
1297
|
+
{
|
|
1298
|
+
enabled: linkSessionValue?.meta?.isEnabled ?? false,
|
|
1299
|
+
onIconClick: onEnabledChange,
|
|
1300
|
+
label: __10("Toggle Link", "elementor")
|
|
1301
|
+
}
|
|
1302
|
+
)
|
|
1303
|
+
), /* @__PURE__ */ React27.createElement(Collapse, { in: linkSessionValue?.meta?.isEnabled, timeout: "auto", unmountOnExit: true }, /* @__PURE__ */ React27.createElement(Stack9, { gap: 1.5 }, /* @__PURE__ */ React27.createElement(PropKeyProvider, { bind: "href" }, /* @__PURE__ */ React27.createElement(
|
|
1304
|
+
AutocompleteControl,
|
|
1305
|
+
{
|
|
1306
|
+
allowCustomValues: Object.keys(options).length ? allowCustomValues : true,
|
|
1307
|
+
options,
|
|
1308
|
+
propType: stringPropTypeUtil7,
|
|
1309
|
+
placeholder
|
|
1310
|
+
}
|
|
1311
|
+
)), /* @__PURE__ */ React27.createElement(PropKeyProvider, { bind: "isTargetBlank" }, /* @__PURE__ */ React27.createElement(SwitchControl, null))))));
|
|
1143
1312
|
});
|
|
1144
|
-
var ToggleIconControl = () => {
|
|
1145
|
-
|
|
1146
|
-
const handleOnChange = () => setValue(!value);
|
|
1147
|
-
return /* @__PURE__ */ React26.createElement(IconButton3, { size: SIZE3, onClick: handleOnChange }, value ? /* @__PURE__ */ React26.createElement(MinusIcon, { fontSize: SIZE3 }) : /* @__PURE__ */ React26.createElement(PlusIcon2, { fontSize: SIZE3 }));
|
|
1313
|
+
var ToggleIconControl = ({ enabled, onIconClick, label }) => {
|
|
1314
|
+
return /* @__PURE__ */ React27.createElement(IconButton4, { size: SIZE3, onClick: onIconClick, "aria-label": label }, enabled ? /* @__PURE__ */ React27.createElement(MinusIcon, { fontSize: SIZE3 }) : /* @__PURE__ */ React27.createElement(PlusIcon2, { fontSize: SIZE3 }));
|
|
1148
1315
|
};
|
|
1149
1316
|
var SwitchControl = () => {
|
|
1150
|
-
const { value = false, setValue } = useBoundProp();
|
|
1317
|
+
const { value = false, setValue } = useBoundProp(booleanPropTypeUtil);
|
|
1151
1318
|
const onChange = () => {
|
|
1152
1319
|
setValue(!value);
|
|
1153
1320
|
};
|
|
1154
|
-
return /* @__PURE__ */
|
|
1321
|
+
return /* @__PURE__ */ React27.createElement(Grid6, { container: true, alignItems: "center", flexWrap: "nowrap", justifyContent: "space-between" }, /* @__PURE__ */ React27.createElement(Grid6, { item: true }, /* @__PURE__ */ React27.createElement(ControlLabel, null, __10("Open in new tab", "elementor"))), /* @__PURE__ */ React27.createElement(Grid6, { item: true }, /* @__PURE__ */ React27.createElement(Switch, { checked: value, onChange })));
|
|
1155
1322
|
};
|
|
1156
1323
|
|
|
1157
1324
|
// src/controls/gap-control.tsx
|
|
1158
|
-
import * as
|
|
1325
|
+
import * as React28 from "react";
|
|
1159
1326
|
import { gapPropTypeUtil } from "@elementor/editor-props";
|
|
1160
1327
|
import { DetachIcon as DetachIcon2, LinkIcon as LinkIcon2 } from "@elementor/icons";
|
|
1161
1328
|
import { Grid as Grid7, Stack as Stack10, ToggleButton as ToggleButton4 } from "@elementor/ui";
|
|
@@ -1183,7 +1350,7 @@ var GapControl = createControl(({ label }) => {
|
|
|
1183
1350
|
setValue(updatedValue);
|
|
1184
1351
|
};
|
|
1185
1352
|
const LinkedIcon = isLinked ? LinkIcon2 : DetachIcon2;
|
|
1186
|
-
return /* @__PURE__ */
|
|
1353
|
+
return /* @__PURE__ */ React28.createElement(PropProvider, { propType, value, setValue: setLinkedValue }, /* @__PURE__ */ React28.createElement(Stack10, { direction: "row", gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React28.createElement(ControlLabel, null, label), /* @__PURE__ */ React28.createElement(
|
|
1187
1354
|
ToggleButton4,
|
|
1188
1355
|
{
|
|
1189
1356
|
"aria-label": __11("Link Inputs", "elementor"),
|
|
@@ -1193,23 +1360,25 @@ var GapControl = createControl(({ label }) => {
|
|
|
1193
1360
|
sx: { marginLeft: "auto" },
|
|
1194
1361
|
onChange: toggleLinked
|
|
1195
1362
|
},
|
|
1196
|
-
/* @__PURE__ */
|
|
1197
|
-
)), /* @__PURE__ */
|
|
1363
|
+
/* @__PURE__ */ React28.createElement(LinkedIcon, { fontSize: "tiny" })
|
|
1364
|
+
)), /* @__PURE__ */ React28.createElement(Stack10, { direction: "row", gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React28.createElement(Grid7, { container: true, gap: 1, alignItems: "center" }, /* @__PURE__ */ React28.createElement(Grid7, { item: true, xs: 12 }, /* @__PURE__ */ React28.createElement(ControlLabel, null, __11("Column", "elementor"))), /* @__PURE__ */ React28.createElement(Grid7, { item: true, xs: 12 }, /* @__PURE__ */ React28.createElement(PropKeyProvider, { bind: "column" }, /* @__PURE__ */ React28.createElement(SizeControl, null)))), /* @__PURE__ */ React28.createElement(Grid7, { container: true, gap: 1, alignItems: "center" }, /* @__PURE__ */ React28.createElement(Grid7, { item: true, xs: 12 }, /* @__PURE__ */ React28.createElement(ControlLabel, null, __11("Row", "elementor"))), /* @__PURE__ */ React28.createElement(Grid7, { item: true, xs: 12 }, /* @__PURE__ */ React28.createElement(PropKeyProvider, { bind: "row" }, /* @__PURE__ */ React28.createElement(SizeControl, null))))));
|
|
1198
1365
|
});
|
|
1199
1366
|
|
|
1200
1367
|
// src/controls/background-control/background-control.tsx
|
|
1201
|
-
import * as
|
|
1368
|
+
import * as React30 from "react";
|
|
1202
1369
|
import { backgroundPropTypeUtil } from "@elementor/editor-props";
|
|
1203
1370
|
import { Grid as Grid9, Stack as Stack12 } from "@elementor/ui";
|
|
1204
1371
|
import { __ as __13 } from "@wordpress/i18n";
|
|
1205
1372
|
|
|
1206
1373
|
// src/controls/background-control/background-overlay/background-overlay-repeater-control.tsx
|
|
1207
|
-
import * as
|
|
1374
|
+
import * as React29 from "react";
|
|
1208
1375
|
import {
|
|
1209
1376
|
backgroundColorOverlayPropTypeUtil,
|
|
1377
|
+
backgroundImageOverlayPropTypeUtil,
|
|
1210
1378
|
backgroundOverlayPropTypeUtil
|
|
1211
1379
|
} from "@elementor/editor-props";
|
|
1212
1380
|
import { Grid as Grid8, Stack as Stack11, UnstableColorIndicator as UnstableColorIndicator2 } from "@elementor/ui";
|
|
1381
|
+
import { useWpMediaAttachment as useWpMediaAttachment2 } from "@elementor/wp-media";
|
|
1213
1382
|
import { __ as __12 } from "@wordpress/i18n";
|
|
1214
1383
|
var initialBackgroundOverlay = {
|
|
1215
1384
|
$$type: "background-color-overlay",
|
|
@@ -1217,7 +1386,7 @@ var initialBackgroundOverlay = {
|
|
|
1217
1386
|
};
|
|
1218
1387
|
var BackgroundOverlayRepeaterControl = createControl(() => {
|
|
1219
1388
|
const { propType, value: overlayValues, setValue } = useBoundProp(backgroundOverlayPropTypeUtil);
|
|
1220
|
-
return /* @__PURE__ */
|
|
1389
|
+
return /* @__PURE__ */ React29.createElement(PropProvider, { propType, value: overlayValues, setValue }, /* @__PURE__ */ React29.createElement(
|
|
1221
1390
|
Repeater,
|
|
1222
1391
|
{
|
|
1223
1392
|
values: overlayValues ?? [],
|
|
@@ -1232,24 +1401,39 @@ var BackgroundOverlayRepeaterControl = createControl(() => {
|
|
|
1232
1401
|
}
|
|
1233
1402
|
));
|
|
1234
1403
|
});
|
|
1235
|
-
var ItemIcon2 = ({ value }) => /* @__PURE__ */
|
|
1404
|
+
var ItemIcon2 = ({ value }) => /* @__PURE__ */ React29.createElement(UnstableColorIndicator2, { size: "inherit", component: "span", value: value.value });
|
|
1236
1405
|
var ItemContent2 = ({ bind }) => {
|
|
1237
|
-
return /* @__PURE__ */
|
|
1406
|
+
return /* @__PURE__ */ React29.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React29.createElement(Content2, null));
|
|
1238
1407
|
};
|
|
1239
1408
|
var Content2 = () => {
|
|
1240
|
-
|
|
1409
|
+
const propContext = useBoundProp(backgroundImageOverlayPropTypeUtil);
|
|
1410
|
+
return /* @__PURE__ */ React29.createElement(Stack11, { gap: 1.5 }, /* @__PURE__ */ React29.createElement(Grid8, { container: true, spacing: 1, alignItems: "center" }, /* @__PURE__ */ React29.createElement(Grid8, { item: true, xs: 12 }, /* @__PURE__ */ React29.createElement(ControlLabel, null, __12("Color", "elementor"))), /* @__PURE__ */ React29.createElement(Grid8, { item: true, xs: 12 }, /* @__PURE__ */ React29.createElement(ColorControl, { propTypeUtil: backgroundColorOverlayPropTypeUtil }))), /* @__PURE__ */ React29.createElement(PropProvider, { ...propContext }, /* @__PURE__ */ React29.createElement(PropKeyProvider, { bind: "image-src" }, /* @__PURE__ */ React29.createElement(Grid8, { container: true, spacing: 1, alignItems: "center" }, /* @__PURE__ */ React29.createElement(Grid8, { item: true, xs: 12 }, /* @__PURE__ */ React29.createElement(ImageMediaControl, null))))));
|
|
1241
1411
|
};
|
|
1242
1412
|
var ItemLabel2 = ({ value }) => {
|
|
1243
|
-
const
|
|
1244
|
-
|
|
1413
|
+
const type = value.$$type;
|
|
1414
|
+
if (type === "background-color-overlay") {
|
|
1415
|
+
return /* @__PURE__ */ React29.createElement(ItemLabelColor, { value });
|
|
1416
|
+
}
|
|
1417
|
+
if (type === "background-image-overlay") {
|
|
1418
|
+
return /* @__PURE__ */ React29.createElement(ItemLabelImage, { value });
|
|
1419
|
+
}
|
|
1420
|
+
};
|
|
1421
|
+
var ItemLabelColor = ({ value }) => {
|
|
1422
|
+
return /* @__PURE__ */ React29.createElement("span", null, value.value);
|
|
1423
|
+
};
|
|
1424
|
+
var ItemLabelImage = ({ value }) => {
|
|
1425
|
+
const { data: attachment } = useWpMediaAttachment2(value?.value["image-src"]?.value.id.value || null);
|
|
1426
|
+
const imageTitle = attachment?.title || null;
|
|
1427
|
+
return /* @__PURE__ */ React29.createElement("span", null, imageTitle);
|
|
1245
1428
|
};
|
|
1246
1429
|
|
|
1247
1430
|
// src/controls/background-control/background-control.tsx
|
|
1248
1431
|
var BackgroundControl = createControl(() => {
|
|
1249
1432
|
const propContext = useBoundProp(backgroundPropTypeUtil);
|
|
1250
|
-
return /* @__PURE__ */
|
|
1433
|
+
return /* @__PURE__ */ React30.createElement(PropProvider, { ...propContext }, /* @__PURE__ */ React30.createElement(Stack12, { gap: 1.5 }, /* @__PURE__ */ React30.createElement(PropKeyProvider, { bind: "background-overlay" }, /* @__PURE__ */ React30.createElement(BackgroundOverlayRepeaterControl, null)), /* @__PURE__ */ React30.createElement(PropKeyProvider, { bind: "color" }, /* @__PURE__ */ React30.createElement(Grid9, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React30.createElement(Grid9, { item: true, xs: 6 }, /* @__PURE__ */ React30.createElement(ControlLabel, null, __13("Color", "elementor"))), /* @__PURE__ */ React30.createElement(Grid9, { item: true, xs: 6 }, /* @__PURE__ */ React30.createElement(ColorControl, null))))));
|
|
1251
1434
|
});
|
|
1252
1435
|
export {
|
|
1436
|
+
AutocompleteControl,
|
|
1253
1437
|
BackgroundControl,
|
|
1254
1438
|
BoxShadowRepeaterControl,
|
|
1255
1439
|
ColorControl,
|