@lipsjs/lips 0.3.1 → 0.4.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.
- package/README.md +122 -9
- package/dist/lips.js +915 -669
- package/dist/lips.js.map +15 -12
- package/dist/lips.min.js +12 -12
- package/dist/lips.min.js.map +15 -12
- package/dist/lynx-background.min.js +3 -0
- package/dist/lynx-background.min.js.map +13 -0
- package/dist/lynx-main.min.js +3 -0
- package/dist/lynx-main.min.js.map +11 -0
- package/dist/lynx-plugin.mjs +1487 -0
- package/dist/lynx.min.js +8 -8
- package/dist/lynx.min.js.map +11 -10
- package/dist/mf2.min.js.map +1 -1
- package/dist/parts.min.js +19 -0
- package/dist/parts.min.js.map +11 -0
- package/dist/precompile.min.js +15 -15
- package/dist/precompile.min.js.map +8 -7
- package/dist/runtime.min.js +4 -4
- package/dist/runtime.min.js.map +11 -9
- package/dist/stylis.min.js.map +1 -1
- package/dist/types/component.d.ts +32 -0
- package/dist/types/ir/compiler.d.ts +2 -4
- package/dist/types/ir/facade.d.ts +63 -12
- package/dist/types/ir/host.d.ts +9 -1
- package/dist/types/ir/initial.d.ts +16 -0
- package/dist/types/ir/router.d.ts +2 -0
- package/dist/types/ir/tags.d.ts +16 -0
- package/dist/types/lips.d.ts +7 -7
- package/dist/types/lynx/a11y.d.ts +1 -0
- package/dist/types/lynx/background.d.ts +52 -3
- package/dist/types/lynx/main.d.ts +9 -5
- package/dist/types/lynx/plugin.d.ts +8 -0
- package/dist/types/lynx/protocol.d.ts +55 -4
- package/dist/types/lynx/style.d.ts +7 -0
- package/dist/types/lynx/template.d.ts +6 -0
- package/dist/types/parts/menu.d.ts +44 -0
- package/dist/types/parts/popover.d.ts +83 -0
- package/dist/types/parts.d.ts +16 -0
- package/dist/types/precompile.d.ts +8 -11
- package/dist/types/runtime.d.ts +1 -0
- package/dist/types/types.d.ts +181 -57
- package/dist/untrusted.min.js +4 -4
- package/dist/untrusted.min.js.map +7 -7
- package/package.json +24 -3
- package/dist/types/i18n/formatters.d.ts +0 -3
|
@@ -0,0 +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};
|
|
2
|
+
|
|
3
|
+
//# debugId=21CED0DF1ADA542A64756E2164756E21
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/ir/tree.ts", "../src/lynx/a11y.ts", "../src/lynx/protocol.ts", "../src/lynx/background.ts"],
|
|
4
|
+
"sourcesContent": [
|
|
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
|
+
"/**\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
|
+
"/**\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"
|
|
9
|
+
],
|
|
10
|
+
"mappings": "AA0CO,IAAM,EAAW,CAAE,EAAc,EAAQ,MAAmB,CACjE,OAAM,QACN,MAAO,CAAC,EAAG,KAAM,CAAC,EAAG,UAAW,CAAC,EACjC,OAAQ,KAAM,MAAO,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,IAC3D,GAEM,GAAY,CAAE,IAAiB,EAAE,KAAM,KAAQ,IAE9C,SAAS,CAAM,CAAE,EAAa,CACnC,IAAM,EAAI,EAAE,OACZ,GAAI,CAAC,EAAI,OAET,EAAE,KAAO,EAAE,KAAK,KAAO,EAAE,KAAO,EAAE,MAAQ,EAAE,KAC5C,EAAE,KAAO,EAAE,KAAK,KAAO,EAAE,KAAO,EAAE,KAAO,EAAE,KAC3C,EAAE,OAAS,EAAE,KAAO,EAAE,KAAO,KAIxB,SAAS,CAAI,CAAE,EAAkB,EAAa,EAAsB,CAIzE,GAHA,EAAQ,CAAE,EACV,EAAE,OAAS,EAEP,EACF,EAAE,KAAO,EAAI,KACb,EAAE,KAAO,EACT,EAAI,KAAO,EAAI,KAAK,KAAO,EAAI,EAAO,MAAQ,EAC9C,EAAI,KAAO,EAEb,KACE,EAAE,KAAO,EAAO,KAChB,EAAO,KAAO,EAAO,KAAK,KAAO,EAAI,EAAO,MAAQ,EACpD,EAAO,KAAO,EAIlB,S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K,EAAK,IAAK,EAAK,CAAG,GAAK,EAAK,IAAK,EAAK,EAAG,CAAE,EAAI,OAEhF,GAAI,OAAO,IAAU,SACnB,EAAM,IAAK,EAAK,GAAI,CAAM,EAC1B,EAAM,OAAS,IAAK,EAAM,OAAQ,OAAM,EAI1C,GAFA,EAAS,EAAK,IAAK,EAAK,CAAG,EAC3B,EAAK,OAAS,QAAU,EAAU,EAAK,IAAK,EAAK,EAAG,EAAI,EAAK,OAAS,QAAU,GAAS,KAAO,EAAK,KAAQ,EAAU,QACnH,EAAM,QAAW,IAAM,CAAE,GAAG,CAAI,EAAI,EAAI,CAAM,EAEtD,EAeK,SAAS,EAAiB,CAAE,EAAgC,CACjE,IAAM,EAAO,KAAK,eAAe,EAC3B,EAAK,GAAsB,KAAO,EAAK,cAAc,CAAE,KAAM,GAAW,KAAM,CAAI,CAAC,EAAG,CAC1F,QAEA,SAAU,KAAW,KAAK,wBAAwB,CAAE,SAAQ,EAAG,IAAM,EAAE,CACzE,CAAC,EAGD,OADA,EAAK,iBAAkB,GAAW,CAAE,IAAwC,EAAG,QAAS,EAAE,IAAK,CAAE,EAC1F",
|
|
11
|
+
"debugId": "21CED0DF1ADA542A64756E2164756E21",
|
|
12
|
+
"names": []
|
|
13
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
var S=0,A=1,L=2,C=3,N=4,O=5,M=6,D=7,V=8,P=9,W=10,K=[2,2,3,2,3,2,2,2,2,1,4],w=1,Y="lips:ops",j="lips:event",Q=["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"],Z=["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"],ge=Object.fromEntries([...Q.map((e)=>[e,"view"]),...Z.map((e)=>[e,"text"]),["img","image"]]);var X=()=>{},ee=(e)=>{let o=e.includes(".capture"),s=e.includes(".stop");return{capture:o,closure_type:2,bind_type:o?s?3:2:s?4:1}},te=new Set(["value","placeholder"]),R=(e)=>e!==null&&e!=="false",k=(e)=>e===null||e===""||isNaN(+e)?void 0:+e,U={"full-span":R,"sticky-top":R,"sticky-bottom":R,"estimated-height-px":k,"estimated-main-axis-size-px":k},ne=/-(count|offset|index|throttle|level|strategy)$|^layout-id$/,ie=/^(sticky$|bounces$|enable-|needs?-|should-|experimental-(?!.*strategy$)|scroll-bar-enable$|harmony-)/,re=(e,o)=>ie.test(e)?R(o):ne.test(e)?k(o)??o:o,oe=/^(visible|events-pass-through|event-through|ignore-focus|user-interaction-enabled|native-interaction-enabled|block-native-event|block-list-event|skip-redirection|enable-exposure-ui-clip|accessibility-(element|elements-hidden|exclusive-focus))$/,se=(e)=>e===""||/^(true|yes)$/i.test(e);function ae(e){let o=[],s=[];for(let d=0;d<e.length;d++){let b=0,m=o.length;while(b<m){let E=b+m>>1;e[o[E]]<e[d]?b=E+1:m=E}s[d]=b?o[b-1]:-1,o[b]=d}let r=new Set;for(let d=o.length?o[o.length-1]:-1;d>=0;d=s[d])r.add(d);return r}var le=(e)=>e.slice(5).replace(/-([a-z])/g,(o,s)=>s.toUpperCase()),G=["key","repeat","altKey","ctrlKey","metaKey","shiftKey"],ce=["identifier","x","y","pageX","pageY","clientX","clientY"],v=(e,o,s={})=>{if(e&&typeof e==="object")for(let r of o)r in e&&(s[r]=e[r]);return s},q=(e)=>Array.from(e||[],(o)=>v(o,ce)),F=(e)=>e&&{id:e.id,dataset:{...e.dataset}},de=(e,o)=>{let s=v(e,G,v(e?.detail,G,{type:e?.type??o,detail:e?.detail}));if(e?.touches)s.touches=q(e.touches),s.changedTouches=q(e.changedTouches);return s.target=F(e?.target),s.currentTarget=F(e?.currentTarget),s};function ue(e,o){let s=__GetElementUniqueID(e),r=new Map([[w,e]]),d=new Map,b=new Map([[s,w]]),m=new Map,E=new Map,y=new Map,I=[],B=(_)=>{let n={order:[],shown:[],attached:new Set,gone:[],hinted:new Set};return m.set(_,n),__CreateList(s,(f,l,t,i)=>{let c=r.get(n.shown[t]),h=__GetElementUniqueID(c);return n.attached.add(n.shown[t]),__AppendElement(f,c),__FlushElementTree(c,{triggerLayout:!0,operationID:i,elementID:h,listID:l}),h},X)},z=(_,n)=>n==="view"?__CreateView(s):n==="text"?__CreateText(s):n==="image"?__CreateImage(s):n==="scroll-view"?__CreateScrollView(s):n==="list"?B(_):__CreateElement(n,s),H=(_,n,f)=>{if(n==="class")__SetClasses(_,f||void 0);else if(n==="id")__SetID(_,f);else if(n.startsWith("data-"))__AddDataset(_,le(n),f??void 0);else __SetAttribute(_,n,f===""&&!te.has(n)||f)},J=(_,n)=>{let f=n.order.slice(),l=new Map(f.map((a,g)=>[a,g])),t=n.shown.filter((a)=>l.has(a)),i=new Set([...ae(t.map((a)=>l.get(a)))].map((a)=>t[a])),c=[],h=[],p=[];n.shown.forEach((a,g)=>i.has(a)||c.push(g)),f.forEach((a,g)=>i.has(a)?n.hinted.has(a)&&p.push({from:g,to:g,flush:!1,type:"default","item-key":String(a),...E.get(a)}):h.push({position:g,type:"default","item-key":String(a),...E.get(a)})),n.shown=f,n.hinted.clear();let u=r.get(_);__SetAttribute(u,"update-list-info",{insertAction:h,removeAction:c,updateAction:p});for(let[a,g]of n.gone)l.has(a)||n.attached.delete(a)&&__RemoveElement(u,g);n.gone=[]};return function(n){let f=new Set;for(let l=0;l<n.length;l+=K[n[l]]+1){let t=n[l+1],i=n[l+2],c=n[l+3],h=n[l+4],p;switch(n[l]){case S:case A:{let u=n[l]===S?z(t,i):__CreateRawText(i);r.set(t,u),b.set(__GetElementUniqueID(u),t);break}case L:if(p=m.get(t)){y.set(i,t);let u=p.order.indexOf(c);p.order.splice(u<0?p.order.length:u,0,i),f.add(t)}else c?__InsertElementBefore(r.get(t),r.get(i),r.get(c)):__AppendElement(r.get(t),r.get(i));break;case C:if(p=m.get(t))y.delete(i),p.order.splice(p.order.indexOf(i),1),p.gone.push([i,r.get(i)]),f.add(t);else __RemoveElement(r.get(t),r.get(i));break;case N:if(H(r.get(t),i,typeof c!=="string"?c:oe.test(i)?se(c):m.has(t)?re(i,c):c),i in U){let u=E.get(t)||{},a=y.get(t),g=U[i](c);if(u[i]===g)break;if(u[i]=g,E.set(t,u),a!==void 0&&(p=m.get(a)))p.hinted.add(t),f.add(a)}break;case O:__SetAttribute(r.get(t),"text",i);break;case M:__SetInlineStyles(r.get(t),i);break;case D:{let u=i.split(".")[0],a=ee(i),g=(x)=>o({id:t,name:i,t:b.get(x?.target?.uid),event:de(x,u)}),T=d.get(t);T||d.set(t,T=new Map),T.set(i,[g,a]),__AddEventListener(r.get(t),u,g,a);break}case V:{let u=d.get(t)?.get(i);if(u)__RemoveEventListener(r.get(t),i.split(".")[0],...u),d.get(t).delete(i);break}case P:b.delete(__GetElementUniqueID(r.get(t))),r.delete(t),d.delete(t),m.delete(t),E.delete(t),y.delete(t);break;case W:I.push([r.get(t),i,c,h]);break;default:throw Error(`[lips] unknown op ${n[l]} at ${l}`)}}for(let l of f)m.has(l)&&J(l,m.get(l));__FlushElementTree();for(let[l,t,i,c]of I.splice(0))t==="animate"?__ElementAnimate(l,i):__InvokeUIMethod(l,t,i,c?(h)=>o({call:c,code:h.code,data:h.data}):X)}}var fe={processData:(e)=>e,renderPage(){},updatePage(){}};function _e(e){for(let[r,d]of Object.entries(fe))typeof globalThis[r]==="function"||(globalThis[r]=d);let o=lynx.getJSContext(),s=ue(e,(r)=>o.dispatchEvent({type:j,data:r}));return o.addEventListener(Y,(r)=>s(r.data)),s}export{_e as connectMain,ue as createApplier};
|
|
2
|
+
|
|
3
|
+
//# debugId=1D0686C66288900864756E2164756E21
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/lynx/protocol.ts", "../src/lynx/main.ts"],
|
|
4
|
+
"sourcesContent": [
|
|
5
|
+
"/**\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",
|
|
6
|
+
"/**\n * The main-thread applier (RFC-006 §4.2).\n *\n * Small on purpose: it owns no Lips logic. It receives the background\n * thread's op batches (`./protocol`), applies them through Element PAPI,\n * flushes once per batch, and forwards element events back as data.\n *\n * Only the public, documented API is used (RFC-006 §5): creation,\n * `__InsertElementBefore` / `__AppendElement` / `__RemoveElement`,\n * `__SetAttribute` / `__SetClasses` / `__SetID` / `__AddDataset`,\n * `__SetInlineStyles`, `__AddEventListener` / `__RemoveEventListener`,\n * `__CreateList` with `update-list-info`, `__InvokeUIMethod`,\n * `__ElementAnimate` and `__FlushElementTree`.\n */\n\nimport {\n CREATE, TEXT, INSERT, REMOVE, ATTR, SET_TEXT, STYLES, LISTEN, UNLISTEN, RELEASE, INVOKE,\n ARITY, PAGE_ID, OPS_EVENT, DOM_EVENT, type WireEvent, type WireReply\n} from './protocol'\n\n/** An Element PAPI handle — opaque, never read or sent */\ntype Ref = object\n\ndeclare global {\n function __GetElementUniqueID( el: Ref ): number\n function __CreateView( pageId: number ): Ref\n function __CreateText( pageId: number ): Ref\n function __CreateImage( pageId: number ): Ref\n function __CreateScrollView( pageId: number ): Ref\n function __CreateElement( tag: string, pageId: number ): Ref\n function __CreateList(\n pageId: number,\n componentAtIndex: ( list: Ref, listId: number, index: number, opId: number ) => number,\n enqueueComponent: ( list: Ref, listId: number, uid: number ) => void\n ): Ref\n function __CreateRawText( text: string ): Ref\n function __AppendElement( parent: Ref, child: Ref ): void\n function __InsertElementBefore( parent: Ref, child: Ref, ref?: Ref ): void\n function __RemoveElement( parent: Ref, child: Ref ): void\n function __SetAttribute( el: Ref, name: string, value: unknown ): void\n function __SetClasses( el: Ref, classes: string | undefined ): void\n function __SetID( el: Ref, id: string | null ): void\n function __AddDataset( el: Ref, key: string, value: unknown ): void\n function __SetInlineStyles( el: Ref, styles: unknown ): void\n function __AddEventListener( el: Ref, name: string, fn: ( e: any ) => void, options: object ): void\n function __RemoveEventListener( el: Ref, name: string, fn: ( e: any ) => void, options: object ): void\n function __InvokeUIMethod( el: Ref, method: string, params: object, callback: ( result: { code: number, data?: unknown } ) => void ): void\n function __ElementAnimate( el: Ref, args: unknown[] ): void\n function __FlushElementTree( el?: Ref, options?: object ): void\n}\n\n/** A free identifier, as on the background thread — see `./background` */\ndeclare const lynx: any\n\nconst NOOP = () => {}\n\n/**\n * How a listener is bound (lips#36): a `LISTEN` name carries `.capture`\n * and `.stop`, as the background spells them. Lynx decides propagation\n * where a listener is declared, by its `bind_type` (`ElementEventBindType`:\n * bubble 1, capture 2, capture-catch 3, bubble-catch 4), and reads it for\n * a `closure_type` of CORE (2): a main-thread function, as `main-thread:bind`\n * binds one, which is what the applier's listeners are. Both engines read\n * it so (native `FiberAddEventListener`, Lynx for Web `eventTypeOf`). A\n * plain callback's options would not do: native reads no catch from them,\n * and Lynx 4.1's touch path ignores `__StopPropagation` (tier B).\n */\nconst bindOf = ( name: string ) => {\n const capture = name.includes('.capture'), stop = name.includes('.stop')\n return { capture, closure_type: 2, bind_type: capture ? stop ? 3 : 2 : stop ? 4 : 1 }\n}\n\n/**\n * Lynx reads an empty attribute as false (`scroll-y=\"\"` does not scroll),\n * where HTML reads a present attribute as true. These two are text that\n * may well be empty.\n */\nconst EMPTY_IS_TEXT = new Set([ 'value', 'placeholder' ])\n\n/**\n * A cell's layout hints (lips#43): attributes of a `list-item` that Lynx's\n * list reads from the insert and update actions it is told, not from the\n * cell, and only as JSON: a flag is a boolean, a size a number\n * (`AdapterHelper::UpdateFiberInsertAction`). A flag is set when present,\n * as in HTML, unless `\"false\"`. Lynx for Web reads the attributes, so\n * they are still set on the cell too.\n */\nconst flag = ( v: string | null ) => v !== null && v !== 'false'\nconst size = ( v: string | null ) => v === null || v === '' || isNaN( +v ) ? undefined : +v\nconst HINTS: Record<string, ( v: string | null ) => unknown> = {\n 'full-span': flag, 'sticky-top': flag, 'sticky-bottom': flag,\n 'estimated-height-px': size, 'estimated-main-axis-size-px': size\n}\n\n/**\n * A list's own props (lips#47), which Lynx reads only as JSON too\n * (`ListContainerImpl::ResolveAttribute`): `span-count` counts only if\n * `IsNumber()`, `sticky` only if `IsBool()`. Every prop `@lynx-js/types`\n * declares `number` on `list`, and every typed one the engine reads beyond\n * them, matches `NUMBERS`; every `boolean` one matches `FLAGS`, which\n * is read first (`enable-dynamic-span-count`), and no string prop matches. A name list measured 0.25 KB\n * larger. A flag follows the cell hints' rule, and text that is not a\n * number goes as written. Lynx for Web gets the same attribute text.\n */\nconst NUMBERS = /-(count|offset|index|throttle|level|strategy)$|^layout-id$/\nconst FLAGS = /^(sticky$|bounces$|enable-|needs?-|should-|experimental-(?!.*strategy$)|scroll-bar-enable$|harmony-)/\nconst listProp = ( name: string, v: string ) => FLAGS.test( name ) ? flag( v ) : NUMBERS.test( name ) ? size( v ) ?? v : v\n\n/**\n * Lynx's boolean attributes, on any element and on `overlay`.\n * Android and iOS read the text `\"false\"` as false; HarmonyOS reads them\n * with `Value::Bool()`, where any text but `\"\"` is true (`UIBase::\n * prop_setters_`, `UIOverlay::OnPropUpdate`), so `visible=\"false\"` would\n * show an overlay there. Written text goes as a boolean, read as Android\n * reads it (`JavaOnlyMap.getBoolean`: `\"true\"` or `\"yes\"`, any case) and\n * present-is-true as in HTML, so all three agree. Bound booleans were\n * already right (`true` is `\"\"`, `false` removes it), and the\n * background's own ARIA sends booleans.\n */\nconst BOOLS = /^(visible|events-pass-through|event-through|ignore-focus|user-interaction-enabled|native-interaction-enabled|block-native-event|block-list-event|skip-redirection|enable-exposure-ui-clip|accessibility-(element|elements-hidden|exclusive-focus))$/\nconst on = ( v: string ) => v === '' || /^(true|yes)$/i.test( v )\n\n/** A list's cells: in Lips's order, and in the order the list was last told */\ninterface ListState {\n order: number[]\n shown: number[]\n /** Cells the list has asked for: attached to it */\n attached: Set<number>\n /** Cells removed this batch: detached once the list has let them go */\n gone: [ number, Ref ][]\n /** Cells whose hints changed this batch */\n hinted: Set<number>\n}\n\n/**\n * The positions in `seq` of its longest increasing run — the cells a\n * reorder can leave in place. Everything else is removed and re-inserted.\n */\nfunction stable( seq: number[] ){\n const tails: number[] = [], prev: number[] = []\n for( let i = 0; i < seq.length; i++ ){\n let lo = 0, hi = tails.length\n while( lo < hi ){\n const mid = ( lo + hi ) >> 1\n seq[ tails[ mid ] ] < seq[ i ] ? lo = mid + 1 : hi = mid\n }\n prev[ i ] = lo ? tails[ lo - 1 ] : -1\n tails[ lo ] = i\n }\n const keep = new Set<number>()\n for( let i = tails.length ? tails[ tails.length - 1 ] : -1; i >= 0; i = prev[ i ] ) keep.add( i )\n return keep\n}\n\n/** `data-user-id` → `userId`, the dataset spelling */\nconst datasetKey = ( name: string ) => name.slice( 5 ).replace( /-([a-z])/g, ( _, c ) => c.toUpperCase() )\n\n/** A key event's fields (lynxjs.org, KeyEvent), and a touch point's (Touch) */\nconst KEY = [ 'key', 'repeat', 'altKey', 'ctrlKey', 'metaKey', 'shiftKey' ]\nconst POINT = [ 'identifier', 'x', 'y', 'pageX', 'pageY', 'clientX', 'clientY' ]\n\nconst take = ( from: any, keys: string[], to: any = {} ) => {\n if( from && typeof from === 'object' ) for( const k of keys ) k in from && ( to[ k ] = from[ k ] )\n return to\n}\nconst points = ( list: any ) => Array.from( list || [], ( p: any ) => take( p, POINT ) )\nconst where = ( t: any ) => t && { id: t.id, dataset: { ...t.dataset } }\n\n/**\n * What crosses for an event: a serializable pick of it, per kind (lips#35).\n * The engine's event holds a `ref` to itself, which cannot cross, and\n * puts much of what a handler reads outside `detail`:\n *\n * - every event: `target` and `currentTarget`, with their `dataset`\n * - a key event: `key`, `repeat` and the modifiers. A platform that\n * sends it as a custom event puts them in `detail`, so both are read\n * - a touch event: `touches` and `changedTouches`, with their positions\n */\nconst pick = ( e: any, type: string ) => {\n const out: any = take( e, KEY, take( e?.detail, KEY, { type: e?.type ?? type, detail: e?.detail }) )\n if( e?.touches ){\n out.touches = points( e.touches )\n out.changedTouches = points( e.changedTouches )\n }\n out.target = where( e?.target )\n out.currentTarget = where( e?.currentTarget )\n return out\n}\n\nexport function createApplier( page: Ref, forward: ( wire: WireEvent | WireReply ) => void ){\n const\n pageId = __GetElementUniqueID( page ),\n els = new Map<number, Ref>([ [ PAGE_ID, page ] ]),\n listeners = new Map<number, Map<string, [ ( e: any ) => void, object ]>>(),\n /** Lynx's element ids → Lips's: an event names its target by Lynx's */\n uids = new Map<number, number>([ [ pageId, PAGE_ID ] ]),\n lists = new Map<number, ListState>(),\n /** Each cell's hints, and the list it is in */\n hints = new Map<number, Record<string, unknown>>(),\n listOf = new Map<number, number>(),\n /** UI methods wait for the flush: before it the engine throws */\n invokes: [ Ref, string, object, number ][] = []\n\n /**\n * A list asks for each cell as it scrolls into view. Cells are built\n * eagerly — they are ordinary elements the background already renders —\n * so the answer is the cell at that position, attached and laid out.\n */\n const list = ( id: number ) => {\n const st: ListState = { order: [], shown: [], attached: new Set(), gone: [], hinted: new Set() }\n lists.set( id, st )\n return __CreateList( pageId,\n ( ref, listID, index, operationID ) => {\n const cell = els.get( st.shown[ index ] )!, elementID = __GetElementUniqueID( cell )\n st.attached.add( st.shown[ index ] )\n __AppendElement( ref, cell )\n __FlushElementTree( cell, { triggerLayout: true, operationID, elementID, listID })\n return elementID\n },\n NOOP )\n }\n\n const create = ( id: number, tag: string ) =>\n tag === 'view' ? __CreateView( pageId )\n : tag === 'text' ? __CreateText( pageId )\n : tag === 'image' ? __CreateImage( pageId )\n : tag === 'scroll-view' ? __CreateScrollView( pageId )\n : tag === 'list' ? list( id )\n : __CreateElement( tag, pageId )\n\n const attr = ( el: Ref, name: string, value: any ) => {\n if( name === 'class' ) __SetClasses( el, value || undefined )\n else if( name === 'id' ) __SetID( el, value )\n else if( name.startsWith('data-') ) __AddDataset( el, datasetKey( name ), value ?? undefined )\n else __SetAttribute( el, name, value === '' && !EMPTY_IS_TEXT.has( name ) || value )\n }\n\n /**\n * Tell a list what changed since it was last told: the cells that left\n * or moved, by their old positions, then the ones that arrived or\n * moved, by their new positions. Each carries the `item-key` Lynx\n * requires — the cell's id, unique and stable for its lifetime — and\n * its hints. A cell that stayed but whose hints changed is an update,\n * by its position, with `flush: false`: its content is not rebuilt.\n */\n const commit = ( id: number, st: ListState ) => {\n const\n next = st.order.slice(),\n at = new Map( next.map( ( c, i ) => [ c, i ] ) ),\n stay = st.shown.filter( c => at.has( c ) ),\n keep = new Set( [ ...stable( stay.map( c => at.get( c )! ) ) ].map( i => stay[ i ] ) ),\n removeAction: number[] = [],\n insertAction: object[] = [],\n updateAction: object[] = []\n\n st.shown.forEach( ( c, i ) => keep.has( c ) || removeAction.push( i ) )\n next.forEach( ( c, position ) => keep.has( c )\n ? st.hinted.has( c ) && updateAction.push({ from: position, to: position, flush: false, type: 'default', 'item-key': String( c ), ...hints.get( c ) })\n : insertAction.push({ position, type: 'default', 'item-key': String( c ), ...hints.get( c ) }) )\n\n st.shown = next\n st.hinted.clear()\n const ref = els.get( id )!\n __SetAttribute( ref, 'update-list-info', { insertAction, removeAction, updateAction })\n for( const [ c, cell ] of st.gone )\n at.has( c ) || st.attached.delete( c ) && __RemoveElement( ref, cell )\n st.gone = []\n }\n\n return function apply( ops: any[] ){\n const touched = new Set<number>()\n\n for( let i = 0; i < ops.length; i += ARITY[ ops[ i ] ] + 1 ){\n const a = ops[ i + 1 ], b = ops[ i + 2 ], c = ops[ i + 3 ], d = ops[ i + 4 ]\n let st: ListState | undefined\n\n switch( ops[ i ] ){\n // An event names its target by Lynx's id: raw text too, which Lynx for Web hit-tests to\n case CREATE:\n case TEXT: {\n const el = ops[ i ] === CREATE ? create( a, b ) : __CreateRawText( b )\n els.set( a, el )\n uids.set( __GetElementUniqueID( el ), a )\n break\n }\n case INSERT:\n if( st = lists.get( a ) ){\n listOf.set( b, a )\n const at = st.order.indexOf( c )\n st.order.splice( at < 0 ? st.order.length : at, 0, b )\n touched.add( a )\n }\n else c ? __InsertElementBefore( els.get( a )!, els.get( b )!, els.get( c ) )\n : __AppendElement( els.get( a )!, els.get( b )! )\n break\n case REMOVE:\n if( st = lists.get( a ) ){\n listOf.delete( b )\n st.order.splice( st.order.indexOf( b ), 1 )\n st.gone.push([ b, els.get( b )! ])\n touched.add( a )\n }\n else __RemoveElement( els.get( a )!, els.get( b )! )\n break\n case ATTR:\n // Only text is converted: a removed prop is still removed, a boolean stays one\n attr( els.get( a )!, b, typeof c !== 'string' ? c : BOOLS.test( b ) ? on( c ) : lists.has( a ) ? listProp( b, c ) : c )\n if( b in HINTS ){\n const h = hints.get( a ) || {}, list = listOf.get( a ), v = HINTS[ b ]( c )\n if( h[ b ] === v ) break\n h[ b ] = v\n hints.set( a, h )\n // A cell the list already has: told again, as an update\n if( list !== undefined && ( st = lists.get( list ) ) ){\n st.hinted.add( a )\n touched.add( list )\n }\n }\n break\n case SET_TEXT: __SetAttribute( els.get( a )!, 'text', b ); break\n case STYLES: __SetInlineStyles( els.get( a )!, b ); break\n case LISTEN: {\n const type = b.split('.')[ 0 ], options = bindOf( b )\n const fn = ( e: any ) => forward({ id: a, name: b, t: uids.get( e?.target?.uid ), event: pick( e, type ) })\n let byName = listeners.get( a )\n byName || listeners.set( a, byName = new Map() )\n byName.set( b, [ fn, options ] )\n __AddEventListener( els.get( a )!, type, fn, options )\n break\n }\n case UNLISTEN: {\n const bound = listeners.get( a )?.get( b )\n if( bound ){\n __RemoveEventListener( els.get( a )!, b.split('.')[ 0 ], ...bound )\n listeners.get( a )!.delete( b )\n }\n break\n }\n case RELEASE:\n uids.delete( __GetElementUniqueID( els.get( a )! ) )\n els.delete( a )\n listeners.delete( a )\n lists.delete( a )\n hints.delete( a )\n listOf.delete( a )\n break\n case INVOKE: invokes.push([ els.get( a )!, b, c, d ]); break\n default:\n throw new Error(`[lips] unknown op ${ops[ i ]} at ${i}`)\n }\n }\n\n for( const id of touched ) lists.has( id ) && commit( id, lists.get( id )! )\n __FlushElementTree()\n // `animate` is Element PAPI's own call, with Lynx's `Animation` arguments; the rest are UI methods\n for( const [ el, method, params, call ] of invokes.splice( 0 ) )\n method === 'animate' ? __ElementAnimate( el, params as unknown[] )\n : __InvokeUIMethod( el, method, params, call ? ( r: { code: number, data?: unknown } ) => forward({ call, code: r.code, data: r.data }) : NOOP )\n }\n}\n\n/**\n * The page lifecycle the native engine calls on the main thread. Lips\n * renders from the background, so there is nothing to do in them — but\n * they must exist: the Lynx 4.1 engine calls `renderPage` and throws\n * when it is missing (Lynx for Web does not call it). An app's own\n * definitions win.\n */\nconst LIFECYCLE = {\n processData: ( data: unknown ) => data,\n renderPage(){},\n updatePage(){}\n}\n\n/**\n * Wire an applier to the real thread bridge. On the main thread\n * `lynx.getJSContext()` is the endpoint connected to the background.\n */\nexport function connectMain( page: Ref ){\n for( const [ name, fn ] of Object.entries( LIFECYCLE ) )\n typeof ( globalThis as any )[ name ] === 'function' || ( ( globalThis as any )[ name ] = fn )\n\n const bridge = lynx.getJSContext()\n const apply = createApplier( page, wire => bridge.dispatchEvent({ type: DOM_EVENT, data: wire }) )\n\n bridge.addEventListener( OPS_EVENT, ( e: { data: unknown[] } ) => apply( e.data ) )\n return apply\n}\n"
|
|
7
|
+
],
|
|
8
|
+
"mappings": "AAgCO,IACP,EAAS,EACT,EAAO,EACP,EAAS,EACT,EAAS,EACT,EAAO,EACP,EAAW,EACX,EAAS,EACT,EAAS,EACT,EAAW,EACX,EAAU,EACV,EAAS,GAGI,EAAQ,CAAE,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,CAAE,EAE1C,EAAU,EAGV,EAAY,WACZ,EAAY,aAyDnB,EAAO,CACX,MAAO,UAAW,UAAW,MAAO,SAAU,SAAU,OAAQ,QAChE,KAAM,KAAM,KAAM,SAAU,OAAQ,SAAU,SAAU,UAAW,UACnE,UAAW,aAAc,SAAU,WAAY,SAAU,OAAQ,KAAM,KAAM,KAAM,YACrF,EACM,EAAY,CA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