zframes 0.4.0 → 0.4.1
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 +5 -5
- package/runtime/assets/{bitcoin-dominance-DVZsIJ3y.js → bitcoin-dominance-BHcykQ8j.js} +1 -1
- package/runtime/assets/{breakeven-lskbHkqb.js → breakeven-PNgn_Prq.js} +1 -1
- package/runtime/assets/{breathing-BeUkCUAJ.js → breathing-DrPgIS4r.js} +1 -1
- package/runtime/assets/{btc-blocks-fXBgGo4z.js → btc-blocks-mJPjO7gs.js} +1 -1
- package/runtime/assets/{btc-difficulty-BwyxgI0e.js → btc-difficulty-D8kmEyQb.js} +1 -1
- package/runtime/assets/{btc-fees-Bg1rcXtN.js → btc-fees-Cv6K9S1L.js} +1 -1
- package/runtime/assets/{btc-hashrate-Xg8QNlTO.js → btc-hashrate-DT6qyeME.js} +1 -1
- package/runtime/assets/{btc-mempool-8Mfa77fO.js → btc-mempool-ftlit90k.js} +1 -1
- package/runtime/assets/{calculator-CiXyJA9p.js → calculator-CYNDBlrv.js} +1 -1
- package/runtime/assets/{checklist-D0dKSdmf.js → checklist-DygbP4AG.js} +1 -1
- package/runtime/assets/{clock-CNQTNh4L.js → clock-D2rGZ-yo.js} +1 -1
- package/runtime/assets/{coin-movers-DulAF_oo.js → coin-movers-DpHOtUMJ.js} +1 -1
- package/runtime/assets/{countdown-BzZ2L6bw.js → countdown-DcbUf2-f.js} +1 -1
- package/runtime/assets/{daily-analysis-RyI5KL4T.js → daily-analysis-D3g2BXJd.js} +1 -1
- package/runtime/assets/{day-meter-2bAj77Kz.js → day-meter-CDmmKsh5.js} +1 -1
- package/runtime/assets/{dex-volume-chart-DDPf1YAN.js → dex-volume-chart-C3KHEnoK.js} +1 -1
- package/runtime/assets/{dex-volume-treemap-jZCgRREu.js → dex-volume-treemap-C-hqWu6U.js} +1 -1
- package/runtime/assets/{dice-wg979Skm.js → dice-B7dy1iZP.js} +1 -1
- package/runtime/assets/{dino-game-DlACWmE_.js → dino-game-DLEtJMnt.js} +1 -1
- package/runtime/assets/{divider-Chz1UsWJ.js → divider-CVjQeL0n.js} +1 -1
- package/runtime/assets/{drawdy-Ce7P47cx.js → drawdy-DoJeRpgi.js} +1 -1
- package/runtime/assets/{editor-BlGZ_tel.js → editor-UP2LBUZ9.js} +1 -1
- package/runtime/assets/{fear-greed-CENzXdIk.js → fear-greed-zPvN2LSi.js} +1 -1
- package/runtime/assets/{filings-feed-2aIKzUUY.js → filings-feed-CWAGVlAW.js} +1 -1
- package/runtime/assets/{financial-stress--ezsCpfR.js → financial-stress-C5-XFPqY.js} +1 -1
- package/runtime/assets/{flappy-bird-DDe-IXt9.js → flappy-bird-CoKOL9Ib.js} +1 -1
- package/runtime/assets/{fundamentals-v8f81ZNS.js → fundamentals-BYjofvJi.js} +1 -1
- package/runtime/assets/{funding-heatmap-DUoeFNGr.js → funding-heatmap-BhL0jjq8.js} +1 -1
- package/runtime/assets/{funding-rate-chart-CjDA4nj7.js → funding-rate-chart-CxBH7hVe.js} +1 -1
- package/runtime/assets/{fx-board-CmXYQZi4.js → fx-board-Cm0_zK03.js} +1 -1
- package/runtime/assets/{heading-DMxdj9LK.js → heading-gFm9ZDY1.js} +1 -1
- package/runtime/assets/{holiday-calendar-DxB-fxG5.js → holiday-calendar-ffNyuPje.js} +1 -1
- package/runtime/assets/{image-DLg33JpH.js → image-D3DwdoU8.js} +1 -1
- package/runtime/assets/{index-C_O7gp2F.js → index-DbboK5sz.js} +13 -15
- package/runtime/assets/{inflation-pulse-gcw-84PM.js → inflation-pulse-GrBWa9Z6.js} +1 -1
- package/runtime/assets/{journal-log-BX5Z_yte.js → journal-log-CcLb4w4A.js} +1 -1
- package/runtime/assets/{journal-open-XFQGIRkw.js → journal-open-C0BKFgMk.js} +1 -1
- package/runtime/assets/{journal-results-J1WCmyH2.js → journal-results-Bpzb4REp.js} +1 -1
- package/runtime/assets/{journal-score-CKhBSfYY.js → journal-score-BUDUgceb.js} +1 -1
- package/runtime/assets/{journal-ui-Cogk2Wkt.js → journal-ui-CJIuEcIa.js} +1 -1
- package/runtime/assets/{labor-market-BV20Rl-4.js → labor-market-DJihF3Mk.js} +1 -1
- package/runtime/assets/{lightning-stats-h4fquhAg.js → lightning-stats-BV14FfAY.js} +1 -1
- package/runtime/assets/{link-grid-a6NWj1Hu.js → link-grid-DK3kGS1q.js} +1 -1
- package/runtime/assets/{market-cap-treemap-CAi49oc_.js → market-cap-treemap-DpuSjWWe.js} +1 -1
- package/runtime/assets/{market-hours-6srwf0-r.js → market-hours-D89LjpUm.js} +1 -1
- package/runtime/assets/{marquee-DDurk6bj.js → marquee-ByOQSr9Q.js} +1 -1
- package/runtime/assets/{mining-pools-BPjCy4ZW.js → mining-pools-D6AnoVnf.js} +1 -1
- package/runtime/assets/{mover-row-kQ9xt3Sp.js → mover-row-BTeXB98H.js} +1 -1
- package/runtime/assets/{national-debt-DkOnmfd1.js → national-debt-CgI8LSK6.js} +1 -1
- package/runtime/assets/{news-feed-CFWKKqrH.js → news-feed-CA8M5V3K.js} +1 -1
- package/runtime/assets/{note-_cGEXAru.js → note-Biu6llug.js} +1 -1
- package/runtime/assets/{open-interest-fxHh_T-V.js → open-interest-DgDfcYh5.js} +1 -1
- package/runtime/assets/{options-iv-CDArg1Op.js → options-iv-CqDfM4IA.js} +1 -1
- package/runtime/assets/{options-oi-strike-D_XIgUkk.js → options-oi-strike-CrIT5WTU.js} +1 -1
- package/runtime/assets/{options-put-call-DG4RXjzD.js → options-put-call--RXL3vTA.js} +1 -1
- package/runtime/assets/{pomodoro-B-Jk-51G.js → pomodoro-DZEEQU2X.js} +1 -1
- package/runtime/assets/{portfolio-allocation-BJepNj1X.js → portfolio-allocation-DKf6H-m6.js} +1 -1
- package/runtime/assets/{portfolio-common-D5L06PNC.js → portfolio-common-CVt117Oi.js} +1 -1
- package/runtime/assets/{portfolio-holdings-DSkAZALG.js → portfolio-holdings-CHtvm8aL.js} +1 -1
- package/runtime/assets/{portfolio-value-BJw2csWV.js → portfolio-value-Dj37WMRc.js} +1 -1
- package/runtime/assets/{price-chart-khxI-9vJ.js → price-chart-hgZApQaG.js} +1 -1
- package/runtime/assets/{price-compare-C-uEckke.js → price-compare-BczbPKy-.js} +1 -1
- package/runtime/assets/{price-liveline-BDesEIbL.js → price-liveline-Cbor-Nv_.js} +1 -1
- package/runtime/assets/{price-ticker-BXSeNYf9.js → price-ticker-BmfARqHc.js} +1 -1
- package/runtime/assets/{protocol-fees-treemap-YtWbL1Kn.js → protocol-fees-treemap-DeSBgGJ9.js} +1 -1
- package/runtime/assets/{protocol-tvl-chart-CEjUOIY5.js → protocol-tvl-chart-Dl_MwJdU.js} +1 -1
- package/runtime/assets/{protocol-tvl-treemap-b31QlpnS.js → protocol-tvl-treemap-Bvgp0EHh.js} +1 -1
- package/runtime/assets/{quote-cehyepdm.js → quote-BjjZrPpM.js} +1 -1
- package/runtime/assets/{rates-board-Du4k0z1i.js → rates-board-B_OYdW_u.js} +1 -1
- package/runtime/assets/{returns-projector-DXnRFAES.js → returns-projector-EA7LLxnL.js} +1 -1
- package/runtime/assets/{risk-reward-DZWyCrbv.js → risk-reward-xhKH6ouR.js} +1 -1
- package/runtime/assets/{rules-card-BXJjNTqj.js → rules-card-CrDquc56.js} +1 -1
- package/runtime/assets/{session-progress-bA45Q3wk.js → session-progress-BquR98Sm.js} +1 -1
- package/runtime/assets/{short-volume-C6cWknyR.js → short-volume-CYxTQG8H.js} +1 -1
- package/runtime/assets/{snake-DYTa97hl.js → snake-9JevhL1w.js} +1 -1
- package/runtime/assets/{spotify-embed-BaH6UHeG.js → spotify-embed-CNEzG2xL.js} +1 -1
- package/runtime/assets/{stopwatch-CS6n0bY9.js → stopwatch-BuN_qlhH.js} +1 -1
- package/runtime/assets/{top-movers-CQNx9EH5.js → top-movers-D7sBm6jo.js} +1 -1
- package/runtime/assets/{treasury-auctions-CGM8hAuU.js → treasury-auctions-bA-385ON.js} +1 -1
- package/runtime/assets/{tvl-treemap-C3SUFzdj.js → tvl-treemap-jrgafmGj.js} +1 -1
- package/runtime/assets/{video-WCnvLwQ_.js → video-CUWN4TBo.js} +1 -1
- package/runtime/assets/{yield-curve-CpitTQ9L.js → yield-curve-BOvLIfWe.js} +1 -1
- package/runtime/index.html +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as l,j as e}from"./react-qoZPGuNy.js";import{i as S}from"./content-shared-BZ1XzrJx.js";import{D as h,U as f,a as y,d as v}from"./format-CfAcS4D8.js";import{f as M,aJ as R}from"./index-
|
|
1
|
+
import{r as l,j as e}from"./react-qoZPGuNy.js";import{i as S}from"./content-shared-BZ1XzrJx.js";import{D as h,U as f,a as y,d as v}from"./format-CfAcS4D8.js";import{f as M,aJ as R}from"./index-DbboK5sz.js";import{s as O}from"./ui-Bq3RQsdJ.js";R.schema;const P="var(--color-highlight)";function b(s){const a=Number(s);return Number.isFinite(a)?a:0}function g({label:s,value:a,onChange:n}){return e.jsxs("label",{className:"flex min-w-0 flex-col gap-1",children:[e.jsx("span",{className:"caption text-soft uppercase tracking-[0.12em]",children:s}),e.jsxs("span",{className:`flex items-center px-2 py-1.5 ${S}`,children:[e.jsx("span",{className:"body-sm text-soft",children:"$"}),e.jsx("input",{type:"number",inputMode:"decimal",value:a,onChange:c=>n(c.target.value),className:"body-sm text-normal min-w-0 flex-1 bg-transparent text-right tabular-nums outline-none [appearance:textfield] [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none"})]})]})}function L({value:s,onChange:a}){return e.jsx("div",{className:`flex gap-1 p-1 ${S}`,children:["long","short"].map(n=>{const c=n===s;return e.jsx("button",{type:"button",onClick:()=>a(n),className:`caption flex-1 rounded px-2 py-1 text-center uppercase tracking-[0.12em] transition-colors ${c?"bg-white/[0.06] font-semibold":"text-soft"}`,style:c?{color:P}:void 0,children:n},n)})})}function T({config:s}){const[a,n]=l.useState(String(s.entry)),[c,j]=l.useState(String(s.stop)),[m,N]=l.useState(String(s.target)),[o,k]=l.useState(s.direction);l.useEffect(()=>n(String(s.entry)),[s.entry]),l.useEffect(()=>j(String(s.stop)),[s.stop]),l.useEffect(()=>N(String(s.target)),[s.target]),l.useEffect(()=>k(s.direction),[s.direction]);const t=l.useMemo(()=>{const r=b(a),p=b(c),x=b(m),i=Math.abs(r-p),d=Math.abs(x-r),D=i>0?d/i:0,E=r!==0?i/r*100:0,$=r!==0?d/r*100:0,u=i+d,U=u>0?i/u*100:50,F=o==="long"?p<r&&r<x:x<r&&r<p;return{riskPerUnit:i,rewardPerUnit:d,rr:D,riskPct:E,rewardPct:$,riskShare:U,hasRisk:i>0,hasData:u>0,valid:F}},[a,c,m,o]),C=t.hasData?t.hasRisk?`1 : ${t.rr.toFixed(t.rr>=10?0:1)}`:"∞":"—",w=s.label.trim();return e.jsxs("div",{className:`${O} flex flex-col gap-3`,children:[w&&e.jsx("span",{className:"caption text-soft uppercase tracking-[0.12em]",children:w}),e.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[e.jsx(g,{label:"Entry",value:a,onChange:n}),e.jsx(g,{label:"Stop",value:c,onChange:j}),e.jsx(g,{label:"Target",value:m,onChange:N})]}),e.jsx(L,{value:o,onChange:k}),e.jsxs("div",{className:"flex flex-col gap-2.5 rounded-lg border border-white/[0.07] bg-white/[0.03] p-3",children:[e.jsxs("div",{className:"flex flex-col items-center gap-0.5",children:[e.jsx("span",{className:"caption text-soft uppercase tracking-[0.12em]",children:"Risk : Reward"}),e.jsx("span",{className:"metric-md",style:{color:t.hasData?P:void 0},children:C})]}),e.jsxs("div",{className:"flex h-2.5 w-full overflow-hidden rounded-full bg-white/[0.06]",children:[e.jsx("span",{className:"h-full",style:{width:`${t.riskShare}%`,background:h}}),e.jsx("span",{className:"h-full",style:{width:`${100-t.riskShare}%`,background:f}})]}),e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsxs("div",{className:"flex min-w-0 flex-col",children:[e.jsx("span",{className:"caption uppercase tracking-[0.12em]",style:{color:h},children:"Risk"}),e.jsx("span",{className:"body-sm tabular-nums",style:{color:h},children:y(-t.riskPct)}),e.jsxs("span",{className:"caption text-soft tabular-nums",children:[v(t.riskPerUnit)," / unit"]})]}),e.jsxs("div",{className:"flex min-w-0 flex-col items-end text-right",children:[e.jsx("span",{className:"caption uppercase tracking-[0.12em]",style:{color:f},children:"Reward"}),e.jsx("span",{className:"body-sm tabular-nums",style:{color:f},children:y(t.rewardPct)}),e.jsxs("span",{className:"caption text-soft tabular-nums",children:[v(t.rewardPerUnit)," / unit"]})]})]}),t.hasData&&!t.valid&&e.jsxs("span",{className:"caption text-soft",children:["⚠ Prices don't bracket entry for a ",o," setup."]})]})]})}const z=M({...R,component:T});export{z as riskRewardFrame};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as s}from"./react-qoZPGuNy.js";import{f as m,bb as n}from"./index-
|
|
1
|
+
import{j as s}from"./react-qoZPGuNy.js";import{f as m,bb as n}from"./index-DbboK5sz.js";import{F as i,s as o}from"./ui-Bq3RQsdJ.js";n.schema;function c({config:l}){const r=l.rules.filter(e=>e.trim()),a=l.title.trim();return r.length===0?s.jsx(i,{children:"no rules yet"}):s.jsxs("div",{className:"flex h-full w-full flex-col",children:[a&&s.jsx("div",{className:"body-sm text-strong mb-1 shrink-0 font-semibold",children:a}),s.jsx("ol",{className:`min-h-0 flex-1 ${o}`,children:r.map((e,t)=>s.jsxs("li",{className:"flex gap-2 py-1",children:[s.jsx("span",{className:"caption text-highlight shrink-0 tabular-nums",children:t+1}),s.jsx("span",{className:"body-sm text-normal",children:e})]},t))})]})}const u=m({...n,component:c});export{u as rulesCardFrame};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as d,j as e}from"./react-qoZPGuNy.js";import{E as u,e as w,f as h}from"./market-data-CvmpLFSo.js";import{f as N,aL as f}from"./index-
|
|
1
|
+
import{r as d,j as e}from"./react-qoZPGuNy.js";import{E as u,e as w,f as h}from"./market-data-CvmpLFSo.js";import{f as N,aL as f}from"./index-DbboK5sz.js";import{F as v}from"./ui-Bq3RQsdJ.js";f.schema;function x(s){const[o,r]=s.split(":").map(Number);return o*60+r}function b(s){return Math.min(1,Math.max(0,s))}function M({config:s}){const[o,r]=d.useState(()=>new Date);d.useEffect(()=>{const j=setInterval(()=>r(new Date),3e4);return()=>clearInterval(j)},[]);const n=u[s.exchange]??u.NYSE;if(!n)return e.jsx(v,{children:"unknown exchange"});const t=w(n,o),a=t.status==="open",c=s.label.trim(),l=x(t.close)-x(t.open),i=a&&l>0?b((l-t.nextChangeMin)/l):0,p=Math.round(i*100),g=t.status==="holiday"?"Holiday":a?`${p}%`:"Closed",m=a?`closes in ${h(t.nextChangeMin)}`:s.showCountdown?`opens in ${h(t.nextChangeMin)}`:null;return e.jsxs("div",{className:"flex h-full w-full flex-col justify-center gap-2",children:[e.jsxs("div",{className:"caption text-soft flex items-center gap-1.5 uppercase tracking-[0.14em]",children:[e.jsx("span",{className:"text-normal font-semibold",children:n.mark}),e.jsx("span",{children:n.code}),c&&e.jsxs("span",{className:"text-disabled truncate tracking-normal normal-case",children:["· ",c]})]}),e.jsx("div",{className:`metric-md leading-none ${a?"text-strong":"text-soft"}`,children:g}),e.jsx("div",{className:"bg-surface h-2 w-full overflow-hidden rounded-full",children:e.jsx("div",{className:"h-full rounded-full transition-[width] duration-500",style:{width:`${i*100}%`,background:"var(--color-highlight)"}})}),m&&e.jsx("div",{className:"caption text-soft",children:m})]})}const $=N({...f,component:M});export{$ as sessionProgressFrame};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as u,j as s}from"./react-qoZPGuNy.js";import{f as x,ad as h,ae as f,A as p}from"./index-
|
|
1
|
+
import{r as u,j as s}from"./react-qoZPGuNy.js";import{f as x,ad as h,ae as f,A as p}from"./index-DbboK5sz.js";import{b,e as i}from"./format-CfAcS4D8.js";import{F as c,s as j}from"./ui-Bq3RQsdJ.js";h.schema;const d=(e=1)=>`hsl(var(--zf-accent-hue, 242) 85% 72% / ${e})`;function y({symbol:e,entry:o}){const l=e.includes(":")?e:`xyz:${o.symbol}`,r=Math.max(0,Math.min(100,o.shortPct));return s.jsxs("div",{className:"flex min-w-0 items-center gap-3 border-b border-white/[0.06] py-2 last:border-b-0",children:[s.jsx(p,{symbol:l,size:20}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsxs("div",{className:"flex items-baseline justify-between gap-2",children:[s.jsx("span",{className:"body-sm text-strong truncate font-semibold",children:o.symbol}),s.jsx("span",{className:"body-md text-strong font-bold tabular-nums",children:b(r,1)})]}),s.jsx("div",{className:"mt-1 h-1.5 w-full overflow-hidden rounded-full bg-white/[0.07]",children:s.jsx("div",{className:"h-full rounded-full",style:{width:`${r}%`,background:d(.85),boxShadow:`0 0 8px ${d(.5)}`}})}),s.jsxs("div",{className:"caption text-soft mt-1 tabular-nums",children:["short ",i(o.shortVolume)," /"," ",i(o.totalVolume)]})]})]})}function v({config:e}){const{data:o,isLoading:l}=f(e.symbols),r=u.useMemo(()=>{const a=e.symbols.map(t=>({symbol:t,entry:o[t]})).filter(t=>!!t.entry);return a.sort((t,n)=>e.sort==="symbol"?t.entry.symbol.localeCompare(n.entry.symbol):e.sort==="volume"?n.entry.totalVolume-t.entry.totalVolume:n.entry.shortPct-t.entry.shortPct),a},[o,e.symbols,e.sort]);if(l)return s.jsx(c,{loading:!0,children:"loading short volume…"});if(r.length===0)return s.jsx(c,{children:"no FINRA short-volume data yet"});const m=r[0].entry.date;return s.jsxs("div",{className:"flex h-full min-h-0 flex-col gap-3",children:[s.jsxs("div",{className:"flex items-start justify-between gap-3",children:[s.jsxs("div",{children:[s.jsx("div",{className:"caption text-soft uppercase",children:"short volume"}),s.jsx("div",{className:"body-sm text-normal",children:m?`FINRA · ${m}`:"FINRA"})]}),s.jsxs("div",{className:"caption text-soft text-right",children:["reported volume",s.jsx("br",{}),"not short interest"]})]}),s.jsx("div",{className:j,children:r.map(({symbol:a,entry:t})=>s.jsx(y,{symbol:a,entry:t},a))})]})}const F=x({...h,component:v});export{F as shortVolumeFrame};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as a,j as L}from"./react-qoZPGuNy.js";import{a as H,G as M,d as I}from"./game-ui-Dy_QYsPr.js";import{f as j,ay as z}from"./index-
|
|
1
|
+
import{r as a,j as L}from"./react-qoZPGuNy.js";import{a as H,G as M,d as I}from"./game-ui-Dy_QYsPr.js";import{f as j,ay as z}from"./index-DbboK5sz.js";import"./format-CfAcS4D8.js";const g=18,P=14,W=0,N={snakeHead:"rgba(255, 255, 255, 0.95)",food:"hsla(347, 100%, 62%, 1)"};function O(s,r,l,u,f){s.fillStyle=u,s.fillRect(r.originX+l.x*g+f,r.originY+l.y*g+f,g-f*2,g-f*2)}function q(s,r,l,u,f,y){r.clearRect(0,0,s.width,s.height),O(r,l,l.food,N.food,3),l.snake.forEach((d,C)=>O(r,l,d,C===0?N.snakeHead:y,2)),I(s,r,u,f,y)}function X(s,r,l,u,f,y){r.clearRect(0,0,s.width,s.height),r.textAlign="center",l==="idle"?(r.fillStyle=M.text,r.font='bold 14px "DM Sans", sans-serif',r.fillText("Arrow keys or swipe to start",s.width/2,s.height/2)):(r.fillStyle=M.gameOver,r.font='bold 20px "DM Sans", sans-serif',r.fillText("GAME OVER",s.width/2,s.height/2-30),r.fillStyle=M.text,r.font='bold 14px "DM Sans", sans-serif',r.fillText(`Score: ${u}`,s.width/2,s.height/2),r.fillStyle=M.textSoft,r.fillText("Press an arrow or tap to play again",s.width/2,s.height/2+28)),r.textAlign="left",I(s,r,u,f,y)}function v(){const s=a.useRef(null),r=a.useRef(null),[l,u]=a.useState("idle"),[f,y]=a.useState(0),[d,C]=a.useState(()=>{if(typeof window<"u"){const e=localStorage.getItem("zframes-snake-high-score");return e?parseInt(e,10):0}return 0}),[,K]=a.useState(!1),h=a.useRef(0),S=a.useRef(d),x=a.useRef(l),A=a.useRef(null),b=a.useRef(H(null));a.useEffect(()=>{S.current=d,d>0&&localStorage.setItem("zframes-snake-high-score",String(d))},[d]),a.useEffect(()=>{x.current=l},[l]);const w=a.useRef({snake:[],dir:{x:1,y:0},pendingDir:{x:1,y:0},food:{x:0,y:0},cols:0,rows:0,originX:0,originY:0,stepCounter:0}),D=a.useCallback(()=>{const e=w.current;if(e.cols<=0||e.rows<=0)return;let t,o=0;do t={x:Math.floor(Math.random()*e.cols),y:Math.floor(Math.random()*e.rows)},o++;while(e.snake.some(i=>i.x===t.x&&i.y===t.y)&&o<400);e.food=t},[]),T=a.useCallback(()=>{const e=w.current,t=Math.floor(e.cols/2),o=Math.floor(e.rows/2);e.snake=[{x:t,y:o},{x:t-1,y:o},{x:t-2,y:o}],e.dir={x:1,y:0},e.pendingDir={x:1,y:0},e.stepCounter=0,D(),h.current=0,y(0)},[D]),p=a.useCallback(()=>{w.current.cols<=0||(T(),u("playing"))},[T]),m=a.useCallback((e,t)=>{const o=w.current;o.dir.x===-e&&o.dir.y===-t||(o.pendingDir={x:e,y:t})},[]);a.useEffect(()=>{const e=o=>{const i=o.target;if(i.tagName==="INPUT"||i.tagName==="TEXTAREA"||i.isContentEditable)return;const c=x.current==="playing";let n=!0;switch(o.code){case"ArrowUp":case"KeyW":c?m(0,-1):p();break;case"ArrowDown":case"KeyS":c?m(0,1):p();break;case"ArrowLeft":case"KeyA":c?m(-1,0):p();break;case"ArrowRight":case"KeyD":c?m(1,0):p();break;case"Space":c||p();break;default:n=!1}n&&o.preventDefault()},t=r.current;if(t)return t.addEventListener("keydown",e),()=>t.removeEventListener("keydown",e)},[m,p]),a.useLayoutEffect(()=>{const e=s.current;if(!e)return;const t=()=>{const i=e.parentElement;if(i&&i.clientWidth>0&&i.clientHeight>0){e.width=i.clientWidth,e.height=i.clientHeight-W,b.current=H(e);const c=w.current;c.cols=Math.max(5,Math.floor(e.width/g)),c.rows=Math.max(5,Math.floor(e.height/g)),c.originX=Math.floor((e.width-c.cols*g)/2),c.originY=Math.floor((e.height-c.rows*g)/2);const n=e.getContext("2d");n&&x.current!=="playing"&&X(e,n,x.current,h.current,S.current,b.current),K(E=>!E)}};t();const o=new ResizeObserver(t);return o.observe(e.parentElement),()=>o.disconnect()},[]),a.useEffect(()=>{if(l!=="playing")return;const e=s.current,t=e==null?void 0:e.getContext("2d");if(!e||!t)return;let o;const i=()=>{h.current>S.current&&(S.current=h.current,C(h.current)),u("gameover")},c=()=>{const n=w.current;if(n.stepCounter++,n.stepCounter>=P){n.stepCounter=0,n.dir=n.pendingDir;const E=n.snake[0],k=E.x+n.dir.x,R=E.y+n.dir.y;if(k<0||R<0||k>=n.cols||R>=n.rows){i();return}const G=k===n.food.x&&R===n.food.y;if((G?n.snake:n.snake.slice(0,-1)).some(F=>F.x===k&&F.y===R)){i();return}n.snake.unshift({x:k,y:R}),G?(h.current+=1,y(h.current),D()):n.snake.pop()}q(e,t,n,h.current,S.current,b.current),o=requestAnimationFrame(c)};return o=requestAnimationFrame(c),()=>cancelAnimationFrame(o)},[l]),a.useEffect(()=>{if(l==="playing")return;const e=s.current,t=e==null?void 0:e.getContext("2d");!e||!t||X(e,t,l,f,d,b.current)},[l,f,d]);const U=e=>{const t=e.touches[0];t&&(A.current={x:t.clientX,y:t.clientY})},Y=e=>{var n;const t=A.current;A.current=null;const o=e.changedTouches[0];if((n=r.current)==null||n.focus(),x.current!=="playing"){p();return}if(!t||!o)return;const i=o.clientX-t.x,c=o.clientY-t.y;Math.abs(i)<12&&Math.abs(c)<12||(Math.abs(i)>Math.abs(c)?m(i>0?1:-1,0):m(0,c>0?1:-1))};return L.jsx("div",{ref:r,tabIndex:0,className:"relative h-full w-full cursor-pointer select-none overflow-hidden outline-none",onTouchStart:U,onTouchEnd:Y,onClick:()=>{var e;return(e=r.current)==null?void 0:e.focus()},role:"application","aria-label":"Snake game. Use the arrow keys or swipe to steer.",children:L.jsx("canvas",{ref:s,className:"h-full w-full"})})}const Q=j({...z,component:v});export{Q as snakeFrame};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as s,j as l}from"./react-qoZPGuNy.js";import{f as p,bd as i}from"./index-
|
|
1
|
+
import{r as s,j as l}from"./react-qoZPGuNy.js";import{f as p,bd as i}from"./index-DbboK5sz.js";import{F as o}from"./ui-Bq3RQsdJ.js";i.schema;const c=["track","album","playlist","artist","episode","show"];function d(t){let a;try{a=new URL(t.trim())}catch{return null}if(a.hostname.replace(/^www\./,"")!=="open.spotify.com")return null;const r=a.pathname.split("/").filter(Boolean),e=r.findIndex(n=>c.includes(n));return e===-1||!r[e+1]?null:`https://open.spotify.com/embed/${r[e]}/${r[e+1]}`}function m({config:t}){const[a,r]=s.useState("loading"),e=s.useMemo(()=>d(t.url),[t.url]);return e?a==="error"?l.jsx(o,{children:"player unavailable"}):l.jsxs("div",{className:"relative h-full w-full overflow-hidden rounded-md",children:[a==="loading"&&l.jsx("div",{className:"absolute inset-0 z-10",children:l.jsx(o,{loading:!0,children:"loading player…"})}),l.jsx("iframe",{src:e,title:"Spotify player",className:"w-full",height:t.compact?152:"100%",style:{border:0,height:t.compact?152:"100%"},loading:"lazy",allow:"autoplay; clipboard-write; encrypted-media; fullscreen; picture-in-picture",onLoad:()=>r("loaded"),onError:()=>r("error")},e+String(t.compact))]}):l.jsx(o,{children:"paste a Spotify track / album / playlist URL"})}const h=p({...i,component:m});export{h as spotifyEmbedFrame};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as l,j as s}from"./react-qoZPGuNy.js";import{i as h}from"./content-shared-BZ1XzrJx.js";import{f as y,aK as f,m as S}from"./index-
|
|
1
|
+
import{r as l,j as s}from"./react-qoZPGuNy.js";import{i as h}from"./content-shared-BZ1XzrJx.js";import{f as y,aK as f,m as S}from"./index-DbboK5sz.js";f.schema;const p="var(--color-highlight)",x="0 0 18px hsl(var(--zf-accent-hue, 242) 92% 70% / 0.45)",i=t=>String(t).padStart(2,"0");function g(t){const e=Math.floor(Math.max(0,t)/1e3),c=Math.floor(e/3600),n=Math.floor(e%3600/60),o=e%60;return c>0?`${c}:${i(n)}:${i(o)}`:`${i(n)}:${i(o)}`}function k({config:t}){const e=S(),[c,n]=l.useState({startedAt:t.startedAt,accumulatedMs:t.accumulatedMs}),o=e?t.startedAt:c.startedAt,w=e?t.accumulatedMs:c.accumulatedMs,a=o!==0,d=l.useCallback(r=>{e?e(r):n(m=>({...m,...r}))},[e]),[,b]=l.useState(0);l.useEffect(()=>{if(!a)return;const r=window.setInterval(()=>b(m=>m+1),250);return()=>window.clearInterval(r)},[a]);const u=w+(a?Date.now()-o:0),v=()=>d({startedAt:Date.now()}),M=()=>d({startedAt:0,accumulatedMs:u}),j=()=>d({startedAt:0,accumulatedMs:0});return s.jsxs("div",{className:"flex h-full w-full flex-col items-center justify-center gap-2 text-center",children:[t.label&&s.jsxs("div",{className:"caption text-soft inline-flex items-center gap-1.5 uppercase tracking-[0.18em]",children:[s.jsx("span",{"aria-hidden":!0,className:"inline-block h-1 w-1 rounded-full",style:{background:p,boxShadow:a?x:void 0}}),t.label]}),s.jsx("div",{className:"metric-lg text-strong leading-none",style:a?{color:p,textShadow:x}:void 0,children:g(u)}),s.jsxs("div",{className:"flex items-center justify-center gap-2",children:[s.jsx("button",{type:"button",onClick:a?M:v,className:`caption text-normal px-3 py-1 uppercase tracking-[0.12em] ${h}`,style:a?void 0:{color:p},children:a?"Pause":"Start"}),s.jsx("button",{type:"button",onClick:j,disabled:!a&&u===0,className:`caption text-soft px-3 py-1 uppercase tracking-[0.12em] transition-opacity disabled:opacity-40 ${h}`,children:"Reset"})]})]})}const E=y({...f,component:k});export{E as stopwatchFrame};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as d,j as s}from"./react-qoZPGuNy.js";import{f,af as m,a7 as g,h as l}from"./index-
|
|
1
|
+
import{r as d,j as s}from"./react-qoZPGuNy.js";import{f,af as m,a7 as g,h as l}from"./index-DbboK5sz.js";import{M as i}from"./mover-row-BTeXB98H.js";import{F as n}from"./ui-Bq3RQsdJ.js";import"./format-CfAcS4D8.js";m.schema;const h=["xyz:*"];function u({config:t}){const{stats:c,isLoading:p}=g(h,6e4),{gainers:o,losers:x}=d.useMemo(()=>{const e=Object.entries(c).map(([a,r])=>({symbol:a,...r})).filter(a=>a.symbol.includes(":")&&a.markPx>0&&a.prevDayPx>0).sort((a,r)=>r.changePct-a.changePct);return{gainers:e.slice(0,t.count),losers:e.slice(-t.count).reverse()}},[c,t.count]);return p?s.jsx(n,{loading:!0,children:"loading movers…"}):o.length===0?s.jsx(n,{children:"no mover data yet"}):s.jsxs("div",{className:"grid h-full grid-cols-2 gap-x-4 overflow-hidden",children:[s.jsxs("div",{className:"flex flex-col gap-1.5",children:[s.jsx("div",{className:"caption text-soft uppercase tracking-wide",children:"gainers"}),o.map(e=>s.jsx(i,{symbol:e.symbol,label:l(e.symbol),price:e.markPx,changePct:e.changePct},e.symbol))]}),s.jsxs("div",{className:"flex flex-col gap-1.5",children:[s.jsx("div",{className:"caption text-soft uppercase tracking-wide",children:"losers"}),x.map(e=>s.jsx(i,{symbol:e.symbol,label:l(e.symbol),price:e.markPx,changePct:e.changePct},e.symbol))]})]})}const M=f({...m,component:u});export{M as topMoversFrame};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as s}from"./react-qoZPGuNy.js";import{b as c}from"./format-CfAcS4D8.js";import{M as m}from"./metric-row-BVVhjsjK.js";import{f as u,P as a,Q as d}from"./index-
|
|
1
|
+
import{j as s}from"./react-qoZPGuNy.js";import{b as c}from"./format-CfAcS4D8.js";import{M as m}from"./metric-row-BVVhjsjK.js";import{f as u,P as a,Q as d}from"./index-DbboK5sz.js";import{F as i,s as x}from"./ui-Bq3RQsdJ.js";a.schema;function f({auction:e}){const t=[e.securityTerm,e.securityType].filter(Boolean).join(" ");return s.jsx(m,{label:t||e.securityType,meta:e.auctionDate+(e.bidToCover!==null?` · ${e.bidToCover.toFixed(2)}× bid-to-cover`:""),value:e.rate!==null?c(e.rate):"—"})}function p({config:e}){const{auctions:t,isLoading:o}=d(e.count);if(o)return s.jsx(i,{loading:!0,children:"loading auctions…"});if(!t.length)return s.jsx(i,{children:"no auction data yet"});const n=t.slice(0,e.count);return s.jsxs("div",{className:"flex h-full min-h-0 flex-col gap-3",children:[s.jsxs("div",{className:"flex items-baseline justify-between gap-3",children:[s.jsxs("div",{children:[s.jsx("div",{className:"caption text-soft uppercase",children:"treasury auctions"}),s.jsx("div",{className:"body-sm text-normal",children:"high yield · bid-to-cover"})]}),s.jsx("div",{className:"caption text-soft text-right",children:"results"})]}),s.jsx("div",{className:x,children:n.map((r,l)=>s.jsx(f,{auction:r},`${r.auctionDate}-${r.securityType}-${r.securityTerm}-${l}`))})]})}const T=u({...a,component:p});export{T as treasuryAuctionsFrame};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as i,j as s}from"./react-qoZPGuNy.js";import{f as l}from"./format-CfAcS4D8.js";import{f as p,ag as n,ah as f}from"./index-
|
|
1
|
+
import{r as i,j as s}from"./react-qoZPGuNy.js";import{f as l}from"./format-CfAcS4D8.js";import{f as p,ag as n,ah as f}from"./index-DbboK5sz.js";import{T as u,a as c}from"./treemap-leaf-DLQawrx4.js";import{F as m}from"./ui-Bq3RQsdJ.js";import"./utils-DaT-yT0k.js";import"./d3-xK4fOkBU.js";n.schema;function d({width:r,height:o,data:e}){const t=l(e.tvl);return s.jsx(c,{width:r,height:o,label:e.id,secondary:t,title:`${e.id} · ${t}`})}function v({config:r}){const{entries:o,isLoading:e}=f(),t=i.useMemo(()=>o.slice(0,r.topN).map(a=>({id:a.name,value:a.tvl,tvl:a.tvl})),[o,r.topN]);return e?s.jsx(m,{loading:!0,children:"loading TVL…"}):t.length===0?s.jsx(m,{children:"no TVL data"}):s.jsx(u,{data:t,LeafComponent:d,getColorValue:a=>a.tvl})}const F=p({...n,component:v});export{F as tvlTreemapFrame};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as l,j as o}from"./react-qoZPGuNy.js";import{f as u,aA as s}from"./index-
|
|
1
|
+
import{r as l,j as o}from"./react-qoZPGuNy.js";import{f as u,aA as s}from"./index-DbboK5sz.js";import{F as i}from"./ui-Bq3RQsdJ.js";s.schema;function c(a){let e;try{e=new URL(a.trim())}catch{return null}const r=e.hostname.replace(/^www\./,"");if(r==="youtu.be"){const t=e.pathname.slice(1).split("/")[0];return t?`https://www.youtube.com/embed/${t}`:null}if(r==="youtube.com"||r==="m.youtube.com"){if(e.pathname==="/watch"){const n=e.searchParams.get("v");return n?`https://www.youtube.com/embed/${n}`:null}const t=e.pathname.match(/^\/(?:embed|shorts)\/([^/]+)/);return t?`https://www.youtube.com/embed/${t[1]}`:null}if(r==="vimeo.com"){const t=e.pathname.split("/").filter(Boolean)[0];return t&&/^\d+$/.test(t)?`https://player.vimeo.com/video/${t}`:null}return r==="player.vimeo.com"||e.protocol==="https:"?e.toString():null}function m({config:a}){const[e,r]=l.useState("loading"),t=l.useMemo(()=>c(a.url),[a.url]);return l.useEffect(()=>r("loading"),[t]),t?e==="error"?o.jsx(i,{children:"video unavailable"}):o.jsxs("div",{className:"relative h-full w-full overflow-hidden rounded-md",children:[e==="loading"&&o.jsx("div",{className:"absolute inset-0 z-10",children:o.jsx(i,{loading:!0,children:"loading video…"})}),o.jsx("iframe",{src:t,title:a.title,className:`h-full w-full border-0 transition-opacity duration-300 ${e==="loaded"?"opacity-100":"opacity-0"}`,allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share",allowFullScreen:!0,onLoad:()=>r("loaded"),onError:()=>r("error")},t)]}):o.jsx(i,{children:"invalid video URL"})}const f=u({...s,component:m});export{f as videoFrame};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e}from"./react-qoZPGuNy.js";import{c as x,b as v}from"./format-CfAcS4D8.js";import{f as j,ai as p,aj as g}from"./index-
|
|
1
|
+
import{j as e}from"./react-qoZPGuNy.js";import{c as x,b as v}from"./format-CfAcS4D8.js";import{f as j,ai as p,aj as g}from"./index-DbboK5sz.js";import{F as u}from"./ui-Bq3RQsdJ.js";p.schema;const h=(n=1)=>`hsl(var(--zf-accent-hue, 242) 85% 72% / ${n})`;function y({rates:n}){const a=Math.min(...n),m=Math.max(...n),r=Math.max(.01,m-a),o=n.length,c=i=>100*i/(o-1),t=i=>4+32*(1-(i-a)/r),d=n.map((i,s)=>`${s?"L":"M"}${c(s).toFixed(2)},${t(i).toFixed(2)}`).join(" ");return e.jsxs("svg",{viewBox:"0 0 100 40",preserveAspectRatio:"none",className:"h-20 w-full","aria-hidden":!0,children:[e.jsx("path",{d:`${d} L100,40 L0,40 Z`,fill:h(.14)}),e.jsx("path",{d,fill:"none",stroke:h(.9),strokeWidth:1.5,vectorEffect:"non-scaling-stroke",strokeLinejoin:"round"})]})}function N({config:n}){const{curve:a,isLoading:m}=g();if(m)return e.jsx(u,{loading:!0,children:"loading yield curve…"});if(!a||a.points.length<2)return e.jsx(u,{children:"no yield-curve data yet"});const r=s=>{var l;return(l=a.points.find(f=>f.label===s))==null?void 0:l.rate},o=r("2Y"),c=r("10Y"),t=o!=null&&c!=null?Math.round((c-o)*100):null,d=t!=null&&t<0,i=n.maturities;return e.jsxs("div",{className:"flex h-full min-h-0 flex-col gap-2",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("div",{className:"caption text-soft uppercase",children:"Treasury yield curve"}),e.jsxs("div",{className:"body-sm text-normal",children:["U.S. Treasury · ",a.date]})]}),e.jsx("div",{className:"caption text-soft text-right",children:"daily"})]}),t!=null&&e.jsxs("div",{className:"flex items-baseline gap-2",children:[e.jsxs("span",{className:"metric-md leading-none",style:{color:x(t),textShadow:`0 0 24px ${x(t)}44`},children:[t>=0?"+":"",t," bps"]}),e.jsxs("span",{className:"caption text-soft",children:["2s10s · ",d?"inverted":"normal"]})]}),e.jsx(y,{rates:a.points.map(s=>s.rate)}),e.jsx("div",{className:"grid gap-1",style:{gridTemplateColumns:`repeat(${i.length}, minmax(0, 1fr))`},children:i.map(s=>{const l=r(s);return e.jsxs("div",{className:"rounded bg-white/[0.04] px-1.5 py-1 text-center",children:[e.jsx("div",{className:"caption text-soft",children:s}),e.jsx("div",{className:"body-sm text-strong font-bold tabular-nums",children:l!=null?v(l):"—"})]},s)})})]})}const M=j({...p,component:N});export{M as yieldCurveFrame};
|
package/runtime/index.html
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16.png" />
|
|
9
9
|
<link rel="apple-touch-icon" href="/apple-touch-icon.png" />
|
|
10
10
|
<title>zframes runtime</title>
|
|
11
|
-
<script type="module" crossorigin src="/assets/index-
|
|
11
|
+
<script type="module" crossorigin src="/assets/index-DbboK5sz.js"></script>
|
|
12
12
|
<link rel="modulepreload" crossorigin href="/assets/react-qoZPGuNy.js">
|
|
13
13
|
<link rel="stylesheet" crossorigin href="/assets/index-DRTPEQtR.css">
|
|
14
14
|
</head>
|