@codingame/monaco-vscode-share-service-override 13.1.7 → 14.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-share-service-override",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "14.0.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "VSCode public API plugged on the monaco editor - share service-override",
|
|
6
6
|
"keywords": [],
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
},
|
|
16
16
|
"type": "module",
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@codingame/monaco-vscode-api": "
|
|
18
|
+
"@codingame/monaco-vscode-api": "14.0.0"
|
|
19
19
|
},
|
|
20
20
|
"main": "index.js",
|
|
21
21
|
"module": "index.js",
|
|
@@ -29,7 +29,7 @@ import { IProgressService } from '@codingame/monaco-vscode-api/vscode/vs/platfor
|
|
|
29
29
|
import { ICodeEditorService } from '@codingame/monaco-vscode-api/vscode/vs/editor/browser/services/codeEditorService';
|
|
30
30
|
import { Extensions as Extensions$1 } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configurationRegistry';
|
|
31
31
|
import { workbenchConfigurationNodeBase } from '@codingame/monaco-vscode-api/vscode/vs/workbench/common/configuration';
|
|
32
|
-
import { DisposableStore } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
32
|
+
import { Disposable, DisposableStore } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
33
33
|
import Severity from '@codingame/monaco-vscode-api/vscode/vs/base/common/severity';
|
|
34
34
|
|
|
35
35
|
var ShareWorkbenchContribution_1;
|
|
@@ -41,16 +41,17 @@ const targetMenus = [
|
|
|
41
41
|
MenuId.MenubarShare,
|
|
42
42
|
MenuId.ExplorerContextShare
|
|
43
43
|
];
|
|
44
|
-
let ShareWorkbenchContribution = class ShareWorkbenchContribution {
|
|
44
|
+
let ShareWorkbenchContribution = class ShareWorkbenchContribution extends Disposable {
|
|
45
45
|
static { ShareWorkbenchContribution_1 = this; }
|
|
46
46
|
static { this.SHARE_ENABLED_SETTING = 'workbench.experimental.share.enabled'; }
|
|
47
47
|
constructor(shareService, configurationService) {
|
|
48
|
+
super();
|
|
48
49
|
this.shareService = shareService;
|
|
49
50
|
this.configurationService = configurationService;
|
|
50
51
|
if (this.configurationService.getValue(ShareWorkbenchContribution_1.SHARE_ENABLED_SETTING)) {
|
|
51
52
|
this.registerActions();
|
|
52
53
|
}
|
|
53
|
-
this.configurationService.onDidChangeConfiguration(e => {
|
|
54
|
+
this._register(this.configurationService.onDidChangeConfiguration(e => {
|
|
54
55
|
if (e.affectsConfiguration(ShareWorkbenchContribution_1.SHARE_ENABLED_SETTING)) {
|
|
55
56
|
const settingValue = this.configurationService.getValue(ShareWorkbenchContribution_1.SHARE_ENABLED_SETTING);
|
|
56
57
|
if (settingValue === true && this._disposables === undefined) {
|
|
@@ -61,7 +62,11 @@ let ShareWorkbenchContribution = class ShareWorkbenchContribution {
|
|
|
61
62
|
this._disposables = undefined;
|
|
62
63
|
}
|
|
63
64
|
}
|
|
64
|
-
});
|
|
65
|
+
}));
|
|
66
|
+
}
|
|
67
|
+
dispose() {
|
|
68
|
+
super.dispose();
|
|
69
|
+
this._disposables?.dispose();
|
|
65
70
|
}
|
|
66
71
|
registerActions() {
|
|
67
72
|
if (!this._disposables) {
|
|
@@ -69,7 +74,7 @@ let ShareWorkbenchContribution = class ShareWorkbenchContribution {
|
|
|
69
74
|
}
|
|
70
75
|
this._disposables.add(registerAction2(class ShareAction extends Action2 {
|
|
71
76
|
static { this.ID = 'workbench.action.share'; }
|
|
72
|
-
static { this.LABEL = ( localize2(
|
|
77
|
+
static { this.LABEL = ( localize2(9053, 'Share...')); }
|
|
73
78
|
constructor() {
|
|
74
79
|
super({
|
|
75
80
|
id: ShareAction.ID,
|
|
@@ -98,7 +103,7 @@ let ShareWorkbenchContribution = class ShareWorkbenchContribution {
|
|
|
98
103
|
const selection = accessor.get(ICodeEditorService).getActiveCodeEditor()?.getSelection() ?? undefined;
|
|
99
104
|
const result = await progressService.withProgress({
|
|
100
105
|
location: ProgressLocation.Window,
|
|
101
|
-
detail: ( localize(
|
|
106
|
+
detail: ( localize(9054, 'Generating link...'))
|
|
102
107
|
}, async () => shareService.provideShare({ resourceUri, selection }, CancellationToken.None));
|
|
103
108
|
if (result) {
|
|
104
109
|
const uriText = ( result.toString());
|
|
@@ -106,7 +111,7 @@ let ShareWorkbenchContribution = class ShareWorkbenchContribution {
|
|
|
106
111
|
await clipboardService.writeText(uriText);
|
|
107
112
|
dialogService.prompt({
|
|
108
113
|
type: Severity.Info,
|
|
109
|
-
message: isResultText ? ( localize(
|
|
114
|
+
message: isResultText ? ( localize(9055, 'Copied text to clipboard!')) : ( localize(9056, 'Copied link to clipboard!')),
|
|
110
115
|
custom: {
|
|
111
116
|
icon: Codicon.check,
|
|
112
117
|
markdownDetails: [{
|
|
@@ -114,8 +119,8 @@ let ShareWorkbenchContribution = class ShareWorkbenchContribution {
|
|
|
114
119
|
classes: [isResultText ? 'share-dialog-input-text' : 'share-dialog-input-link']
|
|
115
120
|
}]
|
|
116
121
|
},
|
|
117
|
-
cancelButton: ( localize(
|
|
118
|
-
buttons: isResultText ? [] : [{ label: ( localize(
|
|
122
|
+
cancelButton: ( localize(9057, 'Close')),
|
|
123
|
+
buttons: isResultText ? [] : [{ label: ( localize(9058, 'Open Link')), run: () => { urlService.open(result, { openExternal: true }); } }]
|
|
119
124
|
});
|
|
120
125
|
}
|
|
121
126
|
}
|
|
@@ -142,7 +147,7 @@ workbenchContributionsRegistry.registerWorkbenchContribution(ShareWorkbenchContr
|
|
|
142
147
|
default: false,
|
|
143
148
|
tags: ['experimental'],
|
|
144
149
|
markdownDescription: ( localize(
|
|
145
|
-
|
|
150
|
+
9059,
|
|
146
151
|
"Controls whether to render the Share action next to the command center when {0} is {1}.",
|
|
147
152
|
'`#window.commandCenter#`',
|
|
148
153
|
'`true`'
|
|
@@ -3,13 +3,16 @@ import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib
|
|
|
3
3
|
import { ICodeEditorService } from '@codingame/monaco-vscode-api/vscode/vs/editor/browser/services/codeEditorService';
|
|
4
4
|
import { score } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/languageSelector';
|
|
5
5
|
import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
|
|
6
|
-
import {
|
|
6
|
+
import { registerAction2 } from '@codingame/monaco-vscode-api/vscode/vs/platform/actions/common/actions';
|
|
7
|
+
import { RawContextKey, ContextKeyExpr } from '@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey';
|
|
7
8
|
import { IContextKeyService } from '@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey.service';
|
|
8
9
|
import { ILabelService } from '@codingame/monaco-vscode-api/vscode/vs/platform/label/common/label.service';
|
|
9
10
|
import { IQuickInputService } from '@codingame/monaco-vscode-api/vscode/vs/platform/quickinput/common/quickInput.service';
|
|
10
11
|
import { ITelemetryService } from '@codingame/monaco-vscode-api/vscode/vs/platform/telemetry/common/telemetry.service';
|
|
12
|
+
import { ToggleTitleBarConfigAction } from '@codingame/monaco-vscode-api/vscode/vs/workbench/browser/parts/titlebar/titlebarActions';
|
|
13
|
+
import { WorkspaceFolderCountContext } from '@codingame/monaco-vscode-api/vscode/vs/workbench/common/contextkeys';
|
|
11
14
|
|
|
12
|
-
const ShareProviderCountContext = ( new RawContextKey('shareProviderCount', 0, ( localize(
|
|
15
|
+
const ShareProviderCountContext = ( new RawContextKey('shareProviderCount', 0, ( localize(9060, "The number of available share providers"))));
|
|
13
16
|
let ShareService = class ShareService {
|
|
14
17
|
constructor(contextKeyService, labelService, quickInputService, codeEditorService, telemetryService) {
|
|
15
18
|
this.contextKeyService = contextKeyService;
|
|
@@ -47,7 +50,7 @@ let ShareService = class ShareService {
|
|
|
47
50
|
}
|
|
48
51
|
const items = ( providers.map((p) => ({ label: p.label, provider: p })));
|
|
49
52
|
const selected = await this.quickInputService.pick(items, { canPickMany: false, placeHolder: ( localize(
|
|
50
|
-
|
|
53
|
+
9061,
|
|
51
54
|
'Choose how to share {0}',
|
|
52
55
|
this.labelService.getUriLabel(item.resourceUri)
|
|
53
56
|
)) }, token);
|
|
@@ -65,5 +68,10 @@ ShareService = ( __decorate([
|
|
|
65
68
|
( __param(3, ICodeEditorService)),
|
|
66
69
|
( __param(4, ITelemetryService))
|
|
67
70
|
], ShareService));
|
|
71
|
+
registerAction2(class ToggleShareControl extends ToggleTitleBarConfigAction {
|
|
72
|
+
constructor() {
|
|
73
|
+
super('workbench.experimental.share.enabled', ( localize(9062, 'Share')), ( localize(9063, "Toggle visibility of the Share action in title bar")), 3, false, ( ContextKeyExpr.and(( ContextKeyExpr.has('config.window.commandCenter')), ( ContextKeyExpr.and(( ShareProviderCountContext.notEqualsTo(0)), ( WorkspaceFolderCountContext.notEqualsTo(0)))))));
|
|
74
|
+
}
|
|
75
|
+
});
|
|
68
76
|
|
|
69
77
|
export { ShareProviderCountContext, ShareService };
|