@motionscript/math 0.1.0-alpha.9 → 0.1.1-alpha.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/CHANGELOG.md +23 -0
- package/dist/annotate/angle-mark.d.ts +4 -14
- package/dist/annotate/angle-mark.d.ts.map +1 -1
- package/dist/annotate/angle-mark.js +2 -1
- package/dist/annotate/angle-mark.js.map +1 -1
- package/dist/annotate/curly-brace.d.ts +4 -16
- package/dist/annotate/curly-brace.d.ts.map +1 -1
- package/dist/annotate/curly-brace.js.map +1 -1
- package/dist/annotate/emphasis-mark.d.ts +0 -5
- package/dist/annotate/emphasis-mark.d.ts.map +1 -1
- package/dist/annotate/emphasis-mark.js.map +1 -1
- package/dist/browser/chunks/chunk-FZ2YBTPL.js +2 -0
- package/dist/browser/chunks/chunk-FZ2YBTPL.js.map +7 -0
- package/dist/browser/chunks/chunk-T42HWKBC.js +2 -0
- package/dist/browser/chunks/chunk-T42HWKBC.js.map +7 -0
- package/dist/browser/chunks/{mathjax-WV55AC2P.js → mathjax-SOM6RSPV.js} +1 -1
- package/dist/browser/chunks/{mathjax-WV55AC2P.js.map → mathjax-SOM6RSPV.js.map} +2 -2
- package/dist/browser/index.js +1 -1
- package/dist/browser/index.js.map +3 -3
- package/dist/browser/kit.js +1 -1
- package/dist/browser/manifest.json +1 -1
- package/dist/browser/tex.js +1 -1
- package/dist/engine.d.ts +3 -4
- package/dist/engine.d.ts.map +1 -1
- package/dist/engine.js +3 -4
- package/dist/engine.js.map +1 -1
- package/dist/kit/cache.d.ts +10 -21
- package/dist/kit/cache.d.ts.map +1 -1
- package/dist/kit/cache.js +33 -24
- package/dist/kit/cache.js.map +1 -1
- package/dist/kit/component.d.ts +5 -14
- package/dist/kit/component.d.ts.map +1 -1
- package/dist/kit/component.js +1 -8
- package/dist/kit/component.js.map +1 -1
- package/dist/kit/coords.d.ts +1 -1
- package/dist/kit/coords.d.ts.map +1 -1
- package/dist/kit/coords.js +2 -1
- package/dist/kit/coords.js.map +1 -1
- package/dist/kit/curve.d.ts +1 -5
- package/dist/kit/curve.d.ts.map +1 -1
- package/dist/kit/curve.js.map +1 -1
- package/dist/kit/equation.d.ts +10 -30
- package/dist/kit/equation.d.ts.map +1 -1
- package/dist/kit/equation.js +9 -44
- package/dist/kit/equation.js.map +1 -1
- package/dist/kit/equation3d.d.ts +3 -3
- package/dist/kit/equation3d.d.ts.map +1 -1
- package/dist/kit/equation3d.js +27 -59
- package/dist/kit/equation3d.js.map +1 -1
- package/dist/kit/expression.d.ts +7 -7
- package/dist/kit/expression.d.ts.map +1 -1
- package/dist/kit/expression.js +18 -17
- package/dist/kit/expression.js.map +1 -1
- package/dist/kit/field-mark.d.ts +0 -7
- package/dist/kit/field-mark.d.ts.map +1 -1
- package/dist/kit/field-mark.js.map +1 -1
- package/dist/kit/field.d.ts +2 -2
- package/dist/kit/field.d.ts.map +1 -1
- package/dist/kit/field.js +11 -31
- package/dist/kit/field.js.map +1 -1
- package/dist/kit/follow.d.ts +3 -10
- package/dist/kit/follow.d.ts.map +1 -1
- package/dist/kit/follow.js +5 -11
- package/dist/kit/follow.js.map +1 -1
- package/dist/kit/furniture.d.ts +2 -1
- package/dist/kit/furniture.d.ts.map +1 -1
- package/dist/kit/furniture.js +6 -3
- package/dist/kit/furniture.js.map +1 -1
- package/dist/kit/geometry.d.ts +1 -0
- package/dist/kit/geometry.d.ts.map +1 -1
- package/dist/kit/geometry.js +3 -0
- package/dist/kit/geometry.js.map +1 -1
- package/dist/kit/mark.d.ts +4 -10
- package/dist/kit/mark.d.ts.map +1 -1
- package/dist/kit/mark.js.map +1 -1
- package/dist/kit/place.d.ts +3 -5
- package/dist/kit/place.d.ts.map +1 -1
- package/dist/kit/place.js +3 -5
- package/dist/kit/place.js.map +1 -1
- package/dist/kit/sampler.d.ts +0 -5
- package/dist/kit/sampler.d.ts.map +1 -1
- package/dist/kit/sampler.js.map +1 -1
- package/dist/kit/system.d.ts +0 -1
- package/dist/kit/system.d.ts.map +1 -1
- package/dist/kit/system.js +3 -10
- package/dist/kit/system.js.map +1 -1
- package/dist/marks/curve-area.d.ts +2 -12
- package/dist/marks/curve-area.d.ts.map +1 -1
- package/dist/marks/curve-area.js +4 -9
- package/dist/marks/curve-area.js.map +1 -1
- package/dist/marks/drop-lines.d.ts +1 -5
- package/dist/marks/drop-lines.d.ts.map +1 -1
- package/dist/marks/drop-lines.js.map +1 -1
- package/dist/marks/plot-point.d.ts +4 -13
- package/dist/marks/plot-point.d.ts.map +1 -1
- package/dist/marks/plot-point.js.map +1 -1
- package/dist/marks/riemann-sum.d.ts +1 -7
- package/dist/marks/riemann-sum.d.ts.map +1 -1
- package/dist/marks/riemann-sum.js +2 -2
- package/dist/marks/riemann-sum.js.map +1 -1
- package/dist/marks/tangent-line.d.ts +2 -12
- package/dist/marks/tangent-line.d.ts.map +1 -1
- package/dist/marks/tangent-line.js +1 -5
- package/dist/marks/tangent-line.js.map +1 -1
- package/dist/marks/vector-arrow.d.ts +2 -11
- package/dist/marks/vector-arrow.d.ts.map +1 -1
- package/dist/marks/vector-arrow.js +3 -6
- package/dist/marks/vector-arrow.js.map +1 -1
- package/dist/nodes.d.ts +1 -12
- package/dist/nodes.d.ts.map +1 -1
- package/dist/nodes.js.map +1 -1
- package/dist/plots/function-plot.d.ts +1 -6
- package/dist/plots/function-plot.d.ts.map +1 -1
- package/dist/plots/function-plot.js +1 -5
- package/dist/plots/function-plot.js.map +1 -1
- package/dist/plots/points-plot.d.ts +1 -6
- package/dist/plots/points-plot.d.ts.map +1 -1
- package/dist/plots/points-plot.js.map +1 -1
- package/dist/plots/stream-lines.d.ts +0 -7
- package/dist/plots/stream-lines.d.ts.map +1 -1
- package/dist/plots/stream-lines.js.map +1 -1
- package/dist/plots/traced-path.d.ts +1 -12
- package/dist/plots/traced-path.d.ts.map +1 -1
- package/dist/plots/traced-path.js +1 -6
- package/dist/plots/traced-path.js.map +1 -1
- package/dist/plots/vector-field.d.ts +1 -10
- package/dist/plots/vector-field.d.ts.map +1 -1
- package/dist/plots/vector-field.js +3 -6
- package/dist/plots/vector-field.js.map +1 -1
- package/dist/structures/network-graph.d.ts +15 -34
- package/dist/structures/network-graph.d.ts.map +1 -1
- package/dist/structures/network-graph.js +2 -5
- package/dist/structures/network-graph.js.map +1 -1
- package/dist/structures/sample-space.d.ts +8 -22
- package/dist/structures/sample-space.d.ts.map +1 -1
- package/dist/structures/sample-space.js +3 -5
- package/dist/structures/sample-space.js.map +1 -1
- package/dist/systems/axes2d.d.ts +0 -1
- package/dist/systems/axes2d.d.ts.map +1 -1
- package/dist/systems/axes2d.js +3 -4
- package/dist/systems/axes2d.js.map +1 -1
- package/dist/systems/number-line.d.ts +7 -22
- package/dist/systems/number-line.d.ts.map +1 -1
- package/dist/systems/number-line.js +2 -2
- package/dist/systems/number-line.js.map +1 -1
- package/dist/systems/number-plane.d.ts +12 -27
- package/dist/systems/number-plane.d.ts.map +1 -1
- package/dist/systems/number-plane.js +1 -7
- package/dist/systems/number-plane.js.map +1 -1
- package/dist/systems/polar-plane.d.ts +11 -26
- package/dist/systems/polar-plane.d.ts.map +1 -1
- package/dist/systems/polar-plane.js +7 -10
- package/dist/systems/polar-plane.js.map +1 -1
- package/dist/tex/geometry.d.ts +5 -24
- package/dist/tex/geometry.d.ts.map +1 -1
- package/dist/tex/geometry.js +19 -90
- package/dist/tex/geometry.js.map +1 -1
- package/dist/tex/mathjax.d.ts +0 -13
- package/dist/tex/mathjax.d.ts.map +1 -1
- package/dist/tex/mathjax.js +4 -24
- package/dist/tex/mathjax.js.map +1 -1
- package/dist/tex/matrix.d.ts +1 -10
- package/dist/tex/matrix.d.ts.map +1 -1
- package/dist/tex/matrix.js +1 -5
- package/dist/tex/matrix.js.map +1 -1
- package/dist/tex/tween.d.ts +9 -30
- package/dist/tex/tween.d.ts.map +1 -1
- package/dist/tex/tween.js +19 -67
- package/dist/tex/tween.js.map +1 -1
- package/dist/tex/typeset.d.ts +2 -23
- package/dist/tex/typeset.d.ts.map +1 -1
- package/dist/tex/typeset.js +4 -30
- package/dist/tex/typeset.js.map +1 -1
- package/dist/three/axes3d.d.ts +32 -62
- package/dist/three/axes3d.d.ts.map +1 -1
- package/dist/three/axes3d.js +5 -13
- package/dist/three/axes3d.js.map +1 -1
- package/dist/three/curve-plot3d.d.ts +4 -15
- package/dist/three/curve-plot3d.d.ts.map +1 -1
- package/dist/three/curve-plot3d.js.map +1 -1
- package/dist/three/plot-point3d.d.ts +7 -14
- package/dist/three/plot-point3d.d.ts.map +1 -1
- package/dist/three/plot-point3d.js.map +1 -1
- package/dist/three/space.d.ts +3 -8
- package/dist/three/space.d.ts.map +1 -1
- package/dist/three/space.js +1 -8
- package/dist/three/space.js.map +1 -1
- package/dist/three/surface-plot3d.d.ts +9 -23
- package/dist/three/surface-plot3d.d.ts.map +1 -1
- package/dist/three/surface-plot3d.js.map +1 -1
- package/dist/three/vector-arrow3d.d.ts +1 -7
- package/dist/three/vector-arrow3d.d.ts.map +1 -1
- package/dist/three/vector-arrow3d.js.map +1 -1
- package/package.json +4 -4
- package/src/annotate/angle-mark.ts +4 -14
- package/src/annotate/curly-brace.ts +2 -14
- package/src/annotate/emphasis-mark.ts +1 -6
- package/src/engine.ts +3 -4
- package/src/kit/cache.ts +33 -25
- package/src/kit/component.ts +5 -19
- package/src/kit/coords.ts +2 -2
- package/src/kit/curve.ts +1 -5
- package/src/kit/equation.ts +12 -50
- package/src/kit/equation3d.ts +23 -59
- package/src/kit/expression.ts +18 -23
- package/src/kit/field-mark.ts +1 -7
- package/src/kit/field.ts +10 -26
- package/src/kit/follow.ts +5 -13
- package/src/kit/furniture.ts +7 -4
- package/src/kit/geometry.ts +4 -0
- package/src/kit/mark.ts +4 -11
- package/src/kit/place.ts +3 -5
- package/src/kit/sampler.ts +0 -6
- package/src/kit/system.ts +3 -12
- package/src/marks/curve-area.ts +3 -16
- package/src/marks/drop-lines.ts +0 -6
- package/src/marks/plot-point.ts +2 -12
- package/src/marks/riemann-sum.ts +2 -10
- package/src/marks/tangent-line.ts +1 -13
- package/src/marks/vector-arrow.ts +3 -13
- package/src/nodes.ts +1 -12
- package/src/plots/function-plot.ts +1 -6
- package/src/plots/points-plot.ts +0 -7
- package/src/plots/stream-lines.ts +1 -8
- package/src/plots/traced-path.ts +2 -13
- package/src/plots/vector-field.ts +4 -12
- package/src/structures/network-graph.ts +6 -25
- package/src/structures/sample-space.ts +5 -20
- package/src/systems/axes2d.ts +3 -6
- package/src/systems/number-line.ts +4 -20
- package/src/systems/number-plane.ts +4 -19
- package/src/systems/polar-plane.ts +11 -25
- package/src/tex/geometry.ts +24 -126
- package/src/tex/mathjax.ts +4 -26
- package/src/tex/matrix.ts +1 -11
- package/src/tex/tween.ts +21 -75
- package/src/tex/typeset.ts +4 -37
- package/src/three/axes3d.ts +7 -42
- package/src/three/curve-plot3d.ts +0 -12
- package/src/three/plot-point3d.ts +0 -10
- package/src/three/space.ts +2 -11
- package/src/three/surface-plot3d.ts +0 -15
- package/src/three/vector-arrow3d.ts +0 -8
- package/dist/browser/chunks/chunk-IRZCG6PM.js +0 -2
- package/dist/browser/chunks/chunk-IRZCG6PM.js.map +0 -7
- package/dist/browser/chunks/chunk-WMVW6ZIV.js +0 -2
- package/dist/browser/chunks/chunk-WMVW6ZIV.js.map +0 -7
- package/dist/kit/withdrawn.d.ts +0 -9
- package/dist/kit/withdrawn.d.ts.map +0 -1
- package/dist/kit/withdrawn.js +0 -9
- package/dist/kit/withdrawn.js.map +0 -1
- package/src/kit/withdrawn.ts +0 -8
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
function Y(e){let t=new Map;return{get(n){if(!t.has(n))return;let r=t.get(n);return t.delete(n),t.set(n,r),r},set(n,r){for(t.delete(n),t.set(n,r);t.size>e;){let o=t.keys().next().value;if(o===void 0)break;t.delete(o)}},get size(){return t.size}}}var Z=null,it=null,b=null,ht="math:mathjax";function mt(){return it??=import("./mathjax-WV55AC2P.js").then(e=>{Z=e,b=e.adaptor}),it}function Pe(){return Z!==null}function dt(){return{tokens:[],parts:[],commands:[],width:0,height:0,bounds:[0,0,0,0]}}var I=class extends Error{constructor(){super("MathJax is not loaded: declare the math:mathjax loader, or await loadMathJax(), before typesetting."),this.name="LatexNotLoaded"}},V=class extends Error{latex;reason;constructor(t,n){super(`Cannot typeset "${t}": ${n}`),this.name="LatexError",this.latex=t,this.reason=n}},ct=Y(128),ut=Y(64);function D(e,t){let n=`${t}\0${e}`,r=ut.get(n);if(r)return lt(r);let o=ct.get(e);o||(o=Bt(e),ct.set(e,o));let s=Jt(o,t);return ut.set(n,s),lt(s)}function Bt(e){if(!Z)throw new I;let t=b.firstChild(Z.convert(e)),n=Qt(t);if(n!==null)throw new V(e,n);let r=b.getAttribute(t,"height")??"";return jt(t,parseFloat(r)||0)}function Qt(e){for(let t of b.tags(e,"g")){let n=b.getAttribute(t,"data-mjx-error");if(n!=null)return String(n)||"unknown error"}return null}function lt(e){let[t,n,r,o]=e.bounds;return{...e,bounds:[t,n,r,o]}}var G=[1,0,0,1,0,0];function B(e,t){return[e[0]*t[0]+e[2]*t[1],e[1]*t[0]+e[3]*t[1],e[0]*t[2]+e[2]*t[3],e[1]*t[2]+e[3]*t[3],e[0]*t[4]+e[2]*t[5]+e[4],e[1]*t[4]+e[3]*t[5]+e[5]]}function Zt(e){if(!e)return G;let t=[...G],n=/([a-z]+)\(([^)]+)\)/g,r;for(;(r=n.exec(e))!==null;){let o=r[1],s=r[2].split(/[ ,]+/).map(parseFloat);if(o==="translate")t=B(t,[1,0,0,1,s[0]||0,s[1]||0]);else if(o==="scale"){let a=s[0]||1,i=s[1]!==void 0?s[1]:a;t=B(t,[a,0,0,i,0,0])}else o==="matrix"&&(t=B(t,[s[0],s[1],s[2],s[3],s[4],s[5]]))}return t}function H(e,t,n){return[e*n[0]+t*n[2]+n[4],e*n[1]+t*n[3]+n[5]]}function Dt(e){let t=e.split("-"),n=t[t.length-1],r=parseInt(n,16);if(!isNaN(r))try{return String.fromCodePoint(r)}catch{}return e}function Rt(e){let t=b.parent(e);return t?String(b.kind(t)).toLowerCase():""}function jt(e,t){let n=new Map;for(let c of b.tags(e,"path")){let l=b.getAttribute(c,"id"),h=b.getAttribute(c,"d");l&&h&&n.set(`#${l}`,pt(ft(h)))}let r=[],o=[],s=0;function a(c,l){r.push({token:c,cmds:l})}function i(c,l,h){let x=l,C=b.getAttribute(c,"transform");C&&(x=B(x,Zt(C)));let F=String(b.kind(c)).toLowerCase(),k=h,w=F==="g"?b.getAttribute(c,"data-latex"):null;if(w&&b.getAttribute(c,"data-mml-node")!=="math"&&(k=o.length,o.push({latex:String(w),from:r.length,to:r.length,parent:h})),F==="use"){let m=b.getAttribute(c,"href")||b.getAttribute(c,"xlink:href"),f=parseFloat(b.getAttribute(c,"x")||"0"),g=parseFloat(b.getAttribute(c,"y")||"0");if(m&&n.has(m)){let y=n.get(m),p=[];for(let T of y){let M=[...T.args];for(let E=0;E<M.length;E+=2){let[$t,Xt]=H(M[E]+f,M[E+1]+g,x);M[E]=$t,M[E+1]=Xt}p.push({cmd:T.cmd,args:M})}let d=m.startsWith("#")?m.slice(1):m;a(Dt(d),p)}}else if(F==="rect"){let m=parseFloat(b.getAttribute(c,"x")||"0"),f=parseFloat(b.getAttribute(c,"y")||"0"),g=parseFloat(b.getAttribute(c,"width")||"0"),y=parseFloat(b.getAttribute(c,"height")||"0");if(g>0&&y>0){let d=[[m,f],[m+g,f],[m+g,f+y],[m,f+y]].map(T=>H(T[0],T[1],x));a(`__rect_${s++}`,[{cmd:"M",args:[d[0][0],d[0][1]]},{cmd:"L",args:[d[1][0],d[1][1]]},{cmd:"L",args:[d[2][0],d[2][1]]},{cmd:"L",args:[d[3][0],d[3][1]]},{cmd:"Z",args:[]}])}}else if(F==="path"&&Rt(c)!=="defs"){let m=b.getAttribute(c,"d");if(m){let f=pt(ft(m)),g=[];for(let y of f){let p=[...y.args];for(let d=0;d<p.length;d+=2){let[T,M]=H(p[d],p[d+1],x);p[d]=T,p[d+1]=M}g.push({cmd:y.cmd,args:p})}a(`__path_${s++}`,g)}}for(let m of b.childNodes(c)){let f=String(b.kind(m)).toLowerCase();f.startsWith("#")||f==="defs"||i(m,x,k)}k!==h&&(o[k].to=r.length)}i(e,G,-1);for(let c of o)if(c.parent===-1)for(let l=c.from;l<c.to;l++)r[l].term=c.latex;let u=zt(r.flatMap(c=>c.cmds));return{tokens:r,parts:o,box:u,heightEx:t}}function Jt(e,t){let{tokens:n,parts:r,box:o,heightEx:s}=e;if(n.length===0)return{tokens:[],parts:[],commands:[],width:0,height:0,bounds:[0,0,0,0]};let{minX:a,minY:i,maxX:u,maxY:c}=o,l=u-a,h=c-i,x;if(s>0&&h>0){let p=h/s;x=t/(2*p)}else x=h>0?t/h:1;let C=(a+u)/2,F=(i+c)/2,k=p=>(p-C)*x,w=p=>(p-F)*x;function m(p){let d=[];for(let{cmd:T,args:M}of p)switch(T){case"M":d.push({type:"M",x:k(M[0]),y:w(M[1])});break;case"L":d.push({type:"L",x:k(M[0]),y:w(M[1])});break;case"Q":d.push({type:"Q",x1:k(M[0]),y1:w(M[1]),x:k(M[2]),y:w(M[3])});break;case"C":d.push({type:"C",x1:k(M[0]),y1:w(M[1]),x2:k(M[2]),y2:w(M[3]),x:k(M[4]),y:w(M[5])});break;case"Z":d.push({type:"Z"});break}return d}let f=n.map(p=>({token:p.token,path:m(p.cmds),...p.term!==void 0&&{term:p.term}})),g=f.flatMap(p=>p.path),y=[k(a),w(i),k(u),w(c)];return{tokens:f,parts:r,commands:g,width:l*x,height:h*x,bounds:y}}function Q(e){return e.replace(/[\s{}]/g,"")}function Se(e){if(e.trim()==="")return[];let t;try{t=D(e,16).parts}catch{return[]}let n=new Set,r=[];for(let o of t){let s=Q(o.latex);o.to<=o.from||s===""||n.has(s)||(n.add(s),r.push(o.latex))}return r}function K(e,t){let n=Q(t);if(n==="")return[];let r=new Map,o=(a,i)=>{i>a&&r.set(`${a}:${i}`,[a,i])},s=new Map;e.forEach((a,i)=>{Q(a.latex)===n&&o(a.from,a.to);let u=s.get(a.parent);u?u.push(i):s.set(a.parent,[i])});for(let a of s.values())for(let i=0;i<a.length;i++){let u="";for(let c=i;c<a.length&&u.length<n.length;c++)u+=Q(e[a[c]].latex),c>i&&u===n&&o(e[a[i]].from,e[a[c]].to)}return[...r.values()].sort((a,i)=>a[0]-i[0]||a[1]-i[1])}function ft(e){let t=/([MmLlHhVvCcSsQqTtAaZz])|([+-]?(?:\d+\.?\d*|\.\d+)(?:[eE][+-]?\d+)?)/g,n=[],r=null,o;for(;(o=t.exec(e))!==null;)o[1]?(r={cmd:o[1],args:[]},n.push(r)):r&&r.args.push(parseFloat(o[2]));return n}function Wt(e){switch(e.toUpperCase()){case"M":return 2;case"L":return 2;case"H":return 1;case"V":return 1;case"C":return 6;case"S":return 4;case"Q":return 4;case"T":return 2;case"A":return 7;case"Z":return 0;default:return 0}}function pt(e){let t=[],n=0,r=0,o=0,s=0,a="",i={x:0,y:0};for(let{cmd:u,args:c}of e){let l=u.toUpperCase(),h=u===u.toLowerCase()&&l!=="Z",x=Wt(l),C=x===0?1:Math.max(1,Math.ceil(c.length/x));for(let F=0;F<C;F++){let k=c.slice(F*x,F*x+x),w=f=>h?k[f]+n:k[f],m=f=>h?k[f]+r:k[f];switch(l){case"M":{let f=w(0),g=m(1),y=F===0?"M":"L";t.push({cmd:y,args:[f,g]}),n=f,r=g,F===0&&(o=f,s=g),a=y,i={x:n,y:r};break}case"Z":t.push({cmd:"Z",args:[]}),n=o,r=s,a="Z";break;case"L":{let f=w(0),g=m(1);t.push({cmd:"L",args:[f,g]}),n=f,r=g,a="L",i={x:n,y:r};break}case"H":{let f=h?k[0]+n:k[0];t.push({cmd:"L",args:[f,r]}),n=f,a="L",i={x:n,y:r};break}case"V":{let f=h?k[0]+r:k[0];t.push({cmd:"L",args:[n,f]}),r=f,a="L",i={x:n,y:r};break}case"C":{let f=w(0),g=m(1),y=w(2),p=m(3),d=w(4),T=m(5);t.push({cmd:"C",args:[f,g,y,p,d,T]}),i={x:y,y:p},n=d,r=T,a="C";break}case"S":{let f=a==="C"||a==="S"?2*n-i.x:n,g=a==="C"||a==="S"?2*r-i.y:r,y=w(0),p=m(1),d=w(2),T=m(3);t.push({cmd:"C",args:[f,g,y,p,d,T]}),i={x:y,y:p},n=d,r=T,a="S";break}case"Q":{let f=w(0),g=m(1),y=w(2),p=m(3);t.push({cmd:"Q",args:[f,g,y,p]}),i={x:f,y:g},n=y,r=p,a="Q";break}case"T":{let f=a==="Q"||a==="T"?2*n-i.x:n,g=a==="Q"||a==="T"?2*r-i.y:r,y=w(0),p=m(1);t.push({cmd:"Q",args:[f,g,y,p]}),i={x:f,y:g},n=y,r=p,a="T";break}}}}return t.length>0&&t[t.length-1].cmd!=="Z"&&t.push({cmd:"Z",args:[]}),t}function zt(e){let t=1/0,n=1/0,r=-1/0,o=-1/0,s=(a,i)=>{a<t&&(t=a),a>r&&(r=a),i<n&&(n=i),i>o&&(o=i)};for(let{cmd:a,args:i}of e)switch(a){case"M":case"L":s(i[0],i[1]);break;case"C":s(i[0],i[1]),s(i[2],i[3]),s(i[4],i[5]);break;case"Q":s(i[0],i[1]),s(i[2],i[3]);break}return{minX:t,minY:n,maxX:r,maxY:o}}import{lerpNumber as L}from"@motionscript/sdk";var U=[["x","y"],["x1","y1"],["x2","y2"]];function xt(e){let t=0,n=0,r=0;for(let o of e)"x"in o&&"y"in o&&(t+=o.x,n+=o.y,r++);return r>0?{x:t/r,y:n/r}:{x:0,y:0}}function gt(e){let t=1/0,n=1/0,r=-1/0,o=-1/0;for(let s of e){let a=s;for(let[i,u]of U)i in a&&(a[i]<t&&(t=a[i]),a[i]>r&&(r=a[i]),a[u]<n&&(n=a[u]),a[u]>o&&(o=a[u]))}return t>r?0:Math.hypot(r-t,o-n)}function qt(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n].type!==t[n].type)return!1;return!0}function Ht(e,t,n){let r=new Array(e.length);for(let o=0;o<e.length;o++){let s=e[o],a=t[o],i={...a};for(let[u,c]of U)u in a&&u in s&&(i[u]=L(s[u],a[u],n),i[c]=L(s[c],a[c],n));r[o]=i}return r}function Vt(e,t,n,r,o,s){return e.map(a=>{let i={...a};for(let[u,c]of U)u in i&&(i[u]=t+(i[u]-t)*r+o,i[c]=n+(i[c]-n)*r+s);return i})}function Gt(e,t){let n=[...t],r=new Map,o=u=>!u.token.startsWith("__"),s=u=>{for(let c of e){if(!o(c)||r.has(c))continue;let l=n.findIndex(h=>o(h)&&u(c,h));l!==-1&&(r.set(c,n[l]),n.splice(l,1))}};s((u,c)=>u.token===c.token&&u.term!==void 0&&u.term===c.term),s((u,c)=>u.token===c.token);let a=[],i=[];for(let u of e){let c=r.get(u);c?a.push({from:u,to:c}):i.push(u)}return{matched:a,deleted:i,added:n}}function _(e,t){let{matched:n,deleted:r,added:o}=Gt(e,t),s=new Map(e.map((u,c)=>[u,c])),a=new Map(t.map((u,c)=>[u,c])),i=n.map(({from:u,to:c})=>{let l=gt(c.path);return{from:s.get(u),to:a.get(c),pointwise:qt(u.path,c.path),fromPath:u.path,toPath:c.path,token:c.token,fromCenter:xt(u.path),toCenter:xt(c.path),fromScale:l>0?gt(u.path)/l:1}});return u=>{let c=[];for(let l of i){if(l.pointwise){c.push({token:l.token,path:Ht(l.fromPath,l.toPath,u),opacity:1,x:0,y:0,from:l.from,to:l.to});continue}let h=L(l.fromScale,1,u),x=L(l.fromCenter.x,l.toCenter.x,u),C=L(l.fromCenter.y,l.toCenter.y,u);c.push({token:l.token,path:Vt(l.toPath,l.toCenter.x,l.toCenter.y,h,x-l.toCenter.x,C-l.toCenter.y),opacity:1,x:0,y:0,from:l.from,to:l.to})}for(let l of r){let h=Math.min(u*2,1);c.push({token:l.token,path:l.path,opacity:L(1,0,h),x:0,y:0,from:s.get(l)})}for(let l of o){let h=Math.max(u*2-1,0);c.push({token:l.token,path:l.path,opacity:L(0,1,h),x:0,y:0,to:a.get(l)})}return c}}import{Paint as yt,Types as Kt}from"@motionscript/sdk";var{overlay:Oe,...Ut}=yt.state,{overlayTo:Ye,...te}=yt.commands,Ne=Ut,$e=te;function Xe(e,t,n={}){return Kt.custom(t,{...n,options:e})}function bt(e,...t){let n={...e};for(let r of t)delete n[r];return n}function Be(e,t,n=()=>{}){e.inFront(t),e.children(),e.inFront(n)}import{fillOps as kt,lerpNumber as ee}from"@motionscript/sdk";function wt(e){return Array.isArray(e)?e.map(t=>({part:String(t?.part??""),fill:kt.resolve(t?.fill??"#ffffff"),occurrence:Math.max(0,Math.round(t?.occurrence??0)),mix:Math.min(1,Math.max(0,t?.mix??1))})):[]}var tt=e=>`${e.occurrence}|${e.part}`;function Mt(e,t,n){if(n<=0)return e;if(n>=1)return t;let r=new Map(e.map(s=>[tt(s),s])),o=t.map(s=>{let a=r.get(tt(s));return r.delete(tt(s)),a?{...s,fill:kt.lerp(a.fill,s.fill,n),mix:ee(a.mix,s.mix,n)}:{...s,mix:s.mix*n}});for(let s of r.values())o.push({...s,mix:s.mix*(1-n)});return o}function Ct(e,t){let n=Math.max(0,Math.round(t.occurrence??0));return[...e.filter(r=>r.part!==t.part||r.occurrence!==n),{...t,occurrence:n}]}function et(e,t){return!t||t.mix<=0?e:t.mix>=1?t.fill:[...e,...t.fill.map(n=>({...n,opacity:(n.opacity??1)*t.mix}))]}import{commandsFor as ne,fillOps as re,Flow as _t,Graphics2D as oe,lerpNumber as P,Paint as vt,pathOps as se,toPathString as Tt,Types as v}from"@motionscript/sdk";var A=class{from;to;t;constructor(t,n,r){this.from=t,this.to=n,this.t=r}};function Ft(e){return e instanceof A?e.t<.5?e.from:e.to:e}function O(e,t,n){return n<=0?e:n>=1?t:new A(Ft(e),Ft(t),n)}function Ot(e,t){let n=e.find(o=>o instanceof A),r=o=>t(e.map(s=>s instanceof A?s[o]:s));return n?new A(r("from"),r("to"),n.t):r("to")}var{start:He,end:Ve,...ae}=vt.state,X={...ae,..._t.state,fontSize:16,partFills:v.custom([],{resolve:wt,lerp:Mt,kind:"vector"}),written:v.number(1,{min:0,max:1,step:.01}),morphProgress:v.number(0,{animatable:!1})},R={...bt(vt.commands,"progressTo","flash"),...ne(X,{writeTo:{args:["written"]},partFillTo:{args:{part:v.text(""),fill:v.custom("#facc15",{kind:"fills"}),occurrence:v.number(0,{min:0,step:1})},run:(e,t)=>{let{part:n,fill:r,occurrence:o}=e.args;return!n||r==null?e.tween({}):e.tween({partFills:Ct(t.partFills,{part:n,fill:r,occurrence:o})})}}})},At={tokens:[],parts:[],bounds:[0,0,0,0],width:0,height:0,morph:null};function Lt(e,t){if(!e)return At;let n;try{n=D(e,t)}catch(r){if(r instanceof I)return At;throw r}return ie(n)}var Pt=new WeakMap;function ie(e){let t=Pt.get(e.tokens);return t||(t={tokens:e.tokens.map(n=>({token:n.token,path:n.path,term:n.term,opacity:1,x:0,y:0})),parts:e.parts,bounds:e.bounds,width:e.width,height:e.height,morph:null},Pt.set(e.tokens,t)),t}function ce(e,t){try{return D(e,t)}catch(n){if(!(n instanceof I))throw n;return dt()}}var St="\0",Et=Y(16),N=null;function S(e,t,n,r=_){if(!(e instanceof A))return Lt(e,t);let o=Lt(e.from,t),s=ce(e.to,t),{t:a}=e,i=`${t}${St}${e.from}${St}${e.to}`,u=r===_?Et.get(i):void 0;u||(u=r(o.tokens.map(l=>({token:l.token,path:l.path,term:l.term})),s.tokens),r===_&&Et.set(i,u));let c=N&&N.key===i&&N.t===a&&r===_?N.tokens:u(a);return r===_&&(N={key:i,t:a,tokens:c}),{tokens:c,parts:[],bounds:[P(o.bounds[0],s.bounds[0],a),P(o.bounds[1],s.bounds[1],a),P(o.bounds[2],s.bounds[2],a),P(o.bounds[3],s.bounds[3],a)],width:P(o.width,s.width,a),height:P(o.height,s.height,a),morph:{from:rt(n,o.parts,o.tokens.length),to:rt(n,s.parts,s.tokens.length),t:a}}}function j(e,t){let n=t.padding;return{width:e.width+n.left+n.right,height:e.height+n.top+n.bottom}}function J(e,t,n){return _t.layout(e,t,n,ue(t.stroke))}function ue(e){let t=0;for(let n of e){let r=n.weight*(1-n.align)/2;r>t&&(t=r)}return{left:t,right:t,top:t,bottom:t}}function W(e){e.task(ht,mt,{before:"layout"})}var le=.6,fe=1/32;function z(e,t,n){e.inFront(()=>pe(e,t,n)),e.children(),e.inFront(()=>he(e,t,n))}function pe(e,t,n){let r=t.fill,o=t.shadow,s=t.stroke,a=me(n,t.partFills),i=Yt(t.written,n.tokens.length);nt(e,n,(u,c,l,h)=>{let x=et(r,a(l,h)),C=i?.(l);return C?C.filled<=0?null:u.shadow(It(o,c*C.filled)).fill($(x,c*C.filled)).stroke(s):u.shadow(It(o,c)).fill($(x,c)).stroke(s)}),i&&nt(e,n,(u,c,l,h)=>{let x=i(l);if(!x||x.filled>=1||x.outlined<=0)return null;let C=$(et(r,a(l,h)),c*(1-x.filled));return u.stroke(s.length>0?s:ge(t.fontSize*fe,C))},u=>i(u)?.outlined??1)}function he(e,t,n){let r=t.overlay;if(r.length===0)return;let o=Yt(t.written,n.tokens.length);nt(e,n,(s,a,i)=>{let u=o?.(i).filled??1;return u<=0?null:s.fill($(r,a*u))})}function me(e,t){let n=e.morph;if(n)return(o,s)=>{let a=s.from===void 0?void 0:n.from[s.from],i=s.to===void 0?void 0:n.to[s.to];if(a&&i)return{...i,fill:re.lerp(a.fill,i.fill,n.t),mix:P(a.mix,i.mix,n.t)};if(a)return s.to===void 0?a:{...a,mix:a.mix*(1-n.t)};if(i)return s.from===void 0?i:{...i,mix:i.mix*n.t}};if(t.length===0)return()=>{};let r=rt(t,e.parts,e.tokens.length);return o=>r[o]}function Yt(e,t){if(e>=1)return null;let n=1-le,r=1/(1+Math.max(0,t-1)*n);return o=>{let s=Math.min(1,Math.max(0,(e-o*r*n)/r));return{outlined:Math.min(1,s*2),filled:Math.max(0,s*2-1)}}}function nt(e,t,n,r=()=>1){t.tokens.forEach((o,s)=>{if(o.opacity<=0)return;let a=o.x!==0||o.y!==0?Tt(ye(o.path,o.x,o.y)):Tt(o.path),i=n(new oe().path({data:a,start:0,end:1*r(s),centerBounds:t.bounds}),o.opacity,s,o);i&&e.draw(i)})}function de(e,t,n=1){let r=K(e.parts,t)[Math.max(1,Math.round(n))-1];if(!r)return null;let o=se.bounds(e.tokens.slice(r[0],r[1]).flatMap(h=>h.path));if(!o)return null;let[s,a,i,u]=e.bounds,c=(s+i)/2,l=(a+u)/2;return{x:(o.minX+o.maxX)/2-c,y:l-(o.minY+o.maxY)/2,width:o.maxX-o.minX,height:o.maxY-o.minY}}var ot=new WeakMap;function q(e,t){return ot.set(e.node,t),e}function Ge(e){return ot.has(e.constructor)}function xe(e){let t=ot.get(e.constructor);if(!t)return null;let n=e;return S(t(n),n.fontSize,n.partFills)}function Ke(e,t,n=1){let r=xe(e);return r?de(r,t,n):void 0}function rt(e,t,n){let r=new Array(n);for(let o of e){if(o.part.trim()==="")continue;let s=K(t,o.part);for(let[a,i]of o.occurrence>0?s.slice(o.occurrence-1,o.occurrence):s)for(let u=a;u<i&&u<n;u++)r[u]=o}return r}function ge(e,t){return[{weight:e,fill:t,dashOffset:0,align:0,cap:"round",capScale:4,join:"round",miterLimit:4}]}function $(e,t){return t>=1?e:e.map(n=>({...n,opacity:(n.opacity??1)*t}))}function It(e,t){return t>=1?e:e.map(n=>({...n,fill:$(n.fill,t)}))}function ye(e,t,n){return e.map(r=>{let o=r,s={...o};return"x"in o&&(s.x=o.x+t),"y"in o&&(s.y=o.y+n),"x1"in o&&(s.x1=o.x1+t,s.y1=o.y1+n),"x2"in o&&(s.x2=o.x2+t,s.y2=o.y2+n),s})}import{component2d as be,Types as ke}from"@motionscript/sdk";var we={...X,latex:ke.custom("",{kind:"text",multiline:!0,lerp:O})},nn=q(be({key:"latex",state:we,defaults:{width:"hug",height:"hug"},load:e=>W(e),commands:{...R,morphTo:{args:["latex"]}},measure:(e,t)=>j(S(t.latex,t.fontSize,t.partFills),t),layout:(e,t,n)=>J(e,t,n),render:(e,t)=>z(e,t,S(t.latex,t.fontSize,t.partFills))}),e=>e.latex);import{component2d as Me,Types as st}from"@motionscript/sdk";var Nt={square:"bmatrix",round:"pmatrix",bar:"vmatrix",double:"Vmatrix",curly:"Bmatrix",none:"matrix"},Ce=["square","round","bar","double","curly","none"];function Te(e,t="square"){let n=e.filter(o=>Array.isArray(o)&&o.length>0);if(n.length===0)return"";let r=Nt[t]??Nt.square;return`\\begin{${r}} ${n.map(o=>o.join(" & ")).join(" \\\\ ")} \\end{${r}}`}function at(e){return Ot([e.entries,e.brackets],([t,n])=>Te(t,n))}var Fe={...X,latex:st.custom("",{kind:"text",multiline:!0,lerp:O}),entries:st.custom([["a","b"],["c","d"]],{lerp:O}),brackets:st.custom("square",{options:Ce,animatable:!1,lerp:O})},an=q(Me({key:"latexMatrix",state:Fe,defaults:{width:"hug",height:"hug"},load:e=>W(e),commands:{...R,morphTo:{args:["latex"]},entriesTo:{args:["entries"]}},measure:(e,t)=>j(S(at(t),t.fontSize,t.partFills),t),layout:(e,t,n)=>J(e,t,n),render:(e,t)=>z(e,t,S(at(t),t.fontSize,t.partFills))}),at);export{Y as a,ht as b,mt as c,Pe as d,dt as e,I as f,V as g,D as h,Se as i,K as j,_ as k,Ne as l,$e as m,Xe as n,bt as o,Be as p,wt as q,Mt as r,Ct as s,et as t,A as u,Ft as v,O as w,Ot as x,X as y,R as z,S as A,j as B,J as C,W as D,z as E,de as F,q as G,Ge as H,xe as I,Ke as J,nn as K,Te as L,an as M};
|
|
2
|
-
//# sourceMappingURL=chunk-WMVW6ZIV.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/kit/cache.ts", "../../../src/tex/geometry.ts", "../../../src/tex/tween.ts", "../../../src/kit/component.ts", "../../../src/kit/part-fills.ts", "../../../src/tex/typeset.ts", "../../../src/tex/node.ts", "../../../src/tex/matrix.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * A bounded, least-recently-used memo.\n *\n * Sits under `geometry.ts`, and imports nothing, so it is testable in bare Node:\n * everything else in this package reaches MathJax's browser adaptor at module\n * scope, which means a test that touches it needs a DOM. The one piece of logic\n * here worth being sure about — what gets thrown away when the memo is full —\n * is exactly the piece that does not need one.\n *\n * Least-recently-used rather than oldest-first, and that matters for the shape\n * of work this sees. A `Latex` node re-resolves its formula whenever `fontSize`\n * changes, so animating the size of one formula inserts a fresh key every frame\n * and would, under a first-in-first-out rule, walk the whole memo out of it in a\n * couple of seconds — including the entries for every *other* formula in the\n * scene, none of which had done anything wrong. Touching an entry on read keeps\n * the formulas that are actually being asked for ahead of the ones streaming\n * past.\n */\n\nexport interface BoundedCache<T> {\n get(key: string): T | undefined;\n set(key: string, value: T): void;\n /** Entries held. For tests and for anyone measuring. */\n readonly size: number;\n}\n\n/**\n * @param limit Most entries to hold. One more arriving evicts the least\n * recently read or written.\n */\nexport function createBoundedCache<T>(limit: number): BoundedCache<T> {\n // Insertion order is the eviction order, which is what makes a plain `Map`\n // an LRU as long as every read re-inserts.\n const entries = new Map<string, T>();\n\n return {\n get(key) {\n if (!entries.has(key)) return undefined;\n const value = entries.get(key) as T;\n // Delete-then-set moves the key to the end, so the next eviction\n // takes the genuinely coldest entry rather than the oldest one.\n entries.delete(key);\n entries.set(key, value);\n return value;\n },\n\n set(key, value) {\n entries.delete(key);\n entries.set(key, value);\n while (entries.size > limit) {\n const coldest = entries.keys().next().value;\n if (coldest === undefined) break;\n entries.delete(coldest);\n }\n },\n\n get size() {\n return entries.size;\n },\n };\n}\n", "\nimport { PathCommand } from '@motionscript/sdk';\n\nimport { createBoundedCache } from '../kit/cache';\n\n// --- MathJax, on demand ---\n\ntype MathJaxRuntime = typeof import('./mathjax');\n\nlet runtime: MathJaxRuntime | null = null;\nlet loading: Promise<void> | null = null;\n// MathJax's DOM, a real one or its own DOM-free tree: read only through its accessors, so its element type is opaque here.\nlet adaptor: any = null;\n\n/**\n * The asset key a node that typesets declares its loader under: the host waits\n * for it before laying the node out, and a scene with no formula never loads it.\n */\nexport const MATHJAX_LOADER = 'math:mathjax';\n\n/** Load MathJax, once. A host that typesets outside a scene (a tool, a test) awaits this first. */\nexport function loadMathJax(): Promise<void> {\n loading ??= import('./mathjax').then((module) => {\n runtime = module;\n adaptor = module.adaptor;\n });\n return loading;\n}\n\n/** Whether MathJax has loaded, so a formula can be typeset now. */\nexport function mathJaxLoaded(): boolean {\n return runtime !== null;\n}\n\n/** What a formula is before MathJax has loaded: nothing to draw, and nothing cached. */\nexport function blankLatex(): LatexPathResult {\n return { tokens: [], parts: [], commands: [], width: 0, height: 0, bounds: [0, 0, 0, 0] };\n}\n\n/** MathJax is not loaded yet: what typesetting throws before {@link loadMathJax} has resolved. */\nexport class LatexNotLoaded extends Error {\n constructor() {\n super('MathJax is not loaded: declare the math:mathjax loader, or await loadMathJax(), before typesetting.');\n this.name = 'LatexNotLoaded';\n }\n}\n\n// --- Public API ---\n\n/**\n * A formula MathJax could not typeset.\n *\n * MathJax does not throw on malformed TeX. It typesets an error box in place of\n * the formula and tags it `data-mjx-error`, so the failure arrives as a drawing:\n * nothing at all from the browser adaptor and a filled bar from the DOM-free\n * one, which left a host able to tell a bad formula from a blank one only by the\n * token count. {@link buildLatexPath} raises this instead, the same way under\n * both adaptors. `\\require` is an error too, since only the packages named above\n * are loaded.\n */\nexport class LatexError extends Error {\n /** The formula that failed, as it was given. */\n readonly latex: string;\n /** MathJax's own description of what is wrong with it. */\n readonly reason: string;\n\n constructor(latex: string, reason: string) {\n super(`Cannot typeset \"${latex}\": ${reason}`);\n this.name = 'LatexError';\n this.latex = latex;\n this.reason = reason;\n }\n}\n\n/** A single rendered glyph or shape with its character key and path commands. */\nexport interface LatexToken {\n /** Character this token represents, or a synthetic key for non-glyph shapes. */\n token: string;\n path: PathCommand[];\n /** The source of the top-level term the token belongs to, `a^2` in `a^2 + b^2`; empty for none. */\n term?: string;\n}\n\n/**\n * A piece of a formula as its source wrote it: `x^2`, `\\frac{d}{dx}`, a lone\n * `+`. Every group the typesetter makes is one, so parts nest.\n */\nexport interface LatexPart {\n /** The part's own source. */\n latex: string;\n /** The tokens it draws, as a span of the formula's token list: `from` up to, not including, `to`. */\n from: number;\n to: number;\n /** The index of the part it sits in, or -1 at the top. */\n parent: number;\n}\n\nexport interface LatexPathResult {\n /** All tokens in render order. */\n tokens: LatexToken[];\n /** Every part of the formula, outermost first, in source order. */\n parts: LatexPart[];\n /** Flat array of all path commands (for legacy single-path rendering). */\n commands: PathCommand[];\n width: number;\n height: number;\n /**\n * Bounding box over every token, in token coordinate space:\n * [minX, minY, maxX, maxY]. All tokens share this frame, so passing it as\n * each path's center frame keeps their relative layout (instead of each\n * glyph centering on its own bbox).\n */\n bounds: [number, number, number, number];\n}\n\n/**\n * A formula's glyph geometry, before a type size is applied to it.\n *\n * The dividing line this whole module's caching turns on. Getting here is the\n * expensive part — MathJax lays the formula out, then the SVG it produces is\n * parsed, its glyph dictionary resolved and every `<use>` walked through its\n * transform stack — and **none of it depends on `fontSize`**: `mjDoc.convert`\n * is called at a fixed em/ex, and the size arrives at the very end as one\n * uniform scale (see {@link scaleLatexGeometry}).\n *\n * So this is what gets remembered per formula, and the size is applied to it\n * afresh. A formula animating from 24pt to 120pt is one trip through MathJax\n * and one DOM parse, not one per frame.\n */\ninterface LatexGeometry {\n tokens: RawToken[];\n parts: LatexPart[];\n /** Box over every command, in the SVG's own coordinates. */\n box: { minX: number; minY: number; maxX: number; maxY: number };\n /** The formula's height in `ex`, as MathJax reported it. */\n heightEx: number;\n}\n\n/**\n * Formulas already worked out, and formulas already sized.\n *\n * `buildLatexPath` is a pure function of `(text, fontSize)` and used to have no\n * memory, which made every caller pay full price for a question it had already\n * asked. The callers are not occasional about it either: constructing a `Latex`\n * resolves its formula, and so does every `to({ latex })` the moment it starts,\n * so a scene re-resolves every formula in it whenever it is rebuilt *and*\n * whenever the playhead moves backwards, since a backward seek replays the\n * scene's generator from its first frame. An editor that rebuilds on a keystroke\n * and seeks on a click asks for the same handful of formulas hundreds of times.\n *\n * Two memos, each keyed by what its stage actually depends on, and deliberately\n * different sizes:\n *\n * - {@link geometryCache} is everything up to the type size, keyed by the text\n * alone. This is the expensive one, and it is generously sized because\n * nothing a scene does can churn it: a deck holds as many distinct formulas\n * as it holds, and it holds them for as long as it is open.\n * - {@link pathCache} is the finished result, keyed by text *and* size. Small\n * on purpose: an animated `fontSize` inserts a distinct key every frame, and\n * the right thing for a stream like that is to churn a little memo rather\n * than a big one. What a miss costs here is arithmetic over glyphs already\n * worked out — no MathJax, no parse.\n */\nconst geometryCache = createBoundedCache<LatexGeometry>(128);\nconst pathCache = createBoundedCache<LatexPathResult>(64);\n\nexport function buildLatexPath(text: string, fontSize: number): LatexPathResult {\n // NUL rather than a punctuation separator, so no formula can spell a key\n // belonging to another size.\n const key = `${fontSize}\\0${text}`;\n\n const hit = pathCache.get(key);\n if (hit) return lend(hit);\n\n let geometry = geometryCache.get(text);\n if (!geometry) {\n geometry = buildLatexGeometry(text);\n geometryCache.set(text, geometry);\n }\n\n const result = scaleLatexGeometry(geometry, fontSize);\n pathCache.set(key, result);\n return lend(result);\n}\n\n/** Typeset `text` and reduce the SVG MathJax returns to glyph geometry. */\nfunction buildLatexGeometry(text: string): LatexGeometry {\n if (!runtime) throw new LatexNotLoaded();\n const svgEl = adaptor.firstChild(runtime.convert(text));\n const failure = mathJaxError(svgEl);\n if (failure !== null) throw new LatexError(text, failure);\n\n const heightAttr = adaptor.getAttribute(svgEl, 'height') ?? '';\n\n return parseLatexSvg(svgEl, parseFloat(heightAttr) || 0);\n}\n\n/**\n * MathJax's description of the error box in a typeset formula, or `null` when\n * there is none. Read through the adaptor, so a real DOM and the DOM-free tree\n * give the same answer.\n */\nfunction mathJaxError(svgEl: unknown): string | null {\n for (const el of adaptor.tags(svgEl, 'g') as unknown[]) {\n const reason = adaptor.getAttribute(el, 'data-mjx-error');\n if (reason !== null && reason !== undefined) return String(reason) || 'unknown error';\n }\n return null;\n}\n\n/**\n * A cached result, handed out safely.\n *\n * `tokens`, `commands` and the path arrays inside them are shared: they are read\n * by everything downstream and written by none of it — `Latex` maps tokens into\n * its own wrappers, and the morph builds new paths rather than editing the ones\n * it is given — so copying them would be copying the whole formula for nothing.\n *\n * `bounds` is copied, because it is the one field a caller *stores*: `Latex`\n * assigns `result.bounds` straight to `this._bounds` and hands it to the\n * renderer as a shared centring frame. That was one node holding its own array\n * before there was a memo, and would be two nodes drawing the same formula\n * holding one array between them after — four numbers is not a price worth\n * paying to find out whether anything downstream ever writes to it.\n */\nfunction lend(result: LatexPathResult): LatexPathResult {\n const [minX, minY, maxX, maxY] = result.bounds;\n return { ...result, bounds: [minX, minY, maxX, maxY] };\n}\n\n// --- High-Speed Matrix Math ---\n\ntype Matrix = [number, number, number, number, number, number]; // [a, b, c, d, tx, ty]\nconst identityMatrix: Matrix = [1, 0, 0, 1, 0, 0];\n\nfunction multiplyMatrix(m1: Matrix, m2: Matrix): Matrix {\n return [\n m1[0] * m2[0] + m1[2] * m2[1],\n m1[1] * m2[0] + m1[3] * m2[1],\n m1[0] * m2[2] + m1[2] * m2[3],\n m1[1] * m2[2] + m1[3] * m2[3],\n m1[0] * m2[4] + m1[2] * m2[5] + m1[4],\n m1[1] * m2[4] + m1[3] * m2[5] + m1[5],\n ];\n}\n\nfunction parseTransform(str: string | null): Matrix {\n if (!str) return identityMatrix;\n let m: Matrix = [...identityMatrix];\n const re = /([a-z]+)\\(([^)]+)\\)/g;\n let match;\n while ((match = re.exec(str)) !== null) {\n const type = match[1];\n const args = match[2].split(/[ ,]+/).map(parseFloat);\n if (type === 'translate') {\n m = multiplyMatrix(m, [1, 0, 0, 1, args[0] || 0, args[1] || 0]);\n } else if (type === 'scale') {\n const sx = args[0] || 1;\n const sy = args[1] !== undefined ? args[1] : sx;\n m = multiplyMatrix(m, [sx, 0, 0, sy, 0, 0]);\n } else if (type === 'matrix') {\n m = multiplyMatrix(m, [args[0], args[1], args[2], args[3], args[4], args[5]]);\n }\n }\n return m;\n}\n\nfunction applyMatrix(x: number, y: number, m: Matrix): [number, number] {\n return [\n x * m[0] + y * m[2] + m[4],\n x * m[1] + y * m[3] + m[5],\n ];\n}\n\n// --- Glyph ID → character decoding ---\n\n/**\n * MathJax SVG glyph IDs look like \"MJX-1-TEX-N-78\" or \"MJX-1-TEX-I-1D465\".\n * The last segment is the Unicode codepoint in hex.\n */\nfunction glyphIdToChar(id: string): string {\n const parts = id.split('-');\n const hex = parts[parts.length - 1];\n const cp = parseInt(hex, 16);\n if (!isNaN(cp)) {\n try { return String.fromCodePoint(cp); } catch { /* fall through */ }\n }\n return id;\n}\n\n// --- Core Fast Traversal Engine ---\n\ntype RawToken = { token: string; cmds: Array<{ cmd: string; args: number[] }>; term?: string };\n\n/** The tag name of a node's parent, or \"\" at the root. */\nfunction parentKind(node: unknown): string {\n const parent = adaptor.parent(node);\n return parent ? String(adaptor.kind(parent)).toLowerCase() : \"\";\n}\n\n/**\n * The size-independent half: MathJax's own SVG tree in, glyph geometry out.\n *\n * Walked through the **adaptor** rather than a `DOMParser`. MathJax already\n * builds this tree, and the adaptor is its own abstraction over \"a real DOM\" and\n * \"the DOM-free `LiteElement` tree\" — the two this module already picks between\n * at load. Serialising it to a string and parsing it back needed a `DOMParser`,\n * which Node does not have, so every LaTeX node threw `DOMParser is not defined`\n * and could not render headlessly at all: no export, and nothing the visual\n * suite could check.\n *\n * Reading the tree directly is also one representation instead of three (tree →\n * string → tree), so a browser and a headless host cannot disagree about how the\n * markup re-parsed.\n */\nfunction parseLatexSvg(svgEl: unknown, heightEx: number): LatexGeometry {\n // Pre-parse the glyph dictionary. `tags` reaches every <path> in the tree,\n // including the ones inside <defs> that the `use` elements reference.\n const glyphMap = new Map<string, Array<{ cmd: string; args: number[] }>>();\n for (const el of adaptor.tags(svgEl, 'path') as unknown[]) {\n const id = adaptor.getAttribute(el, 'id');\n const d = adaptor.getAttribute(el, 'd');\n if (id && d) {\n glyphMap.set(`#${id}`, expandToAbsolute(tokenisePath(d)));\n }\n }\n\n // Collect raw tokens — each <use> is one token, rects/paths are grouped as synthetic tokens\n const rawTokens: RawToken[] = [];\n const parts: LatexPart[] = [];\n let synthIdx = 0;\n\n function pushCmds(token: string, cmds: Array<{ cmd: string; args: number[] }>) {\n rawTokens.push({ token, cmds });\n }\n\n function traverse(node: unknown, currentMatrix: Matrix, within: number) {\n let nodeMatrix = currentMatrix;\n\n const transformStr = adaptor.getAttribute(node, \"transform\");\n if (transformStr) {\n nodeMatrix = multiplyMatrix(nodeMatrix, parseTransform(transformStr));\n }\n\n const nodeName = String(adaptor.kind(node)).toLowerCase();\n\n // MathJax tags each group with the source it typeset; the root's is the whole formula.\n let part = within;\n const source = nodeName === \"g\" ? adaptor.getAttribute(node, \"data-latex\") : null;\n if (source && adaptor.getAttribute(node, \"data-mml-node\") !== \"math\") {\n part = parts.length;\n parts.push({ latex: String(source), from: rawTokens.length, to: rawTokens.length, parent: within });\n }\n\n if (nodeName === \"use\") {\n const href = adaptor.getAttribute(node, \"href\") || adaptor.getAttribute(node, \"xlink:href\");\n const x = parseFloat(adaptor.getAttribute(node, \"x\") || \"0\");\n const y = parseFloat(adaptor.getAttribute(node, \"y\") || \"0\");\n\n if (href && glyphMap.has(href)) {\n const glyphCommands = glyphMap.get(href)!;\n const cmds: Array<{ cmd: string; args: number[] }> = [];\n for (const gc of glyphCommands) {\n const shiftedArgs = [...gc.args];\n for (let j = 0; j < shiftedArgs.length; j += 2) {\n const [nx, ny] = applyMatrix(shiftedArgs[j] + x, shiftedArgs[j + 1] + y, nodeMatrix);\n shiftedArgs[j] = nx;\n shiftedArgs[j + 1] = ny;\n }\n cmds.push({ cmd: gc.cmd, args: shiftedArgs });\n }\n // Derive character from glyph ID\n const rawId = href.startsWith('#') ? href.slice(1) : href;\n pushCmds(glyphIdToChar(rawId), cmds);\n }\n } else if (nodeName === \"rect\") {\n const x = parseFloat(adaptor.getAttribute(node, \"x\") || \"0\");\n const y = parseFloat(adaptor.getAttribute(node, \"y\") || \"0\");\n const w = parseFloat(adaptor.getAttribute(node, \"width\") || \"0\");\n const h = parseFloat(adaptor.getAttribute(node, \"height\") || \"0\");\n\n if (w > 0 && h > 0) {\n const pts = [[x, y], [x + w, y], [x + w, y + h], [x, y + h]];\n const tp = pts.map(p => applyMatrix(p[0], p[1], nodeMatrix));\n pushCmds(`__rect_${synthIdx++}`, [\n { cmd: 'M', args: [tp[0][0], tp[0][1]] },\n { cmd: 'L', args: [tp[1][0], tp[1][1]] },\n { cmd: 'L', args: [tp[2][0], tp[2][1]] },\n { cmd: 'L', args: [tp[3][0], tp[3][1]] },\n { cmd: 'Z', args: [] },\n ]);\n }\n } else if (nodeName === \"path\" && parentKind(node) !== \"defs\") {\n const d = adaptor.getAttribute(node, \"d\");\n if (d) {\n const abs = expandToAbsolute(tokenisePath(d));\n const cmds: Array<{ cmd: string; args: number[] }> = [];\n for (const gc of abs) {\n const shiftedArgs = [...gc.args];\n for (let j = 0; j < shiftedArgs.length; j += 2) {\n const [nx, ny] = applyMatrix(shiftedArgs[j], shiftedArgs[j + 1], nodeMatrix);\n shiftedArgs[j] = nx;\n shiftedArgs[j + 1] = ny;\n }\n cmds.push({ cmd: gc.cmd, args: shiftedArgs });\n }\n pushCmds(`__path_${synthIdx++}`, cmds);\n }\n }\n\n for (const child of adaptor.childNodes(node) as unknown[]) {\n // A text node's kind is \"#text\"; only elements carry geometry, and\n // <defs> holds the dictionary rather than anything drawn.\n const kind = String(adaptor.kind(child)).toLowerCase();\n if (kind.startsWith(\"#\") || kind === \"defs\") continue;\n traverse(child, nodeMatrix, part);\n }\n if (part !== within) parts[part].to = rawTokens.length;\n }\n\n traverse(svgEl, identityMatrix, -1);\n\n for (const part of parts) {\n if (part.parent !== -1) continue;\n for (let i = part.from; i < part.to; i++) rawTokens[i].term = part.latex;\n }\n\n // Bounding box across all raw commands, in the SVG's own coordinates.\n const box = svgBBox(rawTokens.flatMap(t => t.cmds));\n return { tokens: rawTokens, parts, box, heightEx };\n}\n\n/**\n * The size-dependent half: glyph geometry in, a laid-out formula out.\n *\n * Everything here is one uniform scale about the geometry's own centre, which\n * is exactly why {@link LatexGeometry} is worth remembering on its own.\n */\nfunction scaleLatexGeometry(geometry: LatexGeometry, fontSize: number): LatexPathResult {\n const { tokens: rawTokens, parts, box, heightEx } = geometry;\n if (rawTokens.length === 0) return { tokens: [], parts: [], commands: [], width: 0, height: 0, bounds: [0, 0, 0, 0] };\n\n const { minX, minY, maxX, maxY } = box;\n const svgW = maxX - minX;\n const svgH = maxY - minY;\n\n let scale: number;\n if (heightEx > 0 && svgH > 0) {\n const exInCoords = svgH / heightEx;\n scale = fontSize / (2 * exInCoords);\n } else {\n scale = svgH > 0 ? fontSize / svgH : 1;\n }\n\n const ocx = (minX + maxX) / 2;\n const ocy = (minY + maxY) / 2;\n\n const tx = (svgX: number) => (svgX - ocx) * scale;\n const ty = (svgY: number) => (svgY - ocy) * scale;\n\n function rawCmdsToPathCommands(cmds: Array<{ cmd: string; args: number[] }>): PathCommand[] {\n const out: PathCommand[] = [];\n for (const { cmd, args: a } of cmds) {\n switch (cmd) {\n case 'M': out.push({ type: 'M', x: tx(a[0]), y: ty(a[1]) }); break;\n case 'L': out.push({ type: 'L', x: tx(a[0]), y: ty(a[1]) }); break;\n case 'Q': out.push({ type: 'Q', x1: tx(a[0]), y1: ty(a[1]), x: tx(a[2]), y: ty(a[3]) }); break;\n case 'C': out.push({ type: 'C', x1: tx(a[0]), y1: ty(a[1]), x2: tx(a[2]), y2: ty(a[3]), x: tx(a[4]), y: ty(a[5]) }); break;\n case 'Z': out.push({ type: 'Z' }); break;\n }\n }\n return out;\n }\n\n const tokens: LatexToken[] = rawTokens.map(rt => ({\n token: rt.token,\n path: rawCmdsToPathCommands(rt.cmds),\n ...(rt.term !== undefined && { term: rt.term }),\n }));\n\n const commands = tokens.flatMap(t => t.path);\n\n // Shared center frame for all tokens, in token coordinate space. tx/ty map\n // the SVG bbox corners; this is the frame every token's path is laid out in.\n const bounds: [number, number, number, number] = [\n tx(minX), ty(minY), tx(maxX), ty(maxY),\n ];\n\n return { tokens, parts, commands, width: svgW * scale, height: svgH * scale, bounds };\n}\n\n// --- Parts ---\n\n// Spacing and grouping braces are how a source is written, not what it says:\n// `x^{2}` and `x^2` name one part.\nfunction partKey(latex: string): string {\n return latex.replace(/[\\s{}]/g, \"\");\n}\n\n/**\n * The sources of a formula's parts, each once, in the order written: what a\n * host offers to pick a part from. Empty for a formula that will not typeset.\n */\nexport function latexPartNames(source: string): string[] {\n if (source.trim() === \"\") return [];\n let parts: LatexPart[];\n try {\n parts = buildLatexPath(source, 16).parts;\n } catch {\n return [];\n }\n const seen = new Set<string>();\n const names: string[] = [];\n for (const part of parts) {\n const key = partKey(part.latex);\n if (part.to <= part.from || key === \"\" || seen.has(key)) continue;\n seen.add(key);\n names.push(part.latex);\n }\n return names;\n}\n\n/**\n * The token spans `selector` names in a formula, in source order: every part\n * whose source it is, and every run of neighbouring parts that spell it\n * together (`b^2 = c^2` in `a^2 + b^2 = c^2`). Empty when it names nothing.\n */\nexport function findLatexParts(parts: readonly LatexPart[], selector: string): Array<[from: number, to: number]> {\n const wanted = partKey(selector);\n if (wanted === \"\") return [];\n const found = new Map<string, [number, number]>();\n const keep = (from: number, to: number) => {\n if (to > from) found.set(`${from}:${to}`, [from, to]);\n };\n const children = new Map<number, number[]>();\n parts.forEach((part, i) => {\n if (partKey(part.latex) === wanted) keep(part.from, part.to);\n const siblings = children.get(part.parent);\n if (siblings) siblings.push(i);\n else children.set(part.parent, [i]);\n });\n for (const siblings of children.values()) {\n for (let a = 0; a < siblings.length; a++) {\n let spelled = \"\";\n for (let b = a; b < siblings.length && spelled.length < wanted.length; b++) {\n spelled += partKey(parts[siblings[b]].latex);\n if (b > a && spelled === wanted) keep(parts[siblings[a]].from, parts[siblings[b]].to);\n }\n }\n }\n return [...found.values()].sort((x, y) => x[0] - y[0] || x[1] - y[1]);\n}\n\n// --- SVG Path Utilities ---\n\ntype RawCmd = { cmd: string; args: number[] };\n\nfunction tokenisePath(d: string): RawCmd[] {\n const re = /([MmLlHhVvCcSsQqTtAaZz])|([+-]?(?:\\d+\\.?\\d*|\\.\\d+)(?:[eE][+-]?\\d+)?)/g;\n const out: RawCmd[] = [];\n let cur: RawCmd | null = null;\n let m: RegExpExecArray | null;\n while ((m = re.exec(d)) !== null) {\n if (m[1]) { cur = { cmd: m[1], args: [] }; out.push(cur); }\n else if (cur) cur.args.push(parseFloat(m[2]));\n }\n return out;\n}\n\nfunction argCount(cmd: string): number {\n switch (cmd.toUpperCase()) {\n case 'M': return 2; case 'L': return 2; case 'H': return 1; case 'V': return 1;\n case 'C': return 6; case 'S': return 4; case 'Q': return 4; case 'T': return 2;\n case 'A': return 7; case 'Z': return 0; default: return 0;\n }\n}\n\ninterface Pt { x: number; y: number }\n\nfunction expandToAbsolute(raw: RawCmd[]): Array<{ cmd: string; args: number[] }> {\n const out: Array<{ cmd: string; args: number[] }> = [];\n let cx = 0, cy = 0;\n let mx = 0, my = 0;\n let prevCmd = '';\n let prevCtrl: Pt = { x: 0, y: 0 };\n\n for (const { cmd, args } of raw) {\n const up = cmd.toUpperCase();\n const rel = cmd === cmd.toLowerCase() && up !== 'Z';\n const n = argCount(up);\n const reps = n === 0 ? 1 : Math.max(1, Math.ceil(args.length / n));\n\n for (let r = 0; r < reps; r++) {\n const a = args.slice(r * n, r * n + n);\n const absX = (i: number) => rel ? a[i] + cx : a[i];\n const absY = (i: number) => rel ? a[i] + cy : a[i];\n\n switch (up) {\n case 'M': {\n const x = absX(0), y = absY(1);\n const emitCmd = r === 0 ? 'M' : 'L';\n out.push({ cmd: emitCmd, args: [x, y] });\n cx = x; cy = y;\n if (r === 0) { mx = x; my = y; }\n prevCmd = emitCmd;\n prevCtrl = { x: cx, y: cy };\n break;\n }\n case 'Z':\n out.push({ cmd: 'Z', args: [] });\n cx = mx; cy = my;\n prevCmd = 'Z';\n break;\n case 'L': {\n const x = absX(0), y = absY(1);\n out.push({ cmd: 'L', args: [x, y] });\n cx = x; cy = y;\n prevCmd = 'L';\n prevCtrl = { x: cx, y: cy };\n break;\n }\n case 'H': {\n const x = rel ? a[0] + cx : a[0];\n out.push({ cmd: 'L', args: [x, cy] });\n cx = x;\n prevCmd = 'L';\n prevCtrl = { x: cx, y: cy };\n break;\n }\n case 'V': {\n const y = rel ? a[0] + cy : a[0];\n out.push({ cmd: 'L', args: [cx, y] });\n cy = y;\n prevCmd = 'L';\n prevCtrl = { x: cx, y: cy };\n break;\n }\n case 'C': {\n const x1 = absX(0), y1 = absY(1);\n const x2 = absX(2), y2 = absY(3);\n const x = absX(4), y = absY(5);\n out.push({ cmd: 'C', args: [x1, y1, x2, y2, x, y] });\n prevCtrl = { x: x2, y: y2 };\n cx = x; cy = y;\n prevCmd = 'C';\n break;\n }\n case 'S': {\n const x1 = prevCmd === 'C' || prevCmd === 'S' ? 2 * cx - prevCtrl.x : cx;\n const y1 = prevCmd === 'C' || prevCmd === 'S' ? 2 * cy - prevCtrl.y : cy;\n const x2 = absX(0), y2 = absY(1);\n const x = absX(2), y = absY(3);\n out.push({ cmd: 'C', args: [x1, y1, x2, y2, x, y] });\n prevCtrl = { x: x2, y: y2 };\n cx = x; cy = y;\n prevCmd = 'S';\n break;\n }\n case 'Q': {\n const x1 = absX(0), y1 = absY(1);\n const x = absX(2), y = absY(3);\n out.push({ cmd: 'Q', args: [x1, y1, x, y] });\n prevCtrl = { x: x1, y: y1 };\n cx = x; cy = y;\n prevCmd = 'Q';\n break;\n }\n case 'T': {\n const x1 = prevCmd === 'Q' || prevCmd === 'T' ? 2 * cx - prevCtrl.x : cx;\n const y1 = prevCmd === 'Q' || prevCmd === 'T' ? 2 * cy - prevCtrl.y : cy;\n const x = absX(0), y = absY(1);\n out.push({ cmd: 'Q', args: [x1, y1, x, y] });\n prevCtrl = { x: x1, y: y1 };\n cx = x; cy = y;\n prevCmd = 'T';\n break;\n }\n }\n }\n }\n\n if (out.length > 0 && out[out.length - 1].cmd !== 'Z') {\n out.push({ cmd: 'Z', args: [] });\n }\n\n return out;\n}\n\nfunction svgBBox(abs: Array<{ cmd: string; args: number[] }>): { minX: number; minY: number; maxX: number; maxY: number } {\n let minX = Infinity, minY = Infinity, maxX = -Infinity, maxY = -Infinity;\n const touch = (x: number, y: number) => {\n if (x < minX) minX = x; if (x > maxX) maxX = x;\n if (y < minY) minY = y; if (y > maxY) maxY = y;\n };\n for (const { cmd, args } of abs) {\n switch (cmd) {\n case 'M': case 'L': touch(args[0], args[1]); break;\n case 'C': touch(args[0], args[1]); touch(args[2], args[3]); touch(args[4], args[5]); break;\n case 'Q': touch(args[0], args[1]); touch(args[2], args[3]); break;\n }\n }\n return { minX, minY, maxX, maxY };\n}\n", "import { lerpNumber, type PathCommand } from \"@motionscript/sdk\";\nimport type { LatexToken } from \"./geometry\";\n\nexport interface AnimatedToken {\n token: string;\n path: LatexToken[\"path\"];\n /** The top-level term it belongs to at rest; a morph matches on it. */\n term?: string;\n /** 0 = invisible, 1 = fully visible */\n opacity: number;\n /** Interpolated position offset applied during morph (x, y in formula space). */\n x: number;\n y: number;\n /** Mid-morph: the index of the token it was in the formula left, and of the one it becomes. */\n from?: number;\n to?: number;\n}\n\n/**\n * How a `Latex` node interpolates between two formulas: given the tokens it\n * currently holds and the tokens the target formula resolves to, return a\n * pure `t → AnimatedToken[]` frame function. `prepareLatexTween` below is the\n * default implementation (exported as `defaultLatexMorph`) — pass a `morph`\n * of this shape to `<Latex>` to replace it with your own.\n */\nexport type LatexMorphStrategy = (from: LatexToken[], to: LatexToken[]) => (t: number) => AnimatedToken[];\n\n/** The coordinate pairs a `PathCommand` can carry, as (x, y) field names. */\nconst POINT_FIELDS = [[\"x\", \"y\"], [\"x1\", \"y1\"], [\"x2\", \"y2\"]] as const;\n\n/**\n * Compute the centroid of a token's path for position-based interpolation.\n */\nfunction centroid(path: LatexToken[\"path\"]): { x: number; y: number } {\n let sx = 0, sy = 0, n = 0;\n for (const cmd of path) {\n if (\"x\" in cmd && \"y\" in cmd) {\n sx += (cmd as any).x;\n sy += (cmd as any).y;\n n++;\n }\n }\n return n > 0 ? { x: sx / n, y: sy / n } : { x: 0, y: 0 };\n}\n\n/**\n * A glyph's on-screen extent, as the diagonal of its control-point bbox.\n *\n * Only ever used as a *ratio* between the two ends of a match, so the fact that\n * control points overshoot the true outline doesn't matter: both ends overshoot\n * by the same proportion, because they are the same outline.\n */\nfunction extent(path: LatexToken[\"path\"]): number {\n let minX = Infinity, minY = Infinity, maxX = -Infinity, maxY = -Infinity;\n for (const cmd of path) {\n const c = cmd as any;\n for (const [kx, ky] of POINT_FIELDS) {\n if (kx in c) {\n if (c[kx] < minX) minX = c[kx];\n if (c[kx] > maxX) maxX = c[kx];\n if (c[ky] < minY) minY = c[ky];\n if (c[ky] > maxY) maxY = c[ky];\n }\n }\n }\n if (minX > maxX) return 0;\n return Math.hypot(maxX - minX, maxY - minY);\n}\n\n/**\n * Whether two paths can be interpolated point by point: same command count,\n * same command types in the same order.\n *\n * For a matched pair this is the overwhelmingly common case, and not by luck.\n * Tokens are matched on the character their MathJax glyph id decodes to, and\n * that id *is* the key into the `<defs>` dictionary — so the same character in\n * two formulas is the same outline, emitted twice under two different\n * transforms. Same commands, different numbers.\n */\nfunction isPointwiseCompatible(from: PathCommand[], to: PathCommand[]): boolean {\n if (from.length !== to.length) return false;\n for (let i = 0; i < from.length; i++) {\n if (from[i].type !== to[i].type) return false;\n }\n return true;\n}\n\n/**\n * Lerp two structurally identical paths point by point.\n *\n * When the two ends are the same outline under two affine transforms — which is\n * what a matched glyph is — this is exact at both ends *and* correct in\n * between: `(1-t)·A·q + t·B·q = ((1-t)A + tB)·q`, and a blend of two\n * uniform-scale-plus-translate transforms is another one. The intermediate is a\n * properly formed glyph at an intermediate size, not a smeared one.\n */\nfunction lerpPath(from: PathCommand[], to: PathCommand[], t: number): PathCommand[] {\n const out: PathCommand[] = new Array(from.length);\n for (let i = 0; i < from.length; i++) {\n const f = from[i] as any;\n const g = to[i] as any;\n const c: any = { ...g };\n for (const [kx, ky] of POINT_FIELDS) {\n if (kx in g && kx in f) {\n c[kx] = lerpNumber(f[kx], g[kx], t);\n c[ky] = lerpNumber(f[ky], g[ky], t);\n }\n }\n out[i] = c as PathCommand;\n }\n return out;\n}\n\n/**\n * Scale a path uniformly about (cx, cy), then translate by (dx, dy).\n *\n * The fallback for a matched pair whose paths *aren't* structurally identical —\n * a stretchy delimiter assembled from a different number of pieces at the two\n * sizes, say. Point-by-point lerping is impossible there, so the target outline\n * is shrunk to the source's size instead and grown back over the morph: the\n * size still changes continuously, which is the whole point, at the cost of\n * showing the target's shape from the start.\n */\nfunction scaleAbout(\n path: PathCommand[],\n cx: number,\n cy: number,\n s: number,\n dx: number,\n dy: number,\n): PathCommand[] {\n return path.map(cmd => {\n const c: any = { ...(cmd as any) };\n for (const [kx, ky] of POINT_FIELDS) {\n if (kx in c) {\n c[kx] = cx + (c[kx] - cx) * s + dx;\n c[ky] = cy + (c[ky] - cy) * s + dy;\n }\n }\n return c as PathCommand;\n });\n}\n\n/**\n * Match tokens from `from` to `to` by character key, a term that both formulas\n * write first: the `x^2` of `x^2 + 1` travels to the `x^2` of `y = x^2` as\n * one, instead of lending its `2` to whichever `2` comes first. What is left\n * is matched greedily by character alone.\n * Returns three lists: matched pairs, deleted tokens (only in from), added tokens (only in to).\n */\nfunction matchTokens(\n from: LatexToken[],\n to: LatexToken[],\n): {\n matched: Array<{ from: LatexToken; to: LatexToken }>;\n deleted: LatexToken[];\n added: LatexToken[];\n} {\n const remaining = [...to];\n const partner = new Map<LatexToken, LatexToken>();\n // Synthetic shapes (rects/paths) have no natural token key.\n const keyed = (t: LatexToken) => !t.token.startsWith(\"__\");\n const pair = (same: (f: LatexToken, t: LatexToken) => boolean) => {\n for (const ft of from) {\n if (!keyed(ft) || partner.has(ft)) continue;\n const idx = remaining.findIndex(t => keyed(t) && same(ft, t));\n if (idx === -1) continue;\n partner.set(ft, remaining[idx]);\n remaining.splice(idx, 1);\n }\n };\n pair((f, t) => f.token === t.token && f.term !== undefined && f.term === t.term);\n pair((f, t) => f.token === t.token);\n\n const matched: Array<{ from: LatexToken; to: LatexToken }> = [];\n const deleted: LatexToken[] = [];\n for (const ft of from) {\n const tt = partner.get(ft);\n if (tt) matched.push({ from: ft, to: tt });\n else deleted.push(ft);\n }\n\n return { matched, deleted, added: remaining };\n}\n\n/**\n * Precompute a formula-change morph and return a pure `t → AnimatedToken[]`\n * frame function:\n * - Deleted tokens fade out over the first half of `t`.\n * - Matched tokens are interpolated — place *and* size — across the full range\n * of `t`.\n * - Added tokens fade in over the second half of `t`.\n *\n * A matched glyph is rarely the same size at both ends: the `2` of `b^2` is set\n * at script size and the `2` of `2a` at full size, and a `\\frac`'s arguments\n * come back a step smaller than the same symbols on a baseline. So the\n * interpolation has to carry the glyph's *geometry*, not just where it sits.\n * Sliding the target outline from one centroid to the other — which is all this\n * used to do — put the whole size change between the last static frame and the\n * morph's first one: a snap to the new size, then a smooth glide to the new\n * place. Point-by-point lerping (see {@link lerpPath}) is that same\n * interpolation generalised from a glyph's average point to all of them, and it\n * costs nothing extra — the path was already being rebuilt every frame to apply\n * the slide.\n *\n * `t` is normalized `[0, 1]` and already eased — the caller (a `Command`'s\n * `at`) applies easing once, up front, the same eased value driving every\n * concurrent aspect of the morph (props, intrinsic size, tokens) in lockstep.\n */\nexport function prepareLatexTween(\n from: LatexToken[],\n to: LatexToken[],\n): (t: number) => AnimatedToken[] {\n const { matched, deleted, added } = matchTokens(from, to);\n\n // Per-match interpolation data. Structure compatibility, and the centroids\n // and extents behind the fallback, are properties of the pair rather than\n // of `t`, so they are settled once here instead of at every frame.\n const fromIndex = new Map(from.map((token, i) => [token, i]));\n const toIndex = new Map(to.map((token, i) => [token, i]));\n const matchedData = matched.map(({ from: f, to: t }) => {\n const toExtent = extent(t.path);\n return {\n from: fromIndex.get(f),\n to: toIndex.get(t),\n pointwise: isPointwiseCompatible(f.path, t.path),\n fromPath: f.path,\n toPath: t.path,\n token: t.token,\n fromCenter: centroid(f.path),\n toCenter: centroid(t.path),\n /** Only the fallback needs it, and only as a ratio. */\n fromScale: toExtent > 0 ? extent(f.path) / toExtent : 1,\n };\n });\n\n return (t: number): AnimatedToken[] => {\n const tokens: AnimatedToken[] = [];\n\n // Matched tokens: interpolate place and size across the full duration.\n for (const m of matchedData) {\n if (m.pointwise) {\n tokens.push({\n token: m.token,\n path: lerpPath(m.fromPath, m.toPath, t),\n opacity: 1,\n // Baked into the path above: the lerp carries every point,\n // which includes where the glyph sits.\n x: 0,\n y: 0,\n from: m.from,\n to: m.to,\n });\n continue;\n }\n\n const s = lerpNumber(m.fromScale, 1, t);\n const cx = lerpNumber(m.fromCenter.x, m.toCenter.x, t);\n const cy = lerpNumber(m.fromCenter.y, m.toCenter.y, t);\n tokens.push({\n token: m.token,\n path: scaleAbout(\n m.toPath,\n m.toCenter.x,\n m.toCenter.y,\n s,\n cx - m.toCenter.x,\n cy - m.toCenter.y,\n ),\n opacity: 1,\n x: 0,\n y: 0,\n from: m.from,\n to: m.to,\n });\n }\n\n // Deleted tokens: fade out over the first half, gone by t=0.5\n for (const d of deleted) {\n const fadeT = Math.min(t * 2, 1);\n tokens.push({\n token: d.token,\n path: d.path,\n opacity: lerpNumber(1, 0, fadeT),\n x: 0,\n y: 0,\n from: fromIndex.get(d),\n });\n }\n\n // Added tokens: fade in over the second half, starting at t=0.5\n for (const a of added) {\n const fadeT = Math.max(t * 2 - 1, 0);\n tokens.push({\n token: a.token,\n path: a.path,\n opacity: lerpNumber(0, 1, fadeT),\n x: 0,\n y: 0,\n to: toIndex.get(a),\n });\n }\n\n return tokens;\n };\n}\n\nexport { prepareLatexTween as defaultLatexMorph };\n", "import {\n Paint,\n Types,\n type EntryOptions,\n type RenderContext,\n type Type,\n // Named so the emitted declaration reaches these through the sdk, not core.\n type Fill as _Fill,\n type FillResolved as _FillResolved,\n type Shadow as _Shadow,\n type ShadowResolved as _ShadowResolved,\n type Stroke as _Stroke,\n type StrokeResolved as _StrokeResolved,\n} from \"@motionscript/sdk\";\n\n/**\n * What a component in this kit shares beyond the factory: the paints a math\n * node draws with, listed choices, and the order a node paints in.\n */\n\nconst { overlay: _overlay, ...paint } = Paint.state;\nconst { overlayTo: _overlayTo, ...paintCommands } = Paint.commands;\n\n/** A math node's paints: fill, stroke, shadow and the outline trim, with no overlay. */\nexport const PAINT = paint;\nexport const PAINT_COMMANDS = paintCommands;\n\n/**\n * One of `values`, held as text with its choices listed (no `kind: \"enum\"`).\n */\nexport function listed<const V extends readonly string[]>(values: V, initial: V[number], options?: ListedOptions): Type<V[number]>;\n/** With no default: an arg left out is one the command was not given. */\nexport function listed<const V extends readonly string[]>(values: V, initial: undefined, options?: ListedOptions): Type<V[number] | undefined>;\nexport function listed(values: readonly string[], initial: string | undefined, options: ListedOptions = {}): Type<string | undefined> {\n return Types.custom<string | undefined, string | undefined, EntryOptions & { readonly options: readonly string[] }>(initial, { ...options, options: values });\n}\n\ninterface ListedOptions {\n readonly animatable?: boolean;\n}\n\n/** `record` without `keys`: the paints a node has no use for. */\nexport function omit<T extends object, const K extends keyof T>(record: T, ...keys: K[]): Omit<T, K> {\n const out = { ...record };\n for (const key of keys) delete out[key];\n return out;\n}\n\n/**\n * A node's paint order: its own paint under its children, then what it lays\n * over them, each cut at the near plane of a space it crosses.\n */\nexport function painted(ctx: RenderContext, own: () => void, over: () => void = () => { }): void {\n ctx.inFront(own);\n ctx.children();\n ctx.inFront(over);\n}\n", "import { fillOps, lerpNumber, type Fill, type FillResolved } from \"@motionscript/sdk\";\n\n/** A paint for one part of a node, named the way the node names its parts: a formula's term, a graph's vertex or edge. */\nexport interface PartFill {\n part: string;\n fill: Fill;\n /** Which of the places the part is written, counted from 1; 0 is all of them. */\n occurrence?: number;\n /** How far from the node's own paint to `fill`, 0 to 1. A tween's state: an author leaves it out. */\n mix?: number;\n}\n\nexport interface PartFillResolved {\n part: string;\n fill: FillResolved[];\n occurrence: number;\n mix: number;\n}\n\n// Every entry is kept as written, one with no part yet included, so an editor\n// showing the list shows the row it just added; the drawing skips it.\nexport function readPartFills(value: readonly PartFill[] | null | undefined): PartFillResolved[] {\n if (!Array.isArray(value)) return [];\n return value.map((entry) => ({\n part: String(entry?.part ?? \"\"),\n fill: fillOps.resolve(entry?.fill ?? \"#ffffff\"),\n occurrence: Math.max(0, Math.round(entry?.occurrence ?? 0)),\n mix: Math.min(1, Math.max(0, entry?.mix ?? 1)),\n }));\n}\n\nconst keyOf = (entry: PartFillResolved) => `${entry.occurrence}|${entry.part}`;\n\n// A paint that arrives grows from the node's own, and one that leaves fades back to it.\nexport function lerpPartFills(from: PartFillResolved[], to: PartFillResolved[], t: number): PartFillResolved[] {\n if (t <= 0) return from;\n if (t >= 1) return to;\n const before = new Map(from.map((entry) => [keyOf(entry), entry]));\n const out = to.map((entry) => {\n const was = before.get(keyOf(entry));\n before.delete(keyOf(entry));\n return was\n ? { ...entry, fill: fillOps.lerp(was.fill, entry.fill, t), mix: lerpNumber(was.mix, entry.mix, t) }\n : { ...entry, mix: entry.mix * t };\n });\n for (const gone of before.values()) out.push({ ...gone, mix: gone.mix * (1 - t) });\n return out;\n}\n\n/** Each part fill with its own key, the one in place of an earlier one for the same part and occurrence. */\nexport function withPartFill(fills: readonly PartFillResolved[], entry: PartFill): PartFill[] {\n const occurrence = Math.max(0, Math.round(entry.occurrence ?? 0));\n return [...fills.filter((was) => was.part !== entry.part || was.occurrence !== occurrence), { ...entry, occurrence }];\n}\n\n/** `base` with a part's fill laid over it while it arrives, in place of it once it has. */\nexport function partPaint(base: FillResolved[], entry: PartFillResolved | undefined): FillResolved[] {\n if (!entry || entry.mix <= 0) return base;\n if (entry.mix >= 1) return entry.fill;\n return [...base, ...entry.fill.map((layer) => ({ ...layer, opacity: (layer.opacity ?? 1) * entry.mix }))];\n}\n", "import {\n commandsFor,\n fillOps,\n Flow,\n Graphics2D,\n lerpNumber,\n Paint,\n pathOps,\n toPathString,\n Types,\n type BoxBounds,\n type ChildView,\n type Fill,\n type FillResolved,\n type InsetsResolved,\n type Loader,\n type Placement2D,\n type RenderContext,\n type ShadowResolved,\n type Size2D,\n type StrokeResolved,\n type Values,\n // Named so the emitted declaration reaches these through the sdk, not core.\n type Alignment as _Alignment,\n type FlowMode as _FlowMode,\n type FlowResolved as _FlowResolved,\n type GapSize as _GapSize,\n type Shadow as _Shadow,\n type Stroke as _Stroke,\n type Vector2 as _Vector2,\n} from \"@motionscript/sdk\";\n// From each module, never the `../engine` barrel: it re-exports this file.\nimport { blankLatex, buildLatexPath, findLatexParts, LatexNotLoaded, loadMathJax, MATHJAX_LOADER, type LatexPart, type LatexPathResult, type LatexToken } from \"./geometry\";\nimport { defaultLatexMorph, type AnimatedToken, type LatexMorphStrategy } from \"./tween\";\nimport { createBoundedCache } from \"../kit/cache\";\nimport { omit } from \"../kit/component\";\nimport { lerpPartFills, partPaint, readPartFills, withPartFill, type PartFill, type PartFillResolved } from \"../kit/part-fills\";\n\n/**\n * A formula typeset to glyph paths: what `latex` and `latexMatrix` share. A\n * node says where its formula comes from (`formula`); this lays it out, draws\n * it, writes it on, paints its parts, and morphs it into another.\n *\n * A morph is held by the entries the formula is written from: mid-tween each\n * holds both ends ({@link Morph}), so a seek to any time draws the morph there\n * from the node's own state, and a plain `to({ latex })` morphs as `morphTo` does.\n */\n\n/** A value on its way to another: what an entry the formula is written from holds mid-tween. */\nexport class Morph<T> {\n constructor(readonly from: T, readonly to: T, readonly t: number) { }\n}\n\nexport type Morphing<T> = T | Morph<T>;\n\n/** The end a value rests at, or is nearer to mid-tween: where a tween that starts from it starts. */\nexport function settled<T>(value: Morphing<T>): T {\n return value instanceof Morph ? (value.t < 0.5 ? value.from : value.to) : value;\n}\n\n// A whole value has nothing between its ends: mid-way it holds both, and the drawing morphs between them.\n// (A function, not a generic arrow: a copied component is compiled as TSX, where `<T>(` opens an element.)\nexport function lerpMorph<T>(from: Morphing<T>, to: Morphing<T>, t: number): Morphing<T> {\n if (t <= 0) return from;\n if (t >= 1) return to;\n return new Morph(settled(from), settled(to), t);\n}\n\n/** `parts` combined into one value at each end, when any of them is on its way: a matrix's source from its entries and brackets. */\nexport function morphOf<T>(parts: readonly Morphing<unknown>[], combine: (ends: readonly unknown[]) => T): Morphing<T> {\n const moving = parts.find((part): part is Morph<unknown> => part instanceof Morph);\n const end = (which: \"from\" | \"to\") => combine(parts.map((part) => (part instanceof Morph ? part[which] : part)));\n return moving ? new Morph(end(\"from\"), end(\"to\"), moving.t) : end(\"to\");\n}\n\nconst { start: _start, end: _end, ...glyphPaint } = Paint.state;\n\n/** What every formula has: the glyphs' paint, the flow its children are laid out in, its size, its part fills and how much of it is written. */\nexport const TYPESET = {\n // A formula writes itself on (`written`), so it trims no outline.\n ...glyphPaint,\n ...Flow.state,\n fontSize: 16,\n /** Paints for parts of the formula, named by their source. Later entries win where two name a glyph. */\n partFills: Types.custom<PartFill[], PartFillResolved[]>([], { resolve: readPartFills, lerp: lerpPartFills, kind: \"vector\" }),\n /**\n * How much of the formula is written, 0 to 1: its glyphs are drawn one after\n * another, each outlined and then filled.\n */\n written: Types.number(1, { min: 0, max: 1, step: 0.01 }),\n /** Reported for a host that read it; the morph is held by the formula's own entries. */\n morphProgress: Types.number(0, { animatable: false }),\n};\n\nexport const TYPESET_COMMANDS = {\n ...omit(Paint.commands, \"progressTo\", \"flash\"),\n ...commandsFor(TYPESET, {\n /** Write the formula on, or off: its glyphs one after another, each outlined and then filled. */\n writeTo: { args: [\"written\"] },\n /** Paint one part of the formula, leaving the rest as it is. */\n partFillTo: {\n args: {\n part: Types.text(\"\"),\n fill: Types.custom<Fill>(\"#facc15\", { kind: \"fills\" }),\n occurrence: Types.number(0, { min: 0, step: 1 }),\n },\n run: (timeline, s) => {\n const { part, fill, occurrence } = timeline.args;\n if (!part || fill == null) return timeline.tween({});\n return timeline.tween({ partFills: withPartFill(s.partFills, { part, fill, occurrence }) });\n },\n },\n }),\n};\n\ntype TypesetValues = Values<typeof TYPESET>;\n\n// ---- the formula at a moment ------------------------------------------------\n\n/** What is drawn of a formula now: its glyphs, its parts, its centre frame and size, and mid-morph each end's part fills. */\nexport interface FormulaFrame {\n readonly tokens: readonly AnimatedToken[];\n readonly parts: readonly LatexPart[];\n readonly bounds: [number, number, number, number];\n readonly width: number;\n readonly height: number;\n readonly morph: { readonly from: TokenFills; readonly to: TokenFills; readonly t: number } | null;\n}\n\n/** One part fill per token, or none: the last entry that names it. */\ntype TokenFills = (PartFillResolved | undefined)[];\n\nconst EMPTY: FormulaFrame = { tokens: [], parts: [], bounds: [0, 0, 0, 0], width: 0, height: 0, morph: null };\n\n/** A formula at rest: blank while MathJax is on its way, and asked again next time. A malformed one throws, every time. */\nfunction atRest(source: string, fontSize: number): FormulaFrame {\n if (!source) return EMPTY;\n let result: LatexPathResult;\n try {\n result = buildLatexPath(source, fontSize);\n } catch (error) {\n if (error instanceof LatexNotLoaded) return EMPTY;\n throw error;\n }\n return restingFrame(result);\n}\n\nconst resting = new WeakMap<LatexToken[], FormulaFrame>();\n\nfunction restingFrame(result: LatexPathResult): FormulaFrame {\n // The typeset result is shared by every reader of the formula; its tokens wrapped once.\n let frame = resting.get(result.tokens);\n if (!frame) {\n frame = {\n tokens: result.tokens.map((t) => ({ token: t.token, path: t.path, term: t.term, opacity: 1, x: 0, y: 0 })),\n parts: result.parts,\n bounds: result.bounds,\n width: result.width,\n height: result.height,\n morph: null,\n };\n resting.set(result.tokens, frame);\n }\n return frame;\n}\n\n/** Where a morph goes: typeset even when empty, and blank before MathJax. */\nfunction target(source: string, fontSize: number): LatexPathResult {\n try {\n return buildLatexPath(source, fontSize);\n } catch (error) {\n if (!(error instanceof LatexNotLoaded)) throw error;\n return blankLatex();\n }\n}\n\nconst NUL = String.fromCharCode(0);\nconst morphs = createBoundedCache<(t: number) => AnimatedToken[]>(16);\nlet lastMorph: { key: string; t: number; tokens: AnimatedToken[] } | null = null;\n\n/** The formula drawn now, from where it comes from: at rest, or `t` of the way through a morph. */\nexport function formulaFrame(\n source: Morphing<string>,\n fontSize: number,\n partFills: readonly PartFillResolved[],\n morph: LatexMorphStrategy = defaultLatexMorph,\n): FormulaFrame {\n if (!(source instanceof Morph)) return atRest(source, fontSize);\n const from = atRest(source.from, fontSize);\n const to = target(source.to, fontSize);\n const { t } = source;\n const key = `${fontSize}${NUL}${source.from}${NUL}${source.to}`;\n let frame = morph === defaultLatexMorph ? morphs.get(key) : undefined;\n if (!frame) {\n frame = morph(from.tokens.map((token) => ({ token: token.token, path: token.path, term: token.term })), to.tokens);\n if (morph === defaultLatexMorph) morphs.set(key, frame);\n }\n // Measured and drawn in one frame: the glyphs are worked out once.\n const tokens = lastMorph && lastMorph.key === key && lastMorph.t === t && morph === defaultLatexMorph ? lastMorph.tokens : frame(t);\n if (morph === defaultLatexMorph) lastMorph = { key, t, tokens };\n return {\n tokens,\n parts: [],\n bounds: [\n lerpNumber(from.bounds[0], to.bounds[0], t),\n lerpNumber(from.bounds[1], to.bounds[1], t),\n lerpNumber(from.bounds[2], to.bounds[2], t),\n lerpNumber(from.bounds[3], to.bounds[3], t),\n ],\n width: lerpNumber(from.width, to.width, t),\n height: lerpNumber(from.height, to.height, t),\n morph: {\n from: fillsByToken(partFills, from.parts, from.tokens.length),\n to: fillsByToken(partFills, to.parts, to.tokens.length),\n t,\n },\n };\n}\n\n// ---- measuring, laying out, loading -----------------------------------------\n\n/** Its formula's size and its padding, hugging; the factory applies a set or filling size. */\nexport function measureFormula(frame: FormulaFrame, s: { readonly padding: InsetsResolved }): Size2D {\n const pad = s.padding;\n return { width: frame.width + pad.left + pad.right, height: frame.height + pad.top + pad.bottom };\n}\n\n/** Its children, laid out in its box clear of its stroke, as a shape lays out its own. */\nexport function layoutFormula(box: BoxBounds, s: Flow.FlowState & { readonly stroke: StrokeResolved[] }, children: readonly ChildView<any>[]): readonly Placement2D[] {\n return Flow.layout(box, s, children, strokeInset(s.stroke));\n}\n\nfunction strokeInset(stroke: readonly StrokeResolved[]) {\n let extra = 0;\n for (const layer of stroke) {\n const intrusion = layer.weight * (1 - layer.align) / 2;\n if (intrusion > extra) extra = intrusion;\n }\n return { left: extra, right: extra, top: extra, bottom: extra };\n}\n\n/** MathJax, before this node is laid out: a scene with no formula in it never loads it. */\nexport function loadFormula(loader: Loader): void {\n loader.task(MATHJAX_LOADER, loadMathJax, { before: \"layout\" });\n}\n\n// ---- drawing ------------------------------------------------------------------\n\n/** How much of one glyph's writing overlaps the next one's. */\nconst WRITE_OVERLAP = 0.6;\n/** The outline a glyph is written with, as a share of the type size. */\nconst WRITE_STROKE = 1 / 32;\n\n/**\n * The glyphs, in a node's paint order: each one's shadow, fill and stroke\n * (the shadow op first, so the paint after it casts it), the pen's line while\n * it is being written, then the children, then the overlay through the glyphs.\n */\nexport function drawFormula(ctx: RenderContext, s: TypesetValues, frame: FormulaFrame): void {\n ctx.inFront(() => drawGlyphs(ctx, s, frame));\n ctx.children();\n ctx.inFront(() => drawOverlay(ctx, s, frame));\n}\n\nfunction drawGlyphs(ctx: RenderContext, s: TypesetValues, frame: FormulaFrame): void {\n const fills = s.fill as FillResolved[];\n const shadows = s.shadow as ShadowResolved[];\n const stroke = s.stroke as StrokeResolved[];\n const partOf = tokenFills(frame, s.partFills);\n const writing = writingOf(s.written, frame.tokens.length);\n eachToken(ctx, frame, (graphics, opacity, index, token) => {\n const fill = partPaint(fills, partOf(index, token));\n const pen = writing?.(index);\n if (!pen) {\n return graphics\n .shadow(scaleShadowOpacity(shadows, opacity))\n .fill(scaleFillopacity(fill, opacity))\n .stroke(stroke);\n }\n if (pen.filled <= 0) return null;\n return graphics\n .shadow(scaleShadowOpacity(shadows, opacity * pen.filled))\n .fill(scaleFillopacity(fill, opacity * pen.filled))\n .stroke(stroke);\n });\n if (!writing) return;\n // The pen's line: each glyph's outline, in its own colour, ahead of its fill.\n eachToken(ctx, frame, (graphics, opacity, index, token) => {\n const pen = writing(index);\n if (!pen || pen.filled >= 1 || pen.outlined <= 0) return null;\n const fill = scaleFillopacity(partPaint(fills, partOf(index, token)), opacity * (1 - pen.filled));\n return graphics.stroke(stroke.length > 0 ? stroke : penStroke(s.fontSize * WRITE_STROKE, fill));\n }, (index) => writing(index)?.outlined ?? 1);\n}\n\n/** The overlay, painted through the glyphs: a formula has no one silhouette to fill. */\nfunction drawOverlay(ctx: RenderContext, s: TypesetValues, frame: FormulaFrame): void {\n const overlay = s.overlay as FillResolved[];\n if (overlay.length === 0) return;\n const writing = writingOf(s.written, frame.tokens.length);\n eachToken(ctx, frame, (graphics, opacity, index) => {\n const filled = writing?.(index).filled ?? 1;\n return filled <= 0 ? null : graphics.fill(scaleFillopacity(overlay, opacity * filled));\n });\n}\n\n/** Each token's part fill: by its place in the formula at rest, by both ends' mid-morph. */\nfunction tokenFills(frame: FormulaFrame, partFills: readonly PartFillResolved[]): (index: number, token: AnimatedToken) => PartFillResolved | undefined {\n const morph = frame.morph;\n if (morph) {\n return (_index, token) => {\n const a = token.from === undefined ? undefined : morph.from[token.from];\n const b = token.to === undefined ? undefined : morph.to[token.to];\n if (a && b) return { ...b, fill: fillOps.lerp(a.fill, b.fill, morph.t), mix: lerpNumber(a.mix, b.mix, morph.t) };\n if (a) return token.to === undefined ? a : { ...a, mix: a.mix * (1 - morph.t) };\n if (b) return token.from === undefined ? b : { ...b, mix: b.mix * morph.t };\n return undefined;\n };\n }\n if (partFills.length === 0) return () => undefined;\n const byToken = fillsByToken(partFills, frame.parts, frame.tokens.length);\n return (index) => byToken[index];\n}\n\n/**\n * How far each glyph is written at `written`: its outline first, then its fill,\n * each glyph starting before the one ahead of it is done. `null` once the whole\n * formula is.\n */\nfunction writingOf(written: number, count: number): ((index: number) => { outlined: number; filled: number }) | null {\n if (written >= 1) return null;\n const lead = 1 - WRITE_OVERLAP;\n const span = 1 / (1 + Math.max(0, count - 1) * lead);\n return (index) => {\n const p = Math.min(1, Math.max(0, (written - index * span * lead) / span));\n return { outlined: Math.min(1, p * 2), filled: Math.max(0, p * 2 - 1) };\n };\n}\n\n/**\n * Every visible token's path once, each handed to `paint` to have its paint\n * ops appended: a fresh `Graphics2D` per token per pass, since paint ops\n * accumulate on the one they are added to.\n */\nfunction eachToken(\n ctx: RenderContext,\n frame: FormulaFrame,\n paint: (graphics: Graphics2D, opacity: number, index: number, token: AnimatedToken) => Graphics2D | null,\n drawn: (index: number) => number = () => 1,\n): void {\n frame.tokens.forEach((token, index) => {\n if (token.opacity <= 0) return;\n const pathStr = token.x !== 0 || token.y !== 0\n ? toPathString(offsetPath(token.path, token.x, token.y))\n : toPathString(token.path);\n const painted = paint(new Graphics2D()\n .path({\n data: pathStr,\n start: 0,\n end: 1 * drawn(index),\n // All tokens share one centre frame, so they keep their relative layout.\n centerBounds: frame.bounds,\n }), token.opacity, index, token);\n if (painted) ctx.draw(painted);\n });\n}\n\n// ---- parts --------------------------------------------------------------------\n\n/**\n * The box around one part of the formula, centred on the node's own centre and\n * y-up, or `null` when the formula does not write `part` (or is mid-morph).\n * `occurrence` counts from 1.\n */\nexport function partBoundsIn(frame: FormulaFrame, part: string, occurrence = 1): BoxBounds | null {\n const span = findLatexParts(frame.parts, part)[Math.max(1, Math.round(occurrence)) - 1];\n if (!span) return null;\n const box = pathOps.bounds(frame.tokens.slice(span[0], span[1]).flatMap((token) => token.path));\n if (!box) return null;\n const [minX, minY, maxX, maxY] = frame.bounds;\n const cx = (minX + maxX) / 2;\n const cy = (minY + maxY) / 2;\n return {\n x: (box.minX + box.maxX) / 2 - cx,\n y: cy - (box.minY + box.maxY) / 2,\n width: box.maxX - box.minX,\n height: box.maxY - box.minY,\n };\n}\n\n/** Where a node's formula comes from, by the class its component generated. */\ntype SourceOf = (values: never) => Morphing<string>;\nconst sources = new WeakMap<object, SourceOf>();\n\n/** Declare `component` a formula written from `source`: a mark can then point at its parts. */\nexport function formula<C extends { readonly node: object }>(component: C, source: SourceOf): C {\n sources.set(component.node, source);\n return component;\n}\n\n/** Whether `node` draws a formula, and so has parts a mark can point at. */\nexport function isFormula(node: object): boolean {\n return sources.has((node as { constructor: object }).constructor);\n}\n\n/** The formula `node` draws now, or `null` when it is no formula. */\nexport function formulaOf(node: object): FormulaFrame | null {\n const source = sources.get((node as { constructor: object }).constructor);\n if (!source) return null;\n const values = node as unknown as TypesetValues;\n return formulaFrame(source(values as never), values.fontSize, values.partFills);\n}\n\n/** The box around a part of the formula `node` draws (see {@link partBoundsIn}); `undefined` when it is no formula. */\nexport function latexPartBounds(node: object, part: string, occurrence = 1): BoxBounds | null | undefined {\n const frame = formulaOf(node);\n return frame ? partBoundsIn(frame, part, occurrence) : undefined;\n}\n\n// ---- paint helpers ------------------------------------------------------------\n\nfunction fillsByToken(partFills: readonly PartFillResolved[], parts: readonly LatexPart[], count: number): TokenFills {\n const out: TokenFills = new Array(count);\n for (const entry of partFills) {\n if (entry.part.trim() === \"\") continue;\n const spans = findLatexParts(parts, entry.part);\n for (const [from, to] of entry.occurrence > 0 ? spans.slice(entry.occurrence - 1, entry.occurrence) : spans) {\n for (let i = from; i < to && i < count; i++) out[i] = entry;\n }\n }\n return out;\n}\n\nfunction penStroke(weight: number, fill: FillResolved[]): StrokeResolved[] {\n return [{ weight, fill, dashOffset: 0, align: 0, cap: \"round\", capScale: 4, join: \"round\", miterLimit: 4 }];\n}\n\nfunction scaleFillopacity(fills: FillResolved[], opacity: number): FillResolved[] {\n if (opacity >= 1) return fills;\n return fills.map((f) => ({ ...f, opacity: (f.opacity ?? 1) * opacity }));\n}\n\n/** A fading token's shadow fades with it, as its fill does. */\nfunction scaleShadowOpacity(shadows: ShadowResolved[], opacity: number): ShadowResolved[] {\n if (opacity >= 1) return shadows;\n return shadows.map((s) => ({ ...s, fill: scaleFillopacity(s.fill, opacity) }));\n}\n\nfunction offsetPath(path: LatexToken[\"path\"], dx: number, dy: number): LatexToken[\"path\"] {\n return path.map((cmd) => {\n const c = cmd as any;\n const shifted: any = { ...c };\n if (\"x\" in c) shifted.x = c.x + dx;\n if (\"y\" in c) shifted.y = c.y + dy;\n if (\"x1\" in c) { shifted.x1 = c.x1 + dx; shifted.y1 = c.y1 + dy; }\n if (\"x2\" in c) { shifted.x2 = c.x2 + dx; shifted.y2 = c.y2 + dy; }\n return shifted;\n });\n}\n\nexport type { TypesetValues };\n", "import {\n component2d,\n Types,\n type EntryOptions,\n type InsetsProps,\n type NodeOf,\n type ShapeProps,\n // Named so the emitted declaration reaches these through the sdk, not core.\n type Alignment as _Alignment,\n type Fill as _Fill,\n type FillResolved as _FillResolved,\n type FlowMode as _FlowMode,\n type FlowResolved as _FlowResolved,\n type GapSize as _GapSize,\n type Node2D as _Node2D,\n type Node2DProps as _Node2DProps,\n type Shadow as _Shadow,\n type ShadowResolved as _ShadowResolved,\n type Stroke as _Stroke,\n type StrokeResolved as _StrokeResolved,\n type Vector2 as _Vector2,\n} from \"@motionscript/sdk\";\n// From each module, never the `../engine` barrel: it re-exports this file, so a\n// load that enters through the barrel would build this component before the\n// modules it spreads exist.\nimport type { PartFill } from \"../kit/part-fills\";\nimport {\n drawFormula, formula, formulaFrame, layoutFormula, lerpMorph, loadFormula, measureFormula, TYPESET, TYPESET_COMMANDS,\n type Morphing,\n} from \"./typeset\";\nimport type { LatexMorphStrategy } from \"./tween\";\n\nexport interface LatexProps extends ShapeProps {\n latex: string;\n fontSize: number;\n padding: InsetsProps;\n partFills: PartFill[];\n written: number;\n}\n\n/**\n * How a formula morphs, for a node built on the `Typeset` helpers: they take it\n * as an argument (`formulaFrame(source, fontSize, partFills, morph)`).\n */\nexport interface LatexStrategies {\n /** How the node morphs between two formulas. Defaults to `defaultLatexMorph`. */\n morph?: LatexMorphStrategy;\n}\n\nconst state = {\n ...TYPESET,\n /** The formula. Mid-tween it holds both ends, and the glyphs morph from the one into the other. */\n latex: Types.custom<string, Morphing<string>, EntryOptions & { readonly kind: \"text\"; readonly multiline: true }>(\"\", {\n kind: \"text\", multiline: true, lerp: lerpMorph,\n }),\n};\n\n/** A LaTeX formula drawn as glyph paths, morphing token by token between formulas. */\nexport const Latex = formula(component2d({\n key: \"latex\",\n state,\n defaults: { width: \"hug\", height: \"hug\" },\n load: (loader) => loadFormula(loader),\n commands: {\n ...TYPESET_COMMANDS,\n /** Morph this formula into another, its glyphs travelling to their places in it. */\n morphTo: { args: [\"latex\"] },\n },\n measure: (_measurer, s) => measureFormula(formulaFrame(s.latex, s.fontSize, s.partFills), s),\n layout: (box, s, children) => layoutFormula(box, s, children),\n render: (ctx, s) => drawFormula(ctx, s, formulaFrame(s.latex, s.fontSize, s.partFills)),\n}), (s: { readonly latex: Morphing<string> }) => s.latex);\n\nexport type Latex = NodeOf<typeof Latex>;\n", "import {\n component2d,\n Types,\n type EntryOptions,\n type NodeOf,\n // Named so the emitted declaration reaches these through the sdk, not core.\n type Alignment as _Alignment,\n type Fill as _Fill,\n type FillResolved as _FillResolved,\n type FlowMode as _FlowMode,\n type FlowResolved as _FlowResolved,\n type GapSize as _GapSize,\n type Node2D as _Node2D,\n type Node2DProps as _Node2DProps,\n type Shadow as _Shadow,\n type ShadowResolved as _ShadowResolved,\n type Stroke as _Stroke,\n type StrokeResolved as _StrokeResolved,\n type Vector2 as _Vector2,\n} from \"@motionscript/sdk\";\nimport type { LatexProps } from \"./node\";\nimport {\n drawFormula, formula, formulaFrame, layoutFormula, lerpMorph, loadFormula, measureFormula, morphOf, TYPESET, TYPESET_COMMANDS,\n type Morphing,\n} from \"./typeset\";\n\nexport type MatrixBrackets = \"square\" | \"round\" | \"bar\" | \"double\" | \"curly\" | \"none\";\n\nexport interface LatexMatrixProps extends LatexProps {\n entries: string[][];\n brackets: MatrixBrackets;\n}\n\nconst ENVIRONMENT: Record<MatrixBrackets, string> = {\n square: \"bmatrix\",\n round: \"pmatrix\",\n bar: \"vmatrix\",\n double: \"Vmatrix\",\n curly: \"Bmatrix\",\n none: \"matrix\",\n};\n\nconst BRACKETS = [\"square\", \"round\", \"bar\", \"double\", \"curly\", \"none\"] as const;\n\n/** The LaTeX a matrix of `entries` is typeset from; empty for one with no entries. */\nexport function matrixSource(entries: readonly (readonly string[])[], brackets: MatrixBrackets = \"square\"): string {\n const rows = entries.filter((row) => Array.isArray(row) && row.length > 0);\n if (rows.length === 0) return \"\";\n const environment = ENVIRONMENT[brackets] ?? ENVIRONMENT.square;\n return `\\\\begin{${environment}} ${rows.map((row) => row.join(\" & \")).join(\" \\\\\\\\ \")} \\\\end{${environment}}`;\n}\n\ninterface MatrixValues {\n readonly entries: Morphing<string[][]>;\n readonly brackets: Morphing<MatrixBrackets>;\n}\n\n/** The matrix's source now: mid-tween of its entries or its brackets, both ends of it. */\nfunction sourceOf(s: MatrixValues): Morphing<string> {\n return morphOf([s.entries, s.brackets], ([entries, brackets]) => matrixSource(entries as string[][], brackets as MatrixBrackets));\n}\n\nconst state = {\n ...TYPESET,\n // Unused by the matrix's own drawing: its entries say what it writes.\n latex: Types.custom<string, Morphing<string>, EntryOptions & { readonly kind: \"text\"; readonly multiline: true }>(\"\", {\n kind: \"text\", multiline: true, lerp: lerpMorph,\n }),\n /** A list of rows is a whole value: mid-tween it holds both, and the morph draws the way there. */\n entries: Types.custom<string[][], Morphing<string[][]>>([[\"a\", \"b\"], [\"c\", \"d\"]], { lerp: lerpMorph }),\n brackets: Types.custom<MatrixBrackets, Morphing<MatrixBrackets>, EntryOptions & { readonly options: typeof BRACKETS }>(\"square\", {\n options: BRACKETS, animatable: false, lerp: lerpMorph,\n }),\n};\n\n/**\n * A matrix typeset from its entries, row by row, inside the brackets it is\n * given. Each entry is a piece of LaTeX and is one of the formula's parts, so\n * it can be painted, boxed or braced by its own source.\n */\nexport const LatexMatrix = formula(component2d({\n key: \"latexMatrix\",\n state,\n defaults: { width: \"hug\", height: \"hug\" },\n load: (loader) => loadFormula(loader),\n commands: {\n ...TYPESET_COMMANDS,\n morphTo: { args: [\"latex\"] },\n /** Change the entries: the ones both matrices write travel, the rest fade. */\n entriesTo: { args: [\"entries\"] },\n },\n measure: (_measurer, s) => measureFormula(formulaFrame(sourceOf(s), s.fontSize, s.partFills), s),\n layout: (box, s, children) => layoutFormula(box, s, children),\n render: (ctx, s) => drawFormula(ctx, s, formulaFrame(sourceOf(s), s.fontSize, s.partFills)),\n}), sourceO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AGC,EAEH,MAAOC,GAAM,OAAqG,GAAI,CAClH,KAAM,OAAQ,UAAW,GAAM,KAAMC,EACxC,EAED,QAASD,GAAM,OAAyC,CAAC,CAAC,IAAK,GAAG,EAAG,CAAC,IAAK,GAAG,CAAC,EAAG,CAAE,KAAMC,CAAS,CAAE,EACrG,SAAUD,GAAM,OAAuG,SAAU,CAC7H,QAASZ,GAAU,WAAY,GAAO,KAAMa,EAC/C,GAQQC,GAAcC,EAAQC,GAAY,CAC3C,IAAK,cACL,MAAAN,GACA,SAAU,CAAE,MAAO,MAAO,OAAQ,KAAK,EACvC,KAAOO,GAAWC,EAAYD,CAAM,EACpC,SAAU,CACN,GAAGE,EACH,QAAS,CAAE,KAAM,CAAC,OAAO,CAAC,EAE1B,UAAW,CAAE,KAAM,CAAC,SAAS,CAAC,GAElC,QAAS,CAACC,EAAWZ,IAAMa,EAAeC,EAAaf,GAASC,CAAC,EAAGA,EAAE,SAAUA,EAAE,SAAS,EAAGA,CAAC,EAC/F,OAAQ,CAACe,EAAKf,EAAGgB,IAAaC,EAAcF,EAAKf,EAAGgB,CAAQ,EAC5D,OAAQ,CAACE,EAAKlB,IAAMmB,EAAYD,EAAKlB,EAAGc,EAAaf,GAASC,CAAC,EAAGA,EAAE,SAAUA,EAAE,SAAS,CAAC,EAC7F,EAAGD,EAAQ",
|
|
6
|
-
"names": ["createBoundedCache", "limit", "entries", "key", "value", "coldest", "runtime", "loading", "adaptor", "MATHJAX_LOADER", "loadMathJax", "module", "mathJaxLoaded", "blankLatex", "LatexNotLoaded", "LatexError", "latex", "reason", "geometryCache", "createBoundedCache", "pathCache", "buildLatexPath", "text", "fontSize", "key", "hit", "lend", "geometry", "buildLatexGeometry", "result", "scaleLatexGeometry", "svgEl", "failure", "mathJaxError", "heightAttr", "parseLatexSvg", "el", "minX", "minY", "maxX", "maxY", "identityMatrix", "multiplyMatrix", "m1", "m2", "parseTransform", "str", "m", "re", "match", "type", "args", "sx", "sy", "applyMatrix", "x", "y", "glyphIdToChar", "id", "parts", "hex", "cp", "parentKind", "node", "parent", "heightEx", "glyphMap", "d", "expandToAbsolute", "tokenisePath", "rawTokens", "synthIdx", "pushCmds", "token", "cmds", "traverse", "currentMatrix", "within", "nodeMatrix", "transformStr", "nodeName", "part", "source", "href", "glyphCommands", "gc", "shiftedArgs", "j", "nx", "ny", "rawId", "w", "h", "tp", "p", "abs", "child", "kind", "i", "box", "svgBBox", "t", "svgW", "svgH", "scale", "exInCoords", "ocx", "ocy", "tx", "svgX", "ty", "svgY", "rawCmdsToPathCommands", "out", "cmd", "a", "tokens", "rt", "commands", "bounds", "partKey", "latexPartNames", "seen", "names", "findLatexParts", "selector", "wanted", "found", "keep", "from", "to", "children", "siblings", "spelled", "b", "cur", "argCount", "raw", "cx", "cy", "mx", "my", "prevCmd", "prevCtrl", "up", "rel", "n", "reps", "r", "absX", "absY", "emitCmd", "x1", "y1", "x2", "y2", "touch", "lerpNumber", "POINT_FIELDS", "centroid", "path", "sx", "sy", "n", "cmd", "extent", "minX", "minY", "maxX", "maxY", "c", "kx", "ky", "isPointwiseCompatible", "from", "to", "i", "lerpPath", "t", "out", "f", "g", "scaleAbout", "cx", "cy", "s", "dx", "dy", "matchTokens", "remaining", "partner", "keyed", "pair", "same", "ft", "idx", "matched", "deleted", "tt", "prepareLatexTween", "added", "fromIndex", "token", "toIndex", "matchedData", "toExtent", "tokens", "m", "d", "fadeT", "a", "Paint", "Types", "_overlay", "paint", "_overlayTo", "paintCommands", "PAINT", "PAINT_COMMANDS", "listed", "values", "initial", "options", "omit", "record", "keys", "out", "key", "painted", "ctx", "own", "over", "fillOps", "lerpNumber", "readPartFills", "value", "entry", "keyOf", "lerpPartFills", "from", "to", "t", "before", "out", "was", "gone", "withPartFill", "fills", "occurrence", "partPaint", "base", "layer", "commandsFor", "fillOps", "Flow", "Graphics2D", "lerpNumber", "Paint", "pathOps", "toPathString", "Types", "Morph", "from", "to", "t", "settled", "value", "lerpMorph", "morphOf", "parts", "combine", "moving", "part", "end", "which", "_start", "_end", "glyphPaint", "Paint", "TYPESET", "Flow", "Types", "readPartFills", "lerpPartFills", "TYPESET_COMMANDS", "omit", "commandsFor", "timeline", "s", "fill", "occurrence", "withPartFill", "EMPTY", "atRest", "source", "fontSize", "result", "buildLatexPath", "error", "LatexNotLoaded", "restingFrame", "resting", "frame", "target", "blankLatex", "NUL", "morphs", "createBoundedCache", "lastMorph", "formulaFrame", "partFills", "morph", "prepareLatexTween", "key", "token", "tokens", "lerpNumber", "fillsByToken", "measureFormula", "pad", "layoutFormula", "box", "children", "strokeInset", "stroke", "extra", "layer", "intrusion", "loadFormula", "loader", "MATHJAX_LOADER", "loadMathJax", "WRITE_OVERLAP", "WRITE_STROKE", "drawFormula", "ctx", "drawGlyphs", "drawOverlay", "fills", "shadows", "partOf", "tokenFills", "writing", "writingOf", "eachToken", "graphics", "opacity", "index", "partPaint", "pen", "scaleShadowOpacity", "scaleFillopacity", "penStroke", "overlay", "filled", "_index", "b", "fillOps", "byToken", "written", "count", "lead", "span", "p", "paint", "drawn", "pathStr", "toPathString", "offsetPath", "painted", "Graphics2D", "partBoundsIn", "findLatexParts", "pathOps", "minX", "minY", "maxX", "maxY", "cx", "cy", "sources", "formula", "component", "isFormula", "node", "formulaOf", "values", "latexPartBounds", "out", "entry", "spans", "i", "weight", "f", "path", "dx", "dy", "cmd", "c", "shifted", "component2d", "Types", "state", "TYPESET", "Types", "lerpMorph", "Latex", "formula", "component2d", "loader", "loadFormula", "TYPESET_COMMANDS", "_measurer", "s", "measureFormula", "formulaFrame", "box", "children", "layoutFormula", "ctx", "drawFormula", "component2d", "Types", "ENVIRONMENT", "BRACKETS", "matrixSource", "entries", "brackets", "rows", "row", "environment", "sourceOf", "s", "morphOf", "state", "TYPESET", "Types", "lerpMorph", "LatexMatrix", "formula", "component2d", "loader", "loadFormula", "TYPESET_COMMANDS", "_measurer", "measureFormula", "formulaFrame", "box", "children", "layoutFormula", "ctx", "drawFormula"]
|
|
7
|
-
}
|
package/dist/kit/withdrawn.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The paint entries and commands a math node may have no use for: a node that
|
|
3
|
-
* is only a line has no fill, an area no outline, and one that reveals itself
|
|
4
|
-
* in its own way no outline trim.
|
|
5
|
-
*/
|
|
6
|
-
export declare const FILL_PAINT: readonly ["fill", "fillTo"];
|
|
7
|
-
export declare const STROKE_PAINT: readonly ["stroke", "strokeTo"];
|
|
8
|
-
export declare const OUTLINE_TRIM: readonly ["start", "end", "progressTo", "flash"];
|
|
9
|
-
//# sourceMappingURL=withdrawn.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"withdrawn.d.ts","sourceRoot":"","sources":["../../src/kit/withdrawn.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,UAAU,6BAA8B,CAAC;AACtD,eAAO,MAAM,YAAY,iCAAkC,CAAC;AAC5D,eAAO,MAAM,YAAY,kDAAmD,CAAC"}
|
package/dist/kit/withdrawn.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The paint entries and commands a math node may have no use for: a node that
|
|
3
|
-
* is only a line has no fill, an area no outline, and one that reveals itself
|
|
4
|
-
* in its own way no outline trim.
|
|
5
|
-
*/
|
|
6
|
-
export const FILL_PAINT = ["fill", "fillTo"];
|
|
7
|
-
export const STROKE_PAINT = ["stroke", "strokeTo"];
|
|
8
|
-
export const OUTLINE_TRIM = ["start", "end", "progressTo", "flash"];
|
|
9
|
-
//# sourceMappingURL=withdrawn.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"withdrawn.js","sourceRoot":"","sources":["../../src/kit/withdrawn.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,MAAM,EAAE,QAAQ,CAAU,CAAC;AACtD,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,QAAQ,EAAE,UAAU,CAAU,CAAC;AAC5D,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,OAAO,CAAU,CAAC","sourcesContent":["/**\n * The paint entries and commands a math node may have no use for: a node that\n * is only a line has no fill, an area no outline, and one that reveals itself\n * in its own way no outline trim.\n */\nexport const FILL_PAINT = [\"fill\", \"fillTo\"] as const;\nexport const STROKE_PAINT = [\"stroke\", \"strokeTo\"] as const;\nexport const OUTLINE_TRIM = [\"start\", \"end\", \"progressTo\", \"flash\"] as const;\n"]}
|
package/src/kit/withdrawn.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The paint entries and commands a math node may have no use for: a node that
|
|
3
|
-
* is only a line has no fill, an area no outline, and one that reveals itself
|
|
4
|
-
* in its own way no outline trim.
|
|
5
|
-
*/
|
|
6
|
-
export const FILL_PAINT = ["fill", "fillTo"] as const;
|
|
7
|
-
export const STROKE_PAINT = ["stroke", "strokeTo"] as const;
|
|
8
|
-
export const OUTLINE_TRIM = ["start", "end", "progressTo", "flash"] as const;
|