vue-layout-gitcode 1.1.18 → 1.1.20

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,10 +1,11 @@
1
- import { ref, watchEffect, defineComponent, toDisplayString, inject, createElementBlock, openBlock, normalizeClass, createElementVNode, withModifiers, withDirectives, vShow, createVNode, computed, createCommentVNode, unref, normalizeStyle, createTextVNode, onMounted, onUnmounted, Fragment, createBlock, renderList, reactive, withCtx } from "vue";
2
- import { d as debounce, h as headRequest, G as GIcon, r as reqCatch, _ as _export_sfc, a as i18n, T as TOPIC_TYPE, f as useTimeFormat, g as usePageResize, j as isGstarRepo, k as _sfc_main$8, m as isIncubationRepo, n as highlightWords, t as transWebUrl, o as _frEventTrack, E as EVENT_NAME, b as REPO_TYPE, e as extractRepoInfoWithURL } from "./index-BITTokMy.js";
1
+ import { ref, watchEffect, defineComponent, toDisplayString, inject, openBlock, createElementBlock, normalizeClass, createElementVNode, withModifiers, withDirectives, vShow, createVNode, computed, unref, normalizeStyle, createCommentVNode, createTextVNode, onMounted, onUnmounted, Fragment, createBlock, renderList, reactive, withCtx } from "vue";
2
+ import { d as debounce, h as headRequest, G as GIcon, r as reqCatch, _ as _export_sfc, a as i18n, T as TOPIC_TYPE, f as useTimeFormat, L as LANG_KEY, g as LANG_ZH, j as usePageResize, k as isGstarRepo, m as _sfc_main$8, n as isIncubationRepo, o as highlightWords, t as transWebUrl, p as _frEventTrack, E as EVENT_NAME, c as REPO_TYPE, e as extractRepoInfoWithURL } from "./index-7e42cedb.js";
3
3
  import { useRouter } from "vue-router";
4
4
  import { Row, Col } from "vue-devui-lal/grid";
5
5
  import { Skeleton, SkeletonItem } from "vue-devui-lal/skeleton";
6
6
  import "vue-devui-lal/grid/style.css";
7
7
  import "vue-devui-lal/skeleton/style.css";
8
+ import { useLocalStorage } from "@vueuse/core";
8
9
  const useReportRepo = (reportParams, viewReport) => {
9
10
  const list = ref([]);
10
11
  const pageRef = ref((window == null ? void 0 : window.page_ref) || "");
@@ -27,8 +28,10 @@ const useReportRepo = (reportParams, viewReport) => {
27
28
  };
28
29
  const formatItem = (data) => {
29
30
  const channelNames = [];
30
- if (data.channelName) channelNames.push(data.channelName);
31
- if (data.subChannelName) channelNames.push(data.subChannelName);
31
+ if (data.channelName)
32
+ channelNames.push(data.channelName);
33
+ if (data.subChannelName)
34
+ channelNames.push(data.subChannelName);
32
35
  return {
33
36
  type: "gitcode",
34
37
  repo_id: data.id,
@@ -136,7 +139,8 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
136
139
  const handleStar = async (e) => {
137
140
  e.preventDefault();
138
141
  try {
139
- if (starLoading.value) return;
142
+ if (starLoading.value)
143
+ return;
140
144
  starLoading.value = true;
141
145
  const params = { repoId: props.starInfo.id };
142
146
  let res;
@@ -202,7 +206,8 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
202
206
  };
203
207
  }
204
208
  });
205
- const StarTag = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["__scopeId", "data-v-gitcode-layout-lib"]]);
209
+ const index_vue_vue_type_style_index_0_scoped_754df2e0_lang = "";
210
+ const StarTag = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["__scopeId", "data-v-754df2e0"]]);
206
211
  const _hoisted_1$4 = { class: "fork-tag" };
207
212
  const _sfc_main$5 = /* @__PURE__ */ defineComponent({
208
213
  __name: "index",
@@ -227,7 +232,8 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
227
232
  };
228
233
  }
229
234
  });
230
- const ForkTag = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-gitcode-layout-lib"]]);
235
+ const index_vue_vue_type_style_index_0_scoped_98be5d7f_lang = "";
236
+ const ForkTag = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-98be5d7f"]]);
231
237
  const _sfc_main$4 = /* @__PURE__ */ defineComponent({
232
238
  __name: "index",
233
239
  props: {
@@ -273,7 +279,8 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
273
279
  };
274
280
  }
275
281
  });
