@elementor/editor-controls 4.1.0-731 → 4.1.0-733

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.d.mts CHANGED
@@ -580,6 +580,8 @@ type BaseItemSettings<T> = {
580
580
  }>;
581
581
  Content: RepeaterItemContent<T>;
582
582
  actions?: (value: T) => React$1.ReactNode;
583
+ onPopoverOpen?: (value: T) => void;
584
+ onPopoverClose?: () => void;
583
585
  };
584
586
  type SortableItemSettings<T> = BaseItemSettings<T> & {
585
587
  getId: ({ item, index }: {
package/dist/index.d.ts CHANGED
@@ -580,6 +580,8 @@ type BaseItemSettings<T> = {
580
580
  }>;
581
581
  Content: RepeaterItemContent<T>;
582
582
  actions?: (value: T) => React$1.ReactNode;
583
+ onPopoverOpen?: (value: T) => void;
584
+ onPopoverClose?: () => void;
583
585
  };
584
586
  type SortableItemSettings<T> = BaseItemSettings<T> & {
585
587
  getId: ({ item, index }: {
package/dist/index.js CHANGED
@@ -7675,6 +7675,8 @@ var Repeater3 = ({
7675
7675
  toggleDisableItem: () => toggleDisableRepeaterItem(index),
7676
7676
  openOnMount: openOnAdd && openItem === index,
7677
7677
  onOpen: () => setOpenItem(EMPTY_OPEN_ITEM2),
7678
+ onPopoverOpen: itemSettings.onPopoverOpen,
7679
+ onPopoverClose: itemSettings.onPopoverClose,
7678
7680
  showDuplicate,
7679
7681
  showToggle,
7680
7682
  showRemove,
@@ -7703,6 +7705,8 @@ var RepeaterItem = ({
7703
7705
  toggleDisableItem,
7704
7706
  openOnMount,
7705
7707
  onOpen,
7708
+ onPopoverOpen,
7709
+ onPopoverClose,
7706
7710
  showDuplicate,
7707
7711
  showToggle,
7708
7712
  showRemove,
@@ -7710,7 +7714,11 @@ var RepeaterItem = ({
7710
7714
  actions,
7711
7715
  value
7712
7716
  }) => {
7713
- const { popoverState, popoverProps, ref, setRef } = usePopover(openOnMount, onOpen);
7717
+ const { popoverState, popoverProps, ref, setRef } = usePopover(openOnMount, () => {
7718
+ onOpen();
7719
+ onPopoverOpen?.(value);
7720
+ });
7721
+ const triggerProps = (0, import_ui97.bindTrigger)(popoverState);
7714
7722
  const duplicateLabel = (0, import_i18n55.__)("Duplicate", "elementor");
7715
7723
  const toggleLabel = propDisabled ? (0, import_i18n55.__)("Show", "elementor") : (0, import_i18n55.__)("Hide", "elementor");
7716
7724
  const removeLabel = (0, import_i18n55.__)("Remove", "elementor");
@@ -7721,11 +7729,29 @@ var RepeaterItem = ({
7721
7729
  label,
7722
7730
  ref: setRef,
7723
7731
  "aria-label": (0, import_i18n55.__)("Open item", "elementor"),
7724
- ...(0, import_ui97.bindTrigger)(popoverState),
7732
+ ...triggerProps,
7733
+ onClick: (e) => {
7734
+ triggerProps.onClick(e);
7735
+ if (!popoverState.isOpen) {
7736
+ onPopoverOpen?.(value);
7737
+ }
7738
+ },
7725
7739
  startIcon,
7726
7740
  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 }))))
7727
7741
  }
7728
- ), /* @__PURE__ */ React113.createElement(RepeaterPopover, { width: ref?.getBoundingClientRect().width, ...popoverProps, anchorEl: ref }, /* @__PURE__ */ React113.createElement(import_ui97.Box, null, children({ anchorEl: ref }))));
7742
+ ), /* @__PURE__ */ React113.createElement(
7743
+ RepeaterPopover,
7744
+ {
7745
+ width: ref?.getBoundingClientRect().width,
7746
+ ...popoverProps,
7747
+ onClose: () => {
7748
+ popoverProps.onClose?.();
7749
+ onPopoverClose?.();
7750
+ },
7751
+ anchorEl: ref
7752
+ },
7753
+ /* @__PURE__ */ React113.createElement(import_ui97.Box, null, children({ anchorEl: ref }))
7754
+ ));
7729
7755
  };
7730
7756
  var usePopover = (openOnMount, onOpen) => {
7731
7757
  const [ref, setRef] = (0, import_react62.useState)(null);