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

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,127 @@
1
+ import { defineComponent, inject, openBlock, createElementBlock, Fragment, renderList, withDirectives, createBlock, unref, ref, watch, createElementVNode, createVNode, toDisplayString, createCommentVNode } from "vue";
2
+ import { h as headRequest, R as REPO_MODULE, v as vElementExposure, b as REPO_EVENT, _ as _export_sfc, a as i18n, c as useLayoutConfig, G as GIcon } from "./index-trrN7Eu4.js";
3
+ import { u as useReportRepo, S as SearchRepoCard, m as mergeSearchSuggestions } from "./search-suggestion-DiqU8XS4.js";
4
+ import "vue-devui-lal/icon";
5
+ import "vue-devui-lal/icon/style.css";
6
+ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
7
+ __name: "SearchRepoCardList",
8
+ props: {
9
+ dataList: { default: () => [] },
10
+ searchStr: { default: "" },
11
+ type: { default: "" }
12
+ },
13
+ setup(__props) {
14
+ const props = __props;
15
+ const API = headRequest(inject("request"));
16
+ const { triggerReport } = useReportRepo({ moduleName: REPO_MODULE.SEARCH_SUGGESTION_CARD }, API.viewReport);
17
+ const useReport = inject("useReport");
18
+ const handleReport = (item) => {
19
+ useReport(REPO_EVENT.CLICK, { module_name: REPO_MODULE.SEARCH_SUGGESTION_CARD, repo_id: item.id });
20
+ };
21
+ return (_ctx, _cache) => {
22
+ return openBlock(true), createElementBlock(Fragment, null, renderList(props.dataList, (item, index) => {
23
+ return withDirectives((openBlock(), createBlock(SearchRepoCard, {
24
+ key: `${item.searchType || props.type}-${item.id}`,
25
+ class: "search-repo-list-card",
26
+ info: { ...item, index },
27
+ keyword: props.searchStr,
28
+ hover: "",
29
+ noborder: false,
30
+ hideTopicTags: "",
31
+ hideStarBtn: "",
32
+ hideFooter: "",
33
+ hideDescription: "",
34
+ onReport: () => handleReport(item),
35
+ cardType: item.searchType || props.type,
36
+ "url-params": { source_module: "search_project" },
37
+ "preserve-url-origin": item.searchType === "repo"
38
+ }, null, 8, ["info", "keyword", "onReport", "cardType", "preserve-url-origin"])), [
39
+ [unref(vElementExposure), { trigger: (type) => unref(triggerReport)(type, item) }]
40
+ ]);
41
+ }), 128);
42
+ };
43
+ }
44
+ });
45
+ const SearchRepoCardList = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-vue-layout-gitcode"]]);
46
+ const _hoisted_1 = {
47
+ key: 0,
48
+ class: "history-list-project history-list-project--padded"
49
+ };
50
+ const _sfc_main = /* @__PURE__ */ defineComponent({
51
+ __name: "GloabarSearch",
52
+ props: {
53
+ searchStr: {}
54
+ },
55
+ emits: ["searchMore"],
56
+ setup(__props, { emit: __emit }) {
57
+ const emits = __emit;
58
+ const { t: $t } = i18n.global;
59
+ const API = headRequest(inject("request", () => Promise.resolve({ data: {} })));
60
+ const layoutConfig = useLayoutConfig();
61
+ const useReport = inject("useReport", () => {
62
+ });
63
+ const searchSuggestionList = ref([]);
64
+ const origin = window.location.origin;
65
+ const props = __props;
66
+ let timer = null;
67
+ const handleSearchAll = () => {
68
+ emits("searchMore", "all");
69
+ };
70
+ const getData = async () => {
71
+ if (!props.searchStr) {
72
+ return;
73
+ }
74
+ try {
75
+ useReport("search-project", {});
76
+ const res = await API.getGloabarSearchKeyLink({ q: props.searchStr });
77
+ searchSuggestionList.value = mergeSearchSuggestions({
78
+ response: res.data || {},
79
+ origin,
80
+ projectOrigin: layoutConfig.VITE_HOST
81
+ }).items;
82
+ } catch (error) {
83
+ console.error("Failed to fetch search results:", error);
84
+ searchSuggestionList.value = [];
85
+ }
86
+ };
87
+ if (props.searchStr) {
88
+ getData();
89
+ }
90
+ watch(
91
+ () => props.searchStr,
92
+ () => {
93
+ if (timer) {
94
+ clearTimeout(timer);
95
+ }
96
+ timer = setTimeout(() => {
97
+ getData();
98
+ }, 300);
99
+ }
100
+ );
101
+ return (_ctx, _cache) => {
102
+ return openBlock(), createElementBlock(Fragment, null, [
103
+ createElementVNode("button", {
104
+ type: "button",
105
+ class: "global-search-all",
106
+ onClick: handleSearchAll
107
+ }, [
108
+ createVNode(GIcon, {
109
+ name: "gt-search",
110
+ color: "var(--theme-placeholder)"
111
+ }),
112
+ createElementVNode("span", null, toDisplayString(unref($t)("gitCodeLayout.header.searchAll", { keyword: __props.searchStr })), 1)
113
+ ]),
114
+ searchSuggestionList.value.length ? (openBlock(), createElementBlock("div", _hoisted_1, [
115
+ createVNode(SearchRepoCardList, {
116
+ "data-list": searchSuggestionList.value,
117
+ "search-str": __props.searchStr,
118
+ type: "repo"
119
+ }, null, 8, ["data-list", "search-str"])
120
+ ])) : createCommentVNode("", true)
121
+ ], 64);
122
+ };
123
+ }
124
+ });
125
+ export {
126
+ _sfc_main as default
127
+ };
@@ -1,5 +1,5 @@
1
1
  import { defineComponent, inject, useSlots, computed, ref, openBlock, createBlock, unref, withCtx, createElementVNode, normalizeClass, createElementBlock, createCommentVNode, createTextVNode, toDisplayString, renderSlot } from "vue";
