vue-layout-gitcode 1.12.15-beta.44 → 1.12.15-beta.46

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,150 @@
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, c as REPO_TYPE, e as extractRepoInfoWithURL, a as i18n, G as GIcon } from "./index-DUe_D3tb.js";
3
+ import { u as useReportRepo, S as SearchRepoCard, f as formatNameSpace } from "./useReportRepo-DVPLhJis.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: {
10
+ type: Array,
11
+ default: () => []
12
+ },
13
+ searchStr: {
14
+ type: String,
15
+ default: ""
16
+ },
17
+ type: {
18
+ type: String,
19
+ default: ""
20
+ }
21
+ },
22
+ setup(__props) {
23
+ const API = headRequest(inject("request"));
24
+ const { triggerReport } = useReportRepo({ moduleName: REPO_MODULE.SEARCH_SUGGESTION_CARD }, API.viewReport);
25
+ const useReport = inject("useReport");
26
+ const handleReport = (item) => {
27
+ useReport(REPO_EVENT.CLICK, { module_name: REPO_MODULE.SEARCH_SUGGESTION_CARD, repo_id: item.id });
28
+ };
29
+ return (_ctx, _cache) => {
30
+ return openBlock(true), createElementBlock(Fragment, null, renderList(__props.dataList, (item, index) => {
31
+ return withDirectives((openBlock(), createBlock(SearchRepoCard, {
32
+ key: item.id,
33
+ class: "search-repo-list-card",
34
+ info: { ...item, index },
35
+ keyword: __props.searchStr,
36
+ hover: "",
37
+ hideTopicTags: "",
38
+ hideStarBtn: "",
39
+ hideFooter: "",
40
+ hideDescription: "",
41
+ onReport: () => handleReport(item),
42
+ cardType: item.searchType || __props.type,
43
+ "url-params": { source_module: "search_project" }
44
+ }, null, 8, ["info", "keyword", "onReport", "cardType"])), [
45
+ [unref(vElementExposure), { trigger: (type) => unref(triggerReport)(type, item) }]
46
+ ]);
47
+ }), 128);
48
+ };
49
+ }
50
+ });
51
+ const SearchRepoCardList = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-vue-layout-gitcode"]]);
52
+ const normalizeOrigin = (origin) => origin.replace(/\/+$/, "");
53
+ const convertDataList = (dataList, searchType, origin) => {
54
+ if (!Array.isArray(dataList)) {
55
+ return [];
56
+ }
57
+ const baseOrigin = normalizeOrigin(origin);
58
+ return dataList.slice(0, 3).filter((item) => Boolean(item) && typeof item === "object").map((item) => {
59
+ const isGitcodeRepo = REPO_TYPE.GITCODE === item.is_mirrors;
60
+ const importedRepoName = item.import_url ? extractRepoInfoWithURL(item.import_url) : "";
61
+ const repoName = (isGitcodeRepo ? item.name_with_namespace : importedRepoName) || item.name_with_namespace || item.path_with_namespace || "";
62
+ const displayName = formatNameSpace(repoName).join("/");
63
+ const path = `${baseOrigin}/${item.path_with_namespace || ""}`;
64
+ return {
65
+ ...item,
66
+ searchType,
67
+ path,
68
+ displayName,
69
+ web_url: path
70
+ };
71
+ });
72
+ };
73
+ const mergeSearchSuggestions = (response = {}, origin) => [
74
+ ...convertDataList(response.recommend_project, "repo", origin),
75
+ ...convertDataList(response.recommend_model, "model", origin),
76
+ ...convertDataList(response.recommend_dataset, "dataset", origin)
77
+ ];
78
+ const _hoisted_1 = {
79
+ key: 0,
80
+ class: "history-list-project history-list-project--padded"
81
+ };
82
+ const _sfc_main = {
83
+ __name: "GloabarSearch",
84
+ props: ["searchStr"],
85
+ emits: ["searchMore"],
86
+ setup(__props, { emit: __emit }) {
87
+ const emits = __emit;
88
+ const { t: $t } = i18n.global;
89
+ const API = headRequest(inject("request"));
90
+ const useReport = inject("useReport");
91
+ const searchSuggestionList = ref([]);
92
+ const origin = window.location.origin;
93
+ const props = __props;
94
+ let timer = null;
95
+ const handleSearchAll = () => {
96
+ emits("searchMore", "all");
97
+ };
98
+ const getData = async () => {
99
+ if (!props.searchStr) {
100
+ return;
101
+ }
102
+ try {
103
+ useReport == null ? void 0 : useReport("search-project", {});
104
+ const res = await API.getGloabarSearchKeyLink({ q: props.searchStr });
105
+ searchSuggestionList.value = mergeSearchSuggestions(res.data || {}, origin);
106
+ } catch (error) {
107
+ console.error("Failed to fetch search results:", error);
108
+ searchSuggestionList.value = [];
109
+ }
110
+ };
111
+ if (props.searchStr) {
112
+ getData();
113
+ }
114
+ watch(
115
+ () => props.searchStr,
116
+ () => {
117
+ if (timer) {
118
+ clearTimeout(timer);
119
+ }
120
+ timer = setTimeout(() => {
121
+ getData();
122
+ }, 300);
123
+ }
124
+ );
125
+ return (_ctx, _cache) => {
126
+ return openBlock(), createElementBlock(Fragment, null, [
127
+ createElementVNode("button", {
128
+ type: "button",
129
+ class: "global-search-all",
130
+ onClick: handleSearchAll
131
+ }, [
132
+ createVNode(GIcon, {
133
+ name: "gt-search",
134
+ color: "var(--theme-placeholder)"
135
+ }),
136
+ createElementVNode("span", null, toDisplayString(unref($t)("gitCodeLayout.header.searchAll", { keyword: __props.searchStr })), 1)
137
+ ]),
138
+ searchSuggestionList.value.length ? (openBlock(), createElementBlock("div", _hoisted_1, [
139
+ createVNode(SearchRepoCardList, {
140
+ "data-list": searchSuggestionList.value,
141
+ "search-str": __props.searchStr
142
+ }, null, 8, ["data-list", "search-str"])
143
+ ])) : createCommentVNode("", true)
144
+ ], 64);
145
+ };
146
+ }
147
+ };
148
+ export {
149
+ _sfc_main as default
150
+ };
@@ -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, z 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-Bhv07cir.js";
2
+ import { a as i18n, z 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-DUe_D3tb.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";
@@ -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, z 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, f as useRequestReport, M as asideRequest, _ as _export_sfc } from "./index-Bhv07cir.js";
2
+ import { a as i18n, z 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, f as useRequestReport, M as asideRequest, _ as _export_sfc } from "./index-DUe_D3tb.js";
3
3
  import { useRouter } from "vue-router";
