vue-micro-router 1.0.30 → 1.0.33

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.mjs CHANGED
@@ -1091,7 +1091,9 @@ const et = /* @__PURE__ */ ee({
1091
1091
  maxHeight: "100dvh",
1092
1092
  margin: "0",
1093
1093
  padding: "0",
1094
- inset: "0"
1094
+ inset: "0",
1095
+ border: "none",
1096
+ outline: "none"
1095
1097
  }),
1096
1098
  onCancel: A,
1097
1099
  onClick: M
@@ -6,26 +6,26 @@ class C {
6
6
  }).catch(() => {
7
7
  });
8
8
  }
9
- async play(s, n = {}) {
9
+ async play(s, u = {}) {
10
10
  if (this.stop(), !this.HowlCtor) {
11
- const i = await import("howler");
12
- this.HowlCtor = i.Howl;
11
+ const l = await import("howler");
12
+ this.HowlCtor = l.Howl;
13
13
  }
14
14
  this.sound = new this.HowlCtor({
15
15
  src: [s],
16
16
  autoplay: !0,
17
- loop: n.loop ?? !1,
17
+ loop: u.loop ?? !1,
18
18
  volume: 0
19
- }), this.sound.play(), this.sound.fade(0, n.volume ?? 1, 200);
19
+ }), this.sound.play(), this.sound.fade(0, u.volume ?? 1, 200);
20
20
  }
21
21
  /** Fully synchronous play — uses preloaded HowlCtor. No-op if not preloaded yet. */
22
- playSync(s, n = {}) {
22
+ playSync(s, u = {}) {
23
23
  this.HowlCtor && (this.stop(), this.sound = new this.HowlCtor({
24
24
  src: [s],
25
25
  autoplay: !0,
26
- loop: n.loop ?? !1,
26
+ loop: u.loop ?? !1,
27
27
  volume: 0
28
- }), this.sound.play(), this.sound.fade(0, n.volume ?? 1, 200));
28
+ }), this.sound.play(), this.sound.fade(0, u.volume ?? 1, 200));
29
29
  }
