@jupyterlab/notebook-extension 4.7.0-alpha.1 → 4.7.0-alpha.2

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/nboutput.js CHANGED
@@ -42,8 +42,13 @@ function activateNBOutput(app, nbtracker, loggerRegistry) {
42
42
  // There is overlap here since unhandled messages are also emitted in the
43
43
  // iopubMessage signal. However, unhandled messages warrant a higher log
44
44
  // severity, so we'll accept that they are logged twice.
45
- nb.context.sessionContext.iopubMessage.connect((_, msg) => logOutput(msg, 'info', 'info'));
46
- nb.context.sessionContext.unhandledMessage.connect((_, msg) => logOutput(msg, 'warning', 'error'));
45
+ //
46
+ // The session context outlives this panel when other views of the
47
+ // document stay open, so the connections are made with the panel as
48
+ // receiver: `Widget.dispose()` calls `Signal.clearData(this)`, which
49
+ // removes them when the panel is closed.
50
+ nb.context.sessionContext.iopubMessage.connect((_, msg) => logOutput(msg, 'info', 'info'), nb);
51
+ nb.context.sessionContext.unhandledMessage.connect((_, msg) => logOutput(msg, 'warning', 'error'), nb);
47
52
  }
48
53
  nbtracker.forEach(nb => registerNB(nb));
49
54
  nbtracker.widgetAdded.connect((_, nb) => registerNB(nb));
@@ -1 +1 @@
1
- {"version":3,"file":"nboutput.js","sourceRoot":"","sources":["../src/nboutput.ts"],"names":[],"mappings":"AAAA,0CAA0C;AAC1C,2DAA2D;AAO3D,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAGzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAErD;;GAEG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAgC;IAC5D,QAAQ,EAAE,gBAAgB;IAC1B,EAAE,EAAE,2CAA2C;IAC/C,WAAW,EAAE,kDAAkD;IAC/D,QAAQ,EAAE,CAAC,gBAAgB,CAAC;IAC5B,QAAQ,EAAE,CAAC,eAAe,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EAAE,EAAE,CACtC,SAAS,CAAC,GAAG,EAAE,SAAS,EAAE,OAAO,CAAC,EACpC,EAAE,CACH,CAAC;IACJ,CAAC;IACD,SAAS,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC,CAAC;IACxC,SAAS,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC,CAAC;AAC3D,CAAC"}
@@ -2,6 +2,17 @@ import type { FieldProps } from '@rjsf/utils';
2
2
  import type { IEditorLanguageRegistry } from '@jupyterlab/codemirror';
3
3
  import type { INotebookTracker } from '@jupyterlab/notebook';
4
4
  import { NotebookTools } from '@jupyterlab/notebook';
