@versa_ai/vmml-editor 1.0.24 → 1.0.26
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 +10 -7
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +10 -7
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
- package/src/components/EditorCanvas.tsx +6 -4
- package/src/index.tsx +6 -3
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.26 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
|
-
[32mCJS[39m [1mdist\index.js
|
|
129
|
-
[32mCJS[39m
|
|
130
|
-
[
|
|
131
|
-
[32mESM[39m [1mdist\index.mjs
|
|
132
|
-
[32mESM[39m
|
|
133
|
-
[
|
|
126
|
+
[34mDTS[39m Build start
|
|
127
|
+
[32mCJS[39m [1mdist\index.js [22m[32m115.30 KB[39m
|
|
128
|
+
[32mCJS[39m [1mdist\index.js.map [22m[32m218.69 KB[39m
|
|
129
|
+
[32mCJS[39m ⚡️ Build success in 705ms
|
|
130
|
+
[32mESM[39m [1mdist\index.mjs [22m[32m113.66 KB[39m
|
|
131
|
+
[32mESM[39m [1mdist\index.mjs.map [22m[32m218.39 KB[39m
|
|
132
|
+
[32mESM[39m ⚡️ Build success in 706ms
|
|
133
|
+
[32mDTS[39m ⚡️ Build success in 1858ms
|
|
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
|
@@ -1321,12 +1321,13 @@ var EditorCanvas = react.forwardRef(
|
|
|
1321
1321
|
}
|
|
1322
1322
|
const { width, height } = vmml.template.dimension;
|
|
1323
1323
|
const fontSize = vmmlUtils.getFontSize(width, height);
|
|
1324
|
-
const { textContent, backgroundColor, textColor, posParam, fontAssetUrl, alignType, strokeColor, strokeWidth } = clip.textClip;
|
|
1324
|
+
const { textContent, backgroundColor, textColor, posParam, fontAssetUrl, alignType, strokeColor, strokeWidth, letterSpacing } = clip.textClip;
|
|
1325
1325
|
const scaleX = posParam.scaleX * fontSize / 22 / widthScaleRef.current;
|
|
1326
1326
|
const scaleY = posParam.scaleY * fontSize / 22 / heightScaleRef.current;
|
|
1327
1327
|
const strokeW = strokeWidth * 26 * 1.5 / fontSize;
|
|
1328
|
+
const letterSpace = letterSpacing * 22 / fontSize;
|
|
1328
1329
|
const left = canvasSize.width * posParam.centerX;
|
|
1329
|
-
const top = canvasSize.height * posParam.centerY;
|
|
1330
|
+
const top = canvasSize.height * posParam.centerY - 2;
|
|
1330
1331
|
const bgColor = backgroundColor ? vmmlUtils.argbToRgba(backgroundColor) : "transparent";
|
|
1331
1332
|
const stColor = strokeColor ? vmmlUtils.argbToRgba(strokeColor) : "transparent";
|
|
1332
1333
|
const isAiError = textContent === "\u8BF7\u8F93\u5165\u6587\u6848" && textColor === "#00000000";
|
|
@@ -1337,7 +1338,7 @@ var EditorCanvas = react.forwardRef(
|
|
|
1337
1338
|
colorName: "custom",
|
|
1338
1339
|
textAlign: alignType === 1 ? "center" : alignType === 2 ? "right" : "left"
|
|
1339
1340
|
};
|
|
1340
|
-
const textImgData = await createTextImg({ textContent, bgColor, stColor, strokeW, textColor: textFill, fontAssetUrl, textBasicInfo });
|
|
1341
|
+
const textImgData = await createTextImg({ textContent, bgColor, stColor, strokeW, textColor: textFill, fontAssetUrl, textBasicInfo, letterSpacing: letterSpace });
|
|
1341
1342
|
const fontJSON = localStorage.getItem("VMML_PLAYER_FONTSMAP");
|
|
1342
1343
|
let fontMap = {};
|
|
1343
1344
|
try {
|
|
@@ -1441,7 +1442,7 @@ var EditorCanvas = react.forwardRef(
|
|
|
1441
1442
|
return null;
|
|
1442
1443
|
}
|
|
1443
1444
|
};
|
|
1444
|
-
const createTextImg = async ({ textContent, bgColor, textColor, stColor, strokeW, fontAssetUrl = null, textBasicInfo }) => {
|
|
1445
|
+
const createTextImg = async ({ textContent, bgColor, textColor, stColor, strokeW, fontAssetUrl = null, textBasicInfo, letterSpacing }) => {
|
|
1445
1446
|
const fontBase64 = await loadFont(fontAssetUrl);
|
|
1446
1447
|
const container = document.createElement("div");
|
|
1447
1448
|
container.style.backgroundColor = bgColor;
|
|
@@ -1459,6 +1460,7 @@ var EditorCanvas = react.forwardRef(
|
|
|
1459
1460
|
p.style.whiteSpace = "nowrap";
|
|
1460
1461
|
p.style.margin = "0";
|
|
1461
1462
|
p.style.padding = "0";
|
|
1463
|
+
if (letterSpacing) p.style.letterSpacing = `${letterSpacing}px`;
|
|
1462
1464
|
p.style.zIndex = "2";
|
|
1463
1465
|
const fill = document.createElement("span");
|
|
1464
1466
|
fill.textContent = line || " ";
|
|
@@ -2760,19 +2762,20 @@ var EditorFn = ({
|
|
|
2760
2762
|
setPreviewState(false);
|
|
2761
2763
|
}
|
|
2762
2764
|
}, [dragState]);
|
|
2763
|
-
const updateVmml = (v) => {
|
|
2765
|
+
const updateVmml = (v, checkFrame) => {
|
|
2764
2766
|
var _a2, _b, _c;
|
|
2765
2767
|
const { current: playerCurrent } = vmmlPlayerRef;
|
|
2766
2768
|
const { current: canvasCurrent } = canvasRef;
|
|
2767
2769
|
if (!playerCurrent) return;
|
|
2768
2770
|
(_b = (_a2 = canvasCurrent == null ? void 0 : canvasCurrent.getCanvasCtx()) == null ? void 0 : _a2.clear) == null ? void 0 : _b.call(_a2);
|
|
2771
|
+
const currentFrame = checkFrame ?? pauseFrame;
|
|
2769
2772
|
const convertedVmml = vmmlUtils.convertVmmlTextScaleByForbidden(v);
|
|
2770
2773
|
setVmmlState(convertedVmml);
|
|
2771
2774
|
setDurationInFrames(vmmlUtils.getFrames(((_c = v == null ? void 0 : v.template) == null ? void 0 : _c.duration) || 1, fps));
|
|
2772
|
-
playerCurrent.setVmml(convertedVmml,
|
|
2775
|
+
playerCurrent.setVmml(convertedVmml, currentFrame);
|
|
2773
2776
|
setRefreshEdit(Date.now());
|
|
2774
2777
|
if (canvasCurrent) {
|
|
2775
|
-
canvasCurrent.checkObjectInPoint(
|
|
2778
|
+
canvasCurrent.checkObjectInPoint(currentFrame);
|
|
2776
2779
|
}
|
|
2777
2780
|
};
|
|
2778
2781
|
react.useImperativeHandle(
|