microboard-temp 0.4.45 → 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.
@@ -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 = movingItem instanceof Frame2 ? movingItem.getChildrenIds() : [];
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 instanceof Frame2) {
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 Frame2 ? single.getChildrenIds() : null;
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) && !selectedItem.index) {
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
@@ -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 = movingItem instanceof Frame2 ? movingItem.getChildrenIds() : [];
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 instanceof Frame2) {
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 Frame2 ? single.getChildrenIds() : null;
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) && !selectedItem.index) {
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
@@ -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 = movingItem instanceof Frame2 ? movingItem.getChildrenIds() : [];
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 instanceof Frame2) {
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 Frame2 ? single.getChildrenIds() : null;
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) && !selectedItem.index) {
54721
+ if (!("index" in selectedItem) || !selectedItem.index) {
54721
54722
  return;
54722
54723
  }
54723
54724
  for (const childId of selectedItem.getChildrenIds()) {
@@ -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 = movingItem instanceof Frame2 ? movingItem.getChildrenIds() : [];
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 instanceof Frame2) {
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 Frame2 ? single.getChildrenIds() : null;
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) && !selectedItem.index) {
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
@@ -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 = movingItem instanceof Frame2 ? movingItem.getChildrenIds() : [];
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 instanceof Frame2) {
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 Frame2 ? single.getChildrenIds() : null;
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) && !selectedItem.index) {
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
@@ -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 = movingItem instanceof Frame2 ? movingItem.getChildrenIds() : [];
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 instanceof Frame2) {
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 Frame2 ? single.getChildrenIds() : null;
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) && !selectedItem.index) {
54559
+ if (!("index" in selectedItem) || !selectedItem.index) {
54559
54560
  return;
54560
54561
  }
54561
54562
  for (const childId of selectedItem.getChildrenIds()) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "microboard-temp",
3
- "version": "0.4.45",
3
+ "version": "0.4.46",
4
4
  "description": "A flexible interactive whiteboard library",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",