@plait/core 0.78.0 → 0.78.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/fesm2022/plait-core.mjs
CHANGED
|
@@ -508,7 +508,7 @@ const PlaitNode = {
|
|
|
508
508
|
if (!n.children || !board.isExpanded(n)) {
|
|
509
509
|
return n;
|
|
510
510
|
}
|
|
511
|
-
while (n) {
|
|
511
|
+
while (n && n.children && n.children.length > 0 && board.isExpanded(n)) {
|
|
512
512
|
if (n.children.length === 0) {
|
|
513
513
|
break;
|
|
514
514
|
}
|
|
@@ -3154,7 +3154,7 @@ function setSelectedElementsWithGroup(board, elements, isShift) {
|
|
|
3154
3154
|
if (Selection.isCollapsed(board.selection)) {
|
|
3155
3155
|
const hitElement = elements[0];
|
|
3156
3156
|
const hitElementGroups = getGroupByElement(board, hitElement, true);
|
|
3157
|
-
if (hitElementGroups.length) {
|
|
3157
|
+
if (hitElementGroups.length > 0) {
|
|
3158
3158
|
const elementsInHighestGroup = getElementsInGroup(board, hitElementGroups[hitElementGroups.length - 1], true) || [];
|
|
3159
3159
|
const isSelectGroupElement = selectedElements.some((element) => elementsInHighestGroup.map((item) => item.id).includes(element.id));
|
|
3160
3160
|
if (isShift) {
|
|
@@ -3201,12 +3201,24 @@ function cacheSelectedElementsWithGroup(board, elements, isSelectGroupElement, h
|
|
|
3201
3201
|
if (selectedGroups.length > 1) {
|
|
3202
3202
|
newElements = getAllElementsInGroup(board, selectedGroups[selectedGroups.length - 2], true);
|
|
3203
3203
|
}
|
|
3204
|
+
else {
|
|
3205
|
+
const element = board.getOneHitElement(elements);
|
|
3206
|
+
if (element) {
|
|
3207
|
+
newElements = [element];
|
|
3208
|
+
}
|
|
3209
|
+
}
|
|
3204
3210
|
}
|
|
3205
3211
|
else {
|
|
3206
3212
|
const elementsInGroup = getAllElementsInGroup(board, hitElementGroups[hitElementGroups.length - 1], true);
|
|
3207
3213
|
if (!isSelectGroupElement) {
|
|
3208
3214
|
newElements = elementsInGroup;
|
|
3209
3215
|
}
|
|
3216
|
+
else {
|
|
3217
|
+
const element = board.getOneHitElement(elements);
|
|
3218
|
+
if (element) {
|
|
3219
|
+
newElements = [element];
|
|
3220
|
+
}
|
|
3221
|
+
}
|
|
3210
3222
|
}
|
|
3211
3223
|
cacheSelectedElements(board, uniqueById(newElements));
|
|
3212
3224
|
}
|