@versa_ai/vmml-editor 1.0.29 → 1.0.30
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/canvas-JILBIABC.node +0 -0
- package/dist/index.js +22 -25
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +22 -25
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/components/EditorCanvas.tsx +0 -2
- package/src/index.tsx +47 -31
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.30 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 1988ms
|
|
127
|
+
[32mCJS[39m [1mdist\index.js [22m[32m115.76 KB[39m
|
|
128
|
+
[32mCJS[39m [1mdist\index.js.map [22m[32m220.37 KB[39m
|
|
129
|
+
[32mCJS[39m ⚡️ Build success in 863ms
|
|
130
|
+
[32mESM[39m [1mdist\index.mjs [22m[32m114.15 KB[39m
|
|
131
|
+
[32mESM[39m [1mdist\index.mjs.map [22m[32m220.08 KB[39m
|
|
132
|
+
[32mESM[39m ⚡️ Build success in 864ms
|
|
133
|
+
[32mDTS[39m ⚡️ Build success in 1631ms
|
|
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
|
|
Binary file
|
package/dist/index.js
CHANGED
|
@@ -2706,15 +2706,6 @@ var EditorFn = ({
|
|
|
2706
2706
|
initCanEditClips(vmmlState.template.tracks);
|
|
2707
2707
|
}
|
|
2708
2708
|
}, [editableArray, refreshEdit, vmmlState]);
|
|
2709
|
-
react.useEffect(() => {
|
|
2710
|
-
var _a2;
|
|
2711
|
-
if (propVmml) {
|
|
2712
|
-
const convertedVmml = vmmlUtils.convertVmmlTextScaleByForbidden(propVmml);
|
|
2713
|
-
setVmmlState(convertedVmml);
|
|
2714
|
-
setDurationInFrames(vmmlUtils.getFrames(((_a2 = propVmml == null ? void 0 : propVmml.template) == null ? void 0 : _a2.duration) || 1, fps));
|
|
2715
|
-
setRefreshEdit(Date.now());
|
|
2716
|
-
}
|
|
2717
|
-
}, [propVmml]);
|
|
2718
2709
|
react.useEffect(() => {
|
|
2719
2710
|
if (vmmlState) {
|
|
2720
2711
|
initFcObjects(vmmlState.template.tracks);
|
|
@@ -2762,31 +2753,30 @@ var EditorFn = ({
|
|
|
2762
2753
|
setPreviewState(false);
|
|
2763
2754
|
}
|
|
2764
2755
|
}, [dragState]);
|
|
2765
|
-
const
|
|
2766
|
-
var _a2, _b;
|
|
2756
|
+
const updateEditor = (v, checkFrame) => {
|
|
2757
|
+
var _a2, _b, _c, _d;
|
|
2767
2758
|
const { current: playerCurrent } = vmmlPlayerRef;
|
|
2768
2759
|
const { current: canvasCurrent } = canvasRef;
|
|
2769
2760
|
if (!playerCurrent) return;
|
|
2770
|
-
|
|
2761
|
+
const isSame = JSON.stringify(v) === JSON.stringify(vmmlState);
|
|
2762
|
+
console.log(v, vmmlState, isSame, "\u5224\u65ADvmml\u662F\u5426\u76F8\u540C");
|
|
2771
2763
|
needPlay.current = false;
|
|
2772
|
-
const
|
|
2773
|
-
|
|
2774
|
-
|
|
2775
|
-
const convertedVmml = vmmlUtils.convertVmmlTextScaleByForbidden(v);
|
|
2764
|
+
const convertedVmml = vmmlUtils.convertVmmlTextScaleByForbidden(v);
|
|
2765
|
+
if (!isSame) {
|
|
2766
|
+
(_b = (_a2 = canvasCurrent == null ? void 0 : canvasCurrent.getCanvasCtx()) == null ? void 0 : _a2.clear) == null ? void 0 : _b.call(_a2);
|
|
2776
2767
|
setVmmlState(convertedVmml);
|
|
2777
|
-
setDurationInFrames(vmmlUtils.getFrames(((
|
|
2778
|
-
playerCurrent.setVmml(convertedVmml, currentFrame);
|
|
2768
|
+
setDurationInFrames(vmmlUtils.getFrames(((_c = v == null ? void 0 : v.template) == null ? void 0 : _c.duration) || 1, fps));
|
|
2779
2769
|
setRefreshEdit(Date.now());
|
|
2780
|
-
|
|
2781
|
-
|
|
2782
|
-
|
|
2783
|
-
|
|
2770
|
+
}
|
|
2771
|
+
const currentFrame = checkFrame ?? pauseFrame;
|
|
2772
|
+
playerCurrent.setVmml(convertedVmml, currentFrame);
|
|
2773
|
+
(_d = canvasCurrent == null ? void 0 : canvasCurrent.checkObjectInPoint) == null ? void 0 : _d.call(canvasCurrent, currentFrame);
|
|
2784
2774
|
};
|
|
2785
2775
|
const getCurrentFrame = () => {
|
|
2786
2776
|
if (!player) return 0;
|
|
2787
2777
|
return player.getCurrentFrame();
|
|
2788
2778
|
};
|
|
2789
|
-
const
|
|
2779
|
+
const editorSeekTo = (frame2) => {
|
|
2790
2780
|
var _a2;
|
|
2791
2781
|
(_a2 = player == null ? void 0 : player.seekTo) == null ? void 0 : _a2.call(player, frame2 ?? 0);
|
|
2792
2782
|
const { current: canvasCurrent } = canvasRef;
|
|
@@ -2799,13 +2789,20 @@ var EditorFn = ({
|
|
|
2799
2789
|
() => ({
|
|
2800
2790
|
getActions,
|
|
2801
2791
|
getfcObject,
|
|
2792
|
+
// 获取画布上所有对象
|
|
2802
2793
|
getCurrentFrame,
|
|
2794
|
+
// 获取当前帧
|
|
2803
2795
|
getVmml,
|
|
2804
|
-
|
|
2796
|
+
// 获取vmml
|
|
2805
2797
|
getPlayer,
|
|
2798
|
+
// 获取player实例
|
|
2806
2799
|
texteditClose,
|
|
2807
2800
|
textFinish,
|
|
2808
|
-
|
|
2801
|
+
// 完成按钮事件
|
|
2802
|
+
editorSeekTo,
|
|
2803
|
+
// editor的seek事件 入参:frame
|
|
2804
|
+
updateEditor
|
|
2805
|
+
// 更新editor 入参:vmml, frame
|
|
2809
2806
|
}),
|
|
2810
2807
|
[vmmlState, player]
|
|
2811
2808
|
);
|