@jupyterlab/outputarea 4.0.0-alpha.8 → 4.0.0-beta.0

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/model.d.ts CHANGED
@@ -8,11 +8,13 @@ import { ISignal } from '@lumino/signaling';
8
8
  */
9
9
  export interface IOutputAreaModel extends IDisposable {
10
10
  /**
11
- * A signal emitted when the model state changes.
11
+ * A signal emitted when the output item changes.
12
+ *
13
+ * The number is the index of the output that changed.
12
14
  */
13
- readonly stateChanged: ISignal<IOutputAreaModel, void>;
15
+ readonly stateChanged: ISignal<IOutputAreaModel, number>;
14
16
  /**
15
- * A signal emitted when the model changes.
17
+ * A signal emitted when the list of items changes.
16
18
  */
17
19
  readonly changed: ISignal<IOutputAreaModel, IOutputAreaModel.ChangedArgs>;
18
20
  /**
@@ -62,10 +64,6 @@ export interface IOutputAreaModel extends IDisposable {
62
64
  * Serialize the model to JSON.
63
65
  */
64
66
  toJSON(): nbformat.IOutput[];
65
- /**
66
- * The maximum number of output items to display on top and bottom of cell output.
67
- */
68
- maxNumberOutputs?: number;
69
67
  }
70
68
  /**
71
69
  * The namespace for IOutputAreaModel interfaces.
@@ -113,13 +111,13 @@ export declare class OutputAreaModel implements IOutputAreaModel {
113
111
  */
114
112
  constructor(options?: IOutputAreaModel.IOptions);
115
113
  /**
116
- * A signal emitted when the model state changes.
114
+ * A signal emitted when an item changes.
117
115
  */
118
- get stateChanged(): ISignal<IOutputAreaModel, void>;
116
+ get stateChanged(): ISignal<IOutputAreaModel, number>;
119
117
  /**
120
- * A signal emitted when the model changes.
118
+ * A signal emitted when the list of items changes.
121
119
  */
122
- get changed(): ISignal<this, IOutputAreaModel.ChangedArgs>;
120
+ get changed(): ISignal<IOutputAreaModel, IOutputAreaModel.ChangedArgs>;
123
121
  /**
124
122
  * Get the length of the items in the model.
125
123
  */
