| 
									
										
										
										
											2025-08-28 00:23:00 +03:00
										 |  |  | import { NoteType } from "@triliumnext/commons"; | 
					
						
							| 
									
										
										
										
											2025-08-28 20:28:55 +03:00
										 |  |  | import FNote from "../entities/fnote"; | 
					
						
							| 
									
										
										
										
											2025-08-30 14:32:06 +03:00
										 |  |  | import { ViewTypeOptions } from "../widgets/collections/interface"; | 
					
						
							| 
									
										
										
										
											2025-08-28 00:23:00 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | export const byNoteType: Record<Exclude<NoteType, "book">, string | null> = { | 
					
						
							|  |  |  |     canvas: null, | 
					
						
							|  |  |  |     code: null, | 
					
						
							|  |  |  |     contentWidget: null, | 
					
						
							|  |  |  |     doc: null, | 
					
						
							|  |  |  |     file: null, | 
					
						
							|  |  |  |     image: null, | 
					
						
							|  |  |  |     launcher: null, | 
					
						
							|  |  |  |     mermaid: null, | 
					
						
							|  |  |  |     mindMap: null, | 
					
						
							|  |  |  |     noteMap: null, | 
					
						
							|  |  |  |     relationMap: null, | 
					
						
							|  |  |  |     render: null, | 
					
						
							|  |  |  |     search: null, | 
					
						
							|  |  |  |     text: null, | 
					
						
							|  |  |  |     webView: null, | 
					
						
							|  |  |  |     aiChat: null | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | export const byBookType: Record<ViewTypeOptions, string | null> = { | 
					
						
							|  |  |  |     list: "mULW0Q3VojwY", | 
					
						
							|  |  |  |     grid: "8QqnMzx393bx", | 
					
						
							|  |  |  |     calendar: "xWbu3jpNWapp", | 
					
						
							|  |  |  |     table: "2FvYrpmOXm29", | 
					
						
							|  |  |  |     geoMap: "81SGnPGMk7Xc", | 
					
						
							|  |  |  |     board: "CtBQqbwXDx1w" | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | export function getHelpUrlForNote(note: FNote | null | undefined) { | 
					
						
							|  |  |  |     if (note && note.type !== "book" && byNoteType[note.type]) { | 
					
						
							|  |  |  |         return byNoteType[note.type]; | 
					
						
							|  |  |  |     } else if (note?.hasLabel("calendarRoot")) { | 
					
						
							|  |  |  |         return "l0tKav7yLHGF"; | 
					
						
							|  |  |  |     } else if (note?.hasLabel("textSnippet")) { | 
					
						
							|  |  |  |         return "pwc194wlRzcH"; | 
					
						
							|  |  |  |     } else if (note && note.type === "book") { | 
					
						
							|  |  |  |         return byBookType[note.getAttributeValue("label", "viewType") as ViewTypeOptions ?? ""] | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | } |