@ssgoi/core 2.5.4 → 2.5.6

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/dist/animator/animate/css-runner.d.ts +17 -0
  2. package/dist/animator/animate/css-runner.d.ts.map +1 -0
  3. package/dist/animator/animate/index.d.ts +42 -0
  4. package/dist/animator/animate/index.d.ts.map +1 -0
  5. package/dist/animator/animate/tick-runner.d.ts +16 -0
  6. package/dist/animator/animate/tick-runner.d.ts.map +1 -0
  7. package/dist/animator/animate/types.d.ts +31 -0
  8. package/dist/animator/animate/types.d.ts.map +1 -0
  9. package/dist/animator/animation-scheduler.d.ts +4 -17
  10. package/dist/animator/animation-scheduler.d.ts.map +1 -1
  11. package/dist/animator/index.d.ts +32 -32
  12. package/dist/animator/index.d.ts.map +1 -1
  13. package/dist/animator/spring-core.d.ts +63 -0
  14. package/dist/animator/spring-core.d.ts.map +1 -0
  15. package/dist/animator/ticker.d.ts +1 -0
  16. package/dist/animator/ticker.d.ts.map +1 -1
  17. package/dist/index.cjs +2 -2
  18. package/dist/index.js +567 -608
  19. package/dist/jaemin-BG8HRXG1.cjs +1 -0
  20. package/dist/{jaemin-BAi8PTrj.js → jaemin-BWkrXq0V.js} +21 -20
  21. package/dist/ssgoi-transition/create-ssgoi-transition-context.d.ts.map +1 -1
  22. package/dist/ssgoi-transition/create-swipe-detector.d.ts +1 -0
  23. package/dist/ssgoi-transition/create-swipe-detector.d.ts.map +1 -1
  24. package/dist/transition/create-transition-callback.d.ts +2 -2
  25. package/dist/transition/create-transition-callback.d.ts.map +1 -1
  26. package/dist/transition/transition-strategy.d.ts +16 -16
  27. package/dist/transition/transition-strategy.d.ts.map +1 -1
  28. package/dist/transition/transition.d.ts +2 -18
  29. package/dist/transition/transition.d.ts.map +1 -1
  30. package/dist/types.cjs +1 -1
  31. package/dist/types.d.ts +74 -34
  32. package/dist/types.d.ts.map +1 -1
  33. package/dist/types.js +21 -6
  34. package/dist/view-transitions/drill.d.ts.map +1 -1
  35. package/dist/view-transitions/hero.d.ts.map +1 -1
  36. package/dist/view-transitions/index.cjs +7 -7
  37. package/dist/view-transitions/index.js +298 -284
  38. package/package.json +1 -1
  39. package/dist/animator/animate.d.ts +0 -35
  40. package/dist/animator/animate.d.ts.map +0 -1
  41. package/dist/jaemin-DL1-g_B5.cjs +0 -1