5
+ import type { ITranslator } from '@jupyterlab/translation';
6
+ interface ICellIdFieldProps extends FieldProps {
7
+ /**
8
+ * The tracker to the notebook panel.
9
+ */
10
+ tracker: INotebookTracker;
11
+ /**
12
+ * Language translator.
13
+ */
14
+ translator?: ITranslator;
15
+ }
5
16
  declare namespace Private {
6
17
  /**
7
18
  * Custom active cell field options.
@@ -17,19 +28,64 @@ declare namespace Private {
17
28
  languages: IEditorLanguageRegistry;
18
29
  }
19
30
  }
31
+ /**
32
+ * The cell ID field, displaying the ID of the active cell.
33
+ *
34
+ * ## Note
35
+ * This field does not work as other metadata form fields, as it does not update metadata.
36
+ */
37
+ export declare function CellIdField(props: ICellIdFieldProps): JSX.Element;
20
38
  /**
21
39
  * The active cell field, displaying the first line and execution count of the active cell.
22
40
  *
23
41
  * ## Note
24
42
  * This field does not work as other metadata form fields, as it does not update metadata.
43
+ *
44
+ * A single instance is meant to be shared by every render of the field. The
45
+ * displayed cell follows the notebook tracker rather than the render calls, so
46
+ * that the field keeps working when the metadata form is not being rebuilt, and
47
+ * so that it does not hold on to a cell model of a closed notebook.
48
+ *
49
+ * One instance owns one node, so the field can only be mounted in one place at
50
+ * a time: `render` moves the node to the most recent mount point and leaves any
51
+ * earlier one empty. Nothing renders this field twice today.
25
52
  */
26
53
  export declare class ActiveCellTool extends NotebookTools.Tool {
27
54
  constructor(options: Private.IOptions);
55
+ dispose(): void;
28
56
  render(props: FieldProps): JSX.Element;
29
- private refresh;
57
+ /**
58
+ * Follow the active cell of the tracker, which is null once the last
59
+ * notebook is closed.
60
+ */
61
+ private _onActiveCellChanged;
62
+ /**
63
+ * Handle a change to the current cell source, mime type or execution count.
64
+ */
65
+ private _onCellContentChanged;
66
+ /**
67
+ * Stop listening to the cell model the tool is currently displaying.
68
+ */
69
+ private _disconnectCellModel;
70
+ /**
71
+ * Reflect the execution count of the current cell.
72
+ */
73
+ private _updatePrompt;
74
+ /**
75
+ * Refresh the preview, writing an outdated prompt along with it.
76
+ *
77
+ * The prompt is written in the same task as the preview it belongs with, so
78
+ * that the field never shows the prompt of one cell above the source line of
79
+ * another while a language mode is being loaded.
80
+ */
81
+ private _update;
30
82
  private _tracker;
83
+ private _languages;
31
84
  private _cellModel;
32
- private _refreshDebouncer;
85
+ private _previewDebouncer;
86
+ private _updateId;
87
+ private _pendingUpdate;
88
+ private _promptOutdated;
33
89
  private _editorEl;
34
90
  private _inputPrompt;
35
91
  }
@@ -3,9 +3,13 @@
3
3
  * Distributed under the terms of the Modified BSD License.
4
4
  */
5
5
  import React from 'react';
6
+ import { SystemClipboard } from '@jupyterlab/apputils';
7
+ import { PageConfig } from '@jupyterlab/coreutils';
6
8
  import { NotebookTools } from '@jupyterlab/notebook';
7
9
  import { PanelLayout, Widget } from '@lumino/widgets';
8
- import { InputPrompt } from '@jupyterlab/cells';
10
+ import { InputPrompt, isCodeCellModel } from '@jupyterlab/cells';
11
+ import { nullTranslator } from '@jupyterlab/translation';
12
+ import { checkIcon, copyIcon, linkIcon, ToolbarButtonComponent } from '@jupyterlab/ui-components';
9
13
  import { Debouncer } from '@lumino/polling';
10
14
  /**
11
15
  * The class name added to the ActiveCellTool.
@@ -19,17 +23,102 @@ const ACTIVE_CELL_TOOL_CONTENT_CLASS = 'jp-ActiveCellTool-Content';
19
23
  * The class name added to the ActiveCellTool cell content.
20
24
  */
21
25
  const ACTIVE_CELL_TOOL_CELL_CONTENT_CLASS = 'jp-ActiveCellTool-CellContent';
26
+ /**
27
+ * The class name added to the cell ID field.
28
+ */
29
+ const CELL_ID_FIELD_CLASS = 'jp-CellIdField';
30
+ /**
31
+ * The cell ID field, displaying the ID of the active cell.
32
+ *
33
+ * ## Note
34
+ * This field does not work as other metadata form fields, as it does not update metadata.
35
+ */
36
+ export function CellIdField(props) {
37
+ var _a, _b, _c, _d;
38
+ const translator = (_a = props.translator) !== null && _a !== void 0 ? _a : nullTranslator;
39
+ const trans = translator.load('jupyterlab');
40
+ const title = (_b = props.schema.title) !== null && _b !== void 0 ? _b : trans.__('Cell ID');
41
+ const activeCellId = (_d = (_c = props.tracker.activeCell) === null || _c === void 0 ? void 0 : _c.model.id) !== null && _d !== void 0 ? _d : '';
42
+ const [copiedAction, setCopiedAction] = React.useState(null);
43
+ const copiedTimeout = React.useRef(null);
44
+ React.useEffect(() => {
45
+ setCopiedAction(null);
46
+ }, [activeCellId]);
47
+ React.useEffect(() => {
48
+ return () => {
49
+ if (copiedTimeout.current !== null) {
50
+ window.clearTimeout(copiedTimeout.current);
51
+ }
52
+ };
53
+ }, []);
54
+ const showCopied = (action) => {
55
+ setCopiedAction(action);
56
+ if (copiedTimeout.current !== null) {
57
+ window.clearTimeout(copiedTimeout.current);
58
+ }
59
+ copiedTimeout.current = window.setTimeout(() => {
60
+ setCopiedAction(null);
61
+ copiedTimeout.current = null;
62
+ }, 1400);
63
+ };
64
+ const onCopyId = () => {
65
+ if (!activeCellId) {
66
+ return;
67
+ }
68
+ void SystemClipboard.getInstance()
69
+ .setData('text/plain', activeCellId)
70
+ .then(() => showCopied('id'));
71
+ };
72
+ const onCopyLink = () => {
73
+ const notebookPanel = props.tracker.currentWidget;
74
+ const activeCell = props.tracker.activeCell;
75
+ if (!notebookPanel || !activeCell) {
76
+ return;
77
+ }
78
+ const url = PageConfig.getUrl({
79
+ workspace: PageConfig.defaultWorkspace,
80
+ treePath: notebookPanel.context.path,
81
+ toShare: true
82
+ });
83
+ void SystemClipboard.getInstance()
84
+ .setData('text/plain', `${url}#cell-id=${encodeURIComponent(activeCell.model.id)}`)
85
+ .then(() => showCopied('link'));
86
+ };
87
+ return (React.createElement("div", { className: CELL_ID_FIELD_CLASS },
88
+ React.createElement("label", { htmlFor: props.idSchema.$id }, title),
89
+ React.createElement("div", { className: "jp-CellIdField-row" },
90
+ React.createElement("input", { className: "jp-mod-styled jp-CellIdField-input", id: props.idSchema.$id, readOnly: true, type: "text", value: activeCellId }),
91
+ React.createElement(ToolbarButtonComponent, { className: `jp-CellIdField-button ${copiedAction === 'id' ? 'jp-mod-copied' : ''}`, enabled: !!activeCellId, icon: copiedAction === 'id' ? checkIcon : copyIcon, iconLabel: trans.__('Copy cell ID'), onClick: onCopyId, tooltip: copiedAction === 'id'
92
+ ? trans.__('Copied')
93
+ : trans.__('Copy cell ID') }),
94
+ React.createElement(ToolbarButtonComponent, { className: `jp-CellIdField-button ${copiedAction === 'link' ? 'jp-mod-copied' : ''}`, enabled: !!activeCellId, icon: copiedAction === 'link' ? checkIcon : linkIcon, iconLabel: trans.__('Copy link to cell'), onClick: onCopyLink, tooltip: copiedAction === 'link'
95
+ ? trans.__('Copied')
96
+ : trans.__('Copy link to cell') }))));
97
+ }
22
98
  /**
23
99
  * The active cell field, displaying the first line and execution count of the active cell.
24
100
  *
25
101
  * ## Note
26
102
  * This field does not work as other metadata form fields, as it does not update metadata.
103
+ *
104
+ * A single instance is meant to be shared by every render of the field. The
105
+ * displayed cell follows the notebook tracker rather than the render calls, so
106
+ * that the field keeps working when the metadata form is not being rebuilt, and
107
+ * so that it does not hold on to a cell model of a closed notebook.
108
+ *
109
+ * One instance owns one node, so the field can only be mounted in one place at
110
+ * a time: `render` moves the node to the most recent mount point and leaves any
111
+ * earlier one empty. Nothing renders this field twice today.
27
112
  */
28
113
  export class ActiveCellTool extends NotebookTools.Tool {
29
114
  constructor(options) {
30
115
  super();
31
- const { languages } = options;
116
+ this._cellModel = null;
117
+ this._updateId = 0;
118
+ this._pendingUpdate = false;
119
+ this._promptOutdated = false;
32
120
  this._tracker = options.tracker;
121
+ this._languages = options.languages;
33
122
  this.addClass(ACTIVE_CELL_TOOL_CLASS);
34
123
  this.layout = new PanelLayout();
35
124
  this._inputPrompt = new InputPrompt();
@@ -42,37 +131,155 @@ export class ActiveCellTool extends NotebookTools.Tool {
42
131
  container.className = ACTIVE_CELL_TOOL_CELL_CONTENT_CLASS;
43
132
  this._editorEl = editor;
44
133
  this.layout.addWidget(new Widget({ node }));
45
- const update = async () => {
46
- var _a, _b;
47
- this._editorEl.innerHTML = '';
48
- if (((_a = this._cellModel) === null || _a === void 0 ? void 0 : _a.type) === 'code') {
49
- this._inputPrompt.executionCount = `${(_b = this._cellModel.executionCount) !== null && _b !== void 0 ? _b : ''}`;
50
- this._inputPrompt.show();
51
- }
52
- else {
53
- this._inputPrompt.executionCount = null;
54
- this._inputPrompt.hide();
55
- }
56
- if (this._cellModel) {
57
- await languages.highlight(this._cellModel.sharedModel.getSource().split('\n')[0], languages.findByMIME(this._cellModel.mimeType), this._editorEl);
58
- }
59
- };
60
- this._refreshDebouncer = new Debouncer(update, 150);
134
+ // Only edits to the current cell are rate-limited; switching cells updates
135
+ // the display immediately, see `_onActiveCellChanged`.
136
+ this._previewDebouncer = new Debouncer(() => this._update(), 150);
137
+ this._tracker.activeCellChanged.connect(this._onActiveCellChanged, this);
138
+ // `activeCellChanged` is not emitted when the last notebook is closed:
139
+ // NotebookTracker.onCurrentChanged returns early on a null widget. Without
140
+ // this second connection the field would keep the cell model of a closed
141
+ // notebook, and its shared model, alive for the rest of the session.
142
+ this._tracker.currentChanged.connect(this._onActiveCellChanged, this);
143
+ this._onActiveCellChanged();
144
+ }
145
+ dispose() {
146
+ if (this.isDisposed) {
147
+ return;
148
+ }
149
+ this._tracker.activeCellChanged.disconnect(this._onActiveCellChanged, this);
150
+ this._tracker.currentChanged.disconnect(this._onActiveCellChanged, this);
151
+ this._disconnectCellModel();
152
+ this._previewDebouncer.dispose();
153
+ super.dispose();
61
154
  }
62
155
  render(props) {
156
+ // The content is driven by the tracker; React only supplies the mount
157
+ // point, which is a different element on every rebuild of the form.
158
+ return (React.createElement("div", { ref: ref => {
159
+ if (!ref || this.node.parentElement === ref) {
160
+ return;
161
+ }
162
+ ref.appendChild(this.node);
163
+ if (this._pendingUpdate) {
164
+ this._update().catch(console.warn);
165
+ }
166
+ } }));
167
+ }
168
+ /**
169
+ * Follow the active cell of the tracker, which is null once the last
170
+ * notebook is closed.
171
+ */
172
+ _onActiveCellChanged() {
63
173
  var _a, _b;
64
- const activeCell = this._tracker.activeCell;
65
- if (activeCell)
66
- this._cellModel = (activeCell === null || activeCell === void 0 ? void 0 : activeCell.model) || null;
67
- ((_a = this._cellModel) === null || _a === void 0 ? void 0 : _a.sharedModel).changed.connect(this.refresh, this);
68
- (_b = this._cellModel) === null || _b === void 0 ? void 0 : _b.mimeTypeChanged.connect(this.refresh, this);
69
- this.refresh()
70
- .then(() => undefined)
71
- .catch(console.warn);
72
- return React.createElement("div", { ref: ref => ref === null || ref === void 0 ? void 0 : ref.appendChild(this.node) });
174
+ const cellModel = (_b = (_a = this._tracker.activeCell) === null || _a === void 0 ? void 0 : _a.model) !== null && _b !== void 0 ? _b : null;
175
+ if (cellModel === this._cellModel) {
176
+ return;
177
+ }
178
+ this._disconnectCellModel();
179
+ this._cellModel = cellModel;
180
+ if (cellModel) {
181
+ cellModel.sharedModel.changed.connect(this._onCellContentChanged, this);
182
+ cellModel.mimeTypeChanged.connect(this._onCellContentChanged, this);
183
+ }
184
+ // The prompt now belongs to a cell whose source line is not on screen yet,
185
+ // so leave it to `_update` to write both together.
186
+ this._promptOutdated = true;
187
+ this._update().catch(console.warn);
188
+ }
189
+ /**
190
+ * Handle a change to the current cell source, mime type or execution count.
191
+ */
192
+ _onCellContentChanged() {
193
+ if (!this.node.isConnected) {
194
+ this._pendingUpdate = true;
195
+ this._promptOutdated = true;
196
+ return;
197
+ }
198
+ if (!this._promptOutdated) {
199
+ // The cell is unchanged and no switch is in flight, so writing the prompt
200
+ // now cannot pair it with the source line of a different cell.
201
+ this._updatePrompt();
202
+ }
203
+ this._previewDebouncer.invoke().catch(console.warn);
204
+ }
205
+ /**
206
+ * Stop listening to the cell model the tool is currently displaying.
207
+ */
208
+ _disconnectCellModel() {
209
+ const cellModel = this._cellModel;
210
+ if (!cellModel) {
211
+ return;
212
+ }
213
+ cellModel.sharedModel.changed.disconnect(this._onCellContentChanged, this);
214
+ cellModel.mimeTypeChanged.disconnect(this._onCellContentChanged, this);
215
+ this._cellModel = null;
216
+ }
217
+ /**
218
+ * Reflect the execution count of the current cell.
219
+ */
220
+ _updatePrompt() {
221
+ var _a;
222
+ const cellModel = this._cellModel;
223
+ if (cellModel && isCodeCellModel(cellModel)) {
224
+ this._inputPrompt.executionCount = `${(_a = cellModel.executionCount) !== null && _a !== void 0 ? _a : ''}`;
225
+ this._inputPrompt.show();
226
+ }
227
+ else {
228
+ this._inputPrompt.executionCount = null;
229
+ this._inputPrompt.hide();
230
+ }
73
231
  }
74
- async refresh() {
75
- await this._refreshDebouncer.invoke();
232
+ /**
233
+ * Refresh the preview, writing an outdated prompt along with it.
234
+ *
235
+ * The prompt is written in the same task as the preview it belongs with, so
236
+ * that the field never shows the prompt of one cell above the source line of
237
+ * another while a language mode is being loaded.
238
+ */
239
+ async _update() {
240
+ if (!this.node.isConnected) {
241
+ // Nothing is on screen; catch up when the field is mounted again.
242
+ this._pendingUpdate = true;
243
+ return;
244
+ }
245
+ this._pendingUpdate = false;
246
+ const cellModel = this._cellModel;
247
+ const pending = ++this._updateId;
248
+ if (!cellModel) {
249
+ this._promptOutdated = false;
250
+ this._updatePrompt();
251
+ this._editorEl.replaceChildren();
252
+ return;
253
+ }
254
+ const source = cellModel.sharedModel.getSource();
255
+ const lineEnd = source.indexOf('\n');
256
+ const firstLine = lineEnd === -1 ? source : source.slice(0, lineEnd);
257
+ // Highlight into a detached node, so that the preview is never cleared
258
+ // while waiting for a language mode to load.
259
+ const staging = document.createElement('pre');
260
+ try {
261
+ await this._languages.highlight(firstLine, this._languages.findByMIME(cellModel.mimeType), staging);
262
+ }
263
+ catch (error) {
264
+ // Fall back to unhighlighted source rather than keeping the previous
265
+ // cell's line on screen.
266
+ console.warn(error);
267
+ staging.replaceChildren(document.createTextNode(firstLine));
268
+ }
269
+ if (pending !== this._updateId) {
270
+ // A newer update started while this one was highlighting; it still owes
271
+ // the prompt write, so `_promptOutdated` is deliberately left set.
272
+ return;
273
+ }
274
+ if (this._promptOutdated) {
275
+ this._updatePrompt();
276
+ this._promptOutdated = false;
277
+ }
278
+ const fragment = document.createDocumentFragment();
279
+ while (staging.firstChild) {
280
+ fragment.appendChild(staging.firstChild);
281
+ }
282
+ this._editorEl.replaceChildren(fragment);
76
283
  }
77
284
  }
78
285
  //# sourceMappingURL=activeCellToolWidget.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"activeCellToolWidget.js","sourceRoot":"","sources":["../../src/tool-widgets/activeCellToolWidget.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAErD,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAEtD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C;;GAEG;AACH,MAAM,sBAAsB,GAAG,mBAAmB,CAAC;AACnD;;GAEG;AACH,MAAM,8BAA8B,GAAG,2BAA2B,CAAC;AACnE;;GAEG;AACH,MAAM,mCAAmC,GAAG,+BAA+B,CAAC;AAmB5E;;;;;GAKG;AACH,MAAM,OAAO,cAAe,SAAQ,aAAa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CAAC,UAAU,CAAC,UAAU,CAAC,SAAS,CAAC,QAAQ,CAAC,EAC9C,OAAO,CACR,CAAC;QACJ,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,qEAAqE;YACrE,yBAAyB;YACzB,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YACpB,OAAO,CAAC,eAAe,CAAC,QAAQ,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC,CAAC;QAC9D,CAAC;QAED,IAAI,OAAO,KAAK,IAAI,CAAC,SAAS,EAAE,CAAC;YAC/B,wEAAwE;YACxE,mEAAmE;YACnE,OAAO;QACT,CAAC;QAED,IAAI,IAAI,CAAC,eAAe,EAAE,CAAC;YACzB,IAAI,CAAC,aAAa,EAAE,CAAC;YACrB,IAAI,CAAC,eAAe,GAAG,KAAK,CAAC;QAC/B,CAAC;QACD,MAAM,QAAQ,GAAG,QAAQ,CAAC,sBAAsB,EAAE,CAAC;QACnD,OAAO,OAAO,CAAC,UAAU,EAAE,CAAC;YAC1B,QAAQ,CAAC,WAAW,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;QAC3C,CAAC;QACD,IAAI,CAAC,SAAS,CAAC,eAAe,CAAC,QAAQ,CAAC,CAAC;IAC3C,CAAC;CAWF"}
@@ -40,9 +40,12 @@ export class CellMetadataField extends NotebookTools.MetadataEditorTool {
40
40
  render(props) {
41
41
  var _a;
42
42
  const cell = this._tracker.activeCell;
43
+ // Replace and dispose the source created for the previous render.
44
+ const previousSource = this.editor.source;
43
45
  this.editor.source = cell
44
46
  ? new ObservableJSON({ values: cell.model.metadata })
45
47
  : null;
48
+ previousSource === null || previousSource === void 0 ? void 0 : previousSource.dispose();
46
49
  (_a = this.editor.source) === null || _a === void 0 ? void 0 : _a.changed.connect(this._onSourceChanged, this);
47
50
  return (React.createElement("div", { className: CELL_METADATA_EDITOR_CLASS },
48
51
  React.createElement("div", { ref: ref => ref === null || ref === void 0 ? void 0 : ref.appendChild(this.node) })));
@@ -73,9 +76,12 @@ export class NotebookMetadataField extends NotebookTools.MetadataEditorTool {
73
76
  render(props) {
74
77
  var _a, _b;
75
78
  const notebook = this._tracker.currentWidget;
79
+ // Replace and dispose the source created for the previous render.
80
+ const previousSource = this.editor.source;
76
81
  this.editor.source = notebook
77
82
  ? new ObservableJSON({ values: (_a = notebook.model) === null || _a === void 0 ? void 0 : _a.metadata })
78
83
  : null;
84
+ previousSource === null || previousSource === void 0 ? void 0 : previousSource.dispose();
79
85
  (_b = this.editor.source) === null || _b === void 0 ? void 0 : _b.changed.connect(this._onSourceChanged, this);
80
86
  return (React.createElement("div", { className: NOTEBOOK_METADATA_EDITOR_CLASS },
81
87
  React.createElement("div", { ref: ref => ref === null || ref === void 0 ? void 0 : ref.appendChild(this.node) })));
@@ -1 +1 @@
1
- {"version":3,"file":"metadataEditorFields.js","sourceRoot":"","sources":["../../src/tool-widgets/metadataEditorFields.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAGrD,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAGzD,MAAM,0BAA0B,GAAG,uBAAuB,CAAC;AAC3D,MAAM,8BAA8B,GAAG,2BAA2B,CAAC;AA6BnE;;;;;;;GAOG;AACH,MAAM,OAAO,iBAAkB,SAAQ,aAAa,CAAC,kBAAkB;IACrE,YAAY,OAAyB;QACnC,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC,OAAO,CAAC;QAEhC,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,gBAAgB,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;QACvE,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,gBAAgB,CAAC,OAAO,EAAE,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;QACxE,I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AAO,CAAC,OAAO,CAAC,IAAI,CAAC,gBAAgB,EAAE,IAAI,CAAC,CAAC;QAEjE,OAAO,CACL,6BAAK,SAAS,EAAE,8BAA8B;YAC5C,6BAAK,GAAG,EAAE,GAAG,CAAC,EAAE,CAAC,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,GAAQ,CAChD,CACP,CAAC;IACJ,CAAC;CAGF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jupyterlab/notebook-extension",
3
- "version": "4.7.0-alpha.1",
3
+ "version": "4.7.0-alpha.2",
4
4
  "description": "JupyterLab - Notebook Extension",
5
5
  "homepage": "https://github.com/jupyterlab/jupyterlab",
6
6
  "bugs": {
@@ -37,37 +37,37 @@
37
37
  },
38
38
  "dependencies": {
39
39
  "@jupyter/ydoc": "^4.0.0",
40
- "@jupyterlab/application": "^4.7.0-alpha.1",
41
- "@jupyterlab/apputils": "^4.8.0-alpha.1",
42
- "@jupyterlab/cell-toolbar": "^4.7.0-alpha.1",
43
- "@jupyterlab/cells": "^4.7.0-alpha.1",
44
- "@jupyterlab/codeeditor": "^4.7.0-alpha.1",
45
- "@jupyterlab/codemirror": "^4.7.0-alpha.1",
46
- "@jupyterlab/completer": "^4.7.0-alpha.1",
47
- "@jupyterlab/coreutils": "^6.7.0-alpha.1",
48
- "@jupyterlab/docmanager": "^4.7.0-alpha.1",
49
- "@jupyterlab/docmanager-extension": "^4.7.0-alpha.1",
50
- "@jupyterlab/docregistry": "^4.7.0-alpha.1",
51
- "@jupyterlab/documentsearch": "^4.7.0-alpha.1",
52
- "@jupyterlab/filebrowser": "^4.7.0-alpha.1",
53
- "@jupyterlab/launcher": "^4.7.0-alpha.1",
54
- "@jupyterlab/logconsole": "^4.7.0-alpha.1",
55
- "@jupyterlab/lsp": "^4.7.0-alpha.1",
56
- "@jupyterlab/mainmenu": "^4.7.0-alpha.1",
57
- "@jupyterlab/metadataform": "^4.7.0-alpha.1",
58
- "@jupyterlab/nbformat": "^4.7.0-alpha.1",
59
- "@jupyterlab/notebook": "^4.7.0-alpha.1",
60
- "@jupyterlab/observables": "^5.7.0-alpha.1",
61
- "@jupyterlab/outputarea": "^4.7.0-alpha.1",
62
- "@jupyterlab/property-inspector": "^4.7.0-alpha.1",
63
- "@jupyterlab/rendermime": "^4.7.0-alpha.1",
64
- "@jupyterlab/services": "^7.7.0-alpha.1",
65
- "@jupyterlab/settingregistry": "^4.7.0-alpha.1",
66
- "@jupyterlab/statedb": "^4.7.0-alpha.1",
67
- "@jupyterlab/statusbar": "^4.7.0-alpha.1",
68
- "@jupyterlab/toc": "^6.7.0-alpha.1",
69
- "@jupyterlab/translation": "^4.7.0-alpha.1",
70
- "@jupyterlab/ui-components": "^4.7.0-alpha.1",
40
+ "@jupyterlab/application": "^4.7.0-alpha.2",
41
+ "@jupyterlab/apputils": "^4.8.0-alpha.2",
42
+ "@jupyterlab/cell-toolbar": "^4.7.0-alpha.2",
43
+ "@jupyterlab/cells": "^4.7.0-alpha.2",
44
+ "@jupyterlab/codeeditor": "^4.7.0-alpha.2",
45
+ "@jupyterlab/codemirror": "^4.7.0-alpha.2",
46
+ "@jupyterlab/completer": "^4.7.0-alpha.2",
47
+ "@jupyterlab/coreutils": "^6.7.0-alpha.2",
48
+ "@jupyterlab/docmanager": "^4.7.0-alpha.2",
49
+ "@jupyterlab/docmanager-extension": "^4.7.0-alpha.2",
50
+ "@jupyterlab/docregistry": "^4.7.0-alpha.2",
51
+ "@jupyterlab/documentsearch": "^4.7.0-alpha.2",
52
+ "@jupyterlab/filebrowser": "^4.7.0-alpha.2",
53
+ "@jupyterlab/launcher": "^4.7.0-alpha.2",
54
+ "@jupyterlab/logconsole": "^4.7.0-alpha.2",
55
+ "@jupyterlab/lsp": "^4.7.0-alpha.2",
56
+ "@jupyterlab/mainmenu": "^4.7.0-alpha.2",
57
+ "@jupyterlab/metadataform": "^4.7.0-alpha.2",
58
+ "@jupyterlab/nbformat": "^4.7.0-alpha.2",
59
+ "@jupyterlab/notebook": "^4.7.0-alpha.2",
60
+ "@jupyterlab/observables": "^5.7.0-alpha.2",
61
+ "@jupyterlab/outputarea": "^4.7.0-alpha.2",
62
+ "@jupyterlab/property-inspector": "^4.7.0-alpha.2",
63
+ "@jupyterlab/rendermime": "^4.7.0-alpha.2",
64
+ "@jupyterlab/services": "^7.7.0-alpha.2",
65
+ "@jupyterlab/settingregistry": "^4.7.0-alpha.2",
66
+ "@jupyterlab/statedb": "^4.7.0-alpha.2",
67
+ "@jupyterlab/statusbar": "^4.7.0-alpha.2",
68
+ "@jupyterlab/toc": "^6.7.0-alpha.2",
69
+ "@jupyterlab/translation": "^4.7.0-alpha.2",
70
+ "@jupyterlab/ui-components": "^4.7.0-alpha.2",
71
71
  "@lumino/algorithm": "^2.0.5",
72
72
  "@lumino/commands": "^2.3.4",
73
73
  "@lumino/coreutils": "^2.2.3",
package/schema/tools.json CHANGED
@@ -43,6 +43,10 @@
43
43
  }
44
44
  ]
45
45
  },
46
+ "_CELL-ID": {
47
+ "title": "Cell ID",
48
+ "type": "null"
49
+ },
46
50
  "/slideshow/slide_type": {
47
51
  "title": "Slide Type",
48
52
  "type": "string",
@@ -112,6 +116,7 @@
112
116
  }
113
117
  },
114
118
  "uiSchema": {
119
+ "ui:order": ["_CELL-TOOL", "/editable", "/deletable", "_CELL-ID", "*"],
115
120
  "/editable": {
116
121
  "ui:widget": "select"
117
122
  },
@@ -123,6 +128,9 @@
123
128
  "_CELL-TOOL": {
124
129
  "customRenderer": "@jupyterlab/notebook-extension:active-cell-tool.renderer"
125
130
  },
131
+ "_CELL-ID": {
132
+ "customRenderer": "@jupyterlab/notebook-extension:active-cell-tool.cell-id"
133
+ },
126
134
  "/raw_mimetype": {
127
135
  "cellTypes": ["raw"]
128
136
  },