@codingame/monaco-vscode-views-service-override 2.1.4 → 2.2.0-next.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 (107) hide show
  1. package/index.d.ts +11 -9
  2. package/index.js +8 -6
  3. package/package.json +11 -11
  4. package/tools/views.d.ts +102 -0
  5. package/tools/views.js +253 -0
  6. package/views.d.ts +4 -99
  7. package/views.js +52 -280
  8. package/external/rollup-plugin-styles/dist/runtime/inject-css.js +0 -3
  9. package/vscode/src/vs/base/browser/ui/centered/centeredViewLayout.js +0 -180
  10. package/vscode/src/vs/base/browser/ui/grid/grid.js +0 -494
  11. package/vscode/src/vs/base/browser/ui/grid/gridview.css.js +0 -6
  12. package/vscode/src/vs/base/browser/ui/grid/gridview.js +0 -1112
  13. package/vscode/src/vs/base/common/codicons.d.ts +0 -579
  14. package/vscode/src/vs/platform/webview/common/mimeTypes.js +0 -24
  15. package/vscode/src/vs/platform/webview/common/webviewPortMapping.js +0 -64
  16. package/vscode/src/vs/workbench/api/browser/viewsExtensionPoint.js +0 -790
  17. package/vscode/src/vs/workbench/browser/actions/listCommands.js +0 -764
  18. package/vscode/src/vs/workbench/browser/layout.d.ts +0 -26
  19. package/vscode/src/vs/workbench/browser/parts/activitybar/activitybarPart.js +0 -612
  20. package/vscode/src/vs/workbench/browser/parts/activitybar/media/activityaction.css.js +0 -6
  21. package/vscode/src/vs/workbench/browser/parts/activitybar/media/activitybarpart.css.js +0 -6
  22. package/vscode/src/vs/workbench/browser/parts/auxiliarybar/auxiliaryBarPart.js +0 -150
  23. package/vscode/src/vs/workbench/browser/parts/auxiliarybar/media/auxiliaryBarPart.css.js +0 -6
  24. package/vscode/src/vs/workbench/browser/parts/compositeBar.js +0 -605
  25. package/vscode/src/vs/workbench/browser/parts/compositePart.js +0 -335
  26. package/vscode/src/vs/workbench/browser/parts/editor/auxiliaryEditorPart.js +0 -223
  27. package/vscode/src/vs/workbench/browser/parts/editor/editor.contribution.js +0 -1407
  28. package/vscode/src/vs/workbench/browser/parts/editor/editorConfiguration.js +0 -186
  29. package/vscode/src/vs/workbench/browser/parts/editor/editorDropTarget.js +0 -511
  30. package/vscode/src/vs/workbench/browser/parts/editor/editorPane.d.ts +0 -112
  31. package/vscode/src/vs/workbench/browser/parts/editor/editorPart.js +0 -1020
  32. package/vscode/src/vs/workbench/browser/parts/editor/editorParts.js +0 -391
  33. package/vscode/src/vs/workbench/browser/parts/editor/media/editordroptarget.css.js +0 -6
  34. package/vscode/src/vs/workbench/browser/parts/media/compositepart.css.js +0 -6
  35. package/vscode/src/vs/workbench/browser/parts/media/paneCompositePart.css.js +0 -6
  36. package/vscode/src/vs/workbench/browser/parts/paneCompositeBar.js +0 -645
  37. package/vscode/src/vs/workbench/browser/parts/paneCompositePart.js +0 -379
  38. package/vscode/src/vs/workbench/browser/parts/paneCompositePartService.js +0 -68
  39. package/vscode/src/vs/workbench/browser/parts/panel/panelPart.js +0 -146
  40. package/vscode/src/vs/workbench/browser/parts/sidebar/media/sidebarpart.css.js +0 -6
  41. package/vscode/src/vs/workbench/browser/parts/sidebar/sidebarPart.js +0 -222
  42. package/vscode/src/vs/workbench/contrib/callHierarchy/browser/callHierarchy.contribution.js +0 -299
  43. package/vscode/src/vs/workbench/contrib/callHierarchy/browser/callHierarchyPeek.js +0 -365
  44. package/vscode/src/vs/workbench/contrib/callHierarchy/browser/callHierarchyTree.js +0 -135
  45. package/vscode/src/vs/workbench/contrib/callHierarchy/browser/media/callHierarchy.css.js +0 -6
  46. package/vscode/src/vs/workbench/contrib/customEditor/browser/customEditor.contribution.js +0 -17
  47. package/vscode/src/vs/workbench/contrib/customEditor/browser/customEditorInputFactory.js +0 -145
  48. package/vscode/src/vs/workbench/contrib/customEditor/browser/customEditors.js +0 -214
  49. package/vscode/src/vs/workbench/contrib/customEditor/browser/media/customEditor.css.js +0 -6
  50. package/vscode/src/vs/workbench/contrib/customEditor/common/contributedCustomEditors.js +0 -78
  51. package/vscode/src/vs/workbench/contrib/customEditor/common/customEditorModelManager.js +0 -63
  52. package/vscode/src/vs/workbench/contrib/customEditor/common/extensionPoint.js +0 -119
  53. package/vscode/src/vs/workbench/contrib/externalUriOpener/common/externalUriOpener.contribution.js +0 -6
  54. package/vscode/src/vs/workbench/contrib/files/browser/editors/binaryFileEditor.js +0 -79
  55. package/vscode/src/vs/workbench/contrib/files/browser/editors/fileEditorHandler.js +0 -74
  56. package/vscode/src/vs/workbench/contrib/files/browser/editors/textFileEditor.js +0 -256
  57. package/vscode/src/vs/workbench/contrib/files/browser/editors/textFileEditorTracker.js +0 -99
  58. package/vscode/src/vs/workbench/contrib/files/browser/editors/textFileSaveErrorHandler.js +0 -444
  59. package/vscode/src/vs/workbench/contrib/files/browser/explorerService.js +0 -432
  60. package/vscode/src/vs/workbench/contrib/files/browser/fileActions.contribution.js +0 -786
  61. package/vscode/src/vs/workbench/contrib/files/browser/fileCommands.js +0 -488
  62. package/vscode/src/vs/workbench/contrib/files/browser/files.contribution.js +0 -522
  63. package/vscode/src/vs/workbench/contrib/files/browser/workspaceWatcher.js +0 -152
  64. package/vscode/src/vs/workbench/contrib/files/common/dirtyFilesIndicator.js +0 -63
  65. package/vscode/src/vs/workbench/contrib/languageStatus/browser/languageStatus.contribution.js +0 -409
  66. package/vscode/src/vs/workbench/contrib/languageStatus/browser/media/languageStatus.css.js +0 -6
  67. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/commands/commands.js +0 -693
  68. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/commands/devCommands.js +0 -240
  69. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeEditor.contribution.js +0 -77
  70. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeEditorSerializer.js +0 -42
  71. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/colors.js +0 -71
  72. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/conflictActions.js +0 -348
  73. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editorGutter.js +0 -98
  74. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/baseCodeEditorView.js +0 -146
  75. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/codeEditorView.js +0 -105
  76. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/inputCodeEditorView.js +0 -401
  77. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/resultCodeEditorView.js +0 -197
  78. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/fixedZoneWidget.js +0 -41
  79. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/lineAlignment.js +0 -128
  80. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/media/mergeEditor.css.js +0 -6
  81. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/mergeEditor.js +0 -612
  82. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/scrollSynchronizer.js +0 -158
  83. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/viewModel.js +0 -264
  84. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/viewZones.js +0 -173
  85. package/vscode/src/vs/workbench/contrib/typeHierarchy/browser/media/typeHierarchy.css.js +0 -6
  86. package/vscode/src/vs/workbench/contrib/typeHierarchy/browser/typeHierarchy.contribution.js +0 -282
  87. package/vscode/src/vs/workbench/contrib/typeHierarchy/browser/typeHierarchyPeek.js +0 -360
  88. package/vscode/src/vs/workbench/contrib/typeHierarchy/browser/typeHierarchyTree.js +0 -133
  89. package/vscode/src/vs/workbench/contrib/webview/browser/overlayWebview.js +0 -290
  90. package/vscode/src/vs/workbench/contrib/webview/browser/resourceLoading.js +0 -96
  91. package/vscode/src/vs/workbench/contrib/webview/browser/themeing.js +0 -88
  92. package/vscode/src/vs/workbench/contrib/webview/browser/webview.contribution.js +0 -79
  93. package/vscode/src/vs/workbench/contrib/webview/browser/webviewElement.js +0 -648
  94. package/vscode/src/vs/workbench/contrib/webview/browser/webviewFindWidget.js +0 -65
  95. package/vscode/src/vs/workbench/contrib/webview/browser/webviewService.js +0 -59
  96. package/vscode/src/vs/workbench/contrib/webviewPanel/browser/webviewCommands.js +0 -142
  97. package/vscode/src/vs/workbench/contrib/webviewPanel/browser/webviewEditorInputSerializer.js +0 -121
  98. package/vscode/src/vs/workbench/contrib/webviewPanel/browser/webviewPanel.contribution.js +0 -68
  99. package/vscode/src/vs/workbench/contrib/webviewView/browser/webviewViewPane.js +0 -235
  100. package/vscode/src/vs/workbench/services/activity/browser/activityService.js +0 -145
  101. package/vscode/src/vs/workbench/services/editor/browser/editorResolverService.js +0 -670
  102. package/vscode/src/vs/workbench/services/history/browser/historyService.js +0 -1484
  103. package/vscode/src/vs/workbench/services/progress/browser/media/progressService.css.js +0 -6
  104. package/vscode/src/vs/workbench/services/progress/browser/progressService.js +0 -523
  105. package/vscode/src/vs/workbench/services/untitled/common/untitledTextEditorHandler.js +0 -101
  106. package/vscode/src/vs/workbench/services/views/browser/viewDescriptorService.js +0 -713
  107. package/vscode/src/vs/workbench/services/views/common/viewContainerModel.js +0 -598
