vue-layout-gitcode 1.1.27 → 1.1.29

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.
@@ -0,0 +1,106 @@
1
+ import { defineComponent, onMounted, openBlock, createBlock, unref, withCtx, createElementVNode } from "vue";
2
+ import { FixedOverlay } from "vue-devui-lal/overlay";
3
+ import { q as useLayoutConfig, _ as _export_sfc } from "./index-5e727914.js";
4
+ import "vue-devui-lal/overlay/style.css";
5
+ import "vue-devui-lal/button";
6
+ import "vue-devui-lal/popover";
7
+ import "vue-devui-lal/tooltip";
8
+ import "vue-devui-lal/textarea";
9
+ import "vue-devui-lal/button/style.css";
10
+ import "vue-devui-lal/popover/style.css";
11
+ import "vue-devui-lal/tooltip/style.css";
12
+ import "vue-devui-lal/textarea/style.css";
13
+ import "vue-devui-lal/icon";
14
+ import "vue-devui-lal/icon/style.css";
15
+ import "vue-router";
16
+ import "@vueuse/core";
17
+ import "vue-devui-lal/avatar";
18
+ import "vue-devui-lal/avatar/style.css";
19
+ import "vue-devui-lal/dropdown";
20
+ import "vue-devui-lal/dropdown/style.css";
21
+ import "dayjs";
22
+ import "vue-devui-lal/skeleton";
23
+ import "vue-devui-lal/skeleton/style.css";
24
+ import "vue-devui-lal/message";
25
+ import "vue-devui-lal/message/style.css";
26
+ import "vue-devui-lal/badge";
27
+ import "vue-devui-lal/badge/style.css";
28
+ import "vue-devui-lal/tabs/style.css";
29
+ import "vue-devui-lal/input";
30
+ import "vue-devui-lal/form";
31
+ import "vue-devui-lal/input/style.css";
32
+ import "vue-devui-lal/form/style.css";
33
+ import "vue-devui-lal/notification";
34
+ import "vue-devui-lal/notification/style.css";
35
+ import "vue-devui-lal/select";
36
+ import "vue-devui-lal/menu";
37
+ import "vue-devui-lal/select/style.css";
38
+ import "vue-devui-lal/menu/style.css";
39
+ import "vue-devui-lal/drawer";
40
+ import "vue-devui-lal/layout";
41
+ import "vue-devui-lal/drawer/style.css";
42
+ import "vue-devui-lal/layout/style.css";
43
+ import "vue-devui-lal/radio";
44
+ import "@devui-design/icons/icomoon/devui-icon.css";
45
+ import "vue-devui-lal/radio/style.css";
46
+ import "vue-devui-lal/checkbox";
47
+ import "vue-devui-lal/checkbox/style.css";
48
+ import "vue-devui-lal/modal";
49
+ import "vue-devui-lal/modal/style.css";
50
+ const _sfc_main = /* @__PURE__ */ defineComponent({
51
+ __name: "index",
52
+ emits: ["close", "success"],
53
+ setup(__props, { emit: __emit }) {
54
+ const emits = __emit;
55
+ const captchaInit = () => {
56
+ if (!window.initTAC) {
57
+ return;
58
+ }
59
+ const baseURL = useLayoutConfig().VITE_API_HOST;
60
+ const config = {
61
+ requestCaptchaDataUrl: `${baseURL}/uc/api/v1/captcha/gen`,
62
+ validCaptchaUrl: `${baseURL}/uc/api/v1/captcha/check`,
63
+ bindEl: "#captcha-box",
64
+ validSuccess: (res, c, tac) => {
65
+ tac.destroyWindow();
66
+ emits("success", res.data);
67
+ },
68
+ validFail: (res, c, tac) => {
69
+ tac.reloadCaptcha();
70
+ },
71
+ btnRefreshFun: (el, tac) => {
72
+ tac.reloadCaptcha();
73
+ },
74
+ btnCloseFun: (el, tac) => {
75
+ tac.destroyWindow();
76
+ emits("close");
77
+ }
78
+ };
79
+ const style = {
80
+ logoUrl: null
81
+ // 去除logo
82
+ };
83
+ window.initTAC("https://cdn-static.gitcode.com/js/tac/", config, style).then((tac) => {
84
+ tac.init();
85
+ }).catch((e) => {
86
+ console.error("初始化tac失败", e);
87
+ });
88
+ };
89
+ onMounted(() => {
90
+ captchaInit();
91
+ });
92
+ return (_ctx, _cache) => {
93
+ return openBlock(), createBlock(unref(FixedOverlay), { class: "captcha-overlay" }, {
94
+ default: withCtx(() => _cache[0] || (_cache[0] = [
95
+ createElementVNode("div", { id: "captcha-box" }, null, -1)
96
+ ])),
97
+ _: 1
98
+ });
99
+ };
100
+ }
101
+ });
102
+ const index_vue_vue_type_style_index_0_scoped_37ed6e3d_lang = "";
103
+ const index = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-37ed6e3d"]]);
104
+ export {
105
+ index as default
106
+ };
@@ -1,5 +1,5 @@
1
- import { ref, watchEffect, defineComponent, toDisplayString, inject, createElementBlock, openBlock, normalizeClass, createElementVNode, withModifiers, withDirectives, vShow, createVNode, computed, createCommentVNode, unref, normalizeStyle, createTextVNode, onMounted, onUnmounted, Fragment, createBlock, renderList, reactive, withCtx } from "vue";
2
- import { d as debounce, G as GIcon, f as useRequestReport, r as reqCatch, h as headRequest, _ as _export_sfc, a as i18n, T as TOPIC_TYPE, g as useTimeFormat, L as LANG_KEY, j as LANG_ZH, k as usePageResize, m as isGstarRepo, n as _sfc_main$8, o as isIncubationRepo, p as highlightWords, t as transWebUrl, q as _frEventTrack, E as EVENT_NAME, b as REPO_TYPE, e as extractRepoInfoWithURL } from "./index-CFV2tQ1P.js";
1
+ import { ref, watchEffect, defineComponent, toDisplayString, inject, openBlock, createElementBlock, normalizeClass, createElementVNode, withModifiers, withDirectives, vShow, createVNode, computed, unref, normalizeStyle, createCommentVNode, createTextVNode, onMounted, onUnmounted, Fragment, createBlock, renderList, reactive, withCtx } from "vue";
2
+ import { d as debounce, h as headRequest, G as GIcon, r as reqCatch, _ as _export_sfc, a as i18n, T as TOPIC_TYPE, f as useTimeFormat, L as LANG_KEY, g as LANG_ZH, j as usePageResize, k as isGstarRepo, m as _sfc_main$8, n as isIncubationRepo, o as highlightWords, t as transWebUrl, p as _frEventTrack, E as EVENT_NAME, c as REPO_TYPE, e as extractRepoInfoWithURL } from "./index-5e727914.js";
3
3
  import { useRouter } from "vue-router";
