vue-layout-gitcode 1.12.34 → 1.12.36

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,4 +1,4 @@
1
- import { y as useLayoutConfig } from "./index-BYIXHuOy.js";
1
+ import { z as useLayoutConfig } from "./index-BOa97Aot.js";
2
2
  const layoutConfig = useLayoutConfig();
3
3
  const transWebUrl = (url, params) => {
4
4
  if (!url) return url;
@@ -1,7 +1,6 @@
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-BYIXHuOy.js";
4
- import { t as transWebUrl } from "./transWebUrl-C3zC-G_1.js";
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, f as useRequestReport, r as reqCatch, 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, o as _sfc_main$b, p as isIncubationRepo, q as highlightWords, t as transformUrl, w as _frEventTrack, E as EVENT_NAME, c as REPO_TYPE, e as extractRepoInfoWithURL, x as LANG_KEY } from "./index-BOa97Aot.js";
3
+ import { t as transWebUrl } from "./transWebUrl-BjEWcV7K.js";
5
4
  import { useRouter } from "vue-router";
6
5
  import { Row, Col } from "vue-devui-lal/grid";
7
6
  import { Skeleton, SkeletonItem } from "vue-devui-lal/skeleton";
@@ -9,74 +8,7 @@ import "vue-devui-lal/grid/style.css";
9
8
  import "vue-devui-lal/skeleton/style.css";
10
9
  import { Popover } from "vue-devui-lal/popover";
11
10
  import "vue-devui-lal/popover/style.css";
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
- };
11
+ import debounce from "lodash/debounce";
80
12
  const _sfc_main$a = /* @__PURE__ */ defineComponent({
81
13
  __name: "index",
82
14
  props: {
@@ -87,12 +19,12 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
87
19
  },
88
20
  setup(__props) {
89
21
  return (_ctx, _cache) => {
90
- return toDisplayString(unref(transferNumber)({ number: __props.number, fixed: __props.fixed, byte: __props.byte, gt100: __props.gt100 }));
22
+ return toDisplayString(unref(transferNumber)({ number: _ctx.number, fixed: _ctx.fixed, byte: _ctx.byte, gt100: _ctx.gt100 }));
91
23
  };
92
24
  }
93
25
  });
94
- const _hoisted_1$8 = { class: "relative flex" };
95
- const _hoisted_2$6 = { class: "absolute w-full h-full left-0 top-0" };
26
+ const _hoisted_1$8 = { class: "g-like" };
27
+ const _hoisted_2$6 = { class: "g-like__overlay" };
96
28
  const ANIM_END = "animEnd";
97
29
  const activeLikeIcon = "gt-plane-like";
98
30
  const unActiveLikeIcon = "gt-line-like";
@@ -127,7 +59,7 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
127
59
  return (_ctx, _cache) => {
128
60
  return openBlock(), createElementBlock("div", _hoisted_1$8, [
129
61
  createVNode(GIcon, {
130
- class: normalizeClass({ "!text-red-500": active.value }),
62
+ class: normalizeClass({ "g-like__active": active.value }),
131
63
  name: active.value ? activeLikeIcon : unActiveLikeIcon
132
64
  }, null, 8, ["class", "name"]),
133
65
  withDirectives(createElementVNode("div", _hoisted_2$6, [
@@ -136,7 +68,7 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
136
68
  onAnimationend: animationend
137
69
  }, [
138
70
  createVNode(GIcon, {
139
- class: "!text-red-500",
71
+ class: "g-like__active",
140
72
  name: activeLikeIcon
141
73
  })
142
74
  ], 32)
@@ -149,7 +81,7 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
149
81
  });
150
82
  const Like = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["__scopeId", "data-v-vue-layout-gitcode"]]);
151
83
  const _hoisted_1$7 = {
152
- class: "mr-[4px]",
84
+ class: "i-star-tag__icon-wrap",
153
85
  style: { "width": "15px", "height": "15px" }
154
86
  };
