@opensumi/ide-core-browser 2.21.8-rc-1670567192.0 → 2.21.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/components/actions/index.d.ts.map +1 -1
- package/lib/components/actions/index.js +22 -2
- package/lib/components/actions/index.js.map +1 -1
- package/lib/components/tree/tree.module.less +0 -1
- package/lib/contextkey/testing.d.ts +0 -1
- package/lib/contextkey/testing.d.ts.map +1 -1
- package/lib/contextkey/testing.js +1 -2
- package/lib/contextkey/testing.js.map +1 -1
- package/lib/menu/next/menu.contrib.interface.d.ts +2 -3
- package/lib/menu/next/menu.contrib.interface.d.ts.map +1 -1
- package/lib/menu/next/menu.contrib.interface.js.map +1 -1
- package/lib/preferences/preference-configurations.js +1 -1
- package/lib/preferences/preference-configurations.js.map +1 -1
- package/lib/react-providers/config-provider.d.ts +0 -4
- package/lib/react-providers/config-provider.d.ts.map +1 -1
- package/lib/react-providers/config-provider.js.map +1 -1
- package/lib/services/storage-service.d.ts.map +1 -1
- package/lib/services/storage-service.js +1 -7
- package/lib/services/storage-service.js.map +1 -1
- package/lib/utils/label.d.ts.map +1 -1
- package/lib/utils/label.js +9 -16
- package/lib/utils/label.js.map +1 -1
- package/package.json +6 -7
- package/src/application/application-state-service.ts +0 -54
- package/src/application/application.service.ts +0 -51
- package/src/application/index.ts +0 -2
- package/src/authentication/authentication.contribution.ts +0 -35
- package/src/authentication/authentication.service.ts +0 -517
- package/src/bootstrap/app.ts +0 -745
- package/src/bootstrap/app.view.tsx +0 -88
- package/src/bootstrap/connection.ts +0 -116
- package/src/bootstrap/index.ts +0 -3
- package/src/bootstrap/inner-providers.ts +0 -297
- package/src/bootstrap/lifecycle.service.ts +0 -19
- package/src/browser-module.ts +0 -24
- package/src/common/common.command.ts +0 -977
- package/src/common/common.contribution.ts +0 -343
- package/src/common/common.define.ts +0 -55
- package/src/common/common.module.ts +0 -33
- package/src/common/common.storage.ts +0 -22
- package/src/common/container-id.ts +0 -12
- package/src/common/index.ts +0 -4
- package/src/components/actions/index.tsx +0 -486
- package/src/components/actions/placements.ts +0 -47
- package/src/components/actions/styles.module.less +0 -144
- package/src/components/badge/index.tsx +0 -1
- package/src/components/index.ts +0 -26
- package/src/components/layout/box-panel.tsx +0 -88
- package/src/components/layout/default-layout.tsx +0 -61
- package/src/components/layout/index.ts +0 -4
- package/src/components/layout/layout.ts +0 -80
- package/src/components/layout/split-panel.service.ts +0 -56
- package/src/components/layout/split-panel.tsx +0 -296
- package/src/components/layout/styles.module.less +0 -21
- package/src/components/loading/index.ts +0 -1
- package/src/components/loading/loading.less +0 -14
- package/src/components/loading/loading.view.tsx +0 -7
- package/src/components/loading/media/loading-dark.svg +0 -52
- package/src/components/loading/media/loading-hc.svg +0 -52
- package/src/components/loading/media/loading.svg +0 -52
- package/src/components/popover/styles.module.less +0 -81
- package/src/components/portal/index.tsx +0 -13
- package/src/components/progressbar/index.tsx +0 -16
- package/src/components/progressbar/styles.module.less +0 -31
- package/src/components/recycle-tree/index.ts +0 -1
- package/src/components/recycle-tree/recycle-tree.view.tsx +0 -368
- package/src/components/resize/resize.module.less +0 -78
- package/src/components/resize/resize.tsx +0 -663
- package/src/components/scroll/index.tsx +0 -386
- package/src/components/scroll/scroll.module.less +0 -108
- package/src/components/scrollbar/index.ts +0 -1
- package/src/components/scrollbar/scrollbar.less +0 -36
- package/src/components/scrollbar/scrollbar.view.ts +0 -8
- package/src/components/select/index.tsx +0 -12
- package/src/components/select/styles.less +0 -6
- package/src/components/tree/index.ts +0 -3
- package/src/components/tree/tree-node.view.tsx +0 -546
- package/src/components/tree/tree.module.less +0 -297
- package/src/components/tree/tree.view.tsx +0 -486
- package/src/context-key.ts +0 -48
- package/src/contextkey/dialog.ts +0 -3
- package/src/contextkey/explorer.ts +0 -26
- package/src/contextkey/index.ts +0 -6
- package/src/contextkey/outline.ts +0 -4
- package/src/contextkey/resource.ts +0 -61
- package/src/contextkey/terminal.ts +0 -7
- package/src/contextkey/testing.ts +0 -9
- package/src/contextkey/workspace.ts +0 -7
- package/src/core-preferences.ts +0 -318
- package/src/dom/index.ts +0 -176
- package/src/encoding-registry.ts +0 -83
- package/src/extensions/extensions-point.service.ts +0 -78
- package/src/extensions/index.ts +0 -3
- package/src/extensions/schema/browserViews.ts +0 -96
- package/src/extensions/schema/menu.ts +0 -245
- package/src/extensions/schema/opensumiExtensionPackageSchema.ts +0 -12
- package/src/extensions/schema/toolbar.ts +0 -338
- package/src/extensions/schema/vscodeExtensionPackageSchema.ts +0 -330
- package/src/fs/index.ts +0 -12
- package/src/hash-calculate/hash-calculate.contribution.ts +0 -19
- package/src/index.ts +0 -42
- package/src/keybinding/index.ts +0 -1
- package/src/keybinding/keybinding.ts +0 -908
- package/src/keyboard/index.ts +0 -3
- package/src/keyboard/keyboard-layout-provider.ts +0 -412
- package/src/keyboard/keyboard-layout-service.ts +0 -449
- package/src/keyboard/keys.ts +0 -748
- package/src/keyboard/layouts/_.contribution.ts +0 -24
- package/src/keyboard/layouts/cz.win.ts +0 -168
- package/src/keyboard/layouts/de-swiss.win.ts +0 -168
- package/src/keyboard/layouts/de.darwin.ts +0 -131
- package/src/keyboard/layouts/de.linux.ts +0 -186
- package/src/keyboard/layouts/de.win.ts +0 -168
- package/src/keyboard/layouts/dk.win.ts +0 -168
- package/src/keyboard/layouts/dvorak.darwin.ts +0 -131
- package/src/keyboard/layouts/en-belgian.win.ts +0 -168
- package/src/keyboard/layouts/en-ext.darwin.ts +0 -131
- package/src/keyboard/layouts/en-in.win.ts +0 -168
- package/src/keyboard/layouts/en-intl.darwin.ts +0 -131
- package/src/keyboard/layouts/en-intl.win.ts +0 -168
- package/src/keyboard/layouts/en-uk.darwin.ts +0 -131
- package/src/keyboard/layouts/en-uk.win.ts +0 -168
- package/src/keyboard/layouts/en.darwin.ts +0 -139
- package/src/keyboard/layouts/en.linux.ts +0 -186
- package/src/keyboard/layouts/en.win.ts +0 -173
- package/src/keyboard/layouts/es-latin.win.ts +0 -168
- package/src/keyboard/layouts/es.darwin.ts +0 -131
- package/src/keyboard/layouts/es.linux.ts +0 -186
- package/src/keyboard/layouts/es.win.ts +0 -168
- package/src/keyboard/layouts/fr.darwin.ts +0 -131
- package/src/keyboard/layouts/fr.linux.ts +0 -186
- package/src/keyboard/layouts/fr.win.ts +0 -168
- package/src/keyboard/layouts/hu.win.ts +0 -168
- package/src/keyboard/layouts/it.darwin.ts +0 -131
- package/src/keyboard/layouts/it.win.ts +0 -168
- package/src/keyboard/layouts/jp-roman.darwin.ts +0 -131
- package/src/keyboard/layouts/jp.darwin.ts +0 -131
- package/src/keyboard/layouts/ko.darwin.ts +0 -131
- package/src/keyboard/layouts/layout.contribution.darwin.ts +0 -23
- package/src/keyboard/layouts/layout.contribution.linux.ts +0 -12
- package/src/keyboard/layouts/layout.contribution.ts +0 -9
- package/src/keyboard/layouts/layout.contribution.win.ts +0 -29
- package/src/keyboard/layouts/no.win.ts +0 -168
- package/src/keyboard/layouts/pl.darwin.ts +0 -131
- package/src/keyboard/layouts/pl.win.ts +0 -168
- package/src/keyboard/layouts/pt-br.win.ts +0 -169
- package/src/keyboard/layouts/pt.darwin.ts +0 -131
- package/src/keyboard/layouts/pt.win.ts +0 -168
- package/src/keyboard/layouts/ru.darwin.ts +0 -131
- package/src/keyboard/layouts/ru.linux.ts +0 -186
- package/src/keyboard/layouts/ru.win.ts +0 -168
- package/src/keyboard/layouts/sv.darwin.ts +0 -131
- package/src/keyboard/layouts/sv.win.ts +0 -168
- package/src/keyboard/layouts/thai.win.ts +0 -168
- package/src/keyboard/layouts/tr.win.ts +0 -168
- package/src/keyboard/layouts/zh-hans.darwin.ts +0 -131
- package/src/layout/accordion/tab-bar-toolbar.tsx +0 -59
- package/src/layout/accordion/view-context-key.registry.ts +0 -34
- package/src/layout/constants.ts +0 -7
- package/src/layout/index.ts +0 -5
- package/src/layout/layout-hooks.ts +0 -68
- package/src/layout/layout-state.ts +0 -107
- package/src/layout/layout.interface.ts +0 -101
- package/src/layout/layout.ts +0 -80
- package/src/layout/view-id.ts +0 -18
- package/src/logger/browser-logger.ts +0 -51
- package/src/logger/index.ts +0 -1
- package/src/markdown/index.tsx +0 -62
- package/src/menu/next/base.ts +0 -513
- package/src/menu/next/ctxmenu-service.ts +0 -188
- package/src/menu/next/index.ts +0 -10
- package/src/menu/next/menu-id.ts +0 -86
- package/src/menu/next/menu-service.ts +0 -252
- package/src/menu/next/menu-util.ts +0 -77
- package/src/menu/next/menu.contrib.interface.ts +0 -79
- package/src/menu/next/menu.interface.ts +0 -253
- package/src/menu/next/menubar-service.ts +0 -211
- package/src/menu/next/renderer/ctxmenu/base.ts +0 -18
- package/src/menu/next/renderer/ctxmenu/browser.ts +0 -45
- package/src/menu/next/renderer/ctxmenu/electron.ts +0 -207
- package/src/menu/next/toolbar-action.service.ts +0 -132
- package/src/monaco/index.ts +0 -128
- package/src/opener/command-opener.ts +0 -42
- package/src/opener/default-opener.ts +0 -31
- package/src/opener/http-opener.ts +0 -25
- package/src/opener/index.ts +0 -19
- package/src/opener/opener.contribution.ts +0 -57
- package/src/opener/opener.service.ts +0 -66
- package/src/preferences/early-preferences.ts +0 -117
- package/src/preferences/index.ts +0 -9
- package/src/preferences/preference-configurations.ts +0 -77
- package/src/preferences/preference-contribution.ts +0 -401
- package/src/preferences/preference-provider.ts +0 -414
- package/src/preferences/preference-proxy.ts +0 -292
- package/src/preferences/preference-scope.ts +0 -3
- package/src/preferences/preference-service.ts +0 -571
- package/src/preferences/settings.ts +0 -53
- package/src/preferences/types.ts +0 -111
- package/src/progress/index.ts +0 -58
- package/src/progress/progress-bar.tsx +0 -22
- package/src/progress/progress-indicator.ts +0 -90
- package/src/progress/progress.module.less +0 -46
- package/src/progress/progress.service.tsx +0 -429
- package/src/quick-open/index.ts +0 -655
- package/src/quick-open/recent-files.ts +0 -68
- package/src/raw-context-key.ts +0 -116
- package/src/react-hooks/event.tsx +0 -80
- package/src/react-hooks/hot-key.tsx +0 -58
- package/src/react-hooks/index.ts +0 -3
- package/src/react-hooks/injectable-hooks.tsx +0 -35
- package/src/react-hooks/portal-hooks.tsx +0 -38
- package/src/react-providers/config-provider.tsx +0 -263
- package/src/react-providers/index.tsx +0 -2
- package/src/react-providers/slot.module.less +0 -19
- package/src/react-providers/slot.tsx +0 -242
- package/src/services/clipboard.service.ts +0 -97
- package/src/services/credentials-service.ts +0 -91
- package/src/services/crypto-service.ts +0 -23
- package/src/services/external-uri.service.ts +0 -68
- package/src/services/index.ts +0 -7
- package/src/services/label-service.ts +0 -386
- package/src/services/status-bar-service.ts +0 -108
- package/src/services/storage-service.ts +0 -197
- package/src/style/codicons/README.md +0 -22
- package/src/style/codicons/codicon-animations.css +0 -15
- package/src/style/codicons/generator.js +0 -15
- package/src/style/entry.less +0 -25
- package/src/style/icon/fileicons/file-default.svg +0 -1
- package/src/style/icon/fileicons/folder-default.svg +0 -1
- package/src/style/icon/fileicons.less +0 -20
- package/src/style/icon/icon.ts +0 -543
- package/src/style/icon/ide-iconfont.ts +0 -13
- package/src/style/icon/index.less +0 -54
- package/src/style/icon/seti.woff +0 -0
- package/src/style/icon/symbol-icons/boolean-dark.svg +0 -3
- package/src/style/icon/symbol-icons/boolean-light.svg +0 -3
- package/src/style/icon/symbol-icons/class-dark.svg +0 -3
- package/src/style/icon/symbol-icons/class-light.svg +0 -3
- package/src/style/icon/symbol-icons/constant-dark.svg +0 -4
- package/src/style/icon/symbol-icons/constant-light.svg +0 -4
- package/src/style/icon/symbol-icons/enumerator-dark.svg +0 -3
- package/src/style/icon/symbol-icons/enumerator-item-dark.svg +0 -3
- package/src/style/icon/symbol-icons/enumerator-item-light.svg +0 -3
- package/src/style/icon/symbol-icons/enumerator-light.svg +0 -3
- package/src/style/icon/symbol-icons/event-dark.svg +0 -3
- package/src/style/icon/symbol-icons/event-light.svg +0 -3
- package/src/style/icon/symbol-icons/field-dark.svg +0 -3
- package/src/style/icon/symbol-icons/field-light.svg +0 -3
- package/src/style/icon/symbol-icons/file-dark.svg +0 -3
- package/src/style/icon/symbol-icons/file-light.svg +0 -3
- package/src/style/icon/symbol-icons/indexer-dark.svg +0 -3
- package/src/style/icon/symbol-icons/indexer-light.svg +0 -3
- package/src/style/icon/symbol-icons/interface-dark.svg +0 -3
- package/src/style/icon/symbol-icons/interface-light.svg +0 -3
- package/src/style/icon/symbol-icons/keyword-dark.svg +0 -3
- package/src/style/icon/symbol-icons/keyword-light.svg +0 -3
- package/src/style/icon/symbol-icons/method-dark.svg +0 -3
- package/src/style/icon/symbol-icons/method-light.svg +0 -3
- package/src/style/icon/symbol-icons/namespace-dark.svg +0 -3
- package/src/style/icon/symbol-icons/namespace-light.svg +0 -3
- package/src/style/icon/symbol-icons/numeric-dark.svg +0 -3
- package/src/style/icon/symbol-icons/numeric-light.svg +0 -3
- package/src/style/icon/symbol-icons/operator-dark.svg +0 -3
- package/src/style/icon/symbol-icons/operator-light.svg +0 -3
- package/src/style/icon/symbol-icons/property-dark.svg +0 -3
- package/src/style/icon/symbol-icons/property-light.svg +0 -3
- package/src/style/icon/symbol-icons/snippet-dark.svg +0 -3
- package/src/style/icon/symbol-icons/snippet-light.svg +0 -3
- package/src/style/icon/symbol-icons/string-dark.svg +0 -3
- package/src/style/icon/symbol-icons/string-light.svg +0 -3
- package/src/style/icon/symbol-icons/structure-dark.svg +0 -3
- package/src/style/icon/symbol-icons/structure-light.svg +0 -3
- package/src/style/icon/symbol-icons/symbol-icons.css +0 -284
- package/src/style/icon/symbol-icons/template-dark.svg +0 -3
- package/src/style/icon/symbol-icons/template-light.svg +0 -3
- package/src/style/icon/symbol-icons/variable-dark.svg +0 -3
- package/src/style/icon/symbol-icons/variable-light.svg +0 -3
- package/src/style/icon.less +0 -8
- package/src/style/index.less +0 -14
- package/src/style/monaco-override.less +0 -116
- package/src/style/normalize.less +0 -92
- package/src/style/octicons/octicons-cdn.css +0 -720
- package/src/style/octicons/octicons.css +0 -714
- package/src/style/octicons/octicons.html +0 -1882
- package/src/style/octicons/octicons.svg +0 -582
- package/src/style/octicons/octicons.ttf +0 -0
- package/src/style/override.less +0 -97
- package/src/style/toolbar.less +0 -199
- package/src/style/utilities.less +0 -8
- package/src/style/variable.less +0 -8
- package/src/terminal/index.ts +0 -7
- package/src/toolbar/components/auto-complete.tsx +0 -0
- package/src/toolbar/components/button.tsx +0 -440
- package/src/toolbar/components/index.ts +0 -2
- package/src/toolbar/components/select.tsx +0 -189
- package/src/toolbar/index.ts +0 -3
- package/src/toolbar/toolbar.popover.registry.ts +0 -32
- package/src/toolbar/toolbar.registry.ts +0 -352
- package/src/toolbar/toolbar.tsx +0 -710
- package/src/toolbar/types.ts +0 -383
- package/src/tree/index.ts +0 -3
- package/src/tree/tree-expansion.ts +0 -25
- package/src/tree/tree-selection.ts +0 -89
- package/src/tree/tree.ts +0 -294
- package/src/utils/create-overlay.tsx +0 -53
- package/src/utils/electron.ts +0 -92
- package/src/utils/env.ts +0 -26
- package/src/utils/icon.ts +0 -13
- package/src/utils/index.ts +0 -7
- package/src/utils/json.ts +0 -251
- package/src/utils/label.tsx +0 -36
- package/src/utils/parse.ts +0 -72
- package/src/utils/react-hooks.ts +0 -118
- package/src/variable/index.ts +0 -1
- package/src/variable/variable.ts +0 -84
- package/src/window/index.ts +0 -34
- package/src/window/window.service.ts +0 -100
package/src/menu/next/menu-id.ts
DELETED
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
// menu id 枚举值列表
|
|
2
|
-
export enum MenuId {
|
|
3
|
-
AccountsContext = 'accounts/context',
|
|
4
|
-
ActivityBarContext = 'activityBar/context',
|
|
5
|
-
ActivityBarExtra = 'activityBar/extra',
|
|
6
|
-
CommandPalette = 'commandPalette',
|
|
7
|
-
DebugBreakpointsContext = 'debug/breakpoints/context',
|
|
8
|
-
DebugCallStackContext = 'debug/callstack/context',
|
|
9
|
-
DebugConsoleContext = 'debug/console/context',
|
|
10
|
-
DebugVariablesContext = 'debug/variables/context',
|
|
11
|
-
DebugWatchContext = 'debug/watch/context',
|
|
12
|
-
DebugToolBar = 'debug/toolbar',
|
|
13
|
-
EditorContext = 'editor/context',
|
|
14
|
-
EditorTitle = 'editor/title',
|
|
15
|
-
EditorTitleRun = 'editor/title/run',
|
|
16
|
-
EditorTitleContext = 'editor/title/context',
|
|
17
|
-
EmptyEditorGroupContext = 'empty/editor/group/context',
|
|
18
|
-
ExplorerContext = 'explorer/context',
|
|
19
|
-
MenubarAppearanceMenu = 'menubar/appearance',
|
|
20
|
-
MenubarAppMenu = 'menubar/app',
|
|
21
|
-
MenubarDebugMenu = 'menubar/debug',
|
|
22
|
-
MenubarEditMenu = 'menubar/edit',
|
|
23
|
-
MenubarFileMenu = 'menubar/file/menu',
|
|
24
|
-
MenubarGoMenu = 'menubar/go',
|
|
25
|
-
MenubarHelpMenu = 'menubar/help',
|
|
26
|
-
MenubarLayoutMenu = 'menubar/layout',
|
|
27
|
-
MenubarNewBreakpointMenu = 'menubar/new/breakpoint',
|
|
28
|
-
MenubarPreferencesMenu = 'menubar/preferences',
|
|
29
|
-
MenubarRecentMenu = 'menubar/recent',
|
|
30
|
-
MenubarSelectionMenu = 'menubar/selection',
|
|
31
|
-
MenubarSwitchEditorMenu = 'menubar/switch/editor',
|
|
32
|
-
MenubarSwitchGroupMenu = 'menubar/switch/group',
|
|
33
|
-
MenubarTerminalMenu = 'menubar/terminal',
|
|
34
|
-
MenubarViewMenu = 'menubar/view',
|
|
35
|
-
TerminalInstanceContext = 'terminal/instance/context',
|
|
36
|
-
TerminalNewDropdownContext = 'terminal/newDropdown/context',
|
|
37
|
-
TerminalTabContext = 'terminal/tab/context',
|
|
38
|
-
TerminalPanelContext = 'terminal/panel/context',
|
|
39
|
-
TerminalDefaultTypeMenu = 'terminal/menu/context',
|
|
40
|
-
OpenEditorsContext = 'open/editors/context',
|
|
41
|
-
ProblemsPanelContext = 'problems/panel/context',
|
|
42
|
-
SCMChangeTitle = 'scm/change/title',
|
|
43
|
-
SCMResourceContext = 'scm/resourceState/context',
|
|
44
|
-
SCMResourceGroupContext = 'scm/resourceGroup/context',
|
|
45
|
-
SCMResourceFolderContext = 'scm/resourceFolder/context',
|
|
46
|
-
SCMSourceControl = 'scm/sourceControl',
|
|
47
|
-
SCMTitle = 'scm/title',
|
|
48
|
-
SCMInput = 'scm/input',
|
|
49
|
-
SearchContext = 'search/context',
|
|
50
|
-
StatusBarContext = 'statusbar/context',
|
|
51
|
-
StatusBarWindowIndicatorMenu = 'statusbar/windowIndicator',
|
|
52
|
-
TouchBarContext = 'touchBar/context' /* 并未实现 */,
|
|
53
|
-
ViewItemContext = 'view/item/context',
|
|
54
|
-
ViewTitle = 'view/title',
|
|
55
|
-
GlobalActivity = 'global/activity',
|
|
56
|
-
ExtensionContext = 'extension/context', // 插件市场 item
|
|
57
|
-
SettingsIconMenu = 'settings/icon/menu', // 右下角 setting menu
|
|
58
|
-
// The contributed comment thread context menu, rendered as buttons below the comment editor
|
|
59
|
-
CommentsCommentThreadContext = 'comments/commentThread/context',
|
|
60
|
-
// The contributed comment thread title menu
|
|
61
|
-
CommentsCommentThreadTitle = 'comments/commentThread/title',
|
|
62
|
-
// The contributed comment title menu
|
|
63
|
-
CommentsCommentTitle = 'comments/comment/title',
|
|
64
|
-
// The contributed comment context menu, rendered as buttons below the comment editor
|
|
65
|
-
CommentsCommentContext = 'comments/comment/context',
|
|
66
|
-
CommentReactionSwitcherMenu = 'comment/reaction/switcher/menu',
|
|
67
|
-
CommentReactionSwitcherSubmenu = 'comment/reaction/switcher/submenu',
|
|
68
|
-
// ToolbarLocation
|
|
69
|
-
KTToolbarLocationContext = 'kt/toolbar/context',
|
|
70
|
-
// 插件市场未搜索到结果
|
|
71
|
-
MarketplaceNoResultsContext = 'marketplace/noResults/context',
|
|
72
|
-
// Testing glyph margin
|
|
73
|
-
TestingGlyphMarginContext = 'testing/glyphMargin/context',
|
|
74
|
-
TestPeekTitleContext = 'testing/outputPeek/title/context',
|
|
75
|
-
// OpenType
|
|
76
|
-
OpenTypeSubmenuContext = 'editor/openType/submenu',
|
|
77
|
-
// accordion
|
|
78
|
-
AccordionContext = 'accordion',
|
|
79
|
-
// setting.json
|
|
80
|
-
SettingJSONGlyphMarginContext = 'settingJson/glyphMargin/context',
|
|
81
|
-
SubSettingJSONGlyphMarginContext = 'sub/settingJson/glyphMargin/context',
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
export function getTabbarCommonMenuId(location: string) {
|
|
85
|
-
return `tabbar/${location}/common`;
|
|
86
|
-
}
|
|
@@ -1,252 +0,0 @@
|
|
|
1
|
-
import { Autowired, Injectable, Optional, INJECTOR_TOKEN, Injector } from '@opensumi/di';
|
|
2
|
-
import { CommandRegistry, Disposable, Event, Emitter } from '@opensumi/ide-core-common';
|
|
3
|
-
import { ContextKeyExpr } from '@opensumi/monaco-editor-core/esm/vs/platform/contextkey/common/contextkey';
|
|
4
|
-
|
|
5
|
-
import { ContextKeyChangeEvent, IContextKeyService } from '../../context-key';
|
|
6
|
-
|
|
7
|
-
import { IMenuItem, isIMenuItem, ISubmenuItem, IComponentMenuItem, isIComponentMenuItem, IMenuRegistry } from './base';
|
|
8
|
-
import { MenuId } from './menu-id';
|
|
9
|
-
import {
|
|
10
|
-
AbstractMenuService,
|
|
11
|
-
IMenu,
|
|
12
|
-
IMenuNodeOptions,
|
|
13
|
-
SubmenuItemNode,
|
|
14
|
-
ComponentMenuItemNode,
|
|
15
|
-
MenuItemNode,
|
|
16
|
-
} from './menu.interface';
|
|
17
|
-
|
|
18
|
-
type MenuItemGroup = [string, Array<IMenuItem | ISubmenuItem | IComponentMenuItem>];
|
|
19
|
-
|
|
20
|
-
@Injectable()
|
|
21
|
-
export class MenuServiceImpl implements AbstractMenuService {
|
|
22
|
-
@Autowired(INJECTOR_TOKEN)
|
|
23
|
-
private readonly injector: Injector;
|
|
24
|
-
|
|
25
|
-
@Autowired(IContextKeyService)
|
|
26
|
-
private readonly globalCtxKeyService: IContextKeyService;
|
|
27
|
-
|
|
28
|
-
public createMenu(id: MenuId | string, contextKeyService?: IContextKeyService): IMenu {
|
|
29
|
-
return this.injector.get(Menu, [id, contextKeyService || this.globalCtxKeyService]);
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
@Injectable()
|
|
34
|
-
class Menu extends Disposable implements IMenu {
|
|
35
|
-
private readonly _onDidChange = new Emitter<IMenu | undefined>();
|
|
36
|
-
public get onDidChange(): Event<IMenu | undefined> {
|
|
37
|
-
return this._onDidChange.event;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
private _menuGroups: MenuItemGroup[];
|
|
41
|
-
private _contextKeys: Set<string>;
|
|
42
|
-
|
|
43
|
-
@Autowired(IMenuRegistry)
|
|
44
|
-
private readonly menuRegistry: IMenuRegistry;
|
|
45
|
-
|
|
46
|
-
@Autowired(CommandRegistry)
|
|
47
|
-
private readonly commandRegistry: CommandRegistry;
|
|
48
|
-
|
|
49
|
-
@Autowired(INJECTOR_TOKEN)
|
|
50
|
-
private readonly injector: Injector;
|
|
51
|
-
|
|
52
|
-
public get menuId() {
|
|
53
|
-
return this.id;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
constructor(
|
|
57
|
-
@Optional() private readonly id: MenuId | string,
|
|
58
|
-
@Optional() private readonly contextKeyService: IContextKeyService,
|
|
59
|
-
) {
|
|
60
|
-
super();
|
|
61
|
-
this._build();
|
|
62
|
-
|
|
63
|
-
// rebuild this menu whenever the menu registry reports an event for this MenuId
|
|
64
|
-
this.addDispose(
|
|
65
|
-
Event.debounce(
|
|
66
|
-
Event.filter(this.menuRegistry.onDidChangeMenu, (menuId) => menuId === this.id),
|
|
67
|
-
() => {},
|
|
68
|
-
50,
|
|
69
|
-
)(this._build, this),
|
|
70
|
-
);
|
|
71
|
-
|
|
72
|
-
// when context keys change we need to check if the menu also has changed
|
|
73
|
-
this.addDispose(
|
|
74
|
-
Event.debounce<ContextKeyChangeEvent, boolean>(
|
|
75
|
-
this.contextKeyService.onDidChangeContext,
|
|
76
|
-
(last, event) => last || event.payload.affectsSome(this._contextKeys),
|
|
77
|
-
50,
|
|
78
|
-
)((e) => e && this._onDidChange.fire(undefined), this),
|
|
79
|
-
);
|
|
80
|
-
|
|
81
|
-
this.addDispose(this._onDidChange);
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
private _build(): void {
|
|
85
|
-
// reset
|
|
86
|
-
this._menuGroups = [];
|
|
87
|
-
this._contextKeys = new Set();
|
|
88
|
-
|
|
89
|
-
let menuItems = this.menuRegistry.getMenuItems(this.id);
|
|
90
|
-
|
|
91
|
-
let group: MenuItemGroup | undefined;
|
|
92
|
-
menuItems = menuItems.sort(menuItemsSorter);
|
|
93
|
-
|
|
94
|
-
for (const item of menuItems) {
|
|
95
|
-
// group by groupId
|
|
96
|
-
const groupName = item.group || '';
|
|
97
|
-
if (!group || group[0] !== groupName) {
|
|
98
|
-
group = [groupName, []];
|
|
99
|
-
this._menuGroups.push(group);
|
|
100
|
-
}
|
|
101
|
-
group![1].push(item);
|
|
102
|
-
|
|
103
|
-
// keep keys for eventing
|
|
104
|
-
this.fillKeysInWhenExpr(this._contextKeys, item.when);
|
|
105
|
-
|
|
106
|
-
// 收集 toggledWhen
|
|
107
|
-
if (isIMenuItem(item)) {
|
|
108
|
-
this.fillKeysInWhenExpr(this._contextKeys, item.toggledWhen);
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
// 收集 enabledWhen
|
|
112
|
-
if (isIMenuItem(item)) {
|
|
113
|
-
if (item.enabledWhen) {
|
|
114
|
-
this.fillKeysInWhenExpr(this._contextKeys, item.enabledWhen);
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
this._onDidChange.fire(this);
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
public getMenuNodes(
|
|
122
|
-
config: IMenuNodeOptions = {},
|
|
123
|
-
): Array<[MenuId | string, Array<MenuItemNode | SubmenuItemNode | ComponentMenuItemNode>]> {
|
|
124
|
-
const result: [MenuId | string, Array<MenuItemNode | SubmenuItemNode | ComponentMenuItemNode>][] = [];
|
|
125
|
-
for (const group of this._menuGroups) {
|
|
126
|
-
const [id, items] = group;
|
|
127
|
-
const activeActions: Array<MenuItemNode | SubmenuItemNode | ComponentMenuItemNode> = [];
|
|
128
|
-
for (const item of items) {
|
|
129
|
-
const activeAction = this._getActiveAction(item, config);
|
|
130
|
-
if (activeAction) {
|
|
131
|
-
activeActions.push(activeAction);
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
if (activeActions.length > 0) {
|
|
135
|
-
result.push([id, activeActions]);
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
return result;
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
private _getActiveAction(item: IMenuItem | ISubmenuItem | IComponentMenuItem, options: IMenuNodeOptions) {
|
|
142
|
-
if (this.contextKeyService.match(item.when, options.contextDom)) {
|
|
143
|
-
if (isIMenuItem(item)) {
|
|
144
|
-
// 兼容现有的 Command#isVisible
|
|
145
|
-
const { args = [] } = options;
|
|
146
|
-
const menuCommandDesc = this.menuRegistry.getMenuCommand(item.command);
|
|
147
|
-
const command = this.commandRegistry.getCommand(menuCommandDesc.id);
|
|
148
|
-
|
|
149
|
-
const menuCommand = { ...(command || {}), ...menuCommandDesc };
|
|
150
|
-
// 没有 desc 的 command 不展示在 menu 中
|
|
151
|
-
if (!menuCommand.label) {
|
|
152
|
-
return;
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
// command 存在但是 isVisible 为 false 则跳过
|
|
156
|
-
if (command && !this.commandRegistry.isVisible(menuCommand.id, ...args)) {
|
|
157
|
-
return;
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
// 默认为 true, 此项状态皆来自于 Command
|
|
161
|
-
// menu.enabledWhen 的优先级高于 Command.isEnabled
|
|
162
|
-
// 若设置了 menu.enabledWhen 则忽略 Command.isEnabled
|
|
163
|
-
const commandEnablement = command ? this.commandRegistry.isEnabled(menuCommand.id, ...args) : true;
|
|
164
|
-
const disabled =
|
|
165
|
-
item.enabledWhen !== undefined
|
|
166
|
-
? !this.contextKeyService.match(item.enabledWhen, options.contextDom)
|
|
167
|
-
: !commandEnablement;
|
|
168
|
-
|
|
169
|
-
// menu.toggledWhen 的优先级高于 Command.isToggled
|
|
170
|
-
// 若设置了 menu.toggledWhen 则忽略 Command.isToggled
|
|
171
|
-
const commandToggle = Boolean(command && this.commandRegistry.isToggled(menuCommand.id, ...args));
|
|
172
|
-
const checked =
|
|
173
|
-
item.toggledWhen !== undefined
|
|
174
|
-
? this.contextKeyService.match(item.toggledWhen, options.contextDom)
|
|
175
|
-
: commandToggle;
|
|
176
|
-
|
|
177
|
-
const action = this.injector.get(MenuItemNode, [
|
|
178
|
-
menuCommand,
|
|
179
|
-
item.iconClass || command?.iconClass,
|
|
180
|
-
options,
|
|
181
|
-
disabled,
|
|
182
|
-
checked,
|
|
183
|
-
item.type,
|
|
184
|
-
item.nativeRole,
|
|
185
|
-
item.extraDesc,
|
|
186
|
-
item.extraTailArgs,
|
|
187
|
-
item.argsTransformer,
|
|
188
|
-
]);
|
|
189
|
-
return action;
|
|
190
|
-
} else if (isIComponentMenuItem(item)) {
|
|
191
|
-
const action = this.injector.get(ComponentMenuItemNode, [
|
|
192
|
-
item,
|
|
193
|
-
options,
|
|
194
|
-
item.extraTailArgs,
|
|
195
|
-
item.argsTransformer,
|
|
196
|
-
]);
|
|
197
|
-
return action;
|
|
198
|
-
} else {
|
|
199
|
-
// 只有 label 存在值的时候才渲染
|
|
200
|
-
if (item.label) {
|
|
201
|
-
const action = this.injector.get(SubmenuItemNode, [item]);
|
|
202
|
-
return action;
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
private fillKeysInWhenExpr(set: Set<string>, when?: string | ContextKeyExpr) {
|
|
209
|
-
const keys = this.contextKeyService.getKeysInWhen(when);
|
|
210
|
-
keys.forEach((key) => {
|
|
211
|
-
set.add(key);
|
|
212
|
-
});
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
function menuItemsSorter(a: IMenuItem, b: IMenuItem): number {
|
|
217
|
-
const aGroup = a.group;
|
|
218
|
-
const bGroup = b.group;
|
|
219
|
-
|
|
220
|
-
if (aGroup !== bGroup) {
|
|
221
|
-
// Falsy groups come last
|
|
222
|
-
if (!aGroup) {
|
|
223
|
-
return 1;
|
|
224
|
-
} else if (!bGroup) {
|
|
225
|
-
return -1;
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
// 'navigation' group comes first
|
|
229
|
-
if (aGroup === 'navigation') {
|
|
230
|
-
return -1;
|
|
231
|
-
} else if (bGroup === 'navigation') {
|
|
232
|
-
return 1;
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
// lexical sort for groups
|
|
236
|
-
const value = aGroup.localeCompare(bGroup);
|
|
237
|
-
if (value !== 0) {
|
|
238
|
-
return value;
|
|
239
|
-
}
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
// sort on priority - default is 0
|
|
243
|
-
const aPrio = a.order || 0;
|
|
244
|
-
const bPrio = b.order || 0;
|
|
245
|
-
if (aPrio < bPrio) {
|
|
246
|
-
return -1;
|
|
247
|
-
} else if (aPrio > bPrio) {
|
|
248
|
-
return 1;
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
return 0;
|
|
252
|
-
}
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
MenuItemNode,
|
|
3
|
-
SubmenuItemNode,
|
|
4
|
-
SeparatorMenuItemNode,
|
|
5
|
-
TupleMenuNodeResult,
|
|
6
|
-
IMenu,
|
|
7
|
-
IMenuSeparator,
|
|
8
|
-
IMenuConfig,
|
|
9
|
-
ComponentMenuItemNode,
|
|
10
|
-
} from './menu.interface';
|
|
11
|
-
|
|
12
|
-
export const isPrimaryGroup = (group: string) => group === 'navigation';
|
|
13
|
-
export const isInlineGroup = (group: string) => /^inline/.test(group);
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* 将 menuItems 按照 separator 分成两个 group
|
|
17
|
-
* todo: 支持返回结果合并成一个 group
|
|
18
|
-
*/
|
|
19
|
-
export function splitMenuItems(
|
|
20
|
-
groups: Array<[string, Array<MenuItemNode | SubmenuItemNode | ComponentMenuItemNode>]>,
|
|
21
|
-
separator: IMenuSeparator = 'navigation',
|
|
22
|
-
): TupleMenuNodeResult {
|
|
23
|
-
const result: TupleMenuNodeResult = [[], []];
|
|
24
|
-
for (const tuple of groups) {
|
|
25
|
-
const [groupIdentity, menuNodes] = tuple;
|
|
26
|
-
|
|
27
|
-
const splitFn = separator === 'inline' ? isInlineGroup : isPrimaryGroup;
|
|
28
|
-
|
|
29
|
-
if (splitFn(groupIdentity)) {
|
|
30
|
-
result[0].push(...menuNodes);
|
|
31
|
-
} else {
|
|
32
|
-
if (result[1].length > 0) {
|
|
33
|
-
result[1].push(new SeparatorMenuItemNode());
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
result[1].push(...menuNodes);
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
return result;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
interface IExtendMenuConfig extends IMenuConfig {
|
|
43
|
-
menus: IMenu;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
export function mergeTupleMenuNodeResult(payload: TupleMenuNodeResult) {
|
|
47
|
-
const [primary, secondary] = payload;
|
|
48
|
-
const result = [...primary];
|
|
49
|
-
if (result.length > 0 && secondary.length > 0) {
|
|
50
|
-
result.push(new SeparatorMenuItemNode());
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
return result.concat(secondary);
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
export function generateMergedCtxMenu(payload: IExtendMenuConfig) {
|
|
57
|
-
return mergeTupleMenuNodeResult(generateCtxMenu(payload));
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
export function generateCtxMenu(payload: IExtendMenuConfig) {
|
|
61
|
-
const { menus, separator = 'navigation', ...options } = payload;
|
|
62
|
-
const menuNodes = menus.getMenuNodes(options);
|
|
63
|
-
const menuItems = splitMenuItems(menuNodes, separator);
|
|
64
|
-
return menuItems;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
export function generateMergedInlineActions(payload: IExtendMenuConfig) {
|
|
68
|
-
const result = generateInlineActions(payload);
|
|
69
|
-
return [...result[0], ...result[1]];
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
export function generateInlineActions(payload: Omit<IExtendMenuConfig, 'withAlt'>) {
|
|
73
|
-
const { menus, separator, ...options } = payload;
|
|
74
|
-
const menuNodes = menus.getMenuNodes(options);
|
|
75
|
-
const menuItems = splitMenuItems(menuNodes, separator);
|
|
76
|
-
return menuItems;
|
|
77
|
-
}
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import type vscode from 'vscode';
|
|
2
|
-
|
|
3
|
-
import { URI } from '@opensumi/ide-core-common';
|
|
4
|
-
import type { IChange } from '@opensumi/monaco-editor-core/esm/vs/editor/common/diff/smartLinesDiffComputer';
|
|
5
|
-
|
|
6
|
-
// explorer/context
|
|
7
|
-
// 资源管理器 ctxmenu
|
|
8
|
-
// 第一个参数是当前 ctx-menu 出现在的那个 ExplorerItem 的 URI
|
|
9
|
-
// 第二个参数是多选时 ExplorerItem 列表的 URI
|
|
10
|
-
// 经过进程通信后 URI -- transform --> Uri
|
|
11
|
-
export type ExplorerContextParams = [URI, URI[]];
|
|
12
|
-
|
|
13
|
-
export type ExplorerContextCallback = (...args: ExplorerContextParams) => void;
|
|
14
|
-
|
|
15
|
-
// editor/context
|
|
16
|
-
export type EditorContextArgs = [URI, URI[]];
|
|
17
|
-
export type EditorContextCallback = (...args: [URI]) => void;
|
|
18
|
-
|
|
19
|
-
type GroupId = number; // vscode.IEditorGroupView['id'];
|
|
20
|
-
// editor/title
|
|
21
|
-
// editor tab group 最右侧 ellipsis 图标点击 dropdown
|
|
22
|
-
// type EditorTitleCallback = (...args: [URI, { groupId: GroupId }]) => void;
|
|
23
|
-
|
|
24
|
-
// editor/title/context
|
|
25
|
-
// editor tab ctxmenu
|
|
26
|
-
interface EditorTitleExtraArgs {
|
|
27
|
-
groupId: GroupId;
|
|
28
|
-
editorIndex: number;
|
|
29
|
-
}
|
|
30
|
-
// 参考 src/vs/workbench/browser/parts/editor/titleControl.ts#304,310
|
|
31
|
-
export type EditorTitleContextCallback = (...args: [URI, EditorTitleExtraArgs]) => void;
|
|
32
|
-
|
|
33
|
-
// debug/callstack/context
|
|
34
|
-
// debug 时 callstack list item 的 ctxmenu
|
|
35
|
-
// arg.0:"file:///Users/vagusx/Project/ide-test-workspace/aa/aaa.js"
|
|
36
|
-
// arg.1:"stackframe:thread:a0f28e52-6237-40ce-a0d9-11fe2a2de819:1:1001:0"
|
|
37
|
-
export type DebugCallstackContextCallbak = (...args: [string, string]) => void;
|
|
38
|
-
|
|
39
|
-
// debug/toolbar
|
|
40
|
-
// debug toolbar 上
|
|
41
|
-
export type DebugToolbarCallbak = (...args: []) => void;
|
|
42
|
-
|
|
43
|
-
// scm/title
|
|
44
|
-
// scm titlebar 的 inline actions/more actions
|
|
45
|
-
// 此处是 hosted object
|
|
46
|
-
export type ScmTitleCallback = (...args: [vscode.SourceControl]) => void; // 实际为拓展后的 ExtHostSourceControl
|
|
47
|
-
|
|
48
|
-
// scm/resourceGroup/context
|
|
49
|
-
// scm resource list 的 group 的 ctxmenu
|
|
50
|
-
// 此处是 hosted object
|
|
51
|
-
export type ScmResourceGroupContextCallback = (...args: [vscode.SourceControlResourceGroup]) => void; // 实际为拓展后的 ExtHostSourceControlResourceGroup
|
|
52
|
-
|
|
53
|
-
// scm/resourceState/context // 老版本是 scm/resource/context
|
|
54
|
-
// scm resource list 的 item 的 ctxmenu
|
|
55
|
-
// 此处是 hosted object
|
|
56
|
-
export type ScmResourceStateContextCallback = (...args: [vscode.SourceControlResourceState]) => void;
|
|
57
|
-
|
|
58
|
-
// scm/change/title
|
|
59
|
-
// diff editor 的最右侧 ellipsis 图标点击 dropdown
|
|
60
|
-
// 此处 Uri 是 git scheme 的
|
|
61
|
-
// todo: scm/change/title 是 diff widget 的菜单,这里不对待更新
|
|
62
|
-
export type ScmChangeTitleCallback = (...args: [URI, IChange[], number]) => void;
|
|
63
|
-
|
|
64
|
-
// view/title
|
|
65
|
-
// 自定义 contributed view 的 inline actions/more actions
|
|
66
|
-
// 此处参数应该是各个 view 自行定义的
|
|
67
|
-
export type ViewTitleCallback = (...args: []) => void;
|
|
68
|
-
|
|
69
|
-
// view/item/context
|
|
70
|
-
// 自定义 contributed view 中 list item 的 ctx menu
|
|
71
|
-
// 此处参数应该是各个 view 自行定义的
|
|
72
|
-
export type ViewItemCallback = (...args: []) => void;
|
|
73
|
-
|
|
74
|
-
// 目前我们没有实现 comment 相关 API
|
|
75
|
-
// comment 相关可参见 https://github.com/microsoft/vscode/issues/77663
|
|
76
|
-
// comments/commentThread/title
|
|
77
|
-
// comments/commentThread/context
|
|
78
|
-
// comments/comment/title
|
|
79
|
-
// comments/comment/context
|