2
- import { a as i18n, y as useLayoutConfig, A as ThemeType, B as currentTheme, L as LANG_ZH, C as LANG_EN, D as getLocaleLang, G as GIcon, F as emitEvent, b as REPO_EVENT, H as ASIDE_MENU_REPO, I as isHttps, J as navigateWithMigrationGuard, _ as _export_sfc } from "./index-cvKRePGR.js";
2
+ import { a as i18n, c as useLayoutConfig, B as ThemeType, C as currentTheme, L as LANG_ZH, D as LANG_EN, F as getLocaleLang, G as GIcon, H as emitEvent, b as REPO_EVENT, I as ASIDE_MENU_REPO, J as isHttps, K as navigateWithMigrationGuard, _ as _export_sfc } from "./index-trrN7Eu4.js";
3
3
  import { useRouter } from "vue-router";
4
4
  import { Popover } from "vue-devui-lal/popover";
5
5
  import "vue-devui-lal/popover/style.css";
@@ -8,10 +8,10 @@ const _hoisted_2 = {
8
8
  key: 2,
9
9
  class: "menu-item__badge"
10
10
  };
11
- const _hoisted_3 = { class: "relative" };
11
+ const _hoisted_3 = { class: "menu-item__name-wrap" };
12
12
  const _hoisted_4 = {
13
13
  key: 1,
14
- class: "token-free-text bg-[#DBE2FA] text-[#2951E0] text-[12px] rounded-[4px] px-[4px] py-[2px]"
14
+ class: "token-free-text"
15
15
  };
16
16
  const _sfc_main = /* @__PURE__ */ defineComponent({
17
17
  __name: "MenuItem",
@@ -76,7 +76,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
76
76
  return nameMap[getLocaleLang()] || props.item.left_menu_name_cn;
77
77
  });
