vue-layout-gitcode 1.12.54 → 1.12.55-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.
@@ -1,21 +1,18 @@
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-DdlJC00I.js";
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";
3
3
  import "vue-devui-lal/icon";
4
4
  import "vue-devui-lal/icon/style.css";
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" };
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]" };
7
7
  const _hoisted_3 = ["href"];
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({
8
+ const _hoisted_4 = { class: "flex history-list-project-globarbox" };
9
+ const _hoisted_5 = { class: "ml-[8px] ellipsis" };
10
+ const _sfc_main = {
11
11
  __name: "UserSearch",
12
- props: {
13
- searchStr: {},
14
- searchInfo: {}
15
- },
12
+ props: ["searchStr", "searchInfo"],
16
13
  setup(__props) {
17
14
  const { t: $t } = i18n.global;
18
- const API = headRequest(inject("request", () => Promise.resolve({ data: {} })));
15
+ const API = headRequest(inject("request"));
19
16
  const props = __props;
20
17
  const loading = ref(false);
21
18
  const searchFileList = ref([]);
@@ -44,14 +41,14 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
44
41
  search: props.searchStr
45
42
  }).then((res) => {
46
43
  const data = res.data || {};
47
- searchFileList.value = (data.content || []).map((item) => {
44
+ searchFileList.value = data.content.map((item) => {
48
45
  return {
49
46
  ...item,
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 || "")
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)
55
52
  };
56
53
  }) || [];
57
54
  }).finally(() => {
@@ -91,7 +88,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
91
88
  ]);
92
89
  };
93
90
  }
94
- });
91
+ };
95
92
  export {
96
93
  _sfc_main as default
97
94
  };
@@ -1,5 +1,5 @@
1
1
  import { defineComponent, onMounted, nextTick, onUnmounted, openBlock, createBlock, unref, withCtx, createElementVNode } from "vue";