155
87
  const _hoisted_2$5 = { class: "i-star-tag__text" };
@@ -220,14 +152,14 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
220
152
  }])
221
153
  }, [
222
154
  createElementVNode("span", {
223
- class: normalizeClass(["i-star-tag hover:bg-[var(--theme-btn-default-hover)]", {
155
+ class: normalizeClass(["i-star-tag", {
224
156
  "i-star-tag__active": starred.value
225
157
  }]),
226
158
  onClick: withModifiers(handleStar, ["stop", "prevent"])
227
159
  }, [
228
- __props.isLike ? (openBlock(), createBlock(Like, {
160
+ _ctx.isLike ? (openBlock(), createBlock(Like, {
229
161
  key: 0,
230
- class: "mr-[4px]",
162
+ class: "i-star-tag__icon-mr",
231
163
  modelValue: starred.value,
232
164
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => starred.value = $event),
233
165
  runAnimation: running.value,
@@ -272,14 +204,14 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
272
204
  return (_ctx, _cache) => {
273
205
  return openBlock(), createElementBlock("div", _hoisted_1$6, [
274
206
  createVNode(GIcon, {
275
- class: "mr-[4px]",
207
+ class: "fork-tag__icon",
276
208
  name: "gt-line-fork",
277
209
  color: "var(--theme-home-card-color-placeholder)",
278
210
  size: "14"
279
211
  }),
280
212
  createElementVNode("span", null, [
281
213
  createVNode(_sfc_main$a, {
282
- number: __props.count || 0
214
+ number: _ctx.count || 0
283
215
  }, null, 8, ["number"])
284
216
  ])
285
217
  ]);
@@ -290,7 +222,7 @@ const ForkTag = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["__scopeId", "data-v-
290
222
  const _sfc_main$6 = /* @__PURE__ */ defineComponent({
291
223
  __name: "index",
292
224
  props: {
293
- tagInfo: { default: [] },
225
+ tagInfo: { default: () => [] },
294
226
  type: {}
295
227
  },
296
228
  setup(__props) {
@@ -298,15 +230,6 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
298
230
  const isTag = computed(() => props.type === "tag");
299
231
  const languageTag = props.tagInfo[0] || "";
300
232
  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
- });
310
233
  const tagFontColor = computed(() => {
311
234
  if (isTag.value) {
312
235
  return { color: tagColor };
@@ -324,7 +247,6 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
324
247
  style: normalizeStyle({ background: unref(tagColor), opacity: 0.1 })
325
248
  }, null, 4)) : createCommentVNode("", true),
326
249
  createElementVNode("i", {
327
- class: "mr-[4px]",
328
250
  style: normalizeStyle({ background: unref(tagColor) })
329
251
  }, null, 4),
330
252
  createTextVNode(toDisplayString(unref(languageTag)), 1)
@@ -351,9 +273,9 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
351
273
  color: "var(--theme-home-card-color-placeholder)",
352
274
  size: "14"
353
275
  }),
354
- !__props.hideText ? (openBlock(), createElementBlock("span", _hoisted_2$4, toDisplayString(unref($t)("gitCodeLayout.components.repo.today")), 1)) : createCommentVNode("", true),
276
+ !_ctx.hideText ? (openBlock(), createElementBlock("span", _hoisted_2$4, toDisplayString(unref($t)("gitCodeLayout.components.repo.today")), 1)) : createCommentVNode("", true),
355
277
  createVNode(_sfc_main$a, {
356
- number: __props.starCountOne || 0
278
+ number: _ctx.starCountOne || 0
357
279
  }, null, 8, ["number"])
358
280
  ]);
359
281
  };
@@ -364,7 +286,7 @@ const _hoisted_1$4 = {
364
286
  key: 0,
365
287
  class: "github-star-num"
366
288
  };
367
- const _hoisted_2$3 = { class: "leading-none" };
289
+ const _hoisted_2$3 = { class: "github-star-num__count" };
368
290
  const _sfc_main$4 = /* @__PURE__ */ defineComponent({
369
291
  ...{ name: "GithubStarNum" },
370
292
  __name: "index",
@@ -384,9 +306,9 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
384
306
  size: "14"
385
307
  }),
386
308
  createElementVNode("span", _hoisted_2$3, [
387
- _cache[0] || (_cache[0] = createTextVNode("Star ", -1)),
309
+ _cache[0] || (_cache[0] = createTextVNode("Star ")),
388
310
  createVNode(_sfc_main$a, {
389
- number: __props.count || 0,
311
+ number: _ctx.count || 0,
390
312
  gt100: true
391
313
  }, null, 8, ["number"])
392
314
  ])
@@ -395,7 +317,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
395
317
  }
396
318
  });
397
319
  const GithubStarNum = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-vue-layout-gitcode"]]);
398
- const _hoisted_1$3 = { class: "repo-card-footer mt-[4px]" };
320
+ const _hoisted_1$3 = { class: "repo-card-footer" };
399
321
  const _hoisted_2$2 = {
400
322
  key: 3,
401
323
  class: "line-separator"
@@ -409,12 +331,12 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
409
331
  __name: "index",
410
332
  props: {
411
333
  repoInfo: {},
412
- hideTopicTags: { type: Boolean },
413
- tagInfo: {},
414
- hideUpdateTime: { type: Boolean },
415
- hideStarIncrease: { type: Boolean },
416
- hideStarCount: { type: Boolean },
417
- searchCard: { type: Boolean }
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 }
418
340
  },
419
341
  emits: ["topicClick"],
420
342
  setup(__props, { emit: __emit }) {
@@ -426,52 +348,42 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
426
348
  var _a;
427
349
  return ((_a = props.repoInfo.tags) == null ? void 0 : _a.filter((item) => item.type === TOPIC_TYPE.USER)) || [];
428
350
  });
429
- ref(topicNames.value);
430
- const visibleCount = ref(0);
431
- ref(false);
432
351
  const showUpdateTimeDot = computed(() => {
433
352
  return !props.hideUpdateTime && (!props.hideStarCount || props.tagInfo && props.tagInfo[0] || props.repoInfo.forks_count);
434
353
  });
435
- computed(() => {
436
- return topicNames.value.length - visibleCount.value + 1;
437
- });
438
354
  const handleTopicClick = (topic) => {
439
355
  emits("topicClick", topic);
440
356
  };
441
- onMounted(() => {
442
- });
443
- onUnmounted(() => {
444
- });
445
357
  return (_ctx, _cache) => {
446
358
  return openBlock(), createElementBlock(Fragment, null, [
447
359
  createElementVNode("div", null, [
448
360
  createElementVNode("div", _hoisted_1$3, [
449
- __props.tagInfo ? (openBlock(), createBlock(LanguageTag, {
361
+ _ctx.tagInfo ? (openBlock(), createBlock(LanguageTag, {
450
362
  key: 0,
451
- "tag-info": __props.tagInfo
363
+ "tag-info": _ctx.tagInfo
452
364
  }, null, 8, ["tag-info"])) : createCommentVNode("", true),
453
- !__props.hideStarCount ? (openBlock(), createBlock(StarCountOne, {
365
+ !_ctx.hideStarCount ? (openBlock(), createBlock(StarCountOne, {
454
366
  key: 1,
455
367
  hideText: "",
456
- starCountOne: __props.repoInfo.star_count
368
+ starCountOne: _ctx.repoInfo.star_count
457
369
  }, null, 8, ["starCountOne"])) : createCommentVNode("", true),
458
- __props.repoInfo.forks_count ? (openBlock(), createBlock(ForkTag, {
370
+ _ctx.repoInfo.forks_count ? (openBlock(), createBlock(ForkTag, {
459
371
  key: 2,
460
- count: __props.repoInfo.forks_count
372
+ count: _ctx.repoInfo.forks_count
461
373
  }, null, 8, ["count"])) : createCommentVNode("", true),
462
374
  showUpdateTimeDot.value ? (openBlock(), createElementBlock("div", _hoisted_2$2)) : createCommentVNode("", true),
463
- !__props.hideUpdateTime ? (openBlock(), createElementBlock("div", _hoisted_3$2, toDisplayString(unref(formatTimeFromNow)((__props.searchCard ? __props.repoInfo.last_repository_updated_at : __props.repoInfo.last_activity_at) || __props.repoInfo.last_activity_at)), 1)) : createCommentVNode("", true),
464
- !__props.hideStarIncrease && __props.repoInfo.star_count_one ? (openBlock(), createBlock(StarCountOne, {
375
+ !_ctx.hideUpdateTime ? (openBlock(), createElementBlock("div", _hoisted_3$2, toDisplayString(unref(formatTimeFromNow)((_ctx.searchCard ? _ctx.repoInfo.last_repository_updated_at : _ctx.repoInfo.last_activity_at) || _ctx.repoInfo.last_activity_at)), 1)) : createCommentVNode("", true),
376
+ !_ctx.hideStarIncrease && _ctx.repoInfo.star_count_one ? (openBlock(), createBlock(StarCountOne, {
465
377
  key: 5,
466
- starCountOne: __props.repoInfo.star_count_one
378
+ starCountOne: _ctx.repoInfo.star_count_one
467
379
  }, null, 8, ["starCountOne"])) : createCommentVNode("", true),
468
- __props.repoInfo.is_gh_mirrors ? (openBlock(), createBlock(GithubStarNum, {
380
+ _ctx.repoInfo.is_gh_mirrors ? (openBlock(), createBlock(GithubStarNum, {
469
381
  key: 6,
470
- count: __props.repoInfo.import_star_count
382
+ count: _ctx.repoInfo.import_star_count
471
383
  }, null, 8, ["count"])) : createCommentVNode("", true)
472
384
  ])
473
385
  ]),
474
- !__props.hideTopicTags && topicNames.value.length && __props.searchCard ? (openBlock(), createElementBlock("div", {
386
+ !_ctx.hideTopicTags && topicNames.value.length && _ctx.searchCard ? (openBlock(), createElementBlock("div", {
475
387
  key: 0,
476
388
  class: "topic-tags",
477
389
  ref_key: "topicTagsRef",
@@ -490,6 +402,9 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
490
402
  }
491
403
  });
492
404
  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
+ };
493
408
  const _hoisted_1$2 = { class: "new-tag-content" };
494
409
  const _sfc_main$2 = /* @__PURE__ */ defineComponent({
495
410
  __name: "index",
@@ -533,7 +448,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
533
448
  createElementVNode("span", _hoisted_1$2, toDisplayString(tagTipsText.value), 1)
534
449
  ]),
535
450
  default: withCtx(() => [
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))
451
+ _cache[0] || (_cache[0] = createElementVNode("div", { class: "new-tag" }, "New", -1))
537
452
  ]),
538
453
  _: 1
539
454
  })) : createCommentVNode("", true);
@@ -541,17 +456,17 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
541
456
  }
542
457
  });
543
458
  const NewTag = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-vue-layout-gitcode"]]);
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)]" };
459
+ const _hoisted_1$1 = { class: "model-card-footer" };
545
460
  const _hoisted_2$1 = {
546
461
  key: 1,
547
- class: "ellipsis max-150 ml-[6px]"
462
+ class: "ellipsis max-150 model-card-footer__text"
548
463
  };
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]" };
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" };
552
467
  const _hoisted_6$1 = {
553
468
  key: 2,
554
- class: "w-[4px] h-[4px] ml-[6px] mr-[6px] rounded-[2px] bg-[var(--theme-placeholder)]"
469
+ class: "model-card-footer__dot"
555
470
  };
556
471
  const _sfc_main$1 = /* @__PURE__ */ defineComponent({
557
472
  __name: "ModelCardFooter",
@@ -574,7 +489,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
574
489
  size: "12px"
575
490
  }, null, 8, ["name"])) : createCommentVNode("", true),
576
491
  projectData.value.task[0].name ? (openBlock(), createElementBlock("span", _hoisted_2$1, toDisplayString(projectData.value.task[0].name), 1)) : createCommentVNode("", true),
577
- _cache[0] || (_cache[0] = createElementVNode("div", { class: "w-[4px] h-[4px] ml-[6px] mr-[6px] rounded-[2px] bg-[var(--theme-placeholder)]" }, null, -1))
492
+ _cache[0] || (_cache[0] = createElementVNode("div", { class: "model-card-footer__dot" }, null, -1))
578
493
  ], 64)) : createCommentVNode("", true),
579
494
  projectData.value.model_param_size ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
580
495
  createVNode(GIcon, {
@@ -583,10 +498,10 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
583
498
  color: "var(--theme-release-card-text-color)"
584
499
  }),
585
500
  createElementVNode("span", _hoisted_3$1, toDisplayString(projectData.value.model_param_size), 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))
501
+ _cache[1] || (_cache[1] = createElementVNode("div", { class: "model-card-footer__dot" }, null, -1))
587
502
  ], 64)) : createCommentVNode("", true),
588
503
  createElementVNode("span", _hoisted_4$1, toDisplayString(unref(formatTimeFromNow)(projectData.value.updated_at)), 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)),
504
+ _cache[2] || (_cache[2] = createElementVNode("div", { class: "model-card-footer__dot" }, null, -1)),
590
505
  createVNode(GIcon, {
591
506
  name: "gt-line-upload",
592
507
  size: "14px",
@@ -608,10 +523,11 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
608
523
  };
609
524
  }
610
525
  });
526
+ const ModelCardFooter = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-vue-layout-gitcode"]]);
611
527
  const _hoisted_1 = ["innerHTML"];
612
528
  const _hoisted_2 = {
613
529
  key: 0,
614
- class: "is-recommend ml-[8px]"
530
+ class: "is-recommend"
615
531
  };
616
532
  const _hoisted_3 = { key: 1 };
617
533
  const _hoisted_4 = { key: 2 };
@@ -623,18 +539,19 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
623
539
  info: {},
624
540
  keyword: {},
625
541
  cardType: {},
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 }
542
+ noborder: { type: Boolean, default: false },
543
+ hover: { type: Boolean, default: false },
544
+ hideTopicTags: { type: Boolean, default: false },
545
+ urlParams: { default: () => ({}) },
546
+ hideStarBtn: { type: Boolean, default: false },
547
+ hideFooter: { type: Boolean, default: false },
548
+ hideDescription: { type: Boolean, default: false }
633
549
  },
634
550
  emits: ["report"],
635
551
  setup(__props, { emit: __emit }) {
636
552
  const lang = useCookie(LANG_KEY, LANG_ZH);
637
- const API = headRequest(inject("request"));
553
+ const request = inject("request") || (() => Promise.resolve({ data: {} }));
554
+ const API = headRequest(request);
638
555
  const emits = __emit;
639
556
  const router = useRouter();
640
557
  const { widthType } = usePageResize();
@@ -648,7 +565,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
648
565
  emits("report", "starReport");
649
566
  };
650
567
  const rowSpan = reactive({ xxl: 8, xl: 12, md: 12, lg: 24, sm: 24 });
651
- const repoIcon = { repo: "gt-line-repositories", model: "gt-plane-models", dataset: "gt-line-Datasets" };
568
+ const repoIcon = { repo: "gt-line-repositories", model: "gt-line-line-Models", dataset: "gt-line-Datasets" };
652
569
  const props = __props;
653
570
  console.log("i-search-projects-card", props.info, props.cardType);
654
571
  const iconName = computed(() => {
@@ -701,7 +618,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
701
618
  name_with_namespace: nameWithSpace,
702
619
  path_with_namespace: path,
703
620
  import_url: importUrl,
704
- is_gh_mirrors: isGhMirrors,
705
621
  is_mirrors: isMirrors
706
622
  } = info || {};
707
623
  const isGitcodeRepo = REPO_TYPE.GITCODE === isMirrors;
@@ -718,13 +634,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
718
634
  });