78
78
  const isShowPopover = computed(() => {
79
- return props.item.is_show_popup && props.slotKeys.includes(props.item.popup_key) && slots[props.item.popup_key] && asideSetShow.value;
79
+ return Boolean(props.item.is_show_popup && props.slotKeys.includes(props.item.popup_key) && slots[props.item.popup_key] && asideSetShow.value);
80
80
  });
81
81
  const handleMouseEnter = () => {
82
82
  isHover.value = true;
@@ -1,7 +1,7 @@
1
1
  import { defineComponent, inject, ref, reactive, watch, computed, openBlock, createElementBlock, Fragment, createElementVNode, toDisplayString, unref, createVNode, withModifiers, normalizeClass, withCtx, renderList, createBlock, createCommentVNode, createTextVNode, withDirectives, vShow } from "vue";
2
- import { a as i18n, y as useLayoutConfig, G as GIcon, t as transformUrl, M as _sfc_main$1, N as loadAsideData, J as navigateWithMigrationGuard, F as emitEvent, s as setLoginTriggerSource, f as useRequestReport, K as asideRequest, _ as _export_sfc } from "./index-cvKRePGR.js";
2
+ import { a as i18n, c as useLayoutConfig, G as GIcon, t as transformUrl, N as _sfc_main$1, O as loadAsideData, K as navigateWithMigrationGuard, H as emitEvent, s as setLoginTriggerSource, e as useRequestReport, M as asideRequest, _ as _export_sfc } from "./index-trrN7Eu4.js";
3
3
  import { useRouter } from "vue-router";
4
- import { t as transWebUrl } from "./transWebUrl-DdydDOiv.js";
4
+ import { t as transWebUrl } from "./transWebUrl-CfS-lRqR.js";
5
5
  import { Select, Option } from "vue-devui-lal/select";
6
6
  import { Input } from "vue-devui-lal/input";
7
7
  import { Skeleton } from "vue-devui-lal/skeleton";
@@ -12,25 +12,25 @@ import "vue-devui-lal/input/style.css";
12
12
  import "vue-devui-lal/skeleton/style.css";
13
13
  import "vue-devui-lal/menu/style.css";
14
14
  import "vue-devui-lal/button/style.css";
15
- const _hoisted_1 = { class: "devui-submenu layer_2 my-work-platform submenu-item relative" };
15
+ const _hoisted_1 = { class: "devui-submenu layer_2 my-work-platform submenu-item my-work-platform--relative" };
16
16
  const _hoisted_2 = {
17
17
  class: "devui-submenu-title layer_2",
18
18
  style: { "padding": "0px 24px" }
19
19
  };
20
- const _hoisted_3 = { class: "devui-submenu-title-content cursor-auto" };
20
+ const _hoisted_3 = { class: "devui-submenu-title-content submenu-title-static" };
21
21
  const _hoisted_4 = {
22
22
  class: "devui-submenu-title layer_2",
23
23
  style: { "padding": "0px 24px" }
24
24
  };
25
- const _hoisted_5 = { class: "devui-submenu-title-content cursor-auto" };
25
+ const _hoisted_5 = { class: "devui-submenu-title-content submenu-title-static" };
26
26
  const _hoisted_6 = {
27
27
  class: "devui-submenu-title layer_2",
28
28
  style: { "padding": "0px 24px" }
29
29
  };
30
- const _hoisted_7 = { class: "devui-submenu-title-content cursor-auto" };
30
+ const _hoisted_7 = { class: "devui-submenu-title-content submenu-title-static" };
31
31
  const _hoisted_8 = { key: 0 };
32
32
  const _hoisted_9 = { class: "project-label" };
33
- const _hoisted_10 = { class: "project-label flex-1 min-w-0 ellipsis" };
33
+ const _hoisted_10 = { class: "project-label project-label--ellipsis ellipsis" };
34
34
  const _hoisted_11 = {
35
35
  key: 1,
36
36
  class: "project-label"
@@ -267,7 +267,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
267
267
  onClick: _cache[1] || (_cache[1] = withModifiers(($event) => showSearch.value = !showSearch.value, ["stop"]))
268
268
  }),
