@ssgoi/core 3.1.1 → 3.1.3

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.
package/dist/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
  var K = Object.defineProperty;
2
2
  var U = (n, e, t) => e in n ? K(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
3
3
  var d = (n, e, t) => U(n, typeof e != "symbol" ? e + "" : e, t);
4
- import { normalizeToMultiSpring as k, normalizeMultiSpringSchedule as F } from "./types.js";
5
- import { isCssAnimation as kt, isMultiSpring as Vt, isSingleSpring as bt, isTickAnimation as Rt, validateAnimationMode as It, validateSpringItem as Pt } from "./types.js";
4
+ import { normalizeToMultiSpring as V, normalizeMultiSpringSchedule as F } from "./types.js";
5
+ import { isCssAnimation as Vt, isMultiSpring as bt, isSingleSpring as kt, isTickAnimation as Rt, validateAnimationMode as It, validateSpringItem as Pt } from "./types.js";
6
6
  import { j as Mt } from "./jaemin-BWkrXq0V.js";
7
7
  class G {
8
8
  constructor() {
@@ -30,9 +30,9 @@ class G {
30
30
  i > this.lagThreshold || i < 0 ? (this.startTime += i - this.adjustedLag, i = this.adjustedLag) : i > this.maxDeltaTime && (i = this.maxDeltaTime), this.lastUpdate = e;
31
31
  const r = e - this.startTime, o = r - this.nextTime;
32
32
  if (o > 0) {
33
- const s = i / 1e3;
33
+ const c = i / 1e3;
34
34
  this.elapsed = r / 1e3, this.nextTime += o + (o >= this.gap ? 4 : this.gap - o), this.listeners.forEach((a) => {
35
- a(s, this.elapsed);
35
+ a(c, this.elapsed);
36
36
  });
37
37
  }
38
38
  this.listeners.size > 0 ? this.rafId = requestAnimationFrame(this.tick) : (this.isRunning = !1, this.rafId = null);
@@ -68,15 +68,15 @@ class G {
68
68
  return this.elapsed;
69
69
  }
70
70
  }
71
- const P = new G();
71
+ const x = new G();
72
72
  function z(n) {
73
73
  const e = n.stiffness, t = n.damping, i = 1, r = Math.sqrt(e / i), o = t / (2 * Math.sqrt(e * i));
74
74
  return { omega: r, zeta: o };
75
75
  }
76
76
  function q(n, e, t, i) {
77
- const { omega: r, zeta: o } = t, { position: s, velocity: a } = n, c = Math.min(i, 0.033), l = -2 * c * o * r * a, f = c * r * r * (e - s), w = a + l + f;
77
+ const { omega: r, zeta: o } = t, { position: c, velocity: a } = n, s = Math.min(i, 0.033), l = -2 * s * o * r * a, f = s * r * r * (e - c), w = a + l + f;
78
78
  return {
79
- position: s + c * w,
79
+ position: c + s * w,
80
80
  velocity: w
81
81
  };
82
82
  }
@@ -92,46 +92,46 @@ function Q(n) {
92
92
  spring: i,
93
93
  velocity: r = 0,
94
94
  onUpdate: o,
95
- onComplete: s,
95
+ onComplete: c,
96
96
  onStart: a
97
97
  } = n;
98
- let c = { position: e, velocity: r }, l = !0, f = 0, w = !1;
98
+ let s = { position: e, velocity: r }, l = !0, f = 0, w = !1;
99
99
  const u = z(i), h = (p) => {
100
100
  if (l) {
101
- if (w || (w = !0, a == null || a()), c = q(c, t, u, p), N(c, t)) {
101
+ if (w || (w = !0, a == null || a()), s = q(s, t, u, p), N(s, t)) {
102
102
  if (f += Math.min(p, 0.033), f >= H) {
103
- c = { position: t, velocity: 0 }, l = !1, o(c.position), P.unsubscribe(h), s();
103
+ s = { position: t, velocity: 0 }, l = !1, o(s.position), x.unsubscribe(h), c();
104
104
  return;
105
105
  }
106
106
  } else
107
107
  f = 0;
108
- o(c.position);
108
+ o(s.position);
109
109
  }
110
110
  };
111
- return P.subscribe(h), {
111
+ return x.subscribe(h), {
112
112
  stop: () => {
113
- l && (l = !1, P.unsubscribe(h));
113
+ l && (l = !1, x.unsubscribe(h));
114
114
  },
115
- getPosition: () => c.position,
116
- getVelocity: () => c.velocity,
115
+ getPosition: () => s.position,
116
+ getVelocity: () => s.velocity,
117
117
  isRunning: () => l
118
118
  };
119
119
  }
120
- const V = 1e3 / 60;
120
+ const b = 1e3 / 60;
121
121
  function Z(n, e, t, i = 0) {
122
122
  const r = z(t), o = 600;
123
- let s = { position: n, velocity: i }, a = 0;
124
- const c = [];
123
+ let c = { position: n, velocity: i }, a = 0;
124
+ const s = [];
125
125
  for (let l = 0; l < o; l++) {
126
- const f = l * V;
127
- if (c.push({
126
+ const f = l * b;
127
+ if (s.push({
128
128
  time: f,
129
- position: s.position,
130
- velocity: s.velocity
131
- }), s = q(s, e, r, V / 1e3), N(s, e)) {
132
- if (a += V / 1e3, a >= H) {
133
- c.push({
134
- time: (l + 1) * V,
129
+ position: c.position,
130
+ velocity: c.velocity
131
+ }), c = q(c, e, r, b / 1e3), N(c, e)) {
132
+ if (a += b / 1e3, a >= H) {
133
+ s.push({
134
+ time: (l + 1) * b,
135
135
  position: e,
136
136
  velocity: 0
137
137
  });
@@ -140,7 +140,7 @@ function Z(n, e, t, i = 0) {
140
140
  } else
141
141
  a = 0;
142
142
  }
143
- return c;
143
+ return s;
144
144
  }
145
145
  function D(n, e) {
146
146
  if (n.length === 0)
@@ -155,10 +155,10 @@ function D(n, e) {
155
155
  const l = Math.floor((r + o) / 2);
156
156
  n[l].time <= e ? r = l : o = l;
157
157
  }
158
- const s = n[r], a = n[o], c = (e - s.time) / (a.time - s.time);
158
+ const c = n[r], a = n[o], s = (e - c.time) / (a.time - c.time);
159
159
  return {
160
- position: s.position + (a.position - s.position) * c,
161
- velocity: s.velocity + (a.velocity - s.velocity) * c
160
+ position: c.position + (a.position - c.position) * s,
161
+ velocity: c.velocity + (a.velocity - c.velocity) * s
162
162
  };
163
163
  }
164
164
  function tt(n, e) {
@@ -171,27 +171,27 @@ function et(n) {
171
171
  to: i,
172
172
  spring: r,
173
173
  velocity: o = 0,
174
- style: s,
174
+ style: c,
175
175
  onComplete: a,
176
- onStart: c
176
+ onStart: s
177
177
  } = n, l = Z(t, i, r, o);
178
178
  if (l.length === 0)
179
- return c == null || c(), a(), {
179
+ return s == null || s(), a(), {
180
180
  stop: () => {
181
181
  },
182
182
  getPosition: () => i,
183
183
  getVelocity: () => 0,
184
184
  isRunning: () => !1
185
185
  };
186
- const f = tt(l, s), w = l[l.length - 1], u = w.time, h = e.animate(f, {
186
+ const f = tt(l, c), w = l[l.length - 1], u = w.time, h = e.animate(f, {
187
187
  duration: u,
188
188
  fill: "forwards",
189
189
  easing: "linear"
190
190
  // Spring physics already applied in keyframes
191
191
  });
192
192
  let p = !0;
193
- const v = performance.now();
194
- return c == null || c(), h.onfinish = () => {
193
+ const S = performance.now();
194
+ return s == null || s(), h.onfinish = () => {
195
195
  p && (p = !1, a());
196
196
  }, {
197
197
  stop: () => {
@@ -200,37 +200,37 @@ function et(n) {
200
200
  getPosition: () => {
201
201
  if (!p)
202
202
  return w.position;
203
- const y = performance.now() - v;
203
+ const y = performance.now() - S;
204
204
  return D(l, y).position;
205
205
  },
206
206
  getVelocity: () => {
207
207
  if (!p)
208
208
  return 0;
209
- const y = performance.now() - v;
209
+ const y = performance.now() - S;
210
210
  return D(l, y).velocity;
211
211
  },
212
212
  isRunning: () => p
213
213
  };
214
214
  }
215
215
  function it(n) {
216
- const { from: e, to: t, spring: i, velocity: r, onComplete: o, onStart: s, tick: a, css: c } = n;
217
- if (a && c)
216
+ const { from: e, to: t, spring: i, velocity: r, onComplete: o, onStart: c, tick: a, css: s } = n;
217
+ if (a && s)
218
218
  throw new Error("Cannot use both 'tick' and 'css' options together");
219
- return !a && !c ? (s == null || s(), o(), {
219
+ return !a && !s ? (c == null || c(), o(), {
220
220
  stop: () => {
221
221
  },
222
222
  getPosition: () => t,
223
223
  getVelocity: () => 0,
224
224
  isRunning: () => !1
225
- }) : c ? et({
226
- element: c.element,
225
+ }) : s ? et({
226
+ element: s.element,
227
227
  from: e,
228
228
  to: t,
229
229
  spring: i,
230
230
  velocity: r,
231
- style: c.style,
231
+ style: s.style,
232
232
  onComplete: o,
233
- onStart: s
233
+ onStart: c
234
234
  }) : Q({
235
235
  from: e,
236
236
  to: t,
@@ -238,12 +238,12 @@ function it(n) {
238
238
  velocity: r,
239
239
  onUpdate: a,
240
240
  onComplete: o,
241
- onStart: s
241
+ onStart: c
242
242
  });
243
243
  }
244
244
  class Y {
245
245
  }
246
- class R extends Y {
246
+ class I extends Y {
247
247
  constructor(t) {
248
248
  super();
249
249
  d(this, "options");
@@ -320,11 +320,11 @@ class R extends Y {
320
320
  this.options = { ...this.options, ...t };
321
321
  }
322
322
  static fromState(t, i) {
323
- const r = new R(i);
323
+ const r = new I(i);
324
324
  return r.setValue(t.position), r.setVelocity(t.velocity), r;
325
325
  }
326
326
  }
327
- class I extends Y {
327
+ class P extends Y {
328
328
  constructor(t) {
329
329
  super();
330
330
  d(this, "config");
@@ -335,22 +335,21 @@ class I extends Y {
335
335
  d(this, "direction", "forward");
336
336
  d(this, "idCounter", 0);
337
337
  d(this, "rafId", null);
338
- d(this, "element");
339
338
  d(this, "from");
340
339
  d(this, "to");
341
- this.config = t.config, this.from = t.from, this.to = t.to, this.element = t.element, this.initializeAnimators();
340
+ this.config = t.config, this.from = t.from, this.to = t.to, this.initializeAnimators();
342
341
  }
343
342
  generateId() {
344
343
  return `spring_${this.idCounter++}`;
345
344
  }
346
345
  initializeAnimators() {
347
346
  this.config.springs.forEach((t) => {
348
- const i = this.generateId(), r = new R({
347
+ const i = this.generateId(), r = new I({
349
348
  from: this.from,
350
349
  to: this.to,
351
350
  spring: t.spring,
352
351
  tick: t.tick,
353
- css: t.css && this.element ? { element: this.element, style: t.css } : void 0,
352
+ css: t.css,
354
353
  onComplete: () => this.onAnimatorComplete(i),
355
354
  onStart: t.onStart
356
355
  });
@@ -379,9 +378,9 @@ class I extends Y {
379
378
  return this.direction === "forward" ? this.springOrder : [...this.springOrder].reverse();
380
379
  }
381
380
  onAnimatorComplete(t) {
382
- var r, o, s, a, c, l;
381
+ var r, o, c, a, s, l;
383
382
  const i = this.animators.get(t);
384
- !i || this.completedAnimators.has(t) || (this.completedAnimators.add(t), this.completedCount++, (o = (r = i.item).onComplete) == null || o.call(r), (a = (s = this.config).onProgress) == null || a.call(s, this.completedCount, this.config.springs.length), this.completedCount === this.config.springs.length && (this.stopScheduler(), (l = (c = this.config).onEnd) == null || l.call(c)));
383
+ !i || this.completedAnimators.has(t) || (this.completedAnimators.add(t), this.completedCount++, (o = (r = i.item).onComplete) == null || o.call(r), (a = (c = this.config).onProgress) == null || a.call(c, this.completedCount, this.config.springs.length), this.completedCount === this.config.springs.length && (this.stopScheduler(), (l = (s = this.config).onEnd) == null || l.call(s)));
385
384
  }
386
385
  /**
387
386
  * Check and start springs based on previous spring's progress
@@ -396,10 +395,10 @@ class I extends Y {
396
395
  this.startAnimator(r);
397
396
  continue;
398
397
  }
399
- const s = t[i - 1], a = this.animators.get(s);
398
+ const c = t[i - 1], a = this.animators.get(c);
400
399
  if (!a || !a.started) continue;
401
- const c = this.getAnimatorProgress(a), l = o.item.normalizedOffset;
402
- c >= l && this.startAnimator(r);
400
+ const s = this.getAnimatorProgress(a), l = o.item.normalizedOffset;
401
+ s >= l && this.startAnimator(r);
403
402
  }
404
403
  }
405
404
  startAnimator(t) {
@@ -447,19 +446,19 @@ class I extends Y {
447
446
  return;
448
447
  const i = t.animator.getCurrentState();
449
448
  if (i.position === i.to) {
450
- const o = t.item.css && this.element ? { element: this.element, style: t.item.css } : void 0, s = R.fromState(
449
+ const o = I.fromState(
451
450
  { position: this.to, velocity: 0 },
452
451
  {
453
452
  from: this.to,
454
453
  to: this.from,
455
454
  spring: t.item.spring,
456
455
  tick: t.item.tick,
457
- css: o,
456
+ css: t.item.css,
458
457
  onComplete: () => this.onAnimatorComplete(t.id),
459
458
  onStart: t.item.onStart
460
459
  }
461
460
  );
462
- s.forward(), t.animator = s;
461
+ o.forward(), t.animator = o;
463
462
  } else
464
463
  t.animator.reverse();
465
464
  });
@@ -517,7 +516,7 @@ class I extends Y {
517
516
  * Uses first animator's state for initialization
518
517
  */
519
518
  static fromState(t, i) {
520
- const r = new I(i);
519
+ const r = new P(i);
521
520
  return r.setValue(t.position), r.setVelocity(t.velocity), r;
522
521
  }
523
522
  }
@@ -626,7 +625,7 @@ const X = Symbol.for("TRANSITION_STRATEGY"), nt = (n) => ({
626
625
  direction: "forward"
627
626
  }
628
627
  }), $ = "data-ssgoi-scope", j = "data-ssgoi-scope-ready";
629
- function St() {
628
+ function vt() {
630
629
  return (n) => {
631
630
  if (n)
632
631
  return n.setAttribute($, ""), queueMicrotask(() => {
@@ -646,19 +645,19 @@ function st(n) {
646
645
  function ct(n, e) {
647
646
  var w;
648
647
  let t = null, i = null, r = null, o = null;
649
- const s = {
648
+ const c = {
650
649
  get currentAnimation() {
651
650
  return t;
652
651
  }
653
- }, a = ((w = e == null ? void 0 : e.strategy) == null ? void 0 : w.call(e, s)) || nt(s), c = async (u) => {
652
+ }, a = ((w = e == null ? void 0 : e.strategy) == null ? void 0 : w.call(e, c)) || nt(c), s = async (u) => {
654
653
  var E;
655
654
  i && (i.remove(), i = null);
656
- const h = n(), p = h.in && h.in(u), v = !(e != null && e.strategy) && h.out ? h.out(u) : void 0;
655
+ const h = n(), p = h.in && h.in(u), S = !(e != null && e.strategy) && h.out ? h.out(u) : void 0;
657
656
  if (!p)
658
657
  return;
659
658
  const y = {
660
- in: k(p),
661
- out: v ? k(v) : void 0
659
+ in: V(p),
660
+ out: S ? V(S) : void 0
662
661
  }, m = await a.runIn(y);
663
662
  if (!m.config) {
664
663
  t && (t.direction = "in");
@@ -666,28 +665,30 @@ function ct(n, e) {
666
665
  }
667
666
  const g = m.config;
668
667
  (E = g.prepare) == null || E.call(g, u), g.wait && await g.wait();
669
- const C = F({
670
- ...g,
671
- onEnd: () => {
672
- var A;
673
- t = null, (A = g.onEnd) == null || A.call(g);
674
- }
675
- }), S = I.fromState(m.state, {
668
+ const C = F(
669
+ {
670
+ ...g,
671
+ onEnd: () => {
672
+ var A;
673
+ t = null, (A = g.onEnd) == null || A.call(g);
674
+ }
675
+ },
676
+ u
677
+ ), v = P.fromState(m.state, {
676
678
  config: C,
677
679
  from: m.from,
678
- to: m.to,
679
- element: u
680
+ to: m.to
680
681
  });
681
- t = { controller: S, direction: "in" }, m.direction === "forward" ? S.forward() : S.backward();
682
+ t = { controller: v, direction: "in" }, m.direction === "forward" ? v.forward() : v.backward();
682
683
  }, l = async (u) => {
683
684
  var A;
684
685
  i = u;
685
- const h = n(), p = !(e != null && e.strategy) && h.in ? h.in(u) : void 0, v = h.out && h.out(u);
686
- if (!v)
686
+ const h = n(), p = !(e != null && e.strategy) && h.in ? h.in(u) : void 0, S = h.out && h.out(u);
687
+ if (!S)
687
688
  return;
688
689
  const y = {
689
- in: p ? k(p) : void 0,
690
- out: k(v)
690
+ in: p ? V(p) : void 0,
691
+ out: V(S)
691
692
  }, m = await a.runOut(y);
692
693
  if (!m.config) {
693
694
  t && (t.direction = "out"), i && (i.remove(), i = null);
@@ -695,19 +696,21 @@ function ct(n, e) {
695
696
  }
696
697
  const g = m.config;
697
698
  (A = g.prepare) == null || A.call(g, u), E(), g.wait && await g.wait();
698
- const C = F({
699
- ...g,
700
- onEnd: () => {
701
- var T, O;
702
- (T = g.onEnd) == null || T.call(g), i && (i.remove(), i = null), t = null, (O = e == null ? void 0 : e.onCleanupEnd) == null || O.call(e);
703
- }
704
- }), S = I.fromState(m.state, {
699
+ const C = F(
700
+ {
701
+ ...g,
702
+ onEnd: () => {
703
+ var T, O;
704
+ (T = g.onEnd) == null || T.call(g), i && (i.remove(), i = null), t = null, (O = e == null ? void 0 : e.onCleanupEnd) == null || O.call(e);
705
+ }
706
+ },
707
+ u
708
+ ), v = P.fromState(m.state, {
705
709
  config: C,
706
710
  from: m.from,
707
- to: m.to,
708
- element: u
711
+ to: m.to
709
712
  });
710
- t = { controller: S, direction: "out" }, m.direction === "forward" ? S.forward() : S.backward();
713
+ t = { controller: v, direction: "out" }, m.direction === "forward" ? v.forward() : v.backward();
711
714
  function E() {
712
715
  !r || !i || (o && r.contains(o) ? r.insertBefore(i, o) : r.appendChild(i));
713
716
  }
@@ -716,8 +719,8 @@ function ct(n, e) {
716
719
  return (u) => {
717
720
  if (u)
718
721
  return r = u.parentElement, o = u.nextElementSibling, (e == null ? void 0 : e.scope) === "local" ? queueMicrotask(() => {
719
- f = st(u), !(f && !rt(f)) && c(u);
720
- }) : c(u), () => {
722
+ f = st(u), !(f && !rt(f)) && s(u);
723
+ }) : s(u), () => {
721
724
  const h = u.isConnected ? u.cloneNode(!0) : u;
722
725
  f ? queueMicrotask(() => {
723
726
  document.contains(f) && l(h);
@@ -733,28 +736,33 @@ const at = 3, lt = (n) => {
733
736
  const i = e[t], r = i == null ? void 0 : i.match(/\(?([^):]+):(\d+):(\d+)\)?$/);
734
737
  if (!r)
735
738
  continue;
736
- const o = r[1] ?? "", s = r[2] ?? "0", a = r[3] ?? "0";
737
- return { file: o.split(/[\\/]/).pop() || o, line: s, column: a };
739
+ const o = r[1] ?? "", c = r[2] ?? "0", a = r[3] ?? "0";
740
+ return { file: o.split(/[\\/]/).pop() || o, line: c, column: a };
738
741
  }
739
742
  return null;
740
- }, x = /* @__PURE__ */ new Map(), M = /* @__PURE__ */ new Map();
743
+ }, R = /* @__PURE__ */ new Map(), M = /* @__PURE__ */ new Map();
741
744
  function ut(n, e, t) {
742
- x.set(n, e);
745
+ R.set(n, e);
743
746
  let i = M.get(n);
744
- return i || (i = ct(
747
+ if (i)
748
+ return i;
749
+ const r = e;
750
+ return i = ct(
745
751
  () => {
746
- const r = x.get(n);
747
- return r || (console.warn(`Transition "${String(n)}" not found`), {});
752
+ const o = R.get(n);
753
+ return o || (console.warn(`Transition "${String(n)}" not found`), {});
748
754
  },
749
755
  {
750
756
  strategy: t == null ? void 0 : t.strategy,
751
757
  scope: t == null ? void 0 : t.scope,
752
- onCleanupEnd: () => W(n)
758
+ onCleanupEnd: () => {
759
+ R.get(n) === r && W(n);
760
+ }
753
761
  }
754
- ), M.set(n, i), i);
762
+ ), M.set(n, i), i;
755
763
  }
756
764
  function W(n) {
757
- x.delete(n), M.delete(n);
765
+ R.delete(n), M.delete(n);
758
766
  }
759
767
  function ft() {
760
768
  const n = lt(new Error().stack);
@@ -798,22 +806,22 @@ function dt(n) {
798
806
  }
799
807
  function mt(n) {
800
808
  let e = !1, t = 0, i = 0, r = !1;
801
- const o = 50, s = (p) => {
809
+ const o = 50, c = (p) => {
802
810
  if (!n) return;
803
- const v = p.touches[0];
804
- v && (r = v.clientX < o, r && (t = v.clientX, i = v.clientY));
811
+ const S = p.touches[0];
812
+ S && (r = S.clientX < o, r && (t = S.clientX, i = S.clientY));
805
813
  }, a = (p) => {
806
814
  if (!n || !r) return;
807
- const v = p.touches[0];
808
- if (!v) return;
809
- const y = v.clientX - t, m = v.clientY - i;
815
+ const S = p.touches[0];
816
+ if (!S) return;
817
+ const y = S.clientX - t, m = S.clientY - i;
810
818
  y > window.outerWidth / 2 - 5 && Math.abs(y) > Math.abs(m) ? e = !0 : e = !1;
811
- }, c = () => {
819
+ }, s = () => {
812
820
  n && (r = !1, t = 0, i = 0);
813
821
  }, l = () => e, f = () => {
814
- typeof window > "u" || n && (window.addEventListener("touchstart", s, { passive: !0 }), window.addEventListener("touchmove", a, { passive: !0 }), window.addEventListener("touchend", c, { passive: !0 }));
822
+ typeof window > "u" || n && (window.addEventListener("touchstart", c, { passive: !0 }), window.addEventListener("touchmove", a, { passive: !0 }), window.addEventListener("touchend", s, { passive: !0 }));
815
823
  }, w = () => {
816
- typeof window > "u" || (window.removeEventListener("touchstart", s), window.removeEventListener("touchmove", a), window.removeEventListener("touchend", c));
824
+ typeof window > "u" || (window.removeEventListener("touchstart", c), window.removeEventListener("touchmove", a), window.removeEventListener("touchend", s));
817
825
  };
818
826
  let u = 0;
819
827
  return {
@@ -872,7 +880,7 @@ function pt() {
872
880
  getScrollPosition: (f) => f && t.has(f) ? t.get(f) : { x: 0, y: 0 }
873
881
  };
874
882
  }
875
- function b(n, e) {
883
+ function k(n, e) {
876
884
  if (e === "*")
877
885
  return !0;
878
886
  if (e.endsWith("/*")) {
@@ -883,10 +891,10 @@ function b(n, e) {
883
891
  }
884
892
  function wt(n, e, t) {
885
893
  for (const i of t)
886
- if (b(n, i.from) && b(e, i.to))
894
+ if (k(n, i.from) && k(e, i.to))
887
895
  return i.transition;
888
896
  for (const i of t)
889
- if ((i.from === "*" || b(n, i.from)) && (i.to === "*" || b(e, i.to)))
897
+ if ((i.from === "*" || k(n, i.from)) && (i.to === "*" || k(e, i.to)))
890
898
  return i.transition;
891
899
  return null;
892
900
  }
@@ -900,9 +908,9 @@ function At(n) {
900
908
  // Default to true - skip animations on iOS swipe
901
909
  } = n;
902
910
  let o = null;
903
- const s = dt(e), {
911
+ const c = dt(e), {
904
912
  initializeContext: a,
905
- calculateScrollOffset: c,
913
+ calculateScrollOffset: s,
906
914
  getScrollContainer: l,
907
915
  getPositionedParentElement: f,
908
916
  getScrollPosition: w
@@ -916,12 +924,12 @@ function At(n) {
916
924
  ), C = wt(
917
925
  y,
918
926
  m,
919
- s
920
- ) || t, S = c(
927
+ c
928
+ ) || t, v = s(
921
929
  o.from,
922
930
  o.to
923
931
  ), E = {
924
- scrollOffset: S,
932
+ scrollOffset: v,
925
933
  scroll: w(o.from),
926
934
  get scrollingElement() {
927
935
  return l() || document.documentElement;
@@ -930,7 +938,7 @@ function At(n) {
930
938
  return f();
931
939
  }
932
940
  }, A = {
933
- scrollOffset: S,
941
+ scrollOffset: v,
934
942
  get scroll() {
935
943
  return o ? w(o.to) : { x: 0, y: 0 };
936
944
  },
@@ -968,17 +976,17 @@ export {
968
976
  nt as createDefaultStrategy,
969
977
  ot as createPageTransitionStrategy,
970
978
  At as createSggoiTransitionContext,
971
- St as createTransitionScope,
979
+ vt as createTransitionScope,
972
980
  st as findScope,
973
981
  ft as generateAutoKey,
974
- kt as isCssAnimation,
975
- Vt as isMultiSpring,
982
+ Vt as isCssAnimation,
983
+ bt as isMultiSpring,
976
984
  rt as isScopeReady,
977
- bt as isSingleSpring,
985
+ kt as isSingleSpring,
978
986
  Rt as isTickAnimation,
979
987
  Mt as jaeminInternal,
980
988
  F as normalizeMultiSpringSchedule,
981
- k as normalizeToMultiSpring,
989
+ V as normalizeToMultiSpring,
982
990
  Ct as transition,
983
991
  It as validateAnimationMode,
984
992
  Pt as validateSpringItem
@@ -1 +1 @@
1
- {"version":3,"file":"create-transition-callback.d.ts","sourceRoot":"","sources":["../../src/lib/transition/create-transition-callback.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAIhF,OAAO,EAEL,KAAK,eAAe,EACpB,KAAK,kBAAkB,EAExB,MAAM,uBAAuB,CAAC;AAG/B,wBAAgB,wBAAwB,CACtC,aAAa,EAAE,MAAM,UAAU,CAAC,SAAS,CAAC,EAC1C,OAAO,CAAC,EAAE;IACR,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,eAAe,KAAK,kBAAkB,CAAC;IAC5D,KAAK,CAAC,EAAE,eAAe,CAAC;CACzB,GACA,kBAAkB,CA6MpB"}
1
+ {"version":3,"file":"create-transition-callback.d.ts","sourceRoot":"","sources":["../../src/lib/transition/create-transition-callback.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAIhF,OAAO,EAEL,KAAK,eAAe,EACpB,KAAK,kBAAkB,EAExB,MAAM,uBAAuB,CAAC;AAG/B,wBAAgB,wBAAwB,CACtC,aAAa,EAAE,MAAM,UAAU,CAAC,SAAS,CAAC,EAC1C,OAAO,CAAC,EAAE;IACR,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,eAAe,KAAK,kBAAkB,CAAC;IAC5D,KAAK,CAAC,EAAE,eAAe,CAAC;CACzB,GACA,kBAAkB,CAiNpB"}
@@ -1 +1 @@
1
- {"version":3,"file":"transition.d.ts","sourceRoot":"","sources":["../../src/lib/transition/transition.ts"],"names":[],"mappings":"AACA,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,kBAAkB,EACnB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAEV,kBAAkB,EAClB,iBAAiB,EAElB,MAAM,UAAU,CAAC;AAClB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AA+D9C,wBAAgB,eAAe,IAAI,aAAa,CAU/C;AAoBD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,wBAAgB,UAAU,CACxB,OAAO,EAAE,iBAAiB,CAAC,SAAS,CAAC,GAAG;IACtC,CAAC,mBAAmB,CAAC,CAAC,EAAE,CAAC,OAAO,EAAE,eAAe,KAAK,kBAAkB,CAAC;CAC1E,GACA,kBAAkB,CAsBpB"}
1
+ {"version":3,"file":"transition.d.ts","sourceRoot":"","sources":["../../src/lib/transition/transition.ts"],"names":[],"mappings":"AACA,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,kBAAkB,EACnB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAEV,kBAAkB,EAClB,iBAAiB,EAElB,MAAM,UAAU,CAAC;AAClB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAyE9C,wBAAgB,eAAe,IAAI,aAAa,CAU/C;AAoBD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,wBAAgB,UAAU,CACxB,OAAO,EAAE,iBAAiB,CAAC,SAAS,CAAC,GAAG;IACtC,CAAC,mBAAmB,CAAC,CAAC,EAAE,CAAC,OAAO,EAAE,eAAe,KAAK,kBAAkB,CAAC;CAC1E,GACA,kBAAkB,CAsBpB"}
package/dist/types.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function p(n){return("tick"in n||"css"in n)&&!("springs"in n)}function r(n){return"springs"in n}function s(n){return"css"in n&&typeof n.css=="function"}function a(n){return"tick"in n&&typeof n.tick=="function"}function o(n){if(s(n)&&a(n))throw new Error("SingleSpringConfig cannot have both 'tick' and 'css' defined. Use one or the other.")}function c(n){if(n.tick&&n.css)throw new Error("SpringItem cannot have both 'tick' and 'css' defined. Use one or the other.")}async function d(n){const i=await n;return r(i)?(i.springs.forEach(c),i):(o(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 g(n){const i=n.schedule??"parallel",l=n.springs.map(t=>{let e;switch(i){case"parallel":e=0;break;case"sequential":e=1;break;case"stagger":e=Math.max(0,Math.min(1,t.offset??0));break;default:e=0}return{...t,normalizedOffset:e}}),{schedule:S,...u}=n;return{...u,springs:l}}exports.isCssAnimation=s;exports.isMultiSpring=r;exports.isSingleSpring=p;exports.isTickAnimation=a;exports.normalizeMultiSpringSchedule=g;exports.normalizeToMultiSpring=d;exports.validateAnimationMode=o;exports.validateSpringItem=c;
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;