@difizen/libro-core 0.3.2 → 0.3.4
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/components/dnd-component/default-dnd-content.d.ts.map +1 -1
- package/es/components/dnd-component/default-dnd-content.js +88 -165
- package/es/components/dnd-component/dnd-list.d.ts +12 -0
- package/es/components/dnd-component/dnd-list.d.ts.map +1 -1
- package/es/components/dnd-component/dnd-list.js +306 -62
- package/es/components/dnd-component/index.d.ts +0 -2
- package/es/components/dnd-component/index.d.ts.map +1 -1
- package/es/components/dnd-component/index.js +0 -2
- package/es/components/dnd-component/index.less +84 -0
- package/es/components/dnd-component/virtualized-manager.d.ts.map +1 -1
- package/es/components/dnd-component/virtualized-manager.js +2 -8
- package/es/formatter/libro-formatter-json-contribution.d.ts +1 -1
- package/es/formatter/libro-formatter-string-contribution.d.ts +1 -1
- package/es/index.less +0 -22
- package/es/libro-model.js +1 -1
- package/es/libro-view.d.ts.map +1 -1
- package/es/libro-view.js +122 -135
- package/es/virtualized-manager.d.ts.map +1 -1
- package/es/virtualized-manager.js +1 -8
- package/package.json +10 -6
- package/src/components/dnd-component/default-dnd-content.tsx +99 -163
- package/src/components/dnd-component/dnd-list.tsx +303 -34
- package/src/components/dnd-component/index.less +84 -0
- package/src/components/dnd-component/index.tsx +0 -2
- package/src/components/dnd-component/virtualized-manager.ts +10 -7
- package/src/index.less +0 -22
- package/src/libro-model.ts +1 -1
- package/src/libro-view.tsx +22 -29
- package/src/virtualized-manager.ts +9 -7
- package/es/components/dnd-component/custom-drag-layer.d.ts +0 -9
- package/es/components/dnd-component/custom-drag-layer.d.ts.map +0 -1
- package/es/components/dnd-component/custom-drag-layer.js +0 -140
- package/es/components/dnd-component/dnd-context.d.ts +0 -3
- package/es/components/dnd-component/dnd-context.d.ts.map +0 -1
- package/es/components/dnd-component/dnd-context.js +0 -20
- package/src/components/dnd-component/custom-drag-layer.tsx +0 -144
- package/src/components/dnd-component/dnd-context.tsx +0 -28
package/es/libro-view.js
CHANGED
|
@@ -38,7 +38,7 @@ import { forwardRef, memo, useCallback, useEffect, useRef } from 'react';
|
|
|
38
38
|
import { v4 } from 'uuid';
|
|
39
39
|
import { CellService, EditorCellView, ExecutableCellModel, ExecutableCellView } from "./cell/index.js";
|
|
40
40
|
import { CollapseServiceFactory } from "./collapse-service.js";
|
|
41
|
-
import {
|
|
41
|
+
import { DndCellContainer, DndCellItemRender, DndList } from "./components/index.js";
|
|
42
42
|
import { LibroViewHeader } from "./components/libro-view-header.js";
|
|
43
43
|
import { LibroContextKey } from "./libro-context-key.js";
|
|
44
44
|
import { LibroModel } from "./libro-model.js";
|
|
@@ -54,7 +54,6 @@ import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
54
54
|
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
55
55
|
export var LibroContentComponent = /*#__PURE__*/memo(function LibroContentComponent() {
|
|
56
56
|
var libroSlotManager = useInject(LibroSlotManager);
|
|
57
|
-
var ref = useRef(null);
|
|
58
57
|
var libroViewTopRef = useRef(null);
|
|
59
58
|
var libroViewRightContentRef = useRef(null);
|
|
60
59
|
var libroViewLeftContentRef = useRef(null);
|
|
@@ -116,15 +115,12 @@ export var LibroContentComponent = /*#__PURE__*/memo(function LibroContentCompon
|
|
|
116
115
|
className: "libro-view-content-left",
|
|
117
116
|
style: leftContentStyles,
|
|
118
117
|
ref: libroViewLeftContentRef,
|
|
119
|
-
children: /*#__PURE__*/
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
slotView: LibroSlotView
|
|
126
|
-
})
|
|
127
|
-
})]
|
|
118
|
+
children: /*#__PURE__*/_jsx(DndList, {
|
|
119
|
+
libroView: instance,
|
|
120
|
+
children: /*#__PURE__*/_jsx(Slot, {
|
|
121
|
+
name: libroSlotManager.getSlotName(instance, 'list'),
|
|
122
|
+
slotView: LibroSlotView
|
|
123
|
+
})
|
|
128
124
|
})
|
|
129
125
|
}), /*#__PURE__*/_jsx("div", {
|
|
130
126
|
className: "libro-view-content-right",
|
|
@@ -651,22 +647,13 @@ export var LibroView = (_dec = transient(), _dec2 = view(notebookViewFactoryId),
|
|
|
651
647
|
_this.collapseCell(previousCell, false);
|
|
652
648
|
}
|
|
653
649
|
if (_this.model.selections.length !== 0 && _this.isSelected(cell)) {
|
|
654
|
-
var
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
var selectIndex = _this.findCellIndex(selectedCell);
|
|
660
|
-
if (selectIndex === 0) {
|
|
661
|
-
return;
|
|
662
|
-
}
|
|
663
|
-
_this.model.exchangeCells(_this.model.selections, selectIndex - 1);
|
|
664
|
-
}
|
|
665
|
-
} catch (err) {
|
|
666
|
-
_iterator.e(err);
|
|
667
|
-
} finally {
|
|
668
|
-
_iterator.f();
|
|
650
|
+
var startIndex = _this.findCellIndex(_this.model.selections[0]);
|
|
651
|
+
var endIndex = _this.findCellIndex(_this.model.selections[_this.model.selections.length - 1]);
|
|
652
|
+
var index = Math.min(startIndex, endIndex);
|
|
653
|
+
if (startIndex === 0) {
|
|
654
|
+
return;
|
|
669
655
|
}
|
|
656
|
+
_this.model.exchangeCells(_this.model.selections, index - 1);
|
|
670
657
|
} else {
|
|
671
658
|
var sourceIndex = _this.findCellIndex(cell);
|
|
672
659
|
if (sourceIndex > -1) {
|
|
@@ -681,13 +668,13 @@ export var LibroView = (_dec = transient(), _dec2 = view(notebookViewFactoryId),
|
|
|
681
668
|
_this.collapseCell(nextCell, false);
|
|
682
669
|
}
|
|
683
670
|
if (_this.model.selections.length !== 0 && _this.isSelected(cell)) {
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
_this.model.exchangeCells(_this.model.selections, selectIndex + 1);
|
|
671
|
+
var startIndex = _this.findCellIndex(_this.model.selections[0]) + 1;
|
|
672
|
+
var endIndex = _this.findCellIndex(_this.model.selections[_this.model.selections.length - 1]) + 1;
|
|
673
|
+
var index = Math.max(startIndex, endIndex);
|
|
674
|
+
if (index === _this.model.cells.length) {
|
|
675
|
+
return;
|
|
690
676
|
}
|
|
677
|
+
_this.model.exchangeCells(_this.model.selections, index + 1);
|
|
691
678
|
} else {
|
|
692
679
|
var sourceIndex = _this.findCellIndex(cell);
|
|
693
680
|
if (sourceIndex > -1) {
|
|
@@ -843,7 +830,7 @@ export var LibroView = (_dec = transient(), _dec2 = view(notebookViewFactoryId),
|
|
|
843
830
|
}();
|
|
844
831
|
_this.invertCell = /*#__PURE__*/function () {
|
|
845
832
|
var _ref14 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee14(cell, type) {
|
|
846
|
-
var cellIndex,
|
|
833
|
+
var cellIndex, _iterator, _step, selectedCell, cellOptions, cellView, _cellOptions, _cellView;
|
|
847
834
|
return _regeneratorRuntime().wrap(function _callee14$(_context14) {
|
|
848
835
|
while (1) switch (_context14.prev = _context14.next) {
|
|
849
836
|
case 0:
|
|
@@ -854,15 +841,15 @@ export var LibroView = (_dec = transient(), _dec2 = view(notebookViewFactoryId),
|
|
|
854
841
|
_context14.next = 24;
|
|
855
842
|
break;
|
|
856
843
|
}
|
|
857
|
-
|
|
844
|
+
_iterator = _createForOfIteratorHelper(_this.model.selections);
|
|
858
845
|
_context14.prev = 3;
|
|
859
|
-
|
|
846
|
+
_iterator.s();
|
|
860
847
|
case 5:
|
|
861
|
-
if ((
|
|
848
|
+
if ((_step = _iterator.n()).done) {
|
|
862
849
|
_context14.next = 14;
|
|
863
850
|
break;
|
|
864
851
|
}
|
|
865
|
-
selectedCell =
|
|
852
|
+
selectedCell = _step.value;
|
|
866
853
|
cellOptions = {
|
|
867
854
|
cell: {
|
|
868
855
|
cell_type: type,
|
|
@@ -886,10 +873,10 @@ export var LibroView = (_dec = transient(), _dec2 = view(notebookViewFactoryId),
|
|
|
886
873
|
case 16:
|
|
887
874
|
_context14.prev = 16;
|
|
888
875
|
_context14.t0 = _context14["catch"](3);
|
|
889
|
-
|
|
876
|
+
_iterator.e(_context14.t0);
|
|
890
877
|
case 19:
|
|
891
878
|
_context14.prev = 19;
|
|
892
|
-
|
|
879
|
+
_iterator.f();
|
|
893
880
|
return _context14.finish(19);
|
|
894
881
|
case 22:
|
|
895
882
|
_context14.next = 29;
|
|
@@ -922,11 +909,11 @@ export var LibroView = (_dec = transient(), _dec2 = view(notebookViewFactoryId),
|
|
|
922
909
|
}();
|
|
923
910
|
_this.clearOutputs = function (cell) {
|
|
924
911
|
if (_this.model.selections.length !== 0 && _this.isSelected(cell)) {
|
|
925
|
-
var
|
|
926
|
-
|
|
912
|
+
var _iterator2 = _createForOfIteratorHelper(_this.model.selections),
|
|
913
|
+
_step2;
|
|
927
914
|
try {
|
|
928
|
-
for (
|
|
929
|
-
var selectedCell =
|
|
915
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
916
|
+
var selectedCell = _step2.value;
|
|
930
917
|
if (ExecutableCellView.is(selectedCell) && ExecutableCellModel.is(selectedCell.model)) {
|
|
931
918
|
selectedCell.clearExecution();
|
|
932
919
|
selectedCell.model.executing = false;
|
|
@@ -934,9 +921,9 @@ export var LibroView = (_dec = transient(), _dec2 = view(notebookViewFactoryId),
|
|
|
934
921
|
}
|
|
935
922
|
}
|
|
936
923
|
} catch (err) {
|
|
937
|
-
|
|
924
|
+
_iterator2.e(err);
|
|
938
925
|
} finally {
|
|
939
|
-
|
|
926
|
+
_iterator2.f();
|
|
940
927
|
}
|
|
941
928
|
} else {
|
|
942
929
|
if (ExecutableCellView.is(cell) && ExecutableCellModel.is(cell.model)) {
|
|
@@ -949,11 +936,11 @@ export var LibroView = (_dec = transient(), _dec2 = view(notebookViewFactoryId),
|
|
|
949
936
|
_this.clearAllOutputs = function () {
|
|
950
937
|
// 清空所有 cell滚动到最上面
|
|
951
938
|
_this.model.scrollToView(_this.model.cells[0]);
|
|
952
|
-
var
|
|
953
|
-
|
|
939
|
+
var _iterator3 = _createForOfIteratorHelper(_this.model.cells),
|
|
940
|
+
_step3;
|
|
954
941
|
try {
|
|
955
|
-
for (
|
|
956
|
-
var cell =
|
|
942
|
+
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
943
|
+
var cell = _step3.value;
|
|
957
944
|
if (ExecutableCellView.is(cell) && ExecutableCellModel.is(cell.model)) {
|
|
958
945
|
cell.clearExecution();
|
|
959
946
|
cell.model.executing = false;
|
|
@@ -961,24 +948,24 @@ export var LibroView = (_dec = transient(), _dec2 = view(notebookViewFactoryId),
|
|
|
961
948
|
}
|
|
962
949
|
}
|
|
963
950
|
} catch (err) {
|
|
964
|
-
|
|
951
|
+
_iterator3.e(err);
|
|
965
952
|
} finally {
|
|
966
|
-
|
|
953
|
+
_iterator3.f();
|
|
967
954
|
}
|
|
968
955
|
};
|
|
969
956
|
_this.hideCellCode = function (cell) {
|
|
970
957
|
if (_this.model.selections.length !== 0 && _this.isSelected(cell)) {
|
|
971
|
-
var
|
|
972
|
-
|
|
958
|
+
var _iterator4 = _createForOfIteratorHelper(_this.model.selections),
|
|
959
|
+
_step4;
|
|
973
960
|
try {
|
|
974
|
-
for (
|
|
975
|
-
var selectedCell =
|
|
961
|
+
for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
|
|
962
|
+
var selectedCell = _step4.value;
|
|
976
963
|
selectedCell.hasInputHidden = true;
|
|
977
964
|
}
|
|
978
965
|
} catch (err) {
|
|
979
|
-
|
|
966
|
+
_iterator4.e(err);
|
|
980
967
|
} finally {
|
|
981
|
-
|
|
968
|
+
_iterator4.f();
|
|
982
969
|
}
|
|
983
970
|
} else {
|
|
984
971
|
cell.hasInputHidden = true;
|
|
@@ -986,17 +973,17 @@ export var LibroView = (_dec = transient(), _dec2 = view(notebookViewFactoryId),
|
|
|
986
973
|
};
|
|
987
974
|
_this.hideOrShowCellCode = function (cell) {
|
|
988
975
|
if (_this.model.selections.length !== 0 && _this.isSelected(cell)) {
|
|
989
|
-
var
|
|
990
|
-
|
|
976
|
+
var _iterator5 = _createForOfIteratorHelper(_this.model.selections),
|
|
977
|
+
_step5;
|
|
991
978
|
try {
|
|
992
|
-
for (
|
|
993
|
-
var selectedCell =
|
|
979
|
+
for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
|
|
980
|
+
var selectedCell = _step5.value;
|
|
994
981
|
selectedCell.hasInputHidden = !selectedCell.hasInputHidden;
|
|
995
982
|
}
|
|
996
983
|
} catch (err) {
|
|
997
|
-
|
|
984
|
+
_iterator5.e(err);
|
|
998
985
|
} finally {
|
|
999
|
-
|
|
986
|
+
_iterator5.f();
|
|
1000
987
|
}
|
|
1001
988
|
} else {
|
|
1002
989
|
cell.hasInputHidden = !cell.hasInputHidden;
|
|
@@ -1004,19 +991,19 @@ export var LibroView = (_dec = transient(), _dec2 = view(notebookViewFactoryId),
|
|
|
1004
991
|
};
|
|
1005
992
|
_this.hideOutputs = function (cell) {
|
|
1006
993
|
if (_this.model.selections.length !== 0 && _this.isSelected(cell)) {
|
|
1007
|
-
var
|
|
1008
|
-
|
|
994
|
+
var _iterator6 = _createForOfIteratorHelper(_this.model.selections),
|
|
995
|
+
_step6;
|
|
1009
996
|
try {
|
|
1010
|
-
for (
|
|
1011
|
-
var selectedCell =
|
|
997
|
+
for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
|
|
998
|
+
var selectedCell = _step6.value;
|
|
1012
999
|
if (ExecutableCellModel.is(selectedCell.model)) {
|
|
1013
1000
|
selectedCell.model.hasOutputHidden = true;
|
|
1014
1001
|
}
|
|
1015
1002
|
}
|
|
1016
1003
|
} catch (err) {
|
|
1017
|
-
|
|
1004
|
+
_iterator6.e(err);
|
|
1018
1005
|
} finally {
|
|
1019
|
-
|
|
1006
|
+
_iterator6.f();
|
|
1020
1007
|
}
|
|
1021
1008
|
} else {
|
|
1022
1009
|
if (ExecutableCellModel.is(cell.model)) {
|
|
@@ -1026,19 +1013,19 @@ export var LibroView = (_dec = transient(), _dec2 = view(notebookViewFactoryId),
|
|
|
1026
1013
|
};
|
|
1027
1014
|
_this.hideOrShowOutputs = function (cell) {
|
|
1028
1015
|
if (_this.model.selections.length !== 0 && _this.isSelected(cell)) {
|
|
1029
|
-
var
|
|
1030
|
-
|
|
1016
|
+
var _iterator7 = _createForOfIteratorHelper(_this.model.selections),
|
|
1017
|
+
_step7;
|
|
1031
1018
|
try {
|
|
1032
|
-
for (
|
|
1033
|
-
var selectedCell =
|
|
1019
|
+
for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) {
|
|
1020
|
+
var selectedCell = _step7.value;
|
|
1034
1021
|
if (ExecutableCellModel.is(selectedCell.model)) {
|
|
1035
1022
|
selectedCell.model.hasOutputHidden = !selectedCell.model.hasOutputHidden;
|
|
1036
1023
|
}
|
|
1037
1024
|
}
|
|
1038
1025
|
} catch (err) {
|
|
1039
|
-
|
|
1026
|
+
_iterator7.e(err);
|
|
1040
1027
|
} finally {
|
|
1041
|
-
|
|
1028
|
+
_iterator7.f();
|
|
1042
1029
|
}
|
|
1043
1030
|
} else {
|
|
1044
1031
|
if (ExecutableCellModel.is(cell.model)) {
|
|
@@ -1047,82 +1034,82 @@ export var LibroView = (_dec = transient(), _dec2 = view(notebookViewFactoryId),
|
|
|
1047
1034
|
}
|
|
1048
1035
|
};
|
|
1049
1036
|
_this.hideAllOutputs = function () {
|
|
1050
|
-
var
|
|
1051
|
-
|
|
1037
|
+
var _iterator8 = _createForOfIteratorHelper(_this.model.cells),
|
|
1038
|
+
_step8;
|
|
1052
1039
|
try {
|
|
1053
|
-
for (
|
|
1054
|
-
var cell =
|
|
1040
|
+
for (_iterator8.s(); !(_step8 = _iterator8.n()).done;) {
|
|
1041
|
+
var cell = _step8.value;
|
|
1055
1042
|
if (ExecutableCellModel.is(cell.model)) {
|
|
1056
1043
|
cell.model.hasOutputHidden = true;
|
|
1057
1044
|
}
|
|
1058
1045
|
}
|
|
1059
1046
|
} catch (err) {
|
|
1060
|
-
|
|
1047
|
+
_iterator8.e(err);
|
|
1061
1048
|
} finally {
|
|
1062
|
-
|
|
1049
|
+
_iterator8.f();
|
|
1063
1050
|
}
|
|
1064
1051
|
};
|
|
1065
1052
|
_this.hideAllCellCode = function () {
|
|
1066
|
-
var
|
|
1067
|
-
|
|
1053
|
+
var _iterator9 = _createForOfIteratorHelper(_this.model.cells),
|
|
1054
|
+
_step9;
|
|
1068
1055
|
try {
|
|
1069
|
-
for (
|
|
1070
|
-
var cell =
|
|
1056
|
+
for (_iterator9.s(); !(_step9 = _iterator9.n()).done;) {
|
|
1057
|
+
var cell = _step9.value;
|
|
1071
1058
|
cell.hasInputHidden = true;
|
|
1072
1059
|
}
|
|
1073
1060
|
} catch (err) {
|
|
1074
|
-
|
|
1061
|
+
_iterator9.e(err);
|
|
1075
1062
|
} finally {
|
|
1076
|
-
|
|
1063
|
+
_iterator9.f();
|
|
1077
1064
|
}
|
|
1078
1065
|
};
|
|
1079
1066
|
_this.showCellCode = function (cell) {
|
|
1080
1067
|
if (_this.model.selections.length !== 0 && _this.isSelected(cell)) {
|
|
1081
|
-
var
|
|
1082
|
-
|
|
1068
|
+
var _iterator10 = _createForOfIteratorHelper(_this.model.selections),
|
|
1069
|
+
_step10;
|
|
1083
1070
|
try {
|
|
1084
|
-
for (
|
|
1085
|
-
var selectedCell =
|
|
1071
|
+
for (_iterator10.s(); !(_step10 = _iterator10.n()).done;) {
|
|
1072
|
+
var selectedCell = _step10.value;
|
|
1086
1073
|
selectedCell.hasInputHidden = false;
|
|
1087
1074
|
}
|
|
1088
1075
|
} catch (err) {
|
|
1089
|
-
|
|
1076
|
+
_iterator10.e(err);
|
|
1090
1077
|
} finally {
|
|
1091
|
-
|
|
1078
|
+
_iterator10.f();
|
|
1092
1079
|
}
|
|
1093
1080
|
} else {
|
|
1094
1081
|
cell.hasInputHidden = false;
|
|
1095
1082
|
}
|
|
1096
1083
|
};
|
|
1097
1084
|
_this.showAllCellCode = function () {
|
|
1098
|
-
var
|
|
1099
|
-
|
|
1085
|
+
var _iterator11 = _createForOfIteratorHelper(_this.model.cells),
|
|
1086
|
+
_step11;
|
|
1100
1087
|
try {
|
|
1101
|
-
for (
|
|
1102
|
-
var cell =
|
|
1088
|
+
for (_iterator11.s(); !(_step11 = _iterator11.n()).done;) {
|
|
1089
|
+
var cell = _step11.value;
|
|
1103
1090
|
cell.hasInputHidden = false;
|
|
1104
1091
|
}
|
|
1105
1092
|
} catch (err) {
|
|
1106
|
-
|
|
1093
|
+
_iterator11.e(err);
|
|
1107
1094
|
} finally {
|
|
1108
|
-
|
|
1095
|
+
_iterator11.f();
|
|
1109
1096
|
}
|
|
1110
1097
|
};
|
|
1111
1098
|
_this.showCellOutputs = function (cell) {
|
|
1112
1099
|
if (_this.model.selections.length !== 0 && _this.isSelected(cell)) {
|
|
1113
|
-
var
|
|
1114
|
-
|
|
1100
|
+
var _iterator12 = _createForOfIteratorHelper(_this.model.selections),
|
|
1101
|
+
_step12;
|
|
1115
1102
|
try {
|
|
1116
|
-
for (
|
|
1117
|
-
var selectedCell =
|
|
1103
|
+
for (_iterator12.s(); !(_step12 = _iterator12.n()).done;) {
|
|
1104
|
+
var selectedCell = _step12.value;
|
|
1118
1105
|
if (ExecutableCellModel.is(selectedCell.model)) {
|
|
1119
1106
|
selectedCell.model.hasOutputHidden = false;
|
|
1120
1107
|
}
|
|
1121
1108
|
}
|
|
1122
1109
|
} catch (err) {
|
|
1123
|
-
|
|
1110
|
+
_iterator12.e(err);
|
|
1124
1111
|
} finally {
|
|
1125
|
-
|
|
1112
|
+
_iterator12.f();
|
|
1126
1113
|
}
|
|
1127
1114
|
} else {
|
|
1128
1115
|
if (ExecutableCellModel.is(cell.model)) {
|
|
@@ -1131,19 +1118,19 @@ export var LibroView = (_dec = transient(), _dec2 = view(notebookViewFactoryId),
|
|
|
1131
1118
|
}
|
|
1132
1119
|
};
|
|
1133
1120
|
_this.showAllCellOutputs = function () {
|
|
1134
|
-
var
|
|
1135
|
-
|
|
1121
|
+
var _iterator13 = _createForOfIteratorHelper(_this.model.cells),
|
|
1122
|
+
_step13;
|
|
1136
1123
|
try {
|
|
1137
|
-
for (
|
|
1138
|
-
var cell =
|
|
1124
|
+
for (_iterator13.s(); !(_step13 = _iterator13.n()).done;) {
|
|
1125
|
+
var cell = _step13.value;
|
|
1139
1126
|
if (ExecutableCellModel.is(cell.model)) {
|
|
1140
1127
|
cell.model.hasOutputHidden = false;
|
|
1141
1128
|
}
|
|
1142
1129
|
}
|
|
1143
1130
|
} catch (err) {
|
|
1144
|
-
|
|
1131
|
+
_iterator13.e(err);
|
|
1145
1132
|
} finally {
|
|
1146
|
-
|
|
1133
|
+
_iterator13.f();
|
|
1147
1134
|
}
|
|
1148
1135
|
};
|
|
1149
1136
|
_this.extendSelectionAbove = function () {
|
|
@@ -1190,19 +1177,19 @@ export var LibroView = (_dec = transient(), _dec2 = view(notebookViewFactoryId),
|
|
|
1190
1177
|
};
|
|
1191
1178
|
_this.enableOutputScrolling = function (cell) {
|
|
1192
1179
|
if (_this.model.selections.length !== 0 && _this.isSelected(cell)) {
|
|
1193
|
-
var
|
|
1194
|
-
|
|
1180
|
+
var _iterator14 = _createForOfIteratorHelper(_this.model.selections),
|
|
1181
|
+
_step14;
|
|
1195
1182
|
try {
|
|
1196
|
-
for (
|
|
1197
|
-
var selectedCell =
|
|
1183
|
+
for (_iterator14.s(); !(_step14 = _iterator14.n()).done;) {
|
|
1184
|
+
var selectedCell = _step14.value;
|
|
1198
1185
|
if (ExecutableCellModel.is(selectedCell.model)) {
|
|
1199
1186
|
selectedCell.model.hasOutputsScrolled = true;
|
|
1200
1187
|
}
|
|
1201
1188
|
}
|
|
1202
1189
|
} catch (err) {
|
|
1203
|
-
|
|
1190
|
+
_iterator14.e(err);
|
|
1204
1191
|
} finally {
|
|
1205
|
-
|
|
1192
|
+
_iterator14.f();
|
|
1206
1193
|
}
|
|
1207
1194
|
} else {
|
|
1208
1195
|
if (ExecutableCellModel.is(cell.model)) {
|
|
@@ -1213,19 +1200,19 @@ export var LibroView = (_dec = transient(), _dec2 = view(notebookViewFactoryId),
|
|
|
1213
1200
|
_this.disableOutputScrolling = function (cell) {
|
|
1214
1201
|
_this.outputsScroll = false;
|
|
1215
1202
|
if (_this.model.selections.length !== 0 && _this.isSelected(cell)) {
|
|
1216
|
-
var
|
|
1217
|
-
|
|
1203
|
+
var _iterator15 = _createForOfIteratorHelper(_this.model.selections),
|
|
1204
|
+
_step15;
|
|
1218
1205
|
try {
|
|
1219
|
-
for (
|
|
1220
|
-
var selectedCell =
|
|
1206
|
+
for (_iterator15.s(); !(_step15 = _iterator15.n()).done;) {
|
|
1207
|
+
var selectedCell = _step15.value;
|
|
1221
1208
|
if (ExecutableCellModel.is(selectedCell.model)) {
|
|
1222
1209
|
selectedCell.model.hasOutputsScrolled = false;
|
|
1223
1210
|
}
|
|
1224
1211
|
}
|
|
1225
1212
|
} catch (err) {
|
|
1226
|
-
|
|
1213
|
+
_iterator15.e(err);
|
|
1227
1214
|
} finally {
|
|
1228
|
-
|
|
1215
|
+
_iterator15.f();
|
|
1229
1216
|
}
|
|
1230
1217
|
} else {
|
|
1231
1218
|
if (ExecutableCellModel.is(cell.model)) {
|
|
@@ -1235,36 +1222,36 @@ export var LibroView = (_dec = transient(), _dec2 = view(notebookViewFactoryId),
|
|
|
1235
1222
|
};
|
|
1236
1223
|
_this.disableAllOutputScrolling = function () {
|
|
1237
1224
|
_this.outputsScroll = false;
|
|
1238
|
-
var
|
|
1239
|
-
|
|
1225
|
+
var _iterator16 = _createForOfIteratorHelper(_this.model.cells),
|
|
1226
|
+
_step16;
|
|
1240
1227
|
try {
|
|
1241
|
-
for (
|
|
1242
|
-
var cell =
|
|
1228
|
+
for (_iterator16.s(); !(_step16 = _iterator16.n()).done;) {
|
|
1229
|
+
var cell = _step16.value;
|
|
1243
1230
|
if (ExecutableCellModel.is(cell.model)) {
|
|
1244
1231
|
cell.model.hasOutputsScrolled = false;
|
|
1245
1232
|
}
|
|
1246
1233
|
}
|
|
1247
1234
|
} catch (err) {
|
|
1248
|
-
|
|
1235
|
+
_iterator16.e(err);
|
|
1249
1236
|
} finally {
|
|
1250
|
-
|
|
1237
|
+
_iterator16.f();
|
|
1251
1238
|
}
|
|
1252
1239
|
};
|
|
1253
1240
|
_this.enableAllOutputScrolling = function () {
|
|
1254
1241
|
_this.outputsScroll = true;
|
|
1255
|
-
var
|
|
1256
|
-
|
|
1242
|
+
var _iterator17 = _createForOfIteratorHelper(_this.model.cells),
|
|
1243
|
+
_step17;
|
|
1257
1244
|
try {
|
|
1258
|
-
for (
|
|
1259
|
-
var cell =
|
|
1245
|
+
for (_iterator17.s(); !(_step17 = _iterator17.n()).done;) {
|
|
1246
|
+
var cell = _step17.value;
|
|
1260
1247
|
if (ExecutableCellModel.is(cell.model)) {
|
|
1261
1248
|
cell.model.hasOutputsScrolled = true;
|
|
1262
1249
|
}
|
|
1263
1250
|
}
|
|
1264
1251
|
} catch (err) {
|
|
1265
|
-
|
|
1252
|
+
_iterator17.e(err);
|
|
1266
1253
|
} finally {
|
|
1267
|
-
|
|
1254
|
+
_iterator17.f();
|
|
1268
1255
|
}
|
|
1269
1256
|
};
|
|
1270
1257
|
_this.disposed = false;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"virtualized-manager.d.ts","sourceRoot":"","sources":["../src/virtualized-manager.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AAE/D,MAAM,WAAW,mBAAmB;IAClC,eAAe,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IACpF,aAAa,EAAE,OAAO,CAAC;CACxB;AAED,qBACa,kBAAmB,YAAW,mBAAmB;IAC5D;;;OAGG;IAEH,aAAa,UAAS;IAEtB,UAAU,EAAE,aAAa,CAAC;gBAIxB,wBAAwB,EAAE,wBAAwB;IAKpD;;;;;OAKG;IAEH,eAAe,WAAkB,MAAM,SAAS,MAAM,SAAS,MAAM,
|
|
1
|
+
{"version":3,"file":"virtualized-manager.d.ts","sourceRoot":"","sources":["../src/virtualized-manager.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AAE/D,MAAM,WAAW,mBAAmB;IAClC,eAAe,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IACpF,aAAa,EAAE,OAAO,CAAC;CACxB;AAED,qBACa,kBAAmB,YAAW,mBAAmB;IAC5D;;;OAGG;IAEH,aAAa,UAAS;IAEtB,UAAU,EAAE,aAAa,CAAC;gBAIxB,wBAAwB,EAAE,wBAAwB;IAKpD;;;;;OAKG;IAEH,eAAe,WAAkB,MAAM,SAAS,MAAM,SAAS,MAAM,sBAYnE;CACH"}
|
|
@@ -34,16 +34,9 @@ export var VirtualizedManager = (_dec = transient(), _dec2 = prop(), _dec(_class
|
|
|
34
34
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
35
35
|
while (1) switch (_context.prev = _context.next) {
|
|
36
36
|
case 0:
|
|
37
|
-
if (!(length > 100 || size && size > 4)) {
|
|
38
|
-
_context.next = 5;
|
|
39
|
-
break;
|
|
40
|
-
}
|
|
41
|
-
_this.isVirtualized = true;
|
|
42
|
-
return _context.abrupt("return", true);
|
|
43
|
-
case 5:
|
|
44
37
|
_this.isVirtualized = false;
|
|
45
38
|
return _context.abrupt("return", false);
|
|
46
|
-
case
|
|
39
|
+
case 2:
|
|
47
40
|
case "end":
|
|
48
41
|
return _context.stop();
|
|
49
42
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@difizen/libro-core",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.4",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"libro",
|
|
@@ -34,24 +34,28 @@
|
|
|
34
34
|
],
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@ant-design/icons": "^5.1.0",
|
|
37
|
-
"@difizen/libro-code-editor": "^0.3.
|
|
38
|
-
"@difizen/libro-common": "^0.3.
|
|
39
|
-
"@difizen/libro-shared-model": "^0.3.
|
|
40
|
-
"@difizen/libro-virtualized": "^0.3.
|
|
37
|
+
"@difizen/libro-code-editor": "^0.3.4",
|
|
38
|
+
"@difizen/libro-common": "^0.3.4",
|
|
39
|
+
"@difizen/libro-shared-model": "^0.3.4",
|
|
40
|
+
"@difizen/libro-virtualized": "^0.3.4",
|
|
41
41
|
"@difizen/mana-app": "latest",
|
|
42
42
|
"@difizen/mana-l10n": "latest",
|
|
43
43
|
"@difizen/mana-react": "latest",
|
|
44
44
|
"classnames": "^2.3.2",
|
|
45
45
|
"dayjs": "^1.11.10",
|
|
46
46
|
"dnd-core": "^16.0.1",
|
|
47
|
+
"lodash": "^4.17.21",
|
|
47
48
|
"react-dnd": "^16.0.1",
|
|
48
49
|
"react-dnd-html5-backend": "^16.0.1",
|
|
50
|
+
"react-dom": "^18.2.0",
|
|
49
51
|
"resize-observer-polyfill": "^1.5.1",
|
|
50
52
|
"uuid": "^9.0.0"
|
|
51
53
|
},
|
|
52
54
|
"devDependencies": {
|
|
53
55
|
"@types/react": "^18.2.25",
|
|
54
|
-
"@types/
|
|
56
|
+
"@types/react-dom": "^18.2.4",
|
|
57
|
+
"@types/uuid": "^9.0.2",
|
|
58
|
+
"@types/lodash": "^4.17.13"
|
|
55
59
|
},
|
|
56
60
|
"peerDependencies": {
|
|
57
61
|
"antd": "^5.8.6",
|