@huyooo/ui 0.17.1 → 0.17.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.
@@ -41,6 +41,6 @@ export declare function useSEO(): {
41
41
  };
42
42
  /**
43
43
  * 自动从当前路由的 meta 信息设置页面 SEO
44
- * 必须在 Vue 组件中使用
44
+ * 必须在已 app.use(router) 的 Vue 组件中使用;宿主 Vite 需 dedupe vue-router
45
45
  */
46
46
  export declare function useRouteSEO(): void;
@@ -5,7 +5,7 @@ import { u as h } from "./useAuthkitUsersProfile-BZDk21c8.js";
5
5
  import { u as S } from "./useAuthkitAppsAuthPageInfo-DWd0bDP-.js";
6
6
  import { u as C } from "./useAuthkitCreateAndUpdate-oo9517Gj.js";
7
7
  import { u as d } from "./useMessageNotifications-D85_-mDq.js";
8
- import { u as O, a as T, b as P, c as R } from "./useSEO-C6DLicfe.js";
8
+ import { u as O, a as T, b as P, c as R } from "./useSEO-BSMQdBR9.js";
9
9
  import { u as E } from "./useTableHandle-BdujaiNX.js";
10
10
  import { f as k, a as _, g as I, u as M, b as B, c as w, w as F } from "./useRoutePermission-chEi45Nb.js";
11
11
  import { u as v } from "./useUploadCos-BRKRzSy3.js";
package/dist/main.js CHANGED
@@ -7,8 +7,8 @@ import { u as u3 } from "./useAuthkitUsersProfile-BZDk21c8.js";
7
7
  import { u as _3 } from "./useAuthkitAppsAuthPageInfo-DWd0bDP-.js";
8
8
  import { u as L3 } from "./useAuthkitCreateAndUpdate-oo9517Gj.js";
9
9
  import { u as F3 } from "./useMessageNotifications-D85_-mDq.js";
10
- import { a as R } from "./useSEO-C6DLicfe.js";
11
- import { u as y3, b as M3, c as x3 } from "./useSEO-C6DLicfe.js";
10
+ import { a as R } from "./useSEO-BSMQdBR9.js";
11
+ import { u as y3, b as M3, c as x3 } from "./useSEO-BSMQdBR9.js";
12
12
  import { u as Z3 } from "./useTableHandle-BdujaiNX.js";
13
13
  import { f as U3, a as H3, g as E3, u as k3, b as S3, c as A3, w as G3 } from "./useRoutePermission-chEi45Nb.js";
14
14
  import { u as D3 } from "./useUploadCos-BRKRzSy3.js";
