@motionscript/grids 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.
Files changed (92) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/dist/browser/chunks/chunk-7SRKSZ7X.js +2 -0
  3. package/dist/browser/chunks/chunk-7SRKSZ7X.js.map +7 -0
  4. package/dist/browser/index.js +1 -1
  5. package/dist/browser/index.js.map +2 -2
  6. package/dist/browser/kit.js +1 -1
  7. package/dist/browser/manifest.json +1 -1
  8. package/dist/engine.d.ts +0 -11
  9. package/dist/engine.d.ts.map +1 -1
  10. package/dist/engine.js +3 -11
  11. package/dist/engine.js.map +1 -1
  12. package/dist/kit/index.d.ts +0 -1
  13. package/dist/kit/index.d.ts.map +1 -1
  14. package/dist/kit/index.js +0 -2
  15. package/dist/kit/index.js.map +1 -1
  16. package/dist/kit/item-effects.d.ts +2 -5
  17. package/dist/kit/item-effects.d.ts.map +1 -1
  18. package/dist/kit/item-effects.js +5 -7
  19. package/dist/kit/item-effects.js.map +1 -1
  20. package/dist/kit/item-grid.d.ts +4 -48
  21. package/dist/kit/item-grid.d.ts.map +1 -1
  22. package/dist/kit/item-grid.js +4 -15
  23. package/dist/kit/item-grid.js.map +1 -1
  24. package/dist/kit/order.d.ts +3 -5
  25. package/dist/kit/order.d.ts.map +1 -1
  26. package/dist/kit/order.js +3 -5
  27. package/dist/kit/order.js.map +1 -1
  28. package/dist/kit/random.d.ts +0 -2
  29. package/dist/kit/random.d.ts.map +1 -1
  30. package/dist/kit/random.js +1 -1
  31. package/dist/kit/random.js.map +1 -1
  32. package/dist/kit/slots/index.d.ts +0 -1
  33. package/dist/kit/slots/index.d.ts.map +1 -1
  34. package/dist/kit/slots/index.js.map +1 -1
  35. package/dist/kit/slots/path-templates.d.ts +1 -6
  36. package/dist/kit/slots/path-templates.d.ts.map +1 -1
  37. package/dist/kit/slots/path-templates.js +1 -6
  38. package/dist/kit/slots/path-templates.js.map +1 -1
  39. package/dist/kit/slots/path.d.ts.map +1 -1
  40. package/dist/kit/slots/path.js +6 -9
  41. package/dist/kit/slots/path.js.map +1 -1
  42. package/dist/kit/slots/radial.d.ts +3 -5
  43. package/dist/kit/slots/radial.d.ts.map +1 -1
  44. package/dist/kit/slots/radial.js +3 -5
  45. package/dist/kit/slots/radial.js.map +1 -1
  46. package/dist/kit/slots/rectangular.d.ts +1 -5
  47. package/dist/kit/slots/rectangular.d.ts.map +1 -1
  48. package/dist/kit/slots/rectangular.js +1 -5
  49. package/dist/kit/slots/rectangular.js.map +1 -1
  50. package/dist/kit/slots/slot.d.ts +1 -7
  51. package/dist/kit/slots/slot.d.ts.map +1 -1
  52. package/dist/kit/slots/slot.js.map +1 -1
  53. package/dist/kit/stagger.d.ts +2 -13
  54. package/dist/kit/stagger.d.ts.map +1 -1
  55. package/dist/kit/stagger.js +2 -13
  56. package/dist/kit/stagger.js.map +1 -1
  57. package/dist/nodes.d.ts +0 -12
  58. package/dist/nodes.d.ts.map +1 -1
  59. package/dist/nodes.js.map +1 -1
  60. package/dist/path-grid/path-grid.d.ts +0 -3
  61. package/dist/path-grid/path-grid.d.ts.map +1 -1
  62. package/dist/path-grid/path-grid.js.map +1 -1
  63. package/dist/radial-grid/radial-grid.d.ts +0 -2
  64. package/dist/radial-grid/radial-grid.d.ts.map +1 -1
  65. package/dist/radial-grid/radial-grid.js.map +1 -1
  66. package/dist/rectangular-grid/rectangular-grid.d.ts +0 -2
  67. package/dist/rectangular-grid/rectangular-grid.d.ts.map +1 -1
  68. package/dist/rectangular-grid/rectangular-grid.js.map +1 -1
  69. package/dist/sphere-grid/sphere-grid.d.ts +0 -2
  70. package/dist/sphere-grid/sphere-grid.d.ts.map +1 -1
  71. package/dist/sphere-grid/sphere-grid.js.map +1 -1
  72. package/package.json +4 -4
  73. package/src/engine.ts +3 -11
  74. package/src/kit/index.ts +0 -3
  75. package/src/kit/item-effects.ts +6 -13
  76. package/src/kit/item-grid.ts +15 -52
  77. package/src/kit/order.ts +3 -6
  78. package/src/kit/random.ts +1 -1
  79. package/src/kit/slots/index.ts +0 -2
  80. package/src/kit/slots/path-templates.ts +1 -6
  81. package/src/kit/slots/path.ts +6 -10
  82. package/src/kit/slots/radial.ts +3 -5
  83. package/src/kit/slots/rectangular.ts +1 -5
  84. package/src/kit/slots/slot.ts +1 -7
  85. package/src/kit/stagger.ts +2 -13
  86. package/src/nodes.ts +0 -12
  87. package/src/path-grid/path-grid.ts +0 -3
  88. package/src/radial-grid/radial-grid.ts +0 -2
  89. package/src/rectangular-grid/rectangular-grid.ts +0 -2
  90. package/src/sphere-grid/sphere-grid.ts +0 -2
  91. package/dist/browser/chunks/chunk-TYNFMZ3D.js +0 -2
  92. package/dist/browser/chunks/chunk-TYNFMZ3D.js.map +0 -7
package/CHANGELOG.md CHANGED
@@ -1,5 +1,28 @@
1
1
  # @motionscript/grids
2
2
 
