jupyterlab-ipyflow 0.0.190 → 0.0.192
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/index.js +132 -131
- package/package.json +2 -2
- package/style/index.css +8 -10
package/lib/index.js
CHANGED
|
@@ -8,9 +8,9 @@ const readyMakingClass = 'ready-making-cell';
|
|
|
8
8
|
const readyMakingInputClass = 'ready-making-input-cell';
|
|
9
9
|
const linkedWaitingClass = 'linked-waiting';
|
|
10
10
|
const linkedReadyMakerClass = 'linked-ready-maker';
|
|
11
|
-
const selfSliceClass = 'ipyflow-slice-self';
|
|
12
|
-
const directSliceClass = 'ipyflow-slice-direct';
|
|
13
11
|
const sliceClass = 'ipyflow-slice';
|
|
12
|
+
const executeSliceClass = 'ipyflow-slice-execute';
|
|
13
|
+
const classicColorsClass = 'ipyflow-classic-colors';
|
|
14
14
|
const cleanup = new Event('cleanup');
|
|
15
15
|
// ipyflow frontend state
|
|
16
16
|
class IpyflowSessionState {
|
|
@@ -82,7 +82,8 @@ class IpyflowSessionState {
|
|
|
82
82
|
this.executedCells.add(cell.model.id);
|
|
83
83
|
}
|
|
84
84
|
if (++numFinished === cells.length) {
|
|
85
|
-
|
|
85
|
+
// wait a tick first to allow the disk changes to propagate up
|
|
86
|
+
setTimeout(() => this.requestComputeExecSchedule(), 0);
|
|
86
87
|
}
|
|
87
88
|
});
|
|
88
89
|
}
|
|
@@ -108,24 +109,26 @@ class IpyflowSessionState {
|
|
|
108
109
|
store_history: false,
|
|
109
110
|
});
|
|
110
111
|
}
|
|
111
|
-
computeTransitiveClosureHelper(closure, cellId, edges,
|
|
112
|
-
if (!skipFirstCheck) {
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
this.executedCells.has(cellId) &&
|
|
118
|
-
!this.waitingCells.has(cellId) &&
|
|
119
|
-
!this.readyCells.has(cellId)) {
|
|
120
|
-
return;
|
|
121
|
-
}
|
|
112
|
+
computeTransitiveClosureHelper(closure, cellId, edges, addCellsNeedingRefresh = false, skipFirstCheck = false) {
|
|
113
|
+
if (!skipFirstCheck && closure.has(cellId)) {
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
if (!addCellsNeedingRefresh) {
|
|
117
|
+
closure.add(cellId);
|
|
122
118
|
}
|
|
123
|
-
|
|
124
|
-
const children = edges[cellId];
|
|
119
|
+
const children = edges === null || edges === void 0 ? void 0 : edges[cellId];
|
|
125
120
|
if (children === undefined) {
|
|
126
121
|
return;
|
|
127
122
|
}
|
|
128
|
-
|
|
123
|
+
const prevClosureSize = closure.size;
|
|
124
|
+
children.forEach((child) => this.computeTransitiveClosureHelper(closure, child, edges, addCellsNeedingRefresh));
|
|
125
|
+
if (addCellsNeedingRefresh &&
|
|
126
|
+
(closure.size > prevClosureSize ||
|
|
127
|
+
!this.executedCells.has(cellId) ||
|
|
128
|
+
this.readyCells.has(cellId) ||
|
|
129
|
+
this.waitingCells.has(cellId))) {
|
|
130
|
+
closure.add(cellId);
|
|
131
|
+
}
|
|
129
132
|
}
|
|
130
133
|
computeTransitiveClosure(cellIds, inclusive = true, parents = false) {
|
|
131
134
|
const closure = new Set();
|
|
@@ -141,18 +144,19 @@ class IpyflowSessionState {
|
|
|
141
144
|
for (const cellId of closure) {
|
|
142
145
|
this.computeTransitiveClosureHelper(closure, cellId, this.cellParents, true, true);
|
|
143
146
|
}
|
|
144
|
-
if (this.settings.flow_order === 'in_order') {
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
}
|
|
147
|
+
// if (this.settings.flow_order === 'in_order') {
|
|
148
|
+
// const minSeedPosition = Math.min(
|
|
149
|
+
// ...cellIds.map((id) => this.orderIdxById[id])
|
|
150
|
+
// );
|
|
151
|
+
// for (const cellId of Array.from(closure)) {
|
|
152
|
+
// const pos = this.orderIdxById[cellId];
|
|
153
|
+
// if (pos === undefined) {
|
|
154
|
+
// closure.delete(cellId);
|
|
155
|
+
// } else if (pos < minSeedPosition) {
|
|
156
|
+
// closure.delete(cellId);
|
|
157
|
+
// }
|
|
158
|
+
// }
|
|
159
|
+
// }
|
|
156
160
|
}
|
|
157
161
|
if (!inclusive) {
|
|
158
162
|
for (const cellId of cellIds) {
|
|
@@ -323,20 +327,52 @@ const extension = {
|
|
|
323
327
|
keys: ['Accel ArrowUp'],
|
|
324
328
|
selector: '.jp-Notebook',
|
|
325
329
|
});
|
|
326
|
-
|
|
327
|
-
|
|
330
|
+
let runCellCommand;
|
|
331
|
+
try {
|
|
332
|
+
runCellCommand = app.commands._commands.get('notebook:run-cell');
|
|
333
|
+
}
|
|
334
|
+
catch (e) {
|
|
335
|
+
runCellCommand = app.commands._commands['notebook:run-cell'];
|
|
336
|
+
}
|
|
337
|
+
const runCellCommandExecute = runCellCommand.execute;
|
|
338
|
+
const getIpyflowState = () => {
|
|
339
|
+
var _a;
|
|
328
340
|
const session = notebooks.currentWidget.sessionContext;
|
|
329
341
|
if (!session.isReady) {
|
|
330
|
-
return;
|
|
342
|
+
return {};
|
|
331
343
|
}
|
|
332
|
-
|
|
333
|
-
|
|
344
|
+
return ((_a = ipyflowState[session.session.id]) !== null && _a !== void 0 ? _a : {});
|
|
345
|
+
};
|
|
346
|
+
const isBatchReactive = () => {
|
|
347
|
+
var _a;
|
|
348
|
+
const state = getIpyflowState();
|
|
349
|
+
const settings = state.settings;
|
|
350
|
+
return (((_a = state.isIpyflowCommConnected) !== null && _a !== void 0 ? _a : false) &&
|
|
351
|
+
(settings === null || settings === void 0 ? void 0 : settings.exec_mode) === 'reactive' &&
|
|
352
|
+
(settings === null || settings === void 0 ? void 0 : settings.reactivity_mode) === 'batch');
|
|
353
|
+
};
|
|
354
|
+
runCellCommand.execute = (...args) => {
|
|
355
|
+
if (isBatchReactive() &&
|
|
356
|
+
getIpyflowState().activeCell.model.type === 'code') {
|
|
357
|
+
app.commands.execute('notebook:enter-command-mode');
|
|
358
|
+
}
|
|
359
|
+
else {
|
|
360
|
+
runCellCommandExecute.call(runCellCommand, args);
|
|
361
|
+
}
|
|
362
|
+
};
|
|
363
|
+
const executeBatchReactive = (skipFirst = false) => {
|
|
364
|
+
var _a;
|
|
365
|
+
const state = getIpyflowState();
|
|
366
|
+
if ((_a = state.isIpyflowCommConnected) !== null && _a !== void 0 ? _a : false) {
|
|
334
367
|
let closureCellIds = state.executionScheduledCells;
|
|
335
368
|
state.executionScheduledCells = [];
|
|
336
369
|
if (closureCellIds.length === 0) {
|
|
337
370
|
closureCellIds = [state.activeCell.model.id];
|
|
338
371
|
}
|
|
339
|
-
|
|
372
|
+
let closure = state.computeTransitiveClosure(closureCellIds, true);
|
|
373
|
+
if (skipFirst) {
|
|
374
|
+
closure = closure.splice(1);
|
|
375
|
+
}
|
|
340
376
|
if (closure.length > 0) {
|
|
341
377
|
state.executeCells(closure);
|
|
342
378
|
}
|
|
@@ -346,63 +382,38 @@ const extension = {
|
|
|
346
382
|
}
|
|
347
383
|
};
|
|
348
384
|
NotebookActions.executionScheduled.connect((_, args) => {
|
|
349
|
-
var _a, _b, _c;
|
|
350
385
|
const notebook = notebooks === null || notebooks === void 0 ? void 0 : notebooks.currentWidget;
|
|
351
386
|
if ((notebook === null || notebook === void 0 ? void 0 : notebook.content) !== args.notebook) {
|
|
352
387
|
return;
|
|
353
388
|
}
|
|
354
|
-
|
|
355
|
-
if (!((_a = session === null || session === void 0 ? void 0 : session.isReady) !== null && _a !== void 0 ? _a : false)) {
|
|
356
|
-
return;
|
|
357
|
-
}
|
|
358
|
-
const state = ((_b = ipyflowState[session.session.id]) !== null && _b !== void 0 ? _b : {});
|
|
359
|
-
if (!((_c = state.isIpyflowCommConnected) !== null && _c !== void 0 ? _c : false)) {
|
|
360
|
-
return;
|
|
361
|
-
}
|
|
362
|
-
const settings = state.settings;
|
|
363
|
-
const isBatch = (settings === null || settings === void 0 ? void 0 : settings.reactivity_mode) === 'batch';
|
|
364
|
-
const isReactive = (settings === null || settings === void 0 ? void 0 : settings.exec_mode) === 'reactive';
|
|
365
|
-
if (!isBatch || !isReactive) {
|
|
389
|
+
if (!isBatchReactive()) {
|
|
366
390
|
return;
|
|
367
391
|
}
|
|
368
392
|
if (args.cell.model.type === 'code') {
|
|
393
|
+
const state = getIpyflowState();
|
|
369
394
|
state.executionScheduledCells.push(args.cell.model.id);
|
|
370
395
|
}
|
|
371
396
|
});
|
|
372
397
|
app.commands.commandExecuted.connect((_, args) => {
|
|
373
|
-
var _a
|
|
374
|
-
const notebook = notebooks === null || notebooks === void 0 ? void 0 : notebooks.currentWidget;
|
|
375
|
-
const session = notebook === null || notebook === void 0 ? void 0 : notebook.sessionContext;
|
|
376
|
-
if (!((_a = session === null || session === void 0 ? void 0 : session.isReady) !== null && _a !== void 0 ? _a : false)) {
|
|
377
|
-
return;
|
|
378
|
-
}
|
|
379
|
-
const state = ((_b = ipyflowState[session.session.id]) !== null && _b !== void 0 ? _b : {});
|
|
380
|
-
if (!((_c = state.isIpyflowCommConnected) !== null && _c !== void 0 ? _c : false)) {
|
|
381
|
-
return;
|
|
382
|
-
}
|
|
383
|
-
const settings = state.settings;
|
|
384
|
-
const isBatch = (settings === null || settings === void 0 ? void 0 : settings.reactivity_mode) === 'batch';
|
|
385
|
-
const isReactive = (settings === null || settings === void 0 ? void 0 : settings.exec_mode) === 'reactive';
|
|
386
|
-
if (!isBatch) {
|
|
387
|
-
return;
|
|
388
|
-
}
|
|
398
|
+
var _a;
|
|
389
399
|
if (args.id === 'notebook:run-cell') {
|
|
390
|
-
if (
|
|
391
|
-
|
|
400
|
+
if (isBatchReactive()) {
|
|
401
|
+
executeBatchReactive();
|
|
392
402
|
}
|
|
393
403
|
else {
|
|
394
|
-
|
|
404
|
+
(_a = getIpyflowState()) === null || _a === void 0 ? void 0 : _a.requestComputeExecSchedule();
|
|
395
405
|
}
|
|
396
406
|
}
|
|
397
|
-
else if (
|
|
407
|
+
else if (['notebook:run-cell-and-select-next', 'runmenu:run'].includes(args.id)) {
|
|
408
|
+
const state = getIpyflowState();
|
|
398
409
|
const origActiveCell = state.activeCell;
|
|
399
410
|
try {
|
|
400
411
|
state.activeCell = state.prevActiveCell;
|
|
401
|
-
if (
|
|
402
|
-
|
|
412
|
+
if (isBatchReactive()) {
|
|
413
|
+
executeBatchReactive(true);
|
|
403
414
|
}
|
|
404
415
|
else {
|
|
405
|
-
state.requestComputeExecSchedule();
|
|
416
|
+
state === null || state === void 0 ? void 0 : state.requestComputeExecSchedule();
|
|
406
417
|
}
|
|
407
418
|
}
|
|
408
419
|
finally {
|
|
@@ -500,12 +511,11 @@ const addWaitingOutputInteractions = (elem, linkedInputClass) => {
|
|
|
500
511
|
};
|
|
501
512
|
const clearCellState = (notebook) => {
|
|
502
513
|
notebook.widgets.forEach((cell) => {
|
|
514
|
+
cell.node.classList.remove(classicColorsClass);
|
|
503
515
|
cell.node.classList.remove(waitingClass);
|
|
504
516
|
cell.node.classList.remove(readyMakingClass);
|
|
505
517
|
cell.node.classList.remove(readyClass);
|
|
506
518
|
cell.node.classList.remove(readyMakingInputClass);
|
|
507
|
-
cell.node.classList.remove(selfSliceClass);
|
|
508
|
-
cell.node.classList.remove(directSliceClass);
|
|
509
519
|
cell.node.classList.remove(sliceClass);
|
|
510
520
|
// clear any old event listeners
|
|
511
521
|
const inputCollapser = getJpInputCollapser(cell.node);
|
|
@@ -543,7 +553,7 @@ const addUnsafeCellInteraction = (elem, linkedElems, cellsById, collapserFun, ev
|
|
|
543
553
|
attachCleanupListener(elem, evt, listener);
|
|
544
554
|
};
|
|
545
555
|
const connectToComm = (session, notebooks, notebook) => {
|
|
546
|
-
var _a, _b;
|
|
556
|
+
var _a, _b, _c, _d, _e;
|
|
547
557
|
initSessionState(session.session.id);
|
|
548
558
|
const state = ipyflowState[session.session.id];
|
|
549
559
|
state.activeCell = notebook.activeCell;
|
|
@@ -674,65 +684,59 @@ const connectToComm = (session, notebooks, notebook) => {
|
|
|
674
684
|
update: 'remove',
|
|
675
685
|
},
|
|
676
686
|
];
|
|
677
|
-
const updateOneCellUI = (
|
|
678
|
-
|
|
687
|
+
const updateOneCellUI = (cell, inSlice, inExecuteSlice, showCollapserHighlights) => {
|
|
688
|
+
var _a;
|
|
689
|
+
const { model, node } = cell;
|
|
690
|
+
const id = model.id;
|
|
679
691
|
if (model.type !== 'code') {
|
|
680
692
|
return;
|
|
681
693
|
}
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
return;
|
|
694
|
+
if (((_a = state.settings.color_scheme) !== null && _a !== void 0 ? _a : 'normal') === 'classic') {
|
|
695
|
+
node.classList.add(classicColorsClass);
|
|
685
696
|
}
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
elem.classList.add(selfSliceClass);
|
|
697
|
+
if (inExecuteSlice) {
|
|
698
|
+
node.classList.add(executeSliceClass);
|
|
689
699
|
}
|
|
690
700
|
else {
|
|
691
|
-
|
|
701
|
+
node.classList.remove(executeSliceClass);
|
|
692
702
|
}
|
|
693
|
-
if (
|
|
694
|
-
|
|
703
|
+
if (inSlice && !inExecuteSlice) {
|
|
704
|
+
node.classList.add(sliceClass);
|
|
695
705
|
}
|
|
696
706
|
else {
|
|
697
|
-
|
|
698
|
-
}
|
|
699
|
-
if (inSlice && !inDirectSlice && !isSelf) {
|
|
700
|
-
elem.classList.add(sliceClass);
|
|
701
|
-
}
|
|
702
|
-
else {
|
|
703
|
-
elem.classList.remove(sliceClass);
|
|
707
|
+
node.classList.remove(sliceClass);
|
|
704
708
|
}
|
|
705
709
|
if (!showCollapserHighlights) {
|
|
706
710
|
return;
|
|
707
711
|
}
|
|
708
712
|
if (state.waitingCells.has(id)) {
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
addWaitingOutputInteractions(
|
|
713
|
+
node.classList.add(waitingClass);
|
|
714
|
+
node.classList.add(readyClass);
|
|
715
|
+
node.classList.remove(readyMakingInputClass);
|
|
716
|
+
addWaitingOutputInteractions(node, linkedWaitingClass);
|
|
713
717
|
}
|
|
714
718
|
else if (state.readyCells.has(id)) {
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
addWaitingOutputInteractions(
|
|
719
|
+
node.classList.add(readyMakingInputClass);
|
|
720
|
+
node.classList.add(readyClass);
|
|
721
|
+
addWaitingOutputInteractions(node, linkedReadyMakerClass);
|
|
718
722
|
}
|
|
719
723
|
if (state.settings.exec_mode === 'reactive') {
|
|
720
724
|
return;
|
|
721
725
|
}
|
|
722
726
|
if (state.waiterLinks[id] !== undefined) {
|
|
723
727
|
actionUpdatePairs.forEach(({ action, update }) => {
|
|
724
|
-
addUnsafeCellInteraction(getJpInputCollapser(
|
|
725
|
-
addUnsafeCellInteraction(getJpOutputCollapser(
|
|
728
|
+
addUnsafeCellInteraction(getJpInputCollapser(node), state.waiterLinks[id], state.cellsById, getJpInputCollapser, action, update, state.waitingCells);
|
|
729
|
+
addUnsafeCellInteraction(getJpOutputCollapser(node), state.waiterLinks[id], state.cellsById, getJpInputCollapser, action, update, state.waitingCells);
|
|
726
730
|
});
|
|
727
731
|
}
|
|
728
732
|
if (state.readyMakerLinks[id] !== undefined) {
|
|
729
733
|
if (!state.waitingCells.has(id)) {
|
|
730
|
-
|
|
731
|
-
|
|
734
|
+
node.classList.add(readyMakingClass);
|
|
735
|
+
node.classList.add(readyClass);
|
|
732
736
|
}
|
|
733
737
|
actionUpdatePairs.forEach(({ action, update }) => {
|
|
734
|
-
addUnsafeCellInteraction(getJpInputCollapser(
|
|
735
|
-
addUnsafeCellInteraction(getJpInputCollapser(
|
|
738
|
+
addUnsafeCellInteraction(getJpInputCollapser(node), state.readyMakerLinks[id], state.cellsById, getJpInputCollapser, action, update, state.waitingCells);
|
|
739
|
+
addUnsafeCellInteraction(getJpInputCollapser(node), state.readyMakerLinks[id], state.cellsById, getJpOutputCollapser, action, update, state.waitingCells);
|
|
736
740
|
});
|
|
737
741
|
}
|
|
738
742
|
};
|
|
@@ -740,30 +744,24 @@ const connectToComm = (session, notebooks, notebook) => {
|
|
|
740
744
|
clearCellState(notebook);
|
|
741
745
|
refreshNodeMapping(notebook);
|
|
742
746
|
const slice = new Set();
|
|
743
|
-
let directSlice = new Set();
|
|
744
747
|
let closureCellIds = state.selectedCells;
|
|
745
748
|
if (closureCellIds.length === 0) {
|
|
746
749
|
closureCellIds = [state.activeCell.model.id];
|
|
747
750
|
}
|
|
748
751
|
for (const cellId of closureCellIds) {
|
|
749
|
-
|
|
750
|
-
state.cellParents[cellId] !== undefined) {
|
|
751
|
-
directSlice = new Set([
|
|
752
|
-
cellId,
|
|
753
|
-
...directSlice,
|
|
754
|
-
...state.cellChildren[cellId],
|
|
755
|
-
...state.cellParents[cellId],
|
|
756
|
-
]);
|
|
757
|
-
state.computeTransitiveClosureHelper(slice, cellId, state.cellChildren);
|
|
758
|
-
slice.delete(cellId);
|
|
759
|
-
state.computeTransitiveClosureHelper(slice, cellId, state.cellParents);
|
|
760
|
-
}
|
|
752
|
+
state.computeTransitiveClosureHelper(slice, cellId, state.cellChildren);
|
|
761
753
|
}
|
|
754
|
+
const executeSlice = new Set(slice);
|
|
762
755
|
for (const cellId of slice) {
|
|
763
|
-
state.computeTransitiveClosureHelper(
|
|
756
|
+
state.computeTransitiveClosureHelper(executeSlice, cellId, state.cellParents, true, true);
|
|
757
|
+
}
|
|
758
|
+
for (const cellId of closureCellIds) {
|
|
759
|
+
slice.delete(cellId);
|
|
760
|
+
state.computeTransitiveClosureHelper(slice, cellId, state.cellParents);
|
|
764
761
|
}
|
|
765
|
-
for (const
|
|
766
|
-
|
|
762
|
+
for (const cell of notebook.widgets) {
|
|
763
|
+
const id = cell.model.id;
|
|
764
|
+
updateOneCellUI(cell, slice.has(id), executeSlice.has(id), state.lastExecutionHighlights !== 'none');
|
|
767
765
|
}
|
|
768
766
|
};
|
|
769
767
|
const onSelectionChanged = () => {
|
|
@@ -787,8 +785,11 @@ const connectToComm = (session, notebooks, notebook) => {
|
|
|
787
785
|
updateUI(notebook);
|
|
788
786
|
};
|
|
789
787
|
notebooks.selectionChanged.connect(onSelectionChanged);
|
|
788
|
+
const debouncedSave = _.debounce(() => {
|
|
789
|
+
void notebooks.currentWidget.context.save();
|
|
790
|
+
}, 200);
|
|
790
791
|
comm.onMsg = (msg) => {
|
|
791
|
-
var _a, _b, _c, _d;
|
|
792
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
792
793
|
const payload = msg.content.data;
|
|
793
794
|
if (disconnected || !((_a = payload.success) !== null && _a !== void 0 ? _a : true)) {
|
|
794
795
|
return;
|
|
@@ -807,17 +808,17 @@ const connectToComm = (session, notebooks, notebook) => {
|
|
|
807
808
|
}
|
|
808
809
|
else if (payload.type === 'compute_exec_schedule') {
|
|
809
810
|
state.settings = payload.settings;
|
|
810
|
-
const ipyflow_metadata = notebook.model.getMetadata('ipyflow');
|
|
811
|
-
const parentsFromMetadata = (
|
|
812
|
-
const childrenFromMetadata = (
|
|
811
|
+
const ipyflow_metadata = (_d = (_c = (_b = notebook.model).getMetadata) === null || _c === void 0 ? void 0 : _c.call(_b, 'ipyflow')) !== null && _d !== void 0 ? _d : {};
|
|
812
|
+
const parentsFromMetadata = (_e = ipyflow_metadata === null || ipyflow_metadata === void 0 ? void 0 : ipyflow_metadata.cell_parents) !== null && _e !== void 0 ? _e : {};
|
|
813
|
+
const childrenFromMetadata = (_f = ipyflow_metadata === null || ipyflow_metadata === void 0 ? void 0 : ipyflow_metadata.cell_children) !== null && _f !== void 0 ? _f : {};
|
|
813
814
|
state.cellParents = mergeMaps(payload.cell_parents, parentsFromMetadata);
|
|
814
815
|
state.cellChildren = mergeMaps(payload.cell_children, childrenFromMetadata);
|
|
815
816
|
state.executedCells = new Set(payload.executed_cells);
|
|
816
|
-
notebook.model.setMetadata('ipyflow', {
|
|
817
|
+
(_h = (_g = notebook.model).setMetadata) === null || _h === void 0 ? void 0 : _h.call(_g, 'ipyflow', {
|
|
817
818
|
cell_parents: state.cellParents,
|
|
818
819
|
cell_children: state.cellChildren,
|
|
819
820
|
});
|
|
820
|
-
|
|
821
|
+
debouncedSave();
|
|
821
822
|
state.waitingCells = new Set(payload.waiting_cells);
|
|
822
823
|
state.readyCells = new Set(payload.ready_cells);
|
|
823
824
|
if (state.numPendingForcedReactiveCounterBumps === 0) {
|
|
@@ -840,7 +841,7 @@ const connectToComm = (session, notebooks, notebook) => {
|
|
|
840
841
|
const exec_mode = payload.exec_mode;
|
|
841
842
|
state.isReactivelyExecuting =
|
|
842
843
|
state.isReactivelyExecuting ||
|
|
843
|
-
((
|
|
844
|
+
((_j = payload === null || payload === void 0 ? void 0 : payload.is_reactively_executing) !== null && _j !== void 0 ? _j : false) ||
|
|
844
845
|
exec_mode === 'reactive';
|
|
845
846
|
if (exec_mode === 'reactive') {
|
|
846
847
|
state.newReadyCells = new Set([
|
|
@@ -967,12 +968,12 @@ const connectToComm = (session, notebooks, notebook) => {
|
|
|
967
968
|
}
|
|
968
969
|
}
|
|
969
970
|
};
|
|
970
|
-
const ipyflow_metadata = notebook.model.getMetadata('ipyflow');
|
|
971
|
+
const ipyflow_metadata = (_c = (_b = (_a = notebook.model).getMetadata) === null || _b === void 0 ? void 0 : _b.call(_a, 'ipyflow')) !== null && _c !== void 0 ? _c : {};
|
|
971
972
|
comm.open({
|
|
972
973
|
interface: 'jupyterlab',
|
|
973
974
|
cell_metadata_by_id: state.gatherCellMetadataAndContent(),
|
|
974
|
-
cell_parents: (
|
|
975
|
-
cell_children: (
|
|
975
|
+
cell_parents: (_d = ipyflow_metadata === null || ipyflow_metadata === void 0 ? void 0 : ipyflow_metadata.cell_parents) !== null && _d !== void 0 ? _d : {},
|
|
976
|
+
cell_children: (_e = ipyflow_metadata === null || ipyflow_metadata === void 0 ? void 0 : ipyflow_metadata.cell_children) !== null && _e !== void 0 ? _e : {},
|
|
976
977
|
});
|
|
977
978
|
// return a disconnection handle
|
|
978
979
|
return () => {
|
package/package.json
CHANGED
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"lodash": "^4.0"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
|
-
"@jupyterlab/builder": "^
|
|
51
|
+
"@jupyterlab/builder": "^3.6.6",
|
|
52
52
|
"@types/lodash": "^4.14.191",
|
|
53
53
|
"@typescript-eslint/eslint-plugin": "^5.15.0",
|
|
54
54
|
"@typescript-eslint/parser": "^5.15.0",
|
|
@@ -67,5 +67,5 @@
|
|
|
67
67
|
"extension": true,
|
|
68
68
|
"outputDir": "../../core/ipyflow/resources/labextension/"
|
|
69
69
|
},
|
|
70
|
-
"version": "0.0.
|
|
70
|
+
"version": "0.0.192"
|
|
71
71
|
}
|
package/style/index.css
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
:root {
|
|
2
|
+
--waiting-color: #a539f6;
|
|
3
|
+
--ready-making-color: #ff8100;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.ipyflow-classic-colors {
|
|
2
7
|
--waiting-color: rgb(254,0,82);
|
|
3
8
|
--ready-making-color: rgb(0,197,158);
|
|
4
9
|
}
|
|
@@ -69,19 +74,12 @@
|
|
|
69
74
|
content: '';
|
|
70
75
|
}
|
|
71
76
|
|
|
72
|
-
.jp-Notebook .jp-Cell.ipyflow-slice
|
|
73
|
-
color: var(--
|
|
74
|
-
content: '•';
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
.jp-Notebook .jp-Cell.ipyflow-slice-direct .jp-InputPrompt::before {
|
|
78
|
-
color: var(--ready-making-color);
|
|
77
|
+
.jp-Notebook .jp-Cell.ipyflow-slice .jp-InputPrompt::before {
|
|
78
|
+
color: var(--waiting-color);
|
|
79
79
|
content: '•';
|
|
80
80
|
}
|
|
81
81
|
|
|
82
|
-
.jp-Notebook .jp-Cell.ipyflow-slice .jp-InputPrompt::before {
|
|
83
|
-
/* color: var(--waiting-color); */
|
|
84
|
-
/* just use the same color as direct for now */
|
|
82
|
+
.jp-Notebook .jp-Cell.ipyflow-slice-execute .jp-InputPrompt::before {
|
|
85
83
|
color: var(--ready-making-color);
|
|
86
84
|
content: '•';
|
|
87
85
|
}
|