@elementor/editor-controls 3.35.0-413 → 3.35.0-415
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/dist/index.js +309 -311
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +215 -217
- package/dist/index.mjs.map +1 -1
- package/package.json +15 -15
- package/src/controls/image-control.tsx +2 -1
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// src/controls/image-control.tsx
|
|
2
|
-
import * as
|
|
2
|
+
import * as React14 from "react";
|
|
3
3
|
import { imagePropTypeUtil } from "@elementor/editor-props";
|
|
4
|
-
import { Grid, Stack as
|
|
4
|
+
import { Grid, Stack as Stack3 } from "@elementor/ui";
|
|
5
5
|
import { __ as __2 } from "@wordpress/i18n";
|
|
6
6
|
|
|
7
7
|
// src/bound-prop-context/prop-context.tsx
|
|
@@ -204,20 +204,53 @@ var ControlFormLabel = (props) => {
|
|
|
204
204
|
return /* @__PURE__ */ React3.createElement(FormLabel, { size: "tiny", ...props });
|
|
205
205
|
};
|
|
206
206
|
|
|
207
|
-
// src/
|
|
207
|
+
// src/components/control-label.tsx
|
|
208
|
+
import * as React6 from "react";
|
|
209
|
+
import { Stack } from "@elementor/ui";
|
|
210
|
+
|
|
211
|
+
// src/control-adornments/control-adornments.tsx
|
|
208
212
|
import * as React5 from "react";
|
|
209
|
-
import { ErrorBoundary } from "@elementor/ui";
|
|
210
213
|
|
|
211
|
-
// src/control-
|
|
214
|
+
// src/control-adornments/control-adornments-context.tsx
|
|
212
215
|
import * as React4 from "react";
|
|
213
216
|
import { createContext as createContext3, useContext as useContext3 } from "react";
|
|
214
|
-
var
|
|
217
|
+
var Context = createContext3(null);
|
|
218
|
+
var ControlAdornmentsProvider = ({ children, items: items2 }) => /* @__PURE__ */ React4.createElement(Context.Provider, { value: { items: items2 } }, children);
|
|
219
|
+
var useControlAdornments = () => {
|
|
220
|
+
const context = useContext3(Context);
|
|
221
|
+
return context?.items ?? [];
|
|
222
|
+
};
|
|
223
|
+
|
|
224
|
+
// src/control-adornments/control-adornments.tsx
|
|
225
|
+
function ControlAdornments({
|
|
226
|
+
customContext
|
|
227
|
+
}) {
|
|
228
|
+
const items2 = useControlAdornments();
|
|
229
|
+
if (items2?.length === 0) {
|
|
230
|
+
return null;
|
|
231
|
+
}
|
|
232
|
+
return /* @__PURE__ */ React5.createElement(React5.Fragment, null, items2.map(({ Adornment, id }) => /* @__PURE__ */ React5.createElement(Adornment, { key: id, customContext })));
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
// src/components/control-label.tsx
|
|
236
|
+
var ControlLabel = ({ children, ...props }) => {
|
|
237
|
+
return /* @__PURE__ */ React6.createElement(Stack, { direction: "row", alignItems: "center", justifyItems: "start", gap: 0.25 }, /* @__PURE__ */ React6.createElement(ControlFormLabel, { ...props }, children), /* @__PURE__ */ React6.createElement(ControlAdornments, null));
|
|
238
|
+
};
|
|
239
|
+
|
|
240
|
+
// src/create-control.tsx
|
|
241
|
+
import * as React8 from "react";
|
|
242
|
+
import { ErrorBoundary } from "@elementor/ui";
|
|
243
|
+
|
|
244
|
+
// src/control-replacements.tsx
|
|
245
|
+
import * as React7 from "react";
|
|
246
|
+
import { createContext as createContext4, useContext as useContext4 } from "react";
|
|
247
|
+
var ControlReplacementContext = createContext4([]);
|
|
215
248
|
var ControlReplacementsProvider = ({ replacements, children }) => {
|
|
216
|
-
return /* @__PURE__ */
|
|
249
|
+
return /* @__PURE__ */ React7.createElement(ControlReplacementContext.Provider, { value: replacements }, children);
|
|
217
250
|
};
|
|
218
251
|
var useControlReplacement = (OriginalComponent) => {
|
|
219
252
|
const { value, placeholder } = useBoundProp();
|
|
220
|
-
const replacements =
|
|
253
|
+
const replacements = useContext4(ControlReplacementContext);
|
|
221
254
|
try {
|
|
222
255
|
const replacement = replacements.find((r) => r.condition({ value, placeholder }));
|
|
223
256
|
return {
|
|
@@ -246,7 +279,7 @@ function createControl(Control5) {
|
|
|
246
279
|
return ((props) => {
|
|
247
280
|
const { ControlToRender, OriginalControl, isReplaced } = useControlReplacement(Control5);
|
|
248
281
|
const controlProps = isReplaced ? { ...props, OriginalControl } : props;
|
|
249
|
-
return /* @__PURE__ */
|
|
282
|
+
return /* @__PURE__ */ React8.createElement(ErrorBoundary, { fallback: null }, /* @__PURE__ */ React8.createElement(ControlToRender, { ...controlProps }));
|
|
250
283
|
});
|
|
251
284
|
}
|
|
252
285
|
|
|
@@ -290,19 +323,19 @@ var formatResponse = (response) => {
|
|
|
290
323
|
};
|
|
291
324
|
|
|
292
325
|
// src/controls/image-media-control.tsx
|
|
293
|
-
import * as
|
|
326
|
+
import * as React12 from "react";
|
|
294
327
|
import { imageSrcPropTypeUtil } from "@elementor/editor-props";
|
|
295
328
|
import { UploadIcon } from "@elementor/icons";
|
|
296
|
-
import { Button, Card, CardMedia, CardOverlay, CircularProgress, Stack } from "@elementor/ui";
|
|
329
|
+
import { Button, Card, CardMedia, CardOverlay, CircularProgress, Stack as Stack2 } from "@elementor/ui";
|
|
297
330
|
import { useWpMediaAttachment, useWpMediaFrame } from "@elementor/wp-media";
|
|
298
331
|
import { __ } from "@wordpress/i18n";
|
|
299
332
|
|
|
300
333
|
// src/control-actions/control-actions.tsx
|
|
301
|
-
import * as
|
|
334
|
+
import * as React11 from "react";
|
|
302
335
|
|
|
303
336
|
// src/components/floating-bar.tsx
|
|
304
|
-
import * as
|
|
305
|
-
import { createContext as
|
|
337
|
+
import * as React9 from "react";
|
|
338
|
+
import { createContext as createContext5, useContext as useContext5, useState as useState2 } from "react";
|
|
306
339
|
import { styled, UnstableFloatingActionBar } from "@elementor/ui";
|
|
307
340
|
var FloatingBarContainer = styled("span")`
|
|
308
341
|
display: contents;
|
|
@@ -315,13 +348,13 @@ var FloatingBarContainer = styled("span")`
|
|
|
315
348
|
z-index: 1000;
|
|
316
349
|
}
|
|
317
350
|
`;
|
|
318
|
-
var FloatingActionsContext =
|
|
351
|
+
var FloatingActionsContext = createContext5(null);
|
|
319
352
|
function FloatingActionsBar({ actions, children }) {
|
|
320
353
|
const [open, setOpen] = useState2(false);
|
|
321
|
-
return /* @__PURE__ */
|
|
354
|
+
return /* @__PURE__ */ React9.createElement(FloatingActionsContext.Provider, { value: { open, setOpen } }, /* @__PURE__ */ React9.createElement(FloatingBarContainer, null, /* @__PURE__ */ React9.createElement(UnstableFloatingActionBar, { actions, open: open || void 0 }, children)));
|
|
322
355
|
}
|
|
323
356
|
function useFloatingActionsBar() {
|
|
324
|
-
const context =
|
|
357
|
+
const context = useContext5(FloatingActionsContext);
|
|
325
358
|
if (!context) {
|
|
326
359
|
throw new Error("useFloatingActions must be used within a FloatingActionsBar");
|
|
327
360
|
}
|
|
@@ -329,12 +362,12 @@ function useFloatingActionsBar() {
|
|
|
329
362
|
}
|
|
330
363
|
|
|
331
364
|
// src/control-actions/control-actions-context.tsx
|
|
332
|
-
import * as
|
|
333
|
-
import { createContext as
|
|
334
|
-
var
|
|
335
|
-
var ControlActionsProvider = ({ children, items: items2 }) => /* @__PURE__ */
|
|
365
|
+
import * as React10 from "react";
|
|
366
|
+
import { createContext as createContext6, useContext as useContext6 } from "react";
|
|
367
|
+
var Context2 = createContext6(null);
|
|
368
|
+
var ControlActionsProvider = ({ children, items: items2 }) => /* @__PURE__ */ React10.createElement(Context2.Provider, { value: { items: items2 } }, children);
|
|
336
369
|
var useControlActions = () => {
|
|
337
|
-
const context =
|
|
370
|
+
const context = useContext6(Context2);
|
|
338
371
|
if (!context) {
|
|
339
372
|
throw new Error("useControlActions must be used within a ControlActionsProvider");
|
|
340
373
|
}
|
|
@@ -348,8 +381,8 @@ function ControlActions({ children }) {
|
|
|
348
381
|
if (items2.length === 0 || disabled) {
|
|
349
382
|
return children;
|
|
350
383
|
}
|
|
351
|
-
const menuItems = items2.map(({ MenuItem: MenuItem2, id }) => /* @__PURE__ */
|
|
352
|
-
return /* @__PURE__ */
|
|
384
|
+
const menuItems = items2.map(({ MenuItem: MenuItem2, id }) => /* @__PURE__ */ React11.createElement(MenuItem2, { key: id }));
|
|
385
|
+
return /* @__PURE__ */ React11.createElement(FloatingActionsBar, { actions: menuItems }, children);
|
|
353
386
|
}
|
|
354
387
|
|
|
355
388
|
// src/controls/image-media-control.tsx
|
|
@@ -372,7 +405,7 @@ var ImageMediaControl = createControl(({ mediaTypes = ["image"] }) => {
|
|
|
372
405
|
});
|
|
373
406
|
}
|
|
374
407
|
});
|
|
375
|
-
return /* @__PURE__ */
|
|
408
|
+
return /* @__PURE__ */ React12.createElement(ControlActions, null, /* @__PURE__ */ React12.createElement(Card, { variant: "outlined" }, /* @__PURE__ */ React12.createElement(CardMedia, { image: src, sx: { height: propType.meta.isDynamic ? 134 : 150 } }, isFetching ? /* @__PURE__ */ React12.createElement(Stack2, { justifyContent: "center", alignItems: "center", width: "100%", height: "100%" }, /* @__PURE__ */ React12.createElement(CircularProgress, null)) : /* @__PURE__ */ React12.createElement(React12.Fragment, null)), /* @__PURE__ */ React12.createElement(CardOverlay, null, /* @__PURE__ */ React12.createElement(Stack2, { gap: 1 }, /* @__PURE__ */ React12.createElement(
|
|
376
409
|
Button,
|
|
377
410
|
{
|
|
378
411
|
size: "tiny",
|
|
@@ -381,13 +414,13 @@ var ImageMediaControl = createControl(({ mediaTypes = ["image"] }) => {
|
|
|
381
414
|
onClick: () => open({ mode: "browse" })
|
|
382
415
|
},
|
|
383
416
|
__("Select image", "elementor")
|
|
384
|
-
), /* @__PURE__ */
|
|
417
|
+
), /* @__PURE__ */ React12.createElement(
|
|
385
418
|
Button,
|
|
386
419
|
{
|
|
387
420
|
size: "tiny",
|
|
388
421
|
variant: "text",
|
|
389
422
|
color: "inherit",
|
|
390
|
-
startIcon: /* @__PURE__ */
|
|
423
|
+
startIcon: /* @__PURE__ */ React12.createElement(UploadIcon, null),
|
|
391
424
|
onClick: () => open({ mode: "upload" })
|
|
392
425
|
},
|
|
393
426
|
__("Upload", "elementor")
|
|
@@ -395,7 +428,7 @@ var ImageMediaControl = createControl(({ mediaTypes = ["image"] }) => {
|
|
|
395
428
|
});
|
|
396
429
|
|
|
397
430
|
// src/controls/select-control.tsx
|
|
398
|
-
import * as
|
|
431
|
+
import * as React13 from "react";
|
|
399
432
|
import { stringPropTypeUtil } from "@elementor/editor-props";
|
|
400
433
|
import { MenuListItem } from "@elementor/editor-ui";
|
|
401
434
|
import { Select, Typography } from "@elementor/ui";
|
|
@@ -415,7 +448,7 @@ var SelectControl = createControl(
|
|
|
415
448
|
setValue(newValue);
|
|
416
449
|
};
|
|
417
450
|
const isDisabled = disabled || options.length === 0;
|
|
418
|
-
return /* @__PURE__ */
|
|
451
|
+
return /* @__PURE__ */ React13.createElement(ControlActions, null, /* @__PURE__ */ React13.createElement(
|
|
419
452
|
Select,
|
|
420
453
|
{
|
|
421
454
|
sx: { overflow: "hidden" },
|
|
@@ -429,7 +462,7 @@ var SelectControl = createControl(
|
|
|
429
462
|
if (placeholder) {
|
|
430
463
|
const placeholderOption = findOptionByValue(placeholder);
|
|
431
464
|
const displayText = placeholderOption?.label || placeholder;
|
|
432
|
-
return /* @__PURE__ */
|
|
465
|
+
return /* @__PURE__ */ React13.createElement(Typography, { component: "span", variant: "caption", color: "text.tertiary" }, displayText);
|
|
433
466
|
}
|
|
434
467
|
return "";
|
|
435
468
|
}
|
|
@@ -441,7 +474,7 @@ var SelectControl = createControl(
|
|
|
441
474
|
disabled: isDisabled,
|
|
442
475
|
fullWidth: true
|
|
443
476
|
},
|
|
444
|
-
options.map(({ label, ...props }) => /* @__PURE__ */
|
|
477
|
+
options.map(({ label, ...props }) => /* @__PURE__ */ React13.createElement(MenuListItem, { key: props.value, ...props, value: props.value ?? "" }, label))
|
|
445
478
|
));
|
|
446
479
|
}
|
|
447
480
|
);
|
|
@@ -449,19 +482,19 @@ var SelectControl = createControl(
|
|
|
449
482
|
// src/controls/image-control.tsx
|
|
450
483
|
var ImageControl = createControl(({ sizes }) => {
|
|
451
484
|
const propContext = useBoundProp(imagePropTypeUtil);
|
|
452
|
-
return /* @__PURE__ */
|
|
485
|
+
return /* @__PURE__ */ React14.createElement(PropProvider, { ...propContext }, /* @__PURE__ */ React14.createElement(Stack3, { gap: 1.5 }, /* @__PURE__ */ React14.createElement(ControlLabel, null, __2("Image", "elementor")), /* @__PURE__ */ React14.createElement(ImageSrcControl, null), /* @__PURE__ */ React14.createElement(Grid, { container: true, gap: 1.5, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React14.createElement(Grid, { item: true, xs: 6 }, /* @__PURE__ */ React14.createElement(ControlFormLabel, null, __2("Resolution", "elementor"))), /* @__PURE__ */ React14.createElement(Grid, { item: true, xs: 6, sx: { overflow: "hidden" } }, /* @__PURE__ */ React14.createElement(ImageSizeControl, { sizes })))));
|
|
453
486
|
});
|
|
454
487
|
var ImageSrcControl = () => {
|
|
455
488
|
const { data: allowSvgUpload } = useUnfilteredFilesUpload();
|
|
456
489
|
const mediaTypes = allowSvgUpload ? ["image", "svg"] : ["image"];
|
|
457
|
-
return /* @__PURE__ */
|
|
490
|
+
return /* @__PURE__ */ React14.createElement(PropKeyProvider, { bind: "src" }, /* @__PURE__ */ React14.createElement(ImageMediaControl, { mediaTypes }));
|
|
458
491
|
};
|
|
459
492
|
var ImageSizeControl = ({ sizes }) => {
|
|
460
|
-
return /* @__PURE__ */
|
|
493
|
+
return /* @__PURE__ */ React14.createElement(PropKeyProvider, { bind: "size" }, /* @__PURE__ */ React14.createElement(SelectControl, { options: sizes }));
|
|
461
494
|
};
|
|
462
495
|
|
|
463
496
|
// src/controls/text-control.tsx
|
|
464
|
-
import * as
|
|
497
|
+
import * as React15 from "react";
|
|
465
498
|
import { stringPropTypeUtil as stringPropTypeUtil2 } from "@elementor/editor-props";
|
|
466
499
|
import { TextField } from "@elementor/ui";
|
|
467
500
|
var TextControl = createControl(
|
|
@@ -476,7 +509,7 @@ var TextControl = createControl(
|
|
|
476
509
|
}) => {
|
|
477
510
|
const { value, setValue, disabled } = useBoundProp(stringPropTypeUtil2);
|
|
478
511
|
const handleChange = (event) => setValue(event.target.value);
|
|
479
|
-
return /* @__PURE__ */
|
|
512
|
+
return /* @__PURE__ */ React15.createElement(ControlActions, null, /* @__PURE__ */ React15.createElement(
|
|
480
513
|
TextField,
|
|
481
514
|
{
|
|
482
515
|
size: "tiny",
|
|
@@ -497,7 +530,7 @@ var TextControl = createControl(
|
|
|
497
530
|
);
|
|
498
531
|
|
|
499
532
|
// src/controls/text-area-control.tsx
|
|
500
|
-
import * as
|
|
533
|
+
import * as React16 from "react";
|
|
501
534
|
import { stringPropTypeUtil as stringPropTypeUtil3 } from "@elementor/editor-props";
|
|
502
535
|
import { TextField as TextField2 } from "@elementor/ui";
|
|
503
536
|
var TextAreaControl = createControl(({ placeholder, ariaLabel }) => {
|
|
@@ -505,7 +538,7 @@ var TextAreaControl = createControl(({ placeholder, ariaLabel }) => {
|
|
|
505
538
|
const handleChange = (event) => {
|
|
506
539
|
setValue(event.target.value);
|
|
507
540
|
};
|
|
508
|
-
return /* @__PURE__ */
|
|
541
|
+
return /* @__PURE__ */ React16.createElement(ControlActions, null, /* @__PURE__ */ React16.createElement(
|
|
509
542
|
TextField2,
|
|
510
543
|
{
|
|
511
544
|
size: "tiny",
|
|
@@ -524,14 +557,14 @@ var TextAreaControl = createControl(({ placeholder, ariaLabel }) => {
|
|
|
524
557
|
});
|
|
525
558
|
|
|
526
559
|
// src/controls/size-control.tsx
|
|
527
|
-
import * as
|
|
560
|
+
import * as React21 from "react";
|
|
528
561
|
import { useEffect as useEffect3, useMemo as useMemo2 } from "react";
|
|
529
562
|
import { sizePropTypeUtil as sizePropTypeUtil2 } from "@elementor/editor-props";
|
|
530
563
|
import { useActiveBreakpoint } from "@elementor/editor-responsive";
|
|
531
564
|
import { usePopupState as usePopupState2 } from "@elementor/ui";
|
|
532
565
|
|
|
533
566
|
// src/components/size-control/size-input.tsx
|
|
534
|
-
import * as
|
|
567
|
+
import * as React19 from "react";
|
|
535
568
|
import { useRef } from "react";
|
|
536
569
|
import { MathFunctionIcon } from "@elementor/icons";
|
|
537
570
|
import { Box, InputAdornment as InputAdornment2 } from "@elementor/ui";
|
|
@@ -548,7 +581,7 @@ function isUnitExtendedOption(unit) {
|
|
|
548
581
|
}
|
|
549
582
|
|
|
550
583
|
// src/components/size-control/text-field-inner-selection.tsx
|
|
551
|
-
import * as
|
|
584
|
+
import * as React18 from "react";
|
|
552
585
|
import { forwardRef as forwardRef2, useId } from "react";
|
|
553
586
|
import { sizePropTypeUtil } from "@elementor/editor-props";
|
|
554
587
|
import { MenuListItem as MenuListItem2 } from "@elementor/editor-ui";
|
|
@@ -563,7 +596,7 @@ import {
|
|
|
563
596
|
} from "@elementor/ui";
|
|
564
597
|
|
|
565
598
|
// src/components/number-input.tsx
|
|
566
|
-
import * as
|
|
599
|
+
import * as React17 from "react";
|
|
567
600
|
import { forwardRef, useState as useState3 } from "react";
|
|
568
601
|
import { TextField as TextField3 } from "@elementor/ui";
|
|
569
602
|
var RESTRICTED_INPUT_KEYS = ["e", "E", "+"];
|
|
@@ -580,7 +613,7 @@ var NumberInput = forwardRef((props, ref) => {
|
|
|
580
613
|
setKey((prev) => prev + 1);
|
|
581
614
|
}
|
|
582
615
|
};
|
|
583
|
-
return /* @__PURE__ */
|
|
616
|
+
return /* @__PURE__ */ React17.createElement(TextField3, { ...props, ref, key, onKeyDown: handleKeyDown, onBlur: handleBlur });
|
|
584
617
|
});
|
|
585
618
|
function blockRestrictedKeys(event, min) {
|
|
586
619
|
const restrictedInputKeys = [...RESTRICTED_INPUT_KEYS];
|
|
@@ -612,7 +645,7 @@ var TextFieldInnerSelection = forwardRef2(
|
|
|
612
645
|
const getCursorStyle = () => ({
|
|
613
646
|
input: { cursor: InputProps.readOnly ? "default !important" : void 0 }
|
|
614
647
|
});
|
|
615
|
-
return /* @__PURE__ */
|
|
648
|
+
return /* @__PURE__ */ React18.createElement(
|
|
616
649
|
NumberInput,
|
|
617
650
|
{
|
|
618
651
|
ref,
|
|
@@ -657,7 +690,7 @@ var SelectionEndAdornment = ({
|
|
|
657
690
|
flexDirection: "column",
|
|
658
691
|
justifyContent: "center"
|
|
659
692
|
};
|
|
660
|
-
return /* @__PURE__ */
|
|
693
|
+
return /* @__PURE__ */ React18.createElement(InputAdornment, { position: "end" }, /* @__PURE__ */ React18.createElement(
|
|
661
694
|
StyledButton,
|
|
662
695
|
{
|
|
663
696
|
isPrimaryColor: showPrimaryColor,
|
|
@@ -666,7 +699,7 @@ var SelectionEndAdornment = ({
|
|
|
666
699
|
...bindTrigger(popupState)
|
|
667
700
|
},
|
|
668
701
|
placeholder ?? alternativeOptionLabels[value] ?? value
|
|
669
|
-
), /* @__PURE__ */
|
|
702
|
+
), /* @__PURE__ */ React18.createElement(Menu, { MenuListProps: { dense: true }, ...bindMenu(popupState) }, options.map((option, index) => /* @__PURE__ */ React18.createElement(
|
|
670
703
|
MenuListItem2,
|
|
671
704
|
{
|
|
672
705
|
key: option,
|
|
@@ -759,7 +792,7 @@ var SizeInput = ({
|
|
|
759
792
|
custom: popupAttributes
|
|
760
793
|
} : void 0;
|
|
761
794
|
const alternativeOptionLabels = {
|
|
762
|
-
custom: /* @__PURE__ */
|
|
795
|
+
custom: /* @__PURE__ */ React19.createElement(MathFunctionIcon, { fontSize: "tiny" })
|
|
763
796
|
};
|
|
764
797
|
const InputProps = {
|
|
765
798
|
...popupAttributes,
|
|
@@ -767,8 +800,8 @@ var SizeInput = ({
|
|
|
767
800
|
autoComplete: "off",
|
|
768
801
|
onClick,
|
|
769
802
|
onFocus,
|
|
770
|
-
startAdornment: startIcon ? /* @__PURE__ */
|
|
771
|
-
endAdornment: /* @__PURE__ */
|
|
803
|
+
startAdornment: startIcon ? /* @__PURE__ */ React19.createElement(InputAdornment2, { position: "start", disabled }, startIcon) : void 0,
|
|
804
|
+
endAdornment: /* @__PURE__ */ React19.createElement(
|
|
772
805
|
SelectionEndAdornment,
|
|
773
806
|
{
|
|
774
807
|
disabled,
|
|
@@ -780,7 +813,7 @@ var SizeInput = ({
|
|
|
780
813
|
}
|
|
781
814
|
)
|
|
782
815
|
};
|
|
783
|
-
return /* @__PURE__ */
|
|
816
|
+
return /* @__PURE__ */ React19.createElement(ControlActions, null, /* @__PURE__ */ React19.createElement(Box, null, /* @__PURE__ */ React19.createElement(
|
|
784
817
|
TextFieldInnerSelection,
|
|
785
818
|
{
|
|
786
819
|
disabled,
|
|
@@ -799,7 +832,7 @@ var SizeInput = ({
|
|
|
799
832
|
};
|
|
800
833
|
|
|
801
834
|
// src/components/text-field-popover.tsx
|
|
802
|
-
import * as
|
|
835
|
+
import * as React20 from "react";
|
|
803
836
|
import { useEffect, useRef as useRef2 } from "react";
|
|
804
837
|
import { PopoverHeader } from "@elementor/editor-ui";
|
|
805
838
|
import { MathFunctionIcon as MathFunctionIcon2 } from "@elementor/icons";
|
|
@@ -822,7 +855,7 @@ var TextFieldPopover = (props) => {
|
|
|
822
855
|
restoreValue();
|
|
823
856
|
popupState.close();
|
|
824
857
|
};
|
|
825
|
-
return /* @__PURE__ */
|
|
858
|
+
return /* @__PURE__ */ React20.createElement(
|
|
826
859
|
Popover,
|
|
827
860
|
{
|
|
828
861
|
disablePortal: true,
|
|
@@ -839,15 +872,15 @@ var TextFieldPopover = (props) => {
|
|
|
839
872
|
transformOrigin: { vertical: "top", horizontal: "center" },
|
|
840
873
|
onClose: handleClose
|
|
841
874
|
},
|
|
842
|
-
/* @__PURE__ */
|
|
875
|
+
/* @__PURE__ */ React20.createElement(
|
|
843
876
|
PopoverHeader,
|
|
844
877
|
{
|
|
845
878
|
title: __3("CSS function", "elementor"),
|
|
846
879
|
onClose: handleClose,
|
|
847
|
-
icon: /* @__PURE__ */
|
|
880
|
+
icon: /* @__PURE__ */ React20.createElement(MathFunctionIcon2, { fontSize: SIZE })
|
|
848
881
|
}
|
|
849
882
|
),
|
|
850
|
-
/* @__PURE__ */
|
|
883
|
+
/* @__PURE__ */ React20.createElement(
|
|
851
884
|
TextField4,
|
|
852
885
|
{
|
|
853
886
|
value,
|
|
@@ -994,7 +1027,7 @@ var SizeControl = createControl(
|
|
|
994
1027
|
popupState.open(anchorRef?.current);
|
|
995
1028
|
}
|
|
996
1029
|
};
|
|
997
|
-
const maybeClosePopup =
|
|
1030
|
+
const maybeClosePopup = React21.useCallback(() => {
|
|
998
1031
|
if (popupState && popupState.isOpen) {
|
|
999
1032
|
popupState.close();
|
|
1000
1033
|
}
|
|
@@ -1002,7 +1035,7 @@ var SizeControl = createControl(
|
|
|
1002
1035
|
useEffect3(() => {
|
|
1003
1036
|
maybeClosePopup();
|
|
1004
1037
|
}, [activeBreakpoint]);
|
|
1005
|
-
return /* @__PURE__ */
|
|
1038
|
+
return /* @__PURE__ */ React21.createElement(React21.Fragment, null, /* @__PURE__ */ React21.createElement(
|
|
1006
1039
|
SizeInput,
|
|
1007
1040
|
{
|
|
1008
1041
|
disabled,
|
|
@@ -1020,7 +1053,7 @@ var SizeControl = createControl(
|
|
|
1020
1053
|
id,
|
|
1021
1054
|
ariaLabel
|
|
1022
1055
|
}
|
|
1023
|
-
), anchorRef?.current && popupState.isOpen && /* @__PURE__ */
|
|
1056
|
+
), anchorRef?.current && popupState.isOpen && /* @__PURE__ */ React21.createElement(
|
|
1024
1057
|
TextFieldPopover,
|
|
1025
1058
|
{
|
|
1026
1059
|
popupState,
|
|
@@ -1079,19 +1112,19 @@ function extractValueFromState(state, allowEmpty = false) {
|
|
|
1079
1112
|
}
|
|
1080
1113
|
|
|
1081
1114
|
// src/controls/stroke-control.tsx
|
|
1082
|
-
import * as
|
|
1115
|
+
import * as React24 from "react";
|
|
1083
1116
|
import { forwardRef as forwardRef3, useRef as useRef3 } from "react";
|
|
1084
1117
|
import { strokePropTypeUtil } from "@elementor/editor-props";
|
|
1085
1118
|
import { Grid as Grid2 } from "@elementor/ui";
|
|
1086
1119
|
import { __ as __4 } from "@wordpress/i18n";
|
|
1087
1120
|
|
|
1088
1121
|
// src/components/section-content.tsx
|
|
1089
|
-
import * as
|
|
1090
|
-
import { Stack as
|
|
1091
|
-
var SectionContent = ({ gap = 0.5, sx, children }) => /* @__PURE__ */
|
|
1122
|
+
import * as React22 from "react";
|
|
1123
|
+
import { Stack as Stack4 } from "@elementor/ui";
|
|
1124
|
+
var SectionContent = ({ gap = 0.5, sx, children }) => /* @__PURE__ */ React22.createElement(Stack4, { gap, sx: { ...sx } }, children);
|
|
1092
1125
|
|
|
1093
1126
|
// src/controls/color-control.tsx
|
|
1094
|
-
import * as
|
|
1127
|
+
import * as React23 from "react";
|
|
1095
1128
|
import { colorPropTypeUtil } from "@elementor/editor-props";
|
|
1096
1129
|
import { UnstableColorField } from "@elementor/ui";
|
|
1097
1130
|
var ColorControl = createControl(
|
|
@@ -1101,7 +1134,7 @@ var ColorControl = createControl(
|
|
|
1101
1134
|
const handleChange = (selectedColor) => {
|
|
1102
1135
|
setValue(selectedColor || null);
|
|
1103
1136
|
};
|
|
1104
|
-
return /* @__PURE__ */
|
|
1137
|
+
return /* @__PURE__ */ React23.createElement(ControlActions, null, /* @__PURE__ */ React23.createElement(
|
|
1105
1138
|
UnstableColorField,
|
|
1106
1139
|
{
|
|
1107
1140
|
id,
|
|
@@ -1144,26 +1177,26 @@ var units = ["px", "em", "rem"];
|
|
|
1144
1177
|
var StrokeControl = createControl(() => {
|
|
1145
1178
|
const propContext = useBoundProp(strokePropTypeUtil);
|
|
1146
1179
|
const rowRef = useRef3(null);
|
|
1147
|
-
return /* @__PURE__ */
|
|
1180
|
+
return /* @__PURE__ */ React24.createElement(PropProvider, { ...propContext }, /* @__PURE__ */ React24.createElement(SectionContent, null, /* @__PURE__ */ React24.createElement(Control, { bind: "width", label: __4("Stroke width", "elementor"), ref: rowRef }, /* @__PURE__ */ React24.createElement(SizeControl, { units, anchorRef: rowRef })), /* @__PURE__ */ React24.createElement(Control, { bind: "color", label: __4("Stroke color", "elementor") }, /* @__PURE__ */ React24.createElement(ColorControl, null))));
|
|
1148
1181
|
});
|
|
1149
|
-
var Control = forwardRef3(({ bind, label, children }, ref) => /* @__PURE__ */
|
|
1182
|
+
var Control = forwardRef3(({ bind, label, children }, ref) => /* @__PURE__ */ React24.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React24.createElement(Grid2, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap", ref }, /* @__PURE__ */ React24.createElement(Grid2, { item: true, xs: 6 }, /* @__PURE__ */ React24.createElement(ControlFormLabel, null, label)), /* @__PURE__ */ React24.createElement(Grid2, { item: true, xs: 6 }, children))));
|
|
1150
1183
|
|
|
1151
1184
|
// src/controls/box-shadow-repeater-control.tsx
|
|
1152
|
-
import * as
|
|
1185
|
+
import * as React40 from "react";
|
|
1153
1186
|
import { useRef as useRef4 } from "react";
|
|
1154
1187
|
import { boxShadowPropTypeUtil, shadowPropTypeUtil } from "@elementor/editor-props";
|
|
1155
1188
|
import { FormLabel as FormLabel2, Grid as Grid4, styled as styled4, UnstableColorIndicator } from "@elementor/ui";
|
|
1156
1189
|
import { __ as __11 } from "@wordpress/i18n";
|
|
1157
1190
|
|
|
1158
1191
|
// src/components/control-repeater/actions/tooltip-add-item-action.tsx
|
|
1159
|
-
import * as
|
|
1192
|
+
import * as React26 from "react";
|
|
1160
1193
|
import { PlusIcon } from "@elementor/icons";
|
|
1161
1194
|
import { Box as Box2, IconButton, Infotip } from "@elementor/ui";
|
|
1162
1195
|
import { __ as __5, sprintf } from "@wordpress/i18n";
|
|
1163
1196
|
|
|
1164
1197
|
// src/components/control-repeater/context/repeater-context.tsx
|
|
1165
|
-
import * as
|
|
1166
|
-
import { createContext as
|
|
1198
|
+
import * as React25 from "react";
|
|
1199
|
+
import { createContext as createContext8, useMemo as useMemo3, useState as useState5 } from "react";
|
|
1167
1200
|
import { usePopupState as usePopupState3 } from "@elementor/ui";
|
|
1168
1201
|
|
|
1169
1202
|
// src/services/event-bus.ts
|
|
@@ -1201,18 +1234,18 @@ var EventBus = class {
|
|
|
1201
1234
|
var eventBus = new EventBus();
|
|
1202
1235
|
|
|
1203
1236
|
// src/components/control-repeater/context/item-context.tsx
|
|
1204
|
-
import { createContext as
|
|
1205
|
-
var ItemContext =
|
|
1237
|
+
import { createContext as createContext7 } from "react";
|
|
1238
|
+
var ItemContext = createContext7({
|
|
1206
1239
|
index: -1,
|
|
1207
1240
|
value: {}
|
|
1208
1241
|
});
|
|
1209
1242
|
|
|
1210
1243
|
// src/components/control-repeater/context/repeater-context.tsx
|
|
1211
|
-
var RepeaterContext =
|
|
1244
|
+
var RepeaterContext = createContext8(null);
|
|
1212
1245
|
var EMPTY_OPEN_ITEM = -1;
|
|
1213
1246
|
var useRepeaterContext = () => {
|
|
1214
|
-
const context =
|
|
1215
|
-
const itemContext =
|
|
1247
|
+
const context = React25.useContext(RepeaterContext);
|
|
1248
|
+
const itemContext = React25.useContext(ItemContext);
|
|
1216
1249
|
if (!context) {
|
|
1217
1250
|
throw new Error("useRepeaterContext must be used within a RepeaterContextProvider");
|
|
1218
1251
|
}
|
|
@@ -1274,7 +1307,7 @@ var RepeaterContextProvider = ({
|
|
|
1274
1307
|
const newItems = [...items2.slice(0, index), updatedItem, ...items2.slice(index + 1)];
|
|
1275
1308
|
setItems(newItems);
|
|
1276
1309
|
};
|
|
1277
|
-
return /* @__PURE__ */
|
|
1310
|
+
return /* @__PURE__ */ React25.createElement(
|
|
1278
1311
|
RepeaterContext.Provider,
|
|
1279
1312
|
{
|
|
1280
1313
|
value: {
|
|
@@ -1311,7 +1344,7 @@ var TooltipAddItemAction = ({
|
|
|
1311
1344
|
}) => {
|
|
1312
1345
|
const { addItem } = useRepeaterContext();
|
|
1313
1346
|
const onClick = (ev) => addItem(ev, { index: newItemIndex });
|
|
1314
|
-
return /* @__PURE__ */
|
|
1347
|
+
return /* @__PURE__ */ React26.createElement(ConditionalToolTip, { content: tooltipContent, enable: enableTooltip }, /* @__PURE__ */ React26.createElement(Box2, { component: "span", sx: { cursor: disabled ? "not-allowed" : "pointer" } }, /* @__PURE__ */ React26.createElement(
|
|
1315
1348
|
IconButton,
|
|
1316
1349
|
{
|
|
1317
1350
|
size: SIZE2,
|
|
@@ -1319,20 +1352,20 @@ var TooltipAddItemAction = ({
|
|
|
1319
1352
|
onClick,
|
|
1320
1353
|
"aria-label": sprintf(__5("Add %s item", "elementor"), ariaLabel?.toLowerCase())
|
|
1321
1354
|
},
|
|
1322
|
-
/* @__PURE__ */
|
|
1355
|
+
/* @__PURE__ */ React26.createElement(PlusIcon, { fontSize: SIZE2 })
|
|
1323
1356
|
)));
|
|
1324
1357
|
};
|
|
1325
1358
|
var ConditionalToolTip = ({
|
|
1326
1359
|
children,
|
|
1327
1360
|
enable,
|
|
1328
1361
|
content
|
|
1329
|
-
}) => enable && content ? /* @__PURE__ */
|
|
1362
|
+
}) => enable && content ? /* @__PURE__ */ React26.createElement(Infotip, { placement: "right", color: "secondary", content }, children) : children;
|
|
1330
1363
|
|
|
1331
1364
|
// src/components/control-repeater/items/items-container.tsx
|
|
1332
|
-
import * as
|
|
1365
|
+
import * as React28 from "react";
|
|
1333
1366
|
|
|
1334
1367
|
// src/components/repeater/sortable.tsx
|
|
1335
|
-
import * as
|
|
1368
|
+
import * as React27 from "react";
|
|
1336
1369
|
import { GripVerticalIcon } from "@elementor/icons";
|
|
1337
1370
|
import {
|
|
1338
1371
|
Divider,
|
|
@@ -1344,10 +1377,10 @@ import {
|
|
|
1344
1377
|
} from "@elementor/ui";
|
|
1345
1378
|
import { __ as __6 } from "@wordpress/i18n";
|
|
1346
1379
|
var SortableProvider = (props) => {
|
|
1347
|
-
return /* @__PURE__ */
|
|
1380
|
+
return /* @__PURE__ */ React27.createElement(List, { sx: { p: 0, my: -0.5, mx: 0 } }, /* @__PURE__ */ React27.createElement(UnstableSortableProvider, { restrictAxis: true, disableDragOverlay: false, variant: "static", ...props }));
|
|
1348
1381
|
};
|
|
1349
1382
|
var SortableItem = ({ id, children, disabled }) => {
|
|
1350
|
-
return /* @__PURE__ */
|
|
1383
|
+
return /* @__PURE__ */ React27.createElement(
|
|
1351
1384
|
UnstableSortableItem,
|
|
1352
1385
|
{
|
|
1353
1386
|
id,
|
|
@@ -1360,7 +1393,7 @@ var SortableItem = ({ id, children, disabled }) => {
|
|
|
1360
1393
|
showDropIndication,
|
|
1361
1394
|
dropIndicationStyle
|
|
1362
1395
|
}) => {
|
|
1363
|
-
return /* @__PURE__ */
|
|
1396
|
+
return /* @__PURE__ */ React27.createElement(StyledListItem, { ...itemProps, style: itemStyle, tabIndex: -1 }, !disabled && /* @__PURE__ */ React27.createElement(SortableTrigger, { ...triggerProps, style: triggerStyle }), children, showDropIndication && /* @__PURE__ */ React27.createElement(StyledDivider, { style: dropIndicationStyle }));
|
|
1364
1397
|
}
|
|
1365
1398
|
}
|
|
1366
1399
|
);
|
|
@@ -1395,7 +1428,7 @@ var StyledListItem = styled3(ListItem)`
|
|
|
1395
1428
|
}
|
|
1396
1429
|
}
|
|
1397
1430
|
`;
|
|
1398
|
-
var SortableTrigger = (props) => /* @__PURE__ */
|
|
1431
|
+
var SortableTrigger = (props) => /* @__PURE__ */ React27.createElement(
|
|
1399
1432
|
"div",
|
|
1400
1433
|
{
|
|
1401
1434
|
...props,
|
|
@@ -1404,7 +1437,7 @@ var SortableTrigger = (props) => /* @__PURE__ */ React24.createElement(
|
|
|
1404
1437
|
tabIndex: 0,
|
|
1405
1438
|
"aria-label": __6("Drag item", "elementor")
|
|
1406
1439
|
},
|
|
1407
|
-
/* @__PURE__ */
|
|
1440
|
+
/* @__PURE__ */ React27.createElement(GripVerticalIcon, { fontSize: "tiny" })
|
|
1408
1441
|
);
|
|
1409
1442
|
var StyledDivider = styled3(Divider)`
|
|
1410
1443
|
height: 0px;
|
|
@@ -1441,22 +1474,22 @@ var ItemsContainer = ({
|
|
|
1441
1474
|
})
|
|
1442
1475
|
);
|
|
1443
1476
|
};
|
|
1444
|
-
return /* @__PURE__ */
|
|
1477
|
+
return /* @__PURE__ */ React28.createElement(React28.Fragment, null, /* @__PURE__ */ React28.createElement(SortableProvider, { value: keys, onChange: onChangeOrder }, keys.map((key, index) => {
|
|
1445
1478
|
const value = items2[index].item;
|
|
1446
|
-
return /* @__PURE__ */
|
|
1479
|
+
return /* @__PURE__ */ React28.createElement(SortableItem, { id: key, key: `sortable-${key}`, disabled: !isSortable }, /* @__PURE__ */ React28.createElement(ItemContext.Provider, { value: { index, value } }, children));
|
|
1447
1480
|
})));
|
|
1448
1481
|
};
|
|
1449
1482
|
|
|
1450
1483
|
// src/components/control-repeater/items/item.tsx
|
|
1451
|
-
import * as
|
|
1484
|
+
import * as React30 from "react";
|
|
1452
1485
|
import { bindTrigger as bindTrigger2 } from "@elementor/ui";
|
|
1453
1486
|
import { __ as __7 } from "@wordpress/i18n";
|
|
1454
1487
|
|
|
1455
1488
|
// src/hooks/use-repeatable-control-context.ts
|
|
1456
|
-
import { createContext as
|
|
1457
|
-
var RepeatableControlContext =
|
|
1489
|
+
import { createContext as createContext9, useContext as useContext8 } from "react";
|
|
1490
|
+
var RepeatableControlContext = createContext9(void 0);
|
|
1458
1491
|
var useRepeatableControlContext = () => {
|
|
1459
|
-
const context =
|
|
1492
|
+
const context = useContext8(RepeatableControlContext);
|
|
1460
1493
|
if (!context) {
|
|
1461
1494
|
throw new Error("useRepeatableControlContext must be used within RepeatableControl");
|
|
1462
1495
|
}
|
|
@@ -1464,11 +1497,11 @@ var useRepeatableControlContext = () => {
|
|
|
1464
1497
|
};
|
|
1465
1498
|
|
|
1466
1499
|
// src/components/repeater/repeater-tag.tsx
|
|
1467
|
-
import * as
|
|
1500
|
+
import * as React29 from "react";
|
|
1468
1501
|
import { forwardRef as forwardRef4 } from "react";
|
|
1469
1502
|
import { UnstableTag } from "@elementor/ui";
|
|
1470
1503
|
var RepeaterTag = forwardRef4((props, ref) => {
|
|
1471
|
-
return /* @__PURE__ */
|
|
1504
|
+
return /* @__PURE__ */ React29.createElement(
|
|
1472
1505
|
UnstableTag,
|
|
1473
1506
|
{
|
|
1474
1507
|
ref,
|
|
@@ -1498,7 +1531,7 @@ var Item = ({ Label: Label3, Icon, actions }) => {
|
|
|
1498
1531
|
value,
|
|
1499
1532
|
isItemDisabled: isItemDisabled2
|
|
1500
1533
|
} = useRepeaterContext();
|
|
1501
|
-
const repeatableContext =
|
|
1534
|
+
const repeatableContext = React30.useContext(RepeatableControlContext);
|
|
1502
1535
|
const disableOpen = !!repeatableContext?.props?.readOnly;
|
|
1503
1536
|
const triggerProps = bindTrigger2(popoverState);
|
|
1504
1537
|
const onClick = (ev) => {
|
|
@@ -1515,15 +1548,15 @@ var Item = ({ Label: Label3, Icon, actions }) => {
|
|
|
1515
1548
|
setRowRef(ref);
|
|
1516
1549
|
popoverState.setAnchorEl(ref);
|
|
1517
1550
|
};
|
|
1518
|
-
return /* @__PURE__ */
|
|
1551
|
+
return /* @__PURE__ */ React30.createElement(
|
|
1519
1552
|
RepeaterTag,
|
|
1520
1553
|
{
|
|
1521
1554
|
ref: setRef,
|
|
1522
|
-
label: /* @__PURE__ */
|
|
1555
|
+
label: /* @__PURE__ */ React30.createElement(RepeaterItemLabelSlot, { value }, /* @__PURE__ */ React30.createElement(Label3, { value })),
|
|
1523
1556
|
"aria-label": __7("Open item", "elementor"),
|
|
1524
1557
|
...triggerProps,
|
|
1525
1558
|
onClick,
|
|
1526
|
-
startIcon: /* @__PURE__ */
|
|
1559
|
+
startIcon: /* @__PURE__ */ React30.createElement(RepeaterItemIconSlot, { value }, /* @__PURE__ */ React30.createElement(Icon, { value })),
|
|
1527
1560
|
sx: {
|
|
1528
1561
|
minHeight: (theme) => theme.spacing(3.5),
|
|
1529
1562
|
...isItemDisabled2(index) && {
|
|
@@ -1532,20 +1565,20 @@ var Item = ({ Label: Label3, Icon, actions }) => {
|
|
|
1532
1565
|
}
|
|
1533
1566
|
}
|
|
1534
1567
|
},
|
|
1535
|
-
actions: /* @__PURE__ */
|
|
1568
|
+
actions: /* @__PURE__ */ React30.createElement(React30.Fragment, null, /* @__PURE__ */ React30.createElement(RepeaterItemActionsSlot, { index: index ?? -1 }), actions)
|
|
1536
1569
|
}
|
|
1537
1570
|
);
|
|
1538
1571
|
};
|
|
1539
1572
|
|
|
1540
1573
|
// src/components/control-repeater/control-repeater.tsx
|
|
1541
|
-
import * as
|
|
1574
|
+
import * as React31 from "react";
|
|
1542
1575
|
var ControlRepeater = ({
|
|
1543
1576
|
children,
|
|
1544
1577
|
initial,
|
|
1545
1578
|
propTypeUtil,
|
|
1546
1579
|
isItemDisabled: isItemDisabled2
|
|
1547
1580
|
}) => {
|
|
1548
|
-
return /* @__PURE__ */
|
|
1581
|
+
return /* @__PURE__ */ React31.createElement(SectionContent, null, /* @__PURE__ */ React31.createElement(
|
|
1549
1582
|
RepeaterContextProvider,
|
|
1550
1583
|
{
|
|
1551
1584
|
initial,
|
|
@@ -1557,7 +1590,7 @@ var ControlRepeater = ({
|
|
|
1557
1590
|
};
|
|
1558
1591
|
|
|
1559
1592
|
// src/components/control-repeater/actions/disable-item-action.tsx
|
|
1560
|
-
import * as
|
|
1593
|
+
import * as React32 from "react";
|
|
1561
1594
|
import { EyeIcon, EyeOffIcon } from "@elementor/icons";
|
|
1562
1595
|
import { IconButton as IconButton2, Tooltip } from "@elementor/ui";
|
|
1563
1596
|
import { __ as __8 } from "@wordpress/i18n";
|
|
@@ -1577,11 +1610,11 @@ var DisableItemAction = () => {
|
|
|
1577
1610
|
}
|
|
1578
1611
|
updateItem(self, index);
|
|
1579
1612
|
};
|
|
1580
|
-
return /* @__PURE__ */
|
|
1613
|
+
return /* @__PURE__ */ React32.createElement(Tooltip, { title: toggleLabel, placement: "top" }, /* @__PURE__ */ React32.createElement(IconButton2, { size: SIZE3, onClick, "aria-label": toggleLabel }, propDisabled ? /* @__PURE__ */ React32.createElement(EyeOffIcon, { fontSize: SIZE3 }) : /* @__PURE__ */ React32.createElement(EyeIcon, { fontSize: SIZE3 })));
|
|
1581
1614
|
};
|
|
1582
1615
|
|
|
1583
1616
|
// src/components/control-repeater/actions/duplicate-item-action.tsx
|
|
1584
|
-
import * as
|
|
1617
|
+
import * as React33 from "react";
|
|
1585
1618
|
import { CopyIcon } from "@elementor/icons";
|
|
1586
1619
|
import { IconButton as IconButton3, Tooltip as Tooltip2 } from "@elementor/ui";
|
|
1587
1620
|
import { __ as __9 } from "@wordpress/i18n";
|
|
@@ -1597,7 +1630,7 @@ var DuplicateItemAction = () => {
|
|
|
1597
1630
|
const newItem = structuredClone(item);
|
|
1598
1631
|
addItem(ev, { item: newItem, index: index + 1 });
|
|
1599
1632
|
};
|
|
1600
|
-
return /* @__PURE__ */
|
|
1633
|
+
return /* @__PURE__ */ React33.createElement(Tooltip2, { title: duplicateLabel, placement: "top" }, /* @__PURE__ */ React33.createElement(
|
|
1601
1634
|
IconButton3,
|
|
1602
1635
|
{
|
|
1603
1636
|
size: SIZE4,
|
|
@@ -1605,12 +1638,12 @@ var DuplicateItemAction = () => {
|
|
|
1605
1638
|
"aria-label": duplicateLabel,
|
|
1606
1639
|
disabled: isItemDisabled2(index)
|
|
1607
1640
|
},
|
|
1608
|
-
/* @__PURE__ */
|
|
1641
|
+
/* @__PURE__ */ React33.createElement(CopyIcon, { fontSize: SIZE4 })
|
|
1609
1642
|
));
|
|
1610
1643
|
};
|
|
1611
1644
|
|
|
1612
1645
|
// src/components/control-repeater/actions/remove-item-action.tsx
|
|
1613
|
-
import * as
|
|
1646
|
+
import * as React34 from "react";
|
|
1614
1647
|
import { XIcon } from "@elementor/icons";
|
|
1615
1648
|
import { IconButton as IconButton4, Tooltip as Tooltip3 } from "@elementor/ui";
|
|
1616
1649
|
import { __ as __10 } from "@wordpress/i18n";
|
|
@@ -1622,18 +1655,18 @@ var RemoveItemAction = () => {
|
|
|
1622
1655
|
}
|
|
1623
1656
|
const removeLabel = __10("Remove", "elementor");
|
|
1624
1657
|
const onClick = () => removeItem(index);
|
|
1625
|
-
return /* @__PURE__ */
|
|
1658
|
+
return /* @__PURE__ */ React34.createElement(Tooltip3, { title: removeLabel, placement: "top" }, /* @__PURE__ */ React34.createElement(IconButton4, { size: SIZE5, onClick, "aria-label": removeLabel }, /* @__PURE__ */ React34.createElement(XIcon, { fontSize: SIZE5 })));
|
|
1626
1659
|
};
|
|
1627
1660
|
|
|
1628
1661
|
// src/components/control-repeater/items/edit-item-popover.tsx
|
|
1629
|
-
import * as
|
|
1662
|
+
import * as React36 from "react";
|
|
1630
1663
|
import { bindPopover as bindPopover2, Box as Box3 } from "@elementor/ui";
|
|
1631
1664
|
|
|
1632
1665
|
// src/components/repeater/repeater-popover.tsx
|
|
1633
|
-
import * as
|
|
1666
|
+
import * as React35 from "react";
|
|
1634
1667
|
import { Popover as Popover2 } from "@elementor/ui";
|
|
1635
1668
|
var RepeaterPopover = ({ children, width, ...props }) => {
|
|
1636
|
-
return /* @__PURE__ */
|
|
1669
|
+
return /* @__PURE__ */ React35.createElement(
|
|
1637
1670
|
Popover2,
|
|
1638
1671
|
{
|
|
1639
1672
|
disablePortal: true,
|
|
@@ -1660,60 +1693,34 @@ var EditItemPopover = ({ children }) => {
|
|
|
1660
1693
|
popoverState.setAnchorEl(null);
|
|
1661
1694
|
setOpenItemIndex(EMPTY_OPEN_ITEM);
|
|
1662
1695
|
};
|
|
1663
|
-
return /* @__PURE__ */
|
|
1696
|
+
return /* @__PURE__ */ React36.createElement(RepeaterPopover, { width: rowRef.offsetWidth, ...bindPopover2(popoverState), onClose }, /* @__PURE__ */ React36.createElement(PropKeyProvider, { bind: String(openItemIndex) }, /* @__PURE__ */ React36.createElement(Box3, null, children)));
|
|
1664
1697
|
};
|
|
1665
1698
|
|
|
1666
1699
|
// src/components/popover-content.tsx
|
|
1667
|
-
import * as
|
|
1668
|
-
import { Stack as
|
|
1669
|
-
var PopoverContent = ({ gap = 1.5, children, ...props }) => /* @__PURE__ */
|
|
1700
|
+
import * as React37 from "react";
|
|
1701
|
+
import { Stack as Stack5 } from "@elementor/ui";
|
|
1702
|
+
var PopoverContent = ({ gap = 1.5, children, ...props }) => /* @__PURE__ */ React37.createElement(Stack5, { ...props, gap }, children);
|
|
1670
1703
|
|
|
1671
1704
|
// src/components/popover-grid-container.tsx
|
|
1672
1705
|
import { forwardRef as forwardRef5 } from "react";
|
|
1673
|
-
import * as
|
|
1706
|
+
import * as React38 from "react";
|
|
1674
1707
|
import { Grid as Grid3 } from "@elementor/ui";
|
|
1675
1708
|
var PopoverGridContainer = forwardRef5(
|
|
1676
|
-
({ gap = 1.5, alignItems = "center", flexWrap = "nowrap", children }, ref) => /* @__PURE__ */
|
|
1709
|
+
({ gap = 1.5, alignItems = "center", flexWrap = "nowrap", children }, ref) => /* @__PURE__ */ React38.createElement(Grid3, { container: true, gap, alignItems, flexWrap, ref }, children)
|
|
1677
1710
|
);
|
|
1678
1711
|
|
|
1679
1712
|
// src/components/repeater/repeater-header.tsx
|
|
1680
|
-
import * as
|
|
1713
|
+
import * as React39 from "react";
|
|
1681
1714
|
import { forwardRef as forwardRef6 } from "react";
|
|
1682
|
-
import { Box as Box4, Stack as
|
|
1683
|
-
|
|
1684
|
-
// src/control-adornments/control-adornments.tsx
|
|
1685
|
-
import * as React37 from "react";
|
|
1686
|
-
|
|
1687
|
-
// src/control-adornments/control-adornments-context.tsx
|
|
1688
|
-
import * as React36 from "react";
|
|
1689
|
-
import { createContext as createContext9, useContext as useContext9 } from "react";
|
|
1690
|
-
var Context2 = createContext9(null);
|
|
1691
|
-
var ControlAdornmentsProvider = ({ children, items: items2 }) => /* @__PURE__ */ React36.createElement(Context2.Provider, { value: { items: items2 } }, children);
|
|
1692
|
-
var useControlAdornments = () => {
|
|
1693
|
-
const context = useContext9(Context2);
|
|
1694
|
-
return context?.items ?? [];
|
|
1695
|
-
};
|
|
1696
|
-
|
|
1697
|
-
// src/control-adornments/control-adornments.tsx
|
|
1698
|
-
function ControlAdornments({
|
|
1699
|
-
customContext
|
|
1700
|
-
}) {
|
|
1701
|
-
const items2 = useControlAdornments();
|
|
1702
|
-
if (items2?.length === 0) {
|
|
1703
|
-
return null;
|
|
1704
|
-
}
|
|
1705
|
-
return /* @__PURE__ */ React37.createElement(React37.Fragment, null, items2.map(({ Adornment, id }) => /* @__PURE__ */ React37.createElement(Adornment, { key: id, customContext })));
|
|
1706
|
-
}
|
|
1707
|
-
|
|
1708
|
-
// src/components/repeater/repeater-header.tsx
|
|
1715
|
+
import { Box as Box4, Stack as Stack6, Typography as Typography2 } from "@elementor/ui";
|
|
1709
1716
|
var RepeaterHeader = forwardRef6(
|
|
1710
1717
|
({
|
|
1711
1718
|
label,
|
|
1712
1719
|
children,
|
|
1713
1720
|
adornment: Adornment = ControlAdornments
|
|
1714
1721
|
}, ref) => {
|
|
1715
|
-
return /* @__PURE__ */
|
|
1716
|
-
|
|
1722
|
+
return /* @__PURE__ */ React39.createElement(
|
|
1723
|
+
Stack6,
|
|
1717
1724
|
{
|
|
1718
1725
|
direction: "row",
|
|
1719
1726
|
alignItems: "center",
|
|
@@ -1721,7 +1728,7 @@ var RepeaterHeader = forwardRef6(
|
|
|
1721
1728
|
sx: { marginInlineEnd: -0.75, py: 0.25 },
|
|
1722
1729
|
ref
|
|
1723
1730
|
},
|
|
1724
|
-
/* @__PURE__ */
|
|
1731
|
+
/* @__PURE__ */ React39.createElement(Box4, { display: "flex", alignItems: "center", gap: 1, sx: { flexGrow: 1 } }, /* @__PURE__ */ React39.createElement(Typography2, { component: "label", variant: "caption", color: "text.secondary", sx: { lineHeight: 1 } }, label), /* @__PURE__ */ React39.createElement(Adornment, null)),
|
|
1725
1732
|
children
|
|
1726
1733
|
);
|
|
1727
1734
|
}
|
|
@@ -1730,26 +1737,26 @@ var RepeaterHeader = forwardRef6(
|
|
|
1730
1737
|
// src/controls/box-shadow-repeater-control.tsx
|
|
1731
1738
|
var BoxShadowRepeaterControl = createControl(() => {
|
|
1732
1739
|
const { propType, value, setValue, disabled } = useBoundProp(boxShadowPropTypeUtil);
|
|
1733
|
-
return /* @__PURE__ */
|
|
1740
|
+
return /* @__PURE__ */ React40.createElement(PropProvider, { propType, value, setValue, isDisabled: () => disabled }, /* @__PURE__ */ React40.createElement(ControlRepeater, { initial: initialShadow, propTypeUtil: boxShadowPropTypeUtil }, /* @__PURE__ */ React40.createElement(RepeaterHeader, { label: __11("Box shadow", "elementor") }, /* @__PURE__ */ React40.createElement(TooltipAddItemAction, { newItemIndex: 0, disabled, ariaLabel: "Box shadow" })), /* @__PURE__ */ React40.createElement(ItemsContainer, null, /* @__PURE__ */ React40.createElement(
|
|
1734
1741
|
Item,
|
|
1735
1742
|
{
|
|
1736
1743
|
Icon: ItemIcon,
|
|
1737
1744
|
Label: ItemLabel,
|
|
1738
|
-
actions: /* @__PURE__ */
|
|
1745
|
+
actions: /* @__PURE__ */ React40.createElement(React40.Fragment, null, /* @__PURE__ */ React40.createElement(DuplicateItemAction, null), /* @__PURE__ */ React40.createElement(DisableItemAction, null), /* @__PURE__ */ React40.createElement(RemoveItemAction, null))
|
|
1739
1746
|
}
|
|
1740
|
-
)), /* @__PURE__ */
|
|
1747
|
+
)), /* @__PURE__ */ React40.createElement(EditItemPopover, null, /* @__PURE__ */ React40.createElement(Content, null))));
|
|
1741
1748
|
});
|
|
1742
1749
|
var StyledUnstableColorIndicator = styled4(UnstableColorIndicator)(({ theme }) => ({
|
|
1743
1750
|
height: "1rem",
|
|
1744
1751
|
width: "1rem",
|
|
1745
1752
|
borderRadius: `${theme.shape.borderRadius / 2}px`
|
|
1746
1753
|
}));
|
|
1747
|
-
var ItemIcon = ({ value }) => /* @__PURE__ */
|
|
1754
|
+
var ItemIcon = ({ value }) => /* @__PURE__ */ React40.createElement(StyledUnstableColorIndicator, { size: "inherit", component: "span", value: value.value.color?.value });
|
|
1748
1755
|
var Content = () => {
|
|
1749
1756
|
const context = useBoundProp(shadowPropTypeUtil);
|
|
1750
1757
|
const rowRef = [useRef4(null), useRef4(null)];
|
|
1751
1758
|
const { rowRef: anchorEl } = useRepeaterContext();
|
|
1752
|
-
return /* @__PURE__ */
|
|
1759
|
+
return /* @__PURE__ */ React40.createElement(PropProvider, { ...context }, /* @__PURE__ */ React40.createElement(PopoverContent, { p: 1.5 }, /* @__PURE__ */ React40.createElement(PopoverGridContainer, null, /* @__PURE__ */ React40.createElement(Control2, { bind: "color", label: __11("Color", "elementor") }, /* @__PURE__ */ React40.createElement(ColorControl, { anchorEl })), /* @__PURE__ */ React40.createElement(Control2, { bind: "position", label: __11("Position", "elementor"), sx: { overflow: "hidden" } }, /* @__PURE__ */ React40.createElement(
|
|
1753
1760
|
SelectControl,
|
|
1754
1761
|
{
|
|
1755
1762
|
options: [
|
|
@@ -1757,14 +1764,14 @@ var Content = () => {
|
|
|
1757
1764
|
{ label: __11("Outset", "elementor"), value: null }
|
|
1758
1765
|
]
|
|
1759
1766
|
}
|
|
1760
|
-
))), /* @__PURE__ */
|
|
1767
|
+
))), /* @__PURE__ */ React40.createElement(PopoverGridContainer, { ref: rowRef[0] }, /* @__PURE__ */ React40.createElement(Control2, { bind: "hOffset", label: __11("Horizontal", "elementor") }, /* @__PURE__ */ React40.createElement(SizeControl, { anchorRef: rowRef[0] })), /* @__PURE__ */ React40.createElement(Control2, { bind: "vOffset", label: __11("Vertical", "elementor") }, /* @__PURE__ */ React40.createElement(SizeControl, { anchorRef: rowRef[0] }))), /* @__PURE__ */ React40.createElement(PopoverGridContainer, { ref: rowRef[1] }, /* @__PURE__ */ React40.createElement(Control2, { bind: "blur", label: __11("Blur", "elementor") }, /* @__PURE__ */ React40.createElement(SizeControl, { anchorRef: rowRef[1] })), /* @__PURE__ */ React40.createElement(Control2, { bind: "spread", label: __11("Spread", "elementor") }, /* @__PURE__ */ React40.createElement(SizeControl, { anchorRef: rowRef[1] })))));
|
|
1761
1768
|
};
|
|
1762
1769
|
var Control2 = ({
|
|
1763
1770
|
label,
|
|
1764
1771
|
bind,
|
|
1765
1772
|
children,
|
|
1766
1773
|
sx
|
|
1767
|
-
}) => /* @__PURE__ */
|
|
1774
|
+
}) => /* @__PURE__ */ React40.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React40.createElement(Grid4, { item: true, xs: 6, sx }, /* @__PURE__ */ React40.createElement(Grid4, { container: true, gap: 0.75, alignItems: "center" }, /* @__PURE__ */ React40.createElement(Grid4, { item: true, xs: 12 }, /* @__PURE__ */ React40.createElement(FormLabel2, { size: "tiny" }, label)), /* @__PURE__ */ React40.createElement(Grid4, { item: true, xs: 12 }, children))));
|
|
1768
1775
|
var ItemLabel = ({ value }) => {
|
|
1769
1776
|
const { position, hOffset, vOffset, blur, spread } = value.value;
|
|
1770
1777
|
const { size: blurSize = "", unit: blurUnit = "" } = blur?.value || {};
|
|
@@ -1783,7 +1790,7 @@ var ItemLabel = ({ value }) => {
|
|
|
1783
1790
|
}
|
|
1784
1791
|
return !size ? CUSTOM_SIZE_LABEL : size;
|
|
1785
1792
|
}).join(" ");
|
|
1786
|
-
return /* @__PURE__ */
|
|
1793
|
+
return /* @__PURE__ */ React40.createElement("span", { style: { textTransform: "capitalize" } }, positionLabel, ": ", sizes);
|
|
1787
1794
|
};
|
|
1788
1795
|
var initialShadow = {
|
|
1789
1796
|
$$type: "shadow",
|
|
@@ -1813,7 +1820,7 @@ var initialShadow = {
|
|
|
1813
1820
|
};
|
|
1814
1821
|
|
|
1815
1822
|
// src/controls/filter-control/filter-repeater-control.tsx
|
|
1816
|
-
import * as
|
|
1823
|
+
import * as React49 from "react";
|
|
1817
1824
|
import {
|
|
1818
1825
|
backdropFilterPropTypeUtil,
|
|
1819
1826
|
filterPropTypeUtil
|
|
@@ -1821,7 +1828,7 @@ import {
|
|
|
1821
1828
|
import { __ as __16 } from "@wordpress/i18n";
|
|
1822
1829
|
|
|
1823
1830
|
// src/controls/filter-control/context/filter-config-context.tsx
|
|
1824
|
-
import * as
|
|
1831
|
+
import * as React41 from "react";
|
|
1825
1832
|
import { createContext as createContext10, useContext as useContext10, useMemo as useMemo4 } from "react";
|
|
1826
1833
|
import { cssFilterFunctionPropUtil } from "@elementor/editor-props";
|
|
1827
1834
|
|
|
@@ -1937,7 +1944,7 @@ function FilterConfigProvider({ children }) {
|
|
|
1937
1944
|
getInitialValue: () => config.blur.defaultValue
|
|
1938
1945
|
};
|
|
1939
1946
|
}, [propContext.propType]);
|
|
1940
|
-
return /* @__PURE__ */
|
|
1947
|
+
return /* @__PURE__ */ React41.createElement(FilterConfigContext.Provider, { value: contextValue }, children);
|
|
1941
1948
|
}
|
|
1942
1949
|
function useFilterConfig() {
|
|
1943
1950
|
const context = useContext10(FilterConfigContext);
|
|
@@ -1948,7 +1955,7 @@ function useFilterConfig() {
|
|
|
1948
1955
|
}
|
|
1949
1956
|
|
|
1950
1957
|
// src/controls/filter-control/filter-content.tsx
|
|
1951
|
-
import * as
|
|
1958
|
+
import * as React44 from "react";
|
|
1952
1959
|
import {
|
|
1953
1960
|
cssFilterFunctionPropUtil as cssFilterFunctionPropUtil2
|
|
1954
1961
|
} from "@elementor/editor-props";
|
|
@@ -1956,7 +1963,7 @@ import { Grid as Grid7 } from "@elementor/ui";
|
|
|
1956
1963
|
import { __ as __15 } from "@wordpress/i18n";
|
|
1957
1964
|
|
|
1958
1965
|
// src/controls/filter-control/drop-shadow/drop-shadow-item-content.tsx
|
|
1959
|
-
import * as
|
|
1966
|
+
import * as React42 from "react";
|
|
1960
1967
|
import { useRef as useRef5 } from "react";
|
|
1961
1968
|
import { dropShadowFilterPropTypeUtil } from "@elementor/editor-props";
|
|
1962
1969
|
import { Grid as Grid5 } from "@elementor/ui";
|
|
@@ -1986,7 +1993,7 @@ var items = [
|
|
|
1986
1993
|
var DropShadowItemContent = ({ anchorEl }) => {
|
|
1987
1994
|
const context = useBoundProp(dropShadowFilterPropTypeUtil);
|
|
1988
1995
|
const rowRefs = [useRef5(null), useRef5(null)];
|
|
1989
|
-
return /* @__PURE__ */
|
|
1996
|
+
return /* @__PURE__ */ React42.createElement(PropProvider, { ...context }, items.map((item) => /* @__PURE__ */ React42.createElement(PopoverGridContainer, { key: item.bind, ref: rowRefs[item.rowIndex] ?? null }, /* @__PURE__ */ React42.createElement(PropKeyProvider, { bind: item.bind }, /* @__PURE__ */ React42.createElement(Grid5, { item: true, xs: 6 }, /* @__PURE__ */ React42.createElement(ControlFormLabel, null, item.label)), /* @__PURE__ */ React42.createElement(Grid5, { item: true, xs: 6 }, item.bind === "color" ? /* @__PURE__ */ React42.createElement(ColorControl, { anchorEl }) : /* @__PURE__ */ React42.createElement(
|
|
1990
1997
|
SizeControl,
|
|
1991
1998
|
{
|
|
1992
1999
|
anchorRef: rowRefs[item.rowIndex],
|
|
@@ -1998,7 +2005,7 @@ var DropShadowItemContent = ({ anchorEl }) => {
|
|
|
1998
2005
|
|
|
1999
2006
|
// src/controls/filter-control/single-size/single-size-item-content.tsx
|
|
2000
2007
|
import { useRef as useRef6 } from "react";
|
|
2001
|
-
import * as
|
|
2008
|
+
import * as React43 from "react";
|
|
2002
2009
|
import {
|
|
2003
2010
|
blurFilterPropTypeUtil,
|
|
2004
2011
|
colorToneFilterPropTypeUtil,
|
|
@@ -2017,7 +2024,7 @@ var SingleSizeItemContent = ({ filterFunc }) => {
|
|
|
2017
2024
|
const { getFilterFunctionConfig } = useFilterConfig();
|
|
2018
2025
|
const { valueName, filterFunctionGroup } = getFilterFunctionConfig(filterFunc);
|
|
2019
2026
|
const context = useBoundProp(propTypeMap[filterFunctionGroup]);
|
|
2020
|
-
return /* @__PURE__ */
|
|
2027
|
+
return /* @__PURE__ */ React43.createElement(PropProvider, { ...context }, /* @__PURE__ */ React43.createElement(PropKeyProvider, { bind: filterFunctionGroup }, /* @__PURE__ */ React43.createElement(PropKeyProvider, { bind: "size" }, /* @__PURE__ */ React43.createElement(PopoverGridContainer, { ref: rowRef }, /* @__PURE__ */ React43.createElement(Grid6, { item: true, xs: 6 }, /* @__PURE__ */ React43.createElement(ControlFormLabel, null, valueName)), /* @__PURE__ */ React43.createElement(Grid6, { item: true, xs: 6 }, /* @__PURE__ */ React43.createElement(SizeControl, { anchorRef: rowRef, enablePropTypeUnits: true }))))));
|
|
2021
2028
|
};
|
|
2022
2029
|
|
|
2023
2030
|
// src/controls/filter-control/filter-content.tsx
|
|
@@ -2035,7 +2042,7 @@ var FilterContent = () => {
|
|
|
2035
2042
|
}
|
|
2036
2043
|
propContext.setValue(newValue);
|
|
2037
2044
|
};
|
|
2038
|
-
return /* @__PURE__ */
|
|
2045
|
+
return /* @__PURE__ */ React44.createElement(PropProvider, { ...propContext, setValue: handleValueChange }, /* @__PURE__ */ React44.createElement(PropKeyProvider, { bind: "css-filter-func" }, /* @__PURE__ */ React44.createElement(PopoverContent, { p: 1.5 }, /* @__PURE__ */ React44.createElement(PopoverGridContainer, null, /* @__PURE__ */ React44.createElement(Grid7, { item: true, xs: 6 }, /* @__PURE__ */ React44.createElement(ControlFormLabel, null, __15("Filter", "elementor"))), /* @__PURE__ */ React44.createElement(Grid7, { item: true, xs: 6 }, /* @__PURE__ */ React44.createElement(PropKeyProvider, { bind: "func" }, /* @__PURE__ */ React44.createElement(SelectControl, { options: filterOptions })))), /* @__PURE__ */ React44.createElement(PropKeyProvider, { bind: "args" }, /* @__PURE__ */ React44.createElement(FilterValueContent, null)))));
|
|
2039
2046
|
};
|
|
2040
2047
|
var FilterValueContent = () => {
|
|
2041
2048
|
const { openItemIndex, items: items2 } = useRepeaterContext();
|
|
@@ -2043,19 +2050,19 @@ var FilterValueContent = () => {
|
|
|
2043
2050
|
const filterFunc = currentItem.item.value.func.value;
|
|
2044
2051
|
const isDropShadow = filterFunc === "drop-shadow";
|
|
2045
2052
|
if (isDropShadow) {
|
|
2046
|
-
return /* @__PURE__ */
|
|
2053
|
+
return /* @__PURE__ */ React44.createElement(DropShadowItemContent, null);
|
|
2047
2054
|
}
|
|
2048
|
-
return /* @__PURE__ */
|
|
2055
|
+
return /* @__PURE__ */ React44.createElement(SingleSizeItemContent, { filterFunc });
|
|
2049
2056
|
};
|
|
2050
2057
|
|
|
2051
2058
|
// src/controls/filter-control/filter-icon.tsx
|
|
2052
|
-
import * as
|
|
2059
|
+
import * as React45 from "react";
|
|
2053
2060
|
import { styled as styled5, UnstableColorIndicator as UnstableColorIndicator2 } from "@elementor/ui";
|
|
2054
2061
|
var FilterIcon = ({ value }) => {
|
|
2055
2062
|
if (value.value.func.value !== "drop-shadow") {
|
|
2056
2063
|
return null;
|
|
2057
2064
|
}
|
|
2058
|
-
return /* @__PURE__ */
|
|
2065
|
+
return /* @__PURE__ */ React45.createElement(
|
|
2059
2066
|
StyledUnstableColorIndicator2,
|
|
2060
2067
|
{
|
|
2061
2068
|
size: "inherit",
|
|
@@ -2069,10 +2076,10 @@ var StyledUnstableColorIndicator2 = styled5(UnstableColorIndicator2)(({ theme })
|
|
|
2069
2076
|
}));
|
|
2070
2077
|
|
|
2071
2078
|
// src/controls/filter-control/filter-label.tsx
|
|
2072
|
-
import * as
|
|
2079
|
+
import * as React48 from "react";
|
|
2073
2080
|
|
|
2074
2081
|
// src/controls/filter-control/drop-shadow/drop-shadow-item-label.tsx
|
|
2075
|
-
import * as
|
|
2082
|
+
import * as React46 from "react";
|
|
2076
2083
|
import { Box as Box5 } from "@elementor/ui";
|
|
2077
2084
|
var DropShadowItemLabel = ({ value }) => {
|
|
2078
2085
|
const values = value.value.args.value;
|
|
@@ -2080,11 +2087,11 @@ var DropShadowItemLabel = ({ value }) => {
|
|
|
2080
2087
|
const labels = keys.map(
|
|
2081
2088
|
(key) => values[key]?.value?.unit !== "custom" ? `${values[key]?.value?.size ?? 0}${values[key]?.value?.unit ?? "px"}` : values[key]?.value?.size || CUSTOM_SIZE_LABEL
|
|
2082
2089
|
);
|
|
2083
|
-
return /* @__PURE__ */
|
|
2090
|
+
return /* @__PURE__ */ React46.createElement(Box5, { component: "span" }, /* @__PURE__ */ React46.createElement(Box5, { component: "span", style: { textTransform: "capitalize" } }, "Drop shadow:"), ` ${labels.join(" ")}`);
|
|
2084
2091
|
};
|
|
2085
2092
|
|
|
2086
2093
|
// src/controls/filter-control/single-size/single-size-item-label.tsx
|
|
2087
|
-
import * as
|
|
2094
|
+
import * as React47 from "react";
|
|
2088
2095
|
import { Box as Box6 } from "@elementor/ui";
|
|
2089
2096
|
var SingleSizeItemLabel = ({ value }) => {
|
|
2090
2097
|
const { func, args } = value.value;
|
|
@@ -2092,16 +2099,16 @@ var SingleSizeItemLabel = ({ value }) => {
|
|
|
2092
2099
|
const { defaultValue } = getFilterFunctionConfig(func.value ?? "");
|
|
2093
2100
|
const defaultUnit = defaultValue.value.args.value?.size?.value?.unit ?? lengthUnits[0];
|
|
2094
2101
|
const { unit, size } = args.value.size?.value ?? { unit: defaultUnit, size: 0 };
|
|
2095
|
-
const label = /* @__PURE__ */
|
|
2096
|
-
return /* @__PURE__ */
|
|
2102
|
+
const label = /* @__PURE__ */ React47.createElement(Box6, { component: "span", style: { textTransform: "capitalize" } }, func.value ?? "", ":");
|
|
2103
|
+
return /* @__PURE__ */ React47.createElement(Box6, { component: "span" }, label, " " + (unit !== "custom" ? `${size ?? 0}${unit ?? defaultUnit}` : size || CUSTOM_SIZE_LABEL));
|
|
2097
2104
|
};
|
|
2098
2105
|
|
|
2099
2106
|
// src/controls/filter-control/filter-label.tsx
|
|
2100
2107
|
var FilterLabel = ({ value }) => {
|
|
2101
2108
|
if (value.value.func.value === "drop-shadow") {
|
|
2102
|
-
return /* @__PURE__ */
|
|
2109
|
+
return /* @__PURE__ */ React48.createElement(DropShadowItemLabel, { value });
|
|
2103
2110
|
}
|
|
2104
|
-
return /* @__PURE__ */
|
|
2111
|
+
return /* @__PURE__ */ React48.createElement(SingleSizeItemLabel, { value });
|
|
2105
2112
|
};
|
|
2106
2113
|
|
|
2107
2114
|
// src/controls/filter-control/filter-repeater-control.tsx
|
|
@@ -2118,7 +2125,7 @@ var FILTER_CONFIG = {
|
|
|
2118
2125
|
var FilterRepeaterControl = createControl(({ filterPropName = "filter" }) => {
|
|
2119
2126
|
const { propTypeUtil, label } = ensureFilterConfig(filterPropName);
|
|
2120
2127
|
const { propType, value: filterValues, setValue } = useBoundProp(propTypeUtil);
|
|
2121
|
-
return /* @__PURE__ */
|
|
2128
|
+
return /* @__PURE__ */ React49.createElement(FilterConfigProvider, null, /* @__PURE__ */ React49.createElement(PropProvider, { propType, value: filterValues, setValue }, /* @__PURE__ */ React49.createElement(
|
|
2122
2129
|
Repeater,
|
|
2123
2130
|
{
|
|
2124
2131
|
propTypeUtil,
|
|
@@ -2129,20 +2136,20 @@ var FilterRepeaterControl = createControl(({ filterPropName = "filter" }) => {
|
|
|
2129
2136
|
});
|
|
2130
2137
|
var Repeater = ({ propTypeUtil, label, filterPropName }) => {
|
|
2131
2138
|
const { getInitialValue: getInitialValue2 } = useFilterConfig();
|
|
2132
|
-
return /* @__PURE__ */
|
|
2139
|
+
return /* @__PURE__ */ React49.createElement(ControlRepeater, { initial: getInitialValue2(), propTypeUtil }, /* @__PURE__ */ React49.createElement(RepeaterHeader, { label }, /* @__PURE__ */ React49.createElement(
|
|
2133
2140
|
TooltipAddItemAction,
|
|
2134
2141
|
{
|
|
2135
2142
|
newItemIndex: 0,
|
|
2136
2143
|
ariaLabel: filterPropName === "backdrop-filter" ? "backdrop filter" : "filter"
|
|
2137
2144
|
}
|
|
2138
|
-
)), /* @__PURE__ */
|
|
2145
|
+
)), /* @__PURE__ */ React49.createElement(ItemsContainer, null, /* @__PURE__ */ React49.createElement(
|
|
2139
2146
|
Item,
|
|
2140
2147
|
{
|
|
2141
2148
|
Label: FilterLabel,
|
|
2142
2149
|
Icon: FilterIcon,
|
|
2143
|
-
actions: /* @__PURE__ */
|
|
2150
|
+
actions: /* @__PURE__ */ React49.createElement(React49.Fragment, null, /* @__PURE__ */ React49.createElement(DuplicateItemAction, null), /* @__PURE__ */ React49.createElement(DisableItemAction, null), /* @__PURE__ */ React49.createElement(RemoveItemAction, null))
|
|
2144
2151
|
}
|
|
2145
|
-
)), /* @__PURE__ */
|
|
2152
|
+
)), /* @__PURE__ */ React49.createElement(EditItemPopover, null, /* @__PURE__ */ React49.createElement(FilterContent, null)));
|
|
2146
2153
|
};
|
|
2147
2154
|
function ensureFilterConfig(name) {
|
|
2148
2155
|
if (name && name in FILTER_CONFIG) {
|
|
@@ -2152,7 +2159,7 @@ function ensureFilterConfig(name) {
|
|
|
2152
2159
|
}
|
|
2153
2160
|
|
|
2154
2161
|
// src/controls/select-control-wrapper.tsx
|
|
2155
|
-
import * as
|
|
2162
|
+
import * as React50 from "react";
|
|
2156
2163
|
import { useEffect as useEffect4, useState as useState6 } from "react";
|
|
2157
2164
|
var getOffCanvasElements = () => {
|
|
2158
2165
|
const extendedWindow = window;
|
|
@@ -2184,16 +2191,16 @@ var useDynamicOptions = (collectionId, initialOptions) => {
|
|
|
2184
2191
|
var SelectControlWrapper = createControl(
|
|
2185
2192
|
({ collectionId, options, ...props }) => {
|
|
2186
2193
|
const actualOptions = useDynamicOptions(collectionId, options);
|
|
2187
|
-
return /* @__PURE__ */
|
|
2194
|
+
return /* @__PURE__ */ React50.createElement(SelectControl, { options: actualOptions, ...props });
|
|
2188
2195
|
}
|
|
2189
2196
|
);
|
|
2190
2197
|
|
|
2191
2198
|
// src/controls/toggle-control.tsx
|
|
2192
|
-
import * as
|
|
2199
|
+
import * as React54 from "react";
|
|
2193
2200
|
import { stringPropTypeUtil as stringPropTypeUtil4 } from "@elementor/editor-props";
|
|
2194
2201
|
|
|
2195
2202
|
// src/components/control-toggle-button-group.tsx
|
|
2196
|
-
import * as
|
|
2203
|
+
import * as React52 from "react";
|
|
2197
2204
|
import { useEffect as useEffect5, useMemo as useMemo5, useRef as useRef7, useState as useState7 } from "react";
|
|
2198
2205
|
import { ChevronDownIcon } from "@elementor/icons";
|
|
2199
2206
|
import {
|
|
@@ -2208,14 +2215,14 @@ import {
|
|
|
2208
2215
|
} from "@elementor/ui";
|
|
2209
2216
|
|
|
2210
2217
|
// src/components/conditional-tooltip.tsx
|
|
2211
|
-
import * as
|
|
2218
|
+
import * as React51 from "react";
|
|
2212
2219
|
import { Tooltip as Tooltip4 } from "@elementor/ui";
|
|
2213
2220
|
var ConditionalTooltip = ({
|
|
2214
2221
|
showTooltip,
|
|
2215
2222
|
children,
|
|
2216
2223
|
label
|
|
2217
2224
|
}) => {
|
|
2218
|
-
return showTooltip && label ? /* @__PURE__ */
|
|
2225
|
+
return showTooltip && label ? /* @__PURE__ */ React51.createElement(Tooltip4, { title: label, disableFocusListener: true, placement: "top" }, children) : children;
|
|
2219
2226
|
};
|
|
2220
2227
|
|
|
2221
2228
|
// src/components/control-toggle-button-group.tsx
|
|
@@ -2246,7 +2253,7 @@ var StyledToggleButton = styled6(ToggleButton, {
|
|
|
2246
2253
|
}
|
|
2247
2254
|
`}
|
|
2248
2255
|
`;
|
|
2249
|
-
var ToggleButtonGroupUi =
|
|
2256
|
+
var ToggleButtonGroupUi = React52.forwardRef(
|
|
2250
2257
|
({
|
|
2251
2258
|
justify = "end",
|
|
2252
2259
|
size = "tiny",
|
|
@@ -2291,7 +2298,7 @@ var ToggleButtonGroupUi = React51.forwardRef(
|
|
|
2291
2298
|
return [];
|
|
2292
2299
|
};
|
|
2293
2300
|
const placeholderArray = getPlaceholderArray(placeholder);
|
|
2294
|
-
return /* @__PURE__ */
|
|
2301
|
+
return /* @__PURE__ */ React52.createElement(
|
|
2295
2302
|
StyledToggleButtonGroup,
|
|
2296
2303
|
{
|
|
2297
2304
|
ref,
|
|
@@ -2309,14 +2316,14 @@ var ToggleButtonGroupUi = React51.forwardRef(
|
|
|
2309
2316
|
},
|
|
2310
2317
|
fixedItems.map(({ label, value: buttonValue, renderContent: Content3, showTooltip }) => {
|
|
2311
2318
|
const isPlaceholder = placeholderArray.length > 0 && placeholderArray.includes(buttonValue) && (shouldShowExclusivePlaceholder || shouldShowNonExclusivePlaceholder);
|
|
2312
|
-
return /* @__PURE__ */
|
|
2319
|
+
return /* @__PURE__ */ React52.createElement(
|
|
2313
2320
|
ConditionalTooltip,
|
|
2314
2321
|
{
|
|
2315
2322
|
key: buttonValue,
|
|
2316
2323
|
label,
|
|
2317
2324
|
showTooltip: showTooltip || false
|
|
2318
2325
|
},
|
|
2319
|
-
/* @__PURE__ */
|
|
2326
|
+
/* @__PURE__ */ React52.createElement(
|
|
2320
2327
|
StyledToggleButton,
|
|
2321
2328
|
{
|
|
2322
2329
|
value: buttonValue,
|
|
@@ -2325,11 +2332,11 @@ var ToggleButtonGroupUi = React51.forwardRef(
|
|
|
2325
2332
|
fullWidth,
|
|
2326
2333
|
isPlaceholder
|
|
2327
2334
|
},
|
|
2328
|
-
/* @__PURE__ */
|
|
2335
|
+
/* @__PURE__ */ React52.createElement(Content3, { size })
|
|
2329
2336
|
)
|
|
2330
2337
|
);
|
|
2331
2338
|
}),
|
|
2332
|
-
menuItems.length && exclusive && /* @__PURE__ */
|
|
2339
|
+
menuItems.length && exclusive && /* @__PURE__ */ React52.createElement(
|
|
2333
2340
|
SplitButtonGroup,
|
|
2334
2341
|
{
|
|
2335
2342
|
size,
|
|
@@ -2343,7 +2350,7 @@ var ToggleButtonGroupUi = React51.forwardRef(
|
|
|
2343
2350
|
}
|
|
2344
2351
|
);
|
|
2345
2352
|
var ControlToggleButtonGroup = (props) => {
|
|
2346
|
-
return /* @__PURE__ */
|
|
2353
|
+
return /* @__PURE__ */ React52.createElement(ControlActions, null, /* @__PURE__ */ React52.createElement(ToggleButtonGroupUi, { ...props }));
|
|
2347
2354
|
};
|
|
2348
2355
|
var SplitButtonGroup = ({
|
|
2349
2356
|
size = "tiny",
|
|
@@ -2367,7 +2374,7 @@ var SplitButtonGroup = ({
|
|
|
2367
2374
|
const shouldRemove = newValue === value;
|
|
2368
2375
|
onChange(shouldRemove ? null : newValue);
|
|
2369
2376
|
};
|
|
2370
|
-
return /* @__PURE__ */
|
|
2377
|
+
return /* @__PURE__ */ React52.createElement(React52.Fragment, null, /* @__PURE__ */ React52.createElement(
|
|
2371
2378
|
ToggleButton,
|
|
2372
2379
|
{
|
|
2373
2380
|
value: previewButton.value,
|
|
@@ -2380,7 +2387,7 @@ var SplitButtonGroup = ({
|
|
|
2380
2387
|
}
|
|
2381
2388
|
},
|
|
2382
2389
|
previewButton.renderContent({ size })
|
|
2383
|
-
), /* @__PURE__ */
|
|
2390
|
+
), /* @__PURE__ */ React52.createElement(
|
|
2384
2391
|
ToggleButton,
|
|
2385
2392
|
{
|
|
2386
2393
|
size,
|
|
@@ -2391,8 +2398,8 @@ var SplitButtonGroup = ({
|
|
|
2391
2398
|
ref: menuButtonRef,
|
|
2392
2399
|
value: "__chevron-icon-button__"
|
|
2393
2400
|
},
|
|
2394
|
-
/* @__PURE__ */
|
|
2395
|
-
), /* @__PURE__ */
|
|
2401
|
+
/* @__PURE__ */ React52.createElement(ChevronDownIcon, { fontSize: size })
|
|
2402
|
+
), /* @__PURE__ */ React52.createElement(
|
|
2396
2403
|
Menu2,
|
|
2397
2404
|
{
|
|
2398
2405
|
open: isMenuOpen,
|
|
@@ -2410,14 +2417,14 @@ var SplitButtonGroup = ({
|
|
|
2410
2417
|
mt: 0.5
|
|
2411
2418
|
}
|
|
2412
2419
|
},
|
|
2413
|
-
items2.map(({ label, value: buttonValue }) => /* @__PURE__ */
|
|
2420
|
+
items2.map(({ label, value: buttonValue }) => /* @__PURE__ */ React52.createElement(
|
|
2414
2421
|
MenuItem,
|
|
2415
2422
|
{
|
|
2416
2423
|
key: buttonValue,
|
|
2417
2424
|
selected: buttonValue === value,
|
|
2418
2425
|
onClick: () => onMenuItemClick(buttonValue)
|
|
2419
2426
|
},
|
|
2420
|
-
/* @__PURE__ */
|
|
2427
|
+
/* @__PURE__ */ React52.createElement(ListItemText, null, /* @__PURE__ */ React52.createElement(Typography3, { sx: { fontSize: "14px" } }, label))
|
|
2421
2428
|
))
|
|
2422
2429
|
));
|
|
2423
2430
|
};
|
|
@@ -2435,7 +2442,7 @@ var usePreviewButton = (items2, value) => {
|
|
|
2435
2442
|
};
|
|
2436
2443
|
|
|
2437
2444
|
// src/utils/convert-toggle-options-to-atomic.tsx
|
|
2438
|
-
import * as
|
|
2445
|
+
import * as React53 from "react";
|
|
2439
2446
|
import * as Icons from "@elementor/icons";
|
|
2440
2447
|
var convertToggleOptionsToAtomic = (options) => {
|
|
2441
2448
|
return options.map((option) => {
|
|
@@ -2446,7 +2453,7 @@ var convertToggleOptionsToAtomic = (options) => {
|
|
|
2446
2453
|
label: option.label,
|
|
2447
2454
|
renderContent: ({ size }) => {
|
|
2448
2455
|
if (IconComponent) {
|
|
2449
|
-
return /* @__PURE__ */
|
|
2456
|
+
return /* @__PURE__ */ React53.createElement(IconComponent, { fontSize: size });
|
|
2450
2457
|
}
|
|
2451
2458
|
return option.label;
|
|
2452
2459
|
},
|
|
@@ -2482,7 +2489,7 @@ var ToggleControl = createControl(
|
|
|
2482
2489
|
size,
|
|
2483
2490
|
placeholder
|
|
2484
2491
|
};
|
|
2485
|
-
return exclusive ? /* @__PURE__ */
|
|
2492
|
+
return exclusive ? /* @__PURE__ */ React54.createElement(
|
|
2486
2493
|
ControlToggleButtonGroup,
|
|
2487
2494
|
{
|
|
2488
2495
|
...toggleButtonGroupProps,
|
|
@@ -2491,7 +2498,7 @@ var ToggleControl = createControl(
|
|
|
2491
2498
|
disabled,
|
|
2492
2499
|
exclusive: true
|
|
2493
2500
|
}
|
|
2494
|
-
) : /* @__PURE__ */
|
|
2501
|
+
) : /* @__PURE__ */ React54.createElement(
|
|
2495
2502
|
ControlToggleButtonGroup,
|
|
2496
2503
|
{
|
|
2497
2504
|
...toggleButtonGroupProps,
|
|
@@ -2505,7 +2512,7 @@ var ToggleControl = createControl(
|
|
|
2505
2512
|
);
|
|
2506
2513
|
|
|
2507
2514
|
// src/controls/number-control.tsx
|
|
2508
|
-
import * as
|
|
2515
|
+
import * as React55 from "react";
|
|
2509
2516
|
import { numberPropTypeUtil } from "@elementor/editor-props";
|
|
2510
2517
|
import { InputAdornment as InputAdornment3 } from "@elementor/ui";
|
|
2511
2518
|
var isEmptyOrNaN = (value) => value === null || value === void 0 || value === "" || Number.isNaN(Number(value));
|
|
@@ -2536,7 +2543,7 @@ var NumberControl = createControl(
|
|
|
2536
2543
|
}
|
|
2537
2544
|
setValue(updatedValue, void 0, { validation: () => isInputValid });
|
|
2538
2545
|
};
|
|
2539
|
-
return /* @__PURE__ */
|
|
2546
|
+
return /* @__PURE__ */ React55.createElement(ControlActions, null, /* @__PURE__ */ React55.createElement(
|
|
2540
2547
|
NumberInput,
|
|
2541
2548
|
{
|
|
2542
2549
|
size: "tiny",
|
|
@@ -2549,7 +2556,7 @@ var NumberControl = createControl(
|
|
|
2549
2556
|
placeholder: labelPlaceholder ?? (isEmptyOrNaN(placeholder) ? "" : String(placeholder)),
|
|
2550
2557
|
inputProps: { step, min },
|
|
2551
2558
|
InputProps: {
|
|
2552
|
-
startAdornment: startIcon ? /* @__PURE__ */
|
|
2559
|
+
startAdornment: startIcon ? /* @__PURE__ */ React55.createElement(InputAdornment3, { position: "start", disabled }, startIcon) : void 0
|
|
2553
2560
|
}
|
|
2554
2561
|
}
|
|
2555
2562
|
));
|
|
@@ -2561,15 +2568,6 @@ import * as React56 from "react";
|
|
|
2561
2568
|
import { useId as useId2, useRef as useRef8 } from "react";
|
|
2562
2569
|
import { bindPopover as bindPopover3, bindToggle, Box as Box7, Grid as Grid8, Popover as Popover3, Stack as Stack7, Tooltip as Tooltip5, usePopupState as usePopupState4 } from "@elementor/ui";
|
|
2563
2570
|
import { __ as __17 } from "@wordpress/i18n";
|
|
2564
|
-
|
|
2565
|
-
// src/components/control-label.tsx
|
|
2566
|
-
import * as React55 from "react";
|
|
2567
|
-
import { Stack as Stack6 } from "@elementor/ui";
|
|
2568
|
-
var ControlLabel = ({ children, ...props }) => {
|
|
2569
|
-
return /* @__PURE__ */ React55.createElement(Stack6, { direction: "row", alignItems: "center", justifyItems: "start", gap: 0.25 }, /* @__PURE__ */ React55.createElement(ControlFormLabel, { ...props }, children), /* @__PURE__ */ React55.createElement(ControlAdornments, null));
|
|
2570
|
-
};
|
|
2571
|
-
|
|
2572
|
-
// src/controls/equal-unequal-sizes-control.tsx
|
|
2573
2571
|
function EqualUnequalSizesControl({
|
|
2574
2572
|
label,
|
|
2575
2573
|
icon,
|