@codingame/monaco-vscode-view-banner-service-override 5.2.0 → 6.0.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codingame/monaco-vscode-view-banner-service-override",
3
- "version": "5.2.0",
3
+ "version": "6.0.0",
4
4
  "keywords": [],
5
5
  "author": {
6
6
  "name": "CodinGame",
@@ -26,6 +26,6 @@
26
26
  }
27
27
  },
28
28
  "dependencies": {
29
- "vscode": "npm:@codingame/monaco-vscode-api@5.2.0"
29
+ "vscode": "npm:@codingame/monaco-vscode-api@6.0.0"
30
30
  }
31
31
  }
@@ -1,13 +1,15 @@
1
1
  import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
2
2
  import './media/bannerpart.css.js';
3
3
  import { localize2WithPath } from 'vscode/vscode/vs/nls';
4
- import { addDisposableListener, EventType, clearNode, $, append, asCSSUrl } from 'vscode/vscode/vs/base/browser/dom';
4
+ import { addDisposableListener, EventType, clearNode, isHTMLElement, $, append, asCSSUrl } from 'vscode/vscode/vs/base/browser/dom';
5
5
  import { ActionBar } from 'vscode/vscode/vs/base/browser/ui/actionbar/actionbar';
6
+ import 'vscode/vscode/vs/platform/instantiation/common/extensions';
6
7
  import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
7
8
  import { IStorageService } from 'vscode/vscode/vs/platform/storage/common/storage.service';
8
9
  import { IThemeService } from 'vscode/vscode/vs/platform/theme/common/themeService.service';
9
10
  import { ThemeIcon } from 'vscode/vscode/vs/base/common/themables';
10
11
  import { Part } from 'vscode/vscode/vs/workbench/browser/part';
12
+ import { Parts } from 'vscode/vscode/vs/workbench/services/layout/browser/layoutService';
11
13
  import { IWorkbenchLayoutService } from 'vscode/vscode/vs/workbench/services/layout/browser/layoutService.service';
12
14
  import { Action } from 'vscode/vscode/vs/base/common/actions';
13
15
  import { Link } from 'vscode/vscode/vs/platform/opener/browser/link';
@@ -16,7 +18,8 @@ import { IBannerService } from 'vscode/vscode/vs/workbench/services/banner/brows
16
18
  import { MarkdownRenderer } from 'vscode/vscode/vs/editor/browser/widget/markdownRenderer/browser/markdownRenderer';
17
19
  import { Action2, registerAction2 } from 'vscode/vscode/vs/platform/actions/common/actions';
18
20
  import { Categories } from 'vscode/vscode/vs/platform/action/common/actionCommonCategories';
19
- import { KeybindingsRegistry } from 'vscode/vscode/vs/platform/keybinding/common/keybindingsRegistry';
21
+ import { KeybindingsRegistry, KeybindingWeight } from 'vscode/vscode/vs/platform/keybinding/common/keybindingsRegistry';
22
+ import { KeyCode } from 'vscode/vscode/vs/base/common/keyCodes';
20
23
  import { IContextKeyService } from 'vscode/vscode/vs/platform/contextkey/common/contextkey.service';
21
24
  import { URI } from 'vscode/vscode/vs/base/common/uri';
22
25
  import { widgetClose } from 'vscode/vscode/vs/platform/theme/common/iconRegistry';
@@ -32,7 +35,7 @@ let BannerPart = class BannerPart extends Part {
32
35
  }
33
36
  get onDidChange() { return this._onDidChangeSize.event; }
