@ssgoi/core 2.4.0 → 2.5.1

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 (42) hide show
  1. package/dist/animate.d.ts +35 -0
  2. package/dist/animate.d.ts.map +1 -0
  3. package/dist/animation-scheduler.d.ts +47 -0
  4. package/dist/animation-scheduler.d.ts.map +1 -0
  5. package/dist/animator.d.ts +3 -8
  6. package/dist/animator.d.ts.map +1 -1
  7. package/dist/create-ssgoi-transition-context.d.ts.map +1 -1
  8. package/dist/create-transition-callback.d.ts.map +1 -1
  9. package/dist/index.cjs +2 -2
  10. package/dist/index.d.ts +1 -0
  11. package/dist/index.d.ts.map +1 -1
  12. package/dist/index.js +787 -306
  13. package/dist/jaemin-BAi8PTrj.js +130 -0
  14. package/dist/jaemin-DL1-g_B5.cjs +1 -0
  15. package/dist/test-utils.d.ts +46 -0
  16. package/dist/test-utils.d.ts.map +1 -0
  17. package/dist/ticker.d.ts +37 -0
  18. package/dist/ticker.d.ts.map +1 -0
  19. package/dist/transition-strategy.d.ts +2 -3
  20. package/dist/transition-strategy.d.ts.map +1 -1
  21. package/dist/types.cjs +1 -1
  22. package/dist/types.d.ts +164 -4
  23. package/dist/types.d.ts.map +1 -1
  24. package/dist/types.js +10 -1
  25. package/dist/view-transitions/blind.d.ts.map +1 -1
  26. package/dist/view-transitions/curtain-reveal.d.ts +19 -0
  27. package/dist/view-transitions/curtain-reveal.d.ts.map +1 -0
  28. package/dist/view-transitions/fade.d.ts.map +1 -1
  29. package/dist/view-transitions/film.d.ts.map +1 -1
  30. package/dist/view-transitions/hero.d.ts +1 -0
  31. package/dist/view-transitions/hero.d.ts.map +1 -1
  32. package/dist/view-transitions/index.cjs +19 -19
  33. package/dist/view-transitions/index.d.ts +3 -1
  34. package/dist/view-transitions/index.d.ts.map +1 -1
  35. package/dist/view-transitions/index.js +620 -547
  36. package/dist/view-transitions/jaemin.d.ts +4 -0
  37. package/dist/view-transitions/jaemin.d.ts.map +1 -1
  38. package/dist/view-transitions/strip.d.ts +3 -0
  39. package/dist/view-transitions/strip.d.ts.map +1 -0
  40. package/package.json +16 -13
  41. package/dist/view-transitions/hero-rotate.d.ts +0 -28
  42. package/dist/view-transitions/hero-rotate.d.ts.map +0 -1
