screw-bugs 0.1.1 → 0.1.2
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/README.md +69 -19
- package/dist/browser-playwright/launch.js +3 -1
- package/dist/browser-playwright/page.d.ts +3 -11
- package/dist/browser-playwright/page.js +17 -1
- package/dist/browser-playwright/sign-in.d.ts +77 -0
- package/dist/browser-playwright/sign-in.js +217 -0
- package/dist/build-info.json +3 -3
- package/dist/cli/app.js +4 -1
- package/dist/cli/commands.js +68 -3
- package/dist/cli/exit-codes.d.ts +6 -0
- package/dist/cli/exit-codes.js +6 -0
- package/dist/cli/mcp.js +17 -3
- package/dist/cli/operations.d.ts +31 -3
- package/dist/cli/operations.js +95 -3
- package/dist/cli/sign-in.d.ts +79 -0
- package/dist/cli/sign-in.js +305 -0
- package/dist/core/accounts.d.ts +40 -0
- package/dist/core/accounts.js +95 -0
- package/dist/core/engine.d.ts +4 -3
- package/dist/core/engine.js +30 -8
- package/dist/core/errors.d.ts +19 -0
- package/dist/core/errors.js +6 -0
- package/dist/core/index.d.ts +1 -0
- package/dist/core/index.js +1 -0
- package/dist/core/services.d.ts +77 -8
- package/dist/core/services.js +4 -1
- package/dist/report/bug.d.ts +2 -2
- package/dist/report/bug.js +5 -4
- package/dist/report/html.d.ts +1 -1
- package/dist/report/icons.d.ts +1 -0
- package/dist/report/icons.js +1 -0
- package/dist/report/index.d.ts +1 -0
- package/dist/report/index.js +1 -0
- package/dist/report/markup.d.ts +2 -0
- package/dist/report/markup.js +5 -4
- package/dist/report/player.d.ts +7 -2
- package/dist/report/player.js +16 -5
- package/dist/report/sign-in.d.ts +41 -0
- package/dist/report/sign-in.js +591 -0
- package/dist/report/styles.js +1 -1
- package/dist/report/walkthrough.d.ts +3 -2
- package/dist/report/walkthrough.js +47 -38
- package/dist/schema/accounts.d.ts +137 -0
- package/dist/schema/accounts.js +112 -0
- package/dist/schema/index.d.ts +1 -0
- package/dist/schema/index.js +1 -0
- package/dist/schema/job.d.ts +27 -6
- package/dist/schema/job.js +12 -2
- package/dist/schema/ledger.d.ts +5 -1
- package/dist/store-local/accounts.d.ts +8 -4
- package/dist/store-local/accounts.js +82 -7
- package/dist/store-local/paths.d.ts +4 -1
- package/dist/store-local/paths.js +4 -1
- package/package.json +1 -1
package/dist/report/markup.js
CHANGED
|
@@ -77,11 +77,11 @@ export const favicon = html `<link
|
|
|
77
77
|
href="${`data:image/svg+xml,${FAVICON_SVG.replaceAll('#', '%23')}`}"
|
|
78
78
|
/>`;
|
|
79
79
|
/**
|
|
80
|
-
* Geist and Geist Mono from Google Fonts, in exactly the weights the
|
|
81
|
-
* 500 and 700; Geist Mono 400 and 500). Offline, or where Google cannot be reached, the pages use
|
|
80
|
+
* Geist and Geist Mono from Google Fonts, in exactly the weights the pages use (Geist 400,
|
|
81
|
+
* 500, 600 for the sign-in page's menu bar, and 700; Geist Mono 400 and 500). Offline, or where Google cannot be reached, the pages use
|
|
82
82
|
* the system fonts after them in `--sans` and `--mono`. The CSPs allow these two hosts only.
|
|
83
83
|
*/
|
|
84
|
-
const GOOGLE_FONTS_CSS = 'https://fonts.googleapis.com/css2?family=Geist:wght@400;500;700&family=Geist+Mono:wght@400;500&display=swap';
|
|
84
|
+
const GOOGLE_FONTS_CSS = 'https://fonts.googleapis.com/css2?family=Geist:wght@400;500;600;700&family=Geist+Mono:wght@400;500&display=swap';
|
|
85
85
|
export const webFonts = html `<link rel="preconnect" href="https://fonts.googleapis.com" />
|
|
86
86
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
|
87
87
|
<link rel="stylesheet" href="${GOOGLE_FONTS_CSS}" />`;
|
|
@@ -140,7 +140,8 @@ const bugMark = (gif, color, theme) => html `<picture class="${`bug bug-${theme}
|
|
|
140
140
|
><source media="(prefers-reduced-motion: reduce)" srcset="${bugStill(color)}" />
|
|
141
141
|
<img src="${gif}" alt=""
|
|
142
142
|
/></picture>`;
|
|
143
|
-
|
|
143
|
+
/** The bug of each theme (`bugMark`), for the top bars. */
|
|
144
|
+
export const brandMark = html `${bugMark(BUG_GIF_ON_LIGHT, BUG_DARK, 'light')}${bugMark(BUG_GIF_ON_DARK, BUG_LIME, 'dark')}`;
|
|
144
145
|
/**
|
|
145
146
|
* Where a page's Share button starts sharing its run on screw-bugs Cloud: a route of the local
|
|
146
147
|
* report server (`src/cli/share.ts`), by absolute path, so it is the server the page came from.
|
package/dist/report/player.d.ts
CHANGED
|
@@ -67,7 +67,12 @@ export declare const share: (ms: number, of: number | undefined) => string;
|
|
|
67
67
|
* "Show full prompt" (offered only when it does not fit, measured again whenever the prompt's box
|
|
68
68
|
* changes size and once the page's fonts have loaded; while open it stays, as "Show less"), and `player(prefix, hooks)`, which takes over the video:
|
|
69
69
|
* custom controls, speed, a scrubber that seeks by pointer and by keys, fullscreen (of the video, or
|
|
70
|
-
* of the element `full` names;
|
|
70
|
+
* of the element `full` names; where `inPage()` says so, or the browser has no fullscreen, that
|
|
71
|
+
* element gets the class `focus` instead, the page laying itself out as fullscreen would without
|
|
72
|
+
* taking the browser's screen, and Escape leaves it; its button turns into "Exit fullscreen"
|
|
73
|
+
* while it is), the space bar, a click on the video (plays or pauses it, as the play button does;
|
|
74
|
+
* with `expand`, where `o.inPage()` says so (not merely for want of fullscreen), a click on the
|
|
75
|
+
* video or its big play button first lays it out that way and plays),
|
|
71
76
|
* the URL field (the last address recorded by the time shown), session videos (switched with
|
|
72
77
|
* `load`, moving on to the next session when one ends) and a video that does not load (its note
|
|
73
78
|
* takes the player's place, naming the file, while other sessions still play). `none` stops the
|
|
@@ -78,4 +83,4 @@ export declare const share: (ms: number, of: number | undefined) => string;
|
|
|
78
83
|
* hooks use. The big play button over the video shows from the start until the video first plays
|
|
79
84
|
* (by whatever control), and never after. Plain ES2020; no backslashes, so it reads the same in the TypeScript source.
|
|
80
85
|
*/
|
|
81
|
-
export declare const PLAYER_JS = "const d=document,r=d.documentElement,K='screw-bugs-theme';\nconst still=()=>matchMedia('(prefers-reduced-motion: reduce)').matches;\nconst topEdge=()=>{const b=d.querySelector('.top');return b?Math.max(0,b.getBoundingClientRect().bottom):0};\nconst pad=n=>String(n).padStart(2,'0');\nconst clock=s=>{s=Math.max(0,Math.floor(s||0));const h=Math.floor(s/3600),m=Math.floor(s%3600/60);return(h?h+':'+pad(m):String(m))+':'+pad(s%60)};\nconst setTheme=m=>{r.dataset.theme=m;d.querySelectorAll('[data-theme-set]').forEach(b=>b.setAttribute('aria-pressed',String(b.dataset.themeSet===m)))};\nlet theme='system';try{theme=localStorage.getItem(K)||theme}catch(e){}r.dataset.theme=theme;\nconst chrome=()=>{\n setTheme(r.dataset.theme);\n d.querySelectorAll('.theme').forEach(t=>{t.hidden=false});\n if(location.protocol==='http:'&&(location.hostname==='127.0.0.1'||location.hostname==='localhost'))d.querySelectorAll('a.share-btn').forEach(a=>{a.hidden=false});\n d.querySelectorAll('time.when[datetime]').forEach(e=>{\n const t=new Date(e.getAttribute('datetime'));if(isNaN(t.getTime()))return;const p={};\n try{new Intl.DateTimeFormat('en-US',{month:'short',day:'numeric',year:'numeric',hour:'2-digit',minute:'2-digit',hourCycle:'h23'}).formatToParts(t).forEach(x=>{p[x.type]=x.value});\n e.textContent=p.month+' '+p.day+', '+p.year+' '+String.fromCharCode(183)+' '+p.hour+':'+p.minute;\n e.title=new Intl.DateTimeFormat('en-US',{dateStyle:'full',timeStyle:'long'}).format(t)}catch(x){}\n });\n d.addEventListener('click',e=>{const b=e.target.closest('[data-theme-set]');if(!b)return;setTheme(b.dataset.themeSet);try{localStorage.setItem(K,b.dataset.themeSet)}catch(x){}});\n d.querySelectorAll('.prompt').forEach(p=>{\n const t=p.querySelector('.prompt-text'),b=p.querySelector('.prompt-more');if(!t||!b)return;\n const fits=()=>{if(!p.classList.contains('open'))b.hidden=t.scrollHeight<=t.clientHeight+1};\n fits();if(window.ResizeObserver)new ResizeObserver(fits).observe(t);if(d.fonts&&d.fonts.ready)d.fonts.ready.then(fits);\n b.addEventListener('click',()=>{const o=p.classList.toggle('open');b.textContent=o?'Show less':'Show full prompt';b.setAttribute('aria-expanded',String(o));fits()});\n });\n};\nconst bare=u=>{const i=u.indexOf('://');return i<0?u:u.slice(i+3)};\nconst player=(p,o)=>{\n const v=d.getElementById(p+'-video'),fig=v.closest('.player'),note=d.getElementById(p+'-unloaded'),c=d.getElementById(p+'-controls'),url=d.getElementById(p+'-url');\n const srcs=new Map([...fig.querySelectorAll('[data-session-src]')].map(e=>[e.dataset.session,e.dataset.sessionSrc]));\n const order=[...srcs.keys()];\n const urls=[...fig.querySelectorAll('[data-url]')].map(e=>({s:e.dataset.s,t:Number(e.dataset.at),u:e.dataset.url}));\n const dead=new Set(),empty=d.getElementById(p+'-none');let cur=v.dataset.session,down=null,held=false,ask=0,auto=false,rate=1,raf=0,drag=false;\n const play=c.querySelector('.play'),now=c.querySelector('.now'),total=c.querySelector('.total'),bar=c.querySelector('.scrub'),head=c.querySelector('.head'),tracks=[...c.querySelectorAll('.track')];\n v.removeAttribute('controls');c.hidden=false;\n const big=d.getElementById(p+'-start');\n if(big){big.hidden=false;big.addEventListener('click',()=>v.play().catch(()=>{}));v.addEventListener('play',()=>big.remove(),{once:true})}\n const track=()=>tracks.find(t=>t.dataset.s===cur);\n const len=()=>{const t=track(),n=t?Number(t.dataset.total):0;return n>0?n:(isFinite(v.duration)?v.duration:0)};\n const paint=()=>{\n const L=len(),t=v.currentTime,f=L?Math.min(1,t/L):0,k=track();\n tracks.forEach(x=>{x.hidden=x!==k});head.style.left=(f*100)+'%';\n const done=k&&k.querySelector('.done');if(done)done.style.width=(f*100)+'%';\n now.textContent=clock(t);total.textContent=clock(L);\n bar.setAttribute('aria-valuemax',String(Math.round(L)));bar.setAttribute('aria-valuenow',String(Math.round(t)));bar.setAttribute('aria-valuetext',clock(t)+' of '+clock(L));\n play.classList.toggle('playing',!v.paused);play.setAttribute('aria-label',v.paused?'Play':'Pause');\n if(url){let u='';if(down!=='')for(const x of urls){if(x.s===cur&&x.t<=t+0.02)u=x.u}url.textContent=bare(u);url.parentElement.title=u}\n };\n const update=()=>{paint();if(o.tick)o.tick(v.currentTime)};\n const frame=()=>{update();raf=v.paused?0:requestAnimationFrame(frame)};\n const show=s=>{if(down===null)held=!v.paused;down=s;v.pause();fig.classList.add('broken');c.hidden=true;if(empty)empty.hidden=true;if(note){note.hidden=false;const a=note.querySelector('a');if(a){a.href=srcs.get(s);a.textContent=srcs.get(s)}}if(o.broken)o.broken()};\n const fine=()=>{if(down===null)return;down=null;fig.classList.remove('broken');c.hidden=false;if(note)note.hidden=true;if(empty)empty.hidden=true;if(o.fine)o.fine()};\n const none=()=>{if(down===null)held=!v.paused;++ask;auto=false;down='';v.pause();fig.classList.add('broken');c.hidden=true;if(note)note.hidden=true;if(empty)empty.hidden=false;paint();if(o.broken)o.broken()};\n const playing=()=>down===null?!v.paused:held;\n const next=s=>order.slice(order.indexOf(s)+1).find(n=>!dead.has(n));\n const load=(s,t,go,a)=>{\n const my=++ask;auto=!!a;if(dead.has(s))return show(s);\n if(s!==cur||!v.currentSrc||v.error){cur=s;v.dataset.session=s;v.src=srcs.get(s);v.load()}\n const done=()=>{if(my!==ask)return;auto=false;fine();v.playbackRate=rate;v.currentTime=t;update();if(go)v.play().catch(()=>{})};\n if(v.readyState>0)done();else v.addEventListener('loadedmetadata',done,{once:true});\n };\n const bad=()=>{if(!v.error)return;dead.add(cur);if(down==='')return;const n=auto?next(cur):undefined;if(n!==undefined)return load(n,0,true,true);auto=false;show(cur)};\n ['timeupdate','seeked','loadedmetadata','pause','play','durationchange'].forEach(n=>v.addEventListener(n,update));\n v.addEventListener('play',()=>{if(!raf)raf=requestAnimationFrame(frame)});\n addEventListener('resize',update);\n v.addEventListener('error',bad);if(v.error)queueMicrotask(bad);\n v.addEventListener('ended',()=>{if(o.ended&&o.ended())return;const n=next(cur);if(n!==undefined)load(n,0,true,true)});\n play.addEventListener('click',()=>{if(v.paused)v.play().catch(()=>{});else v.pause()});\n c.querySelectorAll('[data-rate]').forEach(b=>b.addEventListener('click',()=>{rate=Number(b.dataset.rate);v.playbackRate=rate;v.defaultPlaybackRate=rate;c.querySelectorAll('[data-rate]').forEach(x=>x.setAttribute('aria-pressed',String(x===b)))}));\n const seek=t=>{const L=len();t=Math.max(0,L?Math.min(L,t):t);v.currentTime=t;if(o.seek)o.seek(t);update()};\n const at=e=>{const b=bar.getBoundingClientRect();return Math.max(0,Math.min(1,(e.clientX-b.left)/b.width))*len()};\n bar.addEventListener('pointerdown',e=>{if(e.button>0||down!==null)return;drag=true;bar.setPointerCapture(e.pointerId);seek(at(e))});\n bar.addEventListener('pointermove',e=>{if(drag)seek(at(e))});\n ['pointerup','pointercancel'].forEach(n=>bar.addEventListener(n,()=>{drag=false}));\n bar.addEventListener('keydown',e=>{\n const k=e.key,t=v.currentTime,by={ArrowLeft:-1,ArrowDown:-1,ArrowRight:1,ArrowUp:1,PageDown:-10,PageUp:10}[k];\n const to=by!==undefined?t+by:k==='Home'?0:k==='End'?len():null;if(to===null)return;e.preventDefault();seek(to);\n });\n const full=c.querySelector('.full'),screen=o.full||fig.querySelector('.screen');\n
|
|
86
|
+
export declare const PLAYER_JS = "const d=document,r=d.documentElement,K='screw-bugs-theme';\nconst still=()=>matchMedia('(prefers-reduced-motion: reduce)').matches;\nconst topEdge=()=>{const b=d.querySelector('.top');return b?Math.max(0,b.getBoundingClientRect().bottom):0};\nconst pad=n=>String(n).padStart(2,'0');\nconst clock=s=>{s=Math.max(0,Math.floor(s||0));const h=Math.floor(s/3600),m=Math.floor(s%3600/60);return(h?h+':'+pad(m):String(m))+':'+pad(s%60)};\nconst setTheme=m=>{r.dataset.theme=m;d.querySelectorAll('[data-theme-set]').forEach(b=>b.setAttribute('aria-pressed',String(b.dataset.themeSet===m)))};\nlet theme='system';try{theme=localStorage.getItem(K)||theme}catch(e){}r.dataset.theme=theme;\nconst chrome=()=>{\n setTheme(r.dataset.theme);\n d.querySelectorAll('.theme').forEach(t=>{t.hidden=false});\n if(location.protocol==='http:'&&(location.hostname==='127.0.0.1'||location.hostname==='localhost'))d.querySelectorAll('a.share-btn').forEach(a=>{a.hidden=false});\n d.querySelectorAll('time.when[datetime]').forEach(e=>{\n const t=new Date(e.getAttribute('datetime'));if(isNaN(t.getTime()))return;const p={};\n try{new Intl.DateTimeFormat('en-US',{month:'short',day:'numeric',year:'numeric',hour:'2-digit',minute:'2-digit',hourCycle:'h23'}).formatToParts(t).forEach(x=>{p[x.type]=x.value});\n e.textContent=p.month+' '+p.day+', '+p.year+' '+String.fromCharCode(183)+' '+p.hour+':'+p.minute;\n e.title=new Intl.DateTimeFormat('en-US',{dateStyle:'full',timeStyle:'long'}).format(t)}catch(x){}\n });\n d.addEventListener('click',e=>{const b=e.target.closest('[data-theme-set]');if(!b)return;setTheme(b.dataset.themeSet);try{localStorage.setItem(K,b.dataset.themeSet)}catch(x){}});\n d.querySelectorAll('.prompt').forEach(p=>{\n const t=p.querySelector('.prompt-text'),b=p.querySelector('.prompt-more');if(!t||!b)return;\n const fits=()=>{if(!p.classList.contains('open'))b.hidden=t.scrollHeight<=t.clientHeight+1};\n fits();if(window.ResizeObserver)new ResizeObserver(fits).observe(t);if(d.fonts&&d.fonts.ready)d.fonts.ready.then(fits);\n b.addEventListener('click',()=>{const o=p.classList.toggle('open');b.textContent=o?'Show less':'Show full prompt';b.setAttribute('aria-expanded',String(o));fits()});\n });\n};\nconst bare=u=>{const i=u.indexOf('://');return i<0?u:u.slice(i+3)};\nconst player=(p,o)=>{\n const v=d.getElementById(p+'-video'),fig=v.closest('.player'),note=d.getElementById(p+'-unloaded'),c=d.getElementById(p+'-controls'),url=d.getElementById(p+'-url');\n const srcs=new Map([...fig.querySelectorAll('[data-session-src]')].map(e=>[e.dataset.session,e.dataset.sessionSrc]));\n const order=[...srcs.keys()];\n const urls=[...fig.querySelectorAll('[data-url]')].map(e=>({s:e.dataset.s,t:Number(e.dataset.at),u:e.dataset.url}));\n const dead=new Set(),empty=d.getElementById(p+'-none');let cur=v.dataset.session,down=null,held=false,ask=0,auto=false,rate=1,raf=0,drag=false;\n const play=c.querySelector('.play'),now=c.querySelector('.now'),total=c.querySelector('.total'),bar=c.querySelector('.scrub'),head=c.querySelector('.head'),tracks=[...c.querySelectorAll('.track')];\n v.removeAttribute('controls');c.hidden=false;\n const big=d.getElementById(p+'-start');\n if(big){big.hidden=false;big.addEventListener('click',()=>{grow();v.play().catch(()=>{})});v.addEventListener('play',()=>big.remove(),{once:true})}\n const track=()=>tracks.find(t=>t.dataset.s===cur);\n const len=()=>{const t=track(),n=t?Number(t.dataset.total):0;return n>0?n:(isFinite(v.duration)?v.duration:0)};\n const paint=()=>{\n const L=len(),t=v.currentTime,f=L?Math.min(1,t/L):0,k=track();\n tracks.forEach(x=>{x.hidden=x!==k});head.style.left=(f*100)+'%';\n const done=k&&k.querySelector('.done');if(done)done.style.width=(f*100)+'%';\n now.textContent=clock(t);total.textContent=clock(L);\n bar.setAttribute('aria-valuemax',String(Math.round(L)));bar.setAttribute('aria-valuenow',String(Math.round(t)));bar.setAttribute('aria-valuetext',clock(t)+' of '+clock(L));\n play.classList.toggle('playing',!v.paused);play.setAttribute('aria-label',v.paused?'Play':'Pause');\n if(url){let u='';if(down!=='')for(const x of urls){if(x.s===cur&&x.t<=t+0.02)u=x.u}url.textContent=bare(u);url.parentElement.title=u}\n };\n const update=()=>{paint();if(o.tick)o.tick(v.currentTime)};\n const frame=()=>{update();raf=v.paused?0:requestAnimationFrame(frame)};\n const show=s=>{if(down===null)held=!v.paused;down=s;v.pause();fig.classList.add('broken');c.hidden=true;if(empty)empty.hidden=true;if(note){note.hidden=false;const a=note.querySelector('a');if(a){a.href=srcs.get(s);a.textContent=srcs.get(s)}}if(o.broken)o.broken()};\n const fine=()=>{if(down===null)return;down=null;fig.classList.remove('broken');c.hidden=false;if(note)note.hidden=true;if(empty)empty.hidden=true;if(o.fine)o.fine()};\n const none=()=>{if(down===null)held=!v.paused;++ask;auto=false;down='';v.pause();fig.classList.add('broken');c.hidden=true;if(note)note.hidden=true;if(empty)empty.hidden=false;paint();if(o.broken)o.broken()};\n const playing=()=>down===null?!v.paused:held;\n const next=s=>order.slice(order.indexOf(s)+1).find(n=>!dead.has(n));\n const load=(s,t,go,a)=>{\n const my=++ask;auto=!!a;if(dead.has(s))return show(s);\n if(s!==cur||!v.currentSrc||v.error){cur=s;v.dataset.session=s;v.src=srcs.get(s);v.load()}\n const done=()=>{if(my!==ask)return;auto=false;fine();v.playbackRate=rate;v.currentTime=t;update();if(go)v.play().catch(()=>{})};\n if(v.readyState>0)done();else v.addEventListener('loadedmetadata',done,{once:true});\n };\n const bad=()=>{if(!v.error)return;dead.add(cur);if(down==='')return;const n=auto?next(cur):undefined;if(n!==undefined)return load(n,0,true,true);auto=false;show(cur)};\n ['timeupdate','seeked','loadedmetadata','pause','play','durationchange'].forEach(n=>v.addEventListener(n,update));\n v.addEventListener('play',()=>{if(!raf)raf=requestAnimationFrame(frame)});\n addEventListener('resize',update);\n v.addEventListener('error',bad);if(v.error)queueMicrotask(bad);\n v.addEventListener('ended',()=>{if(o.ended&&o.ended())return;const n=next(cur);if(n!==undefined)load(n,0,true,true)});\n play.addEventListener('click',()=>{if(v.paused)v.play().catch(()=>{});else v.pause()});\n v.addEventListener('click',()=>{if(down!==null)return;if(grow())v.play().catch(()=>{});else play.click()});\n c.querySelectorAll('[data-rate]').forEach(b=>b.addEventListener('click',()=>{rate=Number(b.dataset.rate);v.playbackRate=rate;v.defaultPlaybackRate=rate;c.querySelectorAll('[data-rate]').forEach(x=>x.setAttribute('aria-pressed',String(x===b)))}));\n const seek=t=>{const L=len();t=Math.max(0,L?Math.min(L,t):t);v.currentTime=t;if(o.seek)o.seek(t);update()};\n const at=e=>{const b=bar.getBoundingClientRect();return Math.max(0,Math.min(1,(e.clientX-b.left)/b.width))*len()};\n bar.addEventListener('pointerdown',e=>{if(e.button>0||down!==null)return;drag=true;bar.setPointerCapture(e.pointerId);seek(at(e))});\n bar.addEventListener('pointermove',e=>{if(drag)seek(at(e))});\n ['pointerup','pointercancel'].forEach(n=>bar.addEventListener(n,()=>{drag=false}));\n bar.addEventListener('keydown',e=>{\n const k=e.key,t=v.currentTime,by={ArrowLeft:-1,ArrowDown:-1,ArrowRight:1,ArrowUp:1,PageDown:-10,PageUp:10}[k];\n const to=by!==undefined?t+by:k==='Home'?0:k==='End'?len():null;if(to===null)return;e.preventDefault();seek(to);\n });\n const full=c.querySelector('.full'),screen=o.full||fig.querySelector('.screen');\n const api=!!(d.fullscreenEnabled&&screen.requestFullscreen),inPage=()=>!!o.inPage&&(o.inPage()||!api);\n const mark=()=>{const f=d.fullscreenElement===screen||screen.classList.contains('focus');full.classList.toggle('out',f);full.setAttribute('aria-label',f?'Exit fullscreen':'Fullscreen');update()};\n let back=0;const focus=on=>{if(on)back=scrollY;screen.classList.toggle('focus',on);scrollTo({top:on?0:back,behavior:'auto'});mark()};\n const grow=()=>{if(!o.expand||!o.inPage||!o.inPage()||d.fullscreenElement||screen.classList.contains('focus'))return false;focus(true);return true};\n if(!api&&!o.inPage)full.hidden=true;\n else{full.addEventListener('click',()=>{const f=screen.classList.contains('focus');if(d.fullscreenElement){d.exitFullscreen().catch(()=>{});if(f)focus(false)}else if(f)focus(false);else if(inPage())focus(true);else screen.requestFullscreen().catch(()=>{})});\n d.addEventListener('fullscreenchange',mark);\n d.addEventListener('keydown',e=>{if(e.key==='Escape'&&!e.defaultPrevented&&screen.classList.contains('focus')&&!d.querySelector('dialog[open]')){e.preventDefault();focus(false)}})}\n d.addEventListener('keydown',e=>{if(e.key!==' '||down!==null||e.defaultPrevented||d.querySelector('dialog[open]')||e.target.closest('button,a,input,textarea,select,summary,[role=slider]'))return;e.preventDefault();play.click()});\n return {v,load,none,playing,update,len,cur:()=>cur,down:()=>down,has:s=>srcs.has(s)};\n};\n";
|
package/dist/report/player.js
CHANGED
|
@@ -157,7 +157,12 @@ export const share = (ms, of) => of === undefined || of <= 0
|
|
|
157
157
|
* "Show full prompt" (offered only when it does not fit, measured again whenever the prompt's box
|
|
158
158
|
* changes size and once the page's fonts have loaded; while open it stays, as "Show less"), and `player(prefix, hooks)`, which takes over the video:
|
|
159
159
|
* custom controls, speed, a scrubber that seeks by pointer and by keys, fullscreen (of the video, or
|
|
160
|
-
* of the element `full` names;
|
|
160
|
+
* of the element `full` names; where `inPage()` says so, or the browser has no fullscreen, that
|
|
161
|
+
* element gets the class `focus` instead, the page laying itself out as fullscreen would without
|
|
162
|
+
* taking the browser's screen, and Escape leaves it; its button turns into "Exit fullscreen"
|
|
163
|
+
* while it is), the space bar, a click on the video (plays or pauses it, as the play button does;
|
|
164
|
+
* with `expand`, where `o.inPage()` says so (not merely for want of fullscreen), a click on the
|
|
165
|
+
* video or its big play button first lays it out that way and plays),
|
|
161
166
|
* the URL field (the last address recorded by the time shown), session videos (switched with
|
|
162
167
|
* `load`, moving on to the next session when one ends) and a video that does not load (its note
|
|
163
168
|
* takes the player's place, naming the file, while other sessions still play). `none` stops the
|
|
@@ -203,7 +208,7 @@ const player=(p,o)=>{
|
|
|
203
208
|
const play=c.querySelector('.play'),now=c.querySelector('.now'),total=c.querySelector('.total'),bar=c.querySelector('.scrub'),head=c.querySelector('.head'),tracks=[...c.querySelectorAll('.track')];
|
|
204
209
|
v.removeAttribute('controls');c.hidden=false;
|
|
205
210
|
const big=d.getElementById(p+'-start');
|
|
206
|
-
if(big){big.hidden=false;big.addEventListener('click',()=>v.play().catch(()=>{}));v.addEventListener('play',()=>big.remove(),{once:true})}
|
|
211
|
+
if(big){big.hidden=false;big.addEventListener('click',()=>{grow();v.play().catch(()=>{})});v.addEventListener('play',()=>big.remove(),{once:true})}
|
|
207
212
|
const track=()=>tracks.find(t=>t.dataset.s===cur);
|
|
208
213
|
const len=()=>{const t=track(),n=t?Number(t.dataset.total):0;return n>0?n:(isFinite(v.duration)?v.duration:0)};
|
|
209
214
|
const paint=()=>{
|
|
@@ -235,6 +240,7 @@ const player=(p,o)=>{
|
|
|
235
240
|
v.addEventListener('error',bad);if(v.error)queueMicrotask(bad);
|
|
236
241
|
v.addEventListener('ended',()=>{if(o.ended&&o.ended())return;const n=next(cur);if(n!==undefined)load(n,0,true,true)});
|
|
237
242
|
play.addEventListener('click',()=>{if(v.paused)v.play().catch(()=>{});else v.pause()});
|
|
243
|
+
v.addEventListener('click',()=>{if(down!==null)return;if(grow())v.play().catch(()=>{});else play.click()});
|
|
238
244
|
c.querySelectorAll('[data-rate]').forEach(b=>b.addEventListener('click',()=>{rate=Number(b.dataset.rate);v.playbackRate=rate;v.defaultPlaybackRate=rate;c.querySelectorAll('[data-rate]').forEach(x=>x.setAttribute('aria-pressed',String(x===b)))}));
|
|
239
245
|
const seek=t=>{const L=len();t=Math.max(0,L?Math.min(L,t):t);v.currentTime=t;if(o.seek)o.seek(t);update()};
|
|
240
246
|
const at=e=>{const b=bar.getBoundingClientRect();return Math.max(0,Math.min(1,(e.clientX-b.left)/b.width))*len()};
|
|
@@ -246,9 +252,14 @@ const player=(p,o)=>{
|
|
|
246
252
|
const to=by!==undefined?t+by:k==='Home'?0:k==='End'?len():null;if(to===null)return;e.preventDefault();seek(to);
|
|
247
253
|
});
|
|
248
254
|
const full=c.querySelector('.full'),screen=o.full||fig.querySelector('.screen');
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
255
|
+
const api=!!(d.fullscreenEnabled&&screen.requestFullscreen),inPage=()=>!!o.inPage&&(o.inPage()||!api);
|
|
256
|
+
const mark=()=>{const f=d.fullscreenElement===screen||screen.classList.contains('focus');full.classList.toggle('out',f);full.setAttribute('aria-label',f?'Exit fullscreen':'Fullscreen');update()};
|
|
257
|
+
let back=0;const focus=on=>{if(on)back=scrollY;screen.classList.toggle('focus',on);scrollTo({top:on?0:back,behavior:'auto'});mark()};
|
|
258
|
+
const grow=()=>{if(!o.expand||!o.inPage||!o.inPage()||d.fullscreenElement||screen.classList.contains('focus'))return false;focus(true);return true};
|
|
259
|
+
if(!api&&!o.inPage)full.hidden=true;
|
|
260
|
+
else{full.addEventListener('click',()=>{const f=screen.classList.contains('focus');if(d.fullscreenElement){d.exitFullscreen().catch(()=>{});if(f)focus(false)}else if(f)focus(false);else if(inPage())focus(true);else screen.requestFullscreen().catch(()=>{})});
|
|
261
|
+
d.addEventListener('fullscreenchange',mark);
|
|
262
|
+
d.addEventListener('keydown',e=>{if(e.key==='Escape'&&!e.defaultPrevented&&screen.classList.contains('focus')&&!d.querySelector('dialog[open]')){e.preventDefault();focus(false)}})}
|
|
252
263
|
d.addEventListener('keydown',e=>{if(e.key!==' '||down!==null||e.defaultPrevented||d.querySelector('dialog[open]')||e.target.closest('button,a,input,textarea,select,summary,[role=slider]'))return;e.preventDefault();play.click()});
|
|
253
264
|
return {v,load,none,playing,update,len,cur:()=>cur,down:()=>down,has:s=>srcs.has(s)};
|
|
254
265
|
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Rive's web runtime (its canvas renderer without text and audio, which the animation does not
|
|
3
|
+
* use), on jsDelivr at an exact version: the script, taken only with `RIVE_JS_SRI`, and its
|
|
4
|
+
* WebAssembly, which the script fetches.
|
|
5
|
+
*/
|
|
6
|
+
export declare const RIVE_RUNTIME = "https://cdn.jsdelivr.net/npm/@rive-app/canvas-lite@2.48.0/";
|
|
7
|
+
/** The runtime script's Subresource Integrity hash: any other script at that URL is refused. */
|
|
8
|
+
export declare const RIVE_JS_SRI = "sha384-KKLeoe6TCJ0x8AYfmSeeOfpT6u1rpxnG6clu8dKuLNqMImJV40kWrCVhTU7lmcNg";
|
|
9
|
+
/**
|
|
10
|
+
* The animation the page plays (the bug kicks a lock open when the person starts), on screw-bugs'
|
|
11
|
+
* CDN, which allows any page to fetch it. The page is the same without it when it cannot load.
|
|
12
|
+
*/
|
|
13
|
+
export declare const SIGN_IN_ANIMATION = "https://static.screwbugs.dev/animations/auth-required.riv";
|
|
14
|
+
/**
|
|
15
|
+
* The script of the live view, with no values of its own (they are data attributes), so its
|
|
16
|
+
* hash is fixed. Frames come by long polling `frame?after=<seq>`; inputs go out in order, one
|
|
17
|
+
* request at a time, mouse moves merged. `410` from any route means the sign-in ended.
|
|
18
|
+
*/
|
|
19
|
+
export declare const SIGN_IN_SCRIPT = "(() => {\n 'use strict';\n const RIVE = 'https://cdn.jsdelivr.net/npm/@rive-app/canvas-lite@2.48.0/', RIVE_JS_SRI = 'sha384-KKLeoe6TCJ0x8AYfmSeeOfpT6u1rpxnG6clu8dKuLNqMImJV40kWrCVhTU7lmcNg', ANIMATION = 'https://static.screwbugs.dev/animations/auth-required.riv';\n // The animation's state while the bug waits by the lock (its `kick` trigger works only then),\n // and how long after the kick the bug has run off, when the browser shows (at most\n // `KICK_WAIT_MAX` after the person started, however long the bug took to reach the lock).\n const WAITING = 'Wait (idle)', KICK_MS = 2300, KICK_WAIT_MAX = 6000;\n const base = location.pathname.replace(/\\/+$/, '');\n const $ = (id) => document.getElementById(id);\n const img = $('screen'), stage = $('stage'), kb = $('keys'), addr = $('addr'), note = $('note');\n let seq = 0, fw = 1280, fh = 800, over = false, saving = false;\n const sleep = (ms) => new Promise((r) => setTimeout(r, ms));\n\n const end = (text) => {\n over = true;\n document.body.classList.add('over');\n note.textContent = text;\n $('ended').textContent = text;\n };\n const GONE = 'This sign-in has ended (it closes after 15 minutes without use), so nothing was saved. Ask your coding agent to start its job again for a new link.';\n\n const queue = [];\n // Inputs per request: under the server's limit (100, and 256 KB with text of up to 2000).\n const BATCH = 50;\n let sending = false;\n // Whether an input may not have reached the browser: Save then asks to check the page first.\n let lost = false;\n const flush = async () => {\n if (sending || over || queue.length === 0) return;\n sending = true;\n const batch = queue.splice(0, BATCH);\n try {\n const r = await fetch(base + '/input', {\n method: 'POST',\n headers: { 'content-type': 'application/json' },\n body: JSON.stringify(batch),\n });\n if (r.status === 410) end('This sign-in has ended. You can close this tab.');\n else if (!r.ok) lost = true;\n } catch {\n // It may or may not have been played; sending it again could type twice.\n lost = true;\n await sleep(500);\n }\n if (lost && !over) note.textContent = 'Some input may not have reached the browser; check the page shows what you expect.';\n sending = false;\n flush();\n };\n const send = (input) => {\n // Nothing more goes in once Save was pressed: the session is what the inputs before it made.\n if (saving || over) return;\n const last = queue[queue.length - 1];\n if (input.type === 'mouse' && input.kind === 'move' && last && last.type === 'mouse' && last.kind === 'move') queue[queue.length - 1] = input;\n else queue.push(input);\n flush();\n };\n\n const frames = async () => {\n let failures = 0;\n while (!over) {\n try {\n const r = await fetch(base + '/frame?after=' + seq, { cache: 'no-store' });\n failures = 0;\n if (r.status === 410) return end('This sign-in has ended. You can close this tab.');\n if (r.status === 200) {\n const f = await r.json();\n seq = f.seq; fw = f.width; fh = f.height;\n img.src = 'data:image/jpeg;base64,' + f.jpeg;\n addr.textContent = f.url;\n } else if (r.status !== 204) await sleep(1000);\n } catch {\n // Its server is gone (it ended, or the agent's process stopped): say so rather than wait.\n if (++failures >= 3) return end(GONE);\n await sleep(1000);\n }\n }\n };\n\n let sized;\n const resize = () => {\n clearTimeout(sized);\n sized = setTimeout(() => send({ type: 'viewport', width: Math.round(stage.clientWidth), height: Math.round(stage.clientHeight) }), 250);\n };\n addEventListener('resize', resize);\n\n const at = (e) => {\n const r = img.getBoundingClientRect();\n return {\n x: Math.round(((e.clientX - r.left) * fw) / Math.max(1, r.width)),\n y: Math.round(((e.clientY - r.top) * fh) / Math.max(1, r.height)),\n };\n };\n const button = (b) => (b === 1 ? 'middle' : b === 2 ? 'right' : 'left');\n let touch;\n img.addEventListener('contextmenu', (e) => e.preventDefault());\n img.addEventListener('pointerdown', (e) => {\n e.preventDefault();\n kb.focus({ preventScroll: true });\n img.setPointerCapture(e.pointerId);\n const p = at(e);\n if (e.pointerType === 'mouse') send({ type: 'mouse', kind: 'down', ...p, button: button(e.button), clickCount: Math.min(3, Math.max(1, e.detail || 1)) });\n else touch = { x: e.clientX, y: e.clientY, moved: false };\n });\n img.addEventListener('pointermove', (e) => {\n const p = at(e);\n if (e.pointerType === 'mouse') return send({ type: 'mouse', kind: 'move', ...p });\n if (!touch) return;\n const dx = e.clientX - touch.x, dy = e.clientY - touch.y;\n if (!touch.moved && Math.hypot(dx, dy) < 8) return;\n touch.moved = true;\n const scale = fw / Math.max(1, img.getBoundingClientRect().width);\n send({ type: 'wheel', ...p, dx: Math.round(-dx * scale), dy: Math.round(-dy * scale) });\n touch.x = e.clientX; touch.y = e.clientY;\n });\n img.addEventListener('pointerup', (e) => {\n const p = at(e);\n if (e.pointerType === 'mouse') return send({ type: 'mouse', kind: 'up', ...p, button: button(e.button), clickCount: Math.min(3, Math.max(1, e.detail || 1)) });\n if (touch && !touch.moved) {\n send({ type: 'mouse', kind: 'move', ...p });\n send({ type: 'mouse', kind: 'down', ...p, button: 'left', clickCount: 1 });\n send({ type: 'mouse', kind: 'up', ...p, button: 'left', clickCount: 1 });\n }\n touch = undefined;\n });\n img.addEventListener('pointercancel', () => { touch = undefined; });\n img.addEventListener('wheel', (e) => {\n e.preventDefault();\n const unit = e.deltaMode === 1 ? 16 : e.deltaMode === 2 ? fh : 1;\n send({ type: 'wheel', ...at(e), dx: Math.round(e.deltaX * unit), dy: Math.round(e.deltaY * unit) });\n }, { passive: false });\n\n const ignored = new Set(['Shift', 'Control', 'Alt', 'Meta', 'CapsLock', 'Unidentified', 'Dead', 'Process', 'Compose']);\n let composing = false;\n kb.addEventListener('compositionstart', () => { composing = true; });\n kb.addEventListener('compositionend', () => { composing = false; typed(); });\n kb.addEventListener('keydown', (e) => {\n if (e.isComposing || e.keyCode === 229 || ignored.has(e.key)) return;\n // A character typed with AltGr (an @ on many European keyboards, where it also reports Ctrl\n // and Alt) or with Option on a Mac is text, not a shortcut: the box gets it as input.\n const altGraph = e.getModifierState && e.getModifierState('AltGraph');\n if (e.key.length === 1 && (altGraph || (e.altKey && !e.ctrlKey && !e.metaKey))) return;\n const command = e.ctrlKey || e.metaKey || e.altKey;\n // Pasting goes in as text, from the paste itself.\n if (command && e.key.toLowerCase() === 'v') return;\n if (e.key.length === 1 && !command) return;\n e.preventDefault();\n const modifiers = [e.altKey && 'Alt', e.ctrlKey && 'Control', e.metaKey && 'Meta', e.shiftKey && 'Shift'].filter(Boolean);\n send({ type: 'key', key: e.key, modifiers });\n });\n // The box always holds one invisible character, so a phone keyboard's Backspace (often only\n // keyCode 229 or 'Unidentified' on keydown) has something to delete, which shows below.\n const MARK = '\u200B';\n const reset = () => {\n kb.value = MARK;\n kb.setSelectionRange(1, 1);\n };\n const typed = () => {\n if (composing) return;\n const value = kb.value;\n const text = value.split(MARK).join('');\n if (!value.includes(MARK) && !text) send({ type: 'key', key: 'Backspace', modifiers: [] });\n if (text) send({ type: 'text', text: text.slice(0, 2000) });\n reset();\n };\n kb.addEventListener('beforeinput', (e) => {\n // Deleting, as keyboards that send no key for it say it: played as the key itself.\n const key = e.inputType === 'deleteContentBackward' ? 'Backspace' : e.inputType === 'deleteContentForward' ? 'Delete' : undefined;\n if (key === undefined || !e.cancelable) return;\n e.preventDefault();\n send({ type: 'key', key, modifiers: [] });\n });\n kb.addEventListener('input', typed);\n kb.addEventListener('focus', reset);\n reset();\n\n $('back').addEventListener('click', () => send({ type: 'nav', kind: 'back' }));\n $('reload').addEventListener('click', () => send({ type: 'nav', kind: 'reload' }));\n const post = async (route) => {\n const r = await fetch(base + '/' + route, { method: 'POST', headers: { 'content-type': 'application/json' }, body: '{}' });\n return r;\n };\n /** Until every input already given has been played (or the sign-in ended). */\n const drained = async () => {\n while (!over && (sending || queue.length > 0)) await sleep(50);\n };\n $('save').addEventListener('click', async () => {\n if (saving || over) return;\n saving = true;\n document.body.classList.add('saving');\n note.textContent = 'Saving\u2026';\n try {\n await drained();\n if (over) return;\n if (lost) {\n lost = false;\n saving = false;\n document.body.classList.remove('saving');\n note.textContent = 'Some input did not reach the browser, so nothing was saved yet. Check the page shows you signed in, then press Save sign-in again.';\n return;\n }\n const r = await post('save');\n if (r.ok) return end('Saved. You can close this tab; your coding agent can start the run again.');\n if (r.status === 410) return end('This sign-in has ended. You can close this tab.');\n note.textContent = 'Could not save: ' + (await r.text());\n } catch {\n note.textContent = 'Could not reach screw-bugs to save. Try again.';\n }\n saving = false;\n document.body.classList.remove('saving');\n });\n $('cancel').addEventListener('click', async () => {\n try { await post('cancel'); } catch {}\n end('Cancelled. Nothing was saved. You can close this tab.');\n });\n\n // The theme: light, dark or the system's, in turn, as on screw-bugs Cloud's menu bar; the button\n // shows the current one (the reports' tokens follow `data-theme`).\n const root = document.documentElement, themes = ['light', 'dark', 'system'];\n const names = { light: 'Light theme', dark: 'Dark theme', system: 'Theme from system' };\n $('theme').addEventListener('click', (e) => {\n const now = themes.indexOf(root.dataset.theme || 'system');\n const theme = themes[(now + 1) % themes.length], after = themes[(now + 2) % themes.length];\n root.dataset.theme = theme;\n e.currentTarget.setAttribute('aria-label', names[theme] + '. Switch to ' + names[after].toLowerCase());\n e.currentTarget.title = names[theme];\n });\n\n // The animation: the bug waits by a lock, and kicks it open when the person starts. It plays\n // with Rive's runtime from its CDN (taken only with the hash it was published with) and the file\n // from screw-bugs' CDN. Without either, or where the person prefers less motion, the page is the\n // same without it.\n const art = $('art');\n // `instance` from when it is made, `rive` once its file loaded; `stopped` once the art is gone\n // for good (it failed, or the person started), so nothing that loads later plays.\n let instance, rive, observer, stopped = false, waiting = false, onWaiting;\n const noArt = () => {\n stopped = true;\n if (art) art.hidden = true;\n if (observer) observer.disconnect();\n try {\n if (instance) instance.cleanup();\n } catch {}\n instance = rive = observer = undefined;\n };\n if (art && !matchMedia('(prefers-reduced-motion: reduce)').matches) {\n const runtime = document.createElement('script');\n runtime.src = RIVE + 'rive.js';\n runtime.integrity = RIVE_JS_SRI;\n runtime.crossOrigin = 'anonymous';\n runtime.onerror = noArt;\n runtime.onload = () => {\n if (stopped) return;\n try {\n const R = window.rive;\n // The runtime is pinned, so the state changes it still gives are what this relies on.\n R.Rive.suppressDeprecationWarnings = ['state-change-events'];\n R.RuntimeLoader.setWasmUrl(RIVE + 'rive.wasm');\n R.RuntimeLoader.setWasmFallbackUrl(RIVE + 'rive_fallback.wasm');\n const canvas = art.querySelector('canvas');\n const r = new R.Rive({\n src: ANIMATION,\n canvas,\n autoplay: true,\n stateMachine: 'Main',\n // Binds the file's view model, whose `kick` trigger starts the kick.\n autoBind: true,\n layout: new R.Layout({ fit: R.Fit.Contain, alignment: R.Alignment.Center }),\n onLoad: () => {\n if (stopped) return;\n r.resizeDrawingSurfaceToCanvas();\n rive = r;\n },\n onLoadError: noArt,\n onStateChange: (e) => {\n for (const name of [].concat(e.data || [])) {\n if (name === WAITING) waiting = true;\n else if (name === 'Arrive' || name === 'Kick') waiting = false;\n }\n if (waiting && onWaiting) onWaiting();\n },\n });\n instance = r;\n observer = new ResizeObserver(() => rive && rive.resizeDrawingSurfaceToCanvas());\n observer.observe(canvas);\n } catch {\n noArt();\n }\n };\n document.head.appendChild(runtime);\n } else noArt();\n /** Plays the kick (once the bug waits by the lock), resolving when the bug has run off. */\n const kick = () =>\n new Promise((done) => {\n if (!rive) return done();\n const cap = setTimeout(done, KICK_WAIT_MAX);\n onWaiting = () => {\n onWaiting = undefined;\n try {\n rive.viewModelInstance.trigger('kick').trigger();\n } catch {\n clearTimeout(cap);\n return done();\n }\n setTimeout(() => {\n clearTimeout(cap);\n done();\n }, KICK_MS);\n };\n if (waiting) onWaiting();\n });\n\n // The explainer comes first; the browser shows (and its frames start) once the person starts.\n let starting = false;\n $('start').addEventListener('click', async () => {\n if (starting || over) return;\n starting = true;\n $('start').setAttribute('aria-disabled', 'true');\n // Reading this takes no requests, so the sign-in may have ended meanwhile.\n try {\n const r = await fetch(base + '/status', { cache: 'no-store' });\n if (!r.ok) return end(GONE);\n } catch {\n return end(GONE);\n }\n await kick();\n noArt();\n if (over) return;\n document.body.classList.remove('intro');\n resize();\n frames();\n });\n})();";
|
|
20
|
+
/**
|
|
21
|
+
* The live view's Content-Security-Policy: its own script, frames and icons as data URLs, its own
|
|
22
|
+
* routes, Google Fonts as the reports load them (`webFonts`), Rive's runtime from its exact folder
|
|
23
|
+
* on jsDelivr (its script and WebAssembly, which needs `wasm-unsafe-eval` to run) and the
|
|
24
|
+
* animation it plays (`SIGN_IN_ANIMATION`).
|
|
25
|
+
*/
|
|
26
|
+
export declare const SIGN_IN_CSP: string;
|
|
27
|
+
/**
|
|
28
|
+
* The live view for signing in to the account `label`, which `about` describes, at the app that
|
|
29
|
+
* `site` names (its title and icon as the sign-in browser read them; its host alone without).
|
|
30
|
+
* First a card that says what happens, beside the animation (`SIGN_IN_ANIMATION`), then the
|
|
31
|
+
* browser.
|
|
32
|
+
*/
|
|
33
|
+
export declare const renderSignInPage: (account: {
|
|
34
|
+
readonly label: string;
|
|
35
|
+
readonly about: string | undefined;
|
|
36
|
+
readonly origin: string;
|
|
37
|
+
readonly site?: {
|
|
38
|
+
readonly title: string | undefined;
|
|
39
|
+
readonly icon: string | undefined;
|
|
40
|
+
};
|
|
41
|
+
}) => string;
|