@opensumi/ide-core-browser 3.2.3 → 3.2.4-next-1723542327.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/components/ai-native/enhanceIcon/index.d.ts +4 -0
- package/lib/components/ai-native/enhanceIcon/index.d.ts.map +1 -1
- package/lib/components/ai-native/enhanceIcon/index.js +1 -1
- package/lib/components/ai-native/enhanceIcon/index.js.map +1 -1
- package/lib/components/layout/default-layout.d.ts +7 -6
- package/lib/components/layout/default-layout.d.ts.map +1 -1
- package/lib/components/layout/default-layout.js +11 -5
- package/lib/components/layout/default-layout.js.map +1 -1
- package/lib/layout/constants.d.ts +11 -7
- package/lib/layout/constants.d.ts.map +1 -1
- package/lib/layout/constants.js +66 -36
- package/lib/layout/constants.js.map +1 -1
- package/lib/layout/index.d.ts +1 -0
- package/lib/layout/index.d.ts.map +1 -1
- package/lib/layout/index.js +1 -0
- package/lib/layout/index.js.map +1 -1
- package/lib/layout/render.d.ts +4 -0
- package/lib/layout/render.d.ts.map +1 -0
- package/lib/layout/render.js +10 -0
- package/lib/layout/render.js.map +1 -0
- package/package.json +5 -8
- package/src/components/ai-native/enhanceIcon/index.tsx +8 -0
- package/src/components/layout/default-layout.tsx +22 -4
- package/src/layout/constants.ts +69 -37
- package/src/layout/index.ts +1 -0
- package/src/layout/render.tsx +14 -0
|
@@ -8,6 +8,10 @@ interface IEnhanceIconProps {
|
|
|
8
8
|
icon?: string;
|
|
9
9
|
iconClass?: string;
|
|
10
10
|
children?: React.ReactNode;
|
|
11
|
+
tabIndex?: number;
|
|
12
|
+
role?: string;
|
|
13
|
+
ariaLabel?: string;
|
|
14
|
+
ariaPressed?: boolean | 'mixed' | 'false' | 'true' | undefined;
|
|
11
15
|
}
|
|
12
16
|
export declare const EnhanceIcon: React.ForwardRefExoticComponent<IEnhanceIconProps & React.RefAttributes<HTMLDivElement | null>>;
|
|
13
17
|
interface IEnhanceIconWithCtxMenuProps extends IEnhanceIconProps {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/ai-native/enhanceIcon/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAsB,MAAM,OAAO,CAAC;AAK3C,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAMnD,UAAU,iBAAiB;IACzB,YAAY,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IACnC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,OAAO,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC,cAAc,CAAC,CAAC;IAClD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/ai-native/enhanceIcon/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAsB,MAAM,OAAO,CAAC;AAK3C,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAMnD,UAAU,iBAAiB;IACzB,YAAY,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IACnC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,OAAO,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC,cAAc,CAAC,CAAC;IAClD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,OAAO,GAAG,OAAO,GAAG,OAAO,GAAG,MAAM,GAAG,SAAS,CAAC;CAChE;AAED,eAAO,MAAM,WAAW,iGAuBvB,CAAC;AAEF,UAAU,4BAA6B,SAAQ,iBAAiB;IAC9D,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,SAAS,EAAE,QAAQ,EAAE,CAAC;IACtB,IAAI,CAAC,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CACjC;AAED;;GAEG;AACH,eAAO,MAAM,sBAAsB,UAAW,4BAA4B,sBA4DzE,CAAC;AAEF,eAAO,MAAM,YAAY,UAAW;IAAE,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,aAAa,CAAC,EAAE,MAAM,CAAA;CAAE,sBAIjF,CAAC"}
|
|
@@ -9,7 +9,7 @@ const components_1 = require("../../../components");
|
|
|
9
9
|
const browser_1 = require("../../../menu/next/renderer/ctxmenu/browser");
|
|
10
10
|
const react_hooks_1 = require("../../../react-hooks");
|
|
11
11
|
const styles_module_less_1 = tslib_1.__importDefault(require("./styles.module.less"));
|
|
12
|
-
exports.EnhanceIcon = react_1.default.forwardRef((props, ref) => (react_1.default.createElement("div", { className: (0, classnames_1.default)(props.wrapperClassName, styles_module_less_1.default.ai_enhance_icon), style: props.wrapperStyle, onClick: props.onClick, ref: ref },
|
|
12
|
+
exports.EnhanceIcon = react_1.default.forwardRef((props, ref) => (react_1.default.createElement("div", { className: (0, classnames_1.default)(props.wrapperClassName, styles_module_less_1.default.ai_enhance_icon), style: props.wrapperStyle, onClick: props.onClick, ref: ref, tabIndex: props.tabIndex, role: props.role, "aria-label": props.ariaLabel, "aria-pressed": props.ariaPressed },
|
|
13
13
|
react_1.default.createElement(components_1.Icon, { className: (0, classnames_1.default)(props.className, styles_module_less_1.default.icon), children: null, onClick: () => null, style: (props.icon || props.iconClass) && props.children ? { marginRight: 5 } : {}, icon: props.icon, iconClass: props.iconClass }),
|
|
14
14
|
props.children && react_1.default.createElement("span", { className: styles_module_less_1.default.children_wrap }, props.children))));
|
|
15
15
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/ai-native/enhanceIcon/index.tsx"],"names":[],"mappings":";;;;AAAA,oEAA6B;AAC7B,uDAA2C;AAE3C,+DAA2D;AAE3D,oDAA2C;AAE3C,yEAA8E;AAC9E,sDAAqD;AAErD,sFAA0C;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/ai-native/enhanceIcon/index.tsx"],"names":[],"mappings":";;;;AAAA,oEAA6B;AAC7B,uDAA2C;AAE3C,+DAA2D;AAE3D,oDAA2C;AAE3C,yEAA8E;AAC9E,sDAAqD;AAErD,sFAA0C;AAgB7B,QAAA,WAAW,GAAG,eAAK,CAAC,UAAU,CACzC,CAAC,KAAwB,EAAE,GAAI,EAAE,EAAE,CAAC,CAClC,uCACE,SAAS,EAAE,IAAA,oBAAG,EAAC,KAAK,CAAC,gBAAgB,EAAE,4BAAM,CAAC,eAAe,CAAC,EAC9D,KAAK,EAAE,KAAK,CAAC,YAAY,EACzB,OAAO,EAAE,KAAK,CAAC,OAAO,EACtB,GAAG,EAAE,GAAG,EACR,QAAQ,EAAE,KAAK,CAAC,QAAQ,EACxB,IAAI,EAAE,KAAK,CAAC,IAAI,gBACJ,KAAK,CAAC,SAAS,kBACb,KAAK,CAAC,WAAW;IAE/B,8BAAC,iBAAI,IACH,SAAS,EAAE,IAAA,oBAAG,EAAC,KAAK,CAAC,SAAS,EAAE,4BAAM,CAAC,IAAI,CAAC,EAC5C,QAAQ,EAAE,IAAI,EACd,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,EACnB,KAAK,EAAE,CAAC,KAAK,CAAC,IAAI,IAAI,KAAK,CAAC,SAAS,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,EAClF,IAA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AAE,4BAAM,CAAC,WAAW,CAAC,GAAI,CACjF,CACP,CAAC;AAJW,QAAA,YAAY,gBAIvB"}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
export
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
currentId: string;
|
|
7
|
-
};
|
|
2
|
+
export interface ILayoutConfigCache {
|
|
3
|
+
[key: string]: {
|
|
4
|
+
size: number;
|
|
5
|
+
currentId: string;
|
|
8
6
|
};
|
|
7
|
+
}
|
|
8
|
+
export declare const getStorageValue: () => {
|
|
9
|
+
layout: ILayoutConfigCache;
|
|
9
10
|
colors: {
|
|
10
11
|
[colorKey: string]: string;
|
|
11
12
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"default-layout.d.ts","sourceRoot":"","sources":["../../../src/components/layout/default-layout.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B,
|
|
1
|
+
{"version":3,"file":"default-layout.d.ts","sourceRoot":"","sources":["../../../src/components/layout/default-layout.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B,MAAM,WAAW,kBAAkB;IACjC,CAAC,GAAG,EAAE,MAAM,GAAG;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,CAAC;CACpD;AAED,eAAO,MAAM,eAAe;;;;;CAoB3B,CAAC;AAEF,eAAO,MAAM,aAAa,iCAA2B,CAAC;AAEtD,wBAAgB,wBAAwB,CACtC,KAAK,GAAE;IACL,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,aAAa,CAAC,EAAE,MAAM,CAAC;CACnB,qBAqCP"}
|
|
@@ -11,8 +11,14 @@ const getStorageValue = () => {
|
|
|
11
11
|
let savedLayout = {};
|
|
12
12
|
let savedColors = {};
|
|
13
13
|
try {
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
const layoutConfigStr = localStorage.getItem('layout');
|
|
15
|
+
if (layoutConfigStr) {
|
|
16
|
+
savedLayout = JSON.parse(layoutConfigStr);
|
|
17
|
+
}
|
|
18
|
+
const themeConfigStr = localStorage.getItem('theme');
|
|
19
|
+
if (themeConfigStr) {
|
|
20
|
+
savedColors = JSON.parse(themeConfigStr);
|
|
21
|
+
}
|
|
16
22
|
}
|
|
17
23
|
catch (err) { }
|
|
18
24
|
return {
|
|
@@ -23,7 +29,7 @@ const getStorageValue = () => {
|
|
|
23
29
|
exports.getStorageValue = getStorageValue;
|
|
24
30
|
exports.DefaultLayout = ToolbarActionBasedLayout;
|
|
25
31
|
function ToolbarActionBasedLayout(props = {}) {
|
|
26
|
-
var _a, _b, _c, _d, _e;
|
|
32
|
+
var _a, _b, _c, _d, _e, _f;
|
|
27
33
|
const { layout } = (0, exports.getStorageValue)();
|
|
28
34
|
return (react_1.default.createElement(box_panel_1.BoxPanel, { direction: 'top-to-bottom' },
|
|
29
35
|
react_1.default.createElement(slot_1.SlotRenderer, { id: 'top', defaultSize: props.topSlotDefaultSize || 0, slot: 'top', zIndex: props.topSlotZIndex }),
|
|
@@ -31,8 +37,8 @@ function ToolbarActionBasedLayout(props = {}) {
|
|
|
31
37
|
react_1.default.createElement(slot_1.SlotRenderer, { slot: 'left', isTabbar: true, defaultSize: ((_a = layout.left) === null || _a === void 0 ? void 0 : _a.currentId) ? ((_b = layout.left) === null || _b === void 0 ? void 0 : _b.size) || 310 : 49, minResize: 280, maxResize: 480, minSize: 49 }),
|
|
32
38
|
react_1.default.createElement(split_panel_1.SplitPanel, { id: 'main-vertical', minResize: 300, flexGrow: 1, direction: 'top-to-bottom' },
|
|
33
39
|
react_1.default.createElement(slot_1.SlotRenderer, { flex: 2, flexGrow: 1, minResize: 200, slot: 'main' }),
|
|
34
|
-
react_1.default.createElement(slot_1.SlotRenderer, { flex: 1, defaultSize: (_c = layout.bottom) === null || _c === void 0 ? void 0 : _c.size, minResize: 160, slot: 'bottom', isTabbar: true })),
|
|
35
|
-
react_1.default.createElement(slot_1.SlotRenderer, { slot: 'right', isTabbar: true, defaultSize: ((
|
|
40
|
+
react_1.default.createElement(slot_1.SlotRenderer, { flex: 1, defaultSize: ((_c = layout.bottom) === null || _c === void 0 ? void 0 : _c.currentId) ? (_d = layout.bottom) === null || _d === void 0 ? void 0 : _d.size : 24, minResize: 160, slot: 'bottom', isTabbar: true })),
|
|
41
|
+
react_1.default.createElement(slot_1.SlotRenderer, { slot: 'right', isTabbar: true, defaultSize: ((_e = layout.right) === null || _e === void 0 ? void 0 : _e.currentId) ? ((_f = layout.right) === null || _f === void 0 ? void 0 : _f.size) || 310 : 0, minResize: 280, maxResize: 480, minSize: 0 })),
|
|
36
42
|
react_1.default.createElement(slot_1.SlotRenderer, { id: 'statusBar', defaultSize: 24, slot: 'statusBar' })));
|
|
37
43
|
}
|
|
38
44
|
exports.ToolbarActionBasedLayout = ToolbarActionBasedLayout;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"default-layout.js","sourceRoot":"","sources":["../../../src/components/layout/default-layout.tsx"],"names":[],"mappings":";;;;AAAA,0DAA0B;AAE1B,qDAA0D;AAE1D,2CAAuC;AACvC,+CAA2C;
|
|
1
|
+
{"version":3,"file":"default-layout.js","sourceRoot":"","sources":["../../../src/components/layout/default-layout.tsx"],"names":[],"mappings":";;;;AAAA,0DAA0B;AAE1B,qDAA0D;AAE1D,2CAAuC;AACvC,+CAA2C;AAMpC,MAAM,eAAe,GAAG,GAAG,EAAE;IAClC,kBAAkB;IAClB,IAAI,WAAW,GAAuB,EAAE,CAAC;IACzC,IAAI,WAAW,GAAmC,EAAE,CAAC;IACrD,IAAI;QACF,MAAM,eAAe,GAAG,YAAY,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;QACvD,IAAI,eAAe,EAAE;YACnB,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC;SAC3C;QAED,MAAM,cAAc,GAAG,YAAY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AAI,EAAC,MAAM,GAAG;gBAClE,8BAAC,mBAAY,IACX,IAAI,EAAE,CAAC,EACP,WAAW,EAAE,CAAA,MAAA,MAAM,CAAC,MAAM,0CAAE,SAAS,EAAC,CAAC,CAAC,MAAA,MAAM,CAAC,MAAM,0CAAE,IAAI,CAAC,CAAC,CAAC,EAAE,EAChE,SAAS,EAAE,GAAG,EACd,IAAI,EAAC,QAAQ,EACb,QAAQ,EAAE,IAAI,GACd,CACS;YACb,8BAAC,mBAAY,IACX,IAAI,EAAC,OAAO,EACZ,QAAQ,EAAE,IAAI,EACd,WAAW,EAAE,CAAA,MAAA,MAAM,CAAC,KAAK,0CAAE,SAAS,EAAC,CAAC,CAAC,CAAA,MAAA,MAAM,CAAC,KAAK,0CAAE,IAAI,KAAI,GAAG,CAAC,CAAC,CAAC,CAAC,EACpE,SAAS,EAAE,GAAG,EACd,SAAS,EAAE,GAAG,EACd,OAAO,EAAE,CAAC,GACV,CACS;QACb,8BAAC,mBAAY,IAAC,EAAE,EAAC,WAAW,EAAC,WAAW,EAAE,EAAE,EAAE,IAAI,EAAC,WAAW,GAAG,CACxD,CACZ,CAAC;AACJ,CAAC;AAzCD,4DAyCC"}
|
|
@@ -9,24 +9,28 @@ 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
|
+
}
|
|
12
16
|
export declare class LayoutViewSizeConfig implements ILayoutViewSize {
|
|
13
17
|
#private;
|
|
14
18
|
private inited;
|
|
15
19
|
init(layoutViewSize?: Partial<ILayoutViewSize>): void;
|
|
16
20
|
get menubarHeight(): number;
|
|
17
|
-
setMenubarHeight(value: number): void;
|
|
21
|
+
setMenubarHeight(value: number, priority?: number): void;
|
|
18
22
|
get editorTabsHeight(): number;
|
|
19
|
-
setEditorTabsHeight(value: number): void;
|
|
23
|
+
setEditorTabsHeight(value: number, priority?: number): void;
|
|
20
24
|
get bigSurTitleBarHeight(): number;
|
|
21
|
-
setBigSurTitleBarHeight(value: number): void;
|
|
25
|
+
setBigSurTitleBarHeight(value: number, priority?: number): void;
|
|
22
26
|
get titleBarHeight(): number;
|
|
23
|
-
setTitleBarHeight(value: number): void;
|
|
27
|
+
setTitleBarHeight(value: number, priority?: number): void;
|
|
24
28
|
get panelTitleBarHeight(): number;
|
|
25
|
-
setPanelTitleBarHeight(value: number): void;
|
|
29
|
+
setPanelTitleBarHeight(value: number, priority?: number): void;
|
|
26
30
|
get statusBarHeight(): number;
|
|
27
|
-
setStatusBarHeight(value: number): void;
|
|
31
|
+
setStatusBarHeight(value: number, priority?: number): void;
|
|
28
32
|
get accordionHeaderSizeHeight(): number;
|
|
29
|
-
setAccordionHeaderSizeHeight(value: number): void;
|
|
33
|
+
setAccordionHeaderSizeHeight(value: number, priority?: number): void;
|
|
30
34
|
protected supportNewMacHeaderBar: boolean;
|
|
31
35
|
calcElectronHeaderHeight(): number;
|
|
32
36
|
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,EAA0B,MAAM,2BAA2B,CAAC;AAIxF,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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,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.DEFAULT_LAYOUT_VIEW_SIZE = void 0;
|
|
4
|
+
exports.DesignLayoutConfig = exports.LayoutViewSizeConfig = exports.ConfigPriority = 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,15 +16,45 @@ 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
|
+
}
|
|
19
49
|
let LayoutViewSizeConfig = class LayoutViewSizeConfig {
|
|
20
50
|
constructor() {
|
|
21
|
-
_LayoutViewSizeConfig_menubarHeight.set(this,
|
|
22
|
-
_LayoutViewSizeConfig_editorTabsHeight.set(this,
|
|
23
|
-
_LayoutViewSizeConfig_bigSurTitleBarHeight.set(this,
|
|
24
|
-
_LayoutViewSizeConfig_titleBarHeight.set(this,
|
|
25
|
-
_LayoutViewSizeConfig_panelTitleBarHeight.set(this,
|
|
26
|
-
_LayoutViewSizeConfig_statusBarHeight.set(this,
|
|
27
|
-
_LayoutViewSizeConfig_accordionHeaderSizeHeight.set(this,
|
|
51
|
+
_LayoutViewSizeConfig_menubarHeight.set(this, new ConfigAtom(exports.DEFAULT_LAYOUT_VIEW_SIZE.menubarHeight));
|
|
52
|
+
_LayoutViewSizeConfig_editorTabsHeight.set(this, new ConfigAtom(exports.DEFAULT_LAYOUT_VIEW_SIZE.editorTabsHeight));
|
|
53
|
+
_LayoutViewSizeConfig_bigSurTitleBarHeight.set(this, new ConfigAtom(exports.DEFAULT_LAYOUT_VIEW_SIZE.bigSurTitleBarHeight));
|
|
54
|
+
_LayoutViewSizeConfig_titleBarHeight.set(this, new ConfigAtom(exports.DEFAULT_LAYOUT_VIEW_SIZE.titleBarHeight));
|
|
55
|
+
_LayoutViewSizeConfig_panelTitleBarHeight.set(this, new ConfigAtom(exports.DEFAULT_LAYOUT_VIEW_SIZE.panelTitleBarHeight));
|
|
56
|
+
_LayoutViewSizeConfig_statusBarHeight.set(this, new ConfigAtom(exports.DEFAULT_LAYOUT_VIEW_SIZE.statusBarHeight));
|
|
57
|
+
_LayoutViewSizeConfig_accordionHeaderSizeHeight.set(this, new ConfigAtom(exports.DEFAULT_LAYOUT_VIEW_SIZE.accordionHeaderSizeHeight));
|
|
28
58
|
this.inited = false;
|
|
29
59
|
this.supportNewMacHeaderBar = electron_1.electronEnv.osRelease ? parseFloat(electron_1.electronEnv.osRelease) >= 20 : false;
|
|
30
60
|
}
|
|
@@ -33,55 +63,55 @@ let LayoutViewSizeConfig = class LayoutViewSizeConfig {
|
|
|
33
63
|
return;
|
|
34
64
|
}
|
|
35
65
|
this.inited = true;
|
|
36
|
-
tslib_1.
|
|
37
|
-
tslib_1.
|
|
38
|
-
tslib_1.
|
|
39
|
-
tslib_1.
|
|
40
|
-
tslib_1.
|
|
41
|
-
tslib_1.
|
|
42
|
-
tslib_1.
|
|
66
|
+
tslib_1.__classPrivateFieldGet(this, _LayoutViewSizeConfig_menubarHeight, "f").setValue(layoutViewSize.menubarHeight, ConfigPriority.UserDefined);
|
|
67
|
+
tslib_1.__classPrivateFieldGet(this, _LayoutViewSizeConfig_editorTabsHeight, "f").setValue(layoutViewSize.editorTabsHeight, ConfigPriority.UserDefined);
|
|
68
|
+
tslib_1.__classPrivateFieldGet(this, _LayoutViewSizeConfig_bigSurTitleBarHeight, "f").setValue(layoutViewSize.bigSurTitleBarHeight, ConfigPriority.UserDefined);
|
|
69
|
+
tslib_1.__classPrivateFieldGet(this, _LayoutViewSizeConfig_titleBarHeight, "f").setValue(layoutViewSize.titleBarHeight, ConfigPriority.UserDefined);
|
|
70
|
+
tslib_1.__classPrivateFieldGet(this, _LayoutViewSizeConfig_panelTitleBarHeight, "f").setValue(layoutViewSize.panelTitleBarHeight, ConfigPriority.UserDefined);
|
|
71
|
+
tslib_1.__classPrivateFieldGet(this, _LayoutViewSizeConfig_statusBarHeight, "f").setValue(layoutViewSize.statusBarHeight, ConfigPriority.UserDefined);
|
|
72
|
+
tslib_1.__classPrivateFieldGet(this, _LayoutViewSizeConfig_accordionHeaderSizeHeight, "f").setValue(layoutViewSize.accordionHeaderSizeHeight, ConfigPriority.UserDefined);
|
|
43
73
|
}
|
|
44
74
|
get menubarHeight() {
|
|
45
|
-
return tslib_1.__classPrivateFieldGet(this, _LayoutViewSizeConfig_menubarHeight, "f");
|
|
75
|
+
return tslib_1.__classPrivateFieldGet(this, _LayoutViewSizeConfig_menubarHeight, "f").getValue();
|
|
46
76
|
}
|
|
47
|
-
setMenubarHeight(value) {
|
|
48
|
-
tslib_1.
|
|
77
|
+
setMenubarHeight(value, priority) {
|
|
78
|
+
tslib_1.__classPrivateFieldGet(this, _LayoutViewSizeConfig_menubarHeight, "f").setValue(value, priority !== null && priority !== void 0 ? priority : ConfigPriority.ModuleDefined);
|
|
49
79
|
}
|
|
50
80
|
get editorTabsHeight() {
|
|
51
|
-
return tslib_1.__classPrivateFieldGet(this, _LayoutViewSizeConfig_editorTabsHeight, "f");
|
|
81
|
+
return tslib_1.__classPrivateFieldGet(this, _LayoutViewSizeConfig_editorTabsHeight, "f").getValue();
|
|
52
82
|
}
|
|
53
|
-
setEditorTabsHeight(value) {
|
|
54
|
-
tslib_1.
|
|
83
|
+
setEditorTabsHeight(value, priority) {
|
|
84
|
+
tslib_1.__classPrivateFieldGet(this, _LayoutViewSizeConfig_editorTabsHeight, "f").setValue(value, priority !== null && priority !== void 0 ? priority : ConfigPriority.ModuleDefined);
|
|
55
85
|
}
|
|
56
86
|
get bigSurTitleBarHeight() {
|
|
57
|
-
return tslib_1.__classPrivateFieldGet(this, _LayoutViewSizeConfig_bigSurTitleBarHeight, "f");
|
|
87
|
+
return tslib_1.__classPrivateFieldGet(this, _LayoutViewSizeConfig_bigSurTitleBarHeight, "f").getValue();
|
|
58
88
|
}
|
|
59
|
-
setBigSurTitleBarHeight(value) {
|
|
60
|
-
tslib_1.
|
|
89
|
+
setBigSurTitleBarHeight(value, priority) {
|
|
90
|
+
tslib_1.__classPrivateFieldGet(this, _LayoutViewSizeConfig_bigSurTitleBarHeight, "f").setValue(value, priority !== null && priority !== void 0 ? priority : ConfigPriority.ModuleDefined);
|
|
61
91
|
}
|
|
62
92
|
get titleBarHeight() {
|
|
63
|
-
return tslib_1.__classPrivateFieldGet(this, _LayoutViewSizeConfig_titleBarHeight, "f");
|
|
93
|
+
return tslib_1.__classPrivateFieldGet(this, _LayoutViewSizeConfig_titleBarHeight, "f").getValue();
|
|
64
94
|
}
|
|
65
|
-
setTitleBarHeight(value) {
|
|
66
|
-
tslib_1.
|
|
95
|
+
setTitleBarHeight(value, priority) {
|
|
96
|
+
tslib_1.__classPrivateFieldGet(this, _LayoutViewSizeConfig_titleBarHeight, "f").setValue(value, priority !== null && priority !== void 0 ? priority : ConfigPriority.ModuleDefined);
|
|
67
97
|
}
|
|
68
98
|
get panelTitleBarHeight() {
|
|
69
|
-
return tslib_1.__classPrivateFieldGet(this, _LayoutViewSizeConfig_panelTitleBarHeight, "f");
|
|
99
|
+
return tslib_1.__classPrivateFieldGet(this, _LayoutViewSizeConfig_panelTitleBarHeight, "f").getValue();
|
|
70
100
|
}
|
|
71
|
-
setPanelTitleBarHeight(value) {
|
|
72
|
-
tslib_1.
|
|
101
|
+
setPanelTitleBarHeight(value, priority) {
|
|
102
|
+
tslib_1.__classPrivateFieldGet(this, _LayoutViewSizeConfig_panelTitleBarHeight, "f").setValue(value, priority !== null && priority !== void 0 ? priority : ConfigPriority.ModuleDefined);
|
|
73
103
|
}
|
|
74
104
|
get statusBarHeight() {
|
|
75
|
-
return tslib_1.__classPrivateFieldGet(this, _LayoutViewSizeConfig_statusBarHeight, "f");
|
|
105
|
+
return tslib_1.__classPrivateFieldGet(this, _LayoutViewSizeConfig_statusBarHeight, "f").getValue();
|
|
76
106
|
}
|
|
77
|
-
setStatusBarHeight(value) {
|
|
78
|
-
tslib_1.
|
|
107
|
+
setStatusBarHeight(value, priority) {
|
|
108
|
+
tslib_1.__classPrivateFieldGet(this, _LayoutViewSizeConfig_statusBarHeight, "f").setValue(value, priority !== null && priority !== void 0 ? priority : ConfigPriority.ModuleDefined);
|
|
79
109
|
}
|
|
80
110
|
get accordionHeaderSizeHeight() {
|
|
81
|
-
return tslib_1.__classPrivateFieldGet(this, _LayoutViewSizeConfig_accordionHeaderSizeHeight, "f");
|
|
111
|
+
return tslib_1.__classPrivateFieldGet(this, _LayoutViewSizeConfig_accordionHeaderSizeHeight, "f").getValue();
|
|
82
112
|
}
|
|
83
|
-
setAccordionHeaderSizeHeight(value) {
|
|
84
|
-
tslib_1.
|
|
113
|
+
setAccordionHeaderSizeHeight(value, priority) {
|
|
114
|
+
tslib_1.__classPrivateFieldGet(this, _LayoutViewSizeConfig_accordionHeaderSizeHeight, "f").setValue(value, priority !== null && priority !== void 0 ? priority : ConfigPriority.ModuleDefined);
|
|
85
115
|
}
|
|
86
116
|
calcElectronHeaderHeight() {
|
|
87
117
|
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,+DAAwF;AAExF,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;AAEF,IAAY,cAGX;AAHD,W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AG,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;AAC5C,cAAc,UAAU,CAAC"}
|
package/lib/layout/index.js
CHANGED
|
@@ -6,4 +6,5 @@ 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);
|
|
9
10
|
//# 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;AAC5C,mDAAyB"}
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1,10 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opensumi/ide-core-browser",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.4-next-1723542327.0",
|
|
4
4
|
"description": "@opensumi/ide-core-browser",
|
|
5
5
|
"files": [
|
|
6
6
|
"lib",
|
|
@@ -18,14 +18,13 @@
|
|
|
18
18
|
"build": "tsc --build ../../configs/ts/references/tsconfig.core-browser.json"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@opensumi/ide-components": "3.2.
|
|
22
|
-
"@opensumi/ide-connection": "3.2.
|
|
23
|
-
"@opensumi/ide-core-common": "3.2.
|
|
21
|
+
"@opensumi/ide-components": "3.2.4-next-1723542327.0",
|
|
22
|
+
"@opensumi/ide-connection": "3.2.4-next-1723542327.0",
|
|
23
|
+
"@opensumi/ide-core-common": "3.2.4-next-1723542327.0",
|
|
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",
|
|
29
28
|
"fuzzy": "^0.1.3",
|
|
30
29
|
"jsonc-parser": "^2.1.0",
|
|
31
30
|
"keycode": "^2.2.0",
|
|
@@ -33,9 +32,7 @@
|
|
|
33
32
|
"mobx": "^6.12.0",
|
|
34
33
|
"mobx-react-lite": "^4.0.5",
|
|
35
34
|
"react": "^18.2.0",
|
|
36
|
-
"react-autosize-textarea": "^7.0.0",
|
|
37
35
|
"react-ctxmenu-trigger": "^1.0.0",
|
|
38
|
-
"react-custom-scrollbars": "^4.2.1",
|
|
39
36
|
"react-dom": "^18.2.0",
|
|
40
37
|
"react-is": "^18.2.0",
|
|
41
38
|
"react-window": "^1.8.5",
|
|
@@ -47,5 +44,5 @@
|
|
|
47
44
|
"react": "^18.2.0",
|
|
48
45
|
"react-dom": "^18.2.0"
|
|
49
46
|
},
|
|
50
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "02695bc27b1628d8939ad5ae06af7746ccba494b"
|
|
51
48
|
}
|
|
@@ -18,6 +18,10 @@ interface IEnhanceIconProps {
|
|
|
18
18
|
icon?: string;
|
|
19
19
|
iconClass?: string;
|
|
20
20
|
children?: React.ReactNode;
|
|
21
|
+
tabIndex?: number;
|
|
22
|
+
role?: string;
|
|
23
|
+
ariaLabel?: string;
|
|
24
|
+
ariaPressed?: boolean | 'mixed' | 'false' | 'true' | undefined;
|
|
21
25
|
}
|
|
22
26
|
|
|
23
27
|
export const EnhanceIcon = React.forwardRef<HTMLDivElement | null, IEnhanceIconProps>(
|
|
@@ -27,6 +31,10 @@ export const EnhanceIcon = React.forwardRef<HTMLDivElement | null, IEnhanceIconP
|
|
|
27
31
|
style={props.wrapperStyle}
|
|
28
32
|
onClick={props.onClick}
|
|
29
33
|
ref={ref}
|
|
34
|
+
tabIndex={props.tabIndex}
|
|
35
|
+
role={props.role}
|
|
36
|
+
aria-label={props.ariaLabel}
|
|
37
|
+
aria-pressed={props.ariaPressed}
|
|
30
38
|
>
|
|
31
39
|
<Icon
|
|
32
40
|
className={cls(props.className, styles.icon)}
|
|
@@ -5,14 +5,26 @@ import { SlotRenderer } from '../../react-providers/slot';
|
|
|
5
5
|
import { BoxPanel } from './box-panel';
|
|
6
6
|
import { SplitPanel } from './split-panel';
|
|
7
7
|
|
|
8
|
+
export interface ILayoutConfigCache {
|
|
9
|
+
[key: string]: { size: number; currentId: string };
|
|
10
|
+
}
|
|
11
|
+
|
|
8
12
|
export const getStorageValue = () => {
|
|
9
13
|
// 启动时渲染的颜色和尺寸,弱依赖
|
|
10
|
-
let savedLayout:
|
|
14
|
+
let savedLayout: ILayoutConfigCache = {};
|
|
11
15
|
let savedColors: { [colorKey: string]: string } = {};
|
|
12
16
|
try {
|
|
13
|
-
|
|
14
|
-
|
|
17
|
+
const layoutConfigStr = localStorage.getItem('layout');
|
|
18
|
+
if (layoutConfigStr) {
|
|
19
|
+
savedLayout = JSON.parse(layoutConfigStr);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const themeConfigStr = localStorage.getItem('theme');
|
|
23
|
+
if (themeConfigStr) {
|
|
24
|
+
savedColors = JSON.parse(themeConfigStr);
|
|
25
|
+
}
|
|
15
26
|
} catch (err) {}
|
|
27
|
+
|
|
16
28
|
return {
|
|
17
29
|
layout: savedLayout,
|
|
18
30
|
colors: savedColors,
|
|
@@ -42,7 +54,13 @@ export function ToolbarActionBasedLayout(
|
|
|
42
54
|
/>
|
|
43
55
|
<SplitPanel id='main-vertical' minResize={300} flexGrow={1} direction='top-to-bottom'>
|
|
44
56
|
<SlotRenderer flex={2} flexGrow={1} minResize={200} slot='main' />
|
|
45
|
-
<SlotRenderer
|
|
57
|
+
<SlotRenderer
|
|
58
|
+
flex={1}
|
|
59
|
+
defaultSize={layout.bottom?.currentId ? layout.bottom?.size : 24}
|
|
60
|
+
minResize={160}
|
|
61
|
+
slot='bottom'
|
|
62
|
+
isTabbar={true}
|
|
63
|
+
/>
|
|
46
64
|
</SplitPanel>
|
|
47
65
|
<SlotRenderer
|
|
48
66
|
slot='right'
|
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, isMacintosh } from '@opensumi/ide-core-common';
|
|
4
|
+
import { IDesignLayoutConfig, isDefined, isMacintosh } from '@opensumi/ide-core-common';
|
|
5
5
|
|
|
6
6
|
import { electronEnv } from '../utils/electron';
|
|
7
7
|
|
|
@@ -25,15 +25,48 @@ 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
|
+
|
|
28
61
|
@Injectable()
|
|
29
62
|
export class LayoutViewSizeConfig implements ILayoutViewSize {
|
|
30
|
-
#menubarHeight
|
|
31
|
-
#editorTabsHeight
|
|
32
|
-
#bigSurTitleBarHeight
|
|
33
|
-
#titleBarHeight
|
|
34
|
-
#panelTitleBarHeight
|
|
35
|
-
#statusBarHeight
|
|
36
|
-
#accordionHeaderSizeHeight
|
|
63
|
+
#menubarHeight = new ConfigAtom(DEFAULT_LAYOUT_VIEW_SIZE.menubarHeight);
|
|
64
|
+
#editorTabsHeight = new ConfigAtom(DEFAULT_LAYOUT_VIEW_SIZE.editorTabsHeight);
|
|
65
|
+
#bigSurTitleBarHeight = new ConfigAtom(DEFAULT_LAYOUT_VIEW_SIZE.bigSurTitleBarHeight);
|
|
66
|
+
#titleBarHeight = new ConfigAtom(DEFAULT_LAYOUT_VIEW_SIZE.titleBarHeight);
|
|
67
|
+
#panelTitleBarHeight = new ConfigAtom(DEFAULT_LAYOUT_VIEW_SIZE.panelTitleBarHeight);
|
|
68
|
+
#statusBarHeight = new ConfigAtom(DEFAULT_LAYOUT_VIEW_SIZE.statusBarHeight);
|
|
69
|
+
#accordionHeaderSizeHeight = new ConfigAtom(DEFAULT_LAYOUT_VIEW_SIZE.accordionHeaderSizeHeight);
|
|
37
70
|
|
|
38
71
|
private inited = false;
|
|
39
72
|
init(layoutViewSize: Partial<ILayoutViewSize> = {}) {
|
|
@@ -42,63 +75,62 @@ export class LayoutViewSizeConfig implements ILayoutViewSize {
|
|
|
42
75
|
}
|
|
43
76
|
this.inited = true;
|
|
44
77
|
|
|
45
|
-
this.#menubarHeight
|
|
46
|
-
this.#editorTabsHeight
|
|
47
|
-
this.#bigSurTitleBarHeight
|
|
48
|
-
this.#titleBarHeight
|
|
49
|
-
this.#panelTitleBarHeight
|
|
50
|
-
this.#statusBarHeight
|
|
51
|
-
this.#accordionHeaderSizeHeight
|
|
52
|
-
layoutViewSize.accordionHeaderSizeHeight || DEFAULT_LAYOUT_VIEW_SIZE.accordionHeaderSizeHeight;
|
|
78
|
+
this.#menubarHeight.setValue(layoutViewSize.menubarHeight, ConfigPriority.UserDefined);
|
|
79
|
+
this.#editorTabsHeight.setValue(layoutViewSize.editorTabsHeight, ConfigPriority.UserDefined);
|
|
80
|
+
this.#bigSurTitleBarHeight.setValue(layoutViewSize.bigSurTitleBarHeight, ConfigPriority.UserDefined);
|
|
81
|
+
this.#titleBarHeight.setValue(layoutViewSize.titleBarHeight, ConfigPriority.UserDefined);
|
|
82
|
+
this.#panelTitleBarHeight.setValue(layoutViewSize.panelTitleBarHeight, ConfigPriority.UserDefined);
|
|
83
|
+
this.#statusBarHeight.setValue(layoutViewSize.statusBarHeight, ConfigPriority.UserDefined);
|
|
84
|
+
this.#accordionHeaderSizeHeight.setValue(layoutViewSize.accordionHeaderSizeHeight, ConfigPriority.UserDefined);
|
|
53
85
|
}
|
|
54
86
|
|
|
55
87
|
get menubarHeight(): number {
|
|
56
|
-
return this.#menubarHeight;
|
|
88
|
+
return this.#menubarHeight.getValue();
|
|
57
89
|
}
|
|
58
|
-
setMenubarHeight(value: number) {
|
|
59
|
-
this.#menubarHeight
|
|
90
|
+
setMenubarHeight(value: number, priority?: number) {
|
|
91
|
+
this.#menubarHeight.setValue(value, priority ?? ConfigPriority.ModuleDefined);
|
|
60
92
|
}
|
|
61
93
|
|
|
62
94
|
get editorTabsHeight(): number {
|
|
63
|
-
return this.#editorTabsHeight;
|
|
95
|
+
return this.#editorTabsHeight.getValue();
|
|
64
96
|
}
|
|
65
|
-
setEditorTabsHeight(value: number) {
|
|
66
|
-
this.#editorTabsHeight
|
|
97
|
+
setEditorTabsHeight(value: number, priority?: number) {
|
|
98
|
+
this.#editorTabsHeight.setValue(value, priority ?? ConfigPriority.ModuleDefined);
|
|
67
99
|
}
|
|
68
100
|
|
|
69
101
|
get bigSurTitleBarHeight(): number {
|
|
70
|
-
return this.#bigSurTitleBarHeight;
|
|
102
|
+
return this.#bigSurTitleBarHeight.getValue();
|
|
71
103
|
}
|
|
72
|
-
setBigSurTitleBarHeight(value: number) {
|
|
73
|
-
this.#bigSurTitleBarHeight
|
|
104
|
+
setBigSurTitleBarHeight(value: number, priority?: number) {
|
|
105
|
+
this.#bigSurTitleBarHeight.setValue(value, priority ?? ConfigPriority.ModuleDefined);
|
|
74
106
|
}
|
|
75
107
|
|
|
76
108
|
get titleBarHeight(): number {
|
|
77
|
-
return this.#titleBarHeight;
|
|
109
|
+
return this.#titleBarHeight.getValue();
|
|
78
110
|
}
|
|
79
|
-
setTitleBarHeight(value: number) {
|
|
80
|
-
this.#titleBarHeight
|
|
111
|
+
setTitleBarHeight(value: number, priority?: number) {
|
|
112
|
+
this.#titleBarHeight.setValue(value, priority ?? ConfigPriority.ModuleDefined);
|
|
81
113
|
}
|
|
82
114
|
|
|
83
115
|
get panelTitleBarHeight(): number {
|
|
84
|
-
return this.#panelTitleBarHeight;
|
|
116
|
+
return this.#panelTitleBarHeight.getValue();
|
|
85
117
|
}
|
|
86
|
-
setPanelTitleBarHeight(value: number) {
|
|
87
|
-
this.#panelTitleBarHeight
|
|
118
|
+
setPanelTitleBarHeight(value: number, priority?: number) {
|
|
119
|
+
this.#panelTitleBarHeight.setValue(value, priority ?? ConfigPriority.ModuleDefined);
|
|
88
120
|
}
|
|
89
121
|
|
|
90
122
|
get statusBarHeight(): number {
|
|
91
|
-
return this.#statusBarHeight;
|
|
123
|
+
return this.#statusBarHeight.getValue();
|
|
92
124
|
}
|
|
93
|
-
setStatusBarHeight(value: number) {
|
|
94
|
-
this.#statusBarHeight
|
|
125
|
+
setStatusBarHeight(value: number, priority?: number) {
|
|
126
|
+
this.#statusBarHeight.setValue(value, priority ?? ConfigPriority.ModuleDefined);
|
|
95
127
|
}
|
|
96
128
|
|
|
97
129
|
get accordionHeaderSizeHeight(): number {
|
|
98
|
-
return this.#accordionHeaderSizeHeight;
|
|
130
|
+
return this.#accordionHeaderSizeHeight.getValue();
|
|
99
131
|
}
|
|
100
|
-
setAccordionHeaderSizeHeight(value: number) {
|
|
101
|
-
this.#accordionHeaderSizeHeight
|
|
132
|
+
setAccordionHeaderSizeHeight(value: number, priority?: number) {
|
|
133
|
+
this.#accordionHeaderSizeHeight.setValue(value, priority ?? ConfigPriority.ModuleDefined);
|
|
102
134
|
}
|
|
103
135
|
|
|
104
136
|
protected supportNewMacHeaderBar = electronEnv.osRelease ? parseFloat(electronEnv.osRelease) >= 20 : false;
|
package/src/layout/index.ts
CHANGED
|
@@ -0,0 +1,14 @@
|
|
|
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
|
+
);
|