@theia/outline-view 1.48.1 → 1.48.2

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 (29) hide show
  1. package/README.md +30 -30
  2. package/lib/browser/index.d.ts +2 -2
  3. package/lib/browser/index.js +20 -20
  4. package/lib/browser/outline-breadcrumbs-contribution.d.ts +57 -57
  5. package/lib/browser/outline-breadcrumbs-contribution.js +214 -214
  6. package/lib/browser/outline-decorator-service.d.ts +13 -13
  7. package/lib/browser/outline-decorator-service.js +42 -42
  8. package/lib/browser/outline-view-contribution.d.ts +36 -36
  9. package/lib/browser/outline-view-contribution.js +125 -125
  10. package/lib/browser/outline-view-frontend-module.d.ts +4 -4
  11. package/lib/browser/outline-view-frontend-module.js +68 -68
  12. package/lib/browser/outline-view-service.d.ts +26 -26
  13. package/lib/browser/outline-view-service.js +78 -78
  14. package/lib/browser/outline-view-tree-model.d.ts +19 -19
  15. package/lib/browser/outline-view-tree-model.js +76 -76
  16. package/lib/browser/outline-view-widget.d.ts +76 -76
  17. package/lib/browser/outline-view-widget.js +184 -184
  18. package/lib/package.spec.js +25 -25
  19. package/package.json +4 -4
  20. package/src/browser/index.ts +18 -18
  21. package/src/browser/outline-breadcrumbs-contribution.tsx +229 -229
  22. package/src/browser/outline-decorator-service.ts +36 -36
  23. package/src/browser/outline-view-contribution.ts +132 -132
  24. package/src/browser/outline-view-frontend-module.ts +84 -84
  25. package/src/browser/outline-view-service.ts +82 -82
  26. package/src/browser/outline-view-tree-model.ts +77 -77
  27. package/src/browser/outline-view-widget.tsx +212 -212
  28. package/src/browser/styles/index.css +24 -24
  29. package/src/package.spec.ts +28 -28
@@ -1,20 +1,20 @@
1
- import { CompositeTreeNode, TreeModelImpl, ExpandableTreeNode, TreeNode } from '@theia/core/lib/browser';
2
- export declare class OutlineViewTreeModel extends TreeModelImpl {
3
- /**
4
- * Handle the expansion of the tree node.
5
- * - The method is a no-op in order to preserve focus on the editor
6
- * after attempting to perform a `collapse-all`.
7
- * @param node the expandable tree node.
8
- */
9
- protected handleExpansion(node: Readonly<ExpandableTreeNode>): void;
10
- collapseAll(raw?: Readonly<CompositeTreeNode>): Promise<boolean>;
11
- /**
12
- * The default behavior of `openNode` calls `doOpenNode` which by default
13
- * toggles the expansion of the node. Overriding to prevent expansion, but
14
- * allow for the `onOpenNode` event to still fire on a double-click event.
15
- */
16
- openNode(raw?: TreeNode | undefined): void;
17
- expandAll(raw?: TreeNode): void;
18
- areNodesCollapsed(): boolean;
19
- }
1
+ import { CompositeTreeNode, TreeModelImpl, ExpandableTreeNode, TreeNode } from '@theia/core/lib/browser';
2
+ export declare class OutlineViewTreeModel extends TreeModelImpl {
3
+ /**
4
+ * Handle the expansion of the tree node.
5
+ * - The method is a no-op in order to preserve focus on the editor
6
+ * after attempting to perform a `collapse-all`.
7
+ * @param node the expandable tree node.
8
+ */
9
+ protected handleExpansion(node: Readonly<ExpandableTreeNode>): void;
10
+ collapseAll(raw?: Readonly<CompositeTreeNode>): Promise<boolean>;
11
+ /**
12
+ * The default behavior of `openNode` calls `doOpenNode` which by default
13
+ * toggles the expansion of the node. Overriding to prevent expansion, but
14
+ * allow for the `onOpenNode` event to still fire on a double-click event.
15
+ */
16
+ openNode(raw?: TreeNode | undefined): void;
17
+ expandAll(raw?: TreeNode): void;
18
+ areNodesCollapsed(): boolean;
19
+ }
20
20
  //# sourceMappingURL=outline-view-tree-model.d.ts.map
