@versa_ai/vmml-editor 1.0.32 → 1.0.33
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/.turbo/turbo-build.log +9 -9
- package/dist/index.js +22 -10
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +22 -10
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/components/EditorCanvas.tsx +35 -10
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @versa_ai/vmml-editor@1.0.
|
|
2
|
+
> @versa_ai/vmml-editor@1.0.33 build D:\code\work\vmml-player\packages\editor
|
|
3
3
|
> tsup
|
|
4
4
|
|
|
5
5
|
[34mCLI[39m Building entry: src/index.tsx
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
[34mCLI[39m Target: node16
|
|
10
10
|
[34mCJS[39m Build start
|
|
11
11
|
[34mESM[39m Build start
|
|
12
|
+
[34mDTS[39m Build start
|
|
12
13
|
|
|
13
14
|
[43m[30m WARN [39m[49m [33m▲ [43;33m[[43;30mWARNING[43;33m][0m [1mUsing / for division outside of calc() is deprecated and will be removed in Dart Sass 2.0.0.
|
|
14
15
|
|
|
@@ -123,13 +124,12 @@ More info and automated migrator: https://sass-lang.com/d/slash-div[0m [1m[35
|
|
|
123
124
|
|
|
124
125
|
|
|
125
126
|
|
|
126
|
-
[32mCJS[39m [1mdist\index.js [22m[
|
|
127
|
-
[32mCJS[39m [1mdist\index.js.map [22m[
|
|
128
|
-
[32mCJS[39m ⚡️ Build success in
|
|
129
|
-
[32mESM[39m [1mdist\index.mjs [22m[32m114.
|
|
130
|
-
[32mESM[39m [1mdist\index.mjs.map [22m[
|
|
131
|
-
[32mESM[39m ⚡️ Build success in
|
|
132
|
-
[
|
|
133
|
-
[32mDTS[39m ⚡️ Build success in 1918ms
|
|
127
|
+
[32mCJS[39m [1mdist\index.js [22m[32m116.27 KB[39m
|
|
128
|
+
[32mCJS[39m [1mdist\index.js.map [22m[32m222.40 KB[39m
|
|
129
|
+
[32mCJS[39m ⚡️ Build success in 2872ms
|
|
130
|
+
[32mESM[39m [1mdist\index.mjs [22m[32m114.66 KB[39m
|
|
131
|
+
[32mESM[39m [1mdist\index.mjs.map [22m[32m222.11 KB[39m
|
|
132
|
+
[32mESM[39m ⚡️ Build success in 2872ms
|
|
133
|
+
[32mDTS[39m ⚡️ Build success in 6088ms
|
|
134
134
|
[32mDTS[39m [1mdist\index.d.ts [22m[32m158.00 B[39m
|
|
135
135
|
[32mDTS[39m [1mdist\index.d.mts [22m[32m158.00 B[39m
|
package/dist/index.js
CHANGED
|
@@ -1441,6 +1441,25 @@ var EditorCanvas = react.forwardRef(
|
|
|
1441
1441
|
return null;
|
|
1442
1442
|
}
|
|
1443
1443
|
};
|
|
1444
|
+
const setTextAlign = (p, stroke, direction) => {
|
|
1445
|
+
if (direction === "center") {
|
|
1446
|
+
p.style.justifyContent = "center";
|
|
1447
|
+
stroke.style.left = "50%";
|
|
1448
|
+
stroke.style.top = "50%";
|
|
1449
|
+
stroke.style.transform = "translate(-50%, -50%)";
|
|
1450
|
+
}
|
|
1451
|
+
if (direction === "left") {
|
|
1452
|
+
stroke.style.left = "0";
|
|
1453
|
+
stroke.style.top = "0";
|
|
1454
|
+
stroke.style.transform = "none";
|
|
1455
|
+
}
|
|
1456
|
+
if (direction === "right") {
|
|
1457
|
+
p.style.justifyContent = "flex-end";
|
|
1458
|
+
stroke.style.right = "0";
|
|
1459
|
+
stroke.style.top = "50%";
|
|
1460
|
+
stroke.style.transform = "translateY(-50%)";
|
|
1461
|
+
}
|
|
1462
|
+
};
|
|
1444
1463
|
const createTextImg = async ({ textContent, bgColor, textColor, stColor, strokeW, fontAssetUrl = null, textBasicInfo, letterSpacing }) => {
|
|
1445
1464
|
const fontBase64 = await loadFont(fontAssetUrl);
|
|
1446
1465
|
const container = document.createElement("div");
|
|
@@ -1462,7 +1481,6 @@ var EditorCanvas = react.forwardRef(
|
|
|
1462
1481
|
p.style.padding = "0";
|
|
1463
1482
|
if (letterSpacing) p.style.letterSpacing = `${letterSpacing}px`;
|
|
1464
1483
|
p.style.zIndex = "2";
|
|
1465
|
-
if (textWarapCenter) p.style.justifyContent = "center";
|
|
1466
1484
|
const fill = document.createElement("span");
|
|
1467
1485
|
fill.textContent = line || " ";
|
|
1468
1486
|
fill.style.color = textColor;
|
|
@@ -1474,15 +1492,9 @@ var EditorCanvas = react.forwardRef(
|
|
|
1474
1492
|
stroke.style.color = "transparent";
|
|
1475
1493
|
stroke.style.webkitTextStrokeWidth = `${strokeW}px`;
|
|
1476
1494
|
stroke.style.webkitTextStrokeColor = stColor;
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
stroke.style.transform = "translate(-50%, -50%)";
|
|
1481
|
-
} else {
|
|
1482
|
-
stroke.style.left = "0";
|
|
1483
|
-
stroke.style.top = "0";
|
|
1484
|
-
}
|
|
1485
|
-
stroke.style.zIndex = "-1";
|
|
1495
|
+
let dr = textBasicInfo.textAlign || "left";
|
|
1496
|
+
if (textWarapCenter) dr = "center";
|
|
1497
|
+
setTextAlign(p, stroke, dr);
|
|
1486
1498
|
p.appendChild(fill);
|
|
1487
1499
|
p.appendChild(stroke);
|
|
1488
1500
|
container.appendChild(p);
|