@versa_ai/vmml-editor 1.0.40 → 1.0.41
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 -14
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +18 -14
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/components/EditorCanvas.tsx +1 -1
- package/src/utils/VmmlConverter.ts +16 -13
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.41 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
|
-
[
|
|
128
|
-
[
|
|
129
|
-
[32mESM[39m
|
|
130
|
-
[
|
|
131
|
-
[
|
|
132
|
-
[
|
|
133
|
-
[32mDTS[39m ⚡️ Build success in 2765ms
|
|
127
|
+
[32mCJS[39m [1mdist\index.js [22m[32m122.59 KB[39m
|
|
128
|
+
[32mCJS[39m [1mdist\index.js.map [22m[32m234.64 KB[39m
|
|
129
|
+
[32mCJS[39m ⚡️ Build success in 868ms
|
|
130
|
+
[32mESM[39m [1mdist\index.mjs [22m[32m120.90 KB[39m
|
|
131
|
+
[32mESM[39m [1mdist\index.mjs.map [22m[32m234.34 KB[39m
|
|
132
|
+
[32mESM[39m ⚡️ Build success in 868ms
|
|
133
|
+
[32mDTS[39m ⚡️ Build success in 1828ms
|
|
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
|
@@ -617,6 +617,20 @@ var VmmlConverter = class {
|
|
|
617
617
|
rotationY: _rotationY
|
|
618
618
|
};
|
|
619
619
|
}
|
|
620
|
+
findClip(id) {
|
|
621
|
+
const tracks = this.vmml.template.tracks || [];
|
|
622
|
+
const isString = typeof id === "string";
|
|
623
|
+
const ids = isString ? [id] : id;
|
|
624
|
+
const list = [];
|
|
625
|
+
tracks.forEach((track) => {
|
|
626
|
+
track.clips.forEach((clip) => {
|
|
627
|
+
if (ids == null ? void 0 : ids.includes(clip.id)) {
|
|
628
|
+
list.push(clip);
|
|
629
|
+
}
|
|
630
|
+
});
|
|
631
|
+
});
|
|
632
|
+
return list;
|
|
633
|
+
}
|
|
620
634
|
/**
|
|
621
635
|
* 转换 TextClip
|
|
622
636
|
* @param fObj - 画布fObj
|
|
@@ -714,19 +728,7 @@ var VmmlConverter = class {
|
|
|
714
728
|
const {
|
|
715
729
|
clipData: { id, type, lineSpacing, originClip }
|
|
716
730
|
} = fObj;
|
|
717
|
-
|
|
718
|
-
if (originClip) {
|
|
719
|
-
for (const track of this.tracks) {
|
|
720
|
-
const clip = (track.clips || []).find((c) => c.id === originClip.id);
|
|
721
|
-
if (clip) {
|
|
722
|
-
existClip = clip;
|
|
723
|
-
break;
|
|
724
|
-
}
|
|
725
|
-
}
|
|
726
|
-
} else {
|
|
727
|
-
const editorTrack = this.tracks.find((track) => track.editorType === type);
|
|
728
|
-
existClip = ((editorTrack == null ? void 0 : editorTrack.clips) || []).find((clip) => clip.id === id);
|
|
729
|
-
}
|
|
731
|
+
const [existClip] = this.findClip(id);
|
|
730
732
|
if (existClip) {
|
|
731
733
|
!originClip && (existClip.fObj = fObj);
|
|
732
734
|
if (type === "\u8868\u60C5\u5305") {
|
|
@@ -1774,7 +1776,9 @@ var EditorCanvas = react.forwardRef(
|
|
|
1774
1776
|
}, [fc, dragState]);
|
|
1775
1777
|
react.useEffect(() => {
|
|
1776
1778
|
if (canvasSize.width && canvasSize.height) {
|
|
1777
|
-
if (vmmlConverterRef.current)
|
|
1779
|
+
if (vmmlConverterRef.current) {
|
|
1780
|
+
vmmlConverterRef.current.changeVmml(vmml);
|
|
1781
|
+
} else {
|
|
1778
1782
|
vmmlConverterRef.current = new VmmlConverter_default({ vmml, canvasSize });
|
|
1779
1783
|
}
|
|
1780
1784
|
}
|