@@ -1,77 +1,77 @@
1
- "use strict";
2
- // *****************************************************************************
3
- // Copyright (C) 2019 Ericsson and others.
4
- //
5
- // This program and the accompanying materials are made available under the
6
- // terms of the Eclipse Public License v. 2.0 which is available at
7
- // http://www.eclipse.org/legal/epl-2.0.
8
- //
9
- // This Source Code may also be made available under the following Secondary
10
- // Licenses when the conditions for such availability set forth in the Eclipse
11
- // Public License v. 2.0 are satisfied: GNU General Public License, version 2
12
- // with the GNU Classpath Exception which is available at
13
- // https://www.gnu.org/software/classpath/license.html.
14
- //
15
- // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
16
- // *****************************************************************************
17
- Object.defineProperty(exports, "__esModule", { value: true });
18
- exports.OutlineViewTreeModel = void 0;
19
- const tslib_1 = require("tslib");
20
- const inversify_1 = require("@theia/core/shared/inversify");
21
- const browser_1 = require("@theia/core/lib/browser");
22
- let OutlineViewTreeModel = class OutlineViewTreeModel extends browser_1.TreeModelImpl {
23
- /**
24
- * Handle the expansion of the tree node.
25
- * - The method is a no-op in order to preserve focus on the editor
26
- * after attempting to perform a `collapse-all`.
27
- * @param node the expandable tree node.
28
- */
29
- handleExpansion(node) {
30
- // no-op
31
- }
32
- async collapseAll(raw) {
33
- const node = raw || this.getFocusedNode();
34
- if (browser_1.CompositeTreeNode.is(node)) {
35
- return this.expansionService.collapseAll(node);
36
- }
37
- return false;
38
- }
39
- /**
40
- * The default behavior of `openNode` calls `doOpenNode` which by default
41
- * toggles the expansion of the node. Overriding to prevent expansion, but
42
- * allow for the `onOpenNode` event to still fire on a double-click event.
43
- */
44
- openNode(raw) {
45
- const node = raw || this.getFocusedNode();
46
- if (node) {
47
- this.onOpenNodeEmitter.fire(node);
48
- }
49
- }
50
- expandAll(raw) {
51
- if (browser_1.CompositeTreeNode.is(raw)) {
52
- for (const child of raw.children) {
53
- if (browser_1.ExpandableTreeNode.is(child)) {
54
- this.expandAll(child);
55
- }
56
- }
57
- }
58
- if (browser_1.ExpandableTreeNode.is(raw)) {
59
- this.expandNode(raw);
60
- }
61
- }
62
- areNodesCollapsed() {
63
- if (browser_1.CompositeTreeNode.is(this.root)) {
64
- for (const child of this.root.children) {
65
- if (!browser_1.ExpandableTreeNode.isCollapsed(child)) {
66
- return false;
67
- }
68
- }
69
- }
70
- return true;
71
- }
72
- };
73
- OutlineViewTreeModel = (0, tslib_1.__decorate)([
74
- (0, inversify_1.injectable)()
75
- ], OutlineViewTreeModel);
76
- exports.OutlineViewTreeModel = OutlineViewTreeModel;
1
+ "use strict";
2
+ // *****************************************************************************
3
+ // Copyright (C) 2019 Ericsson and others.
4
+ //
5
+ // This program and the accompanying materials are made available under the
6
+ // terms of the Eclipse Public License v. 2.0 which is available at
7
+ // http://www.eclipse.org/legal/epl-2.0.
8
+ //
9
+ // This Source Code may also be made available under the following Secondary
10
+ // Licenses when the conditions for such availability set forth in the Eclipse
11
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
12
+ // with the GNU Classpath Exception which is available at
13
+ // https://www.gnu.org/software/classpath/license.html.
14
+ //
15
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
16
+ // *****************************************************************************
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.OutlineViewTreeModel = void 0;
19
+ const tslib_1 = require("tslib");
20
+ const inversify_1 = require("@theia/core/shared/inversify");
21
+ const browser_1 = require("@theia/core/lib/browser");
22
+ let OutlineViewTreeModel = class OutlineViewTreeModel extends browser_1.TreeModelImpl {
23
+ /**
24
+ * Handle the expansion of the tree node.
25
+ * - The method is a no-op in order to preserve focus on the editor
26
+ * after attempting to perform a `collapse-all`.
27
+ * @param node the expandable tree node.
28
+ */
29
+ handleExpansion(node) {
30
+ // no-op
31
+ }
32
+ async collapseAll(raw) {
33
+ const node = raw || this.getFocusedNode();
34
+ if (browser_1.CompositeTreeNode.is(node)) {
35
+ return this.expansionService.collapseAll(node);
36
+ }
37
+ return false;
38
+ }
39
+ /**
40
+ * The default behavior of `openNode` calls `doOpenNode` which by default
41
+ * toggles the expansion of the node. Overriding to prevent expansion, but
42
+ * allow for the `onOpenNode` event to still fire on a double-click event.
43
+ */
44
+ openNode(raw) {
45
+ const node = raw || this.getFocusedNode();
46
+ if (node) {
47
+ this.onOpenNodeEmitter.fire(node);
48
+ }
49
+ }
50
+ expandAll(raw) {
51
+ if (browser_1.CompositeTreeNode.is(raw)) {
52
+ for (const child of raw.children) {
53
+ if (browser_1.ExpandableTreeNode.is(child)) {
54
+ this.expandAll(child);
55
+ }
56
+ }
57
+ }
58
+ if (browser_1.ExpandableTreeNode.is(raw)) {
59
+ this.expandNode(raw);
60
+ }
61
+ }
62
+ areNodesCollapsed() {
63
+ if (browser_1.CompositeTreeNode.is(this.root)) {
64
+ for (const child of this.root.children) {
65
+ if (!browser_1.ExpandableTreeNode.isCollapsed(child)) {
66
+ return false;
67
+ }
68
+ }
69
+ }
70
+ return true;
71
+ }
72
+ };
73
+ OutlineViewTreeModel = (0, tslib_1.__decorate)([
74
+ (0, inversify_1.injectable)()
75
+ ], OutlineViewTreeModel);
76
+ exports.OutlineViewTreeModel = OutlineViewTreeModel;
77
77
  //# sourceMappingURL=outline-view-tree-model.js.map
