microboard-temp 0.4.82 → 0.4.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.
@@ -21312,10 +21312,6 @@ class SimpleSpatialIndex {
21312
21312
  if ("index" in item && item.index) {
21313
21313
  item.removeChildItems(item.index.list());
21314
21314
  }
21315
- if (item.parent !== "Board") {
21316
- const parentFrame = this.items.getById(item.parent);
21317
- parentFrame?.removeChildItems(item);
21318
- }
21319
21315
  this.itemsArray.splice(this.itemsArray.indexOf(item), 1);
21320
21316
  this.Mbr = new Mbr;
21321
21317
  this.itemsArray.forEach((item2) => this.Mbr.combine([item2.getMbr()]));
@@ -21575,8 +21571,8 @@ class BaseItem extends Mbr {
21575
21571
  const foundItem = this.board.items.getById(childId);
21576
21572
  if (this.parent !== childId && this.getId() !== childId) {
21577
21573
  if (!this.index?.getById(childId) && foundItem) {
21578
- foundItem.parent = this.getId();
21579
21574
  this.board.items.index.remove(foundItem);
21575
+ foundItem.parent = this.getId();
21580
21576
  this.index?.insert(foundItem);
21581
21577
  }
21582
21578
  }
@@ -21592,8 +21588,8 @@ class BaseItem extends Mbr {
21592
21588
  const foundItem = this.index?.getById(childId);
21593
21589
  if (this.parent !== childId && this.getId() !== childId) {
21594
21590
  if (foundItem) {
21595
- foundItem.parent = "Board";
21596
21591
  this.index?.remove(foundItem);
21592
+ foundItem.parent = "Board";
21597
21593
  this.board.items.index.insert(foundItem);
21598
21594
  }
21599
21595
  }
@@ -47953,8 +47949,8 @@ class Deck extends BaseItem {
47953
47949
  x: this.left + (this.index?.list().length || 0) * 2,
47954
47950
  y: this.top
47955
47951
  });
47956
- foundItem.parent = this.getId();
47957
47952
  this.board.items.index.remove(foundItem);
47953
+ foundItem.parent = this.getId();
47958
47954
  this.index?.insert(foundItem);
47959
47955
  }
47960
47956
  }
@@ -47977,8 +47973,8 @@ class Deck extends BaseItem {
47977
47973
  x: this.left,
47978
47974
  y: this.top - this.getHeight() / 2
47979
47975
  });
47980
- foundItem.parent = "Board";
47981
47976
  this.index?.remove(foundItem);
47977
+ foundItem.parent = "Board";
47982
47978
  this.board.items.index.insert(foundItem);
47983
47979
  }
47984
47980
  }
