@embedpdf/plugin-stage 3.0.0-next.6 → 3.0.0-next.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/dist/index.cjs +528 -81
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +172 -44
- package/dist/index.d.ts +172 -44
- package/dist/index.js +524 -81
- package/dist/index.js.map +1 -1
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -1,8 +1,151 @@
|
|
|
1
1
|
import { createCapabilityToken, definePlugin } from "@embedpdf/core";
|
|
2
|
-
import { InteractionToken } from "@embedpdf/plugin-interaction";
|
|
3
2
|
import * as S from "@embedpdf/core-stage";
|
|
4
3
|
import { ZoomMode, ZoomMode as ZoomMode$1 } from "@embedpdf/core-stage";
|
|
5
4
|
import { addRotations, applyPoint, applyRect, displaySize, intersectRects, pageGeometry, pageTransform, rotateScaleMatrix, snapToDevice } from "@embedpdf/core-geometry";
|
|
5
|
+
//#region src/motion.ts
|
|
6
|
+
/**
|
|
7
|
+
* The camera's MOTION vocabulary — every formula, pure.
|
|
8
|
+
*
|
|
9
|
+
* The capability owns the impure drivers (scheduler frames, dispatch, gesture
|
|
10
|
+
* state); the LAWS those drivers integrate live here, parameterized by dt/t
|
|
11
|
+
* with no state, no scheduler, no dispatch — unit-testable in isolation, and
|
|
12
|
+
* with zero plugin dependencies, liftable into stage-core if the native port
|
|
13
|
+
* ever wants them.
|
|
14
|
+
*
|
|
15
|
+
* Two families:
|
|
16
|
+
* • ballistic — one per-axis law for every free motion: `glideStep` (the
|
|
17
|
+
* touch fling, decaying on UIScrollView's curve) and `springStep` (a
|
|
18
|
+
* critically-damped return to the clamp). A glide that reaches a content
|
|
19
|
+
* edge converts to a spring with its velocity carried in, so the bounce
|
|
20
|
+
* grows out of physics rather than a scripted overshoot.
|
|
21
|
+
* • resistance — the iOS rubber-band curve `rubberOut` and its exact
|
|
22
|
+
* inverse `rubberIn`: dragging `d` px past an edge displays an
|
|
23
|
+
* asymptotically-bounded stretch, and re-entering a gesture over a
|
|
24
|
+
* stretched camera (the mid-bounce catch) reconstructs the
|
|
25
|
+
* finger-integrated position the curve came from.
|
|
26
|
+
* Plus the tween interpolators: `easeOutCubic` for coordinate tweens and
|
|
27
|
+
* `zoomLerp` — GEOMETRIC zoom interpolation (zoom is multiplicative; equal
|
|
28
|
+
* ratios per unit time, not equal deltas — the linear lerp's visible "dip").
|
|
29
|
+
*/
|
|
30
|
+
/** Resistance coefficient of the rubber-band curve (the iOS feel). */
|
|
31
|
+
const RUBBER = .55;
|
|
32
|
+
/** Glide decay per ms — UIScrollView's normal deceleration rate. */
|
|
33
|
+
const FLING_DECAY = .998;
|
|
34
|
+
/** rad/ms — critically damped, ~400ms to settle. */
|
|
35
|
+
const SPRING_OMEGA = .015;
|
|
36
|
+
/**
|
|
37
|
+
* Overshoot distance → displayed stretch: asymptotic to the viewport
|
|
38
|
+
* dimension `dim`, so the content never leaves the screen however far the
|
|
39
|
+
* finger travels. `rubberOut(0) === 0` — inside the bounds the curve is
|
|
40
|
+
* invisible.
|
|
41
|
+
*/
|
|
42
|
+
const rubberOut = (d, dim) => (1 - 1 / (d * RUBBER / dim + 1)) * dim;
|
|
43
|
+
/** Exact inverse of `rubberOut` (defined for `out < dim`). */
|
|
44
|
+
const rubberIn = (out, dim) => out * dim / (RUBBER * (dim - out));
|
|
45
|
+
/**
|
|
46
|
+
* One frame of free glide: exponential velocity decay, position advanced by
|
|
47
|
+
* the midpoint integral of the decay over `dt` (exact for the exponential —
|
|
48
|
+
* frame-rate independent).
|
|
49
|
+
*/
|
|
50
|
+
const glideStep = (p, v, dt) => {
|
|
51
|
+
const k = Math.pow(FLING_DECAY, dt);
|
|
52
|
+
const np = p + v * (dt * (1 + k) / 2);
|
|
53
|
+
const nv = v * k;
|
|
54
|
+
return Math.abs(nv) < .02 ? {
|
|
55
|
+
p: np,
|
|
56
|
+
v: 0,
|
|
57
|
+
done: true
|
|
58
|
+
} : {
|
|
59
|
+
p: np,
|
|
60
|
+
v: nv,
|
|
61
|
+
done: false
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
/**
|
|
65
|
+
* One frame of critically-damped spring toward `edge` — semi-implicit Euler
|
|
66
|
+
* on x'' = −ω²(x−e) − 2ωx'. Lands exactly ON the edge (position snapped,
|
|
67
|
+
* velocity zeroed) once inside half a pixel at negligible speed.
|
|
68
|
+
*/
|
|
69
|
+
const springStep = (p, v, edge, dt) => {
|
|
70
|
+
const nv = v + (-.015 * SPRING_OMEGA * (p - edge) - 2 * SPRING_OMEGA * v) * dt;
|
|
71
|
+
const np = p + nv * dt;
|
|
72
|
+
if (Math.abs(np - edge) < .5 && Math.abs(nv) < .01) return {
|
|
73
|
+
p: edge,
|
|
74
|
+
v: 0,
|
|
75
|
+
done: true
|
|
76
|
+
};
|
|
77
|
+
return {
|
|
78
|
+
p: np,
|
|
79
|
+
v: nv,
|
|
80
|
+
done: false
|
|
81
|
+
};
|
|
82
|
+
};
|
|
83
|
+
const easeOutCubic = (t) => 1 - Math.pow(1 - t, 3);
|
|
84
|
+
/**
|
|
85
|
+
* Geometric zoom interpolation: `z0·(z1/z0)^k`. Zoom is multiplicative, so a
|
|
86
|
+
* constant-RATE zoom moves equal ratios per unit time; interpolating the
|
|
87
|
+
* level linearly instead makes the start rush and the end crawl (and, under
|
|
88
|
+
* a focal anchor, swings the anchored point along a curved path).
|
|
89
|
+
*/
|
|
90
|
+
const zoomLerp = (z0, z1, k) => z0 * Math.pow(z1 / z0, k);
|
|
91
|
+
//#endregion
|
|
92
|
+
//#region src/responsive.ts
|
|
93
|
+
/**
|
|
94
|
+
* Container queries for the settings bag — the pure half. The capability owns
|
|
95
|
+
* the driver (when to re-resolve, how to react); the LAWS live here: what a
|
|
96
|
+
* box is, when a query matches, and what the effective settings are. No state,
|
|
97
|
+
* no dispatch — property-testable in isolation (the `wheel.ts` convention).
|
|
98
|
+
*
|
|
99
|
+
* The query vocabulary is deliberately just the box: a headless, DOM-free
|
|
100
|
+
* stage knows exactly one environmental fact — the viewport it was told.
|
|
101
|
+
* Anything else (pointer coarseness, platform, app state) is either per-event
|
|
102
|
+
* (`PointerSample.pointerType`) or the app's own business via `update()`.
|
|
103
|
+
*/
|
|
104
|
+
/** The reported viewport as a queryable box. A square box is 'portrait' (CSS). */
|
|
105
|
+
const boxOf = (vp) => ({
|
|
106
|
+
width: vp.width,
|
|
107
|
+
height: vp.height,
|
|
108
|
+
orientation: vp.height >= vp.width ? "portrait" : "landscape"
|
|
109
|
+
});
|
|
110
|
+
/** All bounds inclusive, all fields optional, conditions AND-ed (CSS ranges). */
|
|
111
|
+
const matchesQuery = (q, box) => (q.minWidth === void 0 || box.width >= q.minWidth) && (q.maxWidth === void 0 || box.width <= q.maxWidth) && (q.minHeight === void 0 || box.height >= q.minHeight) && (q.maxHeight === void 0 || box.height <= q.maxHeight) && (q.orientation === void 0 || box.orientation === q.orientation);
|
|
112
|
+
const ruleMatches = (rule, box) => typeof rule.when === "function" ? !!rule.when(box) : matchesQuery(rule.when, box);
|
|
113
|
+
/** Merge a patch over settings, skipping undefined values (Partial semantics). */
|
|
114
|
+
const mergeSettings = (into, patch) => {
|
|
115
|
+
const out = { ...into };
|
|
116
|
+
let key;
|
|
117
|
+
for (key in patch) {
|
|
118
|
+
const value = patch[key];
|
|
119
|
+
if (value !== void 0) Object.assign(out, { [key]: value });
|
|
120
|
+
}
|
|
121
|
+
return out;
|
|
122
|
+
};
|
|
123
|
+
/**
|
|
124
|
+
* Setting-value equality: primitives by identity, the flat objects the
|
|
125
|
+
* settings vocabulary uses (`{ px }`, `{ x, y }`, page frames, zoom specs) by
|
|
126
|
+
* one level of own-key comparison. Settings values are never nested deeper.
|
|
127
|
+
*/
|
|
128
|
+
const eqSetting = (a, b) => {
|
|
129
|
+
if (a === b) return true;
|
|
130
|
+
if (typeof a !== "object" || typeof b !== "object" || a === null || b === null) return false;
|
|
131
|
+
const ka = Object.keys(a);
|
|
132
|
+
const kb = Object.keys(b);
|
|
133
|
+
return ka.length === kb.length && ka.every((k) => a[k] === b[k]);
|
|
134
|
+
};
|
|
135
|
+
const resolveResponsive = (base, rules, box) => {
|
|
136
|
+
let effective = base;
|
|
137
|
+
const active = [];
|
|
138
|
+
for (const rule of rules) {
|
|
139
|
+
if (!ruleMatches(rule, box)) continue;
|
|
140
|
+
if (rule.name !== void 0) active.push(rule.name);
|
|
141
|
+
if (rule.settings) effective = mergeSettings(effective, rule.settings);
|
|
142
|
+
}
|
|
143
|
+
return {
|
|
144
|
+
effective,
|
|
145
|
+
active
|
|
146
|
+
};
|
|
147
|
+
};
|
|
148
|
+
//#endregion
|
|
6
149
|
//#region src/settings.ts
|
|
7
150
|
/**
|
|
8
151
|
* Out-of-the-box defaults — a sensible document-reading feel. They are JUST
|
|
@@ -48,6 +191,18 @@ const DEFAULT_SETTINGS = {
|
|
|
48
191
|
scrollBehavior: "smooth",
|
|
49
192
|
viewUnitsPerPoint: 96 / 72
|
|
50
193
|
};
|
|
194
|
+
/**
|
|
195
|
+
* Out-of-the-box responsive rules — the platform feel with zero configuration:
|
|
196
|
+
* a compact container gets the thin gutter phones use (space, not device — an
|
|
197
|
+
* embedded 500px pane on a desktop is compact too). Override the whole list
|
|
198
|
+
* with `stagePlugin({ responsive: [...] })`; `responsive: []` opts out. The
|
|
199
|
+
* 'compact' name is queryable app-side via `stage.matches('compact')`.
|
|
200
|
+
*/
|
|
201
|
+
const DEFAULT_RESPONSIVE = [{
|
|
202
|
+
name: "compact",
|
|
203
|
+
when: { maxWidth: 600 },
|
|
204
|
+
settings: { padding: 4 }
|
|
205
|
+
}];
|
|
51
206
|
const SETTINGS_EFFECT = {
|
|
52
207
|
flow: "reflow",
|
|
53
208
|
layout: "scene",
|
|
@@ -86,8 +241,9 @@ const settingsEqual = (a, b) => SETTING_KEYS.every((k) => valueEq(a[k], b[k]));
|
|
|
86
241
|
* Layering, stated honestly:
|
|
87
242
|
* • stage-core — PURE spatial math (no DOM, no time). Ports to Rust later.
|
|
88
243
|
* • this capability — the IMPURE platform shell. It dispatches, caches, and owns
|
|
89
|
-
* the camera tween. It is NOT pure;
|
|
90
|
-
*
|
|
244
|
+
* the camera tween. It is NOT pure; its one host dependency (frame timing)
|
|
245
|
+
* enters through the Scheduler seam — injectable, defaulting to the host's
|
|
246
|
+
* own frame clock when one exists (see the seam below).
|
|
91
247
|
*
|
|
92
248
|
* The model: EVERY camera move is defined by what it holds fixed.
|
|
93
249
|
* • gestures (pan/pinch/wheel) — the content under the pointer. Physics, no setting.
|
|
@@ -374,6 +530,10 @@ function createStageCapability(ctx, config = {}) {
|
|
|
374
530
|
direction: ctx.getState().direction
|
|
375
531
|
});
|
|
376
532
|
let hasPlaced = false;
|
|
533
|
+
let gestureDepth = 0;
|
|
534
|
+
let gestureZoomed = false;
|
|
535
|
+
let gestureElastic = false;
|
|
536
|
+
let gestureRaw = null;
|
|
377
537
|
const REST_MS = 150;
|
|
378
538
|
let restRaf = 0;
|
|
379
539
|
const armRest = () => {
|
|
@@ -400,12 +560,69 @@ function createStageCapability(ctx, config = {}) {
|
|
|
400
560
|
};
|
|
401
561
|
const setCam = (next, bounds = stayBounds()) => {
|
|
402
562
|
const clamped = S.clampCamera(next, bounds, vp(), constraint());
|
|
403
|
-
if (clamped.zoom !== cam().zoom)
|
|
563
|
+
if (clamped.zoom !== cam().zoom) if (gestureDepth > 0) {
|
|
564
|
+
gestureZoomed = true;
|
|
565
|
+
if (ctx.getState().cameraResting) ctx.dispatch({
|
|
566
|
+
type: "CAMERA_REST",
|
|
567
|
+
resting: false
|
|
568
|
+
});
|
|
569
|
+
if (restRaf) {
|
|
570
|
+
scheduler.caf(restRaf);
|
|
571
|
+
restRaf = 0;
|
|
572
|
+
}
|
|
573
|
+
} else armRest();
|
|
404
574
|
ctx.dispatch({
|
|
405
575
|
type: "CAMERA",
|
|
406
576
|
camera: clamped
|
|
407
577
|
});
|
|
408
578
|
};
|
|
579
|
+
const axisTravels = (origin, content, view, zoom) => !S.travelRange(origin, content, view, zoom, constraint().padding).fits;
|
|
580
|
+
/** Unclamped finger-integrated camera → the DISPLAYED camera: clamp, then
|
|
581
|
+
* re-apply the overshoot through the resistance curve, per travelling axis.
|
|
582
|
+
* Inside the bounds this is exactly the clamp (rubber of zero is zero);
|
|
583
|
+
* on a fitting axis it is exactly the clamp ALWAYS. */
|
|
584
|
+
const rubberize = (raw) => {
|
|
585
|
+
const clamped = S.clampCamera(raw, stayBounds(), vp(), constraint());
|
|
586
|
+
const v = vp();
|
|
587
|
+
const b = stayBounds();
|
|
588
|
+
const axis = (rawA, clampedA, dim, travels) => {
|
|
589
|
+
if (!travels) return clampedA;
|
|
590
|
+
const dWorld = rawA - clampedA;
|
|
591
|
+
if (dWorld === 0) return clampedA;
|
|
592
|
+
const out = rubberOut(Math.abs(dWorld) * raw.zoom, Math.max(1, dim));
|
|
593
|
+
return clampedA + Math.sign(dWorld) * out / raw.zoom;
|
|
594
|
+
};
|
|
595
|
+
return {
|
|
596
|
+
zoom: raw.zoom,
|
|
597
|
+
x: axis(raw.x, clamped.x, v.width, axisTravels(b.x, b.width, v.width, raw.zoom)),
|
|
598
|
+
y: axis(raw.y, clamped.y, v.height, axisTravels(b.y, b.height, v.height, raw.zoom))
|
|
599
|
+
};
|
|
600
|
+
};
|
|
601
|
+
/** Displayed camera → the raw position `rubberize` would have produced it
|
|
602
|
+
* from. Overshoot is capped just under the asymptote so the inverse stays
|
|
603
|
+
* finite whatever state a catch finds the camera in. */
|
|
604
|
+
const unrubberize = (displayed) => {
|
|
605
|
+
const clamped = S.clampCamera(displayed, stayBounds(), vp(), constraint());
|
|
606
|
+
const v = vp();
|
|
607
|
+
const b = stayBounds();
|
|
608
|
+
const axis = (dispA, clampedA, dim, travels) => {
|
|
609
|
+
if (!travels) return clampedA;
|
|
610
|
+
const dWorld = dispA - clampedA;
|
|
611
|
+
if (dWorld === 0) return clampedA;
|
|
612
|
+
const d = Math.max(1, dim);
|
|
613
|
+
const out = Math.min(Math.abs(dWorld) * displayed.zoom, d - 1);
|
|
614
|
+
return clampedA + Math.sign(dWorld) * rubberIn(out, d) / displayed.zoom;
|
|
615
|
+
};
|
|
616
|
+
return {
|
|
617
|
+
zoom: displayed.zoom,
|
|
618
|
+
x: axis(displayed.x, clamped.x, v.width, axisTravels(b.x, b.width, v.width, displayed.zoom)),
|
|
619
|
+
y: axis(displayed.y, clamped.y, v.height, axisTravels(b.y, b.height, v.height, displayed.zoom))
|
|
620
|
+
};
|
|
621
|
+
};
|
|
622
|
+
const setCamRaw = (c) => ctx.dispatch({
|
|
623
|
+
type: "CAMERA",
|
|
624
|
+
camera: c
|
|
625
|
+
});
|
|
409
626
|
/**
|
|
410
627
|
* Cursor reconciliation, one direction per interaction:
|
|
411
628
|
* navigation → cursor is INTENT, set explicitly; the camera honors it as far
|
|
@@ -439,7 +656,6 @@ function createStageCapability(ctx, config = {}) {
|
|
|
439
656
|
}
|
|
440
657
|
cancelAnim();
|
|
441
658
|
const from = cam();
|
|
442
|
-
const ease = (t) => 1 - Math.pow(1 - t, 3);
|
|
443
659
|
let started = false;
|
|
444
660
|
let t0 = 0;
|
|
445
661
|
const tick = (now) => {
|
|
@@ -447,7 +663,7 @@ function createStageCapability(ctx, config = {}) {
|
|
|
447
663
|
started = true;
|
|
448
664
|
t0 = now;
|
|
449
665
|
}
|
|
450
|
-
const k =
|
|
666
|
+
const k = easeOutCubic(Math.min(1, (now - t0) / ms));
|
|
451
667
|
setCam({
|
|
452
668
|
x: lerp(from.x, target.x, k),
|
|
453
669
|
y: lerp(from.y, target.y, k),
|
|
@@ -461,6 +677,116 @@ function createStageCapability(ctx, config = {}) {
|
|
|
461
677
|
};
|
|
462
678
|
raf = scheduler.raf(tick);
|
|
463
679
|
};
|
|
680
|
+
/**
|
|
681
|
+
* Zoom-anchored tween — animates THE INVARIANT, not the coordinates. A
|
|
682
|
+
* camera move is defined by what it holds fixed; for an anchored zoom that
|
|
683
|
+
* is "the focal page-point stays at `pt` while scale changes". Lerping
|
|
684
|
+
* x/y/zoom independently (the plain tween) breaks that mid-flight: holding
|
|
685
|
+
* a screen point requires `x(t) = focal.x − pt.x / zoom(t)` — hyperbolic in
|
|
686
|
+
* the zoom — so linear coordinates swing the tapped point along a curved
|
|
687
|
+
* path (the visible "dip"). Here the zoom interpolates GEOMETRICALLY
|
|
688
|
+
* (constant rate — zoom is multiplicative) and each frame's camera derives
|
|
689
|
+
* from the anchor at that zoom, then clamps: the focal point is stationary
|
|
690
|
+
* by construction, and a zoom-out rails into its fit progressively as the
|
|
691
|
+
* shrinking travel range lets the clamp take over.
|
|
692
|
+
*/
|
|
693
|
+
const animateZoomAnchored = (focal, pt, targetZoom, ms = 240, then) => {
|
|
694
|
+
if (!canAnimate) {
|
|
695
|
+
const sc = buildScene();
|
|
696
|
+
if (sc.itemCount) setCam(S.cameraForAnchorAtScreen(focal, sc, pt, targetZoom));
|
|
697
|
+
then?.();
|
|
698
|
+
return;
|
|
699
|
+
}
|
|
700
|
+
cancelAnim();
|
|
701
|
+
const z0 = cam().zoom;
|
|
702
|
+
let started = false;
|
|
703
|
+
let t0 = 0;
|
|
704
|
+
const tick = (now) => {
|
|
705
|
+
if (!started) {
|
|
706
|
+
started = true;
|
|
707
|
+
t0 = now;
|
|
708
|
+
}
|
|
709
|
+
const k = easeOutCubic(Math.min(1, (now - t0) / ms));
|
|
710
|
+
const z = zoomLerp(z0, targetZoom, k);
|
|
711
|
+
const sc = buildScene();
|
|
712
|
+
if (sc.itemCount) setCam(S.cameraForAnchorAtScreen(focal, sc, pt, z));
|
|
713
|
+
if (k < 1) raf = scheduler.raf(tick);
|
|
714
|
+
else {
|
|
715
|
+
raf = 0;
|
|
716
|
+
then?.();
|
|
717
|
+
}
|
|
718
|
+
};
|
|
719
|
+
raf = scheduler.raf(tick);
|
|
720
|
+
};
|
|
721
|
+
const startCameraPhysics = (vxFinger, vyFinger) => {
|
|
722
|
+
if (!canAnimate) {
|
|
723
|
+
setCam(cam());
|
|
724
|
+
return;
|
|
725
|
+
}
|
|
726
|
+
cancelAnim();
|
|
727
|
+
const zoom = cam().zoom;
|
|
728
|
+
const c0 = cam();
|
|
729
|
+
const cl0 = S.clampCamera(c0, stayBounds(), vp(), constraint());
|
|
730
|
+
const b0 = stayBounds();
|
|
731
|
+
const v0 = vp();
|
|
732
|
+
const mk = (camA, clampedA, fingerV) => ({
|
|
733
|
+
p: camA * zoom,
|
|
734
|
+
v: -fingerV / 1e3,
|
|
735
|
+
springing: camA !== clampedA,
|
|
736
|
+
done: false
|
|
737
|
+
});
|
|
738
|
+
const ax = mk(c0.x, cl0.x, axisTravels(b0.x, b0.width, v0.width, zoom) ? vxFinger : 0);
|
|
739
|
+
const ay = mk(c0.y, cl0.y, axisTravels(b0.y, b0.height, v0.height, zoom) ? vyFinger : 0);
|
|
740
|
+
if (!ax.springing && !ay.springing && Math.hypot(ax.v, ay.v) < .02) return;
|
|
741
|
+
let started = false;
|
|
742
|
+
let last = 0;
|
|
743
|
+
const tick = (now) => {
|
|
744
|
+
raf = 0;
|
|
745
|
+
const dt = started ? Math.min(64, Math.max(1, now - last)) : 16;
|
|
746
|
+
started = true;
|
|
747
|
+
last = now;
|
|
748
|
+
const cl = S.clampCamera({
|
|
749
|
+
x: ax.p / zoom,
|
|
750
|
+
y: ay.p / zoom,
|
|
751
|
+
zoom
|
|
752
|
+
}, stayBounds(), vp(), constraint());
|
|
753
|
+
const step = (a, edgeWorld) => {
|
|
754
|
+
if (a.done) return;
|
|
755
|
+
const r = a.springing ? springStep(a.p, a.v, edgeWorld * zoom, dt) : glideStep(a.p, a.v, dt);
|
|
756
|
+
a.p = r.p;
|
|
757
|
+
a.v = r.v;
|
|
758
|
+
a.done = r.done;
|
|
759
|
+
};
|
|
760
|
+
step(ax, cl.x);
|
|
761
|
+
step(ay, cl.y);
|
|
762
|
+
const ncl = S.clampCamera({
|
|
763
|
+
x: ax.p / zoom,
|
|
764
|
+
y: ay.p / zoom,
|
|
765
|
+
zoom
|
|
766
|
+
}, stayBounds(), vp(), constraint());
|
|
767
|
+
const convert = (a, clampedA) => {
|
|
768
|
+
if (!a.springing && Math.abs(clampedA * zoom - a.p) > 1e-6) {
|
|
769
|
+
a.p = clampedA * zoom;
|
|
770
|
+
a.springing = true;
|
|
771
|
+
a.done = false;
|
|
772
|
+
}
|
|
773
|
+
};
|
|
774
|
+
convert(ax, ncl.x);
|
|
775
|
+
convert(ay, ncl.y);
|
|
776
|
+
setCamRaw({
|
|
777
|
+
x: ax.p / zoom,
|
|
778
|
+
y: ay.p / zoom,
|
|
779
|
+
zoom
|
|
780
|
+
});
|
|
781
|
+
syncCursorFromCamera();
|
|
782
|
+
if (ax.done && ay.done) {
|
|
783
|
+
setCam(cam());
|
|
784
|
+
return;
|
|
785
|
+
}
|
|
786
|
+
raf = scheduler.raf(tick);
|
|
787
|
+
};
|
|
788
|
+
raf = scheduler.raf(tick);
|
|
789
|
+
};
|
|
464
790
|
const anchorAt = (at) => {
|
|
465
791
|
const sc = buildScene();
|
|
466
792
|
return sc.itemCount ? S.anchorFromCamera(cam(), sc, vp(), at) : {
|
|
@@ -660,6 +986,72 @@ function createStageCapability(ctx, config = {}) {
|
|
|
660
986
|
return out;
|
|
661
987
|
};
|
|
662
988
|
const snapshotSettings = () => pickSettings(ctx.getState());
|
|
989
|
+
/**
|
|
990
|
+
* Settings change, reacted per the registry — the strongest effect among the
|
|
991
|
+
* touched settings wins: 'reflow' ⊃ 'scene'/'refit' ⊃ 'reclamp' ⊃ 'none'.
|
|
992
|
+
* The ONE reactive applier: the public `update()` and the responsive driver
|
|
993
|
+
* both land here, so a breakpoint crossing gets exactly the invariant a
|
|
994
|
+
* hand-written update would.
|
|
995
|
+
*/
|
|
996
|
+
const applySettings = (patch) => {
|
|
997
|
+
cancelAnim();
|
|
998
|
+
const touched = (effect) => SETTING_KEYS.some((k) => patch[k] !== void 0 && SETTINGS_EFFECT[k] === effect);
|
|
999
|
+
const align = touched("refit") && !touched("scene") && !touched("reflow") ? ctx.getState().zoomAlign : ctx.getState().anchorAlign;
|
|
1000
|
+
const anchor = anchorAt(alignPoint(align, vp()));
|
|
1001
|
+
ctx.dispatch({
|
|
1002
|
+
type: "PATCH",
|
|
1003
|
+
patch
|
|
1004
|
+
});
|
|
1005
|
+
if (touched("scene")) sceneCache = null;
|
|
1006
|
+
if (touched("reflow")) goToTarget(ctx.getState().cursor, { behavior: "instant" });
|
|
1007
|
+
else if (touched("scene") || touched("refit")) reapply(anchor, align);
|
|
1008
|
+
else if (touched("reclamp")) setCam(cam());
|
|
1009
|
+
};
|
|
1010
|
+
let base = snapshotSettings();
|
|
1011
|
+
let rules = config.responsive ?? DEFAULT_RESPONSIVE;
|
|
1012
|
+
let lastEffective = base;
|
|
1013
|
+
const publishActive = (active) => {
|
|
1014
|
+
const prev = ctx.getState().activeRules;
|
|
1015
|
+
if (prev.length !== active.length || active.some((n, i) => n !== prev[i])) ctx.dispatch({
|
|
1016
|
+
type: "RESPONSIVE",
|
|
1017
|
+
active
|
|
1018
|
+
});
|
|
1019
|
+
};
|
|
1020
|
+
/**
|
|
1021
|
+
* Re-resolve and apply what CHANGED since the last resolution. `react: true`
|
|
1022
|
+
* routes the patch through `applySettings` (full anchor-preserving update);
|
|
1023
|
+
* `react: false` (inside `setViewport`, whose caller runs its own reframe)
|
|
1024
|
+
* just lands the patch + cache invalidation and reports the strongest
|
|
1025
|
+
* effect so the caller can escalate a rule-driven flow flip.
|
|
1026
|
+
*/
|
|
1027
|
+
const syncResponsive = (react) => {
|
|
1028
|
+
const { effective, active } = resolveResponsive(base, rules, boxOf(vp()));
|
|
1029
|
+
const patch = {};
|
|
1030
|
+
for (const k of SETTING_KEYS) if (!eqSetting(effective[k], lastEffective[k])) Object.assign(patch, { [k]: effective[k] });
|
|
1031
|
+
lastEffective = effective;
|
|
1032
|
+
publishActive(active);
|
|
1033
|
+
const keys = Object.keys(patch);
|
|
1034
|
+
if (keys.length === 0) return "none";
|
|
1035
|
+
if (react) {
|
|
1036
|
+
applySettings(patch);
|
|
1037
|
+
return "none";
|
|
1038
|
+
}
|
|
1039
|
+
ctx.dispatch({
|
|
1040
|
+
type: "PATCH",
|
|
1041
|
+
patch
|
|
1042
|
+
});
|
|
1043
|
+
const rank = {
|
|
1044
|
+
none: 0,
|
|
1045
|
+
reclamp: 1,
|
|
1046
|
+
refit: 2,
|
|
1047
|
+
scene: 3,
|
|
1048
|
+
reflow: 4
|
|
1049
|
+
};
|
|
1050
|
+
let strongest = "none";
|
|
1051
|
+
for (const k of keys) if (rank[SETTINGS_EFFECT[k]] > rank[strongest]) strongest = SETTINGS_EFFECT[k];
|
|
1052
|
+
if (strongest === "scene" || strongest === "reflow") sceneCache = null;
|
|
1053
|
+
return strongest;
|
|
1054
|
+
};
|
|
663
1055
|
const initialViewProviders = [];
|
|
664
1056
|
const api = {
|
|
665
1057
|
camera: cam,
|
|
@@ -783,6 +1175,7 @@ function createStageCapability(ctx, config = {}) {
|
|
|
783
1175
|
type: "VP",
|
|
784
1176
|
vp: v
|
|
785
1177
|
});
|
|
1178
|
+
syncResponsive(false);
|
|
786
1179
|
if (v.width > 0 && v.height > 0 && (ctx.document()?.pageCount ?? 0) > 0) api.placeInitial();
|
|
787
1180
|
return;
|
|
788
1181
|
}
|
|
@@ -792,7 +1185,8 @@ function createStageCapability(ctx, config = {}) {
|
|
|
792
1185
|
type: "VP",
|
|
793
1186
|
vp: v
|
|
794
1187
|
});
|
|
795
|
-
|
|
1188
|
+
if (syncResponsive(false) === "reflow") goToTarget(ctx.getState().cursor, { behavior: "instant" });
|
|
1189
|
+
else reapply(anchor);
|
|
796
1190
|
},
|
|
797
1191
|
setDevicePixelRatio: (ratio) => {
|
|
798
1192
|
if (ratio > 0 && ratio !== dpr()) ctx.dispatch({
|
|
@@ -807,7 +1201,10 @@ function createStageCapability(ctx, config = {}) {
|
|
|
807
1201
|
},
|
|
808
1202
|
panBy: (dx, dy) => {
|
|
809
1203
|
cancelAnim();
|
|
810
|
-
|
|
1204
|
+
if (gestureDepth > 0 && gestureElastic) {
|
|
1205
|
+
gestureRaw = S.panByScreen(gestureRaw ?? unrubberize(cam()), dx, dy);
|
|
1206
|
+
setCamRaw(rubberize(gestureRaw));
|
|
1207
|
+
} else setCam(S.panByScreen(cam(), dx, dy));
|
|
811
1208
|
syncCursorFromCamera();
|
|
812
1209
|
},
|
|
813
1210
|
scrollTo: (opts) => {
|
|
@@ -833,13 +1230,71 @@ function createStageCapability(ctx, config = {}) {
|
|
|
833
1230
|
const before = buildScene();
|
|
834
1231
|
const focal = before.itemCount ? S.anchorAtPoint(before, S.toWorld(cam(), pt)) : null;
|
|
835
1232
|
setCam(S.zoomAround(cam(), pt, factor));
|
|
836
|
-
ctx.dispatch({
|
|
1233
|
+
if (gestureDepth === 0) ctx.dispatch({
|
|
837
1234
|
type: "PATCH",
|
|
838
1235
|
patch: { zoom: { level: cam().zoom } }
|
|
839
1236
|
});
|
|
840
1237
|
const after = buildScene();
|
|
841
1238
|
if (after !== before && focal && after.itemCount) setCam(S.cameraForAnchorAtScreen(focal, after, pt, cam().zoom));
|
|
1239
|
+
if (gestureDepth > 0 && gestureElastic) gestureRaw = unrubberize(cam());
|
|
1240
|
+
syncCursorFromCamera();
|
|
1241
|
+
},
|
|
1242
|
+
beginGesture: (options) => {
|
|
1243
|
+
gestureDepth++;
|
|
1244
|
+
if (gestureDepth === 1) {
|
|
1245
|
+
cancelAnim();
|
|
1246
|
+
gestureZoomed = false;
|
|
1247
|
+
gestureElastic = options?.elastic === true;
|
|
1248
|
+
gestureRaw = null;
|
|
1249
|
+
}
|
|
1250
|
+
},
|
|
1251
|
+
endGesture: () => {
|
|
1252
|
+
if (gestureDepth === 0) return;
|
|
1253
|
+
gestureDepth--;
|
|
1254
|
+
if (gestureDepth > 0) return;
|
|
1255
|
+
gestureRaw = null;
|
|
1256
|
+
const wasElastic = gestureElastic;
|
|
1257
|
+
gestureElastic = false;
|
|
1258
|
+
if (gestureZoomed) {
|
|
1259
|
+
gestureZoomed = false;
|
|
1260
|
+
ctx.dispatch({
|
|
1261
|
+
type: "PATCH",
|
|
1262
|
+
patch: { zoom: { level: cam().zoom } }
|
|
1263
|
+
});
|
|
1264
|
+
armRest();
|
|
1265
|
+
}
|
|
842
1266
|
syncCursorFromCamera();
|
|
1267
|
+
if (wasElastic) {
|
|
1268
|
+
const c = cam();
|
|
1269
|
+
const cl = S.clampCamera(c, stayBounds(), vp(), constraint());
|
|
1270
|
+
if (cl.x !== c.x || cl.y !== c.y) startCameraPhysics(0, 0);
|
|
1271
|
+
}
|
|
1272
|
+
},
|
|
1273
|
+
fling: (vx, vy) => startCameraPhysics(vx, vy),
|
|
1274
|
+
cameraInMotion: () => raf !== 0,
|
|
1275
|
+
doubleTapZoom: (pt) => {
|
|
1276
|
+
cancelAnim();
|
|
1277
|
+
const sc0 = buildScene();
|
|
1278
|
+
if (!sc0.itemCount) return;
|
|
1279
|
+
const item = paged() ? sc0.items[0] : sc0.items[itemIndexOfPage(ctx.getState().cursor)];
|
|
1280
|
+
const fit = fitBox(item);
|
|
1281
|
+
const auto = S.resolveZoom({ mode: S.ZoomMode.Automatic }, fit, vp(), pad());
|
|
1282
|
+
const stops = [
|
|
1283
|
+
auto,
|
|
1284
|
+
S.resolveZoom({ mode: S.ZoomMode.FitWidth }, fit, vp(), pad()),
|
|
1285
|
+
Math.min(auto * 2.5, S.ZOOM_MAX)
|
|
1286
|
+
].sort((a, b) => a - b).filter((z, i, all) => i === 0 || z > all[i - 1] * 1.1);
|
|
1287
|
+
const near = (z, stop) => z > stop / 1.1 && z < stop * 1.1;
|
|
1288
|
+
const onRung = stops.findIndex((s) => near(cam().zoom, s));
|
|
1289
|
+
const target = onRung >= 0 ? stops[(onRung + 1) % stops.length] : stops[0];
|
|
1290
|
+
ctx.dispatch({
|
|
1291
|
+
type: "PATCH",
|
|
1292
|
+
patch: { zoom: { level: target } }
|
|
1293
|
+
});
|
|
1294
|
+
const sc = buildScene();
|
|
1295
|
+
if (!sc.itemCount) return;
|
|
1296
|
+
const focal = S.anchorAtPoint(sc, S.toWorld(cam(), pt));
|
|
1297
|
+
animateZoomAnchored(focal, pt, target, 240, syncCursorFromCamera);
|
|
843
1298
|
},
|
|
844
1299
|
zoomIn: () => api.zoomAround(alignPoint(ctx.getState().zoomAlign, vp()), 1.2),
|
|
845
1300
|
zoomOut: () => api.zoomAround(alignPoint(ctx.getState().zoomAlign, vp()), 1 / 1.2),
|
|
@@ -924,20 +1379,17 @@ function createStageCapability(ctx, config = {}) {
|
|
|
924
1379
|
},
|
|
925
1380
|
next: (opts) => step(1, opts),
|
|
926
1381
|
prev: (opts) => step(-1, opts),
|
|
1382
|
+
lensId: () => ctx.id,
|
|
927
1383
|
update: (patch) => {
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
const align = touched("refit") && !touched("scene") && !touched("reflow") ? ctx.getState().zoomAlign : ctx.getState().anchorAlign;
|
|
931
|
-
const anchor = anchorAt(alignPoint(align, vp()));
|
|
932
|
-
ctx.dispatch({
|
|
933
|
-
type: "PATCH",
|
|
934
|
-
patch
|
|
935
|
-
});
|
|
936
|
-
if (touched("scene")) sceneCache = null;
|
|
937
|
-
if (touched("reflow")) goToTarget(ctx.getState().cursor, { behavior: "instant" });
|
|
938
|
-
else if (touched("scene") || touched("refit")) reapply(anchor, align);
|
|
939
|
-
else if (touched("reclamp")) setCam(cam());
|
|
1384
|
+
base = mergeSettings(base, patch);
|
|
1385
|
+
syncResponsive(true);
|
|
940
1386
|
},
|
|
1387
|
+
setResponsive: (next) => {
|
|
1388
|
+
rules = next;
|
|
1389
|
+
syncResponsive(true);
|
|
1390
|
+
},
|
|
1391
|
+
matches: (name) => ctx.getState().activeRules.includes(name),
|
|
1392
|
+
activeRules: () => ctx.getState().activeRules,
|
|
941
1393
|
setFlow: (flow) => api.update({ flow }),
|
|
942
1394
|
setLayout: (layout) => api.update({ layout }),
|
|
943
1395
|
setSpread: (spread) => api.update({ spread }),
|
|
@@ -957,9 +1409,13 @@ function createStageCapability(ctx, config = {}) {
|
|
|
957
1409
|
setScrollBehavior: (behavior) => api.update({ scrollBehavior: behavior }),
|
|
958
1410
|
applyViewState: (view) => {
|
|
959
1411
|
cancelAnim();
|
|
1412
|
+
base = mergeSettings(base, pickSettings(view));
|
|
1413
|
+
const { effective, active } = resolveResponsive(base, rules, boxOf(vp()));
|
|
1414
|
+
lastEffective = effective;
|
|
1415
|
+
publishActive(active);
|
|
960
1416
|
ctx.dispatch({
|
|
961
1417
|
type: "PATCH",
|
|
962
|
-
patch:
|
|
1418
|
+
patch: effective
|
|
963
1419
|
});
|
|
964
1420
|
ctx.dispatch({
|
|
965
1421
|
type: "CURSOR",
|
|
@@ -991,46 +1447,6 @@ function createStageCapability(ctx, config = {}) {
|
|
|
991
1447
|
return api;
|
|
992
1448
|
}
|
|
993
1449
|
//#endregion
|
|
994
|
-
//#region src/scroll-handler.ts
|
|
995
|
-
/**
|
|
996
|
-
* Pan-the-camera as an interaction handler. Live under the built-in `pan` tool
|
|
997
|
-
* (the `scroll` tag) and — with `panFallback` — under every tool, where it then
|
|
998
|
-
* captures ONLY page-gap drags (on-page downs belong to the active tool, which
|
|
999
|
-
* claims them first at higher priority). It uses the sample's viewport delta, so
|
|
1000
|
-
* it pans over the whole viewport (pages and gaps).
|
|
1001
|
-
*
|
|
1002
|
-
* Cursor feel: a closed hand (`grabbing`) while dragging; an open hand (`grab`)
|
|
1003
|
-
* hovering a gap under a non-pan tool. The pan tool's own resting `grab` comes
|
|
1004
|
-
* from its `Tool.cursor`, so hovering it needs no claim here.
|
|
1005
|
-
*/
|
|
1006
|
-
function createScrollHandler(stage, interaction, options = {}) {
|
|
1007
|
-
const panFallback = options.panFallback ?? true;
|
|
1008
|
-
let last = {
|
|
1009
|
-
x: 0,
|
|
1010
|
-
y: 0
|
|
1011
|
-
};
|
|
1012
|
-
const isPanTool = () => interaction.activeTool().enables.has("scroll");
|
|
1013
|
-
return {
|
|
1014
|
-
id: "stage-scroll",
|
|
1015
|
-
priority: 10,
|
|
1016
|
-
enabledFor: (tool) => tool.enables.has("scroll") || panFallback,
|
|
1017
|
-
onDown: (s) => {
|
|
1018
|
-
if (!isPanTool() && s.page) return false;
|
|
1019
|
-
last = s.viewport;
|
|
1020
|
-
interaction.setCursor("stage-grab", "grabbing", 40);
|
|
1021
|
-
return true;
|
|
1022
|
-
},
|
|
1023
|
-
onMove: (s) => {
|
|
1024
|
-
stage.panBy(s.viewport.x - last.x, s.viewport.y - last.y);
|
|
1025
|
-
last = s.viewport;
|
|
1026
|
-
},
|
|
1027
|
-
onUp: () => interaction.setCursor("stage-grab", null),
|
|
1028
|
-
onHover: (s) => {
|
|
1029
|
-
if (panFallback && !isPanTool()) interaction.setCursor("stage-pan-fallback", s.page ? null : "grab", 5);
|
|
1030
|
-
}
|
|
1031
|
-
};
|
|
1032
|
-
}
|
|
1033
|
-
//#endregion
|
|
1034
1450
|
//#region src/effects.ts
|
|
1035
1451
|
/**
|
|
1036
1452
|
* The one effect a stage lens needs: when the document's page registry changes
|
|
@@ -1053,7 +1469,7 @@ function registerStageEffects(ctx, token) {
|
|
|
1053
1469
|
//#endregion
|
|
1054
1470
|
//#region src/reducer.ts
|
|
1055
1471
|
const initialStageState = (config) => {
|
|
1056
|
-
const { scheduler: _scheduler, ...overrides } = config;
|
|
1472
|
+
const { scheduler: _scheduler, responsive: _responsive, ...overrides } = config;
|
|
1057
1473
|
return {
|
|
1058
1474
|
camera: {
|
|
1059
1475
|
x: 0,
|
|
@@ -1067,6 +1483,7 @@ const initialStageState = (config) => {
|
|
|
1067
1483
|
},
|
|
1068
1484
|
dpr: 1,
|
|
1069
1485
|
cursor: 0,
|
|
1486
|
+
activeRules: [],
|
|
1070
1487
|
...DEFAULT_SETTINGS,
|
|
1071
1488
|
...overrides
|
|
1072
1489
|
};
|
|
@@ -1109,6 +1526,10 @@ const stageReducer = (state, a) => {
|
|
|
1109
1526
|
cursor: a.cursor
|
|
1110
1527
|
};
|
|
1111
1528
|
case "PATCH": return applyPatch(state, a.patch);
|
|
1529
|
+
case "RESPONSIVE": return {
|
|
1530
|
+
...state,
|
|
1531
|
+
activeRules: a.active
|
|
1532
|
+
};
|
|
1112
1533
|
default: return state;
|
|
1113
1534
|
}
|
|
1114
1535
|
};
|
|
@@ -1123,19 +1544,14 @@ const StageToken = createCapabilityToken("stage");
|
|
|
1123
1544
|
* sibling files.
|
|
1124
1545
|
*/
|
|
1125
1546
|
const stagePlugin = (options = {}) => {
|
|
1126
|
-
const { id = "stage", token = StageToken,
|
|
1547
|
+
const { id = "stage", token = StageToken, ...config } = options;
|
|
1127
1548
|
return definePlugin({
|
|
1128
1549
|
id,
|
|
1129
1550
|
token,
|
|
1130
1551
|
scope: "document",
|
|
1131
|
-
optional: interaction ? [InteractionToken] : void 0,
|
|
1132
1552
|
initialState: () => initialStageState(config),
|
|
1133
1553
|
reduce: stageReducer,
|
|
1134
1554
|
capability: (ctx) => createStageCapability(ctx, config),
|
|
1135
|
-
init: interaction ? (ctx) => {
|
|
1136
|
-
const ix = ctx.tryGet(InteractionToken);
|
|
1137
|
-
if (ix) ix.registerHandler(createScrollHandler(ctx.get(token), ix, { panFallback }));
|
|
1138
|
-
} : void 0,
|
|
1139
1555
|
effects: (ctx) => registerStageEffects(ctx, token)
|
|
1140
1556
|
});
|
|
1141
1557
|
};
|
|
@@ -1282,19 +1698,46 @@ function destinationToReveal(dest, layout, bbox) {
|
|
|
1282
1698
|
};
|
|
1283
1699
|
}
|
|
1284
1700
|
//#endregion
|
|
1285
|
-
//#region src/
|
|
1286
|
-
/**
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1701
|
+
//#region src/scroll-handler.ts
|
|
1702
|
+
/**
|
|
1703
|
+
* Pan-the-camera as an interaction handler. Live under the built-in `pan` tool
|
|
1704
|
+
* (the `scroll` tag) and — with `panFallback` — under every tool, where it then
|
|
1705
|
+
* captures ONLY page-gap drags (on-page downs belong to the active tool, which
|
|
1706
|
+
* claims them first at higher priority). It uses the sample's viewport delta, so
|
|
1707
|
+
* it pans over the whole viewport (pages and gaps).
|
|
1708
|
+
*
|
|
1709
|
+
* Cursor feel: a closed hand (`grabbing`) while dragging; an open hand (`grab`)
|
|
1710
|
+
* hovering a gap under a non-pan tool. The pan tool's own resting `grab` comes
|
|
1711
|
+
* from its `Tool.cursor`, so hovering it needs no claim here.
|
|
1712
|
+
*/
|
|
1713
|
+
function createScrollHandler(stage, interaction, options = {}) {
|
|
1714
|
+
const panFallback = options.panFallback ?? true;
|
|
1715
|
+
let last = {
|
|
1716
|
+
x: 0,
|
|
1717
|
+
y: 0
|
|
1718
|
+
};
|
|
1719
|
+
const isPanTool = () => interaction.activeTool().enables.has("scroll");
|
|
1720
|
+
return {
|
|
1721
|
+
id: "stage-scroll",
|
|
1722
|
+
priority: 10,
|
|
1723
|
+
enabledFor: (tool) => tool.enables.has("scroll") || panFallback,
|
|
1724
|
+
onDown: (s) => {
|
|
1725
|
+
if (!isPanTool() && s.page) return false;
|
|
1726
|
+
last = s.viewport;
|
|
1727
|
+
interaction.setCursor("stage-grab", "grabbing", 40);
|
|
1728
|
+
return true;
|
|
1729
|
+
},
|
|
1730
|
+
onMove: (s) => {
|
|
1731
|
+
stage.panBy(s.viewport.x - last.x, s.viewport.y - last.y);
|
|
1732
|
+
last = s.viewport;
|
|
1733
|
+
},
|
|
1734
|
+
onUp: () => interaction.setCursor("stage-grab", null),
|
|
1735
|
+
onHover: (s) => {
|
|
1736
|
+
if (panFallback && !isPanTool()) interaction.setCursor("stage-pan-fallback", s.page ? null : "grab", 5);
|
|
1737
|
+
}
|
|
1738
|
+
};
|
|
1296
1739
|
}
|
|
1297
1740
|
//#endregion
|
|
1298
|
-
export { DEFAULT_SETTINGS, StageToken, ZoomMode, destinationToReveal, settingsEqual, stagePlugin
|
|
1741
|
+
export { DEFAULT_RESPONSIVE, DEFAULT_SETTINGS, StageToken, ZoomMode, boxOf, createScrollHandler, destinationToReveal, matchesQuery, resolveResponsive, settingsEqual, stagePlugin };
|
|
1299
1742
|
|
|
1300
1743
|
//# sourceMappingURL=index.js.map
|