@ssgoi/core 3.4.0 → 4.0.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 (115) hide show
  1. package/dist/animator/integrator/double-spring-integrator.d.ts +25 -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 +19 -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 +13 -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 +2 -2
  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} +17 -9
  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.d.ts +0 -1
  30. package/dist/index.d.ts.map +1 -1
  31. package/dist/index.js +480 -535
  32. package/dist/provider-B6Xnh0BA.cjs +1 -0
  33. package/dist/provider-CMBovM_W.js +134 -0
  34. package/dist/transition/transition-strategy.d.ts +2 -2
  35. package/dist/transition/transition-strategy.d.ts.map +1 -1
  36. package/dist/transitions/blur.d.ts +4 -7
  37. package/dist/transitions/blur.d.ts.map +1 -1
  38. package/dist/transitions/bounce.d.ts +4 -7
  39. package/dist/transitions/bounce.d.ts.map +1 -1
  40. package/dist/transitions/fade.d.ts +4 -7
  41. package/dist/transitions/fade.d.ts.map +1 -1
  42. package/dist/transitions/fly.d.ts +2 -5
  43. package/dist/transitions/fly.d.ts.map +1 -1
  44. package/dist/transitions/index.cjs +1 -1
  45. package/dist/transitions/index.d.ts +5 -0
  46. package/dist/transitions/index.d.ts.map +1 -1
  47. package/dist/transitions/index.js +153 -194
  48. package/dist/transitions/mask.d.ts +2 -5
  49. package/dist/transitions/mask.d.ts.map +1 -1
  50. package/dist/transitions/none.d.ts +2 -5
  51. package/dist/transitions/none.d.ts.map +1 -1
  52. package/dist/transitions/rotate.d.ts +4 -7
  53. package/dist/transitions/rotate.d.ts.map +1 -1
  54. package/dist/transitions/scale.d.ts +4 -7
  55. package/dist/transitions/scale.d.ts.map +1 -1
  56. package/dist/transitions/slide.d.ts +4 -7
  57. package/dist/transitions/slide.d.ts.map +1 -1
  58. package/dist/transitions/utils.d.ts +8 -0
  59. package/dist/transitions/utils.d.ts.map +1 -0
  60. package/dist/types.cjs +1 -1
  61. package/dist/types.d.ts +59 -3
  62. package/dist/types.d.ts.map +1 -1
  63. package/dist/types.js +6 -6
  64. package/dist/view-transitions/blind.d.ts +2 -3
  65. package/dist/view-transitions/blind.d.ts.map +1 -1
  66. package/dist/view-transitions/curtain-reveal.d.ts +2 -3
  67. package/dist/view-transitions/curtain-reveal.d.ts.map +1 -1
  68. package/dist/view-transitions/depth.d.ts +19 -0
  69. package/dist/view-transitions/depth.d.ts.map +1 -0
  70. package/dist/view-transitions/drill.d.ts +2 -2
  71. package/dist/view-transitions/drill.d.ts.map +1 -1
  72. package/dist/view-transitions/fade.d.ts +2 -3
  73. package/dist/view-transitions/fade.d.ts.map +1 -1
  74. package/dist/view-transitions/film.d.ts +2 -1
  75. package/dist/view-transitions/film.d.ts.map +1 -1
  76. package/dist/view-transitions/hero.d.ts +2 -2
  77. package/dist/view-transitions/hero.d.ts.map +1 -1
  78. package/dist/view-transitions/index.cjs +15 -15
  79. package/dist/view-transitions/index.d.ts +6 -2
  80. package/dist/view-transitions/index.d.ts.map +1 -1
  81. package/dist/view-transitions/index.js +1076 -678
  82. package/dist/view-transitions/instagram.d.ts +2 -2
  83. package/dist/view-transitions/instagram.d.ts.map +1 -1
  84. package/dist/view-transitions/jaemin.d.ts +2 -6
  85. package/dist/view-transitions/jaemin.d.ts.map +1 -1
  86. package/dist/view-transitions/pinterest.d.ts +2 -2
  87. package/dist/view-transitions/pinterest.d.ts.map +1 -1
  88. package/dist/view-transitions/rotate.d.ts +5 -2
  89. package/dist/view-transitions/rotate.d.ts.map +1 -1
  90. package/dist/view-transitions/scroll.d.ts +2 -2
  91. package/dist/view-transitions/scroll.d.ts.map +1 -1
  92. package/dist/view-transitions/sheet.d.ts +19 -0
  93. package/dist/view-transitions/sheet.d.ts.map +1 -0
  94. package/dist/view-transitions/slide.d.ts +2 -2
  95. package/dist/view-transitions/slide.d.ts.map +1 -1
  96. package/dist/view-transitions/snap.d.ts +14 -0
  97. package/dist/view-transitions/snap.d.ts.map +1 -0
  98. package/dist/view-transitions/strip.d.ts +6 -2
  99. package/dist/view-transitions/strip.d.ts.map +1 -1
  100. package/dist/view-transitions/swap.d.ts +13 -0
  101. package/dist/view-transitions/swap.d.ts.map +1 -0
  102. package/package.json +1 -1
  103. package/dist/animator/animate/css-runner.d.ts.map +0 -1
  104. package/dist/animator/animate/index.d.ts +0 -42
  105. package/dist/animator/animate/index.d.ts.map +0 -1
  106. package/dist/animator/animate/tick-runner.d.ts.map +0 -1
  107. package/dist/animator/animate/types.d.ts.map +0 -1
  108. package/dist/animator/animation.d.ts.map +0 -1
  109. package/dist/animator/index.d.ts.map +0 -1
  110. package/dist/animator/spring-core.d.ts +0 -82
  111. package/dist/animator/spring-core.d.ts.map +0 -1
  112. package/dist/animator/ticker.d.ts.map +0 -1
  113. package/dist/jaemin-BG8HRXG1.cjs +0 -1
  114. package/dist/jaemin-BWkrXq0V.js +0 -131
  115. /package/dist/animator/{ticker.d.ts → runner/ticker.d.ts} +0 -0
