@ssgoi/core 2.5.6 → 3.1.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/animation.d.ts +57 -0
- package/dist/animator/animation.d.ts.map +1 -0
- package/dist/animator/index.d.ts +4 -3
- 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/index.cjs +2 -2
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +603 -658
- package/dist/transition/create-transition-callback.d.ts +2 -1
- package/dist/transition/create-transition-callback.d.ts.map +1 -1
- package/dist/transition/transition-scope.d.ts +36 -0
- package/dist/transition/transition-scope.d.ts.map +1 -0
- package/dist/transition/transition-strategy.d.ts +20 -9
- package/dist/transition/transition-strategy.d.ts.map +1 -1
- 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 +91 -78
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +60 -11
- package/dist/view-transitions/blind.d.ts +0 -1
- package/dist/view-transitions/blind.d.ts.map +1 -1
- package/dist/view-transitions/fade.d.ts.map +1 -1
- package/dist/view-transitions/index.cjs +13 -13
- package/dist/view-transitions/index.js +472 -479
- 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/animation-scheduler.d.ts +0 -34
- 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,7 +1,8 @@
|
|
|
1
|
-
import { Transition, TransitionCallback } from '../types';
|
|
1
|
+
import { Transition, TransitionCallback, TransitionScope } from '../types';
|
|
2
2
|
import { StrategyContext, TransitionStrategy } from './transition-strategy';
|
|
3
3
|
export declare function createTransitionCallback(getTransition: () => Transition<undefined>, options?: {
|
|
4
4
|
onCleanupEnd?: () => void;
|
|
5
5
|
strategy?: (context: StrategyContext) => TransitionStrategy;
|
|
6
|
+
scope?: TransitionScope;
|
|
6
7
|
}): TransitionCallback;
|
|
7
8
|
//# 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,eAAe,EAAE,MAAM,UAAU,CAAC;AAIhF,OAAO,EAEL,KAAK,eAAe,EACpB,KAAK,kBAAkB,EAExB,MAAM,uBAAuB,CAAC;AAG/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;IAC5D,KAAK,CAAC,EAAE,eAAe,CAAC;CACzB,GACA,kBAAkB,CA6MpB"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { TransitionCallback } from '../types';
|
|
2
|
+
declare const SCOPE_ATTR = "data-ssgoi-scope";
|
|
3
|
+
declare const SCOPE_READY_ATTR = "data-ssgoi-scope-ready";
|
|
4
|
+
/**
|
|
5
|
+
* Creates a transition scope that controls child transition behavior.
|
|
6
|
+
*
|
|
7
|
+
* When a child transition has `scope: 'local'`:
|
|
8
|
+
* - If child mounts simultaneously with scope → skip IN animation
|
|
9
|
+
* - If child unmounts simultaneously with scope → skip OUT animation
|
|
10
|
+
* - If child mounts/unmounts while scope is stable → run animation
|
|
11
|
+
*
|
|
12
|
+
* @returns A ref callback to attach to the scope container element
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```tsx
|
|
16
|
+
* // React
|
|
17
|
+
* <div ref={createTransitionScope()} style={{ display: 'contents' }}>
|
|
18
|
+
* <div ref={transition(fadeIn(), { scope: 'local' })}>
|
|
19
|
+
* Content
|
|
20
|
+
* </div>
|
|
21
|
+
* </div>
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
export declare function createTransitionScope(): TransitionCallback;
|
|
25
|
+
/**
|
|
26
|
+
* Check if scope element is ready (mounted and initial render complete)
|
|
27
|
+
* @internal
|
|
28
|
+
*/
|
|
29
|
+
export declare function isScopeReady(scope: Element): boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Find the closest transition scope element
|
|
32
|
+
* @internal
|
|
33
|
+
*/
|
|
34
|
+
export declare function findScope(element: Element): Element | null;
|
|
35
|
+
export { SCOPE_ATTR, SCOPE_READY_ATTR };
|
|
36
|
+
//# sourceMappingURL=transition-scope.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transition-scope.d.ts","sourceRoot":"","sources":["../../src/lib/transition/transition-scope.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAEnD,QAAA,MAAM,UAAU,qBAAqB,CAAC;AACtC,QAAA,MAAM,gBAAgB,2BAA2B,CAAC;AAElD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,qBAAqB,IAAI,kBAAkB,CAkB1D;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAEpD;AAED;;;GAGG;AACH,wBAAgB,SAAS,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,GAAG,IAAI,CAE1D;AAED,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,CAAC"}
|
|
@@ -1,13 +1,19 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { MultiSpringConfig } from '../types';
|
|
2
|
+
import { Animation } from '../animator/animation';
|
|
2
3
|
export declare const TRANSITION_STRATEGY: unique symbol;
|
|
3
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
18
|
position: number;
|
|
13
19
|
velocity: number;
|
|
@@ -16,13 +22,18 @@ export interface AnimationSetup {
|
|
|
16
22
|
to: number;
|
|
17
23
|
direction: "forward" | "backward";
|
|
18
24
|
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
25
|
+
/**
|
|
26
|
+
* Internal transition configs passed to strategy
|
|
27
|
+
* Uses Promise<MultiSpringConfig> to allow lazy evaluation
|
|
28
|
+
* @internal
|
|
29
|
+
*/
|
|
30
|
+
export interface InternalTransitionConfigs {
|
|
31
|
+
in?: Promise<MultiSpringConfig>;
|
|
32
|
+
out?: Promise<MultiSpringConfig>;
|
|
22
33
|
}
|
|
23
34
|
export interface TransitionStrategy {
|
|
24
|
-
runIn: (configs:
|
|
25
|
-
runOut: (configs:
|
|
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
|
|
@@ -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,OAAO,CAAC,iBAAiB,CAAC,CAAC;IAChC,GAAG,CAAC,EAAE,OAAO,CAAC,iBAAiB,CAAC,CAAC;CAClC;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,kBA4GF,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,4BAA4B,QAAO,kBA4D/C,CAAC"}
|
|
@@ -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,
|
|
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,EAElB,MAAM,UAAU,CAAC;AAClB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AA+D9C,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,CAsBpB"}
|
|
@@ -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;
|