@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.
Files changed (41) hide show
  1. package/README.md +25 -25
  2. package/package.json +1 -1
  3. package/s/demo/routines/timeline-setup.ts +4 -5
  4. package/s/timeline/parts/animations/properties.ts +1 -5
  5. package/s/timeline/parts/animations/types.ts +14 -3
  6. package/s/timeline/parts/item.ts +1 -12
  7. package/s/timeline/renderers/parts/handy.ts +29 -7
  8. package/s/timeline/renderers/parts/samplers/visual/parts/sample.ts +2 -2
  9. package/s/timeline/sugar/helpers.ts +59 -48
  10. package/s/timeline/sugar/o.ts +79 -48
  11. package/s/timeline/types.ts +11 -3
  12. package/s/timeline/utils/anim.ts +0 -9
  13. package/x/demo/demo.bundle.min.js +100 -100
  14. package/x/demo/demo.bundle.min.js.map +3 -3
  15. package/x/demo/routines/timeline-setup.js +4 -3
  16. package/x/demo/routines/timeline-setup.js.map +1 -1
  17. package/x/index.html +2 -2
  18. package/x/tests.bundle.min.js +64 -64
  19. package/x/tests.bundle.min.js.map +4 -4
  20. package/x/tests.html +1 -1
  21. package/x/timeline/parts/animations/properties.d.ts +11 -13
  22. package/x/timeline/parts/animations/properties.js +1 -4
  23. package/x/timeline/parts/animations/properties.js.map +1 -1
  24. package/x/timeline/parts/animations/registry.d.ts +10 -10
  25. package/x/timeline/parts/animations/types.d.ts +12 -3
  26. package/x/timeline/parts/item.d.ts +6 -15
  27. package/x/timeline/parts/item.js +4 -5
  28. package/x/timeline/parts/item.js.map +1 -1
  29. package/x/timeline/renderers/parts/handy.js +22 -4
  30. package/x/timeline/renderers/parts/handy.js.map +1 -1
  31. package/x/timeline/renderers/parts/samplers/visual/parts/sample.js.map +1 -1
  32. package/x/timeline/sugar/helpers.d.ts +16 -9
  33. package/x/timeline/sugar/helpers.js +30 -27
  34. package/x/timeline/sugar/helpers.js.map +1 -1
  35. package/x/timeline/sugar/o.d.ts +7 -8
  36. package/x/timeline/sugar/o.js +52 -35
  37. package/x/timeline/sugar/o.js.map +1 -1
  38. package/x/timeline/types.d.ts +6 -3
  39. package/x/timeline/utils/anim.d.ts +0 -2
  40. package/x/timeline/utils/anim.js +0 -4
  41. package/x/timeline/utils/anim.js.map +1 -1
@@ -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
- export interface AnimateAction {
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: Keyframes
50
+ track: VisualAnimationInput<TKey>
43
51
  ): T
44
- make(terp: Interpolation, track: Keyframes): Item.Animation
52
+ make(terp: Interpolation, track: VisualAnimationInput<TKey>): Item.Animation
45
53
  }
46
54
 
47
55
  // export type Animations = Anim<TrackTransform>
@@ -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
-