@@ -1,77 +1,77 @@
1
- /// <reference types="react" />
2
- import { TreeWidget, TreeNode, NodeProps, SelectableTreeNode, CompositeTreeNode, TreeProps, ContextMenuRenderer, TreeModel, ExpandableTreeNode } from '@theia/core/lib/browser';
3
- import { OutlineViewTreeModel } from './outline-view-tree-model';
4
- import { Message } from '@theia/core/shared/@phosphor/messaging';
5
- import { Emitter, Event } from '@theia/core';
6
- import * as React from '@theia/core/shared/react';
7
- import { Range } from '@theia/core/shared/vscode-languageserver-protocol';
8
- /**
9
- * Representation of an outline symbol information node.
10
- */
11
- export interface OutlineSymbolInformationNode extends CompositeTreeNode, SelectableTreeNode, ExpandableTreeNode {
12
- /**
13
- * The `iconClass` for the given tree node.
14
- */
15
- iconClass: string;
16
- }
17
- /**
18
- * Collection of outline symbol information node functions.
19
- */
20
- export declare namespace OutlineSymbolInformationNode {
21
- /**
22
- * Determine if the given tree node is an `OutlineSymbolInformationNode`.
23
- * - The tree node is an `OutlineSymbolInformationNode` if:
24
- * - The node exists.
25
- * - The node is selectable.
26
- * - The node contains a defined `iconClass` property.
27
- * @param node the tree node.
28
- *
29
- * @returns `true` if the given node is an `OutlineSymbolInformationNode`.
30
- */
31
- function is(node: TreeNode): node is OutlineSymbolInformationNode;
32
- function hasRange(node: unknown): node is {
33
- range: Range;
34
- };
35
- }
36
- export declare type OutlineViewWidgetFactory = () => OutlineViewWidget;
37
- export declare const OutlineViewWidgetFactory: unique symbol;
38
- export declare class OutlineViewWidget extends TreeWidget {
39
- readonly model: OutlineViewTreeModel;
40
- static LABEL: string;
41
- readonly onDidChangeOpenStateEmitter: Emitter<boolean>;
42
- protected readonly onDidUpdateEmitter: Emitter<void>;
43
- readonly onDidUpdate: Event<void>;
44
- constructor(treeProps: TreeProps, model: OutlineViewTreeModel, contextMenuRenderer: ContextMenuRenderer);
45
- protected init(): void;
46
- /**
47
- * Set the outline tree with the list of `OutlineSymbolInformationNode`.
48
- * @param roots the list of `OutlineSymbolInformationNode`.
49
- */
50
- setOutlineTree(roots: OutlineSymbolInformationNode[]): void;
51
- protected getRoot(children: TreeNode[]): CompositeTreeNode;
52
- /**
53
- * Reconcile the outline tree state, gathering all available nodes.
54
- * @param nodes the list of `TreeNode`.
55
- *
56
- * @returns the list of tree nodes.
57
- */
58
- protected reconcileTreeState(nodes: TreeNode[]): TreeNode[];
59
- protected onAfterHide(msg: Message): void;
60
- protected onAfterShow(msg: Message): void;
61
- renderIcon(node: TreeNode, props: NodeProps): React.ReactNode;
62
- protected createNodeAttributes(node: TreeNode, props: NodeProps): React.Attributes & React.HTMLAttributes<HTMLElement>;
63
- /**
64
- * Get the tooltip for the given tree node.
65
- * - The tooltip is discovered when hovering over a tree node.
66
- * - If available, the tooltip is the concatenation of the node name, and it's type.
67
- * @param node the tree node.
68
- *
69
- * @returns the tooltip for the tree node if available, else `undefined`.
70
- */
71
- protected getNodeTooltip(node: TreeNode): string | undefined;
72
- protected isExpandable(node: TreeNode): node is ExpandableTreeNode;
73
- protected renderTree(model: TreeModel): React.ReactNode;
74
- protected deflateForStorage(node: TreeNode): object;
75
- protected inflateFromStorage(node: any, parent?: TreeNode): TreeNode;
76
- }
1
+ /// <reference types="react" />
2
+ import { TreeWidget, TreeNode, NodeProps, SelectableTreeNode, CompositeTreeNode, TreeProps, ContextMenuRenderer, TreeModel, ExpandableTreeNode } from '@theia/core/lib/browser';
3
+ import { OutlineViewTreeModel } from './outline-view-tree-model';
4
+ import { Message } from '@theia/core/shared/@phosphor/messaging';
5
+ import { Emitter, Event } from '@theia/core';
6
+ import * as React from '@theia/core/shared/react';
7
+ import { Range } from '@theia/core/shared/vscode-languageserver-protocol';
8
+ /**
9
+ * Representation of an outline symbol information node.
10
+ */
11
+ export interface OutlineSymbolInformationNode extends CompositeTreeNode, SelectableTreeNode, ExpandableTreeNode {
12
+ /**
13
+ * The `iconClass` for the given tree node.
14
+ */
15
+ iconClass: string;
16
+ }
17
+ /**
18
+ * Collection of outline symbol information node functions.
19
+ */
20
+ export declare namespace OutlineSymbolInformationNode {
21
+ /**
22
+ * Determine if the given tree node is an `OutlineSymbolInformationNode`.
23
+ * - The tree node is an `OutlineSymbolInformationNode` if:
24
+ * - The node exists.
25
+ * - The node is selectable.
26
+ * - The node contains a defined `iconClass` property.
27
+ * @param node the tree node.
28
+ *
29
+ * @returns `true` if the given node is an `OutlineSymbolInformationNode`.
30
+ */
31
+ function is(node: TreeNode): node is OutlineSymbolInformationNode;
32
+ function hasRange(node: unknown): node is {
33
+ range: Range;
34
+ };
35
+ }
36
+ export declare type OutlineViewWidgetFactory = () => OutlineViewWidget;
37
+ export declare const OutlineViewWidgetFactory: unique symbol;
38
+ export declare class OutlineViewWidget extends TreeWidget {
39
+ readonly model: OutlineViewTreeModel;
40
+ static LABEL: string;
41
+ readonly onDidChangeOpenStateEmitter: Emitter<boolean>;
42
+ protected readonly onDidUpdateEmitter: Emitter<void>;
43
+ readonly onDidUpdate: Event<void>;
44
+ constructor(treeProps: TreeProps, model: OutlineViewTreeModel, contextMenuRenderer: ContextMenuRenderer);
45
+ protected init(): void;
46
+ /**
47
+ * Set the outline tree with the list of `OutlineSymbolInformationNode`.
48
+ * @param roots the list of `OutlineSymbolInformationNode`.
49
+ */
50
+ setOutlineTree(roots: OutlineSymbolInformationNode[]): void;
51
+ protected getRoot(children: TreeNode[]): CompositeTreeNode;
52
+ /**
53
+ * Reconcile the outline tree state, gathering all available nodes.
54
+ * @param nodes the list of `TreeNode`.
55
+ *
56
+ * @returns the list of tree nodes.
57
+ */
58
+ protected reconcileTreeState(nodes: TreeNode[]): TreeNode[];
59
+ protected onAfterHide(msg: Message): void;
60
+ protected onAfterShow(msg: Message): void;
61
+ renderIcon(node: TreeNode, props: NodeProps): React.ReactNode;
62
+ protected createNodeAttributes(node: TreeNode, props: NodeProps): React.Attributes & React.HTMLAttributes<HTMLElement>;
63
+ /**
64
+ * Get the tooltip for the given tree node.
65
+ * - The tooltip is discovered when hovering over a tree node.
66
+ * - If available, the tooltip is the concatenation of the node name, and it's type.
67
+ * @param node the tree node.
68
+ *
69
+ * @returns the tooltip for the tree node if available, else `undefined`.
70
+ */
71
+ protected getNodeTooltip(node: TreeNode): string | undefined;
72
+ protected isExpandable(node: TreeNode): node is ExpandableTreeNode;
73
+ protected renderTree(model: TreeModel): React.ReactNode;
74
+ protected deflateForStorage(node: TreeNode): object;
75
+ protected inflateFromStorage(node: any, parent?: TreeNode): TreeNode;
76
+ }
77
77
  //# sourceMappingURL=outline-view-widget.d.ts.map