UNPKG

@redocly/graphql-docs

Version:

Redocly GraphQL docs

2 lines (1 loc) 797 B
import{indexMenuGroupingConfig as u}from"./config/index.js";import{validateMenuConfig as g}from"./config/validate-menu-config.js";import{groupAndIndexSchema as m}from"./grouping/index.js";import{groupsToSidebarItems as a}from"./grouping/groups-to-sidebar-items.js";import{orderMenuGroups as d}from"./order-menu-groups.js";class x{groups;typeGroupIndex;sidebarItems;constructor(e,o){const{menu:r,baseUrlPath:i="/"}=o||{},n="item";g(e,r);const t=u(r),{groups:s,typeGroupIndex:p}=m(e,t);this.groups=d(s,t),this.sidebarItems=a(this.groups,n,i,e),this.typeGroupIndex=p}getGroups(){return this.groups}getGroupIdByTypeName(e){return this.typeGroupIndex.get(e)}getSidebarItems(){return[{type:"link",label:"Overview",link:"/",slug:"/",routeSlug:"/",items:[]},...this.sidebarItems]}}export{x as MenuStore};