@codingame/monaco-vscode-timeline-service-override 2.2.2 → 3.0.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codingame/monaco-vscode-timeline-service-override",
3
- "version": "2.2.2",
3
+ "version": "3.0.0",
4
4
  "keywords": [],
5
5
  "author": {
6
6
  "name": "CodinGame",
@@ -18,7 +18,7 @@
18
18
  "module": "index.js",
19
19
  "types": "index.d.ts",
20
20
  "dependencies": {
21
- "vscode": "npm:@codingame/monaco-vscode-api@2.2.2",
21
+ "vscode": "npm:@codingame/monaco-vscode-api@3.0.0",
22
22
  "vscode-marked": "npm:marked@=3.0.2"
23
23
  }
24
24
  }
@@ -1,5 +1,4 @@
1
- import { Registry } from 'vscode/vscode/vs/platform/registry/common/platform';
2
- import { Extensions } from 'vscode/vscode/vs/workbench/common/contributions';
1
+ import { registerWorkbenchContribution2 } from 'vscode/vscode/vs/workbench/common/contributions';
3
2
  import { LocalHistoryTimeline } from './localHistoryTimeline.js';
4
3
 
5
- ( Registry.as(Extensions.Workbench)).registerWorkbenchContribution(LocalHistoryTimeline, 2 );
4
+ registerWorkbenchContribution2(LocalHistoryTimeline.ID, LocalHistoryTimeline, 2 );
@@ -22,7 +22,7 @@ import { getVirtualWorkspaceAuthority } from 'vscode/vscode/vs/platform/workspac
22
22
  var LocalHistoryTimeline_1;
23
23
  let LocalHistoryTimeline = class LocalHistoryTimeline extends Disposable {
24
24
  static { LocalHistoryTimeline_1 = this; }
25
- static { this.ID = 'timeline.localHistory'; }
25
+ static { this.ID = 'workbench.contrib.localHistoryTimeline'; }
26
26
  static { this.LOCAL_HISTORY_ENABLED_SETTINGS_KEY = 'workbench.localHistory.enabled'; }
27
27
  constructor(timelineService, workingCopyHistoryService, pathService, fileService, environmentService, configurationService, contextService) {
28
28
  super();
@@ -33,7 +33,7 @@ let LocalHistoryTimeline = class LocalHistoryTimeline extends Disposable {
33
33
  this.environmentService = environmentService;
34
34
  this.configurationService = configurationService;
35
35
  this.contextService = contextService;
36
- this.id = LocalHistoryTimeline_1.ID;
36
+ this.id = 'timeline.localHistory';
37
37
  this.label = ( localizeWithPath(
38
38
  'vs/workbench/contrib/localHistory/browser/localHistoryTimeline',
39
39
  'localHistory',
@@ -73,7 +73,7 @@ let LocalHistoryTimeline = class LocalHistoryTimeline extends Disposable {
73
73
  }
74
74
  onDidChangeWorkingCopyHistoryEntry(entry) {
75
75
  this._onDidChange.fire({
76
- id: LocalHistoryTimeline_1.ID,
76
+ id: this.id,
77
77
  uri: entry?.workingCopy.resource,
78
78
  reset: true
79
79
  });
@@ -101,7 +101,7 @@ let LocalHistoryTimeline = class LocalHistoryTimeline extends Disposable {
101
101
  }
102
102
  }
103
103
  return {
104
- source: LocalHistoryTimeline_1.ID,
104
+ source: this.id,
105
105
  items
106
106
  };
107
107
  }
@@ -113,7 +113,7 @@ let LocalHistoryTimeline = class LocalHistoryTimeline extends Disposable {
113
113
  `$(history) ${getLocalHistoryDateFormatter().format(entry.timestamp)}\n\n${SaveSourceRegistry.getSourceLabel(entry.source)}`,
114
114
  { supportThemeIcons: true }
115
115
  )),
116
- source: LocalHistoryTimeline_1.ID,
116
+ source: this.id,
117
117
  timestamp: entry.timestamp,
118
118
  themeIcon: LOCAL_HISTORY_ICON_ENTRY,
119
119
  contextValue: LOCAL_HISTORY_MENU_CONTEXT_VALUE,
@@ -42,10 +42,10 @@ import { registerIcon } from 'vscode/vscode/vs/platform/theme/common/iconRegistr
42
42
  import { API_OPEN_EDITOR_COMMAND_ID, API_OPEN_DIFF_EDITOR_COMMAND_ID } from 'vscode/vscode/vs/workbench/browser/parts/editor/editorCommands';
43
43
  import { isString } from 'vscode/vscode/vs/base/common/types';
44
44
  import { renderMarkdownAsPlaintext } from 'vscode/vscode/vs/base/browser/markdownRenderer';
45
- import { IHoverService } from 'vscode/vscode/vs/platform/hover/browser/hover';
46
45
  import { IUriIdentityService } from 'vscode/vscode/vs/platform/uriIdentity/common/uriIdentity';
47
46
  import { IExtensionService } from 'vscode/vscode/vs/workbench/services/extensions/common/extensions';
48
47
  import { IStorageService } from 'vscode/vscode/vs/platform/storage/common/storage';
48
+ import { getDefaultHoverDelegate } from 'vscode/vscode/vs/base/browser/ui/hover/hoverDelegate';
49
49
 
50
50
  const ItemHeight = 22;
51
51
  function isLoadMoreCommand(item) {
@@ -571,7 +571,7 @@ let TimelinePane = class TimelinePane extends ViewPane {
571
571
  }
572
572
  }
573
573
  const iterator = timeline.items[Symbol.iterator]();
574
- sources.push({ timeline: timeline, iterator: iterator, nextItem: iterator.next() });
574
+ sources.push({ timeline, iterator, nextItem: iterator.next() });
575
575
  }
576
576
  this._visibleItemCount = hasAnyItems ? 1 : 0;
577
577
  function getNextMostRecentSource() {
@@ -864,7 +864,7 @@ let TimelinePane = class TimelinePane extends ViewPane {
864
864
  this.tree.domFocus();
865
865
  }
866
866
  },
867
- getActionsContext: () => ({ uri: this.uri, item: item }),
867
+ getActionsContext: () => ({ uri: this.uri, item }),
868
868
  actionRunner: ( new TimelineActionRunner())
869
869
  });