34
37
  constructor(themeService, layoutService, storageService, contextKeyService, instantiationService) {
35
- super("workbench.parts.banner" , { hasTitle: false }, themeService, storageService, layoutService);
38
+ super(Parts.BANNER_PART, { hasTitle: false }, themeService, storageService, layoutService);
36
39
  this.contextKeyService = contextKeyService;
37
40
  this.instantiationService = instantiationService;
38
41
  this.height = 26;
@@ -67,7 +70,7 @@ let BannerPart = class BannerPart extends Part {
67
70
  const length = this.item?.actions?.length ?? 0;
68
71
  if (this.focusedActionIndex < length) {
69
72
  const actionLink = this.messageActionsContainer?.children[this.focusedActionIndex];
70
- if (actionLink instanceof HTMLElement) {
73
+ if (isHTMLElement(actionLink)) {
71
74
  this.actionBar?.setFocusable(false);
72
75
  actionLink.focus();
73
76
  }
@@ -97,7 +100,7 @@ let BannerPart = class BannerPart extends Part {
97
100
  if (visible !== this.visible) {
98
101
  this.visible = visible;
99
102
  this.focusedActionIndex = -1;
100
- this.layoutService.setPartHidden(!visible, "workbench.parts.banner" );
103
+ this.layoutService.setPartHidden(!visible, Parts.BANNER_PART);
101
104
  this._onDidChangeSize.fire(undefined);
102
105
  }
103
106
  }
@@ -168,7 +171,7 @@ let BannerPart = class BannerPart extends Part {
168
171
  }
169
172
  toJSON() {
170
173
  return {
171
- type: "workbench.parts.banner"
174
+ type: Parts.BANNER_PART
172
175
  };
173
176
  }
174
177
  };
@@ -181,8 +184,8 @@ BannerPart = ( (__decorate([
181
184
  ], BannerPart)));
182
185
  KeybindingsRegistry.registerCommandAndKeybindingRule({
183
186
  id: 'workbench.banner.focusBanner',
184
- weight: 200 ,
185
- primary: 9 ,
187
+ weight: KeybindingWeight.WorkbenchContrib,
188
+ primary: KeyCode.Escape,
186
189
  when: BannerFocused,
187
190
  handler: (accessor) => {
188
191
  const bannerService = accessor.get(IBannerService);
@@ -191,9 +194,9 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
191
194
  });
192
195
  KeybindingsRegistry.registerCommandAndKeybindingRule({
193
196
  id: 'workbench.banner.focusNextAction',
194
- weight: 200 ,
195
- primary: 17 ,
196
- secondary: [18 ],
197
+ weight: KeybindingWeight.WorkbenchContrib,
198
+ primary: KeyCode.RightArrow,
199
+ secondary: [KeyCode.DownArrow],
197
200
  when: BannerFocused,
198
201
  handler: (accessor) => {
199
202
  const bannerService = accessor.get(IBannerService);
@@ -202,9 +205,9 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
202
205
  });
203
206
  KeybindingsRegistry.registerCommandAndKeybindingRule({
204
207
  id: 'workbench.banner.focusPreviousAction',
205
- weight: 200 ,
206
- primary: 15 ,
207
- secondary: [16 ],
208
+ weight: KeybindingWeight.WorkbenchContrib,
209
+ primary: KeyCode.LeftArrow,
210
+ secondary: [KeyCode.UpArrow],
208
211
  when: BannerFocused,
209
212
  handler: (accessor) => {
210
213
  const bannerService = accessor.get(IBannerService);
@@ -224,7 +227,7 @@ class FocusBannerAction extends Action2 {
224
227
  }
225
228
  async run(accessor) {
226
229
  const layoutService = accessor.get(IWorkbenchLayoutService);
227
- layoutService.focusPart("workbench.parts.banner" );
230
+ layoutService.focusPart(Parts.BANNER_PART);
228
231
  }
229
232
  }
230
233
  registerAction2(FocusBannerAction);
@@ -1,7 +1,9 @@
1
1
  import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
2
+ import { LifecyclePhase } from 'vscode/vscode/vs/workbench/services/lifecycle/common/lifecycle';
2
3
  import { Registry } from 'vscode/vscode/vs/platform/registry/common/platform';
3
4
  import { Extensions } from 'vscode/vscode/vs/workbench/common/contributions';
4
5
  import { IBannerService } from 'vscode/vscode/vs/workbench/services/banner/browser/bannerService.service';
6
+ import { StorageScope, StorageTarget } from 'vscode/vscode/vs/platform/storage/common/storage';
5
7
  import { IStorageService } from 'vscode/vscode/vs/platform/storage/common/storage.service';
6
8
  import { IBrowserWorkbenchEnvironmentService } from 'vscode/vscode/vs/workbench/services/environment/browser/environmentService.service';
7
9
  import { URI } from 'vscode/vscode/vs/base/common/uri';
@@ -16,7 +18,7 @@ let WelcomeBannerContribution = class WelcomeBannerContribution {
16
18
  if (!welcomeBanner) {
17
19
  return;
18
20
  }
19
- if (storageService.getBoolean(WelcomeBannerContribution_1.WELCOME_BANNER_DISMISSED_KEY, 0 , false)) {
21
+ if (storageService.getBoolean(WelcomeBannerContribution_1.WELCOME_BANNER_DISMISSED_KEY, StorageScope.PROFILE, false)) {
20
22
  return;
21
23
  }
22
24
  let icon = undefined;
@@ -32,7 +34,7 @@ let WelcomeBannerContribution = class WelcomeBannerContribution {
32
34
  icon,
33
35
  actions: welcomeBanner.actions,
34
36
  onClose: () => {
35
- storageService.store(WelcomeBannerContribution_1.WELCOME_BANNER_DISMISSED_KEY, true, 0 , 1 );
37
+ storageService.store(WelcomeBannerContribution_1.WELCOME_BANNER_DISMISSED_KEY, true, StorageScope.PROFILE, StorageTarget.MACHINE);
36
38
  }
37
39
  });
38
40
  }
@@ -43,4 +45,4 @@ WelcomeBannerContribution = WelcomeBannerContribution_1 = ( __decorate([
43
45
  ( __param(2, IBrowserWorkbenchEnvironmentService))
44
46
  ], WelcomeBannerContribution));
45
47
  ( Registry.as(Extensions.Workbench))
46
- .registerWorkbenchContribution(WelcomeBannerContribution, 3 );
48
+ .registerWorkbenchContribution(WelcomeBannerContribution, LifecyclePhase.Restored);