@elementor/editor-controls 1.0.0 → 1.2.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 +60 -0
- package/dist/index.d.mts +78 -41
- package/dist/index.d.ts +78 -41
- package/dist/index.js +875 -617
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +713 -467
- package/dist/index.mjs.map +1 -1
- package/package.json +11 -11
- package/src/components/font-family-selector.tsx +50 -174
- package/src/components/popover-content.tsx +3 -11
- package/src/components/repeater.tsx +27 -11
- package/src/components/text-field-popover.tsx +3 -3
- package/src/controls/aspect-ratio-control.tsx +20 -2
- package/src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-position.tsx +2 -2
- package/src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-size.tsx +2 -2
- package/src/controls/background-control/background-overlay/background-overlay-repeater-control.tsx +9 -4
- package/src/controls/box-shadow-repeater-control.tsx +2 -2
- package/src/controls/equal-unequal-sizes-control.tsx +3 -9
- package/src/controls/filter-repeater-control.tsx +186 -0
- package/src/controls/font-family-control/font-family-control.tsx +6 -2
- package/src/controls/gap-control.tsx +3 -3
- package/src/controls/image-control.tsx +22 -35
- package/src/controls/key-value-control.tsx +119 -0
- package/src/controls/link-control.tsx +3 -1
- package/src/controls/linked-dimensions-control.tsx +3 -3
- package/src/controls/number-control.tsx +3 -3
- package/src/controls/position-control.tsx +109 -0
- package/src/controls/repeatable-control.tsx +119 -0
- package/src/controls/size-control.tsx +11 -9
- package/src/controls/stroke-control.tsx +2 -2
- package/src/controls/svg-media-control.tsx +0 -2
- package/src/hooks/use-repeatable-control-context.ts +24 -0
- package/src/index.ts +6 -1
package/dist/index.js
CHANGED
|
@@ -41,15 +41,20 @@ __export(index_exports, {
|
|
|
41
41
|
ControlReplacementsProvider: () => ControlReplacementsProvider,
|
|
42
42
|
ControlToggleButtonGroup: () => ControlToggleButtonGroup,
|
|
43
43
|
EqualUnequalSizesControl: () => EqualUnequalSizesControl,
|
|
44
|
+
FilterRepeaterControl: () => FilterRepeaterControl,
|
|
44
45
|
FontFamilyControl: () => FontFamilyControl,
|
|
45
46
|
FontFamilySelector: () => FontFamilySelector,
|
|
46
47
|
GapControl: () => GapControl,
|
|
47
48
|
ImageControl: () => ImageControl,
|
|
49
|
+
KeyValueControl: () => KeyValueControl,
|
|
48
50
|
LinkControl: () => LinkControl,
|
|
49
51
|
LinkedDimensionsControl: () => LinkedDimensionsControl,
|
|
50
52
|
NumberControl: () => NumberControl,
|
|
53
|
+
PopoverContent: () => PopoverContent,
|
|
54
|
+
PositionControl: () => PositionControl,
|
|
51
55
|
PropKeyProvider: () => PropKeyProvider,
|
|
52
56
|
PropProvider: () => PropProvider,
|
|
57
|
+
RepeatableControl: () => RepeatableControl,
|
|
53
58
|
SelectControl: () => SelectControl,
|
|
54
59
|
SizeControl: () => SizeControl,
|
|
55
60
|
StrokeControl: () => StrokeControl,
|
|
@@ -69,10 +74,9 @@ __export(index_exports, {
|
|
|
69
74
|
module.exports = __toCommonJS(index_exports);
|
|
70
75
|
|
|
71
76
|
// src/controls/image-control.tsx
|
|
72
|
-
var
|
|
77
|
+
var React9 = __toESM(require("react"));
|
|
73
78
|
var import_editor_props3 = require("@elementor/editor-props");
|
|
74
|
-
var
|
|
75
|
-
var import_i18n2 = require("@wordpress/i18n");
|
|
79
|
+
var import_ui5 = require("@elementor/ui");
|
|
76
80
|
|
|
77
81
|
// src/bound-prop-context/prop-context.tsx
|
|
78
82
|
var React = __toESM(require("react"));
|
|
@@ -254,23 +258,16 @@ var resolveUnionPropType = (propType, key) => {
|
|
|
254
258
|
return resolvedPropType;
|
|
255
259
|
};
|
|
256
260
|
|
|
257
|
-
// src/components/control-form-label.tsx
|
|
258
|
-
var React3 = __toESM(require("react"));
|
|
259
|
-
var import_ui = require("@elementor/ui");
|
|
260
|
-
var ControlFormLabel = (props) => {
|
|
261
|
-
return /* @__PURE__ */ React3.createElement(import_ui.FormLabel, { size: "tiny", ...props });
|
|
262
|
-
};
|
|
263
|
-
|
|
264
261
|
// src/create-control.tsx
|
|
265
|
-
var
|
|
266
|
-
var
|
|
262
|
+
var React4 = __toESM(require("react"));
|
|
263
|
+
var import_ui = require("@elementor/ui");
|
|
267
264
|
|
|
268
265
|
// src/control-replacements.tsx
|
|
269
|
-
var
|
|
266
|
+
var React3 = __toESM(require("react"));
|
|
270
267
|
var import_react4 = require("react");
|
|
271
268
|
var ControlReplacementContext = (0, import_react4.createContext)([]);
|
|
272
269
|
var ControlReplacementsProvider = ({ replacements, children }) => {
|
|
273
|
-
return /* @__PURE__ */
|
|
270
|
+
return /* @__PURE__ */ React3.createElement(ControlReplacementContext.Provider, { value: replacements }, children);
|
|
274
271
|
};
|
|
275
272
|
var useControlReplacement = (OriginalComponent) => {
|
|
276
273
|
const { value } = useBoundProp();
|
|
@@ -298,7 +295,7 @@ var brandSymbol = Symbol("control");
|
|
|
298
295
|
function createControl(Control5) {
|
|
299
296
|
return (props) => {
|
|
300
297
|
const Component = useControlReplacement(Control5);
|
|
301
|
-
return /* @__PURE__ */
|
|
298
|
+
return /* @__PURE__ */ React4.createElement(import_ui.ErrorBoundary, { fallback: null }, /* @__PURE__ */ React4.createElement(Component, { ...props }));
|
|
302
299
|
};
|
|
303
300
|
}
|
|
304
301
|
|
|
@@ -342,22 +339,22 @@ var formatResponse = (response) => {
|
|
|
342
339
|
};
|
|
343
340
|
|
|
344
341
|
// src/controls/image-media-control.tsx
|
|
345
|
-
var
|
|
342
|
+
var React7 = __toESM(require("react"));
|
|
346
343
|
var import_editor_props = require("@elementor/editor-props");
|
|
347
344
|
var import_icons = require("@elementor/icons");
|
|
348
|
-
var
|
|
345
|
+
var import_ui3 = require("@elementor/ui");
|
|
349
346
|
var import_wp_media = require("@elementor/wp-media");
|
|
350
347
|
var import_i18n = require("@wordpress/i18n");
|
|
351
348
|
|
|
352
349
|
// src/control-actions/control-actions.tsx
|
|
353
|
-
var
|
|
354
|
-
var
|
|
350
|
+
var React6 = __toESM(require("react"));
|
|
351
|
+
var import_ui2 = require("@elementor/ui");
|
|
355
352
|
|
|
356
353
|
// src/control-actions/control-actions-context.tsx
|
|
357
|
-
var
|
|
354
|
+
var React5 = __toESM(require("react"));
|
|
358
355
|
var import_react5 = require("react");
|
|
359
356
|
var Context = (0, import_react5.createContext)(null);
|
|
360
|
-
var ControlActionsProvider = ({ children, items }) => /* @__PURE__ */
|
|
357
|
+
var ControlActionsProvider = ({ children, items }) => /* @__PURE__ */ React5.createElement(Context.Provider, { value: { items } }, children);
|
|
361
358
|
var useControlActions = () => {
|
|
362
359
|
const context = (0, import_react5.useContext)(Context);
|
|
363
360
|
if (!context) {
|
|
@@ -367,7 +364,7 @@ var useControlActions = () => {
|
|
|
367
364
|
};
|
|
368
365
|
|
|
369
366
|
// src/control-actions/control-actions.tsx
|
|
370
|
-
var FloatingBarContainer = (0,
|
|
367
|
+
var FloatingBarContainer = (0, import_ui2.styled)("span")`
|
|
371
368
|
display: contents;
|
|
372
369
|
|
|
373
370
|
.MuiFloatingActionBar-popper:has( .MuiFloatingActionBar-actions:empty ) {
|
|
@@ -384,8 +381,8 @@ function ControlActions({ children }) {
|
|
|
384
381
|
if (items.length === 0 || disabled) {
|
|
385
382
|
return children;
|
|
386
383
|
}
|
|
387
|
-
const menuItems = items.map(({ MenuItem: MenuItem2, id }) => /* @__PURE__ */
|
|
388
|
-
return /* @__PURE__ */
|
|
384
|
+
const menuItems = items.map(({ MenuItem: MenuItem2, id }) => /* @__PURE__ */ React6.createElement(MenuItem2, { key: id }));
|
|
385
|
+
return /* @__PURE__ */ React6.createElement(FloatingBarContainer, null, /* @__PURE__ */ React6.createElement(import_ui2.UnstableFloatingActionBar, { actions: menuItems }, children));
|
|
389
386
|
}
|
|
390
387
|
|
|
391
388
|
// src/controls/image-media-control.tsx
|
|
@@ -408,8 +405,8 @@ var ImageMediaControl = createControl(({ mediaTypes = ["image"] }) => {
|
|
|
408
405
|
});
|
|
409
406
|
}
|
|
410
407
|
});
|
|
411
|
-
return /* @__PURE__ */
|
|
412
|
-
|
|
408
|
+
return /* @__PURE__ */ React7.createElement(ControlActions, null, /* @__PURE__ */ React7.createElement(import_ui3.Card, { variant: "outlined" }, /* @__PURE__ */ React7.createElement(import_ui3.CardMedia, { image: src, sx: { height: 150 } }, isFetching ? /* @__PURE__ */ React7.createElement(import_ui3.Stack, { justifyContent: "center", alignItems: "center", width: "100%", height: "100%" }, /* @__PURE__ */ React7.createElement(import_ui3.CircularProgress, null)) : /* @__PURE__ */ React7.createElement(React7.Fragment, null)), /* @__PURE__ */ React7.createElement(import_ui3.CardOverlay, null, /* @__PURE__ */ React7.createElement(import_ui3.Stack, { gap: 1 }, /* @__PURE__ */ React7.createElement(
|
|
409
|
+
import_ui3.Button,
|
|
413
410
|
{
|
|
414
411
|
size: "tiny",
|
|
415
412
|
color: "inherit",
|
|
@@ -417,13 +414,13 @@ var ImageMediaControl = createControl(({ mediaTypes = ["image"] }) => {
|
|
|
417
414
|
onClick: () => open({ mode: "browse" })
|
|
418
415
|
},
|
|
419
416
|
(0, import_i18n.__)("Select image", "elementor")
|
|
420
|
-
), /* @__PURE__ */
|
|
421
|
-
|
|
417
|
+
), /* @__PURE__ */ React7.createElement(
|
|
418
|
+
import_ui3.Button,
|
|
422
419
|
{
|
|
423
420
|
size: "tiny",
|
|
424
421
|
variant: "text",
|
|
425
422
|
color: "inherit",
|
|
426
|
-
startIcon: /* @__PURE__ */
|
|
423
|
+
startIcon: /* @__PURE__ */ React7.createElement(import_icons.UploadIcon, null),
|
|
427
424
|
onClick: () => open({ mode: "upload" })
|
|
428
425
|
},
|
|
429
426
|
(0, import_i18n.__)("Upload", "elementor")
|
|
@@ -431,10 +428,10 @@ var ImageMediaControl = createControl(({ mediaTypes = ["image"] }) => {
|
|
|
431
428
|
});
|
|
432
429
|
|
|
433
430
|
// src/controls/select-control.tsx
|
|
434
|
-
var
|
|
431
|
+
var React8 = __toESM(require("react"));
|
|
435
432
|
var import_editor_props2 = require("@elementor/editor-props");
|
|
436
433
|
var import_editor_ui = require("@elementor/editor-ui");
|
|
437
|
-
var
|
|
434
|
+
var import_ui4 = require("@elementor/ui");
|
|
438
435
|
var SelectControl = createControl(({ options, onChange }) => {
|
|
439
436
|
const { value, setValue, disabled } = useBoundProp(import_editor_props2.stringPropTypeUtil);
|
|
440
437
|
const handleChange = (event) => {
|
|
@@ -442,8 +439,8 @@ var SelectControl = createControl(({ options, onChange }) => {
|
|
|
442
439
|
onChange?.(newValue, value);
|
|
443
440
|
setValue(newValue);
|
|
444
441
|
};
|
|
445
|
-
return /* @__PURE__ */
|
|
446
|
-
|
|
442
|
+
return /* @__PURE__ */ React8.createElement(ControlActions, null, /* @__PURE__ */ React8.createElement(
|
|
443
|
+
import_ui4.Select,
|
|
447
444
|
{
|
|
448
445
|
sx: { overflow: "hidden" },
|
|
449
446
|
displayEmpty: true,
|
|
@@ -453,29 +450,27 @@ var SelectControl = createControl(({ options, onChange }) => {
|
|
|
453
450
|
disabled,
|
|
454
451
|
fullWidth: true
|
|
455
452
|
},
|
|
456
|
-
options.map(({ label, ...props }) => /* @__PURE__ */
|
|
453
|
+
options.map(({ label, ...props }) => /* @__PURE__ */ React8.createElement(import_editor_ui.MenuListItem, { key: props.value, ...props, value: props.value ?? "" }, label))
|
|
457
454
|
));
|
|
458
455
|
});
|
|
459
456
|
|
|
460
457
|
// src/controls/image-control.tsx
|
|
461
|
-
var ImageControl = createControl(
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
}
|
|
468
|
-
);
|
|
458
|
+
var ImageControl = createControl(({ sizes, showMode = "all" }) => {
|
|
459
|
+
const propContext = useBoundProp(import_editor_props3.imagePropTypeUtil);
|
|
460
|
+
const { data: allowSvgUpload } = useUnfilteredFilesUpload();
|
|
461
|
+
const mediaTypes = allowSvgUpload ? ["image", "svg"] : ["image"];
|
|
462
|
+
return /* @__PURE__ */ React9.createElement(PropProvider, { ...propContext }, /* @__PURE__ */ React9.createElement(import_ui5.Stack, { gap: 1.5 }, ["all", "media"].includes(showMode) ? /* @__PURE__ */ React9.createElement(PropKeyProvider, { bind: "src" }, /* @__PURE__ */ React9.createElement(ImageMediaControl, { mediaTypes })) : null, ["all", "sizes"].includes(showMode) ? /* @__PURE__ */ React9.createElement(PropKeyProvider, { bind: "size" }, /* @__PURE__ */ React9.createElement(SelectControl, { options: sizes })) : null));
|
|
463
|
+
});
|
|
469
464
|
|
|
470
465
|
// src/controls/text-control.tsx
|
|
471
|
-
var
|
|
466
|
+
var React10 = __toESM(require("react"));
|
|
472
467
|
var import_editor_props4 = require("@elementor/editor-props");
|
|
473
|
-
var
|
|
468
|
+
var import_ui6 = require("@elementor/ui");
|
|
474
469
|
var TextControl = createControl(({ placeholder }) => {
|
|
475
470
|
const { value, setValue, disabled } = useBoundProp(import_editor_props4.stringPropTypeUtil);
|
|
476
471
|
const handleChange = (event) => setValue(event.target.value);
|
|
477
|
-
return /* @__PURE__ */
|
|
478
|
-
|
|
472
|
+
return /* @__PURE__ */ React10.createElement(ControlActions, null, /* @__PURE__ */ React10.createElement(
|
|
473
|
+
import_ui6.TextField,
|
|
479
474
|
{
|
|
480
475
|
size: "tiny",
|
|
481
476
|
fullWidth: true,
|
|
@@ -488,16 +483,16 @@ var TextControl = createControl(({ placeholder }) => {
|
|
|
488
483
|
});
|
|
489
484
|
|
|
490
485
|
// src/controls/text-area-control.tsx
|
|
491
|
-
var
|
|
486
|
+
var React11 = __toESM(require("react"));
|
|
492
487
|
var import_editor_props5 = require("@elementor/editor-props");
|
|
493
|
-
var
|
|
488
|
+
var import_ui7 = require("@elementor/ui");
|
|
494
489
|
var TextAreaControl = createControl(({ placeholder }) => {
|
|
495
490
|
const { value, setValue, disabled } = useBoundProp(import_editor_props5.stringPropTypeUtil);
|
|
496
491
|
const handleChange = (event) => {
|
|
497
492
|
setValue(event.target.value);
|
|
498
493
|
};
|
|
499
|
-
return /* @__PURE__ */
|
|
500
|
-
|
|
494
|
+
return /* @__PURE__ */ React11.createElement(ControlActions, null, /* @__PURE__ */ React11.createElement(
|
|
495
|
+
import_ui7.TextField,
|
|
501
496
|
{
|
|
502
497
|
size: "tiny",
|
|
503
498
|
multiline: true,
|
|
@@ -512,17 +507,17 @@ var TextAreaControl = createControl(({ placeholder }) => {
|
|
|
512
507
|
});
|
|
513
508
|
|
|
514
509
|
// src/controls/size-control.tsx
|
|
515
|
-
var
|
|
510
|
+
var React15 = __toESM(require("react"));
|
|
516
511
|
var import_react10 = require("react");
|
|
517
512
|
var import_editor_props6 = require("@elementor/editor-props");
|
|
518
513
|
var import_editor_responsive = require("@elementor/editor-responsive");
|
|
519
|
-
var
|
|
514
|
+
var import_ui11 = require("@elementor/ui");
|
|
520
515
|
|
|
521
516
|
// src/components/size-control/size-input.tsx
|
|
522
|
-
var
|
|
517
|
+
var React13 = __toESM(require("react"));
|
|
523
518
|
var import_react7 = require("react");
|
|
524
519
|
var import_icons2 = require("@elementor/icons");
|
|
525
|
-
var
|
|
520
|
+
var import_ui9 = require("@elementor/ui");
|
|
526
521
|
|
|
527
522
|
// src/utils/size-control.ts
|
|
528
523
|
var defaultUnits = ["px", "%", "em", "rem", "vw", "vh"];
|
|
@@ -532,10 +527,10 @@ function isUnitExtendedOption(unit) {
|
|
|
532
527
|
}
|
|
533
528
|
|
|
534
529
|
// src/components/size-control/text-field-inner-selection.tsx
|
|
535
|
-
var
|
|
530
|
+
var React12 = __toESM(require("react"));
|
|
536
531
|
var import_react6 = require("react");
|
|
537
532
|
var import_editor_ui2 = require("@elementor/editor-ui");
|
|
538
|
-
var
|
|
533
|
+
var import_ui8 = require("@elementor/ui");
|
|
539
534
|
var TextFieldInnerSelection = (0, import_react6.forwardRef)(
|
|
540
535
|
({
|
|
541
536
|
placeholder,
|
|
@@ -549,8 +544,8 @@ var TextFieldInnerSelection = (0, import_react6.forwardRef)(
|
|
|
549
544
|
inputProps,
|
|
550
545
|
disabled
|
|
551
546
|
}, ref) => {
|
|
552
|
-
return /* @__PURE__ */
|
|
553
|
-
|
|
547
|
+
return /* @__PURE__ */ React12.createElement(
|
|
548
|
+
import_ui8.TextField,
|
|
554
549
|
{
|
|
555
550
|
ref,
|
|
556
551
|
sx: { input: { cursor: shouldBlockInput ? "default !important" : void 0 } },
|
|
@@ -577,7 +572,7 @@ var SelectionEndAdornment = ({
|
|
|
577
572
|
menuItemsAttributes = {},
|
|
578
573
|
disabled
|
|
579
574
|
}) => {
|
|
580
|
-
const popupState = (0,
|
|
575
|
+
const popupState = (0, import_ui8.usePopupState)({
|
|
581
576
|
variant: "popover",
|
|
582
577
|
popupId: (0, import_react6.useId)()
|
|
583
578
|
});
|
|
@@ -585,17 +580,17 @@ var SelectionEndAdornment = ({
|
|
|
585
580
|
onClick(options[index]);
|
|
586
581
|
popupState.close();
|
|
587
582
|
};
|
|
588
|
-
return /* @__PURE__ */
|
|
589
|
-
|
|
583
|
+
return /* @__PURE__ */ React12.createElement(import_ui8.InputAdornment, { position: "end" }, /* @__PURE__ */ React12.createElement(
|
|
584
|
+
import_ui8.Button,
|
|
590
585
|
{
|
|
591
586
|
size: "small",
|
|
592
587
|
color: "secondary",
|
|
593
588
|
disabled,
|
|
594
589
|
sx: { font: "inherit", minWidth: "initial", textTransform: "uppercase" },
|
|
595
|
-
...(0,
|
|
590
|
+
...(0, import_ui8.bindTrigger)(popupState)
|
|
596
591
|
},
|
|
597
592
|
alternativeOptionLabels[value] ?? value
|
|
598
|
-
), /* @__PURE__ */
|
|
593
|
+
), /* @__PURE__ */ React12.createElement(import_ui8.Menu, { MenuListProps: { dense: true }, ...(0, import_ui8.bindMenu)(popupState) }, options.map((option, index) => /* @__PURE__ */ React12.createElement(
|
|
599
594
|
import_editor_ui2.MenuListItem,
|
|
600
595
|
{
|
|
601
596
|
key: option,
|
|
@@ -648,8 +643,8 @@ var SizeInput = ({
|
|
|
648
643
|
autoComplete: "off",
|
|
649
644
|
onClick,
|
|
650
645
|
onFocus,
|
|
651
|
-
startAdornment: startIcon ? /* @__PURE__ */
|
|
652
|
-
endAdornment: /* @__PURE__ */
|
|
646
|
+
startAdornment: startIcon ? /* @__PURE__ */ React13.createElement(import_ui9.InputAdornment, { position: "start", disabled }, startIcon) : void 0,
|
|
647
|
+
endAdornment: /* @__PURE__ */ React13.createElement(
|
|
653
648
|
SelectionEndAdornment,
|
|
654
649
|
{
|
|
655
650
|
disabled,
|
|
@@ -657,7 +652,7 @@ var SizeInput = ({
|
|
|
657
652
|
onClick: handleUnitChange,
|
|
658
653
|
value: unit,
|
|
659
654
|
alternativeOptionLabels: {
|
|
660
|
-
custom: /* @__PURE__ */
|
|
655
|
+
custom: /* @__PURE__ */ React13.createElement(import_icons2.PencilIcon, { fontSize: "small" })
|
|
661
656
|
},
|
|
662
657
|
menuItemsAttributes: units2.includes("custom") ? {
|
|
663
658
|
custom: popupAttributes
|
|
@@ -665,7 +660,7 @@ var SizeInput = ({
|
|
|
665
660
|
}
|
|
666
661
|
)
|
|
667
662
|
};
|
|
668
|
-
return /* @__PURE__ */
|
|
663
|
+
return /* @__PURE__ */ React13.createElement(ControlActions, null, /* @__PURE__ */ React13.createElement(import_ui9.Box, null, /* @__PURE__ */ React13.createElement(
|
|
669
664
|
TextFieldInnerSelection,
|
|
670
665
|
{
|
|
671
666
|
disabled,
|
|
@@ -687,15 +682,15 @@ var SizeInput = ({
|
|
|
687
682
|
};
|
|
688
683
|
|
|
689
684
|
// src/components/text-field-popover.tsx
|
|
690
|
-
var
|
|
691
|
-
var
|
|
685
|
+
var React14 = __toESM(require("react"));
|
|
686
|
+
var import_ui10 = require("@elementor/ui");
|
|
692
687
|
var TextFieldPopover = (props) => {
|
|
693
688
|
const { popupState, restoreValue, anchorRef, value, onChange } = props;
|
|
694
|
-
return /* @__PURE__ */
|
|
695
|
-
|
|
689
|
+
return /* @__PURE__ */ React14.createElement(
|
|
690
|
+
import_ui10.Popover,
|
|
696
691
|
{
|
|
697
692
|
disablePortal: true,
|
|
698
|
-
...(0,
|
|
693
|
+
...(0, import_ui10.bindPopover)(popupState),
|
|
699
694
|
anchorOrigin: { vertical: "bottom", horizontal: "center" },
|
|
700
695
|
transformOrigin: { vertical: "top", horizontal: "center" },
|
|
701
696
|
onClose: () => {
|
|
@@ -703,17 +698,17 @@ var TextFieldPopover = (props) => {
|
|
|
703
698
|
popupState.close();
|
|
704
699
|
}
|
|
705
700
|
},
|
|
706
|
-
/* @__PURE__ */
|
|
707
|
-
|
|
701
|
+
/* @__PURE__ */ React14.createElement(
|
|
702
|
+
import_ui10.Paper,
|
|
708
703
|
{
|
|
709
704
|
sx: {
|
|
710
|
-
width: anchorRef.current
|
|
705
|
+
width: anchorRef.current?.offsetWidth + "px",
|
|
711
706
|
borderRadius: 2,
|
|
712
707
|
p: 1.5
|
|
713
708
|
}
|
|
714
709
|
},
|
|
715
|
-
/* @__PURE__ */
|
|
716
|
-
|
|
710
|
+
/* @__PURE__ */ React14.createElement(
|
|
711
|
+
import_ui10.TextField,
|
|
717
712
|
{
|
|
718
713
|
value,
|
|
719
714
|
onChange,
|
|
@@ -784,12 +779,13 @@ var useSyncExternalState = ({
|
|
|
784
779
|
var DEFAULT_UNIT = "px";
|
|
785
780
|
var DEFAULT_SIZE = NaN;
|
|
786
781
|
var SizeControl = createControl((props) => {
|
|
782
|
+
const defaultUnit = props.defaultUnit ?? DEFAULT_UNIT;
|
|
787
783
|
const { units: units2 = [...defaultUnits], placeholder, startIcon, anchorRef } = props;
|
|
788
784
|
const { value: sizeValue, setValue: setSizeValue, disabled, restoreValue } = useBoundProp(import_editor_props6.sizePropTypeUtil);
|
|
789
|
-
const [internalState, setInternalState] = (0, import_react10.useState)(createStateFromSizeProp(sizeValue));
|
|
785
|
+
const [internalState, setInternalState] = (0, import_react10.useState)(createStateFromSizeProp(sizeValue, defaultUnit));
|
|
790
786
|
const activeBreakpoint = (0, import_editor_responsive.useActiveBreakpoint)();
|
|
791
787
|
const extendedOptions = useSizeExtendedOptions(props.extendedOptions || [], props.disableCustom ?? false);
|
|
792
|
-
const popupState = (0,
|
|
788
|
+
const popupState = (0, import_ui11.usePopupState)({ variant: "popover" });
|
|
793
789
|
const [state, setState] = useSyncExternalState({
|
|
794
790
|
external: internalState,
|
|
795
791
|
setExternal: (newState) => setSizeValue(extractValueFromState(newState)),
|
|
@@ -803,7 +799,7 @@ var SizeControl = createControl((props) => {
|
|
|
803
799
|
return !!newState?.numeric || newState?.numeric === 0;
|
|
804
800
|
},
|
|
805
801
|
fallback: (newState) => ({
|
|
806
|
-
unit: newState?.unit ?? DEFAULT_UNIT,
|
|
802
|
+
unit: newState?.unit ?? props.defaultUnit ?? DEFAULT_UNIT,
|
|
807
803
|
numeric: newState?.numeric ?? DEFAULT_SIZE,
|
|
808
804
|
custom: newState?.custom ?? ""
|
|
809
805
|
})
|
|
@@ -838,7 +834,7 @@ var SizeControl = createControl((props) => {
|
|
|
838
834
|
}
|
|
839
835
|
};
|
|
840
836
|
(0, import_react10.useEffect)(() => {
|
|
841
|
-
const newState = createStateFromSizeProp(sizeValue);
|
|
837
|
+
const newState = createStateFromSizeProp(sizeValue, defaultUnit);
|
|
842
838
|
const currentUnit = isUnitExtendedOption(state.unit) ? "custom" : "numeric";
|
|
843
839
|
const mergedStates = { ...state, [currentUnit]: newState[currentUnit] };
|
|
844
840
|
if (mergedStates.unit !== "auto" && areStatesEqual(state, mergedStates)) {
|
|
@@ -851,12 +847,12 @@ var SizeControl = createControl((props) => {
|
|
|
851
847
|
setState(newState);
|
|
852
848
|
}, [sizeValue]);
|
|
853
849
|
(0, import_react10.useEffect)(() => {
|
|
854
|
-
const newState = createStateFromSizeProp(sizeValue);
|
|
850
|
+
const newState = createStateFromSizeProp(sizeValue, defaultUnit);
|
|
855
851
|
if (activeBreakpoint && !areStatesEqual(newState, state)) {
|
|
856
852
|
setState(newState);
|
|
857
853
|
}
|
|
858
854
|
}, [activeBreakpoint]);
|
|
859
|
-
return /* @__PURE__ */
|
|
855
|
+
return /* @__PURE__ */ React15.createElement(React15.Fragment, null, /* @__PURE__ */ React15.createElement(
|
|
860
856
|
SizeInput,
|
|
861
857
|
{
|
|
862
858
|
disabled,
|
|
@@ -872,7 +868,7 @@ var SizeControl = createControl((props) => {
|
|
|
872
868
|
onClick: onInputClick,
|
|
873
869
|
popupState
|
|
874
870
|
}
|
|
875
|
-
), anchorRef?.current && /* @__PURE__ */
|
|
871
|
+
), anchorRef?.current && /* @__PURE__ */ React15.createElement(
|
|
876
872
|
TextFieldPopover,
|
|
877
873
|
{
|
|
878
874
|
popupState,
|
|
@@ -889,8 +885,8 @@ function formatSize(size, unit) {
|
|
|
889
885
|
}
|
|
890
886
|
return size || size === 0 ? Number(size) : NaN;
|
|
891
887
|
}
|
|
892
|
-
function createStateFromSizeProp(sizeValue) {
|
|
893
|
-
const unit = sizeValue?.unit ??
|
|
888
|
+
function createStateFromSizeProp(sizeValue, defaultUnit) {
|
|
889
|
+
const unit = sizeValue?.unit ?? defaultUnit;
|
|
894
890
|
const size = sizeValue?.size ?? "";
|
|
895
891
|
return {
|
|
896
892
|
numeric: !isUnitExtendedOption(unit) && !isNaN(Number(size)) && (size || size === 0) ? Number(size) : DEFAULT_SIZE,
|
|
@@ -929,7 +925,14 @@ var React19 = __toESM(require("react"));
|
|
|
929
925
|
var import_react11 = require("react");
|
|
930
926
|
var import_editor_props8 = require("@elementor/editor-props");
|
|
931
927
|
var import_ui15 = require("@elementor/ui");
|
|
932
|
-
var
|
|
928
|
+
var import_i18n2 = require("@wordpress/i18n");
|
|
929
|
+
|
|
930
|
+
// src/components/control-form-label.tsx
|
|
931
|
+
var React16 = __toESM(require("react"));
|
|
932
|
+
var import_ui12 = require("@elementor/ui");
|
|
933
|
+
var ControlFormLabel = (props) => {
|
|
934
|
+
return /* @__PURE__ */ React16.createElement(import_ui12.FormLabel, { size: "tiny", ...props });
|
|
935
|
+
};
|
|
933
936
|
|
|
934
937
|
// src/components/section-content.tsx
|
|
935
938
|
var React17 = __toESM(require("react"));
|
|
@@ -978,8 +981,8 @@ var ColorControl = createControl(
|
|
|
978
981
|
var units = ["px", "em", "rem"];
|
|
979
982
|
var StrokeControl = createControl(() => {
|
|
980
983
|
const propContext = useBoundProp(import_editor_props8.strokePropTypeUtil);
|
|
981
|
-
const rowRef = (0, import_react11.useRef)();
|
|
982
|
-
return /* @__PURE__ */ React19.createElement(PropProvider, { ...propContext }, /* @__PURE__ */ React19.createElement(SectionContent, null, /* @__PURE__ */ React19.createElement(Control, { bind: "width", label: (0,
|
|
984
|
+
const rowRef = (0, import_react11.useRef)(null);
|
|
985
|
+
return /* @__PURE__ */ React19.createElement(PropProvider, { ...propContext }, /* @__PURE__ */ React19.createElement(SectionContent, null, /* @__PURE__ */ React19.createElement(Control, { bind: "width", label: (0, import_i18n2.__)("Stroke width", "elementor"), ref: rowRef }, /* @__PURE__ */ React19.createElement(SizeControl, { units, anchorRef: rowRef })), /* @__PURE__ */ React19.createElement(Control, { bind: "color", label: (0, import_i18n2.__)("Stroke color", "elementor") }, /* @__PURE__ */ React19.createElement(ColorControl, null))));
|
|
983
986
|
});
|
|
984
987
|
var Control = (0, import_react11.forwardRef)(({ bind, label, children }, ref) => /* @__PURE__ */ React19.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React19.createElement(import_ui15.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap", ref }, /* @__PURE__ */ React19.createElement(import_ui15.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React19.createElement(ControlFormLabel, null, label)), /* @__PURE__ */ React19.createElement(import_ui15.Grid, { item: true, xs: 6 }, children))));
|
|
985
988
|
|
|
@@ -988,12 +991,12 @@ var React26 = __toESM(require("react"));
|
|
|
988
991
|
var import_react15 = require("react");
|
|
989
992
|
var import_editor_props9 = require("@elementor/editor-props");
|
|
990
993
|
var import_ui20 = require("@elementor/ui");
|
|
991
|
-
var
|
|
994
|
+
var import_i18n4 = require("@wordpress/i18n");
|
|
992
995
|
|
|
993
996
|
// src/components/popover-content.tsx
|
|
994
997
|
var React20 = __toESM(require("react"));
|
|
995
998
|
var import_ui16 = require("@elementor/ui");
|
|
996
|
-
var PopoverContent = ({
|
|
999
|
+
var PopoverContent = ({ gap = 1.5, children, ...props }) => /* @__PURE__ */ React20.createElement(import_ui16.Stack, { ...props, gap }, children);
|
|
997
1000
|
|
|
998
1001
|
// src/components/popover-grid-container.tsx
|
|
999
1002
|
var import_react12 = require("react");
|
|
@@ -1008,7 +1011,7 @@ var React25 = __toESM(require("react"));
|
|
|
1008
1011
|
var import_react14 = require("react");
|
|
1009
1012
|
var import_icons4 = require("@elementor/icons");
|
|
1010
1013
|
var import_ui19 = require("@elementor/ui");
|
|
1011
|
-
var
|
|
1014
|
+
var import_i18n3 = require("@wordpress/i18n");
|
|
1012
1015
|
|
|
1013
1016
|
// src/control-adornments/control-adornments.tsx
|
|
1014
1017
|
var React23 = __toESM(require("react"));
|
|
@@ -1120,7 +1123,10 @@ var Repeater = ({
|
|
|
1120
1123
|
openOnAdd = false,
|
|
1121
1124
|
addToBottom = false,
|
|
1122
1125
|
values: repeaterValues = [],
|
|
1123
|
-
setValues: setRepeaterValues
|
|
1126
|
+
setValues: setRepeaterValues,
|
|
1127
|
+
showDuplicate = true,
|
|
1128
|
+
showToggle = true,
|
|
1129
|
+
isSortable = true
|
|
1124
1130
|
}) => {
|
|
1125
1131
|
const [openItem, setOpenItem] = (0, import_react14.useState)(EMPTY_OPEN_ITEM);
|
|
1126
1132
|
const [items, setItems] = useSyncExternalState({
|
|
@@ -1204,7 +1210,7 @@ var Repeater = ({
|
|
|
1204
1210
|
sx: { ml: "auto" },
|
|
1205
1211
|
disabled,
|
|
1206
1212
|
onClick: addRepeaterItem,
|
|
1207
|
-
"aria-label": (0,
|
|
1213
|
+
"aria-label": (0, import_i18n3.__)("Add item", "elementor")
|
|
1208
1214
|
},
|
|
1209
1215
|
/* @__PURE__ */ React25.createElement(import_icons4.PlusIcon, { fontSize: SIZE })
|
|
1210
1216
|
)
|
|
@@ -1213,7 +1219,7 @@ var Repeater = ({
|
|
|
1213
1219
|
if (!value) {
|
|
1214
1220
|
return null;
|
|
1215
1221
|
}
|
|
1216
|
-
return /* @__PURE__ */ React25.createElement(SortableItem, { id: key, key: `sortable-${key}`, disabled }, /* @__PURE__ */ React25.createElement(
|
|
1222
|
+
return /* @__PURE__ */ React25.createElement(SortableItem, { id: key, key: `sortable-${key}`, disabled: !isSortable }, /* @__PURE__ */ React25.createElement(
|
|
1217
1223
|
RepeaterItem,
|
|
1218
1224
|
{
|
|
1219
1225
|
disabled,
|
|
@@ -1224,7 +1230,9 @@ var Repeater = ({
|
|
|
1224
1230
|
duplicateItem: () => duplicateRepeaterItem(index),
|
|
1225
1231
|
toggleDisableItem: () => toggleDisableRepeaterItem(index),
|
|
1226
1232
|
openOnMount: openOnAdd && openItem === key,
|
|
1227
|
-
onOpen: () => setOpenItem(EMPTY_OPEN_ITEM)
|
|
1233
|
+
onOpen: () => setOpenItem(EMPTY_OPEN_ITEM),
|
|
1234
|
+
showDuplicate,
|
|
1235
|
+
showToggle
|
|
1228
1236
|
},
|
|
1229
1237
|
(props) => /* @__PURE__ */ React25.createElement(itemSettings.Content, { ...props, value, bind: String(index) })
|
|
1230
1238
|
));
|
|
@@ -1240,13 +1248,15 @@ var RepeaterItem = ({
|
|
|
1240
1248
|
toggleDisableItem,
|
|
1241
1249
|
openOnMount,
|
|
1242
1250
|
onOpen,
|
|
1251
|
+
showDuplicate,
|
|
1252
|
+
showToggle,
|
|
1243
1253
|
disabled
|
|
1244
1254
|
}) => {
|
|
1245
1255
|
const [anchorEl, setAnchorEl] = (0, import_react14.useState)(null);
|
|
1246
1256
|
const { popoverState, popoverProps, ref, setRef } = usePopover(openOnMount, onOpen);
|
|
1247
|
-
const duplicateLabel = (0,
|
|
1248
|
-
const toggleLabel = propDisabled ? (0,
|
|
1249
|
-
const removeLabel = (0,
|
|
1257
|
+
const duplicateLabel = (0, import_i18n3.__)("Duplicate", "elementor");
|
|
1258
|
+
const toggleLabel = propDisabled ? (0, import_i18n3.__)("Show", "elementor") : (0, import_i18n3.__)("Hide", "elementor");
|
|
1259
|
+
const removeLabel = (0, import_i18n3.__)("Remove", "elementor");
|
|
1250
1260
|
return /* @__PURE__ */ React25.createElement(React25.Fragment, null, /* @__PURE__ */ React25.createElement(
|
|
1251
1261
|
import_ui19.UnstableTag,
|
|
1252
1262
|
{
|
|
@@ -1256,10 +1266,10 @@ var RepeaterItem = ({
|
|
|
1256
1266
|
fullWidth: true,
|
|
1257
1267
|
ref: setRef,
|
|
1258
1268
|
variant: "outlined",
|
|
1259
|
-
"aria-label": (0,
|
|
1269
|
+
"aria-label": (0, import_i18n3.__)("Open item", "elementor"),
|
|
1260
1270
|
...(0, import_ui19.bindTrigger)(popoverState),
|
|
1261
1271
|
startIcon,
|
|
1262
|
-
actions: /* @__PURE__ */ React25.createElement(React25.Fragment, null, /* @__PURE__ */ React25.createElement(import_ui19.Tooltip, { title: duplicateLabel, placement: "top" }, /* @__PURE__ */ React25.createElement(import_ui19.IconButton, { size: SIZE, onClick: duplicateItem, "aria-label": duplicateLabel }, /* @__PURE__ */ React25.createElement(import_icons4.CopyIcon, { fontSize: SIZE }))), /* @__PURE__ */ React25.createElement(import_ui19.Tooltip, { title: toggleLabel, placement: "top" }, /* @__PURE__ */ React25.createElement(import_ui19.IconButton, { size: SIZE, onClick: toggleDisableItem, "aria-label": toggleLabel }, propDisabled ? /* @__PURE__ */ React25.createElement(import_icons4.EyeOffIcon, { fontSize: SIZE }) : /* @__PURE__ */ React25.createElement(import_icons4.EyeIcon, { fontSize: SIZE }))), /* @__PURE__ */ React25.createElement(import_ui19.Tooltip, { title: removeLabel, placement: "top" }, /* @__PURE__ */ React25.createElement(import_ui19.IconButton, { size: SIZE, onClick: removeItem, "aria-label": removeLabel }, /* @__PURE__ */ React25.createElement(import_icons4.XIcon, { fontSize: SIZE }))))
|
|
1272
|
+
actions: /* @__PURE__ */ React25.createElement(React25.Fragment, null, showDuplicate && /* @__PURE__ */ React25.createElement(import_ui19.Tooltip, { title: duplicateLabel, placement: "top" }, /* @__PURE__ */ React25.createElement(import_ui19.IconButton, { size: SIZE, onClick: duplicateItem, "aria-label": duplicateLabel }, /* @__PURE__ */ React25.createElement(import_icons4.CopyIcon, { fontSize: SIZE }))), showToggle && /* @__PURE__ */ React25.createElement(import_ui19.Tooltip, { title: toggleLabel, placement: "top" }, /* @__PURE__ */ React25.createElement(import_ui19.IconButton, { size: SIZE, onClick: toggleDisableItem, "aria-label": toggleLabel }, propDisabled ? /* @__PURE__ */ React25.createElement(import_icons4.EyeOffIcon, { fontSize: SIZE }) : /* @__PURE__ */ React25.createElement(import_icons4.EyeIcon, { fontSize: SIZE }))), /* @__PURE__ */ React25.createElement(import_ui19.Tooltip, { title: removeLabel, placement: "top" }, /* @__PURE__ */ React25.createElement(import_ui19.IconButton, { size: SIZE, onClick: removeItem, "aria-label": removeLabel }, /* @__PURE__ */ React25.createElement(import_icons4.XIcon, { fontSize: SIZE }))))
|
|
1263
1273
|
}
|
|
1264
1274
|
), /* @__PURE__ */ React25.createElement(
|
|
1265
1275
|
import_ui19.Popover,
|
|
@@ -1306,7 +1316,7 @@ var BoxShadowRepeaterControl = createControl(() => {
|
|
|
1306
1316
|
disabled,
|
|
1307
1317
|
values: value ?? [],
|
|
1308
1318
|
setValues: setValue,
|
|
1309
|
-
label: (0,
|
|
1319
|
+
label: (0, import_i18n4.__)("Box shadow", "elementor"),
|
|
1310
1320
|
itemSettings: {
|
|
1311
1321
|
Icon: ItemIcon,
|
|
1312
1322
|
Label: ItemLabel,
|
|
@@ -1322,16 +1332,16 @@ var ItemContent = ({ anchorEl, bind }) => {
|
|
|
1322
1332
|
};
|
|
1323
1333
|
var Content = ({ anchorEl }) => {
|
|
1324
1334
|
const context = useBoundProp(import_editor_props9.shadowPropTypeUtil);
|
|
1325
|
-
const rowRef = [(0, import_react15.useRef)(), (0, import_react15.useRef)()];
|
|
1326
|
-
return /* @__PURE__ */ React26.createElement(PropProvider, { ...context }, /* @__PURE__ */ React26.createElement(PopoverContent, { p: 1.5 }, /* @__PURE__ */ React26.createElement(PopoverGridContainer, null, /* @__PURE__ */ React26.createElement(Control2, { bind: "color", label: (0,
|
|
1335
|
+
const rowRef = [(0, import_react15.useRef)(null), (0, import_react15.useRef)(null)];
|
|
1336
|
+
return /* @__PURE__ */ React26.createElement(PropProvider, { ...context }, /* @__PURE__ */ React26.createElement(PopoverContent, { p: 1.5 }, /* @__PURE__ */ React26.createElement(PopoverGridContainer, null, /* @__PURE__ */ React26.createElement(Control2, { bind: "color", label: (0, import_i18n4.__)("Color", "elementor") }, /* @__PURE__ */ React26.createElement(ColorControl, { anchorEl })), /* @__PURE__ */ React26.createElement(Control2, { bind: "position", label: (0, import_i18n4.__)("Position", "elementor"), sx: { overflow: "hidden" } }, /* @__PURE__ */ React26.createElement(
|
|
1327
1337
|
SelectControl,
|
|
1328
1338
|
{
|
|
1329
1339
|
options: [
|
|
1330
|
-
{ label: (0,
|
|
1331
|
-
{ label: (0,
|
|
1340
|
+
{ label: (0, import_i18n4.__)("Inset", "elementor"), value: "inset" },
|
|
1341
|
+
{ label: (0, import_i18n4.__)("Outset", "elementor"), value: null }
|
|
1332
1342
|
]
|
|
1333
1343
|
}
|
|
1334
|
-
))), /* @__PURE__ */ React26.createElement(PopoverGridContainer, { ref: rowRef[0] }, /* @__PURE__ */ React26.createElement(Control2, { bind: "hOffset", label: (0,
|
|
1344
|
+
))), /* @__PURE__ */ React26.createElement(PopoverGridContainer, { ref: rowRef[0] }, /* @__PURE__ */ React26.createElement(Control2, { bind: "hOffset", label: (0, import_i18n4.__)("Horizontal", "elementor") }, /* @__PURE__ */ React26.createElement(SizeControl, { anchorRef: rowRef[0] })), /* @__PURE__ */ React26.createElement(Control2, { bind: "vOffset", label: (0, import_i18n4.__)("Vertical", "elementor") }, /* @__PURE__ */ React26.createElement(SizeControl, { anchorRef: rowRef[0] }))), /* @__PURE__ */ React26.createElement(PopoverGridContainer, { ref: rowRef[1] }, /* @__PURE__ */ React26.createElement(Control2, { bind: "blur", label: (0, import_i18n4.__)("Blur", "elementor") }, /* @__PURE__ */ React26.createElement(SizeControl, { anchorRef: rowRef[1] })), /* @__PURE__ */ React26.createElement(Control2, { bind: "spread", label: (0, import_i18n4.__)("Spread", "elementor") }, /* @__PURE__ */ React26.createElement(SizeControl, { anchorRef: rowRef[1] })))));
|
|
1335
1345
|
};
|
|
1336
1346
|
var Control2 = ({
|
|
1337
1347
|
label,
|
|
@@ -1381,29 +1391,138 @@ var initialShadow = {
|
|
|
1381
1391
|
}
|
|
1382
1392
|
};
|
|
1383
1393
|
|
|
1384
|
-
// src/controls/
|
|
1385
|
-
var React29 = __toESM(require("react"));
|
|
1386
|
-
var import_editor_props10 = require("@elementor/editor-props");
|
|
1387
|
-
|
|
1388
|
-
// src/components/control-toggle-button-group.tsx
|
|
1394
|
+
// src/controls/filter-repeater-control.tsx
|
|
1389
1395
|
var React28 = __toESM(require("react"));
|
|
1390
1396
|
var import_react16 = require("react");
|
|
1391
|
-
var
|
|
1397
|
+
var import_editor_props10 = require("@elementor/editor-props");
|
|
1398
|
+
var import_editor_ui3 = require("@elementor/editor-ui");
|
|
1392
1399
|
var import_ui22 = require("@elementor/ui");
|
|
1400
|
+
var import_i18n5 = require("@wordpress/i18n");
|
|
1393
1401
|
|
|
1394
|
-
// src/components/
|
|
1402
|
+
// src/components/control-label.tsx
|
|
1395
1403
|
var React27 = __toESM(require("react"));
|
|
1396
1404
|
var import_ui21 = require("@elementor/ui");
|
|
1405
|
+
var ControlLabel = ({ children }) => {
|
|
1406
|
+
return /* @__PURE__ */ React27.createElement(import_ui21.Stack, { direction: "row", alignItems: "center", justifyItems: "start", gap: 0.25 }, /* @__PURE__ */ React27.createElement(ControlFormLabel, null, children), /* @__PURE__ */ React27.createElement(ControlAdornments, null));
|
|
1407
|
+
};
|
|
1408
|
+
|
|
1409
|
+
// src/controls/filter-repeater-control.tsx
|
|
1410
|
+
var DEFAULT_FILTER_KEY = "blur";
|
|
1411
|
+
var filterConfig = {
|
|
1412
|
+
blur: {
|
|
1413
|
+
defaultValue: { $$type: "radius", radius: { $$type: "size", value: { size: 0, unit: "px" } } },
|
|
1414
|
+
name: (0, import_i18n5.__)("Blur", "elementor"),
|
|
1415
|
+
valueName: (0, import_i18n5.__)("Radius", "elementor"),
|
|
1416
|
+
propType: import_editor_props10.blurFilterPropTypeUtil,
|
|
1417
|
+
units: defaultUnits.filter((unit) => unit !== "%")
|
|
1418
|
+
},
|
|
1419
|
+
brightness: {
|
|
1420
|
+
defaultValue: { $$type: "amount", amount: { $$type: "size", value: { size: 100, unit: "%" } } },
|
|
1421
|
+
name: (0, import_i18n5.__)("Brightness", "elementor"),
|
|
1422
|
+
valueName: (0, import_i18n5.__)("Amount", "elementor"),
|
|
1423
|
+
propType: import_editor_props10.brightnessFilterPropTypeUtil,
|
|
1424
|
+
units: ["%"]
|
|
1425
|
+
}
|
|
1426
|
+
};
|
|
1427
|
+
var filterKeys = Object.keys(filterConfig);
|
|
1428
|
+
var singleSizeFilterNames = filterKeys.filter((name) => {
|
|
1429
|
+
const filter = filterConfig[name].defaultValue;
|
|
1430
|
+
return filter[filter.$$type].$$type === "size";
|
|
1431
|
+
});
|
|
1432
|
+
var FilterRepeaterControl = createControl(() => {
|
|
1433
|
+
const { propType, value: filterValues, setValue, disabled } = useBoundProp(import_editor_props10.filterPropTypeUtil);
|
|
1434
|
+
return /* @__PURE__ */ React28.createElement(PropProvider, { propType, value: filterValues, setValue }, /* @__PURE__ */ React28.createElement(
|
|
1435
|
+
Repeater,
|
|
1436
|
+
{
|
|
1437
|
+
openOnAdd: true,
|
|
1438
|
+
disabled,
|
|
1439
|
+
values: filterValues ?? [],
|
|
1440
|
+
setValues: setValue,
|
|
1441
|
+
label: (0, import_i18n5.__)("Filter", "elementor"),
|
|
1442
|
+
itemSettings: {
|
|
1443
|
+
Icon: ItemIcon2,
|
|
1444
|
+
Label: ItemLabel2,
|
|
1445
|
+
Content: ItemContent2,
|
|
1446
|
+
initialValues: {
|
|
1447
|
+
$$type: DEFAULT_FILTER_KEY,
|
|
1448
|
+
value: filterConfig[DEFAULT_FILTER_KEY].defaultValue
|
|
1449
|
+
}
|
|
1450
|
+
}
|
|
1451
|
+
}
|
|
1452
|
+
));
|
|
1453
|
+
});
|
|
1454
|
+
var ItemIcon2 = () => /* @__PURE__ */ React28.createElement(React28.Fragment, null);
|
|
1455
|
+
var ItemLabel2 = (props) => {
|
|
1456
|
+
const { $$type } = props.value;
|
|
1457
|
+
return singleSizeFilterNames.includes($$type) && /* @__PURE__ */ React28.createElement(SingleSizeItemLabel, { value: props.value });
|
|
1458
|
+
};
|
|
1459
|
+
var SingleSizeItemLabel = ({ value }) => {
|
|
1460
|
+
const { $$type, value: sizeValue } = value;
|
|
1461
|
+
const { $$type: key } = filterConfig[$$type].defaultValue;
|
|
1462
|
+
const defaultUnit = filterConfig[$$type].defaultValue[key].value.unit;
|
|
1463
|
+
const { unit, size } = sizeValue[key]?.value ?? { unit: defaultUnit, size: 0 };
|
|
1464
|
+
const label = /* @__PURE__ */ React28.createElement(import_ui22.Box, { component: "span", style: { textTransform: "capitalize" } }, value.$$type, ":");
|
|
1465
|
+
return /* @__PURE__ */ React28.createElement(import_ui22.Box, { component: "span" }, label, unit !== "custom" ? ` ${size ?? 0}${unit ?? defaultUnit}` : size);
|
|
1466
|
+
};
|
|
1467
|
+
var ItemContent2 = ({ bind }) => {
|
|
1468
|
+
const { value: filterValues, setValue } = useBoundProp(import_editor_props10.filterPropTypeUtil);
|
|
1469
|
+
const itemIndex = parseInt(bind, 10);
|
|
1470
|
+
const item = filterValues?.[itemIndex];
|
|
1471
|
+
const handleChange = (e) => {
|
|
1472
|
+
const newFilterValues = [...filterValues];
|
|
1473
|
+
const filterType = e.target.value;
|
|
1474
|
+
newFilterValues[itemIndex] = {
|
|
1475
|
+
$$type: filterType,
|
|
1476
|
+
value: filterConfig[filterType].defaultValue
|
|
1477
|
+
};
|
|
1478
|
+
setValue(newFilterValues);
|
|
1479
|
+
};
|
|
1480
|
+
return /* @__PURE__ */ React28.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React28.createElement(PopoverContent, { p: 1.5 }, /* @__PURE__ */ React28.createElement(PopoverGridContainer, null, /* @__PURE__ */ React28.createElement(import_ui22.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React28.createElement(ControlLabel, null, (0, import_i18n5.__)("Filter", "elementor"))), /* @__PURE__ */ React28.createElement(import_ui22.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React28.createElement(
|
|
1481
|
+
import_ui22.Select,
|
|
1482
|
+
{
|
|
1483
|
+
sx: { overflow: "hidden" },
|
|
1484
|
+
size: "tiny",
|
|
1485
|
+
value: item?.$$type ?? DEFAULT_FILTER_KEY,
|
|
1486
|
+
onChange: handleChange,
|
|
1487
|
+
fullWidth: true
|
|
1488
|
+
},
|
|
1489
|
+
filterKeys.map((filterKey) => /* @__PURE__ */ React28.createElement(import_editor_ui3.MenuListItem, { key: filterKey, value: filterKey }, filterConfig[filterKey].name))
|
|
1490
|
+
))), /* @__PURE__ */ React28.createElement(Content2, { filterType: item?.$$type })));
|
|
1491
|
+
};
|
|
1492
|
+
var Content2 = ({ filterType }) => {
|
|
1493
|
+
return singleSizeFilterNames.includes(filterType) && /* @__PURE__ */ React28.createElement(SingleSizeItemContent, { filterType });
|
|
1494
|
+
};
|
|
1495
|
+
var SingleSizeItemContent = ({ filterType }) => {
|
|
1496
|
+
const { propType, valueName, defaultValue, units: units2 } = filterConfig[filterType];
|
|
1497
|
+
const { $$type } = defaultValue;
|
|
1498
|
+
const context = useBoundProp(propType);
|
|
1499
|
+
const rowRef = (0, import_react16.useRef)(null);
|
|
1500
|
+
return /* @__PURE__ */ React28.createElement(PropProvider, { ...context }, /* @__PURE__ */ React28.createElement(PropKeyProvider, { bind: $$type }, /* @__PURE__ */ React28.createElement(PopoverGridContainer, { ref: rowRef }, /* @__PURE__ */ React28.createElement(import_ui22.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React28.createElement(ControlLabel, null, valueName)), /* @__PURE__ */ React28.createElement(import_ui22.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React28.createElement(SizeControl, { anchorRef: rowRef, units: units2 })))));
|
|
1501
|
+
};
|
|
1502
|
+
|
|
1503
|
+
// src/controls/toggle-control.tsx
|
|
1504
|
+
var React31 = __toESM(require("react"));
|
|
1505
|
+
var import_editor_props11 = require("@elementor/editor-props");
|
|
1506
|
+
|
|
1507
|
+
// src/components/control-toggle-button-group.tsx
|
|
1508
|
+
var React30 = __toESM(require("react"));
|
|
1509
|
+
var import_react17 = require("react");
|
|
1510
|
+
var import_icons5 = require("@elementor/icons");
|
|
1511
|
+
var import_ui24 = require("@elementor/ui");
|
|
1512
|
+
|
|
1513
|
+
// src/components/conditional-tooltip.tsx
|
|
1514
|
+
var React29 = __toESM(require("react"));
|
|
1515
|
+
var import_ui23 = require("@elementor/ui");
|
|
1397
1516
|
var ConditionalTooltip = ({
|
|
1398
1517
|
showTooltip,
|
|
1399
1518
|
children,
|
|
1400
1519
|
label
|
|
1401
1520
|
}) => {
|
|
1402
|
-
return showTooltip && label ? /* @__PURE__ */
|
|
1521
|
+
return showTooltip && label ? /* @__PURE__ */ React29.createElement(import_ui23.Tooltip, { title: label, disableFocusListener: true, placement: "top" }, children) : children;
|
|
1403
1522
|
};
|
|
1404
1523
|
|
|
1405
1524
|
// src/components/control-toggle-button-group.tsx
|
|
1406
|
-
var StyledToggleButtonGroup = (0,
|
|
1525
|
+
var StyledToggleButtonGroup = (0, import_ui24.styled)(import_ui24.ToggleButtonGroup)`
|
|
1407
1526
|
${({ justify }) => `justify-content: ${justify};`}
|
|
1408
1527
|
button:not( :last-of-type ) {
|
|
1409
1528
|
border-start-end-radius: 0;
|
|
@@ -1432,17 +1551,17 @@ var ControlToggleButtonGroup = ({
|
|
|
1432
1551
|
const shouldSliceItems = exclusive && maxItems !== void 0 && items.length > maxItems;
|
|
1433
1552
|
const menuItems = shouldSliceItems ? items.slice(maxItems - 1) : [];
|
|
1434
1553
|
const fixedItems = shouldSliceItems ? items.slice(0, maxItems - 1) : items;
|
|
1435
|
-
const isRtl = "rtl" === (0,
|
|
1554
|
+
const isRtl = "rtl" === (0, import_ui24.useTheme)().direction;
|
|
1436
1555
|
const handleChange = (_, newValue) => {
|
|
1437
1556
|
onChange(newValue);
|
|
1438
1557
|
};
|
|
1439
|
-
const getGridTemplateColumns = (0,
|
|
1558
|
+
const getGridTemplateColumns = (0, import_react17.useMemo)(() => {
|
|
1440
1559
|
const isOffLimits = menuItems?.length;
|
|
1441
1560
|
const itemsCount = isOffLimits ? fixedItems.length + 1 : fixedItems.length;
|
|
1442
1561
|
const templateColumnsSuffix = isOffLimits ? "auto" : "";
|
|
1443
1562
|
return `repeat(${itemsCount}, minmax(0, 25%)) ${templateColumnsSuffix}`;
|
|
1444
1563
|
}, [menuItems?.length, fixedItems.length]);
|
|
1445
|
-
return /* @__PURE__ */
|
|
1564
|
+
return /* @__PURE__ */ React30.createElement(ControlActions, null, /* @__PURE__ */ React30.createElement(
|
|
1446
1565
|
StyledToggleButtonGroup,
|
|
1447
1566
|
{
|
|
1448
1567
|
justify,
|
|
@@ -1457,16 +1576,16 @@ var ControlToggleButtonGroup = ({
|
|
|
1457
1576
|
width: `100%`
|
|
1458
1577
|
}
|
|
1459
1578
|
},
|
|
1460
|
-
fixedItems.map(({ label, value: buttonValue, renderContent:
|
|
1579
|
+
fixedItems.map(({ label, value: buttonValue, renderContent: Content5, showTooltip }) => /* @__PURE__ */ React30.createElement(
|
|
1461
1580
|
ConditionalTooltip,
|
|
1462
1581
|
{
|
|
1463
1582
|
key: buttonValue,
|
|
1464
1583
|
label,
|
|
1465
1584
|
showTooltip: showTooltip || false
|
|
1466
1585
|
},
|
|
1467
|
-
/* @__PURE__ */
|
|
1586
|
+
/* @__PURE__ */ React30.createElement(import_ui24.ToggleButton, { value: buttonValue, "aria-label": label, size, fullWidth }, /* @__PURE__ */ React30.createElement(Content5, { size }))
|
|
1468
1587
|
)),
|
|
1469
|
-
menuItems.length && exclusive && /* @__PURE__ */
|
|
1588
|
+
menuItems.length && exclusive && /* @__PURE__ */ React30.createElement(
|
|
1470
1589
|
SplitButtonGroup,
|
|
1471
1590
|
{
|
|
1472
1591
|
size,
|
|
@@ -1486,8 +1605,8 @@ var SplitButtonGroup = ({
|
|
|
1486
1605
|
value
|
|
1487
1606
|
}) => {
|
|
1488
1607
|
const previewButton = usePreviewButton(items, value);
|
|
1489
|
-
const [isMenuOpen, setIsMenuOpen] = (0,
|
|
1490
|
-
const menuButtonRef = (0,
|
|
1608
|
+
const [isMenuOpen, setIsMenuOpen] = (0, import_react17.useState)(false);
|
|
1609
|
+
const menuButtonRef = (0, import_react17.useRef)(null);
|
|
1491
1610
|
const onMenuToggle = (ev) => {
|
|
1492
1611
|
setIsMenuOpen((prev) => !prev);
|
|
1493
1612
|
ev.preventDefault();
|
|
@@ -1500,8 +1619,8 @@ var SplitButtonGroup = ({
|
|
|
1500
1619
|
const shouldRemove = newValue === value;
|
|
1501
1620
|
onChange(shouldRemove ? null : newValue);
|
|
1502
1621
|
};
|
|
1503
|
-
return /* @__PURE__ */
|
|
1504
|
-
|
|
1622
|
+
return /* @__PURE__ */ React30.createElement(React30.Fragment, null, /* @__PURE__ */ React30.createElement(
|
|
1623
|
+
import_ui24.ToggleButton,
|
|
1505
1624
|
{
|
|
1506
1625
|
value: previewButton.value,
|
|
1507
1626
|
"aria-label": previewButton.label,
|
|
@@ -1514,8 +1633,8 @@ var SplitButtonGroup = ({
|
|
|
1514
1633
|
ref: menuButtonRef
|
|
1515
1634
|
},
|
|
1516
1635
|
previewButton.renderContent({ size })
|
|
1517
|
-
), /* @__PURE__ */
|
|
1518
|
-
|
|
1636
|
+
), /* @__PURE__ */ React30.createElement(
|
|
1637
|
+
import_ui24.ToggleButton,
|
|
1519
1638
|
{
|
|
1520
1639
|
size,
|
|
1521
1640
|
"aria-expanded": isMenuOpen ? "true" : void 0,
|
|
@@ -1525,9 +1644,9 @@ var SplitButtonGroup = ({
|
|
|
1525
1644
|
ref: menuButtonRef,
|
|
1526
1645
|
value: "__chevron-icon-button__"
|
|
1527
1646
|
},
|
|
1528
|
-
/* @__PURE__ */
|
|
1529
|
-
), /* @__PURE__ */
|
|
1530
|
-
|
|
1647
|
+
/* @__PURE__ */ React30.createElement(import_icons5.ChevronDownIcon, { fontSize: size })
|
|
1648
|
+
), /* @__PURE__ */ React30.createElement(
|
|
1649
|
+
import_ui24.Menu,
|
|
1531
1650
|
{
|
|
1532
1651
|
open: isMenuOpen,
|
|
1533
1652
|
onClose: () => setIsMenuOpen(false),
|
|
@@ -1544,22 +1663,22 @@ var SplitButtonGroup = ({
|
|
|
1544
1663
|
mt: 0.5
|
|
1545
1664
|
}
|
|
1546
1665
|
},
|
|
1547
|
-
items.map(({ label, value: buttonValue }) => /* @__PURE__ */
|
|
1548
|
-
|
|
1666
|
+
items.map(({ label, value: buttonValue }) => /* @__PURE__ */ React30.createElement(
|
|
1667
|
+
import_ui24.MenuItem,
|
|
1549
1668
|
{
|
|
1550
1669
|
key: buttonValue,
|
|
1551
1670
|
selected: buttonValue === value,
|
|
1552
1671
|
onClick: () => onMenuItemClick(buttonValue)
|
|
1553
1672
|
},
|
|
1554
|
-
/* @__PURE__ */
|
|
1673
|
+
/* @__PURE__ */ React30.createElement(import_ui24.ListItemText, null, /* @__PURE__ */ React30.createElement(import_ui24.Typography, { sx: { fontSize: "14px" } }, label))
|
|
1555
1674
|
))
|
|
1556
1675
|
));
|
|
1557
1676
|
};
|
|
1558
1677
|
var usePreviewButton = (items, value) => {
|
|
1559
|
-
const [previewButton, setPreviewButton] = (0,
|
|
1678
|
+
const [previewButton, setPreviewButton] = (0, import_react17.useState)(
|
|
1560
1679
|
items.find((item) => item.value === value) ?? items[0]
|
|
1561
1680
|
);
|
|
1562
|
-
(0,
|
|
1681
|
+
(0, import_react17.useEffect)(() => {
|
|
1563
1682
|
const selectedButton = items.find((item) => item.value === value);
|
|
1564
1683
|
if (selectedButton) {
|
|
1565
1684
|
setPreviewButton(selectedButton);
|
|
@@ -1577,7 +1696,7 @@ var ToggleControl = createControl(
|
|
|
1577
1696
|
exclusive = true,
|
|
1578
1697
|
maxItems
|
|
1579
1698
|
}) => {
|
|
1580
|
-
const { value, setValue, placeholder, disabled } = useBoundProp(
|
|
1699
|
+
const { value, setValue, placeholder, disabled } = useBoundProp(import_editor_props11.stringPropTypeUtil);
|
|
1581
1700
|
const exclusiveValues = options.filter((option) => option.exclusive).map((option) => option.value);
|
|
1582
1701
|
const handleNonExclusiveToggle = (selectedValues) => {
|
|
1583
1702
|
const newSelectedValue = selectedValues[selectedValues.length - 1];
|
|
@@ -1591,7 +1710,7 @@ var ToggleControl = createControl(
|
|
|
1591
1710
|
fullWidth,
|
|
1592
1711
|
size
|
|
1593
1712
|
};
|
|
1594
|
-
return exclusive ? /* @__PURE__ */
|
|
1713
|
+
return exclusive ? /* @__PURE__ */ React31.createElement(
|
|
1595
1714
|
ControlToggleButtonGroup,
|
|
1596
1715
|
{
|
|
1597
1716
|
...toggleButtonGroupProps,
|
|
@@ -1600,7 +1719,7 @@ var ToggleControl = createControl(
|
|
|
1600
1719
|
disabled,
|
|
1601
1720
|
exclusive: true
|
|
1602
1721
|
}
|
|
1603
|
-
) : /* @__PURE__ */
|
|
1722
|
+
) : /* @__PURE__ */ React31.createElement(
|
|
1604
1723
|
ControlToggleButtonGroup,
|
|
1605
1724
|
{
|
|
1606
1725
|
...toggleButtonGroupProps,
|
|
@@ -1614,20 +1733,20 @@ var ToggleControl = createControl(
|
|
|
1614
1733
|
);
|
|
1615
1734
|
|
|
1616
1735
|
// src/controls/number-control.tsx
|
|
1617
|
-
var
|
|
1618
|
-
var
|
|
1619
|
-
var
|
|
1736
|
+
var React32 = __toESM(require("react"));
|
|
1737
|
+
var import_editor_props12 = require("@elementor/editor-props");
|
|
1738
|
+
var import_ui25 = require("@elementor/ui");
|
|
1620
1739
|
var isEmptyOrNaN = (value) => value === null || value === void 0 || value === "" || Number.isNaN(Number(value));
|
|
1621
1740
|
var RESTRICTED_INPUT_KEYS2 = ["e", "E", "+", "-"];
|
|
1622
1741
|
var NumberControl = createControl(
|
|
1623
1742
|
({
|
|
1624
|
-
placeholder,
|
|
1743
|
+
placeholder: labelPlaceholder,
|
|
1625
1744
|
max = Number.MAX_VALUE,
|
|
1626
1745
|
min = -Number.MAX_VALUE,
|
|
1627
1746
|
step = 1,
|
|
1628
1747
|
shouldForceInt = false
|
|
1629
1748
|
}) => {
|
|
1630
|
-
const { value, setValue, disabled } = useBoundProp(
|
|
1749
|
+
const { value, setValue, placeholder, disabled } = useBoundProp(import_editor_props12.numberPropTypeUtil);
|
|
1631
1750
|
const handleChange = (event) => {
|
|
1632
1751
|
const eventValue = event.target.value;
|
|
1633
1752
|
if (isEmptyOrNaN(eventValue)) {
|
|
@@ -1637,8 +1756,8 @@ var NumberControl = createControl(
|
|
|
1637
1756
|
const formattedValue = shouldForceInt ? +parseInt(eventValue) : Number(eventValue);
|
|
1638
1757
|
setValue(Math.min(Math.max(formattedValue, min), max));
|
|
1639
1758
|
};
|
|
1640
|
-
return /* @__PURE__ */
|
|
1641
|
-
|
|
1759
|
+
return /* @__PURE__ */ React32.createElement(ControlActions, null, /* @__PURE__ */ React32.createElement(
|
|
1760
|
+
import_ui25.TextField,
|
|
1642
1761
|
{
|
|
1643
1762
|
size: "tiny",
|
|
1644
1763
|
type: "number",
|
|
@@ -1646,7 +1765,7 @@ var NumberControl = createControl(
|
|
|
1646
1765
|
disabled,
|
|
1647
1766
|
value: isEmptyOrNaN(value) ? "" : value,
|
|
1648
1767
|
onChange: handleChange,
|
|
1649
|
-
placeholder,
|
|
1768
|
+
placeholder: labelPlaceholder ?? (placeholder ? String(placeholder) : ""),
|
|
1650
1769
|
inputProps: { step },
|
|
1651
1770
|
onKeyDown: (event) => {
|
|
1652
1771
|
if (RESTRICTED_INPUT_KEYS2.includes(event.key)) {
|
|
@@ -1659,21 +1778,12 @@ var NumberControl = createControl(
|
|
|
1659
1778
|
);
|
|
1660
1779
|
|
|
1661
1780
|
// src/controls/equal-unequal-sizes-control.tsx
|
|
1662
|
-
var
|
|
1663
|
-
var
|
|
1664
|
-
var
|
|
1781
|
+
var React33 = __toESM(require("react"));
|
|
1782
|
+
var import_react18 = require("react");
|
|
1783
|
+
var import_editor_props13 = require("@elementor/editor-props");
|
|
1665
1784
|
var import_editor_v1_adapters2 = require("@elementor/editor-v1-adapters");
|
|
1666
|
-
var
|
|
1785
|
+
var import_ui26 = require("@elementor/ui");
|
|
1667
1786
|
var import_i18n6 = require("@wordpress/i18n");
|
|
1668
|
-
|
|
1669
|
-
// src/components/control-label.tsx
|
|
1670
|
-
var React31 = __toESM(require("react"));
|
|
1671
|
-
var import_ui24 = require("@elementor/ui");
|
|
1672
|
-
var ControlLabel = ({ children }) => {
|
|
1673
|
-
return /* @__PURE__ */ React31.createElement(import_ui24.Stack, { direction: "row", alignItems: "center", justifyItems: "start", gap: 0.25 }, /* @__PURE__ */ React31.createElement(ControlFormLabel, null, children), /* @__PURE__ */ React31.createElement(ControlAdornments, null));
|
|
1674
|
-
};
|
|
1675
|
-
|
|
1676
|
-
// src/controls/equal-unequal-sizes-control.tsx
|
|
1677
1787
|
var isEqualSizes = (propValue, items) => {
|
|
1678
1788
|
const values = Object.values(propValue);
|
|
1679
1789
|
if (values.length !== items.length) {
|
|
@@ -1691,22 +1801,22 @@ function EqualUnequalSizesControl({
|
|
|
1691
1801
|
items,
|
|
1692
1802
|
multiSizePropTypeUtil
|
|
1693
1803
|
}) {
|
|
1694
|
-
const popupId = (0,
|
|
1695
|
-
const popupState = (0,
|
|
1804
|
+
const popupId = (0, import_react18.useId)();
|
|
1805
|
+
const popupState = (0, import_ui26.usePopupState)({ variant: "popover", popupId });
|
|
1696
1806
|
const {
|
|
1697
1807
|
propType: multiSizePropType,
|
|
1698
1808
|
value: multiSizeValue,
|
|
1699
1809
|
setValue: setMultiSizeValue,
|
|
1700
1810
|
disabled: multiSizeDisabled
|
|
1701
1811
|
} = useBoundProp(multiSizePropTypeUtil);
|
|
1702
|
-
const { value: sizeValue, setValue: setSizeValue } = useBoundProp(
|
|
1703
|
-
const rowRefs = [(0,
|
|
1812
|
+
const { value: sizeValue, setValue: setSizeValue } = useBoundProp(import_editor_props13.sizePropTypeUtil);
|
|
1813
|
+
const rowRefs = [(0, import_react18.useRef)(null), (0, import_react18.useRef)(null)];
|
|
1704
1814
|
const splitEqualValue = () => {
|
|
1705
1815
|
if (!sizeValue) {
|
|
1706
1816
|
return null;
|
|
1707
1817
|
}
|
|
1708
1818
|
return items.reduce(
|
|
1709
|
-
(acc, { bind }) => ({ ...acc, [bind]:
|
|
1819
|
+
(acc, { bind }) => ({ ...acc, [bind]: import_editor_props13.sizePropTypeUtil.create(sizeValue) }),
|
|
1710
1820
|
{}
|
|
1711
1821
|
);
|
|
1712
1822
|
};
|
|
@@ -1729,25 +1839,25 @@ function EqualUnequalSizesControl({
|
|
|
1729
1839
|
};
|
|
1730
1840
|
const isShowingGeneralIndicator = !(0, import_editor_v1_adapters2.isExperimentActive)("e_v_3_30") || !popupState.isOpen;
|
|
1731
1841
|
const isMixed = !!multiSizeValue;
|
|
1732
|
-
return /* @__PURE__ */
|
|
1842
|
+
return /* @__PURE__ */ React33.createElement(React33.Fragment, null, /* @__PURE__ */ React33.createElement(import_ui26.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap", ref: rowRefs[0] }, /* @__PURE__ */ React33.createElement(import_ui26.Grid, { item: true, xs: 6 }, !isShowingGeneralIndicator ? /* @__PURE__ */ React33.createElement(ControlFormLabel, null, label) : /* @__PURE__ */ React33.createElement(ControlLabel, null, label)), /* @__PURE__ */ React33.createElement(import_ui26.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React33.createElement(import_ui26.Stack, { direction: "row", alignItems: "center", gap: 1 }, /* @__PURE__ */ React33.createElement(
|
|
1733
1843
|
SizeControl,
|
|
1734
1844
|
{
|
|
1735
1845
|
placeholder: isMixed ? (0, import_i18n6.__)("Mixed", "elementor") : void 0,
|
|
1736
1846
|
anchorRef: rowRefs[0]
|
|
1737
1847
|
}
|
|
1738
|
-
), /* @__PURE__ */
|
|
1739
|
-
|
|
1848
|
+
), /* @__PURE__ */ React33.createElement(import_ui26.Tooltip, { title: tooltipLabel, placement: "top" }, /* @__PURE__ */ React33.createElement(
|
|
1849
|
+
import_ui26.ToggleButton,
|
|
1740
1850
|
{
|
|
1741
1851
|
size: "tiny",
|
|
1742
1852
|
value: "check",
|
|
1743
1853
|
sx: { marginLeft: "auto" },
|
|
1744
|
-
...(0,
|
|
1854
|
+
...(0, import_ui26.bindToggle)(popupState),
|
|
1745
1855
|
selected: popupState.isOpen,
|
|
1746
1856
|
"aria-label": tooltipLabel
|
|
1747
1857
|
},
|
|
1748
1858
|
icon
|
|
1749
|
-
))))), /* @__PURE__ */
|
|
1750
|
-
|
|
1859
|
+
))))), /* @__PURE__ */ React33.createElement(
|
|
1860
|
+
import_ui26.Popover,
|
|
1751
1861
|
{
|
|
1752
1862
|
disablePortal: true,
|
|
1753
1863
|
disableScrollLock: true,
|
|
@@ -1759,12 +1869,12 @@ function EqualUnequalSizesControl({
|
|
|
1759
1869
|
vertical: "top",
|
|
1760
1870
|
horizontal: "right"
|
|
1761
1871
|
},
|
|
1762
|
-
...(0,
|
|
1872
|
+
...(0, import_ui26.bindPopover)(popupState),
|
|
1763
1873
|
slotProps: {
|
|
1764
1874
|
paper: { sx: { mt: 0.5, width: rowRefs[0].current?.getBoundingClientRect().width } }
|
|
1765
1875
|
}
|
|
1766
1876
|
},
|
|
1767
|
-
/* @__PURE__ */
|
|
1877
|
+
/* @__PURE__ */ React33.createElement(
|
|
1768
1878
|
PropProvider,
|
|
1769
1879
|
{
|
|
1770
1880
|
propType: multiSizePropType,
|
|
@@ -1772,25 +1882,22 @@ function EqualUnequalSizesControl({
|
|
|
1772
1882
|
setValue: setNestedProp,
|
|
1773
1883
|
disabled: multiSizeDisabled
|
|
1774
1884
|
},
|
|
1775
|
-
/* @__PURE__ */
|
|
1885
|
+
/* @__PURE__ */ React33.createElement(PopoverContent, { p: 1.5 }, /* @__PURE__ */ React33.createElement(PopoverGridContainer, { ref: rowRefs[1] }, /* @__PURE__ */ React33.createElement(MultiSizeValueControl, { item: items[0], rowRef: rowRefs[1] }), /* @__PURE__ */ React33.createElement(MultiSizeValueControl, { item: items[1], rowRef: rowRefs[1] })), /* @__PURE__ */ React33.createElement(PopoverGridContainer, { ref: rowRefs[2] }, /* @__PURE__ */ React33.createElement(MultiSizeValueControl, { item: items[2], rowRef: rowRefs[2] }), /* @__PURE__ */ React33.createElement(MultiSizeValueControl, { item: items[3], rowRef: rowRefs[2] })))
|
|
1776
1886
|
)
|
|
1777
1887
|
));
|
|
1778
1888
|
}
|
|
1779
|
-
var MultiSizeValueControl = ({
|
|
1780
|
-
item,
|
|
1781
|
-
rowRef
|
|
1782
|
-
}) => {
|
|
1889
|
+
var MultiSizeValueControl = ({ item, rowRef }) => {
|
|
1783
1890
|
const isUsingNestedProps = (0, import_editor_v1_adapters2.isExperimentActive)("e_v_3_30");
|
|
1784
|
-
return /* @__PURE__ */
|
|
1891
|
+
return /* @__PURE__ */ React33.createElement(PropKeyProvider, { bind: item.bind }, /* @__PURE__ */ React33.createElement(import_ui26.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React33.createElement(import_ui26.Grid, { container: true, gap: 0.75, alignItems: "center" }, /* @__PURE__ */ React33.createElement(import_ui26.Grid, { item: true, xs: 12 }, isUsingNestedProps ? /* @__PURE__ */ React33.createElement(ControlLabel, null, item.label) : /* @__PURE__ */ React33.createElement(ControlFormLabel, null, item.label)), /* @__PURE__ */ React33.createElement(import_ui26.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React33.createElement(SizeControl, { startIcon: item.icon, anchorRef: rowRef })))));
|
|
1785
1892
|
};
|
|
1786
1893
|
|
|
1787
1894
|
// src/controls/linked-dimensions-control.tsx
|
|
1788
|
-
var
|
|
1789
|
-
var
|
|
1790
|
-
var
|
|
1895
|
+
var React34 = __toESM(require("react"));
|
|
1896
|
+
var import_react19 = require("react");
|
|
1897
|
+
var import_editor_props14 = require("@elementor/editor-props");
|
|
1791
1898
|
var import_editor_v1_adapters3 = require("@elementor/editor-v1-adapters");
|
|
1792
1899
|
var import_icons6 = require("@elementor/icons");
|
|
1793
|
-
var
|
|
1900
|
+
var import_ui27 = require("@elementor/ui");
|
|
1794
1901
|
var import_i18n7 = require("@wordpress/i18n");
|
|
1795
1902
|
var LinkedDimensionsControl = createControl(
|
|
1796
1903
|
({
|
|
@@ -1798,14 +1905,14 @@ var LinkedDimensionsControl = createControl(
|
|
|
1798
1905
|
isSiteRtl = false,
|
|
1799
1906
|
extendedOptions
|
|
1800
1907
|
}) => {
|
|
1801
|
-
const { value: sizeValue, setValue: setSizeValue, disabled: sizeDisabled } = useBoundProp(
|
|
1802
|
-
const gridRowRefs = [(0,
|
|
1908
|
+
const { value: sizeValue, setValue: setSizeValue, disabled: sizeDisabled } = useBoundProp(import_editor_props14.sizePropTypeUtil);
|
|
1909
|
+
const gridRowRefs = [(0, import_react19.useRef)(null), (0, import_react19.useRef)(null)];
|
|
1803
1910
|
const {
|
|
1804
1911
|
value: dimensionsValue,
|
|
1805
1912
|
setValue: setDimensionsValue,
|
|
1806
1913
|
propType,
|
|
1807
1914
|
disabled: dimensionsDisabled
|
|
1808
|
-
} = useBoundProp(
|
|
1915
|
+
} = useBoundProp(import_editor_props14.dimensionsPropTypeUtil);
|
|
1809
1916
|
const isLinked = !dimensionsValue && !sizeValue ? true : !!sizeValue;
|
|
1810
1917
|
const isUsingNestedProps = (0, import_editor_v1_adapters3.isExperimentActive)("e_v_3_30");
|
|
1811
1918
|
const onLinkToggle = () => {
|
|
@@ -1813,7 +1920,7 @@ var LinkedDimensionsControl = createControl(
|
|
|
1813
1920
|
setSizeValue(dimensionsValue["block-start"]?.value ?? null);
|
|
1814
1921
|
return;
|
|
1815
1922
|
}
|
|
1816
|
-
const value = sizeValue ?
|
|
1923
|
+
const value = sizeValue ? import_editor_props14.sizePropTypeUtil.create(sizeValue) : null;
|
|
1817
1924
|
setDimensionsValue({
|
|
1818
1925
|
"block-start": value,
|
|
1819
1926
|
"block-end": value,
|
|
@@ -1826,7 +1933,7 @@ var LinkedDimensionsControl = createControl(
|
|
|
1826
1933
|
const linkedLabel = (0, import_i18n7.__)("Link %s", "elementor").replace("%s", tooltipLabel);
|
|
1827
1934
|
const unlinkedLabel = (0, import_i18n7.__)("Unlink %s", "elementor").replace("%s", tooltipLabel);
|
|
1828
1935
|
const disabled = sizeDisabled || dimensionsDisabled;
|
|
1829
|
-
return /* @__PURE__ */
|
|
1936
|
+
return /* @__PURE__ */ React34.createElement(
|
|
1830
1937
|
PropProvider,
|
|
1831
1938
|
{
|
|
1832
1939
|
propType,
|
|
@@ -1834,8 +1941,8 @@ var LinkedDimensionsControl = createControl(
|
|
|
1834
1941
|
setValue: setDimensionsValue,
|
|
1835
1942
|
disabled
|
|
1836
1943
|
},
|
|
1837
|
-
/* @__PURE__ */
|
|
1838
|
-
|
|
1944
|
+
/* @__PURE__ */ React34.createElement(import_ui27.Stack, { direction: "row", gap: 2, flexWrap: "nowrap" }, isUsingNestedProps ? /* @__PURE__ */ React34.createElement(ControlFormLabel, null, label) : /* @__PURE__ */ React34.createElement(ControlLabel, null, label), /* @__PURE__ */ React34.createElement(import_ui27.Tooltip, { title: isLinked ? unlinkedLabel : linkedLabel, placement: "top" }, /* @__PURE__ */ React34.createElement(
|
|
1945
|
+
import_ui27.ToggleButton,
|
|
1839
1946
|
{
|
|
1840
1947
|
"aria-label": isLinked ? unlinkedLabel : linkedLabel,
|
|
1841
1948
|
size: "tiny",
|
|
@@ -1845,9 +1952,9 @@ var LinkedDimensionsControl = createControl(
|
|
|
1845
1952
|
onChange: onLinkToggle,
|
|
1846
1953
|
disabled
|
|
1847
1954
|
},
|
|
1848
|
-
/* @__PURE__ */
|
|
1955
|
+
/* @__PURE__ */ React34.createElement(LinkedIcon, { fontSize: "tiny" })
|
|
1849
1956
|
))),
|
|
1850
|
-
getCssMarginProps(isSiteRtl).map((row, index) => /* @__PURE__ */
|
|
1957
|
+
getCssMarginProps(isSiteRtl).map((row, index) => /* @__PURE__ */ React34.createElement(import_ui27.Stack, { direction: "row", gap: 2, flexWrap: "nowrap", key: index, ref: gridRowRefs[index] }, row.map(({ icon, ...props }) => /* @__PURE__ */ React34.createElement(import_ui27.Grid, { container: true, gap: 0.75, alignItems: "center", key: props.bind }, /* @__PURE__ */ React34.createElement(import_ui27.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React34.createElement(Label, { ...props })), /* @__PURE__ */ React34.createElement(import_ui27.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React34.createElement(
|
|
1851
1958
|
Control3,
|
|
1852
1959
|
{
|
|
1853
1960
|
bind: props.bind,
|
|
@@ -1868,16 +1975,16 @@ var Control3 = ({
|
|
|
1868
1975
|
anchorRef
|
|
1869
1976
|
}) => {
|
|
1870
1977
|
if (isLinked) {
|
|
1871
|
-
return /* @__PURE__ */
|
|
1978
|
+
return /* @__PURE__ */ React34.createElement(SizeControl, { startIcon, extendedOptions, anchorRef });
|
|
1872
1979
|
}
|
|
1873
|
-
return /* @__PURE__ */
|
|
1980
|
+
return /* @__PURE__ */ React34.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React34.createElement(SizeControl, { startIcon, extendedOptions, anchorRef }));
|
|
1874
1981
|
};
|
|
1875
1982
|
var Label = ({ label, bind }) => {
|
|
1876
1983
|
const isUsingNestedProps = (0, import_editor_v1_adapters3.isExperimentActive)("e_v_3_30");
|
|
1877
1984
|
if (!isUsingNestedProps) {
|
|
1878
|
-
return /* @__PURE__ */
|
|
1985
|
+
return /* @__PURE__ */ React34.createElement(ControlFormLabel, null, label);
|
|
1879
1986
|
}
|
|
1880
|
-
return /* @__PURE__ */
|
|
1987
|
+
return /* @__PURE__ */ React34.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React34.createElement(ControlLabel, null, label));
|
|
1881
1988
|
};
|
|
1882
1989
|
function getCssMarginProps(isSiteRtl) {
|
|
1883
1990
|
return [
|
|
@@ -1885,43 +1992,42 @@ function getCssMarginProps(isSiteRtl) {
|
|
|
1885
1992
|
{
|
|
1886
1993
|
bind: "block-start",
|
|
1887
1994
|
label: (0, import_i18n7.__)("Top", "elementor"),
|
|
1888
|
-
icon: /* @__PURE__ */
|
|
1995
|
+
icon: /* @__PURE__ */ React34.createElement(import_icons6.SideTopIcon, { fontSize: "tiny" })
|
|
1889
1996
|
},
|
|
1890
1997
|
{
|
|
1891
1998
|
bind: "inline-end",
|
|
1892
1999
|
label: isSiteRtl ? (0, import_i18n7.__)("Left", "elementor") : (0, import_i18n7.__)("Right", "elementor"),
|
|
1893
|
-
icon: isSiteRtl ? /* @__PURE__ */
|
|
2000
|
+
icon: isSiteRtl ? /* @__PURE__ */ React34.createElement(import_icons6.SideLeftIcon, { fontSize: "tiny" }) : /* @__PURE__ */ React34.createElement(import_icons6.SideRightIcon, { fontSize: "tiny" })
|
|
1894
2001
|
}
|
|
1895
2002
|
],
|
|
1896
2003
|
[
|
|
1897
2004
|
{
|
|
1898
2005
|
bind: "block-end",
|
|
1899
2006
|
label: (0, import_i18n7.__)("Bottom", "elementor"),
|
|
1900
|
-
icon: /* @__PURE__ */
|
|
2007
|
+
icon: /* @__PURE__ */ React34.createElement(import_icons6.SideBottomIcon, { fontSize: "tiny" })
|
|
1901
2008
|
},
|
|
1902
2009
|
{
|
|
1903
2010
|
bind: "inline-start",
|
|
1904
2011
|
label: isSiteRtl ? (0, import_i18n7.__)("Right", "elementor") : (0, import_i18n7.__)("Left", "elementor"),
|
|
1905
|
-
icon: isSiteRtl ? /* @__PURE__ */
|
|
2012
|
+
icon: isSiteRtl ? /* @__PURE__ */ React34.createElement(import_icons6.SideRightIcon, { fontSize: "tiny" }) : /* @__PURE__ */ React34.createElement(import_icons6.SideLeftIcon, { fontSize: "tiny" })
|
|
1906
2013
|
}
|
|
1907
2014
|
]
|
|
1908
2015
|
];
|
|
1909
2016
|
}
|
|
1910
2017
|
|
|
1911
2018
|
// src/controls/font-family-control/font-family-control.tsx
|
|
1912
|
-
var
|
|
1913
|
-
var
|
|
2019
|
+
var React36 = __toESM(require("react"));
|
|
2020
|
+
var import_editor_props15 = require("@elementor/editor-props");
|
|
1914
2021
|
var import_icons8 = require("@elementor/icons");
|
|
1915
|
-
var
|
|
2022
|
+
var import_ui29 = require("@elementor/ui");
|
|
1916
2023
|
|
|
1917
2024
|
// src/components/font-family-selector.tsx
|
|
1918
|
-
var
|
|
1919
|
-
var
|
|
1920
|
-
var
|
|
2025
|
+
var React35 = __toESM(require("react"));
|
|
2026
|
+
var import_react20 = require("react");
|
|
2027
|
+
var import_editor_ui4 = require("@elementor/editor-ui");
|
|
1921
2028
|
var import_icons7 = require("@elementor/icons");
|
|
1922
|
-
var
|
|
2029
|
+
var import_ui28 = require("@elementor/ui");
|
|
1923
2030
|
var import_utils2 = require("@elementor/utils");
|
|
1924
|
-
var import_react_virtual = require("@tanstack/react-virtual");
|
|
1925
2031
|
var import_i18n8 = require("@wordpress/i18n");
|
|
1926
2032
|
|
|
1927
2033
|
// src/controls/font-family-control/enqueue-font.tsx
|
|
@@ -1952,38 +2058,33 @@ var FontFamilySelector = ({
|
|
|
1952
2058
|
fontFamilies,
|
|
1953
2059
|
fontFamily,
|
|
1954
2060
|
onFontFamilyChange,
|
|
1955
|
-
onClose
|
|
2061
|
+
onClose,
|
|
2062
|
+
sectionWidth
|
|
1956
2063
|
}) => {
|
|
1957
|
-
const [searchValue, setSearchValue] = (0,
|
|
2064
|
+
const [searchValue, setSearchValue] = (0, import_react20.useState)("");
|
|
1958
2065
|
const filteredFontFamilies = useFilteredFontFamilies(fontFamilies, searchValue);
|
|
1959
|
-
const handleSearch = (
|
|
1960
|
-
setSearchValue(
|
|
2066
|
+
const handleSearch = (value) => {
|
|
2067
|
+
setSearchValue(value);
|
|
1961
2068
|
};
|
|
1962
2069
|
const handleClose = () => {
|
|
1963
2070
|
setSearchValue("");
|
|
1964
2071
|
onClose();
|
|
1965
2072
|
};
|
|
1966
|
-
return /* @__PURE__ */
|
|
1967
|
-
|
|
2073
|
+
return /* @__PURE__ */ React35.createElement(import_ui28.Stack, null, /* @__PURE__ */ React35.createElement(
|
|
2074
|
+
import_editor_ui4.PopoverHeader,
|
|
1968
2075
|
{
|
|
1969
2076
|
title: (0, import_i18n8.__)("Font Family", "elementor"),
|
|
1970
2077
|
onClose: handleClose,
|
|
1971
|
-
icon: /* @__PURE__ */
|
|
2078
|
+
icon: /* @__PURE__ */ React35.createElement(import_icons7.TextIcon, { fontSize: SIZE2 })
|
|
1972
2079
|
}
|
|
1973
|
-
), /* @__PURE__ */
|
|
1974
|
-
|
|
2080
|
+
), /* @__PURE__ */ React35.createElement(
|
|
2081
|
+
import_editor_ui4.PopoverSearch,
|
|
1975
2082
|
{
|
|
1976
|
-
autoFocus: true,
|
|
1977
|
-
fullWidth: true,
|
|
1978
|
-
size: SIZE2,
|
|
1979
2083
|
value: searchValue,
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
InputProps: {
|
|
1983
|
-
startAdornment: /* @__PURE__ */ React34.createElement(import_ui27.InputAdornment, { position: "start" }, /* @__PURE__ */ React34.createElement(import_icons7.SearchIcon, { fontSize: SIZE2 }))
|
|
1984
|
-
}
|
|
2084
|
+
onSearch: handleSearch,
|
|
2085
|
+
placeholder: (0, import_i18n8.__)("Search", "elementor")
|
|
1985
2086
|
}
|
|
1986
|
-
)
|
|
2087
|
+
), /* @__PURE__ */ React35.createElement(import_ui28.Divider, null), /* @__PURE__ */ React35.createElement(import_editor_ui4.PopoverScrollableContent, { width: sectionWidth }, filteredFontFamilies.length > 0 ? /* @__PURE__ */ React35.createElement(
|
|
1987
2088
|
FontList,
|
|
1988
2089
|
{
|
|
1989
2090
|
fontListItems: filteredFontFamilies,
|
|
@@ -1991,35 +2092,55 @@ var FontFamilySelector = ({
|
|
|
1991
2092
|
handleClose,
|
|
1992
2093
|
fontFamily
|
|
1993
2094
|
}
|
|
1994
|
-
) : /* @__PURE__ */
|
|
1995
|
-
|
|
2095
|
+
) : /* @__PURE__ */ React35.createElement(
|
|
2096
|
+
import_ui28.Stack,
|
|
1996
2097
|
{
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
}
|
|
2004
|
-
},
|
|
2005
|
-
/* @__PURE__ */ React34.createElement("span", null, "\u201C"),
|
|
2006
|
-
/* @__PURE__ */ React34.createElement("span", { style: { maxWidth: "80%", overflow: "hidden", textOverflow: "ellipsis" } }, searchValue),
|
|
2007
|
-
/* @__PURE__ */ React34.createElement("span", null, "\u201D.")
|
|
2008
|
-
)), /* @__PURE__ */ React34.createElement(import_ui27.Typography, { align: "center", variant: "caption", color: "text.secondary" }, (0, import_i18n8.__)("Try something else.", "elementor"), /* @__PURE__ */ React34.createElement(
|
|
2009
|
-
import_ui27.Link,
|
|
2010
|
-
{
|
|
2011
|
-
color: "secondary",
|
|
2012
|
-
variant: "caption",
|
|
2013
|
-
component: "button",
|
|
2014
|
-
onClick: () => setSearchValue("")
|
|
2098
|
+
alignItems: "center",
|
|
2099
|
+
justifyContent: "center",
|
|
2100
|
+
height: "100%",
|
|
2101
|
+
p: 2.5,
|
|
2102
|
+
gap: 1.5,
|
|
2103
|
+
overflow: "hidden"
|
|
2015
2104
|
},
|
|
2016
|
-
|
|
2017
|
-
|
|
2105
|
+
/* @__PURE__ */ React35.createElement(import_icons7.TextIcon, { fontSize: "large" }),
|
|
2106
|
+
/* @__PURE__ */ React35.createElement(import_ui28.Box, { sx: { maxWidth: 160, overflow: "hidden" } }, /* @__PURE__ */ React35.createElement(import_ui28.Typography, { align: "center", variant: "subtitle2", color: "text.secondary" }, (0, import_i18n8.__)("Sorry, nothing matched", "elementor")), /* @__PURE__ */ React35.createElement(
|
|
2107
|
+
import_ui28.Typography,
|
|
2108
|
+
{
|
|
2109
|
+
variant: "subtitle2",
|
|
2110
|
+
color: "text.secondary",
|
|
2111
|
+
sx: {
|
|
2112
|
+
display: "flex",
|
|
2113
|
+
width: "100%",
|
|
2114
|
+
justifyContent: "center"
|
|
2115
|
+
}
|
|
2116
|
+
},
|
|
2117
|
+
/* @__PURE__ */ React35.createElement("span", null, "\u201C"),
|
|
2118
|
+
/* @__PURE__ */ React35.createElement("span", { style: { maxWidth: "80%", overflow: "hidden", textOverflow: "ellipsis" } }, searchValue),
|
|
2119
|
+
/* @__PURE__ */ React35.createElement("span", null, "\u201D.")
|
|
2120
|
+
)),
|
|
2121
|
+
/* @__PURE__ */ React35.createElement(
|
|
2122
|
+
import_ui28.Typography,
|
|
2123
|
+
{
|
|
2124
|
+
align: "center",
|
|
2125
|
+
variant: "caption",
|
|
2126
|
+
color: "text.secondary",
|
|
2127
|
+
sx: { display: "flex", flexDirection: "column" }
|
|
2128
|
+
},
|
|
2129
|
+
(0, import_i18n8.__)("Try something else.", "elementor"),
|
|
2130
|
+
/* @__PURE__ */ React35.createElement(
|
|
2131
|
+
import_ui28.Link,
|
|
2132
|
+
{
|
|
2133
|
+
color: "secondary",
|
|
2134
|
+
variant: "caption",
|
|
2135
|
+
component: "button",
|
|
2136
|
+
onClick: () => setSearchValue("")
|
|
2137
|
+
},
|
|
2138
|
+
(0, import_i18n8.__)("Clear & try again", "elementor")
|
|
2139
|
+
)
|
|
2140
|
+
)
|
|
2141
|
+
)));
|
|
2018
2142
|
};
|
|
2019
|
-
var LIST_ITEM_HEIGHT = 36;
|
|
2020
|
-
var LIST_ITEMS_BUFFER = 6;
|
|
2021
2143
|
var FontList = ({ fontListItems, setFontFamily, handleClose, fontFamily }) => {
|
|
2022
|
-
const containerRef = (0, import_react19.useRef)(null);
|
|
2023
2144
|
const selectedItem = fontListItems.find((item) => item.value === fontFamily);
|
|
2024
2145
|
const debouncedVirtualizeChange = useDebounce(({ getVirtualIndexes }) => {
|
|
2025
2146
|
getVirtualIndexes().forEach((index) => {
|
|
@@ -2029,170 +2150,72 @@ var FontList = ({ fontListItems, setFontFamily, handleClose, fontFamily }) => {
|
|
|
2029
2150
|
}
|
|
2030
2151
|
});
|
|
2031
2152
|
}, 100);
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
getScrollElement: () => containerRef.current,
|
|
2035
|
-
estimateSize: () => LIST_ITEM_HEIGHT,
|
|
2036
|
-
overscan: LIST_ITEMS_BUFFER,
|
|
2037
|
-
onChange: debouncedVirtualizeChange
|
|
2038
|
-
});
|
|
2039
|
-
(0, import_react19.useEffect)(
|
|
2040
|
-
() => {
|
|
2041
|
-
virtualizer.scrollToIndex(fontListItems.findIndex((item) => item.value === fontFamily));
|
|
2042
|
-
},
|
|
2043
|
-
// eslint-disable-next-line react-compiler/react-compiler
|
|
2044
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
2045
|
-
[fontFamily]
|
|
2046
|
-
);
|
|
2047
|
-
return /* @__PURE__ */ React34.createElement(
|
|
2048
|
-
import_ui27.Box,
|
|
2153
|
+
return /* @__PURE__ */ React35.createElement(
|
|
2154
|
+
import_editor_ui4.PopoverMenuList,
|
|
2049
2155
|
{
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
}
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
StyledMenuList,
|
|
2059
|
-
{
|
|
2060
|
-
role: "listbox",
|
|
2061
|
-
style: {
|
|
2062
|
-
height: `${virtualizer.getTotalSize()}px`
|
|
2063
|
-
},
|
|
2064
|
-
"data-testid": "font-list"
|
|
2065
|
-
},
|
|
2066
|
-
virtualizer.getVirtualItems().map((virtualRow) => {
|
|
2067
|
-
const item = fontListItems[virtualRow.index];
|
|
2068
|
-
const isLast = virtualRow.index === fontListItems.length - 1;
|
|
2069
|
-
const isFirst = virtualRow.index === 1;
|
|
2070
|
-
const isSelected = selectedItem?.value === item.value;
|
|
2071
|
-
const tabIndexFallback = !selectedItem ? 0 : -1;
|
|
2072
|
-
if (item.type === "category") {
|
|
2073
|
-
return /* @__PURE__ */ React34.createElement(
|
|
2074
|
-
import_ui27.MenuSubheader,
|
|
2075
|
-
{
|
|
2076
|
-
key: virtualRow.key,
|
|
2077
|
-
style: {
|
|
2078
|
-
transform: `translateY(${virtualRow.start}px)`
|
|
2079
|
-
}
|
|
2080
|
-
},
|
|
2081
|
-
item.value
|
|
2082
|
-
);
|
|
2083
|
-
}
|
|
2084
|
-
return /* @__PURE__ */ React34.createElement(
|
|
2085
|
-
"li",
|
|
2086
|
-
{
|
|
2087
|
-
key: virtualRow.key,
|
|
2088
|
-
role: "option",
|
|
2089
|
-
"aria-selected": isSelected,
|
|
2090
|
-
onClick: () => {
|
|
2091
|
-
setFontFamily(item.value);
|
|
2092
|
-
handleClose();
|
|
2093
|
-
},
|
|
2094
|
-
onKeyDown: (event) => {
|
|
2095
|
-
if (event.key === "Enter") {
|
|
2096
|
-
setFontFamily(item.value);
|
|
2097
|
-
handleClose();
|
|
2098
|
-
}
|
|
2099
|
-
if (event.key === "ArrowDown" && isLast) {
|
|
2100
|
-
event.preventDefault();
|
|
2101
|
-
event.stopPropagation();
|
|
2102
|
-
}
|
|
2103
|
-
if (event.key === "ArrowUp" && isFirst) {
|
|
2104
|
-
event.preventDefault();
|
|
2105
|
-
event.stopPropagation();
|
|
2106
|
-
}
|
|
2107
|
-
},
|
|
2108
|
-
tabIndex: isSelected ? 0 : tabIndexFallback,
|
|
2109
|
-
style: {
|
|
2110
|
-
transform: `translateY(${virtualRow.start}px)`,
|
|
2111
|
-
fontFamily: item.value
|
|
2112
|
-
}
|
|
2113
|
-
},
|
|
2114
|
-
item.value
|
|
2115
|
-
);
|
|
2116
|
-
})
|
|
2117
|
-
)
|
|
2156
|
+
items: fontListItems,
|
|
2157
|
+
selectedValue: selectedItem?.value,
|
|
2158
|
+
onChange: debouncedVirtualizeChange,
|
|
2159
|
+
onSelect: setFontFamily,
|
|
2160
|
+
onClose: handleClose,
|
|
2161
|
+
itemStyle: (item) => ({ fontFamily: item.value }),
|
|
2162
|
+
"data-testid": "font-list"
|
|
2163
|
+
}
|
|
2118
2164
|
);
|
|
2119
2165
|
};
|
|
2120
|
-
var StyledMenuList = (0, import_ui27.styled)(import_ui27.MenuList)(({ theme }) => ({
|
|
2121
|
-
"& > li": {
|
|
2122
|
-
height: LIST_ITEM_HEIGHT,
|
|
2123
|
-
position: "absolute",
|
|
2124
|
-
top: 0,
|
|
2125
|
-
left: 0,
|
|
2126
|
-
width: "100%",
|
|
2127
|
-
display: "flex",
|
|
2128
|
-
alignItems: "center"
|
|
2129
|
-
},
|
|
2130
|
-
'& > [role="option"]': {
|
|
2131
|
-
...theme.typography.caption,
|
|
2132
|
-
lineHeight: "inherit",
|
|
2133
|
-
padding: theme.spacing(0.75, 2, 0.75, 4),
|
|
2134
|
-
"&:hover, &:focus": {
|
|
2135
|
-
backgroundColor: theme.palette.action.hover
|
|
2136
|
-
},
|
|
2137
|
-
'&[aria-selected="true"]': {
|
|
2138
|
-
backgroundColor: theme.palette.action.selected
|
|
2139
|
-
},
|
|
2140
|
-
cursor: "pointer",
|
|
2141
|
-
textOverflow: "ellipsis"
|
|
2142
|
-
},
|
|
2143
|
-
width: "100%",
|
|
2144
|
-
position: "relative"
|
|
2145
|
-
}));
|
|
2146
2166
|
var useDebounce = (fn, delay) => {
|
|
2147
|
-
const [debouncedFn] = (0,
|
|
2148
|
-
(0,
|
|
2167
|
+
const [debouncedFn] = (0, import_react20.useState)(() => (0, import_utils2.debounce)(fn, delay));
|
|
2168
|
+
(0, import_react20.useEffect)(() => () => debouncedFn.cancel(), [debouncedFn]);
|
|
2149
2169
|
return debouncedFn;
|
|
2150
2170
|
};
|
|
2151
2171
|
|
|
2152
2172
|
// src/controls/font-family-control/font-family-control.tsx
|
|
2153
2173
|
var SIZE3 = "tiny";
|
|
2154
|
-
var FontFamilyControl = createControl(({ fontFamilies }) => {
|
|
2155
|
-
const { value: fontFamily, setValue: setFontFamily, disabled } = useBoundProp(
|
|
2156
|
-
const popoverState = (0,
|
|
2157
|
-
return /* @__PURE__ */
|
|
2158
|
-
|
|
2174
|
+
var FontFamilyControl = createControl(({ fontFamilies, sectionWidth }) => {
|
|
2175
|
+
const { value: fontFamily, setValue: setFontFamily, disabled } = useBoundProp(import_editor_props15.stringPropTypeUtil);
|
|
2176
|
+
const popoverState = (0, import_ui29.usePopupState)({ variant: "popover" });
|
|
2177
|
+
return /* @__PURE__ */ React36.createElement(React36.Fragment, null, /* @__PURE__ */ React36.createElement(ControlActions, null, /* @__PURE__ */ React36.createElement(
|
|
2178
|
+
import_ui29.UnstableTag,
|
|
2159
2179
|
{
|
|
2160
2180
|
variant: "outlined",
|
|
2161
2181
|
label: fontFamily,
|
|
2162
|
-
endIcon: /* @__PURE__ */
|
|
2163
|
-
...(0,
|
|
2182
|
+
endIcon: /* @__PURE__ */ React36.createElement(import_icons8.ChevronDownIcon, { fontSize: SIZE3 }),
|
|
2183
|
+
...(0, import_ui29.bindTrigger)(popoverState),
|
|
2164
2184
|
fullWidth: true,
|
|
2165
2185
|
disabled
|
|
2166
2186
|
}
|
|
2167
|
-
)), /* @__PURE__ */
|
|
2168
|
-
|
|
2187
|
+
)), /* @__PURE__ */ React36.createElement(
|
|
2188
|
+
import_ui29.Popover,
|
|
2169
2189
|
{
|
|
2170
2190
|
disablePortal: true,
|
|
2171
2191
|
disableScrollLock: true,
|
|
2172
|
-
anchorOrigin: { vertical: "bottom", horizontal: "
|
|
2173
|
-
|
|
2192
|
+
anchorOrigin: { vertical: "bottom", horizontal: "right" },
|
|
2193
|
+
transformOrigin: { vertical: "top", horizontal: "right" },
|
|
2194
|
+
sx: { my: 1.5 },
|
|
2195
|
+
...(0, import_ui29.bindPopover)(popoverState)
|
|
2174
2196
|
},
|
|
2175
|
-
/* @__PURE__ */
|
|
2197
|
+
/* @__PURE__ */ React36.createElement(
|
|
2176
2198
|
FontFamilySelector,
|
|
2177
2199
|
{
|
|
2178
2200
|
fontFamilies,
|
|
2179
2201
|
fontFamily,
|
|
2180
2202
|
onFontFamilyChange: setFontFamily,
|
|
2181
|
-
onClose: popoverState.close
|
|
2203
|
+
onClose: popoverState.close,
|
|
2204
|
+
sectionWidth
|
|
2182
2205
|
}
|
|
2183
2206
|
)
|
|
2184
2207
|
));
|
|
2185
2208
|
});
|
|
2186
2209
|
|
|
2187
2210
|
// src/controls/url-control.tsx
|
|
2188
|
-
var
|
|
2189
|
-
var
|
|
2190
|
-
var
|
|
2211
|
+
var React37 = __toESM(require("react"));
|
|
2212
|
+
var import_editor_props16 = require("@elementor/editor-props");
|
|
2213
|
+
var import_ui30 = require("@elementor/ui");
|
|
2191
2214
|
var UrlControl = createControl(({ placeholder }) => {
|
|
2192
|
-
const { value, setValue, disabled } = useBoundProp(
|
|
2215
|
+
const { value, setValue, disabled } = useBoundProp(import_editor_props16.urlPropTypeUtil);
|
|
2193
2216
|
const handleChange = (event) => setValue(event.target.value);
|
|
2194
|
-
return /* @__PURE__ */
|
|
2195
|
-
|
|
2217
|
+
return /* @__PURE__ */ React37.createElement(ControlActions, null, /* @__PURE__ */ React37.createElement(
|
|
2218
|
+
import_ui30.TextField,
|
|
2196
2219
|
{
|
|
2197
2220
|
size: "tiny",
|
|
2198
2221
|
fullWidth: true,
|
|
@@ -2205,24 +2228,24 @@ var UrlControl = createControl(({ placeholder }) => {
|
|
|
2205
2228
|
});
|
|
2206
2229
|
|
|
2207
2230
|
// src/controls/link-control.tsx
|
|
2208
|
-
var
|
|
2209
|
-
var
|
|
2231
|
+
var React39 = __toESM(require("react"));
|
|
2232
|
+
var import_react22 = require("react");
|
|
2210
2233
|
var import_editor_elements = require("@elementor/editor-elements");
|
|
2211
|
-
var
|
|
2212
|
-
var
|
|
2234
|
+
var import_editor_props17 = require("@elementor/editor-props");
|
|
2235
|
+
var import_editor_ui5 = require("@elementor/editor-ui");
|
|
2213
2236
|
var import_http_client2 = require("@elementor/http-client");
|
|
2214
2237
|
var import_icons10 = require("@elementor/icons");
|
|
2215
2238
|
var import_session = require("@elementor/session");
|
|
2216
|
-
var
|
|
2239
|
+
var import_ui32 = require("@elementor/ui");
|
|
2217
2240
|
var import_utils3 = require("@elementor/utils");
|
|
2218
2241
|
var import_i18n9 = require("@wordpress/i18n");
|
|
2219
2242
|
|
|
2220
2243
|
// src/components/autocomplete.tsx
|
|
2221
|
-
var
|
|
2222
|
-
var
|
|
2244
|
+
var React38 = __toESM(require("react"));
|
|
2245
|
+
var import_react21 = require("react");
|
|
2223
2246
|
var import_icons9 = require("@elementor/icons");
|
|
2224
|
-
var
|
|
2225
|
-
var Autocomplete = (0,
|
|
2247
|
+
var import_ui31 = require("@elementor/ui");
|
|
2248
|
+
var Autocomplete = (0, import_react21.forwardRef)((props, ref) => {
|
|
2226
2249
|
const {
|
|
2227
2250
|
options,
|
|
2228
2251
|
onOptionChange,
|
|
@@ -2238,8 +2261,8 @@ var Autocomplete = (0, import_react20.forwardRef)((props, ref) => {
|
|
|
2238
2261
|
const muiWarningPreventer = allowCustomValues || !!value?.toString()?.length;
|
|
2239
2262
|
const isOptionEqualToValue = muiWarningPreventer ? void 0 : () => true;
|
|
2240
2263
|
const isValueFromOptions = typeof value === "number" && !!findMatchingOption(options, value);
|
|
2241
|
-
return /* @__PURE__ */
|
|
2242
|
-
|
|
2264
|
+
return /* @__PURE__ */ React38.createElement(
|
|
2265
|
+
import_ui31.Autocomplete,
|
|
2243
2266
|
{
|
|
2244
2267
|
...restProps,
|
|
2245
2268
|
ref,
|
|
@@ -2256,8 +2279,8 @@ var Autocomplete = (0, import_react20.forwardRef)((props, ref) => {
|
|
|
2256
2279
|
groupBy: isCategorizedOptionPool(options) ? (optionId) => findMatchingOption(options, optionId)?.groupLabel || optionId : void 0,
|
|
2257
2280
|
isOptionEqualToValue,
|
|
2258
2281
|
filterOptions: () => optionKeys,
|
|
2259
|
-
renderOption: (optionProps, optionId) => /* @__PURE__ */
|
|
2260
|
-
renderInput: (params) => /* @__PURE__ */
|
|
2282
|
+
renderOption: (optionProps, optionId) => /* @__PURE__ */ React38.createElement(import_ui31.Box, { component: "li", ...optionProps, key: optionProps.id }, findMatchingOption(options, optionId)?.label ?? optionId),
|
|
2283
|
+
renderInput: (params) => /* @__PURE__ */ React38.createElement(
|
|
2261
2284
|
TextInput,
|
|
2262
2285
|
{
|
|
2263
2286
|
params,
|
|
@@ -2280,8 +2303,8 @@ var TextInput = ({
|
|
|
2280
2303
|
const onChange = (event) => {
|
|
2281
2304
|
handleChange(event.target.value);
|
|
2282
2305
|
};
|
|
2283
|
-
return /* @__PURE__ */
|
|
2284
|
-
|
|
2306
|
+
return /* @__PURE__ */ React38.createElement(
|
|
2307
|
+
import_ui31.TextField,
|
|
2285
2308
|
{
|
|
2286
2309
|
...params,
|
|
2287
2310
|
placeholder,
|
|
@@ -2293,7 +2316,7 @@ var TextInput = ({
|
|
|
2293
2316
|
},
|
|
2294
2317
|
InputProps: {
|
|
2295
2318
|
...params.InputProps,
|
|
2296
|
-
endAdornment: /* @__PURE__ */
|
|
2319
|
+
endAdornment: /* @__PURE__ */ React38.createElement(ClearButton, { params, allowClear, handleChange })
|
|
2297
2320
|
}
|
|
2298
2321
|
}
|
|
2299
2322
|
);
|
|
@@ -2302,7 +2325,7 @@ var ClearButton = ({
|
|
|
2302
2325
|
allowClear,
|
|
2303
2326
|
handleChange,
|
|
2304
2327
|
params
|
|
2305
|
-
}) => /* @__PURE__ */
|
|
2328
|
+
}) => /* @__PURE__ */ React38.createElement(import_ui31.InputAdornment, { position: "end" }, allowClear && /* @__PURE__ */ React38.createElement(import_ui31.IconButton, { size: params.size, onClick: () => handleChange(null), sx: { cursor: "pointer" } }, /* @__PURE__ */ React38.createElement(import_icons9.XIcon, { fontSize: params.size })));
|
|
2306
2329
|
function findMatchingOption(options, optionId = null) {
|
|
2307
2330
|
const formattedOption = (optionId || "").toString();
|
|
2308
2331
|
return options.find(({ id }) => formattedOption === id.toString());
|
|
@@ -2330,18 +2353,19 @@ var learnMoreButton = {
|
|
|
2330
2353
|
href: "https://go.elementor.com/element-link-inside-link-infotip"
|
|
2331
2354
|
};
|
|
2332
2355
|
var LinkControl = createControl((props) => {
|
|
2333
|
-
const { value, path, setValue, ...propContext } = useBoundProp(
|
|
2356
|
+
const { value, path, setValue, ...propContext } = useBoundProp(import_editor_props17.linkPropTypeUtil);
|
|
2334
2357
|
const [linkSessionValue, setLinkSessionValue] = (0, import_session.useSessionStorage)(path.join("/"));
|
|
2335
|
-
const [isActive, setIsActive] = (0,
|
|
2358
|
+
const [isActive, setIsActive] = (0, import_react22.useState)(!!value);
|
|
2336
2359
|
const {
|
|
2337
2360
|
allowCustomValues,
|
|
2338
2361
|
queryOptions: { endpoint = "", requestParams = {} },
|
|
2339
2362
|
placeholder,
|
|
2340
2363
|
minInputLength = 2,
|
|
2341
|
-
context: { elementId }
|
|
2364
|
+
context: { elementId },
|
|
2365
|
+
label = (0, import_i18n9.__)("Link", "elementor")
|
|
2342
2366
|
} = props || {};
|
|
2343
|
-
const [linkInLinkRestriction, setLinkInLinkRestriction] = (0,
|
|
2344
|
-
const [options, setOptions] = (0,
|
|
2367
|
+
const [linkInLinkRestriction, setLinkInLinkRestriction] = (0, import_react22.useState)((0, import_editor_elements.getLinkInLinkRestriction)(elementId));
|
|
2368
|
+
const [options, setOptions] = (0, import_react22.useState)(
|
|
2345
2369
|
generateFirstLoadedOption(value)
|
|
2346
2370
|
);
|
|
2347
2371
|
const shouldDisableAddingLink = !isActive && linkInLinkRestriction.shouldRestrict;
|
|
@@ -2366,8 +2390,8 @@ var LinkControl = createControl((props) => {
|
|
|
2366
2390
|
const onOptionChange = (newValue) => {
|
|
2367
2391
|
const valueToSave = newValue ? {
|
|
2368
2392
|
...value,
|
|
2369
|
-
destination:
|
|
2370
|
-
label:
|
|
2393
|
+
destination: import_editor_props17.numberPropTypeUtil.create(newValue),
|
|
2394
|
+
label: import_editor_props17.stringPropTypeUtil.create(findMatchingOption(options, newValue)?.label || null)
|
|
2371
2395
|
} : null;
|
|
2372
2396
|
onSaveNewValue(valueToSave);
|
|
2373
2397
|
};
|
|
@@ -2375,8 +2399,8 @@ var LinkControl = createControl((props) => {
|
|
|
2375
2399
|
newValue = newValue?.trim() || "";
|
|
2376
2400
|
const valueToSave = newValue ? {
|
|
2377
2401
|
...value,
|
|
2378
|
-
destination:
|
|
2379
|
-
label:
|
|
2402
|
+
destination: import_editor_props17.urlPropTypeUtil.create(newValue),
|
|
2403
|
+
label: import_editor_props17.stringPropTypeUtil.create("")
|
|
2380
2404
|
} : null;
|
|
2381
2405
|
onSaveNewValue(valueToSave);
|
|
2382
2406
|
updateOptions(newValue);
|
|
@@ -2392,7 +2416,7 @@ var LinkControl = createControl((props) => {
|
|
|
2392
2416
|
}
|
|
2393
2417
|
debounceFetch({ ...requestParams, term: newValue });
|
|
2394
2418
|
};
|
|
2395
|
-
const debounceFetch = (0,
|
|
2419
|
+
const debounceFetch = (0, import_react22.useMemo)(
|
|
2396
2420
|
() => (0, import_utils3.debounce)(
|
|
2397
2421
|
(params) => fetchOptions(endpoint, params).then((newOptions) => {
|
|
2398
2422
|
setOptions(formatOptions(newOptions));
|
|
@@ -2401,8 +2425,8 @@ var LinkControl = createControl((props) => {
|
|
|
2401
2425
|
),
|
|
2402
2426
|
[endpoint]
|
|
2403
2427
|
);
|
|
2404
|
-
return /* @__PURE__ */
|
|
2405
|
-
|
|
2428
|
+
return /* @__PURE__ */ React39.createElement(PropProvider, { ...propContext, value, setValue }, /* @__PURE__ */ React39.createElement(import_ui32.Stack, { gap: 1.5 }, /* @__PURE__ */ React39.createElement(
|
|
2429
|
+
import_ui32.Stack,
|
|
2406
2430
|
{
|
|
2407
2431
|
direction: "row",
|
|
2408
2432
|
sx: {
|
|
@@ -2411,8 +2435,8 @@ var LinkControl = createControl((props) => {
|
|
|
2411
2435
|
marginInlineEnd: -0.75
|
|
2412
2436
|
}
|
|
2413
2437
|
},
|
|
2414
|
-
/* @__PURE__ */
|
|
2415
|
-
/* @__PURE__ */
|
|
2438
|
+
/* @__PURE__ */ React39.createElement(ControlFormLabel, null, label),
|
|
2439
|
+
/* @__PURE__ */ React39.createElement(ConditionalInfoTip, { isVisible: !isActive, linkInLinkRestriction }, /* @__PURE__ */ React39.createElement(
|
|
2416
2440
|
ToggleIconControl,
|
|
2417
2441
|
{
|
|
2418
2442
|
disabled: shouldDisableAddingLink,
|
|
@@ -2421,7 +2445,7 @@ var LinkControl = createControl((props) => {
|
|
|
2421
2445
|
label: (0, import_i18n9.__)("Toggle link", "elementor")
|
|
2422
2446
|
}
|
|
2423
2447
|
))
|
|
2424
|
-
), /* @__PURE__ */
|
|
2448
|
+
), /* @__PURE__ */ React39.createElement(import_ui32.Collapse, { in: isActive, timeout: "auto", unmountOnExit: true }, /* @__PURE__ */ React39.createElement(import_ui32.Stack, { gap: 1.5 }, /* @__PURE__ */ React39.createElement(PropKeyProvider, { bind: "destination" }, /* @__PURE__ */ React39.createElement(ControlActions, null, /* @__PURE__ */ React39.createElement(
|
|
2425
2449
|
Autocomplete,
|
|
2426
2450
|
{
|
|
2427
2451
|
options,
|
|
@@ -2432,13 +2456,13 @@ var LinkControl = createControl((props) => {
|
|
|
2432
2456
|
onTextChange,
|
|
2433
2457
|
minInputLength
|
|
2434
2458
|
}
|
|
2435
|
-
))), /* @__PURE__ */
|
|
2459
|
+
))), /* @__PURE__ */ React39.createElement(PropKeyProvider, { bind: "isTargetBlank" }, /* @__PURE__ */ React39.createElement(SwitchControl, { disabled: propContext.disabled || !value }))))));
|
|
2436
2460
|
});
|
|
2437
2461
|
var ToggleIconControl = ({ disabled, active, onIconClick, label }) => {
|
|
2438
|
-
return /* @__PURE__ */
|
|
2462
|
+
return /* @__PURE__ */ React39.createElement(import_ui32.IconButton, { size: SIZE4, onClick: onIconClick, "aria-label": label, disabled }, active ? /* @__PURE__ */ React39.createElement(import_icons10.MinusIcon, { fontSize: SIZE4 }) : /* @__PURE__ */ React39.createElement(import_icons10.PlusIcon, { fontSize: SIZE4 }));
|
|
2439
2463
|
};
|
|
2440
2464
|
var SwitchControl = ({ disabled }) => {
|
|
2441
|
-
const { value = false, setValue } = useBoundProp(
|
|
2465
|
+
const { value = false, setValue } = useBoundProp(import_editor_props17.booleanPropTypeUtil);
|
|
2442
2466
|
const onClick = () => {
|
|
2443
2467
|
setValue(!value);
|
|
2444
2468
|
};
|
|
@@ -2447,7 +2471,7 @@ var SwitchControl = ({ disabled }) => {
|
|
|
2447
2471
|
opacity: 0
|
|
2448
2472
|
}
|
|
2449
2473
|
} : {};
|
|
2450
|
-
return /* @__PURE__ */
|
|
2474
|
+
return /* @__PURE__ */ React39.createElement(import_ui32.Grid, { container: true, alignItems: "center", flexWrap: "nowrap", justifyContent: "space-between" }, /* @__PURE__ */ React39.createElement(import_ui32.Grid, { item: true }, /* @__PURE__ */ React39.createElement(ControlFormLabel, null, (0, import_i18n9.__)("Open in a new tab", "elementor"))), /* @__PURE__ */ React39.createElement(import_ui32.Grid, { item: true, sx: { marginInlineEnd: -1 } }, /* @__PURE__ */ React39.createElement(import_ui32.Switch, { checked: value, onClick, disabled, inputProps })));
|
|
2451
2475
|
};
|
|
2452
2476
|
async function fetchOptions(ajaxUrl, params) {
|
|
2453
2477
|
if (!params || !ajaxUrl) {
|
|
@@ -2484,15 +2508,15 @@ var ConditionalInfoTip = ({ linkInLinkRestriction, isVisible, children }) => {
|
|
|
2484
2508
|
(0, import_editor_elements.selectElement)(elementId);
|
|
2485
2509
|
}
|
|
2486
2510
|
};
|
|
2487
|
-
return shouldRestrict && isVisible ? /* @__PURE__ */
|
|
2488
|
-
|
|
2511
|
+
return shouldRestrict && isVisible ? /* @__PURE__ */ React39.createElement(
|
|
2512
|
+
import_ui32.Infotip,
|
|
2489
2513
|
{
|
|
2490
2514
|
placement: "right",
|
|
2491
|
-
content: /* @__PURE__ */
|
|
2492
|
-
|
|
2515
|
+
content: /* @__PURE__ */ React39.createElement(
|
|
2516
|
+
import_editor_ui5.InfoTipCard,
|
|
2493
2517
|
{
|
|
2494
2518
|
content: INFOTIP_CONTENT[reason],
|
|
2495
|
-
svgIcon: /* @__PURE__ */
|
|
2519
|
+
svgIcon: /* @__PURE__ */ React39.createElement(import_icons10.AlertTriangleIcon, null),
|
|
2496
2520
|
learnMoreButton,
|
|
2497
2521
|
ctaButton: {
|
|
2498
2522
|
label: (0, import_i18n9.__)("Take me there", "elementor"),
|
|
@@ -2501,20 +2525,20 @@ var ConditionalInfoTip = ({ linkInLinkRestriction, isVisible, children }) => {
|
|
|
2501
2525
|
}
|
|
2502
2526
|
)
|
|
2503
2527
|
},
|
|
2504
|
-
/* @__PURE__ */
|
|
2505
|
-
) : /* @__PURE__ */
|
|
2528
|
+
/* @__PURE__ */ React39.createElement(import_ui32.Box, null, children)
|
|
2529
|
+
) : /* @__PURE__ */ React39.createElement(React39.Fragment, null, children);
|
|
2506
2530
|
};
|
|
2507
2531
|
var INFOTIP_CONTENT = {
|
|
2508
|
-
descendant: /* @__PURE__ */
|
|
2509
|
-
ancestor: /* @__PURE__ */
|
|
2532
|
+
descendant: /* @__PURE__ */ React39.createElement(React39.Fragment, null, (0, import_i18n9.__)("To add a link to this container,", "elementor"), /* @__PURE__ */ React39.createElement("br", null), (0, import_i18n9.__)("first remove the link from the elements inside of it.", "elementor")),
|
|
2533
|
+
ancestor: /* @__PURE__ */ React39.createElement(React39.Fragment, null, (0, import_i18n9.__)("To add a link to this element,", "elementor"), /* @__PURE__ */ React39.createElement("br", null), (0, import_i18n9.__)("first remove the link from its parent container.", "elementor"))
|
|
2510
2534
|
};
|
|
2511
2535
|
|
|
2512
2536
|
// src/controls/gap-control.tsx
|
|
2513
|
-
var
|
|
2514
|
-
var
|
|
2515
|
-
var
|
|
2537
|
+
var React40 = __toESM(require("react"));
|
|
2538
|
+
var import_react23 = require("react");
|
|
2539
|
+
var import_editor_props18 = require("@elementor/editor-props");
|
|
2516
2540
|
var import_icons11 = require("@elementor/icons");
|
|
2517
|
-
var
|
|
2541
|
+
var import_ui33 = require("@elementor/ui");
|
|
2518
2542
|
var import_i18n10 = require("@wordpress/i18n");
|
|
2519
2543
|
var GapControl = createControl(({ label }) => {
|
|
2520
2544
|
const {
|
|
@@ -2522,16 +2546,16 @@ var GapControl = createControl(({ label }) => {
|
|
|
2522
2546
|
setValue: setDirectionValue,
|
|
2523
2547
|
propType,
|
|
2524
2548
|
disabled: directionDisabled
|
|
2525
|
-
} = useBoundProp(
|
|
2526
|
-
const stackRef = (0,
|
|
2527
|
-
const { value: sizeValue, setValue: setSizeValue, disabled: sizeDisabled } = useBoundProp(
|
|
2549
|
+
} = useBoundProp(import_editor_props18.layoutDirectionPropTypeUtil);
|
|
2550
|
+
const stackRef = (0, import_react23.useRef)(null);
|
|
2551
|
+
const { value: sizeValue, setValue: setSizeValue, disabled: sizeDisabled } = useBoundProp(import_editor_props18.sizePropTypeUtil);
|
|
2528
2552
|
const isLinked = !directionValue && !sizeValue ? true : !!sizeValue;
|
|
2529
2553
|
const onLinkToggle = () => {
|
|
2530
2554
|
if (!isLinked) {
|
|
2531
2555
|
setSizeValue(directionValue?.column?.value ?? null);
|
|
2532
2556
|
return;
|
|
2533
2557
|
}
|
|
2534
|
-
const value = sizeValue ?
|
|
2558
|
+
const value = sizeValue ? import_editor_props18.sizePropTypeUtil.create(sizeValue) : null;
|
|
2535
2559
|
setDirectionValue({
|
|
2536
2560
|
row: value,
|
|
2537
2561
|
column: value
|
|
@@ -2542,8 +2566,8 @@ var GapControl = createControl(({ label }) => {
|
|
|
2542
2566
|
const linkedLabel = (0, import_i18n10.__)("Link %s", "elementor").replace("%s", tooltipLabel);
|
|
2543
2567
|
const unlinkedLabel = (0, import_i18n10.__)("Unlink %s", "elementor").replace("%s", tooltipLabel);
|
|
2544
2568
|
const disabled = sizeDisabled || directionDisabled;
|
|
2545
|
-
return /* @__PURE__ */
|
|
2546
|
-
|
|
2569
|
+
return /* @__PURE__ */ React40.createElement(PropProvider, { propType, value: directionValue, setValue: setDirectionValue }, /* @__PURE__ */ React40.createElement(import_ui33.Stack, { direction: "row", gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React40.createElement(ControlLabel, null, label), /* @__PURE__ */ React40.createElement(import_ui33.Tooltip, { title: isLinked ? unlinkedLabel : linkedLabel, placement: "top" }, /* @__PURE__ */ React40.createElement(
|
|
2570
|
+
import_ui33.ToggleButton,
|
|
2547
2571
|
{
|
|
2548
2572
|
"aria-label": isLinked ? unlinkedLabel : linkedLabel,
|
|
2549
2573
|
size: "tiny",
|
|
@@ -2553,8 +2577,8 @@ var GapControl = createControl(({ label }) => {
|
|
|
2553
2577
|
onChange: onLinkToggle,
|
|
2554
2578
|
disabled
|
|
2555
2579
|
},
|
|
2556
|
-
/* @__PURE__ */
|
|
2557
|
-
))), /* @__PURE__ */
|
|
2580
|
+
/* @__PURE__ */ React40.createElement(LinkedIcon, { fontSize: "tiny" })
|
|
2581
|
+
))), /* @__PURE__ */ React40.createElement(import_ui33.Stack, { direction: "row", gap: 2, flexWrap: "nowrap", ref: stackRef }, /* @__PURE__ */ React40.createElement(import_ui33.Grid, { container: true, gap: 0.75, alignItems: "center" }, /* @__PURE__ */ React40.createElement(import_ui33.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React40.createElement(ControlFormLabel, null, (0, import_i18n10.__)("Column", "elementor"))), /* @__PURE__ */ React40.createElement(import_ui33.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React40.createElement(Control4, { bind: "column", isLinked, anchorRef: stackRef }))), /* @__PURE__ */ React40.createElement(import_ui33.Grid, { container: true, gap: 0.75, alignItems: "center" }, /* @__PURE__ */ React40.createElement(import_ui33.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React40.createElement(ControlFormLabel, null, (0, import_i18n10.__)("Row", "elementor"))), /* @__PURE__ */ React40.createElement(import_ui33.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React40.createElement(Control4, { bind: "row", isLinked, anchorRef: stackRef })))));
|
|
2558
2582
|
});
|
|
2559
2583
|
var Control4 = ({
|
|
2560
2584
|
bind,
|
|
@@ -2562,18 +2586,18 @@ var Control4 = ({
|
|
|
2562
2586
|
anchorRef
|
|
2563
2587
|
}) => {
|
|
2564
2588
|
if (isLinked) {
|
|
2565
|
-
return /* @__PURE__ */
|
|
2589
|
+
return /* @__PURE__ */ React40.createElement(SizeControl, { anchorRef });
|
|
2566
2590
|
}
|
|
2567
|
-
return /* @__PURE__ */
|
|
2591
|
+
return /* @__PURE__ */ React40.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React40.createElement(SizeControl, { anchorRef }));
|
|
2568
2592
|
};
|
|
2569
2593
|
|
|
2570
2594
|
// src/controls/aspect-ratio-control.tsx
|
|
2571
|
-
var
|
|
2572
|
-
var
|
|
2573
|
-
var
|
|
2574
|
-
var
|
|
2595
|
+
var React41 = __toESM(require("react"));
|
|
2596
|
+
var import_react24 = require("react");
|
|
2597
|
+
var import_editor_props19 = require("@elementor/editor-props");
|
|
2598
|
+
var import_editor_ui6 = require("@elementor/editor-ui");
|
|
2575
2599
|
var import_icons12 = require("@elementor/icons");
|
|
2576
|
-
var
|
|
2600
|
+
var import_ui34 = require("@elementor/ui");
|
|
2577
2601
|
var import_i18n11 = require("@wordpress/i18n");
|
|
2578
2602
|
var RATIO_OPTIONS = [
|
|
2579
2603
|
{ label: (0, import_i18n11.__)("Auto", "elementor"), value: "auto" },
|
|
@@ -2587,15 +2611,30 @@ var RATIO_OPTIONS = [
|
|
|
2587
2611
|
];
|
|
2588
2612
|
var CUSTOM_RATIO = "custom";
|
|
2589
2613
|
var AspectRatioControl = createControl(({ label }) => {
|
|
2590
|
-
const { value: aspectRatioValue, setValue: setAspectRatioValue, disabled } = useBoundProp(
|
|
2614
|
+
const { value: aspectRatioValue, setValue: setAspectRatioValue, disabled } = useBoundProp(import_editor_props19.stringPropTypeUtil);
|
|
2591
2615
|
const isCustomSelected = aspectRatioValue && !RATIO_OPTIONS.some((option) => option.value === aspectRatioValue);
|
|
2592
2616
|
const [initialWidth, initialHeight] = isCustomSelected ? aspectRatioValue.split("/") : ["", ""];
|
|
2593
|
-
const [isCustom, setIsCustom] = (0,
|
|
2594
|
-
const [customWidth, setCustomWidth] = (0,
|
|
2595
|
-
const [customHeight, setCustomHeight] = (0,
|
|
2596
|
-
const [selectedValue, setSelectedValue] = (0,
|
|
2617
|
+
const [isCustom, setIsCustom] = (0, import_react24.useState)(isCustomSelected);
|
|
2618
|
+
const [customWidth, setCustomWidth] = (0, import_react24.useState)(initialWidth);
|
|
2619
|
+
const [customHeight, setCustomHeight] = (0, import_react24.useState)(initialHeight);
|
|
2620
|
+
const [selectedValue, setSelectedValue] = (0, import_react24.useState)(
|
|
2597
2621
|
isCustomSelected ? CUSTOM_RATIO : aspectRatioValue || ""
|
|
2598
2622
|
);
|
|
2623
|
+
(0, import_react24.useEffect)(() => {
|
|
2624
|
+
const isCustomValue = aspectRatioValue && !RATIO_OPTIONS.some((option) => option.value === aspectRatioValue);
|
|
2625
|
+
if (isCustomValue) {
|
|
2626
|
+
const [width, height] = aspectRatioValue.split("/");
|
|
2627
|
+
setCustomWidth(width || "");
|
|
2628
|
+
setCustomHeight(height || "");
|
|
2629
|
+
setSelectedValue(CUSTOM_RATIO);
|
|
2630
|
+
setIsCustom(true);
|
|
2631
|
+
} else {
|
|
2632
|
+
setSelectedValue(aspectRatioValue || "");
|
|
2633
|
+
setIsCustom(false);
|
|
2634
|
+
setCustomWidth("");
|
|
2635
|
+
setCustomHeight("");
|
|
2636
|
+
}
|
|
2637
|
+
}, [aspectRatioValue]);
|
|
2599
2638
|
const handleSelectChange = (event) => {
|
|
2600
2639
|
const newValue = event.target.value;
|
|
2601
2640
|
const isCustomRatio = newValue === CUSTOM_RATIO;
|
|
@@ -2620,8 +2659,8 @@ var AspectRatioControl = createControl(({ label }) => {
|
|
|
2620
2659
|
setAspectRatioValue(`${customWidth}/${newHeight}`);
|
|
2621
2660
|
}
|
|
2622
2661
|
};
|
|
2623
|
-
return /* @__PURE__ */
|
|
2624
|
-
|
|
2662
|
+
return /* @__PURE__ */ React41.createElement(ControlActions, null, /* @__PURE__ */ React41.createElement(import_ui34.Stack, { direction: "column", gap: 2 }, /* @__PURE__ */ React41.createElement(import_ui34.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React41.createElement(import_ui34.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React41.createElement(ControlLabel, null, label)), /* @__PURE__ */ React41.createElement(import_ui34.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React41.createElement(
|
|
2663
|
+
import_ui34.Select,
|
|
2625
2664
|
{
|
|
2626
2665
|
size: "tiny",
|
|
2627
2666
|
displayEmpty: true,
|
|
@@ -2632,10 +2671,10 @@ var AspectRatioControl = createControl(({ label }) => {
|
|
|
2632
2671
|
fullWidth: true
|
|
2633
2672
|
},
|
|
2634
2673
|
[...RATIO_OPTIONS, { label: (0, import_i18n11.__)("Custom", "elementor"), value: CUSTOM_RATIO }].map(
|
|
2635
|
-
({ label: optionLabel, ...props }) => /* @__PURE__ */
|
|
2674
|
+
({ label: optionLabel, ...props }) => /* @__PURE__ */ React41.createElement(import_editor_ui6.MenuListItem, { key: props.value, ...props, value: props.value ?? "" }, optionLabel)
|
|
2636
2675
|
)
|
|
2637
|
-
))), isCustom && /* @__PURE__ */
|
|
2638
|
-
|
|
2676
|
+
))), isCustom && /* @__PURE__ */ React41.createElement(import_ui34.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React41.createElement(import_ui34.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React41.createElement(
|
|
2677
|
+
import_ui34.TextField,
|
|
2639
2678
|
{
|
|
2640
2679
|
size: "tiny",
|
|
2641
2680
|
type: "number",
|
|
@@ -2644,11 +2683,11 @@ var AspectRatioControl = createControl(({ label }) => {
|
|
|
2644
2683
|
value: customWidth,
|
|
2645
2684
|
onChange: handleCustomWidthChange,
|
|
2646
2685
|
InputProps: {
|
|
2647
|
-
startAdornment: /* @__PURE__ */
|
|
2686
|
+
startAdornment: /* @__PURE__ */ React41.createElement(import_icons12.ArrowsMoveHorizontalIcon, { fontSize: "tiny" })
|
|
2648
2687
|
}
|
|
2649
2688
|
}
|
|
2650
|
-
)), /* @__PURE__ */
|
|
2651
|
-
|
|
2689
|
+
)), /* @__PURE__ */ React41.createElement(import_ui34.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React41.createElement(
|
|
2690
|
+
import_ui34.TextField,
|
|
2652
2691
|
{
|
|
2653
2692
|
size: "tiny",
|
|
2654
2693
|
type: "number",
|
|
@@ -2657,26 +2696,26 @@ var AspectRatioControl = createControl(({ label }) => {
|
|
|
2657
2696
|
value: customHeight,
|
|
2658
2697
|
onChange: handleCustomHeightChange,
|
|
2659
2698
|
InputProps: {
|
|
2660
|
-
startAdornment: /* @__PURE__ */
|
|
2699
|
+
startAdornment: /* @__PURE__ */ React41.createElement(import_icons12.ArrowsMoveVerticalIcon, { fontSize: "tiny" })
|
|
2661
2700
|
}
|
|
2662
2701
|
}
|
|
2663
2702
|
)))));
|
|
2664
2703
|
});
|
|
2665
2704
|
|
|
2666
2705
|
// src/controls/svg-media-control.tsx
|
|
2667
|
-
var
|
|
2668
|
-
var
|
|
2669
|
-
var
|
|
2706
|
+
var React43 = __toESM(require("react"));
|
|
2707
|
+
var import_react26 = require("react");
|
|
2708
|
+
var import_editor_props20 = require("@elementor/editor-props");
|
|
2670
2709
|
var import_icons13 = require("@elementor/icons");
|
|
2671
|
-
var
|
|
2710
|
+
var import_ui36 = require("@elementor/ui");
|
|
2672
2711
|
var import_wp_media2 = require("@elementor/wp-media");
|
|
2673
2712
|
var import_i18n13 = require("@wordpress/i18n");
|
|
2674
2713
|
|
|
2675
2714
|
// src/components/enable-unfiltered-modal.tsx
|
|
2676
|
-
var
|
|
2677
|
-
var
|
|
2715
|
+
var React42 = __toESM(require("react"));
|
|
2716
|
+
var import_react25 = require("react");
|
|
2678
2717
|
var import_editor_current_user = require("@elementor/editor-current-user");
|
|
2679
|
-
var
|
|
2718
|
+
var import_ui35 = require("@elementor/ui");
|
|
2680
2719
|
var import_i18n12 = require("@wordpress/i18n");
|
|
2681
2720
|
var ADMIN_TITLE_TEXT = (0, import_i18n12.__)("Enable Unfiltered Uploads", "elementor");
|
|
2682
2721
|
var ADMIN_CONTENT_TEXT = (0, import_i18n12.__)(
|
|
@@ -2697,7 +2736,7 @@ var WAIT_FOR_CLOSE_TIMEOUT_MS = 300;
|
|
|
2697
2736
|
var EnableUnfilteredModal = (props) => {
|
|
2698
2737
|
const { mutateAsync, isPending } = useUpdateUnfilteredFilesUpload();
|
|
2699
2738
|
const { canUser } = (0, import_editor_current_user.useCurrentUserCapabilities)();
|
|
2700
|
-
const [isError, setIsError] = (0,
|
|
2739
|
+
const [isError, setIsError] = (0, import_react25.useState)(false);
|
|
2701
2740
|
const canManageOptions = canUser("manage_options");
|
|
2702
2741
|
const onClose = (enabled) => {
|
|
2703
2742
|
props.onClose(enabled);
|
|
@@ -2716,10 +2755,10 @@ var EnableUnfilteredModal = (props) => {
|
|
|
2716
2755
|
}
|
|
2717
2756
|
};
|
|
2718
2757
|
const dialogProps = { ...props, isPending, handleEnable, isError, onClose };
|
|
2719
|
-
return canManageOptions ? /* @__PURE__ */
|
|
2758
|
+
return canManageOptions ? /* @__PURE__ */ React42.createElement(AdminDialog, { ...dialogProps }) : /* @__PURE__ */ React42.createElement(NonAdminDialog, { ...dialogProps });
|
|
2720
2759
|
};
|
|
2721
|
-
var AdminDialog = ({ open, onClose, handleEnable, isPending, isError }) => /* @__PURE__ */
|
|
2722
|
-
|
|
2760
|
+
var AdminDialog = ({ open, onClose, handleEnable, isPending, isError }) => /* @__PURE__ */ React42.createElement(import_ui35.Dialog, { open, maxWidth: "sm", onClose: () => onClose(false) }, /* @__PURE__ */ React42.createElement(import_ui35.DialogHeader, { logo: false }, /* @__PURE__ */ React42.createElement(import_ui35.DialogTitle, null, ADMIN_TITLE_TEXT)), /* @__PURE__ */ React42.createElement(import_ui35.Divider, null), /* @__PURE__ */ React42.createElement(import_ui35.DialogContent, null, /* @__PURE__ */ React42.createElement(import_ui35.DialogContentText, null, isError ? /* @__PURE__ */ React42.createElement(React42.Fragment, null, ADMIN_FAILED_CONTENT_TEXT_PT1, " ", /* @__PURE__ */ React42.createElement("br", null), " ", ADMIN_FAILED_CONTENT_TEXT_PT2) : ADMIN_CONTENT_TEXT)), /* @__PURE__ */ React42.createElement(import_ui35.DialogActions, null, /* @__PURE__ */ React42.createElement(import_ui35.Button, { size: "medium", color: "secondary", onClick: () => onClose(false) }, (0, import_i18n12.__)("Cancel", "elementor")), /* @__PURE__ */ React42.createElement(
|
|
2761
|
+
import_ui35.Button,
|
|
2723
2762
|
{
|
|
2724
2763
|
size: "medium",
|
|
2725
2764
|
onClick: () => handleEnable(),
|
|
@@ -2727,16 +2766,16 @@ var AdminDialog = ({ open, onClose, handleEnable, isPending, isError }) => /* @_
|
|
|
2727
2766
|
color: "primary",
|
|
2728
2767
|
disabled: isPending
|
|
2729
2768
|
},
|
|
2730
|
-
isPending ? /* @__PURE__ */
|
|
2769
|
+
isPending ? /* @__PURE__ */ React42.createElement(import_ui35.CircularProgress, { size: 24 }) : (0, import_i18n12.__)("Enable", "elementor")
|
|
2731
2770
|
)));
|
|
2732
|
-
var NonAdminDialog = ({ open, onClose }) => /* @__PURE__ */
|
|
2771
|
+
var NonAdminDialog = ({ open, onClose }) => /* @__PURE__ */ React42.createElement(import_ui35.Dialog, { open, maxWidth: "sm", onClose: () => onClose(false) }, /* @__PURE__ */ React42.createElement(import_ui35.DialogHeader, { logo: false }, /* @__PURE__ */ React42.createElement(import_ui35.DialogTitle, null, NON_ADMIN_TITLE_TEXT)), /* @__PURE__ */ React42.createElement(import_ui35.Divider, null), /* @__PURE__ */ React42.createElement(import_ui35.DialogContent, null, /* @__PURE__ */ React42.createElement(import_ui35.DialogContentText, null, NON_ADMIN_CONTENT_TEXT)), /* @__PURE__ */ React42.createElement(import_ui35.DialogActions, null, /* @__PURE__ */ React42.createElement(import_ui35.Button, { size: "medium", onClick: () => onClose(false), variant: "contained", color: "primary" }, (0, import_i18n12.__)("Got it", "elementor"))));
|
|
2733
2772
|
|
|
2734
2773
|
// src/controls/svg-media-control.tsx
|
|
2735
2774
|
var TILE_SIZE = 8;
|
|
2736
2775
|
var TILE_WHITE = "transparent";
|
|
2737
2776
|
var TILE_BLACK = "#c1c1c1";
|
|
2738
2777
|
var TILES_GRADIENT_FORMULA = `linear-gradient(45deg, ${TILE_BLACK} 25%, ${TILE_WHITE} 0, ${TILE_WHITE} 75%, ${TILE_BLACK} 0, ${TILE_BLACK})`;
|
|
2739
|
-
var StyledCard = (0,
|
|
2778
|
+
var StyledCard = (0, import_ui36.styled)(import_ui36.Card)`
|
|
2740
2779
|
background-color: white;
|
|
2741
2780
|
background-image: ${TILES_GRADIENT_FORMULA}, ${TILES_GRADIENT_FORMULA};
|
|
2742
2781
|
background-size: ${TILE_SIZE}px ${TILE_SIZE}px;
|
|
@@ -2745,7 +2784,7 @@ var StyledCard = (0, import_ui35.styled)(import_ui35.Card)`
|
|
|
2745
2784
|
${TILE_SIZE / 2}px ${TILE_SIZE / 2}px;
|
|
2746
2785
|
border: none;
|
|
2747
2786
|
`;
|
|
2748
|
-
var StyledCardMediaContainer = (0,
|
|
2787
|
+
var StyledCardMediaContainer = (0, import_ui36.styled)(import_ui36.Stack)`
|
|
2749
2788
|
position: relative;
|
|
2750
2789
|
height: 140px;
|
|
2751
2790
|
object-fit: contain;
|
|
@@ -2757,12 +2796,12 @@ var StyledCardMediaContainer = (0, import_ui35.styled)(import_ui35.Stack)`
|
|
|
2757
2796
|
var MODE_BROWSE = { mode: "browse" };
|
|
2758
2797
|
var MODE_UPLOAD = { mode: "upload" };
|
|
2759
2798
|
var SvgMediaControl = createControl(() => {
|
|
2760
|
-
const { value, setValue } = useBoundProp(
|
|
2799
|
+
const { value, setValue } = useBoundProp(import_editor_props20.imageSrcPropTypeUtil);
|
|
2761
2800
|
const { id, url } = value ?? {};
|
|
2762
2801
|
const { data: attachment, isFetching } = (0, import_wp_media2.useWpMediaAttachment)(id?.value || null);
|
|
2763
2802
|
const src = attachment?.url ?? url?.value ?? null;
|
|
2764
2803
|
const { data: allowSvgUpload } = useUnfilteredFilesUpload();
|
|
2765
|
-
const [unfilteredModalOpenState, setUnfilteredModalOpenState] = (0,
|
|
2804
|
+
const [unfilteredModalOpenState, setUnfilteredModalOpenState] = (0, import_react26.useState)(false);
|
|
2766
2805
|
const { open } = (0, import_wp_media2.useWpMediaFrame)({
|
|
2767
2806
|
mediaTypes: ["svg"],
|
|
2768
2807
|
multiple: false,
|
|
@@ -2790,16 +2829,16 @@ var SvgMediaControl = createControl(() => {
|
|
|
2790
2829
|
open(openOptions);
|
|
2791
2830
|
}
|
|
2792
2831
|
};
|
|
2793
|
-
return /* @__PURE__ */
|
|
2794
|
-
|
|
2832
|
+
return /* @__PURE__ */ React43.createElement(import_ui36.Stack, { gap: 1 }, /* @__PURE__ */ React43.createElement(EnableUnfilteredModal, { open: unfilteredModalOpenState, onClose: onCloseUnfilteredModal }), /* @__PURE__ */ React43.createElement(ControlActions, null, /* @__PURE__ */ React43.createElement(StyledCard, { variant: "outlined" }, /* @__PURE__ */ React43.createElement(StyledCardMediaContainer, null, isFetching ? /* @__PURE__ */ React43.createElement(import_ui36.CircularProgress, { role: "progressbar" }) : /* @__PURE__ */ React43.createElement(
|
|
2833
|
+
import_ui36.CardMedia,
|
|
2795
2834
|
{
|
|
2796
2835
|
component: "img",
|
|
2797
2836
|
image: src,
|
|
2798
2837
|
alt: (0, import_i18n13.__)("Preview SVG", "elementor"),
|
|
2799
2838
|
sx: { maxHeight: "140px", width: "50px" }
|
|
2800
2839
|
}
|
|
2801
|
-
)), /* @__PURE__ */
|
|
2802
|
-
|
|
2840
|
+
)), /* @__PURE__ */ React43.createElement(
|
|
2841
|
+
import_ui36.CardOverlay,
|
|
2803
2842
|
{
|
|
2804
2843
|
sx: {
|
|
2805
2844
|
"&:hover": {
|
|
@@ -2807,8 +2846,8 @@ var SvgMediaControl = createControl(() => {
|
|
|
2807
2846
|
}
|
|
2808
2847
|
}
|
|
2809
2848
|
},
|
|
2810
|
-
/* @__PURE__ */
|
|
2811
|
-
|
|
2849
|
+
/* @__PURE__ */ React43.createElement(import_ui36.Stack, { gap: 1 }, /* @__PURE__ */ React43.createElement(
|
|
2850
|
+
import_ui36.Button,
|
|
2812
2851
|
{
|
|
2813
2852
|
size: "tiny",
|
|
2814
2853
|
color: "inherit",
|
|
@@ -2816,13 +2855,13 @@ var SvgMediaControl = createControl(() => {
|
|
|
2816
2855
|
onClick: () => handleClick(MODE_BROWSE)
|
|
2817
2856
|
},
|
|
2818
2857
|
(0, import_i18n13.__)("Select SVG", "elementor")
|
|
2819
|
-
), /* @__PURE__ */
|
|
2820
|
-
|
|
2858
|
+
), /* @__PURE__ */ React43.createElement(
|
|
2859
|
+
import_ui36.Button,
|
|
2821
2860
|
{
|
|
2822
2861
|
size: "tiny",
|
|
2823
2862
|
variant: "text",
|
|
2824
2863
|
color: "inherit",
|
|
2825
|
-
startIcon: /* @__PURE__ */
|
|
2864
|
+
startIcon: /* @__PURE__ */ React43.createElement(import_icons13.UploadIcon, null),
|
|
2826
2865
|
onClick: () => handleClick(MODE_UPLOAD)
|
|
2827
2866
|
},
|
|
2828
2867
|
(0, import_i18n13.__)("Upload", "elementor")
|
|
@@ -2831,16 +2870,16 @@ var SvgMediaControl = createControl(() => {
|
|
|
2831
2870
|
});
|
|
2832
2871
|
|
|
2833
2872
|
// src/controls/background-control/background-control.tsx
|
|
2834
|
-
var
|
|
2835
|
-
var
|
|
2873
|
+
var React50 = __toESM(require("react"));
|
|
2874
|
+
var import_editor_props26 = require("@elementor/editor-props");
|
|
2836
2875
|
var import_editor_v1_adapters4 = require("@elementor/editor-v1-adapters");
|
|
2837
|
-
var
|
|
2876
|
+
var import_ui44 = require("@elementor/ui");
|
|
2838
2877
|
var import_i18n19 = require("@wordpress/i18n");
|
|
2839
2878
|
|
|
2840
2879
|
// src/controls/background-control/background-overlay/background-overlay-repeater-control.tsx
|
|
2841
|
-
var
|
|
2842
|
-
var
|
|
2843
|
-
var
|
|
2880
|
+
var React49 = __toESM(require("react"));
|
|
2881
|
+
var import_editor_props25 = require("@elementor/editor-props");
|
|
2882
|
+
var import_ui43 = require("@elementor/ui");
|
|
2844
2883
|
var import_wp_media3 = require("@elementor/wp-media");
|
|
2845
2884
|
var import_i18n18 = require("@wordpress/i18n");
|
|
2846
2885
|
|
|
@@ -2849,27 +2888,27 @@ var import_env = require("@elementor/env");
|
|
|
2849
2888
|
var { env } = (0, import_env.parseEnv)("@elementor/editor-controls");
|
|
2850
2889
|
|
|
2851
2890
|
// src/controls/background-control/background-gradient-color-control.tsx
|
|
2852
|
-
var
|
|
2853
|
-
var
|
|
2854
|
-
var
|
|
2891
|
+
var React44 = __toESM(require("react"));
|
|
2892
|
+
var import_editor_props21 = require("@elementor/editor-props");
|
|
2893
|
+
var import_ui37 = require("@elementor/ui");
|
|
2855
2894
|
var BackgroundGradientColorControl = createControl(() => {
|
|
2856
|
-
const { value, setValue } = useBoundProp(
|
|
2895
|
+
const { value, setValue } = useBoundProp(import_editor_props21.backgroundGradientOverlayPropTypeUtil);
|
|
2857
2896
|
const handleChange = (newValue) => {
|
|
2858
2897
|
const transformedValue = createTransformableValue(newValue);
|
|
2859
2898
|
if (transformedValue.positions) {
|
|
2860
|
-
transformedValue.positions =
|
|
2899
|
+
transformedValue.positions = import_editor_props21.stringPropTypeUtil.create(newValue.positions.join(" "));
|
|
2861
2900
|
}
|
|
2862
2901
|
setValue(transformedValue);
|
|
2863
2902
|
};
|
|
2864
2903
|
const createTransformableValue = (newValue) => ({
|
|
2865
2904
|
...newValue,
|
|
2866
|
-
type:
|
|
2867
|
-
angle:
|
|
2868
|
-
stops:
|
|
2905
|
+
type: import_editor_props21.stringPropTypeUtil.create(newValue.type),
|
|
2906
|
+
angle: import_editor_props21.numberPropTypeUtil.create(newValue.angle),
|
|
2907
|
+
stops: import_editor_props21.gradientColorStopPropTypeUtil.create(
|
|
2869
2908
|
newValue.stops.map(
|
|
2870
|
-
({ color, offset }) =>
|
|
2871
|
-
color:
|
|
2872
|
-
offset:
|
|
2909
|
+
({ color, offset }) => import_editor_props21.colorStopPropTypeUtil.create({
|
|
2910
|
+
color: import_editor_props21.colorPropTypeUtil.create(color),
|
|
2911
|
+
offset: import_editor_props21.numberPropTypeUtil.create(offset)
|
|
2873
2912
|
})
|
|
2874
2913
|
)
|
|
2875
2914
|
)
|
|
@@ -2889,8 +2928,8 @@ var BackgroundGradientColorControl = createControl(() => {
|
|
|
2889
2928
|
positions: positions?.value.split(" ")
|
|
2890
2929
|
};
|
|
2891
2930
|
};
|
|
2892
|
-
return /* @__PURE__ */
|
|
2893
|
-
|
|
2931
|
+
return /* @__PURE__ */ React44.createElement(ControlActions, null, /* @__PURE__ */ React44.createElement(
|
|
2932
|
+
import_ui37.UnstableGradientBox,
|
|
2894
2933
|
{
|
|
2895
2934
|
sx: { width: "auto", padding: 1.5 },
|
|
2896
2935
|
value: normalizeValue(),
|
|
@@ -2898,51 +2937,51 @@ var BackgroundGradientColorControl = createControl(() => {
|
|
|
2898
2937
|
}
|
|
2899
2938
|
));
|
|
2900
2939
|
});
|
|
2901
|
-
var initialBackgroundGradientOverlay =
|
|
2902
|
-
type:
|
|
2903
|
-
angle:
|
|
2904
|
-
stops:
|
|
2905
|
-
|
|
2906
|
-
color:
|
|
2907
|
-
offset:
|
|
2940
|
+
var initialBackgroundGradientOverlay = import_editor_props21.backgroundGradientOverlayPropTypeUtil.create({
|
|
2941
|
+
type: import_editor_props21.stringPropTypeUtil.create("linear"),
|
|
2942
|
+
angle: import_editor_props21.numberPropTypeUtil.create(180),
|
|
2943
|
+
stops: import_editor_props21.gradientColorStopPropTypeUtil.create([
|
|
2944
|
+
import_editor_props21.colorStopPropTypeUtil.create({
|
|
2945
|
+
color: import_editor_props21.colorPropTypeUtil.create("rgb(0,0,0)"),
|
|
2946
|
+
offset: import_editor_props21.numberPropTypeUtil.create(0)
|
|
2908
2947
|
}),
|
|
2909
|
-
|
|
2910
|
-
color:
|
|
2911
|
-
offset:
|
|
2948
|
+
import_editor_props21.colorStopPropTypeUtil.create({
|
|
2949
|
+
color: import_editor_props21.colorPropTypeUtil.create("rgb(255,255,255)"),
|
|
2950
|
+
offset: import_editor_props21.numberPropTypeUtil.create(100)
|
|
2912
2951
|
})
|
|
2913
2952
|
])
|
|
2914
2953
|
});
|
|
2915
2954
|
|
|
2916
2955
|
// src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-attachment.tsx
|
|
2917
|
-
var
|
|
2956
|
+
var React45 = __toESM(require("react"));
|
|
2918
2957
|
var import_icons14 = require("@elementor/icons");
|
|
2919
|
-
var
|
|
2958
|
+
var import_ui38 = require("@elementor/ui");
|
|
2920
2959
|
var import_i18n14 = require("@wordpress/i18n");
|
|
2921
2960
|
var attachmentControlOptions = [
|
|
2922
2961
|
{
|
|
2923
2962
|
value: "fixed",
|
|
2924
2963
|
label: (0, import_i18n14.__)("Fixed", "elementor"),
|
|
2925
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2964
|
+
renderContent: ({ size }) => /* @__PURE__ */ React45.createElement(import_icons14.PinIcon, { fontSize: size }),
|
|
2926
2965
|
showTooltip: true
|
|
2927
2966
|
},
|
|
2928
2967
|
{
|
|
2929
2968
|
value: "scroll",
|
|
2930
2969
|
label: (0, import_i18n14.__)("Scroll", "elementor"),
|
|
2931
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2970
|
+
renderContent: ({ size }) => /* @__PURE__ */ React45.createElement(import_icons14.PinnedOffIcon, { fontSize: size }),
|
|
2932
2971
|
showTooltip: true
|
|
2933
2972
|
}
|
|
2934
2973
|
];
|
|
2935
2974
|
var BackgroundImageOverlayAttachment = () => {
|
|
2936
|
-
return /* @__PURE__ */
|
|
2975
|
+
return /* @__PURE__ */ React45.createElement(PopoverGridContainer, null, /* @__PURE__ */ React45.createElement(import_ui38.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React45.createElement(ControlFormLabel, null, (0, import_i18n14.__)("Attachment", "elementor"))), /* @__PURE__ */ React45.createElement(import_ui38.Grid, { item: true, xs: 6, sx: { display: "flex", justifyContent: "flex-end", overflow: "hidden" } }, /* @__PURE__ */ React45.createElement(ToggleControl, { options: attachmentControlOptions })));
|
|
2937
2976
|
};
|
|
2938
2977
|
|
|
2939
2978
|
// src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-position.tsx
|
|
2940
|
-
var
|
|
2941
|
-
var
|
|
2942
|
-
var
|
|
2943
|
-
var
|
|
2979
|
+
var React46 = __toESM(require("react"));
|
|
2980
|
+
var import_react27 = require("react");
|
|
2981
|
+
var import_editor_props22 = require("@elementor/editor-props");
|
|
2982
|
+
var import_editor_ui7 = require("@elementor/editor-ui");
|
|
2944
2983
|
var import_icons15 = require("@elementor/icons");
|
|
2945
|
-
var
|
|
2984
|
+
var import_ui39 = require("@elementor/ui");
|
|
2946
2985
|
var import_i18n15 = require("@wordpress/i18n");
|
|
2947
2986
|
var backgroundPositionOptions = [
|
|
2948
2987
|
{ label: (0, import_i18n15.__)("Center center", "elementor"), value: "center center" },
|
|
@@ -2957,10 +2996,10 @@ var backgroundPositionOptions = [
|
|
|
2957
2996
|
{ label: (0, import_i18n15.__)("Custom", "elementor"), value: "custom" }
|
|
2958
2997
|
];
|
|
2959
2998
|
var BackgroundImageOverlayPosition = () => {
|
|
2960
|
-
const backgroundImageOffsetContext = useBoundProp(
|
|
2961
|
-
const stringPropContext = useBoundProp(
|
|
2999
|
+
const backgroundImageOffsetContext = useBoundProp(import_editor_props22.backgroundImagePositionOffsetPropTypeUtil);
|
|
3000
|
+
const stringPropContext = useBoundProp(import_editor_props22.stringPropTypeUtil);
|
|
2962
3001
|
const isCustom = !!backgroundImageOffsetContext.value;
|
|
2963
|
-
const rowRef = (0,
|
|
3002
|
+
const rowRef = (0, import_react27.useRef)(null);
|
|
2964
3003
|
const handlePositionChange = (event) => {
|
|
2965
3004
|
const value = event.target.value || null;
|
|
2966
3005
|
if (value === "custom") {
|
|
@@ -2969,8 +3008,8 @@ var BackgroundImageOverlayPosition = () => {
|
|
|
2969
3008
|
stringPropContext.setValue(value);
|
|
2970
3009
|
}
|
|
2971
3010
|
};
|
|
2972
|
-
return /* @__PURE__ */
|
|
2973
|
-
|
|
3011
|
+
return /* @__PURE__ */ React46.createElement(import_ui39.Grid, { container: true, spacing: 1.5 }, /* @__PURE__ */ React46.createElement(import_ui39.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React46.createElement(PopoverGridContainer, null, /* @__PURE__ */ React46.createElement(import_ui39.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React46.createElement(ControlFormLabel, null, (0, import_i18n15.__)("Position", "elementor"))), /* @__PURE__ */ React46.createElement(import_ui39.Grid, { item: true, xs: 6, sx: { display: "flex", justifyContent: "flex-end", overflow: "hidden" } }, /* @__PURE__ */ React46.createElement(
|
|
3012
|
+
import_ui39.Select,
|
|
2974
3013
|
{
|
|
2975
3014
|
fullWidth: true,
|
|
2976
3015
|
size: "tiny",
|
|
@@ -2978,95 +3017,95 @@ var BackgroundImageOverlayPosition = () => {
|
|
|
2978
3017
|
disabled: stringPropContext.disabled,
|
|
2979
3018
|
value: (backgroundImageOffsetContext.value ? "custom" : stringPropContext.value) ?? ""
|
|
2980
3019
|
},
|
|
2981
|
-
backgroundPositionOptions.map(({ label, value }) => /* @__PURE__ */
|
|
2982
|
-
)))), isCustom ? /* @__PURE__ */
|
|
3020
|
+
backgroundPositionOptions.map(({ label, value }) => /* @__PURE__ */ React46.createElement(import_editor_ui7.MenuListItem, { key: value, value: value ?? "" }, label))
|
|
3021
|
+
)))), isCustom ? /* @__PURE__ */ React46.createElement(PropProvider, { ...backgroundImageOffsetContext }, /* @__PURE__ */ React46.createElement(import_ui39.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React46.createElement(import_ui39.Grid, { container: true, spacing: 1.5, ref: rowRef }, /* @__PURE__ */ React46.createElement(import_ui39.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React46.createElement(PropKeyProvider, { bind: "x" }, /* @__PURE__ */ React46.createElement(
|
|
2983
3022
|
SizeControl,
|
|
2984
3023
|
{
|
|
2985
|
-
startIcon: /* @__PURE__ */
|
|
3024
|
+
startIcon: /* @__PURE__ */ React46.createElement(import_icons15.LetterXIcon, { fontSize: "tiny" }),
|
|
2986
3025
|
anchorRef: rowRef
|
|
2987
3026
|
}
|
|
2988
|
-
))), /* @__PURE__ */
|
|
3027
|
+
))), /* @__PURE__ */ React46.createElement(import_ui39.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React46.createElement(PropKeyProvider, { bind: "y" }, /* @__PURE__ */ React46.createElement(
|
|
2989
3028
|
SizeControl,
|
|
2990
3029
|
{
|
|
2991
|
-
startIcon: /* @__PURE__ */
|
|
3030
|
+
startIcon: /* @__PURE__ */ React46.createElement(import_icons15.LetterYIcon, { fontSize: "tiny" }),
|
|
2992
3031
|
anchorRef: rowRef
|
|
2993
3032
|
}
|
|
2994
3033
|
)))))) : null);
|
|
2995
3034
|
};
|
|
2996
3035
|
|
|
2997
3036
|
// src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-repeat.tsx
|
|
2998
|
-
var
|
|
3037
|
+
var React47 = __toESM(require("react"));
|
|
2999
3038
|
var import_icons16 = require("@elementor/icons");
|
|
3000
|
-
var
|
|
3039
|
+
var import_ui40 = require("@elementor/ui");
|
|
3001
3040
|
var import_i18n16 = require("@wordpress/i18n");
|
|
3002
3041
|
var repeatControlOptions = [
|
|
3003
3042
|
{
|
|
3004
3043
|
value: "repeat",
|
|
3005
3044
|
label: (0, import_i18n16.__)("Repeat", "elementor"),
|
|
3006
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
3045
|
+
renderContent: ({ size }) => /* @__PURE__ */ React47.createElement(import_icons16.GridDotsIcon, { fontSize: size }),
|
|
3007
3046
|
showTooltip: true
|
|
3008
3047
|
},
|
|
3009
3048
|
{
|
|
3010
3049
|
value: "repeat-x",
|
|
3011
3050
|
label: (0, import_i18n16.__)("Repeat-x", "elementor"),
|
|
3012
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
3051
|
+
renderContent: ({ size }) => /* @__PURE__ */ React47.createElement(import_icons16.DotsHorizontalIcon, { fontSize: size }),
|
|
3013
3052
|
showTooltip: true
|
|
3014
3053
|
},
|
|
3015
3054
|
{
|
|
3016
3055
|
value: "repeat-y",
|
|
3017
3056
|
label: (0, import_i18n16.__)("Repeat-y", "elementor"),
|
|
3018
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
3057
|
+
renderContent: ({ size }) => /* @__PURE__ */ React47.createElement(import_icons16.DotsVerticalIcon, { fontSize: size }),
|
|
3019
3058
|
showTooltip: true
|
|
3020
3059
|
},
|
|
3021
3060
|
{
|
|
3022
3061
|
value: "no-repeat",
|
|
3023
3062
|
label: (0, import_i18n16.__)("No-repeat", "elementor"),
|
|
3024
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
3063
|
+
renderContent: ({ size }) => /* @__PURE__ */ React47.createElement(import_icons16.XIcon, { fontSize: size }),
|
|
3025
3064
|
showTooltip: true
|
|
3026
3065
|
}
|
|
3027
3066
|
];
|
|
3028
3067
|
var BackgroundImageOverlayRepeat = () => {
|
|
3029
|
-
return /* @__PURE__ */
|
|
3068
|
+
return /* @__PURE__ */ React47.createElement(PopoverGridContainer, null, /* @__PURE__ */ React47.createElement(import_ui40.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React47.createElement(ControlFormLabel, null, (0, import_i18n16.__)("Repeat", "elementor"))), /* @__PURE__ */ React47.createElement(import_ui40.Grid, { item: true, xs: 6, sx: { display: "flex", justifyContent: "flex-end" } }, /* @__PURE__ */ React47.createElement(ToggleControl, { options: repeatControlOptions })));
|
|
3030
3069
|
};
|
|
3031
3070
|
|
|
3032
3071
|
// src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-size.tsx
|
|
3033
|
-
var
|
|
3034
|
-
var
|
|
3035
|
-
var
|
|
3072
|
+
var React48 = __toESM(require("react"));
|
|
3073
|
+
var import_react28 = require("react");
|
|
3074
|
+
var import_editor_props23 = require("@elementor/editor-props");
|
|
3036
3075
|
var import_icons17 = require("@elementor/icons");
|
|
3037
|
-
var
|
|
3076
|
+
var import_ui41 = require("@elementor/ui");
|
|
3038
3077
|
var import_i18n17 = require("@wordpress/i18n");
|
|
3039
3078
|
var sizeControlOptions = [
|
|
3040
3079
|
{
|
|
3041
3080
|
value: "auto",
|
|
3042
3081
|
label: (0, import_i18n17.__)("Auto", "elementor"),
|
|
3043
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
3082
|
+
renderContent: ({ size }) => /* @__PURE__ */ React48.createElement(import_icons17.LetterAIcon, { fontSize: size }),
|
|
3044
3083
|
showTooltip: true
|
|
3045
3084
|
},
|
|
3046
3085
|
{
|
|
3047
3086
|
value: "cover",
|
|
3048
3087
|
label: (0, import_i18n17.__)("Cover", "elementor"),
|
|
3049
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
3088
|
+
renderContent: ({ size }) => /* @__PURE__ */ React48.createElement(import_icons17.ArrowsMaximizeIcon, { fontSize: size }),
|
|
3050
3089
|
showTooltip: true
|
|
3051
3090
|
},
|
|
3052
3091
|
{
|
|
3053
3092
|
value: "contain",
|
|
3054
3093
|
label: (0, import_i18n17.__)("Contain", "elementor"),
|
|
3055
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
3094
|
+
renderContent: ({ size }) => /* @__PURE__ */ React48.createElement(import_icons17.ArrowBarBothIcon, { fontSize: size }),
|
|
3056
3095
|
showTooltip: true
|
|
3057
3096
|
},
|
|
3058
3097
|
{
|
|
3059
3098
|
value: "custom",
|
|
3060
3099
|
label: (0, import_i18n17.__)("Custom", "elementor"),
|
|
3061
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
3100
|
+
renderContent: ({ size }) => /* @__PURE__ */ React48.createElement(import_icons17.PencilIcon, { fontSize: size }),
|
|
3062
3101
|
showTooltip: true
|
|
3063
3102
|
}
|
|
3064
3103
|
];
|
|
3065
3104
|
var BackgroundImageOverlaySize = () => {
|
|
3066
|
-
const backgroundImageScaleContext = useBoundProp(
|
|
3067
|
-
const stringPropContext = useBoundProp(
|
|
3105
|
+
const backgroundImageScaleContext = useBoundProp(import_editor_props23.backgroundImageSizeScalePropTypeUtil);
|
|
3106
|
+
const stringPropContext = useBoundProp(import_editor_props23.stringPropTypeUtil);
|
|
3068
3107
|
const isCustom = !!backgroundImageScaleContext.value;
|
|
3069
|
-
const rowRef = (0,
|
|
3108
|
+
const rowRef = (0, import_react28.useRef)(null);
|
|
3070
3109
|
const handleSizeChange = (size) => {
|
|
3071
3110
|
if (size === "custom") {
|
|
3072
3111
|
backgroundImageScaleContext.setValue({ width: null, height: null });
|
|
@@ -3074,7 +3113,7 @@ var BackgroundImageOverlaySize = () => {
|
|
|
3074
3113
|
stringPropContext.setValue(size);
|
|
3075
3114
|
}
|
|
3076
3115
|
};
|
|
3077
|
-
return /* @__PURE__ */
|
|
3116
|
+
return /* @__PURE__ */ React48.createElement(import_ui41.Grid, { container: true, spacing: 1.5 }, /* @__PURE__ */ React48.createElement(import_ui41.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React48.createElement(PopoverGridContainer, null, /* @__PURE__ */ React48.createElement(import_ui41.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React48.createElement(ControlFormLabel, null, (0, import_i18n17.__)("Size", "elementor"))), /* @__PURE__ */ React48.createElement(import_ui41.Grid, { item: true, xs: 6, sx: { display: "flex", justifyContent: "flex-end" } }, /* @__PURE__ */ React48.createElement(
|
|
3078
3117
|
ControlToggleButtonGroup,
|
|
3079
3118
|
{
|
|
3080
3119
|
exclusive: true,
|
|
@@ -3083,17 +3122,17 @@ var BackgroundImageOverlaySize = () => {
|
|
|
3083
3122
|
disabled: stringPropContext.disabled,
|
|
3084
3123
|
value: backgroundImageScaleContext.value ? "custom" : stringPropContext.value
|
|
3085
3124
|
}
|
|
3086
|
-
)))), isCustom ? /* @__PURE__ */
|
|
3125
|
+
)))), isCustom ? /* @__PURE__ */ React48.createElement(PropProvider, { ...backgroundImageScaleContext }, /* @__PURE__ */ React48.createElement(import_ui41.Grid, { item: true, xs: 12, ref: rowRef }, /* @__PURE__ */ React48.createElement(PopoverGridContainer, null, /* @__PURE__ */ React48.createElement(import_ui41.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React48.createElement(PropKeyProvider, { bind: "width" }, /* @__PURE__ */ React48.createElement(
|
|
3087
3126
|
SizeControl,
|
|
3088
3127
|
{
|
|
3089
|
-
startIcon: /* @__PURE__ */
|
|
3128
|
+
startIcon: /* @__PURE__ */ React48.createElement(import_icons17.ArrowsMoveHorizontalIcon, { fontSize: "tiny" }),
|
|
3090
3129
|
extendedOptions: ["auto"],
|
|
3091
3130
|
anchorRef: rowRef
|
|
3092
3131
|
}
|
|
3093
|
-
))), /* @__PURE__ */
|
|
3132
|
+
))), /* @__PURE__ */ React48.createElement(import_ui41.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React48.createElement(PropKeyProvider, { bind: "height" }, /* @__PURE__ */ React48.createElement(
|
|
3094
3133
|
SizeControl,
|
|
3095
3134
|
{
|
|
3096
|
-
startIcon: /* @__PURE__ */
|
|
3135
|
+
startIcon: /* @__PURE__ */ React48.createElement(import_icons17.ArrowsMoveVerticalIcon, { fontSize: "tiny" }),
|
|
3097
3136
|
extendedOptions: ["auto"],
|
|
3098
3137
|
anchorRef: rowRef
|
|
3099
3138
|
}
|
|
@@ -3101,17 +3140,17 @@ var BackgroundImageOverlaySize = () => {
|
|
|
3101
3140
|
};
|
|
3102
3141
|
|
|
3103
3142
|
// src/controls/background-control/background-overlay/use-background-tabs-history.ts
|
|
3104
|
-
var
|
|
3105
|
-
var
|
|
3106
|
-
var
|
|
3143
|
+
var import_react29 = require("react");
|
|
3144
|
+
var import_editor_props24 = require("@elementor/editor-props");
|
|
3145
|
+
var import_ui42 = require("@elementor/ui");
|
|
3107
3146
|
var useBackgroundTabsHistory = ({
|
|
3108
3147
|
color: initialBackgroundColorOverlay2,
|
|
3109
3148
|
image: initialBackgroundImageOverlay,
|
|
3110
3149
|
gradient: initialBackgroundGradientOverlay2
|
|
3111
3150
|
}) => {
|
|
3112
|
-
const { value: imageValue, setValue: setImageValue } = useBoundProp(
|
|
3113
|
-
const { value: colorValue, setValue: setColorValue } = useBoundProp(
|
|
3114
|
-
const { value: gradientValue, setValue: setGradientValue } = useBoundProp(
|
|
3151
|
+
const { value: imageValue, setValue: setImageValue } = useBoundProp(import_editor_props24.backgroundImageOverlayPropTypeUtil);
|
|
3152
|
+
const { value: colorValue, setValue: setColorValue } = useBoundProp(import_editor_props24.backgroundColorOverlayPropTypeUtil);
|
|
3153
|
+
const { value: gradientValue, setValue: setGradientValue } = useBoundProp(import_editor_props24.backgroundGradientOverlayPropTypeUtil);
|
|
3115
3154
|
const getCurrentOverlayType = () => {
|
|
3116
3155
|
if (colorValue) {
|
|
3117
3156
|
return "color";
|
|
@@ -3121,8 +3160,8 @@ var useBackgroundTabsHistory = ({
|
|
|
3121
3160
|
}
|
|
3122
3161
|
return "image";
|
|
3123
3162
|
};
|
|
3124
|
-
const { getTabsProps, getTabProps, getTabPanelProps } = (0,
|
|
3125
|
-
const valuesHistory = (0,
|
|
3163
|
+
const { getTabsProps, getTabProps, getTabPanelProps } = (0, import_ui42.useTabs)(getCurrentOverlayType());
|
|
3164
|
+
const valuesHistory = (0, import_react29.useRef)({
|
|
3126
3165
|
image: initialBackgroundImageOverlay,
|
|
3127
3166
|
color: initialBackgroundColorOverlay2,
|
|
3128
3167
|
gradient: initialBackgroundGradientOverlay2
|
|
@@ -3160,9 +3199,9 @@ var useBackgroundTabsHistory = ({
|
|
|
3160
3199
|
|
|
3161
3200
|
// src/controls/background-control/background-overlay/background-overlay-repeater-control.tsx
|
|
3162
3201
|
var DEFAULT_BACKGROUND_COLOR_OVERLAY_COLOR = "#00000033";
|
|
3163
|
-
var initialBackgroundColorOverlay =
|
|
3202
|
+
var initialBackgroundColorOverlay = import_editor_props25.backgroundColorOverlayPropTypeUtil.create(
|
|
3164
3203
|
{
|
|
3165
|
-
color:
|
|
3204
|
+
color: import_editor_props25.colorPropTypeUtil.create(DEFAULT_BACKGROUND_COLOR_OVERLAY_COLOR)
|
|
3166
3205
|
}
|
|
3167
3206
|
);
|
|
3168
3207
|
var getInitialBackgroundOverlay = () => ({
|
|
@@ -3196,8 +3235,8 @@ var backgroundResolutionOptions = [
|
|
|
3196
3235
|
{ label: (0, import_i18n18.__)("Full", "elementor"), value: "full" }
|
|
3197
3236
|
];
|
|
3198
3237
|
var BackgroundOverlayRepeaterControl = createControl(() => {
|
|
3199
|
-
const { propType, value: overlayValues, setValue, disabled } = useBoundProp(
|
|
3200
|
-
return /* @__PURE__ */
|
|
3238
|
+
const { propType, value: overlayValues, setValue, disabled } = useBoundProp(import_editor_props25.backgroundOverlayPropTypeUtil);
|
|
3239
|
+
return /* @__PURE__ */ React49.createElement(PropProvider, { propType, value: overlayValues, setValue, disabled }, /* @__PURE__ */ React49.createElement(
|
|
3201
3240
|
Repeater,
|
|
3202
3241
|
{
|
|
3203
3242
|
openOnAdd: true,
|
|
@@ -3206,44 +3245,44 @@ var BackgroundOverlayRepeaterControl = createControl(() => {
|
|
|
3206
3245
|
setValues: setValue,
|
|
3207
3246
|
label: (0, import_i18n18.__)("Overlay", "elementor"),
|
|
3208
3247
|
itemSettings: {
|
|
3209
|
-
Icon:
|
|
3210
|
-
Label:
|
|
3211
|
-
Content:
|
|
3248
|
+
Icon: ItemIcon3,
|
|
3249
|
+
Label: ItemLabel3,
|
|
3250
|
+
Content: ItemContent3,
|
|
3212
3251
|
initialValues: getInitialBackgroundOverlay()
|
|
3213
3252
|
}
|
|
3214
3253
|
}
|
|
3215
3254
|
));
|
|
3216
3255
|
});
|
|
3217
|
-
var
|
|
3218
|
-
return /* @__PURE__ */
|
|
3256
|
+
var ItemContent3 = ({ anchorEl = null, bind }) => {
|
|
3257
|
+
return /* @__PURE__ */ React49.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React49.createElement(Content3, { anchorEl }));
|
|
3219
3258
|
};
|
|
3220
|
-
var
|
|
3259
|
+
var Content3 = ({ anchorEl }) => {
|
|
3221
3260
|
const { getTabsProps, getTabProps, getTabPanelProps } = useBackgroundTabsHistory({
|
|
3222
3261
|
image: getInitialBackgroundOverlay().value,
|
|
3223
3262
|
color: initialBackgroundColorOverlay.value,
|
|
3224
3263
|
gradient: initialBackgroundGradientOverlay.value
|
|
3225
3264
|
});
|
|
3226
|
-
return /* @__PURE__ */
|
|
3227
|
-
|
|
3265
|
+
return /* @__PURE__ */ React49.createElement(import_ui43.Box, { sx: { width: "100%" } }, /* @__PURE__ */ React49.createElement(import_ui43.Box, { sx: { borderBottom: 1, borderColor: "divider" } }, /* @__PURE__ */ React49.createElement(
|
|
3266
|
+
import_ui43.Tabs,
|
|
3228
3267
|
{
|
|
3229
3268
|
size: "small",
|
|
3230
3269
|
variant: "fullWidth",
|
|
3231
3270
|
...getTabsProps(),
|
|
3232
3271
|
"aria-label": (0, import_i18n18.__)("Background Overlay", "elementor")
|
|
3233
3272
|
},
|
|
3234
|
-
/* @__PURE__ */
|
|
3235
|
-
/* @__PURE__ */
|
|
3236
|
-
/* @__PURE__ */
|
|
3237
|
-
)), /* @__PURE__ */
|
|
3273
|
+
/* @__PURE__ */ React49.createElement(import_ui43.Tab, { label: (0, import_i18n18.__)("Image", "elementor"), ...getTabProps("image") }),
|
|
3274
|
+
/* @__PURE__ */ React49.createElement(import_ui43.Tab, { label: (0, import_i18n18.__)("Gradient", "elementor"), ...getTabProps("gradient") }),
|
|
3275
|
+
/* @__PURE__ */ React49.createElement(import_ui43.Tab, { label: (0, import_i18n18.__)("Color", "elementor"), ...getTabProps("color") })
|
|
3276
|
+
)), /* @__PURE__ */ React49.createElement(import_ui43.TabPanel, { sx: { p: 1.5 }, ...getTabPanelProps("image") }, /* @__PURE__ */ React49.createElement(PopoverContent, null, /* @__PURE__ */ React49.createElement(ImageOverlayContent, null))), /* @__PURE__ */ React49.createElement(import_ui43.TabPanel, { sx: { p: 1.5 }, ...getTabPanelProps("gradient") }, /* @__PURE__ */ React49.createElement(BackgroundGradientColorControl, null)), /* @__PURE__ */ React49.createElement(import_ui43.TabPanel, { sx: { p: 1.5 }, ...getTabPanelProps("color") }, /* @__PURE__ */ React49.createElement(PopoverContent, null, /* @__PURE__ */ React49.createElement(ColorOverlayContent, { anchorEl }))));
|
|
3238
3277
|
};
|
|
3239
|
-
var
|
|
3278
|
+
var ItemIcon3 = ({ value }) => {
|
|
3240
3279
|
switch (value.$$type) {
|
|
3241
3280
|
case "background-image-overlay":
|
|
3242
|
-
return /* @__PURE__ */
|
|
3281
|
+
return /* @__PURE__ */ React49.createElement(ItemIconImage, { value });
|
|
3243
3282
|
case "background-color-overlay":
|
|
3244
|
-
return /* @__PURE__ */
|
|
3283
|
+
return /* @__PURE__ */ React49.createElement(ItemIconColor, { value });
|
|
3245
3284
|
case "background-gradient-overlay":
|
|
3246
|
-
return /* @__PURE__ */
|
|
3285
|
+
return /* @__PURE__ */ React49.createElement(ItemIconGradient, { value });
|
|
3247
3286
|
default:
|
|
3248
3287
|
return null;
|
|
3249
3288
|
}
|
|
@@ -3256,12 +3295,12 @@ var extractColorFrom = (prop) => {
|
|
|
3256
3295
|
};
|
|
3257
3296
|
var ItemIconColor = ({ value: prop }) => {
|
|
3258
3297
|
const color = extractColorFrom(prop);
|
|
3259
|
-
return /* @__PURE__ */
|
|
3298
|
+
return /* @__PURE__ */ React49.createElement(StyledUnstableColorIndicator, { size: "inherit", component: "span", value: color });
|
|
3260
3299
|
};
|
|
3261
3300
|
var ItemIconImage = ({ value }) => {
|
|
3262
3301
|
const { imageUrl } = useImage(value);
|
|
3263
|
-
return /* @__PURE__ */
|
|
3264
|
-
|
|
3302
|
+
return /* @__PURE__ */ React49.createElement(
|
|
3303
|
+
import_ui43.CardMedia,
|
|
3265
3304
|
{
|
|
3266
3305
|
image: imageUrl,
|
|
3267
3306
|
sx: (theme) => ({
|
|
@@ -3275,49 +3314,43 @@ var ItemIconImage = ({ value }) => {
|
|
|
3275
3314
|
};
|
|
3276
3315
|
var ItemIconGradient = ({ value }) => {
|
|
3277
3316
|
const gradient = getGradientValue(value);
|
|
3278
|
-
return /* @__PURE__ */
|
|
3317
|
+
return /* @__PURE__ */ React49.createElement(StyledUnstableColorIndicator, { size: "inherit", component: "span", value: gradient });
|
|
3279
3318
|
};
|
|
3280
|
-
var
|
|
3319
|
+
var ItemLabel3 = ({ value }) => {
|
|
3281
3320
|
switch (value.$$type) {
|
|
3282
3321
|
case "background-image-overlay":
|
|
3283
|
-
return /* @__PURE__ */
|
|
3322
|
+
return /* @__PURE__ */ React49.createElement(ItemLabelImage, { value });
|
|
3284
3323
|
case "background-color-overlay":
|
|
3285
|
-
return /* @__PURE__ */
|
|
3324
|
+
return /* @__PURE__ */ React49.createElement(ItemLabelColor, { value });
|
|
3286
3325
|
case "background-gradient-overlay":
|
|
3287
|
-
return /* @__PURE__ */
|
|
3326
|
+
return /* @__PURE__ */ React49.createElement(ItemLabelGradient, { value });
|
|
3288
3327
|
default:
|
|
3289
3328
|
return null;
|
|
3290
3329
|
}
|
|
3291
3330
|
};
|
|
3292
3331
|
var ItemLabelColor = ({ value: prop }) => {
|
|
3293
3332
|
const color = extractColorFrom(prop);
|
|
3294
|
-
return /* @__PURE__ */
|
|
3333
|
+
return /* @__PURE__ */ React49.createElement("span", null, color);
|
|
3295
3334
|
};
|
|
3296
3335
|
var ItemLabelImage = ({ value }) => {
|
|
3297
3336
|
const { imageTitle } = useImage(value);
|
|
3298
|
-
return /* @__PURE__ */
|
|
3337
|
+
return /* @__PURE__ */ React49.createElement("span", null, imageTitle);
|
|
3299
3338
|
};
|
|
3300
3339
|
var ItemLabelGradient = ({ value }) => {
|
|
3301
3340
|
if (value.value.type.value === "linear") {
|
|
3302
|
-
return /* @__PURE__ */
|
|
3341
|
+
return /* @__PURE__ */ React49.createElement("span", null, (0, import_i18n18.__)("Linear Gradient", "elementor"));
|
|
3303
3342
|
}
|
|
3304
|
-
return /* @__PURE__ */
|
|
3343
|
+
return /* @__PURE__ */ React49.createElement("span", null, (0, import_i18n18.__)("Radial Gradient", "elementor"));
|
|
3305
3344
|
};
|
|
3306
3345
|
var ColorOverlayContent = ({ anchorEl }) => {
|
|
3307
|
-
const propContext = useBoundProp(
|
|
3308
|
-
return /* @__PURE__ */
|
|
3346
|
+
const propContext = useBoundProp(import_editor_props25.backgroundColorOverlayPropTypeUtil);
|
|
3347
|
+
return /* @__PURE__ */ React49.createElement(PropProvider, { ...propContext }, /* @__PURE__ */ React49.createElement(PropKeyProvider, { bind: "color" }, /* @__PURE__ */ React49.createElement(ColorControl, { anchorEl })));
|
|
3309
3348
|
};
|
|
3310
3349
|
var ImageOverlayContent = () => {
|
|
3311
|
-
const propContext = useBoundProp(
|
|
3312
|
-
return /* @__PURE__ */
|
|
3313
|
-
ImageControl,
|
|
3314
|
-
{
|
|
3315
|
-
resolutionLabel: (0, import_i18n18.__)("Resolution", "elementor"),
|
|
3316
|
-
sizes: backgroundResolutionOptions
|
|
3317
|
-
}
|
|
3318
|
-
)))), /* @__PURE__ */ React48.createElement(PropKeyProvider, { bind: "position" }, /* @__PURE__ */ React48.createElement(BackgroundImageOverlayPosition, null)), /* @__PURE__ */ React48.createElement(PropKeyProvider, { bind: "repeat" }, /* @__PURE__ */ React48.createElement(BackgroundImageOverlayRepeat, null)), /* @__PURE__ */ React48.createElement(PropKeyProvider, { bind: "size" }, /* @__PURE__ */ React48.createElement(BackgroundImageOverlaySize, null)), /* @__PURE__ */ React48.createElement(PropKeyProvider, { bind: "attachment" }, /* @__PURE__ */ React48.createElement(BackgroundImageOverlayAttachment, null)));
|
|
3350
|
+
const propContext = useBoundProp(import_editor_props25.backgroundImageOverlayPropTypeUtil);
|
|
3351
|
+
return /* @__PURE__ */ React49.createElement(PropProvider, { ...propContext }, /* @__PURE__ */ React49.createElement(PropKeyProvider, { bind: "image" }, /* @__PURE__ */ React49.createElement(import_ui43.Grid, { container: true, spacing: 1, alignItems: "center" }, /* @__PURE__ */ React49.createElement(import_ui43.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React49.createElement(import_ui43.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React49.createElement(import_ui43.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React49.createElement(ControlFormLabel, null, (0, import_i18n18.__)("Resolution", "elementor"))), /* @__PURE__ */ React49.createElement(import_ui43.Grid, { item: true, xs: 6, sx: { overflow: "hidden" } }, /* @__PURE__ */ React49.createElement(ImageControl, { sizes: backgroundResolutionOptions })))))), /* @__PURE__ */ React49.createElement(PropKeyProvider, { bind: "position" }, /* @__PURE__ */ React49.createElement(BackgroundImageOverlayPosition, null)), /* @__PURE__ */ React49.createElement(PropKeyProvider, { bind: "repeat" }, /* @__PURE__ */ React49.createElement(BackgroundImageOverlayRepeat, null)), /* @__PURE__ */ React49.createElement(PropKeyProvider, { bind: "size" }, /* @__PURE__ */ React49.createElement(BackgroundImageOverlaySize, null)), /* @__PURE__ */ React49.createElement(PropKeyProvider, { bind: "attachment" }, /* @__PURE__ */ React49.createElement(BackgroundImageOverlayAttachment, null)));
|
|
3319
3352
|
};
|
|
3320
|
-
var StyledUnstableColorIndicator = (0,
|
|
3353
|
+
var StyledUnstableColorIndicator = (0, import_ui43.styled)(import_ui43.UnstableColorIndicator)(({ theme }) => ({
|
|
3321
3354
|
borderRadius: `${theme.shape.borderRadius / 2}px`
|
|
3322
3355
|
}));
|
|
3323
3356
|
var useImage = (image) => {
|
|
@@ -3352,23 +3385,243 @@ var getGradientValue = (value) => {
|
|
|
3352
3385
|
|
|
3353
3386
|
// src/controls/background-control/background-control.tsx
|
|
3354
3387
|
var BackgroundControl = createControl(() => {
|
|
3355
|
-
const propContext = useBoundProp(
|
|
3388
|
+
const propContext = useBoundProp(import_editor_props26.backgroundPropTypeUtil);
|
|
3356
3389
|
const isUsingNestedProps = (0, import_editor_v1_adapters4.isExperimentActive)("e_v_3_30");
|
|
3357
3390
|
const colorLabel = (0, import_i18n19.__)("Color", "elementor");
|
|
3358
|
-
return /* @__PURE__ */
|
|
3391
|
+
return /* @__PURE__ */ React50.createElement(PropProvider, { ...propContext }, /* @__PURE__ */ React50.createElement(PropKeyProvider, { bind: "background-overlay" }, /* @__PURE__ */ React50.createElement(BackgroundOverlayRepeaterControl, null)), /* @__PURE__ */ React50.createElement(PropKeyProvider, { bind: "color" }, /* @__PURE__ */ React50.createElement(import_ui44.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React50.createElement(import_ui44.Grid, { item: true, xs: 6 }, isUsingNestedProps ? /* @__PURE__ */ React50.createElement(ControlLabel, null, colorLabel) : /* @__PURE__ */ React50.createElement(ControlFormLabel, null, colorLabel)), /* @__PURE__ */ React50.createElement(import_ui44.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React50.createElement(ColorControl, null)))));
|
|
3359
3392
|
});
|
|
3360
3393
|
|
|
3361
3394
|
// src/controls/switch-control.tsx
|
|
3362
|
-
var
|
|
3363
|
-
var
|
|
3364
|
-
var
|
|
3395
|
+
var React51 = __toESM(require("react"));
|
|
3396
|
+
var import_editor_props27 = require("@elementor/editor-props");
|
|
3397
|
+
var import_ui45 = require("@elementor/ui");
|
|
3365
3398
|
var SwitchControl2 = createControl(() => {
|
|
3366
|
-
const { value, setValue, disabled } = useBoundProp(
|
|
3399
|
+
const { value, setValue, disabled } = useBoundProp(import_editor_props27.booleanPropTypeUtil);
|
|
3367
3400
|
const handleChange = (event) => {
|
|
3368
3401
|
setValue(event.target.checked);
|
|
3369
3402
|
};
|
|
3370
|
-
return /* @__PURE__ */
|
|
3403
|
+
return /* @__PURE__ */ React51.createElement("div", { style: { display: "flex", justifyContent: "flex-end" } }, /* @__PURE__ */ React51.createElement(import_ui45.Switch, { checked: !!value, onChange: handleChange, size: "small", disabled }));
|
|
3404
|
+
});
|
|
3405
|
+
|
|
3406
|
+
// src/controls/repeatable-control.tsx
|
|
3407
|
+
var React52 = __toESM(require("react"));
|
|
3408
|
+
var import_react31 = require("react");
|
|
3409
|
+
var import_editor_props28 = require("@elementor/editor-props");
|
|
3410
|
+
var import_ui46 = require("@elementor/ui");
|
|
3411
|
+
|
|
3412
|
+
// src/hooks/use-repeatable-control-context.ts
|
|
3413
|
+
var import_react30 = require("react");
|
|
3414
|
+
var RepeatableControlContext = (0, import_react30.createContext)(void 0);
|
|
3415
|
+
var useRepeatableControlContext = () => {
|
|
3416
|
+
const context = (0, import_react30.useContext)(RepeatableControlContext);
|
|
3417
|
+
if (!context) {
|
|
3418
|
+
throw new Error("useRepeatableControlContext must be used within RepeatableControl");
|
|
3419
|
+
}
|
|
3420
|
+
return context;
|
|
3421
|
+
};
|
|
3422
|
+
|
|
3423
|
+
// src/controls/repeatable-control.tsx
|
|
3424
|
+
var RepeatableControl = createControl(
|
|
3425
|
+
({
|
|
3426
|
+
repeaterLabel,
|
|
3427
|
+
childControlConfig,
|
|
3428
|
+
showDuplicate,
|
|
3429
|
+
showToggle,
|
|
3430
|
+
initialValues,
|
|
3431
|
+
patternLabel,
|
|
3432
|
+
placeholder
|
|
3433
|
+
}) => {
|
|
3434
|
+
const { propTypeUtil: childPropTypeUtil } = childControlConfig;
|
|
3435
|
+
if (!childPropTypeUtil) {
|
|
3436
|
+
return null;
|
|
3437
|
+
}
|
|
3438
|
+
const childArrayPropTypeUtil = (0, import_react31.useMemo)(
|
|
3439
|
+
() => (0, import_editor_props28.createArrayPropUtils)(childPropTypeUtil.key, childPropTypeUtil.schema),
|
|
3440
|
+
[childPropTypeUtil.key, childPropTypeUtil.schema]
|
|
3441
|
+
);
|
|
3442
|
+
const { propType, value, setValue } = useBoundProp(childArrayPropTypeUtil);
|
|
3443
|
+
const ItemLabel4 = ({ value: itemValue }) => {
|
|
3444
|
+
const pattern = patternLabel || "";
|
|
3445
|
+
const finalLabel = interpolate(pattern, itemValue.value);
|
|
3446
|
+
if (finalLabel) {
|
|
3447
|
+
return /* @__PURE__ */ React52.createElement("span", null, finalLabel);
|
|
3448
|
+
}
|
|
3449
|
+
return /* @__PURE__ */ React52.createElement(import_ui46.Box, { component: "span", color: "text.tertiary" }, placeholder);
|
|
3450
|
+
};
|
|
3451
|
+
return /* @__PURE__ */ React52.createElement(PropProvider, { propType, value, setValue }, /* @__PURE__ */ React52.createElement(RepeatableControlContext.Provider, { value: childControlConfig }, /* @__PURE__ */ React52.createElement(
|
|
3452
|
+
Repeater,
|
|
3453
|
+
{
|
|
3454
|
+
openOnAdd: true,
|
|
3455
|
+
values: value ?? [],
|
|
3456
|
+
setValues: setValue,
|
|
3457
|
+
label: repeaterLabel,
|
|
3458
|
+
isSortable: false,
|
|
3459
|
+
itemSettings: {
|
|
3460
|
+
Icon: ItemIcon4,
|
|
3461
|
+
Label: ItemLabel4,
|
|
3462
|
+
Content: ItemContent4,
|
|
3463
|
+
initialValues: childPropTypeUtil.create(initialValues || null)
|
|
3464
|
+
},
|
|
3465
|
+
showDuplicate,
|
|
3466
|
+
showToggle
|
|
3467
|
+
}
|
|
3468
|
+
)));
|
|
3469
|
+
}
|
|
3470
|
+
);
|
|
3471
|
+
var ItemContent4 = ({ bind }) => {
|
|
3472
|
+
return /* @__PURE__ */ React52.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React52.createElement(Content4, null));
|
|
3473
|
+
};
|
|
3474
|
+
var ItemIcon4 = () => /* @__PURE__ */ React52.createElement(React52.Fragment, null);
|
|
3475
|
+
var Content4 = () => {
|
|
3476
|
+
const { component: ChildControl, props = {} } = useRepeatableControlContext();
|
|
3477
|
+
return /* @__PURE__ */ React52.createElement(PopoverContent, { p: 1.5 }, /* @__PURE__ */ React52.createElement(PopoverGridContainer, null, /* @__PURE__ */ React52.createElement(ChildControl, { ...props })));
|
|
3478
|
+
};
|
|
3479
|
+
var interpolate = (template, data) => {
|
|
3480
|
+
if (Object.values(data).some((value) => value.value === "" || value === "")) {
|
|
3481
|
+
return null;
|
|
3482
|
+
}
|
|
3483
|
+
return new Function(...Object.keys(data), `return \`${template}\`;`)(...Object.values(data));
|
|
3484
|
+
};
|
|
3485
|
+
|
|
3486
|
+
// src/controls/key-value-control.tsx
|
|
3487
|
+
var React53 = __toESM(require("react"));
|
|
3488
|
+
var import_react32 = require("react");
|
|
3489
|
+
var import_editor_props29 = require("@elementor/editor-props");
|
|
3490
|
+
var import_ui47 = require("@elementor/ui");
|
|
3491
|
+
var import_i18n20 = require("@wordpress/i18n");
|
|
3492
|
+
var KeyValueControl = createControl((props = {}) => {
|
|
3493
|
+
const { value, setValue } = useBoundProp(import_editor_props29.keyValuePropTypeUtil);
|
|
3494
|
+
const [keyError, setKeyError] = (0, import_react32.useState)(null);
|
|
3495
|
+
const [valueError, setValueError] = (0, import_react32.useState)(null);
|
|
3496
|
+
const [sessionState, setSessionState] = (0, import_react32.useState)({
|
|
3497
|
+
key: value?.key?.value || "",
|
|
3498
|
+
value: value?.value?.value || ""
|
|
3499
|
+
});
|
|
3500
|
+
const keyLabel = props.keyName || (0, import_i18n20.__)("Key", "elementor");
|
|
3501
|
+
const valueLabel = props.valueName || (0, import_i18n20.__)("Value", "elementor");
|
|
3502
|
+
const [keyRegex, valueRegex, errMsg] = (0, import_react32.useMemo)(
|
|
3503
|
+
() => [
|
|
3504
|
+
props.regexKey ? new RegExp(props.regexKey) : void 0,
|
|
3505
|
+
props.regexValue ? new RegExp(props.regexValue) : void 0,
|
|
3506
|
+
props.validationErrorMessage || (0, import_i18n20.__)("Invalid Format", "elementor")
|
|
3507
|
+
],
|
|
3508
|
+
[props.regexKey, props.regexValue, props.validationErrorMessage]
|
|
3509
|
+
);
|
|
3510
|
+
const validate = (newValue, fieldType) => {
|
|
3511
|
+
if (fieldType === "key" && keyRegex) {
|
|
3512
|
+
const isValid = keyRegex.test(newValue);
|
|
3513
|
+
setKeyError(isValid ? null : errMsg);
|
|
3514
|
+
return isValid;
|
|
3515
|
+
} else if (fieldType === "value" && valueRegex) {
|
|
3516
|
+
const isValid = valueRegex.test(newValue);
|
|
3517
|
+
setValueError(isValid ? null : errMsg);
|
|
3518
|
+
return isValid;
|
|
3519
|
+
}
|
|
3520
|
+
return true;
|
|
3521
|
+
};
|
|
3522
|
+
const handleChange = (event, fieldType) => {
|
|
3523
|
+
const newValue = event.target.value;
|
|
3524
|
+
setSessionState((prev) => ({
|
|
3525
|
+
...prev,
|
|
3526
|
+
[fieldType]: newValue
|
|
3527
|
+
}));
|
|
3528
|
+
if (validate(newValue, fieldType)) {
|
|
3529
|
+
setValue({
|
|
3530
|
+
...value,
|
|
3531
|
+
[fieldType]: {
|
|
3532
|
+
value: newValue,
|
|
3533
|
+
$$type: "string"
|
|
3534
|
+
}
|
|
3535
|
+
});
|
|
3536
|
+
} else {
|
|
3537
|
+
setValue({
|
|
3538
|
+
...value,
|
|
3539
|
+
[fieldType]: {
|
|
3540
|
+
value: "",
|
|
3541
|
+
$$type: "string"
|
|
3542
|
+
}
|
|
3543
|
+
});
|
|
3544
|
+
}
|
|
3545
|
+
};
|
|
3546
|
+
const isKeyInvalid = keyError !== null;
|
|
3547
|
+
const isValueInvalid = valueError !== null;
|
|
3548
|
+
return /* @__PURE__ */ React53.createElement(ControlActions, null, /* @__PURE__ */ React53.createElement(import_ui47.Grid, { container: true, gap: 1.5 }, /* @__PURE__ */ React53.createElement(import_ui47.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React53.createElement(import_ui47.FormLabel, { size: "tiny" }, keyLabel), /* @__PURE__ */ React53.createElement(
|
|
3549
|
+
import_ui47.TextField,
|
|
3550
|
+
{
|
|
3551
|
+
autoFocus: true,
|
|
3552
|
+
sx: { pt: 1 },
|
|
3553
|
+
size: "tiny",
|
|
3554
|
+
fullWidth: true,
|
|
3555
|
+
value: sessionState.key,
|
|
3556
|
+
onChange: (e) => handleChange(e, "key"),
|
|
3557
|
+
error: isKeyInvalid
|
|
3558
|
+
}
|
|
3559
|
+
), isKeyInvalid && /* @__PURE__ */ React53.createElement(import_ui47.FormHelperText, { error: true }, keyError)), /* @__PURE__ */ React53.createElement(import_ui47.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React53.createElement(import_ui47.FormLabel, { size: "tiny" }, valueLabel), /* @__PURE__ */ React53.createElement(
|
|
3560
|
+
import_ui47.TextField,
|
|
3561
|
+
{
|
|
3562
|
+
sx: { pt: 1 },
|
|
3563
|
+
size: "tiny",
|
|
3564
|
+
fullWidth: true,
|
|
3565
|
+
value: sessionState.value,
|
|
3566
|
+
onChange: (e) => handleChange(e, "value"),
|
|
3567
|
+
disabled: isKeyInvalid,
|
|
3568
|
+
error: isValueInvalid
|
|
3569
|
+
}
|
|
3570
|
+
), isValueInvalid && /* @__PURE__ */ React53.createElement(import_ui47.FormHelperText, { error: true }, valueError))));
|
|
3371
3571
|
});
|
|
3572
|
+
|
|
3573
|
+
// src/controls/position-control.tsx
|
|
3574
|
+
var React54 = __toESM(require("react"));
|
|
3575
|
+
var import_react33 = require("react");
|
|
3576
|
+
var import_editor_props30 = require("@elementor/editor-props");
|
|
3577
|
+
var import_editor_ui8 = require("@elementor/editor-ui");
|
|
3578
|
+
var import_editor_v1_adapters5 = require("@elementor/editor-v1-adapters");
|
|
3579
|
+
var import_icons18 = require("@elementor/icons");
|
|
3580
|
+
var import_ui48 = require("@elementor/ui");
|
|
3581
|
+
var import_i18n21 = require("@wordpress/i18n");
|
|
3582
|
+
var positionOptions = [
|
|
3583
|
+
{ label: (0, import_i18n21.__)("Center center", "elementor"), value: "center center" },
|
|
3584
|
+
{ label: (0, import_i18n21.__)("Center left", "elementor"), value: "center left" },
|
|
3585
|
+
{ label: (0, import_i18n21.__)("Center right", "elementor"), value: "center right" },
|
|
3586
|
+
{ label: (0, import_i18n21.__)("Top center", "elementor"), value: "top center" },
|
|
3587
|
+
{ label: (0, import_i18n21.__)("Top left", "elementor"), value: "top left" },
|
|
3588
|
+
{ label: (0, import_i18n21.__)("Top right", "elementor"), value: "top right" },
|
|
3589
|
+
{ label: (0, import_i18n21.__)("Bottom center", "elementor"), value: "bottom center" },
|
|
3590
|
+
{ label: (0, import_i18n21.__)("Bottom left", "elementor"), value: "bottom left" },
|
|
3591
|
+
{ label: (0, import_i18n21.__)("Bottom right", "elementor"), value: "bottom right" }
|
|
3592
|
+
];
|
|
3593
|
+
var PositionControl = () => {
|
|
3594
|
+
const positionContext = useBoundProp(import_editor_props30.positionPropTypeUtil);
|
|
3595
|
+
const stringPropContext = useBoundProp(import_editor_props30.stringPropTypeUtil);
|
|
3596
|
+
const isVersion331Active = (0, import_editor_v1_adapters5.isExperimentActive)("e_v_3_31");
|
|
3597
|
+
const isCustom = !!positionContext.value && isVersion331Active;
|
|
3598
|
+
const availablePositionOptions = (0, import_react33.useMemo)(() => {
|
|
3599
|
+
const options = [...positionOptions];
|
|
3600
|
+
if (isVersion331Active) {
|
|
3601
|
+
options.push({ label: (0, import_i18n21.__)("Custom", "elementor"), value: "custom" });
|
|
3602
|
+
}
|
|
3603
|
+
return options;
|
|
3604
|
+
}, [isVersion331Active]);
|
|
3605
|
+
const handlePositionChange = (event) => {
|
|
3606
|
+
const value = event.target.value || null;
|
|
3607
|
+
if (value === "custom" && isVersion331Active) {
|
|
3608
|
+
positionContext.setValue({ x: null, y: null });
|
|
3609
|
+
} else {
|
|
3610
|
+
stringPropContext.setValue(value);
|
|
3611
|
+
}
|
|
3612
|
+
};
|
|
3613
|
+
return /* @__PURE__ */ React54.createElement(import_ui48.Grid, { container: true, spacing: 1.5 }, /* @__PURE__ */ React54.createElement(import_ui48.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React54.createElement(import_ui48.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React54.createElement(import_ui48.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React54.createElement(ControlFormLabel, null, (0, import_i18n21.__)("Object position", "elementor"))), /* @__PURE__ */ React54.createElement(import_ui48.Grid, { item: true, xs: 6, sx: { overflow: "hidden" } }, /* @__PURE__ */ React54.createElement(
|
|
3614
|
+
import_ui48.Select,
|
|
3615
|
+
{
|
|
3616
|
+
size: "tiny",
|
|
3617
|
+
disabled: stringPropContext.disabled,
|
|
3618
|
+
value: (positionContext.value ? "custom" : stringPropContext.value) ?? "",
|
|
3619
|
+
onChange: handlePositionChange,
|
|
3620
|
+
fullWidth: true
|
|
3621
|
+
},
|
|
3622
|
+
availablePositionOptions.map(({ label, value }) => /* @__PURE__ */ React54.createElement(import_editor_ui8.MenuListItem, { key: value, value: value ?? "" }, label))
|
|
3623
|
+
)))), isCustom && /* @__PURE__ */ React54.createElement(PropProvider, { ...positionContext }, /* @__PURE__ */ React54.createElement(import_ui48.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React54.createElement(import_ui48.Grid, { container: true, spacing: 1.5 }, /* @__PURE__ */ React54.createElement(import_ui48.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React54.createElement(PropKeyProvider, { bind: "x" }, /* @__PURE__ */ React54.createElement(SizeControl, { startIcon: /* @__PURE__ */ React54.createElement(import_icons18.LetterXIcon, { fontSize: "tiny" }) }))), /* @__PURE__ */ React54.createElement(import_ui48.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React54.createElement(PropKeyProvider, { bind: "y" }, /* @__PURE__ */ React54.createElement(SizeControl, { startIcon: /* @__PURE__ */ React54.createElement(import_icons18.LetterYIcon, { fontSize: "tiny" }) })))))));
|
|
3624
|
+
};
|
|
3372
3625
|
// Annotate the CommonJS export names for ESM import in node:
|
|
3373
3626
|
0 && (module.exports = {
|
|
3374
3627
|
AspectRatioControl,
|
|
@@ -3382,15 +3635,20 @@ var SwitchControl2 = createControl(() => {
|
|
|
3382
3635
|
ControlReplacementsProvider,
|
|
3383
3636
|
ControlToggleButtonGroup,
|
|
3384
3637
|
EqualUnequalSizesControl,
|
|
3638
|
+
FilterRepeaterControl,
|
|
3385
3639
|
FontFamilyControl,
|
|
3386
3640
|
FontFamilySelector,
|
|
3387
3641
|
GapControl,
|
|
3388
3642
|
ImageControl,
|
|
3643
|
+
KeyValueControl,
|
|
3389
3644
|
LinkControl,
|
|
3390
3645
|
LinkedDimensionsControl,
|
|
3391
3646
|
NumberControl,
|
|
3647
|
+
PopoverContent,
|
|
3648
|
+
PositionControl,
|
|
3392
3649
|
PropKeyProvider,
|
|
3393
3650
|
PropProvider,
|
|
3651
|
+
RepeatableControl,
|
|
3394
3652
|
SelectControl,
|
|
3395
3653
|
SizeControl,
|
|
3396
3654
|
StrokeControl,
|