microboard-temp 0.12.7 → 0.12.9
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 +11 -10
- package/dist/cjs/index.js +11 -10
- package/dist/cjs/node.js +11 -10
- package/dist/esm/browser.js +11 -10
- package/dist/esm/index.js +11 -10
- package/dist/esm/node.js +11 -10
- package/package.json +1 -1
package/dist/cjs/browser.js
CHANGED
|
@@ -22151,7 +22151,7 @@ class BaseItem extends Mbr {
|
|
|
22151
22151
|
if (!this.isHoverHighlighted) {
|
|
22152
22152
|
return;
|
|
22153
22153
|
}
|
|
22154
|
-
const mbr = this.
|
|
22154
|
+
const mbr = this.getWorldMbr();
|
|
22155
22155
|
mbr.strokeWidth = 2 / context.matrix.scaleX;
|
|
22156
22156
|
mbr.borderColor = BaseItem.HOVER_HIGHLIGHT_COLOR;
|
|
22157
22157
|
mbr.render(context);
|
|
@@ -46064,8 +46064,9 @@ function getQuickAddButtons(selection, board) {
|
|
|
46064
46064
|
let quickAddItems = undefined;
|
|
46065
46065
|
function calculateQuickAddPosition(index2, selectedItem, connectorStartPoint) {
|
|
46066
46066
|
const connectorStorage = new SessionStorage;
|
|
46067
|
-
const currMbr = selectedItem.getPathMbr();
|
|
46067
|
+
const currMbr = selectedItem instanceof BaseItem ? selectedItem.getWorldMbr() : selectedItem.getPathMbr();
|
|
46068
46068
|
const selectedItemData = selectedItem.serialize();
|
|
46069
|
+
const selectedMatrix = selectedItem instanceof BaseItem ? selectedItem.getWorldMatrix() : new Matrix(selectedItemData.transformation?.translateX || 0, selectedItemData.transformation?.translateY || 0);
|
|
46069
46070
|
const width2 = currMbr.getWidth();
|
|
46070
46071
|
const height3 = currMbr.getHeight();
|
|
46071
46072
|
let offsetX = width2;
|
|
@@ -46105,8 +46106,8 @@ function getQuickAddButtons(selection, board) {
|
|
|
46105
46106
|
const adjustment = baseAdjustments[index2];
|
|
46106
46107
|
const newItemData = { ...itemData };
|
|
46107
46108
|
if (newItemData.transformation) {
|
|
46108
|
-
newItemData.transformation.translateX = adjustment.translateX +
|
|
46109
|
-
newItemData.transformation.translateY = adjustment.translateY +
|
|
46109
|
+
newItemData.transformation.translateX = adjustment.translateX + selectedMatrix.translateX;
|
|
46110
|
+
newItemData.transformation.translateY = adjustment.translateY + selectedMatrix.translateY + height3 / 2 - newHeight / 2;
|
|
46110
46111
|
}
|
|
46111
46112
|
const newMbr = new Mbr(newItemData.transformation?.translateX, newItemData.transformation?.translateY, (newItemData.transformation?.translateX || 0) + newWidth, (newItemData.transformation?.translateY || 0) + newHeight);
|
|
46112
46113
|
let step = 1;
|
|
@@ -46197,7 +46198,7 @@ function getQuickAddButtons(selection, board) {
|
|
|
46197
46198
|
}
|
|
46198
46199
|
function getQuickButtonsPositions(customMbr) {
|
|
46199
46200
|
const single = selection.items.getSingle();
|
|
46200
|
-
const itemMbr = customMbr ? customMbr : single?.getMbr();
|
|
46201
|
+
const itemMbr = customMbr ? customMbr : single instanceof BaseItem ? single.getWorldMbr() : single?.getMbr();
|
|
46201
46202
|
if (!itemMbr || single?.itemType !== "Sticker" && single?.itemType !== "Shape" && single?.itemType !== "AINode" && single?.itemType !== "RichText") {
|
|
46202
46203
|
return;
|
|
46203
46204
|
}
|
|
@@ -53724,9 +53725,9 @@ class BoardSelection {
|
|
|
53724
53725
|
}
|
|
53725
53726
|
const selectedMbr = selected.reduce((acc, item) => {
|
|
53726
53727
|
if (!acc) {
|
|
53727
|
-
return item.getMbr();
|
|
53728
|
+
return item instanceof BaseItem ? item.getWorldMbr() : item.getMbr();
|
|
53728
53729
|
}
|
|
53729
|
-
return acc.combine(item.getMbr());
|
|
53730
|
+
return acc.combine(item instanceof BaseItem ? item.getWorldMbr() : item.getMbr());
|
|
53730
53731
|
}, undefined);
|
|
53731
53732
|
if (selectedMbr) {
|
|
53732
53733
|
const selectedMap = Object.fromEntries(selected.map((item) => [item.getId(), { item, nested: false }]));
|
|
@@ -53758,7 +53759,7 @@ class BoardSelection {
|
|
|
53758
53759
|
const childrenIds = val.item.getChildrenIds();
|
|
53759
53760
|
if (childrenIds) {
|
|
53760
53761
|
const currGroup = val.item;
|
|
53761
|
-
const currMbr = currGroup.
|
|
53762
|
+
const currMbr = currGroup.getWorldMbr();
|
|
53762
53763
|
const children = childrenIds.map((childId) => this.board.items.getById(childId)).filter((item) => !!item);
|
|
53763
53764
|
const underGroup = this.board.items.getEnclosedOrCrossed(currMbr.left, currMbr.top, currMbr.right, currMbr.bottom).filter((item) => item.parent === "Board" || item.parent === currGroup.getId());
|
|
53764
53765
|
const uniqueItems = new Set;
|
|
@@ -54239,7 +54240,7 @@ class BoardSelection {
|
|
|
54239
54240
|
};
|
|
54240
54241
|
}
|
|
54241
54242
|
renderItemMbr(context, item, customScale) {
|
|
54242
|
-
const mbr = item.getMbr();
|
|
54243
|
+
const mbr = item instanceof BaseItem ? item.getWorldMbr() : item.getMbr();
|
|
54243
54244
|
mbr.strokeWidth = !customScale ? 1 / context.matrix.scaleX : 1 / customScale;
|
|
54244
54245
|
const selectionColor = item.transformation.isLocked ? conf.SELECTION_LOCKED_COLOR : conf.SELECTION_COLOR;
|
|
54245
54246
|
mbr.borderColor = selectionColor;
|
|
@@ -54296,7 +54297,7 @@ class BoardSelection {
|
|
|
54296
54297
|
path2.setBackgroundColor("none");
|
|
54297
54298
|
path2.render(context);
|
|
54298
54299
|
} else {
|
|
54299
|
-
const itemRect = item.getMbr();
|
|
54300
|
+
const itemRect = item instanceof BaseItem ? item.getWorldMbr() : item.getMbr();
|
|
54300
54301
|
itemRect.borderColor = CONTEXT_NODE_HIGHLIGHT_COLOR;
|
|
54301
54302
|
itemRect.strokeWidth = 2;
|
|
54302
54303
|
itemRect.render(context);
|
package/dist/cjs/index.js
CHANGED
|
@@ -22151,7 +22151,7 @@ class BaseItem extends Mbr {
|
|
|
22151
22151
|
if (!this.isHoverHighlighted) {
|
|
22152
22152
|
return;
|
|
22153
22153
|
}
|
|
22154
|
-
const mbr = this.
|
|
22154
|
+
const mbr = this.getWorldMbr();
|
|
22155
22155
|
mbr.strokeWidth = 2 / context.matrix.scaleX;
|
|
22156
22156
|
mbr.borderColor = BaseItem.HOVER_HIGHLIGHT_COLOR;
|
|
22157
22157
|
mbr.render(context);
|
|
@@ -46064,8 +46064,9 @@ function getQuickAddButtons(selection, board) {
|
|
|
46064
46064
|
let quickAddItems = undefined;
|
|
46065
46065
|
function calculateQuickAddPosition(index2, selectedItem, connectorStartPoint) {
|
|
46066
46066
|
const connectorStorage = new SessionStorage;
|
|
46067
|
-
const currMbr = selectedItem.getPathMbr();
|
|
46067
|
+
const currMbr = selectedItem instanceof BaseItem ? selectedItem.getWorldMbr() : selectedItem.getPathMbr();
|
|
46068
46068
|
const selectedItemData = selectedItem.serialize();
|
|
46069
|
+
const selectedMatrix = selectedItem instanceof BaseItem ? selectedItem.getWorldMatrix() : new Matrix(selectedItemData.transformation?.translateX || 0, selectedItemData.transformation?.translateY || 0);
|
|
46069
46070
|
const width2 = currMbr.getWidth();
|
|
46070
46071
|
const height3 = currMbr.getHeight();
|
|
46071
46072
|
let offsetX = width2;
|
|
@@ -46105,8 +46106,8 @@ function getQuickAddButtons(selection, board) {
|
|
|
46105
46106
|
const adjustment = baseAdjustments[index2];
|
|
46106
46107
|
const newItemData = { ...itemData };
|
|
46107
46108
|
if (newItemData.transformation) {
|
|
46108
|
-
newItemData.transformation.translateX = adjustment.translateX +
|
|
46109
|
-
newItemData.transformation.translateY = adjustment.translateY +
|
|
46109
|
+
newItemData.transformation.translateX = adjustment.translateX + selectedMatrix.translateX;
|
|
46110
|
+
newItemData.transformation.translateY = adjustment.translateY + selectedMatrix.translateY + height3 / 2 - newHeight / 2;
|
|
46110
46111
|
}
|
|
46111
46112
|
const newMbr = new Mbr(newItemData.transformation?.translateX, newItemData.transformation?.translateY, (newItemData.transformation?.translateX || 0) + newWidth, (newItemData.transformation?.translateY || 0) + newHeight);
|
|
46112
46113
|
let step = 1;
|
|
@@ -46197,7 +46198,7 @@ function getQuickAddButtons(selection, board) {
|
|
|
46197
46198
|
}
|
|
46198
46199
|
function getQuickButtonsPositions(customMbr) {
|
|
46199
46200
|
const single = selection.items.getSingle();
|
|
46200
|
-
const itemMbr = customMbr ? customMbr : single?.getMbr();
|
|
46201
|
+
const itemMbr = customMbr ? customMbr : single instanceof BaseItem ? single.getWorldMbr() : single?.getMbr();
|
|
46201
46202
|
if (!itemMbr || single?.itemType !== "Sticker" && single?.itemType !== "Shape" && single?.itemType !== "AINode" && single?.itemType !== "RichText") {
|
|
46202
46203
|
return;
|
|
46203
46204
|
}
|
|
@@ -53724,9 +53725,9 @@ class BoardSelection {
|
|
|
53724
53725
|
}
|
|
53725
53726
|
const selectedMbr = selected.reduce((acc, item) => {
|
|
53726
53727
|
if (!acc) {
|
|
53727
|
-
return item.getMbr();
|
|
53728
|
+
return item instanceof BaseItem ? item.getWorldMbr() : item.getMbr();
|
|
53728
53729
|
}
|
|
53729
|
-
return acc.combine(item.getMbr());
|
|
53730
|
+
return acc.combine(item instanceof BaseItem ? item.getWorldMbr() : item.getMbr());
|
|
53730
53731
|
}, undefined);
|
|
53731
53732
|
if (selectedMbr) {
|
|
53732
53733
|
const selectedMap = Object.fromEntries(selected.map((item) => [item.getId(), { item, nested: false }]));
|
|
@@ -53758,7 +53759,7 @@ class BoardSelection {
|
|
|
53758
53759
|
const childrenIds = val.item.getChildrenIds();
|
|
53759
53760
|
if (childrenIds) {
|
|
53760
53761
|
const currGroup = val.item;
|
|
53761
|
-
const currMbr = currGroup.
|
|
53762
|
+
const currMbr = currGroup.getWorldMbr();
|
|
53762
53763
|
const children = childrenIds.map((childId) => this.board.items.getById(childId)).filter((item) => !!item);
|
|
53763
53764
|
const underGroup = this.board.items.getEnclosedOrCrossed(currMbr.left, currMbr.top, currMbr.right, currMbr.bottom).filter((item) => item.parent === "Board" || item.parent === currGroup.getId());
|
|
53764
53765
|
const uniqueItems = new Set;
|
|
@@ -54239,7 +54240,7 @@ class BoardSelection {
|
|
|
54239
54240
|
};
|
|
54240
54241
|
}
|
|
54241
54242
|
renderItemMbr(context, item, customScale) {
|
|
54242
|
-
const mbr = item.getMbr();
|
|
54243
|
+
const mbr = item instanceof BaseItem ? item.getWorldMbr() : item.getMbr();
|
|
54243
54244
|
mbr.strokeWidth = !customScale ? 1 / context.matrix.scaleX : 1 / customScale;
|
|
54244
54245
|
const selectionColor = item.transformation.isLocked ? conf.SELECTION_LOCKED_COLOR : conf.SELECTION_COLOR;
|
|
54245
54246
|
mbr.borderColor = selectionColor;
|
|
@@ -54296,7 +54297,7 @@ class BoardSelection {
|
|
|
54296
54297
|
path2.setBackgroundColor("none");
|
|
54297
54298
|
path2.render(context);
|
|
54298
54299
|
} else {
|
|
54299
|
-
const itemRect = item.getMbr();
|
|
54300
|
+
const itemRect = item instanceof BaseItem ? item.getWorldMbr() : item.getMbr();
|
|
54300
54301
|
itemRect.borderColor = CONTEXT_NODE_HIGHLIGHT_COLOR;
|
|
54301
54302
|
itemRect.strokeWidth = 2;
|
|
54302
54303
|
itemRect.render(context);
|
package/dist/cjs/node.js
CHANGED
|
@@ -24623,7 +24623,7 @@ class BaseItem extends Mbr {
|
|
|
24623
24623
|
if (!this.isHoverHighlighted) {
|
|
24624
24624
|
return;
|
|
24625
24625
|
}
|
|
24626
|
-
const mbr = this.
|
|
24626
|
+
const mbr = this.getWorldMbr();
|
|
24627
24627
|
mbr.strokeWidth = 2 / context.matrix.scaleX;
|
|
24628
24628
|
mbr.borderColor = BaseItem.HOVER_HIGHLIGHT_COLOR;
|
|
24629
24629
|
mbr.render(context);
|
|
@@ -48537,8 +48537,9 @@ function getQuickAddButtons(selection, board) {
|
|
|
48537
48537
|
let quickAddItems = undefined;
|
|
48538
48538
|
function calculateQuickAddPosition(index2, selectedItem, connectorStartPoint) {
|
|
48539
48539
|
const connectorStorage = new SessionStorage;
|
|
48540
|
-
const currMbr = selectedItem.getPathMbr();
|
|
48540
|
+
const currMbr = selectedItem instanceof BaseItem ? selectedItem.getWorldMbr() : selectedItem.getPathMbr();
|
|
48541
48541
|
const selectedItemData = selectedItem.serialize();
|
|
48542
|
+
const selectedMatrix = selectedItem instanceof BaseItem ? selectedItem.getWorldMatrix() : new Matrix(selectedItemData.transformation?.translateX || 0, selectedItemData.transformation?.translateY || 0);
|
|
48542
48543
|
const width2 = currMbr.getWidth();
|
|
48543
48544
|
const height3 = currMbr.getHeight();
|
|
48544
48545
|
let offsetX = width2;
|
|
@@ -48578,8 +48579,8 @@ function getQuickAddButtons(selection, board) {
|
|
|
48578
48579
|
const adjustment = baseAdjustments[index2];
|
|
48579
48580
|
const newItemData = { ...itemData };
|
|
48580
48581
|
if (newItemData.transformation) {
|
|
48581
|
-
newItemData.transformation.translateX = adjustment.translateX +
|
|
48582
|
-
newItemData.transformation.translateY = adjustment.translateY +
|
|
48582
|
+
newItemData.transformation.translateX = adjustment.translateX + selectedMatrix.translateX;
|
|
48583
|
+
newItemData.transformation.translateY = adjustment.translateY + selectedMatrix.translateY + height3 / 2 - newHeight / 2;
|
|
48583
48584
|
}
|
|
48584
48585
|
const newMbr = new Mbr(newItemData.transformation?.translateX, newItemData.transformation?.translateY, (newItemData.transformation?.translateX || 0) + newWidth, (newItemData.transformation?.translateY || 0) + newHeight);
|
|
48585
48586
|
let step = 1;
|
|
@@ -48670,7 +48671,7 @@ function getQuickAddButtons(selection, board) {
|
|
|
48670
48671
|
}
|
|
48671
48672
|
function getQuickButtonsPositions(customMbr) {
|
|
48672
48673
|
const single = selection.items.getSingle();
|
|
48673
|
-
const itemMbr = customMbr ? customMbr : single?.getMbr();
|
|
48674
|
+
const itemMbr = customMbr ? customMbr : single instanceof BaseItem ? single.getWorldMbr() : single?.getMbr();
|
|
48674
48675
|
if (!itemMbr || single?.itemType !== "Sticker" && single?.itemType !== "Shape" && single?.itemType !== "AINode" && single?.itemType !== "RichText") {
|
|
48675
48676
|
return;
|
|
48676
48677
|
}
|
|
@@ -56197,9 +56198,9 @@ class BoardSelection {
|
|
|
56197
56198
|
}
|
|
56198
56199
|
const selectedMbr = selected.reduce((acc, item) => {
|
|
56199
56200
|
if (!acc) {
|
|
56200
|
-
return item.getMbr();
|
|
56201
|
+
return item instanceof BaseItem ? item.getWorldMbr() : item.getMbr();
|
|
56201
56202
|
}
|
|
56202
|
-
return acc.combine(item.getMbr());
|
|
56203
|
+
return acc.combine(item instanceof BaseItem ? item.getWorldMbr() : item.getMbr());
|
|
56203
56204
|
}, undefined);
|
|
56204
56205
|
if (selectedMbr) {
|
|
56205
56206
|
const selectedMap = Object.fromEntries(selected.map((item) => [item.getId(), { item, nested: false }]));
|
|
@@ -56231,7 +56232,7 @@ class BoardSelection {
|
|
|
56231
56232
|
const childrenIds = val.item.getChildrenIds();
|
|
56232
56233
|
if (childrenIds) {
|
|
56233
56234
|
const currGroup = val.item;
|
|
56234
|
-
const currMbr = currGroup.
|
|
56235
|
+
const currMbr = currGroup.getWorldMbr();
|
|
56235
56236
|
const children = childrenIds.map((childId) => this.board.items.getById(childId)).filter((item) => !!item);
|
|
56236
56237
|
const underGroup = this.board.items.getEnclosedOrCrossed(currMbr.left, currMbr.top, currMbr.right, currMbr.bottom).filter((item) => item.parent === "Board" || item.parent === currGroup.getId());
|
|
56237
56238
|
const uniqueItems = new Set;
|
|
@@ -56712,7 +56713,7 @@ class BoardSelection {
|
|
|
56712
56713
|
};
|
|
56713
56714
|
}
|
|
56714
56715
|
renderItemMbr(context, item, customScale) {
|
|
56715
|
-
const mbr = item.getMbr();
|
|
56716
|
+
const mbr = item instanceof BaseItem ? item.getWorldMbr() : item.getMbr();
|
|
56716
56717
|
mbr.strokeWidth = !customScale ? 1 / context.matrix.scaleX : 1 / customScale;
|
|
56717
56718
|
const selectionColor = item.transformation.isLocked ? conf.SELECTION_LOCKED_COLOR : conf.SELECTION_COLOR;
|
|
56718
56719
|
mbr.borderColor = selectionColor;
|
|
@@ -56769,7 +56770,7 @@ class BoardSelection {
|
|
|
56769
56770
|
path2.setBackgroundColor("none");
|
|
56770
56771
|
path2.render(context);
|
|
56771
56772
|
} else {
|
|
56772
|
-
const itemRect = item.getMbr();
|
|
56773
|
+
const itemRect = item instanceof BaseItem ? item.getWorldMbr() : item.getMbr();
|
|
56773
56774
|
itemRect.borderColor = CONTEXT_NODE_HIGHLIGHT_COLOR;
|
|
56774
56775
|
itemRect.strokeWidth = 2;
|
|
56775
56776
|
itemRect.render(context);
|
package/dist/esm/browser.js
CHANGED
|
@@ -21980,7 +21980,7 @@ class BaseItem extends Mbr {
|
|
|
21980
21980
|
if (!this.isHoverHighlighted) {
|
|
21981
21981
|
return;
|
|
21982
21982
|
}
|
|
21983
|
-
const mbr = this.
|
|
21983
|
+
const mbr = this.getWorldMbr();
|
|
21984
21984
|
mbr.strokeWidth = 2 / context.matrix.scaleX;
|
|
21985
21985
|
mbr.borderColor = BaseItem.HOVER_HIGHLIGHT_COLOR;
|
|
21986
21986
|
mbr.render(context);
|
|
@@ -45893,8 +45893,9 @@ function getQuickAddButtons(selection, board) {
|
|
|
45893
45893
|
let quickAddItems = undefined;
|
|
45894
45894
|
function calculateQuickAddPosition(index2, selectedItem, connectorStartPoint) {
|
|
45895
45895
|
const connectorStorage = new SessionStorage;
|
|
45896
|
-
const currMbr = selectedItem.getPathMbr();
|
|
45896
|
+
const currMbr = selectedItem instanceof BaseItem ? selectedItem.getWorldMbr() : selectedItem.getPathMbr();
|
|
45897
45897
|
const selectedItemData = selectedItem.serialize();
|
|
45898
|
+
const selectedMatrix = selectedItem instanceof BaseItem ? selectedItem.getWorldMatrix() : new Matrix(selectedItemData.transformation?.translateX || 0, selectedItemData.transformation?.translateY || 0);
|
|
45898
45899
|
const width2 = currMbr.getWidth();
|
|
45899
45900
|
const height3 = currMbr.getHeight();
|
|
45900
45901
|
let offsetX = width2;
|
|
@@ -45934,8 +45935,8 @@ function getQuickAddButtons(selection, board) {
|
|
|
45934
45935
|
const adjustment = baseAdjustments[index2];
|
|
45935
45936
|
const newItemData = { ...itemData };
|
|
45936
45937
|
if (newItemData.transformation) {
|
|
45937
|
-
newItemData.transformation.translateX = adjustment.translateX +
|
|
45938
|
-
newItemData.transformation.translateY = adjustment.translateY +
|
|
45938
|
+
newItemData.transformation.translateX = adjustment.translateX + selectedMatrix.translateX;
|
|
45939
|
+
newItemData.transformation.translateY = adjustment.translateY + selectedMatrix.translateY + height3 / 2 - newHeight / 2;
|
|
45939
45940
|
}
|
|
45940
45941
|
const newMbr = new Mbr(newItemData.transformation?.translateX, newItemData.transformation?.translateY, (newItemData.transformation?.translateX || 0) + newWidth, (newItemData.transformation?.translateY || 0) + newHeight);
|
|
45941
45942
|
let step = 1;
|
|
@@ -46026,7 +46027,7 @@ function getQuickAddButtons(selection, board) {
|
|
|
46026
46027
|
}
|
|
46027
46028
|
function getQuickButtonsPositions(customMbr) {
|
|
46028
46029
|
const single = selection.items.getSingle();
|
|
46029
|
-
const itemMbr = customMbr ? customMbr : single?.getMbr();
|
|
46030
|
+
const itemMbr = customMbr ? customMbr : single instanceof BaseItem ? single.getWorldMbr() : single?.getMbr();
|
|
46030
46031
|
if (!itemMbr || single?.itemType !== "Sticker" && single?.itemType !== "Shape" && single?.itemType !== "AINode" && single?.itemType !== "RichText") {
|
|
46031
46032
|
return;
|
|
46032
46033
|
}
|
|
@@ -53553,9 +53554,9 @@ class BoardSelection {
|
|
|
53553
53554
|
}
|
|
53554
53555
|
const selectedMbr = selected.reduce((acc, item) => {
|
|
53555
53556
|
if (!acc) {
|
|
53556
|
-
return item.getMbr();
|
|
53557
|
+
return item instanceof BaseItem ? item.getWorldMbr() : item.getMbr();
|
|
53557
53558
|
}
|
|
53558
|
-
return acc.combine(item.getMbr());
|
|
53559
|
+
return acc.combine(item instanceof BaseItem ? item.getWorldMbr() : item.getMbr());
|
|
53559
53560
|
}, undefined);
|
|
53560
53561
|
if (selectedMbr) {
|
|
53561
53562
|
const selectedMap = Object.fromEntries(selected.map((item) => [item.getId(), { item, nested: false }]));
|
|
@@ -53587,7 +53588,7 @@ class BoardSelection {
|
|
|
53587
53588
|
const childrenIds = val.item.getChildrenIds();
|
|
53588
53589
|
if (childrenIds) {
|
|
53589
53590
|
const currGroup = val.item;
|
|
53590
|
-
const currMbr = currGroup.
|
|
53591
|
+
const currMbr = currGroup.getWorldMbr();
|
|
53591
53592
|
const children = childrenIds.map((childId) => this.board.items.getById(childId)).filter((item) => !!item);
|
|
53592
53593
|
const underGroup = this.board.items.getEnclosedOrCrossed(currMbr.left, currMbr.top, currMbr.right, currMbr.bottom).filter((item) => item.parent === "Board" || item.parent === currGroup.getId());
|
|
53593
53594
|
const uniqueItems = new Set;
|
|
@@ -54068,7 +54069,7 @@ class BoardSelection {
|
|
|
54068
54069
|
};
|
|
54069
54070
|
}
|
|
54070
54071
|
renderItemMbr(context, item, customScale) {
|
|
54071
|
-
const mbr = item.getMbr();
|
|
54072
|
+
const mbr = item instanceof BaseItem ? item.getWorldMbr() : item.getMbr();
|
|
54072
54073
|
mbr.strokeWidth = !customScale ? 1 / context.matrix.scaleX : 1 / customScale;
|
|
54073
54074
|
const selectionColor = item.transformation.isLocked ? conf.SELECTION_LOCKED_COLOR : conf.SELECTION_COLOR;
|
|
54074
54075
|
mbr.borderColor = selectionColor;
|
|
@@ -54125,7 +54126,7 @@ class BoardSelection {
|
|
|
54125
54126
|
path2.setBackgroundColor("none");
|
|
54126
54127
|
path2.render(context);
|
|
54127
54128
|
} else {
|
|
54128
|
-
const itemRect = item.getMbr();
|
|
54129
|
+
const itemRect = item instanceof BaseItem ? item.getWorldMbr() : item.getMbr();
|
|
54129
54130
|
itemRect.borderColor = CONTEXT_NODE_HIGHLIGHT_COLOR;
|
|
54130
54131
|
itemRect.strokeWidth = 2;
|
|
54131
54132
|
itemRect.render(context);
|
package/dist/esm/index.js
CHANGED
|
@@ -21973,7 +21973,7 @@ class BaseItem extends Mbr {
|
|
|
21973
21973
|
if (!this.isHoverHighlighted) {
|
|
21974
21974
|
return;
|
|
21975
21975
|
}
|
|
21976
|
-
const mbr = this.
|
|
21976
|
+
const mbr = this.getWorldMbr();
|
|
21977
21977
|
mbr.strokeWidth = 2 / context.matrix.scaleX;
|
|
21978
21978
|
mbr.borderColor = BaseItem.HOVER_HIGHLIGHT_COLOR;
|
|
21979
21979
|
mbr.render(context);
|
|
@@ -45886,8 +45886,9 @@ function getQuickAddButtons(selection, board) {
|
|
|
45886
45886
|
let quickAddItems = undefined;
|
|
45887
45887
|
function calculateQuickAddPosition(index2, selectedItem, connectorStartPoint) {
|
|
45888
45888
|
const connectorStorage = new SessionStorage;
|
|
45889
|
-
const currMbr = selectedItem.getPathMbr();
|
|
45889
|
+
const currMbr = selectedItem instanceof BaseItem ? selectedItem.getWorldMbr() : selectedItem.getPathMbr();
|
|
45890
45890
|
const selectedItemData = selectedItem.serialize();
|
|
45891
|
+
const selectedMatrix = selectedItem instanceof BaseItem ? selectedItem.getWorldMatrix() : new Matrix(selectedItemData.transformation?.translateX || 0, selectedItemData.transformation?.translateY || 0);
|
|
45891
45892
|
const width2 = currMbr.getWidth();
|
|
45892
45893
|
const height3 = currMbr.getHeight();
|
|
45893
45894
|
let offsetX = width2;
|
|
@@ -45927,8 +45928,8 @@ function getQuickAddButtons(selection, board) {
|
|
|
45927
45928
|
const adjustment = baseAdjustments[index2];
|
|
45928
45929
|
const newItemData = { ...itemData };
|
|
45929
45930
|
if (newItemData.transformation) {
|
|
45930
|
-
newItemData.transformation.translateX = adjustment.translateX +
|
|
45931
|
-
newItemData.transformation.translateY = adjustment.translateY +
|
|
45931
|
+
newItemData.transformation.translateX = adjustment.translateX + selectedMatrix.translateX;
|
|
45932
|
+
newItemData.transformation.translateY = adjustment.translateY + selectedMatrix.translateY + height3 / 2 - newHeight / 2;
|
|
45932
45933
|
}
|
|
45933
45934
|
const newMbr = new Mbr(newItemData.transformation?.translateX, newItemData.transformation?.translateY, (newItemData.transformation?.translateX || 0) + newWidth, (newItemData.transformation?.translateY || 0) + newHeight);
|
|
45934
45935
|
let step = 1;
|
|
@@ -46019,7 +46020,7 @@ function getQuickAddButtons(selection, board) {
|
|
|
46019
46020
|
}
|
|
46020
46021
|
function getQuickButtonsPositions(customMbr) {
|
|
46021
46022
|
const single = selection.items.getSingle();
|
|
46022
|
-
const itemMbr = customMbr ? customMbr : single?.getMbr();
|
|
46023
|
+
const itemMbr = customMbr ? customMbr : single instanceof BaseItem ? single.getWorldMbr() : single?.getMbr();
|
|
46023
46024
|
if (!itemMbr || single?.itemType !== "Sticker" && single?.itemType !== "Shape" && single?.itemType !== "AINode" && single?.itemType !== "RichText") {
|
|
46024
46025
|
return;
|
|
46025
46026
|
}
|
|
@@ -53546,9 +53547,9 @@ class BoardSelection {
|
|
|
53546
53547
|
}
|
|
53547
53548
|
const selectedMbr = selected.reduce((acc, item) => {
|
|
53548
53549
|
if (!acc) {
|
|
53549
|
-
return item.getMbr();
|
|
53550
|
+
return item instanceof BaseItem ? item.getWorldMbr() : item.getMbr();
|
|
53550
53551
|
}
|
|
53551
|
-
return acc.combine(item.getMbr());
|
|
53552
|
+
return acc.combine(item instanceof BaseItem ? item.getWorldMbr() : item.getMbr());
|
|
53552
53553
|
}, undefined);
|
|
53553
53554
|
if (selectedMbr) {
|
|
53554
53555
|
const selectedMap = Object.fromEntries(selected.map((item) => [item.getId(), { item, nested: false }]));
|
|
@@ -53580,7 +53581,7 @@ class BoardSelection {
|
|
|
53580
53581
|
const childrenIds = val.item.getChildrenIds();
|
|
53581
53582
|
if (childrenIds) {
|
|
53582
53583
|
const currGroup = val.item;
|
|
53583
|
-
const currMbr = currGroup.
|
|
53584
|
+
const currMbr = currGroup.getWorldMbr();
|
|
53584
53585
|
const children = childrenIds.map((childId) => this.board.items.getById(childId)).filter((item) => !!item);
|
|
53585
53586
|
const underGroup = this.board.items.getEnclosedOrCrossed(currMbr.left, currMbr.top, currMbr.right, currMbr.bottom).filter((item) => item.parent === "Board" || item.parent === currGroup.getId());
|
|
53586
53587
|
const uniqueItems = new Set;
|
|
@@ -54061,7 +54062,7 @@ class BoardSelection {
|
|
|
54061
54062
|
};
|
|
54062
54063
|
}
|
|
54063
54064
|
renderItemMbr(context, item, customScale) {
|
|
54064
|
-
const mbr = item.getMbr();
|
|
54065
|
+
const mbr = item instanceof BaseItem ? item.getWorldMbr() : item.getMbr();
|
|
54065
54066
|
mbr.strokeWidth = !customScale ? 1 / context.matrix.scaleX : 1 / customScale;
|
|
54066
54067
|
const selectionColor = item.transformation.isLocked ? conf.SELECTION_LOCKED_COLOR : conf.SELECTION_COLOR;
|
|
54067
54068
|
mbr.borderColor = selectionColor;
|
|
@@ -54118,7 +54119,7 @@ class BoardSelection {
|
|
|
54118
54119
|
path2.setBackgroundColor("none");
|
|
54119
54120
|
path2.render(context);
|
|
54120
54121
|
} else {
|
|
54121
|
-
const itemRect = item.getMbr();
|
|
54122
|
+
const itemRect = item instanceof BaseItem ? item.getWorldMbr() : item.getMbr();
|
|
54122
54123
|
itemRect.borderColor = CONTEXT_NODE_HIGHLIGHT_COLOR;
|
|
54123
54124
|
itemRect.strokeWidth = 2;
|
|
54124
54125
|
itemRect.render(context);
|
package/dist/esm/node.js
CHANGED
|
@@ -24440,7 +24440,7 @@ class BaseItem extends Mbr {
|
|
|
24440
24440
|
if (!this.isHoverHighlighted) {
|
|
24441
24441
|
return;
|
|
24442
24442
|
}
|
|
24443
|
-
const mbr = this.
|
|
24443
|
+
const mbr = this.getWorldMbr();
|
|
24444
24444
|
mbr.strokeWidth = 2 / context.matrix.scaleX;
|
|
24445
24445
|
mbr.borderColor = BaseItem.HOVER_HIGHLIGHT_COLOR;
|
|
24446
24446
|
mbr.render(context);
|
|
@@ -48354,8 +48354,9 @@ function getQuickAddButtons(selection, board) {
|
|
|
48354
48354
|
let quickAddItems = undefined;
|
|
48355
48355
|
function calculateQuickAddPosition(index2, selectedItem, connectorStartPoint) {
|
|
48356
48356
|
const connectorStorage = new SessionStorage;
|
|
48357
|
-
const currMbr = selectedItem.getPathMbr();
|
|
48357
|
+
const currMbr = selectedItem instanceof BaseItem ? selectedItem.getWorldMbr() : selectedItem.getPathMbr();
|
|
48358
48358
|
const selectedItemData = selectedItem.serialize();
|
|
48359
|
+
const selectedMatrix = selectedItem instanceof BaseItem ? selectedItem.getWorldMatrix() : new Matrix(selectedItemData.transformation?.translateX || 0, selectedItemData.transformation?.translateY || 0);
|
|
48359
48360
|
const width2 = currMbr.getWidth();
|
|
48360
48361
|
const height3 = currMbr.getHeight();
|
|
48361
48362
|
let offsetX = width2;
|
|
@@ -48395,8 +48396,8 @@ function getQuickAddButtons(selection, board) {
|
|
|
48395
48396
|
const adjustment = baseAdjustments[index2];
|
|
48396
48397
|
const newItemData = { ...itemData };
|
|
48397
48398
|
if (newItemData.transformation) {
|
|
48398
|
-
newItemData.transformation.translateX = adjustment.translateX +
|
|
48399
|
-
newItemData.transformation.translateY = adjustment.translateY +
|
|
48399
|
+
newItemData.transformation.translateX = adjustment.translateX + selectedMatrix.translateX;
|
|
48400
|
+
newItemData.transformation.translateY = adjustment.translateY + selectedMatrix.translateY + height3 / 2 - newHeight / 2;
|
|
48400
48401
|
}
|
|
48401
48402
|
const newMbr = new Mbr(newItemData.transformation?.translateX, newItemData.transformation?.translateY, (newItemData.transformation?.translateX || 0) + newWidth, (newItemData.transformation?.translateY || 0) + newHeight);
|
|
48402
48403
|
let step = 1;
|
|
@@ -48487,7 +48488,7 @@ function getQuickAddButtons(selection, board) {
|
|
|
48487
48488
|
}
|
|
48488
48489
|
function getQuickButtonsPositions(customMbr) {
|
|
48489
48490
|
const single = selection.items.getSingle();
|
|
48490
|
-
const itemMbr = customMbr ? customMbr : single?.getMbr();
|
|
48491
|
+
const itemMbr = customMbr ? customMbr : single instanceof BaseItem ? single.getWorldMbr() : single?.getMbr();
|
|
48491
48492
|
if (!itemMbr || single?.itemType !== "Sticker" && single?.itemType !== "Shape" && single?.itemType !== "AINode" && single?.itemType !== "RichText") {
|
|
48492
48493
|
return;
|
|
48493
48494
|
}
|
|
@@ -56014,9 +56015,9 @@ class BoardSelection {
|
|
|
56014
56015
|
}
|
|
56015
56016
|
const selectedMbr = selected.reduce((acc, item) => {
|
|
56016
56017
|
if (!acc) {
|
|
56017
|
-
return item.getMbr();
|
|
56018
|
+
return item instanceof BaseItem ? item.getWorldMbr() : item.getMbr();
|
|
56018
56019
|
}
|
|
56019
|
-
return acc.combine(item.getMbr());
|
|
56020
|
+
return acc.combine(item instanceof BaseItem ? item.getWorldMbr() : item.getMbr());
|
|
56020
56021
|
}, undefined);
|
|
56021
56022
|
if (selectedMbr) {
|
|
56022
56023
|
const selectedMap = Object.fromEntries(selected.map((item) => [item.getId(), { item, nested: false }]));
|
|
@@ -56048,7 +56049,7 @@ class BoardSelection {
|
|
|
56048
56049
|
const childrenIds = val.item.getChildrenIds();
|
|
56049
56050
|
if (childrenIds) {
|
|
56050
56051
|
const currGroup = val.item;
|
|
56051
|
-
const currMbr = currGroup.
|
|
56052
|
+
const currMbr = currGroup.getWorldMbr();
|
|
56052
56053
|
const children = childrenIds.map((childId) => this.board.items.getById(childId)).filter((item) => !!item);
|
|
56053
56054
|
const underGroup = this.board.items.getEnclosedOrCrossed(currMbr.left, currMbr.top, currMbr.right, currMbr.bottom).filter((item) => item.parent === "Board" || item.parent === currGroup.getId());
|
|
56054
56055
|
const uniqueItems = new Set;
|
|
@@ -56529,7 +56530,7 @@ class BoardSelection {
|
|
|
56529
56530
|
};
|
|
56530
56531
|
}
|
|
56531
56532
|
renderItemMbr(context, item, customScale) {
|
|
56532
|
-
const mbr = item.getMbr();
|
|
56533
|
+
const mbr = item instanceof BaseItem ? item.getWorldMbr() : item.getMbr();
|
|
56533
56534
|
mbr.strokeWidth = !customScale ? 1 / context.matrix.scaleX : 1 / customScale;
|
|
56534
56535
|
const selectionColor = item.transformation.isLocked ? conf.SELECTION_LOCKED_COLOR : conf.SELECTION_COLOR;
|
|
56535
56536
|
mbr.borderColor = selectionColor;
|
|
@@ -56586,7 +56587,7 @@ class BoardSelection {
|
|
|
56586
56587
|
path2.setBackgroundColor("none");
|
|
56587
56588
|
path2.render(context);
|
|
56588
56589
|
} else {
|
|
56589
|
-
const itemRect = item.getMbr();
|
|
56590
|
+
const itemRect = item instanceof BaseItem ? item.getWorldMbr() : item.getMbr();
|
|
56590
56591
|
itemRect.borderColor = CONTEXT_NODE_HIGHLIGHT_COLOR;
|
|
56591
56592
|
itemRect.strokeWidth = 2;
|
|
56592
56593
|
itemRect.render(context);
|