microboard-temp 0.4.55 → 0.4.56
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 +9 -29
- package/dist/cjs/index.js +9 -29
- package/dist/cjs/node.js +9 -29
- package/dist/esm/browser.js +9 -29
- package/dist/esm/index.js +9 -29
- package/dist/esm/node.js +9 -29
- package/dist/types/Items/Frame/Frame.d.ts +0 -2
- package/package.json +1 -1
package/dist/cjs/browser.js
CHANGED
|
@@ -40245,26 +40245,6 @@ class Frame2 extends BaseItem {
|
|
|
40245
40245
|
this.board = board;
|
|
40246
40246
|
return this;
|
|
40247
40247
|
}
|
|
40248
|
-
applyAddChild(childId, noWarn = false) {
|
|
40249
|
-
const children = Array.isArray(childId) ? childId : [childId];
|
|
40250
|
-
children.forEach((child) => {
|
|
40251
|
-
if (this.parent !== child && this.getId() !== child) {
|
|
40252
|
-
const foundItem = this.getItemById(child);
|
|
40253
|
-
if (!this.children.includes(child) && foundItem) {
|
|
40254
|
-
this.children.push(child);
|
|
40255
|
-
foundItem.parent = this.getId();
|
|
40256
|
-
this.updateMbr();
|
|
40257
|
-
this.subject.publish(this);
|
|
40258
|
-
} else if (!foundItem && !noWarn) {
|
|
40259
|
-
console.warn(`Could not find child with id ${childId}`);
|
|
40260
|
-
}
|
|
40261
|
-
}
|
|
40262
|
-
});
|
|
40263
|
-
}
|
|
40264
|
-
applyRemoveChild(childId) {
|
|
40265
|
-
this.children = this.children.filter((currChild) => !childId.includes(currChild));
|
|
40266
|
-
this.subject.publish(this);
|
|
40267
|
-
}
|
|
40268
40248
|
getLinkTo() {
|
|
40269
40249
|
return this.linkTo.link;
|
|
40270
40250
|
}
|
|
@@ -40405,7 +40385,7 @@ class Frame2 extends BaseItem {
|
|
|
40405
40385
|
this.transformPath();
|
|
40406
40386
|
}
|
|
40407
40387
|
if (data.children) {
|
|
40408
|
-
this.
|
|
40388
|
+
this.applyAddChildren(data.children);
|
|
40409
40389
|
}
|
|
40410
40390
|
if (data.text) {
|
|
40411
40391
|
this.text.deserialize(data.text);
|
|
@@ -40451,9 +40431,9 @@ class Frame2 extends BaseItem {
|
|
|
40451
40431
|
} else if (op.method === "setFrameType") {
|
|
40452
40432
|
this.applyFrameType(op.shapeType);
|
|
40453
40433
|
} else if (op.method === "addChild") {
|
|
40454
|
-
this.
|
|
40434
|
+
this.applyAddChildren(op.childId);
|
|
40455
40435
|
} else if (op.method === "removeChild") {
|
|
40456
|
-
this.
|
|
40436
|
+
this.applyRemoveChildren(op.childId);
|
|
40457
40437
|
}
|
|
40458
40438
|
break;
|
|
40459
40439
|
case "RichText":
|
|
@@ -40529,10 +40509,10 @@ class Frame2 extends BaseItem {
|
|
|
40529
40509
|
const child = this.board?.items.getById(childId);
|
|
40530
40510
|
if (child) {
|
|
40531
40511
|
if (this.handleNesting(child)) {
|
|
40532
|
-
this.
|
|
40512
|
+
this.applyAddChildren([child.getId()]);
|
|
40533
40513
|
child.parent = this.getId();
|
|
40534
40514
|
} else {
|
|
40535
|
-
this.
|
|
40515
|
+
this.applyRemoveChildren([child.getId()]);
|
|
40536
40516
|
child.parent = "Board";
|
|
40537
40517
|
}
|
|
40538
40518
|
}
|
|
@@ -40541,7 +40521,7 @@ class Frame2 extends BaseItem {
|
|
|
40541
40521
|
this.board.items.getEnclosedOrCrossed(currMbr.left, currMbr.top, currMbr.right, currMbr.bottom).forEach((item) => {
|
|
40542
40522
|
if (item.parent === "Board") {
|
|
40543
40523
|
if (this.handleNesting(item)) {
|
|
40544
|
-
this.
|
|
40524
|
+
this.applyAddChildren([item.getId()]);
|
|
40545
40525
|
item.parent = this.getId();
|
|
40546
40526
|
}
|
|
40547
40527
|
}
|
|
@@ -43958,7 +43938,7 @@ class AddFrame extends BoardTool {
|
|
|
43958
43938
|
child.parent = this.frame.getId();
|
|
43959
43939
|
return child.getId();
|
|
43960
43940
|
});
|
|
43961
|
-
this.frame.
|
|
43941
|
+
this.frame.applyAddChildren(childrenIds);
|
|
43962
43942
|
this.frame.subject.publish(this.frame);
|
|
43963
43943
|
}
|
|
43964
43944
|
applyCanChangeRatio(canChangeRatio) {
|
|
@@ -53708,7 +53688,7 @@ class Board {
|
|
|
53708
53688
|
}
|
|
53709
53689
|
for (const key in createdFrames) {
|
|
53710
53690
|
const { item, itemData } = createdFrames[key];
|
|
53711
|
-
item.
|
|
53691
|
+
item.applyAddChildren(itemData.children);
|
|
53712
53692
|
}
|
|
53713
53693
|
}
|
|
53714
53694
|
deserialize(snapshot) {
|
|
@@ -53744,7 +53724,7 @@ class Board {
|
|
|
53744
53724
|
}
|
|
53745
53725
|
for (const key in createdFrames) {
|
|
53746
53726
|
const { item, itemData } = createdFrames[key];
|
|
53747
|
-
item.
|
|
53727
|
+
item.applyAddChildren(itemData.children);
|
|
53748
53728
|
}
|
|
53749
53729
|
this.events?.log.deserialize(events);
|
|
53750
53730
|
}
|
package/dist/cjs/index.js
CHANGED
|
@@ -40245,26 +40245,6 @@ class Frame2 extends BaseItem {
|
|
|
40245
40245
|
this.board = board;
|
|
40246
40246
|
return this;
|
|
40247
40247
|
}
|
|
40248
|
-
applyAddChild(childId, noWarn = false) {
|
|
40249
|
-
const children = Array.isArray(childId) ? childId : [childId];
|
|
40250
|
-
children.forEach((child) => {
|
|
40251
|
-
if (this.parent !== child && this.getId() !== child) {
|
|
40252
|
-
const foundItem = this.getItemById(child);
|
|
40253
|
-
if (!this.children.includes(child) && foundItem) {
|
|
40254
|
-
this.children.push(child);
|
|
40255
|
-
foundItem.parent = this.getId();
|
|
40256
|
-
this.updateMbr();
|
|
40257
|
-
this.subject.publish(this);
|
|
40258
|
-
} else if (!foundItem && !noWarn) {
|
|
40259
|
-
console.warn(`Could not find child with id ${childId}`);
|
|
40260
|
-
}
|
|
40261
|
-
}
|
|
40262
|
-
});
|
|
40263
|
-
}
|
|
40264
|
-
applyRemoveChild(childId) {
|
|
40265
|
-
this.children = this.children.filter((currChild) => !childId.includes(currChild));
|
|
40266
|
-
this.subject.publish(this);
|
|
40267
|
-
}
|
|
40268
40248
|
getLinkTo() {
|
|
40269
40249
|
return this.linkTo.link;
|
|
40270
40250
|
}
|
|
@@ -40405,7 +40385,7 @@ class Frame2 extends BaseItem {
|
|
|
40405
40385
|
this.transformPath();
|
|
40406
40386
|
}
|
|
40407
40387
|
if (data.children) {
|
|
40408
|
-
this.
|
|
40388
|
+
this.applyAddChildren(data.children);
|
|
40409
40389
|
}
|
|
40410
40390
|
if (data.text) {
|
|
40411
40391
|
this.text.deserialize(data.text);
|
|
@@ -40451,9 +40431,9 @@ class Frame2 extends BaseItem {
|
|
|
40451
40431
|
} else if (op.method === "setFrameType") {
|
|
40452
40432
|
this.applyFrameType(op.shapeType);
|
|
40453
40433
|
} else if (op.method === "addChild") {
|
|
40454
|
-
this.
|
|
40434
|
+
this.applyAddChildren(op.childId);
|
|
40455
40435
|
} else if (op.method === "removeChild") {
|
|
40456
|
-
this.
|
|
40436
|
+
this.applyRemoveChildren(op.childId);
|
|
40457
40437
|
}
|
|
40458
40438
|
break;
|
|
40459
40439
|
case "RichText":
|
|
@@ -40529,10 +40509,10 @@ class Frame2 extends BaseItem {
|
|
|
40529
40509
|
const child = this.board?.items.getById(childId);
|
|
40530
40510
|
if (child) {
|
|
40531
40511
|
if (this.handleNesting(child)) {
|
|
40532
|
-
this.
|
|
40512
|
+
this.applyAddChildren([child.getId()]);
|
|
40533
40513
|
child.parent = this.getId();
|
|
40534
40514
|
} else {
|
|
40535
|
-
this.
|
|
40515
|
+
this.applyRemoveChildren([child.getId()]);
|
|
40536
40516
|
child.parent = "Board";
|
|
40537
40517
|
}
|
|
40538
40518
|
}
|
|
@@ -40541,7 +40521,7 @@ class Frame2 extends BaseItem {
|
|
|
40541
40521
|
this.board.items.getEnclosedOrCrossed(currMbr.left, currMbr.top, currMbr.right, currMbr.bottom).forEach((item) => {
|
|
40542
40522
|
if (item.parent === "Board") {
|
|
40543
40523
|
if (this.handleNesting(item)) {
|
|
40544
|
-
this.
|
|
40524
|
+
this.applyAddChildren([item.getId()]);
|
|
40545
40525
|
item.parent = this.getId();
|
|
40546
40526
|
}
|
|
40547
40527
|
}
|
|
@@ -43958,7 +43938,7 @@ class AddFrame extends BoardTool {
|
|
|
43958
43938
|
child.parent = this.frame.getId();
|
|
43959
43939
|
return child.getId();
|
|
43960
43940
|
});
|
|
43961
|
-
this.frame.
|
|
43941
|
+
this.frame.applyAddChildren(childrenIds);
|
|
43962
43942
|
this.frame.subject.publish(this.frame);
|
|
43963
43943
|
}
|
|
43964
43944
|
applyCanChangeRatio(canChangeRatio) {
|
|
@@ -53708,7 +53688,7 @@ class Board {
|
|
|
53708
53688
|
}
|
|
53709
53689
|
for (const key in createdFrames) {
|
|
53710
53690
|
const { item, itemData } = createdFrames[key];
|
|
53711
|
-
item.
|
|
53691
|
+
item.applyAddChildren(itemData.children);
|
|
53712
53692
|
}
|
|
53713
53693
|
}
|
|
53714
53694
|
deserialize(snapshot) {
|
|
@@ -53744,7 +53724,7 @@ class Board {
|
|
|
53744
53724
|
}
|
|
53745
53725
|
for (const key in createdFrames) {
|
|
53746
53726
|
const { item, itemData } = createdFrames[key];
|
|
53747
|
-
item.
|
|
53727
|
+
item.applyAddChildren(itemData.children);
|
|
53748
53728
|
}
|
|
53749
53729
|
this.events?.log.deserialize(events);
|
|
53750
53730
|
}
|
package/dist/cjs/node.js
CHANGED
|
@@ -42718,26 +42718,6 @@ class Frame2 extends BaseItem {
|
|
|
42718
42718
|
this.board = board;
|
|
42719
42719
|
return this;
|
|
42720
42720
|
}
|
|
42721
|
-
applyAddChild(childId, noWarn = false) {
|
|
42722
|
-
const children = Array.isArray(childId) ? childId : [childId];
|
|
42723
|
-
children.forEach((child) => {
|
|
42724
|
-
if (this.parent !== child && this.getId() !== child) {
|
|
42725
|
-
const foundItem = this.getItemById(child);
|
|
42726
|
-
if (!this.children.includes(child) && foundItem) {
|
|
42727
|
-
this.children.push(child);
|
|
42728
|
-
foundItem.parent = this.getId();
|
|
42729
|
-
this.updateMbr();
|
|
42730
|
-
this.subject.publish(this);
|
|
42731
|
-
} else if (!foundItem && !noWarn) {
|
|
42732
|
-
console.warn(`Could not find child with id ${childId}`);
|
|
42733
|
-
}
|
|
42734
|
-
}
|
|
42735
|
-
});
|
|
42736
|
-
}
|
|
42737
|
-
applyRemoveChild(childId) {
|
|
42738
|
-
this.children = this.children.filter((currChild) => !childId.includes(currChild));
|
|
42739
|
-
this.subject.publish(this);
|
|
42740
|
-
}
|
|
42741
42721
|
getLinkTo() {
|
|
42742
42722
|
return this.linkTo.link;
|
|
42743
42723
|
}
|
|
@@ -42878,7 +42858,7 @@ class Frame2 extends BaseItem {
|
|
|
42878
42858
|
this.transformPath();
|
|
42879
42859
|
}
|
|
42880
42860
|
if (data.children) {
|
|
42881
|
-
this.
|
|
42861
|
+
this.applyAddChildren(data.children);
|
|
42882
42862
|
}
|
|
42883
42863
|
if (data.text) {
|
|
42884
42864
|
this.text.deserialize(data.text);
|
|
@@ -42924,9 +42904,9 @@ class Frame2 extends BaseItem {
|
|
|
42924
42904
|
} else if (op.method === "setFrameType") {
|
|
42925
42905
|
this.applyFrameType(op.shapeType);
|
|
42926
42906
|
} else if (op.method === "addChild") {
|
|
42927
|
-
this.
|
|
42907
|
+
this.applyAddChildren(op.childId);
|
|
42928
42908
|
} else if (op.method === "removeChild") {
|
|
42929
|
-
this.
|
|
42909
|
+
this.applyRemoveChildren(op.childId);
|
|
42930
42910
|
}
|
|
42931
42911
|
break;
|
|
42932
42912
|
case "RichText":
|
|
@@ -43002,10 +42982,10 @@ class Frame2 extends BaseItem {
|
|
|
43002
42982
|
const child = this.board?.items.getById(childId);
|
|
43003
42983
|
if (child) {
|
|
43004
42984
|
if (this.handleNesting(child)) {
|
|
43005
|
-
this.
|
|
42985
|
+
this.applyAddChildren([child.getId()]);
|
|
43006
42986
|
child.parent = this.getId();
|
|
43007
42987
|
} else {
|
|
43008
|
-
this.
|
|
42988
|
+
this.applyRemoveChildren([child.getId()]);
|
|
43009
42989
|
child.parent = "Board";
|
|
43010
42990
|
}
|
|
43011
42991
|
}
|
|
@@ -43014,7 +42994,7 @@ class Frame2 extends BaseItem {
|
|
|
43014
42994
|
this.board.items.getEnclosedOrCrossed(currMbr.left, currMbr.top, currMbr.right, currMbr.bottom).forEach((item) => {
|
|
43015
42995
|
if (item.parent === "Board") {
|
|
43016
42996
|
if (this.handleNesting(item)) {
|
|
43017
|
-
this.
|
|
42997
|
+
this.applyAddChildren([item.getId()]);
|
|
43018
42998
|
item.parent = this.getId();
|
|
43019
42999
|
}
|
|
43020
43000
|
}
|
|
@@ -46431,7 +46411,7 @@ class AddFrame extends BoardTool {
|
|
|
46431
46411
|
child.parent = this.frame.getId();
|
|
46432
46412
|
return child.getId();
|
|
46433
46413
|
});
|
|
46434
|
-
this.frame.
|
|
46414
|
+
this.frame.applyAddChildren(childrenIds);
|
|
46435
46415
|
this.frame.subject.publish(this.frame);
|
|
46436
46416
|
}
|
|
46437
46417
|
applyCanChangeRatio(canChangeRatio) {
|
|
@@ -56181,7 +56161,7 @@ class Board {
|
|
|
56181
56161
|
}
|
|
56182
56162
|
for (const key in createdFrames) {
|
|
56183
56163
|
const { item, itemData } = createdFrames[key];
|
|
56184
|
-
item.
|
|
56164
|
+
item.applyAddChildren(itemData.children);
|
|
56185
56165
|
}
|
|
56186
56166
|
}
|
|
56187
56167
|
deserialize(snapshot) {
|
|
@@ -56217,7 +56197,7 @@ class Board {
|
|
|
56217
56197
|
}
|
|
56218
56198
|
for (const key in createdFrames) {
|
|
56219
56199
|
const { item, itemData } = createdFrames[key];
|
|
56220
|
-
item.
|
|
56200
|
+
item.applyAddChildren(itemData.children);
|
|
56221
56201
|
}
|
|
56222
56202
|
this.events?.log.deserialize(events);
|
|
56223
56203
|
}
|
package/dist/esm/browser.js
CHANGED
|
@@ -40095,26 +40095,6 @@ class Frame2 extends BaseItem {
|
|
|
40095
40095
|
this.board = board;
|
|
40096
40096
|
return this;
|
|
40097
40097
|
}
|
|
40098
|
-
applyAddChild(childId, noWarn = false) {
|
|
40099
|
-
const children = Array.isArray(childId) ? childId : [childId];
|
|
40100
|
-
children.forEach((child) => {
|
|
40101
|
-
if (this.parent !== child && this.getId() !== child) {
|
|
40102
|
-
const foundItem = this.getItemById(child);
|
|
40103
|
-
if (!this.children.includes(child) && foundItem) {
|
|
40104
|
-
this.children.push(child);
|
|
40105
|
-
foundItem.parent = this.getId();
|
|
40106
|
-
this.updateMbr();
|
|
40107
|
-
this.subject.publish(this);
|
|
40108
|
-
} else if (!foundItem && !noWarn) {
|
|
40109
|
-
console.warn(`Could not find child with id ${childId}`);
|
|
40110
|
-
}
|
|
40111
|
-
}
|
|
40112
|
-
});
|
|
40113
|
-
}
|
|
40114
|
-
applyRemoveChild(childId) {
|
|
40115
|
-
this.children = this.children.filter((currChild) => !childId.includes(currChild));
|
|
40116
|
-
this.subject.publish(this);
|
|
40117
|
-
}
|
|
40118
40098
|
getLinkTo() {
|
|
40119
40099
|
return this.linkTo.link;
|
|
40120
40100
|
}
|
|
@@ -40255,7 +40235,7 @@ class Frame2 extends BaseItem {
|
|
|
40255
40235
|
this.transformPath();
|
|
40256
40236
|
}
|
|
40257
40237
|
if (data.children) {
|
|
40258
|
-
this.
|
|
40238
|
+
this.applyAddChildren(data.children);
|
|
40259
40239
|
}
|
|
40260
40240
|
if (data.text) {
|
|
40261
40241
|
this.text.deserialize(data.text);
|
|
@@ -40301,9 +40281,9 @@ class Frame2 extends BaseItem {
|
|
|
40301
40281
|
} else if (op.method === "setFrameType") {
|
|
40302
40282
|
this.applyFrameType(op.shapeType);
|
|
40303
40283
|
} else if (op.method === "addChild") {
|
|
40304
|
-
this.
|
|
40284
|
+
this.applyAddChildren(op.childId);
|
|
40305
40285
|
} else if (op.method === "removeChild") {
|
|
40306
|
-
this.
|
|
40286
|
+
this.applyRemoveChildren(op.childId);
|
|
40307
40287
|
}
|
|
40308
40288
|
break;
|
|
40309
40289
|
case "RichText":
|
|
@@ -40379,10 +40359,10 @@ class Frame2 extends BaseItem {
|
|
|
40379
40359
|
const child = this.board?.items.getById(childId);
|
|
40380
40360
|
if (child) {
|
|
40381
40361
|
if (this.handleNesting(child)) {
|
|
40382
|
-
this.
|
|
40362
|
+
this.applyAddChildren([child.getId()]);
|
|
40383
40363
|
child.parent = this.getId();
|
|
40384
40364
|
} else {
|
|
40385
|
-
this.
|
|
40365
|
+
this.applyRemoveChildren([child.getId()]);
|
|
40386
40366
|
child.parent = "Board";
|
|
40387
40367
|
}
|
|
40388
40368
|
}
|
|
@@ -40391,7 +40371,7 @@ class Frame2 extends BaseItem {
|
|
|
40391
40371
|
this.board.items.getEnclosedOrCrossed(currMbr.left, currMbr.top, currMbr.right, currMbr.bottom).forEach((item) => {
|
|
40392
40372
|
if (item.parent === "Board") {
|
|
40393
40373
|
if (this.handleNesting(item)) {
|
|
40394
|
-
this.
|
|
40374
|
+
this.applyAddChildren([item.getId()]);
|
|
40395
40375
|
item.parent = this.getId();
|
|
40396
40376
|
}
|
|
40397
40377
|
}
|
|
@@ -43808,7 +43788,7 @@ class AddFrame extends BoardTool {
|
|
|
43808
43788
|
child.parent = this.frame.getId();
|
|
43809
43789
|
return child.getId();
|
|
43810
43790
|
});
|
|
43811
|
-
this.frame.
|
|
43791
|
+
this.frame.applyAddChildren(childrenIds);
|
|
43812
43792
|
this.frame.subject.publish(this.frame);
|
|
43813
43793
|
}
|
|
43814
43794
|
applyCanChangeRatio(canChangeRatio) {
|
|
@@ -53558,7 +53538,7 @@ class Board {
|
|
|
53558
53538
|
}
|
|
53559
53539
|
for (const key in createdFrames) {
|
|
53560
53540
|
const { item, itemData } = createdFrames[key];
|
|
53561
|
-
item.
|
|
53541
|
+
item.applyAddChildren(itemData.children);
|
|
53562
53542
|
}
|
|
53563
53543
|
}
|
|
53564
53544
|
deserialize(snapshot) {
|
|
@@ -53594,7 +53574,7 @@ class Board {
|
|
|
53594
53574
|
}
|
|
53595
53575
|
for (const key in createdFrames) {
|
|
53596
53576
|
const { item, itemData } = createdFrames[key];
|
|
53597
|
-
item.
|
|
53577
|
+
item.applyAddChildren(itemData.children);
|
|
53598
53578
|
}
|
|
53599
53579
|
this.events?.log.deserialize(events);
|
|
53600
53580
|
}
|
package/dist/esm/index.js
CHANGED
|
@@ -40088,26 +40088,6 @@ class Frame2 extends BaseItem {
|
|
|
40088
40088
|
this.board = board;
|
|
40089
40089
|
return this;
|
|
40090
40090
|
}
|
|
40091
|
-
applyAddChild(childId, noWarn = false) {
|
|
40092
|
-
const children = Array.isArray(childId) ? childId : [childId];
|
|
40093
|
-
children.forEach((child) => {
|
|
40094
|
-
if (this.parent !== child && this.getId() !== child) {
|
|
40095
|
-
const foundItem = this.getItemById(child);
|
|
40096
|
-
if (!this.children.includes(child) && foundItem) {
|
|
40097
|
-
this.children.push(child);
|
|
40098
|
-
foundItem.parent = this.getId();
|
|
40099
|
-
this.updateMbr();
|
|
40100
|
-
this.subject.publish(this);
|
|
40101
|
-
} else if (!foundItem && !noWarn) {
|
|
40102
|
-
console.warn(`Could not find child with id ${childId}`);
|
|
40103
|
-
}
|
|
40104
|
-
}
|
|
40105
|
-
});
|
|
40106
|
-
}
|
|
40107
|
-
applyRemoveChild(childId) {
|
|
40108
|
-
this.children = this.children.filter((currChild) => !childId.includes(currChild));
|
|
40109
|
-
this.subject.publish(this);
|
|
40110
|
-
}
|
|
40111
40091
|
getLinkTo() {
|
|
40112
40092
|
return this.linkTo.link;
|
|
40113
40093
|
}
|
|
@@ -40248,7 +40228,7 @@ class Frame2 extends BaseItem {
|
|
|
40248
40228
|
this.transformPath();
|
|
40249
40229
|
}
|
|
40250
40230
|
if (data.children) {
|
|
40251
|
-
this.
|
|
40231
|
+
this.applyAddChildren(data.children);
|
|
40252
40232
|
}
|
|
40253
40233
|
if (data.text) {
|
|
40254
40234
|
this.text.deserialize(data.text);
|
|
@@ -40294,9 +40274,9 @@ class Frame2 extends BaseItem {
|
|
|
40294
40274
|
} else if (op.method === "setFrameType") {
|
|
40295
40275
|
this.applyFrameType(op.shapeType);
|
|
40296
40276
|
} else if (op.method === "addChild") {
|
|
40297
|
-
this.
|
|
40277
|
+
this.applyAddChildren(op.childId);
|
|
40298
40278
|
} else if (op.method === "removeChild") {
|
|
40299
|
-
this.
|
|
40279
|
+
this.applyRemoveChildren(op.childId);
|
|
40300
40280
|
}
|
|
40301
40281
|
break;
|
|
40302
40282
|
case "RichText":
|
|
@@ -40372,10 +40352,10 @@ class Frame2 extends BaseItem {
|
|
|
40372
40352
|
const child = this.board?.items.getById(childId);
|
|
40373
40353
|
if (child) {
|
|
40374
40354
|
if (this.handleNesting(child)) {
|
|
40375
|
-
this.
|
|
40355
|
+
this.applyAddChildren([child.getId()]);
|
|
40376
40356
|
child.parent = this.getId();
|
|
40377
40357
|
} else {
|
|
40378
|
-
this.
|
|
40358
|
+
this.applyRemoveChildren([child.getId()]);
|
|
40379
40359
|
child.parent = "Board";
|
|
40380
40360
|
}
|
|
40381
40361
|
}
|
|
@@ -40384,7 +40364,7 @@ class Frame2 extends BaseItem {
|
|
|
40384
40364
|
this.board.items.getEnclosedOrCrossed(currMbr.left, currMbr.top, currMbr.right, currMbr.bottom).forEach((item) => {
|
|
40385
40365
|
if (item.parent === "Board") {
|
|
40386
40366
|
if (this.handleNesting(item)) {
|
|
40387
|
-
this.
|
|
40367
|
+
this.applyAddChildren([item.getId()]);
|
|
40388
40368
|
item.parent = this.getId();
|
|
40389
40369
|
}
|
|
40390
40370
|
}
|
|
@@ -43801,7 +43781,7 @@ class AddFrame extends BoardTool {
|
|
|
43801
43781
|
child.parent = this.frame.getId();
|
|
43802
43782
|
return child.getId();
|
|
43803
43783
|
});
|
|
43804
|
-
this.frame.
|
|
43784
|
+
this.frame.applyAddChildren(childrenIds);
|
|
43805
43785
|
this.frame.subject.publish(this.frame);
|
|
43806
43786
|
}
|
|
43807
43787
|
applyCanChangeRatio(canChangeRatio) {
|
|
@@ -53551,7 +53531,7 @@ class Board {
|
|
|
53551
53531
|
}
|
|
53552
53532
|
for (const key in createdFrames) {
|
|
53553
53533
|
const { item, itemData } = createdFrames[key];
|
|
53554
|
-
item.
|
|
53534
|
+
item.applyAddChildren(itemData.children);
|
|
53555
53535
|
}
|
|
53556
53536
|
}
|
|
53557
53537
|
deserialize(snapshot) {
|
|
@@ -53587,7 +53567,7 @@ class Board {
|
|
|
53587
53567
|
}
|
|
53588
53568
|
for (const key in createdFrames) {
|
|
53589
53569
|
const { item, itemData } = createdFrames[key];
|
|
53590
|
-
item.
|
|
53570
|
+
item.applyAddChildren(itemData.children);
|
|
53591
53571
|
}
|
|
53592
53572
|
this.events?.log.deserialize(events);
|
|
53593
53573
|
}
|
package/dist/esm/node.js
CHANGED
|
@@ -42556,26 +42556,6 @@ class Frame2 extends BaseItem {
|
|
|
42556
42556
|
this.board = board;
|
|
42557
42557
|
return this;
|
|
42558
42558
|
}
|
|
42559
|
-
applyAddChild(childId, noWarn = false) {
|
|
42560
|
-
const children = Array.isArray(childId) ? childId : [childId];
|
|
42561
|
-
children.forEach((child) => {
|
|
42562
|
-
if (this.parent !== child && this.getId() !== child) {
|
|
42563
|
-
const foundItem = this.getItemById(child);
|
|
42564
|
-
if (!this.children.includes(child) && foundItem) {
|
|
42565
|
-
this.children.push(child);
|
|
42566
|
-
foundItem.parent = this.getId();
|
|
42567
|
-
this.updateMbr();
|
|
42568
|
-
this.subject.publish(this);
|
|
42569
|
-
} else if (!foundItem && !noWarn) {
|
|
42570
|
-
console.warn(`Could not find child with id ${childId}`);
|
|
42571
|
-
}
|
|
42572
|
-
}
|
|
42573
|
-
});
|
|
42574
|
-
}
|
|
42575
|
-
applyRemoveChild(childId) {
|
|
42576
|
-
this.children = this.children.filter((currChild) => !childId.includes(currChild));
|
|
42577
|
-
this.subject.publish(this);
|
|
42578
|
-
}
|
|
42579
42559
|
getLinkTo() {
|
|
42580
42560
|
return this.linkTo.link;
|
|
42581
42561
|
}
|
|
@@ -42716,7 +42696,7 @@ class Frame2 extends BaseItem {
|
|
|
42716
42696
|
this.transformPath();
|
|
42717
42697
|
}
|
|
42718
42698
|
if (data.children) {
|
|
42719
|
-
this.
|
|
42699
|
+
this.applyAddChildren(data.children);
|
|
42720
42700
|
}
|
|
42721
42701
|
if (data.text) {
|
|
42722
42702
|
this.text.deserialize(data.text);
|
|
@@ -42762,9 +42742,9 @@ class Frame2 extends BaseItem {
|
|
|
42762
42742
|
} else if (op.method === "setFrameType") {
|
|
42763
42743
|
this.applyFrameType(op.shapeType);
|
|
42764
42744
|
} else if (op.method === "addChild") {
|
|
42765
|
-
this.
|
|
42745
|
+
this.applyAddChildren(op.childId);
|
|
42766
42746
|
} else if (op.method === "removeChild") {
|
|
42767
|
-
this.
|
|
42747
|
+
this.applyRemoveChildren(op.childId);
|
|
42768
42748
|
}
|
|
42769
42749
|
break;
|
|
42770
42750
|
case "RichText":
|
|
@@ -42840,10 +42820,10 @@ class Frame2 extends BaseItem {
|
|
|
42840
42820
|
const child = this.board?.items.getById(childId);
|
|
42841
42821
|
if (child) {
|
|
42842
42822
|
if (this.handleNesting(child)) {
|
|
42843
|
-
this.
|
|
42823
|
+
this.applyAddChildren([child.getId()]);
|
|
42844
42824
|
child.parent = this.getId();
|
|
42845
42825
|
} else {
|
|
42846
|
-
this.
|
|
42826
|
+
this.applyRemoveChildren([child.getId()]);
|
|
42847
42827
|
child.parent = "Board";
|
|
42848
42828
|
}
|
|
42849
42829
|
}
|
|
@@ -42852,7 +42832,7 @@ class Frame2 extends BaseItem {
|
|
|
42852
42832
|
this.board.items.getEnclosedOrCrossed(currMbr.left, currMbr.top, currMbr.right, currMbr.bottom).forEach((item) => {
|
|
42853
42833
|
if (item.parent === "Board") {
|
|
42854
42834
|
if (this.handleNesting(item)) {
|
|
42855
|
-
this.
|
|
42835
|
+
this.applyAddChildren([item.getId()]);
|
|
42856
42836
|
item.parent = this.getId();
|
|
42857
42837
|
}
|
|
42858
42838
|
}
|
|
@@ -46269,7 +46249,7 @@ class AddFrame extends BoardTool {
|
|
|
46269
46249
|
child.parent = this.frame.getId();
|
|
46270
46250
|
return child.getId();
|
|
46271
46251
|
});
|
|
46272
|
-
this.frame.
|
|
46252
|
+
this.frame.applyAddChildren(childrenIds);
|
|
46273
46253
|
this.frame.subject.publish(this.frame);
|
|
46274
46254
|
}
|
|
46275
46255
|
applyCanChangeRatio(canChangeRatio) {
|
|
@@ -56019,7 +55999,7 @@ class Board {
|
|
|
56019
55999
|
}
|
|
56020
56000
|
for (const key in createdFrames) {
|
|
56021
56001
|
const { item, itemData } = createdFrames[key];
|
|
56022
|
-
item.
|
|
56002
|
+
item.applyAddChildren(itemData.children);
|
|
56023
56003
|
}
|
|
56024
56004
|
}
|
|
56025
56005
|
deserialize(snapshot) {
|
|
@@ -56055,7 +56035,7 @@ class Board {
|
|
|
56055
56035
|
}
|
|
56056
56036
|
for (const key in createdFrames) {
|
|
56057
56037
|
const { item, itemData } = createdFrames[key];
|
|
56058
|
-
item.
|
|
56038
|
+
item.applyAddChildren(itemData.children);
|
|
56059
56039
|
}
|
|
56060
56040
|
this.events?.log.deserialize(events);
|
|
56061
56041
|
}
|