@huyooo/ui 3.0.2 → 4.0.2

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 (64) hide show
  1. package/dist/{AuthkitAppSetting-DNUAV5I8.js → AuthkitAppSetting-Cg8j3nES.js} +41 -42
  2. package/dist/{Contact-CNLjyOCR.js → Contact-D9NRguTE.js} +4 -4
  3. package/dist/{CustomTable-B1KjkixL.js → CustomTable-C15Dgbks.js} +4 -4
  4. package/dist/{FeedbackItem-BP-SiJ2u.js → FeedbackItem-hnJ7YXdE.js} +1 -1
  5. package/dist/FeedbackModal.vue_vue_type_script_setup_true_lang-Ddy1jcdL.js +1526 -0
  6. package/dist/{LandingPageSectionTabs-BEAnU8B0.js → LandingPageSectionTabs-BJQeq3V5.js} +515 -402
  7. package/dist/{LegalDocViewer-B8nGoL2n.js → LegalDocViewer-BuzKCAfO.js} +44 -45
  8. package/dist/{Menu-uCexrsKP.js → Menu-C6NA8hCs.js} +1 -1
  9. package/dist/{MessageHandle-BKMBtqZM.js → MessageHandle-Cu23QspL.js} +13 -14
  10. package/dist/{MessageList-BK4u5DCH.js → MessageList-DdDKl9wk.js} +6 -7
  11. package/dist/{PaySubscriptions-tJSQUmhE.js → PaySubscriptions-ZSvRTG2i.js} +14 -15
  12. package/dist/{PricingPlans-B3HVDVac.js → PricingPlans-DTGJ-_us.js} +13 -14
  13. package/dist/{ReferrerReferees-DEdEjkFH.js → ReferrerReferees-gkKtDau-.js} +25 -26
  14. package/dist/{Upload.vue_vue_type_script_setup_true_lang-CZjNlns_.js → Upload.vue_vue_type_script_setup_true_lang-C6B5_Hjo.js} +2 -2
  15. package/dist/{UserMenuInvitationsItem.vue_vue_type_script_setup_true_lang-Bal7vFj8.js → UserMenuInvitationsItem.vue_vue_type_script_setup_true_lang-BH6l-SKs.js} +34 -35
  16. package/dist/{WidthContainer-Ck7Cr5Wc.js → WidthContainer-DXwIiG2x.js} +32 -32
  17. package/dist/{apiClients-8_c5cDW5.js → apiClients-5u4_uxFE.js} +47 -48
  18. package/dist/authkit.js +10 -10
  19. package/dist/common/globalConfig.d.ts +4 -4
  20. package/dist/common.js +3 -3
  21. package/dist/components/LandingPage/LandingPageHero.vue.d.ts +22 -0
  22. package/dist/components/Pay/PricingPlans.vue.d.ts +1 -1
  23. package/dist/composables/Authkit/useAuthkitAppsAuthPageInfo.d.ts +21 -0
  24. package/dist/composables/useAccessPosture.d.ts +31 -0
  25. package/dist/composables.d.ts +1 -0
  26. package/dist/composables.js +53 -49
  27. package/dist/feedback.js +3 -3
  28. package/dist/{fetchAuthPageAboutUs--dArFYk6.js → fetchAuthPageAboutUs-C-jQ44QK.js} +2 -2
  29. package/dist/{index-D9YtlhTa.js → index-5OR_BVTz.js} +4 -5
  30. package/dist/{index-D56hUMeD.js → index-BIxwv9Xs.js} +1 -1
  31. package/dist/landingPage.js +1 -1
  32. package/dist/legalDocs/constants.d.ts +1 -0
  33. package/dist/main.js +266 -262
  34. package/dist/message.js +36 -37
  35. package/dist/pay.js +5 -5
  36. package/dist/privateCom.js +1 -1
  37. package/dist/referrer.js +1 -1
  38. package/dist/{runtime-CDEl4QQl.js → runtime-B-tHI8-q.js} +191 -186
  39. package/dist/style.css +1 -1
  40. package/dist/types/api/auth.generated.d.ts +188 -37
  41. package/dist/types/api/ones.generated.d.ts +1512 -364
  42. package/dist/types/app.d.ts +9 -0
  43. package/dist/types/auth.d.ts +2 -1
  44. package/dist/upload.js +2 -2
  45. package/dist/useAccessPosture-DBNTLWQn.js +219 -0
  46. package/dist/{useAuthkitAppsAuthPageInfo-mv7hOnhi.js → useAuthkitAppsAuthPageInfo-CsivtUQH.js} +40 -33
  47. package/dist/{useAuthkitAuth-DSC6QSKm.js → useAuthkitAuth-CV60Hc3o.js} +2 -2
  48. package/dist/useAuthkitCreateAndUpdate-DJIn96EE.js +24 -0
  49. package/dist/{useAuthkitUsersProfile-DSd5VA3_.js → useAuthkitUsersProfile-CQOLEAxC.js} +3 -3
  50. package/dist/{useBillingStatusOptions-C8fwW-AI.js → useBillingStatusOptions-BHVLZhEB.js} +1 -1
  51. package/dist/{useBillingSubscriptionSummary-C2E3p68U.js → useBillingSubscriptionSummary-DakAVL-3.js} +1 -1
  52. package/dist/{useEnsureAuthenticated-COQKiCLk.js → useEnsureAuthenticated-BYGI2uYZ.js} +2 -2
  53. package/dist/{useLegalDocs-DUbab5R9.js → useLegalDocs-BrYWCDh3.js} +6 -5
  54. package/dist/{useMessageNotifications-BXimltcx.js → useMessageNotifications-Dcl8TXr-.js} +1 -1
  55. package/dist/{usePageSEO-D8CocvOJ.js → usePageSEO-BHYaXnDU.js} +12 -13
  56. package/dist/useRoutePermission-BkWHsFxN.js +212 -0
  57. package/dist/{useSubscriptionCheckout-LrwlCr84.js → useSubscriptionCheckout-QSNro05_.js} +17 -18
  58. package/dist/user.js +1 -1
  59. package/dist/{userMenuModal-D-nDaYqM.js → userMenuModal-B4m4CHlW.js} +1 -1
  60. package/package.json +1 -1
  61. package/dist/FeedbackModal.vue_vue_type_script_setup_true_lang-DEuryJ4s.js +0 -1516
  62. package/dist/_commonjsHelpers-DaMA6jEr.js +0 -8
  63. package/dist/useAuthkitCreateAndUpdate-CYIcEuub.js +0 -25
  64. package/dist/useRoutePermission-DgQlbUBI.js +0 -249
