@opensumi/ide-outline 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.
- package/lib/browser/index.d.ts +6 -0
- package/lib/browser/index.d.ts.map +1 -0
- package/lib/browser/index.js +41 -0
- package/lib/browser/index.js.map +1 -0
- package/lib/browser/outline-node.d.ts +18 -0
- package/lib/browser/outline-node.d.ts.map +1 -0
- package/lib/browser/outline-node.define.d.ts +28 -0
- package/lib/browser/outline-node.define.d.ts.map +1 -0
- package/lib/browser/outline-node.define.js +59 -0
- package/lib/browser/outline-node.define.js.map +1 -0
- package/lib/browser/outline-node.js +78 -0
- package/lib/browser/outline-node.js.map +1 -0
- package/lib/browser/outline-node.module.less +220 -0
- package/lib/browser/outline.contribution.d.ts +12 -0
- package/lib/browser/outline.contribution.d.ts.map +1 -0
- package/lib/browser/outline.contribution.js +125 -0
- package/lib/browser/outline.contribution.js.map +1 -0
- package/lib/browser/outline.d.ts +6 -0
- package/lib/browser/outline.d.ts.map +1 -0
- package/lib/browser/outline.js +79 -0
- package/lib/browser/outline.js.map +1 -0
- package/lib/browser/outline.module.less +11 -0
- package/lib/browser/services/outline-contextkey.service.d.ts +8 -0
- package/lib/browser/services/outline-contextkey.service.d.ts.map +1 -0
- package/lib/browser/services/outline-contextkey.service.js +25 -0
- package/lib/browser/services/outline-contextkey.service.js.map +1 -0
- package/lib/browser/services/outline-decoration.service.d.ts +14 -0
- package/lib/browser/services/outline-decoration.service.d.ts.map +1 -0
- package/lib/browser/services/outline-decoration.service.js +56 -0
- package/lib/browser/services/outline-decoration.service.js.map +1 -0
- package/lib/browser/services/outline-event.service.d.ts +21 -0
- package/lib/browser/services/outline-event.service.d.ts.map +1 -0
- package/lib/browser/services/outline-event.service.js +57 -0
- package/lib/browser/services/outline-event.service.js.map +1 -0
- package/lib/browser/services/outline-model.d.ts +12 -0
- package/lib/browser/services/outline-model.d.ts.map +1 -0
- package/lib/browser/services/outline-model.js +43 -0
- package/lib/browser/services/outline-model.js.map +1 -0
- package/lib/browser/services/outline-model.service.d.ts +83 -0
- package/lib/browser/services/outline-model.service.d.ts.map +1 -0
- package/lib/browser/services/outline-model.service.js +508 -0
- package/lib/browser/services/outline-model.service.js.map +1 -0
- package/lib/browser/services/outline-tree.service.d.ts +33 -0
- package/lib/browser/services/outline-tree.service.d.ts.map +1 -0
- package/lib/browser/services/outline-tree.service.js +143 -0
- package/lib/browser/services/outline-tree.service.js.map +1 -0
- package/lib/common/index.d.ts +26 -0
- package/lib/common/index.d.ts.map +1 -0
- package/lib/common/index.js +5 -0
- package/lib/common/index.js.map +1 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +5 -0
- package/lib/index.js.map +1 -0
- package/package.json +29 -0
|
@@ -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;AAQ3D,qBACa,aAAc,SAAQ,aAAa;IAC9C,SAAS,EAAE,QAAQ,EAAE,CAkBnB;CACH"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.OutlineModule = 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 outline_contribution_1 = require("./outline.contribution");
|
|
8
|
+
const outline_decoration_service_1 = require("./services/outline-decoration.service");
|
|
9
|
+
const outline_event_service_1 = require("./services/outline-event.service");
|
|
10
|
+
const outline_tree_service_1 = require("./services/outline-tree.service");
|
|
11
|
+
const outline_model_service_1 = require("./services/outline-model.service");
|
|
12
|
+
const common_1 = require("../common");
|
|
13
|
+
let OutlineModule = class OutlineModule extends ide_core_browser_1.BrowserModule {
|
|
14
|
+
constructor() {
|
|
15
|
+
super(...arguments);
|
|
16
|
+
this.providers = [
|
|
17
|
+
{
|
|
18
|
+
token: common_1.IOutlineDecorationService,
|
|
19
|
+
useClass: outline_decoration_service_1.OutlineDecorationService,
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
token: outline_event_service_1.OutlineEventService,
|
|
23
|
+
useClass: outline_event_service_1.OutlineEventService,
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
token: outline_tree_service_1.OutlineTreeService,
|
|
27
|
+
useClass: outline_tree_service_1.OutlineTreeService,
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
token: outline_model_service_1.OutlineModelService,
|
|
31
|
+
useClass: outline_model_service_1.OutlineModelService,
|
|
32
|
+
},
|
|
33
|
+
outline_contribution_1.OutlineContribution,
|
|
34
|
+
];
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
OutlineModule = (0, tslib_1.__decorate)([
|
|
38
|
+
(0, di_1.Injectable)()
|
|
39
|
+
], OutlineModule);
|
|
40
|
+
exports.OutlineModule = OutlineModule;
|
|
41
|
+
//# 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,iEAA6D;AAC7D,sFAAiF;AACjF,4EAAuE;AACvE,0EAAqE;AACrE,4EAAuE;AACvE,sCAAsD;AAGtD,IAAa,aAAa,GAA1B,MAAa,aAAc,SAAQ,gCAAa;IAAhD;;QACE,cAAS,GAAe;YACtB;gBACE,KAAK,EAAE,kCAAyB;gBAChC,QAAQ,EAAE,qDAAwB;aACnC;YACD;gBACE,KAAK,EAAE,2CAAmB;gBAC1B,QAAQ,EAAE,2CAAmB;aAC9B;YACD;gBACE,KAAK,EAAE,yCAAkB;gBACzB,QAAQ,EAAE,yCAAkB;aAC7B;YACD;gBACE,KAAK,EAAE,2CAAmB;gBAC1B,QAAQ,EAAE,2CAAmB;aAC9B;YACD,0CAAmB;SACpB,CAAC;IACJ,CAAC;CAAA,CAAA;AApBY,aAAa;IADzB,IAAA,eAAU,GAAE;GACA,aAAa,CAoBzB;AApBY,sCAAa"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { TreeNode, CompositeTreeNode, INodeRendererProps, ClasslistComposite, TreeNodeType } from '@opensumi/ide-components';
|
|
3
|
+
import { URI, CommandService } from '@opensumi/ide-core-browser';
|
|
4
|
+
import { IOutlineDecorationService } from '../common';
|
|
5
|
+
export interface IOutlineNodeProps {
|
|
6
|
+
item: any;
|
|
7
|
+
defaultLeftPadding?: number;
|
|
8
|
+
leftPadding?: number;
|
|
9
|
+
decorationService: IOutlineDecorationService;
|
|
10
|
+
commandService: CommandService;
|
|
11
|
+
decorations?: ClasslistComposite;
|
|
12
|
+
onClick: (ev: React.MouseEvent, item: TreeNode | CompositeTreeNode, type: TreeNodeType, activeUri?: URI) => void;
|
|
13
|
+
onTwistierClick: (ev: React.MouseEvent, item: TreeNode | CompositeTreeNode, type: TreeNodeType, activeUri?: URI) => void;
|
|
14
|
+
}
|
|
15
|
+
export declare type OutlineNodeRenderedProps = IOutlineNodeProps & INodeRendererProps;
|
|
16
|
+
export declare const OutlineNode: React.FC<OutlineNodeRenderedProps>;
|
|
17
|
+
export declare const OUTLINE_TREE_NODE_HEIGHT = 22;
|
|
18
|
+
//# sourceMappingURL=outline-node.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"outline-node.d.ts","sourceRoot":"","sources":["../../src/browser/outline-node.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,QAAQ,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAC7H,OAAO,EAAE,GAAG,EAAW,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAE1E,OAAO,EAAE,yBAAyB,EAAE,MAAM,WAAW,CAAC;AAGtD,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,GAAG,CAAC;IACV,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iBAAiB,EAAE,yBAAyB,CAAC;IAC7C,cAAc,EAAE,cAAc,CAAC;IAC/B,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,eAAe,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;CAC1H;AAED,oBAAY,wBAAwB,GAAG,iBAAiB,GAAG,kBAAkB,CAAC;AAE9E,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,wBAAwB,CAuH1D,CAAC;AAEF,eAAO,MAAM,wBAAwB,KAAK,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { TreeNode, CompositeTreeNode } from '@opensumi/ide-components';
|
|
2
|
+
import { INormalizedDocumentSymbol } from '@opensumi/ide-editor/lib/browser/breadcrumb/document-symbol';
|
|
3
|
+
import { OutlineTreeService } from './services/outline-tree.service';
|
|
4
|
+
import { MaybeNull, URI } from '@opensumi/ide-core-common';
|
|
5
|
+
export declare class OutlineRoot extends CompositeTreeNode {
|
|
6
|
+
static is(node: OutlineCompositeTreeNode | OutlineRoot): node is OutlineRoot;
|
|
7
|
+
private _currentUri;
|
|
8
|
+
constructor(tree: OutlineTreeService, currentUri: MaybeNull<URI>);
|
|
9
|
+
get currentUri(): MaybeNull<URI>;
|
|
10
|
+
get expanded(): boolean;
|
|
11
|
+
}
|
|
12
|
+
export declare class OutlineCompositeTreeNode extends CompositeTreeNode {
|
|
13
|
+
readonly raw: INormalizedDocumentSymbol;
|
|
14
|
+
readonly icon: string;
|
|
15
|
+
static is(node: OutlineCompositeTreeNode | OutlineTreeNode): node is OutlineCompositeTreeNode;
|
|
16
|
+
private _whenReady;
|
|
17
|
+
constructor(tree: OutlineTreeService, parent: OutlineCompositeTreeNode | OutlineRoot, raw: INormalizedDocumentSymbol, icon: string, id?: number);
|
|
18
|
+
get displayName(): string;
|
|
19
|
+
get whenReady(): Promise<void>;
|
|
20
|
+
}
|
|
21
|
+
export declare class OutlineTreeNode extends TreeNode {
|
|
22
|
+
readonly raw: INormalizedDocumentSymbol;
|
|
23
|
+
readonly icon: string;
|
|
24
|
+
static is(node: OutlineTreeNode): node is OutlineTreeNode;
|
|
25
|
+
constructor(tree: OutlineTreeService, parent: OutlineCompositeTreeNode | OutlineRoot, raw: INormalizedDocumentSymbol, icon: string, id?: number);
|
|
26
|
+
get displayName(): string;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=outline-node.define.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"outline-node.define.d.ts","sourceRoot":"","sources":["../../src/browser/outline-node.define.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,iBAAiB,EAAS,MAAM,0BAA0B,CAAC;AAC9E,OAAO,EAAE,yBAAyB,EAAE,MAAM,6DAA6D,CAAC;AACxG,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AACrE,OAAO,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,2BAA2B,CAAC;AAC3D,qBAAa,WAAY,SAAQ,iBAAiB;IAEhD,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,wBAAwB,GAAG,WAAW,GAAG,IAAI,IAAI,WAAW;IAI5E,OAAO,CAAC,WAAW,CAAiB;gBAGlC,IAAI,EAAE,kBAAkB,EACxB,UAAU,EAAE,SAAS,CAAC,GAAG,CAAC;IAM5B,IAAI,UAAU,mBAEb;IAED,IAAI,QAAQ,YAEX;CACF;AAGD,qBAAa,wBAAyB,SAAQ,iBAAiB;aAW3C,GAAG,EAAE,yBAAyB;aAC9B,IAAI,EAAE,MAAM;IAV9B,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,wBAAwB,GAAG,eAAe,GAAG,IAAI,IAAI,wBAAwB;IAI7F,OAAO,CAAC,UAAU,CAAgB;gBAGhC,IAAI,EAAE,kBAAkB,EACxB,MAAM,EAAE,wBAAwB,GAAG,WAAW,EAC9B,GAAG,EAAE,yBAAyB,EAC9B,IAAI,EAAE,MAAM,EAC5B,EAAE,CAAC,EAAE,MAAM;IAQb,IAAI,WAAW,WAEd;IAED,IAAI,SAAS,kBAEZ;CACF;AAED,qBAAa,eAAgB,SAAQ,QAAQ;aASzB,GAAG,EAAE,yBAAyB;aAC9B,IAAI,EAAE,MAAM;IAR9B,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,eAAe,GAAG,IAAI,IAAI,eAAe;gBAKvD,IAAI,EAAE,kBAAkB,EACxB,MAAM,EAAE,wBAAwB,GAAG,WAAW,EAC9B,GAAG,EAAE,yBAAyB,EAC9B,IAAI,EAAE,MAAM,EAC5B,EAAE,CAAC,EAAE,MAAM;IAOb,IAAI,WAAW,WAEd;CACF"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.OutlineTreeNode = exports.OutlineCompositeTreeNode = exports.OutlineRoot = void 0;
|
|
4
|
+
const ide_components_1 = require("@opensumi/ide-components");
|
|
5
|
+
class OutlineRoot extends ide_components_1.CompositeTreeNode {
|
|
6
|
+
constructor(tree, currentUri) {
|
|
7
|
+
super(tree, undefined);
|
|
8
|
+
this._currentUri = currentUri;
|
|
9
|
+
}
|
|
10
|
+
static is(node) {
|
|
11
|
+
return !!node && !node.parent;
|
|
12
|
+
}
|
|
13
|
+
get currentUri() {
|
|
14
|
+
return this._currentUri;
|
|
15
|
+
}
|
|
16
|
+
get expanded() {
|
|
17
|
+
return true;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
exports.OutlineRoot = OutlineRoot;
|
|
21
|
+
// OutlineCompositeTreeNode 节点不包含父节点, 同时默认为展开状态
|
|
22
|
+
class OutlineCompositeTreeNode extends ide_components_1.CompositeTreeNode {
|
|
23
|
+
constructor(tree, parent, raw, icon, id) {
|
|
24
|
+
super(tree, parent, undefined, { name: raw.name }, { disableCache: true });
|
|
25
|
+
this.raw = raw;
|
|
26
|
+
this.icon = icon;
|
|
27
|
+
this._uid = id || this._uid;
|
|
28
|
+
ide_components_1.TreeNode.setTreeNode(this._uid, this.path, this);
|
|
29
|
+
this._whenReady = this.setExpanded(false, true);
|
|
30
|
+
}
|
|
31
|
+
static is(node) {
|
|
32
|
+
var _a;
|
|
33
|
+
return !!node && !!node.raw && !!((_a = node.raw.children) === null || _a === void 0 ? void 0 : _a.length);
|
|
34
|
+
}
|
|
35
|
+
get displayName() {
|
|
36
|
+
return this.raw.name;
|
|
37
|
+
}
|
|
38
|
+
get whenReady() {
|
|
39
|
+
return this._whenReady;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
exports.OutlineCompositeTreeNode = OutlineCompositeTreeNode;
|
|
43
|
+
class OutlineTreeNode extends ide_components_1.TreeNode {
|
|
44
|
+
constructor(tree, parent, raw, icon, id) {
|
|
45
|
+
super(tree, parent, undefined, { name: raw.name }, { disableCache: true });
|
|
46
|
+
this.raw = raw;
|
|
47
|
+
this.icon = icon;
|
|
48
|
+
this._uid = id || this._uid;
|
|
49
|
+
ide_components_1.TreeNode.setTreeNode(this._uid, this.path, this);
|
|
50
|
+
}
|
|
51
|
+
static is(node) {
|
|
52
|
+
return !!node && !!node.raw;
|
|
53
|
+
}
|
|
54
|
+
get displayName() {
|
|
55
|
+
return this.raw.name;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
exports.OutlineTreeNode = OutlineTreeNode;
|
|
59
|
+
//# sourceMappingURL=outline-node.define.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"outline-node.define.js","sourceRoot":"","sources":["../../src/browser/outline-node.define.ts"],"names":[],"mappings":";;;AAAA,6DAA8E;AAI9E,MAAa,WAAY,SAAQ,kCAAiB;IAQhD,YACE,IAAwB,EACxB,UAA0B;QAE1B,KAAK,CAAC,IAAa,EAAE,SAAS,CAAC,CAAC;QAChC,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;IAChC,CAAC;IAZD,MAAM,CAAC,EAAE,CAAC,IAA4C;QACpD,OAAO,CAAC,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC;IAChC,CAAC;IAYD,IAAI,UAAU;QACZ,OAAO,IAAI,CAAC,WAAW,CAAC;IAC1B,CAAC;IAED,IAAI,QAAQ;QACV,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AAvBD,kCAuBC;AAED,+CAA+C;AAC/C,MAAa,wBAAyB,SAAQ,kCAAiB;IAQ7D,YACE,IAAwB,EACxB,MAA8C,EAC9B,GAA8B,EAC9B,IAAY,EAC5B,EAAW;QAEX,KAAK,CAAC,IAAa,EAAE,MAAM,EAAE,SAAS,EAAE,EAAE,IAAI,EAAE,GAAG,CAAC,IAAI,EAAE,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC,CAAC;QAJpE,QAAG,GAAH,GAAG,CAA2B;QAC9B,SAAI,GAAJ,IAAI,CAAQ;QAI5B,IAAI,CAAC,IAAI,GAAG,EAAE,IAAI,IAAI,CAAC,IAAI,CAAC;QAC5B,yBAAQ,CAAC,WAAW,CAAC,IAAI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BD,0CAqBC"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.OUTLINE_TREE_NODE_HEIGHT = exports.OutlineNode = 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 outline_node_module_less_1 = (0, tslib_1.__importDefault)(require("./outline-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 outline_node_define_1 = require("./outline-node.define");
|
|
11
|
+
const document_symbol_1 = require("@opensumi/ide-editor/lib/browser/breadcrumb/document-symbol");
|
|
12
|
+
const OutlineNode = ({ item, defaultLeftPadding = 8, leftPadding = 8, onClick, onTwistierClick, itemType, decorationService, decorations, }) => {
|
|
13
|
+
const decoration = outline_node_define_1.OutlineTreeNode.is(item) ? decorationService.getDecoration(item) : null;
|
|
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 handlerTwistierClick = (ev) => {
|
|
20
|
+
if (itemType === ide_components_1.TreeNodeType.TreeNode || itemType === ide_components_1.TreeNodeType.CompositeTreeNode) {
|
|
21
|
+
if (onTwistierClick) {
|
|
22
|
+
onTwistierClick(ev, item, itemType);
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
onClick(ev, item, itemType);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
const paddingLeft = `${defaultLeftPadding + (item.depth || 0) * (leftPadding || 0) + (!outline_node_define_1.OutlineCompositeTreeNode.is(item) ? 16 : 0)}px`;
|
|
30
|
+
const editorNodeStyle = {
|
|
31
|
+
color: decoration ? decoration.color : '',
|
|
32
|
+
height: exports.OUTLINE_TREE_NODE_HEIGHT,
|
|
33
|
+
lineHeight: `${exports.OUTLINE_TREE_NODE_HEIGHT}px`,
|
|
34
|
+
paddingLeft,
|
|
35
|
+
};
|
|
36
|
+
const renderIcon = (node) => {
|
|
37
|
+
return react_1.default.createElement("div", { className: (0, classnames_1.default)(outline_node_module_less_1.default.icon, node.icon), style: { height: exports.OUTLINE_TREE_NODE_HEIGHT, lineHeight: `${exports.OUTLINE_TREE_NODE_HEIGHT}px` } });
|
|
38
|
+
};
|
|
39
|
+
const getName = (node) => {
|
|
40
|
+
return node.displayName.replace(/\n/g, '↵');
|
|
41
|
+
};
|
|
42
|
+
const renderDisplayName = (node) => {
|
|
43
|
+
return react_1.default.createElement("div", { className: (0, classnames_1.default)(outline_node_module_less_1.default.outline_node_segment, outline_node_module_less_1.default.outline_node_display_name, { [outline_node_module_less_1.default.deprecated]: node.raw.tags && node.raw.tags.indexOf(document_symbol_1.SymbolTag.Deprecated) >= 0 }) }, getName(node));
|
|
44
|
+
};
|
|
45
|
+
const renderStatusTail = () => {
|
|
46
|
+
return react_1.default.createElement("div", { className: (0, classnames_1.default)(outline_node_module_less_1.default.outline_node_segment, outline_node_module_less_1.default.outline_node_tail) }, renderBadge());
|
|
47
|
+
};
|
|
48
|
+
const renderBadge = () => {
|
|
49
|
+
if (!decoration) {
|
|
50
|
+
return null;
|
|
51
|
+
}
|
|
52
|
+
return react_1.default.createElement("div", { className: outline_node_module_less_1.default.outline_node_status }, decoration.badge.slice());
|
|
53
|
+
};
|
|
54
|
+
const renderFolderToggle = (node, clickHandler) => {
|
|
55
|
+
return react_1.default.createElement("div", { onClick: clickHandler, className: (0, classnames_1.default)(outline_node_module_less_1.default.file_tree_node_segment, outline_node_module_less_1.default.expansion_toggle, (0, ide_core_browser_1.getIcon)('arrow-right'), { [`${outline_node_module_less_1.default.mod_collapsed}`]: !node.expanded }) });
|
|
56
|
+
};
|
|
57
|
+
const renderTwice = (item) => {
|
|
58
|
+
if (outline_node_define_1.OutlineCompositeTreeNode.is(item)) {
|
|
59
|
+
return renderFolderToggle(item, handlerTwistierClick);
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
const getItemTooltip = () => {
|
|
63
|
+
let tooltip = item.tooltip || item.name;
|
|
64
|
+
if (decoration && decoration.tooltip) {
|
|
65
|
+
tooltip += ` • ${decoration.tooltip}`;
|
|
66
|
+
}
|
|
67
|
+
return tooltip;
|
|
68
|
+
};
|
|
69
|
+
return (react_1.default.createElement("div", { key: item.id, onClick: handleClick, title: getItemTooltip(), className: (0, classnames_1.default)(outline_node_module_less_1.default.outline_node, decorations ? decorations.classlist : null), style: editorNodeStyle, "data-id": item.id },
|
|
70
|
+
react_1.default.createElement("div", { className: (0, classnames_1.default)(outline_node_module_less_1.default.outline_node_content) },
|
|
71
|
+
renderTwice(item),
|
|
72
|
+
renderIcon(item),
|
|
73
|
+
react_1.default.createElement("div", { className: outline_node_module_less_1.default.outline_node_overflow_wrap }, renderDisplayName(item)),
|
|
74
|
+
renderStatusTail())));
|
|
75
|
+
};
|
|
76
|
+
exports.OutlineNode = OutlineNode;
|
|
77
|
+
exports.OUTLINE_TREE_NODE_HEIGHT = 22;
|
|
78
|
+
//# sourceMappingURL=outline-node.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"outline-node.js","sourceRoot":"","sources":["../../src/browser/outline-node.tsx"],"names":[],"mappings":";;;;AAAA,+DAA0B;AAC1B,yEAA6B;AAC7B,uGAAgD;AAChD,6DAA6H;AAC7H,iEAA0E;AAC1E,+DAAkF;AAElF,iGAAwF;AAejF,MAAM,WAAW,GAAuC,CAAC,EAC9D,IAAI,EACJ,kBAAkB,GAAG,CAAC,EACtB,WAAW,GAAG,CAAC,EACf,OAAO,EACP,eAAe,EACf,QAAQ,EACR,iBAAiB,EACj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IAAI,CAAC,CACpB;YACL,gBAAgB,EAAE,CACf,CACF,CACP,CAAC;AACJ,CAAC,CAAC;AAvHW,QAAA,WAAW,eAuHtB;AAEW,QAAA,wBAAwB,GAAG,EAAE,CAAC"}
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
.outline_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
|
+
.outline_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, .outline_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, .outline_node_description {
|
|
34
|
+
color: var(--kt-tree-activeSelectionForeground) !important;;
|
|
35
|
+
}
|
|
36
|
+
.outline_node_display_name {
|
|
37
|
+
.compact_name {
|
|
38
|
+
&.active {
|
|
39
|
+
text-decoration: underline;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
&.mod_dirty {
|
|
46
|
+
&::before {
|
|
47
|
+
content: '';
|
|
48
|
+
display: block;
|
|
49
|
+
width: 8px;
|
|
50
|
+
height: 8px;
|
|
51
|
+
border-radius: 4px;
|
|
52
|
+
margin: 7px 5px;
|
|
53
|
+
background: var(--kt-dirtyDot-foreground);
|
|
54
|
+
position: absolute;
|
|
55
|
+
left: 18px;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.expansion_toggle {
|
|
61
|
+
min-width: 20px;
|
|
62
|
+
display: flex;
|
|
63
|
+
justify-content: center;
|
|
64
|
+
flex-shrink: 0;
|
|
65
|
+
font-size: 16px;
|
|
66
|
+
color: var(--foreground);
|
|
67
|
+
&.mod_collapsed {
|
|
68
|
+
&:before {
|
|
69
|
+
display: block;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
&:not(.mod_collapsed) {
|
|
74
|
+
&:before {
|
|
75
|
+
display: block;
|
|
76
|
+
transform: rotate(90deg);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.outline_node_description {
|
|
82
|
+
display: inline;
|
|
83
|
+
transform: scale(0.96);
|
|
84
|
+
color: var(--descriptionForeground);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.outline_node_content {
|
|
88
|
+
position: relative;
|
|
89
|
+
display: flex;
|
|
90
|
+
align-items: center;
|
|
91
|
+
width: 100%;
|
|
92
|
+
|
|
93
|
+
match {
|
|
94
|
+
background-color: var(--editor-findMatchHighlightBackground);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.outline_node_status {
|
|
99
|
+
opacity: .75;
|
|
100
|
+
text-align: center;
|
|
101
|
+
font-size: 12px;
|
|
102
|
+
padding-right: 0;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.outline_node_segment {
|
|
106
|
+
flex-grow: 0;
|
|
107
|
+
white-space: nowrap;
|
|
108
|
+
color: inherit;
|
|
109
|
+
&_grow {
|
|
110
|
+
flex-grow: 1 !important;
|
|
111
|
+
text-align: left;
|
|
112
|
+
z-index: 10;
|
|
113
|
+
padding-right: 5px;
|
|
114
|
+
|
|
115
|
+
&.overflow_visible {
|
|
116
|
+
overflow: visible !important;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
.deprecated {
|
|
121
|
+
text-decoration: line-through;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
.outline_node_display_name {
|
|
126
|
+
margin-right: 6px;
|
|
127
|
+
display: inline;
|
|
128
|
+
white-space:pre;
|
|
129
|
+
.compact_name {
|
|
130
|
+
color: inherit;
|
|
131
|
+
display: inline;
|
|
132
|
+
&:focus,
|
|
133
|
+
&:hover {
|
|
134
|
+
text-decoration: underline;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
.compact_name_separator {
|
|
138
|
+
margin: 0 2px;
|
|
139
|
+
opacity: .5;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
.outline_node_description {
|
|
144
|
+
display: inline;
|
|
145
|
+
transform: scale(0.96);
|
|
146
|
+
color: var(--descriptionForeground);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
.outline_node_overflow_wrap {
|
|
150
|
+
flex: 1;
|
|
151
|
+
flex-shrink: 0;
|
|
152
|
+
overflow: hidden;
|
|
153
|
+
text-overflow: ellipsis;
|
|
154
|
+
white-space: nowrap;
|
|
155
|
+
text-align: left;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
.outline_node_flex_wrap {
|
|
159
|
+
display: flex;
|
|
160
|
+
flex-direction: row;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
.outline_node_segment_grow {
|
|
164
|
+
flex-grow: 1 !important;
|
|
165
|
+
text-align: left;
|
|
166
|
+
z-index: 10;
|
|
167
|
+
padding-right: 5px;
|
|
168
|
+
|
|
169
|
+
&.overflow_visible {
|
|
170
|
+
overflow: visible !important;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
.icon {
|
|
175
|
+
position: relative;
|
|
176
|
+
color: var(--icon-foreground);
|
|
177
|
+
margin-right: 4px;
|
|
178
|
+
&:before {
|
|
179
|
+
font-size: 16px;
|
|
180
|
+
text-align: center;
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
.icon:global(&.fileIcon:before) {
|
|
185
|
+
font-size: 18px;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
.outline_node_tail {
|
|
189
|
+
text-align: center;
|
|
190
|
+
margin-right: 10px;
|
|
191
|
+
position: relative;
|
|
192
|
+
height: 22px;
|
|
193
|
+
display: flex;
|
|
194
|
+
align-items: center;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
.outline_action_bar {
|
|
198
|
+
position: absolute;
|
|
199
|
+
top: 0;
|
|
200
|
+
left: 0;
|
|
201
|
+
width: 100%;
|
|
202
|
+
display: flex;
|
|
203
|
+
display: none;
|
|
204
|
+
z-index: 10;
|
|
205
|
+
.action_icon {
|
|
206
|
+
margin-left: 6px;
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
.outline_left_actions {
|
|
211
|
+
position: absolute;
|
|
212
|
+
left: 14px;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
.outline_right_actions {
|
|
216
|
+
right: 0;
|
|
217
|
+
position: absolute;
|
|
218
|
+
margin-right: 10px;
|
|
219
|
+
}
|
|
220
|
+
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { TabBarToolbarContribution, ToolbarRegistry, CommandContribution, CommandRegistry, IContextKeyService } from '@opensumi/ide-core-browser';
|
|
2
|
+
import { MainLayoutContribution } from '@opensumi/ide-main-layout';
|
|
3
|
+
export declare class OutlineContribution implements MainLayoutContribution, TabBarToolbarContribution, CommandContribution {
|
|
4
|
+
private mainLayoutService;
|
|
5
|
+
private outlineTreeService;
|
|
6
|
+
private outlineTreeModelService;
|
|
7
|
+
contextKey: IContextKeyService;
|
|
8
|
+
onDidRender(): void;
|
|
9
|
+
registerCommands(registry: CommandRegistry): void;
|
|
10
|
+
registerToolbarItems(registry: ToolbarRegistry): void;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=outline.contribution.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"outline.contribution.d.ts","sourceRoot":"","sources":["../../src/browser/outline.contribution.ts"],"names":[],"mappings":"AACA,OAAO,EAAsC,yBAAyB,EAAE,eAAe,EAAE,mBAAmB,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAGtL,OAAO,EAAE,sBAAsB,EAAsB,MAAM,2BAA2B,CAAC;AAOvF,qBACa,mBAAoB,YAAW,sBAAsB,EAAE,yBAAyB,EAAE,mBAAmB;IAEhH,OAAO,CAAC,iBAAiB,CAAqB;IAG9C,OAAO,CAAC,kBAAkB,CAAqB;IAG/C,OAAO,CAAC,uBAAuB,CAAsB;IAGrD,UAAU,EAAE,kBAAkB,CAAC;IAE/B,WAAW;IASX,gBAAgB,CAAC,QAAQ,EAAE,eAAe;IA8C1C,oBAAoB,CAAC,QAAQ,EAAE,eAAe;CAqC/C"}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.OutlineContribution = 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 outline_1 = require("./outline");
|
|
8
|
+
const explorer_contribution_1 = require("@opensumi/ide-explorer/lib/browser/explorer-contribution");
|
|
9
|
+
const ide_main_layout_1 = require("@opensumi/ide-main-layout");
|
|
10
|
+
const ide_core_browser_2 = require("@opensumi/ide-core-browser");
|
|
11
|
+
const contextkey_1 = require("@opensumi/ide-core-browser/lib/contextkey");
|
|
12
|
+
const outline_tree_service_1 = require("./services/outline-tree.service");
|
|
13
|
+
const outline_model_service_1 = require("./services/outline-model.service");
|
|
14
|
+
let OutlineContribution = class OutlineContribution {
|
|
15
|
+
onDidRender() {
|
|
16
|
+
this.mainLayoutService.collectViewComponent({
|
|
17
|
+
component: outline_1.OutlinePanel,
|
|
18
|
+
collapsed: true,
|
|
19
|
+
id: 'outline-view',
|
|
20
|
+
name: (0, ide_core_browser_1.localize)('outline.title'),
|
|
21
|
+
}, explorer_contribution_1.ExplorerContainerId);
|
|
22
|
+
}
|
|
23
|
+
registerCommands(registry) {
|
|
24
|
+
registry.registerCommand({
|
|
25
|
+
id: ide_core_browser_1.OUTLINE_COMMANDS.OUTLINE_COLLAPSE_ALL.id,
|
|
26
|
+
iconClass: (0, ide_core_browser_2.getIcon)('collapse-all'),
|
|
27
|
+
label: (0, ide_core_browser_1.localize)('outline.collapse.all'),
|
|
28
|
+
}, {
|
|
29
|
+
execute: () => {
|
|
30
|
+
this.outlineTreeModelService.collapseAll();
|
|
31
|
+
},
|
|
32
|
+
});
|
|
33
|
+
registry.registerCommand({
|
|
34
|
+
id: ide_core_browser_1.OUTLINE_COMMANDS.OUTLINE_FOLLOW_CURSOR.id,
|
|
35
|
+
iconClass: (0, ide_core_browser_2.getIcon)('follow-cursor'),
|
|
36
|
+
toogleIconClass: (0, ide_core_browser_2.getIcon)('follow-cursor', { fill: true }),
|
|
37
|
+
label: (0, ide_core_browser_1.localize)('outline.follow.cursor'),
|
|
38
|
+
}, {
|
|
39
|
+
execute: () => {
|
|
40
|
+
this.outlineTreeService.followCursor = !this.outlineTreeService.followCursor;
|
|
41
|
+
},
|
|
42
|
+
});
|
|
43
|
+
registry.registerCommand({
|
|
44
|
+
id: ide_core_browser_1.OUTLINE_COMMANDS.OUTLINE_SORT_KIND.id,
|
|
45
|
+
label: (0, ide_core_browser_1.localize)('outline.sort.kind'),
|
|
46
|
+
}, {
|
|
47
|
+
execute: () => {
|
|
48
|
+
this.outlineTreeService.sortType = 2 /* ByKind */;
|
|
49
|
+
},
|
|
50
|
+
});
|
|
51
|
+
registry.registerCommand({
|
|
52
|
+
id: ide_core_browser_1.OUTLINE_COMMANDS.OUTLINE_SORT_NAME.id,
|
|
53
|
+
label: (0, ide_core_browser_1.localize)('outline.sort.name'),
|
|
54
|
+
}, {
|
|
55
|
+
execute: () => {
|
|
56
|
+
this.outlineTreeService.sortType = 1 /* ByName */;
|
|
57
|
+
},
|
|
58
|
+
});
|
|
59
|
+
registry.registerCommand({
|
|
60
|
+
id: ide_core_browser_1.OUTLINE_COMMANDS.OUTLINE_SORT_POSITION.id,
|
|
61
|
+
label: (0, ide_core_browser_1.localize)('outline.sort.position'),
|
|
62
|
+
}, {
|
|
63
|
+
execute: () => {
|
|
64
|
+
this.outlineTreeService.sortType = 0 /* ByPosition */;
|
|
65
|
+
},
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
registerToolbarItems(registry) {
|
|
69
|
+
registry.registerItem({
|
|
70
|
+
id: 'outline.action.follow.cursor',
|
|
71
|
+
viewId: 'outline-view',
|
|
72
|
+
command: ide_core_browser_1.OUTLINE_COMMANDS.OUTLINE_FOLLOW_CURSOR.id,
|
|
73
|
+
label: (0, ide_core_browser_1.localize)('outline.follow.cursor'),
|
|
74
|
+
toggledWhen: contextkey_1.OutlineFollowCursorContext.raw,
|
|
75
|
+
});
|
|
76
|
+
registry.registerItem({
|
|
77
|
+
id: 'outline.action.collapse.all',
|
|
78
|
+
viewId: 'outline-view',
|
|
79
|
+
command: ide_core_browser_1.OUTLINE_COMMANDS.OUTLINE_COLLAPSE_ALL.id,
|
|
80
|
+
label: (0, ide_core_browser_1.localize)('outline.collapse.all'),
|
|
81
|
+
});
|
|
82
|
+
registry.registerItem({
|
|
83
|
+
id: 'outline.menu.sort.kind',
|
|
84
|
+
viewId: 'outline-view',
|
|
85
|
+
command: ide_core_browser_1.OUTLINE_COMMANDS.OUTLINE_SORT_KIND.id,
|
|
86
|
+
group: 'inline',
|
|
87
|
+
toggledWhen: `${contextkey_1.OutlineSortTypeContext.raw} == ${2 /* ByKind */}`,
|
|
88
|
+
});
|
|
89
|
+
registry.registerItem({
|
|
90
|
+
id: 'outline.menu.sort.name',
|
|
91
|
+
viewId: 'outline-view',
|
|
92
|
+
command: ide_core_browser_1.OUTLINE_COMMANDS.OUTLINE_SORT_NAME.id,
|
|
93
|
+
group: 'inline',
|
|
94
|
+
toggledWhen: `${contextkey_1.OutlineSortTypeContext.raw} == ${1 /* ByName */}`,
|
|
95
|
+
});
|
|
96
|
+
registry.registerItem({
|
|
97
|
+
id: 'outline.menu.sort.position',
|
|
98
|
+
viewId: 'outline-view',
|
|
99
|
+
command: ide_core_browser_1.OUTLINE_COMMANDS.OUTLINE_SORT_POSITION.id,
|
|
100
|
+
group: 'inline',
|
|
101
|
+
toggledWhen: `${contextkey_1.OutlineSortTypeContext.raw} == ${0 /* ByPosition */}`,
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
(0, tslib_1.__decorate)([
|
|
106
|
+
(0, di_1.Autowired)(ide_main_layout_1.IMainLayoutService),
|
|
107
|
+
(0, tslib_1.__metadata)("design:type", Object)
|
|
108
|
+
], OutlineContribution.prototype, "mainLayoutService", void 0);
|
|
109
|
+
(0, tslib_1.__decorate)([
|
|
110
|
+
(0, di_1.Autowired)(),
|
|
111
|
+
(0, tslib_1.__metadata)("design:type", outline_tree_service_1.OutlineTreeService)
|
|
112
|
+
], OutlineContribution.prototype, "outlineTreeService", void 0);
|
|
113
|
+
(0, tslib_1.__decorate)([
|
|
114
|
+
(0, di_1.Autowired)(),
|
|
115
|
+
(0, tslib_1.__metadata)("design:type", outline_model_service_1.OutlineModelService)
|
|
116
|
+
], OutlineContribution.prototype, "outlineTreeModelService", void 0);
|
|
117
|
+
(0, tslib_1.__decorate)([
|
|
118
|
+
(0, di_1.Autowired)(ide_core_browser_1.IContextKeyService),
|
|
119
|
+
(0, tslib_1.__metadata)("design:type", Object)
|
|
120
|
+
], OutlineContribution.prototype, "contextKey", void 0);
|
|
121
|
+
OutlineContribution = (0, tslib_1.__decorate)([
|
|
122
|
+
(0, ide_core_browser_1.Domain)(ide_main_layout_1.MainLayoutContribution, ide_core_browser_1.TabBarToolbarContribution, ide_core_browser_1.CommandContribution)
|
|
123
|
+
], OutlineContribution);
|
|
124
|
+
exports.OutlineContribution = OutlineContribution;
|
|
125
|
+
//# sourceMappingURL=outline.contribution.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"outline.contribution.js","sourceRoot":"","sources":["../../src/browser/outline.contribution.ts"],"names":[],"mappings":";;;;AAAA,qCAAyC;AACzC,iEAAsL;AACtL,uCAAyC;AACzC,oGAA+F;AAC/F,+DAAuF;AACvF,iEAAqD;AACrD,0EAA+G;AAC/G,0EAAqE;AACrE,4EAAuE;AAIvE,IAAa,mBAAmB,GAAhC,MAAa,mBAAmB;IAa9B,WAAW;QACT,IAAI,CAAC,iBAAiB,CAAC,oBAAoB,CAAC;YAC1C,SAAS,EAAE,sBAAY;YACvB,SAAS,EAAE,IAAI;YACf,EAAE,EAAE,cAAc;YAClB,IAAI,EAAE,IAAA,2BAAQ,EAAC,eAAe,CAAC;SAChC,EAAE,2CAAmB,CAAC,CAAC;IAC1B,CAAC;IAED,gBAAgB,CAAC,QAAyB;QACxC,QAAQ,CAAC,eAAe,CAAC;YACvB,EAAE,EAAE,mCAAgB,CAAC,oBAAoB,CAAC,EAAE;YAC5C,SAAS,EAAE,IAAA,0BAAO,EAAC,cAAc,CAAC;YAClC,KAAK,EAAE,IAAA,2BAAQ,EAAC,sBAAsB,CAAC;SACxC,EAAE;YACD,OAAO,EAAE,GAAG,EAAE;gBACZ,IAAI,CAAC,uBAAuB,CAAC,WAAW,EAAE,CAAC;YAC7C,CAAC;SACF,CAAC,CAAC;QACH,QAAQ,CAAC,eAAe,CAAC;YACvB,E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