@motionscript/patterns 0.1.1-alpha.5 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,33 @@
1
1
  # @motionscript/patterns
2
2
 
3
+ ## 0.3.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 39cb568: **Breaking:** each kit's root export is now its public surface, named one by one, and everything else moves to `./kit`, which every kit now has and which any release may change.
8
+
9
+ - **The roots** carry the components and `NODES`, plus only what a host's setup or an author's code needs: audio's `AudioEnvelope` and `EMPTY_ENVELOPE`; charts' `CHART_STYLE_PRESETS` and `ChartStylePreset`; code's `defineCode`, `CodeStrategies`, `lines`, `word`, `CodeRanges`, `CodeRange`, `registerCodeTheme`, `initSyntaxHighlighter` and the theme types; geography's `geoRegistry`, `geoUrlSource`, `geoLoaderSource`, `GeoSource`, `GeoDefinition` and `GeoShape`; math's `loadMathJax`. A root name now leaves only after a deprecation, in the next major (the next minor while on 0.x).
10
+ - **`./kit`** (`src/unstable.ts`) is all of each package: every name the root exported before, the shared helpers a copied component imports, and each component's parts. `code/kit` and `geography/kit` are new; the others now hold the component modules as well as the shared helpers.
11
+ - **Copied components** (`registry.json`) import the kit from `<package>/kit` instead of the package root.
12
+
13
+ Migration: no stored document is affected; node keys, props and values are unchanged. Code that imported a helper, a part or a type from a kit's root imports it from `<package>/kit` instead (for example `resolveXScale` from `@motionscript/charts/kit`, `canHighlight` from `@motionscript/code/kit`). A copied component made before this release that imports helpers from the package root changes that specifier to `<package>/kit`.
14
+
15
+ ## 0.2.0
16
+
17
+ ### Patch Changes
18
+
19
+ - e279864: **Breaking:** the component kits drop exports nothing used.
20
+
21
+ - **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`.
22
+ - **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`.
23
+ - **audio:** `FullWaveformProps`, `LiveWaveformProps`, and `clamp01` from `./kit`.
24
+ - **patterns:** `DotGridPatternProps`, `GridPatternProps`, `LineGridPatternProps`.
25
+ - **code:** `DEFAULT_THEMES`, `splitTokensAt`, `LINE_ALIGN_CELLS`, `EDIT_ALIGN_CELLS`, and `phasesFor` (use `defaultCodePhases`). `ensureHighlighter`, `loadCodeLanguage`, `initSyntaxHighlighter` and `canHighlight` lose their ignored theme argument.
26
+ - **grids:** the `findNode2D` and `frameIn` re-exports (import them from `@motionscript/sdk`), `ArrangementKind`, `PathGridShape`, `RectangularGridProps`, `RadialGridProps`, `PathGridProps`, `SphereGridProps`.
27
+ - **geography:** `GeoBorderProps`.
28
+
29
+ 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.
30
+
3
31
  ## 0.1.1-alpha.5
4
32
 
5
33
  ## 0.1.1-alpha.4
package/README.md CHANGED
@@ -69,6 +69,11 @@ later change to `stroke` leaves it as it was.
69
69
  npm install @motionscript/patterns @motionscript/sdk