2
- import { z as slidCaptchaManager, c as useLayoutConfig, A as isZh, _ as _export_sfc } from "./index-DdlJC00I.js";
2
+ import { x as slidCaptchaManager, y as useLayoutConfig, z as isZh, _ as _export_sfc } from "./index-cvKRePGR.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:";
@@ -1,6 +1,7 @@
1
- import { defineComponent, toDisplayString, unref, useModel, ref, watch, openBlock, createElementBlock, createVNode, normalizeClass, withDirectives, createElementVNode, vShow, mergeModels, inject, withModifiers, createBlock, Fragment, computed, normalizeStyle, createCommentVNode, createTextVNode, renderList, withCtx, reactive, onMounted, watchEffect } from "vue";
2
- import { d as transferNumber, G as GIcon, _ as _export_sfc, s as setLoginTriggerSource, r as reqCatch, e as useRequestReport, 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-DdlJC00I.js";
3
- import { t as transWebUrl } from "./transWebUrl-BIRrBeEN.js";
1
+ import { ref, watchEffect, defineComponent, toDisplayString, unref, useModel, watch, openBlock, createElementBlock, createVNode, normalizeClass, withDirectives, createElementVNode, vShow, mergeModels, inject, withModifiers, createBlock, Fragment, computed, normalizeStyle, createCommentVNode, createTextVNode, onMounted, onUnmounted, renderList, withCtx, reactive } from "vue";
2
+ import debounce from "lodash/debounce";
3
+ import { d as transferNumber, G as GIcon, _ as _export_sfc, s as setLoginTriggerSource, r as reqCatch, f as useRequestReport, h as headRequest, a as i18n, T as TOPIC_TYPE, g as useTimeFormat, j as useCookie, k as usePageResize, L as LANG_ZH, m as isGstarRepo, n as _sfc_main$b, o as isIncubationRepo, p as highlightWords, t as transformUrl, q as _frEventTrack, E as EVENT_NAME, c as REPO_TYPE, e as extractRepoInfoWithURL, w as LANG_KEY } from "./index-cvKRePGR.js";
4
+ import { t as transWebUrl } from "./transWebUrl-DdydDOiv.js";
4
5
  import { useRouter } from "vue-router";
5
6
  import { Row, Col } from "vue-devui-lal/grid";
6
7
  import { Skeleton, SkeletonItem } from "vue-devui-lal/skeleton";
@@ -8,7 +9,74 @@ import "vue-devui-lal/grid/style.css";
8
9
  import "vue-devui-lal/skeleton/style.css";
9
10
  import { Popover } from "vue-devui-lal/popover";
10
11
  import "vue-devui-lal/popover/style.css";
11
- import debounce from "lodash/debounce";
12
+ const useReportRepo = (reportParams, viewReport) => {
13
+ const list = ref([]);
14
+ const pageRef = ref((window == null ? void 0 : window.page_ref) || "");
15
+ const locationHref = ref((window == null ? void 0 : window.location.href) || "");
16
+ const keyword = ref(reportParams == null ? void 0 : reportParams.keyword);
17
+ const moduleName = ref(reportParams == null ? void 0 : reportParams.moduleName);
18
+ const triggerReport = (type, data) => {
19
+ if (type === "click") {
20
+ const params = {
21
+ chat_title: "",
22
+ related: {
23
+ list: [formatItem(data)],
24
+ type: "repo"
25
+ }
26
+ };
27
+ viewReport(pageRef.value, locationHref.value, "click", params);
28
+ } else if (type === "expo") {
29
+ list.value.push(data);
30
+ }
31
+ };
32
+ const formatItem = (data) => {
33
+ const channelNames = [];
34
+ if (data.channelName) channelNames.push(data.channelName);
35
+ if (data.subChannelName) channelNames.push(data.subChannelName);
36
+ const repoId = isNaN(Number(data.id)) ? data.id : Number(data.id);
37
+ return {
38
+ type: "gitcode",
39
+ repo_id: repoId,
40
+ dest_url: data.web_url,
41
+ strategy: channelNames.join("、") || "",
42
+ // 官方项目
43
+ repo_index: data.index,
44
+ page: data.pageIndex || data.p || 0,
45
+ per_page: data.pageSize || data.pp || 0,
46
+ q: data.keyword || ""
47
+ };
48
+ };
49
+ const doReport = debounce(() => {
50
+ if (list.value.length >= 1) {
51
+ const reportList = list.value.splice(0).map((item) => {
52
+ return formatItem(item);
53
+ });
54
+ const params = {
55
+ chat_title: "",
56
+ extend_json: {
57
+ key_words: keyword.value,
58
+ module_name: moduleName.value
59
+ },
60
+ related: {
61
+ list: reportList,
62
+ type: "repo"
63
+ }
64
+ };
65
+ viewReport(pageRef.value, locationHref.value, "expo", params);
66
+ }
67
+ }, 500, { leading: false });
68
+ watchEffect(() => {
69
+ if (list.value.length) {
70
+ doReport();
71
+ }
72
+ });
73
+ return {
74
+ triggerReport
75
+ };
76
+ };
77
+ const formatNameSpace = (content) => {
78
+ return content.trim().replace(/\s+/g, "").replace(/^(GitHub加速计划\/|HuggingFace镜像\/)/, "").split("/").filter(Boolean);
79
+ };
12
80
  const _sfc_main$a = /* @__PURE__ */ defineComponent({
13
81
  __name: "index",
14
82
  props: {
@@ -23,8 +91,8 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
23
91
  };
24
92
  }
25
93
  });
26
- const _hoisted_1$8 = { class: "g-like" };
27
- const _hoisted_2$6 = { class: "g-like__overlay" };
94
+ const _hoisted_1$8 = { class: "relative flex" };
95
+ const _hoisted_2$6 = { class: "absolute w-full h-full left-0 top-0" };
28
96
  const ANIM_END = "animEnd";
29
97
  const activeLikeIcon = "gt-plane-like";
30
98
  const unActiveLikeIcon = "gt-line-like";
@@ -59,7 +127,7 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
59
127
  return (_ctx, _cache) => {
60
128
  return openBlock(), createElementBlock("div", _hoisted_1$8, [
61
129
  createVNode(GIcon, {
62
- class: normalizeClass({ "g-like__active": active.value }),
130
+ class: normalizeClass({ "!text-red-500": active.value }),
63
131
  name: active.value ? activeLikeIcon : unActiveLikeIcon
64
132
  }, null, 8, ["class", "name"]),
65
133
  withDirectives(createElementVNode("div", _hoisted_2$6, [
@@ -68,7 +136,7 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
68
136
  onAnimationend: animationend
69
137
  }, [
70
138
  createVNode(GIcon, {
71
- class: "g-like__active",
139
+ class: "!text-red-500",
72
140
  name: activeLikeIcon
73
141
  })
74
142
  ], 32)
@@ -81,7 +149,7 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
81
149
  });
82
150
  const Like = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["__scopeId", "data-v-vue-layout-gitcode"]]);