4
4
  import { Row, Col } from "vue-devui-lal/grid";
5
5
  import { Skeleton, SkeletonItem } from "vue-devui-lal/skeleton";
@@ -28,12 +28,13 @@ const useReportRepo = (reportParams, viewReport) => {
28
28
  };
29
29
  const formatItem = (data) => {
30
30
  const channelNames = [];
31
- if (data.channelName) channelNames.push(data.channelName);
32
- if (data.subChannelName) channelNames.push(data.subChannelName);
33
- const repoId = isNaN(Number(data.id)) ? data.id : Number(data.id);
31
+ if (data.channelName)
32
+ channelNames.push(data.channelName);
33
+ if (data.subChannelName)
34
+ channelNames.push(data.subChannelName);
34
35
  return {
35
36
  type: "gitcode",
36
- repo_id: repoId,
37
+ repo_id: data.id,
37
38
  dest_url: data.web_url,
38
39
  strategy: channelNames.join("、") || "",
39
40
  // 官方项目
@@ -124,16 +125,11 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
124
125
  starInfo: { default: () => ({
125
126
  starred: false,
126
127
  starCount: 0
127
- }) },
128
- loginTriggerSource: { default: "search_star_repo_recommend" }
128
+ }) }
129
129
  },
130
130
  emits: ["report"],
