@plait/core 0.78.1 → 0.79.0
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 +33 -19
- package/fesm2022/plait-core.mjs.map +1 -1
- package/interfaces/board.d.ts +1 -0
- package/package.json +1 -1
package/fesm2022/plait-core.mjs
CHANGED
|
@@ -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
|
}
|
|
@@ -5638,29 +5650,31 @@ function createBoard(children, options) {
|
|
|
5638
5650
|
},
|
|
5639
5651
|
getDeletedFragment: (data) => data,
|
|
5640
5652
|
getRelatedFragment: (data, originData) => data,
|
|
5641
|
-
normalizeElement: (context) => {
|
|
5642
|
-
},
|
|
5653
|
+
normalizeElement: (context) => { },
|
|
5643
5654
|
drawElement: (context) => {
|
|
5644
5655
|
throw new Error(`can not resolve plugin element component type: ${context.element.type}`);
|
|
5645
5656
|
},
|
|
5646
|
-
isWithinSelection: element => false,
|
|
5647
|
-
isRectangleHit: element => false,
|
|
5648
|
-
isHit: element => false,
|
|
5649
|
-
isInsidePoint: element => false,
|
|
5657
|
+
isWithinSelection: (element) => false,
|
|
5658
|
+
isRectangleHit: (element) => false,
|
|
5659
|
+
isHit: (element) => false,
|
|
5660
|
+
isInsidePoint: (element) => false,
|
|
5650
5661
|
getOneHitElement: (data) => data[0],
|
|
5651
|
-
isRecursion: element => true,
|
|
5652
|
-
isMovable: element => false,
|
|
5653
|
-
getRectangle: element => null,
|
|
5662
|
+
isRecursion: (element) => true,
|
|
5663
|
+
isMovable: (element) => false,
|
|
5664
|
+
getRectangle: (element) => null,
|
|
5654
5665
|
applyTheme: (element) => { },
|
|
5655
|
-
isAlign: element => false,
|
|
5656
|
-
pointerDown: pointer => { },
|
|
5657
|
-
pointerMove: pointer => { },
|
|
5658
|
-
pointerUp: pointer => { },
|
|
5659
|
-
pointerCancel: pointer => { },
|
|
5660
|
-
pointerOut: pointer => { },
|
|
5661
|
-
pointerLeave: pointer => { },
|
|
5662
|
-
globalPointerMove: pointer => { },
|
|
5663
|
-
globalPointerUp: pointer => { },
|
|
5666
|
+
isAlign: (element) => false,
|
|
5667
|
+
pointerDown: (pointer) => { },
|
|
5668
|
+
pointerMove: (pointer) => { },
|
|
5669
|
+
pointerUp: (pointer) => { },
|
|
5670
|
+
pointerCancel: (pointer) => { },
|
|
5671
|
+
pointerOut: (pointer) => { },
|
|
5672
|
+
pointerLeave: (pointer) => { },
|
|
5673
|
+
globalPointerMove: (pointer) => { },
|
|
5674
|
+
globalPointerUp: (pointer) => { },
|
|
5675
|
+
drop: (event) => {
|
|
5676
|
+
return false;
|
|
5677
|
+
},
|
|
5664
5678
|
isImageBindingAllowed: (element) => false,
|
|
5665
5679
|
canAddToGroup: (element) => true,
|
|
5666
5680
|
canSetZIndex: (element) => true,
|