@ssgoi/core 7.1.2 → 7.1.3-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +58 -10
- package/dist/animation/animation.d.ts +20 -0
- package/dist/animation/animation.d.ts.map +1 -1
- package/dist/animation/integrator/double-spring-integrator.d.ts +3 -0
- package/dist/animation/integrator/double-spring-integrator.d.ts.map +1 -1
- package/dist/animation/integrator/inertia-integrator.d.ts +2 -2
- package/dist/animation/integrator/inertia-integrator.d.ts.map +1 -1
- package/dist/animation/integrator/spring-integrator.d.ts +2 -0
- package/dist/animation/integrator/spring-integrator.d.ts.map +1 -1
- package/dist/animation/multi-animation.d.ts +37 -9
- package/dist/animation/multi-animation.d.ts.map +1 -1
- package/dist/animation/web-animation.d.ts +20 -2
- package/dist/animation/web-animation.d.ts.map +1 -1
- package/dist/index-B_K3Vnj-.js +55 -0
- package/dist/index-CtyacfH7.cjs +1 -0
- package/dist/index.cjs +4 -4
- package/dist/index.d.ts +8 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1483 -1245
- package/dist/internal.cjs +1 -1
- package/dist/internal.d.ts +1 -0
- package/dist/internal.d.ts.map +1 -1
- package/dist/internal.js +5 -3
- package/dist/motion/index.d.ts +4 -0
- package/dist/motion/index.d.ts.map +1 -0
- package/dist/motion/presets.d.ts +13 -0
- package/dist/motion/presets.d.ts.map +1 -0
- package/dist/motion/spring.d.ts +46 -0
- package/dist/motion/spring.d.ts.map +1 -0
- package/dist/motion/with-override.d.ts +2 -0
- package/dist/motion/with-override.d.ts.map +1 -0
- package/dist/multi-animation-Du9W3ZS_.js +503 -0
- package/dist/multi-animation-hDUcfD7W.cjs +1 -0
- package/dist/page-motion-DF3fFkOw.cjs +1 -0
- package/dist/page-motion-MEazegOU.js +43 -0
- package/dist/provider-Cea0Pfm1.js +232 -0
- package/dist/provider-D9Q2URox.cjs +1 -0
- package/dist/runtime.cjs +1 -1
- package/dist/runtime.js +12 -12
- package/dist/transition/define-transition.d.ts +52 -0
- package/dist/transition/define-transition.d.ts.map +1 -0
- package/dist/transitions/animation-group.d.ts +7 -0
- package/dist/transitions/animation-group.d.ts.map +1 -0
- package/dist/transitions/axis/index.d.ts +3 -2
- package/dist/transitions/axis/index.d.ts.map +1 -1
- package/dist/transitions/axis/transition.d.ts +2 -2
- package/dist/transitions/axis/transition.d.ts.map +1 -1
- package/dist/transitions/blind/index.d.ts +3 -2
- package/dist/transitions/blind/index.d.ts.map +1 -1
- package/dist/transitions/blind/transition.d.ts +3 -10
- package/dist/transitions/blind/transition.d.ts.map +1 -1
- package/dist/transitions/drill/index.d.ts +3 -2
- package/dist/transitions/drill/index.d.ts.map +1 -1
- package/dist/transitions/drill/transition.d.ts +2 -2
- package/dist/transitions/drill/transition.d.ts.map +1 -1
- package/dist/transitions/fade/index.d.ts +3 -2
- package/dist/transitions/fade/index.d.ts.map +1 -1
- package/dist/transitions/fade/transition.d.ts +3 -2
- package/dist/transitions/fade/transition.d.ts.map +1 -1
- package/dist/transitions/film/index.d.ts +3 -2
- package/dist/transitions/film/index.d.ts.map +1 -1
- package/dist/transitions/film/transition.d.ts +2 -20
- package/dist/transitions/film/transition.d.ts.map +1 -1
- package/dist/transitions/hero/index.d.ts +5 -3
- package/dist/transitions/hero/index.d.ts.map +1 -1
- package/dist/transitions/hero/provider/chrome/fade.d.ts.map +1 -1
- package/dist/transitions/hero/provider/chrome/static.d.ts.map +1 -1
- package/dist/transitions/hero/transition.d.ts +2 -6
- package/dist/transitions/hero/transition.d.ts.map +1 -1
- package/dist/transitions/hero/types.d.ts +5 -3
- package/dist/transitions/hero/types.d.ts.map +1 -1
- package/dist/transitions/jaemin/index.d.ts +3 -2
- package/dist/transitions/jaemin/index.d.ts.map +1 -1
- package/dist/transitions/jaemin/transition.d.ts +3 -2
- package/dist/transitions/jaemin/transition.d.ts.map +1 -1
- package/dist/transitions/rotate/index.d.ts +3 -2
- package/dist/transitions/rotate/index.d.ts.map +1 -1
- package/dist/transitions/rotate/transition.d.ts +3 -2
- package/dist/transitions/rotate/transition.d.ts.map +1 -1
- package/dist/transitions/scroll/index.d.ts +3 -2
- package/dist/transitions/scroll/index.d.ts.map +1 -1
- package/dist/transitions/scroll/transition.d.ts +3 -2
- package/dist/transitions/scroll/transition.d.ts.map +1 -1
- package/dist/transitions/sheet/index.d.ts +3 -2
- package/dist/transitions/sheet/index.d.ts.map +1 -1
- package/dist/transitions/sheet/transition.d.ts +2 -6
- package/dist/transitions/sheet/transition.d.ts.map +1 -1
- package/dist/transitions/slide/index.d.ts +3 -2
- package/dist/transitions/slide/index.d.ts.map +1 -1
- package/dist/transitions/slide/transition.d.ts +3 -2
- package/dist/transitions/slide/transition.d.ts.map +1 -1
- package/dist/transitions/strip/index.d.ts +3 -2
- package/dist/transitions/strip/index.d.ts.map +1 -1
- package/dist/transitions/strip/transition.d.ts +3 -2
- package/dist/transitions/strip/transition.d.ts.map +1 -1
- package/dist/transitions/zoom/index.d.ts +3 -2
- package/dist/transitions/zoom/index.d.ts.map +1 -1
- package/dist/transitions/zoom/provider/blur.d.ts +2 -0
- package/dist/transitions/zoom/provider/blur.d.ts.map +1 -1
- package/dist/transitions/zoom/provider/expand.d.ts +1 -0
- package/dist/transitions/zoom/provider/expand.d.ts.map +1 -1
- package/dist/transitions/zoom/provider/static.d.ts +1 -0
- package/dist/transitions/zoom/provider/static.d.ts.map +1 -1
- package/dist/transitions/zoom/transition.d.ts +2 -3
- package/dist/transitions/zoom/transition.d.ts.map +1 -1
- package/dist/transitions/zoom/types.d.ts +2 -0
- package/dist/transitions/zoom/types.d.ts.map +1 -1
- package/dist/types/index.d.ts +5 -3
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types.cjs +1 -1
- package/dist/types.js +2 -4
- package/package.json +1 -1
- package/dist/multi-animation-B5hEmEgN.cjs +0 -1
- package/dist/multi-animation-DyZGEfKy.js +0 -383
- package/dist/page-motion-gH3WomQO.cjs +0 -1
- package/dist/page-motion-wmW7PW6B.js +0 -204
- package/dist/timeline-L_vXntmP.js +0 -68
- package/dist/timeline-Zoo1I4XU.cjs +0 -1
package/README.md
CHANGED
|
@@ -83,25 +83,73 @@ DOM lifetime:
|
|
|
83
83
|
This supports persistent layouts, inner tab transitions, and bottom navigation
|
|
84
84
|
with one SSGOI instance.
|
|
85
85
|
|
|
86
|
-
##
|
|
86
|
+
## Motion overrides
|
|
87
87
|
|
|
88
|
-
|
|
88
|
+
Keep the preset's defaults and change only the selected direction or named group:
|
|
89
89
|
|
|
90
90
|
```ts
|
|
91
|
-
import {
|
|
92
|
-
|
|
93
|
-
const
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
91
|
+
import { axis, spring } from "@ssgoi/core";
|
|
92
|
+
|
|
93
|
+
const tuned = axis({ type: "x" }, {
|
|
94
|
+
override: {
|
|
95
|
+
forward({ animation }) {
|
|
96
|
+
const out = animation.select("out");
|
|
97
|
+
animation.select("in").set({
|
|
98
|
+
integrator: spring({ stiffness: 320, damping: 30 }),
|
|
99
|
+
startAt: { after: out, at: 0.3 },
|
|
100
|
+
});
|
|
101
|
+
},
|
|
97
102
|
},
|
|
98
|
-
|
|
99
|
-
|
|
103
|
+
});
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
The callback receives `{ animation, context }`. Named children are inferred from
|
|
107
|
+
that preset's return type. `animation.set({ integrator })` explicitly retunes the
|
|
108
|
+
whole group. Numeric start thresholds use first crossing; `at: "settled"` waits
|
|
109
|
+
for completion. Custom `Integrator` instances are supported.
|
|
110
|
+
|
|
111
|
+
[Motion guide](https://ssgoi.dev/docs/motion) ·
|
|
112
|
+
[Plain-text API](https://ssgoi.dev/llms/motion.txt)
|
|
113
|
+
|
|
114
|
+
## Custom transitions
|
|
115
|
+
|
|
116
|
+
`defineTransition` pairs each direction's preparation with its animation factory.
|
|
117
|
+
Prepared values and concrete return types are inferred independently. The core
|
|
118
|
+
accepts any `Animation`; it does not require `MultiAnimation`.
|
|
119
|
+
|
|
120
|
+
```ts
|
|
121
|
+
import { defineTransition, WebAnimation, spring } from "@ssgoi/core";
|
|
122
|
+
|
|
123
|
+
const physics = spring({ stiffness: 300, damping: 30 });
|
|
124
|
+
const makeDirection = () => ({
|
|
125
|
+
animation({ from }: { from: HTMLElement }) {
|
|
126
|
+
const previousOpacity = from.style.opacity;
|
|
127
|
+
const animation = new WebAnimation({
|
|
128
|
+
element: from,
|
|
129
|
+
integrator: physics,
|
|
130
|
+
style: (_t, u) => ({ opacity: u }),
|
|
131
|
+
onComplete() {
|
|
132
|
+
from.style.opacity = previousOpacity;
|
|
133
|
+
animation.releaseFill();
|
|
134
|
+
},
|
|
135
|
+
});
|
|
100
136
|
return animation;
|
|
101
137
|
},
|
|
102
138
|
});
|
|
139
|
+
|
|
140
|
+
const effect = defineTransition({
|
|
141
|
+
forward: makeDirection(),
|
|
142
|
+
backward: makeDirection(),
|
|
143
|
+
});
|
|
103
144
|
```
|
|
104
145
|
|
|
146
|
+
The core determines `context.direction` from route rules and history. Transitions
|
|
147
|
+
consume it unchanged. Keep per-run DOM snapshots in prepared data or animation
|
|
148
|
+
closures and restore styles when reusable page nodes finish animating.
|
|
149
|
+
|
|
150
|
+
[Complete custom transition example](https://ssgoi.dev/docs/custom-transitions) ·
|
|
151
|
+
[Custom integrators and lifecycle reference](https://ssgoi.dev/llms/custom-transitions.txt)
|
|
152
|
+
|
|
105
153
|
## Effect index
|
|
106
154
|
|
|
107
155
|
- `fade`: unrelated pages.
|
|
@@ -1,6 +1,26 @@
|
|
|
1
1
|
import { Animation as RuntimeAnimation } from '../runtime/animation';
|
|
2
2
|
import { StyleObject } from '../runtime/motion-state';
|
|
3
|
+
import { Integrator } from './integrator/types';
|
|
4
|
+
/** A start dependency between siblings in the same composite. */
|
|
5
|
+
export interface AnimationStart<TTarget = HTMLElement, TStyle = StyleObject> {
|
|
6
|
+
after: Animation<TTarget, TStyle>;
|
|
7
|
+
/** Numeric progress means first crossing; settled waits for completion. */
|
|
8
|
+
at: number | "settled";
|
|
9
|
+
}
|
|
10
|
+
export interface AnimationPatch<TTarget = HTMLElement, TStyle = StyleObject> {
|
|
11
|
+
/** An integrator instance, including a custom stateless implementation. */
|
|
12
|
+
integrator?: Integrator;
|
|
13
|
+
/** null restores the parent's original scheduling for this child. */
|
|
14
|
+
startAt?: AnimationStart<TTarget, TStyle> | null;
|
|
15
|
+
}
|
|
3
16
|
/** Web-compatible default; platform-neutral consumers use @ssgoi/core/runtime. */
|
|
4
17
|
export declare abstract class Animation<TTarget = HTMLElement, TStyle = StyleObject> extends RuntimeAnimation<TTarget, TStyle> {
|
|
18
|
+
private _startCondition;
|
|
19
|
+
/** Scheduling metadata read by the parent immediately before playback. */
|
|
20
|
+
get startCondition(): Readonly<AnimationStart<TTarget, TStyle>> | undefined;
|
|
21
|
+
/** Retune this animation before playback; omitted values stay unchanged. */
|
|
22
|
+
set(patch: AnimationPatch<TTarget, TStyle>): this;
|
|
23
|
+
/** Custom drivers can opt into physics editing by implementing this method. */
|
|
24
|
+
protected setIntegrator(_integrator: Integrator): void;
|
|
5
25
|
}
|
|
6
26
|
//# sourceMappingURL=animation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"animation.d.ts","sourceRoot":"","sources":["../../src/lib/animation/animation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,IAAI,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACrE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"animation.d.ts","sourceRoot":"","sources":["../../src/lib/animation/animation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,IAAI,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACrE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAErD,iEAAiE;AACjE,MAAM,WAAW,cAAc,CAAC,OAAO,GAAG,WAAW,EAAE,MAAM,GAAG,WAAW;IACzE,KAAK,EAAE,SAAS,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IAClC,2EAA2E;IAC3E,EAAE,EAAE,MAAM,GAAG,SAAS,CAAC;CACxB;AAED,MAAM,WAAW,cAAc,CAAC,OAAO,GAAG,WAAW,EAAE,MAAM,GAAG,WAAW;IACzE,2EAA2E;IAC3E,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,qEAAqE;IACrE,OAAO,CAAC,EAAE,cAAc,CAAC,OAAO,EAAE,MAAM,CAAC,GAAG,IAAI,CAAC;CAClD;AAED,kFAAkF;AAClF,8BAAsB,SAAS,CAC7B,OAAO,GAAG,WAAW,EACrB,MAAM,GAAG,WAAW,CACpB,SAAQ,gBAAgB,CAAC,OAAO,EAAE,MAAM,CAAC;IACzC,OAAO,CAAC,eAAe,CAA8C;IAErE,0EAA0E;IAC1E,IAAI,cAAc,IAAI,QAAQ,CAAC,cAAc,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,GAAG,SAAS,CAE1E;IAED,4EAA4E;IAC5E,GAAG,CAAC,KAAK,EAAE,cAAc,CAAC,OAAO,EAAE,MAAM,CAAC,GAAG,IAAI;IAyBjD,+EAA+E;IAC/E,SAAS,CAAC,aAAa,CAAC,WAAW,EAAE,UAAU,GAAG,IAAI;CAGvD"}
|
|
@@ -20,6 +20,9 @@ export interface DoubleSpringIntegratorConfig extends SpringIntegratorConfig {
|
|
|
20
20
|
follower?: number | FollowerSpringConfig;
|
|
21
21
|
}
|
|
22
22
|
export declare class DoubleSpringIntegrator implements Integrator {
|
|
23
|
+
/** Leader spring values (the follower is derived; see `follower`). */
|
|
24
|
+
readonly stiffness: number;
|
|
25
|
+
readonly damping: number;
|
|
23
26
|
private readonly leader;
|
|
24
27
|
private readonly follower;
|
|
25
28
|
private readonly restDelta;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"double-spring-integrator.d.ts","sourceRoot":"","sources":["../../../src/lib/animation/integrator/double-spring-integrator.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE3D,OAAO,EAEL,KAAK,sBAAsB,EAC5B,MAAM,qBAAqB,CAAC;AAE7B;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,8DAA8D;IAC9D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,8DAA8D;IAC9D,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,4BAA6B,SAAQ,sBAAsB;IAC1E;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,GAAG,oBAAoB,CAAC;CAC1C;AAOD,qBAAa,sBAAuB,YAAW,UAAU;IACvD,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAmB;IAC1C,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAmB;IAC5C,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAS;IACnC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAS;gBAEvB,MAAM,EAAE,4BAA4B;
|
|
1
|
+
{"version":3,"file":"double-spring-integrator.d.ts","sourceRoot":"","sources":["../../../src/lib/animation/integrator/double-spring-integrator.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE3D,OAAO,EAEL,KAAK,sBAAsB,EAC5B,MAAM,qBAAqB,CAAC;AAE7B;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,8DAA8D;IAC9D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,8DAA8D;IAC9D,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,4BAA6B,SAAQ,sBAAsB;IAC1E;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,GAAG,oBAAoB,CAAC;CAC1C;AAOD,qBAAa,sBAAuB,YAAW,UAAU;IACvD,sEAAsE;IACtE,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAmB;IAC1C,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAmB;IAC5C,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAS;IACnC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAS;gBAEvB,MAAM,EAAE,4BAA4B;IA2ChD,IAAI,CAAC,KAAK,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,eAAe;IA6BzE,SAAS,CAAC,KAAK,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO;CAmB3D"}
|
|
@@ -19,8 +19,8 @@ export interface InertiaIntegratorConfig {
|
|
|
19
19
|
restDelta?: number;
|
|
20
20
|
}
|
|
21
21
|
export declare class InertiaIntegrator implements Integrator {
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
readonly acceleration: number;
|
|
23
|
+
readonly resistance: number;
|
|
24
24
|
private readonly resistanceType;
|
|
25
25
|
private readonly min;
|
|
26
26
|
private readonly max;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inertia-integrator.d.ts","sourceRoot":"","sources":["../../../src/lib/animation/integrator/inertia-integrator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAM3D,MAAM,MAAM,cAAc,GAAG,QAAQ,GAAG,WAAW,CAAC;AAEpD,MAAM,WAAW,uBAAuB;IACtC,wDAAwD;IACxD,YAAY,EAAE,MAAM,CAAC;IACrB,iFAAiF;IACjF,UAAU,EAAE,MAAM,CAAC;IACnB,wFAAwF;IACxF,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,6BAA6B;IAC7B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,6BAA6B;IAC7B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,wDAAwD;IACxD,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,qDAAqD;IACrD,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,8DAA8D;IAC9D,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,qBAAa,iBAAkB,YAAW,UAAU;IAClD,
|
|
1
|
+
{"version":3,"file":"inertia-integrator.d.ts","sourceRoot":"","sources":["../../../src/lib/animation/integrator/inertia-integrator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAM3D,MAAM,MAAM,cAAc,GAAG,QAAQ,GAAG,WAAW,CAAC;AAEpD,MAAM,WAAW,uBAAuB;IACtC,wDAAwD;IACxD,YAAY,EAAE,MAAM,CAAC;IACrB,iFAAiF;IACjF,UAAU,EAAE,MAAM,CAAC;IACnB,wFAAwF;IACxF,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,6BAA6B;IAC7B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,6BAA6B;IAC7B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,wDAAwD;IACxD,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,qDAAqD;IACrD,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,8DAA8D;IAC9D,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,qBAAa,iBAAkB,YAAW,UAAU;IAClD,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAiB;IAChD,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAqB;IACzC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAqB;IACzC,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAS;IACzC,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAS;IACvC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAS;gBAEvB,MAAM,EAAE,uBAAuB;IAW3C,IAAI,CAAC,KAAK,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,eAAe;IA8DzE,SAAS,CAAC,KAAK,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO;CAK3D"}
|
|
@@ -8,6 +8,8 @@ export interface SpringIntegratorConfig {
|
|
|
8
8
|
restSpeed?: number;
|
|
9
9
|
}
|
|
10
10
|
export declare class SpringIntegrator implements Integrator {
|
|
11
|
+
readonly stiffness: number;
|
|
12
|
+
readonly damping: number;
|
|
11
13
|
private readonly omega;
|
|
12
14
|
private readonly zeta;
|
|
13
15
|
private readonly restDelta;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spring-integrator.d.ts","sourceRoot":"","sources":["../../../src/lib/animation/integrator/spring-integrator.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAM3D,MAAM,WAAW,sBAAsB;IACrC,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,8DAA8D;IAC9D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,8DAA8D;IAC9D,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,qBAAa,gBAAiB,YAAW,UAAU;IACjD,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAS;IAC/B,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAS;IAC9B,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAS;IACnC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAS;gBAEvB,MAAM,EAAE,sBAAsB;
|
|
1
|
+
{"version":3,"file":"spring-integrator.d.ts","sourceRoot":"","sources":["../../../src/lib/animation/integrator/spring-integrator.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAM3D,MAAM,WAAW,sBAAsB;IACrC,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,8DAA8D;IAC9D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,8DAA8D;IAC9D,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,qBAAa,gBAAiB,YAAW,UAAU;IACjD,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAS;IAC/B,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAS;IAC9B,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAS;IACnC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAS;gBAEvB,MAAM,EAAE,sBAAsB;IAa1C,IAAI,CAAC,KAAK,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,eAAe;IAmBzE,SAAS,CAAC,KAAK,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO;CAM3D"}
|
|
@@ -1,5 +1,11 @@
|
|
|
1
|
-
import { Pose, Timeline } from '../types/index.ts';
|
|
2
|
-
import { Animation } from './animation';
|
|
1
|
+
import { PhysicsOptions, Pose, Timeline } from '../types/index.ts';
|
|
2
|
+
import { Animation, AnimationPatch } from './animation';
|
|
3
|
+
import { Integrator } from './integrator';
|
|
4
|
+
import { WebAnimation } from './web-animation';
|
|
5
|
+
export interface TrackPatch {
|
|
6
|
+
/** New physics — an `Integrator` instance or the `{ spring | inertia }` shape. */
|
|
7
|
+
integrator?: Integrator | PhysicsOptions;
|
|
8
|
+
}
|
|
3
9
|
export type MultiAnimationMode = "parallel" | "sequence";
|
|
4
10
|
export interface MultiAnimationOptions {
|
|
5
11
|
mode?: MultiAnimationMode;
|
|
@@ -20,17 +26,39 @@ export interface MultiAnimationOptions {
|
|
|
20
26
|
* Composite that drives several child Animations.
|
|
21
27
|
*
|
|
22
28
|
* - `parallel`: all children play together (optionally staggered via `startAt`)
|
|
23
|
-
* - `sequence`:
|
|
29
|
+
* - `sequence`: legacy numeric first-arrival chaining; use startCondition with
|
|
30
|
+
* at: "settled" for explicit completion dependencies
|
|
24
31
|
*
|
|
25
32
|
* Pose/Timeline reads fan out to every child for diagnostic / inspection use.
|
|
26
33
|
*/
|
|
27
|
-
export declare class MultiAnimation extends Animation {
|
|
28
|
-
private
|
|
29
|
-
private
|
|
34
|
+
export declare class MultiAnimation<Name extends string = string> extends Animation {
|
|
35
|
+
private readonly _children;
|
|
36
|
+
private readonly progressChildren;
|
|
37
|
+
private _startAt;
|
|
38
|
+
private readonly namedChildren;
|
|
39
|
+
private restoreChildCallbacks;
|
|
40
|
+
private runId;
|
|
30
41
|
private pendingComplete;
|
|
31
42
|
private running;
|
|
32
43
|
private pendingStartObservers;
|
|
33
|
-
constructor(children: Animation[], opts?: MultiAnimationOptions);
|
|
44
|
+
constructor(children: readonly Animation[] | Record<Name, Animation>, opts?: MultiAnimationOptions);
|
|
45
|
+
/** Child animations in play order. */
|
|
46
|
+
get children(): readonly Animation[];
|
|
47
|
+
/**
|
|
48
|
+
* Per-child start thresholds (see `MultiAnimationOptions.startAt`). Read
|
|
49
|
+
* at run time, so replacing it before `play()` changes the overlap.
|
|
50
|
+
*/
|
|
51
|
+
get startAt(): number[];
|
|
52
|
+
set startAt(value: number[]);
|
|
53
|
+
/** Every `WebAnimation` in this composite, nested composites included. */
|
|
54
|
+
tracks(): WebAnimation[];
|
|
55
|
+
/** Select a registered child, which may itself be a composite. */
|
|
56
|
+
select(name: Name): Animation;
|
|
57
|
+
set(patch: AnimationPatch): this;
|
|
58
|
+
/** @deprecated Prefer select(name).set({ integrator }). */
|
|
59
|
+
set(name: Name, patch: TrackPatch): this;
|
|
60
|
+
/** Setting the composite explicitly retunes every child in the group. */
|
|
61
|
+
protected setIntegrator(integrator: Integrator): void;
|
|
34
62
|
play(): void;
|
|
35
63
|
reverse(): void;
|
|
36
64
|
pause(): void;
|
|
@@ -46,10 +74,10 @@ export declare class MultiAnimation extends Animation {
|
|
|
46
74
|
get playbackRate(): number;
|
|
47
75
|
set playbackRate(rate: number);
|
|
48
76
|
private startRun;
|
|
49
|
-
private
|
|
77
|
+
private buildDependencies;
|
|
50
78
|
private hasReachedThreshold;
|
|
51
79
|
private clearPendingStartObservers;
|
|
52
|
-
private
|
|
80
|
+
private restoreCompletionHandlers;
|
|
53
81
|
private handleFinished;
|
|
54
82
|
findTimeForProgress(_threshold: number): number | null;
|
|
55
83
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"multi-animation.d.ts","sourceRoot":"","sources":["../../src/lib/animation/multi-animation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"multi-animation.d.ts","sourceRoot":"","sources":["../../src/lib/animation/multi-animation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAC7D,OAAO,EACL,SAAS,EACT,KAAK,cAAc,EAEpB,MAAM,aAAa,CAAC;AAErB,OAAO,EAAsB,KAAK,UAAU,EAAE,MAAM,cAAc,CAAC;AACnE,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,MAAM,WAAW,UAAU;IACzB,kFAAkF;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AAa,CAAC,UAAU,EAAE,UAAU,GAAG,IAAI;IAIrD,IAAI,IAAI,IAAI;IAIZ,OAAO,IAAI,IAAI;IAIf,KAAK,IAAI,IAAI;IAMb,QAAQ,IAAI,IAAI;IAQhB,IAAI,QAAQ,IAAI,MAAM,CAKrB;IAED,OAAO,IAAI,IAAI,EAAE;IAIjB,WAAW,IAAI,QAAQ,EAAE;IAIzB,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,GAAG,IAAI;IAO/B,IAAI,WAAW,IAAI,OAAO,CAEzB;IACD,IAAI,QAAQ,IAAI,OAAO,CAKtB;IACD,IAAI,UAAU,IAAI,OAAO,CAExB;IACD,IAAI,WAAW,IAAI,OAAO,CAEzB;IAED,IAAI,YAAY,IAAI,MAAM,CAEzB;IACD,IAAI,YAAY,CAAC,IAAI,EAAE,MAAM,EAG5B;IAID,OAAO,CAAC,QAAQ;IA6DhB,OAAO,CAAC,iBAAiB;IA2CzB,OAAO,CAAC,mBAAmB;IAY3B,OAAO,CAAC,0BAA0B;IAKlC,OAAO,CAAC,yBAAyB;IAKjC,OAAO,CAAC,cAAc;IAQtB,mBAAmB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI;CAMvD"}
|
|
@@ -11,6 +11,12 @@ export interface WebAnimationOptions {
|
|
|
11
11
|
upperBound?: number;
|
|
12
12
|
onUpdate?: (poses: Pose[]) => void;
|
|
13
13
|
onComplete?: () => void;
|
|
14
|
+
/**
|
|
15
|
+
* Role label for this track (`"out"`, `"in"`, `"shared"`, `"overlay"`).
|
|
16
|
+
* Presets usually leave it unset; `withOverride` fills it in from element
|
|
17
|
+
* identity so user overrides can address tracks by role.
|
|
18
|
+
*/
|
|
19
|
+
label?: string;
|
|
14
20
|
}
|
|
15
21
|
/**
|
|
16
22
|
* Single-element animation driven by an Integrator simulation, played through
|
|
@@ -36,8 +42,10 @@ export interface WebAnimationOptions {
|
|
|
36
42
|
* animation's pose is handed in via `matchInto`, we look up by element.
|
|
37
43
|
*/
|
|
38
44
|
export declare class WebAnimation extends Animation {
|
|
39
|
-
private
|
|
40
|
-
private
|
|
45
|
+
private readonly _element;
|
|
46
|
+
private _integrator;
|
|
47
|
+
/** Role label, see `WebAnimationOptions.label`. */
|
|
48
|
+
label: string | undefined;
|
|
41
49
|
private styleFn;
|
|
42
50
|
private lowerBound;
|
|
43
51
|
private upperBound;
|
|
@@ -56,6 +64,16 @@ export declare class WebAnimation extends Animation {
|
|
|
56
64
|
private settled;
|
|
57
65
|
private reversing;
|
|
58
66
|
constructor(opts: WebAnimationOptions);
|
|
67
|
+
/** The DOM node this track drives. */
|
|
68
|
+
get element(): HTMLElement;
|
|
69
|
+
/**
|
|
70
|
+
* Physics that drives this track. Read lazily at `play()` / `reverse()`
|
|
71
|
+
* (the simulation runs then), so replacing it before playback takes effect
|
|
72
|
+
* for the next run — this is what `withOverride` relies on.
|
|
73
|
+
*/
|
|
74
|
+
get integrator(): Integrator;
|
|
75
|
+
set integrator(integrator: Integrator);
|
|
76
|
+
protected setIntegrator(integrator: Integrator): void;
|
|
59
77
|
play(): void;
|
|
60
78
|
reverse(): void;
|
|
61
79
|
pause(): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"web-animation.d.ts","sourceRoot":"","sources":["../../src/lib/animation/web-animation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE,QAAQ,EAAiB,MAAM,QAAQ,CAAC;AACzE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAG/C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AASxC,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,WAAW,CAAC;IACrB,UAAU,EAAE,UAAU,CAAC;IACvB,KAAK,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,KAAK,WAAW,CAAC;IAC7C,gEAAgE;IAChE,UAAU,CAAC,EAAE,MAAM,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,CAAC,SAAS;IAiEjB,OAAO,CAAC,UAAU;IAYlB,OAAO,CAAC,gBAAgB;YASV,cAAc;IAwB5B,OAAO,CAAC,uBAAuB;IA8B/B,OAAO,CAAC,wBAAwB;IAqChC,OAAO,CAAC,cAAc;IAUtB,OAAO,CAAC,mBAAmB;IAiB3B,OAAO,CAAC,YAAY;CAQrB"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
const s = Symbol("ssgoi.transition.definition"), d = Symbol("ssgoi.transition.prepared-run");
|
|
2
|
+
function c(t, n) {
|
|
3
|
+
return {
|
|
4
|
+
context: n,
|
|
5
|
+
prepare: (o) => {
|
|
6
|
+
var r;
|
|
7
|
+
return ((r = t.prepare) == null ? void 0 : r.call(t, { ...o, context: n })) ?? {};
|
|
8
|
+
},
|
|
9
|
+
// Prepared values are opaque to the dispatcher and passed back verbatim.
|
|
10
|
+
// The selected branch is captured in this run, so forward's prepared data
|
|
11
|
+
// cannot reach backward's factory even when preparations overlap.
|
|
12
|
+
animation: (o) => t.animation({ ...o, context: n })
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
function u(t) {
|
|
16
|
+
return {
|
|
17
|
+
[s]: t,
|
|
18
|
+
prepare(n) {
|
|
19
|
+
return ((r) => {
|
|
20
|
+
const e = r.prepare(n), i = (a) => ({ ...a, [d]: r });
|
|
21
|
+
return typeof e.then == "function" ? Promise.resolve(e).then(i) : i(e);
|
|
22
|
+
})(t[n.context.direction](n.context));
|
|
23
|
+
},
|
|
24
|
+
animation(n) {
|
|
25
|
+
return (n[d] ?? t[n.context.direction](n.context)).animation(n);
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
function w(t, n = {}) {
|
|
30
|
+
return f(u({
|
|
31
|
+
forward: (r) => c(t.forward, r),
|
|
32
|
+
backward: (r) => c(t.backward, r)
|
|
33
|
+
}), n.override);
|
|
34
|
+
}
|
|
35
|
+
function f(t, n) {
|
|
36
|
+
if (!n) return t;
|
|
37
|
+
const o = t[s], r = (e, i) => ({
|
|
38
|
+
...e,
|
|
39
|
+
animation(a) {
|
|
40
|
+
const p = e.animation(a);
|
|
41
|
+
return i == null || i({
|
|
42
|
+
animation: p,
|
|
43
|
+
context: e.context
|
|
44
|
+
}), p;
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
return u({
|
|
48
|
+
forward: (e) => r(o.forward(e), n.forward),
|
|
49
|
+
backward: (e) => r(o.backward(e), n.backward)
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
export {
|
|
53
|
+
w as d,
|
|
54
|
+
f as w
|
|
55
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const s=Symbol("ssgoi.transition.definition"),d=Symbol("ssgoi.transition.prepared-run");function c(t,n){return{context:n,prepare:o=>{var r;return((r=t.prepare)==null?void 0:r.call(t,{...o,context:n}))??{}},animation:o=>t.animation({...o,context:n})}}function u(t){return{[s]:t,prepare(n){return(r=>{const e=r.prepare(n),i=a=>({...a,[d]:r});return typeof e.then=="function"?Promise.resolve(e).then(i):i(e)})(t[n.context.direction](n.context))},animation(n){return(n[d]??t[n.context.direction](n.context)).animation(n)}}}function w(t,n={}){return f(u({forward:r=>c(t.forward,r),backward:r=>c(t.backward,r)}),n.override)}function f(t,n){if(!n)return t;const o=t[s],r=(e,i)=>({...e,animation(a){const p=e.animation(a);return i==null||i({animation:p,context:e.context}),p}});return u({forward:e=>r(o.forward(e),n.forward),backward:e=>r(o.backward(e),n.backward)})}exports.defineTransition=w;exports.withOverride=f;
|