@elementor/editor-controls 4.1.0-759 → 4.1.0-760

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -7613,6 +7613,7 @@ import {
7613
7613
  bindPopover as bindPopover8,
7614
7614
  bindTrigger as bindTrigger7,
7615
7615
  Box as Box27,
7616
+ ClickAwayListener,
7616
7617
  IconButton as IconButton10,
7617
7618
  Infotip as Infotip4,
7618
7619
  Tooltip as Tooltip12,
@@ -7778,10 +7779,14 @@ var RepeaterItem = ({
7778
7779
  actions,
7779
7780
  value
7780
7781
  }) => {
7781
- const { popoverState, popoverProps, ref, setRef } = usePopover(openOnMount, () => {
7782
- onOpen();
7783
- onPopoverOpen?.(value);
7784
- });
7782
+ const { popoverState, popoverProps, ref, setRef } = usePopover(
7783
+ openOnMount,
7784
+ () => {
7785
+ onOpen();
7786
+ onPopoverOpen?.(value);
7787
+ },
7788
+ onPopoverClose
7789
+ );
7785
7790
  const triggerProps = bindTrigger7(popoverState);
7786
7791
  const duplicateLabel = __55("Duplicate", "elementor");
7787
7792
  const toggleLabel = propDisabled ? __55("Show", "elementor") : __55("Hide", "elementor");
@@ -7803,21 +7808,17 @@ var RepeaterItem = ({
7803
7808
  startIcon,
7804
7809
  actions: /* @__PURE__ */ React113.createElement(React113.Fragment, null, showDuplicate && /* @__PURE__ */ React113.createElement(Tooltip12, { title: duplicateLabel, placement: "top" }, /* @__PURE__ */ React113.createElement(IconButton10, { size: SIZE11, onClick: duplicateItem, "aria-label": duplicateLabel }, /* @__PURE__ */ React113.createElement(CopyIcon2, { fontSize: SIZE11 }))), showToggle && /* @__PURE__ */ React113.createElement(Tooltip12, { title: toggleLabel, placement: "top" }, /* @__PURE__ */ React113.createElement(IconButton10, { size: SIZE11, onClick: toggleDisableItem, "aria-label": toggleLabel }, propDisabled ? /* @__PURE__ */ React113.createElement(EyeOffIcon2, { fontSize: SIZE11 }) : /* @__PURE__ */ React113.createElement(EyeIcon2, { fontSize: SIZE11 }))), actions?.(value), showRemove && /* @__PURE__ */ React113.createElement(Tooltip12, { title: removeLabel, placement: "top" }, /* @__PURE__ */ React113.createElement(IconButton10, { size: SIZE11, onClick: removeItem, "aria-label": removeLabel }, /* @__PURE__ */ React113.createElement(XIcon4, { fontSize: SIZE11 }))))
7805
7810
  }
7806
- ), /* @__PURE__ */ React113.createElement(
7807
- RepeaterPopover,
7811
+ ), /* @__PURE__ */ React113.createElement(RepeaterPopover, { width: ref?.getBoundingClientRect().width, ...popoverProps, anchorEl: ref }, /* @__PURE__ */ React113.createElement(
7812
+ ClickAwayListener,
7808
7813
  {
7809
- width: ref?.getBoundingClientRect().width,
7810
- ...popoverProps,
7811
- onClose: () => {
7812
- popoverProps.onClose?.();
7813
- onPopoverClose?.();
7814
- },
7815
- anchorEl: ref
7814
+ mouseEvent: "onMouseDown",
7815
+ touchEvent: "onTouchStart",
7816
+ onClickAway: popoverProps.onClose
7816
7817
  },
7817
7818
  /* @__PURE__ */ React113.createElement(Box27, null, children({ anchorEl: ref }))
7818
- ));
7819
+ )));
7819
7820
  };
7820
- var usePopover = (openOnMount, onOpen) => {
7821
+ var usePopover = (openOnMount, onOpen, onPopoverClose) => {
7821
7822
  const [ref, setRef] = useState19(null);
7822
7823
  const popoverState = usePopupState10({ variant: "popover" });
7823
7824
  const popoverProps = bindPopover8(popoverState);
@@ -7827,11 +7828,15 @@ var usePopover = (openOnMount, onOpen) => {
7827
7828
  onOpen?.();
7828
7829
  }
7829
7830
  }, [ref]);
7831
+ const onClose = () => {
7832
+ popoverProps.onClose?.();
7833
+ onPopoverClose?.();
7834
+ };
7830
7835
  return {
7831
7836
  popoverState,
7832
7837
  ref,
7833
7838
  setRef,
7834
- popoverProps
7839
+ popoverProps: { ...popoverProps, onClose }
7835
7840
  };
7836
7841
  };
7837
7842