@opensumi/ide-outline 1.1.4-next-1641353261.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- 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 +72 -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 +77 -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 +62 -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 +511 -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 +148 -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
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2019-present Alibaba Group Holding Limited, Ant Technology Group.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -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,EACL,QAAQ,EACR,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,EAClB,YAAY,EACb,MAAM,0BAA0B,CAAC;AAClC,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,CACf,EAAE,EAAE,KAAK,CAAC,UAAU,EACpB,IAAI,EAAE,QAAQ,GAAG,iBAAiB,EAClC,IAAI,EAAE,YAAY,EAClB,SAAS,CAAC,EAAE,GAAG,KACZ,IAAI,CAAC;CACX;AAED,oBAAY,wBAAwB,GAAG,iBAAiB,GAAG,kBAAkB,CAAC;AAE9E,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,wBAAwB,CA6G1D,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;IAChD,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,wBAAwB,GAAG,WAAW,GAAG,IAAI,IAAI,WAAW;IAI5E,OAAO,CAAC,WAAW,CAAiB;gBAExB,IAAI,EAAE,kBAAkB,EAAE,UAAU,EAAE,SAAS,CAAC,GAAG,CAAC;IAKhE,IAAI,UAAU,mBAEb;IAED,IAAI,QAAQ,YAEX;CACF;AAGD,qBAAa,wBAAyB,SAAQ,iBAAiB;aAY3C,GAAG,EAAE,yBAAyB;aAC9B,IAAI,EAAE,MAAM;IAZ9B,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,wBAAwB,GAAG,eAAe,GAAG,IAAI,IAAI,wBAAwB;IAM7F,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;aAQzB,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":"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AAA,MAAC,IAAiC,CAAC,GAAG,CAAC,QAAQ,0CAAE,MAAM,CAAA,CAChH,CAAC;IACJ,CAAC;IAiBD,IAAI,WAAW;QACb,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC;IACvB,CAAC;IAED,IAAI,SAAS;QACX,OAAO,IAAI,CAAC,UAAU,CAAC;IACzB,CAAC;CACF;AA7BD,4DA6BC;AAED,MAAa,eAAgB,SAAQ,yBAAQ;IAK3C,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,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IACnD,CAAC;IAdD,MAAM,CAAC,EAAE,CAAC,IAAqB;QAC7B,OAAO,CAAC,CAAC,IAAI,IAAI,CAAC,CAAE,IAAwB,CAAC,GAAG,CAAC;IACnD,CAAC;IAcD,IAAI,WAAW;QACb,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC;IACvB,CAAC;CACF;AApBD,0CAoBC"}
|
|
@@ -0,0 +1,72 @@
|
|
|
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) => (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` } }));
|
|
37
|
+
const getName = (node) => node.displayName.replace(/\n/g, '↵');
|
|
38
|
+
const renderDisplayName = (node) => (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, {
|
|
39
|
+
[outline_node_module_less_1.default.deprecated]: node.raw.tags && node.raw.tags.indexOf(document_symbol_1.SymbolTag.Deprecated) >= 0,
|
|
40
|
+
}) }, getName(node)));
|
|
41
|
+
const renderStatusTail = () => (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()));
|
|
42
|
+
const renderBadge = () => {
|
|
43
|
+
if (!decoration) {
|
|
44
|
+
return null;
|
|
45
|
+
}
|
|
46
|
+
return react_1.default.createElement("div", { className: outline_node_module_less_1.default.outline_node_status }, decoration.badge.slice());
|
|
47
|
+
};
|
|
48
|
+
const renderFolderToggle = (node, clickHandler) => (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'), {
|
|
49
|
+
[`${outline_node_module_less_1.default.mod_collapsed}`]: !node.expanded,
|
|
50
|
+
}) }));
|
|
51
|
+
const renderTwice = (item) => {
|
|
52
|
+
if (outline_node_define_1.OutlineCompositeTreeNode.is(item)) {
|
|
53
|
+
return renderFolderToggle(item, handlerTwistierClick);
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
const getItemTooltip = () => {
|
|
57
|
+
let tooltip = item.tooltip || item.name;
|
|
58
|
+
if (decoration && decoration.tooltip) {
|
|
59
|
+
tooltip += ` • ${decoration.tooltip}`;
|
|
60
|
+
}
|
|
61
|
+
return tooltip;
|
|
62
|
+
};
|
|
63
|
+
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 },
|
|
64
|
+
react_1.default.createElement("div", { className: (0, classnames_1.default)(outline_node_module_less_1.default.outline_node_content) },
|
|
65
|
+
renderTwice(item),
|
|
66
|
+
renderIcon(item),
|
|
67
|
+
react_1.default.createElement("div", { className: outline_node_module_less_1.default.outline_node_overflow_wrap }, renderDisplayName(item)),
|
|
68
|
+
renderStatusTail())));
|
|
69
|
+
};
|
|
70
|
+
exports.OutlineNode = OutlineNode;
|
|
71
|
+
exports.OUTLINE_TREE_NODE_HEIGHT = 22;
|
|
72
|
+
//# 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,6DAMkC;AAClC,iEAA0E;AAC1E,+DAAkF;AAElF,iGAAwF;AAoBjF,MAAM,WAAW,GAAuC,CAAC,EAC9D,IAAI,EACJ,kBAAkB,GAAG,CAAC,EACtB,WAAW,GAAG,CAAC,EACf,OAAO,EACP,eAAe,EACf,QAAQ,EACR,iBAAiB,EACjB,WAAW,GACc,EAAE,EAAE;IAC7B,MAAM,UAAU,GAAG,qCAAe,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,iBAAiB,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IAE3F,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,IAAuB,EAAE,Q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,oBAAoB,CAAC,CAAC;SACvD;IACH,CAAC,CAAC;IAEF,MAAM,cAAc,GAAG,GAAG,EAAE;QAC1B,IAAI,OAAO,GAAG,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,IAAI,CAAC;QACxC,IAAI,UAAU,IAAI,UAAU,CAAC,OAAO,EAAE;YACpC,OAAO,IAAI,MAAM,UAAU,CAAC,OAAO,EAAE,CAAC;SACvC;QACD,OAAO,OAAO,CAAC;IACjB,CAAC,CAAC;IAEF,OAAO,CACL,uCACE,GAAG,EAAE,IAAI,CAAC,EAAE,EACZ,OAAO,EAAE,WAAW,EACpB,KAAK,EAAE,cAAc,EAAE,EACvB,SAAS,EAAE,IAAA,oBAAG,EAAC,kCAAM,CAAC,YAAY,EAAE,WAAW,CAAC,CAAC,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,EAC/E,KAAK,EAAE,eAAe,aACb,IAAI,CAAC,EAAE;QAEhB,uCAAK,SAAS,EAAE,IAAA,oBAAG,EAAC,kCAAM,CAAC,oBAAoB,CAAC;YAC7C,WAAW,CAAC,IAAI,CAAC;YACjB,UAAU,CAAC,IAAI,CAAC;YACjB,uCAAK,SAAS,EAAE,kCAAM,CAAC,0BAA0B,IAAG,iBAAiB,CAAC,IAAI,CAAC,CAAO;YACjF,gBAAgB,EAAE,CACf,CACF,CACP,CAAC;AACJ,CAAC,CAAC;AA7GW,QAAA,WAAW,eA6GtB;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,
|
|
24
|
+
.outline_node_description {
|
|
25
|
+
color: var(--kt-tree-inactiveSelectionForeground) !important;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
&.mod_focused {
|
|
30
|
+
outline: 1px solid var(--list-focusOutline);
|
|
31
|
+
outline-offset: -1px;
|
|
32
|
+
color: var(--kt-tree-activeSelectionForeground) !important;
|
|
33
|
+
background: var(--kt-tree-activeSelectionBackground);
|
|
34
|
+
.expansion_toggle,
|
|
35
|
+
.outline_node_description {
|
|
36
|
+
color: var(--kt-tree-activeSelectionForeground) !important;
|
|
37
|
+
}
|
|
38
|
+
.outline_node_display_name {
|
|
39
|
+
.compact_name {
|
|
40
|
+
&.active {
|
|
41
|
+
text-decoration: underline;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
&.mod_dirty {
|
|
48
|
+
&::before {
|
|
49
|
+
content: '';
|
|
50
|
+
display: block;
|
|
51
|
+
width: 8px;
|
|
52
|
+
height: 8px;
|
|
53
|
+
border-radius: 4px;
|
|
54
|
+
margin: 7px 5px;
|
|
55
|
+
background: var(--kt-dirtyDot-foreground);
|
|
56
|
+
position: absolute;
|
|
57
|
+
left: 18px;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.expansion_toggle {
|
|
63
|
+
min-width: 20px;
|
|
64
|
+
display: flex;
|
|
65
|
+
justify-content: center;
|
|
66
|
+
flex-shrink: 0;
|
|
67
|
+
font-size: 16px;
|
|
68
|
+
color: var(--foreground);
|
|
69
|
+
&.mod_collapsed {
|
|
70
|
+
&:before {
|
|
71
|
+
display: block;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
&:not(.mod_collapsed) {
|
|
76
|
+
&:before {
|
|
77
|
+
display: block;
|
|
78
|
+
transform: rotate(90deg);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.outline_node_description {
|
|
84
|
+
display: inline;
|
|
85
|
+
transform: scale(0.96);
|
|
86
|
+
color: var(--descriptionForeground);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.outline_node_content {
|
|
90
|
+
position: relative;
|
|
91
|
+
display: flex;
|
|
92
|
+
align-items: center;
|
|
93
|
+
width: 100%;
|
|
94
|
+
|
|
95
|
+
match {
|
|
96
|
+
background-color: var(--editor-findMatchHighlightBackground);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.outline_node_status {
|
|
101
|
+
opacity: 0.75;
|
|
102
|
+
text-align: center;
|
|
103
|
+
font-size: 12px;
|
|
104
|
+
padding-right: 0;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.outline_node_segment {
|
|
108
|
+
flex-grow: 0;
|
|
109
|
+
white-space: nowrap;
|
|
110
|
+
color: inherit;
|
|
111
|
+
&_grow {
|
|
112
|
+
flex-grow: 1 !important;
|
|
113
|
+
text-align: left;
|
|
114
|
+
z-index: 10;
|
|
115
|
+
padding-right: 5px;
|
|
116
|
+
|
|
117
|
+
&.overflow_visible {
|
|
118
|
+
overflow: visible !important;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
.deprecated {
|
|
123
|
+
text-decoration: line-through;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.outline_node_display_name {
|
|
127
|
+
margin-right: 6px;
|
|
128
|
+
display: inline;
|
|
129
|
+
white-space: pre;
|
|
130
|
+
.compact_name {
|
|
131
|
+
color: inherit;
|
|
132
|
+
display: inline;
|
|
133
|
+
&:focus,
|
|
134
|
+
&:hover {
|
|
135
|
+
text-decoration: underline;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
.compact_name_separator {
|
|
139
|
+
margin: 0 2px;
|
|
140
|
+
opacity: 0.5;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.outline_node_description {
|
|
145
|
+
display: inline;
|
|
146
|
+
transform: scale(0.96);
|
|
147
|
+
color: var(--descriptionForeground);
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
.outline_node_overflow_wrap {
|
|
151
|
+
flex: 1;
|
|
152
|
+
flex-shrink: 0;
|
|
153
|
+
overflow: hidden;
|
|
154
|
+
text-overflow: ellipsis;
|
|
155
|
+
white-space: nowrap;
|
|
156
|
+
text-align: left;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
.outline_node_flex_wrap {
|
|
160
|
+
display: flex;
|
|
161
|
+
flex-direction: row;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
.outline_node_segment_grow {
|
|
165
|
+
flex-grow: 1 !important;
|
|
166
|
+
text-align: left;
|
|
167
|
+
z-index: 10;
|
|
168
|
+
padding-right: 5px;
|
|
169
|
+
|
|
170
|
+
&.overflow_visible {
|
|
171
|
+
overflow: visible !important;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
.icon {
|
|
176
|
+
position: relative;
|
|
177
|
+
color: var(--icon-foreground);
|
|
178
|
+
margin-right: 4px;
|
|
179
|
+
&:before {
|
|
180
|
+
font-size: 16px;
|
|
181
|
+
text-align: center;
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
.icon:global(&.fileIcon:before) {
|
|
186
|
+
font-size: 18px;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
.outline_node_tail {
|
|
190
|
+
text-align: center;
|
|
191
|
+
margin-right: 10px;
|
|
192
|
+
position: relative;
|
|
193
|
+
height: 22px;
|
|
194
|
+
display: flex;
|
|
195
|
+
align-items: center;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
.outline_action_bar {
|
|
199
|
+
position: absolute;
|
|
200
|
+
top: 0;
|
|
201
|
+
left: 0;
|
|
202
|
+
width: 100%;
|
|
203
|
+
display: flex;
|
|
204
|
+
display: none;
|
|
205
|
+
z-index: 10;
|
|
206
|
+
.action_icon {
|
|
207
|
+
margin-left: 6px;
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
.outline_left_actions {
|
|
212
|
+
position: absolute;
|
|
213
|
+
left: 14px;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
.outline_right_actions {
|
|
217
|
+
right: 0;
|
|
218
|
+
position: absolute;
|
|
219
|
+
margin-right: 10px;
|
|
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,EAIL,yBAAyB,EACzB,eAAe,EACf,mBAAmB,EACnB,eAAe,EACf,kBAAkB,EACnB,MAAM,4BAA4B,CAAC;AAGpC,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;IAYX,gBAAgB,CAAC,QAAQ,EAAE,eAAe;IA6D1C,oBAAoB,CAAC,QAAQ,EAAE,eAAe;CAoC/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.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