@opensumi/ide-opened-editor 2.12.1-next-079c1930

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 (43) hide show
  1. package/lib/browser/index.d.ts +6 -0
  2. package/lib/browser/index.d.ts.map +1 -0
  3. package/lib/browser/index.js +35 -0
  4. package/lib/browser/index.js.map +1 -0
  5. package/lib/browser/index.module.less +24 -0
  6. package/lib/browser/opened-editor-node.d.ts +21 -0
  7. package/lib/browser/opened-editor-node.d.ts.map +1 -0
  8. package/lib/browser/opened-editor-node.define.d.ts +30 -0
  9. package/lib/browser/opened-editor-node.define.d.ts.map +1 -0
  10. package/lib/browser/opened-editor-node.define.js +71 -0
  11. package/lib/browser/opened-editor-node.define.js.map +1 -0
  12. package/lib/browser/opened-editor-node.js +128 -0
  13. package/lib/browser/opened-editor-node.js.map +1 -0
  14. package/lib/browser/opened-editor-node.module.less +218 -0
  15. package/lib/browser/opened-editor.contribution.d.ts +16 -0
  16. package/lib/browser/opened-editor.contribution.d.ts.map +1 -0
  17. package/lib/browser/opened-editor.contribution.js +168 -0
  18. package/lib/browser/opened-editor.contribution.js.map +1 -0
  19. package/lib/browser/opened-editor.d.ts +6 -0
  20. package/lib/browser/opened-editor.d.ts.map +1 -0
  21. package/lib/browser/opened-editor.js +86 -0
  22. package/lib/browser/opened-editor.js.map +1 -0
  23. package/lib/browser/services/opened-editor-decoration.service.d.ts +13 -0
  24. package/lib/browser/services/opened-editor-decoration.service.d.ts.map +1 -0
  25. package/lib/browser/services/opened-editor-decoration.service.js +59 -0
  26. package/lib/browser/services/opened-editor-decoration.service.js.map +1 -0
  27. package/lib/browser/services/opened-editor-event.service.d.ts +23 -0
  28. package/lib/browser/services/opened-editor-event.service.d.ts.map +1 -0
  29. package/lib/browser/services/opened-editor-event.service.js +71 -0
  30. package/lib/browser/services/opened-editor-event.service.js.map +1 -0
  31. package/lib/browser/services/opened-editor-model.d.ts +15 -0
  32. package/lib/browser/services/opened-editor-model.d.ts.map +1 -0
  33. package/lib/browser/services/opened-editor-model.js +51 -0
  34. package/lib/browser/services/opened-editor-model.js.map +1 -0
  35. package/lib/browser/services/opened-editor-model.service.d.ts +81 -0
  36. package/lib/browser/services/opened-editor-model.service.d.ts.map +1 -0
  37. package/lib/browser/services/opened-editor-model.service.js +464 -0
  38. package/lib/browser/services/opened-editor-model.service.js.map +1 -0
  39. package/lib/browser/services/opened-editor-tree.service.d.ts +28 -0
  40. package/lib/browser/services/opened-editor-tree.service.d.ts.map +1 -0
  41. package/lib/browser/services/opened-editor-tree.service.js +176 -0
  42. package/lib/browser/services/opened-editor-tree.service.js.map +1 -0
  43. package/package.json +34 -0