@@ -0,0 +1 @@
1
+ "use strict";function b(i,a){function o(d){let l=0,y=0;const t=d.offsetWidth,g=d.offsetHeight;let s=d;for(;s;)l+=s.offsetTop,y+=s.offsetLeft,s=s.offsetParent;return l-=window.scrollY,y-=window.scrollX,{top:l,left:y,width:t,height:g}}const e=o(i),n=o(a);return new DOMRect(n.left-e.left,n.top-e.top,n.width,n.height)}const x=(i,a)=>{var o;i.style.position="absolute",i.style.width="100%",i.style.top=`${-1*(((o=a==null?void 0:a.scrollOffset)==null?void 0:o.y)??0)}px`,i.style.left="0"};function M(i,a="viewport"){if(a==="positioned-parent"){const o=i.positionedParent.getBoundingClientRect();return{top:o.top,left:o.left,width:o.width,height:o.height}}else{const o=b(document.body,i.positionedParent);return{top:i.scroll.y,left:0,width:o.width,height:window.innerHeight-o.top}}}const F=(i={})=>R(i),R=(i={})=>{var l,y;const a={stiffness:((l=i.spring)==null?void 0:l.stiffness)??50,damping:((y=i.spring)==null?void 0:y.damping)??30},o=i.initialRotation??45,e=i.initialScale??.01,n=i.rotationTriggerPoint??.8,d=i.containerMode??"viewport";return{out:async(t,g)=>{const s=t.style.opacity;return{spring:{stiffness:80,damping:25},from:1,to:0,prepare:()=>{x(t,g),t.style.opacity="1"},tick:w=>{t.style.opacity=String(w)},onEnd:()=>{t.style.opacity=s}}},in:async(t,g)=>{const s=M(g,d),w=t.style.transform,$=t.style.transformOrigin,O=t.style.position,v=t.style.zIndex;return{spring:a,from:0,to:1,prepare:()=>{const r=Math.min(s.width,s.height)*.4;if(t.style.setProperty("--max-border-radius",`${r}px`),t.style.setProperty("--border-radius-scale","1"),t.style.willChange="transform",t.style.backfaceVisibility="hidden",d==="positioned-parent")t.style.transformOrigin="50% 50%",t.style.position="absolute",t.style.top="0px",t.style.left="0px",t.style.width=`${s.width}px`,t.style.height=`${s.height}px`;else{const f=s.left+s.width/2,h=s.top+s.height/2;t.style.transformOrigin=`${f}px ${h}px`,t.style.position="fixed",t.style.top=`${s.top}px`,t.style.left=`${s.left}px`,t.style.width=`${s.width}px`,t.style.height=`${s.height}px`}t.style.zIndex="1000",t.style.overflow="hidden",t.style.transform=`rotate(${o}deg) scale(${e}) translateZ(0)`,t.style.borderRadius="calc(var(--max-border-radius) * var(--border-radius-scale))",t.style.opacity="1"},tick:r=>{let f;if(r<=.05)f=e;else if(r<=n){const c=(r-.05)/(n-.05),u=Math.pow(c,9);f=e+(.8-e)*u}else{const c=(r-n)/(1-n);f=.8+.2*(1-Math.pow(1-c,3))}let h;const p=.7;if(r<=p)h=o;else{const c=(r-p)/(1-p),u=1-Math.pow(1-c,2);h=o*(1-u)}let P;if(r<=p)P=1;else{const c=(r-p)/(1-p);P=1-Math.pow(c,.5)}t.style.transform=`rotate(${h.toFixed(2)}deg) scale(${f.toFixed(4)}) translateZ(0)`,t.style.setProperty("--border-radius-scale",P.toFixed(4))},onEnd:()=>{t.style.willChange="",t.style.backfaceVisibility="",t.style.removeProperty("--max-border-radius"),t.style.removeProperty("--border-radius-scale"),t.style.transform=w,t.style.transformOrigin=$,t.style.position=O,t.style.zIndex=v,t.style.top="",t.style.left="",t.style.width="",t.style.height="",t.style.overflow="",t.style.borderRadius=""}}}}};exports.getRect=b;exports.jaemin=F;exports.jaeminInternal=R;exports.prepareOutgoing=x;
@@ -15,10 +15,11 @@ function R(i, a) {
15
15
  n.height
16
16
  );
17
17
  }
