@versa_ai/vmml-editor 1.0.6 â 1.0.7
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 +130 -10
- package/dist/index.js +19 -19
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +19 -19
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
- package/src/components/EditorCanvas.tsx +1 -0
- package/src/index.tsx +0 -1
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
|
|
2
|
-
> @versa_ai/vmml-editor@1.0.
|
|
2
|
+
> @versa_ai/vmml-editor@1.0.7 build D:\code\work\vmml-player\packages\editor
|
|
3
3
|
> tsup
|
|
4
4
|
|
|
5
|
-
[34mCLI[39m Building entry: src/index.tsx
|
|
5
|
+
[34mCLI[39m Building entry: ./src/index.tsx
|
|
6
6
|
[34mCLI[39m Using tsconfig: tsconfig.json
|
|
7
|
-
[34mCLI[39m tsup v8.
|
|
7
|
+
[34mCLI[39m tsup v8.2.4
|
|
8
8
|
[34mCLI[39m Using tsup config: D:\code\work\vmml-player\packages\editor\tsup.config.ts
|
|
9
9
|
[34mCLI[39m Target: node16
|
|
10
10
|
[34mCJS[39m Build start
|
|
@@ -89,6 +89,66 @@ More info and automated migrator: https://sass-lang.com/d/slash-div[0m [1m[35
|
|
|
89
89
|
|
|
90
90
|
|
|
91
91
|
|
|
92
|
+
[43m[30m WARN [39m[49m [33mâ² [43;33m[[43;30mWARNING[43;33m][0m [1mSass's behavior for declarations that appear after nested
|
|
93
|
+
rules will be changing to match the behavior specified by CSS in an upcoming
|
|
94
|
+
version. To keep the existing behavior, move the declaration above the nested
|
|
95
|
+
rule. To opt into the new behavior, wrap the declaration in [36m& {}[39m.
|
|
96
|
+
|
|
97
|
+
More info: https://sass-lang.com/d/mixed-decls[0m [1m[35m[plugin sass-plugin][0m
|
|
98
|
+
|
|
99
|
+
src/assets/css/editorTextMenu.scss:104:4:
|
|
100
|
+
[37m 104 â -ms-[32m[37moverflow-style: none
|
|
101
|
+
âµ [32m^[0m
|
|
102
|
+
|
|
103
|
+
The plugin "sass-plugin" was triggered by this import
|
|
104
|
+
|
|
105
|
+
src/components/TextMenu.tsx:2:7:
|
|
106
|
+
[37m 2 â import [32m"../assets/css/editorTextMenu.scss"[37m;
|
|
107
|
+
âµ [32m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~[0m
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
[43m[30m WARN [39m[49m [33mâ² [43;33m[[43;30mWARNING[43;33m][0m [1mSass's behavior for declarations that appear after nested
|
|
113
|
+
rules will be changing to match the behavior specified by CSS in an upcoming
|
|
114
|
+
version. To keep the existing behavior, move the declaration above the nested
|
|
115
|
+
rule. To opt into the new behavior, wrap the declaration in [36m& {}[39m.
|
|
116
|
+
|
|
117
|
+
More info: https://sass-lang.com/d/mixed-decls[0m [1m[35m[plugin sass-plugin][0m
|
|
118
|
+
|
|
119
|
+
src/assets/css/editorTextMenu.scss:105:4:
|
|
120
|
+
[37m 105 â scro[32m[37mllbar-width: none
|
|
121
|
+
âµ [32m^[0m
|
|
122
|
+
|
|
123
|
+
The plugin "sass-plugin" was triggered by this import
|
|
124
|
+
|
|
125
|
+
src/components/TextMenu.tsx:2:7:
|
|
126
|
+
[37m 2 â import [32m"../assets/css/editorTextMenu.scss"[37m;
|
|
127
|
+
âµ [32m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~[0m
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
[43m[30m WARN [39m[49m [33mâ² [43;33m[[43;30mWARNING[43;33m][0m [1mSass's behavior for declarations that appear after nested
|
|
133
|
+
rules will be changing to match the behavior specified by CSS in an upcoming
|
|
134
|
+
version. To keep the existing behavior, move the declaration above the nested
|
|
135
|
+
rule. To opt into the new behavior, wrap the declaration in [36m& {}[39m.
|
|
136
|
+
|
|
137
|
+
More info: https://sass-lang.com/d/mixed-decls[0m [1m[35m[plugin sass-plugin][0m
|
|
138
|
+
|
|
139
|
+
src/assets/css/editorTextMenu.scss:106:4:
|
|
140
|
+
[37m 106 â tran[32m[37msition: all 0.1s
|
|
141
|
+
âµ [32m^[0m
|
|
142
|
+
|
|
143
|
+
The plugin "sass-plugin" was triggered by this import
|
|
144
|
+
|
|
145
|
+
src/components/TextMenu.tsx:2:7:
|
|
146
|
+
[37m 2 â import [32m"../assets/css/editorTextMenu.scss"[37m;
|
|
147
|
+
âµ [32m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~[0m
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
|
|
92
152
|
[43m[30m WARN [39m[49m [33mâ² [43;33m[[43;30mWARNING[43;33m][0m [1mUsing / for division outside of calc() is deprecated and will be removed in Dart Sass 2.0.0.
|
|
93
153
|
|
|
94
154
|
Recommendation: math.div($px, 750) or calc($px / 750)
|
|
@@ -186,6 +246,66 @@ More info and automated migrator: https://sass-lang.com/d/slash-div[0m [1m[35
|
|
|
186
246
|
|
|
187
247
|
|
|
188
248
|
|
|
249
|
+
[43m[30m WARN [39m[49m [33mâ² [43;33m[[43;30mWARNING[43;33m][0m [1mSass's behavior for declarations that appear after nested
|
|
250
|
+
rules will be changing to match the behavior specified by CSS in an upcoming
|
|
251
|
+
version. To keep the existing behavior, move the declaration above the nested
|
|
252
|
+
rule. To opt into the new behavior, wrap the declaration in [36m& {}[39m.
|
|
253
|
+
|
|
254
|
+
More info: https://sass-lang.com/d/mixed-decls[0m [1m[35m[plugin sass-plugin][0m
|
|
255
|
+
|
|
256
|
+
src/assets/css/editorTextMenu.scss:104:4:
|
|
257
|
+
[37m 104 â -ms-[32m[37moverflow-style: none
|
|
258
|
+
âµ [32m^[0m
|
|
259
|
+
|
|
260
|
+
The plugin "sass-plugin" was triggered by this import
|
|
261
|
+
|
|
262
|
+
src/components/TextMenu.tsx:2:7:
|
|
263
|
+
[37m 2 â import [32m"../assets/css/editorTextMenu.scss"[37m;
|
|
264
|
+
âµ [32m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~[0m
|
|
265
|
+
|
|
266
|
+
|
|
267
|
+
|
|
268
|
+
|
|
269
|
+
[43m[30m WARN [39m[49m [33mâ² [43;33m[[43;30mWARNING[43;33m][0m [1mSass's behavior for declarations that appear after nested
|
|
270
|
+
rules will be changing to match the behavior specified by CSS in an upcoming
|
|
271
|
+
version. To keep the existing behavior, move the declaration above the nested
|
|
272
|
+
rule. To opt into the new behavior, wrap the declaration in [36m& {}[39m.
|
|
273
|
+
|
|
274
|
+
More info: https://sass-lang.com/d/mixed-decls[0m [1m[35m[plugin sass-plugin][0m
|
|
275
|
+
|
|
276
|
+
src/assets/css/editorTextMenu.scss:105:4:
|
|
277
|
+
[37m 105 â scro[32m[37mllbar-width: none
|
|
278
|
+
âµ [32m^[0m
|
|
279
|
+
|
|
280
|
+
The plugin "sass-plugin" was triggered by this import
|
|
281
|
+
|
|
282
|
+
src/components/TextMenu.tsx:2:7:
|
|
283
|
+
[37m 2 â import [32m"../assets/css/editorTextMenu.scss"[37m;
|
|
284
|
+
âµ [32m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~[0m
|
|
285
|
+
|
|
286
|
+
|
|
287
|
+
|
|
288
|
+
|
|
289
|
+
[43m[30m WARN [39m[49m [33mâ² [43;33m[[43;30mWARNING[43;33m][0m [1mSass's behavior for declarations that appear after nested
|
|
290
|
+
rules will be changing to match the behavior specified by CSS in an upcoming
|
|
291
|
+
version. To keep the existing behavior, move the declaration above the nested
|
|
292
|
+
rule. To opt into the new behavior, wrap the declaration in [36m& {}[39m.
|
|
293
|
+
|
|
294
|
+
More info: https://sass-lang.com/d/mixed-decls[0m [1m[35m[plugin sass-plugin][0m
|
|
295
|
+
|
|
296
|
+
src/assets/css/editorTextMenu.scss:106:4:
|
|
297
|
+
[37m 106 â tran[32m[37msition: all 0.1s
|
|
298
|
+
âµ [32m^[0m
|
|
299
|
+
|
|
300
|
+
The plugin "sass-plugin" was triggered by this import
|
|
301
|
+
|
|
302
|
+
src/components/TextMenu.tsx:2:7:
|
|
303
|
+
[37m 2 â import [32m"../assets/css/editorTextMenu.scss"[37m;
|
|
304
|
+
âµ [32m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~[0m
|
|
305
|
+
|
|
306
|
+
|
|
307
|
+
|
|
308
|
+
|
|
189
309
|
[43m[30m WARN [39m[49m [33mâ² [43;33m[[43;30mWARNING[43;33m][0m [1mUsing / for division outside of calc() is deprecated and will be removed in Dart Sass 2.0.0.
|
|
190
310
|
|
|
191
311
|
Recommendation: math.div($px, 750) or calc($px / 750)
|
|
@@ -204,12 +324,12 @@ More info and automated migrator: https://sass-lang.com/d/slash-div[0m [1m[35
|
|
|
204
324
|
|
|
205
325
|
|
|
206
326
|
|
|
207
|
-
[32mESM[39m [1mdist\index.mjs [22m[32m102.
|
|
208
|
-
[32mESM[39m [1mdist\index.mjs.map [22m[
|
|
209
|
-
[32mESM[39m âĦï¸ Build success in
|
|
210
|
-
[32mCJS[39m [1mdist\index.js [22m[32m103.
|
|
211
|
-
[32mCJS[39m [1mdist\index.js.map [22m[
|
|
212
|
-
[32mCJS[39m âĦï¸ Build success in
|
|
213
|
-
[32mDTS[39m âĦï¸ Build success in
|
|
327
|
+
[32mESM[39m [1mdist\index.mjs [22m[32m102.29 KB[39m
|
|
328
|
+
[32mESM[39m [1mdist\index.mjs.map [22m[32m203.69 KB[39m
|
|
329
|
+
[32mESM[39m âĦï¸ Build success in 772ms
|
|
330
|
+
[32mCJS[39m [1mdist\index.js [22m[32m103.83 KB[39m
|
|
331
|
+
[32mCJS[39m [1mdist\index.js.map [22m[32m203.97 KB[39m
|
|
332
|
+
[32mCJS[39m âĦï¸ Build success in 774ms
|
|
333
|
+
[32mDTS[39m âĦï¸ Build success in 1917ms
|
|
214
334
|
[32mDTS[39m [1mdist\index.d.ts [22m[32m158.00 B[39m
|
|
215
335
|
[32mDTS[39m [1mdist\index.d.mts [22m[32m158.00 B[39m
|
package/dist/index.js
CHANGED
|
@@ -297,7 +297,7 @@ var SeekBar = ({ player, vmmlRef, frame, durationInFrames, intoEdit, setDragStat
|
|
|
297
297
|
if (e.button !== 0) {
|
|
298
298
|
return;
|
|
299
299
|
}
|
|
300
|
-
const { left, width } = (_a = containerRef.current) == null ?
|
|
300
|
+
const { left, width } = (_a = containerRef.current) == null ? void 0 : _a.getBoundingClientRect();
|
|
301
301
|
const _frame = getFrameFromX(
|
|
302
302
|
e.clientX - left,
|
|
303
303
|
durationInFrames,
|
|
@@ -317,7 +317,7 @@ var SeekBar = ({ player, vmmlRef, frame, durationInFrames, intoEdit, setDragStat
|
|
|
317
317
|
if (!dragging.dragging) {
|
|
318
318
|
return;
|
|
319
319
|
}
|
|
320
|
-
const { left, width } = (_a = containerRef.current) == null ?
|
|
320
|
+
const { left, width } = (_a = containerRef.current) == null ? void 0 : _a.getBoundingClientRect();
|
|
321
321
|
const _frame = getFrameFromX(
|
|
322
322
|
e.clientX - left,
|
|
323
323
|
durationInFrames,
|
|
@@ -655,7 +655,7 @@ var VmmlConverter = class {
|
|
|
655
655
|
existClip = originClip;
|
|
656
656
|
} else {
|
|
657
657
|
const editorTrack = this.tracks.find((track) => track.editorType === type);
|
|
658
|
-
existClip = ((editorTrack == null ?
|
|
658
|
+
existClip = ((editorTrack == null ? void 0 : editorTrack.clips) || []).find((clip) => clip.id === id);
|
|
659
659
|
}
|
|
660
660
|
if (existClip) {
|
|
661
661
|
!originClip && (existClip.fObj = fObj);
|
|
@@ -794,11 +794,11 @@ var VmmlConverter = class {
|
|
|
794
794
|
};
|
|
795
795
|
var VmmlConverter_default = VmmlConverter;
|
|
796
796
|
function drawImg(ctx, left, top, img, wSize, hSize, angle) {
|
|
797
|
-
if (angle ===
|
|
797
|
+
if (angle === void 0) return;
|
|
798
798
|
ctx.save();
|
|
799
799
|
ctx.translate(left, top);
|
|
800
800
|
ctx.rotate(fabric.fabric.util.degreesToRadians(angle));
|
|
801
|
-
ctx.drawImage(img, -
|
|
801
|
+
ctx.drawImage(img, -wSize / 2, -hSize / 2, wSize, hSize);
|
|
802
802
|
ctx.restore();
|
|
803
803
|
}
|
|
804
804
|
function usePeekControl(canvas) {
|
|
@@ -839,7 +839,7 @@ function usePeekControl(canvas) {
|
|
|
839
839
|
const renderMuteIcon = (ctx, left, top, styleOverride, fabricObject) => {
|
|
840
840
|
if (!fabricObject.clipData) return false;
|
|
841
841
|
if (fabricObject.clipData.type === "\u8868\u60C5\u5305") {
|
|
842
|
-
if (fabricObject.clipData.isMute === null || fabricObject.clipData.isMute ===
|
|
842
|
+
if (fabricObject.clipData.isMute === null || fabricObject.clipData.isMute === void 0) return false;
|
|
843
843
|
if (fabricObject.clipData.isMute) {
|
|
844
844
|
drawImg(ctx, left, top, muteImg, 28, 28, fabricObject.angle);
|
|
845
845
|
} else {
|
|
@@ -982,10 +982,10 @@ var EditorCanvas = react.forwardRef(
|
|
|
982
982
|
const objects = fc.getObjects();
|
|
983
983
|
objects.forEach((item) => {
|
|
984
984
|
var _a, _b, _c;
|
|
985
|
-
if (((_a = item == null ?
|
|
985
|
+
if (((_a = item == null ? void 0 : item.clipData) == null ? void 0 : _a.type) === "\u6587\u5B57") {
|
|
986
986
|
item.set("visible", ns >= item.clipData.inPoint && ns < item.clipData.inPoint + (item.clipData.duration || vmml.template.duration));
|
|
987
987
|
} else {
|
|
988
|
-
item.set("visible", ns >= item.clipData.inPoint && ns < item.clipData.inPoint + ((_c = (_b = item.clipData) == null ?
|
|
988
|
+
item.set("visible", ns >= item.clipData.inPoint && ns < item.clipData.inPoint + ((_c = (_b = item.clipData) == null ? void 0 : _b.fileUrl) == null ? void 0 : _c.duration));
|
|
989
989
|
}
|
|
990
990
|
});
|
|
991
991
|
fc.discardActiveObject();
|
|
@@ -1119,7 +1119,7 @@ var EditorCanvas = react.forwardRef(
|
|
|
1119
1119
|
if (canvas) {
|
|
1120
1120
|
const imgs = canvas.getObjects().filter((item) => {
|
|
1121
1121
|
var _a;
|
|
1122
|
-
return ((_a = item == null ?
|
|
1122
|
+
return ((_a = item == null ? void 0 : item.clipData) == null ? void 0 : _a.type) === "\u8868\u60C5\u5305";
|
|
1123
1123
|
});
|
|
1124
1124
|
const target = imgs.find((item) => item.clipData.id === id);
|
|
1125
1125
|
if (target) {
|
|
@@ -1129,7 +1129,7 @@ var EditorCanvas = react.forwardRef(
|
|
|
1129
1129
|
});
|
|
1130
1130
|
}
|
|
1131
1131
|
} else {
|
|
1132
|
-
waitFcTasks.current.push(updateImage.bind(
|
|
1132
|
+
waitFcTasks.current.push(updateImage.bind(void 0, id, base64));
|
|
1133
1133
|
}
|
|
1134
1134
|
};
|
|
1135
1135
|
const createImageFromClip = (clip, fc2) => {
|
|
@@ -1176,7 +1176,7 @@ var EditorCanvas = react.forwardRef(
|
|
|
1176
1176
|
});
|
|
1177
1177
|
});
|
|
1178
1178
|
} else {
|
|
1179
|
-
waitFcTasks.current.push(createImageFromClip.bind(
|
|
1179
|
+
waitFcTasks.current.push(createImageFromClip.bind(void 0, clip));
|
|
1180
1180
|
}
|
|
1181
1181
|
};
|
|
1182
1182
|
const handleRedo = () => {
|
|
@@ -1256,7 +1256,7 @@ var EditorCanvas = react.forwardRef(
|
|
|
1256
1256
|
canvas.add(imgData).renderAll();
|
|
1257
1257
|
});
|
|
1258
1258
|
} else {
|
|
1259
|
-
waitFcTasks.current.push(createTextFromClip.bind(
|
|
1259
|
+
waitFcTasks.current.push(createTextFromClip.bind(void 0, clip));
|
|
1260
1260
|
}
|
|
1261
1261
|
};
|
|
1262
1262
|
const embedFontInSVG = async (svgString, url) => {
|
|
@@ -1295,7 +1295,7 @@ var EditorCanvas = react.forwardRef(
|
|
|
1295
1295
|
container.style.padding = "6.5px 7px 6.5px 7px";
|
|
1296
1296
|
container.style.borderRadius = "5px";
|
|
1297
1297
|
document.body.appendChild(container);
|
|
1298
|
-
const { width, height } = container == null ?
|
|
1298
|
+
const { width, height } = container == null ? void 0 : container.getBoundingClientRect();
|
|
1299
1299
|
const dataurl = await domToImage.toSvg(container);
|
|
1300
1300
|
document.body.removeChild(container);
|
|
1301
1301
|
const base64Image = await embedFontInSVG(dataurl, fontAssetUrl);
|
|
@@ -1718,14 +1718,14 @@ var stopMove = () => {
|
|
|
1718
1718
|
const currentTouchPositionY = e.touches[0].clientY;
|
|
1719
1719
|
const deltaX = currentTouchPositionX - lastTouchPositionX;
|
|
1720
1720
|
const deltaY = currentTouchPositionY - lastTouchPositionY;
|
|
1721
|
-
if (["text-header", "overlay", "text_bg_change"].includes((_a = e.target) == null ?
|
|
1721
|
+
if (["text-header", "overlay", "text_bg_change"].includes((_a = e.target) == null ? void 0 : _a.className)) {
|
|
1722
1722
|
e.preventDefault();
|
|
1723
1723
|
}
|
|
1724
1724
|
if (element) {
|
|
1725
1725
|
const willOverflow = element.scrollHeight > element.clientHeight;
|
|
1726
1726
|
if (willOverflow) {
|
|
1727
1727
|
return;
|
|
1728
|
-
} else if (((_b = e.target) == null ?
|
|
1728
|
+
} else if (((_b = e.target) == null ? void 0 : _b.className.split(" ").includes("color-item")) || ((_c = e.target) == null ? void 0 : _c.className) === "text_color_change") {
|
|
1729
1729
|
if (deltaX < 0 || deltaX > 0) {
|
|
1730
1730
|
return;
|
|
1731
1731
|
} else {
|
|
@@ -1904,7 +1904,7 @@ var ColorSelector_default = ColorSelector;
|
|
|
1904
1904
|
var formatText = (text, maxLengthBase = 40) => {
|
|
1905
1905
|
var _a;
|
|
1906
1906
|
const newlineRegex = /(\r\n|\r|\n)/g;
|
|
1907
|
-
const matches = ((_a = text.match(newlineRegex)) == null ?
|
|
1907
|
+
const matches = ((_a = text.match(newlineRegex)) == null ? void 0 : _a.length) || 0;
|
|
1908
1908
|
const maxLength = maxLengthBase + matches;
|
|
1909
1909
|
let trimmedText = text.substring(0, maxLength);
|
|
1910
1910
|
if (text.length - matches === maxLengthBase) {
|
|
@@ -2230,7 +2230,7 @@ var EditorFn = ({
|
|
|
2230
2230
|
const [isPlaying, setIsPlaying] = react.useState(false);
|
|
2231
2231
|
const [showCanvas, setShowCanvas] = react.useState(false);
|
|
2232
2232
|
const [filterIds, setFilterIds] = react.useState([]);
|
|
2233
|
-
const [durationInFrames, setDurationInFrames] = react.useState(vmmlUtils.getFrames(((_a = vmml == null ?
|
|
2233
|
+
const [durationInFrames, setDurationInFrames] = react.useState(vmmlUtils.getFrames(((_a = vmml == null ? void 0 : vmml.template) == null ? void 0 : _a.duration) || 1, fps));
|
|
2234
2234
|
const [previewState, setPreviewState] = react.useState(true);
|
|
2235
2235
|
const [menuState, setMenuState] = react.useState("");
|
|
2236
2236
|
const [canvasSize, setCanvasSize] = react.useState({ width: 0, height: 0, top: 0 });
|
|
@@ -2506,8 +2506,8 @@ var EditorFn = ({
|
|
|
2506
2506
|
if (player) {
|
|
2507
2507
|
const parent = player.getContainerNode();
|
|
2508
2508
|
if (!canvasSize.width) {
|
|
2509
|
-
const playerElement = parent == null ?
|
|
2510
|
-
const { width, height } = (playerElement == null ?
|
|
2509
|
+
const playerElement = parent == null ? void 0 : parent.children[0];
|
|
2510
|
+
const { width, height } = (playerElement == null ? void 0 : playerElement.getBoundingClientRect()) || {};
|
|
2511
2511
|
setCanvasSize({ width, height, top: playerElement.offsetTop });
|
|
2512
2512
|
}
|
|
2513
2513
|
player.addEventListener("play", onPlay);
|