@lipsjs/lips 0.4.0 → 0.6.0

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.
@@ -1,3 +1,3 @@
1
- var m=(r,o="")=>({type:r,value:o,attrs:{},vars:{},listeners:{},parent:null,first:null,last:null,prev:null,next:null}),$e=(r)=>r.type[0]!=="#";function B(r){let o=r.parent;if(!o)return;r.prev?r.prev.next=r.next:o.first=r.next,r.next?r.next.prev=r.prev:o.last=r.prev,r.parent=r.prev=r.next=null}function R(r,o,s){if(B(o),o.parent=r,s)o.prev=s.prev,o.next=s,s.prev?s.prev.next=o:r.first=o,s.prev=o;else o.prev=r.last,r.last?r.last.next=o:r.first=o,r.last=o}function ae(r){if(typeof r==="string")return m("#text",r);if(r===0)return m("#marker","$");let[o,s,d]=r,l=m(o);return s&&Object.assign(l.attrs,s),d?.forEach((g)=>R(l,ae(g),null)),l}function G(r){let o=[];for(;r;r=r.parent)o.unshift(r);return o}var de={clone(r){if(!r.nodes)throw Error("[lips] this IR has no node tree: compile it with { target: 'tree' } to render on a tree host");let o=m("#fragment");for(let s of r.nodes)R(o,ae(s),null);return o},fragment:()=>m("#fragment"),element:(r)=>m(r),text:(r)=>m("#text",r),marker:(r)=>m("#marker",r),child(r,o){let s=r.first;while(s&&o--)s=s.next;return s},next:(r)=>r.next,range(r,o){let s=[];for(let d=r;d;d=d.next)if(s.push(d),d===o)break;return s},insert:R,insertAfter(r,o){let s=r.parent;if(!s)return;let d=r;for(let l of o)R(s,l,d.next),d=l},remove:B,isElement:$e,connected:(r)=>G(r)[0].type==="#root",precedes(r,o){if(r===o)return!1;let s=G(r),d=G(o);if(s[0]!==d[0])return!1;let l=0;while(l<s.length&&l<d.length&&s[l]===d[l])l++;if(l===s.length)return!0;if(l===d.length)return!1;for(let g=s[l].next;g;g=g.next)if(g===d[l])return!0;return!1},setText:(r,o)=>{r.value=o},content(r,o){while(r.first)B(r.first);o&&R(r,m("#text",o),null)},attr:(r,o,s)=>{s===null?delete r.attrs[o]:r.attrs[o]=s},styleVar:(r,o,s)=>{s===null?delete r.vars[o]:r.vars[o]=s},scope:(r,o)=>{r.scope??=o},listen(r,o,s){return(r.listeners[o]??=new Set).add(s),()=>{r.listeners[o]?.delete(s)}}};var le={checked:"checked",unchecked:"not checked",mixed:"mixed",pressed:"pressed",selected:"selected",expanded:"expanded",collapsed:"collapsed",current:"current",disabled:"disabled",invalid:"invalid",required:"required",radio:"radio button",tab:"tab"},Pe={button:["button"],link:["link"],heading:["header"],img:["image"],image:["image"],checkbox:["button","checkbox"],switch:["button","switch"],radio:["button","radio"],tab:["button","tab"],option:["button"],menuitem:["button"],menuitemcheckbox:["button","checkbox"],menuitemradio:["button","radio"],searchbox:["search"],progressbar:["none","progressbar"]},je=new Set(["button","link","header"]),ce={status:"polite",log:"polite",alert:"assertive"},_e=new Set(["none","presentation"]),K={button:"button",a:"link",h1:"heading",h2:"heading",h3:"heading",h4:"heading",h5:"heading",h6:"heading"},ue=[["aria-checked","checked","unchecked"],["aria-pressed","pressed"],["aria-selected","selected"],["aria-expanded","expanded","collapsed"],["aria-current","current"],["aria-disabled","disabled"],["aria-invalid","invalid"],["aria-required","required"]],U=new Set(["role","alt","for","tabindex","aria-label","aria-labelledby","aria-describedby","aria-hidden","aria-live","aria-modal","aria-roledescription","aria-valuetext","aria-valuenow",...ue.map((r)=>r[0])]),fe=(r,o)=>r.role?.trim().split(/\s+/)[0]||o||"";function pe(r,o,s,d,l,g,w){let h=Pe[o],N=[r["aria-valuetext"]??r["aria-valuenow"]];for(let[P,A,O]of ue){let x=P==="aria-disabled"&&r.disabled!=null?"true":r[P];x&&N.push(w[x==="false"?O:x==="mixed"?"mixed":A])}let v=r["aria-labelledby"]?d(r["aria-labelledby"]):r["aria-label"]||r.alt||g;if(!v&&h&&je.has(h[0])&&!s)v=l();v=[v,r["aria-describedby"]&&d(r["aria-describedby"])].filter(Boolean).join(", ");let T=r.tabindex==null||r.tabindex===""||isNaN(+r.tabindex)?void 0:+r.tabindex>=0;return{"accessibility-element":_e.has(o)||r.alt===""?!1:h||v?!0:void 0,"accessibility-traits":h?.[0],"accessibility-label":v||void 0,"accessibility-value":N.filter(Boolean).join(", ")||void 0,"accessibility-heading":o==="heading"||void 0,"accessibility-role-description":r["aria-roledescription"]||h?.[1]&&(w[h[1]]??h[1]),"accessibility-elements-hidden":r["aria-hidden"]==="true"||void 0,"accessibility-exclusive-focus":r["aria-modal"]==="true"||void 0,focusable:T}}var ge=0,be=1,he=2,F=3,I=4,xe=5,C=6,ye=7,me=8,Ne=9,z=10;var Q=1,ve="lips:ops",Te="lips:event",Me=["div","section","article","nav","header","footer","main","aside","ul","ol","li","button","form","figure","dialog","details","summary","address","blockquote","hgroup","fieldset","legend","menu","dl","dt","dd","figcaption"],Ce=["span","p","h1","h2","h3","h4","h5","h6","label","b","strong","i","em","small","a","code","mark","s","u","sub","sup","time","abbr","cite","kbd","q","var","samp","dfn","del","ins","data","bdi","bdo"],ke=Object.fromEntries([...Me.map((r)=>[r,"view"]),...Ce.map((r)=>[r,"text"]),["img","image"]]),Ee=(r)=>`lips-${r.replace(/[^\w-]/g,"-")}`,H="lips-svg",Le={click:"tap"};var Re=(r)=>r.replace(/[&<>"]/g,(o)=>`&#${o.charCodeAt(0)};`),He=new Set(["input","textarea"]),Ye=0,Xe=1,qe=2,De=3,Ge=4,Ke=new Set(["class","style","id"]);function Ue(r,{announce:o,words:s=le}={}){let d=Q,l=[],g=0,w=!1,h=new Map,N=new Map,v,T,P=0,A=new Map,O=new Set,x=new Map,k=new Map,E=!1,Z=!1,j=(e)=>{let t=e.type==="#text"?e.value:"";for(let n=e.first;n;n=n.next)t+=" "+J(n);return t.replace(/\s+/g," ").trim()},J=(e)=>e.aria?.["aria-hidden"]==="true"?"":e.aria?.["aria-label"]||e.aria?.alt||j(e),we=(e)=>e.trim().split(/\s+/).map((t)=>x.get(t)).filter(Boolean).map((t)=>J(t)).join(" "),Se=()=>{let e=[];for(let t of O){let n=t.aria||{},i=fe(n,t.role),a=t.idv&&k.get(t.idv),f=pe(n,i,t.type==="text",we,()=>j(t),a?j(a):"",s),y=t.sent||={};for(let u of new Set([...Object.keys(f),...Object.keys(y)]))f[u]!==y[u]&&c(I,t.id,u,(y[u]=f[u])??null);let b=n["aria-live"]??ce[i];if(b&&b!=="off"){let u=j(t);u&&u!==t.said&&(t.said!==void 0||b==="assertive"&&Z)&&e.push(u),t.said=u}}return E=!1,e},_=(e)=>{O.add(e),E=!0,X()},Y=new Set,Ie=(e)=>{while(e?.part)e=e.parent;return e?.type==="svg"?e:void 0},M=(e)=>{let t=Ie(e);if(!t)return;Y.add(t),X()},ee=(e)=>{if(e.type==="#text")return Re(e.value);let t="";for(let a=e.first;a;a=a.next)t+=ee(a);if(e.type[0]==="#")return t;let n=e.part||e.type,i="";for(let a in e.attrs)a===H||(i+=` ${a}="${Re(e.attrs[a])}"`);return`<${n}${i}>${t}</${n}>`},te=()=>{for(let n of Y){let i=n.real?ee(n):n.drawn;i!==n.drawn&&c(I,n.id,"content",n.drawn=i)}Y.clear();let e=E?Se():[];if(w=!1,Z=!0,!l.length)return;let t=l;l=[],g++,r(t),o&&e.forEach(o)},X=()=>{if(w)return;w=!0,Promise.resolve().then(te)},c=(...e)=>{l.push(...e),X()},L=(e,t,n={},i=0)=>{e.real&&c(z,e.id,t,n,i)},q=new Map,re=0,Ae={focus(){T=this,L(this,He.has(this.type)?"focus":"requestAccessibilityFocus")},blur(){T===this&&(T=void 0),L(this,"blur")},scrollTo(e,t){let n=typeof e==="object"?e:{left:e,top:t};L(this,"scrollTo",{offset:n.top||n.left||0,smooth:n.behavior==="smooth"})},scrollIntoView(e){let t=typeof e==="object"?e:{block:e===!1?"end":"start"};L(this,"scrollIntoView",{scrollIntoViewOptions:{behavior:t.behavior==="smooth"?"smooth":"auto",block:t.block||"start",inline:t.inline||"start"}})},animate(e,t={}){let n=`lips-${this.id}-${++P}`,i=(a)=>()=>L(this,"animate",[a,n]);return L(this,"animate",[Ye,n,e,typeof t==="number"?{duration:t}:t]),{id:n,play:i(Xe),pause:i(qe),cancel:i(De),finish:i(Ge)}},getBoundingClientRect(){return new Promise((e)=>{if(!this.real)return e(null);p.attr(this,"lips-rect",""),q.set(++re,({code:t,data:n})=>e(t||!n?null:{x:n.left,y:n.top,width:n.width,height:n.height,top:n.top,right:n.right,bottom:n.bottom,left:n.left})),L(this,"boundingClientRect",{},re)})}},S=(e,t="",n=0,i=!1)=>Object.assign(Object.create(Ae),m(e,t),{id:n,real:i,at:null}),ne=(e)=>[e.cls,e.scope&&Ee(e.scope)].filter(Boolean).join(" "),oe=["width","height"],Oe=(e)=>e.type==="svg"?oe.filter((t)=>e.attrs[t]).map((t)=>`${t}: ${e.attrs[t]}${/^[\d.]+$/.test(e.attrs[t])?"px":""}`).join("; "):"",D=(e)=>[Oe(e),e.css,...Object.entries(e.vars).map(([t,n])=>`${t}: ${n}`)].filter(Boolean).join("; "),ie=(e)=>{for(let t=e.first;t;t=t.next)ie(t);if(!e.real)return;h.delete(e.id),N.delete(e.id),A.delete(e.id),O.delete(e),e.idv&&x.get(e.idv)===e&&x.delete(e.idv),e.aria?.for&&k.get(e.aria.for)===e&&k.delete(e.aria.for),c(Ne,e.id),e.real=!1},p={...de,clone(e){if(!e.nodes)throw Error("[lips] this IR has no node tree: compile it with { target: 'tree' } to render on Lynx");let t=(i)=>{if(typeof i==="string")return p.text(i);if(i===0)return p.marker("$");let[a,f,y]=i,b=f?.[H]?Object.assign(S(a),{part:f[H]}):p.element(a);if(f)for(let u in f)p.attr(b,u,f[u]);return y?.forEach((u)=>p.insert(b,t(u),null)),b},n=p.fragment();for(let i of e.nodes)p.insert(n,t(i),null);return n},fragment:()=>S("#fragment"),element(e){let t=S(ke[e]||e,"",++d,!0);if(N.set(t.id,t),c(ge,t.id,t.type),t.batch=g,K[e])t.role=K[e],_(t);return t},text:(e)=>S("#text",e,++d),marker:(e)=>S("#marker",e),insert(e,t,n){if(R(e,t,n),M(e),E=!0,t.type==="#text"&&!t.real&&e.type==="text"&&!e.part)t.real=!0,N.set(t.id,t),c(be,t.id,t.value),t.slot=l.length-1,t.batch=g;if(!t.real)return;if(t.at&&c(F,t.at.id,t.id),t.at=null,!e.real)return;let i=t.next;while(i&&!i.real)i=i.next;c(he,e.id,t.id,i?i.id:0),t.at=e},insertAfter(e,t){let n=e.parent;if(!n)return;let i=e;for(let a of t)p.insert(n,a,i.next),i=a},remove(e,t){E=!0,M(e.parent),B(e),e.at&&c(F,e.at.id,e.id),e.at=null,t&&ie(e)},setText(e,t){if(e.value===t)return;if(e.value=t,E=!0,!e.real)return M(e.parent);e.batch===g?l[e.slot]=t:c(xe,e.id,t)},content(e,t){while(e.first)p.remove(e.first,!0);if(!t)return;let n=e.type==="text"?e:p.element("text");n===e||p.insert(e,n,null),p.insert(n,p.text(t),null)},attr(e,t,n){let i=e.wrote||={};if(t in i&&i[t]===n)return;if(i[t]=n,e.part||e.type==="svg"&&!Ke.has(t)&&!t.startsWith("data-")&&!U.has(t))n===null?delete e.attrs[t]:e.attrs[t]=n,M(e),e.part||!oe.includes(t)||c(C,e.id,D(e));else if(t==="class")e.cls=n??void 0,c(I,e.id,"class",ne(e));else if(t==="style")e.css=n??void 0,c(C,e.id,D(e));else if(t==="value"&&(e.type==="input"||e.type==="textarea")&&e.batch!==g)n!==A.get(e.id)&&c(z,e.id,"setValue",{value:n??""});else if(U.has(t)||t==="disabled"&&e.role==="button"){let a=e.aria||={};if(t==="for"){a.for&&k.get(a.for)===e&&k.delete(a.for),n&&k.set(n,e);let f=n&&x.get(n);f&&_(f)}n===null?delete a[t]:a[t]=n,_(e)}else{if(t==="id")e.idv&&x.get(e.idv)===e&&x.delete(e.idv),e.idv=n??void 0,n&&x.set(n,e),E=!0,k.has(n)&&_(e);c(I,e.id,t,n)}},styleVar(e,t,n){if(n===null?!(t in e.vars):e.vars[t]===n)return;n===null?delete e.vars[t]:e.vars[t]=n,c(C,e.id,D(e))},scope(e,t){if(e.scope)return;e.scope=t,c(I,e.id,"class",ne(e))},keepFocus(){let e=T;return()=>{e?.real&&e.at&&e.focus()}},listen(e,t,n){if(e.part)return()=>{};let[i,...a]=t.split("."),f=a.includes("outside"),y=f?se:e,b=(Le[i]||i)+(f||a.includes("capture")?".capture":"")+(!f&&a.includes("stop")?".stop":""),u=f?(Be)=>{We(v,e)||n(Be)}:n,W=h.get(y.id);W||h.set(y.id,W=new Map);let V=W.get(b);if(!V)W.set(b,V=new Set),c(ye,y.id,b);return V.add(u),()=>{if(!V.delete(u)||V.size||!y.real)return;W.delete(b),c(me,y.id,b)}}},se=S("#root","",Q,!0),We=(e,t)=>{for(;e;e=e.parent)if(e===t)return!0;return!1},Ve=(e)=>{for(;e;e=e.parent)if(e.aria?.disabled!=null)return!0;return!1};return{host:p,root:se,flush:te,receive(e){if("call"in e){q.get(e.call)?.(e),q.delete(e.call);return}let t=h.get(e.id)?.get(e.name),n=e.event,i=n.detail?.value;if(n.type==="tap"&&Ve(N.get(e.t)||N.get(e.id)))return;if(typeof i==="string")A.set(e.id,i),n.target={...n.target,value:i};if(v=N.get(e.t),e.name==="focus"?T=N.get(e.id):e.name==="blur"&&T?.id===e.id&&(T=void 0),t)for(let a of[...t])a(n)}}}function tt(r){let o=lynx.getCoreContext(),s=Ue((d)=>o.dispatchEvent({type:ve,data:d}),{words:r,announce:(d)=>lynx.accessibilityAnnounce?.({content:d},()=>{})});return o.addEventListener(Te,(d)=>s.receive(d.data)),s}export{tt as connectBackground,Ue as createBackgroundHost};
1
+ var m=(r,o="")=>({type:r,value:o,attrs:{},vars:{},listeners:{},parent:null,first:null,last:null,prev:null,next:null}),$e=(r)=>r.type[0]!=="#";function B(r){let o=r.parent;if(!o)return;r.prev?r.prev.next=r.next:o.first=r.next,r.next?r.next.prev=r.prev:o.last=r.prev,r.parent=r.prev=r.next=null}function R(r,o,s){if(B(o),o.parent=r,s)o.prev=s.prev,o.next=s,s.prev?s.prev.next=o:r.first=o,s.prev=o;else o.prev=r.last,r.last?r.last.next=o:r.first=o,r.last=o}function se(r){if(typeof r==="string")return m("#text",r);if(r===0)return m("#marker","$");let[o,s,d]=r,l=m(o);return s&&Object.assign(l.attrs,s),d?.forEach((g)=>R(l,se(g),null)),l}function G(r){let o=[];for(;r;r=r.parent)o.unshift(r);return o}var ae={clone(r){if(!r.nodes)throw Error("[lips] this IR has no node tree: compile it with { target: 'tree' } to render on a tree host");let o=m("#fragment");for(let s of r.nodes)R(o,se(s),null);return o},fragment:()=>m("#fragment"),element:(r)=>m(r),text:(r)=>m("#text",r),marker:(r)=>m("#marker",r),child(r,o){let s=r.first;while(s&&o--)s=s.next;return s},next:(r)=>r.next,range(r,o){let s=[];for(let d=r;d;d=d.next)if(s.push(d),d===o)break;return s},insert:R,insertAfter(r,o){let s=r.parent;if(!s)return;let d=r;for(let l of o)R(s,l,d.next),d=l},remove:B,isElement:$e,connected:(r)=>G(r)[0].type==="#root",precedes(r,o){if(r===o)return!1;let s=G(r),d=G(o);if(s[0]!==d[0])return!1;let l=0;while(l<s.length&&l<d.length&&s[l]===d[l])l++;if(l===s.length)return!0;if(l===d.length)return!1;for(let g=s[l].next;g;g=g.next)if(g===d[l])return!0;return!1},setText:(r,o)=>{r.value=o},content(r,o){while(r.first)B(r.first);o&&R(r,m("#text",o),null)},attr:(r,o,s)=>{s===null?delete r.attrs[o]:r.attrs[o]=s},styleVar:(r,o,s)=>{s===null?delete r.vars[o]:r.vars[o]=s},scope:(r,o)=>{r.scope??=o},listen(r,o,s){return(r.listeners[o]??=new Set).add(s),()=>{r.listeners[o]?.delete(s)}}};var de={checked:"checked",unchecked:"not checked",mixed:"mixed",pressed:"pressed",selected:"selected",expanded:"expanded",collapsed:"collapsed",current:"current",disabled:"disabled",invalid:"invalid",required:"required",radio:"radio button",tab:"tab"},Pe={button:["button"],link:["link"],heading:["header"],img:["image"],image:["image"],checkbox:["button","checkbox"],switch:["button","switch"],radio:["button","radio"],tab:["button","tab"],option:["button"],menuitem:["button"],menuitemcheckbox:["button","checkbox"],menuitemradio:["button","radio"],searchbox:["search"],progressbar:["none","progressbar"]},je=new Set(["button","link","header"]),le={status:"polite",log:"polite",alert:"assertive"},_e=new Set(["none","presentation"]),K={button:"button",a:"link",h1:"heading",h2:"heading",h3:"heading",h4:"heading",h5:"heading",h6:"heading"},ce=[["aria-checked","checked","unchecked"],["aria-pressed","pressed"],["aria-selected","selected"],["aria-expanded","expanded","collapsed"],["aria-current","current"],["aria-disabled","disabled"],["aria-invalid","invalid"],["aria-required","required"]],U=new Set(["role","alt","for","tabindex","aria-label","aria-labelledby","aria-describedby","aria-hidden","aria-live","aria-modal","aria-roledescription","aria-valuetext","aria-valuenow",...ce.map((r)=>r[0])]),ue=(r,o)=>r.role?.trim().split(/\s+/)[0]||o||"";function fe(r,o,s,d,l,g,w){let h=Pe[o],N=[r["aria-valuetext"]??r["aria-valuenow"]];for(let[P,A,O]of ce){let x=P==="aria-disabled"&&r.disabled!=null?"true":r[P];x&&N.push(w[x==="false"?O:x==="mixed"?"mixed":A])}let v=r["aria-labelledby"]?d(r["aria-labelledby"]):r["aria-label"]||r.alt||g;if(!v&&h&&je.has(h[0])&&!s)v=l();v=[v,r["aria-describedby"]&&d(r["aria-describedby"])].filter(Boolean).join(", ");let T=r.tabindex==null||r.tabindex===""||isNaN(+r.tabindex)?void 0:+r.tabindex>=0;return{"accessibility-element":_e.has(o)||r.alt===""?!1:h||v?!0:void 0,"accessibility-traits":h?.[0],"accessibility-label":v||void 0,"accessibility-value":N.filter(Boolean).join(", ")||void 0,"accessibility-heading":o==="heading"||void 0,"accessibility-role-description":r["aria-roledescription"]||h?.[1]&&(w[h[1]]??h[1]),"accessibility-elements-hidden":r["aria-hidden"]==="true"||void 0,"accessibility-exclusive-focus":r["aria-modal"]==="true"||void 0,focusable:T}}var pe=0,ge=1,be=2,F=3,I=4,he=5,C=6,xe=7,ye=8,me=9,Ne=10;var z=1,ve="lips:ops",Te="lips:event",Me=["div","section","article","nav","header","footer","main","aside","ul","ol","li","button","form","figure","dialog","details","summary","address","blockquote","hgroup","fieldset","legend","menu","dl","dt","dd","figcaption"],Ce=["span","p","h1","h2","h3","h4","h5","h6","label","b","strong","i","em","small","a","code","mark","s","u","sub","sup","time","abbr","cite","kbd","q","var","samp","dfn","del","ins","data","bdi","bdo"],ke=Object.fromEntries([...Me.map((r)=>[r,"view"]),...Ce.map((r)=>[r,"text"]),["img","image"]]),Ee=(r)=>`lips-${r.replace(/[^\w-]/g,"-")}`,H="lips-svg",Le={click:"tap"};var Re=(r)=>r.replace(/[&<>"]/g,(o)=>`&#${o.charCodeAt(0)};`),He=new Set(["input","textarea"]),Ye=0,Xe=1,qe=2,De=3,Ge=4,Ke=new Set(["class","style","id"]);function Ue(r,{announce:o,words:s=de}={}){let d=z,l=[],g=0,w=!1,h=new Map,N=new Map,v,T,P=0,A=new Map,O=new Set,x=new Map,E=new Map,L=!1,Q=!1,j=(e)=>{let t=e.type==="#text"?e.value:"";for(let n=e.first;n;n=n.next)t+=" "+Z(n);return t.replace(/\s+/g," ").trim()},Z=(e)=>e.aria?.["aria-hidden"]==="true"?"":e.aria?.["aria-label"]||e.aria?.alt||j(e),we=(e)=>e.trim().split(/\s+/).map((t)=>x.get(t)).filter(Boolean).map((t)=>Z(t)).join(" "),Se=()=>{let e=[];for(let t of O){let n=t.aria||{},i=ue(n,t.role),a=t.idv&&E.get(t.idv),f=fe(n,i,t.type==="text",we,()=>j(t),a?j(a):"",s),y=t.sent||={};for(let u of new Set([...Object.keys(f),...Object.keys(y)]))f[u]!==y[u]&&c(I,t.id,u,(y[u]=f[u])??null);let b=n["aria-live"]??le[i];if(b&&b!=="off"){let u=j(t);u&&u!==t.said&&(t.said!==void 0||b==="assertive"&&Q)&&e.push(u),t.said=u}}return L=!1,e},_=(e)=>{O.add(e),L=!0,X()},Y=new Set,Ie=(e)=>{while(e?.part)e=e.parent;return e?.type==="svg"?e:void 0},M=(e)=>{let t=Ie(e);if(!t)return;Y.add(t),X()},J=(e)=>{if(e.type==="#text")return Re(e.value);let t="";for(let a=e.first;a;a=a.next)t+=J(a);if(e.type[0]==="#")return t;let n=e.part||e.type,i="";for(let a in e.attrs)a===H||(i+=` ${a}="${Re(e.attrs[a])}"`);return`<${n}${i}>${t}</${n}>`},ee=()=>{for(let n of Y){let i=n.real?J(n):n.drawn;i!==n.drawn&&c(I,n.id,"content",n.drawn=i)}Y.clear();let e=L?Se():[];if(w=!1,Q=!0,!l.length)return;let t=l;l=[],g++,r(t),o&&e.forEach(o)},X=()=>{if(w)return;w=!0,Promise.resolve().then(ee)},c=(...e)=>{l.push(...e),X()},k=(e,t,n={},i=0)=>{e.real&&c(Ne,e.id,t,n,i)},q=new Map,te=0,Ae={focus(){T=this,k(this,He.has(this.type)?"focus":"requestAccessibilityFocus")},blur(){T===this&&(T=void 0),k(this,"blur")},scrollTo(e,t){let n=typeof e==="object"?e:{left:e,top:t};k(this,"scrollTo",{offset:n.top||n.left||0,smooth:n.behavior==="smooth"})},scrollIntoView(e){let t=typeof e==="object"?e:{block:e===!1?"end":"start"};k(this,"scrollIntoView",{scrollIntoViewOptions:{behavior:t.behavior==="smooth"?"smooth":"auto",block:t.block||"start",inline:t.inline||"start"}})},animate(e,t={}){let n=`lips-${this.id}-${++P}`,i=(a)=>()=>k(this,"animate",[a,n]);return k(this,"animate",[Ye,n,e,typeof t==="number"?{duration:t}:t]),{id:n,play:i(Xe),pause:i(qe),cancel:i(De),finish:i(Ge)}},getBoundingClientRect(){return new Promise((e)=>{if(!this.real)return e(null);p.attr(this,"lips-rect",""),q.set(++te,({code:t,data:n})=>e(t||!n?null:{x:n.left,y:n.top,width:n.width,height:n.height,top:n.top,right:n.right,bottom:n.bottom,left:n.left})),k(this,"boundingClientRect",{},te)})}},S=(e,t="",n=0,i=!1)=>Object.assign(Object.create(Ae),m(e,t),{id:n,real:i,at:null}),re=(e)=>[e.cls,e.scope&&Ee(e.scope)].filter(Boolean).join(" "),ne=["width","height"],Oe=(e)=>e.type==="svg"?ne.filter((t)=>e.attrs[t]).map((t)=>`${t}: ${e.attrs[t]}${/^[\d.]+$/.test(e.attrs[t])?"px":""}`).join("; "):"",D=(e)=>[Oe(e),e.css,...Object.entries(e.vars).map(([t,n])=>`${t}: ${n}`)].filter(Boolean).join("; "),oe=(e)=>{for(let t=e.first;t;t=t.next)oe(t);if(!e.real)return;h.delete(e.id),N.delete(e.id),A.delete(e.id),O.delete(e),e.idv&&x.get(e.idv)===e&&x.delete(e.idv),e.aria?.for&&E.get(e.aria.for)===e&&E.delete(e.aria.for),c(me,e.id),e.real=!1},p={...ae,clone(e){if(!e.nodes)throw Error("[lips] this IR has no node tree: compile it with { target: 'tree' } to render on Lynx");let t=(i)=>{if(typeof i==="string")return p.text(i);if(i===0)return p.marker("$");let[a,f,y]=i,b=f?.[H]?Object.assign(S(a),{part:f[H]}):p.element(a);if(f)for(let u in f)p.attr(b,u,f[u]);return y?.forEach((u)=>p.insert(b,t(u),null)),b},n=p.fragment();for(let i of e.nodes)p.insert(n,t(i),null);return n},fragment:()=>S("#fragment"),element(e){let t=S(ke[e]||e,"",++d,!0);if(N.set(t.id,t),c(pe,t.id,t.type),t.batch=g,K[e])t.role=K[e],_(t);return t},text:(e)=>S("#text",e,++d),marker:(e)=>S("#marker",e),insert(e,t,n){if(R(e,t,n),M(e),L=!0,t.type==="#text"&&!t.real&&e.type==="text"&&!e.part)t.real=!0,N.set(t.id,t),c(ge,t.id,t.value),t.slot=l.length-1,t.batch=g;if(!t.real)return;if(t.at&&c(F,t.at.id,t.id),t.at=null,!e.real)return;let i=t.next;while(i&&!i.real)i=i.next;c(be,e.id,t.id,i?i.id:0),t.at=e},insertAfter(e,t){let n=e.parent;if(!n)return;let i=e;for(let a of t)p.insert(n,a,i.next),i=a},remove(e,t){L=!0,M(e.parent),B(e),e.at&&c(F,e.at.id,e.id),e.at=null,t&&oe(e)},setText(e,t){if(e.value===t)return;if(e.value=t,L=!0,!e.real)return M(e.parent);e.batch===g?l[e.slot]=t:c(he,e.id,t)},content(e,t){while(e.first)p.remove(e.first,!0);if(!t)return;let n=e.type==="text"?e:p.element("text");n===e||p.insert(e,n,null),p.insert(n,p.text(t),null)},attr(e,t,n){let i=e.wrote||={};if(t in i&&i[t]===n)return;if(i[t]=n,e.part||e.type==="svg"&&!Ke.has(t)&&!t.startsWith("data-")&&!U.has(t))n===null?delete e.attrs[t]:e.attrs[t]=n,M(e),e.part||!ne.includes(t)||c(C,e.id,D(e));else if(t==="class")e.cls=n??void 0,c(I,e.id,"class",re(e));else if(t==="style")e.css=n??void 0,c(C,e.id,D(e));else if(t==="value"&&(e.type==="input"||e.type==="textarea")&&e.batch!==g)n!==A.get(e.id)&&k(e,"setValue",{value:n??""});else if(U.has(t)||t==="disabled"&&e.role==="button"){let a=e.aria||={};if(t==="for"){a.for&&E.get(a.for)===e&&E.delete(a.for),n&&E.set(n,e);let f=n&&x.get(n);f&&_(f)}n===null?delete a[t]:a[t]=n,_(e)}else{if(t==="id")e.idv&&x.get(e.idv)===e&&x.delete(e.idv),e.idv=n??void 0,n&&x.set(n,e),L=!0,E.has(n)&&_(e);c(I,e.id,t,n)}},styleVar(e,t,n){if(n===null?!(t in e.vars):e.vars[t]===n)return;n===null?delete e.vars[t]:e.vars[t]=n,c(C,e.id,D(e))},scope(e,t){if(e.scope)return;e.scope=t,c(I,e.id,"class",re(e))},keepFocus(){let e=T;return()=>{e?.real&&e.at&&e.focus()}},listen(e,t,n){if(e.part)return()=>{};let[i,...a]=t.split("."),f=a.includes("outside"),y=f?ie:e,b=(Le[i]||i)+(f||a.includes("capture")?".capture":"")+(!f&&a.includes("stop")?".stop":""),u=f?(Be)=>{We(v,e)||n(Be)}:n,W=h.get(y.id);W||h.set(y.id,W=new Map);let V=W.get(b);if(!V)W.set(b,V=new Set),c(xe,y.id,b);return V.add(u),()=>{if(!V.delete(u)||V.size||!y.real)return;W.delete(b),c(ye,y.id,b)}}},ie=S("#root","",z,!0),We=(e,t)=>{for(;e;e=e.parent)if(e===t)return!0;return!1},Ve=(e)=>{for(;e;e=e.parent)if(e.aria?.disabled!=null)return!0;return!1};return{host:p,root:ie,flush:ee,receive(e){if("call"in e){q.get(e.call)?.(e),q.delete(e.call);return}let t=h.get(e.id)?.get(e.name),n=e.event,i=n.detail?.value;if(n.type==="tap"&&Ve(N.get(e.t)||N.get(e.id)))return;if(typeof i==="string")A.set(e.id,i),n.target={...n.target,value:i};if(v=N.get(e.t),e.name==="focus"?T=N.get(e.id):e.name==="blur"&&T?.id===e.id&&(T=void 0),t)for(let a of[...t])a(n)}}}function tt(r){let o=lynx.getCoreContext(),s=Ue((d)=>o.dispatchEvent({type:ve,data:d}),{words:r,announce:(d)=>lynx.accessibilityAnnounce?.({content:d},()=>{})});return o.addEventListener(Te,(d)=>s.receive(d.data)),s}export{tt as connectBackground,Ue as createBackgroundHost};
2
2
 
3
- //# debugId=21CED0DF1ADA542A64756E2164756E21
3
+ //# debugId=EDBA19CA3B41DB0A64756E2164756E21
@@ -5,9 +5,9 @@
5
5
  "/**\n * An in-memory host (RFC-006 §4.1): the IR runtime over plain objects,\n * with no DOM anywhere.\n *\n * What it is for:\n * - proving the seam: the host spec renders the same IR through this\n * and through the DOM and requires identical trees\n * - the shape a native binding starts from: a background-thread Lynx\n * host keeps exactly this kind of shadow tree, because the runtime\n * walks siblings synchronously and the real elements live on another\n * thread\n * - rendering where there is no document (tests, servers)\n *\n * Skeletons are built from `BlockIR.nodes`, so the IR must be compiled\n * with `{ target: 'tree' }`.\n *\n * const root = treeRoot()\n * renderIR( compileTemplate( src, { target: 'tree' } ).ir, setup, { host: treeHost } ).mount( root )\n */\n\nimport type { BlockIR, NodeIR } from './compiler'\nimport type { Host } from './host'\n\nexport interface TreeNode {\n /** Element tag, or '#text' | '#marker' | '#fragment' | '#root' */\n type: string\n /** A text run's value, a marker's label */\n value: string\n attrs: Record<string, string>\n /** Inline custom properties (RFC-004 §8) */\n vars: Record<string, string>\n /** The stylesheet scope `Host.scope` assigned — recorded, not styled */\n scope?: string\n listeners: Record<string, Set<( event: any ) => void>>\n parent: TreeNode | null\n first: TreeNode | null\n last: TreeNode | null\n prev: TreeNode | null\n next: TreeNode | null\n}\n\n/** A fresh, unattached node — also the base of the Lynx background host's nodes */\nexport const treeNode = ( type: string, value = '' ): TreeNode => ({\n type, value,\n attrs: {}, vars: {}, listeners: {},\n parent: null, first: null, last: null, prev: null, next: null\n})\n\nconst isElement = ( n: TreeNode ) => n.type[ 0 ] !== '#'\n\nexport function unlink( n: TreeNode ){\n const p = n.parent\n if( !p ) return\n\n n.prev ? n.prev.next = n.next : p.first = n.next\n n.next ? n.next.prev = n.prev : p.last = n.prev\n n.parent = n.prev = n.next = null\n}\n\n/** DOM `insertBefore`: the node leaves wherever it was first */\nexport function link( parent: TreeNode, n: TreeNode, ref: TreeNode | null ){\n unlink( n )\n n.parent = parent\n\n if( ref ){\n n.prev = ref.prev\n n.next = ref\n ref.prev ? ref.prev.next = n : parent.first = n\n ref.prev = n\n }\n else {\n n.prev = parent.last\n parent.last ? parent.last.next = n : parent.first = n\n parent.last = n\n }\n}\n\nfunction build( n: NodeIR ): TreeNode {\n if( typeof n === 'string' ) return treeNode( '#text', n )\n if( n === 0 ) return treeNode( '#marker', '$' )\n\n const [ tag, attrs, children ] = n\n const el = treeNode( tag )\n attrs && Object.assign( el.attrs, attrs )\n children?.forEach( c => link( el, build( c ), null ) )\n return el\n}\n\n/** Root to path, inclusive */\nfunction chain( n: TreeNode | null ){\n const out: TreeNode[] = []\n for( ; n; n = n.parent ) out.unshift( n )\n return out\n}\n\nexport const treeHost: Host<TreeNode> = {\n clone( block: BlockIR ){\n if( !block.nodes )\n throw new Error(`[lips] this IR has no node tree: compile it with { target: 'tree' } to render on a tree host`)\n\n const frag = treeNode('#fragment')\n for( const n of block.nodes ) link( frag, build( n ), null )\n return frag\n },\n fragment: () => treeNode('#fragment'),\n element: tag => treeNode( tag ),\n text: value => treeNode( '#text', value ),\n marker: label => treeNode( '#marker', label ),\n\n child( parent, index ){\n let n = parent.first\n while( n && index-- ) n = n.next\n return n!\n },\n next: n => n.next,\n range( first, last ){\n const out: TreeNode[] = []\n for( let n: TreeNode | null = first; n; n = n.next ){\n out.push( n )\n if( n === last ) break\n }\n return out\n },\n insert: link,\n insertAfter( ref, nodes ){\n const parent = ref.parent\n if( !parent ) return\n let anchor = ref\n for( const n of nodes ){\n link( parent, n, anchor.next )\n anchor = n\n }\n },\n remove: unlink,\n isElement,\n connected: n => chain( n )[ 0 ].type === '#root',\n /**\n * Tree order: an ancestor precedes its descendants, and at the first\n * divergence the earlier sibling wins. Nodes in different trees are\n * unordered, so the answer is false either way round.\n */\n precedes( a, b ){\n if( a === b ) return false\n\n const ca = chain( a ), cb = chain( b )\n if( ca[ 0 ] !== cb[ 0 ] ) return false\n\n let i = 0\n while( i < ca.length && i < cb.length && ca[ i ] === cb[ i ] ) i++\n\n if( i === ca.length ) return true // a contains b\n if( i === cb.length ) return false // b contains a\n\n for( let n = ca[ i ].next; n; n = n.next )\n if( n === cb[ i ] ) return true\n return false\n },\n\n setText: ( n, value ) => { n.value = value },\n content( el, value ){\n while( el.first ) unlink( el.first )\n value && link( el, treeNode( '#text', value ), null )\n },\n attr: ( el, name, value ) => { value === null ? delete el.attrs[ name ] : el.attrs[ name ] = value },\n styleVar: ( el, prop, value ) => { value === null ? delete el.vars[ prop ] : el.vars[ prop ] = value },\n scope: ( el, nsp ) => { el.scope ??= nsp },\n listen( el, name, fn ){\n ( el.listeners[ name ] ??= new Set() ).add( fn )\n return () => { el.listeners[ name ]?.delete( fn ) }\n }\n}\n\n/** A live root to mount into: what is under it counts as connected */\nexport const treeRoot = () => treeNode('#root')\n\nexport function childrenOf( n: TreeNode ){\n const out: TreeNode[] = []\n for( let c = n.first; c; c = c.next ) out.push( c )\n return out\n}\n\n/**\n * Fire an element's own listeners — what a tap would do. No bubbling:\n * the runtime attaches every listener to the element that declares it.\n */\nexport function dispatch( el: TreeNode, name: string, event: any = { type: name, target: el } ){\n for( const fn of [ ...( el.listeners[ name ] || [] ) ] ) fn( event )\n}\n",
6
6
  "/**\n * Accessibility on Lynx (RFC-006 §4.8): a template's ARIA, read as Lynx's\n * own accessibility attributes (verified in §3.8).\n *\n * The background host keeps each element's ARIA and, once per flush,\n * sends what it comes to:\n *\n * ARIA Lynx\n * role (and button, a, h1–h6) accessibility-traits, -element, -heading, -role-description\n * aria-label, alt, aria-labelledby, accessibility-label: ids and <label for> resolved to\n * <label for>, aria-describedby their text here, and kept current\n * aria-checked, -selected, -expanded, accessibility-value: words, the same on every platform\n * -pressed, -current, -disabled,\n * -invalid, -required, -valuetext/now\n * aria-hidden accessibility-elements-hidden\n * aria-modal accessibility-exclusive-focus\n * aria-live, role=status|log|alert lynx.accessibilityAnnounce of the region's text\n * tabindex focusable\n * disabled on a button accessibility-value, as aria-disabled; its taps are dropped\n *\n * What has no Lynx equivalent is a compile-time warning (`./template`).\n */\n\n/** Spoken words: the states, and the role descriptions Android speaks as given. Replace them to translate */\nexport const WORDS = {\n checked: 'checked', unchecked: 'not checked', mixed: 'mixed', pressed: 'pressed', selected: 'selected',\n expanded: 'expanded', collapsed: 'collapsed', current: 'current', disabled: 'disabled',\n invalid: 'invalid', required: 'required', radio: 'radio button', tab: 'tab'\n}\nexport type Words = Record<keyof typeof WORDS, string>\n\n/**\n * A role → its trait, and Android's role description. `checkbox`,\n * `switch` and `progressbar` are Android class names, not words: Android\n * speaks them in the user's language. Android and HarmonyOS take one\n * trait, of `button`, `image` and `text`; the others reach iOS only.\n */\nexport const ROLES: Record<string, [ string, string? ]> = {\n button: [ 'button' ], link: [ 'link' ], heading: [ 'header' ], img: [ 'image' ], image: [ 'image' ],\n checkbox: [ 'button', 'checkbox' ], switch: [ 'button', 'switch' ], radio: [ 'button', 'radio' ], tab: [ 'button', 'tab' ],\n option: [ 'button' ], menuitem: [ 'button' ], menuitemcheckbox: [ 'button', 'checkbox' ], menuitemradio: [ 'button', 'radio' ],\n searchbox: [ 'search' ], progressbar: [ 'none', 'progressbar' ]\n}\n/** Roles the content names: their element swallows its children on iOS, so it is labelled with their text */\nconst NAMED = new Set([ 'button', 'link', 'header' ])\n/** Regions whose changes are announced */\nexport const LIVE: Record<string, string> = { status: 'polite', log: 'polite', alert: 'assertive' }\nexport const QUIET = new Set([ 'none', 'presentation' ])\n/** The roles HTML tags carry: what Lynx's `view` and `text` lose */\nexport const IMPLICIT: Record<string, string> = {\n button: 'button', a: 'link', h1: 'heading', h2: 'heading', h3: 'heading', h4: 'heading', h5: 'heading', h6: 'heading'\n}\n\n/** State attribute → its word when set, and when \"false\" */\nconst STATES: [ string, keyof Words, ( keyof Words )? ][] = [\n [ 'aria-checked', 'checked', 'unchecked' ], [ 'aria-pressed', 'pressed' ], [ 'aria-selected', 'selected' ],\n [ 'aria-expanded', 'expanded', 'collapsed' ], [ 'aria-current', 'current' ], [ 'aria-disabled', 'disabled' ],\n [ 'aria-invalid', 'invalid' ], [ 'aria-required', 'required' ]\n]\n\n/** The attributes the host reads instead of sending */\nexport const A11Y = new Set([\n 'role', 'alt', 'for', 'tabindex', 'aria-label', 'aria-labelledby', 'aria-describedby', 'aria-hidden',\n 'aria-live', 'aria-modal', 'aria-roledescription', 'aria-valuetext', 'aria-valuenow', ...STATES.map( s => s[ 0 ] )\n])\n\nexport type Aria = Record<string, string>\n\n/** ARIA takes the first token of a role list it knows; Lynx knows one */\nexport const roleOf = ( a: Aria, implicit?: string ) => a.role?.trim().split( /\\s+/ )[ 0 ] || implicit || ''\n\n/**\n * The Lynx attributes one element's ARIA comes to; `undefined` resets one.\n * `refs( ids )` is the text of those ids, `content()` the element's own,\n * `labelled` the text of a `<label for>` it.\n */\nexport function lynxA11y( a: Aria, role: string, isText: boolean, refs: ( ids: string ) => string, content: () => string, labelled: string, words: Words ){\n const r = ROLES[ role ]\n const value = [ a[ 'aria-valuetext' ] ?? a[ 'aria-valuenow' ] ]\n for( const [ name, on, off ] of STATES ){\n // HTML's `disabled` on a button wins over its `aria-disabled` (lips#41)\n const v = name === 'aria-disabled' && a.disabled != null ? 'true' : a[ name ]\n // Empty is ARIA's \"not set\". A bound boolean arrives written out, \"true\" or \"false\" (lips#40)\n v && value.push( words[ v === 'false' ? off! : v === 'mixed' ? 'mixed' : on ] )\n }\n\n let label = a[ 'aria-labelledby' ] ? refs( a[ 'aria-labelledby' ] ) : a[ 'aria-label' ] || a.alt || labelled\n if( !label && r && NAMED.has( r[ 0 ] ) && !isText ) label = content()\n label = [ label, a[ 'aria-describedby' ] && refs( a[ 'aria-describedby' ] ) ].filter( Boolean ).join(', ')\n\n const tab = a.tabindex == null || a.tabindex === '' || isNaN( +a.tabindex ) ? undefined : +a.tabindex >= 0\n return {\n 'accessibility-element': QUIET.has( role ) || a.alt === '' ? false : r || label ? true : undefined,\n 'accessibility-traits': r?.[ 0 ],\n 'accessibility-label': label || undefined,\n 'accessibility-value': value.filter( Boolean ).join(', ') || undefined,\n 'accessibility-heading': role === 'heading' || undefined,\n 'accessibility-role-description': a[ 'aria-roledescription' ] || r?.[ 1 ] && ( words[ r[ 1 ] as keyof Words ] ?? r[ 1 ] ),\n 'accessibility-elements-hidden': a[ 'aria-hidden' ] === 'true' || undefined,\n 'accessibility-exclusive-focus': a[ 'aria-modal' ] === 'true' || undefined,\n focusable: tab\n } as Record<string, unknown>\n}\n",
7
7
  "/**\n * The change protocol between the two Lynx threads (RFC-006 §4.2).\n *\n * The background thread runs Lips and never touches an element. What it\n * sends is ONE flat array per flush: an opcode followed by a fixed number\n * of operands, repeated. Flat and primitive-only, so the cross-thread copy\n * is as cheap as a message can be, and it serializes to the same thing on\n * every platform. Ids are integers the background allocates; 1 is the page.\n *\n * op operands main thread does\n * CREATE id, tag element of that Lynx tag\n * TEXT id, value raw text\n * INSERT parent, id, ref insert before `ref`, or append when 0\n * REMOVE parent, id detach\n * ATTR id, name, value routed: class / id / data-* / attribute\n * SET_TEXT id, value raw text's value\n * STYLES id, css the whole inline style\n * LISTEN id, name forward that event to the background;\n * `name.capture`, `name.stop` bind it so\n * UNLISTEN id, name stop forwarding it\n * RELEASE id forget the id (the node is gone)\n * INVOKE id, method, params, a UI method (`setValue`, `scrollTo`, …),\n * call once the batch is flushed; `animate`\n * is `__ElementAnimate( params )`. A\n * `call` other than 0 asks for its\n * result, sent back as a `WireReply`\n *\n * A `list` is the exception to \"INSERT inserts\": Lynx asks for its cells\n * as they scroll into view. The applier keeps each list's order and\n * hands it over as `update-list-info` once per batch.\n */\n\nexport const\nCREATE = 0,\nTEXT = 1,\nINSERT = 2,\nREMOVE = 3,\nATTR = 4,\nSET_TEXT = 5,\nSTYLES = 6,\nLISTEN = 7,\nUNLISTEN = 8,\nRELEASE = 9,\nINVOKE = 10\n\n/** Operand count per opcode, indexed by opcode */\nexport const ARITY = [ 2, 2, 3, 2, 3, 2, 2, 2, 2, 1, 4 ]\n\nexport const PAGE_ID = 1\n\n/** Cross-thread event names — background → main, and main → background */\nexport const OPS_EVENT = 'lips:ops'\nexport const DOM_EVENT = 'lips:event'\n\n/** Where an event happened, or who listens: an element's `id` and `dataset` */\nexport interface WireTarget {\n id?: string\n dataset: Record<string, unknown>\n}\n\n/** A touch point, as Lynx reports it */\nexport interface WirePoint {\n identifier?: number\n x?: number\n y?: number\n pageX?: number\n pageY?: number\n clientX?: number\n clientY?: number\n}\n\n/**\n * An element event as it crosses to the background: data only, never a\n * ref. What each kind carries is picked on the main thread (`./main`).\n */\nexport interface WireEvent {\n id: number\n name: string\n /** The Lips id of the element the event happened on, when it is one */\n t?: number\n event: {\n type: string\n detail?: unknown\n target?: WireTarget\n currentTarget?: WireTarget\n /** Key events */\n key?: string\n repeat?: boolean\n altKey?: boolean\n ctrlKey?: boolean\n metaKey?: boolean\n shiftKey?: boolean\n /** Touch events */\n touches?: WirePoint[]\n changedTouches?: WirePoint[]\n }\n}\n\n/**\n * A UI method's result, for the INVOKE that asked (`call`): what Lynx's\n * callback was given, `code` 0 for success (`LynxUIMethodConstants`).\n */\nexport interface WireReply {\n call: number\n code: number\n data?: unknown\n}\n\n/** A Lips template tag → the Lynx element it renders as (RFC-006 §4.3) */\nconst VIEW = [\n 'div', 'section', 'article', 'nav', 'header', 'footer', 'main', 'aside',\n 'ul', 'ol', 'li', 'button', 'form', 'figure', 'dialog', 'details', 'summary',\n 'address', 'blockquote', 'hgroup', 'fieldset', 'legend', 'menu', 'dl', 'dt', 'dd', 'figcaption'\n]\nconst TEXT_LIKE = [\n 'span', 'p', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'label', 'b', 'strong',\n 'i', 'em', 'small', 'a', 'code', 'mark', 's', 'u', 'sub', 'sup', 'time',\n 'abbr', 'cite', 'kbd', 'q', 'var', 'samp', 'dfn', 'del', 'ins', 'data', 'bdi', 'bdo'\n]\nexport const LYNX_TAG: Record<string, string> = Object.fromEntries([\n ...VIEW.map( t => [ t, 'view' ] ),\n ...TEXT_LIKE.map( t => [ t, 'text' ] ),\n [ 'img', 'image' ]\n])\n\n/**\n * The class a stylesheet scope stamps on a component's roots — what its\n * `.lips-<nsp>` rules select (RFC-006 §4.4). Attribute selectors never\n * match on Lynx, so the DOM's `rel` cannot be used.\n */\nexport const scopeClass = ( nsp: string ) => `lips-${nsp.replace( /[^\\w-]/g, '-' )}`\n\n/**\n * The attribute the template pass stamps on every element inside an\n * `<svg>`, holding its SVG spelling: it is part of the svg's markup, and\n * never an element of its own on the main thread.\n */\nexport const SVG_PART = 'lips-svg'\n\n/** Template event name → Lynx event name: DOM spellings keep working */\nexport const LYNX_EVENT: Record<string, string> = { click: 'tap' }\n",
8
- "/**\n * The background-thread host (RFC-006 §4.2).\n *\n * The Lips runtime runs here, against a SHADOW tree: the runtime walks\n * siblings and resolves paths synchronously, and the real elements live\n * on the other thread. Every mutation that the main thread must mirror is\n * recorded as protocol ops (`./protocol`) and sent once per microtask.\n *\n * Only some shadow nodes are REAL — they exist on the main thread:\n *\n * - elements, and the page\n * - text, once it sits under a `text` element (Lynx renders raw text\n * nowhere else)\n *\n * Markers, fragments and stray text never cross. Insert positions skip\n * them, so the main thread sees exactly the real children, in order.\n *\n * An element node answers the DOM element's own methods (`focus`, `blur`,\n * `scrollTo`, `scrollIntoView`, `animate`), so a `@ref` means the same on\n * both: each is a UI method, run once the batch is flushed (lips#37).\n *\n * Nor do the parts of an `<svg>` (the elements the template pass stamped\n * `lips-svg`): Lynx draws an svg as one view from a markup string, so its\n * subtree is written into its `content`, once per flush when it changed.\n *\n * const lynxHost = createBackgroundHost( ops => send( ops ) )\n * renderIR( ir, setup, { host: lynxHost.host } ).mount( lynxHost.root )\n */\n\nimport type { BlockIR, NodeIR } from '../ir/compiler'\nimport type { Host } from '../ir/host'\nimport { treeHost, treeNode, link, unlink, type TreeNode } from '../ir/tree'\nimport { A11Y, IMPLICIT, LIVE, WORDS, lynxA11y, roleOf, type Aria, type Words } from './a11y'\nimport {\n CREATE, TEXT, INSERT, REMOVE, ATTR, SET_TEXT, STYLES, LISTEN, UNLISTEN, RELEASE, INVOKE,\n PAGE_ID, LYNX_TAG, LYNX_EVENT, OPS_EVENT, DOM_EVENT, SVG_PART, scopeClass, type WireEvent, type WireReply\n} from './protocol'\n\n/** Markup text: what an attribute value or a text run may not hold as is */\nconst esc = ( s: string ) => s.replace( /[&<>\"]/g, c => `&#${c.charCodeAt( 0 )};` )\n\n/** Where `focus()` is input focus; anywhere else it is accessibility focus (RFC-006 §9.9) */\nconst INPUTS = new Set([ 'input', 'textarea' ])\n\n/** `__ElementAnimate`'s operations, as Lynx's own `Animation` sends them */\nconst START = 0, PLAY = 1, PAUSE = 2, CANCEL = 3, FINISH = 4\n\n/** A DOM `animate` option: its duration alone, or the options Lynx's `animate` reads as they are */\ntype AnimateOptions = number | Record<string, unknown>\n\n/** An svg's own attributes that stay on its element rather than in its markup */\nconst ON_SVG = new Set([ 'class', 'style', 'id' ])\n\nexport interface LynxNode extends TreeNode {\n parent: LynxNode | null\n first: LynxNode | null\n last: LynxNode | null\n prev: LynxNode | null\n next: LynxNode | null\n /** Shared with the main thread; 0 for nodes that never cross */\n id: number\n /** Exists on the main thread */\n real: boolean\n /** The real parent the main thread has it under, if any */\n at: LynxNode | null\n /** `class` and `style` as written — merged with the scope class and variables */\n cls?: string\n css?: string\n /** Where its TEXT op's value sits in the unsent batch; the batch it was created in */\n slot?: number\n batch?: number\n /** Its ARIA (RFC-006 §4.8), the role its tag implies, its `id`, what was sent for them, what it last announced */\n aria?: Aria\n role?: string\n idv?: string\n sent?: Record<string, unknown>\n said?: string\n /** Each attribute as last written: an equal write is not sent again */\n wrote?: Record<string, string | null>\n /** What a `@ref` calls, as on the DOM element (lips#37) */\n focus(): void\n blur(): void\n scrollTo( x?: number | { top?: number, left?: number, behavior?: string }, y?: number ): void\n scrollIntoView( arg?: boolean | { behavior?: string, block?: string, inline?: string } ): void\n animate( keyframes: unknown, options?: AnimateOptions ): { id: string, play(): void, pause(): void, cancel(): void, finish(): void }\n /** Its box once laid out, or null when Lynx cannot measure it: a promise here, so `await` it on both hosts */\n getBoundingClientRect(): Promise<Rect | null>\n /** Part of an svg's markup: its SVG spelling. On an svg: the markup last sent */\n part?: string\n drawn?: string\n}\n\n/** A box as the DOM's `getBoundingClientRect()` gives it, in CSS pixels */\nexport interface Rect {\n x: number\n y: number\n width: number\n height: number\n top: number\n right: number\n bottom: number\n left: number\n}\n\nexport interface BackgroundOptions {\n /** Speak a live region's new text: `lynx.accessibilityAnnounce` on the real thread */\n announce?: ( text: string ) => void\n /** The spoken words for states and roles (`WORDS`), to translate them */\n words?: Words\n}\n\nexport interface BackgroundHost {\n host: Host<LynxNode>\n /** The page: mount the root instance here */\n root: LynxNode\n /** An element event forwarded by the main thread, or a UI method's result */\n receive( wire: WireEvent | WireReply ): void\n /** Send what is pending now instead of at the end of the microtask */\n flush(): void\n}\n\nexport function createBackgroundHost( send: ( ops: unknown[] ) => void, { announce, words = WORDS }: BackgroundOptions = {} ): BackgroundHost {\n let\n seq = PAGE_ID,\n ops: unknown[] = [],\n batch = 0,\n scheduled = false\n\n const handlers = new Map<number, Map<string, Set<( event: any ) => void>>>()\n /** The real nodes by id, and the one the event being dispatched happened on */\n const live = new Map<number, LynxNode>()\n let target: LynxNode | undefined\n /** The element last focused, as far as this thread can know: a ref's `focus()`, or a `focus` event a template listens for */\n let focused: LynxNode | undefined\n let animations = 0\n /** What each input last reported holding — the value it already shows */\n const typed = new Map<number, string>()\n\n /**\n * Accessibility (RFC-006 §4.8): the elements with ARIA, the elements by\n * `id` and by the `<label for>` them, and whether any text, structure\n * or ARIA changed since the last flush. A name reads all three, across\n * elements, so any change reads every element again; only what differs\n * from what was sent is sent.\n */\n const a11y = new Set<LynxNode>(), ids = new Map<string, LynxNode>(), labels = new Map<string, LynxNode>()\n let moved = false, rendered = false\n\n /** What an element's content reads as: its text, or the name a part has instead */\n const read = ( n: LynxNode ): string => {\n let s = n.type === '#text' ? n.value : ''\n for( let c = n.first; c; c = c.next ) s += ' ' + name( c )\n return s.replace( /\\s+/g, ' ' ).trim()\n }\n const name = ( n: LynxNode ) => n.aria?.[ 'aria-hidden' ] === 'true' ? '' : n.aria?.[ 'aria-label' ] || n.aria?.alt || read( n )\n const refs = ( list: string ) => list.trim().split( /\\s+/ ).map( id => ids.get( id ) ).filter( Boolean ).map( n => name( n! ) ).join(' ')\n\n /** Send what each element's ARIA now comes to, and announce what live regions now say */\n const derive = () => {\n const said: string[] = []\n for( const n of a11y ){\n const a = n.aria || {}, role = roleOf( a, n.role ), label = n.idv && labels.get( n.idv )\n const out = lynxA11y( a, role, n.type === 'text', refs, () => read( n ), label ? read( label ) : '', words )\n const sent = n.sent ||= {}\n for( const k of new Set([ ...Object.keys( out ), ...Object.keys( sent ) ]) )\n out[ k ] !== sent[ k ] && emit( ATTR, n.id, k, ( sent[ k ] = out[ k ] ) ?? null )\n\n // A region announces its changes; an alert also its arrival, after the first render\n const live = a[ 'aria-live' ] ?? LIVE[ role ]\n if( live && live !== 'off' ){\n const text = read( n )\n text && text !== n.said && ( n.said !== undefined || live === 'assertive' && rendered ) && said.push( text )\n n.said = text\n }\n }\n moved = false\n return said\n }\n const track = ( n: LynxNode ) => {\n a11y.add( n )\n moved = true\n schedule()\n }\n\n /** The svgs whose markup may have changed since the last flush */\n const drawn = new Set<LynxNode>()\n\n /** The svg a node is drawn in: up through the parts, to the svg element */\n const svgOf = ( n: LynxNode | null ) => {\n while( n?.part ) n = n.parent\n return n?.type === 'svg' ? n : undefined\n }\n const draw = ( n: LynxNode | null ) => {\n const svg = svgOf( n )\n if( !svg ) return\n drawn.add( svg )\n schedule()\n }\n const markup = ( n: LynxNode ): string => {\n if( n.type === '#text' ) return esc( n.value )\n let inner = ''\n for( let c = n.first; c; c = c.next ) inner += markup( c )\n if( n.type[ 0 ] === '#' ) return inner\n\n const tag = n.part || n.type\n let attrs = ''\n for( const k in n.attrs ) k === SVG_PART || ( attrs += ` ${k}=\"${esc( n.attrs[ k ] )}\"` )\n return `<${tag}${attrs}>${inner}</${tag}>`\n }\n\n const flush = () => {\n for( const svg of drawn ){\n const m = svg.real ? markup( svg ) : svg.drawn\n m !== svg.drawn && emit( ATTR, svg.id, 'content', svg.drawn = m )\n }\n drawn.clear()\n\n const said = moved ? derive() : []\n scheduled = false\n rendered = true\n if( !ops.length ) return\n const out = ops\n ops = []\n batch++\n send( out )\n announce && said.forEach( announce )\n }\n const schedule = () => {\n if( scheduled ) return\n scheduled = true\n // A promise job, not queueMicrotask: every Lynx background engine has one\n Promise.resolve().then( flush )\n }\n const emit = ( ...args: unknown[] ) => {\n ops.push( ...args )\n schedule()\n }\n\n /** A UI method on a real element, run once the batch is flushed (`./main`) */\n const invoke = ( n: LynxNode, method: string, params: unknown = {}, call = 0 ) => { n.real && emit( INVOKE, n.id, method, params, call ) }\n /** What waits for a UI method's result, by its call */\n const replies = new Map<number, ( r: WireReply ) => void>()\n let calls = 0\n\n /**\n * The DOM element's methods, by its names and its arguments, as Lynx's\n * UI methods take them (lynxjs.org: `<input>`, `<view>`, `<scroll-view>`,\n * `animate`). A method a ref holds on the DOM holds the same here.\n */\n const UI = {\n focus( this: LynxNode ){\n focused = this\n invoke( this, INPUTS.has( this.type ) ? 'focus' : 'requestAccessibilityFocus' )\n },\n blur( this: LynxNode ){\n focused === this && ( focused = undefined )\n invoke( this, 'blur' )\n },\n /** `( x, y )` or `{ top, left, behavior }`: a scroll-view scrolls along one axis, to one offset */\n scrollTo( this: LynxNode, x?: number | { top?: number, left?: number, behavior?: string }, y?: number ){\n const o = typeof x === 'object' ? x : { left: x, top: y }\n invoke( this, 'scrollTo', { offset: o.top || o.left || 0, smooth: o.behavior === 'smooth' })\n },\n /** Lynx asks for every option explicitly: the DOM's defaults are written out */\n scrollIntoView( this: LynxNode, arg?: boolean | { behavior?: string, block?: string, inline?: string } ){\n const o = typeof arg === 'object' ? arg : { block: arg === false ? 'end' : 'start' }\n invoke( this, 'scrollIntoView', { scrollIntoViewOptions: { behavior: o.behavior === 'smooth' ? 'smooth' : 'auto', block: o.block || 'start', inline: o.inline || 'start' } })\n },\n animate( this: LynxNode, keyframes: unknown, options: AnimateOptions = {} ){\n const id = `lips-${this.id}-${++animations}`, to = ( op: number ) => () => invoke( this, 'animate', [ op, id ] )\n invoke( this, 'animate', [ START, id, keyframes, typeof options === 'number' ? { duration: options } : options ] )\n return { id, play: to( PLAY ), pause: to( PAUSE ), cancel: to( CANCEL ), finish: to( FINISH ) }\n },\n /**\n * Lynx's `boundingClientRect` UI method, run once the batch is flushed\n * and answered once laid out (Android waits for layout), relative to\n * the LynxView as the DOM's is to the viewport. A box with only layout\n * styles gets no native view, and Lynx answers it NO_UI_FOR_NODE; any\n * attribute gives it one (`MarkHasLayoutOnlyPropsIfNecessary`), so a\n * measured box carries `lips-rect`. Null when it cannot be measured.\n */\n getBoundingClientRect( this: LynxNode ){\n return new Promise<Rect | null>( resolve => {\n if( !this.real ) return resolve( null )\n host.attr( this, 'lips-rect', '' )\n replies.set( ++calls, ( { code, data: d }: any ) => resolve( code || !d ? null\n : { x: d.left, y: d.top, width: d.width, height: d.height, top: d.top, right: d.right, bottom: d.bottom, left: d.left }) )\n invoke( this, 'boundingClientRect', {}, calls )\n })\n }\n }\n\n const node = ( type: string, value = '', id = 0, real = false ): LynxNode =>\n Object.assign( Object.create( UI ), treeNode( type, value ), { id, real, at: null } ) as LynxNode\n\n const classOf = ( n: LynxNode ) =>\n [ n.cls, n.scope && scopeClass( n.scope ) ].filter( Boolean ).join(' ')\n\n /**\n * An svg's `width` and `height` size its drawing AND its element, as on\n * the DOM. Lynx sizes the element by its style alone (tier B: an svg\n * with only the attributes lays out 0 high), so they go first in its\n * inline style, and the template's own `style` overrides them.\n */\n const SIZE = [ 'width', 'height' ]\n const sizeOf = ( n: LynxNode ) => n.type === 'svg'\n ? SIZE.filter( k => n.attrs[ k ] ).map( k => `${k}: ${n.attrs[ k ]}${/^[\\d.]+$/.test( n.attrs[ k ] ) ? 'px' : ''}` ).join('; ')\n : ''\n\n const cssOf = ( n: LynxNode ) =>\n [ sizeOf( n ), n.css, ...Object.entries( n.vars ).map( ( [ k, v ] ) => `${k}: ${v}` ) ].filter( Boolean ).join('; ')\n\n /** Every real id in a subtree — what the main thread can forget */\n const release = ( n: LynxNode ) => {\n for( let c = n.first; c; c = c.next ) release( c )\n if( !n.real ) return\n handlers.delete( n.id )\n live.delete( n.id )\n typed.delete( n.id )\n a11y.delete( n )\n n.idv && ids.get( n.idv ) === n && ids.delete( n.idv )\n n.aria?.for && labels.get( n.aria.for ) === n && labels.delete( n.aria.for )\n emit( RELEASE, n.id )\n n.real = false\n }\n\n const host: Host<LynxNode> = {\n ...( treeHost as unknown as Host<LynxNode> ),\n\n clone( block: BlockIR ){\n if( !block.nodes )\n throw new Error(`[lips] this IR has no node tree: compile it with { target: 'tree' } to render on Lynx`)\n\n const build = ( n: NodeIR ): LynxNode => {\n if( typeof n === 'string' ) return host.text( n )\n if( n === 0 ) return host.marker('$')\n\n const [ tag, attrs, children ] = n\n const el = attrs?.[ SVG_PART ] ? Object.assign( node( tag ), { part: attrs[ SVG_PART ] }) : host.element( tag )\n if( attrs ) for( const k in attrs ) host.attr( el, k, attrs[ k ] )\n children?.forEach( c => host.insert( el, build( c ), null ) )\n return el\n }\n\n const frag = host.fragment()\n for( const n of block.nodes ) host.insert( frag, build( n ), null )\n return frag\n },\n fragment: () => node('#fragment'),\n element( tag ){\n const el = node( LYNX_TAG[ tag ] || tag, '', ++seq, true )\n live.set( el.id, el )\n emit( CREATE, el.id, el.type )\n el.batch = batch\n if( IMPLICIT[ tag ] ){\n el.role = IMPLICIT[ tag ]\n track( el )\n }\n return el\n },\n text: value => node( '#text', value, ++seq ),\n marker: label => node( '#marker', label ),\n\n insert( parent, n, ref ){\n link( parent, n, ref )\n draw( parent )\n\n // Text becomes real the first time it lands where Lynx renders text\n moved = true\n if( n.type === '#text' && !n.real && parent.type === 'text' && !parent.part ){\n n.real = true\n live.set( n.id, n )\n emit( TEXT, n.id, n.value )\n n.slot = ops.length - 1\n n.batch = batch\n }\n if( !n.real ) return\n\n n.at && emit( REMOVE, n.at.id, n.id )\n n.at = null\n if( !parent.real ) return\n\n let r = n.next\n while( r && !r.real ) r = r.next\n emit( INSERT, parent.id, n.id, r ? r.id : 0 )\n n.at = parent\n },\n insertAfter( ref, nodes ){\n const parent = ref.parent\n if( !parent ) return\n let anchor = ref\n for( const n of nodes ){\n host.insert( parent, n, anchor.next )\n anchor = n\n }\n },\n remove( n, gone ){\n moved = true\n draw( n.parent )\n unlink( n )\n n.at && emit( REMOVE, n.at.id, n.id )\n n.at = null\n gone && release( n )\n },\n\n /**\n * A text bind creates its node empty and fills it in the same pass.\n * While the TEXT op is still unsent, the value goes into it — one op\n * per text instead of two, which on a 1k-row list is 2k fewer. Text\n * equal to what the node holds is not sent at all.\n */\n setText( n, value ){\n if( n.value === value ) return\n n.value = value\n moved = true\n if( !n.real ) return draw( n.parent )\n n.batch === batch\n ? ops[ n.slot! ] = value\n : emit( SET_TEXT, n.id, value )\n },\n /** `@text` and `@format`: in a text of its own when the element is not one */\n content( el, value ){\n while( el.first ) host.remove( el.first, true )\n if( !value ) return\n const t = el.type === 'text' ? el : host.element('text')\n t === el || host.insert( el, t, null )\n host.insert( t, host.text( value ), null )\n },\n /**\n * An equal write is dropped here, the one place that sees them all. A\n * replaced `<for>` array re-runs every kept row's binds (`touch()` on\n * the same object, `set` on a new one), and without this each one\n * crossed again: 100 rows' text where 11 changed (lips#39, L4).\n */\n attr( el, name, value ){\n const w = el.wrote ||= {}\n if( name in w && w[ name ] === value ) return\n w[ name ] = value\n // In an svg's markup: kept for it, not sent (the svg's class, style, id, data-* and ARIA stay on its element)\n if( el.part || el.type === 'svg' && !ON_SVG.has( name ) && !name.startsWith('data-') && !A11Y.has( name ) ){\n value === null ? delete el.attrs[ name ] : el.attrs[ name ] = value\n draw( el )\n el.part || !SIZE.includes( name ) || emit( STYLES, el.id, cssOf( el ) )\n }\n else if( name === 'class' ){\n el.cls = value ?? undefined\n emit( ATTR, el.id, 'class', classOf( el ) )\n }\n else if( name === 'style' ){\n el.css = value ?? undefined\n emit( STYLES, el.id, cssOf( el ) )\n }\n /**\n * Lynx inputs are uncontrolled: the attribute sets the first value\n * only, `setValue` every one after (RFC-006 §4.5). A value the input\n * itself reported is already on screen — writing it back would race\n * the user's next keystroke — so it is not sent.\n */\n else if( name === 'value' && ( el.type === 'input' || el.type === 'textarea' ) && el.batch !== batch ){\n value !== typed.get( el.id ) && emit( INVOKE, el.id, 'setValue', { value: value ?? '' })\n }\n /**\n * ARIA is read here, not sent: Lynx has its own attributes (`./a11y`).\n * So is `disabled` on a button: Lynx has no disabled view and does\n * not block its tap (lips#41). It is sent as `aria-disabled` is, and\n * `receive` drops the taps inside it.\n */\n else if( A11Y.has( name ) || name === 'disabled' && el.role === 'button' ){\n const a = el.aria ||= {}\n if( name === 'for' ){\n a.for && labels.get( a.for ) === el && labels.delete( a.for )\n value && labels.set( value, el )\n // The labelled element is read again, wherever it is\n const target = value && ids.get( value )\n target && track( target )\n }\n value === null ? delete a[ name ] : a[ name ] = value\n track( el )\n }\n else {\n if( name === 'id' ){\n el.idv && ids.get( el.idv ) === el && ids.delete( el.idv )\n el.idv = value ?? undefined\n value && ids.set( value, el )\n // What labels or names it is read again, and it may be labelled now\n moved = true\n labels.has( value! ) && track( el )\n }\n emit( ATTR, el.id, name, value )\n }\n },\n styleVar( el, prop, value ){\n if( value === null ? !( prop in el.vars ) : el.vars[ prop ] === value ) return\n value === null ? delete el.vars[ prop ] : el.vars[ prop ] = value\n emit( STYLES, el.id, cssOf( el ) )\n },\n scope( el, nsp ){\n if( el.scope ) return\n el.scope = nsp\n emit( ATTR, el.id, 'class', classOf( el ) )\n },\n /** The element last focused, focused again once a swap has moved it (`Host.keepFocus`) */\n keepFocus(){\n const f = focused\n return () => { f?.real && f.at && ( f as any ).focus() }\n },\n /**\n * Modifiers (lips#36, `Host.listen`) become how the main thread binds:\n * `tap`, `tap.stop` (Lynx's catch), `tap.capture`, `tap.capture.stop`.\n * `.outside` is a capture listener on the PAGE, which has the event\n * before anything on the way can stop it, and runs the handler only\n * when the event's target is not inside the element.\n */\n listen( el, name, fn ){\n // An svg's parts are not elements: they have no events (LIPS-L108)\n if( el.part ) return () => {}\n const\n [ ev, ...m ] = name.split('.'),\n outside = m.includes('outside'),\n on = outside ? root : el,\n type = ( LYNX_EVENT[ ev ] || ev ) + ( outside || m.includes('capture') ? '.capture' : '' ) + ( !outside && m.includes('stop') ? '.stop' : '' ),\n f = outside ? ( e: any ) => { within( target, el ) || fn( e ) } : fn\n\n let byName = handlers.get( on.id )\n byName || handlers.set( on.id, byName = new Map() )\n\n let set = byName.get( type )\n if( !set ){\n byName.set( type, set = new Set() )\n emit( LISTEN, on.id, type )\n }\n set.add( f )\n\n return () => {\n if( !set!.delete( f ) || set!.size || !on.real ) return\n byName!.delete( type )\n emit( UNLISTEN, on.id, type )\n }\n }\n }\n\n const root = node( '#root', '', PAGE_ID, true )\n\n const within = ( n: LynxNode | null | undefined, el: LynxNode ) => {\n for( ; n; n = n.parent ) if( n === el ) return true\n return false\n }\n /** Inside a disabled button (lips#41) */\n const off = ( n: LynxNode | null | undefined ) => {\n for( ; n; n = n.parent ) if( n.aria?.disabled != null ) return true\n return false\n }\n\n return {\n host, root, flush,\n /**\n * The event arrives DOM-shaped already (`e.key`, `e.touches[0].clientX`,\n * `e.target.dataset`: `./main` picks it so). What an input reported\n * joins its target, as `e.target.value` reads on the DOM.\n */\n receive( wire ){\n if( 'call' in wire ){\n replies.get( wire.call )?.( wire )\n replies.delete( wire.call )\n return\n }\n const set = handlers.get( wire.id )?.get( wire.name ), event: any = wire.event, value = event.detail?.value\n\n // A tap inside a disabled button reaches no handler, as the DOM fires no click for it, there or above it\n if( event.type === 'tap' && off( live.get( wire.t! ) || live.get( wire.id ) ) ) return\n\n if( typeof value === 'string' ){\n typed.set( wire.id, value )\n event.target = { ...event.target, value }\n }\n target = live.get( wire.t! )\n wire.name === 'focus' ? focused = live.get( wire.id ) : wire.name === 'blur' && focused?.id === wire.id && ( focused = undefined )\n if( set ) for( const fn of [ ...set ] ) fn( event )\n }\n }\n}\n\n/**\n * `lynx` is a free identifier on purpose: Lynx's background runtime hands\n * it to the bundle's module wrapper as a parameter, and it is NOT on\n * `globalThis` there (Lynx for Web: `getCoreContext` of undefined).\n */\ndeclare const lynx: any\n\n/**\n * Wire a background host to the real thread bridge. On the background\n * thread `lynx.getCoreContext()` is the endpoint connected to the main\n * thread, both ways.\n */\nexport function connectBackground( words?: Words ): BackgroundHost {\n const main = lynx.getCoreContext()\n const bg = createBackgroundHost( ops => main.dispatchEvent({ type: OPS_EVENT, data: ops }), {\n words,\n // A native module: absent on Lynx for Web, and in apps that leave it out\n announce: content => lynx.accessibilityAnnounce?.({ content }, () => {})\n })\n\n main.addEventListener( DOM_EVENT, ( e: { data: WireEvent | WireReply } ) => bg.receive( e.data ) )\n return bg\n}\n"
8
+ "/**\n * The background-thread host (RFC-006 §4.2).\n *\n * The Lips runtime runs here, against a SHADOW tree: the runtime walks\n * siblings and resolves paths synchronously, and the real elements live\n * on the other thread. Every mutation that the main thread must mirror is\n * recorded as protocol ops (`./protocol`) and sent once per microtask.\n *\n * Only some shadow nodes are REAL — they exist on the main thread:\n *\n * - elements, and the page\n * - text, once it sits under a `text` element (Lynx renders raw text\n * nowhere else)\n *\n * Markers, fragments and stray text never cross. Insert positions skip\n * them, so the main thread sees exactly the real children, in order.\n *\n * An element node answers the DOM element's own methods (`focus`, `blur`,\n * `scrollTo`, `scrollIntoView`, `animate`), so a `@ref` means the same on\n * both: each is a UI method, run once the batch is flushed (lips#37).\n *\n * Nor do the parts of an `<svg>` (the elements the template pass stamped\n * `lips-svg`): Lynx draws an svg as one view from a markup string, so its\n * subtree is written into its `content`, once per flush when it changed.\n *\n * const lynxHost = createBackgroundHost( ops => send( ops ) )\n * renderIR( ir, setup, { host: lynxHost.host } ).mount( lynxHost.root )\n */\n\nimport type { BlockIR, NodeIR } from '../ir/compiler'\nimport type { Host } from '../ir/host'\nimport { treeHost, treeNode, link, unlink, type TreeNode } from '../ir/tree'\nimport { A11Y, IMPLICIT, LIVE, WORDS, lynxA11y, roleOf, type Aria, type Words } from './a11y'\nimport {\n CREATE, TEXT, INSERT, REMOVE, ATTR, SET_TEXT, STYLES, LISTEN, UNLISTEN, RELEASE, INVOKE,\n PAGE_ID, LYNX_TAG, LYNX_EVENT, OPS_EVENT, DOM_EVENT, SVG_PART, scopeClass, type WireEvent, type WireReply\n} from './protocol'\n\n/** Markup text: what an attribute value or a text run may not hold as is */\nconst esc = ( s: string ) => s.replace( /[&<>\"]/g, c => `&#${c.charCodeAt( 0 )};` )\n\n/** Where `focus()` is input focus; anywhere else it is accessibility focus (RFC-006 §9.9) */\nconst INPUTS = new Set([ 'input', 'textarea' ])\n\n/** `__ElementAnimate`'s operations, as Lynx's own `Animation` sends them */\nconst START = 0, PLAY = 1, PAUSE = 2, CANCEL = 3, FINISH = 4\n\n/** A DOM `animate` option: its duration alone, or the options Lynx's `animate` reads as they are */\ntype AnimateOptions = number | Record<string, unknown>\n\n/** An svg's own attributes that stay on its element rather than in its markup */\nconst ON_SVG = new Set([ 'class', 'style', 'id' ])\n\nexport interface LynxNode extends TreeNode {\n parent: LynxNode | null\n first: LynxNode | null\n last: LynxNode | null\n prev: LynxNode | null\n next: LynxNode | null\n /** Shared with the main thread; 0 for nodes that never cross */\n id: number\n /** Exists on the main thread */\n real: boolean\n /** The real parent the main thread has it under, if any */\n at: LynxNode | null\n /** `class` and `style` as written — merged with the scope class and variables */\n cls?: string\n css?: string\n /** Where its TEXT op's value sits in the unsent batch; the batch it was created in */\n slot?: number\n batch?: number\n /** Its ARIA (RFC-006 §4.8), the role its tag implies, its `id`, what was sent for them, what it last announced */\n aria?: Aria\n role?: string\n idv?: string\n sent?: Record<string, unknown>\n said?: string\n /** Each attribute as last written: an equal write is not sent again */\n wrote?: Record<string, string | null>\n /** What a `@ref` calls, as on the DOM element (lips#37) */\n focus(): void\n blur(): void\n scrollTo( x?: number | { top?: number, left?: number, behavior?: string }, y?: number ): void\n scrollIntoView( arg?: boolean | { behavior?: string, block?: string, inline?: string } ): void\n animate( keyframes: unknown, options?: AnimateOptions ): { id: string, play(): void, pause(): void, cancel(): void, finish(): void }\n /** Its box once laid out, or null when Lynx cannot measure it: a promise here, so `await` it on both hosts */\n getBoundingClientRect(): Promise<Rect | null>\n /** Part of an svg's markup: its SVG spelling. On an svg: the markup last sent */\n part?: string\n drawn?: string\n}\n\n/** A box as the DOM's `getBoundingClientRect()` gives it, in CSS pixels */\nexport interface Rect {\n x: number\n y: number\n width: number\n height: number\n top: number\n right: number\n bottom: number\n left: number\n}\n\nexport interface BackgroundOptions {\n /** Speak a live region's new text: `lynx.accessibilityAnnounce` on the real thread */\n announce?: ( text: string ) => void\n /** The spoken words for states and roles (`WORDS`), to translate them */\n words?: Words\n}\n\nexport interface BackgroundHost {\n host: Host<LynxNode>\n /** The page: mount the root instance here */\n root: LynxNode\n /** An element event forwarded by the main thread, or a UI method's result */\n receive( wire: WireEvent | WireReply ): void\n /** Send what is pending now instead of at the end of the microtask */\n flush(): void\n}\n\nexport function createBackgroundHost( send: ( ops: unknown[] ) => void, { announce, words = WORDS }: BackgroundOptions = {} ): BackgroundHost {\n let\n seq = PAGE_ID,\n ops: unknown[] = [],\n batch = 0,\n scheduled = false\n\n const handlers = new Map<number, Map<string, Set<( event: any ) => void>>>()\n /** The real nodes by id, and the one the event being dispatched happened on */\n const live = new Map<number, LynxNode>()\n let target: LynxNode | undefined\n /** The element last focused, as far as this thread can know: a ref's `focus()`, or a `focus` event a template listens for */\n let focused: LynxNode | undefined\n let animations = 0\n /** What each input last reported holding — the value it already shows */\n const typed = new Map<number, string>()\n\n /**\n * Accessibility (RFC-006 §4.8): the elements with ARIA, the elements by\n * `id` and by the `<label for>` them, and whether any text, structure\n * or ARIA changed since the last flush. A name reads all three, across\n * elements, so any change reads every element again; only what differs\n * from what was sent is sent.\n */\n const a11y = new Set<LynxNode>(), ids = new Map<string, LynxNode>(), labels = new Map<string, LynxNode>()\n let moved = false, rendered = false\n\n /** What an element's content reads as: its text, or the name a part has instead */\n const read = ( n: LynxNode ): string => {\n let s = n.type === '#text' ? n.value : ''\n for( let c = n.first; c; c = c.next ) s += ' ' + name( c )\n return s.replace( /\\s+/g, ' ' ).trim()\n }\n const name = ( n: LynxNode ) => n.aria?.[ 'aria-hidden' ] === 'true' ? '' : n.aria?.[ 'aria-label' ] || n.aria?.alt || read( n )\n const refs = ( list: string ) => list.trim().split( /\\s+/ ).map( id => ids.get( id ) ).filter( Boolean ).map( n => name( n! ) ).join(' ')\n\n /** Send what each element's ARIA now comes to, and announce what live regions now say */\n const derive = () => {\n const said: string[] = []\n for( const n of a11y ){\n const a = n.aria || {}, role = roleOf( a, n.role ), label = n.idv && labels.get( n.idv )\n const out = lynxA11y( a, role, n.type === 'text', refs, () => read( n ), label ? read( label ) : '', words )\n const sent = n.sent ||= {}\n for( const k of new Set([ ...Object.keys( out ), ...Object.keys( sent ) ]) )\n out[ k ] !== sent[ k ] && emit( ATTR, n.id, k, ( sent[ k ] = out[ k ] ) ?? null )\n\n // A region announces its changes; an alert also its arrival, after the first render\n const live = a[ 'aria-live' ] ?? LIVE[ role ]\n if( live && live !== 'off' ){\n const text = read( n )\n text && text !== n.said && ( n.said !== undefined || live === 'assertive' && rendered ) && said.push( text )\n n.said = text\n }\n }\n moved = false\n return said\n }\n const track = ( n: LynxNode ) => {\n a11y.add( n )\n moved = true\n schedule()\n }\n\n /** The svgs whose markup may have changed since the last flush */\n const drawn = new Set<LynxNode>()\n\n /** The svg a node is drawn in: up through the parts, to the svg element */\n const svgOf = ( n: LynxNode | null ) => {\n while( n?.part ) n = n.parent\n return n?.type === 'svg' ? n : undefined\n }\n const draw = ( n: LynxNode | null ) => {\n const svg = svgOf( n )\n if( !svg ) return\n drawn.add( svg )\n schedule()\n }\n const markup = ( n: LynxNode ): string => {\n if( n.type === '#text' ) return esc( n.value )\n let inner = ''\n for( let c = n.first; c; c = c.next ) inner += markup( c )\n if( n.type[ 0 ] === '#' ) return inner\n\n const tag = n.part || n.type\n let attrs = ''\n for( const k in n.attrs ) k === SVG_PART || ( attrs += ` ${k}=\"${esc( n.attrs[ k ] )}\"` )\n return `<${tag}${attrs}>${inner}</${tag}>`\n }\n\n const flush = () => {\n for( const svg of drawn ){\n const m = svg.real ? markup( svg ) : svg.drawn\n m !== svg.drawn && emit( ATTR, svg.id, 'content', svg.drawn = m )\n }\n drawn.clear()\n\n const said = moved ? derive() : []\n scheduled = false\n rendered = true\n if( !ops.length ) return\n const out = ops\n ops = []\n batch++\n send( out )\n announce && said.forEach( announce )\n }\n const schedule = () => {\n if( scheduled ) return\n scheduled = true\n // A promise job, not queueMicrotask: every Lynx background engine has one\n Promise.resolve().then( flush )\n }\n const emit = ( ...args: unknown[] ) => {\n ops.push( ...args )\n schedule()\n }\n\n /** A UI method on a real element, run once the batch is flushed (`./main`) */\n const invoke = ( n: LynxNode, method: string, params: unknown = {}, call = 0 ) => { n.real && emit( INVOKE, n.id, method, params, call ) }\n /** What waits for a UI method's result, by its call */\n const replies = new Map<number, ( r: WireReply ) => void>()\n let calls = 0\n\n /**\n * The DOM element's methods, by its names and its arguments, as Lynx's\n * UI methods take them (lynxjs.org: `<input>`, `<view>`, `<scroll-view>`,\n * `animate`). A method a ref holds on the DOM holds the same here.\n */\n const UI = {\n focus( this: LynxNode ){\n focused = this\n invoke( this, INPUTS.has( this.type ) ? 'focus' : 'requestAccessibilityFocus' )\n },\n blur( this: LynxNode ){\n focused === this && ( focused = undefined )\n invoke( this, 'blur' )\n },\n /** `( x, y )` or `{ top, left, behavior }`: a scroll-view scrolls along one axis, to one offset */\n scrollTo( this: LynxNode, x?: number | { top?: number, left?: number, behavior?: string }, y?: number ){\n const o = typeof x === 'object' ? x : { left: x, top: y }\n invoke( this, 'scrollTo', { offset: o.top || o.left || 0, smooth: o.behavior === 'smooth' })\n },\n /** Lynx asks for every option explicitly: the DOM's defaults are written out */\n scrollIntoView( this: LynxNode, arg?: boolean | { behavior?: string, block?: string, inline?: string } ){\n const o = typeof arg === 'object' ? arg : { block: arg === false ? 'end' : 'start' }\n invoke( this, 'scrollIntoView', { scrollIntoViewOptions: { behavior: o.behavior === 'smooth' ? 'smooth' : 'auto', block: o.block || 'start', inline: o.inline || 'start' } })\n },\n animate( this: LynxNode, keyframes: unknown, options: AnimateOptions = {} ){\n const id = `lips-${this.id}-${++animations}`, to = ( op: number ) => () => invoke( this, 'animate', [ op, id ] )\n invoke( this, 'animate', [ START, id, keyframes, typeof options === 'number' ? { duration: options } : options ] )\n return { id, play: to( PLAY ), pause: to( PAUSE ), cancel: to( CANCEL ), finish: to( FINISH ) }\n },\n /**\n * Lynx's `boundingClientRect` UI method, run once the batch is flushed\n * and answered once laid out (Android waits for layout), relative to\n * the LynxView as the DOM's is to the viewport. A box with only layout\n * styles gets no native view, and Lynx answers it NO_UI_FOR_NODE; any\n * attribute gives it one (`MarkHasLayoutOnlyPropsIfNecessary`), so a\n * measured box carries `lips-rect`. Null when it cannot be measured.\n */\n getBoundingClientRect( this: LynxNode ){\n return new Promise<Rect | null>( resolve => {\n if( !this.real ) return resolve( null )\n host.attr( this, 'lips-rect', '' )\n replies.set( ++calls, ( { code, data: d }: any ) => resolve( code || !d ? null\n : { x: d.left, y: d.top, width: d.width, height: d.height, top: d.top, right: d.right, bottom: d.bottom, left: d.left }) )\n invoke( this, 'boundingClientRect', {}, calls )\n })\n }\n }\n\n const node = ( type: string, value = '', id = 0, real = false ): LynxNode =>\n Object.assign( Object.create( UI ), treeNode( type, value ), { id, real, at: null } ) as LynxNode\n\n const classOf = ( n: LynxNode ) =>\n [ n.cls, n.scope && scopeClass( n.scope ) ].filter( Boolean ).join(' ')\n\n /**\n * An svg's `width` and `height` size its drawing AND its element, as on\n * the DOM. Lynx sizes the element by its style alone (tier B: an svg\n * with only the attributes lays out 0 high), so they go first in its\n * inline style, and the template's own `style` overrides them.\n */\n const SIZE = [ 'width', 'height' ]\n const sizeOf = ( n: LynxNode ) => n.type === 'svg'\n ? SIZE.filter( k => n.attrs[ k ] ).map( k => `${k}: ${n.attrs[ k ]}${/^[\\d.]+$/.test( n.attrs[ k ] ) ? 'px' : ''}` ).join('; ')\n : ''\n\n const cssOf = ( n: LynxNode ) =>\n [ sizeOf( n ), n.css, ...Object.entries( n.vars ).map( ( [ k, v ] ) => `${k}: ${v}` ) ].filter( Boolean ).join('; ')\n\n /** Every real id in a subtree — what the main thread can forget */\n const release = ( n: LynxNode ) => {\n for( let c = n.first; c; c = c.next ) release( c )\n if( !n.real ) return\n handlers.delete( n.id )\n live.delete( n.id )\n typed.delete( n.id )\n a11y.delete( n )\n n.idv && ids.get( n.idv ) === n && ids.delete( n.idv )\n n.aria?.for && labels.get( n.aria.for ) === n && labels.delete( n.aria.for )\n emit( RELEASE, n.id )\n n.real = false\n }\n\n const host: Host<LynxNode> = {\n ...( treeHost as unknown as Host<LynxNode> ),\n\n clone( block: BlockIR ){\n if( !block.nodes )\n throw new Error(`[lips] this IR has no node tree: compile it with { target: 'tree' } to render on Lynx`)\n\n const build = ( n: NodeIR ): LynxNode => {\n if( typeof n === 'string' ) return host.text( n )\n if( n === 0 ) return host.marker('$')\n\n const [ tag, attrs, children ] = n\n const el = attrs?.[ SVG_PART ] ? Object.assign( node( tag ), { part: attrs[ SVG_PART ] }) : host.element( tag )\n if( attrs ) for( const k in attrs ) host.attr( el, k, attrs[ k ] )\n children?.forEach( c => host.insert( el, build( c ), null ) )\n return el\n }\n\n const frag = host.fragment()\n for( const n of block.nodes ) host.insert( frag, build( n ), null )\n return frag\n },\n fragment: () => node('#fragment'),\n element( tag ){\n const el = node( LYNX_TAG[ tag ] || tag, '', ++seq, true )\n live.set( el.id, el )\n emit( CREATE, el.id, el.type )\n el.batch = batch\n if( IMPLICIT[ tag ] ){\n el.role = IMPLICIT[ tag ]\n track( el )\n }\n return el\n },\n text: value => node( '#text', value, ++seq ),\n marker: label => node( '#marker', label ),\n\n insert( parent, n, ref ){\n link( parent, n, ref )\n draw( parent )\n\n // Text becomes real the first time it lands where Lynx renders text\n moved = true\n if( n.type === '#text' && !n.real && parent.type === 'text' && !parent.part ){\n n.real = true\n live.set( n.id, n )\n emit( TEXT, n.id, n.value )\n n.slot = ops.length - 1\n n.batch = batch\n }\n if( !n.real ) return\n\n n.at && emit( REMOVE, n.at.id, n.id )\n n.at = null\n if( !parent.real ) return\n\n let r = n.next\n while( r && !r.real ) r = r.next\n emit( INSERT, parent.id, n.id, r ? r.id : 0 )\n n.at = parent\n },\n insertAfter( ref, nodes ){\n const parent = ref.parent\n if( !parent ) return\n let anchor = ref\n for( const n of nodes ){\n host.insert( parent, n, anchor.next )\n anchor = n\n }\n },\n remove( n, gone ){\n moved = true\n draw( n.parent )\n unlink( n )\n n.at && emit( REMOVE, n.at.id, n.id )\n n.at = null\n gone && release( n )\n },\n\n /**\n * A text bind creates its node empty and fills it in the same pass.\n * While the TEXT op is still unsent, the value goes into it — one op\n * per text instead of two, which on a 1k-row list is 2k fewer. Text\n * equal to what the node holds is not sent at all.\n */\n setText( n, value ){\n if( n.value === value ) return\n n.value = value\n moved = true\n if( !n.real ) return draw( n.parent )\n n.batch === batch\n ? ops[ n.slot! ] = value\n : emit( SET_TEXT, n.id, value )\n },\n /** `@text` and `@format`: in a text of its own when the element is not one */\n content( el, value ){\n while( el.first ) host.remove( el.first, true )\n if( !value ) return\n const t = el.type === 'text' ? el : host.element('text')\n t === el || host.insert( el, t, null )\n host.insert( t, host.text( value ), null )\n },\n /**\n * An equal write is dropped here, the one place that sees them all. A\n * replaced `<for>` array re-runs every kept row's binds (`touch()` on\n * the same object, `set` on a new one), and without this each one\n * crossed again: 100 rows' text where 11 changed (lips#39, L4).\n */\n attr( el, name, value ){\n const w = el.wrote ||= {}\n if( name in w && w[ name ] === value ) return\n w[ name ] = value\n // In an svg's markup: kept for it, not sent (the svg's class, style, id, data-* and ARIA stay on its element)\n if( el.part || el.type === 'svg' && !ON_SVG.has( name ) && !name.startsWith('data-') && !A11Y.has( name ) ){\n value === null ? delete el.attrs[ name ] : el.attrs[ name ] = value\n draw( el )\n el.part || !SIZE.includes( name ) || emit( STYLES, el.id, cssOf( el ) )\n }\n else if( name === 'class' ){\n el.cls = value ?? undefined\n emit( ATTR, el.id, 'class', classOf( el ) )\n }\n else if( name === 'style' ){\n el.css = value ?? undefined\n emit( STYLES, el.id, cssOf( el ) )\n }\n /**\n * Lynx inputs are uncontrolled: the attribute sets the first value\n * only, `setValue` every one after (RFC-006 §4.5). A value the input\n * itself reported is already on screen — writing it back would race\n * the user's next keystroke — so it is not sent.\n */\n else if( name === 'value' && ( el.type === 'input' || el.type === 'textarea' ) && el.batch !== batch ){\n // Through `invoke`, as every UI method: an INVOKE is four values, and one short reads every op after it wrong\n value !== typed.get( el.id ) && invoke( el, 'setValue', { value: value ?? '' })\n }\n /**\n * ARIA is read here, not sent: Lynx has its own attributes (`./a11y`).\n * So is `disabled` on a button: Lynx has no disabled view and does\n * not block its tap (lips#41). It is sent as `aria-disabled` is, and\n * `receive` drops the taps inside it.\n */\n else if( A11Y.has( name ) || name === 'disabled' && el.role === 'button' ){\n const a = el.aria ||= {}\n if( name === 'for' ){\n a.for && labels.get( a.for ) === el && labels.delete( a.for )\n value && labels.set( value, el )\n // The labelled element is read again, wherever it is\n const target = value && ids.get( value )\n target && track( target )\n }\n value === null ? delete a[ name ] : a[ name ] = value\n track( el )\n }\n else {\n if( name === 'id' ){\n el.idv && ids.get( el.idv ) === el && ids.delete( el.idv )\n el.idv = value ?? undefined\n value && ids.set( value, el )\n // What labels or names it is read again, and it may be labelled now\n moved = true\n labels.has( value! ) && track( el )\n }\n emit( ATTR, el.id, name, value )\n }\n },\n styleVar( el, prop, value ){\n if( value === null ? !( prop in el.vars ) : el.vars[ prop ] === value ) return\n value === null ? delete el.vars[ prop ] : el.vars[ prop ] = value\n emit( STYLES, el.id, cssOf( el ) )\n },\n scope( el, nsp ){\n if( el.scope ) return\n el.scope = nsp\n emit( ATTR, el.id, 'class', classOf( el ) )\n },\n /** The element last focused, focused again once a swap has moved it (`Host.keepFocus`) */\n keepFocus(){\n const f = focused\n return () => { f?.real && f.at && ( f as any ).focus() }\n },\n /**\n * Modifiers (lips#36, `Host.listen`) become how the main thread binds:\n * `tap`, `tap.stop` (Lynx's catch), `tap.capture`, `tap.capture.stop`.\n * `.outside` is a capture listener on the PAGE, which has the event\n * before anything on the way can stop it, and runs the handler only\n * when the event's target is not inside the element.\n */\n listen( el, name, fn ){\n // An svg's parts are not elements: they have no events (LIPS-L108)\n if( el.part ) return () => {}\n const\n [ ev, ...m ] = name.split('.'),\n outside = m.includes('outside'),\n on = outside ? root : el,\n type = ( LYNX_EVENT[ ev ] || ev ) + ( outside || m.includes('capture') ? '.capture' : '' ) + ( !outside && m.includes('stop') ? '.stop' : '' ),\n f = outside ? ( e: any ) => { within( target, el ) || fn( e ) } : fn\n\n let byName = handlers.get( on.id )\n byName || handlers.set( on.id, byName = new Map() )\n\n let set = byName.get( type )\n if( !set ){\n byName.set( type, set = new Set() )\n emit( LISTEN, on.id, type )\n }\n set.add( f )\n\n return () => {\n if( !set!.delete( f ) || set!.size || !on.real ) return\n byName!.delete( type )\n emit( UNLISTEN, on.id, type )\n }\n }\n }\n\n const root = node( '#root', '', PAGE_ID, true )\n\n const within = ( n: LynxNode | null | undefined, el: LynxNode ) => {\n for( ; n; n = n.parent ) if( n === el ) return true\n return false\n }\n /** Inside a disabled button (lips#41) */\n const off = ( n: LynxNode | null | undefined ) => {\n for( ; n; n = n.parent ) if( n.aria?.disabled != null ) return true\n return false\n }\n\n return {\n host, root, flush,\n /**\n * The event arrives DOM-shaped already (`e.key`, `e.touches[0].clientX`,\n * `e.target.dataset`: `./main` picks it so). What an input reported\n * joins its target, as `e.target.value` reads on the DOM.\n */\n receive( wire ){\n if( 'call' in wire ){\n replies.get( wire.call )?.( wire )\n replies.delete( wire.call )\n return\n }\n const set = handlers.get( wire.id )?.get( wire.name ), event: any = wire.event, value = event.detail?.value\n\n // A tap inside a disabled button reaches no handler, as the DOM fires no click for it, there or above it\n if( event.type === 'tap' && off( live.get( wire.t! ) || live.get( wire.id ) ) ) return\n\n if( typeof value === 'string' ){\n typed.set( wire.id, value )\n event.target = { ...event.target, value }\n }\n target = live.get( wire.t! )\n wire.name === 'focus' ? focused = live.get( wire.id ) : wire.name === 'blur' && focused?.id === wire.id && ( focused = undefined )\n if( set ) for( const fn of [ ...set ] ) fn( event )\n }\n }\n}\n\n/**\n * `lynx` is a free identifier on purpose: Lynx's background runtime hands\n * it to the bundle's module wrapper as a parameter, and it is NOT on\n * `globalThis` there (Lynx for Web: `getCoreContext` of undefined).\n */\ndeclare const lynx: any\n\n/**\n * Wire a background host to the real thread bridge. On the background\n * thread `lynx.getCoreContext()` is the endpoint connected to the main\n * thread, both ways.\n */\nexport function connectBackground( words?: Words ): BackgroundHost {\n const main = lynx.getCoreContext()\n const bg = createBackgroundHost( ops => main.dispatchEvent({ type: OPS_EVENT, data: ops }), {\n words,\n // A native module: absent on Lynx for Web, and in apps that leave it out\n announce: content => lynx.accessibilityAnnounce?.({ content }, ()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