131
131
  setup(__props, { emit: __emit }) {
132
- const request = inject("request");
133
- const API = headRequest(request);
134
- const globalStore = inject("globalStore");
135
- const isLogin = inject("isLogin");
136
- const { useReport } = useRequestReport(request, globalStore);
132
+ const API = headRequest(inject("request"));
137
133
  const props = __props;
138
134
  const emits = __emit;
139
135
  const running = ref(false);
@@ -142,11 +138,9 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
142
138
  const starLoading = ref(false);
143
139
  const handleStar = async (e) => {
144
140
  e.preventDefault();
145
- if (!isLogin.value) {
146
- useReport("login_exposure", { source: props.loginTriggerSource || "search_star_repo_recommend" });
147
- }
148
141
  try {
149
- if (starLoading.value) return;
142
+ if (starLoading.value)
143
+ return;
150
144
  starLoading.value = true;
151
145
  const params = { repoId: props.starInfo.id };
152
146
  let res;
@@ -212,7 +206,8 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
212
206
  };
213
207
  }
214
208
  });
215
- const StarTag = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["__scopeId", "data-v-gitcode-layout-lib"]]);
209
+ const index_vue_vue_type_style_index_0_scoped_754df2e0_lang = "";
210
+ const StarTag = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["__scopeId", "data-v-754df2e0"]]);
216
211
  const _hoisted_1$4 = { class: "fork-tag" };
217
212
  const _sfc_main$5 = /* @__PURE__ */ defineComponent({
218
213
  __name: "index",
@@ -237,7 +232,8 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
237
232
  };
238
233
  }
239
234
  });
240
- const ForkTag = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-gitcode-layout-lib"]]);
235
+ const index_vue_vue_type_style_index_0_scoped_98be5d7f_lang = "";
236
+ const ForkTag = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-98be5d7f"]]);
241
237
  const _sfc_main$4 = /* @__PURE__ */ defineComponent({
242
238
  __name: "index",
243
239
  props: {
@@ -283,7 +279,8 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
283
279
  };
284
280
  }
285
281
  });
286
- const LanguageTag = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-gitcode-layout-lib"]]);
282
+ const index_vue_vue_type_style_index_0_scoped_6e1aad17_lang = "";
283
+ const LanguageTag = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-6e1aad17"]]);
287
284
  const _hoisted_1$3 = { class: "star-count-one" };
288
285
  const _hoisted_2$3 = { key: 0 };
289
286
  const _sfc_main$3 = /* @__PURE__ */ defineComponent({
@@ -310,7 +307,8 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
310
307
  };
311
308
  }
312
309
  });
313
- const StarCountOne = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-gitcode-layout-lib"]]);
310
+ const index_vue_vue_type_style_index_0_scoped_de8d9362_lang = "";
311
+ const StarCountOne = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-de8d9362"]]);
314
312
  const _hoisted_1$2 = { class: "github-star-num" };
315
313
  const _hoisted_2$2 = { class: "leading-none" };
316
314
  const _sfc_main$2 = /* @__PURE__ */ defineComponent({
@@ -337,7 +335,8 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
337
335
  };
338
336
  }
339
337
  });
340
- const GithubStarNum = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-gitcode-layout-lib"]]);
338
+ const index_vue_vue_type_style_index_0_scoped_7f7e79b1_lang = "";
339
+ const GithubStarNum = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-7f7e79b1"]]);
341
340
  const _hoisted_1$1 = { class: "repo-card-footer mt-[4px]" };
342
341
  const _hoisted_2$1 = {
343
342
  key: 3,
@@ -429,7 +428,8 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
429
428
  };
430
429
  }
431
430
  });
432
- const RepoCardFooter = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-gitcode-layout-lib"]]);
431
+ const index_vue_vue_type_style_index_0_scoped_ca800e14_lang = "";
432
+ const RepoCardFooter = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-ca800e14"]]);
433
433
  const _hoisted_1 = ["innerHTML"];
434
434
  const _hoisted_2 = {
435
435
  key: 0,
@@ -531,7 +531,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
531
531
  return highlightWords(keyword, contentArr.join("/"), true);
532
532
  };
