@ssgoi/core 3.5.0 → 4.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (110) hide show
  1. package/dist/animator/integrator/double-spring-integrator.d.ts +31 -0
  2. package/dist/animator/integrator/double-spring-integrator.d.ts.map +1 -0
  3. package/dist/animator/integrator/index.d.ts +13 -0
  4. package/dist/animator/integrator/index.d.ts.map +1 -0
  5. package/dist/animator/integrator/inertia-integrator.d.ts +34 -0
  6. package/dist/animator/integrator/inertia-integrator.d.ts.map +1 -0
  7. package/dist/animator/integrator/provider.d.ts +22 -0
  8. package/dist/animator/integrator/provider.d.ts.map +1 -0
  9. package/dist/animator/integrator/spring-integrator.d.ts +19 -0
  10. package/dist/animator/integrator/spring-integrator.d.ts.map +1 -0
  11. package/dist/animator/integrator/types.d.ts +34 -0
  12. package/dist/animator/integrator/types.d.ts.map +1 -0
  13. package/dist/animator/multi-animator.d.ts +18 -13
  14. package/dist/animator/multi-animator.d.ts.map +1 -1
  15. package/dist/animator/{animate → runner}/css-runner.d.ts +2 -2
  16. package/dist/animator/runner/css-runner.d.ts.map +1 -0
  17. package/dist/animator/runner/provider.d.ts +35 -0
  18. package/dist/animator/runner/provider.d.ts.map +1 -0
  19. package/dist/animator/{animate → runner}/tick-runner.d.ts +2 -2
  20. package/dist/animator/runner/tick-runner.d.ts.map +1 -0
  21. package/dist/animator/runner/ticker.d.ts.map +1 -0
  22. package/dist/animator/{animate → runner}/types.d.ts +6 -3
  23. package/dist/animator/runner/types.d.ts.map +1 -0
  24. package/dist/animator/{index.d.ts → single-animator.d.ts} +22 -12
  25. package/dist/animator/single-animator.d.ts.map +1 -0
  26. package/dist/animator/{animation.d.ts → types.d.ts} +2 -2
  27. package/dist/animator/types.d.ts.map +1 -0
  28. package/dist/index.cjs +1 -1
  29. package/dist/index.js +552 -569
  30. package/dist/provider-Cs5iBqRD.cjs +1 -0
  31. package/dist/provider-Cu4NSF1Q.js +167 -0
  32. package/dist/transition/create-transition-callback.d.ts.map +1 -1
  33. package/dist/transition/transition-strategy.d.ts +8 -8
  34. package/dist/transition/transition-strategy.d.ts.map +1 -1
  35. package/dist/transitions/blur.d.ts +4 -4
  36. package/dist/transitions/blur.d.ts.map +1 -1
  37. package/dist/transitions/bounce.d.ts +4 -4
  38. package/dist/transitions/bounce.d.ts.map +1 -1
  39. package/dist/transitions/fade.d.ts +4 -4
  40. package/dist/transitions/fade.d.ts.map +1 -1
  41. package/dist/transitions/index.cjs +1 -1
  42. package/dist/transitions/index.d.ts +5 -0
  43. package/dist/transitions/index.d.ts.map +1 -1
  44. package/dist/transitions/index.js +141 -191
  45. package/dist/transitions/rotate.d.ts +4 -4
  46. package/dist/transitions/rotate.d.ts.map +1 -1
  47. package/dist/transitions/scale.d.ts +4 -4
  48. package/dist/transitions/scale.d.ts.map +1 -1
  49. package/dist/transitions/slide.d.ts +4 -4
  50. package/dist/transitions/slide.d.ts.map +1 -1
  51. package/dist/transitions/utils.d.ts +8 -0
  52. package/dist/transitions/utils.d.ts.map +1 -0
  53. package/dist/types.cjs +1 -1
  54. package/dist/types.d.ts +124 -38
  55. package/dist/types.d.ts.map +1 -1
  56. package/dist/types.js +41 -48
  57. package/dist/utils/index.d.ts +1 -0
  58. package/dist/utils/index.d.ts.map +1 -1
  59. package/dist/utils/wait-paint.d.ts +15 -0
  60. package/dist/utils/wait-paint.d.ts.map +1 -0
  61. package/dist/view-transitions/blind.d.ts +2 -3
  62. package/dist/view-transitions/blind.d.ts.map +1 -1
  63. package/dist/view-transitions/curtain-reveal.d.ts +2 -3
  64. package/dist/view-transitions/curtain-reveal.d.ts.map +1 -1
  65. package/dist/view-transitions/depth.d.ts +2 -2
  66. package/dist/view-transitions/depth.d.ts.map +1 -1
  67. package/dist/view-transitions/drill.d.ts +2 -2
  68. package/dist/view-transitions/drill.d.ts.map +1 -1
  69. package/dist/view-transitions/fade.d.ts +2 -3
  70. package/dist/view-transitions/fade.d.ts.map +1 -1
  71. package/dist/view-transitions/film.d.ts +2 -1
  72. package/dist/view-transitions/film.d.ts.map +1 -1
  73. package/dist/view-transitions/hero.d.ts +2 -2
  74. package/dist/view-transitions/hero.d.ts.map +1 -1
  75. package/dist/view-transitions/index.cjs +19 -19
  76. package/dist/view-transitions/index.d.ts +1 -0
  77. package/dist/view-transitions/index.d.ts.map +1 -1
  78. package/dist/view-transitions/index.js +874 -869
  79. package/dist/view-transitions/instagram.d.ts +2 -2
  80. package/dist/view-transitions/instagram.d.ts.map +1 -1
  81. package/dist/view-transitions/jaemin.d.ts +2 -2
  82. package/dist/view-transitions/jaemin.d.ts.map +1 -1
  83. package/dist/view-transitions/pinterest.d.ts +2 -2
  84. package/dist/view-transitions/pinterest.d.ts.map +1 -1
  85. package/dist/view-transitions/rotate.d.ts +5 -2
  86. package/dist/view-transitions/rotate.d.ts.map +1 -1
  87. package/dist/view-transitions/scroll.d.ts +2 -2
  88. package/dist/view-transitions/scroll.d.ts.map +1 -1
  89. package/dist/view-transitions/sheet.d.ts +2 -2
  90. package/dist/view-transitions/sheet.d.ts.map +1 -1
  91. package/dist/view-transitions/slide.d.ts +2 -2
  92. package/dist/view-transitions/slide.d.ts.map +1 -1
  93. package/dist/view-transitions/snap.d.ts +14 -0
  94. package/dist/view-transitions/snap.d.ts.map +1 -0
  95. package/dist/view-transitions/strip.d.ts +6 -2
  96. package/dist/view-transitions/strip.d.ts.map +1 -1
  97. package/dist/view-transitions/swap.d.ts +2 -2
  98. package/dist/view-transitions/swap.d.ts.map +1 -1
  99. package/package.json +1 -1
  100. package/dist/animator/animate/css-runner.d.ts.map +0 -1
  101. package/dist/animator/animate/index.d.ts +0 -42
  102. package/dist/animator/animate/index.d.ts.map +0 -1
  103. package/dist/animator/animate/tick-runner.d.ts.map +0 -1
  104. package/dist/animator/animate/types.d.ts.map +0 -1
  105. package/dist/animator/animation.d.ts.map +0 -1
  106. package/dist/animator/index.d.ts.map +0 -1
  107. package/dist/animator/spring-core.d.ts +0 -82
  108. package/dist/animator/spring-core.d.ts.map +0 -1
  109. package/dist/animator/ticker.d.ts.map +0 -1
  110. /package/dist/animator/{ticker.d.ts → runner/ticker.d.ts} +0 -0
