@opensumi/ide-core-browser 3.2.5-next-1724743242.0 → 3.2.5

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.
Files changed (67) hide show
  1. package/lib/ai-native/command.d.ts +0 -6
  2. package/lib/ai-native/command.d.ts.map +1 -1
  3. package/lib/ai-native/command.js +1 -7
  4. package/lib/ai-native/command.js.map +1 -1
  5. package/lib/bootstrap/app.d.ts.map +1 -1
  6. package/lib/bootstrap/app.js +1 -4
  7. package/lib/bootstrap/app.js.map +1 -1
  8. package/lib/components/ai-native/enhanceIcon/index.d.ts +0 -4
  9. package/lib/components/ai-native/enhanceIcon/index.d.ts.map +1 -1
  10. package/lib/components/ai-native/enhanceIcon/index.js +1 -1
  11. package/lib/components/ai-native/enhanceIcon/index.js.map +1 -1
  12. package/lib/components/ai-native/interactive-input/index.d.ts.map +1 -1
  13. package/lib/components/ai-native/interactive-input/index.js +1 -1
  14. package/lib/components/ai-native/interactive-input/index.js.map +1 -1
  15. package/lib/components/ai-native/thumbs/index.d.ts.map +1 -1
  16. package/lib/components/ai-native/thumbs/index.js +2 -2
  17. package/lib/components/ai-native/thumbs/index.js.map +1 -1
  18. package/lib/components/layout/default-layout.d.ts +6 -7
  19. package/lib/components/layout/default-layout.d.ts.map +1 -1
  20. package/lib/components/layout/default-layout.js +5 -11
  21. package/lib/components/layout/default-layout.js.map +1 -1
  22. package/lib/components/layout/split-panel.d.ts.map +1 -1
  23. package/lib/components/layout/split-panel.js +1 -3
  24. package/lib/components/layout/split-panel.js.map +1 -1
  25. package/lib/components/layout/split-panel.service.d.ts +0 -4
  26. package/lib/components/layout/split-panel.service.d.ts.map +1 -1
  27. package/lib/components/layout/split-panel.service.js +0 -16
  28. package/lib/components/layout/split-panel.service.js.map +1 -1
  29. package/lib/contextkey/ai-native.d.ts +0 -1
  30. package/lib/contextkey/ai-native.d.ts.map +1 -1
  31. package/lib/contextkey/ai-native.js +1 -2
  32. package/lib/contextkey/ai-native.js.map +1 -1
  33. package/lib/design/rule.d.ts +10 -19
  34. package/lib/design/rule.d.ts.map +1 -1
  35. package/lib/design/rule.js +9 -22
  36. package/lib/design/rule.js.map +1 -1
  37. package/lib/index.d.ts +0 -1
  38. package/lib/index.d.ts.map +1 -1
  39. package/lib/index.js +1 -1
  40. package/lib/index.js.map +1 -1
  41. package/lib/layout/constants.d.ts +7 -11
  42. package/lib/layout/constants.d.ts.map +1 -1
  43. package/lib/layout/constants.js +36 -66
  44. package/lib/layout/constants.js.map +1 -1
  45. package/lib/layout/index.d.ts +0 -1
  46. package/lib/layout/index.d.ts.map +1 -1
  47. package/lib/layout/index.js +0 -1
  48. package/lib/layout/index.js.map +1 -1
  49. package/package.json +8 -5
  50. package/src/ai-native/command.ts +0 -8
  51. package/src/bootstrap/app.ts +0 -4
  52. package/src/components/ai-native/enhanceIcon/index.tsx +0 -8
  53. package/src/components/ai-native/interactive-input/index.tsx +0 -3
  54. package/src/components/ai-native/thumbs/index.tsx +0 -8
  55. package/src/components/layout/default-layout.tsx +4 -22
  56. package/src/components/layout/split-panel.service.ts +0 -16
  57. package/src/components/layout/split-panel.tsx +1 -4
  58. package/src/contextkey/ai-native.ts +0 -1
  59. package/src/design/rule.ts +10 -26
  60. package/src/index.ts +1 -1
  61. package/src/layout/constants.ts +37 -69
  62. package/src/layout/index.ts +0 -1
  63. package/lib/layout/render.d.ts +0 -4
  64. package/lib/layout/render.d.ts.map +0 -1
  65. package/lib/layout/render.js +0 -10
  66. package/lib/layout/render.js.map +0 -1
  67. package/src/layout/render.tsx +0 -14
@@ -1,51 +1,35 @@
1
1
  /**
2
2
  * 定义了 zIndex 的层级
3
3
  */
4
- export const StackingLevel = Object.freeze({
4
+ export const StackingLevel = {
5
5
  /**
6
6
  * 基础层级
7
7
  */
8
+ Base: 0,
8
9
  Background: 0,
9
10
 
10
- /**
11
- * IDE 的主要内容区域,基础控件
12
- */
13
11
  Workbench: 1,
12
+ WorkbenchEditor: 1,
14
13
 
15
- /**
16
- * 顶部的工具栏
17
- */
18
14
  Toolbar: 2,
19
15
 
20
- /**
21
- * xterm.css 中 decoration 的 z-index 是 7,所以这里要比它大一点
22
- */
23
- XtermDecoration: 8,
16
+ XtermDecoration: 8, // xterm.css 中 decoration 的 z-index 是 7,所以这里要比它大一点
24
17
 
25
- /**
26
- * 顶部工具栏的下拉菜单
27
- */
28
18
  ToolbarDropdown: 10,
29
19
 
30
- EditorTabbarCurrent: 11,
31
-
32
20
  ResizeHandle: 12,
33
21
 
34
- EditorTabbarOverlay: 15,
35
-
36
22
  EditorFloatingContainer: 20,
37
23
 
38
- // #region 中级弹窗区域
24
+ /**
25
+ * 一级弹窗
26
+ */
39
27
  Popup: 100,
40
- // #endregion
41
-
42
- // #region 顶级弹窗区域
28
+ PopoverComponent: 1000,
29
+ PopoverComponentArrow: 1001,
43
30
  Overlay: 800,
44
- PopoverComponent: 999,
45
- PopoverComponentArrow: 1000,
46
31
  OverlayTop: 1000,
47
- // #endregion
48
- } as const);
32
+ } as const;
49
33
 
