@huyooo/ui 0.5.36 → 0.5.38

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.
@@ -1,4 +1,4 @@
1
- import { ref as I, computed as h, watch as C, toValue as N, isRef as G, hasInjectionContext as W, inject as B, watchEffect as F, getCurrentInstance as J, onBeforeUnmount as Q, onDeactivated as Z, onActivated as X } from "vue";
1
+ import { ref as I, computed as h, watch as C, toValue as G, isRef as W, hasInjectionContext as B, inject as F, watchEffect as J, getCurrentInstance as Q, onBeforeUnmount as Z, onDeactivated as X, onActivated as Y } from "vue";
2
2
  import { useRouter as _, useRoute as x } from "vue-router";
3
3
  import { u as R } from "./useAuthkitAppsAuthPageInfo-Ct-ElH04.js";
4
4
  import { a as U } from "./useAuthkitUsersProfile-B1y2nleU.js";
@@ -6,7 +6,7 @@ const v = I({
6
6
  key: "",
7
7
  name: ""
8
8
  });
9
- function be() {
9
+ function we() {
10
10
  function e(t, n) {
11
11
  v.value.key = t, v.value.name = n;
12
12
  }
@@ -15,7 +15,7 @@ function be() {
15
15
  setActiveDoc: e
16
16
  };
17
17
  }
18
- function we(e, t = "default") {
18
+ function Se(e, t = "default") {
19
19
  const n = document;
20
20
  if (n && typeof n.startViewTransition == "function") {
21
21
  const r = document.body;
@@ -30,65 +30,66 @@ function we(e, t = "default") {
30
30
  } else
31
31
  e();
32
32
  }
33
- function K(e, t) {
33
+ function D(e, t) {
34
34
  return Array.isArray(e == null ? void 0 : e.menuTypes) ? e.menuTypes.includes(t) : !1;
35
35
  }
36
- function Se(e, t, n) {
36
+ function Ae(e, t, n) {
37
37
  for (let r = e.length - 1; r >= 0; r--) {
38
38
  const o = e[r];
39
- if (K(o.meta, t))
39
+ if (D(o.meta, t))
40
40
  return o.path;
41
41
  }
42
42
  return n;
43
43
  }
44
- function Ae(e) {
44
+ function $e(e) {
45
45
  const t = _(), {
46
46
  appsData: n
47
47
  } = R(), {
48
48
  isLoggedIn: r,
49
49
  userProfile: o
50
50
  } = U(), s = h(() => {
51
- var p;
52
- return !r.value || !o.value ? [] : ((p = o.value.permissions) == null ? void 0 : p.map((a) => a.permissionKey)) || [];
51
+ var f;
52
+ return !r.value || !o.value ? [] : ((f = o.value.permissions) == null ? void 0 : f.map((a) => a.permissionKey)) || [];
53
53
  });
54
- function i(p) {
55
- return (n.value.publicRoutes || []).some((d) => d.permissionKey === p);
54
+ function i(f) {
55
+ return (n.value.publicRoutes || []).some((d) => d.permissionKey === f);
56
56
  }
57
- function c(p) {
58
- return r.value ? s.value.includes(p) : !1;
57
+ function c(f) {
58
+ return r.value ? s.value.includes(f) : !1;
59
59
  }
60
- function l(p) {
60
+ function l(f) {
61
61
  var a;
62
62
  return {
63
- path: p.path,
64
- name: p.name,
65
- meta: p.meta,
66
- children: (a = p.children) == null ? void 0 : a.map((d) => l(d))
63
+ path: f.path,
64
+ name: f.name,
65
+ meta: f.meta,
66
+ children: (a = f.children) == null ? void 0 : a.map((d) => l(d))
67
67
  };
68
68
  }
69
- function u(p, a) {
69
+ function p(f, a) {
70
70
  const d = [];
71
- for (const f of p) {
72
- if (f.path === "/" || f.path === "/:catchAll(.*)")
71
+ for (const m of f) {
72
+ if (m.path === "/" || m.path === "/:catchAll(.*)")
73
73
  continue;
74
- const m = f.meta;
75
- if (K(m, a)) {
76
- const w = f.path;
74
+ const u = m.meta;
75
+ if (D(u, a)) {
76
+ const w = m.path;
77
77
  if (i(w) || c(w)) {
78
- const P = {
79
- name: (m == null ? void 0 : m.menuName) || (m == null ? void 0 : m.title) || (typeof f.name == "string" ? f.name : f.path),
80
- path: f.path,
81
- icon: (m == null ? void 0 : m.menuIcon) || (m == null ? void 0 : m.icon),
82
- hidden: m == null ? void 0 : m.hidden
78
+ const g = {
79
+ name: (u == null ? void 0 : u.menuName) || (u == null ? void 0 : u.title) || (typeof m.name == "string" ? m.name : m.path),
80
+ path: m.path,
81
+ icon: (u == null ? void 0 : u.menuIcon) || (u == null ? void 0 : u.icon),
82
+ description: (u == null ? void 0 : u.menuDescription) || (u == null ? void 0 : u.description),
83
+ hidden: u == null ? void 0 : u.hidden
83
84
  };
84
- if (f.children && f.children.length > 0) {
85
- const A = u(f.children, a);
86
- A.length > 0 && (P.children = A);
85
+ if (m.children && m.children.length > 0) {
86
+ const P = p(m.children, a);
87
+ P.length > 0 && (g.children = P);
87
88
  }
88
- d.push(P);
89
+ d.push(g);
89
90
  }
90
- } else if (f.children && f.children.length > 0) {
91
- const w = u(f.children, a);
91
+ } else if (m.children && m.children.length > 0) {
92
+ const w = p(m.children, a);
92
93
  d.push(...w);
93
94
  }
94
95
  }
@@ -98,15 +99,15 @@ function Ae(e) {
98
99
  menus: h(() => {
99
100
  if (!e)
100
101
  return [];
101
- const p = t.getRoutes(), a = p.find((y) => y.path === "/"), d = a != null && a.children ? a.children.map((y) => l(y)) : [], m = p.filter((y) => y.path === "/" || y.path === "/:catchAll(.*)" ? !1 : y.path.split("/").filter((A) => A).length === 1).map(l), w = [...d, ...m];
102
- return console.log(u(w, e), "过滤菜单"), u(w, e);
102
+ const f = t.getRoutes(), a = f.find((g) => g.path === "/"), d = a != null && a.children ? a.children.map((g) => l(g)) : [], m = new Set(d.map((g) => g.path)), w = f.filter((g) => g.path === "/" || g.path === "/:catchAll(.*)" || m.has(g.path) ? !1 : g.path.split("/").filter((N) => N).length === 1).map(l), T = [...d, ...w];
103
+ return console.log(p(T, e), "过滤菜单"), p(T, e);
103
104
  }),
104
105
  isRoutePublic: i,
105
- hasPermission: (p) => i(p) ? !0 : c(p),
106
+ hasPermission: (f) => i(f) ? !0 : c(f),
106
107
  isLoggedIn: r
107
108
  };
108
109
  }
109
- function $e() {
110
+ function Te() {
110
111
  const e = _(), t = x(), {
111
112
  appsAuthPageInfoApi: n,
112
113
  appsData: r,
@@ -116,20 +117,20 @@ function $e() {
116
117
  isLoggedIn: i,
117
118
  usersProfileSuccess: c
118
119
  } = U(), l = I(!1);
119
- function u(a) {
120
- return (r.value.publicRoutes || []).some((f) => f.permissionKey === a);
120
+ function p(a) {
121
+ return (r.value.publicRoutes || []).some((m) => m.permissionKey === a);
121
122
  }
122
123
  function b(a) {
123
- var f;
124
- return !i.value || !s.value ? !1 : (((f = s.value.permissions) == null ? void 0 : f.map((m) => m.permissionKey)) || []).includes(a);
124
+ var m;
125
+ return !i.value || !s.value ? !1 : (((m = s.value.permissions) == null ? void 0 : m.map((u) => u.permissionKey)) || []).includes(a);
125
126
  }
126
- function p(a) {
127
- var d, f;
127
+ function f(a) {
128
+ var d, m;
128
129
  if (!o.value) {
129
130
  console.log("权限检查跳过:appsAuthPageInfoSuccess 未加载完成", a);
130
131
  return;
131
132
  }
132
- if (l.value = !0, u(a)) {
133
+ if (l.value = !0, p(a)) {
133
134
  console.log("权限检查通过:公开路由", a), l.value = !1;
134
135
  return;
135
136
  }
@@ -142,27 +143,27 @@ function $e() {
142
143
  return;
143
144
  }
144
145
  b(a) ? console.log("权限检查通过:有权限", a) : (console.log("权限检查失败:无权限,重定向到首页", a, {
145
- permissions: (f = (d = s.value) == null ? void 0 : d.permissions) == null ? void 0 : f.map((m) => m.permissionKey)
146
+ permissions: (m = (d = s.value) == null ? void 0 : d.permissions) == null ? void 0 : m.map((u) => u.permissionKey)
146
147
  }), e.replace("/")), l.value = !1;
147
148
  }
148
149
  return n(), C(() => t.path, (a) => {
149
- p(a);
150
+ f(a);
150
151
  }), C([o, c], ([a]) => {
151
- a && p(t.path);
152
+ a && f(t.path);
152
153
  }), {
153
154
  isChecking: l,
154
- isRoutePublic: u,
155
+ isRoutePublic: p,
155
156
  hasPermission: b
156
157
  };
157
158
  }
158
- const Y = /* @__PURE__ */ new Set(["link", "style", "script", "noscript"]), ee = /* @__PURE__ */ new Set(["title", "titleTemplate", "script", "style", "noscript"]), Te = /* @__PURE__ */ new Set([
159
+ const ee = /* @__PURE__ */ new Set(["link", "style", "script", "noscript"]), te = /* @__PURE__ */ new Set(["title", "titleTemplate", "script", "style", "noscript"]), Pe = /* @__PURE__ */ new Set([
159
160
  "base",
160
161
  "meta",
161
162
  "link",
162
163
  "style",
163
164
  "script",
164
165
  "noscript"
165
- ]), Pe = /* @__PURE__ */ new Set([
166
+ ]), ve = /* @__PURE__ */ new Set([
166
167
  "title",
167
168
  "base",
168
169
  "htmlAttrs",
@@ -172,7 +173,7 @@ const Y = /* @__PURE__ */ new Set(["link", "style", "script", "noscript"]), ee =
172
173
  "style",
173
174
  "script",
174
175
  "noscript"
175
- ]), te = /* @__PURE__ */ new Set(["base", "title", "titleTemplate", "bodyAttrs", "htmlAttrs", "templateParams"]), ne = /* @__PURE__ */ new Set(["key", "tagPosition", "tagPriority", "tagDuplicateStrategy", "innerHTML", "textContent", "processTemplateParams"]), ve = /* @__PURE__ */ new Set(["templateParams", "htmlAttrs", "bodyAttrs"]), E = /* @__PURE__ */ new Set([
176
+ ]), ne = /* @__PURE__ */ new Set(["base", "title", "titleTemplate", "bodyAttrs", "htmlAttrs", "templateParams"]), re = /* @__PURE__ */ new Set(["key", "tagPosition", "tagPriority", "tagDuplicateStrategy", "innerHTML", "textContent", "processTemplateParams"]), je = /* @__PURE__ */ new Set(["templateParams", "htmlAttrs", "bodyAttrs"]), E = /* @__PURE__ */ new Set([
176
177
  "theme-color",
177
178
  "google-site-verification",
178
179
  "og",
@@ -186,7 +187,7 @@ const Y = /* @__PURE__ */ new Set(["link", "style", "script", "noscript"]), ee =
186
187
  OG: /* @__PURE__ */ new Set(["og", "book", "article", "profile", "fb"]),
187
188
  MEDIA: /* @__PURE__ */ new Set(["ogImage", "ogVideo", "ogAudio", "twitterImage"]),
188
189
  HTTP_EQUIV: /* @__PURE__ */ new Set(["contentType", "defaultStyle", "xUaCompatible"])
189
- }, re = {
190
+ }, oe = {
190
191
  articleExpirationTime: "article:expiration_time",
191
192
  articleModifiedTime: "article:modified_time",
192
193
  articlePublishedTime: "article:published_time",
@@ -205,12 +206,12 @@ const Y = /* @__PURE__ */ new Set(["link", "style", "script", "noscript"]), ee =
205
206
  msapplicationConfig: "msapplication-Config",
206
207
  msapplicationTileColor: "msapplication-TileColor",
207
208
  msapplicationTileImage: "msapplication-TileImage"
208
- }, L = {
209
+ }, K = {
209
210
  appleItunesApp: {
210
211
  unpack: {
211
212
  entrySeparator: ", ",
212
213
  // @ts-expect-error untyped
213
- resolve: ({ key: e, value: t }) => `${g(e)}=${t}`
214
+ resolve: ({ key: e, value: t }) => `${y(e)}=${t}`
214
215
  }
215
216
  },
216
217
  refresh: {
@@ -225,7 +226,7 @@ const Y = /* @__PURE__ */ new Set(["link", "style", "script", "noscript"]), ee =
225
226
  unpack: {
226
227
  entrySeparator: ", ",
227
228
  // @ts-expect-error untyped
228
- resolve: ({ key: e, value: t }) => typeof t == "boolean" ? g(e) : `${g(e)}:${t}`
229
+ resolve: ({ key: e, value: t }) => typeof t == "boolean" ? y(e) : `${y(e)}:${t}`
229
230
  }
230
231
  },
231
232
  contentSecurityPolicy: {
@@ -233,66 +234,66 @@ const Y = /* @__PURE__ */ new Set(["link", "style", "script", "noscript"]), ee =
233
234
  unpack: {
234
235
  entrySeparator: "; ",
235
236
  // @ts-expect-error untyped
236
- resolve: ({ key: e, value: t }) => `${g(e)} ${t}`
237
+ resolve: ({ key: e, value: t }) => `${y(e)} ${t}`
237
238
  }
238
239
  },
239
240
  charset: {}
240
241
  };
241
- function g(e) {
242
+ function y(e) {
242
243
  const t = e.replace(/([A-Z])/g, "-$1").toLowerCase(), n = t.indexOf("-");
243
244
  return n === -1 ? t : S.META.has(t.slice(0, n)) || S.OG.has(t.slice(0, n)) ? e.replace(/([A-Z])/g, ":$1").toLowerCase() : t;
244
245
  }
245
- function D(e) {
246
+ function L(e) {
246
247
  return Object.fromEntries(Object.entries(e).filter(([t, n]) => String(n) !== "false" && t));
247
248
  }
248
249
  function j(e) {
249
- return Array.isArray(e) ? e.map(j) : !e || typeof e != "object" ? e : Object.fromEntries(Object.entries(e).map(([t, n]) => [g(t), j(n)]));
250
+ return Array.isArray(e) ? e.map(j) : !e || typeof e != "object" ? e : Object.fromEntries(Object.entries(e).map(([t, n]) => [y(t), j(n)]));
250
251
  }
251
252
  function H(e, t = {}) {
252
253
  const { entrySeparator: n = "", keyValueSeparator: r = "", wrapValue: o, resolve: s } = t;
253
254
  return Object.entries(e).map(([i, c]) => {
254
255
  if (s) {
255
- const u = s({ key: i, value: c });
256
- if (u !== void 0)
257
- return u;
256
+ const p = s({ key: i, value: c });
257
+ if (p !== void 0)
258
+ return p;
258
259
  }
259
260
  const l = typeof c == "object" ? H(c, t) : typeof c == "number" ? c.toString() : typeof c == "string" && o ? `${o}${c.replace(new RegExp(o, "g"), `\\${o}`)}${o}` : c;
260
261
  return `${i}${r}${l}`;
261
262
  }).join(n);
262
263
  }
263
264
  function V(e, t) {
264
- const n = D(t), r = g(e), o = k(r);
265
+ const n = L(t), r = y(e), o = k(r);
265
266
  if (!E.has(r))
266
267
  return [{ [o]: r, ...n }];
267
268
  const s = Object.fromEntries(
268
269
  Object.entries(n).map(([i, c]) => [`${e}${i === "url" ? "" : `${i[0].toUpperCase()}${i.slice(1)}`}`, c])
269
270
  );
270
- return $(s || {}).sort((i, c) => {
271
- var l, u;
272
- return (((l = i[o]) == null ? void 0 : l.length) || 0) - (((u = c[o]) == null ? void 0 : u.length) || 0);
271
+ return A(s || {}).sort((i, c) => {
272
+ var l, p;
273
+ return (((l = i[o]) == null ? void 0 : l.length) || 0) - (((p = c[o]) == null ? void 0 : p.length) || 0);
273
274
  });
274
275
  }
275
276
  function k(e) {
276
277
  var r;
277
- if (((r = L[e]) == null ? void 0 : r.metaKey) === "http-equiv" || S.HTTP_EQUIV.has(e))
278
+ if (((r = K[e]) == null ? void 0 : r.metaKey) === "http-equiv" || S.HTTP_EQUIV.has(e))
278
279
  return "http-equiv";
279
- const t = g(e), n = t.indexOf(":");
280
+ const t = y(e), n = t.indexOf(":");
280
281
  return n === -1 ? "name" : S.OG.has(t.slice(0, n)) ? "property" : "name";
281
282
  }
282
- function oe(e) {
283
- return re[e] || g(e);
283
+ function se(e) {
284
+ return oe[e] || y(e);
284
285
  }
285
- function se(e, t) {
286
+ function ie(e, t) {
286
287
  var n;
287
288
  return t === "refresh" ? `${e.seconds};url=${e.url}` : H(j(e), {
288
289
  keyValueSeparator: "=",
289
290
  entrySeparator: ", ",
290
291
  resolve: ({ value: r, key: o }) => r === null ? "" : typeof r == "boolean" ? o : void 0,
291
292
  // @ts-expect-error untyped
292
- ...(n = L[t]) == null ? void 0 : n.unpack
293
+ ...(n = K[t]) == null ? void 0 : n.unpack
293
294
  });
294
295
  }
295
- function $(e) {
296
+ function A(e) {
296
297
  const t = [], n = {};
297
298
  for (const [o, s] of Object.entries(e)) {
298
299
  if (Array.isArray(s)) {
@@ -305,13 +306,13 @@ function $(e) {
305
306
  for (const i of s)
306
307
  if (typeof i == "object" && i !== null) {
307
308
  const c = [], l = [];
308
- for (const [u, b] of Object.entries(i)) {
309
- const p = `${o}${u === "url" ? "" : `:${u}`}`, a = $({ [p]: b });
310
- (u === "url" ? c : l).push(...a);
309
+ for (const [p, b] of Object.entries(i)) {
310
+ const f = `${o}${p === "url" ? "" : `:${p}`}`, a = A({ [f]: b });
311
+ (p === "url" ? c : l).push(...a);
311
312
  }
312
313
  t.push(...c, ...l);
313
314
  } else
314
- t.push(...typeof i == "string" ? $({ [o]: i }) : V(o, i));
315
+ t.push(...typeof i == "string" ? A({ [o]: i }) : V(o, i));
315
316
  continue;
316
317
  }
317
318
  if (typeof s == "object" && s)
@@ -324,60 +325,60 @@ function $(e) {
324
325
  [l]: `${i}:${c}:secure_url`,
325
326
  content: s.secureUrl
326
327
  });
327
- for (const [u, b] of Object.entries(s))
328
- u !== "url" && u !== "secureUrl" && t.push({
329
- [l]: `${i}:${c}:${u}`,
328
+ for (const [p, b] of Object.entries(s))
329
+ p !== "url" && p !== "secureUrl" && t.push({
330
+ [l]: `${i}:${c}:${p}`,
330
331
  // @ts-expect-error untyped
331
332
  content: b
332
333
  });
333
- } else E.has(g(o)) ? t.push(...V(o, s)) : n[o] = D(s);
334
+ } else E.has(y(o)) ? t.push(...V(o, s)) : n[o] = L(s);
334
335
  else
335
336
  n[o] = s;
336
337
  }
337
338
  const r = Object.entries(n).map(([o, s]) => {
338
339
  if (o === "charset")
339
340
  return { charset: s === null ? "_null" : s };
340
- const i = k(o), c = oe(o), l = s === null ? "_null" : typeof s == "object" ? se(s, o) : typeof s == "number" ? s.toString() : s;
341
+ const i = k(o), c = se(o), l = s === null ? "_null" : typeof s == "object" ? ie(s, o) : typeof s == "number" ? s.toString() : s;
341
342
  return i === "http-equiv" ? { "http-equiv": c, content: l } : { [i]: c, content: l };
342
343
  });
343
344
  return [...t, ...r].map(
344
345
  (o) => "content" in o && o.content === "_null" ? { ...o, content: null } : o
345
346
  );
346
347
  }
347
- const ie = {
348
+ const ce = {
348
349
  key: "flatMeta",
349
350
  hooks: {
350
351
  "entries:normalize": (e) => {
351
352
  const t = [];
352
- e.tags = e.tags.map((n) => n.tag !== "_flatMeta" ? n : (t.push($(n.props).map((r) => ({
353
+ e.tags = e.tags.map((n) => n.tag !== "_flatMeta" ? n : (t.push(A(n.props).map((r) => ({
353
354
  ...n,
354
355
  tag: "meta",
355
356
  props: r
356
357
  }))), !1)).filter(Boolean).concat(...t);
357
358
  }
358
359
  }
359
- }, ce = ["name", "property", "http-equiv"], ae = /* @__PURE__ */ new Set([
360
+ }, ae = ["name", "property", "http-equiv"], le = /* @__PURE__ */ new Set([
360
361
  "viewport",
361
362
  "description",
362
363
  "keywords",
363
364
  "robots"
364
365
  ]);
365
- function je(e) {
366
+ function Me(e) {
366
367
  const t = e.split(":");
367
368
  return t.length ? E.has(t[1]) : !1;
368
369
  }
369
- function Me(e) {
370
+ function Ie(e) {
370
371
  const { props: t, tag: n } = e;
371
- if (te.has(n))
372
+ if (ne.has(n))
372
373
  return n;
373
374
  if (n === "link" && t.rel === "canonical")
374
375
  return "canonical";
375
376
  if (t.charset)
376
377
  return "charset";
377
378
  if (e.tag === "meta") {
378
- for (const r of ce)
379
+ for (const r of ae)
379
380
  if (t[r] !== void 0) {
380
- const o = t[r], s = o.includes(":"), i = ae.has(o), l = !(s || i) && e.key ? `:key:${e.key}` : "";
381
+ const o = t[r], s = o.includes(":"), i = le.has(o), l = !(s || i) && e.key ? `:key:${e.key}` : "";
381
382
  return `${n}:${o}${l}`;
382
383
  }
383
384
  }
@@ -385,33 +386,33 @@ function Me(e) {
385
386
  return `${n}:key:${e.key}`;
386
387
  if (t.id)
387
388
  return `${n}:id:${t.id}`;
388
- if (ee.has(n)) {
389
+ if (te.has(n)) {
389
390
  const r = e.textContent || e.innerHTML;
390
391
  if (r)
391
392
  return `${n}:content:${r}`;
392
393
  }
393
394
  }
394
- function Ie(e) {
395
+ function Ee(e) {
395
396
  const t = e._h || e._d;
396
397
  if (t)
397
398
  return t;
398
399
  const n = e.textContent || e.innerHTML;
399
400
  return n || `${e.tag}:${Object.entries(e.props).map(([r, o]) => `${r}:${String(o)}`).join(",")}`;
400
401
  }
401
- function T(e, t, n) {
402
+ function $(e, t, n) {
402
403
  typeof e === "function" && (!n || n !== "titleTemplate" && !(n[0] === "o" && n[1] === "n")) && (e = e());
403
404
  let o;
404
405
  if (t && (o = t(n, e)), Array.isArray(o))
405
- return o.map((s) => T(s, t));
406
+ return o.map((s) => $(s, t));
406
407
  if ((o == null ? void 0 : o.constructor) === Object) {
407
408
  const s = {};
408
409
  for (const i of Object.keys(o))
409
- s[i] = T(o[i], t, i);
410
+ s[i] = $(o[i], t, i);
410
411
  return s;
411
412
  }
412
413
  return o;
413
414
  }
414
- function le(e, t) {
415
+ function ue(e, t) {
415
416
  const n = e === "style" ? /* @__PURE__ */ new Map() : /* @__PURE__ */ new Set();
416
417
  function r(o) {
417
418
  const s = o.trim();
@@ -426,17 +427,17 @@ function le(e, t) {
426
427
  s && s !== "false" && (e === "style" ? n.set(o.trim(), s) : r(o));
427
428
  }), n;
428
429
  }
429
- function ue(e, t) {
430
+ function pe(e, t) {
430
431
  return e.props = e.props || {}, t ? e.tag === "templateParams" ? (e.props = t, e) : (Object.entries(t).forEach(([n, r]) => {
431
432
  if (r === null) {
432
433
  e.props[n] = null;
433
434
  return;
434
435
  }
435
436
  if (n === "class" || n === "style") {
436
- e.props[n] = le(n, r);
437
+ e.props[n] = ue(n, r);
437
438
  return;
438
439
  }
439
- if (ne.has(n)) {
440
+ if (re.has(n)) {
440
441
  if (["textContent", "innerHTML"].includes(n) && typeof r == "object") {
441
442
  let i = t.type;
442
443
  if (t.type || (i = "application/json"), !(i != null && i.endsWith("json")) && i !== "speculationrules")
@@ -450,11 +451,11 @@ function ue(e, t) {
450
451
  o === "true" || o === "" ? e.props[n] = s ? o : !0 : !r && s && o === "false" ? e.props[n] = "false" : r !== void 0 && (e.props[n] = r);
451
452
  }), e) : e;
452
453
  }
453
- function pe(e, t) {
454
- const n = typeof t == "object" && typeof t != "function" ? t : { [e === "script" || e === "noscript" || e === "style" ? "innerHTML" : "textContent"]: t }, r = ue({ tag: e, props: {} }, n);
455
- return r.key && Y.has(r.tag) && (r.props["data-hid"] = r._h = r.key), r.tag === "script" && typeof r.innerHTML == "object" && (r.innerHTML = JSON.stringify(r.innerHTML), r.props.type = r.props.type || "application/json"), Array.isArray(r.props.content) ? r.props.content.map((o) => ({ ...r, props: { ...r.props, content: o } })) : r;
454
+ function fe(e, t) {
455
+ const n = typeof t == "object" && typeof t != "function" ? t : { [e === "script" || e === "noscript" || e === "style" ? "innerHTML" : "textContent"]: t }, r = pe({ tag: e, props: {} }, n);
456
+ return r.key && ee.has(r.tag) && (r.props["data-hid"] = r._h = r.key), r.tag === "script" && typeof r.innerHTML == "object" && (r.innerHTML = JSON.stringify(r.innerHTML), r.props.type = r.props.type || "application/json"), Array.isArray(r.props.content) ? r.props.content.map((o) => ({ ...r, props: { ...r.props, content: o } })) : r;
456
457
  }
457
- function Ee(e, t) {
458
+ function Oe(e, t) {
458
459
  if (!e)
459
460
  return [];
460
461
  typeof e == "function" && (e = e());
@@ -465,15 +466,15 @@ function Ee(e, t) {
465
466
  };
466
467
  e = n(void 0, e);
467
468
  const r = [];
468
- return e = T(e, n), Object.entries(e || {}).forEach(([o, s]) => {
469
+ return e = $(e, n), Object.entries(e || {}).forEach(([o, s]) => {
469
470
  if (s !== void 0)
470
471
  for (const i of Array.isArray(s) ? s : [s])
471
- r.push(pe(o, i));
472
+ r.push(fe(o, i));
472
473
  }), r.flat();
473
474
  }
474
- const fe = (e, t) => G(t) ? N(t) : t, q = "usehead";
475
+ const me = (e, t) => W(t) ? G(t) : t, q = "usehead";
475
476
  // @__NO_SIDE_EFFECTS__
476
- function Oe(e) {
477
+ function Ce(e) {
477
478
  return {
478
479
  install(n) {
479
480
  n.config.globalProperties.$unhead = e, n.config.globalProperties.$head = e, n.provide(q, e);
@@ -482,8 +483,8 @@ function Oe(e) {
482
483
  }
483
484
  // @__NO_SIDE_EFFECTS__
484
485
  function z() {
485
- if (W()) {
486
- const e = B(q);
486
+ if (B()) {
487
+ const e = F(q);
487
488
  if (!e)
488
489
  throw new Error("useHead() was called without provide context, ensure you call it through the setup() function.");
489
490
  return e;
@@ -492,24 +493,24 @@ function z() {
492
493
  }
493
494
  function O(e, t = {}) {
494
495
  const n = t.head || /* @__PURE__ */ z();
495
- return n.ssr ? n.push(e || {}, t) : me(n, e, t);
496
+ return n.ssr ? n.push(e || {}, t) : de(n, e, t);
496
497
  }
497
- function me(e, t, n = {}) {
498
+ function de(e, t, n = {}) {
498
499
  const r = I(!1);
499
500
  let o;
500
- return F(() => {
501
- const i = r.value ? {} : T(t, fe);
501
+ return J(() => {
502
+ const i = r.value ? {} : $(t, me);
502
503
  o ? o.patch(i) : o = e.push(i, n);
503
- }), J() && (Q(() => {
504
+ }), Q() && (Z(() => {
504
505
  o.dispose();
505
- }), Z(() => {
506
- r.value = !0;
507
506
  }), X(() => {
507
+ r.value = !0;
508
+ }), Y(() => {
508
509
  r.value = !1;
509
510
  })), o;
510
511
  }
511
512
  function M(e = {}, t = {}) {
512
- (t.head || /* @__PURE__ */ z()).use(ie);
513
+ (t.head || /* @__PURE__ */ z()).use(ce);
513
514
  const { title: r, titleTemplate: o, ...s } = e;
514
515
  return O({
515
516
  title: r,
@@ -517,7 +518,7 @@ function M(e = {}, t = {}) {
517
518
  _flatMeta: s
518
519
  }, t);
519
520
  }
520
- function Ce() {
521
+ function Ve() {
521
522
  function e(n) {
522
523
  M({
523
524
  ogSiteName: n.siteName,
@@ -532,7 +533,7 @@ function Ce() {
532
533
  image: i,
533
534
  url: c,
534
535
  type: l = "website"
535
- } = n, u = o && o.length > 155 ? `${o.substring(0, 152)}...` : o;
536
+ } = n, p = o && o.length > 155 ? `${o.substring(0, 152)}...` : o;
536
537
  O({
537
538
  title: r,
538
539
  link: c ? [{
@@ -540,17 +541,17 @@ function Ce() {
540
541
  href: c
541
542
  }] : []
542
543
  }), M({
543
- description: u || o,
544
+ description: p || o,
544
545
  keywords: s,
545
546
  ogTitle: r,
546
- ogDescription: u || o,
547
+ ogDescription: p || o,
547
548
  ogType: l === "product" ? void 0 : l,
548
549
  // product 类型不被支持,跳过
549
550
  ogUrl: c,
550
551
  ogImage: i,
551
552
  twitterCard: "summary_large_image",
552
553
  twitterTitle: r,
553
- twitterDescription: u || o,
554
+ twitterDescription: p || o,
554
555
  twitterImage: i
555
556
  });
556
557
  }
@@ -559,7 +560,7 @@ function Ce() {
559
560
  setPageSEO: t
560
561
  };
561
562
  }
562
- function Ve() {
563
+ function _e() {
563
564
  const e = x(), t = () => e.meta;
564
565
  O({
565
566
  title: h(() => t().title || ""),
@@ -600,20 +601,20 @@ function Ve() {
600
601
  });
601
602
  }
602
603
  export {
603
- Te as H,
604
- ve as U,
605
- Pe as V,
606
- Ae as a,
607
- $e as b,
608
- Ce as c,
609
- Ve as d,
610
- Me as e,
611
- Se as f,
612
- ue as g,
613
- Ie as h,
614
- je as i,
615
- Ee as n,
616
- be as u,
617
- Oe as v,
618
- we as w
604
+ Pe as H,
605
+ je as U,
606
+ ve as V,
607
+ $e as a,
608
+ Te as b,
609
+ Ve as c,
610
+ _e as d,
611
+ Ie as e,
612
+ Ae as f,
613
+ pe as g,
614
+ Ee as h,
615
+ Me as i,
616
+ Oe as n,
617
+ we as u,
618
+ Ce as v,
619
+ Se as w
619
620
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@huyooo/ui",
3
- "version": "0.5.36",
3
+ "version": "0.5.38",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "files": [