@versa_ai/vmml-editor 1.0.47 → 1.0.48
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/README.md +1 -1
- package/dist/index.js +8 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +8 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/components/EditorCanvas.tsx +11 -6
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.48 build D:\code\work\vmml-player\packages\editor
|
|
3
3
|
> tsup
|
|
4
4
|
|
|
5
5
|
[34mCLI[39m Building entry: src/index.tsx
|
|
@@ -9,7 +9,6 @@
|
|
|
9
9
|
[34mCLI[39m Target: node16
|
|
10
10
|
[34mCJS[39m Build start
|
|
11
11
|
[34mESM[39m Build start
|
|
12
|
-
[34mDTS[39m Build start
|
|
13
12
|
|
|
14
13
|
[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.
|
|
15
14
|
|
|
@@ -124,12 +123,13 @@ More info and automated migrator: https://sass-lang.com/d/slash-div[0m [1m[35
|
|
|
124
123
|
|
|
125
124
|
|
|
126
125
|
|
|
127
|
-
[
|
|
128
|
-
[32mESM[39m [1mdist\index.mjs
|
|
129
|
-
[32mESM[39m
|
|
130
|
-
[
|
|
131
|
-
[32mCJS[39m [1mdist\index.js
|
|
132
|
-
[32mCJS[39m
|
|
133
|
-
[
|
|
126
|
+
[34mDTS[39m Build start
|
|
127
|
+
[32mESM[39m [1mdist\index.mjs [22m[32m115.85 KB[39m
|
|
128
|
+
[32mESM[39m [1mdist\index.mjs.map [22m[32m225.42 KB[39m
|
|
129
|
+
[32mESM[39m ⚡️ Build success in 914ms
|
|
130
|
+
[32mCJS[39m [1mdist\index.js [22m[32m117.63 KB[39m
|
|
131
|
+
[32mCJS[39m [1mdist\index.js.map [22m[32m225.71 KB[39m
|
|
132
|
+
[32mCJS[39m ⚡️ Build success in 915ms
|
|
133
|
+
[32mDTS[39m ⚡️ Build success in 1983ms
|
|
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/README.md
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
# `@versa_ai/vmml-editor`
|
|
1
|
+
# `@versa_ai/vmml-editor`
|
package/dist/index.js
CHANGED
|
@@ -1344,6 +1344,8 @@ var EditorCanvas = react.forwardRef(
|
|
|
1344
1344
|
window.dispatchEvent(event);
|
|
1345
1345
|
};
|
|
1346
1346
|
const createTextObjs = async ({ strokeW, stColor, fontAssetUrl = null, letterSpace, bgColor, textContent, textBasicInfo, textColor }) => {
|
|
1347
|
+
const { width, height } = vmml.template.dimension;
|
|
1348
|
+
const fontSize = vmmlUtils.getFontSize(width, height);
|
|
1347
1349
|
let fontFamily = "sansMedium";
|
|
1348
1350
|
if (fontAssetUrl) {
|
|
1349
1351
|
const base64 = await loadFont(fontAssetUrl);
|
|
@@ -1354,7 +1356,9 @@ var EditorCanvas = react.forwardRef(
|
|
|
1354
1356
|
}
|
|
1355
1357
|
const lines = textContent.split("\n").filter((item) => item);
|
|
1356
1358
|
const lineHeight = 22 + strokeW;
|
|
1357
|
-
const paddingX =
|
|
1359
|
+
const paddingX = 60 * 22 / fontSize;
|
|
1360
|
+
const paddingY = 50 * 22 / fontSize;
|
|
1361
|
+
const round = 40 * 22 / fontSize;
|
|
1358
1362
|
const groupWidth = Math.max(...lines.map((l) => {
|
|
1359
1363
|
let options = { fontSize: 22, fontFamily, strokeWidth: strokeW ?? 0 };
|
|
1360
1364
|
if (letterSpace) options.charSpacing = letterSpace;
|
|
@@ -1406,13 +1410,13 @@ var EditorCanvas = react.forwardRef(
|
|
|
1406
1410
|
});
|
|
1407
1411
|
const bgRect = new fabric.fabric.Rect({
|
|
1408
1412
|
width: groupWidth,
|
|
1409
|
-
height: groupHeight +
|
|
1413
|
+
height: groupHeight + paddingY * 2,
|
|
1410
1414
|
// padddingY: 6.5
|
|
1411
1415
|
fill: bgColor,
|
|
1412
1416
|
originX: "left",
|
|
1413
1417
|
originY: "center",
|
|
1414
|
-
rx:
|
|
1415
|
-
ry:
|
|
1418
|
+
rx: round,
|
|
1419
|
+
ry: round
|
|
1416
1420
|
});
|
|
1417
1421
|
return {
|
|
1418
1422
|
objects: [bgRect, ...textObjs],
|