@@ -1,78 +1,66 @@
1
- const b = ($ = {}) => {
2
- const { from: t = 0, to: c = 1, spring: n, key: a } = $, e = {
3
- stiffness: (n == null ? void 0 : n.stiffness) ?? 300,
4
- damping: (n == null ? void 0 : n.damping) ?? 30
5
- };
1
+ import { D as v, b as T, I as j, a as q } from "../provider-CMBovM_W.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
+ });
6
9
  return {
7
10
  in: () => ({
8
- spring: e,
11
+ physics: r,
9
12
  css: (s) => ({
10
- opacity: t + (c - t) * s
13
+ opacity: t + (n - t) * s
11
14
  })
12
15
  }),
13
16
  out: () => ({
14
- spring: e,
17
+ physics: r,
15
18
  css: (s) => ({
16
- opacity: t + (c - t) * s
19
+ opacity: t + (n - t) * s
17
20
  })
18
21
  }),
19
- ...a && { key: a }
22
+ ...c && { key: c }
20
23
  };
21
- }, k = ($ = {}) => {
22
- const {
23
- start: t = 0,
24
- opacity: c = 0,
25
- axis: n = "both",
26
- spring: a,
27
- key: e
28
- } = $, s = {
29
- stiffness: (a == null ? void 0 : a.stiffness) ?? 300,
30
- damping: (a == null ? void 0 : a.damping) ?? 30
31
- }, u = (r) => {
32
- switch (n) {
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) {
33
29
  case "x":
34
- return `scaleX(${r})`;
30
+ return `scaleX(${a})`;
35
31
  case "y":
36
- return `scaleY(${r})`;
32
+ return `scaleY(${a})`;
37
33
  case "both":
38
34
  default:
39
- return `scale(${r})`;
35
+ return `scale(${a})`;
40
36
  }
41
- }, o = (r) => {
42
- const f = t + (1 - t) * r;
37
+ }, u = (a) => {
38
+ const o = t + (1 - t) * a;
43
39
  return {
44
- transform: u(f),
45
- opacity: c + (1 - c) * r
40
+ transform: $(o),
41
+ opacity: n + (1 - n) * a
46
42
  };
47
43
  };
48
44
  return {
49
- in: () => ({
50
- spring: s,
51
- css: o
52
- }),
53
- out: () => ({
54
- spring: s,
55
- css: o
56
- }),
57
- ...e && { key: e }
45
+ in: () => ({ physics: s, css: u }),
46
+ out: () => ({ physics: s, css: u }),
47
+ ...r && { key: r }
58
48
  };
59
- }, w = ($ = {}) => {
49
+ }, w = (e = {}) => {
60
50
  const {
61
51
  direction: t,
62
- distance: c = 100,
63
- opacity: n = 0,
64
- fade: a = !0,
65
- axis: e,
66
- spring: s,
67
- key: u
68
- } = $, o = {
69
- stiffness: (s == null ? void 0 : s.stiffness) ?? 400,
70
- damping: (s == null ? void 0 : s.damping) ?? 35
71
- }, f = t || (e === "x" ? "left" : e === "y" ? "up" : "left"), i = (y) => {
72
- const l = 1 - y;
73
- if (typeof c == "number") {
74
- const d = l * c;
75
- switch (f) {
52
+ distance: n = 100,
53
+ opacity: c = 0,
54
+ fade: r = !0,
55
+ axis: s,
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;
61
+ if (typeof n == "number") {
62
+ const d = i * n;
63
+ switch (o) {
76
64
  case "left":
77
65
  return `translate3d(${-d}px, 0, 0)`;
78
66
  case "right":
@@ -83,50 +71,42 @@ const b = ($ = {}) => {
83
71
  return `translate3d(0, ${d}px, 0)`;
84
72
  }
85
73
  } else
86
- switch (f) {
74
+ switch (o) {
87
75
  case "left":
88
- return `translate3d(calc(-1 * ${c} * ${l}), 0, 0)`;
76
+ return `translate3d(calc(-1 * ${n} * ${i}), 0, 0)`;
89
77
  case "right":
90
- return `translate3d(calc(${c} * ${l}), 0, 0)`;
78
+ return `translate3d(calc(${n} * ${i}), 0, 0)`;
91
79
  case "up":
92
- return `translate3d(0, calc(-1 * ${c} * ${l}), 0)`;
80
+ return `translate3d(0, calc(-1 * ${n} * ${i}), 0)`;
93
81
  case "down":
94
- return `translate3d(0, calc(${c} * ${l}), 0)`;
82
+ return `translate3d(0, calc(${n} * ${i}), 0)`;
95
83
  }
96
- }, m = (y) => {
97
- const l = {
98
- transform: i(y)
84
+ }, f = (g) => {
85
+ const i = {
86
+ transform: l(g)
99
87
  };
100
- return a && (l.opacity = n + (1 - n) * y), l;
88
+ return r && (i.opacity = c + (1 - c) * g), i;
101
89
  };
102
90
  return {
103
- in: () => ({
104
- spring: o,
105
- css: m
106
- }),
107
- out: () => ({
108
- spring: o,
109
- css: m
110
- }),
111
- ...u && { key: u }
91
+ in: () => ({ physics: u, css: f }),
92
+ out: () => ({ physics: u, css: f }),
93
+ ...$ && { key: $ }
112
94
  };
113
- }, C = ($ = {}) => {
95
+ }, C = (e = {}) => {
114
96
  const {
115
97
  degrees: t = 360,
116
- clockwise: c = !0,
117
- scale: n = !1,
118
- fade: a = !0,
119
- origin: e = "center",
120
- axis: s = "2d",
98
+ clockwise: n = !0,
99
+ scale: c = !1,
100
+ fade: r = !0,
101
+ origin: s = "center",
102
+ axis: $ = "2d",
121
103
  perspective: u = 800,
122
- spring: o,
123
- key: r
124
- } = $, f = {
125
- stiffness: (o == null ? void 0 : o.stiffness) ?? 500,
126
- damping: (o == null ? void 0 : o.damping) ?? 25
127
- }, i = c ? t : -t, m = (l) => {
128
- const d = (1 - l) * i;
129
- switch (s) {
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 ($) {
130
110
  case "x":
131
111
  return `perspective(${u}px) rotateX(${d}deg)`;
132
112
  case "y":
@@ -137,114 +117,88 @@ const b = ($ = {}) => {
137
117
  default:
138
118
  return `rotate(${d}deg)`;
139
119
  }
140
- }, y = (l) => {
141
- const d = {}, g = [m(l)];
142
- return n && g.push(`scale(${l})`), d.transform = g.join(" "), d.transformOrigin = e, a && (d.opacity = l), 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;
143
123
  };
144
124
  return {
145
- in: () => ({
146
- spring: f,
147
- css: y
148
- }),
149
- out: () => ({
150
- spring: f,
151
- css: y
152
- }),
153
- ...r && { key: r }
125
+ in: () => ({ physics: o, css: g }),
126
+ out: () => ({ physics: o, css: g }),
127
+ ...a && { key: a }
154
128
  };
155
- }, M = ($ = {}) => {
129
+ }, I = (e = {}) => {
156
130
  const {
157
131
  height: t = 20,
158
- intensity: c = 1,
159
- scale: n = !0,
160
- fade: a = !0,
161
- direction: e = "up",
162
- spring: s,
163
- key: u
164
- } = $, o = {
165
- stiffness: (s == null ? void 0 : s.stiffness) ?? 800,
166
- damping: (s == null ? void 0 : s.damping) ?? 15
167
- }, r = (f) => {
168
- const i = {}, m = [], y = Math.sin(f * Math.PI * (1 + c)), l = 1 - f, d = y * t * l;
169
- if (e === "up" ? m.push(`translateY(${-Math.abs(d)}px)`) : m.push(`translateY(${Math.abs(d)}px)`), n) {
170
- const g = 0.8 + f * 0.2 + y * 0.05 * l;
171
- m.push(`scale(${g})`);
132
+ intensity: n = 1,
133
+ scale: c = !0,
134
+ fade: r = !0,
135
+ direction: s = "up",
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})`);
172
144
  }
173
- return i.transform = m.join(" "), a && (i.opacity = f), i;
145
+ return l.transform = f.join(" "), r && (l.opacity = o), l;
174
146
  };
175
147
  return {
176
- in: () => ({
177
- spring: o,
178
- css: r
179
- }),
180
- out: () => ({
181
- spring: o,
182
- css: r
183
- }),
184
- ...u && { key: u }
148
+ in: () => ({ physics: u, css: a }),
149
+ out: () => ({ physics: u, css: a }),
150
+ ...$ && { key: $ }
185
151
  };
186
- }, z = ($ = {}) => {
187
- const {
188
- amount: t = 10,
189
- opacity: c = 0,
190
- scale: n = !1,
191
- fade: a = !0,
192
- spring: e,
193
- key: s
194
- } = $, u = {
195
- stiffness: (e == null ? void 0 : e.stiffness) ?? 300,
196
- damping: (e == null ? void 0 : e.damping) ?? 30
197
- }, o = (r) => {
198
- const f = 1 - r, i = {};
199
- return typeof t == "number" ? i.filter = `blur(${f * t}px)` : i.filter = `blur(calc(${t} * ${f}))`, n && (i.transform = `scale(${0.8 + r * 0.2})`), a && (i.opacity = c + (1 - c) * r), i;
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;
200
158
  };
201
159
  return {
202
- in: () => ({
203
- spring: u,
204
- css: o
205
- }),
206
- out: () => ({
207
- spring: u,
208
- css: o
209
- }),
160
+ in: () => ({ physics: $, css: u }),
161
+ out: () => ({ physics: $, css: u }),
210
162
  ...s && { key: s }
211
163
  };
212
- }, P = ($ = {}) => {
213
- const { x: t = 0, y: c = -100, opacity: n = 0, spring: a, key: e } = $, s = {
214
- stiffness: (a == null ? void 0 : a.stiffness) ?? 400,
215
- damping: (a == null ? void 0 : a.damping) ?? 35
216
- }, u = (o) => {
217
- const r = 1 - o;
218
- let f, i;
219
- return typeof t == "number" ? f = `${r * t}px` : f = `calc(${t} * ${r})`, typeof c == "number" ? i = `${r * c}px` : i = `calc(${c} * ${r})`, {
220
- transform: `translate3d(${f}, ${i}, 0)`,
221
- opacity: n + (1 - n) * o
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
222
175
  };
223
176
  };
224
177
  return {
225
178
  in: () => ({
226
- spring: s,
179
+ spring: $,
227
180
  css: u
228
181
  }),
229
182
  out: () => ({
230
- spring: s,
183
+ spring: $,
231
184
  css: u
232
185
  }),
233
- ...e && { key: e }
186
+ ...s && { key: s }
234
187
  };
235
- }, V = ($ = {}) => {
188
+ }, M = (e = {}) => {
236
189
  const {
237
190
  shape: t = "circle",
238
- origin: c = "center",
239
- scale: n = 1.5,
240
- fade: a = !1,
241
- spring: e,
242
- key: s
243
- } = $, u = {
244
- stiffness: (e == null ? void 0 : e.stiffness) ?? 300,
245
- damping: (e == null ? void 0 : e.damping) ?? 30
246
- }, o = () => {
247
- switch (c) {
191
+ origin: n = "center",
192
+ scale: c = 1.5,
193
+ fade: r = !1,
194
+ spring: s,
195
+ key: $
196
+ } = e, u = {
197
+ stiffness: (s == null ? void 0 : s.stiffness) ?? 300,
198
+ damping: (s == null ? void 0 : s.damping) ?? 30,
199
+ doubleSpring: (s == null ? void 0 : s.doubleSpring) ?? !1
200
+ }, a = () => {
201
+ switch (n) {
248
202
  case "top":
249
203
  return "50% 0%";
250
204
  case "bottom":
@@ -265,61 +219,66 @@ const b = ($ = {}) => {
265
219
  default:
266
220
  return "50% 50%";
267
221
  }
268
- }, r = (i) => {
269
- const m = i * n * 100, y = o();
222
+ }, o = (f) => {
223
+ const g = f * c * 100, i = a();
270
224
  switch (t) {
271
225
  case "ellipse":
272
- return `ellipse(${m}% ${m * 0.75}% at ${y})`;
226
+ return `ellipse(${g}% ${g * 0.75}% at ${i})`;
273
227
  case "square": {
274
- const l = i * n * 100, [d, g] = y.split(" "), h = parseFloat(d), x = parseFloat(g), p = l / 2;
275
- return `polygon(${h - p}% ${x - p}%, ${h + p}% ${x - p}%, ${h + p}% ${x + p}%, ${h - p}% ${x + p}%)`;
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}%)`;
276
230
  }
277
231
  case "circle":
278
232
  default:
279
- return `circle(${m}% at ${y})`;
233
+ return `circle(${g}% at ${i})`;
280
234
  }
281
- }, f = (i) => {
282
- const m = {
283
- clipPath: r(i)
235
+ }, l = (f) => {
236
+ const g = {
237
+ clipPath: o(f)
284
238
  };
285
- return a && (m.opacity = i), m;
239
+ return r && (g.opacity = f), g;
286
240
  };
287
241
  return {
288
242
  in: () => ({
289
243
  spring: u,
290
- css: f
244
+ css: l
291
245
  }),
292
246
  out: () => ({
293
247
  spring: u,
294
- css: f
248
+ css: l
295
249
  }),
296
- ...s && { key: s }
250
+ ...$ && { key: $ }
297
251
  };
298
- }, Y = ($ = {}) => {
299
- const { spring: t, key: c } = $, n = {
252
+ }, z = (e = {}) => {
253
+ const { spring: t, key: n } = e, c = {
300
254
  stiffness: (t == null ? void 0 : t.stiffness) ?? 1e3,
301
- damping: (t == null ? void 0 : t.damping) ?? 100
255
+ damping: (t == null ? void 0 : t.damping) ?? 100,
256
+ doubleSpring: (t == null ? void 0 : t.doubleSpring) ?? !1
302
257
  };
303
258
  return {
304
259
  in: () => ({
305
- spring: n,
260
+ spring: c,
306
261
  css: () => ({})
307
262
  }),
308
263
  out: () => ({
309
- spring: n,
264
+ spring: c,
310
265
  css: () => ({})
311
266
  }),
312
- ...c && { key: c }
267
+ ...n && { key: n }
313
268
  };
314
269
  };
315
270
  export {
316
- z as blur,
317
- M as bounce,
318
- b as fade,
319
- P as fly,
320
- V as mask,
321
- Y as none,
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,
322
281
  C as rotate,
323
- k as scale,
282
+ S as scale,
324
283
  w as slide
325
284
  };
@@ -1,13 +1,10 @@
1
- import { Transition, TransitionKey } from '../types';
1
+ import { SpringConfig, Transition, TransitionKey } from '../types';
2
2
  interface MaskOptions {
3
3
  shape?: "circle" | "ellipse" | "square";
4
4
  origin?: "center" | "top" | "bottom" | "left" | "right" | "top-left" | "top-right" | "bottom-left" | "bottom-right";
5
5
  scale?: number;
6
6
  fade?: boolean;
7
- spring?: {
8
- stiffness?: number;
9
- damping?: number;
10
- };
7
+ spring?: Partial<SpringConfig>;
11
8
  key?: TransitionKey;
12
9
  }
13
10
  export declare const mask: (options?: MaskOptions) => Transition;
@@ -1 +1 @@
1
- {"version":3,"file":"mask.d.ts","sourceRoot":"","sources":["../../src/lib/transitions/mask.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAe,UAAU,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEvE,UAAU,WAAW;IACnB,KAAK,CAAC,EAAE,QAAQ,GAAG,SAAS,GAAG,QAAQ,CAAC;IACxC,MAAM,CAAC,EACH,QAAQ,GACR,KAAK,GACL,QAAQ,GACR,MAAM,GACN,OAAO,GACP,UAAU,GACV,WAAW,GACX,aAAa,GACb,cAAc,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,MAAM,CAAC,EAAE;QACP,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,CAAC;IACF,GAAG,CAAC,EAAE,aAAa,CAAC;CACrB;AAED,eAAO,MAAM,IAAI,GAAI,UAAS,WAAgB,KAAG,UAuFhD,CAAC"}
1
+ {"version":3,"file":"mask.d.ts","sourceRoot":"","sources":["../../src/lib/transitions/mask.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EAEZ,UAAU,EACV,aAAa,EACd,MAAM,UAAU,CAAC;AAElB,UAAU,WAAW;IACnB,KAAK,CAAC,EAAE,QAAQ,GAAG,SAAS,GAAG,QAAQ,CAAC;IACxC,MAAM,CAAC,EACH,QAAQ,GACR,KAAK,GACL,QAAQ,GACR,MAAM,GACN,OAAO,GACP,UAAU,GACV,WAAW,GACX,aAAa,GACb,cAAc,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,MAAM,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC;IAC/B,GAAG,CAAC,EAAE,aAAa,CAAC;CACrB;AAED,eAAO,MAAM,IAAI,GAAI,UAAS,WAAgB,KAAG,UAwFhD,CAAC"}
@@ -1,9 +1,6 @@
1
- import { Transition, TransitionKey } from '../types';
1
+ import { SpringConfig, Transition, TransitionKey } from '../types';
2
2
  interface NoneOptions {
3
- spring?: {
4
- stiffness?: number;
5
- damping?: number;
6
- };
3
+ spring?: Partial<SpringConfig>;
7
4
  key?: TransitionKey;
8
5
  }
9
6
  export declare const none: (options?: NoneOptions) => Transition;
@@ -1 +1 @@
1
- {"version":3,"file":"none.d.ts","sourceRoot":"","sources":["../../src/lib/transitions/none.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAe,UAAU,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEvE,UAAU,WAAW;IACnB,MAAM,CAAC,EAAE;QACP,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,CAAC;IACF,GAAG,CAAC,EAAE,aAAa,CAAC;CACrB;AAED,eAAO,MAAM,IAAI,GAAI,UAAS,WAAgB,KAAG,UAmBhD,CAAC"}
1
+ {"version":3,"file":"none.d.ts","sourceRoot":"","sources":["../../src/lib/transitions/none.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EAEZ,UAAU,EACV,aAAa,EACd,MAAM,UAAU,CAAC;AAElB,UAAU,WAAW;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC;IAC/B,GAAG,CAAC,EAAE,aAAa,CAAC;CACrB;AAED,eAAO,MAAM,IAAI,GAAI,UAAS,WAAgB,KAAG,UAoBhD,CAAC"}
@@ -1,5 +1,5 @@
1
- import { 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,12 +7,9 @@ interface RotateOptions {
7
7
  origin?: string;
8
8
  axis?: "2d" | "x" | "y" | "z";
9
9
  perspective?: number;
10
- spring?: {
11
- stiffness?: number;
12
- damping?: number;
13
- };
10
+ physics?: PhysicsOptions;
14
11
  key?: TransitionKey;
15
- }
12
+ };
16
13
  export declare const rotate: (options?: RotateOptions) => Transition;
17
14
  export {};
18
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,EAAe,UAAU,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEvE,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;QACP,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,CAAC;IACF,GAAG,CAAC,EAAE,aAAa,CAAC;CACrB;AAED,eAAO,MAAM,MAAM,GAAI,UAAS,aAAkB,KAAG,UAgEpD,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,14 +1,11 @@
1
- import { 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?: {
7
- stiffness?: number;
8
- damping?: number;
9
- };
6
+ physics?: PhysicsOptions;
10
7
  key?: TransitionKey;
11
- }
8
+ };
12
9
  export declare const scale: (options?: ScaleOptions) => Transition;
13
10
  export {};
14
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,EAAe,UAAU,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEvE,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;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,KAAG,UA6ClD,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,16 +1,13 @@
1
- import { 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?: {
9
- stiffness?: number;
10
- damping?: number;
11
- };
8
+ physics?: PhysicsOptions;
12
9
  key?: TransitionKey;
13
- }
10
+ };
14
11
  export declare const slide: (options?: SlideOptions) => Transition;
15
12
  export {};
16
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,EAAe,UAAU,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEvE,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,KAAG,UA4ElD,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 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 g(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:[{physics:i.physics,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:y,...f}=s,h=t?typeof t=="function"?i?{element:i,style:t}:void 0:{element:t.element,style:t.style}:void 0;return{...f,css:h,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=g;exports.validateAnimationMode=c;exports.validateSpringItem=l;