@theia/core 1.60.0-next.47 → 1.60.1
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/README.md +6 -6
- package/i18n/nls.cs.json +104 -8
- package/i18n/nls.de.json +104 -8
- package/i18n/nls.es.json +104 -8
- package/i18n/nls.fr.json +104 -8
- package/i18n/nls.hu.json +104 -8
- package/i18n/nls.it.json +104 -8
- package/i18n/nls.ja.json +104 -8
- package/i18n/nls.json +111 -15
- package/i18n/nls.ko.json +104 -8
- package/i18n/nls.pl.json +104 -8
- package/i18n/nls.pt-br.json +104 -8
- package/i18n/nls.ru.json +104 -8
- package/i18n/nls.tr.json +104 -8
- package/i18n/nls.zh-cn.json +104 -8
- package/i18n/nls.zh-tw.json +104 -8
- package/lib/browser/catalog.json +111 -24
- package/lib/browser/context-menu-renderer.d.ts +2 -1
- package/lib/browser/context-menu-renderer.d.ts.map +1 -1
- package/lib/browser/context-menu-renderer.js +3 -0
- package/lib/browser/context-menu-renderer.js.map +1 -1
- package/lib/browser/shell/application-shell.d.ts.map +1 -1
- package/lib/browser/shell/application-shell.js +2 -1
- package/lib/browser/shell/application-shell.js.map +1 -1
- package/lib/browser/shell/tab-bars.d.ts +7 -30
- package/lib/browser/shell/tab-bars.d.ts.map +1 -1
- package/lib/browser/shell/tab-bars.js +49 -76
- package/lib/browser/shell/tab-bars.js.map +1 -1
- package/lib/browser/shell/theia-dock-panel.d.ts.map +1 -1
- package/lib/browser/shell/theia-dock-panel.js +9 -0
- package/lib/browser/shell/theia-dock-panel.js.map +1 -1
- package/lib/browser/widget-open-handler.d.ts +1 -1
- package/lib/browser/widget-open-handler.d.ts.map +1 -1
- package/lib/browser/widget-open-handler.js +2 -2
- package/lib/browser/widget-open-handler.js.map +1 -1
- package/lib/node/env-variables/env-variables-server.d.ts.map +1 -1
- package/lib/node/env-variables/env-variables-server.js +5 -7
- package/lib/node/env-variables/env-variables-server.js.map +1 -1
- package/package.json +7 -7
- package/src/browser/context-menu-renderer.ts +4 -1
- package/src/browser/shell/application-shell.ts +3 -1
- package/src/browser/shell/tab-bars.ts +55 -86
- package/src/browser/shell/theia-dock-panel.ts +10 -0
- package/src/browser/style/tabs.css +2 -2
- package/src/browser/style/view-container.css +1 -0
- package/src/browser/widget-open-handler.ts +2 -2
- package/src/node/env-variables/env-variables-server.ts +5 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"env-variables-server.js","sourceRoot":"","sources":["../../../src/node/env-variables/env-variables-server.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,oDAAoD;AACpD,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;;;AAEhF,+BAA4B;AAC5B,2BAA6B;AAC7B,yCAAuC;AACvC,uCAAuC;AACvC,uCAA6C;AAE7C,wCAA4C;AAC5C,oDAAgD;AAChD,gEAAgE;AAChE,gGAA0F;AAGnF,IAAM,sBAAsB,GAA5B,MAAM,sBAAsB;IAO/B;QALmB,SAAI,GAAmC,EAAE,CAAC;QAC1C,eAAU,GAAG,kBAAO,CAAC,MAAM,CAAC,IAAA,YAAO,GAAE,CAAC,CAAC,QAAQ,EAAE,CAAC;QAElD,uBAAkB,GAA+B,EAAE,CAAC;QAGnE,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,kBAAkB,EAAE,CAAC;QAC9C,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,YAAY,CAAC,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,iCAAiC,YAAY,GAAG,CAAC,CAAC,CAAC;QACtG,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC;QAC1B,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,GAAW,EAAE,EAAE;YACvC,IAAI,OAAO,GAAG,GAAG,CAAC;YAClB,IAAI,cAAS,EAAE,CAAC;gBACZ,OAAO,GAAG,GAAG,CAAC,WAAW,EAAE,CAAC;YAChC,CAAC;YACD,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC;QAClE,CAAC,CAAC,CAAC;IACP,CAAC;IAES,KAAK,CAAC,kBAAkB;;;QAC9B,IAAI,OAAO,CAAC,GAAG,CAAC,gBAAgB,EAAE,CAAC;YAC/B,4EAA4E;YAC5E,OAAO,kBAAO,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC,QAAQ,EAAE,CAAC;QACnE,CAAC;QAED,MAAM,cAAc,GAAG,IAAA,WAAI,EAAC,4CAAsB,EAAE,MAAM,CAAC,CAAC;QAC5D,MAAM,YAAY,GAAG,IAAA,WAAI,EAAC,cAAc,EAAE,WAAW,CAAC,CAAC;QACvD,MAAM,gBAAgB,eAAG,IAAI,CAAC,kBAAkB,EAAC,cAAc,wCAAd,cAAc,IAAM,MAAM,IAAA,qBAAU,EAAC,cAAc,CAAC,CAAA,CAAC;QACtG,IAAI,gBAAgB,EAAE,CAAC;YACnB,MAAM,cAAc,eAAG,IAAI,CAAC,kBAAkB,EAAC,YAAY,wCAAZ,YAAY,IAAM,MAAM,IAAA,qBAAU,EAAC,YAAY,CAAC,CAAA,CAAC;YAChG,IAAI,cAAc,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"env-variables-server.js","sourceRoot":"","sources":["../../../src/node/env-variables/env-variables-server.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,oDAAoD;AACpD,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACv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AE,CAAC;QAC5B,CAAC;QACD,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC1B,CAAC;IAED,eAAe;QACX,OAAO,IAAI,CAAC,YAAY,CAAC;IAC7B,CAAC;IAED,KAAK,CAAC,aAAa;QACf,OAAO,IAAI,CAAC,UAAU,CAAC;IAC3B,CAAC;IAED,KAAK,CAAC,SAAS;QACX,MAAM,IAAI,GAAa,EAAE,CAAC;QAC1B,MAAM,MAAM,GAAG,MAAM,SAAS,CAAC,IAAI,EAAE,CAAC;QACtC,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;YACzB,KAAK,MAAM,UAAU,IAAI,KAAK,CAAC,WAAW,EAAE,CAAC;gBACzC,IAAI,IAAI,CAAC,sBAAsB,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;oBAC/C,IAAI,CAAC,IAAI,CAAC,kBAAO,CAAC,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC;gBAC1D,CAAC;YACL,CAAC;QACL,CAAC;QACD,OAAO,IAAI,CAAC;IAChB,CAAC;IAED;;OAEG;IACO,sBAAsB,CAAC,IAAY;QACzC,8IAA8I;QAC9I,IAAI,IAAI,KAAK,iBAAiB,EAAE,CAAC;YAC7B,OAAO,KAAK,CAAC;QACjB,CAAC;QACD,0JAA0J;QAC1J,IAAI,IAAI,KAAK,WAAW,EAAE,CAAC;YACvB,OAAO,KAAK,CAAC;QACjB,CAAC;QACD,OAAO,IAAI,CAAC;IAChB,CAAC;CAEJ,CAAA;AA9FY,wDAAsB;iCAAtB,sBAAsB;IADlC,IAAA,sBAAU,GAAE;;GACA,sBAAsB,CA8FlC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@theia/core",
|
|
3
|
-
"version": "1.60.
|
|
3
|
+
"version": "1.60.1",
|
|
4
4
|
"description": "Theia is a cloud & desktop IDE framework implemented in TypeScript.",
|
|
5
5
|
"main": "lib/common/index.js",
|
|
6
6
|
"typings": "lib/common/index.d.ts",
|
|
@@ -17,8 +17,8 @@
|
|
|
17
17
|
"@lumino/virtualdom": "^2.0.2",
|
|
18
18
|
"@lumino/widgets": "2.5.0",
|
|
19
19
|
"@parcel/watcher": "^2.5.0",
|
|
20
|
-
"@theia/application-package": "1.60.
|
|
21
|
-
"@theia/request": "1.60.
|
|
20
|
+
"@theia/application-package": "1.60.1",
|
|
21
|
+
"@theia/request": "1.60.1",
|
|
22
22
|
"@types/body-parser": "^1.16.4",
|
|
23
23
|
"@types/cookie": "^0.3.3",
|
|
24
24
|
"@types/dompurify": "^2.2.2",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"markdown-it": "^12.3.2",
|
|
60
60
|
"msgpackr": "^1.10.2",
|
|
61
61
|
"p-debounce": "^2.1.0",
|
|
62
|
-
"perfect-scrollbar": "
|
|
62
|
+
"perfect-scrollbar": "1.5.5",
|
|
63
63
|
"react": "^18.2.0",
|
|
64
64
|
"react-dom": "^18.2.0",
|
|
65
65
|
"react-tooltip": "^4.2.21",
|
|
@@ -210,13 +210,13 @@
|
|
|
210
210
|
"watch": "theiaext watch"
|
|
211
211
|
},
|
|
212
212
|
"devDependencies": {
|
|
213
|
-
"@theia/ext-scripts": "1.
|
|
214
|
-
"@theia/re-exports": "1.
|
|
213
|
+
"@theia/ext-scripts": "1.60.1",
|
|
214
|
+
"@theia/re-exports": "1.60.1",
|
|
215
215
|
"minimist": "^1.2.0",
|
|
216
216
|
"nodejs-file-downloader": "4.13.0"
|
|
217
217
|
},
|
|
218
218
|
"nyc": {
|
|
219
219
|
"extends": "../../configs/nyc.json"
|
|
220
220
|
},
|
|
221
|
-
"gitHead": "
|
|
221
|
+
"gitHead": "23230a4ff18bb6b4c09e08c1a40ae1ebdb20ff69"
|
|
222
222
|
}
|
|
@@ -31,7 +31,7 @@ export function coordinateFromAnchor(anchor: Anchor): Coordinate {
|
|
|
31
31
|
return { x, y };
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
export
|
|
34
|
+
export class ContextMenuAccess implements Disposable {
|
|
35
35
|
|
|
36
36
|
protected readonly toDispose = new DisposableCollection();
|
|
37
37
|
readonly onDispose = this.toDispose.onDispose;
|
|
@@ -62,6 +62,9 @@ export abstract class ContextMenuRenderer {
|
|
|
62
62
|
get current(): ContextMenuAccess | undefined {
|
|
63
63
|
return this._current;
|
|
64
64
|
}
|
|
65
|
+
set current(current: ContextMenuAccess | undefined) {
|
|
66
|
+
this.setCurrent(current);
|
|
67
|
+
}
|
|
65
68
|
protected setCurrent(current: ContextMenuAccess | undefined): void {
|
|
66
69
|
if (this._current === current) {
|
|
67
70
|
return;
|
|
@@ -123,7 +123,9 @@ export class DockPanelRenderer implements DockLayout.IRenderer {
|
|
|
123
123
|
this.tabBarToolbarFactory,
|
|
124
124
|
this.breadcrumbsRendererFactory,
|
|
125
125
|
{
|
|
126
|
-
renderer
|
|
126
|
+
renderer
|
|
127
|
+
},
|
|
128
|
+
{
|
|
127
129
|
// Scroll bar options
|
|
128
130
|
handlers: ['drag-thumb', 'keyboard', 'wheel', 'touch'],
|
|
129
131
|
useBothWheelAxes: true,
|
|
@@ -20,7 +20,7 @@ import { VirtualElement, h, VirtualDOM, ElementInlineStyle } from '@lumino/virtu
|
|
|
20
20
|
import { Disposable, DisposableCollection, MenuPath, notEmpty, SelectionService, CommandService, nls, ArrayUtils } from '../../common';
|
|
21
21
|
import { ContextMenuRenderer } from '../context-menu-renderer';
|
|
22
22
|
import { Signal, Slot } from '@lumino/signaling';
|
|
23
|
-
import { Message
|
|
23
|
+
import { Message } from '@lumino/messaging';
|
|
24
24
|
import { ArrayExt } from '@lumino/algorithm';
|
|
25
25
|
import { ElementExt } from '@lumino/domutils';
|
|
26
26
|
import { TabBarToolbarRegistry, TabBarToolbar } from './tab-bar-toolbar';
|
|
@@ -697,9 +697,8 @@ export interface TabBarPrivateMethods {
|
|
|
697
697
|
*/
|
|
698
698
|
export class ScrollableTabBar extends TabBar<Widget> {
|
|
699
699
|
|
|
700
|
-
protected scrollBar
|
|
700
|
+
protected scrollBar: PerfectScrollbar | undefined;
|
|
701
701
|
|
|
702
|
-
protected scrollBarFactory: () => PerfectScrollbar;
|
|
703
702
|
protected pendingReveal?: Promise<void>;
|
|
704
703
|
protected isMouseOver = false;
|
|
705
704
|
protected needsRecompute = false;
|
|
@@ -712,11 +711,27 @@ export class ScrollableTabBar extends TabBar<Widget> {
|
|
|
712
711
|
protected openTabsContainer: HTMLDivElement;
|
|
713
712
|
protected openTabsRoot: Root;
|
|
714
713
|
|
|
715
|
-
constructor(options?: TabBar.IOptions<Widget
|
|
714
|
+
constructor(options?: TabBar.IOptions<Widget>, protected readonly scrollbarOptions?: PerfectScrollbar.Options, dynamicTabOptions?: ScrollableTabBar.Options) {
|
|
716
715
|
super(options);
|
|
717
|
-
this.scrollBarFactory = () => new PerfectScrollbar(this.scrollbarHost, options);
|
|
718
716
|
this._dynamicTabOptions = dynamicTabOptions;
|
|
719
|
-
this.
|
|
717
|
+
this.topRow = document.createElement('div');
|
|
718
|
+
this.topRow.classList.add('theia-tabBar-tab-row');
|
|
719
|
+
this.node.appendChild(this.topRow);
|
|
720
|
+
|
|
721
|
+
const contentNode = this.contentNode;
|
|
722
|
+
if (!contentNode) {
|
|
723
|
+
throw new Error('tab bar does not have the content node.');
|
|
724
|
+
}
|
|
725
|
+
this.node.removeChild(contentNode);
|
|
726
|
+
this.contentContainer = document.createElement('div');
|
|
727
|
+
this.contentContainer.classList.add(ScrollableTabBar.Styles.TAB_BAR_CONTENT_CONTAINER);
|
|
728
|
+
this.contentContainer.appendChild(contentNode);
|
|
729
|
+
this.topRow.appendChild(this.contentContainer);
|
|
730
|
+
|
|
731
|
+
this.openTabsContainer = document.createElement('div');
|
|
732
|
+
this.openTabsContainer.classList.add('theia-tabBar-open-tabs');
|
|
733
|
+
this.openTabsRoot = createRoot(this.openTabsContainer);
|
|
734
|
+
this.topRow.appendChild(this.openTabsContainer);
|
|
720
735
|
}
|
|
721
736
|
|
|
722
737
|
set dynamicTabOptions(options: ScrollableTabBar.Options | undefined) {
|
|
@@ -753,39 +768,7 @@ export class ScrollableTabBar extends TabBar<Widget> {
|
|
|
753
768
|
(this as unknown as TabBarPrivateMethods)._releaseMouse();
|
|
754
769
|
}
|
|
755
770
|
|
|
756
|
-
/**
|
|
757
|
-
* Restructures the DOM defined in Lumino.
|
|
758
|
-
*
|
|
759
|
-
* By default the tabs (`li`) are contained in the `this.contentNode` (`ul`) which is wrapped in a `div` (`this.node`).
|
|
760
|
-
* Instead of this structure, we add a container for the `this.contentNode` and for the toolbar.
|
|
761
|
-
* The scrollbar will only work for the `ul` part but it does not affect the toolbar, so it can be on the right hand-side.
|
|
762
|
-
*/
|
|
763
|
-
protected rewireDOM(): void {
|
|
764
|
-
const contentNode = this.node.getElementsByClassName(ScrollableTabBar.Styles.TAB_BAR_CONTENT)[0];
|
|
765
|
-
if (!contentNode) {
|
|
766
|
-
throw new Error(`'this.node' does not have the content as a direct child with class name '${ScrollableTabBar.Styles.TAB_BAR_CONTENT}'.`);
|
|
767
|
-
}
|
|
768
|
-
this.node.removeChild(contentNode);
|
|
769
|
-
this.contentContainer = document.createElement('div');
|
|
770
|
-
this.contentContainer.classList.add(ScrollableTabBar.Styles.TAB_BAR_CONTENT_CONTAINER);
|
|
771
|
-
this.contentContainer.appendChild(contentNode);
|
|
772
|
-
|
|
773
|
-
this.topRow = document.createElement('div');
|
|
774
|
-
this.topRow.classList.add('theia-tabBar-tab-row');
|
|
775
|
-
this.topRow.appendChild(this.contentContainer);
|
|
776
|
-
|
|
777
|
-
this.openTabsContainer = document.createElement('div');
|
|
778
|
-
this.openTabsContainer.classList.add('theia-tabBar-open-tabs');
|
|
779
|
-
this.openTabsRoot = createRoot(this.openTabsContainer);
|
|
780
|
-
this.topRow.appendChild(this.openTabsContainer);
|
|
781
|
-
|
|
782
|
-
this.node.appendChild(this.topRow);
|
|
783
|
-
}
|
|
784
|
-
|
|
785
771
|
protected override onAfterAttach(msg: Message): void {
|
|
786
|
-
if (!this.scrollBar) {
|
|
787
|
-
this.scrollBar = this.scrollBarFactory();
|
|
788
|
-
}
|
|
789
772
|
this.node.addEventListener('mouseenter', () => { this.isMouseOver = true; });
|
|
790
773
|
this.node.addEventListener('mouseleave', () => {
|
|
791
774
|
this.isMouseOver = false;
|
|
@@ -795,14 +778,12 @@ export class ScrollableTabBar extends TabBar<Widget> {
|
|
|
795
778
|
});
|
|
796
779
|
|
|
797
780
|
super.onAfterAttach(msg);
|
|
781
|
+
this.scrollBar = new PerfectScrollbar(this.contentContainer, this.scrollbarOptions);
|
|
798
782
|
}
|
|
799
783
|
|
|
800
784
|
protected override onBeforeDetach(msg: Message): void {
|
|
801
785
|
super.onBeforeDetach(msg);
|
|
802
|
-
|
|
803
|
-
this.scrollBar.destroy();
|
|
804
|
-
this.scrollBar = undefined;
|
|
805
|
-
}
|
|
786
|
+
this.scrollBar?.destroy();
|
|
806
787
|
}
|
|
807
788
|
|
|
808
789
|
protected override onUpdateRequest(msg: Message): void {
|
|
@@ -826,7 +807,7 @@ export class ScrollableTabBar extends TabBar<Widget> {
|
|
|
826
807
|
} else {
|
|
827
808
|
this.needsRecompute = false;
|
|
828
809
|
if (this.orientation === 'horizontal') {
|
|
829
|
-
let availableWidth = this.
|
|
810
|
+
let availableWidth = this.contentNode.clientWidth;
|
|
830
811
|
let effectiveWidth = availableWidth;
|
|
831
812
|
if (!this.openTabsContainer.classList.contains('lm-mod-hidden')) {
|
|
832
813
|
availableWidth += this.openTabsContainer.getBoundingClientRect().width;
|
|
@@ -890,7 +871,7 @@ export class ScrollableTabBar extends TabBar<Widget> {
|
|
|
890
871
|
window.requestAnimationFrame(() => {
|
|
891
872
|
const tab = this.contentNode.children[index] as HTMLElement;
|
|
892
873
|
if (tab && this.isVisible) {
|
|
893
|
-
const parent = this.
|
|
874
|
+
const parent = this.contentNode;
|
|
894
875
|
if (this.orientation === 'horizontal') {
|
|
895
876
|
const scroll = parent.scrollLeft;
|
|
896
877
|
const left = tab.offsetLeft;
|
|
@@ -924,25 +905,6 @@ export class ScrollableTabBar extends TabBar<Widget> {
|
|
|
924
905
|
this.pendingReveal = result;
|
|
925
906
|
return result;
|
|
926
907
|
}
|
|
927
|
-
|
|
928
|
-
/**
|
|
929
|
-
* Overrides the `contentNode` property getter in LuminoJS' TabBar.
|
|
930
|
-
*/
|
|
931
|
-
// @ts-expect-error TS2611 `TabBar<T>.contentNode` is declared as `readonly contentNode` but is implemented as a getter.
|
|
932
|
-
get contentNode(): HTMLUListElement {
|
|
933
|
-
return this.node.getElementsByClassName(ToolbarAwareTabBar.Styles.TAB_BAR_CONTENT)[0] as HTMLUListElement;
|
|
934
|
-
}
|
|
935
|
-
|
|
936
|
-
/**
|
|
937
|
-
* Overrides the scrollable host from the parent class.
|
|
938
|
-
*/
|
|
939
|
-
protected get scrollbarHost(): HTMLElement {
|
|
940
|
-
return this.tabBarContainer;
|
|
941
|
-
}
|
|
942
|
-
|
|
943
|
-
protected get tabBarContainer(): HTMLElement {
|
|
944
|
-
return this.node.getElementsByClassName(ToolbarAwareTabBar.Styles.TAB_BAR_CONTENT_CONTAINER)[0] as HTMLElement;
|
|
945
|
-
}
|
|
946
908
|
}
|
|
947
909
|
|
|
948
910
|
export namespace ScrollableTabBar {
|
|
@@ -953,7 +915,6 @@ export namespace ScrollableTabBar {
|
|
|
953
915
|
}
|
|
954
916
|
export namespace Styles {
|
|
955
917
|
|
|
956
|
-
export const TAB_BAR_CONTENT = 'lm-TabBar-content';
|
|
957
918
|
export const TAB_BAR_CONTENT_CONTAINER = 'lm-TabBar-content-container';
|
|
958
919
|
|
|
959
920
|
}
|
|
@@ -978,32 +939,54 @@ export class ToolbarAwareTabBar extends ScrollableTabBar {
|
|
|
978
939
|
protected toolbar: TabBarToolbar | undefined;
|
|
979
940
|
protected breadcrumbsContainer: HTMLElement;
|
|
980
941
|
protected readonly breadcrumbsRenderer: BreadcrumbsRenderer;
|
|
942
|
+
protected dockPanel: TheiaDockPanel;
|
|
981
943
|
|
|
982
944
|
constructor(
|
|
983
945
|
protected readonly tabBarToolbarRegistry: TabBarToolbarRegistry,
|
|
984
946
|
protected readonly tabBarToolbarFactory: () => TabBarToolbar,
|
|
985
947
|
protected readonly breadcrumbsRendererFactory: BreadcrumbsRendererFactory,
|
|
986
|
-
options?: TabBar.IOptions<Widget
|
|
948
|
+
options?: TabBar.IOptions<Widget>,
|
|
949
|
+
scrollbarOptions?: PerfectScrollbar.Options,
|
|
987
950
|
dynamicTabOptions?: ScrollableTabBar.Options
|
|
988
951
|
) {
|
|
989
|
-
super(options, dynamicTabOptions);
|
|
952
|
+
super(options, scrollbarOptions, dynamicTabOptions);
|
|
953
|
+
|
|
990
954
|
this.breadcrumbsRenderer = this.breadcrumbsRendererFactory();
|
|
991
|
-
this.
|
|
955
|
+
this.breadcrumbsContainer = document.createElement('div');
|
|
956
|
+
this.breadcrumbsContainer.classList.add('theia-tabBar-breadcrumb-row');
|
|
957
|
+
this.breadcrumbsContainer.appendChild(this.breadcrumbsRenderer.host);
|
|
958
|
+
this.node.appendChild(this.breadcrumbsContainer);
|
|
959
|
+
|
|
992
960
|
this.toolbar = this.tabBarToolbarFactory();
|
|
993
961
|
this.toDispose.push(this.tabBarToolbarRegistry.onDidChange(() => this.update()));
|
|
994
962
|
this.toDispose.push(this.breadcrumbsRenderer);
|
|
963
|
+
|
|
964
|
+
if (!this.breadcrumbsRenderer.active) {
|
|
965
|
+
this.breadcrumbsContainer.style.setProperty('display', 'none');
|
|
966
|
+
} else {
|
|
967
|
+
this.node.classList.add('theia-tabBar-multirow');
|
|
968
|
+
}
|
|
995
969
|
this.toDispose.push(this.breadcrumbsRenderer.onDidChangeActiveState(active => {
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
970
|
+
if (active) {
|
|
971
|
+
this.breadcrumbsContainer.style.removeProperty('display');
|
|
972
|
+
this.node.classList.add('theia-tabBar-multirow');
|
|
973
|
+
} else {
|
|
974
|
+
this.breadcrumbsContainer.style.setProperty('display', 'none');
|
|
975
|
+
this.node.classList.remove('theia-tabBar-multirow');
|
|
976
|
+
}
|
|
977
|
+
if (this.dockPanel) {
|
|
978
|
+
this.dockPanel.fit();
|
|
999
979
|
}
|
|
1000
980
|
}));
|
|
1001
|
-
this.node.classList.toggle('theia-tabBar-multirow', this.breadcrumbsRenderer.active);
|
|
1002
981
|
const handler = () => this.updateBreadcrumbs();
|
|
1003
982
|
this.currentChanged.connect(handler);
|
|
1004
983
|
this.toDispose.push(Disposable.create(() => this.currentChanged.disconnect(handler)));
|
|
1005
984
|
}
|
|
1006
985
|
|
|
986
|
+
setDockPanel(panel: TheiaDockPanel): void {
|
|
987
|
+
this.dockPanel = panel;
|
|
988
|
+
}
|
|
989
|
+
|
|
1007
990
|
protected async updateBreadcrumbs(): Promise<void> {
|
|
1008
991
|
const current = this.currentTitle?.owner;
|
|
1009
992
|
const uri = NavigatableWidget.is(current) ? current.getResourceUri() : undefined;
|
|
@@ -1062,20 +1045,6 @@ export class ToolbarAwareTabBar extends ScrollableTabBar {
|
|
|
1062
1045
|
protected isOver(event: Event, element: Element): boolean {
|
|
1063
1046
|
return element && event.target instanceof Element && element.contains(event.target);
|
|
1064
1047
|
}
|
|
1065
|
-
|
|
1066
|
-
/**
|
|
1067
|
-
* Restructures the DOM defined in Lumino.
|
|
1068
|
-
*
|
|
1069
|
-
* By default the tabs (`li`) are contained in the `this.contentNode` (`ul`) which is wrapped in a `div` (`this.node`).
|
|
1070
|
-
* Instead of this structure, we add a container for the `this.contentNode` and for the toolbar.
|
|
1071
|
-
* The scrollbar will only work for the `ul` part but it does not affect the toolbar, so it can be on the right hand-side.
|
|
1072
|
-
*/
|
|
1073
|
-
protected addBreadcrumbs(): void {
|
|
1074
|
-
this.breadcrumbsContainer = document.createElement('div');
|
|
1075
|
-
this.breadcrumbsContainer.classList.add('theia-tabBar-breadcrumb-row');
|
|
1076
|
-
this.breadcrumbsContainer.appendChild(this.breadcrumbsRenderer.host);
|
|
1077
|
-
this.node.appendChild(this.breadcrumbsContainer);
|
|
1078
|
-
}
|
|
1079
1048
|
}
|
|
1080
1049
|
|
|
1081
1050
|
/**
|
|
@@ -1256,7 +1225,7 @@ export class SideTabBar extends ScrollableTabBar {
|
|
|
1256
1225
|
return;
|
|
1257
1226
|
}
|
|
1258
1227
|
|
|
1259
|
-
if ((newOverflowingTabs.length !== this.tabsOverflowData?.titles.length ?? 0) ||
|
|
1228
|
+
if ((newOverflowingTabs.length !== (this.tabsOverflowData?.titles.length ?? 0)) ||
|
|
1260
1229
|
newOverflowingTabs.find((newTitle, i) => newTitle !== this.tabsOverflowData?.titles[i]) !== undefined) {
|
|
1261
1230
|
this.tabsOverflowData = { titles: newOverflowingTabs, startIndex };
|
|
1262
1231
|
this.tabsOverflowChanged.emit(this.tabsOverflowData);
|
|
@@ -21,6 +21,7 @@ import { Disposable, DisposableCollection } from '../../common/disposable';
|
|
|
21
21
|
import { UnsafeWidgetUtilities } from '../widgets';
|
|
22
22
|
import { CorePreferences } from '../core-preferences';
|
|
23
23
|
import { Emitter, Event, environment } from '../../common';
|
|
24
|
+
import { ToolbarAwareTabBar } from './tab-bars';
|
|
24
25
|
|
|
25
26
|
export const MAXIMIZED_CLASS = 'theia-maximized';
|
|
26
27
|
export const ACTIVE_TABBAR_CLASS = 'theia-tabBar-active';
|
|
@@ -63,6 +64,15 @@ export class TheiaDockPanel extends DockPanel {
|
|
|
63
64
|
this.markAsCurrent(args.currentTitle || undefined);
|
|
64
65
|
super['_onCurrentChanged'](sender, args);
|
|
65
66
|
};
|
|
67
|
+
|
|
68
|
+
this['_createTabBar'] = () => {
|
|
69
|
+
// necessary for https://github.com/eclipse-theia/theia/issues/15273
|
|
70
|
+
const tabBar = super['_createTabBar']();
|
|
71
|
+
if (tabBar instanceof ToolbarAwareTabBar) {
|
|
72
|
+
tabBar.setDockPanel(this);
|
|
73
|
+
}
|
|
74
|
+
return tabBar;
|
|
75
|
+
};
|
|
66
76
|
this['_onTabActivateRequested'] = (sender: TabBar<Widget>, args: TabBar.ITabActivateRequestedArgs<Widget>) => {
|
|
67
77
|
this.markAsCurrent(args.title);
|
|
68
78
|
super['_onTabActivateRequested'](sender, args);
|
|
@@ -459,7 +459,7 @@
|
|
|
459
459
|
}
|
|
460
460
|
|
|
461
461
|
.theia-tabBar-breadcrumb-row {
|
|
462
|
-
|
|
462
|
+
width: 100%;
|
|
463
463
|
}
|
|
464
464
|
|
|
465
465
|
.lm-TabBar.theia-tabBar-multirow[data-orientation="horizontal"] {
|
|
@@ -470,7 +470,7 @@
|
|
|
470
470
|
.lm-TabBar[data-orientation="horizontal"] .theia-tabBar-tab-row {
|
|
471
471
|
display: flex;
|
|
472
472
|
flex-flow: row nowrap;
|
|
473
|
-
|
|
473
|
+
width: 100%;
|
|
474
474
|
}
|
|
475
475
|
|
|
476
476
|
.lm-TabBar[data-orientation="vertical"] .theia-tabBar-tab-row {
|
|
@@ -90,10 +90,10 @@ export abstract class WidgetOpenHandler<W extends BaseWidget> implements OpenHan
|
|
|
90
90
|
*/
|
|
91
91
|
async open(uri: URI, options?: WidgetOpenerOptions): Promise<W> {
|
|
92
92
|
const widget = await this.getOrCreateWidget(uri, options);
|
|
93
|
-
await this.doOpen(widget, options);
|
|
93
|
+
await this.doOpen(widget, uri, options);
|
|
94
94
|
return widget;
|
|
95
95
|
}
|
|
96
|
-
protected async doOpen(widget: W, options?: WidgetOpenerOptions): Promise<void> {
|
|
96
|
+
protected async doOpen(widget: W, uri: URI, options?: WidgetOpenerOptions): Promise<void> {
|
|
97
97
|
const op: WidgetOpenerOptions = {
|
|
98
98
|
mode: 'activate',
|
|
99
99
|
...options
|
|
@@ -55,19 +55,18 @@ export class EnvVariablesServerImpl implements EnvVariablesServer {
|
|
|
55
55
|
const dataFolderPath = join(BackendApplicationPath, 'data');
|
|
56
56
|
const userDataPath = join(dataFolderPath, 'user-data');
|
|
57
57
|
const dataFolderExists = this.pathExistenceCache[dataFolderPath] ??= await pathExists(dataFolderPath);
|
|
58
|
+
let theiaConfigDir: string;
|
|
58
59
|
if (dataFolderExists) {
|
|
59
60
|
const userDataExists = this.pathExistenceCache[userDataPath] ??= await pathExists(userDataPath);
|
|
60
|
-
if (userDataExists) {
|
|
61
|
-
process.env.THEIA_CONFIG_DIR = userDataPath;
|
|
62
|
-
} else {
|
|
61
|
+
if (!userDataExists) {
|
|
63
62
|
await mkdir(userDataPath);
|
|
64
|
-
process.env.THEIA_CONFIG_DIR = userDataPath;
|
|
65
63
|
this.pathExistenceCache[userDataPath] = true;
|
|
66
64
|
}
|
|
65
|
+
theiaConfigDir = userDataPath;
|
|
67
66
|
} else {
|
|
68
|
-
|
|
67
|
+
theiaConfigDir = join(homedir(), BackendApplicationConfigProvider.get().configurationFolder);
|
|
69
68
|
}
|
|
70
|
-
return FileUri.create(
|
|
69
|
+
return FileUri.create(theiaConfigDir).toString();
|
|
71
70
|
}
|
|
72
71
|
|
|
73
72
|
async getExecPath(): Promise<string> {
|