83
151
  const _hoisted_1$7 = {
84
- class: "i-star-tag__icon-wrap",
152
+ class: "mr-[4px]",
85
153
  style: { "width": "15px", "height": "15px" }
86
154
  };
87
155
  const _hoisted_2$5 = { class: "i-star-tag__text" };
@@ -152,14 +220,14 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
152
220
  }])
153
221
  }, [
154
222
  createElementVNode("span", {
155
- class: normalizeClass(["i-star-tag", {
223
+ class: normalizeClass(["i-star-tag hover:bg-[var(--theme-btn-default-hover)]", {
156
224
  "i-star-tag__active": starred.value
157
225
  }]),
158
226
  onClick: withModifiers(handleStar, ["stop", "prevent"])
159
227
  }, [
160
228
  __props.isLike ? (openBlock(), createBlock(Like, {
161
229
  key: 0,
162
- class: "i-star-tag__icon-mr",
230
+ class: "mr-[4px]",
163
231
  modelValue: starred.value,
164
232
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => starred.value = $event),
165
233
  runAnimation: running.value,
@@ -204,7 +272,7 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
204
272
  return (_ctx, _cache) => {
205
273
  return openBlock(), createElementBlock("div", _hoisted_1$6, [
206
274
  createVNode(GIcon, {
207
- class: "fork-tag__icon",
275
+ class: "mr-[4px]",
208
276
  name: "gt-line-fork",
209
277
  color: "var(--theme-home-card-color-placeholder)",
210
278
  size: "14"
@@ -222,7 +290,7 @@ const ForkTag = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["__scopeId", "data-v-
222
290
  const _sfc_main$6 = /* @__PURE__ */ defineComponent({
223
291
  __name: "index",
224
292
  props: {
225
- tagInfo: { default: () => [] },
293
+ tagInfo: { default: [] },
226
294
  type: {}
227
295
  },
228
296
  setup(__props) {
@@ -230,6 +298,15 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
230
298
  const isTag = computed(() => props.type === "tag");
231
299
  const languageTag = props.tagInfo[0] || "";
232
300
  const tagColor = props.tagInfo[1] || "#00ADD8";
301
+ computed(() => {
302
+ if (isTag.value) {
303
+ return {
304
+ background: tagColor,
305
+ opacity: 0.1
306
+ };
307
+ }
308
+ return {};
309
+ });
233
310
  const tagFontColor = computed(() => {
234
311
  if (isTag.value) {
235
312
  return { color: tagColor };
@@ -247,6 +324,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
247
324
  style: normalizeStyle({ background: unref(tagColor), opacity: 0.1 })
248
325
  }, null, 4)) : createCommentVNode("", true),
249
326
  createElementVNode("i", {
327
+ class: "mr-[4px]",
250
328
  style: normalizeStyle({ background: unref(tagColor) })
251
329
  }, null, 4),
252
330
  createTextVNode(toDisplayString(unref(languageTag)), 1)
@@ -286,7 +364,7 @@ const _hoisted_1$4 = {
286
364
  key: 0,
287
365
  class: "github-star-num"
288
366
  };
289
- const _hoisted_2$3 = { class: "github-star-num__count" };
367
+ const _hoisted_2$3 = { class: "leading-none" };
290
368
  const _sfc_main$4 = /* @__PURE__ */ defineComponent({
291
369
  ...{ name: "GithubStarNum" },
292
370
  __name: "index",
@@ -317,7 +395,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
317
395
  }
318
396
  });
319
397
  const GithubStarNum = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-vue-layout-gitcode"]]);
320
- const _hoisted_1$3 = { class: "repo-card-footer" };
398
+ const _hoisted_1$3 = { class: "repo-card-footer mt-[4px]" };
321
399
  const _hoisted_2$2 = {
322
400
  key: 3,
323
401
  class: "line-separator"
@@ -331,12 +409,12 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
331
409
  __name: "index",
332
410
  props: {
333
411
  repoInfo: {},
334
- hideTopicTags: { type: Boolean, default: false },
335
- tagInfo: { default: () => [] },
336
- hideUpdateTime: { type: Boolean, default: false },
337
- hideStarIncrease: { type: Boolean, default: false },
338
- hideStarCount: { type: Boolean, default: false },
339
- searchCard: { type: Boolean, default: false }
412
+ hideTopicTags: { type: Boolean },
413
+ tagInfo: {},
414
+ hideUpdateTime: { type: Boolean },
415
+ hideStarIncrease: { type: Boolean },
416
+ hideStarCount: { type: Boolean },
417
+ searchCard: { type: Boolean }
340
418
  },
341
419
  emits: ["topicClick"],
342
420
  setup(__props, { emit: __emit }) {
@@ -348,12 +426,22 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
348
426
  var _a;
349
427
  return ((_a = props.repoInfo.tags) == null ? void 0 : _a.filter((item) => item.type === TOPIC_TYPE.USER)) || [];
350
428
  });
429
+ ref(topicNames.value);
430
+ const visibleCount = ref(0);
431
+ ref(false);
351
432
  const showUpdateTimeDot = computed(() => {
352
433
  return !props.hideUpdateTime && (!props.hideStarCount || props.tagInfo && props.tagInfo[0] || props.repoInfo.forks_count);
353
434
  });
435
+ computed(() => {
436
+ return topicNames.value.length - visibleCount.value + 1;
437
+ });
354
438
  const handleTopicClick = (topic) => {
355
439
  emits("topicClick", topic);
356
440
  };
441
+ onMounted(() => {
442
+ });
443
+ onUnmounted(() => {
444
+ });
357
445
  return (_ctx, _cache) => {
358
446
  return openBlock(), createElementBlock(Fragment, null, [
359
447
  createElementVNode("div", null, [
@@ -402,9 +490,6 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
402
490
  }
403
491
  });
404
492
  const RepoCardFooter = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-vue-layout-gitcode"]]);
405
- const formatNameSpace = (content) => {
406
- return content.trim().replace(/\s+/g, "").replace(/^(GitHub加速计划\/|HuggingFace镜像\/)/, "").split("/").filter(Boolean);
407
- };
408
493
  const _hoisted_1$2 = { class: "new-tag-content" };
409
494
  const _sfc_main$2 = /* @__PURE__ */ defineComponent({
410
495
  __name: "index",
@@ -448,7 +533,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
448
533
  createElementVNode("span", _hoisted_1$2, toDisplayString(tagTipsText.value), 1)
449
534
  ]),
450
535
  default: withCtx(() => [
451
- _cache[0] || (_cache[0] = createElementVNode("div", { class: "new-tag" }, "New", -1))
536
+ _cache[0] || (_cache[0] = createElementVNode("div", { class: "new-tag w-[32px] h-[15px] text-[9px] text-[#ffffff] flex items-center justify-center leading-[1]" }, "New", -1))
452
537
  ]),
453
538
  _: 1
454
539
  })) : createCommentVNode("", true);
@@ -456,17 +541,17 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
456
541
  }
457
542
  });
458
543
  const NewTag = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-vue-layout-gitcode"]]);
459
- const _hoisted_1$1 = { class: "model-card-footer" };
544
+ const _hoisted_1$1 = { class: "model-card-footer h-[22px] mt-[4px] flex items-center overflow-hidden whitespace-nowrap text-[14px] leading-[14px] text-[var(--theme-release-card-text-color)]" };
460
545
  const _hoisted_2$1 = {
461
546
  key: 1,
462
- class: "ellipsis max-150 model-card-footer__text"
547
+ class: "ellipsis max-150 ml-[6px]"
463
548
  };
464
- const _hoisted_3$1 = { class: "model-card-footer__text" };
465
- const _hoisted_4$1 = { class: "model-card-footer__time" };
466
- const _hoisted_5$1 = { class: "model-card-footer__text" };
549
+ const _hoisted_3$1 = { class: "ml-[6px]" };
550
+ const _hoisted_4$1 = { class: "whitespace-nowrap overflow-hidden text-ellipsis" };
551
+ const _hoisted_5$1 = { class: "ml-[6px]" };
467
552
  const _hoisted_6$1 = {
468
553
  key: 2,
469
- class: "model-card-footer__dot"
554
+ class: "w-[4px] h-[4px] ml-[6px] mr-[6px] rounded-[2px] bg-[var(--theme-placeholder)]"
470
555
  };
471
556
  const _sfc_main$1 = /* @__PURE__ */ defineComponent({
472
557
  __name: "ModelCardFooter",
@@ -489,7 +574,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
489
574
  size: "12px"
490
575
  }, null, 8, ["name"])) : createCommentVNode("", true),
491
576
  projectData.value.task[0].name ? (openBlock(), createElementBlock("span", _hoisted_2$1, toDisplayString(projectData.value.task[0].name), 1)) : createCommentVNode("", true),
492
- _cache[0] || (_cache[0] = createElementVNode("div", { class: "model-card-footer__dot" }, null, -1))
577
+ _cache[0] || (_cache[0] = createElementVNode("div", { class: "w-[4px] h-[4px] ml-[6px] mr-[6px] rounded-[2px] bg-[var(--theme-placeholder)]" }, null, -1))
493
578
  ], 64)) : createCommentVNode("", true),
494
579
  projectData.value.model_param_size ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
495
580
  createVNode(GIcon, {
@@ -498,10 +583,10 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
498
583
  color: "var(--theme-release-card-text-color)"
499
584
  }),
500
585
  createElementVNode("span", _hoisted_3$1, toDisplayString(projectData.value.model_param_size), 1),
501
- _cache[1] || (_cache[1] = createElementVNode("div", { class: "model-card-footer__dot" }, null, -1))
586
+ _cache[1] || (_cache[1] = createElementVNode("div", { class: "w-[4px] h-[4px] ml-[6px] mr-[6px] rounded-[2px] bg-[var(--theme-placeholder)]" }, null, -1))
502
587
  ], 64)) : createCommentVNode("", true),
503
588
  createElementVNode("span", _hoisted_4$1, toDisplayString(unref(formatTimeFromNow)(projectData.value.updated_at)), 1),
504
- _cache[2] || (_cache[2] = createElementVNode("div", { class: "model-card-footer__dot" }, null, -1)),
589
+ _cache[2] || (_cache[2] = createElementVNode("div", { class: "w-[4px] h-[4px] ml-[6px] mr-[6px] rounded-[2px] bg-[var(--theme-placeholder)]" }, null, -1)),
505
590
  createVNode(GIcon, {
506
591
  name: "gt-line-upload",
507
592
  size: "14px",
@@ -523,11 +608,10 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
523
608
  };
524
609
  }
525
610
  });
526
- const ModelCardFooter = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-vue-layout-gitcode"]]);
527
611
  const _hoisted_1 = ["innerHTML"];
528
612
  const _hoisted_2 = {
529
613
  key: 0,
530
- class: "is-recommend"
614
+ class: "is-recommend ml-[8px]"
531
615
  };
532
616
  const _hoisted_3 = { key: 1 };
533
617
  const _hoisted_4 = { key: 2 };
@@ -539,28 +623,24 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
539
623
  info: {},
540
624
  keyword: {},
541
625
  cardType: {},
542
- noborder: { type: Boolean, default: false },
543
- hover: { type: Boolean, default: false },
544
- hideTopicTags: { type: Boolean, default: false },
545
- urlParams: { default: () => ({}) },
546
- preserveUrlOrigin: { type: Boolean, default: false },
547
- hideStarBtn: { type: Boolean, default: false },
548
- hideFooter: { type: Boolean, default: false },
549
- hideDescription: { type: Boolean, default: false }
626
+ noborder: { type: Boolean },
627
+ hover: { type: Boolean },
628
+ hideTopicTags: { type: Boolean },
629
+ urlParams: {},
630
+ hideStarBtn: { type: Boolean },
631
+ hideFooter: { type: Boolean },
632
+ hideDescription: { type: Boolean }
550
633
  },
551
634
  emits: ["report"],
552
635
  setup(__props, { emit: __emit }) {
553
636
  const lang = useCookie(LANG_KEY, LANG_ZH);
554
- const request = inject("request") || (() => Promise.resolve({ data: {} }));
555
- const API = headRequest(request);
637
+ const API = headRequest(inject("request"));
556
638
  const emits = __emit;
557
639
  const router = useRouter();
558
640
  const { widthType } = usePageResize();
559
641
  const { t: $t } = i18n.global;
560
642
  const handleClick = () => {
561
- window.open(transWebUrl(transformUrl(props.info.web_url), props.urlParams, {
562
- preserveOrigin: props.preserveUrlOrigin
563
- }), "_blank");
643
+ window.open(transWebUrl(transformUrl(props.info.web_url), props.urlParams), "_blank");
564
644
  emits("report");
565
645
  _frEventTrack(EVENT_NAME.CLICK_SEARCH_RESULT);
566
646
  };
@@ -568,7 +648,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
568
648
  emits("report", "starReport");
569
649
  };
570
650
  const rowSpan = reactive({ xxl: 8, xl: 12, md: 12, lg: 24, sm: 24 });
571
- const repoIcon = { repo: "gt-line-repositories", model: "gt-line-line-Models", dataset: "gt-line-Datasets" };
651
+ const repoIcon = { repo: "gt-line-repositories", model: "gt-plane-models", dataset: "gt-line-Datasets" };
572
652
  const props = __props;
573
653
  console.log("i-search-projects-card", props.info, props.cardType);
574
654
  const iconName = computed(() => {
@@ -621,6 +701,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
621
701
  name_with_namespace: nameWithSpace,
622
702
  path_with_namespace: path,
623
703
  import_url: importUrl,
704
+ is_gh_mirrors: isGhMirrors,
624
705
  is_mirrors: isMirrors
625
706
  } = info || {};
626
707
  const isGitcodeRepo = REPO_TYPE.GITCODE === isMirrors;
@@ -637,13 +718,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
637
718
  });
638
719
  return (_ctx, _cache) => {
639
720
  return openBlock(), createElementBlock("a", {
640
- class: normalizeClass(["i-search-projects-card", { noborder: __props.noborder, "full-hover": __props.hover }]),
721
+ class: normalizeClass(["i-search-projects-card cursor-pointer", { noborder: __props.noborder, "full-hover": __props.hover }]),
641
722
  onClick: handleClick
642
723
  }, [
643
724
  createVNode(unref(Row), { class: "i-search-projects-card-title" }, {
644
725
  default: withCtx(() => [
645
726
  createVNode(unref(Col), {
646
- class: "ellipsis i-search-projects-card-title__col",
727
+ class: "ellipsis flex items-center gap-[8px]",
647
728
  flex: "auto"
648
729
  }, {
649
730
  default: withCtx(() => {
@@ -710,7 +791,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
710
791
  !__props.hideDescription ? (openBlock(), createElementBlock("div", {
711
792
  key: 0,
712
793
  innerHTML: unref(highlightWords)("", description.value),
713
- class: "i-search-projects-card-desc ellipsis"
794
+ class: "i-search-projects-card-desc ellipsis mt-[8px]"
714
795
  }, null, 8, _hoisted_5)) : createCommentVNode("", true),
715
796
  __props.info.index === 0 && __props.info.is_recommend ? (openBlock(), createElementBlock("div", _hoisted_6, [
716
797
  queryLoading.value ? (openBlock(), createBlock(unref(Skeleton), { key: 0 }, {
@@ -724,7 +805,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
724
805
  span: rowSpan[unref(widthType)]
725
806
  }, {
726
807
  default: withCtx(() => [
727
- createVNode(unref(SkeletonItem), { class: "i-search-projects-card-skel" })
808
+ createVNode(unref(SkeletonItem), { class: "h-[110px] mt-[16px]" })
728
809
  ]),
729
810
  _: 1
730
811
  }, 8, ["span"]),
@@ -732,7 +813,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
732
813
  span: rowSpan[unref(widthType)]
733
814
  }, {
734
815
  default: withCtx(() => [
735
- createVNode(unref(SkeletonItem), { class: "i-search-projects-card-skel" })
816
+ createVNode(unref(SkeletonItem), { class: "h-[110px] mt-[16px]" })
736
817
  ]),
737
818
  _: 1
738
819
  }, 8, ["span"]),
@@ -740,7 +821,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
740
821
  span: rowSpan[unref(widthType)]
741
822
  }, {
742
823
  default: withCtx(() => [
743
- createVNode(unref(SkeletonItem), { class: "i-search-projects-card-skel" })
824
+ createVNode(unref(SkeletonItem), { class: "h-[110px] mt-[16px]" })
744
825
  ]),
745
826
  _: 1
746
827
  }, 8, ["span"])
@@ -750,7 +831,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
750
831
  ]),
751
832
  _: 1
752
833
  })) : createCommentVNode("", true)
753
- ])) : isModel.value && !__props.hideFooter ? (openBlock(), createBlock(ModelCardFooter, {
834
+ ])) : isModel.value ? (openBlock(), createBlock(_sfc_main$1, {
754
835
  key: 2,
755
836
  repoInfo: __props.info
756
837
  }, null, 8, ["repoInfo"])) : (openBlock(), createElementBlock(Fragment, { key: 3 }, [
@@ -761,7 +842,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
761
842
  tagInfo: tagInfo.value,
762
843
  repoInfo: __props.info,
763
844
  searchCard: "",
764
- class: "i-search-projects-card-bottom",
845
+ class: "i-search-projects-card-bottom mt-[8px]",
765
846
  onTopicClick: handleTopicClick
766
847
  }, null, 8, ["hideTopicTags", "tagInfo", "repoInfo"])) : createCommentVNode("", true)
767
848
  ], 64))
@@ -770,140 +851,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
770
851
  }
