@elementor/editor-controls 3.32.0-29 → 3.32.0-31

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.
Files changed (33) hide show
  1. package/dist/index.d.mts +1 -3
  2. package/dist/index.d.ts +1 -3
  3. package/dist/index.js +274 -282
  4. package/dist/index.js.map +1 -1
  5. package/dist/index.mjs +235 -242
  6. package/dist/index.mjs.map +1 -1
  7. package/package.json +14 -14
  8. package/src/components/unstable-repeater/actions/disable-item-action.tsx +2 -2
  9. package/src/components/unstable-repeater/actions/duplicate-item-action.tsx +3 -3
  10. package/src/components/unstable-repeater/actions/tooltip-add-item-action.tsx +66 -0
  11. package/src/components/unstable-repeater/context/repeater-context.tsx +52 -67
  12. package/src/components/unstable-repeater/header/header.tsx +2 -2
  13. package/src/components/unstable-repeater/index.ts +1 -1
  14. package/src/components/unstable-repeater/items/edit-item-popover.tsx +28 -12
  15. package/src/components/unstable-repeater/items/item.tsx +15 -19
  16. package/src/components/unstable-repeater/items/items-container.tsx +17 -15
  17. package/src/components/unstable-repeater/types.ts +2 -12
  18. package/src/components/unstable-repeater/unstable-repeater.tsx +5 -3
  19. package/src/controls/background-control/background-overlay/background-overlay-repeater-control.tsx +25 -23
  20. package/src/controls/transform-control/functions/move.tsx +1 -1
  21. package/src/controls/transform-control/functions/rotate.tsx +1 -1
  22. package/src/controls/transform-control/functions/scale.tsx +1 -1
  23. package/src/controls/transform-control/functions/skew.tsx +1 -1
  24. package/src/controls/transform-control/transform-content.tsx +2 -12
  25. package/src/controls/transform-control/transform-icon.tsx +1 -1
  26. package/src/controls/transform-control/transform-label.tsx +1 -1
  27. package/src/controls/transform-control/transform-repeater-control.tsx +49 -17
  28. package/src/controls/transform-control/use-transform-tabs-history.tsx +12 -2
  29. package/src/index.ts +0 -1
  30. package/src/components/unstable-repeater/actions/add-item-action.tsx +0 -50
  31. package/src/components/unstable-repeater/items/use-popover.tsx +0 -26
  32. package/src/controls/unstable-transform-control/unstable-transform-repeater-control.tsx +0 -35
  33. /package/src/controls/transform-control/{types.ts → initial-values.ts} +0 -0
package/dist/index.mjs CHANGED
@@ -1906,7 +1906,7 @@ var ControlToggleButtonGroup = ({
1906
1906
  width: `100%`
1907
1907
  }
1908
1908
  },