4
- import { t as transWebUrl } from "./transWebUrl-CjAKBQUN.js";
4
+ import { t as transWebUrl } from "./transWebUrl-BRQANkzP.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";
@@ -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, z as useLayoutConfig, t as transformUrl, G as GIcon, M as asideRequest, K as navigateWithMigrationGuard, H as emitEvent, s as setLoginTriggerSource, f as useRequestReport, _ as _export_sfc } from "./index-Bhv07cir.js";
2
+ import { a as i18n, z as useLayoutConfig, t as transformUrl, G as GIcon, M as asideRequest, K as navigateWithMigrationGuard, H as emitEvent, s as setLoginTriggerSource, f as useRequestReport, _ as _export_sfc } from "./index-DUe_D3tb.js";
3
3
  import { useRouter } from "vue-router";
4
- import { t as transWebUrl } from "./transWebUrl-CjAKBQUN.js";
4
+ import { t as transWebUrl } from "./transWebUrl-BRQANkzP.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";
@@ -1,5 +1,5 @@
1
1
  import { ref, inject, 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-Bhv07cir.js";
2
+ import { a as i18n, h as headRequest, G as GIcon, r as reqCatch } from "./index-DUe_D3tb.js";
3
3
  import { useRoute, useRouter } from "vue-router";
4
4
  import "vue-devui-lal/icon";
5
5
  import "vue-devui-lal/icon/style.css";
@@ -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, n as normalizeSearchHistoryEntry, G as GIcon, _ as _export_sfc } from "./index-Bhv07cir.js";
2
+ import { a as i18n, n as normalizeSearchHistoryEntry, G as GIcon, _ as _export_sfc } from "./index-DUe_D3tb.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" };
@@ -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-CtM76hG4.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-Bhv07cir.js";
2
+ import { u as useReportRepo, S as SearchRepoCard } from "./useReportRepo-DVPLhJis.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-DUe_D3tb.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";
@@ -1,5 +1,5 @@
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-Bhv07cir.js";
2
+ import { a as i18n, G as GIcon, _ as _export_sfc } from "./index-DUe_D3tb.js";
3
3
  import "vue-devui-lal/icon";
