@theia/timeline 1.34.2 → 1.34.3
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 +641 -641
- package/README.md +30 -30
- package/lib/browser/timeline-context-key-service.d.ts +7 -7
- package/lib/browser/timeline-context-key-service.js +51 -51
- package/lib/browser/timeline-contribution.d.ts +17 -17
- package/lib/browser/timeline-contribution.js +128 -128
- package/lib/browser/timeline-empty-widget.d.ts +8 -8
- package/lib/browser/timeline-empty-widget.js +48 -48
- package/lib/browser/timeline-frontend-module.d.ts +5 -5
- package/lib/browser/timeline-frontend-module.js +68 -68
- package/lib/browser/timeline-service.d.ts +25 -25
- package/lib/browser/timeline-service.js +110 -110
- package/lib/browser/timeline-tree-model.d.ts +10 -10
- package/lib/browser/timeline-tree-model.js +68 -68
- package/lib/browser/timeline-tree-widget.d.ts +36 -36
- package/lib/browser/timeline-tree-widget.js +128 -128
- package/lib/browser/timeline-widget.d.ts +29 -29
- package/lib/browser/timeline-widget.js +194 -194
- package/lib/common/timeline-model.d.ts +56 -56
- package/lib/common/timeline-model.js +17 -17
- package/lib/package.spec.js +25 -25
- package/package.json +5 -5
- package/src/browser/style/index.css +51 -51
- package/src/browser/timeline-context-key-service.ts +36 -36
- package/src/browser/timeline-contribution.ts +112 -112
- package/src/browser/timeline-empty-widget.tsx +40 -40
- package/src/browser/timeline-frontend-module.ts +71 -71
- package/src/browser/timeline-service.ts +124 -124
- package/src/browser/timeline-tree-model.ts +72 -72
- package/src/browser/timeline-tree-widget.tsx +120 -120
- package/src/browser/timeline-widget.tsx +179 -179
- package/src/common/timeline-model.ts +84 -84
- package/src/package.spec.ts +29 -29
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { CommandRegistry, MenuModelRegistry, MenuPath } from '@theia/core/lib/common';
|
|
3
|
-
import { TreeWidget, TreeProps, NodeProps } from '@theia/core/lib/browser/tree';
|
|
4
|
-
import { ContextMenuRenderer } from '@theia/core/lib/browser';
|
|
5
|
-
import { TimelineNode, TimelineTreeModel } from './timeline-tree-model';
|
|
6
|
-
import { TimelineService } from './timeline-service';
|
|
7
|
-
import { TimelineContextKeyService } from './timeline-context-key-service';
|
|
8
|
-
import * as React from '@theia/core/shared/react';
|
|
9
|
-
import { TimelineItem } from '../common/timeline-model';
|
|
10
|
-
export declare const TIMELINE_ITEM_CONTEXT_MENU: MenuPath;
|
|
11
|
-
export declare class TimelineTreeWidget extends TreeWidget {
|
|
12
|
-
readonly model: TimelineTreeModel;
|
|
13
|
-
static ID: string;
|
|
14
|
-
static PAGE_SIZE: number;
|
|
15
|
-
protected readonly menus: MenuModelRegistry;
|
|
16
|
-
protected readonly contextKeys: TimelineContextKeyService;
|
|
17
|
-
protected readonly timelineService: TimelineService;
|
|
18
|
-
protected readonly commandRegistry: CommandRegistry;
|
|
19
|
-
constructor(props: TreeProps, model: TimelineTreeModel, contextMenuRenderer: ContextMenuRenderer);
|
|
20
|
-
protected renderNode(node: TimelineNode, props: NodeProps): React.ReactNode;
|
|
21
|
-
protected handleEnter(event: KeyboardEvent): void;
|
|
22
|
-
protected handleLeft(event: KeyboardEvent): Promise<void>;
|
|
23
|
-
}
|
|
24
|
-
export declare namespace TimelineItemNode {
|
|
25
|
-
interface Props {
|
|
26
|
-
timelineItem: TimelineItem;
|
|
27
|
-
commandRegistry: CommandRegistry;
|
|
28
|
-
contextKeys: TimelineContextKeyService;
|
|
29
|
-
contextMenuRenderer: ContextMenuRenderer;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
export declare class TimelineItemNode extends React.Component<TimelineItemNode.Props> {
|
|
33
|
-
render(): JSX.Element | undefined;
|
|
34
|
-
protected open: () => void;
|
|
35
|
-
protected renderContextMenu: (event: React.MouseEvent<HTMLElement>) => void;
|
|
36
|
-
}
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { CommandRegistry, MenuModelRegistry, MenuPath } from '@theia/core/lib/common';
|
|
3
|
+
import { TreeWidget, TreeProps, NodeProps } from '@theia/core/lib/browser/tree';
|
|
4
|
+
import { ContextMenuRenderer } from '@theia/core/lib/browser';
|
|
5
|
+
import { TimelineNode, TimelineTreeModel } from './timeline-tree-model';
|
|
6
|
+
import { TimelineService } from './timeline-service';
|
|
7
|
+
import { TimelineContextKeyService } from './timeline-context-key-service';
|
|
8
|
+
import * as React from '@theia/core/shared/react';
|
|
9
|
+
import { TimelineItem } from '../common/timeline-model';
|
|
10
|
+
export declare const TIMELINE_ITEM_CONTEXT_MENU: MenuPath;
|
|
11
|
+
export declare class TimelineTreeWidget extends TreeWidget {
|
|
12
|
+
readonly model: TimelineTreeModel;
|
|
13
|
+
static ID: string;
|
|
14
|
+
static PAGE_SIZE: number;
|
|
15
|
+
protected readonly menus: MenuModelRegistry;
|
|
16
|
+
protected readonly contextKeys: TimelineContextKeyService;
|
|
17
|
+
protected readonly timelineService: TimelineService;
|
|
18
|
+
protected readonly commandRegistry: CommandRegistry;
|
|
19
|
+
constructor(props: TreeProps, model: TimelineTreeModel, contextMenuRenderer: ContextMenuRenderer);
|
|
20
|
+
protected renderNode(node: TimelineNode, props: NodeProps): React.ReactNode;
|
|
21
|
+
protected handleEnter(event: KeyboardEvent): void;
|
|
22
|
+
protected handleLeft(event: KeyboardEvent): Promise<void>;
|
|
23
|
+
}
|
|
24
|
+
export declare namespace TimelineItemNode {
|
|
25
|
+
interface Props {
|
|
26
|
+
timelineItem: TimelineItem;
|
|
27
|
+
commandRegistry: CommandRegistry;
|
|
28
|
+
contextKeys: TimelineContextKeyService;
|
|
29
|
+
contextMenuRenderer: ContextMenuRenderer;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
export declare class TimelineItemNode extends React.Component<TimelineItemNode.Props> {
|
|
33
|
+
render(): JSX.Element | undefined;
|
|
34
|
+
protected open: () => void;
|
|
35
|
+
protected renderContextMenu: (event: React.MouseEvent<HTMLElement>) => void;
|
|
36
|
+
}
|
|
37
37
|
//# sourceMappingURL=timeline-tree-widget.d.ts.map
|
|
@@ -1,129 +1,129 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// *****************************************************************************
|
|
3
|
-
// Copyright (C) 2020 RedHat 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 WITH Classpath-exception-2.0
|
|
16
|
-
// *****************************************************************************
|
|
17
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
18
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
19
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
20
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
21
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
22
|
-
};
|
|
23
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
24
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
25
|
-
};
|
|
26
|
-
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
27
|
-
return function (target, key) { decorator(target, key, paramIndex); }
|
|
28
|
-
};
|
|
29
|
-
var TimelineTreeWidget_1;
|
|
30
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
31
|
-
exports.TimelineItemNode = exports.TimelineTreeWidget = exports.TIMELINE_ITEM_CONTEXT_MENU = void 0;
|
|
32
|
-
const inversify_1 = require("@theia/core/shared/inversify");
|
|
33
|
-
const common_1 = require("@theia/core/lib/common");
|
|
34
|
-
const tree_1 = require("@theia/core/lib/browser/tree");
|
|
35
|
-
const browser_1 = require("@theia/core/lib/browser");
|
|
36
|
-
const timeline_tree_model_1 = require("./timeline-tree-model");
|
|
37
|
-
const timeline_service_1 = require("./timeline-service");
|
|
38
|
-
const timeline_context_key_service_1 = require("./timeline-context-key-service");
|
|
39
|
-
const React = require("@theia/core/shared/react");
|
|
40
|
-
exports.TIMELINE_ITEM_CONTEXT_MENU = ['timeline-item-context-menu'];
|
|
41
|
-
let TimelineTreeWidget = TimelineTreeWidget_1 = class TimelineTreeWidget extends tree_1.TreeWidget {
|
|
42
|
-
constructor(props, model, contextMenuRenderer) {
|
|
43
|
-
super(props, model, contextMenuRenderer);
|
|
44
|
-
this.model = model;
|
|
45
|
-
this.id = TimelineTreeWidget_1.ID;
|
|
46
|
-
this.addClass('timeline-outer-container');
|
|
47
|
-
}
|
|
48
|
-
renderNode(node, props) {
|
|
49
|
-
const attributes = this.createNodeAttributes(node, props);
|
|
50
|
-
const content = React.createElement(TimelineItemNode, { timelineItem: node.timelineItem, commandRegistry: this.commandRegistry, contextKeys: this.contextKeys, contextMenuRenderer: this.contextMenuRenderer });
|
|
51
|
-
return React.createElement('div', attributes, content);
|
|
52
|
-
}
|
|
53
|
-
handleEnter(event) {
|
|
54
|
-
var _a;
|
|
55
|
-
const node = this.model.getFocusedNode();
|
|
56
|
-
const command = (_a = node === null || node === void 0 ? void 0 : node.timelineItem) === null || _a === void 0 ? void 0 : _a.command;
|
|
57
|
-
if (command) {
|
|
58
|
-
this.commandRegistry.executeCommand(command.id, ...(command.arguments ? command.arguments : []));
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
async handleLeft(event) {
|
|
62
|
-
this.model.selectPrevNode();
|
|
63
|
-
}
|
|
64
|
-
};
|
|
65
|
-
TimelineTreeWidget.ID = 'timeline-tree-widget';
|
|
66
|
-
TimelineTreeWidget.PAGE_SIZE = 20;
|
|
67
|
-
__decorate([
|
|
68
|
-
(0, inversify_1.inject)(common_1.MenuModelRegistry),
|
|
69
|
-
__metadata("design:type", common_1.MenuModelRegistry)
|
|
70
|
-
], TimelineTreeWidget.prototype, "menus", void 0);
|
|
71
|
-
__decorate([
|
|
72
|
-
(0, inversify_1.inject)(timeline_context_key_service_1.TimelineContextKeyService),
|
|
73
|
-
__metadata("design:type", timeline_context_key_service_1.TimelineContextKeyService)
|
|
74
|
-
], TimelineTreeWidget.prototype, "contextKeys", void 0);
|
|
75
|
-
__decorate([
|
|
76
|
-
(0, inversify_1.inject)(timeline_service_1.TimelineService),
|
|
77
|
-
__metadata("design:type", timeline_service_1.TimelineService)
|
|
78
|
-
], TimelineTreeWidget.prototype, "timelineService", void 0);
|
|
79
|
-
__decorate([
|
|
80
|
-
(0, inversify_1.inject)(common_1.CommandRegistry),
|
|
81
|
-
__metadata("design:type", common_1.CommandRegistry)
|
|
82
|
-
], TimelineTreeWidget.prototype, "commandRegistry", void 0);
|
|
83
|
-
TimelineTreeWidget = TimelineTreeWidget_1 = __decorate([
|
|
84
|
-
(0, inversify_1.injectable)(),
|
|
85
|
-
__param(0, (0, inversify_1.inject)(tree_1.TreeProps)),
|
|
86
|
-
__param(1, (0, inversify_1.inject)(timeline_tree_model_1.TimelineTreeModel)),
|
|
87
|
-
__param(2, (0, inversify_1.inject)(browser_1.ContextMenuRenderer)),
|
|
88
|
-
__metadata("design:paramtypes", [Object, timeline_tree_model_1.TimelineTreeModel,
|
|
89
|
-
browser_1.ContextMenuRenderer])
|
|
90
|
-
], TimelineTreeWidget);
|
|
91
|
-
exports.TimelineTreeWidget = TimelineTreeWidget;
|
|
92
|
-
class TimelineItemNode extends React.Component {
|
|
93
|
-
constructor() {
|
|
94
|
-
super(...arguments);
|
|
95
|
-
this.open = () => {
|
|
96
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
97
|
-
const command = this.props.timelineItem.command;
|
|
98
|
-
if (command) {
|
|
99
|
-
this.props.commandRegistry.executeCommand(command.id, ...command.arguments ? command.arguments : []);
|
|
100
|
-
}
|
|
101
|
-
};
|
|
102
|
-
this.renderContextMenu = (event) => {
|
|
103
|
-
event.preventDefault();
|
|
104
|
-
event.stopPropagation();
|
|
105
|
-
const { timelineItem, contextKeys, contextMenuRenderer } = this.props;
|
|
106
|
-
const currentTimelineItem = contextKeys.timelineItem.get();
|
|
107
|
-
contextKeys.timelineItem.set(timelineItem.contextValue);
|
|
108
|
-
try {
|
|
109
|
-
contextMenuRenderer.render({
|
|
110
|
-
menuPath: exports.TIMELINE_ITEM_CONTEXT_MENU,
|
|
111
|
-
anchor: event.nativeEvent,
|
|
112
|
-
args: [timelineItem]
|
|
113
|
-
});
|
|
114
|
-
}
|
|
115
|
-
finally {
|
|
116
|
-
contextKeys.timelineItem.set(currentTimelineItem);
|
|
117
|
-
}
|
|
118
|
-
};
|
|
119
|
-
}
|
|
120
|
-
render() {
|
|
121
|
-
const { label, description, detail } = this.props.timelineItem;
|
|
122
|
-
return React.createElement("div", { className: 'timeline-item', title: detail, onContextMenu: this.renderContextMenu, onClick: this.open },
|
|
123
|
-
React.createElement("div", { className: `noWrapInfo ${tree_1.TREE_NODE_SEGMENT_GROW_CLASS}` },
|
|
124
|
-
React.createElement("span", { className: 'name' }, label),
|
|
125
|
-
React.createElement("span", { className: 'label' }, description)));
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
exports.TimelineItemNode = TimelineItemNode;
|
|
1
|
+
"use strict";
|
|
2
|
+
// *****************************************************************************
|
|
3
|
+
// Copyright (C) 2020 RedHat 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 WITH Classpath-exception-2.0
|
|
16
|
+
// *****************************************************************************
|
|
17
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
18
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
19
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
20
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
21
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
22
|
+
};
|
|
23
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
24
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
25
|
+
};
|
|
26
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
27
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
28
|
+
};
|
|
29
|
+
var TimelineTreeWidget_1;
|
|
30
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
31
|
+
exports.TimelineItemNode = exports.TimelineTreeWidget = exports.TIMELINE_ITEM_CONTEXT_MENU = void 0;
|
|
32
|
+
const inversify_1 = require("@theia/core/shared/inversify");
|
|
33
|
+
const common_1 = require("@theia/core/lib/common");
|
|
34
|
+
const tree_1 = require("@theia/core/lib/browser/tree");
|
|
35
|
+
const browser_1 = require("@theia/core/lib/browser");
|
|
36
|
+
const timeline_tree_model_1 = require("./timeline-tree-model");
|
|
37
|
+
const timeline_service_1 = require("./timeline-service");
|
|
38
|
+
const timeline_context_key_service_1 = require("./timeline-context-key-service");
|
|
39
|
+
const React = require("@theia/core/shared/react");
|
|
40
|
+
exports.TIMELINE_ITEM_CONTEXT_MENU = ['timeline-item-context-menu'];
|
|
41
|
+
let TimelineTreeWidget = TimelineTreeWidget_1 = class TimelineTreeWidget extends tree_1.TreeWidget {
|
|
42
|
+
constructor(props, model, contextMenuRenderer) {
|
|
43
|
+
super(props, model, contextMenuRenderer);
|
|
44
|
+
this.model = model;
|
|
45
|
+
this.id = TimelineTreeWidget_1.ID;
|
|
46
|
+
this.addClass('timeline-outer-container');
|
|
47
|
+
}
|
|
48
|
+
renderNode(node, props) {
|
|
49
|
+
const attributes = this.createNodeAttributes(node, props);
|
|
50
|
+
const content = React.createElement(TimelineItemNode, { timelineItem: node.timelineItem, commandRegistry: this.commandRegistry, contextKeys: this.contextKeys, contextMenuRenderer: this.contextMenuRenderer });
|
|
51
|
+
return React.createElement('div', attributes, content);
|
|
52
|
+
}
|
|
53
|
+
handleEnter(event) {
|
|
54
|
+
var _a;
|
|
55
|
+
const node = this.model.getFocusedNode();
|
|
56
|
+
const command = (_a = node === null || node === void 0 ? void 0 : node.timelineItem) === null || _a === void 0 ? void 0 : _a.command;
|
|
57
|
+
if (command) {
|
|
58
|
+
this.commandRegistry.executeCommand(command.id, ...(command.arguments ? command.arguments : []));
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
async handleLeft(event) {
|
|
62
|
+
this.model.selectPrevNode();
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
TimelineTreeWidget.ID = 'timeline-tree-widget';
|
|
66
|
+
TimelineTreeWidget.PAGE_SIZE = 20;
|
|
67
|
+
__decorate([
|
|
68
|
+
(0, inversify_1.inject)(common_1.MenuModelRegistry),
|
|
69
|
+
__metadata("design:type", common_1.MenuModelRegistry)
|
|
70
|
+
], TimelineTreeWidget.prototype, "menus", void 0);
|
|
71
|
+
__decorate([
|
|
72
|
+
(0, inversify_1.inject)(timeline_context_key_service_1.TimelineContextKeyService),
|
|
73
|
+
__metadata("design:type", timeline_context_key_service_1.TimelineContextKeyService)
|
|
74
|
+
], TimelineTreeWidget.prototype, "contextKeys", void 0);
|
|
75
|
+
__decorate([
|
|
76
|
+
(0, inversify_1.inject)(timeline_service_1.TimelineService),
|
|
77
|
+
__metadata("design:type", timeline_service_1.TimelineService)
|
|
78
|
+
], TimelineTreeWidget.prototype, "timelineService", void 0);
|
|
79
|
+
__decorate([
|
|
80
|
+
(0, inversify_1.inject)(common_1.CommandRegistry),
|
|
81
|
+
__metadata("design:type", common_1.CommandRegistry)
|
|
82
|
+
], TimelineTreeWidget.prototype, "commandRegistry", void 0);
|
|
83
|
+
TimelineTreeWidget = TimelineTreeWidget_1 = __decorate([
|
|
84
|
+
(0, inversify_1.injectable)(),
|
|
85
|
+
__param(0, (0, inversify_1.inject)(tree_1.TreeProps)),
|
|
86
|
+
__param(1, (0, inversify_1.inject)(timeline_tree_model_1.TimelineTreeModel)),
|
|
87
|
+
__param(2, (0, inversify_1.inject)(browser_1.ContextMenuRenderer)),
|
|
88
|
+
__metadata("design:paramtypes", [Object, timeline_tree_model_1.TimelineTreeModel,
|
|
89
|
+
browser_1.ContextMenuRenderer])
|
|
90
|
+
], TimelineTreeWidget);
|
|
91
|
+
exports.TimelineTreeWidget = TimelineTreeWidget;
|
|
92
|
+
class TimelineItemNode extends React.Component {
|
|
93
|
+
constructor() {
|
|
94
|
+
super(...arguments);
|
|
95
|
+
this.open = () => {
|
|
96
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
97
|
+
const command = this.props.timelineItem.command;
|
|
98
|
+
if (command) {
|
|
99
|
+
this.props.commandRegistry.executeCommand(command.id, ...command.arguments ? command.arguments : []);
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
this.renderContextMenu = (event) => {
|
|
103
|
+
event.preventDefault();
|
|
104
|
+
event.stopPropagation();
|
|
105
|
+
const { timelineItem, contextKeys, contextMenuRenderer } = this.props;
|
|
106
|
+
const currentTimelineItem = contextKeys.timelineItem.get();
|
|
107
|
+
contextKeys.timelineItem.set(timelineItem.contextValue);
|
|
108
|
+
try {
|
|
109
|
+
contextMenuRenderer.render({
|
|
110
|
+
menuPath: exports.TIMELINE_ITEM_CONTEXT_MENU,
|
|
111
|
+
anchor: event.nativeEvent,
|
|
112
|
+
args: [timelineItem]
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
finally {
|
|
116
|
+
contextKeys.timelineItem.set(currentTimelineItem);
|
|
117
|
+
}
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
render() {
|
|
121
|
+
const { label, description, detail } = this.props.timelineItem;
|
|
122
|
+
return React.createElement("div", { className: 'timeline-item', title: detail, onContextMenu: this.renderContextMenu, onClick: this.open },
|
|
123
|
+
React.createElement("div", { className: `noWrapInfo ${tree_1.TREE_NODE_SEGMENT_GROW_CLASS}` },
|
|
124
|
+
React.createElement("span", { className: 'name' }, label),
|
|
125
|
+
React.createElement("span", { className: 'label' }, description)));
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
exports.TimelineItemNode = TimelineItemNode;
|
|
129
129
|
//# sourceMappingURL=timeline-tree-widget.js.map
|
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
import { Message } from '@theia/core/shared/@phosphor/messaging';
|
|
2
|
-
import { ApplicationShell, BaseWidget, Panel, PanelLayout } from '@theia/core/lib/browser';
|
|
3
|
-
import { TimelineTreeWidget } from './timeline-tree-widget';
|
|
4
|
-
import { TimelineService } from './timeline-service';
|
|
5
|
-
import { CommandRegistry, SelectionService } from '@theia/core/lib/common';
|
|
6
|
-
import { TimelineEmptyWidget } from './timeline-empty-widget';
|
|
7
|
-
import URI from '@theia/core/lib/common/uri';
|
|
8
|
-
import { URI as CodeURI } from '@theia/core/shared/vscode-uri';
|
|
9
|
-
export declare class TimelineWidget extends BaseWidget {
|
|
10
|
-
protected panel: Panel;
|
|
11
|
-
static ID: string;
|
|
12
|
-
private readonly timelinesBySource;
|
|
13
|
-
protected readonly resourceWidget: TimelineTreeWidget;
|
|
14
|
-
protected readonly timelineService: TimelineService;
|
|
15
|
-
protected readonly commandRegistry: CommandRegistry;
|
|
16
|
-
protected readonly applicationShell: ApplicationShell;
|
|
17
|
-
protected readonly timelineEmptyWidget: TimelineEmptyWidget;
|
|
18
|
-
protected readonly selectionService: SelectionService;
|
|
19
|
-
constructor();
|
|
20
|
-
protected init(): void;
|
|
21
|
-
protected loadTimelineForSource(source: string, uri: CodeURI, reset: boolean): Promise<void>;
|
|
22
|
-
loadTimeline(uri: URI, reset: boolean): Promise<void>;
|
|
23
|
-
refresh(uri?: URI): void;
|
|
24
|
-
private suitableWidgetsOpened;
|
|
25
|
-
private getCurrentWidgetUri;
|
|
26
|
-
protected get containerLayout(): PanelLayout | undefined;
|
|
27
|
-
protected onUpdateRequest(msg: Message): void;
|
|
28
|
-
protected onAfterAttach(msg: Message): void;
|
|
29
|
-
}
|
|
1
|
+
import { Message } from '@theia/core/shared/@phosphor/messaging';
|
|
2
|
+
import { ApplicationShell, BaseWidget, Panel, PanelLayout } from '@theia/core/lib/browser';
|
|
3
|
+
import { TimelineTreeWidget } from './timeline-tree-widget';
|
|
4
|
+
import { TimelineService } from './timeline-service';
|
|
5
|
+
import { CommandRegistry, SelectionService } from '@theia/core/lib/common';
|
|
6
|
+
import { TimelineEmptyWidget } from './timeline-empty-widget';
|
|
7
|
+
import URI from '@theia/core/lib/common/uri';
|
|
8
|
+
import { URI as CodeURI } from '@theia/core/shared/vscode-uri';
|
|
9
|
+
export declare class TimelineWidget extends BaseWidget {
|
|
10
|
+
protected panel: Panel;
|
|
11
|
+
static ID: string;
|
|
12
|
+
private readonly timelinesBySource;
|
|
13
|
+
protected readonly resourceWidget: TimelineTreeWidget;
|
|
14
|
+
protected readonly timelineService: TimelineService;
|
|
15
|
+
protected readonly commandRegistry: CommandRegistry;
|
|
16
|
+
protected readonly applicationShell: ApplicationShell;
|
|
17
|
+
protected readonly timelineEmptyWidget: TimelineEmptyWidget;
|
|
18
|
+
protected readonly selectionService: SelectionService;
|
|
19
|
+
constructor();
|
|
20
|
+
protected init(): void;
|
|
21
|
+
protected loadTimelineForSource(source: string, uri: CodeURI, reset: boolean): Promise<void>;
|
|
22
|
+
loadTimeline(uri: URI, reset: boolean): Promise<void>;
|
|
23
|
+
refresh(uri?: URI): void;
|
|
24
|
+
private suitableWidgetsOpened;
|
|
25
|
+
private getCurrentWidgetUri;
|
|
26
|
+
protected get containerLayout(): PanelLayout | undefined;
|
|
27
|
+
protected onUpdateRequest(msg: Message): void;
|
|
28
|
+
protected onAfterAttach(msg: Message): void;
|
|
29
|
+
}
|
|
30
30
|
//# sourceMappingURL=timeline-widget.d.ts.map
|