@huyooo/ui 2.1.3 → 2.1.4

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 (45) hide show
  1. package/dist/{AuthkitAppSetting-1FsF45E3.js → AuthkitAppSetting-BJWwY3T-.js} +9 -9
  2. package/dist/{Contact-DBG20I8Y.js → Contact-BTQf8tEx.js} +3 -3
  3. package/dist/{CustomTable-HDwqEcmB.js → CustomTable-BY0oHLXc.js} +1 -1
  4. package/dist/{FeedbackModal.vue_vue_type_script_setup_true_lang-hveEkBb4.js → FeedbackModal.vue_vue_type_script_setup_true_lang-BJj1bNKu.js} +5 -5
  5. package/dist/{LandingPageSectionTabs-BT08gT7_.js → LandingPageSectionTabs-Bl6X2W5W.js} +2 -2
  6. package/dist/{LegalDocViewer-DvsnAv6f.js → LegalDocViewer-DCDSLVjc.js} +10 -10
  7. package/dist/{MessageHandle-BUufez4S.js → MessageHandle-DDGFSJMg.js} +3 -3
  8. package/dist/{MessageList-rttvPmxV.js → MessageList-CE5E_5Uv.js} +1 -1
  9. package/dist/{PaySubscriptions-Bv6LQ_Pf.js → PaySubscriptions-CXLqpfgf.js} +6 -6
  10. package/dist/{PricingPlans-CQaXgOIR.js → PricingPlans-CXk2DNb4.js} +4 -4
  11. package/dist/{ReferrerReferees-CGrH-gYJ.js → ReferrerReferees-ZhroFXBA.js} +4 -4
  12. package/dist/{Upload.vue_vue_type_script_setup_true_lang-CgZQOZYt.js → Upload.vue_vue_type_script_setup_true_lang-DsrqOACa.js} +1 -1
  13. package/dist/{UserMenuInvitationsItem.vue_vue_type_script_setup_true_lang-Di-VAlur.js → UserMenuInvitationsItem.vue_vue_type_script_setup_true_lang-COM36ViG.js} +9 -9
  14. package/dist/{WidthContainer-BzU8aEwN.js → WidthContainer-CDf1GiFk.js} +10 -10
  15. package/dist/apiClients-CWSwNzGk.js +272 -0
  16. package/dist/authkit.js +10 -10
  17. package/dist/common.js +2 -2
  18. package/dist/composables.js +13 -13
  19. package/dist/feedback.js +2 -2
  20. package/dist/{fetchAuthPageAboutUs-DV7ArpNZ.js → fetchAuthPageAboutUs-CLQlGhQy.js} +2 -2
  21. package/dist/{index-Cn6LcfZO.js → index-BYH7DaQf.js} +1 -1
  22. package/dist/landingPage.js +1 -1
  23. package/dist/main.js +31 -31
  24. package/dist/message.js +5 -5
  25. package/dist/pay.js +4 -4
  26. package/dist/privateCom.js +1 -1
  27. package/dist/referrer.js +1 -1
  28. package/dist/{runtime-Dp7MgwhI.js → runtime-DDJRAtkv.js} +1 -1
  29. package/dist/style.css +1 -1
  30. package/dist/upload.js +2 -2
  31. package/dist/{useAuthkitAppsAuthPageInfo-DZ1p-P3Q.js → useAuthkitAppsAuthPageInfo-2izIyMfu.js} +6 -2
  32. package/dist/{useAuthkitAuth-cHrJMM8E.js → useAuthkitAuth-CWHJs8zY.js} +2 -2
  33. package/dist/{useAuthkitCreateAndUpdate-Bbv7vZZn.js → useAuthkitCreateAndUpdate-COI5KVPJ.js} +1 -1
  34. package/dist/{useAuthkitUsersProfile-8FzLTfUJ.js → useAuthkitUsersProfile-DX2PYmdU.js} +13 -9
  35. package/dist/{useBillingStatusOptions-Br-iL77Z.js → useBillingStatusOptions-C6edto7H.js} +1 -1
  36. package/dist/{useEnsureAuthenticated-C8qS8DLL.js → useEnsureAuthenticated-RZ1DflLz.js} +2 -2
  37. package/dist/{useLegalDocs-C4qk5CTb.js → useLegalDocs-xXYvYpPC.js} +2 -2
  38. package/dist/{useMessageNotifications-D9uikt21.js → useMessageNotifications-pxa5LHjV.js} +1 -1
  39. package/dist/{usePageSEO-Dl6_kBWP.js → usePageSEO-B3stKP3n.js} +2 -2
  40. package/dist/{useRoutePermission-DYPZgvYv.js → useRoutePermission-ZOeRg6Wq.js} +3 -3
  41. package/dist/{useSubscriptionCheckout-CYU2Ke0y.js → useSubscriptionCheckout-DAwwBVAk.js} +3 -3
  42. package/dist/user.js +1 -1
  43. package/dist/utils/passkeySupport.d.ts +1 -1
  44. package/package.json +1 -1
  45. package/dist/apiClients-Ctcq8NZs.js +0 -245
