vue-layout-gitcode 1.12.43 → 1.12.44
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.
- package/{GloabarSearch--EPVZ8UD.js → GloabarSearch-Dd2ti805.js} +11 -38
- package/{MenuItem-LyTNWx6g.js → MenuItem-Dz2dt34d.js} +1 -1
- package/{ProjectMenuList-B98docAF.js → ProjectMenuList-CEfWAHj0.js} +2 -2
- package/{ProjectMenuListV2-TWYG6_TF.js → ProjectMenuListV2-r4pTLRhY.js} +2 -2
- package/{ProjectSearch-BDfWWYdS.js → ProjectSearch-DMZcmmYk.js} +1 -1
- package/{SearchHistoryList-Bp2vb2Gp.js → SearchHistoryList-vky6RgfX.js} +1 -1
- package/{SearchRecommed-BAs64Djc.js → SearchRecommed-DNwcvqeX.js} +16 -9
- package/{SearchScopeList-DN89AUVU.js → SearchScopeList-BM3CPIqG.js} +1 -1
- package/{UserSearch-Dtq1lZtD.js → UserSearch-DouG0l2B.js} +1 -1
- package/{index-B6TVo4B7.js → index-BWpBnpsB.js} +1 -1
- package/{index-BGrjmLwV.js → index-BXLreYUt.js} +1 -1
- package/{index-M2ZGt9xA.js → index-DiN4g4by.js} +1320 -1223
- package/index.js +1 -1
- package/{notice-BbWimNkY.js → notice-B600yGOS.js} +1 -1
- package/package.json +1 -1
- package/{useReportRepo-jCe0oJA4.js → search-suggestion-DCJDSykA.js} +74 -4
- package/style.css +1 -1
- package/{transWebUrl-DJX4eAMa.js → transWebUrl-DPYJWnMX.js} +3 -3
package/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a3, $, a1, U, V, X, a6, a8, a0, Y, Z, Q, S, W, a2, P, C, a9, a5, a7, a4 } from "./index-
|
|
1
|
+
import { a3, $, a1, U, V, X, a6, a8, a0, Y, Z, Q, S, W, a2, P, C, a9, a5, a7, a4 } from "./index-DiN4g4by.js";
|
|
2
2
|
export {
|
|
3
3
|
a3 as AsideFooterTools,
|
|
4
4
|
$ as AtomCodeLauncher,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent, computed, createBlock, openBlock, unref, isRef, withCtx, createElementVNode, normalizeClass, createVNode, createTextVNode } from "vue";
|
|
2
|
-
import { i as isPhone, u as useModel, _ as _export_sfc } from "./index-
|
|
2
|
+
import { i as isPhone, u as useModel, _ as _export_sfc } from "./index-DiN4g4by.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";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent, toDisplayString, unref, mergeModels, useModel, ref, watch, createElementBlock, openBlock, createVNode, withDirectives, normalizeClass, createElementVNode, vShow, inject, withModifiers, createBlock, Fragment, computed, createCommentVNode, normalizeStyle, createTextVNode, renderList, withCtx, reactive, onMounted, watchEffect } from "vue";
|
|
2
|
-
import { d as transferNumber, G as GIcon, _ as _export_sfc, s as setLoginTriggerSource,
|
|
3
|
-
import { t as transWebUrl } from "./transWebUrl-
|
|
2
|
+
import { d as transferNumber, G as GIcon, _ as _export_sfc, s as setLoginTriggerSource, e as useRequestReport, r as reqCatch, h as headRequest, a as i18n, T as TOPIC_TYPE, f as useTimeFormat, g as useCookie, j as usePageResize, L as LANG_ZH, k as isGstarRepo, m as _sfc_main$b, o as isIncubationRepo, p as highlightWords, t as transformUrl, q as _frEventTrack, E as EVENT_NAME, w as REPO_TYPE, x as extractRepoInfoWithURL, y as LANG_KEY } from "./index-DiN4g4by.js";
|
|
3
|
+
import { t as transWebUrl } from "./transWebUrl-DPYJWnMX.js";
|
|
4
4
|
import { useRouter } from "vue-router";
|
|
5
5
|
import { Row, Col } from "vue-devui-lal/grid";
|
|
6
6
|
import { Skeleton, SkeletonItem } from "vue-devui-lal/skeleton";
|
|
@@ -543,6 +543,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
543
543
|
hover: { type: Boolean, default: false },
|
|
544
544
|
hideTopicTags: { type: Boolean, default: false },
|
|
545
545
|
urlParams: { default: () => ({}) },
|
|
546
|
+
preserveUrlOrigin: { type: Boolean, default: false },
|
|
546
547
|
hideStarBtn: { type: Boolean, default: false },
|
|
547
548
|
hideFooter: { type: Boolean, default: false },
|
|
548
549
|
hideDescription: { type: Boolean, default: false }
|
|
@@ -557,7 +558,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
557
558
|
const { widthType } = usePageResize();
|
|
558
559
|
const { t: $t } = i18n.global;
|
|
559
560
|
const handleClick = () => {
|
|
560
|
-
window.open(transWebUrl(transformUrl(props.info.web_url), props.urlParams
|
|
561
|
+
window.open(transWebUrl(transformUrl(props.info.web_url), props.urlParams, {
|
|
562
|
+
preserveOrigin: props.preserveUrlOrigin
|
|
563
|
+
}), "_blank");
|
|
561
564
|
emits("report");
|
|
562
565
|
_frEventTrack(EVENT_NAME.CLICK_SEARCH_RESULT);
|
|
563
566
|
};
|
|
@@ -832,8 +835,75 @@ const useReportRepo = (reportParams, viewReport) => {
|
|
|
832
835
|
triggerReport
|
|
833
836
|
};
|
|
834
837
|
};
|
|
838
|
+
const normalizeOrigin = (origin) => {
|
|
839
|
+
const value = origin.trim().replace(/\/+$/, "");
|
|
840
|
+
if (!value) return "";
|
|
841
|
+
try {
|
|
842
|
+
const url = new URL(/^[a-z][a-z\d+.-]*:\/\//i.test(value) ? value : `https://${value}`);
|
|
843
|
+
return url.origin;
|
|
844
|
+
} catch {
|
|
845
|
+
return value;
|
|
846
|
+
}
|
|
847
|
+
};
|
|
848
|
+
const getStringValue = (value) => typeof value === "string" ? value : "";
|
|
849
|
+
const normalizeProjectUrlForMainSite = (value, projectOrigin, currentOrigin) => {
|
|
850
|
+
const urlValue = getStringValue(value).trim();
|
|
851
|
+
if (!urlValue) return urlValue;
|
|
852
|
+
const mainOrigin = normalizeOrigin(projectOrigin) || normalizeOrigin(currentOrigin);
|
|
853
|
+
if (!mainOrigin) return urlValue;
|
|
854
|
+
try {
|
|
855
|
+
const mainSiteUrl = new URL(mainOrigin);
|
|
856
|
+
const projectUrl = new URL(urlValue, `${mainSiteUrl.origin}/`);
|
|
857
|
+
if (projectUrl.protocol !== "http:" && projectUrl.protocol !== "https:") return urlValue;
|
|
858
|
+
projectUrl.protocol = mainSiteUrl.protocol;
|
|
859
|
+
projectUrl.host = mainSiteUrl.host;
|
|
860
|
+
projectUrl.username = "";
|
|
861
|
+
projectUrl.password = "";
|
|
862
|
+
return projectUrl.toString();
|
|
863
|
+
} catch {
|
|
864
|
+
return urlValue;
|
|
865
|
+
}
|
|
866
|
+
};
|
|
867
|
+
const isProjectSuggestionType = (repoType) => {
|
|
868
|
+
if (repoType === void 0 || repoType === null || repoType === "") return true;
|
|
869
|
+
const normalizedType = String(repoType).trim().toLowerCase();
|
|
870
|
+
return !normalizedType || ["repo", "repository", "project", "0"].includes(normalizedType);
|
|
871
|
+
};
|
|
872
|
+
const convertDataList = ({ dataList, searchType, origin }) => {
|
|
873
|
+
if (!Array.isArray(dataList)) {
|
|
874
|
+
return { items: [] };
|
|
875
|
+
}
|
|
876
|
+
const baseOrigin = normalizeOrigin(origin);
|
|
877
|
+
const items = dataList.slice(0, 3).filter((item) => Boolean(item) && typeof item === "object" && !Array.isArray(item)).map((item) => {
|
|
878
|
+
const isGitcodeRepo = REPO_TYPE.GITCODE === item.is_mirrors;
|
|
879
|
+
const importUrl = getStringValue(item.import_url);
|
|
880
|
+
const importedRepoName = importUrl ? extractRepoInfoWithURL(importUrl) : "";
|
|
881
|
+
const nameWithNamespace = getStringValue(item.name_with_namespace);
|
|
882
|
+
const pathWithNamespace = getStringValue(item.path_with_namespace);
|
|
883
|
+
const repoName = (isGitcodeRepo ? nameWithNamespace : importedRepoName) || nameWithNamespace || pathWithNamespace;
|
|
884
|
+
const displayName = formatNameSpace(repoName).join("/");
|
|
885
|
+
const path = `${baseOrigin}/${pathWithNamespace}`;
|
|
886
|
+
return {
|
|
887
|
+
...item,
|
|
888
|
+
searchType,
|
|
889
|
+
path,
|
|
890
|
+
displayName,
|
|
891
|
+
web_url: path
|
|
892
|
+
};
|
|
893
|
+
});
|
|
894
|
+
return { items };
|
|
895
|
+
};
|
|
896
|
+
const mergeSearchSuggestions = ({ response = {}, origin, projectOrigin }) => ({
|
|
897
|
+
items: [
|
|
898
|
+
...convertDataList({ dataList: response.recommend_project, searchType: "repo", origin: projectOrigin || origin }).items,
|
|
899
|
+
...convertDataList({ dataList: response.recommend_model, searchType: "model", origin }).items,
|
|
900
|
+
...convertDataList({ dataList: response.recommend_dataset, searchType: "dataset", origin }).items
|
|
901
|
+
]
|
|
902
|
+
});
|
|
835
903
|
export {
|
|
836
904
|
SearchRepoCard as S,
|
|
837
|
-
|
|
905
|
+
isProjectSuggestionType as i,
|
|
906
|
+
mergeSearchSuggestions as m,
|
|
907
|
+
normalizeProjectUrlForMainSite as n,
|
|
838
908
|
useReportRepo as u
|
|
839
909
|
};
|