@elementor/editor-controls 1.5.0 → 3.32.0-21
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 +0 -22
- package/dist/index.d.mts +95 -25
- package/dist/index.d.ts +95 -25
- package/dist/index.js +2045 -1041
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1962 -964
- package/dist/index.mjs.map +1 -1
- package/package.json +18 -18
- package/src/components/control-toggle-button-group.tsx +78 -14
- package/src/components/floating-bar.tsx +45 -0
- package/src/components/{font-family-selector.tsx → item-selector.tsx} +62 -50
- package/src/components/repeater.tsx +1 -1
- package/src/components/restricted-link-infotip.tsx +76 -0
- package/src/components/size-control/size-input.tsx +8 -7
- package/src/components/size-control/text-field-inner-selection.tsx +60 -14
- package/src/components/text-field-popover.tsx +30 -7
- package/src/components/unstable-repeater/actions/add-item-action.tsx +50 -0
- package/src/components/unstable-repeater/actions/disable-item-action.tsx +39 -0
- package/src/components/unstable-repeater/actions/duplicate-item-action.tsx +32 -0
- package/src/components/unstable-repeater/actions/remove-item-action.tsx +27 -0
- package/src/components/unstable-repeater/context/repeater-context.tsx +137 -0
- package/src/components/unstable-repeater/header/header.tsx +23 -0
- package/src/components/unstable-repeater/index.ts +5 -0
- package/src/components/unstable-repeater/items/edit-item-popover.tsx +28 -0
- package/src/components/unstable-repeater/items/item.tsx +71 -0
- package/src/components/unstable-repeater/items/items-container.tsx +49 -0
- package/src/components/unstable-repeater/items/use-popover.tsx +26 -0
- package/src/{locations.ts → components/unstable-repeater/locations.ts} +9 -1
- package/src/components/unstable-repeater/types.ts +26 -0
- package/src/components/unstable-repeater/unstable-repeater.tsx +24 -0
- package/src/control-actions/control-actions.tsx +3 -20
- package/src/control-replacements.tsx +41 -0
- package/src/controls/background-control/background-control.tsx +1 -8
- package/src/controls/background-control/background-overlay/background-overlay-repeater-control.tsx +17 -16
- package/src/controls/equal-unequal-sizes-control.tsx +2 -9
- package/src/controls/filter-control/drop-shadow-item-content.tsx +4 -6
- package/src/controls/filter-control/drop-shadow-item-label.tsx +2 -2
- package/src/controls/filter-repeater-control.tsx +149 -110
- package/src/controls/font-family-control/font-family-control.tsx +22 -10
- package/src/controls/key-value-control.tsx +9 -6
- package/src/controls/link-control.tsx +8 -91
- package/src/controls/linked-dimensions-control.tsx +3 -16
- package/src/controls/number-control.tsx +10 -1
- package/src/controls/position-control.tsx +4 -16
- package/src/controls/repeatable-control.tsx +8 -5
- package/src/controls/select-control.tsx +7 -2
- package/src/controls/selection-size-control.tsx +74 -0
- package/src/controls/size-control.tsx +181 -126
- package/src/controls/stroke-control.tsx +2 -2
- package/src/controls/toggle-control.tsx +3 -2
- package/src/controls/transform-control/functions/axis-row.tsx +4 -2
- package/src/controls/transform-control/functions/move.tsx +2 -1
- package/src/controls/transform-control/functions/rotate.tsx +48 -0
- package/src/controls/transform-control/functions/scale-axis-row.tsx +32 -0
- package/src/controls/transform-control/functions/scale.tsx +45 -0
- package/src/controls/transform-control/functions/skew.tsx +43 -0
- package/src/controls/transform-control/transform-content.tsx +60 -23
- package/src/controls/transform-control/transform-icon.tsx +10 -2
- package/src/controls/transform-control/transform-label.tsx +39 -2
- package/src/controls/transform-control/transform-repeater-control.tsx +2 -10
- package/src/controls/transform-control/types.ts +58 -0
- package/src/controls/transform-control/use-transform-tabs-history.tsx +107 -0
- package/src/controls/transition-control/data.ts +34 -0
- package/src/controls/transition-control/transition-repeater-control.tsx +63 -0
- package/src/controls/transition-control/transition-selector.tsx +88 -0
- package/src/controls/unstable-transform-control/unstable-transform-repeater-control.tsx +35 -0
- package/src/hooks/use-filtered-items-list.ts +24 -0
- package/src/hooks/use-size-extended-options.ts +1 -6
- package/src/index.ts +13 -3
- package/src/utils/size-control.ts +12 -6
- package/src/hooks/use-filtered-font-families.ts +0 -24
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// src/controls/image-control.tsx
|
|
2
|
-
import * as
|
|
2
|
+
import * as React11 from "react";
|
|
3
3
|
import { imagePropTypeUtil } from "@elementor/editor-props";
|
|
4
4
|
import { Grid, Stack as Stack2 } from "@elementor/ui";
|
|
5
5
|
import { __ as __2 } from "@wordpress/i18n";
|
|
@@ -224,6 +224,30 @@ var createControlReplacementsRegistry = () => {
|
|
|
224
224
|
}
|
|
225
225
|
return { registerControlReplacement, getControlReplacements };
|
|
226
226
|
};
|
|
227
|
+
var SlotChildren = ({
|
|
228
|
+
children,
|
|
229
|
+
whitelist = [],
|
|
230
|
+
sorted = false,
|
|
231
|
+
props = {}
|
|
232
|
+
}) => {
|
|
233
|
+
const filtered = !whitelist.length ? React4.Children.toArray(children) : React4.Children.toArray(children).filter(
|
|
234
|
+
(child) => React4.isValidElement(child) && whitelist.includes(child.type)
|
|
235
|
+
);
|
|
236
|
+
if (sorted) {
|
|
237
|
+
sort(filtered, whitelist);
|
|
238
|
+
}
|
|
239
|
+
return filtered.map((child, index) => /* @__PURE__ */ React4.createElement(React4.Fragment, { key: index }, React4.cloneElement(child, props)));
|
|
240
|
+
};
|
|
241
|
+
var sort = (childrenArray, whitelist) => {
|
|
242
|
+
childrenArray.sort((a, b) => {
|
|
243
|
+
const aIndex = whitelist.indexOf(a.type);
|
|
244
|
+
const bIndex = whitelist.indexOf(b.type);
|
|
245
|
+
if (aIndex === -1 || bIndex === -1) {
|
|
246
|
+
return 0;
|
|
247
|
+
}
|
|
248
|
+
return aIndex - bIndex;
|
|
249
|
+
});
|
|
250
|
+
};
|
|
227
251
|
|
|
228
252
|
// src/create-control.tsx
|
|
229
253
|
var brandSymbol = Symbol("control");
|
|
@@ -274,7 +298,7 @@ var formatResponse = (response) => {
|
|
|
274
298
|
};
|
|
275
299
|
|
|
276
300
|
// src/controls/image-media-control.tsx
|
|
277
|
-
import * as
|
|
301
|
+
import * as React9 from "react";
|
|
278
302
|
import { imageSrcPropTypeUtil } from "@elementor/editor-props";
|
|
279
303
|
import { UploadIcon } from "@elementor/icons";
|
|
280
304
|
import { Button, Card, CardMedia, CardOverlay, CircularProgress, Stack } from "@elementor/ui";
|
|
@@ -282,23 +306,12 @@ import { useWpMediaAttachment, useWpMediaFrame } from "@elementor/wp-media";
|
|
|
282
306
|
import { __ } from "@wordpress/i18n";
|
|
283
307
|
|
|
284
308
|
// src/control-actions/control-actions.tsx
|
|
285
|
-
import * as
|
|
286
|
-
import { styled, UnstableFloatingActionBar } from "@elementor/ui";
|
|
309
|
+
import * as React8 from "react";
|
|
287
310
|
|
|
288
|
-
// src/
|
|
311
|
+
// src/components/floating-bar.tsx
|
|
289
312
|
import * as React6 from "react";
|
|
290
|
-
import { createContext as createContext4, useContext as useContext4 } from "react";
|
|
291
|
-
|
|
292
|
-
var ControlActionsProvider = ({ children, items: items2 }) => /* @__PURE__ */ React6.createElement(Context.Provider, { value: { items: items2 } }, children);
|
|
293
|
-
var useControlActions = () => {
|
|
294
|
-
const context = useContext4(Context);
|
|
295
|
-
if (!context) {
|
|
296
|
-
throw new Error("useControlActions must be used within a ControlActionsProvider");
|
|
297
|
-
}
|
|
298
|
-
return context;
|
|
299
|
-
};
|
|
300
|
-
|
|
301
|
-
// src/control-actions/control-actions.tsx
|
|
313
|
+
import { createContext as createContext4, useContext as useContext4, useState as useState2 } from "react";
|
|
314
|
+
import { styled, UnstableFloatingActionBar } from "@elementor/ui";
|
|
302
315
|
var FloatingBarContainer = styled("span")`
|
|
303
316
|
display: contents;
|
|
304
317
|
|
|
@@ -310,14 +323,41 @@ var FloatingBarContainer = styled("span")`
|
|
|
310
323
|
z-index: 1000;
|
|
311
324
|
}
|
|
312
325
|
`;
|
|
326
|
+
var FloatingActionsContext = createContext4(null);
|
|
327
|
+
function FloatingActionsBar({ actions, children }) {
|
|
328
|
+
const [open, setOpen] = useState2(false);
|
|
329
|
+
return /* @__PURE__ */ React6.createElement(FloatingActionsContext.Provider, { value: { open, setOpen } }, /* @__PURE__ */ React6.createElement(FloatingBarContainer, null, /* @__PURE__ */ React6.createElement(UnstableFloatingActionBar, { actions, open: open || void 0 }, children)));
|
|
330
|
+
}
|
|
331
|
+
function useFloatingActionsBar() {
|
|
332
|
+
const context = useContext4(FloatingActionsContext);
|
|
333
|
+
if (!context) {
|
|
334
|
+
throw new Error("useFloatingActions must be used within a FloatingActionsBar");
|
|
335
|
+
}
|
|
336
|
+
return context;
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
// src/control-actions/control-actions-context.tsx
|
|
340
|
+
import * as React7 from "react";
|
|
341
|
+
import { createContext as createContext5, useContext as useContext5 } from "react";
|
|
342
|
+
var Context = createContext5(null);
|
|
343
|
+
var ControlActionsProvider = ({ children, items: items2 }) => /* @__PURE__ */ React7.createElement(Context.Provider, { value: { items: items2 } }, children);
|
|
344
|
+
var useControlActions = () => {
|
|
345
|
+
const context = useContext5(Context);
|
|
346
|
+
if (!context) {
|
|
347
|
+
throw new Error("useControlActions must be used within a ControlActionsProvider");
|
|
348
|
+
}
|
|
349
|
+
return context;
|
|
350
|
+
};
|
|
351
|
+
|
|
352
|
+
// src/control-actions/control-actions.tsx
|
|
313
353
|
function ControlActions({ children }) {
|
|
314
354
|
const { items: items2 } = useControlActions();
|
|
315
355
|
const { disabled } = useBoundProp();
|
|
316
356
|
if (items2.length === 0 || disabled) {
|
|
317
357
|
return children;
|
|
318
358
|
}
|
|
319
|
-
const menuItems = items2.map(({ MenuItem: MenuItem2, id }) => /* @__PURE__ */
|
|
320
|
-
return /* @__PURE__ */
|
|
359
|
+
const menuItems = items2.map(({ MenuItem: MenuItem2, id }) => /* @__PURE__ */ React8.createElement(MenuItem2, { key: id }));
|
|
360
|
+
return /* @__PURE__ */ React8.createElement(FloatingActionsBar, { actions: menuItems }, children);
|
|
321
361
|
}
|
|
322
362
|
|
|
323
363
|
// src/controls/image-media-control.tsx
|
|
@@ -340,7 +380,7 @@ var ImageMediaControl = createControl(({ mediaTypes = ["image"] }) => {
|
|
|
340
380
|
});
|
|
341
381
|
}
|
|
342
382
|
});
|
|
343
|
-
return /* @__PURE__ */
|
|
383
|
+
return /* @__PURE__ */ React9.createElement(ControlActions, null, /* @__PURE__ */ React9.createElement(Card, { variant: "outlined" }, /* @__PURE__ */ React9.createElement(CardMedia, { image: src, sx: { height: 150 } }, isFetching ? /* @__PURE__ */ React9.createElement(Stack, { justifyContent: "center", alignItems: "center", width: "100%", height: "100%" }, /* @__PURE__ */ React9.createElement(CircularProgress, null)) : /* @__PURE__ */ React9.createElement(React9.Fragment, null)), /* @__PURE__ */ React9.createElement(CardOverlay, null, /* @__PURE__ */ React9.createElement(Stack, { gap: 1 }, /* @__PURE__ */ React9.createElement(
|
|
344
384
|
Button,
|
|
345
385
|
{
|
|
346
386
|
size: "tiny",
|
|
@@ -349,13 +389,13 @@ var ImageMediaControl = createControl(({ mediaTypes = ["image"] }) => {
|
|
|
349
389
|
onClick: () => open({ mode: "browse" })
|
|
350
390
|
},
|
|
351
391
|
__("Select image", "elementor")
|
|
352
|
-
), /* @__PURE__ */
|
|
392
|
+
), /* @__PURE__ */ React9.createElement(
|
|
353
393
|
Button,
|
|
354
394
|
{
|
|
355
395
|
size: "tiny",
|
|
356
396
|
variant: "text",
|
|
357
397
|
color: "inherit",
|
|
358
|
-
startIcon: /* @__PURE__ */
|
|
398
|
+
startIcon: /* @__PURE__ */ React9.createElement(UploadIcon, null),
|
|
359
399
|
onClick: () => open({ mode: "upload" })
|
|
360
400
|
},
|
|
361
401
|
__("Upload", "elementor")
|
|
@@ -363,7 +403,7 @@ var ImageMediaControl = createControl(({ mediaTypes = ["image"] }) => {
|
|
|
363
403
|
});
|
|
364
404
|
|
|
365
405
|
// src/controls/select-control.tsx
|
|
366
|
-
import * as
|
|
406
|
+
import * as React10 from "react";
|
|
367
407
|
import { stringPropTypeUtil } from "@elementor/editor-props";
|
|
368
408
|
import { MenuListItem } from "@elementor/editor-ui";
|
|
369
409
|
import { Select, Typography } from "@elementor/ui";
|
|
@@ -374,7 +414,7 @@ var SelectControl = createControl(({ options, onChange }) => {
|
|
|
374
414
|
onChange?.(newValue, value);
|
|
375
415
|
setValue(newValue);
|
|
376
416
|
};
|
|
377
|
-
return /* @__PURE__ */
|
|
417
|
+
return /* @__PURE__ */ React10.createElement(ControlActions, null, /* @__PURE__ */ React10.createElement(
|
|
378
418
|
Select,
|
|
379
419
|
{
|
|
380
420
|
sx: { overflow: "hidden" },
|
|
@@ -386,7 +426,7 @@ var SelectControl = createControl(({ options, onChange }) => {
|
|
|
386
426
|
if (placeholder) {
|
|
387
427
|
const placeholderOption = findOptionByValue(placeholder);
|
|
388
428
|
const displayText = placeholderOption?.label || placeholder;
|
|
389
|
-
return /* @__PURE__ */
|
|
429
|
+
return /* @__PURE__ */ React10.createElement(Typography, { component: "span", variant: "caption", color: "text.tertiary" }, displayText);
|
|
390
430
|
}
|
|
391
431
|
return "";
|
|
392
432
|
}
|
|
@@ -398,7 +438,7 @@ var SelectControl = createControl(({ options, onChange }) => {
|
|
|
398
438
|
disabled,
|
|
399
439
|
fullWidth: true
|
|
400
440
|
},
|
|
401
|
-
options.map(({ label, ...props }) => /* @__PURE__ */
|
|
441
|
+
options.map(({ label, ...props }) => /* @__PURE__ */ React10.createElement(MenuListItem, { key: props.value, ...props, value: props.value ?? "" }, label))
|
|
402
442
|
));
|
|
403
443
|
});
|
|
404
444
|
|
|
@@ -408,28 +448,28 @@ var ImageControl = createControl(({ sizes, showMode = "all" }) => {
|
|
|
408
448
|
let componentToRender;
|
|
409
449
|
switch (showMode) {
|
|
410
450
|
case "media":
|
|
411
|
-
componentToRender = /* @__PURE__ */
|
|
451
|
+
componentToRender = /* @__PURE__ */ React11.createElement(ImageSrcControl, null);
|
|
412
452
|
break;
|
|
413
453
|
case "sizes":
|
|
414
|
-
componentToRender = /* @__PURE__ */
|
|
454
|
+
componentToRender = /* @__PURE__ */ React11.createElement(ImageSizeControl, { sizes });
|
|
415
455
|
break;
|
|
416
456
|
case "all":
|
|
417
457
|
default:
|
|
418
|
-
componentToRender = /* @__PURE__ */
|
|
458
|
+
componentToRender = /* @__PURE__ */ React11.createElement(Stack2, { gap: 1.5 }, /* @__PURE__ */ React11.createElement(ControlFormLabel, null, __2("Image", "elementor")), /* @__PURE__ */ React11.createElement(ImageSrcControl, null), /* @__PURE__ */ React11.createElement(Grid, { container: true, gap: 1.5, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React11.createElement(Grid, { item: true, xs: 6 }, /* @__PURE__ */ React11.createElement(ControlFormLabel, null, __2("Resolution", "elementor"))), /* @__PURE__ */ React11.createElement(Grid, { item: true, xs: 6, sx: { overflow: "hidden" } }, /* @__PURE__ */ React11.createElement(ImageSizeControl, { sizes }))));
|
|
419
459
|
}
|
|
420
|
-
return /* @__PURE__ */
|
|
460
|
+
return /* @__PURE__ */ React11.createElement(PropProvider, { ...propContext }, componentToRender);
|
|
421
461
|
});
|
|
422
462
|
var ImageSrcControl = () => {
|
|
423
463
|
const { data: allowSvgUpload } = useUnfilteredFilesUpload();
|
|
424
464
|
const mediaTypes = allowSvgUpload ? ["image", "svg"] : ["image"];
|
|
425
|
-
return /* @__PURE__ */
|
|
465
|
+
return /* @__PURE__ */ React11.createElement(PropKeyProvider, { bind: "src" }, /* @__PURE__ */ React11.createElement(ImageMediaControl, { mediaTypes }));
|
|
426
466
|
};
|
|
427
467
|
var ImageSizeControl = ({ sizes }) => {
|
|
428
|
-
return /* @__PURE__ */
|
|
468
|
+
return /* @__PURE__ */ React11.createElement(PropKeyProvider, { bind: "size" }, /* @__PURE__ */ React11.createElement(SelectControl, { options: sizes }));
|
|
429
469
|
};
|
|
430
470
|
|
|
431
471
|
// src/controls/text-control.tsx
|
|
432
|
-
import * as
|
|
472
|
+
import * as React12 from "react";
|
|
433
473
|
import { stringPropTypeUtil as stringPropTypeUtil2 } from "@elementor/editor-props";
|
|
434
474
|
import { TextField } from "@elementor/ui";
|
|
435
475
|
var TextControl = createControl(
|
|
@@ -442,7 +482,7 @@ var TextControl = createControl(
|
|
|
442
482
|
}) => {
|
|
443
483
|
const { value, setValue, disabled } = useBoundProp(stringPropTypeUtil2);
|
|
444
484
|
const handleChange = (event) => setValue(event.target.value);
|
|
445
|
-
return /* @__PURE__ */
|
|
485
|
+
return /* @__PURE__ */ React12.createElement(ControlActions, null, /* @__PURE__ */ React12.createElement(
|
|
446
486
|
TextField,
|
|
447
487
|
{
|
|
448
488
|
size: "tiny",
|
|
@@ -459,7 +499,7 @@ var TextControl = createControl(
|
|
|
459
499
|
);
|
|
460
500
|
|
|
461
501
|
// src/controls/text-area-control.tsx
|
|
462
|
-
import * as
|
|
502
|
+
import * as React13 from "react";
|
|
463
503
|
import { stringPropTypeUtil as stringPropTypeUtil3 } from "@elementor/editor-props";
|
|
464
504
|
import { TextField as TextField2 } from "@elementor/ui";
|
|
465
505
|
var TextAreaControl = createControl(({ placeholder }) => {
|
|
@@ -467,7 +507,7 @@ var TextAreaControl = createControl(({ placeholder }) => {
|
|
|
467
507
|
const handleChange = (event) => {
|
|
468
508
|
setValue(event.target.value);
|
|
469
509
|
};
|
|
470
|
-
return /* @__PURE__ */
|
|
510
|
+
return /* @__PURE__ */ React13.createElement(ControlActions, null, /* @__PURE__ */ React13.createElement(
|
|
471
511
|
TextField2,
|
|
472
512
|
{
|
|
473
513
|
size: "tiny",
|
|
@@ -483,28 +523,33 @@ var TextAreaControl = createControl(({ placeholder }) => {
|
|
|
483
523
|
});
|
|
484
524
|
|
|
485
525
|
// src/controls/size-control.tsx
|
|
486
|
-
import * as
|
|
487
|
-
import { useEffect as
|
|
488
|
-
import { sizePropTypeUtil } from "@elementor/editor-props";
|
|
526
|
+
import * as React17 from "react";
|
|
527
|
+
import { useEffect as useEffect3, useState as useState4 } from "react";
|
|
528
|
+
import { sizePropTypeUtil as sizePropTypeUtil2 } from "@elementor/editor-props";
|
|
489
529
|
import { useActiveBreakpoint } from "@elementor/editor-responsive";
|
|
490
530
|
import { usePopupState as usePopupState2 } from "@elementor/ui";
|
|
491
531
|
|
|
492
532
|
// src/components/size-control/size-input.tsx
|
|
493
|
-
import * as
|
|
533
|
+
import * as React15 from "react";
|
|
494
534
|
import { useRef } from "react";
|
|
495
|
-
import {
|
|
535
|
+
import { MathFunctionIcon } from "@elementor/icons";
|
|
496
536
|
import { Box, InputAdornment as InputAdornment2 } from "@elementor/ui";
|
|
497
537
|
|
|
498
538
|
// src/utils/size-control.ts
|
|
499
|
-
var
|
|
539
|
+
var lengthUnits = ["px", "%", "em", "rem", "vw", "vh"];
|
|
540
|
+
var angleUnits = ["deg", "rad", "grad", "turn"];
|
|
541
|
+
var timeUnits = ["s", "ms"];
|
|
500
542
|
var defaultExtendedOptions = ["auto", "custom"];
|
|
543
|
+
var DEFAULT_UNIT = "px";
|
|
544
|
+
var DEFAULT_SIZE = NaN;
|
|
501
545
|
function isUnitExtendedOption(unit) {
|
|
502
546
|
return defaultExtendedOptions.includes(unit);
|
|
503
547
|
}
|
|
504
548
|
|
|
505
549
|
// src/components/size-control/text-field-inner-selection.tsx
|
|
506
|
-
import * as
|
|
550
|
+
import * as React14 from "react";
|
|
507
551
|
import { forwardRef, useId } from "react";
|
|
552
|
+
import { sizePropTypeUtil } from "@elementor/editor-props";
|
|
508
553
|
import { MenuListItem as MenuListItem2 } from "@elementor/editor-ui";
|
|
509
554
|
import {
|
|
510
555
|
bindMenu,
|
|
@@ -512,6 +557,7 @@ import {
|
|
|
512
557
|
Button as Button2,
|
|
513
558
|
InputAdornment,
|
|
514
559
|
Menu,
|
|
560
|
+
styled as styled2,
|
|
515
561
|
TextField as TextField3,
|
|
516
562
|
usePopupState
|
|
517
563
|
} from "@elementor/ui";
|
|
@@ -524,25 +570,30 @@ var TextFieldInnerSelection = forwardRef(
|
|
|
524
570
|
onBlur,
|
|
525
571
|
onKeyDown,
|
|
526
572
|
onKeyUp,
|
|
527
|
-
shouldBlockInput = false,
|
|
528
573
|
inputProps,
|
|
529
|
-
disabled
|
|
574
|
+
disabled,
|
|
575
|
+
isPopoverOpen
|
|
530
576
|
}, ref) => {
|
|
531
|
-
|
|
577
|
+
const { placeholder: boundPropPlaceholder } = useBoundProp(sizePropTypeUtil);
|
|
578
|
+
const getCursorStyle = () => ({
|
|
579
|
+
input: { cursor: inputProps.readOnly ? "default !important" : void 0 }
|
|
580
|
+
});
|
|
581
|
+
return /* @__PURE__ */ React14.createElement(
|
|
532
582
|
TextField3,
|
|
533
583
|
{
|
|
534
584
|
ref,
|
|
535
|
-
sx:
|
|
585
|
+
sx: getCursorStyle(),
|
|
536
586
|
size: "tiny",
|
|
537
587
|
fullWidth: true,
|
|
538
|
-
type
|
|
588
|
+
type,
|
|
539
589
|
value,
|
|
540
|
-
onChange
|
|
541
|
-
onKeyDown
|
|
542
|
-
onKeyUp
|
|
590
|
+
onChange,
|
|
591
|
+
onKeyDown,
|
|
592
|
+
onKeyUp,
|
|
543
593
|
disabled,
|
|
544
594
|
onBlur,
|
|
545
|
-
|
|
595
|
+
focused: isPopoverOpen ? true : void 0,
|
|
596
|
+
placeholder: placeholder ?? (String(boundPropPlaceholder?.size ?? "") || void 0),
|
|
546
597
|
InputProps: inputProps
|
|
547
598
|
}
|
|
548
599
|
);
|
|
@@ -564,17 +615,17 @@ var SelectionEndAdornment = ({
|
|
|
564
615
|
onClick(options[index]);
|
|
565
616
|
popupState.close();
|
|
566
617
|
};
|
|
567
|
-
|
|
568
|
-
|
|
618
|
+
const { placeholder, showPrimaryColor } = useUnitPlaceholder(value);
|
|
619
|
+
return /* @__PURE__ */ React14.createElement(InputAdornment, { position: "end" }, /* @__PURE__ */ React14.createElement(
|
|
620
|
+
StyledButton,
|
|
569
621
|
{
|
|
622
|
+
isPrimaryColor: showPrimaryColor,
|
|
570
623
|
size: "small",
|
|
571
|
-
color: "secondary",
|
|
572
624
|
disabled,
|
|
573
|
-
sx: { font: "inherit", minWidth: "initial", textTransform: "uppercase" },
|
|
574
625
|
...bindTrigger(popupState)
|
|
575
626
|
},
|
|
576
|
-
alternativeOptionLabels[value] ?? value
|
|
577
|
-
), /* @__PURE__ */
|
|
627
|
+
placeholder ?? alternativeOptionLabels[value] ?? value
|
|
628
|
+
), /* @__PURE__ */ React14.createElement(Menu, { MenuListProps: { dense: true }, ...bindMenu(popupState) }, options.map((option, index) => /* @__PURE__ */ React14.createElement(
|
|
578
629
|
MenuListItem2,
|
|
579
630
|
{
|
|
580
631
|
key: option,
|
|
@@ -584,6 +635,34 @@ var SelectionEndAdornment = ({
|
|
|
584
635
|
alternativeOptionLabels[option] ?? option.toUpperCase()
|
|
585
636
|
))));
|
|
586
637
|
};
|
|
638
|
+
function useUnitPlaceholder(value) {
|
|
639
|
+
const { value: externalValue, placeholder } = useBoundProp(sizePropTypeUtil);
|
|
640
|
+
const size = externalValue?.size;
|
|
641
|
+
const unit = externalValue?.unit;
|
|
642
|
+
const isCustomUnitWithSize = value === "custom" && Boolean(size);
|
|
643
|
+
const isAutoUnit = value === "auto";
|
|
644
|
+
const showPrimaryColor = isAutoUnit || isCustomUnitWithSize || Boolean(size);
|
|
645
|
+
if (!placeholder) {
|
|
646
|
+
return {
|
|
647
|
+
placeholder: null,
|
|
648
|
+
showPrimaryColor
|
|
649
|
+
};
|
|
650
|
+
}
|
|
651
|
+
const isMissingUnit = !unit;
|
|
652
|
+
const showPlaceholder = isMissingUnit && value === DEFAULT_UNIT;
|
|
653
|
+
return {
|
|
654
|
+
placeholder: showPlaceholder ? placeholder.unit : void 0,
|
|
655
|
+
showPrimaryColor
|
|
656
|
+
};
|
|
657
|
+
}
|
|
658
|
+
var StyledButton = styled2(Button2, {
|
|
659
|
+
shouldForwardProp: (prop) => prop !== "isPrimaryColor"
|
|
660
|
+
})(({ isPrimaryColor, theme }) => ({
|
|
661
|
+
color: isPrimaryColor ? theme.palette.text.primary : theme.palette.text.tertiary,
|
|
662
|
+
font: "inherit",
|
|
663
|
+
minWidth: "initial",
|
|
664
|
+
textTransform: "uppercase"
|
|
665
|
+
}));
|
|
587
666
|
|
|
588
667
|
// src/components/size-control/size-input.tsx
|
|
589
668
|
var RESTRICTED_INPUT_KEYS = ["e", "E", "+", "-"];
|
|
@@ -624,11 +703,12 @@ var SizeInput = ({
|
|
|
624
703
|
};
|
|
625
704
|
const inputProps = {
|
|
626
705
|
...popupAttributes,
|
|
706
|
+
readOnly: isUnitExtendedOption(unit),
|
|
627
707
|
autoComplete: "off",
|
|
628
708
|
onClick,
|
|
629
709
|
onFocus,
|
|
630
|
-
startAdornment: startIcon ? /* @__PURE__ */
|
|
631
|
-
endAdornment: /* @__PURE__ */
|
|
710
|
+
startAdornment: startIcon ? /* @__PURE__ */ React15.createElement(InputAdornment2, { position: "start", disabled }, startIcon) : void 0,
|
|
711
|
+
endAdornment: /* @__PURE__ */ React15.createElement(
|
|
632
712
|
SelectionEndAdornment,
|
|
633
713
|
{
|
|
634
714
|
disabled,
|
|
@@ -636,7 +716,7 @@ var SizeInput = ({
|
|
|
636
716
|
onClick: handleUnitChange,
|
|
637
717
|
value: unit,
|
|
638
718
|
alternativeOptionLabels: {
|
|
639
|
-
custom: /* @__PURE__ */
|
|
719
|
+
custom: /* @__PURE__ */ React15.createElement(MathFunctionIcon, { fontSize: "tiny" })
|
|
640
720
|
},
|
|
641
721
|
menuItemsAttributes: units2.includes("custom") ? {
|
|
642
722
|
custom: popupAttributes
|
|
@@ -644,7 +724,7 @@ var SizeInput = ({
|
|
|
644
724
|
}
|
|
645
725
|
)
|
|
646
726
|
};
|
|
647
|
-
return /* @__PURE__ */
|
|
727
|
+
return /* @__PURE__ */ React15.createElement(ControlActions, null, /* @__PURE__ */ React15.createElement(Box, null, /* @__PURE__ */ React15.createElement(
|
|
648
728
|
TextFieldInnerSelection,
|
|
649
729
|
{
|
|
650
730
|
disabled,
|
|
@@ -659,18 +739,37 @@ var SizeInput = ({
|
|
|
659
739
|
},
|
|
660
740
|
onKeyUp: handleKeyUp,
|
|
661
741
|
onBlur,
|
|
662
|
-
|
|
663
|
-
|
|
742
|
+
inputProps,
|
|
743
|
+
isPopoverOpen: popupState.isOpen
|
|
664
744
|
}
|
|
665
745
|
)));
|
|
666
746
|
};
|
|
667
747
|
|
|
668
748
|
// src/components/text-field-popover.tsx
|
|
669
|
-
import * as
|
|
749
|
+
import * as React16 from "react";
|
|
750
|
+
import { useEffect, useRef as useRef2 } from "react";
|
|
751
|
+
import { PopoverHeader } from "@elementor/editor-ui";
|
|
752
|
+
import { MathFunctionIcon as MathFunctionIcon2 } from "@elementor/icons";
|
|
670
753
|
import { bindPopover, Popover, TextField as TextField4 } from "@elementor/ui";
|
|
754
|
+
import { __ as __3 } from "@wordpress/i18n";
|
|
755
|
+
var SIZE = "tiny";
|
|
671
756
|
var TextFieldPopover = (props) => {
|
|
672
757
|
const { popupState, restoreValue, anchorRef, value, onChange } = props;
|
|
673
|
-
|
|
758
|
+
const inputRef = useRef2(null);
|
|
759
|
+
useEffect(() => {
|
|
760
|
+
if (popupState.isOpen) {
|
|
761
|
+
requestAnimationFrame(() => {
|
|
762
|
+
if (inputRef.current) {
|
|
763
|
+
inputRef.current.focus();
|
|
764
|
+
}
|
|
765
|
+
});
|
|
766
|
+
}
|
|
767
|
+
}, [popupState.isOpen]);
|
|
768
|
+
const handleClose = () => {
|
|
769
|
+
restoreValue();
|
|
770
|
+
popupState.close();
|
|
771
|
+
};
|
|
772
|
+
return /* @__PURE__ */ React16.createElement(
|
|
674
773
|
Popover,
|
|
675
774
|
{
|
|
676
775
|
disablePortal: true,
|
|
@@ -678,20 +777,24 @@ var TextFieldPopover = (props) => {
|
|
|
678
777
|
paper: {
|
|
679
778
|
sx: {
|
|
680
779
|
borderRadius: 2,
|
|
681
|
-
width: anchorRef.current?.offsetWidth + "px"
|
|
682
|
-
p: 1.5
|
|
780
|
+
width: anchorRef.current?.offsetWidth + "px"
|
|
683
781
|
}
|
|
684
782
|
}
|
|
685
783
|
},
|
|
686
784
|
...bindPopover(popupState),
|
|
687
785
|
anchorOrigin: { vertical: "bottom", horizontal: "center" },
|
|
688
786
|
transformOrigin: { vertical: "top", horizontal: "center" },
|
|
689
|
-
onClose:
|
|
690
|
-
restoreValue();
|
|
691
|
-
popupState.close();
|
|
692
|
-
}
|
|
787
|
+
onClose: handleClose
|
|
693
788
|
},
|
|
694
|
-
/* @__PURE__ */
|
|
789
|
+
/* @__PURE__ */ React16.createElement(
|
|
790
|
+
PopoverHeader,
|
|
791
|
+
{
|
|
792
|
+
title: __3("CSS function", "elementor"),
|
|
793
|
+
onClose: handleClose,
|
|
794
|
+
icon: /* @__PURE__ */ React16.createElement(MathFunctionIcon2, { fontSize: SIZE })
|
|
795
|
+
}
|
|
796
|
+
),
|
|
797
|
+
/* @__PURE__ */ React16.createElement(
|
|
695
798
|
TextField4,
|
|
696
799
|
{
|
|
697
800
|
value,
|
|
@@ -700,8 +803,9 @@ var TextFieldPopover = (props) => {
|
|
|
700
803
|
type: "text",
|
|
701
804
|
fullWidth: true,
|
|
702
805
|
inputProps: {
|
|
703
|
-
|
|
704
|
-
}
|
|
806
|
+
ref: inputRef
|
|
807
|
+
},
|
|
808
|
+
sx: { pt: 0, pr: 1.5, pb: 1.5, pl: 1.5 }
|
|
705
809
|
}
|
|
706
810
|
)
|
|
707
811
|
);
|
|
@@ -709,14 +813,10 @@ var TextFieldPopover = (props) => {
|
|
|
709
813
|
|
|
710
814
|
// src/hooks/use-size-extended-options.ts
|
|
711
815
|
import { useMemo } from "react";
|
|
712
|
-
import { isExperimentActive } from "@elementor/editor-v1-adapters";
|
|
713
|
-
var EXPERIMENT_ID = "e_v_3_30";
|
|
714
816
|
function useSizeExtendedOptions(options, disableCustom) {
|
|
715
817
|
return useMemo(() => {
|
|
716
|
-
const isVersion330Active = isExperimentActive(EXPERIMENT_ID);
|
|
717
|
-
const shouldDisableCustom = !isVersion330Active || disableCustom;
|
|
718
818
|
const extendedOptions = [...options];
|
|
719
|
-
if (!
|
|
819
|
+
if (!disableCustom && !extendedOptions.includes("custom")) {
|
|
720
820
|
extendedOptions.push("custom");
|
|
721
821
|
} else if (options.includes("custom")) {
|
|
722
822
|
extendedOptions.splice(extendedOptions.indexOf("custom"), 1);
|
|
@@ -726,7 +826,7 @@ function useSizeExtendedOptions(options, disableCustom) {
|
|
|
726
826
|
}
|
|
727
827
|
|
|
728
828
|
// src/hooks/use-sync-external-state.tsx
|
|
729
|
-
import { useEffect, useState as
|
|
829
|
+
import { useEffect as useEffect2, useState as useState3 } from "react";
|
|
730
830
|
var useSyncExternalState = ({
|
|
731
831
|
external,
|
|
732
832
|
setExternal,
|
|
@@ -745,8 +845,8 @@ var useSyncExternalState = ({
|
|
|
745
845
|
}
|
|
746
846
|
return externalValue;
|
|
747
847
|
}
|
|
748
|
-
const [internal, setInternal] =
|
|
749
|
-
|
|
848
|
+
const [internal, setInternal] = useState3(toInternal(external, null));
|
|
849
|
+
useEffect2(() => {
|
|
750
850
|
setInternal((prevInternal) => toInternal(external, prevInternal));
|
|
751
851
|
}, [external]);
|
|
752
852
|
const setInternalValue = (setter) => {
|
|
@@ -759,125 +859,149 @@ var useSyncExternalState = ({
|
|
|
759
859
|
};
|
|
760
860
|
|
|
761
861
|
// src/controls/size-control.tsx
|
|
762
|
-
var
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
862
|
+
var defaultSelectedUnit = {
|
|
863
|
+
length: "px",
|
|
864
|
+
angle: "deg",
|
|
865
|
+
time: "ms"
|
|
866
|
+
};
|
|
867
|
+
var defaultUnits = {
|
|
868
|
+
length: [...lengthUnits],
|
|
869
|
+
angle: [...angleUnits],
|
|
870
|
+
time: [...timeUnits]
|
|
871
|
+
};
|
|
872
|
+
var SizeControl = createControl(
|
|
873
|
+
({
|
|
874
|
+
variant = "length",
|
|
875
|
+
defaultUnit,
|
|
876
|
+
units: units2,
|
|
877
|
+
placeholder,
|
|
878
|
+
startIcon,
|
|
879
|
+
anchorRef,
|
|
880
|
+
extendedOptions,
|
|
881
|
+
disableCustom
|
|
882
|
+
}) => {
|
|
883
|
+
const {
|
|
884
|
+
value: sizeValue,
|
|
885
|
+
setValue: setSizeValue,
|
|
886
|
+
disabled,
|
|
887
|
+
restoreValue,
|
|
888
|
+
placeholder: externalPlaceholder
|
|
889
|
+
} = useBoundProp(sizePropTypeUtil2);
|
|
890
|
+
const actualDefaultUnit = defaultUnit ?? externalPlaceholder?.unit ?? defaultSelectedUnit[variant];
|
|
891
|
+
const actualUnits = units2 ?? [...defaultUnits[variant]];
|
|
892
|
+
const [internalState, setInternalState] = useState4(createStateFromSizeProp(sizeValue, actualDefaultUnit));
|
|
893
|
+
const activeBreakpoint = useActiveBreakpoint();
|
|
894
|
+
const actualExtendedOptions = useSizeExtendedOptions(extendedOptions || [], disableCustom ?? false);
|
|
895
|
+
const popupState = usePopupState2({ variant: "popover" });
|
|
896
|
+
const [state, setState] = useSyncExternalState({
|
|
897
|
+
external: internalState,
|
|
898
|
+
setExternal: (newState) => setSizeValue(extractValueFromState(newState)),
|
|
899
|
+
persistWhen: (newState) => {
|
|
900
|
+
if (!newState?.unit) {
|
|
901
|
+
return false;
|
|
902
|
+
}
|
|
903
|
+
if (isUnitExtendedOption(newState.unit)) {
|
|
904
|
+
return newState.unit === "auto" ? true : !!newState.custom;
|
|
905
|
+
}
|
|
906
|
+
return !!newState?.numeric || newState?.numeric === 0;
|
|
907
|
+
},
|
|
908
|
+
fallback: (newState) => ({
|
|
909
|
+
unit: newState?.unit ?? actualDefaultUnit,
|
|
910
|
+
numeric: newState?.numeric ?? DEFAULT_SIZE,
|
|
911
|
+
custom: newState?.custom ?? ""
|
|
912
|
+
})
|
|
913
|
+
});
|
|
914
|
+
const { size: controlSize = DEFAULT_SIZE, unit: controlUnit = actualDefaultUnit } = extractValueFromState(state) || {};
|
|
915
|
+
const handleUnitChange = (newUnit) => {
|
|
916
|
+
if (newUnit === "custom") {
|
|
917
|
+
popupState.open(anchorRef?.current);
|
|
778
918
|
}
|
|
779
|
-
|
|
780
|
-
|
|
919
|
+
setState((prev) => ({ ...prev, unit: newUnit }));
|
|
920
|
+
};
|
|
921
|
+
const handleSizeChange = (event) => {
|
|
922
|
+
const { value: size } = event.target;
|
|
923
|
+
if (controlUnit === "auto") {
|
|
924
|
+
setState((prev) => ({ ...prev, unit: controlUnit }));
|
|
925
|
+
return;
|
|
781
926
|
}
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
custom: newState?.custom ?? ""
|
|
788
|
-
})
|
|
789
|
-
});
|
|
790
|
-
const { size: controlSize = DEFAULT_SIZE, unit: controlUnit = defaultUnit } = extractValueFromState(state) || {};
|
|
791
|
-
const handleUnitChange = (newUnit) => {
|
|
792
|
-
if (newUnit === "custom") {
|
|
793
|
-
popupState.open(anchorRef?.current);
|
|
794
|
-
}
|
|
795
|
-
setState((prev) => ({ ...prev, unit: newUnit }));
|
|
796
|
-
};
|
|
797
|
-
const handleSizeChange = (event) => {
|
|
798
|
-
const { value: size } = event.target;
|
|
799
|
-
if (controlUnit === "auto") {
|
|
800
|
-
setState((prev) => ({ ...prev, unit: controlUnit }));
|
|
801
|
-
return;
|
|
802
|
-
}
|
|
803
|
-
setState((prev) => ({
|
|
804
|
-
...prev,
|
|
805
|
-
[controlUnit === "custom" ? "custom" : "numeric"]: formatSize(size, controlUnit),
|
|
806
|
-
unit: controlUnit
|
|
807
|
-
}));
|
|
808
|
-
};
|
|
809
|
-
const onInputFocus = (event) => {
|
|
810
|
-
if (isUnitExtendedOption(state.unit)) {
|
|
811
|
-
event.target?.blur();
|
|
812
|
-
}
|
|
813
|
-
};
|
|
814
|
-
const onInputClick = (event) => {
|
|
815
|
-
if (event.target.closest("input") && "custom" === state.unit) {
|
|
816
|
-
popupState.open(anchorRef?.current);
|
|
817
|
-
}
|
|
818
|
-
};
|
|
819
|
-
useEffect2(() => {
|
|
820
|
-
const newState = createStateFromSizeProp(sizeValue, state.unit === "custom" ? state.unit : defaultUnit);
|
|
821
|
-
const currentUnitType = isUnitExtendedOption(state.unit) ? "custom" : "numeric";
|
|
822
|
-
const mergedStates = {
|
|
823
|
-
...state,
|
|
824
|
-
unit: newState.unit ?? state.unit,
|
|
825
|
-
[currentUnitType]: newState[currentUnitType]
|
|
927
|
+
setState((prev) => ({
|
|
928
|
+
...prev,
|
|
929
|
+
[controlUnit === "custom" ? "custom" : "numeric"]: formatSize(size, controlUnit),
|
|
930
|
+
unit: controlUnit
|
|
931
|
+
}));
|
|
826
932
|
};
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
933
|
+
const onInputClick = (event) => {
|
|
934
|
+
if (event.target.closest("input") && "custom" === state.unit) {
|
|
935
|
+
popupState.open(anchorRef?.current);
|
|
936
|
+
}
|
|
937
|
+
};
|
|
938
|
+
useEffect3(() => {
|
|
939
|
+
const newState = createStateFromSizeProp(
|
|
940
|
+
sizeValue,
|
|
941
|
+
state.unit === "custom" ? state.unit : actualDefaultUnit,
|
|
942
|
+
"",
|
|
943
|
+
state.custom
|
|
944
|
+
);
|
|
945
|
+
const currentUnitType = isUnitExtendedOption(state.unit) ? "custom" : "numeric";
|
|
946
|
+
const mergedStates = {
|
|
947
|
+
...state,
|
|
948
|
+
unit: newState.unit ?? state.unit,
|
|
949
|
+
[currentUnitType]: newState[currentUnitType]
|
|
950
|
+
};
|
|
951
|
+
if (mergedStates.unit !== "auto" && areStatesEqual(state, mergedStates)) {
|
|
952
|
+
return;
|
|
953
|
+
}
|
|
954
|
+
if (state.unit === newState.unit) {
|
|
955
|
+
setInternalState(mergedStates);
|
|
956
|
+
return;
|
|
957
|
+
}
|
|
839
958
|
setState(newState);
|
|
840
|
-
}
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
959
|
+
}, [sizeValue]);
|
|
960
|
+
useEffect3(() => {
|
|
961
|
+
const newState = createStateFromSizeProp(sizeValue, actualDefaultUnit, "", state.custom);
|
|
962
|
+
if (activeBreakpoint && !areStatesEqual(newState, state)) {
|
|
963
|
+
setState(newState);
|
|
964
|
+
}
|
|
965
|
+
}, [activeBreakpoint]);
|
|
966
|
+
return /* @__PURE__ */ React17.createElement(React17.Fragment, null, /* @__PURE__ */ React17.createElement(
|
|
967
|
+
SizeInput,
|
|
968
|
+
{
|
|
969
|
+
disabled,
|
|
970
|
+
size: controlSize,
|
|
971
|
+
unit: controlUnit,
|
|
972
|
+
units: [...actualUnits, ...actualExtendedOptions || []],
|
|
973
|
+
placeholder,
|
|
974
|
+
startIcon,
|
|
975
|
+
handleSizeChange,
|
|
976
|
+
handleUnitChange,
|
|
977
|
+
onBlur: restoreValue,
|
|
978
|
+
onClick: onInputClick,
|
|
979
|
+
popupState
|
|
980
|
+
}
|
|
981
|
+
), anchorRef?.current && /* @__PURE__ */ React17.createElement(
|
|
982
|
+
TextFieldPopover,
|
|
983
|
+
{
|
|
984
|
+
popupState,
|
|
985
|
+
anchorRef,
|
|
986
|
+
restoreValue,
|
|
987
|
+
value: controlSize,
|
|
988
|
+
onChange: handleSizeChange
|
|
989
|
+
}
|
|
990
|
+
));
|
|
991
|
+
}
|
|
992
|
+
);
|
|
869
993
|
function formatSize(size, unit) {
|
|
870
994
|
if (isUnitExtendedOption(unit)) {
|
|
871
995
|
return unit === "auto" ? "" : String(size ?? "");
|
|
872
996
|
}
|
|
873
997
|
return size || size === 0 ? Number(size) : NaN;
|
|
874
998
|
}
|
|
875
|
-
function createStateFromSizeProp(sizeValue, defaultUnit) {
|
|
999
|
+
function createStateFromSizeProp(sizeValue, defaultUnit, defaultSize = "", customState = "") {
|
|
876
1000
|
const unit = sizeValue?.unit ?? defaultUnit;
|
|
877
|
-
const size = sizeValue?.size ??
|
|
1001
|
+
const size = sizeValue?.size ?? defaultSize;
|
|
878
1002
|
return {
|
|
879
1003
|
numeric: !isUnitExtendedOption(unit) && !isNaN(Number(size)) && (size || size === 0) ? Number(size) : DEFAULT_SIZE,
|
|
880
|
-
custom: unit === "custom" ? String(size) :
|
|
1004
|
+
custom: unit === "custom" ? String(size) : customState,
|
|
881
1005
|
unit
|
|
882
1006
|
};
|
|
883
1007
|
}
|
|
@@ -908,19 +1032,19 @@ function areStatesEqual(state1, state2) {
|
|
|
908
1032
|
}
|
|
909
1033
|
|
|
910
1034
|
// src/controls/stroke-control.tsx
|
|
911
|
-
import * as
|
|
912
|
-
import { forwardRef as forwardRef2, useRef as
|
|
1035
|
+
import * as React20 from "react";
|
|
1036
|
+
import { forwardRef as forwardRef2, useRef as useRef3 } from "react";
|
|
913
1037
|
import { strokePropTypeUtil } from "@elementor/editor-props";
|
|
914
1038
|
import { Grid as Grid2 } from "@elementor/ui";
|
|
915
|
-
import { __ as
|
|
1039
|
+
import { __ as __4 } from "@wordpress/i18n";
|
|
916
1040
|
|
|
917
1041
|
// src/components/section-content.tsx
|
|
918
|
-
import * as
|
|
1042
|
+
import * as React18 from "react";
|
|
919
1043
|
import { Stack as Stack3 } from "@elementor/ui";
|
|
920
|
-
var SectionContent = ({ gap = 2, sx, children }) => /* @__PURE__ */
|
|
1044
|
+
var SectionContent = ({ gap = 2, sx, children }) => /* @__PURE__ */ React18.createElement(Stack3, { gap, sx: { ...sx } }, children);
|
|
921
1045
|
|
|
922
1046
|
// src/controls/color-control.tsx
|
|
923
|
-
import * as
|
|
1047
|
+
import * as React19 from "react";
|
|
924
1048
|
import { colorPropTypeUtil } from "@elementor/editor-props";
|
|
925
1049
|
import { UnstableColorField } from "@elementor/ui";
|
|
926
1050
|
var ColorControl = createControl(
|
|
@@ -930,7 +1054,7 @@ var ColorControl = createControl(
|
|
|
930
1054
|
const handleChange = (selectedColor) => {
|
|
931
1055
|
setValue(selectedColor || null);
|
|
932
1056
|
};
|
|
933
|
-
return /* @__PURE__ */
|
|
1057
|
+
return /* @__PURE__ */ React19.createElement(ControlActions, null, /* @__PURE__ */ React19.createElement(
|
|
934
1058
|
UnstableColorField,
|
|
935
1059
|
{
|
|
936
1060
|
size: "tiny",
|
|
@@ -971,34 +1095,34 @@ var ColorControl = createControl(
|
|
|
971
1095
|
var units = ["px", "em", "rem"];
|
|
972
1096
|
var StrokeControl = createControl(() => {
|
|
973
1097
|
const propContext = useBoundProp(strokePropTypeUtil);
|
|
974
|
-
const rowRef =
|
|
975
|
-
return /* @__PURE__ */
|
|
1098
|
+
const rowRef = useRef3(null);
|
|
1099
|
+
return /* @__PURE__ */ React20.createElement(PropProvider, { ...propContext }, /* @__PURE__ */ React20.createElement(SectionContent, null, /* @__PURE__ */ React20.createElement(Control, { bind: "width", label: __4("Stroke width", "elementor"), ref: rowRef }, /* @__PURE__ */ React20.createElement(SizeControl, { units, anchorRef: rowRef })), /* @__PURE__ */ React20.createElement(Control, { bind: "color", label: __4("Stroke color", "elementor") }, /* @__PURE__ */ React20.createElement(ColorControl, null))));
|
|
976
1100
|
});
|
|
977
|
-
var Control = forwardRef2(({ bind, label, children }, ref) => /* @__PURE__ */
|
|
1101
|
+
var Control = forwardRef2(({ bind, label, children }, ref) => /* @__PURE__ */ React20.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React20.createElement(Grid2, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap", ref }, /* @__PURE__ */ React20.createElement(Grid2, { item: true, xs: 6 }, /* @__PURE__ */ React20.createElement(ControlFormLabel, null, label)), /* @__PURE__ */ React20.createElement(Grid2, { item: true, xs: 6 }, children))));
|
|
978
1102
|
|
|
979
1103
|
// src/controls/box-shadow-repeater-control.tsx
|
|
980
|
-
import * as
|
|
981
|
-
import { useRef as
|
|
1104
|
+
import * as React27 from "react";
|
|
1105
|
+
import { useRef as useRef4 } from "react";
|
|
982
1106
|
import { boxShadowPropTypeUtil, shadowPropTypeUtil } from "@elementor/editor-props";
|
|
983
1107
|
import { FormLabel as FormLabel2, Grid as Grid4, UnstableColorIndicator } from "@elementor/ui";
|
|
984
|
-
import { __ as
|
|
1108
|
+
import { __ as __6 } from "@wordpress/i18n";
|
|
985
1109
|
|
|
986
1110
|
// src/components/popover-content.tsx
|
|
987
|
-
import * as
|
|
1111
|
+
import * as React21 from "react";
|
|
988
1112
|
import { Stack as Stack4 } from "@elementor/ui";
|
|
989
|
-
var PopoverContent = ({ gap = 1.5, children, ...props }) => /* @__PURE__ */
|
|
1113
|
+
var PopoverContent = ({ gap = 1.5, children, ...props }) => /* @__PURE__ */ React21.createElement(Stack4, { ...props, gap }, children);
|
|
990
1114
|
|
|
991
1115
|
// src/components/popover-grid-container.tsx
|
|
992
1116
|
import { forwardRef as forwardRef3 } from "react";
|
|
993
|
-
import * as
|
|
1117
|
+
import * as React22 from "react";
|
|
994
1118
|
import { Grid as Grid3 } from "@elementor/ui";
|
|
995
1119
|
var PopoverGridContainer = forwardRef3(
|
|
996
|
-
({ gap = 1.5, alignItems = "center", flexWrap = "nowrap", children }, ref) => /* @__PURE__ */
|
|
1120
|
+
({ gap = 1.5, alignItems = "center", flexWrap = "nowrap", children }, ref) => /* @__PURE__ */ React22.createElement(Grid3, { container: true, gap, alignItems, flexWrap, ref }, children)
|
|
997
1121
|
);
|
|
998
1122
|
|
|
999
1123
|
// src/components/repeater.tsx
|
|
1000
|
-
import * as
|
|
1001
|
-
import { useEffect as
|
|
1124
|
+
import * as React26 from "react";
|
|
1125
|
+
import { useEffect as useEffect4, useState as useState5 } from "react";
|
|
1002
1126
|
import { CopyIcon, EyeIcon, EyeOffIcon, PlusIcon, XIcon } from "@elementor/icons";
|
|
1003
1127
|
import {
|
|
1004
1128
|
bindPopover as bindPopover2,
|
|
@@ -1012,18 +1136,18 @@ import {
|
|
|
1012
1136
|
UnstableTag,
|
|
1013
1137
|
usePopupState as usePopupState3
|
|
1014
1138
|
} from "@elementor/ui";
|
|
1015
|
-
import { __ as
|
|
1139
|
+
import { __ as __5 } from "@wordpress/i18n";
|
|
1016
1140
|
|
|
1017
1141
|
// src/control-adornments/control-adornments.tsx
|
|
1018
|
-
import * as
|
|
1142
|
+
import * as React24 from "react";
|
|
1019
1143
|
|
|
1020
1144
|
// src/control-adornments/control-adornments-context.tsx
|
|
1021
|
-
import * as
|
|
1022
|
-
import { createContext as
|
|
1023
|
-
var Context2 =
|
|
1024
|
-
var ControlAdornmentsProvider = ({ children, items: items2 }) => /* @__PURE__ */
|
|
1145
|
+
import * as React23 from "react";
|
|
1146
|
+
import { createContext as createContext6, useContext as useContext6 } from "react";
|
|
1147
|
+
var Context2 = createContext6(null);
|
|
1148
|
+
var ControlAdornmentsProvider = ({ children, items: items2 }) => /* @__PURE__ */ React23.createElement(Context2.Provider, { value: { items: items2 } }, children);
|
|
1025
1149
|
var useControlAdornments = () => {
|
|
1026
|
-
const context =
|
|
1150
|
+
const context = useContext6(Context2);
|
|
1027
1151
|
return context?.items ?? [];
|
|
1028
1152
|
};
|
|
1029
1153
|
|
|
@@ -1033,30 +1157,25 @@ function ControlAdornments() {
|
|
|
1033
1157
|
if (items2?.length === 0) {
|
|
1034
1158
|
return null;
|
|
1035
1159
|
}
|
|
1036
|
-
return /* @__PURE__ */
|
|
1160
|
+
return /* @__PURE__ */ React24.createElement(React24.Fragment, null, items2.map(({ Adornment, id }) => /* @__PURE__ */ React24.createElement(Adornment, { key: id })));
|
|
1037
1161
|
}
|
|
1038
1162
|
|
|
1039
|
-
// src/locations.ts
|
|
1040
|
-
import { createReplaceableLocation } from "@elementor/locations";
|
|
1041
|
-
var { Slot: RepeaterItemIconSlot, inject: injectIntoRepeaterItemIcon } = createReplaceableLocation();
|
|
1042
|
-
var { Slot: RepeaterItemLabelSlot, inject: injectIntoRepeaterItemLabel } = createReplaceableLocation();
|
|
1043
|
-
|
|
1044
1163
|
// src/components/sortable.tsx
|
|
1045
|
-
import * as
|
|
1164
|
+
import * as React25 from "react";
|
|
1046
1165
|
import { GripVerticalIcon } from "@elementor/icons";
|
|
1047
1166
|
import {
|
|
1048
1167
|
Divider,
|
|
1049
1168
|
List,
|
|
1050
1169
|
ListItem,
|
|
1051
|
-
styled as
|
|
1170
|
+
styled as styled3,
|
|
1052
1171
|
UnstableSortableItem,
|
|
1053
1172
|
UnstableSortableProvider
|
|
1054
1173
|
} from "@elementor/ui";
|
|
1055
1174
|
var SortableProvider = (props) => {
|
|
1056
|
-
return /* @__PURE__ */
|
|
1175
|
+
return /* @__PURE__ */ React25.createElement(List, { sx: { p: 0, my: -0.5, mx: 0 } }, /* @__PURE__ */ React25.createElement(UnstableSortableProvider, { restrictAxis: true, disableDragOverlay: false, variant: "static", ...props }));
|
|
1057
1176
|
};
|
|
1058
1177
|
var SortableItem = ({ id, children, disabled }) => {
|
|
1059
|
-
return /* @__PURE__ */
|
|
1178
|
+
return /* @__PURE__ */ React25.createElement(
|
|
1060
1179
|
UnstableSortableItem,
|
|
1061
1180
|
{
|
|
1062
1181
|
id,
|
|
@@ -1069,12 +1188,12 @@ var SortableItem = ({ id, children, disabled }) => {
|
|
|
1069
1188
|
showDropIndication,
|
|
1070
1189
|
dropIndicationStyle
|
|
1071
1190
|
}) => {
|
|
1072
|
-
return /* @__PURE__ */
|
|
1191
|
+
return /* @__PURE__ */ React25.createElement(StyledListItem, { ...itemProps, style: itemStyle }, !disabled && /* @__PURE__ */ React25.createElement(SortableTrigger, { ...triggerProps, style: triggerStyle }), children, showDropIndication && /* @__PURE__ */ React25.createElement(StyledDivider, { style: dropIndicationStyle }));
|
|
1073
1192
|
}
|
|
1074
1193
|
}
|
|
1075
1194
|
);
|
|
1076
1195
|
};
|
|
1077
|
-
var StyledListItem =
|
|
1196
|
+
var StyledListItem = styled3(ListItem)`
|
|
1078
1197
|
position: relative;
|
|
1079
1198
|
margin-inline: 0px;
|
|
1080
1199
|
padding-inline: 0px;
|
|
@@ -1103,8 +1222,8 @@ var StyledListItem = styled2(ListItem)`
|
|
|
1103
1222
|
}
|
|
1104
1223
|
}
|
|
1105
1224
|
`;
|
|
1106
|
-
var SortableTrigger = (props) => /* @__PURE__ */
|
|
1107
|
-
var StyledDivider =
|
|
1225
|
+
var SortableTrigger = (props) => /* @__PURE__ */ React25.createElement("div", { ...props, role: "button", className: "class-item-sortable-trigger" }, /* @__PURE__ */ React25.createElement(GripVerticalIcon, { fontSize: "tiny" }));
|
|
1226
|
+
var StyledDivider = styled3(Divider)`
|
|
1108
1227
|
height: 0px;
|
|
1109
1228
|
border: none;
|
|
1110
1229
|
overflow: visible;
|
|
@@ -1121,8 +1240,15 @@ var StyledDivider = styled2(Divider)`
|
|
|
1121
1240
|
}
|
|
1122
1241
|
`;
|
|
1123
1242
|
|
|
1243
|
+
// src/components/unstable-repeater/locations.ts
|
|
1244
|
+
import { createLocation, createReplaceableLocation } from "@elementor/locations";
|
|
1245
|
+
var { Slot: RepeaterItemIconSlot, inject: injectIntoRepeaterItemIcon } = createReplaceableLocation();
|
|
1246
|
+
var { Slot: RepeaterItemLabelSlot, inject: injectIntoRepeaterItemLabel } = createReplaceableLocation();
|
|
1247
|
+
var { Slot: RepeaterHeaderActionsSlot, inject: injectIntoRepeaterHeaderActions } = createLocation();
|
|
1248
|
+
var { Slot: RepeaterItemActionsSlot, inject: injectIntoRepeaterItemActions } = createLocation();
|
|
1249
|
+
|
|
1124
1250
|
// src/components/repeater.tsx
|
|
1125
|
-
var
|
|
1251
|
+
var SIZE2 = "tiny";
|
|
1126
1252
|
var EMPTY_OPEN_ITEM = -1;
|
|
1127
1253
|
var Repeater = ({
|
|
1128
1254
|
label,
|
|
@@ -1137,20 +1263,20 @@ var Repeater = ({
|
|
|
1137
1263
|
isSortable = true,
|
|
1138
1264
|
collectionPropUtil
|
|
1139
1265
|
}) => {
|
|
1140
|
-
const [openItem, setOpenItem] =
|
|
1266
|
+
const [openItem, setOpenItem] = useState5(EMPTY_OPEN_ITEM);
|
|
1141
1267
|
const [items2, setItems] = useSyncExternalState({
|
|
1142
1268
|
external: repeaterValues,
|
|
1143
1269
|
// @ts-expect-error - as long as persistWhen => true, value will never be null
|
|
1144
1270
|
setExternal: setRepeaterValues,
|
|
1145
1271
|
persistWhen: () => true
|
|
1146
1272
|
});
|
|
1147
|
-
const [uniqueKeys, setUniqueKeys] =
|
|
1148
|
-
const
|
|
1273
|
+
const [uniqueKeys, setUniqueKeys] = useState5(items2.map((_, index) => index));
|
|
1274
|
+
const generateNextKey2 = (source) => {
|
|
1149
1275
|
return 1 + Math.max(0, ...source);
|
|
1150
1276
|
};
|
|
1151
1277
|
const addRepeaterItem = () => {
|
|
1152
1278
|
const newItem = structuredClone(itemSettings.initialValues);
|
|
1153
|
-
const newKey =
|
|
1279
|
+
const newKey = generateNextKey2(uniqueKeys);
|
|
1154
1280
|
if (addToBottom) {
|
|
1155
1281
|
setItems([...items2, newItem]);
|
|
1156
1282
|
setUniqueKeys([...uniqueKeys, newKey]);
|
|
@@ -1164,7 +1290,7 @@ var Repeater = ({
|
|
|
1164
1290
|
};
|
|
1165
1291
|
const duplicateRepeaterItem = (index) => {
|
|
1166
1292
|
const newItem = structuredClone(items2[index]);
|
|
1167
|
-
const newKey =
|
|
1293
|
+
const newKey = generateNextKey2(uniqueKeys);
|
|
1168
1294
|
const atPosition = 1 + index;
|
|
1169
1295
|
setItems([...items2.slice(0, atPosition), newItem, ...items2.slice(atPosition)]);
|
|
1170
1296
|
setUniqueKeys([...uniqueKeys.slice(0, atPosition), newKey, ...uniqueKeys.slice(atPosition)]);
|
|
@@ -1201,7 +1327,7 @@ var Repeater = ({
|
|
|
1201
1327
|
});
|
|
1202
1328
|
});
|
|
1203
1329
|
};
|
|
1204
|
-
return /* @__PURE__ */
|
|
1330
|
+
return /* @__PURE__ */ React26.createElement(SectionContent, null, /* @__PURE__ */ React26.createElement(
|
|
1205
1331
|
Stack5,
|
|
1206
1332
|
{
|
|
1207
1333
|
direction: "row",
|
|
@@ -1210,31 +1336,31 @@ var Repeater = ({
|
|
|
1210
1336
|
gap: 1,
|
|
1211
1337
|
sx: { marginInlineEnd: -0.75 }
|
|
1212
1338
|
},
|
|
1213
|
-
/* @__PURE__ */
|
|
1214
|
-
/* @__PURE__ */
|
|
1215
|
-
/* @__PURE__ */
|
|
1339
|
+
/* @__PURE__ */ React26.createElement(Typography2, { component: "label", variant: "caption", color: "text.secondary" }, label),
|
|
1340
|
+
/* @__PURE__ */ React26.createElement(ControlAdornments, null),
|
|
1341
|
+
/* @__PURE__ */ React26.createElement(
|
|
1216
1342
|
IconButton,
|
|
1217
1343
|
{
|
|
1218
|
-
size:
|
|
1344
|
+
size: SIZE2,
|
|
1219
1345
|
sx: { ml: "auto" },
|
|
1220
1346
|
disabled,
|
|
1221
1347
|
onClick: addRepeaterItem,
|
|
1222
|
-
"aria-label":
|
|
1348
|
+
"aria-label": __5("Add item", "elementor")
|
|
1223
1349
|
},
|
|
1224
|
-
/* @__PURE__ */
|
|
1350
|
+
/* @__PURE__ */ React26.createElement(PlusIcon, { fontSize: SIZE2 })
|
|
1225
1351
|
)
|
|
1226
|
-
), 0 < uniqueKeys.length && /* @__PURE__ */
|
|
1352
|
+
), 0 < uniqueKeys.length && /* @__PURE__ */ React26.createElement(SortableProvider, { value: uniqueKeys, onChange: onChangeOrder }, uniqueKeys.map((key, index) => {
|
|
1227
1353
|
const value = items2[index];
|
|
1228
1354
|
if (!value) {
|
|
1229
1355
|
return null;
|
|
1230
1356
|
}
|
|
1231
|
-
return /* @__PURE__ */
|
|
1357
|
+
return /* @__PURE__ */ React26.createElement(SortableItem, { id: key, key: `sortable-${key}`, disabled: !isSortable }, /* @__PURE__ */ React26.createElement(
|
|
1232
1358
|
RepeaterItem,
|
|
1233
1359
|
{
|
|
1234
1360
|
disabled,
|
|
1235
1361
|
propDisabled: value?.disabled,
|
|
1236
|
-
label: /* @__PURE__ */
|
|
1237
|
-
startIcon: /* @__PURE__ */
|
|
1362
|
+
label: /* @__PURE__ */ React26.createElement(RepeaterItemLabelSlot, { value }, /* @__PURE__ */ React26.createElement(itemSettings.Label, { value })),
|
|
1363
|
+
startIcon: /* @__PURE__ */ React26.createElement(RepeaterItemIconSlot, { value }, /* @__PURE__ */ React26.createElement(itemSettings.Icon, { value })),
|
|
1238
1364
|
removeItem: () => removeRepeaterItem(index),
|
|
1239
1365
|
duplicateItem: () => duplicateRepeaterItem(index),
|
|
1240
1366
|
toggleDisableItem: () => toggleDisableRepeaterItem(index),
|
|
@@ -1244,7 +1370,7 @@ var Repeater = ({
|
|
|
1244
1370
|
showToggle,
|
|
1245
1371
|
collectionPropUtil
|
|
1246
1372
|
},
|
|
1247
|
-
(props) => /* @__PURE__ */
|
|
1373
|
+
(props) => /* @__PURE__ */ React26.createElement(itemSettings.Content, { ...props, value, bind: String(index) })
|
|
1248
1374
|
));
|
|
1249
1375
|
})));
|
|
1250
1376
|
};
|
|
@@ -1263,12 +1389,12 @@ var RepeaterItem = ({
|
|
|
1263
1389
|
disabled,
|
|
1264
1390
|
collectionPropUtil
|
|
1265
1391
|
}) => {
|
|
1266
|
-
const [anchorEl, setAnchorEl] =
|
|
1392
|
+
const [anchorEl, setAnchorEl] = useState5(null);
|
|
1267
1393
|
const { popoverState, popoverProps, ref, setRef } = usePopover(openOnMount, onOpen);
|
|
1268
|
-
const duplicateLabel =
|
|
1269
|
-
const toggleLabel = propDisabled ?
|
|
1270
|
-
const removeLabel =
|
|
1271
|
-
return /* @__PURE__ */
|
|
1394
|
+
const duplicateLabel = __5("Duplicate", "elementor");
|
|
1395
|
+
const toggleLabel = propDisabled ? __5("Show", "elementor") : __5("Hide", "elementor");
|
|
1396
|
+
const removeLabel = __5("Remove", "elementor");
|
|
1397
|
+
return /* @__PURE__ */ React26.createElement(React26.Fragment, null, /* @__PURE__ */ React26.createElement(
|
|
1272
1398
|
UnstableTag,
|
|
1273
1399
|
{
|
|
1274
1400
|
disabled,
|
|
@@ -1277,12 +1403,12 @@ var RepeaterItem = ({
|
|
|
1277
1403
|
fullWidth: true,
|
|
1278
1404
|
ref: setRef,
|
|
1279
1405
|
variant: "outlined",
|
|
1280
|
-
"aria-label":
|
|
1406
|
+
"aria-label": __5("Open item", "elementor"),
|
|
1281
1407
|
...bindTrigger2(popoverState),
|
|
1282
1408
|
startIcon,
|
|
1283
|
-
actions: /* @__PURE__ */
|
|
1409
|
+
actions: /* @__PURE__ */ React26.createElement(React26.Fragment, null, showDuplicate && /* @__PURE__ */ React26.createElement(Tooltip, { title: duplicateLabel, placement: "top" }, /* @__PURE__ */ React26.createElement(IconButton, { size: SIZE2, onClick: duplicateItem, "aria-label": duplicateLabel }, /* @__PURE__ */ React26.createElement(CopyIcon, { fontSize: SIZE2 }))), showToggle && /* @__PURE__ */ React26.createElement(Tooltip, { title: toggleLabel, placement: "top" }, /* @__PURE__ */ React26.createElement(IconButton, { size: SIZE2, onClick: toggleDisableItem, "aria-label": toggleLabel }, propDisabled ? /* @__PURE__ */ React26.createElement(EyeOffIcon, { fontSize: SIZE2 }) : /* @__PURE__ */ React26.createElement(EyeIcon, { fontSize: SIZE2 }))), /* @__PURE__ */ React26.createElement(Tooltip, { title: removeLabel, placement: "top" }, /* @__PURE__ */ React26.createElement(IconButton, { size: SIZE2, onClick: removeItem, "aria-label": removeLabel }, /* @__PURE__ */ React26.createElement(XIcon, { fontSize: SIZE2 }))))
|
|
1284
1410
|
}
|
|
1285
|
-
), /* @__PURE__ */
|
|
1411
|
+
), /* @__PURE__ */ React26.createElement(
|
|
1286
1412
|
Popover2,
|
|
1287
1413
|
{
|
|
1288
1414
|
disablePortal: true,
|
|
@@ -1296,14 +1422,14 @@ var RepeaterItem = ({
|
|
|
1296
1422
|
...popoverProps,
|
|
1297
1423
|
anchorEl: ref
|
|
1298
1424
|
},
|
|
1299
|
-
/* @__PURE__ */
|
|
1425
|
+
/* @__PURE__ */ React26.createElement(Box2, null, children({ anchorEl, collectionPropUtil }))
|
|
1300
1426
|
));
|
|
1301
1427
|
};
|
|
1302
1428
|
var usePopover = (openOnMount, onOpen) => {
|
|
1303
|
-
const [ref, setRef] =
|
|
1429
|
+
const [ref, setRef] = useState5(null);
|
|
1304
1430
|
const popoverState = usePopupState3({ variant: "popover" });
|
|
1305
1431
|
const popoverProps = bindPopover2(popoverState);
|
|
1306
|
-
|
|
1432
|
+
useEffect4(() => {
|
|
1307
1433
|
if (openOnMount && ref) {
|
|
1308
1434
|
popoverState.open(ref);
|
|
1309
1435
|
onOpen?.();
|
|
@@ -1320,14 +1446,14 @@ var usePopover = (openOnMount, onOpen) => {
|
|
|
1320
1446
|
// src/controls/box-shadow-repeater-control.tsx
|
|
1321
1447
|
var BoxShadowRepeaterControl = createControl(() => {
|
|
1322
1448
|
const { propType, value, setValue, disabled } = useBoundProp(boxShadowPropTypeUtil);
|
|
1323
|
-
return /* @__PURE__ */
|
|
1449
|
+
return /* @__PURE__ */ React27.createElement(PropProvider, { propType, value, setValue, isDisabled: () => disabled }, /* @__PURE__ */ React27.createElement(
|
|
1324
1450
|
Repeater,
|
|
1325
1451
|
{
|
|
1326
1452
|
openOnAdd: true,
|
|
1327
1453
|
disabled,
|
|
1328
1454
|
values: value ?? [],
|
|
1329
1455
|
setValues: setValue,
|
|
1330
|
-
label:
|
|
1456
|
+
label: __6("Box shadow", "elementor"),
|
|
1331
1457
|
itemSettings: {
|
|
1332
1458
|
Icon: ItemIcon,
|
|
1333
1459
|
Label: ItemLabel,
|
|
@@ -1337,29 +1463,29 @@ var BoxShadowRepeaterControl = createControl(() => {
|
|
|
1337
1463
|
}
|
|
1338
1464
|
));
|
|
1339
1465
|
});
|
|
1340
|
-
var ItemIcon = ({ value }) => /* @__PURE__ */
|
|
1466
|
+
var ItemIcon = ({ value }) => /* @__PURE__ */ React27.createElement(UnstableColorIndicator, { size: "inherit", component: "span", value: value.value.color?.value });
|
|
1341
1467
|
var ItemContent = ({ anchorEl, bind }) => {
|
|
1342
|
-
return /* @__PURE__ */
|
|
1468
|
+
return /* @__PURE__ */ React27.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React27.createElement(Content, { anchorEl }));
|
|
1343
1469
|
};
|
|
1344
1470
|
var Content = ({ anchorEl }) => {
|
|
1345
1471
|
const context = useBoundProp(shadowPropTypeUtil);
|
|
1346
|
-
const rowRef = [
|
|
1347
|
-
return /* @__PURE__ */
|
|
1472
|
+
const rowRef = [useRef4(null), useRef4(null)];
|
|
1473
|
+
return /* @__PURE__ */ React27.createElement(PropProvider, { ...context }, /* @__PURE__ */ React27.createElement(PopoverContent, { p: 1.5 }, /* @__PURE__ */ React27.createElement(PopoverGridContainer, null, /* @__PURE__ */ React27.createElement(Control2, { bind: "color", label: __6("Color", "elementor") }, /* @__PURE__ */ React27.createElement(ColorControl, { anchorEl })), /* @__PURE__ */ React27.createElement(Control2, { bind: "position", label: __6("Position", "elementor"), sx: { overflow: "hidden" } }, /* @__PURE__ */ React27.createElement(
|
|
1348
1474
|
SelectControl,
|
|
1349
1475
|
{
|
|
1350
1476
|
options: [
|
|
1351
|
-
{ label:
|
|
1352
|
-
{ label:
|
|
1477
|
+
{ label: __6("Inset", "elementor"), value: "inset" },
|
|
1478
|
+
{ label: __6("Outset", "elementor"), value: null }
|
|
1353
1479
|
]
|
|
1354
1480
|
}
|
|
1355
|
-
))), /* @__PURE__ */
|
|
1481
|
+
))), /* @__PURE__ */ React27.createElement(PopoverGridContainer, { ref: rowRef[0] }, /* @__PURE__ */ React27.createElement(Control2, { bind: "hOffset", label: __6("Horizontal", "elementor") }, /* @__PURE__ */ React27.createElement(SizeControl, { anchorRef: rowRef[0] })), /* @__PURE__ */ React27.createElement(Control2, { bind: "vOffset", label: __6("Vertical", "elementor") }, /* @__PURE__ */ React27.createElement(SizeControl, { anchorRef: rowRef[0] }))), /* @__PURE__ */ React27.createElement(PopoverGridContainer, { ref: rowRef[1] }, /* @__PURE__ */ React27.createElement(Control2, { bind: "blur", label: __6("Blur", "elementor") }, /* @__PURE__ */ React27.createElement(SizeControl, { anchorRef: rowRef[1] })), /* @__PURE__ */ React27.createElement(Control2, { bind: "spread", label: __6("Spread", "elementor") }, /* @__PURE__ */ React27.createElement(SizeControl, { anchorRef: rowRef[1] })))));
|
|
1356
1482
|
};
|
|
1357
1483
|
var Control2 = ({
|
|
1358
1484
|
label,
|
|
1359
1485
|
bind,
|
|
1360
1486
|
children,
|
|
1361
1487
|
sx
|
|
1362
|
-
}) => /* @__PURE__ */
|
|
1488
|
+
}) => /* @__PURE__ */ React27.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React27.createElement(Grid4, { item: true, xs: 6, sx }, /* @__PURE__ */ React27.createElement(Grid4, { container: true, gap: 0.75, alignItems: "center" }, /* @__PURE__ */ React27.createElement(Grid4, { item: true, xs: 12 }, /* @__PURE__ */ React27.createElement(FormLabel2, { size: "tiny" }, label)), /* @__PURE__ */ React27.createElement(Grid4, { item: true, xs: 12 }, children))));
|
|
1363
1489
|
var ItemLabel = ({ value }) => {
|
|
1364
1490
|
const { position, hOffset, vOffset, blur, spread } = value.value;
|
|
1365
1491
|
const { size: blurSize = "", unit: blurUnit = "" } = blur?.value || {};
|
|
@@ -1373,7 +1499,7 @@ var ItemLabel = ({ value }) => {
|
|
|
1373
1499
|
blurSize + blurUnit,
|
|
1374
1500
|
spreadSize + spreadUnit
|
|
1375
1501
|
].join(" ");
|
|
1376
|
-
return /* @__PURE__ */
|
|
1502
|
+
return /* @__PURE__ */ React27.createElement("span", { style: { textTransform: "capitalize" } }, positionLabel, ": ", sizes);
|
|
1377
1503
|
};
|
|
1378
1504
|
var initialShadow = {
|
|
1379
1505
|
$$type: "shadow",
|
|
@@ -1404,65 +1530,49 @@ var initialShadow = {
|
|
|
1404
1530
|
|
|
1405
1531
|
// src/controls/filter-repeater-control.tsx
|
|
1406
1532
|
import * as React30 from "react";
|
|
1407
|
-
import { useRef as
|
|
1533
|
+
import { useRef as useRef6 } from "react";
|
|
1408
1534
|
import {
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
contrastFilterPropTypeUtil,
|
|
1412
|
-
dropShadowFilterPropTypeUtil,
|
|
1413
|
-
filterPropTypeUtil,
|
|
1414
|
-
grayscaleFilterPropTypeUtil,
|
|
1415
|
-
hueRotateFilterPropTypeUtil,
|
|
1416
|
-
invertFilterPropTypeUtil,
|
|
1417
|
-
saturateFilterPropTypeUtil,
|
|
1418
|
-
sepiaFilterPropTypeUtil
|
|
1535
|
+
cssFilterFunctionPropUtil,
|
|
1536
|
+
filterPropTypeUtil
|
|
1419
1537
|
} from "@elementor/editor-props";
|
|
1420
1538
|
import { backdropFilterPropTypeUtil } from "@elementor/editor-props";
|
|
1421
|
-
import {
|
|
1422
|
-
import {
|
|
1423
|
-
import { __ as __7 } from "@wordpress/i18n";
|
|
1424
|
-
|
|
1425
|
-
// src/components/control-label.tsx
|
|
1426
|
-
import * as React27 from "react";
|
|
1427
|
-
import { Stack as Stack6 } from "@elementor/ui";
|
|
1428
|
-
var ControlLabel = ({ children }) => {
|
|
1429
|
-
return /* @__PURE__ */ React27.createElement(Stack6, { direction: "row", alignItems: "center", justifyItems: "start", gap: 0.25 }, /* @__PURE__ */ React27.createElement(ControlFormLabel, null, children), /* @__PURE__ */ React27.createElement(ControlAdornments, null));
|
|
1430
|
-
};
|
|
1539
|
+
import { Box as Box4, Grid as Grid6 } from "@elementor/ui";
|
|
1540
|
+
import { __ as __8 } from "@wordpress/i18n";
|
|
1431
1541
|
|
|
1432
1542
|
// src/controls/filter-control/drop-shadow-item-content.tsx
|
|
1433
1543
|
import * as React28 from "react";
|
|
1434
|
-
import { useRef as
|
|
1544
|
+
import { useRef as useRef5 } from "react";
|
|
1545
|
+
import { dropShadowFilterPropTypeUtil } from "@elementor/editor-props";
|
|
1435
1546
|
import { Grid as Grid5 } from "@elementor/ui";
|
|
1436
|
-
import { __ as
|
|
1547
|
+
import { __ as __7 } from "@wordpress/i18n";
|
|
1437
1548
|
var items = [
|
|
1438
1549
|
{
|
|
1439
1550
|
bind: "xAxis",
|
|
1440
|
-
label:
|
|
1551
|
+
label: __7("X-axis", "elementor"),
|
|
1441
1552
|
rowIndex: 0
|
|
1442
1553
|
},
|
|
1443
1554
|
{
|
|
1444
1555
|
bind: "yAxis",
|
|
1445
|
-
label:
|
|
1556
|
+
label: __7("Y-axis", "elementor"),
|
|
1446
1557
|
rowIndex: 0
|
|
1447
1558
|
},
|
|
1448
1559
|
{
|
|
1449
1560
|
bind: "blur",
|
|
1450
|
-
label:
|
|
1561
|
+
label: __7("Blur", "elementor"),
|
|
1451
1562
|
rowIndex: 1
|
|
1452
1563
|
},
|
|
1453
1564
|
{
|
|
1454
1565
|
bind: "color",
|
|
1455
|
-
label:
|
|
1566
|
+
label: __7("Color", "elementor"),
|
|
1456
1567
|
rowIndex: 1
|
|
1457
1568
|
}
|
|
1458
1569
|
];
|
|
1459
1570
|
var DropShadowItemContent = ({
|
|
1460
|
-
propType,
|
|
1461
1571
|
units: units2,
|
|
1462
1572
|
anchorEl
|
|
1463
1573
|
}) => {
|
|
1464
|
-
const context = useBoundProp(
|
|
1465
|
-
const rowRefs = [
|
|
1574
|
+
const context = useBoundProp(dropShadowFilterPropTypeUtil);
|
|
1575
|
+
const rowRefs = [useRef5(null), useRef5(null)];
|
|
1466
1576
|
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(Grid5, { item: true, xs: 6 }, /* @__PURE__ */ React28.createElement(ControlFormLabel, null, item.label)), /* @__PURE__ */ React28.createElement(Grid5, { item: true, xs: 6 }, item.bind === "color" ? /* @__PURE__ */ React28.createElement(ColorControl, { anchorEl }) : /* @__PURE__ */ React28.createElement(SizeControl, { anchorRef: rowRefs[item.rowIndex], units: units2, defaultUnit: "px" }))))));
|
|
1467
1577
|
};
|
|
1468
1578
|
|
|
@@ -1470,7 +1580,7 @@ var DropShadowItemContent = ({
|
|
|
1470
1580
|
import * as React29 from "react";
|
|
1471
1581
|
import { Box as Box3 } from "@elementor/ui";
|
|
1472
1582
|
var DropShadowItemLabel = ({ value }) => {
|
|
1473
|
-
const { xAxis, yAxis, blur } = value.value;
|
|
1583
|
+
const { xAxis, yAxis, blur } = value.value.args.value;
|
|
1474
1584
|
const xValue = `${xAxis?.value?.size ?? 0}${xAxis?.value?.unit ?? "px"}`;
|
|
1475
1585
|
const yValue = `${yAxis?.value?.size ?? 0}${yAxis?.value?.unit ?? "px"}`;
|
|
1476
1586
|
const blurValue = `${blur?.value?.size ?? 10}${blur?.value?.unit ?? "px"}`;
|
|
@@ -1478,78 +1588,123 @@ var DropShadowItemLabel = ({ value }) => {
|
|
|
1478
1588
|
};
|
|
1479
1589
|
|
|
1480
1590
|
// src/controls/filter-repeater-control.tsx
|
|
1481
|
-
var
|
|
1591
|
+
var DEFAULT_FILTER = "blur";
|
|
1482
1592
|
var filterConfig = {
|
|
1483
1593
|
blur: {
|
|
1484
|
-
defaultValue: { $$type: "radius", radius: { $$type: "size", value: { size: 0, unit: "px" } } },
|
|
1485
|
-
name: __7("Blur", "elementor"),
|
|
1486
|
-
valueName: __7("Radius", "elementor"),
|
|
1487
|
-
propType: blurFilterPropTypeUtil,
|
|
1488
|
-
units: defaultUnits.filter((unit) => unit !== "%")
|
|
1489
|
-
},
|
|
1490
|
-
"drop-shadow": {
|
|
1491
1594
|
defaultValue: {
|
|
1492
|
-
$$type: "
|
|
1595
|
+
$$type: "css-filter-func",
|
|
1493
1596
|
value: {
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
blur: { $$type: "size", value: { size: 10, unit: "px" } },
|
|
1497
|
-
color: { $$type: "color", value: "rgba(0, 0, 0, 1)" }
|
|
1597
|
+
func: { $$type: "string", value: "blur" },
|
|
1598
|
+
args: { $$type: "size", value: { size: 0, unit: "px" } }
|
|
1498
1599
|
}
|
|
1499
1600
|
},
|
|
1500
|
-
name:
|
|
1501
|
-
valueName:
|
|
1502
|
-
|
|
1503
|
-
units: defaultUnits.filter((unit) => unit !== "%")
|
|
1601
|
+
name: __8("Blur", "elementor"),
|
|
1602
|
+
valueName: __8("Radius", "elementor"),
|
|
1603
|
+
units: lengthUnits.filter((unit) => unit !== "%")
|
|
1504
1604
|
},
|
|
1505
1605
|
brightness: {
|
|
1506
|
-
defaultValue: {
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1606
|
+
defaultValue: {
|
|
1607
|
+
$$type: "css-filter-func",
|
|
1608
|
+
value: {
|
|
1609
|
+
func: { $$type: "string", value: "brightness" },
|
|
1610
|
+
args: { $$type: "size", value: { size: 100, unit: "%" } }
|
|
1611
|
+
}
|
|
1612
|
+
},
|
|
1613
|
+
name: __8("Brightness", "elementor"),
|
|
1614
|
+
valueName: __8("Amount", "elementor"),
|
|
1510
1615
|
units: ["%"]
|
|
1511
1616
|
},
|
|
1512
1617
|
contrast: {
|
|
1513
|
-
defaultValue: {
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1618
|
+
defaultValue: {
|
|
1619
|
+
$$type: "css-filter-func",
|
|
1620
|
+
value: {
|
|
1621
|
+
func: { $$type: "string", value: "contrast" },
|
|
1622
|
+
args: { $$type: "size", value: { size: 100, unit: "%" } }
|
|
1623
|
+
}
|
|
1624
|
+
},
|
|
1625
|
+
name: __8("Contrast", "elementor"),
|
|
1626
|
+
valueName: __8("Amount", "elementor"),
|
|
1517
1627
|
units: ["%"]
|
|
1518
1628
|
},
|
|
1519
1629
|
"hue-rotate": {
|
|
1520
|
-
defaultValue: {
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1630
|
+
defaultValue: {
|
|
1631
|
+
$$type: "css-filter-func",
|
|
1632
|
+
value: {
|
|
1633
|
+
func: { $$type: "string", value: "hue-rotate" },
|
|
1634
|
+
args: { $$type: "size", value: { size: 0, unit: "deg" } }
|
|
1635
|
+
}
|
|
1636
|
+
},
|
|
1637
|
+
name: __8("Hue Rotate", "elementor"),
|
|
1638
|
+
valueName: __8("Angle", "elementor"),
|
|
1524
1639
|
units: ["deg", "rad", "grad", "turn"]
|
|
1525
1640
|
},
|
|
1526
1641
|
saturate: {
|
|
1527
|
-
defaultValue: {
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1642
|
+
defaultValue: {
|
|
1643
|
+
$$type: "css-filter-func",
|
|
1644
|
+
value: {
|
|
1645
|
+
func: { $$type: "string", value: "saturate" },
|
|
1646
|
+
args: { $$type: "size", value: { size: 100, unit: "%" } }
|
|
1647
|
+
}
|
|
1648
|
+
},
|
|
1649
|
+
name: __8("Saturate", "elementor"),
|
|
1650
|
+
valueName: __8("Amount", "elementor"),
|
|
1531
1651
|
units: ["%"]
|
|
1532
1652
|
},
|
|
1533
1653
|
grayscale: {
|
|
1534
|
-
defaultValue: {
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1654
|
+
defaultValue: {
|
|
1655
|
+
$$type: "css-filter-func",
|
|
1656
|
+
value: {
|
|
1657
|
+
func: { $$type: "string", value: "grayscale" },
|
|
1658
|
+
args: { $$type: "size", value: { size: 0, unit: "%" } }
|
|
1659
|
+
}
|
|
1660
|
+
},
|
|
1661
|
+
name: __8("Grayscale", "elementor"),
|
|
1662
|
+
valueName: __8("Amount", "elementor"),
|
|
1538
1663
|
units: ["%"]
|
|
1539
1664
|
},
|
|
1540
1665
|
invert: {
|
|
1541
|
-
defaultValue: {
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1666
|
+
defaultValue: {
|
|
1667
|
+
$$type: "css-filter-func",
|
|
1668
|
+
value: {
|
|
1669
|
+
func: { $$type: "string", value: "invert" },
|
|
1670
|
+
args: { $$type: "size", value: { size: 0, unit: "%" } }
|
|
1671
|
+
}
|
|
1672
|
+
},
|
|
1673
|
+
name: __8("Invert", "elementor"),
|
|
1674
|
+
valueName: __8("Amount", "elementor"),
|
|
1545
1675
|
units: ["%"]
|
|
1546
1676
|
},
|
|
1547
1677
|
sepia: {
|
|
1548
|
-
defaultValue: {
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1678
|
+
defaultValue: {
|
|
1679
|
+
$$type: "css-filter-func",
|
|
1680
|
+
value: {
|
|
1681
|
+
func: { $$type: "string", value: "sepia" },
|
|
1682
|
+
args: { $$type: "size", value: { size: 0, unit: "%" } }
|
|
1683
|
+
}
|
|
1684
|
+
},
|
|
1685
|
+
name: __8("Sepia", "elementor"),
|
|
1686
|
+
valueName: __8("Amount", "elementor"),
|
|
1552
1687
|
units: ["%"]
|
|
1688
|
+
},
|
|
1689
|
+
"drop-shadow": {
|
|
1690
|
+
defaultValue: {
|
|
1691
|
+
$$type: "css-filter-func",
|
|
1692
|
+
value: {
|
|
1693
|
+
func: { $$type: "string", value: "drop-shadow" },
|
|
1694
|
+
args: {
|
|
1695
|
+
$$type: "drop-shadow",
|
|
1696
|
+
value: {
|
|
1697
|
+
xAxis: { $$type: "size", value: { size: 0, unit: "px" } },
|
|
1698
|
+
yAxis: { $$type: "size", value: { size: 0, unit: "px" } },
|
|
1699
|
+
blur: { $$type: "size", value: { size: 10, unit: "px" } },
|
|
1700
|
+
color: { $$type: "color", value: "rgba(0, 0, 0, 1)" }
|
|
1701
|
+
}
|
|
1702
|
+
}
|
|
1703
|
+
}
|
|
1704
|
+
},
|
|
1705
|
+
name: __8("Drop shadow", "elementor"),
|
|
1706
|
+
valueName: __8("Drop-shadow", "elementor"),
|
|
1707
|
+
units: lengthUnits.filter((unit) => unit !== "%")
|
|
1553
1708
|
}
|
|
1554
1709
|
};
|
|
1555
1710
|
var filterKeys = Object.keys(filterConfig);
|
|
@@ -1557,7 +1712,7 @@ var isSingleSize = (key) => {
|
|
|
1557
1712
|
return !["drop-shadow"].includes(key);
|
|
1558
1713
|
};
|
|
1559
1714
|
var FilterRepeaterControl = createControl(({ filterPropName = "filter" }) => {
|
|
1560
|
-
const [propUtil, label] = filterPropName === "backdrop-filter" ? [backdropFilterPropTypeUtil,
|
|
1715
|
+
const [propUtil, label] = filterPropName === "backdrop-filter" ? [backdropFilterPropTypeUtil, __8("Backdrop Filters", "elementor")] : [filterPropTypeUtil, __8("Filters", "elementor")];
|
|
1561
1716
|
const { propType, value: filterValues, setValue, disabled } = useBoundProp(propUtil);
|
|
1562
1717
|
return /* @__PURE__ */ React30.createElement(PropProvider, { propType, value: filterValues, setValue }, /* @__PURE__ */ React30.createElement(
|
|
1563
1718
|
Repeater,
|
|
@@ -1572,24 +1727,20 @@ var FilterRepeaterControl = createControl(({ filterPropName = "filter" }) => {
|
|
|
1572
1727
|
Icon: ItemIcon2,
|
|
1573
1728
|
Label: ItemLabel2,
|
|
1574
1729
|
Content: ItemContent2,
|
|
1575
|
-
initialValues:
|
|
1576
|
-
$$type: DEFAULT_FILTER_KEY,
|
|
1577
|
-
value: filterConfig[DEFAULT_FILTER_KEY].defaultValue
|
|
1578
|
-
}
|
|
1730
|
+
initialValues: filterConfig[DEFAULT_FILTER].defaultValue
|
|
1579
1731
|
}
|
|
1580
1732
|
}
|
|
1581
1733
|
));
|
|
1582
1734
|
});
|
|
1583
1735
|
var ItemIcon2 = () => /* @__PURE__ */ React30.createElement(React30.Fragment, null);
|
|
1584
1736
|
var ItemLabel2 = ({ value }) => {
|
|
1585
|
-
return isSingleSize(value
|
|
1737
|
+
return isSingleSize(value.value.func.value ?? "") ? /* @__PURE__ */ React30.createElement(SingleSizeItemLabel, { value }) : /* @__PURE__ */ React30.createElement(DropShadowItemLabel, { value });
|
|
1586
1738
|
};
|
|
1587
1739
|
var SingleSizeItemLabel = ({ value }) => {
|
|
1588
|
-
const {
|
|
1589
|
-
const
|
|
1590
|
-
const
|
|
1591
|
-
const
|
|
1592
|
-
const label = /* @__PURE__ */ React30.createElement(Box4, { component: "span", style: { textTransform: "capitalize" } }, value.$$type, ":");
|
|
1740
|
+
const { func, args } = value.value;
|
|
1741
|
+
const defaultUnit = filterConfig[func.value ?? ""].defaultValue.value.args.value.unit ?? lengthUnits[0];
|
|
1742
|
+
const { unit, size } = args.value ?? { unit: defaultUnit, size: 0 };
|
|
1743
|
+
const label = /* @__PURE__ */ React30.createElement(Box4, { component: "span", style: { textTransform: "capitalize" } }, func.value ?? "", ":");
|
|
1593
1744
|
return /* @__PURE__ */ React30.createElement(Box4, { component: "span" }, label, unit !== "custom" ? ` ${size ?? 0}${unit ?? defaultUnit}` : size);
|
|
1594
1745
|
};
|
|
1595
1746
|
var ItemContent2 = ({
|
|
@@ -1597,41 +1748,45 @@ var ItemContent2 = ({
|
|
|
1597
1748
|
collectionPropUtil,
|
|
1598
1749
|
anchorEl
|
|
1599
1750
|
}) => {
|
|
1600
|
-
const { value: filterValues
|
|
1751
|
+
const { value: filterValues = [] } = useBoundProp(collectionPropUtil ?? filterPropTypeUtil);
|
|
1601
1752
|
const itemIndex = parseInt(bind, 10);
|
|
1602
1753
|
const item = filterValues?.[itemIndex];
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1754
|
+
return item ? /* @__PURE__ */ React30.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React30.createElement(PropContent, { item, anchorEl })) : null;
|
|
1755
|
+
};
|
|
1756
|
+
var PropContent = ({ item, anchorEl }) => {
|
|
1757
|
+
const propContext = useBoundProp(cssFilterFunctionPropUtil);
|
|
1758
|
+
const handleValueChange = (changedValue, options, meta) => {
|
|
1759
|
+
let newValue = structuredClone(changedValue);
|
|
1760
|
+
const newFuncName = newValue?.func.value ?? "";
|
|
1761
|
+
if (meta?.bind === "func") {
|
|
1762
|
+
newValue = structuredClone(filterConfig[newFuncName].defaultValue.value);
|
|
1763
|
+
}
|
|
1764
|
+
if (!newValue.args) {
|
|
1765
|
+
return;
|
|
1766
|
+
}
|
|
1767
|
+
propContext.setValue(newValue);
|
|
1768
|
+
};
|
|
1769
|
+
return /* @__PURE__ */ React30.createElement(PropProvider, { ...propContext, setValue: handleValueChange }, /* @__PURE__ */ React30.createElement(PopoverContent, { p: 1.5 }, /* @__PURE__ */ React30.createElement(PopoverGridContainer, null, /* @__PURE__ */ React30.createElement(Grid6, { item: true, xs: 6 }, /* @__PURE__ */ React30.createElement(ControlFormLabel, null, __8("Filter", "elementor"))), /* @__PURE__ */ React30.createElement(Grid6, { item: true, xs: 6 }, /* @__PURE__ */ React30.createElement(PropKeyProvider, { bind: "func" }, /* @__PURE__ */ React30.createElement(
|
|
1770
|
+
SelectControl,
|
|
1771
|
+
{
|
|
1772
|
+
options: filterKeys.map((filterKey) => ({
|
|
1773
|
+
label: filterConfig[filterKey].name,
|
|
1774
|
+
value: filterKey
|
|
1775
|
+
}))
|
|
1776
|
+
}
|
|
1777
|
+
)))), /* @__PURE__ */ React30.createElement(PropKeyProvider, { bind: "args" }, /* @__PURE__ */ React30.createElement(Content2, { filterType: item?.value.func, anchorEl }))));
|
|
1623
1778
|
};
|
|
1624
1779
|
var Content2 = ({ filterType, anchorEl }) => {
|
|
1625
|
-
const
|
|
1626
|
-
|
|
1780
|
+
const filterName = filterType?.value || DEFAULT_FILTER;
|
|
1781
|
+
const filterItemConfig = filterConfig[filterName];
|
|
1782
|
+
const { units: units2 = [] } = filterItemConfig;
|
|
1783
|
+
return isSingleSize(filterName) ? /* @__PURE__ */ React30.createElement(SingleSizeItemContent, { filterType: filterName }) : /* @__PURE__ */ React30.createElement(DropShadowItemContent, { units: units2, anchorEl });
|
|
1627
1784
|
};
|
|
1628
1785
|
var SingleSizeItemContent = ({ filterType }) => {
|
|
1629
|
-
const {
|
|
1630
|
-
const
|
|
1631
|
-
const
|
|
1632
|
-
|
|
1633
|
-
const defaultUnit = defaultValue[$$type].value.unit;
|
|
1634
|
-
return /* @__PURE__ */ React30.createElement(PropProvider, { ...context }, /* @__PURE__ */ React30.createElement(PropKeyProvider, { bind: $$type }, /* @__PURE__ */ React30.createElement(PopoverGridContainer, { ref: rowRef }, /* @__PURE__ */ React30.createElement(Grid6, { item: true, xs: 6 }, /* @__PURE__ */ React30.createElement(ControlLabel, null, valueName)), /* @__PURE__ */ React30.createElement(Grid6, { item: true, xs: 6 }, /* @__PURE__ */ React30.createElement(SizeControl, { anchorRef: rowRef, units: units2, defaultUnit })))));
|
|
1786
|
+
const { valueName, defaultValue, units: units2 } = filterConfig[filterType];
|
|
1787
|
+
const rowRef = useRef6(null);
|
|
1788
|
+
const defaultUnit = defaultValue.value.args.value.unit;
|
|
1789
|
+
return /* @__PURE__ */ React30.createElement(PopoverGridContainer, { ref: rowRef }, /* @__PURE__ */ React30.createElement(Grid6, { item: true, xs: 6 }, /* @__PURE__ */ React30.createElement(ControlFormLabel, null, valueName)), /* @__PURE__ */ React30.createElement(Grid6, { item: true, xs: 6 }, /* @__PURE__ */ React30.createElement(SizeControl, { anchorRef: rowRef, units: units2, defaultUnit })));
|
|
1635
1790
|
};
|
|
1636
1791
|
|
|
1637
1792
|
// src/controls/toggle-control.tsx
|
|
@@ -1640,13 +1795,13 @@ import { stringPropTypeUtil as stringPropTypeUtil4 } from "@elementor/editor-pro
|
|
|
1640
1795
|
|
|
1641
1796
|
// src/components/control-toggle-button-group.tsx
|
|
1642
1797
|
import * as React32 from "react";
|
|
1643
|
-
import { useEffect as
|
|
1798
|
+
import { useEffect as useEffect5, useMemo as useMemo2, useRef as useRef7, useState as useState6 } from "react";
|
|
1644
1799
|
import { ChevronDownIcon } from "@elementor/icons";
|
|
1645
1800
|
import {
|
|
1646
1801
|
ListItemText,
|
|
1647
1802
|
Menu as Menu2,
|
|
1648
1803
|
MenuItem,
|
|
1649
|
-
styled as
|
|
1804
|
+
styled as styled4,
|
|
1650
1805
|
ToggleButton,
|
|
1651
1806
|
ToggleButtonGroup,
|
|
1652
1807
|
Typography as Typography3,
|
|
@@ -1665,7 +1820,7 @@ var ConditionalTooltip = ({
|
|
|
1665
1820
|
};
|
|
1666
1821
|
|
|
1667
1822
|
// src/components/control-toggle-button-group.tsx
|
|
1668
|
-
var StyledToggleButtonGroup =
|
|
1823
|
+
var StyledToggleButtonGroup = styled4(ToggleButtonGroup)`
|
|
1669
1824
|
${({ justify }) => `justify-content: ${justify};`}
|
|
1670
1825
|
button:not( :last-of-type ) {
|
|
1671
1826
|
border-start-end-radius: 0;
|
|
@@ -1680,6 +1835,18 @@ var StyledToggleButtonGroup = styled3(ToggleButtonGroup)`
|
|
|
1680
1835
|
border-end-end-radius: 8px;
|
|
1681
1836
|
}
|
|
1682
1837
|
`;
|
|
1838
|
+
var StyledToggleButton = styled4(ToggleButton, {
|
|
1839
|
+
shouldForwardProp: (prop) => prop !== "isPlaceholder"
|
|
1840
|
+
})`
|
|
1841
|
+
${({ theme, isPlaceholder }) => isPlaceholder && `
|
|
1842
|
+
color: ${theme.palette.text.tertiary};
|
|
1843
|
+
background-color: ${theme.palette.mode === "dark" ? "rgba(255,255,255,0.04)" : "rgba(0,0,0,0.02)"};
|
|
1844
|
+
|
|
1845
|
+
&:hover {
|
|
1846
|
+
background-color: ${theme.palette.mode === "dark" ? "rgba(255,255,255,0.08)" : "rgba(0,0,0,0.04)"};
|
|
1847
|
+
}
|
|
1848
|
+
`}
|
|
1849
|
+
`;
|
|
1683
1850
|
var ControlToggleButtonGroup = ({
|
|
1684
1851
|
justify = "end",
|
|
1685
1852
|
size = "tiny",
|
|
@@ -1689,12 +1856,14 @@ var ControlToggleButtonGroup = ({
|
|
|
1689
1856
|
maxItems,
|
|
1690
1857
|
exclusive = false,
|
|
1691
1858
|
fullWidth = false,
|
|
1692
|
-
disabled
|
|
1859
|
+
disabled,
|
|
1860
|
+
placeholder
|
|
1693
1861
|
}) => {
|
|
1694
1862
|
const shouldSliceItems = exclusive && maxItems !== void 0 && items2.length > maxItems;
|
|
1695
1863
|
const menuItems = shouldSliceItems ? items2.slice(maxItems - 1) : [];
|
|
1696
1864
|
const fixedItems = shouldSliceItems ? items2.slice(0, maxItems - 1) : items2;
|
|
1697
|
-
const
|
|
1865
|
+
const theme = useTheme();
|
|
1866
|
+
const isRtl = "rtl" === theme.direction;
|
|
1698
1867
|
const handleChange = (_, newValue) => {
|
|
1699
1868
|
onChange(newValue);
|
|
1700
1869
|
};
|
|
@@ -1704,6 +1873,24 @@ var ControlToggleButtonGroup = ({
|
|
|
1704
1873
|
const templateColumnsSuffix = isOffLimits ? "auto" : "";
|
|
1705
1874
|
return `repeat(${itemsCount}, minmax(0, 25%)) ${templateColumnsSuffix}`;
|
|
1706
1875
|
}, [menuItems?.length, fixedItems.length]);
|
|
1876
|
+
const shouldShowExclusivePlaceholder = exclusive && (value === null || value === void 0 || value === "");
|
|
1877
|
+
const nonExclusiveSelectedValues = !exclusive && Array.isArray(value) ? value.map((v) => typeof v === "string" ? v : "").join(" ").trim().split(/\s+/).filter(Boolean) : [];
|
|
1878
|
+
const shouldShowNonExclusivePlaceholder = !exclusive && nonExclusiveSelectedValues.length === 0;
|
|
1879
|
+
const getPlaceholderArray = (placeholderValue) => {
|
|
1880
|
+
if (Array.isArray(placeholderValue)) {
|
|
1881
|
+
return placeholderValue.flatMap((p) => {
|
|
1882
|
+
if (typeof p === "string") {
|
|
1883
|
+
return p.trim().split(/\s+/).filter(Boolean);
|
|
1884
|
+
}
|
|
1885
|
+
return [];
|
|
1886
|
+
});
|
|
1887
|
+
}
|
|
1888
|
+
if (typeof placeholderValue === "string") {
|
|
1889
|
+
return placeholderValue.trim().split(/\s+/).filter(Boolean);
|
|
1890
|
+
}
|
|
1891
|
+
return [];
|
|
1892
|
+
};
|
|
1893
|
+
const placeholderArray = getPlaceholderArray(placeholder);
|
|
1707
1894
|
return /* @__PURE__ */ React32.createElement(ControlActions, null, /* @__PURE__ */ React32.createElement(
|
|
1708
1895
|
StyledToggleButtonGroup,
|
|
1709
1896
|
{
|
|
@@ -1719,15 +1906,28 @@ var ControlToggleButtonGroup = ({
|
|
|
1719
1906
|
width: `100%`
|
|
1720
1907
|
}
|
|
1721
1908
|
},
|
|
1722
|
-
fixedItems.map(({ label, value: buttonValue, renderContent:
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1909
|
+
fixedItems.map(({ label, value: buttonValue, renderContent: Content6, showTooltip }) => {
|
|
1910
|
+
const isPlaceholder = placeholderArray.length > 0 && placeholderArray.includes(buttonValue) && (shouldShowExclusivePlaceholder || shouldShowNonExclusivePlaceholder);
|
|
1911
|
+
return /* @__PURE__ */ React32.createElement(
|
|
1912
|
+
ConditionalTooltip,
|
|
1913
|
+
{
|
|
1914
|
+
key: buttonValue,
|
|
1915
|
+
label,
|
|
1916
|
+
showTooltip: showTooltip || false
|
|
1917
|
+
},
|
|
1918
|
+
/* @__PURE__ */ React32.createElement(
|
|
1919
|
+
StyledToggleButton,
|
|
1920
|
+
{
|
|
1921
|
+
value: buttonValue,
|
|
1922
|
+
"aria-label": label,
|
|
1923
|
+
size,
|
|
1924
|
+
fullWidth,
|
|
1925
|
+
isPlaceholder
|
|
1926
|
+
},
|
|
1927
|
+
/* @__PURE__ */ React32.createElement(Content6, { size })
|
|
1928
|
+
)
|
|
1929
|
+
);
|
|
1930
|
+
}),
|
|
1731
1931
|
menuItems.length && exclusive && /* @__PURE__ */ React32.createElement(
|
|
1732
1932
|
SplitButtonGroup,
|
|
1733
1933
|
{
|
|
@@ -1748,8 +1948,8 @@ var SplitButtonGroup = ({
|
|
|
1748
1948
|
value
|
|
1749
1949
|
}) => {
|
|
1750
1950
|
const previewButton = usePreviewButton(items2, value);
|
|
1751
|
-
const [isMenuOpen, setIsMenuOpen] =
|
|
1752
|
-
const menuButtonRef =
|
|
1951
|
+
const [isMenuOpen, setIsMenuOpen] = useState6(false);
|
|
1952
|
+
const menuButtonRef = useRef7(null);
|
|
1753
1953
|
const onMenuToggle = (ev) => {
|
|
1754
1954
|
setIsMenuOpen((prev) => !prev);
|
|
1755
1955
|
ev.preventDefault();
|
|
@@ -1818,10 +2018,10 @@ var SplitButtonGroup = ({
|
|
|
1818
2018
|
));
|
|
1819
2019
|
};
|
|
1820
2020
|
var usePreviewButton = (items2, value) => {
|
|
1821
|
-
const [previewButton, setPreviewButton] =
|
|
2021
|
+
const [previewButton, setPreviewButton] = useState6(
|
|
1822
2022
|
items2.find((item) => item.value === value) ?? items2[0]
|
|
1823
2023
|
);
|
|
1824
|
-
|
|
2024
|
+
useEffect5(() => {
|
|
1825
2025
|
const selectedButton = items2.find((item) => item.value === value);
|
|
1826
2026
|
if (selectedButton) {
|
|
1827
2027
|
setPreviewButton(selectedButton);
|
|
@@ -1851,13 +2051,14 @@ var ToggleControl = createControl(
|
|
|
1851
2051
|
items: options,
|
|
1852
2052
|
maxItems,
|
|
1853
2053
|
fullWidth,
|
|
1854
|
-
size
|
|
2054
|
+
size,
|
|
2055
|
+
placeholder
|
|
1855
2056
|
};
|
|
1856
2057
|
return exclusive ? /* @__PURE__ */ React33.createElement(
|
|
1857
2058
|
ControlToggleButtonGroup,
|
|
1858
2059
|
{
|
|
1859
2060
|
...toggleButtonGroupProps,
|
|
1860
|
-
value: value ??
|
|
2061
|
+
value: value ?? null,
|
|
1861
2062
|
onChange: setValue,
|
|
1862
2063
|
disabled,
|
|
1863
2064
|
exclusive: true
|
|
@@ -1866,7 +2067,7 @@ var ToggleControl = createControl(
|
|
|
1866
2067
|
ControlToggleButtonGroup,
|
|
1867
2068
|
{
|
|
1868
2069
|
...toggleButtonGroupProps,
|
|
1869
|
-
value:
|
|
2070
|
+
value: value?.split(" ") ?? [],
|
|
1870
2071
|
onChange: handleNonExclusiveToggle,
|
|
1871
2072
|
disabled,
|
|
1872
2073
|
exclusive: false
|
|
@@ -1878,7 +2079,7 @@ var ToggleControl = createControl(
|
|
|
1878
2079
|
// src/controls/number-control.tsx
|
|
1879
2080
|
import * as React34 from "react";
|
|
1880
2081
|
import { numberPropTypeUtil } from "@elementor/editor-props";
|
|
1881
|
-
import { TextField as TextField5 } from "@elementor/ui";
|
|
2082
|
+
import { InputAdornment as InputAdornment3, TextField as TextField5 } from "@elementor/ui";
|
|
1882
2083
|
var isEmptyOrNaN = (value) => value === null || value === void 0 || value === "" || Number.isNaN(Number(value));
|
|
1883
2084
|
var RESTRICTED_INPUT_KEYS2 = ["e", "E", "+", "-"];
|
|
1884
2085
|
var NumberControl = createControl(
|
|
@@ -1887,7 +2088,8 @@ var NumberControl = createControl(
|
|
|
1887
2088
|
max = Number.MAX_VALUE,
|
|
1888
2089
|
min = -Number.MAX_VALUE,
|
|
1889
2090
|
step = 1,
|
|
1890
|
-
shouldForceInt = false
|
|
2091
|
+
shouldForceInt = false,
|
|
2092
|
+
startIcon
|
|
1891
2093
|
}) => {
|
|
1892
2094
|
const { value, setValue, placeholder, disabled } = useBoundProp(numberPropTypeUtil);
|
|
1893
2095
|
const handleChange = (event) => {
|
|
@@ -1910,6 +2112,9 @@ var NumberControl = createControl(
|
|
|
1910
2112
|
onChange: handleChange,
|
|
1911
2113
|
placeholder: labelPlaceholder ?? (placeholder ? String(placeholder) : ""),
|
|
1912
2114
|
inputProps: { step },
|
|
2115
|
+
InputProps: {
|
|
2116
|
+
startAdornment: startIcon ? /* @__PURE__ */ React34.createElement(InputAdornment3, { position: "start", disabled }, startIcon) : void 0
|
|
2117
|
+
},
|
|
1913
2118
|
onKeyDown: (event) => {
|
|
1914
2119
|
if (RESTRICTED_INPUT_KEYS2.includes(event.key)) {
|
|
1915
2120
|
event.preventDefault();
|
|
@@ -1921,12 +2126,20 @@ var NumberControl = createControl(
|
|
|
1921
2126
|
);
|
|
1922
2127
|
|
|
1923
2128
|
// src/controls/equal-unequal-sizes-control.tsx
|
|
1924
|
-
import * as
|
|
1925
|
-
import { useId as useId2, useRef as
|
|
1926
|
-
import { sizePropTypeUtil as
|
|
1927
|
-
import { isExperimentActive as isExperimentActive2 } from "@elementor/editor-v1-adapters";
|
|
2129
|
+
import * as React36 from "react";
|
|
2130
|
+
import { useId as useId2, useRef as useRef8 } from "react";
|
|
2131
|
+
import { sizePropTypeUtil as sizePropTypeUtil3 } from "@elementor/editor-props";
|
|
1928
2132
|
import { bindPopover as bindPopover3, bindToggle, Grid as Grid7, Popover as Popover3, Stack as Stack7, ToggleButton as ToggleButton2, Tooltip as Tooltip3, usePopupState as usePopupState4 } from "@elementor/ui";
|
|
1929
|
-
import { __ as
|
|
2133
|
+
import { __ as __9 } from "@wordpress/i18n";
|
|
2134
|
+
|
|
2135
|
+
// src/components/control-label.tsx
|
|
2136
|
+
import * as React35 from "react";
|
|
2137
|
+
import { Stack as Stack6 } from "@elementor/ui";
|
|
2138
|
+
var ControlLabel = ({ children }) => {
|
|
2139
|
+
return /* @__PURE__ */ React35.createElement(Stack6, { direction: "row", alignItems: "center", justifyItems: "start", gap: 0.25 }, /* @__PURE__ */ React35.createElement(ControlFormLabel, null, children), /* @__PURE__ */ React35.createElement(ControlAdornments, null));
|
|
2140
|
+
};
|
|
2141
|
+
|
|
2142
|
+
// src/controls/equal-unequal-sizes-control.tsx
|
|
1930
2143
|
var isEqualSizes = (propValue, items2) => {
|
|
1931
2144
|
const values = Object.values(propValue);
|
|
1932
2145
|
if (values.length !== items2.length) {
|
|
@@ -1952,14 +2165,14 @@ function EqualUnequalSizesControl({
|
|
|
1952
2165
|
setValue: setMultiSizeValue,
|
|
1953
2166
|
disabled: multiSizeDisabled
|
|
1954
2167
|
} = useBoundProp(multiSizePropTypeUtil);
|
|
1955
|
-
const { value: sizeValue, setValue: setSizeValue } = useBoundProp(
|
|
1956
|
-
const rowRefs = [
|
|
2168
|
+
const { value: sizeValue, setValue: setSizeValue } = useBoundProp(sizePropTypeUtil3);
|
|
2169
|
+
const rowRefs = [useRef8(null), useRef8(null)];
|
|
1957
2170
|
const splitEqualValue = () => {
|
|
1958
2171
|
if (!sizeValue) {
|
|
1959
2172
|
return null;
|
|
1960
2173
|
}
|
|
1961
2174
|
return items2.reduce(
|
|
1962
|
-
(acc, { bind }) => ({ ...acc, [bind]:
|
|
2175
|
+
(acc, { bind }) => ({ ...acc, [bind]: sizePropTypeUtil3.create(sizeValue) }),
|
|
1963
2176
|
{}
|
|
1964
2177
|
);
|
|
1965
2178
|
};
|
|
@@ -1980,15 +2193,15 @@ function EqualUnequalSizesControl({
|
|
|
1980
2193
|
}
|
|
1981
2194
|
return splitEqualValue() ?? null;
|
|
1982
2195
|
};
|
|
1983
|
-
const isShowingGeneralIndicator = !
|
|
2196
|
+
const isShowingGeneralIndicator = !popupState.isOpen;
|
|
1984
2197
|
const isMixed = !!multiSizeValue;
|
|
1985
|
-
return /* @__PURE__ */
|
|
2198
|
+
return /* @__PURE__ */ React36.createElement(React36.Fragment, null, /* @__PURE__ */ React36.createElement(Grid7, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap", ref: rowRefs[0] }, /* @__PURE__ */ React36.createElement(Grid7, { item: true, xs: 6 }, !isShowingGeneralIndicator ? /* @__PURE__ */ React36.createElement(ControlFormLabel, null, label) : /* @__PURE__ */ React36.createElement(ControlLabel, null, label)), /* @__PURE__ */ React36.createElement(Grid7, { item: true, xs: 6 }, /* @__PURE__ */ React36.createElement(Stack7, { direction: "row", alignItems: "center", gap: 1 }, /* @__PURE__ */ React36.createElement(
|
|
1986
2199
|
SizeControl,
|
|
1987
2200
|
{
|
|
1988
|
-
placeholder: isMixed ?
|
|
2201
|
+
placeholder: isMixed ? __9("Mixed", "elementor") : void 0,
|
|
1989
2202
|
anchorRef: rowRefs[0]
|
|
1990
2203
|
}
|
|
1991
|
-
), /* @__PURE__ */
|
|
2204
|
+
), /* @__PURE__ */ React36.createElement(Tooltip3, { title: tooltipLabel, placement: "top" }, /* @__PURE__ */ React36.createElement(
|
|
1992
2205
|
ToggleButton2,
|
|
1993
2206
|
{
|
|
1994
2207
|
size: "tiny",
|
|
@@ -1999,7 +2212,7 @@ function EqualUnequalSizesControl({
|
|
|
1999
2212
|
"aria-label": tooltipLabel
|
|
2000
2213
|
},
|
|
2001
2214
|
icon
|
|
2002
|
-
))))), /* @__PURE__ */
|
|
2215
|
+
))))), /* @__PURE__ */ React36.createElement(
|
|
2003
2216
|
Popover3,
|
|
2004
2217
|
{
|
|
2005
2218
|
disablePortal: true,
|
|
@@ -2017,7 +2230,7 @@ function EqualUnequalSizesControl({
|
|
|
2017
2230
|
paper: { sx: { mt: 0.5, width: rowRefs[0].current?.getBoundingClientRect().width } }
|
|
2018
2231
|
}
|
|
2019
2232
|
},
|
|
2020
|
-
/* @__PURE__ */
|
|
2233
|
+
/* @__PURE__ */ React36.createElement(
|
|
2021
2234
|
PropProvider,
|
|
2022
2235
|
{
|
|
2023
2236
|
propType: multiSizePropType,
|
|
@@ -2025,31 +2238,29 @@ function EqualUnequalSizesControl({
|
|
|
2025
2238
|
setValue: setNestedProp,
|
|
2026
2239
|
isDisabled: () => multiSizeDisabled
|
|
2027
2240
|
},
|
|
2028
|
-
/* @__PURE__ */
|
|
2241
|
+
/* @__PURE__ */ React36.createElement(PopoverContent, { p: 1.5 }, /* @__PURE__ */ React36.createElement(PopoverGridContainer, { ref: rowRefs[1] }, /* @__PURE__ */ React36.createElement(MultiSizeValueControl, { item: items2[0], rowRef: rowRefs[1] }), /* @__PURE__ */ React36.createElement(MultiSizeValueControl, { item: items2[1], rowRef: rowRefs[1] })), /* @__PURE__ */ React36.createElement(PopoverGridContainer, { ref: rowRefs[2] }, /* @__PURE__ */ React36.createElement(MultiSizeValueControl, { item: items2[2], rowRef: rowRefs[2] }), /* @__PURE__ */ React36.createElement(MultiSizeValueControl, { item: items2[3], rowRef: rowRefs[2] })))
|
|
2029
2242
|
)
|
|
2030
2243
|
));
|
|
2031
2244
|
}
|
|
2032
2245
|
var MultiSizeValueControl = ({ item, rowRef }) => {
|
|
2033
|
-
|
|
2034
|
-
return /* @__PURE__ */ React35.createElement(PropKeyProvider, { bind: item.bind }, /* @__PURE__ */ React35.createElement(Grid7, { item: true, xs: 6 }, /* @__PURE__ */ React35.createElement(Grid7, { container: true, gap: 0.75, alignItems: "center" }, /* @__PURE__ */ React35.createElement(Grid7, { item: true, xs: 12 }, isUsingNestedProps ? /* @__PURE__ */ React35.createElement(ControlLabel, null, item.label) : /* @__PURE__ */ React35.createElement(ControlFormLabel, null, item.label)), /* @__PURE__ */ React35.createElement(Grid7, { item: true, xs: 12 }, /* @__PURE__ */ React35.createElement(SizeControl, { startIcon: item.icon, anchorRef: rowRef })))));
|
|
2246
|
+
return /* @__PURE__ */ React36.createElement(PropKeyProvider, { bind: item.bind }, /* @__PURE__ */ React36.createElement(Grid7, { item: true, xs: 6 }, /* @__PURE__ */ React36.createElement(Grid7, { container: true, gap: 0.75, alignItems: "center" }, /* @__PURE__ */ React36.createElement(Grid7, { item: true, xs: 12 }, /* @__PURE__ */ React36.createElement(ControlLabel, null, item.label)), /* @__PURE__ */ React36.createElement(Grid7, { item: true, xs: 12 }, /* @__PURE__ */ React36.createElement(SizeControl, { startIcon: item.icon, anchorRef: rowRef })))));
|
|
2035
2247
|
};
|
|
2036
2248
|
|
|
2037
2249
|
// src/controls/linked-dimensions-control.tsx
|
|
2038
|
-
import * as
|
|
2039
|
-
import { useRef as
|
|
2040
|
-
import { dimensionsPropTypeUtil, sizePropTypeUtil as
|
|
2041
|
-
import { isExperimentActive as isExperimentActive3 } from "@elementor/editor-v1-adapters";
|
|
2250
|
+
import * as React37 from "react";
|
|
2251
|
+
import { useRef as useRef9 } from "react";
|
|
2252
|
+
import { dimensionsPropTypeUtil, sizePropTypeUtil as sizePropTypeUtil4 } from "@elementor/editor-props";
|
|
2042
2253
|
import { DetachIcon, LinkIcon, SideBottomIcon, SideLeftIcon, SideRightIcon, SideTopIcon } from "@elementor/icons";
|
|
2043
2254
|
import { Grid as Grid8, Stack as Stack8, ToggleButton as ToggleButton3, Tooltip as Tooltip4 } from "@elementor/ui";
|
|
2044
|
-
import { __ as
|
|
2255
|
+
import { __ as __10 } from "@wordpress/i18n";
|
|
2045
2256
|
var LinkedDimensionsControl = createControl(
|
|
2046
2257
|
({
|
|
2047
2258
|
label,
|
|
2048
2259
|
isSiteRtl = false,
|
|
2049
2260
|
extendedOptions
|
|
2050
2261
|
}) => {
|
|
2051
|
-
const { value: sizeValue, setValue: setSizeValue, disabled: sizeDisabled } = useBoundProp(
|
|
2052
|
-
const gridRowRefs = [
|
|
2262
|
+
const { value: sizeValue, setValue: setSizeValue, disabled: sizeDisabled } = useBoundProp(sizePropTypeUtil4);
|
|
2263
|
+
const gridRowRefs = [useRef9(null), useRef9(null)];
|
|
2053
2264
|
const {
|
|
2054
2265
|
value: dimensionsValue,
|
|
2055
2266
|
setValue: setDimensionsValue,
|
|
@@ -2057,13 +2268,12 @@ var LinkedDimensionsControl = createControl(
|
|
|
2057
2268
|
disabled: dimensionsDisabled
|
|
2058
2269
|
} = useBoundProp(dimensionsPropTypeUtil);
|
|
2059
2270
|
const isLinked = !dimensionsValue && !sizeValue ? true : !!sizeValue;
|
|
2060
|
-
const isUsingNestedProps = isExperimentActive3("e_v_3_30");
|
|
2061
2271
|
const onLinkToggle = () => {
|
|
2062
2272
|
if (!isLinked) {
|
|
2063
2273
|
setSizeValue(dimensionsValue["block-start"]?.value ?? null);
|
|
2064
2274
|
return;
|
|
2065
2275
|
}
|
|
2066
|
-
const value = sizeValue ?
|
|
2276
|
+
const value = sizeValue ? sizePropTypeUtil4.create(sizeValue) : null;
|
|
2067
2277
|
setDimensionsValue({
|
|
2068
2278
|
"block-start": value,
|
|
2069
2279
|
"block-end": value,
|
|
@@ -2073,10 +2283,10 @@ var LinkedDimensionsControl = createControl(
|
|
|
2073
2283
|
};
|
|
2074
2284
|
const tooltipLabel = label.toLowerCase();
|
|
2075
2285
|
const LinkedIcon = isLinked ? LinkIcon : DetachIcon;
|
|
2076
|
-
const linkedLabel =
|
|
2077
|
-
const unlinkedLabel =
|
|
2286
|
+
const linkedLabel = __10("Link %s", "elementor").replace("%s", tooltipLabel);
|
|
2287
|
+
const unlinkedLabel = __10("Unlink %s", "elementor").replace("%s", tooltipLabel);
|
|
2078
2288
|
const disabled = sizeDisabled || dimensionsDisabled;
|
|
2079
|
-
return /* @__PURE__ */
|
|
2289
|
+
return /* @__PURE__ */ React37.createElement(
|
|
2080
2290
|
PropProvider,
|
|
2081
2291
|
{
|
|
2082
2292
|
propType,
|
|
@@ -2084,7 +2294,7 @@ var LinkedDimensionsControl = createControl(
|
|
|
2084
2294
|
setValue: setDimensionsValue,
|
|
2085
2295
|
isDisabled: () => disabled
|
|
2086
2296
|
},
|
|
2087
|
-
/* @__PURE__ */
|
|
2297
|
+
/* @__PURE__ */ React37.createElement(Stack8, { direction: "row", gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React37.createElement(ControlFormLabel, null, label), /* @__PURE__ */ React37.createElement(Tooltip4, { title: isLinked ? unlinkedLabel : linkedLabel, placement: "top" }, /* @__PURE__ */ React37.createElement(
|
|
2088
2298
|
ToggleButton3,
|
|
2089
2299
|
{
|
|
2090
2300
|
"aria-label": isLinked ? unlinkedLabel : linkedLabel,
|
|
@@ -2095,9 +2305,9 @@ var LinkedDimensionsControl = createControl(
|
|
|
2095
2305
|
onChange: onLinkToggle,
|
|
2096
2306
|
disabled
|
|
2097
2307
|
},
|
|
2098
|
-
/* @__PURE__ */
|
|
2308
|
+
/* @__PURE__ */ React37.createElement(LinkedIcon, { fontSize: "tiny" })
|
|
2099
2309
|
))),
|
|
2100
|
-
|
|
2310
|
+
getCssDimensionProps(isSiteRtl).map((row, index) => /* @__PURE__ */ React37.createElement(Stack8, { direction: "row", gap: 2, flexWrap: "nowrap", key: index, ref: gridRowRefs[index] }, row.map(({ icon, ...props }) => /* @__PURE__ */ React37.createElement(Grid8, { container: true, gap: 0.75, alignItems: "center", key: props.bind }, /* @__PURE__ */ React37.createElement(Grid8, { item: true, xs: 12 }, /* @__PURE__ */ React37.createElement(Label, { ...props })), /* @__PURE__ */ React37.createElement(Grid8, { item: true, xs: 12 }, /* @__PURE__ */ React37.createElement(
|
|
2101
2311
|
Control3,
|
|
2102
2312
|
{
|
|
2103
2313
|
bind: props.bind,
|
|
@@ -2118,94 +2328,89 @@ var Control3 = ({
|
|
|
2118
2328
|
anchorRef
|
|
2119
2329
|
}) => {
|
|
2120
2330
|
if (isLinked) {
|
|
2121
|
-
return /* @__PURE__ */
|
|
2331
|
+
return /* @__PURE__ */ React37.createElement(SizeControl, { startIcon, extendedOptions, anchorRef });
|
|
2122
2332
|
}
|
|
2123
|
-
return /* @__PURE__ */
|
|
2333
|
+
return /* @__PURE__ */ React37.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React37.createElement(SizeControl, { startIcon, extendedOptions, anchorRef }));
|
|
2124
2334
|
};
|
|
2125
2335
|
var Label = ({ label, bind }) => {
|
|
2126
|
-
|
|
2127
|
-
if (!isUsingNestedProps) {
|
|
2128
|
-
return /* @__PURE__ */ React36.createElement(ControlFormLabel, null, label);
|
|
2129
|
-
}
|
|
2130
|
-
return /* @__PURE__ */ React36.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React36.createElement(ControlLabel, null, label));
|
|
2336
|
+
return /* @__PURE__ */ React37.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React37.createElement(ControlLabel, null, label));
|
|
2131
2337
|
};
|
|
2132
|
-
function
|
|
2338
|
+
function getCssDimensionProps(isSiteRtl) {
|
|
2133
2339
|
return [
|
|
2134
2340
|
[
|
|
2135
2341
|
{
|
|
2136
2342
|
bind: "block-start",
|
|
2137
|
-
label:
|
|
2138
|
-
icon: /* @__PURE__ */
|
|
2343
|
+
label: __10("Top", "elementor"),
|
|
2344
|
+
icon: /* @__PURE__ */ React37.createElement(SideTopIcon, { fontSize: "tiny" })
|
|
2139
2345
|
},
|
|
2140
2346
|
{
|
|
2141
2347
|
bind: "inline-end",
|
|
2142
|
-
label: isSiteRtl ?
|
|
2143
|
-
icon: isSiteRtl ? /* @__PURE__ */
|
|
2348
|
+
label: isSiteRtl ? __10("Left", "elementor") : __10("Right", "elementor"),
|
|
2349
|
+
icon: isSiteRtl ? /* @__PURE__ */ React37.createElement(SideLeftIcon, { fontSize: "tiny" }) : /* @__PURE__ */ React37.createElement(SideRightIcon, { fontSize: "tiny" })
|
|
2144
2350
|
}
|
|
2145
2351
|
],
|
|
2146
2352
|
[
|
|
2147
2353
|
{
|
|
2148
2354
|
bind: "block-end",
|
|
2149
|
-
label:
|
|
2150
|
-
icon: /* @__PURE__ */
|
|
2355
|
+
label: __10("Bottom", "elementor"),
|
|
2356
|
+
icon: /* @__PURE__ */ React37.createElement(SideBottomIcon, { fontSize: "tiny" })
|
|
2151
2357
|
},
|
|
2152
2358
|
{
|
|
2153
2359
|
bind: "inline-start",
|
|
2154
|
-
label: isSiteRtl ?
|
|
2155
|
-
icon: isSiteRtl ? /* @__PURE__ */
|
|
2360
|
+
label: isSiteRtl ? __10("Right", "elementor") : __10("Left", "elementor"),
|
|
2361
|
+
icon: isSiteRtl ? /* @__PURE__ */ React37.createElement(SideRightIcon, { fontSize: "tiny" }) : /* @__PURE__ */ React37.createElement(SideLeftIcon, { fontSize: "tiny" })
|
|
2156
2362
|
}
|
|
2157
2363
|
]
|
|
2158
2364
|
];
|
|
2159
2365
|
}
|
|
2160
2366
|
|
|
2161
2367
|
// src/controls/font-family-control/font-family-control.tsx
|
|
2162
|
-
import * as
|
|
2368
|
+
import * as React39 from "react";
|
|
2163
2369
|
import { stringPropTypeUtil as stringPropTypeUtil5 } from "@elementor/editor-props";
|
|
2164
|
-
import { ChevronDownIcon as ChevronDownIcon2 } from "@elementor/icons";
|
|
2370
|
+
import { ChevronDownIcon as ChevronDownIcon2, TextIcon } from "@elementor/icons";
|
|
2165
2371
|
import { bindPopover as bindPopover4, bindTrigger as bindTrigger3, Popover as Popover4, UnstableTag as UnstableTag2, usePopupState as usePopupState5 } from "@elementor/ui";
|
|
2372
|
+
import { __ as __12 } from "@wordpress/i18n";
|
|
2166
2373
|
|
|
2167
|
-
// src/components/
|
|
2168
|
-
import * as
|
|
2169
|
-
import { useEffect as
|
|
2170
|
-
import { PopoverBody, PopoverHeader, PopoverMenuList, PopoverSearch } from "@elementor/editor-ui";
|
|
2171
|
-
import { TextIcon } from "@elementor/icons";
|
|
2374
|
+
// src/components/item-selector.tsx
|
|
2375
|
+
import * as React38 from "react";
|
|
2376
|
+
import { useCallback, useEffect as useEffect6, useState as useState7 } from "react";
|
|
2377
|
+
import { PopoverBody, PopoverHeader as PopoverHeader2, PopoverMenuList, PopoverSearch } from "@elementor/editor-ui";
|
|
2172
2378
|
import { Box as Box5, Divider as Divider2, Link, Stack as Stack9, Typography as Typography4 } from "@elementor/ui";
|
|
2173
2379
|
import { debounce } from "@elementor/utils";
|
|
2174
|
-
import { __ as
|
|
2175
|
-
|
|
2176
|
-
// src/controls/font-family-control/enqueue-font.tsx
|
|
2177
|
-
var enqueueFont = (fontFamily, context = "editor") => {
|
|
2178
|
-
const extendedWindow = window;
|
|
2179
|
-
return extendedWindow.elementor?.helpers?.enqueueFont?.(fontFamily, context) ?? null;
|
|
2180
|
-
};
|
|
2380
|
+
import { __ as __11 } from "@wordpress/i18n";
|
|
2181
2381
|
|
|
2182
|
-
// src/hooks/use-filtered-
|
|
2183
|
-
var
|
|
2184
|
-
return
|
|
2185
|
-
const
|
|
2186
|
-
(
|
|
2382
|
+
// src/hooks/use-filtered-items-list.ts
|
|
2383
|
+
var useFilteredItemsList = (itemsList, searchValue) => {
|
|
2384
|
+
return itemsList.reduce((acc, category) => {
|
|
2385
|
+
const filteredItems = category.items.filter(
|
|
2386
|
+
(item) => item.toLowerCase().includes(searchValue.toLowerCase())
|
|
2187
2387
|
);
|
|
2188
|
-
if (
|
|
2388
|
+
if (filteredItems.length) {
|
|
2189
2389
|
acc.push({ type: "category", value: category.label });
|
|
2190
|
-
|
|
2191
|
-
acc.push({ type: "
|
|
2390
|
+
filteredItems.forEach((item) => {
|
|
2391
|
+
acc.push({ type: "item", value: item });
|
|
2192
2392
|
});
|
|
2193
2393
|
}
|
|
2194
2394
|
return acc;
|
|
2195
2395
|
}, []);
|
|
2196
2396
|
};
|
|
2197
2397
|
|
|
2198
|
-
// src/components/
|
|
2199
|
-
var
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
onFontFamilyChange,
|
|
2398
|
+
// src/components/item-selector.tsx
|
|
2399
|
+
var ItemSelector = ({
|
|
2400
|
+
itemsList,
|
|
2401
|
+
selectedItem,
|
|
2402
|
+
onItemChange,
|
|
2204
2403
|
onClose,
|
|
2205
|
-
sectionWidth
|
|
2404
|
+
sectionWidth,
|
|
2405
|
+
title,
|
|
2406
|
+
itemStyle = () => ({}),
|
|
2407
|
+
onDebounce = () => {
|
|
2408
|
+
},
|
|
2409
|
+
icon
|
|
2206
2410
|
}) => {
|
|
2207
|
-
const [searchValue, setSearchValue] =
|
|
2208
|
-
const
|
|
2411
|
+
const [searchValue, setSearchValue] = useState7("");
|
|
2412
|
+
const filteredItemsList = useFilteredItemsList(itemsList, searchValue);
|
|
2413
|
+
const IconComponent = icon;
|
|
2209
2414
|
const handleSearch = (value) => {
|
|
2210
2415
|
setSearchValue(value);
|
|
2211
2416
|
};
|
|
@@ -2213,29 +2418,24 @@ var FontFamilySelector = ({
|
|
|
2213
2418
|
setSearchValue("");
|
|
2214
2419
|
onClose();
|
|
2215
2420
|
};
|
|
2216
|
-
return /* @__PURE__ */
|
|
2217
|
-
PopoverHeader,
|
|
2218
|
-
{
|
|
2219
|
-
title: __10("Font Family", "elementor"),
|
|
2220
|
-
onClose: handleClose,
|
|
2221
|
-
icon: /* @__PURE__ */ React37.createElement(TextIcon, { fontSize: SIZE2 })
|
|
2222
|
-
}
|
|
2223
|
-
), /* @__PURE__ */ React37.createElement(
|
|
2421
|
+
return /* @__PURE__ */ React38.createElement(PopoverBody, { width: sectionWidth }, /* @__PURE__ */ React38.createElement(PopoverHeader2, { title, onClose: handleClose, icon: /* @__PURE__ */ React38.createElement(IconComponent, { fontSize: "tiny" }) }), /* @__PURE__ */ React38.createElement(
|
|
2224
2422
|
PopoverSearch,
|
|
2225
2423
|
{
|
|
2226
2424
|
value: searchValue,
|
|
2227
2425
|
onSearch: handleSearch,
|
|
2228
|
-
placeholder:
|
|
2426
|
+
placeholder: __11("Search", "elementor")
|
|
2229
2427
|
}
|
|
2230
|
-
), /* @__PURE__ */
|
|
2231
|
-
|
|
2428
|
+
), /* @__PURE__ */ React38.createElement(Divider2, null), filteredItemsList.length > 0 ? /* @__PURE__ */ React38.createElement(
|
|
2429
|
+
ItemList,
|
|
2232
2430
|
{
|
|
2233
|
-
|
|
2234
|
-
|
|
2431
|
+
itemListItems: filteredItemsList,
|
|
2432
|
+
setSelectedItem: onItemChange,
|
|
2235
2433
|
handleClose,
|
|
2236
|
-
|
|
2434
|
+
selectedItem,
|
|
2435
|
+
itemStyle,
|
|
2436
|
+
onDebounce
|
|
2237
2437
|
}
|
|
2238
|
-
) : /* @__PURE__ */
|
|
2438
|
+
) : /* @__PURE__ */ React38.createElement(
|
|
2239
2439
|
Stack9,
|
|
2240
2440
|
{
|
|
2241
2441
|
alignItems: "center",
|
|
@@ -2245,23 +2445,19 @@ var FontFamilySelector = ({
|
|
|
2245
2445
|
gap: 1.5,
|
|
2246
2446
|
overflow: "hidden"
|
|
2247
2447
|
},
|
|
2248
|
-
/* @__PURE__ */
|
|
2249
|
-
/* @__PURE__ */
|
|
2448
|
+
/* @__PURE__ */ React38.createElement(IconComponent, { fontSize: "large" }),
|
|
2449
|
+
/* @__PURE__ */ React38.createElement(Box5, { sx: { maxWidth: 160, overflow: "hidden" } }, /* @__PURE__ */ React38.createElement(Typography4, { align: "center", variant: "subtitle2", color: "text.secondary" }, __11("Sorry, nothing matched", "elementor")), /* @__PURE__ */ React38.createElement(
|
|
2250
2450
|
Typography4,
|
|
2251
2451
|
{
|
|
2252
2452
|
variant: "subtitle2",
|
|
2253
2453
|
color: "text.secondary",
|
|
2254
|
-
sx: {
|
|
2255
|
-
display: "flex",
|
|
2256
|
-
width: "100%",
|
|
2257
|
-
justifyContent: "center"
|
|
2258
|
-
}
|
|
2454
|
+
sx: { display: "flex", width: "100%", justifyContent: "center" }
|
|
2259
2455
|
},
|
|
2260
|
-
/* @__PURE__ */
|
|
2261
|
-
/* @__PURE__ */
|
|
2262
|
-
/* @__PURE__ */
|
|
2456
|
+
/* @__PURE__ */ React38.createElement("span", null, "\u201C"),
|
|
2457
|
+
/* @__PURE__ */ React38.createElement("span", { style: { maxWidth: "80%", overflow: "hidden", textOverflow: "ellipsis" } }, searchValue),
|
|
2458
|
+
/* @__PURE__ */ React38.createElement("span", null, "\u201D.")
|
|
2263
2459
|
)),
|
|
2264
|
-
/* @__PURE__ */
|
|
2460
|
+
/* @__PURE__ */ React38.createElement(
|
|
2265
2461
|
Typography4,
|
|
2266
2462
|
{
|
|
2267
2463
|
align: "center",
|
|
@@ -2269,8 +2465,8 @@ var FontFamilySelector = ({
|
|
|
2269
2465
|
color: "text.secondary",
|
|
2270
2466
|
sx: { display: "flex", flexDirection: "column" }
|
|
2271
2467
|
},
|
|
2272
|
-
|
|
2273
|
-
/* @__PURE__ */
|
|
2468
|
+
__11("Try something else.", "elementor"),
|
|
2469
|
+
/* @__PURE__ */ React38.createElement(
|
|
2274
2470
|
Link,
|
|
2275
2471
|
{
|
|
2276
2472
|
color: "secondary",
|
|
@@ -2278,52 +2474,72 @@ var FontFamilySelector = ({
|
|
|
2278
2474
|
component: "button",
|
|
2279
2475
|
onClick: () => setSearchValue("")
|
|
2280
2476
|
},
|
|
2281
|
-
|
|
2477
|
+
__11("Clear & try again", "elementor")
|
|
2282
2478
|
)
|
|
2283
2479
|
)
|
|
2284
2480
|
));
|
|
2285
2481
|
};
|
|
2286
|
-
var
|
|
2287
|
-
|
|
2482
|
+
var ItemList = ({
|
|
2483
|
+
itemListItems,
|
|
2484
|
+
setSelectedItem,
|
|
2485
|
+
handleClose,
|
|
2486
|
+
selectedItem,
|
|
2487
|
+
itemStyle = () => ({}),
|
|
2488
|
+
onDebounce = () => {
|
|
2489
|
+
}
|
|
2490
|
+
}) => {
|
|
2491
|
+
const selectedItemFound = itemListItems.find((item) => item.value === selectedItem);
|
|
2288
2492
|
const debouncedVirtualizeChange = useDebounce(({ getVirtualIndexes }) => {
|
|
2289
2493
|
getVirtualIndexes().forEach((index) => {
|
|
2290
|
-
const item =
|
|
2291
|
-
if (item && item.type === "
|
|
2292
|
-
|
|
2494
|
+
const item = itemListItems[index];
|
|
2495
|
+
if (item && item.type === "item") {
|
|
2496
|
+
onDebounce(item.value);
|
|
2293
2497
|
}
|
|
2294
2498
|
});
|
|
2295
2499
|
}, 100);
|
|
2296
|
-
|
|
2500
|
+
const memoizedItemStyle = useCallback((item) => itemStyle(item), [itemStyle]);
|
|
2501
|
+
return /* @__PURE__ */ React38.createElement(
|
|
2297
2502
|
PopoverMenuList,
|
|
2298
2503
|
{
|
|
2299
|
-
items:
|
|
2300
|
-
selectedValue:
|
|
2504
|
+
items: itemListItems,
|
|
2505
|
+
selectedValue: selectedItemFound?.value,
|
|
2301
2506
|
onChange: debouncedVirtualizeChange,
|
|
2302
|
-
onSelect:
|
|
2507
|
+
onSelect: setSelectedItem,
|
|
2303
2508
|
onClose: handleClose,
|
|
2304
|
-
itemStyle:
|
|
2305
|
-
"data-testid": "
|
|
2509
|
+
itemStyle: memoizedItemStyle,
|
|
2510
|
+
"data-testid": "item-list"
|
|
2306
2511
|
}
|
|
2307
2512
|
);
|
|
2308
2513
|
};
|
|
2309
2514
|
var useDebounce = (fn, delay) => {
|
|
2310
|
-
const [debouncedFn] =
|
|
2311
|
-
|
|
2515
|
+
const [debouncedFn] = useState7(() => debounce(fn, delay));
|
|
2516
|
+
useEffect6(() => () => debouncedFn.cancel(), [debouncedFn]);
|
|
2312
2517
|
return debouncedFn;
|
|
2313
2518
|
};
|
|
2314
2519
|
|
|
2520
|
+
// src/controls/font-family-control/enqueue-font.tsx
|
|
2521
|
+
var enqueueFont = (fontFamily, context = "editor") => {
|
|
2522
|
+
const extendedWindow = window;
|
|
2523
|
+
return extendedWindow.elementor?.helpers?.enqueueFont?.(fontFamily, context) ?? null;
|
|
2524
|
+
};
|
|
2525
|
+
|
|
2315
2526
|
// src/controls/font-family-control/font-family-control.tsx
|
|
2316
|
-
var SIZE3 = "tiny";
|
|
2317
2527
|
var FontFamilyControl = createControl(({ fontFamilies, sectionWidth }) => {
|
|
2318
2528
|
const { value: fontFamily, setValue: setFontFamily, disabled, placeholder } = useBoundProp(stringPropTypeUtil5);
|
|
2319
2529
|
const popoverState = usePopupState5({ variant: "popover" });
|
|
2320
2530
|
const isShowingPlaceholder = !fontFamily && placeholder;
|
|
2321
|
-
|
|
2531
|
+
const mapFontSubs = React39.useMemo(() => {
|
|
2532
|
+
return fontFamilies.map(({ label, fonts }) => ({
|
|
2533
|
+
label,
|
|
2534
|
+
items: fonts
|
|
2535
|
+
}));
|
|
2536
|
+
}, [fontFamilies]);
|
|
2537
|
+
return /* @__PURE__ */ React39.createElement(React39.Fragment, null, /* @__PURE__ */ React39.createElement(ControlActions, null, /* @__PURE__ */ React39.createElement(
|
|
2322
2538
|
UnstableTag2,
|
|
2323
2539
|
{
|
|
2324
2540
|
variant: "outlined",
|
|
2325
2541
|
label: fontFamily || placeholder,
|
|
2326
|
-
endIcon: /* @__PURE__ */
|
|
2542
|
+
endIcon: /* @__PURE__ */ React39.createElement(ChevronDownIcon2, { fontSize: "tiny" }),
|
|
2327
2543
|
...bindTrigger3(popoverState),
|
|
2328
2544
|
fullWidth: true,
|
|
2329
2545
|
disabled,
|
|
@@ -2334,7 +2550,7 @@ var FontFamilyControl = createControl(({ fontFamilies, sectionWidth }) => {
|
|
|
2334
2550
|
textTransform: "capitalize"
|
|
2335
2551
|
} : void 0
|
|
2336
2552
|
}
|
|
2337
|
-
)), /* @__PURE__ */
|
|
2553
|
+
)), /* @__PURE__ */ React39.createElement(
|
|
2338
2554
|
Popover4,
|
|
2339
2555
|
{
|
|
2340
2556
|
disablePortal: true,
|
|
@@ -2344,27 +2560,31 @@ var FontFamilyControl = createControl(({ fontFamilies, sectionWidth }) => {
|
|
|
2344
2560
|
sx: { my: 1.5 },
|
|
2345
2561
|
...bindPopover4(popoverState)
|
|
2346
2562
|
},
|
|
2347
|
-
/* @__PURE__ */
|
|
2348
|
-
|
|
2563
|
+
/* @__PURE__ */ React39.createElement(
|
|
2564
|
+
ItemSelector,
|
|
2349
2565
|
{
|
|
2350
|
-
|
|
2351
|
-
fontFamily,
|
|
2352
|
-
|
|
2566
|
+
itemsList: mapFontSubs,
|
|
2567
|
+
selectedItem: fontFamily,
|
|
2568
|
+
onItemChange: setFontFamily,
|
|
2353
2569
|
onClose: popoverState.close,
|
|
2354
|
-
sectionWidth
|
|
2570
|
+
sectionWidth,
|
|
2571
|
+
title: __12("Font Family", "elementor"),
|
|
2572
|
+
itemStyle: (item) => ({ fontFamily: item.value }),
|
|
2573
|
+
onDebounce: enqueueFont,
|
|
2574
|
+
icon: TextIcon
|
|
2355
2575
|
}
|
|
2356
2576
|
)
|
|
2357
2577
|
));
|
|
2358
2578
|
});
|
|
2359
2579
|
|
|
2360
2580
|
// src/controls/url-control.tsx
|
|
2361
|
-
import * as
|
|
2581
|
+
import * as React40 from "react";
|
|
2362
2582
|
import { urlPropTypeUtil } from "@elementor/editor-props";
|
|
2363
2583
|
import { TextField as TextField6 } from "@elementor/ui";
|
|
2364
2584
|
var UrlControl = createControl(({ placeholder }) => {
|
|
2365
2585
|
const { value, setValue, disabled } = useBoundProp(urlPropTypeUtil);
|
|
2366
2586
|
const handleChange = (event) => setValue(event.target.value);
|
|
2367
|
-
return /* @__PURE__ */
|
|
2587
|
+
return /* @__PURE__ */ React40.createElement(ControlActions, null, /* @__PURE__ */ React40.createElement(
|
|
2368
2588
|
TextField6,
|
|
2369
2589
|
{
|
|
2370
2590
|
size: "tiny",
|
|
@@ -2378,34 +2598,31 @@ var UrlControl = createControl(({ placeholder }) => {
|
|
|
2378
2598
|
});
|
|
2379
2599
|
|
|
2380
2600
|
// src/controls/link-control.tsx
|
|
2381
|
-
import * as
|
|
2382
|
-
import { useMemo as
|
|
2383
|
-
import { getLinkInLinkRestriction
|
|
2601
|
+
import * as React44 from "react";
|
|
2602
|
+
import { useMemo as useMemo4, useState as useState8 } from "react";
|
|
2603
|
+
import { getLinkInLinkRestriction } from "@elementor/editor-elements";
|
|
2384
2604
|
import {
|
|
2385
|
-
booleanPropTypeUtil as booleanPropTypeUtil2,
|
|
2386
2605
|
linkPropTypeUtil,
|
|
2387
2606
|
numberPropTypeUtil as numberPropTypeUtil2,
|
|
2388
2607
|
stringPropTypeUtil as stringPropTypeUtil6,
|
|
2389
2608
|
urlPropTypeUtil as urlPropTypeUtil2
|
|
2390
2609
|
} from "@elementor/editor-props";
|
|
2391
|
-
import { InfoTipCard } from "@elementor/editor-ui";
|
|
2392
|
-
import { isExperimentActive as isExperimentActive4 } from "@elementor/editor-v1-adapters";
|
|
2393
2610
|
import { httpService as httpService2 } from "@elementor/http-client";
|
|
2394
|
-
import {
|
|
2611
|
+
import { MinusIcon, PlusIcon as PlusIcon2 } from "@elementor/icons";
|
|
2395
2612
|
import { useSessionStorage } from "@elementor/session";
|
|
2396
|
-
import {
|
|
2613
|
+
import { Collapse, Grid as Grid9, IconButton as IconButton3, Stack as Stack10 } from "@elementor/ui";
|
|
2397
2614
|
import { debounce as debounce2 } from "@elementor/utils";
|
|
2398
|
-
import { __ as
|
|
2615
|
+
import { __ as __14 } from "@wordpress/i18n";
|
|
2399
2616
|
|
|
2400
2617
|
// src/components/autocomplete.tsx
|
|
2401
|
-
import * as
|
|
2618
|
+
import * as React41 from "react";
|
|
2402
2619
|
import { forwardRef as forwardRef4 } from "react";
|
|
2403
2620
|
import { XIcon as XIcon2 } from "@elementor/icons";
|
|
2404
2621
|
import {
|
|
2405
2622
|
Autocomplete as AutocompleteBase,
|
|
2406
2623
|
Box as Box6,
|
|
2407
2624
|
IconButton as IconButton2,
|
|
2408
|
-
InputAdornment as
|
|
2625
|
+
InputAdornment as InputAdornment4,
|
|
2409
2626
|
TextField as TextField7
|
|
2410
2627
|
} from "@elementor/ui";
|
|
2411
2628
|
var Autocomplete = forwardRef4((props, ref) => {
|
|
@@ -2424,7 +2641,7 @@ var Autocomplete = forwardRef4((props, ref) => {
|
|
|
2424
2641
|
const muiWarningPreventer = allowCustomValues || !!value?.toString()?.length;
|
|
2425
2642
|
const isOptionEqualToValue = muiWarningPreventer ? void 0 : () => true;
|
|
2426
2643
|
const isValueFromOptions = typeof value === "number" && !!findMatchingOption(options, value);
|
|
2427
|
-
return /* @__PURE__ */
|
|
2644
|
+
return /* @__PURE__ */ React41.createElement(
|
|
2428
2645
|
AutocompleteBase,
|
|
2429
2646
|
{
|
|
2430
2647
|
...restProps,
|
|
@@ -2442,8 +2659,8 @@ var Autocomplete = forwardRef4((props, ref) => {
|
|
|
2442
2659
|
groupBy: isCategorizedOptionPool(options) ? (optionId) => findMatchingOption(options, optionId)?.groupLabel || optionId : void 0,
|
|
2443
2660
|
isOptionEqualToValue,
|
|
2444
2661
|
filterOptions: () => optionKeys,
|
|
2445
|
-
renderOption: (optionProps, optionId) => /* @__PURE__ */
|
|
2446
|
-
renderInput: (params) => /* @__PURE__ */
|
|
2662
|
+
renderOption: (optionProps, optionId) => /* @__PURE__ */ React41.createElement(Box6, { component: "li", ...optionProps, key: optionProps.id }, findMatchingOption(options, optionId)?.label ?? optionId),
|
|
2663
|
+
renderInput: (params) => /* @__PURE__ */ React41.createElement(
|
|
2447
2664
|
TextInput,
|
|
2448
2665
|
{
|
|
2449
2666
|
params,
|
|
@@ -2466,7 +2683,7 @@ var TextInput = ({
|
|
|
2466
2683
|
const onChange = (event) => {
|
|
2467
2684
|
handleChange(event.target.value);
|
|
2468
2685
|
};
|
|
2469
|
-
return /* @__PURE__ */
|
|
2686
|
+
return /* @__PURE__ */ React41.createElement(
|
|
2470
2687
|
TextField7,
|
|
2471
2688
|
{
|
|
2472
2689
|
...params,
|
|
@@ -2479,7 +2696,7 @@ var TextInput = ({
|
|
|
2479
2696
|
},
|
|
2480
2697
|
InputProps: {
|
|
2481
2698
|
...params.InputProps,
|
|
2482
|
-
endAdornment: /* @__PURE__ */
|
|
2699
|
+
endAdornment: /* @__PURE__ */ React41.createElement(ClearButton, { params, allowClear, handleChange })
|
|
2483
2700
|
}
|
|
2484
2701
|
}
|
|
2485
2702
|
);
|
|
@@ -2488,7 +2705,7 @@ var ClearButton = ({
|
|
|
2488
2705
|
allowClear,
|
|
2489
2706
|
handleChange,
|
|
2490
2707
|
params
|
|
2491
|
-
}) => /* @__PURE__ */
|
|
2708
|
+
}) => /* @__PURE__ */ React41.createElement(InputAdornment4, { position: "end" }, allowClear && /* @__PURE__ */ React41.createElement(IconButton2, { size: params.size, onClick: () => handleChange(null), sx: { cursor: "pointer" } }, /* @__PURE__ */ React41.createElement(XIcon2, { fontSize: params.size })));
|
|
2492
2709
|
function findMatchingOption(options, optionId = null) {
|
|
2493
2710
|
const formattedOption = (optionId || "").toString();
|
|
2494
2711
|
return options.find(({ id }) => formattedOption === id.toString());
|
|
@@ -2509,8 +2726,67 @@ function _factoryFilter(newValue, options, minInputLength) {
|
|
|
2509
2726
|
);
|
|
2510
2727
|
}
|
|
2511
2728
|
|
|
2729
|
+
// src/components/restricted-link-infotip.tsx
|
|
2730
|
+
import * as React42 from "react";
|
|
2731
|
+
import { selectElement } from "@elementor/editor-elements";
|
|
2732
|
+
import { InfoCircleFilledIcon } from "@elementor/icons";
|
|
2733
|
+
import { Alert, AlertAction, AlertTitle, Box as Box7, Infotip, Link as Link2 } from "@elementor/ui";
|
|
2734
|
+
import { __ as __13 } from "@wordpress/i18n";
|
|
2735
|
+
var learnMoreButton = {
|
|
2736
|
+
label: __13("Learn More", "elementor"),
|
|
2737
|
+
href: "https://go.elementor.com/element-link-inside-link-infotip"
|
|
2738
|
+
};
|
|
2739
|
+
var INFOTIP_CONTENT = {
|
|
2740
|
+
descendant: __13(
|
|
2741
|
+
"To add a link to this element, first remove the link from the elements inside of it.",
|
|
2742
|
+
"elementor"
|
|
2743
|
+
),
|
|
2744
|
+
ancestor: __13("To add a link to this element, first remove the link from its parent container.", "elementor")
|
|
2745
|
+
};
|
|
2746
|
+
var RestrictedLinkInfotip = ({
|
|
2747
|
+
linkInLinkRestriction,
|
|
2748
|
+
isVisible,
|
|
2749
|
+
children
|
|
2750
|
+
}) => {
|
|
2751
|
+
const { shouldRestrict, reason, elementId } = linkInLinkRestriction;
|
|
2752
|
+
const handleTakeMeClick = () => {
|
|
2753
|
+
if (elementId) {
|
|
2754
|
+
selectElement(elementId);
|
|
2755
|
+
}
|
|
2756
|
+
};
|
|
2757
|
+
const content = /* @__PURE__ */ React42.createElement(
|
|
2758
|
+
Alert,
|
|
2759
|
+
{
|
|
2760
|
+
severity: "secondary",
|
|
2761
|
+
icon: /* @__PURE__ */ React42.createElement(InfoCircleFilledIcon, null),
|
|
2762
|
+
action: /* @__PURE__ */ React42.createElement(
|
|
2763
|
+
AlertAction,
|
|
2764
|
+
{
|
|
2765
|
+
sx: { width: "fit-content" },
|
|
2766
|
+
variant: "contained",
|
|
2767
|
+
color: "secondary",
|
|
2768
|
+
onClick: handleTakeMeClick
|
|
2769
|
+
},
|
|
2770
|
+
__13("Take me there", "elementor")
|
|
2771
|
+
)
|
|
2772
|
+
},
|
|
2773
|
+
/* @__PURE__ */ React42.createElement(AlertTitle, null, __13("Nested links", "elementor")),
|
|
2774
|
+
/* @__PURE__ */ React42.createElement(Box7, { component: "span" }, INFOTIP_CONTENT[reason ?? "descendant"], " ", /* @__PURE__ */ React42.createElement(Link2, { href: learnMoreButton.href, target: "_blank", color: "info.main" }, learnMoreButton.label))
|
|
2775
|
+
);
|
|
2776
|
+
return shouldRestrict && isVisible ? /* @__PURE__ */ React42.createElement(
|
|
2777
|
+
Infotip,
|
|
2778
|
+
{
|
|
2779
|
+
placement: "right",
|
|
2780
|
+
content,
|
|
2781
|
+
color: "secondary",
|
|
2782
|
+
slotProps: { popper: { sx: { width: 300 } } }
|
|
2783
|
+
},
|
|
2784
|
+
/* @__PURE__ */ React42.createElement(Box7, null, children)
|
|
2785
|
+
) : /* @__PURE__ */ React42.createElement(React42.Fragment, null, children);
|
|
2786
|
+
};
|
|
2787
|
+
|
|
2512
2788
|
// src/controls/switch-control.tsx
|
|
2513
|
-
import * as
|
|
2789
|
+
import * as React43 from "react";
|
|
2514
2790
|
import { booleanPropTypeUtil } from "@elementor/editor-props";
|
|
2515
2791
|
import { Switch } from "@elementor/ui";
|
|
2516
2792
|
var SwitchControl = createControl(() => {
|
|
@@ -2518,7 +2794,7 @@ var SwitchControl = createControl(() => {
|
|
|
2518
2794
|
const handleChange = (event) => {
|
|
2519
2795
|
setValue(event.target.checked);
|
|
2520
2796
|
};
|
|
2521
|
-
return /* @__PURE__ */
|
|
2797
|
+
return /* @__PURE__ */ React43.createElement("div", { style: { display: "flex", justifyContent: "flex-end" } }, /* @__PURE__ */ React43.createElement(
|
|
2522
2798
|
Switch,
|
|
2523
2799
|
{
|
|
2524
2800
|
checked: !!value,
|
|
@@ -2533,25 +2809,21 @@ var SwitchControl = createControl(() => {
|
|
|
2533
2809
|
});
|
|
2534
2810
|
|
|
2535
2811
|
// src/controls/link-control.tsx
|
|
2536
|
-
var
|
|
2537
|
-
var learnMoreButton = {
|
|
2538
|
-
label: __11("Learn More", "elementor"),
|
|
2539
|
-
href: "https://go.elementor.com/element-link-inside-link-infotip"
|
|
2540
|
-
};
|
|
2812
|
+
var SIZE3 = "tiny";
|
|
2541
2813
|
var LinkControl = createControl((props) => {
|
|
2542
2814
|
const { value, path, setValue, ...propContext } = useBoundProp(linkPropTypeUtil);
|
|
2543
2815
|
const [linkSessionValue, setLinkSessionValue] = useSessionStorage(path.join("/"));
|
|
2544
|
-
const [isActive, setIsActive] =
|
|
2816
|
+
const [isActive, setIsActive] = useState8(!!value);
|
|
2545
2817
|
const {
|
|
2546
2818
|
allowCustomValues,
|
|
2547
2819
|
queryOptions: { endpoint = "", requestParams = {} },
|
|
2548
2820
|
placeholder,
|
|
2549
2821
|
minInputLength = 2,
|
|
2550
2822
|
context: { elementId },
|
|
2551
|
-
label =
|
|
2823
|
+
label = __14("Link", "elementor")
|
|
2552
2824
|
} = props || {};
|
|
2553
|
-
const [linkInLinkRestriction, setLinkInLinkRestriction] =
|
|
2554
|
-
const [options, setOptions] =
|
|
2825
|
+
const [linkInLinkRestriction, setLinkInLinkRestriction] = useState8(getLinkInLinkRestriction(elementId));
|
|
2826
|
+
const [options, setOptions] = useState8(
|
|
2555
2827
|
generateFirstLoadedOption(value)
|
|
2556
2828
|
);
|
|
2557
2829
|
const shouldDisableAddingLink = !isActive && linkInLinkRestriction.shouldRestrict;
|
|
@@ -2602,7 +2874,7 @@ var LinkControl = createControl((props) => {
|
|
|
2602
2874
|
}
|
|
2603
2875
|
debounceFetch({ ...requestParams, term: newValue });
|
|
2604
2876
|
};
|
|
2605
|
-
const debounceFetch =
|
|
2877
|
+
const debounceFetch = useMemo4(
|
|
2606
2878
|
() => debounce2(
|
|
2607
2879
|
(params) => fetchOptions(endpoint, params).then((newOptions) => {
|
|
2608
2880
|
setOptions(formatOptions(newOptions));
|
|
@@ -2611,7 +2883,7 @@ var LinkControl = createControl((props) => {
|
|
|
2611
2883
|
),
|
|
2612
2884
|
[endpoint]
|
|
2613
2885
|
);
|
|
2614
|
-
return /* @__PURE__ */
|
|
2886
|
+
return /* @__PURE__ */ React44.createElement(PropProvider, { ...propContext, value, setValue }, /* @__PURE__ */ React44.createElement(Stack10, { gap: 1.5 }, /* @__PURE__ */ React44.createElement(
|
|
2615
2887
|
Stack10,
|
|
2616
2888
|
{
|
|
2617
2889
|
direction: "row",
|
|
@@ -2621,17 +2893,17 @@ var LinkControl = createControl((props) => {
|
|
|
2621
2893
|
marginInlineEnd: -0.75
|
|
2622
2894
|
}
|
|
2623
2895
|
},
|
|
2624
|
-
/* @__PURE__ */
|
|
2625
|
-
/* @__PURE__ */
|
|
2896
|
+
/* @__PURE__ */ React44.createElement(ControlFormLabel, null, label),
|
|
2897
|
+
/* @__PURE__ */ React44.createElement(RestrictedLinkInfotip, { isVisible: !isActive, linkInLinkRestriction }, /* @__PURE__ */ React44.createElement(
|
|
2626
2898
|
ToggleIconControl,
|
|
2627
2899
|
{
|
|
2628
2900
|
disabled: shouldDisableAddingLink,
|
|
2629
2901
|
active: isActive,
|
|
2630
2902
|
onIconClick: onEnabledChange,
|
|
2631
|
-
label:
|
|
2903
|
+
label: __14("Toggle link", "elementor")
|
|
2632
2904
|
}
|
|
2633
2905
|
))
|
|
2634
|
-
), /* @__PURE__ */
|
|
2906
|
+
), /* @__PURE__ */ React44.createElement(Collapse, { in: isActive, timeout: "auto", unmountOnExit: true }, /* @__PURE__ */ React44.createElement(Stack10, { gap: 1.5 }, /* @__PURE__ */ React44.createElement(PropKeyProvider, { bind: "destination" }, /* @__PURE__ */ React44.createElement(ControlActions, null, /* @__PURE__ */ React44.createElement(
|
|
2635
2907
|
Autocomplete,
|
|
2636
2908
|
{
|
|
2637
2909
|
options,
|
|
@@ -2642,31 +2914,10 @@ var LinkControl = createControl((props) => {
|
|
|
2642
2914
|
onTextChange,
|
|
2643
2915
|
minInputLength
|
|
2644
2916
|
}
|
|
2645
|
-
))), /* @__PURE__ */
|
|
2917
|
+
))), /* @__PURE__ */ React44.createElement(PropKeyProvider, { bind: "isTargetBlank" }, /* @__PURE__ */ React44.createElement(Grid9, { container: true, alignItems: "center", flexWrap: "nowrap", justifyContent: "space-between" }, /* @__PURE__ */ React44.createElement(Grid9, { item: true }, /* @__PURE__ */ React44.createElement(ControlFormLabel, null, __14("Open in a new tab", "elementor"))), /* @__PURE__ */ React44.createElement(Grid9, { item: true, sx: { marginInlineEnd: -1 } }, /* @__PURE__ */ React44.createElement(SwitchControl, null))))))));
|
|
2646
2918
|
});
|
|
2647
2919
|
var ToggleIconControl = ({ disabled, active, onIconClick, label }) => {
|
|
2648
|
-
return /* @__PURE__ */
|
|
2649
|
-
};
|
|
2650
|
-
var SwitchControlComponent = ({ disabled }) => {
|
|
2651
|
-
const { value, setValue } = useBoundProp(booleanPropTypeUtil2);
|
|
2652
|
-
const isVersion331Active = isExperimentActive4("e_v_3_31");
|
|
2653
|
-
if (isVersion331Active) {
|
|
2654
|
-
return /* @__PURE__ */ React42.createElement(SwitchControl, null);
|
|
2655
|
-
}
|
|
2656
|
-
const onClick = () => {
|
|
2657
|
-
setValue(!value);
|
|
2658
|
-
};
|
|
2659
|
-
return /* @__PURE__ */ React42.createElement(
|
|
2660
|
-
Switch2,
|
|
2661
|
-
{
|
|
2662
|
-
checked: value ?? false,
|
|
2663
|
-
onClick,
|
|
2664
|
-
disabled,
|
|
2665
|
-
inputProps: {
|
|
2666
|
-
...disabled ? { style: { opacity: 0 } } : {}
|
|
2667
|
-
}
|
|
2668
|
-
}
|
|
2669
|
-
);
|
|
2920
|
+
return /* @__PURE__ */ React44.createElement(IconButton3, { size: SIZE3, onClick: onIconClick, "aria-label": label, disabled }, active ? /* @__PURE__ */ React44.createElement(MinusIcon, { fontSize: SIZE3 }) : /* @__PURE__ */ React44.createElement(PlusIcon2, { fontSize: SIZE3 }));
|
|
2670
2921
|
};
|
|
2671
2922
|
async function fetchOptions(ajaxUrl, params) {
|
|
2672
2923
|
if (!params || !ajaxUrl) {
|
|
@@ -2696,45 +2947,14 @@ function generateFirstLoadedOption(unionValue) {
|
|
|
2696
2947
|
}
|
|
2697
2948
|
] : [];
|
|
2698
2949
|
}
|
|
2699
|
-
var ConditionalInfoTip = ({ linkInLinkRestriction, isVisible, children }) => {
|
|
2700
|
-
const { shouldRestrict, reason, elementId } = linkInLinkRestriction;
|
|
2701
|
-
const handleTakeMeClick = () => {
|
|
2702
|
-
if (elementId) {
|
|
2703
|
-
selectElement(elementId);
|
|
2704
|
-
}
|
|
2705
|
-
};
|
|
2706
|
-
return shouldRestrict && isVisible ? /* @__PURE__ */ React42.createElement(
|
|
2707
|
-
Infotip,
|
|
2708
|
-
{
|
|
2709
|
-
placement: "right",
|
|
2710
|
-
content: /* @__PURE__ */ React42.createElement(
|
|
2711
|
-
InfoTipCard,
|
|
2712
|
-
{
|
|
2713
|
-
content: INFOTIP_CONTENT[reason],
|
|
2714
|
-
svgIcon: /* @__PURE__ */ React42.createElement(AlertTriangleIcon, null),
|
|
2715
|
-
learnMoreButton,
|
|
2716
|
-
ctaButton: {
|
|
2717
|
-
label: __11("Take me there", "elementor"),
|
|
2718
|
-
onClick: handleTakeMeClick
|
|
2719
|
-
}
|
|
2720
|
-
}
|
|
2721
|
-
)
|
|
2722
|
-
},
|
|
2723
|
-
/* @__PURE__ */ React42.createElement(Box7, null, children)
|
|
2724
|
-
) : /* @__PURE__ */ React42.createElement(React42.Fragment, null, children);
|
|
2725
|
-
};
|
|
2726
|
-
var INFOTIP_CONTENT = {
|
|
2727
|
-
descendant: /* @__PURE__ */ React42.createElement(React42.Fragment, null, __11("To add a link to this container,", "elementor"), /* @__PURE__ */ React42.createElement("br", null), __11("first remove the link from the elements inside of it.", "elementor")),
|
|
2728
|
-
ancestor: /* @__PURE__ */ React42.createElement(React42.Fragment, null, __11("To add a link to this element,", "elementor"), /* @__PURE__ */ React42.createElement("br", null), __11("first remove the link from its parent container.", "elementor"))
|
|
2729
|
-
};
|
|
2730
2950
|
|
|
2731
2951
|
// src/controls/gap-control.tsx
|
|
2732
|
-
import * as
|
|
2733
|
-
import { useRef as
|
|
2734
|
-
import { layoutDirectionPropTypeUtil, sizePropTypeUtil as
|
|
2952
|
+
import * as React45 from "react";
|
|
2953
|
+
import { useRef as useRef10 } from "react";
|
|
2954
|
+
import { layoutDirectionPropTypeUtil, sizePropTypeUtil as sizePropTypeUtil5 } from "@elementor/editor-props";
|
|
2735
2955
|
import { DetachIcon as DetachIcon2, LinkIcon as LinkIcon2 } from "@elementor/icons";
|
|
2736
2956
|
import { Grid as Grid10, Stack as Stack11, ToggleButton as ToggleButton4, Tooltip as Tooltip5 } from "@elementor/ui";
|
|
2737
|
-
import { __ as
|
|
2957
|
+
import { __ as __15 } from "@wordpress/i18n";
|
|
2738
2958
|
var GapControl = createControl(({ label }) => {
|
|
2739
2959
|
const {
|
|
2740
2960
|
value: directionValue,
|
|
@@ -2742,15 +2962,15 @@ var GapControl = createControl(({ label }) => {
|
|
|
2742
2962
|
propType,
|
|
2743
2963
|
disabled: directionDisabled
|
|
2744
2964
|
} = useBoundProp(layoutDirectionPropTypeUtil);
|
|
2745
|
-
const stackRef =
|
|
2746
|
-
const { value: sizeValue, setValue: setSizeValue, disabled: sizeDisabled } = useBoundProp(
|
|
2965
|
+
const stackRef = useRef10(null);
|
|
2966
|
+
const { value: sizeValue, setValue: setSizeValue, disabled: sizeDisabled } = useBoundProp(sizePropTypeUtil5);
|
|
2747
2967
|
const isLinked = !directionValue && !sizeValue ? true : !!sizeValue;
|
|
2748
2968
|
const onLinkToggle = () => {
|
|
2749
2969
|
if (!isLinked) {
|
|
2750
2970
|
setSizeValue(directionValue?.column?.value ?? null);
|
|
2751
2971
|
return;
|
|
2752
2972
|
}
|
|
2753
|
-
const value = sizeValue ?
|
|
2973
|
+
const value = sizeValue ? sizePropTypeUtil5.create(sizeValue) : null;
|
|
2754
2974
|
setDirectionValue({
|
|
2755
2975
|
row: value,
|
|
2756
2976
|
column: value
|
|
@@ -2758,10 +2978,10 @@ var GapControl = createControl(({ label }) => {
|
|
|
2758
2978
|
};
|
|
2759
2979
|
const tooltipLabel = label.toLowerCase();
|
|
2760
2980
|
const LinkedIcon = isLinked ? LinkIcon2 : DetachIcon2;
|
|
2761
|
-
const linkedLabel =
|
|
2762
|
-
const unlinkedLabel =
|
|
2981
|
+
const linkedLabel = __15("Link %s", "elementor").replace("%s", tooltipLabel);
|
|
2982
|
+
const unlinkedLabel = __15("Unlink %s", "elementor").replace("%s", tooltipLabel);
|
|
2763
2983
|
const disabled = sizeDisabled || directionDisabled;
|
|
2764
|
-
return /* @__PURE__ */
|
|
2984
|
+
return /* @__PURE__ */ React45.createElement(PropProvider, { propType, value: directionValue, setValue: setDirectionValue }, /* @__PURE__ */ React45.createElement(Stack11, { direction: "row", gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React45.createElement(ControlLabel, null, label), /* @__PURE__ */ React45.createElement(Tooltip5, { title: isLinked ? unlinkedLabel : linkedLabel, placement: "top" }, /* @__PURE__ */ React45.createElement(
|
|
2765
2985
|
ToggleButton4,
|
|
2766
2986
|
{
|
|
2767
2987
|
"aria-label": isLinked ? unlinkedLabel : linkedLabel,
|
|
@@ -2772,8 +2992,8 @@ var GapControl = createControl(({ label }) => {
|
|
|
2772
2992
|
onChange: onLinkToggle,
|
|
2773
2993
|
disabled
|
|
2774
2994
|
},
|
|
2775
|
-
/* @__PURE__ */
|
|
2776
|
-
))), /* @__PURE__ */
|
|
2995
|
+
/* @__PURE__ */ React45.createElement(LinkedIcon, { fontSize: "tiny" })
|
|
2996
|
+
))), /* @__PURE__ */ React45.createElement(Stack11, { direction: "row", gap: 2, flexWrap: "nowrap", ref: stackRef }, /* @__PURE__ */ React45.createElement(Grid10, { container: true, gap: 0.75, alignItems: "center" }, /* @__PURE__ */ React45.createElement(Grid10, { item: true, xs: 12 }, /* @__PURE__ */ React45.createElement(ControlFormLabel, null, __15("Column", "elementor"))), /* @__PURE__ */ React45.createElement(Grid10, { item: true, xs: 12 }, /* @__PURE__ */ React45.createElement(Control4, { bind: "column", isLinked, anchorRef: stackRef }))), /* @__PURE__ */ React45.createElement(Grid10, { container: true, gap: 0.75, alignItems: "center" }, /* @__PURE__ */ React45.createElement(Grid10, { item: true, xs: 12 }, /* @__PURE__ */ React45.createElement(ControlFormLabel, null, __15("Row", "elementor"))), /* @__PURE__ */ React45.createElement(Grid10, { item: true, xs: 12 }, /* @__PURE__ */ React45.createElement(Control4, { bind: "row", isLinked, anchorRef: stackRef })))));
|
|
2777
2997
|
});
|
|
2778
2998
|
var Control4 = ({
|
|
2779
2999
|
bind,
|
|
@@ -2781,21 +3001,21 @@ var Control4 = ({
|
|
|
2781
3001
|
anchorRef
|
|
2782
3002
|
}) => {
|
|
2783
3003
|
if (isLinked) {
|
|
2784
|
-
return /* @__PURE__ */
|
|
3004
|
+
return /* @__PURE__ */ React45.createElement(SizeControl, { anchorRef });
|
|
2785
3005
|
}
|
|
2786
|
-
return /* @__PURE__ */
|
|
3006
|
+
return /* @__PURE__ */ React45.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React45.createElement(SizeControl, { anchorRef }));
|
|
2787
3007
|
};
|
|
2788
3008
|
|
|
2789
3009
|
// src/controls/aspect-ratio-control.tsx
|
|
2790
|
-
import * as
|
|
2791
|
-
import { useEffect as
|
|
3010
|
+
import * as React46 from "react";
|
|
3011
|
+
import { useEffect as useEffect7, useState as useState9 } from "react";
|
|
2792
3012
|
import { stringPropTypeUtil as stringPropTypeUtil7 } from "@elementor/editor-props";
|
|
2793
|
-
import { MenuListItem as
|
|
3013
|
+
import { MenuListItem as MenuListItem3 } from "@elementor/editor-ui";
|
|
2794
3014
|
import { ArrowsMoveHorizontalIcon, ArrowsMoveVerticalIcon } from "@elementor/icons";
|
|
2795
|
-
import { Grid as Grid11, Select as
|
|
2796
|
-
import { __ as
|
|
3015
|
+
import { Grid as Grid11, Select as Select2, Stack as Stack12, TextField as TextField8 } from "@elementor/ui";
|
|
3016
|
+
import { __ as __16 } from "@wordpress/i18n";
|
|
2797
3017
|
var RATIO_OPTIONS = [
|
|
2798
|
-
{ label:
|
|
3018
|
+
{ label: __16("Auto", "elementor"), value: "auto" },
|
|
2799
3019
|
{ label: "1/1", value: "1/1" },
|
|
2800
3020
|
{ label: "4/3", value: "4/3" },
|
|
2801
3021
|
{ label: "3/4", value: "3/4" },
|
|
@@ -2809,13 +3029,13 @@ var AspectRatioControl = createControl(({ label }) => {
|
|
|
2809
3029
|
const { value: aspectRatioValue, setValue: setAspectRatioValue, disabled } = useBoundProp(stringPropTypeUtil7);
|
|
2810
3030
|
const isCustomSelected = aspectRatioValue && !RATIO_OPTIONS.some((option) => option.value === aspectRatioValue);
|
|
2811
3031
|
const [initialWidth, initialHeight] = isCustomSelected ? aspectRatioValue.split("/") : ["", ""];
|
|
2812
|
-
const [isCustom, setIsCustom] =
|
|
2813
|
-
const [customWidth, setCustomWidth] =
|
|
2814
|
-
const [customHeight, setCustomHeight] =
|
|
2815
|
-
const [selectedValue, setSelectedValue] =
|
|
3032
|
+
const [isCustom, setIsCustom] = useState9(isCustomSelected);
|
|
3033
|
+
const [customWidth, setCustomWidth] = useState9(initialWidth);
|
|
3034
|
+
const [customHeight, setCustomHeight] = useState9(initialHeight);
|
|
3035
|
+
const [selectedValue, setSelectedValue] = useState9(
|
|
2816
3036
|
isCustomSelected ? CUSTOM_RATIO : aspectRatioValue || ""
|
|
2817
3037
|
);
|
|
2818
|
-
|
|
3038
|
+
useEffect7(() => {
|
|
2819
3039
|
const isCustomValue = aspectRatioValue && !RATIO_OPTIONS.some((option) => option.value === aspectRatioValue);
|
|
2820
3040
|
if (isCustomValue) {
|
|
2821
3041
|
const [width, height] = aspectRatioValue.split("/");
|
|
@@ -2854,8 +3074,8 @@ var AspectRatioControl = createControl(({ label }) => {
|
|
|
2854
3074
|
setAspectRatioValue(`${customWidth}/${newHeight}`);
|
|
2855
3075
|
}
|
|
2856
3076
|
};
|
|
2857
|
-
return /* @__PURE__ */
|
|
2858
|
-
|
|
3077
|
+
return /* @__PURE__ */ React46.createElement(ControlActions, null, /* @__PURE__ */ React46.createElement(Stack12, { direction: "column", gap: 2 }, /* @__PURE__ */ React46.createElement(Grid11, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React46.createElement(Grid11, { item: true, xs: 6 }, /* @__PURE__ */ React46.createElement(ControlLabel, null, label)), /* @__PURE__ */ React46.createElement(Grid11, { item: true, xs: 6 }, /* @__PURE__ */ React46.createElement(
|
|
3078
|
+
Select2,
|
|
2859
3079
|
{
|
|
2860
3080
|
size: "tiny",
|
|
2861
3081
|
displayEmpty: true,
|
|
@@ -2865,10 +3085,10 @@ var AspectRatioControl = createControl(({ label }) => {
|
|
|
2865
3085
|
onChange: handleSelectChange,
|
|
2866
3086
|
fullWidth: true
|
|
2867
3087
|
},
|
|
2868
|
-
[...RATIO_OPTIONS, { label:
|
|
2869
|
-
({ label: optionLabel, ...props }) => /* @__PURE__ */
|
|
3088
|
+
[...RATIO_OPTIONS, { label: __16("Custom", "elementor"), value: CUSTOM_RATIO }].map(
|
|
3089
|
+
({ label: optionLabel, ...props }) => /* @__PURE__ */ React46.createElement(MenuListItem3, { key: props.value, ...props, value: props.value ?? "" }, optionLabel)
|
|
2870
3090
|
)
|
|
2871
|
-
))), isCustom && /* @__PURE__ */
|
|
3091
|
+
))), isCustom && /* @__PURE__ */ React46.createElement(Grid11, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React46.createElement(Grid11, { item: true, xs: 6 }, /* @__PURE__ */ React46.createElement(
|
|
2872
3092
|
TextField8,
|
|
2873
3093
|
{
|
|
2874
3094
|
size: "tiny",
|
|
@@ -2878,10 +3098,10 @@ var AspectRatioControl = createControl(({ label }) => {
|
|
|
2878
3098
|
value: customWidth,
|
|
2879
3099
|
onChange: handleCustomWidthChange,
|
|
2880
3100
|
InputProps: {
|
|
2881
|
-
startAdornment: /* @__PURE__ */
|
|
3101
|
+
startAdornment: /* @__PURE__ */ React46.createElement(ArrowsMoveHorizontalIcon, { fontSize: "tiny" })
|
|
2882
3102
|
}
|
|
2883
3103
|
}
|
|
2884
|
-
)), /* @__PURE__ */
|
|
3104
|
+
)), /* @__PURE__ */ React46.createElement(Grid11, { item: true, xs: 6 }, /* @__PURE__ */ React46.createElement(
|
|
2885
3105
|
TextField8,
|
|
2886
3106
|
{
|
|
2887
3107
|
size: "tiny",
|
|
@@ -2891,24 +3111,24 @@ var AspectRatioControl = createControl(({ label }) => {
|
|
|
2891
3111
|
value: customHeight,
|
|
2892
3112
|
onChange: handleCustomHeightChange,
|
|
2893
3113
|
InputProps: {
|
|
2894
|
-
startAdornment: /* @__PURE__ */
|
|
3114
|
+
startAdornment: /* @__PURE__ */ React46.createElement(ArrowsMoveVerticalIcon, { fontSize: "tiny" })
|
|
2895
3115
|
}
|
|
2896
3116
|
}
|
|
2897
3117
|
)))));
|
|
2898
3118
|
});
|
|
2899
3119
|
|
|
2900
3120
|
// src/controls/svg-media-control.tsx
|
|
2901
|
-
import * as
|
|
2902
|
-
import { useState as
|
|
3121
|
+
import * as React48 from "react";
|
|
3122
|
+
import { useState as useState11 } from "react";
|
|
2903
3123
|
import { imageSrcPropTypeUtil as imageSrcPropTypeUtil2 } from "@elementor/editor-props";
|
|
2904
3124
|
import { UploadIcon as UploadIcon2 } from "@elementor/icons";
|
|
2905
|
-
import { Button as Button4, Card as Card2, CardMedia as CardMedia2, CardOverlay as CardOverlay2, CircularProgress as CircularProgress3, Stack as Stack13, styled as
|
|
3125
|
+
import { Button as Button4, Card as Card2, CardMedia as CardMedia2, CardOverlay as CardOverlay2, CircularProgress as CircularProgress3, Stack as Stack13, styled as styled5 } from "@elementor/ui";
|
|
2906
3126
|
import { useWpMediaAttachment as useWpMediaAttachment2, useWpMediaFrame as useWpMediaFrame2 } from "@elementor/wp-media";
|
|
2907
|
-
import { __ as
|
|
3127
|
+
import { __ as __18 } from "@wordpress/i18n";
|
|
2908
3128
|
|
|
2909
3129
|
// src/components/enable-unfiltered-modal.tsx
|
|
2910
|
-
import * as
|
|
2911
|
-
import { useState as
|
|
3130
|
+
import * as React47 from "react";
|
|
3131
|
+
import { useState as useState10 } from "react";
|
|
2912
3132
|
import { useCurrentUserCapabilities } from "@elementor/editor-current-user";
|
|
2913
3133
|
import {
|
|
2914
3134
|
Button as Button3,
|
|
@@ -2921,19 +3141,19 @@ import {
|
|
|
2921
3141
|
DialogTitle,
|
|
2922
3142
|
Divider as Divider3
|
|
2923
3143
|
} from "@elementor/ui";
|
|
2924
|
-
import { __ as
|
|
2925
|
-
var ADMIN_TITLE_TEXT =
|
|
2926
|
-
var ADMIN_CONTENT_TEXT =
|
|
3144
|
+
import { __ as __17 } from "@wordpress/i18n";
|
|
3145
|
+
var ADMIN_TITLE_TEXT = __17("Enable Unfiltered Uploads", "elementor");
|
|
3146
|
+
var ADMIN_CONTENT_TEXT = __17(
|
|
2927
3147
|
"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.",
|
|
2928
3148
|
"elementor"
|
|
2929
3149
|
);
|
|
2930
|
-
var NON_ADMIN_TITLE_TEXT =
|
|
2931
|
-
var NON_ADMIN_CONTENT_TEXT =
|
|
3150
|
+
var NON_ADMIN_TITLE_TEXT = __17("Sorry, you can't upload that file yet", "elementor");
|
|
3151
|
+
var NON_ADMIN_CONTENT_TEXT = __17(
|
|
2932
3152
|
"This is because this file type may pose a security risk. To upload them anyway, ask the site administrator to enable unfiltered file uploads.",
|
|
2933
3153
|
"elementor"
|
|
2934
3154
|
);
|
|
2935
|
-
var ADMIN_FAILED_CONTENT_TEXT_PT1 =
|
|
2936
|
-
var ADMIN_FAILED_CONTENT_TEXT_PT2 =
|
|
3155
|
+
var ADMIN_FAILED_CONTENT_TEXT_PT1 = __17("Failed to enable unfiltered files upload.", "elementor");
|
|
3156
|
+
var ADMIN_FAILED_CONTENT_TEXT_PT2 = __17(
|
|
2937
3157
|
"You can try again, if the problem persists, please contact support.",
|
|
2938
3158
|
"elementor"
|
|
2939
3159
|
);
|
|
@@ -2941,7 +3161,7 @@ var WAIT_FOR_CLOSE_TIMEOUT_MS = 300;
|
|
|
2941
3161
|
var EnableUnfilteredModal = (props) => {
|
|
2942
3162
|
const { mutateAsync, isPending } = useUpdateUnfilteredFilesUpload();
|
|
2943
3163
|
const { canUser } = useCurrentUserCapabilities();
|
|
2944
|
-
const [isError, setIsError] =
|
|
3164
|
+
const [isError, setIsError] = useState10(false);
|
|
2945
3165
|
const canManageOptions = canUser("manage_options");
|
|
2946
3166
|
const onClose = (enabled) => {
|
|
2947
3167
|
props.onClose(enabled);
|
|
@@ -2960,9 +3180,9 @@ var EnableUnfilteredModal = (props) => {
|
|
|
2960
3180
|
}
|
|
2961
3181
|
};
|
|
2962
3182
|
const dialogProps = { ...props, isPending, handleEnable, isError, onClose };
|
|
2963
|
-
return canManageOptions ? /* @__PURE__ */
|
|
3183
|
+
return canManageOptions ? /* @__PURE__ */ React47.createElement(AdminDialog, { ...dialogProps }) : /* @__PURE__ */ React47.createElement(NonAdminDialog, { ...dialogProps });
|
|
2964
3184
|
};
|
|
2965
|
-
var AdminDialog = ({ open, onClose, handleEnable, isPending, isError }) => /* @__PURE__ */
|
|
3185
|
+
var AdminDialog = ({ open, onClose, handleEnable, isPending, isError }) => /* @__PURE__ */ React47.createElement(Dialog, { open, maxWidth: "sm", onClose: () => onClose(false) }, /* @__PURE__ */ React47.createElement(DialogHeader, { logo: false }, /* @__PURE__ */ React47.createElement(DialogTitle, null, ADMIN_TITLE_TEXT)), /* @__PURE__ */ React47.createElement(Divider3, null), /* @__PURE__ */ React47.createElement(DialogContent, null, /* @__PURE__ */ React47.createElement(DialogContentText, null, isError ? /* @__PURE__ */ React47.createElement(React47.Fragment, null, ADMIN_FAILED_CONTENT_TEXT_PT1, " ", /* @__PURE__ */ React47.createElement("br", null), " ", ADMIN_FAILED_CONTENT_TEXT_PT2) : ADMIN_CONTENT_TEXT)), /* @__PURE__ */ React47.createElement(DialogActions, null, /* @__PURE__ */ React47.createElement(Button3, { size: "medium", color: "secondary", onClick: () => onClose(false) }, __17("Cancel", "elementor")), /* @__PURE__ */ React47.createElement(
|
|
2966
3186
|
Button3,
|
|
2967
3187
|
{
|
|
2968
3188
|
size: "medium",
|
|
@@ -2971,16 +3191,16 @@ var AdminDialog = ({ open, onClose, handleEnable, isPending, isError }) => /* @_
|
|
|
2971
3191
|
color: "primary",
|
|
2972
3192
|
disabled: isPending
|
|
2973
3193
|
},
|
|
2974
|
-
isPending ? /* @__PURE__ */
|
|
3194
|
+
isPending ? /* @__PURE__ */ React47.createElement(CircularProgress2, { size: 24 }) : __17("Enable", "elementor")
|
|
2975
3195
|
)));
|
|
2976
|
-
var NonAdminDialog = ({ open, onClose }) => /* @__PURE__ */
|
|
3196
|
+
var NonAdminDialog = ({ open, onClose }) => /* @__PURE__ */ React47.createElement(Dialog, { open, maxWidth: "sm", onClose: () => onClose(false) }, /* @__PURE__ */ React47.createElement(DialogHeader, { logo: false }, /* @__PURE__ */ React47.createElement(DialogTitle, null, NON_ADMIN_TITLE_TEXT)), /* @__PURE__ */ React47.createElement(Divider3, null), /* @__PURE__ */ React47.createElement(DialogContent, null, /* @__PURE__ */ React47.createElement(DialogContentText, null, NON_ADMIN_CONTENT_TEXT)), /* @__PURE__ */ React47.createElement(DialogActions, null, /* @__PURE__ */ React47.createElement(Button3, { size: "medium", onClick: () => onClose(false), variant: "contained", color: "primary" }, __17("Got it", "elementor"))));
|
|
2977
3197
|
|
|
2978
3198
|
// src/controls/svg-media-control.tsx
|
|
2979
3199
|
var TILE_SIZE = 8;
|
|
2980
3200
|
var TILE_WHITE = "transparent";
|
|
2981
3201
|
var TILE_BLACK = "#c1c1c1";
|
|
2982
3202
|
var TILES_GRADIENT_FORMULA = `linear-gradient(45deg, ${TILE_BLACK} 25%, ${TILE_WHITE} 0, ${TILE_WHITE} 75%, ${TILE_BLACK} 0, ${TILE_BLACK})`;
|
|
2983
|
-
var StyledCard =
|
|
3203
|
+
var StyledCard = styled5(Card2)`
|
|
2984
3204
|
background-color: white;
|
|
2985
3205
|
background-image: ${TILES_GRADIENT_FORMULA}, ${TILES_GRADIENT_FORMULA};
|
|
2986
3206
|
background-size: ${TILE_SIZE}px ${TILE_SIZE}px;
|
|
@@ -2989,7 +3209,7 @@ var StyledCard = styled4(Card2)`
|
|
|
2989
3209
|
${TILE_SIZE / 2}px ${TILE_SIZE / 2}px;
|
|
2990
3210
|
border: none;
|
|
2991
3211
|
`;
|
|
2992
|
-
var StyledCardMediaContainer =
|
|
3212
|
+
var StyledCardMediaContainer = styled5(Stack13)`
|
|
2993
3213
|
position: relative;
|
|
2994
3214
|
height: 140px;
|
|
2995
3215
|
object-fit: contain;
|
|
@@ -3006,7 +3226,7 @@ var SvgMediaControl = createControl(() => {
|
|
|
3006
3226
|
const { data: attachment, isFetching } = useWpMediaAttachment2(id?.value || null);
|
|
3007
3227
|
const src = attachment?.url ?? url?.value ?? null;
|
|
3008
3228
|
const { data: allowSvgUpload } = useUnfilteredFilesUpload();
|
|
3009
|
-
const [unfilteredModalOpenState, setUnfilteredModalOpenState] =
|
|
3229
|
+
const [unfilteredModalOpenState, setUnfilteredModalOpenState] = useState11(false);
|
|
3010
3230
|
const { open } = useWpMediaFrame2({
|
|
3011
3231
|
mediaTypes: ["svg"],
|
|
3012
3232
|
multiple: false,
|
|
@@ -3034,15 +3254,15 @@ var SvgMediaControl = createControl(() => {
|
|
|
3034
3254
|
open(openOptions);
|
|
3035
3255
|
}
|
|
3036
3256
|
};
|
|
3037
|
-
return /* @__PURE__ */
|
|
3257
|
+
return /* @__PURE__ */ React48.createElement(Stack13, { gap: 1 }, /* @__PURE__ */ React48.createElement(EnableUnfilteredModal, { open: unfilteredModalOpenState, onClose: onCloseUnfilteredModal }), /* @__PURE__ */ React48.createElement(ControlActions, null, /* @__PURE__ */ React48.createElement(StyledCard, { variant: "outlined" }, /* @__PURE__ */ React48.createElement(StyledCardMediaContainer, null, isFetching ? /* @__PURE__ */ React48.createElement(CircularProgress3, { role: "progressbar" }) : /* @__PURE__ */ React48.createElement(
|
|
3038
3258
|
CardMedia2,
|
|
3039
3259
|
{
|
|
3040
3260
|
component: "img",
|
|
3041
3261
|
image: src,
|
|
3042
|
-
alt:
|
|
3262
|
+
alt: __18("Preview SVG", "elementor"),
|
|
3043
3263
|
sx: { maxHeight: "140px", width: "50px" }
|
|
3044
3264
|
}
|
|
3045
|
-
)), /* @__PURE__ */
|
|
3265
|
+
)), /* @__PURE__ */ React48.createElement(
|
|
3046
3266
|
CardOverlay2,
|
|
3047
3267
|
{
|
|
3048
3268
|
sx: {
|
|
@@ -3051,7 +3271,7 @@ var SvgMediaControl = createControl(() => {
|
|
|
3051
3271
|
}
|
|
3052
3272
|
}
|
|
3053
3273
|
},
|
|
3054
|
-
/* @__PURE__ */
|
|
3274
|
+
/* @__PURE__ */ React48.createElement(Stack13, { gap: 1 }, /* @__PURE__ */ React48.createElement(
|
|
3055
3275
|
Button4,
|
|
3056
3276
|
{
|
|
3057
3277
|
size: "tiny",
|
|
@@ -3059,95 +3279,420 @@ var SvgMediaControl = createControl(() => {
|
|
|
3059
3279
|
variant: "outlined",
|
|
3060
3280
|
onClick: () => handleClick(MODE_BROWSE)
|
|
3061
3281
|
},
|
|
3062
|
-
|
|
3063
|
-
), /* @__PURE__ */
|
|
3282
|
+
__18("Select SVG", "elementor")
|
|
3283
|
+
), /* @__PURE__ */ React48.createElement(
|
|
3064
3284
|
Button4,
|
|
3065
3285
|
{
|
|
3066
3286
|
size: "tiny",
|
|
3067
3287
|
variant: "text",
|
|
3068
3288
|
color: "inherit",
|
|
3069
|
-
startIcon: /* @__PURE__ */
|
|
3289
|
+
startIcon: /* @__PURE__ */ React48.createElement(UploadIcon2, null),
|
|
3070
3290
|
onClick: () => handleClick(MODE_UPLOAD)
|
|
3071
3291
|
},
|
|
3072
|
-
|
|
3292
|
+
__18("Upload", "elementor")
|
|
3073
3293
|
))
|
|
3074
3294
|
))));
|
|
3075
3295
|
});
|
|
3076
3296
|
|
|
3077
3297
|
// src/controls/background-control/background-control.tsx
|
|
3078
|
-
import * as
|
|
3298
|
+
import * as React65 from "react";
|
|
3079
3299
|
import { backgroundPropTypeUtil } from "@elementor/editor-props";
|
|
3080
|
-
import { isExperimentActive as isExperimentActive5 } from "@elementor/editor-v1-adapters";
|
|
3081
3300
|
import { Grid as Grid16 } from "@elementor/ui";
|
|
3082
|
-
import { __ as
|
|
3301
|
+
import { __ as __29 } from "@wordpress/i18n";
|
|
3083
3302
|
|
|
3084
3303
|
// src/controls/background-control/background-overlay/background-overlay-repeater-control.tsx
|
|
3085
|
-
import * as
|
|
3304
|
+
import * as React64 from "react";
|
|
3086
3305
|
import {
|
|
3087
3306
|
backgroundColorOverlayPropTypeUtil as backgroundColorOverlayPropTypeUtil2,
|
|
3088
3307
|
backgroundImageOverlayPropTypeUtil as backgroundImageOverlayPropTypeUtil2,
|
|
3089
3308
|
backgroundOverlayPropTypeUtil,
|
|
3090
3309
|
colorPropTypeUtil as colorPropTypeUtil3
|
|
3091
3310
|
} from "@elementor/editor-props";
|
|
3092
|
-
import { Box as
|
|
3311
|
+
import { Box as Box9, CardMedia as CardMedia3, styled as styled6, Tab, TabPanel, Tabs, UnstableColorIndicator as UnstableColorIndicator2 } from "@elementor/ui";
|
|
3093
3312
|
import { useWpMediaAttachment as useWpMediaAttachment3 } from "@elementor/wp-media";
|
|
3094
|
-
import { __ as
|
|
3313
|
+
import { __ as __28 } from "@wordpress/i18n";
|
|
3095
3314
|
|
|
3096
|
-
// src/
|
|
3097
|
-
import
|
|
3098
|
-
|
|
3315
|
+
// src/components/unstable-repeater/actions/add-item-action.tsx
|
|
3316
|
+
import * as React50 from "react";
|
|
3317
|
+
import { PlusIcon as PlusIcon3 } from "@elementor/icons";
|
|
3318
|
+
import { IconButton as IconButton4, Tooltip as Tooltip6 } from "@elementor/ui";
|
|
3319
|
+
import { __ as __19 } from "@wordpress/i18n";
|
|
3099
3320
|
|
|
3100
|
-
// src/
|
|
3101
|
-
import * as
|
|
3102
|
-
import {
|
|
3103
|
-
|
|
3104
|
-
|
|
3105
|
-
|
|
3106
|
-
|
|
3107
|
-
|
|
3108
|
-
|
|
3109
|
-
}
|
|
3110
|
-
|
|
3111
|
-
|
|
3112
|
-
|
|
3113
|
-
|
|
3114
|
-
|
|
3115
|
-
|
|
3116
|
-
|
|
3117
|
-
|
|
3118
|
-
|
|
3321
|
+
// src/components/unstable-repeater/context/repeater-context.tsx
|
|
3322
|
+
import * as React49 from "react";
|
|
3323
|
+
import { createContext as createContext7, useState as useState12 } from "react";
|
|
3324
|
+
var RepeaterContext = createContext7(null);
|
|
3325
|
+
var EMPTY_OPEN_ITEM2 = -1;
|
|
3326
|
+
var useRepeaterContext = () => {
|
|
3327
|
+
const context = React49.useContext(RepeaterContext);
|
|
3328
|
+
if (!context) {
|
|
3329
|
+
throw new Error("useRepeaterContext must be used within a RepeaterContextProvider");
|
|
3330
|
+
}
|
|
3331
|
+
return {
|
|
3332
|
+
isOpen: context.isOpen,
|
|
3333
|
+
openItem: context.openItem,
|
|
3334
|
+
setOpenItem: context.setOpenItem,
|
|
3335
|
+
items: context.items,
|
|
3336
|
+
setItems: context.setItems,
|
|
3337
|
+
uniqueKeys: context.uniqueKeys,
|
|
3338
|
+
setUniqueKeys: context.setUniqueKeys,
|
|
3339
|
+
initial: context.initial,
|
|
3340
|
+
isSortable: context.isSortable,
|
|
3341
|
+
generateNextKey: context.generateNextKey,
|
|
3342
|
+
sortItemsByKeys: context.sortItemsByKeys,
|
|
3343
|
+
addItem: context.addItem,
|
|
3344
|
+
updateItem: context.updateItem,
|
|
3345
|
+
removeItem: context.removeItem
|
|
3119
3346
|
};
|
|
3120
|
-
|
|
3121
|
-
|
|
3122
|
-
|
|
3123
|
-
|
|
3124
|
-
|
|
3125
|
-
|
|
3126
|
-
|
|
3127
|
-
|
|
3128
|
-
|
|
3129
|
-
|
|
3130
|
-
|
|
3131
|
-
|
|
3347
|
+
};
|
|
3348
|
+
var RepeaterContextProvider = ({
|
|
3349
|
+
children,
|
|
3350
|
+
initial,
|
|
3351
|
+
propTypeUtil,
|
|
3352
|
+
isSortable = true
|
|
3353
|
+
}) => {
|
|
3354
|
+
const { value: repeaterValues, setValue: setRepeaterValues } = useBoundProp(propTypeUtil);
|
|
3355
|
+
const [items2, setItems] = useSyncExternalState({
|
|
3356
|
+
external: repeaterValues,
|
|
3357
|
+
fallback: () => [],
|
|
3358
|
+
setExternal: setRepeaterValues,
|
|
3359
|
+
persistWhen: () => true
|
|
3132
3360
|
});
|
|
3133
|
-
const
|
|
3134
|
-
|
|
3135
|
-
|
|
3136
|
-
|
|
3137
|
-
|
|
3138
|
-
|
|
3139
|
-
|
|
3140
|
-
|
|
3141
|
-
|
|
3142
|
-
|
|
3143
|
-
|
|
3144
|
-
|
|
3145
|
-
|
|
3146
|
-
|
|
3147
|
-
|
|
3148
|
-
|
|
3149
|
-
|
|
3150
|
-
|
|
3361
|
+
const [openItem, setOpenItem] = useState12(EMPTY_OPEN_ITEM2);
|
|
3362
|
+
const [uniqueKeys, setUniqueKeys] = useState12(items2?.map((_, index) => index) ?? []);
|
|
3363
|
+
const isOpen = openItem !== EMPTY_OPEN_ITEM2;
|
|
3364
|
+
const sortItemsByKeys = (keysOrder) => {
|
|
3365
|
+
setUniqueKeys(keysOrder);
|
|
3366
|
+
setItems(
|
|
3367
|
+
(prevItems) => keysOrder.map((key) => {
|
|
3368
|
+
const index = uniqueKeys.indexOf(key);
|
|
3369
|
+
return prevItems[index];
|
|
3370
|
+
})
|
|
3371
|
+
);
|
|
3372
|
+
};
|
|
3373
|
+
const addItem = (config) => {
|
|
3374
|
+
const item = config?.item ?? initial;
|
|
3375
|
+
const index = config?.index ?? items2.length;
|
|
3376
|
+
const newItems = [...items2];
|
|
3377
|
+
newItems.splice(index, 0, item);
|
|
3378
|
+
setItems(newItems);
|
|
3379
|
+
setUniqueKeys(newItems.map((_, i) => i));
|
|
3380
|
+
setOpenItem(index);
|
|
3381
|
+
};
|
|
3382
|
+
const removeItem = (index) => {
|
|
3383
|
+
setItems((prevItems) => prevItems.filter((_, pos) => pos !== index));
|
|
3384
|
+
setUniqueKeys((prevKeys) => prevKeys.slice(0, -1));
|
|
3385
|
+
};
|
|
3386
|
+
const updateItem = (updatedItem, index) => {
|
|
3387
|
+
setItems((prevItems) => prevItems.map((item, pos) => pos === index ? updatedItem : item));
|
|
3388
|
+
};
|
|
3389
|
+
return /* @__PURE__ */ React49.createElement(
|
|
3390
|
+
RepeaterContext.Provider,
|
|
3391
|
+
{
|
|
3392
|
+
value: {
|
|
3393
|
+
isOpen,
|
|
3394
|
+
openItem,
|
|
3395
|
+
setOpenItem,
|
|
3396
|
+
items: items2 ?? [],
|
|
3397
|
+
setItems,
|
|
3398
|
+
initial,
|
|
3399
|
+
uniqueKeys,
|
|
3400
|
+
setUniqueKeys,
|
|
3401
|
+
isSortable,
|
|
3402
|
+
generateNextKey,
|
|
3403
|
+
sortItemsByKeys,
|
|
3404
|
+
addItem,
|
|
3405
|
+
updateItem,
|
|
3406
|
+
removeItem
|
|
3407
|
+
}
|
|
3408
|
+
},
|
|
3409
|
+
children
|
|
3410
|
+
);
|
|
3411
|
+
};
|
|
3412
|
+
var generateNextKey = (source) => {
|
|
3413
|
+
return 1 + Math.max(0, ...source);
|
|
3414
|
+
};
|
|
3415
|
+
|
|
3416
|
+
// src/components/unstable-repeater/actions/add-item-action.tsx
|
|
3417
|
+
var SIZE4 = "tiny";
|
|
3418
|
+
var AddItemAction = ({
|
|
3419
|
+
disabled = false,
|
|
3420
|
+
tooltip = false,
|
|
3421
|
+
tooltipContent = null,
|
|
3422
|
+
newItemIndex
|
|
3423
|
+
}) => {
|
|
3424
|
+
const { addItem } = useRepeaterContext();
|
|
3425
|
+
const shouldShowTooltip = tooltip && tooltipContent;
|
|
3426
|
+
const onClick = () => addItem({ index: newItemIndex });
|
|
3427
|
+
return /* @__PURE__ */ React50.createElement(ConditionalToolTip, { content: tooltipContent, shouldShowTooltip: !!shouldShowTooltip }, /* @__PURE__ */ React50.createElement(
|
|
3428
|
+
IconButton4,
|
|
3429
|
+
{
|
|
3430
|
+
size: SIZE4,
|
|
3431
|
+
sx: { ml: "auto" },
|
|
3432
|
+
disabled,
|
|
3433
|
+
onClick,
|
|
3434
|
+
"aria-label": __19("Add item", "elementor")
|
|
3435
|
+
},
|
|
3436
|
+
/* @__PURE__ */ React50.createElement(PlusIcon3, { fontSize: SIZE4 })
|
|
3437
|
+
));
|
|
3438
|
+
};
|
|
3439
|
+
var ConditionalToolTip = ({
|
|
3440
|
+
children,
|
|
3441
|
+
content,
|
|
3442
|
+
shouldShowTooltip
|
|
3443
|
+
}) => {
|
|
3444
|
+
return shouldShowTooltip ? /* @__PURE__ */ React50.createElement(Tooltip6, { title: content }, children) : children;
|
|
3445
|
+
};
|
|
3446
|
+
|
|
3447
|
+
// src/components/unstable-repeater/header/header.tsx
|
|
3448
|
+
import * as React51 from "react";
|
|
3449
|
+
import { Stack as Stack14, Typography as Typography5 } from "@elementor/ui";
|
|
3450
|
+
var Header = ({ label, children }) => {
|
|
3451
|
+
const { value } = useBoundProp();
|
|
3452
|
+
return /* @__PURE__ */ React51.createElement(Stack14, { direction: "row", justifyContent: "start", alignItems: "center", gap: 1, sx: { marginInlineEnd: -0.75 } }, /* @__PURE__ */ React51.createElement(Typography5, { component: "label", variant: "caption", color: "text.secondary" }, label), /* @__PURE__ */ React51.createElement(RepeaterHeaderActionsSlot, { value }), /* @__PURE__ */ React51.createElement(SlotChildren, { whitelist: [AddItemAction] }, children), /* @__PURE__ */ React51.createElement(ControlAdornments, null));
|
|
3453
|
+
};
|
|
3454
|
+
|
|
3455
|
+
// src/components/unstable-repeater/items/items-container.tsx
|
|
3456
|
+
import * as React52 from "react";
|
|
3457
|
+
var ItemsContainer = ({
|
|
3458
|
+
itemTemplate,
|
|
3459
|
+
children
|
|
3460
|
+
}) => {
|
|
3461
|
+
const { items: items2, uniqueKeys, openItem, isSortable, sortItemsByKeys } = useRepeaterContext();
|
|
3462
|
+
if (!itemTemplate) {
|
|
3463
|
+
return null;
|
|
3464
|
+
}
|
|
3465
|
+
const onChangeOrder = (newOrder) => {
|
|
3466
|
+
sortItemsByKeys(newOrder);
|
|
3467
|
+
};
|
|
3468
|
+
return /* @__PURE__ */ React52.createElement(React52.Fragment, null, /* @__PURE__ */ React52.createElement(SortableProvider, { value: uniqueKeys, onChange: onChangeOrder }, uniqueKeys?.map((key, index) => {
|
|
3469
|
+
const value = items2?.[index];
|
|
3470
|
+
if (!value) {
|
|
3471
|
+
return null;
|
|
3472
|
+
}
|
|
3473
|
+
return /* @__PURE__ */ React52.createElement(SortableItem, { id: key, key: `sortable-${key}`, disabled: !isSortable }, React52.isValidElement(itemTemplate) ? React52.cloneElement(itemTemplate, {
|
|
3474
|
+
key,
|
|
3475
|
+
value,
|
|
3476
|
+
index,
|
|
3477
|
+
openOnMount: key === openItem,
|
|
3478
|
+
children
|
|
3479
|
+
}) : null);
|
|
3480
|
+
})));
|
|
3481
|
+
};
|
|
3482
|
+
|
|
3483
|
+
// src/components/unstable-repeater/items/item.tsx
|
|
3484
|
+
import * as React57 from "react";
|
|
3485
|
+
import { useState as useState14 } from "react";
|
|
3486
|
+
import { bindTrigger as bindTrigger4, UnstableTag as UnstableTag3 } from "@elementor/ui";
|
|
3487
|
+
import { __ as __23 } from "@wordpress/i18n";
|
|
3488
|
+
|
|
3489
|
+
// src/components/unstable-repeater/actions/disable-item-action.tsx
|
|
3490
|
+
import * as React53 from "react";
|
|
3491
|
+
import { EyeIcon as EyeIcon2, EyeOffIcon as EyeOffIcon2 } from "@elementor/icons";
|
|
3492
|
+
import { IconButton as IconButton5, Tooltip as Tooltip7 } from "@elementor/ui";
|
|
3493
|
+
import { __ as __20 } from "@wordpress/i18n";
|
|
3494
|
+
var SIZE5 = "tiny";
|
|
3495
|
+
var DisableItemAction = ({ index = -1 }) => {
|
|
3496
|
+
const { items: items2, updateItem } = useRepeaterContext();
|
|
3497
|
+
if (index === -1) {
|
|
3498
|
+
return null;
|
|
3499
|
+
}
|
|
3500
|
+
const propDisabled = items2[index]?.disabled ?? false;
|
|
3501
|
+
const toggleLabel = propDisabled ? __20("Show", "elementor") : __20("Hide", "elementor");
|
|
3502
|
+
const onClick = () => {
|
|
3503
|
+
const self = structuredClone(items2[index]);
|
|
3504
|
+
self.disabled = !self.disabled;
|
|
3505
|
+
if (!self.disabled) {
|
|
3506
|
+
delete self.disabled;
|
|
3507
|
+
}
|
|
3508
|
+
updateItem(self, index);
|
|
3509
|
+
};
|
|
3510
|
+
return /* @__PURE__ */ React53.createElement(Tooltip7, { title: toggleLabel, placement: "top" }, /* @__PURE__ */ React53.createElement(IconButton5, { size: SIZE5, onClick, "aria-label": toggleLabel }, propDisabled ? /* @__PURE__ */ React53.createElement(EyeOffIcon2, { fontSize: SIZE5 }) : /* @__PURE__ */ React53.createElement(EyeIcon2, { fontSize: SIZE5 })));
|
|
3511
|
+
};
|
|
3512
|
+
|
|
3513
|
+
// src/components/unstable-repeater/actions/duplicate-item-action.tsx
|
|
3514
|
+
import * as React54 from "react";
|
|
3515
|
+
import { CopyIcon as CopyIcon2 } from "@elementor/icons";
|
|
3516
|
+
import { IconButton as IconButton6, Tooltip as Tooltip8 } from "@elementor/ui";
|
|
3517
|
+
import { __ as __21 } from "@wordpress/i18n";
|
|
3518
|
+
var SIZE6 = "tiny";
|
|
3519
|
+
var DuplicateItemAction = ({ index = -1 }) => {
|
|
3520
|
+
const { items: items2, addItem } = useRepeaterContext();
|
|
3521
|
+
if (index === -1) {
|
|
3522
|
+
return null;
|
|
3523
|
+
}
|
|
3524
|
+
const duplicateLabel = __21("Duplicate", "elementor");
|
|
3525
|
+
const onClick = () => {
|
|
3526
|
+
const newItem = structuredClone(items2[index]);
|
|
3527
|
+
addItem({ item: newItem, index: index + 1 });
|
|
3528
|
+
};
|
|
3529
|
+
return /* @__PURE__ */ React54.createElement(Tooltip8, { title: duplicateLabel, placement: "top" }, /* @__PURE__ */ React54.createElement(IconButton6, { size: SIZE6, onClick, "aria-label": duplicateLabel }, /* @__PURE__ */ React54.createElement(CopyIcon2, { fontSize: SIZE6 })));
|
|
3530
|
+
};
|
|
3531
|
+
|
|
3532
|
+
// src/components/unstable-repeater/actions/remove-item-action.tsx
|
|
3533
|
+
import * as React55 from "react";
|
|
3534
|
+
import { XIcon as XIcon3 } from "@elementor/icons";
|
|
3535
|
+
import { IconButton as IconButton7, Tooltip as Tooltip9 } from "@elementor/ui";
|
|
3536
|
+
import { __ as __22 } from "@wordpress/i18n";
|
|
3537
|
+
var SIZE7 = "tiny";
|
|
3538
|
+
var RemoveItemAction = ({ index = -1 }) => {
|
|
3539
|
+
const { removeItem } = useRepeaterContext();
|
|
3540
|
+
if (index === -1) {
|
|
3541
|
+
return null;
|
|
3542
|
+
}
|
|
3543
|
+
const removeLabel = __22("Remove", "elementor");
|
|
3544
|
+
const onClick = () => removeItem(index);
|
|
3545
|
+
return /* @__PURE__ */ React55.createElement(Tooltip9, { title: removeLabel, placement: "top" }, /* @__PURE__ */ React55.createElement(IconButton7, { size: SIZE7, onClick, "aria-label": removeLabel }, /* @__PURE__ */ React55.createElement(XIcon3, { fontSize: SIZE7 })));
|
|
3546
|
+
};
|
|
3547
|
+
|
|
3548
|
+
// src/components/unstable-repeater/items/edit-item-popover.tsx
|
|
3549
|
+
import * as React56 from "react";
|
|
3550
|
+
import { Box as Box8, Popover as Popover5 } from "@elementor/ui";
|
|
3551
|
+
var EditItemPopover = ({ children, anchorRef, setAnchorEl, popoverProps }) => {
|
|
3552
|
+
return /* @__PURE__ */ React56.createElement(
|
|
3553
|
+
Popover5,
|
|
3554
|
+
{
|
|
3555
|
+
disablePortal: true,
|
|
3556
|
+
slotProps: {
|
|
3557
|
+
paper: {
|
|
3558
|
+
ref: setAnchorEl,
|
|
3559
|
+
sx: { mt: 0.5, width: anchorRef?.offsetWidth }
|
|
3560
|
+
}
|
|
3561
|
+
},
|
|
3562
|
+
anchorOrigin: { vertical: "bottom", horizontal: "left" },
|
|
3563
|
+
anchorEl: anchorRef,
|
|
3564
|
+
...popoverProps
|
|
3565
|
+
},
|
|
3566
|
+
/* @__PURE__ */ React56.createElement(Box8, null, children)
|
|
3567
|
+
);
|
|
3568
|
+
};
|
|
3569
|
+
|
|
3570
|
+
// src/components/unstable-repeater/items/use-popover.tsx
|
|
3571
|
+
import { useEffect as useEffect8, useState as useState13 } from "react";
|
|
3572
|
+
import { bindPopover as bindPopover5, usePopupState as usePopupState6 } from "@elementor/ui";
|
|
3573
|
+
var usePopover2 = (openOnMount, onOpen) => {
|
|
3574
|
+
const [ref, setRef] = useState13(null);
|
|
3575
|
+
const popoverState = usePopupState6({ variant: "popover" });
|
|
3576
|
+
const popoverProps = bindPopover5(popoverState);
|
|
3577
|
+
useEffect8(() => {
|
|
3578
|
+
if (openOnMount && ref) {
|
|
3579
|
+
popoverState.open(ref);
|
|
3580
|
+
onOpen?.();
|
|
3581
|
+
}
|
|
3582
|
+
}, [ref]);
|
|
3583
|
+
return {
|
|
3584
|
+
popoverState,
|
|
3585
|
+
ref,
|
|
3586
|
+
setRef,
|
|
3587
|
+
popoverProps
|
|
3588
|
+
};
|
|
3589
|
+
};
|
|
3590
|
+
|
|
3591
|
+
// src/components/unstable-repeater/items/item.tsx
|
|
3592
|
+
var Item = ({
|
|
3593
|
+
Label: Label3,
|
|
3594
|
+
Icon,
|
|
3595
|
+
Content: Content6,
|
|
3596
|
+
key,
|
|
3597
|
+
value,
|
|
3598
|
+
index,
|
|
3599
|
+
openOnMount,
|
|
3600
|
+
children
|
|
3601
|
+
}) => {
|
|
3602
|
+
const [anchorEl, setAnchorEl] = useState14(null);
|
|
3603
|
+
const { popoverState, popoverProps, ref, setRef } = usePopover2(openOnMount, () => {
|
|
3604
|
+
});
|
|
3605
|
+
return /* @__PURE__ */ React57.createElement(React57.Fragment, null, /* @__PURE__ */ React57.createElement(
|
|
3606
|
+
UnstableTag3,
|
|
3607
|
+
{
|
|
3608
|
+
key,
|
|
3609
|
+
disabled: false,
|
|
3610
|
+
label: /* @__PURE__ */ React57.createElement(RepeaterItemLabelSlot, { value }, /* @__PURE__ */ React57.createElement(Label3, { value })),
|
|
3611
|
+
showActionsOnHover: true,
|
|
3612
|
+
fullWidth: true,
|
|
3613
|
+
ref: setRef,
|
|
3614
|
+
variant: "outlined",
|
|
3615
|
+
"aria-label": __23("Open item", "elementor"),
|
|
3616
|
+
...bindTrigger4(popoverState),
|
|
3617
|
+
startIcon: /* @__PURE__ */ React57.createElement(RepeaterItemIconSlot, { value }, /* @__PURE__ */ React57.createElement(Icon, { value })),
|
|
3618
|
+
actions: /* @__PURE__ */ React57.createElement(React57.Fragment, null, /* @__PURE__ */ React57.createElement(RepeaterItemActionsSlot, { index: index ?? -1 }), /* @__PURE__ */ React57.createElement(
|
|
3619
|
+
SlotChildren,
|
|
3620
|
+
{
|
|
3621
|
+
whitelist: [DuplicateItemAction, DisableItemAction, RemoveItemAction],
|
|
3622
|
+
props: { index },
|
|
3623
|
+
sorted: true
|
|
3624
|
+
},
|
|
3625
|
+
children
|
|
3626
|
+
))
|
|
3627
|
+
}
|
|
3628
|
+
), /* @__PURE__ */ React57.createElement(EditItemPopover, { anchorRef: ref, setAnchorEl, popoverProps }, /* @__PURE__ */ React57.createElement(Content6, { anchorEl, bind: String(index), value })));
|
|
3629
|
+
};
|
|
3630
|
+
|
|
3631
|
+
// src/components/unstable-repeater/unstable-repeater.tsx
|
|
3632
|
+
import * as React58 from "react";
|
|
3633
|
+
var UnstableRepeater = ({
|
|
3634
|
+
children,
|
|
3635
|
+
initial,
|
|
3636
|
+
propTypeUtil
|
|
3637
|
+
}) => {
|
|
3638
|
+
return /* @__PURE__ */ React58.createElement(SectionContent, null, /* @__PURE__ */ React58.createElement(RepeaterContextProvider, { initial, propTypeUtil }, /* @__PURE__ */ React58.createElement(SlotChildren, { whitelist: [Header, ItemsContainer], sorted: true }, children)));
|
|
3639
|
+
};
|
|
3640
|
+
|
|
3641
|
+
// src/env.ts
|
|
3642
|
+
import { parseEnv } from "@elementor/env";
|
|
3643
|
+
var { env } = parseEnv("@elementor/editor-controls");
|
|
3644
|
+
|
|
3645
|
+
// src/controls/background-control/background-gradient-color-control.tsx
|
|
3646
|
+
import * as React59 from "react";
|
|
3647
|
+
import {
|
|
3648
|
+
backgroundGradientOverlayPropTypeUtil,
|
|
3649
|
+
colorPropTypeUtil as colorPropTypeUtil2,
|
|
3650
|
+
colorStopPropTypeUtil,
|
|
3651
|
+
gradientColorStopPropTypeUtil,
|
|
3652
|
+
numberPropTypeUtil as numberPropTypeUtil3,
|
|
3653
|
+
stringPropTypeUtil as stringPropTypeUtil8
|
|
3654
|
+
} from "@elementor/editor-props";
|
|
3655
|
+
import { UnstableGradientBox } from "@elementor/ui";
|
|
3656
|
+
var BackgroundGradientColorControl = createControl(() => {
|
|
3657
|
+
const { value, setValue } = useBoundProp(backgroundGradientOverlayPropTypeUtil);
|
|
3658
|
+
const handleChange = (newValue) => {
|
|
3659
|
+
const transformedValue = createTransformableValue(newValue);
|
|
3660
|
+
if (transformedValue.positions) {
|
|
3661
|
+
transformedValue.positions = stringPropTypeUtil8.create(newValue.positions.join(" "));
|
|
3662
|
+
}
|
|
3663
|
+
setValue(transformedValue);
|
|
3664
|
+
};
|
|
3665
|
+
const createTransformableValue = (newValue) => ({
|
|
3666
|
+
...newValue,
|
|
3667
|
+
type: stringPropTypeUtil8.create(newValue.type),
|
|
3668
|
+
angle: numberPropTypeUtil3.create(newValue.angle),
|
|
3669
|
+
stops: gradientColorStopPropTypeUtil.create(
|
|
3670
|
+
newValue.stops.map(
|
|
3671
|
+
({ color, offset }) => colorStopPropTypeUtil.create({
|
|
3672
|
+
color: colorPropTypeUtil2.create(color),
|
|
3673
|
+
offset: numberPropTypeUtil3.create(offset)
|
|
3674
|
+
})
|
|
3675
|
+
)
|
|
3676
|
+
)
|
|
3677
|
+
});
|
|
3678
|
+
const normalizeValue = () => {
|
|
3679
|
+
if (!value) {
|
|
3680
|
+
return;
|
|
3681
|
+
}
|
|
3682
|
+
const { type, angle, stops, positions } = value;
|
|
3683
|
+
return {
|
|
3684
|
+
type: type.value,
|
|
3685
|
+
angle: angle.value,
|
|
3686
|
+
stops: stops.value.map(({ value: { color, offset } }) => ({
|
|
3687
|
+
color: color.value,
|
|
3688
|
+
offset: offset.value
|
|
3689
|
+
})),
|
|
3690
|
+
positions: positions?.value.split(" ")
|
|
3691
|
+
};
|
|
3692
|
+
};
|
|
3693
|
+
return /* @__PURE__ */ React59.createElement(ControlActions, null, /* @__PURE__ */ React59.createElement(
|
|
3694
|
+
UnstableGradientBox,
|
|
3695
|
+
{
|
|
3151
3696
|
sx: { width: "auto", padding: 1.5 },
|
|
3152
3697
|
value: normalizeValue(),
|
|
3153
3698
|
onChange: handleChange
|
|
@@ -3170,53 +3715,53 @@ var initialBackgroundGradientOverlay = backgroundGradientOverlayPropTypeUtil.cre
|
|
|
3170
3715
|
});
|
|
3171
3716
|
|
|
3172
3717
|
// src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-attachment.tsx
|
|
3173
|
-
import * as
|
|
3718
|
+
import * as React60 from "react";
|
|
3174
3719
|
import { PinIcon, PinnedOffIcon } from "@elementor/icons";
|
|
3175
3720
|
import { Grid as Grid12 } from "@elementor/ui";
|
|
3176
|
-
import { __ as
|
|
3721
|
+
import { __ as __24 } from "@wordpress/i18n";
|
|
3177
3722
|
var attachmentControlOptions = [
|
|
3178
3723
|
{
|
|
3179
3724
|
value: "fixed",
|
|
3180
|
-
label:
|
|
3181
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
3725
|
+
label: __24("Fixed", "elementor"),
|
|
3726
|
+
renderContent: ({ size }) => /* @__PURE__ */ React60.createElement(PinIcon, { fontSize: size }),
|
|
3182
3727
|
showTooltip: true
|
|
3183
3728
|
},
|
|
3184
3729
|
{
|
|
3185
3730
|
value: "scroll",
|
|
3186
|
-
label:
|
|
3187
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
3731
|
+
label: __24("Scroll", "elementor"),
|
|
3732
|
+
renderContent: ({ size }) => /* @__PURE__ */ React60.createElement(PinnedOffIcon, { fontSize: size }),
|
|
3188
3733
|
showTooltip: true
|
|
3189
3734
|
}
|
|
3190
3735
|
];
|
|
3191
3736
|
var BackgroundImageOverlayAttachment = () => {
|
|
3192
|
-
return /* @__PURE__ */
|
|
3737
|
+
return /* @__PURE__ */ React60.createElement(PopoverGridContainer, null, /* @__PURE__ */ React60.createElement(Grid12, { item: true, xs: 6 }, /* @__PURE__ */ React60.createElement(ControlFormLabel, null, __24("Attachment", "elementor"))), /* @__PURE__ */ React60.createElement(Grid12, { item: true, xs: 6, sx: { display: "flex", justifyContent: "flex-end", overflow: "hidden" } }, /* @__PURE__ */ React60.createElement(ToggleControl, { options: attachmentControlOptions })));
|
|
3193
3738
|
};
|
|
3194
3739
|
|
|
3195
3740
|
// src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-position.tsx
|
|
3196
|
-
import * as
|
|
3197
|
-
import { useRef as
|
|
3741
|
+
import * as React61 from "react";
|
|
3742
|
+
import { useRef as useRef11 } from "react";
|
|
3198
3743
|
import { backgroundImagePositionOffsetPropTypeUtil, stringPropTypeUtil as stringPropTypeUtil9 } from "@elementor/editor-props";
|
|
3199
|
-
import { MenuListItem as
|
|
3744
|
+
import { MenuListItem as MenuListItem4 } from "@elementor/editor-ui";
|
|
3200
3745
|
import { LetterXIcon, LetterYIcon } from "@elementor/icons";
|
|
3201
|
-
import { Grid as Grid13, Select as
|
|
3202
|
-
import { __ as
|
|
3746
|
+
import { Grid as Grid13, Select as Select3 } from "@elementor/ui";
|
|
3747
|
+
import { __ as __25 } from "@wordpress/i18n";
|
|
3203
3748
|
var backgroundPositionOptions = [
|
|
3204
|
-
{ label:
|
|
3205
|
-
{ label:
|
|
3206
|
-
{ label:
|
|
3207
|
-
{ label:
|
|
3208
|
-
{ label:
|
|
3209
|
-
{ label:
|
|
3210
|
-
{ label:
|
|
3211
|
-
{ label:
|
|
3212
|
-
{ label:
|
|
3213
|
-
{ label:
|
|
3749
|
+
{ label: __25("Center center", "elementor"), value: "center center" },
|
|
3750
|
+
{ label: __25("Center left", "elementor"), value: "center left" },
|
|
3751
|
+
{ label: __25("Center right", "elementor"), value: "center right" },
|
|
3752
|
+
{ label: __25("Top center", "elementor"), value: "top center" },
|
|
3753
|
+
{ label: __25("Top left", "elementor"), value: "top left" },
|
|
3754
|
+
{ label: __25("Top right", "elementor"), value: "top right" },
|
|
3755
|
+
{ label: __25("Bottom center", "elementor"), value: "bottom center" },
|
|
3756
|
+
{ label: __25("Bottom left", "elementor"), value: "bottom left" },
|
|
3757
|
+
{ label: __25("Bottom right", "elementor"), value: "bottom right" },
|
|
3758
|
+
{ label: __25("Custom", "elementor"), value: "custom" }
|
|
3214
3759
|
];
|
|
3215
3760
|
var BackgroundImageOverlayPosition = () => {
|
|
3216
3761
|
const backgroundImageOffsetContext = useBoundProp(backgroundImagePositionOffsetPropTypeUtil);
|
|
3217
3762
|
const stringPropContext = useBoundProp(stringPropTypeUtil9);
|
|
3218
3763
|
const isCustom = !!backgroundImageOffsetContext.value;
|
|
3219
|
-
const rowRef =
|
|
3764
|
+
const rowRef = useRef11(null);
|
|
3220
3765
|
const handlePositionChange = (event) => {
|
|
3221
3766
|
const value = event.target.value || null;
|
|
3222
3767
|
if (value === "custom") {
|
|
@@ -3225,8 +3770,8 @@ var BackgroundImageOverlayPosition = () => {
|
|
|
3225
3770
|
stringPropContext.setValue(value);
|
|
3226
3771
|
}
|
|
3227
3772
|
};
|
|
3228
|
-
return /* @__PURE__ */
|
|
3229
|
-
|
|
3773
|
+
return /* @__PURE__ */ React61.createElement(Grid13, { container: true, spacing: 1.5 }, /* @__PURE__ */ React61.createElement(Grid13, { item: true, xs: 12 }, /* @__PURE__ */ React61.createElement(PopoverGridContainer, null, /* @__PURE__ */ React61.createElement(Grid13, { item: true, xs: 6 }, /* @__PURE__ */ React61.createElement(ControlFormLabel, null, __25("Position", "elementor"))), /* @__PURE__ */ React61.createElement(Grid13, { item: true, xs: 6, sx: { display: "flex", justifyContent: "flex-end", overflow: "hidden" } }, /* @__PURE__ */ React61.createElement(
|
|
3774
|
+
Select3,
|
|
3230
3775
|
{
|
|
3231
3776
|
fullWidth: true,
|
|
3232
3777
|
size: "tiny",
|
|
@@ -3234,60 +3779,60 @@ var BackgroundImageOverlayPosition = () => {
|
|
|
3234
3779
|
disabled: stringPropContext.disabled,
|
|
3235
3780
|
value: (backgroundImageOffsetContext.value ? "custom" : stringPropContext.value) ?? ""
|
|
3236
3781
|
},
|
|
3237
|
-
backgroundPositionOptions.map(({ label, value }) => /* @__PURE__ */
|
|
3238
|
-
)))), isCustom ? /* @__PURE__ */
|
|
3782
|
+
backgroundPositionOptions.map(({ label, value }) => /* @__PURE__ */ React61.createElement(MenuListItem4, { key: value, value: value ?? "" }, label))
|
|
3783
|
+
)))), isCustom ? /* @__PURE__ */ React61.createElement(PropProvider, { ...backgroundImageOffsetContext }, /* @__PURE__ */ React61.createElement(Grid13, { item: true, xs: 12 }, /* @__PURE__ */ React61.createElement(Grid13, { container: true, spacing: 1.5, ref: rowRef }, /* @__PURE__ */ React61.createElement(Grid13, { item: true, xs: 6 }, /* @__PURE__ */ React61.createElement(PropKeyProvider, { bind: "x" }, /* @__PURE__ */ React61.createElement(
|
|
3239
3784
|
SizeControl,
|
|
3240
3785
|
{
|
|
3241
|
-
startIcon: /* @__PURE__ */
|
|
3786
|
+
startIcon: /* @__PURE__ */ React61.createElement(LetterXIcon, { fontSize: "tiny" }),
|
|
3242
3787
|
anchorRef: rowRef
|
|
3243
3788
|
}
|
|
3244
|
-
))), /* @__PURE__ */
|
|
3789
|
+
))), /* @__PURE__ */ React61.createElement(Grid13, { item: true, xs: 6 }, /* @__PURE__ */ React61.createElement(PropKeyProvider, { bind: "y" }, /* @__PURE__ */ React61.createElement(
|
|
3245
3790
|
SizeControl,
|
|
3246
3791
|
{
|
|
3247
|
-
startIcon: /* @__PURE__ */
|
|
3792
|
+
startIcon: /* @__PURE__ */ React61.createElement(LetterYIcon, { fontSize: "tiny" }),
|
|
3248
3793
|
anchorRef: rowRef
|
|
3249
3794
|
}
|
|
3250
3795
|
)))))) : null);
|
|
3251
3796
|
};
|
|
3252
3797
|
|
|
3253
3798
|
// src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-repeat.tsx
|
|
3254
|
-
import * as
|
|
3255
|
-
import { DotsHorizontalIcon, DotsVerticalIcon, GridDotsIcon, XIcon as
|
|
3799
|
+
import * as React62 from "react";
|
|
3800
|
+
import { DotsHorizontalIcon, DotsVerticalIcon, GridDotsIcon, XIcon as XIcon4 } from "@elementor/icons";
|
|
3256
3801
|
import { Grid as Grid14 } from "@elementor/ui";
|
|
3257
|
-
import { __ as
|
|
3802
|
+
import { __ as __26 } from "@wordpress/i18n";
|
|
3258
3803
|
var repeatControlOptions = [
|
|
3259
3804
|
{
|
|
3260
3805
|
value: "repeat",
|
|
3261
|
-
label:
|
|
3262
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
3806
|
+
label: __26("Repeat", "elementor"),
|
|
3807
|
+
renderContent: ({ size }) => /* @__PURE__ */ React62.createElement(GridDotsIcon, { fontSize: size }),
|
|
3263
3808
|
showTooltip: true
|
|
3264
3809
|
},
|
|
3265
3810
|
{
|
|
3266
3811
|
value: "repeat-x",
|
|
3267
|
-
label:
|
|
3268
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
3812
|
+
label: __26("Repeat-x", "elementor"),
|
|
3813
|
+
renderContent: ({ size }) => /* @__PURE__ */ React62.createElement(DotsHorizontalIcon, { fontSize: size }),
|
|
3269
3814
|
showTooltip: true
|
|
3270
3815
|
},
|
|
3271
3816
|
{
|
|
3272
3817
|
value: "repeat-y",
|
|
3273
|
-
label:
|
|
3274
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
3818
|
+
label: __26("Repeat-y", "elementor"),
|
|
3819
|
+
renderContent: ({ size }) => /* @__PURE__ */ React62.createElement(DotsVerticalIcon, { fontSize: size }),
|
|
3275
3820
|
showTooltip: true
|
|
3276
3821
|
},
|
|
3277
3822
|
{
|
|
3278
3823
|
value: "no-repeat",
|
|
3279
|
-
label:
|
|
3280
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
3824
|
+
label: __26("No-repeat", "elementor"),
|
|
3825
|
+
renderContent: ({ size }) => /* @__PURE__ */ React62.createElement(XIcon4, { fontSize: size }),
|
|
3281
3826
|
showTooltip: true
|
|
3282
3827
|
}
|
|
3283
3828
|
];
|
|
3284
3829
|
var BackgroundImageOverlayRepeat = () => {
|
|
3285
|
-
return /* @__PURE__ */
|
|
3830
|
+
return /* @__PURE__ */ React62.createElement(PopoverGridContainer, null, /* @__PURE__ */ React62.createElement(Grid14, { item: true, xs: 6 }, /* @__PURE__ */ React62.createElement(ControlFormLabel, null, __26("Repeat", "elementor"))), /* @__PURE__ */ React62.createElement(Grid14, { item: true, xs: 6, sx: { display: "flex", justifyContent: "flex-end" } }, /* @__PURE__ */ React62.createElement(ToggleControl, { options: repeatControlOptions })));
|
|
3286
3831
|
};
|
|
3287
3832
|
|
|
3288
3833
|
// src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-size.tsx
|
|
3289
|
-
import * as
|
|
3290
|
-
import { useRef as
|
|
3834
|
+
import * as React63 from "react";
|
|
3835
|
+
import { useRef as useRef12 } from "react";
|
|
3291
3836
|
import { backgroundImageSizeScalePropTypeUtil, stringPropTypeUtil as stringPropTypeUtil10 } from "@elementor/editor-props";
|
|
3292
3837
|
import {
|
|
3293
3838
|
ArrowBarBothIcon,
|
|
@@ -3295,33 +3840,33 @@ import {
|
|
|
3295
3840
|
ArrowsMoveHorizontalIcon as ArrowsMoveHorizontalIcon2,
|
|
3296
3841
|
ArrowsMoveVerticalIcon as ArrowsMoveVerticalIcon2,
|
|
3297
3842
|
LetterAIcon,
|
|
3298
|
-
PencilIcon
|
|
3843
|
+
PencilIcon
|
|
3299
3844
|
} from "@elementor/icons";
|
|
3300
3845
|
import { Grid as Grid15 } from "@elementor/ui";
|
|
3301
|
-
import { __ as
|
|
3846
|
+
import { __ as __27 } from "@wordpress/i18n";
|
|
3302
3847
|
var sizeControlOptions = [
|
|
3303
3848
|
{
|
|
3304
3849
|
value: "auto",
|
|
3305
|
-
label:
|
|
3306
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
3850
|
+
label: __27("Auto", "elementor"),
|
|
3851
|
+
renderContent: ({ size }) => /* @__PURE__ */ React63.createElement(LetterAIcon, { fontSize: size }),
|
|
3307
3852
|
showTooltip: true
|
|
3308
3853
|
},
|
|
3309
3854
|
{
|
|
3310
3855
|
value: "cover",
|
|
3311
|
-
label:
|
|
3312
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
3856
|
+
label: __27("Cover", "elementor"),
|
|
3857
|
+
renderContent: ({ size }) => /* @__PURE__ */ React63.createElement(ArrowsMaximizeIcon, { fontSize: size }),
|
|
3313
3858
|
showTooltip: true
|
|
3314
3859
|
},
|
|
3315
3860
|
{
|
|
3316
3861
|
value: "contain",
|
|
3317
|
-
label:
|
|
3318
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
3862
|
+
label: __27("Contain", "elementor"),
|
|
3863
|
+
renderContent: ({ size }) => /* @__PURE__ */ React63.createElement(ArrowBarBothIcon, { fontSize: size }),
|
|
3319
3864
|
showTooltip: true
|
|
3320
3865
|
},
|
|
3321
3866
|
{
|
|
3322
3867
|
value: "custom",
|
|
3323
|
-
label:
|
|
3324
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
3868
|
+
label: __27("Custom", "elementor"),
|
|
3869
|
+
renderContent: ({ size }) => /* @__PURE__ */ React63.createElement(PencilIcon, { fontSize: size }),
|
|
3325
3870
|
showTooltip: true
|
|
3326
3871
|
}
|
|
3327
3872
|
];
|
|
@@ -3329,7 +3874,7 @@ var BackgroundImageOverlaySize = () => {
|
|
|
3329
3874
|
const backgroundImageScaleContext = useBoundProp(backgroundImageSizeScalePropTypeUtil);
|
|
3330
3875
|
const stringPropContext = useBoundProp(stringPropTypeUtil10);
|
|
3331
3876
|
const isCustom = !!backgroundImageScaleContext.value;
|
|
3332
|
-
const rowRef =
|
|
3877
|
+
const rowRef = useRef12(null);
|
|
3333
3878
|
const handleSizeChange = (size) => {
|
|
3334
3879
|
if (size === "custom") {
|
|
3335
3880
|
backgroundImageScaleContext.setValue({ width: null, height: null });
|
|
@@ -3337,7 +3882,7 @@ var BackgroundImageOverlaySize = () => {
|
|
|
3337
3882
|
stringPropContext.setValue(size);
|
|
3338
3883
|
}
|
|
3339
3884
|
};
|
|
3340
|
-
return /* @__PURE__ */
|
|
3885
|
+
return /* @__PURE__ */ React63.createElement(Grid15, { container: true, spacing: 1.5 }, /* @__PURE__ */ React63.createElement(Grid15, { item: true, xs: 12 }, /* @__PURE__ */ React63.createElement(PopoverGridContainer, null, /* @__PURE__ */ React63.createElement(Grid15, { item: true, xs: 6 }, /* @__PURE__ */ React63.createElement(ControlFormLabel, null, __27("Size", "elementor"))), /* @__PURE__ */ React63.createElement(Grid15, { item: true, xs: 6, sx: { display: "flex", justifyContent: "flex-end" } }, /* @__PURE__ */ React63.createElement(
|
|
3341
3886
|
ControlToggleButtonGroup,
|
|
3342
3887
|
{
|
|
3343
3888
|
exclusive: true,
|
|
@@ -3346,17 +3891,17 @@ var BackgroundImageOverlaySize = () => {
|
|
|
3346
3891
|
disabled: stringPropContext.disabled,
|
|
3347
3892
|
value: backgroundImageScaleContext.value ? "custom" : stringPropContext.value
|
|
3348
3893
|
}
|
|
3349
|
-
)))), isCustom ? /* @__PURE__ */
|
|
3894
|
+
)))), isCustom ? /* @__PURE__ */ React63.createElement(PropProvider, { ...backgroundImageScaleContext }, /* @__PURE__ */ React63.createElement(Grid15, { item: true, xs: 12, ref: rowRef }, /* @__PURE__ */ React63.createElement(PopoverGridContainer, null, /* @__PURE__ */ React63.createElement(Grid15, { item: true, xs: 6 }, /* @__PURE__ */ React63.createElement(PropKeyProvider, { bind: "width" }, /* @__PURE__ */ React63.createElement(
|
|
3350
3895
|
SizeControl,
|
|
3351
3896
|
{
|
|
3352
|
-
startIcon: /* @__PURE__ */
|
|
3897
|
+
startIcon: /* @__PURE__ */ React63.createElement(ArrowsMoveHorizontalIcon2, { fontSize: "tiny" }),
|
|
3353
3898
|
extendedOptions: ["auto"],
|
|
3354
3899
|
anchorRef: rowRef
|
|
3355
3900
|
}
|
|
3356
|
-
))), /* @__PURE__ */
|
|
3901
|
+
))), /* @__PURE__ */ React63.createElement(Grid15, { item: true, xs: 6 }, /* @__PURE__ */ React63.createElement(PropKeyProvider, { bind: "height" }, /* @__PURE__ */ React63.createElement(
|
|
3357
3902
|
SizeControl,
|
|
3358
3903
|
{
|
|
3359
|
-
startIcon: /* @__PURE__ */
|
|
3904
|
+
startIcon: /* @__PURE__ */ React63.createElement(ArrowsMoveVerticalIcon2, { fontSize: "tiny" }),
|
|
3360
3905
|
extendedOptions: ["auto"],
|
|
3361
3906
|
anchorRef: rowRef
|
|
3362
3907
|
}
|
|
@@ -3364,7 +3909,7 @@ var BackgroundImageOverlaySize = () => {
|
|
|
3364
3909
|
};
|
|
3365
3910
|
|
|
3366
3911
|
// src/controls/background-control/background-overlay/use-background-tabs-history.ts
|
|
3367
|
-
import { useRef as
|
|
3912
|
+
import { useRef as useRef13 } from "react";
|
|
3368
3913
|
import {
|
|
3369
3914
|
backgroundColorOverlayPropTypeUtil,
|
|
3370
3915
|
backgroundGradientOverlayPropTypeUtil as backgroundGradientOverlayPropTypeUtil2,
|
|
@@ -3389,7 +3934,7 @@ var useBackgroundTabsHistory = ({
|
|
|
3389
3934
|
return "image";
|
|
3390
3935
|
};
|
|
3391
3936
|
const { getTabsProps, getTabProps, getTabPanelProps } = useTabs(getCurrentOverlayType());
|
|
3392
|
-
const valuesHistory =
|
|
3937
|
+
const valuesHistory = useRef13({
|
|
3393
3938
|
image: initialBackgroundImageOverlay,
|
|
3394
3939
|
color: initialBackgroundColorOverlay2,
|
|
3395
3940
|
gradient: initialBackgroundGradientOverlay2
|
|
@@ -3457,32 +4002,17 @@ var getInitialBackgroundOverlay = () => ({
|
|
|
3457
4002
|
}
|
|
3458
4003
|
});
|
|
3459
4004
|
var backgroundResolutionOptions = [
|
|
3460
|
-
{ label:
|
|
3461
|
-
{ label:
|
|
3462
|
-
{ label:
|
|
3463
|
-
{ label:
|
|
4005
|
+
{ label: __28("Thumbnail - 150 x 150", "elementor"), value: "thumbnail" },
|
|
4006
|
+
{ label: __28("Medium - 300 x 300", "elementor"), value: "medium" },
|
|
4007
|
+
{ label: __28("Large 1024 x 1024", "elementor"), value: "large" },
|
|
4008
|
+
{ label: __28("Full", "elementor"), value: "full" }
|
|
3464
4009
|
];
|
|
3465
4010
|
var BackgroundOverlayRepeaterControl = createControl(() => {
|
|
3466
|
-
const { propType, value:
|
|
3467
|
-
return /* @__PURE__ */
|
|
3468
|
-
Repeater,
|
|
3469
|
-
{
|
|
3470
|
-
openOnAdd: true,
|
|
3471
|
-
disabled,
|
|
3472
|
-
values: overlayValues ?? [],
|
|
3473
|
-
setValues: setValue,
|
|
3474
|
-
label: __20("Overlay", "elementor"),
|
|
3475
|
-
itemSettings: {
|
|
3476
|
-
Icon: ItemIcon3,
|
|
3477
|
-
Label: ItemLabel3,
|
|
3478
|
-
Content: ItemContent3,
|
|
3479
|
-
initialValues: getInitialBackgroundOverlay()
|
|
3480
|
-
}
|
|
3481
|
-
}
|
|
3482
|
-
));
|
|
4011
|
+
const { propType, value: backgroundValues, setValue } = useBoundProp(backgroundOverlayPropTypeUtil);
|
|
4012
|
+
return /* @__PURE__ */ React64.createElement(PropProvider, { propType, value: backgroundValues, setValue }, /* @__PURE__ */ React64.createElement(UnstableRepeater, { initial: getInitialBackgroundOverlay(), propTypeUtil: backgroundOverlayPropTypeUtil }, /* @__PURE__ */ React64.createElement(Header, { label: __28("Overlay", "elementor") }, /* @__PURE__ */ React64.createElement(AddItemAction, { newItemIndex: 0 })), /* @__PURE__ */ React64.createElement(ItemsContainer, { itemTemplate: /* @__PURE__ */ React64.createElement(Item, { Icon: ItemIcon3, Label: ItemLabel3, Content: ItemContent3 }) }, /* @__PURE__ */ React64.createElement(DuplicateItemAction, null), /* @__PURE__ */ React64.createElement(DisableItemAction, null), /* @__PURE__ */ React64.createElement(RemoveItemAction, null))));
|
|
3483
4013
|
});
|
|
3484
4014
|
var ItemContent3 = ({ anchorEl = null, bind }) => {
|
|
3485
|
-
return /* @__PURE__ */
|
|
4015
|
+
return /* @__PURE__ */ React64.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React64.createElement(Content3, { anchorEl }));
|
|
3486
4016
|
};
|
|
3487
4017
|
var Content3 = ({ anchorEl }) => {
|
|
3488
4018
|
const { getTabsProps, getTabProps, getTabPanelProps } = useBackgroundTabsHistory({
|
|
@@ -3490,27 +4020,27 @@ var Content3 = ({ anchorEl }) => {
|
|
|
3490
4020
|
color: initialBackgroundColorOverlay.value,
|
|
3491
4021
|
gradient: initialBackgroundGradientOverlay.value
|
|
3492
4022
|
});
|
|
3493
|
-
return /* @__PURE__ */
|
|
4023
|
+
return /* @__PURE__ */ React64.createElement(Box9, { sx: { width: "100%" } }, /* @__PURE__ */ React64.createElement(Box9, { sx: { borderBottom: 1, borderColor: "divider" } }, /* @__PURE__ */ React64.createElement(
|
|
3494
4024
|
Tabs,
|
|
3495
4025
|
{
|
|
3496
4026
|
size: "small",
|
|
3497
4027
|
variant: "fullWidth",
|
|
3498
4028
|
...getTabsProps(),
|
|
3499
|
-
"aria-label":
|
|
4029
|
+
"aria-label": __28("Background Overlay", "elementor")
|
|
3500
4030
|
},
|
|
3501
|
-
/* @__PURE__ */
|
|
3502
|
-
/* @__PURE__ */
|
|
3503
|
-
/* @__PURE__ */
|
|
3504
|
-
)), /* @__PURE__ */
|
|
4031
|
+
/* @__PURE__ */ React64.createElement(Tab, { label: __28("Image", "elementor"), ...getTabProps("image") }),
|
|
4032
|
+
/* @__PURE__ */ React64.createElement(Tab, { label: __28("Gradient", "elementor"), ...getTabProps("gradient") }),
|
|
4033
|
+
/* @__PURE__ */ React64.createElement(Tab, { label: __28("Color", "elementor"), ...getTabProps("color") })
|
|
4034
|
+
)), /* @__PURE__ */ React64.createElement(TabPanel, { sx: { p: 1.5 }, ...getTabPanelProps("image") }, /* @__PURE__ */ React64.createElement(PopoverContent, null, /* @__PURE__ */ React64.createElement(ImageOverlayContent, null))), /* @__PURE__ */ React64.createElement(TabPanel, { sx: { p: 1.5 }, ...getTabPanelProps("gradient") }, /* @__PURE__ */ React64.createElement(BackgroundGradientColorControl, null)), /* @__PURE__ */ React64.createElement(TabPanel, { sx: { p: 1.5 }, ...getTabPanelProps("color") }, /* @__PURE__ */ React64.createElement(PopoverContent, null, /* @__PURE__ */ React64.createElement(ColorOverlayContent, { anchorEl }))));
|
|
3505
4035
|
};
|
|
3506
4036
|
var ItemIcon3 = ({ value }) => {
|
|
3507
4037
|
switch (value.$$type) {
|
|
3508
4038
|
case "background-image-overlay":
|
|
3509
|
-
return /* @__PURE__ */
|
|
4039
|
+
return /* @__PURE__ */ React64.createElement(ItemIconImage, { value });
|
|
3510
4040
|
case "background-color-overlay":
|
|
3511
|
-
return /* @__PURE__ */
|
|
4041
|
+
return /* @__PURE__ */ React64.createElement(ItemIconColor, { value });
|
|
3512
4042
|
case "background-gradient-overlay":
|
|
3513
|
-
return /* @__PURE__ */
|
|
4043
|
+
return /* @__PURE__ */ React64.createElement(ItemIconGradient, { value });
|
|
3514
4044
|
default:
|
|
3515
4045
|
return null;
|
|
3516
4046
|
}
|
|
@@ -3523,11 +4053,11 @@ var extractColorFrom = (prop) => {
|
|
|
3523
4053
|
};
|
|
3524
4054
|
var ItemIconColor = ({ value: prop }) => {
|
|
3525
4055
|
const color = extractColorFrom(prop);
|
|
3526
|
-
return /* @__PURE__ */
|
|
4056
|
+
return /* @__PURE__ */ React64.createElement(StyledUnstableColorIndicator, { size: "inherit", component: "span", value: color });
|
|
3527
4057
|
};
|
|
3528
4058
|
var ItemIconImage = ({ value }) => {
|
|
3529
4059
|
const { imageUrl } = useImage(value);
|
|
3530
|
-
return /* @__PURE__ */
|
|
4060
|
+
return /* @__PURE__ */ React64.createElement(
|
|
3531
4061
|
CardMedia3,
|
|
3532
4062
|
{
|
|
3533
4063
|
image: imageUrl,
|
|
@@ -3542,43 +4072,43 @@ var ItemIconImage = ({ value }) => {
|
|
|
3542
4072
|
};
|
|
3543
4073
|
var ItemIconGradient = ({ value }) => {
|
|
3544
4074
|
const gradient = getGradientValue(value);
|
|
3545
|
-
return /* @__PURE__ */
|
|
4075
|
+
return /* @__PURE__ */ React64.createElement(StyledUnstableColorIndicator, { size: "inherit", component: "span", value: gradient });
|
|
3546
4076
|
};
|
|
3547
4077
|
var ItemLabel3 = ({ value }) => {
|
|
3548
4078
|
switch (value.$$type) {
|
|
3549
4079
|
case "background-image-overlay":
|
|
3550
|
-
return /* @__PURE__ */
|
|
4080
|
+
return /* @__PURE__ */ React64.createElement(ItemLabelImage, { value });
|
|
3551
4081
|
case "background-color-overlay":
|
|
3552
|
-
return /* @__PURE__ */
|
|
4082
|
+
return /* @__PURE__ */ React64.createElement(ItemLabelColor, { value });
|
|
3553
4083
|
case "background-gradient-overlay":
|
|
3554
|
-
return /* @__PURE__ */
|
|
4084
|
+
return /* @__PURE__ */ React64.createElement(ItemLabelGradient, { value });
|
|
3555
4085
|
default:
|
|
3556
4086
|
return null;
|
|
3557
4087
|
}
|
|
3558
4088
|
};
|
|
3559
4089
|
var ItemLabelColor = ({ value: prop }) => {
|
|
3560
4090
|
const color = extractColorFrom(prop);
|
|
3561
|
-
return /* @__PURE__ */
|
|
4091
|
+
return /* @__PURE__ */ React64.createElement("span", null, color);
|
|
3562
4092
|
};
|
|
3563
4093
|
var ItemLabelImage = ({ value }) => {
|
|
3564
4094
|
const { imageTitle } = useImage(value);
|
|
3565
|
-
return /* @__PURE__ */
|
|
4095
|
+
return /* @__PURE__ */ React64.createElement("span", null, imageTitle);
|
|
3566
4096
|
};
|
|
3567
4097
|
var ItemLabelGradient = ({ value }) => {
|
|
3568
4098
|
if (value.value.type.value === "linear") {
|
|
3569
|
-
return /* @__PURE__ */
|
|
4099
|
+
return /* @__PURE__ */ React64.createElement("span", null, __28("Linear Gradient", "elementor"));
|
|
3570
4100
|
}
|
|
3571
|
-
return /* @__PURE__ */
|
|
4101
|
+
return /* @__PURE__ */ React64.createElement("span", null, __28("Radial Gradient", "elementor"));
|
|
3572
4102
|
};
|
|
3573
4103
|
var ColorOverlayContent = ({ anchorEl }) => {
|
|
3574
4104
|
const propContext = useBoundProp(backgroundColorOverlayPropTypeUtil2);
|
|
3575
|
-
return /* @__PURE__ */
|
|
4105
|
+
return /* @__PURE__ */ React64.createElement(PropProvider, { ...propContext }, /* @__PURE__ */ React64.createElement(PropKeyProvider, { bind: "color" }, /* @__PURE__ */ React64.createElement(ColorControl, { anchorEl })));
|
|
3576
4106
|
};
|
|
3577
4107
|
var ImageOverlayContent = () => {
|
|
3578
4108
|
const propContext = useBoundProp(backgroundImageOverlayPropTypeUtil2);
|
|
3579
|
-
return /* @__PURE__ */
|
|
4109
|
+
return /* @__PURE__ */ React64.createElement(PropProvider, { ...propContext }, /* @__PURE__ */ React64.createElement(PropKeyProvider, { bind: "image" }, /* @__PURE__ */ React64.createElement(ImageControl, { sizes: backgroundResolutionOptions })), /* @__PURE__ */ React64.createElement(PropKeyProvider, { bind: "position" }, /* @__PURE__ */ React64.createElement(BackgroundImageOverlayPosition, null)), /* @__PURE__ */ React64.createElement(PropKeyProvider, { bind: "repeat" }, /* @__PURE__ */ React64.createElement(BackgroundImageOverlayRepeat, null)), /* @__PURE__ */ React64.createElement(PropKeyProvider, { bind: "size" }, /* @__PURE__ */ React64.createElement(BackgroundImageOverlaySize, null)), /* @__PURE__ */ React64.createElement(PropKeyProvider, { bind: "attachment" }, /* @__PURE__ */ React64.createElement(BackgroundImageOverlayAttachment, null)));
|
|
3580
4110
|
};
|
|
3581
|
-
var StyledUnstableColorIndicator =
|
|
4111
|
+
var StyledUnstableColorIndicator = styled6(UnstableColorIndicator2)(({ theme }) => ({
|
|
3582
4112
|
borderRadius: `${theme.shape.borderRadius / 2}px`
|
|
3583
4113
|
}));
|
|
3584
4114
|
var useImage = (image) => {
|
|
@@ -3614,22 +4144,21 @@ var getGradientValue = (value) => {
|
|
|
3614
4144
|
// src/controls/background-control/background-control.tsx
|
|
3615
4145
|
var BackgroundControl = createControl(() => {
|
|
3616
4146
|
const propContext = useBoundProp(backgroundPropTypeUtil);
|
|
3617
|
-
const
|
|
3618
|
-
|
|
3619
|
-
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(Grid16, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React53.createElement(Grid16, { item: true, xs: 6 }, isUsingNestedProps ? /* @__PURE__ */ React53.createElement(ControlLabel, null, colorLabel) : /* @__PURE__ */ React53.createElement(ControlFormLabel, null, colorLabel)), /* @__PURE__ */ React53.createElement(Grid16, { item: true, xs: 6 }, /* @__PURE__ */ React53.createElement(ColorControl, null)))));
|
|
4147
|
+
const colorLabel = __29("Color", "elementor");
|
|
4148
|
+
return /* @__PURE__ */ React65.createElement(PropProvider, { ...propContext }, /* @__PURE__ */ React65.createElement(PropKeyProvider, { bind: "background-overlay" }, /* @__PURE__ */ React65.createElement(BackgroundOverlayRepeaterControl, null)), /* @__PURE__ */ React65.createElement(PropKeyProvider, { bind: "color" }, /* @__PURE__ */ React65.createElement(Grid16, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React65.createElement(Grid16, { item: true, xs: 6 }, /* @__PURE__ */ React65.createElement(ControlLabel, null, colorLabel)), /* @__PURE__ */ React65.createElement(Grid16, { item: true, xs: 6 }, /* @__PURE__ */ React65.createElement(ColorControl, null)))));
|
|
3620
4149
|
});
|
|
3621
4150
|
|
|
3622
4151
|
// src/controls/repeatable-control.tsx
|
|
3623
|
-
import * as
|
|
3624
|
-
import { useMemo as
|
|
4152
|
+
import * as React66 from "react";
|
|
4153
|
+
import { useMemo as useMemo5 } from "react";
|
|
3625
4154
|
import { createArrayPropUtils } from "@elementor/editor-props";
|
|
3626
|
-
import { Box as
|
|
4155
|
+
import { Box as Box10 } from "@elementor/ui";
|
|
3627
4156
|
|
|
3628
4157
|
// src/hooks/use-repeatable-control-context.ts
|
|
3629
|
-
import { createContext as
|
|
3630
|
-
var RepeatableControlContext =
|
|
4158
|
+
import { createContext as createContext8, useContext as useContext8 } from "react";
|
|
4159
|
+
var RepeatableControlContext = createContext8(void 0);
|
|
3631
4160
|
var useRepeatableControlContext = () => {
|
|
3632
|
-
const context =
|
|
4161
|
+
const context = useContext8(RepeatableControlContext);
|
|
3633
4162
|
if (!context) {
|
|
3634
4163
|
throw new Error("useRepeatableControlContext must be used within RepeatableControl");
|
|
3635
4164
|
}
|
|
@@ -3646,17 +4175,18 @@ var RepeatableControl = createControl(
|
|
|
3646
4175
|
showToggle,
|
|
3647
4176
|
initialValues,
|
|
3648
4177
|
patternLabel,
|
|
3649
|
-
placeholder
|
|
4178
|
+
placeholder,
|
|
4179
|
+
propKey
|
|
3650
4180
|
}) => {
|
|
3651
4181
|
const { propTypeUtil: childPropTypeUtil } = childControlConfig;
|
|
3652
4182
|
if (!childPropTypeUtil) {
|
|
3653
4183
|
return null;
|
|
3654
4184
|
}
|
|
3655
|
-
const childArrayPropTypeUtil =
|
|
3656
|
-
() => createArrayPropUtils(childPropTypeUtil.key, childPropTypeUtil.schema),
|
|
3657
|
-
[childPropTypeUtil.key, childPropTypeUtil.schema]
|
|
4185
|
+
const childArrayPropTypeUtil = useMemo5(
|
|
4186
|
+
() => createArrayPropUtils(childPropTypeUtil.key, childPropTypeUtil.schema, propKey),
|
|
4187
|
+
[childPropTypeUtil.key, childPropTypeUtil.schema, propKey]
|
|
3658
4188
|
);
|
|
3659
|
-
const contextValue =
|
|
4189
|
+
const contextValue = useMemo5(
|
|
3660
4190
|
() => ({
|
|
3661
4191
|
...childControlConfig,
|
|
3662
4192
|
placeholder: placeholder || "",
|
|
@@ -3665,7 +4195,7 @@ var RepeatableControl = createControl(
|
|
|
3665
4195
|
[childControlConfig, placeholder, patternLabel]
|
|
3666
4196
|
);
|
|
3667
4197
|
const { propType, value, setValue } = useBoundProp(childArrayPropTypeUtil);
|
|
3668
|
-
return /* @__PURE__ */
|
|
4198
|
+
return /* @__PURE__ */ React66.createElement(PropProvider, { propType, value, setValue }, /* @__PURE__ */ React66.createElement(RepeatableControlContext.Provider, { value: contextValue }, /* @__PURE__ */ React66.createElement(
|
|
3669
4199
|
Repeater,
|
|
3670
4200
|
{
|
|
3671
4201
|
openOnAdd: true,
|
|
@@ -3686,12 +4216,12 @@ var RepeatableControl = createControl(
|
|
|
3686
4216
|
}
|
|
3687
4217
|
);
|
|
3688
4218
|
var ItemContent4 = ({ bind }) => {
|
|
3689
|
-
return /* @__PURE__ */
|
|
4219
|
+
return /* @__PURE__ */ React66.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React66.createElement(Content4, null));
|
|
3690
4220
|
};
|
|
3691
|
-
var ItemIcon4 = () => /* @__PURE__ */
|
|
4221
|
+
var ItemIcon4 = () => /* @__PURE__ */ React66.createElement(React66.Fragment, null);
|
|
3692
4222
|
var Content4 = () => {
|
|
3693
4223
|
const { component: ChildControl, props = {} } = useRepeatableControlContext();
|
|
3694
|
-
return /* @__PURE__ */
|
|
4224
|
+
return /* @__PURE__ */ React66.createElement(PopoverContent, { p: 1.5 }, /* @__PURE__ */ React66.createElement(PopoverGridContainer, null, /* @__PURE__ */ React66.createElement(ChildControl, { ...props })));
|
|
3695
4225
|
};
|
|
3696
4226
|
var interpolate = (template, data) => {
|
|
3697
4227
|
if (!data) {
|
|
@@ -3750,8 +4280,10 @@ var shouldShowPlaceholder = (pattern, data) => {
|
|
|
3750
4280
|
};
|
|
3751
4281
|
var ItemLabel4 = ({ value }) => {
|
|
3752
4282
|
const { placeholder, patternLabel } = useRepeatableControlContext();
|
|
3753
|
-
const
|
|
3754
|
-
|
|
4283
|
+
const showPlaceholder = shouldShowPlaceholder(patternLabel, value);
|
|
4284
|
+
const label = showPlaceholder ? placeholder : interpolate(patternLabel, value);
|
|
4285
|
+
const color = showPlaceholder ? "text.tertiary" : "text.primary";
|
|
4286
|
+
return /* @__PURE__ */ React66.createElement(Box10, { component: "span", color }, label);
|
|
3755
4287
|
};
|
|
3756
4288
|
var getAllProperties = (pattern) => {
|
|
3757
4289
|
const properties = pattern.match(PLACEHOLDER_REGEX)?.map((match) => match.slice(2, -1)) || [];
|
|
@@ -3759,30 +4291,30 @@ var getAllProperties = (pattern) => {
|
|
|
3759
4291
|
};
|
|
3760
4292
|
|
|
3761
4293
|
// src/controls/key-value-control.tsx
|
|
3762
|
-
import * as
|
|
3763
|
-
import { useMemo as
|
|
4294
|
+
import * as React67 from "react";
|
|
4295
|
+
import { useMemo as useMemo6, useState as useState15 } from "react";
|
|
3764
4296
|
import {
|
|
3765
4297
|
isTransformable,
|
|
3766
4298
|
keyValuePropTypeUtil,
|
|
3767
4299
|
stringPropTypeUtil as stringPropTypeUtil11
|
|
3768
4300
|
} from "@elementor/editor-props";
|
|
3769
4301
|
import { FormHelperText, FormLabel as FormLabel3, Grid as Grid17 } from "@elementor/ui";
|
|
3770
|
-
import { __ as
|
|
4302
|
+
import { __ as __30 } from "@wordpress/i18n";
|
|
3771
4303
|
var KeyValueControl = createControl((props = {}) => {
|
|
3772
4304
|
const { value, setValue, ...propContext } = useBoundProp(keyValuePropTypeUtil);
|
|
3773
|
-
const [keyError, setKeyError] =
|
|
3774
|
-
const [valueError, setValueError] =
|
|
3775
|
-
const [sessionState, setSessionState] =
|
|
4305
|
+
const [keyError, setKeyError] = useState15("");
|
|
4306
|
+
const [valueError, setValueError] = useState15("");
|
|
4307
|
+
const [sessionState, setSessionState] = useState15({
|
|
3776
4308
|
key: value?.key?.value || "",
|
|
3777
4309
|
value: value?.value?.value || ""
|
|
3778
4310
|
});
|
|
3779
|
-
const keyLabel = props.keyName ||
|
|
3780
|
-
const valueLabel = props.valueName ||
|
|
3781
|
-
const [keyRegex, valueRegex, errMsg] =
|
|
4311
|
+
const keyLabel = props.keyName || __30("Key", "elementor");
|
|
4312
|
+
const valueLabel = props.valueName || __30("Value", "elementor");
|
|
4313
|
+
const [keyRegex, valueRegex, errMsg] = useMemo6(
|
|
3782
4314
|
() => [
|
|
3783
4315
|
props.regexKey ? new RegExp(props.regexKey) : void 0,
|
|
3784
4316
|
props.regexValue ? new RegExp(props.regexValue) : void 0,
|
|
3785
|
-
props.validationErrorMessage ||
|
|
4317
|
+
props.validationErrorMessage || __30("Invalid Format", "elementor")
|
|
3786
4318
|
],
|
|
3787
4319
|
[props.regexKey, props.regexValue, props.validationErrorMessage]
|
|
3788
4320
|
);
|
|
@@ -3831,59 +4363,49 @@ var KeyValueControl = createControl((props = {}) => {
|
|
|
3831
4363
|
});
|
|
3832
4364
|
}
|
|
3833
4365
|
};
|
|
3834
|
-
return /* @__PURE__ */
|
|
4366
|
+
return /* @__PURE__ */ React67.createElement(PropProvider, { ...propContext, value, setValue: handleChange }, /* @__PURE__ */ React67.createElement(Grid17, { container: true, gap: 1.5 }, /* @__PURE__ */ React67.createElement(Grid17, { item: true, xs: 12, display: "flex", flexDirection: "column" }, /* @__PURE__ */ React67.createElement(FormLabel3, { size: "tiny", sx: { pb: 1 } }, keyLabel), /* @__PURE__ */ React67.createElement(PropKeyProvider, { bind: "key" }, /* @__PURE__ */ React67.createElement(TextControl, { inputValue: sessionState.key, error: !!keyError })), !!keyError && /* @__PURE__ */ React67.createElement(FormHelperText, { error: true }, keyError)), /* @__PURE__ */ React67.createElement(Grid17, { item: true, xs: 12, display: "flex", flexDirection: "column" }, /* @__PURE__ */ React67.createElement(FormLabel3, { size: "tiny", sx: { pb: 1 } }, valueLabel), /* @__PURE__ */ React67.createElement(PropKeyProvider, { bind: "value" }, /* @__PURE__ */ React67.createElement(
|
|
3835
4367
|
TextControl,
|
|
3836
4368
|
{
|
|
3837
4369
|
inputValue: sessionState.value,
|
|
3838
4370
|
error: !!valueError,
|
|
3839
|
-
inputDisabled: !!keyError
|
|
3840
|
-
sx: { pt: 1 }
|
|
4371
|
+
inputDisabled: !!keyError
|
|
3841
4372
|
}
|
|
3842
|
-
)), !!valueError && /* @__PURE__ */
|
|
4373
|
+
)), !!valueError && /* @__PURE__ */ React67.createElement(FormHelperText, { error: true }, valueError))));
|
|
3843
4374
|
});
|
|
3844
4375
|
|
|
3845
4376
|
// src/controls/position-control.tsx
|
|
3846
|
-
import * as
|
|
3847
|
-
import { useMemo as useMemo6 } from "react";
|
|
4377
|
+
import * as React68 from "react";
|
|
3848
4378
|
import { positionPropTypeUtil, stringPropTypeUtil as stringPropTypeUtil12 } from "@elementor/editor-props";
|
|
3849
|
-
import { MenuListItem as
|
|
3850
|
-
import { isExperimentActive as isExperimentActive6 } from "@elementor/editor-v1-adapters";
|
|
4379
|
+
import { MenuListItem as MenuListItem5 } from "@elementor/editor-ui";
|
|
3851
4380
|
import { LetterXIcon as LetterXIcon2, LetterYIcon as LetterYIcon2 } from "@elementor/icons";
|
|
3852
|
-
import { Grid as Grid18, Select as
|
|
3853
|
-
import { __ as
|
|
4381
|
+
import { Grid as Grid18, Select as Select4 } from "@elementor/ui";
|
|
4382
|
+
import { __ as __31 } from "@wordpress/i18n";
|
|
3854
4383
|
var positionOptions = [
|
|
3855
|
-
{ label:
|
|
3856
|
-
{ label:
|
|
3857
|
-
{ label:
|
|
3858
|
-
{ label:
|
|
3859
|
-
{ label:
|
|
3860
|
-
{ label:
|
|
3861
|
-
{ label:
|
|
3862
|
-
{ label:
|
|
3863
|
-
{ label:
|
|
4384
|
+
{ label: __31("Center center", "elementor"), value: "center center" },
|
|
4385
|
+
{ label: __31("Center left", "elementor"), value: "center left" },
|
|
4386
|
+
{ label: __31("Center right", "elementor"), value: "center right" },
|
|
4387
|
+
{ label: __31("Top center", "elementor"), value: "top center" },
|
|
4388
|
+
{ label: __31("Top left", "elementor"), value: "top left" },
|
|
4389
|
+
{ label: __31("Top right", "elementor"), value: "top right" },
|
|
4390
|
+
{ label: __31("Bottom center", "elementor"), value: "bottom center" },
|
|
4391
|
+
{ label: __31("Bottom left", "elementor"), value: "bottom left" },
|
|
4392
|
+
{ label: __31("Bottom right", "elementor"), value: "bottom right" },
|
|
4393
|
+
{ label: __31("Custom", "elementor"), value: "custom" }
|
|
3864
4394
|
];
|
|
3865
4395
|
var PositionControl = () => {
|
|
3866
4396
|
const positionContext = useBoundProp(positionPropTypeUtil);
|
|
3867
4397
|
const stringPropContext = useBoundProp(stringPropTypeUtil12);
|
|
3868
|
-
const
|
|
3869
|
-
const isCustom = !!positionContext.value && isVersion331Active;
|
|
3870
|
-
const availablePositionOptions = useMemo6(() => {
|
|
3871
|
-
const options = [...positionOptions];
|
|
3872
|
-
if (isVersion331Active) {
|
|
3873
|
-
options.push({ label: __23("Custom", "elementor"), value: "custom" });
|
|
3874
|
-
}
|
|
3875
|
-
return options;
|
|
3876
|
-
}, [isVersion331Active]);
|
|
4398
|
+
const isCustom = !!positionContext.value;
|
|
3877
4399
|
const handlePositionChange = (event) => {
|
|
3878
4400
|
const value = event.target.value || null;
|
|
3879
|
-
if (value === "custom"
|
|
4401
|
+
if (value === "custom") {
|
|
3880
4402
|
positionContext.setValue({ x: null, y: null });
|
|
3881
4403
|
} else {
|
|
3882
4404
|
stringPropContext.setValue(value);
|
|
3883
4405
|
}
|
|
3884
4406
|
};
|
|
3885
|
-
return /* @__PURE__ */
|
|
3886
|
-
|
|
4407
|
+
return /* @__PURE__ */ React68.createElement(Grid18, { container: true, spacing: 1.5 }, /* @__PURE__ */ React68.createElement(Grid18, { item: true, xs: 12 }, /* @__PURE__ */ React68.createElement(Grid18, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React68.createElement(Grid18, { item: true, xs: 6 }, /* @__PURE__ */ React68.createElement(ControlFormLabel, null, __31("Object position", "elementor"))), /* @__PURE__ */ React68.createElement(Grid18, { item: true, xs: 6, sx: { overflow: "hidden" } }, /* @__PURE__ */ React68.createElement(
|
|
4408
|
+
Select4,
|
|
3887
4409
|
{
|
|
3888
4410
|
size: "tiny",
|
|
3889
4411
|
disabled: stringPropContext.disabled,
|
|
@@ -3891,123 +4413,384 @@ var PositionControl = () => {
|
|
|
3891
4413
|
onChange: handlePositionChange,
|
|
3892
4414
|
fullWidth: true
|
|
3893
4415
|
},
|
|
3894
|
-
|
|
3895
|
-
)))), isCustom && /* @__PURE__ */
|
|
4416
|
+
positionOptions.map(({ label, value }) => /* @__PURE__ */ React68.createElement(MenuListItem5, { key: value, value: value ?? "" }, label))
|
|
4417
|
+
)))), isCustom && /* @__PURE__ */ React68.createElement(PropProvider, { ...positionContext }, /* @__PURE__ */ React68.createElement(Grid18, { item: true, xs: 12 }, /* @__PURE__ */ React68.createElement(Grid18, { container: true, spacing: 1.5 }, /* @__PURE__ */ React68.createElement(Grid18, { item: true, xs: 6 }, /* @__PURE__ */ React68.createElement(PropKeyProvider, { bind: "x" }, /* @__PURE__ */ React68.createElement(SizeControl, { startIcon: /* @__PURE__ */ React68.createElement(LetterXIcon2, { fontSize: "tiny" }) }))), /* @__PURE__ */ React68.createElement(Grid18, { item: true, xs: 6 }, /* @__PURE__ */ React68.createElement(PropKeyProvider, { bind: "y" }, /* @__PURE__ */ React68.createElement(SizeControl, { startIcon: /* @__PURE__ */ React68.createElement(LetterYIcon2, { fontSize: "tiny" }) })))))));
|
|
3896
4418
|
};
|
|
3897
4419
|
|
|
3898
4420
|
// src/controls/transform-control/transform-repeater-control.tsx
|
|
3899
|
-
import * as
|
|
4421
|
+
import * as React78 from "react";
|
|
3900
4422
|
import { transformPropTypeUtil } from "@elementor/editor-props";
|
|
3901
|
-
import { __ as
|
|
4423
|
+
import { __ as __38 } from "@wordpress/i18n";
|
|
3902
4424
|
|
|
3903
4425
|
// src/controls/transform-control/transform-content.tsx
|
|
3904
|
-
import * as
|
|
3905
|
-
import { Box as
|
|
3906
|
-
import { __ as
|
|
4426
|
+
import * as React75 from "react";
|
|
4427
|
+
import { Box as Box11, Tab as Tab2, TabPanel as TabPanel2, Tabs as Tabs2 } from "@elementor/ui";
|
|
4428
|
+
import { __ as __36 } from "@wordpress/i18n";
|
|
3907
4429
|
|
|
3908
4430
|
// src/controls/transform-control/functions/move.tsx
|
|
3909
|
-
import * as
|
|
3910
|
-
import { useRef as
|
|
4431
|
+
import * as React70 from "react";
|
|
4432
|
+
import { useRef as useRef14 } from "react";
|
|
3911
4433
|
import { moveTransformPropTypeUtil } from "@elementor/editor-props";
|
|
3912
4434
|
import { ArrowDownLeftIcon, ArrowDownSmallIcon, ArrowRightIcon } from "@elementor/icons";
|
|
3913
4435
|
import { Grid as Grid20 } from "@elementor/ui";
|
|
3914
|
-
import { __ as
|
|
4436
|
+
import { __ as __32 } from "@wordpress/i18n";
|
|
4437
|
+
|
|
4438
|
+
// src/controls/transform-control/types.ts
|
|
4439
|
+
import {
|
|
4440
|
+
numberPropTypeUtil as numberPropTypeUtil4,
|
|
4441
|
+
rotateTransformPropTypeUtil,
|
|
4442
|
+
scaleTransformPropTypeUtil,
|
|
4443
|
+
skewTransformPropTypeUtil
|
|
4444
|
+
} from "@elementor/editor-props";
|
|
4445
|
+
var TransformFunctionKeys = {
|
|
4446
|
+
move: "transform-move",
|
|
4447
|
+
scale: "transform-scale",
|
|
4448
|
+
rotate: "transform-rotate",
|
|
4449
|
+
skew: "transform-skew"
|
|
4450
|
+
};
|
|
4451
|
+
var defaultValues = {
|
|
4452
|
+
move: {
|
|
4453
|
+
size: 0,
|
|
4454
|
+
unit: "px"
|
|
4455
|
+
},
|
|
4456
|
+
scale: 1,
|
|
4457
|
+
rotate: {
|
|
4458
|
+
size: 0,
|
|
4459
|
+
unit: "deg"
|
|
4460
|
+
},
|
|
4461
|
+
skew: {
|
|
4462
|
+
size: 0,
|
|
4463
|
+
unit: "deg"
|
|
4464
|
+
}
|
|
4465
|
+
};
|
|
4466
|
+
var initialTransformValue = {
|
|
4467
|
+
$$type: TransformFunctionKeys.move,
|
|
4468
|
+
value: {
|
|
4469
|
+
x: { $$type: "size", value: { size: defaultValues.move.size, unit: defaultValues.move.unit } },
|
|
4470
|
+
y: { $$type: "size", value: { size: defaultValues.move.size, unit: defaultValues.move.unit } },
|
|
4471
|
+
z: { $$type: "size", value: { size: defaultValues.move.size, unit: defaultValues.move.unit } }
|
|
4472
|
+
}
|
|
4473
|
+
};
|
|
4474
|
+
var initialScaleValue = scaleTransformPropTypeUtil.create({
|
|
4475
|
+
x: numberPropTypeUtil4.create(defaultValues.scale),
|
|
4476
|
+
y: numberPropTypeUtil4.create(defaultValues.scale),
|
|
4477
|
+
z: numberPropTypeUtil4.create(defaultValues.scale)
|
|
4478
|
+
});
|
|
4479
|
+
var initialRotateValue = rotateTransformPropTypeUtil.create({
|
|
4480
|
+
x: { $$type: "size", value: { size: defaultValues.rotate.size, unit: defaultValues.rotate.unit } },
|
|
4481
|
+
y: { $$type: "size", value: { size: defaultValues.rotate.size, unit: defaultValues.rotate.unit } },
|
|
4482
|
+
z: { $$type: "size", value: { size: defaultValues.rotate.size, unit: defaultValues.rotate.unit } }
|
|
4483
|
+
});
|
|
4484
|
+
var initialSkewValue = skewTransformPropTypeUtil.create({
|
|
4485
|
+
x: { $$type: "size", value: { size: defaultValues.skew.size, unit: defaultValues.skew.unit } },
|
|
4486
|
+
y: { $$type: "size", value: { size: defaultValues.skew.size, unit: defaultValues.skew.unit } }
|
|
4487
|
+
});
|
|
3915
4488
|
|
|
3916
4489
|
// src/controls/transform-control/functions/axis-row.tsx
|
|
3917
|
-
import * as
|
|
4490
|
+
import * as React69 from "react";
|
|
3918
4491
|
import { Grid as Grid19 } from "@elementor/ui";
|
|
3919
|
-
var AxisRow = ({ label, bindValue, startIcon, anchorRef }) => {
|
|
3920
|
-
return /* @__PURE__ */
|
|
4492
|
+
var AxisRow = ({ label, bindValue, startIcon, anchorRef, units: units2 }) => {
|
|
4493
|
+
return /* @__PURE__ */ React69.createElement(Grid19, { item: true, xs: 12 }, /* @__PURE__ */ React69.createElement(PopoverGridContainer, { ref: anchorRef }, /* @__PURE__ */ React69.createElement(Grid19, { item: true, xs: 6 }, /* @__PURE__ */ React69.createElement(ControlLabel, null, label)), /* @__PURE__ */ React69.createElement(Grid19, { item: true, xs: 6 }, /* @__PURE__ */ React69.createElement(PropKeyProvider, { bind: bindValue }, /* @__PURE__ */ React69.createElement(SizeControl, { anchorRef, startIcon, units: units2, variant: "angle" })))));
|
|
3921
4494
|
};
|
|
3922
4495
|
|
|
3923
4496
|
// src/controls/transform-control/functions/move.tsx
|
|
3924
4497
|
var moveAxisControls = [
|
|
3925
4498
|
{
|
|
3926
|
-
label:
|
|
4499
|
+
label: __32("Move X", "elementor"),
|
|
3927
4500
|
bindValue: "x",
|
|
3928
|
-
startIcon: /* @__PURE__ */
|
|
4501
|
+
startIcon: /* @__PURE__ */ React70.createElement(ArrowRightIcon, { fontSize: "tiny" })
|
|
3929
4502
|
},
|
|
3930
4503
|
{
|
|
3931
|
-
label:
|
|
4504
|
+
label: __32("Move Y", "elementor"),
|
|
3932
4505
|
bindValue: "y",
|
|
3933
|
-
startIcon: /* @__PURE__ */
|
|
4506
|
+
startIcon: /* @__PURE__ */ React70.createElement(ArrowDownSmallIcon, { fontSize: "tiny" })
|
|
3934
4507
|
},
|
|
3935
4508
|
{
|
|
3936
|
-
label:
|
|
4509
|
+
label: __32("Move Z", "elementor"),
|
|
3937
4510
|
bindValue: "z",
|
|
3938
|
-
startIcon: /* @__PURE__ */
|
|
4511
|
+
startIcon: /* @__PURE__ */ React70.createElement(ArrowDownLeftIcon, { fontSize: "tiny" })
|
|
3939
4512
|
}
|
|
3940
4513
|
];
|
|
3941
4514
|
var Move = () => {
|
|
3942
4515
|
const context = useBoundProp(moveTransformPropTypeUtil);
|
|
3943
|
-
const rowRef =
|
|
3944
|
-
return /* @__PURE__ */
|
|
4516
|
+
const rowRef = useRef14(null);
|
|
4517
|
+
return /* @__PURE__ */ React70.createElement(Grid20, { container: true, spacing: 1.5 }, /* @__PURE__ */ React70.createElement(PropProvider, { ...context }, /* @__PURE__ */ React70.createElement(PropKeyProvider, { bind: TransformFunctionKeys.move }, moveAxisControls.map((control) => /* @__PURE__ */ React70.createElement(AxisRow, { key: control.bindValue, ...control, anchorRef: rowRef })))));
|
|
4518
|
+
};
|
|
4519
|
+
|
|
4520
|
+
// src/controls/transform-control/functions/rotate.tsx
|
|
4521
|
+
import * as React71 from "react";
|
|
4522
|
+
import { useRef as useRef15 } from "react";
|
|
4523
|
+
import { rotateTransformPropTypeUtil as rotateTransformPropTypeUtil2 } from "@elementor/editor-props";
|
|
4524
|
+
import { Arrow360Icon, RotateClockwiseIcon } from "@elementor/icons";
|
|
4525
|
+
import { Grid as Grid21 } from "@elementor/ui";
|
|
4526
|
+
import { __ as __33 } from "@wordpress/i18n";
|
|
4527
|
+
var rotateAxisControls = [
|
|
4528
|
+
{
|
|
4529
|
+
label: __33("Rotate X", "elementor"),
|
|
4530
|
+
bindValue: "x",
|
|
4531
|
+
startIcon: /* @__PURE__ */ React71.createElement(Arrow360Icon, { fontSize: "tiny" })
|
|
4532
|
+
},
|
|
4533
|
+
{
|
|
4534
|
+
label: __33("Rotate Y", "elementor"),
|
|
4535
|
+
bindValue: "y",
|
|
4536
|
+
startIcon: /* @__PURE__ */ React71.createElement(Arrow360Icon, { fontSize: "tiny", style: { transform: "scaleX(-1) rotate(-90deg)" } })
|
|
4537
|
+
},
|
|
4538
|
+
{
|
|
4539
|
+
label: __33("Rotate Z", "elementor"),
|
|
4540
|
+
bindValue: "z",
|
|
4541
|
+
startIcon: /* @__PURE__ */ React71.createElement(RotateClockwiseIcon, { fontSize: "tiny" })
|
|
4542
|
+
}
|
|
4543
|
+
];
|
|
4544
|
+
var rotateUnits = ["deg", "rad", "grad", "turn"];
|
|
4545
|
+
var Rotate = () => {
|
|
4546
|
+
const context = useBoundProp(rotateTransformPropTypeUtil2);
|
|
4547
|
+
const rowRef = useRef15(null);
|
|
4548
|
+
return /* @__PURE__ */ React71.createElement(Grid21, { container: true, spacing: 1.5 }, /* @__PURE__ */ React71.createElement(PropProvider, { ...context }, /* @__PURE__ */ React71.createElement(PropKeyProvider, { bind: TransformFunctionKeys.rotate }, rotateAxisControls.map((control) => /* @__PURE__ */ React71.createElement(AxisRow, { key: control.bindValue, ...control, anchorRef: rowRef, units: rotateUnits })))));
|
|
4549
|
+
};
|
|
4550
|
+
|
|
4551
|
+
// src/controls/transform-control/functions/scale.tsx
|
|
4552
|
+
import * as React73 from "react";
|
|
4553
|
+
import { useRef as useRef16 } from "react";
|
|
4554
|
+
import { scaleTransformPropTypeUtil as scaleTransformPropTypeUtil2 } from "@elementor/editor-props";
|
|
4555
|
+
import { ArrowDownLeftIcon as ArrowDownLeftIcon2, ArrowDownSmallIcon as ArrowDownSmallIcon2, ArrowRightIcon as ArrowRightIcon2 } from "@elementor/icons";
|
|
4556
|
+
import { Grid as Grid23 } from "@elementor/ui";
|
|
4557
|
+
import { __ as __34 } from "@wordpress/i18n";
|
|
4558
|
+
|
|
4559
|
+
// src/controls/transform-control/functions/scale-axis-row.tsx
|
|
4560
|
+
import * as React72 from "react";
|
|
4561
|
+
import { Grid as Grid22 } from "@elementor/ui";
|
|
4562
|
+
var ScaleAxisRow = ({ label, bindValue, startIcon, anchorRef }) => {
|
|
4563
|
+
return /* @__PURE__ */ React72.createElement(Grid22, { item: true, xs: 12 }, /* @__PURE__ */ React72.createElement(PopoverGridContainer, { ref: anchorRef }, /* @__PURE__ */ React72.createElement(Grid22, { item: true, xs: 6 }, /* @__PURE__ */ React72.createElement(ControlLabel, null, label)), /* @__PURE__ */ React72.createElement(Grid22, { item: true, xs: 6 }, /* @__PURE__ */ React72.createElement(PropKeyProvider, { bind: bindValue }, /* @__PURE__ */ React72.createElement(NumberControl, { step: 0.1, placeholder: "1", startIcon })))));
|
|
4564
|
+
};
|
|
4565
|
+
|
|
4566
|
+
// src/controls/transform-control/functions/scale.tsx
|
|
4567
|
+
var scaleAxisControls = [
|
|
4568
|
+
{
|
|
4569
|
+
label: __34("Scale X", "elementor"),
|
|
4570
|
+
bindValue: "x",
|
|
4571
|
+
startIcon: /* @__PURE__ */ React73.createElement(ArrowRightIcon2, { fontSize: "tiny" })
|
|
4572
|
+
},
|
|
4573
|
+
{
|
|
4574
|
+
label: __34("Scale Y", "elementor"),
|
|
4575
|
+
bindValue: "y",
|
|
4576
|
+
startIcon: /* @__PURE__ */ React73.createElement(ArrowDownSmallIcon2, { fontSize: "tiny" })
|
|
4577
|
+
},
|
|
4578
|
+
{
|
|
4579
|
+
label: __34("Scale Z", "elementor"),
|
|
4580
|
+
bindValue: "z",
|
|
4581
|
+
startIcon: /* @__PURE__ */ React73.createElement(ArrowDownLeftIcon2, { fontSize: "tiny" })
|
|
4582
|
+
}
|
|
4583
|
+
];
|
|
4584
|
+
var Scale = () => {
|
|
4585
|
+
const context = useBoundProp(scaleTransformPropTypeUtil2);
|
|
4586
|
+
const rowRef = useRef16(null);
|
|
4587
|
+
return /* @__PURE__ */ React73.createElement(Grid23, { container: true, spacing: 1.5 }, /* @__PURE__ */ React73.createElement(PropProvider, { ...context }, /* @__PURE__ */ React73.createElement(PropKeyProvider, { bind: TransformFunctionKeys.scale }, scaleAxisControls.map((control) => /* @__PURE__ */ React73.createElement(ScaleAxisRow, { key: control.bindValue, ...control, anchorRef: rowRef })))));
|
|
4588
|
+
};
|
|
4589
|
+
|
|
4590
|
+
// src/controls/transform-control/functions/skew.tsx
|
|
4591
|
+
import * as React74 from "react";
|
|
4592
|
+
import { useRef as useRef17 } from "react";
|
|
4593
|
+
import { skewTransformPropTypeUtil as skewTransformPropTypeUtil2 } from "@elementor/editor-props";
|
|
4594
|
+
import { ArrowLeftIcon, ArrowRightIcon as ArrowRightIcon3 } from "@elementor/icons";
|
|
4595
|
+
import { Grid as Grid24 } from "@elementor/ui";
|
|
4596
|
+
import { __ as __35 } from "@wordpress/i18n";
|
|
4597
|
+
var skewAxisControls = [
|
|
4598
|
+
{
|
|
4599
|
+
label: __35("Skew X", "elementor"),
|
|
4600
|
+
bindValue: "x",
|
|
4601
|
+
startIcon: /* @__PURE__ */ React74.createElement(ArrowRightIcon3, { fontSize: "tiny" })
|
|
4602
|
+
},
|
|
4603
|
+
{
|
|
4604
|
+
label: __35("Skew Y", "elementor"),
|
|
4605
|
+
bindValue: "y",
|
|
4606
|
+
startIcon: /* @__PURE__ */ React74.createElement(ArrowLeftIcon, { fontSize: "tiny", style: { transform: "scaleX(-1) rotate(-90deg)" } })
|
|
4607
|
+
}
|
|
4608
|
+
];
|
|
4609
|
+
var skewUnits = ["deg", "rad", "grad", "turn"];
|
|
4610
|
+
var Skew = () => {
|
|
4611
|
+
const context = useBoundProp(skewTransformPropTypeUtil2);
|
|
4612
|
+
const rowRef = useRef17(null);
|
|
4613
|
+
return /* @__PURE__ */ React74.createElement(Grid24, { container: true, spacing: 1.5 }, /* @__PURE__ */ React74.createElement(PropProvider, { ...context }, /* @__PURE__ */ React74.createElement(PropKeyProvider, { bind: TransformFunctionKeys.skew }, skewAxisControls.map((control) => /* @__PURE__ */ React74.createElement(AxisRow, { key: control.bindValue, ...control, anchorRef: rowRef, units: skewUnits })))));
|
|
4614
|
+
};
|
|
4615
|
+
|
|
4616
|
+
// src/controls/transform-control/use-transform-tabs-history.tsx
|
|
4617
|
+
import { useRef as useRef18 } from "react";
|
|
4618
|
+
import {
|
|
4619
|
+
moveTransformPropTypeUtil as moveTransformPropTypeUtil2,
|
|
4620
|
+
rotateTransformPropTypeUtil as rotateTransformPropTypeUtil3,
|
|
4621
|
+
scaleTransformPropTypeUtil as scaleTransformPropTypeUtil3,
|
|
4622
|
+
skewTransformPropTypeUtil as skewTransformPropTypeUtil3
|
|
4623
|
+
} from "@elementor/editor-props";
|
|
4624
|
+
import { useTabs as useTabs2 } from "@elementor/ui";
|
|
4625
|
+
var useTransformTabsHistory = ({
|
|
4626
|
+
move: initialMove,
|
|
4627
|
+
scale: initialScale,
|
|
4628
|
+
rotate: initialRotate,
|
|
4629
|
+
skew: initialSkew
|
|
4630
|
+
}) => {
|
|
4631
|
+
const { value: moveValue, setValue: setMoveValue } = useBoundProp(moveTransformPropTypeUtil2);
|
|
4632
|
+
const { value: scaleValue, setValue: setScaleValue } = useBoundProp(scaleTransformPropTypeUtil3);
|
|
4633
|
+
const { value: rotateValue, setValue: setRotateValue } = useBoundProp(rotateTransformPropTypeUtil3);
|
|
4634
|
+
const { value: skewValue, setValue: setSkewValue } = useBoundProp(skewTransformPropTypeUtil3);
|
|
4635
|
+
const getCurrentTransformType = () => {
|
|
4636
|
+
switch (true) {
|
|
4637
|
+
case !!scaleValue:
|
|
4638
|
+
return TransformFunctionKeys.scale;
|
|
4639
|
+
case !!rotateValue:
|
|
4640
|
+
return TransformFunctionKeys.rotate;
|
|
4641
|
+
case !!skewValue:
|
|
4642
|
+
return TransformFunctionKeys.skew;
|
|
4643
|
+
default:
|
|
4644
|
+
return TransformFunctionKeys.move;
|
|
4645
|
+
}
|
|
4646
|
+
};
|
|
4647
|
+
const { getTabsProps, getTabProps, getTabPanelProps } = useTabs2(getCurrentTransformType());
|
|
4648
|
+
const valuesHistory = useRef18({
|
|
4649
|
+
move: initialMove,
|
|
4650
|
+
scale: initialScale,
|
|
4651
|
+
rotate: initialRotate,
|
|
4652
|
+
skew: initialSkew
|
|
4653
|
+
});
|
|
4654
|
+
const saveToHistory = (key, value) => {
|
|
4655
|
+
if (value) {
|
|
4656
|
+
valuesHistory.current[key] = value;
|
|
4657
|
+
}
|
|
4658
|
+
};
|
|
4659
|
+
const onTabChange = (e, tabName) => {
|
|
4660
|
+
switch (tabName) {
|
|
4661
|
+
case TransformFunctionKeys.move:
|
|
4662
|
+
setMoveValue(valuesHistory.current.move);
|
|
4663
|
+
saveToHistory("scale", scaleValue);
|
|
4664
|
+
saveToHistory("rotate", rotateValue);
|
|
4665
|
+
saveToHistory("skew", skewValue);
|
|
4666
|
+
break;
|
|
4667
|
+
case TransformFunctionKeys.scale:
|
|
4668
|
+
setScaleValue(valuesHistory.current.scale);
|
|
4669
|
+
saveToHistory("move", moveValue);
|
|
4670
|
+
saveToHistory("rotate", rotateValue);
|
|
4671
|
+
saveToHistory("skew", skewValue);
|
|
4672
|
+
break;
|
|
4673
|
+
case TransformFunctionKeys.rotate:
|
|
4674
|
+
setRotateValue(valuesHistory.current.rotate);
|
|
4675
|
+
saveToHistory("move", moveValue);
|
|
4676
|
+
saveToHistory("scale", scaleValue);
|
|
4677
|
+
saveToHistory("skew", skewValue);
|
|
4678
|
+
break;
|
|
4679
|
+
case TransformFunctionKeys.skew:
|
|
4680
|
+
setSkewValue(valuesHistory.current.skew);
|
|
4681
|
+
saveToHistory("move", moveValue);
|
|
4682
|
+
saveToHistory("scale", scaleValue);
|
|
4683
|
+
saveToHistory("rotate", rotateValue);
|
|
4684
|
+
break;
|
|
4685
|
+
}
|
|
4686
|
+
return getTabsProps().onChange(e, tabName);
|
|
4687
|
+
};
|
|
4688
|
+
return {
|
|
4689
|
+
getTabProps,
|
|
4690
|
+
getTabPanelProps,
|
|
4691
|
+
getTabsProps: () => ({ ...getTabsProps(), onChange: onTabChange })
|
|
4692
|
+
};
|
|
3945
4693
|
};
|
|
3946
4694
|
|
|
3947
4695
|
// src/controls/transform-control/transform-content.tsx
|
|
3948
4696
|
var TransformContent = ({ bind }) => {
|
|
3949
|
-
|
|
3950
|
-
|
|
4697
|
+
return /* @__PURE__ */ React75.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React75.createElement(Content5, null));
|
|
4698
|
+
};
|
|
4699
|
+
var Content5 = () => {
|
|
4700
|
+
const { getTabsProps, getTabProps, getTabPanelProps } = useTransformTabsHistory({
|
|
4701
|
+
move: initialTransformValue.value,
|
|
4702
|
+
scale: initialScaleValue.value,
|
|
4703
|
+
rotate: initialRotateValue.value,
|
|
4704
|
+
skew: initialSkewValue.value
|
|
4705
|
+
});
|
|
4706
|
+
return /* @__PURE__ */ React75.createElement(PopoverContent, null, /* @__PURE__ */ React75.createElement(Box11, { sx: { width: "100%" } }, /* @__PURE__ */ React75.createElement(Box11, { sx: { borderBottom: 1, borderColor: "divider" } }, /* @__PURE__ */ React75.createElement(
|
|
3951
4707
|
Tabs2,
|
|
3952
4708
|
{
|
|
3953
4709
|
size: "small",
|
|
3954
4710
|
variant: "fullWidth",
|
|
4711
|
+
sx: {
|
|
4712
|
+
"& .MuiTab-root": {
|
|
4713
|
+
minWidth: "62px"
|
|
4714
|
+
}
|
|
4715
|
+
},
|
|
3955
4716
|
...getTabsProps(),
|
|
3956
|
-
"aria-label":
|
|
4717
|
+
"aria-label": __36("Transform", "elementor")
|
|
3957
4718
|
},
|
|
3958
|
-
/* @__PURE__ */
|
|
3959
|
-
|
|
4719
|
+
/* @__PURE__ */ React75.createElement(Tab2, { label: __36("Move", "elementor"), ...getTabProps(TransformFunctionKeys.move) }),
|
|
4720
|
+
/* @__PURE__ */ React75.createElement(Tab2, { label: __36("Scale", "elementor"), ...getTabProps(TransformFunctionKeys.scale) }),
|
|
4721
|
+
/* @__PURE__ */ React75.createElement(Tab2, { label: __36("Rotate", "elementor"), ...getTabProps(TransformFunctionKeys.rotate) }),
|
|
4722
|
+
/* @__PURE__ */ React75.createElement(Tab2, { label: __36("Skew", "elementor"), ...getTabProps(TransformFunctionKeys.skew) })
|
|
4723
|
+
)), /* @__PURE__ */ React75.createElement(TabPanel2, { sx: { p: 1.5 }, ...getTabPanelProps(TransformFunctionKeys.move) }, /* @__PURE__ */ React75.createElement(Move, null)), /* @__PURE__ */ React75.createElement(TabPanel2, { sx: { p: 1.5 }, ...getTabPanelProps(TransformFunctionKeys.scale) }, /* @__PURE__ */ React75.createElement(Scale, null)), /* @__PURE__ */ React75.createElement(TabPanel2, { sx: { p: 1.5 }, ...getTabPanelProps(TransformFunctionKeys.rotate) }, /* @__PURE__ */ React75.createElement(Rotate, null)), /* @__PURE__ */ React75.createElement(TabPanel2, { sx: { p: 1.5 }, ...getTabPanelProps(TransformFunctionKeys.skew) }, /* @__PURE__ */ React75.createElement(Skew, null))));
|
|
3960
4724
|
};
|
|
3961
4725
|
|
|
3962
4726
|
// src/controls/transform-control/transform-icon.tsx
|
|
3963
|
-
import * as
|
|
3964
|
-
import { ArrowsMaximizeIcon as ArrowsMaximizeIcon2 } from "@elementor/icons";
|
|
4727
|
+
import * as React76 from "react";
|
|
4728
|
+
import { ArrowsMaximizeIcon as ArrowsMaximizeIcon2, ExpandIcon, RotateClockwise2Icon, SkewXIcon } from "@elementor/icons";
|
|
3965
4729
|
var TransformIcon = ({ value }) => {
|
|
3966
4730
|
switch (value.$$type) {
|
|
3967
|
-
case
|
|
3968
|
-
return /* @__PURE__ */
|
|
4731
|
+
case TransformFunctionKeys.move:
|
|
4732
|
+
return /* @__PURE__ */ React76.createElement(ArrowsMaximizeIcon2, { fontSize: "tiny" });
|
|
4733
|
+
case TransformFunctionKeys.scale:
|
|
4734
|
+
return /* @__PURE__ */ React76.createElement(ExpandIcon, { fontSize: "tiny" });
|
|
4735
|
+
case TransformFunctionKeys.rotate:
|
|
4736
|
+
return /* @__PURE__ */ React76.createElement(RotateClockwise2Icon, { fontSize: "tiny" });
|
|
4737
|
+
case TransformFunctionKeys.skew:
|
|
4738
|
+
return /* @__PURE__ */ React76.createElement(SkewXIcon, { fontSize: "tiny" });
|
|
3969
4739
|
default:
|
|
3970
4740
|
return null;
|
|
3971
4741
|
}
|
|
3972
4742
|
};
|
|
3973
4743
|
|
|
3974
4744
|
// src/controls/transform-control/transform-label.tsx
|
|
3975
|
-
import * as
|
|
3976
|
-
import { Box as
|
|
3977
|
-
import { __ as
|
|
3978
|
-
var transformMoveValue = (value) => Object.values(value).map((axis) =>
|
|
4745
|
+
import * as React77 from "react";
|
|
4746
|
+
import { Box as Box12 } from "@elementor/ui";
|
|
4747
|
+
import { __ as __37 } from "@wordpress/i18n";
|
|
4748
|
+
var transformMoveValue = (value) => Object.values(value).map((axis) => {
|
|
4749
|
+
const size = axis?.value?.size ?? defaultValues.move.size;
|
|
4750
|
+
const unit = axis?.value?.unit ?? defaultValues.move.unit;
|
|
4751
|
+
return `${size}${unit}`;
|
|
4752
|
+
}).join(", ");
|
|
4753
|
+
var transformScaleValue = (value) => Object.values(value).map((axis) => axis?.value || defaultValues.scale).join(", ");
|
|
4754
|
+
var transformRotateValue = (value) => Object.values(value).map((axis) => {
|
|
4755
|
+
const size = axis?.value?.size ?? defaultValues.rotate.size;
|
|
4756
|
+
const unit = axis?.value?.unit ?? defaultValues.rotate.unit;
|
|
4757
|
+
return `${size}${unit}`;
|
|
4758
|
+
}).join(", ");
|
|
4759
|
+
var transformSkewValue = (value) => Object.values(value).map((axis) => {
|
|
4760
|
+
const size = axis?.value?.size ?? defaultValues.skew.size;
|
|
4761
|
+
const unit = axis?.value?.unit ?? defaultValues.skew.unit;
|
|
4762
|
+
return `${size}${unit}`;
|
|
4763
|
+
}).join(", ");
|
|
3979
4764
|
var TransformLabel = (props) => {
|
|
3980
4765
|
const { $$type, value } = props.value;
|
|
3981
4766
|
switch ($$type) {
|
|
3982
|
-
case
|
|
3983
|
-
return /* @__PURE__ */
|
|
4767
|
+
case TransformFunctionKeys.move:
|
|
4768
|
+
return /* @__PURE__ */ React77.createElement(Label2, { label: __37("Move", "elementor"), value: transformMoveValue(value) });
|
|
4769
|
+
case TransformFunctionKeys.scale:
|
|
4770
|
+
return /* @__PURE__ */ React77.createElement(Label2, { label: __37("Scale", "elementor"), value: transformScaleValue(value) });
|
|
4771
|
+
case TransformFunctionKeys.rotate:
|
|
4772
|
+
return /* @__PURE__ */ React77.createElement(Label2, { label: __37("Rotate", "elementor"), value: transformRotateValue(value) });
|
|
4773
|
+
case TransformFunctionKeys.skew:
|
|
4774
|
+
return /* @__PURE__ */ React77.createElement(Label2, { label: __37("Skew", "elementor"), value: transformSkewValue(value) });
|
|
3984
4775
|
default:
|
|
3985
4776
|
return "";
|
|
3986
4777
|
}
|
|
3987
4778
|
};
|
|
3988
4779
|
var Label2 = ({ label, value }) => {
|
|
3989
|
-
return /* @__PURE__ */
|
|
4780
|
+
return /* @__PURE__ */ React77.createElement(Box12, { component: "span" }, label, ": ", value);
|
|
3990
4781
|
};
|
|
3991
4782
|
|
|
3992
4783
|
// src/controls/transform-control/transform-repeater-control.tsx
|
|
3993
|
-
var initialTransformValue = {
|
|
3994
|
-
$$type: "transform-move",
|
|
3995
|
-
value: {
|
|
3996
|
-
x: { $$type: "size", value: { size: 0, unit: "px" } },
|
|
3997
|
-
y: { $$type: "size", value: { size: 0, unit: "px" } },
|
|
3998
|
-
z: { $$type: "size", value: { size: 0, unit: "px" } }
|
|
3999
|
-
}
|
|
4000
|
-
};
|
|
4001
4784
|
var TransformRepeaterControl = createControl(() => {
|
|
4002
4785
|
const { propType, value: transformValues, setValue, disabled } = useBoundProp(transformPropTypeUtil);
|
|
4003
|
-
return /* @__PURE__ */
|
|
4786
|
+
return /* @__PURE__ */ React78.createElement(PropProvider, { propType, value: transformValues, setValue }, /* @__PURE__ */ React78.createElement(
|
|
4004
4787
|
Repeater,
|
|
4005
4788
|
{
|
|
4006
4789
|
openOnAdd: true,
|
|
4007
4790
|
disabled,
|
|
4008
4791
|
values: transformValues ?? [],
|
|
4009
4792
|
setValues: setValue,
|
|
4010
|
-
label:
|
|
4793
|
+
label: __38("Transform", "elementor"),
|
|
4011
4794
|
showDuplicate: false,
|
|
4012
4795
|
itemSettings: {
|
|
4013
4796
|
Icon: TransformIcon,
|
|
@@ -4018,6 +4801,213 @@ var TransformRepeaterControl = createControl(() => {
|
|
|
4018
4801
|
}
|
|
4019
4802
|
));
|
|
4020
4803
|
});
|
|
4804
|
+
|
|
4805
|
+
// src/controls/transition-control/transition-repeater-control.tsx
|
|
4806
|
+
import * as React81 from "react";
|
|
4807
|
+
import { selectionSizePropTypeUtil as selectionSizePropTypeUtil2 } from "@elementor/editor-props";
|
|
4808
|
+
import { __ as __40 } from "@wordpress/i18n";
|
|
4809
|
+
|
|
4810
|
+
// src/controls/selection-size-control.tsx
|
|
4811
|
+
import * as React79 from "react";
|
|
4812
|
+
import { useMemo as useMemo7, useRef as useRef19 } from "react";
|
|
4813
|
+
import { selectionSizePropTypeUtil } from "@elementor/editor-props";
|
|
4814
|
+
import { Grid as Grid25 } from "@elementor/ui";
|
|
4815
|
+
var SelectionSizeControl = createControl(
|
|
4816
|
+
({ selectionLabel, sizeLabel, selectionConfig, sizeConfigMap }) => {
|
|
4817
|
+
const { value, setValue, propType } = useBoundProp(selectionSizePropTypeUtil);
|
|
4818
|
+
const rowRef = useRef19(null);
|
|
4819
|
+
const currentSizeConfig = useMemo7(() => {
|
|
4820
|
+
switch (value.selection.$$type) {
|
|
4821
|
+
case "key-value":
|
|
4822
|
+
return sizeConfigMap[value?.selection?.value.value.value || ""];
|
|
4823
|
+
case "string":
|
|
4824
|
+
return sizeConfigMap[value?.selection?.value || ""];
|
|
4825
|
+
default:
|
|
4826
|
+
return null;
|
|
4827
|
+
}
|
|
4828
|
+
}, [value, sizeConfigMap]);
|
|
4829
|
+
const SelectionComponent = selectionConfig.component;
|
|
4830
|
+
return /* @__PURE__ */ React79.createElement(PropProvider, { value, setValue, propType }, /* @__PURE__ */ React79.createElement(Grid25, { container: true, spacing: 1.5, ref: rowRef }, /* @__PURE__ */ React79.createElement(Grid25, { item: true, xs: 6, sx: { display: "flex", alignItems: "center" } }, /* @__PURE__ */ React79.createElement(ControlFormLabel, null, selectionLabel)), /* @__PURE__ */ React79.createElement(Grid25, { item: true, xs: 6 }, /* @__PURE__ */ React79.createElement(PropKeyProvider, { bind: "selection" }, /* @__PURE__ */ React79.createElement(SelectionComponent, { ...selectionConfig.props }))), currentSizeConfig && /* @__PURE__ */ React79.createElement(React79.Fragment, null, /* @__PURE__ */ React79.createElement(Grid25, { item: true, xs: 6, sx: { display: "flex", alignItems: "center" } }, /* @__PURE__ */ React79.createElement(ControlFormLabel, null, sizeLabel)), /* @__PURE__ */ React79.createElement(Grid25, { item: true, xs: 6 }, /* @__PURE__ */ React79.createElement(PropKeyProvider, { bind: "size" }, /* @__PURE__ */ React79.createElement(
|
|
4831
|
+
SizeControl,
|
|
4832
|
+
{
|
|
4833
|
+
anchorRef: rowRef,
|
|
4834
|
+
variant: currentSizeConfig.variant,
|
|
4835
|
+
units: currentSizeConfig.units,
|
|
4836
|
+
defaultUnit: currentSizeConfig.defaultUnit
|
|
4837
|
+
}
|
|
4838
|
+
))))));
|
|
4839
|
+
}
|
|
4840
|
+
);
|
|
4841
|
+
|
|
4842
|
+
// src/controls/transition-control/data.ts
|
|
4843
|
+
var initialTransitionValue = {
|
|
4844
|
+
selection: {
|
|
4845
|
+
$$type: "key-value",
|
|
4846
|
+
value: {
|
|
4847
|
+
key: { value: "All properties", $$type: "string" },
|
|
4848
|
+
value: { value: "all", $$type: "string" }
|
|
4849
|
+
}
|
|
4850
|
+
},
|
|
4851
|
+
size: { $$type: "size", value: { size: 200, unit: "ms" } }
|
|
4852
|
+
};
|
|
4853
|
+
var transitionProperties = [
|
|
4854
|
+
{
|
|
4855
|
+
label: "Common",
|
|
4856
|
+
type: "category",
|
|
4857
|
+
properties: [{ label: "All properties", value: "all" }]
|
|
4858
|
+
}
|
|
4859
|
+
];
|
|
4860
|
+
var transitionsItemsList = transitionProperties.map((category) => ({
|
|
4861
|
+
label: category.label,
|
|
4862
|
+
items: category.properties.map((property) => property.label)
|
|
4863
|
+
}));
|
|
4864
|
+
|
|
4865
|
+
// src/controls/transition-control/transition-selector.tsx
|
|
4866
|
+
import * as React80 from "react";
|
|
4867
|
+
import { useRef as useRef20 } from "react";
|
|
4868
|
+
import { keyValuePropTypeUtil as keyValuePropTypeUtil2 } from "@elementor/editor-props";
|
|
4869
|
+
import { ChevronDownIcon as ChevronDownIcon3, VariationsIcon } from "@elementor/icons";
|
|
4870
|
+
import { bindPopover as bindPopover6, bindTrigger as bindTrigger5, Box as Box13, Popover as Popover6, UnstableTag as UnstableTag4, usePopupState as usePopupState7 } from "@elementor/ui";
|
|
4871
|
+
import { __ as __39 } from "@wordpress/i18n";
|
|
4872
|
+
var toTransitionSelectorValue = (label) => {
|
|
4873
|
+
for (const category of transitionProperties) {
|
|
4874
|
+
const property = category.properties.find((prop) => prop.label === label);
|
|
4875
|
+
if (property) {
|
|
4876
|
+
return {
|
|
4877
|
+
key: { value: property.label, $$type: "string" },
|
|
4878
|
+
value: { value: property.value, $$type: "string" }
|
|
4879
|
+
};
|
|
4880
|
+
}
|
|
4881
|
+
}
|
|
4882
|
+
return null;
|
|
4883
|
+
};
|
|
4884
|
+
var TransitionSelector = () => {
|
|
4885
|
+
const { value, setValue } = useBoundProp(keyValuePropTypeUtil2);
|
|
4886
|
+
const {
|
|
4887
|
+
value: { value: transitionValue },
|
|
4888
|
+
key: { value: transitionLabel }
|
|
4889
|
+
} = value;
|
|
4890
|
+
const defaultRef = useRef20(null);
|
|
4891
|
+
const popoverState = usePopupState7({ variant: "popover" });
|
|
4892
|
+
const handleTransitionPropertyChange = (newLabel) => {
|
|
4893
|
+
const newValue = toTransitionSelectorValue(newLabel);
|
|
4894
|
+
if (!newValue) {
|
|
4895
|
+
return;
|
|
4896
|
+
}
|
|
4897
|
+
setValue(newValue);
|
|
4898
|
+
popoverState.close();
|
|
4899
|
+
};
|
|
4900
|
+
const getAnchorPosition = () => {
|
|
4901
|
+
if (!defaultRef.current) {
|
|
4902
|
+
return void 0;
|
|
4903
|
+
}
|
|
4904
|
+
const rect = defaultRef.current.getBoundingClientRect();
|
|
4905
|
+
return {
|
|
4906
|
+
top: rect.top,
|
|
4907
|
+
left: rect.right + 36
|
|
4908
|
+
};
|
|
4909
|
+
};
|
|
4910
|
+
return /* @__PURE__ */ React80.createElement(Box13, { ref: defaultRef }, /* @__PURE__ */ React80.createElement(
|
|
4911
|
+
UnstableTag4,
|
|
4912
|
+
{
|
|
4913
|
+
variant: "outlined",
|
|
4914
|
+
label: transitionLabel,
|
|
4915
|
+
endIcon: /* @__PURE__ */ React80.createElement(ChevronDownIcon3, { fontSize: "tiny" }),
|
|
4916
|
+
...bindTrigger5(popoverState),
|
|
4917
|
+
fullWidth: true
|
|
4918
|
+
}
|
|
4919
|
+
), /* @__PURE__ */ React80.createElement(
|
|
4920
|
+
Popover6,
|
|
4921
|
+
{
|
|
4922
|
+
disablePortal: true,
|
|
4923
|
+
disableScrollLock: true,
|
|
4924
|
+
...bindPopover6(popoverState),
|
|
4925
|
+
anchorReference: "anchorPosition",
|
|
4926
|
+
anchorPosition: getAnchorPosition(),
|
|
4927
|
+
anchorOrigin: { vertical: "top", horizontal: "right" },
|
|
4928
|
+
transformOrigin: { vertical: "top", horizontal: "left" }
|
|
4929
|
+
},
|
|
4930
|
+
/* @__PURE__ */ React80.createElement(
|
|
4931
|
+
ItemSelector,
|
|
4932
|
+
{
|
|
4933
|
+
itemsList: transitionsItemsList,
|
|
4934
|
+
selectedItem: transitionValue,
|
|
4935
|
+
onItemChange: handleTransitionPropertyChange,
|
|
4936
|
+
onClose: popoverState.close,
|
|
4937
|
+
sectionWidth: 268,
|
|
4938
|
+
title: __39("Transition Property", "elementor"),
|
|
4939
|
+
icon: VariationsIcon
|
|
4940
|
+
}
|
|
4941
|
+
)
|
|
4942
|
+
));
|
|
4943
|
+
};
|
|
4944
|
+
|
|
4945
|
+
// src/controls/transition-control/transition-repeater-control.tsx
|
|
4946
|
+
var DURATION_CONFIG = {
|
|
4947
|
+
variant: "time",
|
|
4948
|
+
units: ["s", "ms"],
|
|
4949
|
+
defaultUnit: "ms"
|
|
4950
|
+
};
|
|
4951
|
+
var getSelectionSizeProps = () => {
|
|
4952
|
+
return {
|
|
4953
|
+
selectionLabel: __40("Type", "elementor"),
|
|
4954
|
+
sizeLabel: __40("Duration", "elementor"),
|
|
4955
|
+
selectionConfig: {
|
|
4956
|
+
component: TransitionSelector,
|
|
4957
|
+
props: {}
|
|
4958
|
+
},
|
|
4959
|
+
sizeConfigMap: {
|
|
4960
|
+
...transitionProperties.reduce(
|
|
4961
|
+
(acc, category) => {
|
|
4962
|
+
category.properties.forEach((property) => {
|
|
4963
|
+
acc[property.value] = DURATION_CONFIG;
|
|
4964
|
+
});
|
|
4965
|
+
return acc;
|
|
4966
|
+
},
|
|
4967
|
+
{}
|
|
4968
|
+
)
|
|
4969
|
+
}
|
|
4970
|
+
};
|
|
4971
|
+
};
|
|
4972
|
+
function getChildControlConfig() {
|
|
4973
|
+
return {
|
|
4974
|
+
propTypeUtil: selectionSizePropTypeUtil2,
|
|
4975
|
+
component: SelectionSizeControl,
|
|
4976
|
+
props: getSelectionSizeProps()
|
|
4977
|
+
};
|
|
4978
|
+
}
|
|
4979
|
+
var TransitionRepeaterControl = createControl(() => {
|
|
4980
|
+
return /* @__PURE__ */ React81.createElement(
|
|
4981
|
+
RepeatableControl,
|
|
4982
|
+
{
|
|
4983
|
+
label: __40("Transitions", "elementor"),
|
|
4984
|
+
repeaterLabel: __40("Transitions", "elementor"),
|
|
4985
|
+
patternLabel: "${value.selection.value.key.value}: ${value.size.value.size}${value.size.value.unit}",
|
|
4986
|
+
placeholder: __40("Empty Transition", "elementor"),
|
|
4987
|
+
showDuplicate: false,
|
|
4988
|
+
showToggle: true,
|
|
4989
|
+
initialValues: initialTransitionValue,
|
|
4990
|
+
childControlConfig: getChildControlConfig(),
|
|
4991
|
+
propKey: "transition"
|
|
4992
|
+
}
|
|
4993
|
+
);
|
|
4994
|
+
});
|
|
4995
|
+
|
|
4996
|
+
// src/controls/unstable-transform-control/unstable-transform-repeater-control.tsx
|
|
4997
|
+
import * as React82 from "react";
|
|
4998
|
+
import { transformPropTypeUtil as transformPropTypeUtil2 } from "@elementor/editor-props";
|
|
4999
|
+
import { __ as __41 } from "@wordpress/i18n";
|
|
5000
|
+
var UnstableTransformRepeaterControl = createControl(() => {
|
|
5001
|
+
const { propType, value: transformValues, setValue } = useBoundProp(transformPropTypeUtil2);
|
|
5002
|
+
return /* @__PURE__ */ React82.createElement(PropProvider, { propType, value: transformValues, setValue }, /* @__PURE__ */ React82.createElement(UnstableRepeater, { initial: initialTransformValue, propTypeUtil: transformPropTypeUtil2 }, /* @__PURE__ */ React82.createElement(Header, { label: __41("Transform", "elementor") }, /* @__PURE__ */ React82.createElement(AddItemAction, null)), /* @__PURE__ */ React82.createElement(
|
|
5003
|
+
ItemsContainer,
|
|
5004
|
+
{
|
|
5005
|
+
itemTemplate: /* @__PURE__ */ React82.createElement(Item, { Icon: TransformIcon, Label: TransformLabel, Content: TransformContent })
|
|
5006
|
+
},
|
|
5007
|
+
/* @__PURE__ */ React82.createElement(DisableItemAction, null),
|
|
5008
|
+
/* @__PURE__ */ React82.createElement(RemoveItemAction, null)
|
|
5009
|
+
)));
|
|
5010
|
+
});
|
|
4021
5011
|
export {
|
|
4022
5012
|
AspectRatioControl,
|
|
4023
5013
|
BackgroundControl,
|
|
@@ -4032,9 +5022,9 @@ export {
|
|
|
4032
5022
|
EqualUnequalSizesControl,
|
|
4033
5023
|
FilterRepeaterControl,
|
|
4034
5024
|
FontFamilyControl,
|
|
4035
|
-
FontFamilySelector,
|
|
4036
5025
|
GapControl,
|
|
4037
5026
|
ImageControl,
|
|
5027
|
+
ItemSelector,
|
|
4038
5028
|
KeyValueControl,
|
|
4039
5029
|
LinkControl,
|
|
4040
5030
|
LinkedDimensionsControl,
|
|
@@ -4053,12 +5043,20 @@ export {
|
|
|
4053
5043
|
TextControl,
|
|
4054
5044
|
ToggleControl,
|
|
4055
5045
|
TransformRepeaterControl,
|
|
5046
|
+
TransitionRepeaterControl,
|
|
5047
|
+
UnstableTransformRepeaterControl,
|
|
4056
5048
|
UrlControl,
|
|
4057
5049
|
createControlReplacementsRegistry,
|
|
5050
|
+
enqueueFont,
|
|
5051
|
+
injectIntoRepeaterHeaderActions,
|
|
5052
|
+
injectIntoRepeaterItemActions,
|
|
4058
5053
|
injectIntoRepeaterItemIcon,
|
|
4059
5054
|
injectIntoRepeaterItemLabel,
|
|
5055
|
+
transitionProperties,
|
|
5056
|
+
transitionsItemsList,
|
|
4060
5057
|
useBoundProp,
|
|
4061
5058
|
useControlActions,
|
|
5059
|
+
useFloatingActionsBar,
|
|
4062
5060
|
useSyncExternalState
|
|
4063
5061
|
};
|
|
4064
5062
|
//# sourceMappingURL=index.mjs.map
|