microboard-temp 0.13.94 → 0.13.96

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.
@@ -64830,6 +64830,7 @@ var init_AddDrawing2 = __esm(() => {
64830
64830
  var NestingHighlighter;
64831
64831
  var init_NestingHighlighter = __esm(() => {
64832
64832
  init_FrameData();
64833
+ init_BaseItem2();
64833
64834
  NestingHighlighter = class NestingHighlighter extends Tool {
64834
64835
  toHighlight = [];
64835
64836
  clear() {
@@ -64870,8 +64871,7 @@ var init_NestingHighlighter = __esm(() => {
64870
64871
  frameRect.render(context);
64871
64872
  }
64872
64873
  group.children.forEach((child) => {
64873
- child.render(context);
64874
- const childRect = child.getMbr();
64874
+ const childRect = child instanceof BaseItem && child.parent !== "Board" ? child.getWorldMbr() : child.getMbr();
64875
64875
  childRect.backgroundColor = FRAME_CHILDREN_HIGHLIGHTER_COLOR;
64876
64876
  childRect.borderColor = FRAME_CHILDREN_HIGHLIGHTER_BORDER_COLOR;
64877
64877
  childRect.strokeWidth = 0.3;
@@ -67206,6 +67206,7 @@ var init_Select = __esm(() => {
67206
67206
  init_NestingHighlighter2();
67207
67207
  init_RelativeAlignment2();
67208
67208
  init_RelativeAlignment();
67209
+ init_BaseItem2();
67209
67210
  Select = class Select extends Tool {
67210
67211
  board;
67211
67212
  line = null;
@@ -67595,10 +67596,11 @@ var init_Select = __esm(() => {
67595
67596
  if (this.handleSnapping(this.downOnItem)) {
67596
67597
  return false;
67597
67598
  }
67598
- const draggingMbr = draggingItem.getMbr();
67599
+ const draggingMbr = draggingItem instanceof BaseItem && draggingItem.parent !== "Board" ? draggingItem.getWorldMbr() : draggingItem.getMbr();
67599
67600
  const groups = this.board.items.getEnclosedOrCrossed(draggingMbr.left, draggingMbr.top, draggingMbr.right, draggingMbr.bottom).filter((item) => !!(("index" in item) && item.index));
67600
67601
  groups.forEach((group) => {
67601
- if (group.handleNesting(draggingItem)) {
67602
+ const alreadyInGroup = draggingItem instanceof BaseItem && draggingItem.parent === group.getId();
67603
+ if (group.handleNesting(draggingItem) && !alreadyInGroup) {
67602
67604
  this.nestingHighlighter.add(group, draggingItem);
67603
67605
  } else {
67604
67606
  this.nestingHighlighter.remove(draggingItem);
@@ -67655,7 +67657,8 @@ var init_Select = __esm(() => {
67655
67657
  selection.list().forEach((item) => {
67656
67658
  if (!(("index" in item) && item.index) && !draggingGroupsIds.includes(item.parent)) {
67657
67659
  groups.forEach((group) => {
67658
- if (group.handleNesting(item)) {
67660
+ const alreadyInGroup = item instanceof BaseItem && item.parent === group.getId();
67661
+ if (group.handleNesting(item) && !alreadyInGroup) {
67659
67662
  this.nestingHighlighter.add(group, item);
67660
67663
  } else {
67661
67664
  this.nestingHighlighter.remove(item);
package/dist/cjs/index.js CHANGED
@@ -64830,6 +64830,7 @@ var init_AddDrawing2 = __esm(() => {
64830
64830
  var NestingHighlighter;
64831
64831
  var init_NestingHighlighter = __esm(() => {
64832
64832
  init_FrameData();
64833
+ init_BaseItem2();
64833
64834
  NestingHighlighter = class NestingHighlighter extends Tool {
64834
64835
  toHighlight = [];
64835
64836
  clear() {
@@ -64870,8 +64871,7 @@ var init_NestingHighlighter = __esm(() => {
64870
64871
  frameRect.render(context);
64871
64872
  }
64872
64873
  group.children.forEach((child) => {
64873
- child.render(context);
64874
- const childRect = child.getMbr();
64874
+ const childRect = child instanceof BaseItem && child.parent !== "Board" ? child.getWorldMbr() : child.getMbr();
64875
64875
  childRect.backgroundColor = FRAME_CHILDREN_HIGHLIGHTER_COLOR;
64876
64876
  childRect.borderColor = FRAME_CHILDREN_HIGHLIGHTER_BORDER_COLOR;
64877
64877
  childRect.strokeWidth = 0.3;
@@ -67206,6 +67206,7 @@ var init_Select = __esm(() => {
67206
67206
  init_NestingHighlighter2();
67207
67207
  init_RelativeAlignment2();
67208
67208
  init_RelativeAlignment();
67209
+ init_BaseItem2();
67209
67210
  Select = class Select extends Tool {
67210
67211
  board;
67211
67212
  line = null;
@@ -67595,10 +67596,11 @@ var init_Select = __esm(() => {
67595
67596
  if (this.handleSnapping(this.downOnItem)) {
67596
67597
  return false;
67597
67598
  }
67598
- const draggingMbr = draggingItem.getMbr();
67599
+ const draggingMbr = draggingItem instanceof BaseItem && draggingItem.parent !== "Board" ? draggingItem.getWorldMbr() : draggingItem.getMbr();
67599
67600
  const groups = this.board.items.getEnclosedOrCrossed(draggingMbr.left, draggingMbr.top, draggingMbr.right, draggingMbr.bottom).filter((item) => !!(("index" in item) && item.index));
67600
67601
  groups.forEach((group) => {
67601
- if (group.handleNesting(draggingItem)) {
67602
+ const alreadyInGroup = draggingItem instanceof BaseItem && draggingItem.parent === group.getId();
67603
+ if (group.handleNesting(draggingItem) && !alreadyInGroup) {
67602
67604
  this.nestingHighlighter.add(group, draggingItem);
67603
67605
  } else {
67604
67606
  this.nestingHighlighter.remove(draggingItem);
@@ -67655,7 +67657,8 @@ var init_Select = __esm(() => {
67655
67657
  selection.list().forEach((item) => {
67656
67658
  if (!(("index" in item) && item.index) && !draggingGroupsIds.includes(item.parent)) {
67657
67659
  groups.forEach((group) => {
67658
- if (group.handleNesting(item)) {
67660
+ const alreadyInGroup = item instanceof BaseItem && item.parent === group.getId();
67661
+ if (group.handleNesting(item) && !alreadyInGroup) {
67659
67662
  this.nestingHighlighter.add(group, item);
67660
67663
  } else {
67661
67664
  this.nestingHighlighter.remove(item);
package/dist/cjs/node.js CHANGED
@@ -67250,6 +67250,7 @@ var init_AddDrawing2 = __esm(() => {
67250
67250
  var NestingHighlighter;
67251
67251
  var init_NestingHighlighter = __esm(() => {
67252
67252
  init_FrameData();
67253
+ init_BaseItem2();
67253
67254
  NestingHighlighter = class NestingHighlighter extends Tool {
67254
67255
  toHighlight = [];
67255
67256
  clear() {
@@ -67290,8 +67291,7 @@ var init_NestingHighlighter = __esm(() => {
67290
67291
  frameRect.render(context);
67291
67292
  }
67292
67293
  group.children.forEach((child) => {
67293
- child.render(context);
67294
- const childRect = child.getMbr();
67294
+ const childRect = child instanceof BaseItem && child.parent !== "Board" ? child.getWorldMbr() : child.getMbr();
67295
67295
  childRect.backgroundColor = FRAME_CHILDREN_HIGHLIGHTER_COLOR;
67296
67296
  childRect.borderColor = FRAME_CHILDREN_HIGHLIGHTER_BORDER_COLOR;
67297
67297
  childRect.strokeWidth = 0.3;
@@ -69626,6 +69626,7 @@ var init_Select = __esm(() => {
69626
69626
  init_NestingHighlighter2();
69627
69627
  init_RelativeAlignment2();
69628
69628
  init_RelativeAlignment();
69629
+ init_BaseItem2();
69629
69630
  Select = class Select extends Tool {
69630
69631
  board;
69631
69632
  line = null;
@@ -70015,10 +70016,11 @@ var init_Select = __esm(() => {
70015
70016
  if (this.handleSnapping(this.downOnItem)) {
70016
70017
  return false;
70017
70018
  }
70018
- const draggingMbr = draggingItem.getMbr();
70019
+ const draggingMbr = draggingItem instanceof BaseItem && draggingItem.parent !== "Board" ? draggingItem.getWorldMbr() : draggingItem.getMbr();
70019
70020
  const groups = this.board.items.getEnclosedOrCrossed(draggingMbr.left, draggingMbr.top, draggingMbr.right, draggingMbr.bottom).filter((item) => !!(("index" in item) && item.index));
70020
70021
  groups.forEach((group) => {
70021
- if (group.handleNesting(draggingItem)) {
70022
+ const alreadyInGroup = draggingItem instanceof BaseItem && draggingItem.parent === group.getId();
70023
+ if (group.handleNesting(draggingItem) && !alreadyInGroup) {
70022
70024
  this.nestingHighlighter.add(group, draggingItem);
70023
70025
  } else {
70024
70026
  this.nestingHighlighter.remove(draggingItem);
@@ -70075,7 +70077,8 @@ var init_Select = __esm(() => {
70075
70077
  selection.list().forEach((item) => {
70076
70078
  if (!(("index" in item) && item.index) && !draggingGroupsIds.includes(item.parent)) {
70077
70079
  groups.forEach((group) => {
70078
- if (group.handleNesting(item)) {
70080
+ const alreadyInGroup = item instanceof BaseItem && item.parent === group.getId();
70081
+ if (group.handleNesting(item) && !alreadyInGroup) {
70079
70082
  this.nestingHighlighter.add(group, item);
70080
70083
  } else {
70081
70084
  this.nestingHighlighter.remove(item);
@@ -64767,6 +64767,7 @@ var init_AddDrawing2 = __esm(() => {
64767
64767
  var NestingHighlighter;
64768
64768
  var init_NestingHighlighter = __esm(() => {
64769
64769
  init_FrameData();
64770
+ init_BaseItem2();
64770
64771
  NestingHighlighter = class NestingHighlighter extends Tool {
64771
64772
  toHighlight = [];
64772
64773
  clear() {
@@ -64807,8 +64808,7 @@ var init_NestingHighlighter = __esm(() => {
64807
64808
  frameRect.render(context);
64808
64809
  }
64809
64810
  group.children.forEach((child) => {
64810
- child.render(context);
64811
- const childRect = child.getMbr();
64811
+ const childRect = child instanceof BaseItem && child.parent !== "Board" ? child.getWorldMbr() : child.getMbr();
64812
64812
  childRect.backgroundColor = FRAME_CHILDREN_HIGHLIGHTER_COLOR;
64813
64813
  childRect.borderColor = FRAME_CHILDREN_HIGHLIGHTER_BORDER_COLOR;
64814
64814
  childRect.strokeWidth = 0.3;
@@ -67143,6 +67143,7 @@ var init_Select = __esm(() => {
67143
67143
  init_NestingHighlighter2();
67144
67144
  init_RelativeAlignment2();
67145
67145
  init_RelativeAlignment();
67146
+ init_BaseItem2();
67146
67147
  Select = class Select extends Tool {
67147
67148
  board;
67148
67149
  line = null;
@@ -67532,10 +67533,11 @@ var init_Select = __esm(() => {
67532
67533
  if (this.handleSnapping(this.downOnItem)) {
67533
67534
  return false;
67534
67535
  }
67535
- const draggingMbr = draggingItem.getMbr();
67536
+ const draggingMbr = draggingItem instanceof BaseItem && draggingItem.parent !== "Board" ? draggingItem.getWorldMbr() : draggingItem.getMbr();
67536
67537
  const groups = this.board.items.getEnclosedOrCrossed(draggingMbr.left, draggingMbr.top, draggingMbr.right, draggingMbr.bottom).filter((item) => !!(("index" in item) && item.index));
67537
67538
  groups.forEach((group) => {
67538
- if (group.handleNesting(draggingItem)) {
67539
+ const alreadyInGroup = draggingItem instanceof BaseItem && draggingItem.parent === group.getId();
67540
+ if (group.handleNesting(draggingItem) && !alreadyInGroup) {
67539
67541
  this.nestingHighlighter.add(group, draggingItem);
67540
67542
  } else {
67541
67543
  this.nestingHighlighter.remove(draggingItem);
@@ -67592,7 +67594,8 @@ var init_Select = __esm(() => {
67592
67594
  selection.list().forEach((item) => {
67593
67595
  if (!(("index" in item) && item.index) && !draggingGroupsIds.includes(item.parent)) {
67594
67596
  groups.forEach((group) => {
67595
- if (group.handleNesting(item)) {
67597
+ const alreadyInGroup = item instanceof BaseItem && item.parent === group.getId();
67598
+ if (group.handleNesting(item) && !alreadyInGroup) {
67596
67599
  this.nestingHighlighter.add(group, item);
67597
67600
  } else {
67598
67601
  this.nestingHighlighter.remove(item);
package/dist/esm/index.js CHANGED
@@ -64760,6 +64760,7 @@ var init_AddDrawing2 = __esm(() => {
64760
64760
  var NestingHighlighter;
64761
64761
  var init_NestingHighlighter = __esm(() => {
64762
64762
  init_FrameData();
64763
+ init_BaseItem2();
64763
64764
  NestingHighlighter = class NestingHighlighter extends Tool {
64764
64765
  toHighlight = [];
64765
64766
  clear() {
@@ -64800,8 +64801,7 @@ var init_NestingHighlighter = __esm(() => {
64800
64801
  frameRect.render(context);
64801
64802
  }
64802
64803
  group.children.forEach((child) => {
64803
- child.render(context);
64804
- const childRect = child.getMbr();
64804
+ const childRect = child instanceof BaseItem && child.parent !== "Board" ? child.getWorldMbr() : child.getMbr();
64805
64805
  childRect.backgroundColor = FRAME_CHILDREN_HIGHLIGHTER_COLOR;
64806
64806
  childRect.borderColor = FRAME_CHILDREN_HIGHLIGHTER_BORDER_COLOR;
64807
64807
  childRect.strokeWidth = 0.3;
@@ -67136,6 +67136,7 @@ var init_Select = __esm(() => {
67136
67136
  init_NestingHighlighter2();
67137
67137
  init_RelativeAlignment2();
67138
67138
  init_RelativeAlignment();
67139
+ init_BaseItem2();
67139
67140
  Select = class Select extends Tool {
67140
67141
  board;
67141
67142
  line = null;
@@ -67525,10 +67526,11 @@ var init_Select = __esm(() => {
67525
67526
  if (this.handleSnapping(this.downOnItem)) {
67526
67527
  return false;
67527
67528
  }
67528
- const draggingMbr = draggingItem.getMbr();
67529
+ const draggingMbr = draggingItem instanceof BaseItem && draggingItem.parent !== "Board" ? draggingItem.getWorldMbr() : draggingItem.getMbr();
67529
67530
  const groups = this.board.items.getEnclosedOrCrossed(draggingMbr.left, draggingMbr.top, draggingMbr.right, draggingMbr.bottom).filter((item) => !!(("index" in item) && item.index));
67530
67531
  groups.forEach((group) => {
67531
- if (group.handleNesting(draggingItem)) {
67532
+ const alreadyInGroup = draggingItem instanceof BaseItem && draggingItem.parent === group.getId();
67533
+ if (group.handleNesting(draggingItem) && !alreadyInGroup) {
67532
67534
  this.nestingHighlighter.add(group, draggingItem);
67533
67535
  } else {
67534
67536
  this.nestingHighlighter.remove(draggingItem);
@@ -67585,7 +67587,8 @@ var init_Select = __esm(() => {
67585
67587
  selection.list().forEach((item) => {
67586
67588
  if (!(("index" in item) && item.index) && !draggingGroupsIds.includes(item.parent)) {
67587
67589
  groups.forEach((group) => {
67588
- if (group.handleNesting(item)) {
67590
+ const alreadyInGroup = item instanceof BaseItem && item.parent === group.getId();
67591
+ if (group.handleNesting(item) && !alreadyInGroup) {
67589
67592
  this.nestingHighlighter.add(group, item);
67590
67593
  } else {
67591
67594
  this.nestingHighlighter.remove(item);
package/dist/esm/node.js CHANGED
@@ -67169,6 +67169,7 @@ var init_AddDrawing2 = __esm(() => {
67169
67169
  var NestingHighlighter;
67170
67170
  var init_NestingHighlighter = __esm(() => {
67171
67171
  init_FrameData();
67172
+ init_BaseItem2();
67172
67173
  NestingHighlighter = class NestingHighlighter extends Tool {
67173
67174
  toHighlight = [];
67174
67175
  clear() {
@@ -67209,8 +67210,7 @@ var init_NestingHighlighter = __esm(() => {
67209
67210
  frameRect.render(context);
67210
67211
  }
67211
67212
  group.children.forEach((child) => {
67212
- child.render(context);
67213
- const childRect = child.getMbr();
67213
+ const childRect = child instanceof BaseItem && child.parent !== "Board" ? child.getWorldMbr() : child.getMbr();
67214
67214
  childRect.backgroundColor = FRAME_CHILDREN_HIGHLIGHTER_COLOR;
67215
67215
  childRect.borderColor = FRAME_CHILDREN_HIGHLIGHTER_BORDER_COLOR;
67216
67216
  childRect.strokeWidth = 0.3;
@@ -69545,6 +69545,7 @@ var init_Select = __esm(() => {
69545
69545
  init_NestingHighlighter2();
69546
69546
  init_RelativeAlignment2();
69547
69547
  init_RelativeAlignment();
69548
+ init_BaseItem2();
69548
69549
  Select = class Select extends Tool {
69549
69550
  board;
69550
69551
  line = null;
@@ -69934,10 +69935,11 @@ var init_Select = __esm(() => {
69934
69935
  if (this.handleSnapping(this.downOnItem)) {
69935
69936
  return false;
69936
69937
  }
69937
- const draggingMbr = draggingItem.getMbr();
69938
+ const draggingMbr = draggingItem instanceof BaseItem && draggingItem.parent !== "Board" ? draggingItem.getWorldMbr() : draggingItem.getMbr();
69938
69939
  const groups = this.board.items.getEnclosedOrCrossed(draggingMbr.left, draggingMbr.top, draggingMbr.right, draggingMbr.bottom).filter((item) => !!(("index" in item) && item.index));
69939
69940
  groups.forEach((group) => {
69940
- if (group.handleNesting(draggingItem)) {
69941
+ const alreadyInGroup = draggingItem instanceof BaseItem && draggingItem.parent === group.getId();
69942
+ if (group.handleNesting(draggingItem) && !alreadyInGroup) {
69941
69943
  this.nestingHighlighter.add(group, draggingItem);
69942
69944
  } else {
69943
69945
  this.nestingHighlighter.remove(draggingItem);
@@ -69994,7 +69996,8 @@ var init_Select = __esm(() => {
69994
69996
  selection.list().forEach((item) => {
69995
69997
  if (!(("index" in item) && item.index) && !draggingGroupsIds.includes(item.parent)) {
69996
69998
  groups.forEach((group) => {
69997
- if (group.handleNesting(item)) {
69999
+ const alreadyInGroup = item instanceof BaseItem && item.parent === group.getId();
70000
+ if (group.handleNesting(item) && !alreadyInGroup) {
69998
70001
  this.nestingHighlighter.add(group, item);
69999
70002
  } else {
70000
70003
  this.nestingHighlighter.remove(item);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "microboard-temp",
3
- "version": "0.13.94",
3
+ "version": "0.13.96",
4
4
  "description": "A flexible interactive whiteboard library",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",