microboard-temp 0.4.81 → 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.
- package/dist/cjs/browser.js +13 -13
- package/dist/cjs/index.js +13 -13
- package/dist/cjs/node.js +13 -13
- package/dist/esm/browser.js +13 -13
- package/dist/esm/index.js +13 -13
- package/dist/esm/node.js +13 -13
- package/package.json +1 -1
package/dist/cjs/browser.js
CHANGED
|
@@ -20792,6 +20792,10 @@ class SpatialIndex {
|
|
|
20792
20792
|
if ("index" in item && item.index) {
|
|
20793
20793
|
item.removeChildItems(item.index.list());
|
|
20794
20794
|
}
|
|
20795
|
+
if (item.parent !== "Board") {
|
|
20796
|
+
const parentFrame = this.items.getById(item.parent);
|
|
20797
|
+
parentFrame?.removeChildItems(item);
|
|
20798
|
+
}
|
|
20795
20799
|
this.itemsArray.splice(this.itemsArray.indexOf(item), 1);
|
|
20796
20800
|
this.itemsIndex.remove(item);
|
|
20797
20801
|
this.Mbr = new Mbr;
|
|
@@ -21308,10 +21312,6 @@ class SimpleSpatialIndex {
|
|
|
21308
21312
|
if ("index" in item && item.index) {
|
|
21309
21313
|
item.removeChildItems(item.index.list());
|
|
21310
21314
|
}
|
|
21311
|
-
if (item.parent !== "Board") {
|
|
21312
|
-
const parentFrame = this.items.getById(item.parent);
|
|
21313
|
-
parentFrame?.removeChildItems(item);
|
|
21314
|
-
}
|
|
21315
21315
|
this.itemsArray.splice(this.itemsArray.indexOf(item), 1);
|
|
21316
21316
|
this.Mbr = new Mbr;
|
|
21317
21317
|
this.itemsArray.forEach((item2) => this.Mbr.combine([item2.getMbr()]));
|
|
@@ -21571,8 +21571,8 @@ class BaseItem extends Mbr {
|
|
|
21571
21571
|
const foundItem = this.board.items.getById(childId);
|
|
21572
21572
|
if (this.parent !== childId && this.getId() !== childId) {
|
|
21573
21573
|
if (!this.index?.getById(childId) && foundItem) {
|
|
21574
|
-
foundItem.parent = this.getId();
|
|
21575
21574
|
this.board.items.index.remove(foundItem);
|
|
21575
|
+
foundItem.parent = this.getId();
|
|
21576
21576
|
this.index?.insert(foundItem);
|
|
21577
21577
|
}
|
|
21578
21578
|
}
|
|
@@ -21588,8 +21588,8 @@ class BaseItem extends Mbr {
|
|
|
21588
21588
|
const foundItem = this.index?.getById(childId);
|
|
21589
21589
|
if (this.parent !== childId && this.getId() !== childId) {
|
|
21590
21590
|
if (foundItem) {
|
|
21591
|
-
foundItem.parent = "Board";
|
|
21592
21591
|
this.index?.remove(foundItem);
|
|
21592
|
+
foundItem.parent = "Board";
|
|
21593
21593
|
this.board.items.index.insert(foundItem);
|
|
21594
21594
|
}
|
|
21595
21595
|
}
|
|
@@ -47949,8 +47949,8 @@ class Deck extends BaseItem {
|
|
|
47949
47949
|
x: this.left + (this.index?.list().length || 0) * 2,
|
|
47950
47950
|
y: this.top
|
|
47951
47951
|
});
|
|
47952
|
-
foundItem.parent = this.getId();
|
|
47953
47952
|
this.board.items.index.remove(foundItem);
|
|
47953
|
+
foundItem.parent = this.getId();
|
|
47954
47954
|
this.index?.insert(foundItem);
|
|
47955
47955
|
}
|
|
47956
47956
|
}
|
|
@@ -47973,8 +47973,8 @@ class Deck extends BaseItem {
|
|
|
47973
47973
|
x: this.left,
|
|
47974
47974
|
y: this.top - this.getHeight() / 2
|
|
47975
47975
|
});
|
|
47976
|
-
foundItem.parent = "Board";
|
|
47977
47976
|
this.index?.remove(foundItem);
|
|
47977
|
+
foundItem.parent = "Board";
|
|
47978
47978
|
this.board.items.index.insert(foundItem);
|
|
47979
47979
|
}
|
|
47980
47980
|
}
|
|
@@ -53895,15 +53895,15 @@ class Board {
|
|
|
53895
53895
|
const { events, items } = snapshot;
|
|
53896
53896
|
this.index.clear();
|
|
53897
53897
|
const createdConnectors = {};
|
|
53898
|
-
const
|
|
53898
|
+
const createdGroups = {};
|
|
53899
53899
|
if (Array.isArray(items)) {
|
|
53900
53900
|
for (const itemData of items) {
|
|
53901
53901
|
const item = this.createItem(itemData.id, itemData);
|
|
53902
53902
|
if (item instanceof Connector2) {
|
|
53903
53903
|
createdConnectors[itemData.id] = { item, itemData };
|
|
53904
53904
|
}
|
|
53905
|
-
if (item
|
|
53906
|
-
|
|
53905
|
+
if ("index" in item && item.index) {
|
|
53906
|
+
createdGroups[item.getId()] = { item, itemData };
|
|
53907
53907
|
}
|
|
53908
53908
|
this.index.insert(item);
|
|
53909
53909
|
}
|
|
@@ -53922,8 +53922,8 @@ class Board {
|
|
|
53922
53922
|
item.applyStartPoint(itemData.startPoint);
|
|
53923
53923
|
item.applyEndPoint(itemData.endPoint);
|
|
53924
53924
|
}
|
|
53925
|
-
for (const key in
|
|
53926
|
-
const { item, itemData } =
|
|
53925
|
+
for (const key in createdGroups) {
|
|
53926
|
+
const { item, itemData } = createdGroups[key];
|
|
53927
53927
|
item.applyAddChildren(itemData.children);
|
|
53928
53928
|
}
|
|
53929
53929
|
this.events?.log.deserialize(events);
|
package/dist/cjs/index.js
CHANGED
|
@@ -20792,6 +20792,10 @@ class SpatialIndex {
|
|
|
20792
20792
|
if ("index" in item && item.index) {
|
|
20793
20793
|
item.removeChildItems(item.index.list());
|
|
20794
20794
|
}
|
|
20795
|
+
if (item.parent !== "Board") {
|
|
20796
|
+
const parentFrame = this.items.getById(item.parent);
|
|
20797
|
+
parentFrame?.removeChildItems(item);
|
|
20798
|
+
}
|
|
20795
20799
|
this.itemsArray.splice(this.itemsArray.indexOf(item), 1);
|
|
20796
20800
|
this.itemsIndex.remove(item);
|
|
20797
20801
|
this.Mbr = new Mbr;
|
|
@@ -21308,10 +21312,6 @@ class SimpleSpatialIndex {
|
|
|
21308
21312
|
if ("index" in item && item.index) {
|
|
21309
21313
|
item.removeChildItems(item.index.list());
|
|
21310
21314
|
}
|
|
21311
|
-
if (item.parent !== "Board") {
|
|
21312
|
-
const parentFrame = this.items.getById(item.parent);
|
|
21313
|
-
parentFrame?.removeChildItems(item);
|
|
21314
|
-
}
|
|
21315
21315
|
this.itemsArray.splice(this.itemsArray.indexOf(item), 1);
|
|
21316
21316
|
this.Mbr = new Mbr;
|
|
21317
21317
|
this.itemsArray.forEach((item2) => this.Mbr.combine([item2.getMbr()]));
|
|
@@ -21571,8 +21571,8 @@ class BaseItem extends Mbr {
|
|
|
21571
21571
|
const foundItem = this.board.items.getById(childId);
|
|
21572
21572
|
if (this.parent !== childId && this.getId() !== childId) {
|
|
21573
21573
|
if (!this.index?.getById(childId) && foundItem) {
|
|
21574
|
-
foundItem.parent = this.getId();
|
|
21575
21574
|
this.board.items.index.remove(foundItem);
|
|
21575
|
+
foundItem.parent = this.getId();
|
|
21576
21576
|
this.index?.insert(foundItem);
|
|
21577
21577
|
}
|
|
21578
21578
|
}
|
|
@@ -21588,8 +21588,8 @@ class BaseItem extends Mbr {
|
|
|
21588
21588
|
const foundItem = this.index?.getById(childId);
|
|
21589
21589
|
if (this.parent !== childId && this.getId() !== childId) {
|
|
21590
21590
|
if (foundItem) {
|
|
21591
|
-
foundItem.parent = "Board";
|
|
21592
21591
|
this.index?.remove(foundItem);
|
|
21592
|
+
foundItem.parent = "Board";
|
|
21593
21593
|
this.board.items.index.insert(foundItem);
|
|
21594
21594
|
}
|
|
21595
21595
|
}
|
|
@@ -47949,8 +47949,8 @@ class Deck extends BaseItem {
|
|
|
47949
47949
|
x: this.left + (this.index?.list().length || 0) * 2,
|
|
47950
47950
|
y: this.top
|
|
47951
47951
|
});
|
|
47952
|
-
foundItem.parent = this.getId();
|
|
47953
47952
|
this.board.items.index.remove(foundItem);
|
|
47953
|
+
foundItem.parent = this.getId();
|
|
47954
47954
|
this.index?.insert(foundItem);
|
|
47955
47955
|
}
|
|
47956
47956
|
}
|
|
@@ -47973,8 +47973,8 @@ class Deck extends BaseItem {
|
|
|
47973
47973
|
x: this.left,
|
|
47974
47974
|
y: this.top - this.getHeight() / 2
|
|
47975
47975
|
});
|
|
47976
|
-
foundItem.parent = "Board";
|
|
47977
47976
|
this.index?.remove(foundItem);
|
|
47977
|
+
foundItem.parent = "Board";
|
|
47978
47978
|
this.board.items.index.insert(foundItem);
|
|
47979
47979
|
}
|
|
47980
47980
|
}
|
|
@@ -53895,15 +53895,15 @@ class Board {
|
|
|
53895
53895
|
const { events, items } = snapshot;
|
|
53896
53896
|
this.index.clear();
|
|
53897
53897
|
const createdConnectors = {};
|
|
53898
|
-
const
|
|
53898
|
+
const createdGroups = {};
|
|
53899
53899
|
if (Array.isArray(items)) {
|
|
53900
53900
|
for (const itemData of items) {
|
|
53901
53901
|
const item = this.createItem(itemData.id, itemData);
|
|
53902
53902
|
if (item instanceof Connector2) {
|
|
53903
53903
|
createdConnectors[itemData.id] = { item, itemData };
|
|
53904
53904
|
}
|
|
53905
|
-
if (item
|
|
53906
|
-
|
|
53905
|
+
if ("index" in item && item.index) {
|
|
53906
|
+
createdGroups[item.getId()] = { item, itemData };
|
|
53907
53907
|
}
|
|
53908
53908
|
this.index.insert(item);
|
|
53909
53909
|
}
|
|
@@ -53922,8 +53922,8 @@ class Board {
|
|
|
53922
53922
|
item.applyStartPoint(itemData.startPoint);
|
|
53923
53923
|
item.applyEndPoint(itemData.endPoint);
|
|
53924
53924
|
}
|
|
53925
|
-
for (const key in
|
|
53926
|
-
const { item, itemData } =
|
|
53925
|
+
for (const key in createdGroups) {
|
|
53926
|
+
const { item, itemData } = createdGroups[key];
|
|
53927
53927
|
item.applyAddChildren(itemData.children);
|
|
53928
53928
|
}
|
|
53929
53929
|
this.events?.log.deserialize(events);
|
package/dist/cjs/node.js
CHANGED
|
@@ -23264,6 +23264,10 @@ class SpatialIndex {
|
|
|
23264
23264
|
if ("index" in item && item.index) {
|
|
23265
23265
|
item.removeChildItems(item.index.list());
|
|
23266
23266
|
}
|
|
23267
|
+
if (item.parent !== "Board") {
|
|
23268
|
+
const parentFrame = this.items.getById(item.parent);
|
|
23269
|
+
parentFrame?.removeChildItems(item);
|
|
23270
|
+
}
|
|
23267
23271
|
this.itemsArray.splice(this.itemsArray.indexOf(item), 1);
|
|
23268
23272
|
this.itemsIndex.remove(item);
|
|
23269
23273
|
this.Mbr = new Mbr;
|
|
@@ -23780,10 +23784,6 @@ class SimpleSpatialIndex {
|
|
|
23780
23784
|
if ("index" in item && item.index) {
|
|
23781
23785
|
item.removeChildItems(item.index.list());
|
|
23782
23786
|
}
|
|
23783
|
-
if (item.parent !== "Board") {
|
|
23784
|
-
const parentFrame = this.items.getById(item.parent);
|
|
23785
|
-
parentFrame?.removeChildItems(item);
|
|
23786
|
-
}
|
|
23787
23787
|
this.itemsArray.splice(this.itemsArray.indexOf(item), 1);
|
|
23788
23788
|
this.Mbr = new Mbr;
|
|
23789
23789
|
this.itemsArray.forEach((item2) => this.Mbr.combine([item2.getMbr()]));
|
|
@@ -24043,8 +24043,8 @@ class BaseItem extends Mbr {
|
|
|
24043
24043
|
const foundItem = this.board.items.getById(childId);
|
|
24044
24044
|
if (this.parent !== childId && this.getId() !== childId) {
|
|
24045
24045
|
if (!this.index?.getById(childId) && foundItem) {
|
|
24046
|
-
foundItem.parent = this.getId();
|
|
24047
24046
|
this.board.items.index.remove(foundItem);
|
|
24047
|
+
foundItem.parent = this.getId();
|
|
24048
24048
|
this.index?.insert(foundItem);
|
|
24049
24049
|
}
|
|
24050
24050
|
}
|
|
@@ -24060,8 +24060,8 @@ class BaseItem extends Mbr {
|
|
|
24060
24060
|
const foundItem = this.index?.getById(childId);
|
|
24061
24061
|
if (this.parent !== childId && this.getId() !== childId) {
|
|
24062
24062
|
if (foundItem) {
|
|
24063
|
-
foundItem.parent = "Board";
|
|
24064
24063
|
this.index?.remove(foundItem);
|
|
24064
|
+
foundItem.parent = "Board";
|
|
24065
24065
|
this.board.items.index.insert(foundItem);
|
|
24066
24066
|
}
|
|
24067
24067
|
}
|
|
@@ -50422,8 +50422,8 @@ class Deck extends BaseItem {
|
|
|
50422
50422
|
x: this.left + (this.index?.list().length || 0) * 2,
|
|
50423
50423
|
y: this.top
|
|
50424
50424
|
});
|
|
50425
|
-
foundItem.parent = this.getId();
|
|
50426
50425
|
this.board.items.index.remove(foundItem);
|
|
50426
|
+
foundItem.parent = this.getId();
|
|
50427
50427
|
this.index?.insert(foundItem);
|
|
50428
50428
|
}
|
|
50429
50429
|
}
|
|
@@ -50446,8 +50446,8 @@ class Deck extends BaseItem {
|
|
|
50446
50446
|
x: this.left,
|
|
50447
50447
|
y: this.top - this.getHeight() / 2
|
|
50448
50448
|
});
|
|
50449
|
-
foundItem.parent = "Board";
|
|
50450
50449
|
this.index?.remove(foundItem);
|
|
50450
|
+
foundItem.parent = "Board";
|
|
50451
50451
|
this.board.items.index.insert(foundItem);
|
|
50452
50452
|
}
|
|
50453
50453
|
}
|
|
@@ -56368,15 +56368,15 @@ class Board {
|
|
|
56368
56368
|
const { events, items } = snapshot;
|
|
56369
56369
|
this.index.clear();
|
|
56370
56370
|
const createdConnectors = {};
|
|
56371
|
-
const
|
|
56371
|
+
const createdGroups = {};
|
|
56372
56372
|
if (Array.isArray(items)) {
|
|
56373
56373
|
for (const itemData of items) {
|
|
56374
56374
|
const item = this.createItem(itemData.id, itemData);
|
|
56375
56375
|
if (item instanceof Connector2) {
|
|
56376
56376
|
createdConnectors[itemData.id] = { item, itemData };
|
|
56377
56377
|
}
|
|
56378
|
-
if (item
|
|
56379
|
-
|
|
56378
|
+
if ("index" in item && item.index) {
|
|
56379
|
+
createdGroups[item.getId()] = { item, itemData };
|
|
56380
56380
|
}
|
|
56381
56381
|
this.index.insert(item);
|
|
56382
56382
|
}
|
|
@@ -56395,8 +56395,8 @@ class Board {
|
|
|
56395
56395
|
item.applyStartPoint(itemData.startPoint);
|
|
56396
56396
|
item.applyEndPoint(itemData.endPoint);
|
|
56397
56397
|
}
|
|
56398
|
-
for (const key in
|
|
56399
|
-
const { item, itemData } =
|
|
56398
|
+
for (const key in createdGroups) {
|
|
56399
|
+
const { item, itemData } = createdGroups[key];
|
|
56400
56400
|
item.applyAddChildren(itemData.children);
|
|
56401
56401
|
}
|
|
56402
56402
|
this.events?.log.deserialize(events);
|
package/dist/esm/browser.js
CHANGED
|
@@ -20641,6 +20641,10 @@ class SpatialIndex {
|
|
|
20641
20641
|
if ("index" in item && item.index) {
|
|
20642
20642
|
item.removeChildItems(item.index.list());
|
|
20643
20643
|
}
|
|
20644
|
+
if (item.parent !== "Board") {
|
|
20645
|
+
const parentFrame = this.items.getById(item.parent);
|
|
20646
|
+
parentFrame?.removeChildItems(item);
|
|
20647
|
+
}
|
|
20644
20648
|
this.itemsArray.splice(this.itemsArray.indexOf(item), 1);
|
|
20645
20649
|
this.itemsIndex.remove(item);
|
|
20646
20650
|
this.Mbr = new Mbr;
|
|
@@ -21157,10 +21161,6 @@ class SimpleSpatialIndex {
|
|
|
21157
21161
|
if ("index" in item && item.index) {
|
|
21158
21162
|
item.removeChildItems(item.index.list());
|
|
21159
21163
|
}
|
|
21160
|
-
if (item.parent !== "Board") {
|
|
21161
|
-
const parentFrame = this.items.getById(item.parent);
|
|
21162
|
-
parentFrame?.removeChildItems(item);
|
|
21163
|
-
}
|
|
21164
21164
|
this.itemsArray.splice(this.itemsArray.indexOf(item), 1);
|
|
21165
21165
|
this.Mbr = new Mbr;
|
|
21166
21166
|
this.itemsArray.forEach((item2) => this.Mbr.combine([item2.getMbr()]));
|
|
@@ -21420,8 +21420,8 @@ class BaseItem extends Mbr {
|
|
|
21420
21420
|
const foundItem = this.board.items.getById(childId);
|
|
21421
21421
|
if (this.parent !== childId && this.getId() !== childId) {
|
|
21422
21422
|
if (!this.index?.getById(childId) && foundItem) {
|
|
21423
|
-
foundItem.parent = this.getId();
|
|
21424
21423
|
this.board.items.index.remove(foundItem);
|
|
21424
|
+
foundItem.parent = this.getId();
|
|
21425
21425
|
this.index?.insert(foundItem);
|
|
21426
21426
|
}
|
|
21427
21427
|
}
|
|
@@ -21437,8 +21437,8 @@ class BaseItem extends Mbr {
|
|
|
21437
21437
|
const foundItem = this.index?.getById(childId);
|
|
21438
21438
|
if (this.parent !== childId && this.getId() !== childId) {
|
|
21439
21439
|
if (foundItem) {
|
|
21440
|
-
foundItem.parent = "Board";
|
|
21441
21440
|
this.index?.remove(foundItem);
|
|
21441
|
+
foundItem.parent = "Board";
|
|
21442
21442
|
this.board.items.index.insert(foundItem);
|
|
21443
21443
|
}
|
|
21444
21444
|
}
|
|
@@ -47798,8 +47798,8 @@ class Deck extends BaseItem {
|
|
|
47798
47798
|
x: this.left + (this.index?.list().length || 0) * 2,
|
|
47799
47799
|
y: this.top
|
|
47800
47800
|
});
|
|
47801
|
-
foundItem.parent = this.getId();
|
|
47802
47801
|
this.board.items.index.remove(foundItem);
|
|
47802
|
+
foundItem.parent = this.getId();
|
|
47803
47803
|
this.index?.insert(foundItem);
|
|
47804
47804
|
}
|
|
47805
47805
|
}
|
|
@@ -47822,8 +47822,8 @@ class Deck extends BaseItem {
|
|
|
47822
47822
|
x: this.left,
|
|
47823
47823
|
y: this.top - this.getHeight() / 2
|
|
47824
47824
|
});
|
|
47825
|
-
foundItem.parent = "Board";
|
|
47826
47825
|
this.index?.remove(foundItem);
|
|
47826
|
+
foundItem.parent = "Board";
|
|
47827
47827
|
this.board.items.index.insert(foundItem);
|
|
47828
47828
|
}
|
|
47829
47829
|
}
|
|
@@ -53744,15 +53744,15 @@ class Board {
|
|
|
53744
53744
|
const { events, items } = snapshot;
|
|
53745
53745
|
this.index.clear();
|
|
53746
53746
|
const createdConnectors = {};
|
|
53747
|
-
const
|
|
53747
|
+
const createdGroups = {};
|
|
53748
53748
|
if (Array.isArray(items)) {
|
|
53749
53749
|
for (const itemData of items) {
|
|
53750
53750
|
const item = this.createItem(itemData.id, itemData);
|
|
53751
53751
|
if (item instanceof Connector2) {
|
|
53752
53752
|
createdConnectors[itemData.id] = { item, itemData };
|
|
53753
53753
|
}
|
|
53754
|
-
if (item
|
|
53755
|
-
|
|
53754
|
+
if ("index" in item && item.index) {
|
|
53755
|
+
createdGroups[item.getId()] = { item, itemData };
|
|
53756
53756
|
}
|
|
53757
53757
|
this.index.insert(item);
|
|
53758
53758
|
}
|
|
@@ -53771,8 +53771,8 @@ class Board {
|
|
|
53771
53771
|
item.applyStartPoint(itemData.startPoint);
|
|
53772
53772
|
item.applyEndPoint(itemData.endPoint);
|
|
53773
53773
|
}
|
|
53774
|
-
for (const key in
|
|
53775
|
-
const { item, itemData } =
|
|
53774
|
+
for (const key in createdGroups) {
|
|
53775
|
+
const { item, itemData } = createdGroups[key];
|
|
53776
53776
|
item.applyAddChildren(itemData.children);
|
|
53777
53777
|
}
|
|
53778
53778
|
this.events?.log.deserialize(events);
|
package/dist/esm/index.js
CHANGED
|
@@ -20634,6 +20634,10 @@ class SpatialIndex {
|
|
|
20634
20634
|
if ("index" in item && item.index) {
|
|
20635
20635
|
item.removeChildItems(item.index.list());
|
|
20636
20636
|
}
|
|
20637
|
+
if (item.parent !== "Board") {
|
|
20638
|
+
const parentFrame = this.items.getById(item.parent);
|
|
20639
|
+
parentFrame?.removeChildItems(item);
|
|
20640
|
+
}
|
|
20637
20641
|
this.itemsArray.splice(this.itemsArray.indexOf(item), 1);
|
|
20638
20642
|
this.itemsIndex.remove(item);
|
|
20639
20643
|
this.Mbr = new Mbr;
|
|
@@ -21150,10 +21154,6 @@ class SimpleSpatialIndex {
|
|
|
21150
21154
|
if ("index" in item && item.index) {
|
|
21151
21155
|
item.removeChildItems(item.index.list());
|
|
21152
21156
|
}
|
|
21153
|
-
if (item.parent !== "Board") {
|
|
21154
|
-
const parentFrame = this.items.getById(item.parent);
|
|
21155
|
-
parentFrame?.removeChildItems(item);
|
|
21156
|
-
}
|
|
21157
21157
|
this.itemsArray.splice(this.itemsArray.indexOf(item), 1);
|
|
21158
21158
|
this.Mbr = new Mbr;
|
|
21159
21159
|
this.itemsArray.forEach((item2) => this.Mbr.combine([item2.getMbr()]));
|
|
@@ -21413,8 +21413,8 @@ class BaseItem extends Mbr {
|
|
|
21413
21413
|
const foundItem = this.board.items.getById(childId);
|
|
21414
21414
|
if (this.parent !== childId && this.getId() !== childId) {
|
|
21415
21415
|
if (!this.index?.getById(childId) && foundItem) {
|
|
21416
|
-
foundItem.parent = this.getId();
|
|
21417
21416
|
this.board.items.index.remove(foundItem);
|
|
21417
|
+
foundItem.parent = this.getId();
|
|
21418
21418
|
this.index?.insert(foundItem);
|
|
21419
21419
|
}
|
|
21420
21420
|
}
|
|
@@ -21430,8 +21430,8 @@ class BaseItem extends Mbr {
|
|
|
21430
21430
|
const foundItem = this.index?.getById(childId);
|
|
21431
21431
|
if (this.parent !== childId && this.getId() !== childId) {
|
|
21432
21432
|
if (foundItem) {
|
|
21433
|
-
foundItem.parent = "Board";
|
|
21434
21433
|
this.index?.remove(foundItem);
|
|
21434
|
+
foundItem.parent = "Board";
|
|
21435
21435
|
this.board.items.index.insert(foundItem);
|
|
21436
21436
|
}
|
|
21437
21437
|
}
|
|
@@ -47791,8 +47791,8 @@ class Deck extends BaseItem {
|
|
|
47791
47791
|
x: this.left + (this.index?.list().length || 0) * 2,
|
|
47792
47792
|
y: this.top
|
|
47793
47793
|
});
|
|
47794
|
-
foundItem.parent = this.getId();
|
|
47795
47794
|
this.board.items.index.remove(foundItem);
|
|
47795
|
+
foundItem.parent = this.getId();
|
|
47796
47796
|
this.index?.insert(foundItem);
|
|
47797
47797
|
}
|
|
47798
47798
|
}
|
|
@@ -47815,8 +47815,8 @@ class Deck extends BaseItem {
|
|
|
47815
47815
|
x: this.left,
|
|
47816
47816
|
y: this.top - this.getHeight() / 2
|
|
47817
47817
|
});
|
|
47818
|
-
foundItem.parent = "Board";
|
|
47819
47818
|
this.index?.remove(foundItem);
|
|
47819
|
+
foundItem.parent = "Board";
|
|
47820
47820
|
this.board.items.index.insert(foundItem);
|
|
47821
47821
|
}
|
|
47822
47822
|
}
|
|
@@ -53737,15 +53737,15 @@ class Board {
|
|
|
53737
53737
|
const { events, items } = snapshot;
|
|
53738
53738
|
this.index.clear();
|
|
53739
53739
|
const createdConnectors = {};
|
|
53740
|
-
const
|
|
53740
|
+
const createdGroups = {};
|
|
53741
53741
|
if (Array.isArray(items)) {
|
|
53742
53742
|
for (const itemData of items) {
|
|
53743
53743
|
const item = this.createItem(itemData.id, itemData);
|
|
53744
53744
|
if (item instanceof Connector2) {
|
|
53745
53745
|
createdConnectors[itemData.id] = { item, itemData };
|
|
53746
53746
|
}
|
|
53747
|
-
if (item
|
|
53748
|
-
|
|
53747
|
+
if ("index" in item && item.index) {
|
|
53748
|
+
createdGroups[item.getId()] = { item, itemData };
|
|
53749
53749
|
}
|
|
53750
53750
|
this.index.insert(item);
|
|
53751
53751
|
}
|
|
@@ -53764,8 +53764,8 @@ class Board {
|
|
|
53764
53764
|
item.applyStartPoint(itemData.startPoint);
|
|
53765
53765
|
item.applyEndPoint(itemData.endPoint);
|
|
53766
53766
|
}
|
|
53767
|
-
for (const key in
|
|
53768
|
-
const { item, itemData } =
|
|
53767
|
+
for (const key in createdGroups) {
|
|
53768
|
+
const { item, itemData } = createdGroups[key];
|
|
53769
53769
|
item.applyAddChildren(itemData.children);
|
|
53770
53770
|
}
|
|
53771
53771
|
this.events?.log.deserialize(events);
|
package/dist/esm/node.js
CHANGED
|
@@ -23101,6 +23101,10 @@ class SpatialIndex {
|
|
|
23101
23101
|
if ("index" in item && item.index) {
|
|
23102
23102
|
item.removeChildItems(item.index.list());
|
|
23103
23103
|
}
|
|
23104
|
+
if (item.parent !== "Board") {
|
|
23105
|
+
const parentFrame = this.items.getById(item.parent);
|
|
23106
|
+
parentFrame?.removeChildItems(item);
|
|
23107
|
+
}
|
|
23104
23108
|
this.itemsArray.splice(this.itemsArray.indexOf(item), 1);
|
|
23105
23109
|
this.itemsIndex.remove(item);
|
|
23106
23110
|
this.Mbr = new Mbr;
|
|
@@ -23617,10 +23621,6 @@ class SimpleSpatialIndex {
|
|
|
23617
23621
|
if ("index" in item && item.index) {
|
|
23618
23622
|
item.removeChildItems(item.index.list());
|
|
23619
23623
|
}
|
|
23620
|
-
if (item.parent !== "Board") {
|
|
23621
|
-
const parentFrame = this.items.getById(item.parent);
|
|
23622
|
-
parentFrame?.removeChildItems(item);
|
|
23623
|
-
}
|
|
23624
23624
|
this.itemsArray.splice(this.itemsArray.indexOf(item), 1);
|
|
23625
23625
|
this.Mbr = new Mbr;
|
|
23626
23626
|
this.itemsArray.forEach((item2) => this.Mbr.combine([item2.getMbr()]));
|
|
@@ -23880,8 +23880,8 @@ class BaseItem extends Mbr {
|
|
|
23880
23880
|
const foundItem = this.board.items.getById(childId);
|
|
23881
23881
|
if (this.parent !== childId && this.getId() !== childId) {
|
|
23882
23882
|
if (!this.index?.getById(childId) && foundItem) {
|
|
23883
|
-
foundItem.parent = this.getId();
|
|
23884
23883
|
this.board.items.index.remove(foundItem);
|
|
23884
|
+
foundItem.parent = this.getId();
|
|
23885
23885
|
this.index?.insert(foundItem);
|
|
23886
23886
|
}
|
|
23887
23887
|
}
|
|
@@ -23897,8 +23897,8 @@ class BaseItem extends Mbr {
|
|
|
23897
23897
|
const foundItem = this.index?.getById(childId);
|
|
23898
23898
|
if (this.parent !== childId && this.getId() !== childId) {
|
|
23899
23899
|
if (foundItem) {
|
|
23900
|
-
foundItem.parent = "Board";
|
|
23901
23900
|
this.index?.remove(foundItem);
|
|
23901
|
+
foundItem.parent = "Board";
|
|
23902
23902
|
this.board.items.index.insert(foundItem);
|
|
23903
23903
|
}
|
|
23904
23904
|
}
|
|
@@ -50259,8 +50259,8 @@ class Deck extends BaseItem {
|
|
|
50259
50259
|
x: this.left + (this.index?.list().length || 0) * 2,
|
|
50260
50260
|
y: this.top
|
|
50261
50261
|
});
|
|
50262
|
-
foundItem.parent = this.getId();
|
|
50263
50262
|
this.board.items.index.remove(foundItem);
|
|
50263
|
+
foundItem.parent = this.getId();
|
|
50264
50264
|
this.index?.insert(foundItem);
|
|
50265
50265
|
}
|
|
50266
50266
|
}
|
|
@@ -50283,8 +50283,8 @@ class Deck extends BaseItem {
|
|
|
50283
50283
|
x: this.left,
|
|
50284
50284
|
y: this.top - this.getHeight() / 2
|
|
50285
50285
|
});
|
|
50286
|
-
foundItem.parent = "Board";
|
|
50287
50286
|
this.index?.remove(foundItem);
|
|
50287
|
+
foundItem.parent = "Board";
|
|
50288
50288
|
this.board.items.index.insert(foundItem);
|
|
50289
50289
|
}
|
|
50290
50290
|
}
|
|
@@ -56205,15 +56205,15 @@ class Board {
|
|
|
56205
56205
|
const { events, items } = snapshot;
|
|
56206
56206
|
this.index.clear();
|
|
56207
56207
|
const createdConnectors = {};
|
|
56208
|
-
const
|
|
56208
|
+
const createdGroups = {};
|
|
56209
56209
|
if (Array.isArray(items)) {
|
|
56210
56210
|
for (const itemData of items) {
|
|
56211
56211
|
const item = this.createItem(itemData.id, itemData);
|
|
56212
56212
|
if (item instanceof Connector2) {
|
|
56213
56213
|
createdConnectors[itemData.id] = { item, itemData };
|
|
56214
56214
|
}
|
|
56215
|
-
if (item
|
|
56216
|
-
|
|
56215
|
+
if ("index" in item && item.index) {
|
|
56216
|
+
createdGroups[item.getId()] = { item, itemData };
|
|
56217
56217
|
}
|
|
56218
56218
|
this.index.insert(item);
|
|
56219
56219
|
}
|
|
@@ -56232,8 +56232,8 @@ class Board {
|
|
|
56232
56232
|
item.applyStartPoint(itemData.startPoint);
|
|
56233
56233
|
item.applyEndPoint(itemData.endPoint);
|
|
56234
56234
|
}
|
|
56235
|
-
for (const key in
|
|
56236
|
-
const { item, itemData } =
|
|
56235
|
+
for (const key in createdGroups) {
|
|
56236
|
+
const { item, itemData } = createdGroups[key];
|
|
56237
56237
|
item.applyAddChildren(itemData.children);
|
|
56238
56238
|
}
|
|
56239
56239
|
this.events?.log.deserialize(events);
|