microboard-temp 0.13.62 → 0.13.64
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 +17 -5
- package/dist/cjs/index.js +17 -5
- package/dist/cjs/node.js +17 -5
- package/dist/esm/browser.js +17 -5
- package/dist/esm/index.js +17 -5
- package/dist/esm/node.js +17 -5
- package/package.json +1 -1
package/dist/cjs/browser.js
CHANGED
|
@@ -3624,7 +3624,7 @@ var init_Settings = __esm(() => {
|
|
|
3624
3624
|
measureCtx: undefined,
|
|
3625
3625
|
i18n: instance,
|
|
3626
3626
|
hooks: {
|
|
3627
|
-
beforeMediaUpload: async (...args) =>
|
|
3627
|
+
beforeMediaUpload: async (...args) => true,
|
|
3628
3628
|
beforeMediaRemove: async (...args) => false,
|
|
3629
3629
|
onUploadMediaError: async (...args) => false
|
|
3630
3630
|
},
|
|
@@ -51431,7 +51431,7 @@ function validateFrameData(data) {
|
|
|
51431
51431
|
return false;
|
|
51432
51432
|
}
|
|
51433
51433
|
const frameData = data;
|
|
51434
|
-
const isValid = frameData.hasOwnProperty("shapeType") && frameData.hasOwnProperty("backgroundColor") && frameData.hasOwnProperty("backgroundOpacity") && frameData.hasOwnProperty("borderColor") && frameData.hasOwnProperty("borderOpacity") && frameData.hasOwnProperty("borderStyle") && frameData.hasOwnProperty("borderWidth") && frameData.hasOwnProperty("transformation") && frameData.hasOwnProperty("text") && frameData.hasOwnProperty("children") && typeof frameData.shapeType === "string" && isColorValue(frameData.backgroundColor) && typeof frameData.backgroundOpacity === "number" && isColorValue(frameData.borderColor) && typeof frameData.borderOpacity === "number" && typeof frameData.borderStyle === "string" && typeof frameData.borderWidth === "number" && Array.isArray(frameData.children) && validateTransformationData(frameData.transformation) && validateRichTextData(frameData.text);
|
|
51434
|
+
const isValid = frameData.hasOwnProperty("shapeType") && frameData.hasOwnProperty("backgroundColor") && frameData.hasOwnProperty("backgroundOpacity") && frameData.hasOwnProperty("borderColor") && frameData.hasOwnProperty("borderOpacity") && frameData.hasOwnProperty("borderStyle") && frameData.hasOwnProperty("borderWidth") && frameData.hasOwnProperty("transformation") && frameData.hasOwnProperty("text") && (frameData.hasOwnProperty("childIds") || frameData.hasOwnProperty("children")) && typeof frameData.shapeType === "string" && isColorValue(frameData.backgroundColor) && typeof frameData.backgroundOpacity === "number" && isColorValue(frameData.borderColor) && typeof frameData.borderOpacity === "number" && typeof frameData.borderStyle === "string" && typeof frameData.borderWidth === "number" && (Array.isArray(frameData.childIds) || Array.isArray(frameData.children)) && validateTransformationData(frameData.transformation) && validateRichTextData(frameData.text);
|
|
51435
51435
|
return isValid;
|
|
51436
51436
|
}
|
|
51437
51437
|
function validateShapeData(shapeData) {
|
|
@@ -61928,9 +61928,19 @@ class Board {
|
|
|
61928
61928
|
}
|
|
61929
61929
|
}
|
|
61930
61930
|
const newMap = {};
|
|
61931
|
+
const childItemIds = new Set;
|
|
61932
|
+
for (const itemId in itemsMap) {
|
|
61933
|
+
const d = itemsMap[itemId];
|
|
61934
|
+
if (Array.isArray(d.childIds)) {
|
|
61935
|
+
for (const cid of d.childIds)
|
|
61936
|
+
childItemIds.add(cid);
|
|
61937
|
+
}
|
|
61938
|
+
}
|
|
61931
61939
|
let minX = Infinity;
|
|
61932
61940
|
let minY = Infinity;
|
|
61933
61941
|
for (const itemId in itemsMap) {
|
|
61942
|
+
if (childItemIds.has(itemId))
|
|
61943
|
+
continue;
|
|
61934
61944
|
const itemData = itemsMap[itemId];
|
|
61935
61945
|
const { translateX, translateY } = itemData.transformation || {
|
|
61936
61946
|
translateX: 0,
|
|
@@ -61980,7 +61990,7 @@ class Board {
|
|
|
61980
61990
|
itemData.middlePoint.x += -minX + x;
|
|
61981
61991
|
itemData.middlePoint.y += -minY + y;
|
|
61982
61992
|
}
|
|
61983
|
-
} else if (itemData.transformation) {
|
|
61993
|
+
} else if (itemData.transformation && !childItemIds.has(itemId)) {
|
|
61984
61994
|
itemData.transformation.translateX = translateX - minX + x;
|
|
61985
61995
|
itemData.transformation.translateY = translateY - minY + y;
|
|
61986
61996
|
}
|
|
@@ -62124,8 +62134,10 @@ class Board {
|
|
|
62124
62134
|
}
|
|
62125
62135
|
}
|
|
62126
62136
|
const itemDataWithChildren = itemData;
|
|
62127
|
-
if ("
|
|
62128
|
-
itemDataWithChildren.
|
|
62137
|
+
if ("childIds" in itemDataWithChildren && itemDataWithChildren.childIds?.length) {
|
|
62138
|
+
itemDataWithChildren.childIds = itemDataWithChildren.childIds.map((childId) => newItemIdMap[childId] || childId);
|
|
62139
|
+
} else if ("children" in itemDataWithChildren && itemDataWithChildren.children?.length) {
|
|
62140
|
+
itemDataWithChildren.children = itemDataWithChildren.children.map((childId) => newItemIdMap[childId] || childId);
|
|
62129
62141
|
}
|
|
62130
62142
|
newMap[newItemId] = itemData;
|
|
62131
62143
|
}
|
package/dist/cjs/index.js
CHANGED
|
@@ -3624,7 +3624,7 @@ var init_Settings = __esm(() => {
|
|
|
3624
3624
|
measureCtx: undefined,
|
|
3625
3625
|
i18n: instance,
|
|
3626
3626
|
hooks: {
|
|
3627
|
-
beforeMediaUpload: async (...args) =>
|
|
3627
|
+
beforeMediaUpload: async (...args) => true,
|
|
3628
3628
|
beforeMediaRemove: async (...args) => false,
|
|
3629
3629
|
onUploadMediaError: async (...args) => false
|
|
3630
3630
|
},
|
|
@@ -51431,7 +51431,7 @@ function validateFrameData(data) {
|
|
|
51431
51431
|
return false;
|
|
51432
51432
|
}
|
|
51433
51433
|
const frameData = data;
|
|
51434
|
-
const isValid = frameData.hasOwnProperty("shapeType") && frameData.hasOwnProperty("backgroundColor") && frameData.hasOwnProperty("backgroundOpacity") && frameData.hasOwnProperty("borderColor") && frameData.hasOwnProperty("borderOpacity") && frameData.hasOwnProperty("borderStyle") && frameData.hasOwnProperty("borderWidth") && frameData.hasOwnProperty("transformation") && frameData.hasOwnProperty("text") && frameData.hasOwnProperty("children") && typeof frameData.shapeType === "string" && isColorValue(frameData.backgroundColor) && typeof frameData.backgroundOpacity === "number" && isColorValue(frameData.borderColor) && typeof frameData.borderOpacity === "number" && typeof frameData.borderStyle === "string" && typeof frameData.borderWidth === "number" && Array.isArray(frameData.children) && validateTransformationData(frameData.transformation) && validateRichTextData(frameData.text);
|
|
51434
|
+
const isValid = frameData.hasOwnProperty("shapeType") && frameData.hasOwnProperty("backgroundColor") && frameData.hasOwnProperty("backgroundOpacity") && frameData.hasOwnProperty("borderColor") && frameData.hasOwnProperty("borderOpacity") && frameData.hasOwnProperty("borderStyle") && frameData.hasOwnProperty("borderWidth") && frameData.hasOwnProperty("transformation") && frameData.hasOwnProperty("text") && (frameData.hasOwnProperty("childIds") || frameData.hasOwnProperty("children")) && typeof frameData.shapeType === "string" && isColorValue(frameData.backgroundColor) && typeof frameData.backgroundOpacity === "number" && isColorValue(frameData.borderColor) && typeof frameData.borderOpacity === "number" && typeof frameData.borderStyle === "string" && typeof frameData.borderWidth === "number" && (Array.isArray(frameData.childIds) || Array.isArray(frameData.children)) && validateTransformationData(frameData.transformation) && validateRichTextData(frameData.text);
|
|
51435
51435
|
return isValid;
|
|
51436
51436
|
}
|
|
51437
51437
|
function validateShapeData(shapeData) {
|
|
@@ -61928,9 +61928,19 @@ class Board {
|
|
|
61928
61928
|
}
|
|
61929
61929
|
}
|
|
61930
61930
|
const newMap = {};
|
|
61931
|
+
const childItemIds = new Set;
|
|
61932
|
+
for (const itemId in itemsMap) {
|
|
61933
|
+
const d = itemsMap[itemId];
|
|
61934
|
+
if (Array.isArray(d.childIds)) {
|
|
61935
|
+
for (const cid of d.childIds)
|
|
61936
|
+
childItemIds.add(cid);
|
|
61937
|
+
}
|
|
61938
|
+
}
|
|
61931
61939
|
let minX = Infinity;
|
|
61932
61940
|
let minY = Infinity;
|
|
61933
61941
|
for (const itemId in itemsMap) {
|
|
61942
|
+
if (childItemIds.has(itemId))
|
|
61943
|
+
continue;
|
|
61934
61944
|
const itemData = itemsMap[itemId];
|
|
61935
61945
|
const { translateX, translateY } = itemData.transformation || {
|
|
61936
61946
|
translateX: 0,
|
|
@@ -61980,7 +61990,7 @@ class Board {
|
|
|
61980
61990
|
itemData.middlePoint.x += -minX + x;
|
|
61981
61991
|
itemData.middlePoint.y += -minY + y;
|
|
61982
61992
|
}
|
|
61983
|
-
} else if (itemData.transformation) {
|
|
61993
|
+
} else if (itemData.transformation && !childItemIds.has(itemId)) {
|
|
61984
61994
|
itemData.transformation.translateX = translateX - minX + x;
|
|
61985
61995
|
itemData.transformation.translateY = translateY - minY + y;
|
|
61986
61996
|
}
|
|
@@ -62124,8 +62134,10 @@ class Board {
|
|
|
62124
62134
|
}
|
|
62125
62135
|
}
|
|
62126
62136
|
const itemDataWithChildren = itemData;
|
|
62127
|
-
if ("
|
|
62128
|
-
itemDataWithChildren.
|
|
62137
|
+
if ("childIds" in itemDataWithChildren && itemDataWithChildren.childIds?.length) {
|
|
62138
|
+
itemDataWithChildren.childIds = itemDataWithChildren.childIds.map((childId) => newItemIdMap[childId] || childId);
|
|
62139
|
+
} else if ("children" in itemDataWithChildren && itemDataWithChildren.children?.length) {
|
|
62140
|
+
itemDataWithChildren.children = itemDataWithChildren.children.map((childId) => newItemIdMap[childId] || childId);
|
|
62129
62141
|
}
|
|
62130
62142
|
newMap[newItemId] = itemData;
|
|
62131
62143
|
}
|
package/dist/cjs/node.js
CHANGED
|
@@ -3624,7 +3624,7 @@ var init_Settings = __esm(() => {
|
|
|
3624
3624
|
measureCtx: undefined,
|
|
3625
3625
|
i18n: instance,
|
|
3626
3626
|
hooks: {
|
|
3627
|
-
beforeMediaUpload: async (...args) =>
|
|
3627
|
+
beforeMediaUpload: async (...args) => true,
|
|
3628
3628
|
beforeMediaRemove: async (...args) => false,
|
|
3629
3629
|
onUploadMediaError: async (...args) => false
|
|
3630
3630
|
},
|
|
@@ -53851,7 +53851,7 @@ function validateFrameData(data) {
|
|
|
53851
53851
|
return false;
|
|
53852
53852
|
}
|
|
53853
53853
|
const frameData = data;
|
|
53854
|
-
const isValid = frameData.hasOwnProperty("shapeType") && frameData.hasOwnProperty("backgroundColor") && frameData.hasOwnProperty("backgroundOpacity") && frameData.hasOwnProperty("borderColor") && frameData.hasOwnProperty("borderOpacity") && frameData.hasOwnProperty("borderStyle") && frameData.hasOwnProperty("borderWidth") && frameData.hasOwnProperty("transformation") && frameData.hasOwnProperty("text") && frameData.hasOwnProperty("children") && typeof frameData.shapeType === "string" && isColorValue(frameData.backgroundColor) && typeof frameData.backgroundOpacity === "number" && isColorValue(frameData.borderColor) && typeof frameData.borderOpacity === "number" && typeof frameData.borderStyle === "string" && typeof frameData.borderWidth === "number" && Array.isArray(frameData.children) && validateTransformationData(frameData.transformation) && validateRichTextData(frameData.text);
|
|
53854
|
+
const isValid = frameData.hasOwnProperty("shapeType") && frameData.hasOwnProperty("backgroundColor") && frameData.hasOwnProperty("backgroundOpacity") && frameData.hasOwnProperty("borderColor") && frameData.hasOwnProperty("borderOpacity") && frameData.hasOwnProperty("borderStyle") && frameData.hasOwnProperty("borderWidth") && frameData.hasOwnProperty("transformation") && frameData.hasOwnProperty("text") && (frameData.hasOwnProperty("childIds") || frameData.hasOwnProperty("children")) && typeof frameData.shapeType === "string" && isColorValue(frameData.backgroundColor) && typeof frameData.backgroundOpacity === "number" && isColorValue(frameData.borderColor) && typeof frameData.borderOpacity === "number" && typeof frameData.borderStyle === "string" && typeof frameData.borderWidth === "number" && (Array.isArray(frameData.childIds) || Array.isArray(frameData.children)) && validateTransformationData(frameData.transformation) && validateRichTextData(frameData.text);
|
|
53855
53855
|
return isValid;
|
|
53856
53856
|
}
|
|
53857
53857
|
function validateShapeData(shapeData) {
|
|
@@ -64403,9 +64403,19 @@ class Board {
|
|
|
64403
64403
|
}
|
|
64404
64404
|
}
|
|
64405
64405
|
const newMap = {};
|
|
64406
|
+
const childItemIds = new Set;
|
|
64407
|
+
for (const itemId in itemsMap) {
|
|
64408
|
+
const d = itemsMap[itemId];
|
|
64409
|
+
if (Array.isArray(d.childIds)) {
|
|
64410
|
+
for (const cid of d.childIds)
|
|
64411
|
+
childItemIds.add(cid);
|
|
64412
|
+
}
|
|
64413
|
+
}
|
|
64406
64414
|
let minX = Infinity;
|
|
64407
64415
|
let minY = Infinity;
|
|
64408
64416
|
for (const itemId in itemsMap) {
|
|
64417
|
+
if (childItemIds.has(itemId))
|
|
64418
|
+
continue;
|
|
64409
64419
|
const itemData = itemsMap[itemId];
|
|
64410
64420
|
const { translateX, translateY } = itemData.transformation || {
|
|
64411
64421
|
translateX: 0,
|
|
@@ -64455,7 +64465,7 @@ class Board {
|
|
|
64455
64465
|
itemData.middlePoint.x += -minX + x;
|
|
64456
64466
|
itemData.middlePoint.y += -minY + y;
|
|
64457
64467
|
}
|
|
64458
|
-
} else if (itemData.transformation) {
|
|
64468
|
+
} else if (itemData.transformation && !childItemIds.has(itemId)) {
|
|
64459
64469
|
itemData.transformation.translateX = translateX - minX + x;
|
|
64460
64470
|
itemData.transformation.translateY = translateY - minY + y;
|
|
64461
64471
|
}
|
|
@@ -64599,8 +64609,10 @@ class Board {
|
|
|
64599
64609
|
}
|
|
64600
64610
|
}
|
|
64601
64611
|
const itemDataWithChildren = itemData;
|
|
64602
|
-
if ("
|
|
64603
|
-
itemDataWithChildren.
|
|
64612
|
+
if ("childIds" in itemDataWithChildren && itemDataWithChildren.childIds?.length) {
|
|
64613
|
+
itemDataWithChildren.childIds = itemDataWithChildren.childIds.map((childId) => newItemIdMap[childId] || childId);
|
|
64614
|
+
} else if ("children" in itemDataWithChildren && itemDataWithChildren.children?.length) {
|
|
64615
|
+
itemDataWithChildren.children = itemDataWithChildren.children.map((childId) => newItemIdMap[childId] || childId);
|
|
64604
64616
|
}
|
|
64605
64617
|
newMap[newItemId] = itemData;
|
|
64606
64618
|
}
|
package/dist/esm/browser.js
CHANGED
|
@@ -3631,7 +3631,7 @@ var init_Settings = __esm(() => {
|
|
|
3631
3631
|
measureCtx: undefined,
|
|
3632
3632
|
i18n: instance,
|
|
3633
3633
|
hooks: {
|
|
3634
|
-
beforeMediaUpload: async (...args) =>
|
|
3634
|
+
beforeMediaUpload: async (...args) => true,
|
|
3635
3635
|
beforeMediaRemove: async (...args) => false,
|
|
3636
3636
|
onUploadMediaError: async (...args) => false
|
|
3637
3637
|
},
|
|
@@ -51369,7 +51369,7 @@ function validateFrameData(data) {
|
|
|
51369
51369
|
return false;
|
|
51370
51370
|
}
|
|
51371
51371
|
const frameData = data;
|
|
51372
|
-
const isValid = frameData.hasOwnProperty("shapeType") && frameData.hasOwnProperty("backgroundColor") && frameData.hasOwnProperty("backgroundOpacity") && frameData.hasOwnProperty("borderColor") && frameData.hasOwnProperty("borderOpacity") && frameData.hasOwnProperty("borderStyle") && frameData.hasOwnProperty("borderWidth") && frameData.hasOwnProperty("transformation") && frameData.hasOwnProperty("text") && frameData.hasOwnProperty("children") && typeof frameData.shapeType === "string" && isColorValue(frameData.backgroundColor) && typeof frameData.backgroundOpacity === "number" && isColorValue(frameData.borderColor) && typeof frameData.borderOpacity === "number" && typeof frameData.borderStyle === "string" && typeof frameData.borderWidth === "number" && Array.isArray(frameData.children) && validateTransformationData(frameData.transformation) && validateRichTextData(frameData.text);
|
|
51372
|
+
const isValid = frameData.hasOwnProperty("shapeType") && frameData.hasOwnProperty("backgroundColor") && frameData.hasOwnProperty("backgroundOpacity") && frameData.hasOwnProperty("borderColor") && frameData.hasOwnProperty("borderOpacity") && frameData.hasOwnProperty("borderStyle") && frameData.hasOwnProperty("borderWidth") && frameData.hasOwnProperty("transformation") && frameData.hasOwnProperty("text") && (frameData.hasOwnProperty("childIds") || frameData.hasOwnProperty("children")) && typeof frameData.shapeType === "string" && isColorValue(frameData.backgroundColor) && typeof frameData.backgroundOpacity === "number" && isColorValue(frameData.borderColor) && typeof frameData.borderOpacity === "number" && typeof frameData.borderStyle === "string" && typeof frameData.borderWidth === "number" && (Array.isArray(frameData.childIds) || Array.isArray(frameData.children)) && validateTransformationData(frameData.transformation) && validateRichTextData(frameData.text);
|
|
51373
51373
|
return isValid;
|
|
51374
51374
|
}
|
|
51375
51375
|
function validateShapeData(shapeData) {
|
|
@@ -61671,9 +61671,19 @@ class Board {
|
|
|
61671
61671
|
}
|
|
61672
61672
|
}
|
|
61673
61673
|
const newMap = {};
|
|
61674
|
+
const childItemIds = new Set;
|
|
61675
|
+
for (const itemId in itemsMap) {
|
|
61676
|
+
const d = itemsMap[itemId];
|
|
61677
|
+
if (Array.isArray(d.childIds)) {
|
|
61678
|
+
for (const cid of d.childIds)
|
|
61679
|
+
childItemIds.add(cid);
|
|
61680
|
+
}
|
|
61681
|
+
}
|
|
61674
61682
|
let minX = Infinity;
|
|
61675
61683
|
let minY = Infinity;
|
|
61676
61684
|
for (const itemId in itemsMap) {
|
|
61685
|
+
if (childItemIds.has(itemId))
|
|
61686
|
+
continue;
|
|
61677
61687
|
const itemData = itemsMap[itemId];
|
|
61678
61688
|
const { translateX, translateY } = itemData.transformation || {
|
|
61679
61689
|
translateX: 0,
|
|
@@ -61723,7 +61733,7 @@ class Board {
|
|
|
61723
61733
|
itemData.middlePoint.x += -minX + x;
|
|
61724
61734
|
itemData.middlePoint.y += -minY + y;
|
|
61725
61735
|
}
|
|
61726
|
-
} else if (itemData.transformation) {
|
|
61736
|
+
} else if (itemData.transformation && !childItemIds.has(itemId)) {
|
|
61727
61737
|
itemData.transformation.translateX = translateX - minX + x;
|
|
61728
61738
|
itemData.transformation.translateY = translateY - minY + y;
|
|
61729
61739
|
}
|
|
@@ -61867,8 +61877,10 @@ class Board {
|
|
|
61867
61877
|
}
|
|
61868
61878
|
}
|
|
61869
61879
|
const itemDataWithChildren = itemData;
|
|
61870
|
-
if ("
|
|
61871
|
-
itemDataWithChildren.
|
|
61880
|
+
if ("childIds" in itemDataWithChildren && itemDataWithChildren.childIds?.length) {
|
|
61881
|
+
itemDataWithChildren.childIds = itemDataWithChildren.childIds.map((childId) => newItemIdMap[childId] || childId);
|
|
61882
|
+
} else if ("children" in itemDataWithChildren && itemDataWithChildren.children?.length) {
|
|
61883
|
+
itemDataWithChildren.children = itemDataWithChildren.children.map((childId) => newItemIdMap[childId] || childId);
|
|
61872
61884
|
}
|
|
61873
61885
|
newMap[newItemId] = itemData;
|
|
61874
61886
|
}
|
package/dist/esm/index.js
CHANGED
|
@@ -3624,7 +3624,7 @@ var init_Settings = __esm(() => {
|
|
|
3624
3624
|
measureCtx: undefined,
|
|
3625
3625
|
i18n: instance,
|
|
3626
3626
|
hooks: {
|
|
3627
|
-
beforeMediaUpload: async (...args) =>
|
|
3627
|
+
beforeMediaUpload: async (...args) => true,
|
|
3628
3628
|
beforeMediaRemove: async (...args) => false,
|
|
3629
3629
|
onUploadMediaError: async (...args) => false
|
|
3630
3630
|
},
|
|
@@ -51362,7 +51362,7 @@ function validateFrameData(data) {
|
|
|
51362
51362
|
return false;
|
|
51363
51363
|
}
|
|
51364
51364
|
const frameData = data;
|
|
51365
|
-
const isValid = frameData.hasOwnProperty("shapeType") && frameData.hasOwnProperty("backgroundColor") && frameData.hasOwnProperty("backgroundOpacity") && frameData.hasOwnProperty("borderColor") && frameData.hasOwnProperty("borderOpacity") && frameData.hasOwnProperty("borderStyle") && frameData.hasOwnProperty("borderWidth") && frameData.hasOwnProperty("transformation") && frameData.hasOwnProperty("text") && frameData.hasOwnProperty("children") && typeof frameData.shapeType === "string" && isColorValue(frameData.backgroundColor) && typeof frameData.backgroundOpacity === "number" && isColorValue(frameData.borderColor) && typeof frameData.borderOpacity === "number" && typeof frameData.borderStyle === "string" && typeof frameData.borderWidth === "number" && Array.isArray(frameData.children) && validateTransformationData(frameData.transformation) && validateRichTextData(frameData.text);
|
|
51365
|
+
const isValid = frameData.hasOwnProperty("shapeType") && frameData.hasOwnProperty("backgroundColor") && frameData.hasOwnProperty("backgroundOpacity") && frameData.hasOwnProperty("borderColor") && frameData.hasOwnProperty("borderOpacity") && frameData.hasOwnProperty("borderStyle") && frameData.hasOwnProperty("borderWidth") && frameData.hasOwnProperty("transformation") && frameData.hasOwnProperty("text") && (frameData.hasOwnProperty("childIds") || frameData.hasOwnProperty("children")) && typeof frameData.shapeType === "string" && isColorValue(frameData.backgroundColor) && typeof frameData.backgroundOpacity === "number" && isColorValue(frameData.borderColor) && typeof frameData.borderOpacity === "number" && typeof frameData.borderStyle === "string" && typeof frameData.borderWidth === "number" && (Array.isArray(frameData.childIds) || Array.isArray(frameData.children)) && validateTransformationData(frameData.transformation) && validateRichTextData(frameData.text);
|
|
51366
51366
|
return isValid;
|
|
51367
51367
|
}
|
|
51368
51368
|
function validateShapeData(shapeData) {
|
|
@@ -61664,9 +61664,19 @@ class Board {
|
|
|
61664
61664
|
}
|
|
61665
61665
|
}
|
|
61666
61666
|
const newMap = {};
|
|
61667
|
+
const childItemIds = new Set;
|
|
61668
|
+
for (const itemId in itemsMap) {
|
|
61669
|
+
const d = itemsMap[itemId];
|
|
61670
|
+
if (Array.isArray(d.childIds)) {
|
|
61671
|
+
for (const cid of d.childIds)
|
|
61672
|
+
childItemIds.add(cid);
|
|
61673
|
+
}
|
|
61674
|
+
}
|
|
61667
61675
|
let minX = Infinity;
|
|
61668
61676
|
let minY = Infinity;
|
|
61669
61677
|
for (const itemId in itemsMap) {
|
|
61678
|
+
if (childItemIds.has(itemId))
|
|
61679
|
+
continue;
|
|
61670
61680
|
const itemData = itemsMap[itemId];
|
|
61671
61681
|
const { translateX, translateY } = itemData.transformation || {
|
|
61672
61682
|
translateX: 0,
|
|
@@ -61716,7 +61726,7 @@ class Board {
|
|
|
61716
61726
|
itemData.middlePoint.x += -minX + x;
|
|
61717
61727
|
itemData.middlePoint.y += -minY + y;
|
|
61718
61728
|
}
|
|
61719
|
-
} else if (itemData.transformation) {
|
|
61729
|
+
} else if (itemData.transformation && !childItemIds.has(itemId)) {
|
|
61720
61730
|
itemData.transformation.translateX = translateX - minX + x;
|
|
61721
61731
|
itemData.transformation.translateY = translateY - minY + y;
|
|
61722
61732
|
}
|
|
@@ -61860,8 +61870,10 @@ class Board {
|
|
|
61860
61870
|
}
|
|
61861
61871
|
}
|
|
61862
61872
|
const itemDataWithChildren = itemData;
|
|
61863
|
-
if ("
|
|
61864
|
-
itemDataWithChildren.
|
|
61873
|
+
if ("childIds" in itemDataWithChildren && itemDataWithChildren.childIds?.length) {
|
|
61874
|
+
itemDataWithChildren.childIds = itemDataWithChildren.childIds.map((childId) => newItemIdMap[childId] || childId);
|
|
61875
|
+
} else if ("children" in itemDataWithChildren && itemDataWithChildren.children?.length) {
|
|
61876
|
+
itemDataWithChildren.children = itemDataWithChildren.children.map((childId) => newItemIdMap[childId] || childId);
|
|
61865
61877
|
}
|
|
61866
61878
|
newMap[newItemId] = itemData;
|
|
61867
61879
|
}
|
package/dist/esm/node.js
CHANGED
|
@@ -3626,7 +3626,7 @@ var init_Settings = __esm(() => {
|
|
|
3626
3626
|
measureCtx: undefined,
|
|
3627
3627
|
i18n: instance,
|
|
3628
3628
|
hooks: {
|
|
3629
|
-
beforeMediaUpload: async (...args) =>
|
|
3629
|
+
beforeMediaUpload: async (...args) => true,
|
|
3630
3630
|
beforeMediaRemove: async (...args) => false,
|
|
3631
3631
|
onUploadMediaError: async (...args) => false
|
|
3632
3632
|
},
|
|
@@ -53771,7 +53771,7 @@ function validateFrameData(data) {
|
|
|
53771
53771
|
return false;
|
|
53772
53772
|
}
|
|
53773
53773
|
const frameData = data;
|
|
53774
|
-
const isValid = frameData.hasOwnProperty("shapeType") && frameData.hasOwnProperty("backgroundColor") && frameData.hasOwnProperty("backgroundOpacity") && frameData.hasOwnProperty("borderColor") && frameData.hasOwnProperty("borderOpacity") && frameData.hasOwnProperty("borderStyle") && frameData.hasOwnProperty("borderWidth") && frameData.hasOwnProperty("transformation") && frameData.hasOwnProperty("text") && frameData.hasOwnProperty("children") && typeof frameData.shapeType === "string" && isColorValue(frameData.backgroundColor) && typeof frameData.backgroundOpacity === "number" && isColorValue(frameData.borderColor) && typeof frameData.borderOpacity === "number" && typeof frameData.borderStyle === "string" && typeof frameData.borderWidth === "number" && Array.isArray(frameData.children) && validateTransformationData(frameData.transformation) && validateRichTextData(frameData.text);
|
|
53774
|
+
const isValid = frameData.hasOwnProperty("shapeType") && frameData.hasOwnProperty("backgroundColor") && frameData.hasOwnProperty("backgroundOpacity") && frameData.hasOwnProperty("borderColor") && frameData.hasOwnProperty("borderOpacity") && frameData.hasOwnProperty("borderStyle") && frameData.hasOwnProperty("borderWidth") && frameData.hasOwnProperty("transformation") && frameData.hasOwnProperty("text") && (frameData.hasOwnProperty("childIds") || frameData.hasOwnProperty("children")) && typeof frameData.shapeType === "string" && isColorValue(frameData.backgroundColor) && typeof frameData.backgroundOpacity === "number" && isColorValue(frameData.borderColor) && typeof frameData.borderOpacity === "number" && typeof frameData.borderStyle === "string" && typeof frameData.borderWidth === "number" && (Array.isArray(frameData.childIds) || Array.isArray(frameData.children)) && validateTransformationData(frameData.transformation) && validateRichTextData(frameData.text);
|
|
53775
53775
|
return isValid;
|
|
53776
53776
|
}
|
|
53777
53777
|
function validateShapeData(shapeData) {
|
|
@@ -64128,9 +64128,19 @@ class Board {
|
|
|
64128
64128
|
}
|
|
64129
64129
|
}
|
|
64130
64130
|
const newMap = {};
|
|
64131
|
+
const childItemIds = new Set;
|
|
64132
|
+
for (const itemId in itemsMap) {
|
|
64133
|
+
const d = itemsMap[itemId];
|
|
64134
|
+
if (Array.isArray(d.childIds)) {
|
|
64135
|
+
for (const cid of d.childIds)
|
|
64136
|
+
childItemIds.add(cid);
|
|
64137
|
+
}
|
|
64138
|
+
}
|
|
64131
64139
|
let minX = Infinity;
|
|
64132
64140
|
let minY = Infinity;
|
|
64133
64141
|
for (const itemId in itemsMap) {
|
|
64142
|
+
if (childItemIds.has(itemId))
|
|
64143
|
+
continue;
|
|
64134
64144
|
const itemData = itemsMap[itemId];
|
|
64135
64145
|
const { translateX, translateY } = itemData.transformation || {
|
|
64136
64146
|
translateX: 0,
|
|
@@ -64180,7 +64190,7 @@ class Board {
|
|
|
64180
64190
|
itemData.middlePoint.x += -minX + x;
|
|
64181
64191
|
itemData.middlePoint.y += -minY + y;
|
|
64182
64192
|
}
|
|
64183
|
-
} else if (itemData.transformation) {
|
|
64193
|
+
} else if (itemData.transformation && !childItemIds.has(itemId)) {
|
|
64184
64194
|
itemData.transformation.translateX = translateX - minX + x;
|
|
64185
64195
|
itemData.transformation.translateY = translateY - minY + y;
|
|
64186
64196
|
}
|
|
@@ -64324,8 +64334,10 @@ class Board {
|
|
|
64324
64334
|
}
|
|
64325
64335
|
}
|
|
64326
64336
|
const itemDataWithChildren = itemData;
|
|
64327
|
-
if ("
|
|
64328
|
-
itemDataWithChildren.
|
|
64337
|
+
if ("childIds" in itemDataWithChildren && itemDataWithChildren.childIds?.length) {
|
|
64338
|
+
itemDataWithChildren.childIds = itemDataWithChildren.childIds.map((childId) => newItemIdMap[childId] || childId);
|
|
64339
|
+
} else if ("children" in itemDataWithChildren && itemDataWithChildren.children?.length) {
|
|
64340
|
+
itemDataWithChildren.children = itemDataWithChildren.children.map((childId) => newItemIdMap[childId] || childId);
|
|
64329
64341
|
}
|
|
64330
64342
|
newMap[newItemId] = itemData;
|
|
64331
64343
|
}
|