@motionscript/patterns 0.1.0-alpha.5 → 0.1.0-alpha.7
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 +24 -0
- package/README.md +13 -9
- package/dist/browser/chunks/chunk-REWLNFZ2.js +2 -0
- package/dist/browser/chunks/chunk-REWLNFZ2.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 +104 -27
- package/dist/dot-grid-pattern/dot-grid-pattern.d.ts.map +1 -1
- package/dist/dot-grid-pattern/dot-grid-pattern.js +71 -75
- package/dist/dot-grid-pattern/dot-grid-pattern.js.map +1 -1
- package/dist/engine.d.ts +4 -4
- package/dist/engine.js +4 -4
- package/dist/engine.js.map +1 -1
- package/dist/grid-pattern/grid-pattern.d.ts +89 -26
- package/dist/grid-pattern/grid-pattern.d.ts.map +1 -1
- package/dist/grid-pattern/grid-pattern.js +83 -102
- package/dist/grid-pattern/grid-pattern.js.map +1 -1
- package/dist/kit/grid-lines.d.ts +7 -0
- package/dist/kit/grid-lines.d.ts.map +1 -1
- package/dist/kit/grid-lines.js +21 -0
- package/dist/kit/grid-lines.js.map +1 -1
- package/dist/kit/index.d.ts +1 -1
- package/dist/kit/index.d.ts.map +1 -1
- package/dist/kit/index.js +1 -1
- package/dist/kit/index.js.map +1 -1
- package/dist/kit/viewport-pattern.d.ts +75 -30
- package/dist/kit/viewport-pattern.d.ts.map +1 -1
- package/dist/kit/viewport-pattern.js +66 -69
- package/dist/kit/viewport-pattern.js.map +1 -1
- package/dist/line-grid-pattern/line-grid-pattern.d.ts +86 -23
- package/dist/line-grid-pattern/line-grid-pattern.d.ts.map +1 -1
- package/dist/line-grid-pattern/line-grid-pattern.js +63 -88
- package/dist/line-grid-pattern/line-grid-pattern.js.map +1 -1
- package/dist/nodes.d.ts +8 -3
- package/dist/nodes.d.ts.map +1 -1
- package/dist/nodes.js +5 -10
- package/dist/nodes.js.map +1 -1
- package/package.json +4 -4
- package/src/dot-grid-pattern/dot-grid-pattern.ts +101 -78
- package/src/engine.ts +4 -4
- package/src/grid-pattern/grid-pattern.ts +126 -120
- package/src/kit/grid-lines.ts +25 -1
- package/src/kit/index.ts +1 -1
- package/src/kit/viewport-pattern.ts +89 -78
- package/src/line-grid-pattern/line-grid-pattern.ts +95 -103
- package/src/nodes.ts +16 -3
- package/dist/browser/chunks/chunk-EZEE76AY.js +0 -2
- package/dist/browser/chunks/chunk-EZEE76AY.js.map +0 -7
|
@@ -1,98 +1,109 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Camera,
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
Flow,
|
|
4
|
+
Graphics2D,
|
|
5
|
+
Paint,
|
|
5
6
|
type BoxBounds,
|
|
6
|
-
type
|
|
7
|
-
type
|
|
7
|
+
type ChildView,
|
|
8
|
+
type Measurer,
|
|
9
|
+
type Placement2D,
|
|
10
|
+
type RenderContext,
|
|
11
|
+
type Size2D,
|
|
12
|
+
type Values,
|
|
13
|
+
// Named so the emitted declaration reaches these through the sdk, not core.
|
|
14
|
+
type Alignment as _Alignment,
|
|
15
|
+
type Fill as _Fill,
|
|
16
|
+
type FillResolved as _FillResolved,
|
|
17
|
+
type FlowMode as _FlowMode,
|
|
18
|
+
type FlowResolved as _FlowResolved,
|
|
19
|
+
type GapSize as _GapSize,
|
|
20
|
+
type Shadow as _Shadow,
|
|
21
|
+
type ShadowResolved as _ShadowResolved,
|
|
22
|
+
type Stroke as _Stroke,
|
|
23
|
+
type StrokeResolved as _StrokeResolved,
|
|
24
|
+
type Vector2 as _Vector2,
|
|
8
25
|
} from "@motionscript/sdk";
|
|
9
26
|
|
|
10
27
|
/**
|
|
11
|
-
*
|
|
12
|
-
* than a fixed rect
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* generates geometry for what's on screen — no oversized static node sized for
|
|
16
|
-
* the worst-case pan/zoom.
|
|
28
|
+
* What a background that fills whatever region is currently visible shares,
|
|
29
|
+
* rather than a fixed rect: `GridPattern` is built from it, and so is a pattern
|
|
30
|
+
* of your own. Spread `state` and `commands` in, pass `measure` and `layout`, and
|
|
31
|
+
* draw with {@link draw}.
|
|
17
32
|
*
|
|
18
|
-
*
|
|
33
|
+
* Placed inside a `Camera`, the pattern is handed the world region the camera
|
|
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
|
|
19
37
|
* same pattern doubles as an ordinary full-bleed background.
|
|
20
38
|
*
|
|
21
|
-
* The pattern
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
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.
|
|
25
43
|
*/
|
|
26
|
-
export abstract class ViewportPattern<P extends ShapeProps = ShapeProps> extends ShapeNode<P> {
|
|
27
44
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
* once per render with the currently-visible region. The `centerBounds` for
|
|
31
|
-
* path ops drawn here is `[bounds.x - w/2, bounds.y - h/2, bounds.x + w/2,
|
|
32
|
-
* bounds.y + h/2]`.
|
|
33
|
-
*/
|
|
34
|
-
protected abstract renderPattern(draw: RenderContext2D, bounds: BoxBounds): void;
|
|
45
|
+
/** A pattern is a shape: paints, and children laid out like a rect's. */
|
|
46
|
+
export const state = { ...Paint.state, ...Flow.state };
|
|
35
47
|
|
|
36
|
-
|
|
37
|
-
const bounds = this.visibleBounds();
|
|
38
|
-
// Clip to the visible region so geometry overscanned past the edge (so
|
|
39
|
-
// thick lines slide out instead of popping) trims cleanly. When inside a
|
|
40
|
-
// camera the viewport already clips, but this keeps edge strokes clean
|
|
41
|
-
// and bounds the work in the no-camera fallback too.
|
|
42
|
-
draw.beginClip(new Clip().rect({ x: bounds.x, y: bounds.y, width: bounds.width, height: bounds.height }));
|
|
43
|
-
this.renderPattern(draw, bounds);
|
|
44
|
-
draw.endClip();
|
|
45
|
-
}
|
|
48
|
+
export const commands = { ...Paint.commands };
|
|
46
49
|
|
|
47
|
-
|
|
48
|
-
* The region this node should cover, in its own local draw space. Inside a
|
|
49
|
-
* camera this is the world rect the camera currently sees; otherwise it's the
|
|
50
|
-
* node's own layout rect (a normal background).
|
|
51
|
-
*/
|
|
52
|
-
protected visibleBounds(): BoxBounds {
|
|
53
|
-
const camera = this.findCamera();
|
|
54
|
-
if (!camera) {
|
|
55
|
-
// No camera — fill our own cell, centred on this node's origin.
|
|
56
|
-
const w = this.layoutBounds?.width ?? 0;
|
|
57
|
-
const h = this.layoutBounds?.height ?? 0;
|
|
58
|
-
return { x: 0, y: 0, width: w, height: h };
|
|
59
|
-
}
|
|
50
|
+
type ShapeState = Flow.FlowState & Values<typeof Paint.state>;
|
|
60
51
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
const heading = camera.heading;
|
|
52
|
+
export function measure(measurer: Measurer, s: ShapeState, children: readonly ChildView[]): Size2D {
|
|
53
|
+
return Flow.measure(measurer, s, children, Paint.inset(s));
|
|
54
|
+
}
|
|
65
55
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
const hh = vh / 2 / zoom;
|
|
56
|
+
export function layout(box: BoxBounds, s: ShapeState, children: readonly ChildView[]): readonly Placement2D[] {
|
|
57
|
+
return Flow.layout(box, s, children, Paint.inset(s));
|
|
58
|
+
}
|
|
70
59
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
const sin = Math.abs(Math.sin(rad));
|
|
79
|
-
bw = hw * cos + hh * sin;
|
|
80
|
-
bh = hw * sin + hh * cos;
|
|
81
|
-
}
|
|
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
|
+
*/
|
|
64
|
+
export function visibleBounds(ctx: RenderContext): BoxBounds {
|
|
65
|
+
const camera = ctx.ancestor(Camera);
|
|
66
|
+
if (!camera) return { x: 0, y: 0, width: ctx.size.width, height: ctx.size.height };
|
|
82
67
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
68
|
+
const { width: vw, height: vh } = camera.size;
|
|
69
|
+
const zoom = camera.state.zoom || 1;
|
|
70
|
+
const heading = camera.state.heading;
|
|
71
|
+
|
|
72
|
+
// Inverse of the camera scale: a viewport `vw×vh` shows `vw/zoom × vh/zoom` of the world.
|
|
73
|
+
const hw = vw / 2 / zoom;
|
|
74
|
+
const hh = vh / 2 / zoom;
|
|
90
75
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
76
|
+
// With a heading the visible world rect is rotated; take its axis-aligned
|
|
77
|
+
// bounding box so the pattern covers the rotated viewport's full extent.
|
|
78
|
+
let bw = hw;
|
|
79
|
+
let bh = hh;
|
|
80
|
+
if (heading !== 0) {
|
|
81
|
+
const rad = (heading * Math.PI) / 180;
|
|
82
|
+
const cos = Math.abs(Math.cos(rad));
|
|
83
|
+
const sin = Math.abs(Math.sin(rad));
|
|
84
|
+
bw = hw * cos + hh * sin;
|
|
85
|
+
bh = hw * sin + hh * cos;
|
|
97
86
|
}
|
|
87
|
+
|
|
88
|
+
// Centred on the camera's `lookAt`, in y-up world space (the descriptor
|
|
89
|
+
// convention; the renderer applies the single y-up→canvas flip when the
|
|
90
|
+
// pattern's shapes are drawn).
|
|
91
|
+
const lookAt = camera.state.lookAt;
|
|
92
|
+
return { x: lookAt.x, y: lookAt.y, width: bw * 2, height: bh * 2 };
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Paint `pattern` over the visible region, once per render, then the children.
|
|
97
|
+
*
|
|
98
|
+
* The pattern is clipped to the region, so geometry overscanned past the edge
|
|
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]`.
|
|
103
|
+
*/
|
|
104
|
+
export function draw(ctx: RenderContext, pattern: (bounds: BoxBounds) => void): void {
|
|
105
|
+
const bounds = visibleBounds(ctx);
|
|
106
|
+
const region = new Graphics2D().rect({ x: bounds.x, y: bounds.y, width: bounds.width, height: bounds.height });
|
|
107
|
+
ctx.inFront(() => ctx.clip(region, () => pattern(bounds)));
|
|
108
|
+
ctx.children();
|
|
98
109
|
}
|
|
@@ -1,34 +1,30 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
2
|
+
Flow,
|
|
3
3
|
Graphics2D,
|
|
4
|
-
|
|
4
|
+
Paint,
|
|
5
|
+
Types,
|
|
6
|
+
component2d,
|
|
5
7
|
lerpVector2,
|
|
6
|
-
|
|
7
|
-
property,
|
|
8
|
-
strokeProperty,
|
|
9
|
-
type AssetScope,
|
|
10
|
-
type NodeConfig,
|
|
8
|
+
type NodeOf,
|
|
11
9
|
type PathBounds,
|
|
12
10
|
type PathCommand,
|
|
13
|
-
type RenderContext2D,
|
|
14
|
-
type ShapeProps,
|
|
15
|
-
type Stroke,
|
|
16
|
-
type StrokeResolved,
|
|
17
11
|
type Vector2,
|
|
12
|
+
// Named so the emitted declaration reaches these through the sdk, not core.
|
|
13
|
+
type Alignment as _Alignment,
|
|
14
|
+
type Fill as _Fill,
|
|
15
|
+
type FillResolved as _FillResolved,
|
|
16
|
+
type FlowMode as _FlowMode,
|
|
17
|
+
type FlowResolved as _FlowResolved,
|
|
18
|
+
type GapSize as _GapSize,
|
|
19
|
+
type Node2D as _Node2D,
|
|
20
|
+
type Node2DProps as _Node2DProps,
|
|
21
|
+
type Shadow as _Shadow,
|
|
22
|
+
type ShadowResolved as _ShadowResolved,
|
|
23
|
+
type Stroke as _Stroke,
|
|
24
|
+
type StrokeResolved as _StrokeResolved,
|
|
18
25
|
} from "@motionscript/sdk";
|
|
19
26
|
|
|
20
|
-
import { centered,
|
|
21
|
-
|
|
22
|
-
export interface LineGridPatternProps extends ShapeProps {
|
|
23
|
-
/** Cells along each axis: `divisions` of 4 draws 5 major lines per axis. */
|
|
24
|
-
divisions: number;
|
|
25
|
-
/** Finer cells each division is split into. 1 draws no minor lines; 2 adds one per division. */
|
|
26
|
-
subdivisions: number;
|
|
27
|
-
/** Stroke for the minor lines. Defaults to the major `stroke` at half opacity when `subdivisions > 1`. */
|
|
28
|
-
subStroke?: Stroke;
|
|
29
|
-
/** Pans the grid. Lines wrap and tile, so the rect stays full while `offset` scrolls it. */
|
|
30
|
-
offset: Vector2;
|
|
31
|
-
}
|
|
27
|
+
import { centered, defaultSubStroke, gridLinePaths, maxWeight } from "../kit";
|
|
32
28
|
|
|
33
29
|
/**
|
|
34
30
|
* A rectangular grid of lines filling the node's layout rect.
|
|
@@ -36,90 +32,86 @@ export interface LineGridPatternProps extends ShapeProps {
|
|
|
36
32
|
* `stroke` paints the major lines and `subStroke` the minor ones, each as a
|
|
37
33
|
* single union path. `fill` and `shadow` cover the whole rect, behind the lines.
|
|
38
34
|
*/
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
35
|
+
export const LineGridPattern = component2d({
|
|
36
|
+
key: "lineGridPattern",
|
|
37
|
+
state: {
|
|
38
|
+
...Paint.state,
|
|
39
|
+
...Flow.state,
|
|
40
|
+
/** Cells along each axis: `divisions` of 4 draws 5 major lines per axis. */
|
|
41
|
+
divisions: 4,
|
|
42
|
+
/** Finer cells each division is split into. 1 draws no minor lines; 2 adds one per division. */
|
|
43
|
+
subdivisions: 1,
|
|
44
|
+
/** Stroke for the minor lines. Unset, the major `stroke` at half opacity when `subdivisions > 1`. */
|
|
45
|
+
subStroke: Types.stroke,
|
|
46
|
+
/** Pans the grid. Lines wrap and tile, so the rect stays full while `offset` scrolls it. */
|
|
47
|
+
offset: Types.custom<Vector2>({ x: 0, y: 0 }, { lerp: lerpVector2 }),
|
|
48
|
+
},
|
|
49
|
+
defaults: { subStroke: (_state, given) => defaultSubStroke(given) },
|
|
50
|
+
commands: { ...Paint.commands },
|
|
51
|
+
measure: (measurer, state, children) => Flow.measure(measurer, state, children, Paint.inset(state)),
|
|
52
|
+
layout: (box, state, children) => Flow.layout(box, state, children, Paint.inset(state)),
|
|
53
|
+
render: (ctx, state) => {
|
|
54
|
+
const { width, height } = ctx.size;
|
|
55
|
+
const box = new Graphics2D().rect({ width, height });
|
|
56
|
+
ctx.inFront(() => {
|
|
57
|
+
ctx.draw(new Graphics2D()
|
|
58
|
+
.rect({ width, height, start: state.start, end: state.end })
|
|
59
|
+
.shadow(state.shadow)
|
|
60
|
+
.fill(state.fill));
|
|
58
61
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
for (const stroke of this.subStroke) assets.fill(stroke.fill);
|
|
62
|
-
}
|
|
62
|
+
const divisions = Math.max(1, Math.floor(state.divisions));
|
|
63
|
+
const subdivisions = Math.max(1, Math.floor(state.subdivisions));
|
|
63
64
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
65
|
+
// Lines overscan the rect by half the thickest stroke and are clipped to it, so a
|
|
66
|
+
// thick line slides out under the clip instead of popping at the boundary.
|
|
67
|
+
const major = centered(state.stroke);
|
|
68
|
+
const minorStroke = centered(state.subStroke);
|
|
69
|
+
const overscan = Math.max(maxWeight(major), maxWeight(minorStroke)) / 2;
|
|
70
|
+
const lines = gridPaths(width, height, divisions, subdivisions, overscan, state.offset);
|
|
71
|
+
const centerBounds: PathBounds = [-width / 2, -height / 2, width / 2, height / 2];
|
|
68
72
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
// thick line slides out under the clip instead of popping at the boundary.
|
|
79
|
-
const major = centered(this.stroke as StrokeResolved[]);
|
|
80
|
-
const minorStroke = centered(this.subStroke as StrokeResolved[]);
|
|
81
|
-
const overscan = Math.max(maxWeight(major), maxWeight(minorStroke)) / 2;
|
|
82
|
-
const { major: majorLines, minor: minorLines } = this._gridPaths(width, height, divisions, subdivisions, overscan);
|
|
83
|
-
|
|
84
|
-
draw.beginClip(new Clip().rect({ width, height }));
|
|
85
|
-
// Minor lines first so the major lines sit on top.
|
|
86
|
-
if (subdivisions > 1 && minorStroke.length > 0 && minorLines.length > 0) {
|
|
87
|
-
draw.draw(new Graphics2D()
|
|
88
|
-
.path({ data: minorLines, centerBounds })
|
|
89
|
-
.stroke(minorStroke));
|
|
90
|
-
}
|
|
91
|
-
if (majorLines.length > 0) {
|
|
92
|
-
draw.draw(new Graphics2D()
|
|
93
|
-
.path({ data: majorLines, centerBounds })
|
|
94
|
-
.stroke(major));
|
|
95
|
-
}
|
|
96
|
-
draw.endClip();
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
protected override clipSelf(): Clip {
|
|
100
|
-
return new Clip().rect({
|
|
101
|
-
width: this.layoutBounds.width,
|
|
102
|
-
height: this.layoutBounds.height,
|
|
73
|
+
ctx.clip(box, () => {
|
|
74
|
+
// Minor lines first so the major lines sit on top.
|
|
75
|
+
if (subdivisions > 1 && minorStroke.length > 0 && lines.minor.length > 0) {
|
|
76
|
+
ctx.draw(new Graphics2D().path({ data: lines.minor, centerBounds }).stroke(minorStroke));
|
|
77
|
+
}
|
|
78
|
+
if (lines.major.length > 0) {
|
|
79
|
+
ctx.draw(new Graphics2D().path({ data: lines.major, centerBounds }).stroke(major));
|
|
80
|
+
}
|
|
81
|
+
});
|
|
103
82
|
});
|
|
104
|
-
|
|
83
|
+
// The rect is what `clip` confines the children to and what picking tests; it paints nothing more.
|
|
84
|
+
Paint.draw(ctx, state, null, { clipShape: box });
|
|
85
|
+
},
|
|
86
|
+
});
|
|
87
|
+
|
|
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]>;
|
|
105
91
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
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
|
+
function gridPaths(
|
|
95
|
+
width: number,
|
|
96
|
+
height: number,
|
|
97
|
+
divisions: number,
|
|
98
|
+
subdivisions: number,
|
|
99
|
+
overscan: number,
|
|
100
|
+
offset: Vector2,
|
|
101
|
+
): { major: PathCommand[]; minor: PathCommand[] } {
|
|
102
|
+
// Inset by `overscan` so the outermost lines sit fully inside the rect and are not
|
|
103
|
+
// trimmed to half weight by the clip.
|
|
104
|
+
const cols = divisions * subdivisions;
|
|
105
|
+
const innerW = Math.max(0, width - 2 * overscan);
|
|
106
|
+
const innerH = Math.max(0, height - 2 * overscan);
|
|
107
|
+
const insetX = width / 2 - overscan;
|
|
108
|
+
const insetY = height / 2 - overscan;
|
|
116
109
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
}
|
|
110
|
+
// Anchored at the near edge, so a line sits on each edge of the box for any count of cells.
|
|
111
|
+
return gridLinePaths(
|
|
112
|
+
{ min: -insetX, max: insetX, step: innerW / cols, offset: offset.x, anchor: -insetX },
|
|
113
|
+
{ min: -insetY, max: insetY, step: innerH / cols, offset: offset.y, anchor: -insetY },
|
|
114
|
+
subdivisions,
|
|
115
|
+
overscan,
|
|
116
|
+
);
|
|
125
117
|
}
|
package/src/nodes.ts
CHANGED
|
@@ -6,9 +6,22 @@ import { LineGridPattern } from "./line-grid-pattern"
|
|
|
6
6
|
* Every node type this package publishes.
|
|
7
7
|
*
|
|
8
8
|
* A host registers these by handing the array to an engine —
|
|
9
|
-
* `new Engine(platform, { nodes: NODES })` — which reads each
|
|
10
|
-
*
|
|
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
|
|
11
14
|
* declares `sideEffects: false`, and a document names a node type by string, so
|
|
12
15
|
* an import kept only for its side effect is exactly what gets shaken out.
|
|
13
16
|
*/
|
|
14
|
-
|
|
17
|
+
// Typed by name, so the declaration names each component rather than spelling out its type through core.
|
|
18
|
+
type KitNode =
|
|
19
|
+
| typeof LineGridPattern
|
|
20
|
+
| typeof DotGridPattern
|
|
21
|
+
| typeof GridPattern
|
|
22
|
+
|
|
23
|
+
export const NODES: KitNode[] = [
|
|
24
|
+
LineGridPattern,
|
|
25
|
+
DotGridPattern,
|
|
26
|
+
GridPattern,
|
|
27
|
+
]
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{strokeOps as x}from"@motionscript/sdk";function y(e,t,o,i,n=0){let s=[],h=[],r=[],f=[],l=u(t.min-i,t.step,t.offset,n,Math.floor),m=u(t.max+i,t.step,t.offset,n,Math.ceil),a=u(e.min-i,e.step,e.offset,n,Math.floor),p=u(e.max+i,e.step,e.offset,n,Math.ceil);return M(e.min,e.max,e.step,e.offset,o,i,(c,d)=>{(d?s:h).push(c)},e.anchor),M(t.min,t.max,t.step,t.offset,o,i,(c,d)=>{(d?r:f).push(c)},t.anchor),{top:l,bottom:m,left:a,right:p,verticalMajor:s,verticalMinor:h,horizontalMajor:r,horizontalMinor:f}}function z(e,t,o,i){let n=y(e,t,o,i),s=[],h=[];for(let r of n.verticalMajor)s.push({type:"M",x:r,y:n.top},{type:"L",x:r,y:n.bottom});for(let r of n.verticalMinor)h.push({type:"M",x:r,y:n.top},{type:"L",x:r,y:n.bottom});for(let r of n.horizontalMajor)s.push({type:"M",x:n.left,y:r},{type:"L",x:n.right,y:r});for(let r of n.horizontalMinor)h.push({type:"M",x:n.left,y:r},{type:"L",x:n.right,y:r});return{major:s,minor:h}}function u(e,t,o,i,n){return i>0?n(e/i)*i:t<=0?e:n((e-o)/t)*t+o}function M(e,t,o,i,n,s,h,r=0){if(o<=0)return;let f=o*1e-6,l=Math.ceil((e-s-i-r-f)/o),m=Math.floor((t+s-i-r+f)/o);for(let a=l;a<=m;a++){let p=r+a*o+i,c=(a%n+n)%n===0;h(p,c)}}function C(e){let t=0;for(let o of e)o.weight>t&&(t=o.weight);return t}function k(e){return e.map(t=>t.align===0?t:{...t,align:0})}function B(e,t){return x.resolve(e.map(o=>({...o,fill:o.fill.map(i=>({...i,opacity:(i.opacity??1)*t}))})))}import{Camera as w,Clip as b,ShapeNode as L}from"@motionscript/sdk";var g=class extends L{renderSelf(t){let o=this.visibleBounds();t.beginClip(new b().rect({x:o.x,y:o.y,width:o.width,height:o.height})),this.renderPattern(t,o),t.endClip()}visibleBounds(){let t=this.findCamera();if(!t){let a=this.layoutBounds?.width??0,p=this.layoutBounds?.height??0;return{x:0,y:0,width:a,height:p}}let o=t.measuredWidth,i=t.measuredHeight,n=t.zoom||1,s=t.heading,h=o/2/n,r=i/2/n,f=h,l=r;if(s!==0){let a=s*Math.PI/180,p=Math.abs(Math.cos(a)),c=Math.abs(Math.sin(a));f=h*p+r*c,l=h*c+r*p}let m=t.lookAt;return{x:m.x,y:m.y,width:f*2,height:l*2}}findCamera(){for(let t=this.parent;t;t=t.parent)if(t instanceof w)return t;return null}};export{y as a,z as b,M as c,C as d,k as e,B as f,g};
|
|
2
|
-
//# sourceMappingURL=chunk-EZEE76AY.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 StrokeProp, type StrokeResolved } from \"@motionscript/sdk\";\r\n\r\n/**\r\n * Shared geometry for line grids. Both {@link LineGridPattern} (a fixed grid filling\r\n * its layout rect) and {@link GridPattern} (an infinite grid tiled across the\r\n * camera's visible region) build the same multi-subpath line paths from these\r\n * helpers — they differ only in how the extent and step are chosen.\r\n *\r\n * Lines are tiled by the minor step and panned by an origin offset: every\r\n * position within the extent (grown by `overscan` so thick lines clip out\r\n * smoothly) is emitted regardless of the offset, so the area always stays full\r\n * and animating the offset scrolls the grid. The lattice starts at the axis's\r\n * `anchor` (the world origin unless it says otherwise). A tile whose index\r\n * aligns to the division grid is major; the rest are minor. Each is built as a\r\n * single multi-subpath path so the trailing stroke paints every line as one\r\n * union with no destructive boolean op (which would erase the open lines).\r\n */\r\n\r\n/** A grid extent on one axis: lines tile within `[min, max]`, on a lattice that starts at `anchor`. */\r\nexport interface GridAxis {\r\n /** Minimum coordinate (typically negative). */\r\n min: number;\r\n /** Maximum coordinate. */\r\n max: number;\r\n /** Spacing between adjacent (minor) lines. */\r\n step: number;\r\n /** Pan offset in pixels along this axis. */\r\n offset: number;\r\n /**\r\n * Where the lattice starts: a line sits at `anchor + n * step`, and the tile\r\n * index `n` that decides which lines are major counts from there. Omitted it is 0, the\r\n * world origin, which is what a grid that follows a camera keeps. A grid with a box of its\r\n * own sets it to `min`, so the box's edges are lines whatever the count of cells.\r\n */\r\n anchor?: number;\r\n}\r\n\r\n/** The resolved grid: where each line sits and how far it runs. Vertical lines\r\n * sit at x = `verticalX[i]` and run from `top` to `bottom`; horizontal lines sit\r\n * at y = `horizontalY[i]` and run from `left` to `right`. Positions are split\r\n * into major (division) and minor (subdivision) lines. */\r\nexport interface GridLines {\r\n /** y-extent every vertical line spans. */\r\n top: number;\r\n bottom: number;\r\n /** x-extent every horizontal line spans. */\r\n left: number;\r\n right: number;\r\n verticalMajor: number[];\r\n verticalMinor: number[];\r\n horizontalMajor: number[];\r\n horizontalMinor: number[];\r\n}\r\n\r\n/**\r\n * Resolve the grid for the given per-axis extents: the cross-axis span and the\r\n * major/minor line positions on each axis. Vertical lines span the full y\r\n * extent; horizontal lines span the full x extent. Both spans are grown by\r\n * `overscan` so a thick line slides out under the clip instead of popping, and\r\n * snapped outward to the grid so the endpoints sit on stable world positions\r\n * (a line's start stays fixed as the camera pans, so a dashed stroke anchored to\r\n * it doesn't crawl).\r\n *\r\n * `cycle` (the dash period, when dashed) snaps the cross-axis span to a whole\r\n * number of dash cycles too, so each parallel line is the same dash-aligned\r\n * length and the renderer's per-path dash-fit becomes a no-op (no per-frame\r\n * resizing of the dashes as lines enter and leave view).\r\n */\r\nexport function gridLines(\r\n x: GridAxis,\r\n y: GridAxis,\r\n subdivisions: number,\r\n overscan: number,\r\n cycle = 0,\r\n): GridLines {\r\n const verticalMajor: number[] = [];\r\n const verticalMinor: number[] = [];\r\n const horizontalMajor: number[] = [];\r\n const horizontalMinor: number[] = [];\r\n\r\n // Span each line across the cross axis, snapped outward to the grid (and to\r\n // the dash cycle when dashed) so the endpoints sit on stable world positions.\r\n const top = snapSpan(y.min - overscan, y.step, y.offset, cycle, Math.floor);\r\n const bottom = snapSpan(y.max + overscan, y.step, y.offset, cycle, Math.ceil);\r\n const left = snapSpan(x.min - overscan, x.step, x.offset, cycle, Math.floor);\r\n const right = snapSpan(x.max + overscan, x.step, x.offset, cycle, Math.ceil);\r\n\r\n addTiledLines(x.min, x.max, x.step, x.offset, subdivisions, overscan, (px, isMajor) => {\r\n (isMajor ? verticalMajor : verticalMinor).push(px);\r\n }, x.anchor);\r\n addTiledLines(y.min, y.max, y.step, y.offset, subdivisions, overscan, (py, isMajor) => {\r\n (isMajor ? horizontalMajor : horizontalMinor).push(py);\r\n }, y.anchor);\r\n\r\n return { top, bottom, left, right, verticalMajor, verticalMinor, horizontalMajor, horizontalMinor };\r\n}\r\n\r\n/**\r\n * Build the grid lines as multi-subpath path commands, split into the major\r\n * (division) lines and the minor (subdivision) lines, for the given per-axis\r\n * extents. Every line in a group shares one stroke (drawn as one union path), so\r\n * this is the path for solid strokes; dashed strokes that must stay world-locked\r\n * draw per line from {@link gridLines} instead.\r\n */\r\nexport function gridLinePaths(\r\n x: GridAxis,\r\n y: GridAxis,\r\n subdivisions: number,\r\n overscan: number,\r\n): { major: PathCommand[]; minor: PathCommand[] } {\r\n const g = gridLines(x, y, subdivisions, overscan);\r\n const major: PathCommand[] = [];\r\n const minor: PathCommand[] = [];\r\n for (const px of g.verticalMajor) major.push({ type: \"M\", x: px, y: g.top }, { type: \"L\", x: px, y: g.bottom });\r\n for (const px of g.verticalMinor) minor.push({ type: \"M\", x: px, y: g.top }, { type: \"L\", x: px, y: g.bottom });\r\n for (const py of g.horizontalMajor) major.push({ type: \"M\", x: g.left, y: py }, { type: \"L\", x: g.right, y: py });\r\n for (const py of g.horizontalMinor) minor.push({ type: \"M\", x: g.left, y: py }, { type: \"L\", x: g.right, y: py });\r\n return { major, minor };\r\n}\r\n\r\n// Snap `pos` outward to a stable world position so a dashed line's start stays\r\n// fixed as the viewport moves (the renderer anchors dash phase to the subpath\r\n// start). Snap to the grid line lattice (`n*step + offset`); when a dash `cycle`\r\n// is given, snap to the dash lattice instead (`n*cycle`, anchored to world 0) so\r\n// every parallel line is the same whole number of cycles long and the renderer's\r\n// per-path dash-fit stays a no-op. `round` is `Math.floor` to snap below, `ceil`\r\n// to snap above. The lattice is the one about 0 whatever an axis's `anchor`: a span\r\n// only has to reach past the edge, and a line's ends stay where they always were.\r\nfunction snapSpan(pos: number, step: number, offset: number, cycle: number, round: (n: number) => number): number {\r\n if (cycle > 0) return round(pos / cycle) * cycle;\r\n if (step <= 0) return pos;\r\n return round((pos - offset) / step) * step + offset;\r\n}\r\n\r\n/**\r\n * Emit every grid line position in `[min, max]` (grown by `overscan` on each\r\n * end) for a grid of spacing `step`, panned by `offset` px. Without panning the\r\n * lattice starts at `anchor` (0 unless given) and its tile indices count outward\r\n * from there; the line at tile index `n` is major when `n` is a multiple of\r\n * `subdivisions`. The pan shifts each position by `offset` while keeping the\r\n * area full, so `n` is taken relative to the un-panned lattice (offset folded\r\n * out) to keep classification stable as it scrolls.\r\n *\r\n * A fixed grid anchors at `min`, so its first line is on the box's edge and the\r\n * last is too whenever the extent is a whole number of steps. An infinite grid\r\n * keeps the default, so its lines stay on the world's lattice.\r\n */\r\nexport function addTiledLines(\r\n min: number,\r\n max: number,\r\n step: number,\r\n offset: number,\r\n subdivisions: number,\r\n overscan: number,\r\n emit: (pos: number, isMajor: boolean) => void,\r\n anchor = 0,\r\n): void {\r\n if (step <= 0) return;\r\n // First/last tile index whose panned position is within the overscanned\r\n // [min, max]. Positions are `anchor + n*step + offset` (n=0 sits on the\r\n // anchor). A small epsilon keeps a line that lands exactly on an edge (an\r\n // anchor at `min`, or a world lattice that reaches it) from being dropped by FP error.\r\n const eps = step * 1e-6;\r\n const startN = Math.ceil((min - overscan - offset - anchor - eps) / step);\r\n const endN = Math.floor((max + overscan - offset - anchor + eps) / step);\r\n for (let n = startN; n <= endN; n++) {\r\n const pos = anchor + n * step + offset;\r\n // mod that stays non-negative for negative n.\r\n const isMajor = ((n % subdivisions) + subdivisions) % subdivisions === 0;\r\n emit(pos, isMajor);\r\n }\r\n}\r\n\r\n/** Largest stroke weight across the layers of a resolved stroke array. Used to\r\n * overscan the tiling so a thick line stays drawn until fully off the area. */\r\nexport function maxWeight(strokes: StrokeResolved[]): number {\r\n let max = 0;\r\n for (const s of strokes) if (s.weight > max) max = s.weight;\r\n return max;\r\n}\r\n\r\n/** Force every layer of a resolved stroke array to centered alignment. Grid\r\n * lines are open paths, not a closed region, so inside/outside alignment is\r\n * meaningless — they always straddle their position. (Open paths are already\r\n * stroked centered by the renderer; this makes the intent explicit and ignores\r\n * any author `align`.) */\r\nexport function centered(strokes: StrokeResolved[]): StrokeResolved[] {\r\n return strokes.map(s => (s.align === 0 ? s : { ...s, align: 0 }));\r\n}\r\n\r\n/** Copy a resolved stroke array with every fill layer's opacity scaled by\r\n * `factor`. Used to derive the default minor-line stroke from the major one.\r\n * Every resolved fill carries an `opacity` field, so this is type-uniform. */\r\nexport function dimStroke(strokes: StrokeResolved[], factor: number): StrokeResolved[] {\r\n return strokeOps.resolve(strokes.map(s => ({\r\n ...s,\r\n fill: s.fill.map(f => ({ ...f, opacity: (f.opacity ?? 1) * factor })),\r\n })) as unknown as StrokeProp[]);\r\n}\r\n", "import {\r\n Camera,\r\n Clip,\r\n ShapeNode,\r\n type BoxBounds,\r\n type RenderContext2D,\r\n type ShapeProps,\r\n} from \"@motionscript/sdk\";\r\n\r\n/**\r\n * Base for backgrounds that fill whatever region is currently visible, rather\r\n * than a fixed rect. Placed inside a {@link Camera}, the node resolves the\r\n * world region the camera can currently see (from its `zoom`/`origin`/`heading`)\r\n * and hands those bounds to {@link renderPattern}, so the subclass only ever\r\n * generates geometry for what's on screen — no oversized static node sized for\r\n * the worst-case pan/zoom.\r\n *\r\n * With no ancestor `Camera` the node falls back to its own layout rect, so the\r\n * same pattern doubles as an ordinary full-bleed background.\r\n *\r\n * The pattern node is itself a camera child, laid out stack-style at the\r\n * camera's centre, so its local draw space shares the world origin its siblings\r\n * use. The visible region is therefore expressed directly in that space: centred\r\n * on the camera's `origin`, sized to the inverse of the camera transform.\r\n */\r\nexport abstract class ViewportPattern<P extends ShapeProps = ShapeProps> extends ShapeNode<P> {\r\n\r\n /**\r\n * Fill `bounds` (in this node's local draw space) with the pattern. Called\r\n * once per render with the currently-visible region. The `centerBounds` for\r\n * path ops drawn here is `[bounds.x - w/2, bounds.y - h/2, bounds.x + w/2,\r\n * bounds.y + h/2]`.\r\n */\r\n protected abstract renderPattern(draw: RenderContext2D, bounds: BoxBounds): void;\r\n\r\n protected renderSelf(draw: RenderContext2D): void {\r\n const bounds = this.visibleBounds();\r\n // Clip to the visible region so geometry overscanned past the edge (so\r\n // thick lines slide out instead of popping) trims cleanly. When inside a\r\n // camera the viewport already clips, but this keeps edge strokes clean\r\n // and bounds the work in the no-camera fallback too.\r\n draw.beginClip(new Clip().rect({ x: bounds.x, y: bounds.y, width: bounds.width, height: bounds.height }));\r\n this.renderPattern(draw, bounds);\r\n draw.endClip();\r\n }\r\n\r\n /**\r\n * The region this node should cover, in its own local draw space. Inside a\r\n * camera this is the world rect the camera currently sees; otherwise it's the\r\n * node's own layout rect (a normal background).\r\n */\r\n protected visibleBounds(): BoxBounds {\r\n const camera = this.findCamera();\r\n if (!camera) {\r\n // No camera — fill our own cell, centred on this node's origin.\r\n const w = this.layoutBounds?.width ?? 0;\r\n const h = this.layoutBounds?.height ?? 0;\r\n return { x: 0, y: 0, width: w, height: h };\r\n }\r\n\r\n const vw = camera.measuredWidth;\r\n const vh = camera.measuredHeight;\r\n const zoom = camera.zoom || 1;\r\n const heading = camera.heading;\r\n\r\n // Inverse of the camera scale: a viewport `vw×vh` shows `vw/zoom × vh/zoom`\r\n // of the world.\r\n const hw = vw / 2 / zoom;\r\n const hh = vh / 2 / zoom;\r\n\r\n // With a heading the visible world rect is rotated; take its axis-aligned\r\n // bounding box so the pattern covers the rotated viewport's full extent.\r\n let bw = hw;\r\n let bh = hh;\r\n if (heading !== 0) {\r\n const rad = (heading * Math.PI) / 180;\r\n const cos = Math.abs(Math.cos(rad));\r\n const sin = Math.abs(Math.sin(rad));\r\n bw = hw * cos + hh * sin;\r\n bh = hw * sin + hh * cos;\r\n }\r\n\r\n // The visible region centres on the camera's `lookAt`, returned in y-UP\r\n // world space (matching the descriptor convention; the renderer applies\r\n // the single y-up→canvas flip when the pattern's shapes are drawn). A\r\n // y-down consumer would have wanted -lookAt.y; we hand back the y-up value.\r\n const lookAt = camera.lookAt;\r\n return { x: lookAt.x, y: lookAt.y, width: bw * 2, height: bh * 2 };\r\n }\r\n\r\n /** Nearest ancestor {@link Camera}, or `null` when rendered outside one. */\r\n protected findCamera(): Camera | null {\r\n for (let n = this.parent; n; n = n.parent) {\r\n if (n instanceof Camera) return n;\r\n }\r\n return null;\r\n }\r\n}\r\n"],
|
|
5
|
-
"mappings": "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",
|
|
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", "Camera", "Clip", "ShapeNode", "ViewportPattern", "draw", "bounds", "camera", "w", "h", "vw", "vh", "zoom", "heading", "hw", "hh", "bw", "bh", "rad", "cos", "sin", "lookAt", "n"]
|
|
7
|
-
}
|