@elementor/editor-controls 1.2.0 → 1.5.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 +66 -0
- package/dist/index.d.mts +20 -8
- package/dist/index.d.ts +20 -8
- package/dist/index.js +1092 -714
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +937 -549
- package/dist/index.mjs.map +1 -1
- package/package.json +7 -7
- package/src/bound-prop-context/prop-context.tsx +3 -3
- package/src/bound-prop-context/prop-key-context.tsx +1 -0
- package/src/bound-prop-context/use-bound-prop.ts +5 -1
- package/src/components/font-family-selector.tsx +54 -56
- package/src/components/repeater.tsx +22 -11
- package/src/components/size-control/size-input.tsx +4 -4
- package/src/components/text-field-popover.tsx +19 -18
- package/src/controls/background-control/background-overlay/background-overlay-repeater-control.tsx +3 -15
- package/src/controls/box-shadow-repeater-control.tsx +1 -1
- package/src/controls/color-control.tsx +12 -1
- package/src/controls/equal-unequal-sizes-control.tsx +1 -1
- package/src/controls/filter-control/drop-shadow-item-content.tsx +69 -0
- package/src/controls/filter-control/drop-shadow-item-label.tsx +20 -0
- package/src/controls/filter-repeater-control.tsx +108 -21
- package/src/controls/font-family-control/font-family-control.tsx +14 -2
- package/src/controls/image-control.tsx +45 -16
- package/src/controls/key-value-control.tsx +57 -46
- package/src/controls/link-control.tsx +25 -20
- package/src/controls/linked-dimensions-control.tsx +1 -1
- package/src/controls/repeatable-control.tsx +100 -21
- package/src/controls/select-control.tsx +22 -2
- package/src/controls/size-control.tsx +25 -12
- package/src/controls/switch-control.tsx +9 -1
- package/src/controls/text-control.tsx +33 -18
- package/src/controls/transform-control/functions/axis-row.tsx +32 -0
- package/src/controls/transform-control/functions/move.tsx +44 -0
- package/src/controls/transform-control/transform-content.tsx +36 -0
- package/src/controls/transform-control/transform-icon.tsx +12 -0
- package/src/controls/transform-control/transform-label.tsx +27 -0
- package/src/controls/transform-control/transform-repeater-control.tsx +42 -0
- package/src/hooks/use-repeatable-control-context.ts +6 -1
- package/src/index.ts +1 -0
- package/src/utils/size-control.ts +4 -2
package/dist/index.js
CHANGED
|
@@ -59,10 +59,11 @@ __export(index_exports, {
|
|
|
59
59
|
SizeControl: () => SizeControl,
|
|
60
60
|
StrokeControl: () => StrokeControl,
|
|
61
61
|
SvgMediaControl: () => SvgMediaControl,
|
|
62
|
-
SwitchControl: () =>
|
|
62
|
+
SwitchControl: () => SwitchControl,
|
|
63
63
|
TextAreaControl: () => TextAreaControl,
|
|
64
64
|
TextControl: () => TextControl,
|
|
65
65
|
ToggleControl: () => ToggleControl,
|
|
66
|
+
TransformRepeaterControl: () => TransformRepeaterControl,
|
|
66
67
|
UrlControl: () => UrlControl,
|
|
67
68
|
createControlReplacementsRegistry: () => createControlReplacementsRegistry,
|
|
68
69
|
injectIntoRepeaterItemIcon: () => injectIntoRepeaterItemIcon,
|
|
@@ -74,9 +75,10 @@ __export(index_exports, {
|
|
|
74
75
|
module.exports = __toCommonJS(index_exports);
|
|
75
76
|
|
|
76
77
|
// src/controls/image-control.tsx
|
|
77
|
-
var
|
|
78
|
+
var React10 = __toESM(require("react"));
|
|
78
79
|
var import_editor_props3 = require("@elementor/editor-props");
|
|
79
|
-
var
|
|
80
|
+
var import_ui6 = require("@elementor/ui");
|
|
81
|
+
var import_i18n2 = require("@wordpress/i18n");
|
|
80
82
|
|
|
81
83
|
// src/bound-prop-context/prop-context.tsx
|
|
82
84
|
var React = __toESM(require("react"));
|
|
@@ -105,7 +107,7 @@ var PropProvider = ({
|
|
|
105
107
|
setValue,
|
|
106
108
|
propType,
|
|
107
109
|
placeholder,
|
|
108
|
-
|
|
110
|
+
isDisabled
|
|
109
111
|
}) => {
|
|
110
112
|
return /* @__PURE__ */ React.createElement(
|
|
111
113
|
PropContext.Provider,
|
|
@@ -115,7 +117,7 @@ var PropProvider = ({
|
|
|
115
117
|
propType,
|
|
116
118
|
setValue,
|
|
117
119
|
placeholder,
|
|
118
|
-
|
|
120
|
+
isDisabled
|
|
119
121
|
}
|
|
120
122
|
},
|
|
121
123
|
children
|
|
@@ -205,8 +207,9 @@ var import_react3 = require("react");
|
|
|
205
207
|
function useBoundProp(propTypeUtil) {
|
|
206
208
|
const propKeyContext = usePropKeyContext();
|
|
207
209
|
const { isValid, validate, restoreValue } = useValidation(propKeyContext.propType);
|
|
210
|
+
const disabled = propKeyContext.isDisabled?.(propKeyContext.propType);
|
|
208
211
|
if (!propTypeUtil) {
|
|
209
|
-
return propKeyContext;
|
|
212
|
+
return { ...propKeyContext, disabled };
|
|
210
213
|
}
|
|
211
214
|
function setValue(value2, options, meta) {
|
|
212
215
|
if (!validate(value2)) {
|
|
@@ -226,7 +229,8 @@ function useBoundProp(propTypeUtil) {
|
|
|
226
229
|
setValue,
|
|
227
230
|
value: isValid ? value : null,
|
|
228
231
|
restoreValue,
|
|
229
|
-
placeholder
|
|
232
|
+
placeholder,
|
|
233
|
+
disabled
|
|
230
234
|
};
|
|
231
235
|
}
|
|
232
236
|
var useValidation = (propType) => {
|
|
@@ -258,16 +262,23 @@ var resolveUnionPropType = (propType, key) => {
|
|
|
258
262
|
return resolvedPropType;
|
|
259
263
|
};
|
|
260
264
|
|
|
261
|
-
// src/
|
|
262
|
-
var
|
|
265
|
+
// src/components/control-form-label.tsx
|
|
266
|
+
var React3 = __toESM(require("react"));
|
|
263
267
|
var import_ui = require("@elementor/ui");
|
|
268
|
+
var ControlFormLabel = (props) => {
|
|
269
|
+
return /* @__PURE__ */ React3.createElement(import_ui.FormLabel, { size: "tiny", ...props });
|
|
270
|
+
};
|
|
271
|
+
|
|
272
|
+
// src/create-control.tsx
|
|
273
|
+
var React5 = __toESM(require("react"));
|
|
274
|
+
var import_ui2 = require("@elementor/ui");
|
|
264
275
|
|
|
265
276
|
// src/control-replacements.tsx
|
|
266
|
-
var
|
|
277
|
+
var React4 = __toESM(require("react"));
|
|
267
278
|
var import_react4 = require("react");
|
|
268
279
|
var ControlReplacementContext = (0, import_react4.createContext)([]);
|
|
269
280
|
var ControlReplacementsProvider = ({ replacements, children }) => {
|
|
270
|
-
return /* @__PURE__ */
|
|
281
|
+
return /* @__PURE__ */ React4.createElement(ControlReplacementContext.Provider, { value: replacements }, children);
|
|
271
282
|
};
|
|
272
283
|
var useControlReplacement = (OriginalComponent) => {
|
|
273
284
|
const { value } = useBoundProp();
|
|
@@ -295,7 +306,7 @@ var brandSymbol = Symbol("control");
|
|
|
295
306
|
function createControl(Control5) {
|
|
296
307
|
return (props) => {
|
|
297
308
|
const Component = useControlReplacement(Control5);
|
|
298
|
-
return /* @__PURE__ */
|
|
309
|
+
return /* @__PURE__ */ React5.createElement(import_ui2.ErrorBoundary, { fallback: null }, /* @__PURE__ */ React5.createElement(Component, { ...props }));
|
|
299
310
|
};
|
|
300
311
|
}
|
|
301
312
|
|
|
@@ -339,22 +350,22 @@ var formatResponse = (response) => {
|
|
|
339
350
|
};
|
|
340
351
|
|
|
341
352
|
// src/controls/image-media-control.tsx
|
|
342
|
-
var
|
|
353
|
+
var React8 = __toESM(require("react"));
|
|
343
354
|
var import_editor_props = require("@elementor/editor-props");
|
|
344
355
|
var import_icons = require("@elementor/icons");
|
|
345
|
-
var
|
|
356
|
+
var import_ui4 = require("@elementor/ui");
|
|
346
357
|
var import_wp_media = require("@elementor/wp-media");
|
|
347
358
|
var import_i18n = require("@wordpress/i18n");
|
|
348
359
|
|
|
349
360
|
// src/control-actions/control-actions.tsx
|
|
350
|
-
var
|
|
351
|
-
var
|
|
361
|
+
var React7 = __toESM(require("react"));
|
|
362
|
+
var import_ui3 = require("@elementor/ui");
|
|
352
363
|
|
|
353
364
|
// src/control-actions/control-actions-context.tsx
|
|
354
|
-
var
|
|
365
|
+
var React6 = __toESM(require("react"));
|
|
355
366
|
var import_react5 = require("react");
|
|
356
367
|
var Context = (0, import_react5.createContext)(null);
|
|
357
|
-
var ControlActionsProvider = ({ children, items }) => /* @__PURE__ */
|
|
368
|
+
var ControlActionsProvider = ({ children, items: items2 }) => /* @__PURE__ */ React6.createElement(Context.Provider, { value: { items: items2 } }, children);
|
|
358
369
|
var useControlActions = () => {
|
|
359
370
|
const context = (0, import_react5.useContext)(Context);
|
|
360
371
|
if (!context) {
|
|
@@ -364,7 +375,7 @@ var useControlActions = () => {
|
|
|
364
375
|
};
|
|
365
376
|
|
|
366
377
|
// src/control-actions/control-actions.tsx
|
|
367
|
-
var FloatingBarContainer = (0,
|
|
378
|
+
var FloatingBarContainer = (0, import_ui3.styled)("span")`
|
|
368
379
|
display: contents;
|
|
369
380
|
|
|
370
381
|
.MuiFloatingActionBar-popper:has( .MuiFloatingActionBar-actions:empty ) {
|
|
@@ -376,13 +387,13 @@ var FloatingBarContainer = (0, import_ui2.styled)("span")`
|
|
|
376
387
|
}
|
|
377
388
|
`;
|
|
378
389
|
function ControlActions({ children }) {
|
|
379
|
-
const { items } = useControlActions();
|
|
390
|
+
const { items: items2 } = useControlActions();
|
|
380
391
|
const { disabled } = useBoundProp();
|
|
381
|
-
if (
|
|
392
|
+
if (items2.length === 0 || disabled) {
|
|
382
393
|
return children;
|
|
383
394
|
}
|
|
384
|
-
const menuItems =
|
|
385
|
-
return /* @__PURE__ */
|
|
395
|
+
const menuItems = items2.map(({ MenuItem: MenuItem2, id }) => /* @__PURE__ */ React7.createElement(MenuItem2, { key: id }));
|
|
396
|
+
return /* @__PURE__ */ React7.createElement(FloatingBarContainer, null, /* @__PURE__ */ React7.createElement(import_ui3.UnstableFloatingActionBar, { actions: menuItems }, children));
|
|
386
397
|
}
|
|
387
398
|
|
|
388
399
|
// src/controls/image-media-control.tsx
|
|
@@ -405,8 +416,8 @@ var ImageMediaControl = createControl(({ mediaTypes = ["image"] }) => {
|
|
|
405
416
|
});
|
|
406
417
|
}
|
|
407
418
|
});
|
|
408
|
-
return /* @__PURE__ */
|
|
409
|
-
|
|
419
|
+
return /* @__PURE__ */ React8.createElement(ControlActions, null, /* @__PURE__ */ React8.createElement(import_ui4.Card, { variant: "outlined" }, /* @__PURE__ */ React8.createElement(import_ui4.CardMedia, { image: src, sx: { height: 150 } }, isFetching ? /* @__PURE__ */ React8.createElement(import_ui4.Stack, { justifyContent: "center", alignItems: "center", width: "100%", height: "100%" }, /* @__PURE__ */ React8.createElement(import_ui4.CircularProgress, null)) : /* @__PURE__ */ React8.createElement(React8.Fragment, null)), /* @__PURE__ */ React8.createElement(import_ui4.CardOverlay, null, /* @__PURE__ */ React8.createElement(import_ui4.Stack, { gap: 1 }, /* @__PURE__ */ React8.createElement(
|
|
420
|
+
import_ui4.Button,
|
|
410
421
|
{
|
|
411
422
|
size: "tiny",
|
|
412
423
|
color: "inherit",
|
|
@@ -414,13 +425,13 @@ var ImageMediaControl = createControl(({ mediaTypes = ["image"] }) => {
|
|
|
414
425
|
onClick: () => open({ mode: "browse" })
|
|
415
426
|
},
|
|
416
427
|
(0, import_i18n.__)("Select image", "elementor")
|
|
417
|
-
), /* @__PURE__ */
|
|
418
|
-
|
|
428
|
+
), /* @__PURE__ */ React8.createElement(
|
|
429
|
+
import_ui4.Button,
|
|
419
430
|
{
|
|
420
431
|
size: "tiny",
|
|
421
432
|
variant: "text",
|
|
422
433
|
color: "inherit",
|
|
423
|
-
startIcon: /* @__PURE__ */
|
|
434
|
+
startIcon: /* @__PURE__ */ React8.createElement(import_icons.UploadIcon, null),
|
|
424
435
|
onClick: () => open({ mode: "upload" })
|
|
425
436
|
},
|
|
426
437
|
(0, import_i18n.__)("Upload", "elementor")
|
|
@@ -428,71 +439,112 @@ var ImageMediaControl = createControl(({ mediaTypes = ["image"] }) => {
|
|
|
428
439
|
});
|
|
429
440
|
|
|
430
441
|
// src/controls/select-control.tsx
|
|
431
|
-
var
|
|
442
|
+
var React9 = __toESM(require("react"));
|
|
432
443
|
var import_editor_props2 = require("@elementor/editor-props");
|
|
433
444
|
var import_editor_ui = require("@elementor/editor-ui");
|
|
434
|
-
var
|
|
445
|
+
var import_ui5 = require("@elementor/ui");
|
|
435
446
|
var SelectControl = createControl(({ options, onChange }) => {
|
|
436
|
-
const { value, setValue, disabled } = useBoundProp(import_editor_props2.stringPropTypeUtil);
|
|
447
|
+
const { value, setValue, disabled, placeholder } = useBoundProp(import_editor_props2.stringPropTypeUtil);
|
|
437
448
|
const handleChange = (event) => {
|
|
438
449
|
const newValue = event.target.value || null;
|
|
439
450
|
onChange?.(newValue, value);
|
|
440
451
|
setValue(newValue);
|
|
441
452
|
};
|
|
442
|
-
return /* @__PURE__ */
|
|
443
|
-
|
|
453
|
+
return /* @__PURE__ */ React9.createElement(ControlActions, null, /* @__PURE__ */ React9.createElement(
|
|
454
|
+
import_ui5.Select,
|
|
444
455
|
{
|
|
445
456
|
sx: { overflow: "hidden" },
|
|
446
457
|
displayEmpty: true,
|
|
447
458
|
size: "tiny",
|
|
459
|
+
renderValue: (selectedValue) => {
|
|
460
|
+
const findOptionByValue = (searchValue) => options.find((opt) => opt.value === searchValue);
|
|
461
|
+
if (!selectedValue || selectedValue === "") {
|
|
462
|
+
if (placeholder) {
|
|
463
|
+
const placeholderOption = findOptionByValue(placeholder);
|
|
464
|
+
const displayText = placeholderOption?.label || placeholder;
|
|
465
|
+
return /* @__PURE__ */ React9.createElement(import_ui5.Typography, { component: "span", variant: "caption", color: "text.tertiary" }, displayText);
|
|
466
|
+
}
|
|
467
|
+
return "";
|
|
468
|
+
}
|
|
469
|
+
const option = findOptionByValue(selectedValue);
|
|
470
|
+
return option?.label || selectedValue;
|
|
471
|
+
},
|
|
448
472
|
value: value ?? "",
|
|
449
473
|
onChange: handleChange,
|
|
450
474
|
disabled,
|
|
451
475
|
fullWidth: true
|
|
452
476
|
},
|
|
453
|
-
options.map(({ label, ...props }) => /* @__PURE__ */
|
|
477
|
+
options.map(({ label, ...props }) => /* @__PURE__ */ React9.createElement(import_editor_ui.MenuListItem, { key: props.value, ...props, value: props.value ?? "" }, label))
|
|
454
478
|
));
|
|
455
479
|
});
|
|
456
480
|
|
|
457
481
|
// src/controls/image-control.tsx
|
|
458
482
|
var ImageControl = createControl(({ sizes, showMode = "all" }) => {
|
|
459
483
|
const propContext = useBoundProp(import_editor_props3.imagePropTypeUtil);
|
|
484
|
+
let componentToRender;
|
|
485
|
+
switch (showMode) {
|
|
486
|
+
case "media":
|
|
487
|
+
componentToRender = /* @__PURE__ */ React10.createElement(ImageSrcControl, null);
|
|
488
|
+
break;
|
|
489
|
+
case "sizes":
|
|
490
|
+
componentToRender = /* @__PURE__ */ React10.createElement(ImageSizeControl, { sizes });
|
|
491
|
+
break;
|
|
492
|
+
case "all":
|
|
493
|
+
default:
|
|
494
|
+
componentToRender = /* @__PURE__ */ React10.createElement(import_ui6.Stack, { gap: 1.5 }, /* @__PURE__ */ React10.createElement(ControlFormLabel, null, (0, import_i18n2.__)("Image", "elementor")), /* @__PURE__ */ React10.createElement(ImageSrcControl, null), /* @__PURE__ */ React10.createElement(import_ui6.Grid, { container: true, gap: 1.5, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React10.createElement(import_ui6.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React10.createElement(ControlFormLabel, null, (0, import_i18n2.__)("Resolution", "elementor"))), /* @__PURE__ */ React10.createElement(import_ui6.Grid, { item: true, xs: 6, sx: { overflow: "hidden" } }, /* @__PURE__ */ React10.createElement(ImageSizeControl, { sizes }))));
|
|
495
|
+
}
|
|
496
|
+
return /* @__PURE__ */ React10.createElement(PropProvider, { ...propContext }, componentToRender);
|
|
497
|
+
});
|
|
498
|
+
var ImageSrcControl = () => {
|
|
460
499
|
const { data: allowSvgUpload } = useUnfilteredFilesUpload();
|
|
461
500
|
const mediaTypes = allowSvgUpload ? ["image", "svg"] : ["image"];
|
|
462
|
-
return /* @__PURE__ */
|
|
463
|
-
}
|
|
501
|
+
return /* @__PURE__ */ React10.createElement(PropKeyProvider, { bind: "src" }, /* @__PURE__ */ React10.createElement(ImageMediaControl, { mediaTypes }));
|
|
502
|
+
};
|
|
503
|
+
var ImageSizeControl = ({ sizes }) => {
|
|
504
|
+
return /* @__PURE__ */ React10.createElement(PropKeyProvider, { bind: "size" }, /* @__PURE__ */ React10.createElement(SelectControl, { options: sizes }));
|
|
505
|
+
};
|
|
464
506
|
|
|
465
507
|
// src/controls/text-control.tsx
|
|
466
|
-
var
|
|
508
|
+
var React11 = __toESM(require("react"));
|
|
467
509
|
var import_editor_props4 = require("@elementor/editor-props");
|
|
468
|
-
var
|
|
469
|
-
var TextControl = createControl(
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
510
|
+
var import_ui7 = require("@elementor/ui");
|
|
511
|
+
var TextControl = createControl(
|
|
512
|
+
({
|
|
513
|
+
placeholder,
|
|
514
|
+
error,
|
|
515
|
+
inputValue,
|
|
516
|
+
inputDisabled,
|
|
517
|
+
sx
|
|
518
|
+
}) => {
|
|
519
|
+
const { value, setValue, disabled } = useBoundProp(import_editor_props4.stringPropTypeUtil);
|
|
520
|
+
const handleChange = (event) => setValue(event.target.value);
|
|
521
|
+
return /* @__PURE__ */ React11.createElement(ControlActions, null, /* @__PURE__ */ React11.createElement(
|
|
522
|
+
import_ui7.TextField,
|
|
523
|
+
{
|
|
524
|
+
size: "tiny",
|
|
525
|
+
fullWidth: true,
|
|
526
|
+
disabled: inputDisabled ?? disabled,
|
|
527
|
+
value: inputValue ?? value ?? "",
|
|
528
|
+
onChange: handleChange,
|
|
529
|
+
placeholder,
|
|
530
|
+
error,
|
|
531
|
+
sx
|
|
532
|
+
}
|
|
533
|
+
));
|
|
534
|
+
}
|
|
535
|
+
);
|
|
484
536
|
|
|
485
537
|
// src/controls/text-area-control.tsx
|
|
486
|
-
var
|
|
538
|
+
var React12 = __toESM(require("react"));
|
|
487
539
|
var import_editor_props5 = require("@elementor/editor-props");
|
|
488
|
-
var
|
|
540
|
+
var import_ui8 = require("@elementor/ui");
|
|
489
541
|
var TextAreaControl = createControl(({ placeholder }) => {
|
|
490
542
|
const { value, setValue, disabled } = useBoundProp(import_editor_props5.stringPropTypeUtil);
|
|
491
543
|
const handleChange = (event) => {
|
|
492
544
|
setValue(event.target.value);
|
|
493
545
|
};
|
|
494
|
-
return /* @__PURE__ */
|
|
495
|
-
|
|
546
|
+
return /* @__PURE__ */ React12.createElement(ControlActions, null, /* @__PURE__ */ React12.createElement(
|
|
547
|
+
import_ui8.TextField,
|
|
496
548
|
{
|
|
497
549
|
size: "tiny",
|
|
498
550
|
multiline: true,
|
|
@@ -507,17 +559,17 @@ var TextAreaControl = createControl(({ placeholder }) => {
|
|
|
507
559
|
});
|
|
508
560
|
|
|
509
561
|
// src/controls/size-control.tsx
|
|
510
|
-
var
|
|
562
|
+
var React16 = __toESM(require("react"));
|
|
511
563
|
var import_react10 = require("react");
|
|
512
564
|
var import_editor_props6 = require("@elementor/editor-props");
|
|
513
565
|
var import_editor_responsive = require("@elementor/editor-responsive");
|
|
514
|
-
var
|
|
566
|
+
var import_ui12 = require("@elementor/ui");
|
|
515
567
|
|
|
516
568
|
// src/components/size-control/size-input.tsx
|
|
517
|
-
var
|
|
569
|
+
var React14 = __toESM(require("react"));
|
|
518
570
|
var import_react7 = require("react");
|
|
519
571
|
var import_icons2 = require("@elementor/icons");
|
|
520
|
-
var
|
|
572
|
+
var import_ui10 = require("@elementor/ui");
|
|
521
573
|
|
|
522
574
|
// src/utils/size-control.ts
|
|
523
575
|
var defaultUnits = ["px", "%", "em", "rem", "vw", "vh"];
|
|
@@ -527,10 +579,10 @@ function isUnitExtendedOption(unit) {
|
|
|
527
579
|
}
|
|
528
580
|
|
|
529
581
|
// src/components/size-control/text-field-inner-selection.tsx
|
|
530
|
-
var
|
|
582
|
+
var React13 = __toESM(require("react"));
|
|
531
583
|
var import_react6 = require("react");
|
|
532
584
|
var import_editor_ui2 = require("@elementor/editor-ui");
|
|
533
|
-
var
|
|
585
|
+
var import_ui9 = require("@elementor/ui");
|
|
534
586
|
var TextFieldInnerSelection = (0, import_react6.forwardRef)(
|
|
535
587
|
({
|
|
536
588
|
placeholder,
|
|
@@ -544,8 +596,8 @@ var TextFieldInnerSelection = (0, import_react6.forwardRef)(
|
|
|
544
596
|
inputProps,
|
|
545
597
|
disabled
|
|
546
598
|
}, ref) => {
|
|
547
|
-
return /* @__PURE__ */
|
|
548
|
-
|
|
599
|
+
return /* @__PURE__ */ React13.createElement(
|
|
600
|
+
import_ui9.TextField,
|
|
549
601
|
{
|
|
550
602
|
ref,
|
|
551
603
|
sx: { input: { cursor: shouldBlockInput ? "default !important" : void 0 } },
|
|
@@ -572,7 +624,7 @@ var SelectionEndAdornment = ({
|
|
|
572
624
|
menuItemsAttributes = {},
|
|
573
625
|
disabled
|
|
574
626
|
}) => {
|
|
575
|
-
const popupState = (0,
|
|
627
|
+
const popupState = (0, import_ui9.usePopupState)({
|
|
576
628
|
variant: "popover",
|
|
577
629
|
popupId: (0, import_react6.useId)()
|
|
578
630
|
});
|
|
@@ -580,17 +632,17 @@ var SelectionEndAdornment = ({
|
|
|
580
632
|
onClick(options[index]);
|
|
581
633
|
popupState.close();
|
|
582
634
|
};
|
|
583
|
-
return /* @__PURE__ */
|
|
584
|
-
|
|
635
|
+
return /* @__PURE__ */ React13.createElement(import_ui9.InputAdornment, { position: "end" }, /* @__PURE__ */ React13.createElement(
|
|
636
|
+
import_ui9.Button,
|
|
585
637
|
{
|
|
586
638
|
size: "small",
|
|
587
639
|
color: "secondary",
|
|
588
640
|
disabled,
|
|
589
641
|
sx: { font: "inherit", minWidth: "initial", textTransform: "uppercase" },
|
|
590
|
-
...(0,
|
|
642
|
+
...(0, import_ui9.bindTrigger)(popupState)
|
|
591
643
|
},
|
|
592
644
|
alternativeOptionLabels[value] ?? value
|
|
593
|
-
), /* @__PURE__ */
|
|
645
|
+
), /* @__PURE__ */ React13.createElement(import_ui9.Menu, { MenuListProps: { dense: true }, ...(0, import_ui9.bindMenu)(popupState) }, options.map((option, index) => /* @__PURE__ */ React13.createElement(
|
|
594
646
|
import_editor_ui2.MenuListItem,
|
|
595
647
|
{
|
|
596
648
|
key: option,
|
|
@@ -643,8 +695,8 @@ var SizeInput = ({
|
|
|
643
695
|
autoComplete: "off",
|
|
644
696
|
onClick,
|
|
645
697
|
onFocus,
|
|
646
|
-
startAdornment: startIcon ? /* @__PURE__ */
|
|
647
|
-
endAdornment: /* @__PURE__ */
|
|
698
|
+
startAdornment: startIcon ? /* @__PURE__ */ React14.createElement(import_ui10.InputAdornment, { position: "start", disabled }, startIcon) : void 0,
|
|
699
|
+
endAdornment: /* @__PURE__ */ React14.createElement(
|
|
648
700
|
SelectionEndAdornment,
|
|
649
701
|
{
|
|
650
702
|
disabled,
|
|
@@ -652,7 +704,7 @@ var SizeInput = ({
|
|
|
652
704
|
onClick: handleUnitChange,
|
|
653
705
|
value: unit,
|
|
654
706
|
alternativeOptionLabels: {
|
|
655
|
-
custom: /* @__PURE__ */
|
|
707
|
+
custom: /* @__PURE__ */ React14.createElement(import_icons2.PencilIcon, { fontSize: "small" })
|
|
656
708
|
},
|
|
657
709
|
menuItemsAttributes: units2.includes("custom") ? {
|
|
658
710
|
custom: popupAttributes
|
|
@@ -660,7 +712,7 @@ var SizeInput = ({
|
|
|
660
712
|
}
|
|
661
713
|
)
|
|
662
714
|
};
|
|
663
|
-
return /* @__PURE__ */
|
|
715
|
+
return /* @__PURE__ */ React14.createElement(ControlActions, null, /* @__PURE__ */ React14.createElement(import_ui10.Box, null, /* @__PURE__ */ React14.createElement(
|
|
664
716
|
TextFieldInnerSelection,
|
|
665
717
|
{
|
|
666
718
|
disabled,
|
|
@@ -682,15 +734,24 @@ var SizeInput = ({
|
|
|
682
734
|
};
|
|
683
735
|
|
|
684
736
|
// src/components/text-field-popover.tsx
|
|
685
|
-
var
|
|
686
|
-
var
|
|
737
|
+
var React15 = __toESM(require("react"));
|
|
738
|
+
var import_ui11 = require("@elementor/ui");
|
|
687
739
|
var TextFieldPopover = (props) => {
|
|
688
740
|
const { popupState, restoreValue, anchorRef, value, onChange } = props;
|
|
689
|
-
return /* @__PURE__ */
|
|
690
|
-
|
|
741
|
+
return /* @__PURE__ */ React15.createElement(
|
|
742
|
+
import_ui11.Popover,
|
|
691
743
|
{
|
|
692
744
|
disablePortal: true,
|
|
693
|
-
|
|
745
|
+
slotProps: {
|
|
746
|
+
paper: {
|
|
747
|
+
sx: {
|
|
748
|
+
borderRadius: 2,
|
|
749
|
+
width: anchorRef.current?.offsetWidth + "px",
|
|
750
|
+
p: 1.5
|
|
751
|
+
}
|
|
752
|
+
}
|
|
753
|
+
},
|
|
754
|
+
...(0, import_ui11.bindPopover)(popupState),
|
|
694
755
|
anchorOrigin: { vertical: "bottom", horizontal: "center" },
|
|
695
756
|
transformOrigin: { vertical: "top", horizontal: "center" },
|
|
696
757
|
onClose: () => {
|
|
@@ -698,28 +759,18 @@ var TextFieldPopover = (props) => {
|
|
|
698
759
|
popupState.close();
|
|
699
760
|
}
|
|
700
761
|
},
|
|
701
|
-
/* @__PURE__ */
|
|
702
|
-
|
|
762
|
+
/* @__PURE__ */ React15.createElement(
|
|
763
|
+
import_ui11.TextField,
|
|
703
764
|
{
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
import_ui10.TextField,
|
|
712
|
-
{
|
|
713
|
-
value,
|
|
714
|
-
onChange,
|
|
715
|
-
size: "tiny",
|
|
716
|
-
type: "text",
|
|
717
|
-
fullWidth: true,
|
|
718
|
-
inputProps: {
|
|
719
|
-
autoFocus: true
|
|
720
|
-
}
|
|
765
|
+
value,
|
|
766
|
+
onChange,
|
|
767
|
+
size: "tiny",
|
|
768
|
+
type: "text",
|
|
769
|
+
fullWidth: true,
|
|
770
|
+
inputProps: {
|
|
771
|
+
autoFocus: true
|
|
721
772
|
}
|
|
722
|
-
|
|
773
|
+
}
|
|
723
774
|
)
|
|
724
775
|
);
|
|
725
776
|
};
|
|
@@ -785,7 +836,7 @@ var SizeControl = createControl((props) => {
|
|
|
785
836
|
const [internalState, setInternalState] = (0, import_react10.useState)(createStateFromSizeProp(sizeValue, defaultUnit));
|
|
786
837
|
const activeBreakpoint = (0, import_editor_responsive.useActiveBreakpoint)();
|
|
787
838
|
const extendedOptions = useSizeExtendedOptions(props.extendedOptions || [], props.disableCustom ?? false);
|
|
788
|
-
const popupState = (0,
|
|
839
|
+
const popupState = (0, import_ui12.usePopupState)({ variant: "popover" });
|
|
789
840
|
const [state, setState] = useSyncExternalState({
|
|
790
841
|
external: internalState,
|
|
791
842
|
setExternal: (newState) => setSizeValue(extractValueFromState(newState)),
|
|
@@ -799,12 +850,12 @@ var SizeControl = createControl((props) => {
|
|
|
799
850
|
return !!newState?.numeric || newState?.numeric === 0;
|
|
800
851
|
},
|
|
801
852
|
fallback: (newState) => ({
|
|
802
|
-
unit: newState?.unit ??
|
|
853
|
+
unit: newState?.unit ?? defaultUnit,
|
|
803
854
|
numeric: newState?.numeric ?? DEFAULT_SIZE,
|
|
804
855
|
custom: newState?.custom ?? ""
|
|
805
856
|
})
|
|
806
857
|
});
|
|
807
|
-
const { size: controlSize = DEFAULT_SIZE, unit: controlUnit =
|
|
858
|
+
const { size: controlSize = DEFAULT_SIZE, unit: controlUnit = defaultUnit } = extractValueFromState(state) || {};
|
|
808
859
|
const handleUnitChange = (newUnit) => {
|
|
809
860
|
if (newUnit === "custom") {
|
|
810
861
|
popupState.open(anchorRef?.current);
|
|
@@ -834,9 +885,13 @@ var SizeControl = createControl((props) => {
|
|
|
834
885
|
}
|
|
835
886
|
};
|
|
836
887
|
(0, import_react10.useEffect)(() => {
|
|
837
|
-
const newState = createStateFromSizeProp(sizeValue, defaultUnit);
|
|
838
|
-
const
|
|
839
|
-
const mergedStates = {
|
|
888
|
+
const newState = createStateFromSizeProp(sizeValue, state.unit === "custom" ? state.unit : defaultUnit);
|
|
889
|
+
const currentUnitType = isUnitExtendedOption(state.unit) ? "custom" : "numeric";
|
|
890
|
+
const mergedStates = {
|
|
891
|
+
...state,
|
|
892
|
+
unit: newState.unit ?? state.unit,
|
|
893
|
+
[currentUnitType]: newState[currentUnitType]
|
|
894
|
+
};
|
|
840
895
|
if (mergedStates.unit !== "auto" && areStatesEqual(state, mergedStates)) {
|
|
841
896
|
return;
|
|
842
897
|
}
|
|
@@ -852,7 +907,7 @@ var SizeControl = createControl((props) => {
|
|
|
852
907
|
setState(newState);
|
|
853
908
|
}
|
|
854
909
|
}, [activeBreakpoint]);
|
|
855
|
-
return /* @__PURE__ */
|
|
910
|
+
return /* @__PURE__ */ React16.createElement(React16.Fragment, null, /* @__PURE__ */ React16.createElement(
|
|
856
911
|
SizeInput,
|
|
857
912
|
{
|
|
858
913
|
disabled,
|
|
@@ -868,7 +923,7 @@ var SizeControl = createControl((props) => {
|
|
|
868
923
|
onClick: onInputClick,
|
|
869
924
|
popupState
|
|
870
925
|
}
|
|
871
|
-
), anchorRef?.current && /* @__PURE__ */
|
|
926
|
+
), anchorRef?.current && /* @__PURE__ */ React16.createElement(
|
|
872
927
|
TextFieldPopover,
|
|
873
928
|
{
|
|
874
929
|
popupState,
|
|
@@ -925,14 +980,7 @@ var React19 = __toESM(require("react"));
|
|
|
925
980
|
var import_react11 = require("react");
|
|
926
981
|
var import_editor_props8 = require("@elementor/editor-props");
|
|
927
982
|
var import_ui15 = require("@elementor/ui");
|
|
928
|
-
var
|
|
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
|
-
};
|
|
983
|
+
var import_i18n3 = require("@wordpress/i18n");
|
|
936
984
|
|
|
937
985
|
// src/components/section-content.tsx
|
|
938
986
|
var React17 = __toESM(require("react"));
|
|
@@ -945,7 +993,8 @@ var import_editor_props7 = require("@elementor/editor-props");
|
|
|
945
993
|
var import_ui14 = require("@elementor/ui");
|
|
946
994
|
var ColorControl = createControl(
|
|
947
995
|
({ propTypeUtil = import_editor_props7.colorPropTypeUtil, anchorEl, slotProps = {}, ...props }) => {
|
|
948
|
-
const { value, setValue, disabled } = useBoundProp(propTypeUtil);
|
|
996
|
+
const { value, setValue, placeholder: boundPropPlaceholder, disabled } = useBoundProp(propTypeUtil);
|
|
997
|
+
const placeholder = props.placeholder ?? boundPropPlaceholder;
|
|
949
998
|
const handleChange = (selectedColor) => {
|
|
950
999
|
setValue(selectedColor || null);
|
|
951
1000
|
};
|
|
@@ -955,6 +1004,7 @@ var ColorControl = createControl(
|
|
|
955
1004
|
size: "tiny",
|
|
956
1005
|
fullWidth: true,
|
|
957
1006
|
value: value ?? "",
|
|
1007
|
+
placeholder: placeholder ?? "",
|
|
958
1008
|
onChange: handleChange,
|
|
959
1009
|
...props,
|
|
960
1010
|
disabled,
|
|
@@ -969,6 +1019,14 @@ var ColorControl = createControl(
|
|
|
969
1019
|
transformOrigin: {
|
|
970
1020
|
vertical: "top",
|
|
971
1021
|
horizontal: -10
|
|
1022
|
+
},
|
|
1023
|
+
slotProps: {
|
|
1024
|
+
colorIndicator: {
|
|
1025
|
+
value: value ?? placeholder ?? ""
|
|
1026
|
+
},
|
|
1027
|
+
colorBox: {
|
|
1028
|
+
value: value ?? placeholder ?? ""
|
|
1029
|
+
}
|
|
972
1030
|
}
|
|
973
1031
|
}
|
|
974
1032
|
}
|
|
@@ -982,7 +1040,7 @@ var units = ["px", "em", "rem"];
|
|
|
982
1040
|
var StrokeControl = createControl(() => {
|
|
983
1041
|
const propContext = useBoundProp(import_editor_props8.strokePropTypeUtil);
|
|
984
1042
|
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,
|
|
1043
|
+
return /* @__PURE__ */ React19.createElement(PropProvider, { ...propContext }, /* @__PURE__ */ React19.createElement(SectionContent, null, /* @__PURE__ */ React19.createElement(Control, { bind: "width", label: (0, import_i18n3.__)("Stroke width", "elementor"), ref: rowRef }, /* @__PURE__ */ React19.createElement(SizeControl, { units, anchorRef: rowRef })), /* @__PURE__ */ React19.createElement(Control, { bind: "color", label: (0, import_i18n3.__)("Stroke color", "elementor") }, /* @__PURE__ */ React19.createElement(ColorControl, null))));
|
|
986
1044
|
});
|
|
987
1045
|
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))));
|
|
988
1046
|
|
|
@@ -991,7 +1049,7 @@ var React26 = __toESM(require("react"));
|
|
|
991
1049
|
var import_react15 = require("react");
|
|
992
1050
|
var import_editor_props9 = require("@elementor/editor-props");
|
|
993
1051
|
var import_ui20 = require("@elementor/ui");
|
|
994
|
-
var
|
|
1052
|
+
var import_i18n5 = require("@wordpress/i18n");
|
|
995
1053
|
|
|
996
1054
|
// src/components/popover-content.tsx
|
|
997
1055
|
var React20 = __toESM(require("react"));
|
|
@@ -1011,7 +1069,7 @@ var React25 = __toESM(require("react"));
|
|
|
1011
1069
|
var import_react14 = require("react");
|
|
1012
1070
|
var import_icons4 = require("@elementor/icons");
|
|
1013
1071
|
var import_ui19 = require("@elementor/ui");
|
|
1014
|
-
var
|
|
1072
|
+
var import_i18n4 = require("@wordpress/i18n");
|
|
1015
1073
|
|
|
1016
1074
|
// src/control-adornments/control-adornments.tsx
|
|
1017
1075
|
var React23 = __toESM(require("react"));
|
|
@@ -1020,7 +1078,7 @@ var React23 = __toESM(require("react"));
|
|
|
1020
1078
|
var React22 = __toESM(require("react"));
|
|
1021
1079
|
var import_react13 = require("react");
|
|
1022
1080
|
var Context2 = (0, import_react13.createContext)(null);
|
|
1023
|
-
var ControlAdornmentsProvider = ({ children, items }) => /* @__PURE__ */ React22.createElement(Context2.Provider, { value: { items } }, children);
|
|
1081
|
+
var ControlAdornmentsProvider = ({ children, items: items2 }) => /* @__PURE__ */ React22.createElement(Context2.Provider, { value: { items: items2 } }, children);
|
|
1024
1082
|
var useControlAdornments = () => {
|
|
1025
1083
|
const context = (0, import_react13.useContext)(Context2);
|
|
1026
1084
|
return context?.items ?? [];
|
|
@@ -1028,11 +1086,11 @@ var useControlAdornments = () => {
|
|
|
1028
1086
|
|
|
1029
1087
|
// src/control-adornments/control-adornments.tsx
|
|
1030
1088
|
function ControlAdornments() {
|
|
1031
|
-
const
|
|
1032
|
-
if (
|
|
1089
|
+
const items2 = useControlAdornments();
|
|
1090
|
+
if (items2?.length === 0) {
|
|
1033
1091
|
return null;
|
|
1034
1092
|
}
|
|
1035
|
-
return /* @__PURE__ */ React23.createElement(React23.Fragment, null,
|
|
1093
|
+
return /* @__PURE__ */ React23.createElement(React23.Fragment, null, items2.map(({ Adornment, id }) => /* @__PURE__ */ React23.createElement(Adornment, { key: id })));
|
|
1036
1094
|
}
|
|
1037
1095
|
|
|
1038
1096
|
// src/locations.ts
|
|
@@ -1126,16 +1184,17 @@ var Repeater = ({
|
|
|
1126
1184
|
setValues: setRepeaterValues,
|
|
1127
1185
|
showDuplicate = true,
|
|
1128
1186
|
showToggle = true,
|
|
1129
|
-
isSortable = true
|
|
1187
|
+
isSortable = true,
|
|
1188
|
+
collectionPropUtil
|
|
1130
1189
|
}) => {
|
|
1131
1190
|
const [openItem, setOpenItem] = (0, import_react14.useState)(EMPTY_OPEN_ITEM);
|
|
1132
|
-
const [
|
|
1191
|
+
const [items2, setItems] = useSyncExternalState({
|
|
1133
1192
|
external: repeaterValues,
|
|
1134
1193
|
// @ts-expect-error - as long as persistWhen => true, value will never be null
|
|
1135
1194
|
setExternal: setRepeaterValues,
|
|
1136
1195
|
persistWhen: () => true
|
|
1137
1196
|
});
|
|
1138
|
-
const [uniqueKeys, setUniqueKeys] = (0, import_react14.useState)(
|
|
1197
|
+
const [uniqueKeys, setUniqueKeys] = (0, import_react14.useState)(items2.map((_, index) => index));
|
|
1139
1198
|
const generateNextKey = (source) => {
|
|
1140
1199
|
return 1 + Math.max(0, ...source);
|
|
1141
1200
|
};
|
|
@@ -1143,10 +1202,10 @@ var Repeater = ({
|
|
|
1143
1202
|
const newItem = structuredClone(itemSettings.initialValues);
|
|
1144
1203
|
const newKey = generateNextKey(uniqueKeys);
|
|
1145
1204
|
if (addToBottom) {
|
|
1146
|
-
setItems([...
|
|
1205
|
+
setItems([...items2, newItem]);
|
|
1147
1206
|
setUniqueKeys([...uniqueKeys, newKey]);
|
|
1148
1207
|
} else {
|
|
1149
|
-
setItems([newItem, ...
|
|
1208
|
+
setItems([newItem, ...items2]);
|
|
1150
1209
|
setUniqueKeys([newKey, ...uniqueKeys]);
|
|
1151
1210
|
}
|
|
1152
1211
|
if (openOnAdd) {
|
|
@@ -1154,10 +1213,10 @@ var Repeater = ({
|
|
|
1154
1213
|
}
|
|
1155
1214
|
};
|
|
1156
1215
|
const duplicateRepeaterItem = (index) => {
|
|
1157
|
-
const newItem = structuredClone(
|
|
1216
|
+
const newItem = structuredClone(items2[index]);
|
|
1158
1217
|
const newKey = generateNextKey(uniqueKeys);
|
|
1159
1218
|
const atPosition = 1 + index;
|
|
1160
|
-
setItems([...
|
|
1219
|
+
setItems([...items2.slice(0, atPosition), newItem, ...items2.slice(atPosition)]);
|
|
1161
1220
|
setUniqueKeys([...uniqueKeys.slice(0, atPosition), newKey, ...uniqueKeys.slice(atPosition)]);
|
|
1162
1221
|
};
|
|
1163
1222
|
const removeRepeaterItem = (index) => {
|
|
@@ -1167,14 +1226,14 @@ var Repeater = ({
|
|
|
1167
1226
|
})
|
|
1168
1227
|
);
|
|
1169
1228
|
setItems(
|
|
1170
|
-
|
|
1229
|
+
items2.filter((_, pos) => {
|
|
1171
1230
|
return pos !== index;
|
|
1172
1231
|
})
|
|
1173
1232
|
);
|
|
1174
1233
|
};
|
|
1175
1234
|
const toggleDisableRepeaterItem = (index) => {
|
|
1176
1235
|
setItems(
|
|
1177
|
-
|
|
1236
|
+
items2.map((value, pos) => {
|
|
1178
1237
|
if (pos === index) {
|
|
1179
1238
|
const { disabled: propDisabled, ...rest } = value;
|
|
1180
1239
|
return { ...rest, ...propDisabled ? {} : { disabled: true } };
|
|
@@ -1210,12 +1269,12 @@ var Repeater = ({
|
|
|
1210
1269
|
sx: { ml: "auto" },
|
|
1211
1270
|
disabled,
|
|
1212
1271
|
onClick: addRepeaterItem,
|
|
1213
|
-
"aria-label": (0,
|
|
1272
|
+
"aria-label": (0, import_i18n4.__)("Add item", "elementor")
|
|
1214
1273
|
},
|
|
1215
1274
|
/* @__PURE__ */ React25.createElement(import_icons4.PlusIcon, { fontSize: SIZE })
|
|
1216
1275
|
)
|
|
1217
1276
|
), 0 < uniqueKeys.length && /* @__PURE__ */ React25.createElement(SortableProvider, { value: uniqueKeys, onChange: onChangeOrder }, uniqueKeys.map((key, index) => {
|
|
1218
|
-
const value =
|
|
1277
|
+
const value = items2[index];
|
|
1219
1278
|
if (!value) {
|
|
1220
1279
|
return null;
|
|
1221
1280
|
}
|
|
@@ -1232,7 +1291,8 @@ var Repeater = ({
|
|
|
1232
1291
|
openOnMount: openOnAdd && openItem === key,
|
|
1233
1292
|
onOpen: () => setOpenItem(EMPTY_OPEN_ITEM),
|
|
1234
1293
|
showDuplicate,
|
|
1235
|
-
showToggle
|
|
1294
|
+
showToggle,
|
|
1295
|
+
collectionPropUtil
|
|
1236
1296
|
},
|
|
1237
1297
|
(props) => /* @__PURE__ */ React25.createElement(itemSettings.Content, { ...props, value, bind: String(index) })
|
|
1238
1298
|
));
|
|
@@ -1250,13 +1310,14 @@ var RepeaterItem = ({
|
|
|
1250
1310
|
onOpen,
|
|
1251
1311
|
showDuplicate,
|
|
1252
1312
|
showToggle,
|
|
1253
|
-
disabled
|
|
1313
|
+
disabled,
|
|
1314
|
+
collectionPropUtil
|
|
1254
1315
|
}) => {
|
|
1255
1316
|
const [anchorEl, setAnchorEl] = (0, import_react14.useState)(null);
|
|
1256
1317
|
const { popoverState, popoverProps, ref, setRef } = usePopover(openOnMount, onOpen);
|
|
1257
|
-
const duplicateLabel = (0,
|
|
1258
|
-
const toggleLabel = propDisabled ? (0,
|
|
1259
|
-
const removeLabel = (0,
|
|
1318
|
+
const duplicateLabel = (0, import_i18n4.__)("Duplicate", "elementor");
|
|
1319
|
+
const toggleLabel = propDisabled ? (0, import_i18n4.__)("Show", "elementor") : (0, import_i18n4.__)("Hide", "elementor");
|
|
1320
|
+
const removeLabel = (0, import_i18n4.__)("Remove", "elementor");
|
|
1260
1321
|
return /* @__PURE__ */ React25.createElement(React25.Fragment, null, /* @__PURE__ */ React25.createElement(
|
|
1261
1322
|
import_ui19.UnstableTag,
|
|
1262
1323
|
{
|
|
@@ -1266,7 +1327,7 @@ var RepeaterItem = ({
|
|
|
1266
1327
|
fullWidth: true,
|
|
1267
1328
|
ref: setRef,
|
|
1268
1329
|
variant: "outlined",
|
|
1269
|
-
"aria-label": (0,
|
|
1330
|
+
"aria-label": (0, import_i18n4.__)("Open item", "elementor"),
|
|
1270
1331
|
...(0, import_ui19.bindTrigger)(popoverState),
|
|
1271
1332
|
startIcon,
|
|
1272
1333
|
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 }))))
|
|
@@ -1285,7 +1346,7 @@ var RepeaterItem = ({
|
|
|
1285
1346
|
...popoverProps,
|
|
1286
1347
|
anchorEl: ref
|
|
1287
1348
|
},
|
|
1288
|
-
/* @__PURE__ */ React25.createElement(import_ui19.Box, null, children({ anchorEl }))
|
|
1349
|
+
/* @__PURE__ */ React25.createElement(import_ui19.Box, null, children({ anchorEl, collectionPropUtil }))
|
|
1289
1350
|
));
|
|
1290
1351
|
};
|
|
1291
1352
|
var usePopover = (openOnMount, onOpen) => {
|
|
@@ -1309,14 +1370,14 @@ var usePopover = (openOnMount, onOpen) => {
|
|
|
1309
1370
|
// src/controls/box-shadow-repeater-control.tsx
|
|
1310
1371
|
var BoxShadowRepeaterControl = createControl(() => {
|
|
1311
1372
|
const { propType, value, setValue, disabled } = useBoundProp(import_editor_props9.boxShadowPropTypeUtil);
|
|
1312
|
-
return /* @__PURE__ */ React26.createElement(PropProvider, { propType, value, setValue, disabled }, /* @__PURE__ */ React26.createElement(
|
|
1373
|
+
return /* @__PURE__ */ React26.createElement(PropProvider, { propType, value, setValue, isDisabled: () => disabled }, /* @__PURE__ */ React26.createElement(
|
|
1313
1374
|
Repeater,
|
|
1314
1375
|
{
|
|
1315
1376
|
openOnAdd: true,
|
|
1316
1377
|
disabled,
|
|
1317
1378
|
values: value ?? [],
|
|
1318
1379
|
setValues: setValue,
|
|
1319
|
-
label: (0,
|
|
1380
|
+
label: (0, import_i18n5.__)("Box shadow", "elementor"),
|
|
1320
1381
|
itemSettings: {
|
|
1321
1382
|
Icon: ItemIcon,
|
|
1322
1383
|
Label: ItemLabel,
|
|
@@ -1333,15 +1394,15 @@ var ItemContent = ({ anchorEl, bind }) => {
|
|
|
1333
1394
|
var Content = ({ anchorEl }) => {
|
|
1334
1395
|
const context = useBoundProp(import_editor_props9.shadowPropTypeUtil);
|
|
1335
1396
|
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,
|
|
1397
|
+
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_i18n5.__)("Color", "elementor") }, /* @__PURE__ */ React26.createElement(ColorControl, { anchorEl })), /* @__PURE__ */ React26.createElement(Control2, { bind: "position", label: (0, import_i18n5.__)("Position", "elementor"), sx: { overflow: "hidden" } }, /* @__PURE__ */ React26.createElement(
|
|
1337
1398
|
SelectControl,
|
|
1338
1399
|
{
|
|
1339
1400
|
options: [
|
|
1340
|
-
{ label: (0,
|
|
1341
|
-
{ label: (0,
|
|
1401
|
+
{ label: (0, import_i18n5.__)("Inset", "elementor"), value: "inset" },
|
|
1402
|
+
{ label: (0, import_i18n5.__)("Outset", "elementor"), value: null }
|
|
1342
1403
|
]
|
|
1343
1404
|
}
|
|
1344
|
-
))), /* @__PURE__ */ React26.createElement(PopoverGridContainer, { ref: rowRef[0] }, /* @__PURE__ */ React26.createElement(Control2, { bind: "hOffset", label: (0,
|
|
1405
|
+
))), /* @__PURE__ */ React26.createElement(PopoverGridContainer, { ref: rowRef[0] }, /* @__PURE__ */ React26.createElement(Control2, { bind: "hOffset", label: (0, import_i18n5.__)("Horizontal", "elementor") }, /* @__PURE__ */ React26.createElement(SizeControl, { anchorRef: rowRef[0] })), /* @__PURE__ */ React26.createElement(Control2, { bind: "vOffset", label: (0, import_i18n5.__)("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_i18n5.__)("Blur", "elementor") }, /* @__PURE__ */ React26.createElement(SizeControl, { anchorRef: rowRef[1] })), /* @__PURE__ */ React26.createElement(Control2, { bind: "spread", label: (0, import_i18n5.__)("Spread", "elementor") }, /* @__PURE__ */ React26.createElement(SizeControl, { anchorRef: rowRef[1] })))));
|
|
1345
1406
|
};
|
|
1346
1407
|
var Control2 = ({
|
|
1347
1408
|
label,
|
|
@@ -1392,12 +1453,13 @@ var initialShadow = {
|
|
|
1392
1453
|
};
|
|
1393
1454
|
|
|
1394
1455
|
// src/controls/filter-repeater-control.tsx
|
|
1395
|
-
var
|
|
1396
|
-
var
|
|
1456
|
+
var React30 = __toESM(require("react"));
|
|
1457
|
+
var import_react17 = require("react");
|
|
1397
1458
|
var import_editor_props10 = require("@elementor/editor-props");
|
|
1459
|
+
var import_editor_props11 = require("@elementor/editor-props");
|
|
1398
1460
|
var import_editor_ui3 = require("@elementor/editor-ui");
|
|
1399
|
-
var
|
|
1400
|
-
var
|
|
1461
|
+
var import_ui24 = require("@elementor/ui");
|
|
1462
|
+
var import_i18n7 = require("@wordpress/i18n");
|
|
1401
1463
|
|
|
1402
1464
|
// src/components/control-label.tsx
|
|
1403
1465
|
var React27 = __toESM(require("react"));
|
|
@@ -1406,39 +1468,145 @@ var ControlLabel = ({ children }) => {
|
|
|
1406
1468
|
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
1469
|
};
|
|
1408
1470
|
|
|
1471
|
+
// src/controls/filter-control/drop-shadow-item-content.tsx
|
|
1472
|
+
var React28 = __toESM(require("react"));
|
|
1473
|
+
var import_react16 = require("react");
|
|
1474
|
+
var import_ui22 = require("@elementor/ui");
|
|
1475
|
+
var import_i18n6 = require("@wordpress/i18n");
|
|
1476
|
+
var items = [
|
|
1477
|
+
{
|
|
1478
|
+
bind: "xAxis",
|
|
1479
|
+
label: (0, import_i18n6.__)("X-axis", "elementor"),
|
|
1480
|
+
rowIndex: 0
|
|
1481
|
+
},
|
|
1482
|
+
{
|
|
1483
|
+
bind: "yAxis",
|
|
1484
|
+
label: (0, import_i18n6.__)("Y-axis", "elementor"),
|
|
1485
|
+
rowIndex: 0
|
|
1486
|
+
},
|
|
1487
|
+
{
|
|
1488
|
+
bind: "blur",
|
|
1489
|
+
label: (0, import_i18n6.__)("Blur", "elementor"),
|
|
1490
|
+
rowIndex: 1
|
|
1491
|
+
},
|
|
1492
|
+
{
|
|
1493
|
+
bind: "color",
|
|
1494
|
+
label: (0, import_i18n6.__)("Color", "elementor"),
|
|
1495
|
+
rowIndex: 1
|
|
1496
|
+
}
|
|
1497
|
+
];
|
|
1498
|
+
var DropShadowItemContent = ({
|
|
1499
|
+
propType,
|
|
1500
|
+
units: units2,
|
|
1501
|
+
anchorEl
|
|
1502
|
+
}) => {
|
|
1503
|
+
const context = useBoundProp(propType);
|
|
1504
|
+
const rowRefs = [(0, import_react16.useRef)(null), (0, import_react16.useRef)(null)];
|
|
1505
|
+
return /* @__PURE__ */ React28.createElement(PropProvider, { ...context }, items.map((item) => /* @__PURE__ */ React28.createElement(PopoverGridContainer, { key: item.bind, ref: rowRefs[item.rowIndex] ?? null }, /* @__PURE__ */ React28.createElement(PropKeyProvider, { bind: item.bind }, /* @__PURE__ */ React28.createElement(import_ui22.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React28.createElement(ControlFormLabel, null, item.label)), /* @__PURE__ */ React28.createElement(import_ui22.Grid, { item: true, xs: 6 }, item.bind === "color" ? /* @__PURE__ */ React28.createElement(ColorControl, { anchorEl }) : /* @__PURE__ */ React28.createElement(SizeControl, { anchorRef: rowRefs[item.rowIndex], units: units2, defaultUnit: "px" }))))));
|
|
1506
|
+
};
|
|
1507
|
+
|
|
1508
|
+
// src/controls/filter-control/drop-shadow-item-label.tsx
|
|
1509
|
+
var React29 = __toESM(require("react"));
|
|
1510
|
+
var import_ui23 = require("@elementor/ui");
|
|
1511
|
+
var DropShadowItemLabel = ({ value }) => {
|
|
1512
|
+
const { xAxis, yAxis, blur } = value.value;
|
|
1513
|
+
const xValue = `${xAxis?.value?.size ?? 0}${xAxis?.value?.unit ?? "px"}`;
|
|
1514
|
+
const yValue = `${yAxis?.value?.size ?? 0}${yAxis?.value?.unit ?? "px"}`;
|
|
1515
|
+
const blurValue = `${blur?.value?.size ?? 10}${blur?.value?.unit ?? "px"}`;
|
|
1516
|
+
return /* @__PURE__ */ React29.createElement(import_ui23.Box, { component: "span" }, /* @__PURE__ */ React29.createElement(import_ui23.Box, { component: "span", style: { textTransform: "capitalize" } }, "Drop shadow:"), `${xValue} ${yValue} ${blurValue}`);
|
|
1517
|
+
};
|
|
1518
|
+
|
|
1409
1519
|
// src/controls/filter-repeater-control.tsx
|
|
1410
1520
|
var DEFAULT_FILTER_KEY = "blur";
|
|
1411
1521
|
var filterConfig = {
|
|
1412
1522
|
blur: {
|
|
1413
1523
|
defaultValue: { $$type: "radius", radius: { $$type: "size", value: { size: 0, unit: "px" } } },
|
|
1414
|
-
name: (0,
|
|
1415
|
-
valueName: (0,
|
|
1524
|
+
name: (0, import_i18n7.__)("Blur", "elementor"),
|
|
1525
|
+
valueName: (0, import_i18n7.__)("Radius", "elementor"),
|
|
1416
1526
|
propType: import_editor_props10.blurFilterPropTypeUtil,
|
|
1417
1527
|
units: defaultUnits.filter((unit) => unit !== "%")
|
|
1418
1528
|
},
|
|
1529
|
+
"drop-shadow": {
|
|
1530
|
+
defaultValue: {
|
|
1531
|
+
$$type: "drop-shadow",
|
|
1532
|
+
value: {
|
|
1533
|
+
xAxis: { $$type: "size", value: { size: 0, unit: "px" } },
|
|
1534
|
+
yAxis: { $$type: "size", value: { size: 0, unit: "px" } },
|
|
1535
|
+
blur: { $$type: "size", value: { size: 10, unit: "px" } },
|
|
1536
|
+
color: { $$type: "color", value: "rgba(0, 0, 0, 1)" }
|
|
1537
|
+
}
|
|
1538
|
+
},
|
|
1539
|
+
name: (0, import_i18n7.__)("Drop shadow", "elementor"),
|
|
1540
|
+
valueName: (0, import_i18n7.__)("Drop-shadow", "elementor"),
|
|
1541
|
+
propType: import_editor_props10.dropShadowFilterPropTypeUtil,
|
|
1542
|
+
units: defaultUnits.filter((unit) => unit !== "%")
|
|
1543
|
+
},
|
|
1419
1544
|
brightness: {
|
|
1420
1545
|
defaultValue: { $$type: "amount", amount: { $$type: "size", value: { size: 100, unit: "%" } } },
|
|
1421
|
-
name: (0,
|
|
1422
|
-
valueName: (0,
|
|
1546
|
+
name: (0, import_i18n7.__)("Brightness", "elementor"),
|
|
1547
|
+
valueName: (0, import_i18n7.__)("Amount", "elementor"),
|
|
1423
1548
|
propType: import_editor_props10.brightnessFilterPropTypeUtil,
|
|
1424
1549
|
units: ["%"]
|
|
1550
|
+
},
|
|
1551
|
+
contrast: {
|
|
1552
|
+
defaultValue: { $$type: "contrast", contrast: { $$type: "size", value: { size: 100, unit: "%" } } },
|
|
1553
|
+
name: (0, import_i18n7.__)("Contrast", "elementor"),
|
|
1554
|
+
valueName: (0, import_i18n7.__)("Amount", "elementor"),
|
|
1555
|
+
propType: import_editor_props10.contrastFilterPropTypeUtil,
|
|
1556
|
+
units: ["%"]
|
|
1557
|
+
},
|
|
1558
|
+
"hue-rotate": {
|
|
1559
|
+
defaultValue: { $$type: "hue-rotate", "hue-rotate": { $$type: "size", value: { size: 0, unit: "deg" } } },
|
|
1560
|
+
name: (0, import_i18n7.__)("Hue Rotate", "elementor"),
|
|
1561
|
+
valueName: (0, import_i18n7.__)("Angle", "elementor"),
|
|
1562
|
+
propType: import_editor_props10.hueRotateFilterPropTypeUtil,
|
|
1563
|
+
units: ["deg", "rad", "grad", "turn"]
|
|
1564
|
+
},
|
|
1565
|
+
saturate: {
|
|
1566
|
+
defaultValue: { $$type: "saturate", saturate: { $$type: "size", value: { size: 100, unit: "%" } } },
|
|
1567
|
+
name: (0, import_i18n7.__)("Saturate", "elementor"),
|
|
1568
|
+
valueName: (0, import_i18n7.__)("Amount", "elementor"),
|
|
1569
|
+
propType: import_editor_props10.saturateFilterPropTypeUtil,
|
|
1570
|
+
units: ["%"]
|
|
1571
|
+
},
|
|
1572
|
+
grayscale: {
|
|
1573
|
+
defaultValue: { $$type: "grayscale", grayscale: { $$type: "size", value: { size: 0, unit: "%" } } },
|
|
1574
|
+
name: (0, import_i18n7.__)("Grayscale", "elementor"),
|
|
1575
|
+
valueName: (0, import_i18n7.__)("Amount", "elementor"),
|
|
1576
|
+
propType: import_editor_props10.grayscaleFilterPropTypeUtil,
|
|
1577
|
+
units: ["%"]
|
|
1578
|
+
},
|
|
1579
|
+
invert: {
|
|
1580
|
+
defaultValue: { $$type: "invert", invert: { $$type: "size", value: { size: 0, unit: "%" } } },
|
|
1581
|
+
name: (0, import_i18n7.__)("Invert", "elementor"),
|
|
1582
|
+
valueName: (0, import_i18n7.__)("Amount", "elementor"),
|
|
1583
|
+
propType: import_editor_props10.invertFilterPropTypeUtil,
|
|
1584
|
+
units: ["%"]
|
|
1585
|
+
},
|
|
1586
|
+
sepia: {
|
|
1587
|
+
defaultValue: { $$type: "sepia", sepia: { $$type: "size", value: { size: 0, unit: "%" } } },
|
|
1588
|
+
name: (0, import_i18n7.__)("Sepia", "elementor"),
|
|
1589
|
+
valueName: (0, import_i18n7.__)("Amount", "elementor"),
|
|
1590
|
+
propType: import_editor_props10.sepiaFilterPropTypeUtil,
|
|
1591
|
+
units: ["%"]
|
|
1425
1592
|
}
|
|
1426
1593
|
};
|
|
1427
1594
|
var filterKeys = Object.keys(filterConfig);
|
|
1428
|
-
var
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
})
|
|
1432
|
-
|
|
1433
|
-
const { propType, value: filterValues, setValue, disabled } = useBoundProp(
|
|
1434
|
-
return /* @__PURE__ */
|
|
1595
|
+
var isSingleSize = (key) => {
|
|
1596
|
+
return !["drop-shadow"].includes(key);
|
|
1597
|
+
};
|
|
1598
|
+
var FilterRepeaterControl = createControl(({ filterPropName = "filter" }) => {
|
|
1599
|
+
const [propUtil, label] = filterPropName === "backdrop-filter" ? [import_editor_props11.backdropFilterPropTypeUtil, (0, import_i18n7.__)("Backdrop Filters", "elementor")] : [import_editor_props10.filterPropTypeUtil, (0, import_i18n7.__)("Filters", "elementor")];
|
|
1600
|
+
const { propType, value: filterValues, setValue, disabled } = useBoundProp(propUtil);
|
|
1601
|
+
return /* @__PURE__ */ React30.createElement(PropProvider, { propType, value: filterValues, setValue }, /* @__PURE__ */ React30.createElement(
|
|
1435
1602
|
Repeater,
|
|
1436
1603
|
{
|
|
1437
1604
|
openOnAdd: true,
|
|
1438
1605
|
disabled,
|
|
1439
1606
|
values: filterValues ?? [],
|
|
1440
1607
|
setValues: setValue,
|
|
1441
|
-
label
|
|
1608
|
+
label,
|
|
1609
|
+
collectionPropUtil: propUtil,
|
|
1442
1610
|
itemSettings: {
|
|
1443
1611
|
Icon: ItemIcon2,
|
|
1444
1612
|
Label: ItemLabel2,
|
|
@@ -1451,21 +1619,24 @@ var FilterRepeaterControl = createControl(() => {
|
|
|
1451
1619
|
}
|
|
1452
1620
|
));
|
|
1453
1621
|
});
|
|
1454
|
-
var ItemIcon2 = () => /* @__PURE__ */
|
|
1455
|
-
var ItemLabel2 = (
|
|
1456
|
-
|
|
1457
|
-
return singleSizeFilterNames.includes($$type) && /* @__PURE__ */ React28.createElement(SingleSizeItemLabel, { value: props.value });
|
|
1622
|
+
var ItemIcon2 = () => /* @__PURE__ */ React30.createElement(React30.Fragment, null);
|
|
1623
|
+
var ItemLabel2 = ({ value }) => {
|
|
1624
|
+
return isSingleSize(value.$$type) ? /* @__PURE__ */ React30.createElement(SingleSizeItemLabel, { value }) : /* @__PURE__ */ React30.createElement(DropShadowItemLabel, { value });
|
|
1458
1625
|
};
|
|
1459
1626
|
var SingleSizeItemLabel = ({ value }) => {
|
|
1460
1627
|
const { $$type, value: sizeValue } = value;
|
|
1461
1628
|
const { $$type: key } = filterConfig[$$type].defaultValue;
|
|
1462
1629
|
const defaultUnit = filterConfig[$$type].defaultValue[key].value.unit;
|
|
1463
1630
|
const { unit, size } = sizeValue[key]?.value ?? { unit: defaultUnit, size: 0 };
|
|
1464
|
-
const label = /* @__PURE__ */
|
|
1465
|
-
return /* @__PURE__ */
|
|
1631
|
+
const label = /* @__PURE__ */ React30.createElement(import_ui24.Box, { component: "span", style: { textTransform: "capitalize" } }, value.$$type, ":");
|
|
1632
|
+
return /* @__PURE__ */ React30.createElement(import_ui24.Box, { component: "span" }, label, unit !== "custom" ? ` ${size ?? 0}${unit ?? defaultUnit}` : size);
|
|
1466
1633
|
};
|
|
1467
|
-
var ItemContent2 = ({
|
|
1468
|
-
|
|
1634
|
+
var ItemContent2 = ({
|
|
1635
|
+
bind,
|
|
1636
|
+
collectionPropUtil,
|
|
1637
|
+
anchorEl
|
|
1638
|
+
}) => {
|
|
1639
|
+
const { value: filterValues, setValue } = useBoundProp(collectionPropUtil ?? import_editor_props10.filterPropTypeUtil);
|
|
1469
1640
|
const itemIndex = parseInt(bind, 10);
|
|
1470
1641
|
const item = filterValues?.[itemIndex];
|
|
1471
1642
|
const handleChange = (e) => {
|
|
@@ -1473,12 +1644,12 @@ var ItemContent2 = ({ bind }) => {
|
|
|
1473
1644
|
const filterType = e.target.value;
|
|
1474
1645
|
newFilterValues[itemIndex] = {
|
|
1475
1646
|
$$type: filterType,
|
|
1476
|
-
value: filterConfig[filterType].defaultValue
|
|
1647
|
+
value: { ...filterConfig[filterType].defaultValue }
|
|
1477
1648
|
};
|
|
1478
1649
|
setValue(newFilterValues);
|
|
1479
1650
|
};
|
|
1480
|
-
return /* @__PURE__ */
|
|
1481
|
-
|
|
1651
|
+
return /* @__PURE__ */ React30.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React30.createElement(PopoverContent, { p: 1.5 }, /* @__PURE__ */ React30.createElement(PopoverGridContainer, null, /* @__PURE__ */ React30.createElement(import_ui24.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React30.createElement(ControlLabel, null, (0, import_i18n7.__)("Filter", "elementor"))), /* @__PURE__ */ React30.createElement(import_ui24.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React30.createElement(
|
|
1652
|
+
import_ui24.Select,
|
|
1482
1653
|
{
|
|
1483
1654
|
sx: { overflow: "hidden" },
|
|
1484
1655
|
size: "tiny",
|
|
@@ -1486,43 +1657,45 @@ var ItemContent2 = ({ bind }) => {
|
|
|
1486
1657
|
onChange: handleChange,
|
|
1487
1658
|
fullWidth: true
|
|
1488
1659
|
},
|
|
1489
|
-
filterKeys.map((filterKey) => /* @__PURE__ */
|
|
1490
|
-
))), /* @__PURE__ */
|
|
1660
|
+
filterKeys.map((filterKey) => /* @__PURE__ */ React30.createElement(import_editor_ui3.MenuListItem, { key: filterKey, value: filterKey }, filterConfig[filterKey].name))
|
|
1661
|
+
))), /* @__PURE__ */ React30.createElement(Content2, { filterType: item?.$$type, anchorEl })));
|
|
1491
1662
|
};
|
|
1492
|
-
var Content2 = ({ filterType }) => {
|
|
1493
|
-
|
|
1663
|
+
var Content2 = ({ filterType, anchorEl }) => {
|
|
1664
|
+
const { propType, units: units2 = [] } = filterConfig[filterType];
|
|
1665
|
+
return isSingleSize(filterType) ? /* @__PURE__ */ React30.createElement(SingleSizeItemContent, { filterType }) : /* @__PURE__ */ React30.createElement(DropShadowItemContent, { propType, units: units2, anchorEl });
|
|
1494
1666
|
};
|
|
1495
1667
|
var SingleSizeItemContent = ({ filterType }) => {
|
|
1496
1668
|
const { propType, valueName, defaultValue, units: units2 } = filterConfig[filterType];
|
|
1497
1669
|
const { $$type } = defaultValue;
|
|
1498
1670
|
const context = useBoundProp(propType);
|
|
1499
|
-
const rowRef = (0,
|
|
1500
|
-
|
|
1671
|
+
const rowRef = (0, import_react17.useRef)(null);
|
|
1672
|
+
const defaultUnit = defaultValue[$$type].value.unit;
|
|
1673
|
+
return /* @__PURE__ */ React30.createElement(PropProvider, { ...context }, /* @__PURE__ */ React30.createElement(PropKeyProvider, { bind: $$type }, /* @__PURE__ */ React30.createElement(PopoverGridContainer, { ref: rowRef }, /* @__PURE__ */ React30.createElement(import_ui24.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React30.createElement(ControlLabel, null, valueName)), /* @__PURE__ */ React30.createElement(import_ui24.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React30.createElement(SizeControl, { anchorRef: rowRef, units: units2, defaultUnit })))));
|
|
1501
1674
|
};
|
|
1502
1675
|
|
|
1503
1676
|
// src/controls/toggle-control.tsx
|
|
1504
|
-
var
|
|
1505
|
-
var
|
|
1677
|
+
var React33 = __toESM(require("react"));
|
|
1678
|
+
var import_editor_props12 = require("@elementor/editor-props");
|
|
1506
1679
|
|
|
1507
1680
|
// src/components/control-toggle-button-group.tsx
|
|
1508
|
-
var
|
|
1509
|
-
var
|
|
1681
|
+
var React32 = __toESM(require("react"));
|
|
1682
|
+
var import_react18 = require("react");
|
|
1510
1683
|
var import_icons5 = require("@elementor/icons");
|
|
1511
|
-
var
|
|
1684
|
+
var import_ui26 = require("@elementor/ui");
|
|
1512
1685
|
|
|
1513
1686
|
// src/components/conditional-tooltip.tsx
|
|
1514
|
-
var
|
|
1515
|
-
var
|
|
1687
|
+
var React31 = __toESM(require("react"));
|
|
1688
|
+
var import_ui25 = require("@elementor/ui");
|
|
1516
1689
|
var ConditionalTooltip = ({
|
|
1517
1690
|
showTooltip,
|
|
1518
1691
|
children,
|
|
1519
1692
|
label
|
|
1520
1693
|
}) => {
|
|
1521
|
-
return showTooltip && label ? /* @__PURE__ */
|
|
1694
|
+
return showTooltip && label ? /* @__PURE__ */ React31.createElement(import_ui25.Tooltip, { title: label, disableFocusListener: true, placement: "top" }, children) : children;
|
|
1522
1695
|
};
|
|
1523
1696
|
|
|
1524
1697
|
// src/components/control-toggle-button-group.tsx
|
|
1525
|
-
var StyledToggleButtonGroup = (0,
|
|
1698
|
+
var StyledToggleButtonGroup = (0, import_ui26.styled)(import_ui26.ToggleButtonGroup)`
|
|
1526
1699
|
${({ justify }) => `justify-content: ${justify};`}
|
|
1527
1700
|
button:not( :last-of-type ) {
|
|
1528
1701
|
border-start-end-radius: 0;
|
|
@@ -1542,26 +1715,26 @@ var ControlToggleButtonGroup = ({
|
|
|
1542
1715
|
size = "tiny",
|
|
1543
1716
|
value,
|
|
1544
1717
|
onChange,
|
|
1545
|
-
items,
|
|
1718
|
+
items: items2,
|
|
1546
1719
|
maxItems,
|
|
1547
1720
|
exclusive = false,
|
|
1548
1721
|
fullWidth = false,
|
|
1549
1722
|
disabled
|
|
1550
1723
|
}) => {
|
|
1551
|
-
const shouldSliceItems = exclusive && maxItems !== void 0 &&
|
|
1552
|
-
const menuItems = shouldSliceItems ?
|
|
1553
|
-
const fixedItems = shouldSliceItems ?
|
|
1554
|
-
const isRtl = "rtl" === (0,
|
|
1724
|
+
const shouldSliceItems = exclusive && maxItems !== void 0 && items2.length > maxItems;
|
|
1725
|
+
const menuItems = shouldSliceItems ? items2.slice(maxItems - 1) : [];
|
|
1726
|
+
const fixedItems = shouldSliceItems ? items2.slice(0, maxItems - 1) : items2;
|
|
1727
|
+
const isRtl = "rtl" === (0, import_ui26.useTheme)().direction;
|
|
1555
1728
|
const handleChange = (_, newValue) => {
|
|
1556
1729
|
onChange(newValue);
|
|
1557
1730
|
};
|
|
1558
|
-
const getGridTemplateColumns = (0,
|
|
1731
|
+
const getGridTemplateColumns = (0, import_react18.useMemo)(() => {
|
|
1559
1732
|
const isOffLimits = menuItems?.length;
|
|
1560
1733
|
const itemsCount = isOffLimits ? fixedItems.length + 1 : fixedItems.length;
|
|
1561
1734
|
const templateColumnsSuffix = isOffLimits ? "auto" : "";
|
|
1562
1735
|
return `repeat(${itemsCount}, minmax(0, 25%)) ${templateColumnsSuffix}`;
|
|
1563
1736
|
}, [menuItems?.length, fixedItems.length]);
|
|
1564
|
-
return /* @__PURE__ */
|
|
1737
|
+
return /* @__PURE__ */ React32.createElement(ControlActions, null, /* @__PURE__ */ React32.createElement(
|
|
1565
1738
|
StyledToggleButtonGroup,
|
|
1566
1739
|
{
|
|
1567
1740
|
justify,
|
|
@@ -1576,16 +1749,16 @@ var ControlToggleButtonGroup = ({
|
|
|
1576
1749
|
width: `100%`
|
|
1577
1750
|
}
|
|
1578
1751
|
},
|
|
1579
|
-
fixedItems.map(({ label, value: buttonValue, renderContent: Content5, showTooltip }) => /* @__PURE__ */
|
|
1752
|
+
fixedItems.map(({ label, value: buttonValue, renderContent: Content5, showTooltip }) => /* @__PURE__ */ React32.createElement(
|
|
1580
1753
|
ConditionalTooltip,
|
|
1581
1754
|
{
|
|
1582
1755
|
key: buttonValue,
|
|
1583
1756
|
label,
|
|
1584
1757
|
showTooltip: showTooltip || false
|
|
1585
1758
|
},
|
|
1586
|
-
/* @__PURE__ */
|
|
1759
|
+
/* @__PURE__ */ React32.createElement(import_ui26.ToggleButton, { value: buttonValue, "aria-label": label, size, fullWidth }, /* @__PURE__ */ React32.createElement(Content5, { size }))
|
|
1587
1760
|
)),
|
|
1588
|
-
menuItems.length && exclusive && /* @__PURE__ */
|
|
1761
|
+
menuItems.length && exclusive && /* @__PURE__ */ React32.createElement(
|
|
1589
1762
|
SplitButtonGroup,
|
|
1590
1763
|
{
|
|
1591
1764
|
size,
|
|
@@ -1600,13 +1773,13 @@ var ControlToggleButtonGroup = ({
|
|
|
1600
1773
|
var SplitButtonGroup = ({
|
|
1601
1774
|
size = "tiny",
|
|
1602
1775
|
onChange,
|
|
1603
|
-
items,
|
|
1776
|
+
items: items2,
|
|
1604
1777
|
fullWidth,
|
|
1605
1778
|
value
|
|
1606
1779
|
}) => {
|
|
1607
|
-
const previewButton = usePreviewButton(
|
|
1608
|
-
const [isMenuOpen, setIsMenuOpen] = (0,
|
|
1609
|
-
const menuButtonRef = (0,
|
|
1780
|
+
const previewButton = usePreviewButton(items2, value);
|
|
1781
|
+
const [isMenuOpen, setIsMenuOpen] = (0, import_react18.useState)(false);
|
|
1782
|
+
const menuButtonRef = (0, import_react18.useRef)(null);
|
|
1610
1783
|
const onMenuToggle = (ev) => {
|
|
1611
1784
|
setIsMenuOpen((prev) => !prev);
|
|
1612
1785
|
ev.preventDefault();
|
|
@@ -1619,8 +1792,8 @@ var SplitButtonGroup = ({
|
|
|
1619
1792
|
const shouldRemove = newValue === value;
|
|
1620
1793
|
onChange(shouldRemove ? null : newValue);
|
|
1621
1794
|
};
|
|
1622
|
-
return /* @__PURE__ */
|
|
1623
|
-
|
|
1795
|
+
return /* @__PURE__ */ React32.createElement(React32.Fragment, null, /* @__PURE__ */ React32.createElement(
|
|
1796
|
+
import_ui26.ToggleButton,
|
|
1624
1797
|
{
|
|
1625
1798
|
value: previewButton.value,
|
|
1626
1799
|
"aria-label": previewButton.label,
|
|
@@ -1633,8 +1806,8 @@ var SplitButtonGroup = ({
|
|
|
1633
1806
|
ref: menuButtonRef
|
|
1634
1807
|
},
|
|
1635
1808
|
previewButton.renderContent({ size })
|
|
1636
|
-
), /* @__PURE__ */
|
|
1637
|
-
|
|
1809
|
+
), /* @__PURE__ */ React32.createElement(
|
|
1810
|
+
import_ui26.ToggleButton,
|
|
1638
1811
|
{
|
|
1639
1812
|
size,
|
|
1640
1813
|
"aria-expanded": isMenuOpen ? "true" : void 0,
|
|
@@ -1644,9 +1817,9 @@ var SplitButtonGroup = ({
|
|
|
1644
1817
|
ref: menuButtonRef,
|
|
1645
1818
|
value: "__chevron-icon-button__"
|
|
1646
1819
|
},
|
|
1647
|
-
/* @__PURE__ */
|
|
1648
|
-
), /* @__PURE__ */
|
|
1649
|
-
|
|
1820
|
+
/* @__PURE__ */ React32.createElement(import_icons5.ChevronDownIcon, { fontSize: size })
|
|
1821
|
+
), /* @__PURE__ */ React32.createElement(
|
|
1822
|
+
import_ui26.Menu,
|
|
1650
1823
|
{
|
|
1651
1824
|
open: isMenuOpen,
|
|
1652
1825
|
onClose: () => setIsMenuOpen(false),
|
|
@@ -1663,27 +1836,27 @@ var SplitButtonGroup = ({
|
|
|
1663
1836
|
mt: 0.5
|
|
1664
1837
|
}
|
|
1665
1838
|
},
|
|
1666
|
-
|
|
1667
|
-
|
|
1839
|
+
items2.map(({ label, value: buttonValue }) => /* @__PURE__ */ React32.createElement(
|
|
1840
|
+
import_ui26.MenuItem,
|
|
1668
1841
|
{
|
|
1669
1842
|
key: buttonValue,
|
|
1670
1843
|
selected: buttonValue === value,
|
|
1671
1844
|
onClick: () => onMenuItemClick(buttonValue)
|
|
1672
1845
|
},
|
|
1673
|
-
/* @__PURE__ */
|
|
1846
|
+
/* @__PURE__ */ React32.createElement(import_ui26.ListItemText, null, /* @__PURE__ */ React32.createElement(import_ui26.Typography, { sx: { fontSize: "14px" } }, label))
|
|
1674
1847
|
))
|
|
1675
1848
|
));
|
|
1676
1849
|
};
|
|
1677
|
-
var usePreviewButton = (
|
|
1678
|
-
const [previewButton, setPreviewButton] = (0,
|
|
1679
|
-
|
|
1850
|
+
var usePreviewButton = (items2, value) => {
|
|
1851
|
+
const [previewButton, setPreviewButton] = (0, import_react18.useState)(
|
|
1852
|
+
items2.find((item) => item.value === value) ?? items2[0]
|
|
1680
1853
|
);
|
|
1681
|
-
(0,
|
|
1682
|
-
const selectedButton =
|
|
1854
|
+
(0, import_react18.useEffect)(() => {
|
|
1855
|
+
const selectedButton = items2.find((item) => item.value === value);
|
|
1683
1856
|
if (selectedButton) {
|
|
1684
1857
|
setPreviewButton(selectedButton);
|
|
1685
1858
|
}
|
|
1686
|
-
}, [
|
|
1859
|
+
}, [items2, value]);
|
|
1687
1860
|
return previewButton;
|
|
1688
1861
|
};
|
|
1689
1862
|
|
|
@@ -1696,7 +1869,7 @@ var ToggleControl = createControl(
|
|
|
1696
1869
|
exclusive = true,
|
|
1697
1870
|
maxItems
|
|
1698
1871
|
}) => {
|
|
1699
|
-
const { value, setValue, placeholder, disabled } = useBoundProp(
|
|
1872
|
+
const { value, setValue, placeholder, disabled } = useBoundProp(import_editor_props12.stringPropTypeUtil);
|
|
1700
1873
|
const exclusiveValues = options.filter((option) => option.exclusive).map((option) => option.value);
|
|
1701
1874
|
const handleNonExclusiveToggle = (selectedValues) => {
|
|
1702
1875
|
const newSelectedValue = selectedValues[selectedValues.length - 1];
|
|
@@ -1710,7 +1883,7 @@ var ToggleControl = createControl(
|
|
|
1710
1883
|
fullWidth,
|
|
1711
1884
|
size
|
|
1712
1885
|
};
|
|
1713
|
-
return exclusive ? /* @__PURE__ */
|
|
1886
|
+
return exclusive ? /* @__PURE__ */ React33.createElement(
|
|
1714
1887
|
ControlToggleButtonGroup,
|
|
1715
1888
|
{
|
|
1716
1889
|
...toggleButtonGroupProps,
|
|
@@ -1719,7 +1892,7 @@ var ToggleControl = createControl(
|
|
|
1719
1892
|
disabled,
|
|
1720
1893
|
exclusive: true
|
|
1721
1894
|
}
|
|
1722
|
-
) : /* @__PURE__ */
|
|
1895
|
+
) : /* @__PURE__ */ React33.createElement(
|
|
1723
1896
|
ControlToggleButtonGroup,
|
|
1724
1897
|
{
|
|
1725
1898
|
...toggleButtonGroupProps,
|
|
@@ -1733,9 +1906,9 @@ var ToggleControl = createControl(
|
|
|
1733
1906
|
);
|
|
1734
1907
|
|
|
1735
1908
|
// src/controls/number-control.tsx
|
|
1736
|
-
var
|
|
1737
|
-
var
|
|
1738
|
-
var
|
|
1909
|
+
var React34 = __toESM(require("react"));
|
|
1910
|
+
var import_editor_props13 = require("@elementor/editor-props");
|
|
1911
|
+
var import_ui27 = require("@elementor/ui");
|
|
1739
1912
|
var isEmptyOrNaN = (value) => value === null || value === void 0 || value === "" || Number.isNaN(Number(value));
|
|
1740
1913
|
var RESTRICTED_INPUT_KEYS2 = ["e", "E", "+", "-"];
|
|
1741
1914
|
var NumberControl = createControl(
|
|
@@ -1746,7 +1919,7 @@ var NumberControl = createControl(
|
|
|
1746
1919
|
step = 1,
|
|
1747
1920
|
shouldForceInt = false
|
|
1748
1921
|
}) => {
|
|
1749
|
-
const { value, setValue, placeholder, disabled } = useBoundProp(
|
|
1922
|
+
const { value, setValue, placeholder, disabled } = useBoundProp(import_editor_props13.numberPropTypeUtil);
|
|
1750
1923
|
const handleChange = (event) => {
|
|
1751
1924
|
const eventValue = event.target.value;
|
|
1752
1925
|
if (isEmptyOrNaN(eventValue)) {
|
|
@@ -1756,8 +1929,8 @@ var NumberControl = createControl(
|
|
|
1756
1929
|
const formattedValue = shouldForceInt ? +parseInt(eventValue) : Number(eventValue);
|
|
1757
1930
|
setValue(Math.min(Math.max(formattedValue, min), max));
|
|
1758
1931
|
};
|
|
1759
|
-
return /* @__PURE__ */
|
|
1760
|
-
|
|
1932
|
+
return /* @__PURE__ */ React34.createElement(ControlActions, null, /* @__PURE__ */ React34.createElement(
|
|
1933
|
+
import_ui27.TextField,
|
|
1761
1934
|
{
|
|
1762
1935
|
size: "tiny",
|
|
1763
1936
|
type: "number",
|
|
@@ -1778,15 +1951,15 @@ var NumberControl = createControl(
|
|
|
1778
1951
|
);
|
|
1779
1952
|
|
|
1780
1953
|
// src/controls/equal-unequal-sizes-control.tsx
|
|
1781
|
-
var
|
|
1782
|
-
var
|
|
1783
|
-
var
|
|
1954
|
+
var React35 = __toESM(require("react"));
|
|
1955
|
+
var import_react19 = require("react");
|
|
1956
|
+
var import_editor_props14 = require("@elementor/editor-props");
|
|
1784
1957
|
var import_editor_v1_adapters2 = require("@elementor/editor-v1-adapters");
|
|
1785
|
-
var
|
|
1786
|
-
var
|
|
1787
|
-
var isEqualSizes = (propValue,
|
|
1958
|
+
var import_ui28 = require("@elementor/ui");
|
|
1959
|
+
var import_i18n8 = require("@wordpress/i18n");
|
|
1960
|
+
var isEqualSizes = (propValue, items2) => {
|
|
1788
1961
|
const values = Object.values(propValue);
|
|
1789
|
-
if (values.length !==
|
|
1962
|
+
if (values.length !== items2.length) {
|
|
1790
1963
|
return false;
|
|
1791
1964
|
}
|
|
1792
1965
|
const [firstValue, ...restValues] = values;
|
|
@@ -1798,25 +1971,25 @@ function EqualUnequalSizesControl({
|
|
|
1798
1971
|
label,
|
|
1799
1972
|
icon,
|
|
1800
1973
|
tooltipLabel,
|
|
1801
|
-
items,
|
|
1974
|
+
items: items2,
|
|
1802
1975
|
multiSizePropTypeUtil
|
|
1803
1976
|
}) {
|
|
1804
|
-
const popupId = (0,
|
|
1805
|
-
const popupState = (0,
|
|
1977
|
+
const popupId = (0, import_react19.useId)();
|
|
1978
|
+
const popupState = (0, import_ui28.usePopupState)({ variant: "popover", popupId });
|
|
1806
1979
|
const {
|
|
1807
1980
|
propType: multiSizePropType,
|
|
1808
1981
|
value: multiSizeValue,
|
|
1809
1982
|
setValue: setMultiSizeValue,
|
|
1810
1983
|
disabled: multiSizeDisabled
|
|
1811
1984
|
} = useBoundProp(multiSizePropTypeUtil);
|
|
1812
|
-
const { value: sizeValue, setValue: setSizeValue } = useBoundProp(
|
|
1813
|
-
const rowRefs = [(0,
|
|
1985
|
+
const { value: sizeValue, setValue: setSizeValue } = useBoundProp(import_editor_props14.sizePropTypeUtil);
|
|
1986
|
+
const rowRefs = [(0, import_react19.useRef)(null), (0, import_react19.useRef)(null)];
|
|
1814
1987
|
const splitEqualValue = () => {
|
|
1815
1988
|
if (!sizeValue) {
|
|
1816
1989
|
return null;
|
|
1817
1990
|
}
|
|
1818
|
-
return
|
|
1819
|
-
(acc, { bind }) => ({ ...acc, [bind]:
|
|
1991
|
+
return items2.reduce(
|
|
1992
|
+
(acc, { bind }) => ({ ...acc, [bind]: import_editor_props14.sizePropTypeUtil.create(sizeValue) }),
|
|
1820
1993
|
{}
|
|
1821
1994
|
);
|
|
1822
1995
|
};
|
|
@@ -1825,7 +1998,7 @@ function EqualUnequalSizesControl({
|
|
|
1825
1998
|
...multiSizeValue ?? splitEqualValue(),
|
|
1826
1999
|
...newValue
|
|
1827
2000
|
};
|
|
1828
|
-
const isEqual = isEqualSizes(newMappedValues,
|
|
2001
|
+
const isEqual = isEqualSizes(newMappedValues, items2);
|
|
1829
2002
|
if (isEqual) {
|
|
1830
2003
|
return setSizeValue(Object.values(newMappedValues)[0]?.value);
|
|
1831
2004
|
}
|
|
@@ -1839,25 +2012,25 @@ function EqualUnequalSizesControl({
|
|
|
1839
2012
|
};
|
|
1840
2013
|
const isShowingGeneralIndicator = !(0, import_editor_v1_adapters2.isExperimentActive)("e_v_3_30") || !popupState.isOpen;
|
|
1841
2014
|
const isMixed = !!multiSizeValue;
|
|
1842
|
-
return /* @__PURE__ */
|
|
2015
|
+
return /* @__PURE__ */ React35.createElement(React35.Fragment, null, /* @__PURE__ */ React35.createElement(import_ui28.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap", ref: rowRefs[0] }, /* @__PURE__ */ React35.createElement(import_ui28.Grid, { item: true, xs: 6 }, !isShowingGeneralIndicator ? /* @__PURE__ */ React35.createElement(ControlFormLabel, null, label) : /* @__PURE__ */ React35.createElement(ControlLabel, null, label)), /* @__PURE__ */ React35.createElement(import_ui28.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React35.createElement(import_ui28.Stack, { direction: "row", alignItems: "center", gap: 1 }, /* @__PURE__ */ React35.createElement(
|
|
1843
2016
|
SizeControl,
|
|
1844
2017
|
{
|
|
1845
|
-
placeholder: isMixed ? (0,
|
|
2018
|
+
placeholder: isMixed ? (0, import_i18n8.__)("Mixed", "elementor") : void 0,
|
|
1846
2019
|
anchorRef: rowRefs[0]
|
|
1847
2020
|
}
|
|
1848
|
-
), /* @__PURE__ */
|
|
1849
|
-
|
|
2021
|
+
), /* @__PURE__ */ React35.createElement(import_ui28.Tooltip, { title: tooltipLabel, placement: "top" }, /* @__PURE__ */ React35.createElement(
|
|
2022
|
+
import_ui28.ToggleButton,
|
|
1850
2023
|
{
|
|
1851
2024
|
size: "tiny",
|
|
1852
2025
|
value: "check",
|
|
1853
2026
|
sx: { marginLeft: "auto" },
|
|
1854
|
-
...(0,
|
|
2027
|
+
...(0, import_ui28.bindToggle)(popupState),
|
|
1855
2028
|
selected: popupState.isOpen,
|
|
1856
2029
|
"aria-label": tooltipLabel
|
|
1857
2030
|
},
|
|
1858
2031
|
icon
|
|
1859
|
-
))))), /* @__PURE__ */
|
|
1860
|
-
|
|
2032
|
+
))))), /* @__PURE__ */ React35.createElement(
|
|
2033
|
+
import_ui28.Popover,
|
|
1861
2034
|
{
|
|
1862
2035
|
disablePortal: true,
|
|
1863
2036
|
disableScrollLock: true,
|
|
@@ -1869,50 +2042,50 @@ function EqualUnequalSizesControl({
|
|
|
1869
2042
|
vertical: "top",
|
|
1870
2043
|
horizontal: "right"
|
|
1871
2044
|
},
|
|
1872
|
-
...(0,
|
|
2045
|
+
...(0, import_ui28.bindPopover)(popupState),
|
|
1873
2046
|
slotProps: {
|
|
1874
2047
|
paper: { sx: { mt: 0.5, width: rowRefs[0].current?.getBoundingClientRect().width } }
|
|
1875
2048
|
}
|
|
1876
2049
|
},
|
|
1877
|
-
/* @__PURE__ */
|
|
2050
|
+
/* @__PURE__ */ React35.createElement(
|
|
1878
2051
|
PropProvider,
|
|
1879
2052
|
{
|
|
1880
2053
|
propType: multiSizePropType,
|
|
1881
2054
|
value: getMultiSizeValues(),
|
|
1882
2055
|
setValue: setNestedProp,
|
|
1883
|
-
|
|
2056
|
+
isDisabled: () => multiSizeDisabled
|
|
1884
2057
|
},
|
|
1885
|
-
/* @__PURE__ */
|
|
2058
|
+
/* @__PURE__ */ React35.createElement(PopoverContent, { p: 1.5 }, /* @__PURE__ */ React35.createElement(PopoverGridContainer, { ref: rowRefs[1] }, /* @__PURE__ */ React35.createElement(MultiSizeValueControl, { item: items2[0], rowRef: rowRefs[1] }), /* @__PURE__ */ React35.createElement(MultiSizeValueControl, { item: items2[1], rowRef: rowRefs[1] })), /* @__PURE__ */ React35.createElement(PopoverGridContainer, { ref: rowRefs[2] }, /* @__PURE__ */ React35.createElement(MultiSizeValueControl, { item: items2[2], rowRef: rowRefs[2] }), /* @__PURE__ */ React35.createElement(MultiSizeValueControl, { item: items2[3], rowRef: rowRefs[2] })))
|
|
1886
2059
|
)
|
|
1887
2060
|
));
|
|
1888
2061
|
}
|
|
1889
2062
|
var MultiSizeValueControl = ({ item, rowRef }) => {
|
|
1890
2063
|
const isUsingNestedProps = (0, import_editor_v1_adapters2.isExperimentActive)("e_v_3_30");
|
|
1891
|
-
return /* @__PURE__ */
|
|
2064
|
+
return /* @__PURE__ */ React35.createElement(PropKeyProvider, { bind: item.bind }, /* @__PURE__ */ React35.createElement(import_ui28.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React35.createElement(import_ui28.Grid, { container: true, gap: 0.75, alignItems: "center" }, /* @__PURE__ */ React35.createElement(import_ui28.Grid, { item: true, xs: 12 }, isUsingNestedProps ? /* @__PURE__ */ React35.createElement(ControlLabel, null, item.label) : /* @__PURE__ */ React35.createElement(ControlFormLabel, null, item.label)), /* @__PURE__ */ React35.createElement(import_ui28.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React35.createElement(SizeControl, { startIcon: item.icon, anchorRef: rowRef })))));
|
|
1892
2065
|
};
|
|
1893
2066
|
|
|
1894
2067
|
// src/controls/linked-dimensions-control.tsx
|
|
1895
|
-
var
|
|
1896
|
-
var
|
|
1897
|
-
var
|
|
2068
|
+
var React36 = __toESM(require("react"));
|
|
2069
|
+
var import_react20 = require("react");
|
|
2070
|
+
var import_editor_props15 = require("@elementor/editor-props");
|
|
1898
2071
|
var import_editor_v1_adapters3 = require("@elementor/editor-v1-adapters");
|
|
1899
2072
|
var import_icons6 = require("@elementor/icons");
|
|
1900
|
-
var
|
|
1901
|
-
var
|
|
2073
|
+
var import_ui29 = require("@elementor/ui");
|
|
2074
|
+
var import_i18n9 = require("@wordpress/i18n");
|
|
1902
2075
|
var LinkedDimensionsControl = createControl(
|
|
1903
2076
|
({
|
|
1904
2077
|
label,
|
|
1905
2078
|
isSiteRtl = false,
|
|
1906
2079
|
extendedOptions
|
|
1907
2080
|
}) => {
|
|
1908
|
-
const { value: sizeValue, setValue: setSizeValue, disabled: sizeDisabled } = useBoundProp(
|
|
1909
|
-
const gridRowRefs = [(0,
|
|
2081
|
+
const { value: sizeValue, setValue: setSizeValue, disabled: sizeDisabled } = useBoundProp(import_editor_props15.sizePropTypeUtil);
|
|
2082
|
+
const gridRowRefs = [(0, import_react20.useRef)(null), (0, import_react20.useRef)(null)];
|
|
1910
2083
|
const {
|
|
1911
2084
|
value: dimensionsValue,
|
|
1912
2085
|
setValue: setDimensionsValue,
|
|
1913
2086
|
propType,
|
|
1914
2087
|
disabled: dimensionsDisabled
|
|
1915
|
-
} = useBoundProp(
|
|
2088
|
+
} = useBoundProp(import_editor_props15.dimensionsPropTypeUtil);
|
|
1916
2089
|
const isLinked = !dimensionsValue && !sizeValue ? true : !!sizeValue;
|
|
1917
2090
|
const isUsingNestedProps = (0, import_editor_v1_adapters3.isExperimentActive)("e_v_3_30");
|
|
1918
2091
|
const onLinkToggle = () => {
|
|
@@ -1920,7 +2093,7 @@ var LinkedDimensionsControl = createControl(
|
|
|
1920
2093
|
setSizeValue(dimensionsValue["block-start"]?.value ?? null);
|
|
1921
2094
|
return;
|
|
1922
2095
|
}
|
|
1923
|
-
const value = sizeValue ?
|
|
2096
|
+
const value = sizeValue ? import_editor_props15.sizePropTypeUtil.create(sizeValue) : null;
|
|
1924
2097
|
setDimensionsValue({
|
|
1925
2098
|
"block-start": value,
|
|
1926
2099
|
"block-end": value,
|
|
@@ -1930,19 +2103,19 @@ var LinkedDimensionsControl = createControl(
|
|
|
1930
2103
|
};
|
|
1931
2104
|
const tooltipLabel = label.toLowerCase();
|
|
1932
2105
|
const LinkedIcon = isLinked ? import_icons6.LinkIcon : import_icons6.DetachIcon;
|
|
1933
|
-
const linkedLabel = (0,
|
|
1934
|
-
const unlinkedLabel = (0,
|
|
2106
|
+
const linkedLabel = (0, import_i18n9.__)("Link %s", "elementor").replace("%s", tooltipLabel);
|
|
2107
|
+
const unlinkedLabel = (0, import_i18n9.__)("Unlink %s", "elementor").replace("%s", tooltipLabel);
|
|
1935
2108
|
const disabled = sizeDisabled || dimensionsDisabled;
|
|
1936
|
-
return /* @__PURE__ */
|
|
2109
|
+
return /* @__PURE__ */ React36.createElement(
|
|
1937
2110
|
PropProvider,
|
|
1938
2111
|
{
|
|
1939
2112
|
propType,
|
|
1940
2113
|
value: dimensionsValue,
|
|
1941
2114
|
setValue: setDimensionsValue,
|
|
1942
|
-
disabled
|
|
2115
|
+
isDisabled: () => disabled
|
|
1943
2116
|
},
|
|
1944
|
-
/* @__PURE__ */
|
|
1945
|
-
|
|
2117
|
+
/* @__PURE__ */ React36.createElement(import_ui29.Stack, { direction: "row", gap: 2, flexWrap: "nowrap" }, isUsingNestedProps ? /* @__PURE__ */ React36.createElement(ControlFormLabel, null, label) : /* @__PURE__ */ React36.createElement(ControlLabel, null, label), /* @__PURE__ */ React36.createElement(import_ui29.Tooltip, { title: isLinked ? unlinkedLabel : linkedLabel, placement: "top" }, /* @__PURE__ */ React36.createElement(
|
|
2118
|
+
import_ui29.ToggleButton,
|
|
1946
2119
|
{
|
|
1947
2120
|
"aria-label": isLinked ? unlinkedLabel : linkedLabel,
|
|
1948
2121
|
size: "tiny",
|
|
@@ -1952,9 +2125,9 @@ var LinkedDimensionsControl = createControl(
|
|
|
1952
2125
|
onChange: onLinkToggle,
|
|
1953
2126
|
disabled
|
|
1954
2127
|
},
|
|
1955
|
-
/* @__PURE__ */
|
|
2128
|
+
/* @__PURE__ */ React36.createElement(LinkedIcon, { fontSize: "tiny" })
|
|
1956
2129
|
))),
|
|
1957
|
-
getCssMarginProps(isSiteRtl).map((row, index) => /* @__PURE__ */
|
|
2130
|
+
getCssMarginProps(isSiteRtl).map((row, index) => /* @__PURE__ */ React36.createElement(import_ui29.Stack, { direction: "row", gap: 2, flexWrap: "nowrap", key: index, ref: gridRowRefs[index] }, row.map(({ icon, ...props }) => /* @__PURE__ */ React36.createElement(import_ui29.Grid, { container: true, gap: 0.75, alignItems: "center", key: props.bind }, /* @__PURE__ */ React36.createElement(import_ui29.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React36.createElement(Label, { ...props })), /* @__PURE__ */ React36.createElement(import_ui29.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React36.createElement(
|
|
1958
2131
|
Control3,
|
|
1959
2132
|
{
|
|
1960
2133
|
bind: props.bind,
|
|
@@ -1975,60 +2148,60 @@ var Control3 = ({
|
|
|
1975
2148
|
anchorRef
|
|
1976
2149
|
}) => {
|
|
1977
2150
|
if (isLinked) {
|
|
1978
|
-
return /* @__PURE__ */
|
|
2151
|
+
return /* @__PURE__ */ React36.createElement(SizeControl, { startIcon, extendedOptions, anchorRef });
|
|
1979
2152
|
}
|
|
1980
|
-
return /* @__PURE__ */
|
|
2153
|
+
return /* @__PURE__ */ React36.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React36.createElement(SizeControl, { startIcon, extendedOptions, anchorRef }));
|
|
1981
2154
|
};
|
|
1982
2155
|
var Label = ({ label, bind }) => {
|
|
1983
2156
|
const isUsingNestedProps = (0, import_editor_v1_adapters3.isExperimentActive)("e_v_3_30");
|
|
1984
2157
|
if (!isUsingNestedProps) {
|
|
1985
|
-
return /* @__PURE__ */
|
|
2158
|
+
return /* @__PURE__ */ React36.createElement(ControlFormLabel, null, label);
|
|
1986
2159
|
}
|
|
1987
|
-
return /* @__PURE__ */
|
|
2160
|
+
return /* @__PURE__ */ React36.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React36.createElement(ControlLabel, null, label));
|
|
1988
2161
|
};
|
|
1989
2162
|
function getCssMarginProps(isSiteRtl) {
|
|
1990
2163
|
return [
|
|
1991
2164
|
[
|
|
1992
2165
|
{
|
|
1993
2166
|
bind: "block-start",
|
|
1994
|
-
label: (0,
|
|
1995
|
-
icon: /* @__PURE__ */
|
|
2167
|
+
label: (0, import_i18n9.__)("Top", "elementor"),
|
|
2168
|
+
icon: /* @__PURE__ */ React36.createElement(import_icons6.SideTopIcon, { fontSize: "tiny" })
|
|
1996
2169
|
},
|
|
1997
2170
|
{
|
|
1998
2171
|
bind: "inline-end",
|
|
1999
|
-
label: isSiteRtl ? (0,
|
|
2000
|
-
icon: isSiteRtl ? /* @__PURE__ */
|
|
2172
|
+
label: isSiteRtl ? (0, import_i18n9.__)("Left", "elementor") : (0, import_i18n9.__)("Right", "elementor"),
|
|
2173
|
+
icon: isSiteRtl ? /* @__PURE__ */ React36.createElement(import_icons6.SideLeftIcon, { fontSize: "tiny" }) : /* @__PURE__ */ React36.createElement(import_icons6.SideRightIcon, { fontSize: "tiny" })
|
|
2001
2174
|
}
|
|
2002
2175
|
],
|
|
2003
2176
|
[
|
|
2004
2177
|
{
|
|
2005
2178
|
bind: "block-end",
|
|
2006
|
-
label: (0,
|
|
2007
|
-
icon: /* @__PURE__ */
|
|
2179
|
+
label: (0, import_i18n9.__)("Bottom", "elementor"),
|
|
2180
|
+
icon: /* @__PURE__ */ React36.createElement(import_icons6.SideBottomIcon, { fontSize: "tiny" })
|
|
2008
2181
|
},
|
|
2009
2182
|
{
|
|
2010
2183
|
bind: "inline-start",
|
|
2011
|
-
label: isSiteRtl ? (0,
|
|
2012
|
-
icon: isSiteRtl ? /* @__PURE__ */
|
|
2184
|
+
label: isSiteRtl ? (0, import_i18n9.__)("Right", "elementor") : (0, import_i18n9.__)("Left", "elementor"),
|
|
2185
|
+
icon: isSiteRtl ? /* @__PURE__ */ React36.createElement(import_icons6.SideRightIcon, { fontSize: "tiny" }) : /* @__PURE__ */ React36.createElement(import_icons6.SideLeftIcon, { fontSize: "tiny" })
|
|
2013
2186
|
}
|
|
2014
2187
|
]
|
|
2015
2188
|
];
|
|
2016
2189
|
}
|
|
2017
2190
|
|
|
2018
2191
|
// src/controls/font-family-control/font-family-control.tsx
|
|
2019
|
-
var
|
|
2020
|
-
var
|
|
2192
|
+
var React38 = __toESM(require("react"));
|
|
2193
|
+
var import_editor_props16 = require("@elementor/editor-props");
|
|
2021
2194
|
var import_icons8 = require("@elementor/icons");
|
|
2022
|
-
var
|
|
2195
|
+
var import_ui31 = require("@elementor/ui");
|
|
2023
2196
|
|
|
2024
2197
|
// src/components/font-family-selector.tsx
|
|
2025
|
-
var
|
|
2026
|
-
var
|
|
2198
|
+
var React37 = __toESM(require("react"));
|
|
2199
|
+
var import_react21 = require("react");
|
|
2027
2200
|
var import_editor_ui4 = require("@elementor/editor-ui");
|
|
2028
2201
|
var import_icons7 = require("@elementor/icons");
|
|
2029
|
-
var
|
|
2202
|
+
var import_ui30 = require("@elementor/ui");
|
|
2030
2203
|
var import_utils2 = require("@elementor/utils");
|
|
2031
|
-
var
|
|
2204
|
+
var import_i18n10 = require("@wordpress/i18n");
|
|
2032
2205
|
|
|
2033
2206
|
// src/controls/font-family-control/enqueue-font.tsx
|
|
2034
2207
|
var enqueueFont = (fontFamily, context = "editor") => {
|
|
@@ -2061,7 +2234,7 @@ var FontFamilySelector = ({
|
|
|
2061
2234
|
onClose,
|
|
2062
2235
|
sectionWidth
|
|
2063
2236
|
}) => {
|
|
2064
|
-
const [searchValue, setSearchValue] = (0,
|
|
2237
|
+
const [searchValue, setSearchValue] = (0, import_react21.useState)("");
|
|
2065
2238
|
const filteredFontFamilies = useFilteredFontFamilies(fontFamilies, searchValue);
|
|
2066
2239
|
const handleSearch = (value) => {
|
|
2067
2240
|
setSearchValue(value);
|
|
@@ -2070,21 +2243,21 @@ var FontFamilySelector = ({
|
|
|
2070
2243
|
setSearchValue("");
|
|
2071
2244
|
onClose();
|
|
2072
2245
|
};
|
|
2073
|
-
return /* @__PURE__ */
|
|
2246
|
+
return /* @__PURE__ */ React37.createElement(import_editor_ui4.PopoverBody, { width: sectionWidth }, /* @__PURE__ */ React37.createElement(
|
|
2074
2247
|
import_editor_ui4.PopoverHeader,
|
|
2075
2248
|
{
|
|
2076
|
-
title: (0,
|
|
2249
|
+
title: (0, import_i18n10.__)("Font Family", "elementor"),
|
|
2077
2250
|
onClose: handleClose,
|
|
2078
|
-
icon: /* @__PURE__ */
|
|
2251
|
+
icon: /* @__PURE__ */ React37.createElement(import_icons7.TextIcon, { fontSize: SIZE2 })
|
|
2079
2252
|
}
|
|
2080
|
-
), /* @__PURE__ */
|
|
2253
|
+
), /* @__PURE__ */ React37.createElement(
|
|
2081
2254
|
import_editor_ui4.PopoverSearch,
|
|
2082
2255
|
{
|
|
2083
2256
|
value: searchValue,
|
|
2084
2257
|
onSearch: handleSearch,
|
|
2085
|
-
placeholder: (0,
|
|
2258
|
+
placeholder: (0, import_i18n10.__)("Search", "elementor")
|
|
2086
2259
|
}
|
|
2087
|
-
), /* @__PURE__ */
|
|
2260
|
+
), /* @__PURE__ */ React37.createElement(import_ui30.Divider, null), filteredFontFamilies.length > 0 ? /* @__PURE__ */ React37.createElement(
|
|
2088
2261
|
FontList,
|
|
2089
2262
|
{
|
|
2090
2263
|
fontListItems: filteredFontFamilies,
|
|
@@ -2092,8 +2265,8 @@ var FontFamilySelector = ({
|
|
|
2092
2265
|
handleClose,
|
|
2093
2266
|
fontFamily
|
|
2094
2267
|
}
|
|
2095
|
-
) : /* @__PURE__ */
|
|
2096
|
-
|
|
2268
|
+
) : /* @__PURE__ */ React37.createElement(
|
|
2269
|
+
import_ui30.Stack,
|
|
2097
2270
|
{
|
|
2098
2271
|
alignItems: "center",
|
|
2099
2272
|
justifyContent: "center",
|
|
@@ -2102,9 +2275,9 @@ var FontFamilySelector = ({
|
|
|
2102
2275
|
gap: 1.5,
|
|
2103
2276
|
overflow: "hidden"
|
|
2104
2277
|
},
|
|
2105
|
-
/* @__PURE__ */
|
|
2106
|
-
/* @__PURE__ */
|
|
2107
|
-
|
|
2278
|
+
/* @__PURE__ */ React37.createElement(import_icons7.TextIcon, { fontSize: "large" }),
|
|
2279
|
+
/* @__PURE__ */ React37.createElement(import_ui30.Box, { sx: { maxWidth: 160, overflow: "hidden" } }, /* @__PURE__ */ React37.createElement(import_ui30.Typography, { align: "center", variant: "subtitle2", color: "text.secondary" }, (0, import_i18n10.__)("Sorry, nothing matched", "elementor")), /* @__PURE__ */ React37.createElement(
|
|
2280
|
+
import_ui30.Typography,
|
|
2108
2281
|
{
|
|
2109
2282
|
variant: "subtitle2",
|
|
2110
2283
|
color: "text.secondary",
|
|
@@ -2114,31 +2287,31 @@ var FontFamilySelector = ({
|
|
|
2114
2287
|
justifyContent: "center"
|
|
2115
2288
|
}
|
|
2116
2289
|
},
|
|
2117
|
-
/* @__PURE__ */
|
|
2118
|
-
/* @__PURE__ */
|
|
2119
|
-
/* @__PURE__ */
|
|
2290
|
+
/* @__PURE__ */ React37.createElement("span", null, "\u201C"),
|
|
2291
|
+
/* @__PURE__ */ React37.createElement("span", { style: { maxWidth: "80%", overflow: "hidden", textOverflow: "ellipsis" } }, searchValue),
|
|
2292
|
+
/* @__PURE__ */ React37.createElement("span", null, "\u201D.")
|
|
2120
2293
|
)),
|
|
2121
|
-
/* @__PURE__ */
|
|
2122
|
-
|
|
2294
|
+
/* @__PURE__ */ React37.createElement(
|
|
2295
|
+
import_ui30.Typography,
|
|
2123
2296
|
{
|
|
2124
2297
|
align: "center",
|
|
2125
2298
|
variant: "caption",
|
|
2126
2299
|
color: "text.secondary",
|
|
2127
2300
|
sx: { display: "flex", flexDirection: "column" }
|
|
2128
2301
|
},
|
|
2129
|
-
(0,
|
|
2130
|
-
/* @__PURE__ */
|
|
2131
|
-
|
|
2302
|
+
(0, import_i18n10.__)("Try something else.", "elementor"),
|
|
2303
|
+
/* @__PURE__ */ React37.createElement(
|
|
2304
|
+
import_ui30.Link,
|
|
2132
2305
|
{
|
|
2133
2306
|
color: "secondary",
|
|
2134
2307
|
variant: "caption",
|
|
2135
2308
|
component: "button",
|
|
2136
2309
|
onClick: () => setSearchValue("")
|
|
2137
2310
|
},
|
|
2138
|
-
(0,
|
|
2311
|
+
(0, import_i18n10.__)("Clear & try again", "elementor")
|
|
2139
2312
|
)
|
|
2140
2313
|
)
|
|
2141
|
-
))
|
|
2314
|
+
));
|
|
2142
2315
|
};
|
|
2143
2316
|
var FontList = ({ fontListItems, setFontFamily, handleClose, fontFamily }) => {
|
|
2144
2317
|
const selectedItem = fontListItems.find((item) => item.value === fontFamily);
|
|
@@ -2150,7 +2323,7 @@ var FontList = ({ fontListItems, setFontFamily, handleClose, fontFamily }) => {
|
|
|
2150
2323
|
}
|
|
2151
2324
|
});
|
|
2152
2325
|
}, 100);
|
|
2153
|
-
return /* @__PURE__ */
|
|
2326
|
+
return /* @__PURE__ */ React37.createElement(
|
|
2154
2327
|
import_editor_ui4.PopoverMenuList,
|
|
2155
2328
|
{
|
|
2156
2329
|
items: fontListItems,
|
|
@@ -2164,37 +2337,44 @@ var FontList = ({ fontListItems, setFontFamily, handleClose, fontFamily }) => {
|
|
|
2164
2337
|
);
|
|
2165
2338
|
};
|
|
2166
2339
|
var useDebounce = (fn, delay) => {
|
|
2167
|
-
const [debouncedFn] = (0,
|
|
2168
|
-
(0,
|
|
2340
|
+
const [debouncedFn] = (0, import_react21.useState)(() => (0, import_utils2.debounce)(fn, delay));
|
|
2341
|
+
(0, import_react21.useEffect)(() => () => debouncedFn.cancel(), [debouncedFn]);
|
|
2169
2342
|
return debouncedFn;
|
|
2170
2343
|
};
|
|
2171
2344
|
|
|
2172
2345
|
// src/controls/font-family-control/font-family-control.tsx
|
|
2173
2346
|
var SIZE3 = "tiny";
|
|
2174
2347
|
var FontFamilyControl = createControl(({ fontFamilies, sectionWidth }) => {
|
|
2175
|
-
const { value: fontFamily, setValue: setFontFamily, disabled } = useBoundProp(
|
|
2176
|
-
const popoverState = (0,
|
|
2177
|
-
|
|
2178
|
-
|
|
2348
|
+
const { value: fontFamily, setValue: setFontFamily, disabled, placeholder } = useBoundProp(import_editor_props16.stringPropTypeUtil);
|
|
2349
|
+
const popoverState = (0, import_ui31.usePopupState)({ variant: "popover" });
|
|
2350
|
+
const isShowingPlaceholder = !fontFamily && placeholder;
|
|
2351
|
+
return /* @__PURE__ */ React38.createElement(React38.Fragment, null, /* @__PURE__ */ React38.createElement(ControlActions, null, /* @__PURE__ */ React38.createElement(
|
|
2352
|
+
import_ui31.UnstableTag,
|
|
2179
2353
|
{
|
|
2180
2354
|
variant: "outlined",
|
|
2181
|
-
label: fontFamily,
|
|
2182
|
-
endIcon: /* @__PURE__ */
|
|
2183
|
-
...(0,
|
|
2355
|
+
label: fontFamily || placeholder,
|
|
2356
|
+
endIcon: /* @__PURE__ */ React38.createElement(import_icons8.ChevronDownIcon, { fontSize: SIZE3 }),
|
|
2357
|
+
...(0, import_ui31.bindTrigger)(popoverState),
|
|
2184
2358
|
fullWidth: true,
|
|
2185
|
-
disabled
|
|
2359
|
+
disabled,
|
|
2360
|
+
sx: isShowingPlaceholder ? {
|
|
2361
|
+
"& .MuiTag-label": {
|
|
2362
|
+
color: (theme) => theme.palette.text.tertiary
|
|
2363
|
+
},
|
|
2364
|
+
textTransform: "capitalize"
|
|
2365
|
+
} : void 0
|
|
2186
2366
|
}
|
|
2187
|
-
)), /* @__PURE__ */
|
|
2188
|
-
|
|
2367
|
+
)), /* @__PURE__ */ React38.createElement(
|
|
2368
|
+
import_ui31.Popover,
|
|
2189
2369
|
{
|
|
2190
2370
|
disablePortal: true,
|
|
2191
2371
|
disableScrollLock: true,
|
|
2192
2372
|
anchorOrigin: { vertical: "bottom", horizontal: "right" },
|
|
2193
2373
|
transformOrigin: { vertical: "top", horizontal: "right" },
|
|
2194
2374
|
sx: { my: 1.5 },
|
|
2195
|
-
...(0,
|
|
2375
|
+
...(0, import_ui31.bindPopover)(popoverState)
|
|
2196
2376
|
},
|
|
2197
|
-
/* @__PURE__ */
|
|
2377
|
+
/* @__PURE__ */ React38.createElement(
|
|
2198
2378
|
FontFamilySelector,
|
|
2199
2379
|
{
|
|
2200
2380
|
fontFamilies,
|
|
@@ -2208,14 +2388,14 @@ var FontFamilyControl = createControl(({ fontFamilies, sectionWidth }) => {
|
|
|
2208
2388
|
});
|
|
2209
2389
|
|
|
2210
2390
|
// src/controls/url-control.tsx
|
|
2211
|
-
var
|
|
2212
|
-
var
|
|
2213
|
-
var
|
|
2391
|
+
var React39 = __toESM(require("react"));
|
|
2392
|
+
var import_editor_props17 = require("@elementor/editor-props");
|
|
2393
|
+
var import_ui32 = require("@elementor/ui");
|
|
2214
2394
|
var UrlControl = createControl(({ placeholder }) => {
|
|
2215
|
-
const { value, setValue, disabled } = useBoundProp(
|
|
2395
|
+
const { value, setValue, disabled } = useBoundProp(import_editor_props17.urlPropTypeUtil);
|
|
2216
2396
|
const handleChange = (event) => setValue(event.target.value);
|
|
2217
|
-
return /* @__PURE__ */
|
|
2218
|
-
|
|
2397
|
+
return /* @__PURE__ */ React39.createElement(ControlActions, null, /* @__PURE__ */ React39.createElement(
|
|
2398
|
+
import_ui32.TextField,
|
|
2219
2399
|
{
|
|
2220
2400
|
size: "tiny",
|
|
2221
2401
|
fullWidth: true,
|
|
@@ -2228,24 +2408,25 @@ var UrlControl = createControl(({ placeholder }) => {
|
|
|
2228
2408
|
});
|
|
2229
2409
|
|
|
2230
2410
|
// src/controls/link-control.tsx
|
|
2231
|
-
var
|
|
2232
|
-
var
|
|
2411
|
+
var React42 = __toESM(require("react"));
|
|
2412
|
+
var import_react23 = require("react");
|
|
2233
2413
|
var import_editor_elements = require("@elementor/editor-elements");
|
|
2234
|
-
var
|
|
2414
|
+
var import_editor_props19 = require("@elementor/editor-props");
|
|
2235
2415
|
var import_editor_ui5 = require("@elementor/editor-ui");
|
|
2416
|
+
var import_editor_v1_adapters4 = require("@elementor/editor-v1-adapters");
|
|
2236
2417
|
var import_http_client2 = require("@elementor/http-client");
|
|
2237
2418
|
var import_icons10 = require("@elementor/icons");
|
|
2238
2419
|
var import_session = require("@elementor/session");
|
|
2239
|
-
var
|
|
2420
|
+
var import_ui35 = require("@elementor/ui");
|
|
2240
2421
|
var import_utils3 = require("@elementor/utils");
|
|
2241
|
-
var
|
|
2422
|
+
var import_i18n11 = require("@wordpress/i18n");
|
|
2242
2423
|
|
|
2243
2424
|
// src/components/autocomplete.tsx
|
|
2244
|
-
var
|
|
2245
|
-
var
|
|
2425
|
+
var React40 = __toESM(require("react"));
|
|
2426
|
+
var import_react22 = require("react");
|
|
2246
2427
|
var import_icons9 = require("@elementor/icons");
|
|
2247
|
-
var
|
|
2248
|
-
var Autocomplete = (0,
|
|
2428
|
+
var import_ui33 = require("@elementor/ui");
|
|
2429
|
+
var Autocomplete = (0, import_react22.forwardRef)((props, ref) => {
|
|
2249
2430
|
const {
|
|
2250
2431
|
options,
|
|
2251
2432
|
onOptionChange,
|
|
@@ -2261,8 +2442,8 @@ var Autocomplete = (0, import_react21.forwardRef)((props, ref) => {
|
|
|
2261
2442
|
const muiWarningPreventer = allowCustomValues || !!value?.toString()?.length;
|
|
2262
2443
|
const isOptionEqualToValue = muiWarningPreventer ? void 0 : () => true;
|
|
2263
2444
|
const isValueFromOptions = typeof value === "number" && !!findMatchingOption(options, value);
|
|
2264
|
-
return /* @__PURE__ */
|
|
2265
|
-
|
|
2445
|
+
return /* @__PURE__ */ React40.createElement(
|
|
2446
|
+
import_ui33.Autocomplete,
|
|
2266
2447
|
{
|
|
2267
2448
|
...restProps,
|
|
2268
2449
|
ref,
|
|
@@ -2279,8 +2460,8 @@ var Autocomplete = (0, import_react21.forwardRef)((props, ref) => {
|
|
|
2279
2460
|
groupBy: isCategorizedOptionPool(options) ? (optionId) => findMatchingOption(options, optionId)?.groupLabel || optionId : void 0,
|
|
2280
2461
|
isOptionEqualToValue,
|
|
2281
2462
|
filterOptions: () => optionKeys,
|
|
2282
|
-
renderOption: (optionProps, optionId) => /* @__PURE__ */
|
|
2283
|
-
renderInput: (params) => /* @__PURE__ */
|
|
2463
|
+
renderOption: (optionProps, optionId) => /* @__PURE__ */ React40.createElement(import_ui33.Box, { component: "li", ...optionProps, key: optionProps.id }, findMatchingOption(options, optionId)?.label ?? optionId),
|
|
2464
|
+
renderInput: (params) => /* @__PURE__ */ React40.createElement(
|
|
2284
2465
|
TextInput,
|
|
2285
2466
|
{
|
|
2286
2467
|
params,
|
|
@@ -2303,8 +2484,8 @@ var TextInput = ({
|
|
|
2303
2484
|
const onChange = (event) => {
|
|
2304
2485
|
handleChange(event.target.value);
|
|
2305
2486
|
};
|
|
2306
|
-
return /* @__PURE__ */
|
|
2307
|
-
|
|
2487
|
+
return /* @__PURE__ */ React40.createElement(
|
|
2488
|
+
import_ui33.TextField,
|
|
2308
2489
|
{
|
|
2309
2490
|
...params,
|
|
2310
2491
|
placeholder,
|
|
@@ -2316,7 +2497,7 @@ var TextInput = ({
|
|
|
2316
2497
|
},
|
|
2317
2498
|
InputProps: {
|
|
2318
2499
|
...params.InputProps,
|
|
2319
|
-
endAdornment: /* @__PURE__ */
|
|
2500
|
+
endAdornment: /* @__PURE__ */ React40.createElement(ClearButton, { params, allowClear, handleChange })
|
|
2320
2501
|
}
|
|
2321
2502
|
}
|
|
2322
2503
|
);
|
|
@@ -2325,7 +2506,7 @@ var ClearButton = ({
|
|
|
2325
2506
|
allowClear,
|
|
2326
2507
|
handleChange,
|
|
2327
2508
|
params
|
|
2328
|
-
}) => /* @__PURE__ */
|
|
2509
|
+
}) => /* @__PURE__ */ React40.createElement(import_ui33.InputAdornment, { position: "end" }, allowClear && /* @__PURE__ */ React40.createElement(import_ui33.IconButton, { size: params.size, onClick: () => handleChange(null), sx: { cursor: "pointer" } }, /* @__PURE__ */ React40.createElement(import_icons9.XIcon, { fontSize: params.size })));
|
|
2329
2510
|
function findMatchingOption(options, optionId = null) {
|
|
2330
2511
|
const formattedOption = (optionId || "").toString();
|
|
2331
2512
|
return options.find(({ id }) => formattedOption === id.toString());
|
|
@@ -2346,26 +2527,49 @@ function _factoryFilter(newValue, options, minInputLength) {
|
|
|
2346
2527
|
);
|
|
2347
2528
|
}
|
|
2348
2529
|
|
|
2530
|
+
// src/controls/switch-control.tsx
|
|
2531
|
+
var React41 = __toESM(require("react"));
|
|
2532
|
+
var import_editor_props18 = require("@elementor/editor-props");
|
|
2533
|
+
var import_ui34 = require("@elementor/ui");
|
|
2534
|
+
var SwitchControl = createControl(() => {
|
|
2535
|
+
const { value, setValue, disabled } = useBoundProp(import_editor_props18.booleanPropTypeUtil);
|
|
2536
|
+
const handleChange = (event) => {
|
|
2537
|
+
setValue(event.target.checked);
|
|
2538
|
+
};
|
|
2539
|
+
return /* @__PURE__ */ React41.createElement("div", { style: { display: "flex", justifyContent: "flex-end" } }, /* @__PURE__ */ React41.createElement(
|
|
2540
|
+
import_ui34.Switch,
|
|
2541
|
+
{
|
|
2542
|
+
checked: !!value,
|
|
2543
|
+
onChange: handleChange,
|
|
2544
|
+
size: "small",
|
|
2545
|
+
disabled,
|
|
2546
|
+
inputProps: {
|
|
2547
|
+
...disabled ? { style: { opacity: 0 } } : {}
|
|
2548
|
+
}
|
|
2549
|
+
}
|
|
2550
|
+
));
|
|
2551
|
+
});
|
|
2552
|
+
|
|
2349
2553
|
// src/controls/link-control.tsx
|
|
2350
2554
|
var SIZE4 = "tiny";
|
|
2351
2555
|
var learnMoreButton = {
|
|
2352
|
-
label: (0,
|
|
2556
|
+
label: (0, import_i18n11.__)("Learn More", "elementor"),
|
|
2353
2557
|
href: "https://go.elementor.com/element-link-inside-link-infotip"
|
|
2354
2558
|
};
|
|
2355
2559
|
var LinkControl = createControl((props) => {
|
|
2356
|
-
const { value, path, setValue, ...propContext } = useBoundProp(
|
|
2560
|
+
const { value, path, setValue, ...propContext } = useBoundProp(import_editor_props19.linkPropTypeUtil);
|
|
2357
2561
|
const [linkSessionValue, setLinkSessionValue] = (0, import_session.useSessionStorage)(path.join("/"));
|
|
2358
|
-
const [isActive, setIsActive] = (0,
|
|
2562
|
+
const [isActive, setIsActive] = (0, import_react23.useState)(!!value);
|
|
2359
2563
|
const {
|
|
2360
2564
|
allowCustomValues,
|
|
2361
2565
|
queryOptions: { endpoint = "", requestParams = {} },
|
|
2362
2566
|
placeholder,
|
|
2363
2567
|
minInputLength = 2,
|
|
2364
2568
|
context: { elementId },
|
|
2365
|
-
label = (0,
|
|
2569
|
+
label = (0, import_i18n11.__)("Link", "elementor")
|
|
2366
2570
|
} = props || {};
|
|
2367
|
-
const [linkInLinkRestriction, setLinkInLinkRestriction] = (0,
|
|
2368
|
-
const [options, setOptions] = (0,
|
|
2571
|
+
const [linkInLinkRestriction, setLinkInLinkRestriction] = (0, import_react23.useState)((0, import_editor_elements.getLinkInLinkRestriction)(elementId));
|
|
2572
|
+
const [options, setOptions] = (0, import_react23.useState)(
|
|
2369
2573
|
generateFirstLoadedOption(value)
|
|
2370
2574
|
);
|
|
2371
2575
|
const shouldDisableAddingLink = !isActive && linkInLinkRestriction.shouldRestrict;
|
|
@@ -2390,8 +2594,8 @@ var LinkControl = createControl((props) => {
|
|
|
2390
2594
|
const onOptionChange = (newValue) => {
|
|
2391
2595
|
const valueToSave = newValue ? {
|
|
2392
2596
|
...value,
|
|
2393
|
-
destination:
|
|
2394
|
-
label:
|
|
2597
|
+
destination: import_editor_props19.numberPropTypeUtil.create(newValue),
|
|
2598
|
+
label: import_editor_props19.stringPropTypeUtil.create(findMatchingOption(options, newValue)?.label || null)
|
|
2395
2599
|
} : null;
|
|
2396
2600
|
onSaveNewValue(valueToSave);
|
|
2397
2601
|
};
|
|
@@ -2399,8 +2603,8 @@ var LinkControl = createControl((props) => {
|
|
|
2399
2603
|
newValue = newValue?.trim() || "";
|
|
2400
2604
|
const valueToSave = newValue ? {
|
|
2401
2605
|
...value,
|
|
2402
|
-
destination:
|
|
2403
|
-
label:
|
|
2606
|
+
destination: import_editor_props19.urlPropTypeUtil.create(newValue),
|
|
2607
|
+
label: import_editor_props19.stringPropTypeUtil.create("")
|
|
2404
2608
|
} : null;
|
|
2405
2609
|
onSaveNewValue(valueToSave);
|
|
2406
2610
|
updateOptions(newValue);
|
|
@@ -2416,7 +2620,7 @@ var LinkControl = createControl((props) => {
|
|
|
2416
2620
|
}
|
|
2417
2621
|
debounceFetch({ ...requestParams, term: newValue });
|
|
2418
2622
|
};
|
|
2419
|
-
const debounceFetch = (0,
|
|
2623
|
+
const debounceFetch = (0, import_react23.useMemo)(
|
|
2420
2624
|
() => (0, import_utils3.debounce)(
|
|
2421
2625
|
(params) => fetchOptions(endpoint, params).then((newOptions) => {
|
|
2422
2626
|
setOptions(formatOptions(newOptions));
|
|
@@ -2425,8 +2629,8 @@ var LinkControl = createControl((props) => {
|
|
|
2425
2629
|
),
|
|
2426
2630
|
[endpoint]
|
|
2427
2631
|
);
|
|
2428
|
-
return /* @__PURE__ */
|
|
2429
|
-
|
|
2632
|
+
return /* @__PURE__ */ React42.createElement(PropProvider, { ...propContext, value, setValue }, /* @__PURE__ */ React42.createElement(import_ui35.Stack, { gap: 1.5 }, /* @__PURE__ */ React42.createElement(
|
|
2633
|
+
import_ui35.Stack,
|
|
2430
2634
|
{
|
|
2431
2635
|
direction: "row",
|
|
2432
2636
|
sx: {
|
|
@@ -2435,17 +2639,17 @@ var LinkControl = createControl((props) => {
|
|
|
2435
2639
|
marginInlineEnd: -0.75
|
|
2436
2640
|
}
|
|
2437
2641
|
},
|
|
2438
|
-
/* @__PURE__ */
|
|
2439
|
-
/* @__PURE__ */
|
|
2642
|
+
/* @__PURE__ */ React42.createElement(ControlFormLabel, null, label),
|
|
2643
|
+
/* @__PURE__ */ React42.createElement(ConditionalInfoTip, { isVisible: !isActive, linkInLinkRestriction }, /* @__PURE__ */ React42.createElement(
|
|
2440
2644
|
ToggleIconControl,
|
|
2441
2645
|
{
|
|
2442
2646
|
disabled: shouldDisableAddingLink,
|
|
2443
2647
|
active: isActive,
|
|
2444
2648
|
onIconClick: onEnabledChange,
|
|
2445
|
-
label: (0,
|
|
2649
|
+
label: (0, import_i18n11.__)("Toggle link", "elementor")
|
|
2446
2650
|
}
|
|
2447
2651
|
))
|
|
2448
|
-
), /* @__PURE__ */
|
|
2652
|
+
), /* @__PURE__ */ React42.createElement(import_ui35.Collapse, { in: isActive, timeout: "auto", unmountOnExit: true }, /* @__PURE__ */ React42.createElement(import_ui35.Stack, { gap: 1.5 }, /* @__PURE__ */ React42.createElement(PropKeyProvider, { bind: "destination" }, /* @__PURE__ */ React42.createElement(ControlActions, null, /* @__PURE__ */ React42.createElement(
|
|
2449
2653
|
Autocomplete,
|
|
2450
2654
|
{
|
|
2451
2655
|
options,
|
|
@@ -2456,22 +2660,31 @@ var LinkControl = createControl((props) => {
|
|
|
2456
2660
|
onTextChange,
|
|
2457
2661
|
minInputLength
|
|
2458
2662
|
}
|
|
2459
|
-
))), /* @__PURE__ */
|
|
2663
|
+
))), /* @__PURE__ */ React42.createElement(PropKeyProvider, { bind: "isTargetBlank" }, /* @__PURE__ */ React42.createElement(import_ui35.Grid, { container: true, alignItems: "center", flexWrap: "nowrap", justifyContent: "space-between" }, /* @__PURE__ */ React42.createElement(import_ui35.Grid, { item: true }, /* @__PURE__ */ React42.createElement(ControlFormLabel, null, (0, import_i18n11.__)("Open in a new tab", "elementor"))), /* @__PURE__ */ React42.createElement(import_ui35.Grid, { item: true, sx: { marginInlineEnd: -1 } }, /* @__PURE__ */ React42.createElement(SwitchControlComponent, { disabled: propContext.disabled || !value }))))))));
|
|
2460
2664
|
});
|
|
2461
2665
|
var ToggleIconControl = ({ disabled, active, onIconClick, label }) => {
|
|
2462
|
-
return /* @__PURE__ */
|
|
2666
|
+
return /* @__PURE__ */ React42.createElement(import_ui35.IconButton, { size: SIZE4, onClick: onIconClick, "aria-label": label, disabled }, active ? /* @__PURE__ */ React42.createElement(import_icons10.MinusIcon, { fontSize: SIZE4 }) : /* @__PURE__ */ React42.createElement(import_icons10.PlusIcon, { fontSize: SIZE4 }));
|
|
2463
2667
|
};
|
|
2464
|
-
var
|
|
2465
|
-
const { value
|
|
2668
|
+
var SwitchControlComponent = ({ disabled }) => {
|
|
2669
|
+
const { value, setValue } = useBoundProp(import_editor_props19.booleanPropTypeUtil);
|
|
2670
|
+
const isVersion331Active = (0, import_editor_v1_adapters4.isExperimentActive)("e_v_3_31");
|
|
2671
|
+
if (isVersion331Active) {
|
|
2672
|
+
return /* @__PURE__ */ React42.createElement(SwitchControl, null);
|
|
2673
|
+
}
|
|
2466
2674
|
const onClick = () => {
|
|
2467
2675
|
setValue(!value);
|
|
2468
2676
|
};
|
|
2469
|
-
|
|
2470
|
-
|
|
2471
|
-
|
|
2677
|
+
return /* @__PURE__ */ React42.createElement(
|
|
2678
|
+
import_ui35.Switch,
|
|
2679
|
+
{
|
|
2680
|
+
checked: value ?? false,
|
|
2681
|
+
onClick,
|
|
2682
|
+
disabled,
|
|
2683
|
+
inputProps: {
|
|
2684
|
+
...disabled ? { style: { opacity: 0 } } : {}
|
|
2685
|
+
}
|
|
2472
2686
|
}
|
|
2473
|
-
|
|
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 })));
|
|
2687
|
+
);
|
|
2475
2688
|
};
|
|
2476
2689
|
async function fetchOptions(ajaxUrl, params) {
|
|
2477
2690
|
if (!params || !ajaxUrl) {
|
|
@@ -2508,54 +2721,54 @@ var ConditionalInfoTip = ({ linkInLinkRestriction, isVisible, children }) => {
|
|
|
2508
2721
|
(0, import_editor_elements.selectElement)(elementId);
|
|
2509
2722
|
}
|
|
2510
2723
|
};
|
|
2511
|
-
return shouldRestrict && isVisible ? /* @__PURE__ */
|
|
2512
|
-
|
|
2724
|
+
return shouldRestrict && isVisible ? /* @__PURE__ */ React42.createElement(
|
|
2725
|
+
import_ui35.Infotip,
|
|
2513
2726
|
{
|
|
2514
2727
|
placement: "right",
|
|
2515
|
-
content: /* @__PURE__ */
|
|
2728
|
+
content: /* @__PURE__ */ React42.createElement(
|
|
2516
2729
|
import_editor_ui5.InfoTipCard,
|
|
2517
2730
|
{
|
|
2518
2731
|
content: INFOTIP_CONTENT[reason],
|
|
2519
|
-
svgIcon: /* @__PURE__ */
|
|
2732
|
+
svgIcon: /* @__PURE__ */ React42.createElement(import_icons10.AlertTriangleIcon, null),
|
|
2520
2733
|
learnMoreButton,
|
|
2521
2734
|
ctaButton: {
|
|
2522
|
-
label: (0,
|
|
2735
|
+
label: (0, import_i18n11.__)("Take me there", "elementor"),
|
|
2523
2736
|
onClick: handleTakeMeClick
|
|
2524
2737
|
}
|
|
2525
2738
|
}
|
|
2526
2739
|
)
|
|
2527
2740
|
},
|
|
2528
|
-
/* @__PURE__ */
|
|
2529
|
-
) : /* @__PURE__ */
|
|
2741
|
+
/* @__PURE__ */ React42.createElement(import_ui35.Box, null, children)
|
|
2742
|
+
) : /* @__PURE__ */ React42.createElement(React42.Fragment, null, children);
|
|
2530
2743
|
};
|
|
2531
2744
|
var INFOTIP_CONTENT = {
|
|
2532
|
-
descendant: /* @__PURE__ */
|
|
2533
|
-
ancestor: /* @__PURE__ */
|
|
2745
|
+
descendant: /* @__PURE__ */ React42.createElement(React42.Fragment, null, (0, import_i18n11.__)("To add a link to this container,", "elementor"), /* @__PURE__ */ React42.createElement("br", null), (0, import_i18n11.__)("first remove the link from the elements inside of it.", "elementor")),
|
|
2746
|
+
ancestor: /* @__PURE__ */ React42.createElement(React42.Fragment, null, (0, import_i18n11.__)("To add a link to this element,", "elementor"), /* @__PURE__ */ React42.createElement("br", null), (0, import_i18n11.__)("first remove the link from its parent container.", "elementor"))
|
|
2534
2747
|
};
|
|
2535
2748
|
|
|
2536
2749
|
// src/controls/gap-control.tsx
|
|
2537
|
-
var
|
|
2538
|
-
var
|
|
2539
|
-
var
|
|
2750
|
+
var React43 = __toESM(require("react"));
|
|
2751
|
+
var import_react24 = require("react");
|
|
2752
|
+
var import_editor_props20 = require("@elementor/editor-props");
|
|
2540
2753
|
var import_icons11 = require("@elementor/icons");
|
|
2541
|
-
var
|
|
2542
|
-
var
|
|
2754
|
+
var import_ui36 = require("@elementor/ui");
|
|
2755
|
+
var import_i18n12 = require("@wordpress/i18n");
|
|
2543
2756
|
var GapControl = createControl(({ label }) => {
|
|
2544
2757
|
const {
|
|
2545
2758
|
value: directionValue,
|
|
2546
2759
|
setValue: setDirectionValue,
|
|
2547
2760
|
propType,
|
|
2548
2761
|
disabled: directionDisabled
|
|
2549
|
-
} = useBoundProp(
|
|
2550
|
-
const stackRef = (0,
|
|
2551
|
-
const { value: sizeValue, setValue: setSizeValue, disabled: sizeDisabled } = useBoundProp(
|
|
2762
|
+
} = useBoundProp(import_editor_props20.layoutDirectionPropTypeUtil);
|
|
2763
|
+
const stackRef = (0, import_react24.useRef)(null);
|
|
2764
|
+
const { value: sizeValue, setValue: setSizeValue, disabled: sizeDisabled } = useBoundProp(import_editor_props20.sizePropTypeUtil);
|
|
2552
2765
|
const isLinked = !directionValue && !sizeValue ? true : !!sizeValue;
|
|
2553
2766
|
const onLinkToggle = () => {
|
|
2554
2767
|
if (!isLinked) {
|
|
2555
2768
|
setSizeValue(directionValue?.column?.value ?? null);
|
|
2556
2769
|
return;
|
|
2557
2770
|
}
|
|
2558
|
-
const value = sizeValue ?
|
|
2771
|
+
const value = sizeValue ? import_editor_props20.sizePropTypeUtil.create(sizeValue) : null;
|
|
2559
2772
|
setDirectionValue({
|
|
2560
2773
|
row: value,
|
|
2561
2774
|
column: value
|
|
@@ -2563,11 +2776,11 @@ var GapControl = createControl(({ label }) => {
|
|
|
2563
2776
|
};
|
|
2564
2777
|
const tooltipLabel = label.toLowerCase();
|
|
2565
2778
|
const LinkedIcon = isLinked ? import_icons11.LinkIcon : import_icons11.DetachIcon;
|
|
2566
|
-
const linkedLabel = (0,
|
|
2567
|
-
const unlinkedLabel = (0,
|
|
2779
|
+
const linkedLabel = (0, import_i18n12.__)("Link %s", "elementor").replace("%s", tooltipLabel);
|
|
2780
|
+
const unlinkedLabel = (0, import_i18n12.__)("Unlink %s", "elementor").replace("%s", tooltipLabel);
|
|
2568
2781
|
const disabled = sizeDisabled || directionDisabled;
|
|
2569
|
-
return /* @__PURE__ */
|
|
2570
|
-
|
|
2782
|
+
return /* @__PURE__ */ React43.createElement(PropProvider, { propType, value: directionValue, setValue: setDirectionValue }, /* @__PURE__ */ React43.createElement(import_ui36.Stack, { direction: "row", gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React43.createElement(ControlLabel, null, label), /* @__PURE__ */ React43.createElement(import_ui36.Tooltip, { title: isLinked ? unlinkedLabel : linkedLabel, placement: "top" }, /* @__PURE__ */ React43.createElement(
|
|
2783
|
+
import_ui36.ToggleButton,
|
|
2571
2784
|
{
|
|
2572
2785
|
"aria-label": isLinked ? unlinkedLabel : linkedLabel,
|
|
2573
2786
|
size: "tiny",
|
|
@@ -2577,8 +2790,8 @@ var GapControl = createControl(({ label }) => {
|
|
|
2577
2790
|
onChange: onLinkToggle,
|
|
2578
2791
|
disabled
|
|
2579
2792
|
},
|
|
2580
|
-
/* @__PURE__ */
|
|
2581
|
-
))), /* @__PURE__ */
|
|
2793
|
+
/* @__PURE__ */ React43.createElement(LinkedIcon, { fontSize: "tiny" })
|
|
2794
|
+
))), /* @__PURE__ */ React43.createElement(import_ui36.Stack, { direction: "row", gap: 2, flexWrap: "nowrap", ref: stackRef }, /* @__PURE__ */ React43.createElement(import_ui36.Grid, { container: true, gap: 0.75, alignItems: "center" }, /* @__PURE__ */ React43.createElement(import_ui36.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React43.createElement(ControlFormLabel, null, (0, import_i18n12.__)("Column", "elementor"))), /* @__PURE__ */ React43.createElement(import_ui36.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React43.createElement(Control4, { bind: "column", isLinked, anchorRef: stackRef }))), /* @__PURE__ */ React43.createElement(import_ui36.Grid, { container: true, gap: 0.75, alignItems: "center" }, /* @__PURE__ */ React43.createElement(import_ui36.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React43.createElement(ControlFormLabel, null, (0, import_i18n12.__)("Row", "elementor"))), /* @__PURE__ */ React43.createElement(import_ui36.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React43.createElement(Control4, { bind: "row", isLinked, anchorRef: stackRef })))));
|
|
2582
2795
|
});
|
|
2583
2796
|
var Control4 = ({
|
|
2584
2797
|
bind,
|
|
@@ -2586,21 +2799,21 @@ var Control4 = ({
|
|
|
2586
2799
|
anchorRef
|
|
2587
2800
|
}) => {
|
|
2588
2801
|
if (isLinked) {
|
|
2589
|
-
return /* @__PURE__ */
|
|
2802
|
+
return /* @__PURE__ */ React43.createElement(SizeControl, { anchorRef });
|
|
2590
2803
|
}
|
|
2591
|
-
return /* @__PURE__ */
|
|
2804
|
+
return /* @__PURE__ */ React43.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React43.createElement(SizeControl, { anchorRef }));
|
|
2592
2805
|
};
|
|
2593
2806
|
|
|
2594
2807
|
// src/controls/aspect-ratio-control.tsx
|
|
2595
|
-
var
|
|
2596
|
-
var
|
|
2597
|
-
var
|
|
2808
|
+
var React44 = __toESM(require("react"));
|
|
2809
|
+
var import_react25 = require("react");
|
|
2810
|
+
var import_editor_props21 = require("@elementor/editor-props");
|
|
2598
2811
|
var import_editor_ui6 = require("@elementor/editor-ui");
|
|
2599
2812
|
var import_icons12 = require("@elementor/icons");
|
|
2600
|
-
var
|
|
2601
|
-
var
|
|
2813
|
+
var import_ui37 = require("@elementor/ui");
|
|
2814
|
+
var import_i18n13 = require("@wordpress/i18n");
|
|
2602
2815
|
var RATIO_OPTIONS = [
|
|
2603
|
-
{ label: (0,
|
|
2816
|
+
{ label: (0, import_i18n13.__)("Auto", "elementor"), value: "auto" },
|
|
2604
2817
|
{ label: "1/1", value: "1/1" },
|
|
2605
2818
|
{ label: "4/3", value: "4/3" },
|
|
2606
2819
|
{ label: "3/4", value: "3/4" },
|
|
@@ -2611,16 +2824,16 @@ var RATIO_OPTIONS = [
|
|
|
2611
2824
|
];
|
|
2612
2825
|
var CUSTOM_RATIO = "custom";
|
|
2613
2826
|
var AspectRatioControl = createControl(({ label }) => {
|
|
2614
|
-
const { value: aspectRatioValue, setValue: setAspectRatioValue, disabled } = useBoundProp(
|
|
2827
|
+
const { value: aspectRatioValue, setValue: setAspectRatioValue, disabled } = useBoundProp(import_editor_props21.stringPropTypeUtil);
|
|
2615
2828
|
const isCustomSelected = aspectRatioValue && !RATIO_OPTIONS.some((option) => option.value === aspectRatioValue);
|
|
2616
2829
|
const [initialWidth, initialHeight] = isCustomSelected ? aspectRatioValue.split("/") : ["", ""];
|
|
2617
|
-
const [isCustom, setIsCustom] = (0,
|
|
2618
|
-
const [customWidth, setCustomWidth] = (0,
|
|
2619
|
-
const [customHeight, setCustomHeight] = (0,
|
|
2620
|
-
const [selectedValue, setSelectedValue] = (0,
|
|
2830
|
+
const [isCustom, setIsCustom] = (0, import_react25.useState)(isCustomSelected);
|
|
2831
|
+
const [customWidth, setCustomWidth] = (0, import_react25.useState)(initialWidth);
|
|
2832
|
+
const [customHeight, setCustomHeight] = (0, import_react25.useState)(initialHeight);
|
|
2833
|
+
const [selectedValue, setSelectedValue] = (0, import_react25.useState)(
|
|
2621
2834
|
isCustomSelected ? CUSTOM_RATIO : aspectRatioValue || ""
|
|
2622
2835
|
);
|
|
2623
|
-
(0,
|
|
2836
|
+
(0, import_react25.useEffect)(() => {
|
|
2624
2837
|
const isCustomValue = aspectRatioValue && !RATIO_OPTIONS.some((option) => option.value === aspectRatioValue);
|
|
2625
2838
|
if (isCustomValue) {
|
|
2626
2839
|
const [width, height] = aspectRatioValue.split("/");
|
|
@@ -2659,8 +2872,8 @@ var AspectRatioControl = createControl(({ label }) => {
|
|
|
2659
2872
|
setAspectRatioValue(`${customWidth}/${newHeight}`);
|
|
2660
2873
|
}
|
|
2661
2874
|
};
|
|
2662
|
-
return /* @__PURE__ */
|
|
2663
|
-
|
|
2875
|
+
return /* @__PURE__ */ React44.createElement(ControlActions, null, /* @__PURE__ */ React44.createElement(import_ui37.Stack, { direction: "column", gap: 2 }, /* @__PURE__ */ React44.createElement(import_ui37.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React44.createElement(import_ui37.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React44.createElement(ControlLabel, null, label)), /* @__PURE__ */ React44.createElement(import_ui37.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React44.createElement(
|
|
2876
|
+
import_ui37.Select,
|
|
2664
2877
|
{
|
|
2665
2878
|
size: "tiny",
|
|
2666
2879
|
displayEmpty: true,
|
|
@@ -2670,11 +2883,11 @@ var AspectRatioControl = createControl(({ label }) => {
|
|
|
2670
2883
|
onChange: handleSelectChange,
|
|
2671
2884
|
fullWidth: true
|
|
2672
2885
|
},
|
|
2673
|
-
[...RATIO_OPTIONS, { label: (0,
|
|
2674
|
-
({ label: optionLabel, ...props }) => /* @__PURE__ */
|
|
2886
|
+
[...RATIO_OPTIONS, { label: (0, import_i18n13.__)("Custom", "elementor"), value: CUSTOM_RATIO }].map(
|
|
2887
|
+
({ label: optionLabel, ...props }) => /* @__PURE__ */ React44.createElement(import_editor_ui6.MenuListItem, { key: props.value, ...props, value: props.value ?? "" }, optionLabel)
|
|
2675
2888
|
)
|
|
2676
|
-
))), isCustom && /* @__PURE__ */
|
|
2677
|
-
|
|
2889
|
+
))), isCustom && /* @__PURE__ */ React44.createElement(import_ui37.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React44.createElement(import_ui37.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React44.createElement(
|
|
2890
|
+
import_ui37.TextField,
|
|
2678
2891
|
{
|
|
2679
2892
|
size: "tiny",
|
|
2680
2893
|
type: "number",
|
|
@@ -2683,11 +2896,11 @@ var AspectRatioControl = createControl(({ label }) => {
|
|
|
2683
2896
|
value: customWidth,
|
|
2684
2897
|
onChange: handleCustomWidthChange,
|
|
2685
2898
|
InputProps: {
|
|
2686
|
-
startAdornment: /* @__PURE__ */
|
|
2899
|
+
startAdornment: /* @__PURE__ */ React44.createElement(import_icons12.ArrowsMoveHorizontalIcon, { fontSize: "tiny" })
|
|
2687
2900
|
}
|
|
2688
2901
|
}
|
|
2689
|
-
)), /* @__PURE__ */
|
|
2690
|
-
|
|
2902
|
+
)), /* @__PURE__ */ React44.createElement(import_ui37.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React44.createElement(
|
|
2903
|
+
import_ui37.TextField,
|
|
2691
2904
|
{
|
|
2692
2905
|
size: "tiny",
|
|
2693
2906
|
type: "number",
|
|
@@ -2696,39 +2909,39 @@ var AspectRatioControl = createControl(({ label }) => {
|
|
|
2696
2909
|
value: customHeight,
|
|
2697
2910
|
onChange: handleCustomHeightChange,
|
|
2698
2911
|
InputProps: {
|
|
2699
|
-
startAdornment: /* @__PURE__ */
|
|
2912
|
+
startAdornment: /* @__PURE__ */ React44.createElement(import_icons12.ArrowsMoveVerticalIcon, { fontSize: "tiny" })
|
|
2700
2913
|
}
|
|
2701
2914
|
}
|
|
2702
2915
|
)))));
|
|
2703
2916
|
});
|
|
2704
2917
|
|
|
2705
2918
|
// src/controls/svg-media-control.tsx
|
|
2706
|
-
var
|
|
2707
|
-
var
|
|
2708
|
-
var
|
|
2919
|
+
var React46 = __toESM(require("react"));
|
|
2920
|
+
var import_react27 = require("react");
|
|
2921
|
+
var import_editor_props22 = require("@elementor/editor-props");
|
|
2709
2922
|
var import_icons13 = require("@elementor/icons");
|
|
2710
|
-
var
|
|
2923
|
+
var import_ui39 = require("@elementor/ui");
|
|
2711
2924
|
var import_wp_media2 = require("@elementor/wp-media");
|
|
2712
|
-
var
|
|
2925
|
+
var import_i18n15 = require("@wordpress/i18n");
|
|
2713
2926
|
|
|
2714
2927
|
// src/components/enable-unfiltered-modal.tsx
|
|
2715
|
-
var
|
|
2716
|
-
var
|
|
2928
|
+
var React45 = __toESM(require("react"));
|
|
2929
|
+
var import_react26 = require("react");
|
|
2717
2930
|
var import_editor_current_user = require("@elementor/editor-current-user");
|
|
2718
|
-
var
|
|
2719
|
-
var
|
|
2720
|
-
var ADMIN_TITLE_TEXT = (0,
|
|
2721
|
-
var ADMIN_CONTENT_TEXT = (0,
|
|
2931
|
+
var import_ui38 = require("@elementor/ui");
|
|
2932
|
+
var import_i18n14 = require("@wordpress/i18n");
|
|
2933
|
+
var ADMIN_TITLE_TEXT = (0, import_i18n14.__)("Enable Unfiltered Uploads", "elementor");
|
|
2934
|
+
var ADMIN_CONTENT_TEXT = (0, import_i18n14.__)(
|
|
2722
2935
|
"Before you enable unfiltered files upload, note that such files include a security risk. Elementor does run a process to remove possible malicious code, but there is still risk involved when using such files.",
|
|
2723
2936
|
"elementor"
|
|
2724
2937
|
);
|
|
2725
|
-
var NON_ADMIN_TITLE_TEXT = (0,
|
|
2726
|
-
var NON_ADMIN_CONTENT_TEXT = (0,
|
|
2938
|
+
var NON_ADMIN_TITLE_TEXT = (0, import_i18n14.__)("Sorry, you can't upload that file yet", "elementor");
|
|
2939
|
+
var NON_ADMIN_CONTENT_TEXT = (0, import_i18n14.__)(
|
|
2727
2940
|
"This is because this file type may pose a security risk. To upload them anyway, ask the site administrator to enable unfiltered file uploads.",
|
|
2728
2941
|
"elementor"
|
|
2729
2942
|
);
|
|
2730
|
-
var ADMIN_FAILED_CONTENT_TEXT_PT1 = (0,
|
|
2731
|
-
var ADMIN_FAILED_CONTENT_TEXT_PT2 = (0,
|
|
2943
|
+
var ADMIN_FAILED_CONTENT_TEXT_PT1 = (0, import_i18n14.__)("Failed to enable unfiltered files upload.", "elementor");
|
|
2944
|
+
var ADMIN_FAILED_CONTENT_TEXT_PT2 = (0, import_i18n14.__)(
|
|
2732
2945
|
"You can try again, if the problem persists, please contact support.",
|
|
2733
2946
|
"elementor"
|
|
2734
2947
|
);
|
|
@@ -2736,7 +2949,7 @@ var WAIT_FOR_CLOSE_TIMEOUT_MS = 300;
|
|
|
2736
2949
|
var EnableUnfilteredModal = (props) => {
|
|
2737
2950
|
const { mutateAsync, isPending } = useUpdateUnfilteredFilesUpload();
|
|
2738
2951
|
const { canUser } = (0, import_editor_current_user.useCurrentUserCapabilities)();
|
|
2739
|
-
const [isError, setIsError] = (0,
|
|
2952
|
+
const [isError, setIsError] = (0, import_react26.useState)(false);
|
|
2740
2953
|
const canManageOptions = canUser("manage_options");
|
|
2741
2954
|
const onClose = (enabled) => {
|
|
2742
2955
|
props.onClose(enabled);
|
|
@@ -2755,10 +2968,10 @@ var EnableUnfilteredModal = (props) => {
|
|
|
2755
2968
|
}
|
|
2756
2969
|
};
|
|
2757
2970
|
const dialogProps = { ...props, isPending, handleEnable, isError, onClose };
|
|
2758
|
-
return canManageOptions ? /* @__PURE__ */
|
|
2971
|
+
return canManageOptions ? /* @__PURE__ */ React45.createElement(AdminDialog, { ...dialogProps }) : /* @__PURE__ */ React45.createElement(NonAdminDialog, { ...dialogProps });
|
|
2759
2972
|
};
|
|
2760
|
-
var AdminDialog = ({ open, onClose, handleEnable, isPending, isError }) => /* @__PURE__ */
|
|
2761
|
-
|
|
2973
|
+
var AdminDialog = ({ open, onClose, handleEnable, isPending, isError }) => /* @__PURE__ */ React45.createElement(import_ui38.Dialog, { open, maxWidth: "sm", onClose: () => onClose(false) }, /* @__PURE__ */ React45.createElement(import_ui38.DialogHeader, { logo: false }, /* @__PURE__ */ React45.createElement(import_ui38.DialogTitle, null, ADMIN_TITLE_TEXT)), /* @__PURE__ */ React45.createElement(import_ui38.Divider, null), /* @__PURE__ */ React45.createElement(import_ui38.DialogContent, null, /* @__PURE__ */ React45.createElement(import_ui38.DialogContentText, null, isError ? /* @__PURE__ */ React45.createElement(React45.Fragment, null, ADMIN_FAILED_CONTENT_TEXT_PT1, " ", /* @__PURE__ */ React45.createElement("br", null), " ", ADMIN_FAILED_CONTENT_TEXT_PT2) : ADMIN_CONTENT_TEXT)), /* @__PURE__ */ React45.createElement(import_ui38.DialogActions, null, /* @__PURE__ */ React45.createElement(import_ui38.Button, { size: "medium", color: "secondary", onClick: () => onClose(false) }, (0, import_i18n14.__)("Cancel", "elementor")), /* @__PURE__ */ React45.createElement(
|
|
2974
|
+
import_ui38.Button,
|
|
2762
2975
|
{
|
|
2763
2976
|
size: "medium",
|
|
2764
2977
|
onClick: () => handleEnable(),
|
|
@@ -2766,16 +2979,16 @@ var AdminDialog = ({ open, onClose, handleEnable, isPending, isError }) => /* @_
|
|
|
2766
2979
|
color: "primary",
|
|
2767
2980
|
disabled: isPending
|
|
2768
2981
|
},
|
|
2769
|
-
isPending ? /* @__PURE__ */
|
|
2982
|
+
isPending ? /* @__PURE__ */ React45.createElement(import_ui38.CircularProgress, { size: 24 }) : (0, import_i18n14.__)("Enable", "elementor")
|
|
2770
2983
|
)));
|
|
2771
|
-
var NonAdminDialog = ({ open, onClose }) => /* @__PURE__ */
|
|
2984
|
+
var NonAdminDialog = ({ open, onClose }) => /* @__PURE__ */ React45.createElement(import_ui38.Dialog, { open, maxWidth: "sm", onClose: () => onClose(false) }, /* @__PURE__ */ React45.createElement(import_ui38.DialogHeader, { logo: false }, /* @__PURE__ */ React45.createElement(import_ui38.DialogTitle, null, NON_ADMIN_TITLE_TEXT)), /* @__PURE__ */ React45.createElement(import_ui38.Divider, null), /* @__PURE__ */ React45.createElement(import_ui38.DialogContent, null, /* @__PURE__ */ React45.createElement(import_ui38.DialogContentText, null, NON_ADMIN_CONTENT_TEXT)), /* @__PURE__ */ React45.createElement(import_ui38.DialogActions, null, /* @__PURE__ */ React45.createElement(import_ui38.Button, { size: "medium", onClick: () => onClose(false), variant: "contained", color: "primary" }, (0, import_i18n14.__)("Got it", "elementor"))));
|
|
2772
2985
|
|
|
2773
2986
|
// src/controls/svg-media-control.tsx
|
|
2774
2987
|
var TILE_SIZE = 8;
|
|
2775
2988
|
var TILE_WHITE = "transparent";
|
|
2776
2989
|
var TILE_BLACK = "#c1c1c1";
|
|
2777
2990
|
var TILES_GRADIENT_FORMULA = `linear-gradient(45deg, ${TILE_BLACK} 25%, ${TILE_WHITE} 0, ${TILE_WHITE} 75%, ${TILE_BLACK} 0, ${TILE_BLACK})`;
|
|
2778
|
-
var StyledCard = (0,
|
|
2991
|
+
var StyledCard = (0, import_ui39.styled)(import_ui39.Card)`
|
|
2779
2992
|
background-color: white;
|
|
2780
2993
|
background-image: ${TILES_GRADIENT_FORMULA}, ${TILES_GRADIENT_FORMULA};
|
|
2781
2994
|
background-size: ${TILE_SIZE}px ${TILE_SIZE}px;
|
|
@@ -2784,7 +2997,7 @@ var StyledCard = (0, import_ui36.styled)(import_ui36.Card)`
|
|
|
2784
2997
|
${TILE_SIZE / 2}px ${TILE_SIZE / 2}px;
|
|
2785
2998
|
border: none;
|
|
2786
2999
|
`;
|
|
2787
|
-
var StyledCardMediaContainer = (0,
|
|
3000
|
+
var StyledCardMediaContainer = (0, import_ui39.styled)(import_ui39.Stack)`
|
|
2788
3001
|
position: relative;
|
|
2789
3002
|
height: 140px;
|
|
2790
3003
|
object-fit: contain;
|
|
@@ -2796,12 +3009,12 @@ var StyledCardMediaContainer = (0, import_ui36.styled)(import_ui36.Stack)`
|
|
|
2796
3009
|
var MODE_BROWSE = { mode: "browse" };
|
|
2797
3010
|
var MODE_UPLOAD = { mode: "upload" };
|
|
2798
3011
|
var SvgMediaControl = createControl(() => {
|
|
2799
|
-
const { value, setValue } = useBoundProp(
|
|
3012
|
+
const { value, setValue } = useBoundProp(import_editor_props22.imageSrcPropTypeUtil);
|
|
2800
3013
|
const { id, url } = value ?? {};
|
|
2801
3014
|
const { data: attachment, isFetching } = (0, import_wp_media2.useWpMediaAttachment)(id?.value || null);
|
|
2802
3015
|
const src = attachment?.url ?? url?.value ?? null;
|
|
2803
3016
|
const { data: allowSvgUpload } = useUnfilteredFilesUpload();
|
|
2804
|
-
const [unfilteredModalOpenState, setUnfilteredModalOpenState] = (0,
|
|
3017
|
+
const [unfilteredModalOpenState, setUnfilteredModalOpenState] = (0, import_react27.useState)(false);
|
|
2805
3018
|
const { open } = (0, import_wp_media2.useWpMediaFrame)({
|
|
2806
3019
|
mediaTypes: ["svg"],
|
|
2807
3020
|
multiple: false,
|
|
@@ -2829,16 +3042,16 @@ var SvgMediaControl = createControl(() => {
|
|
|
2829
3042
|
open(openOptions);
|
|
2830
3043
|
}
|
|
2831
3044
|
};
|
|
2832
|
-
return /* @__PURE__ */
|
|
2833
|
-
|
|
3045
|
+
return /* @__PURE__ */ React46.createElement(import_ui39.Stack, { gap: 1 }, /* @__PURE__ */ React46.createElement(EnableUnfilteredModal, { open: unfilteredModalOpenState, onClose: onCloseUnfilteredModal }), /* @__PURE__ */ React46.createElement(ControlActions, null, /* @__PURE__ */ React46.createElement(StyledCard, { variant: "outlined" }, /* @__PURE__ */ React46.createElement(StyledCardMediaContainer, null, isFetching ? /* @__PURE__ */ React46.createElement(import_ui39.CircularProgress, { role: "progressbar" }) : /* @__PURE__ */ React46.createElement(
|
|
3046
|
+
import_ui39.CardMedia,
|
|
2834
3047
|
{
|
|
2835
3048
|
component: "img",
|
|
2836
3049
|
image: src,
|
|
2837
|
-
alt: (0,
|
|
3050
|
+
alt: (0, import_i18n15.__)("Preview SVG", "elementor"),
|
|
2838
3051
|
sx: { maxHeight: "140px", width: "50px" }
|
|
2839
3052
|
}
|
|
2840
|
-
)), /* @__PURE__ */
|
|
2841
|
-
|
|
3053
|
+
)), /* @__PURE__ */ React46.createElement(
|
|
3054
|
+
import_ui39.CardOverlay,
|
|
2842
3055
|
{
|
|
2843
3056
|
sx: {
|
|
2844
3057
|
"&:hover": {
|
|
@@ -2846,69 +3059,69 @@ var SvgMediaControl = createControl(() => {
|
|
|
2846
3059
|
}
|
|
2847
3060
|
}
|
|
2848
3061
|
},
|
|
2849
|
-
/* @__PURE__ */
|
|
2850
|
-
|
|
3062
|
+
/* @__PURE__ */ React46.createElement(import_ui39.Stack, { gap: 1 }, /* @__PURE__ */ React46.createElement(
|
|
3063
|
+
import_ui39.Button,
|
|
2851
3064
|
{
|
|
2852
3065
|
size: "tiny",
|
|
2853
3066
|
color: "inherit",
|
|
2854
3067
|
variant: "outlined",
|
|
2855
3068
|
onClick: () => handleClick(MODE_BROWSE)
|
|
2856
3069
|
},
|
|
2857
|
-
(0,
|
|
2858
|
-
), /* @__PURE__ */
|
|
2859
|
-
|
|
3070
|
+
(0, import_i18n15.__)("Select SVG", "elementor")
|
|
3071
|
+
), /* @__PURE__ */ React46.createElement(
|
|
3072
|
+
import_ui39.Button,
|
|
2860
3073
|
{
|
|
2861
3074
|
size: "tiny",
|
|
2862
3075
|
variant: "text",
|
|
2863
3076
|
color: "inherit",
|
|
2864
|
-
startIcon: /* @__PURE__ */
|
|
3077
|
+
startIcon: /* @__PURE__ */ React46.createElement(import_icons13.UploadIcon, null),
|
|
2865
3078
|
onClick: () => handleClick(MODE_UPLOAD)
|
|
2866
3079
|
},
|
|
2867
|
-
(0,
|
|
3080
|
+
(0, import_i18n15.__)("Upload", "elementor")
|
|
2868
3081
|
))
|
|
2869
3082
|
))));
|
|
2870
3083
|
});
|
|
2871
3084
|
|
|
2872
3085
|
// src/controls/background-control/background-control.tsx
|
|
2873
|
-
var
|
|
2874
|
-
var
|
|
2875
|
-
var
|
|
2876
|
-
var
|
|
2877
|
-
var
|
|
3086
|
+
var React53 = __toESM(require("react"));
|
|
3087
|
+
var import_editor_props28 = require("@elementor/editor-props");
|
|
3088
|
+
var import_editor_v1_adapters5 = require("@elementor/editor-v1-adapters");
|
|
3089
|
+
var import_ui47 = require("@elementor/ui");
|
|
3090
|
+
var import_i18n21 = require("@wordpress/i18n");
|
|
2878
3091
|
|
|
2879
3092
|
// src/controls/background-control/background-overlay/background-overlay-repeater-control.tsx
|
|
2880
|
-
var
|
|
2881
|
-
var
|
|
2882
|
-
var
|
|
3093
|
+
var React52 = __toESM(require("react"));
|
|
3094
|
+
var import_editor_props27 = require("@elementor/editor-props");
|
|
3095
|
+
var import_ui46 = require("@elementor/ui");
|
|
2883
3096
|
var import_wp_media3 = require("@elementor/wp-media");
|
|
2884
|
-
var
|
|
3097
|
+
var import_i18n20 = require("@wordpress/i18n");
|
|
2885
3098
|
|
|
2886
3099
|
// src/env.ts
|
|
2887
3100
|
var import_env = require("@elementor/env");
|
|
2888
3101
|
var { env } = (0, import_env.parseEnv)("@elementor/editor-controls");
|
|
2889
3102
|
|
|
2890
3103
|
// src/controls/background-control/background-gradient-color-control.tsx
|
|
2891
|
-
var
|
|
2892
|
-
var
|
|
2893
|
-
var
|
|
3104
|
+
var React47 = __toESM(require("react"));
|
|
3105
|
+
var import_editor_props23 = require("@elementor/editor-props");
|
|
3106
|
+
var import_ui40 = require("@elementor/ui");
|
|
2894
3107
|
var BackgroundGradientColorControl = createControl(() => {
|
|
2895
|
-
const { value, setValue } = useBoundProp(
|
|
3108
|
+
const { value, setValue } = useBoundProp(import_editor_props23.backgroundGradientOverlayPropTypeUtil);
|
|
2896
3109
|
const handleChange = (newValue) => {
|
|
2897
3110
|
const transformedValue = createTransformableValue(newValue);
|
|
2898
3111
|
if (transformedValue.positions) {
|
|
2899
|
-
transformedValue.positions =
|
|
3112
|
+
transformedValue.positions = import_editor_props23.stringPropTypeUtil.create(newValue.positions.join(" "));
|
|
2900
3113
|
}
|
|
2901
3114
|
setValue(transformedValue);
|
|
2902
3115
|
};
|
|
2903
3116
|
const createTransformableValue = (newValue) => ({
|
|
2904
3117
|
...newValue,
|
|
2905
|
-
type:
|
|
2906
|
-
angle:
|
|
2907
|
-
stops:
|
|
3118
|
+
type: import_editor_props23.stringPropTypeUtil.create(newValue.type),
|
|
3119
|
+
angle: import_editor_props23.numberPropTypeUtil.create(newValue.angle),
|
|
3120
|
+
stops: import_editor_props23.gradientColorStopPropTypeUtil.create(
|
|
2908
3121
|
newValue.stops.map(
|
|
2909
|
-
({ color, offset }) =>
|
|
2910
|
-
color:
|
|
2911
|
-
offset:
|
|
3122
|
+
({ color, offset }) => import_editor_props23.colorStopPropTypeUtil.create({
|
|
3123
|
+
color: import_editor_props23.colorPropTypeUtil.create(color),
|
|
3124
|
+
offset: import_editor_props23.numberPropTypeUtil.create(offset)
|
|
2912
3125
|
})
|
|
2913
3126
|
)
|
|
2914
3127
|
)
|
|
@@ -2928,8 +3141,8 @@ var BackgroundGradientColorControl = createControl(() => {
|
|
|
2928
3141
|
positions: positions?.value.split(" ")
|
|
2929
3142
|
};
|
|
2930
3143
|
};
|
|
2931
|
-
return /* @__PURE__ */
|
|
2932
|
-
|
|
3144
|
+
return /* @__PURE__ */ React47.createElement(ControlActions, null, /* @__PURE__ */ React47.createElement(
|
|
3145
|
+
import_ui40.UnstableGradientBox,
|
|
2933
3146
|
{
|
|
2934
3147
|
sx: { width: "auto", padding: 1.5 },
|
|
2935
3148
|
value: normalizeValue(),
|
|
@@ -2937,69 +3150,69 @@ var BackgroundGradientColorControl = createControl(() => {
|
|
|
2937
3150
|
}
|
|
2938
3151
|
));
|
|
2939
3152
|
});
|
|
2940
|
-
var initialBackgroundGradientOverlay =
|
|
2941
|
-
type:
|
|
2942
|
-
angle:
|
|
2943
|
-
stops:
|
|
2944
|
-
|
|
2945
|
-
color:
|
|
2946
|
-
offset:
|
|
3153
|
+
var initialBackgroundGradientOverlay = import_editor_props23.backgroundGradientOverlayPropTypeUtil.create({
|
|
3154
|
+
type: import_editor_props23.stringPropTypeUtil.create("linear"),
|
|
3155
|
+
angle: import_editor_props23.numberPropTypeUtil.create(180),
|
|
3156
|
+
stops: import_editor_props23.gradientColorStopPropTypeUtil.create([
|
|
3157
|
+
import_editor_props23.colorStopPropTypeUtil.create({
|
|
3158
|
+
color: import_editor_props23.colorPropTypeUtil.create("rgb(0,0,0)"),
|
|
3159
|
+
offset: import_editor_props23.numberPropTypeUtil.create(0)
|
|
2947
3160
|
}),
|
|
2948
|
-
|
|
2949
|
-
color:
|
|
2950
|
-
offset:
|
|
3161
|
+
import_editor_props23.colorStopPropTypeUtil.create({
|
|
3162
|
+
color: import_editor_props23.colorPropTypeUtil.create("rgb(255,255,255)"),
|
|
3163
|
+
offset: import_editor_props23.numberPropTypeUtil.create(100)
|
|
2951
3164
|
})
|
|
2952
3165
|
])
|
|
2953
3166
|
});
|
|
2954
3167
|
|
|
2955
3168
|
// src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-attachment.tsx
|
|
2956
|
-
var
|
|
3169
|
+
var React48 = __toESM(require("react"));
|
|
2957
3170
|
var import_icons14 = require("@elementor/icons");
|
|
2958
|
-
var
|
|
2959
|
-
var
|
|
3171
|
+
var import_ui41 = require("@elementor/ui");
|
|
3172
|
+
var import_i18n16 = require("@wordpress/i18n");
|
|
2960
3173
|
var attachmentControlOptions = [
|
|
2961
3174
|
{
|
|
2962
3175
|
value: "fixed",
|
|
2963
|
-
label: (0,
|
|
2964
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
3176
|
+
label: (0, import_i18n16.__)("Fixed", "elementor"),
|
|
3177
|
+
renderContent: ({ size }) => /* @__PURE__ */ React48.createElement(import_icons14.PinIcon, { fontSize: size }),
|
|
2965
3178
|
showTooltip: true
|
|
2966
3179
|
},
|
|
2967
3180
|
{
|
|
2968
3181
|
value: "scroll",
|
|
2969
|
-
label: (0,
|
|
2970
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
3182
|
+
label: (0, import_i18n16.__)("Scroll", "elementor"),
|
|
3183
|
+
renderContent: ({ size }) => /* @__PURE__ */ React48.createElement(import_icons14.PinnedOffIcon, { fontSize: size }),
|
|
2971
3184
|
showTooltip: true
|
|
2972
3185
|
}
|
|
2973
3186
|
];
|
|
2974
3187
|
var BackgroundImageOverlayAttachment = () => {
|
|
2975
|
-
return /* @__PURE__ */
|
|
3188
|
+
return /* @__PURE__ */ React48.createElement(PopoverGridContainer, null, /* @__PURE__ */ React48.createElement(import_ui41.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React48.createElement(ControlFormLabel, null, (0, import_i18n16.__)("Attachment", "elementor"))), /* @__PURE__ */ React48.createElement(import_ui41.Grid, { item: true, xs: 6, sx: { display: "flex", justifyContent: "flex-end", overflow: "hidden" } }, /* @__PURE__ */ React48.createElement(ToggleControl, { options: attachmentControlOptions })));
|
|
2976
3189
|
};
|
|
2977
3190
|
|
|
2978
3191
|
// src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-position.tsx
|
|
2979
|
-
var
|
|
2980
|
-
var
|
|
2981
|
-
var
|
|
3192
|
+
var React49 = __toESM(require("react"));
|
|
3193
|
+
var import_react28 = require("react");
|
|
3194
|
+
var import_editor_props24 = require("@elementor/editor-props");
|
|
2982
3195
|
var import_editor_ui7 = require("@elementor/editor-ui");
|
|
2983
3196
|
var import_icons15 = require("@elementor/icons");
|
|
2984
|
-
var
|
|
2985
|
-
var
|
|
3197
|
+
var import_ui42 = require("@elementor/ui");
|
|
3198
|
+
var import_i18n17 = require("@wordpress/i18n");
|
|
2986
3199
|
var backgroundPositionOptions = [
|
|
2987
|
-
{ label: (0,
|
|
2988
|
-
{ label: (0,
|
|
2989
|
-
{ label: (0,
|
|
2990
|
-
{ label: (0,
|
|
2991
|
-
{ label: (0,
|
|
2992
|
-
{ label: (0,
|
|
2993
|
-
{ label: (0,
|
|
2994
|
-
{ label: (0,
|
|
2995
|
-
{ label: (0,
|
|
2996
|
-
{ label: (0,
|
|
3200
|
+
{ label: (0, import_i18n17.__)("Center center", "elementor"), value: "center center" },
|
|
3201
|
+
{ label: (0, import_i18n17.__)("Center left", "elementor"), value: "center left" },
|
|
3202
|
+
{ label: (0, import_i18n17.__)("Center right", "elementor"), value: "center right" },
|
|
3203
|
+
{ label: (0, import_i18n17.__)("Top center", "elementor"), value: "top center" },
|
|
3204
|
+
{ label: (0, import_i18n17.__)("Top left", "elementor"), value: "top left" },
|
|
3205
|
+
{ label: (0, import_i18n17.__)("Top right", "elementor"), value: "top right" },
|
|
3206
|
+
{ label: (0, import_i18n17.__)("Bottom center", "elementor"), value: "bottom center" },
|
|
3207
|
+
{ label: (0, import_i18n17.__)("Bottom left", "elementor"), value: "bottom left" },
|
|
3208
|
+
{ label: (0, import_i18n17.__)("Bottom right", "elementor"), value: "bottom right" },
|
|
3209
|
+
{ label: (0, import_i18n17.__)("Custom", "elementor"), value: "custom" }
|
|
2997
3210
|
];
|
|
2998
3211
|
var BackgroundImageOverlayPosition = () => {
|
|
2999
|
-
const backgroundImageOffsetContext = useBoundProp(
|
|
3000
|
-
const stringPropContext = useBoundProp(
|
|
3212
|
+
const backgroundImageOffsetContext = useBoundProp(import_editor_props24.backgroundImagePositionOffsetPropTypeUtil);
|
|
3213
|
+
const stringPropContext = useBoundProp(import_editor_props24.stringPropTypeUtil);
|
|
3001
3214
|
const isCustom = !!backgroundImageOffsetContext.value;
|
|
3002
|
-
const rowRef = (0,
|
|
3215
|
+
const rowRef = (0, import_react28.useRef)(null);
|
|
3003
3216
|
const handlePositionChange = (event) => {
|
|
3004
3217
|
const value = event.target.value || null;
|
|
3005
3218
|
if (value === "custom") {
|
|
@@ -3008,8 +3221,8 @@ var BackgroundImageOverlayPosition = () => {
|
|
|
3008
3221
|
stringPropContext.setValue(value);
|
|
3009
3222
|
}
|
|
3010
3223
|
};
|
|
3011
|
-
return /* @__PURE__ */
|
|
3012
|
-
|
|
3224
|
+
return /* @__PURE__ */ React49.createElement(import_ui42.Grid, { container: true, spacing: 1.5 }, /* @__PURE__ */ React49.createElement(import_ui42.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React49.createElement(PopoverGridContainer, null, /* @__PURE__ */ React49.createElement(import_ui42.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React49.createElement(ControlFormLabel, null, (0, import_i18n17.__)("Position", "elementor"))), /* @__PURE__ */ React49.createElement(import_ui42.Grid, { item: true, xs: 6, sx: { display: "flex", justifyContent: "flex-end", overflow: "hidden" } }, /* @__PURE__ */ React49.createElement(
|
|
3225
|
+
import_ui42.Select,
|
|
3013
3226
|
{
|
|
3014
3227
|
fullWidth: true,
|
|
3015
3228
|
size: "tiny",
|
|
@@ -3017,95 +3230,95 @@ var BackgroundImageOverlayPosition = () => {
|
|
|
3017
3230
|
disabled: stringPropContext.disabled,
|
|
3018
3231
|
value: (backgroundImageOffsetContext.value ? "custom" : stringPropContext.value) ?? ""
|
|
3019
3232
|
},
|
|
3020
|
-
backgroundPositionOptions.map(({ label, value }) => /* @__PURE__ */
|
|
3021
|
-
)))), isCustom ? /* @__PURE__ */
|
|
3233
|
+
backgroundPositionOptions.map(({ label, value }) => /* @__PURE__ */ React49.createElement(import_editor_ui7.MenuListItem, { key: value, value: value ?? "" }, label))
|
|
3234
|
+
)))), isCustom ? /* @__PURE__ */ React49.createElement(PropProvider, { ...backgroundImageOffsetContext }, /* @__PURE__ */ React49.createElement(import_ui42.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React49.createElement(import_ui42.Grid, { container: true, spacing: 1.5, ref: rowRef }, /* @__PURE__ */ React49.createElement(import_ui42.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React49.createElement(PropKeyProvider, { bind: "x" }, /* @__PURE__ */ React49.createElement(
|
|
3022
3235
|
SizeControl,
|
|
3023
3236
|
{
|
|
3024
|
-
startIcon: /* @__PURE__ */
|
|
3237
|
+
startIcon: /* @__PURE__ */ React49.createElement(import_icons15.LetterXIcon, { fontSize: "tiny" }),
|
|
3025
3238
|
anchorRef: rowRef
|
|
3026
3239
|
}
|
|
3027
|
-
))), /* @__PURE__ */
|
|
3240
|
+
))), /* @__PURE__ */ React49.createElement(import_ui42.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React49.createElement(PropKeyProvider, { bind: "y" }, /* @__PURE__ */ React49.createElement(
|
|
3028
3241
|
SizeControl,
|
|
3029
3242
|
{
|
|
3030
|
-
startIcon: /* @__PURE__ */
|
|
3243
|
+
startIcon: /* @__PURE__ */ React49.createElement(import_icons15.LetterYIcon, { fontSize: "tiny" }),
|
|
3031
3244
|
anchorRef: rowRef
|
|
3032
3245
|
}
|
|
3033
3246
|
)))))) : null);
|
|
3034
3247
|
};
|
|
3035
3248
|
|
|
3036
3249
|
// src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-repeat.tsx
|
|
3037
|
-
var
|
|
3250
|
+
var React50 = __toESM(require("react"));
|
|
3038
3251
|
var import_icons16 = require("@elementor/icons");
|
|
3039
|
-
var
|
|
3040
|
-
var
|
|
3252
|
+
var import_ui43 = require("@elementor/ui");
|
|
3253
|
+
var import_i18n18 = require("@wordpress/i18n");
|
|
3041
3254
|
var repeatControlOptions = [
|
|
3042
3255
|
{
|
|
3043
3256
|
value: "repeat",
|
|
3044
|
-
label: (0,
|
|
3045
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
3257
|
+
label: (0, import_i18n18.__)("Repeat", "elementor"),
|
|
3258
|
+
renderContent: ({ size }) => /* @__PURE__ */ React50.createElement(import_icons16.GridDotsIcon, { fontSize: size }),
|
|
3046
3259
|
showTooltip: true
|
|
3047
3260
|
},
|
|
3048
3261
|
{
|
|
3049
3262
|
value: "repeat-x",
|
|
3050
|
-
label: (0,
|
|
3051
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
3263
|
+
label: (0, import_i18n18.__)("Repeat-x", "elementor"),
|
|
3264
|
+
renderContent: ({ size }) => /* @__PURE__ */ React50.createElement(import_icons16.DotsHorizontalIcon, { fontSize: size }),
|
|
3052
3265
|
showTooltip: true
|
|
3053
3266
|
},
|
|
3054
3267
|
{
|
|
3055
3268
|
value: "repeat-y",
|
|
3056
|
-
label: (0,
|
|
3057
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
3269
|
+
label: (0, import_i18n18.__)("Repeat-y", "elementor"),
|
|
3270
|
+
renderContent: ({ size }) => /* @__PURE__ */ React50.createElement(import_icons16.DotsVerticalIcon, { fontSize: size }),
|
|
3058
3271
|
showTooltip: true
|
|
3059
3272
|
},
|
|
3060
3273
|
{
|
|
3061
3274
|
value: "no-repeat",
|
|
3062
|
-
label: (0,
|
|
3063
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
3275
|
+
label: (0, import_i18n18.__)("No-repeat", "elementor"),
|
|
3276
|
+
renderContent: ({ size }) => /* @__PURE__ */ React50.createElement(import_icons16.XIcon, { fontSize: size }),
|
|
3064
3277
|
showTooltip: true
|
|
3065
3278
|
}
|
|
3066
3279
|
];
|
|
3067
3280
|
var BackgroundImageOverlayRepeat = () => {
|
|
3068
|
-
return /* @__PURE__ */
|
|
3281
|
+
return /* @__PURE__ */ React50.createElement(PopoverGridContainer, null, /* @__PURE__ */ React50.createElement(import_ui43.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React50.createElement(ControlFormLabel, null, (0, import_i18n18.__)("Repeat", "elementor"))), /* @__PURE__ */ React50.createElement(import_ui43.Grid, { item: true, xs: 6, sx: { display: "flex", justifyContent: "flex-end" } }, /* @__PURE__ */ React50.createElement(ToggleControl, { options: repeatControlOptions })));
|
|
3069
3282
|
};
|
|
3070
3283
|
|
|
3071
3284
|
// src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-size.tsx
|
|
3072
|
-
var
|
|
3073
|
-
var
|
|
3074
|
-
var
|
|
3285
|
+
var React51 = __toESM(require("react"));
|
|
3286
|
+
var import_react29 = require("react");
|
|
3287
|
+
var import_editor_props25 = require("@elementor/editor-props");
|
|
3075
3288
|
var import_icons17 = require("@elementor/icons");
|
|
3076
|
-
var
|
|
3077
|
-
var
|
|
3289
|
+
var import_ui44 = require("@elementor/ui");
|
|
3290
|
+
var import_i18n19 = require("@wordpress/i18n");
|
|
3078
3291
|
var sizeControlOptions = [
|
|
3079
3292
|
{
|
|
3080
3293
|
value: "auto",
|
|
3081
|
-
label: (0,
|
|
3082
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
3294
|
+
label: (0, import_i18n19.__)("Auto", "elementor"),
|
|
3295
|
+
renderContent: ({ size }) => /* @__PURE__ */ React51.createElement(import_icons17.LetterAIcon, { fontSize: size }),
|
|
3083
3296
|
showTooltip: true
|
|
3084
3297
|
},
|
|
3085
3298
|
{
|
|
3086
3299
|
value: "cover",
|
|
3087
|
-
label: (0,
|
|
3088
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
3300
|
+
label: (0, import_i18n19.__)("Cover", "elementor"),
|
|
3301
|
+
renderContent: ({ size }) => /* @__PURE__ */ React51.createElement(import_icons17.ArrowsMaximizeIcon, { fontSize: size }),
|
|
3089
3302
|
showTooltip: true
|
|
3090
3303
|
},
|
|
3091
3304
|
{
|
|
3092
3305
|
value: "contain",
|
|
3093
|
-
label: (0,
|
|
3094
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
3306
|
+
label: (0, import_i18n19.__)("Contain", "elementor"),
|
|
3307
|
+
renderContent: ({ size }) => /* @__PURE__ */ React51.createElement(import_icons17.ArrowBarBothIcon, { fontSize: size }),
|
|
3095
3308
|
showTooltip: true
|
|
3096
3309
|
},
|
|
3097
3310
|
{
|
|
3098
3311
|
value: "custom",
|
|
3099
|
-
label: (0,
|
|
3100
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
3312
|
+
label: (0, import_i18n19.__)("Custom", "elementor"),
|
|
3313
|
+
renderContent: ({ size }) => /* @__PURE__ */ React51.createElement(import_icons17.PencilIcon, { fontSize: size }),
|
|
3101
3314
|
showTooltip: true
|
|
3102
3315
|
}
|
|
3103
3316
|
];
|
|
3104
3317
|
var BackgroundImageOverlaySize = () => {
|
|
3105
|
-
const backgroundImageScaleContext = useBoundProp(
|
|
3106
|
-
const stringPropContext = useBoundProp(
|
|
3318
|
+
const backgroundImageScaleContext = useBoundProp(import_editor_props25.backgroundImageSizeScalePropTypeUtil);
|
|
3319
|
+
const stringPropContext = useBoundProp(import_editor_props25.stringPropTypeUtil);
|
|
3107
3320
|
const isCustom = !!backgroundImageScaleContext.value;
|
|
3108
|
-
const rowRef = (0,
|
|
3321
|
+
const rowRef = (0, import_react29.useRef)(null);
|
|
3109
3322
|
const handleSizeChange = (size) => {
|
|
3110
3323
|
if (size === "custom") {
|
|
3111
3324
|
backgroundImageScaleContext.setValue({ width: null, height: null });
|
|
@@ -3113,7 +3326,7 @@ var BackgroundImageOverlaySize = () => {
|
|
|
3113
3326
|
stringPropContext.setValue(size);
|
|
3114
3327
|
}
|
|
3115
3328
|
};
|
|
3116
|
-
return /* @__PURE__ */
|
|
3329
|
+
return /* @__PURE__ */ React51.createElement(import_ui44.Grid, { container: true, spacing: 1.5 }, /* @__PURE__ */ React51.createElement(import_ui44.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React51.createElement(PopoverGridContainer, null, /* @__PURE__ */ React51.createElement(import_ui44.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React51.createElement(ControlFormLabel, null, (0, import_i18n19.__)("Size", "elementor"))), /* @__PURE__ */ React51.createElement(import_ui44.Grid, { item: true, xs: 6, sx: { display: "flex", justifyContent: "flex-end" } }, /* @__PURE__ */ React51.createElement(
|
|
3117
3330
|
ControlToggleButtonGroup,
|
|
3118
3331
|
{
|
|
3119
3332
|
exclusive: true,
|
|
@@ -3122,17 +3335,17 @@ var BackgroundImageOverlaySize = () => {
|
|
|
3122
3335
|
disabled: stringPropContext.disabled,
|
|
3123
3336
|
value: backgroundImageScaleContext.value ? "custom" : stringPropContext.value
|
|
3124
3337
|
}
|
|
3125
|
-
)))), isCustom ? /* @__PURE__ */
|
|
3338
|
+
)))), isCustom ? /* @__PURE__ */ React51.createElement(PropProvider, { ...backgroundImageScaleContext }, /* @__PURE__ */ React51.createElement(import_ui44.Grid, { item: true, xs: 12, ref: rowRef }, /* @__PURE__ */ React51.createElement(PopoverGridContainer, null, /* @__PURE__ */ React51.createElement(import_ui44.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React51.createElement(PropKeyProvider, { bind: "width" }, /* @__PURE__ */ React51.createElement(
|
|
3126
3339
|
SizeControl,
|
|
3127
3340
|
{
|
|
3128
|
-
startIcon: /* @__PURE__ */
|
|
3341
|
+
startIcon: /* @__PURE__ */ React51.createElement(import_icons17.ArrowsMoveHorizontalIcon, { fontSize: "tiny" }),
|
|
3129
3342
|
extendedOptions: ["auto"],
|
|
3130
3343
|
anchorRef: rowRef
|
|
3131
3344
|
}
|
|
3132
|
-
))), /* @__PURE__ */
|
|
3345
|
+
))), /* @__PURE__ */ React51.createElement(import_ui44.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React51.createElement(PropKeyProvider, { bind: "height" }, /* @__PURE__ */ React51.createElement(
|
|
3133
3346
|
SizeControl,
|
|
3134
3347
|
{
|
|
3135
|
-
startIcon: /* @__PURE__ */
|
|
3348
|
+
startIcon: /* @__PURE__ */ React51.createElement(import_icons17.ArrowsMoveVerticalIcon, { fontSize: "tiny" }),
|
|
3136
3349
|
extendedOptions: ["auto"],
|
|
3137
3350
|
anchorRef: rowRef
|
|
3138
3351
|
}
|
|
@@ -3140,17 +3353,17 @@ var BackgroundImageOverlaySize = () => {
|
|
|
3140
3353
|
};
|
|
3141
3354
|
|
|
3142
3355
|
// src/controls/background-control/background-overlay/use-background-tabs-history.ts
|
|
3143
|
-
var
|
|
3144
|
-
var
|
|
3145
|
-
var
|
|
3356
|
+
var import_react30 = require("react");
|
|
3357
|
+
var import_editor_props26 = require("@elementor/editor-props");
|
|
3358
|
+
var import_ui45 = require("@elementor/ui");
|
|
3146
3359
|
var useBackgroundTabsHistory = ({
|
|
3147
3360
|
color: initialBackgroundColorOverlay2,
|
|
3148
3361
|
image: initialBackgroundImageOverlay,
|
|
3149
3362
|
gradient: initialBackgroundGradientOverlay2
|
|
3150
3363
|
}) => {
|
|
3151
|
-
const { value: imageValue, setValue: setImageValue } = useBoundProp(
|
|
3152
|
-
const { value: colorValue, setValue: setColorValue } = useBoundProp(
|
|
3153
|
-
const { value: gradientValue, setValue: setGradientValue } = useBoundProp(
|
|
3364
|
+
const { value: imageValue, setValue: setImageValue } = useBoundProp(import_editor_props26.backgroundImageOverlayPropTypeUtil);
|
|
3365
|
+
const { value: colorValue, setValue: setColorValue } = useBoundProp(import_editor_props26.backgroundColorOverlayPropTypeUtil);
|
|
3366
|
+
const { value: gradientValue, setValue: setGradientValue } = useBoundProp(import_editor_props26.backgroundGradientOverlayPropTypeUtil);
|
|
3154
3367
|
const getCurrentOverlayType = () => {
|
|
3155
3368
|
if (colorValue) {
|
|
3156
3369
|
return "color";
|
|
@@ -3160,8 +3373,8 @@ var useBackgroundTabsHistory = ({
|
|
|
3160
3373
|
}
|
|
3161
3374
|
return "image";
|
|
3162
3375
|
};
|
|
3163
|
-
const { getTabsProps, getTabProps, getTabPanelProps } = (0,
|
|
3164
|
-
const valuesHistory = (0,
|
|
3376
|
+
const { getTabsProps, getTabProps, getTabPanelProps } = (0, import_ui45.useTabs)(getCurrentOverlayType());
|
|
3377
|
+
const valuesHistory = (0, import_react30.useRef)({
|
|
3165
3378
|
image: initialBackgroundImageOverlay,
|
|
3166
3379
|
color: initialBackgroundColorOverlay2,
|
|
3167
3380
|
gradient: initialBackgroundGradientOverlay2
|
|
@@ -3199,9 +3412,9 @@ var useBackgroundTabsHistory = ({
|
|
|
3199
3412
|
|
|
3200
3413
|
// src/controls/background-control/background-overlay/background-overlay-repeater-control.tsx
|
|
3201
3414
|
var DEFAULT_BACKGROUND_COLOR_OVERLAY_COLOR = "#00000033";
|
|
3202
|
-
var initialBackgroundColorOverlay =
|
|
3415
|
+
var initialBackgroundColorOverlay = import_editor_props27.backgroundColorOverlayPropTypeUtil.create(
|
|
3203
3416
|
{
|
|
3204
|
-
color:
|
|
3417
|
+
color: import_editor_props27.colorPropTypeUtil.create(DEFAULT_BACKGROUND_COLOR_OVERLAY_COLOR)
|
|
3205
3418
|
}
|
|
3206
3419
|
);
|
|
3207
3420
|
var getInitialBackgroundOverlay = () => ({
|
|
@@ -3229,21 +3442,21 @@ var getInitialBackgroundOverlay = () => ({
|
|
|
3229
3442
|
}
|
|
3230
3443
|
});
|
|
3231
3444
|
var backgroundResolutionOptions = [
|
|
3232
|
-
{ label: (0,
|
|
3233
|
-
{ label: (0,
|
|
3234
|
-
{ label: (0,
|
|
3235
|
-
{ label: (0,
|
|
3445
|
+
{ label: (0, import_i18n20.__)("Thumbnail - 150 x 150", "elementor"), value: "thumbnail" },
|
|
3446
|
+
{ label: (0, import_i18n20.__)("Medium - 300 x 300", "elementor"), value: "medium" },
|
|
3447
|
+
{ label: (0, import_i18n20.__)("Large 1024 x 1024", "elementor"), value: "large" },
|
|
3448
|
+
{ label: (0, import_i18n20.__)("Full", "elementor"), value: "full" }
|
|
3236
3449
|
];
|
|
3237
3450
|
var BackgroundOverlayRepeaterControl = createControl(() => {
|
|
3238
|
-
const { propType, value: overlayValues, setValue, disabled } = useBoundProp(
|
|
3239
|
-
return /* @__PURE__ */
|
|
3451
|
+
const { propType, value: overlayValues, setValue, disabled } = useBoundProp(import_editor_props27.backgroundOverlayPropTypeUtil);
|
|
3452
|
+
return /* @__PURE__ */ React52.createElement(PropProvider, { propType, value: overlayValues, setValue, isDisabled: () => disabled }, /* @__PURE__ */ React52.createElement(
|
|
3240
3453
|
Repeater,
|
|
3241
3454
|
{
|
|
3242
3455
|
openOnAdd: true,
|
|
3243
3456
|
disabled,
|
|
3244
3457
|
values: overlayValues ?? [],
|
|
3245
3458
|
setValues: setValue,
|
|
3246
|
-
label: (0,
|
|
3459
|
+
label: (0, import_i18n20.__)("Overlay", "elementor"),
|
|
3247
3460
|
itemSettings: {
|
|
3248
3461
|
Icon: ItemIcon3,
|
|
3249
3462
|
Label: ItemLabel3,
|
|
@@ -3254,7 +3467,7 @@ var BackgroundOverlayRepeaterControl = createControl(() => {
|
|
|
3254
3467
|
));
|
|
3255
3468
|
});
|
|
3256
3469
|
var ItemContent3 = ({ anchorEl = null, bind }) => {
|
|
3257
|
-
return /* @__PURE__ */
|
|
3470
|
+
return /* @__PURE__ */ React52.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React52.createElement(Content3, { anchorEl }));
|
|
3258
3471
|
};
|
|
3259
3472
|
var Content3 = ({ anchorEl }) => {
|
|
3260
3473
|
const { getTabsProps, getTabProps, getTabPanelProps } = useBackgroundTabsHistory({
|
|
@@ -3262,27 +3475,27 @@ var Content3 = ({ anchorEl }) => {
|
|
|
3262
3475
|
color: initialBackgroundColorOverlay.value,
|
|
3263
3476
|
gradient: initialBackgroundGradientOverlay.value
|
|
3264
3477
|
});
|
|
3265
|
-
return /* @__PURE__ */
|
|
3266
|
-
|
|
3478
|
+
return /* @__PURE__ */ React52.createElement(import_ui46.Box, { sx: { width: "100%" } }, /* @__PURE__ */ React52.createElement(import_ui46.Box, { sx: { borderBottom: 1, borderColor: "divider" } }, /* @__PURE__ */ React52.createElement(
|
|
3479
|
+
import_ui46.Tabs,
|
|
3267
3480
|
{
|
|
3268
3481
|
size: "small",
|
|
3269
3482
|
variant: "fullWidth",
|
|
3270
3483
|
...getTabsProps(),
|
|
3271
|
-
"aria-label": (0,
|
|
3484
|
+
"aria-label": (0, import_i18n20.__)("Background Overlay", "elementor")
|
|
3272
3485
|
},
|
|
3273
|
-
/* @__PURE__ */
|
|
3274
|
-
/* @__PURE__ */
|
|
3275
|
-
/* @__PURE__ */
|
|
3276
|
-
)), /* @__PURE__ */
|
|
3486
|
+
/* @__PURE__ */ React52.createElement(import_ui46.Tab, { label: (0, import_i18n20.__)("Image", "elementor"), ...getTabProps("image") }),
|
|
3487
|
+
/* @__PURE__ */ React52.createElement(import_ui46.Tab, { label: (0, import_i18n20.__)("Gradient", "elementor"), ...getTabProps("gradient") }),
|
|
3488
|
+
/* @__PURE__ */ React52.createElement(import_ui46.Tab, { label: (0, import_i18n20.__)("Color", "elementor"), ...getTabProps("color") })
|
|
3489
|
+
)), /* @__PURE__ */ React52.createElement(import_ui46.TabPanel, { sx: { p: 1.5 }, ...getTabPanelProps("image") }, /* @__PURE__ */ React52.createElement(PopoverContent, null, /* @__PURE__ */ React52.createElement(ImageOverlayContent, null))), /* @__PURE__ */ React52.createElement(import_ui46.TabPanel, { sx: { p: 1.5 }, ...getTabPanelProps("gradient") }, /* @__PURE__ */ React52.createElement(BackgroundGradientColorControl, null)), /* @__PURE__ */ React52.createElement(import_ui46.TabPanel, { sx: { p: 1.5 }, ...getTabPanelProps("color") }, /* @__PURE__ */ React52.createElement(PopoverContent, null, /* @__PURE__ */ React52.createElement(ColorOverlayContent, { anchorEl }))));
|
|
3277
3490
|
};
|
|
3278
3491
|
var ItemIcon3 = ({ value }) => {
|
|
3279
3492
|
switch (value.$$type) {
|
|
3280
3493
|
case "background-image-overlay":
|
|
3281
|
-
return /* @__PURE__ */
|
|
3494
|
+
return /* @__PURE__ */ React52.createElement(ItemIconImage, { value });
|
|
3282
3495
|
case "background-color-overlay":
|
|
3283
|
-
return /* @__PURE__ */
|
|
3496
|
+
return /* @__PURE__ */ React52.createElement(ItemIconColor, { value });
|
|
3284
3497
|
case "background-gradient-overlay":
|
|
3285
|
-
return /* @__PURE__ */
|
|
3498
|
+
return /* @__PURE__ */ React52.createElement(ItemIconGradient, { value });
|
|
3286
3499
|
default:
|
|
3287
3500
|
return null;
|
|
3288
3501
|
}
|
|
@@ -3295,12 +3508,12 @@ var extractColorFrom = (prop) => {
|
|
|
3295
3508
|
};
|
|
3296
3509
|
var ItemIconColor = ({ value: prop }) => {
|
|
3297
3510
|
const color = extractColorFrom(prop);
|
|
3298
|
-
return /* @__PURE__ */
|
|
3511
|
+
return /* @__PURE__ */ React52.createElement(StyledUnstableColorIndicator, { size: "inherit", component: "span", value: color });
|
|
3299
3512
|
};
|
|
3300
3513
|
var ItemIconImage = ({ value }) => {
|
|
3301
3514
|
const { imageUrl } = useImage(value);
|
|
3302
|
-
return /* @__PURE__ */
|
|
3303
|
-
|
|
3515
|
+
return /* @__PURE__ */ React52.createElement(
|
|
3516
|
+
import_ui46.CardMedia,
|
|
3304
3517
|
{
|
|
3305
3518
|
image: imageUrl,
|
|
3306
3519
|
sx: (theme) => ({
|
|
@@ -3314,43 +3527,43 @@ var ItemIconImage = ({ value }) => {
|
|
|
3314
3527
|
};
|
|
3315
3528
|
var ItemIconGradient = ({ value }) => {
|
|
3316
3529
|
const gradient = getGradientValue(value);
|
|
3317
|
-
return /* @__PURE__ */
|
|
3530
|
+
return /* @__PURE__ */ React52.createElement(StyledUnstableColorIndicator, { size: "inherit", component: "span", value: gradient });
|
|
3318
3531
|
};
|
|
3319
3532
|
var ItemLabel3 = ({ value }) => {
|
|
3320
3533
|
switch (value.$$type) {
|
|
3321
3534
|
case "background-image-overlay":
|
|
3322
|
-
return /* @__PURE__ */
|
|
3535
|
+
return /* @__PURE__ */ React52.createElement(ItemLabelImage, { value });
|
|
3323
3536
|
case "background-color-overlay":
|
|
3324
|
-
return /* @__PURE__ */
|
|
3537
|
+
return /* @__PURE__ */ React52.createElement(ItemLabelColor, { value });
|
|
3325
3538
|
case "background-gradient-overlay":
|
|
3326
|
-
return /* @__PURE__ */
|
|
3539
|
+
return /* @__PURE__ */ React52.createElement(ItemLabelGradient, { value });
|
|
3327
3540
|
default:
|
|
3328
3541
|
return null;
|
|
3329
3542
|
}
|
|
3330
3543
|
};
|
|
3331
3544
|
var ItemLabelColor = ({ value: prop }) => {
|
|
3332
3545
|
const color = extractColorFrom(prop);
|
|
3333
|
-
return /* @__PURE__ */
|
|
3546
|
+
return /* @__PURE__ */ React52.createElement("span", null, color);
|
|
3334
3547
|
};
|
|
3335
3548
|
var ItemLabelImage = ({ value }) => {
|
|
3336
3549
|
const { imageTitle } = useImage(value);
|
|
3337
|
-
return /* @__PURE__ */
|
|
3550
|
+
return /* @__PURE__ */ React52.createElement("span", null, imageTitle);
|
|
3338
3551
|
};
|
|
3339
3552
|
var ItemLabelGradient = ({ value }) => {
|
|
3340
3553
|
if (value.value.type.value === "linear") {
|
|
3341
|
-
return /* @__PURE__ */
|
|
3554
|
+
return /* @__PURE__ */ React52.createElement("span", null, (0, import_i18n20.__)("Linear Gradient", "elementor"));
|
|
3342
3555
|
}
|
|
3343
|
-
return /* @__PURE__ */
|
|
3556
|
+
return /* @__PURE__ */ React52.createElement("span", null, (0, import_i18n20.__)("Radial Gradient", "elementor"));
|
|
3344
3557
|
};
|
|
3345
3558
|
var ColorOverlayContent = ({ anchorEl }) => {
|
|
3346
|
-
const propContext = useBoundProp(
|
|
3347
|
-
return /* @__PURE__ */
|
|
3559
|
+
const propContext = useBoundProp(import_editor_props27.backgroundColorOverlayPropTypeUtil);
|
|
3560
|
+
return /* @__PURE__ */ React52.createElement(PropProvider, { ...propContext }, /* @__PURE__ */ React52.createElement(PropKeyProvider, { bind: "color" }, /* @__PURE__ */ React52.createElement(ColorControl, { anchorEl })));
|
|
3348
3561
|
};
|
|
3349
3562
|
var ImageOverlayContent = () => {
|
|
3350
|
-
const propContext = useBoundProp(
|
|
3351
|
-
return /* @__PURE__ */
|
|
3563
|
+
const propContext = useBoundProp(import_editor_props27.backgroundImageOverlayPropTypeUtil);
|
|
3564
|
+
return /* @__PURE__ */ React52.createElement(PropProvider, { ...propContext }, /* @__PURE__ */ React52.createElement(PropKeyProvider, { bind: "image" }, /* @__PURE__ */ React52.createElement(ImageControl, { sizes: backgroundResolutionOptions })), /* @__PURE__ */ React52.createElement(PropKeyProvider, { bind: "position" }, /* @__PURE__ */ React52.createElement(BackgroundImageOverlayPosition, null)), /* @__PURE__ */ React52.createElement(PropKeyProvider, { bind: "repeat" }, /* @__PURE__ */ React52.createElement(BackgroundImageOverlayRepeat, null)), /* @__PURE__ */ React52.createElement(PropKeyProvider, { bind: "size" }, /* @__PURE__ */ React52.createElement(BackgroundImageOverlaySize, null)), /* @__PURE__ */ React52.createElement(PropKeyProvider, { bind: "attachment" }, /* @__PURE__ */ React52.createElement(BackgroundImageOverlayAttachment, null)));
|
|
3352
3565
|
};
|
|
3353
|
-
var StyledUnstableColorIndicator = (0,
|
|
3566
|
+
var StyledUnstableColorIndicator = (0, import_ui46.styled)(import_ui46.UnstableColorIndicator)(({ theme }) => ({
|
|
3354
3567
|
borderRadius: `${theme.shape.borderRadius / 2}px`
|
|
3355
3568
|
}));
|
|
3356
3569
|
var useImage = (image) => {
|
|
@@ -3385,35 +3598,23 @@ var getGradientValue = (value) => {
|
|
|
3385
3598
|
|
|
3386
3599
|
// src/controls/background-control/background-control.tsx
|
|
3387
3600
|
var BackgroundControl = createControl(() => {
|
|
3388
|
-
const propContext = useBoundProp(
|
|
3389
|
-
const isUsingNestedProps = (0,
|
|
3390
|
-
const colorLabel = (0,
|
|
3391
|
-
return /* @__PURE__ */
|
|
3392
|
-
});
|
|
3393
|
-
|
|
3394
|
-
// src/controls/switch-control.tsx
|
|
3395
|
-
var React51 = __toESM(require("react"));
|
|
3396
|
-
var import_editor_props27 = require("@elementor/editor-props");
|
|
3397
|
-
var import_ui45 = require("@elementor/ui");
|
|
3398
|
-
var SwitchControl2 = createControl(() => {
|
|
3399
|
-
const { value, setValue, disabled } = useBoundProp(import_editor_props27.booleanPropTypeUtil);
|
|
3400
|
-
const handleChange = (event) => {
|
|
3401
|
-
setValue(event.target.checked);
|
|
3402
|
-
};
|
|
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 }));
|
|
3601
|
+
const propContext = useBoundProp(import_editor_props28.backgroundPropTypeUtil);
|
|
3602
|
+
const isUsingNestedProps = (0, import_editor_v1_adapters5.isExperimentActive)("e_v_3_30");
|
|
3603
|
+
const colorLabel = (0, import_i18n21.__)("Color", "elementor");
|
|
3604
|
+
return /* @__PURE__ */ React53.createElement(PropProvider, { ...propContext }, /* @__PURE__ */ React53.createElement(PropKeyProvider, { bind: "background-overlay" }, /* @__PURE__ */ React53.createElement(BackgroundOverlayRepeaterControl, null)), /* @__PURE__ */ React53.createElement(PropKeyProvider, { bind: "color" }, /* @__PURE__ */ React53.createElement(import_ui47.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React53.createElement(import_ui47.Grid, { item: true, xs: 6 }, isUsingNestedProps ? /* @__PURE__ */ React53.createElement(ControlLabel, null, colorLabel) : /* @__PURE__ */ React53.createElement(ControlFormLabel, null, colorLabel)), /* @__PURE__ */ React53.createElement(import_ui47.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React53.createElement(ColorControl, null)))));
|
|
3404
3605
|
});
|
|
3405
3606
|
|
|
3406
3607
|
// src/controls/repeatable-control.tsx
|
|
3407
|
-
var
|
|
3408
|
-
var
|
|
3409
|
-
var
|
|
3410
|
-
var
|
|
3608
|
+
var React54 = __toESM(require("react"));
|
|
3609
|
+
var import_react32 = require("react");
|
|
3610
|
+
var import_editor_props29 = require("@elementor/editor-props");
|
|
3611
|
+
var import_ui48 = require("@elementor/ui");
|
|
3411
3612
|
|
|
3412
3613
|
// src/hooks/use-repeatable-control-context.ts
|
|
3413
|
-
var
|
|
3414
|
-
var RepeatableControlContext = (0,
|
|
3614
|
+
var import_react31 = require("react");
|
|
3615
|
+
var RepeatableControlContext = (0, import_react31.createContext)(void 0);
|
|
3415
3616
|
var useRepeatableControlContext = () => {
|
|
3416
|
-
const context = (0,
|
|
3617
|
+
const context = (0, import_react31.useContext)(RepeatableControlContext);
|
|
3417
3618
|
if (!context) {
|
|
3418
3619
|
throw new Error("useRepeatableControlContext must be used within RepeatableControl");
|
|
3419
3620
|
}
|
|
@@ -3421,6 +3622,7 @@ var useRepeatableControlContext = () => {
|
|
|
3421
3622
|
};
|
|
3422
3623
|
|
|
3423
3624
|
// src/controls/repeatable-control.tsx
|
|
3625
|
+
var PLACEHOLDER_REGEX = /\$\{([^}]+)\}/g;
|
|
3424
3626
|
var RepeatableControl = createControl(
|
|
3425
3627
|
({
|
|
3426
3628
|
repeaterLabel,
|
|
@@ -3435,20 +3637,20 @@ var RepeatableControl = createControl(
|
|
|
3435
3637
|
if (!childPropTypeUtil) {
|
|
3436
3638
|
return null;
|
|
3437
3639
|
}
|
|
3438
|
-
const childArrayPropTypeUtil = (0,
|
|
3439
|
-
() => (0,
|
|
3640
|
+
const childArrayPropTypeUtil = (0, import_react32.useMemo)(
|
|
3641
|
+
() => (0, import_editor_props29.createArrayPropUtils)(childPropTypeUtil.key, childPropTypeUtil.schema),
|
|
3440
3642
|
[childPropTypeUtil.key, childPropTypeUtil.schema]
|
|
3441
3643
|
);
|
|
3644
|
+
const contextValue = (0, import_react32.useMemo)(
|
|
3645
|
+
() => ({
|
|
3646
|
+
...childControlConfig,
|
|
3647
|
+
placeholder: placeholder || "",
|
|
3648
|
+
patternLabel: patternLabel || ""
|
|
3649
|
+
}),
|
|
3650
|
+
[childControlConfig, placeholder, patternLabel]
|
|
3651
|
+
);
|
|
3442
3652
|
const { propType, value, setValue } = useBoundProp(childArrayPropTypeUtil);
|
|
3443
|
-
|
|
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(
|
|
3653
|
+
return /* @__PURE__ */ React54.createElement(PropProvider, { propType, value, setValue }, /* @__PURE__ */ React54.createElement(RepeatableControlContext.Provider, { value: contextValue }, /* @__PURE__ */ React54.createElement(
|
|
3452
3654
|
Repeater,
|
|
3453
3655
|
{
|
|
3454
3656
|
openOnAdd: true,
|
|
@@ -3469,69 +3671,136 @@ var RepeatableControl = createControl(
|
|
|
3469
3671
|
}
|
|
3470
3672
|
);
|
|
3471
3673
|
var ItemContent4 = ({ bind }) => {
|
|
3472
|
-
return /* @__PURE__ */
|
|
3674
|
+
return /* @__PURE__ */ React54.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React54.createElement(Content4, null));
|
|
3473
3675
|
};
|
|
3474
|
-
var ItemIcon4 = () => /* @__PURE__ */
|
|
3676
|
+
var ItemIcon4 = () => /* @__PURE__ */ React54.createElement(React54.Fragment, null);
|
|
3475
3677
|
var Content4 = () => {
|
|
3476
3678
|
const { component: ChildControl, props = {} } = useRepeatableControlContext();
|
|
3477
|
-
return /* @__PURE__ */
|
|
3679
|
+
return /* @__PURE__ */ React54.createElement(PopoverContent, { p: 1.5 }, /* @__PURE__ */ React54.createElement(PopoverGridContainer, null, /* @__PURE__ */ React54.createElement(ChildControl, { ...props })));
|
|
3478
3680
|
};
|
|
3479
3681
|
var interpolate = (template, data) => {
|
|
3480
|
-
if (
|
|
3481
|
-
return
|
|
3682
|
+
if (!data) {
|
|
3683
|
+
return template;
|
|
3684
|
+
}
|
|
3685
|
+
return template.replace(PLACEHOLDER_REGEX, (_, path) => {
|
|
3686
|
+
const value = getNestedValue(data, path);
|
|
3687
|
+
if (typeof value === "object" && value !== null && !Array.isArray(value)) {
|
|
3688
|
+
if (value.name) {
|
|
3689
|
+
return value.name;
|
|
3690
|
+
}
|
|
3691
|
+
return JSON.stringify(value);
|
|
3692
|
+
}
|
|
3693
|
+
if (Array.isArray(value)) {
|
|
3694
|
+
return value.join(", ");
|
|
3695
|
+
}
|
|
3696
|
+
return String(value ?? "");
|
|
3697
|
+
});
|
|
3698
|
+
};
|
|
3699
|
+
var getNestedValue = (obj, path) => {
|
|
3700
|
+
return path.split(".").reduce((current, key) => {
|
|
3701
|
+
if (current && typeof current === "object") {
|
|
3702
|
+
return current[key];
|
|
3703
|
+
}
|
|
3704
|
+
return {};
|
|
3705
|
+
}, obj);
|
|
3706
|
+
};
|
|
3707
|
+
var isEmptyValue = (val) => {
|
|
3708
|
+
if (typeof val === "string") {
|
|
3709
|
+
return val.trim() === "";
|
|
3710
|
+
}
|
|
3711
|
+
if (Number.isNaN(val)) {
|
|
3712
|
+
return true;
|
|
3713
|
+
}
|
|
3714
|
+
if (Array.isArray(val)) {
|
|
3715
|
+
return val.length === 0;
|
|
3716
|
+
}
|
|
3717
|
+
if (typeof val === "object" && val !== null) {
|
|
3718
|
+
return Object.keys(val).length === 0;
|
|
3719
|
+
}
|
|
3720
|
+
return false;
|
|
3721
|
+
};
|
|
3722
|
+
var shouldShowPlaceholder = (pattern, data) => {
|
|
3723
|
+
const propertyPaths = getAllProperties(pattern);
|
|
3724
|
+
const values = propertyPaths.map((path) => getNestedValue(data, path));
|
|
3725
|
+
if (values.length === 0) {
|
|
3726
|
+
return false;
|
|
3727
|
+
}
|
|
3728
|
+
if (values.some((value) => value === null || value === void 0)) {
|
|
3729
|
+
return true;
|
|
3730
|
+
}
|
|
3731
|
+
if (values.every(isEmptyValue)) {
|
|
3732
|
+
return true;
|
|
3482
3733
|
}
|
|
3483
|
-
return
|
|
3734
|
+
return false;
|
|
3735
|
+
};
|
|
3736
|
+
var ItemLabel4 = ({ value }) => {
|
|
3737
|
+
const { placeholder, patternLabel } = useRepeatableControlContext();
|
|
3738
|
+
const label = shouldShowPlaceholder(patternLabel, value) ? placeholder : interpolate(patternLabel, value);
|
|
3739
|
+
return /* @__PURE__ */ React54.createElement(import_ui48.Box, { component: "span", color: "text.tertiary" }, label);
|
|
3740
|
+
};
|
|
3741
|
+
var getAllProperties = (pattern) => {
|
|
3742
|
+
const properties = pattern.match(PLACEHOLDER_REGEX)?.map((match) => match.slice(2, -1)) || [];
|
|
3743
|
+
return properties;
|
|
3484
3744
|
};
|
|
3485
3745
|
|
|
3486
3746
|
// src/controls/key-value-control.tsx
|
|
3487
|
-
var
|
|
3488
|
-
var
|
|
3489
|
-
var
|
|
3490
|
-
var
|
|
3491
|
-
var
|
|
3747
|
+
var React55 = __toESM(require("react"));
|
|
3748
|
+
var import_react33 = require("react");
|
|
3749
|
+
var import_editor_props30 = require("@elementor/editor-props");
|
|
3750
|
+
var import_ui49 = require("@elementor/ui");
|
|
3751
|
+
var import_i18n22 = require("@wordpress/i18n");
|
|
3492
3752
|
var KeyValueControl = createControl((props = {}) => {
|
|
3493
|
-
const { value, setValue } = useBoundProp(
|
|
3494
|
-
const [keyError, setKeyError] = (0,
|
|
3495
|
-
const [valueError, setValueError] = (0,
|
|
3496
|
-
const [sessionState, setSessionState] = (0,
|
|
3753
|
+
const { value, setValue, ...propContext } = useBoundProp(import_editor_props30.keyValuePropTypeUtil);
|
|
3754
|
+
const [keyError, setKeyError] = (0, import_react33.useState)("");
|
|
3755
|
+
const [valueError, setValueError] = (0, import_react33.useState)("");
|
|
3756
|
+
const [sessionState, setSessionState] = (0, import_react33.useState)({
|
|
3497
3757
|
key: value?.key?.value || "",
|
|
3498
3758
|
value: value?.value?.value || ""
|
|
3499
3759
|
});
|
|
3500
|
-
const keyLabel = props.keyName || (0,
|
|
3501
|
-
const valueLabel = props.valueName || (0,
|
|
3502
|
-
const [keyRegex, valueRegex, errMsg] = (0,
|
|
3760
|
+
const keyLabel = props.keyName || (0, import_i18n22.__)("Key", "elementor");
|
|
3761
|
+
const valueLabel = props.valueName || (0, import_i18n22.__)("Value", "elementor");
|
|
3762
|
+
const [keyRegex, valueRegex, errMsg] = (0, import_react33.useMemo)(
|
|
3503
3763
|
() => [
|
|
3504
3764
|
props.regexKey ? new RegExp(props.regexKey) : void 0,
|
|
3505
3765
|
props.regexValue ? new RegExp(props.regexValue) : void 0,
|
|
3506
|
-
props.validationErrorMessage || (0,
|
|
3766
|
+
props.validationErrorMessage || (0, import_i18n22.__)("Invalid Format", "elementor")
|
|
3507
3767
|
],
|
|
3508
3768
|
[props.regexKey, props.regexValue, props.validationErrorMessage]
|
|
3509
3769
|
);
|
|
3510
3770
|
const validate = (newValue, fieldType) => {
|
|
3511
3771
|
if (fieldType === "key" && keyRegex) {
|
|
3512
3772
|
const isValid = keyRegex.test(newValue);
|
|
3513
|
-
setKeyError(isValid ?
|
|
3773
|
+
setKeyError(isValid ? "" : errMsg);
|
|
3514
3774
|
return isValid;
|
|
3515
3775
|
} else if (fieldType === "value" && valueRegex) {
|
|
3516
3776
|
const isValid = valueRegex.test(newValue);
|
|
3517
|
-
setValueError(isValid ?
|
|
3777
|
+
setValueError(isValid ? "" : errMsg);
|
|
3518
3778
|
return isValid;
|
|
3519
3779
|
}
|
|
3520
3780
|
return true;
|
|
3521
3781
|
};
|
|
3522
|
-
const handleChange = (
|
|
3523
|
-
const
|
|
3782
|
+
const handleChange = (newValue, options, meta) => {
|
|
3783
|
+
const fieldType = meta?.bind;
|
|
3784
|
+
if (!fieldType) {
|
|
3785
|
+
return;
|
|
3786
|
+
}
|
|
3787
|
+
const newChangedValue = newValue[fieldType];
|
|
3788
|
+
if ((0, import_editor_props30.isTransformable)(newChangedValue) && newChangedValue.$$type === "dynamic") {
|
|
3789
|
+
setValue({
|
|
3790
|
+
...value,
|
|
3791
|
+
[fieldType]: newChangedValue
|
|
3792
|
+
});
|
|
3793
|
+
return;
|
|
3794
|
+
}
|
|
3795
|
+
const extractedValue = import_editor_props30.stringPropTypeUtil.extract(newChangedValue);
|
|
3524
3796
|
setSessionState((prev) => ({
|
|
3525
3797
|
...prev,
|
|
3526
|
-
[fieldType]:
|
|
3798
|
+
[fieldType]: extractedValue
|
|
3527
3799
|
}));
|
|
3528
|
-
if (validate(
|
|
3800
|
+
if (extractedValue && validate(extractedValue, fieldType)) {
|
|
3529
3801
|
setValue({
|
|
3530
3802
|
...value,
|
|
3531
|
-
[fieldType]:
|
|
3532
|
-
value: newValue,
|
|
3533
|
-
$$type: "string"
|
|
3534
|
-
}
|
|
3803
|
+
[fieldType]: newChangedValue
|
|
3535
3804
|
});
|
|
3536
3805
|
} else {
|
|
3537
3806
|
setValue({
|
|
@@ -3543,62 +3812,46 @@ var KeyValueControl = createControl((props = {}) => {
|
|
|
3543
3812
|
});
|
|
3544
3813
|
}
|
|
3545
3814
|
};
|
|
3546
|
-
|
|
3547
|
-
|
|
3548
|
-
return /* @__PURE__ */ React53.createElement(ControlActions, null, /* @__PURE__ */ React53.createElement(import_ui47.Grid, { container: true, gap: 1.5 }, /* @__PURE__ */ React53.createElement(import_ui47.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React53.createElement(import_ui47.FormLabel, { size: "tiny" }, keyLabel), /* @__PURE__ */ React53.createElement(
|
|
3549
|
-
import_ui47.TextField,
|
|
3550
|
-
{
|
|
3551
|
-
autoFocus: true,
|
|
3552
|
-
sx: { pt: 1 },
|
|
3553
|
-
size: "tiny",
|
|
3554
|
-
fullWidth: true,
|
|
3555
|
-
value: sessionState.key,
|
|
3556
|
-
onChange: (e) => handleChange(e, "key"),
|
|
3557
|
-
error: isKeyInvalid
|
|
3558
|
-
}
|
|
3559
|
-
), isKeyInvalid && /* @__PURE__ */ React53.createElement(import_ui47.FormHelperText, { error: true }, keyError)), /* @__PURE__ */ React53.createElement(import_ui47.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React53.createElement(import_ui47.FormLabel, { size: "tiny" }, valueLabel), /* @__PURE__ */ React53.createElement(
|
|
3560
|
-
import_ui47.TextField,
|
|
3815
|
+
return /* @__PURE__ */ React55.createElement(PropProvider, { ...propContext, value, setValue: handleChange }, /* @__PURE__ */ React55.createElement(import_ui49.Grid, { container: true, gap: 1.5 }, /* @__PURE__ */ React55.createElement(import_ui49.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React55.createElement(import_ui49.FormLabel, { size: "tiny" }, keyLabel), /* @__PURE__ */ React55.createElement(PropKeyProvider, { bind: "key" }, /* @__PURE__ */ React55.createElement(TextControl, { inputValue: sessionState.key, error: !!keyError, sx: { pt: 1 } })), !!keyError && /* @__PURE__ */ React55.createElement(import_ui49.FormHelperText, { error: true }, keyError)), /* @__PURE__ */ React55.createElement(import_ui49.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React55.createElement(import_ui49.FormLabel, { size: "tiny" }, valueLabel), /* @__PURE__ */ React55.createElement(PropKeyProvider, { bind: "value" }, /* @__PURE__ */ React55.createElement(
|
|
3816
|
+
TextControl,
|
|
3561
3817
|
{
|
|
3562
|
-
|
|
3563
|
-
|
|
3564
|
-
|
|
3565
|
-
|
|
3566
|
-
onChange: (e) => handleChange(e, "value"),
|
|
3567
|
-
disabled: isKeyInvalid,
|
|
3568
|
-
error: isValueInvalid
|
|
3818
|
+
inputValue: sessionState.value,
|
|
3819
|
+
error: !!valueError,
|
|
3820
|
+
inputDisabled: !!keyError,
|
|
3821
|
+
sx: { pt: 1 }
|
|
3569
3822
|
}
|
|
3570
|
-
),
|
|
3823
|
+
)), !!valueError && /* @__PURE__ */ React55.createElement(import_ui49.FormHelperText, { error: true }, valueError))));
|
|
3571
3824
|
});
|
|
3572
3825
|
|
|
3573
3826
|
// src/controls/position-control.tsx
|
|
3574
|
-
var
|
|
3575
|
-
var
|
|
3576
|
-
var
|
|
3827
|
+
var React56 = __toESM(require("react"));
|
|
3828
|
+
var import_react34 = require("react");
|
|
3829
|
+
var import_editor_props31 = require("@elementor/editor-props");
|
|
3577
3830
|
var import_editor_ui8 = require("@elementor/editor-ui");
|
|
3578
|
-
var
|
|
3831
|
+
var import_editor_v1_adapters6 = require("@elementor/editor-v1-adapters");
|
|
3579
3832
|
var import_icons18 = require("@elementor/icons");
|
|
3580
|
-
var
|
|
3581
|
-
var
|
|
3833
|
+
var import_ui50 = require("@elementor/ui");
|
|
3834
|
+
var import_i18n23 = require("@wordpress/i18n");
|
|
3582
3835
|
var positionOptions = [
|
|
3583
|
-
{ label: (0,
|
|
3584
|
-
{ label: (0,
|
|
3585
|
-
{ label: (0,
|
|
3586
|
-
{ label: (0,
|
|
3587
|
-
{ label: (0,
|
|
3588
|
-
{ label: (0,
|
|
3589
|
-
{ label: (0,
|
|
3590
|
-
{ label: (0,
|
|
3591
|
-
{ label: (0,
|
|
3836
|
+
{ label: (0, import_i18n23.__)("Center center", "elementor"), value: "center center" },
|
|
3837
|
+
{ label: (0, import_i18n23.__)("Center left", "elementor"), value: "center left" },
|
|
3838
|
+
{ label: (0, import_i18n23.__)("Center right", "elementor"), value: "center right" },
|
|
3839
|
+
{ label: (0, import_i18n23.__)("Top center", "elementor"), value: "top center" },
|
|
3840
|
+
{ label: (0, import_i18n23.__)("Top left", "elementor"), value: "top left" },
|
|
3841
|
+
{ label: (0, import_i18n23.__)("Top right", "elementor"), value: "top right" },
|
|
3842
|
+
{ label: (0, import_i18n23.__)("Bottom center", "elementor"), value: "bottom center" },
|
|
3843
|
+
{ label: (0, import_i18n23.__)("Bottom left", "elementor"), value: "bottom left" },
|
|
3844
|
+
{ label: (0, import_i18n23.__)("Bottom right", "elementor"), value: "bottom right" }
|
|
3592
3845
|
];
|
|
3593
3846
|
var PositionControl = () => {
|
|
3594
|
-
const positionContext = useBoundProp(
|
|
3595
|
-
const stringPropContext = useBoundProp(
|
|
3596
|
-
const isVersion331Active = (0,
|
|
3847
|
+
const positionContext = useBoundProp(import_editor_props31.positionPropTypeUtil);
|
|
3848
|
+
const stringPropContext = useBoundProp(import_editor_props31.stringPropTypeUtil);
|
|
3849
|
+
const isVersion331Active = (0, import_editor_v1_adapters6.isExperimentActive)("e_v_3_31");
|
|
3597
3850
|
const isCustom = !!positionContext.value && isVersion331Active;
|
|
3598
|
-
const availablePositionOptions = (0,
|
|
3851
|
+
const availablePositionOptions = (0, import_react34.useMemo)(() => {
|
|
3599
3852
|
const options = [...positionOptions];
|
|
3600
3853
|
if (isVersion331Active) {
|
|
3601
|
-
options.push({ label: (0,
|
|
3854
|
+
options.push({ label: (0, import_i18n23.__)("Custom", "elementor"), value: "custom" });
|
|
3602
3855
|
}
|
|
3603
3856
|
return options;
|
|
3604
3857
|
}, [isVersion331Active]);
|
|
@@ -3610,8 +3863,8 @@ var PositionControl = () => {
|
|
|
3610
3863
|
stringPropContext.setValue(value);
|
|
3611
3864
|
}
|
|
3612
3865
|
};
|
|
3613
|
-
return /* @__PURE__ */
|
|
3614
|
-
|
|
3866
|
+
return /* @__PURE__ */ React56.createElement(import_ui50.Grid, { container: true, spacing: 1.5 }, /* @__PURE__ */ React56.createElement(import_ui50.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React56.createElement(import_ui50.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React56.createElement(import_ui50.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React56.createElement(ControlFormLabel, null, (0, import_i18n23.__)("Object position", "elementor"))), /* @__PURE__ */ React56.createElement(import_ui50.Grid, { item: true, xs: 6, sx: { overflow: "hidden" } }, /* @__PURE__ */ React56.createElement(
|
|
3867
|
+
import_ui50.Select,
|
|
3615
3868
|
{
|
|
3616
3869
|
size: "tiny",
|
|
3617
3870
|
disabled: stringPropContext.disabled,
|
|
@@ -3619,9 +3872,133 @@ var PositionControl = () => {
|
|
|
3619
3872
|
onChange: handlePositionChange,
|
|
3620
3873
|
fullWidth: true
|
|
3621
3874
|
},
|
|
3622
|
-
availablePositionOptions.map(({ label, value }) => /* @__PURE__ */
|
|
3623
|
-
)))), isCustom && /* @__PURE__ */
|
|
3875
|
+
availablePositionOptions.map(({ label, value }) => /* @__PURE__ */ React56.createElement(import_editor_ui8.MenuListItem, { key: value, value: value ?? "" }, label))
|
|
3876
|
+
)))), isCustom && /* @__PURE__ */ React56.createElement(PropProvider, { ...positionContext }, /* @__PURE__ */ React56.createElement(import_ui50.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React56.createElement(import_ui50.Grid, { container: true, spacing: 1.5 }, /* @__PURE__ */ React56.createElement(import_ui50.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React56.createElement(PropKeyProvider, { bind: "x" }, /* @__PURE__ */ React56.createElement(SizeControl, { startIcon: /* @__PURE__ */ React56.createElement(import_icons18.LetterXIcon, { fontSize: "tiny" }) }))), /* @__PURE__ */ React56.createElement(import_ui50.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React56.createElement(PropKeyProvider, { bind: "y" }, /* @__PURE__ */ React56.createElement(SizeControl, { startIcon: /* @__PURE__ */ React56.createElement(import_icons18.LetterYIcon, { fontSize: "tiny" }) })))))));
|
|
3877
|
+
};
|
|
3878
|
+
|
|
3879
|
+
// src/controls/transform-control/transform-repeater-control.tsx
|
|
3880
|
+
var React62 = __toESM(require("react"));
|
|
3881
|
+
var import_editor_props33 = require("@elementor/editor-props");
|
|
3882
|
+
var import_i18n27 = require("@wordpress/i18n");
|
|
3883
|
+
|
|
3884
|
+
// src/controls/transform-control/transform-content.tsx
|
|
3885
|
+
var React59 = __toESM(require("react"));
|
|
3886
|
+
var import_ui53 = require("@elementor/ui");
|
|
3887
|
+
var import_i18n25 = require("@wordpress/i18n");
|
|
3888
|
+
|
|
3889
|
+
// src/controls/transform-control/functions/move.tsx
|
|
3890
|
+
var React58 = __toESM(require("react"));
|
|
3891
|
+
var import_react35 = require("react");
|
|
3892
|
+
var import_editor_props32 = require("@elementor/editor-props");
|
|
3893
|
+
var import_icons19 = require("@elementor/icons");
|
|
3894
|
+
var import_ui52 = require("@elementor/ui");
|
|
3895
|
+
var import_i18n24 = require("@wordpress/i18n");
|
|
3896
|
+
|
|
3897
|
+
// src/controls/transform-control/functions/axis-row.tsx
|
|
3898
|
+
var React57 = __toESM(require("react"));
|
|
3899
|
+
var import_ui51 = require("@elementor/ui");
|
|
3900
|
+
var AxisRow = ({ label, bindValue, startIcon, anchorRef }) => {
|
|
3901
|
+
return /* @__PURE__ */ React57.createElement(import_ui51.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React57.createElement(PopoverGridContainer, { ref: anchorRef }, /* @__PURE__ */ React57.createElement(import_ui51.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React57.createElement(ControlLabel, null, label)), /* @__PURE__ */ React57.createElement(import_ui51.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React57.createElement(PropKeyProvider, { bind: bindValue }, /* @__PURE__ */ React57.createElement(SizeControl, { anchorRef, startIcon })))));
|
|
3902
|
+
};
|
|
3903
|
+
|
|
3904
|
+
// src/controls/transform-control/functions/move.tsx
|
|
3905
|
+
var moveAxisControls = [
|
|
3906
|
+
{
|
|
3907
|
+
label: (0, import_i18n24.__)("Move X", "elementor"),
|
|
3908
|
+
bindValue: "x",
|
|
3909
|
+
startIcon: /* @__PURE__ */ React58.createElement(import_icons19.ArrowRightIcon, { fontSize: "tiny" })
|
|
3910
|
+
},
|
|
3911
|
+
{
|
|
3912
|
+
label: (0, import_i18n24.__)("Move Y", "elementor"),
|
|
3913
|
+
bindValue: "y",
|
|
3914
|
+
startIcon: /* @__PURE__ */ React58.createElement(import_icons19.ArrowDownSmallIcon, { fontSize: "tiny" })
|
|
3915
|
+
},
|
|
3916
|
+
{
|
|
3917
|
+
label: (0, import_i18n24.__)("Move Z", "elementor"),
|
|
3918
|
+
bindValue: "z",
|
|
3919
|
+
startIcon: /* @__PURE__ */ React58.createElement(import_icons19.ArrowDownLeftIcon, { fontSize: "tiny" })
|
|
3920
|
+
}
|
|
3921
|
+
];
|
|
3922
|
+
var Move = () => {
|
|
3923
|
+
const context = useBoundProp(import_editor_props32.moveTransformPropTypeUtil);
|
|
3924
|
+
const rowRef = (0, import_react35.useRef)(null);
|
|
3925
|
+
return /* @__PURE__ */ React58.createElement(import_ui52.Grid, { container: true, spacing: 1.5 }, /* @__PURE__ */ React58.createElement(PropProvider, { ...context }, /* @__PURE__ */ React58.createElement(PropKeyProvider, { bind: "transform-move" }, moveAxisControls.map((control) => /* @__PURE__ */ React58.createElement(AxisRow, { key: control.bindValue, ...control, anchorRef: rowRef })))));
|
|
3624
3926
|
};
|
|
3927
|
+
|
|
3928
|
+
// src/controls/transform-control/transform-content.tsx
|
|
3929
|
+
var TransformContent = ({ bind }) => {
|
|
3930
|
+
const { getTabsProps, getTabProps, getTabPanelProps } = (0, import_ui53.useTabs)("transform-move");
|
|
3931
|
+
return /* @__PURE__ */ React59.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React59.createElement(PopoverContent, null, /* @__PURE__ */ React59.createElement(import_ui53.Box, { sx: { width: "100%" } }, /* @__PURE__ */ React59.createElement(import_ui53.Box, { sx: { borderBottom: 1, borderColor: "divider" } }, /* @__PURE__ */ React59.createElement(
|
|
3932
|
+
import_ui53.Tabs,
|
|
3933
|
+
{
|
|
3934
|
+
size: "small",
|
|
3935
|
+
variant: "fullWidth",
|
|
3936
|
+
...getTabsProps(),
|
|
3937
|
+
"aria-label": (0, import_i18n25.__)("Transform", "elementor")
|
|
3938
|
+
},
|
|
3939
|
+
/* @__PURE__ */ React59.createElement(import_ui53.Tab, { label: (0, import_i18n25.__)("Move", "elementor"), ...getTabProps("transform-move") })
|
|
3940
|
+
)), /* @__PURE__ */ React59.createElement(import_ui53.TabPanel, { sx: { p: 1.5 }, ...getTabPanelProps("transform-move") }, /* @__PURE__ */ React59.createElement(Move, null)))));
|
|
3941
|
+
};
|
|
3942
|
+
|
|
3943
|
+
// src/controls/transform-control/transform-icon.tsx
|
|
3944
|
+
var React60 = __toESM(require("react"));
|
|
3945
|
+
var import_icons20 = require("@elementor/icons");
|
|
3946
|
+
var TransformIcon = ({ value }) => {
|
|
3947
|
+
switch (value.$$type) {
|
|
3948
|
+
case "transform-move":
|
|
3949
|
+
return /* @__PURE__ */ React60.createElement(import_icons20.ArrowsMaximizeIcon, { fontSize: "tiny" });
|
|
3950
|
+
default:
|
|
3951
|
+
return null;
|
|
3952
|
+
}
|
|
3953
|
+
};
|
|
3954
|
+
|
|
3955
|
+
// src/controls/transform-control/transform-label.tsx
|
|
3956
|
+
var React61 = __toESM(require("react"));
|
|
3957
|
+
var import_ui54 = require("@elementor/ui");
|
|
3958
|
+
var import_i18n26 = require("@wordpress/i18n");
|
|
3959
|
+
var transformMoveValue = (value) => Object.values(value).map((axis) => `${axis?.value.size}${axis?.value.unit}`).join(", ");
|
|
3960
|
+
var TransformLabel = (props) => {
|
|
3961
|
+
const { $$type, value } = props.value;
|
|
3962
|
+
switch ($$type) {
|
|
3963
|
+
case "transform-move":
|
|
3964
|
+
return /* @__PURE__ */ React61.createElement(Label2, { label: (0, import_i18n26.__)("Move", "elementor"), value: transformMoveValue(value) });
|
|
3965
|
+
default:
|
|
3966
|
+
return "";
|
|
3967
|
+
}
|
|
3968
|
+
};
|
|
3969
|
+
var Label2 = ({ label, value }) => {
|
|
3970
|
+
return /* @__PURE__ */ React61.createElement(import_ui54.Box, { component: "span" }, label, ": ", value);
|
|
3971
|
+
};
|
|
3972
|
+
|
|
3973
|
+
// src/controls/transform-control/transform-repeater-control.tsx
|
|
3974
|
+
var initialTransformValue = {
|
|
3975
|
+
$$type: "transform-move",
|
|
3976
|
+
value: {
|
|
3977
|
+
x: { $$type: "size", value: { size: 0, unit: "px" } },
|
|
3978
|
+
y: { $$type: "size", value: { size: 0, unit: "px" } },
|
|
3979
|
+
z: { $$type: "size", value: { size: 0, unit: "px" } }
|
|
3980
|
+
}
|
|
3981
|
+
};
|
|
3982
|
+
var TransformRepeaterControl = createControl(() => {
|
|
3983
|
+
const { propType, value: transformValues, setValue, disabled } = useBoundProp(import_editor_props33.transformPropTypeUtil);
|
|
3984
|
+
return /* @__PURE__ */ React62.createElement(PropProvider, { propType, value: transformValues, setValue }, /* @__PURE__ */ React62.createElement(
|
|
3985
|
+
Repeater,
|
|
3986
|
+
{
|
|
3987
|
+
openOnAdd: true,
|
|
3988
|
+
disabled,
|
|
3989
|
+
values: transformValues ?? [],
|
|
3990
|
+
setValues: setValue,
|
|
3991
|
+
label: (0, import_i18n27.__)("Transform", "elementor"),
|
|
3992
|
+
showDuplicate: false,
|
|
3993
|
+
itemSettings: {
|
|
3994
|
+
Icon: TransformIcon,
|
|
3995
|
+
Label: TransformLabel,
|
|
3996
|
+
Content: TransformContent,
|
|
3997
|
+
initialValues: initialTransformValue
|
|
3998
|
+
}
|
|
3999
|
+
}
|
|
4000
|
+
));
|
|
4001
|
+
});
|
|
3625
4002
|
// Annotate the CommonJS export names for ESM import in node:
|
|
3626
4003
|
0 && (module.exports = {
|
|
3627
4004
|
AspectRatioControl,
|
|
@@ -3657,6 +4034,7 @@ var PositionControl = () => {
|
|
|
3657
4034
|
TextAreaControl,
|
|
3658
4035
|
TextControl,
|
|
3659
4036
|
ToggleControl,
|
|
4037
|
+
TransformRepeaterControl,
|
|
3660
4038
|
UrlControl,
|
|
3661
4039
|
createControlReplacementsRegistry,
|
|
3662
4040
|
injectIntoRepeaterItemIcon,
|