@versa_ai/vmml-editor 1.0.7 → 1.0.9
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 +12 -288
- package/dist/index.js +7 -770
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +8 -771
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
- package/src/index.tsx +12 -49
- package/src/utils/HistoryClass.ts +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@versa_ai/vmml-editor",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.9",
|
|
4
4
|
"module": "dist/index.mjs",
|
|
5
5
|
"main": "dist/index.mjs",
|
|
6
6
|
"types": "dist/index.d.mts",
|
|
@@ -16,8 +16,8 @@
|
|
|
16
16
|
"remotion": "4.0.166",
|
|
17
17
|
"uuid": "^10.0.0",
|
|
18
18
|
"zod": "^3.23.8",
|
|
19
|
-
"@versa_ai/vmml-utils": "1.0.
|
|
20
|
-
"@versa_ai/vmml-player": "1.1.
|
|
19
|
+
"@versa_ai/vmml-utils": "1.0.12",
|
|
20
|
+
"@versa_ai/vmml-player": "1.1.12"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
23
|
"@biomejs/biome": "^1.7.1",
|
package/src/index.tsx
CHANGED
|
@@ -41,7 +41,7 @@ const EditorFn = <Schema extends AnyZodObject, Props>(
|
|
|
41
41
|
const [frame, setFrame] = useState<number>(pauseFrame);
|
|
42
42
|
const [isPlaying, setIsPlaying] = useState<boolean>(false);
|
|
43
43
|
const [showCanvas, setShowCanvas] = useState(false);
|
|
44
|
-
|
|
44
|
+
const [filterIds, setFilterIds] = useState<string[]>([]);
|
|
45
45
|
const [durationInFrames, setDurationInFrames] = useState(getFrames(vmml?.template?.duration || 1, fps));
|
|
46
46
|
const [previewState, setPreviewState] = useState<boolean>(true); // true预览态 false编辑态
|
|
47
47
|
const [menuState, setMenuState] = useState<string>(""); // text 文字菜单 video 表情包菜单 空不显示
|
|
@@ -68,7 +68,7 @@ const EditorFn = <Schema extends AnyZodObject, Props>(
|
|
|
68
68
|
}
|
|
69
69
|
};
|
|
70
70
|
|
|
71
|
-
const
|
|
71
|
+
const onPlayerReady = () => {
|
|
72
72
|
const { current }: any = vmmlPlayerRef;
|
|
73
73
|
vmmlFlag.current = false;
|
|
74
74
|
if (current && current.playerRef) {
|
|
@@ -390,11 +390,11 @@ const EditorFn = <Schema extends AnyZodObject, Props>(
|
|
|
390
390
|
|
|
391
391
|
useEffect(() => {
|
|
392
392
|
if (showCanvas) {
|
|
393
|
-
const ids = [...signList.map((item: any) => item.id)
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
393
|
+
const ids = [...signList.map((item: any) => item.id), ...editableArray];
|
|
394
|
+
setFilterIds(ids);
|
|
395
|
+
} else {
|
|
396
|
+
setFilterIds([]);
|
|
397
|
+
}
|
|
398
398
|
}, [showCanvas, signList])
|
|
399
399
|
|
|
400
400
|
useEffect(() => {
|
|
@@ -421,12 +421,12 @@ const EditorFn = <Schema extends AnyZodObject, Props>(
|
|
|
421
421
|
}),
|
|
422
422
|
[vmml, player]
|
|
423
423
|
)
|
|
424
|
-
const texteditClose = ()=>{
|
|
424
|
+
const texteditClose = () => {
|
|
425
425
|
if (textMenuRef) {
|
|
426
426
|
textMenuRef.current.close();
|
|
427
427
|
}
|
|
428
428
|
}
|
|
429
|
-
const textFinish = () =>{
|
|
429
|
+
const textFinish = () => {
|
|
430
430
|
if (textMenuRef) {
|
|
431
431
|
textMenuRef.current.handleSubmit();
|
|
432
432
|
}
|
|
@@ -455,10 +455,9 @@ const EditorFn = <Schema extends AnyZodObject, Props>(
|
|
|
455
455
|
vmml={vmml}
|
|
456
456
|
existenceBorderRadio
|
|
457
457
|
moveToBeginningWhenEnded
|
|
458
|
-
isEditorState
|
|
459
458
|
muted={true}
|
|
460
459
|
fps={fps}
|
|
461
|
-
|
|
460
|
+
onPlayerReady={onPlayerReady}
|
|
462
461
|
editableArray={editableArray}
|
|
463
462
|
premountFor={40}
|
|
464
463
|
pauseWhenBuffering={pauseWhenBuffering}
|
|
@@ -477,7 +476,7 @@ const EditorFn = <Schema extends AnyZodObject, Props>(
|
|
|
477
476
|
dragState={dragState}
|
|
478
477
|
initFcObjs={initFcObjs}
|
|
479
478
|
onVideoChange={onVideoChange}
|
|
480
|
-
|
|
479
|
+
// textInfoReset={textInfoReset}
|
|
481
480
|
/>
|
|
482
481
|
<div className="controls-box">
|
|
483
482
|
<Controls
|
|
@@ -497,43 +496,7 @@ const EditorFn = <Schema extends AnyZodObject, Props>(
|
|
|
497
496
|
</section>
|
|
498
497
|
</div>
|
|
499
498
|
<div className="padding-box"></div>
|
|
500
|
-
|
|
501
|
-
{
|
|
502
|
-
maxText > 0 && (
|
|
503
|
-
<div
|
|
504
|
-
onClick={() => onClickMenu("text")}
|
|
505
|
-
data-aspm-click="c375146.d480849"
|
|
506
|
-
data-aspm-expo
|
|
507
|
-
data-aspm-param={`Template_Id=${templateId}^Strategy_Id=${strategyId}`}
|
|
508
|
-
>
|
|
509
|
-
<img src={wordIcon} alt="word" />
|
|
510
|
-
<p>文字</p>
|
|
511
|
-
</div>
|
|
512
|
-
)
|
|
513
|
-
}
|
|
514
|
-
{
|
|
515
|
-
maxVideo > 0 && (
|
|
516
|
-
<div
|
|
517
|
-
onClick={() => onClickMenu("video")}
|
|
518
|
-
data-aspm-click="c375146.d480850"
|
|
519
|
-
data-aspm-expo
|
|
520
|
-
data-aspm-param={`Template_Id=${templateId}^Strategy_Id=${strategyId}`}
|
|
521
|
-
>
|
|
522
|
-
<img src={emotionIcon} alt="emotion" />
|
|
523
|
-
<p>表情包</p>
|
|
524
|
-
</div>
|
|
525
|
-
)
|
|
526
|
-
}
|
|
527
|
-
</section>
|
|
528
|
-
{
|
|
529
|
-
maxVideo > 0 && (
|
|
530
|
-
<VideoMenu menuState={menuState} createImage={createImage} videoMenus={videoMenus} />
|
|
531
|
-
)
|
|
532
|
-
}
|
|
533
|
-
{menuState === "text" && (
|
|
534
|
-
<TextMenu ref={textMenuRef} createText={createText} textClose={textClose} textInfo={textInfo} showTextButtons={showTextButtons} />
|
|
535
|
-
)}
|
|
536
|
-
</div>
|
|
499
|
+
</div>
|
|
537
500
|
<MaxTextLayer textLayerHide={() => setIsShowMaxTextLayer(false)} show={isShowMaxTextLayer} text={tips} />
|
|
538
501
|
</>
|
|
539
502
|
);
|