269
269
  createElementVNode("div", {
270
- class: normalizeClass(["flex flex-col pl-[0] my-work-platform-inputbox", showSearch.value ? "" : "my-work-platform-hideInputBox"]),
270
+ class: normalizeClass(["my-work-platform-inputbox-wrap my-work-platform-inputbox", showSearch.value ? "" : "my-work-platform-hideInputBox"]),
271
271
  onClick: _cache[6] || (_cache[6] = withModifiers(() => {
272
272
  }, ["stop"]))
273
273
  }, [
@@ -275,7 +275,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
275
275
  "menu-class": "my-work-platform-select",
276
276
  modelValue: nameSpace.value,
277
277
  "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => nameSpace.value = $event),
278
- class: "mb-[8px]",
278
+ class: "my-work-platform-select-wrap",
279
279
  placeholder: "",
280
280
  filter: true,
281
281
  onLoadMore: loadTeam,
@@ -328,7 +328,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
328
328
  color: "var(--theme-menu-icon-fill)"
329
329
  }),
330
330
  createElementVNode("div", {
331
- class: normalizeClass(["flex flex-col pl-[0] my-work-platform-inputbox", showSearch.value ? "" : "my-work-platform-hideInputBox"]),
331
+ class: normalizeClass(["my-work-platform-inputbox-wrap my-work-platform-inputbox", showSearch.value ? "" : "my-work-platform-hideInputBox"]),
332
332
  onClick: _cache[11] || (_cache[11] = withModifiers(() => {
333
333
  }, ["stop"]))
334
334
  }, [
@@ -367,7 +367,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
367
367
  color: "var(--theme-menu-icon-fill)"
368
368
  }),
369
369
  createElementVNode("div", {
370
- class: normalizeClass(["flex flex-col pl-[0] my-work-platform-inputbox", showSearch.value ? "" : "my-work-platform-hideInputBox"]),
370
+ class: normalizeClass(["my-work-platform-inputbox my-work-platform-inputbox--enterprise", showSearch.value ? "" : "my-work-platform-hideInputBox"]),
371
371
  onClick: _cache[16] || (_cache[16] = withModifiers(() => {
372
372
  }, ["stop"]))
373
373
  }, [
@@ -1,7 +1,7 @@
1
1
  import { defineComponent, inject, ref, reactive, computed, watch, openBlock, createElementBlock, createElementVNode, toDisplayString, unref, createVNode, withModifiers, normalizeClass, withCtx, createBlock, createCommentVNode, Fragment, renderList, createTextVNode, withDirectives, vShow } from "vue";
2
- import { a as i18n, y as useLayoutConfig, t as transformUrl, G as GIcon, K as asideRequest, J as navigateWithMigrationGuard, F as emitEvent, s as setLoginTriggerSource, f as useRequestReport, _ as _export_sfc } from "./index-cvKRePGR.js";
2
+ import { a as i18n, c as useLayoutConfig, t as transformUrl, G as GIcon, M as asideRequest, K as navigateWithMigrationGuard, H as emitEvent, s as setLoginTriggerSource, e as useRequestReport, _ as _export_sfc } from "./index-trrN7Eu4.js";
3
3
  import { useRouter } from "vue-router";
4
- import { t as transWebUrl } from "./transWebUrl-DdydDOiv.js";
4
+ import { t as transWebUrl } from "./transWebUrl-CfS-lRqR.js";
5
5
  import { Input } from "vue-devui-lal/input";
6
6
  import { Skeleton } from "vue-devui-lal/skeleton";
7
7
  import { MenuItem } from "vue-devui-lal/menu";
@@ -10,14 +10,14 @@ import "vue-devui-lal/input/style.css";
10
10
  import "vue-devui-lal/skeleton/style.css";
11
11
  import "vue-devui-lal/menu/style.css";
12
12
  import "vue-devui-lal/button/style.css";
13
- const _hoisted_1 = { class: "devui-submenu layer_2 my-work-platform submenu-item relative" };
13
+ const _hoisted_1 = { class: "devui-submenu layer_2 my-work-platform submenu-item my-work-platform--relative" };
14
14
  const _hoisted_2 = {
15
15
  class: "devui-submenu-title layer_2",
16
16
  style: { "padding": "0px 24px" }
17
17
  };
18
- const _hoisted_3 = { class: "devui-submenu-title-content cursor-auto" };
18
+ const _hoisted_3 = { class: "devui-submenu-title-content submenu-title-static" };
19
19
  const _hoisted_4 = { class: "project-label" };
20
- const _hoisted_5 = { class: "project-label flex-1 min-w-0 ellipsis" };
20
+ const _hoisted_5 = { class: "project-label project-label--ellipsis ellipsis" };
21
21
  const _hoisted_6 = ["href"];
22
22
  const INIT_SHOW_COUNT = 4;
23
23
  const LOAD_MORE_COUNT = 10;
@@ -26,7 +26,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
26
26
  props: {
27
27
  buttonText: { default: "" },
28
28
  subShow: { type: Boolean, default: false },
29
- defaultData: {},
29
+ defaultData: { default: () => ({ loading: false }) },
30
30
  isLogin: { type: Boolean, default: false },
31
31
  username: { default: "" }
32
32
  },
@@ -165,7 +165,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
165
165
  onClick: withModifiers(handleOpenSearch, ["stop"])
166
166
  }),