@@ -0,0 +1,130 @@
1
+ function R(i, a) {
2
+ function o(d) {
3
+ let l = 0, y = 0;
4
+ const t = d.offsetWidth, g = d.offsetHeight;
5
+ let s = d;
6
+ for (; s; )
7
+ l += s.offsetTop, y += s.offsetLeft, s = s.offsetParent;
8
+ return l -= window.scrollY, y -= window.scrollX, { top: l, left: y, width: t, height: g };
9
+ }
10
+ const e = o(i), n = o(a);
11
+ return new DOMRect(
12
+ n.left - e.left,
13
+ n.top - e.top,
14
+ n.width,
15
+ n.height
16
+ );
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";
20
+ };
21
+ function M(i, a = "viewport") {
22
+ if (a === "positioned-parent") {
23
+ const o = i.positionedParent.getBoundingClientRect();
24
+ return {
25
+ top: o.top,
26
+ left: o.left,
27
+ width: o.width,
28
+ height: o.height
29
+ };
30
+ } else {
31
+ const o = R(document.body, i.positionedParent);
32
+ return {
33
+ top: i.scroll.y,
34
+ left: 0,
35
+ width: o.width,
36
+ height: window.innerHeight - o.top
37
+ };
38
+ }
39
+ }
40
+ const F = (i = {}) => O(i), O = (i = {}) => {
41
+ var l, y;
42
+ const a = {
43
+ // Much slower animation - 4x duration by reducing stiffness further
44
+ stiffness: ((l = i.spring) == null ? void 0 : l.stiffness) ?? 50,
45
+ damping: ((y = i.spring) == null ? void 0 : y.damping) ?? 30
46
+ }, o = i.initialRotation ?? 45, e = i.initialScale ?? 0.01, n = i.rotationTriggerPoint ?? 0.8, d = i.containerMode ?? "viewport";
47
+ return {
48
+ out: async (t, g) => {
49
+ const s = t.style.opacity;
50
+ return {
51
+ spring: {
52
+ stiffness: 80,
53
+ damping: 25
54
+ },
55
+ from: 1,
56
+ to: 0,
57
+ prepare: () => {
58
+ v(t, g), t.style.opacity = "1";
59
+ },
60
+ tick: (w) => {
61
+ t.style.opacity = String(w);
62
+ },
63
+ onEnd: () => {
64
+ t.style.opacity = s;
65
+ }
66
+ };
67
+ },
68
+ 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
+ return {
71
+ spring: a,
72
+ from: 0,
73
+ to: 1,
74
+ prepare: () => {
75
+ const r = Math.min(s.width, s.height) * 0.4;
76
+ if (t.style.setProperty(
77
+ "--max-border-radius",
78
+ `${r}px`
79
+ ), t.style.setProperty("--border-radius-scale", "1"), t.style.willChange = "transform", t.style.backfaceVisibility = "hidden", d === "positioned-parent")
80
+ 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
+ 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`;
84
+ }
85
+ 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
+ tick: (r) => {
88
+ let p;
89
+ if (r <= 0.05)
90
+ p = e;
91
+ else if (r <= n) {
92
+ const c = (r - 0.05) / (n - 0.05), u = Math.pow(c, 9);
93
+ p = e + (0.8 - e) * u;
94
+ } else {
95
+ const c = (r - n) / (1 - n);
96
+ p = 0.8 + 0.2 * (1 - Math.pow(1 - c, 3));
97
+ }
98
+ let h;
99
+ const f = 0.7;
100
+ if (r <= f)
101
+ h = o;
102
+ else {
103
+ const c = (r - f) / (1 - f), u = 1 - Math.pow(1 - c, 2);
104
+ h = o * (1 - u);
105
+ }
106
+ let P;
107
+ if (r <= f)
108
+ P = 1;
109
+ else {
110
+ const c = (r - f) / (1 - f);
111
+ P = 1 - Math.pow(c, 0.5);
112
+ }
113
+ t.style.transform = `rotate(${h.toFixed(2)}deg) scale(${p.toFixed(4)}) translateZ(0)`, t.style.setProperty(
114
+ "--border-radius-scale",
115
+ P.toFixed(4)
116
+ );
117
+ },
118
+ onEnd: () => {
119
+ 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 = b, t.style.position = x, t.style.zIndex = $, t.style.top = "", t.style.left = "", t.style.width = "", t.style.height = "", t.style.overflow = "", t.style.borderRadius = "";
120
+ }
121
+ };
122
+ }
123
+ };
124
+ };
125
+ export {
126
+ F as a,
127
+ R as g,
128
+ O as j,
129
+ v as p
130
+ };
@@ -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)=>{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"};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 p=s.left+s.width/2,h=s.top+s.height/2;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`}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 p;if(r<=.05)p=e;else if(r<=n){const c=(r-.05)/(n-.05),u=Math.pow(c,9);p=e+(.8-e)*u}else{const c=(r-n)/(1-n);p=.8+.2*(1-Math.pow(1-c,3))}let h;const f=.7;if(r<=f)h=o;else{const c=(r-f)/(1-f),u=1-Math.pow(1-c,2);h=o*(1-u)}let P;if(r<=f)P=1;else{const c=(r-f)/(1-f);P=1-Math.pow(c,.5)}t.style.transform=`rotate(${h.toFixed(2)}deg) scale(${p.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;
@@ -0,0 +1,46 @@
1
+ import { SpringConfig, SpringItem } from './types';
2
+ import { Animator } from './animator';
3
+ /**
4
+ * Mock timer utilities for testing animations
5
+ */
6
+ export declare const mockTimers: {
7
+ setup: () => void;
8
+ cleanup: () => void;
9
+ advance: (ms: number) => void;
10
+ runAll: () => void;
11
+ };
12
+ /**
13
+ * Create a mock spring item for testing
14
+ */
15
+ export declare function createMockSpringItem(overrides?: Partial<SpringItem>): SpringItem;
16
+ /**
17
+ * Create a mock spring config
18
+ */
19
+ export declare function createMockSpringConfig(overrides?: Partial<SpringConfig>): SpringConfig;
20
+ /**
21
+ * Wait for all animators to complete
22
+ * Uses real timers and RAF polling
23
+ */
24
+ export declare function waitForAnimation(timeout?: number): Promise<void>;
25
+ /**
26
+ * Spy on console methods
27
+ */
28
+ export declare const consoleSpy: {
29
+ warn: () => import('vitest').MockInstance<{
30
+ (...data: any[]): void;
31
+ (message?: any, ...optionalParams: any[]): void;
32
+ }>;
33
+ error: () => import('vitest').MockInstance<{
34
+ (...data: any[]): void;
35
+ (message?: any, ...optionalParams: any[]): void;
36
+ }>;
37
+ log: () => import('vitest').MockInstance<{
38
+ (...data: any[]): void;
39
+ (message?: any, ...optionalParams: any[]): void;
40
+ }>;
41
+ };
42
+ /**
43
+ * Mock Animator for testing without real animation
44
+ */
45
+ export declare function createMockAnimator(): Animator;
46
+ //# sourceMappingURL=test-utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"test-utils.d.ts","sourceRoot":"","sources":["../src/lib/test-utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACxD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC;;GAEG;AACH,eAAO,MAAM,UAAU;;;kBAQP,MAAM;;CAMrB,CAAC;AAEF;;GAEG;AACH,wBAAgB,oBAAoB,CAClC,SAAS,GAAE,OAAO,CAAC,UAAU,CAAM,GAClC,UAAU,CAWZ;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CACpC,SAAS,GAAE,OAAO,CAAC,YAAY,CAAM,GACpC,YAAY,CAMd;AAED;;;GAGG;AACH,wBAAsB,gBAAgB,CAAC,OAAO,SAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAcpE;AAED;;GAEG;AACH,eAAO,MAAM,UAAU;;;;;;;;;;;;;CAItB,CAAC;AAEF;;GAEG;AACH,wBAAgB,kBAAkB,IAaF,QAAQ,CACvC"}
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Ticker - Singleton requestAnimationFrame manager
3
+ * Prevents multiple RAF calls by batching all animation updates into a single loop
4
+ * Inspired by GSAP's ticker with mobile optimizations
5
+ */
6
+ type TickerCallback = (deltaTime: number, elapsed: number) => void;
7
+ declare class Ticker {
8
+ private listeners;
9
+ private rafId;
10
+ private isRunning;
11
+ private startTime;
12
+ private lastUpdate;
13
+ private elapsed;
14
+ private lagThreshold;
15
+ private adjustedLag;
16
+ private gap;
17
+ private nextTime;
18
+ private tick;
19
+ subscribe(callback: TickerCallback): () => void;
20
+ unsubscribe(callback: TickerCallback): void;
21
+ /**
22
+ * Configure lag smoothing behavior
23
+ * @param threshold - Time threshold to detect lag (default: 500ms)
24
+ * @param adjustedLag - Max time jump when lag detected (default: 33ms)
25
+ */
26
+ lagSmoothing(threshold: number, adjustedLag: number): void;
27
+ /**
28
+ * Set maximum FPS
29
+ * @param fps - Target FPS (default: 240)
30
+ */
31
+ fps(fps: number): void;
32
+ getListenerCount(): number;
33
+ getElapsed(): number;
34
+ }
35
+ export declare const ticker: Ticker;
36
+ export {};
37
+ //# sourceMappingURL=ticker.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ticker.d.ts","sourceRoot":"","sources":["../src/lib/ticker.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,KAAK,cAAc,GAAG,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;AAEnE,cAAM,MAAM;IACV,OAAO,CAAC,SAAS,CAA6B;IAC9C,OAAO,CAAC,KAAK,CAAuB;IACpC,OAAO,CAAC,SAAS,CAAS;IAG1B,OAAO,CAAC,SAAS,CAAc;IAC/B,OAAO,CAAC,UAAU,CAAkB;IACpC,OAAO,CAAC,OAAO,CAAK;IAGpB,OAAO,CAAC,YAAY,CAAO;IAC3B,OAAO,CAAC,WAAW,CAAM;IAGzB,OAAO,CAAC,GAAG,CAAc;IACzB,OAAO,CAAC,QAAQ,CAAY;IAE5B,OAAO,CAAC,IAAI,CAmCV;IAEF,SAAS,CAAC,QAAQ,EAAE,cAAc,GAAG,MAAM,IAAI;IAe/C,WAAW,CAAC,QAAQ,EAAE,cAAc,GAAG,IAAI;IAW3C;;;;OAIG;IACH,YAAY,CAAC,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,IAAI;IAK1D;;;OAGG;IACH,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;IAKtB,gBAAgB,IAAI,MAAM;IAI1B,UAAU,IAAI,MAAM;CAGrB;AAGD,eAAO,MAAM,MAAM,QAAe,CAAC"}
@@ -1,9 +1,8 @@
1
- import { TransitionConfig } from './types';
2
- import { Animator } from './animator';
1
+ import { TransitionConfig, AnimationController } from './types';
3
2
  export declare const TRANSITION_STRATEGY: unique symbol;
4
3
  export interface StrategyContext<TAnimationValue = number> {
5
4
  currentAnimation: {
6
- animator: Animator<TAnimationValue>;
5
+ controller: AnimationController<TAnimationValue>;
7
6
  direction: "in" | "out";
8
7
  } | null;
9
8
  }
@@ -1 +1 @@
1
- {"version":3,"file":"transition-strategy.d.ts","sourceRoot":"","sources":["../src/lib/transition-strategy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EA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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"}
package/dist/types.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";
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;
package/dist/types.d.ts CHANGED
@@ -3,16 +3,101 @@ export type SpringConfig = {
3
3
  stiffness?: number;
4
4
  damping?: number;
5
5
  };
6
- export type TransitionConfig<TAnimationValue = number> = {
6
+ /**
7
+ * Schedule strategy for multi-spring animations
8
+ * - overlap: All springs start immediately (parallel execution)
9
+ * - wait: Each spring waits for previous to complete (sequential)
10
+ * - chain: Springs start with offset delays
11
+ */
12
+ export type ScheduleType = "overlap" | "wait" | "chain";
13
+ /**
14
+ * Base configuration shared by both single and multi-spring transitions
15
+ */
16
+ export type BaseTransitionConfig = {
17
+ prepare?: (element: HTMLElement) => void;
18
+ wait?: () => Promise<void>;
19
+ onStart?: () => void;
20
+ onEnd?: () => void;
21
+ };
22
+ /**
23
+ * Single spring configuration (existing - backward compatible)
24
+ * Used for simple transitions with a single animation value
25
+ */
26
+ export type SingleSpringConfig<TAnimationValue = number> = BaseTransitionConfig & {
7
27
  spring?: SpringConfig;
8
28
  from?: TAnimationValue;
9
29
  to?: TAnimationValue;
10
30
  tick?: (progress: TAnimationValue) => void;
11
- prepare?: (element: HTMLElement) => void;
12
- wait?: () => Promise<void>;
31
+ };
32
+ /**
33
+ * Individual spring item in a multi-spring animation
34
+ */
35
+ export type SpringItem<TAnimationValue = number> = {
36
+ from?: TAnimationValue;
37
+ to?: TAnimationValue;
38
+ spring?: SpringConfig;
39
+ /**
40
+ * Frame callback - called on each animation frame with progress value
41
+ *
42
+ * **Performance Warning:** Use WRITE-ONLY operations for best performance.
43
+ * Avoid reading layout properties inside tick to prevent layout thrashing.
44
+ *
45
+ * Layout-triggering properties (causes forced synchronous layout):
46
+ * - element.offsetWidth, offsetHeight, offsetTop, offsetLeft
47
+ * - element.clientWidth, clientHeight
48
+ * - element.getBoundingClientRect()
49
+ * - element.scrollWidth, scrollHeight, scrollTop, scrollLeft
50
+ * - window.getComputedStyle(element)
51
+ *
52
+ * @example
53
+ * // ❌ Bad: Layout read in tick (causes thrashing)
54
+ * tick: (progress) => {
55
+ * const height = element.offsetHeight // READ - forces layout!
56
+ * element.style.height = height * progress
57
+ * }
58
+ *
59
+ * @example
60
+ * // ✅ Good: Read in prepare, write in tick
61
+ * prepare: (element) => {
62
+ * const height = element.offsetHeight // READ once before animation
63
+ * element.dataset.height = height.toString()
64
+ * },
65
+ * tick: (progress) => {
66
+ * const height = parseFloat(element.dataset.height)
67
+ * element.style.height = height * progress // WRITE only
68
+ * }
69
+ */
70
+ tick: (progress: TAnimationValue) => void;
13
71
  onStart?: () => void;
14
- onEnd?: () => void;
72
+ onComplete?: () => void;
73
+ /**
74
+ * Delay offset in milliseconds before this spring starts
75
+ * Only applies to 'chain' schedule mode
76
+ */
77
+ offset?: number;
78
+ };
79
+ /**
80
+ * Multi-spring configuration (new feature)
81
+ * Used for complex transitions with multiple coordinated animations
82
+ */
83
+ export type MultiSpringConfig<TAnimationValue = number> = BaseTransitionConfig & {
84
+ springs: SpringItem<TAnimationValue>[];
85
+ schedule?: ScheduleType;
86
+ onProgress?: (completed: number, total: number) => void;
15
87
  };
88
+ /**
89
+ * Transition configuration - supports both single and multi-spring animations
90
+ * Uses Union Type for type safety and backward compatibility
91
+ */
92
+ export type TransitionConfig<TAnimationValue = number> = SingleSpringConfig<TAnimationValue> | MultiSpringConfig<TAnimationValue>;
93
+ /**
94
+ * Type guard to check if config is single spring
95
+ */
96
+ export declare function isSingleSpring<T>(config: TransitionConfig<T>): config is SingleSpringConfig<T>;
97
+ /**
98
+ * Type guard to check if config is multi-spring
99
+ */
100
+ export declare function isMultiSpring<T>(config: TransitionConfig<T>): config is MultiSpringConfig<T>;
16
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>>;
17
102
  export type Transition<TContext = undefined, TAnimationValue = number> = {
18
103
  in?: GetTransitionConfig<TContext, TAnimationValue>;
@@ -74,8 +159,83 @@ export type SsgoiConfig = {
74
159
  from: string;
75
160
  to: string;
76
161
  };
162
+ /**
163
+ * Skip page transitions when iOS/Safari swipe-back gesture is detected
164
+ * This prevents animation conflicts between SSGOI and Safari's native swipe animation
165
+ * @default true
166
+ */
167
+ skipOnIosSwipe?: boolean;
77
168
  };
78
169
  export type SsgoiContext = (path: string) => Transition & {
79
170
  key: TransitionKey;
80
171
  };
172
+ /**
173
+ * Normalized schedule entry for internal processing (discriminated union)
174
+ * Used by AnimationScheduler to unify different schedule strategies
175
+ * @internal
176
+ */
177
+ export type NormalizedScheduleEntry = OffsetScheduleEntry | WaitScheduleEntry;
178
+ /**
179
+ * Offset-based schedule entry (overlap/chain modes)
180
+ * - delay=0: immediate start (overlap)
181
+ * - delay>0: delayed start with fixed timing (chain)
182
+ * @internal
183
+ */
184
+ export type OffsetScheduleEntry = {
185
+ type: "offset";
186
+ id: string;
187
+ delay: number;
188
+ };
189
+ /**
190
+ * Wait-based schedule entry (wait mode)
191
+ * Dynamic dependency - starts after previous spring completes
192
+ * @internal
193
+ */
194
+ export type WaitScheduleEntry = {
195
+ type: "wait";
196
+ id: string;
197
+ };
198
+ /**
199
+ * Animation state (discriminated union)
200
+ * Different return types for single vs multi-spring animations
201
+ * @internal
202
+ */
203
+ export type AnimationState<T = number> = SingleAnimationState<T> | MultiAnimationState;
204
+ /**
205
+ * Single spring animation state
206
+ * Supports both number and object animations
207
+ * @internal
208
+ */
209
+ export type SingleAnimationState<T = number> = {
210
+ type: "single";
211
+ position: T;
212
+ velocity: T extends number ? number : Record<string, number>;
213
+ from: T;
214
+ to: T;
215
+ };
216
+ /**
217
+ * Multi-spring animation state
218
+ * Always uses number for progress tracking
219
+ * @internal
220
+ */
221
+ export type MultiAnimationState = {
222
+ type: "multi";
223
+ completed: number;
224
+ total: number;
225
+ direction: "forward" | "backward";
226
+ };
227
+ /**
228
+ * Common interface for animation controllers
229
+ * Implemented by both Animator (single spring) and AnimationScheduler (multi-spring)
230
+ * @internal
231
+ */
232
+ export interface AnimationController<T = number> {
233
+ forward(): void;
234
+ backward(): void;
235
+ stop(): void;
236
+ reverse(options?: {
237
+ offsetMode?: "immediate" | "mirror" | "reverse";
238
+ }): void;
239
+ getCurrentState(): AnimationState<T>;
240
+ }
81
241
  //# 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,MAAM,MAAM,gBAAgB,CAAC,eAAe,GAAG,MAAM,IAAI;I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CAAC,EAAE;QAAE,UAAU,CAAC,EAAE,WAAW,GAAG,QAAQ,GAAG,SAAS,CAAA;KAAE,GAAG,IAAI,CAAC;IAC7E,eAAe,IAAI,cAAc,CAAC,CAAC,CAAC,CAAC;CACtC"}
package/dist/types.js CHANGED
@@ -1 +1,10 @@
1
-
1
+ function n(i) {
2
+ return "tick" in i && !("springs" in i);
3
+ }
4
+ function r(i) {
5
+ return "springs" in i;
6
+ }
7
+ export {
8
+ r as isMultiSpring,
9
+ n as isSingleSpring
10
+ };
@@ -1 +1 @@
1
- {"version":3,"file":"blind.d.ts","sourceRoot":"","sources":["../../src/lib/view-transitions/blind.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAU9D,UAAU,YAAY;IACpB,QAAQ,CAAC,EAAE,YAAY,CAAC;IACxB,SAAS,CAAC,EAAE,YAAY,CAAC;IACzB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,YAAY,GAAG,UAAU,CAAC;IACtC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,eAAO,MAAM,KAAK,GAAI,UAAS,YAAiB,KAAG,eAmNlD,CAAC"}
1
+ {"version":3,"file":"blind.d.ts","sourceRoot":"","sources":["../../src/lib/view-transitions/blind.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACZ,eAAe,EAEhB,MAAM,UAAU,CAAC;AAWlB,UAAU,YAAY;IACpB,QAAQ,CAAC,EAAE,YAAY,CAAC;IACxB,SAAS,CAAC,EAAE,YAAY,CAAC;IACzB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,YAAY,GAAG,UAAU,CAAC;IACtC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,eAAO,MAAM,KAAK,GAAI,UAAS,YAAiB,KAAG,eA8LlD,CAAC"}
@@ -0,0 +1,19 @@
1
+ import { SggoiTransition, SpringConfig } from '../types';
2
+ type CurtainShape = "circle" | "square" | "triangle";
3
+ interface CurtainRevealOptions {
4
+ /** Background style.
5
+ *
6
+ * Supports both:
7
+ * - Solid colors (e.g., `"#000000"`, `"rgb(255, 0, 0)"`)
8
+ * - CSS gradients (e.g., `"linear-gradient(to right, #000, #fff)"`)
9
+ */
10
+ background?: string;
11
+ texts?: string[];
12
+ shape?: CurtainShape;
13
+ inSpring?: SpringConfig;
14
+ outSpring?: SpringConfig;
15
+ textStyle?: Partial<CSSStyleDeclaration>;
16
+ }
17
+ export declare const curtainReveal: (options?: CurtainRevealOptions) => SggoiTransition;
18
+ export {};
19
+ //# sourceMappingURL=curtain-reveal.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"curtain-reveal.d.ts","sourceRoot":"","sources":["../../src/lib/view-transitions/curtain-reveal.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAiD9D,KAAK,YAAY,GAAG,QAAQ,GAAG,QAAQ,GAAG,UAAU,CAAC;AAErD,UAAU,oBAAoB;IAC5B;;;;;OAKG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,KAAK,CAAC,EAAE,YAAY,CAAC;IACrB,QAAQ,CAAC,EAAE,YAAY,CAAC;IACxB,SAAS,CAAC,EAAE,YAAY,CAAC;IACzB,SAAS,CAAC,EAAE,OAAO,CAAC,mBAAmB,CAAC,CAAC;CAC1C;AAmBD,eAAO,MAAM,aAAa,GACxB,UAAS,oBAAyB,KACjC,eA0HF,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"fade.d.ts","sourceRoot":"","sources":["../../src/lib/view-transitions/fade.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAQ9D,UAAU,WAAW;IACnB,QAAQ,CAAC,EAAE,YAAY,CAAC;IACxB,SAAS,CAAC,EAAE,YAAY,CAAC;IACzB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,eAAO,MAAM,IAAI,GAAI,UAAS,WAAgB,KAAG,eAmDhD,CAAC"}
1
+ {"version":3,"file":"fade.d.ts","sourceRoot":"","sources":["../../src/lib/view-transitions/fade.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAQ9D,UAAU,WAAW;IACnB,QAAQ,CAAC,EAAE,YAAY,CAAC;IACxB,SAAS,CAAC,EAAE,YAAY,CAAC;IACzB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,eAAO,MAAM,IAAI,GAAI,UAAS,WAAgB,KAAG,eAuDhD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"film.d.ts","sourceRoot":"","sources":["../../src/lib/view-transitions/film.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,eAAe,EAEf,YAAY,EACb,MAAM,UAAU,CAAC;AAgBlB,UAAU,WAAW;IACnB,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE;QACP,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,CAAC;CACH;AA4ND,eAAO,MAAM,IAAI,GAAI,UAAU,WAAW,KAAG,eA4I5C,CAAC"}
1
+ {"version":3,"file":"film.d.ts","sourceRoot":"","sources":["../../src/lib/view-transitions/film.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,eAAe,EAEf,YAAY,EACb,MAAM,UAAU,CAAC;AAmClB,UAAU,WAAW;IACnB,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE;QACP,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,CAAC;CACH;AAED,eAAO,MAAM,IAAI,GAAI,UAAU,WAAW,KAAG,eAoJ5C,CAAC"}
@@ -2,6 +2,7 @@ import { SpringConfig, SggoiTransition } from '../types';
2
2
  interface HeroOptions {
3
3
  spring?: Partial<SpringConfig>;
4
4
  timeout?: number;
5
+ maxDistance?: number;
5
6
  }
6
7
  export declare const hero: (options?: HeroOptions) => SggoiTransition;
7
8
  export {};
@@ -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;CAClB;AAMD,eAAO,MAAM,IAAI,GAAI,UAAS,WAAgB,KAAG,eAgKhD,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,eAqKhD,CAAC"}