@@ -0,0 +1,212 @@
1
+ import { ref as C, computed as M, watch as L } from "vue";
2
+ import { useRouter as S, useRoute as O } from "vue-router";
3
+ import { u as x } from "./useAuthkitAppsAuthPageInfo-CsivtUQH.js";
4
+ import { u as I } from "./useAuthkitUsersProfile-CQOLEAxC.js";
5
+ import { g as W } from "./runtime-B-tHI8-q.js";
6
+ const R = C({
7
+ key: "",
8
+ name: ""
9
+ });
10
+ function H() {
11
+ function e(s, n) {
12
+ R.value.key = s, R.value.name = n;
13
+ }
14
+ return {
15
+ activeDoc: R,
16
+ setActiveDoc: e
17
+ };
18
+ }
19
+ function w(e) {
20
+ const s = /* @__PURE__ */ new Set();
21
+ s.add(e);
22
+ const n = e.split("/").filter(Boolean);
23
+ for (let t = n.length - 1; t > 0; t--)
24
+ s.add(`/${n.slice(0, t).join("/")}`);
25
+ return [...s];
26
+ }
27
+ function y(e, s) {
28
+ const n = new Set(s);
29
+ return n.has("*") ? !0 : w(e).some((t) => n.has(t));
30
+ }
31
+ function $(e) {
32
+ return e.filter((s) => j(s.publicMatch) === "exact").map((s) => s.permissionKey);
33
+ }
34
+ function j(e) {
35
+ return e === "exact" ? "exact" : "prefix";
36
+ }
37
+ function D(e, s) {
38
+ const n = s.map((a) => a.permissionKey);
39
+ if (n.includes("*"))
40
+ return !0;
41
+ const t = new Set(n), l = new Set($(s));
42
+ return w(e).some((a) => !(!t.has(a) || l.has(a) && e !== a));
43
+ }
44
+ function z(e, s) {
45
+ const n = e.endsWith("/") ? e.slice(0, -1) : e;
46
+ return n === "" ? !1 : y(n, s) || s.some((t) => t === n ? !0 : t.startsWith(`${n}/`));
47
+ }
48
+ function K(e, s) {
49
+ return Array.isArray(e == null ? void 0 : e.menuTypes) ? e.menuTypes.includes(s) : !1;
50
+ }
51
+ function N(e, s, n) {
52
+ for (let t = e.length - 1; t >= 0; t--) {
53
+ const l = e[t];
54
+ if (K(l.meta, s))
55
+ return l.path;
56
+ }
57
+ return n;
58
+ }
59
+ function g(e) {
60
+ return e.split("?")[0].split("#")[0];
61
+ }
62
+ function q(e, s, n) {
63
+ const t = g(s), l = (n == null ? void 0 : n.returnParentOnChildMatch) ?? !1;
64
+ function a(f, p) {
65
+ for (const o of f) {
66
+ if (g(o.path) === p)
67
+ return o.path;
68
+ if (o.children && o.children.length > 0) {
69
+ const u = a(o.children, p);
70
+ if (u)
71
+ return l ? o.path : u;
72
+ }
73
+ }
74
+ return null;
75
+ }
76
+ const d = a(e, t);
77
+ if (d)
78
+ return d;
79
+ for (const f of e) {
80
+ const p = g(f.path);
81
+ if (t.startsWith(p + "/") || t === p) {
82
+ if (f.children && f.children.length > 0)
83
+ for (const o of f.children) {
84
+ const P = g(o.path);
85
+ if (t.startsWith(P + "/") || t === P)
86
+ return l ? f.path : o.path;
87
+ }
88
+ return f.path;
89
+ }
90
+ }
91
+ return n != null && n.fallback ? n.fallback(t) : t;
92
+ }
93
+ function G(e) {
94
+ const s = S(), {
95
+ appsData: n
96
+ } = x(), {
97
+ isLoggedIn: t,
98
+ userProfile: l
99
+ } = I(), a = M(() => {
100
+ var u;
101
+ return !t.value || !l.value ? [] : ((u = l.value.permissions) == null ? void 0 : u.map((r) => r.permissionKey)) || [];
102
+ });
103
+ function d(u) {
104
+ return D(u, n.value.publicRoutes || []);
105
+ }
106
+ function f(u) {
107
+ return t.value ? y(u, a.value) : !1;
108
+ }
109
+ function p(u) {
110
+ var r;
111
+ return {
112
+ path: u.path,
113
+ name: u.name,
114
+ meta: u.meta,
115
+ children: (r = u.children) == null ? void 0 : r.map((m) => p(m))
116
+ };
117
+ }
118
+ function o(u, r) {
119
+ const m = [];
120
+ for (const c of u) {
121
+ if (c.path === "/" || c.path === "/:catchAll(.*)")
122
+ continue;
123
+ const i = c.meta;
124
+ if (K(i, r)) {
125
+ const v = c.path;
126
+ if (d(v) || z(v, a.value)) {
127
+ const h = {
128
+ name: (i == null ? void 0 : i.menuName) || (i == null ? void 0 : i.title) || (typeof c.name == "string" ? c.name : c.path),
129
+ path: c.path,
130
+ icon: (i == null ? void 0 : i.menuIcon) || (i == null ? void 0 : i.icon),
131
+ description: (i == null ? void 0 : i.menuDescription) || (i == null ? void 0 : i.description),
132
+ hidden: i == null ? void 0 : i.hidden
133
+ };
134
+ if (c.children && c.children.length > 0) {
135
+ const A = o(c.children, r);
136
+ A.length > 0 && (h.children = A);
137
+ }
138
+ m.push(h);
139
+ }
140
+ } else if (c.children && c.children.length > 0) {
141
+ const v = o(c.children, r);
142
+ m.push(...v);
143
+ }
144
+ }
145
+ return m;
146
+ }
147
+ return {
148
+ menus: M(() => {
149
+ if (!e)
150
+ return [];
151
+ const u = s.getRoutes(), r = u.find((h) => h.path === "/"), m = r != null && r.children ? r.children.map((h) => p(h)) : [], c = new Set(m.map((h) => h.path)), v = u.filter((h) => h.path === "/" || h.path === "/:catchAll(.*)" || c.has(h.path) ? !1 : h.path.split("/").filter((k) => k).length === 1).map(p), b = [...m, ...v];
152
+ return o(b, e);
153
+ }),
154
+ isRoutePublic: d,
155
+ hasPermission: (u) => d(u) ? !0 : f(u),
156
+ isLoggedIn: t
157
+ };
158
+ }
159
+ function J() {
160
+ const e = S(), s = O(), {
161
+ appsData: n,
162
+ appsAuthPageInfoSuccess: t
163
+ } = x(), {
164
+ userProfile: l,
165
+ isLoggedIn: a,
166
+ usersProfileReady: d
167
+ } = I();
168
+ function f() {
169
+ return n.value.publicRoutes || [];
170
+ }
171
+ function p(r) {
172
+ return D(r, f());
173
+ }
174
+ function o(r) {
175
+ var c;
176
+ if (!a.value || !l.value)
177
+ return !1;
178
+ const m = ((c = l.value.permissions) == null ? void 0 : c.map((i) => i.permissionKey)) || [];
179
+ return y(r, m);
180
+ }
181
+ function P() {
182
+ const r = W().config.accessDeniedUrl || "/";
183
+ e.replace(r);
184
+ }
185
+ function u(r) {
186
+ p(r) || !t.value || !d.value || (!a.value || !o(r)) && P();
187
+ }
188
+ return L([() => s.path, t, d, a, () => f().map((r) => `${r.permissionKey}:${r.publicMatch || "prefix"}`).join("|"), () => {
189
+ var r;
190
+ return (((r = l.value) == null ? void 0 : r.permissions) || []).map((m) => m.permissionKey).join("|");
191
+ }], () => {
192
+ u(s.path);
193
+ }, {
194
+ immediate: !0
195
+ }), {
196
+ isRoutePublic: p,
197
+ hasPermission: o
198
+ };
199
+ }
200
+ export {
201
+ N as a,
202
+ y as b,
203
+ w as c,
204
+ G as d,
205
+ J as e,
206
+ q as f,
207
+ g,
208
+ z as h,
209
+ D as i,
210
+ $ as r,
211
+ H as u
212
+ };
@@ -1,9 +1,8 @@
1
1
  import { ref as v, computed as S } from "vue";