719
635
  return (_ctx, _cache) => {
720
636
  return openBlock(), createElementBlock("a", {
721
- class: normalizeClass(["i-search-projects-card cursor-pointer", { noborder: __props.noborder, "full-hover": __props.hover }]),
637
+ class: normalizeClass(["i-search-projects-card", { noborder: _ctx.noborder, "full-hover": _ctx.hover }]),
722
638
  onClick: handleClick
723
639
  }, [
724
640
  createVNode(unref(Row), { class: "i-search-projects-card-title" }, {
725
641
  default: withCtx(() => [
726
642
  createVNode(unref(Col), {
727
- class: "ellipsis flex items-center gap-[8px]",
643
+ class: "ellipsis i-search-projects-card-title__col",
728
644
  flex: "auto"
729
645
  }, {
730
646
  default: withCtx(() => {
@@ -732,43 +648,43 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
732
648
  return [
733
649
  createVNode(GIcon, {
734
650
  name: iconName.value,
735
- class: normalizeClass({ "align-middle": __props.info.is_gh_mirrors }),
651
+ class: normalizeClass({ "align-middle": _ctx.info.is_gh_mirrors }),
736
652
  color: "var(--theme-placeholder)"
737
653
  }, null, 8, ["name", "class"]),
738
654
  createElementVNode("span", {
739
655
  class: "repo-title",
740
656
  innerHTML: preHandWord()
741
657
  }, null, 8, _hoisted_1),
742
- __props.info.show_recommend_icon ? (openBlock(), createElementBlock("span", _hoisted_2, toDisplayString(unref($t)("gitCodeLayout.search.recommendTag")), 1)) : createCommentVNode("", true),
743
- unref(isGstarRepo)(__props.info.topic_names) ? (openBlock(), createElementBlock("div", _hoisted_3, [
658
+ _ctx.info.show_recommend_icon ? (openBlock(), createElementBlock("span", _hoisted_2, toDisplayString(unref($t)("gitCodeLayout.search.recommendTag")), 1)) : createCommentVNode("", true),
659
+ unref(isGstarRepo)(_ctx.info.topic_names) ? (openBlock(), createElementBlock("div", _hoisted_3, [
744
660
  createVNode(_sfc_main$b, {
745
661
  origin: "repo",
746
662
  icon: "",
747
663
  type: "gstar",
748
664
  message: `G-Star ${unref($t)("gitCodeLayout.GStar.project.graduation")}`
749
665
  }, {
750
- default: withCtx(() => [..._cache[0] || (_cache[0] = [
751
- createTextVNode("G-Star ", -1)
752
- ])]),
666
+ default: withCtx(() => _cache[0] || (_cache[0] = [
667
+ createTextVNode("G-Star ")
668
+ ])),
753
669
  _: 1
754
670
  }, 8, ["message"])
755
671
  ])) : createCommentVNode("", true),
756
- unref(isIncubationRepo)(__props.info.topic_names) ? (openBlock(), createElementBlock("div", _hoisted_4, [
672
+ unref(isIncubationRepo)(_ctx.info.topic_names) ? (openBlock(), createElementBlock("div", _hoisted_4, [
757
673
  createVNode(_sfc_main$b, {
758
674
  origin: "repo",
759
675
  icon: "",
760
676
  type: "incubation",
761
677
  message: `G-Star ${unref($t)("gitCodeLayout.GStar.project.incubation")}`
762
678
  }, {
763
- default: withCtx(() => [..._cache[1] || (_cache[1] = [
764
- createTextVNode(" G-Star ", -1)
765
- ])]),
679
+ default: withCtx(() => _cache[1] || (_cache[1] = [
680
+ createTextVNode(" G-Star ")
681
+ ])),
766
682
  _: 1
767
683
  }, 8, ["message"])
768
684
  ])) : createCommentVNode("", true),
769
685
  createVNode(NewTag, {
770
- repoType: __props.cardType,
771
- isNew: ((_a = __props.info) == null ? void 0 : _a.is_new) || false
686
+ repoType: _ctx.cardType,
687
+ isNew: ((_a = _ctx.info) == null ? void 0 : _a.is_new) || false
772
688
  }, null, 8, ["repoType", "isNew"])
773
689
  ];
774
690
  }),
@@ -776,7 +692,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
776
692
  }),
777
693
  createVNode(unref(Col), { flex: "none" }, {
778
694
  default: withCtx(() => [
779
- !__props.hideStarBtn ? (openBlock(), createBlock(StarTag, {
695
+ !_ctx.hideStarBtn ? (openBlock(), createBlock(StarTag, {
780
696
  key: 0,
781
697
  isLike: isModel.value,
782
698
  "star-info": starInfo.value,
@@ -788,12 +704,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
788
704
  ]),
789
705
  _: 1
790
706
  }),
791
- !__props.hideDescription ? (openBlock(), createElementBlock("div", {
707
+ !_ctx.hideDescription ? (openBlock(), createElementBlock("div", {
792
708
  key: 0,
793
709
  innerHTML: unref(highlightWords)("", description.value),
794
- class: "i-search-projects-card-desc ellipsis mt-[8px]"
710
+ class: "i-search-projects-card-desc ellipsis"
795
711
  }, null, 8, _hoisted_5)) : createCommentVNode("", true),
796
- __props.info.index === 0 && __props.info.is_recommend ? (openBlock(), createElementBlock("div", _hoisted_6, [
712
+ _ctx.info.index === 0 && _ctx.info.is_recommend ? (openBlock(), createElementBlock("div", _hoisted_6, [
797
713
  queryLoading.value ? (openBlock(), createBlock(unref(Skeleton), { key: 0 }, {
798
714
  placeholder: withCtx(() => [
799
715
  createVNode(unref(Row), {
@@ -805,7 +721,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
805
721
  span: rowSpan[unref(widthType)]
806
722
  }, {
807
723
  default: withCtx(() => [
808
- createVNode(unref(SkeletonItem), { class: "h-[110px] mt-[16px]" })
724
+ createVNode(unref(SkeletonItem), { class: "i-search-projects-card-skel" })
809
725
  ]),
810
726
  _: 1
811
727
  }, 8, ["span"]),
@@ -813,7 +729,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
813
729
  span: rowSpan[unref(widthType)]
814
730
  }, {
815
731
  default: withCtx(() => [
816
- createVNode(unref(SkeletonItem), { class: "h-[110px] mt-[16px]" })
732
+ createVNode(unref(SkeletonItem), { class: "i-search-projects-card-skel" })
817
733
  ]),
818
734
  _: 1
819
735
  }, 8, ["span"]),
@@ -821,7 +737,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
821
737
  span: rowSpan[unref(widthType)]
822
738
  }, {
823
739
  default: withCtx(() => [
824
- createVNode(unref(SkeletonItem), { class: "h-[110px] mt-[16px]" })
740
+ createVNode(unref(SkeletonItem), { class: "i-search-projects-card-skel" })
825
741
  ]),
826
742
  _: 1
827
743
  }, 8, ["span"])
@@ -831,18 +747,18 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
831
747
  ]),
832
748
  _: 1
833
749
  })) : createCommentVNode("", true)
834
- ])) : isModel.value ? (openBlock(), createBlock(_sfc_main$1, {
750
+ ])) : isModel.value && !_ctx.hideFooter ? (openBlock(), createBlock(ModelCardFooter, {
835
751
  key: 2,
836
- repoInfo: __props.info
752
+ repoInfo: _ctx.info
837
753
  }, null, 8, ["repoInfo"])) : (openBlock(), createElementBlock(Fragment, { key: 3 }, [
838
- !__props.hideFooter ? (openBlock(), createBlock(RepoCardFooter, {
754
+ !_ctx.hideFooter ? (openBlock(), createBlock(RepoCardFooter, {
839
755
  key: 0,
840
- hideTopicTags: __props.hideTopicTags,
756
+ hideTopicTags: _ctx.hideTopicTags,
841
757
  hideStarCount: "",
842
758
  tagInfo: tagInfo.value,
843
- repoInfo: __props.info,
759
+ repoInfo: _ctx.info,
844
760
  searchCard: "",
845
- class: "i-search-projects-card-bottom mt-[8px]",
761
+ class: "i-search-projects-card-bottom",
846
762
  onTopicClick: handleTopicClick
847
763
  }, null, 8, ["hideTopicTags", "tagInfo", "repoInfo"])) : createCommentVNode("", true)
848
764
  ], 64))
@@ -851,6 +767,71 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
851
767
  }
852
768
  });
853
769
  const SearchRepoCard = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-vue-layout-gitcode"]]);
770
+ const useReportRepo = (reportParams, viewReport) => {
771
+ const list = ref([]);
772
+ const pageRef = ref((window == null ? void 0 : window.page_ref) || "");
773
+ const locationHref = ref((window == null ? void 0 : window.location.href) || "");
774
+ const keyword = ref(reportParams == null ? void 0 : reportParams.keyword);
775
+ const moduleName = ref(reportParams == null ? void 0 : reportParams.moduleName);
776
+ const triggerReport = (type, data) => {
777
+ if (type === "click") {
778
+ const params = {
779
+ chat_title: "",
780
+ related: {
781
+ list: [formatItem(data)],
782
+ type: "repo"
783
+ }
784
+ };
785
+ viewReport(pageRef.value, locationHref.value, "click", params);
786
+ } else if (type === "expo") {
787
+ list.value.push(data);
788
+ }
789
+ };
790
+ const formatItem = (data) => {
791
+ const channelNames = [];
792
+ if (data.channelName) channelNames.push(data.channelName);
793
+ if (data.subChannelName) channelNames.push(data.subChannelName);
794
+ const repoId = isNaN(Number(data.id)) ? data.id : Number(data.id);
795
+ return {
796
+ type: "gitcode",
797
+ repo_id: repoId,
798
+ dest_url: data.web_url,
799
+ strategy: channelNames.join("、") || "",
800
+ // 官方项目
801
+ repo_index: data.index,
802
+ page: data.pageIndex || data.p || 0,
803
+ per_page: data.pageSize || data.pp || 0,
804
+ q: data.keyword || ""
805
+ };
806
+ };
807
+ const doReport = debounce(() => {
808
+ if (list.value.length >= 1) {
809
+ const reportList = list.value.splice(0).map((item) => {
810
+ return formatItem(item);
811
+ });
812
+ const params = {
813
+ chat_title: "",
814
+ extend_json: {
815
+ key_words: keyword.value,
816
+ module_name: moduleName.value
817
+ },
818
+ related: {
819
+ list: reportList,
820
+ type: "repo"
821
+ }
822
+ };
823
+ viewReport(pageRef.value, locationHref.value, "expo", params);
824
+ }
825
+ }, 500, { leading: false });
826
+ watchEffect(() => {
827
+ if (list.value.length) {
828
+ doReport();
829
+ }
830
+ });
831
+ return {
832
+ triggerReport
833
+ };
834
+ };
854
835
  export {
855
836
  SearchRepoCard as S,
856
837
  formatNameSpace as f,