@versa_ai/vmml-editor 1.0.25 → 1.0.26

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@versa_ai/vmml-editor",
3
- "version": "1.0.25",
3
+ "version": "1.0.26",
4
4
  "module": "dist/index.mjs",
5
5
  "main": "dist/index.mjs",
6
6
  "types": "dist/index.d.mts",
package/src/index.tsx CHANGED
@@ -426,21 +426,24 @@ const EditorFn = <Schema extends AnyZodObject, Props>(
426
426
  }
427
427
  }, [dragState]);
428
428
 
429
- const updateVmml = (v: any) => {
429
+ const updateVmml = (v: any, checkFrame: number) => {
430
430
  const { current: playerCurrent }: any = vmmlPlayerRef;
431
431
  const { current: canvasCurrent }: any = canvasRef;
432
432
  if (!playerCurrent) return;
433
433
  canvasCurrent?.getCanvasCtx()?.clear?.()
434
434
 
435
+ const currentFrame = checkFrame ?? pauseFrame
436
+
435
437
  const convertedVmml = convertVmmlTextScaleByForbidden(v);
436
438
  setVmmlState(convertedVmml);
437
439
  setDurationInFrames(getFrames(v?.template?.duration || 1, fps));
438
- playerCurrent.setVmml(convertedVmml, pauseFrame);
440
+
441
+ playerCurrent.setVmml(convertedVmml, currentFrame);
439
442
 
440
443
  setRefreshEdit(Date.now());
441
444
 
442
445
  if (canvasCurrent) {
443
- canvasCurrent.checkObjectInPoint(pauseFrame);
446
+ canvasCurrent.checkObjectInPoint(currentFrame);
444
447
  }
445
448
  }
446
449