167
167
  createElementVNode("div", {
168
- class: normalizeClass(["flex flex-col pl-[0] my-work-platform-inputbox", showSearch.value ? "" : "my-work-platform-hideInputBox"]),
168
+ class: normalizeClass(["my-work-platform-inputbox-wrap my-work-platform-inputbox", showSearch.value ? "" : "my-work-platform-hideInputBox"]),
169
169
  onClick: _cache[4] || (_cache[4] = withModifiers(() => {
170
170
  }, ["stop"]))
171
171
  }, [
@@ -241,7 +241,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
241
241
  showTianqiRepo.value ? (openBlock(), createElementBlock("a", {
242
242
  key: 2,
243
243
  href: tianqiRepoUrl.value,
244
- class: "flex-1 min-w-0 cursor-pointer more-btn"
244
+ class: "more-btn more-btn--tianqi"
245
245
  }, toDisplayString(unref(t)("gitCodeLayout.org.tianqiRepo")) + " >", 9, _hoisted_6)) : createCommentVNode("", true)
246
246
  ]);
247
247
  };
@@ -0,0 +1,121 @@
1
+ import { defineComponent, ref, inject, watch, computed, withDirectives, openBlock, createElementBlock, createElementVNode, toDisplayString, unref, Fragment, renderList, createVNode, vShow } from "vue";
2
+ import { a as i18n, h as headRequest, G as GIcon, r as reqCatch } from "./index-trrN7Eu4.js";
3
+ import { useRoute, useRouter } from "vue-router";
4
+ import "vue-devui-lal/icon";
5
+ import "vue-devui-lal/icon/style.css";
6
+ const extractSearchFileList = (response) => {
7
+ const responseData = Array.isArray(response) ? response : response == null ? void 0 : response.data;
8
+ const data = responseData && typeof responseData === "object" && !Array.isArray(responseData) && "data" in responseData ? responseData.data : responseData;
9
+ return Array.isArray(data) ? data.filter((item) => typeof item === "string") : [];
10
+ };
11
+ const _hoisted_1 = { class: "history-list-project history-list-project--padded" };
12
+ const _hoisted_2 = { class: "history-list-project-globartitle history-list-project-globartitle--gap" };
13
+ const _hoisted_3 = ["href"];
14
+ const _hoisted_4 = { class: "history-list-project-globarbox" };
15
+ const _hoisted_5 = { class: "ellipsis history-list-project__name" };
16
+ const _sfc_main = /* @__PURE__ */ defineComponent({
17
+ ...{ name: "SearchFileList" },
18
+ __name: "ProjectSearch",
19
+ props: {
20
+ searchStr: {},
21
+ searchInfo: {},
22
+ isSearchPage: { type: Boolean }
23
+ },
24
+ setup(__props) {
25
+ const { t: $t } = i18n.global;
26
+ const props = __props;
27
+ const filedList = ref([]);
28
+ const route = useRoute();
29
+ const router = useRouter();
30
+ const API = headRequest(inject("request", () => Promise.resolve({ data: {} })));
31
+ let fileListRequestId = 0;
32
+ const loadFileList = async () => {
33
+ var _a, _b;
34
+ const searchScopeName = (_a = props == null ? void 0 : props.searchInfo) == null ? void 0 : _a.searchScopeName;
35
+ const requestId = ++fileListRequestId;
36
+ if (!searchScopeName) {
37
+ filedList.value = [];
38
+ return;
39
+ }
40
+ const params = {
41
+ repoId: encodeURIComponent(searchScopeName),
42
+ ref_name: ((_b = props.searchInfo) == null ? void 0 : _b.branch) || ""
43
+ };
44
+ const res = await reqCatch(API.getRepoFileList, params);
45
+ if (requestId !== fileListRequestId) return;
46
+ filedList.value = extractSearchFileList(res == null ? void 0 : res.data);
47
+ };
48
+ watch(
49
+ () => {
50
+ var _a, _b;
51
+ return [(_a = props.searchInfo) == null ? void 0 : _a.searchScopeName, (_b = props.searchInfo) == null ? void 0 : _b.branch];
52
+ },
53
+ () => {
54
+ void loadFileList();
55
+ },
56
+ { immediate: true }
57
+ );
58
+ const searchFileList = computed(() => {
59
+ return filedList.value.filter((item) => {
60
+ var _a;
61
+ return (_a = item == null ? void 0 : item.toLowerCase()) == null ? void 0 : _a.includes(props.searchStr);
62
+ }).splice(0, 5);
63
+ });
64
+ const getRoutePath = (filePath) => {
65
+ let params = {};
66
+ if (props.isSearchPage) {
67
+ const [namespace, repoName] = decodeURIComponent(props.searchInfo.repo).split("/");
68
+ params.namespace = namespace;
69
+ params.repoName = repoName;
70
+ } else {
71
+ params = (route == null ? void 0 : route.params) || {};
72
+ }
73
+ const defaultBranch = props.searchInfo.branch;
74
+ const branchName = Array.isArray(defaultBranch) ? defaultBranch : defaultBranch == null ? void 0 : defaultBranch.split("/");
75
+ const filePathList = filePath.split("/");
76
+ if (router == null ? void 0 : router.hasRoute("repoFile")) {
77
+ return router.resolve({
78
+ name: "repoFile",
79
+ params: {
80
+ ...params,
81
+ branchName,
82
+ filePath: filePathList
83
+ },
84
+ query: {
85
+ init: "initTree"
86
+ }
87
+ }).href;
88
+ }
89
+ const joinSegments = (value) => {
90
+ const segmentList = Array.isArray(value) ? value : [value];
91
+ return segmentList.filter((seg) => seg !== void 0 && seg !== null && seg !== "").map((seg) => encodeURIComponent(String(seg))).join("/");
92
+ };
93
+ const repoSegment = params.repo || params.repoName;
94
+ return `/${params.namespace}/${repoSegment}/blob/${joinSegments(branchName)}/${joinSegments(filePathList)}?init=initTree`;
95
+ };
96
+ return (_ctx, _cache) => {
97
+ return withDirectives((openBlock(), createElementBlock("div", _hoisted_1, [
98
+ createElementVNode("p", _hoisted_2, toDisplayString(unref($t)("gitCodeLayout.header.file")), 1),
99
+ (openBlock(true), createElementBlock(Fragment, null, renderList(searchFileList.value, (item, index) => {
100
+ return openBlock(), createElementBlock("a", {
101
+ key: index,
102
+ href: getRoutePath(item)
103
+ }, [
104
+ createElementVNode("p", _hoisted_4, [
105
+ createVNode(GIcon, {
106
+ name: "gt-file-c",
107
+ style: { "flex-shrink": "0" }
108
+ }),
109
+ createElementVNode("span", _hoisted_5, toDisplayString(item), 1)
110
+ ])
111
+ ], 8, _hoisted_3);
112
+ }), 128))
113
+ ], 512)), [
114
+ [vShow, searchFileList.value.length]
115
+ ]);
116
+ };
117
+ }
118
+ });
119
+ export {
120
+ _sfc_main as default
121
+ };
@@ -1,5 +1,5 @@
1
1
  import { defineComponent, computed, openBlock, createElementBlock, Fragment, renderList, normalizeClass, createElementVNode, createVNode, toDisplayString, withModifiers, createCommentVNode } from "vue";
