@codingame/monaco-vscode-share-service-override 23.2.2 → 24.1.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": "24.1.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "VSCode public API plugged on the monaco editor - share service-override",
|
|
6
6
|
"keywords": [],
|
|
@@ -15,8 +15,7 @@
|
|
|
15
15
|
},
|
|
16
16
|
"type": "module",
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@codingame/monaco-vscode-
|
|
19
|
-
"@codingame/monaco-vscode-api": "23.2.2"
|
|
18
|
+
"@codingame/monaco-vscode-api": "24.1.0"
|
|
20
19
|
},
|
|
21
20
|
"main": "index.js",
|
|
22
21
|
"module": "index.js",
|
|
@@ -76,7 +76,7 @@ let ShareWorkbenchContribution = class ShareWorkbenchContribution extends Dispos
|
|
|
76
76
|
}
|
|
77
77
|
this._disposables.add(registerAction2(class ShareAction extends Action2 {
|
|
78
78
|
static { this.ID = 'workbench.action.share'; }
|
|
79
|
-
static { this.LABEL = ( localize2(
|
|
79
|
+
static { this.LABEL = ( localize2(10926, 'Share...')); }
|
|
80
80
|
constructor() {
|
|
81
81
|
super({
|
|
82
82
|
id: ShareAction.ID,
|
|
@@ -105,7 +105,7 @@ let ShareWorkbenchContribution = class ShareWorkbenchContribution extends Dispos
|
|
|
105
105
|
const selection = accessor.get(ICodeEditorService).getActiveCodeEditor()?.getSelection() ?? undefined;
|
|
106
106
|
const result = await progressService.withProgress({
|
|
107
107
|
location: ProgressLocation.Window,
|
|
108
|
-
detail: ( localize(
|
|
108
|
+
detail: ( localize(10927, 'Generating link...'))
|
|
109
109
|
}, async () => shareService.provideShare({ resourceUri, selection }, CancellationToken.None));
|
|
110
110
|
if (result) {
|
|
111
111
|
const uriText = ( result.toString());
|
|
@@ -113,7 +113,7 @@ let ShareWorkbenchContribution = class ShareWorkbenchContribution extends Dispos
|
|
|
113
113
|
await clipboardService.writeText(uriText);
|
|
114
114
|
dialogService.prompt({
|
|
115
115
|
type: Severity.Info,
|
|
116
|
-
message: isResultText ? ( localize(
|
|
116
|
+
message: isResultText ? ( localize(10928, 'Copied text to clipboard!')) : ( localize(10929, 'Copied link to clipboard!')),
|
|
117
117
|
custom: {
|
|
118
118
|
icon: Codicon.check,
|
|
119
119
|
markdownDetails: [{
|
|
@@ -121,8 +121,8 @@ let ShareWorkbenchContribution = class ShareWorkbenchContribution extends Dispos
|
|
|
121
121
|
classes: [isResultText ? 'share-dialog-input-text' : 'share-dialog-input-link']
|
|
122
122
|
}]
|
|
123
123
|
},
|
|
124
|
-
cancelButton: ( localize(
|
|
125
|
-
buttons: isResultText ? [] : [{ label: ( localize(
|
|
124
|
+
cancelButton: ( localize(10930, 'Close')),
|
|
125
|
+
buttons: isResultText ? [] : [{ label: ( localize(10931, 'Open Link')), run: () => { urlService.open(result, { openExternal: true }); } }]
|
|
126
126
|
});
|
|
127
127
|
}
|
|
128
128
|
}
|
|
@@ -149,7 +149,7 @@ workbenchContributionsRegistry.registerWorkbenchContribution(ShareWorkbenchContr
|
|
|
149
149
|
default: false,
|
|
150
150
|
tags: ['experimental'],
|
|
151
151
|
markdownDescription: ( localize(
|
|
152
|
-
|
|
152
|
+
10932,
|
|
153
153
|
"Controls whether to render the Share action next to the command center when {0} is {1}.",
|
|
154
154
|
'`#window.commandCenter#`',
|
|
155
155
|
'`true`'
|
|
@@ -9,10 +9,10 @@ import { IContextKeyService } from '@codingame/monaco-vscode-api/vscode/vs/platf
|
|
|
9
9
|
import { ILabelService } from '@codingame/monaco-vscode-api/vscode/vs/platform/label/common/label.service';
|
|
10
10
|
import { IQuickInputService } from '@codingame/monaco-vscode-api/vscode/vs/platform/quickinput/common/quickInput.service';
|
|
11
11
|
import { ITelemetryService } from '@codingame/monaco-vscode-api/vscode/vs/platform/telemetry/common/telemetry.service';
|
|
12
|
-
import { ToggleTitleBarConfigAction } from '@codingame/monaco-vscode-
|
|
12
|
+
import { ToggleTitleBarConfigAction } from '@codingame/monaco-vscode-api/vscode/vs/workbench/browser/parts/titlebar/titlebarActions';
|
|
13
13
|
import { IsCompactTitleBarContext, WorkspaceFolderCountContext } from '@codingame/monaco-vscode-api/vscode/vs/workbench/common/contextkeys';
|
|
14
14
|
|
|
15
|
-
const ShareProviderCountContext = ( new RawContextKey('shareProviderCount', 0, ( localize(
|
|
15
|
+
const ShareProviderCountContext = ( new RawContextKey('shareProviderCount', 0, ( localize(10933, "The number of available share providers"))));
|
|
16
16
|
let ShareService = class ShareService {
|
|
17
17
|
constructor(contextKeyService, labelService, quickInputService, codeEditorService, telemetryService) {
|
|
18
18
|
this.contextKeyService = contextKeyService;
|
|
@@ -50,7 +50,7 @@ let ShareService = class ShareService {
|
|
|
50
50
|
}
|
|
51
51
|
const items = ( providers.map((p) => ({ label: p.label, provider: p })));
|
|
52
52
|
const selected = await this.quickInputService.pick(items, { canPickMany: false, placeHolder: ( localize(
|
|
53
|
-
|
|
53
|
+
10934,
|
|
54
54
|
'Choose how to share {0}',
|
|
55
55
|
this.labelService.getUriLabel(item.resourceUri)
|
|
56
56
|
)) }, token);
|
|
@@ -70,7 +70,7 @@ ShareService = ( __decorate([
|
|
|
70
70
|
], ShareService));
|
|
71
71
|
registerAction2(class ToggleShareControl extends ToggleTitleBarConfigAction {
|
|
72
72
|
constructor() {
|
|
73
|
-
super('workbench.experimental.share.enabled', ( localize(
|
|
73
|
+
super('workbench.experimental.share.enabled', ( localize(10935, 'Share')), ( localize(10936, "Toggle visibility of the Share action in title bar")), 3, ( ContextKeyExpr.and(( IsCompactTitleBarContext.toNegated()), ( ContextKeyExpr.has('config.window.commandCenter')), ( ContextKeyExpr.and(( ShareProviderCountContext.notEqualsTo(0)), ( WorkspaceFolderCountContext.notEqualsTo(0)))))));
|
|
74
74
|
}
|
|
75
75
|
});
|
|
76
76
|
|