@codingame/monaco-vscode-1b4486de-4fe4-59c4-9e6d-34f265ff6625-common 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/empty.js ADDED
@@ -0,0 +1 @@
1
+ export {}
package/package.json ADDED
@@ -0,0 +1,41 @@
1
+ {
2
+ "name": "@codingame/monaco-vscode-1b4486de-4fe4-59c4-9e6d-34f265ff6625-common",
3
+ "version": "12.0.0",
4
+ "private": false,
5
+ "description": "VSCode public API plugged on the monaco editor - common package (remote-agent, view-common)",
6
+ "keywords": [],
7
+ "author": {
8
+ "name": "CodinGame",
9
+ "url": "http://www.codingame.com"
10
+ },
11
+ "license": "MIT",
12
+ "repository": {
13
+ "type": "git",
14
+ "url": "git+ssh://git@github.com/CodinGame/monaco-vscode-api.git"
15
+ },
16
+ "type": "module",
17
+ "dependencies": {
18
+ "@codingame/monaco-vscode-2a94c04a-b85b-5669-b06b-89c1bfa11cb9-common": "12.0.0",
19
+ "@codingame/monaco-vscode-422642f2-7e3a-5c1c-9e1e-1d3ef1817346-common": "12.0.0",
20
+ "@codingame/monaco-vscode-65619f8f-0eab-5d8b-855a-43b6353fe527-common": "12.0.0",
21
+ "@codingame/monaco-vscode-9a1a5840-af83-5d07-a156-ba32a36c5c4b-common": "12.0.0",
22
+ "@codingame/monaco-vscode-9e888134-1a6f-58d9-b0e6-0fc047448366-common": "12.0.0",
23
+ "@codingame/monaco-vscode-a7c9ae3c-16d2-5d17-86b2-981be7094566-common": "12.0.0",
24
+ "vscode": "npm:@codingame/monaco-vscode-api@12.0.0"
25
+ },
26
+ "peerDependencies": {},
27
+ "peerDependenciesMeta": {},
28
+ "exports": {
29
+ ".": {
30
+ "default": "./empty.js"
31
+ },
32
+ "./vscode/*": {
33
+ "default": "./vscode/src/*.js",
34
+ "types": "./vscode/src/*.d.ts"
35
+ },
36
+ "./*": {
37
+ "default": "./*.js",
38
+ "types": "./*.d.ts"
39
+ }
40
+ }
41
+ }
@@ -0,0 +1,44 @@
1
+ import { CancellationToken } from "vscode/vscode/vs/base/common/cancellation";
2
+ import { Disposable, IDisposable } from "vscode/vscode/vs/base/common/lifecycle";
3
+ import { URI } from "vscode/vscode/vs/base/common/uri";
4
+ import * as languages from "vscode/vscode/vs/editor/common/languages";
5
+ import { IConfigurationService } from "vscode/vscode/vs/platform/configuration/common/configuration.service";
6
+ import { ILogService } from "vscode/vscode/vs/platform/log/common/log.service";
7
+ import { IExternalOpener } from "vscode/vscode/vs/platform/opener/common/opener";
8
+ import { IOpenerService } from "vscode/vscode/vs/platform/opener/common/opener.service";
9
+ import { IQuickInputService } from "vscode/vscode/vs/platform/quickinput/common/quickInput.service";
10
+ import { IPreferencesService } from "vscode/vscode/vs/workbench/services/preferences/common/preferences.service";
11
+ import { IExternalUriOpenerService } from "vscode/vscode/vs/workbench/contrib/externalUriOpener/common/externalUriOpenerService.service";
12
+ export interface IExternalOpenerProvider {
13
+ getOpeners(targetUri: URI): AsyncIterable<IExternalUriOpener>;
14
+ }
15
+ export interface IExternalUriOpener {
16
+ readonly id: string;
17
+ readonly label: string;
18
+ canOpen(uri: URI, token: CancellationToken): Promise<languages.ExternalUriOpenerPriority>;
19
+ openExternalUri(uri: URI, ctx: {
20
+ sourceUri: URI;
21
+ }, token: CancellationToken): Promise<boolean>;
22
+ }
23
+ export declare class ExternalUriOpenerService extends Disposable implements IExternalUriOpenerService, IExternalOpener {
24
+ private readonly configurationService;
25
+ private readonly logService;
26
+ private readonly preferencesService;
27
+ private readonly quickInputService;
28
+ readonly _serviceBrand: undefined;
29
+ private readonly _providers;
30
+ constructor(openerService: IOpenerService, configurationService: IConfigurationService, logService: ILogService, preferencesService: IPreferencesService, quickInputService: IQuickInputService);
31
+ registerExternalOpenerProvider(provider: IExternalOpenerProvider): IDisposable;
32
+ private getOpeners;
33
+ openExternal(href: string, ctx: {
34
+ sourceUri: URI;
35
+ preferredOpenerId?: string;
36
+ }, token: CancellationToken): Promise<boolean>;
37
+ getOpener(targetUri: URI, ctx: {
38
+ sourceUri: URI;
39
+ preferredOpenerId?: string;
40
+ }, token: CancellationToken): Promise<IExternalUriOpener | undefined>;
41
+ private getAllOpenersForUri;
42
+ private getConfiguredOpenerForUri;
43
+ private showOpenerPrompt;
44
+ }
@@ -0,0 +1,167 @@
1
+
2
+ import { __decorate, __param } from 'vscode/external/tslib/tslib.es6';
3
+ import { Iterable } from 'vscode/vscode/vs/base/common/iterator';
4
+ import { Disposable } from 'vscode/vscode/vs/base/common/lifecycle';
5
+ import { LinkedList } from 'vscode/vscode/vs/base/common/linkedList';
6
+ import { isWeb } from 'vscode/vscode/vs/base/common/platform';
7
+ import { URI } from 'vscode/vscode/vs/base/common/uri';
8
+ import { ExternalUriOpenerPriority } from 'vscode/vscode/vs/editor/common/languages';
9
+ import { localize } from 'vscode/vscode/vs/nls';
10
+ import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration.service';
11
+ import { ILogService } from 'vscode/vscode/vs/platform/log/common/log.service';
12
+ import { IOpenerService } from 'vscode/vscode/vs/platform/opener/common/opener.service';
13
+ import { IQuickInputService } from 'vscode/vscode/vs/platform/quickinput/common/quickInput.service';
14
+ import { defaultExternalUriOpenerId, externalUriOpenersSettingId } from '@codingame/monaco-vscode-2a94c04a-b85b-5669-b06b-89c1bfa11cb9-common/vscode/vs/workbench/contrib/externalUriOpener/common/configuration';
15
+ import { testUrlMatchesGlob } from '@codingame/monaco-vscode-9a1a5840-af83-5d07-a156-ba32a36c5c4b-common/vscode/vs/workbench/contrib/url/common/urlGlob';
16
+ import { IPreferencesService } from 'vscode/vscode/vs/workbench/services/preferences/common/preferences.service';
17
+
18
+ let ExternalUriOpenerService = class ExternalUriOpenerService extends Disposable {
19
+ constructor(openerService, configurationService, logService, preferencesService, quickInputService) {
20
+ super();
21
+ this.configurationService = configurationService;
22
+ this.logService = logService;
23
+ this.preferencesService = preferencesService;
24
+ this.quickInputService = quickInputService;
25
+ this._providers = ( new LinkedList());
26
+ this._register(openerService.registerExternalOpener(this));
27
+ }
28
+ registerExternalOpenerProvider(provider) {
29
+ const remove = this._providers.push(provider);
30
+ return { dispose: remove };
31
+ }
32
+ async getOpeners(targetUri, allowOptional, ctx, token) {
33
+ const allOpeners = await this.getAllOpenersForUri(targetUri);
34
+ if (allOpeners.size === 0) {
35
+ return [];
36
+ }
37
+ if (ctx.preferredOpenerId) {
38
+ if (ctx.preferredOpenerId === defaultExternalUriOpenerId) {
39
+ return [];
40
+ }
41
+ const preferredOpener = allOpeners.get(ctx.preferredOpenerId);
42
+ if (preferredOpener) {
43
+ return [preferredOpener];
44
+ }
45
+ }
46
+ const configuredOpener = this.getConfiguredOpenerForUri(allOpeners, targetUri);
47
+ if (configuredOpener) {
48
+ return configuredOpener === defaultExternalUriOpenerId ? [] : [configuredOpener];
49
+ }
50
+ const validOpeners = [];
51
+ await Promise.all(( Array.from(( allOpeners.values())).map(async (opener) => {
52
+ let priority;
53
+ try {
54
+ priority = await opener.canOpen(ctx.sourceUri, token);
55
+ }
56
+ catch (e) {
57
+ this.logService.error(e);
58
+ return;
59
+ }
60
+ switch (priority) {
61
+ case ExternalUriOpenerPriority.Option:
62
+ case ExternalUriOpenerPriority.Default:
63
+ case ExternalUriOpenerPriority.Preferred:
64
+ validOpeners.push({ opener, priority });
65
+ break;
66
+ }
67
+ })));
68
+ if (validOpeners.length === 0) {
69
+ return [];
70
+ }
71
+ const preferred = validOpeners.filter(x => x.priority === ExternalUriOpenerPriority.Preferred).at(0);
72
+ if (preferred) {
73
+ return [preferred.opener];
74
+ }
75
+ if (!allowOptional && validOpeners.every(x => x.priority === ExternalUriOpenerPriority.Option)) {
76
+ return [];
77
+ }
78
+ return ( validOpeners.map(value => value.opener));
79
+ }
80
+ async openExternal(href, ctx, token) {
81
+ const targetUri = typeof href === 'string' ? ( URI.parse(href)) : href;
82
+ const allOpeners = await this.getOpeners(targetUri, false, ctx, token);
83
+ if (allOpeners.length === 0) {
84
+ return false;
85
+ }
86
+ else if (allOpeners.length === 1) {
87
+ return allOpeners[0].openExternalUri(targetUri, ctx, token);
88
+ }
89
+ return this.showOpenerPrompt(allOpeners, targetUri, ctx, token);
90
+ }
91
+ async getOpener(targetUri, ctx, token) {
92
+ const allOpeners = await this.getOpeners(targetUri, true, ctx, token);
93
+ if (allOpeners.length >= 1) {
94
+ return allOpeners[0];
95
+ }
96
+ return undefined;
97
+ }
98
+ async getAllOpenersForUri(targetUri) {
99
+ const allOpeners = ( new Map());
100
+ await Promise.all(( Iterable.map(this._providers, async (provider) => {
101
+ for await (const opener of provider.getOpeners(targetUri)) {
102
+ allOpeners.set(opener.id, opener);
103
+ }
104
+ })));
105
+ return allOpeners;
106
+ }
107
+ getConfiguredOpenerForUri(openers, targetUri) {
108
+ const config = this.configurationService.getValue(externalUriOpenersSettingId) || {};
109
+ for (const [uriGlob, id] of Object.entries(config)) {
110
+ if (testUrlMatchesGlob(targetUri, uriGlob)) {
111
+ if (id === defaultExternalUriOpenerId) {
112
+ return 'default';
113
+ }
114
+ const entry = openers.get(id);
115
+ if (entry) {
116
+ return entry;
117
+ }
118
+ }
119
+ }
120
+ return undefined;
121
+ }
122
+ async showOpenerPrompt(openers, targetUri, ctx, token) {
123
+ const items = ( openers.map((opener) => {
124
+ return {
125
+ label: opener.label,
126
+ opener: opener
127
+ };
128
+ }));
129
+ items.push({
130
+ label: isWeb
131
+ ? ( localize(6330, 'Open in new browser window'))
132
+ : ( localize(6331, 'Open in default browser')),
133
+ opener: undefined
134
+ }, { type: 'separator' }, {
135
+ label: ( localize(6332, "Configure default opener...")),
136
+ opener: 'configureDefault'
137
+ });
138
+ const picked = await this.quickInputService.pick(items, {
139
+ placeHolder: ( localize(6333, "How would you like to open: {0}", (targetUri.toString())))
140
+ });
141
+ if (!picked) {
142
+ return true;
143
+ }
144
+ if (typeof picked.opener === 'undefined') {
145
+ return false;
146
+ }
147
+ else if (picked.opener === 'configureDefault') {
148
+ await this.preferencesService.openUserSettings({
149
+ jsonEditor: true,
150
+ revealSetting: { key: externalUriOpenersSettingId, edit: true }
151
+ });
152
+ return true;
153
+ }
154
+ else {
155
+ return picked.opener.openExternalUri(targetUri, ctx, token);
156
+ }
157
+ }
158
+ };
159
+ ExternalUriOpenerService = ( __decorate([
160
+ ( __param(0, IOpenerService)),
161
+ ( __param(1, IConfigurationService)),
162
+ ( __param(2, ILogService)),
163
+ ( __param(3, IPreferencesService)),
164
+ ( __param(4, IQuickInputService))
165
+ ], ExternalUriOpenerService));
166
+
167
+ export { ExternalUriOpenerService };
@@ -0,0 +1,6 @@
1
+ import n from 'vscode/external/rollup-plugin-styles/dist/runtime/inject-css';
2
+
3
+ var css = ".ports-view .monaco-icon-label,.ports-view .monaco-list .monaco-list-row.focused .monaco-icon-label,.ports-view .monaco-list .monaco-list-row:hover:not(.highlighted) .monaco-icon-label{flex:1}.ports-view .monaco-list .monaco-list-row .actionBarContainer{flex:1 0 auto;flex:0 0 auto;text-align:right}.ports-view .monaco-list .monaco-list-row .ports-view-actionbar-cell{display:flex;flex:1;flex-wrap:nowrap;height:22px;overflow:hidden;text-overflow:ellipsis}.ports-view .monaco-list .monaco-list-row .ports-view-actionbar-cell .monaco-inputbox{flex:1;height:22px;line-height:19px}.ports-view .monaco-list .monaco-list-row .ports-view-actionbar-cell .monaco-inputbox input{margin-top:-40px}.ports-view .monaco-list .monaco-list-row .ports-view-actionbar-cell .ports-view-actionbar-cell-localaddress{color:var(--vscode-textLink-foreground);text-decoration:var(--text-link-decoration)}.ports-view .monaco-list .monaco-list-row .ports-view-actionbar-cell .ports-view-actionbar-cell-localaddress:hover{text-decoration:underline}.ports-view .monaco-table-td[data-col-index=\"0\"],.ports-view .monaco-table-th,.ports-view .monaco-table-th[data-col-index=\"0\"]{padding-left:10px}.ports-view .monaco-list .monaco-list-row .ports-view-actionbar-cell .monaco-button{line-height:1.4em;margin-bottom:3px;margin-left:3px;margin-top:4px;padding:2px 14px;width:auto}.ports-view .monaco-list .monaco-list-row .ports-view-actionbar-cell>.ports-view-actionbar-cell-icon.codicon{margin-top:3px;padding-right:3px}.ports-view .monaco-list .monaco-list-row.selected .ports-view-actionbar-cell>.ports-view-actionbar-cell-icon.codicon{color:currentColor!important}.ports-view .monaco-list .monaco-list-row .ports-view-actionbar-cell .ports-view-actionbar-cell-resourceLabel .monaco-icon-label-container>.monaco-icon-name-container{flex:1}.ports-view .monaco-list .monaco-list-row .ports-view-actionbar-cell .ports-view-actionbar-cell-resourceLabel:after{padding-right:0}.ports-view .monaco-list .monaco-list-row .ports-view-actionbar-cell .actions{display:none}.ports-view .monaco-list .monaco-list-row.focused .ports-view-actionbar-cell .actions,.ports-view .monaco-list .monaco-list-row.selected .ports-view-actionbar-cell .actions,.ports-view .monaco-list .monaco-list-row:hover .ports-view-actionbar-cell .actions{display:block}.ports-view .monaco-list .ports-view-actionbar-cell .actions .action-label{background-position:50% 50%;background-repeat:no-repeat;background-size:16px;height:100%;padding:2px;width:16px}.monaco-workbench .codicon.codicon-ports-forwarded-with-process-icon{color:var(--vscode-ports-iconRunningProcessForeground)}";
4
+ n(css,{});
5
+
6
+ export { css, css as default };
@@ -0,0 +1,66 @@
1
+ import { Disposable } from "vscode/vscode/vs/base/common/lifecycle";
2
+ import { IWorkbenchContribution } from "vscode/vscode/vs/workbench/common/contributions";
3
+ import { IRemoteExplorerService } from "vscode/vscode/vs/workbench/services/remote/common/remoteExplorerService.service";
4
+ import { IContextKeyService } from "vscode/vscode/vs/platform/contextkey/common/contextkey.service";
5
+ import { IWorkbenchEnvironmentService } from "vscode/vscode/vs/workbench/services/environment/common/environmentService.service";
6
+ import { IStatusbarService } from "vscode/vscode/vs/workbench/services/statusbar/browser/statusbar.service";
7
+ import { INotificationService } from "vscode/vscode/vs/platform/notification/common/notification.service";
8
+ import { IOpenerService } from "vscode/vscode/vs/platform/opener/common/opener.service";
9
+ import { ITerminalService } from "vscode/vscode/vs/workbench/contrib/terminal/browser/terminal.service";
10
+ import { IDebugService } from "vscode/vscode/vs/workbench/contrib/debug/common/debug.service";
11
+ import { IRemoteAgentService } from "vscode/vscode/vs/workbench/services/remote/common/remoteAgentService.service";
12
+ import { ITunnelService } from "vscode/vscode/vs/platform/tunnel/common/tunnel.service";
13
+ import { IActivityService } from "vscode/vscode/vs/workbench/services/activity/common/activity.service";
14
+ import { IExternalUriOpenerService } from "vscode/vscode/vs/workbench/contrib/externalUriOpener/common/externalUriOpenerService.service";
15
+ import { IHostService } from "vscode/vscode/vs/workbench/services/host/browser/host.service";
16
+ import { ILogService } from "vscode/vscode/vs/platform/log/common/log.service";
17
+ import { IWorkbenchConfigurationService } from "@codingame/monaco-vscode-422642f2-7e3a-5c1c-9e1e-1d3ef1817346-common/vscode/vs/workbench/services/configuration/common/configuration.service";
18
+ import { IPreferencesService } from "vscode/vscode/vs/workbench/services/preferences/common/preferences.service";
19
+ import { IStorageService } from "vscode/vscode/vs/platform/storage/common/storage.service";
20
+ export declare const VIEWLET_ID = "workbench.view.remote";
21
+ export declare class ForwardedPortsView extends Disposable implements IWorkbenchContribution {
22
+ private readonly contextKeyService;
23
+ private readonly environmentService;
24
+ private readonly remoteExplorerService;
25
+ private readonly tunnelService;
26
+ private readonly activityService;
27
+ private readonly statusbarService;
28
+ private readonly contextKeyListener;
29
+ private readonly activityBadge;
30
+ private entryAccessor;
31
+ constructor(contextKeyService: IContextKeyService, environmentService: IWorkbenchEnvironmentService, remoteExplorerService: IRemoteExplorerService, tunnelService: ITunnelService, activityService: IActivityService, statusbarService: IStatusbarService);
32
+ private getViewContainer;
33
+ private enableForwardedPortsFeatures;
34
+ private enableBadgeAndStatusBar;
35
+ private updateActivityBadge;
36
+ private updateStatusBar;
37
+ private get entry();
38
+ }
39
+ export declare class PortRestore implements IWorkbenchContribution {
40
+ private readonly remoteExplorerService;
41
+ private readonly logService;
42
+ constructor(remoteExplorerService: IRemoteExplorerService, logService: ILogService);
43
+ private restore;
44
+ }
45
+ export declare class AutomaticPortForwarding extends Disposable implements IWorkbenchContribution {
46
+ private readonly terminalService;
47
+ private readonly notificationService;
48
+ private readonly openerService;
49
+ private readonly externalOpenerService;
50
+ private readonly remoteExplorerService;
51
+ private readonly contextKeyService;
52
+ private readonly configurationService;
53
+ private readonly debugService;
54
+ private readonly tunnelService;
55
+ private readonly hostService;
56
+ private readonly logService;
57
+ private readonly storageService;
58
+ private readonly preferencesService;
59
+ private procForwarder;
60
+ private outputForwarder;
61
+ private portListener;
62
+ constructor(terminalService: ITerminalService, notificationService: INotificationService, openerService: IOpenerService, externalOpenerService: IExternalUriOpenerService, remoteExplorerService: IRemoteExplorerService, environmentService: IWorkbenchEnvironmentService, contextKeyService: IContextKeyService, configurationService: IWorkbenchConfigurationService, debugService: IDebugService, remoteAgentService: IRemoteAgentService, tunnelService: ITunnelService, hostService: IHostService, logService: ILogService, storageService: IStorageService, preferencesService: IPreferencesService);
63
+ private getPortAutoFallbackNumber;
64
+ private listenForPorts;
65
+ private setup;
66
+ }