@versa_ai/vmml-editor 1.0.16 → 1.0.17

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.16 build D:\code\work\vmml-player\packages\editor
2
+ > @versa_ai/vmml-editor@1.0.17 build D:\code\work\vmml-player\packages\editor
3
3
  > tsup
4
4
 
5
5
  CLI Building entry: src/index.tsx
@@ -9,7 +9,6 @@
9
9
  CLI Target: node16
10
10
  CJS Build start
11
11
  ESM Build start
12
- DTS Build start
13
12
 
14
13
   WARN  ▲ [WARNING] Using / for division outside of calc() is deprecated and will be removed in Dart Sass 2.0.0.
15
14
 
@@ -67,6 +66,7 @@ More info and automated migrator: https://sass-lang.com/d/slash-div [35
67
66
 
68
67
 
69
68
 
69
+ DTS Build start
70
70
 
71
71
   WARN  ▲ [WARNING] Using / for division outside of calc() is deprecated and will be removed in Dart Sass 2.0.0.
72
72
 
@@ -124,12 +124,12 @@ More info and automated migrator: https://sass-lang.com/d/slash-div [35
124
124
 
125
125
 
126
126
 
127
- ESM dist\index.mjs 111.04 KB
128
- ESM dist\index.mjs.map 213.31 KB
129
- ESM ⚡️ Build success in 1139ms
130
- CJS dist\index.js 112.66 KB
131
- CJS dist\index.js.map 213.61 KB
132
- CJS ⚡️ Build success in 1141ms
133
- DTS ⚡️ Build success in 2678ms
127
+ ESM dist\index.mjs 110.95 KB
128
+ ESM dist\index.mjs.map 213.03 KB
129
+ ESM ⚡️ Build success in 1002ms
130
+ CJS dist\index.js 112.57 KB
131
+ CJS dist\index.js.map 213.32 KB
132
+ CJS ⚡️ Build success in 1002ms
133
+ DTS ⚡️ Build success in 2326ms
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
@@ -1197,15 +1197,6 @@ var EditorCanvas = react.forwardRef(
1197
1197
  }
1198
1198
  };
1199
1199
  const createEditObjes = async (canvas, time) => {
1200
- const allObjects = canvas.getObjects();
1201
- const toRemove = [];
1202
- allObjects.forEach((obj) => {
1203
- var _a;
1204
- if ((_a = obj == null ? void 0 : obj.clipData) == null ? void 0 : _a.originClip) {
1205
- toRemove.push(obj);
1206
- }
1207
- });
1208
- toRemove.forEach((obj) => canvas.remove(obj));
1209
1200
  const promises = editClips.map((clip) => {
1210
1201
  if (clip.videoClip) {
1211
1202
  return createImageFromClip(clip);
@@ -1581,6 +1572,9 @@ var EditorCanvas = react.forwardRef(
1581
1572
  }
1582
1573
  }
1583
1574
  }, [fc]);
1575
+ const getCanvasCtx = () => {
1576
+ return fc;
1577
+ };
1584
1578
  react.useImperativeHandle(ref, () => ({
1585
1579
  createImage,
1586
1580
  createText,
@@ -1594,8 +1588,9 @@ var EditorCanvas = react.forwardRef(
1594
1588
  checkObjectInPoint,
1595
1589
  createImageFromClip,
1596
1590
  createTextFromClip,
1597
- changeObjectVisible
1598
- }));
1591
+ changeObjectVisible,
1592
+ getCanvasCtx
1593
+ }), [fc]);
1599
1594
  const getActions = () => {
1600
1595
  if (history) {
1601
1596
  return history.getActionType();
@@ -2713,13 +2708,14 @@ var EditorFn = ({
2713
2708
  }
2714
2709
  }, [dragState]);
2715
2710
  const updateVmml = (v) => {
2716
- var _a2;
2711
+ var _a2, _b, _c;
2717
2712
  const { current: playerCurrent } = vmmlPlayerRef;
2718
2713
  const { current: canvasCurrent } = canvasRef;
2719
2714
  if (!playerCurrent) return;
2715
+ (_b = (_a2 = canvasCurrent == null ? void 0 : canvasCurrent.getCanvasCtx()) == null ? void 0 : _a2.clear) == null ? void 0 : _b.call(_a2);
2720
2716
  const convertedVmml = vmmlUtils.convertVmmlTextScaleByForbidden(v);
2721
2717
  setVmmlState(convertedVmml);
2722
- setDurationInFrames(vmmlUtils.getFrames(((_a2 = v == null ? void 0 : v.template) == null ? void 0 : _a2.duration) || 1, fps));
2718
+ setDurationInFrames(vmmlUtils.getFrames(((_c = v == null ? void 0 : v.template) == null ? void 0 : _c.duration) || 1, fps));
2723
2719
  playerCurrent.setVmml(convertedVmml, pauseFrame);
2724
2720
  setRefreshEdit(Date.now());
2725
2721
  if (canvasCurrent) {