3
+ ## 0.1.1-alpha.0
4
+
5
+ ### Patch Changes
6
+
7
+ - e279864: **Breaking:** the component kits drop exports nothing used.
8
+
9
+ - **math:** the hand-mirrored `*Props` interfaces of 24 components (`AngleMarkProps`, `CurlyBraceProps`, `EmphasisMarkProps`, `CurveAreaProps`, `DropLinesProps`, `PlotPointProps`, `RiemannSumProps`, `TangentLineProps`, `VectorArrowProps`, `PointsPlotProps`, `StreamLinesProps`, `TracedPathProps`, `VectorFieldProps`, `NetworkGraphProps`, `SampleSpaceProps`, `NumberLineProps`, `NumberPlaneProps`, `PolarPlaneProps`, `LatexMatrixProps`, `Axes3dProps`, `CurvePlot3dProps`, `PlotPoint3dProps`, `SurfacePlot3dProps`, `VectorArrow3dProps`), `FILL_PAINT`, `STROKE_PAINT`, `OUTLINE_TRIM` and `spaceOf` from `./kit`, and `LatexPathResult.commands`.
10
+ - **charts:** `LineChartProps`, `BarChartProps`, `PieChartProps`, `PieRingProps`, `PieLegendProps`, `ChartBarsProps`, `CategoryAxisProps`, `ChartBorderProps`, `ChartCanvasProps`, `ChartLegendProps`, `VerticalAxisProps`, and from `./kit` `axisTweenTarget`, `resolvePalettePaint`, `legendShows`, `MarkerLabel`, `clampUnit` (use the SDK's `clamp`). `niceStep` and `enterBudget` stay reachable from `@motionscript/sdk/component`.
11
+ - **audio:** `FullWaveformProps`, `LiveWaveformProps`, and `clamp01` from `./kit`.
12
+ - **patterns:** `DotGridPatternProps`, `GridPatternProps`, `LineGridPatternProps`.
13
+ - **code:** `DEFAULT_THEMES`, `splitTokensAt`, `LINE_ALIGN_CELLS`, `EDIT_ALIGN_CELLS`, and `phasesFor` (use `defaultCodePhases`). `ensureHighlighter`, `loadCodeLanguage`, `initSyntaxHighlighter` and `canHighlight` lose their ignored theme argument.
14
+ - **grids:** the `findNode2D` and `frameIn` re-exports (import them from `@motionscript/sdk`), `ArrangementKind`, `PathGridShape`, `RectangularGridProps`, `RadialGridProps`, `PathGridProps`, `SphereGridProps`.
15
+ - **geography:** `GeoBorderProps`.
16
+
17
+ Migration: no stored document is affected; only TypeScript imports change. Code that imported a removed `*Props` interface states the props it passes inline, and code that used a removed helper uses the replacement named beside it above.
18
+
19
+ - Updated dependencies [e279864]
20
+ - @motionscript/sdk@0.1.1-alpha.0
21
+
22
+ ## 0.1.0
23
+
24
+ ## 0.1.0-alpha.10
25
+
3
26
  ## 0.1.0-alpha.9
4
27
 
5
28
  ## 0.1.0-alpha.8
@@ -0,0 +1,2 @@
1
+ var Yt=Object.defineProperty;var Dt=(t,e)=>{for(var n in e)Yt(t,n,{get:e[n],enumerable:!0})};import{clamp as P,pathOps as st}from"@motionscript/sdk";function y(t,e,n){return{x:t,y:e,depth:0,rotation:0,rotationX:0,rotationY:0,scale:1,opacity:1,meta:n}}function rt(t,e,n){if(n<=0)return t;if(n>=1)return e;let o=(r,a)=>r+(a-r)*n;return{x:o(t.x,e.x),y:o(t.y,e.y),depth:o(t.depth,e.depth),rotation:o(t.rotation,e.rotation),rotationX:o(t.rotationX,e.rotationX),rotationY:o(t.rotationY,e.rotationY),scale:o(t.scale,e.scale),opacity:o(t.opacity,e.opacity),meta:n<.5?t.meta:e.meta}}function Z(t,e){return e===1?t:{...t,x:t.x*e,y:t.y*e,depth:t.depth*e}}function at(t){let e=0,n=0;for(let o of t)o.width>e&&(e=o.width),o.height>n&&(n=o.height);return{width:e,height:n}}var be=["distribute","fixed"],_=new Map,Bt=32;function Xt(t){let e=_.get(t);if(e)return e;let n=st.contours(t),o={sampler:st.sampler(t),closed:n.length===1&&n[0].closed};return _.size>=Bt&&_.delete(_.keys().next().value),_.set(t,o),o}function ct(t,e){let{count:n}=e;if(n===0)return[];let{sampler:o,closed:r}=Xt(t.path),a=o.length,s=P(Math.min(t.trimStart,t.trimEnd),0,1),c=P(Math.max(t.trimStart,t.trimEnd),0,1),i=s*a,u=(c-s)*a,h=r&&s===0&&c===1,f=t.offset+t.flowSpeed*e.time,l=t.placement,m=l.rotation*Math.PI/180,k=Math.cos(m),A=Math.sin(m),g=[];for(let x=0;x<n;x++){let d;t.spacing==="fixed"&&u>0?d=f+x*t.spacingDistance/u:h?d=f+x/n:d=f+(n===1?.5:x/(n-1));let E=!0;h?d=d-Math.floor(d):(d<-1e-9||d>1+1e-9)&&(E=!1);let M=o.frameAt(i+P(d,0,1)*u);if(!M){let X=y(0,0,{kind:"path",t:P(d,0,1)});X.opacity=0,g.push(X);continue}let T=l.flipY?-1:1,R=(M.x-l.originX)*l.scale,G=(M.y-l.originY)*l.scale*T,O=y(l.x+R*k+G*A,l.y-R*A+G*k,{kind:"path",t:P(d,0,1)});t.alignToPath&&(O.rotation=-Math.atan2(M.ty*T,M.tx)*180/Math.PI+l.rotation),E||(O.opacity=0),g.push(O)}return g}var Re=["clockwise","counterclockwise"];function it(t,e,n){let o=t.sweep,r=Math.min(1,Math.abs(o)/360)**8,a=e<=1?0:o/(e-1+r),s=t.direction==="counterclockwise"?-1:1,c=t.startAngle+t.spinSpeed*n,i=[];for(let u=0;u<e;u++)i.push(c+s*u*a);return i}function ut(t,e){let n=it(t,e.count,e.time),o=n[0]??0;return n.map(r=>{let a=r*Math.PI/180,s=y(t.radius*Math.sin(a),t.radius*Math.cos(a),{kind:"radial",angle:Math.abs(r-o)});return t.rotateItems&&(s.rotation=r),s})}function Ge(t,e,n){let o=it({...t,spinSpeed:0},e,0)[n]??t.startAngle;return-Ft(o)}function Ft(t){let e=(t%360+360)%360;return e>180?e-360:e}var ve=["row","column"],Ce=["fit","fixed","fill"],ze=["start","center","end"];function ft(t,e){let n=Math.max(1,Math.round(t.columns)),o=Math.max(1,Math.ceil(e/n));return t.fillDirection==="column"?{rows:o,columns:Math.max(1,Math.ceil(e/o))}:{rows:o,columns:n}}function Ht(t,e,n,o){let{rows:r,columns:a}=ft(t,e);switch(t.cellMode){case"fixed":return{width:Math.max(0,t.cellWidth),height:Math.max(0,t.cellHeight)};case"fill":return{width:Math.max(0,(o.width-t.columnGap*(a-1))/a),height:Math.max(0,(o.height-t.rowGap*(r-1))/r)};default:return at(n)}}function lt(t,e){let{count:n}=e;if(n===0)return[];let{rows:o,columns:r}=ft(t,n),a=t.fillDirection==="column",s=a?r:o,c=a?o:r,i=Ht(t,n,e.sizes,e.box),u=i.width+t.columnGap,h=i.height+t.rowGap,f=s-1,l=n-f*c,m=c-l,k=t.lastLineAlign==="center"?m/2:t.lastLineAlign==="end"?m:0,A=t.rowOffset*u,g=t.columnOffset*h,x=[];for(let d=0;d<n;d++){let E=Math.floor(d/c),M=d%c;E===f&&(M+=k);let T=a?M:E,R=a?E:M,G=Math.round(T),O=Math.round(R),X=(R-(r-1)/2)*u+(G%2===1?A:0)-(o>1?A/2:0),Nt=((o-1)/2-T)*h-(O%2===1?g:0)+(r>1?g/2:0);x.push(y(X,Nt,{kind:"rectangular",row:G,column:O}))}return x}var De=["outward","billboard"],Be=["x","y","z"],Wt=Math.PI*(3-Math.sqrt(5)),w=180/Math.PI;function ht(t,e){if(e<=1)return[0,0,1];let n=1-2*(t+.5)/e,o=Math.sqrt(Math.max(0,1-n*n)),r=t*Wt;return[Math.cos(r)*o,n,Math.sin(r)*o]}function qt(t,e,n,o){let[r,a,s]=t,c=e/w,i=n/w,u=o/w,h=r*Math.cos(c)+s*Math.sin(c),f=-r*Math.sin(c)+s*Math.cos(c),l=a*Math.cos(i)-f*Math.sin(i),m=a*Math.sin(i)+f*Math.cos(i);return[h*Math.cos(u)+l*Math.sin(u),-h*Math.sin(u)+l*Math.cos(u),m]}function pt(t,e){let{count:n}=e,o=t.radius,r=t.yaw+t.spinSpeed*e.time,a=t.facing==="outward",s=[];for(let c=0;c<n;c++){let i=ht(c,n),[u,h,f]=qt(i,r,t.pitch,t.roll),l=y(u*o,h*o,{kind:"sphere",lat:Math.asin(Math.max(-1,Math.min(1,i[1])))*w,lon:Math.atan2(i[2],i[0])*w,depth:f});l.depth=f*o,a&&(l.rotationY=Math.asin(Math.max(-1,Math.min(1,u)))*w,l.rotationX=Math.atan2(h,f)*w),l.opacity=1-t.depthFade*(1-(f+1)/2),a&&t.cullBackfaces&&Vt(l,[u,h,f],t.focalLength)&&(l.opacity=0),s.push(l)}return s}function Vt(t,e,n){return n<=0?e[2]<0:e[0]*-t.x+e[1]*-t.y+e[2]*(n-t.depth)<0}function Xe(t,e){let[n,o,r]=ht(e,t);return{yaw:-Math.atan2(n,r)*w,pitch:Math.atan2(o,Math.hypot(n,r))*w}}var He=["circle","square","star","heart","infinity","wave","spiral","arc","line"];var v=new Map,$t=64;function We(t,e){let n=`${t}:${Math.round(e.width*100)}:${Math.round(e.height*100)}`,o=v.get(n);if(o)return o;let r=Kt(t,e);return v.size>=$t&&v.delete(v.keys().next().value),v.set(n,r),r}function Kt(t,e){let n=e.width>0?e.width:400,o=e.height>0?e.height:400,r=n/2,a=o/2;switch(t){case"square":return F([[-r,a],[r,a],[r,-a],[-r,-a]]);case"star":{let s=[];for(let c=0;c<10;c++){let i=c*Math.PI/5,u=c%2===0?1:.45;s.push([Math.sin(i)*r*u,Math.cos(i)*a*u])}return F(s)}case"heart":return F(C(96,s=>{let c=s*2*Math.PI,i=16*Math.sin(c)**3,u=13*Math.cos(c)-5*Math.cos(2*c)-2*Math.cos(3*c)-Math.cos(4*c);return[i/17*r,(u+2.5)/15.5*a]}).slice(0,-1));case"infinity":return F(C(96,s=>{let c=s*2*Math.PI,i=1+Math.sin(c)**2;return[Math.cos(c)/i*r,Math.sin(c)*Math.cos(c)/i*a*2]}).slice(0,-1));case"wave":return H(C(96,s=>[(-1+2*s)*r,Math.sin(s*4*Math.PI)*a*.6]));case"spiral":return H(C(160,s=>{let c=s*3*2*Math.PI,i=.08+.92*s;return[Math.sin(c)*r*i,Math.cos(c)*a*i]}));case"arc":return H(C(64,s=>{let c=-Math.PI/2+s*Math.PI;return[Math.sin(c)*r,-a+Math.cos(c)*o]}));case"line":return[{type:"M",x:-r,y:0},{type:"L",x:r,y:0}];default:return Zt(r,a)}}function Zt(t,e){let n=.5522847498;return[{type:"M",x:0,y:e},{type:"C",x1:n*t,y1:e,x2:t,y2:n*e,x:t,y:0},{type:"C",x1:t,y1:-n*e,x2:n*t,y2:-e,x:0,y:-e},{type:"C",x1:-n*t,y1:-e,x2:-t,y2:-n*e,x:-t,y:0},{type:"C",x1:-t,y1:n*e,x2:-n*t,y2:e,x:0,y:e},{type:"Z"}]}function C(t,e){let n=[];for(let o=0;o<=t;o++)n.push(e(o/t));return n}function H(t){return t.map(([e,n],o)=>o===0?{type:"M",x:e,y:n}:{type:"L",x:e,y:n})}function F(t){return[...H(t),{type:"Z"}]}function j(t,e){switch(t.kind){case"rectangular":return lt(t,e);case"radial":return ut(t,e);case"path":return ct(t,e);case"sphere":return pt(t,e)}}function J(t){return t.kind==="sphere"?Math.max(1,t.focalLength):0}function jt(t){let e=Math.floor(t)>>>0;return()=>{e=e+1831565813>>>0;let n=e;return n=Math.imul(n^n>>>15,n|1),n^=n+Math.imul(n^n>>>7,n|61),((n^n>>>14)>>>0)/4294967296}}function W(t,e){let n=[...t],o=jt(e);for(let r=n.length-1;r>0;r--){let a=Math.floor(o()*(r+1));[n[r],n[a]]=[n[a],n[r]]}return n}function dt(t){let e=2166136261;for(let n=0;n<t.length;n++)e=Math.imul(e^t.charCodeAt(n),16777619);return e>>>0}var mt=["index","reverse","random","centerOut","edgesIn","row","column","angle","path","depth"],Jt=.95;function gt(t,e,n){let o=e.length,r=Qt(t,e,n),a=1/0,s=-1/0;for(let i of r)i<a&&(a=i),i>s&&(s=i);let c=s-a;return c>1e-9?r.map(i=>(i-a)/c):new Array(o).fill(0)}function z(t,e,n){let o=Math.max(0,Math.min(Jt,n)),r=o===0?e:(e-t*o)/(1-o);return r<0?0:r>1?1:r}function Qt(t,e,n){switch(t){case"reverse":return e.map((o,r)=>-r);case"random":{let o=W(e.map((a,s)=>s),n),r=new Array(e.length);return o.forEach((a,s)=>{r[a]=s}),r}case"centerOut":return e.map(o=>Math.round(Math.hypot(o.x,o.y,o.depth)*1e3)/1e3);case"edgesIn":return e.map(o=>-Math.round(Math.hypot(o.x,o.y,o.depth)*1e3)/1e3);case"row":return e.map(o=>o.meta.kind==="rectangular"?o.meta.row:-Math.round(o.y));case"column":return e.map(o=>o.meta.kind==="rectangular"?o.meta.column:Math.round(o.x));case"angle":return e.map((o,r)=>o.meta.kind==="radial"?o.meta.angle:o.meta.kind==="rectangular"||o.meta.kind==="sphere"?Ut(o):r);case"path":return e.map((o,r)=>o.meta.kind==="path"?o.meta.t:r);case"depth":return e.map((o,r)=>o.meta.kind==="sphere"?-o.meta.depth:r);default:return e.map((o,r)=>r)}}function Ut(t){let e=Math.atan2(t.x,t.y)*180/Math.PI;return e<0?e+360:e}import{clamp as q}from"@motionscript/sdk";var Q=["scale","fade","center","rise","flip","spin"],xt=["scale","lift","fade","spin"];function Mt(t,e,n,o,r,a){o&&te(t,o.style,o.values[e]??1,n),r&&ee(t,r,r.values[e]??0,n),a&&ne(t,a,a.values[e]??0)}function te(t,e,n,o){if(n===1)return;let r=q(n,0,1);switch(e){case"fade":t.opacity*=r;break;case"center":t.x*=n,t.y*=n,t.depth*=n,t.opacity*=q(n*4,0,1);break;case"rise":t.y-=(1-n)*Math.max(40,o.height),t.opacity*=r;break;case"flip":t.rotationX+=(1-n)*90;break;case"spin":t.rotation-=(1-n)*180,t.scale*=Math.max(0,n);break;default:t.scale*=Math.max(0,n)}}function ee(t,e,n,o){if(n!==0)switch(e.style){case"lift":t.y+=e.amount*n*Math.max(40,o.height);break;case"fade":t.opacity*=q(1-e.amount*n,0,1);break;case"spin":t.rotation+=e.amount*n*360;break;default:t.scale*=1+e.amount*n}}function ne(t,e,n){if(n!==0){if(n>0){t.scale*=1+e.grow*n;return}t.opacity*=q(1-e.dim*-n,0,1),t.scale*=Math.max(0,1+e.grow*.5*n)}}function I(t,e){let n=[],o=new Array(e).fill(!1);for(let r of t??[]){let a=Math.round(r);a>=0&&a<e&&!o[a]&&(o[a]=!0,n.push(a))}for(let r=0;r<e;r++)o[r]||n.push(r);return n}function U(t){let e=new Array(t.length);return t.forEach((n,o)=>{e[n]=o}),e}function yt(t){return Array.isArray(t)?t.map(Number).filter(Number.isFinite):typeof t!="string"?[]:t.split(/[\s,]+/).filter(e=>e!=="").map(Number).filter(Number.isFinite)}var zt={};Dt(zt,{ITEM_GRID_TYPES:()=>$,TRANSITION_STAGGER:()=>b,commands:()=>pe,contentBox:()=>L,contentBoxOf:()=>Lt,defaults:()=>se,define:()=>ce,fields:()=>ue,focusOn:()=>Rt,hinted:()=>ae,isGrid:()=>ie,itemSlots:()=>Tt,layout:()=>Ot,measure:()=>Et,nodeRef:()=>kt,nodeRefArg:()=>At,ranks:()=>D,render:()=>bt,staggerArgs:()=>S,state:()=>It,transitionTo:()=>N});import{commandsFor as oe,easeIn as re,easeInOut as Y,easeOut as wt,flowOps as tt,insetsOps as St,Types as p}from"@motionscript/sdk";var $=["rectangularGrid","radialGrid","pathGrid","sphereGrid"],b=.3;function kt(t){let e={kind:"nodeRef",nodeTypes:t,animatable:!1};return p.custom("",e)}function S(t){return{staggerOrder:p.oneOf(mt,{default:"index"}),stagger:p.number(t,{min:0,max:.95,step:.05})}}function ae(t,e={}){let n={...e,default:t};return p.custom(void 0,n)}function At(t){let e={kind:"nodeRef",nodeTypes:t};return p.custom(void 0,e)}var It={order:p.custom([],{kind:"order",animatable:!1}),spread:p.number(1,{min:0,max:3,step:.05}),arrangeLike:kt($),revealState:p.custom(void 0,{kind:"state",animatable:!1}),waveState:p.custom(void 0,{kind:"state",animatable:!1}),focusState:p.custom(void 0,{kind:"state",animatable:!1}),transition:p.custom(void 0,{kind:"state",animatable:!1}),transitionSource:p.custom("",{kind:"nodeRef",private:!0})},se={width:"hug",height:"hug"},B=new Map;function ce(t,e){return B.set(t.key,{component:t,arranger:e}),t}function ie(t){for(let{component:e}of B.values())if(t instanceof e.node)return!0;return!1}function ue(t){return{measure:(e,n,o)=>Et(e,n,o,t),layout:(e,n,o)=>Ot(e,n,o,t),render:(e,n)=>bt(e,n,t)}}var fe={width:0,height:0},le={x:0,y:0},V=new WeakMap;function Et(t,e,n,o){let r={maxWidth:t.max.width,maxHeight:t.max.height},a=e.padding;if(n.length===0)return V.delete(e),tt.size(e,r,a,fe);let s=tt.contentBox(e,r,a),c=_t(n,s,e,o);V.set(e,{space:s,sizes:c});let i={state:e,arranger:o,children:n,isSelf:Gt(n)},u=ot(i,c.length,c,s,t.time.total);return tt.size(e,r,a,we(u.slots,c,vt(e,u.arrangement)))}function Ot(t,e,n,o){let r=V.get(e);if(V.delete(e),n.length===0)return[];let a=St.insetBounds(t.width,t.height,e.padding),s=r&&r.sizes.length===n.length&&ke(r.space,a)?r.sizes:_t(n,a,e,o);return xe({state:e,arranger:o,children:n,isSelf:Gt(n)},s,a,t.time.total).map((i,u)=>ye(a,i,s[u]))}function bt(t,e,n){let o=e.children.length===0?0:vt(e,ge({state:e,arranger:n,children:[],isSelf:()=>!1},L(t.size,e.padding)));o>0&&!t.inSpace?t.space(Me(o)):t.children()}function Lt(t){let e=t.layoutBounds;return L({width:e.width,height:e.height},t.effectivePadding())}function Tt(t,e,n){let o=Pt(t,e,n),r=n.map(a=>a.size);return ot(o,n.length,r,L(t.node.size,e.padding),0).slots}function D(t,e,n,o){return gt(o??"index",Tt(t,e,n),dt(t.node.id))}function N(t,e,n,o,r=b){let a=me(t,e,n),s=t.easing??Y("cubic"),c=D(t,e,n,t.args.staggerOrder),i=t.args.stagger??r;return t.animate(u=>{if(u>=1)return{...o,transition:null,transitionSource:""};let h=c.map(f=>s(z(f,u,i)));return{...o,transition:{from:a,mix:h},transitionSource:a.source}},{eased:!1})}function Rt(t,e,n,o,r,a){let s=e.focusState,c=Array.from({length:o},(u,h)=>n(h)?1:-1),i=t.easing??Y("cubic");return t.animate(u=>{let h=i(u);return{focusState:{dim:et(s?.dim??r,r,h),grow:et(s?.grow??a,a,h),values:c.map((f,l)=>et(s?.values[l]??0,f,h))}}},{eased:!1})}var he={...It,padding:p.insets},pe=oe(he,{reveal:{args:{style:p.oneOf(Q,{default:"scale"}),...S(.5)},run:(t,e,n)=>{let o=t.args.style??"scale",r=t.easing??(o==="scale"||o==="flip"?wt("back"):wt("cubic")),a=D(t,e,n,t.args.staggerOrder),s=t.args.stagger??.5;return t.animate(c=>c>=1?{revealState:null}:{revealState:{style:o,values:a.map(i=>r(z(i,c,s)))}},{eased:!1})}},conceal:{args:{style:p.oneOf(Q,{default:"scale"}),...S(.5)},run:(t,e,n)=>{let o=t.args.style??"scale",r=t.easing??(o==="scale"||o==="flip"?re("back"):Y("cubic")),a=D(t,e,n,t.args.staggerOrder),s=t.args.stagger??.5,c=e.revealState?.values;return t.animate(i=>({revealState:{style:o,values:a.map((u,h)=>(c?.[h]??1)*(1-r(z(u,i,s))))}}),{eased:!1})}},wave:{args:{style:p.oneOf(xt,{default:"scale"}),amount:p.number(.3,{min:0,max:2,step:.05}),...S(.7)},run:(t,e,n)=>{let o=t.args.style??"scale",r=t.args.amount??.3,a=t.easing??Y("sine"),s=D(t,e,n,t.args.staggerOrder),c=t.args.stagger??.7;return t.animate(i=>i>=1?{waveState:null}:{waveState:{style:o,amount:r,values:s.map(u=>Math.sin(Math.PI*a(z(u,i,c))))}},{eased:!1})}},focus:{args:{item:p.number(0,{min:0,step:1}),dim:p.number(.7,{min:0,max:1,step:.05}),grow:p.number(.15,{min:0,max:1,step:.05})},run:(t,e,n)=>{let o=Math.round(t.args.item??0);return Rt(t,e,r=>r===o,n.length,t.args.dim??.7,t.args.grow??.15)}},unfocus:(t,e)=>{let n=e.focusState,o=t.easing??Y("cubic");return t.animate(r=>{if(r>=1||!n)return{focusState:null};let a=1-o(r);return{focusState:{...n,values:n.values.map(s=>s*a)}}},{eased:!1})},spreadTo:{args:{spread:p.number(1,{min:0,max:3,step:.05})},run:t=>t.tween({spread:t.args.spread??1})},shuffle:{args:{seed:p.number(1,{min:0,step:1}),...S(b)},run:(t,e,n)=>{let o=I(e.order,n.length),r=W(o,t.args.seed??1);return r.length>1&&r.every((a,s)=>a===o[s])&&(r=[...r.slice(1),r[0]]),N(t,e,n,{order:r})}},swap:{args:{first:p.number(0,{min:0,step:1}),second:p.number(1,{min:0,step:1}),...S(0)},run:(t,e,n)=>{let o=I(e.order,n.length),r=o.indexOf(Math.round(t.args.first??0)),a=o.indexOf(Math.round(t.args.second??1));return r>=0&&a>=0&&([o[r],o[a]]=[o[a],o[r]]),N(t,e,n,{order:o},0)}},reorder:{args:{order:p.text(""),...S(b)},run:(t,e,n)=>{let o=I(yt(t.args.order),n.length);return N(t,e,n,{order:o})}},morphInto:{args:{target:At($),...S(b)},run:(t,e,n)=>N(t,e,n,{arrangeLike:t.args.target??""})}});function de(t){let e=B.get(t);if(!e)throw new Error(`"${t}" is no grid: pass its component through ItemGrid.define.`);return e.arranger}function nt(t,e){if(!t)return null;let n=B.get(t.key);return!n||e.isSelf(t)?null:{view:t,arranger:n.arranger}}function Gt(t){return e=>t.length===0?!1:e.state.children?.[0]===t[0]}function Pt(t,e,n){return{state:e,arranger:de(t.node.key),children:n,isSelf:o=>o.id===t.node.id}}function me(t,e,n){let o=Pt(t,e,n),r=nt(e.arrangeLike,o);return{arrangement:r?r.arranger.arrangement(r.view.state,K(r.view)):o.arranger.arrangement(e,L(t.node.size,e.padding)),source:r?.view.id??"",order:I(e.order,n.length),spread:e.spread}}function _t(t,e,n,o){let r=t.map(s=>s.measure(e)),a=o.itemSpace?o.itemSpace(n,t.length,e):e;return a===e?r:t.map(s=>s.measure(a))}function ge(t,e){let n=nt(t.state.arrangeLike,t);return n?n.arranger.arrangement(n.view.state,K(n.view)):t.arranger.arrangement(t.state,e)}function ot(t,e,n,o,r){let a=t.state,s=nt(a.arrangeLike,t),c=s?K(s.view):o,i=s?s.arranger.arrangement(s.view.state,c):t.arranger.arrangement(a,o),u=j(i,{count:e,sizes:n,box:c,time:r});return s&&(u=Ct(s.view.frame,u)),{slots:U(I(a.order,e)).map(f=>Z(u[f],a.spread)),arrangement:i}}function xe(t,e,n,o){let r=t.state,a=e.length,s=ot(t,a,e,n,o).slots,c=r.transition;if(c){let{from:f}=c,l=f.source?r.transitionSource:null,m=l&&l.id===f.source&&B.has(l.key)?l:null,k=m!==null&&t.isSelf(m),A=m&&!k?K(m):n,g=j(f.arrangement,{count:a,sizes:e,box:A,time:o});m&&!k&&(g=Ct(m.frame,g));let x=U(I(f.order,a));for(let d=0;d<a;d++)s[d]=rt(Z(g[x[d]],f.spread),s[d],c.mix[d]??1)}let i=r.revealState,u=r.waveState,h=r.focusState;if(i||u||h)for(let f=0;f<a;f++)Mt(s[f],f,e[f],i,u,h);return s}function vt(t,e){return J(e)||(t.transition?J(t.transition.from.arrangement):0)}function Me(t){return{perspective:t,orbit:0,elevation:0,dolly:0,lookAt:le,zoom:1,heading:0,viewportX:0,viewportY:0}}function ye(t,e,n){let o={x:t.x+e.x,y:e.y-t.y,width:n.width,height:n.height};return e.rotation===0&&e.scale===1&&e.rotationX===0&&e.rotationY===0&&e.depth===0&&e.opacity===1?o:{...o,rotation:e.rotation,scale:e.scale,rotationX:e.rotationX,rotationY:e.rotationY,depth:e.depth,opacity:e.opacity}}function Ct(t,e){return e.map(n=>{let o=Se(n.x*t.scale,n.y*t.scale,t.rotation);return{...n,x:t.x+o.x,y:t.y+o.y,depth:n.depth*t.scale,rotation:n.rotation+t.rotation,scale:n.scale*t.scale}})}function K(t){return L(t.size,t.state.padding)}function L(t,e){let n=St.insetBounds(t.width,t.height,e);return{width:n.width,height:n.height}}function we(t,e,n){let o=0,r=0;for(let a=0;a<t.length;a++){let s=t[a],c=e[a],i=s.rotation*Math.PI/180,u=Math.abs(Math.cos(i)),h=Math.abs(Math.sin(i)),f=n>0&&n-s.depth>1?n/(n-s.depth):1,l=(c.width*u+c.height*h)/2*s.scale*f,m=(c.width*h+c.height*u)/2*s.scale*f;o=Math.max(o,Math.abs(s.x)*f+l),r=Math.max(r,Math.abs(s.y)*f+m)}return{width:o*2,height:r*2}}function Se(t,e,n){if(n===0)return{x:t,y:e};let o=n*Math.PI/180,r=Math.cos(o),a=Math.sin(o);return{x:t*r+e*a,y:-t*a+e*r}}function ke(t,e){return Math.abs(t.width-e.width)<1e-6&&Math.abs(t.height-e.height)<1e-6}function et(t,e,n){return t+(e-t)*n}export{y as a,rt as b,Z as c,at as d,be as e,ct as f,Re as g,it as h,ut as i,Ge as j,Ft as k,ve as l,Ce as m,ze as n,ft as o,Ht as p,lt as q,De as r,Be as s,ht as t,qt as u,pt as v,Xe as w,He as x,We as y,j as z,J as A,W as B,dt as C,mt as D,gt as E,z as F,Q as G,xt as H,Mt as I,I as J,U as K,yt as L,$ as M,b as N,S as O,Lt as P,zt as Q};
2
+ //# sourceMappingURL=chunk-7SRKSZ7X.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/kit/slots/path.ts", "../../../src/kit/slots/slot.ts", "../../../src/kit/slots/radial.ts", "../../../src/kit/slots/rectangular.ts", "../../../src/kit/slots/sphere.ts", "../../../src/kit/slots/path-templates.ts", "../../../src/kit/slots/index.ts", "../../../src/kit/random.ts", "../../../src/kit/stagger.ts", "../../../src/kit/item-effects.ts", "../../../src/kit/order.ts", "../../../src/kit/item-grid.ts"],
4
+ "sourcesContent": ["import { clamp, pathOps, type PathData, type PathSampler } from \"@motionscript/sdk\"\n\nimport { slot, type Slot, type SlotInput } from \"./slot\"\n\n/** `distribute` spreads the items over the path; `fixed` sets them a distance apart. */\nexport const PATH_SPACINGS = [\"distribute\", \"fixed\"] as const\nexport type PathSpacing = (typeof PATH_SPACINGS)[number]\n\n/** How path coordinates land in the grid's frame: `origin` of the path goes to `(x, y)`, turned and scaled. */\nexport interface PathPlacement {\n originX: number\n originY: number\n /** The path is y-down, as SVG and the editor write one. */\n flipY?: boolean\n x: number\n y: number\n /** Degrees clockwise. */\n rotation: number\n scale: number\n}\n\nexport interface PathArrangement {\n kind: \"path\"\n /** y-up, like every path in the library, unless its placement says otherwise. */\n path: PathData\n placement: PathPlacement\n spacing: PathSpacing\n /** Pixels between items when `spacing` is `fixed`. */\n spacingDistance: number\n /** Share of the path the items are moved along; wraps on a closed path. */\n offset: number\n /** Share of the path per second the items travel on their own. */\n flowSpeed: number\n trimStart: number\n trimEnd: number\n /** Turn each item to follow the path's direction. */\n alignToPath: boolean\n}\n\nconst SAMPLERS = new Map<PathData, { sampler: PathSampler; closed: boolean }>()\nconst SAMPLER_CACHE = 32\n\n/** A sampler for `path`, kept while the same value keeps arriving — a path is re-read every frame. */\nfunction measured(path: PathData): { sampler: PathSampler; closed: boolean } {\n const hit = SAMPLERS.get(path)\n if (hit) return hit\n const contours = pathOps.contours(path)\n const entry = {\n sampler: pathOps.sampler(path),\n closed: contours.length === 1 && contours[0].closed,\n }\n if (SAMPLERS.size >= SAMPLER_CACHE) SAMPLERS.delete(SAMPLERS.keys().next().value!)\n SAMPLERS.set(path, entry)\n return entry\n}\n\n/**\n * Items at even arc-length steps — by distance along the curve rather than the\n * path's own parameter, which bunches them up wherever a curve is tight.\n *\n * On a closed path used whole, `n` items take `n` equal steps and `offset`\n * wraps round, so an animated offset is a loop. Anywhere else the ends are\n * ends: `n` items take `n - 1` steps so both get one, and an item moved past\n * either is hidden rather than piled on it.\n */\nexport function pathSlots(arrangement: PathArrangement, input: SlotInput): Slot[] {\n const { count } = input\n if (count === 0) return []\n const { sampler, closed } = measured(arrangement.path)\n const length = sampler.length\n const a = clamp(Math.min(arrangement.trimStart, arrangement.trimEnd), 0, 1)\n const b = clamp(Math.max(arrangement.trimStart, arrangement.trimEnd), 0, 1)\n const start = a * length\n const span = (b - a) * length\n const loops = closed && a === 0 && b === 1\n const offset = arrangement.offset + arrangement.flowSpeed * input.time\n const place = arrangement.placement\n const rad = (place.rotation * Math.PI) / 180\n const cos = Math.cos(rad)\n const sin = Math.sin(rad)\n\n const slots: Slot[] = []\n for (let k = 0; k < count; k++) {\n let u: number\n if (arrangement.spacing === \"fixed\" && span > 0) {\n u = offset + (k * arrangement.spacingDistance) / span\n } else if (loops) {\n u = offset + k / count\n } else {\n u = offset + (count === 1 ? 0.5 : k / (count - 1))\n }\n let visible = true\n if (loops) u = u - Math.floor(u)\n else if (u < -1e-9 || u > 1 + 1e-9) visible = false\n const at = sampler.frameAt(start + clamp(u, 0, 1) * span)\n if (!at) {\n const s = slot(0, 0, { kind: \"path\", t: clamp(u, 0, 1) })\n s.opacity = 0\n slots.push(s)\n continue\n }\n // Into the grid's frame: about the path's origin, turned clockwise (y-up).\n const flip = place.flipY ? -1 : 1\n const px = (at.x - place.originX) * place.scale\n const py = (at.y - place.originY) * place.scale * flip\n const s = slot(\n place.x + px * cos + py * sin,\n place.y - px * sin + py * cos,\n { kind: \"path\", t: clamp(u, 0, 1) },\n )\n if (arrangement.alignToPath) s.rotation = (-Math.atan2(at.ty * flip, at.tx) * 180) / Math.PI + place.rotation\n if (!visible) s.opacity = 0\n slots.push(s)\n }\n return slots\n}\n", "import type { Size2D } from \"@motionscript/sdk\"\n\n/** One place in an arrangement, in the grid's frame (y-up, `depth` toward the viewer). Pure data, so a morph can blend any two. */\nexport interface Slot {\n x: number\n y: number\n depth: number\n /** Degrees clockwise. */\n rotation: number\n /** Tilt, degrees, as a node's own `rotationX`/`rotationY`. */\n rotationX: number\n rotationY: number\n scale: number\n opacity: number\n meta: SlotMeta\n}\n\n/** What kind of place a slot is — the orderings a stagger can follow. */\nexport type SlotMeta =\n | { kind: \"rectangular\"; row: number; column: number }\n /** Degrees clockwise from the arrangement's first slot. */\n | { kind: \"radial\"; angle: number }\n /** `0..1` along the part of the path in use. */\n | { kind: \"path\"; t: number }\n /** `depth` is `-1` at the back of the sphere and `1` at the front. */\n | { kind: \"sphere\"; lat: number; lon: number; depth: number }\n\n/** What an arrangement is laid out for. */\nexport interface SlotInput {\n count: number\n /** Each item's measured size, in item order. */\n sizes: readonly Size2D[]\n /** The grid's content box. */\n box: Size2D\n /** Clip seconds, for arrangements that move on their own. */\n time: number\n}\n\nexport function slot(x: number, y: number, meta: SlotMeta): Slot {\n return { x, y, depth: 0, rotation: 0, rotationX: 0, rotationY: 0, scale: 1, opacity: 1, meta }\n}\n\n/** `a` toward `b`. The meta switches halfway, since an ordering cannot be half one thing. */\nexport function blendSlot(a: Slot, b: Slot, t: number): Slot {\n if (t <= 0) return a\n if (t >= 1) return b\n const mix = (p: number, q: number) => p + (q - p) * t\n return {\n x: mix(a.x, b.x),\n y: mix(a.y, b.y),\n depth: mix(a.depth, b.depth),\n rotation: mix(a.rotation, b.rotation),\n rotationX: mix(a.rotationX, b.rotationX),\n rotationY: mix(a.rotationY, b.rotationY),\n scale: mix(a.scale, b.scale),\n opacity: mix(a.opacity, b.opacity),\n meta: t < 0.5 ? a.meta : b.meta,\n }\n}\n\n/** Push `s` away from (or pull it toward) the grid's centre. */\nexport function spreadSlot(s: Slot, spread: number): Slot {\n if (spread === 1) return s\n return { ...s, x: s.x * spread, y: s.y * spread, depth: s.depth * spread }\n}\n\n/** Largest width and height among `sizes`. */\nexport function largest(sizes: readonly Size2D[]): Size2D {\n let width = 0\n let height = 0\n for (const size of sizes) {\n if (size.width > width) width = size.width\n if (size.height > height) height = size.height\n }\n return { width, height }\n}\n", "import { slot, type Slot, type SlotInput } from \"./slot\"\n\nexport const RADIAL_DIRECTIONS = [\"clockwise\", \"counterclockwise\"] as const\nexport type RadialDirection = (typeof RADIAL_DIRECTIONS)[number]\n\nexport interface RadialArrangement {\n kind: \"radial\"\n radius: number\n /** Where the first item sits, degrees clockwise from twelve o'clock. */\n startAngle: number\n /** How much of the circle the items span, degrees. */\n sweep: number\n direction: RadialDirection\n /** Turn each item so its top faces away from the centre. */\n rotateItems: boolean\n /** Degrees per second the ring turns on its own. */\n spinSpeed: number\n}\n\n/**\n * Clockwise from twelve o'clock. A full circle divides by the count (the last item\n * must not land on the first), an arc by one less (both ends get an item); the divisor\n * slides between them steeply as the arc closes, so a sweep animated to 360 lands without a jump.\n */\nexport function radialAngles(arrangement: RadialArrangement, count: number, time: number): number[] {\n const sweep = arrangement.sweep\n const closing = Math.min(1, Math.abs(sweep) / 360) ** 8\n const step = count <= 1 ? 0 : sweep / (count - 1 + closing)\n const sign = arrangement.direction === \"counterclockwise\" ? -1 : 1\n const start = arrangement.startAngle + arrangement.spinSpeed * time\n const angles: number[] = []\n for (let k = 0; k < count; k++) angles.push(start + sign * k * step)\n return angles\n}\n\nexport function radialSlots(arrangement: RadialArrangement, input: SlotInput): Slot[] {\n const angles = radialAngles(arrangement, input.count, input.time)\n const start = angles[0] ?? 0\n return angles.map((angle) => {\n const rad = (angle * Math.PI) / 180\n const s = slot(arrangement.radius * Math.sin(rad), arrangement.radius * Math.cos(rad), {\n kind: \"radial\",\n angle: Math.abs(angle - start),\n })\n if (arrangement.rotateItems) s.rotation = angle\n return s\n })\n}\n\n/** The change to `startAngle` that brings slot `index` to twelve o'clock by the shorter way round. */\nexport function radialTurnToTop(arrangement: RadialArrangement, count: number, index: number): number {\n const angle = radialAngles({ ...arrangement, spinSpeed: 0 }, count, 0)[index] ?? arrangement.startAngle\n return -wrapDegrees(angle)\n}\n\n/** `degrees` folded into `(-180, 180]`. */\nexport function wrapDegrees(degrees: number): number {\n const wrapped = ((degrees % 360) + 360) % 360\n return wrapped > 180 ? wrapped - 360 : wrapped\n}\n", "import type { Size2D } from \"@motionscript/sdk\"\n\nimport { largest, slot, type Slot, type SlotInput } from \"./slot\"\n\nexport const FILL_DIRECTIONS = [\"row\", \"column\"] as const\nexport type FillDirection = (typeof FILL_DIRECTIONS)[number]\n\n/** The largest child (`fit`), a size of its own (`fixed`), or an equal share of the box (`fill`). */\nexport const CELL_MODES = [\"fit\", \"fixed\", \"fill\"] as const\nexport type CellMode = (typeof CELL_MODES)[number]\n\n/** Where a short last row (or column, filling by column) sits. */\nexport const LINE_ALIGNS = [\"start\", \"center\", \"end\"] as const\nexport type LineAlign = (typeof LINE_ALIGNS)[number]\n\nexport interface RectangularArrangement {\n kind: \"rectangular\"\n columns: number\n fillDirection: FillDirection\n cellMode: CellMode\n cellWidth: number\n cellHeight: number\n columnGap: number\n rowGap: number\n lastLineAlign: LineAlign\n /** Share of a column's pitch every other row shifts right — `0.5` is a brick bond. */\n rowOffset: number\n /** Share of a row's pitch every other column shifts down. */\n columnOffset: number\n}\n\n/** Rows and columns `count` items make, `columns` wide. */\nexport function rectangularShape(arrangement: RectangularArrangement, count: number): { rows: number; columns: number } {\n const columns = Math.max(1, Math.round(arrangement.columns))\n const rows = Math.max(1, Math.ceil(count / columns))\n // Filling by column, the rows are set by the count, and a column the items\n // never reach would pull the block off centre.\n if (arrangement.fillDirection === \"column\") return { rows, columns: Math.max(1, Math.ceil(count / rows)) }\n return { rows, columns }\n}\n\n/** The cell every item is laid out in — what a `fill` child is measured against. */\nexport function rectangularCell(\n arrangement: RectangularArrangement,\n count: number,\n sizes: readonly Size2D[],\n box: Size2D,\n): Size2D {\n const { rows, columns } = rectangularShape(arrangement, count)\n switch (arrangement.cellMode) {\n case \"fixed\":\n return { width: Math.max(0, arrangement.cellWidth), height: Math.max(0, arrangement.cellHeight) }\n case \"fill\":\n return {\n width: Math.max(0, (box.width - arrangement.columnGap * (columns - 1)) / columns),\n height: Math.max(0, (box.height - arrangement.rowGap * (rows - 1)) / rows),\n }\n default:\n return largest(sizes)\n }\n}\n\n/**\n * Items fill rows left to right, top to bottom (or columns top to bottom, left to\n * right), and the whole block is centred on the grid.\n */\nexport function rectangularSlots(arrangement: RectangularArrangement, input: SlotInput): Slot[] {\n const { count } = input\n if (count === 0) return []\n const { rows, columns } = rectangularShape(arrangement, count)\n const byColumn = arrangement.fillDirection === \"column\"\n // Filling by column keeps the column count and lets the rows follow from it.\n const lines = byColumn ? columns : rows\n const perLine = byColumn ? rows : columns\n const cell = rectangularCell(arrangement, count, input.sizes, input.box)\n const pitchX = cell.width + arrangement.columnGap\n const pitchY = cell.height + arrangement.rowGap\n const lastLine = lines - 1\n const lastCount = count - lastLine * perLine\n const shortBy = perLine - lastCount\n const lead = arrangement.lastLineAlign === \"center\" ? shortBy / 2 : arrangement.lastLineAlign === \"end\" ? shortBy : 0\n // Shifting every other row by a share of a pitch moves the block's centre by\n // half that share; taking it back keeps the block centred on the grid.\n const shiftX = arrangement.rowOffset * pitchX\n const shiftY = arrangement.columnOffset * pitchY\n\n const slots: Slot[] = []\n for (let i = 0; i < count; i++) {\n const line = Math.floor(i / perLine)\n let along = i % perLine\n if (line === lastLine) along += lead\n const row = byColumn ? along : line\n const column = byColumn ? line : along\n // A centred short line sits between whole cells; its parity is the cell it covers most.\n const rowIndex = Math.round(row)\n const columnIndex = Math.round(column)\n const x = (column - (columns - 1) / 2) * pitchX\n + (rowIndex % 2 === 1 ? shiftX : 0) - (rows > 1 ? shiftX / 2 : 0)\n const y = ((rows - 1) / 2 - row) * pitchY\n - (columnIndex % 2 === 1 ? shiftY : 0) + (columns > 1 ? shiftY / 2 : 0)\n slots.push(slot(x, y, { kind: \"rectangular\", row: rowIndex, column: columnIndex }))\n }\n return slots\n}\n", "import { slot, type Slot, type SlotInput } from \"./slot\"\n\n/** `outward` lays each item on the sphere's surface; `billboard` keeps every item facing the viewer. */\nexport const SPHERE_FACINGS = [\"outward\", \"billboard\"] as const\nexport type SphereFacing = (typeof SPHERE_FACINGS)[number]\n\nexport const SPHERE_AXES = [\"x\", \"y\", \"z\"] as const\nexport type SphereAxis = (typeof SPHERE_AXES)[number]\n\nexport interface SphereArrangement {\n kind: \"sphere\"\n radius: number\n /** Turn about the vertical axis, degrees — positive carries the front to the right. */\n yaw: number\n /** Turn about the horizontal axis, degrees — positive brings the top toward the viewer. */\n pitch: number\n /** Turn about the view axis, degrees clockwise. */\n roll: number\n facing: SphereFacing\n /** The camera's distance from the sphere's centre plane, px — smaller is more dramatic. */\n focalLength: number\n /** How much the back half fades, `0..1`. */\n depthFade: number\n /** Hide the items whose faces point away from the viewer. */\n cullBackfaces: boolean\n /** Degrees per second of yaw the sphere turns on its own. */\n spinSpeed: number\n}\n\nconst GOLDEN_ANGLE = Math.PI * (3 - Math.sqrt(5))\nconst DEG = 180 / Math.PI\n\n/** Point `k` of `count` on the unit sphere — a Fibonacci lattice, as even as `count` points get. */\nexport function fibonacciPoint(k: number, count: number): [number, number, number] {\n if (count <= 1) return [0, 0, 1]\n const y = 1 - (2 * (k + 0.5)) / count\n const r = Math.sqrt(Math.max(0, 1 - y * y))\n const theta = k * GOLDEN_ANGLE\n return [Math.cos(theta) * r, y, Math.sin(theta) * r]\n}\n\n/** `p` turned by yaw, then pitch, then roll — y-up, z toward the viewer. */\nexport function orient(p: readonly [number, number, number], yaw: number, pitch: number, roll: number): [number, number, number] {\n const [x0, y0, z0] = p\n const ya = yaw / DEG, pa = pitch / DEG, ra = roll / DEG\n const x1 = x0 * Math.cos(ya) + z0 * Math.sin(ya)\n const z1 = -x0 * Math.sin(ya) + z0 * Math.cos(ya)\n const y2 = y0 * Math.cos(pa) - z1 * Math.sin(pa)\n const z2 = y0 * Math.sin(pa) + z1 * Math.cos(pa)\n return [x1 * Math.cos(ra) + y2 * Math.sin(ra), -x1 * Math.sin(ra) + y2 * Math.cos(ra), z2]\n}\n\nexport function sphereSlots(arrangement: SphereArrangement, input: SlotInput): Slot[] {\n const { count } = input\n const radius = arrangement.radius\n const yaw = arrangement.yaw + arrangement.spinSpeed * input.time\n const outward = arrangement.facing === \"outward\"\n const slots: Slot[] = []\n for (let k = 0; k < count; k++) {\n const q = fibonacciPoint(k, count)\n const [nx, ny, nz] = orient(q, yaw, arrangement.pitch, arrangement.roll)\n const s = slot(nx * radius, ny * radius, {\n kind: \"sphere\",\n lat: Math.asin(Math.max(-1, Math.min(1, q[1]))) * DEG,\n lon: Math.atan2(q[2], q[0]) * DEG,\n depth: nz,\n })\n s.depth = nz * radius\n if (outward) {\n // The tilt whose `Rx · Ry` turns a face's normal onto the surface normal.\n s.rotationY = Math.asin(Math.max(-1, Math.min(1, nx))) * DEG\n s.rotationX = Math.atan2(ny, nz) * DEG\n }\n s.opacity = 1 - arrangement.depthFade * (1 - (nz + 1) / 2)\n if (outward && arrangement.cullBackfaces && facesAway(s, [nx, ny, nz], arrangement.focalLength)) s.opacity = 0\n slots.push(s)\n }\n return slots\n}\n\n/** Whether an outward face at `s` shows its back to a viewer `focal` px in front of the centre. */\nfunction facesAway(s: Slot, normal: readonly [number, number, number], focal: number): boolean {\n if (focal <= 0) return normal[2] < 0\n return normal[0] * -s.x + normal[1] * -s.y + normal[2] * (focal - s.depth) < 0\n}\n\n/** The yaw and pitch that bring point `index` of `count` round to face the viewer. */\nexport function sphereFaceForward(count: number, index: number): { yaw: number; pitch: number } {\n const [x, y, z] = fibonacciPoint(index, count)\n return {\n yaw: -Math.atan2(x, z) * DEG,\n pitch: Math.atan2(y, Math.hypot(x, z)) * DEG,\n }\n}\n", "import type { PathCommand, Size2D } from \"@motionscript/sdk\"\n\n/** Shapes drawn to fill the grid's box, centred and y-up; the closed ones run clockwise so flow goes the same way round. */\nexport const PATH_TEMPLATES = [\n \"circle\",\n \"square\",\n \"star\",\n \"heart\",\n \"infinity\",\n \"wave\",\n \"spiral\",\n \"arc\",\n \"line\",\n] as const\nexport type PathTemplate = (typeof PATH_TEMPLATES)[number]\n\n/** What a template is drawn at when the grid has no box to fill. */\nconst FALLBACK = 400\n\nconst DRAWN = new Map<string, PathCommand[]>()\nconst DRAWN_CACHE = 64\n\n/**\n * `template` drawn to fill `box`. The same template at the same size is the\n * same array, which is what lets the path's measurement be kept between frames.\n */\nexport function templatePath(template: PathTemplate, box: Size2D): PathCommand[] {\n const key = `${template}:${Math.round(box.width * 100)}:${Math.round(box.height * 100)}`\n const hit = DRAWN.get(key)\n if (hit) return hit\n const path = drawTemplate(template, box)\n if (DRAWN.size >= DRAWN_CACHE) DRAWN.delete(DRAWN.keys().next().value!)\n DRAWN.set(key, path)\n return path\n}\n\nfunction drawTemplate(template: PathTemplate, box: Size2D): PathCommand[] {\n const w = box.width > 0 ? box.width : FALLBACK\n const h = box.height > 0 ? box.height : FALLBACK\n const rx = w / 2\n const ry = h / 2\n switch (template) {\n case \"square\":\n return closed([\n [-rx, ry], [rx, ry], [rx, -ry], [-rx, -ry],\n ])\n case \"star\": {\n const points: [number, number][] = []\n for (let i = 0; i < 10; i++) {\n const angle = (i * Math.PI) / 5\n const r = i % 2 === 0 ? 1 : 0.45\n points.push([Math.sin(angle) * rx * r, Math.cos(angle) * ry * r])\n }\n return closed(points)\n }\n case \"heart\":\n return closed(sample(96, (t) => {\n // The classic heart curve, from its top notch, clockwise.\n const a = t * 2 * Math.PI\n const x = 16 * Math.sin(a) ** 3\n const y = 13 * Math.cos(a) - 5 * Math.cos(2 * a) - 2 * Math.cos(3 * a) - Math.cos(4 * a)\n return [(x / 17) * rx, ((y + 2.5) / 15.5) * ry]\n }).slice(0, -1))\n case \"infinity\":\n return closed(sample(96, (t) => {\n const a = t * 2 * Math.PI\n const d = 1 + Math.sin(a) ** 2\n return [(Math.cos(a) / d) * rx, ((Math.sin(a) * Math.cos(a)) / d) * ry * 2]\n }).slice(0, -1))\n case \"wave\":\n return open(sample(96, (t) => [(-1 + 2 * t) * rx, Math.sin(t * 4 * Math.PI) * ry * 0.6]))\n case \"spiral\":\n return open(sample(160, (t) => {\n const a = t * 3 * 2 * Math.PI\n const r = 0.08 + 0.92 * t\n return [Math.sin(a) * rx * r, Math.cos(a) * ry * r]\n }))\n case \"arc\":\n return open(sample(64, (t) => {\n const a = -Math.PI / 2 + t * Math.PI\n return [Math.sin(a) * rx, -ry + Math.cos(a) * h]\n }))\n case \"line\":\n return [{ type: \"M\", x: -rx, y: 0 }, { type: \"L\", x: rx, y: 0 }]\n default:\n return ellipse(rx, ry)\n }\n}\n\n/** Four quarter-arcs from the top, clockwise. */\nfunction ellipse(rx: number, ry: number): PathCommand[] {\n const k = 0.5522847498\n return [\n { type: \"M\", x: 0, y: ry },\n { type: \"C\", x1: k * rx, y1: ry, x2: rx, y2: k * ry, x: rx, y: 0 },\n { type: \"C\", x1: rx, y1: -k * ry, x2: k * rx, y2: -ry, x: 0, y: -ry },\n { type: \"C\", x1: -k * rx, y1: -ry, x2: -rx, y2: -k * ry, x: -rx, y: 0 },\n { type: \"C\", x1: -rx, y1: k * ry, x2: -k * rx, y2: ry, x: 0, y: ry },\n { type: \"Z\" },\n ]\n}\n\nfunction sample(steps: number, at: (t: number) => [number, number]): [number, number][] {\n const points: [number, number][] = []\n for (let i = 0; i <= steps; i++) points.push(at(i / steps))\n return points\n}\n\nfunction open(points: [number, number][]): PathCommand[] {\n return points.map(([x, y], i) => (i === 0 ? { type: \"M\", x, y } : { type: \"L\", x, y }))\n}\n\nfunction closed(points: [number, number][]): PathCommand[] {\n return [...open(points), { type: \"Z\" }]\n}\n", "import { pathSlots, type PathArrangement } from \"./path\"\nimport { radialSlots, type RadialArrangement } from \"./radial\"\nimport { rectangularSlots, type RectangularArrangement } from \"./rectangular\"\nimport type { Slot, SlotInput } from \"./slot\"\nimport { sphereSlots, type SphereArrangement } from \"./sphere\"\n\nexport * from \"./slot\"\nexport * from \"./rectangular\"\nexport * from \"./radial\"\nexport * from \"./path\"\nexport * from \"./path-templates\"\nexport * from \"./sphere\"\n\n/**\n * Everything an arrangement needs to place items, as plain data — so a\n * transition can keep the one it is leaving, and a grid can borrow another's.\n */\nexport type Arrangement = RectangularArrangement | RadialArrangement | PathArrangement | SphereArrangement\n\n/** Where each of `input.count` items sits under `arrangement`, in slot order. */\nexport function slotsOf(arrangement: Arrangement, input: SlotInput): Slot[] {\n switch (arrangement.kind) {\n case \"rectangular\":\n return rectangularSlots(arrangement, input)\n case \"radial\":\n return radialSlots(arrangement, input)\n case \"path\":\n return pathSlots(arrangement, input)\n case \"sphere\":\n return sphereSlots(arrangement, input)\n }\n}\n\n/** The camera distance an arrangement is seen through, or `0` when it is flat. */\nexport function focalLengthOf(arrangement: Arrangement): number {\n return arrangement.kind === \"sphere\" ? Math.max(1, arrangement.focalLength) : 0\n}\n", "/** A seeded generator in `[0, 1)` — mulberry32, so a shuffle is the same on every frame and every machine. */\nfunction seededRandom(seed: number): () => number {\n let a = Math.floor(seed) >>> 0\n return () => {\n a = (a + 0x6d2b79f5) >>> 0\n let t = a\n t = Math.imul(t ^ (t >>> 15), t | 1)\n t ^= t + Math.imul(t ^ (t >>> 7), t | 61)\n return ((t ^ (t >>> 14)) >>> 0) / 4294967296\n }\n}\n\n/** `values` in a seeded random order. */\nexport function shuffled<T>(values: readonly T[], seed: number): T[] {\n const out = [...values]\n const random = seededRandom(seed)\n for (let i = out.length - 1; i > 0; i--) {\n const j = Math.floor(random() * (i + 1))\n ;[out[i], out[j]] = [out[j], out[i]]\n }\n return out\n}\n\n/** A stable number for a string — a node's id, so its \"random\" stagger never changes between builds. */\nexport function hashSeed(text: string): number {\n let h = 2166136261\n for (let i = 0; i < text.length; i++) h = Math.imul(h ^ text.charCodeAt(i), 16777619)\n return h >>> 0\n}\n", "import { shuffled } from \"./random\"\nimport type { Slot } from \"./slots\"\n\n/** The first five work on any grid; the rest follow one arrangement's geometry and fall back to item order where it has none. */\nexport const STAGGER_ORDERS = [\n \"index\",\n \"reverse\",\n \"random\",\n \"centerOut\",\n \"edgesIn\",\n \"row\",\n \"column\",\n \"angle\",\n \"path\",\n \"depth\",\n] as const\nexport type StaggerOrder = (typeof STAGGER_ORDERS)[number]\n\n/** The most of a command's length the offsets may take; the rest is each item's own motion. */\nconst MAX_STAGGER = 0.95\n\n/**\n * Each item's start, `0..1`, as a share of the stagger: `0` goes first, `1`\n * last, and items that tie go together — a ring revealed `centerOut` from its\n * centre appears all at once, which is what that means.\n */\nexport function staggerRanks(order: StaggerOrder, slots: readonly Slot[], seed: number): number[] {\n const n = slots.length\n const keys = keysOf(order, slots, seed)\n let min = Infinity\n let max = -Infinity\n for (const key of keys) {\n if (key < min) min = key\n if (key > max) max = key\n }\n const range = max - min\n if (!(range > 1e-9)) return new Array<number>(n).fill(0)\n return keys.map((key) => (key - min) / range)\n}\n\n/** Each item runs the same length, starting `rank · stagger` in; the stagger lives inside the command's duration. */\nexport function staggerProgress(rank: number, t: number, stagger: number): number {\n const s = Math.max(0, Math.min(MAX_STAGGER, stagger))\n const p = s === 0 ? t : (t - rank * s) / (1 - s)\n return p < 0 ? 0 : p > 1 ? 1 : p\n}\n\nfunction keysOf(order: StaggerOrder, slots: readonly Slot[], seed: number): number[] {\n switch (order) {\n case \"reverse\":\n return slots.map((_, i) => -i)\n case \"random\": {\n const sequence = shuffled(slots.map((_, i) => i), seed)\n const keys = new Array<number>(slots.length)\n sequence.forEach((item, rank) => {\n keys[item] = rank\n })\n return keys\n }\n case \"centerOut\":\n return slots.map((s) => Math.round(Math.hypot(s.x, s.y, s.depth) * 1000) / 1000)\n case \"edgesIn\":\n return slots.map((s) => -Math.round(Math.hypot(s.x, s.y, s.depth) * 1000) / 1000)\n case \"row\":\n return slots.map((s) => (s.meta.kind === \"rectangular\" ? s.meta.row : -Math.round(s.y)))\n case \"column\":\n return slots.map((s) => (s.meta.kind === \"rectangular\" ? s.meta.column : Math.round(s.x)))\n case \"angle\":\n return slots.map((s, i) =>\n s.meta.kind === \"radial\" ? s.meta.angle : s.meta.kind === \"rectangular\" || s.meta.kind === \"sphere\" ? clockAngle(s) : i\n )\n case \"path\":\n return slots.map((s, i) => (s.meta.kind === \"path\" ? s.meta.t : i))\n case \"depth\":\n return slots.map((s, i) => (s.meta.kind === \"sphere\" ? -s.meta.depth : i))\n default:\n return slots.map((_, i) => i)\n }\n}\n\n/** Degrees clockwise from twelve o'clock to where `s` sits. */\nfunction clockAngle(s: Slot): number {\n const angle = (Math.atan2(s.x, s.y) * 180) / Math.PI\n return angle < 0 ? angle + 360 : angle\n}\n", "import { clamp, type Size2D } from \"@motionscript/sdk\"\n\nimport type { Slot } from \"./slots\"\n\n/**\n * What an item does on its way in (or out): grow from nothing, fade, fly out of\n * the grid's centre, rise into place, flip up, or spin in.\n */\nexport const REVEAL_STYLES = [\"scale\", \"fade\", \"center\", \"rise\", \"flip\", \"spin\"] as const\nexport type RevealStyle = (typeof REVEAL_STYLES)[number]\n\n/** What a wave does to each item as it passes. */\nexport const WAVE_STYLES = [\"scale\", \"lift\", \"fade\", \"spin\"] as const\nexport type WaveStyle = (typeof WAVE_STYLES)[number]\n\n/** `1` shown and `0` gone, past `1` under an overshooting ease; absent means every item is shown. */\nexport interface RevealState {\n style: RevealStyle\n values: readonly number[]\n}\n\n/** Each item's share of the wave passing through it, `0` at rest and `1` at the crest. */\nexport interface WaveState {\n style: WaveStyle\n /** How big the crest is — a share of the item's size, opacity or a turn, by style. */\n amount: number\n values: readonly number[]\n}\n\n/** Each item's emphasis: `1` the focus, `-1` pushed back, `0` untouched. */\nexport interface FocusState {\n /** How far the others fade, `0..1`. */\n dim: number\n /** How much the focus grows, as a share of its size; the others shrink by half that. */\n grow: number\n values: readonly number[]\n}\n\n/** Layer item `i`'s reveal, wave and focus onto its slot, in place. */\nexport function applyItemEffects(\n s: Slot,\n i: number,\n size: Size2D,\n reveal: RevealState | null | undefined,\n wave: WaveState | null | undefined,\n focus: FocusState | null | undefined,\n): void {\n if (reveal) applyReveal(s, reveal.style, reveal.values[i] ?? 1, size)\n if (wave) applyWave(s, wave, wave.values[i] ?? 0, size)\n if (focus) applyFocus(s, focus, focus.values[i] ?? 0)\n}\n\nfunction applyReveal(s: Slot, style: RevealStyle, v: number, size: Size2D): void {\n if (v === 1) return\n const shown = clamp(v, 0, 1)\n switch (style) {\n case \"fade\":\n s.opacity *= shown\n break\n case \"center\":\n s.x *= v\n s.y *= v\n s.depth *= v\n s.opacity *= clamp(v * 4, 0, 1)\n break\n case \"rise\":\n s.y -= (1 - v) * Math.max(40, size.height)\n s.opacity *= shown\n break\n case \"flip\":\n s.rotationX += (1 - v) * 90\n break\n case \"spin\":\n s.rotation -= (1 - v) * 180\n s.scale *= Math.max(0, v)\n break\n default:\n s.scale *= Math.max(0, v)\n }\n}\n\nfunction applyWave(s: Slot, wave: WaveState, w: number, size: Size2D): void {\n if (w === 0) return\n switch (wave.style) {\n case \"lift\":\n s.y += wave.amount * w * Math.max(40, size.height)\n break\n case \"fade\":\n s.opacity *= clamp(1 - wave.amount * w, 0, 1)\n break\n case \"spin\":\n s.rotation += wave.amount * w * 360\n break\n default:\n s.scale *= 1 + wave.amount * w\n }\n}\n\nfunction applyFocus(s: Slot, focus: FocusState, f: number): void {\n if (f === 0) return\n if (f > 0) {\n s.scale *= 1 + focus.grow * f\n return\n }\n s.opacity *= clamp(1 - focus.dim * -f, 0, 1)\n s.scale *= Math.max(0, 1 + focus.grow * 0.5 * f)\n}\n", "/**\n * `order` lists items in slot order (slot `k` holds item `order[k]`), repaired into a\n * permutation of `0..count-1` — valid entries first, then the rest — so a stale entry, a\n * repeat or a child added or removed never leaves a slot empty or doubled.\n */\nexport function normalizeOrder(order: readonly number[] | undefined, count: number): number[] {\n const out: number[] = []\n const taken = new Array<boolean>(count).fill(false)\n for (const entry of order ?? []) {\n const item = Math.round(entry)\n if (item >= 0 && item < count && !taken[item]) {\n taken[item] = true\n out.push(item)\n }\n }\n for (let item = 0; item < count; item++) if (!taken[item]) out.push(item)\n return out\n}\n\n/** For each item, the slot it sits in. */\nexport function slotOfItem(order: readonly number[]): number[] {\n const slots = new Array<number>(order.length)\n order.forEach((item, slot) => {\n slots[item] = slot\n })\n return slots\n}\n\n/** An order written as `\"2, 0, 1\"` or as numbers. */\nexport function parseOrder(value: unknown): number[] {\n if (Array.isArray(value)) return value.map(Number).filter(Number.isFinite)\n if (typeof value !== \"string\") return []\n return value\n .split(/[\\s,]+/)\n .filter((part) => part !== \"\")\n .map(Number)\n .filter(Number.isFinite)\n}\n", "import {\n commandsFor,\n easeIn,\n easeInOut,\n easeOut,\n flowOps,\n insetsOps,\n Types,\n type ChildView,\n type InsetsResolved,\n type LayoutBox,\n type LayoutItem,\n type Measurer,\n type Node2D,\n type NodeFrame,\n type NodeView,\n type Piece,\n type Placement2D,\n type RenderContext,\n type Size2D,\n type SpaceCamera,\n type Timeline,\n type Values,\n} from \"@motionscript/sdk\"\n\nimport {\n applyItemEffects,\n REVEAL_STYLES,\n WAVE_STYLES,\n type FocusState,\n type RevealState,\n type WaveState,\n} from \"./item-effects\"\nimport { normalizeOrder, parseOrder, slotOfItem } from \"./order\"\nimport { hashSeed, shuffled } from \"./random\"\nimport { blendSlot, focalLengthOf, slotsOf, spreadSlot, type Arrangement, type Slot } from \"./slots\"\nimport { STAGGER_ORDERS, staggerProgress, staggerRanks, type StaggerOrder } from \"./stagger\"\n\n// What every grid is built from: spread `state`, `commands` and `defaults` in, give `fields` the\n// {@link Arranger} that makes the arrangement from the state, and pass the component and its\n// arranger through {@link define}.\n// The items are the children in layer order; a slot is a parent transform on a child, so its own\n// x/y/rotation/scale and their commands still work relative to it.\n// Every frame measures the children, asks the arrangement for slots (pure in state, sizes and\n// clock), blends from the arrangement a transition leaves, and layers the per-item effects; the\n// result is each child's box and slot, which rendering, picking and `global` all read.\n// Every command is a pure function of time. Per-item ones stagger inside their duration and write\n// their state to entries, which keeps them seekable; ones that change the arrangement keep the one\n// they leave as data and blend each item from its old slot to its new.\n\n/** An arrangement a grid is leaving, kept as data so its slots can be worked out afresh every frame. */\nexport interface GridSnapshot {\n arrangement: Arrangement\n /** The grid the arrangement was borrowed from, or `\"\"` for the grid's own. */\n source: string\n order: readonly number[]\n spread: number\n}\n\n/** A change of arrangement under way: where the items are coming from, and how far each has come. */\nexport interface GridTransition {\n from: GridSnapshot\n /** Each item's eased, staggered progress, `0..1`. */\n mix: readonly number[]\n}\n\n/** The stagger options every per-item command takes. */\nexport interface StaggerArgs {\n staggerOrder?: StaggerOrder\n /** `0..0.95`: how much of the command's length the items' offsets take up. */\n stagger?: number\n}\n\n/**\n * Every grid's document key — what a reference to \"another grid\" may name. A\n * `nodeRef` descriptor carries it as `nodeTypes`, for a host's picker to offer\n * only those.\n */\nexport const ITEM_GRID_TYPES = [\"rectangularGrid\", \"radialGrid\", \"pathGrid\", \"sphereGrid\"] as const\n\n/** The stagger a move to new slots takes when its command states none. */\nexport const TRANSITION_STAGGER = 0.3\n\n/** A reference to another node, a host's picker offering only `types`. Its fields read a view of it. */\nexport function nodeRef(types: readonly string[]) {\n const described = { kind: \"nodeRef\", nodeTypes: types, animatable: false }\n return Types.custom<string, NodeView | null>(\"\", described)\n}\n\n/** The stagger args every per-item command takes, `stagger` defaulting to `fallback`. */\nexport function staggerArgs(fallback: number) {\n return {\n staggerOrder: Types.oneOf(STAGGER_ORDERS, { default: \"index\" }),\n stagger: Types.number(fallback, { min: 0, max: 0.95, step: 0.05 }),\n }\n}\n\n/**\n * A command arg a host fills in with `hint`, which a row may leave out: the\n * command then keeps what the grid has. A run arg's default is both what a\n * host offers and what an omitted arg means, so the hint rides on the arg's\n * description alone, and an omitted arg reads `undefined`.\n */\nexport function hinted<T extends number | string>(hint: T, options: object = {}) {\n const described: Record<string, unknown> = { ...options, default: hint }\n return Types.custom<T | undefined>(undefined, described as never)\n}\n\n/** A command arg naming another node, a host's picker offering only `types`; left out, it reads `undefined`. */\nexport function nodeRefArg(types: readonly string[]) {\n const described = { kind: \"nodeRef\", nodeTypes: types }\n return Types.custom<string | undefined>(undefined, described)\n}\n\n/** The state every grid shares. */\nexport const state = {\n /** Items in slot order: slot `k` holds child `order[k]`. Empty is the children's own order. */\n order: Types.custom<number[]>([], { kind: \"order\", animatable: false }),\n /** `0` gathers every item at the centre, `1` is the arrangement, past `1` pushes them apart. */\n spread: Types.number(1, { min: 0, max: 3, step: 0.05 }),\n /** Another grid whose arrangement this one takes on — what `morphInto` animates. */\n arrangeLike: nodeRef(ITEM_GRID_TYPES),\n // What the per-item commands write. State rather than settings: a command\n // owns each while it runs, and a document has no reason to name them. Unset\n // until a command writes one, so a fresh node's row does not state them.\n revealState: Types.custom<RevealState | null | undefined>(undefined, { kind: \"state\", animatable: false }),\n waveState: Types.custom<WaveState | null | undefined>(undefined, { kind: \"state\", animatable: false }),\n focusState: Types.custom<FocusState | null | undefined>(undefined, { kind: \"state\", animatable: false }),\n transition: Types.custom<GridTransition | null | undefined>(undefined, { kind: \"state\", animatable: false }),\n /** The grid a transition's leaving arrangement was borrowed from, followed while the items travel. */\n transitionSource: Types.custom<string, NodeView | null, { readonly private: true }>(\"\", { kind: \"nodeRef\", private: true }),\n}\n\n/** A grid's size is what its items come to, whether it was built with children or they arrive after it. */\nexport const defaults = { width: \"hug\", height: \"hug\" } as const\n\n/** What a grid's commands read of its state, beyond its own arrangement's entries. */\nexport type GridValues = Values<typeof state> & { readonly padding: InsetsResolved }\n\n/** What a grid's measure, layout and render read of its state, beyond its own arrangement's entries. */\nexport type GridState = GridValues & {\n readonly width: LayoutItem[\"width\"]\n readonly height: LayoutItem[\"height\"]\n readonly children: readonly ChildView[]\n}\n\n/** What makes one grid's arrangement from its state: the rest of a grid is this module. */\nexport interface Arranger<S = unknown> {\n /** This grid's own arrangement, for a content box of `box`. */\n arrangement(state: S, box: Size2D): Arrangement\n /** The room each item is measured in — the whole content box, unless the arrangement has cells. */\n itemSpace?(state: S, count: number, space: Size2D): Size2D\n}\n\ntype GridComponent = { readonly key: string; readonly node: abstract new (...args: never[]) => object }\n\nconst GRIDS = new Map<string, { readonly component: GridComponent; readonly arranger: Arranger<never> }>()\n\n/**\n * `component` as a grid: registers its `arranger`, which another grid borrowing\n * its arrangement or morphing into it reads it by, and which {@link isGrid} knows it by.\n */\nexport function define<C extends GridComponent, S>(component: C, arranger: Arranger<S>): C {\n GRIDS.set(component.key, { component, arranger: arranger as Arranger<never> })\n return component\n}\n\n/** Whether `value` is a node of one of the grids {@link define} has seen. */\nexport function isGrid(value: unknown): boolean {\n for (const { component } of GRIDS.values()) if (value instanceof component.node) return true\n return false\n}\n\n/** The grid's measure, layout and render, for `arranger`'s arrangement: spread them into the component. */\nexport function fields<S>(arranger: Arranger<S>) {\n return {\n measure: (measurer: Measurer, s: GridState & S, children: readonly ChildView[]) => measure(measurer, s, children, arranger),\n layout: (box: LayoutBox, s: GridState & S, children: readonly ChildView[]) => layout(box, s, children, arranger),\n render: (ctx: RenderContext, s: GridState & S) => render(ctx, s, arranger),\n }\n}\n\nconst NO_CONTENT: Size2D = { width: 0, height: 0 }\nconst CENTRE = { x: 0, y: 0 }\n\n/** What `measure` found, for `layout` to reuse in the same pass. Keyed by the grid's state, one object per node. */\nconst measured = new WeakMap<object, { space: Size2D; sizes: Size2D[] }>()\n\nexport function measure<S>(measurer: Measurer, s: GridState & S, children: readonly ChildView[], arranger: Arranger<S>): Size2D {\n const constraints = { maxWidth: measurer.max.width, maxHeight: measurer.max.height }\n const padding = s.padding\n if (children.length === 0) {\n measured.delete(s)\n return flowOps.size(s, constraints, padding, NO_CONTENT)\n }\n const space = flowOps.contentBox(s, constraints, padding)\n const sizes = measureItems(children, space, s, arranger)\n measured.set(s, { space, sizes })\n const grid = { state: s, arranger, children, isSelf: sharesChildren(children) }\n const target = targetSlots(grid, sizes.length, sizes, space, measurer.time.total)\n return flowOps.size(s, constraints, padding, extentOf(target.slots, sizes, focalOf(s, target.arrangement)))\n}\n\nexport function layout<S>(box: LayoutBox, s: GridState & S, children: readonly ChildView[], arranger: Arranger<S>): readonly Placement2D[] {\n const kept = measured.get(s)\n measured.delete(s)\n if (children.length === 0) return []\n const inner = insetsOps.insetBounds(box.width, box.height, s.padding)\n const sizes = kept && kept.sizes.length === children.length && sameSize(kept.space, inner)\n ? kept.sizes\n : measureItems(children, inner, s, arranger)\n const slots = resolve({ state: s, arranger, children, isSelf: sharesChildren(children) }, sizes, inner, box.time.total)\n return slots.map((slot, i) => placement(inner, slot, sizes[i]))\n}\n\n/** A grid with depth is seen through a camera of its own, painting far to near, unless it already sits in a space, whose camera its items join. */\nexport function render<S>(ctx: RenderContext, s: GridState & S, arranger: Arranger<S>): void {\n // With no items there is nothing to see through a camera.\n const focal = s.children.length === 0 ? 0 : focalOf(s, arrangementOf({ state: s, arranger, children: [], isSelf: () => false }, contentBox(ctx.size, s.padding)))\n if (focal > 0 && !ctx.inSpace) ctx.space(cameraAt(focal))\n else ctx.children()\n}\n\n/** Its laid-out size inside its padding. */\nexport function contentBoxOf(grid: Node2D): Size2D {\n const b = grid.layoutBounds\n return contentBox({ width: b.width, height: b.height }, grid.effectivePadding())\n}\n\ntype GridTimeline = Timeline<StaggerArgs, never>\n\n/** Each item's slot as the arrangement stands while a command is built (the tree stands at time 0 then): what its stagger is ranked by. */\nexport function itemSlots(timeline: Timeline<object, never>, s: GridValues, children: readonly ChildView[]): Slot[] {\n const grid = commandGrid(timeline, s, children)\n const sizes = children.map((child) => child.size)\n return targetSlots(grid, children.length, sizes, contentBox(timeline.node.size, s.padding), 0).slots\n}\n\n/** Each item's start in a stagger. A random order is seeded by the node's id, so it never changes between builds. */\nexport function ranks(timeline: Timeline<object, never>, s: GridValues, children: readonly ChildView[], order: StaggerOrder | undefined): number[] {\n return staggerRanks(order ?? \"index\", itemSlots(timeline, s, children), hashSeed(timeline.node.id))\n}\n\n/** Writes `changes` to the arrangement and moves each item, staggered, from its slot in the one being left to its slot in the new one. */\nexport function transitionTo(\n timeline: GridTimeline,\n s: GridValues,\n children: readonly ChildView[],\n changes: Record<string, unknown>,\n stagger = TRANSITION_STAGGER,\n): Piece {\n const from = snapshot(timeline, s, children)\n const ease = timeline.easing ?? easeInOut(\"cubic\")\n const order = ranks(timeline, s, children, timeline.args.staggerOrder)\n const spread = timeline.args.stagger ?? stagger\n return timeline.animate((t) => {\n if (t >= 1) return { ...changes, transition: null, transitionSource: \"\" } as never\n const mix = order.map((rank) => ease(staggerProgress(rank, t, spread)))\n return { ...changes, transition: { from, mix }, transitionSource: from.source } as never\n }, { eased: false })\n}\n\n/** Emphasise the items `isFocus` picks and push the rest back. */\nexport function focusOn(\n timeline: Timeline<object, never>,\n s: GridValues,\n isFocus: (item: number) => boolean,\n count: number,\n dim: number,\n grow: number,\n): Piece {\n const from = s.focusState\n const target = Array.from({ length: count }, (_, i) => (isFocus(i) ? 1 : -1))\n const ease = timeline.easing ?? easeInOut(\"cubic\")\n return timeline.animate((t) => {\n const e = ease(t)\n return {\n focusState: {\n dim: lerp(from?.dim ?? dim, dim, e),\n grow: lerp(from?.grow ?? grow, grow, e),\n values: target.map((v, i) => lerp(from?.values[i] ?? 0, v, e)),\n },\n } as never\n }, { eased: false })\n}\n\n// What the commands are typed against: the shared state, and the padding every node has.\nconst GRID_STATE = { ...state, padding: Types.insets }\n\nexport const commands = commandsFor(GRID_STATE, {\n /**\n * Bring the items in, one after another. Every item starts hidden, so place\n * it where the grid enters — or after a `conceal`.\n */\n reveal: {\n args: { style: Types.oneOf(REVEAL_STYLES, { default: \"scale\" }), ...staggerArgs(0.5) },\n run: (timeline, s, children) => {\n const style = timeline.args.style ?? \"scale\"\n const ease = timeline.easing ?? (style === \"scale\" || style === \"flip\" ? easeOut(\"back\") : easeOut(\"cubic\"))\n const order = ranks(timeline as never, s, children, timeline.args.staggerOrder)\n const stagger = timeline.args.stagger ?? 0.5\n return timeline.animate((t) => {\n if (t >= 1) return { revealState: null }\n return { revealState: { style, values: order.map((rank) => ease(staggerProgress(rank, t, stagger))) } }\n }, { eased: false })\n },\n },\n /** Take the items out, one after another — `reveal` in reverse. They stay hidden after. */\n conceal: {\n args: { style: Types.oneOf(REVEAL_STYLES, { default: \"scale\" }), ...staggerArgs(0.5) },\n run: (timeline, s, children) => {\n const style = timeline.args.style ?? \"scale\"\n const ease = timeline.easing ?? (style === \"scale\" || style === \"flip\" ? easeIn(\"back\") : easeInOut(\"cubic\"))\n const order = ranks(timeline as never, s, children, timeline.args.staggerOrder)\n const stagger = timeline.args.stagger ?? 0.5\n const from = s.revealState?.values\n return timeline.animate((t) => ({\n revealState: {\n style,\n values: order.map((rank, i) => (from?.[i] ?? 1) * (1 - ease(staggerProgress(rank, t, stagger)))),\n },\n }), { eased: false })\n },\n },\n /** Send a ripple through the items that swells each in turn and settles back. */\n wave: {\n args: {\n style: Types.oneOf(WAVE_STYLES, { default: \"scale\" }),\n amount: Types.number(0.3, { min: 0, max: 2, step: 0.05 }),\n ...staggerArgs(0.7),\n },\n run: (timeline, s, children) => {\n const style = timeline.args.style ?? \"scale\"\n const amount = timeline.args.amount ?? 0.3\n const ease = timeline.easing ?? easeInOut(\"sine\")\n const order = ranks(timeline as never, s, children, timeline.args.staggerOrder)\n const stagger = timeline.args.stagger ?? 0.7\n return timeline.animate((t) => {\n if (t >= 1) return { waveState: null }\n return { waveState: { style, amount, values: order.map((rank) => Math.sin(Math.PI * ease(staggerProgress(rank, t, stagger)))) } }\n }, { eased: false })\n },\n },\n /** Bring one item (by its place in the layers, from 0) forward and push the rest back. */\n focus: {\n args: {\n item: Types.number(0, { min: 0, step: 1 }),\n dim: Types.number(0.7, { min: 0, max: 1, step: 0.05 }),\n grow: Types.number(0.15, { min: 0, max: 1, step: 0.05 }),\n },\n run: (timeline, s, children) => {\n const item = Math.round(timeline.args.item ?? 0)\n return focusOn(timeline as never, s, (i) => i === item, children.length, timeline.args.dim ?? 0.7, timeline.args.grow ?? 0.15)\n },\n },\n /** Bring every item back to even. */\n unfocus: (timeline, s) => {\n const from = s.focusState\n const ease = timeline.easing ?? easeInOut(\"cubic\")\n return timeline.animate((t) => {\n if (t >= 1 || !from) return { focusState: null }\n const k = 1 - ease(t)\n return { focusState: { ...from, values: from.values.map((v) => v * k) } }\n }, { eased: false })\n },\n /** Gather the items toward the centre (`0`), back to the arrangement (`1`), or push them apart. */\n spreadTo: {\n args: { spread: Types.number(1, { min: 0, max: 3, step: 0.05 }) },\n run: (timeline) => timeline.tween({ spread: timeline.args.spread ?? 1 }),\n },\n /** Send every item to a random slot. The same `seed` always deals the same way. */\n shuffle: {\n args: { seed: Types.number(1, { min: 0, step: 1 }), ...staggerArgs(TRANSITION_STAGGER) },\n run: (timeline, s, children) => {\n const current = normalizeOrder(s.order, children.length)\n let next = shuffled(current, timeline.args.seed ?? 1)\n // A shuffle that deals everything back where it was would look like nothing happened.\n if (next.length > 1 && next.every((item, k) => item === current[k])) next = [...next.slice(1), next[0]]\n return transitionTo(timeline as never, s, children, { order: next })\n },\n },\n /** Two items trade places, by their place in the layers. */\n swap: {\n args: {\n first: Types.number(0, { min: 0, step: 1 }),\n second: Types.number(1, { min: 0, step: 1 }),\n ...staggerArgs(0),\n },\n run: (timeline, s, children) => {\n const order = normalizeOrder(s.order, children.length)\n const a = order.indexOf(Math.round(timeline.args.first ?? 0))\n const b = order.indexOf(Math.round(timeline.args.second ?? 1))\n if (a >= 0 && b >= 0) [order[a], order[b]] = [order[b], order[a]]\n return transitionTo(timeline as never, s, children, { order }, 0)\n },\n },\n /** Move the items into a new order — a list of layer indices, first slot first, like `\"2, 0, 1\"`. */\n reorder: {\n args: { order: Types.text(\"\"), ...staggerArgs(TRANSITION_STAGGER) },\n run: (timeline, s, children) => {\n const order = normalizeOrder(parseOrder(timeline.args.order), children.length)\n return transitionTo(timeline as never, s, children, { order })\n },\n },\n /**\n * Move every item into another grid's arrangement — a grid into a ring, a ring\n * onto a sphere — and keep following it. An empty `target` morphs back to\n * this grid's own.\n */\n morphInto: {\n args: { target: nodeRefArg(ITEM_GRID_TYPES), ...staggerArgs(TRANSITION_STAGGER) },\n run: (timeline, s, children) => transitionTo(timeline as never, s, children, { arrangeLike: timeline.args.target ?? \"\" }),\n },\n})\n\ninterface Grid {\n readonly state: GridValues\n readonly arranger: Arranger<never>\n readonly children: readonly ChildView[]\n /** Whether a view is this grid itself, which borrows nothing from itself. */\n readonly isSelf: (view: NodeView) => boolean\n}\n\nfunction arrangerOf(key: string): Arranger<never> {\n const grid = GRIDS.get(key)\n if (!grid) throw new Error(`\"${key}\" is no grid: pass its component through ItemGrid.define.`)\n return grid.arranger\n}\n\n/** A grid `view` names, when it is one this kit can arrange and not the reader itself. */\nfunction gridIn(view: NodeView | null | undefined, grid: Grid): { view: NodeView; arranger: Arranger<never> } | null {\n if (!view) return null\n const found = GRIDS.get(view.key)\n if (!found || grid.isSelf(view)) return null\n return { view, arranger: found.arranger }\n}\n\n/** In layout, a view is this grid when it holds the same children: a child has one parent. */\nfunction sharesChildren(children: readonly ChildView[]): (view: NodeView) => boolean {\n return (view) => {\n if (children.length === 0) return false\n const theirs = (view.state as { readonly children?: readonly ChildView[] }).children\n return theirs?.[0] === children[0]\n }\n}\n\nfunction commandGrid(timeline: Timeline<object, never>, s: GridValues, children: readonly ChildView[]): Grid {\n return { state: s, arranger: arrangerOf(timeline.node.key), children, isSelf: (view) => view.id === timeline.node.id }\n}\n\nfunction snapshot(timeline: Timeline<object, never>, s: GridValues, children: readonly ChildView[]): GridSnapshot {\n const grid = commandGrid(timeline, s, children)\n const source = gridIn(s.arrangeLike, grid)\n return {\n arrangement: source\n ? source.arranger.arrangement(source.view.state as never, viewBox(source.view))\n : grid.arranger.arrangement(s as never, contentBox(timeline.node.size, s.padding)),\n source: source?.view.id ?? \"\",\n order: normalizeOrder(s.order, children.length),\n spread: s.spread,\n }\n}\n\nfunction measureItems(children: readonly ChildView[], space: Size2D, s: unknown, arranger: Arranger<never>): Size2D[] {\n const sizes = children.map((child) => child.measure(space))\n const cell = arranger.itemSpace ? arranger.itemSpace(s as never, children.length, space) : space\n if (cell === space) return sizes\n return children.map((child) => child.measure(cell))\n}\n\n/** The arrangement the grid is heading for: the one it borrows, or its own. */\nfunction arrangementOf(grid: Grid, box: Size2D): Arrangement {\n const source = gridIn(grid.state.arrangeLike, grid)\n return source ? source.arranger.arrangement(source.view.state as never, viewBox(source.view)) : grid.arranger.arrangement(grid.state as never, box)\n}\n\n/** Where each item sits in the arrangement it is heading for, before any transition or effect. */\nfunction targetSlots(grid: Grid, count: number, sizes: readonly Size2D[], box: Size2D, time: number): { slots: Slot[]; arrangement: Arrangement } {\n const s = grid.state\n const source = gridIn(s.arrangeLike, grid)\n const sourceBox = source ? viewBox(source.view) : box\n const arrangement = source ? source.arranger.arrangement(source.view.state as never, sourceBox) : grid.arranger.arrangement(s as never, box)\n let slots = slotsOf(arrangement, { count, sizes, box: sourceBox, time })\n if (source) slots = inFrame(source.view.frame, slots)\n const slotOf = slotOfItem(normalizeOrder(s.order, count))\n return { slots: slotOf.map((k) => spreadSlot(slots[k], s.spread)), arrangement }\n}\n\n/** Each item's final slot this frame: the target, blended from any transition, with its effects on. */\nfunction resolve(grid: Grid, sizes: readonly Size2D[], box: Size2D, time: number): Slot[] {\n const s = grid.state\n const count = sizes.length\n const slots = targetSlots(grid, count, sizes, box, time).slots\n const transition = s.transition\n if (transition) {\n const { from } = transition\n const named = from.source ? s.transitionSource : null\n const source = named && named.id === from.source && GRIDS.has(named.key) ? named : null\n const self = source !== null && grid.isSelf(source)\n const fromBox = source && !self ? viewBox(source) : box\n let leaving = slotsOf(from.arrangement, { count, sizes, box: fromBox, time })\n if (source && !self) leaving = inFrame(source.frame, leaving)\n const slotOf = slotOfItem(normalizeOrder(from.order, count))\n for (let i = 0; i < count; i++) {\n slots[i] = blendSlot(spreadSlot(leaving[slotOf[i]], from.spread), slots[i], transition.mix[i] ?? 1)\n }\n }\n const reveal = s.revealState\n const wave = s.waveState\n const focus = s.focusState\n if (reveal || wave || focus) {\n for (let i = 0; i < count; i++) applyItemEffects(slots[i], i, sizes[i], reveal, wave, focus)\n }\n return slots\n}\n\n/** The camera distance the grid is seen through: the target's, or, while a morph runs, the one it is leaving. */\nfunction focalOf(s: GridValues, target: Arrangement): number {\n // A morph into or out of depth keeps the camera for its whole length.\n return focalLengthOf(target) || (s.transition ? focalLengthOf(s.transition.from.arrangement) : 0)\n}\n\nfunction cameraAt(focal: number): SpaceCamera {\n return {\n perspective: focal,\n orbit: 0,\n elevation: 0,\n dolly: 0,\n lookAt: CENTRE,\n zoom: 1,\n heading: 0,\n viewportX: 0,\n viewportY: 0,\n }\n}\n\n/** A slot as a child's placement: its box centred on the slot, and the slot's transform when it has one. */\nfunction placement(inner: { x: number; y: number }, s: Slot, size: Size2D): Placement2D {\n const box = { x: inner.x + s.x, y: s.y - inner.y, width: size.width, height: size.height }\n if (s.rotation === 0 && s.scale === 1 && s.rotationX === 0 && s.rotationY === 0 && s.depth === 0 && s.opacity === 1) return box\n return {\n ...box,\n rotation: s.rotation,\n scale: s.scale,\n rotationX: s.rotationX,\n rotationY: s.rotationY,\n depth: s.depth,\n opacity: s.opacity,\n }\n}\n\n/** `slots`, laid out in another grid's frame, moved into this grid's. */\nfunction inFrame(frame: NodeFrame, slots: Slot[]): Slot[] {\n return slots.map((s) => {\n const p = rotateClockwise(s.x * frame.scale, s.y * frame.scale, frame.rotation)\n return {\n ...s,\n x: frame.x + p.x,\n y: frame.y + p.y,\n depth: s.depth * frame.scale,\n rotation: s.rotation + frame.rotation,\n scale: s.scale * frame.scale,\n }\n })\n}\n\nfunction viewBox(view: NodeView): Size2D {\n return contentBox(view.size, (view.state as { readonly padding: InsetsResolved }).padding)\n}\n\n/** A box of `size` inside `padding`: what a command reads as its grid's content box from `timeline.node.size`. */\nexport function contentBox(size: Size2D, padding: InsetsResolved): Size2D {\n const inner = insetsOps.insetBounds(size.width, size.height, padding)\n return { width: inner.width, height: inner.height }\n}\n\n/** The box, centred on the grid, that holds every item where its slot puts it. */\nfunction extentOf(slots: readonly Slot[], sizes: readonly Size2D[], focal: number): Size2D {\n let halfWidth = 0\n let halfHeight = 0\n for (let i = 0; i < slots.length; i++) {\n const s = slots[i]\n const size = sizes[i]\n const rad = (s.rotation * Math.PI) / 180\n const cos = Math.abs(Math.cos(rad))\n const sin = Math.abs(Math.sin(rad))\n // What the camera does to a slot at depth, so a sphere hugs its front.\n const lens = focal > 0 && focal - s.depth > 1 ? focal / (focal - s.depth) : 1\n const w = ((size.width * cos + size.height * sin) / 2) * s.scale * lens\n const h = ((size.width * sin + size.height * cos) / 2) * s.scale * lens\n halfWidth = Math.max(halfWidth, Math.abs(s.x) * lens + w)\n halfHeight = Math.max(halfHeight, Math.abs(s.y) * lens + h)\n }\n return { width: halfWidth * 2, height: halfHeight * 2 }\n}\n\nfunction rotateClockwise(x: number, y: number, degrees: number): { x: number; y: number } {\n if (degrees === 0) return { x, y }\n const rad = (degrees * Math.PI) / 180\n const cos = Math.cos(rad)\n const sin = Math.sin(rad)\n return { x: x * cos + y * sin, y: -x * sin + y * cos }\n}\n\nfunction sameSize(a: Size2D, b: Size2D): boolean {\n return Math.abs(a.width - b.width) < 1e-6 && Math.abs(a.height - b.height) < 1e-6\n}\n\nfunction lerp(a: number, b: number, t: number): number {\n return a + (b - a) * t\n}\n"],
5
+ "mappings": "6FAAA,OAAS,SAAAA,EAAO,WAAAC,OAAgD,oBCsC1D,SAAUC,EAAKC,EAAWC,EAAWC,EAAc,CACvD,MAAO,CAAE,EAAAF,EAAG,EAAAC,EAAG,MAAO,EAAG,SAAU,EAAG,UAAW,EAAG,UAAW,EAAG,MAAO,EAAG,QAAS,EAAG,KAAAC,CAAI,CAC9F,CAGM,SAAUC,GAAUC,EAASC,EAASC,EAAS,CACnD,GAAIA,GAAK,EAAG,OAAOF,EACnB,GAAIE,GAAK,EAAG,OAAOD,EACnB,IAAME,EAAM,CAACC,EAAWC,IAAcD,GAAKC,EAAID,GAAKF,EACpD,MAAO,CACL,EAAGC,EAAIH,EAAE,EAAGC,EAAE,CAAC,EACf,EAAGE,EAAIH,EAAE,EAAGC,EAAE,CAAC,EACf,MAAOE,EAAIH,EAAE,MAAOC,EAAE,KAAK,EAC3B,SAAUE,EAAIH,EAAE,SAAUC,EAAE,QAAQ,EACpC,UAAWE,EAAIH,EAAE,UAAWC,EAAE,SAAS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AAC,EAAII,EAAOE,CAAC,CAC5D,CACA,MAAO,CAAE,MAAOP,EAAY,EAAG,OAAQC,EAAa,CAAC,CACvD,CAEA,SAASF,GAAgBS,EAAWC,EAAWC,EAAe,CAC5D,GAAIA,IAAY,EAAG,MAAO,CAAE,EAAAF,EAAG,EAAAC,CAAC,EAChC,IAAMP,EAAOQ,EAAU,KAAK,GAAM,IAC5BP,EAAM,KAAK,IAAID,CAAG,EAClBE,EAAM,KAAK,IAAIF,CAAG,EACxB,MAAO,CAAE,EAAGM,EAAIL,EAAMM,EAAIL,EAAK,EAAG,CAACI,EAAIJ,EAAMK,EAAIN,CAAG,CACtD,CAEA,SAAS5F,GAASuD,EAAW7C,EAAS,CACpC,OAAO,KAAK,IAAI6C,EAAE,MAAQ7C,EAAE,KAAK,EAAI,MAAQ,KAAK,IAAI6C,EAAE,OAAS7C,EAAE,MAAM,EAAI,IAC/E,CAEA,SAAS4B,GAAKiB,EAAW7C,EAAWiB,EAAS,CAC3C,OAAO4B,GAAK7C,EAAI6C,GAAK5B,CACvB",
6
+ "names": ["clamp", "pathOps", "slot", "x", "y", "meta", "blendSlot", "a", "b", "t", "mix", "p", "q", "spreadSlot", "s", "spread", "largest", "sizes", "width", "height", "size", "PATH_SPACINGS", "SAMPLERS", "SAMPLER_CACHE", "measured", "path", "hit", "contours", "pathOps", "entry", "pathSlots", "arrangement", "input", "count", "sampler", "closed", "length", "a", "clamp", "b", "start", "span", "loops", "offset", "place", "rad", "cos", "sin", "slots", "k", "u", "visible", "at", "s", "slot", "flip", "px", "py", "RADIAL_DIRECTIONS", "radialAngles", "arrangement", "count", "time", "sweep", "closing", "step", "sign", "start", "angles", "k", "radialSlots", "input", "angle", "rad", "slot", "radialTurnToTop", "index", "wrapDegrees", "degrees", "wrapped", "FILL_DIRECTIONS", "CELL_MODES", "LINE_ALIGNS", "rectangularShape", "arrangement", "count", "columns", "rows", "rectangularCell", "sizes", "box", "largest", "rectangularSlots", "input", "byColumn", "lines", "perLine", "cell", "pitchX", "pitchY", "lastLine", "lastCount", "shortBy", "lead", "shiftX", "shiftY", "slots", "i", "line", "along", "row", "column", "rowIndex", "columnIndex", "x", "y", "slot", "SPHERE_FACINGS", "SPHERE_AXES", "GOLDEN_ANGLE", "DEG", "fibonacciPoint", "k", "count", "y", "r", "theta", "orient", "p", "yaw", "pitch", "roll", "x0", "y0", "z0", "ya", "pa", "ra", "x1", "z1", "y2", "z2", "sphereSlots", "arrangement", "input", "radius", "outward", "slots", "q", "nx", "ny", "nz", "s", "slot", "facesAway", "normal", "focal", "sphereFaceForward", "index", "x", "z", "PATH_TEMPLATES", "DRAWN", "DRAWN_CACHE", "templatePath", "template", "box", "key", "hit", "path", "drawTemplate", "w", "h", "rx", "ry", "closed", "points", "i", "angle", "r", "sample", "t", "a", "x", "y", "d", "open", "ellipse", "k", "steps", "at", "slotsOf", "arrangement", "input", "rectangularSlots", "radialSlots", "pathSlots", "sphereSlots", "focalLengthOf", "seededRandom", "seed", "a", "t", "shuffled", "values", "out", "random", "i", "j", "hashSeed", "text", "h", "STAGGER_ORDERS", "MAX_STAGGER", "staggerRanks", "order", "slots", "seed", "n", "keys", "keysOf", "min", "max", "key", "range", "staggerProgress", "rank", "t", "stagger", "s", "p", "_", "i", "sequence", "shuffled", "item", "clockAngle", "angle", "clamp", "REVEAL_STYLES", "WAVE_STYLES", "applyItemEffects", "s", "i", "size", "reveal", "wave", "focus", "applyReveal", "applyWave", "applyFocus", "style", "v", "shown", "w", "f", "normalizeOrder", "order", "count", "out", "taken", "entry", "item", "slotOfItem", "slots", "slot", "parseOrder", "value", "part", "item_grid_exports", "__export", "ITEM_GRID_TYPES", "TRANSITION_STAGGER", "commands", "contentBox", "contentBoxOf", "defaults", "define", "fields", "focusOn", "hinted", "isGrid", "itemSlots", "layout", "measure", "nodeRef", "nodeRefArg", "ranks", "render", "staggerArgs", "state", "transitionTo", "commandsFor", "easeIn", "easeInOut", "easeOut", "flowOps", "insetsOps", "Types", "ITEM_GRID_TYPES", "TRANSITION_STAGGER", "nodeRef", "types", "described", "Types", "staggerArgs", "fallback", "STAGGER_ORDERS", "hinted", "hint", "options", "nodeRefArg", "state", "defaults", "GRIDS", "define", "component", "arranger", "isGrid", "value", "fields", "measurer", "s", "children", "measure", "box", "layout", "ctx", "render", "NO_CONTENT", "CENTRE", "measured", "constraints", "padding", "flowOps", "space", "sizes", "measureItems", "grid", "sharesChildren", "target", "targetSlots", "extentOf", "focalOf", "kept", "inner", "insetsOps", "sameSize", "resolve", "slot", "i", "placement", "focal", "arrangementOf", "contentBox", "cameraAt", "contentBoxOf", "b", "itemSlots", "timeline", "commandGrid", "child", "ranks", "order", "staggerRanks", "hashSeed", "transitionTo", "changes", "stagger", "from", "snapshot", "ease", "easeInOut", "spread", "t", "mix", "rank", "staggerProgress", "focusOn", "isFocus", "count", "dim", "grow", "_", "e", "lerp", "v", "GRID_STATE", "commands", "commandsFor", "REVEAL_STYLES", "style", "easeOut", "easeIn", "WAVE_STYLES", "amount", "item", "k", "current", "normalizeOrder", "next", "shuffled", "a", "parseOrder", "arrangerOf", "key", "gridIn", "view", "found", "source", "viewBox", "cell", "time", "sourceBox", "arrangement", "slots", "slotsOf", "inFrame", "slotOfItem", "spreadSlot", "transition", "named", "self", "fromBox", "leaving", "slotOf", "blendSlot", "reveal", "wave", "focus", "applyItemEffects", "focalLengthOf", "size", "frame", "p", "rotateClockwise", "halfWidth", "halfHeight", "rad", "cos", "sin", "lens", "w", "h", "x", "y", "degrees"]
7
+ }
@@ -1,2 +1,2 @@
1
- import{A as Gt,B as Tt,C as bt,D as Ot,E as At,F as yt,G as It,H as Et,I as kt,J as Lt,K as l,L as Pt,M as Rt,N as Nt,O as g,P as h,Q as Dt,R as n,S as _t,T as Mt,a as it,b as ct,c as dt,d as ut,e as T,f as pt,g as b,h as mt,i as lt,j as O,k as w,l as A,m as y,n as I,o as gt,p as S,q as ht,r as E,s as k,t as ft,u as wt,v as St,w as L,x as P,y as R,z as xt}from"./chunks/chunk-TYNFMZ3D.js";import{component2d as j,easeInOut as q,Types as c}from"@motionscript/sdk";var J={columns:c.number(3,{min:1,step:1}),fillDirection:c.oneOf(A,{default:"row"}),cellMode:c.oneOf(y,{default:"fit"}),cellWidth:c.number(120,{min:0,step:1}),cellHeight:c.number(120,{min:0,step:1}),columnGap:c.number(24,{step:1}),rowGap:c.number(24,{step:1}),lastLineAlign:c.oneOf(I,{default:"start"}),rowOffset:c.number(0,{min:-1,max:1,step:.05}),columnOffset:c.number(0,{min:-1,max:1,step:.05})};function x(t){return{kind:"rectangular",columns:t.columns,fillDirection:t.fillDirection,cellMode:t.cellMode,cellWidth:t.cellWidth,cellHeight:t.cellHeight,columnGap:t.columnGap,rowGap:t.rowGap,lastLineAlign:t.lastLineAlign,rowOffset:t.rowOffset,columnOffset:t.columnOffset}}var N={arrangement:x,itemSpace:(t,e,r)=>t.cellMode==="fit"?r:S(x(t),e,[],r)},D={dim:c.number(.7,{min:0,max:1,step:.05}),grow:n.hinted(.1,{min:0,max:1,step:.05})},_=n.define(j({key:"rectangularGrid",state:{...n.state,...J},defaults:n.defaults,commands:{...n.commands,columnsTo:{args:{columns:n.hinted(4,{min:1,step:1}),...h(g)},run:(t,e,r)=>{let a=Math.max(1,Math.round(t.args.columns??e.columns));return n.transitionTo(t,e,r,{columns:a})}},gapTo:{args:{columnGap:n.hinted(48),rowGap:n.hinted(48)},run:t=>{let e={};return t.args.columnGap!==void 0&&(e.columnGap=t.args.columnGap),t.args.rowGap!==void 0&&(e.rowGap=t.args.rowGap),t.tween(e)}},cellSizeTo:{args:{cellWidth:n.hinted(160,{min:0}),cellHeight:n.hinted(160,{min:0})},easing:q("cubic"),run:(t,e,r)=>{let a=r.map(m=>m.size),o=n.contentBox(t.node.size,e.padding),s=S(x(e),a.length,a,o),i=t.args.cellWidth??s.width,Z=t.args.cellHeight??s.height;return t.animate(m=>({cellMode:"fixed",cellWidth:s.width+(i-s.width)*m,cellHeight:s.height+(Z-s.height)*m}))}},focusRow:{args:{row:c.number(0,{min:0,step:1}),...D},run:(t,e,r)=>{let a=n.itemSlots(t,e,r),o=Math.round(t.args.row??0),s=i=>a[i]?.meta.kind==="rectangular"&&a[i].meta.row===o;return n.focusOn(t,e,s,a.length,t.args.dim??.7,t.args.grow??.15)}},focusColumn:{args:{column:c.number(0,{min:0,step:1}),...D},run:(t,e,r)=>{let a=n.itemSlots(t,e,r),o=Math.round(t.args.column??0),s=i=>a[i]?.meta.kind==="rectangular"&&a[i].meta.column===o;return n.focusOn(t,e,s,a.length,t.args.dim??.7,t.args.grow??.15)}}},...n.fields(N)}),N);import{component2d as K,Types as p}from"@motionscript/sdk";var Q={radius:p.number(200,{min:0,step:1}),startAngle:p.number(0,{step:1,unit:"\xB0"}),sweep:p.number(360,{min:-360,max:360,step:1,unit:"\xB0"}),direction:p.oneOf(b,{default:"clockwise"}),rotateItems:!1,spinSpeed:p.number(0,{step:1,unit:"\xB0/s"})};function H(t){return{kind:"radial",radius:t.radius,startAngle:t.startAngle,sweep:t.sweep,direction:t.direction,rotateItems:t.rotateItems,spinSpeed:t.spinSpeed}}var M={arrangement:H},C=n.define(K({key:"radialGrid",state:{...n.state,...Q},defaults:n.defaults,commands:{...n.commands,spin:{args:{degrees:p.number(360,{step:15,unit:"\xB0"})},run:(t,e)=>t.tween({startAngle:e.startAngle+(t.args.degrees??360)})},turnTo:{args:{item:p.number(0,{min:0,step:1})},run:(t,e,r)=>{let a=r.length,o=l(e.order,a).indexOf(Math.round(t.args.item??0)),s=o<0?0:O(H(e),a,o);return t.tween({startAngle:e.startAngle+s})}},radiusTo:{args:{radius:n.hinted(280,{min:0})},run:(t,e)=>t.tween({radius:t.args.radius??e.radius})},sweepTo:{args:{sweep:n.hinted(360,{min:-360,max:360,unit:"\xB0"})},run:(t,e)=>t.tween({sweep:t.args.sweep??e.sweep})}},...n.fields(M)}),M);import{component2d as V,pathOps as f,Types as u}from"@motionscript/sdk";var z=[...P,"custom"],$={shape:u.oneOf(z,{default:"circle"}),path:u.path,pathNode:n.nodeRef(["path"]),spacing:u.oneOf(T,{default:"distribute"}),spacingDistance:u.number(80,{min:0,step:1}),offset:u.number(0,{step:.01}),flowSpeed:u.number(0,{step:.01,unit:"/s"}),trimStart:u.number(0,{min:0,max:1,step:.01}),trimEnd:u.number(1,{min:0,max:1,step:.01}),alignToPath:!0},G={originX:0,originY:0,x:0,y:0,rotation:0,scale:1},v={width:640,height:400},F={arrangement:(t,e)=>{let{path:r,placement:a}=tt(t,e);return{kind:"path",path:r,placement:a,spacing:t.spacing,spacingDistance:t.spacingDistance,offset:t.offset,flowSpeed:t.flowSpeed,trimStart:t.trimStart,trimEnd:t.trimEnd,alignToPath:t.alignToPath}}},Y=n.define(V({key:"pathGrid",state:{...n.state,...$},defaults:{...v},commands:{...n.commands,flow:{args:{loops:u.number(1,{step:.25})},run:(t,e)=>t.tween({offset:e.offset+(t.args.loops??1)})},trimTo:{args:{trimStart:n.hinted(.25,{min:0,max:1,step:.01}),trimEnd:n.hinted(.75,{min:0,max:1,step:.01})},run:(t,e)=>t.tween({trimStart:t.args.trimStart??e.trimStart,trimEnd:t.args.trimEnd??e.trimEnd})},setPath:{args:{shape:n.hinted("heart",{kind:"enum",options:z}),pathNode:n.nodeRefArg(["path"]),...h(g)},run:(t,e,r)=>{let a=t.args.pathNode??"",o=a?{pathNode:a}:{shape:t.args.shape??e.shape,pathNode:""};return n.transitionTo(t,e,r,o)}}},...n.fields(F)}),F);function tt(t,e){let r=t.pathNode;if(r?.key==="path")return{path:et(r),placement:{...G,...r.frame}};let a=r?.key==="facePath"?W(r):void 0,o=a!==void 0?f.bounds(a):null;if(r&&a!==void 0&&o)return{path:a,placement:{originX:(o.minX+o.maxX)/2,originY:(o.minY+o.maxY)/2,...r.frame}};if(t.shape==="custom"){let i=f.bounds(t.path);if(i)return{path:t.path,placement:{...G,originX:(i.minX+i.maxX)/2,originY:(i.minY+i.maxY)/2,flipY:!0}}}let s=t.shape==="custom"?"circle":t.shape;return{path:R(s,e),placement:G}}function W(t){return t.state.data}var X=new WeakMap;function et(t){let e=W(t),{width:r,height:a}=t.size,o=X.get(t);if(o&&o.data===e&&o.width===r&&o.height===a)return o.path;let s=f.anchorCommands(f.anchors(e),i=>({x:i.x*r,y:-i.y*a}));return X.set(t,{data:e,width:r,height:a,path:s}),s}import{component2d as nt,Types as d}from"@motionscript/sdk";var rt={radius:d.number(220,{min:0,step:1}),yaw:d.number(0,{step:1,unit:"\xB0"}),pitch:d.number(0,{step:1,unit:"\xB0"}),roll:d.number(0,{step:1,unit:"\xB0"}),facing:d.oneOf(E,{default:"outward"}),focalLength:d.number(900,{min:100,step:10}),depthFade:d.number(.5,{min:0,max:1,step:.05}),cullBackfaces:!1,spinSpeed:d.number(0,{step:1,unit:"\xB0/s"})};function at(t){return{kind:"sphere",radius:t.radius,yaw:t.yaw,pitch:t.pitch,roll:t.roll,facing:t.facing,focalLength:t.focalLength,depthFade:t.depthFade,cullBackfaces:t.cullBackfaces,spinSpeed:t.spinSpeed}}var B={arrangement:at},ot={x:"pitch",y:"yaw",z:"roll"},U=n.define(nt({key:"sphereGrid",state:{...n.state,...rt},defaults:n.defaults,commands:{...n.commands,spin:{args:{axis:d.oneOf(k,{default:"y"}),degrees:d.number(360,{step:15,unit:"\xB0"})},run:(t,e)=>{let r=ot[t.args.axis??"y"]??"yaw";return t.tween({[r]:e[r]+(t.args.degrees??360)})}},orientTo:{args:{yaw:n.hinted(45,{unit:"\xB0"}),pitch:n.hinted(20,{unit:"\xB0"}),roll:n.hinted(0,{unit:"\xB0"})},run:(t,e)=>t.tween({yaw:t.args.yaw??e.yaw,pitch:t.args.pitch??e.pitch,roll:t.args.roll??e.roll})},turnTo:{args:{item:d.number(0,{min:0,step:1})},run:(t,e,r)=>{let a=r.length,o=l(e.order,a).indexOf(Math.round(t.args.item??0));if(o<0)return t.tween({});let s=L(a,o);return t.tween({yaw:e.yaw+w(s.yaw-e.yaw),pitch:e.pitch+w(s.pitch-e.pitch),roll:0})}},radiusTo:{args:{radius:n.hinted(300,{min:0})},run:(t,e)=>t.tween({radius:t.args.radius??e.radius})},focalLengthTo:{args:{focalLength:n.hinted(600,{min:100})},run:(t,e)=>t.tween({focalLength:t.args.focalLength??e.focalLength})}},...n.fields(B)}),B);var st=[_,C,Y,U];export{y as CELL_MODES,A as FILL_DIRECTIONS,Nt as ITEM_GRID_TYPES,n as ItemGrid,I as LINE_ALIGNS,st as NODES,z as PATH_GRID_SHAPES,T as PATH_SPACINGS,P as PATH_TEMPLATES,Y as PathGrid,b as RADIAL_DIRECTIONS,Et as REVEAL_STYLES,C as RadialGrid,_ as RectangularGrid,k as SPHERE_AXES,E as SPHERE_FACINGS,At as STAGGER_ORDERS,U as SphereGrid,g as TRANSITION_STAGGER,kt as WAVE_STYLES,Lt as applyItemEffects,ct as blendSlot,Dt as contentBoxOf,ft as fibonacciPoint,_t as findNode2D,Gt as focalLengthOf,Mt as frameIn,Ot as hashSeed,ut as largest,l as normalizeOrder,wt as orient,Rt as parseOrder,pt as pathSlots,mt as radialAngles,lt as radialSlots,O as radialTurnToTop,S as rectangularCell,gt as rectangularShape,ht as rectangularSlots,Tt as seededRandom,bt as shuffled,it as slot,Pt as slotOfItem,xt as slotsOf,L as sphereFaceForward,St as sphereSlots,dt as spreadSlot,h as staggerArgs,It as staggerProgress,yt as staggerRanks,R as templatePath,w as wrapDegrees};
1
+ import{A as Gt,B as Tt,C as bt,D as Ot,E as At,F as yt,G as It,H as Et,I as kt,J as l,K as Lt,L as Pt,M as Rt,N as g,O as h,P as Nt,Q as n,a as it,b as ct,c as dt,d as ut,e as T,f as pt,g as b,h as mt,i as lt,j as O,k as w,l as A,m as y,n as I,o as gt,p as S,q as ht,r as E,s as k,t as ft,u as wt,v as St,w as L,x as P,y as R,z as xt}from"./chunks/chunk-7SRKSZ7X.js";import{component2d as j,easeInOut as q,Types as c}from"@motionscript/sdk";var J={columns:c.number(3,{min:1,step:1}),fillDirection:c.oneOf(A,{default:"row"}),cellMode:c.oneOf(y,{default:"fit"}),cellWidth:c.number(120,{min:0,step:1}),cellHeight:c.number(120,{min:0,step:1}),columnGap:c.number(24,{step:1}),rowGap:c.number(24,{step:1}),lastLineAlign:c.oneOf(I,{default:"start"}),rowOffset:c.number(0,{min:-1,max:1,step:.05}),columnOffset:c.number(0,{min:-1,max:1,step:.05})};function x(t){return{kind:"rectangular",columns:t.columns,fillDirection:t.fillDirection,cellMode:t.cellMode,cellWidth:t.cellWidth,cellHeight:t.cellHeight,columnGap:t.columnGap,rowGap:t.rowGap,lastLineAlign:t.lastLineAlign,rowOffset:t.rowOffset,columnOffset:t.columnOffset}}var N={arrangement:x,itemSpace:(t,e,r)=>t.cellMode==="fit"?r:S(x(t),e,[],r)},D={dim:c.number(.7,{min:0,max:1,step:.05}),grow:n.hinted(.1,{min:0,max:1,step:.05})},_=n.define(j({key:"rectangularGrid",state:{...n.state,...J},defaults:n.defaults,commands:{...n.commands,columnsTo:{args:{columns:n.hinted(4,{min:1,step:1}),...h(g)},run:(t,e,r)=>{let a=Math.max(1,Math.round(t.args.columns??e.columns));return n.transitionTo(t,e,r,{columns:a})}},gapTo:{args:{columnGap:n.hinted(48),rowGap:n.hinted(48)},run:t=>{let e={};return t.args.columnGap!==void 0&&(e.columnGap=t.args.columnGap),t.args.rowGap!==void 0&&(e.rowGap=t.args.rowGap),t.tween(e)}},cellSizeTo:{args:{cellWidth:n.hinted(160,{min:0}),cellHeight:n.hinted(160,{min:0})},easing:q("cubic"),run:(t,e,r)=>{let a=r.map(m=>m.size),o=n.contentBox(t.node.size,e.padding),s=S(x(e),a.length,a,o),i=t.args.cellWidth??s.width,Z=t.args.cellHeight??s.height;return t.animate(m=>({cellMode:"fixed",cellWidth:s.width+(i-s.width)*m,cellHeight:s.height+(Z-s.height)*m}))}},focusRow:{args:{row:c.number(0,{min:0,step:1}),...D},run:(t,e,r)=>{let a=n.itemSlots(t,e,r),o=Math.round(t.args.row??0),s=i=>a[i]?.meta.kind==="rectangular"&&a[i].meta.row===o;return n.focusOn(t,e,s,a.length,t.args.dim??.7,t.args.grow??.15)}},focusColumn:{args:{column:c.number(0,{min:0,step:1}),...D},run:(t,e,r)=>{let a=n.itemSlots(t,e,r),o=Math.round(t.args.column??0),s=i=>a[i]?.meta.kind==="rectangular"&&a[i].meta.column===o;return n.focusOn(t,e,s,a.length,t.args.dim??.7,t.args.grow??.15)}}},...n.fields(N)}),N);import{component2d as K,Types as p}from"@motionscript/sdk";var Q={radius:p.number(200,{min:0,step:1}),startAngle:p.number(0,{step:1,unit:"\xB0"}),sweep:p.number(360,{min:-360,max:360,step:1,unit:"\xB0"}),direction:p.oneOf(b,{default:"clockwise"}),rotateItems:!1,spinSpeed:p.number(0,{step:1,unit:"\xB0/s"})};function H(t){return{kind:"radial",radius:t.radius,startAngle:t.startAngle,sweep:t.sweep,direction:t.direction,rotateItems:t.rotateItems,spinSpeed:t.spinSpeed}}var M={arrangement:H},C=n.define(K({key:"radialGrid",state:{...n.state,...Q},defaults:n.defaults,commands:{...n.commands,spin:{args:{degrees:p.number(360,{step:15,unit:"\xB0"})},run:(t,e)=>t.tween({startAngle:e.startAngle+(t.args.degrees??360)})},turnTo:{args:{item:p.number(0,{min:0,step:1})},run:(t,e,r)=>{let a=r.length,o=l(e.order,a).indexOf(Math.round(t.args.item??0)),s=o<0?0:O(H(e),a,o);return t.tween({startAngle:e.startAngle+s})}},radiusTo:{args:{radius:n.hinted(280,{min:0})},run:(t,e)=>t.tween({radius:t.args.radius??e.radius})},sweepTo:{args:{sweep:n.hinted(360,{min:-360,max:360,unit:"\xB0"})},run:(t,e)=>t.tween({sweep:t.args.sweep??e.sweep})}},...n.fields(M)}),M);import{component2d as V,pathOps as f,Types as u}from"@motionscript/sdk";var z=[...P,"custom"],$={shape:u.oneOf(z,{default:"circle"}),path:u.path,pathNode:n.nodeRef(["path"]),spacing:u.oneOf(T,{default:"distribute"}),spacingDistance:u.number(80,{min:0,step:1}),offset:u.number(0,{step:.01}),flowSpeed:u.number(0,{step:.01,unit:"/s"}),trimStart:u.number(0,{min:0,max:1,step:.01}),trimEnd:u.number(1,{min:0,max:1,step:.01}),alignToPath:!0},G={originX:0,originY:0,x:0,y:0,rotation:0,scale:1},v={width:640,height:400},F={arrangement:(t,e)=>{let{path:r,placement:a}=tt(t,e);return{kind:"path",path:r,placement:a,spacing:t.spacing,spacingDistance:t.spacingDistance,offset:t.offset,flowSpeed:t.flowSpeed,trimStart:t.trimStart,trimEnd:t.trimEnd,alignToPath:t.alignToPath}}},Y=n.define(V({key:"pathGrid",state:{...n.state,...$},defaults:{...v},commands:{...n.commands,flow:{args:{loops:u.number(1,{step:.25})},run:(t,e)=>t.tween({offset:e.offset+(t.args.loops??1)})},trimTo:{args:{trimStart:n.hinted(.25,{min:0,max:1,step:.01}),trimEnd:n.hinted(.75,{min:0,max:1,step:.01})},run:(t,e)=>t.tween({trimStart:t.args.trimStart??e.trimStart,trimEnd:t.args.trimEnd??e.trimEnd})},setPath:{args:{shape:n.hinted("heart",{kind:"enum",options:z}),pathNode:n.nodeRefArg(["path"]),...h(g)},run:(t,e,r)=>{let a=t.args.pathNode??"",o=a?{pathNode:a}:{shape:t.args.shape??e.shape,pathNode:""};return n.transitionTo(t,e,r,o)}}},...n.fields(F)}),F);function tt(t,e){let r=t.pathNode;if(r?.key==="path")return{path:et(r),placement:{...G,...r.frame}};let a=r?.key==="facePath"?W(r):void 0,o=a!==void 0?f.bounds(a):null;if(r&&a!==void 0&&o)return{path:a,placement:{originX:(o.minX+o.maxX)/2,originY:(o.minY+o.maxY)/2,...r.frame}};if(t.shape==="custom"){let i=f.bounds(t.path);if(i)return{path:t.path,placement:{...G,originX:(i.minX+i.maxX)/2,originY:(i.minY+i.maxY)/2,flipY:!0}}}let s=t.shape==="custom"?"circle":t.shape;return{path:R(s,e),placement:G}}function W(t){return t.state.data}var X=new WeakMap;function et(t){let e=W(t),{width:r,height:a}=t.size,o=X.get(t);if(o&&o.data===e&&o.width===r&&o.height===a)return o.path;let s=f.anchorCommands(f.anchors(e),i=>({x:i.x*r,y:-i.y*a}));return X.set(t,{data:e,width:r,height:a,path:s}),s}import{component2d as nt,Types as d}from"@motionscript/sdk";var rt={radius:d.number(220,{min:0,step:1}),yaw:d.number(0,{step:1,unit:"\xB0"}),pitch:d.number(0,{step:1,unit:"\xB0"}),roll:d.number(0,{step:1,unit:"\xB0"}),facing:d.oneOf(E,{default:"outward"}),focalLength:d.number(900,{min:100,step:10}),depthFade:d.number(.5,{min:0,max:1,step:.05}),cullBackfaces:!1,spinSpeed:d.number(0,{step:1,unit:"\xB0/s"})};function at(t){return{kind:"sphere",radius:t.radius,yaw:t.yaw,pitch:t.pitch,roll:t.roll,facing:t.facing,focalLength:t.focalLength,depthFade:t.depthFade,cullBackfaces:t.cullBackfaces,spinSpeed:t.spinSpeed}}var B={arrangement:at},ot={x:"pitch",y:"yaw",z:"roll"},U=n.define(nt({key:"sphereGrid",state:{...n.state,...rt},defaults:n.defaults,commands:{...n.commands,spin:{args:{axis:d.oneOf(k,{default:"y"}),degrees:d.number(360,{step:15,unit:"\xB0"})},run:(t,e)=>{let r=ot[t.args.axis??"y"]??"yaw";return t.tween({[r]:e[r]+(t.args.degrees??360)})}},orientTo:{args:{yaw:n.hinted(45,{unit:"\xB0"}),pitch:n.hinted(20,{unit:"\xB0"}),roll:n.hinted(0,{unit:"\xB0"})},run:(t,e)=>t.tween({yaw:t.args.yaw??e.yaw,pitch:t.args.pitch??e.pitch,roll:t.args.roll??e.roll})},turnTo:{args:{item:d.number(0,{min:0,step:1})},run:(t,e,r)=>{let a=r.length,o=l(e.order,a).indexOf(Math.round(t.args.item??0));if(o<0)return t.tween({});let s=L(a,o);return t.tween({yaw:e.yaw+w(s.yaw-e.yaw),pitch:e.pitch+w(s.pitch-e.pitch),roll:0})}},radiusTo:{args:{radius:n.hinted(300,{min:0})},run:(t,e)=>t.tween({radius:t.args.radius??e.radius})},focalLengthTo:{args:{focalLength:n.hinted(600,{min:100})},run:(t,e)=>t.tween({focalLength:t.args.focalLength??e.focalLength})}},...n.fields(B)}),B);var st=[_,C,Y,U];export{y as CELL_MODES,A as FILL_DIRECTIONS,Rt as ITEM_GRID_TYPES,n as ItemGrid,I as LINE_ALIGNS,st as NODES,z as PATH_GRID_SHAPES,T as PATH_SPACINGS,P as PATH_TEMPLATES,Y as PathGrid,b as RADIAL_DIRECTIONS,It as REVEAL_STYLES,C as RadialGrid,_ as RectangularGrid,k as SPHERE_AXES,E as SPHERE_FACINGS,Ot as STAGGER_ORDERS,U as SphereGrid,g as TRANSITION_STAGGER,Et as WAVE_STYLES,kt as applyItemEffects,ct as blendSlot,Nt as contentBoxOf,ft as fibonacciPoint,Gt as focalLengthOf,bt as hashSeed,ut as largest,l as normalizeOrder,wt as orient,Pt as parseOrder,pt as pathSlots,mt as radialAngles,lt as radialSlots,O as radialTurnToTop,S as rectangularCell,gt as rectangularShape,ht as rectangularSlots,Tt as shuffled,it as slot,Lt as slotOfItem,xt as slotsOf,L as sphereFaceForward,St as sphereSlots,dt as spreadSlot,h as staggerArgs,yt as staggerProgress,At as staggerRanks,R as templatePath,w as wrapDegrees};
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/rectangular-grid/rectangular-grid.ts", "../../src/radial-grid/radial-grid.ts", "../../src/path-grid/path-grid.ts", "../../src/sphere-grid/sphere-grid.ts", "../../src/nodes.ts"],
4
- "sourcesContent": ["import {\n component2d,\n easeInOut,\n Types,\n type NodeOf,\n type Values,\n // Named so the emitted declaration reaches these through the sdk, not core.\n type Node2D as _Node2D,\n type Node2DProps as _Node2DProps,\n} from \"@motionscript/sdk\"\n\nimport {\n CELL_MODES,\n FILL_DIRECTIONS,\n ItemGrid,\n LINE_ALIGNS,\n rectangularCell,\n staggerArgs,\n TRANSITION_STAGGER,\n type RectangularArrangement,\n} from \"../kit\"\n\nconst own = {\n columns: Types.number(3, { min: 1, step: 1 }),\n fillDirection: Types.oneOf(FILL_DIRECTIONS, { default: \"row\" }),\n cellMode: Types.oneOf(CELL_MODES, { default: \"fit\" }),\n cellWidth: Types.number(120, { min: 0, step: 1 }),\n cellHeight: Types.number(120, { min: 0, step: 1 }),\n columnGap: Types.number(24, { step: 1 }),\n rowGap: Types.number(24, { step: 1 }),\n lastLineAlign: Types.oneOf(LINE_ALIGNS, { default: \"start\" }),\n rowOffset: Types.number(0, { min: -1, max: 1, step: 0.05 }),\n columnOffset: Types.number(0, { min: -1, max: 1, step: 0.05 }),\n}\n\ntype Own = Values<typeof own>\n\nfunction arrangement(s: Own): RectangularArrangement {\n return {\n kind: \"rectangular\",\n columns: s.columns,\n fillDirection: s.fillDirection,\n cellMode: s.cellMode,\n cellWidth: s.cellWidth,\n cellHeight: s.cellHeight,\n columnGap: s.columnGap,\n rowGap: s.rowGap,\n lastLineAlign: s.lastLineAlign,\n rowOffset: s.rowOffset,\n columnOffset: s.columnOffset,\n }\n}\n\nconst arranger: ItemGrid.Arranger<Own> = {\n arrangement,\n // A child set to fill takes its cell, where the cell is not simply the largest child.\n itemSpace: (s, count, space) => (s.cellMode === \"fit\" ? space : rectangularCell(arrangement(s), count, [], space)),\n}\n\n/** The focus args of a row or a column: the grow a row leaves out is the shared focus's. */\nconst lineFocus = {\n dim: Types.number(0.7, { min: 0, max: 1, step: 0.05 }),\n grow: ItemGrid.hinted(0.1, { min: 0, max: 1, step: 0.05 }),\n}\n\n/**\n * Children in rows and columns — the grid the other three are variations on.\n *\n * Cells are as big as the largest child (`fit`), a size of their own\n * (`fixed`), or an equal share of the node's box (`fill`), which is also the\n * room a child set to fill grows into. Shift every other row by half a cell\n * for a brick bond or a hex pack.\n */\nexport const RectangularGrid = ItemGrid.define(component2d({\n key: \"rectangularGrid\",\n state: { ...ItemGrid.state, ...own },\n defaults: ItemGrid.defaults,\n commands: {\n ...ItemGrid.commands,\n /** Re-flow the items into `columns` columns, each moving to its new cell. */\n columnsTo: {\n args: { columns: ItemGrid.hinted(4, { min: 1, step: 1 }), ...staggerArgs(TRANSITION_STAGGER) },\n run: (timeline, s, children) => {\n const columns = Math.max(1, Math.round(timeline.args.columns ?? s.columns))\n return ItemGrid.transitionTo(timeline as never, s, children, { columns })\n },\n },\n /** Animate the spacing between columns and rows. */\n gapTo: {\n args: { columnGap: ItemGrid.hinted(48), rowGap: ItemGrid.hinted(48) },\n run: (timeline) => {\n const data: { columnGap?: number; rowGap?: number } = {}\n if (timeline.args.columnGap !== undefined) data.columnGap = timeline.args.columnGap\n if (timeline.args.rowGap !== undefined) data.rowGap = timeline.args.rowGap\n return timeline.tween(data)\n },\n },\n /**\n * Animate the cell size, from whatever the cells measure now. The grid\n * switches to `fixed` cells as it starts, since a size of its own is what\n * `fixed` means.\n */\n cellSizeTo: {\n args: { cellWidth: ItemGrid.hinted(160, { min: 0 }), cellHeight: ItemGrid.hinted(160, { min: 0 }) },\n easing: easeInOut(\"cubic\"),\n run: (timeline, s, children) => {\n const sizes = children.map((child) => child.size)\n const box = ItemGrid.contentBox(timeline.node.size, s.padding)\n const from = rectangularCell(arrangement(s), sizes.length, sizes, box)\n const width = timeline.args.cellWidth ?? from.width\n const height = timeline.args.cellHeight ?? from.height\n return timeline.animate((t) => ({\n cellMode: \"fixed\",\n cellWidth: from.width + (width - from.width) * t,\n cellHeight: from.height + (height - from.height) * t,\n }))\n },\n },\n /** Bring one row (from 0 at the top) forward and push the rest back. */\n focusRow: {\n args: { row: Types.number(0, { min: 0, step: 1 }), ...lineFocus },\n run: (timeline, s, children) => {\n const slots = ItemGrid.itemSlots(timeline as never, s, children)\n const row = Math.round(timeline.args.row ?? 0)\n const inRow = (i: number) => slots[i]?.meta.kind === \"rectangular\" && slots[i].meta.row === row\n return ItemGrid.focusOn(timeline as never, s, inRow, slots.length, timeline.args.dim ?? 0.7, timeline.args.grow ?? 0.15)\n },\n },\n /** Bring one column (from 0 at the left) forward and push the rest back. */\n focusColumn: {\n args: { column: Types.number(0, { min: 0, step: 1 }), ...lineFocus },\n run: (timeline, s, children) => {\n const slots = ItemGrid.itemSlots(timeline as never, s, children)\n const column = Math.round(timeline.args.column ?? 0)\n const inColumn = (i: number) => slots[i]?.meta.kind === \"rectangular\" && slots[i].meta.column === column\n return ItemGrid.focusOn(timeline as never, s, inColumn, slots.length, timeline.args.dim ?? 0.7, timeline.args.grow ?? 0.15)\n },\n },\n },\n ...ItemGrid.fields(arranger),\n}), arranger)\n\nexport type RectangularGrid = NodeOf<typeof RectangularGrid>\n/** What a call or a document row may set. */\nexport type RectangularGridProps = NonNullable<Parameters<typeof RectangularGrid>[0]>\n", "import {\n component2d,\n Types,\n type NodeOf,\n type Values,\n // Named so the emitted declaration reaches these through the sdk, not core.\n type Node2D as _Node2D,\n type Node2DProps as _Node2DProps,\n} from \"@motionscript/sdk\"\n\nimport { ItemGrid, normalizeOrder, RADIAL_DIRECTIONS, radialTurnToTop, type RadialArrangement } from \"../kit\"\n\nconst own = {\n radius: Types.number(200, { min: 0, step: 1 }),\n startAngle: Types.number(0, { step: 1, unit: \"°\" }),\n sweep: Types.number(360, { min: -360, max: 360, step: 1, unit: \"°\" }),\n direction: Types.oneOf(RADIAL_DIRECTIONS, { default: \"clockwise\" }),\n rotateItems: false,\n spinSpeed: Types.number(0, { step: 1, unit: \"°/s\" }),\n}\n\ntype Own = Values<typeof own>\n\nfunction arrangement(s: Own): RadialArrangement {\n return {\n kind: \"radial\",\n radius: s.radius,\n startAngle: s.startAngle,\n sweep: s.sweep,\n direction: s.direction,\n rotateItems: s.rotateItems,\n spinSpeed: s.spinSpeed,\n }\n}\n\nconst arranger: ItemGrid.Arranger<Own> = { arrangement }\n\n/**\n * Children round a circle, or along an arc of one.\n *\n * A full circle spaces the items evenly with none on top of another; an arc\n * puts one at each end. Angles run clockwise from twelve o'clock, so `turnTo`\n * can bring any item to the top like a dial.\n */\nexport const RadialGrid = ItemGrid.define(component2d({\n key: \"radialGrid\",\n state: { ...ItemGrid.state, ...own },\n defaults: ItemGrid.defaults,\n commands: {\n ...ItemGrid.commands,\n /** Orbit the items round the centre by `degrees` — `360` is one full turn. */\n spin: {\n args: { degrees: Types.number(360, { step: 15, unit: \"°\" }) },\n run: (timeline, s) => timeline.tween({ startAngle: s.startAngle + (timeline.args.degrees ?? 360) }),\n },\n /** Turn the ring the shorter way round until an item (by its place in the layers) sits at the top. */\n turnTo: {\n args: { item: Types.number(0, { min: 0, step: 1 }) },\n run: (timeline, s, children) => {\n const count = children.length\n const slot = normalizeOrder(s.order, count).indexOf(Math.round(timeline.args.item ?? 0))\n const turn = slot < 0 ? 0 : radialTurnToTop(arrangement(s), count, slot)\n return timeline.tween({ startAngle: s.startAngle + turn })\n },\n },\n radiusTo: {\n args: { radius: ItemGrid.hinted(280, { min: 0 }) },\n run: (timeline, s) => timeline.tween({ radius: timeline.args.radius ?? s.radius }),\n },\n /** Open or close the arc like a fan — from `0` to `360` is a reveal of its own. */\n sweepTo: {\n args: { sweep: ItemGrid.hinted(360, { min: -360, max: 360, unit: \"°\" }) },\n run: (timeline, s) => timeline.tween({ sweep: timeline.args.sweep ?? s.sweep }),\n },\n },\n ...ItemGrid.fields(arranger),\n}), arranger)\n\nexport type RadialGrid = NodeOf<typeof RadialGrid>\n/** What a call or a document row may set. */\nexport type RadialGridProps = NonNullable<Parameters<typeof RadialGrid>[0]>\n", "import {\n component2d,\n pathOps,\n Types,\n type NodeOf,\n type NodeView,\n type PathData,\n type Size2D,\n type Values,\n // Named so the emitted declaration reaches these through the sdk, not core.\n type Node2D as _Node2D,\n type Node2DProps as _Node2DProps,\n} from \"@motionscript/sdk\"\n\nimport {\n ItemGrid,\n PATH_SPACINGS,\n PATH_TEMPLATES,\n staggerArgs,\n TRANSITION_STAGGER,\n templatePath,\n type PathArrangement,\n type PathPlacement,\n type PathTemplate,\n} from \"../kit\"\n\n/** A template, or `custom` for the grid's own `path`. */\nexport const PATH_GRID_SHAPES = [...PATH_TEMPLATES, \"custom\"] as const\nexport type PathGridShape = (typeof PATH_GRID_SHAPES)[number]\n\nconst own = {\n shape: Types.oneOf(PATH_GRID_SHAPES, { default: \"circle\" }),\n /** Used when `shape` is `custom`: an SVG path, y-down as SVG writes one, centred on its own bounds. */\n path: Types.path,\n /** A path node to follow instead, by id — the items track it wherever it goes. */\n pathNode: ItemGrid.nodeRef([\"path\"]),\n spacing: Types.oneOf(PATH_SPACINGS, { default: \"distribute\" }),\n spacingDistance: Types.number(80, { min: 0, step: 1 }),\n /** Share of the path the items are moved along — `1` is once round. */\n offset: Types.number(0, { step: 0.01 }),\n /** Share of the path per second the items travel on their own. */\n flowSpeed: Types.number(0, { step: 0.01, unit: \"/s\" }),\n trimStart: Types.number(0, { min: 0, max: 1, step: 0.01 }),\n trimEnd: Types.number(1, { min: 0, max: 1, step: 0.01 }),\n alignToPath: true,\n}\n\ntype Own = Values<typeof own>\n\nconst AT_ORIGIN: PathPlacement = { originX: 0, originY: 0, x: 0, y: 0, rotation: 0, scale: 1 }\n\n/** The size a path grid is placed at when nothing says otherwise, since a template is drawn to fill it. */\nconst DEFAULT_SIZE = { width: 640, height: 400 }\n\nconst arranger: ItemGrid.Arranger<Own> = {\n arrangement: (s, box): PathArrangement => {\n const { path, placement } = pathIn(s, box)\n return {\n kind: \"path\",\n path,\n placement,\n spacing: s.spacing,\n spacingDistance: s.spacingDistance,\n offset: s.offset,\n flowSpeed: s.flowSpeed,\n trimStart: s.trimStart,\n trimEnd: s.trimEnd,\n alignToPath: s.alignToPath,\n }\n },\n}\n\n/**\n * Children along a path: one of the templates drawn to fill the node's box,\n * a path of the grid's own, or a path node elsewhere in the scene, followed\n * wherever it is.\n *\n * Items are spaced by distance along the curve, so they sit evenly on a tight\n * bend and a straight alike. Animating `offset` moves them along it — on a\n * closed path they come round again, which is a conveyor belt for free.\n */\nexport const PathGrid = ItemGrid.define(component2d({\n key: \"pathGrid\",\n state: { ...ItemGrid.state, ...own },\n // A template is drawn to fill the box, so a path grid needs one of its own\n // rather than hugging items whose places depend on it.\n defaults: { ...DEFAULT_SIZE },\n commands: {\n ...ItemGrid.commands,\n /** Move the items along the path by `loops` — `1` is once round, and they keep their spacing. */\n flow: {\n args: { loops: Types.number(1, { step: 0.25 }) },\n run: (timeline, s) => timeline.tween({ offset: s.offset + (timeline.args.loops ?? 1) }),\n },\n /** Squeeze the items into part of the path, between two shares of its length. */\n trimTo: {\n args: {\n trimStart: ItemGrid.hinted(0.25, { min: 0, max: 1, step: 0.01 }),\n trimEnd: ItemGrid.hinted(0.75, { min: 0, max: 1, step: 0.01 }),\n },\n run: (timeline, s) => timeline.tween({\n trimStart: timeline.args.trimStart ?? s.trimStart,\n trimEnd: timeline.args.trimEnd ?? s.trimEnd,\n }),\n },\n /**\n * Move the items onto another path — a template, or a path node in the\n * scene. Each item travels from its place on the old path to its place on\n * the new one; the path itself is not morphed.\n */\n setPath: {\n args: {\n shape: ItemGrid.hinted(\"heart\", { kind: \"enum\", options: PATH_GRID_SHAPES }),\n pathNode: ItemGrid.nodeRefArg([\"path\"]),\n ...staggerArgs(TRANSITION_STAGGER),\n },\n run: (timeline, s, children) => {\n const pathNode = timeline.args.pathNode ?? \"\"\n const changes = pathNode ? { pathNode } : { shape: timeline.args.shape ?? s.shape, pathNode: \"\" }\n return ItemGrid.transitionTo(timeline as never, s, children, changes)\n },\n },\n },\n ...ItemGrid.fields(arranger),\n}), arranger)\n\nexport type PathGrid = NodeOf<typeof PathGrid>\n/** What a call or a document row may set. */\nexport type PathGridProps = NonNullable<Parameters<typeof PathGrid>[0]>\n\n/** The path the items follow, and where its coordinates land in this grid's frame. */\nfunction pathIn(s: Own, box: Size2D): { path: PathData; placement: PathPlacement } {\n const linked = s.pathNode\n // A document `path` draws its data in its own unit box, at its own position.\n if (linked?.key === \"path\") return { path: unitPath(linked), placement: { ...AT_ORIGIN, ...linked.frame } }\n // A face-value path draws its data centred on the data's own bounds, at its own position.\n const data = linked?.key === \"facePath\" ? dataOf(linked) : undefined\n const bounds = data !== undefined ? pathOps.bounds(data) : null\n if (linked && data !== undefined && bounds) {\n return {\n path: data,\n placement: {\n originX: (bounds.minX + bounds.maxX) / 2,\n originY: (bounds.minY + bounds.maxY) / 2,\n ...linked.frame,\n },\n }\n }\n if (s.shape === \"custom\") {\n const own = pathOps.bounds(s.path)\n if (own) {\n return {\n path: s.path,\n placement: {\n ...AT_ORIGIN,\n originX: (own.minX + own.maxX) / 2,\n originY: (own.minY + own.maxY) / 2,\n flipY: true,\n },\n }\n }\n }\n const template: PathTemplate = s.shape === \"custom\" ? \"circle\" : s.shape\n return { path: templatePath(template, box), placement: AT_ORIGIN }\n}\n\nfunction dataOf(view: NodeView): PathData {\n return (view.state as { readonly data: PathData }).data\n}\n\nconst unitPaths = new WeakMap<NodeView, { data: PathData; width: number; height: number; path: PathData }>()\n\n/**\n * A path node's geometry as it draws it: stored in its unit box, y-down, and\n * scaled to its laid-out size — kept while neither changes, so the path's\n * measurement is kept with it.\n */\nfunction unitPath(view: NodeView): PathData {\n const data = dataOf(view)\n const { width, height } = view.size\n const cached = unitPaths.get(view)\n if (cached && cached.data === data && cached.width === width && cached.height === height) return cached.path\n const path = pathOps.anchorCommands(pathOps.anchors(data), (p) => ({ x: p.x * width, y: -p.y * height }))\n unitPaths.set(view, { data, width, height, path })\n return path\n}\n", "import {\n component2d,\n Types,\n type NodeOf,\n type Values,\n // Named so the emitted declaration reaches these through the sdk, not core.\n type Node2D as _Node2D,\n type Node2DProps as _Node2DProps,\n} from \"@motionscript/sdk\"\n\nimport {\n ItemGrid,\n normalizeOrder,\n SPHERE_AXES,\n SPHERE_FACINGS,\n sphereFaceForward,\n wrapDegrees,\n type SphereArrangement,\n type SphereAxis,\n} from \"../kit\"\n\nconst own = {\n radius: Types.number(220, { min: 0, step: 1 }),\n yaw: Types.number(0, { step: 1, unit: \"°\" }),\n pitch: Types.number(0, { step: 1, unit: \"°\" }),\n roll: Types.number(0, { step: 1, unit: \"°\" }),\n facing: Types.oneOf(SPHERE_FACINGS, { default: \"outward\" }),\n focalLength: Types.number(900, { min: 100, step: 10 }),\n depthFade: Types.number(0.5, { min: 0, max: 1, step: 0.05 }),\n cullBackfaces: false,\n spinSpeed: Types.number(0, { step: 1, unit: \"°/s\" }),\n}\n\ntype Own = Values<typeof own>\n\nfunction arrangement(s: Own): SphereArrangement {\n return {\n kind: \"sphere\",\n radius: s.radius,\n yaw: s.yaw,\n pitch: s.pitch,\n roll: s.roll,\n facing: s.facing,\n focalLength: s.focalLength,\n depthFade: s.depthFade,\n cullBackfaces: s.cullBackfaces,\n spinSpeed: s.spinSpeed,\n }\n}\n\nconst arranger: ItemGrid.Arranger<Own> = { arrangement }\n\nconst AXIS_PROP: Record<SphereAxis, \"yaw\" | \"pitch\" | \"roll\"> = { x: \"pitch\", y: \"yaw\", z: \"roll\" }\n\n/**\n * Children spread over a sphere — a Fibonacci lattice, as even as any number\n * of points gets — and seen through a camera of the grid's own, so the far\n * side is smaller, drawn first, and hidden where a face turns away.\n *\n * `outward` lays each item flat on the surface; `billboard` keeps each one\n * facing the viewer, like labels on a globe. `turnTo` brings any item round\n * to the front.\n */\nexport const SphereGrid = ItemGrid.define(component2d({\n key: \"sphereGrid\",\n state: { ...ItemGrid.state, ...own },\n defaults: ItemGrid.defaults,\n commands: {\n ...ItemGrid.commands,\n /** Turn the sphere about an axis by `degrees` — `y` spins it like a globe. */\n spin: {\n args: {\n axis: Types.oneOf(SPHERE_AXES, { default: \"y\" }),\n degrees: Types.number(360, { step: 15, unit: \"°\" }),\n },\n run: (timeline, s) => {\n const key = AXIS_PROP[timeline.args.axis ?? \"y\"] ?? \"yaw\"\n return timeline.tween({ [key]: s[key] + (timeline.args.degrees ?? 360) })\n },\n },\n /** Turn the sphere to a set orientation. */\n orientTo: {\n args: {\n yaw: ItemGrid.hinted(45, { unit: \"°\" }),\n pitch: ItemGrid.hinted(20, { unit: \"°\" }),\n roll: ItemGrid.hinted(0, { unit: \"°\" }),\n },\n run: (timeline, s) => timeline.tween({\n yaw: timeline.args.yaw ?? s.yaw,\n pitch: timeline.args.pitch ?? s.pitch,\n roll: timeline.args.roll ?? s.roll,\n }),\n },\n /**\n * Turn the sphere the shorter way until an item (by its place in the layers)\n * faces the viewer. It turns from the orientation the sphere is given: the\n * yaw its `spinSpeed` adds by the time the command runs is not counted, as\n * commands are built against the tree standing at time 0.\n */\n turnTo: {\n args: { item: Types.number(0, { min: 0, step: 1 }) },\n run: (timeline, s, children) => {\n const count = children.length\n const slot = normalizeOrder(s.order, count).indexOf(Math.round(timeline.args.item ?? 0))\n if (slot < 0) return timeline.tween({})\n const facing = sphereFaceForward(count, slot)\n return timeline.tween({\n yaw: s.yaw + wrapDegrees(facing.yaw - s.yaw),\n pitch: s.pitch + wrapDegrees(facing.pitch - s.pitch),\n roll: 0,\n })\n },\n },\n radiusTo: {\n args: { radius: ItemGrid.hinted(300, { min: 0 }) },\n run: (timeline, s) => timeline.tween({ radius: timeline.args.radius ?? s.radius }),\n },\n /** Dolly the camera: a shorter focal length exaggerates the depth, a longer one flattens it. */\n focalLengthTo: {\n args: { focalLength: ItemGrid.hinted(600, { min: 100 }) },\n run: (timeline, s) => timeline.tween({ focalLength: timeline.args.focalLength ?? s.focalLength }),\n },\n },\n ...ItemGrid.fields(arranger),\n}), arranger)\n\nexport type SphereGrid = NodeOf<typeof SphereGrid>\n/** What a call or a document row may set. */\nexport type SphereGridProps = NonNullable<Parameters<typeof SphereGrid>[0]>\n", "import { PathGrid } from \"./path-grid\"\nimport { RadialGrid } from \"./radial-grid\"\nimport { RectangularGrid } from \"./rectangular-grid\"\nimport { SphereGrid } from \"./sphere-grid\"\n\n/**\n * Every node type this package publishes.\n *\n * A host registers these by handing the array to an engine —\n * `new Engine(platform, { nodes: NODES })` — which reads each component's key.\n * Defining a component only *declares* that key: nothing is registered by\n * importing a module, so a registry holds exactly what its owner asked for.\n *\n * Listing the component **values** is also what survives bundling: this package\n * declares `sideEffects: false`, and a document names a node type by string, so\n * an import kept only for its side effect is exactly what gets shaken out.\n */\n// Typed by name, so the declaration names each component rather than spelling out its type through core.\ntype KitNode =\n | typeof RectangularGrid\n | typeof RadialGrid\n | typeof PathGrid\n | typeof SphereGrid\n\nexport const NODES: KitNode[] = [\n RectangularGrid,\n RadialGrid,\n PathGrid,\n SphereGrid,\n]\n"],
5
- "mappings": "uYAAA,OACE,eAAAA,EACA,aAAAC,EACA,SAAAC,MAMK,oBAaP,IAAMC,EAAM,CACV,QAASC,EAAM,OAAO,EAAG,CAAE,IAAK,EAAG,KAAM,CAAC,CAAE,EAC5C,cAAeA,EAAM,MAAMC,EAAiB,CAAE,QAAS,KAAK,CAAE,EAC9D,SAAUD,EAAM,MAAME,EAAY,CAAE,QAAS,KAAK,CAAE,EACpD,UAAWF,EAAM,OAAO,IAAK,CAAE,IAAK,EAAG,KAAM,CAAC,CAAE,EAChD,WAAYA,EAAM,OAAO,IAAK,CAAE,IAAK,EAAG,KAAM,CAAC,CAAE,EACjD,UAAWA,EAAM,OAAO,GAAI,CAAE,KAAM,CAAC,CAAE,EACvC,OAAQA,EAAM,OAAO,GAAI,CAAE,KAAM,CAAC,CAAE,EACpC,cAAeA,EAAM,MAAMG,EAAa,CAAE,QAAS,OAAO,CAAE,EAC5D,UAAWH,EAAM,OAAO,EAAG,CAAE,IAAK,GAAI,IAAK,EAAG,KAAM,GAAI,CAAE,EAC1D,aAAcA,EAAM,OAAO,EAAG,CAAE,IAAK,GAAI,IAAK,EAAG,KAAM,GAAI,CAAE,GAK/D,SAASI,EAAYC,EAAM,CACzB,MAAO,CACL,KAAM,cACN,QAASA,EAAE,QACX,cAAeA,EAAE,cACjB,SAAUA,EAAE,SACZ,UAAWA,EAAE,UACb,WAAYA,EAAE,WACd,UAAWA,EAAE,UACb,OAAQA,EAAE,OACV,cAAeA,EAAE,cACjB,UAAWA,EAAE,UACb,aAAcA,EAAE,aAEpB,CAEA,IAAMC,EAAmC,CACvC,YAAAF,EAEA,UAAW,CAACC,EAAGE,EAAOC,IAAWH,EAAE,WAAa,MAAQG,EAAQC,EAAgBL,EAAYC,CAAC,EAAGE,EAAO,CAAA,EAA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Q,CACN,KAAM,CAAE,KAAMH,EAAM,OAAO,EAAG,CAAE,IAAK,EAAG,KAAM,CAAC,CAAE,CAAC,EAClD,IAAK,CAACU,EAAUP,EAAGS,IAAY,CAC7B,IAAMC,EAAQD,EAAS,OACjBE,EAAOC,EAAeZ,EAAE,MAAOU,CAAK,EAAE,QAAQ,KAAK,MAAMH,EAAS,KAAK,MAAQ,CAAC,CAAC,EACvF,GAAII,EAAO,EAAG,OAAOJ,EAAS,MAAM,CAAA,CAAE,EACtC,IAAMM,EAASC,EAAkBJ,EAAOC,CAAI,EAC5C,OAAOJ,EAAS,MAAM,CACpB,IAAKP,EAAE,IAAMe,EAAYF,EAAO,IAAMb,EAAE,GAAG,EAC3C,MAAOA,EAAE,MAAQe,EAAYF,EAAO,MAAQb,EAAE,KAAK,EACnD,KAAM,EACP,CACH,GAEF,SAAU,CACR,KAAM,CAAE,OAAQI,EAAS,OAAO,IAAK,CAAE,IAAK,CAAC,CAAE,CAAC,EAChD,IAAK,CAACG,EAAUP,IAAMO,EAAS,MAAM,CAAE,OAAQA,EAAS,KAAK,QAAUP,EAAE,MAAM,CAAE,GAGnF,cAAe,CACb,KAAM,CAAE,YAAaI,EAAS,OAAO,IAAK,CAAE,IAAK,GAAG,CAAE,CAAC,EACvD,IAAK,CAACG,EAAUP,IAAMO,EAAS,MAAM,CAAE,YAAaA,EAAS,KAAK,aAAeP,EAAE,WAAW,CAAE,IAGpG,GAAGI,EAAS,OAAOH,CAAQ,EAC5B,EAAGA,CAAQ,ECpGL,IAAMe,GAAmB,CAC9BC,EACAC,EACAC,EACAC",
4
+ "sourcesContent": ["import {\n component2d,\n easeInOut,\n Types,\n type NodeOf,\n type Values,\n // Named so the emitted declaration reaches these through the sdk, not core.\n type Node2D as _Node2D,\n type Node2DProps as _Node2DProps,\n} from \"@motionscript/sdk\"\n\nimport {\n CELL_MODES,\n FILL_DIRECTIONS,\n ItemGrid,\n LINE_ALIGNS,\n rectangularCell,\n staggerArgs,\n TRANSITION_STAGGER,\n type RectangularArrangement,\n} from \"../kit\"\n\nconst own = {\n columns: Types.number(3, { min: 1, step: 1 }),\n fillDirection: Types.oneOf(FILL_DIRECTIONS, { default: \"row\" }),\n cellMode: Types.oneOf(CELL_MODES, { default: \"fit\" }),\n cellWidth: Types.number(120, { min: 0, step: 1 }),\n cellHeight: Types.number(120, { min: 0, step: 1 }),\n columnGap: Types.number(24, { step: 1 }),\n rowGap: Types.number(24, { step: 1 }),\n lastLineAlign: Types.oneOf(LINE_ALIGNS, { default: \"start\" }),\n rowOffset: Types.number(0, { min: -1, max: 1, step: 0.05 }),\n columnOffset: Types.number(0, { min: -1, max: 1, step: 0.05 }),\n}\n\ntype Own = Values<typeof own>\n\nfunction arrangement(s: Own): RectangularArrangement {\n return {\n kind: \"rectangular\",\n columns: s.columns,\n fillDirection: s.fillDirection,\n cellMode: s.cellMode,\n cellWidth: s.cellWidth,\n cellHeight: s.cellHeight,\n columnGap: s.columnGap,\n rowGap: s.rowGap,\n lastLineAlign: s.lastLineAlign,\n rowOffset: s.rowOffset,\n columnOffset: s.columnOffset,\n }\n}\n\nconst arranger: ItemGrid.Arranger<Own> = {\n arrangement,\n // A child set to fill takes its cell, where the cell is not simply the largest child.\n itemSpace: (s, count, space) => (s.cellMode === \"fit\" ? space : rectangularCell(arrangement(s), count, [], space)),\n}\n\n/** The focus args of a row or a column: the grow a row leaves out is the shared focus's. */\nconst lineFocus = {\n dim: Types.number(0.7, { min: 0, max: 1, step: 0.05 }),\n grow: ItemGrid.hinted(0.1, { min: 0, max: 1, step: 0.05 }),\n}\n\n/**\n * Children in rows and columns — the grid the other three are variations on.\n *\n * Cells are as big as the largest child (`fit`), a size of their own\n * (`fixed`), or an equal share of the node's box (`fill`), which is also the\n * room a child set to fill grows into. Shift every other row by half a cell\n * for a brick bond or a hex pack.\n */\nexport const RectangularGrid = ItemGrid.define(component2d({\n key: \"rectangularGrid\",\n state: { ...ItemGrid.state, ...own },\n defaults: ItemGrid.defaults,\n commands: {\n ...ItemGrid.commands,\n /** Re-flow the items into `columns` columns, each moving to its new cell. */\n columnsTo: {\n args: { columns: ItemGrid.hinted(4, { min: 1, step: 1 }), ...staggerArgs(TRANSITION_STAGGER) },\n run: (timeline, s, children) => {\n const columns = Math.max(1, Math.round(timeline.args.columns ?? s.columns))\n return ItemGrid.transitionTo(timeline as never, s, children, { columns })\n },\n },\n /** Animate the spacing between columns and rows. */\n gapTo: {\n args: { columnGap: ItemGrid.hinted(48), rowGap: ItemGrid.hinted(48) },\n run: (timeline) => {\n const data: { columnGap?: number; rowGap?: number } = {}\n if (timeline.args.columnGap !== undefined) data.columnGap = timeline.args.columnGap\n if (timeline.args.rowGap !== undefined) data.rowGap = timeline.args.rowGap\n return timeline.tween(data)\n },\n },\n /**\n * Animate the cell size, from whatever the cells measure now. The grid\n * switches to `fixed` cells as it starts, since a size of its own is what\n * `fixed` means.\n */\n cellSizeTo: {\n args: { cellWidth: ItemGrid.hinted(160, { min: 0 }), cellHeight: ItemGrid.hinted(160, { min: 0 }) },\n easing: easeInOut(\"cubic\"),\n run: (timeline, s, children) => {\n const sizes = children.map((child) => child.size)\n const box = ItemGrid.contentBox(timeline.node.size, s.padding)\n const from = rectangularCell(arrangement(s), sizes.length, sizes, box)\n const width = timeline.args.cellWidth ?? from.width\n const height = timeline.args.cellHeight ?? from.height\n return timeline.animate((t) => ({\n cellMode: \"fixed\",\n cellWidth: from.width + (width - from.width) * t,\n cellHeight: from.height + (height - from.height) * t,\n }))\n },\n },\n /** Bring one row (from 0 at the top) forward and push the rest back. */\n focusRow: {\n args: { row: Types.number(0, { min: 0, step: 1 }), ...lineFocus },\n run: (timeline, s, children) => {\n const slots = ItemGrid.itemSlots(timeline as never, s, children)\n const row = Math.round(timeline.args.row ?? 0)\n const inRow = (i: number) => slots[i]?.meta.kind === \"rectangular\" && slots[i].meta.row === row\n return ItemGrid.focusOn(timeline as never, s, inRow, slots.length, timeline.args.dim ?? 0.7, timeline.args.grow ?? 0.15)\n },\n },\n /** Bring one column (from 0 at the left) forward and push the rest back. */\n focusColumn: {\n args: { column: Types.number(0, { min: 0, step: 1 }), ...lineFocus },\n run: (timeline, s, children) => {\n const slots = ItemGrid.itemSlots(timeline as never, s, children)\n const column = Math.round(timeline.args.column ?? 0)\n const inColumn = (i: number) => slots[i]?.meta.kind === \"rectangular\" && slots[i].meta.column === column\n return ItemGrid.focusOn(timeline as never, s, inColumn, slots.length, timeline.args.dim ?? 0.7, timeline.args.grow ?? 0.15)\n },\n },\n },\n ...ItemGrid.fields(arranger),\n}), arranger)\n\nexport type RectangularGrid = NodeOf<typeof RectangularGrid>\n", "import {\n component2d,\n Types,\n type NodeOf,\n type Values,\n // Named so the emitted declaration reaches these through the sdk, not core.\n type Node2D as _Node2D,\n type Node2DProps as _Node2DProps,\n} from \"@motionscript/sdk\"\n\nimport { ItemGrid, normalizeOrder, RADIAL_DIRECTIONS, radialTurnToTop, type RadialArrangement } from \"../kit\"\n\nconst own = {\n radius: Types.number(200, { min: 0, step: 1 }),\n startAngle: Types.number(0, { step: 1, unit: \"°\" }),\n sweep: Types.number(360, { min: -360, max: 360, step: 1, unit: \"°\" }),\n direction: Types.oneOf(RADIAL_DIRECTIONS, { default: \"clockwise\" }),\n rotateItems: false,\n spinSpeed: Types.number(0, { step: 1, unit: \"°/s\" }),\n}\n\ntype Own = Values<typeof own>\n\nfunction arrangement(s: Own): RadialArrangement {\n return {\n kind: \"radial\",\n radius: s.radius,\n startAngle: s.startAngle,\n sweep: s.sweep,\n direction: s.direction,\n rotateItems: s.rotateItems,\n spinSpeed: s.spinSpeed,\n }\n}\n\nconst arranger: ItemGrid.Arranger<Own> = { arrangement }\n\n/**\n * Children round a circle, or along an arc of one.\n *\n * A full circle spaces the items evenly with none on top of another; an arc\n * puts one at each end. Angles run clockwise from twelve o'clock, so `turnTo`\n * can bring any item to the top like a dial.\n */\nexport const RadialGrid = ItemGrid.define(component2d({\n key: \"radialGrid\",\n state: { ...ItemGrid.state, ...own },\n defaults: ItemGrid.defaults,\n commands: {\n ...ItemGrid.commands,\n /** Orbit the items round the centre by `degrees` — `360` is one full turn. */\n spin: {\n args: { degrees: Types.number(360, { step: 15, unit: \"°\" }) },\n run: (timeline, s) => timeline.tween({ startAngle: s.startAngle + (timeline.args.degrees ?? 360) }),\n },\n /** Turn the ring the shorter way round until an item (by its place in the layers) sits at the top. */\n turnTo: {\n args: { item: Types.number(0, { min: 0, step: 1 }) },\n run: (timeline, s, children) => {\n const count = children.length\n const slot = normalizeOrder(s.order, count).indexOf(Math.round(timeline.args.item ?? 0))\n const turn = slot < 0 ? 0 : radialTurnToTop(arrangement(s), count, slot)\n return timeline.tween({ startAngle: s.startAngle + turn })\n },\n },\n radiusTo: {\n args: { radius: ItemGrid.hinted(280, { min: 0 }) },\n run: (timeline, s) => timeline.tween({ radius: timeline.args.radius ?? s.radius }),\n },\n /** Open or close the arc like a fan — from `0` to `360` is a reveal of its own. */\n sweepTo: {\n args: { sweep: ItemGrid.hinted(360, { min: -360, max: 360, unit: \"°\" }) },\n run: (timeline, s) => timeline.tween({ sweep: timeline.args.sweep ?? s.sweep }),\n },\n },\n ...ItemGrid.fields(arranger),\n}), arranger)\n\nexport type RadialGrid = NodeOf<typeof RadialGrid>\n", "import {\n component2d,\n pathOps,\n Types,\n type NodeOf,\n type NodeView,\n type PathData,\n type Size2D,\n type Values,\n // Named so the emitted declaration reaches these through the sdk, not core.\n type Node2D as _Node2D,\n type Node2DProps as _Node2DProps,\n} from \"@motionscript/sdk\"\n\nimport {\n ItemGrid,\n PATH_SPACINGS,\n PATH_TEMPLATES,\n staggerArgs,\n TRANSITION_STAGGER,\n templatePath,\n type PathArrangement,\n type PathPlacement,\n type PathTemplate,\n} from \"../kit\"\n\n/** A template, or `custom` for the grid's own `path`. */\nexport const PATH_GRID_SHAPES = [...PATH_TEMPLATES, \"custom\"] as const\n\nconst own = {\n shape: Types.oneOf(PATH_GRID_SHAPES, { default: \"circle\" }),\n /** Used when `shape` is `custom`: an SVG path, y-down as SVG writes one, centred on its own bounds. */\n path: Types.path,\n /** A path node to follow instead, by id — the items track it wherever it goes. */\n pathNode: ItemGrid.nodeRef([\"path\"]),\n spacing: Types.oneOf(PATH_SPACINGS, { default: \"distribute\" }),\n spacingDistance: Types.number(80, { min: 0, step: 1 }),\n /** Share of the path the items are moved along — `1` is once round. */\n offset: Types.number(0, { step: 0.01 }),\n /** Share of the path per second the items travel on their own. */\n flowSpeed: Types.number(0, { step: 0.01, unit: \"/s\" }),\n trimStart: Types.number(0, { min: 0, max: 1, step: 0.01 }),\n trimEnd: Types.number(1, { min: 0, max: 1, step: 0.01 }),\n alignToPath: true,\n}\n\ntype Own = Values<typeof own>\n\nconst AT_ORIGIN: PathPlacement = { originX: 0, originY: 0, x: 0, y: 0, rotation: 0, scale: 1 }\n\n/** The size a path grid is placed at when nothing says otherwise, since a template is drawn to fill it. */\nconst DEFAULT_SIZE = { width: 640, height: 400 }\n\nconst arranger: ItemGrid.Arranger<Own> = {\n arrangement: (s, box): PathArrangement => {\n const { path, placement } = pathIn(s, box)\n return {\n kind: \"path\",\n path,\n placement,\n spacing: s.spacing,\n spacingDistance: s.spacingDistance,\n offset: s.offset,\n flowSpeed: s.flowSpeed,\n trimStart: s.trimStart,\n trimEnd: s.trimEnd,\n alignToPath: s.alignToPath,\n }\n },\n}\n\n/**\n * Children along a path: one of the templates drawn to fill the node's box,\n * a path of the grid's own, or a path node elsewhere in the scene, followed\n * wherever it is.\n *\n * Items are spaced by distance along the curve, so they sit evenly on a tight\n * bend and a straight alike. Animating `offset` moves them along it — on a\n * closed path they come round again, which is a conveyor belt for free.\n */\nexport const PathGrid = ItemGrid.define(component2d({\n key: \"pathGrid\",\n state: { ...ItemGrid.state, ...own },\n // A template is drawn to fill the box, so a path grid needs one of its own\n // rather than hugging items whose places depend on it.\n defaults: { ...DEFAULT_SIZE },\n commands: {\n ...ItemGrid.commands,\n /** Move the items along the path by `loops` — `1` is once round, and they keep their spacing. */\n flow: {\n args: { loops: Types.number(1, { step: 0.25 }) },\n run: (timeline, s) => timeline.tween({ offset: s.offset + (timeline.args.loops ?? 1) }),\n },\n /** Squeeze the items into part of the path, between two shares of its length. */\n trimTo: {\n args: {\n trimStart: ItemGrid.hinted(0.25, { min: 0, max: 1, step: 0.01 }),\n trimEnd: ItemGrid.hinted(0.75, { min: 0, max: 1, step: 0.01 }),\n },\n run: (timeline, s) => timeline.tween({\n trimStart: timeline.args.trimStart ?? s.trimStart,\n trimEnd: timeline.args.trimEnd ?? s.trimEnd,\n }),\n },\n /**\n * Move the items onto another path — a template, or a path node in the\n * scene. Each item travels from its place on the old path to its place on\n * the new one; the path itself is not morphed.\n */\n setPath: {\n args: {\n shape: ItemGrid.hinted(\"heart\", { kind: \"enum\", options: PATH_GRID_SHAPES }),\n pathNode: ItemGrid.nodeRefArg([\"path\"]),\n ...staggerArgs(TRANSITION_STAGGER),\n },\n run: (timeline, s, children) => {\n const pathNode = timeline.args.pathNode ?? \"\"\n const changes = pathNode ? { pathNode } : { shape: timeline.args.shape ?? s.shape, pathNode: \"\" }\n return ItemGrid.transitionTo(timeline as never, s, children, changes)\n },\n },\n },\n ...ItemGrid.fields(arranger),\n}), arranger)\n\nexport type PathGrid = NodeOf<typeof PathGrid>\n\n/** The path the items follow, and where its coordinates land in this grid's frame. */\nfunction pathIn(s: Own, box: Size2D): { path: PathData; placement: PathPlacement } {\n const linked = s.pathNode\n // A document `path` draws its data in its own unit box, at its own position.\n if (linked?.key === \"path\") return { path: unitPath(linked), placement: { ...AT_ORIGIN, ...linked.frame } }\n // A face-value path draws its data centred on the data's own bounds, at its own position.\n const data = linked?.key === \"facePath\" ? dataOf(linked) : undefined\n const bounds = data !== undefined ? pathOps.bounds(data) : null\n if (linked && data !== undefined && bounds) {\n return {\n path: data,\n placement: {\n originX: (bounds.minX + bounds.maxX) / 2,\n originY: (bounds.minY + bounds.maxY) / 2,\n ...linked.frame,\n },\n }\n }\n if (s.shape === \"custom\") {\n const own = pathOps.bounds(s.path)\n if (own) {\n return {\n path: s.path,\n placement: {\n ...AT_ORIGIN,\n originX: (own.minX + own.maxX) / 2,\n originY: (own.minY + own.maxY) / 2,\n flipY: true,\n },\n }\n }\n }\n const template: PathTemplate = s.shape === \"custom\" ? \"circle\" : s.shape\n return { path: templatePath(template, box), placement: AT_ORIGIN }\n}\n\nfunction dataOf(view: NodeView): PathData {\n return (view.state as { readonly data: PathData }).data\n}\n\nconst unitPaths = new WeakMap<NodeView, { data: PathData; width: number; height: number; path: PathData }>()\n\n/**\n * A path node's geometry as it draws it: stored in its unit box, y-down, and\n * scaled to its laid-out size — kept while neither changes, so the path's\n * measurement is kept with it.\n */\nfunction unitPath(view: NodeView): PathData {\n const data = dataOf(view)\n const { width, height } = view.size\n const cached = unitPaths.get(view)\n if (cached && cached.data === data && cached.width === width && cached.height === height) return cached.path\n const path = pathOps.anchorCommands(pathOps.anchors(data), (p) => ({ x: p.x * width, y: -p.y * height }))\n unitPaths.set(view, { data, width, height, path })\n return path\n}\n", "import {\n component2d,\n Types,\n type NodeOf,\n type Values,\n // Named so the emitted declaration reaches these through the sdk, not core.\n type Node2D as _Node2D,\n type Node2DProps as _Node2DProps,\n} from \"@motionscript/sdk\"\n\nimport {\n ItemGrid,\n normalizeOrder,\n SPHERE_AXES,\n SPHERE_FACINGS,\n sphereFaceForward,\n wrapDegrees,\n type SphereArrangement,\n type SphereAxis,\n} from \"../kit\"\n\nconst own = {\n radius: Types.number(220, { min: 0, step: 1 }),\n yaw: Types.number(0, { step: 1, unit: \"°\" }),\n pitch: Types.number(0, { step: 1, unit: \"°\" }),\n roll: Types.number(0, { step: 1, unit: \"°\" }),\n facing: Types.oneOf(SPHERE_FACINGS, { default: \"outward\" }),\n focalLength: Types.number(900, { min: 100, step: 10 }),\n depthFade: Types.number(0.5, { min: 0, max: 1, step: 0.05 }),\n cullBackfaces: false,\n spinSpeed: Types.number(0, { step: 1, unit: \"°/s\" }),\n}\n\ntype Own = Values<typeof own>\n\nfunction arrangement(s: Own): SphereArrangement {\n return {\n kind: \"sphere\",\n radius: s.radius,\n yaw: s.yaw,\n pitch: s.pitch,\n roll: s.roll,\n facing: s.facing,\n focalLength: s.focalLength,\n depthFade: s.depthFade,\n cullBackfaces: s.cullBackfaces,\n spinSpeed: s.spinSpeed,\n }\n}\n\nconst arranger: ItemGrid.Arranger<Own> = { arrangement }\n\nconst AXIS_PROP: Record<SphereAxis, \"yaw\" | \"pitch\" | \"roll\"> = { x: \"pitch\", y: \"yaw\", z: \"roll\" }\n\n/**\n * Children spread over a sphere — a Fibonacci lattice, as even as any number\n * of points gets — and seen through a camera of the grid's own, so the far\n * side is smaller, drawn first, and hidden where a face turns away.\n *\n * `outward` lays each item flat on the surface; `billboard` keeps each one\n * facing the viewer, like labels on a globe. `turnTo` brings any item round\n * to the front.\n */\nexport const SphereGrid = ItemGrid.define(component2d({\n key: \"sphereGrid\",\n state: { ...ItemGrid.state, ...own },\n defaults: ItemGrid.defaults,\n commands: {\n ...ItemGrid.commands,\n /** Turn the sphere about an axis by `degrees` — `y` spins it like a globe. */\n spin: {\n args: {\n axis: Types.oneOf(SPHERE_AXES, { default: \"y\" }),\n degrees: Types.number(360, { step: 15, unit: \"°\" }),\n },\n run: (timeline, s) => {\n const key = AXIS_PROP[timeline.args.axis ?? \"y\"] ?? \"yaw\"\n return timeline.tween({ [key]: s[key] + (timeline.args.degrees ?? 360) })\n },\n },\n /** Turn the sphere to a set orientation. */\n orientTo: {\n args: {\n yaw: ItemGrid.hinted(45, { unit: \"°\" }),\n pitch: ItemGrid.hinted(20, { unit: \"°\" }),\n roll: ItemGrid.hinted(0, { unit: \"°\" }),\n },\n run: (timeline, s) => timeline.tween({\n yaw: timeline.args.yaw ?? s.yaw,\n pitch: timeline.args.pitch ?? s.pitch,\n roll: timeline.args.roll ?? s.roll,\n }),\n },\n /**\n * Turn the sphere the shorter way until an item (by its place in the layers)\n * faces the viewer. It turns from the orientation the sphere is given: the\n * yaw its `spinSpeed` adds by the time the command runs is not counted, as\n * commands are built against the tree standing at time 0.\n */\n turnTo: {\n args: { item: Types.number(0, { min: 0, step: 1 }) },\n run: (timeline, s, children) => {\n const count = children.length\n const slot = normalizeOrder(s.order, count).indexOf(Math.round(timeline.args.item ?? 0))\n if (slot < 0) return timeline.tween({})\n const facing = sphereFaceForward(count, slot)\n return timeline.tween({\n yaw: s.yaw + wrapDegrees(facing.yaw - s.yaw),\n pitch: s.pitch + wrapDegrees(facing.pitch - s.pitch),\n roll: 0,\n })\n },\n },\n radiusTo: {\n args: { radius: ItemGrid.hinted(300, { min: 0 }) },\n run: (timeline, s) => timeline.tween({ radius: timeline.args.radius ?? s.radius }),\n },\n /** Dolly the camera: a shorter focal length exaggerates the depth, a longer one flattens it. */\n focalLengthTo: {\n args: { focalLength: ItemGrid.hinted(600, { min: 100 }) },\n run: (timeline, s) => timeline.tween({ focalLength: timeline.args.focalLength ?? s.focalLength }),\n },\n },\n ...ItemGrid.fields(arranger),\n}), arranger)\n\nexport type SphereGrid = NodeOf<typeof SphereGrid>\n", "import { PathGrid } from \"./path-grid\"\nimport { RadialGrid } from \"./radial-grid\"\nimport { RectangularGrid } from \"./rectangular-grid\"\nimport { SphereGrid } from \"./sphere-grid\"\n\n// Typed by name, so the declaration names each component rather than spelling out its type through core.\ntype KitNode =\n | typeof RectangularGrid\n | typeof RadialGrid\n | typeof PathGrid\n | typeof SphereGrid\n\nexport const NODES: KitNode[] = [\n RectangularGrid,\n RadialGrid,\n PathGrid,\n SphereGrid,\n]\n"],
5
+ "mappings": "+WAAA,OACE,eAAAA,EACA,aAAAC,EACA,SAAAC,MAMK,oBAaP,IAAMC,EAAM,CACV,QAASC,EAAM,OAAO,EAAG,CAAE,IAAK,EAAG,KAAM,CAAC,CAAE,EAC5C,cAAeA,EAAM,MAAMC,EAAiB,CAAE,QAAS,KAAK,CAAE,EAC9D,SAAUD,EAAM,MAAME,EAAY,CAAE,QAAS,KAAK,CAAE,EACpD,UAAWF,EAAM,OAAO,IAAK,CAAE,I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Mb,EAAE,GAAG,EAC3C,MAAOA,EAAE,MAAQe,EAAYF,EAAO,MAAQb,EAAE,KAAK,EACnD,KAAM,EACP,CACH,GAEF,SAAU,CACR,KAAM,CAAE,OAAQI,EAAS,OAAO,IAAK,CAAE,IAAK,CAAC,CAAE,CAAC,EAChD,IAAK,CAACG,EAAUP,IAAMO,EAAS,MAAM,CAAE,OAAQA,EAAS,KAAK,QAAUP,EAAE,MAAM,CAAE,GAGnF,cAAe,CACb,KAAM,CAAE,YAAaI,EAAS,OAAO,IAAK,CAAE,IAAK,GAAG,CAAE,CAAC,EACvD,IAAK,CAACG,EAAUP,IAAMO,EAAS,MAAM,CAAE,YAAaA,EAAS,KAAK,aAAeP,EAAE,WAAW,CAAE,IAGpG,GAAGI,EAAS,OAAOH,CAAQ,EAC5B,EAAGA,CAAQ,EChHL,IAAMe,GAAmB,CAC9BC,EACAC,EACAC,EACAC",
6
6
  "names": ["component2d", "easeInOut", "Types", "own", "Types", "FILL_DIRECTIONS", "CELL_MODES", "LINE_ALIGNS", "arrangement", "s", "arranger", "count", "space", "rectangularCell", "lineFocus", "item_grid_exports", "RectangularGrid", "component2d", "staggerArgs", "TRANSITION_STAGGER", "timeline", "children", "columns", "data", "easeInOut", "sizes", "child", "box", "from", "width", "height", "t", "slots", "row", "inRow", "column", "inColumn", "component2d", "Types", "own", "Types", "RADIAL_DIRECTIONS", "arrangement", "s", "arranger", "RadialGrid", "item_grid_exports", "component2d", "timeline", "children", "count", "slot", "normalizeOrder", "turn", "radialTurnToTop", "component2d", "pathOps", "Types", "PATH_GRID_SHAPES", "PATH_TEMPLATES", "own", "Types", "item_grid_exports", "PATH_SPACINGS", "AT_ORIGIN", "DEFAULT_SIZE", "arranger", "s", "box", "path", "placement", "pathIn", "PathGrid", "component2d", "timeline", "staggerArgs", "TRANSITION_STAGGER", "children", "pathNode", "changes", "linked", "unitPath", "data", "dataOf", "bounds", "pathOps", "template", "templatePath", "view", "unitPaths", "width", "height", "cached", "p", "component2d", "Types", "own", "Types", "SPHERE_FACINGS", "arrangement", "s", "arranger", "AXIS_PROP", "SphereGrid", "item_grid_exports", "component2d", "SPHERE_AXES", "timeline", "key", "children", "count", "slot", "normalizeOrder", "facing", "sphereFaceForward", "wrapDegrees", "NODES", "RectangularGrid", "RadialGrid", "PathGrid", "SphereGrid"]
