@infinityfx/lively 4.0.6 → 4.0.7

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 (76) hide show
  1. package/dist/layout/layout-group.js +1 -1
  2. package/dist/tsconfig.tsbuildinfo +1 -1
  3. package/package.json +1 -1
  4. package/.rollup.cache/F/projects/code/lively/dist/animatable.js +0 -147
  5. package/.rollup.cache/F/projects/code/lively/dist/animatable.js.map +0 -1
  6. package/.rollup.cache/F/projects/code/lively/dist/animate.js +0 -26
  7. package/.rollup.cache/F/projects/code/lively/dist/animate.js.map +0 -1
  8. package/.rollup.cache/F/projects/code/lively/dist/core/action.js +0 -28
  9. package/.rollup.cache/F/projects/code/lively/dist/core/action.js.map +0 -1
  10. package/.rollup.cache/F/projects/code/lively/dist/core/cache.js +0 -55
  11. package/.rollup.cache/F/projects/code/lively/dist/core/cache.js.map +0 -1
  12. package/.rollup.cache/F/projects/code/lively/dist/core/clip.js +0 -71
  13. package/.rollup.cache/F/projects/code/lively/dist/core/clip.js.map +0 -1
  14. package/.rollup.cache/F/projects/code/lively/dist/core/link.js +0 -39
  15. package/.rollup.cache/F/projects/code/lively/dist/core/link.js.map +0 -1
  16. package/.rollup.cache/F/projects/code/lively/dist/core/timeline.js +0 -107
  17. package/.rollup.cache/F/projects/code/lively/dist/core/timeline.js.map +0 -1
  18. package/.rollup.cache/F/projects/code/lively/dist/core/track.js +0 -147
  19. package/.rollup.cache/F/projects/code/lively/dist/core/track.js.map +0 -1
  20. package/.rollup.cache/F/projects/code/lively/dist/core/utils.js +0 -95
  21. package/.rollup.cache/F/projects/code/lively/dist/core/utils.js.map +0 -1
  22. package/.rollup.cache/F/projects/code/lively/dist/hooks/use-audio.js +0 -63
  23. package/.rollup.cache/F/projects/code/lively/dist/hooks/use-audio.js.map +0 -1
  24. package/.rollup.cache/F/projects/code/lively/dist/hooks/use-link.js +0 -7
  25. package/.rollup.cache/F/projects/code/lively/dist/hooks/use-link.js.map +0 -1
  26. package/.rollup.cache/F/projects/code/lively/dist/hooks/use-path.js +0 -15
  27. package/.rollup.cache/F/projects/code/lively/dist/hooks/use-path.js.map +0 -1
  28. package/.rollup.cache/F/projects/code/lively/dist/hooks/use-reduced-motion.js +0 -14
  29. package/.rollup.cache/F/projects/code/lively/dist/hooks/use-reduced-motion.js.map +0 -1
  30. package/.rollup.cache/F/projects/code/lively/dist/hooks/use-scroll.js +0 -21
  31. package/.rollup.cache/F/projects/code/lively/dist/hooks/use-scroll.js.map +0 -1
  32. package/.rollup.cache/F/projects/code/lively/dist/hooks/use-spring.js +0 -37
  33. package/.rollup.cache/F/projects/code/lively/dist/hooks/use-spring.js.map +0 -1
  34. package/.rollup.cache/F/projects/code/lively/dist/hooks/use-trigger.js +0 -15
  35. package/.rollup.cache/F/projects/code/lively/dist/hooks/use-trigger.js.map +0 -1
  36. package/.rollup.cache/F/projects/code/lively/dist/hooks/use-viewport.js +0 -27
  37. package/.rollup.cache/F/projects/code/lively/dist/hooks/use-viewport.js.map +0 -1
  38. package/.rollup.cache/F/projects/code/lively/dist/hooks/use-visible.js +0 -26
  39. package/.rollup.cache/F/projects/code/lively/dist/hooks/use-visible.js.map +0 -1
  40. package/.rollup.cache/F/projects/code/lively/dist/hooks.js +0 -11
  41. package/.rollup.cache/F/projects/code/lively/dist/hooks.js.map +0 -1
  42. package/.rollup.cache/F/projects/code/lively/dist/index.js +0 -4
  43. package/.rollup.cache/F/projects/code/lively/dist/index.js.map +0 -1
  44. package/.rollup.cache/F/projects/code/lively/dist/layout/layout-group.js +0 -209
  45. package/.rollup.cache/F/projects/code/lively/dist/layout/layout-group.js.map +0 -1
  46. package/.rollup.cache/F/projects/code/lively/dist/layout/morph.js +0 -48
  47. package/.rollup.cache/F/projects/code/lively/dist/layout/morph.js.map +0 -1
  48. package/.rollup.cache/F/projects/code/lively/dist/layout/typable.js +0 -21
  49. package/.rollup.cache/F/projects/code/lively/dist/layout/typable.js.map +0 -1
  50. package/.rollup.cache/F/projects/code/lively/dist/layout.js +0 -5
  51. package/.rollup.cache/F/projects/code/lively/dist/layout.js.map +0 -1
  52. package/.rollup.cache/F/projects/code/lively/dist/tsconfig.tsbuildinfo +0 -1
  53. package/.rollup.cache/F/projects/code/lively/dist/types/animatable.d.ts +0 -112
  54. package/.rollup.cache/F/projects/code/lively/dist/types/animate.d.ts +0 -19
  55. package/.rollup.cache/F/projects/code/lively/dist/types/core/action.d.ts +0 -15
  56. package/.rollup.cache/F/projects/code/lively/dist/types/core/cache.d.ts +0 -23
  57. package/.rollup.cache/F/projects/code/lively/dist/types/core/clip.d.ts +0 -52
  58. package/.rollup.cache/F/projects/code/lively/dist/types/core/link.d.ts +0 -14
  59. package/.rollup.cache/F/projects/code/lively/dist/types/core/timeline.d.ts +0 -41
  60. package/.rollup.cache/F/projects/code/lively/dist/types/core/track.d.ts +0 -32
  61. package/.rollup.cache/F/projects/code/lively/dist/types/core/utils.d.ts +0 -39
  62. package/.rollup.cache/F/projects/code/lively/dist/types/hooks/use-audio.d.ts +0 -7
  63. package/.rollup.cache/F/projects/code/lively/dist/types/hooks/use-link.d.ts +0 -1
  64. package/.rollup.cache/F/projects/code/lively/dist/types/hooks/use-path.d.ts +0 -1
  65. package/.rollup.cache/F/projects/code/lively/dist/types/hooks/use-reduced-motion.d.ts +0 -1
  66. package/.rollup.cache/F/projects/code/lively/dist/types/hooks/use-scroll.d.ts +0 -9
  67. package/.rollup.cache/F/projects/code/lively/dist/types/hooks/use-spring.d.ts +0 -6
  68. package/.rollup.cache/F/projects/code/lively/dist/types/hooks/use-trigger.d.ts +0 -4
  69. package/.rollup.cache/F/projects/code/lively/dist/types/hooks/use-viewport.d.ts +0 -2
  70. package/.rollup.cache/F/projects/code/lively/dist/types/hooks/use-visible.d.ts +0 -6
  71. package/.rollup.cache/F/projects/code/lively/dist/types/hooks.d.ts +0 -10
  72. package/.rollup.cache/F/projects/code/lively/dist/types/index.d.ts +0 -3
  73. package/.rollup.cache/F/projects/code/lively/dist/types/layout/layout-group.d.ts +0 -16
  74. package/.rollup.cache/F/projects/code/lively/dist/types/layout/morph.d.ts +0 -24
  75. package/.rollup.cache/F/projects/code/lively/dist/types/layout/typable.d.ts +0 -11
  76. package/.rollup.cache/F/projects/code/lively/dist/types/layout.d.ts +0 -4
