@@ -26,7 +26,7 @@ const tagsToGroup = {
2626 "@connectWallet" : "Connect Wallet" ,
2727 "@appURI" : "App URI" ,
2828 "@storage" : "Storage" ,
29- "@others" : "Others " ,
29+ "@others" : "Miscellaneous " ,
3030 "@wallet" : "Wallets" ,
3131 "@walletConfig" : "WalletConfig" ,
3232 "@theme" : "Theme" ,
@@ -40,20 +40,25 @@ const tagsToGroup = {
4040 "@chain" : "Chain" ,
4141 "@social" : "Social API" ,
4242 "@modules" : "Modules" ,
43+ "@client" : "Client" ,
4344} as const ;
4445
4546type TagKey = keyof typeof tagsToGroup ;
4647
4748const sidebarGroupOrder : TagKey [ ] = [
49+ "@client" ,
4850 "@wallet" ,
4951 "@abstractWallet" ,
5052 "@locale" ,
51- "@chain" ,
52- "@contract" ,
5353 "@networkConnection" ,
5454 "@walletConfig" ,
5555 "@walletConnection" ,
5656 "@walletUtils" ,
57+ "@chain" ,
58+ "@contract" ,
59+ "@transaction" ,
60+ "@social" ,
61+ "@auth" ,
5762 "@nft" ,
5863 "@buyCrypto" ,
5964 "@nftDrop" ,
@@ -64,18 +69,15 @@ const sidebarGroupOrder: TagKey[] = [
6469 "@metadata" ,
6570 "@permissionControl" ,
6671 "@platformFees" ,
67- "@auth" ,
6872 "@storage" ,
6973 "@smartWallet" ,
7074 "@connectWallet" ,
7175 "@appURI" ,
7276 "@extension" ,
73- "@transaction" ,
7477 "@rpc" ,
75- "@utils" ,
76- "@social" ,
7778 "@modules" ,
7879 "@theme" ,
80+ "@utils" ,
7981 "@others" ,
8082] ;
8183
@@ -191,6 +193,7 @@ export function getSidebarLinkGroups(doc: TransformedDoc, path: string) {
191193 name : name ,
192194 href : getLink ( `${ path } /${ key } ` ) ,
193195 links : [ { name : "Extensions" , links : extensionLinkGroups } ] ,
196+ isCollapsible : false ,
194197 } ) ;
195198 } else {
196199 linkGroups
@@ -245,7 +248,12 @@ export function getSidebarLinkGroups(doc: TransformedDoc, path: string) {
245248
246249 // sort into groups
247250 for ( const d of nonExtensions ) {
248- const [ tag ] = getCustomTag ( d ) || [ ] ;
251+ let [ tag ] = getCustomTag ( d ) || [ ] ;
252+ // for ungrouped functions - put it in utils
253+ // useful for re-exports that we can't tag
254+ if ( ! tag ) {
255+ tag = "@others" ;
256+ }
249257
250258 if ( tag ) {
251259 if ( ! groups [ tag ] ) {
@@ -257,16 +265,6 @@ export function getSidebarLinkGroups(doc: TransformedDoc, path: string) {
257265 }
258266 }
259267
260- // If a group only has one item, do not create a group for it and add it to noGroups
261- for ( const _tag in groups ) {
262- const tag = _tag as TagKey ;
263- const links = groups [ tag ] ;
264- if ( links && links . length === 1 && links [ 0 ] ) {
265- ungroupedLinks . push ( links [ 0 ] ) ;
266- delete groups [ tag ] ;
267- }
268- }
269-
270268 // throw error if we don't know where to put the group in sidebar ( because this leads to it not being added in sidebar at all )
271269 for ( const tag of Object . keys ( groups ) ) {
272270 if ( ! sidebarGroupOrder . includes ( tag as TagKey ) ) {
@@ -314,6 +312,7 @@ export function getSidebarLinkGroups(doc: TransformedDoc, path: string) {
314312 name : name ,
315313 links : links ,
316314 href : getLink ( `${ path } /${ key } ` ) ,
315+ isCollapsible : false ,
317316 } ) ;
318317 }
319318 }
@@ -326,26 +325,10 @@ export function getSidebarLinkGroups(doc: TransformedDoc, path: string) {
326325 createSubGroups ( "hooks" , doc . hooks ) ;
327326 }
328327
329- if ( doc . classes ) {
330- createSubGroups ( "classes" , doc . classes ) ;
331- }
332-
333328 if ( doc . functions ) {
334329 createSubGroups ( "functions" , doc . functions ) ;
335330 }
336331
337- if ( doc . variables ) {
338- createSubGroups ( "variables" , doc . variables ) ;
339- }
340-
341- if ( doc . types ) {
342- createSubGroups ( "types" , doc . types ) ;
343- }
344-
345- if ( doc . enums ) {
346- createSubGroups ( "enums" , doc . enums ) ;
347- }
348-
349332 return linkGroups ;
350333}
351334
0 commit comments