/** Payload of the floating tree's `itemhover` event. */

/**
 * Returns an `onMouseMove` handler that announces an item hover on the
 * floating tree, so an open submenu of the same menu can close when a
 * different item is hovered (see `<Menu.Positioner>`). Mirrors React's
 * `useMenuItemCommonProps` `onMouseMove`.
 *
 * `nodeId` is the floating node of the menu the item renders in, which is what
 * a child submenu sees as its `floatingParentNodeId`.
 */
export function createItemHoverEmitter(menu, nodeId) {
  return event => {
    if (!nodeId) return;
    const payload = {
      nodeId,
      target: event.currentTarget
    };
    menu.floatingTreeRoot()?.events.emit("itemhover", payload);
  };
}
//# sourceMappingURL=item-hover.jsx.map
