@opensumi/ide-terminal-next 3.7.1 → 3.7.2-next-1739848467.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/lib/browser/component/resize.view.d.ts.map +1 -1
- package/lib/browser/component/resize.view.js +2 -2
- package/lib/browser/component/resize.view.js.map +1 -1
- package/lib/browser/component/tab.item.d.ts.map +1 -1
- package/lib/browser/component/tab.item.js +23 -1
- package/lib/browser/component/tab.item.js.map +1 -1
- package/lib/browser/component/tab.view.d.ts.map +1 -1
- package/lib/browser/component/tab.view.js +10 -1
- package/lib/browser/component/tab.view.js.map +1 -1
- package/lib/browser/component/terminal.module.less +6 -0
- package/lib/browser/component/terminal.widget.d.ts.map +1 -1
- package/lib/browser/component/terminal.widget.js +9 -3
- package/lib/browser/component/terminal.widget.js.map +1 -1
- package/lib/browser/contribution/terminal.view.d.ts.map +1 -1
- package/lib/browser/contribution/terminal.view.js +2 -0
- package/lib/browser/contribution/terminal.view.js.map +1 -1
- package/lib/browser/links/link-manager.d.ts.map +1 -1
- package/lib/browser/links/link-manager.js +10 -7
- package/lib/browser/links/link-manager.js.map +1 -1
- package/lib/browser/links/validated-local-link-provider.d.ts +1 -0
- package/lib/browser/links/validated-local-link-provider.d.ts.map +1 -1
- package/lib/browser/links/validated-local-link-provider.js +55 -42
- package/lib/browser/links/validated-local-link-provider.js.map +1 -1
- package/lib/browser/links/word-link-provider.d.ts +29 -0
- package/lib/browser/links/word-link-provider.d.ts.map +1 -0
- package/lib/browser/links/word-link-provider.js +153 -0
- package/lib/browser/links/word-link-provider.js.map +1 -0
- package/lib/browser/terminal.controller.d.ts +1 -2
- package/lib/browser/terminal.controller.d.ts.map +1 -1
- package/lib/browser/terminal.controller.js +6 -6
- package/lib/browser/terminal.controller.js.map +1 -1
- package/lib/browser/terminal.hover.manager.d.ts.map +1 -1
- package/lib/browser/terminal.hover.manager.js +4 -2
- package/lib/browser/terminal.hover.manager.js.map +1 -1
- package/lib/browser/terminal.view.d.ts +6 -5
- package/lib/browser/terminal.view.d.ts.map +1 -1
- package/lib/browser/terminal.view.js +13 -0
- package/lib/browser/terminal.view.js.map +1 -1
- package/lib/common/controller.d.ts +1 -0
- package/lib/common/controller.d.ts.map +1 -1
- package/lib/common/controller.js.map +1 -1
- package/lib/common/pty.d.ts +1 -1
- package/lib/common/pty.d.ts.map +1 -1
- package/lib/common/render.d.ts +3 -0
- package/lib/common/render.d.ts.map +1 -1
- package/lib/common/render.js.map +1 -1
- package/package.json +18 -18
- package/src/browser/component/resize.view.tsx +2 -1
- package/src/browser/component/tab.item.tsx +38 -0
- package/src/browser/component/tab.view.tsx +12 -0
- package/src/browser/component/terminal.module.less +6 -0
- package/src/browser/component/terminal.widget.tsx +8 -3
- package/src/browser/contribution/terminal.view.ts +2 -0
- package/src/browser/links/link-manager.ts +11 -8
- package/src/browser/links/validated-local-link-provider.ts +68 -48
- package/src/browser/links/word-link-provider.ts +175 -0
- package/src/browser/terminal.controller.ts +7 -8
- package/src/browser/terminal.hover.manager.ts +4 -4
- package/src/browser/terminal.view.ts +17 -0
- package/src/common/controller.ts +2 -0
- package/src/common/pty.ts +1 -1
- package/src/common/render.ts +3 -0
- package/src/common/xterm-private.d.ts +7 -4
|
@@ -23,7 +23,6 @@ import {
|
|
|
23
23
|
} from '@opensumi/ide-core-common';
|
|
24
24
|
import { WorkbenchEditorService } from '@opensumi/ide-editor';
|
|
25
25
|
import { IMainLayoutService } from '@opensumi/ide-main-layout';
|
|
26
|
-
import { TabBarHandler } from '@opensumi/ide-main-layout/lib/browser/tabbar-handler';
|
|
27
26
|
import { IThemeService } from '@opensumi/ide-theme';
|
|
28
27
|
|
|
29
28
|
import {
|
|
@@ -62,7 +61,6 @@ import { TerminalGroupViewService } from './terminal.view';
|
|
|
62
61
|
@Injectable()
|
|
63
62
|
export class TerminalController extends WithEventBus implements ITerminalController {
|
|
64
63
|
protected _focus: boolean;
|
|
65
|
-
protected _tabBarHandler: TabBarHandler | undefined;
|
|
66
64
|
protected _clients: Map<string, ITerminalClient>;
|
|
67
65
|
protected _onDidOpenTerminal = new Emitter<ITerminalInfo>();
|
|
68
66
|
protected _onDidCloseTerminal = new Emitter<ITerminalExitEvent>();
|
|
@@ -199,6 +197,10 @@ export class TerminalController extends WithEventBus implements ITerminalControl
|
|
|
199
197
|
return this._clientId;
|
|
200
198
|
}
|
|
201
199
|
|
|
200
|
+
get _tabBarHandler() {
|
|
201
|
+
return this.layoutService.getTabbarHandler(TERMINAL_CONTAINER_ID);
|
|
202
|
+
}
|
|
203
|
+
|
|
202
204
|
private async _createClientOrIgnore(widget: IWidget) {
|
|
203
205
|
if (this._clients.has(widget.id)) {
|
|
204
206
|
return this._clients.get(widget.id)!;
|
|
@@ -397,11 +399,9 @@ export class TerminalController extends WithEventBus implements ITerminalControl
|
|
|
397
399
|
}
|
|
398
400
|
|
|
399
401
|
initContextKey(dom: HTMLDivElement) {
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
this.terminalContextKey.isTerminalViewInitialized.set(true);
|
|
404
|
-
}
|
|
402
|
+
this.terminalContextKey = this.injector.get(TerminalContextKey, [dom]);
|
|
403
|
+
this.terminalContextKey.isTerminalFocused.set(this._focus);
|
|
404
|
+
this.terminalContextKey.isTerminalViewInitialized.set(true);
|
|
405
405
|
}
|
|
406
406
|
|
|
407
407
|
async firstInitialize() {
|
|
@@ -418,7 +418,6 @@ export class TerminalController extends WithEventBus implements ITerminalControl
|
|
|
418
418
|
}),
|
|
419
419
|
]);
|
|
420
420
|
|
|
421
|
-
this._tabBarHandler = this.layoutService.getTabbarHandler(TERMINAL_CONTAINER_ID);
|
|
422
421
|
this.themeBackground = this.terminalTheme.terminalTheme.background || '';
|
|
423
422
|
|
|
424
423
|
this.addDispose(
|
|
@@ -14,10 +14,12 @@ export class TerminalHoverManagerService implements ITerminalHoverManagerService
|
|
|
14
14
|
private hoverWidget: HTMLElement | undefined;
|
|
15
15
|
|
|
16
16
|
private appendTerminalHoverOverlay() {
|
|
17
|
-
|
|
17
|
+
let overlayContainer = document.querySelector('#terminal-link-hover-overlay');
|
|
18
18
|
|
|
19
19
|
if (!overlayContainer) {
|
|
20
|
-
|
|
20
|
+
overlayContainer = document.createElement('div');
|
|
21
|
+
overlayContainer.id = 'terminal-link-hover-overlay';
|
|
22
|
+
document.body.appendChild(overlayContainer);
|
|
21
23
|
}
|
|
22
24
|
|
|
23
25
|
const overlay = document.createElement('div');
|
|
@@ -72,13 +74,11 @@ export class TerminalHoverManagerService implements ITerminalHoverManagerService
|
|
|
72
74
|
this.hoverWidget.style.top = `${
|
|
73
75
|
(viewportRange.start.y - 1) * cellDimensions.height + boundingClientRect.y - TIPS_OFFSET_Y
|
|
74
76
|
}px`;
|
|
75
|
-
|
|
76
77
|
let tooltipsLeft = viewportRange.start.x * cellDimensions.width + boundingClientRect.x + TIPS_OFFSET_X;
|
|
77
78
|
// if the tooltip is too close to the right edge of the terminal, move it to the left
|
|
78
79
|
if (tooltipsLeft + this.hoverWidget.clientWidth > boundingClientRect.x + boundingClientRect.width) {
|
|
79
80
|
tooltipsLeft = boundingClientRect.x + boundingClientRect.width - this.hoverWidget.clientWidth - TIPS_OFFSET_X;
|
|
80
81
|
}
|
|
81
|
-
|
|
82
82
|
this.hoverWidget.style.left = `${tooltipsLeft}px`;
|
|
83
83
|
}
|
|
84
84
|
});
|
|
@@ -275,6 +275,23 @@ export class TerminalGroupViewService implements ITerminalGroupViewService {
|
|
|
275
275
|
return this.groups.get()[index];
|
|
276
276
|
}
|
|
277
277
|
|
|
278
|
+
swapGroup(i: number, j: number) {
|
|
279
|
+
const groups = this.groups.get();
|
|
280
|
+
|
|
281
|
+
if (i === -1 || j === -1) {
|
|
282
|
+
return;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
const newGroups = [...groups];
|
|
286
|
+
const temp = newGroups[i];
|
|
287
|
+
newGroups[i] = newGroups[j];
|
|
288
|
+
newGroups[j] = temp;
|
|
289
|
+
|
|
290
|
+
transaction((tx) => {
|
|
291
|
+
this.groups.set(newGroups, tx);
|
|
292
|
+
});
|
|
293
|
+
}
|
|
294
|
+
|
|
278
295
|
private _doSelectGroup(index: number) {
|
|
279
296
|
const group = this.getGroup(index);
|
|
280
297
|
transaction((tx) => {
|
package/src/common/controller.ts
CHANGED
|
@@ -140,6 +140,8 @@ export interface ITerminalGroupViewService {
|
|
|
140
140
|
selectGroup(index: number): void;
|
|
141
141
|
removeGroup(index: number): void;
|
|
142
142
|
|
|
143
|
+
swapGroup(i: number, j: number): void;
|
|
144
|
+
|
|
143
145
|
createWidget(group: IWidgetGroup, id?: string, reuse?: boolean, isSimpleWidget?: boolean): IWidget;
|
|
144
146
|
getWidget(id: string): IWidget;
|
|
145
147
|
selectWidget(widgetId: string): void;
|
package/src/common/pty.ts
CHANGED
|
@@ -539,7 +539,7 @@ export interface IShellLaunchConfig {
|
|
|
539
539
|
/**
|
|
540
540
|
* The color ID to use for this terminal. If not specified it will use the default fallback
|
|
541
541
|
*/
|
|
542
|
-
color?: vscode.ThemeColor;
|
|
542
|
+
color?: string | vscode.ThemeColor;
|
|
543
543
|
|
|
544
544
|
/**
|
|
545
545
|
* When a parent terminal is provided via API, the group needs
|
package/src/common/render.ts
CHANGED
|
@@ -18,8 +18,11 @@ export interface ItemProps {
|
|
|
18
18
|
onDropdown?: (event: React.MouseEvent<HTMLElement>) => void;
|
|
19
19
|
onContextMenu?: (event: React.MouseEvent<HTMLElement>) => void;
|
|
20
20
|
getKeybinding?: (command: string) => string;
|
|
21
|
+
onDrop?: (event: React.DragEvent) => void;
|
|
22
|
+
onDragStart?: (event: React.DragEvent) => void;
|
|
21
23
|
provider: ITerminalRenderProvider;
|
|
22
24
|
theme: ThemeType;
|
|
25
|
+
draggable?: boolean;
|
|
23
26
|
}
|
|
24
27
|
|
|
25
28
|
export const ITerminalRenderProvider = Symbol('TerminalRenderProvider');
|
|
@@ -25,13 +25,16 @@ export interface XTermCore {
|
|
|
25
25
|
|
|
26
26
|
_renderService: {
|
|
27
27
|
dimensions: {
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
css: {
|
|
29
|
+
cell: {
|
|
30
|
+
width: number;
|
|
31
|
+
height: number;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
30
34
|
};
|
|
31
35
|
_renderer: {
|
|
32
|
-
|
|
36
|
+
value?: unknown;
|
|
33
37
|
};
|
|
34
|
-
_onIntersectionChange: any;
|
|
35
38
|
};
|
|
36
39
|
}
|
|
37
40
|
|