@codingame/monaco-vscode-welcome-service-override 11.1.1 → 12.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/index.d.ts CHANGED
@@ -1 +1,2 @@
1
- export { default } from 'vscode/service-override/welcome';
1
+ import type { IEditorOverrideServices } from "vscode/vscode/vs/editor/standalone/browser/standaloneServices";
2
+ export default function getServiceOverride(): IEditorOverrideServices;
package/index.js CHANGED
@@ -1 +1,9 @@
1
- export { default } from './welcome.js';
1
+
2
+ import './vscode/src/vs/workbench/contrib/welcomeViews/common/viewsWelcome.contribution.js';
3
+ import './vscode/src/vs/workbench/contrib/welcomeViews/common/newFile.contribution.js';
4
+
5
+ function getServiceOverride() {
6
+ return {};
7
+ }
8
+
9
+ export { getServiceOverride as default };
package/package.json CHANGED
@@ -1,6 +1,8 @@
1
1
  {
2
2
  "name": "@codingame/monaco-vscode-welcome-service-override",
3
- "version": "11.1.1",
3
+ "version": "12.0.0",
4
+ "private": false,
5
+ "description": "VSCode public API plugged on the monaco editor - welcome service-override",
4
6
  "keywords": [],
5
7
  "author": {
6
8
  "name": "CodinGame",
@@ -12,8 +14,11 @@
12
14
  "url": "git+ssh://git@github.com/CodinGame/monaco-vscode-api.git"
13
15
  },
14
16
  "type": "module",
15
- "private": false,
16
- "description": "VSCode public API plugged on the monaco editor - welcome service-override",
17
+ "dependencies": {
18
+ "vscode": "npm:@codingame/monaco-vscode-api@12.0.0"
19
+ },
20
+ "peerDependencies": {},
21
+ "peerDependenciesMeta": {},
17
22
  "main": "index.js",
18
23
  "module": "index.js",
19
24
  "types": "index.d.ts",
@@ -22,10 +27,12 @@
22
27
  "default": "./index.js"
23
28
  },
24
29
  "./vscode/*": {
25
- "default": "./vscode/src/*.js"
30
+ "default": "./vscode/src/*.js",
31
+ "types": "./vscode/src/*.d.ts"
32
+ },
33
+ "./*": {
34
+ "default": "./*.js",
35
+ "types": "./*.d.ts"
26
36
  }
27
- },
28
- "dependencies": {
29
- "vscode": "npm:@codingame/monaco-vscode-api@11.1.1"
30
37
  }
31
38
  }
@@ -1,5 +1,7 @@
1
- import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
1
+
2
+ import { __decorate, __param } from 'vscode/external/tslib/tslib.es6';
2
3
  import { promiseWithResolvers } from 'vscode/vscode/vs/base/common/async';
4
+ import { KeyMod, KeyCode } from 'vscode/vscode/vs/base/common/keyCodes';
3
5
  import { Disposable, DisposableStore } from 'vscode/vscode/vs/base/common/lifecycle';
4
6
  import { assertIsDefined } from 'vscode/vscode/vs/base/common/types';
5
7
  import { localize, localize2 } from 'vscode/vscode/vs/nls';
@@ -8,23 +10,25 @@ import { IMenuService } from 'vscode/vscode/vs/platform/actions/common/actions.s
8
10
  import { ICommandService } from 'vscode/vscode/vs/platform/commands/common/commands.service';
9
11
  import { IContextKeyService } from 'vscode/vscode/vs/platform/contextkey/common/contextkey.service';
10
12
  import { IKeybindingService } from 'vscode/vscode/vs/platform/keybinding/common/keybinding.service';
13
+ import { KeybindingWeight } from 'vscode/vscode/vs/platform/keybinding/common/keybindingsRegistry';
11
14
  import { IQuickInputService } from 'vscode/vscode/vs/platform/quickinput/common/quickInput.service';
12
15
  import { Registry } from 'vscode/vscode/vs/platform/registry/common/platform';
