@versa_ai/vmml-editor 1.0.43 → 1.0.45
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 +8 -8
- package/dist/index.js +4 -13
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +4 -13
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
- package/src/index.tsx +5 -3
- package/src/utils/VmmlConverter.ts +6 -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.45 build D:\code\work\vmml-player\packages\editor
|
|
3
3
|
> tsup
|
|
4
4
|
|
|
5
5
|
[34mCLI[39m Building entry: src/index.tsx
|
|
@@ -124,12 +124,12 @@ More info and automated migrator: https://sass-lang.com/d/slash-div[0m [1m[35
|
|
|
124
124
|
|
|
125
125
|
|
|
126
126
|
|
|
127
|
-
[32mESM[39m [1mdist\index.mjs [22m[32m119.
|
|
128
|
-
[32mESM[39m [1mdist\index.mjs.map [22m[32m232.
|
|
129
|
-
[32mESM[39m ⚡️ Build success in
|
|
130
|
-
[32mCJS[39m [1mdist\index.js [22m[
|
|
131
|
-
[32mCJS[39m [1mdist\index.js.map [22m[
|
|
132
|
-
[32mCJS[39m ⚡️ Build success in
|
|
133
|
-
[32mDTS[39m ⚡️ Build success in
|
|
127
|
+
[32mESM[39m [1mdist\index.mjs [22m[32m119.17 KB[39m
|
|
128
|
+
[32mESM[39m [1mdist\index.mjs.map [22m[32m232.29 KB[39m
|
|
129
|
+
[32mESM[39m ⚡️ Build success in 1010ms
|
|
130
|
+
[32mCJS[39m [1mdist\index.js [22m[32m120.97 KB[39m
|
|
131
|
+
[32mCJS[39m [1mdist\index.js.map [22m[32m232.60 KB[39m
|
|
132
|
+
[32mCJS[39m ⚡️ Build success in 1012ms
|
|
133
|
+
[32mDTS[39m ⚡️ Build success in 2343ms
|
|
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
|
@@ -641,7 +641,6 @@ var VmmlConverter = class {
|
|
|
641
641
|
* @param fObj - 画布fObj
|
|
642
642
|
*/
|
|
643
643
|
addTextClip(fObj) {
|
|
644
|
-
console.log("addTextClip fObj", fObj);
|
|
645
644
|
const posParam = this.setPosParam(fObj);
|
|
646
645
|
const { clipData: { id, inPoint, text, textColor, bgColor } } = fObj;
|
|
647
646
|
const { template: { duration } } = this.vmml;
|
|
@@ -684,14 +683,12 @@ var VmmlConverter = class {
|
|
|
684
683
|
} else {
|
|
685
684
|
editorTrack.clips.push(tClipData);
|
|
686
685
|
}
|
|
687
|
-
console.log("addTextClip \u6700\u7EC8vmml", this.vmml);
|
|
688
686
|
}
|
|
689
687
|
/**
|
|
690
688
|
* 转换 VideoClip
|
|
691
689
|
* @param fObj - 画布fObj
|
|
692
690
|
*/
|
|
693
691
|
addVideoClip(fObj) {
|
|
694
|
-
console.log("addVideoClip fObj", fObj);
|
|
695
692
|
const clips = [];
|
|
696
693
|
const editorTrack = this.tracks.find((track) => track.editorType === "\u8868\u60C5\u5305");
|
|
697
694
|
const clipData = this.loadClipData(fObj);
|
|
@@ -721,14 +718,12 @@ var VmmlConverter = class {
|
|
|
721
718
|
}
|
|
722
719
|
}
|
|
723
720
|
}
|
|
724
|
-
console.log("addVideoClip \u6700\u7EC8vmml", this.vmml);
|
|
725
721
|
}
|
|
726
722
|
/**
|
|
727
723
|
* 更新 clip
|
|
728
724
|
* @param fObj - 画布fObj
|
|
729
725
|
*/
|
|
730
726
|
updateClip(fObj) {
|
|
731
|
-
console.log("updateClip fObj", fObj, this.tracks);
|
|
732
727
|
const posParam = this.setPosParam(fObj);
|
|
733
728
|
const {
|
|
734
729
|
clipData: { id, type, lineSpacing, originClip }
|
|
@@ -756,7 +751,6 @@ var VmmlConverter = class {
|
|
|
756
751
|
}
|
|
757
752
|
}
|
|
758
753
|
updateTextClip(fObj, duration) {
|
|
759
|
-
console.log("updateClip fObj", fObj, this.tracks);
|
|
760
754
|
const posParam = this.setPosParam(fObj);
|
|
761
755
|
const {
|
|
762
756
|
clipData: { id }
|
|
@@ -766,7 +760,6 @@ var VmmlConverter = class {
|
|
|
766
760
|
const { clipData: { text, textColor, bgColor } } = fObj;
|
|
767
761
|
const scale = this.fontSize / 22;
|
|
768
762
|
existClip.duration = duration;
|
|
769
|
-
console.log(bgColor, "bgColor>>>");
|
|
770
763
|
existClip.textClip = {
|
|
771
764
|
...existClip.textClip,
|
|
772
765
|
posParam,
|
|
@@ -779,7 +772,6 @@ var VmmlConverter = class {
|
|
|
779
772
|
}
|
|
780
773
|
};
|
|
781
774
|
}
|
|
782
|
-
console.log(this.vmml, "updateText>>>");
|
|
783
775
|
}
|
|
784
776
|
/**
|
|
785
777
|
* 删除 Clip
|
|
@@ -807,7 +799,6 @@ var VmmlConverter = class {
|
|
|
807
799
|
}
|
|
808
800
|
}
|
|
809
801
|
}
|
|
810
|
-
console.log("\u5220\u9664\u4E4B\u540E\u7684vmml", this.vmml);
|
|
811
802
|
}
|
|
812
803
|
changeVmml(newVmml) {
|
|
813
804
|
this.vmml = newVmml;
|
|
@@ -824,7 +815,6 @@ var VmmlConverter = class {
|
|
|
824
815
|
editorTrack.clips[index + 1].audioClip.volume = volume;
|
|
825
816
|
}
|
|
826
817
|
}
|
|
827
|
-
console.log("changeMute \u6700\u7EC8Vmml", this.vmml);
|
|
828
818
|
}
|
|
829
819
|
//加载clip数据
|
|
830
820
|
loadClipData(fObj) {
|
|
@@ -2926,12 +2916,13 @@ var EditorFn = ({
|
|
|
2926
2916
|
if (!playing) needPlay.current = false;
|
|
2927
2917
|
const currentFrame = checkFrame ?? (((_c = player == null ? void 0 : player.getCurrentFrame) == null ? void 0 : _c.call(player)) ?? frame ?? pauseFrame);
|
|
2928
2918
|
setFrame(currentFrame);
|
|
2929
|
-
const convertedVmml =
|
|
2919
|
+
const convertedVmml = v;
|
|
2930
2920
|
const isSame = JSON.stringify(convertedVmml) == JSON.stringify(vmmlState);
|
|
2931
2921
|
if (!isSame) {
|
|
2922
|
+
const currentV = cloneDeep__default.default(convertedVmml);
|
|
2932
2923
|
(_e = (_d = canvasCurrent == null ? void 0 : canvasCurrent.getCanvasCtx()) == null ? void 0 : _d.clear) == null ? void 0 : _e.call(_d);
|
|
2933
|
-
setVmmlState(
|
|
2934
|
-
setDurationInFrames(vmmlUtils.getFrames(((_f =
|
|
2924
|
+
setVmmlState(currentV);
|
|
2925
|
+
setDurationInFrames(vmmlUtils.getFrames(((_f = currentV == null ? void 0 : currentV.template) == null ? void 0 : _f.duration) || 1, fps));
|
|
2935
2926
|
}
|
|
2936
2927
|
playerCurrent.setVmml(convertedVmml, currentFrame);
|
|
2937
2928
|
if (isSame) (_g = canvasCurrent == null ? void 0 : canvasCurrent.checkObjectInPoint) == null ? void 0 : _g.call(canvasCurrent, currentFrame);
|