@versa_ai/vmml-editor 1.0.33 → 1.0.34

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.33 build D:\code\work\vmml-player\packages\editor
2
+ > @versa_ai/vmml-editor@1.0.34 build D:\code\work\vmml-player\packages\editor
3
3
  > tsup
4
4
 
5
5
  CLI Building entry: src/index.tsx
@@ -124,12 +124,12 @@ More info and automated migrator: https://sass-lang.com/d/slash-div [35
124
124
 
125
125
 
126
126
 
127
- CJS dist\index.js 116.27 KB
128
- CJS dist\index.js.map 222.40 KB
129
- CJS ⚡️ Build success in 2872ms
130
- ESM dist\index.mjs 114.66 KB
131
- ESM dist\index.mjs.map 222.11 KB
132
- ESM ⚡️ Build success in 2872ms
133
- DTS ⚡️ Build success in 6088ms
127
+ ESM dist\index.mjs 114.84 KB
128
+ ESM dist\index.mjs.map 222.06 KB
129
+ ESM ⚡️ Build success in 3042ms
130
+ CJS dist\index.js 116.45 KB
131
+ CJS dist\index.js.map 222.35 KB
132
+ CJS ⚡️ Build success in 3042ms
133
+ DTS ⚡️ Build success in 1673ms
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
@@ -1055,6 +1055,7 @@ var EditorCanvas = react.forwardRef(
1055
1055
  if (fc) {
1056
1056
  const ns = Math.floor((f ?? frame) / 30 * 1e6);
1057
1057
  const objects = fc.getObjects();
1058
+ console.log(objects, "checkObjectInPoint>>>objects>>>>>>>>>>>", ns, f, frame);
1058
1059
  objects.forEach((item) => {
1059
1060
  var _a, _b, _c;
1060
1061
  if (((_a = item == null ? void 0 : item.clipData) == null ? void 0 : _a.type) === "\u6587\u5B57") {
@@ -2774,24 +2775,24 @@ var EditorFn = ({
2774
2775
  }
2775
2776
  }, [dragState]);
2776
2777
  const updateEditor = (v, checkFrame) => {
2777
- var _a2, _b, _c, _d;
2778
+ var _a2, _b, _c, _d, _e;
2778
2779
  const { current: playerCurrent } = vmmlPlayerRef;
2779
2780
  const { current: canvasCurrent } = canvasRef;
2780
2781
  if (!playerCurrent) return;
2781
- const isSame = JSON.stringify(v) === JSON.stringify(vmmlState);
2782
- console.log(v, vmmlState, isSame, "\u5224\u65ADvmml\u662F\u5426\u76F8\u540C");
2783
2782
  needPlay.current = false;
2784
2783
  once.current = false;
2785
2784
  const convertedVmml = vmmlUtils.convertVmmlTextScaleByForbidden(v);
2785
+ const isSame = JSON.stringify(convertedVmml) === JSON.stringify(vmmlState);
2786
+ const currentFrame = checkFrame ?? (((_a2 = player == null ? void 0 : player.getCurrentFrame) == null ? void 0 : _a2.call(player)) ?? frame ?? pauseFrame);
2787
+ setFrame(currentFrame);
2788
+ playerCurrent.setVmml(convertedVmml, currentFrame);
2786
2789
  if (!isSame) {
2787
- (_b = (_a2 = canvasCurrent == null ? void 0 : canvasCurrent.getCanvasCtx()) == null ? void 0 : _a2.clear) == null ? void 0 : _b.call(_a2);
2790
+ (_c = (_b = canvasCurrent == null ? void 0 : canvasCurrent.getCanvasCtx()) == null ? void 0 : _b.clear) == null ? void 0 : _c.call(_b);
2788
2791
  setVmmlState(convertedVmml);
2789
- setDurationInFrames(vmmlUtils.getFrames(((_c = v == null ? void 0 : v.template) == null ? void 0 : _c.duration) || 1, fps));
2790
- setRefreshEdit(Date.now());
2792
+ setDurationInFrames(vmmlUtils.getFrames(((_d = convertedVmml == null ? void 0 : convertedVmml.template) == null ? void 0 : _d.duration) || 1, fps));
2793
+ } else {
2794
+ (_e = canvasCurrent == null ? void 0 : canvasCurrent.checkObjectInPoint) == null ? void 0 : _e.call(canvasCurrent, currentFrame);
2791
2795
  }
2792
- const currentFrame = checkFrame ?? pauseFrame;
2793
- playerCurrent.setVmml(convertedVmml, currentFrame);
2794
- (_d = canvasCurrent == null ? void 0 : canvasCurrent.checkObjectInPoint) == null ? void 0 : _d.call(canvasCurrent, currentFrame);
2795
2796
  };
2796
2797
  const getCurrentFrame = () => {
2797
2798
  if (!player) return 0;
@@ -2800,6 +2801,7 @@ var EditorFn = ({
2800
2801
  const editorSeekTo = (frame2) => {
2801
2802
  var _a2;
2802
2803
  (_a2 = player == null ? void 0 : player.seekTo) == null ? void 0 : _a2.call(player, frame2 ?? 0);
2804
+ setFrame(frame2 ?? 0);
2803
2805
  const { current: canvasCurrent } = canvasRef;
2804
2806
  if (canvasCurrent) {
2805
2807
  canvasCurrent.checkObjectInPoint(frame2);