microboard-temp 0.13.68 → 0.13.70
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 +25 -6
- package/dist/cjs/index.js +25 -6
- package/dist/cjs/node.js +25 -6
- package/dist/esm/browser.js +25 -6
- package/dist/esm/index.js +25 -6
- package/dist/esm/node.js +25 -6
- package/package.json +1 -1
package/dist/cjs/browser.js
CHANGED
|
@@ -61972,6 +61972,11 @@ class Board {
|
|
|
61972
61972
|
}
|
|
61973
61973
|
const { x, y } = this.pointer.point;
|
|
61974
61974
|
console.log("[paste] minX:", minX, "minY:", minY, "pointer:", x, y);
|
|
61975
|
+
const originalTranslations = new Map;
|
|
61976
|
+
for (const itemId in itemsMap) {
|
|
61977
|
+
const t3 = itemsMap[itemId].transformation;
|
|
61978
|
+
originalTranslations.set(itemId, { tx: t3?.translateX ?? 0, ty: t3?.translateY ?? 0 });
|
|
61979
|
+
}
|
|
61975
61980
|
const mediaStorageIds = [];
|
|
61976
61981
|
for (const itemId in itemsMap) {
|
|
61977
61982
|
const itemData = itemsMap[itemId];
|
|
@@ -62019,9 +62024,9 @@ class Board {
|
|
|
62019
62024
|
}
|
|
62020
62025
|
} else if (childItemIds.has(itemId)) {
|
|
62021
62026
|
const parentId = childToParent.get(itemId);
|
|
62022
|
-
const
|
|
62023
|
-
const parentOrigTx =
|
|
62024
|
-
const parentOrigTy =
|
|
62027
|
+
const parentOrig = parentId ? originalTranslations.get(parentId) : undefined;
|
|
62028
|
+
const parentOrigTx = parentOrig?.tx ?? 0;
|
|
62029
|
+
const parentOrigTy = parentOrig?.ty ?? 0;
|
|
62025
62030
|
const parentNewTx = parentOrigTx - minX + x;
|
|
62026
62031
|
const parentNewTy = parentOrigTy - minY + y;
|
|
62027
62032
|
const newChildTx = parentNewTx + translateX;
|
|
@@ -62060,7 +62065,16 @@ class Board {
|
|
|
62060
62065
|
select: select2
|
|
62061
62066
|
});
|
|
62062
62067
|
const items = Object.keys(newMap).map((id) => this.items.getById(id)).filter((item) => typeof item !== "undefined");
|
|
62068
|
+
for (const item of items) {
|
|
62069
|
+
const mbr = item.getMbr();
|
|
62070
|
+
const pos = item.transformation.getTranslation();
|
|
62071
|
+
console.log(`[nest-pre] ${item.itemType} ${item.getId()}: pos=(${pos.x.toFixed(0)},${pos.y.toFixed(0)}) mbr=(${mbr.left.toFixed(0)},${mbr.top.toFixed(0)},${mbr.right.toFixed(0)},${mbr.bottom.toFixed(0)}) parent=${item.parent}`);
|
|
62072
|
+
}
|
|
62063
62073
|
this.handleNesting(items);
|
|
62074
|
+
for (const item of items) {
|
|
62075
|
+
const pos = item.transformation.getTranslation();
|
|
62076
|
+
console.log(`[nest-post] ${item.itemType} ${item.getId()}: pos=(${pos.x.toFixed(0)},${pos.y.toFixed(0)}) parent=${item.parent}`);
|
|
62077
|
+
}
|
|
62064
62078
|
this.selection.removeAll();
|
|
62065
62079
|
this.selection.add(items);
|
|
62066
62080
|
this.selection.setContext("EditUnderPointer");
|
|
@@ -62155,6 +62169,11 @@ class Board {
|
|
|
62155
62169
|
if (minY === Infinity) {
|
|
62156
62170
|
minY = 0;
|
|
62157
62171
|
}
|
|
62172
|
+
const dupOriginalTranslations = new Map;
|
|
62173
|
+
for (const itemId in itemsMap) {
|
|
62174
|
+
const t3 = itemsMap[itemId].transformation;
|
|
62175
|
+
dupOriginalTranslations.set(itemId, { tx: t3?.translateX ?? 0, ty: t3?.translateY ?? 0 });
|
|
62176
|
+
}
|
|
62158
62177
|
const mbr = this.selection.getMbr();
|
|
62159
62178
|
const selectedItems = this.selection.items.list();
|
|
62160
62179
|
const isSelectedItemsMinWidth = selectedItems.some((item) => item.getMbr().getWidth() === 0);
|
|
@@ -62184,9 +62203,9 @@ class Board {
|
|
|
62184
62203
|
}
|
|
62185
62204
|
} else if (dupChildItemIds.has(itemId)) {
|
|
62186
62205
|
const parentId = dupChildToParent.get(itemId);
|
|
62187
|
-
const
|
|
62188
|
-
const parentOrigTx =
|
|
62189
|
-
const parentOrigTy =
|
|
62206
|
+
const parentOrig = parentId ? dupOriginalTranslations.get(parentId) : undefined;
|
|
62207
|
+
const parentOrigTx = parentOrig?.tx ?? 0;
|
|
62208
|
+
const parentOrigTy = parentOrig?.ty ?? 0;
|
|
62190
62209
|
const parentNewTx = parentOrigTx - minX + right + width2;
|
|
62191
62210
|
const parentNewTy = parentOrigTy - minY + top;
|
|
62192
62211
|
if (itemData.transformation) {
|
package/dist/cjs/index.js
CHANGED
|
@@ -61972,6 +61972,11 @@ class Board {
|
|
|
61972
61972
|
}
|
|
61973
61973
|
const { x, y } = this.pointer.point;
|
|
61974
61974
|
console.log("[paste] minX:", minX, "minY:", minY, "pointer:", x, y);
|
|
61975
|
+
const originalTranslations = new Map;
|
|
61976
|
+
for (const itemId in itemsMap) {
|
|
61977
|
+
const t3 = itemsMap[itemId].transformation;
|
|
61978
|
+
originalTranslations.set(itemId, { tx: t3?.translateX ?? 0, ty: t3?.translateY ?? 0 });
|
|
61979
|
+
}
|
|
61975
61980
|
const mediaStorageIds = [];
|
|
61976
61981
|
for (const itemId in itemsMap) {
|
|
61977
61982
|
const itemData = itemsMap[itemId];
|
|
@@ -62019,9 +62024,9 @@ class Board {
|
|
|
62019
62024
|
}
|
|
62020
62025
|
} else if (childItemIds.has(itemId)) {
|
|
62021
62026
|
const parentId = childToParent.get(itemId);
|
|
62022
|
-
const
|
|
62023
|
-
const parentOrigTx =
|
|
62024
|
-
const parentOrigTy =
|
|
62027
|
+
const parentOrig = parentId ? originalTranslations.get(parentId) : undefined;
|
|
62028
|
+
const parentOrigTx = parentOrig?.tx ?? 0;
|
|
62029
|
+
const parentOrigTy = parentOrig?.ty ?? 0;
|
|
62025
62030
|
const parentNewTx = parentOrigTx - minX + x;
|
|
62026
62031
|
const parentNewTy = parentOrigTy - minY + y;
|
|
62027
62032
|
const newChildTx = parentNewTx + translateX;
|
|
@@ -62060,7 +62065,16 @@ class Board {
|
|
|
62060
62065
|
select: select2
|
|
62061
62066
|
});
|
|
62062
62067
|
const items = Object.keys(newMap).map((id) => this.items.getById(id)).filter((item) => typeof item !== "undefined");
|
|
62068
|
+
for (const item of items) {
|
|
62069
|
+
const mbr = item.getMbr();
|
|
62070
|
+
const pos = item.transformation.getTranslation();
|
|
62071
|
+
console.log(`[nest-pre] ${item.itemType} ${item.getId()}: pos=(${pos.x.toFixed(0)},${pos.y.toFixed(0)}) mbr=(${mbr.left.toFixed(0)},${mbr.top.toFixed(0)},${mbr.right.toFixed(0)},${mbr.bottom.toFixed(0)}) parent=${item.parent}`);
|
|
62072
|
+
}
|
|
62063
62073
|
this.handleNesting(items);
|
|
62074
|
+
for (const item of items) {
|
|
62075
|
+
const pos = item.transformation.getTranslation();
|
|
62076
|
+
console.log(`[nest-post] ${item.itemType} ${item.getId()}: pos=(${pos.x.toFixed(0)},${pos.y.toFixed(0)}) parent=${item.parent}`);
|
|
62077
|
+
}
|
|
62064
62078
|
this.selection.removeAll();
|
|
62065
62079
|
this.selection.add(items);
|
|
62066
62080
|
this.selection.setContext("EditUnderPointer");
|
|
@@ -62155,6 +62169,11 @@ class Board {
|
|
|
62155
62169
|
if (minY === Infinity) {
|
|
62156
62170
|
minY = 0;
|
|
62157
62171
|
}
|
|
62172
|
+
const dupOriginalTranslations = new Map;
|
|
62173
|
+
for (const itemId in itemsMap) {
|
|
62174
|
+
const t3 = itemsMap[itemId].transformation;
|
|
62175
|
+
dupOriginalTranslations.set(itemId, { tx: t3?.translateX ?? 0, ty: t3?.translateY ?? 0 });
|
|
62176
|
+
}
|
|
62158
62177
|
const mbr = this.selection.getMbr();
|
|
62159
62178
|
const selectedItems = this.selection.items.list();
|
|
62160
62179
|
const isSelectedItemsMinWidth = selectedItems.some((item) => item.getMbr().getWidth() === 0);
|
|
@@ -62184,9 +62203,9 @@ class Board {
|
|
|
62184
62203
|
}
|
|
62185
62204
|
} else if (dupChildItemIds.has(itemId)) {
|
|
62186
62205
|
const parentId = dupChildToParent.get(itemId);
|
|
62187
|
-
const
|
|
62188
|
-
const parentOrigTx =
|
|
62189
|
-
const parentOrigTy =
|
|
62206
|
+
const parentOrig = parentId ? dupOriginalTranslations.get(parentId) : undefined;
|
|
62207
|
+
const parentOrigTx = parentOrig?.tx ?? 0;
|
|
62208
|
+
const parentOrigTy = parentOrig?.ty ?? 0;
|
|
62190
62209
|
const parentNewTx = parentOrigTx - minX + right + width2;
|
|
62191
62210
|
const parentNewTy = parentOrigTy - minY + top;
|
|
62192
62211
|
if (itemData.transformation) {
|
package/dist/cjs/node.js
CHANGED
|
@@ -64447,6 +64447,11 @@ class Board {
|
|
|
64447
64447
|
}
|
|
64448
64448
|
const { x, y } = this.pointer.point;
|
|
64449
64449
|
console.log("[paste] minX:", minX, "minY:", minY, "pointer:", x, y);
|
|
64450
|
+
const originalTranslations = new Map;
|
|
64451
|
+
for (const itemId in itemsMap) {
|
|
64452
|
+
const t3 = itemsMap[itemId].transformation;
|
|
64453
|
+
originalTranslations.set(itemId, { tx: t3?.translateX ?? 0, ty: t3?.translateY ?? 0 });
|
|
64454
|
+
}
|
|
64450
64455
|
const mediaStorageIds = [];
|
|
64451
64456
|
for (const itemId in itemsMap) {
|
|
64452
64457
|
const itemData = itemsMap[itemId];
|
|
@@ -64494,9 +64499,9 @@ class Board {
|
|
|
64494
64499
|
}
|
|
64495
64500
|
} else if (childItemIds.has(itemId)) {
|
|
64496
64501
|
const parentId = childToParent.get(itemId);
|
|
64497
|
-
const
|
|
64498
|
-
const parentOrigTx =
|
|
64499
|
-
const parentOrigTy =
|
|
64502
|
+
const parentOrig = parentId ? originalTranslations.get(parentId) : undefined;
|
|
64503
|
+
const parentOrigTx = parentOrig?.tx ?? 0;
|
|
64504
|
+
const parentOrigTy = parentOrig?.ty ?? 0;
|
|
64500
64505
|
const parentNewTx = parentOrigTx - minX + x;
|
|
64501
64506
|
const parentNewTy = parentOrigTy - minY + y;
|
|
64502
64507
|
const newChildTx = parentNewTx + translateX;
|
|
@@ -64535,7 +64540,16 @@ class Board {
|
|
|
64535
64540
|
select: select2
|
|
64536
64541
|
});
|
|
64537
64542
|
const items = Object.keys(newMap).map((id) => this.items.getById(id)).filter((item) => typeof item !== "undefined");
|
|
64543
|
+
for (const item of items) {
|
|
64544
|
+
const mbr = item.getMbr();
|
|
64545
|
+
const pos = item.transformation.getTranslation();
|
|
64546
|
+
console.log(`[nest-pre] ${item.itemType} ${item.getId()}: pos=(${pos.x.toFixed(0)},${pos.y.toFixed(0)}) mbr=(${mbr.left.toFixed(0)},${mbr.top.toFixed(0)},${mbr.right.toFixed(0)},${mbr.bottom.toFixed(0)}) parent=${item.parent}`);
|
|
64547
|
+
}
|
|
64538
64548
|
this.handleNesting(items);
|
|
64549
|
+
for (const item of items) {
|
|
64550
|
+
const pos = item.transformation.getTranslation();
|
|
64551
|
+
console.log(`[nest-post] ${item.itemType} ${item.getId()}: pos=(${pos.x.toFixed(0)},${pos.y.toFixed(0)}) parent=${item.parent}`);
|
|
64552
|
+
}
|
|
64539
64553
|
this.selection.removeAll();
|
|
64540
64554
|
this.selection.add(items);
|
|
64541
64555
|
this.selection.setContext("EditUnderPointer");
|
|
@@ -64630,6 +64644,11 @@ class Board {
|
|
|
64630
64644
|
if (minY === Infinity) {
|
|
64631
64645
|
minY = 0;
|
|
64632
64646
|
}
|
|
64647
|
+
const dupOriginalTranslations = new Map;
|
|
64648
|
+
for (const itemId in itemsMap) {
|
|
64649
|
+
const t3 = itemsMap[itemId].transformation;
|
|
64650
|
+
dupOriginalTranslations.set(itemId, { tx: t3?.translateX ?? 0, ty: t3?.translateY ?? 0 });
|
|
64651
|
+
}
|
|
64633
64652
|
const mbr = this.selection.getMbr();
|
|
64634
64653
|
const selectedItems = this.selection.items.list();
|
|
64635
64654
|
const isSelectedItemsMinWidth = selectedItems.some((item) => item.getMbr().getWidth() === 0);
|
|
@@ -64659,9 +64678,9 @@ class Board {
|
|
|
64659
64678
|
}
|
|
64660
64679
|
} else if (dupChildItemIds.has(itemId)) {
|
|
64661
64680
|
const parentId = dupChildToParent.get(itemId);
|
|
64662
|
-
const
|
|
64663
|
-
const parentOrigTx =
|
|
64664
|
-
const parentOrigTy =
|
|
64681
|
+
const parentOrig = parentId ? dupOriginalTranslations.get(parentId) : undefined;
|
|
64682
|
+
const parentOrigTx = parentOrig?.tx ?? 0;
|
|
64683
|
+
const parentOrigTy = parentOrig?.ty ?? 0;
|
|
64665
64684
|
const parentNewTx = parentOrigTx - minX + right + width2;
|
|
64666
64685
|
const parentNewTy = parentOrigTy - minY + top;
|
|
64667
64686
|
if (itemData.transformation) {
|
package/dist/esm/browser.js
CHANGED
|
@@ -61715,6 +61715,11 @@ class Board {
|
|
|
61715
61715
|
}
|
|
61716
61716
|
const { x, y } = this.pointer.point;
|
|
61717
61717
|
console.log("[paste] minX:", minX, "minY:", minY, "pointer:", x, y);
|
|
61718
|
+
const originalTranslations = new Map;
|
|
61719
|
+
for (const itemId in itemsMap) {
|
|
61720
|
+
const t3 = itemsMap[itemId].transformation;
|
|
61721
|
+
originalTranslations.set(itemId, { tx: t3?.translateX ?? 0, ty: t3?.translateY ?? 0 });
|
|
61722
|
+
}
|
|
61718
61723
|
const mediaStorageIds = [];
|
|
61719
61724
|
for (const itemId in itemsMap) {
|
|
61720
61725
|
const itemData = itemsMap[itemId];
|
|
@@ -61762,9 +61767,9 @@ class Board {
|
|
|
61762
61767
|
}
|
|
61763
61768
|
} else if (childItemIds.has(itemId)) {
|
|
61764
61769
|
const parentId = childToParent.get(itemId);
|
|
61765
|
-
const
|
|
61766
|
-
const parentOrigTx =
|
|
61767
|
-
const parentOrigTy =
|
|
61770
|
+
const parentOrig = parentId ? originalTranslations.get(parentId) : undefined;
|
|
61771
|
+
const parentOrigTx = parentOrig?.tx ?? 0;
|
|
61772
|
+
const parentOrigTy = parentOrig?.ty ?? 0;
|
|
61768
61773
|
const parentNewTx = parentOrigTx - minX + x;
|
|
61769
61774
|
const parentNewTy = parentOrigTy - minY + y;
|
|
61770
61775
|
const newChildTx = parentNewTx + translateX;
|
|
@@ -61803,7 +61808,16 @@ class Board {
|
|
|
61803
61808
|
select: select2
|
|
61804
61809
|
});
|
|
61805
61810
|
const items = Object.keys(newMap).map((id) => this.items.getById(id)).filter((item) => typeof item !== "undefined");
|
|
61811
|
+
for (const item of items) {
|
|
61812
|
+
const mbr = item.getMbr();
|
|
61813
|
+
const pos = item.transformation.getTranslation();
|
|
61814
|
+
console.log(`[nest-pre] ${item.itemType} ${item.getId()}: pos=(${pos.x.toFixed(0)},${pos.y.toFixed(0)}) mbr=(${mbr.left.toFixed(0)},${mbr.top.toFixed(0)},${mbr.right.toFixed(0)},${mbr.bottom.toFixed(0)}) parent=${item.parent}`);
|
|
61815
|
+
}
|
|
61806
61816
|
this.handleNesting(items);
|
|
61817
|
+
for (const item of items) {
|
|
61818
|
+
const pos = item.transformation.getTranslation();
|
|
61819
|
+
console.log(`[nest-post] ${item.itemType} ${item.getId()}: pos=(${pos.x.toFixed(0)},${pos.y.toFixed(0)}) parent=${item.parent}`);
|
|
61820
|
+
}
|
|
61807
61821
|
this.selection.removeAll();
|
|
61808
61822
|
this.selection.add(items);
|
|
61809
61823
|
this.selection.setContext("EditUnderPointer");
|
|
@@ -61898,6 +61912,11 @@ class Board {
|
|
|
61898
61912
|
if (minY === Infinity) {
|
|
61899
61913
|
minY = 0;
|
|
61900
61914
|
}
|
|
61915
|
+
const dupOriginalTranslations = new Map;
|
|
61916
|
+
for (const itemId in itemsMap) {
|
|
61917
|
+
const t3 = itemsMap[itemId].transformation;
|
|
61918
|
+
dupOriginalTranslations.set(itemId, { tx: t3?.translateX ?? 0, ty: t3?.translateY ?? 0 });
|
|
61919
|
+
}
|
|
61901
61920
|
const mbr = this.selection.getMbr();
|
|
61902
61921
|
const selectedItems = this.selection.items.list();
|
|
61903
61922
|
const isSelectedItemsMinWidth = selectedItems.some((item) => item.getMbr().getWidth() === 0);
|
|
@@ -61927,9 +61946,9 @@ class Board {
|
|
|
61927
61946
|
}
|
|
61928
61947
|
} else if (dupChildItemIds.has(itemId)) {
|
|
61929
61948
|
const parentId = dupChildToParent.get(itemId);
|
|
61930
|
-
const
|
|
61931
|
-
const parentOrigTx =
|
|
61932
|
-
const parentOrigTy =
|
|
61949
|
+
const parentOrig = parentId ? dupOriginalTranslations.get(parentId) : undefined;
|
|
61950
|
+
const parentOrigTx = parentOrig?.tx ?? 0;
|
|
61951
|
+
const parentOrigTy = parentOrig?.ty ?? 0;
|
|
61933
61952
|
const parentNewTx = parentOrigTx - minX + right + width2;
|
|
61934
61953
|
const parentNewTy = parentOrigTy - minY + top;
|
|
61935
61954
|
if (itemData.transformation) {
|
package/dist/esm/index.js
CHANGED
|
@@ -61708,6 +61708,11 @@ class Board {
|
|
|
61708
61708
|
}
|
|
61709
61709
|
const { x, y } = this.pointer.point;
|
|
61710
61710
|
console.log("[paste] minX:", minX, "minY:", minY, "pointer:", x, y);
|
|
61711
|
+
const originalTranslations = new Map;
|
|
61712
|
+
for (const itemId in itemsMap) {
|
|
61713
|
+
const t3 = itemsMap[itemId].transformation;
|
|
61714
|
+
originalTranslations.set(itemId, { tx: t3?.translateX ?? 0, ty: t3?.translateY ?? 0 });
|
|
61715
|
+
}
|
|
61711
61716
|
const mediaStorageIds = [];
|
|
61712
61717
|
for (const itemId in itemsMap) {
|
|
61713
61718
|
const itemData = itemsMap[itemId];
|
|
@@ -61755,9 +61760,9 @@ class Board {
|
|
|
61755
61760
|
}
|
|
61756
61761
|
} else if (childItemIds.has(itemId)) {
|
|
61757
61762
|
const parentId = childToParent.get(itemId);
|
|
61758
|
-
const
|
|
61759
|
-
const parentOrigTx =
|
|
61760
|
-
const parentOrigTy =
|
|
61763
|
+
const parentOrig = parentId ? originalTranslations.get(parentId) : undefined;
|
|
61764
|
+
const parentOrigTx = parentOrig?.tx ?? 0;
|
|
61765
|
+
const parentOrigTy = parentOrig?.ty ?? 0;
|
|
61761
61766
|
const parentNewTx = parentOrigTx - minX + x;
|
|
61762
61767
|
const parentNewTy = parentOrigTy - minY + y;
|
|
61763
61768
|
const newChildTx = parentNewTx + translateX;
|
|
@@ -61796,7 +61801,16 @@ class Board {
|
|
|
61796
61801
|
select: select2
|
|
61797
61802
|
});
|
|
61798
61803
|
const items = Object.keys(newMap).map((id) => this.items.getById(id)).filter((item) => typeof item !== "undefined");
|
|
61804
|
+
for (const item of items) {
|
|
61805
|
+
const mbr = item.getMbr();
|
|
61806
|
+
const pos = item.transformation.getTranslation();
|
|
61807
|
+
console.log(`[nest-pre] ${item.itemType} ${item.getId()}: pos=(${pos.x.toFixed(0)},${pos.y.toFixed(0)}) mbr=(${mbr.left.toFixed(0)},${mbr.top.toFixed(0)},${mbr.right.toFixed(0)},${mbr.bottom.toFixed(0)}) parent=${item.parent}`);
|
|
61808
|
+
}
|
|
61799
61809
|
this.handleNesting(items);
|
|
61810
|
+
for (const item of items) {
|
|
61811
|
+
const pos = item.transformation.getTranslation();
|
|
61812
|
+
console.log(`[nest-post] ${item.itemType} ${item.getId()}: pos=(${pos.x.toFixed(0)},${pos.y.toFixed(0)}) parent=${item.parent}`);
|
|
61813
|
+
}
|
|
61800
61814
|
this.selection.removeAll();
|
|
61801
61815
|
this.selection.add(items);
|
|
61802
61816
|
this.selection.setContext("EditUnderPointer");
|
|
@@ -61891,6 +61905,11 @@ class Board {
|
|
|
61891
61905
|
if (minY === Infinity) {
|
|
61892
61906
|
minY = 0;
|
|
61893
61907
|
}
|
|
61908
|
+
const dupOriginalTranslations = new Map;
|
|
61909
|
+
for (const itemId in itemsMap) {
|
|
61910
|
+
const t3 = itemsMap[itemId].transformation;
|
|
61911
|
+
dupOriginalTranslations.set(itemId, { tx: t3?.translateX ?? 0, ty: t3?.translateY ?? 0 });
|
|
61912
|
+
}
|
|
61894
61913
|
const mbr = this.selection.getMbr();
|
|
61895
61914
|
const selectedItems = this.selection.items.list();
|
|
61896
61915
|
const isSelectedItemsMinWidth = selectedItems.some((item) => item.getMbr().getWidth() === 0);
|
|
@@ -61920,9 +61939,9 @@ class Board {
|
|
|
61920
61939
|
}
|
|
61921
61940
|
} else if (dupChildItemIds.has(itemId)) {
|
|
61922
61941
|
const parentId = dupChildToParent.get(itemId);
|
|
61923
|
-
const
|
|
61924
|
-
const parentOrigTx =
|
|
61925
|
-
const parentOrigTy =
|
|
61942
|
+
const parentOrig = parentId ? dupOriginalTranslations.get(parentId) : undefined;
|
|
61943
|
+
const parentOrigTx = parentOrig?.tx ?? 0;
|
|
61944
|
+
const parentOrigTy = parentOrig?.ty ?? 0;
|
|
61926
61945
|
const parentNewTx = parentOrigTx - minX + right + width2;
|
|
61927
61946
|
const parentNewTy = parentOrigTy - minY + top;
|
|
61928
61947
|
if (itemData.transformation) {
|
package/dist/esm/node.js
CHANGED
|
@@ -64172,6 +64172,11 @@ class Board {
|
|
|
64172
64172
|
}
|
|
64173
64173
|
const { x, y } = this.pointer.point;
|
|
64174
64174
|
console.log("[paste] minX:", minX, "minY:", minY, "pointer:", x, y);
|
|
64175
|
+
const originalTranslations = new Map;
|
|
64176
|
+
for (const itemId in itemsMap) {
|
|
64177
|
+
const t3 = itemsMap[itemId].transformation;
|
|
64178
|
+
originalTranslations.set(itemId, { tx: t3?.translateX ?? 0, ty: t3?.translateY ?? 0 });
|
|
64179
|
+
}
|
|
64175
64180
|
const mediaStorageIds = [];
|
|
64176
64181
|
for (const itemId in itemsMap) {
|
|
64177
64182
|
const itemData = itemsMap[itemId];
|
|
@@ -64219,9 +64224,9 @@ class Board {
|
|
|
64219
64224
|
}
|
|
64220
64225
|
} else if (childItemIds.has(itemId)) {
|
|
64221
64226
|
const parentId = childToParent.get(itemId);
|
|
64222
|
-
const
|
|
64223
|
-
const parentOrigTx =
|
|
64224
|
-
const parentOrigTy =
|
|
64227
|
+
const parentOrig = parentId ? originalTranslations.get(parentId) : undefined;
|
|
64228
|
+
const parentOrigTx = parentOrig?.tx ?? 0;
|
|
64229
|
+
const parentOrigTy = parentOrig?.ty ?? 0;
|
|
64225
64230
|
const parentNewTx = parentOrigTx - minX + x;
|
|
64226
64231
|
const parentNewTy = parentOrigTy - minY + y;
|
|
64227
64232
|
const newChildTx = parentNewTx + translateX;
|
|
@@ -64260,7 +64265,16 @@ class Board {
|
|
|
64260
64265
|
select: select2
|
|
64261
64266
|
});
|
|
64262
64267
|
const items = Object.keys(newMap).map((id) => this.items.getById(id)).filter((item) => typeof item !== "undefined");
|
|
64268
|
+
for (const item of items) {
|
|
64269
|
+
const mbr = item.getMbr();
|
|
64270
|
+
const pos = item.transformation.getTranslation();
|
|
64271
|
+
console.log(`[nest-pre] ${item.itemType} ${item.getId()}: pos=(${pos.x.toFixed(0)},${pos.y.toFixed(0)}) mbr=(${mbr.left.toFixed(0)},${mbr.top.toFixed(0)},${mbr.right.toFixed(0)},${mbr.bottom.toFixed(0)}) parent=${item.parent}`);
|
|
64272
|
+
}
|
|
64263
64273
|
this.handleNesting(items);
|
|
64274
|
+
for (const item of items) {
|
|
64275
|
+
const pos = item.transformation.getTranslation();
|
|
64276
|
+
console.log(`[nest-post] ${item.itemType} ${item.getId()}: pos=(${pos.x.toFixed(0)},${pos.y.toFixed(0)}) parent=${item.parent}`);
|
|
64277
|
+
}
|
|
64264
64278
|
this.selection.removeAll();
|
|
64265
64279
|
this.selection.add(items);
|
|
64266
64280
|
this.selection.setContext("EditUnderPointer");
|
|
@@ -64355,6 +64369,11 @@ class Board {
|
|
|
64355
64369
|
if (minY === Infinity) {
|
|
64356
64370
|
minY = 0;
|
|
64357
64371
|
}
|
|
64372
|
+
const dupOriginalTranslations = new Map;
|
|
64373
|
+
for (const itemId in itemsMap) {
|
|
64374
|
+
const t3 = itemsMap[itemId].transformation;
|
|
64375
|
+
dupOriginalTranslations.set(itemId, { tx: t3?.translateX ?? 0, ty: t3?.translateY ?? 0 });
|
|
64376
|
+
}
|
|
64358
64377
|
const mbr = this.selection.getMbr();
|
|
64359
64378
|
const selectedItems = this.selection.items.list();
|
|
64360
64379
|
const isSelectedItemsMinWidth = selectedItems.some((item) => item.getMbr().getWidth() === 0);
|
|
@@ -64384,9 +64403,9 @@ class Board {
|
|
|
64384
64403
|
}
|
|
64385
64404
|
} else if (dupChildItemIds.has(itemId)) {
|
|
64386
64405
|
const parentId = dupChildToParent.get(itemId);
|
|
64387
|
-
const
|
|
64388
|
-
const parentOrigTx =
|
|
64389
|
-
const parentOrigTy =
|
|
64406
|
+
const parentOrig = parentId ? dupOriginalTranslations.get(parentId) : undefined;
|
|
64407
|
+
const parentOrigTx = parentOrig?.tx ?? 0;
|
|
64408
|
+
const parentOrigTy = parentOrig?.ty ?? 0;
|
|
64390
64409
|
const parentNewTx = parentOrigTx - minX + right + width2;
|
|
64391
64410
|
const parentNewTy = parentOrigTy - minY + top;
|
|
64392
64411
|
if (itemData.transformation) {
|