@huyooo/ui 2.2.3 → 2.2.7

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 (46) hide show
  1. package/dist/{AuthkitAppSetting-DkkEPenO.js → AuthkitAppSetting-K0qhtQoU.js} +4 -4
  2. package/dist/{Contact-CtfToLPT.js → Contact-CNLjyOCR.js} +92 -89
  3. package/dist/{FeedbackModal.vue_vue_type_script_setup_true_lang-DIIH9PCN.js → FeedbackModal.vue_vue_type_script_setup_true_lang-hbfe8U5u.js} +2 -2
  4. package/dist/{LandingPageLinkGroup-C4iHX7Hz.js → LandingPageLinkGroup-B8ERKG5f.js} +63 -61
  5. package/dist/{LandingPageSectionTabs-Bl6X2W5W.js → LandingPageSectionTabs-BEAnU8B0.js} +1 -1
  6. package/dist/{LegalDocViewer-DZDBRGrC.js → LegalDocViewer-C6yZJ_kH.js} +7 -7
  7. package/dist/{PaySubscriptions-OZ6OFeQJ.js → PaySubscriptions-tJSQUmhE.js} +1 -1
  8. package/dist/{PricingPlans-BdG0qYFZ.js → PricingPlans-BKbMjHaY.js} +3 -3
  9. package/dist/{ReferrerReferees-d4JByWcG.js → ReferrerReferees-BQ0_OW74.js} +1 -1
  10. package/dist/{Upload.vue_vue_type_script_setup_true_lang-DtciAodp.js → Upload.vue_vue_type_script_setup_true_lang-CZjNlns_.js} +1 -1
  11. package/dist/{UserMenuInvitationsItem.vue_vue_type_script_setup_true_lang-BpQa21qc.js → UserMenuInvitationsItem.vue_vue_type_script_setup_true_lang-K5_YUkGs.js} +5 -5
  12. package/dist/WidthContainer-ummelwr_.js +688 -0
  13. package/dist/authkit.js +8 -8
  14. package/dist/common/globalConfig.d.ts +5 -0
  15. package/dist/common.js +1 -1
  16. package/dist/components/MenuItem.vue.d.ts +1 -1
  17. package/dist/components/SvgIcon.vue.d.ts +1 -1
  18. package/dist/composables/Authkit/resolveRoutePermission.d.ts +10 -1
  19. package/dist/composables/Authkit/useAuthkitAppsAuthPageInfo.d.ts +16 -0
  20. package/dist/composables/Authkit/useRoutePermission.d.ts +12 -1
  21. package/dist/composables.d.ts +1 -0
  22. package/dist/composables.js +49 -44
  23. package/dist/feedback.js +1 -1
  24. package/dist/{fetchAuthPageAboutUs-B6ZZylgG.js → fetchAuthPageAboutUs--dArFYk6.js} +2 -2
  25. package/dist/landingPage.js +2 -2
  26. package/dist/main.js +284 -279
  27. package/dist/pay.js +3 -3
  28. package/dist/privateCom.js +1 -1
  29. package/dist/referrer.js +1 -1
  30. package/dist/{runtime-B_xhJ3i8.js → runtime-CDEl4QQl.js} +129 -128
  31. package/dist/style.css +1 -1
  32. package/dist/types/api/auth.generated.d.ts +203 -13
  33. package/dist/types/app.d.ts +13 -0
  34. package/dist/upload.js +2 -2
  35. package/dist/{useAuthkitAppsAuthPageInfo-DPCwzF7j.js → useAuthkitAppsAuthPageInfo-mv7hOnhi.js} +18 -17
  36. package/dist/{useAuthkitAuth-C6GGWqSb.js → useAuthkitAuth-HqXgYzfZ.js} +1 -1
  37. package/dist/{useAuthkitUsersProfile-Bzr0IVmJ.js → useAuthkitUsersProfile-DyjCmUka.js} +1 -1
  38. package/dist/{useEnsureAuthenticated-z30FlElo.js → useEnsureAuthenticated-CpZcAqLg.js} +1 -1
  39. package/dist/{useLegalDocs-CWBqi9Ce.js → useLegalDocs-DUbab5R9.js} +2 -2
  40. package/dist/{usePageSEO-D7eyLr8d.js → usePageSEO-D8CocvOJ.js} +1 -1
  41. package/dist/useRoutePermission-BCXxvMoU.js +249 -0
  42. package/dist/{useSubscriptionCheckout-CnbX1bFi.js → useSubscriptionCheckout-D8W6v3YG.js} +1 -1
  43. package/dist/user.js +1 -1
  44. package/package.json +1 -1
  45. package/dist/WidthContainer-50pahbfe.js +0 -706
  46. package/dist/useRoutePermission-CZ7hHcZy.js +0 -247