@@ -1,52 +0,0 @@
1
- import { Link } from "./link";
2
- import type Track from "./track";
3
- 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
- export type ClipConfig = {
18
- duration?: number;
19
- delay?: number;
20
- repeat?: number;
21
- alternate?: boolean;
22
- easing?: Easing;
23
- reverse?: boolean;
24
- composite?: CompositeType;
25
- };
26
- export type ClipProperties = ClipConfig & AnimatableProperties;
27
- export type DynamicProperties = {
28
- [key in AnimatableKey]?: (progress: number, index: number) => any;
29
- };
30
- export default class Clip {
31
- keyframes: Keyframe[];
32
- initial: React.CSSProperties;
33
- dynamic: DynamicProperties;
34
- duration: number;
35
- delay: number;
36
- repeat: number;
37
- alternate: boolean;
38
- easing: string;
39
- reverse: boolean;
40
- composite: CompositeType;
41
- isEmpty: boolean;
42
- constructor({ duration, delay, repeat, alternate, easing, reverse, composite, ...properties }: ClipProperties, initial?: AnimatableInitials);
43
- static from(data?: ClipProperties | Clip, initial?: AnimatableInitials): Clip;
44
- unique(config: ClipConfig): Clip;
45
- play(track: Track, { composite, reverse, commit, delay }: {
46
- composite?: CompositeType;
47
- reverse?: boolean;
48
- delay?: number;
49
- commit?: boolean;
50
- }): void;
51
- }
52
- export {};
@@ -1,14 +0,0 @@
1
- import { ClipConfig } from "./clip";
2
- type Computed<P> = (index: number) => P;
3
- export type Computation<T, P> = (value: T, index: number) => P;
4
- type LinkCallback = (options: ClipConfig) => void;
5
- export type Link<T> = {
6
- (index?: number): T;
7
- <P>(computation: Computation<T, P>): Link<ReturnType<typeof computation>>;
8
- set(value: T, options?: ClipConfig): void;
9
- subscribe(callback: LinkCallback): void;
10
- unsubscribe(callback: LinkCallback): void;
11
- };
12
- export declare function createLink<T, P>(initial: T, computed?: Computed<P>): Link<T>;
13
- export declare function isLink<T>(val: any): val is Link<T>;
14
- export {};
@@ -1,41 +0,0 @@
1
- import { CachableKey } from "./cache";
2
- import Clip, { ClipProperties, CompositeType } from "./clip";
3
- import Track, { TransitionOptions } from "./track";
4
- import { IndexedMap } from "./utils";
5
- export type PlayOptions = {
6
- composite?: CompositeType;
7
- immediate?: boolean;
8
- reverse?: boolean;
9
- delay?: number;
10
- commit?: boolean;
11
- };
12
- export default class Timeline {
13
- index: number;
14
- stagger: number;
15
- staggerLimit: number;
16
- deform: boolean;
17
- cachable?: CachableKey[];
18
- paused: boolean;
19
- tracks: IndexedMap<Element, Track>;
20
- frame: number;
21
- linked: (() => void)[];
22
- mounted: boolean;
23
- mountClips: Clip[];
24
- constructor({ stagger, staggerLimit, deform, cachable, mountClips }: {
25
- stagger?: number;
26
- staggerLimit?: number;
27
- deform?: boolean;
28
- cachable?: CachableKey[];
29
- mountClips: Clip[];
30
- });
31
- step(): void;
32
- time(clip: Clip): number;
33
- private receiver;
34
- link(clip?: ClipProperties | Clip): void;
35
- unlink(): void;
36
- transition(from: Timeline | undefined, options?: TransitionOptions): void;
37
- insert(element: any): void;
38
- add(clip: Clip, { immediate, composite, reverse, delay, commit }: PlayOptions): void;
39
- pause(value: boolean): void;
40
- cache(): void;
41
- }
@@ -1,32 +0,0 @@
1
- import type Action from "./action";
2
- import { CachableKey, StyleCache } from "./cache";
3
- import type { Easing } from "./clip";
4
- export type TransitionOptions = {
5
- duration?: number;
6
- easing?: Easing;
7
- reverse?: boolean;
8
- };
9
- export default class Track {
10
- element: HTMLElement | SVGElement;
11
- deform: boolean;
12
- playing: number;
13
- active: Action[];
14
- queue: Action[];
15
- cache: StyleCache;
16
- paused: boolean;
17
- scale: [number, number];
18
- corrected: {
19
- borderRadius: string;
20
- boxShadow: string;
21
- };
22
- constructor(element: HTMLElement | SVGElement, deform: boolean, cachable?: CachableKey[]);
23
- push(action: Action): void;
24
- next(): void;
25
- clear(partial?: boolean): void;
26
- pause(value: boolean): void;
27
- step(index: number): void;
28
- transition(previous: Track | undefined, options: TransitionOptions): void;
29
- apply(prop: string, val: any): void;
30
- decomposeScale(): [number, number];
31
- correct(): void;
32
- }
@@ -1,39 +0,0 @@
1
- import type { AnimatableKeyframe } from "./clip";
2
- import type Track from "./track";
3
- type SharedKeys<T, P> = keyof Omit<T | P, keyof (Omit<T, keyof P> & Omit<P, keyof T>)>;
4
- type MergedMaps<T, P> = T & P & {
5
- [K in SharedKeys<T, P>]: MergedPair<T[K], P[K]>;
6
- };
7
- type MergedPair<T, P> = [T, P] extends [{
8
- [key: string]: unknown;
9
- }, {
10
- [key: string]: unknown;
11
- }] ? MergedMaps<T, P> : T & P;
12
- type Merged<T extends [...any]> = T extends [infer L, ...infer R] ? MergedPair<L, Merged<R>> : unknown;
13
- export declare function merge<T extends {
14
- [key: string]: any;
15
- }[]>(...objects: T): Merged<T>;
16
- export declare function pick<T extends {
17
- [key: string]: any;
18
- }, K extends keyof T>(map: T, keys: K[]): { [key in K]: T[K]; };
19
- export declare function combineRefs(...refs: (React.Ref<any> | undefined)[]): (el: any) => void;
20
- export declare const limitSmallestQuantity: (val: number, e: number) => number;
21
- export declare const lengthToOffset: (val: any) => number;
22
- export declare class IndexedMap<K, V> extends Map<K, V> {
23
- stack: V[];
24
- set(key: K, value: V): this;
25
- delete(key: K): boolean;
26
- }
27
- type AnimatableObjectProperty = {
28
- value?: string | number;
29
- after?: string | number;
30
- offset: number;
31
- };
32
- export declare function distributeAnimatableKeyframes(prop: string, keyframes: AnimatableObjectProperty[], map?: {
33
- [key: number]: Keyframe;
34
- }): {
35
- [key: number]: Keyframe;
36
- };
37
- export declare function normalizeAnimatableKeyframes(keyframes: (AnimatableKeyframe | undefined)[]): boolean;
38
- export declare function createDynamic(prop: string, keyframes: Keyframe[], easing: string): (this: Track, t: number) => string;
39
- export {};
@@ -1,7 +0,0 @@
1
- import { Link } from "../core/link";
2
- export default function useAudio({ bands, minFrequency, maxFrequency, smoothing }?: {
3
- bands?: number | undefined;
4
- minFrequency?: number | undefined;
5
- maxFrequency?: number | undefined;
6
- smoothing?: number | undefined;
7
- }): [React.RefObject<HTMLAudioElement | null>, Link<number[]>];
@@ -1 +0,0 @@
1
- export default function useLink<T = any>(initial: T): import("../core/link").Link<T>;
@@ -1 +0,0 @@
1
- export default function usePath<T extends SVGGeometryElement = any>(): [React.Ref<T>, (transform: (value: [number, number], index: number) => any) => (progress: number, index: number) => any];
@@ -1 +0,0 @@
1
- export default function useReducedMotion(): boolean;
@@ -1,9 +0,0 @@
1
- export default function useScroll<T extends HTMLElement>({ restore, target }?: {
2
- restore?: number;
3
- target?: React.RefObject<T>;
4
- }): import("../core/link").Link<{
5
- x: number;
6
- y: number;
7
- top: number;
8
- left: number;
9
- }>;
@@ -1,6 +0,0 @@
1
- export default function useSpring<T extends number | number[]>(initial: T, { stiffness, damping, mass, restThreshold }?: {
2
- stiffness?: number | undefined;
3
- damping?: number | undefined;
4
- mass?: number | undefined;
5
- restThreshold?: number | undefined;
6
- }): import("../core/link").Link<T>;
@@ -1,4 +0,0 @@
1
- export type Trigger = (() => void) & {
2
- called: number;
3
- };
4
- export default function useTrigger(): Trigger;
@@ -1,2 +0,0 @@
1
- import { Link } from "../core/link";
2
- export default function useViewport<T extends Element = any>(threshold?: number): [React.Ref<T>, Link<[number, number]>];
@@ -1,6 +0,0 @@
1
- import { Trigger } from "./use-trigger";
2
- export default function useVisible<T extends Element = any>({ enter, exit, threshold }?: {
3
- enter?: boolean | number;
4
- exit?: boolean | number;
5
- threshold?: number;
6
- }): [React.Ref<T>, Trigger, Trigger];
@@ -1,10 +0,0 @@
1
- import useLink from "./hooks/use-link";
2
- import useTrigger from "./hooks/use-trigger";
3
- import useReducedMotion from "./hooks/use-reduced-motion";
4
- import useScroll from "./hooks/use-scroll";
5
- import usePath from "./hooks/use-path";
6
- import useViewport from "./hooks/use-viewport";
7
- import useVisible from "./hooks/use-visible";
8
- import useAudio from "./hooks/use-audio";
9
- import useSpring from "./hooks/use-spring";
10
- export { useLink, useTrigger, useReducedMotion, useScroll, usePath, useViewport, useVisible, useAudio, useSpring };
@@ -1,3 +0,0 @@
1
- import Animatable from "./animatable";
2
- import Animate from "./animate";
3
- export { Animatable, Animate };
@@ -1,16 +0,0 @@
1
- import type { TransitionOptions } from "../core/track";
2
- /**
3
- * Animate layout changes or unmounts.
4
- *
5
- * @see {@link https://lively.infinityfx.dev/docs/components/layout-group}
6
- */
7
- export default function LayoutGroup({ children, transition, initialMount }: {
8
- children: React.ReactNode;
9
- transition?: Omit<TransitionOptions, 'reverse'>;
10
- /**
11
- * Whether to play mount mount animations on first render
12
- *
13
- * @default true
14
- */
15
- initialMount?: boolean;
16
- }): import("react/jsx-runtime").JSX.Element;
@@ -1,24 +0,0 @@
1
- import { AnimatableProps } from "../animatable";
2
- import Timeline from "../core/timeline";
3
- import { TransitionOptions } from "../core/track";
4
- export declare const Groups: {
5
- [key: string]: Map<Timeline, {
6
- state: 'mounted' | 'unmounted' | 'collected';
7
- }>;
8
- };
9
- /**
10
- * Peform layout morphs between components when one mounts and unmount.
11
- *
12
- * @see {@link https://lively.infinityfx.dev/docs/components/morph}
13
- */
14
- declare function Morph({ children, group, transition, ...props }: {
15
- /**
16
- * Global identifier, components with the same group will morph between eachother.
17
- */
18
- group: string;
19
- transition?: Omit<TransitionOptions, 'reverse'>;
20
- } & AnimatableProps): import("react/jsx-runtime").JSX.Element;
21
- declare namespace Morph {
22
- var isLively: boolean;
23
- }
24
- export default Morph;
@@ -1,11 +0,0 @@
1
- import { AnimatableProps } from "../animatable";
2
- /**
3
- * Wrap around text to animate it.
4
- *
5
- * @see {@link https://lively.infinityfx.dev/docs/components/typable}
6
- */
7
- declare function Typable({ children, stagger, staggerLimit, ...props }: AnimatableProps): import("react/jsx-runtime").JSX.Element;
8
- declare namespace Typable {
9
- var isLively: boolean;
10
- }
11
- export default Typable;
@@ -1,4 +0,0 @@
1
- import LayoutGroup from "./layout/layout-group";
2
- import Morph from "./layout/morph";
3
- import Typable from "./layout/typable";
4
- export { LayoutGroup, Morph, Typable };