@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@versa_ai/vmml-editor",
3
- "version": "1.0.7",
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.8",
20
- "@versa_ai/vmml-player": "1.1.3"
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
- const [filterIds, setFilterIds] = useState<string[]>([]);
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 hideLoading = () => {
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),...editableArray];
394
- setFilterIds(ids);
395
- } else {
396
- setFilterIds([]);
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
- hideLoading={hideLoading}
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
- // textInfoReset={textInfoReset}
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
- <section style={menuStyles} className={`footer ${menuState === 'text' ? 'text-style' : ''}`}>
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
  );
@@ -10,7 +10,6 @@ export default class HistoryClass {
10
10
  editorInstance: any[];
11
11
  actionTypeList: any[];
12
12
  constructor(canvas?: fabric.Canvas) {
13
- console.log("history init");
14
13
  this.canvas = canvas;
15
14
  this.historyUndo = [];
16
15
  this.historyRedo = [];