533
533
  onMounted(() => {
534
- if (props.info.is_recommend && props.info.index === 0) handleQueryGraph();
534
+ if (props.info.is_recommend && props.info.index === 0)
535
+ handleQueryGraph();
535
536
  });
536
537
  return (_ctx, _cache) => {
537
538
  return openBlock(), createElementBlock("a", {
@@ -655,7 +656,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
655
656
  };
656
657
  }
657
658
  });
658
- const SearchRepoCard = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-gitcode-layout-lib"]]);
659
+ const index_vue_vue_type_style_index_0_scoped_9047871e_lang = "";
660
+ const SearchRepoCard = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-9047871e"]]);
659
661
  export {
660
662
  SearchRepoCard as S,
661
663
  formatNameSpace as f,
package/index.d.ts CHANGED
@@ -17,6 +17,7 @@ import { UserInfo } from '../../types/types';
17
17
 
18
18
  declare interface BaseLayoutConfig {
19
19
  VITE_HOST: string;
20
+ VITE_HOST_TIANQI: string;
20
21
  VITE_ENV: string;
21
22
  VITE_API_HOST: string;
22
23
  VITE_AD_LINK: string;
@@ -547,7 +548,7 @@ export declare const ToolsFloat: DefineComponent<ExtractPropTypes<{
547
548
  globalStore: Object;
548
549
  }, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
549
550
 
550
- export declare function useLogin(request: any, globalStore?: any): {
551
+ export declare function useLogin(request: any): {
551
552
  login: (options?: LoginOptions, loginSuccess?: Function, openHarmonyGuide?: boolean) => void;
552
553
  unMount: () => void;
553
554
  isMounted: () => boolean;
package/index.js CHANGED
@@ -1,14 +1,60 @@
1
- import { x, y, B, w, S, v, C, F, A, D, z } from "./index-CFV2tQ1P.js";
1
+ import { w, x, A, v, S, s, B, D, z, C, y } from "./index-5e727914.js";
2
+ import "vue";
3
+ import "vue-devui-lal/button";
4
+ import "vue-devui-lal/popover";
5
+ import "vue-devui-lal/tooltip";
6
+ import "vue-devui-lal/textarea";
7
+ import "vue-devui-lal/button/style.css";
8
+ import "vue-devui-lal/popover/style.css";
9
+ import "vue-devui-lal/tooltip/style.css";
10
+ import "vue-devui-lal/textarea/style.css";
11
+ import "vue-devui-lal/icon";
12
+ import "vue-devui-lal/icon/style.css";
13
+ import "vue-router";
14
+ import "@vueuse/core";
15
+ import "vue-devui-lal/avatar";
16
+ import "vue-devui-lal/avatar/style.css";
17
+ import "vue-devui-lal/dropdown";
18
+ import "vue-devui-lal/dropdown/style.css";
19
+ import "dayjs";
20
+ import "vue-devui-lal/skeleton";
21
+ import "vue-devui-lal/skeleton/style.css";
22
+ import "vue-devui-lal/message";
23
+ import "vue-devui-lal/message/style.css";
24
+ import "vue-devui-lal/badge";
25
+ import "vue-devui-lal/badge/style.css";
26
+ import "vue-devui-lal/tabs/style.css";
27
+ import "vue-devui-lal/input";
28
+ import "vue-devui-lal/form";
29
+ import "vue-devui-lal/input/style.css";
30
+ import "vue-devui-lal/form/style.css";
31
+ import "vue-devui-lal/notification";
32
+ import "vue-devui-lal/notification/style.css";
33
+ import "vue-devui-lal/select";
34
+ import "vue-devui-lal/menu";
35
+ import "vue-devui-lal/select/style.css";
36
+ import "vue-devui-lal/menu/style.css";
37
+ import "vue-devui-lal/drawer";
38
+ import "vue-devui-lal/layout";
39
+ import "vue-devui-lal/drawer/style.css";
40
+ import "vue-devui-lal/layout/style.css";
41
+ import "vue-devui-lal/radio";
42
+ import "@devui-design/icons/icomoon/devui-icon.css";
43
+ import "vue-devui-lal/radio/style.css";
44
+ import "vue-devui-lal/checkbox";
45
+ import "vue-devui-lal/checkbox/style.css";
46
+ import "vue-devui-lal/modal";
47
+ import "vue-devui-lal/modal/style.css";
2
48
  export {
3
- x as GitCodeAside,
4
- y as GitCodeHeader,
5
- B as GitCodeLayoutEmitter,
6
- w as Login,
49
+ w as GitCodeAside,
50
+ x as GitCodeHeader,
51
+ A as GitCodeLayoutEmitter,
52
+ v as Login,
7
53
  S as SceneValue,
8
- v as ToolsFloat,
9
- C as currentTheme,
10
- F as default,
11
- A as setLayoutConfig,
12
- D as setTheme,
13
- z as useLogin
54
+ s as ToolsFloat,
55
+ B as currentTheme,
56
+ D as default,
57
+ z as setLayoutConfig,
58
+ C as setTheme,
59
+ y as useLogin
14
60
  };
@@ -1,9 +1,50 @@
1
- import { defineComponent, computed, createBlock, openBlock, unref, isRef, withCtx, createElementVNode, normalizeClass, createVNode, createTextVNode } from "vue";
2
- import { i as isPhone, u as useModel } from "./index-CFV2tQ1P.js";
1
+ import { defineComponent, computed, openBlock, createBlock, unref, isRef, withCtx, createElementVNode, normalizeClass, createVNode, createTextVNode } from "vue";
2
+ import { i as isPhone, u as useModel } from "./index-5e727914.js";
3
3
  import { Notification } from "vue-devui-lal/notification";
4
4
  import { Button } from "vue-devui-lal/button";
5
5
  import "vue-devui-lal/notification/style.css";
6
6
  import "vue-devui-lal/button/style.css";
7
+ import "vue-devui-lal/popover";
8
+ import "vue-devui-lal/tooltip";
9
+ import "vue-devui-lal/textarea";
10
+ import "vue-devui-lal/popover/style.css";
11
+ import "vue-devui-lal/tooltip/style.css";
12
+ import "vue-devui-lal/textarea/style.css";
13
+ import "vue-devui-lal/icon";
14
+ import "vue-devui-lal/icon/style.css";
15
+ import "vue-router";
16
+ import "@vueuse/core";
17
+ import "vue-devui-lal/avatar";
18
+ import "vue-devui-lal/avatar/style.css";
19
+ import "vue-devui-lal/dropdown";
20
+ import "vue-devui-lal/dropdown/style.css";
21
+ import "dayjs";
22
+ import "vue-devui-lal/skeleton";
23
+ import "vue-devui-lal/skeleton/style.css";
24
+ import "vue-devui-lal/message";
25
+ import "vue-devui-lal/message/style.css";
26
+ import "vue-devui-lal/badge";
27
+ import "vue-devui-lal/badge/style.css";
28
+ import "vue-devui-lal/tabs/style.css";
29
+ import "vue-devui-lal/input";
30
+ import "vue-devui-lal/form";
31
+ import "vue-devui-lal/input/style.css";
32
+ import "vue-devui-lal/form/style.css";
33
+ import "vue-devui-lal/select";
34
+ import "vue-devui-lal/menu";
35
+ import "vue-devui-lal/select/style.css";
36
+ import "vue-devui-lal/menu/style.css";
37
+ import "vue-devui-lal/drawer";
38
+ import "vue-devui-lal/layout";
39
+ import "vue-devui-lal/drawer/style.css";
40
+ import "vue-devui-lal/layout/style.css";
41
+ import "vue-devui-lal/radio";
42
+ import "@devui-design/icons/icomoon/devui-icon.css";
43
+ import "vue-devui-lal/radio/style.css";
44
+ import "vue-devui-lal/checkbox";
45
+ import "vue-devui-lal/checkbox/style.css";
46
+ import "vue-devui-lal/modal";
47
+ import "vue-devui-lal/modal/style.css";
7
48
  const _sfc_main = /* @__PURE__ */ defineComponent({
8
49
  __name: "notice",
9
50
  props: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vue-layout-gitcode",
3
- "version": "1.1.27",
3
+ "version": "1.1.29",
4
4
  "description": "用于 gitcode 站点生产环境使用",
5
5
  "main": "index.js",
6
6
  "types": "./index.d.ts",