@@ -53899,15 +53895,15 @@ class Board {
53899
53895
  const { events, items } = snapshot;
53900
53896
  this.index.clear();
53901
53897
  const createdConnectors = {};
53902
- const createdFrames = {};
53898
+ const createdGroups = {};
53903
53899
  if (Array.isArray(items)) {
53904
53900
  for (const itemData of items) {
53905
53901
  const item = this.createItem(itemData.id, itemData);
53906
53902
  if (item instanceof Connector2) {
53907
53903
  createdConnectors[itemData.id] = { item, itemData };
53908
53904
  }
53909
- if (item instanceof Frame2) {
53910
- createdFrames[item.getId()] = { item, itemData };
53905
+ if ("index" in item && item.index) {
53906
+ createdGroups[item.getId()] = { item, itemData };
53911
53907
  }
53912
53908
  this.index.insert(item);
53913
53909
  }
@@ -53926,8 +53922,8 @@ class Board {
53926
53922
  item.applyStartPoint(itemData.startPoint);
53927
53923
  item.applyEndPoint(itemData.endPoint);
53928
53924
  }
53929
- for (const key in createdFrames) {
53930
- const { item, itemData } = createdFrames[key];
53925
+ for (const key in createdGroups) {
53926
+ const { item, itemData } = createdGroups[key];
53931
53927
  item.applyAddChildren(itemData.children);
53932
53928
  }
53933
53929
  this.events?.log.deserialize(events);
package/dist/cjs/index.js CHANGED
@@ -21312,10 +21312,6 @@ class SimpleSpatialIndex {
21312
21312
  if ("index" in item && item.index) {
21313
21313
  item.removeChildItems(item.index.list());
21314
21314
  }
21315
- if (item.parent !== "Board") {
21316
- const parentFrame = this.items.getById(item.parent);
21317
- parentFrame?.removeChildItems(item);
21318
- }
21319
21315
  this.itemsArray.splice(this.itemsArray.indexOf(item), 1);
21320
21316
  this.Mbr = new Mbr;
21321
21317
  this.itemsArray.forEach((item2) => this.Mbr.combine([item2.getMbr()]));
@@ -21575,8 +21571,8 @@ class BaseItem extends Mbr {
21575
21571
  const foundItem = this.board.items.getById(childId);
21576
21572
  if (this.parent !== childId && this.getId() !== childId) {
21577
21573
  if (!this.index?.getById(childId) && foundItem) {
21578
- foundItem.parent = this.getId();
21579
21574
  this.board.items.index.remove(foundItem);
21575
+ foundItem.parent = this.getId();
21580
21576
  this.index?.insert(foundItem);
21581
21577
  }
21582
21578
  }
@@ -21592,8 +21588,8 @@ class BaseItem extends Mbr {
21592
21588
  const foundItem = this.index?.getById(childId);
21593
21589
  if (this.parent !== childId && this.getId() !== childId) {
21594
21590
  if (foundItem) {
21595
- foundItem.parent = "Board";
21596
21591
  this.index?.remove(foundItem);
21592
+ foundItem.parent = "Board";
21597
21593
  this.board.items.index.insert(foundItem);
21598
21594
  }
21599
21595
  }
@@ -47953,8 +47949,8 @@ class Deck extends BaseItem {
47953
47949
  x: this.left + (this.index?.list().length || 0) * 2,
47954
47950
  y: this.top
47955
47951
  });
47956
- foundItem.parent = this.getId();
47957
47952
  this.board.items.index.remove(foundItem);
47953
+ foundItem.parent = this.getId();
47958
47954
  this.index?.insert(foundItem);
47959
47955
  }
47960
47956
  }
@@ -47977,8 +47973,8 @@ class Deck extends BaseItem {
47977
47973
  x: this.left,
47978
47974
  y: this.top - this.getHeight() / 2
47979
47975
  });
47980
- foundItem.parent = "Board";
47981
47976
  this.index?.remove(foundItem);
47977
+ foundItem.parent = "Board";
47982
47978
  this.board.items.index.insert(foundItem);
47983
47979
  }
47984
47980
  }
@@ -53899,15 +53895,15 @@ class Board {
53899
53895
  const { events, items } = snapshot;
53900
53896
  this.index.clear();
53901
53897
  const createdConnectors = {};
53902
- const createdFrames = {};
53898
+ const createdGroups = {};
53903
53899
  if (Array.isArray(items)) {
53904
53900
  for (const itemData of items) {
53905
53901
  const item = this.createItem(itemData.id, itemData);
53906
53902
  if (item instanceof Connector2) {
53907
53903
  createdConnectors[itemData.id] = { item, itemData };
53908
53904
  }
53909
- if (item instanceof Frame2) {
53910
- createdFrames[item.getId()] = { item, itemData };
53905
+ if ("index" in item && item.index) {
53906
+ createdGroups[item.getId()] = { item, itemData };
53911
53907
  }
53912
53908
  this.index.insert(item);
53913
53909
  }
@@ -53926,8 +53922,8 @@ class Board {
53926
53922
  item.applyStartPoint(itemData.startPoint);
53927
53923
  item.applyEndPoint(itemData.endPoint);
53928
53924
  }
53929
- for (const key in createdFrames) {
53930
- const { item, itemData } = createdFrames[key];
53925
+ for (const key in createdGroups) {
53926
+ const { item, itemData } = createdGroups[key];
53931
53927
  item.applyAddChildren(itemData.children);
53932
53928
  }
53933
53929
  this.events?.log.deserialize(events);
package/dist/cjs/node.js CHANGED
@@ -23784,10 +23784,6 @@ class SimpleSpatialIndex {
23784
23784
  if ("index" in item && item.index) {
23785
23785
  item.removeChildItems(item.index.list());
23786
23786
  }
23787
- if (item.parent !== "Board") {
23788
- const parentFrame = this.items.getById(item.parent);
23789
- parentFrame?.removeChildItems(item);
23790
- }
23791
23787
  this.itemsArray.splice(this.itemsArray.indexOf(item), 1);
23792
23788
  this.Mbr = new Mbr;
23793
23789
  this.itemsArray.forEach((item2) => this.Mbr.combine([item2.getMbr()]));
@@ -24047,8 +24043,8 @@ class BaseItem extends Mbr {
24047
24043
  const foundItem = this.board.items.getById(childId);
24048
24044
  if (this.parent !== childId && this.getId() !== childId) {
24049
24045
  if (!this.index?.getById(childId) && foundItem) {
24050
- foundItem.parent = this.getId();
24051
24046
  this.board.items.index.remove(foundItem);
24047
+ foundItem.parent = this.getId();
24052
24048
  this.index?.insert(foundItem);
24053
24049
  }
24054
24050
  }
@@ -24064,8 +24060,8 @@ class BaseItem extends Mbr {
24064
24060
  const foundItem = this.index?.getById(childId);
24065
24061
  if (this.parent !== childId && this.getId() !== childId) {
24066
24062
  if (foundItem) {
24067
- foundItem.parent = "Board";
24068
24063
  this.index?.remove(foundItem);
24064
+ foundItem.parent = "Board";
24069
24065
  this.board.items.index.insert(foundItem);
24070
24066
  }
24071
24067
  }
@@ -50426,8 +50422,8 @@ class Deck extends BaseItem {
50426
50422
  x: this.left + (this.index?.list().length || 0) * 2,
50427
50423
  y: this.top
50428
50424
  });
50429
- foundItem.parent = this.getId();
50430
50425
  this.board.items.index.remove(foundItem);
50426
+ foundItem.parent = this.getId();
50431
50427
  this.index?.insert(foundItem);
50432
50428
  }
50433
50429
  }
@@ -50450,8 +50446,8 @@ class Deck extends BaseItem {
50450
50446
  x: this.left,
50451
50447
  y: this.top - this.getHeight() / 2
50452
50448
  });
50453
- foundItem.parent = "Board";
50454
50449
  this.index?.remove(foundItem);
50450
+ foundItem.parent = "Board";
50455
50451
  this.board.items.index.insert(foundItem);
50456
50452
  }
50457
50453
  }
@@ -56372,15 +56368,15 @@ class Board {
56372
56368
  const { events, items } = snapshot;
56373
56369
  this.index.clear();
56374
56370
  const createdConnectors = {};
56375
- const createdFrames = {};
56371
+ const createdGroups = {};
56376
56372
  if (Array.isArray(items)) {
56377
56373
  for (const itemData of items) {
56378
56374
  const item = this.createItem(itemData.id, itemData);
56379
56375
  if (item instanceof Connector2) {
56380
56376
  createdConnectors[itemData.id] = { item, itemData };
56381
56377
  }
56382
- if (item instanceof Frame2) {
56383
- createdFrames[item.getId()] = { item, itemData };
56378
+ if ("index" in item && item.index) {
56379
+ createdGroups[item.getId()] = { item, itemData };
56384
56380
  }
56385
56381
  this.index.insert(item);
56386
56382
  }
@@ -56399,8 +56395,8 @@ class Board {
56399
56395
  item.applyStartPoint(itemData.startPoint);
56400
56396
  item.applyEndPoint(itemData.endPoint);
56401
56397
  }
56402
- for (const key in createdFrames) {
56403
- const { item, itemData } = createdFrames[key];
56398
+ for (const key in createdGroups) {
56399
+ const { item, itemData } = createdGroups[key];
56404
56400
  item.applyAddChildren(itemData.children);
56405
56401
  }
56406
56402
  this.events?.log.deserialize(events);
@@ -21161,10 +21161,6 @@ class SimpleSpatialIndex {
21161
21161
  if ("index" in item && item.index) {
21162
21162
  item.removeChildItems(item.index.list());
21163
21163
  }
21164
- if (item.parent !== "Board") {
21165
- const parentFrame = this.items.getById(item.parent);
21166
- parentFrame?.removeChildItems(item);
21167
- }
21168
21164
  this.itemsArray.splice(this.itemsArray.indexOf(item), 1);
21169
21165
  this.Mbr = new Mbr;
21170
21166
  this.itemsArray.forEach((item2) => this.Mbr.combine([item2.getMbr()]));
@@ -21424,8 +21420,8 @@ class BaseItem extends Mbr {
21424
21420
  const foundItem = this.board.items.getById(childId);
21425
21421
  if (this.parent !== childId && this.getId() !== childId) {
21426
21422
  if (!this.index?.getById(childId) && foundItem) {
21427
- foundItem.parent = this.getId();
21428
21423
  this.board.items.index.remove(foundItem);
21424
+ foundItem.parent = this.getId();
21429
21425
  this.index?.insert(foundItem);
21430
21426
  }
21431
21427
  }
@@ -21441,8 +21437,8 @@ class BaseItem extends Mbr {
21441
21437
  const foundItem = this.index?.getById(childId);
21442
21438
  if (this.parent !== childId && this.getId() !== childId) {
21443
21439
  if (foundItem) {
21444
- foundItem.parent = "Board";
21445
21440
  this.index?.remove(foundItem);
21441
+ foundItem.parent = "Board";
21446
21442
  this.board.items.index.insert(foundItem);
21447
21443
  }
21448
21444
  }
@@ -47802,8 +47798,8 @@ class Deck extends BaseItem {
47802
47798
  x: this.left + (this.index?.list().length || 0) * 2,
47803
47799
  y: this.top
47804
47800
  });
47805
- foundItem.parent = this.getId();
47806
47801
  this.board.items.index.remove(foundItem);
47802
+ foundItem.parent = this.getId();
47807
47803
  this.index?.insert(foundItem);
47808
47804
  }
47809
47805
  }
@@ -47826,8 +47822,8 @@ class Deck extends BaseItem {
47826
47822
  x: this.left,
47827
47823
  y: this.top - this.getHeight() / 2
47828
47824
  });
47829
- foundItem.parent = "Board";
47830
47825
  this.index?.remove(foundItem);
47826
+ foundItem.parent = "Board";
47831
47827
  this.board.items.index.insert(foundItem);
47832
47828
  }
47833
47829
  }
@@ -53748,15 +53744,15 @@ class Board {
53748
53744
  const { events, items } = snapshot;
53749
53745
  this.index.clear();
53750
53746
  const createdConnectors = {};
53751
- const createdFrames = {};
53747
+ const createdGroups = {};
53752
53748
  if (Array.isArray(items)) {
53753
53749
  for (const itemData of items) {
53754
53750
  const item = this.createItem(itemData.id, itemData);
53755
53751
  if (item instanceof Connector2) {
53756
53752
  createdConnectors[itemData.id] = { item, itemData };
53757
53753
  }
53758
- if (item instanceof Frame2) {
53759
- createdFrames[item.getId()] = { item, itemData };
53754
+ if ("index" in item && item.index) {
53755
+ createdGroups[item.getId()] = { item, itemData };
53760
53756
  }
53761
53757
  this.index.insert(item);
53762
53758
  }
@@ -53775,8 +53771,8 @@ class Board {
53775
53771
  item.applyStartPoint(itemData.startPoint);
53776
53772
  item.applyEndPoint(itemData.endPoint);
53777
53773
  }
53778
- for (const key in createdFrames) {
53779
- const { item, itemData } = createdFrames[key];
53774
+ for (const key in createdGroups) {
53775
+ const { item, itemData } = createdGroups[key];
53780
53776
  item.applyAddChildren(itemData.children);
53781
53777
  }
53782
53778
  this.events?.log.deserialize(events);
package/dist/esm/index.js CHANGED
@@ -21154,10 +21154,6 @@ class SimpleSpatialIndex {
21154
21154
  if ("index" in item && item.index) {
21155
21155
  item.removeChildItems(item.index.list());
21156
21156
  }
21157
- if (item.parent !== "Board") {
21158
- const parentFrame = this.items.getById(item.parent);
21159
- parentFrame?.removeChildItems(item);
21160
- }
21161
21157
  this.itemsArray.splice(this.itemsArray.indexOf(item), 1);
21162
21158
  this.Mbr = new Mbr;
21163
21159
  this.itemsArray.forEach((item2) => this.Mbr.combine([item2.getMbr()]));
@@ -21417,8 +21413,8 @@ class BaseItem extends Mbr {
21417
21413
  const foundItem = this.board.items.getById(childId);
21418
21414
  if (this.parent !== childId && this.getId() !== childId) {
21419
21415
  if (!this.index?.getById(childId) && foundItem) {
21420
- foundItem.parent = this.getId();
21421
21416
  this.board.items.index.remove(foundItem);
21417
+ foundItem.parent = this.getId();
21422
21418
  this.index?.insert(foundItem);
21423
21419
  }
21424
21420
  }
@@ -21434,8 +21430,8 @@ class BaseItem extends Mbr {
21434
21430
  const foundItem = this.index?.getById(childId);
21435
21431
  if (this.parent !== childId && this.getId() !== childId) {
21436
21432
  if (foundItem) {
21437
- foundItem.parent = "Board";
21438
21433
  this.index?.remove(foundItem);
21434
+ foundItem.parent = "Board";
21439
21435
  this.board.items.index.insert(foundItem);
21440
21436
  }
21441
21437
  }
@@ -47795,8 +47791,8 @@ class Deck extends BaseItem {
47795
47791
  x: this.left + (this.index?.list().length || 0) * 2,
47796
47792
  y: this.top
47797
47793
  });
47798
- foundItem.parent = this.getId();
47799
47794
  this.board.items.index.remove(foundItem);
47795
+ foundItem.parent = this.getId();
47800
47796
  this.index?.insert(foundItem);
47801
47797
  }
47802
47798
  }
@@ -47819,8 +47815,8 @@ class Deck extends BaseItem {
47819
47815
  x: this.left,
47820
47816
  y: this.top - this.getHeight() / 2
47821
47817
  });
47822
- foundItem.parent = "Board";
47823
47818
  this.index?.remove(foundItem);
47819
+ foundItem.parent = "Board";
47824
47820
  this.board.items.index.insert(foundItem);
47825
47821
  }
47826
47822
  }
@@ -53741,15 +53737,15 @@ class Board {
53741
53737
  const { events, items } = snapshot;
53742
53738
  this.index.clear();
53743
53739
  const createdConnectors = {};
53744
- const createdFrames = {};
53740
+ const createdGroups = {};
53745
53741
  if (Array.isArray(items)) {
53746
53742
  for (const itemData of items) {
53747
53743
  const item = this.createItem(itemData.id, itemData);
53748
53744
  if (item instanceof Connector2) {
53749
53745
  createdConnectors[itemData.id] = { item, itemData };
53750
53746
  }
53751
- if (item instanceof Frame2) {
53752
- createdFrames[item.getId()] = { item, itemData };
53747
+ if ("index" in item && item.index) {
53748
+ createdGroups[item.getId()] = { item, itemData };
53753
53749
  }
53754
53750
  this.index.insert(item);
53755
53751
  }
@@ -53768,8 +53764,8 @@ class Board {
53768
53764
  item.applyStartPoint(itemData.startPoint);
53769
53765
  item.applyEndPoint(itemData.endPoint);
53770
53766
  }
53771
- for (const key in createdFrames) {
53772
- const { item, itemData } = createdFrames[key];
53767
+ for (const key in createdGroups) {
53768
+ const { item, itemData } = createdGroups[key];
53773
53769
  item.applyAddChildren(itemData.children);
53774
53770
  }
53775
53771
  this.events?.log.deserialize(events);
package/dist/esm/node.js CHANGED
@@ -23621,10 +23621,6 @@ class SimpleSpatialIndex {
23621
23621
  if ("index" in item && item.index) {
23622
23622
  item.removeChildItems(item.index.list());
23623
23623
  }
23624
- if (item.parent !== "Board") {
23625
- const parentFrame = this.items.getById(item.parent);
23626
- parentFrame?.removeChildItems(item);
23627
- }
23628
23624
  this.itemsArray.splice(this.itemsArray.indexOf(item), 1);
23629
23625
  this.Mbr = new Mbr;
23630
23626
  this.itemsArray.forEach((item2) => this.Mbr.combine([item2.getMbr()]));
@@ -23884,8 +23880,8 @@ class BaseItem extends Mbr {
23884
23880
  const foundItem = this.board.items.getById(childId);
23885
23881
  if (this.parent !== childId && this.getId() !== childId) {
23886
23882
  if (!this.index?.getById(childId) && foundItem) {
23887
- foundItem.parent = this.getId();
23888
23883
  this.board.items.index.remove(foundItem);
23884
+ foundItem.parent = this.getId();
23889
23885
  this.index?.insert(foundItem);
23890
23886
  }
23891
23887
  }
@@ -23901,8 +23897,8 @@ class BaseItem extends Mbr {
23901
23897
  const foundItem = this.index?.getById(childId);
23902
23898
  if (this.parent !== childId && this.getId() !== childId) {
23903
23899
  if (foundItem) {
23904
- foundItem.parent = "Board";
23905
23900
  this.index?.remove(foundItem);
23901
+ foundItem.parent = "Board";
23906
23902
  this.board.items.index.insert(foundItem);
23907
23903
  }
23908
23904
  }
@@ -50263,8 +50259,8 @@ class Deck extends BaseItem {
50263
50259
  x: this.left + (this.index?.list().length || 0) * 2,
50264
50260
  y: this.top
50265
50261
  });
50266
- foundItem.parent = this.getId();
50267
50262
  this.board.items.index.remove(foundItem);
50263
+ foundItem.parent = this.getId();
50268
50264
  this.index?.insert(foundItem);
50269
50265
  }
50270
50266
  }
@@ -50287,8 +50283,8 @@ class Deck extends BaseItem {
50287
50283
  x: this.left,
50288
50284
  y: this.top - this.getHeight() / 2
50289
50285
  });
50290
- foundItem.parent = "Board";
50291
50286
  this.index?.remove(foundItem);
50287
+ foundItem.parent = "Board";
50292
50288
  this.board.items.index.insert(foundItem);
50293
50289
  }
50294
50290
  }
@@ -56209,15 +56205,15 @@ class Board {
56209
56205
  const { events, items } = snapshot;
56210
56206
  this.index.clear();
56211
56207
  const createdConnectors = {};
56212
- const createdFrames = {};
56208
+ const createdGroups = {};
56213
56209
  if (Array.isArray(items)) {
56214
56210
  for (const itemData of items) {
56215
56211
  const item = this.createItem(itemData.id, itemData);
56216
56212
  if (item instanceof Connector2) {
56217
56213
  createdConnectors[itemData.id] = { item, itemData };
56218
56214
  }
56219
- if (item instanceof Frame2) {
56220
- createdFrames[item.getId()] = { item, itemData };
56215
+ if ("index" in item && item.index) {
56216
+ createdGroups[item.getId()] = { item, itemData };
56221
56217
  }
56222
56218
  this.index.insert(item);
56223
56219
  }
@@ -56236,8 +56232,8 @@ class Board {
56236
56232
  item.applyStartPoint(itemData.startPoint);
56237
56233
  item.applyEndPoint(itemData.endPoint);
56238
56234
  }
56239
- for (const key in createdFrames) {
56240
- const { item, itemData } = createdFrames[key];
56235
+ for (const key in createdGroups) {
56236
+ const { item, itemData } = createdGroups[key];
56241
56237
  item.applyAddChildren(itemData.children);
56242
56238
  }
56243
56239
  this.events?.log.deserialize(events);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "microboard-temp",
3
- "version": "0.4.82",
3
+ "version": "0.4.83",
4
4
  "description": "A flexible interactive whiteboard library",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",