@opensumi/ide-core-browser 2.21.8-rc-1670567192.0 → 2.21.8
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/actions/index.d.ts.map +1 -1
- package/lib/components/actions/index.js +22 -2
- package/lib/components/actions/index.js.map +1 -1
- package/lib/components/tree/tree.module.less +0 -1
- package/lib/contextkey/testing.d.ts +0 -1
- package/lib/contextkey/testing.d.ts.map +1 -1
- package/lib/contextkey/testing.js +1 -2
- package/lib/contextkey/testing.js.map +1 -1
- package/lib/menu/next/menu.contrib.interface.d.ts +2 -3
- package/lib/menu/next/menu.contrib.interface.d.ts.map +1 -1
- package/lib/menu/next/menu.contrib.interface.js.map +1 -1
- package/lib/preferences/preference-configurations.js +1 -1
- package/lib/preferences/preference-configurations.js.map +1 -1
- package/lib/react-providers/config-provider.d.ts +0 -4
- package/lib/react-providers/config-provider.d.ts.map +1 -1
- package/lib/react-providers/config-provider.js.map +1 -1
- package/lib/services/storage-service.d.ts.map +1 -1
- package/lib/services/storage-service.js +1 -7
- package/lib/services/storage-service.js.map +1 -1
- package/lib/utils/label.d.ts.map +1 -1
- package/lib/utils/label.js +9 -16
- package/lib/utils/label.js.map +1 -1
- package/package.json +6 -7
- package/src/application/application-state-service.ts +0 -54
- package/src/application/application.service.ts +0 -51
- package/src/application/index.ts +0 -2
- package/src/authentication/authentication.contribution.ts +0 -35
- package/src/authentication/authentication.service.ts +0 -517
- package/src/bootstrap/app.ts +0 -745
- package/src/bootstrap/app.view.tsx +0 -88
- package/src/bootstrap/connection.ts +0 -116
- package/src/bootstrap/index.ts +0 -3
- package/src/bootstrap/inner-providers.ts +0 -297
- package/src/bootstrap/lifecycle.service.ts +0 -19
- package/src/browser-module.ts +0 -24
- package/src/common/common.command.ts +0 -977
- package/src/common/common.contribution.ts +0 -343
- package/src/common/common.define.ts +0 -55
- package/src/common/common.module.ts +0 -33
- package/src/common/common.storage.ts +0 -22
- package/src/common/container-id.ts +0 -12
- package/src/common/index.ts +0 -4
- package/src/components/actions/index.tsx +0 -486
- package/src/components/actions/placements.ts +0 -47
- package/src/components/actions/styles.module.less +0 -144
- package/src/components/badge/index.tsx +0 -1
- package/src/components/index.ts +0 -26
- package/src/components/layout/box-panel.tsx +0 -88
- package/src/components/layout/default-layout.tsx +0 -61
- package/src/components/layout/index.ts +0 -4
- package/src/components/layout/layout.ts +0 -80
- package/src/components/layout/split-panel.service.ts +0 -56
- package/src/components/layout/split-panel.tsx +0 -296
- package/src/components/layout/styles.module.less +0 -21
- package/src/components/loading/index.ts +0 -1
- package/src/components/loading/loading.less +0 -14
- package/src/components/loading/loading.view.tsx +0 -7
- package/src/components/loading/media/loading-dark.svg +0 -52
- package/src/components/loading/media/loading-hc.svg +0 -52
- package/src/components/loading/media/loading.svg +0 -52
- package/src/components/popover/styles.module.less +0 -81
- package/src/components/portal/index.tsx +0 -13
- package/src/components/progressbar/index.tsx +0 -16
- package/src/components/progressbar/styles.module.less +0 -31
- package/src/components/recycle-tree/index.ts +0 -1
- package/src/components/recycle-tree/recycle-tree.view.tsx +0 -368
- package/src/components/resize/resize.module.less +0 -78
- package/src/components/resize/resize.tsx +0 -663
- package/src/components/scroll/index.tsx +0 -386
- package/src/components/scroll/scroll.module.less +0 -108
- package/src/components/scrollbar/index.ts +0 -1
- package/src/components/scrollbar/scrollbar.less +0 -36
- package/src/components/scrollbar/scrollbar.view.ts +0 -8
- package/src/components/select/index.tsx +0 -12
- package/src/components/select/styles.less +0 -6
- package/src/components/tree/index.ts +0 -3
- package/src/components/tree/tree-node.view.tsx +0 -546
- package/src/components/tree/tree.module.less +0 -297
- package/src/components/tree/tree.view.tsx +0 -486
- package/src/context-key.ts +0 -48
- package/src/contextkey/dialog.ts +0 -3
- package/src/contextkey/explorer.ts +0 -26
- package/src/contextkey/index.ts +0 -6
- package/src/contextkey/outline.ts +0 -4
- package/src/contextkey/resource.ts +0 -61
- package/src/contextkey/terminal.ts +0 -7
- package/src/contextkey/testing.ts +0 -9
- package/src/contextkey/workspace.ts +0 -7
- package/src/core-preferences.ts +0 -318
- package/src/dom/index.ts +0 -176
- package/src/encoding-registry.ts +0 -83
- package/src/extensions/extensions-point.service.ts +0 -78
- package/src/extensions/index.ts +0 -3
- package/src/extensions/schema/browserViews.ts +0 -96
- package/src/extensions/schema/menu.ts +0 -245
- package/src/extensions/schema/opensumiExtensionPackageSchema.ts +0 -12
- package/src/extensions/schema/toolbar.ts +0 -338
- package/src/extensions/schema/vscodeExtensionPackageSchema.ts +0 -330
- package/src/fs/index.ts +0 -12
- package/src/hash-calculate/hash-calculate.contribution.ts +0 -19
- package/src/index.ts +0 -42
- package/src/keybinding/index.ts +0 -1
- package/src/keybinding/keybinding.ts +0 -908
- package/src/keyboard/index.ts +0 -3
- package/src/keyboard/keyboard-layout-provider.ts +0 -412
- package/src/keyboard/keyboard-layout-service.ts +0 -449
- package/src/keyboard/keys.ts +0 -748
- package/src/keyboard/layouts/_.contribution.ts +0 -24
- package/src/keyboard/layouts/cz.win.ts +0 -168
- package/src/keyboard/layouts/de-swiss.win.ts +0 -168
- package/src/keyboard/layouts/de.darwin.ts +0 -131
- package/src/keyboard/layouts/de.linux.ts +0 -186
- package/src/keyboard/layouts/de.win.ts +0 -168
- package/src/keyboard/layouts/dk.win.ts +0 -168
- package/src/keyboard/layouts/dvorak.darwin.ts +0 -131
- package/src/keyboard/layouts/en-belgian.win.ts +0 -168
- package/src/keyboard/layouts/en-ext.darwin.ts +0 -131
- package/src/keyboard/layouts/en-in.win.ts +0 -168
- package/src/keyboard/layouts/en-intl.darwin.ts +0 -131
- package/src/keyboard/layouts/en-intl.win.ts +0 -168
- package/src/keyboard/layouts/en-uk.darwin.ts +0 -131
- package/src/keyboard/layouts/en-uk.win.ts +0 -168
- package/src/keyboard/layouts/en.darwin.ts +0 -139
- package/src/keyboard/layouts/en.linux.ts +0 -186
- package/src/keyboard/layouts/en.win.ts +0 -173
- package/src/keyboard/layouts/es-latin.win.ts +0 -168
- package/src/keyboard/layouts/es.darwin.ts +0 -131
- package/src/keyboard/layouts/es.linux.ts +0 -186
- package/src/keyboard/layouts/es.win.ts +0 -168
- package/src/keyboard/layouts/fr.darwin.ts +0 -131
- package/src/keyboard/layouts/fr.linux.ts +0 -186
- package/src/keyboard/layouts/fr.win.ts +0 -168
- package/src/keyboard/layouts/hu.win.ts +0 -168
- package/src/keyboard/layouts/it.darwin.ts +0 -131
- package/src/keyboard/layouts/it.win.ts +0 -168
- package/src/keyboard/layouts/jp-roman.darwin.ts +0 -131
- package/src/keyboard/layouts/jp.darwin.ts +0 -131
- package/src/keyboard/layouts/ko.darwin.ts +0 -131
- package/src/keyboard/layouts/layout.contribution.darwin.ts +0 -23
- package/src/keyboard/layouts/layout.contribution.linux.ts +0 -12
- package/src/keyboard/layouts/layout.contribution.ts +0 -9
- package/src/keyboard/layouts/layout.contribution.win.ts +0 -29
- package/src/keyboard/layouts/no.win.ts +0 -168
- package/src/keyboard/layouts/pl.darwin.ts +0 -131
- package/src/keyboard/layouts/pl.win.ts +0 -168
- package/src/keyboard/layouts/pt-br.win.ts +0 -169
- package/src/keyboard/layouts/pt.darwin.ts +0 -131
- package/src/keyboard/layouts/pt.win.ts +0 -168
- package/src/keyboard/layouts/ru.darwin.ts +0 -131
- package/src/keyboard/layouts/ru.linux.ts +0 -186
- package/src/keyboard/layouts/ru.win.ts +0 -168
- package/src/keyboard/layouts/sv.darwin.ts +0 -131
- package/src/keyboard/layouts/sv.win.ts +0 -168
- package/src/keyboard/layouts/thai.win.ts +0 -168
- package/src/keyboard/layouts/tr.win.ts +0 -168
- package/src/keyboard/layouts/zh-hans.darwin.ts +0 -131
- package/src/layout/accordion/tab-bar-toolbar.tsx +0 -59
- package/src/layout/accordion/view-context-key.registry.ts +0 -34
- package/src/layout/constants.ts +0 -7
- package/src/layout/index.ts +0 -5
- package/src/layout/layout-hooks.ts +0 -68
- package/src/layout/layout-state.ts +0 -107
- package/src/layout/layout.interface.ts +0 -101
- package/src/layout/layout.ts +0 -80
- package/src/layout/view-id.ts +0 -18
- package/src/logger/browser-logger.ts +0 -51
- package/src/logger/index.ts +0 -1
- package/src/markdown/index.tsx +0 -62
- package/src/menu/next/base.ts +0 -513
- package/src/menu/next/ctxmenu-service.ts +0 -188
- package/src/menu/next/index.ts +0 -10
- package/src/menu/next/menu-id.ts +0 -86
- package/src/menu/next/menu-service.ts +0 -252
- package/src/menu/next/menu-util.ts +0 -77
- package/src/menu/next/menu.contrib.interface.ts +0 -79
- package/src/menu/next/menu.interface.ts +0 -253
- package/src/menu/next/menubar-service.ts +0 -211
- package/src/menu/next/renderer/ctxmenu/base.ts +0 -18
- package/src/menu/next/renderer/ctxmenu/browser.ts +0 -45
- package/src/menu/next/renderer/ctxmenu/electron.ts +0 -207
- package/src/menu/next/toolbar-action.service.ts +0 -132
- package/src/monaco/index.ts +0 -128
- package/src/opener/command-opener.ts +0 -42
- package/src/opener/default-opener.ts +0 -31
- package/src/opener/http-opener.ts +0 -25
- package/src/opener/index.ts +0 -19
- package/src/opener/opener.contribution.ts +0 -57
- package/src/opener/opener.service.ts +0 -66
- package/src/preferences/early-preferences.ts +0 -117
- package/src/preferences/index.ts +0 -9
- package/src/preferences/preference-configurations.ts +0 -77
- package/src/preferences/preference-contribution.ts +0 -401
- package/src/preferences/preference-provider.ts +0 -414
- package/src/preferences/preference-proxy.ts +0 -292
- package/src/preferences/preference-scope.ts +0 -3
- package/src/preferences/preference-service.ts +0 -571
- package/src/preferences/settings.ts +0 -53
- package/src/preferences/types.ts +0 -111
- package/src/progress/index.ts +0 -58
- package/src/progress/progress-bar.tsx +0 -22
- package/src/progress/progress-indicator.ts +0 -90
- package/src/progress/progress.module.less +0 -46
- package/src/progress/progress.service.tsx +0 -429
- package/src/quick-open/index.ts +0 -655
- package/src/quick-open/recent-files.ts +0 -68
- package/src/raw-context-key.ts +0 -116
- package/src/react-hooks/event.tsx +0 -80
- package/src/react-hooks/hot-key.tsx +0 -58
- package/src/react-hooks/index.ts +0 -3
- package/src/react-hooks/injectable-hooks.tsx +0 -35
- package/src/react-hooks/portal-hooks.tsx +0 -38
- package/src/react-providers/config-provider.tsx +0 -263
- package/src/react-providers/index.tsx +0 -2
- package/src/react-providers/slot.module.less +0 -19
- package/src/react-providers/slot.tsx +0 -242
- package/src/services/clipboard.service.ts +0 -97
- package/src/services/credentials-service.ts +0 -91
- package/src/services/crypto-service.ts +0 -23
- package/src/services/external-uri.service.ts +0 -68
- package/src/services/index.ts +0 -7
- package/src/services/label-service.ts +0 -386
- package/src/services/status-bar-service.ts +0 -108
- package/src/services/storage-service.ts +0 -197
- package/src/style/codicons/README.md +0 -22
- package/src/style/codicons/codicon-animations.css +0 -15
- package/src/style/codicons/generator.js +0 -15
- package/src/style/entry.less +0 -25
- package/src/style/icon/fileicons/file-default.svg +0 -1
- package/src/style/icon/fileicons/folder-default.svg +0 -1
- package/src/style/icon/fileicons.less +0 -20
- package/src/style/icon/icon.ts +0 -543
- package/src/style/icon/ide-iconfont.ts +0 -13
- package/src/style/icon/index.less +0 -54
- package/src/style/icon/seti.woff +0 -0
- package/src/style/icon/symbol-icons/boolean-dark.svg +0 -3
- package/src/style/icon/symbol-icons/boolean-light.svg +0 -3
- package/src/style/icon/symbol-icons/class-dark.svg +0 -3
- package/src/style/icon/symbol-icons/class-light.svg +0 -3
- package/src/style/icon/symbol-icons/constant-dark.svg +0 -4
- package/src/style/icon/symbol-icons/constant-light.svg +0 -4
- package/src/style/icon/symbol-icons/enumerator-dark.svg +0 -3
- package/src/style/icon/symbol-icons/enumerator-item-dark.svg +0 -3
- package/src/style/icon/symbol-icons/enumerator-item-light.svg +0 -3
- package/src/style/icon/symbol-icons/enumerator-light.svg +0 -3
- package/src/style/icon/symbol-icons/event-dark.svg +0 -3
- package/src/style/icon/symbol-icons/event-light.svg +0 -3
- package/src/style/icon/symbol-icons/field-dark.svg +0 -3
- package/src/style/icon/symbol-icons/field-light.svg +0 -3
- package/src/style/icon/symbol-icons/file-dark.svg +0 -3
- package/src/style/icon/symbol-icons/file-light.svg +0 -3
- package/src/style/icon/symbol-icons/indexer-dark.svg +0 -3
- package/src/style/icon/symbol-icons/indexer-light.svg +0 -3
- package/src/style/icon/symbol-icons/interface-dark.svg +0 -3
- package/src/style/icon/symbol-icons/interface-light.svg +0 -3
- package/src/style/icon/symbol-icons/keyword-dark.svg +0 -3
- package/src/style/icon/symbol-icons/keyword-light.svg +0 -3
- package/src/style/icon/symbol-icons/method-dark.svg +0 -3
- package/src/style/icon/symbol-icons/method-light.svg +0 -3
- package/src/style/icon/symbol-icons/namespace-dark.svg +0 -3
- package/src/style/icon/symbol-icons/namespace-light.svg +0 -3
- package/src/style/icon/symbol-icons/numeric-dark.svg +0 -3
- package/src/style/icon/symbol-icons/numeric-light.svg +0 -3
- package/src/style/icon/symbol-icons/operator-dark.svg +0 -3
- package/src/style/icon/symbol-icons/operator-light.svg +0 -3
- package/src/style/icon/symbol-icons/property-dark.svg +0 -3
- package/src/style/icon/symbol-icons/property-light.svg +0 -3
- package/src/style/icon/symbol-icons/snippet-dark.svg +0 -3
- package/src/style/icon/symbol-icons/snippet-light.svg +0 -3
- package/src/style/icon/symbol-icons/string-dark.svg +0 -3
- package/src/style/icon/symbol-icons/string-light.svg +0 -3
- package/src/style/icon/symbol-icons/structure-dark.svg +0 -3
- package/src/style/icon/symbol-icons/structure-light.svg +0 -3
- package/src/style/icon/symbol-icons/symbol-icons.css +0 -284
- package/src/style/icon/symbol-icons/template-dark.svg +0 -3
- package/src/style/icon/symbol-icons/template-light.svg +0 -3
- package/src/style/icon/symbol-icons/variable-dark.svg +0 -3
- package/src/style/icon/symbol-icons/variable-light.svg +0 -3
- package/src/style/icon.less +0 -8
- package/src/style/index.less +0 -14
- package/src/style/monaco-override.less +0 -116
- package/src/style/normalize.less +0 -92
- package/src/style/octicons/octicons-cdn.css +0 -720
- package/src/style/octicons/octicons.css +0 -714
- package/src/style/octicons/octicons.html +0 -1882
- package/src/style/octicons/octicons.svg +0 -582
- package/src/style/octicons/octicons.ttf +0 -0
- package/src/style/override.less +0 -97
- package/src/style/toolbar.less +0 -199
- package/src/style/utilities.less +0 -8
- package/src/style/variable.less +0 -8
- package/src/terminal/index.ts +0 -7
- package/src/toolbar/components/auto-complete.tsx +0 -0
- package/src/toolbar/components/button.tsx +0 -440
- package/src/toolbar/components/index.ts +0 -2
- package/src/toolbar/components/select.tsx +0 -189
- package/src/toolbar/index.ts +0 -3
- package/src/toolbar/toolbar.popover.registry.ts +0 -32
- package/src/toolbar/toolbar.registry.ts +0 -352
- package/src/toolbar/toolbar.tsx +0 -710
- package/src/toolbar/types.ts +0 -383
- package/src/tree/index.ts +0 -3
- package/src/tree/tree-expansion.ts +0 -25
- package/src/tree/tree-selection.ts +0 -89
- package/src/tree/tree.ts +0 -294
- package/src/utils/create-overlay.tsx +0 -53
- package/src/utils/electron.ts +0 -92
- package/src/utils/env.ts +0 -26
- package/src/utils/icon.ts +0 -13
- package/src/utils/index.ts +0 -7
- package/src/utils/json.ts +0 -251
- package/src/utils/label.tsx +0 -36
- package/src/utils/parse.ts +0 -72
- package/src/utils/react-hooks.ts +0 -118
- package/src/variable/index.ts +0 -1
- package/src/variable/variable.ts +0 -84
- package/src/window/index.ts +0 -34
- package/src/window/window.service.ts +0 -100
package/src/tree/tree.ts
DELETED
|
@@ -1,294 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
|
|
3
|
-
export interface TreeNodeHighlightRange {
|
|
4
|
-
start: number;
|
|
5
|
-
end: number;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
export type themeColorId = string;
|
|
9
|
-
|
|
10
|
-
export interface IFileDecoration {
|
|
11
|
-
badge: string;
|
|
12
|
-
tooltip: string;
|
|
13
|
-
color: themeColorId;
|
|
14
|
-
weight?: number;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export interface FileDecorationsProvider {
|
|
18
|
-
getDecoration: (uri: any, hasChildren?: boolean) => IFileDecoration;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export interface ThemeProvider {
|
|
22
|
-
getColor: ({ id: themeColorId }) => string;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export interface TreeNode<T extends TreeNode<any> = TreeNode<any>> {
|
|
26
|
-
/**
|
|
27
|
-
* 节点唯一ID
|
|
28
|
-
*/
|
|
29
|
-
readonly id: number | string;
|
|
30
|
-
/**
|
|
31
|
-
* 可读的节点名称
|
|
32
|
-
* 可能为ReactComponent
|
|
33
|
-
*/
|
|
34
|
-
readonly name: string | React.JSXElementConstructor<any>;
|
|
35
|
-
/**
|
|
36
|
-
* 节点头部,会影响节点计算逻辑
|
|
37
|
-
* 不适用于RecycleTree面板
|
|
38
|
-
*/
|
|
39
|
-
readonly title?: string;
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* 顺序
|
|
43
|
-
*/
|
|
44
|
-
readonly order?: number;
|
|
45
|
-
/**
|
|
46
|
-
* 节点深度
|
|
47
|
-
*/
|
|
48
|
-
readonly depth?: number;
|
|
49
|
-
/**
|
|
50
|
-
* 图标的classname
|
|
51
|
-
*/
|
|
52
|
-
readonly icon?: string;
|
|
53
|
-
/**
|
|
54
|
-
* 图标的样式
|
|
55
|
-
*/
|
|
56
|
-
readonly iconStyle?: React.CSSProperties;
|
|
57
|
-
/**
|
|
58
|
-
* 节点描述
|
|
59
|
-
* 可能为ReactComponent
|
|
60
|
-
*/
|
|
61
|
-
readonly description?: string | React.JSXElementConstructor<any>;
|
|
62
|
-
/**
|
|
63
|
-
* 当该值为false时节点不渲染,否则渲染
|
|
64
|
-
*/
|
|
65
|
-
readonly visible?: boolean;
|
|
66
|
-
/**
|
|
67
|
-
* 节点的父节点,当节点为根节点时为undefined
|
|
68
|
-
*/
|
|
69
|
-
readonly parent: Readonly<T> | undefined;
|
|
70
|
-
/**
|
|
71
|
-
* 节点尾部标志,如M,C等
|
|
72
|
-
*/
|
|
73
|
-
readonly badge?: number | string;
|
|
74
|
-
/**
|
|
75
|
-
* badge限制
|
|
76
|
-
* 当badge为number时
|
|
77
|
-
* badgeLimit = 99,badge最多显示为99+
|
|
78
|
-
* 当badge为string时
|
|
79
|
-
* badgeLimit = 2,badge最多显示不超过2个字符
|
|
80
|
-
*/
|
|
81
|
-
readonly badgeLimit?: number;
|
|
82
|
-
/**
|
|
83
|
-
* 节点字体颜色
|
|
84
|
-
*/
|
|
85
|
-
readonly color?: string;
|
|
86
|
-
/**
|
|
87
|
-
* 节点背景颜色
|
|
88
|
-
*/
|
|
89
|
-
readonly background?: string;
|
|
90
|
-
/**
|
|
91
|
-
* 节点字体颜色样式
|
|
92
|
-
*/
|
|
93
|
-
readonly style?: React.CSSProperties;
|
|
94
|
-
/**
|
|
95
|
-
* 节点尾部标志样式,如M,C等
|
|
96
|
-
*/
|
|
97
|
-
readonly badgeStyle?: React.CSSProperties;
|
|
98
|
-
/**
|
|
99
|
-
* 文本提示
|
|
100
|
-
*/
|
|
101
|
-
readonly tooltip?: string;
|
|
102
|
-
|
|
103
|
-
/**
|
|
104
|
-
* 节点上的 inline actions, 可以传自定义 react 组件
|
|
105
|
-
*/
|
|
106
|
-
readonly actions?: TreeViewAction[];
|
|
107
|
-
|
|
108
|
-
/**
|
|
109
|
-
* 节点上 inline actions 是否一直显示,默认为 hover 出现
|
|
110
|
-
*/
|
|
111
|
-
readonly alwaysShowActions?: boolean;
|
|
112
|
-
|
|
113
|
-
/**
|
|
114
|
-
* 高亮区域
|
|
115
|
-
*/
|
|
116
|
-
readonly highLightRanges?: {
|
|
117
|
-
name?: TreeNodeHighlightRange[];
|
|
118
|
-
description?: TreeNodeHighlightRange[];
|
|
119
|
-
};
|
|
120
|
-
|
|
121
|
-
/**
|
|
122
|
-
* 高亮区域替换文本
|
|
123
|
-
*/
|
|
124
|
-
readonly replace?: string;
|
|
125
|
-
|
|
126
|
-
/**
|
|
127
|
-
* 名称显示后部部分补充文本
|
|
128
|
-
*/
|
|
129
|
-
readonly afterLabel?: string;
|
|
130
|
-
|
|
131
|
-
/**
|
|
132
|
-
* 名称显示前部部分补充文本
|
|
133
|
-
*/
|
|
134
|
-
readonly beforeLabel?: string;
|
|
135
|
-
|
|
136
|
-
/**
|
|
137
|
-
* 名称显示样式
|
|
138
|
-
*/
|
|
139
|
-
readonly labelClass?: string;
|
|
140
|
-
|
|
141
|
-
/**
|
|
142
|
-
* 描述信息样式
|
|
143
|
-
*/
|
|
144
|
-
readonly descriptionClass?: string;
|
|
145
|
-
|
|
146
|
-
/**
|
|
147
|
-
* 节点头部的图标样式,如,dirty状态文件的小圆点
|
|
148
|
-
*/
|
|
149
|
-
readonly headIconClass?: string;
|
|
150
|
-
|
|
151
|
-
/**
|
|
152
|
-
* 是否为临时文件,如可编辑节点
|
|
153
|
-
*/
|
|
154
|
-
readonly isTemporary?: boolean;
|
|
155
|
-
/**
|
|
156
|
-
* 仅对可折叠节点有效,控制loading样式
|
|
157
|
-
*/
|
|
158
|
-
readonly isLoading?: boolean;
|
|
159
|
-
|
|
160
|
-
[key: string]: any;
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
export namespace TreeNode {
|
|
164
|
-
export function equals(left: TreeNode | undefined, right: TreeNode | undefined): boolean {
|
|
165
|
-
return left === right || (!!left && !!right && left.id === right.id);
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
export function isVisible(node: TreeNode | undefined): boolean {
|
|
169
|
-
return !!node && (node.visible === undefined || node.visible);
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
/**
|
|
174
|
-
* 拓展树节点.
|
|
175
|
-
*/
|
|
176
|
-
export interface CompositeTreeNode extends TreeNode {
|
|
177
|
-
/**
|
|
178
|
-
* 树的子节点数组.
|
|
179
|
-
*/
|
|
180
|
-
children: ReadonlyArray<TreeNode>;
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
export namespace CompositeTreeNode {
|
|
184
|
-
export function is(node: object | undefined): node is CompositeTreeNode {
|
|
185
|
-
return !!node && 'children' in node;
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
export function getFirstChild(parent: CompositeTreeNode): TreeNode | undefined {
|
|
189
|
-
return parent.children[0];
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
export function getLastChild(parent: CompositeTreeNode): TreeNode | undefined {
|
|
193
|
-
return parent.children[parent.children.length - 1];
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
export function isAncestor(parent: CompositeTreeNode, child: TreeNode | undefined): boolean {
|
|
197
|
-
if (!child) {
|
|
198
|
-
return false;
|
|
199
|
-
}
|
|
200
|
-
if (TreeNode.equals(parent, child.parent)) {
|
|
201
|
-
return true;
|
|
202
|
-
}
|
|
203
|
-
return isAncestor(parent, child.parent);
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
export function indexOf(parent: CompositeTreeNode, node: TreeNode | undefined): number {
|
|
207
|
-
if (!node) {
|
|
208
|
-
return -1;
|
|
209
|
-
}
|
|
210
|
-
return parent.children.findIndex((child) => TreeNode.equals(node, child));
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
export function addChildren(parent: CompositeTreeNode, children: TreeNode[]): CompositeTreeNode {
|
|
214
|
-
for (const child of children) {
|
|
215
|
-
addChild(parent, child);
|
|
216
|
-
}
|
|
217
|
-
return parent;
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
export function addChild(parent: CompositeTreeNode, child: TreeNode): CompositeTreeNode {
|
|
221
|
-
const children = parent.children as TreeNode[];
|
|
222
|
-
const index = children.findIndex((value) => value.id === child.id);
|
|
223
|
-
if (index !== -1) {
|
|
224
|
-
children.splice(index, 1, child);
|
|
225
|
-
setParent(child, index, parent);
|
|
226
|
-
} else {
|
|
227
|
-
children.push(child);
|
|
228
|
-
setParent(child, parent.children.length - 1, parent);
|
|
229
|
-
}
|
|
230
|
-
return parent;
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
export function removeChild(parent: CompositeTreeNode, child: TreeNode): void {
|
|
234
|
-
const children = parent.children as TreeNode[];
|
|
235
|
-
const index = children.findIndex((value) => value.id === child.id);
|
|
236
|
-
if (index === -1) {
|
|
237
|
-
return;
|
|
238
|
-
}
|
|
239
|
-
children.splice(index, 1);
|
|
240
|
-
const { previousSibling, nextSibling } = child;
|
|
241
|
-
if (previousSibling) {
|
|
242
|
-
Object.assign(previousSibling, { nextSibling });
|
|
243
|
-
}
|
|
244
|
-
if (nextSibling) {
|
|
245
|
-
Object.assign(nextSibling, { previousSibling });
|
|
246
|
-
}
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
export function setParent(child: TreeNode, index: number, parent: CompositeTreeNode): void {
|
|
250
|
-
const previousSibling = parent.children[index - 1];
|
|
251
|
-
const nextSibling = parent.children[index + 1];
|
|
252
|
-
Object.assign(child, { parent, previousSibling, nextSibling });
|
|
253
|
-
if (previousSibling) {
|
|
254
|
-
Object.assign(previousSibling, { nextSibling: child });
|
|
255
|
-
}
|
|
256
|
-
if (nextSibling) {
|
|
257
|
-
Object.assign(nextSibling, { previousSibling: child });
|
|
258
|
-
}
|
|
259
|
-
}
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
export function isTreeViewActionComponent(action: TreeViewAction): action is TreeViewActionComponent {
|
|
263
|
-
return 'component' in action && React.isValidElement(action.component);
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
export type TreeViewAction = TreeViewActionConfig | TreeViewActionComponent;
|
|
267
|
-
|
|
268
|
-
export interface TreeViewActionConfig {
|
|
269
|
-
icon:
|
|
270
|
-
| {
|
|
271
|
-
dark?: string;
|
|
272
|
-
light?: string;
|
|
273
|
-
}
|
|
274
|
-
| string;
|
|
275
|
-
title: string;
|
|
276
|
-
command: string;
|
|
277
|
-
location: TreeViewActionTypes;
|
|
278
|
-
/**
|
|
279
|
-
* paramsKey 支持从 node 直接取指定的 key
|
|
280
|
-
* 同时也支持从 node 变换成一个新的格式
|
|
281
|
-
*/
|
|
282
|
-
paramsKey?: string | ((node: TreeNode) => any);
|
|
283
|
-
}
|
|
284
|
-
|
|
285
|
-
export interface TreeViewActionComponent {
|
|
286
|
-
component: React.ReactNode;
|
|
287
|
-
location: TreeViewActionTypes;
|
|
288
|
-
}
|
|
289
|
-
|
|
290
|
-
export enum TreeViewActionTypes {
|
|
291
|
-
TreeNode_Left = 0,
|
|
292
|
-
TreeNode_Right,
|
|
293
|
-
TreeContainer,
|
|
294
|
-
}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import ReactDOM from 'react-dom';
|
|
3
|
-
|
|
4
|
-
export const destroyFns: Array<() => void> = [];
|
|
5
|
-
|
|
6
|
-
export function destroyAllOverlays() {
|
|
7
|
-
while (destroyFns.length) {
|
|
8
|
-
const close = destroyFns.pop();
|
|
9
|
-
if (close) {
|
|
10
|
-
close();
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export function createOverlay(children: React.ReactElement) {
|
|
16
|
-
const div = document.createElement('div');
|
|
17
|
-
document.body.appendChild(div);
|
|
18
|
-
|
|
19
|
-
function destroy() {
|
|
20
|
-
const unmountResult = ReactDOM.unmountComponentAtNode(div);
|
|
21
|
-
if (unmountResult && div.parentNode) {
|
|
22
|
-
div.parentNode.removeChild(div);
|
|
23
|
-
}
|
|
24
|
-
for (let i = 0; i < destroyFns.length; i++) {
|
|
25
|
-
const fn = destroyFns[i];
|
|
26
|
-
if (fn === close) {
|
|
27
|
-
destroyFns.splice(i, 1);
|
|
28
|
-
break;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
function render(comp: React.ReactElement) {
|
|
34
|
-
ReactDOM.render(React.cloneElement(comp), div);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
function update(newChildren: React.ReactElement) {
|
|
38
|
-
render(newChildren);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
function close() {
|
|
42
|
-
destroy();
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
render(children);
|
|
46
|
-
|
|
47
|
-
destroyFns.push(close);
|
|
48
|
-
|
|
49
|
-
return {
|
|
50
|
-
destroy: close,
|
|
51
|
-
update,
|
|
52
|
-
};
|
|
53
|
-
}
|
package/src/utils/electron.ts
DELETED
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
import { IDisposable } from '@opensumi/ide-core-common';
|
|
2
|
-
import { IElectronMainApi } from '@opensumi/ide-core-common/lib/electron';
|
|
3
|
-
import type { MessageConnection } from '@opensumi/vscode-jsonrpc';
|
|
4
|
-
|
|
5
|
-
declare const ElectronIpcRenderer: IElectronIpcRenderer;
|
|
6
|
-
|
|
7
|
-
export interface IElectronIpcRenderer {
|
|
8
|
-
on(channel: string, listener: (event: any, ...args: any[]) => void);
|
|
9
|
-
once(channel: string, listener: (event: any, ...args: any[]) => void);
|
|
10
|
-
removeListener(channel: string, listener: (event: any, ...args: any[]) => void);
|
|
11
|
-
removeAllListeners(channel?: string);
|
|
12
|
-
send(channel: string, ...args: any[]): void;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export function createElectronMainApi(name: string): IElectronMainApi<any> {
|
|
16
|
-
let id = 0;
|
|
17
|
-
return new Proxy(
|
|
18
|
-
{
|
|
19
|
-
on: (event: string, listener: (...args) => void): IDisposable => {
|
|
20
|
-
const wrappedListener = (e, eventName, ...args) => {
|
|
21
|
-
if (eventName === event) {
|
|
22
|
-
return listener(...args);
|
|
23
|
-
}
|
|
24
|
-
};
|
|
25
|
-
ElectronIpcRenderer.on('event:' + name, wrappedListener);
|
|
26
|
-
return {
|
|
27
|
-
dispose: () => {
|
|
28
|
-
ElectronIpcRenderer.removeListener('event:' + name, wrappedListener);
|
|
29
|
-
},
|
|
30
|
-
};
|
|
31
|
-
},
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
get: (target, method) => {
|
|
35
|
-
if (method === 'on') {
|
|
36
|
-
return target[method];
|
|
37
|
-
} else {
|
|
38
|
-
return async (...args: any) =>
|
|
39
|
-
new Promise((resolve, reject) => {
|
|
40
|
-
const requestId = id++;
|
|
41
|
-
ElectronIpcRenderer.send('request:' + name, method, requestId, ...args);
|
|
42
|
-
const listener = (event, id, error, result) => {
|
|
43
|
-
if (id === requestId) {
|
|
44
|
-
ElectronIpcRenderer.removeListener('response:' + name, listener);
|
|
45
|
-
if (error) {
|
|
46
|
-
const e = new Error(error.message);
|
|
47
|
-
e.stack = error.stack;
|
|
48
|
-
reject(e);
|
|
49
|
-
} else {
|
|
50
|
-
resolve(result);
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
};
|
|
54
|
-
ElectronIpcRenderer.on('response:' + name, listener);
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
},
|
|
58
|
-
},
|
|
59
|
-
);
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
export const electronEnv: {
|
|
63
|
-
currentWindowId: number;
|
|
64
|
-
currentWebContentsId: number;
|
|
65
|
-
ipcRenderer: IElectronIpcRenderer;
|
|
66
|
-
webviewPreload: string;
|
|
67
|
-
plainWebviewPreload: string;
|
|
68
|
-
[key: string]: any;
|
|
69
|
-
} = (global as any) || {};
|
|
70
|
-
|
|
71
|
-
if (typeof ElectronIpcRenderer !== 'undefined') {
|
|
72
|
-
electronEnv.ipcRenderer = ElectronIpcRenderer;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
export interface IElectronNativeDialogService {
|
|
76
|
-
showOpenDialog(options: Electron.OpenDialogOptions): Promise<string[] | undefined>;
|
|
77
|
-
|
|
78
|
-
showSaveDialog(options: Electron.SaveDialogOptions): Promise<string | undefined>;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
export const IElectronNativeDialogService = Symbol('IElectronNativeDialogService');
|
|
82
|
-
|
|
83
|
-
export function createElectronClientConnection(connectPath?: string): MessageConnection {
|
|
84
|
-
let socket;
|
|
85
|
-
if (connectPath) {
|
|
86
|
-
socket = electronEnv.createNetConnection(connectPath);
|
|
87
|
-
} else {
|
|
88
|
-
socket = electronEnv.createRPCNetConnection();
|
|
89
|
-
}
|
|
90
|
-
const { createSocketConnection } = require('@opensumi/ide-connection/lib/node/connect');
|
|
91
|
-
return createSocketConnection(socket);
|
|
92
|
-
}
|
package/src/utils/env.ts
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { isWindows, isElectronRenderer } from '@opensumi/ide-core-common';
|
|
2
|
-
|
|
3
|
-
export function getElectronEnv(): any {
|
|
4
|
-
return (global as any).env || {};
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
export function useNativeTopMenu() {
|
|
8
|
-
if (isElectronRenderer()) {
|
|
9
|
-
if (getElectronEnv().USE_NATIVE_TOP_MENU !== undefined) {
|
|
10
|
-
return getElectronEnv().USE_NATIVE_TOP_MENU === '1';
|
|
11
|
-
} else {
|
|
12
|
-
return !isWindows;
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
return false;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export function useNativeContextMenu() {
|
|
19
|
-
if (isElectronRenderer()) {
|
|
20
|
-
if (getElectronEnv().USE_NATIVE_CONTEXT_MENU !== undefined) {
|
|
21
|
-
return getElectronEnv().USE_NATIVE_CONTEXT_MENU === '1';
|
|
22
|
-
}
|
|
23
|
-
return true;
|
|
24
|
-
}
|
|
25
|
-
return false;
|
|
26
|
-
}
|
package/src/utils/icon.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 获取 icon class name
|
|
3
|
-
* @param text status-bar 传过来的文字
|
|
4
|
-
* @returns [icon, text]
|
|
5
|
-
*/
|
|
6
|
-
export function getIconClass(text: string): [string | null, string] {
|
|
7
|
-
const regExp = /\$\(([^\)]*)\)(.*)/;
|
|
8
|
-
const result = text.match(regExp);
|
|
9
|
-
if (!result) {
|
|
10
|
-
return [null, text];
|
|
11
|
-
}
|
|
12
|
-
return [result[1], result[2].trim()];
|
|
13
|
-
}
|