@theia/notebook 1.53.0-next.5 → 1.53.0-next.55

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 (88) hide show
  1. package/README.md +30 -30
  2. package/lib/browser/contributions/notebook-actions-contribution.d.ts +1 -0
  3. package/lib/browser/contributions/notebook-actions-contribution.d.ts.map +1 -1
  4. package/lib/browser/contributions/notebook-actions-contribution.js +31 -5
  5. package/lib/browser/contributions/notebook-actions-contribution.js.map +1 -1
  6. package/lib/browser/contributions/notebook-cell-actions-contribution.d.ts +2 -0
  7. package/lib/browser/contributions/notebook-cell-actions-contribution.d.ts.map +1 -1
  8. package/lib/browser/contributions/notebook-cell-actions-contribution.js +41 -7
  9. package/lib/browser/contributions/notebook-cell-actions-contribution.js.map +1 -1
  10. package/lib/browser/contributions/notebook-status-bar-contribution.d.ts +14 -0
  11. package/lib/browser/contributions/notebook-status-bar-contribution.d.ts.map +1 -0
  12. package/lib/browser/contributions/notebook-status-bar-contribution.js +75 -0
  13. package/lib/browser/contributions/notebook-status-bar-contribution.js.map +1 -0
  14. package/lib/browser/notebook-editor-widget.d.ts.map +1 -1
  15. package/lib/browser/notebook-editor-widget.js +3 -5
  16. package/lib/browser/notebook-editor-widget.js.map +1 -1
  17. package/lib/browser/notebook-frontend-module.d.ts.map +1 -1
  18. package/lib/browser/notebook-frontend-module.js +3 -0
  19. package/lib/browser/notebook-frontend-module.js.map +1 -1
  20. package/lib/browser/notebook-open-handler.d.ts +3 -2
  21. package/lib/browser/notebook-open-handler.d.ts.map +1 -1
  22. package/lib/browser/notebook-open-handler.js +12 -5
  23. package/lib/browser/notebook-open-handler.js.map +1 -1
  24. package/lib/browser/view/notebook-cell-editor.d.ts +1 -0
  25. package/lib/browser/view/notebook-cell-editor.d.ts.map +1 -1
  26. package/lib/browser/view/notebook-cell-editor.js +30 -16
  27. package/lib/browser/view/notebook-cell-editor.js.map +1 -1
  28. package/lib/browser/view/notebook-cell-list-view.d.ts +6 -4
  29. package/lib/browser/view/notebook-cell-list-view.d.ts.map +1 -1
  30. package/lib/browser/view/notebook-cell-list-view.js +20 -13
  31. package/lib/browser/view/notebook-cell-list-view.js.map +1 -1
  32. package/lib/browser/view-model/notebook-cell-model.d.ts +3 -0
  33. package/lib/browser/view-model/notebook-cell-model.d.ts.map +1 -1
  34. package/lib/browser/view-model/notebook-cell-model.js +5 -0
  35. package/lib/browser/view-model/notebook-cell-model.js.map +1 -1
  36. package/package.json +8 -8
  37. package/src/browser/contributions/cell-operations.ts +44 -44
  38. package/src/browser/contributions/notebook-actions-contribution.ts +379 -350
  39. package/src/browser/contributions/notebook-cell-actions-contribution.ts +525 -487
  40. package/src/browser/contributions/notebook-color-contribution.ts +268 -268
  41. package/src/browser/contributions/notebook-context-keys.ts +113 -113
  42. package/src/browser/contributions/notebook-label-provider-contribution.ts +85 -85
  43. package/src/browser/contributions/notebook-outline-contribution.ts +114 -114
  44. package/src/browser/contributions/notebook-output-action-contribution.ts +82 -82
  45. package/src/browser/contributions/notebook-preferences.ts +92 -92
  46. package/src/browser/contributions/notebook-status-bar-contribution.ts +77 -0
  47. package/src/browser/contributions/notebook-undo-redo-handler.ts +41 -41
  48. package/src/browser/index.ts +27 -27
  49. package/src/browser/notebook-cell-resource-resolver.ts +130 -130
  50. package/src/browser/notebook-editor-widget-factory.ts +82 -82
  51. package/src/browser/notebook-editor-widget.tsx +330 -331
  52. package/src/browser/notebook-frontend-module.ts +119 -115
  53. package/src/browser/notebook-open-handler.ts +120 -114
  54. package/src/browser/notebook-output-utils.ts +119 -119
  55. package/src/browser/notebook-renderer-registry.ts +85 -85
  56. package/src/browser/notebook-type-registry.ts +54 -54
  57. package/src/browser/notebook-types.ts +186 -186
  58. package/src/browser/renderers/cell-output-webview.ts +33 -33
  59. package/src/browser/service/notebook-clipboard-service.ts +43 -43
  60. package/src/browser/service/notebook-context-manager.ts +162 -162
  61. package/src/browser/service/notebook-editor-widget-service.ts +101 -101
  62. package/src/browser/service/notebook-execution-service.ts +139 -139
  63. package/src/browser/service/notebook-execution-state-service.ts +311 -311
  64. package/src/browser/service/notebook-kernel-history-service.ts +124 -124
  65. package/src/browser/service/notebook-kernel-quick-pick-service.ts +479 -479
  66. package/src/browser/service/notebook-kernel-service.ts +357 -357
  67. package/src/browser/service/notebook-model-resolver-service.ts +160 -160
  68. package/src/browser/service/notebook-monaco-text-model-service.ts +48 -48
  69. package/src/browser/service/notebook-options.ts +155 -155
  70. package/src/browser/service/notebook-renderer-messaging-service.ts +121 -121
  71. package/src/browser/service/notebook-service.ts +215 -215
  72. package/src/browser/style/index.css +483 -471
  73. package/src/browser/view/notebook-cell-editor.tsx +263 -247
  74. package/src/browser/view/notebook-cell-list-view.tsx +279 -262
  75. package/src/browser/view/notebook-cell-toolbar-factory.tsx +102 -102
  76. package/src/browser/view/notebook-cell-toolbar.tsx +74 -74
  77. package/src/browser/view/notebook-code-cell-view.tsx +350 -350
  78. package/src/browser/view/notebook-find-widget.tsx +335 -335
  79. package/src/browser/view/notebook-main-toolbar.tsx +235 -235
  80. package/src/browser/view/notebook-markdown-cell-view.tsx +208 -208
  81. package/src/browser/view/notebook-viewport-service.ts +61 -61
  82. package/src/browser/view-model/notebook-cell-model.ts +473 -466
  83. package/src/browser/view-model/notebook-cell-output-model.ts +100 -100
  84. package/src/browser/view-model/notebook-model.ts +550 -550
  85. package/src/common/index.ts +18 -18
  86. package/src/common/notebook-common.ts +337 -337
  87. package/src/common/notebook-protocol.ts +35 -35
  88. package/src/common/notebook-range.ts +30 -30
