@difizen/libro-core 0.1.37 → 0.2.1
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/es/add-cell/libro-add-cell-view.js +1 -1
- package/es/command/libro-command-contribution.d.ts.map +1 -1
- package/es/command/libro-command-contribution.js +67 -55
- package/es/components/dnd-cell-item-render.js +1 -1
- package/es/components/dnd-component/default-dnd-content.js +1 -1
- package/es/libro-model.d.ts +7 -2
- package/es/libro-model.d.ts.map +1 -1
- package/es/libro-model.js +79 -47
- package/es/libro-protocol.d.ts +13 -4
- package/es/libro-protocol.d.ts.map +1 -1
- package/es/libro-view.d.ts.map +1 -1
- package/es/libro-view.js +2 -2
- package/package.json +5 -5
- package/src/add-cell/libro-add-cell-view.tsx +1 -1
- package/src/command/libro-command-contribution.ts +83 -57
- package/src/components/dnd-cell-item-render.tsx +1 -1
- package/src/components/dnd-component/default-dnd-content.tsx +1 -1
- package/src/libro-model.ts +21 -5
- package/src/libro-protocol.ts +15 -5
- package/src/libro-view.tsx +11 -2
|
@@ -72,7 +72,7 @@ export var LibroWrappedAddCell = /*#__PURE__*/forwardRef(function LibroWrappedAd
|
|
|
72
72
|
var _instance$parent;
|
|
73
73
|
var instance = useInject(ViewInstance);
|
|
74
74
|
return /*#__PURE__*/_jsx(DisplayWrapComponent, {
|
|
75
|
-
mode: (_instance$parent = instance.parent)
|
|
75
|
+
mode: !((_instance$parent = instance.parent) !== null && _instance$parent !== void 0 && _instance$parent.model.cellsEditable),
|
|
76
76
|
children: /*#__PURE__*/_jsx(LibroAddCell, {})
|
|
77
77
|
});
|
|
78
78
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"libro-command-contribution.d.ts","sourceRoot":"","sources":["../../src/command/libro-command-contribution.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAEL,YAAY,EAEZ,mBAAmB,EACpB,MAAM,mBAAmB,CAAC;AAM3B,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"libro-command-contribution.d.ts","sourceRoot":"","sources":["../../src/command/libro-command-contribution.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAEL,YAAY,EAEZ,mBAAmB,EACpB,MAAM,mBAAmB,CAAC;AAM3B,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAI1D,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAOnD,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAGnE,qBACa,wBAAyB,YAAW,mBAAmB;IAC5C,SAAS,CAAC,QAAQ,CAAC,YAAY,EAAE,YAAY,CAAC;IACtC,SAAS,CAAC,QAAQ,CAAC,YAAY,EAAE,oBAAoB,CAAC;IAC9D,SAAS,CAAC,QAAQ,CAAC,YAAY,EAAE,YAAY,CAAC;IAC3C,SAAS,CAAC,QAAQ,CAAC,eAAe,EAAE,eAAe,CAAC;IAE7E,gBAAgB,CAAC,OAAO,EAAE,eAAe,GAAG,IAAI;CAs1CjD"}
|
|
@@ -60,7 +60,7 @@ export var LibroCommandContribution = (_dec = singleton({
|
|
|
60
60
|
return execute;
|
|
61
61
|
}(),
|
|
62
62
|
isEnabled: function isEnabled(cell, libro) {
|
|
63
|
-
if (!libro || !(libro instanceof LibroView) || libro.model.
|
|
63
|
+
if (!libro || !(libro instanceof LibroView) || !libro.model.inputEditable) {
|
|
64
64
|
return false;
|
|
65
65
|
}
|
|
66
66
|
return true;
|
|
@@ -92,7 +92,9 @@ export var LibroCommandContribution = (_dec = singleton({
|
|
|
92
92
|
}
|
|
93
93
|
return _context2.abrupt("return");
|
|
94
94
|
case 2:
|
|
95
|
-
libro.
|
|
95
|
+
if (libro.model.executable) {
|
|
96
|
+
libro.runCell(cell);
|
|
97
|
+
}
|
|
96
98
|
case 3:
|
|
97
99
|
case "end":
|
|
98
100
|
return _context2.stop();
|
|
@@ -105,7 +107,7 @@ export var LibroCommandContribution = (_dec = singleton({
|
|
|
105
107
|
return execute;
|
|
106
108
|
}(),
|
|
107
109
|
isEnabled: function isEnabled(cell, libro) {
|
|
108
|
-
if (!libro || !(libro instanceof LibroView)
|
|
110
|
+
if (!libro || !(libro instanceof LibroView)) {
|
|
109
111
|
return false;
|
|
110
112
|
}
|
|
111
113
|
return true;
|
|
@@ -123,7 +125,9 @@ export var LibroCommandContribution = (_dec = singleton({
|
|
|
123
125
|
}
|
|
124
126
|
return _context3.abrupt("return");
|
|
125
127
|
case 2:
|
|
126
|
-
libro.
|
|
128
|
+
if (libro.model.executable) {
|
|
129
|
+
libro.runAllCell();
|
|
130
|
+
}
|
|
127
131
|
case 3:
|
|
128
132
|
case "end":
|
|
129
133
|
return _context3.stop();
|
|
@@ -148,7 +152,9 @@ export var LibroCommandContribution = (_dec = singleton({
|
|
|
148
152
|
}
|
|
149
153
|
return _context4.abrupt("return");
|
|
150
154
|
case 2:
|
|
151
|
-
libro.
|
|
155
|
+
if (libro.model.executable) {
|
|
156
|
+
libro.runAllAbove(cell);
|
|
157
|
+
}
|
|
152
158
|
case 3:
|
|
153
159
|
case "end":
|
|
154
160
|
return _context4.stop();
|
|
@@ -173,7 +179,9 @@ export var LibroCommandContribution = (_dec = singleton({
|
|
|
173
179
|
}
|
|
174
180
|
return _context5.abrupt("return");
|
|
175
181
|
case 2:
|
|
176
|
-
libro.
|
|
182
|
+
if (libro.model.executable) {
|
|
183
|
+
libro.runAllBelow(cell);
|
|
184
|
+
}
|
|
177
185
|
case 3:
|
|
178
186
|
case "end":
|
|
179
187
|
return _context5.stop();
|
|
@@ -198,7 +206,9 @@ export var LibroCommandContribution = (_dec = singleton({
|
|
|
198
206
|
}
|
|
199
207
|
return _context6.abrupt("return");
|
|
200
208
|
case 2:
|
|
201
|
-
libro.
|
|
209
|
+
if (libro.model.executable) {
|
|
210
|
+
libro.runCellandSelectNext(cell);
|
|
211
|
+
}
|
|
202
212
|
case 3:
|
|
203
213
|
case "end":
|
|
204
214
|
return _context6.stop();
|
|
@@ -211,7 +221,7 @@ export var LibroCommandContribution = (_dec = singleton({
|
|
|
211
221
|
return execute;
|
|
212
222
|
}(),
|
|
213
223
|
isEnabled: function isEnabled(cell, libro) {
|
|
214
|
-
if (!libro || !(libro instanceof LibroView)
|
|
224
|
+
if (!libro || !(libro instanceof LibroView)) {
|
|
215
225
|
return false;
|
|
216
226
|
}
|
|
217
227
|
return true;
|
|
@@ -229,7 +239,9 @@ export var LibroCommandContribution = (_dec = singleton({
|
|
|
229
239
|
}
|
|
230
240
|
return _context7.abrupt("return");
|
|
231
241
|
case 2:
|
|
232
|
-
libro.
|
|
242
|
+
if (libro.model.executable) {
|
|
243
|
+
libro.runCellandInsertBelow(cell);
|
|
244
|
+
}
|
|
233
245
|
case 3:
|
|
234
246
|
case "end":
|
|
235
247
|
return _context7.stop();
|
|
@@ -242,7 +254,7 @@ export var LibroCommandContribution = (_dec = singleton({
|
|
|
242
254
|
return execute;
|
|
243
255
|
}(),
|
|
244
256
|
isEnabled: function isEnabled(cell, libro) {
|
|
245
|
-
if (!libro || !(libro instanceof LibroView)
|
|
257
|
+
if (!libro || !(libro instanceof LibroView)) {
|
|
246
258
|
return false;
|
|
247
259
|
}
|
|
248
260
|
return true;
|
|
@@ -288,7 +300,7 @@ export var LibroCommandContribution = (_dec = singleton({
|
|
|
288
300
|
if (!libro || !(libro instanceof LibroView)) {
|
|
289
301
|
return false;
|
|
290
302
|
}
|
|
291
|
-
return
|
|
303
|
+
return (libro === null || libro === void 0 ? void 0 : libro.model).executable && path === LibroToolbarArea.HeaderCenter;
|
|
292
304
|
}
|
|
293
305
|
});
|
|
294
306
|
this.libroCommand.registerLibroCommand(command, NotebookCommands['RestartClearOutput'], {
|
|
@@ -319,7 +331,7 @@ export var LibroCommandContribution = (_dec = singleton({
|
|
|
319
331
|
if (!libro || !(libro instanceof LibroView)) {
|
|
320
332
|
return false;
|
|
321
333
|
}
|
|
322
|
-
return
|
|
334
|
+
return (libro === null || libro === void 0 ? void 0 : libro.model).executable && path === LibroToolbarArea.HeaderCenter;
|
|
323
335
|
}
|
|
324
336
|
});
|
|
325
337
|
this.libroCommand.registerLibroCommand(command, NotebookCommands['CloseAndShutdown'], {
|
|
@@ -406,10 +418,10 @@ export var LibroCommandContribution = (_dec = singleton({
|
|
|
406
418
|
if (!libro || !(libro instanceof LibroView)) {
|
|
407
419
|
return false;
|
|
408
420
|
}
|
|
409
|
-
return
|
|
421
|
+
return (libro === null || libro === void 0 ? void 0 : libro.model.cellsEditable) && path === LibroToolbarArea.CellRight;
|
|
410
422
|
},
|
|
411
423
|
isEnabled: function isEnabled(cell, libro) {
|
|
412
|
-
if (!libro || !(libro instanceof LibroView) || libro.model.
|
|
424
|
+
if (!libro || !(libro instanceof LibroView) || !libro.model.cellsEditable) {
|
|
413
425
|
return false;
|
|
414
426
|
}
|
|
415
427
|
return true;
|
|
@@ -453,7 +465,7 @@ export var LibroCommandContribution = (_dec = singleton({
|
|
|
453
465
|
return execute;
|
|
454
466
|
}(),
|
|
455
467
|
isEnabled: function isEnabled(cell, libro) {
|
|
456
|
-
if (!libro || !(libro instanceof LibroView) || libro.model.
|
|
468
|
+
if (!libro || !(libro instanceof LibroView) || !libro.model.cellsEditable) {
|
|
457
469
|
return false;
|
|
458
470
|
}
|
|
459
471
|
return true;
|
|
@@ -567,7 +579,7 @@ export var LibroCommandContribution = (_dec = singleton({
|
|
|
567
579
|
return execute;
|
|
568
580
|
}(),
|
|
569
581
|
isEnabled: function isEnabled(cell, libro) {
|
|
570
|
-
if (!libro || !(libro instanceof LibroView) || libro.model.
|
|
582
|
+
if (!libro || !(libro instanceof LibroView) || !libro.model.inputEditable || !libro.model.cellsEditable) {
|
|
571
583
|
return false;
|
|
572
584
|
}
|
|
573
585
|
return true;
|
|
@@ -598,7 +610,7 @@ export var LibroCommandContribution = (_dec = singleton({
|
|
|
598
610
|
return execute;
|
|
599
611
|
}(),
|
|
600
612
|
isEnabled: function isEnabled(cell, libro) {
|
|
601
|
-
if (!libro || !(libro instanceof LibroView) || libro.model.
|
|
613
|
+
if (!libro || !(libro instanceof LibroView) || !libro.model.inputEditable || !libro.model.cellsEditable) {
|
|
602
614
|
return false;
|
|
603
615
|
}
|
|
604
616
|
return true;
|
|
@@ -629,7 +641,7 @@ export var LibroCommandContribution = (_dec = singleton({
|
|
|
629
641
|
return execute;
|
|
630
642
|
}(),
|
|
631
643
|
isEnabled: function isEnabled(cell, libro) {
|
|
632
|
-
if (!libro || !(libro instanceof LibroView) || libro.model.
|
|
644
|
+
if (!libro || !(libro instanceof LibroView) || !libro.model.inputEditable || !libro.model.cellsEditable) {
|
|
633
645
|
return false;
|
|
634
646
|
}
|
|
635
647
|
return true;
|
|
@@ -663,10 +675,10 @@ export var LibroCommandContribution = (_dec = singleton({
|
|
|
663
675
|
if (!libro || !(libro instanceof LibroView)) {
|
|
664
676
|
return false;
|
|
665
677
|
}
|
|
666
|
-
return
|
|
678
|
+
return (libro === null || libro === void 0 ? void 0 : libro.model.cellsEditable) && path === LibroToolbarArea.CellRight;
|
|
667
679
|
},
|
|
668
680
|
isEnabled: function isEnabled(cell, libro) {
|
|
669
|
-
if (!libro || !(libro instanceof LibroView) || libro.model.
|
|
681
|
+
if (!libro || !(libro instanceof LibroView) || !libro.model.cellsEditable) {
|
|
670
682
|
return false;
|
|
671
683
|
}
|
|
672
684
|
return true;
|
|
@@ -697,7 +709,7 @@ export var LibroCommandContribution = (_dec = singleton({
|
|
|
697
709
|
return execute;
|
|
698
710
|
}(),
|
|
699
711
|
isEnabled: function isEnabled(cell, libro) {
|
|
700
|
-
if (!libro || !(libro instanceof LibroView) || libro.model.
|
|
712
|
+
if (!libro || !(libro instanceof LibroView) || !libro.model.outputEditable) {
|
|
701
713
|
return false;
|
|
702
714
|
}
|
|
703
715
|
return true;
|
|
@@ -731,10 +743,10 @@ export var LibroCommandContribution = (_dec = singleton({
|
|
|
731
743
|
if (!libro || !(libro instanceof LibroView)) {
|
|
732
744
|
return false;
|
|
733
745
|
}
|
|
734
|
-
return
|
|
746
|
+
return (libro === null || libro === void 0 ? void 0 : libro.model.outputEditable) && path === LibroToolbarArea.HeaderCenter;
|
|
735
747
|
},
|
|
736
748
|
isEnabled: function isEnabled(cell, libro) {
|
|
737
|
-
if (!libro || !(libro instanceof LibroView) || libro.model.
|
|
749
|
+
if (!libro || !(libro instanceof LibroView) || !libro.model.outputEditable) {
|
|
738
750
|
return false;
|
|
739
751
|
}
|
|
740
752
|
return true;
|
|
@@ -768,7 +780,7 @@ export var LibroCommandContribution = (_dec = singleton({
|
|
|
768
780
|
return path === LibroToolbarArea.CellRight;
|
|
769
781
|
},
|
|
770
782
|
isEnabled: function isEnabled(cell, libro) {
|
|
771
|
-
if (!cell || !libro || !(cell instanceof LibroCellView) || !(libro instanceof LibroView) || libro.model.
|
|
783
|
+
if (!cell || !libro || !(cell instanceof LibroCellView) || !(libro instanceof LibroView) || !libro.model.cellsEditable) {
|
|
772
784
|
return false;
|
|
773
785
|
}
|
|
774
786
|
var cellIndex = libro.model.getCells().findIndex(function (item) {
|
|
@@ -802,7 +814,7 @@ export var LibroCommandContribution = (_dec = singleton({
|
|
|
802
814
|
return execute;
|
|
803
815
|
}(),
|
|
804
816
|
isEnabled: function isEnabled(cell, libro) {
|
|
805
|
-
if (!cell || !libro || !(cell instanceof LibroCellView) || !(libro instanceof LibroView) || libro.model.
|
|
817
|
+
if (!cell || !libro || !(cell instanceof LibroCellView) || !(libro instanceof LibroView) || !libro.model.cellsEditable) {
|
|
806
818
|
return false;
|
|
807
819
|
}
|
|
808
820
|
var cellIndex = libro.model.getCells().findIndex(function (item) {
|
|
@@ -850,7 +862,7 @@ export var LibroCommandContribution = (_dec = singleton({
|
|
|
850
862
|
// return true;
|
|
851
863
|
// },
|
|
852
864
|
isEnabled: function isEnabled(cell, libro) {
|
|
853
|
-
if (!libro || !(libro instanceof LibroView) || libro.model.
|
|
865
|
+
if (!libro || !(libro instanceof LibroView) || !libro.model.cellsEditable) {
|
|
854
866
|
return false;
|
|
855
867
|
}
|
|
856
868
|
return true;
|
|
@@ -892,7 +904,7 @@ export var LibroCommandContribution = (_dec = singleton({
|
|
|
892
904
|
// return true;
|
|
893
905
|
// },
|
|
894
906
|
isEnabled: function isEnabled(cell, libro) {
|
|
895
|
-
if (!libro || !(libro instanceof LibroView) || libro.model.
|
|
907
|
+
if (!libro || !(libro instanceof LibroView) || !libro.model.cellsEditable) {
|
|
896
908
|
return false;
|
|
897
909
|
}
|
|
898
910
|
return true;
|
|
@@ -923,7 +935,7 @@ export var LibroCommandContribution = (_dec = singleton({
|
|
|
923
935
|
return execute;
|
|
924
936
|
}(),
|
|
925
937
|
isEnabled: function isEnabled(cell, libro) {
|
|
926
|
-
if (!libro || !(libro instanceof LibroView) || libro.model.
|
|
938
|
+
if (!libro || !(libro instanceof LibroView) || !libro.model.cellsEditable) {
|
|
927
939
|
return false;
|
|
928
940
|
}
|
|
929
941
|
return true;
|
|
@@ -965,7 +977,7 @@ export var LibroCommandContribution = (_dec = singleton({
|
|
|
965
977
|
// return true;
|
|
966
978
|
// },
|
|
967
979
|
isEnabled: function isEnabled(cell, libro) {
|
|
968
|
-
if (!libro || !(libro instanceof LibroView) || libro.model.
|
|
980
|
+
if (!libro || !(libro instanceof LibroView) || !libro.model.cellsEditable) {
|
|
969
981
|
return false;
|
|
970
982
|
}
|
|
971
983
|
return true;
|
|
@@ -1141,10 +1153,10 @@ export var LibroCommandContribution = (_dec = singleton({
|
|
|
1141
1153
|
if (!libro || !(libro instanceof LibroView)) {
|
|
1142
1154
|
return false;
|
|
1143
1155
|
}
|
|
1144
|
-
return
|
|
1156
|
+
return path === LibroToolbarArea.HeaderCenter;
|
|
1145
1157
|
},
|
|
1146
1158
|
isEnabled: function isEnabled(cell, libro) {
|
|
1147
|
-
if (!libro || !(libro instanceof LibroView)
|
|
1159
|
+
if (!libro || !(libro instanceof LibroView)) {
|
|
1148
1160
|
return false;
|
|
1149
1161
|
}
|
|
1150
1162
|
return true;
|
|
@@ -1380,10 +1392,10 @@ export var LibroCommandContribution = (_dec = singleton({
|
|
|
1380
1392
|
if (!libro || !(libro instanceof LibroView)) {
|
|
1381
1393
|
return false;
|
|
1382
1394
|
}
|
|
1383
|
-
return
|
|
1395
|
+
return (libro === null || libro === void 0 ? void 0 : libro.model.cellsEditable) && path === LibroToolbarArea.HeaderCenter;
|
|
1384
1396
|
},
|
|
1385
1397
|
isEnabled: function isEnabled(cell, libro) {
|
|
1386
|
-
if (!libro || !(libro instanceof LibroView) || libro.model.
|
|
1398
|
+
if (!libro || !(libro instanceof LibroView) || !libro.model.cellsEditable) {
|
|
1387
1399
|
return false;
|
|
1388
1400
|
}
|
|
1389
1401
|
return true;
|
|
@@ -1397,7 +1409,7 @@ export var LibroCommandContribution = (_dec = singleton({
|
|
|
1397
1409
|
libro.invertCell(cell, 'code');
|
|
1398
1410
|
},
|
|
1399
1411
|
isEnabled: function isEnabled(cell, libro) {
|
|
1400
|
-
if (!libro || !(libro instanceof LibroView) || libro.model.
|
|
1412
|
+
if (!libro || !(libro instanceof LibroView) || !libro.model.cellsEditable) {
|
|
1401
1413
|
return false;
|
|
1402
1414
|
}
|
|
1403
1415
|
return true;
|
|
@@ -1411,7 +1423,7 @@ export var LibroCommandContribution = (_dec = singleton({
|
|
|
1411
1423
|
libro.invertCell(cell, 'markdown');
|
|
1412
1424
|
},
|
|
1413
1425
|
isEnabled: function isEnabled(cell, libro) {
|
|
1414
|
-
if (!libro || !(libro instanceof LibroView) || libro.model.
|
|
1426
|
+
if (!libro || !(libro instanceof LibroView) || !libro.model.cellsEditable) {
|
|
1415
1427
|
return false;
|
|
1416
1428
|
}
|
|
1417
1429
|
return true;
|
|
@@ -1448,7 +1460,7 @@ export var LibroCommandContribution = (_dec = singleton({
|
|
|
1448
1460
|
if (!libro || !(libro instanceof LibroView)) {
|
|
1449
1461
|
return false;
|
|
1450
1462
|
}
|
|
1451
|
-
return
|
|
1463
|
+
return path === LibroToolbarArea.HeaderCenter;
|
|
1452
1464
|
}
|
|
1453
1465
|
});
|
|
1454
1466
|
this.libroCommand.registerLibroCommand(command, DocumentCommands['Save'], {
|
|
@@ -1457,7 +1469,7 @@ export var LibroCommandContribution = (_dec = singleton({
|
|
|
1457
1469
|
return _regeneratorRuntime().wrap(function _callee43$(_context43) {
|
|
1458
1470
|
while (1) switch (_context43.prev = _context43.next) {
|
|
1459
1471
|
case 0:
|
|
1460
|
-
if (!(!libro || !(libro instanceof LibroView))) {
|
|
1472
|
+
if (!(!libro || !(libro instanceof LibroView) || !libro.model.savable)) {
|
|
1461
1473
|
_context43.next = 2;
|
|
1462
1474
|
break;
|
|
1463
1475
|
}
|
|
@@ -1476,13 +1488,13 @@ export var LibroCommandContribution = (_dec = singleton({
|
|
|
1476
1488
|
return execute;
|
|
1477
1489
|
}(),
|
|
1478
1490
|
isVisible: function isVisible(cell, libro, path) {
|
|
1479
|
-
if (!libro || !(libro instanceof LibroView)) {
|
|
1491
|
+
if (!libro || !(libro instanceof LibroView) || !libro.model.savable) {
|
|
1480
1492
|
return false;
|
|
1481
1493
|
}
|
|
1482
|
-
return
|
|
1494
|
+
return (libro === null || libro === void 0 ? void 0 : libro.model.savable) && path === LibroToolbarArea.HeaderCenter;
|
|
1483
1495
|
},
|
|
1484
1496
|
isEnabled: function isEnabled(cell, libro) {
|
|
1485
|
-
if (!libro || !(libro instanceof LibroView)
|
|
1497
|
+
if (!libro || !(libro instanceof LibroView)) {
|
|
1486
1498
|
return false;
|
|
1487
1499
|
}
|
|
1488
1500
|
return true;
|
|
@@ -1510,7 +1522,7 @@ export var LibroCommandContribution = (_dec = singleton({
|
|
|
1510
1522
|
if (!libro || !(libro instanceof LibroView)) {
|
|
1511
1523
|
return false;
|
|
1512
1524
|
}
|
|
1513
|
-
return
|
|
1525
|
+
return path === LibroToolbarArea.HeaderRight;
|
|
1514
1526
|
}
|
|
1515
1527
|
});
|
|
1516
1528
|
this.libroCommand.registerLibroCommand(command, DocumentCommands['FormatCell'], {
|
|
@@ -1539,7 +1551,7 @@ export var LibroCommandContribution = (_dec = singleton({
|
|
|
1539
1551
|
if (!libro || !(libro instanceof LibroView)) {
|
|
1540
1552
|
return false;
|
|
1541
1553
|
}
|
|
1542
|
-
return _this.libroService.hasFormatter &&
|
|
1554
|
+
return _this.libroService.hasFormatter && (libro === null || libro === void 0 ? void 0 : libro.model.inputEditable) && EditorCellView.is(cell) && cell.model.mimeType === MIME.python && path === LibroToolbarArea.CellRight;
|
|
1543
1555
|
}
|
|
1544
1556
|
});
|
|
1545
1557
|
this.libroCommand.registerLibroCommand(command, NotebookCommands['UndoCellAction'], {
|
|
@@ -1570,11 +1582,11 @@ export var LibroCommandContribution = (_dec = singleton({
|
|
|
1570
1582
|
if (!libro || !(libro instanceof LibroView)) {
|
|
1571
1583
|
return false;
|
|
1572
1584
|
}
|
|
1573
|
-
return
|
|
1585
|
+
return (libro === null || libro === void 0 ? void 0 : libro.model.cellsEditable) && path === LibroToolbarArea.HeaderCenter;
|
|
1574
1586
|
},
|
|
1575
1587
|
isEnabled: function isEnabled(cell, libro) {
|
|
1576
1588
|
var _libro$model$canUndo;
|
|
1577
|
-
if (!libro || !(libro instanceof LibroView) || libro.model.
|
|
1589
|
+
if (!libro || !(libro instanceof LibroView) || !libro.model.cellsEditable) {
|
|
1578
1590
|
return false;
|
|
1579
1591
|
}
|
|
1580
1592
|
return (_libro$model$canUndo = libro.model.canUndo) !== null && _libro$model$canUndo !== void 0 ? _libro$model$canUndo : false;
|
|
@@ -1608,11 +1620,11 @@ export var LibroCommandContribution = (_dec = singleton({
|
|
|
1608
1620
|
if (!libro || !(libro instanceof LibroView)) {
|
|
1609
1621
|
return false;
|
|
1610
1622
|
}
|
|
1611
|
-
return
|
|
1623
|
+
return (libro === null || libro === void 0 ? void 0 : libro.model.cellsEditable) && path === LibroToolbarArea.HeaderCenter;
|
|
1612
1624
|
},
|
|
1613
1625
|
isEnabled: function isEnabled(cell, libro) {
|
|
1614
1626
|
var _libro$model$canRedo;
|
|
1615
|
-
if (!libro || !(libro instanceof LibroView) || libro.model.
|
|
1627
|
+
if (!libro || !(libro instanceof LibroView) || !libro.model.cellsEditable) {
|
|
1616
1628
|
return false;
|
|
1617
1629
|
}
|
|
1618
1630
|
return (_libro$model$canRedo = libro.model.canRedo) !== null && _libro$model$canRedo !== void 0 ? _libro$model$canRedo : false;
|
|
@@ -1626,7 +1638,7 @@ export var LibroCommandContribution = (_dec = singleton({
|
|
|
1626
1638
|
libro.splitCell(cell);
|
|
1627
1639
|
},
|
|
1628
1640
|
isEnabled: function isEnabled(cell, libro) {
|
|
1629
|
-
if (!libro || !(libro instanceof LibroView) || libro.model.
|
|
1641
|
+
if (!libro || !(libro instanceof LibroView) || !libro.model.cellsEditable) {
|
|
1630
1642
|
return false;
|
|
1631
1643
|
}
|
|
1632
1644
|
return true;
|
|
@@ -1657,7 +1669,7 @@ export var LibroCommandContribution = (_dec = singleton({
|
|
|
1657
1669
|
return execute;
|
|
1658
1670
|
}(),
|
|
1659
1671
|
isEnabled: function isEnabled(cell, libro) {
|
|
1660
|
-
if (!libro || !(libro instanceof LibroView) || libro.model.
|
|
1672
|
+
if (!libro || !(libro instanceof LibroView) || !libro.model.inputEditable) {
|
|
1661
1673
|
return false;
|
|
1662
1674
|
}
|
|
1663
1675
|
return true;
|
|
@@ -1688,7 +1700,7 @@ export var LibroCommandContribution = (_dec = singleton({
|
|
|
1688
1700
|
return execute;
|
|
1689
1701
|
}(),
|
|
1690
1702
|
isEnabled: function isEnabled(cell, libro) {
|
|
1691
|
-
if (!libro || !(libro instanceof LibroView) || libro.model.
|
|
1703
|
+
if (!libro || !(libro instanceof LibroView) || !libro.model.inputEditable) {
|
|
1692
1704
|
return false;
|
|
1693
1705
|
}
|
|
1694
1706
|
return true;
|
|
@@ -1702,7 +1714,7 @@ export var LibroCommandContribution = (_dec = singleton({
|
|
|
1702
1714
|
libro.setMarkdownHeader(cell, 1);
|
|
1703
1715
|
},
|
|
1704
1716
|
isEnabled: function isEnabled(cell, libro) {
|
|
1705
|
-
if (!libro || !(libro instanceof LibroView) || libro.model.
|
|
1717
|
+
if (!libro || !(libro instanceof LibroView) || !libro.model.cellsEditable) {
|
|
1706
1718
|
return false;
|
|
1707
1719
|
}
|
|
1708
1720
|
return true;
|
|
@@ -1716,7 +1728,7 @@ export var LibroCommandContribution = (_dec = singleton({
|
|
|
1716
1728
|
libro.setMarkdownHeader(cell, 2);
|
|
1717
1729
|
},
|
|
1718
1730
|
isEnabled: function isEnabled(cell, libro) {
|
|
1719
|
-
if (!libro || !(libro instanceof LibroView) || libro.model.
|
|
1731
|
+
if (!libro || !(libro instanceof LibroView) || !libro.model.cellsEditable) {
|
|
1720
1732
|
return false;
|
|
1721
1733
|
}
|
|
1722
1734
|
return true;
|
|
@@ -1730,7 +1742,7 @@ export var LibroCommandContribution = (_dec = singleton({
|
|
|
1730
1742
|
libro.setMarkdownHeader(cell, 3);
|
|
1731
1743
|
},
|
|
1732
1744
|
isEnabled: function isEnabled(cell, libro) {
|
|
1733
|
-
if (!libro || !(libro instanceof LibroView) || libro.model.
|
|
1745
|
+
if (!libro || !(libro instanceof LibroView) || !libro.model.cellsEditable) {
|
|
1734
1746
|
return false;
|
|
1735
1747
|
}
|
|
1736
1748
|
return true;
|
|
@@ -1744,7 +1756,7 @@ export var LibroCommandContribution = (_dec = singleton({
|
|
|
1744
1756
|
libro.setMarkdownHeader(cell, 4);
|
|
1745
1757
|
},
|
|
1746
1758
|
isEnabled: function isEnabled(cell, libro) {
|
|
1747
|
-
if (!libro || !(libro instanceof LibroView) || libro.model.
|
|
1759
|
+
if (!libro || !(libro instanceof LibroView) || !libro.model.cellsEditable) {
|
|
1748
1760
|
return false;
|
|
1749
1761
|
}
|
|
1750
1762
|
return true;
|
|
@@ -1758,7 +1770,7 @@ export var LibroCommandContribution = (_dec = singleton({
|
|
|
1758
1770
|
libro.setMarkdownHeader(cell, 5);
|
|
1759
1771
|
},
|
|
1760
1772
|
isEnabled: function isEnabled(cell, libro) {
|
|
1761
|
-
if (!libro || !(libro instanceof LibroView) || libro.model.
|
|
1773
|
+
if (!libro || !(libro instanceof LibroView) || !libro.model.cellsEditable) {
|
|
1762
1774
|
return false;
|
|
1763
1775
|
}
|
|
1764
1776
|
return true;
|
|
@@ -1772,7 +1784,7 @@ export var LibroCommandContribution = (_dec = singleton({
|
|
|
1772
1784
|
libro.setMarkdownHeader(cell, 6);
|
|
1773
1785
|
},
|
|
1774
1786
|
isEnabled: function isEnabled(cell, libro) {
|
|
1775
|
-
if (!libro || !(libro instanceof LibroView) || libro.model.
|
|
1787
|
+
if (!libro || !(libro instanceof LibroView) || !libro.model.cellsEditable) {
|
|
1776
1788
|
return false;
|
|
1777
1789
|
}
|
|
1778
1790
|
return true;
|
|
@@ -310,7 +310,7 @@ export var DndCellItemContainer = /*#__PURE__*/memo(function DndCellItemContaine
|
|
|
310
310
|
onFocus: function onFocus(e) {
|
|
311
311
|
e.stopPropagation();
|
|
312
312
|
},
|
|
313
|
-
children: isActive && !isDrag && instance.model.
|
|
313
|
+
children: isActive && !isDrag && instance.model.cellsEditable && /*#__PURE__*/_jsx(ToolbarRender, {
|
|
314
314
|
data: rightToolbarArgs,
|
|
315
315
|
tooltip: {
|
|
316
316
|
placement: LibroToolbarArea.CellRight
|
|
@@ -219,7 +219,7 @@ export var DndCellContainer = function DndCellContainer(_ref) {
|
|
|
219
219
|
isDragOver = _useDrop2$.isDragOver,
|
|
220
220
|
drop = _useDrop2[1];
|
|
221
221
|
var opacity = isDrag ? 0.4 : 1;
|
|
222
|
-
if (
|
|
222
|
+
if (instance.model.cellsEditable) {
|
|
223
223
|
drop(ref);
|
|
224
224
|
}
|
|
225
225
|
if (isDrag) {
|
package/es/libro-model.d.ts
CHANGED
|
@@ -37,12 +37,17 @@ export declare class LibroModel implements NotebookModel, DndListModel {
|
|
|
37
37
|
protected readonly _modelDBMutex: (f: () => void) => void;
|
|
38
38
|
lastClipboardInteraction?: string;
|
|
39
39
|
clipboard?: CellView | CellView[];
|
|
40
|
-
|
|
40
|
+
inputEditable: boolean;
|
|
41
|
+
outputEditable: boolean;
|
|
42
|
+
cellsEditable: boolean;
|
|
43
|
+
get executable(): boolean;
|
|
44
|
+
set executable(value: boolean);
|
|
45
|
+
savable: boolean;
|
|
46
|
+
runnable: boolean;
|
|
41
47
|
commandMode: boolean;
|
|
42
48
|
isEditMode: boolean;
|
|
43
49
|
dndAreaNullEnable: boolean;
|
|
44
50
|
dirty: boolean;
|
|
45
|
-
readOnly: boolean;
|
|
46
51
|
cells: CellView[];
|
|
47
52
|
getCells(): CellView[];
|
|
48
53
|
active?: CellView;
|
package/es/libro-model.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"libro-model.d.ts","sourceRoot":"","sources":["../src/libro-model.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAEV,gBAAgB,EAChB,iBAAiB,EAClB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EACV,eAAe,EACf,eAAe,EACf,cAAc,EACf,MAAM,6BAA6B,CAAC;AAErC,OAAO,EAAa,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AACpE,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAK5C,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EAAc,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACjE,OAAO,KAAK,EACV,WAAW,EACX,cAAc,EACd,YAAY,EACZ,aAAa,EAEb,QAAQ,EACR,SAAS,EACT,kBAAkB,EACnB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AAE3E,qBACa,UAAW,YAAW,aAAa,EAAE,YAAY;IACpC,OAAO,EAAE,cAAc,CAAC;IACnB,mBAAmB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