@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.js CHANGED
@@ -7789,10 +7789,14 @@ var RepeaterItem = ({
7789
7789
  actions,
7790
7790
  value
7791
7791
  }) => {
7792
- const { popoverState, popoverProps, ref, setRef } = usePopover(openOnMount, () => {
7793
- onOpen();
7794
- onPopoverOpen?.(value);
7795
- });
7792
+ const { popoverState, popoverProps, ref, setRef } = usePopover(
7793
+ openOnMount,
7794
+ () => {
7795
+ onOpen();
7796
+ onPopoverOpen?.(value);
7797
+ },
7798
+ onPopoverClose
7799
+ );
7796
7800
  const triggerProps = (0, import_ui97.bindTrigger)(popoverState);
7797
7801
  const duplicateLabel = (0, import_i18n55.__)("Duplicate", "elementor");
7798
7802
  const toggleLabel = propDisabled ? (0, import_i18n55.__)("Show", "elementor") : (0, import_i18n55.__)("Hide", "elementor");
@@ -7814,21 +7818,17 @@ var RepeaterItem = ({
7814
7818
  startIcon,
7815
7819
  actions: /* @__PURE__ */ React113.createElement(React113.Fragment, null, showDuplicate && /* @__PURE__ */ React113.createElement(import_ui97.Tooltip, { title: duplicateLabel, placement: "top" }, /* @__PURE__ */ React113.createElement(import_ui97.IconButton, { size: SIZE11, onClick: duplicateItem, "aria-label": duplicateLabel }, /* @__PURE__ */ React113.createElement(import_icons39.CopyIcon, { fontSize: SIZE11 }))), showToggle && /* @__PURE__ */ React113.createElement(import_ui97.Tooltip, { title: toggleLabel, placement: "top" }, /* @__PURE__ */ React113.createElement(import_ui97.IconButton, { size: SIZE11, onClick: toggleDisableItem, "aria-label": toggleLabel }, propDisabled ? /* @__PURE__ */ React113.createElement(import_icons39.EyeOffIcon, { fontSize: SIZE11 }) : /* @__PURE__ */ React113.createElement(import_icons39.EyeIcon, { fontSize: SIZE11 }))), actions?.(value), showRemove && /* @__PURE__ */ React113.createElement(import_ui97.Tooltip, { title: removeLabel, placement: "top" }, /* @__PURE__ */ React113.createElement(import_ui97.IconButton, { size: SIZE11, onClick: removeItem, "aria-label": removeLabel }, /* @__PURE__ */ React113.createElement(import_icons39.XIcon, { fontSize: SIZE11 }))))
7816
7820
  }
7817
- ), /* @__PURE__ */ React113.createElement(
7818
- RepeaterPopover,
7821
+ ), /* @__PURE__ */ React113.createElement(RepeaterPopover, { width: ref?.getBoundingClientRect().width, ...popoverProps, anchorEl: ref }, /* @__PURE__ */ React113.createElement(
7822
+ import_ui97.ClickAwayListener,
7819
7823
  {
7820
- width: ref?.getBoundingClientRect().width,
7821
- ...popoverProps,
7822
- onClose: () => {
7823
- popoverProps.onClose?.();
7824
- onPopoverClose?.();
7825
- },
7826
- anchorEl: ref
7824
+ mouseEvent: "onMouseDown",
7825
+ touchEvent: "onTouchStart",
7826
+ onClickAway: popoverProps.onClose
7827
7827
  },
7828
7828
  /* @__PURE__ */ React113.createElement(import_ui97.Box, null, children({ anchorEl: ref }))
7829
- ));
7829
+ )));
7830
7830
  };
7831
- var usePopover = (openOnMount, onOpen) => {
7831
+ var usePopover = (openOnMount, onOpen, onPopoverClose) => {
7832
7832
  const [ref, setRef] = (0, import_react67.useState)(null);
7833
7833
  const popoverState = (0, import_ui97.usePopupState)({ variant: "popover" });
7834
7834
  const popoverProps = (0, import_ui97.bindPopover)(popoverState);
@@ -7838,11 +7838,15 @@ var usePopover = (openOnMount, onOpen) => {
7838
7838
  onOpen?.();
7839
7839
  }
7840
7840
  }, [ref]);
7841
+ const onClose = () => {
7842
+ popoverProps.onClose?.();
7843
+ onPopoverClose?.();
7844
+ };
7841
7845
  return {
7842
7846
  popoverState,
7843
7847
  ref,
7844
7848
  setRef,
7845
- popoverProps
7849
+ popoverProps: { ...popoverProps, onClose }
7846
7850
  };
7847
7851
  };
7848
7852