1909
- fixedItems.map(({ label, value: buttonValue, renderContent: Content6, showTooltip }) => {
1909
+ fixedItems.map(({ label, value: buttonValue, renderContent: Content4, showTooltip }) => {
1910
1910
  const isPlaceholder = placeholderArray.length > 0 && placeholderArray.includes(buttonValue) && (shouldShowExclusivePlaceholder || shouldShowNonExclusivePlaceholder);
1911
1911
  return /* @__PURE__ */ React32.createElement(
1912
1912
  ConditionalTooltip,
@@ -1924,7 +1924,7 @@ var ControlToggleButtonGroup = ({
1924
1924
  fullWidth,
1925
1925
  isPlaceholder
1926
1926
  },
1927
- /* @__PURE__ */ React32.createElement(Content6, { size })
1927
+ /* @__PURE__ */ React32.createElement(Content4, { size })
1928
1928
  )
1929
1929
  );
1930
1930
  }),
@@ -3308,19 +3308,20 @@ import {
3308
3308
  backgroundOverlayPropTypeUtil,
3309
3309
  colorPropTypeUtil as colorPropTypeUtil3
3310
3310
  } from "@elementor/editor-props";
3311
- import { Box as Box9, CardMedia as CardMedia3, styled as styled6, Tab, TabPanel, Tabs, UnstableColorIndicator as UnstableColorIndicator2 } from "@elementor/ui";
3311
+ import { Box as Box10, CardMedia as CardMedia3, styled as styled6, Tab, TabPanel, Tabs, UnstableColorIndicator as UnstableColorIndicator2 } from "@elementor/ui";
3312
3312
  import { useWpMediaAttachment as useWpMediaAttachment3 } from "@elementor/wp-media";
3313
3313
  import { __ as __28 } from "@wordpress/i18n";
3314
3314
 
3315
- // src/components/unstable-repeater/actions/add-item-action.tsx
3315
+ // src/components/unstable-repeater/actions/tooltip-add-item-action.tsx
3316
3316
  import * as React50 from "react";
3317
3317
  import { PlusIcon as PlusIcon3 } from "@elementor/icons";
3318
- import { IconButton as IconButton4, Tooltip as Tooltip6 } from "@elementor/ui";
3318
+ import { Box as Box8, IconButton as IconButton4, Infotip as Infotip2 } from "@elementor/ui";
3319
3319
  import { __ as __19 } from "@wordpress/i18n";
3320
3320
 
3321
3321
  // src/components/unstable-repeater/context/repeater-context.tsx
3322
3322
  import * as React49 from "react";
3323
3323
  import { createContext as createContext7, useState as useState12 } from "react";
3324
+ import { usePopupState as usePopupState6 } from "@elementor/ui";
3324
3325
  var RepeaterContext = createContext7(null);
3325
3326
  var EMPTY_OPEN_ITEM2 = -1;
3326
3327
  var useRepeaterContext = () => {
@@ -3328,28 +3329,12 @@ var useRepeaterContext = () => {
3328
3329
  if (!context) {
3329
3330
  throw new Error("useRepeaterContext must be used within a RepeaterContextProvider");
3330
3331
  }
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
3346
- };
3332
+ return context;
3347
3333
  };
3348
3334
  var RepeaterContextProvider = ({
3349
3335
  children,
3350
3336
  initial,
3351
- propTypeUtil,
3352
- isSortable = true
3337
+ propTypeUtil
3353
3338
  }) => {
3354
3339
  const { value: repeaterValues, setValue: setRepeaterValues } = useBoundProp(propTypeUtil);
3355
3340
  const [items2, setItems] = useSyncExternalState({
@@ -3358,52 +3343,51 @@ var RepeaterContextProvider = ({
3358
3343
  setExternal: setRepeaterValues,
3359
3344
  persistWhen: () => true
3360
3345
  });
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
- );
3346
+ const itemWithKeysState = useState12(
3347
+ items2?.map((item, index) => ({ key: index, item })) ?? []
3348
+ );
3349
+ const itemsWithKeys = itemWithKeysState[0];
3350
+ const setItemsWithKeys = (newItems) => {
3351
+ itemWithKeysState[1](newItems);
3352
+ setItems(newItems.map(({ item }) => item));
3372
3353
  };
3373
- const addItem = (config) => {
3354
+ const [openItemIndex, setOpenItemIndex] = useState12(EMPTY_OPEN_ITEM2);
3355
+ const [rowRef, setRowRef] = useState12(null);
3356
+ const isOpen = openItemIndex !== EMPTY_OPEN_ITEM2;
3357
+ const popoverState = usePopupState6({ variant: "popover" });
3358
+ const addItem = (ev, config) => {
3374
3359
  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);
3360
+ const newIndex = config?.index ?? items2.length;
3361
+ const newKey = generateNextKey(itemsWithKeys.map(({ key }) => key));
3362
+ const newItemsWithKeys = [...itemsWithKeys];
3363
+ newItemsWithKeys.splice(newIndex, 0, { item, key: newKey });
3364
+ setItemsWithKeys(newItemsWithKeys);
3365
+ setOpenItemIndex(newIndex);
3366
+ popoverState.open(rowRef ?? ev);
3381
3367
  };
3382
3368
  const removeItem = (index) => {
3383
- setItems((prevItems) => prevItems.filter((_, pos) => pos !== index));
3384
- setUniqueKeys((prevKeys) => prevKeys.slice(0, -1));
3369
+ setItemsWithKeys(itemsWithKeys.filter((_, pos) => pos !== index));
3385
3370
  };
3386
3371
  const updateItem = (updatedItem, index) => {
3387
- setItems((prevItems) => prevItems.map((item, pos) => pos === index ? updatedItem : item));
3372
+ const item = itemsWithKeys[index];
3373
+ setItemsWithKeys(itemsWithKeys.toSpliced(index, 1, { ...item, item: updatedItem }));
3388
3374
  };
3389
3375
  return /* @__PURE__ */ React49.createElement(
3390
3376
  RepeaterContext.Provider,
3391
3377
  {
3392
3378
  value: {
3393
3379
  isOpen,
3394
- openItem,
3395
- setOpenItem,
3396
- items: items2 ?? [],
3397
- setItems,
3380
+ openItemIndex,
3381
+ setOpenItemIndex,
3382
+ items: itemsWithKeys ?? [],
3383
+ setItems: setItemsWithKeys,
3384
+ popoverState,
3398
3385
  initial,
3399
- uniqueKeys,
3400
- setUniqueKeys,
3401
- isSortable,
3402
- generateNextKey,
3403
- sortItemsByKeys,
3404
- addItem,
3405
3386
  updateItem,
3406
- removeItem
3387
+ addItem,
3388
+ removeItem,
3389
+ rowRef,
3390
+ setRowRef
3407
3391
  }
3408
3392
  },
3409
3393
  children
@@ -3413,83 +3397,96 @@ var generateNextKey = (source) => {
3413
3397
  return 1 + Math.max(0, ...source);
3414
3398
  };
3415
3399
 
3416
- // src/components/unstable-repeater/actions/add-item-action.tsx
3400
+ // src/components/unstable-repeater/actions/tooltip-add-item-action.tsx
3417
3401
  var SIZE4 = "tiny";
3418
- var AddItemAction = ({
3402
+ var TooltipAddItemAction = ({
3419
3403
  disabled = false,
3420
- tooltip = false,
3404
+ enableTooltip = false,
3421
3405
  tooltipContent = null,
3422
3406
  newItemIndex
3423
3407
  }) => {
3424
3408
  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(
3409
+ const onClick = (ev) => addItem(ev, { index: newItemIndex });
3410
+ return /* @__PURE__ */ React50.createElement(ConditionalToolTip, { content: tooltipContent, enable: enableTooltip }, /* @__PURE__ */ React50.createElement(Box8, { sx: { ml: "auto" } }, /* @__PURE__ */ React50.createElement(
3428
3411
  IconButton4,
3429
3412
  {
3430
3413
  size: SIZE4,
3431
- sx: { ml: "auto" },
3432
3414
  disabled,
3433
3415
  onClick,
3434
3416
  "aria-label": __19("Add item", "elementor")
3435
3417
  },
3436
3418
  /* @__PURE__ */ React50.createElement(PlusIcon3, { fontSize: SIZE4 })
3437
- ));
3419
+ )));
3438
3420
  };
3439
3421
  var ConditionalToolTip = ({
3440
3422
  children,
3441
- content,
3442
- shouldShowTooltip
3443
- }) => {
3444
- return shouldShowTooltip ? /* @__PURE__ */ React50.createElement(Tooltip6, { title: content }, children) : children;
3445
- };
3423
+ enable,
3424
+ content
3425
+ }) => enable && content ? /* @__PURE__ */ React50.createElement(
3426
+ Infotip2,
3427
+ {
3428
+ placement: "right",
3429
+ content: /* @__PURE__ */ React50.createElement(
3430
+ Box8,
3431
+ {
3432
+ component: "span",
3433
+ "aria-label": void 0,
3434
+ sx: { display: "flex", gap: 0.5, p: 2, width: 320, borderRadius: 1 }
3435
+ },
3436
+ content
3437
+ )
3438
+ },
3439
+ children
3440
+ ) : children;
3446
3441
 
3447
3442
  // src/components/unstable-repeater/header/header.tsx
3448
3443
  import * as React51 from "react";
3449
3444
  import { Stack as Stack14, Typography as Typography5 } from "@elementor/ui";
3450
3445
  var Header = ({ label, children }) => {
3451
3446
  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));
3447
+ 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: [TooltipAddItemAction] }, children), /* @__PURE__ */ React51.createElement(ControlAdornments, null));
3453
3448
  };
3454
3449
 
3455
3450
  // src/components/unstable-repeater/items/items-container.tsx
3456
3451
  import * as React52 from "react";
