vue-layout-gitcode 1.12.55-multiple-account → 1.12.55

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.
@@ -1,6 +1,6 @@
1
- import { defineComponent, inject, ref, onMounted, openBlock, createElementBlock, createElementVNode, toDisplayString, unref, Fragment, renderList, renderSlot, createBlock, createVNode, withCtx } from "vue";
2
- import { u as useReportRepo, S as SearchRepoCard } from "./index-Ci7lYW7d.js";
3
- import { a as i18n, h as headRequest, R as REPO_MODULE, b as REPO_EVENT, l as localStorage, _ as _export_sfc } from "./index-cvKRePGR.js";
1
+ import { defineComponent, inject, ref, onMounted, createElementBlock, openBlock, createElementVNode, toDisplayString, unref, Fragment, renderList, renderSlot, createBlock, createVNode, withCtx } from "vue";
2
+ import { u as useReportRepo, S as SearchRepoCard, i as isProjectSuggestionType, n as normalizeProjectUrlForMainSite } from "./search-suggestion-5gvGFBYY.js";
3
+ import { a as i18n, h as headRequest, c as useLayoutConfig, R as REPO_MODULE, b as REPO_EVENT, l as localStorage, _ as _export_sfc } from "./index-XmRn4ADt.js";
4
4
  import { Row, Col } from "vue-devui-lal/grid";
5
5
  import { SkeletonItem } from "vue-devui-lal/skeleton";
6
6
  import "vue-devui-lal/grid/style.css";
@@ -14,9 +14,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
14
14
  setup(__props) {
15
15
  const { t: $t } = i18n.global;
16
16
  const API = headRequest(inject("request"));
17
+ const layoutConfig = useLayoutConfig();
17
18
  const useReport = inject("useReport");
18
19
  const { triggerReport } = useReportRepo({ moduleName: REPO_MODULE.SEARCH_RECOMMEND_CARD }, API.viewReport);
19
20
  const recommendRepoList = ref([]);
21
+ const getCardType = (repoType) => repoType ? String(repoType) : "repo";
20
22
  const handleReport = (repo, index, evt) => {
21
23
  const params = evt === "starReport" ? {
22
24
  module_name: REPO_MODULE.SEARCH_RECOMMEND_CARD,
@@ -38,10 +40,14 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
38
40
  }
39
41
  const params = { history: JSON.stringify(localSearchText) };
40
42
  const res = await API.openSourceProject(params);
41
- const data = (((_a = res == null ? void 0 : res.data) == null ? void 0 : _a.content) || []).map((item) => ({
42
- ...item,
43
- tags: item.tags || item.topic_names
44
- }));
43
+ const data = (((_a = res == null ? void 0 : res.data) == null ? void 0 : _a.content) || []).map((item) => {
44
+ const isProject = isProjectSuggestionType(item.repo_type);
45
+ return {
46
+ ...item,
47
+ ...isProject && item.web_url ? { web_url: normalizeProjectUrlForMainSite(item.web_url, layoutConfig.VITE_HOST, window.location.origin) } : {},
48
+ tags: item.tags || item.topic_names
49
+ };
50
+ });
45
51
  data.forEach((item, index) => {
46
52
  triggerReport("expo", { ...item, index });
47
53
  });
@@ -57,26 +63,28 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
57
63
  createElementVNode("div", _hoisted_3, toDisplayString(unref($t)("gitCodeLayout.search.trendingToday")), 1),
58
64
  (openBlock(true), createElementBlock(Fragment, null, renderList(recommendRepoList.value, (item, index) => {
59
65
  return renderSlot(_ctx.$slots, "default", {
66
+ key: item.id,
60
67
  item,
61
68
  index
62
69
  }, () => [
63
70
  (openBlock(), createBlock(SearchRepoCard, {
64
71
  key: item.id,
65
- class: "mb-[8px]",
72
+ class: "g-header-search-recommed-card",
66
73
  info: { ...item, index },
67
74
  keyword: "",
68
75
  hover: "",
69
76
  hideTopicTags: "",
70
77
  onReport: (evt) => handleReport(item, index, evt),
71
- cardType: (item == null ? void 0 : item.repo_type) || "repo",
72
- "url-params": { source_module: "search_box_discovery" }
73
- }, null, 8, ["info", "onReport", "cardType"]))
74
- ], true, item.id);
78
+ cardType: getCardType(item.repo_type),
79
+ "url-params": { source_module: "search_box_discovery" },
80
+ "preserve-url-origin": unref(isProjectSuggestionType)(item.repo_type)
81
+ }, null, 8, ["info", "onReport", "cardType", "preserve-url-origin"]))
82
+ ], true);
75
83
  }), 128))