70
70
  ```
71
71
 
72
+ | Entry | What |
73
+ | --- | --- |
74
+ | `@motionscript/patterns` | The public surface: the three patterns and `NODES`. A name leaves it only after a deprecation, in the next major (the next minor while on 0.x). |
75
+ | `@motionscript/patterns/kit` | Everything (`src/unstable.ts`): `ViewportPattern`, the tiling helpers (`src/engine.ts`) and the pattern modules. **Unstable**: any release may change it. |
76
+
72
77
  A copy of `line-grid-pattern`, `dot-grid-pattern` or `grid-pattern`
73
78
  (`registry.json`) keeps importing `ViewportPattern` and the tiling
74
79
  helpers from `@motionscript/patterns/kit`.
@@ -0,0 +1,2 @@
1
+ var R=Object.defineProperty;var U=(o,t)=>{for(var e in t)R(o,e,{get:t[e],enumerable:!0})};import{strokeOps as C}from"@motionscript/sdk";function T(o,t,e,n,r=0){let c=[],i=[],s=[],f=[],a=S(t.min-n,t.step,t.offset,r,Math.floor),h=S(t.max+n,t.step,t.offset,r,Math.ceil),m=S(o.min-n,o.step,o.offset,r,Math.floor),l=S(o.max+n,o.step,o.offset,r,Math.ceil);return z(o.min,o.max,o.step,o.offset,e,n,(p,u)=>{(u?c:i).push(p)},o.anchor),z(t.min,t.max,t.step,t.offset,e,n,(p,u)=>{(u?s:f).push(p)},t.anchor),{top:a,bottom:h,left:m,right:l,verticalMajor:c,verticalMinor:i,horizontalMajor:s,horizontalMinor:f}}function P(o,t,e,n){let r=T(o,t,e,n),c=[],i=[];for(let s of r.verticalMajor)c.push({type:"M",x:s,y:r.top},{type:"L",x:s,y:r.bottom});for(let s of r.verticalMinor)i.push({type:"M",x:s,y:r.top},{type:"L",x:s,y:r.bottom});for(let s of r.horizontalMajor)c.push({type:"M",x:r.left,y:s},{type:"L",x:r.right,y:s});for(let s of r.horizontalMinor)i.push({type:"M",x:r.left,y:s},{type:"L",x:r.right,y:s});return{major:c,minor:i}}function S(o,t,e,n,r){return n>0?r(o/n)*n:t<=0?o:r((o-e)/t)*t+e}function z(o,t,e,n,r,c,i,s=0){if(e<=0)return;let f=e*1e-6,a=Math.ceil((o-c-n-s-f)/e),h=Math.floor((t+c-n-s+f)/e);for(let m=a;m<=h;m++){let l=s+m*e+n,p=(m%r+r)%r===0;i(l,p)}}function M(o){let t=0;for(let e of o)e.weight>t&&(t=e.weight);return t}function g(o){return o.map(t=>t.align===0?t:{...t,align:0})}function q(o,t){return C.resolve(o.map(e=>({...e,fill:e.fill.map(n=>({...n,opacity:(n.opacity??1)*t}))})))}var X=new WeakMap;function v(o){let t=X.get(o);if(!t){let e=Y(o.stroke),n=Y(o.subdivisions)??1;t=e!==void 0&&n>1?q(C.resolve(e),.5):[],X.set(o,t)}return t}function Y(o){return typeof o=="function"?o():o}var d={};U(d,{commands:()=>$,draw:()=>et,layout:()=>ot,measure:()=>tt,state:()=>Z,visibleBounds:()=>N});import{Camera as J,Flow as W,Graphics2D as Q,Paint as j}from"@motionscript/sdk";var Z={...j.state,...W.state},$={...j.commands};function tt(o,t,e){return W.measure(o,t,e,j.inset(t))}function ot(o,t,e){return W.layout(o,t,e,j.inset(t))}function N(o){let t=o.ancestor(J);if(!t)return{x:0,y:0,width:o.size.width,height:o.size.height};let{width:e,height:n}=t.size,r=t.state.zoom||1,c=t.state.heading,i=e/2/r,s=n/2/r,f=i,a=s;if(c!==0){let m=c*Math.PI/180,l=Math.abs(Math.cos(m)),p=Math.abs(Math.sin(m));f=i*l+s*p,a=i*p+s*l}let h=t.state.lookAt;return{x:h.x,y:h.y,width:f*2,height:a*2}}function et(o,t){let e=N(o),n=new Q().rect({x:e.x,y:e.y,width:e.width,height:e.height});o.inFront(()=>o.clip(n,()=>t(e))),o.children()}import{Flow as D,Graphics2D as L,Paint as b,Types as _,component2d as nt,lerpVector2 as rt}from"@motionscript/sdk";var zt=nt({key:"lineGridPattern",state:{...b.state,...D.state,divisions:4,subdivisions:1,subStroke:_.stroke,offset:_.custom({x:0,y:0},{lerp:rt})},defaults:{subStroke:(o,t)=>v(t)},commands:{...b.commands},measure:(o,t,e)=>D.measure(o,t,e,b.inset(t)),layout:(o,t,e)=>D.layout(o,t,e,b.inset(t)),render:(o,t)=>{let{width:e,height:n}=o.size,r=new L().rect({width:e,height:n});o.inFront(()=>{o.draw(new L().rect({width:e,height:n,start:t.start,end:t.end}).shadow(t.shadow).fill(t.fill));let c=Math.max(1,Math.floor(t.divisions)),i=Math.max(1,Math.floor(t.subdivisions)),s=g(t.stroke),f=g(t.subStroke),a=Math.max(M(s),M(f))/2,h=st(e,n,c,i,a,t.offset),m=[-e/2,-n/2,e/2,n/2];o.clip(r,()=>{i>1&&f.length>0&&h.minor.length>0&&o.draw(new L().path({data:h.minor,centerBounds:m}).stroke(f)),h.major.length>0&&o.draw(new L().path({data:h.major,centerBounds:m}).stroke(s))})}),b.draw(o,t,null,{clipShape:r})}});function st(o,t,e,n,r,c){let i=e*n,s=Math.max(0,o-2*r),f=Math.max(0,t-2*r),a=o/2-r,h=t/2-r;return P({min:-a,max:a,step:s/i,offset:c.x,anchor:-a},{min:-h,max:h,step:f/i,offset:c.y,anchor:-h},n,r)}import{Flow as F,Graphics2D as H,Paint as k,Types as it,component2d as at,lerpVector2 as ct}from"@motionscript/sdk";function A(o,t,e,n,r,c){let i=[];return z(o,t,e,n,r,c,(s,f)=>{i.push({pos:s,isMajor:f})},o),i}var ht={...k.state,...F.state,divisions:4,subdivisions:1,radius:3,subScale:.5,offset:it.custom({x:0,y:0},{lerp:ct})},Lt=at({key:"dotGridPattern",state:ht,commands:{...k.commands},measure:(o,t,e)=>F.measure(o,t,e,k.inset(t)),layout:(o,t,e)=>F.layout(o,t,e,k.inset(t)),render:(o,t)=>{let e={fill:t.fill,stroke:t.stroke,shadow:t.shadow,overlay:t.overlay,start:0,end:1,clip:t.clip},n=new H().rect({width:o.size.width,height:o.size.height});k.draw(o,e,ft(o.size,t),{clipShape:n})}});function ft(o,t){let{width:e,height:n}=o;if(e<=0||n<=0)return null;let r=Math.max(1,Math.floor(t.divisions)),c=Math.max(1,Math.floor(t.subdivisions)),i=Math.max(0,t.radius),s=i*Math.max(0,t.subScale);if(i<=0&&s<=0)return null;let f=r*c,a=Math.max(0,e/2-i),h=Math.max(0,n/2-i),m=A(-a,a,a*2/f,t.offset.x,c,i),l=A(-h,h,h*2/f,t.offset.y,c,i),p=new H,u=!1;for(let y of m)for(let w of l){let x=y.isMajor&&w.isMajor?i:s;x<=0||(p.ellipse({x:y.pos,y:w.pos,width:x*2,height:x*2}),u=!0)}return u?p:null}import{Graphics2D as G,Types as O,component2d as lt,lerpNumber as mt,lerpVector2 as K}from"@motionscript/sdk";var Dt=lt({key:"gridPattern",state:{...d.state,cellSize:O.custom(100,{lerp:dt}),subdivisions:1,subStroke:O.stroke,offset:O.custom({x:0,y:0},{lerp:K})},defaults:{subStroke:(o,t)=>v(t)},commands:{...d.commands},measure:d.measure,layout:d.layout,render:(o,t)=>d.draw(o,e=>pt(o,t,e))});function pt(o,t,e){let n=e.width/2,r=e.height/2,c=e.x-n,i=e.x+n,s=e.y-r,f=e.y+r;o.draw(new G().rect({x:e.x,y:e.y,width:e.width,height:e.height,start:t.start,end:t.end}).shadow(t.shadow).fill(t.fill));let a=Math.max(1,Math.floor(t.subdivisions)),h=t.cellSize,m=Math.max(.001,typeof h=="number"?h:h.x),l=Math.max(.001,typeof h=="number"?h:h.y),p=m/a,u=l/a,y=g(t.stroke),w=g(t.subStroke),x=Math.max(M(y),M(w))/2,V={min:c,max:i,step:p,offset:t.offset.x},B={min:s,max:f,step:u,offset:t.offset.y};a>1&&w.length>0&&E(o,V,B,a,x,w,!1),y.length>0&&E(o,V,B,a,x,y,!0)}function E(o,t,e,n,r,c,i){let s=[-1,-1,1,1],f=ut(c);if(f<=0){let l=P(t,e,n,r)[i?"major":"minor"];l.length>0&&o.draw(new G().path({data:l,centerBounds:s}).stroke(c));return}let a=T(t,e,n,r,f),h=i?a.verticalMajor:a.verticalMinor,m=i?a.horizontalMajor:a.horizontalMinor;for(let l of h){let p=[{type:"M",x:l,y:a.top},{type:"L",x:l,y:a.bottom}];o.draw(new G().path({data:p,centerBounds:s}).stroke(I(c,a.top)))}for(let l of m){let p=[{type:"M",x:a.left,y:l},{type:"L",x:a.right,y:l}];o.draw(new G().path({data:p,centerBounds:s}).stroke(I(c,a.left)))}}function ut(o){let t=0;for(let e of o)if(e.dash&&e.dash.length>0){let n=e.dash.reduce((r,c)=>r+c,0);n>t&&(t=n)}return t}function I(o,t){return o.map(e=>e.dash&&e.dash.length>0?{...e,dashOffset:(e.dashOffset??0)-t}:e)}function dt(o,t,e){return typeof o=="number"&&typeof t=="number"?mt(o,t,e):K(typeof o=="number"?{x:o,y:o}:o,typeof t=="number"?{x:t,y:t}:t,e)}export{T as a,P as b,z as c,M as d,g as e,q as f,v as g,d as h,zt as i,Lt as j,Dt as k};
2
+ //# sourceMappingURL=chunk-H7QJB37I.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/kit/grid-lines.ts", "../../../src/kit/viewport-pattern.ts", "../../../src/line-grid-pattern/line-grid-pattern.ts", "../../../src/dot-grid-pattern/dot-grid-pattern.ts", "../../../src/grid-pattern/grid-pattern.ts"],
4
+ "sourcesContent": ["import { strokeOps, type PathCommand, type Stroke, type StrokeProp, type StrokeResolved } from \"@motionscript/sdk\";\n\n/** A grid extent on one axis: lines tile within `[min, max]`, on a lattice that starts at `anchor`. */\nexport interface GridAxis {\n min: number;\n max: number;\n /** Spacing between adjacent (minor) lines. */\n step: number;\n /** Pan offset in pixels. */\n offset: number;\n /**\n * Where the lattice starts: a line sits at `anchor + n * step`, and the tile\n * index `n` that decides which lines are major counts from there. Omitted it is\n * 0, the world origin, which a camera-following grid keeps. A grid with a box of\n * its own sets it to `min`, so the box's edges are lines whatever the cell count.\n */\n anchor?: number;\n}\n\n/** Where each line sits, split into major (division) and minor (subdivision) lines. Vertical lines run `top` to `bottom`, horizontal ones `left` to `right`. */\ninterface GridLines {\n top: number;\n bottom: number;\n left: number;\n right: number;\n verticalMajor: number[];\n verticalMinor: number[];\n horizontalMajor: number[];\n horizontalMinor: number[];\n}\n\n/**\n * The cross-axis spans and the major/minor line positions per axis. Spans are\n * grown by `overscan` so a thick line slides out under the clip instead of\n * popping, and snapped outward so a line's start stays fixed as the camera pans\n * (a dashed stroke anchored to it would otherwise crawl). `cycle`, the dash\n * period, snaps the span to whole dash cycles too, so every parallel line is the\n * same length and the renderer's per-path dash-fit is a no-op.\n */\nexport function gridLines(\n x: GridAxis,\n y: GridAxis,\n subdivisions: number,\n overscan: number,\n cycle = 0,\n): GridLines {\n const verticalMajor: number[] = [];\n const verticalMinor: number[] = [];\n const horizontalMajor: number[] = [];\n const horizontalMinor: number[] = [];\n\n const top = snapSpan(y.min - overscan, y.step, y.offset, cycle, Math.floor);\n const bottom = snapSpan(y.max + overscan, y.step, y.offset, cycle, Math.ceil);\n const left = snapSpan(x.min - overscan, x.step, x.offset, cycle, Math.floor);\n const right = snapSpan(x.max + overscan, x.step, x.offset, cycle, Math.ceil);\n\n addTiledLines(x.min, x.max, x.step, x.offset, subdivisions, overscan, (px, isMajor) => {\n (isMajor ? verticalMajor : verticalMinor).push(px);\n }, x.anchor);\n addTiledLines(y.min, y.max, y.step, y.offset, subdivisions, overscan, (py, isMajor) => {\n (isMajor ? horizontalMajor : horizontalMinor).push(py);\n }, y.anchor);\n\n return { top, bottom, left, right, verticalMajor, verticalMinor, horizontalMajor, horizontalMinor };\n}\n\n/**\n * The lines as one multi-subpath path per group (major, minor), so each stroke\n * paints as a union with no destructive boolean op, which would erase open lines.\n * For solid strokes; dashed strokes that must stay world-locked draw per line from\n * {@link gridLines}.\n */\nexport function gridLinePaths(\n x: GridAxis,\n y: GridAxis,\n subdivisions: number,\n overscan: number,\n): { major: PathCommand[]; minor: PathCommand[] } {\n const g = gridLines(x, y, subdivisions, overscan);\n const major: PathCommand[] = [];\n const minor: PathCommand[] = [];\n for (const px of g.verticalMajor) major.push({ type: \"M\", x: px, y: g.top }, { type: \"L\", x: px, y: g.bottom });\n for (const px of g.verticalMinor) minor.push({ type: \"M\", x: px, y: g.top }, { type: \"L\", x: px, y: g.bottom });\n for (const py of g.horizontalMajor) major.push({ type: \"M\", x: g.left, y: py }, { type: \"L\", x: g.right, y: py });\n for (const py of g.horizontalMinor) minor.push({ type: \"M\", x: g.left, y: py }, { type: \"L\", x: g.right, y: py });\n return { major, minor };\n}\n\n// Snaps `pos` outward to a stable world position, since the renderer anchors dash\n// phase to the subpath start. It snaps to the line lattice (`n*step + offset`), or\n// to the dash lattice (`n*cycle`, anchored to world 0) when a `cycle` is given.\n// The lattice is the one about 0 whatever an axis's `anchor`: a span only has to\n// reach past the edge.\nfunction snapSpan(pos: number, step: number, offset: number, cycle: number, round: (n: number) => number): number {\n if (cycle > 0) return round(pos / cycle) * cycle;\n if (step <= 0) return pos;\n return round((pos - offset) / step) * step + offset;\n}\n\n/**\n * Emits every line position in `[min, max]` (grown by `overscan`) for spacing\n * `step`, panned by `offset`. The line at tile index `n`, counted from `anchor`,\n * is major when `n` is a multiple of `subdivisions`; `n` is relative to the\n * un-panned lattice, so classification stays stable as the grid scrolls.\n */\nexport function addTiledLines(\n min: number,\n max: number,\n step: number,\n offset: number,\n subdivisions: number,\n overscan: number,\n emit: (pos: number, isMajor: boolean) => void,\n anchor = 0,\n): void {\n if (step <= 0) return;\n // First/last tile index whose panned position is within the overscanned\n // [min, max]. A small epsilon keeps a line that lands exactly on an edge (an\n // anchor at `min`, or a world lattice that reaches it) from being dropped by FP error.\n const eps = step * 1e-6;\n const startN = Math.ceil((min - overscan - offset - anchor - eps) / step);\n const endN = Math.floor((max + overscan - offset - anchor + eps) / step);\n for (let n = startN; n <= endN; n++) {\n const pos = anchor + n * step + offset;\n const isMajor = ((n % subdivisions) + subdivisions) % subdivisions === 0;\n emit(pos, isMajor);\n }\n}\n\n/** Largest layer weight, to overscan the tiling so a thick line stays drawn until fully off the area. */\nexport function maxWeight(strokes: StrokeResolved[]): number {\n let max = 0;\n for (const s of strokes) if (s.weight > max) max = s.weight;\n return max;\n}\n\n/** Every layer centred: grid lines are open paths, so inside/outside alignment means nothing. Makes explicit what the renderer does and ignores any author `align`. */\nexport function centered(strokes: StrokeResolved[]): StrokeResolved[] {\n return strokes.map(s => (s.align === 0 ? s : { ...s, align: 0 }));\n}\n\n/** The default minor-line stroke is the major one with every fill's opacity scaled by `factor`. */\nexport function dimStroke(strokes: StrokeResolved[], factor: number): StrokeResolved[] {\n return strokeOps.resolve(strokes.map(s => ({\n ...s,\n fill: s.fill.map(f => ({ ...f, opacity: (f.opacity ?? 1) * factor })),\n })) as unknown as StrokeProp[]);\n}\n\nconst SUB_STROKES = new WeakMap<object, StrokeResolved[]>();\n\n/**\n * The minor-line stroke of a pattern built with a `stroke` and no `subStroke`:\n * the major one at half opacity, when it was built with minor lines. Read off\n * what the pattern was built with (`given`), so it is not kept in step with a\n * stroke written later.\n */\nexport function defaultSubStroke(given: Readonly<Record<string, unknown>>): StrokeResolved[] {\n let sub = SUB_STROKES.get(given);\n if (!sub) {\n const stroke = valueOf(given.stroke) as Stroke | undefined;\n const subdivisions = (valueOf(given.subdivisions) as number | undefined) ?? 1;\n sub = stroke !== undefined && subdivisions > 1 ? dimStroke(strokeOps.resolve(stroke), 0.5) : [];\n SUB_STROKES.set(given, sub);\n }\n return sub;\n}\n\n/** A prop as given, a binding read once. */\nfunction valueOf(prop: unknown): unknown {\n return typeof prop === \"function\" ? (prop as () => unknown)() : prop;\n}\n", "import {\n Camera,\n Flow,\n Graphics2D,\n Paint,\n type BoxBounds,\n type ChildView,\n type Measurer,\n type Placement2D,\n type RenderContext,\n type Size2D,\n type Values,\n // Named so the emitted declaration reaches these through the sdk, not core.\n type Alignment as _Alignment,\n type Fill as _Fill,\n type FillResolved as _FillResolved,\n type FlowMode as _FlowMode,\n type FlowResolved as _FlowResolved,\n type GapSize as _GapSize,\n type Shadow as _Shadow,\n type ShadowResolved as _ShadowResolved,\n type Stroke as _Stroke,\n type StrokeResolved as _StrokeResolved,\n type Vector2 as _Vector2,\n} from \"@motionscript/sdk\";\n\n/**\n * What a pattern filling the camera's visible region shares: spread `state` and\n * `commands` in, pass `measure` and `layout`, and draw with {@link draw}. Inside a\n * `Camera` the pattern is handed the world region it can see, so it only generates\n * geometry for what is on screen; with none it fills its own box. It is laid out at\n * the camera's centre, so its draw space shares the world origin its siblings use.\n * A pattern is a shape: paints, and children laid out like a rect's.\n */\nexport const state = { ...Paint.state, ...Flow.state };\n\nexport const commands = { ...Paint.commands };\n\ntype ShapeState = Flow.FlowState & Values<typeof Paint.state>;\n\nexport function measure(measurer: Measurer, s: ShapeState, children: readonly ChildView[]): Size2D {\n return Flow.measure(measurer, s, children, Paint.inset(s));\n}\n\nexport function layout(box: BoxBounds, s: ShapeState, children: readonly ChildView[]): readonly Placement2D[] {\n return Flow.layout(box, s, children, Paint.inset(s));\n}\n\n/** The world rect the nearest `Camera` sees, in the pattern's draw space, else its own box. */\nexport function visibleBounds(ctx: RenderContext): BoxBounds {\n const camera = ctx.ancestor(Camera);\n if (!camera) return { x: 0, y: 0, width: ctx.size.width, height: ctx.size.height };\n\n const { width: vw, height: vh } = camera.size;\n const zoom = camera.state.zoom || 1;\n const heading = camera.state.heading;\n\n const hw = vw / 2 / zoom;\n const hh = vh / 2 / zoom;\n\n // With a heading the visible rect is rotated; its axis-aligned bounding box covers the full extent.\n let bw = hw;\n let bh = hh;\n if (heading !== 0) {\n const rad = (heading * Math.PI) / 180;\n const cos = Math.abs(Math.cos(rad));\n const sin = Math.abs(Math.sin(rad));\n bw = hw * cos + hh * sin;\n bh = hw * sin + hh * cos;\n }\n\n // Centred on the camera's `lookAt`, in y-up world space.\n const lookAt = camera.state.lookAt;\n return { x: lookAt.x, y: lookAt.y, width: bw * 2, height: bh * 2 };\n}\n\n/**\n * Paints `pattern` over the visible region, then the children. Clipped to the\n * region so overscanned geometry trims cleanly even with no camera. A path drawn\n * here takes `centerBounds` of `[bounds.x - w/2, bounds.y - h/2, bounds.x + w/2, bounds.y + h/2]`.\n */\nexport function draw(ctx: RenderContext, pattern: (bounds: BoxBounds) => void): void {\n const bounds = visibleBounds(ctx);\n const region = new Graphics2D().rect({ x: bounds.x, y: bounds.y, width: bounds.width, height: bounds.height });\n ctx.inFront(() => ctx.clip(region, () => pattern(bounds)));\n ctx.children();\n}\n", "import {\n Flow,\n Graphics2D,\n Paint,\n Types,\n component2d,\n lerpVector2,\n type NodeOf,\n type PathBounds,\n type PathCommand,\n type Vector2,\n // Named so the emitted declaration reaches these through the sdk, not core.\n type Alignment as _Alignment,\n type Fill as _Fill,\n type FillResolved as _FillResolved,\n type FlowMode as _FlowMode,\n type FlowResolved as _FlowResolved,\n type GapSize as _GapSize,\n type Node2D as _Node2D,\n type Node2DProps as _Node2DProps,\n type Shadow as _Shadow,\n type ShadowResolved as _ShadowResolved,\n type Stroke as _Stroke,\n type StrokeResolved as _StrokeResolved,\n} from \"@motionscript/sdk\";\n\nimport { centered, defaultSubStroke, gridLinePaths, maxWeight } from \"../kit\";\n\n/**\n * A rectangular grid of lines filling the node's layout rect.\n *\n * `stroke` paints the major lines and `subStroke` the minor ones, each as a\n * single union path. `fill` and `shadow` cover the whole rect, behind the lines.\n */\nexport const LineGridPattern = component2d({\n key: \"lineGridPattern\",\n state: {\n ...Paint.state,\n ...Flow.state,\n /** Cells along each axis: `divisions` of 4 draws 5 major lines per axis. */\n divisions: 4,\n /** Finer cells each division is split into. 1 draws no minor lines; 2 adds one per division. */\n subdivisions: 1,\n /** Stroke for the minor lines. Unset, the major `stroke` at half opacity when `subdivisions > 1`. */\n subStroke: Types.stroke,\n /** Pans the grid. Lines wrap and tile, so the rect stays full while `offset` scrolls it. */\n offset: Types.custom<Vector2>({ x: 0, y: 0 }, { lerp: lerpVector2 }),\n },\n defaults: { subStroke: (_state, given) => defaultSubStroke(given) },\n commands: { ...Paint.commands },\n measure: (measurer, state, children) => Flow.measure(measurer, state, children, Paint.inset(state)),\n layout: (box, state, children) => Flow.layout(box, state, children, Paint.inset(state)),\n render: (ctx, state) => {\n const { width, height } = ctx.size;\n const box = new Graphics2D().rect({ width, height });\n ctx.inFront(() => {\n ctx.draw(new Graphics2D()\n .rect({ width, height, start: state.start, end: state.end })\n .shadow(state.shadow)\n .fill(state.fill));\n\n const divisions = Math.max(1, Math.floor(state.divisions));\n const subdivisions = Math.max(1, Math.floor(state.subdivisions));\n\n // Lines overscan the rect by half the thickest stroke and are clipped to it, so a\n // thick line slides out under the clip instead of popping at the boundary.\n const major = centered(state.stroke);\n const minorStroke = centered(state.subStroke);\n const overscan = Math.max(maxWeight(major), maxWeight(minorStroke)) / 2;\n const lines = gridPaths(width, height, divisions, subdivisions, overscan, state.offset);\n const centerBounds: PathBounds = [-width / 2, -height / 2, width / 2, height / 2];\n\n ctx.clip(box, () => {\n // Minor lines first so the major lines sit on top.\n if (subdivisions > 1 && minorStroke.length > 0 && lines.minor.length > 0) {\n ctx.draw(new Graphics2D().path({ data: lines.minor, centerBounds }).stroke(minorStroke));\n }\n if (lines.major.length > 0) {\n ctx.draw(new Graphics2D().path({ data: lines.major, centerBounds }).stroke(major));\n }\n });\n });\n // The rect is what `clip` confines the children to and what picking tests; it paints nothing more.\n Paint.draw(ctx, state, null, { clipShape: box });\n },\n});\n\nexport type LineGridPattern = NodeOf<typeof LineGridPattern>;\n\nfunction gridPaths(\n width: number,\n height: number,\n divisions: number,\n subdivisions: number,\n overscan: number,\n offset: Vector2,\n): { major: PathCommand[]; minor: PathCommand[] } {\n // Inset by `overscan` so the outermost lines sit fully inside the rect and are not\n // trimmed to half weight by the clip.\n const cols = divisions * subdivisions;\n const innerW = Math.max(0, width - 2 * overscan);\n const innerH = Math.max(0, height - 2 * overscan);\n const insetX = width / 2 - overscan;\n const insetY = height / 2 - overscan;\n\n // Anchored at the near edge, so a line sits on each edge of the box for any count of cells.\n return gridLinePaths(\n { min: -insetX, max: insetX, step: innerW / cols, offset: offset.x, anchor: -insetX },\n { min: -insetY, max: insetY, step: innerH / cols, offset: offset.y, anchor: -insetY },\n subdivisions,\n overscan,\n );\n}\n", "import {\n Flow,\n Graphics2D,\n Paint,\n Types,\n component2d,\n lerpVector2,\n type NodeOf,\n type Size2D,\n type Vector2,\n // Named so the emitted declaration reaches these through the sdk, not core.\n type Alignment as _Alignment,\n type Fill as _Fill,\n type FillResolved as _FillResolved,\n type FlowMode as _FlowMode,\n type FlowResolved as _FlowResolved,\n type GapSize as _GapSize,\n type Node2D as _Node2D,\n type Node2DProps as _Node2DProps,\n type Shadow as _Shadow,\n type ShadowResolved as _ShadowResolved,\n type Stroke as _Stroke,\n type StrokeResolved as _StrokeResolved,\n} from \"@motionscript/sdk\"\n\nimport { addTiledLines } from \"../kit\"\n\n// The tiling `LineGridPattern` uses, so dots stay on its intersections at every offset.\nfunction gridPositions(\n min: number,\n max: number,\n step: number,\n offset: number,\n subdivisions: number,\n overscan: number\n): { pos: number; isMajor: boolean }[] {\n const out: { pos: number; isMajor: boolean }[] = []\n // Anchored at the near edge, so a column or row sits on each edge of the box for any cell count.\n addTiledLines(min, max, step, offset, subdivisions, overscan, (pos, isMajor) => {\n out.push({ pos, isMajor })\n }, min)\n return out\n}\n\nconst state = {\n ...Paint.state,\n ...Flow.state,\n /** Cells along each axis, as in `LineGridPattern.divisions`: 4 puts 5 major dots on each. */\n divisions: 4,\n /** `1` draws only the major dots; `2` puts one minor dot between each pair. */\n subdivisions: 1,\n /** Radius of a major dot. */\n radius: 3,\n /** A minor dot's radius as a fraction of a major one's, not a second paint stack, so a gradient crosses every dot. */\n subScale: 0.5,\n /** As `LineGridPattern.offset`, so the two stay aligned while both scroll. */\n offset: Types.custom<Vector2>({ x: 0, y: 0 }, { lerp: lerpVector2 }),\n}\n\ninterface DotField {\n readonly divisions: number\n readonly subdivisions: number\n readonly radius: number\n readonly subScale: number\n readonly offset: Vector2\n}\n\n/**\n * A field of dots on the same `divisions` / `subdivisions` / `offset` as\n * `LineGridPattern`, so laid over one the dots sit on its intersections. The\n * dots are the silhouette `Paint.draw` paints; a background is a rectangle behind\n * it. `clip` and picking use the node's box, not the silhouette, so outer dots\n * clip as they pan out and the node stays selectable between dots. `start` and\n * `end` act on nothing: trimming a disc leaves a crescent, not a partial grid.\n */\nexport const DotGridPattern = component2d({\n key: \"dotGridPattern\",\n state,\n commands: { ...Paint.commands },\n measure: (measurer, state, children) => Flow.measure(measurer, state, children, Paint.inset(state)),\n layout: (box, state, children) => Flow.layout(box, state, children, Paint.inset(state)),\n render: (ctx, state) => {\n const untrimmed = {\n fill: state.fill, stroke: state.stroke, shadow: state.shadow, overlay: state.overlay, start: 0, end: 1, clip: state.clip,\n }\n const box = new Graphics2D().rect({ width: ctx.size.width, height: ctx.size.height })\n Paint.draw(ctx, untrimmed, dots(ctx.size, state), { clipShape: box })\n },\n})\n\nexport type DotGridPattern = NodeOf<typeof DotGridPattern>\n\n/** Every dot as one un-painted union: the paint stacks belong to the grid, not a dot. */\nfunction dots(size: Size2D, s: DotField): Graphics2D | null {\n const { width, height } = size\n if (width <= 0 || height <= 0) return null\n\n const divisions = Math.max(1, Math.floor(s.divisions))\n const subdivisions = Math.max(1, Math.floor(s.subdivisions))\n const major = Math.max(0, s.radius)\n const minor = major * Math.max(0, s.subScale)\n if (major <= 0 && minor <= 0) return null\n\n // Inset by a dot's radius so an edge dot sits inside the box rather than being halved by the clip.\n const cols = divisions * subdivisions\n const insetX = Math.max(0, width / 2 - major)\n const insetY = Math.max(0, height / 2 - major)\n const xs = gridPositions(\n -insetX,\n insetX,\n (insetX * 2) / cols,\n s.offset.x,\n subdivisions,\n major\n )\n const ys = gridPositions(\n -insetY,\n insetY,\n (insetY * 2) / cols,\n s.offset.y,\n subdivisions,\n major\n )\n\n const field = new Graphics2D()\n let drew = false\n for (const column of xs) {\n for (const row of ys) {\n // Major only where both axes are: an intersection of two major rules.\n const size = column.isMajor && row.isMajor ? major : minor\n if (size <= 0) continue\n field.ellipse({ x: column.pos, y: row.pos, width: size * 2, height: size * 2 })\n drew = true\n }\n }\n return drew ? field : null\n}\n", "import {\n Graphics2D,\n Types,\n component2d,\n lerpNumber,\n lerpVector2,\n type BoxBounds,\n type NodeOf,\n type PathCommand,\n type RenderContext,\n type ShadowResolved,\n type FillResolved,\n type StrokeResolved,\n type Vector2,\n // Named so the emitted declaration reaches these through the sdk, not core.\n type Alignment as _Alignment,\n type Fill as _Fill,\n type FlowMode as _FlowMode,\n type FlowResolved as _FlowResolved,\n type GapSize as _GapSize,\n type Node2D as _Node2D,\n type Node2DProps as _Node2DProps,\n type Shadow as _Shadow,\n type Stroke as _Stroke,\n} from \"@motionscript/sdk\";\n\nimport { centered, defaultSubStroke, gridLinePaths, gridLines, maxWeight, ViewportPattern, type GridAxis } from \"../kit\";\n\n/**\n * An infinite line grid that fills the camera's visible region: like\n * `LineGridPattern`, but it tiles a world-anchored grid (spacing `cellSize`)\n * across what the nearest `Camera` sees, regenerated each frame. With no camera it\n * fills its own layout rect.\n */\nexport const GridPattern = component2d({\n key: \"gridPattern\",\n state: {\n ...ViewportPattern.state,\n /** Spacing between grid lines in world units: one number for both axes, or `{ x, y }`. */\n cellSize: Types.custom<number | Vector2>(100, { lerp: lerpCellSize }),\n /** Finer cells each cell is split into, as in `LineGridPattern.subdivisions`. */\n subdivisions: 1,\n /** Stroke for the minor lines. Unset, the major `stroke` at half opacity when `subdivisions > 1`. */\n subStroke: Types.stroke,\n /** Scrolls the pattern relative to the world, which it is otherwise anchored to. */\n offset: Types.custom<Vector2>({ x: 0, y: 0 }, { lerp: lerpVector2 }),\n },\n defaults: { subStroke: (_state, given) => defaultSubStroke(given) },\n commands: { ...ViewportPattern.commands },\n measure: ViewportPattern.measure,\n layout: ViewportPattern.layout,\n render: (ctx, state) => ViewportPattern.draw(ctx, (bounds) => drawGrid(ctx, state, bounds)),\n});\n\nexport type GridPattern = NodeOf<typeof GridPattern>;\n\ninterface GridState {\n readonly fill: FillResolved[];\n readonly stroke: StrokeResolved[];\n readonly shadow: ShadowResolved[];\n readonly start: number;\n readonly end: number;\n readonly cellSize: number | Vector2;\n readonly subdivisions: number;\n readonly subStroke: StrokeResolved[];\n readonly offset: Vector2;\n}\n\nfunction drawGrid(ctx: RenderContext, s: GridState, bounds: BoxBounds): void {\n const halfW = bounds.width / 2;\n const halfH = bounds.height / 2;\n // `bounds` is centred on (x, y) in y-up world space.\n const left = bounds.x - halfW;\n const right = bounds.x + halfW;\n const top = bounds.y - halfH;\n const bottom = bounds.y + halfH;\n\n ctx.draw(new Graphics2D()\n .rect({ x: bounds.x, y: bounds.y, width: bounds.width, height: bounds.height, start: s.start, end: s.end })\n .shadow(s.shadow)\n .fill(s.fill));\n\n const subdivisions = Math.max(1, Math.floor(s.subdivisions));\n const cell = s.cellSize;\n const cellX = Math.max(1e-3, typeof cell === \"number\" ? cell : cell.x);\n const cellY = Math.max(1e-3, typeof cell === \"number\" ? cell : cell.y);\n const stepX = cellX / subdivisions;\n const stepY = cellY / subdivisions;\n\n const major = centered(s.stroke);\n const minorStroke = centered(s.subStroke);\n const overscan = Math.max(maxWeight(major), maxWeight(minorStroke)) / 2;\n\n const xAxis: GridAxis = { min: left, max: right, step: stepX, offset: s.offset.x };\n const yAxis: GridAxis = { min: top, max: bottom, step: stepY, offset: s.offset.y };\n\n // Minor lines first so the major lines sit on top.\n if (subdivisions > 1 && minorStroke.length > 0) {\n drawGroup(ctx, xAxis, yAxis, subdivisions, overscan, minorStroke, false);\n }\n if (major.length > 0) {\n drawGroup(ctx, xAxis, yAxis, subdivisions, overscan, major, true);\n }\n}\n\n// A solid stroke paints the group as one union path. A dashed one draws each line on its\n// own, dash phase anchored to its world coordinate, so dashes never crawl as the camera pans.\nfunction drawGroup(\n ctx: RenderContext,\n xAxis: GridAxis,\n yAxis: GridAxis,\n subdivisions: number,\n overscan: number,\n stroke: StrokeResolved[],\n isMajor: boolean,\n): void {\n // Symmetric centerBounds give a zero recentre offset, so local coordinates draw verbatim.\n const centerBounds = [-1, -1, 1, 1] as const;\n\n const cycle = dashCycle(stroke);\n if (cycle <= 0) {\n const data = gridLinePaths(xAxis, yAxis, subdivisions, overscan)[isMajor ? \"major\" : \"minor\"];\n if (data.length > 0) ctx.draw(new Graphics2D().path({ data, centerBounds }).stroke(stroke));\n return;\n }\n\n // Each line spans a whole number of dash cycles, so the renderer's per-path dash-fit\n // is a no-op and every line dashes identically.\n const g = gridLines(xAxis, yAxis, subdivisions, overscan, cycle);\n const verticals = isMajor ? g.verticalMajor : g.verticalMinor;\n const horizontals = isMajor ? g.horizontalMajor : g.horizontalMinor;\n\n for (const px of verticals) {\n const data: PathCommand[] = [{ type: \"M\", x: px, y: g.top }, { type: \"L\", x: px, y: g.bottom }];\n ctx.draw(new Graphics2D().path({ data, centerBounds }).stroke(phaseShift(stroke, g.top)));\n }\n for (const py of horizontals) {\n const data: PathCommand[] = [{ type: \"M\", x: g.left, y: py }, { type: \"L\", x: g.right, y: py }];\n ctx.draw(new Graphics2D().path({ data, centerBounds }).stroke(phaseShift(stroke, g.left)));\n }\n}\n\n// The largest dash-array sum across the layers, or 0 when none is dashed.\nfunction dashCycle(strokes: StrokeResolved[]): number {\n let cycle = 0;\n for (const s of strokes) {\n if (s.dash && s.dash.length > 0) {\n const sum = s.dash.reduce((a, b) => a + b, 0);\n if (sum > cycle) cycle = sum;\n }\n }\n return cycle;\n}\n\n// `dashOffset` advances the pattern, so it is negated to give the phase one infinite line would have at this world coordinate.\nfunction phaseShift(strokes: StrokeResolved[], worldStart: number): StrokeResolved[] {\n return strokes.map(s => (s.dash && s.dash.length > 0)\n ? { ...s, dashOffset: (s.dashOffset ?? 0) - worldStart }\n : s);\n}\n\n// A number and a vector tween by promoting the number to a uniform vector.\nfunction lerpCellSize(from: number | Vector2, to: number | Vector2, t: number): number | Vector2 {\n if (typeof from === \"number\" && typeof to === \"number\") return lerpNumber(from, to, t);\n const a = typeof from === \"number\" ? { x: from, y: from } : from;\n const b = typeof to === \"number\" ? { x: to, y: to } : to;\n return lerpVector2(a, b, t);\n}\n"],
5
+ "mappings": "0FAAA,OAAS,aAAAA,MAAsF,oBAuCzF,SAAUC,EACZC,EACAC,EACAC,EACAC,EAC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AAM,IAAK,EAAGN,EAAE,MAAO,EAAGM,CAAE,CAAE,EAC9FvC,EAAI,KAAK,IAAIW,EAAU,EAAG,KAAK,CAAE,KAAAoB,EAAM,aAAAH,CAAY,CAAE,EAAE,OAAOU,EAAWZ,EAAQO,EAAE,IAAI,CAAC,CAAC,CAC7F,CACJ,CAGA,SAASH,GAAUU,EAAyB,CACxC,IAAIX,EAAQ,EACZ,QAAWzB,KAAKoC,EACZ,GAAIpC,EAAE,MAAQA,EAAE,KAAK,OAAS,EAAG,CAC7B,IAAMqC,EAAMrC,EAAE,KAAK,OAAO,CAACsC,EAAGC,IAAMD,EAAIC,EAAG,CAAC,EACxCF,EAAMZ,IAAOA,EAAQY,EAC7B,CAEJ,OAAOZ,CACX,CAGA,SAASS,EAAWE,EAA2BI,EAAkB,CAC7D,OAAOJ,EAAQ,IAAIpC,GAAMA,EAAE,MAAQA,EAAE,KAAK,OAAS,EAC7C,CAAE,GAAGA,EAAG,YAAaA,EAAE,YAAc,GAAKwC,CAAU,EACpDxC,CAAC,CACX,CAGA,SAAST,GAAakD,EAAwBC,EAAsBC,EAAS,CACzE,OAAI,OAAOF,GAAS,UAAY,OAAOC,GAAO,SAAiBE,GAAWH,EAAMC,EAAIC,CAAC,EAG9EnD,EAFG,OAAOiD,GAAS,SAAW,CAAE,EAAGA,EAAM,EAAGA,CAAI,EAAKA,EAClD,OAAOC,GAAO,SAAW,CAAE,EAAGA,EAAI,EAAGA,CAAE,EAAKA,EAC7BC,CAAC,CAC9B",
6
+ "names": ["strokeOps", "gridLines", "x", "y", "subdivisions", "overscan", "cycle", "verticalMajor", "verticalMinor", "horizontalMajor", "horizontalMinor", "top", "snapSpan", "bottom", "left", "right", "addTiledLines", "px", "isMajor", "py", "gridLinePaths", "g", "major", "minor", "pos", "step", "offset", "round", "min", "max", "emit", "anchor", "eps", "startN", "endN", "n", "maxWeight", "strokes", "s", "centered", "dimStroke", "factor", "f", "SUB_STROKES", "defaultSubStroke", "given", "sub", "stroke", "valueOf", "prop", "viewport_pattern_exports", "__export", "commands", "draw", "layout", "measure", "state", "visibleBounds", "Camera", "Flow", "Graphics2D", "Paint", "measurer", "s", "children", "box", "ctx", "camera", "vw", "vh", "zoom", "heading", "hw", "hh", "bw", "bh", "rad", "cos", "sin", "lookAt", "pattern", "bounds", "region", "Flow", "Graphics2D", "Paint", "Types", "component2d", "lerpVector2", "LineGridPattern", "component2d", "Paint", "Flow", "Types", "lerpVector2", "_state", "given", "defaultSubStroke", "measurer", "state", "children", "box", "ctx", "width", "height", "Graphics2D", "divisions", "subdivisions", "major", "centered", "minorStroke", "overscan", "maxWeight", "lines", "gridPaths", "centerBounds", "offset", "cols", "innerW", "innerH", "insetX", "insetY", "gridLinePaths", "Flow", "Graphics2D", "Paint", "Types", "component2d", "lerpVector2", "gridPositions", "min", "max", "step", "offset", "subdivisions", "overscan", "out", "addTiledLines", "pos", "isMajor", "state", "Paint", "Flow", "Types", "lerpVector2", "DotGridPattern", "component2d", "measurer", "children", "box", "ctx", "untrimmed", "Graphics2D", "dots", "size", "s", "width", "height", "divisions", "major", "minor", "cols", "insetX", "insetY", "xs", "ys", "field", "drew", "column", "row", "Graphics2D", "Types", "component2d", "lerpNumber", "lerpVector2", "GridPattern", "component2d", "viewport_pattern_exports", "Types", "lerpCellSize", "lerpVector2", "_state", "given", "defaultSubStroke", "ctx", "state", "bounds", "drawGrid", "s", "halfW", "halfH", "left", "right", "top", "bottom", "Graphics2D", "subdivisions", "cell", "cellX", "cellY", "stepX", "stepY", "major", "centered", "minorStroke", "overscan", "maxWeight", "xAxis", "yAxis", "drawGroup", "stroke", "isMajor", "centerBounds", "cycle", "dashCycle", "data", "gridLinePaths", "g", "gridLines", "verticals", "horizontals", "px", "phaseShift", "py", "strokes", "sum", "a", "b", "worldStart", "from", "to", "t", "lerpNumber"]
7
+ }
@@ -1,2 +1,2 @@
1
- import{a as T,b as k,c as V,d as w,e as x,f as nt,g as P,h as g}from"./chunks/chunk-DRFXMB3M.js";import{Flow as z,Graphics2D as v,Paint as M,Types as W,component2d as _,lerpVector2 as q}from"@motionscript/sdk";var X=_({key:"lineGridPattern",state:{...M.state,...z.state,divisions:4,subdivisions:1,subStroke:W.stroke,offset:W.custom({x:0,y:0},{lerp:q})},defaults:{subStroke:(o,t)=>P(t)},commands:{...M.commands},measure:(o,t,e)=>z.measure(o,t,e,M.inset(t)),layout:(o,t,e)=>z.layout(o,t,e,M.inset(t)),render:(o,t)=>{let{width:e,height:r}=o.size,i=new v().rect({width:e,height:r});o.inFront(()=>{o.draw(new v().rect({width:e,height:r,start:t.start,end:t.end}).shadow(t.shadow).fill(t.fill));let c=Math.max(1,Math.floor(t.divisions)),s=Math.max(1,Math.floor(t.subdivisions)),l=x(t.stroke),f=x(t.subStroke),n=Math.max(w(l),w(f))/2,a=A(e,r,c,s,n,t.offset),m=[-e/2,-r/2,e/2,r/2];o.clip(i,()=>{s>1&&f.length>0&&a.minor.length>0&&o.draw(new v().path({data:a.minor,centerBounds:m}).stroke(f)),a.major.length>0&&o.draw(new v().path({data:a.major,centerBounds:m}).stroke(l))})}),M.draw(o,t,null,{clipShape:i})}});function A(o,t,e,r,i,c){let s=e*r,l=Math.max(0,o-2*i),f=Math.max(0,t-2*i),n=o/2-i,a=t/2-i;return k({min:-n,max:n,step:l/s,offset:c.x,anchor:-n},{min:-a,max:a,step:f/s,offset:c.y,anchor:-a},r,i)}import{Flow as j,Graphics2D as F,Paint as S,Types as I,component2d as J,lerpVector2 as K}from"@motionscript/sdk";function Y(o,t,e,r,i,c){let s=[];return V(o,t,e,r,i,c,(l,f)=>{s.push({pos:l,isMajor:f})},o),s}var Q={...S.state,...j.state,divisions:4,subdivisions:1,radius:3,subScale:.5,offset:I.custom({x:0,y:0},{lerp:K})},N=J({key:"dotGridPattern",state:Q,commands:{...S.commands},measure:(o,t,e)=>j.measure(o,t,e,S.inset(t)),layout:(o,t,e)=>j.layout(o,t,e,S.inset(t)),render:(o,t)=>{let e={fill:t.fill,stroke:t.stroke,shadow:t.shadow,overlay:t.overlay,start:0,end:1,clip:t.clip},r=new F().rect({width:o.size.width,height:o.size.height});S.draw(o,e,R(o.size,t),{clipShape:r})}});function R(o,t){let{width:e,height:r}=o;if(e<=0||r<=0)return null;let i=Math.max(1,Math.floor(t.divisions)),c=Math.max(1,Math.floor(t.subdivisions)),s=Math.max(0,t.radius),l=s*Math.max(0,t.subScale);if(s<=0&&l<=0)return null;let f=i*c,n=Math.max(0,e/2-s),a=Math.max(0,r/2-s),m=Y(-n,n,n*2/f,t.offset.x,c,s),d=Y(-a,a,a*2/f,t.offset.y,c,s),h=new F,b=!1;for(let p of m)for(let u of d){let y=p.isMajor&&u.isMajor?s:l;y<=0||(h.ellipse({x:p.pos,y:u.pos,width:y*2,height:y*2}),b=!0)}return b?h:null}import{Graphics2D as G,Types as L,component2d as U,lerpNumber as Z,lerpVector2 as E}from"@motionscript/sdk";var H=U({key:"gridPattern",state:{...g.state,cellSize:L.custom(100,{lerp:ot}),subdivisions:1,subStroke:L.stroke,offset:L.custom({x:0,y:0},{lerp:E})},defaults:{subStroke:(o,t)=>P(t)},commands:{...g.commands},measure:g.measure,layout:g.layout,render:(o,t)=>g.draw(o,e=>$(o,t,e))});function $(o,t,e){let r=e.width/2,i=e.height/2,c=e.x-r,s=e.x+r,l=e.y-i,f=e.y+i;o.draw(new G().rect({x:e.x,y:e.y,width:e.width,height:e.height,start:t.start,end:t.end}).shadow(t.shadow).fill(t.fill));let n=Math.max(1,Math.floor(t.subdivisions)),a=t.cellSize,m=Math.max(.001,typeof a=="number"?a:a.x),d=Math.max(.001,typeof a=="number"?a:a.y),h=m/n,b=d/n,p=x(t.stroke),u=x(t.subStroke),y=Math.max(w(p),w(u))/2,D={min:c,max:s,step:h,offset:t.offset.x},O={min:l,max:f,step:b,offset:t.offset.y};n>1&&u.length>0&&B(o,D,O,n,y,u,!1),p.length>0&&B(o,D,O,n,y,p,!0)}function B(o,t,e,r,i,c,s){let l=[-1,-1,1,1],f=tt(c);if(f<=0){let d=k(t,e,r,i)[s?"major":"minor"];d.length>0&&o.draw(new G().path({data:d,centerBounds:l}).stroke(c));return}let n=T(t,e,r,i,f),a=s?n.verticalMajor:n.verticalMinor,m=s?n.horizontalMajor:n.horizontalMinor;for(let d of a){let h=[{type:"M",x:d,y:n.top},{type:"L",x:d,y:n.bottom}];o.draw(new G().path({data:h,centerBounds:l}).stroke(C(c,n.top)))}for(let d of m){let h=[{type:"M",x:n.left,y:d},{type:"L",x:n.right,y:d}];o.draw(new G().path({data:h,centerBounds:l}).stroke(C(c,n.left)))}}function tt(o){let t=0;for(let e of o)if(e.dash&&e.dash.length>0){let r=e.dash.reduce((i,c)=>i+c,0);r>t&&(t=r)}return t}function C(o,t){return o.map(e=>e.dash&&e.dash.length>0?{...e,dashOffset:(e.dashOffset??0)-t}:e)}function ot(o,t,e){return typeof o=="number"&&typeof t=="number"?Z(o,t,e):E(typeof o=="number"?{x:o,y:o}:o,typeof t=="number"?{x:t,y:t}:t,e)}var et=[X,N,H];export{N as DotGridPattern,H as GridPattern,X as LineGridPattern,et as NODES,g as ViewportPattern,V as addTiledLines,x as centered,P as defaultSubStroke,nt as dimStroke,k as gridLinePaths,T as gridLines,w as maxWeight};
1
+ import{i as r,j as t,k as o}from"./chunks/chunk-H7QJB37I.js";var e=[r,t,o];export{t as DotGridPattern,o as GridPattern,r as LineGridPattern,e as NODES};
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../src/line-grid-pattern/line-grid-pattern.ts", "../../src/dot-grid-pattern/dot-grid-pattern.ts", "../../src/grid-pattern/grid-pattern.ts", "../../src/nodes.ts"],
4
- "sourcesContent": ["import {\n Flow,\n Graphics2D,\n Paint,\n Types,\n component2d,\n lerpVector2,\n type NodeOf,\n type PathBounds,\n type PathCommand,\n type Vector2,\n // Named so the emitted declaration reaches these through the sdk, not core.\n type Alignment as _Alignment,\n type Fill as _Fill,\n type FillResolved as _FillResolved,\n type FlowMode as _FlowMode,\n type FlowResolved as _FlowResolved,\n type GapSize as _GapSize,\n type Node2D as _Node2D,\n type Node2DProps as _Node2DProps,\n type Shadow as _Shadow,\n type ShadowResolved as _ShadowResolved,\n type Stroke as _Stroke,\n type StrokeResolved as _StrokeResolved,\n} from \"@motionscript/sdk\";\n\nimport { centered, defaultSubStroke, gridLinePaths, maxWeight } from \"../kit\";\n\n/**\n * A rectangular grid of lines filling the node's layout rect.\n *\n * `stroke` paints the major lines and `subStroke` the minor ones, each as a\n * single union path. `fill` and `shadow` cover the whole rect, behind the lines.\n */\nexport const LineGridPattern = component2d({\n key: \"lineGridPattern\",\n state: {\n ...Paint.state,\n ...Flow.state,\n /** Cells along each axis: `divisions` of 4 draws 5 major lines per axis. */\n divisions: 4,\n /** Finer cells each division is split into. 1 draws no minor lines; 2 adds one per division. */\n subdivisions: 1,\n /** Stroke for the minor lines. Unset, the major `stroke` at half opacity when `subdivisions > 1`. */\n subStroke: Types.stroke,\n /** Pans the grid. Lines wrap and tile, so the rect stays full while `offset` scrolls it. */\n offset: Types.custom<Vector2>({ x: 0, y: 0 }, { lerp: lerpVector2 }),\n },\n defaults: { subStroke: (_state, given) => defaultSubStroke(given) },\n commands: { ...Paint.commands },\n measure: (measurer, state, children) => Flow.measure(measurer, state, children, Paint.inset(state)),\n layout: (box, state, children) => Flow.layout(box, state, children, Paint.inset(state)),\n render: (ctx, state) => {\n const { width, height } = ctx.size;\n const box = new Graphics2D().rect({ width, height });\n ctx.inFront(() => {\n ctx.draw(new Graphics2D()\n .rect({ width, height, start: state.start, end: state.end })\n .shadow(state.shadow)\n .fill(state.fill));\n\n const divisions = Math.max(1, Math.floor(state.divisions));\n const subdivisions = Math.max(1, Math.floor(state.subdivisions));\n\n // Lines overscan the rect by half the thickest stroke and are clipped to it, so a\n // thick line slides out under the clip instead of popping at the boundary.\n const major = centered(state.stroke);\n const minorStroke = centered(state.subStroke);\n const overscan = Math.max(maxWeight(major), maxWeight(minorStroke)) / 2;\n const lines = gridPaths(width, height, divisions, subdivisions, overscan, state.offset);\n const centerBounds: PathBounds = [-width / 2, -height / 2, width / 2, height / 2];\n\n ctx.clip(box, () => {\n // Minor lines first so the major lines sit on top.\n if (subdivisions > 1 && minorStroke.length > 0 && lines.minor.length > 0) {\n ctx.draw(new Graphics2D().path({ data: lines.minor, centerBounds }).stroke(minorStroke));\n }\n if (lines.major.length > 0) {\n ctx.draw(new Graphics2D().path({ data: lines.major, centerBounds }).stroke(major));\n }\n });\n });\n // The rect is what `clip` confines the children to and what picking tests; it paints nothing more.\n Paint.draw(ctx, state, null, { clipShape: box });\n },\n});\n\nexport type LineGridPattern = NodeOf<typeof LineGridPattern>;\n\nfunction gridPaths(\n width: number,\n height: number,\n divisions: number,\n subdivisions: number,\n overscan: number,\n offset: Vector2,\n): { major: PathCommand[]; minor: PathCommand[] } {\n // Inset by `overscan` so the outermost lines sit fully inside the rect and are not\n // trimmed to half weight by the clip.\n const cols = divisions * subdivisions;\n const innerW = Math.max(0, width - 2 * overscan);\n const innerH = Math.max(0, height - 2 * overscan);\n const insetX = width / 2 - overscan;\n const insetY = height / 2 - overscan;\n\n // Anchored at the near edge, so a line sits on each edge of the box for any count of cells.\n return gridLinePaths(\n { min: -insetX, max: insetX, step: innerW / cols, offset: offset.x, anchor: -insetX },\n { min: -insetY, max: insetY, step: innerH / cols, offset: offset.y, anchor: -insetY },\n subdivisions,\n overscan,\n );\n}\n", "import {\n Flow,\n Graphics2D,\n Paint,\n Types,\n component2d,\n lerpVector2,\n type NodeOf,\n type Size2D,\n type Vector2,\n // Named so the emitted declaration reaches these through the sdk, not core.\n type Alignment as _Alignment,\n type Fill as _Fill,\n type FillResolved as _FillResolved,\n type FlowMode as _FlowMode,\n type FlowResolved as _FlowResolved,\n type GapSize as _GapSize,\n type Node2D as _Node2D,\n type Node2DProps as _Node2DProps,\n type Shadow as _Shadow,\n type ShadowResolved as _ShadowResolved,\n type Stroke as _Stroke,\n type StrokeResolved as _StrokeResolved,\n} from \"@motionscript/sdk\"\n\nimport { addTiledLines } from \"../kit\"\n\n// The tiling `LineGridPattern` uses, so dots stay on its intersections at every offset.\nfunction gridPositions(\n min: number,\n max: number,\n step: number,\n offset: number,\n subdivisions: number,\n overscan: number\n): { pos: number; isMajor: boolean }[] {\n const out: { pos: number; isMajor: boolean }[] = []\n // Anchored at the near edge, so a column or row sits on each edge of the box for any cell count.\n addTiledLines(min, max, step, offset, subdivisions, overscan, (pos, isMajor) => {\n out.push({ pos, isMajor })\n }, min)\n return out\n}\n\nconst state = {\n ...Paint.state,\n ...Flow.state,\n /** Cells along each axis, as in `LineGridPattern.divisions`: 4 puts 5 major dots on each. */\n divisions: 4,\n /** `1` draws only the major dots; `2` puts one minor dot between each pair. */\n subdivisions: 1,\n /** Radius of a major dot. */\n radius: 3,\n /** A minor dot's radius as a fraction of a major one's, not a second paint stack, so a gradient crosses every dot. */\n subScale: 0.5,\n /** As `LineGridPattern.offset`, so the two stay aligned while both scroll. */\n offset: Types.custom<Vector2>({ x: 0, y: 0 }, { lerp: lerpVector2 }),\n}\n\ninterface DotField {\n readonly divisions: number\n readonly subdivisions: number\n readonly radius: number\n readonly subScale: number\n readonly offset: Vector2\n}\n\n/**\n * A field of dots on the same `divisions` / `subdivisions` / `offset` as\n * `LineGridPattern`, so laid over one the dots sit on its intersections. The\n * dots are the silhouette `Paint.draw` paints; a background is a rectangle behind\n * it. `clip` and picking use the node's box, not the silhouette, so outer dots\n * clip as they pan out and the node stays selectable between dots. `start` and\n * `end` act on nothing: trimming a disc leaves a crescent, not a partial grid.\n */\nexport const DotGridPattern = component2d({\n key: \"dotGridPattern\",\n state,\n commands: { ...Paint.commands },\n measure: (measurer, state, children) => Flow.measure(measurer, state, children, Paint.inset(state)),\n layout: (box, state, children) => Flow.layout(box, state, children, Paint.inset(state)),\n render: (ctx, state) => {\n const untrimmed = {\n fill: state.fill, stroke: state.stroke, shadow: state.shadow, overlay: state.overlay, start: 0, end: 1, clip: state.clip,\n }\n const box = new Graphics2D().rect({ width: ctx.size.width, height: ctx.size.height })\n Paint.draw(ctx, untrimmed, dots(ctx.size, state), { clipShape: box })\n },\n})\n\nexport type DotGridPattern = NodeOf<typeof DotGridPattern>\n\n/** Every dot as one un-painted union: the paint stacks belong to the grid, not a dot. */\nfunction dots(size: Size2D, s: DotField): Graphics2D | null {\n const { width, height } = size\n if (width <= 0 || height <= 0) return null\n\n const divisions = Math.max(1, Math.floor(s.divisions))\n const subdivisions = Math.max(1, Math.floor(s.subdivisions))\n const major = Math.max(0, s.radius)\n const minor = major * Math.max(0, s.subScale)\n if (major <= 0 && minor <= 0) return null\n\n // Inset by a dot's radius so an edge dot sits inside the box rather than being halved by the clip.\n const cols = divisions * subdivisions\n const insetX = Math.max(0, width / 2 - major)\n const insetY = Math.max(0, height / 2 - major)\n const xs = gridPositions(\n -insetX,\n insetX,\n (insetX * 2) / cols,\n s.offset.x,\n subdivisions,\n major\n )\n const ys = gridPositions(\n -insetY,\n insetY,\n (insetY * 2) / cols,\n s.offset.y,\n subdivisions,\n major\n )\n\n const field = new Graphics2D()\n let drew = false\n for (const column of xs) {\n for (const row of ys) {\n // Major only where both axes are: an intersection of two major rules.\n const size = column.isMajor && row.isMajor ? major : minor\n if (size <= 0) continue\n field.ellipse({ x: column.pos, y: row.pos, width: size * 2, height: size * 2 })\n drew = true\n }\n }\n return drew ? field : null\n}\n", "import {\n Graphics2D,\n Types,\n component2d,\n lerpNumber,\n lerpVector2,\n type BoxBounds,\n type NodeOf,\n type PathCommand,\n type RenderContext,\n type ShadowResolved,\n type FillResolved,\n type StrokeResolved,\n type Vector2,\n // Named so the emitted declaration reaches these through the sdk, not core.\n type Alignment as _Alignment,\n type Fill as _Fill,\n type FlowMode as _FlowMode,\n type FlowResolved as _FlowResolved,\n type GapSize as _GapSize,\n type Node2D as _Node2D,\n type Node2DProps as _Node2DProps,\n type Shadow as _Shadow,\n type Stroke as _Stroke,\n} from \"@motionscript/sdk\";\n\nimport { centered, defaultSubStroke, gridLinePaths, gridLines, maxWeight, ViewportPattern, type GridAxis } from \"../kit\";\n\n/**\n * An infinite line grid that fills the camera's visible region: like\n * `LineGridPattern`, but it tiles a world-anchored grid (spacing `cellSize`)\n * across what the nearest `Camera` sees, regenerated each frame. With no camera it\n * fills its own layout rect.\n */\nexport const GridPattern = component2d({\n key: \"gridPattern\",\n state: {\n ...ViewportPattern.state,\n /** Spacing between grid lines in world units: one number for both axes, or `{ x, y }`. */\n cellSize: Types.custom<number | Vector2>(100, { lerp: lerpCellSize }),\n /** Finer cells each cell is split into, as in `LineGridPattern.subdivisions`. */\n subdivisions: 1,\n /** Stroke for the minor lines. Unset, the major `stroke` at half opacity when `subdivisions > 1`. */\n subStroke: Types.stroke,\n /** Scrolls the pattern relative to the world, which it is otherwise anchored to. */\n offset: Types.custom<Vector2>({ x: 0, y: 0 }, { lerp: lerpVector2 }),\n },\n defaults: { subStroke: (_state, given) => defaultSubStroke(given) },\n commands: { ...ViewportPattern.commands },\n measure: ViewportPattern.measure,\n layout: ViewportPattern.layout,\n render: (ctx, state) => ViewportPattern.draw(ctx, (bounds) => drawGrid(ctx, state, bounds)),\n});\n\nexport type GridPattern = NodeOf<typeof GridPattern>;\n\ninterface GridState {\n readonly fill: FillResolved[];\n readonly stroke: StrokeResolved[];\n readonly shadow: ShadowResolved[];\n readonly start: number;\n readonly end: number;\n readonly cellSize: number | Vector2;\n readonly subdivisions: number;\n readonly subStroke: StrokeResolved[];\n readonly offset: Vector2;\n}\n\nfunction drawGrid(ctx: RenderContext, s: GridState, bounds: BoxBounds): void {\n const halfW = bounds.width / 2;\n const halfH = bounds.height / 2;\n // `bounds` is centred on (x, y) in y-up world space.\n const left = bounds.x - halfW;\n const right = bounds.x + halfW;\n const top = bounds.y - halfH;\n const bottom = bounds.y + halfH;\n\n ctx.draw(new Graphics2D()\n .rect({ x: bounds.x, y: bounds.y, width: bounds.width, height: bounds.height, start: s.start, end: s.end })\n .shadow(s.shadow)\n .fill(s.fill));\n\n const subdivisions = Math.max(1, Math.floor(s.subdivisions));\n const cell = s.cellSize;\n const cellX = Math.max(1e-3, typeof cell === \"number\" ? cell : cell.x);\n const cellY = Math.max(1e-3, typeof cell === \"number\" ? cell : cell.y);\n const stepX = cellX / subdivisions;\n const stepY = cellY / subdivisions;\n\n const major = centered(s.stroke);\n const minorStroke = centered(s.subStroke);\n const overscan = Math.max(maxWeight(major), maxWeight(minorStroke)) / 2;\n\n const xAxis: GridAxis = { min: left, max: right, step: stepX, offset: s.offset.x };\n const yAxis: GridAxis = { min: top, max: bottom, step: stepY, offset: s.offset.y };\n\n // Minor lines first so the major lines sit on top.\n if (subdivisions > 1 && minorStroke.length > 0) {\n drawGroup(ctx, xAxis, yAxis, subdivisions, overscan, minorStroke, false);\n }\n if (major.length > 0) {\n drawGroup(ctx, xAxis, yAxis, subdivisions, overscan, major, true);\n }\n}\n\n// A solid stroke paints the group as one union path. A dashed one draws each line on its\n// own, dash phase anchored to its world coordinate, so dashes never crawl as the camera pans.\nfunction drawGroup(\n ctx: RenderContext,\n xAxis: GridAxis,\n yAxis: GridAxis,\n subdivisions: number,\n overscan: number,\n stroke: StrokeResolved[],\n isMajor: boolean,\n): void {\n // Symmetric centerBounds give a zero recentre offset, so local coordinates draw verbatim.\n const centerBounds = [-1, -1, 1, 1] as const;\n\n const cycle = dashCycle(stroke);\n if (cycle <= 0) {\n const data = gridLinePaths(xAxis, yAxis, subdivisions, overscan)[isMajor ? \"major\" : \"minor\"];\n if (data.length > 0) ctx.draw(new Graphics2D().path({ data, centerBounds }).stroke(stroke));\n return;\n }\n\n // Each line spans a whole number of dash cycles, so the renderer's per-path dash-fit\n // is a no-op and every line dashes identically.\n const g = gridLines(xAxis, yAxis, subdivisions, overscan, cycle);\n const verticals = isMajor ? g.verticalMajor : g.verticalMinor;\n const horizontals = isMajor ? g.horizontalMajor : g.horizontalMinor;\n\n for (const px of verticals) {\n const data: PathCommand[] = [{ type: \"M\", x: px, y: g.top }, { type: \"L\", x: px, y: g.bottom }];\n ctx.draw(new Graphics2D().path({ data, centerBounds }).stroke(phaseShift(stroke, g.top)));\n }\n for (const py of horizontals) {\n const data: PathCommand[] = [{ type: \"M\", x: g.left, y: py }, { type: \"L\", x: g.right, y: py }];\n ctx.draw(new Graphics2D().path({ data, centerBounds }).stroke(phaseShift(stroke, g.left)));\n }\n}\n\n// The largest dash-array sum across the layers, or 0 when none is dashed.\nfunction dashCycle(strokes: StrokeResolved[]): number {\n let cycle = 0;\n for (const s of strokes) {\n if (s.dash && s.dash.length > 0) {\n const sum = s.dash.reduce((a, b) => a + b, 0);\n if (sum > cycle) cycle = sum;\n }\n }\n return cycle;\n}\n\n// `dashOffset` advances the pattern, so it is negated to give the phase one infinite line would have at this world coordinate.\nfunction phaseShift(strokes: StrokeResolved[], worldStart: number): StrokeResolved[] {\n return strokes.map(s => (s.dash && s.dash.length > 0)\n ? { ...s, dashOffset: (s.dashOffset ?? 0) - worldStart }\n : s);\n}\n\n// A number and a vector tween by promoting the number to a uniform vector.\nfunction lerpCellSize(from: number | Vector2, to: number | Vector2, t: number): number | Vector2 {\n if (typeof from === \"number\" && typeof to === \"number\") return lerpNumber(from, to, t);\n const a = typeof from === \"number\" ? { x: from, y: from } : from;\n const b = typeof to === \"number\" ? { x: to, y: to } : to;\n return lerpVector2(a, b, t);\n}\n", "import { DotGridPattern } from \"./dot-grid-pattern\"\nimport { GridPattern } from \"./grid-pattern\"\nimport { LineGridPattern } from \"./line-grid-pattern\"\n\n// Typed by name, so the declaration names each component rather than spelling out its type through core.\ntype KitNode =\n | typeof LineGridPattern\n | typeof DotGridPattern\n | typeof GridPattern\n\nexport const NODES: KitNode[] = [\n LineGridPattern,\n DotGridPattern,\n GridPattern,\n]\n"],
5
- "mappings": "iGAAA,OACI,QAAAA,EACA,cAAAC,EACA,SAAAC,EACA,SAAAC,EACA,eAAAC,EACA,eAAAC,MAkBG,oBAUA,IAAMC,EAAkBC,EAAY,CACvC,IAAK,kBACL,MAAO,CACH,GA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AAE,EAAE,OAAOU,EAAWZ,EAAQO,EAAE,IAAI,CAAC,CAAC,CAC7F,CACJ,CAGA,SAASH,GAAUU,EAAyB,CACxC,IAAIX,EAAQ,EACZ,QAAWzB,KAAKoC,EACZ,GAAIpC,EAAE,MAAQA,EAAE,KAAK,OAAS,EAAG,CAC7B,IAAMqC,EAAMrC,EAAE,KAAK,OAAO,CAACsC,EAAGC,IAAMD,EAAIC,EAAG,CAAC,EACxCF,EAAMZ,IAAOA,EAAQY,EAC7B,CAEJ,OAAOZ,CACX,CAGA,SAASS,EAAWE,EAA2BI,EAAkB,CAC7D,OAAOJ,EAAQ,IAAIpC,GAAMA,EAAE,MAAQA,EAAE,KAAK,OAAS,EAC7C,CAAE,GAAGA,EAAG,YAAaA,EAAE,YAAc,GAAKwC,CAAU,EACpDxC,CAAC,CACX,CAGA,SAAST,GAAakD,EAAwBC,EAAsBC,EAAS,CACzE,OAAI,OAAOF,GAAS,UAAY,OAAOC,GAAO,SAAiBE,EAAWH,EAAMC,EAAIC,CAAC,EAG9EnD,EAFG,OAAOiD,GAAS,SAAW,CAAE,EAAGA,EAAM,EAAGA,CAAI,EAAKA,EAClD,OAAOC,GAAO,SAAW,CAAE,EAAGA,EAAI,EAAGA,CAAE,EAAKA,EAC7BC,CAAC,CAC9B,CC7JO,IAAME,GAAmB,CAC5BC,EACAC,EACAC",
6
- "names": ["Flow", "Graphics2D", "Paint", "Types", "component2d", "lerpVector2", "LineGridPattern", "component2d", "Paint", "Flow", "Types", "lerpVector2", "_state", "given", "defaultSubStroke", "measurer", "state", "children", "box", "ctx", "width", "height", "Graphics2D", "divisions", "subdivisions", "major", "centered", "minorStroke", "overscan", "maxWeight", "lines", "gridPaths", "centerBounds", "offset", "cols", "innerW", "innerH", "insetX", "insetY", "gridLinePaths", "Flow", "Graphics2D", "Paint", "Types", "component2d", "lerpVector2", "gridPositions", "min", "max", "step", "offset", "subdivisions", "overscan", "out", "addTiledLines", "pos", "isMajor", "state", "Paint", "Flow", "Types", "lerpVector2", "DotGridPattern", "component2d", "measurer", "children", "box", "ctx", "untrimmed", "Graphics2D", "dots", "size", "s", "width", "height", "divisions", "major", "minor", "cols", "insetX", "insetY", "xs", "ys", "field", "drew", "column", "row", "Graphics2D", "Types", "component2d", "lerpNumber", "lerpVector2", "GridPattern", "component2d", "viewport_pattern_exports", "Types", "lerpCellSize", "lerpVector2", "_state", "given", "defaultSubStroke", "ctx", "state", "bounds", "drawGrid", "s", "halfW", "halfH", "left", "right", "top", "bottom", "Graphics2D", "subdivisions", "cell", "cellX", "cellY", "stepX", "stepY", "major", "centered", "minorStroke", "overscan", "maxWeight", "xAxis", "yAxis", "drawGroup", "stroke", "isMajor", "centerBounds", "cycle", "dashCycle", "data", "gridLinePaths", "g", "gridLines", "verticals", "horizontals", "px", "phaseShift", "py", "strokes", "sum", "a", "b", "worldStart", "from", "to", "t", "lerpNumber", "NODES", "LineGridPattern", "DotGridPattern", "GridPattern"]
3
+ "sources": ["../../src/nodes.ts"],
4
+ "sourcesContent": ["import { DotGridPattern } from \"./dot-grid-pattern\"\nimport { GridPattern } from \"./grid-pattern\"\nimport { LineGridPattern } from \"./line-grid-pattern\"\n\n// Typed by name, so the declaration names each component rather than spelling out its type through core.\ntype KitNode =\n | typeof LineGridPattern\n | typeof DotGridPattern\n | typeof GridPattern\n\nexport const NODES: KitNode[] = [\n LineGridPattern,\n DotGridPattern,\n GridPattern,\n]\n"],
5
+ "mappings": "6DAUO,IAAMA,EAAmB,CAC5BC,EACAC,EACAC",
6
+ "names": ["NODES", "LineGridPattern", "DotGridPattern", "GridPattern"]
7
7
  }
@@ -1,2 +1,2 @@
1
- import{a,b,c,d,e,f,g,h}from"./chunks/chunk-DRFXMB3M.js";export{h as ViewportPattern,c as addTiledLines,e as centered,g as defaultSubStroke,f as dimStroke,b as gridLinePaths,a as gridLines,d as maxWeight};
1
+ import{a as o,b as r,c as e,d as f,e as m,f as p,g as t,h as x,i as a,j as b,k as c}from"./chunks/chunk-H7QJB37I.js";export{b as DotGridPattern,c as GridPattern,a as LineGridPattern,x as ViewportPattern,e as addTiledLines,m as centered,t as defaultSubStroke,p as dimStroke,r as gridLinePaths,o as gridLines,f as maxWeight};
2
2
  //# sourceMappingURL=kit.js.map
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@motionscript/patterns",
3
- "version": "0.1.1-alpha.5",
3
+ "version": "0.3.0",
4
4
  "exports": {
5
5
  ".": "dist/browser/index.js",
6
6
  "./kit": "dist/browser/kit.js"
package/dist/index.d.ts CHANGED
@@ -1,6 +1,5 @@
1
- export * from "./line-grid-pattern/index.js";
2
- export * from "./dot-grid-pattern/index.js";
3
- export * from "./grid-pattern/index.js";
4
- export * from "./engine.js";
1
+ export { LineGridPattern } from "./line-grid-pattern/index.js";
2
+ export { DotGridPattern } from "./dot-grid-pattern/index.js";
3
+ export { GridPattern } from "./grid-pattern/index.js";
5
4
  export { NODES } from "./nodes.js";
6
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAA;AACnC,cAAc,oBAAoB,CAAA;AAClC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,UAAU,CAAA;AACxB,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAC5C,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA"}
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
- export * from "./line-grid-pattern/index.js";
2
- export * from "./dot-grid-pattern/index.js";
3
- export * from "./grid-pattern/index.js";
4
- export * from "./engine.js";
1
+ // The public surface, named one by one; everything else is `./kit` (`unstable.ts`).
2
+ export { LineGridPattern } from "./line-grid-pattern/index.js";
3
+ export { DotGridPattern } from "./dot-grid-pattern/index.js";
4
+ export { GridPattern } from "./grid-pattern/index.js";
5
5
  export { NODES } from "./nodes.js";
6
6
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAA;AACnC,cAAc,oBAAoB,CAAA;AAClC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,UAAU,CAAA;AACxB,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA","sourcesContent":["export * from \"./line-grid-pattern\"\nexport * from \"./dot-grid-pattern\"\nexport * from \"./grid-pattern\"\nexport * from \"./engine\"\nexport { NODES } from \"./nodes\"\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,oFAAoF;AACpF,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAC5C,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA","sourcesContent":["// The public surface, named one by one; everything else is `./kit` (`unstable.ts`).\nexport { LineGridPattern } from \"./line-grid-pattern\"\nexport { DotGridPattern } from \"./dot-grid-pattern\"\nexport { GridPattern } from \"./grid-pattern\"\nexport { NODES } from \"./nodes\"\n"]}
@@ -0,0 +1,5 @@
1
+ export * from "./engine.js";
2
+ export * from "./line-grid-pattern/index.js";
3
+ export * from "./dot-grid-pattern/index.js";
4
+ export * from "./grid-pattern/index.js";
5
+ //# sourceMappingURL=unstable.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"unstable.d.ts","sourceRoot":"","sources":["../src/unstable.ts"],"names":[],"mappings":"AAEA,cAAc,UAAU,CAAA;AACxB,cAAc,qBAAqB,CAAA;AACnC,cAAc,oBAAoB,CAAA;AAClC,cAAc,gBAAgB,CAAA"}
@@ -0,0 +1,7 @@
1
+ // `@motionscript/patterns/kit`: everything the package holds, for a copied pattern and code built on its
2
+ // internals. Any release may change it; the root barrel is what stays.
3
+ export * from "./engine.js";
4
+ export * from "./line-grid-pattern/index.js";
5
+ export * from "./dot-grid-pattern/index.js";
6
+ export * from "./grid-pattern/index.js";
7
+ //# sourceMappingURL=unstable.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"unstable.js","sourceRoot":"","sources":["../src/unstable.ts"],"names":[],"mappings":"AAAA,yGAAyG;AACzG,uEAAuE;AACvE,cAAc,UAAU,CAAA;AACxB,cAAc,qBAAqB,CAAA;AACnC,cAAc,oBAAoB,CAAA;AAClC,cAAc,gBAAgB,CAAA","sourcesContent":["// `@motionscript/patterns/kit`: everything the package holds, for a copied pattern and code built on its\n// internals. Any release may change it; the root barrel is what stays.\nexport * from \"./engine\"\nexport * from \"./line-grid-pattern\"\nexport * from \"./dot-grid-pattern\"\nexport * from \"./grid-pattern\"\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@motionscript/patterns",
3
- "version": "0.1.1-alpha.5",
3
+ "version": "0.3.0",
4
4
  "type": "module",
5
5
  "description": "Background patterns for Motion Script: line and dot grids that fill a box, and an infinite grid that fills whatever a camera can see.",
6
6
  "repository": {
@@ -36,8 +36,8 @@
36
36
  "default": "./dist/index.js"
37
37
  },
38
38
  "./kit": {
39
- "types": "./dist/engine.d.ts",
40
- "default": "./dist/engine.js"
39
+ "types": "./dist/unstable.d.ts",
40
+ "default": "./dist/unstable.js"
41
41
  }
42
42
  },
43
43
  "keywords": [
@@ -51,7 +51,7 @@
51
51
  "license": "Apache-2.0",
52
52
  "author": "Motionscript",
53
53
  "peerDependencies": {
54
- "@motionscript/sdk": "^0.1.1-alpha.5"
54
+ "@motionscript/sdk": "^0.3.0"
55
55
  },
56
56
  "devDependencies": {
57
57
  "@types/node": "^25.6.2",
@@ -62,8 +62,8 @@
62
62
  "typescript": "^6.0.3",
63
63
  "typescript-eslint": "^8.48.0",
64
64
  "vitest": "^4.1.5",
65
- "@motionscript/core": "0.1.1-alpha.5",
66
- "@motionscript/sdk": "0.1.1-alpha.5"
65
+ "@motionscript/sdk": "0.3.0",
66
+ "@motionscript/core": "0.3.0"
67
67
  },
68
68
  "scripts": {
69
69
  "build": "tsc -p tsconfig.build.json && tsc-alias -p tsconfig.build.json --resolve-full-paths && node ../../../scripts/build-browser.mjs",
package/src/index.ts CHANGED
@@ -1,5 +1,5 @@
1
- export * from "./line-grid-pattern"
2
- export * from "./dot-grid-pattern"
3
- export * from "./grid-pattern"
4
- export * from "./engine"
1
+ // The public surface, named one by one; everything else is `./kit` (`unstable.ts`).
2
+ export { LineGridPattern } from "./line-grid-pattern"
3
+ export { DotGridPattern } from "./dot-grid-pattern"
4
+ export { GridPattern } from "./grid-pattern"
5
5
  export { NODES } from "./nodes"
@@ -0,0 +1,6 @@
1
+ // `@motionscript/patterns/kit`: everything the package holds, for a copied pattern and code built on its
2
+ // internals. Any release may change it; the root barrel is what stays.
3
+ export * from "./engine"
4
+ export * from "./line-grid-pattern"
5
+ export * from "./dot-grid-pattern"
6
+ export * from "./grid-pattern"
@@ -1,2 +0,0 @@
1
- var L=Object.defineProperty;var S=(o,t)=>{for(var n in t)L(o,n,{get:t[n],enumerable:!0})};import{strokeOps as b}from"@motionscript/sdk";function j(o,t,n,r,e=0){let s=[],a=[],i=[],f=[],p=m(t.min-r,t.step,t.offset,e,Math.floor),u=m(t.max+r,t.step,t.offset,e,Math.ceil),h=m(o.min-r,o.step,o.offset,e,Math.floor),l=m(o.max+r,o.step,o.offset,e,Math.ceil);return g(o.min,o.max,o.step,o.offset,n,r,(c,d)=>{(d?s:a).push(c)},o.anchor),g(t.min,t.max,t.step,t.offset,n,r,(c,d)=>{(d?i:f).push(c)},t.anchor),{top:p,bottom:u,left:h,right:l,verticalMajor:s,verticalMinor:a,horizontalMajor:i,horizontalMinor:f}}function E(o,t,n,r){let e=j(o,t,n,r),s=[],a=[];for(let i of e.verticalMajor)s.push({type:"M",x:i,y:e.top},{type:"L",x:i,y:e.bottom});for(let i of e.verticalMinor)a.push({type:"M",x:i,y:e.top},{type:"L",x:i,y:e.bottom});for(let i of e.horizontalMajor)s.push({type:"M",x:e.left,y:i},{type:"L",x:e.right,y:i});for(let i of e.horizontalMinor)a.push({type:"M",x:e.left,y:i},{type:"L",x:e.right,y:i});return{major:s,minor:a}}function m(o,t,n,r,e){return r>0?e(o/r)*r:t<=0?o:e((o-n)/t)*t+n}function g(o,t,n,r,e,s,a,i=0){if(n<=0)return;let f=n*1e-6,p=Math.ceil((o-s-r-i-f)/n),u=Math.floor((t+s-r-i+f)/n);for(let h=p;h<=u;h++){let l=i+h*n+r,c=(h%e+e)%e===0;a(l,c)}}function G(o){let t=0;for(let n of o)n.weight>t&&(t=n.weight);return t}function I(o){return o.map(t=>t.align===0?t:{...t,align:0})}function P(o,t){return b.resolve(o.map(n=>({...n,fill:n.fill.map(r=>({...r,opacity:(r.opacity??1)*t}))})))}var w=new WeakMap;function K(o){let t=w.get(o);if(!t){let n=y(o.stroke),r=y(o.subdivisions)??1;t=n!==void 0&&r>1?P(b.resolve(n),.5):[],w.set(o,t)}return t}function y(o){return typeof o=="function"?o():o}var k={};S(k,{commands:()=>F,draw:()=>W,layout:()=>T,measure:()=>N,state:()=>B,visibleBounds:()=>z});import{Camera as O,Flow as x,Graphics2D as A,Paint as M}from"@motionscript/sdk";var B={...M.state,...x.state},F={...M.commands};function N(o,t,n){return x.measure(o,t,n,M.inset(t))}function T(o,t,n){return x.layout(o,t,n,M.inset(t))}function z(o){let t=o.ancestor(O);if(!t)return{x:0,y:0,width:o.size.width,height:o.size.height};let{width:n,height:r}=t.size,e=t.state.zoom||1,s=t.state.heading,a=n/2/e,i=r/2/e,f=a,p=i;if(s!==0){let h=s*Math.PI/180,l=Math.abs(Math.cos(h)),c=Math.abs(Math.sin(h));f=a*l+i*c,p=a*c+i*l}let u=t.state.lookAt;return{x:u.x,y:u.y,width:f*2,height:p*2}}function W(o,t){let n=z(o),r=new A().rect({x:n.x,y:n.y,width:n.width,height:n.height});o.inFront(()=>o.clip(r,()=>t(n))),o.children()}export{j as a,E as b,g as c,G as d,I as e,P as f,K as g,k as h};
2
- //# sourceMappingURL=chunk-DRFXMB3M.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/kit/grid-lines.ts", "../../../src/kit/viewport-pattern.ts"],
4
- "sourcesContent": ["import { strokeOps, type PathCommand, type Stroke, type StrokeProp, type StrokeResolved } from \"@motionscript/sdk\";\n\n/** A grid extent on one axis: lines tile within `[min, max]`, on a lattice that starts at `anchor`. */\nexport interface GridAxis {\n min: number;\n max: number;\n /** Spacing between adjacent (minor) lines. */\n step: number;\n /** Pan offset in pixels. */\n offset: number;\n /**\n * Where the lattice starts: a line sits at `anchor + n * step`, and the tile\n * index `n` that decides which lines are major counts from there. Omitted it is\n * 0, the world origin, which a camera-following grid keeps. A grid with a box of\n * its own sets it to `min`, so the box's edges are lines whatever the cell count.\n */\n anchor?: number;\n}\n\n/** Where each line sits, split into major (division) and minor (subdivision) lines. Vertical lines run `top` to `bottom`, horizontal ones `left` to `right`. */\ninterface GridLines {\n top: number;\n bottom: number;\n left: number;\n right: number;\n verticalMajor: number[];\n verticalMinor: number[];\n horizontalMajor: number[];\n horizontalMinor: number[];\n}\n\n/**\n * The cross-axis spans and the major/minor line positions per axis. Spans are\n * grown by `overscan` so a thick line slides out under the clip instead of\n * popping, and snapped outward so a line's start stays fixed as the camera pans\n * (a dashed stroke anchored to it would otherwise crawl). `cycle`, the dash\n * period, snaps the span to whole dash cycles too, so every parallel line is the\n * same length and the renderer's per-path dash-fit is a no-op.\n */\nexport function gridLines(\n x: GridAxis,\n y: GridAxis,\n subdivisions: number,\n overscan: number,\n cycle = 0,\n): GridLines {\n const verticalMajor: number[] = [];\n const verticalMinor: number[] = [];\n const horizontalMajor: number[] = [];\n const horizontalMinor: number[] = [];\n\n const top = snapSpan(y.min - overscan, y.step, y.offset, cycle, Math.floor);\n const bottom = snapSpan(y.max + overscan, y.step, y.offset, cycle, Math.ceil);\n const left = snapSpan(x.min - overscan, x.step, x.offset, cycle, Math.floor);\n const right = snapSpan(x.max + overscan, x.step, x.offset, cycle, Math.ceil);\n\n addTiledLines(x.min, x.max, x.step, x.offset, subdivisions, overscan, (px, isMajor) => {\n (isMajor ? verticalMajor : verticalMinor).push(px);\n }, x.anchor);\n addTiledLines(y.min, y.max, y.step, y.offset, subdivisions, overscan, (py, isMajor) => {\n (isMajor ? horizontalMajor : horizontalMinor).push(py);\n }, y.anchor);\n\n return { top, bottom, left, right, verticalMajor, verticalMinor, horizontalMajor, horizontalMinor };\n}\n\n/**\n * The lines as one multi-subpath path per group (major, minor), so each stroke\n * paints as a union with no destructive boolean op, which would erase open lines.\n * For solid strokes; dashed strokes that must stay world-locked draw per line from\n * {@link gridLines}.\n */\nexport function gridLinePaths(\n x: GridAxis,\n y: GridAxis,\n subdivisions: number,\n overscan: number,\n): { major: PathCommand[]; minor: PathCommand[] } {\n const g = gridLines(x, y, subdivisions, overscan);\n const major: PathCommand[] = [];\n const minor: PathCommand[] = [];\n for (const px of g.verticalMajor) major.push({ type: \"M\", x: px, y: g.top }, { type: \"L\", x: px, y: g.bottom });\n for (const px of g.verticalMinor) minor.push({ type: \"M\", x: px, y: g.top }, { type: \"L\", x: px, y: g.bottom });\n for (const py of g.horizontalMajor) major.push({ type: \"M\", x: g.left, y: py }, { type: \"L\", x: g.right, y: py });\n for (const py of g.horizontalMinor) minor.push({ type: \"M\", x: g.left, y: py }, { type: \"L\", x: g.right, y: py });\n return { major, minor };\n}\n\n// Snaps `pos` outward to a stable world position, since the renderer anchors dash\n// phase to the subpath start. It snaps to the line lattice (`n*step + offset`), or\n// to the dash lattice (`n*cycle`, anchored to world 0) when a `cycle` is given.\n// The lattice is the one about 0 whatever an axis's `anchor`: a span only has to\n// reach past the edge.\nfunction snapSpan(pos: number, step: number, offset: number, cycle: number, round: (n: number) => number): number {\n if (cycle > 0) return round(pos / cycle) * cycle;\n if (step <= 0) return pos;\n return round((pos - offset) / step) * step + offset;\n}\n\n/**\n * Emits every line position in `[min, max]` (grown by `overscan`) for spacing\n * `step`, panned by `offset`. The line at tile index `n`, counted from `anchor`,\n * is major when `n` is a multiple of `subdivisions`; `n` is relative to the\n * un-panned lattice, so classification stays stable as the grid scrolls.\n */\nexport function addTiledLines(\n min: number,\n max: number,\n step: number,\n offset: number,\n subdivisions: number,\n overscan: number,\n emit: (pos: number, isMajor: boolean) => void,\n anchor = 0,\n): void {\n if (step <= 0) return;\n // First/last tile index whose panned position is within the overscanned\n // [min, max]. A small epsilon keeps a line that lands exactly on an edge (an\n // anchor at `min`, or a world lattice that reaches it) from being dropped by FP error.\n const eps = step * 1e-6;\n const startN = Math.ceil((min - overscan - offset - anchor - eps) / step);\n const endN = Math.floor((max + overscan - offset - anchor + eps) / step);\n for (let n = startN; n <= endN; n++) {\n const pos = anchor + n * step + offset;\n const isMajor = ((n % subdivisions) + subdivisions) % subdivisions === 0;\n emit(pos, isMajor);\n }\n}\n\n/** Largest layer weight, to overscan the tiling so a thick line stays drawn until fully off the area. */\nexport function maxWeight(strokes: StrokeResolved[]): number {\n let max = 0;\n for (const s of strokes) if (s.weight > max) max = s.weight;\n return max;\n}\n\n/** Every layer centred: grid lines are open paths, so inside/outside alignment means nothing. Makes explicit what the renderer does and ignores any author `align`. */\nexport function centered(strokes: StrokeResolved[]): StrokeResolved[] {\n return strokes.map(s => (s.align === 0 ? s : { ...s, align: 0 }));\n}\n\n/** The default minor-line stroke is the major one with every fill's opacity scaled by `factor`. */\nexport function dimStroke(strokes: StrokeResolved[], factor: number): StrokeResolved[] {\n return strokeOps.resolve(strokes.map(s => ({\n ...s,\n fill: s.fill.map(f => ({ ...f, opacity: (f.opacity ?? 1) * factor })),\n })) as unknown as StrokeProp[]);\n}\n\nconst SUB_STROKES = new WeakMap<object, StrokeResolved[]>();\n\n/**\n * The minor-line stroke of a pattern built with a `stroke` and no `subStroke`:\n * the major one at half opacity, when it was built with minor lines. Read off\n * what the pattern was built with (`given`), so it is not kept in step with a\n * stroke written later.\n */\nexport function defaultSubStroke(given: Readonly<Record<string, unknown>>): StrokeResolved[] {\n let sub = SUB_STROKES.get(given);\n if (!sub) {\n const stroke = valueOf(given.stroke) as Stroke | undefined;\n const subdivisions = (valueOf(given.subdivisions) as number | undefined) ?? 1;\n sub = stroke !== undefined && subdivisions > 1 ? dimStroke(strokeOps.resolve(stroke), 0.5) : [];\n SUB_STROKES.set(given, sub);\n }\n return sub;\n}\n\n/** A prop as given, a binding read once. */\nfunction valueOf(prop: unknown): unknown {\n return typeof prop === \"function\" ? (prop as () => unknown)() : prop;\n}\n", "import {\n Camera,\n Flow,\n Graphics2D,\n Paint,\n type BoxBounds,\n type ChildView,\n type Measurer,\n type Placement2D,\n type RenderContext,\n type Size2D,\n type Values,\n // Named so the emitted declaration reaches these through the sdk, not core.\n type Alignment as _Alignment,\n type Fill as _Fill,\n type FillResolved as _FillResolved,\n type FlowMode as _FlowMode,\n type FlowResolved as _FlowResolved,\n type GapSize as _GapSize,\n type Shadow as _Shadow,\n type ShadowResolved as _ShadowResolved,\n type Stroke as _Stroke,\n type StrokeResolved as _StrokeResolved,\n type Vector2 as _Vector2,\n} from \"@motionscript/sdk\";\n\n/**\n * What a pattern filling the camera's visible region shares: spread `state` and\n * `commands` in, pass `measure` and `layout`, and draw with {@link draw}. Inside a\n * `Camera` the pattern is handed the world region it can see, so it only generates\n * geometry for what is on screen; with none it fills its own box. It is laid out at\n * the camera's centre, so its draw space shares the world origin its siblings use.\n * A pattern is a shape: paints, and children laid out like a rect's.\n */\nexport const state = { ...Paint.state, ...Flow.state };\n\nexport const commands = { ...Paint.commands };\n\ntype ShapeState = Flow.FlowState & Values<typeof Paint.state>;\n\nexport function measure(measurer: Measurer, s: ShapeState, children: readonly ChildView[]): Size2D {\n return Flow.measure(measurer, s, children, Paint.inset(s));\n}\n\nexport function layout(box: BoxBounds, s: ShapeState, children: readonly ChildView[]): readonly Placement2D[] {\n return Flow.layout(box, s, children, Paint.inset(s));\n}\n\n/** The world rect the nearest `Camera` sees, in the pattern's draw space, else its own box. */\nexport function visibleBounds(ctx: RenderContext): BoxBounds {\n const camera = ctx.ancestor(Camera);\n if (!camera) return { x: 0, y: 0, width: ctx.size.width, height: ctx.size.height };\n\n const { width: vw, height: vh } = camera.size;\n const zoom = camera.state.zoom || 1;\n const heading = camera.state.heading;\n\n const hw = vw / 2 / zoom;\n const hh = vh / 2 / zoom;\n\n // With a heading the visible rect is rotated; its axis-aligned bounding box covers the full extent.\n let bw = hw;\n let bh = hh;\n if (heading !== 0) {\n const rad = (heading * Math.PI) / 180;\n const cos = Math.abs(Math.cos(rad));\n const sin = Math.abs(Math.sin(rad));\n bw = hw * cos + hh * sin;\n bh = hw * sin + hh * cos;\n }\n\n // Centred on the camera's `lookAt`, in y-up world space.\n const lookAt = camera.state.lookAt;\n return { x: lookAt.x, y: lookAt.y, width: bw * 2, height: bh * 2 };\n}\n\n/**\n * Paints `pattern` over the visible region, then the children. Clipped to the\n * region so overscanned geometry trims cleanly even with no camera. A path drawn\n * here takes `centerBounds` of `[bounds.x - w/2, bounds.y - h/2, bounds.x + w/2, bounds.y + h/2]`.\n */\nexport function draw(ctx: RenderContext, pattern: (bounds: BoxBounds) => void): void {\n const bounds = visibleBounds(ctx);\n const region = new Graphics2D().rect({ x: bounds.x, y: bounds.y, width: bounds.width, height: bounds.height });\n ctx.inFront(() => ctx.clip(region, () => pattern(bounds)));\n ctx.children();\n}\n"],
5
- "mappings": "0FAAA,OAAS,aAAAA,MAAsF,oBAuCzF,SAAUC,EACZC,EACAC,EACAC,EACAC,EACAC,EAAQ,EAAC,CAET,IAAMC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an", "cycle", "verticalMajor", "verticalMinor", "horizontalMajor", "horizontalMinor", "top", "snapSpan", "bottom", "left", "right", "addTiledLines", "px", "isMajor", "py", "gridLinePaths", "g", "major", "minor", "pos", "step", "offset", "round", "min", "max", "emit", "anchor", "eps", "startN", "endN", "n", "maxWeight", "strokes", "s", "centered", "dimStroke", "factor", "f", "SUB_STROKES", "defaultSubStroke", "given", "sub", "stroke", "valueOf", "prop", "viewport_pattern_exports", "__export", "commands", "draw", "layout", "measure", "state", "visibleBounds", "Camera", "Flow", "Graphics2D", "Paint", "measurer", "s", "children", "box", "ctx", "camera", "vw", "vh", "zoom", "heading", "hw", "hh", "bw", "bh", "rad", "cos", "sin", "lookAt", "pattern", "bounds", "region"]
7
- }