4
4
  import "vue-devui-lal/icon/style.css";
5
5
  const _hoisted_1 = ["onClick"];
@@ -1,5 +1,5 @@
1
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-Bhv07cir.js";
2
+ import { a as i18n, h as headRequest, G as GIcon, t as transformUrl } from "./index-DUe_D3tb.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-project history-list-project--padded" };
@@ -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, A as isZh, _ as _export_sfc } from "./index-Bhv07cir.js";
11
+ import { a as i18n, k as usePageResize, A as isZh, _ as _export_sfc } from "./index-DUe_D3tb.js";
12
12
  const _YunpianCaptchaManager = class _YunpianCaptchaManager {
13
13
  // eslint-disable-next-line no-useless-constructor
14
14
  constructor() {
@@ -16851,7 +16851,7 @@ const normalizeSearchHistoryEntry = (value) => {
16851
16851
  };
16852
16852
  const sameSearchHistory = (left, right) => {
16853
16853
  const leftEntry = normalizeSearchHistoryEntry(left);
16854
- return leftEntry.q === right.q && leftEntry.type === right.type && leftEntry.repo === right.repo && leftEntry.org === right.org && leftEntry.user === right.user && leftEntry.namespace === right.namespace;
16854
+ return leftEntry.q === right.q && leftEntry.type === right.type && leftEntry.scope === right.scope && leftEntry.repo === right.repo && leftEntry.org === right.org && leftEntry.user === right.user && leftEntry.namespace === right.namespace;
16855
16855
  };
16856
16856
  const upsertSearchHistory = (current, data, limit = 10) => {
16857
16857
  const next = current.filter((item) => Boolean(normalizeSearchHistoryEntry(item).q));
@@ -17299,12 +17299,12 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
17299
17299
  setup(__props) {
17300
17300
  const layoutConfig2 = useLayoutConfig();
17301
17301
  const { t: $t } = i18n.global;
17302
- const ProjectSearch = defineAsyncComponent(() => import("./ProjectSearch-B--M9NKy.js"));
17303
- const UserSearch = defineAsyncComponent(() => import("./UserSearch-C7yhRImW.js"));
17304
- const GloabarSearch = defineAsyncComponent(() => import("./GloabarSearch-DOb49kb1.js"));
17305
- const SearchHistoryList = defineAsyncComponent(() => import("./SearchHistoryList-C6SlOUbd.js"));
17306
- const SearchScopeList = defineAsyncComponent(() => import("./SearchScopeList-BTHTBdRL.js"));
17307
- const SearchRecommed = defineAsyncComponent(() => import("./SearchRecommed-B2nSbCak.js"));
17302
+ const ProjectSearch = defineAsyncComponent(() => import("./ProjectSearch-CUo9HKZg.js"));
17303
+ const UserSearch = defineAsyncComponent(() => import("./UserSearch-11OKBd5O.js"));
17304
+ const GloabarSearch = defineAsyncComponent(() => import("./GloabarSearch-Da1RZAKG.js"));
17305
+ const SearchHistoryList = defineAsyncComponent(() => import("./SearchHistoryList-DY1-q7Dm.js"));
17306
+ const SearchScopeList = defineAsyncComponent(() => import("./SearchScopeList-CRD8vYLp.js"));
17307
+ const SearchRecommed = defineAsyncComponent(() => import("./SearchRecommed-8-eRMRkX.js"));
17308
17308
  const props = __props;
17309
17309
  const repoInfo = inject("repoInfo");
17310
17310
  const orgInfo = inject("orgInfo");
@@ -18632,7 +18632,7 @@ const vElementExposure = {
18632
18632
  beforeUnmount() {
18633
18633
  }
18634
18634
  };
18635
- const NoticeModal = defineAsyncComponent(() => import("./notice-CxKzeiYF.js"));
18635
+ const NoticeModal = defineAsyncComponent(() => import("./notice-F_Rlk1uj.js"));
18636
18636
  function clearNotice() {
18637
18637
  if (localStorage$2.getItem("validator_email")) {
18638
18638
  localStorage$2.removeItem("validator_email");
@@ -21056,9 +21056,9 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
21056
21056
  const layoutConfig2 = useLayoutConfig();
21057
21057
  const { t: t2 } = i18n.global;
21058
21058
  const route = useRoute();
21059
- const MenuItem = defineAsyncComponent(() => import("./MenuItem-BDykqVY_.js"));
21060
- const ProjectMenuListV2 = defineAsyncComponent(() => import("./ProjectMenuListV2-BuyD7jOd.js"));
21061
- const ProjectMenuList = defineAsyncComponent(() => import("./ProjectMenuList-XmOFvTS9.js"));
21059
+ const MenuItem = defineAsyncComponent(() => import("./MenuItem-CIXrRuAs.js"));
21060
+ const ProjectMenuListV2 = defineAsyncComponent(() => import("./ProjectMenuListV2-elZE2Sq_.js"));
21061
+ const ProjectMenuList = defineAsyncComponent(() => import("./ProjectMenuList-CHBCQxNT.js"));
21062
21062
  const props = __props;
21063
21063
  const useReport2 = inject("useReport");
21064
21064
  const userInfo = inject("userInfo");
@@ -27542,7 +27542,7 @@ const _SlidCaptchaManager = class _SlidCaptchaManager {
27542
27542
  __publicField(_SlidCaptchaManager, "instance");
27543
27543
  let SlidCaptchaManager = _SlidCaptchaManager;
27544
27544
  const slidCaptchaManager = SlidCaptchaManager.getInstance();
27545
- const SlidCaptcha = defineAsyncComponent(() => import("./index-CH0gI_tL.js"));
27545
+ const SlidCaptcha = defineAsyncComponent(() => import("./index-lJ94iEJ8.js"));
27546
27546
  const useSlidCaptcha = () => {
27547
27547
  const { mount, unMount, isMounted } = usePopup("slid-captcha-popup");
27548
27548
  const open = (config) => {
@@ -27572,7 +27572,7 @@ const useSlidCaptcha = () => {
27572
27572
  close
27573
27573
  };
27574
27574
  };
27575
- const YunpianCaptcha = defineAsyncComponent(() => import("./index-DFsuUGSz.js"));
27575
+ const YunpianCaptcha = defineAsyncComponent(() => import("./index-CLmiFFtl.js"));
27576
27576
  const useYunpianCaptcha = () => {
27577
27577
  const { mount, unMount } = usePopup("yunpian-captcha-popup");
27578
27578
  const open = (config) => {
@@ -1,5 +1,5 @@
1
1
  import { defineComponent, onMounted, nextTick, onUnmounted, openBlock, createBlock, unref, withCtx, createElementVNode } from "vue";
2
- import { y as slidCaptchaManager, z as useLayoutConfig, A as isZh, _ as _export_sfc } from "./index-Bhv07cir.js";
2
+ import { y as slidCaptchaManager, z as useLayoutConfig, A as isZh, _ as _export_sfc } from "./index-DUe_D3tb.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:";
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { P, Q, S, U, V, W, X, Y, Z, $, a0, a1, a2, a3, a4, C, a5, a6, a7, a8 } from "./index-Bhv07cir.js";
1
+ import { P, Q, S, U, V, W, X, Y, Z, $, a0, a1, a2, a3, a4, C, a5, a6, a7, a8 } from "./index-DUe_D3tb.js";
2
2
  export {
3
3
  P as AsideFooterTools,
4
4
  Q as AtomCodeLauncher,
@@ -1,5 +1,5 @@
1
1
  import { defineComponent, computed, openBlock, createBlock, unref, isRef, withCtx, createElementVNode, normalizeClass, createVNode, createTextVNode } from "vue";
2
- import { i as isPhone, u as useModel, _ as _export_sfc } from "./index-Bhv07cir.js";
2
+ import { i as isPhone, u as useModel, _ as _export_sfc } from "./index-DUe_D3tb.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
  {
2
2
  "name": "vue-layout-gitcode",
3
- "version": "1.12.15-beta.44",
3
+ "version": "1.12.15-beta.46",
4
4
  "description": "用于 gitcode 站点生产环境使用",
5
5
  "main": "index.js",
6
6
  "types": "./index.d.ts",