771
852
  });
772
853
  const SearchRepoCard = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-vue-layout-gitcode"]]);
773
- const useReportRepo = (reportParams, viewReport) => {
774
- const list = ref([]);
775
- const pageRef = ref((window == null ? void 0 : window.page_ref) || "");
776
- const locationHref = ref((window == null ? void 0 : window.location.href) || "");
777
- const keyword = ref(reportParams == null ? void 0 : reportParams.keyword);
778
- const moduleName = ref(reportParams == null ? void 0 : reportParams.moduleName);
779
- const triggerReport = (type, data) => {
780
- if (type === "click") {
781
- const params = {
782
- chat_title: "",
783
- related: {
784
- list: [formatItem(data)],
785
- type: "repo"
786
- }
787
- };
788
- viewReport(pageRef.value, locationHref.value, "click", params);
789
- } else if (type === "expo") {
790
- list.value.push(data);
791
- }
792
- };
793
- const formatItem = (data) => {
794
- const channelNames = [];
795
- if (data.channelName) channelNames.push(data.channelName);
796
- if (data.subChannelName) channelNames.push(data.subChannelName);
797
- const repoId = isNaN(Number(data.id)) ? data.id : Number(data.id);
798
- return {
799
- type: "gitcode",
800
- repo_id: repoId,
801
- dest_url: data.web_url,
802
- strategy: channelNames.join("、") || "",
803
- // 官方项目
804
- repo_index: data.index,
805
- page: data.pageIndex || data.p || 0,
806
- per_page: data.pageSize || data.pp || 0,
807
- q: data.keyword || ""
808
- };
809
- };
810
- const doReport = debounce(() => {
811
- if (list.value.length >= 1) {
812
- const reportList = list.value.splice(0).map((item) => {
813
- return formatItem(item);
814
- });
815
- const params = {
816
- chat_title: "",
817
- extend_json: {
818
- key_words: keyword.value,
819
- module_name: moduleName.value
820
- },
821
- related: {
822
- list: reportList,
823
- type: "repo"
824
- }
825
- };
826
- viewReport(pageRef.value, locationHref.value, "expo", params);
827
- }
828
- }, 500, { leading: false });
829
- watchEffect(() => {
830
- if (list.value.length) {
831
- doReport();
832
- }
833
- });
834
- return {
835
- triggerReport
836
- };
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
- });
903
854
  export {
904
855
  SearchRepoCard as S,
905
- isProjectSuggestionType as i,
906
- mergeSearchSuggestions as m,
907
- normalizeProjectUrlForMainSite as n,
856
+ formatNameSpace as f,
908
857
  useReportRepo as u
909
858
  };
@@ -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, j as usePageResize, A as isZh, _ as _export_sfc } from "./index-DdlJC00I.js";
11
+ import { a as i18n, k as usePageResize, z as isZh, _ as _export_sfc } from "./index-cvKRePGR.js";
12
12
  const _YunpianCaptchaManager = class _YunpianCaptchaManager {
13
13
  // eslint-disable-next-line no-useless-constructor
14
14
  constructor() {