@codingame/monaco-vscode-share-service-override 4.5.0 → 4.5.2

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 @@
1
- export { default } from './share.js';
1
+ export { default } from 'vscode/service-override/share';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codingame/monaco-vscode-share-service-override",
3
- "version": "4.5.0",
3
+ "version": "4.5.2",
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@4.5.0"
29
+ "vscode": "npm:@codingame/monaco-vscode-api@4.5.2"
30
30
  }
31
31
  }
@@ -27,6 +27,7 @@ import { DisposableStore } from 'vscode/vscode/vs/base/common/lifecycle';
27
27
  import Severity$1 from 'vscode/vscode/vs/base/common/severity';
28
28
 
29
29
  var ShareWorkbenchContribution_1;
30
+ const _moduleId = "vs/workbench/contrib/share/browser/share.contribution";
30
31
  const targetMenus = [
31
32
  MenuId.EditorContextShare,
32
33
  MenuId.SCMResourceContextShare,
@@ -59,22 +60,21 @@ let ShareWorkbenchContribution = class ShareWorkbenchContribution {
59
60
  }
60
61
  registerActions() {
61
62
  if (!this._disposables) {
62
- this._disposables = ( new DisposableStore());
63
+ this._disposables = ( (new DisposableStore()));
63
64
  }
64
65
  this._disposables.add(registerAction2(class ShareAction extends Action2 {
65
66
  static { this.ID = 'workbench.action.share'; }
66
- static { this.LABEL = ( localize2WithPath(
67
- 'vs/workbench/contrib/share/browser/share.contribution',
68
- 'share',
69
- 'Share...'
70
- )); }
67
+ static { this.LABEL = ( localize2WithPath(_moduleId, 0, 'Share...')); }
71
68
  constructor() {
72
69
  super({
73
70
  id: ShareAction.ID,
74
71
  title: ShareAction.LABEL,
75
72
  f1: true,
76
73
  icon: Codicon.linkExternal,
77
- precondition: ( ContextKeyExpr.and(( ShareProviderCountContext.notEqualsTo(0)), ( WorkspaceFolderCountContext.notEqualsTo(0)))),
74
+ precondition: ( (ContextKeyExpr.and(
75
+ (ShareProviderCountContext.notEqualsTo(0)),
76
+ (WorkspaceFolderCountContext.notEqualsTo(0))
77
+ ))),
78
78
  keybinding: {
79
79
  weight: 200 ,
80
80
  primary: 512 | 2048 | 49 ,
@@ -96,40 +96,24 @@ let ShareWorkbenchContribution = class ShareWorkbenchContribution {
96
96
  const selection = accessor.get(ICodeEditorService).getActiveCodeEditor()?.getSelection() ?? undefined;
97
97
  const result = await progressService.withProgress({
98
98
  location: 10 ,
99
- detail: ( localizeWithPath(
100
- 'vs/workbench/contrib/share/browser/share.contribution',
101
- 'generating link',
102
- 'Generating link...'
103
- ))
99
+ detail: ( localizeWithPath(_moduleId, 1, 'Generating link...'))
104
100
  }, async () => shareService.provideShare({ resourceUri, selection }, CancellationToken.None));
105
101
  if (result) {
106
- const uriText = ( result.toString());
102
+ const uriText = ( (result.toString()));
107
103
  const isResultText = typeof result === 'string';
108
104
  await clipboardService.writeText(uriText);
109
105
  dialogService.prompt({
110
106
  type: Severity$1.Info,
111
- message: isResultText ? ( localizeWithPath(
112
- 'vs/workbench/contrib/share/browser/share.contribution',
113
- 'shareTextSuccess',
114
- 'Copied text to clipboard!'
115
- )) : ( localizeWithPath(
116
- 'vs/workbench/contrib/share/browser/share.contribution',
117
- 'shareSuccess',
118
- 'Copied link to clipboard!'
119
- )),
107
+ message: isResultText ? ( localizeWithPath(_moduleId, 2, 'Copied text to clipboard!')) : ( localizeWithPath(_moduleId, 3, 'Copied link to clipboard!')),
120
108
  custom: {
121
109
  icon: Codicon.check,
122
110
  markdownDetails: [{
123
- markdown: ( new MarkdownString(`<div aria-label='${uriText}'>${uriText}</div>`, { supportHtml: true })),
111
+ markdown: ( (new MarkdownString(`<div aria-label='${uriText}'>${uriText}</div>`, { supportHtml: true }))),
124
112
  classes: [isResultText ? 'share-dialog-input-text' : 'share-dialog-input-link']
125
113
  }]
126
114
  },
127
- cancelButton: ( localizeWithPath('vs/workbench/contrib/share/browser/share.contribution', 'close', 'Close')),
128
- buttons: isResultText ? [] : [{ label: ( localizeWithPath(
129
- 'vs/workbench/contrib/share/browser/share.contribution',
130
- 'open link',
131
- 'Open Link'
132
- )), run: () => { urlService.open(result, { openExternal: true }); } }]
115
+ cancelButton: ( localizeWithPath(_moduleId, 4, 'Close')),
116
+ buttons: isResultText ? [] : [{ label: ( localizeWithPath(_moduleId, 5, 'Open Link')), run: () => { urlService.open(result, { openExternal: true }); } }]
133
117
  });
134
118
  }
135
119
  }
@@ -142,13 +126,13 @@ let ShareWorkbenchContribution = class ShareWorkbenchContribution {
142
126
  }
143
127
  }
144
128
  };
145
- ShareWorkbenchContribution = ShareWorkbenchContribution_1 = ( __decorate([
146
- ( __param(0, IShareService)),
147
- ( __param(1, IConfigurationService))
148
- ], ShareWorkbenchContribution));
149
- const workbenchContributionsRegistry = ( Registry.as(Extensions.Workbench));
129
+ ShareWorkbenchContribution = ShareWorkbenchContribution_1 = ( (__decorate([
130
+ ( (__param(0, IShareService))),
131
+ ( (__param(1, IConfigurationService)))
132
+ ], ShareWorkbenchContribution)));
133
+ const workbenchContributionsRegistry = ( (Registry.as(Extensions.Workbench)));
150
134
  workbenchContributionsRegistry.registerWorkbenchContribution(ShareWorkbenchContribution, 4 );
151
- ( Registry.as(Extensions$1.Configuration)).registerConfiguration({
135
+ ( (Registry.as(Extensions$1.Configuration))).registerConfiguration({
152
136
  ...workbenchConfigurationNodeBase,
153
137
  properties: {
154
138
  'workbench.experimental.share.enabled': {
@@ -156,8 +140,8 @@ workbenchContributionsRegistry.registerWorkbenchContribution(ShareWorkbenchContr
156
140
  default: false,
157
141
  tags: ['experimental'],
158
142
  markdownDescription: ( localizeWithPath(
159
- 'vs/workbench/contrib/share/browser/share.contribution',
160
- 'experimental.share.enabled',
143
+ _moduleId,
144
+ 6,
161
145
  "Controls whether to render the Share action next to the command center when {0} is {1}.",
162
146
  '`#window.commandCenter#`',
163
147
  '`true`'
@@ -8,11 +8,8 @@ import { ILabelService } from 'vscode/vscode/vs/platform/label/common/label.serv
8
8
  import { IQuickInputService } from 'vscode/vscode/vs/platform/quickinput/common/quickInput.service';
9
9
  import { ITelemetryService } from 'vscode/vscode/vs/platform/telemetry/common/telemetry.service';
10
10
 
11
- const ShareProviderCountContext = ( new RawContextKey('shareProviderCount', 0, ( localizeWithPath(
12
- 'vs/workbench/contrib/share/browser/shareService',
13
- 'shareProviderCount',
14
- "The number of available share providers"
15
- ))));
11
+ const _moduleId = "vs/workbench/contrib/share/browser/shareService";
12
+ const ShareProviderCountContext = ( (new RawContextKey('shareProviderCount', 0, ( localizeWithPath(_moduleId, 0, "The number of available share providers")))));
16
13
  let ShareService = class ShareService {
17
14
  constructor(contextKeyService, labelService, quickInputService, codeEditorService, telemetryService) {
18
15
  this.contextKeyService = contextKeyService;
@@ -20,7 +17,7 @@ let ShareService = class ShareService {
20
17
  this.quickInputService = quickInputService;
21
18
  this.codeEditorService = codeEditorService;
22
19
  this.telemetryService = telemetryService;
23
- this._providers = ( new Set());
20
+ this._providers = ( (new Set()));
24
21
  this.providerCount = ShareProviderCountContext.bindTo(this.contextKeyService);
25
22
  }
26
23
  registerShareProvider(provider) {
@@ -38,7 +35,7 @@ let ShareService = class ShareService {
38
35
  }
39
36
  async provideShare(item, token) {
40
37
  const language = this.codeEditorService.getActiveCodeEditor()?.getModel()?.getLanguageId() ?? '';
41
- const providers = [...( this._providers.values())]
38
+ const providers = [...( (this._providers.values()))]
42
39
  .filter((p) => score(p.selector, item.resourceUri, language, true, undefined, undefined) > 0)
43
40
  .sort((a, b) => a.priority - b.priority);
44
41
  if (providers.length === 0) {
@@ -48,10 +45,10 @@ let ShareService = class ShareService {
48
45
  this.telemetryService.publicLog2('shareService.share', { providerId: providers[0].id });
49
46
  return providers[0].provideShare(item, token);
50
47
  }
51
- const items = ( providers.map((p) => ({ label: p.label, provider: p })));
48
+ const items = ( (providers.map((p) => ({ label: p.label, provider: p }))));
52
49
  const selected = await this.quickInputService.pick(items, { canPickMany: false, placeHolder: ( localizeWithPath(
53
- 'vs/workbench/contrib/share/browser/shareService',
54
- 'type to filter',
50
+ _moduleId,
51
+ 1,
55
52
  'Choose how to share {0}',
56
53
  this.labelService.getUriLabel(item.resourceUri)
57
54
  )) }, token);
@@ -62,12 +59,12 @@ let ShareService = class ShareService {
62
59
  return;
63
60
  }
64
61
  };
65
- ShareService = ( __decorate([
66
- ( __param(0, IContextKeyService)),
67
- ( __param(1, ILabelService)),
68
- ( __param(2, IQuickInputService)),
69
- ( __param(3, ICodeEditorService)),
70
- ( __param(4, ITelemetryService))
71
- ], ShareService));
62
+ ShareService = ( (__decorate([
63
+ ( (__param(0, IContextKeyService))),
64
+ ( (__param(1, ILabelService))),
65
+ ( (__param(2, IQuickInputService))),
66
+ ( (__param(3, ICodeEditorService))),
67
+ ( (__param(4, ITelemetryService)))
68
+ ], ShareService)));
72
69
 
73
70
  export { ShareProviderCountContext, ShareService };
package/share.d.ts DELETED
@@ -1,5 +0,0 @@
1
- import { IEditorOverrideServices } from 'vscode/vscode/vs/editor/standalone/browser/standaloneServices';
2
-
3
- declare function getServiceOverride(): IEditorOverrideServices;
4
-
5
- export { getServiceOverride as default };