@motionscript/patterns 0.1.0 → 0.1.1-alpha.1
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 +21 -0
- package/dist/browser/chunks/{chunk-FXDYEY4R.js → chunk-DRFXMB3M.js} +1 -1
- package/dist/browser/chunks/chunk-DRFXMB3M.js.map +7 -0
- package/dist/browser/index.js +1 -1
- package/dist/browser/index.js.map +3 -3
- package/dist/browser/kit.js +1 -1
- package/dist/browser/manifest.json +1 -1
- package/dist/dot-grid-pattern/dot-grid-pattern.d.ts +17 -36
- package/dist/dot-grid-pattern/dot-grid-pattern.d.ts.map +1 -1
- package/dist/dot-grid-pattern/dot-grid-pattern.js +13 -23
- package/dist/dot-grid-pattern/dot-grid-pattern.js.map +1 -1
- package/dist/engine.d.ts +3 -8
- package/dist/engine.d.ts.map +1 -1
- package/dist/engine.js +3 -8
- package/dist/engine.js.map +1 -1
- package/dist/grid-pattern/grid-pattern.d.ts +4 -7
- package/dist/grid-pattern/grid-pattern.d.ts.map +1 -1
- package/dist/grid-pattern/grid-pattern.js +16 -24
- package/dist/grid-pattern/grid-pattern.js.map +1 -1
- package/dist/kit/grid-lines.d.ts +24 -66
- package/dist/kit/grid-lines.d.ts.map +1 -1
- package/dist/kit/grid-lines.js +24 -52
- package/dist/kit/grid-lines.js.map +1 -1
- package/dist/kit/viewport-pattern.d.ts +10 -27
- package/dist/kit/viewport-pattern.d.ts.map +1 -1
- package/dist/kit/viewport-pattern.js +12 -33
- package/dist/kit/viewport-pattern.js.map +1 -1
- package/dist/line-grid-pattern/line-grid-pattern.d.ts +0 -2
- package/dist/line-grid-pattern/line-grid-pattern.d.ts.map +1 -1
- package/dist/line-grid-pattern/line-grid-pattern.js +0 -2
- package/dist/line-grid-pattern/line-grid-pattern.js.map +1 -1
- package/dist/nodes.d.ts +0 -12
- package/dist/nodes.d.ts.map +1 -1
- package/dist/nodes.js.map +1 -1
- package/package.json +4 -4
- package/src/dot-grid-pattern/dot-grid-pattern.ts +15 -33
- package/src/engine.ts +3 -8
- package/src/grid-pattern/grid-pattern.ts +17 -25
- package/src/kit/grid-lines.ts +30 -81
- package/src/kit/viewport-pattern.ts +12 -34
- package/src/line-grid-pattern/line-grid-pattern.ts +0 -4
- package/src/nodes.ts +0 -12
- package/dist/browser/chunks/chunk-FXDYEY4R.js.map +0 -7
package/src/kit/grid-lines.ts
CHANGED
|
@@ -1,49 +1,26 @@
|
|
|
1
1
|
import { strokeOps, type PathCommand, type Stroke, type StrokeProp, type StrokeResolved } from "@motionscript/sdk";
|
|
2
2
|
|
|
3
|
-
/**
|
|
4
|
-
* Shared geometry for line grids. Both {@link LineGridPattern} (a fixed grid filling
|
|
5
|
-
* its layout rect) and {@link GridPattern} (an infinite grid tiled across the
|
|
6
|
-
* camera's visible region) build the same multi-subpath line paths from these
|
|
7
|
-
* helpers — they differ only in how the extent and step are chosen.
|
|
8
|
-
*
|
|
9
|
-
* Lines are tiled by the minor step and panned by an origin offset: every
|
|
10
|
-
* position within the extent (grown by `overscan` so thick lines clip out
|
|
11
|
-
* smoothly) is emitted regardless of the offset, so the area always stays full
|
|
12
|
-
* and animating the offset scrolls the grid. The lattice starts at the axis's
|
|
13
|
-
* `anchor` (the world origin unless it says otherwise). A tile whose index
|
|
14
|
-
* aligns to the division grid is major; the rest are minor. Each is built as a
|
|
15
|
-
* single multi-subpath path so the trailing stroke paints every line as one
|
|
16
|
-
* union with no destructive boolean op (which would erase the open lines).
|
|
17
|
-
*/
|
|
18
|
-
|
|
19
3
|
/** A grid extent on one axis: lines tile within `[min, max]`, on a lattice that starts at `anchor`. */
|
|
20
4
|
export interface GridAxis {
|
|
21
|
-
/** Minimum coordinate (typically negative). */
|
|
22
5
|
min: number;
|
|
23
|
-
/** Maximum coordinate. */
|
|
24
6
|
max: number;
|
|
25
7
|
/** Spacing between adjacent (minor) lines. */
|
|
26
8
|
step: number;
|
|
27
|
-
/** Pan offset in pixels
|
|
9
|
+
/** Pan offset in pixels. */
|
|
28
10
|
offset: number;
|
|
29
11
|
/**
|
|
30
12
|
* Where the lattice starts: a line sits at `anchor + n * step`, and the tile
|
|
31
|
-
* index `n` that decides which lines are major counts from there. Omitted it is
|
|
32
|
-
* world origin, which
|
|
33
|
-
* own sets it to `min`, so the box's edges are lines whatever the count
|
|
13
|
+
* index `n` that decides which lines are major counts from there. Omitted it is
|
|
14
|
+
* 0, the world origin, which a camera-following grid keeps. A grid with a box of
|
|
15
|
+
* its own sets it to `min`, so the box's edges are lines whatever the cell count.
|
|
34
16
|
*/
|
|
35
17
|
anchor?: number;
|
|
36
18
|
}
|
|
37
19
|
|
|
38
|
-
/**
|
|
39
|
-
|
|
40
|
-
* at y = `horizontalY[i]` and run from `left` to `right`. Positions are split
|
|
41
|
-
* into major (division) and minor (subdivision) lines. */
|
|
42
|
-
export interface GridLines {
|
|
43
|
-
/** y-extent every vertical line spans. */
|
|
20
|
+
/** Where each line sits, split into major (division) and minor (subdivision) lines. Vertical lines run `top` to `bottom`, horizontal ones `left` to `right`. */
|
|
21
|
+
interface GridLines {
|
|
44
22
|
top: number;
|
|
45
23
|
bottom: number;
|
|
46
|
-
/** x-extent every horizontal line spans. */
|
|
47
24
|
left: number;
|
|
48
25
|
right: number;
|
|
49
26
|
verticalMajor: number[];
|
|
@@ -53,18 +30,12 @@ export interface GridLines {
|
|
|
53
30
|
}
|
|
54
31
|
|
|
55
32
|
/**
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
* it doesn't crawl).
|
|
63
|
-
*
|
|
64
|
-
* `cycle` (the dash period, when dashed) snaps the cross-axis span to a whole
|
|
65
|
-
* number of dash cycles too, so each parallel line is the same dash-aligned
|
|
66
|
-
* length and the renderer's per-path dash-fit becomes a no-op (no per-frame
|
|
67
|
-
* resizing of the dashes as lines enter and leave view).
|
|
33
|
+
* The cross-axis spans and the major/minor line positions per axis. Spans are
|
|
34
|
+
* grown by `overscan` so a thick line slides out under the clip instead of
|
|
35
|
+
* popping, and snapped outward so a line's start stays fixed as the camera pans
|
|
36
|
+
* (a dashed stroke anchored to it would otherwise crawl). `cycle`, the dash
|
|
37
|
+
* period, snaps the span to whole dash cycles too, so every parallel line is the
|
|
38
|
+
* same length and the renderer's per-path dash-fit is a no-op.
|
|
68
39
|
*/
|
|
69
40
|
export function gridLines(
|
|
70
41
|
x: GridAxis,
|
|
@@ -78,8 +49,6 @@ export function gridLines(
|
|
|
78
49
|
const horizontalMajor: number[] = [];
|
|
79
50
|
const horizontalMinor: number[] = [];
|
|
80
51
|
|
|
81
|
-
// Span each line across the cross axis, snapped outward to the grid (and to
|
|
82
|
-
// the dash cycle when dashed) so the endpoints sit on stable world positions.
|
|
83
52
|
const top = snapSpan(y.min - overscan, y.step, y.offset, cycle, Math.floor);
|
|
84
53
|
const bottom = snapSpan(y.max + overscan, y.step, y.offset, cycle, Math.ceil);
|
|
85
54
|
const left = snapSpan(x.min - overscan, x.step, x.offset, cycle, Math.floor);
|
|
@@ -96,11 +65,10 @@ export function gridLines(
|
|
|
96
65
|
}
|
|
97
66
|
|
|
98
67
|
/**
|
|
99
|
-
*
|
|
100
|
-
*
|
|
101
|
-
*
|
|
102
|
-
*
|
|
103
|
-
* draw per line from {@link gridLines} instead.
|
|
68
|
+
* The lines as one multi-subpath path per group (major, minor), so each stroke
|
|
69
|
+
* paints as a union with no destructive boolean op, which would erase open lines.
|
|
70
|
+
* For solid strokes; dashed strokes that must stay world-locked draw per line from
|
|
71
|
+
* {@link gridLines}.
|
|
104
72
|
*/
|
|
105
73
|
export function gridLinePaths(
|
|
106
74
|
x: GridAxis,
|
|
@@ -118,14 +86,11 @@ export function gridLinePaths(
|
|
|
118
86
|
return { major, minor };
|
|
119
87
|
}
|
|
120
88
|
|
|
121
|
-
//
|
|
122
|
-
//
|
|
123
|
-
//
|
|
124
|
-
// is
|
|
125
|
-
//
|
|
126
|
-
// per-path dash-fit stays a no-op. `round` is `Math.floor` to snap below, `ceil`
|
|
127
|
-
// to snap above. The lattice is the one about 0 whatever an axis's `anchor`: a span
|
|
128
|
-
// only has to reach past the edge, and a line's ends stay where they always were.
|
|
89
|
+
// Snaps `pos` outward to a stable world position, since the renderer anchors dash
|
|
90
|
+
// phase to the subpath start. It snaps to the line lattice (`n*step + offset`), or
|
|
91
|
+
// to the dash lattice (`n*cycle`, anchored to world 0) when a `cycle` is given.
|
|
92
|
+
// The lattice is the one about 0 whatever an axis's `anchor`: a span only has to
|
|
93
|
+
// reach past the edge.
|
|
129
94
|
function snapSpan(pos: number, step: number, offset: number, cycle: number, round: (n: number) => number): number {
|
|
130
95
|
if (cycle > 0) return round(pos / cycle) * cycle;
|
|
131
96
|
if (step <= 0) return pos;
|
|
@@ -133,17 +98,10 @@ function snapSpan(pos: number, step: number, offset: number, cycle: number, roun
|
|
|
133
98
|
}
|
|
134
99
|
|
|
135
100
|
/**
|
|
136
|
-
*
|
|
137
|
-
*
|
|
138
|
-
*
|
|
139
|
-
*
|
|
140
|
-
* `subdivisions`. The pan shifts each position by `offset` while keeping the
|
|
141
|
-
* area full, so `n` is taken relative to the un-panned lattice (offset folded
|
|
142
|
-
* out) to keep classification stable as it scrolls.
|
|
143
|
-
*
|
|
144
|
-
* A fixed grid anchors at `min`, so its first line is on the box's edge and the
|
|
145
|
-
* last is too whenever the extent is a whole number of steps. An infinite grid
|
|
146
|
-
* keeps the default, so its lines stay on the world's lattice.
|
|
101
|
+
* Emits every line position in `[min, max]` (grown by `overscan`) for spacing
|
|
102
|
+
* `step`, panned by `offset`. The line at tile index `n`, counted from `anchor`,
|
|
103
|
+
* is major when `n` is a multiple of `subdivisions`; `n` is relative to the
|
|
104
|
+
* un-panned lattice, so classification stays stable as the grid scrolls.
|
|
147
105
|
*/
|
|
148
106
|
export function addTiledLines(
|
|
149
107
|
min: number,
|
|
@@ -157,40 +115,31 @@ export function addTiledLines(
|
|
|
157
115
|
): void {
|
|
158
116
|
if (step <= 0) return;
|
|
159
117
|
// First/last tile index whose panned position is within the overscanned
|
|
160
|
-
// [min, max].
|
|
161
|
-
// anchor). A small epsilon keeps a line that lands exactly on an edge (an
|
|
118
|
+
// [min, max]. A small epsilon keeps a line that lands exactly on an edge (an
|
|
162
119
|
// anchor at `min`, or a world lattice that reaches it) from being dropped by FP error.
|
|
163
120
|
const eps = step * 1e-6;
|
|
164
121
|
const startN = Math.ceil((min - overscan - offset - anchor - eps) / step);
|
|
165
122
|
const endN = Math.floor((max + overscan - offset - anchor + eps) / step);
|
|
166
123
|
for (let n = startN; n <= endN; n++) {
|
|
167
124
|
const pos = anchor + n * step + offset;
|
|
168
|
-
// mod that stays non-negative for negative n.
|
|
169
125
|
const isMajor = ((n % subdivisions) + subdivisions) % subdivisions === 0;
|
|
170
126
|
emit(pos, isMajor);
|
|
171
127
|
}
|
|
172
128
|
}
|
|
173
129
|
|
|
174
|
-
/** Largest
|
|
175
|
-
* overscan the tiling so a thick line stays drawn until fully off the area. */
|
|
130
|
+
/** Largest layer weight, to overscan the tiling so a thick line stays drawn until fully off the area. */
|
|
176
131
|
export function maxWeight(strokes: StrokeResolved[]): number {
|
|
177
132
|
let max = 0;
|
|
178
133
|
for (const s of strokes) if (s.weight > max) max = s.weight;
|
|
179
134
|
return max;
|
|
180
135
|
}
|
|
181
136
|
|
|
182
|
-
/**
|
|
183
|
-
* lines are open paths, not a closed region, so inside/outside alignment is
|
|
184
|
-
* meaningless — they always straddle their position. (Open paths are already
|
|
185
|
-
* stroked centered by the renderer; this makes the intent explicit and ignores
|
|
186
|
-
* any author `align`.) */
|
|
137
|
+
/** 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`. */
|
|
187
138
|
export function centered(strokes: StrokeResolved[]): StrokeResolved[] {
|
|
188
139
|
return strokes.map(s => (s.align === 0 ? s : { ...s, align: 0 }));
|
|
189
140
|
}
|
|
190
141
|
|
|
191
|
-
/**
|
|
192
|
-
* `factor`. Used to derive the default minor-line stroke from the major one.
|
|
193
|
-
* Every resolved fill carries an `opacity` field, so this is type-uniform. */
|
|
142
|
+
/** The default minor-line stroke is the major one with every fill's opacity scaled by `factor`. */
|
|
194
143
|
export function dimStroke(strokes: StrokeResolved[], factor: number): StrokeResolved[] {
|
|
195
144
|
return strokeOps.resolve(strokes.map(s => ({
|
|
196
145
|
...s,
|
|
@@ -217,7 +166,7 @@ export function defaultSubStroke(given: Readonly<Record<string, unknown>>): Stro
|
|
|
217
166
|
return sub;
|
|
218
167
|
}
|
|
219
168
|
|
|
220
|
-
/** A prop as
|
|
169
|
+
/** A prop as given, a binding read once. */
|
|
221
170
|
function valueOf(prop: unknown): unknown {
|
|
222
171
|
return typeof prop === "function" ? (prop as () => unknown)() : prop;
|
|
223
172
|
}
|
|
@@ -25,24 +25,13 @@ import {
|
|
|
25
25
|
} from "@motionscript/sdk";
|
|
26
26
|
|
|
27
27
|
/**
|
|
28
|
-
* What a
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
* can currently see (from its `zoom`/`lookAt`/`heading`), so it only ever
|
|
35
|
-
* generates geometry for what's on screen, with no oversized node sized for the
|
|
36
|
-
* worst-case pan and zoom. With no `Camera` above it, it fills its own box, so the
|
|
37
|
-
* same pattern doubles as an ordinary full-bleed background.
|
|
38
|
-
*
|
|
39
|
-
* The pattern is itself a camera child, laid out at the camera's centre, so its
|
|
40
|
-
* local draw space shares the world origin its siblings use. The visible region
|
|
41
|
-
* is therefore expressed directly in that space: centred on the camera's
|
|
42
|
-
* `lookAt`, sized to the inverse of the camera transform.
|
|
28
|
+
* What a pattern filling the camera's visible region shares: spread `state` and
|
|
29
|
+
* `commands` in, pass `measure` and `layout`, and draw with {@link draw}. Inside a
|
|
30
|
+
* `Camera` the pattern is handed the world region it can see, so it only generates
|
|
31
|
+
* geometry for what is on screen; with none it fills its own box. It is laid out at
|
|
32
|
+
* the camera's centre, so its draw space shares the world origin its siblings use.
|
|
33
|
+
* A pattern is a shape: paints, and children laid out like a rect's.
|
|
43
34
|
*/
|
|
44
|
-
|
|
45
|
-
/** A pattern is a shape: paints, and children laid out like a rect's. */
|
|
46
35
|
export const state = { ...Paint.state, ...Flow.state };
|
|
47
36
|
|
|
48
37
|
export const commands = { ...Paint.commands };
|
|
@@ -57,10 +46,7 @@ export function layout(box: BoxBounds, s: ShapeState, children: readonly ChildVi
|
|
|
57
46
|
return Flow.layout(box, s, children, Paint.inset(s));
|
|
58
47
|
}
|
|
59
48
|
|
|
60
|
-
/**
|
|
61
|
-
* The region the pattern covers, in its own draw space: the world rect the
|
|
62
|
-
* nearest `Camera` above it sees, or its own box when there is none.
|
|
63
|
-
*/
|
|
49
|
+
/** The world rect the nearest `Camera` sees, in the pattern's draw space, else its own box. */
|
|
64
50
|
export function visibleBounds(ctx: RenderContext): BoxBounds {
|
|
65
51
|
const camera = ctx.ancestor(Camera);
|
|
66
52
|
if (!camera) return { x: 0, y: 0, width: ctx.size.width, height: ctx.size.height };
|
|
@@ -69,12 +55,10 @@ export function visibleBounds(ctx: RenderContext): BoxBounds {
|
|
|
69
55
|
const zoom = camera.state.zoom || 1;
|
|
70
56
|
const heading = camera.state.heading;
|
|
71
57
|
|
|
72
|
-
// Inverse of the camera scale: a viewport `vw×vh` shows `vw/zoom × vh/zoom` of the world.
|
|
73
58
|
const hw = vw / 2 / zoom;
|
|
74
59
|
const hh = vh / 2 / zoom;
|
|
75
60
|
|
|
76
|
-
// With a heading the visible
|
|
77
|
-
// bounding box so the pattern covers the rotated viewport's full extent.
|
|
61
|
+
// With a heading the visible rect is rotated; its axis-aligned bounding box covers the full extent.
|
|
78
62
|
let bw = hw;
|
|
79
63
|
let bh = hh;
|
|
80
64
|
if (heading !== 0) {
|
|
@@ -85,21 +69,15 @@ export function visibleBounds(ctx: RenderContext): BoxBounds {
|
|
|
85
69
|
bh = hw * sin + hh * cos;
|
|
86
70
|
}
|
|
87
71
|
|
|
88
|
-
// Centred on the camera's `lookAt`, in y-up world space
|
|
89
|
-
// convention; the renderer applies the single y-up→canvas flip when the
|
|
90
|
-
// pattern's shapes are drawn).
|
|
72
|
+
// Centred on the camera's `lookAt`, in y-up world space.
|
|
91
73
|
const lookAt = camera.state.lookAt;
|
|
92
74
|
return { x: lookAt.x, y: lookAt.y, width: bw * 2, height: bh * 2 };
|
|
93
75
|
}
|
|
94
76
|
|
|
95
77
|
/**
|
|
96
|
-
*
|
|
97
|
-
*
|
|
98
|
-
*
|
|
99
|
-
* (so thick lines slide out instead of popping) trims cleanly. Inside a camera
|
|
100
|
-
* the viewport already clips, but this keeps edge strokes clean and bounds the
|
|
101
|
-
* work with no camera too. A `centerBounds` for a path drawn here is
|
|
102
|
-
* `[bounds.x - w/2, bounds.y - h/2, bounds.x + w/2, bounds.y + h/2]`.
|
|
78
|
+
* Paints `pattern` over the visible region, then the children. Clipped to the
|
|
79
|
+
* region so overscanned geometry trims cleanly even with no camera. A path drawn
|
|
80
|
+
* here takes `centerBounds` of `[bounds.x - w/2, bounds.y - h/2, bounds.x + w/2, bounds.y + h/2]`.
|
|
103
81
|
*/
|
|
104
82
|
export function draw(ctx: RenderContext, pattern: (bounds: BoxBounds) => void): void {
|
|
105
83
|
const bounds = visibleBounds(ctx);
|
|
@@ -86,11 +86,7 @@ export const LineGridPattern = component2d({
|
|
|
86
86
|
});
|
|
87
87
|
|
|
88
88
|
export type LineGridPattern = NodeOf<typeof LineGridPattern>;
|
|
89
|
-
/** What a call or a document row may set. */
|
|
90
|
-
export type LineGridPatternProps = NonNullable<Parameters<typeof LineGridPattern>[0]>;
|
|
91
89
|
|
|
92
|
-
// One multi-subpath path per group, so each stroke paints its lines as a union with no
|
|
93
|
-
// destructive boolean op (which would erase open lines).
|
|
94
90
|
function gridPaths(
|
|
95
91
|
width: number,
|
|
96
92
|
height: number,
|
package/src/nodes.ts
CHANGED
|
@@ -2,18 +2,6 @@ import { DotGridPattern } from "./dot-grid-pattern"
|
|
|
2
2
|
import { GridPattern } from "./grid-pattern"
|
|
3
3
|
import { LineGridPattern } from "./line-grid-pattern"
|
|
4
4
|
|
|
5
|
-
/**
|
|
6
|
-
* Every node type this package publishes.
|
|
7
|
-
*
|
|
8
|
-
* A host registers these by handing the array to an engine —
|
|
9
|
-
* `new Engine(platform, { nodes: NODES })` — which reads each component's key.
|
|
10
|
-
* Defining a component only *declares* that key: nothing is registered by
|
|
11
|
-
* importing a module, so a registry holds exactly what its owner asked for.
|
|
12
|
-
*
|
|
13
|
-
* Listing the component **values** is also what survives bundling: this package
|
|
14
|
-
* declares `sideEffects: false`, and a document names a node type by string, so
|
|
15
|
-
* an import kept only for its side effect is exactly what gets shaken out.
|
|
16
|
-
*/
|
|
17
5
|
// Typed by name, so the declaration names each component rather than spelling out its type through core.
|
|
18
6
|
type KitNode =
|
|
19
7
|
| typeof LineGridPattern
|
|
@@ -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/**\n * Shared geometry for line grids. Both {@link LineGridPattern} (a fixed grid filling\n * its layout rect) and {@link GridPattern} (an infinite grid tiled across the\n * camera's visible region) build the same multi-subpath line paths from these\n * helpers — they differ only in how the extent and step are chosen.\n *\n * Lines are tiled by the minor step and panned by an origin offset: every\n * position within the extent (grown by `overscan` so thick lines clip out\n * smoothly) is emitted regardless of the offset, so the area always stays full\n * and animating the offset scrolls the grid. The lattice starts at the axis's\n * `anchor` (the world origin unless it says otherwise). A tile whose index\n * aligns to the division grid is major; the rest are minor. Each is built as a\n * single multi-subpath path so the trailing stroke paints every line as one\n * union with no destructive boolean op (which would erase the open lines).\n */\n\n/** A grid extent on one axis: lines tile within `[min, max]`, on a lattice that starts at `anchor`. */\nexport interface GridAxis {\n /** Minimum coordinate (typically negative). */\n min: number;\n /** Maximum coordinate. */\n max: number;\n /** Spacing between adjacent (minor) lines. */\n step: number;\n /** Pan offset in pixels along this axis. */\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 0, the\n * world origin, which is what a grid that follows a camera keeps. A grid with a box of its\n * own sets it to `min`, so the box's edges are lines whatever the count of cells.\n */\n anchor?: number;\n}\n\n/** The resolved grid: where each line sits and how far it runs. Vertical lines\n * sit at x = `verticalX[i]` and run from `top` to `bottom`; horizontal lines sit\n * at y = `horizontalY[i]` and run from `left` to `right`. Positions are split\n * into major (division) and minor (subdivision) lines. */\nexport interface GridLines {\n /** y-extent every vertical line spans. */\n top: number;\n bottom: number;\n /** x-extent every horizontal line spans. */\n left: number;\n right: number;\n verticalMajor: number[];\n verticalMinor: number[];\n horizontalMajor: number[];\n horizontalMinor: number[];\n}\n\n/**\n * Resolve the grid for the given per-axis extents: the cross-axis span and the\n * major/minor line positions on each axis. Vertical lines span the full y\n * extent; horizontal lines span the full x extent. Both spans are grown by\n * `overscan` so a thick line slides out under the clip instead of popping, and\n * snapped outward to the grid so the endpoints sit on stable world positions\n * (a line's start stays fixed as the camera pans, so a dashed stroke anchored to\n * it doesn't crawl).\n *\n * `cycle` (the dash period, when dashed) snaps the cross-axis span to a whole\n * number of dash cycles too, so each parallel line is the same dash-aligned\n * length and the renderer's per-path dash-fit becomes a no-op (no per-frame\n * resizing of the dashes as lines enter and leave view).\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 // Span each line across the cross axis, snapped outward to the grid (and to\n // the dash cycle when dashed) so the endpoints sit on stable world positions.\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 * Build the grid lines as multi-subpath path commands, split into the major\n * (division) lines and the minor (subdivision) lines, for the given per-axis\n * extents. Every line in a group shares one stroke (drawn as one union path), so\n * this is the path for solid strokes; dashed strokes that must stay world-locked\n * draw per line from {@link gridLines} instead.\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// Snap `pos` outward to a stable world position so a dashed line's start stays\n// fixed as the viewport moves (the renderer anchors dash phase to the subpath\n// start). Snap to the grid line lattice (`n*step + offset`); when a dash `cycle`\n// is given, snap to the dash lattice instead (`n*cycle`, anchored to world 0) so\n// every parallel line is the same whole number of cycles long and the renderer's\n// per-path dash-fit stays a no-op. `round` is `Math.floor` to snap below, `ceil`\n// to snap above. The lattice is the one about 0 whatever an axis's `anchor`: a span\n// only has to reach past the edge, and a line's ends stay where they always were.\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 * Emit every grid line position in `[min, max]` (grown by `overscan` on each\n * end) for a grid of spacing `step`, panned by `offset` px. Without panning the\n * lattice starts at `anchor` (0 unless given) and its tile indices count outward\n * from there; the line at tile index `n` is major when `n` is a multiple of\n * `subdivisions`. The pan shifts each position by `offset` while keeping the\n * area full, so `n` is taken relative to the un-panned lattice (offset folded\n * out) to keep classification stable as it scrolls.\n *\n * A fixed grid anchors at `min`, so its first line is on the box's edge and the\n * last is too whenever the extent is a whole number of steps. An infinite grid\n * keeps the default, so its lines stay on the world's lattice.\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]. Positions are `anchor + n*step + offset` (n=0 sits on the\n // anchor). 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 // mod that stays non-negative for negative n.\n const isMajor = ((n % subdivisions) + subdivisions) % subdivisions === 0;\n emit(pos, isMajor);\n }\n}\n\n/** Largest stroke weight across the layers of a resolved stroke array. Used to\n * 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/** Force every layer of a resolved stroke array to centered alignment. Grid\n * lines are open paths, not a closed region, so inside/outside alignment is\n * meaningless — they always straddle their position. (Open paths are already\n * stroked centered by the renderer; this makes the intent explicit and ignores\n * any author `align`.) */\nexport function centered(strokes: StrokeResolved[]): StrokeResolved[] {\n return strokes.map(s => (s.align === 0 ? s : { ...s, align: 0 }));\n}\n\n/** Copy a resolved stroke array with every fill layer's opacity scaled by\n * `factor`. Used to derive the default minor-line stroke from the major one.\n * Every resolved fill carries an `opacity` field, so this is type-uniform. */\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 it stood when 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 background that fills whatever region is currently visible shares,\n * rather than a fixed rect: `GridPattern` is built from it, and so is a pattern\n * of your own. Spread `state` and `commands` in, pass `measure` and `layout`, and\n * draw with {@link draw}.\n *\n * Placed inside a `Camera`, the pattern is handed the world region the camera\n * can currently see (from its `zoom`/`lookAt`/`heading`), so it only ever\n * generates geometry for what's on screen, with no oversized node sized for the\n * worst-case pan and zoom. With no `Camera` above it, it fills its own box, so the\n * same pattern doubles as an ordinary full-bleed background.\n *\n * The pattern is itself a camera child, laid out at the camera's centre, so its\n * local draw space shares the world origin its siblings use. The visible region\n * is therefore expressed directly in that space: centred on the camera's\n * `lookAt`, sized to the inverse of the camera transform.\n */\n\n/** A pattern is a shape: paints, and children laid out like a rect's. */\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/**\n * The region the pattern covers, in its own draw space: the world rect the\n * nearest `Camera` above it sees, or its own box when there is none.\n */\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 // Inverse of the camera scale: a viewport `vw×vh` shows `vw/zoom × vh/zoom` of the world.\n const hw = vw / 2 / zoom;\n const hh = vh / 2 / zoom;\n\n // With a heading the visible world rect is rotated; take its axis-aligned\n // bounding box so the pattern covers the rotated viewport's 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 (the descriptor\n // convention; the renderer applies the single y-up→canvas flip when the\n // pattern's shapes are drawn).\n const lookAt = camera.state.lookAt;\n return { x: lookAt.x, y: lookAt.y, width: bw * 2, height: bh * 2 };\n}\n\n/**\n * Paint `pattern` over the visible region, once per render, then the children.\n *\n * The pattern is clipped to the region, so geometry overscanned past the edge\n * (so thick lines slide out instead of popping) trims cleanly. Inside a camera\n * the viewport already clips, but this keeps edge strokes clean and bounds the\n * work with no camera too. A `centerBounds` for a path drawn here is\n * `[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,oBAoEzF,SAAUC,EACZC,EACAC,EACAC,EACAC,EACAC,EAAQ,EAAC,CAET,IAAMC,EAA0B,CAAA,EAC1BC,EAA0B,CAAA,EAC1BC,EAA4B,CAAA,EAC5BC,EAA4B,CAAA,EAI5BC,EAAMC,EAAST,EAAE,IAAME,EAAUF,EAAE,KAAMA,EAAE,OAAQG,EAAO,KAAK,KAAK,EACpEO,EAASD,EAAST,EAAE,IAAME,EAAUF,EAAE,KAAMA,EAAE,OAAQG,EAAO,KAAK,IAAI,EACtEQ,EAAOF,EAASV,EAAE,IAAMG,EAAUH,EAAE,KAAMA,EAAE,OAAQI,EAAO,KAAK,KAAK,EACr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AAKF,EAAO,KACnCG,EAAOH,EAAO,MAAM,MAAQ,EAC5BI,EAAUJ,EAAO,MAAM,QAGvBK,EAAKJ,EAAK,EAAIE,EACdG,EAAKJ,EAAK,EAAIC,EAIhBI,EAAKF,EACLG,EAAKF,EACT,GAAIF,IAAY,EAAG,CACf,IAAMK,EAAOL,EAAU,KAAK,GAAM,IAC5BM,EAAM,KAAK,IAAI,KAAK,IAAID,CAAG,CAAC,EAC5BE,EAAM,KAAK,IAAI,KAAK,IAAIF,CAAG,CAAC,EAClCF,EAAKF,EAAKK,EAAMJ,EAAKK,EACrBH,EAAKH,EAAKM,EAAML,EAAKI,CACzB,CAKA,IAAME,EAASZ,EAAO,MAAM,OAC5B,MAAO,CAAE,EAAGY,EAAO,EAAG,EAAGA,EAAO,EAAG,MAAOL,EAAK,EAAG,OAAQC,EAAK,CAAC,CACpE,CAWM,SAAUtB,EAAKa,EAAoBc,EAAoC,CACzE,IAAMC,EAASxB,EAAcS,CAAG,EAC1BgB,EAAS,IAAItB,EAAU,EAAG,KAAK,CAAE,EAAGqB,EAAO,EAAG,EAAGA,EAAO,EAAG,MAAOA,EAAO,MAAO,OAAQA,EAAO,MAAM,CAAE,EAC7Gf,EAAI,QAAQ,IAAMA,EAAI,KAAKgB,EAAQ,IAAMF,EAAQC,CAAM,CAAC,CAAC,EACzDf,EAAI,SAAQ,CAChB",
|
|
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"]
|
|
7
|
-
}
|