@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/dist/index.mjs
CHANGED
|
@@ -635,7 +635,6 @@ var VmmlConverter = class {
|
|
|
635
635
|
* @param fObj - 画布fObj
|
|
636
636
|
*/
|
|
637
637
|
addTextClip(fObj) {
|
|
638
|
-
console.log("addTextClip fObj", fObj);
|
|
639
638
|
const posParam = this.setPosParam(fObj);
|
|
640
639
|
const { clipData: { id, inPoint, text, textColor, bgColor } } = fObj;
|
|
641
640
|
const { template: { duration } } = this.vmml;
|
|
@@ -678,14 +677,12 @@ var VmmlConverter = class {
|
|
|
678
677
|
} else {
|
|
679
678
|
editorTrack.clips.push(tClipData);
|
|
680
679
|
}
|
|
681
|
-
console.log("addTextClip \u6700\u7EC8vmml", this.vmml);
|
|
682
680
|
}
|
|
683
681
|
/**
|
|
684
682
|
* 转换 VideoClip
|
|
685
683
|
* @param fObj - 画布fObj
|
|
686
684
|
*/
|
|
687
685
|
addVideoClip(fObj) {
|
|
688
|
-
console.log("addVideoClip fObj", fObj);
|
|
689
686
|
const clips = [];
|
|
690
687
|
const editorTrack = this.tracks.find((track) => track.editorType === "\u8868\u60C5\u5305");
|
|
691
688
|
const clipData = this.loadClipData(fObj);
|
|
@@ -715,14 +712,12 @@ var VmmlConverter = class {
|
|
|
715
712
|
}
|
|
716
713
|
}
|
|
717
714
|
}
|
|
718
|
-
console.log("addVideoClip \u6700\u7EC8vmml", this.vmml);
|
|
719
715
|
}
|
|
720
716
|
/**
|
|
721
717
|
* 更新 clip
|
|
722
718
|
* @param fObj - 画布fObj
|
|
723
719
|
*/
|
|
724
720
|
updateClip(fObj) {
|
|
725
|
-
console.log("updateClip fObj", fObj, this.tracks);
|
|
726
721
|
const posParam = this.setPosParam(fObj);
|
|
727
722
|
const {
|
|
728
723
|
clipData: { id, type, lineSpacing, originClip }
|
|
@@ -750,7 +745,6 @@ var VmmlConverter = class {
|
|
|
750
745
|
}
|
|
751
746
|
}
|
|
752
747
|
updateTextClip(fObj, duration) {
|
|
753
|
-
console.log("updateClip fObj", fObj, this.tracks);
|
|
754
748
|
const posParam = this.setPosParam(fObj);
|
|
755
749
|
const {
|
|
756
750
|
clipData: { id }
|
|
@@ -760,7 +754,6 @@ var VmmlConverter = class {
|
|
|
760
754
|
const { clipData: { text, textColor, bgColor } } = fObj;
|
|
761
755
|
const scale = this.fontSize / 22;
|
|
762
756
|
existClip.duration = duration;
|
|
763
|
-
console.log(bgColor, "bgColor>>>");
|
|
764
757
|
existClip.textClip = {
|
|
765
758
|
...existClip.textClip,
|
|
766
759
|
posParam,
|
|
@@ -773,7 +766,6 @@ var VmmlConverter = class {
|
|
|
773
766
|
}
|
|
774
767
|
};
|
|
775
768
|
}
|
|
776
|
-
console.log(this.vmml, "updateText>>>");
|
|
777
769
|
}
|
|
778
770
|
/**
|
|
779
771
|
* 删除 Clip
|
|
@@ -801,7 +793,6 @@ var VmmlConverter = class {
|
|
|
801
793
|
}
|
|
802
794
|
}
|
|
803
795
|
}
|
|
804
|
-
console.log("\u5220\u9664\u4E4B\u540E\u7684vmml", this.vmml);
|
|
805
796
|
}
|
|
806
797
|
changeVmml(newVmml) {
|
|
807
798
|
this.vmml = newVmml;
|
|
@@ -818,7 +809,6 @@ var VmmlConverter = class {
|
|
|
818
809
|
editorTrack.clips[index + 1].audioClip.volume = volume;
|
|
819
810
|
}
|
|
820
811
|
}
|
|
821
|
-
console.log("changeMute \u6700\u7EC8Vmml", this.vmml);
|
|
822
812
|
}
|
|
823
813
|
//加载clip数据
|
|
824
814
|
loadClipData(fObj) {
|
|
@@ -2920,12 +2910,13 @@ var EditorFn = ({
|
|
|
2920
2910
|
if (!playing) needPlay.current = false;
|
|
2921
2911
|
const currentFrame = checkFrame ?? (((_c = player == null ? void 0 : player.getCurrentFrame) == null ? void 0 : _c.call(player)) ?? frame ?? pauseFrame);
|
|
2922
2912
|
setFrame(currentFrame);
|
|
2923
|
-
const convertedVmml =
|
|
2913
|
+
const convertedVmml = v;
|
|
2924
2914
|
const isSame = JSON.stringify(convertedVmml) == JSON.stringify(vmmlState);
|
|
2925
2915
|
if (!isSame) {
|
|
2916
|
+
const currentV = cloneDeep(convertedVmml);
|
|
2926
2917
|
(_e = (_d = canvasCurrent == null ? void 0 : canvasCurrent.getCanvasCtx()) == null ? void 0 : _d.clear) == null ? void 0 : _e.call(_d);
|
|
2927
|
-
setVmmlState(
|
|
2928
|
-
setDurationInFrames(getFrames(((_f =
|
|
2918
|
+
setVmmlState(currentV);
|
|
2919
|
+
setDurationInFrames(getFrames(((_f = currentV == null ? void 0 : currentV.template) == null ? void 0 : _f.duration) || 1, fps));
|
|
2929
2920
|
}
|
|
2930
2921
|
playerCurrent.setVmml(convertedVmml, currentFrame);
|
|
2931
2922
|
if (isSame) (_g = canvasCurrent == null ? void 0 : canvasCurrent.checkObjectInPoint) == null ? void 0 : _g.call(canvasCurrent, currentFrame);
|