30
30
  stop() {
31
31
  try {
@@ -41,9 +41,9 @@ class C {
41
41
  resume() {
42
42
  this.sound && this.state() === "loaded" && this.sound.play();
43
43
  }
44
- fade(s, n, i) {
44
+ fade(s, u, l) {
45
45
  var e;
46
- (e = this.sound) != null && e.playing() && this.sound.fade(s, n, i);
46
+ (e = this.sound) != null && e.playing() && this.sound.fade(s, u, l);
47
47
  }
48
48
  isPlaying() {
49
49
  var s;
@@ -62,21 +62,21 @@ function k(t) {
62
62
  function B(t) {
63
63
  return t.split("/").filter(Boolean);
64
64
  }
65
- function x(t) {
65
+ function L(t) {
66
66
  return `/${t.join("/")}`;
67
67
  }
68
68
  function b(t) {
69
69
  const s = t.lastIndexOf("/");
70
70
  return s === -1 ? t : t.substring(s + 1);
71
71
  }
72
- function A(t) {
72
+ function x(t) {
73
73
  try {
74
74
  return w(t);
75
75
  } catch {
76
76
  return t;
77
77
  }
78
78
  }
79
- function L(t) {
79
+ function A(t) {
80
80
  return typeof t == "function" && !("__name" in t) && !("setup" in t) && !("render" in t);
81
81
  }
82
82
  async function M(t) {
@@ -87,38 +87,42 @@ async function M(t) {
87
87
  }
88
88
  function R(t) {
89
89
  let s = !1;
90
- const n = (t == null ? void 0 : t.defaultBgm) ?? "";
91
- let i = "";
92
- const e = (t == null ? void 0 : t.adapter) ?? new C(), o = S(""), r = H(() => {
93
- var a;
94
- return (((a = t == null ? void 0 : t.volumeRef) == null ? void 0 : a.value) || 0) / 100;
90
+ const u = (t == null ? void 0 : t.defaultBgm) ?? "";
91
+ let l = "";
92
+ const e = (t == null ? void 0 : t.adapter) ?? new C(), n = S(""), d = H(() => {
93
+ var o;
94
+ return (((o = t == null ? void 0 : t.volumeRef) == null ? void 0 : o.value) || 0) / 100;
95
95
  });
96
- async function d(a, u = !1) {
96
+ async function c(o, r = !1) {
97
97
  try {
98
- if (e.isPlaying() && o.value === a) return;
99
- i = o.value, o.value = a, e.stop(), await e.play(a, { loop: u, volume: r.value });
100
- } catch (l) {
101
- console.error("Sound playback failed:", l), e.stop();
98
+ const a = o === "default" ? u : o;
99
+ if (!a || e.isPlaying() && n.value === a) return;
100
+ l = n.value, n.value = a, e.stop(), await e.play(a, { loop: o === "default" ? !0 : r, volume: d.value });
101
+ } catch (a) {
102
+ console.error("Sound playback failed:", a), e.stop();
102
103
  }
103
104
  }
104
- function f(a, u = !1) {
105
+ function p(o, r = !1) {
105
106
  try {
106
- if (e.isPlaying() && o.value === a) return;
107
- i = o.value, o.value = a, e.stop(), e.playSync ? e.playSync(a, { loop: u, volume: r.value }) : e.play(a, { loop: u, volume: r.value });
108
- } catch (l) {
109
- console.error("Sound playback failed:", l), e.stop();
107
+ const a = o === "default" ? u : o;
108
+ if (!a || e.isPlaying() && n.value === a) return;
109
+ l = n.value, n.value = a, e.stop();
110
+ const i = o === "default" ? !0 : r;
111
+ e.playSync ? e.playSync(a, { loop: i, volume: d.value }) : e.play(a, { loop: i, volume: d.value });
112
+ } catch (a) {
113
+ console.error("Sound playback failed:", a), e.stop();
110
114
  }
111
115
  }
112
- function p() {
116
+ function h() {
113
117
  e.stop();
114
118
  }
115
- async function y(a, u) {
116
- if (u)
119
+ async function y(o, r) {
120
+ if (r)
117
121
  try {
118
- const l = b(a) || "home", c = u.get(l), h = (c == null ? void 0 : c.bgm) || n;
119
- h && i !== h && await d(h, !0);
120
- } catch (l) {
121
- console.error("Error updating background music:", l);
122
+ const a = b(o) || "home", i = r.get(a), f = (i == null ? void 0 : i.bgm) || u;
123
+ f && l !== f && await c(f, !0);
124
+ } catch (a) {
125
+ console.error("Error updating background music:", a);
122
126
  }
123
127
  }
124
128
  function m() {
@@ -132,12 +136,12 @@ function R(t) {
132
136
  function v() {
133
137
  e.cleanup();
134
138
  }
135
- return g(r, (a, u) => {
136
- e.isPlaying() ? e.fade(u ?? 0, a, 300) : a > 0 && o.value && d(o.value, !0);
139
+ return g(d, (o, r) => {
140
+ e.isPlaying() ? e.fade(r ?? 0, o, 300) : o > 0 && n.value && c(n.value, !0);
137
141
  }), {
138
- playSound: d,
139
- playSoundSync: f,
140
- stopSound: p,
142
+ playSound: c,
143
+ playSoundSync: p,
144
+ stopSound: h,
141
145
  updateBackgroundMusic: y,
142
146
  isStarted: () => e.isPlaying() || e.state() === "loaded",
143
147
  handleVisibilityChange: m,
@@ -146,12 +150,12 @@ function R(t) {
146
150
  }
147
151
  export {
148
152
  C as H,
149
- x as b,
153
+ L as b,
150
154
  b as g,
151
- L as i,
155
+ A as i,
152
156
  k as n,
153
157
  B as p,
154
- A as s,
158
+ x as s,
155
159
  R as u,
156
160
  M as w
157
161
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vue-micro-router",
3
- "version": "1.0.30",
3
+ "version": "1.0.33",
4
4
  "type": "module",
5
5
  "description": "Mobile-app-style navigation for Vue 3 — animated page stacks, modal dialogs, HUD controls. No URL routing.",
6
6
  "author": {