@lalalic/markcut 3.2.27 → 3.2.29

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.
@@ -6,7 +6,7 @@ import {SharedPlayer} from '../player/SharedPlayer';
6
6
  import {SceneThumbnails} from '../player/components/SceneThumbnails';
7
7
  import {useWebAudioPreview} from './web-audio-preview';
8
8
  import {useBrowserSpeechPreview} from './browser-speech-preview';
9
- const PLAYER_VERSION='v33';
9
+ const PLAYER_VERSION='v35';
10
10
  const contextTime=(scene:{start:number;end:number}|undefined,time:number)=>
11
11
  Math.round(Math.max(scene?.start??0,Math.min(scene?.end??time,time))*10)/10;
12
12
  function App(){
@@ -73,7 +73,7 @@ function App(){
73
73
  const bar=Array.from(document.querySelectorAll<HTMLElement>('#remotion-canvas div')).find(el=>
74
74
  el.style.cursor==='pointer'&&el.style.touchAction==='none'&&el.style.position==='relative');
75
75
  if(bar){
76
- bar.style.marginLeft='22px';setSeekBar(bar);window.clearInterval(timer);
76
+ bar.style.marginLeft='44px';setSeekBar(bar);window.clearInterval(timer);
77
77
  }
78
78
  };
79
79
  find();timer=window.setInterval(find,150);
@@ -98,10 +98,12 @@ function App(){
98
98
  <input type="checkbox" checked={useBrowserTts} disabled={!data?.subtitle?.src} onChange={e=>setBrowserTts(e.target.checked)}/>
99
99
  Browser TTS
100
100
  </label>,document.getElementById("header-tts")!)}
101
- <div id="remotion-canvas" style={{width:'100%',aspectRatio:`${data.width||1080}/${data.height||1920}`,maxHeight:'65vh',margin:'auto'}}>
101
+ <div id="remotion-canvas" style={{position:'relative',width:'100%',aspectRatio:`${data.width||1080}/${data.height||1920}`,maxHeight:'65vh',margin:'auto'}}>
102
102
  <SharedPlayer key={revision.revisionId} root={playbackRoot} playerRef={ref} numberOfSharedAudioTags={0} style={{width:'100%',height:'100%'}} />
103
+ {useBrowserTts&&caption&&<div id="browser-tts-caption" aria-live="off" style={{position:'absolute',bottom:50,left:12,right:12,zIndex:5,pointerEvents:'none',textAlign:'center'}}>
104
+ <span style={{display:'inline-block',maxWidth:'90%',padding:'5px 10px',borderRadius:5,background:'rgba(0,0,0,.72)',color:'#fff',fontSize:'clamp(12px,1.6vw,18px)',lineHeight:1.4,textShadow:'0 1px 2px #000',overflowWrap:'anywhere'}}>{caption}</span>
105
+ </div>}
103
106
  </div>
104
- {useBrowserTts&&caption&&<div role="status" style={{textAlign:"center",padding:"6px 12px",fontSize:13}}>{caption}</div>}
105
107
  <SceneThumbnails sceneData={scenes} commentedScenes={commentedScenes} currentTime={currentTime} onSeek={t=>{ref.current?.seekTo(Math.round(t*fps));setCurrentTime(t);}} />
106
108
  {seekBar&&createPortal(<>
107
109
  {spotMarkers.map(note=>{
@@ -164,6 +164,28 @@ describe('MCP Remotion bridge',()=>{
164
164
  expect(h.nodes['overall-mode'].hidden).toBe(true);
165
165
  expect(h.nodes.feedback.value).toBe('');
166
166
  });
167
+ it('auto-saves edits and new overall drafts when switching marker selection',()=>{
168
+ const h=harness();
169
+ h.scene({sceneId:'s1',sceneName:'Scene-A',sceneStart:0,timeSeconds:0});
170
+ h.nodes.feedback.value='First spot';h.nodes['save-spot'].onclick?.();
171
+ h.scene({sceneId:'s1',sceneName:'Scene-A',sceneStart:0,timeSeconds:5});
172
+ h.nodes.feedback.value='Second spot';h.nodes['save-spot'].onclick?.();
173
+ let dots=h.events.filter(e=>e.type==='markcut:spots-change').at(-1).detail.spots;
174
+ const first=dots.find((x:any)=>x.text==='First spot');
175
+ const second=dots.find((x:any)=>x.text==='Second spot');
176
+ h.selectSpot(first.id);
177
+ h.nodes.feedback.value='Edited first spot';
178
+ h.selectSpot(second.id);
179
+ dots=h.events.filter(e=>e.type==='markcut:spots-change').at(-1).detail.spots;
180
+ expect(dots.find((x:any)=>x.id===first.id)).toMatchObject({text:'Edited first spot',context:{timeSeconds:0}});
181
+ expect(dots.find((x:any)=>x.id===second.id).selected).toBe(true);
182
+ h.nodes.feedback.value='';h.selectSpot(first.id);
183
+ dots=h.events.filter(e=>e.type==='markcut:spots-change').at(-1).detail.spots;
184
+ expect(dots.find((x:any)=>x.id===second.id).text).toBe('Second spot');
185
+ h.selectSpot(0);h.nodes.feedback.value='Overall draft';h.selectSpot(second.id);
186
+ dots=h.events.filter(e=>e.type==='markcut:spots-change').at(-1).detail.spots;
187
+ expect(dots.filter((x:any)=>x.scope==='overall')).toEqual([expect.objectContaining({text:'Overall draft'})]);
188
+ });
167
189
  it('saves overall, scene and spot scopes at their canonical timeline positions',()=>{
168
190
  const h=harness();h.result({id:'multi',revisionId:'r1',contentHash:'hash',compiled:{children:[]}});
169
191
  h.selectSpot(0);
@@ -11,7 +11,7 @@ describe('Markcut Remotion MCP App',()=>{
11
11
  const html=buildPreviewHtml();
12
12
  expect(html).toContain('id="remotion-root"');
13
13
  expect(html).toContain('id="player-version"');
14
- expect(html).toContain('>v33</span>');
14
+ expect(html).toContain('>v35</span>');
15
15
  expect(html).toContain('id="video-md-version"');
16
16
  expect(html).toContain('<textarea id="feedback" rows="3"');
17
17
  expect(html).toContain('id="comment-tools"');