870
870
  }
@@ -896,14 +896,11 @@ class TimelineElementTemplate {
896
896
  constructor(container, actionViewItemProvider, hoverDelegate) {
897
897
  container.classList.add('custom-view-tree-node-item');
898
898
  this.icon = append(container, $('.custom-view-tree-node-item-icon'));
899
- this.iconLabel = ( new IconLabel(
900
- container,
901
- { supportHighlights: true, supportIcons: true, hoverDelegate: hoverDelegate }
902
- ));
899
+ this.iconLabel = ( new IconLabel(container, { supportHighlights: true, supportIcons: true, hoverDelegate }));
903
900
  const timestampContainer = append(this.iconLabel.element, $('.timeline-timestamp-container'));
904
901
  this.timestamp = append(timestampContainer, $('span.timeline-timestamp'));
905
902
  const actionsContainer = append(this.iconLabel.element, $('.actions'));
906
- this.actionBar = ( new ActionBar(actionsContainer, { actionViewItemProvider: actionViewItemProvider }));
903
+ this.actionBar = ( new ActionBar(actionsContainer, { actionViewItemProvider }));
907
904
  }
908
905
  dispose() {
909
906
  this.iconLabel.dispose();
@@ -930,7 +927,7 @@ class TimelineActionRunner extends ActionRunner {
930
927
  $mid: 12 ,
931
928
  handle: item.handle,
932
929
  source: item.source,
933
- uri: uri
930
+ uri
934
931
  }, uri, item.source);
935
932
  }
936
933
  }
@@ -948,20 +945,15 @@ class TimelineListVirtualDelegate {
948
945
  }
949
946
  }
950
947
  let TimelineTreeRenderer = class TimelineTreeRenderer {
951
- constructor(commands, instantiationService, themeService, hoverService, configurationService) {
948
+ constructor(commands, instantiationService, themeService) {
952
949
  this.commands = commands;
953
950
  this.instantiationService = instantiationService;
954
951
  this.themeService = themeService;
955
- this.hoverService = hoverService;
956
- this.configurationService = configurationService;
957
952
  this._onDidScrollToEnd = ( new Emitter());
958
953
  this.onDidScrollToEnd = this._onDidScrollToEnd.event;
959
954
  this.templateId = TimelineElementTemplate.id;
960
955
  this.actionViewItemProvider = createActionViewItem.bind(undefined, this.instantiationService);
961
- this._hoverDelegate = {
962
- showHover: (options) => this.hoverService.showHover(options),
963
- delay: this.configurationService.getValue('workbench.hover.delay')
964
- };
956
+ this._hoverDelegate = getDefaultHoverDelegate('mouse');
965
957
  }
966
958
  setUri(uri) {
967
959
  this.uri = uri;
@@ -1007,7 +999,7 @@ let TimelineTreeRenderer = class TimelineTreeRenderer {
1007
999
  template.timestamp.textContent = item.relativeTime ?? '';
1008
1000
  template.timestamp.ariaLabel = item.relativeTimeFullWord ?? '';
1009
1001
  template.timestamp.parentElement.classList.toggle('timeline-timestamp--duplicate', isTimelineItem(item) && item.hideRelativeTime);
1010
- template.actionBar.context = { uri: this.uri, item: item };
1002
+ template.actionBar.context = { uri: this.uri, item };
1011
1003
  template.actionBar.actionRunner = ( new TimelineActionRunner());
1012
1004
  template.actionBar.push(this.commands.getItemActions(item), { icon: true, label: false });
1013
1005
  if (isLoadMoreCommand(item)) {
@@ -1020,9 +1012,7 @@ let TimelineTreeRenderer = class TimelineTreeRenderer {
1020
1012
  };
1021
1013
  TimelineTreeRenderer = ( __decorate([
1022
1014
  ( __param(1, IInstantiationService)),
1023
- ( __param(2, IThemeService)),
1024
- ( __param(3, IHoverService)),
1025
- ( __param(4, IConfigurationService))
1015
+ ( __param(2, IThemeService))
1026
1016
  ], TimelineTreeRenderer));
1027
1017
  const timelineRefresh = registerIcon('timeline-refresh', Codicon.refresh, ( localizeWithPath(
1028
1018
  'vs/workbench/contrib/timeline/browser/timelinePane',