@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.
@@ -1,5 +1,5 @@
1
1
 
2
- > @versa_ai/vmml-editor@1.0.27 build D:\code\work\vmml-player\packages\editor
2
+ > @versa_ai/vmml-editor@1.0.29 build D:\code\work\vmml-player\packages\editor
3
3
  > tsup
4
4
 
5
5
  CLI Building entry: src/index.tsx
@@ -66,7 +66,6 @@ More info and automated migrator: https://sass-lang.com/d/slash-div [35
66
66
 
67
67
 
68
68
 
69
- DTS Build start
70
69
 
71
70
   WARN  ▲ [WARNING] Using / for division outside of calc() is deprecated and will be removed in Dart Sass 2.0.0.
72
71
 
@@ -124,12 +123,13 @@ More info and automated migrator: https://sass-lang.com/d/slash-div [35
124
123
 
125
124
 
126
125
 
127
- ESM dist\index.mjs 113.88 KB
128
- ESM dist\index.mjs.map 218.86 KB
129
- ESM ⚡️ Build success in 700ms
130
- CJS dist\index.js 115.52 KB
131
- CJS dist\index.js.map 219.15 KB
132
- CJS ⚡️ Build success in 700ms
133
- DTS ⚡️ Build success in 1636ms
126
+ DTS Build start
127
+ ESM dist\index.mjs 114.18 KB
128
+ ESM dist\index.mjs.map 219.48 KB
129
+ ESM ⚡️ Build success in 693ms
130
+ CJS dist\index.js 115.82 KB
131
+ CJS dist\index.js.map 219.77 KB
132
+ CJS ⚡️ Build success in 694ms
133
+ DTS ⚡️ Build success in 1988ms
134
134
  DTS dist\index.d.ts 158.00 B
135
135
  DTS dist\index.d.mts 158.00 B
package/dist/index.js CHANGED
@@ -2763,26 +2763,36 @@ var EditorFn = ({
2763
2763
  }
2764
2764
  }, [dragState]);
2765
2765
  const updateVmml = (v, checkFrame) => {
2766
- var _a2, _b, _c;
2766
+ var _a2, _b;
2767
2767
  const { current: playerCurrent } = vmmlPlayerRef;
2768
2768
  const { current: canvasCurrent } = canvasRef;
2769
2769
  if (!playerCurrent) return;
2770
2770
  (_b = (_a2 = canvasCurrent == null ? void 0 : canvasCurrent.getCanvasCtx()) == null ? void 0 : _a2.clear) == null ? void 0 : _b.call(_a2);
2771
2771
  needPlay.current = false;
2772
2772
  const currentFrame = checkFrame ?? pauseFrame;
2773
- const convertedVmml = vmmlUtils.convertVmmlTextScaleByForbidden(v);
2774
- setVmmlState(convertedVmml);
2775
- setDurationInFrames(vmmlUtils.getFrames(((_c = v == null ? void 0 : v.template) == null ? void 0 : _c.duration) || 1, fps));
2776
- playerCurrent.setVmml(convertedVmml, currentFrame);
2777
- setRefreshEdit(Date.now());
2778
- if (canvasCurrent) {
2779
- canvasCurrent.checkObjectInPoint(currentFrame);
2780
- }
2773
+ requestAnimationFrame(() => {
2774
+ var _a3;
2775
+ const convertedVmml = vmmlUtils.convertVmmlTextScaleByForbidden(v);
2776
+ setVmmlState(convertedVmml);
2777
+ setDurationInFrames(vmmlUtils.getFrames(((_a3 = v == null ? void 0 : v.template) == null ? void 0 : _a3.duration) || 1, fps));
2778
+ playerCurrent.setVmml(convertedVmml, currentFrame);
2779
+ setRefreshEdit(Date.now());
2780
+ if (canvasCurrent) {
2781
+ canvasCurrent.checkObjectInPoint(currentFrame);
2782
+ }
2783
+ });
2781
2784
  };
2782
2785
  const getCurrentFrame = () => {
2783
- console.log(player, "getCurrentFrame>>>>>>>>>>>>");
2784
2786
  if (!player) return 0;
2785
- return player.getPlayer().getCurrentFrame();
2787
+ return player.getCurrentFrame();
2788
+ };
2789
+ const EditorSeekTo = (frame2) => {
2790
+ var _a2;
2791
+ (_a2 = player == null ? void 0 : player.seekTo) == null ? void 0 : _a2.call(player, frame2 ?? 0);
2792
+ const { current: canvasCurrent } = canvasRef;
2793
+ if (canvasCurrent) {
2794
+ canvasCurrent.checkObjectInPoint(frame2);
2795
+ }
2786
2796
  };
2787
2797
  react.useImperativeHandle(
2788
2798
  ref,
@@ -2791,6 +2801,7 @@ var EditorFn = ({
2791
2801
  getfcObject,
2792
2802
  getCurrentFrame,
2793
2803
  getVmml,
2804
+ EditorSeekTo,
2794
2805
  getPlayer,
2795
2806
  texteditClose,
2796
2807
  textFinish,