1- import { createGuards , createMachine , type Scope , type Service } from "@zag-js/core"
1+ import { createGuards , createMachine , type Scope } from "@zag-js/core"
22import { trackDismissableElement } from "@zag-js/dismissable"
33import {
44 addDomEvent ,
@@ -16,7 +16,7 @@ import { getPlacement, getPlacementSide, type Placement } from "@zag-js/popper"
1616import { getElementPolygon , isPointInPolygon , type Point } from "@zag-js/rect-utils"
1717import { isEqual } from "@zag-js/utils"
1818import * as dom from "./menu.dom"
19- import type { MenuSchema , MenuService } from "./menu.types"
19+ import type { ChildMenuService , MenuSchema , ParentMenuService } from "./menu.types"
2020
2121const { not, and, or } = createGuards < MenuSchema > ( )
2222
@@ -838,7 +838,7 @@ export const machine = createMachine<MenuSchema>({
838838 } ,
839839} )
840840
841- function closeRootMenu ( ctx : { parent : Service < MenuSchema > | null } ) {
841+ function closeRootMenu ( ctx : { parent : ParentMenuService | null } ) {
842842 let parent = ctx . parent
843843 while ( parent && parent . context . get ( "isSubmenu" ) ) {
844844 parent = parent . refs . get ( "parent" )
@@ -851,7 +851,7 @@ function isWithinPolygon(polygon: Point[] | null, point: Point) {
851851 return isPointInPolygon ( polygon , point )
852852}
853853
854- function resolveItemId ( children : Record < string , MenuService > , value : string | null , scope : Scope ) {
854+ function resolveItemId ( children : Record < string , ChildMenuService > , value : string | null , scope : Scope ) {
855855 const hasChildren = Object . keys ( children ) . length > 0
856856 if ( ! value ) return null
857857 if ( ! hasChildren ) {
0 commit comments