@jupyterlab/notebook 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.
Files changed (88) hide show
  1. package/lib/actions.d.ts +56 -32
  2. package/lib/actions.js +452 -354
  3. package/lib/actions.js.map +1 -1
  4. package/lib/celllist.d.ts +9 -283
  5. package/lib/celllist.js +73 -463
  6. package/lib/celllist.js.map +1 -1
  7. package/lib/constants.d.ts +8 -0
  8. package/lib/constants.js +13 -0
  9. package/lib/constants.js.map +1 -0
  10. package/lib/default-toolbar.d.ts +10 -9
  11. package/lib/default-toolbar.js +15 -11
  12. package/lib/default-toolbar.js.map +1 -1
  13. package/lib/default.json +160 -0
  14. package/lib/executionindicator.d.ts +63 -49
  15. package/lib/executionindicator.js +66 -45
  16. package/lib/executionindicator.js.map +1 -1
  17. package/lib/index.d.ts +6 -1
  18. package/lib/index.js +6 -1
  19. package/lib/index.js.map +1 -1
  20. package/lib/model.d.ts +93 -201
  21. package/lib/model.js +144 -268
  22. package/lib/model.js.map +1 -1
  23. package/lib/modelfactory.d.ts +22 -18
  24. package/lib/modelfactory.js +20 -12
  25. package/lib/modelfactory.js.map +1 -1
  26. package/lib/modestatus.js +4 -0
  27. package/lib/modestatus.js.map +1 -1
  28. package/lib/notebooklspadapter.d.ts +146 -0
  29. package/lib/notebooklspadapter.js +374 -0
  30. package/lib/notebooklspadapter.js.map +1 -0
  31. package/lib/notebooktools.d.ts +61 -195
  32. package/lib/notebooktools.js +86 -395
  33. package/lib/notebooktools.js.map +1 -1
  34. package/lib/panel.d.ts +4 -8
  35. package/lib/panel.js +14 -27
  36. package/lib/panel.js.map +1 -1
  37. package/lib/searchprovider.d.ts +164 -0
  38. package/lib/searchprovider.js +598 -0
  39. package/lib/searchprovider.js.map +1 -0
  40. package/lib/testutils.d.ts +74 -0
  41. package/lib/testutils.js +219 -0
  42. package/lib/testutils.js.map +1 -0
  43. package/lib/toc.d.ts +170 -0
  44. package/lib/toc.js +497 -0
  45. package/lib/toc.js.map +1 -0
  46. package/lib/tokens.d.ts +23 -1
  47. package/lib/tokens.js.map +1 -1
  48. package/lib/tracker.js.map +1 -1
  49. package/lib/truststatus.js +11 -15
  50. package/lib/truststatus.js.map +1 -1
  51. package/lib/widget.d.ts +215 -113
  52. package/lib/widget.js +592 -437
  53. package/lib/widget.js.map +1 -1
  54. package/lib/widgetfactory.d.ts +4 -10
  55. package/lib/widgetfactory.js +1 -11
  56. package/lib/widgetfactory.js.map +1 -1
  57. package/lib/windowing.d.ts +139 -0
  58. package/lib/windowing.js +293 -0
  59. package/lib/windowing.js.map +1 -0
  60. package/package.json +40 -37
  61. package/src/actions.tsx +2752 -0
  62. package/src/celllist.ts +167 -0
  63. package/src/constants.ts +14 -0
  64. package/src/default-toolbar.tsx +387 -0
  65. package/src/default.json +160 -0
  66. package/src/executionindicator.tsx +673 -0
  67. package/src/index.ts +25 -0
  68. package/src/model.ts +538 -0
  69. package/src/modelfactory.ts +135 -0
  70. package/src/modestatus.tsx +166 -0
  71. package/src/notebooklspadapter.ts +490 -0
  72. package/src/notebooktools.ts +612 -0
  73. package/src/panel.ts +314 -0
  74. package/src/searchprovider.ts +803 -0
  75. package/src/testutils.ts +267 -0
  76. package/src/toc.ts +695 -0
  77. package/src/tokens.ts +126 -0
  78. package/src/tracker.ts +104 -0
  79. package/src/truststatus.tsx +289 -0
  80. package/src/widget.ts +2854 -0
  81. package/src/widgetfactory.ts +167 -0
  82. package/src/windowing.ts +336 -0
  83. package/style/base.css +24 -20
  84. package/style/executionindicator.css +2 -2
  85. package/style/index.css +4 -0
  86. package/style/index.js +4 -0
  87. package/style/toc.css +36 -0
  88. package/style/toolbar.css +3 -0