@@ -184,6 +182,8 @@ export declare class OutputAreaModel implements IOutputAreaModel {
184
182
  toJSON(): nbformat.IOutput[];
185
183
  /**
186
184
  * Add a copy of the item to the list.
185
+ *
186
+ * @returns The list length
187
187
  */
188
188
  private _add;
189
189
  /**
package/lib/model.js CHANGED
@@ -3,7 +3,7 @@
3
3
  import * as nbformat from '@jupyterlab/nbformat';
4
4
  import { ObservableList } from '@jupyterlab/observables';
5
5
  import { OutputModel } from '@jupyterlab/rendermime';
6
- import { each, map, toArray } from '@lumino/algorithm';
6
+ import { map } from '@lumino/algorithm';
7
7
  import { JSONExt } from '@lumino/coreutils';
8
8
  import { Signal } from '@lumino/signaling';
9
9
  /**
@@ -19,6 +19,7 @@ export class OutputAreaModel {
19
19
  * *after* the next addition to it.
20
20
  */
21
21
  this.clearNext = false;
22
+ this._lastStream = '';
22
23
  this._trusted = false;
23
24
  this._isDisposed = false;
24
25
  this._stateChanged = new Signal(this);
@@ -28,20 +29,22 @@ export class OutputAreaModel {
28
29
  options.contentFactory || OutputAreaModel.defaultContentFactory;
29
30
  this.list = new ObservableList();
30
31
  if (options.values) {
31
- each(options.values, value => {
32
- this._add(value);
33
- });
32
+ for (const value of options.values) {
33
+ const index = this._add(value) - 1;
34
+ const item = this.list.get(index);
35
+ item.changed.connect(this._onGenericChange, this);
36
+ }
34
37
  }
35
38
  this.list.changed.connect(this._onListChanged, this);
36
39
  }
37
40
  /**
38
- * A signal emitted when the model state changes.
41
+ * A signal emitted when an item changes.
39
42
  */
40
43
  get stateChanged() {
41
44
  return this._stateChanged;
42
45
  }
43
46
  /**
44
- * A signal emitted when the model changes.
47
+ * A signal emitted when the list of items changes.
45
48
  */
46
49
  get changed() {
47
50
  return this._changed;
@@ -70,11 +73,11 @@ export class OutputAreaModel {
70
73
  }
71
74
  const trusted = (this._trusted = value);
72
75
  for (let i = 0; i < this.list.length; i++) {
73
- let item = this.list.get(i);
74
- const value = item.toJSON();
75
- item.dispose();
76
- item = this._createItem({ value, trusted });
76
+ const oldItem = this.list.get(i);
77
+ const value = oldItem.toJSON();
78
+ const item = this._createItem({ value, trusted });
77
79
  this.list.set(i, item);
80
+ oldItem.dispose();
78
81
  }
79
82
  }
80
83
  /**
@@ -138,9 +141,9 @@ export class OutputAreaModel {
138
141
  this.clearNext = true;
139
142
  return;
140
143
  }
141
- each(this.list, (item) => {
144
+ for (const item of this.list) {
142
145
  item.dispose();
143
- });
146
+ }
144
147
  this.list.clear();
145
148
  }
146
149
  /**
@@ -151,18 +154,20 @@ export class OutputAreaModel {
151
154
  */
152
155
  fromJSON(values) {
153
156
  this.clear();
154
- each(values, value => {
157
+ for (const value of values) {
155
158
  this._add(value);
156
- });
159
+ }
157
160
  }
158
161
  /**
159
162
  * Serialize the model to JSON.
160
163
  */
161
164
  toJSON() {
162
- return toArray(map(this.list, (output) => output.toJSON()));
165
+ return Array.from(map(this.list, (output) => output.toJSON()));
163
166
  }
164
167
  /**
165
168
  * Add a copy of the item to the list.
169
+ *
170
+ * @returns The list length
166
171
  */
167
172
  _add(value) {
168
173
  const trusted = this._trusted;
@@ -186,9 +191,9 @@ export class OutputAreaModel {
186
191
  const item = this._createItem({ value, trusted });
187
192
  const index = this.length - 1;
188
193
  const prev = this.list.get(index);
189
- prev.dispose();
190
194
  this.list.set(index, item);
191
- return index;
195
+ prev.dispose();
196
+ return this.length;
192
197
  }
193
198
  if (nbformat.isStream(value)) {
194
199
  value.text = Private.removeOverwrittenChars(value.text);
@@ -221,20 +226,46 @@ export class OutputAreaModel {
221
226
  _createItem(options) {
222
227
  const factory = this.contentFactory;
223
228
  const item = factory.createOutputModel(options);
224
- item.changed.connect(this._onGenericChange, this);
225
229
  return item;
226
230
  }
227
231
  /**
228
232
  * Handle a change to the list.
229
233
  */
230
234
  _onListChanged(sender, args) {
235
+ switch (args.type) {
236
+ case 'add':
237
+ args.newValues.forEach(item => {
238
+ item.changed.connect(this._onGenericChange, this);
239
+ });
240
+ break;
241
+ case 'remove':
242
+ args.oldValues.forEach(item => {
243
+ item.changed.disconnect(this._onGenericChange, this);
244
+ });
245
+ break;
246
+ case 'set':
247
+ args.newValues.forEach(item => {
248
+ item.changed.connect(this._onGenericChange, this);
249
+ });
250
+ args.oldValues.forEach(item => {
251
+ item.changed.disconnect(this._onGenericChange, this);
252
+ });
253
+ break;
254
+ }
231
255
  this._changed.emit(args);
232
256
  }
233
257
  /**
234
258
  * Handle a change to an item.
235
259
  */
236
- _onGenericChange() {
237
- this._stateChanged.emit(void 0);
260
+ _onGenericChange(itemModel) {
261
+ let idx;
262
+ for (idx = 0; idx < this.list.length; idx++) {
263
+ const item = this.list.get(idx);
264
+ if (item === itemModel) {
265
+ break;
266
+ }
267
+ }
268
+ this._stateChanged.emit(idx);
238
269
  }
239
270
  }
240
271
  /**
package/lib/model.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"model.js","sourceRoot":"","sources":["../src/model.ts"],"names":[],"mappings":"AAAA,0CAA0C;AAC1C,2DAA2D;AAE3D,OAAO,KAAK,QAAQ,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAmB,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAC1E,OAAO,EAAgB,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACnE,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAE5C,OAAO,EAAW,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAwHpD;;GAEG;AACH,MAAM,OAAO,eAAe;IAC1B;;OAEG;IACH,YAAY,UAAqC,EAAE;QAiOnD;;;WAGG;QACO,cAAS,GAAG,KAAK,CAAC;QAqCpB,aAAQ,GAAG,KAAK,CAAC;QACjB,gBAAW,GAAG,KAAK,CAAC;QACpB,kBAAa,GAAG,IAAI,MAAM,CAAyB,IAAI,CAAC,CAAC;QACzD,aAAQ,GAAG,IAAI,MAAM,CAAqC,IAAI,CAAC,CAAC;QA5QtE,IAAI,CAAC,QAAQ,GAAG,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC;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AG,CAAC,KAAK,CAAC,WAAW,CAAE,CAAC,CAAC,CAAC,CAAC;YACxC,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;YACzD,GAAG,GAAG,GAAG,CAAC,OAAO,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC,OAAO,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;SAC9D;QACD,OAAO,GAAG,CAAC;IACb,CAAC;IAED;;OAEG;IACH,SAAgB,sBAAsB,CAAC,IAAY;QACjD,OAAO,iBAAiB,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC;IAC/C,CAAC;IAFe,8BAAsB,yBAErC,CAAA;AACH,CAAC,EA9CS,OAAO,KAAP,OAAO,QA8ChB"}
package/lib/widget.d.ts CHANGED
@@ -2,10 +2,11 @@ import { ISessionContext, WidgetTracker } from '@jupyterlab/apputils';
2
2
  import * as nbformat from '@jupyterlab/nbformat';
3
3
  import { IOutputModel, IRenderMimeRegistry } from '@jupyterlab/rendermime';
4
4
  import { Kernel, KernelMessage } from '@jupyterlab/services';
5
+ import { ITranslator } from '@jupyterlab/translation';
5
6
  import { JSONObject, ReadonlyPartialJSONObject } from '@lumino/coreutils';
6
7
  import { Message } from '@lumino/messaging';
7
- import { Signal } from '@lumino/signaling';
8
- import { Widget } from '@lumino/widgets';
8
+ import { ISignal, Signal } from '@lumino/signaling';
9
+ import { PanelLayout, Widget } from '@lumino/widgets';
9
10
  import { IOutputAreaModel } from './model';
10
11
  /** ****************************************************************************
11
12
  * OutputArea
@@ -24,30 +25,28 @@ export declare class OutputArea extends Widget {
24
25
  * Construct an output area widget.
25
26
  */
26
27
  constructor(options: OutputArea.IOptions);
27
- /**
28
- * The model used by the widget.
29
- */
30
- readonly model: IOutputAreaModel;
31
28
  /**
32
29
  * The content factory used by the widget.
33
30
  */
34
31
  readonly contentFactory: OutputArea.IContentFactory;
32
+ /**
33
+ * The model used by the widget.
34
+ */
35
+ readonly model: IOutputAreaModel;
35
36
  /**
36
37
  * The rendermime instance used by the widget.
37
38
  */
38
39
  readonly rendermime: IRenderMimeRegistry;
39
40
  /**
40
- * The hidden output models.
41
+ * Narrow the type of OutputArea's layout prop
41
42
  */
42
- private trimmedOutputModels;
43
- private maxNumberOutputs;
44
- private headEndIndex;
43
+ get layout(): PanelLayout;
45
44
  /**
46
45
  * A read-only sequence of the children widgets in the output area.
47
46
  */
48
47
  get widgets(): ReadonlyArray<Widget>;
49
48
  /**
50
- * A public signal used to indicate the number of outputs has changed.
49
+ * A public signal used to indicate the number of displayed outputs has changed.
51
50
  *
52
51
  * #### Notes
53
52
  * This is useful for parents who want to apply styling based on the number
@@ -59,6 +58,18 @@ export declare class OutputArea extends Widget {
59
58
  */
60
59
  get future(): Kernel.IShellFuture<KernelMessage.IExecuteRequestMsg, KernelMessage.IExecuteReplyMsg>;
61
60
  set future(value: Kernel.IShellFuture<KernelMessage.IExecuteRequestMsg, KernelMessage.IExecuteReplyMsg>);
61
+ /**
62
+ * Signal emitted when an output area is requesting an input.
63
+ */
64
+ get inputRequested(): ISignal<OutputArea, void>;
65
+ /**
66
+ * The maximum number of output items to display on top and bottom of cell output.
67
+ *
68
+ * ### Notes
69
+ * It is set to Infinity if no trim is applied.
70
+ */
71
+ get maxNumberOutputs(): number;
72
+ set maxNumberOutputs(limit: number);
62
73
  /**
63
74
  * Dispose of the resources used by the output area.
64
75
  */
@@ -67,9 +78,17 @@ export declare class OutputArea extends Widget {
67
78
  * Follow changes on the model state.
68
79
  */
69
80
  protected onModelChanged(sender: IOutputAreaModel, args: IOutputAreaModel.ChangedArgs): void;
81
+ /**
82
+ * Emitted when user requests toggling of the output scrolling mode.
83
+ */
84
+ get toggleScrolling(): ISignal<OutputArea, void>;
85
+ /**
86
+ * Add overlay allowing to toggle scrolling.
87
+ */
88
+ private _addPromptOverlay;
70
89
  /**
71
90
  * Update indices in _displayIdMap in response to element remove from model items
72
- * *
91
+ *
73
92
  * @param startIndex - The index of first element removed
74
93
  *
75
94
  * @param count - The number of elements removed from model items
@@ -79,9 +98,9 @@ export declare class OutputArea extends Widget {
79
98
  /**
80
99
  * Follow changes on the output model state.
81
100
  */
82
- protected onStateChanged(sender: IOutputAreaModel): void;
101
+ protected onStateChanged(sender: IOutputAreaModel, change: number | void): void;
83
102
  /**
84
- * Clear the widget inputs and outputs.
103
+ * Clear the widget outputs.
85
104
  */
86
105
  private _clear;
87
106
  private _preventHeightChangeJitter;
@@ -100,14 +119,15 @@ export declare class OutputArea extends Widget {
100
119
  * @param model - The model of the output to be inserted.
101
120
  */
102
121
  private _insertOutput;
103
- private _createOutput;
104
122
  /**
105
123
  * A widget tracker for individual output widgets in the output area.
106
124
  */
107
125
  get outputTracker(): WidgetTracker<Widget>;
108
126
  /**
109
- * Remove the information message related to the trimmed output
110
- * and show all previously trimmed outputs.
127
+ * Dispose information message and show output models from the given
128
+ * index to maxNumberOutputs
129
+ *
130
+ * @param lastShown Starting model index to insert.
111
131
  */
112
132
  private _showTrimmedOutputs;
113
133
  /**
@@ -129,10 +149,27 @@ export declare class OutputArea extends Widget {
129
149
  * Handle an execute reply message.
130
150
  */
131
151
  private _onExecuteReply;
132
- private _minHeightTimeout;
133
- private _future;
152
+ /**
153
+ * Wrap a output widget within a output panel
154
+ *
155
+ * @param output Output widget to wrap
156
+ * @param executionCount Execution count
157
+ * @returns The output panel
158
+ */
159
+ private _wrappedOutput;
134
160
  private _displayIdMap;
161
+ private _future;
162
+ /**
163
+ * The maximum outputs to show in the trimmed
164
+ * output area.
165
+ */
166
+ private _maxNumberOutputs;
167
+ private _minHeightTimeout;
168
+ private _inputRequested;
169
+ private _toggleScrolling;
135
170
  private _outputTracker;
171
+ private _translator;
172
+ private _inputHistoryScope;
136
173
  }
137
174
  export declare class SimplifiedOutputArea extends OutputArea {
138
175
  /**
@@ -168,6 +205,18 @@ export declare namespace OutputArea {
168
205
  * The maximum number of output items to display on top and bottom of cell output.
169
206
  */
170
207
  maxNumberOutputs?: number;
208
+ /**
209
+ * Whether to show prompt overlay emitting `toggleScrolling` signal.
210
+ */
211
+ promptOverlay?: boolean;
212
+ /**
213
+ * Translator
214
+ */
215
+ readonly translator?: ITranslator;
216
+ /**
217
+ * Whether to split stdin line history by kernel session or keep globally accessible.
218
+ */
219
+ inputHistoryScope?: 'global' | 'session';
171
220
  }
172
221
  /**
173
222
  * Execute code on an output area.
@@ -248,6 +297,11 @@ export interface IStdin extends Widget {
248
297
  * The default stdin widget.
249
298
  */
250
299
  export declare class Stdin extends Widget implements IStdin {
300
+ private static _history;
301
+ private static _historyIx;
302
+ private static _historyAt;
303
+ private static _historyPush;
304
+ private static _historySearch;
251
305
  /**
252
306
  * Construct a new input widget.
253
307
  */
@@ -266,23 +320,27 @@ export declare class Stdin extends Widget implements IStdin {
266
320
  * called in response to events on the dock panel's node. It should
267
321
  * not be called directly by user code.
268
322
  */
269
- handleEvent(event: Event): void;
323
+ handleEvent(event: KeyboardEvent): void;
324
+ protected resetSearch(): void;
270
325
  /**
271
326
  * Handle `after-attach` messages sent to the widget.
272
327
  */
273
328
  protected onAfterAttach(msg: Message): void;
274
- /**
275
- * Handle `update-request` messages sent to the widget.
276
- */
277
- protected onUpdateRequest(msg: Message): void;
278
329
  /**
279
330
  * Handle `before-detach` messages sent to the widget.
280
331
  */
281
332
  protected onBeforeDetach(msg: Message): void;
282
333
  private _future;
334
+ private _historyIndex;
335
+ private _historyKey;
336
+ private _historyPat;
283
337
  private _input;
284
- private _value;
338
+ private _parentHeader;
339
+ private _password;
285
340
  private _promise;
341
+ private _trans;
342
+ private _value;
343
+ private _valueCache;
286
344
  }
287
345
  export declare namespace Stdin {
288
346
  /**
@@ -301,5 +359,17 @@ export declare namespace Stdin {
301
359
  * The kernel future associated with the request.
302
360
  */
303
361
  future: Kernel.IShellFuture;
362
+ /**
363
+ * The header of the input_request message.
364
+ */
365
+ parent_header: KernelMessage.IInputReplyMsg['parent_header'];
366
+ /**
367
+ * Translator
368
+ */
369
+ readonly translator?: ITranslator;
370
+ /**
371
+ * Whether to split stdin line history by kernel session or keep globally accessible.
372
+ */
373
+ inputHistoryScope?: 'global' | 'session';
304
374
  }
305
375
  }