3457
3452
  var ItemsContainer = ({
3458
3453
  itemTemplate,
3454
+ isSortable = true,
3459
3455
  children
3460
3456
  }) => {
3461
- const { items: items2, uniqueKeys, openItem, isSortable, sortItemsByKeys } = useRepeaterContext();
3457
+ const { items: items2, setItems } = useRepeaterContext();
3458
+ const keys = items2.map(({ key }) => key);
3462
3459
  if (!itemTemplate) {
3463
3460
  return null;
3464
3461
  }
3465
- const onChangeOrder = (newOrder) => {
3466
- sortItemsByKeys(newOrder);
3462
+ const onChangeOrder = (newKeys) => {
3463
+ setItems(
3464
+ newKeys.map((key) => {
3465
+ const index = items2.findIndex((item) => item.key === key);
3466
+ return items2[index];
3467
+ })
3468
+ );
3467
3469
  };
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
- }
3470
+ return /* @__PURE__ */ React52.createElement(React52.Fragment, null, /* @__PURE__ */ React52.createElement(SortableProvider, { value: keys, onChange: onChangeOrder }, keys.map((key, index) => {
3471
+ const value = items2[index].item;
3473
3472
  return /* @__PURE__ */ React52.createElement(SortableItem, { id: key, key: `sortable-${key}`, disabled: !isSortable }, React52.isValidElement(itemTemplate) ? React52.cloneElement(itemTemplate, {
3474
3473
  key,
3475
3474
  value,
3476
3475
  index,
3477
- openOnMount: key === openItem,
3478
3476
  children
3479
3477
  }) : null);
3480
3478
  })));
3481
3479
  };
3482
3480
 
3483
3481
  // src/components/unstable-repeater/items/item.tsx
3484
- import * as React57 from "react";
3485
- import { useState as useState14 } from "react";
3482
+ import * as React56 from "react";
3486
3483
  import { bindTrigger as bindTrigger4, UnstableTag as UnstableTag3 } from "@elementor/ui";
3487
3484
  import { __ as __23 } from "@wordpress/i18n";
3488
3485
 
3489
3486
  // src/components/unstable-repeater/actions/disable-item-action.tsx
3490
3487
  import * as React53 from "react";
3491
3488
  import { EyeIcon as EyeIcon2, EyeOffIcon as EyeOffIcon2 } from "@elementor/icons";
3492
- import { IconButton as IconButton5, Tooltip as Tooltip7 } from "@elementor/ui";
3489
+ import { IconButton as IconButton5, Tooltip as Tooltip6 } from "@elementor/ui";
3493
3490
  import { __ as __20 } from "@wordpress/i18n";
3494
3491
  var SIZE5 = "tiny";
3495
3492
  var DisableItemAction = ({ index = -1 }) => {
@@ -3497,23 +3494,23 @@ var DisableItemAction = ({ index = -1 }) => {
3497
3494
  if (index === -1) {
3498
3495
  return null;
3499
3496
  }
3500
- const propDisabled = items2[index]?.disabled ?? false;
3497
+ const propDisabled = items2[index].item.disabled ?? false;
3501
3498
  const toggleLabel = propDisabled ? __20("Show", "elementor") : __20("Hide", "elementor");
3502
3499
  const onClick = () => {
3503
- const self = structuredClone(items2[index]);
3500
+ const self = structuredClone(items2[index].item);
3504
3501
  self.disabled = !self.disabled;
3505
3502
  if (!self.disabled) {
3506
3503
  delete self.disabled;
3507
3504
  }
3508
3505
  updateItem(self, index);
3509
3506
  };
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 })));
3507
+ return /* @__PURE__ */ React53.createElement(Tooltip6, { 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
3508
  };
3512
3509
 
3513
3510
  // src/components/unstable-repeater/actions/duplicate-item-action.tsx
3514
3511
  import * as React54 from "react";
3515
3512
  import { CopyIcon as CopyIcon2 } from "@elementor/icons";
3516
- import { IconButton as IconButton6, Tooltip as Tooltip8 } from "@elementor/ui";
3513
+ import { IconButton as IconButton6, Tooltip as Tooltip7 } from "@elementor/ui";
3517
3514
  import { __ as __21 } from "@wordpress/i18n";
3518
3515
  var SIZE6 = "tiny";
3519
3516
  var DuplicateItemAction = ({ index = -1 }) => {
@@ -3522,17 +3519,17 @@ var DuplicateItemAction = ({ index = -1 }) => {
3522
3519
  return null;
3523
3520
  }
3524
3521
  const duplicateLabel = __21("Duplicate", "elementor");
3525
- const onClick = () => {
3526
- const newItem = structuredClone(items2[index]);
3527
- addItem({ item: newItem, index: index + 1 });
3522
+ const onClick = (ev) => {
3523
+ const newItem = structuredClone(items2[index]?.item);
3524
+ addItem(ev, { item: newItem, index: index + 1 });
3528
3525
  };
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 })));
3526
+ return /* @__PURE__ */ React54.createElement(Tooltip7, { title: duplicateLabel, placement: "top" }, /* @__PURE__ */ React54.createElement(IconButton6, { size: SIZE6, onClick, "aria-label": duplicateLabel }, /* @__PURE__ */ React54.createElement(CopyIcon2, { fontSize: SIZE6 })));
3530
3527
  };
3531
3528
 
3532
3529
  // src/components/unstable-repeater/actions/remove-item-action.tsx
3533
3530
  import * as React55 from "react";
3534
3531
  import { XIcon as XIcon3 } from "@elementor/icons";
3535
- import { IconButton as IconButton7, Tooltip as Tooltip9 } from "@elementor/ui";
3532
+ import { IconButton as IconButton7, Tooltip as Tooltip8 } from "@elementor/ui";
3536
3533
  import { __ as __22 } from "@wordpress/i18n";
3537
3534
  var SIZE7 = "tiny";
3538
3535
  var RemoveItemAction = ({ index = -1 }) => {
@@ -3542,80 +3539,39 @@ var RemoveItemAction = ({ index = -1 }) => {
3542
3539
  }
3543
3540
  const removeLabel = __22("Remove", "elementor");
3544
3541
  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
- };
3542
+ return /* @__PURE__ */ React55.createElement(Tooltip8, { title: removeLabel, placement: "top" }, /* @__PURE__ */ React55.createElement(IconButton7, { size: SIZE7, onClick, "aria-label": removeLabel }, /* @__PURE__ */ React55.createElement(XIcon3, { fontSize: SIZE7 })));
3589
3543
  };
