@omnimedia/omnitool 1.1.0-85 → 1.1.0-86
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 +25 -25
- package/package.json +1 -1
- package/s/demo/routines/timeline-setup.ts +4 -5
- package/s/timeline/parts/animations/properties.ts +1 -5
- package/s/timeline/parts/animations/types.ts +14 -3
- package/s/timeline/parts/item.ts +1 -12
- package/s/timeline/renderers/parts/handy.ts +29 -7
- package/s/timeline/renderers/parts/samplers/visual/parts/sample.ts +2 -2
- package/s/timeline/sugar/helpers.ts +59 -48
- package/s/timeline/sugar/o.ts +79 -48
- package/s/timeline/types.ts +11 -3
- package/s/timeline/utils/anim.ts +0 -9
- package/x/demo/demo.bundle.min.js +100 -100
- package/x/demo/demo.bundle.min.js.map +3 -3
- package/x/demo/routines/timeline-setup.js +4 -3
- package/x/demo/routines/timeline-setup.js.map +1 -1
- package/x/index.html +2 -2
- package/x/tests.bundle.min.js +64 -64
- package/x/tests.bundle.min.js.map +4 -4
- package/x/tests.html +1 -1
- package/x/timeline/parts/animations/properties.d.ts +11 -13
- package/x/timeline/parts/animations/properties.js +1 -4
- package/x/timeline/parts/animations/properties.js.map +1 -1
- package/x/timeline/parts/animations/registry.d.ts +10 -10
- package/x/timeline/parts/animations/types.d.ts +12 -3
- package/x/timeline/parts/item.d.ts +6 -15
- package/x/timeline/parts/item.js +4 -5
- package/x/timeline/parts/item.js.map +1 -1
- package/x/timeline/renderers/parts/handy.js +22 -4
- package/x/timeline/renderers/parts/handy.js.map +1 -1
- package/x/timeline/renderers/parts/samplers/visual/parts/sample.js.map +1 -1
- package/x/timeline/sugar/helpers.d.ts +16 -9
- package/x/timeline/sugar/helpers.js +30 -27
- package/x/timeline/sugar/helpers.js.map +1 -1
- package/x/timeline/sugar/o.d.ts +7 -8
- package/x/timeline/sugar/o.js +52 -35
- package/x/timeline/sugar/o.js.map +1 -1
- package/x/timeline/types.d.ts +6 -3
- package/x/timeline/utils/anim.d.ts +0 -2
- package/x/timeline/utils/anim.js +0 -4
- package/x/timeline/utils/anim.js.map +1 -1
package/s/timeline/types.ts
CHANGED
|
@@ -34,14 +34,22 @@ export type Vec2Animation = Anim<TrackVec2>
|
|
|
34
34
|
export type TransformAnimation = Anim<TrackTransform>
|
|
35
35
|
export type VisualAnimations = {
|
|
36
36
|
opacity?: ScalarAnimation
|
|
37
|
+
transform?: TransformAnimation
|
|
37
38
|
}
|
|
38
|
-
|
|
39
|
+
|
|
40
|
+
export type VisualAnimationInput<TKey extends keyof VisualAnimations> =
|
|
41
|
+
TKey extends "transform" ? Keyframes<Transform> : Keyframes
|
|
42
|
+
|
|
43
|
+
export type VisualAnimationValue<TKey extends keyof VisualAnimations> =
|
|
44
|
+
TKey extends "transform" ? TransformAnimation : ScalarAnimation
|
|
45
|
+
|
|
46
|
+
export interface AnimateAction<TKey extends keyof VisualAnimations = keyof VisualAnimations> {
|
|
39
47
|
<T extends VisualAnimatableItem>(
|
|
40
48
|
item: T,
|
|
41
49
|
terp: Interpolation,
|
|
42
|
-
track:
|
|
50
|
+
track: VisualAnimationInput<TKey>
|
|
43
51
|
): T
|
|
44
|
-
make(terp: Interpolation, track:
|
|
52
|
+
make(terp: Interpolation, track: VisualAnimationInput<TKey>): Item.Animation
|
|
45
53
|
}
|
|
46
54
|
|
|
47
55
|
// export type Animations = Anim<TrackTransform>
|
package/s/timeline/utils/anim.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
|
|
2
2
|
import {resolveTerp} from "./terps.js"
|
|
3
|
-
import {Item, Kind} from "../parts/item.js"
|
|
4
3
|
import {Anim, Keyframes, ScalarAnimation, Transform, TransformAnimation} from "../types.js"
|
|
5
4
|
|
|
6
5
|
const resolveScalar =(
|
|
@@ -62,11 +61,3 @@ export const resolveScalarAnimation =(
|
|
|
62
61
|
anim: ScalarAnimation,
|
|
63
62
|
): number => resolveScalar(time, anim.track, anim.terp)
|
|
64
63
|
|
|
65
|
-
export const resolveTransform =(
|
|
66
|
-
spatial: Item.Spatial | Item.AnimatedSpatial,
|
|
67
|
-
time: number,
|
|
68
|
-
): Transform =>
|
|
69
|
-
spatial.kind === Kind.AnimatedSpatial
|
|
70
|
-
? resolveTransformAnimation(time, spatial.anim)
|
|
71
|
-
: spatial.transform
|
|
72
|
-
|