@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
|
@@ -19,34 +19,33 @@
|
|
|
19
19
|
*--------------------------------------------------------------------------------------------*/
|
|
20
20
|
|
|
21
21
|
import * as React from '@theia/core/shared/react';
|
|
22
|
-
import { inject, injectable, interfaces
|
|
22
|
+
import { inject, injectable, interfaces } from '@theia/core/shared/inversify';
|
|
23
23
|
import { generateUuid } from '@theia/core/lib/common/uuid';
|
|
24
24
|
import {
|
|
25
25
|
NotebookRendererMessagingService, CellOutputWebview, NotebookRendererRegistry,
|
|
26
|
-
NotebookEditorWidgetService,
|
|
26
|
+
NotebookEditorWidgetService, NotebookKernelService, NotebookEditorWidget,
|
|
27
|
+
OutputRenderEvent,
|
|
28
|
+
NotebookCellOutputsSplice,
|
|
29
|
+
NotebookContentChangedEvent
|
|
27
30
|
} from '@theia/notebook/lib/browser';
|
|
28
|
-
import { NotebookCellModel } from '@theia/notebook/lib/browser/view-model/notebook-cell-model';
|
|
29
31
|
import { WebviewWidget } from '../../webview/webview';
|
|
30
32
|
import { Message, WidgetManager } from '@theia/core/lib/browser';
|
|
31
33
|
import { outputWebviewPreload, PreloadContext } from './output-webview-internal';
|
|
32
34
|
import { WorkspaceTrustService } from '@theia/workspace/lib/browser';
|
|
33
|
-
import { ChangePreferredMimetypeMessage, FromWebviewMessage, OutputChangedMessage } from './webview-communication';
|
|
34
|
-
import {
|
|
35
|
-
import { Disposable, DisposableCollection, nls, QuickPickService } from '@theia/core';
|
|
36
|
-
import { NotebookCellOutputModel } from '@theia/notebook/lib/browser/view-model/notebook-cell-output-model';
|
|
35
|
+
import { CellsChangedMessage, CellsMoved, CellsSpliced, ChangePreferredMimetypeMessage, FromWebviewMessage, OutputChangedMessage } from './webview-communication';
|
|
36
|
+
import { Disposable, DisposableCollection, Emitter, QuickPickService, nls } from '@theia/core';
|
|
37
37
|
import { NotebookModel } from '@theia/notebook/lib/browser/view-model/notebook-model';
|
|
38
38
|
import { NotebookOptionsService, NotebookOutputOptions } from '@theia/notebook/lib/browser/service/notebook-options';
|
|
39
|
+
import { NotebookCellModel } from '@theia/notebook/lib/browser/view-model/notebook-cell-model';
|
|
40
|
+
import { NotebookCellsChangeType } from '@theia/notebook/lib/common';
|
|
41
|
+
import { NotebookCellOutputModel } from '@theia/notebook/lib/browser/view-model/notebook-cell-output-model';
|
|
39
42
|
|
|
40
|
-
const CellModel = Symbol('CellModel');
|
|
41
|
-
const Notebook = Symbol('NotebookModel');
|
|
42
43
|
export const AdditionalNotebookCellOutputCss = Symbol('AdditionalNotebookCellOutputCss');
|
|
43
44
|
|
|
44
|
-
export function createCellOutputWebviewContainer(ctx: interfaces.Container
|
|
45
|
+
export function createCellOutputWebviewContainer(ctx: interfaces.Container): interfaces.Container {
|
|
45
46
|
const child = ctx.createChild();
|
|
46
|
-
child.bind(CellModel).toConstantValue(cell);
|
|
47
|
-
child.bind(Notebook).toConstantValue(notebook);
|
|
48
47
|
child.bind(AdditionalNotebookCellOutputCss).toConstantValue(DEFAULT_NOTEBOOK_OUTPUT_CSS);
|
|
49
|
-
child.bind(CellOutputWebviewImpl).toSelf()
|
|
48
|
+
child.bind(CellOutputWebviewImpl).toSelf();
|
|
50
49
|
return child;
|
|
51
50
|
}
|
|
52
51
|
|
|
@@ -191,18 +190,16 @@ tbody th {
|
|
|
191
190
|
}
|
|
192
191
|
`;
|
|
193
192
|
|
|
193
|
+
interface CellOutputUpdate extends NotebookCellOutputsSplice {
|
|
194
|
+
cellHandle: number
|
|
195
|
+
}
|
|
196
|
+
|
|
194
197
|
@injectable()
|
|
195
198
|
export class CellOutputWebviewImpl implements CellOutputWebview, Disposable {
|
|
196
199
|
|
|
197
200
|
@inject(NotebookRendererMessagingService)
|
|
198
201
|
protected readonly messagingService: NotebookRendererMessagingService;
|
|
199
202
|
|
|
200
|
-
@inject(CellModel)
|
|
201
|
-
protected readonly cell: NotebookCellModel;
|
|
202
|
-
|
|
203
|
-
@inject(Notebook)
|
|
204
|
-
protected readonly notebook: NotebookModel;
|
|
205
|
-
|
|
206
203
|
@inject(WidgetManager)
|
|
207
204
|
protected readonly widgetManager: WidgetManager;
|
|
208
205
|
|
|
@@ -227,36 +224,63 @@ export class CellOutputWebviewImpl implements CellOutputWebview, Disposable {
|
|
|
227
224
|
@inject(NotebookOptionsService)
|
|
228
225
|
protected readonly notebookOptionsService: NotebookOptionsService;
|
|
229
226
|
|
|
227
|
+
// returns the output Height
|
|
228
|
+
protected readonly onDidRenderOutputEmitter = new Emitter<OutputRenderEvent>();
|
|
229
|
+
readonly onDidRenderOutput = this.onDidRenderOutputEmitter.event;
|
|
230
|
+
|
|
231
|
+
protected notebook: NotebookModel;
|
|
232
|
+
|
|
230
233
|
protected options: NotebookOutputOptions;
|
|
231
234
|
|
|
232
235
|
readonly id = generateUuid();
|
|
233
236
|
|
|
234
237
|
protected editor: NotebookEditorWidget | undefined;
|
|
235
238
|
|
|
236
|
-
protected
|
|
237
|
-
protected outputPresentationListeners: DisposableCollection = new DisposableCollection();
|
|
239
|
+
protected element?: HTMLDivElement; // React.createRef<HTMLDivElement>();
|
|
238
240
|
|
|
239
241
|
protected webviewWidget: WebviewWidget;
|
|
240
242
|
|
|
241
243
|
protected toDispose = new DisposableCollection();
|
|
242
244
|
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
245
|
+
protected isDisposed = false;
|
|
246
|
+
|
|
247
|
+
async init(notebook: NotebookModel, editor: NotebookEditorWidget): Promise<void> {
|
|
248
|
+
this.notebook = notebook;
|
|
249
|
+
this.editor = editor;
|
|
246
250
|
this.options = this.notebookOptionsService.computeOutputOptions();
|
|
247
251
|
this.toDispose.push(this.notebookOptionsService.onDidChangeOutputOptions(options => {
|
|
248
252
|
this.options = options;
|
|
249
253
|
this.updateStyles();
|
|
250
254
|
}));
|
|
251
255
|
|
|
252
|
-
this.
|
|
253
|
-
this.
|
|
254
|
-
|
|
255
|
-
|
|
256
|
+
this.webviewWidget = await this.widgetManager.getOrCreateWidget(WebviewWidget.FACTORY_ID, { id: this.id });
|
|
257
|
+
// this.webviewWidget.parent = this.editor ?? null;
|
|
258
|
+
this.webviewWidget.setContentOptions({
|
|
259
|
+
allowScripts: true,
|
|
260
|
+
// eslint-disable-next-line max-len
|
|
261
|
+
// list taken from https://github.com/microsoft/vscode/blob/a27099233b956dddc2536d4a0d714ab36266d897/src/vs/workbench/contrib/notebook/browser/view/renderers/backLayerWebView.ts#L762-L774
|
|
262
|
+
enableCommandUris: [
|
|
263
|
+
'github-issues.authNow',
|
|
264
|
+
'workbench.extensions.search',
|
|
265
|
+
'workbench.action.openSettings',
|
|
266
|
+
'_notebook.selectKernel',
|
|
267
|
+
'jupyter.viewOutput',
|
|
268
|
+
'workbench.action.openLargeOutput',
|
|
269
|
+
'cellOutput.enableScrolling',
|
|
270
|
+
],
|
|
271
|
+
});
|
|
272
|
+
this.webviewWidget.setHTML(await this.createWebviewContent());
|
|
273
|
+
|
|
274
|
+
this.notebook.onDidAddOrRemoveCell(e => {
|
|
275
|
+
if (e.newCellIds) {
|
|
276
|
+
const newCells = e.newCellIds.map(id => this.notebook.cells.find(cell => cell.handle === id)).filter(cell => !!cell) as NotebookCellModel[];
|
|
277
|
+
newCells.forEach(cell => this.attachCellAndOutputListeners(cell));
|
|
278
|
+
}
|
|
279
|
+
});
|
|
280
|
+
this.notebook.cells.forEach(cell => this.attachCellAndOutputListeners(cell));
|
|
256
281
|
|
|
257
282
|
if (this.editor) {
|
|
258
283
|
this.toDispose.push(this.editor.onDidPostKernelMessage(message => {
|
|
259
|
-
// console.log('from extension customKernelMessage ', JSON.stringify(message));
|
|
260
284
|
this.webviewWidget.sendMessage({
|
|
261
285
|
type: 'customKernelMessage',
|
|
262
286
|
message
|
|
@@ -264,7 +288,6 @@ export class CellOutputWebviewImpl implements CellOutputWebview, Disposable {
|
|
|
264
288
|
}));
|
|
265
289
|
|
|
266
290
|
this.toDispose.push(this.editor.onPostRendererMessage(messageObj => {
|
|
267
|
-
// console.log('from extension customRendererMessage ', JSON.stringify(messageObj));
|
|
268
291
|
this.webviewWidget.sendMessage({
|
|
269
292
|
type: 'customRendererMessage',
|
|
270
293
|
...messageObj
|
|
@@ -273,110 +296,184 @@ export class CellOutputWebviewImpl implements CellOutputWebview, Disposable {
|
|
|
273
296
|
|
|
274
297
|
}
|
|
275
298
|
|
|
276
|
-
this.webviewWidget = await this.widgetManager.getOrCreateWidget(WebviewWidget.FACTORY_ID, { id: this.id });
|
|
277
|
-
this.webviewWidget.parent = this.editor ?? null;
|
|
278
|
-
this.webviewWidget.setContentOptions({
|
|
279
|
-
allowScripts: true,
|
|
280
|
-
// eslint-disable-next-line max-len
|
|
281
|
-
// list taken from https://github.com/microsoft/vscode/blob/a27099233b956dddc2536d4a0d714ab36266d897/src/vs/workbench/contrib/notebook/browser/view/renderers/backLayerWebView.ts#L762-L774
|
|
282
|
-
enableCommandUris: [
|
|
283
|
-
'github-issues.authNow',
|
|
284
|
-
'workbench.extensions.search',
|
|
285
|
-
'workbench.action.openSettings',
|
|
286
|
-
'_notebook.selectKernel',
|
|
287
|
-
'jupyter.viewOutput',
|
|
288
|
-
'workbench.action.openLargeOutput',
|
|
289
|
-
'cellOutput.enableScrolling',
|
|
290
|
-
],
|
|
291
|
-
});
|
|
292
|
-
this.webviewWidget.setHTML(await this.createWebviewContent());
|
|
293
|
-
|
|
294
299
|
this.webviewWidget.onMessage((message: FromWebviewMessage) => {
|
|
295
300
|
this.handleWebviewMessage(message);
|
|
296
301
|
});
|
|
297
302
|
}
|
|
298
303
|
|
|
304
|
+
attachCellAndOutputListeners(cell: NotebookCellModel): void {
|
|
305
|
+
this.toDispose.push(cell.onDidChangeOutputs(outputChange => this.updateOutputs([{
|
|
306
|
+
newOutputs: outputChange.newOutputs,
|
|
307
|
+
start: outputChange.start,
|
|
308
|
+
deleteCount: outputChange.deleteCount,
|
|
309
|
+
cellHandle: cell.handle
|
|
310
|
+
}])));
|
|
311
|
+
this.toDispose.push(cell.onDidChangeOutputItems(output => {
|
|
312
|
+
const oldOutputIndex = cell.outputs.findIndex(o => o.outputId === output.outputId);
|
|
313
|
+
this.updateOutputs([{
|
|
314
|
+
cellHandle: cell.handle,
|
|
315
|
+
newOutputs: [output],
|
|
316
|
+
start: oldOutputIndex,
|
|
317
|
+
deleteCount: 1
|
|
318
|
+
}]);
|
|
319
|
+
}));
|
|
320
|
+
this.toDispose.push(cell.onDidCellHeightChange(height => this.setCellHeight(cell, height)));
|
|
321
|
+
this.toDispose.push(cell.onDidChangeOutputVisibility(visible => {
|
|
322
|
+
this.webviewWidget.sendMessage({
|
|
323
|
+
type: 'outputVisibilityChanged',
|
|
324
|
+
cellHandle: cell.handle,
|
|
325
|
+
visible
|
|
326
|
+
});
|
|
327
|
+
}));
|
|
328
|
+
}
|
|
329
|
+
|
|
299
330
|
render(): React.JSX.Element {
|
|
300
|
-
return <div className='theia-notebook-cell-output-webview' ref={
|
|
331
|
+
return <div className='theia-notebook-cell-output-webview' ref={element => {
|
|
332
|
+
if (element) {
|
|
333
|
+
this.element = element;
|
|
334
|
+
this.attachWebview();
|
|
335
|
+
}
|
|
336
|
+
}}></div>;
|
|
301
337
|
}
|
|
302
338
|
|
|
303
339
|
attachWebview(): void {
|
|
304
|
-
if (this.
|
|
340
|
+
if (this.element) {
|
|
305
341
|
this.webviewWidget.processMessage(new Message('before-attach'));
|
|
306
|
-
this.
|
|
342
|
+
this.element.appendChild(this.webviewWidget.node);
|
|
307
343
|
this.webviewWidget.processMessage(new Message('after-attach'));
|
|
308
344
|
this.webviewWidget.setIframeHeight(0);
|
|
309
345
|
}
|
|
310
346
|
}
|
|
311
347
|
|
|
312
348
|
isAttached(): boolean {
|
|
313
|
-
return this.
|
|
349
|
+
return this.element?.contains(this.webviewWidget.node) ?? false;
|
|
314
350
|
}
|
|
315
351
|
|
|
316
|
-
|
|
352
|
+
updateOutputs(updates: CellOutputUpdate[]): void {
|
|
317
353
|
if (this.webviewWidget.isHidden) {
|
|
318
354
|
this.webviewWidget.show();
|
|
319
355
|
}
|
|
320
356
|
|
|
321
|
-
this.outputPresentationListeners.dispose();
|
|
322
|
-
this.outputPresentationListeners = new DisposableCollection();
|
|
323
|
-
for (const output of this.cell.outputs) {
|
|
324
|
-
this.outputPresentationListeners.push(output.onRequestOutputPresentationChange(() => this.requestOutputPresentationUpdate(output)));
|
|
325
|
-
}
|
|
326
|
-
|
|
327
357
|
const updateOutputMessage: OutputChangedMessage = {
|
|
328
358
|
type: 'outputChanged',
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
359
|
+
changes: updates.map(update => ({
|
|
360
|
+
cellHandle: update.cellHandle,
|
|
361
|
+
newOutputs: update.newOutputs.map(output => ({
|
|
362
|
+
id: output.outputId,
|
|
363
|
+
items: output.outputs.map(item => ({ mime: item.mime, data: item.data.buffer })),
|
|
364
|
+
metadata: output.metadata
|
|
365
|
+
})),
|
|
366
|
+
start: update.start,
|
|
367
|
+
deleteCount: update.deleteCount
|
|
368
|
+
}))
|
|
336
369
|
};
|
|
337
370
|
|
|
338
371
|
this.webviewWidget.sendMessage(updateOutputMessage);
|
|
339
372
|
}
|
|
340
373
|
|
|
341
|
-
|
|
374
|
+
cellsChanged(cellEvents: NotebookContentChangedEvent[]): void {
|
|
375
|
+
const changes: Array<CellsMoved | CellsSpliced> = [];
|
|
376
|
+
|
|
377
|
+
for (const event of cellEvents) {
|
|
378
|
+
if (event.kind === NotebookCellsChangeType.Move) {
|
|
379
|
+
changes.push(...event.cells.map((cell, i) => ({
|
|
380
|
+
type: 'cellMoved',
|
|
381
|
+
cellHandle: event.cells[0].handle,
|
|
382
|
+
toIndex: event.newIdx + i,
|
|
383
|
+
} as CellsMoved)));
|
|
384
|
+
} else if (event.kind === NotebookCellsChangeType.ModelChange) {
|
|
385
|
+
changes.push(...event.changes.map(change => ({
|
|
386
|
+
type: 'cellsSpliced',
|
|
387
|
+
start: change.start,
|
|
388
|
+
deleteCount: change.deleteCount,
|
|
389
|
+
newCells: change.newItems.map(cell => cell.handle)
|
|
390
|
+
} as CellsSpliced)));
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
this.webviewWidget.sendMessage({
|
|
395
|
+
type: 'cellsChanged',
|
|
396
|
+
changes: changes.filter(e => e)
|
|
397
|
+
} as CellsChangedMessage);
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
setCellHeight(cell: NotebookCellModel, height: number): void {
|
|
401
|
+
if (!this.isDisposed) {
|
|
402
|
+
this.webviewWidget.sendMessage({
|
|
403
|
+
type: 'cellHeightUpdate',
|
|
404
|
+
cellHandle: cell.handle,
|
|
405
|
+
cellKind: cell.cellKind,
|
|
406
|
+
height
|
|
407
|
+
});
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
async requestOutputPresentationUpdate(cellHandle: number, output: NotebookCellOutputModel): Promise<void> {
|
|
342
412
|
const selectedMime = await this.quickPickService.show(
|
|
343
413
|
output.outputs.map(item => ({ label: item.mime })),
|
|
344
414
|
{ description: nls.localizeByDefault('Select mimetype to render for current output') });
|
|
345
415
|
if (selectedMime) {
|
|
346
416
|
this.webviewWidget.sendMessage({
|
|
347
417
|
type: 'changePreferredMimetype',
|
|
418
|
+
cellHandle,
|
|
348
419
|
outputId: output.outputId,
|
|
349
420
|
mimeType: selectedMime.label
|
|
350
421
|
} as ChangePreferredMimetypeMessage);
|
|
351
422
|
}
|
|
352
423
|
}
|
|
353
424
|
|
|
354
|
-
|
|
425
|
+
protected handleWebviewMessage(message: FromWebviewMessage): void {
|
|
355
426
|
if (!this.editor) {
|
|
356
427
|
throw new Error('No editor found for cell output webview');
|
|
357
428
|
}
|
|
358
429
|
|
|
359
430
|
switch (message.type) {
|
|
360
431
|
case 'initialized':
|
|
361
|
-
this.
|
|
432
|
+
this.updateOutputs(this.notebook.cells.map(cell => ({
|
|
433
|
+
cellHandle: cell.handle,
|
|
434
|
+
newOutputs: cell.outputs,
|
|
435
|
+
start: 0,
|
|
436
|
+
deleteCount: 0
|
|
437
|
+
})));
|
|
362
438
|
this.updateStyles();
|
|
363
439
|
break;
|
|
364
440
|
case 'customRendererMessage':
|
|
365
|
-
// console.log('from webview customRendererMessage ', message.rendererId, '', JSON.stringify(message.message));
|
|
366
441
|
this.messagingService.getScoped(this.editor.id).postMessage(message.rendererId, message.message);
|
|
367
442
|
break;
|
|
368
443
|
case 'didRenderOutput':
|
|
369
|
-
this.webviewWidget.setIframeHeight(message.
|
|
444
|
+
this.webviewWidget.setIframeHeight(message.bodyHeight);
|
|
445
|
+
this.onDidRenderOutputEmitter.fire({
|
|
446
|
+
cellHandle: message.cellHandle,
|
|
447
|
+
outputId: message.outputId,
|
|
448
|
+
outputHeight: message.outputHeight
|
|
449
|
+
});
|
|
370
450
|
break;
|
|
371
451
|
case 'did-scroll-wheel':
|
|
372
452
|
this.editor.node.getElementsByClassName('theia-notebook-viewport')[0].children[0].scrollBy(message.deltaX, message.deltaY);
|
|
373
453
|
break;
|
|
374
454
|
case 'customKernelMessage':
|
|
375
|
-
// console.log('from webview customKernelMessage ', JSON.stringify(message.message));
|
|
376
455
|
this.editor.recieveKernelMessage(message.message);
|
|
377
456
|
break;
|
|
378
457
|
case 'inputFocusChanged':
|
|
379
458
|
this.editor?.outputInputFocusChanged(message.focused);
|
|
459
|
+
break;
|
|
460
|
+
case 'cellFocusChanged':
|
|
461
|
+
const selectedCell = this.notebook.getCellByHandle(message.cellHandle);
|
|
462
|
+
if (selectedCell) {
|
|
463
|
+
this.notebook.setSelectedCell(selectedCell);
|
|
464
|
+
}
|
|
465
|
+
break;
|
|
466
|
+
case 'cellHeightRequest':
|
|
467
|
+
const cellHeight = this.notebook.getCellByHandle(message.cellHandle)?.cellHeight ?? 0;
|
|
468
|
+
this.webviewWidget.sendMessage({
|
|
469
|
+
type: 'cellHeightUpdate',
|
|
470
|
+
cellHandle: message.cellHandle,
|
|
471
|
+
height: cellHeight
|
|
472
|
+
});
|
|
473
|
+
break;
|
|
474
|
+
case 'bodyHeightChange':
|
|
475
|
+
this.webviewWidget.setIframeHeight(message.height);
|
|
476
|
+
break;
|
|
380
477
|
}
|
|
381
478
|
}
|
|
382
479
|
|
|
@@ -445,8 +542,7 @@ export class CellOutputWebviewImpl implements CellOutputWebview, Disposable {
|
|
|
445
542
|
}
|
|
446
543
|
|
|
447
544
|
dispose(): void {
|
|
545
|
+
this.isDisposed = true;
|
|
448
546
|
this.toDispose.dispose();
|
|
449
|
-
this.outputPresentationListeners.dispose();
|
|
450
|
-
this.webviewWidget.dispose();
|
|
451
547
|
}
|
|
452
548
|
}
|