@@ -1,81 +1,66 @@
1
- const S = ($ = {}) => {
2
- const { from: t = 0, to: n = 1, spring: a, key: c } = $, s = {
3
- stiffness: (a == null ? void 0 : a.stiffness) ?? 300,
4
- damping: (a == null ? void 0 : a.damping) ?? 30,
5
- doubleSpring: (a == null ? void 0 : a.doubleSpring) ?? !1
6
- };
1
+ import { D as v, b as T, I as j, a as q } from "../provider-Cu4NSF1Q.js";
2
+ function m(e, t) {
3
+ return e != null && e.spring || e != null && e.inertia || e != null && e.integrator ? e : { spring: t.spring };
4
+ }
5
+ const k = (e = {}) => {
6
+ const { from: t = 0, to: n = 1, key: c } = e, r = m(e.physics, {
7
+ spring: { stiffness: 300, damping: 30 }
8
+ });
7
9
  return {
8
10
  in: () => ({
9
- spring: s,
10
- css: (e) => ({
11
- opacity: t + (n - t) * e
11
+ physics: r,
12
+ css: (s) => ({
13
+ opacity: t + (n - t) * s
12
14
  })
13
15
  }),
14
16
  out: () => ({
15
- spring: s,
16
- css: (e) => ({
17
- opacity: t + (n - t) * e
17
+ physics: r,
18
+ css: (s) => ({
19
+ opacity: t + (n - t) * s
18
20
  })
19
21
  }),
20
22
  ...c && { key: c }
21
23
  };
22
- }, p = ($ = {}) => {
23
- const {
24
- start: t = 0,
25
- opacity: n = 0,
26
- axis: a = "both",
27
- spring: c,
28
- key: s
29
- } = $, e = {
30
- stiffness: (c == null ? void 0 : c.stiffness) ?? 300,
31
- damping: (c == null ? void 0 : c.damping) ?? 30,
32
- doubleSpring: (c == null ? void 0 : c.doubleSpring) ?? !1
33
- }, f = (l) => {
34
- switch (a) {
24
+ }, S = (e = {}) => {
25
+ const { start: t = 0, opacity: n = 0, axis: c = "both", key: r } = e, s = m(e.physics, {
26
+ spring: { stiffness: 300, damping: 30 }
27
+ }), $ = (a) => {
28
+ switch (c) {
35
29
  case "x":
36
- return `scaleX(${l})`;
30
+ return `scaleX(${a})`;
37
31
  case "y":
38
- return `scaleY(${l})`;
32
+ return `scaleY(${a})`;
39
33
  case "both":
40
34
  default:
41
- return `scale(${l})`;
35
+ return `scale(${a})`;
42
36
  }
43
- }, r = (l) => {
44
- const u = t + (1 - t) * l;
37
+ }, u = (a) => {
38
+ const o = t + (1 - t) * a;
45
39
  return {
46
- transform: f(u),
47
- opacity: n + (1 - n) * l
40
+ transform: $(o),
41
+ opacity: n + (1 - n) * a
48
42
  };
49
43
  };
50
44
  return {
51
- in: () => ({
52
- spring: e,
53
- css: r
54
- }),
55
- out: () => ({
56
- spring: e,
57
- css: r
58
- }),
59
- ...s && { key: s }
45
+ in: () => ({ physics: s, css: u }),
46
+ out: () => ({ physics: s, css: u }),
47
+ ...r && { key: r }
60
48
  };
61
- }, k = ($ = {}) => {
49
+ }, w = (e = {}) => {
62
50
  const {
63
51
  direction: t,
64
52
  distance: n = 100,
65
- opacity: a = 0,
66
- fade: c = !0,
53
+ opacity: c = 0,
54
+ fade: r = !0,
67
55
  axis: s,
68
- spring: e,
69
- key: f
70
- } = $, r = {
71
- stiffness: (e == null ? void 0 : e.stiffness) ?? 400,
72
- damping: (e == null ? void 0 : e.damping) ?? 35,
73
- doubleSpring: (e == null ? void 0 : e.doubleSpring) ?? !1
74
- }, u = t || (s === "x" ? "left" : s === "y" ? "up" : "left"), o = (y) => {
75
- const i = 1 - y;
56
+ key: $
57
+ } = e, u = m(e.physics, {
58
+ spring: { stiffness: 400, damping: 35 }
59
+ }), o = t || (s === "x" ? "left" : s === "y" ? "up" : "left"), l = (g) => {
60
+ const i = 1 - g;
76
61
  if (typeof n == "number") {
77
62
  const d = i * n;
78
- switch (u) {
63
+ switch (o) {
79
64
  case "left":
80
65
  return `translate3d(${-d}px, 0, 0)`;
81
66
  case "right":
@@ -86,7 +71,7 @@ const S = ($ = {}) => {
86
71
  return `translate3d(0, ${d}px, 0)`;
87
72
  }
88
73
  } else
89
- switch (u) {
74
+ switch (o) {
90
75
  case "left":
91
76
  return `translate3d(calc(-1 * ${n} * ${i}), 0, 0)`;
92
77
  case "right":
@@ -96,162 +81,123 @@ const S = ($ = {}) => {
96
81
  case "down":
97
82
  return `translate3d(0, calc(${n} * ${i}), 0)`;
98
83
  }
99
- }, m = (y) => {
84
+ }, f = (g) => {
100
85
  const i = {
101
- transform: o(y)
86
+ transform: l(g)
102
87
  };
103
- return c && (i.opacity = a + (1 - a) * y), i;
88
+ return r && (i.opacity = c + (1 - c) * g), i;
104
89
  };
105
90
  return {
106
- in: () => ({
107
- spring: r,
108
- css: m
109
- }),
110
- out: () => ({
111
- spring: r,
112
- css: m
113
- }),
114
- ...f && { key: f }
91
+ in: () => ({ physics: u, css: f }),
92
+ out: () => ({ physics: u, css: f }),
93
+ ...$ && { key: $ }
115
94
  };
116
- }, w = ($ = {}) => {
95
+ }, C = (e = {}) => {
117
96
  const {
118
97
  degrees: t = 360,
119
98
  clockwise: n = !0,
120
- scale: a = !1,
121
- fade: c = !0,
99
+ scale: c = !1,
100
+ fade: r = !0,
122
101
  origin: s = "center",
123
- axis: e = "2d",
124
- perspective: f = 800,
125
- spring: r,
126
- key: l
127
- } = $, u = {
128
- stiffness: (r == null ? void 0 : r.stiffness) ?? 500,
129
- damping: (r == null ? void 0 : r.damping) ?? 25,
130
- doubleSpring: (r == null ? void 0 : r.doubleSpring) ?? !1
131
- }, o = n ? t : -t, m = (i) => {
132
- const d = (1 - i) * o;
133
- switch (e) {
102
+ axis: $ = "2d",
103
+ perspective: u = 800,
104
+ key: a
105
+ } = e, o = m(e.physics, {
106
+ spring: { stiffness: 500, damping: 25 }
107
+ }), l = n ? t : -t, f = (i) => {
108
+ const d = (1 - i) * l;
109
+ switch ($) {
134
110
  case "x":
135
- return `perspective(${f}px) rotateX(${d}deg)`;
111
+ return `perspective(${u}px) rotateX(${d}deg)`;
136
112
  case "y":
137
- return `perspective(${f}px) rotateY(${d}deg)`;
113
+ return `perspective(${u}px) rotateY(${d}deg)`;
138
114
  case "z":
139
115
  return `rotateZ(${d}deg)`;
140
116
  case "2d":
141
117
  default:
142
118
  return `rotate(${d}deg)`;
143
119
  }
144
- }, y = (i) => {
145
- const d = {}, g = [m(i)];
146
- return a && g.push(`scale(${i})`), d.transform = g.join(" "), d.transformOrigin = s, c && (d.opacity = i), d;
120
+ }, g = (i) => {
121
+ const d = {}, y = [f(i)];
122
+ return c && y.push(`scale(${i})`), d.transform = y.join(" "), d.transformOrigin = s, r && (d.opacity = i), d;
147
123
  };
148
124
  return {
149
- in: () => ({
150
- spring: u,
151
- css: y
152
- }),
153
- out: () => ({
154
- spring: u,
155
- css: y
156
- }),
157
- ...l && { key: l }
125
+ in: () => ({ physics: o, css: g }),
126
+ out: () => ({ physics: o, css: g }),
127
+ ...a && { key: a }
158
128
  };
159
- }, C = ($ = {}) => {
129
+ }, I = (e = {}) => {
160
130
  const {
161
131
  height: t = 20,
162
132
  intensity: n = 1,
163
- scale: a = !0,
164
- fade: c = !0,
133
+ scale: c = !0,
134
+ fade: r = !0,
165
135
  direction: s = "up",
166
- spring: e,
167
- key: f
168
- } = $, r = {
169
- stiffness: (e == null ? void 0 : e.stiffness) ?? 800,
170
- damping: (e == null ? void 0 : e.damping) ?? 15,
171
- doubleSpring: (e == null ? void 0 : e.doubleSpring) ?? !1
172
- }, l = (u) => {
173
- const o = {}, m = [], y = Math.sin(u * Math.PI * (1 + n)), i = 1 - u, d = y * t * i;
174
- if (s === "up" ? m.push(`translateY(${-Math.abs(d)}px)`) : m.push(`translateY(${Math.abs(d)}px)`), a) {
175
- const g = 0.8 + u * 0.2 + y * 0.05 * i;
176
- m.push(`scale(${g})`);
136
+ key: $
137
+ } = e, u = m(e.physics, {
138
+ spring: { stiffness: 800, damping: 15 }
139
+ }), a = (o) => {
140
+ const l = {}, f = [], g = Math.sin(o * Math.PI * (1 + n)), i = 1 - o, d = g * t * i;
141
+ if (s === "up" ? f.push(`translateY(${-Math.abs(d)}px)`) : f.push(`translateY(${Math.abs(d)}px)`), c) {
142
+ const y = 0.8 + o * 0.2 + g * 0.05 * i;
143
+ f.push(`scale(${y})`);
177
144
  }
178
- return o.transform = m.join(" "), c && (o.opacity = u), o;
145
+ return l.transform = f.join(" "), r && (l.opacity = o), l;
179
146
  };
180
147
  return {
181
- in: () => ({
182
- spring: r,
183
- css: l
184
- }),
185
- out: () => ({
186
- spring: r,
187
- css: l
188
- }),
189
- ...f && { key: f }
148
+ in: () => ({ physics: u, css: a }),
149
+ out: () => ({ physics: u, css: a }),
150
+ ...$ && { key: $ }
190
151
  };
191
- }, M = ($ = {}) => {
192
- const {
193
- amount: t = 10,
194
- opacity: n = 0,
195
- scale: a = !1,
196
- fade: c = !0,
197
- spring: s,
198
- key: e
199
- } = $, f = {
200
- stiffness: (s == null ? void 0 : s.stiffness) ?? 300,
201
- damping: (s == null ? void 0 : s.damping) ?? 30,
202
- doubleSpring: (s == null ? void 0 : s.doubleSpring) ?? !1
203
- }, r = (l) => {
204
- const u = 1 - l, o = {};
205
- return typeof t == "number" ? o.filter = `blur(${u * t}px)` : o.filter = `blur(calc(${t} * ${u}))`, a && (o.transform = `scale(${0.8 + l * 0.2})`), c && (o.opacity = n + (1 - n) * l), o;
152
+ }, P = (e = {}) => {
153
+ const { amount: t = 10, opacity: n = 0, scale: c = !1, fade: r = !0, key: s } = e, $ = m(e.physics, {
154
+ spring: { stiffness: 300, damping: 30 }
155
+ }), u = (a) => {
156
+ const o = 1 - a, l = {};
157
+ return typeof t == "number" ? l.filter = `blur(${o * t}px)` : l.filter = `blur(calc(${t} * ${o}))`, c && (l.transform = `scale(${0.8 + a * 0.2})`), r && (l.opacity = n + (1 - n) * a), l;
206
158
  };
207
159
  return {
208
- in: () => ({
209
- spring: f,
210
- css: r
211
- }),
212
- out: () => ({
213
- spring: f,
214
- css: r
215
- }),
216
- ...e && { key: e }
160
+ in: () => ({ physics: $, css: u }),
161
+ out: () => ({ physics: $, css: u }),
162
+ ...s && { key: s }
217
163
  };
218
- }, z = ($ = {}) => {
219
- const { x: t = 0, y: n = -100, opacity: a = 0, spring: c, key: s } = $, e = {
220
- stiffness: (c == null ? void 0 : c.stiffness) ?? 400,
221
- damping: (c == null ? void 0 : c.damping) ?? 35,
222
- doubleSpring: (c == null ? void 0 : c.doubleSpring) ?? !1
223
- }, f = (r) => {
224
- const l = 1 - r;
225
- let u, o;
226
- return typeof t == "number" ? u = `${l * t}px` : u = `calc(${t} * ${l})`, typeof n == "number" ? o = `${l * n}px` : o = `calc(${n} * ${l})`, {
227
- transform: `translate3d(${u}, ${o}, 0)`,
228
- opacity: a + (1 - a) * r
164
+ }, D = (e = {}) => {
165
+ const { x: t = 0, y: n = -100, opacity: c = 0, spring: r, key: s } = e, $ = {
166
+ stiffness: (r == null ? void 0 : r.stiffness) ?? 400,
167
+ damping: (r == null ? void 0 : r.damping) ?? 35,
168
+ doubleSpring: (r == null ? void 0 : r.doubleSpring) ?? !1
169
+ }, u = (a) => {
170
+ const o = 1 - a;
171
+ let l, f;
172
+ return typeof t == "number" ? l = `${o * t}px` : l = `calc(${t} * ${o})`, typeof n == "number" ? f = `${o * n}px` : f = `calc(${n} * ${o})`, {
173
+ transform: `translate3d(${l}, ${f}, 0)`,
174
+ opacity: c + (1 - c) * a
229
175
  };
230
176
  };
231
177
  return {
232
178
  in: () => ({
233
- spring: e,
234
- css: f
179
+ spring: $,
180
+ css: u
235
181
  }),
236
182
  out: () => ({
237
- spring: e,
238
- css: f
183
+ spring: $,
184
+ css: u
239
185
  }),
240
186
  ...s && { key: s }
241
187
  };
242
- }, P = ($ = {}) => {
188
+ }, M = (e = {}) => {
243
189
  const {
244
190
  shape: t = "circle",
245
191
  origin: n = "center",
246
- scale: a = 1.5,
247
- fade: c = !1,
192
+ scale: c = 1.5,
193
+ fade: r = !1,
248
194
  spring: s,
249
- key: e
250
- } = $, f = {
195
+ key: $
196
+ } = e, u = {
251
197
  stiffness: (s == null ? void 0 : s.stiffness) ?? 300,
252
198
  damping: (s == null ? void 0 : s.damping) ?? 30,
253
199
  doubleSpring: (s == null ? void 0 : s.doubleSpring) ?? !1
254
- }, r = () => {
200
+ }, a = () => {
255
201
  switch (n) {
256
202
  case "top":
257
203
  return "50% 0%";
@@ -273,62 +219,66 @@ const S = ($ = {}) => {
273
219
  default:
274
220
  return "50% 50%";
275
221
  }
276
- }, l = (o) => {
277
- const m = o * a * 100, y = r();
222
+ }, o = (f) => {
223
+ const g = f * c * 100, i = a();
278
224
  switch (t) {
279
225
  case "ellipse":
280
- return `ellipse(${m}% ${m * 0.75}% at ${y})`;
226
+ return `ellipse(${g}% ${g * 0.75}% at ${i})`;
281
227
  case "square": {
282
- const i = o * a * 100, [d, g] = y.split(" "), h = parseFloat(d), x = parseFloat(g), b = i / 2;
283
- return `polygon(${h - b}% ${x - b}%, ${h + b}% ${x - b}%, ${h + b}% ${x + b}%, ${h - b}% ${x + b}%)`;
228
+ const d = f * c * 100, [y, x] = i.split(" "), b = parseFloat(y), h = parseFloat(x), p = d / 2;
229
+ return `polygon(${b - p}% ${h - p}%, ${b + p}% ${h - p}%, ${b + p}% ${h + p}%, ${b - p}% ${h + p}%)`;
284
230
  }
285
231
  case "circle":
286
232
  default:
287
- return `circle(${m}% at ${y})`;
233
+ return `circle(${g}% at ${i})`;
288
234
  }
289
- }, u = (o) => {
290
- const m = {
291
- clipPath: l(o)
235
+ }, l = (f) => {
236
+ const g = {
237
+ clipPath: o(f)
292
238
  };
293
- return c && (m.opacity = o), m;
239
+ return r && (g.opacity = f), g;
294
240
  };
295
241
  return {
296
242
  in: () => ({
297
- spring: f,
298
- css: u
243
+ spring: u,
244
+ css: l
299
245
  }),
300
246
  out: () => ({
301
- spring: f,
302
- css: u
247
+ spring: u,
248
+ css: l
303
249
  }),
304
- ...e && { key: e }
250
+ ...$ && { key: $ }
305
251
  };
306
- }, V = ($ = {}) => {
307
- const { spring: t, key: n } = $, a = {
252
+ }, z = (e = {}) => {
253
+ const { spring: t, key: n } = e, c = {
308
254
  stiffness: (t == null ? void 0 : t.stiffness) ?? 1e3,
309
255
  damping: (t == null ? void 0 : t.damping) ?? 100,
310
256
  doubleSpring: (t == null ? void 0 : t.doubleSpring) ?? !1
311
257
  };
312
258
  return {
313
259
  in: () => ({
314
- spring: a,
260
+ spring: c,
315
261
  css: () => ({})
316
262
  }),
317
263
  out: () => ({
318
- spring: a,
264
+ spring: c,
319
265
  css: () => ({})
320
266
  }),
321
267
  ...n && { key: n }
322
268
  };
323
269
  };
324
270
  export {
325
- M as blur,
326
- C as bounce,
327
- S as fade,
328
- z as fly,
329
- P as mask,
330
- V as none,
331
- w as rotate,
332
- p as scale,
333
- k as slide
271
+ v as DoubleSpringIntegrator,
272
+ T as InertiaIntegrator,
273
+ j as IntegratorProvider,
274
+ q as SpringIntegrator,
275
+ P as blur,
276
+ I as bounce,
277
+ k as fade,
278
+ D as fly,
279
+ M as mask,
280
+ z as none,
281
+ C as rotate,
282
+ S as scale,
283
+ w as slide
334
284
  };
@@ -1,5 +1,5 @@
1
- import { SpringConfig, Transition, TransitionKey } from '../types';
2
- interface RotateOptions {
1
+ import { PhysicsOptions, Transition, TransitionKey } from '../types';
2
+ type RotateOptions = {
3
3
  degrees?: number;
4
4
  clockwise?: boolean;
5
5
  scale?: boolean;
@@ -7,9 +7,9 @@ interface RotateOptions {
7
7
  origin?: string;
8
8
  axis?: "2d" | "x" | "y" | "z";
9
9
  perspective?: number;
10
- spring?: Partial<SpringConfig>;
10
+ physics?: PhysicsOptions;
11
11
  key?: TransitionKey;
12
- }
12
+ };
13
13
  export declare const rotate: (options?: RotateOptions) => Transition;
14
14
  export {};
15
15
  //# sourceMappingURL=rotate.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"rotate.d.ts","sourceRoot":"","sources":["../../src/lib/transitions/rotate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EAEZ,UAAU,EACV,aAAa,EACd,MAAM,UAAU,CAAC;AAElB,UAAU,aAAa;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,IAAI,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;IAC9B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC;IAC/B,GAAG,CAAC,EAAE,aAAa,CAAC;CACrB;AAED,eAAO,MAAM,MAAM,GAAI,UAAS,aAAkB,KAAG,UAiEpD,CAAC"}
1
+ {"version":3,"file":"rotate.d.ts","sourceRoot":"","sources":["../../src/lib/transitions/rotate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EAEd,UAAU,EACV,aAAa,EACd,MAAM,UAAU,CAAC;AAGlB,KAAK,aAAa,GAAG;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,IAAI,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;IAC9B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,cAAc,CAAC;IACzB,GAAG,CAAC,EAAE,aAAa,CAAC;CACrB,CAAC;AAEF,eAAO,MAAM,MAAM,GAAI,UAAS,aAAkB,KAAG,UAuDpD,CAAC"}
@@ -1,11 +1,11 @@
1
- import { SpringConfig, Transition, TransitionKey } from '../types';
2
- interface ScaleOptions {
1
+ import { PhysicsOptions, Transition, TransitionKey } from '../types';
2
+ type ScaleOptions = {
3
3
  start?: number;
4
4
  opacity?: number;
5
5
  axis?: "x" | "y" | "both";
6
- spring?: Partial<SpringConfig>;
6
+ physics?: PhysicsOptions;
7
7
  key?: TransitionKey;
8
- }
8
+ };
9
9
  export declare const scale: (options?: ScaleOptions) => Transition;
10
10
  export {};
11
11
  //# sourceMappingURL=scale.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"scale.d.ts","sourceRoot":"","sources":["../../src/lib/transitions/scale.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EAEZ,UAAU,EACV,aAAa,EACd,MAAM,UAAU,CAAC;AAElB,UAAU,YAAY;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,GAAG,GAAG,GAAG,GAAG,MAAM,CAAC;IAC1B,MAAM,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC;IAC/B,GAAG,CAAC,EAAE,aAAa,CAAC;CACrB;AAED,eAAO,MAAM,KAAK,GAAI,UAAS,YAAiB,KAAG,UA8ClD,CAAC"}
1
+ {"version":3,"file":"scale.d.ts","sourceRoot":"","sources":["../../src/lib/transitions/scale.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EAEd,UAAU,EACV,aAAa,EACd,MAAM,UAAU,CAAC;AAGlB,KAAK,YAAY,GAAG;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,GAAG,GAAG,GAAG,GAAG,MAAM,CAAC;IAC1B,OAAO,CAAC,EAAE,cAAc,CAAC;IACzB,GAAG,CAAC,EAAE,aAAa,CAAC;CACrB,CAAC;AAEF,eAAO,MAAM,KAAK,GAAI,UAAS,YAAiB,KAAG,UA+BlD,CAAC"}
@@ -1,13 +1,13 @@
1
- import { SpringConfig, Transition, TransitionKey } from '../types';
2
- interface SlideOptions {
1
+ import { PhysicsOptions, Transition, TransitionKey } from '../types';
2
+ type SlideOptions = {
3
3
  direction?: "left" | "right" | "up" | "down";
4
4
  distance?: number | string;
5
5
  opacity?: number;
6
6
  fade?: boolean;
7
7
  axis?: "x" | "y";
8
- spring?: Partial<SpringConfig>;
8
+ physics?: PhysicsOptions;
9
9
  key?: TransitionKey;
10
- }
10
+ };
11
11
  export declare const slide: (options?: SlideOptions) => Transition;
12
12
  export {};
13
13
  //# sourceMappingURL=slide.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"slide.d.ts","sourceRoot":"","sources":["../../src/lib/transitions/slide.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EAEZ,UAAU,EACV,aAAa,EACd,MAAM,UAAU,CAAC;AAElB,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,OAAO,CAAC,YAAY,CAAC,CAAC;IAC/B,GAAG,CAAC,EAAE,aAAa,CAAC;CACrB;AAED,eAAO,MAAM,KAAK,GAAI,UAAS,YAAiB,KAAG,UA6ElD,CAAC"}
1
+ {"version":3,"file":"slide.d.ts","sourceRoot":"","sources":["../../src/lib/transitions/slide.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EAEd,UAAU,EACV,aAAa,EACd,MAAM,UAAU,CAAC;AAGlB,KAAK,YAAY,GAAG;IAClB,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,OAAO,CAAC,EAAE,cAAc,CAAC;IACzB,GAAG,CAAC,EAAE,aAAa,CAAC;CACrB,CAAC;AAEF,eAAO,MAAM,KAAK,GAAI,UAAS,YAAiB,KAAG,UAmElD,CAAC"}
@@ -0,0 +1,8 @@
1
+ import { PhysicsOptions, SpringConfig } from '../types';
2
+ /**
3
+ * Get physics options with fallback to default spring
4
+ */
5
+ export declare function getPhysics(physics: PhysicsOptions | undefined, fallback: {
6
+ spring: SpringConfig;
7
+ }): PhysicsOptions;
8
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/lib/transitions/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAE7D;;GAEG;AACH,wBAAgB,UAAU,CACxB,OAAO,EAAE,cAAc,GAAG,SAAS,EACnC,QAAQ,EAAE;IAAE,MAAM,EAAE,YAAY,CAAA;CAAE,GACjC,cAAc,CAKhB"}
package/dist/types.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function S(n){return("tick"in n||"css"in n)&&!("springs"in n)}function r(n){return"springs"in n}function o(n){return"css"in n&&typeof n.css=="function"}function a(n){return"tick"in n&&typeof n.tick=="function"}function c(n){if(o(n)&&a(n))throw new Error("SingleSpringConfig cannot have both 'tick' and 'css' defined. Use one or the other.")}function l(n){if(n.tick&&n.css)throw new Error("SpringItem cannot have both 'tick' and 'css' defined. Use one or the other.")}async function h(n){const i=await n;return r(i)?(i.springs.forEach(l),i):(c(i),{prepare:i.prepare,wait:i.wait,onStart:i.onStart,onEnd:i.onEnd,springs:[{spring:i.spring,tick:i.tick,css:i.css}],schedule:"parallel"})}function m(n,i){const u=n.schedule??"parallel",p=n.springs.map(s=>{let e;switch(u){case"parallel":e=0;break;case"sequential":e=1;break;case"stagger":e=Math.max(0,Math.min(1,s.offset??0));break;default:e=0}const{css:t,offset:M,...f}=s,g=t?typeof t=="function"?i?{element:i,style:t}:void 0:{element:t.element,style:t.style}:void 0;return{...f,css:g,normalizedOffset:e}}),{schedule:k,...d}=n;return{...d,springs:p}}exports.isCssAnimation=o;exports.isMultiSpring=r;exports.isSingleSpring=S;exports.isTickAnimation=a;exports.normalizeMultiSpringSchedule=m;exports.normalizeToMultiSpring=h;exports.validateAnimationMode=c;exports.validateSpringItem=l;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function m(t){return("tick"in t||"css"in t)&&!("items"in t)}function a(t){return"items"in t}function d(t){return"css"in t&&typeof t.css=="function"}function p(t){return"tick"in t&&typeof t.tick=="function"}async function f(t){const e=await t;return a(e)?{prepare:e.prepare,wait:e.wait,onStart:e.onStart,onEnd:e.onEnd,items:e.items,schedule:e.schedule}:{prepare:e.prepare,wait:e.wait,onStart:e.onStart,onEnd:e.onEnd,items:[{physics:e.physics,tick:e.tick,css:e.css}],schedule:"parallel"}}function h(t,e){const o=t.schedule??"parallel",r=t.items.map(s=>{let i;switch(o){case"parallel":i=0;break;case"sequential":i=1;break;case"stagger":i=Math.max(0,Math.min(1,s.offset??0));break;default:i=0}const{css:n,offset:k,...c}=s,u=n?typeof n=="function"?e?{element:e,style:n}:void 0:{element:n.element,style:n.style}:void 0;return{...c,css:u,normalizedOffset:i}}),{schedule:y,...l}=t;return{...l,items:r}}exports.isCssAnimation=d;exports.isMultiAnimation=a;exports.isSingleAnimation=m;exports.isTickAnimation=p;exports.normalizeSchedule=h;exports.normalizeToMultiAnimation=f;