13
16
  import { Extensions } from 'vscode/vscode/vs/workbench/common/contributions';
17
+ import { LifecyclePhase } from 'vscode/vscode/vs/workbench/services/lifecycle/common/lifecycle';
14
18
 
15
19
  var NewFileTemplatesManager_1;
16
- const builtInSource = ( localize(2527, "Built-In"));
17
- const category = ( localize2(2528, 'Create'));
20
+ const builtInSource = ( localize(10969, "Built-In"));
21
+ const category = ( localize2(10970, 'Create'));
18
22
  registerAction2(class extends Action2 {
19
23
  constructor() {
20
24
  super({
21
25
  id: 'welcome.showNewFileEntries',
22
- title: ( localize2(2529, 'New File...')),
26
+ title: ( localize2(10971, 'New File...')),
23
27
  category,
24
28
  f1: true,
25
29
  keybinding: {
26
- primary: 512 + 2048 + 256 + 44 ,
27
- weight: 200 ,
30
+ primary: KeyMod.Alt + KeyMod.CtrlCmd + KeyMod.WinCtrl + KeyCode.KeyN,
31
+ weight: KeybindingWeight.WorkbenchContrib,
28
32
  },
29
33
  menu: {
30
34
  id: MenuId.MenubarFileMenu,
@@ -77,10 +81,10 @@ let NewFileTemplatesManager = class NewFileTemplatesManager extends Disposable {
77
81
  }
78
82
  async selectNewEntry(entries) {
79
83
  const { promise: resultPromise, resolve: resolveResult } = promiseWithResolvers();
80
- const disposables = ( (new DisposableStore()));
84
+ const disposables = ( new DisposableStore());
81
85
  const qp = this.quickInputService.createQuickPick({ useSeparators: true });
82
- qp.title = ( localize(2530, "New File..."));
83
- qp.placeholder = ( localize(2531, "Select File Type or Enter File Name..."));
86
+ qp.title = ( localize(10972, "New File..."));
87
+ qp.placeholder = ( localize(10973, "Select File Type or Enter File Name..."));
84
88
  qp.sortByLabel = false;
85
89
  qp.matchOnDetail = true;
86
90
  qp.matchOnDescription = true;
@@ -106,8 +110,8 @@ let NewFileTemplatesManager = class NewFileTemplatesManager extends Disposable {
106
110
  return a.from.localeCompare(b.from);
107
111
  };
108
112
  const displayCategory = {
109
- 'file': ( localize(2532, "File")),
110
- 'notebook': ( localize(2533, "Notebook")),
113
+ 'file': ( localize(10974, "File")),
114
+ 'notebook': ( localize(10975, "Notebook")),
111
115
  };
112
116
  const refreshQp = (entries) => {
113
117
  const items = [];
@@ -132,7 +136,7 @@ let NewFileTemplatesManager = class NewFileTemplatesManager extends Disposable {
132
136
  buttons: command ? [
133
137
  {
134
138
  iconClass: 'codicon codicon-gear',
135
- tooltip: ( localize(2534, "Configure Keybinding"))
139
+ tooltip: ( localize(10976, "Configure Keybinding"))
136
140
  }
137
141
  ] : [],
138
142
  detail: '',
@@ -151,7 +155,7 @@ let NewFileTemplatesManager = class NewFileTemplatesManager extends Disposable {
151
155
  const currentTextEntry = {
152
156
  commandID: 'workbench.action.files.newFile',
153
157
  commandArgs: { languageId: undefined, viewType: undefined, fileName: val },
154
- title: ( localize(2535, "Create New File ({0})", val)),
158
+ title: ( localize(10977, "Create New File ({0})", val)),
155
159
  group: 'file',
156
160
  from: builtInSource,
157
161
  };
@@ -179,20 +183,20 @@ let NewFileTemplatesManager = class NewFileTemplatesManager extends Disposable {
179
183
  return resultPromise;
180
184
  }
181
185
  };
182
- NewFileTemplatesManager = NewFileTemplatesManager_1 = ( (__decorate([
183
- ( (__param(0, IQuickInputService))),
184
- ( (__param(1, IContextKeyService))),
185
- ( (__param(2, ICommandService))),
186
- ( (__param(3, IKeybindingService))),
187
- ( (__param(4, IMenuService)))
188
- ], NewFileTemplatesManager)));
189
- ( (Registry.as(Extensions.Workbench)))
190
- .registerWorkbenchContribution(NewFileTemplatesManager, 3 );
186
+ NewFileTemplatesManager = NewFileTemplatesManager_1 = ( __decorate([
187
+ ( __param(0, IQuickInputService)),
188
+ ( __param(1, IContextKeyService)),
189
+ ( __param(2, ICommandService)),
190
+ ( __param(3, IKeybindingService)),
191
+ ( __param(4, IMenuService))
192
+ ], NewFileTemplatesManager));
193
+ ( Registry.as(Extensions.Workbench))
194
+ .registerWorkbenchContribution(NewFileTemplatesManager, LifecyclePhase.Restored);
191
195
  MenuRegistry.appendMenuItem(MenuId.NewFile, {
192
196
  group: 'file',
193
197
  command: {
194
198
  id: 'workbench.action.files.newUntitledFile',
195
- title: ( localize(2536, "Text File"))
199
+ title: ( localize(10978, "Text File"))
196
200
  },
197
201
  order: 1
198
202
  });
@@ -1,5 +1,7 @@
1
- import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
1
+
2
+ import { __decorate, __param } from 'vscode/external/tslib/tslib.es6';
2
3
  import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
4
+ import { LifecyclePhase } from 'vscode/vscode/vs/workbench/services/lifecycle/common/lifecycle';
3
5
  import { Registry } from 'vscode/vscode/vs/platform/registry/common/platform';
4
6
  import { Extensions } from 'vscode/vscode/vs/workbench/common/contributions';
5
7
  import { ViewsWelcomeContribution } from './viewsWelcomeContribution.js';
@@ -16,4 +18,4 @@ WorkbenchConfigurationContribution = ( __decorate([
16
18
  ( __param(0, IInstantiationService))
17
19
  ], WorkbenchConfigurationContribution));
18
20
  ( Registry.as(Extensions.Workbench))
19
- .registerWorkbenchContribution(WorkbenchConfigurationContribution, 3 );
21
+ .registerWorkbenchContribution(WorkbenchConfigurationContribution, LifecyclePhase.Restored);
@@ -0,0 +1,8 @@
1
+ import { Disposable } from "vscode/vscode/vs/base/common/lifecycle";
2
+ import { IWorkbenchContribution } from "vscode/vscode/vs/workbench/common/contributions";
3
+ import { IExtensionPoint } from "vscode/vscode/vs/workbench/services/extensions/common/extensionsRegistry";
4
+ import { ViewsWelcomeExtensionPoint } from "./viewsWelcomeExtensionPoint.js";
5
+ export declare class ViewsWelcomeContribution extends Disposable implements IWorkbenchContribution {
6
+ private viewWelcomeContents;
7
+ constructor(extensionPoint: IExtensionPoint<ViewsWelcomeExtensionPoint>);
8
+ }
@@ -1,3 +1,4 @@
1
+
1
2
  import { localize } from 'vscode/vscode/vs/nls';
2
3
  import { Disposable } from 'vscode/vscode/vs/base/common/lifecycle';
3
4
  import { ContextKeyExpr } from 'vscode/vscode/vs/platform/contextkey/common/contextkey';
@@ -6,11 +7,11 @@ import { Registry } from 'vscode/vscode/vs/platform/registry/common/platform';
6
7
  import { Extensions } from 'vscode/vscode/vs/workbench/common/views';
7
8
  import { isProposedApiEnabled } from 'vscode/vscode/vs/workbench/services/extensions/common/extensions';
8
9
 
9
- const viewsRegistry = ( (Registry.as(Extensions.ViewsRegistry)));
10
+ const viewsRegistry = ( Registry.as(Extensions.ViewsRegistry));
10
11
  class ViewsWelcomeContribution extends Disposable {
11
12
  constructor(extensionPoint) {
12
13
  super();
13
- this.viewWelcomeContents = ( (new Map()));
14
+ this.viewWelcomeContents = ( new Map());
14
15
  extensionPoint.setHandler((_, { added, removed }) => {
15
16
  for (const contribution of removed) {
16
17
  for (const welcome of contribution.value) {
@@ -18,7 +19,7 @@ class ViewsWelcomeContribution extends Disposable {
18
19
  disposable?.dispose();
19
20
  }
20
21
  }
21
- const welcomesByViewId = ( (new Map()));
22
+ const welcomesByViewId = ( new Map());
22
23
  for (const contribution of added) {
23
24
  for (const welcome of contribution.value) {
24
25
  const { group, order } = parseGroupAndOrder(welcome, contribution);
@@ -26,7 +27,7 @@ class ViewsWelcomeContribution extends Disposable {
26
27
  const id = ViewIdentifierMap[welcome.view] ?? welcome.view;
27
28
  let viewContentMap = welcomesByViewId.get(id);
28
29
  if (!viewContentMap) {
29
- viewContentMap = ( (new Map()));
30
+ viewContentMap = ( new Map());
30
31
  welcomesByViewId.set(id, viewContentMap);
31
32
  }
32
33
  viewContentMap.set(welcome, {
@@ -53,7 +54,7 @@ function parseGroupAndOrder(welcome, contribution) {
53
54
  if (welcome.group) {
54
55
  if (!isProposedApiEnabled(contribution.description, 'contribViewsWelcome')) {
55
56
  contribution.collector.warn(( localize(
56
- 6723,
57
+ 10979,
57
58
  "The viewsWelcome contribution in '{0}' requires 'enabledApiProposals: [\"contribViewsWelcome\"]' in order to use the 'group' proposed property.",
58
59
  contribution.description.identifier.value
59
60
  )));
@@ -0,0 +1,23 @@
1
+ import { IConfigurationPropertySchema } from "vscode/vscode/vs/platform/configuration/common/configurationRegistry";
2
+ export declare enum ViewsWelcomeExtensionPointFields {
3
+ view = "view",
4
+ contents = "contents",
5
+ when = "when",
6
+ group = "group",
7
+ enablement = "enablement"
8
+ }
9
+ export interface ViewWelcome {
10
+ readonly [ViewsWelcomeExtensionPointFields.view]: string;
11
+ readonly [ViewsWelcomeExtensionPointFields.contents]: string;
12
+ readonly [ViewsWelcomeExtensionPointFields.when]: string;
13
+ readonly [ViewsWelcomeExtensionPointFields.group]: string;
14
+ readonly [ViewsWelcomeExtensionPointFields.enablement]: string;
15
+ }
16
+ export type ViewsWelcomeExtensionPoint = ViewWelcome[];
17
+ export declare const ViewIdentifierMap: {
18
+ [key: string]: string;
19
+ };
20
+ export declare const viewsWelcomeExtensionPointDescriptor: {
21
+ extensionPoint: string;
22
+ jsonSchema: Readonly<IConfigurationPropertySchema>;
23
+ };
@@ -1,30 +1,29 @@
1
+
1
2
  import { localize } from 'vscode/vscode/vs/nls';
2
3
 
3
4
  var ViewsWelcomeExtensionPointFields;
4
- ( ((function(ViewsWelcomeExtensionPointFields) {
5
+ (function (ViewsWelcomeExtensionPointFields) {
5
6
  ViewsWelcomeExtensionPointFields["view"] = "view";
6
7
  ViewsWelcomeExtensionPointFields["contents"] = "contents";
7
8
  ViewsWelcomeExtensionPointFields["when"] = "when";
8
9
  ViewsWelcomeExtensionPointFields["group"] = "group";
9
10
  ViewsWelcomeExtensionPointFields["enablement"] = "enablement";
10
- })(
11
- ViewsWelcomeExtensionPointFields || (ViewsWelcomeExtensionPointFields = {})
12
- )));
11
+ })(ViewsWelcomeExtensionPointFields || (ViewsWelcomeExtensionPointFields = {}));
13
12
  const ViewIdentifierMap = {
14
13
  'explorer': 'workbench.explorer.emptyView',
15
14
  'debug': 'workbench.debug.welcome',
16
15
  'scm': 'workbench.scm',
17
16
  'testing': 'workbench.view.testing'
18
17
  };
19
- const viewsWelcomeExtensionPointSchema = ( (Object.freeze({
18
+ const viewsWelcomeExtensionPointSchema = ( Object.freeze({
20
19
  type: 'array',
21
20
  description: ( localize(
22
- 6724,
21
+ 10980,
23
22
  "Contributed views welcome content. Welcome content will be rendered in tree based views whenever they have no meaningful content to display, ie. the File Explorer when no folder is open. Such content is useful as in-product documentation to drive users to use certain features before they are available. A good example would be a `Clone Repository` button in the File Explorer welcome view."
24
23
  )),
25
24
  items: {
26
25
  type: 'object',
27
- description: ( localize(6725, "Contributed welcome content for a specific view.")),
26
+ description: ( localize(10981, "Contributed welcome content for a specific view.")),
28
27
  required: [
29
28
  ViewsWelcomeExtensionPointFields.view,
30
29
  ViewsWelcomeExtensionPointFields.contents
@@ -35,45 +34,45 @@ const viewsWelcomeExtensionPointSchema = ( (Object.freeze({
35
34
  {
36
35
  type: 'string',
37
36
  description: ( localize(
38
- 6726,
37
+ 10982,
39
38
  "Target view identifier for this welcome content. Only tree based views are supported."
40
39
  ))
41
40
  },
42
41
  {
43
42
  type: 'string',
44
43
  description: ( localize(
45
- 6726,
44
+ 10982,
46
45
  "Target view identifier for this welcome content. Only tree based views are supported."
47
46
  )),
48
- enum: ( (Object.keys(ViewIdentifierMap)))
47
+ enum: ( Object.keys(ViewIdentifierMap))
49
48
  }
50
49
  ]
51
50
  },
52
51
  [ViewsWelcomeExtensionPointFields.contents]: {
53
52
  type: 'string',
54
53
  description: ( localize(
55
- 6727,
54
+ 10983,
56
55
  "Welcome content to be displayed. The format of the contents is a subset of Markdown, with support for links only."
57
56
  )),
58
57
  },
59
58
  [ViewsWelcomeExtensionPointFields.when]: {
60
59
  type: 'string',
61
- description: ( localize(6728, "Condition when the welcome content should be displayed.")),
60
+ description: ( localize(10984, "Condition when the welcome content should be displayed.")),
62
61
  },
63
62
  [ViewsWelcomeExtensionPointFields.group]: {
64
63
  type: 'string',
65
- description: ( localize(6729, "Group to which this welcome content belongs. Proposed API.")),
64
+ description: ( localize(10985, "Group to which this welcome content belongs. Proposed API.")),
66
65
  },
67
66
  [ViewsWelcomeExtensionPointFields.enablement]: {
68
67
  type: 'string',
69
68
  description: ( localize(
70
- 6730,
69
+ 10986,
71
70
  "Condition when the welcome content buttons and command links should be enabled."
72
71
  )),
73
72
  },
74
73
  }
75
74
  }
76
- })));
75
+ }));
77
76
  const viewsWelcomeExtensionPointDescriptor = {
78
77
  extensionPoint: 'viewsWelcome',
79
78
  jsonSchema: viewsWelcomeExtensionPointSchema
package/welcome.js DELETED
@@ -1,8 +0,0 @@
1
- import './vscode/src/vs/workbench/contrib/welcomeViews/common/viewsWelcome.contribution.js';
2
- import './vscode/src/vs/workbench/contrib/welcomeViews/common/newFile.contribution.js';
3
-
4
- function getServiceOverride() {
5
- return {};
6
- }
7
-
8
- export { getServiceOverride as default };