76
84
  ])) : (openBlock(), createElementBlock("div", _hoisted_4, [
77
85
  (openBlock(), createElementBlock(Fragment, null, renderList(5, (item) => {
78
86
  return createElementVNode("div", {
79
- class: "pt-[8px] pb-[16px]",
87
+ class: "g-header-search-recommed-skel",
80
88
  key: item
81
89
  }, [
82
90
  createVNode(unref(Row), {
@@ -100,7 +108,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
100
108
  _: 1
101
109
  }),
102
110
  createVNode(unref(Row), {
103
- class: "mt-[12px]",
111
+ class: "g-header-search-recommed-skel-row",
104
112
  align: "middle",
105
113
  gutter: 16
106
114
  }, {
@@ -115,7 +123,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
115
123
  _: 1
116
124
  }),
117
125
  createVNode(unref(Row), {
118
- class: "mt-[12px]",
126
+ class: "g-header-search-recommed-skel-row",
119
127
  align: "middle",
120
128
  gutter: 16
121
129
  }, {
@@ -1,13 +1,13 @@
1
- import { defineComponent, openBlock, createElementBlock, Fragment, renderList, createElementVNode, createVNode, toDisplayString, createCommentVNode, unref } from "vue";
2
- import { a as i18n, G as GIcon, _ as _export_sfc } from "./index-cvKRePGR.js";
1
+ import { defineComponent, createElementBlock, openBlock, Fragment, renderList, createElementVNode, createVNode, createCommentVNode, toDisplayString, unref } from "vue";
2
+ import { a as i18n, G as GIcon, _ as _export_sfc } from "./index-XmRn4ADt.js";
3
3
  import "vue-devui-lal/icon";
4
4
  import "vue-devui-lal/icon/style.css";
5
5
  const _hoisted_1 = ["onClick"];
6
- const _hoisted_2 = { class: "flex linkItem pl-[9px] pr-[19px]" };
6
+ const _hoisted_2 = { class: "linkItem" };
7
7
  const _hoisted_3 = { class: "leftTx ellipsis" };
8
8
  const _hoisted_4 = {
9
9
  key: 0,
10
- class: "ml-[4px]"
10
+ class: "g-header-search-scopechoose__label"
11
11
  };
12
12
  const _hoisted_5 = { key: 1 };
13
13
  const _hoisted_6 = { class: "right-text" };
@@ -25,10 +25,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
25
25
  };
26
26
  return (_ctx, _cache) => {
27
27
  return openBlock(), createElementBlock("ul", null, [
28
- (openBlock(true), createElementBlock(Fragment, null, renderList(__props.searchScopeList, (item, index) => {
28
+ (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.searchScopeList, (item, index) => {
29
29
  return openBlock(), createElementBlock("li", {
30
30
  key: index,
31
- class: "g-header-search-scopechoose pt-[16px] px-[8px]",
31
+ class: "g-header-search-scopechoose",
32
32
  onClick: ($event) => onScopeSearch(item)
33
33
  }, [
34
34
  createElementVNode("div", _hoisted_2, [
@@ -1,18 +1,21 @@
1
- import { inject, ref, watch, withDirectives, openBlock, createElementBlock, createElementVNode, toDisplayString, unref, Fragment, renderList, createVNode, vShow } from "vue";
2
- import { a as i18n, h as headRequest, G as GIcon, t as transformUrl } from "./index-cvKRePGR.js";
1
+ import { defineComponent, inject, ref, watch, withDirectives, createElementBlock, openBlock, createElementVNode, toDisplayString, unref, Fragment, renderList, createVNode, vShow } from "vue";
2
+ import { a as i18n, h as headRequest, G as GIcon, t as transformUrl } from "./index-XmRn4ADt.js";
3
3
  import "vue-devui-lal/icon";
4
4
  import "vue-devui-lal/icon/style.css";
5
- const _hoisted_1 = { class: "px-[8px] history-list-project pl-[8px]" };
6
- const _hoisted_2 = { class: "history-list-project-globartitle mb-[4px] mt-[16px]" };
5
+ const _hoisted_1 = { class: "history-list-project history-list-project--padded" };
6
+ const _hoisted_2 = { class: "history-list-project-globartitle history-list-project-globartitle--gap" };
7
7
  const _hoisted_3 = ["href"];
8
- const _hoisted_4 = { class: "flex history-list-project-globarbox" };
9
- const _hoisted_5 = { class: "ml-[8px] ellipsis" };
10
- const _sfc_main = {
8
+ const _hoisted_4 = { class: "history-list-project-globarbox" };
9
+ const _hoisted_5 = { class: "ellipsis history-list-project__name" };
10
+ const _sfc_main = /* @__PURE__ */ defineComponent({
11
11
  __name: "UserSearch",
12
- props: ["searchStr", "searchInfo"],
12
+ props: {
13
+ searchStr: {},
14
+ searchInfo: {}
15
+ },
13
16
  setup(__props) {
14
17
  const { t: $t } = i18n.global;
15
- const API = headRequest(inject("request"));
18
+ const API = headRequest(inject("request", () => Promise.resolve({ data: {} })));
16
19
  const props = __props;
17
20
  const loading = ref(false);
18
21
  const searchFileList = ref([]);
@@ -41,14 +44,14 @@ const _sfc_main = {
41
44
  search: props.searchStr
42
45
  }).then((res) => {
43
46
  const data = res.data || {};
44
- searchFileList.value = data.content.map((item) => {
47
+ searchFileList.value = (data.content || []).map((item) => {
45
48
  return {
46
49
  ...item,
47
- web_url: transformUrl(item.web_url),
48
- ssh_url_to_repo: transformUrl(item.ssh_url_to_repo),
49
- http_url_to_repo: transformUrl(item.http_url_to_repo),
50
- readme_url: transformUrl(item.readme_url),
51
- avatar_url: transformUrl(item.avatar_url)
50
+ web_url: transformUrl(item.web_url || ""),
51
+ ssh_url_to_repo: transformUrl(item.ssh_url_to_repo || ""),
52
+ http_url_to_repo: transformUrl(item.http_url_to_repo || ""),
53
+ readme_url: transformUrl(item.readme_url || ""),
54
+ avatar_url: transformUrl(item.avatar_url || "")
52
55
  };
53
56
  }) || [];
54
57
  }).finally(() => {
@@ -88,7 +91,7 @@ const _sfc_main = {
88
91
  ]);
89
92
  };
90
93
  }
91
- };
94
+ });
92
95
  export {
93
96
  _sfc_main as default
94
97
  };
@@ -1,5 +1,5 @@
1
- import { defineComponent, onMounted, nextTick, onUnmounted, openBlock, createBlock, unref, withCtx, createElementVNode } from "vue";
2
- import { x as slidCaptchaManager, y as useLayoutConfig, z as isZh, _ as _export_sfc } from "./index-cvKRePGR.js";
1
+ import { defineComponent, onMounted, nextTick, onUnmounted, createBlock, openBlock, unref, withCtx, createElementVNode } from "vue";
2
+ import { z as slidCaptchaManager, c as useLayoutConfig, A as isZh, _ as _export_sfc } from "./index-XmRn4ADt.js";
3
3
  import { FixedOverlay } from "vue-devui-lal/overlay";
4
4
  import "vue-devui-lal/overlay/style.css";
5
5
  const TARGET_TEXT = "Click in order:";
@@ -105,10 +105,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
105
105
  });
106
106
  return (_ctx, _cache) => {
107
107
  return openBlock(), createBlock(unref(FixedOverlay), { class: "captcha-overlay-slid" }, {
108
- default: withCtx(() => [..._cache[0] || (_cache[0] = [
108
+ default: withCtx(() => _cache[0] || (_cache[0] = [
109
109
  createElementVNode("div", { id: "captcha-box" }, null, -1)
110
- ])]),
111
- _: 1
110
+ ])),
111
+ _: 1,
112
+ __: [0]
112
113
  });
113
114
  };
114
115
  }