vue-layout-gitcode 1.3.38 → 1.3.39

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,13 +1,11 @@
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-IGla-Q6g.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, 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";
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";
11
9
  const useReportRepo = (reportParams, viewReport) => {
12
10
  const list = ref([]);
13
11
  const pageRef = ref((window == null ? void 0 : window.page_ref) || "");
@@ -76,7 +74,7 @@ const useReportRepo = (reportParams, viewReport) => {
76
74
  const formatNameSpace = (content) => {
77
75
  return content.trim().replace(/\s+/g, "").replace(/^(GitHub加速计划\/|HuggingFace镜像\/)/, "").split("/").filter(Boolean);
78
76
  };
79
- const _sfc_main$8 = /* @__PURE__ */ defineComponent({
77
+ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
80
78
  __name: "index",
81
79
  props: {
82
80
  number: {},
@@ -90,12 +88,12 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
90
88
  };
91
89
  }
92
90
  });
93
- const _hoisted_1$6 = {
91
+ const _hoisted_1$5 = {
94
92
  class: "mr-[4px]",
95
93
  style: { "width": "15px", "height": "15px" }
96
94
  };
97
95
  const _hoisted_2$4 = { class: "i-star-tag__text" };
98
- const _sfc_main$7 = /* @__PURE__ */ defineComponent({
96
+ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
99
97
  __name: "index",
100
98
  props: {
101
99
  starInfo: { default: () => ({
@@ -169,7 +167,7 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
169
167
  }, null, 544), [
170
168
  [vShow, running.value]
171
169
  ]),
172
- createElementVNode("div", _hoisted_1$6, [
170
+ createElementVNode("div", _hoisted_1$5, [
173
171
  withDirectives(createVNode(GIcon, {
174
172
  size: "15",
175
173
  name: starred.value ? "gt-a-star_open_16px1" : "gt-line-new-star",
@@ -181,7 +179,7 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
181
179
  ])
182
180
  ]),
183
181
  createElementVNode("span", _hoisted_2$4, [
184
- createVNode(_sfc_main$8, {
182
+ createVNode(_sfc_main$7, {
185
183
  number: Number(starCount.value || 0)
186
184
  }, null, 8, ["number"])
187
185
  ])
@@ -190,16 +188,16 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
190
188
  };
191
189
  }
192
190
  });
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({
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({
196
194
  __name: "index",
197
195
  props: {
198
196
  count: {}
199
197
  },
200
198
  setup(__props) {
201
199
  return (_ctx, _cache) => {
202
- return openBlock(), createElementBlock("div", _hoisted_1$5, [
200
+ return openBlock(), createElementBlock("div", _hoisted_1$4, [
203
201
  createVNode(GIcon, {
204
202
  class: "mr-[4px]",
205
203
  name: "gt-line-fork",
@@ -207,7 +205,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
207
205
  size: "14"
208
206
  }),
209
207
  createElementVNode("span", null, [
210
- createVNode(_sfc_main$8, {
208
+ createVNode(_sfc_main$7, {
211
209
  number: _ctx.count || 0
212
210
  }, null, 8, ["number"])
213
211
  ])
@@ -215,8 +213,8 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
215
213
  };
216
214
  }
217
215
  });
218
- const ForkTag = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["__scopeId", "data-v-gitcode-layout-lib"]]);
219
- const _sfc_main$5 = /* @__PURE__ */ defineComponent({
216
+ const ForkTag = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-gitcode-layout-lib"]]);
217
+ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
220
218
  __name: "index",
221
219
  props: {
222
220
  tagInfo: { default: [] },
@@ -261,10 +259,10 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
261
259
  };
262
260
  }
263
261
  });
264
- const LanguageTag = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-gitcode-layout-lib"]]);
265
- const _hoisted_1$4 = { class: "star-count-one" };
262
+ const LanguageTag = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-gitcode-layout-lib"]]);
263
+ const _hoisted_1$3 = { class: "star-count-one" };
266
264
  const _hoisted_2$3 = { key: 0 };
267
- const _sfc_main$4 = /* @__PURE__ */ defineComponent({
265
+ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
268
266
  ...{ name: "star-count-one" },
269
267
  __name: "index",
270
268
  props: {
@@ -274,27 +272,27 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
274
272
  setup(__props) {
275
273
  const { t: $t } = i18n.global;
276
274
  return (_ctx, _cache) => {
277
- return openBlock(), createElementBlock("div", _hoisted_1$4, [
275
+ return openBlock(), createElementBlock("div", _hoisted_1$3, [
278
276
  createVNode(GIcon, {
279
277
  name: "gt-line-new-star",
280
278
  color: "var(--theme-home-card-color-placeholder)",
281
279
  size: "14"
282
280
  }),
283
281
  !_ctx.hideText ? (openBlock(), createElementBlock("span", _hoisted_2$3, toDisplayString(unref($t)("gitCodeLayout.components.repo.today")), 1)) : createCommentVNode("", true),
284
- createVNode(_sfc_main$8, {
282
+ createVNode(_sfc_main$7, {
285
283
  number: _ctx.starCountOne || 0
286
284
  }, null, 8, ["number"])
287
285
  ]);
288
286
  };
289
287
  }
290
288
  });
291
- const StarCountOne = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-gitcode-layout-lib"]]);
292
- const _hoisted_1$3 = {
289
+ const StarCountOne = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-gitcode-layout-lib"]]);
290
+ const _hoisted_1$2 = {
293
291
  key: 0,
294
292
  class: "github-star-num"
295
293
  };
296
294
  const _hoisted_2$2 = { class: "leading-none" };
297
- const _sfc_main$3 = /* @__PURE__ */ defineComponent({
295
+ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
298
296
  ...{ name: "GithubStarNum" },
299
297
  __name: "index",
300
298
  props: {
@@ -306,7 +304,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
306
304
  return props.count && props.count >= 100;
307
305
  });
308
306
  return (_ctx, _cache) => {
309
- return starVisible.value ? (openBlock(), createElementBlock("div", _hoisted_1$3, [
307
+ return starVisible.value ? (openBlock(), createElementBlock("div", _hoisted_1$2, [
310
308
  createVNode(GIcon, {
311
309
  name: "gt-line-github",
312
310
  color: "var(--theme-home-card-color-placeholder)",
@@ -314,7 +312,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
314
312
  }),
315
313
  createElementVNode("span", _hoisted_2$2, [
316
314
  _cache[0] || (_cache[0] = createTextVNode("Star ")),
317
- createVNode(_sfc_main$8, {
315
+ createVNode(_sfc_main$7, {
318
316
  number: _ctx.count || 0,
319
317
  gt100: true
320
318
  }, null, 8, ["number"])
@@ -323,8 +321,8 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
323
321
  };
324
322
  }
325
323
  });
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]" };
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]" };
328
326
  const _hoisted_2$1 = {
329
327
  key: 3,
330
328
  class: "line-separator"
@@ -334,7 +332,7 @@ const _hoisted_3$1 = {
334
332
  class: "repo-card-footer-timer"
335
333
  };
336
334
  const _hoisted_4$1 = ["onClick"];
337
- const _sfc_main$2 = /* @__PURE__ */ defineComponent({
335
+ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
338
336
  __name: "index",
339
337
  props: {
340
338
  repoInfo: {},
@@ -371,7 +369,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
371
369
  return (_ctx, _cache) => {
372
370
  return openBlock(), createElementBlock(Fragment, null, [
373
371
  createElementVNode("div", null, [
374
- createElementVNode("div", _hoisted_1$2, [
372
+ createElementVNode("div", _hoisted_1$1, [
375
373
  _ctx.tagInfo ? (openBlock(), createBlock(LanguageTag, {
376
374
  key: 0,
377
375
  "tag-info": _ctx.tagInfo
@@ -415,58 +413,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
415
413
  };
416
414
  }
417
415
  });
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"]]);
416
+ const RepoCardFooter = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-gitcode-layout-lib"]]);
470
417
  const _hoisted_1 = ["innerHTML"];
471
418
  const _hoisted_2 = {
472
419
  key: 0,
@@ -582,51 +529,46 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
582
529
  class: "ellipsis flex items-center gap-[8px]",
583
530
  flex: "auto"
584
531
  }, {
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
- }),
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
+ ]),
630
572
  _: 1
631
573
  }),
632
574
  createVNode(unref(Col), { flex: "none" }, {
package/index.d.ts CHANGED
@@ -227,7 +227,7 @@ export declare const GitCodeHeader: DefineComponent<ExtractPropTypes<{
227
227
  sceneValue: {
228
228
  type: PropType<SceneValue>;
229
229
  required: true;
230
- default: SceneValue;
230
+ default: any;
231
231
  };
232
232
  isLogin: {
233
233
  type: PropType<boolean>;
@@ -305,6 +305,10 @@ export declare const GitCodeHeader: DefineComponent<ExtractPropTypes<{
305
305
  required: false;
306
306
  default: boolean;
307
307
  };
308
+ userMenus: {
309
+ type: PropType<any[] | undefined>;
310
+ required: false;
311
+ };
308
312
  bgConfig: {
309
313
  type: PropType<{
310
314
  index_head: string;
@@ -332,7 +336,7 @@ export declare const GitCodeHeader: DefineComponent<ExtractPropTypes<{
332
336
  sceneValue: {
333
337
  type: PropType<SceneValue>;
334
338
  required: true;
335
- default: SceneValue;
339
+ default: any;
336
340
  };
337
341
  isLogin: {
338
342
  type: PropType<boolean>;
@@ -410,6 +414,10 @@ export declare const GitCodeHeader: DefineComponent<ExtractPropTypes<{
410
414
  required: false;
411
415
  default: boolean;
412
416
  };
417
+ userMenus: {
418
+ type: PropType<any[] | undefined>;
419
+ required: false;
420
+ };
413
421
  bgConfig: {
414
422
  type: PropType<{
415
423
  index_head: string;
package/index.js CHANGED
@@ -1,14 +1,14 @@
1
- import { A, B, F, z, S, y, H, J, D, I, C } from "./index-IGla-Q6g.js";
1
+ import { z, A, D, y, S, x, F, I, C, H, B } from "./index-CGyHM1VW.js";
2
2
  export {
3
- A as GitCodeAside,
4
- B as GitCodeHeader,
5
- F as GitCodeLayoutEmitter,
6
- z as Login,
3
+ z as GitCodeAside,
4
+ A as GitCodeHeader,
5
+ D as GitCodeLayoutEmitter,
6
+ y as Login,
7
7
  S as SceneValue,
8
- y as ToolsFloat,
9
- H as currentTheme,
10
- J as default,
11
- D as setLayoutConfig,
12
- I as setTheme,
13
- C as useLogin
8
+ x as ToolsFloat,
9
+ F as currentTheme,
10
+ I as default,
11
+ C as setLayoutConfig,
12
+ H as setTheme,
13
+ B 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-IGla-Q6g.js";
2
+ import { i as isPhone, u as useModel } from "./index-CGyHM1VW.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,7 +39,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
39
39
  default: withCtx(() => _cache[1] || (_cache[1] = [
40
40
  createTextVNode("忽略")
41
41
  ])),
42
- _: 1
42
+ _: 1,
43
+ __: [1]
43
44
  }, 8, ["size", "onClick"]),
44
45
  createVNode(unref(Button), {
45
46
  variant: "solid",
@@ -50,7 +51,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
50
51
  default: withCtx(() => _cache[2] || (_cache[2] = [
51
52
  createTextVNode("修改")
52
53
  ])),
53
- _: 1
54
+ _: 1,
55
+ __: [2]
54
56
  }, 8, ["size"])
55
57
  ], 2)
56
58
  ]),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vue-layout-gitcode",
3
- "version": "1.3.38",
3
+ "version": "1.3.39",
4
4
  "description": "用于 gitcode 站点生产环境使用",
5
5
  "main": "index.js",
6
6
  "types": "./index.d.ts",