@jupyterlab/cells 4.0.0-alpha.12 → 4.0.0-alpha.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/celldragutils.d.ts +1 -7
- package/lib/celldragutils.js +12 -13
- package/lib/celldragutils.js.map +1 -1
- package/lib/inputarea.d.ts +0 -8
- package/lib/inputarea.js +2 -5
- package/lib/inputarea.js.map +1 -1
- package/lib/model.d.ts +48 -66
- package/lib/model.js +152 -342
- package/lib/model.js.map +1 -1
- package/lib/placeholder.d.ts +23 -19
- package/lib/placeholder.js +30 -35
- package/lib/placeholder.js.map +1 -1
- package/lib/searchprovider.d.ts +3 -3
- package/lib/searchprovider.js +26 -15
- package/lib/searchprovider.js.map +1 -1
- package/lib/widget.d.ts +151 -21
- package/lib/widget.js +447 -153
- package/lib/widget.js.map +1 -1
- package/package.json +27 -27
package/lib/widget.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ import { ITranslator } from '@jupyterlab/translation';
|
|
|
9
9
|
import { JSONObject, JSONValue, PartialJSONValue } from '@lumino/coreutils';
|
|
10
10
|
import { Message } from '@lumino/messaging';
|
|
11
11
|
import { ISignal, Signal } from '@lumino/signaling';
|
|
12
|
-
import { Widget } from '@lumino/widgets';
|
|
12
|
+
import { PanelLayout, Widget } from '@lumino/widgets';
|
|
13
13
|
import { ICellFooter, ICellHeader } from './headerfooter';
|
|
14
14
|
import { IInputPrompt, InputArea } from './inputarea';
|
|
15
15
|
import { IAttachmentsCellModel, ICellModel, ICodeCellModel, IMarkdownCellModel, IRawCellModel } from './model';
|
|
@@ -40,18 +40,42 @@ export declare class Cell<T extends ICellModel = ICellModel> extends Widget {
|
|
|
40
40
|
* Signal to indicate that widget has changed visibly (in size, in type, etc)
|
|
41
41
|
*/
|
|
42
42
|
get displayChanged(): ISignal<this, void>;
|
|
43
|
+
/**
|
|
44
|
+
* Whether the cell is in viewport or not.
|
|
45
|
+
*/
|
|
46
|
+
get inViewport(): boolean;
|
|
47
|
+
set inViewport(v: boolean);
|
|
48
|
+
/**
|
|
49
|
+
* Will emit true just after the node is attached to the DOM
|
|
50
|
+
* Will emit false just before the node is detached of the DOM
|
|
51
|
+
*/
|
|
52
|
+
get inViewportChanged(): ISignal<Cell, boolean>;
|
|
53
|
+
/**
|
|
54
|
+
* Whether the cell is a placeholder not yet fully rendered or not.
|
|
55
|
+
*/
|
|
56
|
+
protected get placeholder(): boolean;
|
|
57
|
+
protected set placeholder(v: boolean);
|
|
43
58
|
/**
|
|
44
59
|
* Get the prompt node used by the cell.
|
|
45
60
|
*/
|
|
46
|
-
get promptNode(): HTMLElement;
|
|
61
|
+
get promptNode(): HTMLElement | null;
|
|
47
62
|
/**
|
|
48
63
|
* Get the CodeEditorWrapper used by the cell.
|
|
49
64
|
*/
|
|
50
|
-
get editorWidget(): CodeEditorWrapper;
|
|
65
|
+
get editorWidget(): CodeEditorWrapper | null;
|
|
51
66
|
/**
|
|
52
67
|
* Get the CodeEditor used by the cell.
|
|
53
68
|
*/
|
|
54
|
-
get editor(): CodeEditor.IEditor;
|
|
69
|
+
get editor(): CodeEditor.IEditor | null;
|
|
70
|
+
/**
|
|
71
|
+
* Editor configuration
|
|
72
|
+
*/
|
|
73
|
+
get editorConfig(): Partial<CodeEditor.IConfig>;
|
|
74
|
+
setEditorConfig(v: Partial<CodeEditor.IConfig>): void;
|
|
75
|
+
/**
|
|
76
|
+
* Cell headings
|
|
77
|
+
*/
|
|
78
|
+
get headings(): Cell.IHeading[];
|
|
55
79
|
/**
|
|
56
80
|
* Get the model used by the cell.
|
|
57
81
|
*/
|
|
@@ -59,14 +83,18 @@ export declare class Cell<T extends ICellModel = ICellModel> extends Widget {
|
|
|
59
83
|
/**
|
|
60
84
|
* Get the input area for the cell.
|
|
61
85
|
*/
|
|
62
|
-
get inputArea(): InputArea;
|
|
86
|
+
get inputArea(): InputArea | null;
|
|
63
87
|
/**
|
|
64
88
|
* The read only state of the cell.
|
|
65
89
|
*/
|
|
66
90
|
get readOnly(): boolean;
|
|
67
91
|
set readOnly(value: boolean);
|
|
68
92
|
/**
|
|
69
|
-
* Whether the cell is a placeholder that
|
|
93
|
+
* Whether the cell is a placeholder that defer rendering
|
|
94
|
+
*
|
|
95
|
+
* #### Notes
|
|
96
|
+
* You can wait for the promise `Cell.ready` to wait for the
|
|
97
|
+
* cell to be rendered.
|
|
70
98
|
*/
|
|
71
99
|
isPlaceholder(): boolean;
|
|
72
100
|
/**
|
|
@@ -125,6 +153,14 @@ export declare class Cell<T extends ICellModel = ICellModel> extends Widget {
|
|
|
125
153
|
* Dispose of the resources held by the widget.
|
|
126
154
|
*/
|
|
127
155
|
dispose(): void;
|
|
156
|
+
/**
|
|
157
|
+
* Create children widgets.
|
|
158
|
+
*/
|
|
159
|
+
protected initializeDOM(): void;
|
|
160
|
+
/**
|
|
161
|
+
* Handle `before-attach` messages.
|
|
162
|
+
*/
|
|
163
|
+
protected onBeforeAttach(msg: Message): void;
|
|
128
164
|
/**
|
|
129
165
|
* Handle `after-attach` messages.
|
|
130
166
|
*/
|
|
@@ -145,18 +181,23 @@ export declare class Cell<T extends ICellModel = ICellModel> extends Widget {
|
|
|
145
181
|
* Handle changes in the metadata.
|
|
146
182
|
*/
|
|
147
183
|
protected onMetadataChanged(model: IObservableJSON, args: IObservableMap.IChangedArgs<PartialJSONValue | undefined>): void;
|
|
184
|
+
protected prompt: string;
|
|
148
185
|
protected translator: ITranslator;
|
|
149
186
|
protected _displayChanged: Signal<this, void>;
|
|
150
|
-
private
|
|
151
|
-
private _model;
|
|
152
|
-
private _inputHidden;
|
|
187
|
+
private _editorConfig;
|
|
153
188
|
private _input;
|
|
189
|
+
private _inputHidden;
|
|
154
190
|
private _inputWrapper;
|
|
155
191
|
private _inputPlaceholder;
|
|
156
|
-
private
|
|
192
|
+
private _inViewport;
|
|
193
|
+
private _inViewportChanged;
|
|
194
|
+
private _model;
|
|
195
|
+
private _placeholder;
|
|
196
|
+
private _readOnly;
|
|
197
|
+
private _ready;
|
|
198
|
+
private _resizeDebouncer;
|
|
157
199
|
private _syncCollapse;
|
|
158
200
|
private _syncEditable;
|
|
159
|
-
private _resizeDebouncer;
|
|
160
201
|
}
|
|
161
202
|
/**
|
|
162
203
|
* The namespace for the `Cell` class statics.
|
|
@@ -179,9 +220,9 @@ export declare namespace Cell {
|
|
|
179
220
|
*/
|
|
180
221
|
editorConfig?: Partial<CodeEditor.IConfig>;
|
|
181
222
|
/**
|
|
182
|
-
*
|
|
223
|
+
* Cell widget layout.
|
|
183
224
|
*/
|
|
184
|
-
|
|
225
|
+
layout?: PanelLayout;
|
|
185
226
|
/**
|
|
186
227
|
* The maximum number of output items to display in cell output.
|
|
187
228
|
*/
|
|
@@ -195,6 +236,40 @@ export declare namespace Cell {
|
|
|
195
236
|
*/
|
|
196
237
|
translator?: ITranslator;
|
|
197
238
|
}
|
|
239
|
+
/**
|
|
240
|
+
* Cell heading
|
|
241
|
+
*/
|
|
242
|
+
interface IHeading {
|
|
243
|
+
/**
|
|
244
|
+
* Heading text.
|
|
245
|
+
*/
|
|
246
|
+
text: string;
|
|
247
|
+
/**
|
|
248
|
+
* HTML heading level.
|
|
249
|
+
*/
|
|
250
|
+
level: number;
|
|
251
|
+
/**
|
|
252
|
+
* Index of the output containing the heading
|
|
253
|
+
*/
|
|
254
|
+
outputIndex?: number;
|
|
255
|
+
/**
|
|
256
|
+
* Type of heading
|
|
257
|
+
*/
|
|
258
|
+
type: HeadingType;
|
|
259
|
+
}
|
|
260
|
+
/**
|
|
261
|
+
* Type of headings
|
|
262
|
+
*/
|
|
263
|
+
enum HeadingType {
|
|
264
|
+
/**
|
|
265
|
+
* Heading from HTML output
|
|
266
|
+
*/
|
|
267
|
+
HTML = 0,
|
|
268
|
+
/**
|
|
269
|
+
* Heading from Markdown cell or Markdown output
|
|
270
|
+
*/
|
|
271
|
+
Markdown = 1
|
|
272
|
+
}
|
|
198
273
|
/**
|
|
199
274
|
* The factory object for customizable cell children.
|
|
200
275
|
*
|
|
@@ -275,6 +350,35 @@ export declare namespace Cell {
|
|
|
275
350
|
/** ****************************************************************************
|
|
276
351
|
* CodeCell
|
|
277
352
|
******************************************************************************/
|
|
353
|
+
/**
|
|
354
|
+
* Code cell layout
|
|
355
|
+
*
|
|
356
|
+
* It will not detached the output area when the cell is detached.
|
|
357
|
+
*/
|
|
358
|
+
export declare class CodeCellLayout extends PanelLayout {
|
|
359
|
+
/**
|
|
360
|
+
* A message handler invoked on a `'before-attach'` message.
|
|
361
|
+
*
|
|
362
|
+
* #### Notes
|
|
363
|
+
* The default implementation of this method forwards the message
|
|
364
|
+
* to all widgets. It assumes all widget nodes are attached to the
|
|
365
|
+
* parent widget node.
|
|
366
|
+
*
|
|
367
|
+
* This may be reimplemented by subclasses as needed.
|
|
368
|
+
*/
|
|
369
|
+
protected onBeforeAttach(msg: Message): void;
|
|
370
|
+
/**
|
|
371
|
+
* A message handler invoked on an `'after-detach'` message.
|
|
372
|
+
*
|
|
373
|
+
* #### Notes
|
|
374
|
+
* The default implementation of this method forwards the message
|
|
375
|
+
* to all widgets. It assumes all widget nodes are attached to the
|
|
376
|
+
* parent widget node.
|
|
377
|
+
*
|
|
378
|
+
* This may be reimplemented by subclasses as needed.
|
|
379
|
+
*/
|
|
380
|
+
protected onAfterDetach(msg: Message): void;
|
|
381
|
+
}
|
|
278
382
|
/**
|
|
279
383
|
* A widget for a code cell.
|
|
280
384
|
*/
|
|
@@ -283,6 +387,14 @@ export declare class CodeCell extends Cell<ICodeCellModel> {
|
|
|
283
387
|
* Construct a code cell widget.
|
|
284
388
|
*/
|
|
285
389
|
constructor(options: CodeCell.IOptions);
|
|
390
|
+
/**
|
|
391
|
+
* Maximum number of outputs to display.
|
|
392
|
+
*/
|
|
393
|
+
protected maxNumberOutputs: number | undefined;
|
|
394
|
+
/**
|
|
395
|
+
* Create children widgets.
|
|
396
|
+
*/
|
|
397
|
+
protected initializeDOM(): void;
|
|
286
398
|
/**
|
|
287
399
|
* Initialize view state from model.
|
|
288
400
|
*
|
|
@@ -291,6 +403,7 @@ export declare class CodeCell extends Cell<ICodeCellModel> {
|
|
|
291
403
|
* can be chained in the construction, like `new Foo().initializeState();`
|
|
292
404
|
*/
|
|
293
405
|
initializeState(): this;
|
|
406
|
+
get headings(): Cell.IHeading[];
|
|
294
407
|
/**
|
|
295
408
|
* Get the output area for the cell.
|
|
296
409
|
*/
|
|
@@ -354,6 +467,10 @@ export declare class CodeCell extends Cell<ICodeCellModel> {
|
|
|
354
467
|
* Handle changes in the model.
|
|
355
468
|
*/
|
|
356
469
|
protected onStateChanged(model: ICellModel, args: IChangedArgs<any>): void;
|
|
470
|
+
/**
|
|
471
|
+
* Callback on output changes
|
|
472
|
+
*/
|
|
473
|
+
protected onOutputChanged(): void;
|
|
357
474
|
/**
|
|
358
475
|
* Handle changes in the metadata.
|
|
359
476
|
*/
|
|
@@ -362,6 +479,7 @@ export declare class CodeCell extends Cell<ICodeCellModel> {
|
|
|
362
479
|
* Handle changes in the number of outputs in the output area.
|
|
363
480
|
*/
|
|
364
481
|
private _outputLengthHandler;
|
|
482
|
+
private _headingsCache;
|
|
365
483
|
private _rendermime;
|
|
366
484
|
private _outputHidden;
|
|
367
485
|
private _outputsScrolled;
|
|
@@ -379,6 +497,10 @@ export declare namespace CodeCell {
|
|
|
379
497
|
* An options object for initializing a base cell widget.
|
|
380
498
|
*/
|
|
381
499
|
interface IOptions extends Cell.IOptions<ICodeCellModel> {
|
|
500
|
+
/**
|
|
501
|
+
* Code cell layout.
|
|
502
|
+
*/
|
|
503
|
+
layout?: CodeCellLayout;
|
|
382
504
|
/**
|
|
383
505
|
* The mime renderer for the cell widget.
|
|
384
506
|
*/
|
|
@@ -464,10 +586,6 @@ export declare class MarkdownCell extends AttachmentsCell<IMarkdownCellModel> {
|
|
|
464
586
|
* Construct a Markdown cell widget.
|
|
465
587
|
*/
|
|
466
588
|
constructor(options: MarkdownCell.IOptions);
|
|
467
|
-
/**
|
|
468
|
-
* A promise that resolves when the widget renders for the first time.
|
|
469
|
-
*/
|
|
470
|
-
get ready(): Promise<void>;
|
|
471
589
|
/**
|
|
472
590
|
* Text that represents the highest heading (i.e. lowest level) if cell is a heading.
|
|
473
591
|
* Returns empty string if not a heading.
|
|
@@ -476,6 +594,7 @@ export declare class MarkdownCell extends AttachmentsCell<IMarkdownCellModel> {
|
|
|
476
594
|
text: string;
|
|
477
595
|
level: number;
|
|
478
596
|
};
|
|
597
|
+
get headings(): Cell.IHeading[];
|
|
479
598
|
/**
|
|
480
599
|
* Whether the heading is collapsed or not.
|
|
481
600
|
*/
|
|
@@ -505,13 +624,24 @@ export declare class MarkdownCell extends AttachmentsCell<IMarkdownCellModel> {
|
|
|
505
624
|
* Renderer
|
|
506
625
|
*/
|
|
507
626
|
get renderer(): IRenderMime.IRenderer;
|
|
627
|
+
/**
|
|
628
|
+
* Dispose of the resources held by the widget.
|
|
629
|
+
*/
|
|
508
630
|
dispose(): void;
|
|
631
|
+
/**
|
|
632
|
+
* Create children widgets.
|
|
633
|
+
*/
|
|
634
|
+
protected initializeDOM(): void;
|
|
509
635
|
protected maybeCreateCollapseButton(): void;
|
|
510
636
|
/**
|
|
511
637
|
* Create, update or remove the hidden cells button.
|
|
512
638
|
* Note that the actual visibility is controlled in Static Notebook by toggling jp-mod-showHiddenCellsButton class.
|
|
513
639
|
*/
|
|
514
640
|
protected maybeCreateOrUpdateExpandButton(): void;
|
|
641
|
+
/**
|
|
642
|
+
* Callback on content changed
|
|
643
|
+
*/
|
|
644
|
+
protected onContentChanged(): void;
|
|
515
645
|
/**
|
|
516
646
|
* Render the collapse button for heading cells,
|
|
517
647
|
* and for collapsed heading cells render the "expand hidden cells"
|
|
@@ -543,16 +673,16 @@ export declare class MarkdownCell extends AttachmentsCell<IMarkdownCellModel> {
|
|
|
543
673
|
* Clone the cell, using the same model.
|
|
544
674
|
*/
|
|
545
675
|
clone(): MarkdownCell;
|
|
546
|
-
private
|
|
547
|
-
private _numberChildNodes;
|
|
676
|
+
private _headingsCache;
|
|
548
677
|
private _headingCollapsed;
|
|
549
678
|
private _headingCollapsedChanged;
|
|
679
|
+
private _monitor;
|
|
680
|
+
private _numberChildNodes;
|
|
681
|
+
private _prevText;
|
|
550
682
|
private _renderer;
|
|
551
683
|
private _rendermime;
|
|
552
684
|
private _rendered;
|
|
553
685
|
private _renderedChanged;
|
|
554
|
-
private _prevText;
|
|
555
|
-
private _ready;
|
|
556
686
|
private _showEditorForReadOnlyMarkdown;
|
|
557
687
|
}
|
|
558
688
|
/**
|