microboard-temp 0.4.44 → 0.4.46
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/dist/cjs/browser.js +7 -6
- package/dist/cjs/index.js +7 -6
- package/dist/cjs/node.js +7 -6
- package/dist/esm/browser.js +7 -6
- package/dist/esm/index.js +7 -6
- package/dist/esm/node.js +7 -6
- package/package.json +1 -1
package/dist/cjs/browser.js
CHANGED
|
@@ -20970,7 +20970,7 @@ class Items {
|
|
|
20970
20970
|
return this.index.list();
|
|
20971
20971
|
}
|
|
20972
20972
|
listGroupItems() {
|
|
20973
|
-
return this.index.list().filter((item) => ("
|
|
20973
|
+
return this.index.list().filter((item) => ("index" in item) && item.index);
|
|
20974
20974
|
}
|
|
20975
20975
|
getById(id) {
|
|
20976
20976
|
return this.index.getById(id);
|
|
@@ -20985,7 +20985,7 @@ class Items {
|
|
|
20985
20985
|
return this.index.getEnclosedOrCrossed(left, top, right, bottom);
|
|
20986
20986
|
}
|
|
20987
20987
|
getGroupItemsEnclosedOrCrossed(left, top, right, bottom) {
|
|
20988
|
-
return this.index.getEnclosedOrCrossed(left, top, right, bottom).filter((item) => item instanceof BaseItem && item.
|
|
20988
|
+
return this.index.getEnclosedOrCrossed(left, top, right, bottom).filter((item) => item instanceof BaseItem && item.index);
|
|
20989
20989
|
}
|
|
20990
20990
|
getUnderPoint(point3, tolerance = 5) {
|
|
20991
20991
|
return this.index.getUnderPoint(point3, tolerance);
|
|
@@ -43750,6 +43750,7 @@ class NestingHighlighter extends Tool {
|
|
|
43750
43750
|
frameRect.render(context);
|
|
43751
43751
|
}
|
|
43752
43752
|
group.children.forEach((child) => {
|
|
43753
|
+
child.render(context);
|
|
43753
43754
|
const childRect = child.getMbr();
|
|
43754
43755
|
childRect.backgroundColor = FRAME_CHILDREN_HIGHLIGHTER_COLOR;
|
|
43755
43756
|
childRect.borderColor = FRAME_CHILDREN_HIGHLIGHTER_BORDER_COLOR;
|
|
@@ -45590,7 +45591,7 @@ class AlignmentHelper {
|
|
|
45590
45591
|
const cameraWidth = camera.getWidth();
|
|
45591
45592
|
const scale = this.board.camera.getScale();
|
|
45592
45593
|
const dynamicAlignThreshold = Math.min(this.alignThreshold / scale, 8);
|
|
45593
|
-
const childrenIds =
|
|
45594
|
+
const childrenIds = "index" in movingItem ? movingItem.getChildrenIds() : [];
|
|
45594
45595
|
const nearbyItems = this.canvasDrawer.getLastCreatedCanvas() ? this.spatialIndex.getNearestTo(movingMBR.getCenter(), 20, (item) => !excludeItems.includes(item), Math.ceil(cameraWidth)) : this.spatialIndex.getNearestTo(movingMBR.getCenter(), 20, (otherItem) => otherItem !== movingMBR && otherItem.itemType !== "Connector" && otherItem.itemType !== "Drawing" && otherItem.isInView(camera) && !childrenIds.includes(otherItem.getId()), Math.ceil(cameraWidth)).filter((item) => Array.isArray(movingItem) ? !movingItem.includes(item) : true);
|
|
45595
45596
|
const verticalAlignments = new Map;
|
|
45596
45597
|
const horizontalAlignments = new Map;
|
|
@@ -46495,7 +46496,7 @@ class Select extends Tool {
|
|
|
46495
46496
|
const isNotInSelection = this.board.selection.items.findById(underPointer.getId()) === null;
|
|
46496
46497
|
if (isNotInSelection) {
|
|
46497
46498
|
this.board.selection.add(underPointer);
|
|
46498
|
-
if (underPointer
|
|
46499
|
+
if ("index" in underPointer && underPointer.index) {
|
|
46499
46500
|
const { left, right, top, bottom } = underPointer.getMbr();
|
|
46500
46501
|
const itemsInFrame = this.board.items.getEnclosedOrCrossed(left, top, right, bottom).filter((item) => underPointer.getChildrenIds().includes(item.getId()));
|
|
46501
46502
|
this.board.selection.add(itemsInFrame);
|
|
@@ -51993,7 +51994,7 @@ class BoardSelection {
|
|
|
51993
51994
|
const startItemId = startPoint.pointType !== "Board" ? startPoint.item.getId() : null;
|
|
51994
51995
|
const endItemId = endPoint.pointType !== "Board" ? endPoint.item.getId() : null;
|
|
51995
51996
|
const single = this.items.getSingle();
|
|
51996
|
-
const frameChild = single instanceof
|
|
51997
|
+
const frameChild = single instanceof BaseItem && single.index ? single.getChildrenIds() : null;
|
|
51997
51998
|
const hasStartItem = startItemId && !this.items.findById(startItemId) && !frameChild?.some((child) => child === startItemId);
|
|
51998
51999
|
const hasEndItem = endItemId && !this.items.findById(endItemId) && !frameChild?.some((child) => child === endItemId);
|
|
51999
52000
|
if (hasStartItem) {
|
|
@@ -52244,7 +52245,7 @@ class BoardSelection {
|
|
|
52244
52245
|
};
|
|
52245
52246
|
}
|
|
52246
52247
|
function tryToAddFrameChildrenToTranslation(selectedItem) {
|
|
52247
|
-
if (!("index" in selectedItem)
|
|
52248
|
+
if (!("index" in selectedItem) || !selectedItem.index) {
|
|
52248
52249
|
return;
|
|
52249
52250
|
}
|
|
52250
52251
|
for (const childId of selectedItem.getChildrenIds()) {
|
package/dist/cjs/index.js
CHANGED
|
@@ -20970,7 +20970,7 @@ class Items {
|
|
|
20970
20970
|
return this.index.list();
|
|
20971
20971
|
}
|
|
20972
20972
|
listGroupItems() {
|
|
20973
|
-
return this.index.list().filter((item) => ("
|
|
20973
|
+
return this.index.list().filter((item) => ("index" in item) && item.index);
|
|
20974
20974
|
}
|
|
20975
20975
|
getById(id) {
|
|
20976
20976
|
return this.index.getById(id);
|
|
@@ -20985,7 +20985,7 @@ class Items {
|
|
|
20985
20985
|
return this.index.getEnclosedOrCrossed(left, top, right, bottom);
|
|
20986
20986
|
}
|
|
20987
20987
|
getGroupItemsEnclosedOrCrossed(left, top, right, bottom) {
|
|
20988
|
-
return this.index.getEnclosedOrCrossed(left, top, right, bottom).filter((item) => item instanceof BaseItem && item.
|
|
20988
|
+
return this.index.getEnclosedOrCrossed(left, top, right, bottom).filter((item) => item instanceof BaseItem && item.index);
|
|
20989
20989
|
}
|
|
20990
20990
|
getUnderPoint(point3, tolerance = 5) {
|
|
20991
20991
|
return this.index.getUnderPoint(point3, tolerance);
|
|
@@ -43750,6 +43750,7 @@ class NestingHighlighter extends Tool {
|
|
|
43750
43750
|
frameRect.render(context);
|
|
43751
43751
|
}
|
|
43752
43752
|
group.children.forEach((child) => {
|
|
43753
|
+
child.render(context);
|
|
43753
43754
|
const childRect = child.getMbr();
|
|
43754
43755
|
childRect.backgroundColor = FRAME_CHILDREN_HIGHLIGHTER_COLOR;
|
|
43755
43756
|
childRect.borderColor = FRAME_CHILDREN_HIGHLIGHTER_BORDER_COLOR;
|
|
@@ -45590,7 +45591,7 @@ class AlignmentHelper {
|
|
|
45590
45591
|
const cameraWidth = camera.getWidth();
|
|
45591
45592
|
const scale = this.board.camera.getScale();
|
|
45592
45593
|
const dynamicAlignThreshold = Math.min(this.alignThreshold / scale, 8);
|
|
45593
|
-
const childrenIds =
|
|
45594
|
+
const childrenIds = "index" in movingItem ? movingItem.getChildrenIds() : [];
|
|
45594
45595
|
const nearbyItems = this.canvasDrawer.getLastCreatedCanvas() ? this.spatialIndex.getNearestTo(movingMBR.getCenter(), 20, (item) => !excludeItems.includes(item), Math.ceil(cameraWidth)) : this.spatialIndex.getNearestTo(movingMBR.getCenter(), 20, (otherItem) => otherItem !== movingMBR && otherItem.itemType !== "Connector" && otherItem.itemType !== "Drawing" && otherItem.isInView(camera) && !childrenIds.includes(otherItem.getId()), Math.ceil(cameraWidth)).filter((item) => Array.isArray(movingItem) ? !movingItem.includes(item) : true);
|
|
45595
45596
|
const verticalAlignments = new Map;
|
|
45596
45597
|
const horizontalAlignments = new Map;
|
|
@@ -46495,7 +46496,7 @@ class Select extends Tool {
|
|
|
46495
46496
|
const isNotInSelection = this.board.selection.items.findById(underPointer.getId()) === null;
|
|
46496
46497
|
if (isNotInSelection) {
|
|
46497
46498
|
this.board.selection.add(underPointer);
|
|
46498
|
-
if (underPointer
|
|
46499
|
+
if ("index" in underPointer && underPointer.index) {
|
|
46499
46500
|
const { left, right, top, bottom } = underPointer.getMbr();
|
|
46500
46501
|
const itemsInFrame = this.board.items.getEnclosedOrCrossed(left, top, right, bottom).filter((item) => underPointer.getChildrenIds().includes(item.getId()));
|
|
46501
46502
|
this.board.selection.add(itemsInFrame);
|
|
@@ -51993,7 +51994,7 @@ class BoardSelection {
|
|
|
51993
51994
|
const startItemId = startPoint.pointType !== "Board" ? startPoint.item.getId() : null;
|
|
51994
51995
|
const endItemId = endPoint.pointType !== "Board" ? endPoint.item.getId() : null;
|
|
51995
51996
|
const single = this.items.getSingle();
|
|
51996
|
-
const frameChild = single instanceof
|
|
51997
|
+
const frameChild = single instanceof BaseItem && single.index ? single.getChildrenIds() : null;
|
|
51997
51998
|
const hasStartItem = startItemId && !this.items.findById(startItemId) && !frameChild?.some((child) => child === startItemId);
|
|
51998
51999
|
const hasEndItem = endItemId && !this.items.findById(endItemId) && !frameChild?.some((child) => child === endItemId);
|
|
51999
52000
|
if (hasStartItem) {
|
|
@@ -52244,7 +52245,7 @@ class BoardSelection {
|
|
|
52244
52245
|
};
|
|
52245
52246
|
}
|
|
52246
52247
|
function tryToAddFrameChildrenToTranslation(selectedItem) {
|
|
52247
|
-
if (!("index" in selectedItem)
|
|
52248
|
+
if (!("index" in selectedItem) || !selectedItem.index) {
|
|
52248
52249
|
return;
|
|
52249
52250
|
}
|
|
52250
52251
|
for (const childId of selectedItem.getChildrenIds()) {
|
package/dist/cjs/node.js
CHANGED
|
@@ -23442,7 +23442,7 @@ class Items {
|
|
|
23442
23442
|
return this.index.list();
|
|
23443
23443
|
}
|
|
23444
23444
|
listGroupItems() {
|
|
23445
|
-
return this.index.list().filter((item) => ("
|
|
23445
|
+
return this.index.list().filter((item) => ("index" in item) && item.index);
|
|
23446
23446
|
}
|
|
23447
23447
|
getById(id) {
|
|
23448
23448
|
return this.index.getById(id);
|
|
@@ -23457,7 +23457,7 @@ class Items {
|
|
|
23457
23457
|
return this.index.getEnclosedOrCrossed(left, top, right, bottom);
|
|
23458
23458
|
}
|
|
23459
23459
|
getGroupItemsEnclosedOrCrossed(left, top, right, bottom) {
|
|
23460
|
-
return this.index.getEnclosedOrCrossed(left, top, right, bottom).filter((item) => item instanceof BaseItem && item.
|
|
23460
|
+
return this.index.getEnclosedOrCrossed(left, top, right, bottom).filter((item) => item instanceof BaseItem && item.index);
|
|
23461
23461
|
}
|
|
23462
23462
|
getUnderPoint(point3, tolerance = 5) {
|
|
23463
23463
|
return this.index.getUnderPoint(point3, tolerance);
|
|
@@ -46223,6 +46223,7 @@ class NestingHighlighter extends Tool {
|
|
|
46223
46223
|
frameRect.render(context);
|
|
46224
46224
|
}
|
|
46225
46225
|
group.children.forEach((child) => {
|
|
46226
|
+
child.render(context);
|
|
46226
46227
|
const childRect = child.getMbr();
|
|
46227
46228
|
childRect.backgroundColor = FRAME_CHILDREN_HIGHLIGHTER_COLOR;
|
|
46228
46229
|
childRect.borderColor = FRAME_CHILDREN_HIGHLIGHTER_BORDER_COLOR;
|
|
@@ -48063,7 +48064,7 @@ class AlignmentHelper {
|
|
|
48063
48064
|
const cameraWidth = camera.getWidth();
|
|
48064
48065
|
const scale = this.board.camera.getScale();
|
|
48065
48066
|
const dynamicAlignThreshold = Math.min(this.alignThreshold / scale, 8);
|
|
48066
|
-
const childrenIds =
|
|
48067
|
+
const childrenIds = "index" in movingItem ? movingItem.getChildrenIds() : [];
|
|
48067
48068
|
const nearbyItems = this.canvasDrawer.getLastCreatedCanvas() ? this.spatialIndex.getNearestTo(movingMBR.getCenter(), 20, (item) => !excludeItems.includes(item), Math.ceil(cameraWidth)) : this.spatialIndex.getNearestTo(movingMBR.getCenter(), 20, (otherItem) => otherItem !== movingMBR && otherItem.itemType !== "Connector" && otherItem.itemType !== "Drawing" && otherItem.isInView(camera) && !childrenIds.includes(otherItem.getId()), Math.ceil(cameraWidth)).filter((item) => Array.isArray(movingItem) ? !movingItem.includes(item) : true);
|
|
48068
48069
|
const verticalAlignments = new Map;
|
|
48069
48070
|
const horizontalAlignments = new Map;
|
|
@@ -48968,7 +48969,7 @@ class Select extends Tool {
|
|
|
48968
48969
|
const isNotInSelection = this.board.selection.items.findById(underPointer.getId()) === null;
|
|
48969
48970
|
if (isNotInSelection) {
|
|
48970
48971
|
this.board.selection.add(underPointer);
|
|
48971
|
-
if (underPointer
|
|
48972
|
+
if ("index" in underPointer && underPointer.index) {
|
|
48972
48973
|
const { left, right, top, bottom } = underPointer.getMbr();
|
|
48973
48974
|
const itemsInFrame = this.board.items.getEnclosedOrCrossed(left, top, right, bottom).filter((item) => underPointer.getChildrenIds().includes(item.getId()));
|
|
48974
48975
|
this.board.selection.add(itemsInFrame);
|
|
@@ -54466,7 +54467,7 @@ class BoardSelection {
|
|
|
54466
54467
|
const startItemId = startPoint.pointType !== "Board" ? startPoint.item.getId() : null;
|
|
54467
54468
|
const endItemId = endPoint.pointType !== "Board" ? endPoint.item.getId() : null;
|
|
54468
54469
|
const single = this.items.getSingle();
|
|
54469
|
-
const frameChild = single instanceof
|
|
54470
|
+
const frameChild = single instanceof BaseItem && single.index ? single.getChildrenIds() : null;
|
|
54470
54471
|
const hasStartItem = startItemId && !this.items.findById(startItemId) && !frameChild?.some((child) => child === startItemId);
|
|
54471
54472
|
const hasEndItem = endItemId && !this.items.findById(endItemId) && !frameChild?.some((child) => child === endItemId);
|
|
54472
54473
|
if (hasStartItem) {
|
|
@@ -54717,7 +54718,7 @@ class BoardSelection {
|
|
|
54717
54718
|
};
|
|
54718
54719
|
}
|
|
54719
54720
|
function tryToAddFrameChildrenToTranslation(selectedItem) {
|
|
54720
|
-
if (!("index" in selectedItem)
|
|
54721
|
+
if (!("index" in selectedItem) || !selectedItem.index) {
|
|
54721
54722
|
return;
|
|
54722
54723
|
}
|
|
54723
54724
|
for (const childId of selectedItem.getChildrenIds()) {
|
package/dist/esm/browser.js
CHANGED
|
@@ -20820,7 +20820,7 @@ class Items {
|
|
|
20820
20820
|
return this.index.list();
|
|
20821
20821
|
}
|
|
20822
20822
|
listGroupItems() {
|
|
20823
|
-
return this.index.list().filter((item) => ("
|
|
20823
|
+
return this.index.list().filter((item) => ("index" in item) && item.index);
|
|
20824
20824
|
}
|
|
20825
20825
|
getById(id) {
|
|
20826
20826
|
return this.index.getById(id);
|
|
@@ -20835,7 +20835,7 @@ class Items {
|
|
|
20835
20835
|
return this.index.getEnclosedOrCrossed(left, top, right, bottom);
|
|
20836
20836
|
}
|
|
20837
20837
|
getGroupItemsEnclosedOrCrossed(left, top, right, bottom) {
|
|
20838
|
-
return this.index.getEnclosedOrCrossed(left, top, right, bottom).filter((item) => item instanceof BaseItem && item.
|
|
20838
|
+
return this.index.getEnclosedOrCrossed(left, top, right, bottom).filter((item) => item instanceof BaseItem && item.index);
|
|
20839
20839
|
}
|
|
20840
20840
|
getUnderPoint(point3, tolerance = 5) {
|
|
20841
20841
|
return this.index.getUnderPoint(point3, tolerance);
|
|
@@ -43600,6 +43600,7 @@ class NestingHighlighter extends Tool {
|
|
|
43600
43600
|
frameRect.render(context);
|
|
43601
43601
|
}
|
|
43602
43602
|
group.children.forEach((child) => {
|
|
43603
|
+
child.render(context);
|
|
43603
43604
|
const childRect = child.getMbr();
|
|
43604
43605
|
childRect.backgroundColor = FRAME_CHILDREN_HIGHLIGHTER_COLOR;
|
|
43605
43606
|
childRect.borderColor = FRAME_CHILDREN_HIGHLIGHTER_BORDER_COLOR;
|
|
@@ -45440,7 +45441,7 @@ class AlignmentHelper {
|
|
|
45440
45441
|
const cameraWidth = camera.getWidth();
|
|
45441
45442
|
const scale = this.board.camera.getScale();
|
|
45442
45443
|
const dynamicAlignThreshold = Math.min(this.alignThreshold / scale, 8);
|
|
45443
|
-
const childrenIds =
|
|
45444
|
+
const childrenIds = "index" in movingItem ? movingItem.getChildrenIds() : [];
|
|
45444
45445
|
const nearbyItems = this.canvasDrawer.getLastCreatedCanvas() ? this.spatialIndex.getNearestTo(movingMBR.getCenter(), 20, (item) => !excludeItems.includes(item), Math.ceil(cameraWidth)) : this.spatialIndex.getNearestTo(movingMBR.getCenter(), 20, (otherItem) => otherItem !== movingMBR && otherItem.itemType !== "Connector" && otherItem.itemType !== "Drawing" && otherItem.isInView(camera) && !childrenIds.includes(otherItem.getId()), Math.ceil(cameraWidth)).filter((item) => Array.isArray(movingItem) ? !movingItem.includes(item) : true);
|
|
45445
45446
|
const verticalAlignments = new Map;
|
|
45446
45447
|
const horizontalAlignments = new Map;
|
|
@@ -46345,7 +46346,7 @@ class Select extends Tool {
|
|
|
46345
46346
|
const isNotInSelection = this.board.selection.items.findById(underPointer.getId()) === null;
|
|
46346
46347
|
if (isNotInSelection) {
|
|
46347
46348
|
this.board.selection.add(underPointer);
|
|
46348
|
-
if (underPointer
|
|
46349
|
+
if ("index" in underPointer && underPointer.index) {
|
|
46349
46350
|
const { left, right, top, bottom } = underPointer.getMbr();
|
|
46350
46351
|
const itemsInFrame = this.board.items.getEnclosedOrCrossed(left, top, right, bottom).filter((item) => underPointer.getChildrenIds().includes(item.getId()));
|
|
46351
46352
|
this.board.selection.add(itemsInFrame);
|
|
@@ -51843,7 +51844,7 @@ class BoardSelection {
|
|
|
51843
51844
|
const startItemId = startPoint.pointType !== "Board" ? startPoint.item.getId() : null;
|
|
51844
51845
|
const endItemId = endPoint.pointType !== "Board" ? endPoint.item.getId() : null;
|
|
51845
51846
|
const single = this.items.getSingle();
|
|
51846
|
-
const frameChild = single instanceof
|
|
51847
|
+
const frameChild = single instanceof BaseItem && single.index ? single.getChildrenIds() : null;
|
|
51847
51848
|
const hasStartItem = startItemId && !this.items.findById(startItemId) && !frameChild?.some((child) => child === startItemId);
|
|
51848
51849
|
const hasEndItem = endItemId && !this.items.findById(endItemId) && !frameChild?.some((child) => child === endItemId);
|
|
51849
51850
|
if (hasStartItem) {
|
|
@@ -52094,7 +52095,7 @@ class BoardSelection {
|
|
|
52094
52095
|
};
|
|
52095
52096
|
}
|
|
52096
52097
|
function tryToAddFrameChildrenToTranslation(selectedItem) {
|
|
52097
|
-
if (!("index" in selectedItem)
|
|
52098
|
+
if (!("index" in selectedItem) || !selectedItem.index) {
|
|
52098
52099
|
return;
|
|
52099
52100
|
}
|
|
52100
52101
|
for (const childId of selectedItem.getChildrenIds()) {
|
package/dist/esm/index.js
CHANGED
|
@@ -20813,7 +20813,7 @@ class Items {
|
|
|
20813
20813
|
return this.index.list();
|
|
20814
20814
|
}
|
|
20815
20815
|
listGroupItems() {
|
|
20816
|
-
return this.index.list().filter((item) => ("
|
|
20816
|
+
return this.index.list().filter((item) => ("index" in item) && item.index);
|
|
20817
20817
|
}
|
|
20818
20818
|
getById(id) {
|
|
20819
20819
|
return this.index.getById(id);
|
|
@@ -20828,7 +20828,7 @@ class Items {
|
|
|
20828
20828
|
return this.index.getEnclosedOrCrossed(left, top, right, bottom);
|
|
20829
20829
|
}
|
|
20830
20830
|
getGroupItemsEnclosedOrCrossed(left, top, right, bottom) {
|
|
20831
|
-
return this.index.getEnclosedOrCrossed(left, top, right, bottom).filter((item) => item instanceof BaseItem && item.
|
|
20831
|
+
return this.index.getEnclosedOrCrossed(left, top, right, bottom).filter((item) => item instanceof BaseItem && item.index);
|
|
20832
20832
|
}
|
|
20833
20833
|
getUnderPoint(point3, tolerance = 5) {
|
|
20834
20834
|
return this.index.getUnderPoint(point3, tolerance);
|
|
@@ -43593,6 +43593,7 @@ class NestingHighlighter extends Tool {
|
|
|
43593
43593
|
frameRect.render(context);
|
|
43594
43594
|
}
|
|
43595
43595
|
group.children.forEach((child) => {
|
|
43596
|
+
child.render(context);
|
|
43596
43597
|
const childRect = child.getMbr();
|
|
43597
43598
|
childRect.backgroundColor = FRAME_CHILDREN_HIGHLIGHTER_COLOR;
|
|
43598
43599
|
childRect.borderColor = FRAME_CHILDREN_HIGHLIGHTER_BORDER_COLOR;
|
|
@@ -45433,7 +45434,7 @@ class AlignmentHelper {
|
|
|
45433
45434
|
const cameraWidth = camera.getWidth();
|
|
45434
45435
|
const scale = this.board.camera.getScale();
|
|
45435
45436
|
const dynamicAlignThreshold = Math.min(this.alignThreshold / scale, 8);
|
|
45436
|
-
const childrenIds =
|
|
45437
|
+
const childrenIds = "index" in movingItem ? movingItem.getChildrenIds() : [];
|
|
45437
45438
|
const nearbyItems = this.canvasDrawer.getLastCreatedCanvas() ? this.spatialIndex.getNearestTo(movingMBR.getCenter(), 20, (item) => !excludeItems.includes(item), Math.ceil(cameraWidth)) : this.spatialIndex.getNearestTo(movingMBR.getCenter(), 20, (otherItem) => otherItem !== movingMBR && otherItem.itemType !== "Connector" && otherItem.itemType !== "Drawing" && otherItem.isInView(camera) && !childrenIds.includes(otherItem.getId()), Math.ceil(cameraWidth)).filter((item) => Array.isArray(movingItem) ? !movingItem.includes(item) : true);
|
|
45438
45439
|
const verticalAlignments = new Map;
|
|
45439
45440
|
const horizontalAlignments = new Map;
|
|
@@ -46338,7 +46339,7 @@ class Select extends Tool {
|
|
|
46338
46339
|
const isNotInSelection = this.board.selection.items.findById(underPointer.getId()) === null;
|
|
46339
46340
|
if (isNotInSelection) {
|
|
46340
46341
|
this.board.selection.add(underPointer);
|
|
46341
|
-
if (underPointer
|
|
46342
|
+
if ("index" in underPointer && underPointer.index) {
|
|
46342
46343
|
const { left, right, top, bottom } = underPointer.getMbr();
|
|
46343
46344
|
const itemsInFrame = this.board.items.getEnclosedOrCrossed(left, top, right, bottom).filter((item) => underPointer.getChildrenIds().includes(item.getId()));
|
|
46344
46345
|
this.board.selection.add(itemsInFrame);
|
|
@@ -51836,7 +51837,7 @@ class BoardSelection {
|
|
|
51836
51837
|
const startItemId = startPoint.pointType !== "Board" ? startPoint.item.getId() : null;
|
|
51837
51838
|
const endItemId = endPoint.pointType !== "Board" ? endPoint.item.getId() : null;
|
|
51838
51839
|
const single = this.items.getSingle();
|
|
51839
|
-
const frameChild = single instanceof
|
|
51840
|
+
const frameChild = single instanceof BaseItem && single.index ? single.getChildrenIds() : null;
|
|
51840
51841
|
const hasStartItem = startItemId && !this.items.findById(startItemId) && !frameChild?.some((child) => child === startItemId);
|
|
51841
51842
|
const hasEndItem = endItemId && !this.items.findById(endItemId) && !frameChild?.some((child) => child === endItemId);
|
|
51842
51843
|
if (hasStartItem) {
|
|
@@ -52087,7 +52088,7 @@ class BoardSelection {
|
|
|
52087
52088
|
};
|
|
52088
52089
|
}
|
|
52089
52090
|
function tryToAddFrameChildrenToTranslation(selectedItem) {
|
|
52090
|
-
if (!("index" in selectedItem)
|
|
52091
|
+
if (!("index" in selectedItem) || !selectedItem.index) {
|
|
52091
52092
|
return;
|
|
52092
52093
|
}
|
|
52093
52094
|
for (const childId of selectedItem.getChildrenIds()) {
|
package/dist/esm/node.js
CHANGED
|
@@ -23280,7 +23280,7 @@ class Items {
|
|
|
23280
23280
|
return this.index.list();
|
|
23281
23281
|
}
|
|
23282
23282
|
listGroupItems() {
|
|
23283
|
-
return this.index.list().filter((item) => ("
|
|
23283
|
+
return this.index.list().filter((item) => ("index" in item) && item.index);
|
|
23284
23284
|
}
|
|
23285
23285
|
getById(id) {
|
|
23286
23286
|
return this.index.getById(id);
|
|
@@ -23295,7 +23295,7 @@ class Items {
|
|
|
23295
23295
|
return this.index.getEnclosedOrCrossed(left, top, right, bottom);
|
|
23296
23296
|
}
|
|
23297
23297
|
getGroupItemsEnclosedOrCrossed(left, top, right, bottom) {
|
|
23298
|
-
return this.index.getEnclosedOrCrossed(left, top, right, bottom).filter((item) => item instanceof BaseItem && item.
|
|
23298
|
+
return this.index.getEnclosedOrCrossed(left, top, right, bottom).filter((item) => item instanceof BaseItem && item.index);
|
|
23299
23299
|
}
|
|
23300
23300
|
getUnderPoint(point3, tolerance = 5) {
|
|
23301
23301
|
return this.index.getUnderPoint(point3, tolerance);
|
|
@@ -46061,6 +46061,7 @@ class NestingHighlighter extends Tool {
|
|
|
46061
46061
|
frameRect.render(context);
|
|
46062
46062
|
}
|
|
46063
46063
|
group.children.forEach((child) => {
|
|
46064
|
+
child.render(context);
|
|
46064
46065
|
const childRect = child.getMbr();
|
|
46065
46066
|
childRect.backgroundColor = FRAME_CHILDREN_HIGHLIGHTER_COLOR;
|
|
46066
46067
|
childRect.borderColor = FRAME_CHILDREN_HIGHLIGHTER_BORDER_COLOR;
|
|
@@ -47901,7 +47902,7 @@ class AlignmentHelper {
|
|
|
47901
47902
|
const cameraWidth = camera.getWidth();
|
|
47902
47903
|
const scale = this.board.camera.getScale();
|
|
47903
47904
|
const dynamicAlignThreshold = Math.min(this.alignThreshold / scale, 8);
|
|
47904
|
-
const childrenIds =
|
|
47905
|
+
const childrenIds = "index" in movingItem ? movingItem.getChildrenIds() : [];
|
|
47905
47906
|
const nearbyItems = this.canvasDrawer.getLastCreatedCanvas() ? this.spatialIndex.getNearestTo(movingMBR.getCenter(), 20, (item) => !excludeItems.includes(item), Math.ceil(cameraWidth)) : this.spatialIndex.getNearestTo(movingMBR.getCenter(), 20, (otherItem) => otherItem !== movingMBR && otherItem.itemType !== "Connector" && otherItem.itemType !== "Drawing" && otherItem.isInView(camera) && !childrenIds.includes(otherItem.getId()), Math.ceil(cameraWidth)).filter((item) => Array.isArray(movingItem) ? !movingItem.includes(item) : true);
|
|
47906
47907
|
const verticalAlignments = new Map;
|
|
47907
47908
|
const horizontalAlignments = new Map;
|
|
@@ -48806,7 +48807,7 @@ class Select extends Tool {
|
|
|
48806
48807
|
const isNotInSelection = this.board.selection.items.findById(underPointer.getId()) === null;
|
|
48807
48808
|
if (isNotInSelection) {
|
|
48808
48809
|
this.board.selection.add(underPointer);
|
|
48809
|
-
if (underPointer
|
|
48810
|
+
if ("index" in underPointer && underPointer.index) {
|
|
48810
48811
|
const { left, right, top, bottom } = underPointer.getMbr();
|
|
48811
48812
|
const itemsInFrame = this.board.items.getEnclosedOrCrossed(left, top, right, bottom).filter((item) => underPointer.getChildrenIds().includes(item.getId()));
|
|
48812
48813
|
this.board.selection.add(itemsInFrame);
|
|
@@ -54304,7 +54305,7 @@ class BoardSelection {
|
|
|
54304
54305
|
const startItemId = startPoint.pointType !== "Board" ? startPoint.item.getId() : null;
|
|
54305
54306
|
const endItemId = endPoint.pointType !== "Board" ? endPoint.item.getId() : null;
|
|
54306
54307
|
const single = this.items.getSingle();
|
|
54307
|
-
const frameChild = single instanceof
|
|
54308
|
+
const frameChild = single instanceof BaseItem && single.index ? single.getChildrenIds() : null;
|
|
54308
54309
|
const hasStartItem = startItemId && !this.items.findById(startItemId) && !frameChild?.some((child) => child === startItemId);
|
|
54309
54310
|
const hasEndItem = endItemId && !this.items.findById(endItemId) && !frameChild?.some((child) => child === endItemId);
|
|
54310
54311
|
if (hasStartItem) {
|
|
@@ -54555,7 +54556,7 @@ class BoardSelection {
|
|
|
54555
54556
|
};
|
|
54556
54557
|
}
|
|
54557
54558
|
function tryToAddFrameChildrenToTranslation(selectedItem) {
|
|
54558
|
-
if (!("index" in selectedItem)
|
|
54559
|
+
if (!("index" in selectedItem) || !selectedItem.index) {
|
|
54559
54560
|
return;
|
|
54560
54561
|
}
|
|
54561
54562
|
for (const childId of selectedItem.getChildrenIds()) {
|