@@ -0,0 +1,6 @@
1
+ import { Provider } from '@opensumi/di';
2
+ import { BrowserModule } from '@opensumi/ide-core-browser';
3
+ export declare class OpenedEditorModule extends BrowserModule {
4
+ providers: Provider[];
5
+ }
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/browser/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAc,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAM3D,qBACa,kBAAmB,SAAQ,aAAa;IACnD,SAAS,EAAE,QAAQ,EAAE,CAcnB;CACH"}
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.OpenedEditorModule = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const di_1 = require("@opensumi/di");
6
+ const ide_core_browser_1 = require("@opensumi/ide-core-browser");
7
+ const opened_editor_contribution_1 = require("./opened-editor.contribution");
8
+ const opened_editor_decoration_service_1 = require("./services/opened-editor-decoration.service");
9
+ const opened_editor_tree_service_1 = require("./services/opened-editor-tree.service");
10
+ const opened_editor_model_service_1 = require("./services/opened-editor-model.service");
11
+ let OpenedEditorModule = class OpenedEditorModule extends ide_core_browser_1.BrowserModule {
12
+ constructor() {
13
+ super(...arguments);
14
+ this.providers = [
15
+ {
16
+ token: opened_editor_decoration_service_1.OpenedEditorDecorationService,
17
+ useClass: opened_editor_decoration_service_1.OpenedEditorDecorationService,
18
+ },
19
+ {
20
+ token: opened_editor_tree_service_1.OpenedEditorService,
21
+ useClass: opened_editor_tree_service_1.OpenedEditorService,
22
+ },
23
+ {
24
+ token: opened_editor_model_service_1.OpenedEditorModelService,
25
+ useClass: opened_editor_model_service_1.OpenedEditorModelService,
26
+ },
27
+ opened_editor_contribution_1.OpenedEditorContribution,
28
+ ];
29
+ }
30
+ };
31
+ OpenedEditorModule = (0, tslib_1.__decorate)([
32
+ (0, di_1.Injectable)()
33
+ ], OpenedEditorModule);
34
+ exports.OpenedEditorModule = OpenedEditorModule;
35
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/browser/index.ts"],"names":[],"mappings":";;;;AAAA,qCAAoD;AACpD,iEAA2D;AAC3D,6EAAwE;AACxE,kGAA4F;AAC5F,sFAA4E;AAC5E,wFAAkF;AAGlF,IAAa,kBAAkB,GAA/B,MAAa,kBAAmB,SAAQ,gCAAa;IAArD;;QACE,cAAS,GAAe;YACtB;gBACE,KAAK,EAAE,gEAA6B;gBACpC,QAAQ,EAAE,gEAA6B;aACxC;YACD;gBACE,KAAK,EAAE,gDAAmB;gBAC1B,QAAQ,EAAE,gDAAmB;aAC9B;YACD;gBACE,KAAK,EAAE,sDAAwB;gBAC/B,QAAQ,EAAE,sDAAwB;aACnC;YACD,qDAAwB;SACzB,CAAC;IACJ,CAAC;CAAA,CAAA;AAhBY,kBAAkB;IAD9B,IAAA,eAAU,GAAE;GACA,kBAAkB,CAgB9B;AAhBY,gDAAkB"}
@@ -0,0 +1,24 @@
1
+ .opened_editor_container {
2
+ font-size: 12px;
3
+ overflow: hidden;
4
+ }
5
+
6
+ .opened_editor_empty_text {
7
+ display: block;
8
+ line-height: 36px;
9
+ text-align: center;
10
+ width: 100%;
11
+ user-select: none;
12
+ }
13
+
14
+ .dirty_icon {
15
+ &::before {
16
+ content: '';
17
+ display: block;
18
+ width: 8px;
19
+ height: 8px;
20
+ border-radius: 4px;
21
+ margin: 7px 5px;
22
+ background: var(--kt-dirtyDot-foreground);
23
+ }
24
+ }
@@ -0,0 +1,21 @@
1
+ import React from 'react';
2
+ import { TreeNode, CompositeTreeNode, INodeRendererProps, ClasslistComposite, TreeNodeType } from '@opensumi/ide-components';
3
+ import { LabelService } from '@opensumi/ide-core-browser/lib/services';
4
+ import { URI, CommandService } from '@opensumi/ide-core-browser';
5
+ import { OpenedEditorDecorationService } from './services/opened-editor-decoration.service';
6
+ export interface IEditorNodeProps {
7
+ item: any;
8
+ defaultLeftPadding?: number;
9
+ leftPadding?: number;
10
+ decorationService: OpenedEditorDecorationService;
11
+ commandService: CommandService;
12
+ labelService: LabelService;
13
+ decorations?: ClasslistComposite;
14
+ onClick: (ev: React.MouseEvent, item: TreeNode | CompositeTreeNode, type: TreeNodeType, activeUri?: URI) => void;
15
+ onContextMenu: (ev: React.MouseEvent, item: TreeNode | CompositeTreeNode, type: TreeNodeType, activeUri?: URI) => void;
16
+ }
17
+ export declare type EditorNodeRenderedProps = IEditorNodeProps & INodeRendererProps;
18
+ export declare const EditorTreeNode: React.FC<EditorNodeRenderedProps>;
19
+ export declare const OPENED_EDITOR_TREE_NODE_HEIGHT = 22;
20
+ export declare const OPENED_EDITOR_BADGE_LIMIT = 99;
21
+ //# sourceMappingURL=opened-editor-node.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"opened-editor-node.d.ts","sourceRoot":"","sources":["../../src/browser/opened-editor-node.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,QAAQ,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,YAAY,EAAU,MAAM,0BAA0B,CAAC;AACrI,OAAO,EAAE,YAAY,EAAE,MAAM,yCAAyC,CAAC;AACvE,OAAO,EAAE,GAAG,EAA4C,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAE3G,OAAO,EAAE,6BAA6B,EAAE,MAAM,6CAA6C,CAAC;AAG5F,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,GAAG,CAAC;IACV,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iBAAiB,EAAE,6BAA6B,CAAC;IACjD,cAAc,EAAE,cAAc,CAAC;IAC/B,YAAY,EAAE,YAAY,CAAC;IAC3B,WAAW,CAAC,EAAE,kBAAkB,CAAC;IACjC,OAAO,EAAE,CAAC,EAAE,EAAE,KAAK,CAAC,UAAU,EAAE,IAAI,EAAE,QAAQ,GAAG,iBAAiB,EAAE,IAAI,EAAE,YAAY,EAAE,SAAS,CAAC,EAAE,GAAG,KAAK,IAAI,CAAC;IACjH,aAAa,EAAE,CAAC,EAAE,EAAE,KAAK,CAAC,UAAU,EAAE,IAAI,EAAE,QAAQ,GAAG,iBAAiB,EAAE,IAAI,EAAE,YAAY,EAAE,SAAS,CAAC,EAAE,GAAG,KAAK,IAAI,CAAC;CACxH;AAED,oBAAY,uBAAuB,GAAG,gBAAgB,GAAG,kBAAkB,CAAC;AAE5E,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,uBAAuB,CA2L5D,CAAC;AAEF,eAAO,MAAM,8BAA8B,KAAK,CAAC;AACjD,eAAO,MAAM,yBAAyB,KAAK,CAAC"}
@@ -0,0 +1,30 @@
1
+ import { URI } from '@opensumi/ide-core-browser';
2
+ import { TreeNode, CompositeTreeNode } from '@opensumi/ide-components';
3
+ import { OpenedEditorService } from './services/opened-editor-tree.service';
4
+ import { IEditorGroup, IResource } from '@opensumi/ide-editor';
5
+ export declare type OpenedEditorData = IEditorGroup | IResource;
6
+ export declare class EditorFileRoot extends CompositeTreeNode {
7
+ static is(node: EditorFileGroup | EditorFileRoot): node is EditorFileRoot;
8
+ constructor(tree: OpenedEditorService, id?: number);
9
+ get expanded(): boolean;
10
+ dispose(): void;
11
+ }
12
+ export declare class EditorFileGroup extends CompositeTreeNode {
13
+ readonly group: IEditorGroup;
14
+ static isEditorGroup(data: OpenedEditorData): data is IEditorGroup;
15
+ static is(node: EditorFileGroup | EditorFile): node is EditorFileGroup;
16
+ private groupIndex;
17
+ constructor(tree: OpenedEditorService, group: IEditorGroup, parent: EditorFileRoot, id?: number);
18
+ get name(): string;
19
+ get tooltip(): string;
20
+ dispose(): void;
21
+ }
22
+ export declare class EditorFile extends TreeNode {
23
+ readonly resource: IResource;
24
+ tooltip: string;
25
+ constructor(tree: OpenedEditorService, resource: IResource, tooltip: string, parent: EditorFileGroup | undefined, id?: number);
26
+ get name(): string;
27
+ get uri(): URI;
28
+ dispose(): void;
29
+ }
30
+ //# sourceMappingURL=opened-editor-node.define.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"opened-editor-node.define.d.ts","sourceRoot":"","sources":["../../src/browser/opened-editor-node.define.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,GAAG,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAE,QAAQ,EAAE,iBAAiB,EAAS,MAAM,0BAA0B,CAAC;AAC9E,OAAO,EAAE,mBAAmB,EAAE,MAAM,uCAAuC,CAAC;AAC5E,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAE/D,oBAAY,gBAAgB,GAAG,YAAY,GAAG,SAAS,CAAC;AAExD,qBAAa,cAAe,SAAQ,iBAAiB;IAEnD,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,eAAe,GAAG,cAAc,GAAG,IAAI,IAAI,cAAc;gBAKvE,IAAI,EAAE,mBAAmB,EACzB,EAAE,CAAC,EAAE,MAAM;IAQb,IAAI,QAAQ,YAEX;IAED,OAAO;CAGR;AAGD,qBAAa,eAAgB,SAAQ,iBAAiB;aAalC,KAAK,EAAE,YAAY;IAZrC,MAAM,CAAC,aAAa,CAAC,IAAI,EAAE,gBAAgB,GAAG,IAAI,IAAI,YAAY;IAIlE,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,eAAe,GAAG,UAAU,GAAG,IAAI,IAAI,eAAe;IAItE,OAAO,CAAC,UAAU,CAAS;gBAGzB,IAAI,EAAE,mBAAmB,EACT,KAAK,EAAE,YAAY,EACnC,MAAM,EAAE,cAAc,EACtB,EAAE,CAAC,EAAE,MAAM;IAUb,IAAI,IAAI,WAEP;IAED,IAAI,OAAO,WAEV;IAED,OAAO;CAGR;AAED,qBAAa,UAAW,SAAQ,QAAQ;aAGpB,QAAQ,EAAE,SAAS;IAC5B,OAAO,EAAE,MAAM;gBAFtB,IAAI,EAAE,mBAAmB,EACT,QAAQ,EAAE,SAAS,EAC5B,OAAO,EAAE,MAAM,EACtB,MAAM,EAAE,eAAe,GAAG,SAAS,EACnC,EAAE,CAAC,EAAE,MAAM;IAOb,IAAI,IAAI,WAEP;IAED,IAAI,GAAG,QAEN;IAED,OAAO;CAGR"}
@@ -0,0 +1,71 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.EditorFile = exports.EditorFileGroup = exports.EditorFileRoot = void 0;
4
+ const ide_core_browser_1 = require("@opensumi/ide-core-browser");
5
+ const ide_components_1 = require("@opensumi/ide-components");
6
+ class EditorFileRoot extends ide_components_1.CompositeTreeNode {
7
+ static is(node) {
8
+ return !!node && !node.parent;
9
+ }
10
+ constructor(tree, id) {
11
+ super(tree, undefined, undefined, undefined, { disableCache: true });
12
+ // 根节点默认展开节点
13
+ this._uid = id || this._uid;
14
+ ide_components_1.TreeNode.setTreeNode(this._uid, this.path, this);
15
+ }
16
+ get expanded() {
17
+ return true;
18
+ }
19
+ dispose() {
20
+ super.dispose();
21
+ }
22
+ }
23
+ exports.EditorFileRoot = EditorFileRoot;
24
+ // EditorFileGroup 节点不包含父节点, 同时默认为展开状态
25
+ class EditorFileGroup extends ide_components_1.CompositeTreeNode {
26
+ constructor(tree, group, parent, id) {
27
+ super(tree, parent, undefined, undefined, { disableCache: true });
28
+ this.group = group;
29
+ this.groupIndex = this.group.index;
30
+ this._uid = id || this._uid;
31
+ ide_components_1.TreeNode.setTreeNode(this._uid, this.path, this);
32
+ // 根节点默认展开节点
33
+ this.setExpanded(false, true);
34
+ }
35
+ static isEditorGroup(data) {
36
+ return typeof data.resources !== 'undefined';
37
+ }
38
+ static is(node) {
39
+ return !!node && !!node.group;
40
+ }
41
+ get name() {
42
+ return (0, ide_core_browser_1.formatLocalize)('opened.editors.group.title', this.groupIndex + 1);
43
+ }
44
+ get tooltip() {
45
+ return this.name;
46
+ }
47
+ dispose() {
48
+ super.dispose();
49
+ }
50
+ }
51
+ exports.EditorFileGroup = EditorFileGroup;
52
+ class EditorFile extends ide_components_1.TreeNode {
53
+ constructor(tree, resource, tooltip, parent, id) {
54
+ super(tree, parent, undefined, undefined, { disableCache: true });
55
+ this.resource = resource;
56
+ this.tooltip = tooltip;
57
+ this._uid = id || this._uid;
58
+ ide_components_1.TreeNode.setTreeNode(this._uid, this.path, this);
59
+ }
60
+ get name() {
61
+ return this.resource ? this.resource.name : '';
62
+ }
63
+ get uri() {
64
+ return this.resource ? this.resource.uri : new ide_core_browser_1.URI();
65
+ }
66
+ dispose() {
67
+ super.dispose();
68
+ }
69
+ }
70
+ exports.EditorFile = EditorFile;
71
+ //# sourceMappingURL=opened-editor-node.define.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"opened-editor-node.define.js","sourceRoot":"","sources":["../../src/browser/opened-editor-node.define.ts"],"names":[],"mappings":";;;AAAA,iEAAiE;AACjE,6DAA8E;AAM9E,MAAa,cAAe,SAAQ,kCAAiB;IAEnD,MAAM,CAAC,EAAE,CAAC,IAAsC;QAC9C,OAAO,CAAC,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC;IAChC,CAA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HEIGHT = exports.EditorTreeNode = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const react_1 = (0, tslib_1.__importDefault)(require("react"));
6
+ const classnames_1 = (0, tslib_1.__importDefault)(require("classnames"));
7
+ const opened_editor_node_module_less_1 = (0, tslib_1.__importDefault)(require("./opened-editor-node.module.less"));
8
+ const ide_components_1 = require("@opensumi/ide-components");
9
+ const ide_core_browser_1 = require("@opensumi/ide-core-browser");
10
+ const opened_editor_node_define_1 = require("./opened-editor-node.define");
11
+ const ide_webview_1 = require("@opensumi/ide-webview");
12
+ const EditorTreeNode = ({ item, defaultLeftPadding = 8, leftPadding = 8, onClick, onContextMenu, itemType, decorationService, labelService, commandService, decorations, }) => {
13
+ const decoration = opened_editor_node_define_1.EditorFileGroup.is(item) ? null : decorationService.getDecoration(item.uri, false);
14
+ const handleClick = (ev) => {
15
+ if (itemType === ide_components_1.TreeNodeType.TreeNode || itemType === ide_components_1.TreeNodeType.CompositeTreeNode) {
16
+ onClick(ev, item, itemType);
17
+ }
18
+ };
19
+ const handleContextMenu = (ev) => {
20
+ if (ev.nativeEvent.which === 0) {
21
+ return;
22
+ }
23
+ if (itemType === ide_components_1.TreeNodeType.TreeNode || itemType === ide_components_1.TreeNodeType.CompositeTreeNode) {
24
+ onContextMenu(ev, item, itemType);
25
+ }
26
+ };
27
+ const paddingLeft = `${defaultLeftPadding + (item.depth || 0) * (leftPadding || 0) + (!opened_editor_node_define_1.EditorFileGroup.is(item) ? 16 : 0)}px`;
28
+ const editorNodeStyle = {
29
+ color: decoration ? decoration.color : '',
30
+ height: exports.OPENED_EDITOR_TREE_NODE_HEIGHT,
31
+ lineHeight: `${exports.OPENED_EDITOR_TREE_NODE_HEIGHT}px`,
32
+ paddingLeft,
33
+ };
34
+ const renderIcon = (node) => {
35
+ if (opened_editor_node_define_1.EditorFileGroup.is(node)) {
36
+ return null;
37
+ }
38
+ const iconClass = node.resource.icon || labelService.getIcon(node.uri, { isDirectory: false });
39
+ return react_1.default.createElement("div", { className: (0, classnames_1.default)(opened_editor_node_module_less_1.default.file_icon, iconClass), style: { height: exports.OPENED_EDITOR_TREE_NODE_HEIGHT, lineHeight: `${exports.OPENED_EDITOR_TREE_NODE_HEIGHT}px` } });
40
+ };
41
+ const getNodeName = (node) => {
42
+ if (!opened_editor_node_define_1.EditorFileGroup.is(node)) {
43
+ if (node.uri.scheme === ide_webview_1.EDITOR_WEBVIEW_SCHEME) {
44
+ return node.name;
45
+ }
46
+ return node.name || labelService.getName(node.uri);
47
+ }
48
+ return node.name;
49
+ };
50
+ const renderDisplayName = (node) => {
51
+ return react_1.default.createElement("div", { className: (0, classnames_1.default)(opened_editor_node_module_less_1.default.opened_editor_node_segment, opened_editor_node_module_less_1.default.opened_editor_node_display_name) }, getNodeName(node));
52
+ };
53
+ const renderDescription = (node) => {
54
+ if (opened_editor_node_define_1.EditorFileGroup.is(node)) {
55
+ return null;
56
+ }
57
+ return react_1.default.createElement("div", { className: (0, classnames_1.default)(opened_editor_node_module_less_1.default.opened_editor_node_segment_grow, opened_editor_node_module_less_1.default.opened_editor_node_description) }, node.tooltip);
58
+ };
59
+ const renderStatusTail = () => {
60
+ return react_1.default.createElement("div", { className: (0, classnames_1.default)(opened_editor_node_module_less_1.default.opened_editor_node_segment, opened_editor_node_module_less_1.default.opened_editor_node_tail) }, renderBadge());
61
+ };
62
+ const renderBadge = () => {
63
+ if (!decoration) {
64
+ return null;
65
+ }
66
+ return react_1.default.createElement("div", { className: opened_editor_node_module_less_1.default.opened_editor_node_status }, decoration.badge.slice());
67
+ };
68
+ const getItemTooltip = () => {
69
+ let tooltip = item.tooltip;
70
+ if (decoration && decoration.badge) {
71
+ tooltip += ` • ${decoration.tooltip}`;
72
+ }
73
+ return tooltip;
74
+ };
75
+ const renderAction = () => {
76
+ let actions = [];
77
+ if (opened_editor_node_define_1.EditorFileGroup.is(item)) {
78
+ actions = [{
79
+ icon: (0, ide_core_browser_1.getIcon)('save-all'),
80
+ title: (0, ide_core_browser_1.localize)('opened.editors.save.byGroup'),
81
+ command: ide_core_browser_1.OPEN_EDITORS_COMMANDS.SAVE_BY_GROUP.id,
82
+ },
83
+ {
84
+ icon: (0, ide_core_browser_1.getIcon)('clear'),
85
+ title: (0, ide_core_browser_1.localize)('opened.editors.close.byGroup'),
86
+ command: ide_core_browser_1.OPEN_EDITORS_COMMANDS.CLOSE_BY_GROUP.id,
87
+ }];
88
+ return react_1.default.createElement("div", { className: opened_editor_node_module_less_1.default.opened_editor_right_actions }, actions.map((action) => {
89
+ const clickHandler = (event) => {
90
+ event.stopPropagation();
91
+ event.preventDefault();
92
+ commandService.executeCommand(action.command, item);
93
+ };
94
+ return react_1.default.createElement(ide_components_1.Button, { type: 'icon', key: `${item.id}-${action.command}`, iconClass: (0, classnames_1.default)(opened_editor_node_module_less_1.default.action_icon, action.icon), title: action.title, onClick: clickHandler });
95
+ }));
96
+ }
97
+ else {
98
+ actions = [{
99
+ icon: (0, ide_core_browser_1.getIcon)('close'),
100
+ title: (0, ide_core_browser_1.localize)('file.close'),
101
+ command: ide_core_browser_1.OPEN_EDITORS_COMMANDS.CLOSE.id,
102
+ }];
103
+ return react_1.default.createElement("div", { className: opened_editor_node_module_less_1.default.opened_editor_left_actions }, actions.map((action) => {
104
+ const clickHandler = (event) => {
105
+ event.stopPropagation();
106
+ event.preventDefault();
107
+ commandService.executeCommand(action.command, item);
108
+ };
109
+ return react_1.default.createElement(ide_components_1.Button, { type: 'icon', key: `${item.id}-${action.command}`, iconClass: (0, classnames_1.default)(opened_editor_node_module_less_1.default.action_icon, action.icon), title: action.title, onClick: clickHandler });
110
+ }));
111
+ }
112
+ };
113
+ const renderActionBar = () => {
114
+ return react_1.default.createElement("div", { className: opened_editor_node_module_less_1.default.opened_editor_action_bar }, renderAction());
115
+ };
116
+ return (react_1.default.createElement("div", { key: item.id, onClick: handleClick, onContextMenu: handleContextMenu, title: getItemTooltip(), className: (0, classnames_1.default)(opened_editor_node_module_less_1.default.opened_editor_node, decorations ? decorations.classlist : null), style: editorNodeStyle, "data-id": item.id },
117
+ renderActionBar(),
118
+ react_1.default.createElement("div", { className: (0, classnames_1.default)(opened_editor_node_module_less_1.default.opened_editor_node_content) },
119
+ renderIcon(item),
120
+ react_1.default.createElement("div", { className: opened_editor_node_module_less_1.default.opened_editor_node_overflow_wrap },
121
+ renderDisplayName(item),
122
+ renderDescription(item)),
123
+ renderStatusTail())));
124
+ };
125
+ exports.EditorTreeNode = EditorTreeNode;
126
+ exports.OPENED_EDITOR_TREE_NODE_HEIGHT = 22;
127
+ exports.OPENED_EDITOR_BADGE_LIMIT = 99;
128
+ //# sourceMappingURL=opened-editor-node.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"opened-editor-node.js","sourceRoot":"","sources":["../../src/browser/opened-editor-node.tsx"],"names":[],"mappings":";;;;AAAA,+DAA0B;AAC1B,yEAA6B;AAC7B,mHAAsD;AACtD,6DAAqI;AAErI,iEAA2G;AAC3G,2EAA0E;AAE1E,uDAA8D;AAgBvD,MAAM,cAAc,GAAsC,CAAC,EAChE,IAAI,EACJ,kBAAkB,GAAG,CAAC,EACtB,WAAW,GAAG,CAAC,EACf,OAAO,EACP,aAAa,EACb,QAAQ,EACR,iBAAiB,EACjB,YAAY,EACZ,cAAc,EACd,WAAW,GACa,EAAE,EAAE;IAC5B,MAAM,UAAU,GAAG,2CAAe,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,iBAAiB,CAAC,aAAa,CAAC,IAAI,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;IAEtG,MAAM,WAAW,GAAG,CAAC,EAAoB,EAAE,EAAE;QAC3C,IAAI,QAAQ,KAAK,6BAAY,CAAC,QAAQ,IAAI,QAAQ,KAAK,6BAAY,CAAC,iBAAiB,EAAE;YACrF,OAAO,CAAC,EAAE,EAAE,IAAkB,EAAE,QAAQ,CAAC,CAAC;SAC3C;IACH,CAAC,CAAC;IAEF,MAAM,iBAAiB,GAA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C,EAAE,EACZ,OAAO,EAAE,WAAW,EACpB,aAAa,EAAE,iBAAiB,EAChC,KAAK,EAAE,cAAc,EAAE,EACvB,SAAS,EAAE,IAAA,oBAAG,EACZ,wCAAM,CAAC,kBAAkB,EACzB,WAAW,CAAC,CAAC,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAC3C,EACD,KAAK,EAAE,eAAe,aACb,IAAI,CAAC,EAAE;QAEf,eAAe,EAAE;QAClB,uCAAK,SAAS,EAAE,IAAA,oBAAG,EAAC,wCAAM,CAAC,0BAA0B,CAAC;YACnD,UAAU,CAAC,IAAI,CAAC;YACjB,uCACE,SAAS,EAAE,wCAAM,CAAC,gCAAgC;gBAEjD,iBAAiB,CAAC,IAAI,CAAC;gBACvB,iBAAiB,CAAC,IAAI,CAAC,CACpB;YACL,gBAAgB,EAAE,CACf,CACF,CACP,CAAC;AACJ,CAAC,CAAC;AA3LW,QAAA,cAAc,kBA2LzB;AAEW,QAAA,8BAA8B,GAAG,EAAE,CAAC;AACpC,QAAA,yBAAyB,GAAG,EAAE,CAAC"}
@@ -0,0 +1,218 @@
1
+ .opened_editor_node {
2
+ height: 22px;
3
+ line-height: 22px;
4
+ display: flex;
5
+ flex-direction: column;
6
+ position: relative;
7
+ cursor: pointer;
8
+
9
+ &:hover {
10
+ color: var(--kt-tree-hoverForeground);
11
+ background: var(--kt-tree-hoverBackground);
12
+ .opened_editor_action_bar {
13
+ display: block;
14
+ }
15
+ &::before {
16
+ display: none !important;
17
+ }
18
+ }
19
+
20
+ &.mod_selected {
21
+ color: var(--kt-tree-inactiveSelectionForeground) !important;
22
+ background: var(--kt-tree-inactiveSelectionBackground);
23
+ .expansion_toggle, .opened_editor_node_description {
24
+ color: var(--kt-tree-inactiveSelectionForeground) !important;
25
+ }
26
+ }
27
+
28
+ &.mod_focused {
29
+ outline: 1px solid var(--list-focusOutline);
30
+ outline-offset: -1px;
31
+ color: var(--kt-tree-activeSelectionForeground) !important;;
32
+ background: var(--kt-tree-activeSelectionBackground);
33
+ .expansion_toggle, .opened_editor_node_description {
34
+ color: var(--kt-tree-activeSelectionForeground) !important;;
35
+ }
36
+ .opened_editor_node_display_name {
37
+ .compact_name {
38
+ &.active {
39
+ text-decoration: underline;
40
+ }
41
+ }
42
+ }
43
+ }
44
+
45
+ &.mod_actived {
46
+ outline: 1px solid var(--list-focusOutline);
47
+ outline-offset: -1px;
48
+ .expansion_toggle {
49
+ color: var(--kt-tree-activeSelectionForeground) !important;
50
+ }
51
+ .opened_editor_node_display_name {
52
+ .compact_name {
53
+ &.active {
54
+ text-decoration: underline;
55
+ }
56
+ }
57
+ }
58
+ }
59
+
60
+ &.mod_dirty {
61
+ &::before {
62
+ content: '';
63
+ display: block;
64
+ width: 8px;
65
+ height: 8px;
66
+ border-radius: 4px;
67
+ margin: 7px 5px;
68
+ background: var(--kt-dirtyDot-foreground);
69
+ position: absolute;
70
+ left: 18px;
71
+ }
72
+ }
73
+ }
74
+
75
+ .opened_editor_node_description {
76
+ display: inline;
77
+ transform: scale(0.96);
78
+ color: var(--descriptionForeground);
79
+ }
80
+
81
+ .opened_editor_node_content {
82
+ position: relative;
83
+ display: flex;
84
+ align-items: center;
85
+ width: 100%;
86
+
87
+ match {
88
+ background-color: var(--editor-findMatchHighlightBackground);
89
+ }
90
+ }
91
+
92
+ .opened_editor_node_status {
93
+ opacity: .75;
94
+ text-align: center;
95
+ font-size: 12px;
96
+ padding-right: 0;
97
+ }
98
+
99
+ .opened_editor_node_segment {
100
+ flex-grow: 0;
101
+ white-space: nowrap;
102
+ color: inherit;
103
+ &_grow {
104
+ flex-grow: 1 !important;
105
+ text-align: left;
106
+ z-index: 10;
107
+ padding-right: 5px;
108
+
109
+ &.overflow_visible {
110
+ overflow: visible !important;
111
+ }
112
+ }
113
+ }
114
+
115
+
116
+ .opened_editor_node_display_name {
117
+ margin-right: 6px;
118
+ display: inline;
119
+ white-space:pre;
120
+ .compact_name {
121
+ color: inherit;
122
+ display: inline;
123
+ &:focus,
124
+ &:hover {
125
+ text-decoration: underline;
126
+ }
127
+ }
128
+ .compact_name_separator {
129
+ margin: 0 2px;
130
+ opacity: .5;
131
+ }
132
+ }
133
+
134
+ .opened_editor_node_description {
135
+ display: inline;
136
+ transform: scale(0.96);
137
+ color: var(--descriptionForeground);
138
+ }
139
+
140
+ .opened_editor_node_overflow_wrap {
141
+ flex: 1;
142
+ flex-shrink: 0;
143
+ overflow: hidden;
144
+ text-overflow: ellipsis;
145
+ white-space: nowrap;
146
+ text-align: left;
147
+ }
148
+
149
+ .opened_editor_node_flex_wrap {
150
+ display: flex;
151
+ flex-direction: row;
152
+ }
153
+
154
+ .opened_editor_node_segment_grow {
155
+ flex-grow: 1 !important;
156
+ text-align: left;
157
+ z-index: 10;
158
+ padding-right: 5px;
159
+
160
+ &.overflow_visible {
161
+ overflow: visible !important;
162
+ }
163
+ }
164
+
165
+ .file_icon {
166
+ position: relative;
167
+ color: var(--icon-foreground);
168
+ margin-right: 4px;
169
+ &:before {
170
+ font-size: 16px;
171
+ text-align: center;
172
+ }
173
+ }
174
+
175
+ .file_icon:global(&.fileIcon:before) {
176
+ font-size: 18px;
177
+ }
178
+
179
+ .opened_editor_node_tail {
180
+ text-align: center;
181
+ margin-right: 10px;
182
+ position: relative;
183
+ height: 22px;
184
+ display: flex;
185
+ align-items: center;
186
+ }
187
+
188
+ .opened_editor_action_bar {
189
+ position: absolute;
190
+ top: 0;
191
+ left: 0;
192
+ width: 100%;
193
+ display: flex;
194
+ display: none;
195
+ z-index: 10;
196
+ .action_icon {
197
+ margin-left: 6px;
198
+ font-size: 14px;
199
+ }
200
+ }
201
+
202
+ .opened_editor_left_actions {
203
+ position: absolute;
204
+ left: 14px;
205
+ }
206
+
207
+ .opened_editor_right_actions {
208
+ right: 0;
209
+ position: absolute;
210
+ margin-right: 10px;
211
+ }
212
+
213
+ .opened_editor_left_actions, .opened_editor_right_actions {
214
+ display: flex;
215
+ align-items: center;
216
+ justify-content: center;
217
+ height: 22px;
218
+ }
@@ -0,0 +1,16 @@
1
+ import { CommandContribution, CommandRegistry } from '@opensumi/ide-core-browser';
2
+ import { ToolbarRegistry, TabBarToolbarContribution } from '@opensumi/ide-core-browser/lib/layout';
3
+ import { ClientAppContribution } from '@opensumi/ide-core-browser';
4
+ import { MenuContribution, IMenuRegistry } from '@opensumi/ide-core-browser/lib/menu/next';
5
+ export declare const ExplorerOpenedEditorViewId = "file-opened-editor";
6
+ export declare class OpenedEditorContribution implements ClientAppContribution, TabBarToolbarContribution, CommandContribution, MenuContribution {
7
+ private readonly mainLayoutService;
8
+ private readonly workbenchEditorService;
9
+ private readonly openedEditorModelService;
10
+ private readonly commandService;
11
+ onStart(): Promise<void>;
12
+ registerCommands(commands: CommandRegistry): void;
13
+ registerToolbarItems(registry: ToolbarRegistry): void;
14
+ registerMenus(menuRegistry: IMenuRegistry): void;
15
+ }
16
+ //# sourceMappingURL=opened-editor.contribution.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"opened-editor.contribution.d.ts","sourceRoot":"","sources":["../../src/browser/opened-editor.contribution.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,mBAAmB,EAAE,eAAe,EAAyE,MAAM,4BAA4B,CAAC;AAI3K,OAAO,EAAE,eAAe,EAAE,yBAAyB,EAAE,MAAM,uCAAuC,CAAC;AAEnG,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAU,MAAM,0CAA0C,CAAC;AAKnG,eAAO,MAAM,0BAA0B,uBAAuB,CAAC;AAE/D,qBACa,wBAAyB,YAAW,qBAAqB,EAAE,yBAAyB,EAAE,mBAAmB,EAAE,gBAAgB;IAGtI,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAqB;IAGvD,OAAO,CAAC,QAAQ,CAAC,sBAAsB,CAAyB;IAGhE,OAAO,CAAC,QAAQ,CAAC,wBAAwB,CAA2B;IAGpE,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAiB;IAE1C,OAAO;IAWb,gBAAgB,CAAC,QAAQ,EAAE,eAAe;IA4E1C,oBAAoB,CAAC,QAAQ,EAAE,eAAe;IAgB9C,aAAa,CAAC,YAAY,EAAE,aAAa,GAAG,IAAI;CA0CjD"}