2
- import { d as V } from "./useBillingStatusOptions-C8fwW-AI.js";
3
- import { g as $ } from "./apiClients-8_c5cDW5.js";
4
- /* empty css */
2
+ import { d as V } from "./useBillingStatusOptions-BHVLZhEB.js";
3
+ import { g as $ } from "./apiClients-5u4_uxFE.js";
5
4
  import { Message as b } from "@arco-design/web-vue";
6
- import { u as _ } from "./useEnsureAuthenticated-COQKiCLk.js";
5
+ import { u as _ } from "./useEnsureAuthenticated-BYGI2uYZ.js";
7
6
  function D(e) {
8
7
  var u;
9
8
  const i = (u = e == null ? void 0 : e.metadata) == null ? void 0 : u.originalPrice;
@@ -131,7 +130,7 @@ function ee(e) {
131
130
  function B() {
132
131
  return !!localStorage.getItem("jwtToken");
133
132
  }
134
- function ae(e = "month") {
133
+ function ce(e = "month") {
135
134
  const i = v([]), u = v(null), c = v(null), a = v(!1), s = v(!1), d = v(ee(e)), f = S(() => {
136
135
  const n = /* @__PURE__ */ new Map();
137
136
  for (const t of i.value)
@@ -144,7 +143,7 @@ function ae(e = "month") {
144
143
  label: J(t.interval, t.intervalCount),
145
144
  badge: Z(i.value, t.key)
146
145
  }));
147
- }), p = S(() => {
146
+ }), y = S(() => {
148
147
  const n = [];
149
148
  for (const t of i.value) {
150
149
  const r = t.prices.find((g) => {
@@ -162,7 +161,7 @@ function ae(e = "month") {
162
161
  function F(n) {
163
162
  d.value = n;
164
163
  }
165
- function y(n) {
164
+ function p(n) {
166
165
  const t = u.value, r = c.value;
167
166
  return t != null && t.priceId && n.selectedPrice ? t.priceId === n.selectedPrice.id : t ? t.productId === n.id : r != null && r.priceId && n.selectedPrice ? r.priceId === n.selectedPrice.id : r ? r.productId === n.id : !1;
168
167
  }
@@ -178,7 +177,7 @@ function ae(e = "month") {
178
177
  return !!u.value;
179
178
  }
180
179
  function E(n) {
181
- return !!(!n.selectedPrice || y(n) || m(n) && U());
180
+ return !!(!n.selectedPrice || p(n) || m(n) && U());
182
181
  }
183
182
  function w(n) {
184
183
  var t;
@@ -204,7 +203,7 @@ function ae(e = "month") {
204
203
  }
205
204
  function T(n) {
206
205
  const t = [];
207
- return y(n) ? t.push({
206
+ return p(n) ? t.push({
208
207
  label: "当前方案",
209
208
  type: "current"
210
209
  }) : m(n) ? t.push({
@@ -217,7 +216,7 @@ function ae(e = "month") {
217
216
  }
218
217
  function N(n) {
219
218
  const t = u.value;
220
- return y(n) ? "当前方案" : m(n) ? t ? "已订阅付费方案" : B() ? "免费开通" : "免费注册" : t ? C(n) ? "切换周期" : typeof t.unitAmount == "number" && n.selectedPrice.unitAmount > t.unitAmount ? "升级方案" : "切换方案" : "立即订阅";
219
+ return p(n) ? "当前方案" : m(n) ? t ? "已订阅付费方案" : B() ? "免费开通" : "免费注册" : t ? C(n) ? "切换周期" : typeof t.unitAmount == "number" && n.selectedPrice.unitAmount > t.unitAmount ? "升级方案" : "切换方案" : "立即订阅";
221
220
  }
222
221
  function R(n, t) {
223
222
  const r = n.features.find((o) => o.type === "quota" && o.value !== void 0);
@@ -314,7 +313,7 @@ function ae(e = "month") {
314
313
  }
315
314
  return {
316
315
  products: i,
317
- plans: p,
316
+ plans: y,
318
317
  currentSubscription: u,
319
318
  currentTrial: c,
320
319
  listLoading: a,
@@ -322,7 +321,7 @@ function ae(e = "month") {
322
321
  billingInterval: d,
323
322
  billingIntervalTabs: f,
324
323
  setBillingInterval: F,
325
- isCurrentPlan: y,
324
+ isCurrentPlan: p,
326
325
  isSameProduct: C,
327
326
  isRecommendedPlan: w,
328
327
  isFreePlan: m,
@@ -350,7 +349,7 @@ function ne(e) {
350
349
  function re(e) {
351
350
  return e && typeof e == "object" && "alipayUrl" in e && typeof e.alipayUrl == "string" ? e.alipayUrl : "";
352
351
  }
353
- function de(e) {
352
+ function ae(e) {
354
353
  const i = v(null), {
355
354
  ensureAuthenticated: u
356
355
  } = _();
@@ -377,9 +376,9 @@ function de(e) {
377
376
  });
378
377
  if (i.value = null, f.error)
379
378
  return;
380
- const p = re(f.data);
381
- if (p) {
382
- te(p);
379
+ const y = re(f.data);
380
+ if (y) {
381
+ te(y);
383
382
  return;
384
383
  }
385
384
  b.success(ne(f.data) || "订阅已更新"), await e.refreshCurrentSubscription();
@@ -394,6 +393,6 @@ function de(e) {
394
393
  };
395
394
  }
396
395
  export {
397
- de as a,
398
- ae as u
396
+ ae as a,
397
+ ce as u
399
398
  };
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-Bal7vFj8.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-BH6l-SKs.js";
2
2
  export {
3
3
  a as UserAccountMenu,
4
4
  n as UserAvatar,
@@ -1,4 +1,4 @@
1
- /* empty css */
1
+ import "./apiClients-5u4_uxFE.js";
2
2
  import { defineComponent as f, ref as m, openBlock as i, createElementBlock as n, createVNode as d, unref as a, createCommentVNode as r } from "vue";
3
3
  import { Spin as p, Empty as h } from "@arco-design/web-vue";
4
4
  import { useIntersectionObserver as u } from "@vueuse/core";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@huyooo/ui",
3
- "version": "3.0.2",
3
+ "version": "4.0.2",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "files": [