@ssgoi/core 2.1.2 → 2.3.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.
Files changed (60) hide show
  1. package/README.md +10 -11
  2. package/dist/animator.d.ts.map +1 -1
  3. package/dist/create-ssgoi-transition-context.d.ts.map +1 -1
  4. package/dist/create-transition-callback.d.ts.map +1 -1
  5. package/dist/index.cjs +2 -1
  6. package/dist/index.js +326 -212
  7. package/dist/transition-strategy.d.ts +5 -0
  8. package/dist/transition-strategy.d.ts.map +1 -1
  9. package/dist/transition.d.ts.map +1 -1
  10. package/dist/transitions/blur.d.ts.map +1 -1
  11. package/dist/transitions/bounce.d.ts +1 -1
  12. package/dist/transitions/bounce.d.ts.map +1 -1
  13. package/dist/transitions/fly.d.ts.map +1 -1
  14. package/dist/transitions/index.cjs +1 -1
  15. package/dist/transitions/index.d.ts +1 -0
  16. package/dist/transitions/index.d.ts.map +1 -1
  17. package/dist/transitions/index.js +199 -142
  18. package/dist/transitions/mask.d.ts +31 -0
  19. package/dist/transitions/mask.d.ts.map +1 -0
  20. package/dist/transitions/none.d.ts +4 -4
  21. package/dist/transitions/none.d.ts.map +1 -1
  22. package/dist/transitions/rotate.d.ts +1 -1
  23. package/dist/transitions/scale.d.ts +1 -1
  24. package/dist/transitions/slide.d.ts +2 -2
  25. package/dist/transitions/slide.d.ts.map +1 -1
  26. package/dist/types.d.ts +31 -0
  27. package/dist/types.d.ts.map +1 -1
  28. package/dist/utils/get-positioned-parent.d.ts +7 -0
  29. package/dist/utils/get-positioned-parent.d.ts.map +1 -0
  30. package/dist/utils/get-rect.d.ts +7 -0
  31. package/dist/utils/get-rect.d.ts.map +1 -0
  32. package/dist/utils/get-scrolling-element.d.ts +6 -0
  33. package/dist/utils/get-scrolling-element.d.ts.map +1 -0
  34. package/dist/utils/index.d.ts +7 -0
  35. package/dist/utils/index.d.ts.map +1 -0
  36. package/dist/utils/parse-caller-location.d.ts +6 -0
  37. package/dist/utils/parse-caller-location.d.ts.map +1 -0
  38. package/dist/utils/prepare-outgoing.d.ts +6 -0
  39. package/dist/utils/prepare-outgoing.d.ts.map +1 -0
  40. package/dist/utils/sleep.d.ts +7 -0
  41. package/dist/utils/sleep.d.ts.map +1 -0
  42. package/dist/utils.d.ts.map +1 -1
  43. package/dist/view-transitions/blind.d.ts +13 -0
  44. package/dist/view-transitions/blind.d.ts.map +1 -0
  45. package/dist/view-transitions/fade.d.ts.map +1 -1
  46. package/dist/view-transitions/film.d.ts +8 -0
  47. package/dist/view-transitions/film.d.ts.map +1 -0
  48. package/dist/view-transitions/hero.d.ts.map +1 -1
  49. package/dist/view-transitions/index.cjs +35 -1
  50. package/dist/view-transitions/index.d.ts +3 -0
  51. package/dist/view-transitions/index.d.ts.map +1 -1
  52. package/dist/view-transitions/index.js +448 -202
  53. package/dist/view-transitions/pinterest.d.ts.map +1 -1
  54. package/dist/view-transitions/slide.d.ts +8 -0
  55. package/dist/view-transitions/slide.d.ts.map +1 -0
  56. package/package.json +15 -8
  57. package/dist/utils-8Eptbv7c.cjs +0 -2
  58. package/dist/utils-DTRMUQW4.js +0 -31
  59. package/dist/view-transitions/ripple.d.ts +0 -7
  60. package/dist/view-transitions/ripple.d.ts.map +0 -1