package/dist/upload.js CHANGED
@@ -1,5 +1,5 @@
1
- import { _ as o } from "./Upload.vue_vue_type_script_setup_true_lang-CgZQOZYt.js";
2
- import { b as s, d as p } from "./runtime-Dp7MgwhI.js";
1
+ import { _ as o } from "./Upload.vue_vue_type_script_setup_true_lang-DsrqOACa.js";
2
+ import { b as s, d as p } from "./runtime-DDJRAtkv.js";
3
3
  export {
4
4
  o as Upload,
5
5
  s as createBrowserCosTransport,
@@ -1,5 +1,5 @@
1
1
  import { ref as r } from "vue";
2
- import { g as s } from "./apiClients-Ctcq8NZs.js";
2
+ import { g as s } from "./apiClients-CWSwNzGk.js";
3
3
  function i() {
4
4
  return {
5
5
  type: "doc",
@@ -100,7 +100,11 @@ async function g() {
100
100
  const {
101
101
  data: e,
102
102
  error: l
103
- } = await s().auth.apps.authPageInfo.post({});
103
+ } = await s().auth.apps.authPageInfo.post({
104
+ meta: {
105
+ silentError: !0
106
+ }
107
+ });
104
108
  n.value = !1, !(l || !e) && (f(e), t.value = !0);
105
109
  }
106
110
  function d() {
@@ -1,6 +1,6 @@
1
1
  import { ref as u, computed as h, nextTick as _, readonly as x } from "vue";
2
- import { o as M, g as m, r as $, s as F } from "./apiClients-Ctcq8NZs.js";
3
- import { u as D } from "./useAuthkitAppsAuthPageInfo-DZ1p-P3Q.js";
2
+ import { o as M, g as m, r as $, s as F } from "./apiClients-CWSwNzGk.js";
3
+ import { u as D } from "./useAuthkitAppsAuthPageInfo-2izIyMfu.js";
4
4
  const g = u(!1), w = u(!1);
5
5
  let I;
6
6
  const G = "请先阅读并同意用户协议与隐私政策", K = {
@@ -1,5 +1,5 @@
1
1
  /* empty css */
2
- import "./apiClients-Ctcq8NZs.js";
2
+ import "./apiClients-CWSwNzGk.js";
3
3
  import { Message as u } from "@arco-design/web-vue";
4
4
  import { ref as e } from "vue";
5
5
  function h(o) {
@@ -1,7 +1,7 @@
1
- import { ref as a, computed as l } from "vue";
2
- import { g as c } from "./apiClients-Ctcq8NZs.js";
3
- import { u as i } from "./useAuthkitAuth-cHrJMM8E.js";
4
- const e = a(null), n = a(!1), u = a(!1), o = a(!1);
1
+ import { ref as r, computed as l } from "vue";
2
+ import { g as c } from "./apiClients-CWSwNzGk.js";
3
+ import { u as i } from "./useAuthkitAuth-CWHJs8zY.js";
4
+ const e = r(null), n = r(!1), u = r(!1), o = r(!1);
5
5
  function v() {
6
6
  o.value = !0;
7
7
  }
@@ -30,14 +30,18 @@ async function g() {
30
30
  n.value = !0, u.value = !1;
31
31
  const {
32
32
  data: s,
33
- error: r
34
- } = await c().auth.users.profile.post({});
35
- n.value = !1, s ? e.value = s : p(r == null ? void 0 : r.code) && (e.value = null, console.warn("认证已过期,清除认证状态"), f()), u.value = !0;
33
+ error: a
34
+ } = await c().auth.users.profile.post({
35
+ meta: {
36
+ silentError: !0
37
+ }
38
+ });
39
+ n.value = !1, s ? e.value = s : p(a == null ? void 0 : a.code) && (e.value = null, console.warn("认证已过期,清除认证状态"), f()), u.value = !0;
36
40
  }
37
41
  function m() {
38
42
  e.value = null, n.value = !1, u.value = !0;
39
43
  }
40
- function U() {
44
+ function E() {
41
45
  return {
42
46
  userProfile: e,
43
47
  loading: n,
@@ -51,5 +55,5 @@ function U() {
51
55
  };
52
56
  }
53
57
  export {
54
- U as u
58
+ E as u
55
59
  };
@@ -1,4 +1,4 @@
1
- import { g as s } from "./apiClients-Ctcq8NZs.js";
1
+ import { g as s } from "./apiClients-CWSwNzGk.js";
2
2
  import { ref as c } from "vue";
3
3
  const v = {
4
4
  async productOptions() {
@@ -1,6 +1,6 @@
1
1
  import { computed as f } from "vue";
2
- import { u as r } from "./useAuthkitAuth-cHrJMM8E.js";
3
- import { u as d } from "./apiClients-Ctcq8NZs.js";
2
+ import { u as r } from "./useAuthkitAuth-CWHJs8zY.js";
3
+ import { u as d } from "./apiClients-CWSwNzGk.js";
4
4
  const A = "jwtToken";
5
5
  let e = null, i = !1;
6
6
  async function h(n) {
@@ -1,6 +1,6 @@
1
1
  import { computed as f } from "vue";
2
- import { u as d } from "./useAuthkitAppsAuthPageInfo-DZ1p-P3Q.js";
3
- import { g as L } from "./runtime-Dp7MgwhI.js";
2
+ import { u as d } from "./useAuthkitAppsAuthPageInfo-2izIyMfu.js";
3
+ import { g as L } from "./runtime-DDJRAtkv.js";
4
4
  const c = {
5
5
  userServiceAgreement: "用户服务协议",
6
6
  privacyPolicy: "隐私协议",
@@ -1,5 +1,5 @@
1
1
  import { ref as a, computed as y } from "vue";
2
- import { g as f } from "./apiClients-Ctcq8NZs.js";
2
+ import { g as f } from "./apiClients-CWSwNzGk.js";
3
3
  function z() {
4
4
  const n = a(!0), d = a(""), i = a(!1), g = a(!1), o = a([]), t = a({
5
5
  total: 0,
@@ -1,8 +1,8 @@
1
1
  /* empty css */
2
- import "./apiClients-Ctcq8NZs.js";
2
+ import "./apiClients-CWSwNzGk.js";
3
3
  import { Message as y } from "@arco-design/web-vue";
4
4
  import { ref as a, computed as s, toValue as A } from "vue";
5
- import { u as N } from "./runtime-Dp7MgwhI.js";
5
+ import { u as N } from "./runtime-DDJRAtkv.js";
6
6
  import { useHead as g, useSeoMeta as w } from "@unhead/vue";
7
7
  import { useRoute as E } from "vue-router";
8
8
  function M(t) {
@@ -1,8 +1,8 @@
1
1
  import { computed as g, ref as L, watch as S } from "vue";
2
2
  import { useRouter as w, useRoute as C } from "vue-router";
3
- import { u as k } from "./useAuthkitAppsAuthPageInfo-DZ1p-P3Q.js";
4
- import { u as M } from "./useAuthkitUsersProfile-8FzLTfUJ.js";
5
- import { u as K } from "./useAuthkitAuth-cHrJMM8E.js";
3
+ import { u as k } from "./useAuthkitAppsAuthPageInfo-2izIyMfu.js";
4
+ import { u as M } from "./useAuthkitUsersProfile-DX2PYmdU.js";
5
+ import { u as K } from "./useAuthkitAuth-CWHJs8zY.js";
6
6
  function O(e, s = "default") {
7
7
  const n = document;
8
8
  if (n && typeof n.startViewTransition == "function") {
@@ -1,9 +1,9 @@
1
1
  import { ref as g, computed as q } from "vue";
2
- import { d as z } from "./useBillingStatusOptions-Br-iL77Z.js";
3
- import { g as $ } from "./apiClients-Ctcq8NZs.js";
2
+ import { d as z } from "./useBillingStatusOptions-C6edto7H.js";
3
+ import { g as $ } from "./apiClients-CWSwNzGk.js";
4
4
  /* empty css */
5
5
  import { Message as h } from "@arco-design/web-vue";
6
- import { u as H } from "./useEnsureAuthenticated-C8qS8DLL.js";
6
+ import { u as H } from "./useEnsureAuthenticated-RZ1DflLz.js";
7
7
  function D(e) {
8
8
  var i;
9
9
  const r = (i = e == null ? void 0 : e.metadata) == null ? void 0 : i.originalPrice;
package/dist/user.js CHANGED
@@ -1,4 +1,4 @@
1
- import { U as a, a as n, b as r, c as t, d as U, _ as u, e as i, f as M, g as o, h as m, i as I, j as c, k as d, l as b, m as f } from "./UserMenuInvitationsItem.vue_vue_type_script_setup_true_lang-Di-VAlur.js";
1
+ import { U as a, a as n, b as r, c as t, d as U, _ as u, e as i, f as M, g as o, h as m, i as I, j as c, k as d, l as b, m as f } from "./UserMenuInvitationsItem.vue_vue_type_script_setup_true_lang-COM36ViG.js";
2
2
  export {
3
3
  a as UserAccountMenu,
4
4
  n as UserAvatar,
@@ -2,7 +2,7 @@
2
2
  export declare function isPasskeyEnvironmentReady(): boolean;
3
3
  /** 返回无法使用 Passkey 的原因;为 null 表示环境检测通过 */
4
4
  export declare function getPasskeyEnvironmentIssue(): string | null;
5
- /** 将 WebAuthn 错误转为中文提示 */
5
+ /** 将 WebAuthn / 网络错误转为中文提示 */
6
6
  export declare function formatPasskeyError(error: unknown): string;
7
7
  /** 生成默认 Passkey 名称 */
8
8
  export declare function buildDefaultPasskeyName(): string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@huyooo/ui",
3
- "version": "2.1.3",
3
+ "version": "2.1.4",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "files": [
@@ -1,245 +0,0 @@
1
- import { eden as f, defineMiddleware as p, createClient as U } from "@vafast/api-client";
2
- /* empty css */
3
- import { Message as b } from "@arco-design/web-vue";
4
- import { ref as v, computed as A } from "vue";
5
- function g(e, r = 3) {
6
- const o = e.indexOf("@");
7
- if (o > 1) {
8
- const n = e.slice(0, r), u = e.slice(o);
9
- return n + "***" + u;
10
- }
11
- return e;
12
- }
13
- function E(e) {
14
- const r = e.trim();
15
- return r.length < 7 ? r : `${r.slice(0, 3)}****${r.slice(-4)}`;
16
- }
17
- const j = {
18
- normal: "正常",
19
- pending: "待完善",
20
- forbidden: "已禁用",
21
- deleted: "已注销"
22
- };
23
- function ee(e) {
24
- return e ? j[e] ?? e : "-";
25
- }
26
- function re(e) {
27
- var o, n, u, h, w, m, a, i, t;
28
- const r = [];
29
- if ((o = e.email) != null && o.trim() && r.push(g(e.email.trim())), (n = e.phone) != null && n.trim() && r.push(E(e.phone.trim())), e.wechat) {
30
- const s = (u = e.wechat.nickname) == null ? void 0 : u.trim();
31
- r.push(s ? `微信(${s})` : "微信");
32
- }
33
- return (w = (h = e.github) == null ? void 0 : h.login) != null && w.trim() && r.push(`GitHub(${e.github.login.trim()})`), (a = (m = e.google) == null ? void 0 : m.email) != null && a.trim() && r.push(g(e.google.email.trim())), (t = (i = e.microsoft) == null ? void 0 : i.email) != null && t.trim() && r.push(g(e.microsoft.email.trim())), r.length > 0 ? r.join(" / ") : "-";
34
- }
35
- const k = /* @__PURE__ */ new Set();
36
- function te(e) {
37
- return k.add(e), () => {
38
- k.delete(e);
39
- };
40
- }
41
- function $() {
42
- try {
43
- localStorage.removeItem("jwtToken"), localStorage.removeItem("refreshToken");
44
- } catch (e) {
45
- console.warn("Failed to clear localStorage:", e);
46
- }
47
- k.forEach((e) => e());
48
- }
49
- function ne(e) {
50
- try {
51
- localStorage.setItem("jwtToken", e.jwtToken), localStorage.setItem("refreshToken", e.refreshToken);
52
- } catch (r) {
53
- console.warn("Failed to set localStorage:", r);
54
- }
55
- }
56
- function x() {
57
- try {
58
- return localStorage.getItem("refreshToken");
59
- } catch (e) {
60
- return console.warn("Failed to get refreshToken from localStorage:", e), null;
61
- }
62
- }
63
- function O(e) {
64
- try {
65
- localStorage.setItem("jwtToken", e);
66
- } catch (r) {
67
- console.warn("Failed to update jwtToken in localStorage:", r);
68
- }
69
- }
70
- function z(e) {
71
- return f(e);
72
- }
73
- function H(e) {
74
- return f(e);
75
- }
76
- function L(e) {
77
- return f(e);
78
- }
79
- function D(e) {
80
- return f(e);
81
- }
82
- function F(e) {
83
- return f(e);
84
- }
85
- function N(e) {
86
- return f(e);
87
- }
88
- const S = v(!1), y = v("signIn");
89
- function _(e) {
90
- e != null && e.view && (y.value = e.view), S.value = !0;
91
- }
92
- function B() {
93
- S.value = !1, y.value = "signIn";
94
- }
95
- function q() {
96
- return {
97
- open: _,
98
- close: B,
99
- isOpen: A(() => S.value),
100
- view: A(() => y.value)
101
- };
102
- }
103
- const T = 40101, I = 401;
104
- function J(e) {
105
- var r;
106
- return e.status === I || ((r = e.error) == null ? void 0 : r.code) === I;
107
- }
108
- function G(e) {
109
- var r;
110
- return J(e) && ((r = e.error) == null ? void 0 : r.code) !== T;
111
- }
112
- function K() {
113
- const {
114
- open: e
115
- } = q();
116
- e();
117
- }
118
- function M() {
119
- $(), K();
120
- }
121
- async function V(e) {
122
- const r = x();
123
- if (!r)
124
- throw new Error("No refresh token available");
125
- try {
126
- const n = await (await fetch(`${e.authPrefixUrl}/auth/refresh`, {
127
- method: "POST",
128
- headers: {
129
- "Content-Type": "application/json",
130
- "app-id": e.appId
131
- },
132
- body: JSON.stringify({
133
- refreshToken: r
134
- })
135
- })).json();
136
- if (n.jwtToken)
137
- return O(n.jwtToken), n.refreshToken && localStorage.setItem("refreshToken", n.refreshToken), n.jwtToken;
138
- throw new Error(n.message || "Token refresh failed");
139
- } catch (o) {
140
- throw console.error("Token refresh failed:", o), o;
141
- }
142
- }
143
- function C(e) {
144
- let r = !1, o = [];
145
- function n(a, i = null) {
146
- o.forEach(({
147
- resolve: t,
148
- reject: s
149
- }) => {
150
- a ? s(a) : i && t(i);
151
- }), o = [];
152
- }
153
- const u = p(async (a, i) => (a.headers.set("app-id", e.appId), i()), {
154
- name: "app-id"
155
- }), h = p(async (a, i) => {
156
- const t = e.getAccessToken();
157
- return t && a.headers.set("authorization", `Bearer ${t}`), i();
158
- }, {
159
- name: "token"
160
- }), w = p(async (a, i) => {
161
- var s;
162
- const t = await i();
163
- if (((s = t.error) == null ? void 0 : s.code) !== T)
164
- return t;
165
- if (r)
166
- return new Promise((c, P) => {
167
- o.push({
168
- resolve: async (R) => {
169
- a.headers.set("authorization", `Bearer ${R}`), c(await i());
170
- },
171
- reject: () => P(t)
172
- });
173
- });
174
- r = !0;
175
- try {
176
- const c = await V(e);
177
- return n(null, c), a.headers.set("authorization", `Bearer ${c}`), await i();
178
- } catch (c) {
179
- return n(c, null), M(), t;
180
- } finally {
181
- r = !1;
182
- }
183
- }, {
184
- name: "token-refresh"
185
- }), m = p(async (a, i) => {
186
- const t = await i();
187
- return G(t) ? (M(), t) : (t.error && t.error.code !== T && b.error(t.error.message || "请求失败"), t);
188
- }, {
189
- name: "error-message"
190
- });
191
- return {
192
- appIdMiddleware: u,
193
- tokenMiddleware: h,
194
- tokenRefreshMiddleware: w,
195
- errorMessageMiddleware: m
196
- };
197
- }
198
- function oe(e, r) {
199
- const {
200
- tokenRefreshMiddleware: o,
201
- errorMessageMiddleware: n
202
- } = C(r);
203
- return e.use(o).use(n);
204
- }
205
- function l(e, r) {
206
- return U({
207
- baseURL: e,
208
- timeout: 3e4
209
- }).use(r.appIdMiddleware).use(r.tokenMiddleware).use(r.tokenRefreshMiddleware).use(r.errorMessageMiddleware);
210
- }
211
- function W(e) {
212
- const r = C(e);
213
- return {
214
- auth: H(l(e.authPrefixUrl, r)),
215
- billing: L(l(e.billingPrefixUrl, r)),
216
- ones: F(l(e.onesPrefixUrl, r)),
217
- log: D(l(e.logPrefixUrl, r)),
218
- ai: z(l(e.aiPrefixUrl, r)),
219
- webhook: N(l(e.webhookPrefixUrl, r))
220
- };
221
- }
222
- let d = null;
223
- function ie(e) {
224
- if (d)
225
- throw new Error("Huyooo UI Runtime 已初始化,不能重复创建");
226
- return d = W(e), d;
227
- }
228
- function ae() {
229
- if (!d)
230
- throw new Error("请先在应用入口调用 app.use(createHuyoooUI(config))");
231
- return d;
232
- }
233
- export {
234
- re as b,
235
- C as c,
236
- ee as f,
237
- ae as g,
238
- g as h,
239
- ie as i,
240
- te as o,
241
- $ as r,
242
- ne as s,
243
- q as u,
244
- oe as w
245
- };