@@ -0,0 +1,158 @@
1
+ /* empty css */
2
+ import { g } from "./apiClients-DrGX2iJy.js";
3
+ import { Message as f } from "@arco-design/web-vue";
4
+ import { ref as i, getCurrentInstance as w, computed as a } from "vue";
5
+ import { useHead as p, useSeoMeta as m } from "@unhead/vue";
6
+ import { useRoute as v } from "vue-router";
7
+ function C(o) {
8
+ const n = i(!1), t = i(), e = i(!1), s = i(""), u = i("");
9
+ function l(c) {
10
+ f.success(c), e.value = !1, n.value = !1, o("confirm");
11
+ }
12
+ function r() {
13
+ e.value = !1, o("cancel");
14
+ }
15
+ return {
16
+ loading: n,
17
+ formRef: t,
18
+ submitSuccess: l,
19
+ modelType: s,
20
+ changeType: u,
21
+ show: e,
22
+ handleCancel: r
23
+ };
24
+ }
25
+ function I() {
26
+ const o = i([]), n = i(!1), t = i(""), e = i("");
27
+ async function s() {
28
+ n.value = !0, t.value = "";
29
+ try {
30
+ const l = await (await fetch(`${g.onesPrefixUrl}/releases/latest`, {
31
+ method: "POST",
32
+ headers: {
33
+ "Content-Type": "application/json",
34
+ "app-id": g.appId
35
+ },
36
+ body: JSON.stringify({})
37
+ })).json();
38
+ e.value = l.version, o.value = l.downloads.map((r) => {
39
+ const c = {
40
+ id: r.id,
41
+ name: r.name,
42
+ description: r.description,
43
+ version: r.version,
44
+ updateDate: r.updateDate,
45
+ icon: "",
46
+ downloadUrl: r.downloadUrl,
47
+ platform: r.platform,
48
+ requirements: r.requirements
49
+ };
50
+ return r.arch && (c.arch = r.arch), r.badge && (c.badge = r.badge), c;
51
+ });
52
+ } catch {
53
+ t.value = "获取版本信息失败,请刷新重试";
54
+ } finally {
55
+ n.value = !1;
56
+ }
57
+ }
58
+ return {
59
+ downloads: o,
60
+ loading: n,
61
+ error: t,
62
+ version: e,
63
+ fetchDownloads: s
64
+ };
65
+ }
66
+ function O() {
67
+ function o(t) {
68
+ m({
69
+ ogSiteName: t.siteName,
70
+ ogLocale: t.locale
71
+ });
72
+ }
73
+ function n(t) {
74
+ const {
75
+ title: e,
76
+ description: s,
77
+ keywords: u,
78
+ image: l,
79
+ url: r,
80
+ type: c = "website"
81
+ } = t, d = s && s.length > 155 ? `${s.substring(0, 152)}...` : s;
82
+ p({
83
+ title: e,
84
+ link: r ? [{
85
+ rel: "canonical",
86
+ href: r
87
+ }] : []
88
+ }), m({
89
+ description: d || s,
90
+ keywords: u,
91
+ ogTitle: e,
92
+ ogDescription: d || s,
93
+ ogType: c === "product" ? void 0 : c,
94
+ // product 类型不被支持,跳过
95
+ ogUrl: r,
96
+ ogImage: l,
97
+ twitterCard: "summary_large_image",
98
+ twitterTitle: e,
99
+ twitterDescription: d || s,
100
+ twitterImage: l
101
+ });
102
+ }
103
+ return {
104
+ setGlobalSEO: o,
105
+ setPageSEO: n
106
+ };
107
+ }
108
+ function U() {
109
+ if (!w())
110
+ return;
111
+ const o = v();
112
+ if (!(o != null && o.meta))
113
+ return;
114
+ const n = () => o.meta;
115
+ p({
116
+ title: a(() => n().title || ""),
117
+ link: a(() => {
118
+ const t = n();
119
+ return t.url ? [{
120
+ rel: "canonical",
121
+ href: t.url
122
+ }] : [];
123
+ })
124
+ }), m({
125
+ description: a(() => {
126
+ const e = n().description;
127
+ if (e)
128
+ return e.length > 155 ? `${e.substring(0, 152)}...` : e;
129
+ }),
130
+ keywords: a(() => n().keywords),
131
+ ogTitle: a(() => n().title),
132
+ ogDescription: a(() => {
133
+ const e = n().description;
134
+ if (e)
135
+ return e.length > 155 ? `${e.substring(0, 152)}...` : e;
136
+ }),
137
+ ogType: a(() => {
138
+ const e = n().type || "website";
139
+ return e === "product" ? void 0 : e;
140
+ }),
141
+ ogUrl: a(() => n().url),
142
+ ogImage: a(() => n().image),
143
+ twitterCard: "summary_large_image",
144
+ twitterTitle: a(() => n().title),
145
+ twitterDescription: a(() => {
146
+ const e = n().description;
147
+ if (e)
148
+ return e.length > 155 ? `${e.substring(0, 152)}...` : e;
149
+ }),
150
+ twitterImage: a(() => n().image)
151
+ });
152
+ }
153
+ export {
154
+ I as a,
155
+ U as b,
156
+ O as c,
157
+ C as u
158
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@huyooo/ui",
3
- "version": "0.17.1",
3
+ "version": "0.17.2",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "files": [
@@ -1,153 +0,0 @@
1
- /* empty css */
2
- import { g } from "./apiClients-DrGX2iJy.js";
3
- import { Message as f } from "@arco-design/web-vue";
4
- import { ref as i, computed as r } from "vue";
5
- import { useHead as p, useSeoMeta as m } from "@unhead/vue";
6
- import { useRoute as w } from "vue-router";
7
- function S(s) {
8
- const o = i(!1), t = i(), e = i(!1), a = i(""), u = i("");
9
- function l(c) {
10
- f.success(c), e.value = !1, o.value = !1, s("confirm");
11
- }
12
- function n() {
13
- e.value = !1, s("cancel");
14
- }
15
- return {
16
- loading: o,
17
- formRef: t,
18
- submitSuccess: l,
19
- modelType: a,
20
- changeType: u,
21
- show: e,
22
- handleCancel: n
23
- };
24
- }
25
- function C() {
26
- const s = i([]), o = i(!1), t = i(""), e = i("");
27
- async function a() {
28
- o.value = !0, t.value = "";
29
- try {
30
- const l = await (await fetch(`${g.onesPrefixUrl}/releases/latest`, {
31
- method: "POST",
32
- headers: {
33
- "Content-Type": "application/json",
34
- "app-id": g.appId
35
- },
36
- body: JSON.stringify({})
37
- })).json();
38
- e.value = l.version, s.value = l.downloads.map((n) => {
39
- const c = {
40
- id: n.id,
41
- name: n.name,
42
- description: n.description,
43
- version: n.version,
44
- updateDate: n.updateDate,
45
- icon: "",
46
- downloadUrl: n.downloadUrl,
47
- platform: n.platform,
48
- requirements: n.requirements
49
- };
50
- return n.arch && (c.arch = n.arch), n.badge && (c.badge = n.badge), c;
51
- });
52
- } catch {
53
- t.value = "获取版本信息失败,请刷新重试";
54
- } finally {
55
- o.value = !1;
56
- }
57
- }
58
- return {
59
- downloads: s,
60
- loading: o,
61
- error: t,
62
- version: e,
63
- fetchDownloads: a
64
- };
65
- }
66
- function O() {
67
- function s(t) {
68
- m({
69
- ogSiteName: t.siteName,
70
- ogLocale: t.locale
71
- });
72
- }
73
- function o(t) {
74
- const {
75
- title: e,
76
- description: a,
77
- keywords: u,
78
- image: l,
79
- url: n,
80
- type: c = "website"
81
- } = t, d = a && a.length > 155 ? `${a.substring(0, 152)}...` : a;
82
- p({
83
- title: e,
84
- link: n ? [{
85
- rel: "canonical",
86
- href: n
87
- }] : []
88
- }), m({
89
- description: d || a,
90
- keywords: u,
91
- ogTitle: e,
92
- ogDescription: d || a,
93
- ogType: c === "product" ? void 0 : c,
94
- // product 类型不被支持,跳过
95
- ogUrl: n,
96
- ogImage: l,
97
- twitterCard: "summary_large_image",
98
- twitterTitle: e,
99
- twitterDescription: d || a,
100
- twitterImage: l
101
- });
102
- }
103
- return {
104
- setGlobalSEO: s,
105
- setPageSEO: o
106
- };
107
- }
108
- function U() {
109
- const s = w(), o = () => s.meta;
110
- p({
111
- title: r(() => o().title || ""),
112
- link: r(() => {
113
- const t = o();
114
- return t.url ? [{
115
- rel: "canonical",
116
- href: t.url
117
- }] : [];
118
- })
119
- }), m({
120
- description: r(() => {
121
- const e = o().description;
122
- if (e)
123
- return e.length > 155 ? `${e.substring(0, 152)}...` : e;
124
- }),
125
- keywords: r(() => o().keywords),
126
- ogTitle: r(() => o().title),
127
- ogDescription: r(() => {
128
- const e = o().description;
129
- if (e)
130
- return e.length > 155 ? `${e.substring(0, 152)}...` : e;
131
- }),
132
- ogType: r(() => {
133
- const e = o().type || "website";
134
- return e === "product" ? void 0 : e;
135
- }),
136
- ogUrl: r(() => o().url),
137
- ogImage: r(() => o().image),
138
- twitterCard: "summary_large_image",
139
- twitterTitle: r(() => o().title),
140
- twitterDescription: r(() => {
141
- const e = o().description;
142
- if (e)
143
- return e.length > 155 ? `${e.substring(0, 152)}...` : e;
144
- }),
145
- twitterImage: r(() => o().image)
146
- });
147
- }
148
- export {
149
- C as a,
150
- U as b,
151
- O as c,
152
- S as u
153
- };