@motion.page/sdk 1.1.0 → 1.1.2
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/core/Animation.d.ts +6 -0
- package/dist/core/Engine.d.ts +4 -0
- package/dist/core/Timeline.d.ts +27 -2
- package/dist/index.cjs +20 -21
- package/dist/index.js +20 -21
- package/dist/triggers/CursorTrigger.d.ts +2 -0
- package/dist/triggers/EventTrigger.d.ts +3 -1
- package/dist/triggers/GestureTrigger.d.ts +1 -0
- package/dist/triggers/GlobalPointerListener.d.ts +22 -0
- package/dist/triggers/GlobalScrollListener.d.ts +1 -1
- package/dist/triggers/MouseMoveTrigger.d.ts +4 -0
- package/package.json +4 -3
- package/dist/index.cjs.map +0 -55
- package/dist/index.js.map +0 -55
package/dist/core/Animation.d.ts
CHANGED
|
@@ -58,6 +58,7 @@ export declare class Animation {
|
|
|
58
58
|
private _pendingFitSetup;
|
|
59
59
|
private _fitCleanupFn;
|
|
60
60
|
private _unregisterCallback;
|
|
61
|
+
private _activationCallback;
|
|
61
62
|
/**
|
|
62
63
|
* Initialize the animation
|
|
63
64
|
*/
|
|
@@ -190,6 +191,11 @@ export declare class Animation {
|
|
|
190
191
|
* This avoids circular dependency with Engine
|
|
191
192
|
*/
|
|
192
193
|
setUnregisterCallback(callback: () => void): void;
|
|
194
|
+
/**
|
|
195
|
+
* Set callback invoked whenever this animation becomes active.
|
|
196
|
+
* Used by Engine to restart the global ticker after it idles.
|
|
197
|
+
*/
|
|
198
|
+
setActivationCallback(callback: () => void): void;
|
|
193
199
|
/**
|
|
194
200
|
* Capture current element values as start values for all PropTweens
|
|
195
201
|
* This enables proper chaining in timelines
|
package/dist/core/Engine.d.ts
CHANGED
|
@@ -25,6 +25,7 @@ export declare class Engine {
|
|
|
25
25
|
private timelines;
|
|
26
26
|
private _captureTarget;
|
|
27
27
|
private ticker;
|
|
28
|
+
private _tickerSubscribed;
|
|
28
29
|
private animationPool;
|
|
29
30
|
private propTweenPool;
|
|
30
31
|
private constructor();
|
|
@@ -36,6 +37,9 @@ export declare class Engine {
|
|
|
36
37
|
* Main update loop called by Ticker
|
|
37
38
|
*/
|
|
38
39
|
private update;
|
|
40
|
+
private _ensureTickerSubscription;
|
|
41
|
+
private _hasActiveWork;
|
|
42
|
+
private _releaseTickerIfIdle;
|
|
39
43
|
/**
|
|
40
44
|
* Create a new animation (called by AnimationBuilder)
|
|
41
45
|
* Returns either a single Animation or an array of Animations (for stagger)
|
package/dist/core/Timeline.d.ts
CHANGED
|
@@ -21,11 +21,17 @@ export declare class Timeline {
|
|
|
21
21
|
* @internal
|
|
22
22
|
*/
|
|
23
23
|
private static _registerWithEngine;
|
|
24
|
+
private static _activateEngine;
|
|
24
25
|
/**
|
|
25
26
|
* Set the engine registration callback. Called once by Engine during initialization.
|
|
26
27
|
* @internal
|
|
27
28
|
*/
|
|
28
29
|
static setEngineRegisterCallback(callback: (name: string, timeline: Timeline) => void): void;
|
|
30
|
+
/**
|
|
31
|
+
* Set the engine activation callback. Called once by Engine during initialization.
|
|
32
|
+
* @internal
|
|
33
|
+
*/
|
|
34
|
+
static setEngineActivationCallback(callback: () => void): void;
|
|
29
35
|
private _name?;
|
|
30
36
|
private _children;
|
|
31
37
|
private _duration;
|
|
@@ -62,6 +68,7 @@ export declare class Timeline {
|
|
|
62
68
|
* @internal
|
|
63
69
|
*/
|
|
64
70
|
setUnregisterCallback(callback: () => void): void;
|
|
71
|
+
private _notifyActivated;
|
|
65
72
|
private _previousStart;
|
|
66
73
|
private _previousEnd;
|
|
67
74
|
private _eachInstances?;
|
|
@@ -149,10 +156,28 @@ export declare class Timeline {
|
|
|
149
156
|
private _createInstanceForElement;
|
|
150
157
|
/**
|
|
151
158
|
* Create a timeline instance for multiple elements (for each mode with explicit container target).
|
|
152
|
-
* This is a sibling of _createInstanceForElement — the
|
|
153
|
-
* Element[]
|
|
159
|
+
* This is a sibling of _createInstanceForElement — the difference is that it accepts an
|
|
160
|
+
* Element[] of scoped targets (animation targets belonging to one container).
|
|
161
|
+
*
|
|
162
|
+
* Per-builder filtering: each cloned builder ONLY animates the subset of `elements`
|
|
163
|
+
* that the original builder targeted. Without this, a builder for `.subtitle` would
|
|
164
|
+
* also animate `.eyebrow` and `.section-title` elements that happen to share the
|
|
165
|
+
* same scoped container — producing visually broken animations.
|
|
154
166
|
*/
|
|
155
167
|
private _createInstanceForElements;
|
|
168
|
+
/**
|
|
169
|
+
* Find animation targets that "belong" to a container in each-mode.
|
|
170
|
+
*
|
|
171
|
+
* Strategy 1 (preferred): descendants of the container.
|
|
172
|
+
* Strategy 2 (sibling fallback): anim targets sharing the container's parent
|
|
173
|
+
* that aren't owned by another container.
|
|
174
|
+
*
|
|
175
|
+
* Returns [] when neither strategy yields targets — the caller skips this
|
|
176
|
+
* container, dropping the orphaned anim targets entirely. This matches the
|
|
177
|
+
* documented behaviour: when each:true + explicit target is set, only anim
|
|
178
|
+
* targets associated with a container (descendant or sibling) are animated.
|
|
179
|
+
*/
|
|
180
|
+
private _findScopedTargetsForContainer;
|
|
156
181
|
/**
|
|
157
182
|
* Resolve a CSS selector string or Element into an array of DOM elements.
|
|
158
183
|
*/
|