3590
3544
 
3591
3545
  // src/components/unstable-repeater/items/item.tsx
3592
3546
  var Item = ({
3593
3547
  Label: Label3,
3594
3548
  Icon,
3595
- Content: Content6,
3596
- key,
3597
3549
  value,
3598
- index,
3599
- openOnMount,
3550
+ index = -1,
3600
3551
  children
3601
3552
  }) => {
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(
3553
+ const { items: items2, popoverState, setRowRef, openItemIndex, setOpenItemIndex } = useRepeaterContext();
3554
+ const triggerProps = bindTrigger4(popoverState);
3555
+ const key = items2[index].key ?? -1;
3556
+ const onClick = (ev) => {
3557
+ triggerProps.onClick(ev);
3558
+ setOpenItemIndex(index);
3559
+ };
3560
+ return /* @__PURE__ */ React56.createElement(React56.Fragment, null, /* @__PURE__ */ React56.createElement(
3606
3561
  UnstableTag3,
3607
3562
  {
3608
3563
  key,
3609
3564
  disabled: false,
3610
- label: /* @__PURE__ */ React57.createElement(RepeaterItemLabelSlot, { value }, /* @__PURE__ */ React57.createElement(Label3, { value })),
3565
+ label: /* @__PURE__ */ React56.createElement(RepeaterItemLabelSlot, { value }, /* @__PURE__ */ React56.createElement(Label3, { value })),
3611
3566
  showActionsOnHover: true,
3612
3567
  fullWidth: true,
3613
- ref: setRef,
3568
+ ref: (ref) => ref && openItemIndex === index && setRowRef(ref),
3614
3569
  variant: "outlined",
3615
3570
  "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(
3571
+ ...triggerProps,
3572
+ onClick,
3573
+ startIcon: /* @__PURE__ */ React56.createElement(RepeaterItemIconSlot, { value }, /* @__PURE__ */ React56.createElement(Icon, { value })),
3574
+ actions: /* @__PURE__ */ React56.createElement(React56.Fragment, null, /* @__PURE__ */ React56.createElement(RepeaterItemActionsSlot, { index: index ?? -1 }), /* @__PURE__ */ React56.createElement(
3619
3575
  SlotChildren,
3620
3576
  {
3621
3577
  whitelist: [DuplicateItemAction, DisableItemAction, RemoveItemAction],
@@ -3625,17 +3581,52 @@ var Item = ({
3625
3581
  children
3626
3582
  ))
3627
3583
  }
3628
- ), /* @__PURE__ */ React57.createElement(EditItemPopover, { anchorRef: ref, setAnchorEl, popoverProps }, /* @__PURE__ */ React57.createElement(Content6, { anchorEl, bind: String(index), value })));
3584
+ ));
3629
3585
  };
3630
3586
 
3631
3587
  // src/components/unstable-repeater/unstable-repeater.tsx
3632
3588
  import * as React58 from "react";
3589
+
3590
+ // src/components/unstable-repeater/items/edit-item-popover.tsx
3591
+ import * as React57 from "react";
3592
+ import { bindPopover as bindPopover5, Box as Box9, Popover as Popover5 } from "@elementor/ui";
3593
+ var EditItemPopover = ({ children }) => {
3594
+ const { popoverState, openItemIndex, isOpen, rowRef, setOpenItemIndex, setRowRef, items: items2 } = useRepeaterContext();
3595
+ const popoverProps = bindPopover5(popoverState);
3596
+ if (!isOpen || !rowRef) {
3597
+ return null;
3598
+ }
3599
+ const bind = items2[openItemIndex].item.$$type;
3600
+ const onClose = () => {
3601
+ popoverProps.onClose?.();
3602
+ setRowRef(null);
3603
+ setOpenItemIndex(EMPTY_OPEN_ITEM2);
3604
+ };
3605
+ return /* @__PURE__ */ React57.createElement(
3606
+ Popover5,
3607
+ {
3608
+ disablePortal: true,
3609
+ slotProps: {
3610
+ paper: {
3611
+ sx: { mt: 0.5, width: rowRef.offsetWidth }
3612
+ }
3613
+ },
3614
+ anchorOrigin: { vertical: "bottom", horizontal: "left" },
3615
+ ...popoverProps,
3616
+ anchorEl: rowRef,
3617
+ onClose
3618
+ },
3619
+ /* @__PURE__ */ React57.createElement(PropKeyProvider, { bind: String(openItemIndex) }, /* @__PURE__ */ React57.createElement(Box9, null, React57.isValidElement(children) && React57.cloneElement(children, { bind, index: openItemIndex })))
3620
+ );
3621
+ };
3622
+
3623
+ // src/components/unstable-repeater/unstable-repeater.tsx
3633
3624
  var UnstableRepeater = ({
3634
3625
  children,
3635
3626
  initial,
3636
3627
  propTypeUtil
3637
3628
  }) => {
3638
- return /* @__PURE__ */ React58.createElement(SectionContent, null, /* @__PURE__ */ React58.createElement(RepeaterContextProvider, { initial, propTypeUtil }, /* @__PURE__ */ React58.createElement(SlotChildren, { whitelist: [Header, ItemsContainer], sorted: true }, children)));
3629
+ return /* @__PURE__ */ React58.createElement(SectionContent, null, /* @__PURE__ */ React58.createElement(RepeaterContextProvider, { initial, propTypeUtil }, /* @__PURE__ */ React58.createElement(SlotChildren, { whitelist: [Header, ItemsContainer, EditItemPopover], sorted: true }, children)));
3639
3630
  };
3640
3631
 
3641
3632
  // src/env.ts
@@ -4008,19 +3999,26 @@ var backgroundResolutionOptions = [
4008
3999
  { label: __28("Full", "elementor"), value: "full" }
4009
4000
  ];
4010
4001
  var BackgroundOverlayRepeaterControl = createControl(() => {
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))));
4002
+ const { propType, value: overlayValues, setValue } = useBoundProp(backgroundOverlayPropTypeUtil);
4003
+ return /* @__PURE__ */ React64.createElement(PropProvider, { propType, value: overlayValues, setValue }, /* @__PURE__ */ React64.createElement(
4004
+ UnstableRepeater,
4005
+ {
4006
+ initial: getInitialBackgroundOverlay(),
4007
+ propTypeUtil: backgroundOverlayPropTypeUtil
4008
+ },
4009
+ /* @__PURE__ */ React64.createElement(Header, { label: __28("Overlay", "elementor") }, /* @__PURE__ */ React64.createElement(TooltipAddItemAction, { newItemIndex: 0 })),
4010
+ /* @__PURE__ */ React64.createElement(ItemsContainer, { itemTemplate: /* @__PURE__ */ React64.createElement(Item, { Icon: ItemIcon3, Label: ItemLabel3 }) }, /* @__PURE__ */ React64.createElement(DuplicateItemAction, null), /* @__PURE__ */ React64.createElement(DisableItemAction, null), /* @__PURE__ */ React64.createElement(RemoveItemAction, null)),
4011
+ /* @__PURE__ */ React64.createElement(EditItemPopover, null, /* @__PURE__ */ React64.createElement(ItemContent3, null))
4012
+ ));
4013
4013
  });