2
- import { a as i18n, G as GIcon, _ as _export_sfc } from "./index-cvKRePGR.js";
2
+ import { a as i18n, n as normalizeSearchHistoryEntry, G as GIcon, _ as _export_sfc } from "./index-trrN7Eu4.js";
3
3
  import "vue-devui-lal/icon";
4
4
  import "vue-devui-lal/icon/style.css";
5
5
  const _hoisted_1 = { class: "history-list" };
@@ -42,6 +42,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
42
42
  icon: "gt-plane-project",
43
43
  hoverIcon: "gt-plane-project-red"
44
44
  },
45
+ all: {
46
+ text: t("gitCodeLayout.common.all"),
47
+ icon: "gt-plane-column1",
48
+ hoverIcon: "gt-plane-column-red"
49
+ },
45
50
  model: {
46
51
  text: t("gitCodeLayout.aihub.model"),
47
52
  icon: "gt-plane-Models",
@@ -83,11 +88,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
83
88
  hoverIcon: "gt-plane-topic-red"
84
89
  }
85
90
  };
86
- return typeMap[item.type] || typeMap["repo"];
91
+ const type = normalizeSearchHistoryEntry(item).type;
92
+ return typeMap[type] || typeMap["repo"];
87
93
  };
88
94
  const historyList = computed(() => {
89
95
  var _a;
90
- return (_a = props.searchHistoryList) == null ? void 0 : _a.map((raw) => typeof raw === "string" ? { q: raw } : raw).filter((item) => item == null ? void 0 : item.q).map((item) => {
96
+ return (_a = props.searchHistoryList) == null ? void 0 : _a.map((raw) => normalizeSearchHistoryEntry(raw)).filter((item) => item == null ? void 0 : item.q).map((item) => {
91
97
  const repoTitle = item.repo ? `${t("gitCodeLayout.header.repo")} ${decodeURIComponent(item.repo)}:` : "";
92
98
  const userVal = item.user || (item.scope === "user" ? item.namespace : "");
93
99
  const orgVal = item.org || (item.scope === "user" ? "" : item.namespace);
@@ -100,9 +106,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
100
106
  return { ...item, repoTitle, namespaceTitle };
101
107
  });
102
108
  });
103
- computed(() => {
104
- return props.visitHistoryList;
105
- });
106
109
  const resetIndex = () => {
107
110
  emits("resetIndex");
108
111
  };
@@ -119,12 +122,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
119
122
  return openBlock(), createElementBlock("div", _hoisted_1, [
120
123
  __props.searchHistoryList.length ? (openBlock(), createElementBlock("ul", {
121
124
  key: 0,
122
- class: "history-list-box mt-[16px]",
125
+ class: "history-list-box history-list-box--mt",
123
126
  onMouseleave: resetIndex
124
127
  }, [
125
128
  (openBlock(true), createElementBlock(Fragment, null, renderList(historyList.value, (item, index) => {
126
129
  return openBlock(), createElementBlock("li", {
127
- key: item,
130
+ key: `${item.q}-${item.type || "repo"}-${index}`,
128
131
  class: normalizeClass(__props.activeIndex === index ? "hoverbg" : ""),
129
132
  onClick: ($event) => toSearch(item),
130
133
  onMouseenter: ($event) => onSearchEnter(index)
@@ -1,6 +1,6 @@
1
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";
2
+ import { u as useReportRepo, S as SearchRepoCard, i as isProjectSuggestionType, n as normalizeProjectUrlForMainSite } from "./search-suggestion-DiqU8XS4.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-trrN7Eu4.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
  });
@@ -62,21 +68,22 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
62
68
  }, () => [
63
69
  (openBlock(), createBlock(SearchRepoCard, {
64
70
  key: item.id,
65
- class: "mb-[8px]",
71
+ class: "g-header-search-recommed-card",
66
72
  info: { ...item, index },
67
73
  keyword: "",
68
74
  hover: "",
69
75
  hideTopicTags: "",
70
76
  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"]))
77
+ cardType: getCardType(item.repo_type),
78
+ "url-params": { source_module: "search_box_discovery" },
79
+ "preserve-url-origin": unref(isProjectSuggestionType)(item.repo_type)
80
+ }, null, 8, ["info", "onReport", "cardType", "preserve-url-origin"]))
74
81
  ], true, item.id);
75
82
  }), 128))
76
83
  ])) : (openBlock(), createElementBlock("div", _hoisted_4, [
77
84
  (openBlock(), createElementBlock(Fragment, null, renderList(5, (item) => {
78
85
  return createElementVNode("div", {
79
- class: "pt-[8px] pb-[16px]",
86
+ class: "g-header-search-recommed-skel",
80
87
  key: item
81
88
  }, [
82
89
  createVNode(unref(Row), {
@@ -100,7 +107,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
100
107
  _: 1
101
108
  }),
102
109
  createVNode(unref(Row), {
103
- class: "mt-[12px]",
110
+ class: "g-header-search-recommed-skel-row",
104
111
  align: "middle",
105
112
  gutter: 16
106
113
  }, {
@@ -115,7 +122,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
115
122
  _: 1
116
123
  }),
117
124
  createVNode(unref(Row), {
118
- class: "mt-[12px]",
125
+ class: "g-header-search-recommed-skel-row",
119
126
  align: "middle",
120
127
  gutter: 16
121
128
  }, {
@@ -1,13 +1,13 @@
1
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";
2
+ import { a as i18n, G as GIcon, _ as _export_sfc } from "./index-trrN7Eu4.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" };
@@ -28,7 +28,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
28
28
  (openBlock(true), createElementBlock(Fragment, null, renderList(__props.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, 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-trrN7Eu4.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
  };
@@ -8,7 +8,7 @@ import { Message } from "vue-devui-lal/message";
8
8
  import "vue-devui-lal/message/style.css";
9
9
  import { FixedOverlay } from "vue-devui-lal/overlay";
10
10
  import "vue-devui-lal/overlay/style.css";
11
- import { a as i18n, k as usePageResize, z as isZh, _ as _export_sfc } from "./index-cvKRePGR.js";
11
+ import { a as i18n, j as usePageResize, A as isZh, _ as _export_sfc } from "./index-trrN7Eu4.js";
12
12
  const _YunpianCaptchaManager = class _YunpianCaptchaManager {
13
13
  // eslint-disable-next-line no-useless-constructor
14
14
  constructor() {