@@ -0,0 +1,249 @@
1
+ import { computed as g, ref as T, watch as k } from "vue";
2
+ import { useRouter as R, useRoute as $ } from "vue-router";
3
+ import { u as w } from "./useAuthkitAppsAuthPageInfo-mv7hOnhi.js";
4
+ import { u as I } from "./useAuthkitUsersProfile-DyjCmUka.js";
5
+ import { g as C } from "./runtime-CDEl4QQl.js";
6
+ function j(e, r = "default") {
7
+ const t = document;
8
+ if (t && typeof t.startViewTransition == "function") {
9
+ const n = document.body;
10
+ n.classList.add(`vt-${r}`), t.startViewTransition(() => {
11
+ try {
12
+ e();
13
+ } catch {
14
+ }
15
+ }).finished.finally(() => {
16
+ n.classList.remove(`vt-${r}`);
17
+ });
18
+ } else
19
+ e();
20
+ }
21
+ function E() {
22
+ const {
23
+ appsData: e,
24
+ appsAuthPageInfoSuccess: r
25
+ } = w(), t = R(), n = g(() => r.value), c = g(() => n.value && e.value.applicationLogoUrl || ""), a = g(() => n.value && e.value.name || "");
26
+ function m() {
27
+ j(() => {
28
+ t.push("/"), window.scrollTo({
29
+ top: 0,
30
+ behavior: "smooth"
31
+ });
32
+ });
33
+ }
34
+ return {
35
+ brandReady: n,
36
+ brandLogoUrl: c,
37
+ brandName: a,
38
+ navigateToAppHome: m
39
+ };
40
+ }
41
+ const A = T({
42
+ key: "",
43
+ name: ""
44
+ });
45
+ function F() {
46
+ function e(r, t) {
47
+ A.value.key = r, A.value.name = t;
48
+ }
49
+ return {
50
+ activeDoc: A,
51
+ setActiveDoc: e
52
+ };
53
+ }
54
+ function x(e) {
55
+ const r = /* @__PURE__ */ new Set();
56
+ r.add(e);
57
+ const t = e.split("/").filter(Boolean);
58
+ for (let n = t.length - 1; n > 0; n--)
59
+ r.add(`/${t.slice(0, n).join("/")}`);
60
+ return [...r];
61
+ }
62
+ function M(e, r) {
63
+ const t = new Set(r);
64
+ return t.has("*") ? !0 : x(e).some((n) => t.has(n));
65
+ }
66
+ function O(e) {
67
+ return e.filter((r) => U(r.publicMatch) === "exact").map((r) => r.permissionKey);
68
+ }
69
+ function U(e) {
70
+ return e === "exact" ? "exact" : "prefix";
71
+ }
72
+ function L(e, r) {
73
+ const t = r.map((a) => a.permissionKey);
74
+ if (t.includes("*"))
75
+ return !0;
76
+ const n = new Set(t), c = new Set(O(r));
77
+ return x(e).some((a) => !(!n.has(a) || c.has(a) && e !== a));
78
+ }
79
+ function W(e, r) {
80
+ const t = e.endsWith("/") ? e.slice(0, -1) : e;
81
+ return t === "" ? !1 : M(t, r) || r.some((n) => n === t ? !0 : n.startsWith(`${t}/`));
82
+ }
83
+ function D(e, r) {
84
+ return Array.isArray(e == null ? void 0 : e.menuTypes) ? e.menuTypes.includes(r) : !1;
85
+ }
86
+ function q(e, r, t) {
87
+ for (let n = e.length - 1; n >= 0; n--) {
88
+ const c = e[n];
89
+ if (D(c.meta, r))
90
+ return c.path;
91
+ }
92
+ return t;
93
+ }
94
+ function b(e) {
95
+ return e.split("?")[0].split("#")[0];
96
+ }
97
+ function G(e, r, t) {
98
+ const n = b(r), c = (t == null ? void 0 : t.returnParentOnChildMatch) ?? !1;
99
+ function a(f, p) {
100
+ for (const l of f) {
101
+ if (b(l.path) === p)
102
+ return l.path;
103
+ if (l.children && l.children.length > 0) {
104
+ const o = a(l.children, p);
105
+ if (o)
106
+ return c ? l.path : o;
107
+ }
108
+ }
109
+ return null;
110
+ }
111
+ const m = a(e, n);
112
+ if (m)
113
+ return m;
114
+ for (const f of e) {
115
+ const p = b(f.path);
116
+ if (n.startsWith(p + "/") || n === p) {
117
+ if (f.children && f.children.length > 0)
118
+ for (const l of f.children) {
119
+ const v = b(l.path);
120
+ if (n.startsWith(v + "/") || n === v)
121
+ return c ? f.path : l.path;
122
+ }
123
+ return f.path;
124
+ }
125
+ }
126
+ return t != null && t.fallback ? t.fallback(n) : n;
127
+ }
128
+ function J(e) {
129
+ const r = R(), {
130
+ appsData: t
131
+ } = w(), {
132
+ isLoggedIn: n,
133
+ userProfile: c
134
+ } = I(), a = g(() => {
135
+ var o;
136
+ return !n.value || !c.value ? [] : ((o = c.value.permissions) == null ? void 0 : o.map((s) => s.permissionKey)) || [];
137
+ });
138
+ function m(o) {
139
+ return L(o, t.value.publicRoutes || []);
140
+ }
141
+ function f(o) {
142
+ return n.value ? M(o, a.value) : !1;
143
+ }
144
+ function p(o) {
145
+ var s;
146
+ return {
147
+ path: o.path,
148
+ name: o.name,
149
+ meta: o.meta,
150
+ children: (s = o.children) == null ? void 0 : s.map((d) => p(d))
151
+ };
152
+ }
153
+ function l(o, s) {
154
+ const d = [];
155
+ for (const u of o) {
156
+ if (u.path === "/" || u.path === "/:catchAll(.*)")
157
+ continue;
158
+ const i = u.meta;
159
+ if (D(i, s)) {
160
+ const P = u.path;
161
+ if (m(P) || W(P, a.value)) {
162
+ const h = {
163
+ name: (i == null ? void 0 : i.menuName) || (i == null ? void 0 : i.title) || (typeof u.name == "string" ? u.name : u.path),
164
+ path: u.path,
165
+ icon: (i == null ? void 0 : i.menuIcon) || (i == null ? void 0 : i.icon),
166
+ description: (i == null ? void 0 : i.menuDescription) || (i == null ? void 0 : i.description),
167
+ hidden: i == null ? void 0 : i.hidden
168
+ };
169
+ if (u.children && u.children.length > 0) {
170
+ const y = l(u.children, s);
171
+ y.length > 0 && (h.children = y);
172
+ }
173
+ d.push(h);
174
+ }
175
+ } else if (u.children && u.children.length > 0) {
176
+ const P = l(u.children, s);
177
+ d.push(...P);
178
+ }
179
+ }
180
+ return d;
181
+ }
182
+ return {
183
+ menus: g(() => {
184
+ if (!e)
185
+ return [];
186
+ const o = r.getRoutes(), s = o.find((h) => h.path === "/"), d = s != null && s.children ? s.children.map((h) => p(h)) : [], u = new Set(d.map((h) => h.path)), P = o.filter((h) => h.path === "/" || h.path === "/:catchAll(.*)" || u.has(h.path) ? !1 : h.path.split("/").filter((K) => K).length === 1).map(p), S = [...d, ...P];
187
+ return l(S, e);
188
+ }),
189
+ isRoutePublic: m,
190
+ hasPermission: (o) => m(o) ? !0 : f(o),
191
+ isLoggedIn: n
192
+ };
193
+ }
194
+ function Q() {
195
+ const e = R(), r = $(), {
196
+ appsData: t,
197
+ appsAuthPageInfoSuccess: n
198
+ } = w(), {
199
+ userProfile: c,
200
+ isLoggedIn: a,
201
+ usersProfileReady: m
202
+ } = I();
203
+ function f() {
204
+ return t.value.publicRoutes || [];
205
+ }
206
+ function p(s) {
207
+ return L(s, f());
208
+ }
209
+ function l(s) {
210
+ var u;
211
+ if (!a.value || !c.value)
212
+ return !1;
213
+ const d = ((u = c.value.permissions) == null ? void 0 : u.map((i) => i.permissionKey)) || [];
214
+ return M(s, d);
215
+ }
216
+ function v() {
217
+ const s = C().config.accessDeniedUrl || "/";
218
+ e.replace(s);
219
+ }
220
+ function o(s) {
221
+ p(s) || !n.value || !m.value || (!a.value || !l(s)) && v();
222
+ }
223
+ return k([() => r.path, n, m, a, () => f().map((s) => `${s.permissionKey}:${s.publicMatch || "prefix"}`).join("|"), () => {
224
+ var s;
225
+ return (((s = c.value) == null ? void 0 : s.permissions) || []).map((d) => d.permissionKey).join("|");
226
+ }], () => {
227
+ o(r.path);
228
+ }, {
229
+ immediate: !0
230
+ }), {
231
+ isRoutePublic: p,
232
+ hasPermission: l
233
+ };
234
+ }
235
+ export {
236
+ q as a,
237
+ M as b,
238
+ x as c,
239
+ E as d,
240
+ J as e,
241
+ G as f,
242
+ b as g,
243
+ W as h,
244
+ L as i,
245
+ Q as j,
246
+ O as r,
247
+ F as u,
248
+ j as w
249
+ };
@@ -3,7 +3,7 @@ import { d as V } from "./useBillingStatusOptions-C8fwW-AI.js";
3
3
  import { g as $ } from "./apiClients-8_c5cDW5.js";
4
4
  /* empty css */
5
5
  import { Message as b } from "@arco-design/web-vue";
6
- import { u as _ } from "./useEnsureAuthenticated-z30FlElo.js";
6
+ import { u as _ } from "./useEnsureAuthenticated-CpZcAqLg.js";
7
7
  function D(e) {
8
8
  var u;
9
9
  const i = (u = e == null ? void 0 : e.metadata) == null ? void 0 : u.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-BpQa21qc.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-K5_YUkGs.js";
2
2
  export {
3
3
  a as UserAccountMenu,
4
4
  n as UserAvatar,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@huyooo/ui",
3
- "version": "2.2.3",
3
+ "version": "2.2.7",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "files": [