50
34
  export const StackingLevelStr = Object.fromEntries(
51
35
  Object.entries(StackingLevel).map(([key, value]) => [key, value.toString()]),
package/src/index.ts CHANGED
@@ -1,3 +1,4 @@
1
+ // 输出所有 common 里面会有的内容
1
2
  export * from '@opensumi/ide-core-common';
2
3
 
3
4
  // 输出当前 browser 特有的内容
@@ -44,4 +45,3 @@ export * from './markdown';
44
45
  export * from './extensions';
45
46
 
46
47
  export * from './static-resource';
47
- export * from './context-key';
@@ -1,7 +1,7 @@
1
1
  import merge from 'lodash/merge';
2
2
 
3
3
  import { Injectable } from '@opensumi/di';
4
- import { IDesignLayoutConfig, isDefined, isMacintosh } from '@opensumi/ide-core-common';
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 = 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);
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.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);
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.getValue();
56
+ return this.#menubarHeight;
89
57
  }
90
- setMenubarHeight(value: number, priority?: number) {
91
- this.#menubarHeight.setValue(value, priority ?? ConfigPriority.ModuleDefined);
58
+ setMenubarHeight(value: number) {
59
+ this.#menubarHeight = value;
92
60
  }
93
61
 
94
62
  get editorTabsHeight(): number {
95
- return this.#editorTabsHeight.getValue();
63
+ return this.#editorTabsHeight;
96
64
  }
97
- setEditorTabsHeight(value: number, priority?: number) {
98
- this.#editorTabsHeight.setValue(value, priority ?? ConfigPriority.ModuleDefined);
65
+ setEditorTabsHeight(value: number) {
66
+ this.#editorTabsHeight = value;
99
67
  }
100
68
 
101
69
  get bigSurTitleBarHeight(): number {
102
- return this.#bigSurTitleBarHeight.getValue();
70
+ return this.#bigSurTitleBarHeight;
103
71
  }
104
- setBigSurTitleBarHeight(value: number, priority?: number) {
105
- this.#bigSurTitleBarHeight.setValue(value, priority ?? ConfigPriority.ModuleDefined);
72
+ setBigSurTitleBarHeight(value: number) {
73
+ this.#bigSurTitleBarHeight = value;
106
74
  }
107
75
 
108
76
  get titleBarHeight(): number {
109
- return this.#titleBarHeight.getValue();
77
+ return this.#titleBarHeight;
110
78
  }
111
- setTitleBarHeight(value: number, priority?: number) {
112
- this.#titleBarHeight.setValue(value, priority ?? ConfigPriority.ModuleDefined);
79
+ setTitleBarHeight(value: number) {
80
+ this.#titleBarHeight = value;
113
81
  }
114
82
 
115
83
  get panelTitleBarHeight(): number {
116
- return this.#panelTitleBarHeight.getValue();
84
+ return this.#panelTitleBarHeight;
117
85
  }
118
- setPanelTitleBarHeight(value: number, priority?: number) {
119
- this.#panelTitleBarHeight.setValue(value, priority ?? ConfigPriority.ModuleDefined);
86
+ setPanelTitleBarHeight(value: number) {
87
+ this.#panelTitleBarHeight = value;
120
88
  }
121
89
 
122
90
  get statusBarHeight(): number {
123
- return this.#statusBarHeight.getValue();
91
+ return this.#statusBarHeight;
124
92
  }
125
- setStatusBarHeight(value: number, priority?: number) {
126
- this.#statusBarHeight.setValue(value, priority ?? ConfigPriority.ModuleDefined);
93
+ setStatusBarHeight(value: number) {
94
+ this.#statusBarHeight = value;
127
95
  }
128
96
 
129
97
  get accordionHeaderSizeHeight(): number {
130
- return this.#accordionHeaderSizeHeight.getValue();
98
+ return this.#accordionHeaderSizeHeight;
131
99
  }
132
- setAccordionHeaderSizeHeight(value: number, priority?: number) {
133
- this.#accordionHeaderSizeHeight.setValue(value, priority ?? ConfigPriority.ModuleDefined);
100
+ setAccordionHeaderSizeHeight(value: number) {
101
+ this.#accordionHeaderSizeHeight = value;
134
102
  }
135
103
 
136
104
  protected supportNewMacHeaderBar = electronEnv.osRelease ? parseFloat(electronEnv.osRelease) >= 20 : false;
@@ -3,4 +3,3 @@ export * from './layout-hooks';
3
3
  export * from './layout.interface';
4
4
  export * from './accordion/view-context-key.registry';
5
5
  export * from './accordion/tab-bar-toolbar';
6
- export * from './render';
@@ -1,4 +0,0 @@
1
- import React from 'react';
2
- import { View } from './layout.interface';
3
- export declare const renderView: (view?: View) => React.JSX.Element;
4
- //# sourceMappingURL=render.d.ts.map
@@ -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"}
@@ -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
@@ -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"}
@@ -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
- );