( options: CreateMainMenuContextOptions, )
| 50 | ] |
| 51 | |
| 52 | export function createMainMenuContext( |
| 53 | options: CreateMainMenuContextOptions, |
| 54 | ): MainMenuContext { |
| 55 | if (options.activeSpaceId === 'code') { |
| 56 | return { |
| 57 | file: { |
| 58 | primaryAction: 'new-snippet', |
| 59 | secondaryAction: 'new-folder', |
| 60 | canCreateFragment: true, |
| 61 | canCreateTask: false, |
| 62 | }, |
| 63 | view: { |
| 64 | layoutMode: options.code.layoutMode, |
| 65 | layoutModes: sharedLayoutModes, |
| 66 | contentSortField: options.contentSort.code.sort, |
| 67 | contentSortOrder: options.contentSort.code.order, |
| 68 | canToggleCompactMode: true, |
| 69 | canToggleMindmap: false, |
| 70 | isCompactMode: options.compactListMode, |
| 71 | isMindmapShown: false, |
| 72 | canTogglePresentation: false, |
| 73 | isPresentationShown: false, |
| 74 | }, |
| 75 | editor: { |
| 76 | kind: 'code', |
| 77 | noteMode: null, |
| 78 | canSendRequest: false, |
| 79 | canFormat: true, |
| 80 | canPreviewCode: options.code.canPreviewCode, |
| 81 | isCodePreviewShown: options.code.isCodePreviewShown, |
| 82 | canPreviewJson: options.code.canPreviewJson, |
| 83 | isJsonPreviewShown: options.code.isJsonPreviewShown, |
| 84 | canAdjustFontSize: true, |
| 85 | }, |
| 86 | } |
| 87 | } |
| 88 | |
| 89 | if (options.activeSpaceId === 'notes') { |
| 90 | return { |
| 91 | file: { |
| 92 | primaryAction: 'new-note', |
| 93 | secondaryAction: 'new-folder', |
| 94 | canCreateFragment: false, |
| 95 | canCreateTask: true, |
| 96 | }, |
| 97 | view: { |
| 98 | layoutMode: options.notes.layoutMode, |
| 99 | layoutModes: sharedLayoutModes, |
| 100 | contentSortField: options.contentSort.notes.sort, |
| 101 | contentSortOrder: options.contentSort.notes.order, |
| 102 | canToggleCompactMode: true, |
| 103 | canToggleMindmap: options.notes.hasSelectedNote, |
| 104 | isCompactMode: options.compactListMode, |
| 105 | isMindmapShown: options.notes.isMindmapShown, |
| 106 | canTogglePresentation: options.notes.hasSelectedNote, |
| 107 | isPresentationShown: options.notes.isPresentationShown, |
| 108 | }, |
| 109 | editor: { |
no outgoing calls
no test coverage detected