@versa_ai/vmml-editor 1.0.50 → 1.0.52
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 +18 -28
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +18 -28
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/components/EditorCanvas.tsx +3 -1
- package/src/index.tsx +10 -2
- package/src/utils/VmmlConverter.ts +2 -27
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.52 build D:\code\work\vmml-player\packages\editor
|
|
3
3
|
> tsup
|
|
4
4
|
|
|
5
5
|
[34mCLI[39m Building entry: src/index.tsx
|
|
@@ -66,6 +66,7 @@ More info and automated migrator: https://sass-lang.com/d/slash-div[0m [1m[35
|
|
|
66
66
|
|
|
67
67
|
|
|
68
68
|
|
|
69
|
+
[34mDTS[39m Build start
|
|
69
70
|
|
|
70
71
|
[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.
|
|
71
72
|
|
|
@@ -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
|
-
[
|
|
127
|
-
[32mCJS[39m [1mdist\index.js
|
|
128
|
-
[32mCJS[39m
|
|
129
|
-
[
|
|
130
|
-
[32mESM[39m [1mdist\index.mjs
|
|
131
|
-
[32mESM[39m
|
|
132
|
-
[
|
|
133
|
-
[32mDTS[39m ⚡️ Build success in 2585ms
|
|
127
|
+
[32mCJS[39m [1mdist\index.js [22m[32m121.78 KB[39m
|
|
128
|
+
[32mCJS[39m [1mdist\index.js.map [22m[32m233.41 KB[39m
|
|
129
|
+
[32mCJS[39m ⚡️ Build success in 673ms
|
|
130
|
+
[32mESM[39m [1mdist\index.mjs [22m[32m119.91 KB[39m
|
|
131
|
+
[32mESM[39m [1mdist\index.mjs.map [22m[32m233.11 KB[39m
|
|
132
|
+
[32mESM[39m ⚡️ Build success in 674ms
|
|
133
|
+
[32mDTS[39m ⚡️ Build success in 1560ms
|
|
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
|
@@ -681,6 +681,7 @@ var VmmlConverter = class {
|
|
|
681
681
|
} else {
|
|
682
682
|
editorTrack.clips.push(tClipData);
|
|
683
683
|
}
|
|
684
|
+
this.updateVmml(this.vmml);
|
|
684
685
|
}
|
|
685
686
|
/**
|
|
686
687
|
* 转换 VideoClip
|
|
@@ -748,29 +749,6 @@ var VmmlConverter = class {
|
|
|
748
749
|
}
|
|
749
750
|
}
|
|
750
751
|
}
|
|
751
|
-
updateTextClip(fObj, duration) {
|
|
752
|
-
const posParam = this.setPosParam(fObj);
|
|
753
|
-
const {
|
|
754
|
-
clipData: { id }
|
|
755
|
-
} = fObj;
|
|
756
|
-
const [existClip] = this.findClip(id);
|
|
757
|
-
if (existClip) {
|
|
758
|
-
const { clipData: { text, textColor, bgColor } } = fObj;
|
|
759
|
-
const scale = this.fontSize / 22;
|
|
760
|
-
existClip.duration = duration;
|
|
761
|
-
existClip.textClip = {
|
|
762
|
-
...existClip.textClip,
|
|
763
|
-
posParam,
|
|
764
|
-
backgroundColor: this.toARGB(bgColor),
|
|
765
|
-
textContent: text,
|
|
766
|
-
textColor: this.toARGB(textColor),
|
|
767
|
-
dimension: {
|
|
768
|
-
width: Math.floor(fObj.width * scale),
|
|
769
|
-
height: Math.floor(fObj.height * scale)
|
|
770
|
-
}
|
|
771
|
-
};
|
|
772
|
-
}
|
|
773
|
-
}
|
|
774
752
|
/**
|
|
775
753
|
* 删除 Clip
|
|
776
754
|
* @param id - 实例 id
|
|
@@ -1041,7 +1019,7 @@ function usePeekControl(canvas, hideConfig) {
|
|
|
1041
1019
|
return canvas;
|
|
1042
1020
|
}
|
|
1043
1021
|
var EditorCanvas = react.forwardRef(
|
|
1044
|
-
({ previewState, showCanvas, canvasSize, enterPreview, intoTextEdit, frame, vmml, dragState, initFcObjs, editClips = [], onVideoChange, isBatchModify, hideConfig, textWarapCenter }, ref) => {
|
|
1022
|
+
({ previewState, showCanvas, canvasSize, enterPreview, intoTextEdit, frame, vmml, dragState, initFcObjs, editClips = [], onVideoChange, isBatchModify, hideConfig, textWarapCenter, updateVmml }, ref) => {
|
|
1045
1023
|
const [fc, setFc] = react.useState(null);
|
|
1046
1024
|
const [history, setHistory] = react.useState(null);
|
|
1047
1025
|
const [canvasReady, setCanvasReady] = react.useState(false);
|
|
@@ -1317,7 +1295,7 @@ var EditorCanvas = react.forwardRef(
|
|
|
1317
1295
|
history.undo();
|
|
1318
1296
|
};
|
|
1319
1297
|
const onBatchModify = (fObj, canvas) => {
|
|
1320
|
-
var _a;
|
|
1298
|
+
var _a, _b;
|
|
1321
1299
|
if (!canvas) return;
|
|
1322
1300
|
const textObjects = canvas.getObjects().filter((item) => {
|
|
1323
1301
|
var _a2;
|
|
@@ -1337,9 +1315,10 @@ var EditorCanvas = react.forwardRef(
|
|
|
1337
1315
|
vmmlConverterRef.current.updateClip(updatedFObj);
|
|
1338
1316
|
});
|
|
1339
1317
|
canvas.renderAll();
|
|
1318
|
+
updateVmml((_a = vmmlConverterRef.current) == null ? void 0 : _a.vmml);
|
|
1340
1319
|
const event = new CustomEvent("editor-vmml-batch-change", {
|
|
1341
1320
|
detail: {
|
|
1342
|
-
vmml: ((
|
|
1321
|
+
vmml: ((_b = vmmlConverterRef.current) == null ? void 0 : _b.vmml) ?? null
|
|
1343
1322
|
}
|
|
1344
1323
|
});
|
|
1345
1324
|
window.dispatchEvent(event);
|
|
@@ -1484,6 +1463,7 @@ var EditorCanvas = react.forwardRef(
|
|
|
1484
1463
|
options.transform.target.isSelected = 0;
|
|
1485
1464
|
});
|
|
1486
1465
|
group.on("modified", () => {
|
|
1466
|
+
var _a;
|
|
1487
1467
|
const fObj = convertToJSON(group);
|
|
1488
1468
|
if (fObj.clipData.isAiError) {
|
|
1489
1469
|
fObj.clipData.textColor = "rgba(0, 0, 0, 0)";
|
|
@@ -1492,6 +1472,7 @@ var EditorCanvas = react.forwardRef(
|
|
|
1492
1472
|
onBatchModify(fObj, canvas);
|
|
1493
1473
|
} else {
|
|
1494
1474
|
vmmlConverterRef.current.updateClip(fObj);
|
|
1475
|
+
updateVmml((_a = vmmlConverterRef.current) == null ? void 0 : _a.vmml);
|
|
1495
1476
|
}
|
|
1496
1477
|
});
|
|
1497
1478
|
resolve(group);
|
|
@@ -2609,8 +2590,8 @@ var EditorFn = ({
|
|
|
2609
2590
|
current.unmute();
|
|
2610
2591
|
current.play();
|
|
2611
2592
|
} else {
|
|
2612
|
-
setMenuState("");
|
|
2613
2593
|
setPreviewState(true);
|
|
2594
|
+
setMenuState("");
|
|
2614
2595
|
}
|
|
2615
2596
|
};
|
|
2616
2597
|
const onClickMenu = (type) => {
|
|
@@ -2982,6 +2963,14 @@ var EditorFn = ({
|
|
|
2982
2963
|
}
|
|
2983
2964
|
return {};
|
|
2984
2965
|
}, [loading]);
|
|
2966
|
+
const updateVmml = (vmml) => {
|
|
2967
|
+
var _a2, _b;
|
|
2968
|
+
const { current } = vmmlPlayerRef;
|
|
2969
|
+
if (!current) return;
|
|
2970
|
+
const playing = ((_b = (_a2 = current == null ? void 0 : current.playerRef) == null ? void 0 : _a2.isPlaying) == null ? void 0 : _b.call(_a2)) ?? false;
|
|
2971
|
+
if (!playing) needPlay.current = false;
|
|
2972
|
+
current.setVmml(vmml, frame, false);
|
|
2973
|
+
};
|
|
2985
2974
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
2986
2975
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "editor", style: { height }, children: [
|
|
2987
2976
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "editor-vessel", onClick: () => {
|
|
@@ -3021,7 +3010,8 @@ var EditorFn = ({
|
|
|
3021
3010
|
onVideoChange,
|
|
3022
3011
|
isBatchModify,
|
|
3023
3012
|
hideConfig,
|
|
3024
|
-
textWarapCenter
|
|
3013
|
+
textWarapCenter,
|
|
3014
|
+
updateVmml
|
|
3025
3015
|
}
|
|
3026
3016
|
),
|
|
3027
3017
|
/* @__PURE__ */ jsxRuntime.jsx(Loading_default, { show: loading })
|