7
7
  }
@@ -1,2 +1,2 @@
1
- import{A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z}from"./chunks/chunk-TYNFMZ3D.js";export{m as CELL_MODES,l as FILL_DIRECTIONS,N as ITEM_GRID_TYPES,R as ItemGrid,n as LINE_ALIGNS,e as PATH_SPACINGS,x as PATH_TEMPLATES,g as RADIAL_DIRECTIONS,H as REVEAL_STYLES,s as SPHERE_AXES,r as SPHERE_FACINGS,E as STAGGER_ORDERS,O as TRANSITION_STAGGER,I as WAVE_STYLES,J as applyItemEffects,b as blendSlot,Q as contentBoxOf,t as fibonacciPoint,S as findNode2D,A as focalLengthOf,T as frameIn,D as hashSeed,d as largest,K as normalizeOrder,u as orient,M as parseOrder,f as pathSlots,h as radialAngles,i as radialSlots,j as radialTurnToTop,p as rectangularCell,o as rectangularShape,q as rectangularSlots,B as seededRandom,C as shuffled,a as slot,L as slotOfItem,z as slotsOf,w as sphereFaceForward,v as sphereSlots,c as spreadSlot,P as staggerArgs,G as staggerProgress,F as staggerRanks,y as templatePath,k as wrapDegrees};
1
+ import{A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z}from"./chunks/chunk-7SRKSZ7X.js";export{m as CELL_MODES,l as FILL_DIRECTIONS,M as ITEM_GRID_TYPES,Q as ItemGrid,n as LINE_ALIGNS,e as PATH_SPACINGS,x as PATH_TEMPLATES,g as RADIAL_DIRECTIONS,G as REVEAL_STYLES,s as SPHERE_AXES,r as SPHERE_FACINGS,D as STAGGER_ORDERS,N as TRANSITION_STAGGER,H as WAVE_STYLES,I as applyItemEffects,b as blendSlot,P as contentBoxOf,t as fibonacciPoint,A as focalLengthOf,C as hashSeed,d as largest,J as normalizeOrder,u as orient,L as parseOrder,f as pathSlots,h as radialAngles,i as radialSlots,j as radialTurnToTop,p as rectangularCell,o as rectangularShape,q as rectangularSlots,B as shuffled,a as slot,K as slotOfItem,z as slotsOf,w as sphereFaceForward,v as sphereSlots,c as spreadSlot,O as staggerArgs,F as staggerProgress,E as staggerRanks,y as templatePath,k as wrapDegrees};
2
2
  //# sourceMappingURL=kit.js.map
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@motionscript/grids",
3
- "version": "0.1.0-alpha.8",
3
+ "version": "0.1.0",
4
4
  "exports": {
5
5
  ".": "dist/browser/index.js",
6
6
  "./kit": "dist/browser/kit.js"
package/dist/engine.d.ts CHANGED
@@ -1,13 +1,2 @@
1
- /**
2
- * The item grid **kit**: what the four grids share, and what a copied one does
3
- * not copy.
4
- *
5
- * A copy takes a grid's own files into your project and rewrites its reach for
6
- * these to `@motionscript/grids`, so the shared parts stay a real
7
- * dependency. That is not a size decision. `ItemGrid` keeps the register of
8
- * grids a morph looks another grid's arrangement up in, so a second copy of it
9
- * would be a second register, and a morph from one grid to another would only
10
- * find the grids its own copy was told of.
11
- */
12
1
  export * from "./kit/index.js";
13
2
  //# sourceMappingURL=engine.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"engine.d.ts","sourceRoot":"","sources":["../src/engine.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,cAAc,OAAO,CAAA"}
1
+ {"version":3,"file":"engine.d.ts","sourceRoot":"","sources":["../src/engine.ts"],"names":[],"mappings":"AAGA,cAAc,OAAO,CAAA"}