microboard-temp 0.13.81 → 0.13.83

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.
@@ -13221,7 +13221,7 @@ var init_BaseItem = __esm(() => {
13221
13221
  return this.index.items.listAll().map((item) => item.getId());
13222
13222
  }
13223
13223
  addChildItems(children) {
13224
- if (!this.index) {
13224
+ if (!this.index || children.length === 0) {
13225
13225
  return;
13226
13226
  }
13227
13227
  this.emit({
@@ -13236,6 +13236,9 @@ var init_BaseItem = __esm(() => {
13236
13236
  return;
13237
13237
  }
13238
13238
  const childrenArr = Array.isArray(children) ? children : [children];
13239
+ if (childrenArr.length === 0) {
13240
+ return;
13241
+ }
13239
13242
  this.emit({
13240
13243
  class: this.itemType,
13241
13244
  method: "removeChildren",
@@ -76275,7 +76278,7 @@ class Board {
76275
76278
  const groupsMap = new Map;
76276
76279
  arrayed.forEach((item) => {
76277
76280
  const itemCenter = item.getMbr().getCenter();
76278
- const groupItem = this.items.getGroupItemsInView().filter((groupItem2) => groupItem2.handleNesting(item)).reduce((acc, groupItem2) => {
76281
+ const groupItem = this.items.getGroupItemsInView().filter((groupItem2) => groupItem2 !== item).filter((groupItem2) => groupItem2.handleNesting(item)).reduce((acc, groupItem2) => {
76279
76282
  if (!acc || groupItem2.getDistanceToPoint(itemCenter) > acc.getDistanceToPoint(itemCenter)) {
76280
76283
  acc = groupItem2;
76281
76284
  }
package/dist/cjs/index.js CHANGED
@@ -13221,7 +13221,7 @@ var init_BaseItem = __esm(() => {
13221
13221
  return this.index.items.listAll().map((item) => item.getId());
13222
13222
  }
13223
13223
  addChildItems(children) {
13224
- if (!this.index) {
13224
+ if (!this.index || children.length === 0) {
13225
13225
  return;
13226
13226
  }
13227
13227
  this.emit({
@@ -13236,6 +13236,9 @@ var init_BaseItem = __esm(() => {
13236
13236
  return;
13237
13237
  }
13238
13238
  const childrenArr = Array.isArray(children) ? children : [children];
13239
+ if (childrenArr.length === 0) {
13240
+ return;
13241
+ }
13239
13242
  this.emit({
13240
13243
  class: this.itemType,
13241
13244
  method: "removeChildren",
@@ -76275,7 +76278,7 @@ class Board {
76275
76278
  const groupsMap = new Map;
76276
76279
  arrayed.forEach((item) => {
76277
76280
  const itemCenter = item.getMbr().getCenter();
76278
- const groupItem = this.items.getGroupItemsInView().filter((groupItem2) => groupItem2.handleNesting(item)).reduce((acc, groupItem2) => {
76281
+ const groupItem = this.items.getGroupItemsInView().filter((groupItem2) => groupItem2 !== item).filter((groupItem2) => groupItem2.handleNesting(item)).reduce((acc, groupItem2) => {
76279
76282
  if (!acc || groupItem2.getDistanceToPoint(itemCenter) > acc.getDistanceToPoint(itemCenter)) {
76280
76283
  acc = groupItem2;
76281
76284
  }
package/dist/cjs/node.js CHANGED
@@ -13241,7 +13241,7 @@ var init_BaseItem = __esm(() => {
13241
13241
  return this.index.items.listAll().map((item) => item.getId());
13242
13242
  }
13243
13243
  addChildItems(children) {
13244
- if (!this.index) {
13244
+ if (!this.index || children.length === 0) {
13245
13245
  return;
13246
13246
  }
13247
13247
  this.emit({
@@ -13256,6 +13256,9 @@ var init_BaseItem = __esm(() => {
13256
13256
  return;
13257
13257
  }
13258
13258
  const childrenArr = Array.isArray(children) ? children : [children];
13259
+ if (childrenArr.length === 0) {
13260
+ return;
13261
+ }
13259
13262
  this.emit({
13260
13263
  class: this.itemType,
13261
13264
  method: "removeChildren",
@@ -78750,7 +78753,7 @@ class Board {
78750
78753
  const groupsMap = new Map;
78751
78754
  arrayed.forEach((item) => {
78752
78755
  const itemCenter = item.getMbr().getCenter();
78753
- const groupItem = this.items.getGroupItemsInView().filter((groupItem2) => groupItem2.handleNesting(item)).reduce((acc, groupItem2) => {
78756
+ const groupItem = this.items.getGroupItemsInView().filter((groupItem2) => groupItem2 !== item).filter((groupItem2) => groupItem2.handleNesting(item)).reduce((acc, groupItem2) => {
78754
78757
  if (!acc || groupItem2.getDistanceToPoint(itemCenter) > acc.getDistanceToPoint(itemCenter)) {
78755
78758
  acc = groupItem2;
78756
78759
  }
@@ -13193,7 +13193,7 @@ var init_BaseItem = __esm(() => {
13193
13193
  return this.index.items.listAll().map((item) => item.getId());
13194
13194
  }
13195
13195
  addChildItems(children) {
13196
- if (!this.index) {
13196
+ if (!this.index || children.length === 0) {
13197
13197
  return;
13198
13198
  }
13199
13199
  this.emit({
@@ -13208,6 +13208,9 @@ var init_BaseItem = __esm(() => {
13208
13208
  return;
13209
13209
  }
13210
13210
  const childrenArr = Array.isArray(children) ? children : [children];
13211
+ if (childrenArr.length === 0) {
13212
+ return;
13213
+ }
13211
13214
  this.emit({
13212
13215
  class: this.itemType,
13213
13216
  method: "removeChildren",
@@ -76019,7 +76022,7 @@ class Board {
76019
76022
  const groupsMap = new Map;
76020
76023
  arrayed.forEach((item) => {
76021
76024
  const itemCenter = item.getMbr().getCenter();
76022
- const groupItem = this.items.getGroupItemsInView().filter((groupItem2) => groupItem2.handleNesting(item)).reduce((acc, groupItem2) => {
76025
+ const groupItem = this.items.getGroupItemsInView().filter((groupItem2) => groupItem2 !== item).filter((groupItem2) => groupItem2.handleNesting(item)).reduce((acc, groupItem2) => {
76023
76026
  if (!acc || groupItem2.getDistanceToPoint(itemCenter) > acc.getDistanceToPoint(itemCenter)) {
76024
76027
  acc = groupItem2;
76025
76028
  }
package/dist/esm/index.js CHANGED
@@ -13186,7 +13186,7 @@ var init_BaseItem = __esm(() => {
13186
13186
  return this.index.items.listAll().map((item) => item.getId());
13187
13187
  }
13188
13188
  addChildItems(children) {
13189
- if (!this.index) {
13189
+ if (!this.index || children.length === 0) {
13190
13190
  return;
13191
13191
  }
13192
13192
  this.emit({
@@ -13201,6 +13201,9 @@ var init_BaseItem = __esm(() => {
13201
13201
  return;
13202
13202
  }
13203
13203
  const childrenArr = Array.isArray(children) ? children : [children];
13204
+ if (childrenArr.length === 0) {
13205
+ return;
13206
+ }
13204
13207
  this.emit({
13205
13208
  class: this.itemType,
13206
13209
  method: "removeChildren",
@@ -76012,7 +76015,7 @@ class Board {
76012
76015
  const groupsMap = new Map;
76013
76016
  arrayed.forEach((item) => {
76014
76017
  const itemCenter = item.getMbr().getCenter();
76015
- const groupItem = this.items.getGroupItemsInView().filter((groupItem2) => groupItem2.handleNesting(item)).reduce((acc, groupItem2) => {
76018
+ const groupItem = this.items.getGroupItemsInView().filter((groupItem2) => groupItem2 !== item).filter((groupItem2) => groupItem2.handleNesting(item)).reduce((acc, groupItem2) => {
76016
76019
  if (!acc || groupItem2.getDistanceToPoint(itemCenter) > acc.getDistanceToPoint(itemCenter)) {
76017
76020
  acc = groupItem2;
76018
76021
  }
package/dist/esm/node.js CHANGED
@@ -13208,7 +13208,7 @@ var init_BaseItem = __esm(() => {
13208
13208
  return this.index.items.listAll().map((item) => item.getId());
13209
13209
  }
13210
13210
  addChildItems(children) {
13211
- if (!this.index) {
13211
+ if (!this.index || children.length === 0) {
13212
13212
  return;
13213
13213
  }
13214
13214
  this.emit({
@@ -13223,6 +13223,9 @@ var init_BaseItem = __esm(() => {
13223
13223
  return;
13224
13224
  }
13225
13225
  const childrenArr = Array.isArray(children) ? children : [children];
13226
+ if (childrenArr.length === 0) {
13227
+ return;
13228
+ }
13226
13229
  this.emit({
13227
13230
  class: this.itemType,
13228
13231
  method: "removeChildren",
@@ -78476,7 +78479,7 @@ class Board {
78476
78479
  const groupsMap = new Map;
78477
78480
  arrayed.forEach((item) => {
78478
78481
  const itemCenter = item.getMbr().getCenter();
78479
- const groupItem = this.items.getGroupItemsInView().filter((groupItem2) => groupItem2.handleNesting(item)).reduce((acc, groupItem2) => {
78482
+ const groupItem = this.items.getGroupItemsInView().filter((groupItem2) => groupItem2 !== item).filter((groupItem2) => groupItem2.handleNesting(item)).reduce((acc, groupItem2) => {
78480
78483
  if (!acc || groupItem2.getDistanceToPoint(itemCenter) > acc.getDistanceToPoint(itemCenter)) {
78481
78484
  acc = groupItem2;
78482
78485
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "microboard-temp",
3
- "version": "0.13.81",
3
+ "version": "0.13.83",
4
4
  "description": "A flexible interactive whiteboard library",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",