(context: MainMenuContext)
| 300 | } |
| 301 | |
| 302 | function createFileMenuItems(context: MainMenuContext): MenuConfig[] { |
| 303 | const items: MenuConfig[] = [] |
| 304 | |
| 305 | if (context.file.primaryAction) { |
| 306 | items.push({ |
| 307 | label: getPrimaryActionLabel(context.file.primaryAction), |
| 308 | accelerator: 'CommandOrControl+N', |
| 309 | click: createPrimaryActionClick(context.file.primaryAction), |
| 310 | }) |
| 311 | } |
| 312 | |
| 313 | if (context.file.canCreateFragment) { |
| 314 | items.push({ |
| 315 | label: i18n.t('action.new.fragment'), |
| 316 | accelerator: 'CommandOrControl+T', |
| 317 | click: () => send('main-menu:new-fragment'), |
| 318 | }) |
| 319 | } |
| 320 | |
| 321 | if (context.file.canCreateTask) { |
| 322 | items.push({ |
| 323 | label: i18n.t('action.new.task'), |
| 324 | accelerator: 'CommandOrControl+T', |
| 325 | click: () => send('main-menu:new-task'), |
| 326 | }) |
| 327 | } |
| 328 | |
| 329 | if (context.file.secondaryAction) { |
| 330 | items.push({ |
| 331 | label: i18n.t('action.new.folder'), |
| 332 | accelerator: 'CommandOrControl+Shift+N', |
| 333 | click: () => |
| 334 | send( |
| 335 | context.file.primaryAction === 'new-note' |
| 336 | ? 'main-menu:new-note-folder' |
| 337 | : 'main-menu:new-folder', |
| 338 | ), |
| 339 | }) |
| 340 | } |
| 341 | |
| 342 | return items |
| 343 | } |
| 344 | |
| 345 | function getSidebarLayoutAccelerator( |
| 346 | targetLayout: MainMenuLayoutMode, |
no test coverage detected