diff --git a/.agent/skills/basalt-html/SKILL.md b/.agent/skills/basalt-html/SKILL.md index 4aa875bd..75edb2cb 100644 --- a/.agent/skills/basalt-html/SKILL.md +++ b/.agent/skills/basalt-html/SKILL.md @@ -14,6 +14,8 @@ Standalone HTML that looks and behaves like Basalt: one file, no network, dark a 3. Run `node .agent/skills/basalt-html/compose.mjs report.body.html` (writes `report.html`; `--out ` names it). It wraps the body in the doctype, meta and theme bootstrap, inlines Geist and adds the core CSS and script, only the modules your classes, attributes and tags use, and the icons you name in quotes. It prints what it added, and one warning line for each module added. `--no-fonts` skips Geist (only for a file a tool reads, never a file a person opens), `--lang fr` sets the language, `--all` adds every module. 4. Open the page in both themes at 1440 and 390 wide before you hand it over. It follows the system theme; the toggle or `Basalt.toggleTheme()` switches it. +**Data you did not write** (a file, an API, a user) goes in as `textContent`; a link from it passes `Basalt.safeHref` (relative, http, https, mailto, tel); an option comes from a fixed list. Never into markup, a ``, - ...(chosen.modules.includes("loops") ? [``] : []), + // Any page that draws a loop keeps a hold the reader stored on another page of the origin, not only a page with the toggle. + ...(chosen.modules.some((n) => LOOPING.has(n)) ? [``] : []), ...(fonts ? [""] : []), ``, ...styles.map((style) => `${style.css}`), diff --git a/.agent/skills/basalt-html/parts/braille.css b/.agent/skills/basalt-html/parts/braille.css index 42fb710b..b8eb082a 100644 --- a/.agent/skills/basalt-html/parts/braille.css +++ b/.agent/skills/basalt-html/parts/braille.css @@ -1 +1 @@ -@layer basalt{braille-spinner{display:inline-block;flex:none;width:var(--basalt-size-dot);height:var(--basalt-space-2-5);line-height:0;color:inherit}braille-spinner>svg{display:block;width:100%;height:100%;overflow:visible}.braille-dot{fill:currentColor;opacity:0;animation:var(--basalt-duration-loop-braille) step-end infinite}.braille-dot[data-hold]{opacity:1}.braille-dot[data-dot="1"]{animation-name:bh-b1}.braille-dot[data-dot="2"]{animation-name:bh-b2}.braille-dot[data-dot="3"]{animation-name:bh-b3}.braille-dot[data-dot="4"]{animation-name:bh-b4}.braille-dot[data-dot="5"]{animation-name:bh-b5}.braille-dot[data-dot="6"]{animation-name:bh-b6}@keyframes bh-b1{0%{opacity:1}30%{opacity:0}70%{opacity:1}}@keyframes bh-b2{0%{opacity:1}10%{opacity:0}60%{opacity:1}}@keyframes bh-b3{0%{opacity:0}40%{opacity:1}}@keyframes bh-b4{0%{opacity:1}50%{opacity:0}90%{opacity:1}}@keyframes bh-b5{0%{opacity:0}10%{opacity:1}60%{opacity:0}}@keyframes bh-b6{0%{opacity:0}20%{opacity:1}80%{opacity:0}}@media(prefers-reduced-motion:reduce){.braille-dot[data-dot]{animation:none}}} +@layer basalt{braille-spinner{display:inline-block;flex:none;width:var(--basalt-size-dot);height:var(--basalt-space-2-5);line-height:0;color:inherit}braille-spinner>svg{display:block;width:100%;height:100%;overflow:visible}.braille-dot{fill:currentColor;opacity:0;animation:var(--basalt-duration-loop-braille) step-end infinite}.braille-dot[data-hold]{opacity:1}.braille-dot[data-dot="1"]{animation-name:bh-b1}.braille-dot[data-dot="2"]{animation-name:bh-b2}.braille-dot[data-dot="3"]{animation-name:bh-b3}.braille-dot[data-dot="4"]{animation-name:bh-b4}.braille-dot[data-dot="5"]{animation-name:bh-b5}.braille-dot[data-dot="6"]{animation-name:bh-b6}@keyframes bh-b1{0%{opacity:1}30%{opacity:0}70%{opacity:1}}@keyframes bh-b2{0%{opacity:1}10%{opacity:0}60%{opacity:1}}@keyframes bh-b3{0%{opacity:0}40%{opacity:1}}@keyframes bh-b4{0%{opacity:1}50%{opacity:0}90%{opacity:1}}@keyframes bh-b5{0%{opacity:0}10%{opacity:1}60%{opacity:0}}@keyframes bh-b6{0%{opacity:0}20%{opacity:1}80%{opacity:0}}@media(prefers-reduced-motion:reduce){.braille-dot[data-dot]{animation:none}}:root[data-loops=held] .braille-dot[data-dot]{animation:none}} diff --git a/.agent/skills/basalt-html/parts/chart.js b/.agent/skills/basalt-html/parts/chart.js index b042fc77..b28a2032 100644 --- a/.agent/skills/basalt-html/parts/chart.js +++ b/.agent/skills/basalt-html/parts/chart.js @@ -1 +1 @@ -(function($){"use strict";var pa=$._,w=pa.esc,jr=864e5,Z="Not observed",ya=["disc","square","diamond"],ga=["solid","dash","dot"],lr=56,ur=80,cr=.6,hr=2,ba=[1,2,2.5,5],fr=0;function qt(r,s,u){return Math.max(s,Math.min(u,r))}function dr(r){var s=String(r).split("-").map(Number);return Date.UTC(s[0]||1970,(s[1]||1)-1,s[2]||1)}function Wt(r){return r.replace(/\d/g,"0")}function xa(r){return r.filter(function(s,u){return r.indexOf(s)===u})}function vr(r,s){return Math.abs(r-s)<1e-9}function jt(r){return typeof r=="number"&&isFinite(r)}function Vt(r,s,u){for(var i=[],h=r;h<=s;h++){var f=u(h),v=i[i.length-1];v&&v.key===f?v.to=h:i.push({from:h,to:h,key:f})}return i}function mr(r,s){var u=Math.max(1,Math.floor(s&&s.window||7)),i=Math.max(1,Math.min(Math.floor(s&&s.min||3),u));function h(f){return jt(r[f])}return r.map(function(f,v){for(var c=0,l=0,E=Math.max(0,v-u+1);E<=v;E++)h(E)&&(c+=r[E],l++);return l>=i&&(h(v)||h(v-1)&&h(v+1))?c/l:null})}function pr(r,s,u,i){var h=r.length?Math.min.apply(null,r):0,f=r.length?Math.max.apply(null,r):1,v=s||u,c=v?Math.min(0,h):h,l=v?Math.max(0,f):f,E=s?0:Math.max((l-c)*.04,0),z=s?Math.max(l*1.04,l):l+E,C=c-(v?0:E);function dt(k){var at=Math.floor(C/k+1e-9)*k;return{lo:at,hi:Math.max(Math.ceil(z/k-1e-9)*k,at+k),step:k}}function vt(k){return Math.round((k.hi-k.lo)/k.step)}var D;if(i&&i>0&&(D=dt(i),vt(D)<=5))return D.lo===D.hi?{lo:D.lo,hi:D.lo+2*i,step:i}:D;for(var St=Math.max(z-C,l>0?l:1),B=Math.floor(Math.log10(Math.max(St,1e-9))),mt=B-2;mt<=B+2;mt++)for(var K=0;Kh?r.say(l-h)+" over the plan":"On the plan"):u.push(lh[1]?c.name+" "+r.say(l-h[1])+" over the plan":c.name+" inside the plan")),u.join(". ")+"."}function wa(r,s){return s==null?"":r.formatPlan?r.formatPlan(s):typeof s=="number"?r.format(s):r.format(s[0])+"–"+r.format(s[1])}function kt(r,s,u,i,h,f,v,c){f=f||0;var l=v?c/2:0,E=' data-shape="'+r+'"'+(v?' data-so-far=""':"");if(r==="square"){var z=i*Math.sqrt(Math.PI)/2+f-l;return'"}if(r==="diamond"){var C=i*Math.sqrt(Math.PI/2)+(f-l)*Math.SQRT2;return'"}return'"}function At(r,s,u,i){var h=ga[s%3],f=ya[s%3],v="";return r==="series"?v=''+kt(f,8,8,4,"chart-ring",2)+kt(f,8,8,4,"chart-mark"):r==="bar"?v='':r==="so-far"?v='':r==="value"?v='':r==="band"?v='':r==="missing"&&(v=''),'"}var Gt=typeof WeakMap=="function"?new WeakMap:null;function Mr(r){var s=r.closest&&r.closest(".chart-group");if(!s||!Gt)return null;var u=Gt.get(s);return u||(u={members:[],shared:{gutter:0,right:0}},u.report=function(i,h){i.sizes=h;var f={gutter:0,right:0};u.members.forEach(function(v){v.sizes&&(f.gutter=Math.max(f.gutter,v.sizes.gutter),f.right=Math.max(f.right,v.sizes.right))}),!(f.gutter===u.shared.gutter&&f.right===u.shared.right)&&(u.shared=f,u.members.forEach(function(v){v!==i&&v.draw()}))},Gt.set(s,u)),u}function Ma(r,s){if(!r||!s)return null;var u=r.__bhChart&&r.__bhChart.drawn?r.__bhChart.drawn():null;r.__bhChart&&r.__bhChart.destroy();var i=s,h=i.kind==="bar",f=(i.series||[]).slice(0,h?1:3),v=i.days||[],c=v.length,l=i.plan,E=i.locale||"en-US",z=xr(i.format,E),C=typeof i.format=="function"?i.format:z.write,dt=typeof i.spoken=="function"?i.spoken:typeof i.format=="function"?C:z.say,vt=new Intl.NumberFormat(void 0,{maximumFractionDigits:6}),D=i.tickDivisor||1,St=typeof i.formatTick=="function"?i.formatTick:function(t){return vt.format(t/D)},B=i.partial,mt=i.partialLabel||"Today so far",K=i.partialSuffix||"so far",tt=i.unit,k="bc"+ ++fr,at=k+"-title",Ea=k+"-summary",ka=k+"-keys",Aa=k+"-table",rt={short:new Intl.DateTimeFormat(E,{day:"numeric",month:"short",timeZone:"UTC"}),withDay:new Intl.DateTimeFormat(E,{weekday:"short",day:"numeric",month:"short",timeZone:"UTC"}),long:new Intl.DateTimeFormat(E,{weekday:"long",day:"numeric",month:"long",timeZone:"UTC"})},et=v.map(dr),kr=i.now==null?Date.now():new Date(i.now).getTime(),Zt={n:c,series:f,plan:l,partial:B,partialSuffix:K,say:dt,format:C,stamps:et,formats:rt,formatPlan:i.formatPlan,lastIsToday:c>0&&v[c-1]===new Date(kr).toISOString().slice(0,10)},Vr=function(t){return rt.short.format(et[t])},Sa=function(t){return rt.withDay.format(et[t])},Lt=[];f.forEach(function(t){t.values.forEach(function(a){jt(a)&&Lt.push(a)})}),l&&l.values.forEach(function(t){t!=null&&(typeof t=="number"?Lt.push(t):Lt.push(t[0],t[1]))});var nt=pr(Lt,h,!!i.fromZero,i.step),pt=yr(nt);function La(t,a){return St(t)+(tt&&a===pt.length-1?" "+tt:"")}var Ca="h"+([2,3,4,5,6].indexOf(i.heading)===-1?3:i.heading),Ar=f.some(function(t){return t.values.some(function(a){return a==null})}),Sr=B!=null&&B>=0&&B