18
- const v = (i, a) => {
19
- i.style.position = "absolute", i.style.width = "100%", i.style.top = `${-1 * ((a == null ? void 0 : a.scroll.y) ?? 0)}px`, i.style.left = "0";
18
+ const O = (i, a) => {
19
+ var o;
20
+ i.style.position = "absolute", i.style.width = "100%", i.style.top = `${-1 * (((o = a == null ? void 0 : a.scrollOffset) == null ? void 0 : o.y) ?? 0)}px`, i.style.left = "0";
20
21
  };
21
- function M(i, a = "viewport") {
22
+ function v(i, a = "viewport") {
22
23
  if (a === "positioned-parent") {
23
24
  const o = i.positionedParent.getBoundingClientRect();
24
25
  return {
@@ -37,7 +38,7 @@ function M(i, a = "viewport") {
37
38
  };
38
39
  }
39
40
  }
40
- const F = (i = {}) => O(i), O = (i = {}) => {
41
+ const F = (i = {}) => M(i), M = (i = {}) => {
41
42
  var l, y;
42
43
  const a = {
43
44
  // Much slower animation - 4x duration by reducing stiffness further
@@ -55,7 +56,7 @@ const F = (i = {}) => O(i), O = (i = {}) => {
55
56
  from: 1,
56
57
  to: 0,
57
58
  prepare: () => {
58
- v(t, g), t.style.opacity = "1";
59
+ O(t, g), t.style.opacity = "1";
59
60
  },
60
61
  tick: (w) => {
61
62
  t.style.opacity = String(w);
@@ -66,7 +67,7 @@ const F = (i = {}) => O(i), O = (i = {}) => {
66
67
  };
67
68
  },
68
69
  in: async (t, g) => {
69
- const s = M(g, d), w = t.style.transform, b = t.style.transformOrigin, x = t.style.position, $ = t.style.zIndex;
70
+ const s = v(g, d), w = t.style.transform, b = t.style.transformOrigin, x = t.style.position, $ = t.style.zIndex;
70
71
  return {
71
72
  spring: a,
72
73
  from: 0,
@@ -79,38 +80,38 @@ const F = (i = {}) => O(i), O = (i = {}) => {
79
80
  ), t.style.setProperty("--border-radius-scale", "1"), t.style.willChange = "transform", t.style.backfaceVisibility = "hidden", d === "positioned-parent")
80
81
  t.style.transformOrigin = "50% 50%", t.style.position = "absolute", t.style.top = "0px", t.style.left = "0px", t.style.width = `${s.width}px`, t.style.height = `${s.height}px`;
81
82
  else {
82
- const p = s.left + s.width / 2, h = s.top + s.height / 2;
83
- t.style.transformOrigin = `${p}px ${h}px`, t.style.position = "fixed", t.style.top = `${s.top}px`, t.style.left = `${s.left}px`, t.style.width = `${s.width}px`, t.style.height = `${s.height}px`;
83
+ const f = s.left + s.width / 2, h = s.top + s.height / 2;
84
+ t.style.transformOrigin = `${f}px ${h}px`, t.style.position = "fixed", t.style.top = `${s.top}px`, t.style.left = `${s.left}px`, t.style.width = `${s.width}px`, t.style.height = `${s.height}px`;
84
85
  }
85
86
  t.style.zIndex = "1000", t.style.overflow = "hidden", t.style.transform = `rotate(${o}deg) scale(${e}) translateZ(0)`, t.style.borderRadius = "calc(var(--max-border-radius) * var(--border-radius-scale))", t.style.opacity = "1";
86
87
  },
87
88
  tick: (r) => {
88
- let p;
89
+ let f;
89
90
  if (r <= 0.05)
90
- p = e;
91
+ f = e;
91
92
  else if (r <= n) {
92
93
  const c = (r - 0.05) / (n - 0.05), u = Math.pow(c, 9);
93
- p = e + (0.8 - e) * u;
94
+ f = e + (0.8 - e) * u;
94
95
  } else {
95
96
  const c = (r - n) / (1 - n);
96
- p = 0.8 + 0.2 * (1 - Math.pow(1 - c, 3));
97
+ f = 0.8 + 0.2 * (1 - Math.pow(1 - c, 3));
97
98
  }
98
99
  let h;
99
- const f = 0.7;
100
- if (r <= f)
100
+ const p = 0.7;
101
+ if (r <= p)
101
102
  h = o;
102
103
  else {
103
- const c = (r - f) / (1 - f), u = 1 - Math.pow(1 - c, 2);
104
+ const c = (r - p) / (1 - p), u = 1 - Math.pow(1 - c, 2);
104
105
  h = o * (1 - u);
105
106
  }
106
107
  let P;
107
- if (r <= f)
108
+ if (r <= p)
108
109
  P = 1;
109
110
  else {
110
- const c = (r - f) / (1 - f);
111
+ const c = (r - p) / (1 - p);
111
112
  P = 1 - Math.pow(c, 0.5);
112
113
  }
113
- t.style.transform = `rotate(${h.toFixed(2)}deg) scale(${p.toFixed(4)}) translateZ(0)`, t.style.setProperty(
114
+ t.style.transform = `rotate(${h.toFixed(2)}deg) scale(${f.toFixed(4)}) translateZ(0)`, t.style.setProperty(
114
115
  "--border-radius-scale",
115
116
  P.toFixed(4)
116
117
  );
@@ -125,6 +126,6 @@ const F = (i = {}) => O(i), O = (i = {}) => {
125
126
  export {
126
127
  F as a,
127
128
  R as g,
128
- O as j,
129
- v as p
129
+ M as j,
130
+ O as p
130
131
  };
@@ -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,CAkJd"}
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"}
@@ -6,5 +6,6 @@ export declare function createSwipeDetector(enabled: boolean): {
6
6
  initialize: () => void;
7
7
  cleanup: () => void;
8
8
  isSwipePending: () => boolean;
9
+ resetSwipeDetection: () => void;
9
10
  };
10
11
  //# sourceMappingURL=create-swipe-detector.d.ts.map
@@ -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;;;;EAgFnD"}
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<TAnimationValue = number>(getTransition: () => Transition<undefined, TAnimationValue>, options?: {
3
+ export declare function createTransitionCallback(getTransition: () => Transition<undefined>, options?: {
4
4
  onCleanupEnd?: () => void;
5
- strategy?: (context: StrategyContext<TAnimationValue>) => TransitionStrategy<TAnimationValue>;
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,EACV,UAAU,EACV,kBAAkB,EAEnB,MAAM,UAAU,CAAC;AAIlB,OAAO,EAEL,KAAK,eAAe,EACpB,KAAK,kBAAkB,EAExB,MAAM,uBAAuB,CAAC;AAE/B,wBAAgB,wBAAwB,CAAC,eAAe,GAAG,MAAM,EAC/D,aAAa,EAAE,MAAM,UAAU,CAAC,SAAS,EAAE,eAAe,CAAC,EAC3D,OAAO,CAAC,EAAE;IACR,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B,QAAQ,CAAC,EAAE,CACT,OAAO,EAAE,eAAe,CAAC,eAAe,CAAC,KACtC,kBAAkB,CAAC,eAAe,CAAC,CAAC;CAC1C,GACA,kBAAkB,CA0RpB"}
1
+ {"version":3,"file":"create-transition-callback.d.ts","sourceRoot":"","sources":["../../src/lib/transition/create-transition-callback.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EACV,kBAAkB,EAEnB,MAAM,UAAU,CAAC;AAIlB,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,CAqOpB"}
@@ -1,28 +1,28 @@
1
1
  import { TransitionConfig, AnimationController } from '../types';
2
2
  export declare const TRANSITION_STRATEGY: unique symbol;
3
- export interface StrategyContext<TAnimationValue = number> {
3
+ export interface StrategyContext {
4
4
  currentAnimation: {
5
- controller: AnimationController<TAnimationValue>;
5
+ controller: AnimationController;
6
6
  direction: "in" | "out";
7
7
  } | null;
8
8
  }
9
- export interface AnimationSetup<TAnimationValue = number> {
10
- config?: TransitionConfig<TAnimationValue>;
9
+ export interface AnimationSetup {
10
+ config?: TransitionConfig;
11
11
  state: {
12
- position: TAnimationValue;
13
- velocity: TAnimationValue extends number ? number : Record<string, number>;
12
+ position: number;
13
+ velocity: number;
14
14
  };
15
- from: TAnimationValue;
16
- to: TAnimationValue;
15
+ from: number;
16
+ to: number;
17
17
  direction: "forward" | "backward";
18
18
  }
19
- export interface TransitionConfigs<TAnimationValue = number> {
20
- in?: Promise<TransitionConfig<TAnimationValue>>;
21
- out?: Promise<TransitionConfig<TAnimationValue>>;
19
+ export interface TransitionConfigs {
20
+ in?: Promise<TransitionConfig>;
21
+ out?: Promise<TransitionConfig>;
22
22
  }
23
- export interface TransitionStrategy<TAnimationValue = number> {
24
- runIn: (configs: TransitionConfigs<TAnimationValue>) => Promise<AnimationSetup<TAnimationValue>>;
25
- runOut: (configs: TransitionConfigs<TAnimationValue>) => Promise<AnimationSetup<TAnimationValue>>;
23
+ export interface TransitionStrategy {
24
+ runIn: (configs: TransitionConfigs) => Promise<AnimationSetup>;
25
+ runOut: (configs: TransitionConfigs) => Promise<AnimationSetup>;
26
26
  }
27
27
  /**
28
28
  * Creates a transition callback that can be used with framework-specific implementations
@@ -55,10 +55,10 @@ export interface TransitionStrategy<TAnimationValue = number> {
55
55
  * - Inner function (entrance callback): Returns cleanup callback (exit)
56
56
  * - Cleanup callback: Handles exit transitions
57
57
  */
58
- export declare const createDefaultStrategy: <TAnimationValue = number>(context: StrategyContext<TAnimationValue>) => TransitionStrategy<TAnimationValue>;
58
+ export declare const createDefaultStrategy: (context: StrategyContext) => TransitionStrategy;
59
59
  /**
60
60
  * Page transition strategy - Always starts fresh without checking current animations
61
61
  * This is used for page-level transitions where each transition should be independent
62
62
  */
63
- export declare const createPageTransitionStrategy: <TAnimationValue = number>() => TransitionStrategy<TAnimationValue>;
63
+ export declare const createPageTransitionStrategy: () => TransitionStrategy;
64
64
  //# 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,EACV,gBAAgB,EAChB,mBAAmB,EAEpB,MAAM,UAAU,CAAC;AAElB,eAAO,MAAM,mBAAmB,eAAoC,CAAC;AAErE,MAAM,WAAW,eAAe,CAAC,eAAe,GAAG,MAAM;IAGvD,gBAAgB,EAAE;QAChB,UAAU,EAAE,mBAAmB,CAAC,eAAe,CAAC,CAAC;QACjD,SAAS,EAAE,IAAI,GAAG,KAAK,CAAC;KACzB,GAAG,IAAI,CAAC;CACV;AAED,MAAM,WAAW,cAAc,CAAC,eAAe,GAAG,MAAM;IACtD,MAAM,CAAC,EAAE,gBAAgB,CAAC,eAAe,CAAC,CAAC;IAC3C,KAAK,EAAE;QACL,QAAQ,EAAE,eAAe,CAAC;QAC1B,QAAQ,EAAE,eAAe,SAAS,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;KAC5E,CAAC;IACF,IAAI,EAAE,eAAe,CAAC;IACtB,EAAE,EAAE,eAAe,CAAC;IACpB,SAAS,EAAE,SAAS,GAAG,UAAU,CAAC;CACnC;AAED,MAAM,WAAW,iBAAiB,CAAC,eAAe,GAAG,MAAM;IACzD,EAAE,CAAC,EAAE,OAAO,CAAC,gBAAgB,CAAC,eAAe,CAAC,CAAC,CAAC;IAChD,GAAG,CAAC,EAAE,OAAO,CAAC,gBAAgB,CAAC,eAAe,CAAC,CAAC,CAAC;CAClD;AAED,MAAM,WAAW,kBAAkB,CAAC,eAAe,GAAG,MAAM;IAC1D,KAAK,EAAE,CACL,OAAO,EAAE,iBAAiB,CAAC,eAAe,CAAC,KACxC,OAAO,CAAC,cAAc,CAAC,eAAe,CAAC,CAAC,CAAC;IAC9C,MAAM,EAAE,CACN,OAAO,EAAE,iBAAiB,CAAC,eAAe,CAAC,KACxC,OAAO,CAAC,cAAc,CAAC,eAAe,CAAC,CAAC,CAAC;CAC/C;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,eAAO,MAAM,qBAAqB,GAAI,eAAe,GAAG,MAAM,EAC5D,SAAS,eAAe,CAAC,eAAe,CAAC,KACxC,kBAAkB,CAAC,eAAe,CAiMpC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,4BAA4B,GACvC,eAAe,GAAG,MAAM,OACrB,kBAAkB,CAAC,eAAe,CAoGtC,CAAC"}
1
+ {"version":3,"file":"transition-strategy.d.ts","sourceRoot":"","sources":["../../src/lib/transition/transition-strategy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,gBAAgB,EAChB,mBAAmB,EAEpB,MAAM,UAAU,CAAC;AAElB,eAAO,MAAM,mBAAmB,eAAoC,CAAC;AAErE,MAAM,WAAW,eAAe;IAG9B,gBAAgB,EAAE;QAChB,UAAU,EAAE,mBAAmB,CAAC;QAChC,SAAS,EAAE,IAAI,GAAG,KAAK,CAAC;KACzB,GAAG,IAAI,CAAC;CACV;AAED,MAAM,WAAW,cAAc;IAC7B,MAAM,CAAC,EAAE,gBAAgB,CAAC;IAC1B,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,MAAM,WAAW,iBAAiB;IAChC,EAAE,CAAC,EAAE,OAAO,CAAC,gBAAgB,CAAC,CAAC;IAC/B,GAAG,CAAC,EAAE,OAAO,CAAC,gBAAgB,CAAC,CAAC;CACjC;AAED,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,CAAC,OAAO,EAAE,iBAAiB,KAAK,OAAO,CAAC,cAAc,CAAC,CAAC;IAC/D,MAAM,EAAE,CAAC,OAAO,EAAE,iBAAiB,KAAK,OAAO,CAAC,cAAc,CAAC,CAAC;CACjE;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,eAAO,MAAM,qBAAqB,GAChC,SAAS,eAAe,KACvB,kBA8KF,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,4BAA4B,QAAO,kBAwF/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<TAnimationValue = number>(options: TransitionOptions<undefined, TAnimationValue> & {
58
- [TRANSITION_STRATEGY]?: (context: StrategyContext<TAnimationValue>) => TransitionStrategy<TAnimationValue>;
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;AAiE9C,wBAAgB,eAAe,IAAI,aAAa,CAY/C;AAoBD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoDG;AACH,wBAAgB,UAAU,CAAC,eAAe,GAAG,MAAM,EACjD,OAAO,EAAE,iBAAiB,CAAC,SAAS,EAAE,eAAe,CAAC,GAAG;IACvD,CAAC,mBAAmB,CAAC,CAAC,EAAE,CACtB,OAAO,EAAE,eAAe,CAAC,eAAe,CAAC,KACtC,kBAAkB,CAAC,eAAe,CAAC,CAAC;CAC1C,GACA,kBAAkB,CAoBpB"}
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"}
package/dist/types.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function n(i){return"tick"in i&&!("springs"in i)}function r(i){return"springs"in i}exports.isMultiSpring=r;exports.isSingleSpring=n;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function e(i){return("tick"in i||"css"in i)&&!("springs"in i)}function s(i){return"springs"in i}function n(i){return"css"in i&&typeof i.css=="function"}function t(i){return"tick"in i&&typeof i.tick=="function"}function r(i){if(n(i)&&t(i))throw new Error("SingleSpringConfig cannot have both 'tick' and 'css' defined. Use one or the other.")}exports.isCssAnimation=n;exports.isMultiSpring=s;exports.isSingleSpring=e;exports.isTickAnimation=t;exports.validateAnimationMode=r;
package/dist/types.d.ts CHANGED
@@ -1,8 +1,12 @@
1
1
  export type TransitionKey = string | symbol;
2
2
  export type SpringConfig = {
3
- stiffness?: number;
4
- damping?: number;
3
+ stiffness: number;
4
+ damping: number;
5
5
  };
6
+ /**
7
+ * CSS style object type
8
+ */
9
+ export type StyleObject = Record<string, number | string>;
6
10
  /**
7
11
  * Schedule strategy for multi-spring animations
8
12
  * - overlap: All springs start immediately (parallel execution)
@@ -20,21 +24,43 @@ export type BaseTransitionConfig = {
20
24
  onEnd?: () => void;
21
25
  };
22
26
  /**
23
- * Single spring configuration (existing - backward compatible)
27
+ * Single spring configuration
24
28
  * Used for simple transitions with a single animation value
29
+ *
30
+ * Supports two animation modes:
31
+ * - tick: RAF-based animation with callback on each frame
32
+ * - css: Web Animation API with CSS string generation
25
33
  */
26
- export type SingleSpringConfig<TAnimationValue = number> = BaseTransitionConfig & {
34
+ export type SingleSpringConfig = BaseTransitionConfig & {
27
35
  spring?: SpringConfig;
28
- from?: TAnimationValue;
29
- to?: TAnimationValue;
30
- tick?: (progress: TAnimationValue) => void;
36
+ from?: number;
37
+ to?: number;
38
+ tick?: (progress: number) => void;
39
+ /**
40
+ * Style generator for Web Animation API mode
41
+ *
42
+ * When provided, the animation uses Web Animation API instead of RAF.
43
+ * Spring physics are pre-computed and converted to keyframes.
44
+ *
45
+ * @param progress - Current progress value (0 to 1)
46
+ * @returns Style object for Web Animation API
47
+ *
48
+ * @example
49
+ * ```ts
50
+ * css: (progress) => ({
51
+ * opacity: progress,
52
+ * transform: `translateY(${(1 - progress) * 20}px)`,
53
+ * })
54
+ * ```
55
+ */
56
+ css?: (progress: number) => StyleObject;
31
57
  };
32
58
  /**
33
59
  * Individual spring item in a multi-spring animation
34
60
  */
35
- export type SpringItem<TAnimationValue = number> = {
36
- from?: TAnimationValue;
37
- to?: TAnimationValue;
61
+ export type SpringItem = {
62
+ from?: number;
63
+ to?: number;
38
64
  spring?: SpringConfig;
39
65
  /**
40
66
  * Frame callback - called on each animation frame with progress value
@@ -67,7 +93,7 @@ export type SpringItem<TAnimationValue = number> = {
67
93
  * element.style.height = height * progress // WRITE only
68
94
  * }
69
95
  */
70
- tick: (progress: TAnimationValue) => void;
96
+ tick: (progress: number) => void;
71
97
  onStart?: () => void;
72
98
  onComplete?: () => void;
73
99
  /**
@@ -77,11 +103,11 @@ export type SpringItem<TAnimationValue = number> = {
77
103
  offset?: number;
78
104
  };
79
105
  /**
80
- * Multi-spring configuration (new feature)
106
+ * Multi-spring configuration
81
107
  * Used for complex transitions with multiple coordinated animations
82
108
  */
83
- export type MultiSpringConfig<TAnimationValue = number> = BaseTransitionConfig & {
84
- springs: SpringItem<TAnimationValue>[];
109
+ export type MultiSpringConfig = BaseTransitionConfig & {
110
+ springs: SpringItem[];
85
111
  schedule?: ScheduleType;
86
112
  onProgress?: (completed: number, total: number) => void;
87
113
  };
@@ -89,22 +115,39 @@ export type MultiSpringConfig<TAnimationValue = number> = BaseTransitionConfig &
89
115
  * Transition configuration - supports both single and multi-spring animations
90
116
  * Uses Union Type for type safety and backward compatibility
91
117
  */
92
- export type TransitionConfig<TAnimationValue = number> = SingleSpringConfig<TAnimationValue> | MultiSpringConfig<TAnimationValue>;
118
+ export type TransitionConfig = SingleSpringConfig | MultiSpringConfig;
93
119
  /**
94
120
  * Type guard to check if config is single spring
95
121
  */
96
- export declare function isSingleSpring<T>(config: TransitionConfig<T>): config is SingleSpringConfig<T>;
122
+ export declare function isSingleSpring(config: TransitionConfig): config is SingleSpringConfig;
97
123
  /**
98
124
  * Type guard to check if config is multi-spring
99
125
  */
100
- export declare function isMultiSpring<T>(config: TransitionConfig<T>): config is MultiSpringConfig<T>;
101
- export type GetTransitionConfig<TContext = undefined, TAnimationValue = number> = TContext extends undefined ? (node: HTMLElement) => TransitionConfig<TAnimationValue> | Promise<TransitionConfig<TAnimationValue>> : (node: HTMLElement, context: TContext) => TransitionConfig<TAnimationValue> | Promise<TransitionConfig<TAnimationValue>>;
102
- export type Transition<TContext = undefined, TAnimationValue = number> = {
103
- in?: GetTransitionConfig<TContext, TAnimationValue>;
104
- out?: GetTransitionConfig<TContext, TAnimationValue>;
126
+ export declare function isMultiSpring(config: TransitionConfig): config is MultiSpringConfig;
127
+ /**
128
+ * Type guard to check if config uses CSS mode (Web Animation API)
129
+ */
130
+ export declare function isCssAnimation(config: SingleSpringConfig): config is SingleSpringConfig & {
131
+ css: (progress: number) => string;
132
+ };
133
+ /**
134
+ * Type guard to check if config uses tick mode (RAF-based)
135
+ */
136
+ export declare function isTickAnimation(config: SingleSpringConfig): config is SingleSpringConfig & {
137
+ tick: (progress: number) => void;
138
+ };
139
+ /**
140
+ * Validate that config doesn't have both tick and css defined
141
+ * @throws Error if both tick and css are defined
142
+ */
143
+ export declare function validateAnimationMode(config: SingleSpringConfig): void;
144
+ export type GetTransitionConfig<TContext = undefined> = TContext extends undefined ? (node: HTMLElement) => TransitionConfig | Promise<TransitionConfig> : (node: HTMLElement, context: TContext) => TransitionConfig | Promise<TransitionConfig>;
145
+ export type Transition<TContext = undefined> = {
146
+ in?: GetTransitionConfig<TContext>;
147
+ out?: GetTransitionConfig<TContext>;
105
148
  key?: TransitionKey;
106
149
  };
107
- export type TransitionOptions<TContext = undefined, TAnimationValue = number> = Transition<TContext, TAnimationValue> & {
150
+ export type TransitionOptions<TContext = undefined> = Transition<TContext> & {
108
151
  key?: TransitionKey;
109
152
  ref?: object;
110
153
  };
@@ -200,18 +243,17 @@ export type WaitScheduleEntry = {
200
243
  * Different return types for single vs multi-spring animations
201
244
  * @internal
202
245
  */
203
- export type AnimationState<T = number> = SingleAnimationState<T> | MultiAnimationState;
246
+ export type AnimationState = SingleAnimationState | MultiAnimationState;
204
247
  /**
205
248
  * Single spring animation state
206
- * Supports both number and object animations
207
249
  * @internal
208
250
  */
209
- export type SingleAnimationState<T = number> = {
251
+ export type SingleAnimationState = {
210
252
  type: "single";
211
- position: T;
212
- velocity: T extends number ? number : Record<string, number>;
213
- from: T;
214
- to: T;
253
+ position: number;
254
+ velocity: number;
255
+ from: number;
256
+ to: number;
215
257
  };
216
258
  /**
217
259
  * Multi-spring animation state
@@ -229,13 +271,11 @@ export type MultiAnimationState = {
229
271
  * Implemented by both Animator (single spring) and AnimationScheduler (multi-spring)
230
272
  * @internal
231
273
  */
232
- export interface AnimationController<T = number> {
274
+ export interface AnimationController {
233
275
  forward(): void;
234
276
  backward(): void;
235
277
  stop(): void;
236
- reverse(options?: {
237
- offsetMode?: "immediate" | "mirror" | "reverse";
238
- }): void;
239
- getCurrentState(): AnimationState<T>;
278
+ reverse(): void;
279
+ getCurrentState(): AnimationState;
240
280
  }
241
281
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/lib/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,MAAM,CAAC;AAE5C,MAAM,MAAM,YAAY,GAAG;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,MAAM,GAAG,OAAO,CAAC;AAExD;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAAG;IAEjC,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,IAAI,CAAC;IAGzC,IAAI,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAG3B,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IAGrB,KAAK,CAAC,EAAE,MAAM,IAAI,CAAC;CACpB,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,kBAAkB,CAAC,eAAe,GAAG,MAAM,IACrD,oBAAoB,GAAG;IAErB,MAAM,CAAC,EAAE,YAAY,CAAC;IAGtB,IAAI,CAAC,EAAE,eAAe,CAAC;IACvB,EAAE,CAAC,EAAE,eAAe,CAAC;IAGrB,IAAI,CAAC,EAAE,CAAC,QAAQ,EAAE,eAAe,KAAK,IAAI,CAAC;CAC5C,CAAC;AAEJ;;GAEG;AACH,MAAM,MAAM,UAAU,CAAC,eAAe,GAAG,MAAM,IAAI;IACjD,IAAI,CAAC,EAAE,eAAe,CAAC;IACvB,EAAE,CAAC,EAAE,eAAe,CAAC;IACrB,MAAM,CAAC,EAAE,YAAY,CAAC;IAEtB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA8BG;IACH,IAAI,EAAE,CAAC,QAAQ,EAAE,eAAe,KAAK,IAAI,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AAExE;;;GAGG;AACH,MAAM,MAAM,oBAAoB,GAAG;IACjC,IAAI,EAAE,QAAQ,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,mBAAmB,GAAG;IAChC,IAAI,EAAE,OAAO,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,SAAS,GAAG,UAAU,CAAC;CACnC,CAAC;AAEF;;;;GAIG;AACH,MAAM,WAAW,mBAAmB;IAClC,OAAO,IAAI,IAAI,CAAC;IAChB,QAAQ,IAAI,IAAI,CAAC;IACjB,IAAI,IAAI,IAAI,CAAC;IACb,OAAO,IAAI,IAAI,CAAC;IAChB,eAAe,IAAI,cAAc,CAAC;CACnC"}
package/dist/types.js CHANGED
@@ -1,10 +1,25 @@
1
- function n(i) {
2
- return "tick" in i && !("springs" in i);
1
+ function r(n) {
2
+ return ("tick" in n || "css" in n) && !("springs" in n);
3
3
  }
4
- function r(i) {
5
- return "springs" in i;
4
+ function e(n) {
5
+ return "springs" in n;
6
+ }
7
+ function i(n) {
8
+ return "css" in n && typeof n.css == "function";
9
+ }
10
+ function t(n) {
11
+ return "tick" in n && typeof n.tick == "function";
12
+ }
13
+ function s(n) {
14
+ if (i(n) && t(n))
15
+ throw new Error(
16
+ "SingleSpringConfig cannot have both 'tick' and 'css' defined. Use one or the other."
17
+ );
6
18
  }
7
19
  export {
8
- r as isMultiSpring,
9
- n as isSingleSpring
20
+ i as isCssAnimation,
21
+ e as isMultiSpring,
22
+ r as isSingleSpring,
23
+ t as isTickAnimation,
24
+ s as validateAnimationMode
10
25
  };
@@ -1 +1 @@
1
- {"version":3,"file":"drill.d.ts","sourceRoot":"","sources":["../../src/lib/view-transitions/drill.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAa9D,UAAU,YAAY;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IAC7B,MAAM,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC;CAChC;AAED,eAAO,MAAM,KAAK,GAAI,UAAS,YAAiB,KAAG,eAuFlD,CAAC"}
1
+ {"version":3,"file":"drill.d.ts","sourceRoot":"","sources":["../../src/lib/view-transitions/drill.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAe,MAAM,UAAU,CAAC;AAa3E,UAAU,YAAY;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IAC7B,MAAM,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC;CAChC;AAED,eAAO,MAAM,KAAK,GAAI,UAAS,YAAiB,KAAG,eAkHlD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"hero.d.ts","sourceRoot":"","sources":["../../src/lib/view-transitions/hero.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAI9D,UAAU,WAAW;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC;IAC/B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAMD,eAAO,MAAM,IAAI,GAAI,UAAS,WAAgB,KAAG,eA2KhD,CAAC"}
1
+ {"version":3,"file":"hero.d.ts","sourceRoot":"","sources":["../../src/lib/view-transitions/hero.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAI9D,UAAU,WAAW;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC;IAC/B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAMD,eAAO,MAAM,IAAI,GAAI,UAAS,WAAgB,KAAG,eA4KhD,CAAC"}