vue-layout-gitcode 1.3.39 → 1.3.40

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,11 +1,13 @@
1
- import { ref, watchEffect, defineComponent, toDisplayString, unref, inject, createElementBlock, openBlock, normalizeClass, createElementVNode, withModifiers, withDirectives, vShow, createVNode, computed, createCommentVNode, normalizeStyle, createTextVNode, onMounted, onUnmounted, Fragment, createBlock, renderList, reactive, withCtx } from "vue";
2
- import { d as debounce, t as transferNumber, G as GIcon, s as setLoginTriggerSource, f as useRequestReport, r as reqCatch, h as headRequest, _ as _export_sfc, a as i18n, T as TOPIC_TYPE, g as useTimeFormat, L as LANG_KEY, j as LANG_ZH, k as usePageResize, m as isGstarRepo, n as _sfc_main$8, o as isIncubationRepo, p as highlightWords, q as transWebUrl, v as _frEventTrack, E as EVENT_NAME, c as REPO_TYPE, e as extractRepoInfoWithURL } from "./index-CGyHM1VW.js";
1
+ import { ref, watchEffect, defineComponent, toDisplayString, unref, inject, createElementBlock, openBlock, normalizeClass, createElementVNode, withModifiers, withDirectives, vShow, createVNode, computed, createCommentVNode, normalizeStyle, createTextVNode, onMounted, onUnmounted, Fragment, createBlock, renderList, withCtx, reactive } from "vue";
2
+ import { d as debounce, t as transferNumber, G as GIcon, s as setLoginTriggerSource, f as useRequestReport, r as reqCatch, h as headRequest, _ as _export_sfc, a as i18n, T as TOPIC_TYPE, g as useTimeFormat, L as LANG_KEY, j as LANG_ZH, k as usePageResize, m as isGstarRepo, n as _sfc_main$9, o as isIncubationRepo, p as highlightWords, q as transWebUrl, w as _frEventTrack, E as EVENT_NAME, c as REPO_TYPE, e as extractRepoInfoWithURL } from "./index-8onKOHd0.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
8
  import { useLocalStorage } from "@vueuse/core";
