@infinityfx/lively 4.0.11 → 5.0.0-alpha.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/dist/animate.js +1 -1
- package/dist/animations/text-animation.js +3 -0
- package/dist/animations/text-animation.js.map +1 -0
- package/dist/animations/view-animation.js +3 -0
- package/dist/animations/view-animation.js.map +1 -0
- package/dist/animations.js +2 -0
- package/dist/animations.js.map +1 -0
- package/dist/core/animation-link.js +2 -0
- package/dist/core/animation-link.js.map +1 -0
- package/dist/core/animator.js +2 -0
- package/dist/core/animator.js.map +1 -0
- package/dist/core/clip.js +1 -1
- package/dist/core/clip.js.map +1 -1
- package/dist/core/state.js +2 -0
- package/dist/core/state.js.map +1 -0
- package/dist/core/track.js +1 -1
- package/dist/core/track.js.map +1 -1
- package/dist/core/utils.js +1 -1
- package/dist/core/utils.js.map +1 -1
- package/dist/hooks/use-audio.js +1 -1
- package/dist/hooks/use-hover.js +3 -0
- package/dist/hooks/use-hover.js.map +1 -0
- package/dist/hooks/use-link.js +2 -1
- package/dist/hooks/use-link.js.map +1 -1
- package/dist/hooks/use-scroll.js +1 -1
- package/dist/hooks/use-spring.js +2 -1
- package/dist/hooks/use-spring.js.map +1 -1
- package/dist/hooks/use-tap.js +3 -0
- package/dist/hooks/use-tap.js.map +1 -0
- package/dist/hooks/use-viewport.js +1 -1
- package/dist/hooks/use-visible.js +1 -1
- package/dist/hooks.js +1 -1
- package/dist/index.js +1 -1
- package/dist/layout-group.js +3 -0
- package/dist/types/animate.d.ts +31 -19
- package/dist/types/animations/text-animation.d.ts +5 -0
- package/dist/types/animations/view-animation.d.ts +9 -0
- package/dist/types/animations.d.ts +3 -0
- package/dist/types/core/animation-link.d.ts +19 -0
- package/dist/types/core/animator.d.ts +75 -0
- package/dist/types/core/clip.d.ts +32 -35
- package/dist/types/core/state.d.ts +16 -0
- package/dist/types/core/track.d.ts +30 -22
- package/dist/types/core/utils.d.ts +891 -35
- package/dist/types/hooks/use-audio.d.ts +1 -2
- package/dist/types/hooks/use-hover.d.ts +1 -0
- package/dist/types/hooks/use-link.d.ts +3 -1
- package/dist/types/hooks/use-scroll.d.ts +4 -6
- package/dist/types/hooks/use-spring.d.ts +9 -6
- package/dist/types/hooks/use-tap.d.ts +1 -0
- package/dist/types/hooks/use-viewport.d.ts +7 -2
- package/dist/types/hooks/use-visible.d.ts +1 -6
- package/dist/types/hooks.d.ts +5 -5
- package/dist/types/index.d.ts +5 -4
- package/dist/types/layout-group.d.ts +7 -0
- package/package.json +6 -6
- package/dist/animatable.js +0 -3
- package/dist/animatable.js.map +0 -1
- package/dist/core/action.js +0 -2
- package/dist/core/action.js.map +0 -1
- package/dist/core/cache.js +0 -2
- package/dist/core/cache.js.map +0 -1
- package/dist/core/link.js +0 -2
- package/dist/core/link.js.map +0 -1
- package/dist/core/timeline.js +0 -2
- package/dist/core/timeline.js.map +0 -1
- package/dist/hooks/use-path.js +0 -2
- package/dist/hooks/use-path.js.map +0 -1
- package/dist/hooks/use-trigger.js +0 -3
- package/dist/hooks/use-trigger.js.map +0 -1
- package/dist/layout/layout-group.js +0 -3
- package/dist/layout/morph.js +0 -3
- package/dist/layout/morph.js.map +0 -1
- package/dist/layout/typable.js +0 -3
- package/dist/layout/typable.js.map +0 -1
- package/dist/layout.js +0 -2
- package/dist/layout.js.map +0 -1
- package/dist/types/animatable.d.ts +0 -113
- package/dist/types/core/action.d.ts +0 -15
- package/dist/types/core/cache.d.ts +0 -23
- package/dist/types/core/link.d.ts +0 -14
- package/dist/types/core/timeline.d.ts +0 -42
- package/dist/types/hooks/use-path.d.ts +0 -1
- package/dist/types/hooks/use-trigger.d.ts +0 -4
- package/dist/types/layout/layout-group.d.ts +0 -16
- package/dist/types/layout/morph.d.ts +0 -24
- package/dist/types/layout/typable.d.ts +0 -11
- package/dist/types/layout.d.ts +0 -4
- /package/dist/{layout/layout-group.js.map → layout-group.js.map} +0 -0
|
@@ -1,52 +1,49 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
1
|
+
import { AnimationOptions } from "./animator";
|
|
2
|
+
import AnimationLink from "./animation-link";
|
|
3
|
+
export type BlendMode = 'none' | 'override' | 'combine';
|
|
3
4
|
export type Easing = 'linear' | 'ease' | 'ease-in' | 'ease-out' | 'ease-in-out' | 'step-start' | 'step-end' | (string & {});
|
|
4
|
-
export type AnimatableKey = keyof React.CSSProperties | 'strokeLength';
|
|
5
|
-
export type AnimatableKeyframe = string | number | null | {
|
|
6
|
-
value?: string | number;
|
|
7
|
-
after?: string | number;
|
|
8
|
-
offset?: number;
|
|
9
|
-
};
|
|
10
|
-
type AnimatableProperties = {
|
|
11
|
-
[key in AnimatableKey]?: Link<any> | ((progress: number, index: number) => any) | AnimatableKeyframe | AnimatableKeyframe[];
|
|
12
|
-
};
|
|
13
|
-
export type AnimatableInitials = React.CSSProperties & {
|
|
14
|
-
strokeLength?: number | string;
|
|
15
|
-
};
|
|
16
|
-
export type CompositeType = 'none' | 'override' | 'combine';
|
|
17
5
|
export type ClipConfig = {
|
|
18
6
|
duration?: number;
|
|
19
7
|
delay?: number;
|
|
20
8
|
repeat?: number;
|
|
21
9
|
alternate?: boolean;
|
|
22
|
-
easing?: Easing;
|
|
23
10
|
reverse?: boolean;
|
|
24
|
-
|
|
11
|
+
easing?: Easing;
|
|
12
|
+
composite?: BlendMode;
|
|
25
13
|
};
|
|
26
|
-
export type
|
|
27
|
-
export type
|
|
28
|
-
|
|
14
|
+
export type ClipKey = keyof React.CSSProperties | 'strokeLength';
|
|
15
|
+
export type ClipKeyframe = null | string | number | {
|
|
16
|
+
to?: string | number;
|
|
17
|
+
after?: string | number;
|
|
18
|
+
offset?: number;
|
|
19
|
+
};
|
|
20
|
+
export type ClipKeyframes = {
|
|
21
|
+
[key in ClipKey]?: ClipKeyframe | ClipKeyframe[] | AnimationLink<any>;
|
|
22
|
+
};
|
|
23
|
+
export type ClipOptions = ClipConfig & ClipKeyframes;
|
|
24
|
+
export type ClipInitials = React.CSSProperties & {
|
|
25
|
+
strokeLength?: number;
|
|
29
26
|
};
|
|
30
27
|
export default class Clip {
|
|
28
|
+
isEmpty: boolean;
|
|
31
29
|
keyframes: Keyframe[];
|
|
32
|
-
initial: React.CSSProperties;
|
|
33
|
-
dynamic: DynamicProperties;
|
|
34
30
|
duration: number;
|
|
35
31
|
delay: number;
|
|
36
32
|
repeat: number;
|
|
37
33
|
alternate: boolean;
|
|
38
|
-
easing: string;
|
|
39
34
|
reverse: boolean;
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
constructor({ duration, delay, repeat, alternate,
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
reverse
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
35
|
+
easing: Easing;
|
|
36
|
+
composite: BlendMode;
|
|
37
|
+
constructor({ duration, delay, repeat, alternate, reverse, easing, composite, ...keyframes }: ClipOptions, initial?: ClipInitials);
|
|
38
|
+
getConfig({ delay, repeat, alternate, reverse, composite, commit }: AnimationOptions): {
|
|
39
|
+
duration: number;
|
|
40
|
+
delay: number;
|
|
41
|
+
iterations: number;
|
|
42
|
+
directions: "normal" | "alternate" | "alternate-reverse" | "reverse";
|
|
43
|
+
easing: Easing;
|
|
44
|
+
composite: "accumulate" | "replace";
|
|
45
|
+
blendmode: BlendMode;
|
|
46
|
+
commit: boolean;
|
|
47
|
+
};
|
|
48
|
+
static mergeInitialStyles(clips: Clip[], styles: ClipInitials): ClipInitials;
|
|
51
49
|
}
|
|
52
|
-
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import Animator from "./animator";
|
|
2
|
+
export declare function getParentAnimator(id: string, stepsRemoved: number): Animator<any> | null;
|
|
3
|
+
export declare function isRegistered(id: string): boolean;
|
|
4
|
+
export declare function registerAnimator(id: string, animator: Animator<any>): void;
|
|
5
|
+
export declare function unregisterAnimator(id: string): void;
|
|
6
|
+
export declare function registerLayoutGroup(id: string, skipInitialMount: boolean): {
|
|
7
|
+
animators: Set<string>;
|
|
8
|
+
skipInitialMount: boolean;
|
|
9
|
+
};
|
|
10
|
+
export declare function unregisterLayoutGroup(id: string): void;
|
|
11
|
+
export declare function registerToLayoutGroup(layoutId: string, id: string): boolean;
|
|
12
|
+
export declare function unregisterFromLayoutGroup(layoutId: string, id: string): void;
|
|
13
|
+
export declare function forEachAnimator(ids: Set<string>, callback: (animator: Animator<any>) => void): void;
|
|
14
|
+
export declare function registerAsMorph(morphId: string, animator: Animator<any>): void;
|
|
15
|
+
export declare function getMorphTarget(morphId: string, receiverId: string): Animator<any> | null;
|
|
16
|
+
export declare function deleteMorphTarget(morphId: string, animator: Animator<any>, delay?: number): number;
|
|
@@ -1,32 +1,40 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { TransitionOptions } from "./animation-link";
|
|
2
|
+
import { AnimationOptions } from "./animator";
|
|
3
|
+
import Clip, { BlendMode, ClipKey } from "./clip";
|
|
4
|
+
import { ScaleTuple } from "./utils";
|
|
5
|
+
export type CacheKey = Exclude<ClipKey, 'scale' | 'translate'> | 'x' | 'y' | 'sx' | 'sy';
|
|
6
|
+
export type StyleCache = {
|
|
7
|
+
[key in Exclude<CacheKey, 'x' | 'y' | 'sx' | 'sy'>]?: string;
|
|
8
|
+
} & {
|
|
9
|
+
x: number;
|
|
10
|
+
y: number;
|
|
11
|
+
sx: number;
|
|
12
|
+
sy: number;
|
|
13
|
+
};
|
|
14
|
+
export type TrackAnimation = Animation & {
|
|
15
|
+
name?: string;
|
|
16
|
+
blendmode: BlendMode;
|
|
8
17
|
};
|
|
9
18
|
export default class Track {
|
|
10
19
|
element: HTMLElement | SVGElement;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
active: Action[];
|
|
14
|
-
queue: Action[];
|
|
20
|
+
shouldCache: CacheKey[];
|
|
21
|
+
styles: CSSStyleDeclaration;
|
|
15
22
|
cache: StyleCache;
|
|
16
|
-
|
|
17
|
-
scale: [number, number];
|
|
23
|
+
scale: ScaleTuple;
|
|
18
24
|
corrected: {
|
|
19
25
|
borderRadius: string;
|
|
20
26
|
boxShadow: string;
|
|
21
27
|
};
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
correctionAnimation: Animation | null;
|
|
29
|
+
queue: TrackAnimation[];
|
|
30
|
+
animations: TrackAnimation[];
|
|
31
|
+
active: number;
|
|
32
|
+
constructor(element: HTMLElement | SVGElement, shouldCache: CacheKey[]);
|
|
33
|
+
snapshot(): StyleCache;
|
|
34
|
+
push(clip: Clip, options?: AnimationOptions, onEnded?: () => void): number;
|
|
35
|
+
advance(): void;
|
|
36
|
+
transition(from?: StyleCache, options?: TransitionOptions): void;
|
|
37
|
+
clear(animation?: string): void;
|
|
38
|
+
toggle(paused: boolean): void;
|
|
31
39
|
correct(): void;
|
|
32
40
|
}
|