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