@versa_ai/vmml-editor 1.0.27 → 1.0.29
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 +22 -11
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +22 -11
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/index.tsx +23 -13
package/package.json
CHANGED
package/src/index.tsx
CHANGED
|
@@ -435,23 +435,32 @@ const EditorFn = <Schema extends AnyZodObject, Props>(
|
|
|
435
435
|
|
|
436
436
|
const currentFrame = checkFrame ?? pauseFrame
|
|
437
437
|
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
canvasCurrent
|
|
448
|
-
|
|
438
|
+
requestAnimationFrame(() => {
|
|
439
|
+
const convertedVmml = convertVmmlTextScaleByForbidden(v);
|
|
440
|
+
setVmmlState(convertedVmml);
|
|
441
|
+
setDurationInFrames(getFrames(v?.template?.duration || 1, fps));
|
|
442
|
+
|
|
443
|
+
playerCurrent.setVmml(convertedVmml, currentFrame);
|
|
444
|
+
|
|
445
|
+
setRefreshEdit(Date.now());
|
|
446
|
+
|
|
447
|
+
if (canvasCurrent) {
|
|
448
|
+
canvasCurrent.checkObjectInPoint(currentFrame);
|
|
449
|
+
}
|
|
450
|
+
})
|
|
449
451
|
}
|
|
450
452
|
|
|
451
453
|
const getCurrentFrame = () => {
|
|
452
|
-
console.log(player, 'getCurrentFrame>>>>>>>>>>>>')
|
|
453
454
|
if (!player) return 0
|
|
454
|
-
return player.
|
|
455
|
+
return player.getCurrentFrame()
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
const EditorSeekTo = (frame: number) => {
|
|
459
|
+
player?.seekTo?.(frame ?? 0)
|
|
460
|
+
const { current: canvasCurrent }: any = canvasRef;
|
|
461
|
+
if (canvasCurrent) {
|
|
462
|
+
canvasCurrent.checkObjectInPoint(frame);
|
|
463
|
+
}
|
|
455
464
|
}
|
|
456
465
|
|
|
457
466
|
useImperativeHandle(ref,
|
|
@@ -460,6 +469,7 @@ const EditorFn = <Schema extends AnyZodObject, Props>(
|
|
|
460
469
|
getfcObject,
|
|
461
470
|
getCurrentFrame,
|
|
462
471
|
getVmml,
|
|
472
|
+
EditorSeekTo,
|
|
463
473
|
getPlayer,
|
|
464
474
|
texteditClose,
|
|
465
475
|
textFinish,
|