@theia/notebook 1.44.0 → 1.45.1
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/browser/contributions/notebook-actions-contribution.d.ts +2 -2
- package/lib/browser/contributions/notebook-actions-contribution.d.ts.map +1 -1
- package/lib/browser/contributions/notebook-actions-contribution.js +1 -1
- package/lib/browser/contributions/notebook-actions-contribution.js.map +1 -1
- package/lib/browser/index.d.ts +1 -0
- package/lib/browser/index.d.ts.map +1 -1
- package/lib/browser/index.js +1 -0
- package/lib/browser/index.js.map +1 -1
- package/lib/browser/notebook-editor-widget.d.ts +4 -1
- package/lib/browser/notebook-editor-widget.d.ts.map +1 -1
- package/lib/browser/notebook-editor-widget.js +9 -3
- package/lib/browser/notebook-editor-widget.js.map +1 -1
- package/lib/browser/notebook-frontend-module.js +1 -1
- package/lib/browser/notebook-frontend-module.js.map +1 -1
- package/lib/browser/notebook-output-utils.d.ts +13 -0
- package/lib/browser/notebook-output-utils.d.ts.map +1 -0
- package/lib/browser/notebook-output-utils.js +112 -0
- package/lib/browser/notebook-output-utils.js.map +1 -0
- package/lib/browser/notebook-types.d.ts +120 -0
- package/lib/browser/notebook-types.d.ts.map +1 -0
- package/lib/browser/notebook-types.js +28 -0
- package/lib/browser/notebook-types.js.map +1 -0
- package/lib/browser/service/notebook-cell-context-manager.d.ts +5 -4
- package/lib/browser/service/notebook-cell-context-manager.d.ts.map +1 -1
- package/lib/browser/service/notebook-cell-context-manager.js +15 -10
- package/lib/browser/service/notebook-cell-context-manager.js.map +1 -1
- package/lib/browser/service/notebook-editor-widget-service.d.ts +2 -5
- package/lib/browser/service/notebook-editor-widget-service.d.ts.map +1 -1
- package/lib/browser/service/notebook-editor-widget-service.js +12 -15
- package/lib/browser/service/notebook-editor-widget-service.js.map +1 -1
- package/lib/browser/service/notebook-execution-service.d.ts +3 -4
- package/lib/browser/service/notebook-execution-service.d.ts.map +1 -1
- package/lib/browser/service/notebook-execution-service.js +2 -12
- package/lib/browser/service/notebook-execution-service.js.map +1 -1
- package/lib/browser/service/notebook-execution-state-service.d.ts +2 -5
- package/lib/browser/service/notebook-execution-state-service.d.ts.map +1 -1
- package/lib/browser/service/notebook-execution-state-service.js.map +1 -1
- package/lib/browser/service/notebook-kernel-history-service.d.ts +4 -1
- package/lib/browser/service/notebook-kernel-history-service.d.ts.map +1 -1
- package/lib/browser/service/notebook-kernel-history-service.js +15 -0
- package/lib/browser/service/notebook-kernel-history-service.js.map +1 -1
- package/lib/browser/service/notebook-kernel-quick-pick-service.d.ts +5 -11
- package/lib/browser/service/notebook-kernel-quick-pick-service.d.ts.map +1 -1
- package/lib/browser/service/notebook-kernel-quick-pick-service.js +33 -48
- package/lib/browser/service/notebook-kernel-quick-pick-service.js.map +1 -1
- package/lib/browser/view/notebook-cell-editor.d.ts +1 -1
- package/lib/browser/view/notebook-cell-editor.d.ts.map +1 -1
- package/lib/browser/view/notebook-cell-editor.js +5 -5
- package/lib/browser/view/notebook-cell-editor.js.map +1 -1
- package/lib/browser/view/notebook-cell-list-view.d.ts.map +1 -1
- package/lib/browser/view/notebook-cell-list-view.js +9 -3
- package/lib/browser/view/notebook-cell-list-view.js.map +1 -1
- package/lib/browser/view/notebook-cell-toolbar-factory.d.ts +1 -0
- package/lib/browser/view/notebook-cell-toolbar-factory.d.ts.map +1 -1
- package/lib/browser/view/notebook-cell-toolbar-factory.js +2 -1
- package/lib/browser/view/notebook-cell-toolbar-factory.js.map +1 -1
- package/lib/browser/view/notebook-cell-toolbar.d.ts +5 -4
- package/lib/browser/view/notebook-cell-toolbar.d.ts.map +1 -1
- package/lib/browser/view/notebook-cell-toolbar.js +6 -4
- package/lib/browser/view/notebook-cell-toolbar.js.map +1 -1
- package/lib/browser/view/notebook-main-toolbar.d.ts.map +1 -1
- package/lib/browser/view/notebook-main-toolbar.js +8 -0
- package/lib/browser/view/notebook-main-toolbar.js.map +1 -1
- package/lib/browser/view-model/notebook-cell-model.d.ts +22 -2
- package/lib/browser/view-model/notebook-cell-model.d.ts.map +1 -1
- package/lib/browser/view-model/notebook-cell-model.js +5 -0
- package/lib/browser/view-model/notebook-cell-model.js.map +1 -1
- package/lib/browser/view-model/notebook-cell-output-model.d.ts.map +1 -1
- package/lib/browser/view-model/notebook-cell-output-model.js +4 -3
- package/lib/browser/view-model/notebook-cell-output-model.js.map +1 -1
- package/lib/browser/view-model/notebook-model.d.ts +9 -7
- package/lib/browser/view-model/notebook-model.d.ts.map +1 -1
- package/lib/browser/view-model/notebook-model.js +42 -36
- package/lib/browser/view-model/notebook-model.js.map +1 -1
- package/lib/common/notebook-common.d.ts +14 -146
- package/lib/common/notebook-common.d.ts.map +1 -1
- package/lib/common/notebook-common.js +13 -9
- package/lib/common/notebook-common.js.map +1 -1
- package/package.json +7 -7
- package/src/browser/contributions/notebook-actions-contribution.ts +2 -2
- package/src/browser/index.ts +1 -0
- package/src/browser/notebook-editor-widget.tsx +11 -5
- package/src/browser/notebook-frontend-module.ts +2 -2
- package/src/browser/notebook-output-utils.ts +119 -0
- package/src/browser/notebook-types.ts +172 -0
- package/src/browser/service/notebook-cell-context-manager.ts +17 -12
- package/src/browser/service/notebook-editor-widget-service.ts +14 -19
- package/src/browser/service/notebook-execution-service.ts +4 -16
- package/src/browser/service/notebook-execution-state-service.ts +2 -5
- package/src/browser/service/notebook-kernel-history-service.ts +18 -1
- package/src/browser/service/notebook-kernel-quick-pick-service.ts +29 -49
- package/src/browser/view/notebook-cell-editor.tsx +7 -5
- package/src/browser/view/notebook-cell-list-view.tsx +8 -3
- package/src/browser/view/notebook-cell-toolbar-factory.tsx +3 -1
- package/src/browser/view/notebook-cell-toolbar.tsx +8 -5
- package/src/browser/view/notebook-main-toolbar.tsx +9 -0
- package/src/browser/view-model/notebook-cell-model.ts +30 -3
- package/src/browser/view-model/notebook-cell-output-model.ts +6 -5
- package/src/browser/view-model/notebook-model.ts +52 -45
- package/src/common/notebook-common.ts +22 -181
|
@@ -14,11 +14,18 @@
|
|
|
14
14
|
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
15
|
// *****************************************************************************
|
|
16
16
|
|
|
17
|
-
import {
|
|
17
|
+
import { Command, URI, isObject } from '@theia/core';
|
|
18
18
|
import { MarkdownString } from '@theia/core/lib/common/markdown-rendering/markdown-string';
|
|
19
19
|
import { BinaryBuffer } from '@theia/core/lib/common/buffer';
|
|
20
20
|
import { UriComponents } from '@theia/core/lib/common/uri';
|
|
21
|
-
|
|
21
|
+
|
|
22
|
+
export interface NotebookCommand {
|
|
23
|
+
id: string;
|
|
24
|
+
title?: string;
|
|
25
|
+
tooltip?: string;
|
|
26
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
27
|
+
arguments?: any[];
|
|
28
|
+
}
|
|
22
29
|
|
|
23
30
|
export enum CellKind {
|
|
24
31
|
Markup = 1,
|
|
@@ -88,23 +95,6 @@ export interface NotebookCellCollapseState {
|
|
|
88
95
|
outputCollapsed?: boolean;
|
|
89
96
|
}
|
|
90
97
|
|
|
91
|
-
export interface NotebookCell {
|
|
92
|
-
readonly uri: URI;
|
|
93
|
-
handle: number;
|
|
94
|
-
language: string;
|
|
95
|
-
cellKind: CellKind;
|
|
96
|
-
outputs: CellOutput[];
|
|
97
|
-
metadata: NotebookCellMetadata;
|
|
98
|
-
internalMetadata: NotebookCellInternalMetadata;
|
|
99
|
-
text: string;
|
|
100
|
-
onDidChangeOutputs?: Event<NotebookCellOutputsSplice>;
|
|
101
|
-
onDidChangeOutputItems?: Event<CellOutput>;
|
|
102
|
-
onDidChangeLanguage: Event<string>;
|
|
103
|
-
onDidChangeMetadata: Event<void>;
|
|
104
|
-
onDidChangeInternalMetadata: Event<CellInternalMetadataChangedEvent>;
|
|
105
|
-
|
|
106
|
-
}
|
|
107
|
-
|
|
108
98
|
export interface CellData {
|
|
109
99
|
source: string;
|
|
110
100
|
language: string;
|
|
@@ -115,13 +105,6 @@ export interface CellData {
|
|
|
115
105
|
collapseState?: NotebookCellCollapseState;
|
|
116
106
|
}
|
|
117
107
|
|
|
118
|
-
export interface CellReplaceEdit {
|
|
119
|
-
editType: CellEditType.Replace;
|
|
120
|
-
index: number;
|
|
121
|
-
count: number;
|
|
122
|
-
cells: CellData[];
|
|
123
|
-
}
|
|
124
|
-
|
|
125
108
|
export interface NotebookDocumentMetadataEdit {
|
|
126
109
|
editType: CellEditType.DocumentMetadata;
|
|
127
110
|
metadata: NotebookDocumentMetadata;
|
|
@@ -140,32 +123,11 @@ export interface NotebookContributionData {
|
|
|
140
123
|
exclusive: boolean;
|
|
141
124
|
}
|
|
142
125
|
|
|
143
|
-
export interface
|
|
144
|
-
items: NotebookCellStatusBarItem[];
|
|
145
|
-
dispose?(): void;
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
export interface NotebookCellStatusBarItemProvider {
|
|
149
|
-
viewType: string;
|
|
150
|
-
onDidChangeStatusBarItems?: Event<void>;
|
|
151
|
-
provideCellStatusBarItems(uri: UriComponents, index: number, token: CancellationToken): Promise<NotebookCellStatusBarItemList | undefined>;
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
export interface NotebookCellOutputsSplice {
|
|
155
|
-
start: number /* start */;
|
|
156
|
-
deleteCount: number /* delete count */;
|
|
157
|
-
newOutputs: CellOutput[];
|
|
158
|
-
};
|
|
159
|
-
|
|
160
|
-
export interface CellInternalMetadataChangedEvent {
|
|
161
|
-
readonly lastRunSuccessChanged?: boolean;
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
export type NotebookCellTextModelSplice<T> = [
|
|
126
|
+
export interface NotebookCellTextModelSplice<T> {
|
|
165
127
|
start: number,
|
|
166
128
|
deleteCount: number,
|
|
167
129
|
newItems: T[]
|
|
168
|
-
|
|
130
|
+
};
|
|
169
131
|
|
|
170
132
|
export enum NotebookCellsChangeType {
|
|
171
133
|
ModelChange = 1,
|
|
@@ -182,69 +144,12 @@ export enum NotebookCellsChangeType {
|
|
|
182
144
|
Unknown = 100
|
|
183
145
|
}
|
|
184
146
|
|
|
185
|
-
export enum SelectionStateType {
|
|
186
|
-
Handle = 0,
|
|
187
|
-
Index = 1
|
|
188
|
-
}
|
|
189
|
-
export interface SelectionHandleState {
|
|
190
|
-
kind: SelectionStateType.Handle;
|
|
191
|
-
primary: number | null;
|
|
192
|
-
selections: number[];
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
export interface SelectionIndexState {
|
|
196
|
-
kind: SelectionStateType.Index;
|
|
197
|
-
focus: CellRange;
|
|
198
|
-
selections: CellRange[];
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
export type SelectionState = SelectionHandleState | SelectionIndexState;
|
|
202
|
-
|
|
203
|
-
export interface NotebookTextModelChangedEvent {
|
|
204
|
-
readonly rawEvents: NotebookRawContentEvent[];
|
|
205
|
-
// readonly versionId: number;
|
|
206
|
-
readonly synchronous?: boolean;
|
|
207
|
-
readonly endSelectionState?: SelectionState;
|
|
208
|
-
};
|
|
209
|
-
|
|
210
|
-
export interface NotebookCellsInitializeEvent<T> {
|
|
211
|
-
readonly kind: NotebookCellsChangeType.Initialize;
|
|
212
|
-
readonly changes: NotebookCellTextModelSplice<T>[];
|
|
213
|
-
}
|
|
214
|
-
|
|
215
147
|
export interface NotebookCellsChangeLanguageEvent {
|
|
216
148
|
readonly kind: NotebookCellsChangeType.ChangeCellLanguage;
|
|
217
149
|
readonly index: number;
|
|
218
150
|
readonly language: string;
|
|
219
151
|
}
|
|
220
152
|
|
|
221
|
-
export interface NotebookCellsModelChangedEvent<T> {
|
|
222
|
-
readonly kind: NotebookCellsChangeType.ModelChange;
|
|
223
|
-
readonly changes: NotebookCellTextModelSplice<T>[];
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
export interface NotebookCellsModelMoveEvent<T> {
|
|
227
|
-
readonly kind: NotebookCellsChangeType.Move;
|
|
228
|
-
readonly index: number;
|
|
229
|
-
readonly length: number;
|
|
230
|
-
readonly newIdx: number;
|
|
231
|
-
readonly cells: T[];
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
export interface NotebookOutputChangedEvent {
|
|
235
|
-
readonly kind: NotebookCellsChangeType.Output;
|
|
236
|
-
readonly index: number;
|
|
237
|
-
readonly outputs: CellOutput[];
|
|
238
|
-
readonly append: boolean;
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
export interface NotebookOutputItemChangedEvent {
|
|
242
|
-
readonly kind: NotebookCellsChangeType.OutputItem;
|
|
243
|
-
readonly index: number;
|
|
244
|
-
readonly outputId: string;
|
|
245
|
-
readonly outputItems: CellOutputItem[];
|
|
246
|
-
readonly append: boolean;
|
|
247
|
-
}
|
|
248
153
|
export interface NotebookCellsChangeMetadataEvent {
|
|
249
154
|
readonly kind: NotebookCellsChangeType.ChangeCellMetadata;
|
|
250
155
|
readonly index: number;
|
|
@@ -257,35 +162,23 @@ export interface NotebookCellsChangeInternalMetadataEvent {
|
|
|
257
162
|
readonly internalMetadata: NotebookCellInternalMetadata;
|
|
258
163
|
}
|
|
259
164
|
|
|
260
|
-
export interface NotebookDocumentChangeMetadataEvent {
|
|
261
|
-
readonly kind: NotebookCellsChangeType.ChangeDocumentMetadata;
|
|
262
|
-
readonly metadata: NotebookDocumentMetadata;
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
export interface NotebookDocumentUnknownChangeEvent {
|
|
266
|
-
readonly kind: NotebookCellsChangeType.Unknown;
|
|
267
|
-
}
|
|
268
|
-
|
|
269
165
|
export interface NotebookCellContentChangeEvent {
|
|
270
166
|
readonly kind: NotebookCellsChangeType.ChangeCellContent;
|
|
271
167
|
readonly index: number;
|
|
272
168
|
}
|
|
273
169
|
|
|
274
|
-
export
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
NotebookCellsChangeInternalMetadataEvent | NotebookDocumentUnknownChangeEvent); // & { transient: boolean };
|
|
278
|
-
|
|
279
|
-
export interface NotebookModelChangedEvent {
|
|
280
|
-
readonly rawEvents: NotebookRawContentEvent[];
|
|
281
|
-
readonly versionId: number;
|
|
282
|
-
// readonly synchronous: boolean | undefined;
|
|
283
|
-
// readonly endSelectionState: ISelectionState | undefined;
|
|
284
|
-
};
|
|
170
|
+
export interface NotebookModelResource {
|
|
171
|
+
notebookModelUri: URI;
|
|
172
|
+
}
|
|
285
173
|
|
|
286
|
-
export
|
|
287
|
-
|
|
288
|
-
|
|
174
|
+
export namespace NotebookModelResource {
|
|
175
|
+
export function is(item: unknown): item is NotebookModelResource {
|
|
176
|
+
return isObject<NotebookModelResource>(item) && item.notebookModelUri instanceof URI;
|
|
177
|
+
}
|
|
178
|
+
export function create(uri: URI): NotebookModelResource {
|
|
179
|
+
return { notebookModelUri: uri };
|
|
180
|
+
}
|
|
181
|
+
}
|
|
289
182
|
|
|
290
183
|
export enum NotebookCellExecutionState {
|
|
291
184
|
Unconfirmed = 1,
|
|
@@ -321,51 +214,12 @@ export interface CellExecutionStateUpdateDto {
|
|
|
321
214
|
isPaused?: boolean;
|
|
322
215
|
}
|
|
323
216
|
|
|
324
|
-
export interface CellOutputEdit {
|
|
325
|
-
editType: CellEditType.Output;
|
|
326
|
-
index: number;
|
|
327
|
-
outputs: CellOutput[];
|
|
328
|
-
append?: boolean;
|
|
329
|
-
}
|
|
330
|
-
|
|
331
|
-
export interface CellOutputEditByHandle {
|
|
332
|
-
editType: CellEditType.Output;
|
|
333
|
-
handle: number;
|
|
334
|
-
outputs: CellOutput[];
|
|
335
|
-
append?: boolean;
|
|
336
|
-
}
|
|
337
|
-
|
|
338
|
-
export interface CellOutputItemEdit {
|
|
339
|
-
editType: CellEditType.OutputItems;
|
|
340
|
-
items: CellOutputItem[];
|
|
341
|
-
outputId: string;
|
|
342
|
-
append?: boolean;
|
|
343
|
-
}
|
|
344
|
-
|
|
345
217
|
export interface CellMetadataEdit {
|
|
346
218
|
editType: CellEditType.Metadata;
|
|
347
219
|
index: number;
|
|
348
220
|
metadata: NotebookCellMetadata;
|
|
349
221
|
}
|
|
350
222
|
|
|
351
|
-
export interface CellLanguageEdit {
|
|
352
|
-
editType: CellEditType.CellLanguage;
|
|
353
|
-
index: number;
|
|
354
|
-
language: string;
|
|
355
|
-
}
|
|
356
|
-
|
|
357
|
-
export interface DocumentMetadataEdit {
|
|
358
|
-
editType: CellEditType.DocumentMetadata;
|
|
359
|
-
metadata: NotebookDocumentMetadata;
|
|
360
|
-
}
|
|
361
|
-
|
|
362
|
-
export interface CellMoveEdit {
|
|
363
|
-
editType: CellEditType.Move;
|
|
364
|
-
index: number;
|
|
365
|
-
length: number;
|
|
366
|
-
newIdx: number;
|
|
367
|
-
}
|
|
368
|
-
|
|
369
223
|
export const enum CellEditType {
|
|
370
224
|
Replace = 1,
|
|
371
225
|
Output = 2,
|
|
@@ -378,19 +232,6 @@ export const enum CellEditType {
|
|
|
378
232
|
PartialInternalMetadata = 9,
|
|
379
233
|
}
|
|
380
234
|
|
|
381
|
-
export type ImmediateCellEditOperation = CellOutputEditByHandle | CellOutputItemEdit | CellPartialInternalMetadataEditByHandle; // add more later on
|
|
382
|
-
export type CellEditOperation = ImmediateCellEditOperation | CellReplaceEdit | CellOutputEdit |
|
|
383
|
-
CellMetadataEdit | CellLanguageEdit | DocumentMetadataEdit | CellMoveEdit; // add more later on
|
|
384
|
-
|
|
385
|
-
export type NullablePartialNotebookCellInternalMetadata = {
|
|
386
|
-
[Key in keyof Partial<NotebookCellInternalMetadata>]: NotebookCellInternalMetadata[Key] | null
|
|
387
|
-
};
|
|
388
|
-
export interface CellPartialInternalMetadataEditByHandle {
|
|
389
|
-
editType: CellEditType.PartialInternalMetadata;
|
|
390
|
-
handle: number;
|
|
391
|
-
internalMetadata: NullablePartialNotebookCellInternalMetadata;
|
|
392
|
-
}
|
|
393
|
-
|
|
394
235
|
export interface NotebookKernelSourceAction {
|
|
395
236
|
readonly label: string;
|
|
396
237
|
readonly description?: string;
|