@opensumi/ide-core-browser 3.2.4-next-1723688727.0 → 3.2.4
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/layout/constants.d.ts +7 -11
- package/lib/layout/constants.d.ts.map +1 -1
- package/lib/layout/constants.js +36 -66
- package/lib/layout/constants.js.map +1 -1
- package/lib/layout/index.d.ts +0 -1
- package/lib/layout/index.d.ts.map +1 -1
- package/lib/layout/index.js +0 -1
- package/lib/layout/index.js.map +1 -1
- package/package.json +8 -5
- package/src/layout/constants.ts +37 -69
- package/src/layout/index.ts +0 -1
- package/lib/layout/render.d.ts +0 -4
- package/lib/layout/render.d.ts.map +0 -1
- package/lib/layout/render.js +0 -10
- package/lib/layout/render.js.map +0 -1
- package/src/layout/render.tsx +0 -14
|
@@ -9,28 +9,24 @@ export interface ILayoutViewSize {
|
|
|
9
9
|
accordionHeaderSizeHeight: number;
|
|
10
10
|
}
|
|
11
11
|
export declare const DEFAULT_LAYOUT_VIEW_SIZE: ILayoutViewSize;
|
|
12
|
-
export declare enum ConfigPriority {
|
|
13
|
-
ModuleDefined = 0,
|
|
14
|
-
UserDefined = 1
|
|
15
|
-
}
|
|
16
12
|
export declare class LayoutViewSizeConfig implements ILayoutViewSize {
|
|
17
13
|
#private;
|
|
18
14
|
private inited;
|
|
19
15
|
init(layoutViewSize?: Partial<ILayoutViewSize>): void;
|
|
20
16
|
get menubarHeight(): number;
|
|
21
|
-
setMenubarHeight(value: number
|
|
17
|
+
setMenubarHeight(value: number): void;
|
|
22
18
|
get editorTabsHeight(): number;
|
|
23
|
-
setEditorTabsHeight(value: number
|
|
19
|
+
setEditorTabsHeight(value: number): void;
|
|
24
20
|
get bigSurTitleBarHeight(): number;
|
|
25
|
-
setBigSurTitleBarHeight(value: number
|
|
21
|
+
setBigSurTitleBarHeight(value: number): void;
|
|
26
22
|
get titleBarHeight(): number;
|
|
27
|
-
setTitleBarHeight(value: number
|
|
23
|
+
setTitleBarHeight(value: number): void;
|
|
28
24
|
get panelTitleBarHeight(): number;
|
|
29
|
-
setPanelTitleBarHeight(value: number
|
|
25
|
+
setPanelTitleBarHeight(value: number): void;
|
|
30
26
|
get statusBarHeight(): number;
|
|
31
|
-
setStatusBarHeight(value: number
|
|
27
|
+
setStatusBarHeight(value: number): void;
|
|
32
28
|
get accordionHeaderSizeHeight(): number;
|
|
33
|
-
setAccordionHeaderSizeHeight(value: number
|
|
29
|
+
setAccordionHeaderSizeHeight(value: number): void;
|
|
34
30
|
protected supportNewMacHeaderBar: boolean;
|
|
35
31
|
calcElectronHeaderHeight(): number;
|
|
36
32
|
calcOnlyTitleBarHeight(): number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/layout/constants.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,mBAAmB,
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/layout/constants.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,mBAAmB,EAAe,MAAM,2BAA2B,CAAC;AAI7E,MAAM,WAAW,eAAe;IAC9B,aAAa,EAAE,MAAM,CAAC;IACtB,gBAAgB,EAAE,MAAM,CAAC;IACzB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,cAAc,EAAE,MAAM,CAAC;IACvB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,eAAe,EAAE,MAAM,CAAC;IACxB,yBAAyB,EAAE,MAAM,CAAC;CACnC;AAED,eAAO,MAAM,wBAAwB,EAAE,eAQtC,CAAC;AAEF,qBACa,oBAAqB,YAAW,eAAe;;IAS1D,OAAO,CAAC,MAAM,CAAS;IACvB,IAAI,CAAC,cAAc,GAAE,OAAO,CAAC,eAAe,CAAM;IAgBlD,IAAI,aAAa,IAAI,MAAM,CAE1B;IACD,gBAAgB,CAAC,KAAK,EAAE,MAAM;IAI9B,IAAI,gBAAgB,IAAI,MAAM,CAE7B;IACD,mBAAmB,CAAC,KAAK,EAAE,MAAM;IAIjC,IAAI,oBAAoB,IAAI,MAAM,CAEjC;IACD,uBAAuB,CAAC,KAAK,EAAE,MAAM;IAIrC,IAAI,cAAc,IAAI,MAAM,CAE3B;IACD,iBAAiB,CAAC,KAAK,EAAE,MAAM;IAI/B,IAAI,mBAAmB,IAAI,MAAM,CAEhC;IACD,sBAAsB,CAAC,KAAK,EAAE,MAAM;IAIpC,IAAI,eAAe,IAAI,MAAM,CAE5B;IACD,kBAAkB,CAAC,KAAK,EAAE,MAAM;IAIhC,IAAI,yBAAyB,IAAI,MAAM,CAEtC;IACD,4BAA4B,CAAC,KAAK,EAAE,MAAM;IAI1C,SAAS,CAAC,sBAAsB,UAA2E;IAE3G,wBAAwB,IAAI,MAAM;IAQlC,sBAAsB,IAAI,MAAM;CAMjC;AAED,qBACa,kBAAmB,YAAW,mBAAmB;IAC5D,OAAO,CAAC,cAAc,CAIpB;IAEF,SAAS,CAAC,GAAG,KAAK,EAAE,CAAC,OAAO,CAAC,mBAAmB,CAAC,GAAG,SAAS,CAAC,EAAE,GAAG,IAAI;IAIvE,IAAI,0BAA0B,IAAI,OAAO,CAExC;IAED,IAAI,WAAW,IAAI,MAAM,CAExB;CACF"}
|
package/lib/layout/constants.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var _LayoutViewSizeConfig_menubarHeight, _LayoutViewSizeConfig_editorTabsHeight, _LayoutViewSizeConfig_bigSurTitleBarHeight, _LayoutViewSizeConfig_titleBarHeight, _LayoutViewSizeConfig_panelTitleBarHeight, _LayoutViewSizeConfig_statusBarHeight, _LayoutViewSizeConfig_accordionHeaderSizeHeight;
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.DesignLayoutConfig = exports.LayoutViewSizeConfig = exports.
|
|
4
|
+
exports.DesignLayoutConfig = exports.LayoutViewSizeConfig = exports.DEFAULT_LAYOUT_VIEW_SIZE = void 0;
|
|
5
5
|
const tslib_1 = require("tslib");
|
|
6
6
|
const merge_1 = tslib_1.__importDefault(require("lodash/merge"));
|
|
7
7
|
const di_1 = require("@opensumi/di");
|
|
@@ -16,45 +16,15 @@ exports.DEFAULT_LAYOUT_VIEW_SIZE = {
|
|
|
16
16
|
statusBarHeight: 24,
|
|
17
17
|
accordionHeaderSizeHeight: 24,
|
|
18
18
|
};
|
|
19
|
-
var ConfigPriority;
|
|
20
|
-
(function (ConfigPriority) {
|
|
21
|
-
ConfigPriority[ConfigPriority["ModuleDefined"] = 0] = "ModuleDefined";
|
|
22
|
-
ConfigPriority[ConfigPriority["UserDefined"] = 1] = "UserDefined";
|
|
23
|
-
})(ConfigPriority = exports.ConfigPriority || (exports.ConfigPriority = {}));
|
|
24
|
-
/**
|
|
25
|
-
* 支持多档优先级配置
|
|
26
|
-
*/
|
|
27
|
-
class ConfigAtom {
|
|
28
|
-
constructor(defaultValue) {
|
|
29
|
-
this.defaultValue = defaultValue;
|
|
30
|
-
/**
|
|
31
|
-
* index 越高,优先级越高
|
|
32
|
-
*/
|
|
33
|
-
this._value = [];
|
|
34
|
-
}
|
|
35
|
-
setValue(value, priority) {
|
|
36
|
-
this._value[priority] = value;
|
|
37
|
-
}
|
|
38
|
-
getValue() {
|
|
39
|
-
let value = this.defaultValue;
|
|
40
|
-
for (let i = this._value.length - 1; i >= 0; i--) {
|
|
41
|
-
if ((0, ide_core_common_1.isDefined)(this._value[i])) {
|
|
42
|
-
value = this._value[i];
|
|
43
|
-
break;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
return value;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
19
|
let LayoutViewSizeConfig = class LayoutViewSizeConfig {
|
|
50
20
|
constructor() {
|
|
51
|
-
_LayoutViewSizeConfig_menubarHeight.set(this,
|
|
52
|
-
_LayoutViewSizeConfig_editorTabsHeight.set(this,
|
|
53
|
-
_LayoutViewSizeConfig_bigSurTitleBarHeight.set(this,
|
|
54
|
-
_LayoutViewSizeConfig_titleBarHeight.set(this,
|
|
55
|
-
_LayoutViewSizeConfig_panelTitleBarHeight.set(this,
|
|
56
|
-
_LayoutViewSizeConfig_statusBarHeight.set(this,
|
|
57
|
-
_LayoutViewSizeConfig_accordionHeaderSizeHeight.set(this,
|
|
21
|
+
_LayoutViewSizeConfig_menubarHeight.set(this, void 0);
|
|
22
|
+
_LayoutViewSizeConfig_editorTabsHeight.set(this, void 0);
|
|
23
|
+
_LayoutViewSizeConfig_bigSurTitleBarHeight.set(this, void 0);
|
|
24
|
+
_LayoutViewSizeConfig_titleBarHeight.set(this, void 0);
|
|
25
|
+
_LayoutViewSizeConfig_panelTitleBarHeight.set(this, void 0);
|
|
26
|
+
_LayoutViewSizeConfig_statusBarHeight.set(this, void 0);
|
|
27
|
+
_LayoutViewSizeConfig_accordionHeaderSizeHeight.set(this, void 0);
|
|
58
28
|
this.inited = false;
|
|
59
29
|
this.supportNewMacHeaderBar = electron_1.electronEnv.osRelease ? parseFloat(electron_1.electronEnv.osRelease) >= 20 : false;
|
|
60
30
|
}
|
|
@@ -63,55 +33,55 @@ let LayoutViewSizeConfig = class LayoutViewSizeConfig {
|
|
|
63
33
|
return;
|
|
64
34
|
}
|
|
65
35
|
this.inited = true;
|
|
66
|
-
tslib_1.
|
|
67
|
-
tslib_1.
|
|
68
|
-
tslib_1.
|
|
69
|
-
tslib_1.
|
|
70
|
-
tslib_1.
|
|
71
|
-
tslib_1.
|
|
72
|
-
tslib_1.
|
|
36
|
+
tslib_1.__classPrivateFieldSet(this, _LayoutViewSizeConfig_menubarHeight, layoutViewSize.menubarHeight || exports.DEFAULT_LAYOUT_VIEW_SIZE.menubarHeight, "f");
|
|
37
|
+
tslib_1.__classPrivateFieldSet(this, _LayoutViewSizeConfig_editorTabsHeight, layoutViewSize.editorTabsHeight || exports.DEFAULT_LAYOUT_VIEW_SIZE.editorTabsHeight, "f");
|
|
38
|
+
tslib_1.__classPrivateFieldSet(this, _LayoutViewSizeConfig_bigSurTitleBarHeight, layoutViewSize.bigSurTitleBarHeight || exports.DEFAULT_LAYOUT_VIEW_SIZE.bigSurTitleBarHeight, "f");
|
|
39
|
+
tslib_1.__classPrivateFieldSet(this, _LayoutViewSizeConfig_titleBarHeight, layoutViewSize.titleBarHeight || exports.DEFAULT_LAYOUT_VIEW_SIZE.titleBarHeight, "f");
|
|
40
|
+
tslib_1.__classPrivateFieldSet(this, _LayoutViewSizeConfig_panelTitleBarHeight, layoutViewSize.panelTitleBarHeight || exports.DEFAULT_LAYOUT_VIEW_SIZE.panelTitleBarHeight, "f");
|
|
41
|
+
tslib_1.__classPrivateFieldSet(this, _LayoutViewSizeConfig_statusBarHeight, layoutViewSize.statusBarHeight || exports.DEFAULT_LAYOUT_VIEW_SIZE.statusBarHeight, "f");
|
|
42
|
+
tslib_1.__classPrivateFieldSet(this, _LayoutViewSizeConfig_accordionHeaderSizeHeight, layoutViewSize.accordionHeaderSizeHeight || exports.DEFAULT_LAYOUT_VIEW_SIZE.accordionHeaderSizeHeight, "f");
|
|
73
43
|
}
|
|
74
44
|
get menubarHeight() {
|
|
75
|
-
return tslib_1.__classPrivateFieldGet(this, _LayoutViewSizeConfig_menubarHeight, "f")
|
|
45
|
+
return tslib_1.__classPrivateFieldGet(this, _LayoutViewSizeConfig_menubarHeight, "f");
|
|
76
46
|
}
|
|
77
|
-
setMenubarHeight(value
|
|
78
|
-
tslib_1.
|
|
47
|
+
setMenubarHeight(value) {
|
|
48
|
+
tslib_1.__classPrivateFieldSet(this, _LayoutViewSizeConfig_menubarHeight, value, "f");
|
|
79
49
|
}
|
|
80
50
|
get editorTabsHeight() {
|
|
81
|
-
return tslib_1.__classPrivateFieldGet(this, _LayoutViewSizeConfig_editorTabsHeight, "f")
|
|
51
|
+
return tslib_1.__classPrivateFieldGet(this, _LayoutViewSizeConfig_editorTabsHeight, "f");
|
|
82
52
|
}
|
|
83
|
-
setEditorTabsHeight(value
|
|
84
|
-
tslib_1.
|
|
53
|
+
setEditorTabsHeight(value) {
|
|
54
|
+
tslib_1.__classPrivateFieldSet(this, _LayoutViewSizeConfig_editorTabsHeight, value, "f");
|
|
85
55
|
}
|
|
86
56
|
get bigSurTitleBarHeight() {
|
|
87
|
-
return tslib_1.__classPrivateFieldGet(this, _LayoutViewSizeConfig_bigSurTitleBarHeight, "f")
|
|
57
|
+
return tslib_1.__classPrivateFieldGet(this, _LayoutViewSizeConfig_bigSurTitleBarHeight, "f");
|
|
88
58
|
}
|
|
89
|
-
setBigSurTitleBarHeight(value
|
|
90
|
-
tslib_1.
|
|
59
|
+
setBigSurTitleBarHeight(value) {
|
|
60
|
+
tslib_1.__classPrivateFieldSet(this, _LayoutViewSizeConfig_bigSurTitleBarHeight, value, "f");
|
|
91
61
|
}
|
|
92
62
|
get titleBarHeight() {
|
|
93
|
-
return tslib_1.__classPrivateFieldGet(this, _LayoutViewSizeConfig_titleBarHeight, "f")
|
|
63
|
+
return tslib_1.__classPrivateFieldGet(this, _LayoutViewSizeConfig_titleBarHeight, "f");
|
|
94
64
|
}
|
|
95
|
-
setTitleBarHeight(value
|
|
96
|
-
tslib_1.
|
|
65
|
+
setTitleBarHeight(value) {
|
|
66
|
+
tslib_1.__classPrivateFieldSet(this, _LayoutViewSizeConfig_titleBarHeight, value, "f");
|
|
97
67
|
}
|
|
98
68
|
get panelTitleBarHeight() {
|
|
99
|
-
return tslib_1.__classPrivateFieldGet(this, _LayoutViewSizeConfig_panelTitleBarHeight, "f")
|
|
69
|
+
return tslib_1.__classPrivateFieldGet(this, _LayoutViewSizeConfig_panelTitleBarHeight, "f");
|
|
100
70
|
}
|
|
101
|
-
setPanelTitleBarHeight(value
|
|
102
|
-
tslib_1.
|
|
71
|
+
setPanelTitleBarHeight(value) {
|
|
72
|
+
tslib_1.__classPrivateFieldSet(this, _LayoutViewSizeConfig_panelTitleBarHeight, value, "f");
|
|
103
73
|
}
|
|
104
74
|
get statusBarHeight() {
|
|
105
|
-
return tslib_1.__classPrivateFieldGet(this, _LayoutViewSizeConfig_statusBarHeight, "f")
|
|
75
|
+
return tslib_1.__classPrivateFieldGet(this, _LayoutViewSizeConfig_statusBarHeight, "f");
|
|
106
76
|
}
|
|
107
|
-
setStatusBarHeight(value
|
|
108
|
-
tslib_1.
|
|
77
|
+
setStatusBarHeight(value) {
|
|
78
|
+
tslib_1.__classPrivateFieldSet(this, _LayoutViewSizeConfig_statusBarHeight, value, "f");
|
|
109
79
|
}
|
|
110
80
|
get accordionHeaderSizeHeight() {
|
|
111
|
-
return tslib_1.__classPrivateFieldGet(this, _LayoutViewSizeConfig_accordionHeaderSizeHeight, "f")
|
|
81
|
+
return tslib_1.__classPrivateFieldGet(this, _LayoutViewSizeConfig_accordionHeaderSizeHeight, "f");
|
|
112
82
|
}
|
|
113
|
-
setAccordionHeaderSizeHeight(value
|
|
114
|
-
tslib_1.
|
|
83
|
+
setAccordionHeaderSizeHeight(value) {
|
|
84
|
+
tslib_1.__classPrivateFieldSet(this, _LayoutViewSizeConfig_accordionHeaderSizeHeight, value, "f");
|
|
115
85
|
}
|
|
116
86
|
calcElectronHeaderHeight() {
|
|
117
87
|
if (ide_core_common_1.isMacintosh) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/layout/constants.ts"],"names":[],"mappings":";;;;;AAAA,iEAAiC;AAEjC,qCAA0C;AAC1C,+
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/layout/constants.ts"],"names":[],"mappings":";;;;;AAAA,iEAAiC;AAEjC,qCAA0C;AAC1C,+DAA6E;AAE7E,gDAAgD;AAYnC,QAAA,wBAAwB,GAAoB;IACvD,aAAa,EAAE,EAAE;IACjB,gBAAgB,EAAE,EAAE;IACpB,oBAAoB,EAAE,EAAE;IACxB,cAAc,EAAE,EAAE;IAClB,mBAAmB,EAAE,EAAE;IACvB,eAAe,EAAE,EAAE;IACnB,yBAAyB,EAAE,EAAE;CAC9B,CAAC;AAGK,IAAM,oBAAoB,G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AAC;SAClC;QACD,OAAO,IAAI,CAAC,cAAc,CAAC;IAC7B,CAAC;CACF,CAAA;;AA3FY,oBAAoB;IADhC,IAAA,eAAU,GAAE;GACA,oBAAoB,CA2FhC;AA3FY,oDAAoB;AA8F1B,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;IAAxB;QACG,mBAAc,GAAkC;YACtD,0BAA0B,EAAE,KAAK;YACjC,cAAc,EAAE,KAAK;YACrB,WAAW,EAAE,EAAE;SAChB,CAAC;IAaJ,CAAC;IAXC,SAAS,CAAC,GAAG,KAAmD;QAC9D,IAAI,CAAC,cAAc,GAAG,IAAA,eAAK,EAAC,IAAI,CAAC,cAAc,EAAE,GAAG,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC;IAC7E,CAAC;IAED,IAAI,0BAA0B;QAC5B,OAAO,IAAI,CAAC,cAAc,CAAC,0BAA0B,CAAC;IACxD,CAAC;IAED,IAAI,WAAW;QACb,OAAO,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC;IACzC,CAAC;CACF,CAAA;AAlBY,kBAAkB;IAD9B,IAAA,eAAU,GAAE;GACA,kBAAkB,CAkB9B;AAlBY,gDAAkB"}
|
package/lib/layout/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/layout/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,uCAAuC,CAAC;AACtD,cAAc,6BAA6B,CAAC
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/layout/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,uCAAuC,CAAC;AACtD,cAAc,6BAA6B,CAAC"}
|
package/lib/layout/index.js
CHANGED
|
@@ -6,5 +6,4 @@ tslib_1.__exportStar(require("./layout-hooks"), exports);
|
|
|
6
6
|
tslib_1.__exportStar(require("./layout.interface"), exports);
|
|
7
7
|
tslib_1.__exportStar(require("./accordion/view-context-key.registry"), exports);
|
|
8
8
|
tslib_1.__exportStar(require("./accordion/tab-bar-toolbar"), exports);
|
|
9
|
-
tslib_1.__exportStar(require("./render"), exports);
|
|
10
9
|
//# sourceMappingURL=index.js.map
|
package/lib/layout/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/layout/index.ts"],"names":[],"mappings":";;;AAAA,mDAAyB;AACzB,yDAA+B;AAC/B,6DAAmC;AACnC,gFAAsD;AACtD,sEAA4C
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/layout/index.ts"],"names":[],"mappings":";;;AAAA,mDAAyB;AACzB,yDAA+B;AAC/B,6DAAmC;AACnC,gFAAsD;AACtD,sEAA4C"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opensumi/ide-core-browser",
|
|
3
|
-
"version": "3.2.4
|
|
3
|
+
"version": "3.2.4",
|
|
4
4
|
"description": "@opensumi/ide-core-browser",
|
|
5
5
|
"files": [
|
|
6
6
|
"lib",
|
|
@@ -18,13 +18,14 @@
|
|
|
18
18
|
"build": "tsc --build ../../configs/ts/references/tsconfig.core-browser.json"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@opensumi/ide-components": "3.2.4
|
|
22
|
-
"@opensumi/ide-connection": "3.2.4
|
|
23
|
-
"@opensumi/ide-core-common": "3.2.4
|
|
21
|
+
"@opensumi/ide-components": "3.2.4",
|
|
22
|
+
"@opensumi/ide-connection": "3.2.4",
|
|
23
|
+
"@opensumi/ide-core-common": "3.2.4",
|
|
24
24
|
"@opensumi/vscode-debugprotocol": "1.49.0-beta.1",
|
|
25
25
|
"@vscode/codicons": "0.0.35",
|
|
26
26
|
"ajv": "^6.10.0",
|
|
27
27
|
"classnames": "2.5.1",
|
|
28
|
+
"font-awesome": "^4.7.0",
|
|
28
29
|
"fuzzy": "^0.1.3",
|
|
29
30
|
"jsonc-parser": "^2.1.0",
|
|
30
31
|
"keycode": "^2.2.0",
|
|
@@ -32,7 +33,9 @@
|
|
|
32
33
|
"mobx": "^6.12.0",
|
|
33
34
|
"mobx-react-lite": "^4.0.5",
|
|
34
35
|
"react": "^18.2.0",
|
|
36
|
+
"react-autosize-textarea": "^7.0.0",
|
|
35
37
|
"react-ctxmenu-trigger": "^1.0.0",
|
|
38
|
+
"react-custom-scrollbars": "^4.2.1",
|
|
36
39
|
"react-dom": "^18.2.0",
|
|
37
40
|
"react-is": "^18.2.0",
|
|
38
41
|
"react-window": "^1.8.5",
|
|
@@ -44,5 +47,5 @@
|
|
|
44
47
|
"react": "^18.2.0",
|
|
45
48
|
"react-dom": "^18.2.0"
|
|
46
49
|
},
|
|
47
|
-
"gitHead": "
|
|
50
|
+
"gitHead": "1e0967c6a7b1044f04059f57209a2ef593f746fb"
|
|
48
51
|
}
|
package/src/layout/constants.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import merge from 'lodash/merge';
|
|
2
2
|
|
|
3
3
|
import { Injectable } from '@opensumi/di';
|
|
4
|
-
import { IDesignLayoutConfig,
|
|
4
|
+
import { IDesignLayoutConfig, isMacintosh } from '@opensumi/ide-core-common';
|
|
5
5
|
|
|
6
6
|
import { electronEnv } from '../utils/electron';
|
|
7
7
|
|
|
@@ -25,48 +25,15 @@ export const DEFAULT_LAYOUT_VIEW_SIZE: ILayoutViewSize = {
|
|
|
25
25
|
accordionHeaderSizeHeight: 24,
|
|
26
26
|
};
|
|
27
27
|
|
|
28
|
-
export enum ConfigPriority {
|
|
29
|
-
ModuleDefined,
|
|
30
|
-
UserDefined,
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* 支持多档优先级配置
|
|
35
|
-
*/
|
|
36
|
-
class ConfigAtom<T> {
|
|
37
|
-
/**
|
|
38
|
-
* index 越高,优先级越高
|
|
39
|
-
*/
|
|
40
|
-
protected _value: (T | undefined)[] = [];
|
|
41
|
-
constructor(public defaultValue: T) {}
|
|
42
|
-
|
|
43
|
-
setValue(value: T | undefined, priority: number) {
|
|
44
|
-
this._value[priority] = value;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
getValue(): T {
|
|
48
|
-
let value = this.defaultValue;
|
|
49
|
-
|
|
50
|
-
for (let i = this._value.length - 1; i >= 0; i--) {
|
|
51
|
-
if (isDefined(this._value[i])) {
|
|
52
|
-
value = this._value[i]!;
|
|
53
|
-
break;
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
return value;
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
|
|
61
28
|
@Injectable()
|
|
62
29
|
export class LayoutViewSizeConfig implements ILayoutViewSize {
|
|
63
|
-
#menubarHeight
|
|
64
|
-
#editorTabsHeight
|
|
65
|
-
#bigSurTitleBarHeight
|
|
66
|
-
#titleBarHeight
|
|
67
|
-
#panelTitleBarHeight
|
|
68
|
-
#statusBarHeight
|
|
69
|
-
#accordionHeaderSizeHeight
|
|
30
|
+
#menubarHeight: number;
|
|
31
|
+
#editorTabsHeight: number;
|
|
32
|
+
#bigSurTitleBarHeight: number;
|
|
33
|
+
#titleBarHeight: number;
|
|
34
|
+
#panelTitleBarHeight: number;
|
|
35
|
+
#statusBarHeight: number;
|
|
36
|
+
#accordionHeaderSizeHeight: number;
|
|
70
37
|
|
|
71
38
|
private inited = false;
|
|
72
39
|
init(layoutViewSize: Partial<ILayoutViewSize> = {}) {
|
|
@@ -75,62 +42,63 @@ export class LayoutViewSizeConfig implements ILayoutViewSize {
|
|
|
75
42
|
}
|
|
76
43
|
this.inited = true;
|
|
77
44
|
|
|
78
|
-
this.#menubarHeight
|
|
79
|
-
this.#editorTabsHeight
|
|
80
|
-
this.#bigSurTitleBarHeight
|
|
81
|
-
this.#titleBarHeight
|
|
82
|
-
this.#panelTitleBarHeight
|
|
83
|
-
this.#statusBarHeight
|
|
84
|
-
this.#accordionHeaderSizeHeight
|
|
45
|
+
this.#menubarHeight = layoutViewSize.menubarHeight || DEFAULT_LAYOUT_VIEW_SIZE.menubarHeight;
|
|
46
|
+
this.#editorTabsHeight = layoutViewSize.editorTabsHeight || DEFAULT_LAYOUT_VIEW_SIZE.editorTabsHeight;
|
|
47
|
+
this.#bigSurTitleBarHeight = layoutViewSize.bigSurTitleBarHeight || DEFAULT_LAYOUT_VIEW_SIZE.bigSurTitleBarHeight;
|
|
48
|
+
this.#titleBarHeight = layoutViewSize.titleBarHeight || DEFAULT_LAYOUT_VIEW_SIZE.titleBarHeight;
|
|
49
|
+
this.#panelTitleBarHeight = layoutViewSize.panelTitleBarHeight || DEFAULT_LAYOUT_VIEW_SIZE.panelTitleBarHeight;
|
|
50
|
+
this.#statusBarHeight = layoutViewSize.statusBarHeight || DEFAULT_LAYOUT_VIEW_SIZE.statusBarHeight;
|
|
51
|
+
this.#accordionHeaderSizeHeight =
|
|
52
|
+
layoutViewSize.accordionHeaderSizeHeight || DEFAULT_LAYOUT_VIEW_SIZE.accordionHeaderSizeHeight;
|
|
85
53
|
}
|
|
86
54
|
|
|
87
55
|
get menubarHeight(): number {
|
|
88
|
-
return this.#menubarHeight
|
|
56
|
+
return this.#menubarHeight;
|
|
89
57
|
}
|
|
90
|
-
setMenubarHeight(value: number
|
|
91
|
-
this.#menubarHeight
|
|
58
|
+
setMenubarHeight(value: number) {
|
|
59
|
+
this.#menubarHeight = value;
|
|
92
60
|
}
|
|
93
61
|
|
|
94
62
|
get editorTabsHeight(): number {
|
|
95
|
-
return this.#editorTabsHeight
|
|
63
|
+
return this.#editorTabsHeight;
|
|
96
64
|
}
|
|
97
|
-
setEditorTabsHeight(value: number
|
|
98
|
-
this.#editorTabsHeight
|
|
65
|
+
setEditorTabsHeight(value: number) {
|
|
66
|
+
this.#editorTabsHeight = value;
|
|
99
67
|
}
|
|
100
68
|
|
|
101
69
|
get bigSurTitleBarHeight(): number {
|
|
102
|
-
return this.#bigSurTitleBarHeight
|
|
70
|
+
return this.#bigSurTitleBarHeight;
|
|
103
71
|
}
|
|
104
|
-
setBigSurTitleBarHeight(value: number
|
|
105
|
-
this.#bigSurTitleBarHeight
|
|
72
|
+
setBigSurTitleBarHeight(value: number) {
|
|
73
|
+
this.#bigSurTitleBarHeight = value;
|
|
106
74
|
}
|
|
107
75
|
|
|
108
76
|
get titleBarHeight(): number {
|
|
109
|
-
return this.#titleBarHeight
|
|
77
|
+
return this.#titleBarHeight;
|
|
110
78
|
}
|
|
111
|
-
setTitleBarHeight(value: number
|
|
112
|
-
this.#titleBarHeight
|
|
79
|
+
setTitleBarHeight(value: number) {
|
|
80
|
+
this.#titleBarHeight = value;
|
|
113
81
|
}
|
|
114
82
|
|
|
115
83
|
get panelTitleBarHeight(): number {
|
|
116
|
-
return this.#panelTitleBarHeight
|
|
84
|
+
return this.#panelTitleBarHeight;
|
|
117
85
|
}
|
|
118
|
-
setPanelTitleBarHeight(value: number
|
|
119
|
-
this.#panelTitleBarHeight
|
|
86
|
+
setPanelTitleBarHeight(value: number) {
|
|
87
|
+
this.#panelTitleBarHeight = value;
|
|
120
88
|
}
|
|
121
89
|
|
|
122
90
|
get statusBarHeight(): number {
|
|
123
|
-
return this.#statusBarHeight
|
|
91
|
+
return this.#statusBarHeight;
|
|
124
92
|
}
|
|
125
|
-
setStatusBarHeight(value: number
|
|
126
|
-
this.#statusBarHeight
|
|
93
|
+
setStatusBarHeight(value: number) {
|
|
94
|
+
this.#statusBarHeight = value;
|
|
127
95
|
}
|
|
128
96
|
|
|
129
97
|
get accordionHeaderSizeHeight(): number {
|
|
130
|
-
return this.#accordionHeaderSizeHeight
|
|
98
|
+
return this.#accordionHeaderSizeHeight;
|
|
131
99
|
}
|
|
132
|
-
setAccordionHeaderSizeHeight(value: number
|
|
133
|
-
this.#accordionHeaderSizeHeight
|
|
100
|
+
setAccordionHeaderSizeHeight(value: number) {
|
|
101
|
+
this.#accordionHeaderSizeHeight = value;
|
|
134
102
|
}
|
|
135
103
|
|
|
136
104
|
protected supportNewMacHeaderBar = electronEnv.osRelease ? parseFloat(electronEnv.osRelease) >= 20 : false;
|
package/src/layout/index.ts
CHANGED
package/lib/layout/render.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../../src/layout/render.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAE1C,eAAO,MAAM,UAAU,UAAW,IAAI,sBAMnC,CAAC"}
|
package/lib/layout/render.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.renderView = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const react_1 = tslib_1.__importDefault(require("react"));
|
|
6
|
-
const react_is_1 = tslib_1.__importDefault(require("react-is"));
|
|
7
|
-
const react_providers_1 = require("../react-providers");
|
|
8
|
-
const renderView = (view) => (react_1.default.createElement(react_1.default.Fragment, null, view && react_is_1.default.isValidElementType(view.component) ? (react_1.default.createElement(react_providers_1.ErrorBoundary, null, view.component && react_1.default.createElement(view.component, view.initialProps))) : null));
|
|
9
|
-
exports.renderView = renderView;
|
|
10
|
-
//# sourceMappingURL=render.js.map
|
package/lib/layout/render.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"render.js","sourceRoot":"","sources":["../../src/layout/render.tsx"],"names":[],"mappings":";;;;AAAA,0DAA0B;AAC1B,gEAA+B;AAE/B,wDAAmD;AAI5C,MAAM,UAAU,GAAG,CAAC,IAAW,EAAE,EAAE,CAAC,CACvC,8DACG,IAAI,IAAI,kBAAO,CAAC,kBAAkB,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CACpD,8BAAC,+BAAa,QAAE,IAAI,CAAC,SAAS,IAAI,eAAK,CAAC,aAAa,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,YAAY,CAAC,CAAiB,CAC1G,CAAC,CAAC,CAAC,IAAI,CACP,CACJ,CAAC;AANS,QAAA,UAAU,cAMnB"}
|
package/src/layout/render.tsx
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import ReactIs from 'react-is';
|
|
3
|
-
|
|
4
|
-
import { ErrorBoundary } from '../react-providers';
|
|
5
|
-
|
|
6
|
-
import { View } from './layout.interface';
|
|
7
|
-
|
|
8
|
-
export const renderView = (view?: View) => (
|
|
9
|
-
<>
|
|
10
|
-
{view && ReactIs.isValidElementType(view.component) ? (
|
|
11
|
-
<ErrorBoundary>{view.component && React.createElement(view.component, view.initialProps)}</ErrorBoundary>
|
|
12
|
-
) : null}
|
|
13
|
-
</>
|
|
14
|
-
);
|