MCPcopy Index your code
hub / github.com/massCodeIO/massCode / createNotesEditorModeItems

Function createNotesEditorModeItems

src/main/menu/main.ts:496–526  ·  view source on GitHub ↗
(context: MainMenuContext)

Source from the content-addressed store, hash-verified

494}
495
496function createNotesEditorModeItems(context: MainMenuContext): MenuConfig[] {
497 if (context.editor.kind !== 'notes' || !context.editor.noteMode) {
498 return []
499 }
500
501 return [
502 {
503 label: i18n.t('menu:editor.mode'),
504 submenu: createPlatformMenuItems([
505 {
506 label: i18n.t('menu:editor.modeRaw'),
507 type: 'radio',
508 checked: context.editor.noteMode === 'raw',
509 click: () => send('main-menu:set-notes-editor-mode', 'raw'),
510 },
511 {
512 label: i18n.t('menu:editor.modeLivePreview'),
513 type: 'radio',
514 checked: context.editor.noteMode === 'livePreview',
515 click: () => send('main-menu:set-notes-editor-mode', 'livePreview'),
516 },
517 {
518 label: i18n.t('menu:editor.modePreview'),
519 type: 'radio',
520 checked: context.editor.noteMode === 'preview',
521 click: () => send('main-menu:set-notes-editor-mode', 'preview'),
522 },
523 ]),
524 },
525 ]
526}
527
528function createEditorMenuItems(context: MainMenuContext): MenuConfig[] {
529 const items: MenuConfig[] = []

Callers 1

createEditorMenuItemsFunction · 0.85

Calls 2

createPlatformMenuItemsFunction · 0.90
sendFunction · 0.90

Tested by

no test coverage detected