4014
- var ItemContent3 = ({ anchorEl = null, bind }) => {
4015
- return /* @__PURE__ */ React64.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React64.createElement(Content3, { anchorEl }));
4016
- };
4017
- var Content3 = ({ anchorEl }) => {
4014
+ var ItemContent3 = () => {
4018
4015
  const { getTabsProps, getTabProps, getTabPanelProps } = useBackgroundTabsHistory({
4019
4016
  image: getInitialBackgroundOverlay().value,
4020
4017
  color: initialBackgroundColorOverlay.value,
4021
4018
  gradient: initialBackgroundGradientOverlay.value
4022
4019
  });
4023
- return /* @__PURE__ */ React64.createElement(Box9, { sx: { width: "100%" } }, /* @__PURE__ */ React64.createElement(Box9, { sx: { borderBottom: 1, borderColor: "divider" } }, /* @__PURE__ */ React64.createElement(
4020
+ const { rowRef } = useRepeaterContext();
4021
+ return /* @__PURE__ */ React64.createElement(Box10, { sx: { width: "100%" } }, /* @__PURE__ */ React64.createElement(Box10, { sx: { borderBottom: 1, borderColor: "divider" } }, /* @__PURE__ */ React64.createElement(
4024
4022
  Tabs,
4025
4023
  {
4026
4024
  size: "small",
@@ -4031,7 +4029,7 @@ var Content3 = ({ anchorEl }) => {
4031
4029
  /* @__PURE__ */ React64.createElement(Tab, { label: __28("Image", "elementor"), ...getTabProps("image") }),
4032
4030
  /* @__PURE__ */ React64.createElement(Tab, { label: __28("Gradient", "elementor"), ...getTabProps("gradient") }),
4033
4031
  /* @__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 }))));
4032
+ )), /* @__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: rowRef }))));
4035
4033
  };
4036
4034
  var ItemIcon3 = ({ value }) => {
4037
4035
  switch (value.$$type) {
@@ -4152,7 +4150,7 @@ var BackgroundControl = createControl(() => {
4152
4150
  import * as React66 from "react";
4153
4151
  import { useMemo as useMemo5 } from "react";
4154
4152
  import { createArrayPropUtils } from "@elementor/editor-props";
4155
- import { Box as Box10 } from "@elementor/ui";
4153
+ import { Box as Box11 } from "@elementor/ui";
4156
4154
 
4157
4155
  // src/hooks/use-repeatable-control-context.ts
4158
4156
  import { createContext as createContext8, useContext as useContext8 } from "react";
@@ -4216,10 +4214,10 @@ var RepeatableControl = createControl(
4216
4214
  }
4217
4215
  );
4218
4216
  var ItemContent4 = ({ bind }) => {
4219
- return /* @__PURE__ */ React66.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React66.createElement(Content4, null));
4217
+ return /* @__PURE__ */ React66.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React66.createElement(Content3, null));
4220
4218
  };
4221
4219
  var ItemIcon4 = () => /* @__PURE__ */ React66.createElement(React66.Fragment, null);
4222
- var Content4 = () => {
4220
+ var Content3 = () => {
4223
4221
  const { component: ChildControl, props = {} } = useRepeatableControlContext();
4224
4222
  return /* @__PURE__ */ React66.createElement(PopoverContent, { p: 1.5 }, /* @__PURE__ */ React66.createElement(PopoverGridContainer, null, /* @__PURE__ */ React66.createElement(ChildControl, { ...props })));
4225
4223
  };
@@ -4283,7 +4281,7 @@ var ItemLabel4 = ({ value }) => {
4283
4281
  const showPlaceholder = shouldShowPlaceholder(patternLabel, value);
4284
4282
  const label = showPlaceholder ? placeholder : interpolate(patternLabel, value);
4285
4283
  const color = showPlaceholder ? "text.tertiary" : "text.primary";
4286
- return /* @__PURE__ */ React66.createElement(Box10, { component: "span", color }, label);
4284
+ return /* @__PURE__ */ React66.createElement(Box11, { component: "span", color }, label);
4287
4285
  };
4288
4286
  var getAllProperties = (pattern) => {
4289
4287
  const properties = pattern.match(PLACEHOLDER_REGEX)?.map((match) => match.slice(2, -1)) || [];
@@ -4292,7 +4290,7 @@ var getAllProperties = (pattern) => {
4292
4290
 
4293
4291
  // src/controls/key-value-control.tsx
4294
4292
  import * as React67 from "react";
4295
- import { useMemo as useMemo6, useState as useState15 } from "react";
4293
+ import { useMemo as useMemo6, useState as useState13 } from "react";
4296
4294
  import {
4297
4295
  isTransformable,
4298
4296
  keyValuePropTypeUtil,
@@ -4302,9 +4300,9 @@ import { FormHelperText, FormLabel as FormLabel3, Grid as Grid17 } from "@elemen
4302
4300
  import { __ as __30 } from "@wordpress/i18n";
4303
4301
  var KeyValueControl = createControl((props = {}) => {
4304
4302
  const { value, setValue, ...propContext } = useBoundProp(keyValuePropTypeUtil);
4305
- const [keyError, setKeyError] = useState15("");
4306
- const [valueError, setValueError] = useState15("");
4307
- const [sessionState, setSessionState] = useState15({
4303
+ const [keyError, setKeyError] = useState13("");
4304
+ const [valueError, setValueError] = useState13("");
4305
+ const [sessionState, setSessionState] = useState13({
4308
4306
  key: value?.key?.value || "",
4309
4307
  value: value?.value?.value || ""
4310
4308
  });
@@ -4420,22 +4418,11 @@ var PositionControl = () => {
4420
4418
  // src/controls/transform-control/transform-repeater-control.tsx
4421
4419
  import * as React78 from "react";
4422
4420
  import { transformPropTypeUtil } from "@elementor/editor-props";
4421
+ import { InfoCircleFilledIcon as InfoCircleFilledIcon2 } from "@elementor/icons";
4422
+ import { Typography as Typography6 } from "@elementor/ui";
4423
4423
  import { __ as __38 } from "@wordpress/i18n";
4424
4424
 
4425
- // src/controls/transform-control/transform-content.tsx
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";
4429
-
4430
- // src/controls/transform-control/functions/move.tsx
4431
- import * as React70 from "react";
4432
- import { useRef as useRef14 } from "react";
4433
- import { moveTransformPropTypeUtil } from "@elementor/editor-props";
4434
- import { ArrowDownLeftIcon, ArrowDownSmallIcon, ArrowRightIcon } from "@elementor/icons";
4435
- import { Grid as Grid20 } from "@elementor/ui";
4436
- import { __ as __32 } from "@wordpress/i18n";
4437
-
4438
- // src/controls/transform-control/types.ts
4425
+ // src/controls/transform-control/initial-values.ts
4439
4426
  import {
4440
4427
  numberPropTypeUtil as numberPropTypeUtil4,
4441
4428
  rotateTransformPropTypeUtil,
@@ -4486,6 +4473,19 @@ var initialSkewValue = skewTransformPropTypeUtil.create({
4486
4473
  y: { $$type: "size", value: { size: defaultValues.skew.size, unit: defaultValues.skew.unit } }
4487
4474
  });
4488
4475
 
4476
+ // src/controls/transform-control/transform-content.tsx
4477
+ import * as React75 from "react";
4478
+ import { Box as Box12, Tab as Tab2, TabPanel as TabPanel2, Tabs as Tabs2 } from "@elementor/ui";
4479
+ import { __ as __36 } from "@wordpress/i18n";
4480
+
4481
+ // src/controls/transform-control/functions/move.tsx
4482
+ import * as React70 from "react";
4483
+ import { useRef as useRef14 } from "react";
4484
+ import { moveTransformPropTypeUtil } from "@elementor/editor-props";
4485
+ import { ArrowDownLeftIcon, ArrowDownSmallIcon, ArrowRightIcon } from "@elementor/icons";
4486
+ import { Grid as Grid20 } from "@elementor/ui";
4487
+ import { __ as __32 } from "@wordpress/i18n";
4488
+
4489
4489
  // src/controls/transform-control/functions/axis-row.tsx
4490
4490
  import * as React69 from "react";
4491
4491
  import { Grid as Grid19 } from "@elementor/ui";
@@ -4632,6 +4632,7 @@ var useTransformTabsHistory = ({
4632
4632
  const { value: scaleValue, setValue: setScaleValue } = useBoundProp(scaleTransformPropTypeUtil3);
4633
4633
  const { value: rotateValue, setValue: setRotateValue } = useBoundProp(rotateTransformPropTypeUtil3);
4634
4634
  const { value: skewValue, setValue: setSkewValue } = useBoundProp(skewTransformPropTypeUtil3);
4635
+ const { openItemIndex, items: items2 } = useRepeaterContext();
4635
4636
  const getCurrentTransformType = () => {
4636
4637
  switch (true) {
4637
4638
  case !!scaleValue:
@@ -4685,25 +4686,28 @@ var useTransformTabsHistory = ({
4685
4686
  }
4686
4687
  return getTabsProps().onChange(e, tabName);
4687
4688
  };
4689
+ const isTabDisabled = (tabKey) => {
4690
+ return !!items2.find(({ item: { $$type: key } }, pos) => tabKey === key && pos !== openItemIndex);
4691
+ };
4688
4692
  return {
4689
- getTabProps,
4693
+ getTabProps: (value) => ({
4694
+ ...getTabProps(value),
4695
+ disabled: isTabDisabled(value)
4696
+ }),
4690
4697
  getTabPanelProps,
4691
4698
  getTabsProps: () => ({ ...getTabsProps(), onChange: onTabChange })
4692
4699
  };
4693
4700
  };
4694
4701
 
4695
4702
  // src/controls/transform-control/transform-content.tsx
4696
- var TransformContent = ({ bind }) => {
4697
- return /* @__PURE__ */ React75.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React75.createElement(Content5, null));
4698
- };
4699
- var Content5 = () => {
4703
+ var TransformContent = () => {
4700
4704
  const { getTabsProps, getTabProps, getTabPanelProps } = useTransformTabsHistory({
4701
4705
  move: initialTransformValue.value,
4702
4706
  scale: initialScaleValue.value,
4703
4707
  rotate: initialRotateValue.value,
4704
4708
  skew: initialSkewValue.value
4705
4709
  });
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(
4710
+ return /* @__PURE__ */ React75.createElement(PopoverContent, null, /* @__PURE__ */ React75.createElement(Box12, { sx: { width: "100%" } }, /* @__PURE__ */ React75.createElement(Box12, { sx: { borderBottom: 1, borderColor: "divider" } }, /* @__PURE__ */ React75.createElement(
4707
4711
  Tabs2,
4708
4712
  {
4709
4713
  size: "small",
@@ -4743,7 +4747,7 @@ var TransformIcon = ({ value }) => {
4743
4747
 
4744
4748
  // src/controls/transform-control/transform-label.tsx
4745
4749
  import * as React77 from "react";
4746
- import { Box as Box12 } from "@elementor/ui";
4750
+ import { Box as Box13 } from "@elementor/ui";
4747
4751
  import { __ as __37 } from "@wordpress/i18n";
4748
4752
  var transformMoveValue = (value) => Object.values(value).map((axis) => {
4749
4753
  const size = axis?.value?.size ?? defaultValues.move.size;
@@ -4777,30 +4781,36 @@ var TransformLabel = (props) => {
4777
4781
  }
4778
4782
  };
4779
4783
  var Label2 = ({ label, value }) => {
4780
- return /* @__PURE__ */ React77.createElement(Box12, { component: "span" }, label, ": ", value);
4784
+ return /* @__PURE__ */ React77.createElement(Box13, { component: "span" }, label, ": ", value);
4781
4785
  };
4782
4786
 
4783
4787
  // src/controls/transform-control/transform-repeater-control.tsx
4784
4788
  var TransformRepeaterControl = createControl(() => {
4785
- const { propType, value: transformValues, setValue, disabled } = useBoundProp(transformPropTypeUtil);
4789
+ const { propType, value: transformValues, setValue } = useBoundProp(transformPropTypeUtil);
4790
+ const availableValues = [initialTransformValue, initialScaleValue, initialRotateValue, initialSkewValue];
4791
+ const getInitialValue = () => {
4792
+ return availableValues.find((value) => !transformValues?.some((item) => item.$$type === value.$$type));
4793
+ };
4794
+ const shouldDisableAddItem = !getInitialValue();
4786
4795
  return /* @__PURE__ */ React78.createElement(PropProvider, { propType, value: transformValues, setValue }, /* @__PURE__ */ React78.createElement(
4787
- Repeater,
4796
+ UnstableRepeater,
4788
4797
  {
4789
- openOnAdd: true,
4790
- disabled,
4791
- values: transformValues ?? [],
4792
- setValues: setValue,
4793
- label: __38("Transform", "elementor"),
4794
- showDuplicate: false,
4795
- itemSettings: {
4796
- Icon: TransformIcon,
4797
- Label: TransformLabel,
4798
- Content: TransformContent,
4799
- initialValues: initialTransformValue
4798
+ initial: getInitialValue() ?? initialTransformValue,
4799
+ propTypeUtil: transformPropTypeUtil
4800
+ },
4801
+ /* @__PURE__ */ React78.createElement(Header, { label: __38("Transform", "elementor") }, /* @__PURE__ */ React78.createElement(
4802
+ TooltipAddItemAction,
4803
+ {
4804
+ disabled: shouldDisableAddItem,
4805
+ tooltipContent: ToolTip,
4806
+ enableTooltip: shouldDisableAddItem
4800
4807
  }
4801
- }
4808
+ )),
4809
+ /* @__PURE__ */ React78.createElement(ItemsContainer, { itemTemplate: /* @__PURE__ */ React78.createElement(Item, { Icon: TransformIcon, Label: TransformLabel }) }, /* @__PURE__ */ React78.createElement(DisableItemAction, null), /* @__PURE__ */ React78.createElement(RemoveItemAction, null)),
4810
+ /* @__PURE__ */ React78.createElement(EditItemPopover, null, /* @__PURE__ */ React78.createElement(TransformContent, null))
4802
4811
  ));
4803
4812
  });
4813
+ var ToolTip = /* @__PURE__ */ React78.createElement(React78.Fragment, null, /* @__PURE__ */ React78.createElement(InfoCircleFilledIcon2, { sx: { color: "secondary.main" } }), /* @__PURE__ */ React78.createElement(Typography6, { variant: "body2", color: "text.secondary", fontSize: "14px" }, __38("You can use each kind of transform only once per element.", "elementor")));
4804
4814
 
4805
4815
  // src/controls/transition-control/transition-repeater-control.tsx
4806
4816
  import * as React81 from "react";
@@ -4867,7 +4877,7 @@ import * as React80 from "react";
4867
4877
  import { useRef as useRef20 } from "react";
4868
4878
  import { keyValuePropTypeUtil as keyValuePropTypeUtil2 } from "@elementor/editor-props";
4869
4879
  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";
4880
+ import { bindPopover as bindPopover6, bindTrigger as bindTrigger5, Box as Box14, Popover as Popover6, UnstableTag as UnstableTag4, usePopupState as usePopupState7 } from "@elementor/ui";
4871
4881
  import { __ as __39 } from "@wordpress/i18n";
4872
4882
  var toTransitionSelectorValue = (label) => {
4873
4883
  for (const category of transitionProperties) {
@@ -4934,7 +4944,7 @@ var TransitionSelector = ({ recentlyUsedList }) => {
4934
4944
  left: rect.right + 36
4935
4945
  };
4936
4946
  };
4937
- return /* @__PURE__ */ React80.createElement(Box13, { ref: defaultRef }, /* @__PURE__ */ React80.createElement(
4947
+ return /* @__PURE__ */ React80.createElement(Box14, { ref: defaultRef }, /* @__PURE__ */ React80.createElement(
4938
4948
  UnstableTag4,
4939
4949
  {
4940
4950
  variant: "outlined",
@@ -5022,31 +5032,15 @@ var TransitionRepeaterControl = createControl((props) => {
5022
5032
  );
5023
5033
  });
5024
5034
 
5025
- // src/controls/unstable-transform-control/unstable-transform-repeater-control.tsx
5026
- import * as React82 from "react";
5027
- import { transformPropTypeUtil as transformPropTypeUtil2 } from "@elementor/editor-props";
5028
- import { __ as __41 } from "@wordpress/i18n";
5029
- var UnstableTransformRepeaterControl = createControl(() => {
5030
- const { propType, value: transformValues, setValue } = useBoundProp(transformPropTypeUtil2);
5031
- 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(
5032
- ItemsContainer,
5033
- {
5034
- itemTemplate: /* @__PURE__ */ React82.createElement(Item, { Icon: TransformIcon, Label: TransformLabel, Content: TransformContent })
5035
- },
5036
- /* @__PURE__ */ React82.createElement(DisableItemAction, null),
5037
- /* @__PURE__ */ React82.createElement(RemoveItemAction, null)
5038
- )));
5039
- });
5040
-
5041
5035
  // src/components/css-code-editor/css-editor.tsx
5042
- import * as React84 from "react";
5036
+ import * as React83 from "react";
5043
5037
  import { useActiveBreakpoint as useActiveBreakpoint2 } from "@elementor/editor-responsive";
5044
5038
  import { useTheme as useTheme2 } from "@elementor/ui";
5045
5039
  import { Editor } from "@monaco-editor/react";
5046
5040
 
5047
5041
  // src/components/css-code-editor/css-editor.styles.ts
5048
- import { Box as Box14, Button as Button5, styled as styled7 } from "@elementor/ui";
5049
- var EditorWrapper = styled7(Box14)`
5042
+ import { Box as Box15, Button as Button5, styled as styled7 } from "@elementor/ui";
5043
+ var EditorWrapper = styled7(Box15)`
5050
5044
  border: 1px solid var( --e-a-border-color );
5051
5045
  border-radius: 8px;
5052
5046
  padding: 10px 12px;
@@ -5090,25 +5084,25 @@ var ResizeHandle = styled7(Button5)`
5090
5084
  `;
5091
5085
 
5092
5086
  // src/components/css-code-editor/css-validation.ts
5093
- import { __ as __42 } from "@wordpress/i18n";
5087
+ import { __ as __41 } from "@wordpress/i18n";
5094
5088
  var forbiddenPatterns = [
5095
5089
  {
5096
5090
  pattern: ":hover",
5097
- message: __42(
5091
+ message: __41(
5098
5092
  "The use of pseudo-states is not permitted. Instead, switch to the desired pseudo state and add your custom code there.",
5099
5093
  "elementor"
5100
5094
  )
5101
5095
  },
5102
5096
  {
5103
5097
  pattern: ":active",
5104
- message: __42(
5098
+ message: __41(
5105
5099
  "The use of pseudo-states is not permitted. Instead, switch to the desired pseudo state and add your custom code there.",
5106
5100
  "elementor"
5107
5101
  )
5108
5102
  },
5109
5103
  {
5110
5104
  pattern: "@media",
5111
- message: __42(
5105
+ message: __41(
5112
5106
  "The use of @media is not permitted. Instead, switch to the desired breakpoint and add your custom code there.",
5113
5107
  "elementor"
5114
5108
  )
@@ -5147,9 +5141,9 @@ function validate(editor, monaco) {
5147
5141
  }
5148
5142
 
5149
5143
  // src/components/css-code-editor/resize-handle.tsx
5150
- import * as React83 from "react";
5144
+ import * as React82 from "react";
5151
5145
  var ResizeHandleComponent = ({ onResize, containerRef, onHeightChange }) => {
5152
- const handleResizeMove = React83.useCallback(
5146
+ const handleResizeMove = React82.useCallback(
5153
5147
  (e) => {
5154
5148
  const container = containerRef.current;
5155
5149
  if (!container) {
@@ -5162,11 +5156,11 @@ var ResizeHandleComponent = ({ onResize, containerRef, onHeightChange }) => {
5162
5156
  },
5163
5157
  [containerRef, onResize, onHeightChange]
5164
5158
  );
5165
- const handleResizeEnd = React83.useCallback(() => {
5159
+ const handleResizeEnd = React82.useCallback(() => {
5166
5160
  document.removeEventListener("mousemove", handleResizeMove);
5167
5161
  document.removeEventListener("mouseup", handleResizeEnd);
5168
5162
  }, [handleResizeMove]);
5169
- const handleResizeStart = React83.useCallback(
5163
+ const handleResizeStart = React82.useCallback(
5170
5164
  (e) => {
5171
5165
  e.preventDefault();
5172
5166
  e.stopPropagation();
@@ -5175,13 +5169,13 @@ var ResizeHandleComponent = ({ onResize, containerRef, onHeightChange }) => {
5175
5169
  },
5176
5170
  [handleResizeMove, handleResizeEnd]
5177
5171
  );
5178
- React83.useEffect(() => {
5172
+ React82.useEffect(() => {
5179
5173
  return () => {
5180
5174
  document.removeEventListener("mousemove", handleResizeMove);
5181
5175
  document.removeEventListener("mouseup", handleResizeEnd);
5182
5176
  };
5183
5177
  }, [handleResizeMove, handleResizeEnd]);
5184
- return /* @__PURE__ */ React83.createElement(
5178
+ return /* @__PURE__ */ React82.createElement(
5185
5179
  ResizeHandle,
5186
5180
  {
5187
5181
  onMouseDown: handleResizeStart,
@@ -5265,21 +5259,21 @@ var createEditorDidMountHandler = (editorRef, monacoRef, debounceTimer, onChange
5265
5259
  };
5266
5260
  var CssEditor = ({ value, onChange }) => {
5267
5261
  const theme = useTheme2();
5268
- const containerRef = React84.useRef(null);
5269
- const editorRef = React84.useRef(null);
5270
- const monacoRef = React84.useRef(null);
5271
- const debounceTimer = React84.useRef(null);
5262
+ const containerRef = React83.useRef(null);
5263
+ const editorRef = React83.useRef(null);
5264
+ const monacoRef = React83.useRef(null);
5265
+ const debounceTimer = React83.useRef(null);
5272
5266
  const activeBreakpoint = useActiveBreakpoint2();
5273
- const handleResize = React84.useCallback(() => {
5267
+ const handleResize = React83.useCallback(() => {
5274
5268
  editorRef.current?.layout();
5275
5269
  }, []);
5276
- const handleHeightChange = React84.useCallback((height) => {
5270
+ const handleHeightChange = React83.useCallback((height) => {
5277
5271
  if (containerRef.current) {
5278
5272
  containerRef.current.style.height = `${height}px`;
5279
5273
  }
5280
5274
  }, []);
5281
5275
  const handleEditorDidMount = createEditorDidMountHandler(editorRef, monacoRef, debounceTimer, onChange);
5282
- React84.useEffect(() => {
5276
+ React83.useEffect(() => {
5283
5277
  const timerRef = debounceTimer;
5284
5278
  return () => {
5285
5279
  const timer = timerRef.current;
@@ -5288,7 +5282,7 @@ var CssEditor = ({ value, onChange }) => {
5288
5282
  }
5289
5283
  };
5290
5284
  }, []);
5291
- return /* @__PURE__ */ React84.createElement(EditorWrapper, { ref: containerRef }, /* @__PURE__ */ React84.createElement(
5285
+ return /* @__PURE__ */ React83.createElement(EditorWrapper, { ref: containerRef }, /* @__PURE__ */ React83.createElement(
5292
5286
  Editor,
5293
5287
  {
5294
5288
  key: activeBreakpoint,
@@ -5309,7 +5303,7 @@ var CssEditor = ({ value, onChange }) => {
5309
5303
  fixedOverflowWidgets: true
5310
5304
  }
5311
5305
  }
5312
- ), /* @__PURE__ */ React84.createElement(
5306
+ ), /* @__PURE__ */ React83.createElement(
5313
5307
  ResizeHandleComponent,
5314
5308
  {
5315
5309
  onResize: handleResize,
@@ -5355,7 +5349,6 @@ export {
5355
5349
  ToggleControl,
5356
5350
  TransformRepeaterControl,
5357
5351
  TransitionRepeaterControl,
5358
- UnstableTransformRepeaterControl,
5359
5352
  UrlControl,
5360
5353
  createControlReplacementsRegistry,
5361
5354
  enqueueFont,