package/lib/actions.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { ISessionContext } from '@jupyterlab/apputils';
1
+ import { ISessionContext, ISessionContextDialogs } from '@jupyterlab/apputils';
2
2
  import { Cell } from '@jupyterlab/cells';
3
3
  import * as nbformat from '@jupyterlab/nbformat';
4
4
  import { KernelMessage } from '@jupyterlab/services';
@@ -120,7 +120,7 @@ export declare namespace NotebookActions {
120
120
  */
121
121
  function deleteCells(notebook: Notebook): void;
122
122
  /**
123
- * Insert a new code cell above the active cell.
123
+ * Insert a new code cell above the active cell or in index 0 if the notebook is empty.
124
124
  *
125
125
  * @param notebook - The target notebook widget.
126
126
  *
@@ -132,7 +132,7 @@ export declare namespace NotebookActions {
132
132
  */
133
133
  function insertAbove(notebook: Notebook): void;
134
134
  /**
135
- * Insert a new code cell below the active cell.
135
+ * Insert a new code cell below the active cell or in index 0 if the notebook is empty.
136
136
  *
137
137
  * @param notebook - The target notebook widget.
138
138
  *
@@ -152,7 +152,7 @@ export declare namespace NotebookActions {
152
152
  /**
153
153
  * Move the selected cell(s) up.
154
154
  *
155
- * @param widget - The target notebook widget.
155
+ * @param notebook - The target notebook widget.
156
156
  */
157
157
  function moveUp(notebook: Notebook): void;
158
158
  /**
@@ -173,8 +173,9 @@ export declare namespace NotebookActions {
173
173
  * Run the selected cell(s).
174
174
  *
175
175
  * @param notebook - The target notebook widget.
176
- *
177
- * @param sessionContext - The optional client session object.
176
+ * @param sessionContext - The client session object.
177
+ * @param sessionDialogs - The session dialogs.
178
+ * @param translator - The application translator.
178
179
  *
179
180
  * #### Notes
180
181
  * The last selected cell will be activated, but not scrolled into view.
@@ -182,13 +183,14 @@ export declare namespace NotebookActions {
182
183
  * An execution error will prevent the remaining code cells from executing.
183
184
  * All markdown cells will be rendered.
184
185
  */
185
- function run(notebook: Notebook, sessionContext?: ISessionContext): Promise<boolean>;
186
+ function run(notebook: Notebook, sessionContext?: ISessionContext, sessionDialogs?: ISessionContextDialogs, translator?: ITranslator): Promise<boolean>;
186
187
  /**
187
188
  * Run the selected cell(s) and advance to the next cell.
188
189
  *
189
190
  * @param notebook - The target notebook widget.
190
- *
191
- * @param sessionContext - The optional client session object.
191
+ * @param sessionContext - The client session object.
192
+ * @param sessionDialogs - The session dialogs.
193
+ * @param translator - The application translator.
192
194
  *
193
195
  * #### Notes
194
196
  * The existing selection will be cleared.
@@ -198,13 +200,14 @@ export declare namespace NotebookActions {
198
200
  * If the last selected cell is the last cell, a new code cell
199
201
  * will be created in `'edit'` mode. The new cell creation can be undone.
200
202
  */
201
- function runAndAdvance(notebook: Notebook, sessionContext?: ISessionContext): Promise<boolean>;
203
+ function runAndAdvance(notebook: Notebook, sessionContext?: ISessionContext, sessionDialogs?: ISessionContextDialogs, translator?: ITranslator): Promise<boolean>;
202
204
  /**
203
205
  * Run the selected cell(s) and insert a new code cell.
204
206
  *
205
207
  * @param notebook - The target notebook widget.
206
- *
207
- * @param sessionContext - The optional client session object.
208
+ * @param sessionContext - The client session object.
209
+ * @param sessionDialogs - The session dialogs.
210
+ * @param translator - The application translator.
208
211
  *
209
212
  * #### Notes
210
213
  * An execution error will prevent the remaining code cells from executing.
@@ -214,13 +217,14 @@ export declare namespace NotebookActions {
214
217
  * The cell insert can be undone.
215
218
  * The new cell will be scrolled into view.
216
219
  */
217
- function runAndInsert(notebook: Notebook, sessionContext?: ISessionContext): Promise<boolean>;
220
+ function runAndInsert(notebook: Notebook, sessionContext?: ISessionContext, sessionDialogs?: ISessionContextDialogs, translator?: ITranslator): Promise<boolean>;
218
221
  /**
219
222
  * Run all of the cells in the notebook.
220
223
  *
221
224
  * @param notebook - The target notebook widget.
222
- *
223
- * @param sessionContext - The optional client session object.
225
+ * @param sessionContext - The client session object.
226
+ * @param sessionDialogs - The session dialogs.
227
+ * @param translator - The application translator.
224
228
  *
225
229
  * #### Notes
226
230
  * The existing selection will be cleared.
@@ -228,14 +232,15 @@ export declare namespace NotebookActions {
228
232
  * All markdown cells will be rendered.
229
233
  * The last cell in the notebook will be activated and scrolled into view.
230
234
  */
231
- function runAll(notebook: Notebook, sessionContext?: ISessionContext): Promise<boolean>;
232
- function renderAllMarkdown(notebook: Notebook, sessionContext?: ISessionContext): Promise<boolean>;
235
+ function runAll(notebook: Notebook, sessionContext?: ISessionContext, sessionDialogs?: ISessionContextDialogs, translator?: ITranslator): Promise<boolean>;
236
+ function renderAllMarkdown(notebook: Notebook): Promise<boolean>;
233
237
  /**
234
238
  * Run all of the cells before the currently active cell (exclusive).
235
239
  *
236
240
  * @param notebook - The target notebook widget.
237
- *
238
- * @param sessionContext - The optional client session object.
241
+ * @param sessionContext - The client session object.
242
+ * @param sessionDialogs - The session dialogs.
243
+ * @param translator - The application translator.
239
244
  *
240
245
  * #### Notes
241
246
  * The existing selection will be cleared.
@@ -243,13 +248,14 @@ export declare namespace NotebookActions {
243
248
  * All markdown cells will be rendered.
244
249
  * The currently active cell will remain selected.
245
250
  */
246
- function runAllAbove(notebook: Notebook, sessionContext?: ISessionContext): Promise<boolean>;
251
+ function runAllAbove(notebook: Notebook, sessionContext?: ISessionContext, sessionDialogs?: ISessionContextDialogs, translator?: ITranslator): Promise<boolean>;
247
252
  /**
248
253
  * Run all of the cells after the currently active cell (inclusive).
249
254
  *
250
255
  * @param notebook - The target notebook widget.
251
- *
252
- * @param sessionContext - The optional client session object.
256
+ * @param sessionContext - The client session object.
257
+ * @param sessionDialogs - The session dialogs.
258
+ * @param translator - The application translator.
253
259
  *
254
260
  * #### Notes
255
261
  * The existing selection will be cleared.
@@ -257,7 +263,7 @@ export declare namespace NotebookActions {
257
263
  * All markdown cells will be rendered.
258
264
  * The last cell in the notebook will be activated and scrolled into view.
259
265
  */
260
- function runAllBelow(notebook: Notebook, sessionContext?: ISessionContext): Promise<boolean>;
266
+ function runAllBelow(notebook: Notebook, sessionContext?: ISessionContext, sessionDialogs?: ISessionContextDialogs, translator?: ITranslator): Promise<boolean>;
261
267
  /**
262
268
  * Replaces the selection in the active cell of the notebook.
263
269
  *
@@ -293,12 +299,12 @@ export declare namespace NotebookActions {
293
299
  *
294
300
  * @param notebook - The target notebook widget
295
301
  */
296
- function insertSameLevelHeadingAbove(notebook: Notebook): void;
302
+ function insertSameLevelHeadingAbove(notebook: Notebook): Promise<void>;
297
303
  /** Insert new heading of same level at end of current section.
298
304
  *
299
305
  * @param notebook - The target notebook widget
300
306
  */
301
- function insertSameLevelHeadingBelow(notebook: Notebook): void;
307
+ function insertSameLevelHeadingBelow(notebook: Notebook): Promise<void>;
302
308
  /**
303
309
  * Select the heading above the active cell or, if already at heading, collapse it.
304
310
  *
@@ -356,7 +362,7 @@ export declare namespace NotebookActions {
356
362
  */
357
363
  function deselectAll(notebook: Notebook): void;
358
364
  /**
359
- * Copy the selected cell data to a clipboard.
365
+ * Copy the selected cell(s) data to a clipboard.
360
366
  *
361
367
  * @param notebook - The target notebook widget.
362
368
  */
@@ -376,24 +382,42 @@ export declare namespace NotebookActions {
376
382
  *
377
383
  * @param notebook - The target notebook widget.
378
384
  *
379
- * @param mode - the mode of the paste operation: 'below' pastes cells
380
- * below the active cell, 'above' pastes cells above the active cell,
381
- * and 'replace' removes the currently selected cells and pastes cells
382
- * in their place.
385
+ * @param mode - the mode of adding cells:
386
+ * 'below' (default) adds cells below the active cell,
387
+ * 'belowSelected' adds cells below all selected cells,
388
+ * 'above' adds cells above the active cell, and
389
+ * 'replace' removes the currently selected cells and adds cells in their place.
390
+ *
391
+ * #### Notes
392
+ * The last pasted cell becomes the active cell.
393
+ * This is a no-op if there is no cell data on the clipboard.
394
+ * This action can be undone.
395
+ */
396
+ function paste(notebook: Notebook, mode?: 'below' | 'belowSelected' | 'above' | 'replace'): void;
397
+ /**
398
+ * Duplicate selected cells in the notebook without using the application clipboard.
399
+ *
400
+ * @param notebook - The target notebook widget.
401
+ *
402
+ * @param mode - the mode of adding cells:
403
+ * 'below' (default) adds cells below the active cell,
404
+ * 'belowSelected' adds cells below all selected cells,
405
+ * 'above' adds cells above the active cell, and
406
+ * 'replace' removes the currently selected cells and adds cells in their place.
383
407
  *
384
408
  * #### Notes
385
409
  * The last pasted cell becomes the active cell.
386
410
  * This is a no-op if there is no cell data on the clipboard.
387
411
  * This action can be undone.
388
412
  */
389
- function paste(notebook: Notebook, mode?: 'below' | 'above' | 'replace'): void;
413
+ function duplicate(notebook: Notebook, mode?: 'below' | 'belowSelected' | 'above' | 'replace'): void;
390
414
  /**
391
415
  * Undo a cell action.
392
416
  *
393
417
  * @param notebook - The target notebook widget.
394
418
  *
395
419
  * #### Notes
396
- * This is a no-op if if there are no cell actions to undo.
420
+ * This is a no-op if there are no cell actions to undo.
397
421
  */
398
422
  function undo(notebook: Notebook): void;
399
423
  /**