build: update some build dependencies (#44069)
* build: update some build dependencies (#43882) * build: update some build dependencies * build: fix eslint issues after updating * build: disable ts check on busted js example * build: update internal types for stricter event handling * restore url.parse behavior * fix typing issues * sigh * build: update easy deps * build: skip woa engines check * build: s/colors/chalk
This commit is contained in:
parent
ac10ddaa48
commit
8af5c6d130
49 changed files with 2311 additions and 1338 deletions
|
@ -7,23 +7,29 @@ import { IPC_MESSAGES } from '@electron/internal//common/ipc-messages';
|
|||
|
||||
const convertToMenuTemplate = function (items: ContextMenuItem[], handler: (id: number) => void) {
|
||||
return items.map(function (item) {
|
||||
const transformed: Electron.MenuItemConstructorOptions = item.type === 'subMenu' ? {
|
||||
type: 'submenu',
|
||||
label: item.label,
|
||||
enabled: item.enabled,
|
||||
submenu: convertToMenuTemplate(item.subItems, handler)
|
||||
} : item.type === 'separator' ? {
|
||||
type: 'separator'
|
||||
} : item.type === 'checkbox' ? {
|
||||
type: 'checkbox',
|
||||
label: item.label,
|
||||
enabled: item.enabled,
|
||||
checked: item.checked
|
||||
} : {
|
||||
type: 'normal',
|
||||
label: item.label,
|
||||
enabled: item.enabled
|
||||
};
|
||||
const transformed: Electron.MenuItemConstructorOptions = item.type === 'subMenu'
|
||||
? {
|
||||
type: 'submenu',
|
||||
label: item.label,
|
||||
enabled: item.enabled,
|
||||
submenu: convertToMenuTemplate(item.subItems, handler)
|
||||
}
|
||||
: item.type === 'separator'
|
||||
? {
|
||||
type: 'separator'
|
||||
}
|
||||
: item.type === 'checkbox'
|
||||
? {
|
||||
type: 'checkbox',
|
||||
label: item.label,
|
||||
enabled: item.enabled,
|
||||
checked: item.checked
|
||||
}
|
||||
: {
|
||||
type: 'normal',
|
||||
label: item.label,
|
||||
enabled: item.enabled
|
||||
};
|
||||
|
||||
if (item.id != null) {
|
||||
transformed.click = () => handler(item.id);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue