microboard-temp 0.13.11 → 0.13.13
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 +35 -17
- package/dist/cjs/index.js +35 -17
- package/dist/cjs/node.js +35 -17
- package/dist/esm/browser.js +35 -17
- package/dist/esm/index.js +35 -17
- package/dist/esm/node.js +35 -17
- package/dist/types/Items/BaseItem/BaseItemOperation.d.ts +1 -1
- package/dist/types/Items/Group/GroupOperation.d.ts +17 -1
- package/package.json +1 -1
package/dist/cjs/browser.js
CHANGED
|
@@ -19533,7 +19533,7 @@ class GroupCommand {
|
|
|
19533
19533
|
const operation = {
|
|
19534
19534
|
...this.operation,
|
|
19535
19535
|
method: "removeChild",
|
|
19536
|
-
childId:
|
|
19536
|
+
childId: this.operation.childId
|
|
19537
19537
|
};
|
|
19538
19538
|
return {
|
|
19539
19539
|
item: group2,
|
|
@@ -19547,7 +19547,33 @@ class GroupCommand {
|
|
|
19547
19547
|
const operation = {
|
|
19548
19548
|
...this.operation,
|
|
19549
19549
|
method: "addChild",
|
|
19550
|
-
childId:
|
|
19550
|
+
childId: this.operation.childId
|
|
19551
|
+
};
|
|
19552
|
+
return {
|
|
19553
|
+
item: group2,
|
|
19554
|
+
operation
|
|
19555
|
+
};
|
|
19556
|
+
});
|
|
19557
|
+
}
|
|
19558
|
+
case "addChildren": {
|
|
19559
|
+
const groups = Array.isArray(group) ? group : [group];
|
|
19560
|
+
return groups.map((group2) => {
|
|
19561
|
+
const operation = {
|
|
19562
|
+
...this.operation,
|
|
19563
|
+
method: "removeChildren"
|
|
19564
|
+
};
|
|
19565
|
+
return {
|
|
19566
|
+
item: group2,
|
|
19567
|
+
operation
|
|
19568
|
+
};
|
|
19569
|
+
});
|
|
19570
|
+
}
|
|
19571
|
+
case "removeChildren": {
|
|
19572
|
+
const groups = Array.isArray(group) ? group : [group];
|
|
19573
|
+
return groups.map((group2) => {
|
|
19574
|
+
const operation = {
|
|
19575
|
+
...this.operation,
|
|
19576
|
+
method: "addChildren"
|
|
19551
19577
|
};
|
|
19552
19578
|
return {
|
|
19553
19579
|
item: group2,
|
|
@@ -22341,10 +22367,10 @@ class RichText extends BaseItem {
|
|
|
22341
22367
|
const shouldUpdateLayout = this.getTextWidth() > (maxWidth || 0);
|
|
22342
22368
|
if (shouldUpdateLayout) {
|
|
22343
22369
|
this.updateElement();
|
|
22344
|
-
this.subject.publish(this);
|
|
22345
22370
|
} else {
|
|
22346
22371
|
this.transformCanvas();
|
|
22347
22372
|
this.recoordinate(maxWidth);
|
|
22373
|
+
this.subject.publish(this);
|
|
22348
22374
|
}
|
|
22349
22375
|
}
|
|
22350
22376
|
handleFocus = () => {
|
|
@@ -22863,9 +22889,7 @@ class RichText extends BaseItem {
|
|
|
22863
22889
|
this.insideOf = data.insideOf;
|
|
22864
22890
|
if (typeof document !== "undefined") {
|
|
22865
22891
|
document.fonts.ready.then(() => {
|
|
22866
|
-
this.
|
|
22867
|
-
this.alignInRectangle(this.getTransformedContainer(), this.editor.verticalAlignment);
|
|
22868
|
-
this.transformCanvas();
|
|
22892
|
+
this.updateElement();
|
|
22869
22893
|
});
|
|
22870
22894
|
}
|
|
22871
22895
|
this.subject.publish(this);
|
|
@@ -43609,21 +43633,15 @@ class Group extends BaseItem {
|
|
|
43609
43633
|
return null;
|
|
43610
43634
|
}
|
|
43611
43635
|
apply(op) {
|
|
43636
|
+
super.apply(op);
|
|
43612
43637
|
switch (op.class) {
|
|
43613
43638
|
case "Group":
|
|
43614
43639
|
if (op.method === "addChild") {
|
|
43615
43640
|
this.applyAddChildren([op.childId]);
|
|
43616
43641
|
} else if (op.method === "removeChild") {
|
|
43617
43642
|
this.applyRemoveChildren([op.childId]);
|
|
43618
|
-
} else if (op.method === "addChildren") {
|
|
43619
|
-
this.applyAddChildren(op.newData.childIds);
|
|
43620
|
-
} else if (op.method === "removeChildren") {
|
|
43621
|
-
this.applyRemoveChildren(op.newData.childIds);
|
|
43622
43643
|
}
|
|
43623
43644
|
break;
|
|
43624
|
-
case "Transformation":
|
|
43625
|
-
super.apply(op);
|
|
43626
|
-
break;
|
|
43627
43645
|
default:
|
|
43628
43646
|
return;
|
|
43629
43647
|
}
|
|
@@ -43656,10 +43674,10 @@ class Group extends BaseItem {
|
|
|
43656
43674
|
for (const child of children) {
|
|
43657
43675
|
const childLocalMbr = child.getMbr();
|
|
43658
43676
|
const corners = [
|
|
43659
|
-
|
|
43660
|
-
|
|
43661
|
-
|
|
43662
|
-
|
|
43677
|
+
new Point(childLocalMbr.left, childLocalMbr.top),
|
|
43678
|
+
new Point(childLocalMbr.right, childLocalMbr.top),
|
|
43679
|
+
new Point(childLocalMbr.right, childLocalMbr.bottom),
|
|
43680
|
+
new Point(childLocalMbr.left, childLocalMbr.bottom)
|
|
43663
43681
|
];
|
|
43664
43682
|
for (const corner of corners) {
|
|
43665
43683
|
groupWorldMatrix.apply(corner);
|
package/dist/cjs/index.js
CHANGED
|
@@ -19533,7 +19533,7 @@ class GroupCommand {
|
|
|
19533
19533
|
const operation = {
|
|
19534
19534
|
...this.operation,
|
|
19535
19535
|
method: "removeChild",
|
|
19536
|
-
childId:
|
|
19536
|
+
childId: this.operation.childId
|
|
19537
19537
|
};
|
|
19538
19538
|
return {
|
|
19539
19539
|
item: group2,
|
|
@@ -19547,7 +19547,33 @@ class GroupCommand {
|
|
|
19547
19547
|
const operation = {
|
|
19548
19548
|
...this.operation,
|
|
19549
19549
|
method: "addChild",
|
|
19550
|
-
childId:
|
|
19550
|
+
childId: this.operation.childId
|
|
19551
|
+
};
|
|
19552
|
+
return {
|
|
19553
|
+
item: group2,
|
|
19554
|
+
operation
|
|
19555
|
+
};
|
|
19556
|
+
});
|
|
19557
|
+
}
|
|
19558
|
+
case "addChildren": {
|
|
19559
|
+
const groups = Array.isArray(group) ? group : [group];
|
|
19560
|
+
return groups.map((group2) => {
|
|
19561
|
+
const operation = {
|
|
19562
|
+
...this.operation,
|
|
19563
|
+
method: "removeChildren"
|
|
19564
|
+
};
|
|
19565
|
+
return {
|
|
19566
|
+
item: group2,
|
|
19567
|
+
operation
|
|
19568
|
+
};
|
|
19569
|
+
});
|
|
19570
|
+
}
|
|
19571
|
+
case "removeChildren": {
|
|
19572
|
+
const groups = Array.isArray(group) ? group : [group];
|
|
19573
|
+
return groups.map((group2) => {
|
|
19574
|
+
const operation = {
|
|
19575
|
+
...this.operation,
|
|
19576
|
+
method: "addChildren"
|
|
19551
19577
|
};
|
|
19552
19578
|
return {
|
|
19553
19579
|
item: group2,
|
|
@@ -22341,10 +22367,10 @@ class RichText extends BaseItem {
|
|
|
22341
22367
|
const shouldUpdateLayout = this.getTextWidth() > (maxWidth || 0);
|
|
22342
22368
|
if (shouldUpdateLayout) {
|
|
22343
22369
|
this.updateElement();
|
|
22344
|
-
this.subject.publish(this);
|
|
22345
22370
|
} else {
|
|
22346
22371
|
this.transformCanvas();
|
|
22347
22372
|
this.recoordinate(maxWidth);
|
|
22373
|
+
this.subject.publish(this);
|
|
22348
22374
|
}
|
|
22349
22375
|
}
|
|
22350
22376
|
handleFocus = () => {
|
|
@@ -22863,9 +22889,7 @@ class RichText extends BaseItem {
|
|
|
22863
22889
|
this.insideOf = data.insideOf;
|
|
22864
22890
|
if (typeof document !== "undefined") {
|
|
22865
22891
|
document.fonts.ready.then(() => {
|
|
22866
|
-
this.
|
|
22867
|
-
this.alignInRectangle(this.getTransformedContainer(), this.editor.verticalAlignment);
|
|
22868
|
-
this.transformCanvas();
|
|
22892
|
+
this.updateElement();
|
|
22869
22893
|
});
|
|
22870
22894
|
}
|
|
22871
22895
|
this.subject.publish(this);
|
|
@@ -43609,21 +43633,15 @@ class Group extends BaseItem {
|
|
|
43609
43633
|
return null;
|
|
43610
43634
|
}
|
|
43611
43635
|
apply(op) {
|
|
43636
|
+
super.apply(op);
|
|
43612
43637
|
switch (op.class) {
|
|
43613
43638
|
case "Group":
|
|
43614
43639
|
if (op.method === "addChild") {
|
|
43615
43640
|
this.applyAddChildren([op.childId]);
|
|
43616
43641
|
} else if (op.method === "removeChild") {
|
|
43617
43642
|
this.applyRemoveChildren([op.childId]);
|
|
43618
|
-
} else if (op.method === "addChildren") {
|
|
43619
|
-
this.applyAddChildren(op.newData.childIds);
|
|
43620
|
-
} else if (op.method === "removeChildren") {
|
|
43621
|
-
this.applyRemoveChildren(op.newData.childIds);
|
|
43622
43643
|
}
|
|
43623
43644
|
break;
|
|
43624
|
-
case "Transformation":
|
|
43625
|
-
super.apply(op);
|
|
43626
|
-
break;
|
|
43627
43645
|
default:
|
|
43628
43646
|
return;
|
|
43629
43647
|
}
|
|
@@ -43656,10 +43674,10 @@ class Group extends BaseItem {
|
|
|
43656
43674
|
for (const child of children) {
|
|
43657
43675
|
const childLocalMbr = child.getMbr();
|
|
43658
43676
|
const corners = [
|
|
43659
|
-
|
|
43660
|
-
|
|
43661
|
-
|
|
43662
|
-
|
|
43677
|
+
new Point(childLocalMbr.left, childLocalMbr.top),
|
|
43678
|
+
new Point(childLocalMbr.right, childLocalMbr.top),
|
|
43679
|
+
new Point(childLocalMbr.right, childLocalMbr.bottom),
|
|
43680
|
+
new Point(childLocalMbr.left, childLocalMbr.bottom)
|
|
43663
43681
|
];
|
|
43664
43682
|
for (const corner of corners) {
|
|
43665
43683
|
groupWorldMatrix.apply(corner);
|
package/dist/cjs/node.js
CHANGED
|
@@ -22072,7 +22072,7 @@ class GroupCommand {
|
|
|
22072
22072
|
const operation = {
|
|
22073
22073
|
...this.operation,
|
|
22074
22074
|
method: "removeChild",
|
|
22075
|
-
childId:
|
|
22075
|
+
childId: this.operation.childId
|
|
22076
22076
|
};
|
|
22077
22077
|
return {
|
|
22078
22078
|
item: group2,
|
|
@@ -22086,7 +22086,33 @@ class GroupCommand {
|
|
|
22086
22086
|
const operation = {
|
|
22087
22087
|
...this.operation,
|
|
22088
22088
|
method: "addChild",
|
|
22089
|
-
childId:
|
|
22089
|
+
childId: this.operation.childId
|
|
22090
|
+
};
|
|
22091
|
+
return {
|
|
22092
|
+
item: group2,
|
|
22093
|
+
operation
|
|
22094
|
+
};
|
|
22095
|
+
});
|
|
22096
|
+
}
|
|
22097
|
+
case "addChildren": {
|
|
22098
|
+
const groups = Array.isArray(group) ? group : [group];
|
|
22099
|
+
return groups.map((group2) => {
|
|
22100
|
+
const operation = {
|
|
22101
|
+
...this.operation,
|
|
22102
|
+
method: "removeChildren"
|
|
22103
|
+
};
|
|
22104
|
+
return {
|
|
22105
|
+
item: group2,
|
|
22106
|
+
operation
|
|
22107
|
+
};
|
|
22108
|
+
});
|
|
22109
|
+
}
|
|
22110
|
+
case "removeChildren": {
|
|
22111
|
+
const groups = Array.isArray(group) ? group : [group];
|
|
22112
|
+
return groups.map((group2) => {
|
|
22113
|
+
const operation = {
|
|
22114
|
+
...this.operation,
|
|
22115
|
+
method: "addChildren"
|
|
22090
22116
|
};
|
|
22091
22117
|
return {
|
|
22092
22118
|
item: group2,
|
|
@@ -24813,10 +24839,10 @@ class RichText extends BaseItem {
|
|
|
24813
24839
|
const shouldUpdateLayout = this.getTextWidth() > (maxWidth || 0);
|
|
24814
24840
|
if (shouldUpdateLayout) {
|
|
24815
24841
|
this.updateElement();
|
|
24816
|
-
this.subject.publish(this);
|
|
24817
24842
|
} else {
|
|
24818
24843
|
this.transformCanvas();
|
|
24819
24844
|
this.recoordinate(maxWidth);
|
|
24845
|
+
this.subject.publish(this);
|
|
24820
24846
|
}
|
|
24821
24847
|
}
|
|
24822
24848
|
handleFocus = () => {
|
|
@@ -25335,9 +25361,7 @@ class RichText extends BaseItem {
|
|
|
25335
25361
|
this.insideOf = data.insideOf;
|
|
25336
25362
|
if (typeof document !== "undefined") {
|
|
25337
25363
|
document.fonts.ready.then(() => {
|
|
25338
|
-
this.
|
|
25339
|
-
this.alignInRectangle(this.getTransformedContainer(), this.editor.verticalAlignment);
|
|
25340
|
-
this.transformCanvas();
|
|
25364
|
+
this.updateElement();
|
|
25341
25365
|
});
|
|
25342
25366
|
}
|
|
25343
25367
|
this.subject.publish(this);
|
|
@@ -46082,21 +46106,15 @@ class Group extends BaseItem {
|
|
|
46082
46106
|
return null;
|
|
46083
46107
|
}
|
|
46084
46108
|
apply(op) {
|
|
46109
|
+
super.apply(op);
|
|
46085
46110
|
switch (op.class) {
|
|
46086
46111
|
case "Group":
|
|
46087
46112
|
if (op.method === "addChild") {
|
|
46088
46113
|
this.applyAddChildren([op.childId]);
|
|
46089
46114
|
} else if (op.method === "removeChild") {
|
|
46090
46115
|
this.applyRemoveChildren([op.childId]);
|
|
46091
|
-
} else if (op.method === "addChildren") {
|
|
46092
|
-
this.applyAddChildren(op.newData.childIds);
|
|
46093
|
-
} else if (op.method === "removeChildren") {
|
|
46094
|
-
this.applyRemoveChildren(op.newData.childIds);
|
|
46095
46116
|
}
|
|
46096
46117
|
break;
|
|
46097
|
-
case "Transformation":
|
|
46098
|
-
super.apply(op);
|
|
46099
|
-
break;
|
|
46100
46118
|
default:
|
|
46101
46119
|
return;
|
|
46102
46120
|
}
|
|
@@ -46129,10 +46147,10 @@ class Group extends BaseItem {
|
|
|
46129
46147
|
for (const child of children) {
|
|
46130
46148
|
const childLocalMbr = child.getMbr();
|
|
46131
46149
|
const corners = [
|
|
46132
|
-
|
|
46133
|
-
|
|
46134
|
-
|
|
46135
|
-
|
|
46150
|
+
new Point(childLocalMbr.left, childLocalMbr.top),
|
|
46151
|
+
new Point(childLocalMbr.right, childLocalMbr.top),
|
|
46152
|
+
new Point(childLocalMbr.right, childLocalMbr.bottom),
|
|
46153
|
+
new Point(childLocalMbr.left, childLocalMbr.bottom)
|
|
46136
46154
|
];
|
|
46137
46155
|
for (const corner of corners) {
|
|
46138
46156
|
groupWorldMatrix.apply(corner);
|
package/dist/esm/browser.js
CHANGED
|
@@ -19362,7 +19362,7 @@ class GroupCommand {
|
|
|
19362
19362
|
const operation = {
|
|
19363
19363
|
...this.operation,
|
|
19364
19364
|
method: "removeChild",
|
|
19365
|
-
childId:
|
|
19365
|
+
childId: this.operation.childId
|
|
19366
19366
|
};
|
|
19367
19367
|
return {
|
|
19368
19368
|
item: group2,
|
|
@@ -19376,7 +19376,33 @@ class GroupCommand {
|
|
|
19376
19376
|
const operation = {
|
|
19377
19377
|
...this.operation,
|
|
19378
19378
|
method: "addChild",
|
|
19379
|
-
childId:
|
|
19379
|
+
childId: this.operation.childId
|
|
19380
|
+
};
|
|
19381
|
+
return {
|
|
19382
|
+
item: group2,
|
|
19383
|
+
operation
|
|
19384
|
+
};
|
|
19385
|
+
});
|
|
19386
|
+
}
|
|
19387
|
+
case "addChildren": {
|
|
19388
|
+
const groups = Array.isArray(group) ? group : [group];
|
|
19389
|
+
return groups.map((group2) => {
|
|
19390
|
+
const operation = {
|
|
19391
|
+
...this.operation,
|
|
19392
|
+
method: "removeChildren"
|
|
19393
|
+
};
|
|
19394
|
+
return {
|
|
19395
|
+
item: group2,
|
|
19396
|
+
operation
|
|
19397
|
+
};
|
|
19398
|
+
});
|
|
19399
|
+
}
|
|
19400
|
+
case "removeChildren": {
|
|
19401
|
+
const groups = Array.isArray(group) ? group : [group];
|
|
19402
|
+
return groups.map((group2) => {
|
|
19403
|
+
const operation = {
|
|
19404
|
+
...this.operation,
|
|
19405
|
+
method: "addChildren"
|
|
19380
19406
|
};
|
|
19381
19407
|
return {
|
|
19382
19408
|
item: group2,
|
|
@@ -22170,10 +22196,10 @@ class RichText extends BaseItem {
|
|
|
22170
22196
|
const shouldUpdateLayout = this.getTextWidth() > (maxWidth || 0);
|
|
22171
22197
|
if (shouldUpdateLayout) {
|
|
22172
22198
|
this.updateElement();
|
|
22173
|
-
this.subject.publish(this);
|
|
22174
22199
|
} else {
|
|
22175
22200
|
this.transformCanvas();
|
|
22176
22201
|
this.recoordinate(maxWidth);
|
|
22202
|
+
this.subject.publish(this);
|
|
22177
22203
|
}
|
|
22178
22204
|
}
|
|
22179
22205
|
handleFocus = () => {
|
|
@@ -22692,9 +22718,7 @@ class RichText extends BaseItem {
|
|
|
22692
22718
|
this.insideOf = data.insideOf;
|
|
22693
22719
|
if (typeof document !== "undefined") {
|
|
22694
22720
|
document.fonts.ready.then(() => {
|
|
22695
|
-
this.
|
|
22696
|
-
this.alignInRectangle(this.getTransformedContainer(), this.editor.verticalAlignment);
|
|
22697
|
-
this.transformCanvas();
|
|
22721
|
+
this.updateElement();
|
|
22698
22722
|
});
|
|
22699
22723
|
}
|
|
22700
22724
|
this.subject.publish(this);
|
|
@@ -43438,21 +43462,15 @@ class Group extends BaseItem {
|
|
|
43438
43462
|
return null;
|
|
43439
43463
|
}
|
|
43440
43464
|
apply(op) {
|
|
43465
|
+
super.apply(op);
|
|
43441
43466
|
switch (op.class) {
|
|
43442
43467
|
case "Group":
|
|
43443
43468
|
if (op.method === "addChild") {
|
|
43444
43469
|
this.applyAddChildren([op.childId]);
|
|
43445
43470
|
} else if (op.method === "removeChild") {
|
|
43446
43471
|
this.applyRemoveChildren([op.childId]);
|
|
43447
|
-
} else if (op.method === "addChildren") {
|
|
43448
|
-
this.applyAddChildren(op.newData.childIds);
|
|
43449
|
-
} else if (op.method === "removeChildren") {
|
|
43450
|
-
this.applyRemoveChildren(op.newData.childIds);
|
|
43451
43472
|
}
|
|
43452
43473
|
break;
|
|
43453
|
-
case "Transformation":
|
|
43454
|
-
super.apply(op);
|
|
43455
|
-
break;
|
|
43456
43474
|
default:
|
|
43457
43475
|
return;
|
|
43458
43476
|
}
|
|
@@ -43485,10 +43503,10 @@ class Group extends BaseItem {
|
|
|
43485
43503
|
for (const child of children) {
|
|
43486
43504
|
const childLocalMbr = child.getMbr();
|
|
43487
43505
|
const corners = [
|
|
43488
|
-
|
|
43489
|
-
|
|
43490
|
-
|
|
43491
|
-
|
|
43506
|
+
new Point(childLocalMbr.left, childLocalMbr.top),
|
|
43507
|
+
new Point(childLocalMbr.right, childLocalMbr.top),
|
|
43508
|
+
new Point(childLocalMbr.right, childLocalMbr.bottom),
|
|
43509
|
+
new Point(childLocalMbr.left, childLocalMbr.bottom)
|
|
43492
43510
|
];
|
|
43493
43511
|
for (const corner of corners) {
|
|
43494
43512
|
groupWorldMatrix.apply(corner);
|
package/dist/esm/index.js
CHANGED
|
@@ -19355,7 +19355,7 @@ class GroupCommand {
|
|
|
19355
19355
|
const operation = {
|
|
19356
19356
|
...this.operation,
|
|
19357
19357
|
method: "removeChild",
|
|
19358
|
-
childId:
|
|
19358
|
+
childId: this.operation.childId
|
|
19359
19359
|
};
|
|
19360
19360
|
return {
|
|
19361
19361
|
item: group2,
|
|
@@ -19369,7 +19369,33 @@ class GroupCommand {
|
|
|
19369
19369
|
const operation = {
|
|
19370
19370
|
...this.operation,
|
|
19371
19371
|
method: "addChild",
|
|
19372
|
-
childId:
|
|
19372
|
+
childId: this.operation.childId
|
|
19373
|
+
};
|
|
19374
|
+
return {
|
|
19375
|
+
item: group2,
|
|
19376
|
+
operation
|
|
19377
|
+
};
|
|
19378
|
+
});
|
|
19379
|
+
}
|
|
19380
|
+
case "addChildren": {
|
|
19381
|
+
const groups = Array.isArray(group) ? group : [group];
|
|
19382
|
+
return groups.map((group2) => {
|
|
19383
|
+
const operation = {
|
|
19384
|
+
...this.operation,
|
|
19385
|
+
method: "removeChildren"
|
|
19386
|
+
};
|
|
19387
|
+
return {
|
|
19388
|
+
item: group2,
|
|
19389
|
+
operation
|
|
19390
|
+
};
|
|
19391
|
+
});
|
|
19392
|
+
}
|
|
19393
|
+
case "removeChildren": {
|
|
19394
|
+
const groups = Array.isArray(group) ? group : [group];
|
|
19395
|
+
return groups.map((group2) => {
|
|
19396
|
+
const operation = {
|
|
19397
|
+
...this.operation,
|
|
19398
|
+
method: "addChildren"
|
|
19373
19399
|
};
|
|
19374
19400
|
return {
|
|
19375
19401
|
item: group2,
|
|
@@ -22163,10 +22189,10 @@ class RichText extends BaseItem {
|
|
|
22163
22189
|
const shouldUpdateLayout = this.getTextWidth() > (maxWidth || 0);
|
|
22164
22190
|
if (shouldUpdateLayout) {
|
|
22165
22191
|
this.updateElement();
|
|
22166
|
-
this.subject.publish(this);
|
|
22167
22192
|
} else {
|
|
22168
22193
|
this.transformCanvas();
|
|
22169
22194
|
this.recoordinate(maxWidth);
|
|
22195
|
+
this.subject.publish(this);
|
|
22170
22196
|
}
|
|
22171
22197
|
}
|
|
22172
22198
|
handleFocus = () => {
|
|
@@ -22685,9 +22711,7 @@ class RichText extends BaseItem {
|
|
|
22685
22711
|
this.insideOf = data.insideOf;
|
|
22686
22712
|
if (typeof document !== "undefined") {
|
|
22687
22713
|
document.fonts.ready.then(() => {
|
|
22688
|
-
this.
|
|
22689
|
-
this.alignInRectangle(this.getTransformedContainer(), this.editor.verticalAlignment);
|
|
22690
|
-
this.transformCanvas();
|
|
22714
|
+
this.updateElement();
|
|
22691
22715
|
});
|
|
22692
22716
|
}
|
|
22693
22717
|
this.subject.publish(this);
|
|
@@ -43431,21 +43455,15 @@ class Group extends BaseItem {
|
|
|
43431
43455
|
return null;
|
|
43432
43456
|
}
|
|
43433
43457
|
apply(op) {
|
|
43458
|
+
super.apply(op);
|
|
43434
43459
|
switch (op.class) {
|
|
43435
43460
|
case "Group":
|
|
43436
43461
|
if (op.method === "addChild") {
|
|
43437
43462
|
this.applyAddChildren([op.childId]);
|
|
43438
43463
|
} else if (op.method === "removeChild") {
|
|
43439
43464
|
this.applyRemoveChildren([op.childId]);
|
|
43440
|
-
} else if (op.method === "addChildren") {
|
|
43441
|
-
this.applyAddChildren(op.newData.childIds);
|
|
43442
|
-
} else if (op.method === "removeChildren") {
|
|
43443
|
-
this.applyRemoveChildren(op.newData.childIds);
|
|
43444
43465
|
}
|
|
43445
43466
|
break;
|
|
43446
|
-
case "Transformation":
|
|
43447
|
-
super.apply(op);
|
|
43448
|
-
break;
|
|
43449
43467
|
default:
|
|
43450
43468
|
return;
|
|
43451
43469
|
}
|
|
@@ -43478,10 +43496,10 @@ class Group extends BaseItem {
|
|
|
43478
43496
|
for (const child of children) {
|
|
43479
43497
|
const childLocalMbr = child.getMbr();
|
|
43480
43498
|
const corners = [
|
|
43481
|
-
|
|
43482
|
-
|
|
43483
|
-
|
|
43484
|
-
|
|
43499
|
+
new Point(childLocalMbr.left, childLocalMbr.top),
|
|
43500
|
+
new Point(childLocalMbr.right, childLocalMbr.top),
|
|
43501
|
+
new Point(childLocalMbr.right, childLocalMbr.bottom),
|
|
43502
|
+
new Point(childLocalMbr.left, childLocalMbr.bottom)
|
|
43485
43503
|
];
|
|
43486
43504
|
for (const corner of corners) {
|
|
43487
43505
|
groupWorldMatrix.apply(corner);
|
package/dist/esm/node.js
CHANGED
|
@@ -21889,7 +21889,7 @@ class GroupCommand {
|
|
|
21889
21889
|
const operation = {
|
|
21890
21890
|
...this.operation,
|
|
21891
21891
|
method: "removeChild",
|
|
21892
|
-
childId:
|
|
21892
|
+
childId: this.operation.childId
|
|
21893
21893
|
};
|
|
21894
21894
|
return {
|
|
21895
21895
|
item: group2,
|
|
@@ -21903,7 +21903,33 @@ class GroupCommand {
|
|
|
21903
21903
|
const operation = {
|
|
21904
21904
|
...this.operation,
|
|
21905
21905
|
method: "addChild",
|
|
21906
|
-
childId:
|
|
21906
|
+
childId: this.operation.childId
|
|
21907
|
+
};
|
|
21908
|
+
return {
|
|
21909
|
+
item: group2,
|
|
21910
|
+
operation
|
|
21911
|
+
};
|
|
21912
|
+
});
|
|
21913
|
+
}
|
|
21914
|
+
case "addChildren": {
|
|
21915
|
+
const groups = Array.isArray(group) ? group : [group];
|
|
21916
|
+
return groups.map((group2) => {
|
|
21917
|
+
const operation = {
|
|
21918
|
+
...this.operation,
|
|
21919
|
+
method: "removeChildren"
|
|
21920
|
+
};
|
|
21921
|
+
return {
|
|
21922
|
+
item: group2,
|
|
21923
|
+
operation
|
|
21924
|
+
};
|
|
21925
|
+
});
|
|
21926
|
+
}
|
|
21927
|
+
case "removeChildren": {
|
|
21928
|
+
const groups = Array.isArray(group) ? group : [group];
|
|
21929
|
+
return groups.map((group2) => {
|
|
21930
|
+
const operation = {
|
|
21931
|
+
...this.operation,
|
|
21932
|
+
method: "addChildren"
|
|
21907
21933
|
};
|
|
21908
21934
|
return {
|
|
21909
21935
|
item: group2,
|
|
@@ -24630,10 +24656,10 @@ class RichText extends BaseItem {
|
|
|
24630
24656
|
const shouldUpdateLayout = this.getTextWidth() > (maxWidth || 0);
|
|
24631
24657
|
if (shouldUpdateLayout) {
|
|
24632
24658
|
this.updateElement();
|
|
24633
|
-
this.subject.publish(this);
|
|
24634
24659
|
} else {
|
|
24635
24660
|
this.transformCanvas();
|
|
24636
24661
|
this.recoordinate(maxWidth);
|
|
24662
|
+
this.subject.publish(this);
|
|
24637
24663
|
}
|
|
24638
24664
|
}
|
|
24639
24665
|
handleFocus = () => {
|
|
@@ -25152,9 +25178,7 @@ class RichText extends BaseItem {
|
|
|
25152
25178
|
this.insideOf = data.insideOf;
|
|
25153
25179
|
if (typeof document !== "undefined") {
|
|
25154
25180
|
document.fonts.ready.then(() => {
|
|
25155
|
-
this.
|
|
25156
|
-
this.alignInRectangle(this.getTransformedContainer(), this.editor.verticalAlignment);
|
|
25157
|
-
this.transformCanvas();
|
|
25181
|
+
this.updateElement();
|
|
25158
25182
|
});
|
|
25159
25183
|
}
|
|
25160
25184
|
this.subject.publish(this);
|
|
@@ -45899,21 +45923,15 @@ class Group extends BaseItem {
|
|
|
45899
45923
|
return null;
|
|
45900
45924
|
}
|
|
45901
45925
|
apply(op) {
|
|
45926
|
+
super.apply(op);
|
|
45902
45927
|
switch (op.class) {
|
|
45903
45928
|
case "Group":
|
|
45904
45929
|
if (op.method === "addChild") {
|
|
45905
45930
|
this.applyAddChildren([op.childId]);
|
|
45906
45931
|
} else if (op.method === "removeChild") {
|
|
45907
45932
|
this.applyRemoveChildren([op.childId]);
|
|
45908
|
-
} else if (op.method === "addChildren") {
|
|
45909
|
-
this.applyAddChildren(op.newData.childIds);
|
|
45910
|
-
} else if (op.method === "removeChildren") {
|
|
45911
|
-
this.applyRemoveChildren(op.newData.childIds);
|
|
45912
45933
|
}
|
|
45913
45934
|
break;
|
|
45914
|
-
case "Transformation":
|
|
45915
|
-
super.apply(op);
|
|
45916
|
-
break;
|
|
45917
45935
|
default:
|
|
45918
45936
|
return;
|
|
45919
45937
|
}
|
|
@@ -45946,10 +45964,10 @@ class Group extends BaseItem {
|
|
|
45946
45964
|
for (const child of children) {
|
|
45947
45965
|
const childLocalMbr = child.getMbr();
|
|
45948
45966
|
const corners = [
|
|
45949
|
-
|
|
45950
|
-
|
|
45951
|
-
|
|
45952
|
-
|
|
45967
|
+
new Point(childLocalMbr.left, childLocalMbr.top),
|
|
45968
|
+
new Point(childLocalMbr.right, childLocalMbr.top),
|
|
45969
|
+
new Point(childLocalMbr.right, childLocalMbr.bottom),
|
|
45970
|
+
new Point(childLocalMbr.left, childLocalMbr.bottom)
|
|
45953
45971
|
];
|
|
45954
45972
|
for (const corner of corners) {
|
|
45955
45973
|
groupWorldMatrix.apply(corner);
|
|
@@ -10,5 +10,21 @@ interface RemoveChild {
|
|
|
10
10
|
item: string[];
|
|
11
11
|
childId: string;
|
|
12
12
|
}
|
|
13
|
-
|
|
13
|
+
interface AddChildren {
|
|
14
|
+
class: "Group";
|
|
15
|
+
method: "addChildren";
|
|
16
|
+
item: string[];
|
|
17
|
+
newData: {
|
|
18
|
+
childIds: string[];
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
interface RemoveChildren {
|
|
22
|
+
class: "Group";
|
|
23
|
+
method: "removeChildren";
|
|
24
|
+
item: string[];
|
|
25
|
+
newData: {
|
|
26
|
+
childIds: string[];
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
export type GroupOperation = AddChild | RemoveChild | AddChildren | RemoveChildren;
|
|
14
30
|
export {};
|