@opensumi/ide-main-layout 3.9.1-next-1748425167.0 → 3.9.1-next-1748425792.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/README.md +31 -30
- package/lib/browser/accordion/accordion.service.d.ts +1 -9
- package/lib/browser/accordion/accordion.service.d.ts.map +1 -1
- package/lib/browser/accordion/accordion.service.js +33 -120
- package/lib/browser/accordion/accordion.service.js.map +1 -1
- package/lib/browser/accordion/accordion.view.d.ts.map +1 -1
- package/lib/browser/accordion/accordion.view.js +1 -4
- package/lib/browser/accordion/accordion.view.js.map +1 -1
- package/lib/browser/accordion/section.view.d.ts.map +1 -1
- package/lib/browser/accordion/section.view.js +1 -1
- package/lib/browser/accordion/section.view.js.map +1 -1
- package/lib/browser/accordion/styles.module.less +0 -61
- package/lib/browser/default-config.d.ts.map +1 -1
- package/lib/browser/default-config.js +6 -7
- package/lib/browser/default-config.js.map +1 -1
- package/lib/browser/drop-area/drop-area.d.ts +2 -3
- package/lib/browser/drop-area/drop-area.d.ts.map +1 -1
- package/lib/browser/drop-area/drop-area.js +5 -8
- package/lib/browser/drop-area/drop-area.js.map +1 -1
- package/lib/browser/index.d.ts.map +1 -1
- package/lib/browser/index.js.map +1 -1
- package/lib/browser/layout.service.d.ts +0 -3
- package/lib/browser/layout.service.d.ts.map +1 -1
- package/lib/browser/layout.service.js +78 -120
- package/lib/browser/layout.service.js.map +1 -1
- package/lib/browser/main-layout.contribution.d.ts +18 -2
- package/lib/browser/main-layout.contribution.d.ts.map +1 -1
- package/lib/browser/main-layout.contribution.js +131 -75
- package/lib/browser/main-layout.contribution.js.map +1 -1
- package/lib/browser/tabbar/bar.view.d.ts.map +1 -1
- package/lib/browser/tabbar/bar.view.js +10 -5
- package/lib/browser/tabbar/bar.view.js.map +1 -1
- package/lib/browser/tabbar/panel.view.js +1 -1
- package/lib/browser/tabbar/panel.view.js.map +1 -1
- package/lib/browser/tabbar/renderer.view.js +4 -4
- package/lib/browser/tabbar/renderer.view.js.map +1 -1
- package/lib/browser/tabbar/tabbar.service.d.ts +19 -8
- package/lib/browser/tabbar/tabbar.service.d.ts.map +1 -1
- package/lib/browser/tabbar/tabbar.service.js +146 -37
- package/lib/browser/tabbar/tabbar.service.js.map +1 -1
- package/lib/common/main-layout.definition.d.ts +3 -4
- package/lib/common/main-layout.definition.d.ts.map +1 -1
- package/lib/common/main-layout.definition.js +4 -5
- package/lib/common/main-layout.definition.js.map +1 -1
- package/package.json +8 -8
- package/src/browser/accordion/accordion.service.ts +35 -152
- package/src/browser/accordion/accordion.view.tsx +2 -4
- package/src/browser/accordion/section.view.tsx +1 -5
- package/src/browser/accordion/styles.module.less +0 -61
- package/src/browser/default-config.ts +7 -8
- package/src/browser/drop-area/drop-area.tsx +3 -6
- package/src/browser/index.ts +0 -1
- package/src/browser/layout.service.ts +66 -134
- package/src/browser/main-layout.contribution.ts +138 -93
- package/src/browser/tabbar/bar.view.tsx +15 -9
- package/src/browser/tabbar/panel.view.tsx +2 -2
- package/src/browser/tabbar/renderer.view.tsx +4 -4
- package/src/browser/tabbar/tabbar.service.ts +161 -52
- package/src/common/main-layout.definition.ts +4 -6
- package/lib/browser/command.d.ts +0 -29
- package/lib/browser/command.d.ts.map +0 -1
- package/lib/browser/command.js +0 -84
- package/lib/browser/command.js.map +0 -1
- package/lib/browser/tabbar/TABBAR_CONFIG_USAGE.md +0 -141
- package/lib/browser/tabbar/tabbar-behavior-handler.d.ts +0 -71
- package/lib/browser/tabbar/tabbar-behavior-handler.d.ts.map +0 -1
- package/lib/browser/tabbar/tabbar-behavior-handler.js +0 -210
- package/lib/browser/tabbar/tabbar-behavior-handler.js.map +0 -1
- package/src/browser/command.ts +0 -99
- package/src/browser/tabbar/TABBAR_CONFIG_USAGE.md +0 -141
- package/src/browser/tabbar/tabbar-behavior-handler.ts +0 -260
|
@@ -33,7 +33,7 @@ export interface IMainLayoutService {
|
|
|
33
33
|
* 注册单个或多个视图到tabbar位置
|
|
34
34
|
* @param views 使用手风琴能力时传入的多个子视图
|
|
35
35
|
* @param options container相关选项
|
|
36
|
-
* @param side 注册的位置,支持
|
|
36
|
+
* @param side 注册的位置,支持left、right、bottom
|
|
37
37
|
*/
|
|
38
38
|
collectTabbarComponent(views: View[], options: ViewContainerOptions, side: string): string;
|
|
39
39
|
/**
|
|
@@ -112,7 +112,6 @@ export declare class ViewCollapseChangedEvent extends BasicEvent<{
|
|
|
112
112
|
}> {
|
|
113
113
|
}
|
|
114
114
|
export declare const SUPPORT_ACCORDION_LOCATION: Set<string>;
|
|
115
|
-
export declare const
|
|
116
|
-
export declare const
|
|
117
|
-
export declare const DROP_VIEW_CONTAINER = "drop-view";
|
|
115
|
+
export declare const DROP_BOTTOM_CONTAINER = "drop-bottom";
|
|
116
|
+
export declare const DROP_RIGHT_CONTAINER = "drop-right";
|
|
118
117
|
//# sourceMappingURL=main-layout.definition.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main-layout.definition.d.ts","sourceRoot":"","sources":["../../src/common/main-layout.definition.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"main-layout.definition.d.ts","sourceRoot":"","sources":["../../src/common/main-layout.definition.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AACnF,OAAO,EAAE,gBAAgB,EAAE,IAAI,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AACrG,OAAO,EAAE,qBAAqB,EAAE,MAAM,wDAAwD,CAAC;AAC/F,OAAO,EAAE,YAAY,EAAE,MAAM,0CAA0C,CAAC;AACxE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EAAE,qBAAqB,EAAE,MAAM,2EAA2E,CAAC;AAGl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c,eAA2B,CAAC;AAEvD,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,6BAA6B,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACtD,0BAA0B,CAAC,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,sBAAsB,GAAG,WAAW,CAAC;IACxF,2BAA2B,CAAC,IAAI,EAC9B,EAAE,EAAE,MAAM,EACV,cAAc,EAAE,GAAG,CAAC,IAAI,EAAE,sBAAsB,CAAC,GAChD,GAAG,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;IAC1B,qBAAqB,CAAC,EAAE,EAAE,MAAM,GAAG,sBAAsB,EAAE,CAAC;CAC7D;AAED,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,IAAI,CAAC,EAAE,qBAAqB,GAAG,SAAS,CAAC;IAClD,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,YAAY,CAAC,EAAE,qBAAqB,GAAG,SAAS,CAAC;CAC3D;AAED,qBAAa,wBAAyB,SAAQ,UAAU,CAAC;IACvD,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,OAAO,CAAC;CACpB,CAAC;CAAG;AAEL,eAAO,MAAM,0BAA0B,aAAmD,CAAC;AAE3F,eAAO,MAAM,qBAAqB,gBAAgB,CAAC;AACnD,eAAO,MAAM,oBAAoB,eAAe,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.DROP_RIGHT_CONTAINER = exports.DROP_BOTTOM_CONTAINER = exports.SUPPORT_ACCORDION_LOCATION = exports.ViewCollapseChangedEvent = exports.IViewsRegistry = exports.TabBarRegistrationEvent = exports.MainLayoutContribution = exports.IMainLayoutService = void 0;
|
|
4
4
|
const ide_core_browser_1 = require("@opensumi/ide-core-browser");
|
|
5
5
|
exports.IMainLayoutService = Symbol('IMainLayoutService');
|
|
6
6
|
exports.MainLayoutContribution = Symbol('MainLayoutContribution');
|
|
@@ -14,8 +14,7 @@ exports.IViewsRegistry = Symbol('IViewsRegistry');
|
|
|
14
14
|
class ViewCollapseChangedEvent extends ide_core_browser_1.BasicEvent {
|
|
15
15
|
}
|
|
16
16
|
exports.ViewCollapseChangedEvent = ViewCollapseChangedEvent;
|
|
17
|
-
exports.SUPPORT_ACCORDION_LOCATION = new Set([ide_core_browser_1.SlotLocation.
|
|
18
|
-
exports.
|
|
19
|
-
exports.
|
|
20
|
-
exports.DROP_VIEW_CONTAINER = 'drop-view';
|
|
17
|
+
exports.SUPPORT_ACCORDION_LOCATION = new Set([ide_core_browser_1.SlotLocation.left, ide_core_browser_1.SlotLocation.right]);
|
|
18
|
+
exports.DROP_BOTTOM_CONTAINER = 'drop-bottom';
|
|
19
|
+
exports.DROP_RIGHT_CONTAINER = 'drop-right';
|
|
21
20
|
//# sourceMappingURL=main-layout.definition.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main-layout.definition.js","sourceRoot":"","sources":["../../src/common/main-layout.definition.ts"],"names":[],"mappings":";;;AAAA,iEAAmF;
|
|
1
|
+
{"version":3,"file":"main-layout.definition.js","sourceRoot":"","sources":["../../src/common/main-layout.definition.ts"],"names":[],"mappings":";;;AAAA,iEAAmF;AAwBtE,QAAA,kBAAkB,GAAG,MAAM,CAAC,oBAAoB,CAAC,CAAC;AAsElD,QAAA,sBAAsB,GAAG,MAAM,CAAC,wBAAwB,CAAC,CAAC;AASvE;;GAEG;AACH,MAAa,uBAAwB,SAAQ,6BAAgC;CAAG;AAAhF,0DAAgF;AAEnE,QAAA,cAAc,GAAG,MAAM,CAAC,gBAAgB,CAAC,CAAC;AAoBvD,MAAa,wBAAyB,SAAQ,6BAG5C;CAAG;AAHL,4DAGK;AAEQ,QAAA,0BAA0B,GAAG,IAAI,GAAG,CAAC,CAAC,+BAAY,CAAC,IAAI,EAAE,+BAAY,CAAC,KAAK,CAAC,CAAC,CAAC;AAE9E,QAAA,qBAAqB,GAAG,aAAa,CAAC;AACtC,QAAA,oBAAoB,GAAG,YAAY,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opensumi/ide-main-layout",
|
|
3
|
-
"version": "3.9.1-next-
|
|
3
|
+
"version": "3.9.1-next-1748425792.0",
|
|
4
4
|
"description": "@opensumi/ide-main-layout",
|
|
5
5
|
"files": [
|
|
6
6
|
"lib",
|
|
@@ -18,14 +18,14 @@
|
|
|
18
18
|
"url": "git@github.com:opensumi/core.git"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@opensumi/ide-components": "3.9.1-next-
|
|
22
|
-
"@opensumi/ide-core-browser": "3.9.1-next-
|
|
23
|
-
"@opensumi/ide-core-common": "3.9.1-next-
|
|
24
|
-
"@opensumi/ide-theme": "3.9.1-next-
|
|
21
|
+
"@opensumi/ide-components": "3.9.1-next-1748425792.0",
|
|
22
|
+
"@opensumi/ide-core-browser": "3.9.1-next-1748425792.0",
|
|
23
|
+
"@opensumi/ide-core-common": "3.9.1-next-1748425792.0",
|
|
24
|
+
"@opensumi/ide-theme": "3.9.1-next-1748425792.0"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
|
-
"@opensumi/ide-dev-tool": "3.9.1-next-
|
|
28
|
-
"@opensumi/ide-monaco": "3.9.1-next-
|
|
27
|
+
"@opensumi/ide-dev-tool": "3.9.1-next-1748425792.0",
|
|
28
|
+
"@opensumi/ide-monaco": "3.9.1-next-1748425792.0"
|
|
29
29
|
},
|
|
30
|
-
"gitHead": "
|
|
30
|
+
"gitHead": "0e655f74e699a47a29624a1bb3afed069d6d9366"
|
|
31
31
|
}
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
isDefined,
|
|
22
22
|
localize,
|
|
23
23
|
} from '@opensumi/ide-core-browser';
|
|
24
|
-
import {
|
|
24
|
+
import { RESIZE_LOCK } from '@opensumi/ide-core-browser/lib/components';
|
|
25
25
|
import {
|
|
26
26
|
ISplitPanelService,
|
|
27
27
|
SplitPanelManager,
|
|
@@ -85,6 +85,9 @@ export class AccordionService extends WithEventBus {
|
|
|
85
85
|
@Autowired()
|
|
86
86
|
private viewContextKeyRegistry: ViewContextKeyRegistry;
|
|
87
87
|
|
|
88
|
+
@Autowired(IMainLayoutService)
|
|
89
|
+
private readonly mainLayoutService: IMainLayoutService;
|
|
90
|
+
|
|
88
91
|
@Autowired(IContextKeyService)
|
|
89
92
|
private contextKeyService: IContextKeyService;
|
|
90
93
|
|
|
@@ -149,15 +152,6 @@ export class AccordionService extends WithEventBus {
|
|
|
149
152
|
private afterDisposeViewEmitter = this.registerDispose(new Emitter<string>());
|
|
150
153
|
public onAfterDisposeViewEvent = this.afterDisposeViewEmitter.event;
|
|
151
154
|
|
|
152
|
-
private _alignment: Layout.alignment = 'vertical';
|
|
153
|
-
|
|
154
|
-
public set alignment(alignment: Layout.alignment) {
|
|
155
|
-
if (this._alignment !== alignment) {
|
|
156
|
-
this._alignment = alignment;
|
|
157
|
-
this.doUpdateResize();
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
|
|
161
155
|
constructor(public containerId: string, private noRestore?: boolean) {
|
|
162
156
|
super();
|
|
163
157
|
this.addDispose(recomputeInitiallyAndOnChange(this.visibleViews));
|
|
@@ -617,24 +611,39 @@ export class AccordionService extends WithEventBus {
|
|
|
617
611
|
const viewState = this.getViewState(viewId);
|
|
618
612
|
this.updateViewState(viewId, { ...viewState, collapsed });
|
|
619
613
|
|
|
620
|
-
const
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
614
|
+
const container = this.mainLayoutService.getContainer(this.containerId)!;
|
|
615
|
+
if (container?.options?.alignment !== 'horizontal') {
|
|
616
|
+
let sizeIncrement: number;
|
|
617
|
+
if (collapsed) {
|
|
618
|
+
sizeIncrement = this.setSize(index, 0, false, noAnimation);
|
|
619
|
+
} else {
|
|
620
|
+
// 仅有一个视图展开时独占
|
|
621
|
+
sizeIncrement = this.setSize(
|
|
622
|
+
index,
|
|
623
|
+
this.expandedViews.length === 1 ? this.getAvailableSize() : viewState.size || this.minSize,
|
|
624
|
+
false,
|
|
625
|
+
noAnimation,
|
|
626
|
+
);
|
|
627
|
+
}
|
|
628
|
+
// 下方视图被影响的情况下,上方视图不会同时变化,该情况会在sizeIncrement=0上体现
|
|
629
|
+
// 从视图下方最后一个展开的视图起依次减去对应的高度
|
|
630
|
+
for (let i = this.visibleViews.get().length - 1; i > index; i--) {
|
|
631
|
+
if (this.getViewState(this.visibleViews.get()[i].id).collapsed !== true) {
|
|
632
|
+
sizeIncrement = this.setSize(i, sizeIncrement, true, noAnimation);
|
|
633
|
+
} else {
|
|
634
|
+
this.setSize(i, 0, false, noAnimation);
|
|
635
|
+
}
|
|
636
|
+
}
|
|
637
|
+
// 找到视图上方首个展开的视图减去对应的高度
|
|
638
|
+
for (let i = index - 1; i >= 0; i--) {
|
|
639
|
+
if ((this.state[this.visibleViews.get()[i].id] || {}).collapsed !== true) {
|
|
640
|
+
sizeIncrement = this.setSize(i, sizeIncrement, true, noAnimation);
|
|
641
|
+
} else {
|
|
642
|
+
this.setSize(i, 0, false, noAnimation);
|
|
643
|
+
}
|
|
644
|
+
}
|
|
633
645
|
}
|
|
634
646
|
|
|
635
|
-
// 统一的相邻视图调整逻辑
|
|
636
|
-
this.adjustAdjacentViews(index, sizeIncrement, noAnimation, isHorizontal);
|
|
637
|
-
|
|
638
647
|
this.eventBus.fire(
|
|
639
648
|
new ViewCollapseChangedEvent({
|
|
640
649
|
viewId,
|
|
@@ -643,49 +652,6 @@ export class AccordionService extends WithEventBus {
|
|
|
643
652
|
);
|
|
644
653
|
}
|
|
645
654
|
|
|
646
|
-
private setSizeByAlignment(
|
|
647
|
-
index: number,
|
|
648
|
-
targetSize: number,
|
|
649
|
-
isIncrement?: boolean,
|
|
650
|
-
noAnimation?: boolean,
|
|
651
|
-
isHorizontal?: boolean,
|
|
652
|
-
): number {
|
|
653
|
-
return isHorizontal
|
|
654
|
-
? this.setSizeHorizontal(index, targetSize, isIncrement, noAnimation)
|
|
655
|
-
: this.setSize(index, targetSize, isIncrement, noAnimation);
|
|
656
|
-
}
|
|
657
|
-
|
|
658
|
-
private getAvailableSizeByAlignment(isHorizontal: boolean): number {
|
|
659
|
-
return isHorizontal ? this.getAvailableSizeHorizontal() : this.getAvailableSize();
|
|
660
|
-
}
|
|
661
|
-
|
|
662
|
-
private adjustAdjacentViews(
|
|
663
|
-
currentIndex: number,
|
|
664
|
-
sizeIncrement: number,
|
|
665
|
-
noAnimation?: boolean,
|
|
666
|
-
isHorizontal?: boolean,
|
|
667
|
-
) {
|
|
668
|
-
const visibleViews = this.visibleViews.get();
|
|
669
|
-
|
|
670
|
-
// 处理当前视图后方的视图(右侧或下方)
|
|
671
|
-
for (let i = visibleViews.length - 1; i > currentIndex; i--) {
|
|
672
|
-
if (this.getViewState(visibleViews[i].id).collapsed !== true) {
|
|
673
|
-
sizeIncrement = this.setSizeByAlignment(i, sizeIncrement, true, noAnimation, isHorizontal);
|
|
674
|
-
} else {
|
|
675
|
-
this.setSizeByAlignment(i, 0, false, noAnimation, isHorizontal);
|
|
676
|
-
}
|
|
677
|
-
}
|
|
678
|
-
|
|
679
|
-
// 处理当前视图前方的视图(左侧或上方)
|
|
680
|
-
for (let i = currentIndex - 1; i >= 0; i--) {
|
|
681
|
-
if ((this.state[visibleViews[i].id] || {}).collapsed !== true) {
|
|
682
|
-
sizeIncrement = this.setSizeByAlignment(i, sizeIncrement, true, noAnimation, isHorizontal);
|
|
683
|
-
} else {
|
|
684
|
-
this.setSizeByAlignment(i, 0, false, noAnimation, isHorizontal);
|
|
685
|
-
}
|
|
686
|
-
}
|
|
687
|
-
}
|
|
688
|
-
|
|
689
655
|
protected setSize(index: number, targetSize: number, isIncrement?: boolean, noAnimation?: boolean): number {
|
|
690
656
|
const view = this.visibleViews.get()[index];
|
|
691
657
|
const fullHeight = this.splitPanelService.rootNode?.clientHeight;
|
|
@@ -759,89 +725,6 @@ export class AccordionService extends WithEventBus {
|
|
|
759
725
|
return fullHeight ? fullHeight - (this.visibleViews.get().length - 1) * this.headerSize : 0;
|
|
760
726
|
}
|
|
761
727
|
|
|
762
|
-
protected setSizeHorizontal(index: number, targetSize: number, isIncrement?: boolean, noAnimation?: boolean): number {
|
|
763
|
-
const view = this.visibleViews.get()[index];
|
|
764
|
-
const fullWidth = this.splitPanelService.rootNode?.clientWidth;
|
|
765
|
-
const panel = this.splitPanelService.panels[index];
|
|
766
|
-
|
|
767
|
-
if (!panel) {
|
|
768
|
-
return 0;
|
|
769
|
-
}
|
|
770
|
-
|
|
771
|
-
if (!noAnimation) {
|
|
772
|
-
panel.classList.add('resize-ease-horizontal');
|
|
773
|
-
}
|
|
774
|
-
|
|
775
|
-
if (!targetSize && !isIncrement) {
|
|
776
|
-
targetSize = this.headerSize;
|
|
777
|
-
panel.classList.add(RESIZE_LOCK);
|
|
778
|
-
} else {
|
|
779
|
-
panel.classList.remove(RESIZE_LOCK);
|
|
780
|
-
}
|
|
781
|
-
|
|
782
|
-
// clientWidth会被上次展开的元素挤掉
|
|
783
|
-
const prevSize = panel.clientWidth;
|
|
784
|
-
const viewState = this.getViewState(view.id);
|
|
785
|
-
let calcTargetSize: number = targetSize;
|
|
786
|
-
|
|
787
|
-
if (isIncrement) {
|
|
788
|
-
calcTargetSize = Math.max(prevSize - targetSize, this.minSize);
|
|
789
|
-
}
|
|
790
|
-
|
|
791
|
-
if (index === this.expandedViews.length - 1 && isDefined(fullWidth)) {
|
|
792
|
-
// 最后一个视图需要兼容最大宽度超出总视图宽度及最大宽度不足总视图宽度的情况
|
|
793
|
-
if (calcTargetSize + index * this.minSize > fullWidth) {
|
|
794
|
-
calcTargetSize -= calcTargetSize + index * this.minSize - fullWidth;
|
|
795
|
-
} else {
|
|
796
|
-
const restSize = this.getPanelFullWidthHorizontal(view.id);
|
|
797
|
-
if (calcTargetSize + restSize < fullWidth) {
|
|
798
|
-
calcTargetSize += fullWidth - (calcTargetSize + restSize);
|
|
799
|
-
}
|
|
800
|
-
}
|
|
801
|
-
}
|
|
802
|
-
|
|
803
|
-
if (this.rendered) {
|
|
804
|
-
let toSaveSize: number;
|
|
805
|
-
if (targetSize === this.headerSize) {
|
|
806
|
-
// 当前视图即将折叠且不是唯一展开的视图时,存储当前宽度
|
|
807
|
-
toSaveSize = prevSize;
|
|
808
|
-
} else {
|
|
809
|
-
toSaveSize = calcTargetSize;
|
|
810
|
-
}
|
|
811
|
-
if (toSaveSize !== this.headerSize) {
|
|
812
|
-
// 视图折叠宽度不做存储
|
|
813
|
-
viewState.size = toSaveSize;
|
|
814
|
-
}
|
|
815
|
-
}
|
|
816
|
-
|
|
817
|
-
this.storeState();
|
|
818
|
-
viewState.nextSize = calcTargetSize;
|
|
819
|
-
|
|
820
|
-
if (!noAnimation) {
|
|
821
|
-
setTimeout(() => {
|
|
822
|
-
// 动画 0.1s,保证结束后移除
|
|
823
|
-
panel.classList.remove('resize-ease-horizontal');
|
|
824
|
-
}, 200);
|
|
825
|
-
}
|
|
826
|
-
|
|
827
|
-
return isIncrement ? calcTargetSize - (prevSize - targetSize) : targetSize - prevSize;
|
|
828
|
-
}
|
|
829
|
-
|
|
830
|
-
protected getAvailableSizeHorizontal() {
|
|
831
|
-
const fullWidth = this.splitPanelService.rootNode?.clientWidth;
|
|
832
|
-
return fullWidth ? fullWidth - (this.visibleViews.get().length - 1) * this.headerSize : 0;
|
|
833
|
-
}
|
|
834
|
-
|
|
835
|
-
private getPanelFullWidthHorizontal(ignoreViewId?: string) {
|
|
836
|
-
return Object.keys(this.state)
|
|
837
|
-
.filter((viewId) => this.views.find((item) => item.id === viewId) && viewId !== ignoreViewId)
|
|
838
|
-
.reduce(
|
|
839
|
-
(acc, id) =>
|
|
840
|
-
acc + (this.state[id].collapsed ? this.headerSize : this.state[id].hidden ? 0 : this.state[id].size!),
|
|
841
|
-
0,
|
|
842
|
-
);
|
|
843
|
-
}
|
|
844
|
-
|
|
845
728
|
private handleContextKeyChange() {
|
|
846
729
|
Array.from(this.viewsWithContextKey.values()).forEach((view) => {
|
|
847
730
|
if (
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import cls from 'classnames';
|
|
2
1
|
import React, { useMemo } from 'react';
|
|
3
2
|
|
|
4
3
|
import { View, useAutorun, useInjectable } from '@opensumi/ide-core-browser';
|
|
@@ -34,7 +33,6 @@ export const AccordionContainer = ({
|
|
|
34
33
|
const layoutViewSize = useInjectable<LayoutViewSizeConfig>(LayoutViewSizeConfig);
|
|
35
34
|
|
|
36
35
|
const accordionService: AccordionService = useInjectable(AccordionServiceFactory)(containerId, noRestore);
|
|
37
|
-
accordionService.alignment = alignment;
|
|
38
36
|
const visibleViews = useAutorun(accordionService.visibleViews);
|
|
39
37
|
|
|
40
38
|
useAutorun(accordionService.stateObservable);
|
|
@@ -54,10 +52,10 @@ export const AccordionContainer = ({
|
|
|
54
52
|
React.useEffect(() => {
|
|
55
53
|
accordionService.initConfig({ headerSize: layoutHeaderSize, minSize });
|
|
56
54
|
}, []);
|
|
57
|
-
|
|
55
|
+
|
|
58
56
|
return (
|
|
59
57
|
<SplitPanel
|
|
60
|
-
className={
|
|
58
|
+
className={className}
|
|
61
59
|
style={style}
|
|
62
60
|
headerSize={headerSize}
|
|
63
61
|
dynamicTarget={true}
|
|
@@ -169,11 +169,7 @@ export const AccordionSection = ({
|
|
|
169
169
|
}, [expanded, headerSize, alignment]);
|
|
170
170
|
|
|
171
171
|
return (
|
|
172
|
-
<div
|
|
173
|
-
className={cls(styles_kt_split_panel, { horizontal: alignment === 'horizontal' })}
|
|
174
|
-
data-view-id={viewId}
|
|
175
|
-
draggable={false}
|
|
176
|
-
>
|
|
172
|
+
<div className={styles_kt_split_panel} data-view-id={viewId} draggable={false}>
|
|
177
173
|
{!noHeader && (
|
|
178
174
|
<div
|
|
179
175
|
{...attrs}
|
|
@@ -2,9 +2,6 @@
|
|
|
2
2
|
.resize-ease {
|
|
3
3
|
transition: height 0.1s ease-out;
|
|
4
4
|
}
|
|
5
|
-
.resize-ease-horizontal {
|
|
6
|
-
transition: width 0.1s ease-out;
|
|
7
|
-
}
|
|
8
5
|
}
|
|
9
6
|
|
|
10
7
|
.kt_split_panel_container {
|
|
@@ -13,10 +10,6 @@
|
|
|
13
10
|
height: 100%;
|
|
14
11
|
white-space: nowrap;
|
|
15
12
|
flex-direction: column;
|
|
16
|
-
|
|
17
|
-
&.horizontal {
|
|
18
|
-
flex-direction: row;
|
|
19
|
-
}
|
|
20
13
|
}
|
|
21
14
|
|
|
22
15
|
.kt_split_panel {
|
|
@@ -26,14 +19,6 @@
|
|
|
26
19
|
display: flex;
|
|
27
20
|
flex-direction: column;
|
|
28
21
|
position: relative;
|
|
29
|
-
|
|
30
|
-
&.horizontal {
|
|
31
|
-
flex-direction: column;
|
|
32
|
-
width: auto;
|
|
33
|
-
min-width: 0;
|
|
34
|
-
height: 100%;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
22
|
&:hover .actions_wrap {
|
|
38
23
|
display: block;
|
|
39
24
|
}
|
|
@@ -239,49 +224,3 @@
|
|
|
239
224
|
}
|
|
240
225
|
}
|
|
241
226
|
}
|
|
242
|
-
|
|
243
|
-
// 水平模式样式支持
|
|
244
|
-
.kt_split_panel.horizontal {
|
|
245
|
-
.kt_split_panel_header {
|
|
246
|
-
writing-mode: vertical-lr;
|
|
247
|
-
text-orientation: mixed;
|
|
248
|
-
border-top: 1px solid transparent;
|
|
249
|
-
border-left: 1px solid var(--sideBar-border);
|
|
250
|
-
flex-direction: column;
|
|
251
|
-
width: 100%;
|
|
252
|
-
height: auto;
|
|
253
|
-
justify-content: flex-start;
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
.label_wrap {
|
|
257
|
-
flex-direction: column;
|
|
258
|
-
align-items: flex-start;
|
|
259
|
-
width: 100%;
|
|
260
|
-
|
|
261
|
-
i.arrow_icon {
|
|
262
|
-
margin: 4px 0;
|
|
263
|
-
&.kt_mod_collapsed {
|
|
264
|
-
transform: rotate(-180deg);
|
|
265
|
-
}
|
|
266
|
-
}
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
.section_label {
|
|
270
|
-
writing-mode: vertical-lr;
|
|
271
|
-
text-orientation: mixed;
|
|
272
|
-
line-height: normal;
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
.section_description {
|
|
276
|
-
writing-mode: vertical-lr;
|
|
277
|
-
text-orientation: mixed;
|
|
278
|
-
margin-left: 0;
|
|
279
|
-
margin-top: 10px;
|
|
280
|
-
line-height: normal;
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
.section_badge {
|
|
284
|
-
margin-left: 0;
|
|
285
|
-
margin-top: 6px;
|
|
286
|
-
}
|
|
287
|
-
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* istanbul ignore file */
|
|
2
2
|
import { LayoutConfig, SlotLocation } from '@opensumi/ide-core-browser';
|
|
3
3
|
|
|
4
|
-
import {
|
|
4
|
+
import { DROP_BOTTOM_CONTAINER, DROP_RIGHT_CONTAINER } from '../common';
|
|
5
5
|
|
|
6
6
|
export const defaultConfig: LayoutConfig = {
|
|
7
7
|
[SlotLocation.top]: {
|
|
@@ -10,26 +10,25 @@ export const defaultConfig: LayoutConfig = {
|
|
|
10
10
|
[SlotLocation.action]: {
|
|
11
11
|
modules: ['@opensumi/ide-toolbar-action'],
|
|
12
12
|
},
|
|
13
|
-
[SlotLocation.
|
|
13
|
+
[SlotLocation.left]: {
|
|
14
14
|
modules: [
|
|
15
|
-
DROP_VIEW_CONTAINER,
|
|
16
15
|
'@opensumi/ide-explorer',
|
|
17
16
|
'@opensumi/ide-search',
|
|
18
17
|
'@opensumi/ide-scm',
|
|
19
|
-
'@opensumi/ide-debug',
|
|
20
18
|
'@opensumi/ide-extension-manager',
|
|
19
|
+
'@opensumi/ide-debug',
|
|
21
20
|
'@opensumi/ide-notebook',
|
|
22
21
|
],
|
|
23
22
|
},
|
|
24
|
-
[SlotLocation.
|
|
25
|
-
modules: [
|
|
23
|
+
[SlotLocation.right]: {
|
|
24
|
+
modules: [DROP_RIGHT_CONTAINER],
|
|
26
25
|
},
|
|
27
26
|
[SlotLocation.main]: {
|
|
28
27
|
modules: ['@opensumi/ide-editor'],
|
|
29
28
|
},
|
|
30
|
-
[SlotLocation.
|
|
29
|
+
[SlotLocation.bottom]: {
|
|
31
30
|
modules: [
|
|
32
|
-
|
|
31
|
+
DROP_BOTTOM_CONTAINER,
|
|
33
32
|
'@opensumi/ide-terminal-next',
|
|
34
33
|
'@opensumi/ide-output',
|
|
35
34
|
'debug-console',
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { localize, useInjectable } from '@opensumi/ide-core-browser';
|
|
4
4
|
|
|
5
5
|
import { IMainLayoutService } from '../../common';
|
|
6
6
|
|
|
@@ -18,7 +18,6 @@ const DropArea: React.FC<IDropAreaProps> = (props) => {
|
|
|
18
18
|
(e: React.DragEvent) => {
|
|
19
19
|
const containerId = e.dataTransfer?.getData('containerId');
|
|
20
20
|
layoutService.moveContainerTo(containerId, location);
|
|
21
|
-
layoutService.hideDropArea();
|
|
22
21
|
},
|
|
23
22
|
[layoutService, location],
|
|
24
23
|
);
|
|
@@ -36,8 +35,6 @@ const DropArea: React.FC<IDropAreaProps> = (props) => {
|
|
|
36
35
|
);
|
|
37
36
|
};
|
|
38
37
|
|
|
39
|
-
export const
|
|
38
|
+
export const RightDropArea = () => <DropArea location='right' />;
|
|
40
39
|
|
|
41
|
-
export const
|
|
42
|
-
|
|
43
|
-
export const PanelDropArea = () => <DropArea location={SlotLocation.panel} />;
|
|
40
|
+
export const BottomDropArea = () => <DropArea location='bottom' />;
|
package/src/browser/index.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Injectable, Injector, Provider } from '@opensumi/di';
|
|
2
2
|
import { BrowserModule } from '@opensumi/ide-core-browser';
|
|
3
|
-
import { Layout } from '@opensumi/ide-core-browser/lib/components';
|
|
4
3
|
|
|
5
4
|
import { IMainLayoutService, IViewsRegistry, MainLayoutContribution } from '../common';
|
|
6
5
|
|