@@ -5,7 +5,7 @@ interface RotateOptions {
5
5
  scale?: boolean;
6
6
  fade?: boolean;
7
7
  origin?: string;
8
- axis?: '2d' | 'x' | 'y' | 'z';
8
+ axis?: "2d" | "x" | "y" | "z";
9
9
  perspective?: number;
10
10
  spring?: {
11
11
  stiffness?: number;
@@ -2,7 +2,7 @@ import { TransitionKey } from '../types';
2
2
  interface ScaleOptions {
3
3
  start?: number;
4
4
  opacity?: number;
5
- axis?: 'x' | 'y' | 'both';
5
+ axis?: "x" | "y" | "both";
6
6
  spring?: {
7
7
  stiffness?: number;
8
8
  damping?: number;
@@ -1,10 +1,10 @@
1
1
  import { TransitionKey } from '../types';
2
2
  interface SlideOptions {
3
- direction?: 'left' | 'right' | 'up' | 'down';
3
+ direction?: "left" | "right" | "up" | "down";
4
4
  distance?: number | string;
5
5
  opacity?: number;
6
6
  fade?: boolean;
7
- axis?: 'x' | 'y';
7
+ axis?: "x" | "y";
8
8
  spring?: {
9
9
  stiffness?: number;
10
10
  damping?: number;
@@ -1 +1 @@
1
- {"version":3,"file":"slide.d.ts","sourceRoot":"","sources":["../../src/lib/transitions/slide.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAE9C,UAAU,YAAY;IACpB,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,IAAI,GAAG,MAAM,CAAC;IAC7C,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC3B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,IAAI,CAAC,EAAE,GAAG,GAAG,GAAG,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,KAAK,GAAI,UAAS,YAAiB;;kBAoD9B,WAAW;;wBA1Db,MAAM;sBACR,MAAM;;yBA2DG,MAAM;;mBAOV,WAAW;;wBAnEd,MAAM;sBACR,MAAM;;yBAoEG,MAAM;;CAS5B,CAAC"}
1
+ {"version":3,"file":"slide.d.ts","sourceRoot":"","sources":["../../src/lib/transitions/slide.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAE9C,UAAU,YAAY;IACpB,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,IAAI,GAAG,MAAM,CAAC;IAC7C,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC3B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,IAAI,CAAC,EAAE,GAAG,GAAG,GAAG,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,KAAK,GAAI,UAAS,YAAiB;;kBAqD9B,WAAW;;wBA3Db,MAAM;sBACR,MAAM;;yBA4DG,MAAM;;mBAUV,WAAW;;wBAvEd,MAAM;sBACR,MAAM;;yBAwEG,MAAM;;CAY5B,CAAC"}
package/dist/types.d.ts CHANGED
@@ -24,11 +24,42 @@ export type TransitionOptions<TContext = undefined, TAnimationValue = number> =
24
24
  ref?: object;
25
25
  };
26
26
  export type TransitionCallback = (element: HTMLElement | null) => void | (() => void);
27
+ /**
28
+ * Context object passed to view transitions
29
+ * Provides essential information for smooth page transitions
30
+ */
27
31
  export type SggoiTransitionContext = {
32
+ /**
33
+ * The scroll position difference between 'from' and 'to' pages
34
+ * Used in hero and pinterest transitions to maintain natural scroll position
35
+ * when transitioning between pages with different scroll states
36
+ */
28
37
  scrollOffset: {
29
38
  x: number;
30
39
  y: number;
31
40
  };
41
+ /**
42
+ * The current page's scroll position
43
+ * Provides the actual scroll coordinates for precise viewport calculations
44
+ * OUT transition receives 'from' page scroll, IN transition receives 'to' page scroll
45
+ */
46
+ scroll: {
47
+ x: number;
48
+ y: number;
49
+ };
50
+ /**
51
+ * The scrollable container element (document.documentElement or custom container)
52
+ * Provides viewport dimensions for calculating transition animations
53
+ * Lazy-evaluated to handle delayed initialization
54
+ */
55
+ scrollingElement: HTMLElement;
56
+ /**
57
+ * The positioned parent element (containing block for absolute positioning)
58
+ * Returns the nearest ancestor with position: relative/absolute/fixed/sticky
59
+ * Falls back to document.body if no positioned ancestor exists
60
+ * Lazy-evaluated to handle delayed initialization
61
+ */
62
+ positionedParent: HTMLElement;
32
63
  };
33
64
  export type SggoiTransition = Transition<SggoiTransitionContext>;
34
65
  export type SsgoiConfig = {
@@ -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;IAEvD,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;IAG3C,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,MAAM,MAAM,mBAAmB,CAC7B,QAAQ,GAAG,SAAS,EACpB,eAAe,GAAG,MAAM,IACtB,QAAQ,SAAS,SAAS,GAC1B,CACE,IAAI,EAAE,WAAW,KAEf,gBAAgB,CAAC,eAAe,CAAC,GACjC,OAAO,CAAC,gBAAgB,CAAC,eAAe,CAAC,CAAC,GAC9C,CACE,IAAI,EAAE,WAAW,EACjB,OAAO,EAAE,QAAQ,KAEf,gBAAgB,CAAC,eAAe,CAAC,GACjC,OAAO,CAAC,gBAAgB,CAAC,eAAe,CAAC,CAAC,CAAC;AAEnD,MAAM,MAAM,UAAU,CAAC,QAAQ,GAAG,SAAS,EAAE,eAAe,GAAG,MAAM,IAAI;IACvE,EAAE,CAAC,EAAE,mBAAmB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MAAM,YAAY,GAAG,CACzB,IAAI,EAAE,MAAM,KACT,UAAU,GAAG;IAAE,GAAG,EAAE,aAAa,CAAA;CAAE,CAAC"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Gets the positioned parent element that serves as the containing block for absolute positioning
3
+ * Returns the nearest ancestor with position: relative, absolute, fixed, or sticky
4
+ * Falls back to document.body if no positioned ancestor is found
5
+ */
6
+ export declare const getPositionedParent: (element: HTMLElement) => HTMLElement;
7
+ //# sourceMappingURL=get-positioned-parent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-positioned-parent.d.ts","sourceRoot":"","sources":["../../src/lib/utils/get-positioned-parent.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,GAAI,SAAS,WAAW,KAAG,WAqB1D,CAAC"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Get the relative position of an element to its root container
3
+ * Returns a DOMRect with position relative to the root element
4
+ * Uses offset properties instead of getBoundingClientRect to avoid transform issues
5
+ */
6
+ export declare function getRect(root: HTMLElement, el: HTMLElement): DOMRect;
7
+ //# sourceMappingURL=get-rect.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-rect.d.ts","sourceRoot":"","sources":["../../src/lib/utils/get-rect.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,WAAW,EAAE,EAAE,EAAE,WAAW,GAAG,OAAO,CAmCnE"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Gets the scrolling element that contains the given element
3
+ * Returns the first scrollable parent element or document.documentElement
4
+ */
5
+ export declare const getScrollingElement: (element: HTMLElement) => HTMLElement;
6
+ //# sourceMappingURL=get-scrolling-element.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-scrolling-element.d.ts","sourceRoot":"","sources":["../../src/lib/utils/get-scrolling-element.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,mBAAmB,GAAI,SAAS,WAAW,KAAG,WAyB1D,CAAC"}
@@ -0,0 +1,7 @@
1
+ export { prepareOutgoing } from './prepare-outgoing';
2
+ export { getScrollingElement } from './get-scrolling-element';
3
+ export { getPositionedParent } from './get-positioned-parent';
4
+ export { parseCallerLocation } from './parse-caller-location';
5
+ export { sleep } from './sleep';
6
+ export { getRect } from './get-rect';
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lib/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC"}
@@ -0,0 +1,6 @@
1
+ export declare const parseCallerLocation: (stack?: string) => {
2
+ file: string;
3
+ line: string;
4
+ column: string;
5
+ } | null;
6
+ //# sourceMappingURL=parse-caller-location.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parse-caller-location.d.ts","sourceRoot":"","sources":["../../src/lib/utils/parse-caller-location.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,mBAAmB,GAC9B,QAAQ,MAAM,KACb;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GAAG,IA+BnD,CAAC"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Applies common styles for outgoing page elements
3
+ * Makes the element absolute positioned to allow the incoming page to take its place
4
+ */
5
+ export declare const prepareOutgoing: (element: HTMLElement) => void;
6
+ //# sourceMappingURL=prepare-outgoing.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prepare-outgoing.d.ts","sourceRoot":"","sources":["../../src/lib/utils/prepare-outgoing.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,eAAe,GAAI,SAAS,WAAW,KAAG,IAKtD,CAAC"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Delays execution for a specified amount of milliseconds
3
+ * @param ms - Milliseconds to wait
4
+ * @returns Promise that resolves after the specified delay
5
+ */
6
+ export declare const sleep: (ms: number) => Promise<void>;
7
+ //# sourceMappingURL=sleep.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sleep.d.ts","sourceRoot":"","sources":["../../src/lib/utils/sleep.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,KAAK,GAAI,IAAI,MAAM,KAAG,OAAO,CAAC,IAAI,CAE9C,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/lib/utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,eAAe,GAAI,SAAS,WAAW,KAAG,IAKtD,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,mBAAmB,GAAI,SAAS,WAAW,KAAG,WAyB1D,CAAC;AAIF,eAAO,MAAM,mBAAmB,GAAI,QAAQ,MAAM,KAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GAAG,IA2BrG,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,KAAK,GAAI,IAAI,MAAM,KAAG,OAAO,CAAC,IAAI,CAE9C,CAAC"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/lib/utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,eAAe,GAAI,SAAS,WAAW,KAAG,IAKtD,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,mBAAmB,GAAI,SAAS,WAAW,KAAG,WAyB1D,CAAC;AAIF,eAAO,MAAM,mBAAmB,GAC9B,QAAQ,MAAM,KACb;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GAAG,IA+BnD,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,KAAK,GAAI,IAAI,MAAM,KAAG,OAAO,CAAC,IAAI,CAE9C,CAAC"}
@@ -0,0 +1,13 @@
1
+ import { SpringConfig, SggoiTransition } from '../types';
2
+ interface BlindOptions {
3
+ inSpring?: SpringConfig;
4
+ outSpring?: SpringConfig;
5
+ transitionDelay?: number;
6
+ blindCount?: number;
7
+ direction?: "horizontal" | "vertical";
8
+ staggerDelay?: number;
9
+ blindColor?: string;
10
+ }
11
+ export declare const blind: (options?: BlindOptions) => SggoiTransition;
12
+ export {};
13
+ //# sourceMappingURL=blind.d.ts.map
@@ -0,0 +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 +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;AAO9D,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,eAmDhD,CAAC"}
@@ -0,0 +1,8 @@
1
+ import { SggoiTransition, SpringConfig } from '../types';
2
+ interface FilmOptions {
3
+ spring?: SpringConfig;
4
+ scale?: number;
5
+ }
6
+ export declare const film: (options?: FilmOptions) => SggoiTransition;
7
+ export {};
8
+ //# sourceMappingURL=film.d.ts.map
@@ -0,0 +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;CAChB;AAwDD,eAAO,MAAM,IAAI,GAAI,UAAU,WAAW,KAAG,eAsG5C,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;AAG9D,UAAU,WAAW;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC;IAC/B,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAkBD,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;CAClB;AAMD,eAAO,MAAM,IAAI,GAAI,UAAS,WAAgB,KAAG,eAgKhD,CAAC"}
@@ -1 +1,35 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const x=require("../utils-8Eptbv7c.cjs"),q=(t={})=>{var a,l;const{opacity:n=!1,direction:s="enter"}=t,e={stiffness:((a=t.spring)==null?void 0:a.stiffness)??150,damping:((l=t.spring)==null?void 0:l.damping)??20};return s==="enter"?{in:r=>({spring:e,tick:i=>{r.style.transform=`translateX(${(1-i)*100}%)`,n&&(r.style.opacity=i.toString())}}),out:r=>({spring:e,prepare:i=>{x.prepareOutgoing(i),i.style.zIndex="-1"},tick:i=>{r.style.transform=`translateX(${-(1-i)*20}%)`,n&&(r.style.opacity=i.toString())}})}:{in:r=>({spring:{stiffness:100,damping:20},tick:i=>{r.style.transform=`translateX(${-(1-i)*20}%)`,n&&(r.style.opacity=i.toString())}}),out:r=>({spring:{stiffness:100,damping:20},prepare:i=>{x.prepareOutgoing(i),i.style.zIndex="100"},tick:i=>{r.style.transform=`translateX(${(1-i)*100}%)`,n&&(r.style.opacity=i.toString())}})}},L={stiffness:400,damping:20},Y={stiffness:40,damping:8},F=100,M=(t={})=>{const{inSpring:n=Y,outSpring:s=L,transitionDelay:e=F}=t;let a,l=null;return{in:r=>({spring:n,prepare:i=>{i.style.opacity="0"},wait:async()=>{a&&(await a,await x.sleep(e))},tick:i=>{r.style.opacity=i.toString()}}),out:r=>(a=new Promise(i=>{l=i}),{spring:s,tick:i=>{r.style.opacity=i.toString()},prepare:x.prepareOutgoing,onEnd:()=>{l&&l()}})}};function X(t,n){return t.querySelector(`[data-hero-key="${n}"]`)}function S(t,n){const s=t.getBoundingClientRect(),e=n.getBoundingClientRect();return new DOMRect(e.left-s.left,e.top-s.top,e.width,e.height)}const z=(t={})=>{var l,r;const n={stiffness:((l=t.spring)==null?void 0:l.stiffness)??300,damping:((r=t.spring)==null?void 0:r.damping)??30},s=t.timeout??300;let e=null,a=null;return{in:async(i,o)=>{const u=i,p=Array.from(u.querySelectorAll("[data-hero-key]"));if(p.length===0)return{spring:n,tick:()=>{}};if(!await new Promise(h=>{e?h(!0):(a=h,setTimeout(()=>{a=null,h(!1)},s))})||!e)return e=null,{spring:n,tick:()=>{}};const g=p.map(h=>{const $=h.getAttribute("data-hero-key");if(!$)return null;const c=X(e,$);if(!c)return null;const y=h,f=S(e,c),w=S(u,y),k=f.left-w.left-o.scrollOffset.x,T=f.top-w.top-o.scrollOffset.y,m=f.width/w.width,O=f.height/w.height,D=y.style.transform,E=y.style.position,B=y.style.transformOrigin,P=y.style.zIndex;return{toEl:y,dx:k,dy:T,dw:m,dh:O,originalTransform:D,originalPosition:E,originalTransformOrigin:B,originalZIndex:P}}).filter(Boolean);return e=null,g.length===0?{spring:n,tick:()=>{}}:{spring:n,prepare:()=>{g.forEach(({toEl:h})=>{h.style.position="relative",h.style.transformOrigin="top left",h.style.zIndex="1000"})},tick:h=>{g.forEach(({toEl:$,dx:c,dy:y,dw:f,dh:w})=>{$.style.transform=`translate(${(1-h)*c}px,${(1-h)*y}px) scale(${h+(1-h)*f}, ${h+(1-h)*w})`})},onEnd:()=>{g.forEach(({toEl:h,originalTransform:$,originalPosition:c,originalTransformOrigin:y,originalZIndex:f})=>{h.style.transform=$,h.style.position=c,h.style.transformOrigin=y,h.style.zIndex=f})}}},out:async i=>({onStart:()=>{e=i,a&&(a(!0),a=null)},prepare:o=>{x.prepareOutgoing(o),o.style.opacity="0"}})}};function A(t,n){const s=t.getBoundingClientRect(),e=n.getBoundingClientRect();return new DOMRect(e.left-s.left,e.top-s.top,e.width,e.height)}function C({detailRect:t,galleryRect:n,pageRect:s,scrollOffset:e},a){const l=n.left-t.left+(n.width-t.width)/2-e.x,r=n.top-t.top+(n.height-t.height)/2-e.y,i=n.width/t.width,o=n.height/t.height,u=Math.max(i,o),p=t.top/s.height*100,d=(s.width-(t.left+t.width))/s.width*100,g=(s.height-(t.top+t.height))/s.height*100,h=t.left/s.width*100;return a.style.transformOrigin=`${t.left+t.width/2}px ${t.top+t.height/2}px`,$=>{const c=1-$,y=p*c,f=d*c,w=g*c,k=h*c;a.style.clipPath=`inset(${y}% ${f}% ${w}% ${k}%)`,a.style.transform=`translate(${l*c}px, ${r*c}px) scale(${1+(u-1)*c})`}}function _({galleryRect:t,detailRect:n,scrollOffset:s},e){const a=n.left-t.left+(n.width-t.width)/2+s.x,l=n.top-t.top+(n.height-t.height)/2+s.y,r=n.width/t.width,i=n.height/t.height,o=Math.max(r,i);return u=>{e.style.transformOrigin=`${t.left+t.width/2}px ${t.top+t.height/2}px`;const p=1-u;e.style.transform=`translate(${a*p-s.x}px, ${l*p-s.y}px) scale(${1+(o-1)*p})`,e.style.opacity=`${1-p}`}}function U({galleryRect:t,detailRect:n,scrollOffset:s},e){const a=n.left-t.left+(n.width-t.width)/2-s.x,l=n.top-t.top+(n.height-t.height)/2-s.y,r=n.width/t.width,i=n.height/t.height,o=Math.max(r,i);return u=>{const p=1-u,d=u;e.style.transformOrigin=`${t.left+t.width/2}px ${t.top+t.height/2}px`,e.style.transform=`translate(${a*p}px, ${l*p}px) scale(${1+(o-1)*p})`,e.style.opacity=`${d}`}}function b({detailRect:t,galleryRect:n,pageRect:s,scrollOffset:e},a){const l=n.left-t.left+(n.width-t.width)/2+e.x,r=n.top-t.top+(n.height-t.height)/2+e.y,i=n.width/t.width,o=n.height/t.height,u=Math.min(i,o),p=t.top/s.height*100,d=(s.width-(t.left+t.width))/s.width*100,g=(s.height-(t.top+t.height))/s.height*100,h=t.left/s.width*100;return a.style.transformOrigin=`${t.left+t.width/2}px ${t.top+t.height/2}px`,$=>{const c=1-$,y=p*c,f=d*c,w=g*c,k=h*c;a.style.clipPath=`inset(${y}% ${f}% ${w}% ${k}%)`,a.style.transform=`translate(${l*c-e.x}px, ${r*c-e.y}px) scale(${1+(u-1)*c})`}}function G(t,n,s){const e=t.querySelector("[data-pinterest-detail-key]"),a=n.querySelector("[data-pinterest-detail-key]");if(t.querySelectorAll("[data-pinterest-detail-key]").length>1||n.querySelectorAll("[data-pinterest-detail-key]").length>1)return null;let l=null,r=null,i=!1;if(!e&&a){r=a;const d=r.getAttribute("data-pinterest-detail-key");if(!d)return null;l=t.querySelector(`[data-pinterest-gallery-key="${d}"]`),l&&(i=!0)}else if(e&&!a){r=e;const d=r.getAttribute("data-pinterest-detail-key");if(!d)return null;l=n.querySelector(`[data-pinterest-gallery-key="${d}"]`),l&&(i=!1)}if(!l||!r)return null;const o=A(i?t:n,l),u=A(i?n:t,r),p=n.getBoundingClientRect();return i?{inAnimation:C({detailRect:u,galleryRect:o,pageRect:p,scrollOffset:s},n),outAnimation:_({galleryRect:o,detailRect:u,scrollOffset:s},t)}:{inAnimation:U({galleryRect:o,detailRect:u,scrollOffset:s},n),outAnimation:b({detailRect:u,galleryRect:o,pageRect:p,scrollOffset:s},t)}}const v=(t={})=>{var r,i;const n={stiffness:((r=t.spring)==null?void 0:r.stiffness)??50,damping:((i=t.spring)==null?void 0:i.damping)??10},s=t.timeout??300;let e=null,a=null,l=null;return{in:async(o,{scrollOffset:u})=>{const p=o;return!await new Promise(g=>{e?g(!0):(a=g,setTimeout(()=>{a=null,g(!1)},s))})||!e?(e=null,{spring:n,tick:()=>{}}):(l=G(e,p,u),l?(e=null,{spring:n,tick:g=>{l&&l.inAnimation(g)}}):{spring:n,tick:()=>{}})},out:async o=>({spring:n,onStart:()=>{e=o,a&&(a(!0),a=null)},prepare:u=>{x.prepareOutgoing(u),u.style.zIndex="-1"},tick:u=>{l&&l.outAnimation(u)}})}},I={stiffness:30,damping:7},j=(t={})=>{var a,l;const n=t.direction??"up",s={stiffness:((a=t.spring)==null?void 0:a.stiffness)??I.stiffness,damping:((l=t.spring)==null?void 0:l.damping)??I.damping},e=n==="up";return{in:r=>({spring:s,tick:i=>{const o=e?(1-i)*100:(1-i)*-100;r.style.transform=`translateY(${o}vh)`}}),out:r=>({spring:s,tick:i=>{const o=e?(1-i)*-100:(1-i)*100;r.style.transform=`translateY(${o}vh)`},prepare:i=>{x.prepareOutgoing(i),i.style.zIndex=e?"-1":"1"}})}};exports.drill=q;exports.fade=M;exports.hero=z;exports.pinterest=v;exports.scroll=j;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const D=t=>{t.style.position="absolute",t.style.width="100%",t.style.top="0",t.style.left="0"},N=t=>new Promise(n=>setTimeout(n,t)),v={stiffness:80,damping:25},C={stiffness:75,damping:25},G=300,q=10,B="horizontal",M="#000000",H=(t={})=>{const{inSpring:n=C,outSpring:e=v,transitionDelay:s=G,blindCount:l=q,direction:a=B,staggerDelay:r=100,blindColor:i=M}=t;let o,h=null;const d=(p,c,f,u=!1)=>{const y=Math.min(.5,r*f/1e3),g=1-y,x=(u?f-1-c:c)/f*y,S=x+g;return p<=x?0:p>=S?1:(p-x)/g},$=(p,c,f="left")=>{window.getComputedStyle(p).position==="static"&&(p.style.position="relative");const y=document.createElement("div");y.className="blind-container",y.style.cssText=`
2
+ position: absolute;
3
+ top: 0;
4
+ left: 0;
5
+ width: 100%;
6
+ height: 100%;
7
+ pointer-events: none;
8
+ z-index: 9999;
9
+ overflow: hidden;
10
+ `;const g=[];for(let w=0;w<l;w++){const x=document.createElement("div");if(a==="horizontal"){const S=100/l,A=`calc(${S}% + 1px)`;x.style.cssText=`
11
+ position: absolute;
12
+ top: ${S*w}%;
13
+ left: 0;
14
+ width: 100%;
15
+ height: ${A};
16
+ background: ${i};
17
+ transform: scaleX(${c==="hidden"?0:1});
18
+ transform-origin: ${f} center;
19
+ will-change: transform;
20
+ `}else{const S=100/l,A=`calc(${S}% + 1px)`;x.style.cssText=`
21
+ position: absolute;
22
+ top: 0;
23
+ left: ${S*w}%;
24
+ width: ${A};
25
+ height: 100%;
26
+ background: ${i};
27
+ transform: scaleY(${c==="hidden"?0:1});
28
+ transform-origin: ${f==="left"?"top":"bottom"} center;
29
+ will-change: transform;
30
+ `}g.push(x),y.appendChild(x)}return p.appendChild(y),{container:y,blinds:g}};return{out:()=>{let p=null;return o=new Promise(c=>{h=c}),{spring:e,prepare:c=>{D(c),c.style.zIndex="1000",p=$(c,"hidden","left")},onStart:()=>{},tick:c=>{if(!p)return;const f=1-c;p.blinds.forEach((u,y)=>{const g=d(f,y,l,!1);a==="horizontal"?u.style.transform=`scaleX(${g})`:u.style.transform=`scaleY(${g})`})},onEnd:()=>{h&&h()}}},in:()=>{let p=null;return{spring:n,prepare:c=>{c.style.position="relative",c.style.zIndex="0",p=$(c,"closed","right")},onStart:()=>{},wait:async()=>{o&&await o,await N(s)},tick:c=>{p&&p.blinds.forEach((f,u)=>{const y=d(c,u,l,!1);a==="horizontal"?f.style.transform=`scaleX(${1-y})`:f.style.transform=`scaleY(${1-y})`})},onEnd:()=>{p&&p.container&&p.container.remove()}}}}},k=t=>{t.style.position="absolute",t.style.width="100%",t.style.top="0",t.style.left="0"},W=(t={})=>{var l,a;const{opacity:n=!1,direction:e="enter"}=t,s={stiffness:((l=t.spring)==null?void 0:l.stiffness)??150,damping:((a=t.spring)==null?void 0:a.damping)??20};return e==="enter"?{in:r=>({spring:s,tick:i=>{r.style.transform=`translateX(${(1-i)*100}%)`,n&&(r.style.opacity=i.toString())}}),out:r=>({spring:s,prepare:i=>{k(i),i.style.zIndex="-1"},tick:i=>{r.style.transform=`translateX(${-(1-i)*20}%)`,n&&(r.style.opacity=i.toString())}})}:{in:r=>({spring:{stiffness:100,damping:20},tick:i=>{r.style.transform=`translateX(${-(1-i)*20}%)`,n&&(r.style.opacity=i.toString())}}),out:r=>({spring:{stiffness:100,damping:20},prepare:i=>{k(i),i.style.zIndex="100"},tick:i=>{r.style.transform=`translateX(${(1-i)*100}%)`,n&&(r.style.opacity=i.toString())}})}},j=t=>new Promise(n=>setTimeout(n,t)),Z={stiffness:400,damping:20},J={stiffness:40,damping:8},K=100,Q=(t={})=>{const{inSpring:n=J,outSpring:e=Z,transitionDelay:s=K}=t;let l,a=null;return{in:r=>({spring:n,prepare:i=>{i.style.opacity="0"},wait:async()=>{l&&(await l,await j(s))},tick:i=>{r.style.opacity=i.toString()}}),out:r=>(l=new Promise(i=>{a=i}),{spring:e,tick:i=>{r.style.opacity=i.toString()},prepare:k,onEnd:()=>{a&&a()}})}};function P(t,n){function e(a){let r=0,i=0;const o=a.offsetWidth,h=a.offsetHeight;let d=a;for(;d;)r+=d.offsetTop,i+=d.offsetLeft,d=d.offsetParent;return r-=window.scrollY,i-=window.scrollX,{top:r,left:i,width:o,height:h}}const s=e(t),l=e(n);return new DOMRect(l.left-s.left,l.top-s.top,l.width,l.height)}const V={stiffness:10,damping:5},m=.2,T=.82;function I(t){const n=P(document.body,t.positionedParent);return{top:t.scroll.y,left:0,width:n.width,height:window.innerHeight-n.top}}function b(t,n){const e=n.left+n.width/2,s=n.top+n.height/2;t.style.transformOrigin=`${e}px ${s}px`}function Y(t,n){t.style.clipPath=`polygon(
31
+ ${n.left}px ${n.top}px,
32
+ ${n.left+n.width}px ${n.top}px,
33
+ ${n.left+n.width}px ${n.top+n.height}px,
34
+ ${n.left}px ${n.top+n.height}px
35
+ )`}function E(t,n,e){return t<=n?0:t>=e?1:(t-n)/(e-n)}const R=t=>{const n=(t==null?void 0:t.spring)??V,e=(t==null?void 0:t.scale)??.9;return{out:async(s,l)=>{const a=I(l);return{spring:n,prepare:()=>{D(s),b(s,a),Y(s,a)},onEnd:()=>{s.style.clipPath="",s.style.transformOrigin=""},tick:r=>{const i=1-r;if(i<m){const o=E(i,0,m),h=1-(1-e)*o;s.style.transform=`scale(${h})`}else if(i<T){const o=E(i,m,T),h=-a.height*o;s.style.transform=`translateY(${h}px) scale(${e})`}else{const o=E(i,T,1),h=e+(1-e)*o;s.style.transform=`translateY(${-a.height}px) scale(${h})`}}}},in:async(s,l)=>{const a=I(l);return{spring:n,prepare:()=>{b(s,a),Y(s,a),s.style.transform=`translateY(${a.height}px) scale(${e})`},onEnd:()=>{s.style.clipPath="",s.style.transformOrigin=""},tick:r=>{if(r<m)s.style.transform=`translateY(${a.height}px) scale(${e})`,s.style.opacity="0";else if(r<T){const i=E(r,m,T),o=a.height*(1-i);s.style.transform=`translateY(${o}px) scale(${e})`,s.style.opacity="1"}else{const i=E(r,T,1),o=e+(1-e)*i;s.style.transform=`scale(${o})`,s.style.opacity="1"}}}}}};function tt(t,n){return t.querySelector(`[data-hero-key="${n}"]`)}const nt=(t={})=>{var a,r;const n={stiffness:((a=t.spring)==null?void 0:a.stiffness)??300,damping:((r=t.spring)==null?void 0:r.damping)??30},e=t.timeout??300;let s=null,l=null;return{in:async(i,o)=>{const h=i,d=Array.from(h.querySelectorAll("[data-hero-key]"));if(d.length===0)return{spring:n,tick:()=>{}};if(!await new Promise(c=>{s?c(!0):(l=c,setTimeout(()=>{l=null,c(!1)},e))})||!s)return s=null,{spring:n,tick:()=>{}};const p=d.map(c=>{const f=c.getAttribute("data-hero-key");if(!f)return null;const u=tt(s,f);if(!u)return null;const y=c,g=P(s,u),w=P(h,y),x=g.left-w.left-o.scrollOffset.x,S=g.top-w.top-o.scrollOffset.y,A=g.width/w.width,F=g.height/w.height,O=y.style.transform,X=y.style.position,U=y.style.transformOrigin,z=y.style.zIndex;return{toEl:y,dx:x,dy:S,dw:A,dh:F,originalTransform:O,originalPosition:X,originalTransformOrigin:U,originalZIndex:z}}).filter(Boolean);return s=null,p.length===0?{spring:n,tick:()=>{}}:{spring:n,prepare:()=>{p.forEach(({toEl:c})=>{c.style.position="relative",c.style.transformOrigin="top left",c.style.zIndex="1000"})},tick:c=>{p.forEach(({toEl:f,dx:u,dy:y,dw:g,dh:w})=>{f.style.transform=`translate(${(1-c)*u}px,${(1-c)*y}px) scale(${c+(1-c)*g}, ${c+(1-c)*w})`})},onEnd:()=>{p.forEach(({toEl:c,originalTransform:f,originalPosition:u,originalTransformOrigin:y,originalZIndex:g})=>{c.style.transform=f,c.style.position=u,c.style.transformOrigin=y,c.style.zIndex=g})}}},out:async i=>({onStart:()=>{s=i,l&&(l(!0),l=null)},prepare:o=>{k(o),o.style.opacity="0"}})}};function it({detailRect:t,galleryRect:n,pageRect:e,scrollOffset:s},l){const a=n.left-t.left+(n.width-t.width)/2-s.x,r=n.top-t.top+(n.height-t.height)/2-s.y,i=n.width/t.width,o=n.height/t.height,h=Math.max(i,o),d=t.top/e.height*100,$=(e.width-(t.left+t.width))/e.width*100,p=(e.height-(t.top+t.height))/e.height*100,c=t.left/e.width*100;return l.style.transformOrigin=`${t.left+t.width/2}px ${t.top+t.height/2}px`,f=>{const u=1-f,y=d*u,g=$*u,w=p*u,x=c*u;l.style.clipPath=`inset(${y}% ${g}% ${w}% ${x}%)`,l.style.transform=`translate(${a*u}px, ${r*u}px) scale(${1+(h-1)*u})`}}function st({galleryRect:t,detailRect:n,scrollOffset:e},s){const l=n.left-t.left+(n.width-t.width)/2+e.x,a=n.top-t.top+(n.height-t.height)/2+e.y,r=n.width/t.width,i=n.height/t.height,o=Math.max(r,i);return h=>{s.style.transformOrigin=`${t.left+t.width/2}px ${t.top+t.height/2}px`;const d=1-h;s.style.transform=`translate(${l*d-e.x}px, ${a*d-e.y}px) scale(${1+(o-1)*d})`,s.style.opacity=`${1-d}`}}function et({galleryRect:t,detailRect:n,scrollOffset:e},s){const l=n.left-t.left+(n.width-t.width)/2-e.x,a=n.top-t.top+(n.height-t.height)/2-e.y,r=n.width/t.width,i=n.height/t.height,o=Math.max(r,i);return h=>{const d=1-h,$=h;s.style.transformOrigin=`${t.left+t.width/2}px ${t.top+t.height/2}px`,s.style.transform=`translate(${l*d}px, ${a*d}px) scale(${1+(o-1)*d})`,s.style.opacity=`${$}`}}function rt({detailRect:t,galleryRect:n,pageRect:e,scrollOffset:s},l){const a=n.left-t.left+(n.width-t.width)/2+s.x,r=n.top-t.top+(n.height-t.height)/2+s.y,i=n.width/t.width,o=n.height/t.height,h=Math.min(i,o),d=t.top/e.height*100,$=(e.width-(t.left+t.width))/e.width*100,p=(e.height-(t.top+t.height))/e.height*100,c=t.left/e.width*100;return l.style.transformOrigin=`${t.left+t.width/2}px ${t.top+t.height/2}px`,f=>{const u=1-f,y=d*u,g=$*u,w=p*u,x=c*u;l.style.clipPath=`inset(${y}% ${g}% ${w}% ${x}%)`,l.style.transform=`translate(${a*u-s.x}px, ${r*u-s.y}px) scale(${1+(h-1)*u})`}}function at(t,n,e){const s=t.querySelector("[data-pinterest-detail-key]"),l=n.querySelector("[data-pinterest-detail-key]");if(t.querySelectorAll("[data-pinterest-detail-key]").length>1||n.querySelectorAll("[data-pinterest-detail-key]").length>1)return null;let a=null,r=null,i=!1;if(!s&&l){r=l;const $=r.getAttribute("data-pinterest-detail-key");if(!$)return null;a=t.querySelector(`[data-pinterest-gallery-key="${$}"]`),a&&(i=!0)}else if(s&&!l){r=s;const $=r.getAttribute("data-pinterest-detail-key");if(!$)return null;a=n.querySelector(`[data-pinterest-gallery-key="${$}"]`),a&&(i=!1)}if(!a||!r)return null;const o=P(i?t:n,a),h=P(i?n:t,r),d=n.getBoundingClientRect();return i?{inAnimation:it({detailRect:h,galleryRect:o,pageRect:d,scrollOffset:e},n),outAnimation:st({galleryRect:o,detailRect:h,scrollOffset:e},t)}:{inAnimation:et({galleryRect:o,detailRect:h,scrollOffset:e},n),outAnimation:rt({detailRect:h,galleryRect:o,pageRect:d,scrollOffset:e},t)}}const lt=(t={})=>{var r,i;const n={stiffness:((r=t.spring)==null?void 0:r.stiffness)??50,damping:((i=t.spring)==null?void 0:i.damping)??10},e=t.timeout??300;let s=null,l=null,a=null;return{in:async(o,{scrollOffset:h})=>{const d=o;return!await new Promise(p=>{s?p(!0):(l=p,setTimeout(()=>{l=null,p(!1)},e))})||!s?(s=null,{spring:n,tick:()=>{}}):(a=at(s,d,h),a?(s=null,{spring:n,tick:p=>{a&&a.inAnimation(p)}}):{spring:n,tick:()=>{}})},out:async o=>({spring:n,onStart:()=>{s=o,l&&(l(!0),l=null)},prepare:h=>{k(h),h.style.zIndex="-1"},tick:h=>{a&&a.outAnimation(h)}})}},_={stiffness:30,damping:7},ot=(t={})=>{var l,a;const n=t.direction??"up",e={stiffness:((l=t.spring)==null?void 0:l.stiffness)??_.stiffness,damping:((a=t.spring)==null?void 0:a.damping)??_.damping},s=n==="up";return{in:r=>({spring:e,tick:i=>{const o=s?(1-i)*100:(1-i)*-100;r.style.transform=`translateY(${o}vh)`}}),out:r=>({spring:e,tick:i=>{const o=s?(1-i)*-100:(1-i)*100;r.style.transform=`translateY(${o}vh)`},prepare:i=>{k(i),i.style.zIndex=s?"-1":"1"}})}},L={stiffness:30,damping:7},ct=(t={})=>{var l,a;const n=t.direction??"left",e={stiffness:((l=t.spring)==null?void 0:l.stiffness)??L.stiffness,damping:((a=t.spring)==null?void 0:a.damping)??L.damping},s=n==="left";return{in:r=>({spring:e,tick:i=>{const o=s?(1-i)*100:(1-i)*-100;r.style.transform=`translateX(${o}%)`}}),out:r=>({spring:e,tick:i=>{const o=s?(1-i)*-100:(1-i)*100;r.style.transform=`translateX(${o}%)`},prepare:i=>{D(i),i.style.zIndex=s?"-1":"1"}})}};exports.blind=H;exports.drill=W;exports.fade=Q;exports.film=R;exports.hero=nt;exports.pinterest=lt;exports.scroll=ot;exports.slide=ct;
@@ -1,6 +1,9 @@
1
+ export * from './blind';
1
2
  export * from './drill';
2
3
  export * from './fade';
4
+ export * from './film';
3
5
  export * from './hero';
4
6
  export * from './pinterest';
5
7
  export * from './scroll';
8
+ export * from './slide';
6
9
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lib/view-transitions/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lib/view-transitions/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC"}