@theia/plugin-ext 1.53.2 → 1.55.0-next.14
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/lib/common/plugin-api-rpc-model.d.ts +10 -1
- package/lib/common/plugin-api-rpc-model.d.ts.map +1 -1
- package/lib/common/plugin-api-rpc-model.js.map +1 -1
- package/lib/common/plugin-api-rpc.d.ts +7 -6
- package/lib/common/plugin-api-rpc.d.ts.map +1 -1
- package/lib/common/plugin-api-rpc.js.map +1 -1
- package/lib/common/test-types.d.ts +11 -1
- package/lib/common/test-types.d.ts.map +1 -1
- package/lib/common/test-types.js +9 -1
- package/lib/common/test-types.js.map +1 -1
- package/lib/main/browser/authentication-main.d.ts +6 -6
- package/lib/main/browser/authentication-main.d.ts.map +1 -1
- package/lib/main/browser/authentication-main.js +15 -9
- package/lib/main/browser/authentication-main.js.map +1 -1
- package/lib/main/browser/command-registry-main.d.ts +0 -1
- package/lib/main/browser/command-registry-main.d.ts.map +1 -1
- package/lib/main/browser/custom-editors/custom-editor-opener.d.ts +5 -3
- package/lib/main/browser/custom-editors/custom-editor-opener.d.ts.map +1 -1
- package/lib/main/browser/custom-editors/custom-editor-opener.js +16 -3
- package/lib/main/browser/custom-editors/custom-editor-opener.js.map +1 -1
- package/lib/main/browser/custom-editors/custom-editors-main.d.ts +0 -1
- package/lib/main/browser/custom-editors/custom-editors-main.d.ts.map +1 -1
- package/lib/main/browser/custom-editors/plugin-custom-editor-registry.d.ts +2 -1
- package/lib/main/browser/custom-editors/plugin-custom-editor-registry.d.ts.map +1 -1
- package/lib/main/browser/custom-editors/plugin-custom-editor-registry.js +6 -2
- package/lib/main/browser/custom-editors/plugin-custom-editor-registry.js.map +1 -1
- package/lib/main/browser/debug/plugin-debug-service.d.ts +0 -1
- package/lib/main/browser/debug/plugin-debug-service.d.ts.map +1 -1
- package/lib/main/browser/editors-and-documents-main.d.ts.map +1 -1
- package/lib/main/browser/editors-and-documents-main.js +17 -2
- package/lib/main/browser/editors-and-documents-main.js.map +1 -1
- package/lib/main/browser/languages-main.d.ts +0 -1
- package/lib/main/browser/languages-main.d.ts.map +1 -1
- package/lib/main/browser/menus/plugin-menu-command-adapter.d.ts.map +1 -1
- package/lib/main/browser/menus/plugin-menu-command-adapter.js +2 -2
- package/lib/main/browser/menus/plugin-menu-command-adapter.js.map +1 -1
- package/lib/main/browser/notebooks/notebook-documents-and-editors-main.d.ts.map +1 -1
- package/lib/main/browser/notebooks/notebook-documents-and-editors-main.js +10 -7
- package/lib/main/browser/notebooks/notebook-documents-and-editors-main.js.map +1 -1
- package/lib/main/browser/notebooks/notebooks-main.d.ts +0 -1
- package/lib/main/browser/notebooks/notebooks-main.d.ts.map +1 -1
- package/lib/main/browser/notebooks/renderers/cell-output-webview.d.ts +22 -12
- package/lib/main/browser/notebooks/renderers/cell-output-webview.d.ts.map +1 -1
- package/lib/main/browser/notebooks/renderers/cell-output-webview.js +145 -74
- package/lib/main/browser/notebooks/renderers/cell-output-webview.js.map +1 -1
- package/lib/main/browser/notebooks/renderers/output-webview-internal.d.ts.map +1 -1
- package/lib/main/browser/notebooks/renderers/output-webview-internal.js +198 -69
- package/lib/main/browser/notebooks/renderers/output-webview-internal.js.map +1 -1
- package/lib/main/browser/notebooks/renderers/webview-communication.d.ts +56 -6
- package/lib/main/browser/notebooks/renderers/webview-communication.d.ts.map +1 -1
- package/lib/main/browser/plugin-ext-frontend-module.d.ts.map +1 -1
- package/lib/main/browser/plugin-ext-frontend-module.js +2 -1
- package/lib/main/browser/plugin-ext-frontend-module.js.map +1 -1
- package/lib/main/browser/quick-open-main.d.ts +0 -1
- package/lib/main/browser/quick-open-main.d.ts.map +1 -1
- package/lib/main/browser/tabs/tabs-main.d.ts +1 -1
- package/lib/main/browser/tabs/tabs-main.d.ts.map +1 -1
- package/lib/main/browser/tabs/tabs-main.js +1 -1
- package/lib/main/browser/tabs/tabs-main.js.map +1 -1
- package/lib/main/browser/terminal-main.d.ts +0 -1
- package/lib/main/browser/terminal-main.d.ts.map +1 -1
- package/lib/main/browser/test-main.d.ts.map +1 -1
- package/lib/main/browser/test-main.js.map +1 -1
- package/lib/main/browser/text-editor-main.d.ts +6 -3
- package/lib/main/browser/text-editor-main.d.ts.map +1 -1
- package/lib/main/browser/text-editor-main.js +39 -5
- package/lib/main/browser/text-editor-main.js.map +1 -1
- package/lib/main/browser/view/tree-view-decorator-service.d.ts +0 -1
- package/lib/main/browser/view/tree-view-decorator-service.d.ts.map +1 -1
- package/lib/main/browser/view/tree-view-widget.d.ts +0 -1
- package/lib/main/browser/view/tree-view-widget.d.ts.map +1 -1
- package/lib/main/browser/view/tree-views-main.d.ts +0 -1
- package/lib/main/browser/view/tree-views-main.d.ts.map +1 -1
- package/lib/main/browser/webview/webview.d.ts +0 -1
- package/lib/main/browser/webview/webview.d.ts.map +1 -1
- package/lib/main/browser/webview-views/webview-views-main.d.ts +0 -1
- package/lib/main/browser/webview-views/webview-views-main.d.ts.map +1 -1
- package/lib/main/browser/webviews-main.d.ts +0 -1
- package/lib/main/browser/webviews-main.d.ts.map +1 -1
- package/lib/main/browser/workspace-main.d.ts +0 -1
- package/lib/main/browser/workspace-main.d.ts.map +1 -1
- package/lib/plugin/authentication-ext.d.ts +3 -3
- package/lib/plugin/authentication-ext.d.ts.map +1 -1
- package/lib/plugin/authentication-ext.js +8 -5
- package/lib/plugin/authentication-ext.js.map +1 -1
- package/lib/plugin/clipboard-ext.d.ts +0 -1
- package/lib/plugin/clipboard-ext.d.ts.map +1 -1
- package/lib/plugin/command-registry.d.ts +0 -1
- package/lib/plugin/command-registry.d.ts.map +1 -1
- package/lib/plugin/comments.d.ts +0 -1
- package/lib/plugin/comments.d.ts.map +1 -1
- package/lib/plugin/custom-editors.d.ts +0 -1
- package/lib/plugin/custom-editors.d.ts.map +1 -1
- package/lib/plugin/debug/debug-ext.d.ts +0 -1
- package/lib/plugin/debug/debug-ext.d.ts.map +1 -1
- package/lib/plugin/debug/plugin-debug-adapter-creator.d.ts +0 -1
- package/lib/plugin/debug/plugin-debug-adapter-creator.d.ts.map +1 -1
- package/lib/plugin/debug/plugin-debug-adapter-session.d.ts +0 -1
- package/lib/plugin/debug/plugin-debug-adapter-session.d.ts.map +1 -1
- package/lib/plugin/debug/plugin-debug-adapter-tracker.d.ts +0 -1
- package/lib/plugin/debug/plugin-debug-adapter-tracker.d.ts.map +1 -1
- package/lib/plugin/decorations.d.ts +0 -1
- package/lib/plugin/decorations.d.ts.map +1 -1
- package/lib/plugin/dialogs.d.ts +0 -1
- package/lib/plugin/dialogs.d.ts.map +1 -1
- package/lib/plugin/document-data.d.ts +0 -1
- package/lib/plugin/document-data.d.ts.map +1 -1
- package/lib/plugin/documents.d.ts +0 -1
- package/lib/plugin/documents.d.ts.map +1 -1
- package/lib/plugin/env.d.ts +0 -1
- package/lib/plugin/env.d.ts.map +1 -1
- package/lib/plugin/file-system-event-service-ext-impl.d.ts +0 -1
- package/lib/plugin/file-system-event-service-ext-impl.d.ts.map +1 -1
- package/lib/plugin/file-system-ext-impl.d.ts +27 -4
- package/lib/plugin/file-system-ext-impl.d.ts.map +1 -1
- package/lib/plugin/file-system-ext-impl.js +4 -2
- package/lib/plugin/file-system-ext-impl.js.map +1 -1
- package/lib/plugin/label-service.d.ts +0 -1
- package/lib/plugin/label-service.d.ts.map +1 -1
- package/lib/plugin/languages/call-hierarchy.d.ts +0 -1
- package/lib/plugin/languages/call-hierarchy.d.ts.map +1 -1
- package/lib/plugin/languages/code-action.d.ts +0 -1
- package/lib/plugin/languages/code-action.d.ts.map +1 -1
- package/lib/plugin/languages/color.d.ts +0 -1
- package/lib/plugin/languages/color.d.ts.map +1 -1
- package/lib/plugin/languages/completion.d.ts +0 -1
- package/lib/plugin/languages/completion.d.ts.map +1 -1
- package/lib/plugin/languages/declaration.d.ts +0 -1
- package/lib/plugin/languages/declaration.d.ts.map +1 -1
- package/lib/plugin/languages/definition.d.ts +0 -1
- package/lib/plugin/languages/definition.d.ts.map +1 -1
- package/lib/plugin/languages/diagnostics.d.ts +0 -1
- package/lib/plugin/languages/diagnostics.d.ts.map +1 -1
- package/lib/plugin/languages/document-drop-edit.d.ts +0 -1
- package/lib/plugin/languages/document-drop-edit.d.ts.map +1 -1
- package/lib/plugin/languages/document-formatting.d.ts +0 -1
- package/lib/plugin/languages/document-formatting.d.ts.map +1 -1
- package/lib/plugin/languages/document-highlight.d.ts +0 -1
- package/lib/plugin/languages/document-highlight.d.ts.map +1 -1
- package/lib/plugin/languages/evaluatable-expression.d.ts +0 -1
- package/lib/plugin/languages/evaluatable-expression.d.ts.map +1 -1
- package/lib/plugin/languages/folding.d.ts +0 -1
- package/lib/plugin/languages/folding.d.ts.map +1 -1
- package/lib/plugin/languages/hover.d.ts +0 -1
- package/lib/plugin/languages/hover.d.ts.map +1 -1
- package/lib/plugin/languages/implementation.d.ts +0 -1
- package/lib/plugin/languages/implementation.d.ts.map +1 -1
- package/lib/plugin/languages/inlay-hints.d.ts +0 -1
- package/lib/plugin/languages/inlay-hints.d.ts.map +1 -1
- package/lib/plugin/languages/inline-completion.d.ts +0 -1
- package/lib/plugin/languages/inline-completion.d.ts.map +1 -1
- package/lib/plugin/languages/inline-values.d.ts +0 -1
- package/lib/plugin/languages/inline-values.d.ts.map +1 -1
- package/lib/plugin/languages/lens.d.ts +0 -1
- package/lib/plugin/languages/lens.d.ts.map +1 -1
- package/lib/plugin/languages/link-provider.d.ts +0 -1
- package/lib/plugin/languages/link-provider.d.ts.map +1 -1
- package/lib/plugin/languages/linked-editing-range.d.ts +0 -1
- package/lib/plugin/languages/linked-editing-range.d.ts.map +1 -1
- package/lib/plugin/languages/on-type-formatting.d.ts +0 -1
- package/lib/plugin/languages/on-type-formatting.d.ts.map +1 -1
- package/lib/plugin/languages/outline.d.ts +0 -1
- package/lib/plugin/languages/outline.d.ts.map +1 -1
- package/lib/plugin/languages/range-formatting.d.ts +0 -1
- package/lib/plugin/languages/range-formatting.d.ts.map +1 -1
- package/lib/plugin/languages/reference.d.ts +0 -1
- package/lib/plugin/languages/reference.d.ts.map +1 -1
- package/lib/plugin/languages/rename.d.ts +0 -1
- package/lib/plugin/languages/rename.d.ts.map +1 -1
- package/lib/plugin/languages/selection-range.d.ts +0 -1
- package/lib/plugin/languages/selection-range.d.ts.map +1 -1
- package/lib/plugin/languages/semantic-highlighting.d.ts +0 -1
- package/lib/plugin/languages/semantic-highlighting.d.ts.map +1 -1
- package/lib/plugin/languages/signature.d.ts +0 -1
- package/lib/plugin/languages/signature.d.ts.map +1 -1
- package/lib/plugin/languages/type-definition.d.ts +0 -1
- package/lib/plugin/languages/type-definition.d.ts.map +1 -1
- package/lib/plugin/languages/type-hierarchy.d.ts +0 -1
- package/lib/plugin/languages/type-hierarchy.d.ts.map +1 -1
- package/lib/plugin/languages/util.d.ts +0 -1
- package/lib/plugin/languages/util.d.ts.map +1 -1
- package/lib/plugin/languages/workspace-symbol.d.ts +0 -1
- package/lib/plugin/languages/workspace-symbol.d.ts.map +1 -1
- package/lib/plugin/languages-utils.d.ts +0 -1
- package/lib/plugin/languages-utils.d.ts.map +1 -1
- package/lib/plugin/languages.d.ts +0 -1
- package/lib/plugin/languages.d.ts.map +1 -1
- package/lib/plugin/markdown-string.d.ts +0 -1
- package/lib/plugin/markdown-string.d.ts.map +1 -1
- package/lib/plugin/message-registry.d.ts +0 -1
- package/lib/plugin/message-registry.d.ts.map +1 -1
- package/lib/plugin/node/debug/plugin-node-debug-adapter-creator.d.ts +0 -1
- package/lib/plugin/node/debug/plugin-node-debug-adapter-creator.d.ts.map +1 -1
- package/lib/plugin/notebook/notebook-document.d.ts +0 -1
- package/lib/plugin/notebook/notebook-document.d.ts.map +1 -1
- package/lib/plugin/notebook/notebook-documents.d.ts +0 -1
- package/lib/plugin/notebook/notebook-documents.d.ts.map +1 -1
- package/lib/plugin/notebook/notebook-editor.d.ts +0 -1
- package/lib/plugin/notebook/notebook-editor.d.ts.map +1 -1
- package/lib/plugin/notebook/notebook-editors.d.ts +0 -1
- package/lib/plugin/notebook/notebook-editors.d.ts.map +1 -1
- package/lib/plugin/notebook/notebook-kernels.d.ts +0 -1
- package/lib/plugin/notebook/notebook-kernels.d.ts.map +1 -1
- package/lib/plugin/notebook/notebook-renderers.d.ts +0 -1
- package/lib/plugin/notebook/notebook-renderers.d.ts.map +1 -1
- package/lib/plugin/notebook/notebooks.d.ts +1 -1
- package/lib/plugin/notebook/notebooks.d.ts.map +1 -1
- package/lib/plugin/notebook/notebooks.js +23 -3
- package/lib/plugin/notebook/notebooks.js.map +1 -1
- package/lib/plugin/notification.d.ts +0 -1
- package/lib/plugin/notification.d.ts.map +1 -1
- package/lib/plugin/output-channel/log-output-channel.d.ts +0 -1
- package/lib/plugin/output-channel/log-output-channel.d.ts.map +1 -1
- package/lib/plugin/output-channel/output-channel-item.d.ts +0 -1
- package/lib/plugin/output-channel/output-channel-item.d.ts.map +1 -1
- package/lib/plugin/output-channel-registry.d.ts +0 -1
- package/lib/plugin/output-channel-registry.d.ts.map +1 -1
- package/lib/plugin/plugin-context.d.ts +1 -1
- package/lib/plugin/plugin-context.d.ts.map +1 -1
- package/lib/plugin/plugin-context.js +37 -15
- package/lib/plugin/plugin-context.js.map +1 -1
- package/lib/plugin/plugin-manager.d.ts +0 -1
- package/lib/plugin/plugin-manager.d.ts.map +1 -1
- package/lib/plugin/plugin-storage.d.ts +0 -1
- package/lib/plugin/plugin-storage.d.ts.map +1 -1
- package/lib/plugin/preference-registry.d.ts +0 -1
- package/lib/plugin/preference-registry.d.ts.map +1 -1
- package/lib/plugin/quick-open.d.ts +0 -1
- package/lib/plugin/quick-open.d.ts.map +1 -1
- package/lib/plugin/scm.d.ts +1 -1
- package/lib/plugin/scm.d.ts.map +1 -1
- package/lib/plugin/scm.js +3 -3
- package/lib/plugin/scm.js.map +1 -1
- package/lib/plugin/secrets-ext.d.ts +0 -1
- package/lib/plugin/secrets-ext.d.ts.map +1 -1
- package/lib/plugin/status-bar/status-bar-item.d.ts +0 -1
- package/lib/plugin/status-bar/status-bar-item.d.ts.map +1 -1
- package/lib/plugin/status-bar-message-registry.d.ts +0 -1
- package/lib/plugin/status-bar-message-registry.d.ts.map +1 -1
- package/lib/plugin/tabs.d.ts +0 -1
- package/lib/plugin/tabs.d.ts.map +1 -1
- package/lib/plugin/tasks/task-provider.d.ts +0 -1
- package/lib/plugin/tasks/task-provider.d.ts.map +1 -1
- package/lib/plugin/tasks/tasks.d.ts +0 -1
- package/lib/plugin/tasks/tasks.d.ts.map +1 -1
- package/lib/plugin/terminal-ext.d.ts +1 -1
- package/lib/plugin/terminal-ext.d.ts.map +1 -1
- package/lib/plugin/terminal-ext.js +1 -0
- package/lib/plugin/terminal-ext.js.map +1 -1
- package/lib/plugin/test-item.d.ts +0 -1
- package/lib/plugin/test-item.d.ts.map +1 -1
- package/lib/plugin/tests.d.ts +8 -2
- package/lib/plugin/tests.d.ts.map +1 -1
- package/lib/plugin/tests.js +24 -1
- package/lib/plugin/tests.js.map +1 -1
- package/lib/plugin/text-editor.d.ts +1 -2
- package/lib/plugin/text-editor.d.ts.map +1 -1
- package/lib/plugin/text-editor.js.map +1 -1
- package/lib/plugin/text-editors.d.ts +0 -1
- package/lib/plugin/text-editors.d.ts.map +1 -1
- package/lib/plugin/timeline.d.ts +0 -1
- package/lib/plugin/timeline.d.ts.map +1 -1
- package/lib/plugin/tree/tree-views.d.ts +0 -1
- package/lib/plugin/tree/tree-views.d.ts.map +1 -1
- package/lib/plugin/type-converters.d.ts +13 -2
- package/lib/plugin/type-converters.d.ts.map +1 -1
- package/lib/plugin/type-converters.js +55 -5
- package/lib/plugin/type-converters.js.map +1 -1
- package/lib/plugin/types-impl.d.ts +7 -1
- package/lib/plugin/types-impl.d.ts.map +1 -1
- package/lib/plugin/types-impl.js +9 -1
- package/lib/plugin/types-impl.js.map +1 -1
- package/lib/plugin/uri-ext.d.ts +0 -1
- package/lib/plugin/uri-ext.d.ts.map +1 -1
- package/lib/plugin/webview-views.d.ts +0 -1
- package/lib/plugin/webview-views.d.ts.map +1 -1
- package/lib/plugin/webviews.d.ts +0 -1
- package/lib/plugin/webviews.d.ts.map +1 -1
- package/lib/plugin/window-state.d.ts +0 -1
- package/lib/plugin/window-state.d.ts.map +1 -1
- package/lib/plugin/workspace.d.ts +0 -1
- package/lib/plugin/workspace.d.ts.map +1 -1
- package/package.json +29 -29
- package/src/common/plugin-api-rpc-model.ts +11 -0
- package/src/common/plugin-api-rpc.ts +7 -5
- package/src/common/test-types.ts +15 -1
- package/src/main/browser/authentication-main.ts +24 -11
- package/src/main/browser/custom-editors/custom-editor-opener.tsx +19 -4
- package/src/main/browser/custom-editors/plugin-custom-editor-registry.ts +7 -3
- package/src/main/browser/editors-and-documents-main.ts +27 -2
- package/src/main/browser/menus/plugin-menu-command-adapter.ts +2 -2
- package/src/main/browser/notebooks/notebook-documents-and-editors-main.ts +13 -9
- package/src/main/browser/notebooks/notebook-kernels-main.ts +2 -2
- package/src/main/browser/notebooks/renderers/cell-output-webview.tsx +170 -74
- package/src/main/browser/notebooks/renderers/output-webview-internal.ts +237 -73
- package/src/main/browser/notebooks/renderers/webview-communication.ts +78 -7
- package/src/main/browser/plugin-ext-frontend-module.ts +6 -5
- package/src/main/browser/tabs/tabs-main.ts +6 -2
- package/src/main/browser/test-main.ts +4 -1
- package/src/main/browser/text-editor-main.ts +55 -14
- package/src/plugin/authentication-ext.ts +9 -5
- package/src/plugin/file-system-ext-impl.ts +7 -3
- package/src/plugin/notebook/notebooks.ts +22 -1
- package/src/plugin/plugin-context.ts +40 -15
- package/src/plugin/scm.ts +5 -4
- package/src/plugin/terminal-ext.ts +1 -0
- package/src/plugin/tests.ts +34 -3
- package/src/plugin/text-editor.ts +1 -1
- package/src/plugin/type-converters.ts +58 -6
- package/src/plugin/types-impl.ts +10 -1
|
@@ -74,6 +74,12 @@ export async function outputWebviewPreload(ctx: PreloadContext): Promise<void> {
|
|
|
74
74
|
const theia = acquireVsCodeApi();
|
|
75
75
|
const renderFallbackErrorName = 'vscode.fallbackToNextRenderer';
|
|
76
76
|
|
|
77
|
+
document.body.style.overflow = 'hidden';
|
|
78
|
+
const container = document.createElement('div');
|
|
79
|
+
container.id = 'container';
|
|
80
|
+
container.classList.add('widgetarea');
|
|
81
|
+
document.body.appendChild(container);
|
|
82
|
+
|
|
77
83
|
function createEmitter<T>(listenerChange: (listeners: Set<Listener<T>>) => void = () => undefined): EmitterLike<T> {
|
|
78
84
|
const listeners = new Set<Listener<T>>();
|
|
79
85
|
return {
|
|
@@ -138,19 +144,124 @@ export async function outputWebviewPreload(ctx: PreloadContext): Promise<void> {
|
|
|
138
144
|
return module.activate(createKernelContext());
|
|
139
145
|
}
|
|
140
146
|
|
|
141
|
-
class
|
|
147
|
+
class OutputCell {
|
|
148
|
+
readonly element: HTMLElement;
|
|
149
|
+
readonly outputElements: OutputContainer[] = [];
|
|
150
|
+
|
|
151
|
+
constructor(public cellHandle: number, cellIndex?: number) {
|
|
152
|
+
this.element = document.createElement('div');
|
|
153
|
+
this.element.style.outline = '0';
|
|
154
|
+
|
|
155
|
+
this.element.id = `cellHandle${cellHandle}`;
|
|
156
|
+
this.element.classList.add('cell_container');
|
|
157
|
+
|
|
158
|
+
this.element.addEventListener('focusin', e => {
|
|
159
|
+
theia.postMessage({ type: 'cellFocusChanged', cellHandle: cellHandle });
|
|
160
|
+
});
|
|
161
|
+
|
|
162
|
+
if (cellIndex && cellIndex < container.children.length) {
|
|
163
|
+
container.insertBefore(this.element, container.children[cellIndex]);
|
|
164
|
+
} else {
|
|
165
|
+
container.appendChild(this.element);
|
|
166
|
+
}
|
|
167
|
+
this.element = this.element;
|
|
168
|
+
|
|
169
|
+
theia.postMessage({ type: 'cellHeightRequest', cellHandle: cellHandle });
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
public dispose(): void {
|
|
173
|
+
this.element.remove();
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
calcTotalOutputHeight(): number {
|
|
177
|
+
return this.outputElements.reduce((acc, output) => acc + output.element.clientHeight, 0) + 5;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
createOutputElement(index: number, output: webviewCommunication.Output, items: rendererApi.OutputItem[]): OutputContainer {
|
|
181
|
+
let outputContainer = this.outputElements.find(o => o.outputId === output.id);
|
|
182
|
+
if (!outputContainer) {
|
|
183
|
+
outputContainer = new OutputContainer(output, items, this);
|
|
184
|
+
this.element.appendChild(outputContainer.containerElement);
|
|
185
|
+
this.outputElements.splice(index, 0, outputContainer);
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
return outputContainer;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
public clearOutputs(start: number, deleteCount: number): void {
|
|
192
|
+
for (const output of this.outputElements.splice(start, deleteCount)) {
|
|
193
|
+
output?.clear();
|
|
194
|
+
output.containerElement.remove();
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
public show(outputId: string, top: number): void {
|
|
199
|
+
const outputContainer = this.outputElements.find(o => o.outputId === outputId);
|
|
200
|
+
if (!outputContainer) {
|
|
201
|
+
return;
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
public hide(): void {
|
|
206
|
+
this.element.style.visibility = 'hidden';
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
public updateCellHeight(cellKind: number, height: number): void {
|
|
210
|
+
let additionalHeight = 54.5;
|
|
211
|
+
additionalHeight -= cells[0] === this ? 2.5 : 0; // first cell
|
|
212
|
+
additionalHeight -= this.outputElements.length ? 0 : 5.5; // no outputs
|
|
213
|
+
this.element.style.paddingTop = `${height + additionalHeight}px`;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
public outputVisibilityChanged(visible: boolean): void {
|
|
217
|
+
this.outputElements.forEach(output => {
|
|
218
|
+
output.element.style.display = visible ? 'initial' : 'none';
|
|
219
|
+
});
|
|
220
|
+
if (visible) {
|
|
221
|
+
this.element.getElementsByClassName('output-hidden')?.[0].remove();
|
|
222
|
+
} else {
|
|
223
|
+
const outputHiddenElement = document.createElement('div');
|
|
224
|
+
outputHiddenElement.classList.add('output-hidden');
|
|
225
|
+
outputHiddenElement.style.height = '16px';
|
|
226
|
+
this.element.appendChild(outputHiddenElement);
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
// public updateScroll(request: webviewCommunication.IContentWidgetTopRequest): void {
|
|
231
|
+
// this.element.style.top = `${request.cellTop}px`;
|
|
232
|
+
|
|
233
|
+
// const outputElement = this.outputElements.get(request.outputId);
|
|
234
|
+
// if (outputElement) {
|
|
235
|
+
// outputElement.updateScroll(request.outputOffset);
|
|
236
|
+
|
|
237
|
+
// if (request.forceDisplay && outputElement.element) {
|
|
238
|
+
// // TODO @rebornix @mjbvz, there is a misalignment here.
|
|
239
|
+
// // We set output visibility on cell container, other than output container or output node itself.
|
|
240
|
+
// outputElement.element.style.visibility = '';
|
|
241
|
+
// }
|
|
242
|
+
// }
|
|
243
|
+
|
|
244
|
+
// if (request.forceDisplay) {
|
|
245
|
+
// this.element.style.visibility = '';
|
|
246
|
+
// }
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
const cells: OutputCell[] = [];
|
|
250
|
+
|
|
251
|
+
class OutputContainer {
|
|
142
252
|
readonly outputId: string;
|
|
253
|
+
readonly cellId: string;
|
|
143
254
|
renderedItem?: rendererApi.OutputItem;
|
|
144
255
|
allItems: rendererApi.OutputItem[];
|
|
145
256
|
|
|
146
257
|
renderer: Renderer;
|
|
147
258
|
|
|
148
259
|
element: HTMLElement;
|
|
149
|
-
|
|
260
|
+
containerElement: HTMLElement;
|
|
150
261
|
|
|
151
|
-
constructor(output: webviewCommunication.Output, items: rendererApi.OutputItem[]) {
|
|
152
|
-
this.createHtmlElement(output.id);
|
|
262
|
+
constructor(output: webviewCommunication.Output, items: rendererApi.OutputItem[], private cell: OutputCell) {
|
|
153
263
|
this.outputId = output.id;
|
|
264
|
+
this.createHtmlElement();
|
|
154
265
|
this.allItems = items;
|
|
155
266
|
}
|
|
156
267
|
|
|
@@ -169,27 +280,23 @@ export async function outputWebviewPreload(ctx: PreloadContext): Promise<void> {
|
|
|
169
280
|
this.element.innerHTML = '';
|
|
170
281
|
}
|
|
171
282
|
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
this.
|
|
175
|
-
this.
|
|
176
|
-
this.
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
this.
|
|
181
|
-
|
|
182
|
-
outputContainer.classList.add('output-container');
|
|
183
|
-
cellContainer.appendChild(outputContainer);
|
|
283
|
+
preferredMimeTypeChange(mimeType: string): void {
|
|
284
|
+
this.containerElement.remove();
|
|
285
|
+
this.createHtmlElement();
|
|
286
|
+
this.cell.element.appendChild(this.containerElement);
|
|
287
|
+
renderers.render(this.cell, this, mimeType, undefined, new AbortController().signal);
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
private createHtmlElement(): void {
|
|
291
|
+
this.containerElement = document.createElement('div');
|
|
292
|
+
this.containerElement.classList.add('output-container');
|
|
184
293
|
this.element = document.createElement('div');
|
|
185
|
-
this.element.id =
|
|
294
|
+
this.element.id = this.outputId;
|
|
186
295
|
this.element.classList.add('output');
|
|
187
|
-
|
|
188
|
-
document.body.appendChild(this.container);
|
|
296
|
+
this.containerElement.appendChild(this.element);
|
|
189
297
|
}
|
|
190
|
-
}
|
|
191
298
|
|
|
192
|
-
|
|
299
|
+
}
|
|
193
300
|
|
|
194
301
|
class Renderer {
|
|
195
302
|
|
|
@@ -330,7 +437,8 @@ export async function outputWebviewPreload(ctx: PreloadContext): Promise<void> {
|
|
|
330
437
|
this.renderers.get(rendererId)?.disposeOutputItem(outputId);
|
|
331
438
|
}
|
|
332
439
|
|
|
333
|
-
public async render(
|
|
440
|
+
public async render(cell: OutputCell, output: OutputContainer, preferredMimeType: string | undefined,
|
|
441
|
+
preferredRendererId: string | undefined, signal: AbortSignal): Promise<void> {
|
|
334
442
|
const item = output.findItemToRender(preferredMimeType);
|
|
335
443
|
const primaryRenderer = this.findRenderer(preferredRendererId, item);
|
|
336
444
|
if (!primaryRenderer) {
|
|
@@ -341,7 +449,7 @@ export async function outputWebviewPreload(ctx: PreloadContext): Promise<void> {
|
|
|
341
449
|
// Try primary renderer first
|
|
342
450
|
if (!(await this.doRender(item, output.element, primaryRenderer, signal)).continue) {
|
|
343
451
|
output.renderer = primaryRenderer;
|
|
344
|
-
this.onRenderCompleted();
|
|
452
|
+
this.onRenderCompleted(cell, output);
|
|
345
453
|
return;
|
|
346
454
|
}
|
|
347
455
|
|
|
@@ -360,7 +468,7 @@ export async function outputWebviewPreload(ctx: PreloadContext): Promise<void> {
|
|
|
360
468
|
if (renderer) {
|
|
361
469
|
if (!(await this.doRender(additionalItem, output.element, renderer, signal)).continue) {
|
|
362
470
|
output.renderer = renderer;
|
|
363
|
-
this.onRenderCompleted();
|
|
471
|
+
this.onRenderCompleted(cell, output);
|
|
364
472
|
return; // We rendered successfully
|
|
365
473
|
}
|
|
366
474
|
}
|
|
@@ -371,28 +479,39 @@ export async function outputWebviewPreload(ctx: PreloadContext): Promise<void> {
|
|
|
371
479
|
this.showRenderError(item, output.element, 'No fallback renderers found or all fallback renderers failed.');
|
|
372
480
|
}
|
|
373
481
|
|
|
374
|
-
private onRenderCompleted(): void {
|
|
482
|
+
private onRenderCompleted(cell: OutputCell, output: OutputContainer): void {
|
|
375
483
|
// we need to check for all images are loaded. Otherwise we can't determine the correct height of the output
|
|
376
484
|
const images = Array.from(document.images);
|
|
377
485
|
if (images.length > 0) {
|
|
378
|
-
Promise.all(images
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
486
|
+
Promise.all(images
|
|
487
|
+
.filter(img => !img.complete && !img.dataset.waiting)
|
|
488
|
+
.map(img => {
|
|
489
|
+
img.dataset.waiting = 'true'; // mark to avoid overriding onload a second time
|
|
490
|
+
return new Promise(resolve => { img.onload = img.onerror = resolve; });
|
|
491
|
+
})).then(() => {
|
|
492
|
+
this.sendDidRenderMessage(cell, output);
|
|
493
|
+
new ResizeObserver(() => this.sendDidRenderMessage(cell, output)).observe(cell.element);
|
|
494
|
+
});
|
|
384
495
|
} else {
|
|
385
|
-
|
|
386
|
-
new ResizeObserver(() =>
|
|
387
|
-
theia.postMessage(<webviewCommunication.OnDidRenderOutput>{ type: 'didRenderOutput', contentHeight: document.body.clientHeight }))
|
|
388
|
-
.observe(document.body);
|
|
496
|
+
this.sendDidRenderMessage(cell, output);
|
|
497
|
+
new ResizeObserver(() => this.sendDidRenderMessage(cell, output)).observe(cell.element);
|
|
389
498
|
}
|
|
390
499
|
|
|
391
500
|
}
|
|
392
501
|
|
|
502
|
+
private sendDidRenderMessage(cell: OutputCell, output: OutputContainer): void {
|
|
503
|
+
theia.postMessage(<webviewCommunication.OnDidRenderOutput>{
|
|
504
|
+
type: 'didRenderOutput',
|
|
505
|
+
cellHandle: cell.cellHandle,
|
|
506
|
+
outputId: output.outputId,
|
|
507
|
+
outputHeight: cell.calcTotalOutputHeight(),
|
|
508
|
+
bodyHeight: document.body.clientHeight
|
|
509
|
+
});
|
|
510
|
+
}
|
|
511
|
+
|
|
393
512
|
private async doRender(item: rendererApi.OutputItem, element: HTMLElement, renderer: Renderer, signal: AbortSignal): Promise<{ continue: boolean }> {
|
|
394
513
|
try {
|
|
395
|
-
(await renderer.getOrLoad())?.renderOutputItem(item, element, signal);
|
|
514
|
+
await (await renderer.getOrLoad())?.renderOutputItem(item, element, signal);
|
|
396
515
|
return { continue: false }; // We rendered successfully
|
|
397
516
|
} catch (e) {
|
|
398
517
|
if (signal.aborted) {
|
|
@@ -482,40 +601,66 @@ export async function outputWebviewPreload(ctx: PreloadContext): Promise<void> {
|
|
|
482
601
|
|
|
483
602
|
await Promise.all(ctx.staticPreloadsData.map(preload => kernelPreloads.load(preload)));
|
|
484
603
|
|
|
485
|
-
function
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
604
|
+
async function outputsChanged(changedEvent: webviewCommunication.OutputChangedMessage): Promise<void> {
|
|
605
|
+
for (const cellChange of changedEvent.changes) {
|
|
606
|
+
let cell = cells.find(c => c.cellHandle === cellChange.cellHandle);
|
|
607
|
+
if (!cell) {
|
|
608
|
+
cell = new OutputCell(cellChange.cellHandle);
|
|
609
|
+
cells.push(cell);
|
|
610
|
+
}
|
|
489
611
|
|
|
490
|
-
|
|
491
|
-
for (const output of outputs.splice(changedEvent.deleteStart ?? 0, changedEvent.deleteCount ?? 0)) {
|
|
492
|
-
clearOutput(output);
|
|
493
|
-
}
|
|
612
|
+
cell.clearOutputs(cellChange.start, cellChange.deleteCount);
|
|
494
613
|
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
614
|
+
for (const outputData of cellChange.newOutputs ?? []) {
|
|
615
|
+
const apiItems: rendererApi.OutputItem[] = outputData.items.map((item, index) => ({
|
|
616
|
+
id: `${outputData.id}-${index}`,
|
|
617
|
+
mime: item.mime,
|
|
618
|
+
metadata: outputData.metadata,
|
|
619
|
+
data(): Uint8Array {
|
|
620
|
+
return item.data;
|
|
621
|
+
},
|
|
622
|
+
text(): string {
|
|
623
|
+
return new TextDecoder().decode(this.data());
|
|
624
|
+
},
|
|
625
|
+
json(): unknown {
|
|
626
|
+
return JSON.parse(this.text());
|
|
627
|
+
},
|
|
628
|
+
blob(): Blob {
|
|
629
|
+
return new Blob([this.data()], { type: this.mime });
|
|
630
|
+
},
|
|
631
|
+
|
|
632
|
+
}));
|
|
633
|
+
const output = cell.createOutputElement(cellChange.start, outputData, apiItems);
|
|
512
634
|
|
|
513
|
-
|
|
635
|
+
await renderers.render(cell, output, undefined, undefined, new AbortController().signal);
|
|
514
636
|
|
|
515
|
-
|
|
516
|
-
|
|
637
|
+
theia.postMessage(<webviewCommunication.OnDidRenderOutput>{
|
|
638
|
+
type: 'didRenderOutput',
|
|
639
|
+
cellHandle: cell.cellHandle,
|
|
640
|
+
outputId: outputData.id,
|
|
641
|
+
outputHeight: document.getElementById(output.outputId)?.clientHeight ?? 0,
|
|
642
|
+
bodyHeight: document.body.clientHeight
|
|
643
|
+
});
|
|
644
|
+
|
|
645
|
+
}
|
|
646
|
+
}
|
|
647
|
+
}
|
|
517
648
|
|
|
518
|
-
|
|
649
|
+
function cellsChanged(changes: (webviewCommunication.CellsMoved | webviewCommunication.CellsSpliced)[]): void {
|
|
650
|
+
for (const change of changes) {
|
|
651
|
+
if (change.type === 'cellMoved') {
|
|
652
|
+
const currentIndex = cells.findIndex(c => c.cellHandle === change.cellHandle);
|
|
653
|
+
const cell = cells[currentIndex];
|
|
654
|
+
cells.splice(change.toIndex, 0, cells.splice(currentIndex, 1)[0]);
|
|
655
|
+
if (change.toIndex < cells.length - 1) {
|
|
656
|
+
container.insertBefore(cell.element, container.children[change.toIndex + (change.toIndex > currentIndex ? 1 : 0)]);
|
|
657
|
+
} else {
|
|
658
|
+
container.appendChild(cell.element);
|
|
659
|
+
}
|
|
660
|
+
} else if (change.type === 'cellsSpliced') {
|
|
661
|
+
const deltedCells = cells.splice(change.start, change.deleteCount, ...change.newCells.map((cellHandle, i) => new OutputCell(cellHandle, change.start + i)));
|
|
662
|
+
deltedCells.forEach(cell => cell.dispose());
|
|
663
|
+
}
|
|
519
664
|
}
|
|
520
665
|
}
|
|
521
666
|
|
|
@@ -565,6 +710,7 @@ export async function outputWebviewPreload(ctx: PreloadContext): Promise<void> {
|
|
|
565
710
|
|
|
566
711
|
window.addEventListener('message', async rawEvent => {
|
|
567
712
|
const event = rawEvent as ({ data: webviewCommunication.ToWebviewMessage });
|
|
713
|
+
let cellHandle: number | undefined;
|
|
568
714
|
switch (event.data.type) {
|
|
569
715
|
case 'updateRenderers':
|
|
570
716
|
renderers.updateRendererData(event.data.rendererData);
|
|
@@ -572,27 +718,28 @@ export async function outputWebviewPreload(ctx: PreloadContext): Promise<void> {
|
|
|
572
718
|
case 'outputChanged':
|
|
573
719
|
outputsChanged(event.data);
|
|
574
720
|
break;
|
|
721
|
+
case 'cellsChanged':
|
|
722
|
+
cellsChanged(event.data.changes);
|
|
723
|
+
break;
|
|
575
724
|
case 'customRendererMessage':
|
|
576
725
|
renderers.getRenderer(event.data.rendererId)?.receiveMessage(event.data.message);
|
|
577
726
|
break;
|
|
578
727
|
case 'changePreferredMimetype':
|
|
728
|
+
cellHandle = event.data.cellHandle;
|
|
579
729
|
const mimeType = event.data.mimeType;
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
renderers.render(output, mimeType, undefined, new AbortController().signal);
|
|
583
|
-
});
|
|
730
|
+
cells.find(c => c.cellHandle === cellHandle)
|
|
731
|
+
?.outputElements.forEach(o => o.preferredMimeTypeChange(mimeType));
|
|
584
732
|
break;
|
|
585
733
|
case 'customKernelMessage':
|
|
586
734
|
onDidReceiveKernelMessage.fire(event.data.message);
|
|
587
735
|
break;
|
|
588
|
-
case 'preload':
|
|
736
|
+
case 'preload':
|
|
589
737
|
const resources = event.data.resources;
|
|
590
738
|
for (const uri of resources) {
|
|
591
739
|
kernelPreloads.load(uri);
|
|
592
740
|
}
|
|
593
741
|
break;
|
|
594
|
-
|
|
595
|
-
case 'notebookStyles': {
|
|
742
|
+
case 'notebookStyles':
|
|
596
743
|
const documentStyle = window.document.documentElement.style;
|
|
597
744
|
|
|
598
745
|
for (let i = documentStyle.length - 1; i >= 0; i--) {
|
|
@@ -609,7 +756,17 @@ export async function outputWebviewPreload(ctx: PreloadContext): Promise<void> {
|
|
|
609
756
|
documentStyle.setProperty(`--${name}`, value);
|
|
610
757
|
}
|
|
611
758
|
break;
|
|
612
|
-
|
|
759
|
+
case 'cellHeightUpdate':
|
|
760
|
+
cellHandle = event.data.cellHandle;
|
|
761
|
+
const cell = cells.find(c => c.cellHandle === cellHandle);
|
|
762
|
+
if (cell) {
|
|
763
|
+
cell.updateCellHeight(event.data.cellKind, event.data.height);
|
|
764
|
+
}
|
|
765
|
+
break;
|
|
766
|
+
case 'outputVisibilityChanged':
|
|
767
|
+
cellHandle = event.data.cellHandle;
|
|
768
|
+
cells.find(c => c.cellHandle === cellHandle)?.outputVisibilityChanged(event.data.visible);
|
|
769
|
+
break;
|
|
613
770
|
}
|
|
614
771
|
});
|
|
615
772
|
window.addEventListener('wheel', handleWheel);
|
|
@@ -632,5 +789,12 @@ export async function outputWebviewPreload(ctx: PreloadContext): Promise<void> {
|
|
|
632
789
|
|
|
633
790
|
window.addEventListener('focusout', (event: FocusEvent) => focusChange(event, false));
|
|
634
791
|
|
|
792
|
+
new ResizeObserver(() => {
|
|
793
|
+
theia.postMessage({
|
|
794
|
+
type: 'bodyHeightChange',
|
|
795
|
+
height: document.body.clientHeight
|
|
796
|
+
} as webviewCommunication.BodyHeightChange);
|
|
797
|
+
}).observe(document.body);
|
|
798
|
+
|
|
635
799
|
theia.postMessage(<webviewCommunication.WebviewInitialized>{ type: 'initialized' });
|
|
636
800
|
}
|
|
@@ -36,15 +36,21 @@ export interface UpdateRenderersMessage {
|
|
|
36
36
|
readonly rendererData: readonly RendererMetadata[];
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
+
export interface CellOutputChange {
|
|
40
|
+
readonly cellHandle: number;
|
|
41
|
+
readonly newOutputs?: Output[];
|
|
42
|
+
readonly start: number;
|
|
43
|
+
readonly deleteCount: number;
|
|
44
|
+
}
|
|
45
|
+
|
|
39
46
|
export interface OutputChangedMessage {
|
|
40
47
|
readonly type: 'outputChanged';
|
|
41
|
-
|
|
42
|
-
readonly deleteStart?: number;
|
|
43
|
-
readonly deleteCount?: number;
|
|
48
|
+
changes: CellOutputChange[];
|
|
44
49
|
}
|
|
45
50
|
|
|
46
51
|
export interface ChangePreferredMimetypeMessage {
|
|
47
52
|
readonly type: 'changePreferredMimetype';
|
|
53
|
+
readonly cellHandle: number;
|
|
48
54
|
readonly outputId: string;
|
|
49
55
|
readonly mimeType: string;
|
|
50
56
|
}
|
|
@@ -64,13 +70,53 @@ export interface notebookStylesMessage {
|
|
|
64
70
|
styles: Record<string, string>;
|
|
65
71
|
}
|
|
66
72
|
|
|
73
|
+
export interface CellHeigthsMessage {
|
|
74
|
+
type: 'cellHeigths';
|
|
75
|
+
cellHeigths: Record<number, number>;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export interface CellsMoved {
|
|
79
|
+
type: 'cellMoved';
|
|
80
|
+
cellHandle: number;
|
|
81
|
+
toIndex: number;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export interface CellsSpliced {
|
|
85
|
+
type: 'cellsSpliced';
|
|
86
|
+
start: number;
|
|
87
|
+
deleteCount: number;
|
|
88
|
+
newCells: number[];
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export interface CellsChangedMessage {
|
|
92
|
+
type: 'cellsChanged';
|
|
93
|
+
changes: Array<CellsMoved | CellsSpliced>;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export interface CellHeightUpdateMessage {
|
|
97
|
+
type: 'cellHeightUpdate';
|
|
98
|
+
cellKind: number;
|
|
99
|
+
cellHandle: number;
|
|
100
|
+
height: number;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
export interface OutputVisibilityChangedMessage {
|
|
104
|
+
type: 'outputVisibilityChanged';
|
|
105
|
+
cellHandle: number;
|
|
106
|
+
visible: boolean;
|
|
107
|
+
}
|
|
108
|
+
|
|
67
109
|
export type ToWebviewMessage = UpdateRenderersMessage
|
|
68
110
|
| OutputChangedMessage
|
|
69
111
|
| ChangePreferredMimetypeMessage
|
|
70
112
|
| CustomRendererMessage
|
|
71
113
|
| KernelMessage
|
|
72
114
|
| PreloadMessage
|
|
73
|
-
| notebookStylesMessage
|
|
115
|
+
| notebookStylesMessage
|
|
116
|
+
| CellHeigthsMessage
|
|
117
|
+
| CellHeightUpdateMessage
|
|
118
|
+
| CellsChangedMessage
|
|
119
|
+
| OutputVisibilityChangedMessage;
|
|
74
120
|
|
|
75
121
|
export interface WebviewInitialized {
|
|
76
122
|
readonly type: 'initialized';
|
|
@@ -78,7 +124,10 @@ export interface WebviewInitialized {
|
|
|
78
124
|
|
|
79
125
|
export interface OnDidRenderOutput {
|
|
80
126
|
readonly type: 'didRenderOutput';
|
|
81
|
-
|
|
127
|
+
cellHandle: number;
|
|
128
|
+
outputId: string;
|
|
129
|
+
outputHeight: number;
|
|
130
|
+
bodyHeight: number;
|
|
82
131
|
}
|
|
83
132
|
|
|
84
133
|
export interface WheelMessage {
|
|
@@ -92,7 +141,30 @@ export interface InputFocusChange {
|
|
|
92
141
|
readonly focused: boolean;
|
|
93
142
|
}
|
|
94
143
|
|
|
95
|
-
export
|
|
144
|
+
export interface CellOuputFocus {
|
|
145
|
+
readonly type: 'cellFocusChanged';
|
|
146
|
+
readonly cellHandle: number;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
export interface CellHeightRequest {
|
|
150
|
+
readonly type: 'cellHeightRequest';
|
|
151
|
+
readonly cellHandle: number;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
export interface BodyHeightChange {
|
|
155
|
+
readonly type: 'bodyHeightChange';
|
|
156
|
+
readonly height: number;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
export type FromWebviewMessage = WebviewInitialized
|
|
160
|
+
| OnDidRenderOutput
|
|
161
|
+
| WheelMessage
|
|
162
|
+
| CustomRendererMessage
|
|
163
|
+
| KernelMessage
|
|
164
|
+
| InputFocusChange
|
|
165
|
+
| CellOuputFocus
|
|
166
|
+
| CellHeightRequest
|
|
167
|
+
| BodyHeightChange;
|
|
96
168
|
|
|
97
169
|
export interface Output {
|
|
98
170
|
id: string
|
|
@@ -104,4 +176,3 @@ export interface OutputItem {
|
|
|
104
176
|
readonly mime: string;
|
|
105
177
|
readonly data: Uint8Array;
|
|
106
178
|
}
|
|
107
|
-
|
|
@@ -22,7 +22,9 @@ import { ContainerModule } from '@theia/core/shared/inversify';
|
|
|
22
22
|
import {
|
|
23
23
|
FrontendApplicationContribution, WidgetFactory, bindViewContribution,
|
|
24
24
|
ViewContainerIdentifier, ViewContainer, createTreeContainer, TreeWidget, LabelProviderContribution, LabelProvider,
|
|
25
|
-
UndoRedoHandler, DiffUris, Navigatable, SplitWidget
|
|
25
|
+
UndoRedoHandler, DiffUris, Navigatable, SplitWidget,
|
|
26
|
+
noopWidgetStatusBarContribution,
|
|
27
|
+
WidgetStatusBarContribution
|
|
26
28
|
} from '@theia/core/lib/browser';
|
|
27
29
|
import { MaybePromise, CommandContribution, ResourceResolver, bindContributionProvider, URI, generateUuid } from '@theia/core/lib/common';
|
|
28
30
|
import { WebSocketConnectionProvider } from '@theia/core/lib/browser/messaging';
|
|
@@ -86,8 +88,6 @@ import { LanguagePackService, languagePackServicePath } from '../../common/langu
|
|
|
86
88
|
import { TabBarToolbarContribution } from '@theia/core/lib/browser/shell/tab-bar-toolbar';
|
|
87
89
|
import { CellOutputWebviewFactory } from '@theia/notebook/lib/browser';
|
|
88
90
|
import { CellOutputWebviewImpl, createCellOutputWebviewContainer } from './notebooks/renderers/cell-output-webview';
|
|
89
|
-
import { NotebookCellModel } from '@theia/notebook/lib/browser/view-model/notebook-cell-model';
|
|
90
|
-
import { NotebookModel } from '@theia/notebook/lib/browser/view-model/notebook-model';
|
|
91
91
|
import { ArgumentProcessorContribution } from './command-registry-main';
|
|
92
92
|
import { WebviewSecondaryWindowSupport } from './webview/webview-secondary-window-support';
|
|
93
93
|
import { CustomEditorUndoRedoHandler } from './custom-editors/custom-editor-undo-redo-handler';
|
|
@@ -191,6 +191,7 @@ export default new ContainerModule((bind, unbind, isBound, rebind) => {
|
|
|
191
191
|
bind(WebviewSecondaryWindowSupport).toSelf().inSingletonScope();
|
|
192
192
|
bind(FrontendApplicationContribution).toService(WebviewSecondaryWindowSupport);
|
|
193
193
|
bind(FrontendApplicationContribution).toService(WebviewContextKeys);
|
|
194
|
+
bind(WidgetStatusBarContribution).toConstantValue(noopWidgetStatusBarContribution(WebviewWidget));
|
|
194
195
|
|
|
195
196
|
bind(PluginCustomEditorRegistry).toSelf().inSingletonScope();
|
|
196
197
|
bind(CustomEditorService).toSelf().inSingletonScope();
|
|
@@ -283,8 +284,8 @@ export default new ContainerModule((bind, unbind, isBound, rebind) => {
|
|
|
283
284
|
return provider.createProxy<LanguagePackService>(languagePackServicePath);
|
|
284
285
|
}).inSingletonScope();
|
|
285
286
|
|
|
286
|
-
bind(CellOutputWebviewFactory).toFactory(ctx =>
|
|
287
|
-
createCellOutputWebviewContainer(ctx.container
|
|
287
|
+
bind(CellOutputWebviewFactory).toFactory(ctx => () =>
|
|
288
|
+
createCellOutputWebviewContainer(ctx.container).get(CellOutputWebviewImpl)
|
|
288
289
|
);
|
|
289
290
|
bindContributionProvider(bind, ArgumentProcessorContribution);
|
|
290
291
|
|
|
@@ -231,9 +231,13 @@ export class TabsMainImpl implements TabsMain, Disposable {
|
|
|
231
231
|
return { kind: TabInputKind.UnknownInput };
|
|
232
232
|
}
|
|
233
233
|
|
|
234
|
-
protected connectToSignal<T>(disposableList: DisposableCollection,
|
|
234
|
+
protected connectToSignal<T>(disposableList: DisposableCollection,
|
|
235
|
+
signal: {
|
|
236
|
+
connect(listener: T, context: unknown): void,
|
|
237
|
+
disconnect(listener: T, context: unknown): void
|
|
238
|
+
}, listener: T): void {
|
|
235
239
|
signal.connect(listener, this);
|
|
236
|
-
disposableList.push(Disposable.create(() => signal.disconnect(listener)));
|
|
240
|
+
disposableList.push(Disposable.create(() => signal.disconnect(listener, this)));
|
|
237
241
|
}
|
|
238
242
|
|
|
239
243
|
protected tabDtosEqual(a: TabDto, b: TabDto): boolean {
|
|
@@ -27,7 +27,10 @@ import { CancellationToken, Disposable, Event, URI } from '@theia/core';
|
|
|
27
27
|
import { MAIN_RPC_CONTEXT, TestControllerUpdate, TestingExt, TestingMain } from '../../common';
|
|
28
28
|
import { RPCProtocol } from '../../common/rpc-protocol';
|
|
29
29
|
import { interfaces } from '@theia/core/shared/inversify';
|
|
30
|
-
import {
|
|
30
|
+
import {
|
|
31
|
+
TestExecutionState, TestItemDTO, TestItemReference, TestOutputDTO,
|
|
32
|
+
TestRunDTO, TestRunProfileDTO, TestStateChangeDTO
|
|
33
|
+
} from '../../common/test-types';
|
|
31
34
|
import { TestRunProfileKind } from '../../plugin/types-impl';
|
|
32
35
|
import { CommandRegistryMainImpl } from './command-registry-main';
|
|
33
36
|
|