jupyterlab-ipyflow 0.0.128 → 0.0.129

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 (2) hide show
  1. package/lib/index.js +19 -22
  2. package/package.json +2 -2
package/lib/index.js CHANGED
@@ -66,7 +66,7 @@ let cellModelsById = {};
66
66
  let orderIdxById = {};
67
67
  let cellPendingExecution = null;
68
68
  let lastExecutionMode = null;
69
- let lastExecutionHighlightsEnabled = null;
69
+ let lastExecutionHighlights = null;
70
70
  let executedReactiveReadyCells = new Set();
71
71
  let newReadyCells = new Set();
72
72
  let forcedReactiveCells = new Set();
@@ -193,25 +193,10 @@ const connectToComm = (session, notebook) => {
193
193
  itercell.node.classList.remove(readyMakingInputClass);
194
194
  }
195
195
  });
196
- const payload = {
196
+ comm.send({
197
197
  type: 'compute_exec_schedule',
198
198
  executed_cell_id: cell.id,
199
199
  cell_metadata_by_id,
200
- };
201
- comm.send(payload).done.then(() => {
202
- if (cellPendingExecution !== null) {
203
- CodeCell.execute(cellPendingExecution, session);
204
- }
205
- else {
206
- if (lastExecutionMode === 'reactive') {
207
- readyCells = executedReactiveReadyCells;
208
- updateUI(notebook);
209
- }
210
- resetReactiveState();
211
- comm.send({
212
- type: 'reactivity_cleanup',
213
- });
214
- }
215
200
  });
216
201
  };
217
202
  const notifyActiveCell = (newActiveCell) => {
@@ -317,7 +302,7 @@ const connectToComm = (session, notebook) => {
317
302
  };
318
303
  const updateUI = (notebook) => {
319
304
  clearCellState(notebook);
320
- if (!lastExecutionHighlightsEnabled) {
305
+ if (lastExecutionHighlights === 'none') {
321
306
  return;
322
307
  }
323
308
  refreshNodeMapping(notebook);
@@ -345,7 +330,7 @@ const connectToComm = (session, notebook) => {
345
330
  const flow_order = msg.content.data['flow_order'];
346
331
  const exec_schedule = msg.content.data['exec_schedule'];
347
332
  lastExecutionMode = exec_mode;
348
- lastExecutionHighlightsEnabled = msg.content.data['highlights_enabled'];
333
+ lastExecutionHighlights = msg.content.data['highlights'];
349
334
  executedReactiveReadyCells.add(msg.content.data['last_executed_cell_id']);
350
335
  for (const cell of notebook.widgets) {
351
336
  if (cell.model.type !== 'code' || executedReactiveReadyCells.has(cell.model.id)) {
@@ -373,12 +358,24 @@ const connectToComm = (session, notebook) => {
373
358
  }
374
359
  }
375
360
  if (cellPendingExecution === null) {
376
- resetReactiveState();
377
- updateUI(notebook);
361
+ if (lastExecutionMode === 'reactive') {
362
+ if (lastExecutionHighlights === 'reactive') {
363
+ readyCells = executedReactiveReadyCells;
364
+ }
365
+ updateUI(notebook);
366
+ resetReactiveState();
367
+ comm.send({
368
+ type: 'reactivity_cleanup',
369
+ });
370
+ }
371
+ else {
372
+ resetReactiveState();
373
+ updateUI(notebook);
374
+ }
378
375
  }
379
376
  else {
380
377
  onActiveCellChange(notebook, cellPendingExecution);
381
- clearCellState(notebook);
378
+ CodeCell.execute(cellPendingExecution, session);
382
379
  }
383
380
  }
384
381
  };
package/package.json CHANGED
@@ -54,7 +54,7 @@
54
54
  "eslint-plugin-prettier": "^4.0.0",
55
55
  "prettier": "2.6.0",
56
56
  "rimraf": "^3.0.2",
57
- "typescript": "^4.7.4"
57
+ "typescript": "4.3.5"
58
58
  },
59
59
  "sideEffects": [
60
60
  "style/*.css"
@@ -63,5 +63,5 @@
63
63
  "extension": true,
64
64
  "outputDir": "../../core/ipyflow/resources/labextension/"
65
65
  },
66
- "version": "0.0.128"
66
+ "version": "0.0.129"
67
67
  }