@@ -1,186 +1,186 @@
1
- // *****************************************************************************
2
- // Copyright (C) 2023 TypeFox and others.
3
- //
4
- // This program and the accompanying materials are made available under the
5
- // terms of the Eclipse Public License v. 2.0 which is available at
6
- // http://www.eclipse.org/legal/epl-2.0.
7
- //
8
- // This Source Code may also be made available under the following Secondary
9
- // Licenses when the conditions for such availability set forth in the Eclipse
10
- // Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
- // with the GNU Classpath Exception which is available at
12
- // https://www.gnu.org/software/classpath/license.html.
13
- //
14
- // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
- // *****************************************************************************
16
-
17
- import {
18
- CellData, CellEditType, CellMetadataEdit, CellOutput, CellOutputItem, CellRange, NotebookCellContentChangeEvent,
19
- NotebookCellInternalMetadata,
20
- NotebookCellMetadata,
21
- NotebookCellsChangeInternalMetadataEvent,
22
- NotebookCellsChangeLanguageEvent,
23
- NotebookCellsChangeMetadataEvent,
24
- NotebookCellsChangeType, NotebookCellTextModelSplice, NotebookDocumentMetadata
25
- } from '../common';
26
- import { NotebookCell } from './view-model/notebook-cell-model';
27
-
28
- export interface NotebookTextModelChangedEvent {
29
- readonly rawEvents: NotebookContentChangedEvent[];
30
- // readonly versionId: number;
31
- readonly synchronous?: boolean;
32
- readonly endSelectionState?: SelectionState;
33
- };
34
-
35
- export type NotebookContentChangedEvent = (NotebookCellsInitializeEvent<NotebookCell> | NotebookDocumentChangeMetadataEvent | NotebookCellContentChangeEvent |
36
- NotebookCellsModelChangedEvent<NotebookCell> | NotebookCellsModelMoveEvent<NotebookCell> | NotebookOutputChangedEvent | NotebookOutputItemChangedEvent |
37
- NotebookCellsChangeLanguageEvent | NotebookCellsChangeMetadataEvent |
38
- NotebookCellsChangeInternalMetadataEvent | NotebookDocumentUnknownChangeEvent); // & { transient: boolean };
39
-
40
- export interface NotebookCellsInitializeEvent<T> {
41
- readonly kind: NotebookCellsChangeType.Initialize;
42
- readonly changes: NotebookCellTextModelSplice<T>[];
43
- }
44
-
45
- export interface NotebookDocumentChangeMetadataEvent {
46
- readonly kind: NotebookCellsChangeType.ChangeDocumentMetadata;
47
- readonly metadata: NotebookDocumentMetadata;
48
- }
49
-
50
- export interface NotebookCellsModelChangedEvent<T> {
51
- readonly kind: NotebookCellsChangeType.ModelChange;
52
- readonly changes: NotebookCellTextModelSplice<T>[];
53
- }
54
-
55
- export interface NotebookModelWillAddRemoveEvent {
56
- readonly rawEvent: NotebookCellsModelChangedEvent<CellData>;
57
- };
58
-
59
- export interface NotebookCellsModelMoveEvent<T> {
60
- readonly kind: NotebookCellsChangeType.Move;
61
- readonly index: number;
62
- readonly length: number;
63
- readonly newIdx: number;
64
- readonly cells: T[];
65
- }
66
-
67
- export interface NotebookOutputChangedEvent {
68
- readonly kind: NotebookCellsChangeType.Output;
69
- readonly index: number;
70
- readonly outputs: CellOutput[];
71
- readonly append: boolean;
72
- }
73
-
74
- export interface NotebookOutputItemChangedEvent {
75
- readonly kind: NotebookCellsChangeType.OutputItem;
76
- readonly index: number;
77
- readonly outputId: string;
78
- readonly outputItems: CellOutputItem[];
79
- readonly append: boolean;
80
- }
81
-
82
- export interface NotebookDocumentUnknownChangeEvent {
83
- readonly kind: NotebookCellsChangeType.Unknown;
84
- }
85
-
86
- export enum SelectionStateType {
87
- Handle = 0,
88
- Index = 1
89
- }
90
-
91
- export interface SelectionHandleState {
92
- kind: SelectionStateType.Handle;
93
- primary: number | null;
94
- selections: number[];
95
- }
96
-
97
- export interface SelectionIndexState {
98
- kind: SelectionStateType.Index;
99
- focus: CellRange;
100
- selections: CellRange[];
101
- }
102
-
103
- export type SelectionState = SelectionHandleState | SelectionIndexState;
104
-
105
- export interface NotebookModelWillAddRemoveEvent {
106
- readonly newCellIds?: number[];
107
- readonly rawEvent: NotebookCellsModelChangedEvent<CellData>;
108
- };
109
-
110
- export interface CellOutputEdit {
111
- editType: CellEditType.Output;
112
- index: number;
113
- outputs: CellOutput[];
114
- deleteCount?: number;
115
- append?: boolean;
116
- }
117
-
118
- export interface CellOutputEditByHandle {
119
- editType: CellEditType.Output;
120
- handle: number;
121
- outputs: CellOutput[];
122
- deleteCount?: number;
123
- append?: boolean;
124
- }
125
-
126
- export interface CellOutputItemEdit {
127
- editType: CellEditType.OutputItems;
128
- items: CellOutputItem[];
129
- outputId: string;
130
- append?: boolean;
131
- }
132
-
133
- export interface CellLanguageEdit {
134
- editType: CellEditType.CellLanguage;
135
- index: number;
136
- language: string;
137
- }
138
-
139
- export interface DocumentMetadataEdit {
140
- editType: CellEditType.DocumentMetadata;
141
- metadata: NotebookDocumentMetadata;
142
- }
143
-
144
- export interface CellMoveEdit {
145
- editType: CellEditType.Move;
146
- index: number;
147
- length: number;
148
- newIdx: number;
149
- }
150
-
151
- export interface CellReplaceEdit {
152
- editType: CellEditType.Replace;
153
- index: number;
154
- count: number;
155
- cells: CellData[];
156
- }
157
-
158
- export interface CellPartialMetadataEdit {
159
- editType: CellEditType.PartialMetadata;
160
- index: number;
161
- metadata: NullablePartialNotebookCellMetadata;
162
- }
163
-
164
- export type ImmediateCellEditOperation = CellOutputEditByHandle | CellOutputItemEdit | CellPartialInternalMetadataEditByHandle; // add more later on
165
- export type CellEditOperation = ImmediateCellEditOperation | CellReplaceEdit | CellOutputEdit |
166
- CellMetadataEdit | CellLanguageEdit | DocumentMetadataEdit | CellMoveEdit | CellPartialMetadataEdit; // add more later on
167
-
168
- export type NullablePartialNotebookCellInternalMetadata = {
169
- [Key in keyof Partial<NotebookCellInternalMetadata>]: NotebookCellInternalMetadata[Key] | null
170
- };
171
-
172
- export type NullablePartialNotebookCellMetadata = {
173
- [Key in keyof Partial<NotebookCellMetadata>]: NotebookCellMetadata[Key] | null
174
- };
175
-
176
- export interface CellPartialInternalMetadataEditByHandle {
177
- editType: CellEditType.PartialInternalMetadata;
178
- handle: number;
179
- internalMetadata: NullablePartialNotebookCellInternalMetadata;
180
- }
181
-
182
- export interface NotebookCellOutputsSplice {
183
- start: number;
184
- deleteCount: number;
185
- newOutputs: CellOutput[];
186
- };
1
+ // *****************************************************************************
2
+ // Copyright (C) 2023 TypeFox and others.
3
+ //
4
+ // This program and the accompanying materials are made available under the
5
+ // terms of the Eclipse Public License v. 2.0 which is available at
6
+ // http://www.eclipse.org/legal/epl-2.0.
7
+ //
8
+ // This Source Code may also be made available under the following Secondary
9
+ // Licenses when the conditions for such availability set forth in the Eclipse
10
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
+ // with the GNU Classpath Exception which is available at
12
+ // https://www.gnu.org/software/classpath/license.html.
13
+ //
14
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
+ // *****************************************************************************
16
+
17
+ import {
18
+ CellData, CellEditType, CellMetadataEdit, CellOutput, CellOutputItem, CellRange, NotebookCellContentChangeEvent,
19
+ NotebookCellInternalMetadata,
20
+ NotebookCellMetadata,
21
+ NotebookCellsChangeInternalMetadataEvent,
22
+ NotebookCellsChangeLanguageEvent,
23
+ NotebookCellsChangeMetadataEvent,
24
+ NotebookCellsChangeType, NotebookCellTextModelSplice, NotebookDocumentMetadata
25
+ } from '../common';
26
+ import { NotebookCell } from './view-model/notebook-cell-model';
27
+
28
+ export interface NotebookTextModelChangedEvent {
29
+ readonly rawEvents: NotebookContentChangedEvent[];
30
+ // readonly versionId: number;
31
+ readonly synchronous?: boolean;
32
+ readonly endSelectionState?: SelectionState;
33
+ };
34
+
35
+ export type NotebookContentChangedEvent = (NotebookCellsInitializeEvent<NotebookCell> | NotebookDocumentChangeMetadataEvent | NotebookCellContentChangeEvent |
36
+ NotebookCellsModelChangedEvent<NotebookCell> | NotebookCellsModelMoveEvent<NotebookCell> | NotebookOutputChangedEvent | NotebookOutputItemChangedEvent |
37
+ NotebookCellsChangeLanguageEvent | NotebookCellsChangeMetadataEvent |
38
+ NotebookCellsChangeInternalMetadataEvent | NotebookDocumentUnknownChangeEvent); // & { transient: boolean };
39
+
40
+ export interface NotebookCellsInitializeEvent<T> {
41
+ readonly kind: NotebookCellsChangeType.Initialize;
42
+ readonly changes: NotebookCellTextModelSplice<T>[];
43
+ }
44
+
45
+ export interface NotebookDocumentChangeMetadataEvent {
46
+ readonly kind: NotebookCellsChangeType.ChangeDocumentMetadata;
47
+ readonly metadata: NotebookDocumentMetadata;
48
+ }
49
+
50
+ export interface NotebookCellsModelChangedEvent<T> {
51
+ readonly kind: NotebookCellsChangeType.ModelChange;
52
+ readonly changes: NotebookCellTextModelSplice<T>[];
53
+ }
54
+
55
+ export interface NotebookModelWillAddRemoveEvent {
56
+ readonly rawEvent: NotebookCellsModelChangedEvent<CellData>;
57
+ };
58
+
59
+ export interface NotebookCellsModelMoveEvent<T> {
60
+ readonly kind: NotebookCellsChangeType.Move;
61
+ readonly index: number;
62
+ readonly length: number;
63
+ readonly newIdx: number;
64
+ readonly cells: T[];
65
+ }
66
+
67
+ export interface NotebookOutputChangedEvent {
68
+ readonly kind: NotebookCellsChangeType.Output;
69
+ readonly index: number;
70
+ readonly outputs: CellOutput[];
71
+ readonly append: boolean;
72
+ }
73
+
74
+ export interface NotebookOutputItemChangedEvent {
75
+ readonly kind: NotebookCellsChangeType.OutputItem;
76
+ readonly index: number;
77
+ readonly outputId: string;
78
+ readonly outputItems: CellOutputItem[];
79
+ readonly append: boolean;
80
+ }
81
+
82
+ export interface NotebookDocumentUnknownChangeEvent {
83
+ readonly kind: NotebookCellsChangeType.Unknown;
84
+ }
85
+
86
+ export enum SelectionStateType {
87
+ Handle = 0,
88
+ Index = 1
89
+ }
90
+
91
+ export interface SelectionHandleState {
92
+ kind: SelectionStateType.Handle;
93
+ primary: number | null;
94
+ selections: number[];
95
+ }
96
+
97
+ export interface SelectionIndexState {
98
+ kind: SelectionStateType.Index;
99
+ focus: CellRange;
100
+ selections: CellRange[];
101
+ }
102
+
103
+ export type SelectionState = SelectionHandleState | SelectionIndexState;
104
+
105
+ export interface NotebookModelWillAddRemoveEvent {
106
+ readonly newCellIds?: number[];
107
+ readonly rawEvent: NotebookCellsModelChangedEvent<CellData>;
108
+ };
109
+
110
+ export interface CellOutputEdit {
111
+ editType: CellEditType.Output;
112
+ index: number;
113
+ outputs: CellOutput[];
114
+ deleteCount?: number;
115
+ append?: boolean;
116
+ }
117
+
118
+ export interface CellOutputEditByHandle {
119
+ editType: CellEditType.Output;
120
+ handle: number;
121
+ outputs: CellOutput[];
122
+ deleteCount?: number;
123
+ append?: boolean;
124
+ }
125
+
126
+ export interface CellOutputItemEdit {
127
+ editType: CellEditType.OutputItems;
128
+ items: CellOutputItem[];
129
+ outputId: string;
130
+ append?: boolean;
131
+ }
132
+
133
+ export interface CellLanguageEdit {
134
+ editType: CellEditType.CellLanguage;
135
+ index: number;
136
+ language: string;
137
+ }
138
+
139
+ export interface DocumentMetadataEdit {
140
+ editType: CellEditType.DocumentMetadata;
141
+ metadata: NotebookDocumentMetadata;
142
+ }
143
+
144
+ export interface CellMoveEdit {
145
+ editType: CellEditType.Move;
146
+ index: number;
147
+ length: number;
148
+ newIdx: number;
149
+ }
150
+
151
+ export interface CellReplaceEdit {
152
+ editType: CellEditType.Replace;
153
+ index: number;
154
+ count: number;
155
+ cells: CellData[];
156
+ }
157
+
158
+ export interface CellPartialMetadataEdit {
159
+ editType: CellEditType.PartialMetadata;
160
+ index: number;
161
+ metadata: NullablePartialNotebookCellMetadata;
162
+ }
163
+
164
+ export type ImmediateCellEditOperation = CellOutputEditByHandle | CellOutputItemEdit | CellPartialInternalMetadataEditByHandle; // add more later on
165
+ export type CellEditOperation = ImmediateCellEditOperation | CellReplaceEdit | CellOutputEdit |
166
+ CellMetadataEdit | CellLanguageEdit | DocumentMetadataEdit | CellMoveEdit | CellPartialMetadataEdit; // add more later on
167
+
168
+ export type NullablePartialNotebookCellInternalMetadata = {
169
+ [Key in keyof Partial<NotebookCellInternalMetadata>]: NotebookCellInternalMetadata[Key] | null
170
+ };
171
+
172
+ export type NullablePartialNotebookCellMetadata = {
173
+ [Key in keyof Partial<NotebookCellMetadata>]: NotebookCellMetadata[Key] | null
174
+ };
175
+
176
+ export interface CellPartialInternalMetadataEditByHandle {
177
+ editType: CellEditType.PartialInternalMetadata;
178
+ handle: number;
179
+ internalMetadata: NullablePartialNotebookCellInternalMetadata;
180
+ }
181
+
182
+ export interface NotebookCellOutputsSplice {
183
+ start: number;
184
+ deleteCount: number;
185
+ newOutputs: CellOutput[];
186
+ };
@@ -1,33 +1,33 @@
1
- // *****************************************************************************
2
- // Copyright (C) 2023 TypeFox and others.
3
- //
4
- // This program and the accompanying materials are made available under the
5
- // terms of the Eclipse Public License v. 2.0 which is available at
6
- // http://www.eclipse.org/legal/epl-2.0.
7
- //
8
- // This Source Code may also be made available under the following Secondary
9
- // Licenses when the conditions for such availability set forth in the Eclipse
10
- // Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
- // with the GNU Classpath Exception which is available at
12
- // https://www.gnu.org/software/classpath/license.html.
13
- //
14
- // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
- // *****************************************************************************
16
-
17
- import { Disposable } from '@theia/core';
18
- import { NotebookCellModel } from '../view-model/notebook-cell-model';
19
- import { NotebookModel } from '../view-model/notebook-model';
20
-
21
- export const CellOutputWebviewFactory = Symbol('outputWebviewFactory');
22
-
23
- export type CellOutputWebviewFactory = (cell: NotebookCellModel, notebook: NotebookModel) => Promise<CellOutputWebview>;
24
-
25
- export interface CellOutputWebview extends Disposable {
26
-
27
- readonly id: string;
28
-
29
- render(): React.ReactNode;
30
-
31
- attachWebview(): void;
32
- isAttached(): boolean
33
- }
1
+ // *****************************************************************************
2
+ // Copyright (C) 2023 TypeFox and others.
3
+ //
4
+ // This program and the accompanying materials are made available under the
5
+ // terms of the Eclipse Public License v. 2.0 which is available at
6
+ // http://www.eclipse.org/legal/epl-2.0.
7
+ //
8
+ // This Source Code may also be made available under the following Secondary
9
+ // Licenses when the conditions for such availability set forth in the Eclipse
10
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
+ // with the GNU Classpath Exception which is available at
12
+ // https://www.gnu.org/software/classpath/license.html.
13
+ //
14
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
+ // *****************************************************************************
16
+
17
+ import { Disposable } from '@theia/core';
18
+ import { NotebookCellModel } from '../view-model/notebook-cell-model';
19
+ import { NotebookModel } from '../view-model/notebook-model';
20
+
21
+ export const CellOutputWebviewFactory = Symbol('outputWebviewFactory');
22
+
23
+ export type CellOutputWebviewFactory = (cell: NotebookCellModel, notebook: NotebookModel) => Promise<CellOutputWebview>;
24
+
25
+ export interface CellOutputWebview extends Disposable {
26
+
27
+ readonly id: string;
28
+
29
+ render(): React.ReactNode;
30
+
31
+ attachWebview(): void;
32
+ isAttached(): boolean
33
+ }
@@ -1,43 +1,43 @@
1
- // *****************************************************************************
2
- // Copyright (C) 2024 Typefox and others.
3
- //
4
- // This program and the accompanying materials are made available under the
5
- // terms of the Eclipse Public License v. 2.0 which is available at
6
- // http://www.eclipse.org/legal/epl-2.0.
7
- //
8
- // This Source Code may also be made available under the following Secondary
9
- // Licenses when the conditions for such availability set forth in the Eclipse
10
- // Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
- // with the GNU Classpath Exception which is available at
12
- // https://www.gnu.org/software/classpath/license.html.
13
- //
14
- // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
- // *****************************************************************************
16
-
17
- import { inject, injectable } from '@theia/core/shared/inversify';
18
- import { ClipboardService } from '@theia/core/lib/browser/clipboard-service';
19
- import { NotebookCellModel } from '../view-model/notebook-cell-model';
20
- import { environment } from '@theia/core';
21
- import { CellData } from '../../common';
22
-
23
- @injectable()
24
- export class NotebookClipboardService {
25
-
26
- protected copiedCell: CellData | undefined;
27
-
28
- @inject(ClipboardService)
29
- protected readonly clipboardService: ClipboardService;
30
-
31
- copyCell(cell: NotebookCellModel): void {
32
- this.copiedCell = cell.getData();
33
-
34
- if (environment.electron.is()) {
35
- this.clipboardService.writeText(cell.text);
36
- }
37
- }
38
-
39
- getCell(): CellData | undefined {
40
- return this.copiedCell;
41
- }
42
-
43
- }
1
+ // *****************************************************************************
2
+ // Copyright (C) 2024 Typefox and others.
3
+ //
4
+ // This program and the accompanying materials are made available under the
5
+ // terms of the Eclipse Public License v. 2.0 which is available at
6
+ // http://www.eclipse.org/legal/epl-2.0.
7
+ //
8
+ // This Source Code may also be made available under the following Secondary
9
+ // Licenses when the conditions for such availability set forth in the Eclipse
10
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
+ // with the GNU Classpath Exception which is available at
12
+ // https://www.gnu.org/software/classpath/license.html.
13
+ //
14
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
+ // *****************************************************************************
16
+
17
+ import { inject, injectable } from '@theia/core/shared/inversify';
18
+ import { ClipboardService } from '@theia/core/lib/browser/clipboard-service';
19
+ import { NotebookCellModel } from '../view-model/notebook-cell-model';
20
+ import { environment } from '@theia/core';
21
+ import { CellData } from '../../common';
22
+
23
+ @injectable()
24
+ export class NotebookClipboardService {
25
+
26
+ protected copiedCell: CellData | undefined;
27
+
28
+ @inject(ClipboardService)
29
+ protected readonly clipboardService: ClipboardService;
30
+
31
+ copyCell(cell: NotebookCellModel): void {
32
+ this.copiedCell = cell.getData();
33
+
34
+ if (environment.electron.is()) {
35
+ this.clipboardService.writeText(cell.text);
36
+ }
37
+ }
38
+
39
+ getCell(): CellData | undefined {
40
+ return this.copiedCell;
41
+ }
42
+
43
+ }