@@ -1,65 +0,0 @@
1
- import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
2
- import { IContextKeyService } from 'vscode/vscode/vs/platform/contextkey/common/contextkey';
3
- import { IContextViewService } from 'vscode/vscode/vs/platform/contextview/browser/contextView';
4
- import { IKeybindingService } from 'vscode/vscode/vs/platform/keybinding/common/keybinding';
5
- import { SimpleFindWidget } from 'vscode/vscode/vs/workbench/contrib/codeEditor/browser/find/simpleFindWidget';
6
- import { KEYBINDING_CONTEXT_WEBVIEW_FIND_WIDGET_FOCUSED } from 'vscode/vscode/vs/workbench/contrib/webview/browser/webview';
7
-
8
- let WebviewFindWidget = class WebviewFindWidget extends SimpleFindWidget {
9
- async _getResultCount(dataChanged) {
10
- return undefined;
11
- }
12
- constructor(_delegate, contextViewService, contextKeyService, keybindingService) {
13
- super({
14
- showCommonFindToggles: false,
15
- checkImeCompletionState: _delegate.checkImeCompletionState,
16
- enableSash: true,
17
- }, contextViewService, contextKeyService, keybindingService);
18
- this._delegate = _delegate;
19
- this._findWidgetFocused = KEYBINDING_CONTEXT_WEBVIEW_FIND_WIDGET_FOCUSED.bindTo(contextKeyService);
20
- this._register(_delegate.hasFindResult(hasResult => {
21
- this.updateButtons(hasResult);
22
- this.focusFindBox();
23
- }));
24
- this._register(_delegate.onDidStopFind(() => {
25
- this.updateButtons(false);
26
- }));
27
- }
28
- find(previous) {
29
- const val = this.inputValue;
30
- if (val) {
31
- this._delegate.find(val, previous);
32
- }
33
- }
34
- hide(animated = true) {
35
- super.hide(animated);
36
- this._delegate.stopFind(true);
37
- this._delegate.focus();
38
- }
39
- _onInputChanged() {
40
- const val = this.inputValue;
41
- if (val) {
42
- this._delegate.updateFind(val);
43
- }
44
- else {
45
- this._delegate.stopFind(false);
46
- }
47
- return false;
48
- }
49
- _onFocusTrackerFocus() {
50
- this._findWidgetFocused.set(true);
51
- }
52
- _onFocusTrackerBlur() {
53
- this._findWidgetFocused.reset();
54
- }
55
- _onFindInputFocusTrackerFocus() { }
56
- _onFindInputFocusTrackerBlur() { }
57
- findFirst() { }
58
- };
59
- WebviewFindWidget = ( __decorate([
60
- ( __param(1, IContextViewService)),
61
- ( __param(2, IContextKeyService)),
62
- ( __param(3, IKeybindingService))
63
- ], WebviewFindWidget));
64
-
65
- export { WebviewFindWidget };
@@ -1,59 +0,0 @@
1
- import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
2
- import { Emitter } from 'vscode/vscode/vs/base/common/event';
3
- import { Disposable } from 'vscode/vscode/vs/base/common/lifecycle';
4
- import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
5
- import { WebviewThemeDataProvider } from './themeing.js';
6
- import { WebviewElement } from './webviewElement.js';
7
- import { OverlayWebview } from './overlayWebview.js';
8
-
9
- let WebviewService = class WebviewService extends Disposable {
10
- constructor(_instantiationService) {
11
- super();
12
- this._instantiationService = _instantiationService;
13
- this._webviews = ( new Set());
14
- this._onDidChangeActiveWebview = this._register(( new Emitter()));
15
- this.onDidChangeActiveWebview = this._onDidChangeActiveWebview.event;
16
- this._webviewThemeDataProvider = this._instantiationService.createInstance(WebviewThemeDataProvider);
17
- }
18
- get activeWebview() { return this._activeWebview; }
19
- _updateActiveWebview(value) {
20
- if (value !== this._activeWebview) {
21
- this._activeWebview = value;
22
- this._onDidChangeActiveWebview.fire(value);
23
- }
24
- }
25
- get webviews() {
26
- return ( this._webviews.values());
27
- }
28
- createWebviewElement(initInfo) {
29
- const webview = this._instantiationService.createInstance(WebviewElement, initInfo, this._webviewThemeDataProvider);
30
- this.registerNewWebview(webview);
31
- return webview;
32
- }
33
- createWebviewOverlay(initInfo) {
34
- const webview = this._instantiationService.createInstance(OverlayWebview, initInfo);
35
- this.registerNewWebview(webview);
36
- return webview;
37
- }
38
- registerNewWebview(webview) {
39
- this._webviews.add(webview);
40
- webview.onDidFocus(() => {
41
- this._updateActiveWebview(webview);
42
- });
43
- const onBlur = () => {
44
- if (this._activeWebview === webview) {
45
- this._updateActiveWebview(undefined);
46
- }
47
- };
48
- webview.onDidBlur(onBlur);
49
- webview.onDidDispose(() => {
50
- onBlur();
51
- this._webviews.delete(webview);
52
- });
53
- }
54
- };
55
- WebviewService = ( __decorate([
56
- ( __param(0, IInstantiationService))
57
- ], WebviewService));
58
-
59
- export { WebviewService };
@@ -1,142 +0,0 @@
1
- import { EditorContextKeys } from 'vscode/vscode/vs/editor/common/editorContextKeys';
2
- import { localizeWithPath } from 'vscode/vscode/vs/nls';
3
- import { Action2, MenuId } from 'vscode/vscode/vs/platform/actions/common/actions';
4
- import { ContextKeyExpr } from 'vscode/vscode/vs/platform/contextkey/common/contextkey';
5
- import { Categories } from 'vscode/vscode/vs/platform/action/common/actionCommonCategories';
6
- import { KEYBINDING_CONTEXT_WEBVIEW_FIND_WIDGET_ENABLED, KEYBINDING_CONTEXT_WEBVIEW_FIND_WIDGET_VISIBLE, KEYBINDING_CONTEXT_WEBVIEW_FIND_WIDGET_FOCUSED, IWebviewService } from 'vscode/vscode/vs/workbench/contrib/webview/browser/webview';
7
- import { WebviewEditor } from 'vscode/vscode/vs/workbench/contrib/webviewPanel/browser/webviewEditor';
8
- import { WebviewInput } from 'vscode/vscode/vs/workbench/contrib/webviewPanel/browser/webviewEditorInput';
9
- import { IEditorService } from 'vscode/vscode/vs/workbench/services/editor/common/editorService';
10
-
11
- const webviewActiveContextKeyExpr = ( ContextKeyExpr.and(( ContextKeyExpr.equals('activeEditor', WebviewEditor.ID)), ( EditorContextKeys.focus.toNegated() )));
12
- class ShowWebViewEditorFindWidgetAction extends Action2 {
13
- static { this.ID = 'editor.action.webvieweditor.showFind'; }
14
- static { this.LABEL = ( localizeWithPath(
15
- 'vs/workbench/contrib/webviewPanel/browser/webviewCommands',
16
- 'editor.action.webvieweditor.showFind',
17
- "Show find"
18
- )); }
19
- constructor() {
20
- super({
21
- id: ShowWebViewEditorFindWidgetAction.ID,
22
- title: ShowWebViewEditorFindWidgetAction.LABEL,
23
- keybinding: {
24
- when: ( ContextKeyExpr.and(
25
- webviewActiveContextKeyExpr,
26
- KEYBINDING_CONTEXT_WEBVIEW_FIND_WIDGET_ENABLED
27
- )),
28
- primary: 2048 | 36 ,
29
- weight: 100
30
- }
31
- });
32
- }
33
- run(accessor) {
34
- getActiveWebviewEditor(accessor)?.showFind();
35
- }
36
- }
37
- class HideWebViewEditorFindCommand extends Action2 {
38
- static { this.ID = 'editor.action.webvieweditor.hideFind'; }
39
- static { this.LABEL = ( localizeWithPath(
40
- 'vs/workbench/contrib/webviewPanel/browser/webviewCommands',
41
- 'editor.action.webvieweditor.hideFind',
42
- "Stop find"
43
- )); }
44
- constructor() {
45
- super({
46
- id: HideWebViewEditorFindCommand.ID,
47
- title: HideWebViewEditorFindCommand.LABEL,
48
- keybinding: {
49
- when: ( ContextKeyExpr.and(
50
- webviewActiveContextKeyExpr,
51
- KEYBINDING_CONTEXT_WEBVIEW_FIND_WIDGET_VISIBLE
52
- )),
53
- primary: 9 ,
54
- weight: 100
55
- }
56
- });
57
- }
58
- run(accessor) {
59
- getActiveWebviewEditor(accessor)?.hideFind();
60
- }
61
- }
62
- class WebViewEditorFindNextCommand extends Action2 {
63
- static { this.ID = 'editor.action.webvieweditor.findNext'; }
64
- static { this.LABEL = ( localizeWithPath(
65
- 'vs/workbench/contrib/webviewPanel/browser/webviewCommands',
66
- 'editor.action.webvieweditor.findNext',
67
- 'Find next'
68
- )); }
69
- constructor() {
70
- super({
71
- id: WebViewEditorFindNextCommand.ID,
72
- title: WebViewEditorFindNextCommand.LABEL,
73
- keybinding: {
74
- when: ( ContextKeyExpr.and(
75
- webviewActiveContextKeyExpr,
76
- KEYBINDING_CONTEXT_WEBVIEW_FIND_WIDGET_FOCUSED
77
- )),
78
- primary: 3 ,
79
- weight: 100
80
- }
81
- });
82
- }
83
- run(accessor) {
84
- getActiveWebviewEditor(accessor)?.runFindAction(false);
85
- }
86
- }
87
- class WebViewEditorFindPreviousCommand extends Action2 {
88
- static { this.ID = 'editor.action.webvieweditor.findPrevious'; }
89
- static { this.LABEL = ( localizeWithPath(
90
- 'vs/workbench/contrib/webviewPanel/browser/webviewCommands',
91
- 'editor.action.webvieweditor.findPrevious',
92
- 'Find previous'
93
- )); }
94
- constructor() {
95
- super({
96
- id: WebViewEditorFindPreviousCommand.ID,
97
- title: WebViewEditorFindPreviousCommand.LABEL,
98
- keybinding: {
99
- when: ( ContextKeyExpr.and(
100
- webviewActiveContextKeyExpr,
101
- KEYBINDING_CONTEXT_WEBVIEW_FIND_WIDGET_FOCUSED
102
- )),
103
- primary: 1024 | 3 ,
104
- weight: 100
105
- }
106
- });
107
- }
108
- run(accessor) {
109
- getActiveWebviewEditor(accessor)?.runFindAction(true);
110
- }
111
- }
112
- class ReloadWebviewAction extends Action2 {
113
- static { this.ID = 'workbench.action.webview.reloadWebviewAction'; }
114
- static { this.LABEL = ( localizeWithPath(
115
- 'vs/workbench/contrib/webviewPanel/browser/webviewCommands',
116
- 'refreshWebviewLabel',
117
- "Reload Webviews"
118
- )); }
119
- constructor() {
120
- super({
121
- id: ReloadWebviewAction.ID,
122
- title: { value: ReloadWebviewAction.LABEL, original: 'Reload Webviews' },
123
- category: Categories.Developer,
124
- menu: [{
125
- id: MenuId.CommandPalette
126
- }]
127
- });
128
- }
129
- async run(accessor) {
130
- const webviewService = accessor.get(IWebviewService);
131
- for (const webview of webviewService.webviews) {
132
- webview.reload();
133
- }
134
- }
135
- }
136
- function getActiveWebviewEditor(accessor) {
137
- const editorService = accessor.get(IEditorService);
138
- const activeEditor = editorService.activeEditor;
139
- return activeEditor instanceof WebviewInput ? activeEditor.webview : undefined;
140
- }
141
-
142
- export { HideWebViewEditorFindCommand, ReloadWebviewAction, ShowWebViewEditorFindWidgetAction, WebViewEditorFindNextCommand, WebViewEditorFindPreviousCommand };
@@ -1,121 +0,0 @@
1
- import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
2
- import { URI } from 'vscode/vscode/vs/base/common/uri';
3
- import { ExtensionIdentifier } from 'vscode/vscode/vs/platform/extensions/common/extensions';
4
- import { WebviewInput } from 'vscode/vscode/vs/workbench/contrib/webviewPanel/browser/webviewEditorInput';
5
- import { IWebviewWorkbenchService } from 'vscode/vscode/vs/workbench/contrib/webviewPanel/browser/webviewWorkbenchService';
6
-
7
- let WebviewEditorInputSerializer = class WebviewEditorInputSerializer {
8
- static { this.ID = WebviewInput.typeId; }
9
- constructor(_webviewWorkbenchService) {
10
- this._webviewWorkbenchService = _webviewWorkbenchService;
11
- }
12
- canSerialize(input) {
13
- return this._webviewWorkbenchService.shouldPersist(input);
14
- }
15
- serialize(input) {
16
- if (!this._webviewWorkbenchService.shouldPersist(input)) {
17
- return undefined;
18
- }
19
- const data = this.toJson(input);
20
- try {
21
- return JSON.stringify(data);
22
- }
23
- catch {
24
- return undefined;
25
- }
26
- }
27
- deserialize(_instantiationService, serializedEditorInput) {
28
- const data = this.fromJson(JSON.parse(serializedEditorInput));
29
- return this._webviewWorkbenchService.openRevivedWebview({
30
- webviewInitInfo: {
31
- providedViewType: data.providedId,
32
- origin: data.origin,
33
- title: data.title,
34
- options: data.webviewOptions,
35
- contentOptions: data.contentOptions,
36
- extension: data.extension,
37
- },
38
- viewType: data.viewType,
39
- title: data.title,
40
- iconPath: data.iconPath,
41
- state: data.state,
42
- group: data.group
43
- });
44
- }
45
- fromJson(data) {
46
- return {
47
- ...data,
48
- extension: reviveWebviewExtensionDescription(data.extensionId, data.extensionLocation),
49
- iconPath: reviveIconPath(data.iconPath),
50
- state: reviveState(data.state),
51
- webviewOptions: restoreWebviewOptions(data.options),
52
- contentOptions: restoreWebviewContentOptions(data.options),
53
- };
54
- }
55
- toJson(input) {
56
- return {
57
- origin: input.webview.origin,
58
- viewType: input.viewType,
59
- providedId: input.providedId,
60
- title: input.getName(),
61
- options: { ...input.webview.options, ...input.webview.contentOptions },
62
- extensionLocation: input.extension?.location,
63
- extensionId: input.extension?.id.value,
64
- state: input.webview.state,
65
- iconPath: input.iconPath ? { light: input.iconPath.light, dark: input.iconPath.dark, } : undefined,
66
- group: input.group
67
- };
68
- }
69
- };
70
- WebviewEditorInputSerializer = ( __decorate([
71
- ( __param(0, IWebviewWorkbenchService))
72
- ], WebviewEditorInputSerializer));
73
- function reviveWebviewExtensionDescription(extensionId, extensionLocation) {
74
- if (!extensionId) {
75
- return undefined;
76
- }
77
- const location = reviveUri(extensionLocation);
78
- if (!location) {
79
- return undefined;
80
- }
81
- return {
82
- id: ( new ExtensionIdentifier(extensionId)),
83
- location,
84
- };
85
- }
86
- function reviveIconPath(data) {
87
- if (!data) {
88
- return undefined;
89
- }
90
- const light = reviveUri(data.light);
91
- const dark = reviveUri(data.dark);
92
- return light && dark ? { light, dark } : undefined;
93
- }
94
- function reviveUri(data) {
95
- if (!data) {
96
- return undefined;
97
- }
98
- try {
99
- if (typeof data === 'string') {
100
- return ( URI.parse(data));
101
- }
102
- return ( URI.from(data));
103
- }
104
- catch {
105
- return undefined;
106
- }
107
- }
108
- function reviveState(state) {
109
- return typeof state === 'string' ? state : undefined;
110
- }
111
- function restoreWebviewOptions(options) {
112
- return options;
113
- }
114
- function restoreWebviewContentOptions(options) {
115
- return {
116
- ...options,
117
- localResourceRoots: options.localResourceRoots?.map(uri => reviveUri(uri)),
118
- };
119
- }
120
-
121
- export { WebviewEditorInputSerializer, restoreWebviewContentOptions, restoreWebviewOptions, reviveWebviewExtensionDescription };
@@ -1,68 +0,0 @@
1
- import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
2
- import { Event } from 'vscode/vscode/vs/base/common/event';
3
- import { Disposable } from 'vscode/vscode/vs/base/common/lifecycle';
4
- import { localizeWithPath } from 'vscode/vscode/vs/nls';
5
- import { registerAction2 } from 'vscode/vscode/vs/platform/actions/common/actions';
6
- import { SyncDescriptor } from 'vscode/vscode/vs/platform/instantiation/common/descriptors';
7
- import { Registry } from 'vscode/vscode/vs/platform/registry/common/platform';
8
- import { EditorPaneDescriptor } from 'vscode/vscode/vs/workbench/browser/editor';
9
- import { Extensions } from 'vscode/vscode/vs/workbench/common/contributions';
10
- import { EditorExtensions } from 'vscode/vscode/vs/workbench/common/editor';
11
- import { IEditorGroupsService } from 'vscode/vscode/vs/workbench/services/editor/common/editorGroupsService';
12
- import { ShowWebViewEditorFindWidgetAction, HideWebViewEditorFindCommand, WebViewEditorFindNextCommand, WebViewEditorFindPreviousCommand, ReloadWebviewAction } from './webviewCommands.js';
13
- import { WebviewEditor } from 'vscode/vscode/vs/workbench/contrib/webviewPanel/browser/webviewEditor';
14
- import { WebviewInput } from 'vscode/vscode/vs/workbench/contrib/webviewPanel/browser/webviewEditorInput';
15
- import { WebviewEditorInputSerializer } from './webviewEditorInputSerializer.js';
16
-
17
- (( Registry.as(EditorExtensions.EditorPane))).registerEditorPane(EditorPaneDescriptor.create(WebviewEditor, WebviewEditor.ID, ( localizeWithPath(
18
- 'vs/workbench/contrib/webviewPanel/browser/webviewPanel.contribution',
19
- 'webview.editor.label',
20
- "webview editor"
21
- ))), [( new SyncDescriptor(WebviewInput))]);
22
- let WebviewPanelContribution = class WebviewPanelContribution extends Disposable {
23
- constructor(editorGroupService) {
24
- super();
25
- this.editorGroupService = editorGroupService;
26
- this.editorGroupService.whenReady.then(() => this.editorGroupService.groups.forEach(group => {
27
- this.registerGroupListener(group);
28
- }));
29
- this._register(this.editorGroupService.onDidAddGroup(group => this.registerGroupListener(group)));
30
- }
31
- registerGroupListener(group) {
32
- const listener = group.onWillOpenEditor(e => this.onEditorOpening(e.editor, group));
33
- Event.once(group.onWillDispose)(() => {
34
- listener.dispose();
35
- });
36
- }
37
- onEditorOpening(editor, group) {
38
- if (!(editor instanceof WebviewInput) || editor.typeId !== WebviewInput.typeId) {
39
- return undefined;
40
- }
41
- if (group.contains(editor)) {
42
- return undefined;
43
- }
44
- let previousGroup;
45
- const groups = this.editorGroupService.groups;
46
- for (const group of groups) {
47
- if (group.contains(editor)) {
48
- previousGroup = group;
49
- break;
50
- }
51
- }
52
- if (!previousGroup) {
53
- return undefined;
54
- }
55
- previousGroup.closeEditor(editor);
56
- }
57
- };
58
- WebviewPanelContribution = ( __decorate([
59
- ( __param(0, IEditorGroupsService))
60
- ], WebviewPanelContribution));
61
- const workbenchContributionsRegistry = ( Registry.as(Extensions.Workbench));
62
- workbenchContributionsRegistry.registerWorkbenchContribution(WebviewPanelContribution, 1 );
63
- ( Registry.as(EditorExtensions.EditorFactory)).registerEditorSerializer(WebviewEditorInputSerializer.ID, WebviewEditorInputSerializer);
64
- registerAction2(ShowWebViewEditorFindWidgetAction);
65
- registerAction2(HideWebViewEditorFindCommand);
66
- registerAction2(WebViewEditorFindNextCommand);
67
- registerAction2(WebViewEditorFindPreviousCommand);
68
- registerAction2(ReloadWebviewAction);