@ssgoi/core 2.5.5 → 3.0.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/animator/animate/css-runner.d.ts +17 -0
- package/dist/animator/animate/css-runner.d.ts.map +1 -0
- package/dist/animator/animate/index.d.ts +42 -0
- package/dist/animator/animate/index.d.ts.map +1 -0
- package/dist/animator/animate/tick-runner.d.ts +16 -0
- package/dist/animator/animate/tick-runner.d.ts.map +1 -0
- package/dist/animator/animate/types.d.ts +31 -0
- package/dist/animator/animate/types.d.ts.map +1 -0
- package/dist/animator/animation.d.ts +57 -0
- package/dist/animator/animation.d.ts.map +1 -0
- package/dist/animator/index.d.ts +34 -33
- package/dist/animator/index.d.ts.map +1 -1
- package/dist/animator/multi-animator.d.ts +98 -0
- package/dist/animator/multi-animator.d.ts.map +1 -0
- package/dist/animator/spring-core.d.ts +63 -0
- package/dist/animator/spring-core.d.ts.map +1 -0
- package/dist/index.cjs +2 -2
- package/dist/index.js +700 -818
- package/dist/ssgoi-transition/create-ssgoi-transition-context.d.ts.map +1 -1
- package/dist/ssgoi-transition/create-swipe-detector.d.ts +1 -0
- package/dist/ssgoi-transition/create-swipe-detector.d.ts.map +1 -1
- package/dist/transition/create-transition-callback.d.ts +2 -2
- package/dist/transition/create-transition-callback.d.ts.map +1 -1
- package/dist/transition/transition-strategy.d.ts +28 -17
- package/dist/transition/transition-strategy.d.ts.map +1 -1
- package/dist/transition/transition.d.ts +2 -18
- package/dist/transition/transition.d.ts.map +1 -1
- package/dist/transitions/blur.d.ts +5 -5
- package/dist/transitions/blur.d.ts.map +1 -1
- package/dist/transitions/bounce.d.ts +5 -5
- package/dist/transitions/bounce.d.ts.map +1 -1
- package/dist/transitions/fade.d.ts +5 -5
- package/dist/transitions/fade.d.ts.map +1 -1
- package/dist/transitions/fly.d.ts +5 -5
- package/dist/transitions/fly.d.ts.map +1 -1
- package/dist/transitions/index.cjs +1 -1
- package/dist/transitions/index.js +206 -207
- package/dist/transitions/mask.d.ts +5 -5
- package/dist/transitions/mask.d.ts.map +1 -1
- package/dist/transitions/none.d.ts +3 -3
- package/dist/transitions/none.d.ts.map +1 -1
- package/dist/transitions/rotate.d.ts +5 -5
- package/dist/transitions/rotate.d.ts.map +1 -1
- package/dist/transitions/scale.d.ts +5 -5
- package/dist/transitions/scale.d.ts.map +1 -1
- package/dist/transitions/slide.d.ts +5 -5
- package/dist/transitions/slide.d.ts.map +1 -1
- package/dist/types.cjs +1 -1
- package/dist/types.d.ts +142 -102
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +69 -6
- package/dist/view-transitions/blind.d.ts +0 -1
- package/dist/view-transitions/blind.d.ts.map +1 -1
- package/dist/view-transitions/drill.d.ts.map +1 -1
- package/dist/view-transitions/fade.d.ts.map +1 -1
- package/dist/view-transitions/hero.d.ts.map +1 -1
- package/dist/view-transitions/index.cjs +13 -13
- package/dist/view-transitions/index.js +499 -492
- package/dist/view-transitions/scroll.d.ts.map +1 -1
- package/dist/view-transitions/slide.d.ts.map +1 -1
- package/dist/view-transitions/strip.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/animator/animate.d.ts +0 -35
- package/dist/animator/animate.d.ts.map +0 -1
- package/dist/animator/animation-scheduler.d.ts +0 -47
- package/dist/animator/animation-scheduler.d.ts.map +0 -1
- package/dist/test-utils.d.ts +0 -46
- package/dist/test-utils.d.ts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-ssgoi-transition-context.d.ts","sourceRoot":"","sources":["../../src/lib/ssgoi-transition/create-ssgoi-transition-context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAuB,MAAM,UAAU,CAAC;AAW/E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH;;;;;;;;;;;GAWG;AACH,wBAAgB,4BAA4B,CAC1C,OAAO,EAAE,WAAW,GACnB,YAAY,
|
|
1
|
+
{"version":3,"file":"create-ssgoi-transition-context.d.ts","sourceRoot":"","sources":["../../src/lib/ssgoi-transition/create-ssgoi-transition-context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAuB,MAAM,UAAU,CAAC;AAW/E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH;;;;;;;;;;;GAWG;AACH,wBAAgB,4BAA4B,CAC1C,OAAO,EAAE,WAAW,GACnB,YAAY,CAqJd"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-swipe-detector.d.ts","sourceRoot":"","sources":["../../src/lib/ssgoi-transition/create-swipe-detector.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,OAAO
|
|
1
|
+
{"version":3,"file":"create-swipe-detector.d.ts","sourceRoot":"","sources":["../../src/lib/ssgoi-transition/create-swipe-detector.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,OAAO;;;;;EAuFnD"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Transition, TransitionCallback } from '../types';
|
|
2
2
|
import { StrategyContext, TransitionStrategy } from './transition-strategy';
|
|
3
|
-
export declare function createTransitionCallback
|
|
3
|
+
export declare function createTransitionCallback(getTransition: () => Transition<undefined>, options?: {
|
|
4
4
|
onCleanupEnd?: () => void;
|
|
5
|
-
strategy?: (context: StrategyContext
|
|
5
|
+
strategy?: (context: StrategyContext) => TransitionStrategy;
|
|
6
6
|
}): TransitionCallback;
|
|
7
7
|
//# sourceMappingURL=create-transition-callback.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-transition-callback.d.ts","sourceRoot":"","sources":["../../src/lib/transition/create-transition-callback.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"create-transition-callback.d.ts","sourceRoot":"","sources":["../../src/lib/transition/create-transition-callback.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAI/D,OAAO,EAEL,KAAK,eAAe,EACpB,KAAK,kBAAkB,EAExB,MAAM,uBAAuB,CAAC;AAE/B,wBAAgB,wBAAwB,CACtC,aAAa,EAAE,MAAM,UAAU,CAAC,SAAS,CAAC,EAC1C,OAAO,CAAC,EAAE;IACR,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,eAAe,KAAK,kBAAkB,CAAC;CAC7D,GACA,kBAAkB,CA+KpB"}
|
|
@@ -1,28 +1,39 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { MultiSpringConfig } from '../types';
|
|
2
|
+
import { Animation } from '../animator/animation';
|
|
2
3
|
export declare const TRANSITION_STRATEGY: unique symbol;
|
|
3
|
-
export interface StrategyContext
|
|
4
|
+
export interface StrategyContext {
|
|
4
5
|
currentAnimation: {
|
|
5
|
-
controller:
|
|
6
|
+
controller: Animation;
|
|
6
7
|
direction: "in" | "out";
|
|
7
8
|
} | null;
|
|
8
9
|
}
|
|
9
|
-
|
|
10
|
-
|
|
10
|
+
/**
|
|
11
|
+
* Internal animation setup returned by strategy
|
|
12
|
+
* Always uses MultiSpringConfig (normalized from user's Single/Multi config)
|
|
13
|
+
* @internal
|
|
14
|
+
*/
|
|
15
|
+
export interface InternalAnimationSetup {
|
|
16
|
+
config?: MultiSpringConfig;
|
|
11
17
|
state: {
|
|
12
|
-
position:
|
|
13
|
-
velocity:
|
|
18
|
+
position: number;
|
|
19
|
+
velocity: number;
|
|
14
20
|
};
|
|
15
|
-
from:
|
|
16
|
-
to:
|
|
21
|
+
from: number;
|
|
22
|
+
to: number;
|
|
17
23
|
direction: "forward" | "backward";
|
|
18
24
|
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
25
|
+
/**
|
|
26
|
+
* Internal transition configs passed to strategy
|
|
27
|
+
* Always uses MultiSpringConfig (normalized before passing)
|
|
28
|
+
* @internal
|
|
29
|
+
*/
|
|
30
|
+
export interface InternalTransitionConfigs {
|
|
31
|
+
in?: MultiSpringConfig;
|
|
32
|
+
out?: MultiSpringConfig;
|
|
22
33
|
}
|
|
23
|
-
export interface TransitionStrategy
|
|
24
|
-
runIn: (configs:
|
|
25
|
-
runOut: (configs:
|
|
34
|
+
export interface TransitionStrategy {
|
|
35
|
+
runIn: (configs: InternalTransitionConfigs) => Promise<InternalAnimationSetup>;
|
|
36
|
+
runOut: (configs: InternalTransitionConfigs) => Promise<InternalAnimationSetup>;
|
|
26
37
|
}
|
|
27
38
|
/**
|
|
28
39
|
* Creates a transition callback that can be used with framework-specific implementations
|
|
@@ -55,10 +66,10 @@ export interface TransitionStrategy<TAnimationValue = number> {
|
|
|
55
66
|
* - Inner function (entrance callback): Returns cleanup callback (exit)
|
|
56
67
|
* - Cleanup callback: Handles exit transitions
|
|
57
68
|
*/
|
|
58
|
-
export declare const createDefaultStrategy:
|
|
69
|
+
export declare const createDefaultStrategy: (context: StrategyContext) => TransitionStrategy;
|
|
59
70
|
/**
|
|
60
71
|
* Page transition strategy - Always starts fresh without checking current animations
|
|
61
72
|
* This is used for page-level transitions where each transition should be independent
|
|
62
73
|
*/
|
|
63
|
-
export declare const createPageTransitionStrategy:
|
|
74
|
+
export declare const createPageTransitionStrategy: () => TransitionStrategy;
|
|
64
75
|
//# sourceMappingURL=transition-strategy.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transition-strategy.d.ts","sourceRoot":"","sources":["../../src/lib/transition/transition-strategy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"transition-strategy.d.ts","sourceRoot":"","sources":["../../src/lib/transition/transition-strategy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAClD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAEvD,eAAO,MAAM,mBAAmB,eAAoC,CAAC;AAErE,MAAM,WAAW,eAAe;IAE9B,gBAAgB,EAAE;QAChB,UAAU,EAAE,SAAS,CAAC;QACtB,SAAS,EAAE,IAAI,GAAG,KAAK,CAAC;KACzB,GAAG,IAAI,CAAC;CACV;AAED;;;;GAIG;AACH,MAAM,WAAW,sBAAsB;IACrC,MAAM,CAAC,EAAE,iBAAiB,CAAC;IAC3B,KAAK,EAAE;QACL,QAAQ,EAAE,MAAM,CAAC;QACjB,QAAQ,EAAE,MAAM,CAAC;KAClB,CAAC;IACF,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,SAAS,GAAG,UAAU,CAAC;CACnC;AAED;;;;GAIG;AACH,MAAM,WAAW,yBAAyB;IACxC,EAAE,CAAC,EAAE,iBAAiB,CAAC;IACvB,GAAG,CAAC,EAAE,iBAAiB,CAAC;CACzB;AAED,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,CACL,OAAO,EAAE,yBAAyB,KAC/B,OAAO,CAAC,sBAAsB,CAAC,CAAC;IACrC,MAAM,EAAE,CACN,OAAO,EAAE,yBAAyB,KAC/B,OAAO,CAAC,sBAAsB,CAAC,CAAC;CACtC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,eAAO,MAAM,qBAAqB,GAChC,SAAS,eAAe,KACvB,kBAwGF,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,4BAA4B,QAAO,kBA0D/C,CAAC"}
|
|
@@ -22,26 +22,10 @@ export declare function generateAutoKey(): TransitionKey;
|
|
|
22
22
|
* 4. `tick` - Called on each animation frame with progress value (1 → 0)
|
|
23
23
|
* 5. `onEnd` - Called when animation completes and element is removed
|
|
24
24
|
*
|
|
25
|
-
* The `key` parameter is crucial for transition management - it uniquely identifies
|
|
26
|
-
* each transition instance, allowing the system to track, cleanup, and prevent
|
|
27
|
-
* conflicts between multiple transitions on the same element.
|
|
28
|
-
*
|
|
29
|
-
* @param {object} options - Configuration object
|
|
30
|
-
* @param {TransitionKey} options.key - Unique identifier for this transition instance.
|
|
31
|
-
* Can be string or symbol. Used to manage and cleanup
|
|
32
|
-
* transitions internally.
|
|
33
|
-
* @param {Function} options.in - Configuration for entrance animation.
|
|
34
|
-
* Returns TransitionConfig with lifecycle hooks.
|
|
35
|
-
* @param {Function} options.out - Configuration for exit animation.
|
|
36
|
-
* Returns TransitionConfig with lifecycle hooks.
|
|
37
|
-
*
|
|
38
|
-
* @template TAnimationValue - The type of value being animated (number | object)
|
|
39
|
-
*
|
|
40
25
|
* @returns {TransitionCallback} A callback function to be used as a ref
|
|
41
26
|
*
|
|
42
27
|
* @example
|
|
43
28
|
* ```tsx
|
|
44
|
-
* // Simple fade transition
|
|
45
29
|
* <div ref={transition({
|
|
46
30
|
* key: 'hero-fade',
|
|
47
31
|
* in: (element) => ({
|
|
@@ -54,7 +38,7 @@ export declare function generateAutoKey(): TransitionKey;
|
|
|
54
38
|
* })} />
|
|
55
39
|
* ```
|
|
56
40
|
*/
|
|
57
|
-
export declare function transition
|
|
58
|
-
[TRANSITION_STRATEGY]?: (context: StrategyContext
|
|
41
|
+
export declare function transition(options: TransitionOptions<undefined> & {
|
|
42
|
+
[TRANSITION_STRATEGY]?: (context: StrategyContext) => TransitionStrategy;
|
|
59
43
|
}): TransitionCallback;
|
|
60
44
|
//# sourceMappingURL=transition.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transition.d.ts","sourceRoot":"","sources":["../../src/lib/transition/transition.ts"],"names":[],"mappings":"AACA,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,kBAAkB,EACnB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAEV,kBAAkB,EAClB,iBAAiB,EAClB,MAAM,UAAU,CAAC;AAClB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"transition.d.ts","sourceRoot":"","sources":["../../src/lib/transition/transition.ts"],"names":[],"mappings":"AACA,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,kBAAkB,EACnB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAEV,kBAAkB,EAClB,iBAAiB,EAClB,MAAM,UAAU,CAAC;AAClB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AA2D9C,wBAAgB,eAAe,IAAI,aAAa,CAU/C;AAoBD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,wBAAgB,UAAU,CACxB,OAAO,EAAE,iBAAiB,CAAC,SAAS,CAAC,GAAG;IACtC,CAAC,mBAAmB,CAAC,CAAC,EAAE,CAAC,OAAO,EAAE,eAAe,KAAK,kBAAkB,CAAC;CAC1E,GACA,kBAAkB,CAmBpB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TransitionKey } from '../types';
|
|
1
|
+
import { StyleObject, TransitionKey } from '../types';
|
|
2
2
|
interface BlurOptions {
|
|
3
3
|
amount?: number | string;
|
|
4
4
|
opacity?: number;
|
|
@@ -12,19 +12,19 @@ interface BlurOptions {
|
|
|
12
12
|
}
|
|
13
13
|
export declare const blur: (options?: BlurOptions) => {
|
|
14
14
|
key?: TransitionKey | undefined;
|
|
15
|
-
in: (
|
|
15
|
+
in: () => {
|
|
16
16
|
spring: {
|
|
17
17
|
stiffness?: number;
|
|
18
18
|
damping?: number;
|
|
19
19
|
};
|
|
20
|
-
|
|
20
|
+
css: (progress: number) => StyleObject;
|
|
21
21
|
};
|
|
22
|
-
out: (
|
|
22
|
+
out: () => {
|
|
23
23
|
spring: {
|
|
24
24
|
stiffness?: number;
|
|
25
25
|
damping?: number;
|
|
26
26
|
};
|
|
27
|
-
|
|
27
|
+
css: (progress: number) => StyleObject;
|
|
28
28
|
};
|
|
29
29
|
};
|
|
30
30
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"blur.d.ts","sourceRoot":"","sources":["../../src/lib/transitions/blur.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"blur.d.ts","sourceRoot":"","sources":["../../src/lib/transitions/blur.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAE3D,UAAU,WAAW;IACnB,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACzB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,MAAM,CAAC,EAAE;QACP,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,CAAC;IACF,GAAG,CAAC,EAAE,aAAa,CAAC;CACrB;AAED,eAAO,MAAM,IAAI,GAAI,UAAS,WAAgB;;;;wBAN9B,MAAM;sBACR,MAAM;;wBAeQ,MAAM,KAAG,WAAW;;;;wBAhBhC,MAAM;sBACR,MAAM;;wBAeQ,MAAM,KAAG,WAAW;;CAgC/C,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TransitionKey } from '../types';
|
|
1
|
+
import { StyleObject, TransitionKey } from '../types';
|
|
2
2
|
interface BounceOptions {
|
|
3
3
|
height?: number;
|
|
4
4
|
intensity?: number;
|
|
@@ -13,19 +13,19 @@ interface BounceOptions {
|
|
|
13
13
|
}
|
|
14
14
|
export declare const bounce: (options?: BounceOptions) => {
|
|
15
15
|
key?: TransitionKey | undefined;
|
|
16
|
-
in: (
|
|
16
|
+
in: () => {
|
|
17
17
|
spring: {
|
|
18
18
|
stiffness?: number;
|
|
19
19
|
damping?: number;
|
|
20
20
|
};
|
|
21
|
-
|
|
21
|
+
css: (progress: number) => StyleObject;
|
|
22
22
|
};
|
|
23
|
-
out: (
|
|
23
|
+
out: () => {
|
|
24
24
|
spring: {
|
|
25
25
|
stiffness?: number;
|
|
26
26
|
damping?: number;
|
|
27
27
|
};
|
|
28
|
-
|
|
28
|
+
css: (progress: number) => StyleObject;
|
|
29
29
|
};
|
|
30
30
|
};
|
|
31
31
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bounce.d.ts","sourceRoot":"","sources":["../../src/lib/transitions/bounce.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"bounce.d.ts","sourceRoot":"","sources":["../../src/lib/transitions/bounce.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAE3D,UAAU,aAAa;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,SAAS,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;IAC1B,MAAM,CAAC,EAAE;QACP,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,CAAC;IACF,GAAG,CAAC,EAAE,aAAa,CAAC;CACrB;AAED,eAAO,MAAM,MAAM,GAAI,UAAS,aAAkB;;;;wBANlC,MAAM;sBACR,MAAM;;wBAgBQ,MAAM,KAAG,WAAW;;;;wBAjBhC,MAAM;sBACR,MAAM;;wBAgBQ,MAAM,KAAG,WAAW;;CAwC/C,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TransitionKey } from '../types';
|
|
1
|
+
import { StyleObject, TransitionKey } from '../types';
|
|
2
2
|
interface FadeOptions {
|
|
3
3
|
from?: number;
|
|
4
4
|
to?: number;
|
|
@@ -10,19 +10,19 @@ interface FadeOptions {
|
|
|
10
10
|
}
|
|
11
11
|
export declare const fade: (options?: FadeOptions) => {
|
|
12
12
|
key?: TransitionKey | undefined;
|
|
13
|
-
in: (
|
|
13
|
+
in: () => {
|
|
14
14
|
spring: {
|
|
15
15
|
stiffness?: number;
|
|
16
16
|
damping?: number;
|
|
17
17
|
};
|
|
18
|
-
|
|
18
|
+
css: (progress: number) => StyleObject;
|
|
19
19
|
};
|
|
20
|
-
out: (
|
|
20
|
+
out: () => {
|
|
21
21
|
spring: {
|
|
22
22
|
stiffness?: number;
|
|
23
23
|
damping?: number;
|
|
24
24
|
};
|
|
25
|
-
|
|
25
|
+
css: (progress: number) => StyleObject;
|
|
26
26
|
};
|
|
27
27
|
};
|
|
28
28
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fade.d.ts","sourceRoot":"","sources":["../../src/lib/transitions/fade.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"fade.d.ts","sourceRoot":"","sources":["../../src/lib/transitions/fade.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAE3D,UAAU,WAAW;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE;QACP,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,CAAC;IACF,GAAG,CAAC,EAAE,aAAa,CAAC;CACrB;AAED,eAAO,MAAM,IAAI,GAAI,UAAS,WAAgB;;;;wBAN9B,MAAM;sBACR,MAAM;;wBAgBE,MAAM,KAAG,WAAW;;;;wBAjB1B,MAAM;sBACR,MAAM;;wBAsBE,MAAM,KAAG,WAAW;;CAMzC,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TransitionKey } from '../types';
|
|
1
|
+
import { StyleObject, TransitionKey } from '../types';
|
|
2
2
|
interface FlyOptions {
|
|
3
3
|
x?: number | string;
|
|
4
4
|
y?: number | string;
|
|
@@ -11,19 +11,19 @@ interface FlyOptions {
|
|
|
11
11
|
}
|
|
12
12
|
export declare const fly: (options?: FlyOptions) => {
|
|
13
13
|
key?: TransitionKey | undefined;
|
|
14
|
-
in: (
|
|
14
|
+
in: () => {
|
|
15
15
|
spring: {
|
|
16
16
|
stiffness?: number;
|
|
17
17
|
damping?: number;
|
|
18
18
|
};
|
|
19
|
-
|
|
19
|
+
css: (progress: number) => StyleObject;
|
|
20
20
|
};
|
|
21
|
-
out: (
|
|
21
|
+
out: () => {
|
|
22
22
|
spring: {
|
|
23
23
|
stiffness?: number;
|
|
24
24
|
damping?: number;
|
|
25
25
|
};
|
|
26
|
-
|
|
26
|
+
css: (progress: number) => StyleObject;
|
|
27
27
|
};
|
|
28
28
|
};
|
|
29
29
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fly.d.ts","sourceRoot":"","sources":["../../src/lib/transitions/fly.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"fly.d.ts","sourceRoot":"","sources":["../../src/lib/transitions/fly.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAE3D,UAAU,UAAU;IAClB,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACpB,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE;QACP,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,CAAC;IACF,GAAG,CAAC,EAAE,aAAa,CAAC;CACrB;AAED,eAAO,MAAM,GAAG,GAAI,UAAS,UAAe;;;;wBAN5B,MAAM;sBACR,MAAM;;wBAcQ,MAAM,KAAG,WAAW;;;;wBAfhC,MAAM;sBACR,MAAM;;wBAcQ,MAAM,KAAG,WAAW;;CAmC/C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=(p={})=>{const{from:t=0,to:e=1,spring:a={stiffness:300,damping:30},key:u}=p;return{in:()=>({spring:a,css:c=>({opacity:t+(e-t)*c})}),out:()=>({spring:a,css:c=>({opacity:t+(e-t)*c})}),...u&&{key:u}}},x=(p={})=>{const{start:t=0,opacity:e=0,axis:a="both",spring:u={stiffness:300,damping:30},key:c}=p,f=s=>{switch(a){case"x":return`scaleX(${s})`;case"y":return`scaleY(${s})`;case"both":default:return`scale(${s})`}},i=s=>{const r=t+(1-t)*s;return{transform:f(r),opacity:e+(1-e)*s}};return{in:()=>({spring:u,css:i}),out:()=>({spring:u,css:i}),...c&&{key:c}}},k=(p={})=>{const{direction:t,distance:e=100,opacity:a=0,fade:u=!0,axis:c,spring:f={stiffness:400,damping:35},key:i}=p,r=t||(c==="x"?"left":c==="y"?"up":"left"),n=d=>{const o=1-d;if(typeof e=="number"){const l=o*e;switch(r){case"left":return`translate3d(${-l}px, 0, 0)`;case"right":return`translate3d(${l}px, 0, 0)`;case"up":return`translate3d(0, ${-l}px, 0)`;case"down":return`translate3d(0, ${l}px, 0)`}}else switch(r){case"left":return`translate3d(calc(-1 * ${e} * ${o}), 0, 0)`;case"right":return`translate3d(calc(${e} * ${o}), 0, 0)`;case"up":return`translate3d(0, calc(-1 * ${e} * ${o}), 0)`;case"down":return`translate3d(0, calc(${e} * ${o}), 0)`}},$=d=>{const o={transform:n(d)};return u&&(o.opacity=a+(1-a)*d),o};return{in:()=>({spring:f,css:$}),out:()=>({spring:f,css:$}),...i&&{key:i}}},w=(p={})=>{const{degrees:t=360,clockwise:e=!0,scale:a=!1,fade:u=!0,origin:c="center",axis:f="2d",perspective:i=800,spring:s={stiffness:500,damping:25},key:r}=p,n=e?t:-t,$=o=>{const l=(1-o)*n;switch(f){case"x":return`perspective(${i}px) rotateX(${l}deg)`;case"y":return`perspective(${i}px) rotateY(${l}deg)`;case"z":return`rotateZ(${l}deg)`;case"2d":default:return`rotate(${l}deg)`}},d=o=>{const l={},g=[$(o)];return a&&g.push(`scale(${o})`),l.transform=g.join(" "),l.transformOrigin=c,u&&(l.opacity=o),l};return{in:()=>({spring:s,css:d}),out:()=>({spring:s,css:d}),...r&&{key:r}}},C=(p={})=>{const{height:t=20,intensity:e=1,scale:a=!0,fade:u=!0,direction:c="up",spring:f={stiffness:800,damping:15},key:i}=p,s=r=>{const n={},$=[],d=Math.sin(r*Math.PI*(1+e)),o=1-r,l=d*t*o;if(c==="up"?$.push(`translateY(${-Math.abs(l)}px)`):$.push(`translateY(${Math.abs(l)}px)`),a){const g=.8+r*.2+d*.05*o;$.push(`scale(${g})`)}return n.transform=$.join(" "),u&&(n.opacity=r),n};return{in:()=>({spring:f,css:s}),out:()=>({spring:f,css:s}),...i&&{key:i}}},M=(p={})=>{const{amount:t=10,opacity:e=0,scale:a=!1,fade:u=!0,spring:c={stiffness:300,damping:30},key:f}=p,i=s=>{const r=1-s,n={};return typeof t=="number"?n.filter=`blur(${r*t}px)`:n.filter=`blur(calc(${t} * ${r}))`,a&&(n.transform=`scale(${.8+s*.2})`),u&&(n.opacity=e+(1-e)*s),n};return{in:()=>({spring:c,css:i}),out:()=>({spring:c,css:i}),...f&&{key:f}}},O=(p={})=>{const{x:t=0,y:e=-100,opacity:a=0,spring:u={stiffness:400,damping:35},key:c}=p,f=i=>{const s=1-i;let r,n;return typeof t=="number"?r=`${s*t}px`:r=`calc(${t} * ${s})`,typeof e=="number"?n=`${s*e}px`:n=`calc(${e} * ${s})`,{transform:`translate3d(${r}, ${n}, 0)`,opacity:a+(1-a)*i}};return{in:()=>({spring:u,css:f}),out:()=>({spring:u,css:f}),...c&&{key:c}}},P=(p={})=>{const{shape:t="circle",origin:e="center",scale:a=1.5,fade:u=!1,spring:c={stiffness:300,damping:30},key:f}=p,i=()=>{switch(e){case"top":return"50% 0%";case"bottom":return"50% 100%";case"left":return"0% 50%";case"right":return"100% 50%";case"top-left":return"0% 0%";case"top-right":return"100% 0%";case"bottom-left":return"0% 100%";case"bottom-right":return"100% 100%";case"center":default:return"50% 50%"}},s=n=>{const $=n*a*100,d=i();switch(t){case"ellipse":return`ellipse(${$}% ${$*.75}% at ${d})`;case"square":{const o=n*a*100,[l,g]=d.split(" "),m=parseFloat(l),h=parseFloat(g),y=o/2;return`polygon(${m-y}% ${h-y}%, ${m+y}% ${h-y}%, ${m+y}% ${h+y}%, ${m-y}% ${h+y}%)`}case"circle":default:return`circle(${$}% at ${d})`}},r=n=>{const $={clipPath:s(n)};return u&&($.opacity=n),$};return{in:()=>({spring:c,css:r}),out:()=>({spring:c,css:r}),...f&&{key:f}}},S=(p={})=>{const{spring:t={stiffness:1e3,damping:100},key:e}=p;return{in:()=>({spring:t,css:()=>({})}),out:()=>({spring:t,css:()=>({})}),...e&&{key:e}}};exports.blur=M;exports.bounce=C;exports.fade=b;exports.fly=O;exports.mask=P;exports.none=S;exports.rotate=w;exports.scale=x;exports.slide=k;
|