9
+ import { Popover } from "vue-devui-lal/popover";
10
+ import "vue-devui-lal/popover/style.css";
9
11
  const useReportRepo = (reportParams, viewReport) => {
10
12
  const list = ref([]);
11
13
  const pageRef = ref((window == null ? void 0 : window.page_ref) || "");
@@ -74,7 +76,7 @@ const useReportRepo = (reportParams, viewReport) => {
74
76
  const formatNameSpace = (content) => {
75
77
  return content.trim().replace(/\s+/g, "").replace(/^(GitHub加速计划\/|HuggingFace镜像\/)/, "").split("/").filter(Boolean);
76
78
  };
77
- const _sfc_main$7 = /* @__PURE__ */ defineComponent({
79
+ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
78
80
  __name: "index",
79
81
  props: {
80
82
  number: {},
@@ -88,12 +90,12 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
88
90
  };
89
91
  }
90
92
  });
91
- const _hoisted_1$5 = {
93
+ const _hoisted_1$6 = {
92
94
  class: "mr-[4px]",
93
95
  style: { "width": "15px", "height": "15px" }
94
96
  };
95
97
  const _hoisted_2$4 = { class: "i-star-tag__text" };
96
- const _sfc_main$6 = /* @__PURE__ */ defineComponent({
98
+ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
97
99
  __name: "index",
98
100
  props: {
99
101
  starInfo: { default: () => ({
@@ -167,7 +169,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
167
169
  }, null, 544), [
168
170
  [vShow, running.value]
169
171
  ]),
170
- createElementVNode("div", _hoisted_1$5, [
172
+ createElementVNode("div", _hoisted_1$6, [
171
173
  withDirectives(createVNode(GIcon, {
172
174
  size: "15",
173
175
  name: starred.value ? "gt-a-star_open_16px1" : "gt-line-new-star",
@@ -179,7 +181,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
179
181
  ])
180
182
  ]),
181
183
  createElementVNode("span", _hoisted_2$4, [
182
- createVNode(_sfc_main$7, {
184
+ createVNode(_sfc_main$8, {
183
185
  number: Number(starCount.value || 0)
184
186
  }, null, 8, ["number"])
185
187
  ])
@@ -188,16 +190,16 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
188
190
  };
189
191
  }
190
192
  });
191
- const StarTag = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["__scopeId", "data-v-gitcode-layout-lib"]]);
192
- const _hoisted_1$4 = { class: "fork-tag" };
193
- const _sfc_main$5 = /* @__PURE__ */ defineComponent({
193
+ const StarTag = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["__scopeId", "data-v-gitcode-layout-lib"]]);
194
+ const _hoisted_1$5 = { class: "fork-tag" };
195
+ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
194
196
  __name: "index",
195
197
  props: {
196
198
  count: {}
197
199
  },
198
200
  setup(__props) {
199
201
  return (_ctx, _cache) => {
200
- return openBlock(), createElementBlock("div", _hoisted_1$4, [
202
+ return openBlock(), createElementBlock("div", _hoisted_1$5, [
201
203
  createVNode(GIcon, {
202
204
  class: "mr-[4px]",
203
205
  name: "gt-line-fork",
@@ -205,7 +207,7 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
205
207
  size: "14"
206
208
  }),
207
209
  createElementVNode("span", null, [
208
- createVNode(_sfc_main$7, {
210
+ createVNode(_sfc_main$8, {
209
211
  number: _ctx.count || 0
210
212
  }, null, 8, ["number"])
211
213
  ])
@@ -213,8 +215,8 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
213
215
  };
214
216
  }
215
217
  });
216
- const ForkTag = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-gitcode-layout-lib"]]);
217
- const _sfc_main$4 = /* @__PURE__ */ defineComponent({
218
+ const ForkTag = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["__scopeId", "data-v-gitcode-layout-lib"]]);
219
+ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
218
220
  __name: "index",
219
221
  props: {
220
222
  tagInfo: { default: [] },
@@ -259,10 +261,10 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
259
261
  };
260
262
  }
261
263
  });
262
- const LanguageTag = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-gitcode-layout-lib"]]);
263
- const _hoisted_1$3 = { class: "star-count-one" };
264
+ const LanguageTag = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-gitcode-layout-lib"]]);
265
+ const _hoisted_1$4 = { class: "star-count-one" };
264
266
  const _hoisted_2$3 = { key: 0 };
265
- const _sfc_main$3 = /* @__PURE__ */ defineComponent({
267
+ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
266
268
  ...{ name: "star-count-one" },
267
269
  __name: "index",
268
270
  props: {
@@ -272,27 +274,27 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
272
274
  setup(__props) {
273
275
  const { t: $t } = i18n.global;
274
276
  return (_ctx, _cache) => {
275
- return openBlock(), createElementBlock("div", _hoisted_1$3, [
277
+ return openBlock(), createElementBlock("div", _hoisted_1$4, [
276
278
  createVNode(GIcon, {
277
279
  name: "gt-line-new-star",
278
280
  color: "var(--theme-home-card-color-placeholder)",
279
281
  size: "14"
280
282
  }),
281
283
  !_ctx.hideText ? (openBlock(), createElementBlock("span", _hoisted_2$3, toDisplayString(unref($t)("gitCodeLayout.components.repo.today")), 1)) : createCommentVNode("", true),
282
- createVNode(_sfc_main$7, {
284
+ createVNode(_sfc_main$8, {
283
285
  number: _ctx.starCountOne || 0
284
286
  }, null, 8, ["number"])
285
287
  ]);
286
288
  };
287
289
  }
288
290
  });
289
- const StarCountOne = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-gitcode-layout-lib"]]);
290
- const _hoisted_1$2 = {
291
+ const StarCountOne = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-gitcode-layout-lib"]]);
292
+ const _hoisted_1$3 = {
291
293
  key: 0,
292
294
  class: "github-star-num"
293
295
  };
294
296
  const _hoisted_2$2 = { class: "leading-none" };
295
- const _sfc_main$2 = /* @__PURE__ */ defineComponent({
297
+ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
296
298
  ...{ name: "GithubStarNum" },
297
299
  __name: "index",
298
300
  props: {
@@ -304,7 +306,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
304
306
  return props.count && props.count >= 100;
305
307
  });
306
308
  return (_ctx, _cache) => {
307
- return starVisible.value ? (openBlock(), createElementBlock("div", _hoisted_1$2, [
309
+ return starVisible.value ? (openBlock(), createElementBlock("div", _hoisted_1$3, [
308
310
  createVNode(GIcon, {
309
311
  name: "gt-line-github",
310
312
  color: "var(--theme-home-card-color-placeholder)",
@@ -312,7 +314,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
312
314
  }),
313
315
  createElementVNode("span", _hoisted_2$2, [
314
316
  _cache[0] || (_cache[0] = createTextVNode("Star ")),
315
- createVNode(_sfc_main$7, {
317
+ createVNode(_sfc_main$8, {
316
318
  number: _ctx.count || 0,
317
319
  gt100: true
318
320
  }, null, 8, ["number"])
@@ -321,8 +323,8 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
321
323
  };
322
324
  }
323
325
  });
324
- const GithubStarNum = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-gitcode-layout-lib"]]);
325
- const _hoisted_1$1 = { class: "repo-card-footer mt-[4px]" };
326
+ const GithubStarNum = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-gitcode-layout-lib"]]);
327
+ const _hoisted_1$2 = { class: "repo-card-footer mt-[4px]" };
326
328
  const _hoisted_2$1 = {
327
329
  key: 3,
328
330
  class: "line-separator"
@@ -332,7 +334,7 @@ const _hoisted_3$1 = {
332
334
  class: "repo-card-footer-timer"
333
335
  };
334
336
  const _hoisted_4$1 = ["onClick"];
335
- const _sfc_main$1 = /* @__PURE__ */ defineComponent({
337
+ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
336
338
  __name: "index",
337
339
  props: {
338
340
  repoInfo: {},
@@ -369,7 +371,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
369
371
  return (_ctx, _cache) => {
370
372
  return openBlock(), createElementBlock(Fragment, null, [
371
373
  createElementVNode("div", null, [
372
- createElementVNode("div", _hoisted_1$1, [
374
+ createElementVNode("div", _hoisted_1$2, [
373
375
  _ctx.tagInfo ? (openBlock(), createBlock(LanguageTag, {
374
376
  key: 0,
375
377
  "tag-info": _ctx.tagInfo
@@ -413,7 +415,58 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
413
415
  };
414
416
  }
415
417
  });
416
- const RepoCardFooter = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-gitcode-layout-lib"]]);
418
+ const RepoCardFooter = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-gitcode-layout-lib"]]);
419
+ const _hoisted_1$1 = { class: "new-tag-content" };
420
+ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
421
+ __name: "index",
422
+ props: {
423
+ repoType: {},
424
+ isNew: { type: Boolean }
425
+ },
426
+ setup(__props) {
427
+ const props = __props;
428
+ const tagTipsText = computed(() => {
429
+ if ([
430
+ "model",
431
+ "1"
432
+ /* model */
433
+ ].includes(props.repoType)) {
434
+ return "本月新增模型";
435
+ }
436
+ if ([
437
+ "dataset",
438
+ "2"
439
+ /* dataset */
440
+ ].includes(props.repoType)) {
441
+ return "本月新增数据集";
442
+ }
443
+ return "本月新增项目";
444
+ });
445
+ const isShowTag = computed(() => {
446
+ return [
447
+ "model",
448
+ "1"
449
+ /* model */
450
+ ].includes(props.repoType) && props.isNew;
451
+ });
452
+ return (_ctx, _cache) => {
453
+ return isShowTag.value ? (openBlock(), createBlock(unref(Popover), {
454
+ key: 0,
455
+ position: ["top"],
456
+ trigger: "hover"
457
+ }, {
458
+ content: withCtx(() => [
459
+ createElementVNode("span", _hoisted_1$1, toDisplayString(tagTipsText.value), 1)
460
+ ]),
461
+ default: withCtx(() => [
462
+ _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))
463
+ ]),
464
+ _: 1
465
+ })) : createCommentVNode("", true);
466
+ };
467
+ }
468
+ });
469
+ const NewTag = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-gitcode-layout-lib"]]);
417
470
  const _hoisted_1 = ["innerHTML"];
418
471
  const _hoisted_2 = {
419
472
  key: 0,
@@ -529,46 +582,51 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
529
582
  class: "ellipsis flex items-center gap-[8px]",
530
583
  flex: "auto"
531
584
  }, {
532
- default: withCtx(() => [
533
- createVNode(GIcon, {
534
- name: iconName.value,
535
- class: normalizeClass({ "align-middle": _ctx.info.is_gh_mirrors }),
536
- color: "var(--theme-placeholder)"
537
- }, null, 8, ["name", "class"]),
538
- createElementVNode("span", {
539
- class: "repo-title",
540
- innerHTML: preHandWord()
541
- }, null, 8, _hoisted_1),
542
- _ctx.info.show_recommend_icon ? (openBlock(), createElementBlock("span", _hoisted_2, toDisplayString(unref($t)("gitCodeLayout.search.recommendTag")), 1)) : createCommentVNode("", true),
543
- unref(isGstarRepo)(_ctx.info.topic_names) ? (openBlock(), createElementBlock("div", _hoisted_3, [
544
- createVNode(_sfc_main$8, {
545
- origin: "repo",
546
- icon: "",
547
- type: "gstar",
548
- message: `G-Star ${unref($t)("gitCodeLayout.GStar.project.graduation")}`
549
- }, {
550
- default: withCtx(() => _cache[0] || (_cache[0] = [
551
- createTextVNode("G-Star ")
552
- ])),
553
- _: 1,
554
- __: [0]
555
- }, 8, ["message"])
556
- ])) : createCommentVNode("", true),
557
- unref(isIncubationRepo)(_ctx.info.topic_names) ? (openBlock(), createElementBlock("div", _hoisted_4, [
558
- createVNode(_sfc_main$8, {
559
- origin: "repo",
560
- icon: "",
561
- type: "incubation",
562
- message: `G-Star ${unref($t)("gitCodeLayout.GStar.project.incubation")}`
563
- }, {
564
- default: withCtx(() => _cache[1] || (_cache[1] = [
565
- createTextVNode(" G-Star ")
566
- ])),
567
- _: 1,
568
- __: [1]
569
- }, 8, ["message"])
570
- ])) : createCommentVNode("", true)
571
- ]),
585
+ default: withCtx(() => {
586
+ var _a;
587
+ return [
588
+ createVNode(GIcon, {
589
+ name: iconName.value,
590
+ class: normalizeClass({ "align-middle": _ctx.info.is_gh_mirrors }),
591
+ color: "var(--theme-placeholder)"
592
+ }, null, 8, ["name", "class"]),
593
+ createElementVNode("span", {
594
+ class: "repo-title",
595
+ innerHTML: preHandWord()
596
+ }, null, 8, _hoisted_1),
597
+ _ctx.info.show_recommend_icon ? (openBlock(), createElementBlock("span", _hoisted_2, toDisplayString(unref($t)("gitCodeLayout.search.recommendTag")), 1)) : createCommentVNode("", true),
598
+ unref(isGstarRepo)(_ctx.info.topic_names) ? (openBlock(), createElementBlock("div", _hoisted_3, [
599
+ createVNode(_sfc_main$9, {
600
+ origin: "repo",
601
+ icon: "",
602
+ type: "gstar",
603
+ message: `G-Star ${unref($t)("gitCodeLayout.GStar.project.graduation")}`
604
+ }, {
605
+ default: withCtx(() => _cache[0] || (_cache[0] = [
606
+ createTextVNode("G-Star ")
607
+ ])),
608
+ _: 1
609
+ }, 8, ["message"])
610
+ ])) : createCommentVNode("", true),
611
+ unref(isIncubationRepo)(_ctx.info.topic_names) ? (openBlock(), createElementBlock("div", _hoisted_4, [
612
+ createVNode(_sfc_main$9, {
613
+ origin: "repo",
614
+ icon: "",
615
+ type: "incubation",
616
+ message: `G-Star ${unref($t)("gitCodeLayout.GStar.project.incubation")}`
617
+ }, {
618
+ default: withCtx(() => _cache[1] || (_cache[1] = [
619
+ createTextVNode(" G-Star ")
620
+ ])),
621
+ _: 1
622
+ }, 8, ["message"])
623
+ ])) : createCommentVNode("", true),
624
+ createVNode(NewTag, {
625
+ repoType: _ctx.cardType,
626
+ isNew: ((_a = _ctx.info) == null ? void 0 : _a.is_new) || false
627
+ }, null, 8, ["repoType", "isNew"])
628
+ ];
629
+ }),
572
630
  _: 1
573
631
  }),
574
632
  createVNode(unref(Col), { flex: "none" }, {
@@ -1,6 +1,6 @@
1
1
  import { defineComponent, onMounted, createBlock, openBlock, unref, withCtx, createElementVNode } from "vue";
2
2
  import { FixedOverlay } from "vue-devui-lal/overlay";
3
- import { w as useLayoutConfig, _ as _export_sfc } from "./index-CGyHM1VW.js";
3
+ import { x as useLayoutConfig, _ as _export_sfc } from "./index-8onKOHd0.js";
4
4
  import "vue-devui-lal/overlay/style.css";
5
5
  const _sfc_main = /* @__PURE__ */ defineComponent({
6
6
  __name: "index",
@@ -49,8 +49,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
49
49
  default: withCtx(() => _cache[0] || (_cache[0] = [
50
50
  createElementVNode("div", { id: "captcha-box" }, null, -1)
51
51
  ])),
52
- _: 1,
53
- __: [0]
52
+ _: 1
54
53
  });
55
54
  };
56
55
  }
package/index.js CHANGED
@@ -1,14 +1,14 @@
1
- import { z, A, D, y, S, x, F, I, C, H, B } from "./index-CGyHM1VW.js";
1
+ import { A, B, F, z, S, y, H, J, D, I, C } from "./index-8onKOHd0.js";
2
2
  export {
3
- z as GitCodeAside,
4
- A as GitCodeHeader,
5
- D as GitCodeLayoutEmitter,
6
- y as Login,
3
+ A as GitCodeAside,
4
+ B as GitCodeHeader,
5
+ F as GitCodeLayoutEmitter,
6
+ z as Login,
7
7
  S as SceneValue,
8
- x as ToolsFloat,
9
- F as currentTheme,
10
- I as default,
11
- C as setLayoutConfig,
12
- H as setTheme,
13
- B as useLogin
8
+ y as ToolsFloat,
9
+ H as currentTheme,
10
+ J as default,
11
+ D as setLayoutConfig,
12
+ I as setTheme,
13
+ C as useLogin
14
14
  };
@@ -1,5 +1,5 @@
1
1
  import { defineComponent, computed, createBlock, openBlock, unref, isRef, withCtx, createElementVNode, normalizeClass, createVNode, createTextVNode } from "vue";
2
- import { i as isPhone, u as useModel } from "./index-CGyHM1VW.js";
2
+ import { i as isPhone, u as useModel } from "./index-8onKOHd0.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";
@@ -39,8 +39,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
39
39
  default: withCtx(() => _cache[1] || (_cache[1] = [
40
40
  createTextVNode("忽略")
41
41
  ])),
42
- _: 1,
43
- __: [1]
42
+ _: 1
44
43
  }, 8, ["size", "onClick"]),
45
44
  createVNode(unref(Button), {
46
45
  variant: "solid",
@@ -51,8 +50,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
51
50
  default: withCtx(() => _cache[2] || (_cache[2] = [
52
51
  createTextVNode("修改")
53
52
  ])),
54
- _: 1,
55
- __: [2]
53
+ _: 1
56
54
  }, 8, ["size"])
57
55
  ], 2)
58
56
  ]),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vue-layout-gitcode",
3
- "version": "1.3.39",
3
+ "version": "1.3.40",
4
4
  "description": "用于 gitcode 站点生产环境使用",
5
5
  "main": "index.js",
6
6
  "types": "./index.d.ts",