276
- const LanguageTag = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-gitcode-layout-lib"]]);
282
+ const index_vue_vue_type_style_index_0_scoped_6e1aad17_lang = "";
283
+ const LanguageTag = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-6e1aad17"]]);
277
284
  const _hoisted_1$3 = { class: "star-count-one" };
278
285
  const _hoisted_2$3 = { key: 0 };
279
286
  const _sfc_main$3 = /* @__PURE__ */ defineComponent({
@@ -300,7 +307,8 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
300
307
  };
301
308
  }
302
309
  });
303
- const StarCountOne = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-gitcode-layout-lib"]]);
310
+ const index_vue_vue_type_style_index_0_scoped_de8d9362_lang = "";
311
+ const StarCountOne = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-de8d9362"]]);
304
312
  const _hoisted_1$2 = { class: "github-star-num" };
305
313
  const _hoisted_2$2 = { class: "leading-none" };
306
314
  const _sfc_main$2 = /* @__PURE__ */ defineComponent({
@@ -327,7 +335,8 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
327
335
  };
328
336
  }
329
337
  });
330
- const GithubStarNum = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-gitcode-layout-lib"]]);
338
+ const index_vue_vue_type_style_index_0_scoped_7f7e79b1_lang = "";
339
+ const GithubStarNum = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-7f7e79b1"]]);
331
340
  const _hoisted_1$1 = { class: "repo-card-footer mt-[4px]" };
332
341
  const _hoisted_2$1 = {
333
342
  key: 3,
@@ -419,7 +428,8 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
419
428
  };
420
429
  }
421
430
  });
422
- const RepoCardFooter = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-gitcode-layout-lib"]]);
431
+ const index_vue_vue_type_style_index_0_scoped_ca800e14_lang = "";
432
+ const RepoCardFooter = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-ca800e14"]]);
423
433
  const _hoisted_1 = ["innerHTML"];
424
434
  const _hoisted_2 = {
425
435
  key: 0,
@@ -444,6 +454,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
444
454
  },
445
455
  emits: ["report"],
446
456
  setup(__props, { emit: __emit }) {
457
+ const lang = useLocalStorage(LANG_KEY, LANG_ZH);
447
458
  const API = headRequest(inject("request"));
448
459
  const emits = __emit;
449
460
  const router = useRouter();
@@ -467,6 +478,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
467
478
  }
468
479
  return repoIcon[props.cardType] || "gt-line-repositories";
469
480
  });
481
+ const description = computed(() => {
482
+ if (lang.value === LANG_ZH) {
483
+ return props.info.description_cn || props.info.description;
484
+ }
485
+ return props.info.description || props.info.description_cn;
486
+ });
470
487
  const graphInfo = reactive({ commit_stat: null, trends: null });
471
488
  const starInfo = computed(() => {
472
489
  return { id: props.info.id, starred: props.info.starred, starCount: props.info.star_count };
@@ -514,7 +531,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
514
531
  return highlightWords(keyword, contentArr.join("/"), true);
515
532
  };
516
533
  onMounted(() => {
517
- if (props.info.is_recommend && props.info.index === 0) handleQueryGraph();
534
+ if (props.info.is_recommend && props.info.index === 0)
535
+ handleQueryGraph();
518
536
  });
519
537
  return (_ctx, _cache) => {
520
538
  return openBlock(), createElementBlock("a", {
@@ -581,7 +599,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
581
599
  _: 1
582
600
  }),
583
601
  createElementVNode("div", {
584
- innerHTML: unref(highlightWords)("", _ctx.info.description),
602
+ innerHTML: unref(highlightWords)("", description.value),
585
603
  class: "i-search-projects-card-desc ellipsis"
586
604
  }, null, 8, _hoisted_5),
587
605
  _ctx.info.index === 0 && _ctx.info.is_recommend ? (openBlock(), createElementBlock("div", _hoisted_6, [
@@ -638,7 +656,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
638
656
  };
639
657
  }
640
658
  });
641
- const SearchRepoCard = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-gitcode-layout-lib"]]);
659
+ const index_vue_vue_type_style_index_0_scoped_9047871e_lang = "";
660
+ const SearchRepoCard = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-9047871e"]]);
642
661
  export {
643
662
  SearchRepoCard as S,
644
663
  formatNameSpace as f,