vue-layout-gitcode 1.1.7 → 1.1.9

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,54 +1,78 @@
1
- import { defineComponent, toDisplayString, inject, ref, openBlock, createElementBlock, normalizeClass, createElementVNode, withModifiers, withDirectives, vShow, createVNode, computed, unref, normalizeStyle, createCommentVNode, createTextVNode, onMounted, onUnmounted, Fragment, createBlock, renderList, reactive, resolveComponent, withCtx } from "vue";
2
- import { h as headRequest, I as Icon, r as reqCatch, _ as _export_sfc, a as i18n, T as TOPIC_TYPE, d as useTimeFormat, f as usePageResize, g as highlightWords, t as transWebUrl, j as _frEventTrack, E as EVENT_NAME, c as REPO_TYPE, e as extractRepoInfoWithURL, R as REPO_MODULE, b as REPO_EVENT } from "./index-20dfcc22.js";
3
- import { f as formatNameSpace, u as useReportRepo } from "./formatNameSpace-9df98279.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, resolveComponent, 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 highlightWords, t as transWebUrl, k as _frEventTrack, E as EVENT_NAME, c as REPO_TYPE, e as extractRepoInfoWithURL } from "./index-840e7c95.js";
4
3
  import { useRouter } from "vue-router";
5
4
  import { Row, Col } from "vue-devui-lal/grid";
6
5
  import "vue-devui-lal/grid/style.css";
7
- import "vue-devui-lal/button";
8
- import "vue-devui-lal/popover";
9
- import "vue-devui-lal/tooltip";
10
- import "vue-devui-lal/textarea";
11
- import "vue-devui-lal/button/style.css";
12
- import "vue-devui-lal/popover/style.css";
13
- import "vue-devui-lal/tooltip/style.css";
14
- import "vue-devui-lal/textarea/style.css";
15
- import "vue-devui-lal/icon";
16
- import "vue-devui-lal/icon/style.css";
17
- import "@vueuse/core";
18
- import "vue-devui-lal/avatar";
19
- import "vue-devui-lal/avatar/style.css";
20
- import "vue-devui-lal/dropdown";
21
- import "vue-devui-lal/dropdown/style.css";
22
- import "dayjs";
23
- import "vue-devui-lal/skeleton";
24
- import "vue-devui-lal/skeleton/style.css";
25
- import "vue-devui-lal/message";
26
- import "vue-devui-lal/message/style.css";
27
- import "vue-devui-lal/badge";
28
- import "vue-devui-lal/badge/style.css";
29
- import "vue-devui-lal/tabs/style.css";
30
- import "vue-devui-lal/input";
31
- import "vue-devui-lal/form";
32
- import "vue-devui-lal/input/style.css";
33
- import "vue-devui-lal/form/style.css";
34
- import "vue-devui-lal/notification";
35
- import "vue-devui-lal/notification/style.css";
36
- import "vue-devui-lal/select";
37
- import "vue-devui-lal/menu";
38
- import "vue-devui-lal/select/style.css";
39
- import "vue-devui-lal/menu/style.css";
40
- import "vue-devui-lal/drawer";
41
- import "vue-devui-lal/layout";
42
- import "vue-devui-lal/drawer/style.css";
43
- import "vue-devui-lal/layout/style.css";
44
- import "vue-devui-lal/radio";
45
- import "@devui-design/icons/icomoon/devui-icon.css";
46
- import "vue-devui-lal/radio/style.css";
47
- import "vue-devui-lal/checkbox";
48
- import "vue-devui-lal/checkbox/style.css";
49
- import "vue-devui-lal/modal";
50
- import "vue-devui-lal/modal/style.css";
51
- const _sfc_main$8 = /* @__PURE__ */ defineComponent({
6
+ const useReportRepo = (reportParams, viewReport) => {
7
+ const list = ref([]);
8
+ const pageRef = ref((window == null ? void 0 : window.page_ref) || "");
9
+ const locationHref = ref((window == null ? void 0 : window.location.href) || "");
10
+ const keyword = ref(reportParams == null ? void 0 : reportParams.keyword);
11
+ const moduleName = ref(reportParams == null ? void 0 : reportParams.moduleName);
12
+ const triggerReport = (type, data) => {
13
+ if (type === "click") {
14
+ const params = {
15
+ chat_title: "",
16
+ related: {
17
+ list: [formatItem(data)],
18
+ type: "repo"
19
+ }
20
+ };
21
+ viewReport(pageRef.value, locationHref.value, "click", params);
22
+ } else if (type === "expo") {
23
+ list.value.push(data);
24
+ }
25
+ };
26
+ const formatItem = (data) => {
27
+ const channelNames = [];
28
+ if (data.channelName)
29
+ channelNames.push(data.channelName);
30
+ if (data.subChannelName)
31
+ channelNames.push(data.subChannelName);
32
+ return {
33
+ type: "gitcode",
34
+ repo_id: data.id,
35
+ dest_url: data.web_url,
36
+ strategy: channelNames.join("") || "",
37
+ // 官方项目
38
+ repo_index: data.index,
39
+ page: data.pageIndex || data.p || 0,
40
+ per_page: data.pageSize || data.pp || 0,
41
+ q: data.keyword || ""
42
+ };
43
+ };
44
+ const doReport = debounce(() => {
45
+ if (list.value.length >= 1) {
46
+ const reportList = list.value.splice(0).map((item) => {
47
+ return formatItem(item);
48
+ });
49
+ const params = {
50
+ chat_title: "",
51
+ extend_json: {
52
+ key_words: keyword.value,
53
+ module_name: moduleName.value
54
+ },
55
+ related: {
56
+ list: reportList,
57
+ type: "repo"
58
+ }
59
+ };
60
+ viewReport(pageRef.value, locationHref.value, "expo", params);
61
+ }
62
+ }, 500, { leading: false });
63
+ watchEffect(() => {
64
+ if (list.value.length) {
65
+ doReport();
66
+ }
67
+ });
68
+ return {
69
+ triggerReport
70
+ };
71
+ };
72
+ const formatNameSpace = (content) => {
73
+ return content.trim().replace(/\s+/g, "").replace(/^(GitHub加速计划\/|HuggingFace镜像\/)/, "").split("/").filter(Boolean);
74
+ };
75
+ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
52
76
  __name: "index",
53
77
  props: {
54
78
  number: {},
@@ -87,12 +111,12 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
87
111
  };
88
112
  }
89
113
  });
90
- const _hoisted_1$6 = {
114
+ const _hoisted_1$5 = {
91
115
  class: "mr-[4px]",
92
116
  style: { "width": "15px", "height": "15px" }
93
117
  };
94
- const _hoisted_2$5 = { class: "i-star-tag__text" };
95
- const _sfc_main$7 = /* @__PURE__ */ defineComponent({
118
+ const _hoisted_2$4 = { class: "i-star-tag__text" };
119
+ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
96
120
  __name: "index",
97
121
  props: {
98
122
  starInfo: { default: () => ({
@@ -158,8 +182,8 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
158
182
  }, null, 544), [
159
183
  [vShow, running.value]
160
184
  ]),
161
- createElementVNode("div", _hoisted_1$6, [
162
- withDirectives(createVNode(Icon, {
185
+ createElementVNode("div", _hoisted_1$5, [
186
+ withDirectives(createVNode(GIcon, {
163
187
  size: "15",
164
188
  name: starred.value ? "gt-a-star_open_16px1" : "gt-line-new-star",
165
189
  style: {
@@ -169,8 +193,8 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
169
193
  [vShow, !running.value]
170
194
  ])
171
195
  ]),
172
- createElementVNode("span", _hoisted_2$5, [
173
- createVNode(_sfc_main$8, {
196
+ createElementVNode("span", _hoisted_2$4, [
197
+ createVNode(_sfc_main$7, {
174
198
  number: Number(starCount.value || 0)
175
199
  }, null, 8, ["number"])
176
200
  ])
@@ -180,24 +204,24 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
180
204
  }
181
205
  });
182
206
  const index_vue_vue_type_style_index_0_scoped_754df2e0_lang = "";
183
- const StarTag = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["__scopeId", "data-v-754df2e0"]]);
184
- const _hoisted_1$5 = { class: "fork-tag" };
185
- const _sfc_main$6 = /* @__PURE__ */ defineComponent({
207
+ const StarTag = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["__scopeId", "data-v-754df2e0"]]);
208
+ const _hoisted_1$4 = { class: "fork-tag" };
209
+ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
186
210
  __name: "index",
187
211
  props: {
188
212
  count: {}
189
213
  },
190
214
  setup(__props) {
191
215
  return (_ctx, _cache) => {
192
- return openBlock(), createElementBlock("div", _hoisted_1$5, [
193
- createVNode(Icon, {
216
+ return openBlock(), createElementBlock("div", _hoisted_1$4, [
217
+ createVNode(GIcon, {
194
218
  class: "mr-[4px]",
195
219
  name: "gt-line-fork",
196
220
  color: "var(--theme-home-card-color-placeholder)",
197
221
  size: "14"
198
222
  }),
199
223
  createElementVNode("span", null, [
200
- createVNode(_sfc_main$8, {
224
+ createVNode(_sfc_main$7, {
201
225
  number: _ctx.count || 0
202
226
  }, null, 8, ["number"])
203
227
  ])
@@ -206,8 +230,8 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
206
230
  }
207
231
  });
208
232
  const index_vue_vue_type_style_index_0_scoped_98be5d7f_lang = "";
209
- const ForkTag = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["__scopeId", "data-v-98be5d7f"]]);
210
- const _sfc_main$5 = /* @__PURE__ */ defineComponent({
233
+ const ForkTag = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-98be5d7f"]]);
234
+ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
211
235
  __name: "index",
212
236
  props: {
213
237
  tagInfo: { default: [] },
@@ -253,10 +277,10 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
253
277
  }
254
278
  });
255
279
  const index_vue_vue_type_style_index_0_scoped_6e1aad17_lang = "";
256
- const LanguageTag = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-6e1aad17"]]);
257
- const _hoisted_1$4 = { class: "star-count-one" };
258
- const _hoisted_2$4 = { key: 0 };
259
- const _sfc_main$4 = /* @__PURE__ */ defineComponent({
280
+ const LanguageTag = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-6e1aad17"]]);
281
+ const _hoisted_1$3 = { class: "star-count-one" };
282
+ const _hoisted_2$3 = { key: 0 };
283
+ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
260
284
  ...{ name: "star-count-one" },
261
285
  __name: "index",
262
286
  props: {
@@ -266,14 +290,14 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
266
290
  setup(__props) {
267
291
  const { t: $t } = i18n.global;
268
292
  return (_ctx, _cache) => {
269
- return openBlock(), createElementBlock("div", _hoisted_1$4, [
270
- createVNode(Icon, {
293
+ return openBlock(), createElementBlock("div", _hoisted_1$3, [
294
+ createVNode(GIcon, {
271
295
  name: "gt-line-new-star",
272
296
  color: "var(--theme-home-card-color-placeholder)",
273
297
  size: "14"
274
298
  }),
275
- !_ctx.hideText ? (openBlock(), createElementBlock("span", _hoisted_2$4, toDisplayString(unref($t)("gitCodeLayout.components.repo.today")), 1)) : createCommentVNode("", true),
276
- createVNode(_sfc_main$8, {
299
+ !_ctx.hideText ? (openBlock(), createElementBlock("span", _hoisted_2$3, toDisplayString(unref($t)("gitCodeLayout.components.repo.today")), 1)) : createCommentVNode("", true),
300
+ createVNode(_sfc_main$7, {
277
301
  number: _ctx.starCountOne || 0
278
302
  }, null, 8, ["number"])
279
303
  ]);
@@ -281,10 +305,10 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
281
305
  }
282
306
  });
283
307
  const index_vue_vue_type_style_index_0_scoped_de8d9362_lang = "";
284
- const StarCountOne = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-de8d9362"]]);
285
- const _hoisted_1$3 = { class: "github-star-num" };
286
- const _hoisted_2$3 = { class: "leading-none" };
287
- const _sfc_main$3 = /* @__PURE__ */ defineComponent({
308
+ const StarCountOne = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-de8d9362"]]);
309
+ const _hoisted_1$2 = { class: "github-star-num" };
310
+ const _hoisted_2$2 = { class: "leading-none" };
311
+ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
288
312
  ...{ name: "GithubStarNum" },
289
313
  __name: "index",
290
314
  props: {
@@ -292,15 +316,15 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
292
316
  },
293
317
  setup(__props) {
294
318
  return (_ctx, _cache) => {
295
- return openBlock(), createElementBlock("div", _hoisted_1$3, [
296
- createVNode(Icon, {
319
+ return openBlock(), createElementBlock("div", _hoisted_1$2, [
320
+ createVNode(GIcon, {
297
321
  name: "gt-line-github",
298
322
  color: "var(--theme-home-card-color-placeholder)",
299
323
  size: "14"
300
324
  }),
301
- createElementVNode("span", _hoisted_2$3, [
325
+ createElementVNode("span", _hoisted_2$2, [
302
326
  _cache[0] || (_cache[0] = createTextVNode("Star ")),
303
- createVNode(_sfc_main$8, {
327
+ createVNode(_sfc_main$7, {
304
328
  number: _ctx.count || 0
305
329
  }, null, 8, ["number"])
306
330
  ])
@@ -309,18 +333,18 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
309
333
  }
310
334
  });
311
335
  const index_vue_vue_type_style_index_0_scoped_7f7e79b1_lang = "";
312
- const GithubStarNum = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-7f7e79b1"]]);
313
- const _hoisted_1$2 = { class: "repo-card-footer mt-[4px]" };
314
- const _hoisted_2$2 = {
336
+ const GithubStarNum = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-7f7e79b1"]]);
337
+ const _hoisted_1$1 = { class: "repo-card-footer mt-[4px]" };
338
+ const _hoisted_2$1 = {
315
339
  key: 3,
316
340
  class: "line-separator"
317
341
  };
318
- const _hoisted_3$2 = {
342
+ const _hoisted_3$1 = {
319
343
  key: 4,
320
344
  class: "repo-card-footer-timer"
321
345
  };
322
- const _hoisted_4$2 = ["onClick"];
323
- const _sfc_main$2 = /* @__PURE__ */ defineComponent({
346
+ const _hoisted_4$1 = ["onClick"];
347
+ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
324
348
  __name: "index",
325
349
  props: {
326
350
  repoInfo: {},
@@ -357,7 +381,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
357
381
  return (_ctx, _cache) => {
358
382
  return openBlock(), createElementBlock(Fragment, null, [
359
383
  createElementVNode("div", null, [
360
- createElementVNode("div", _hoisted_1$2, [
384
+ createElementVNode("div", _hoisted_1$1, [
361
385
  _ctx.tagInfo ? (openBlock(), createBlock(LanguageTag, {
362
386
  key: 0,
363
387
  "tag-info": _ctx.tagInfo
@@ -371,8 +395,8 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
371
395
  key: 2,
372
396
  count: _ctx.repoInfo.forks_count
373
397
  }, null, 8, ["count"])) : createCommentVNode("", true),
374
- !_ctx.hideUpdateTime ? (openBlock(), createElementBlock("div", _hoisted_2$2)) : createCommentVNode("", true),
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),
398
+ !_ctx.hideUpdateTime ? (openBlock(), createElementBlock("div", _hoisted_2$1)) : createCommentVNode("", true),
399
+ !_ctx.hideUpdateTime ? (openBlock(), createElementBlock("div", _hoisted_3$1, 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
400
  !_ctx.hideStarIncrease && _ctx.repoInfo.star_count_one ? (openBlock(), createBlock(StarCountOne, {
377
401
  key: 5,
378
402
  starCountOne: _ctx.repoInfo.star_count_one
@@ -394,7 +418,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
394
418
  class: "topic-tag",
395
419
  key: topic.topic_id,
396
420
  onClick: withModifiers(($event) => handleTopicClick(topic), ["stop"])
397
- }, toDisplayString(topic.name), 9, _hoisted_4$2);
421
+ }, toDisplayString(topic.name), 9, _hoisted_4$1);
398
422
  }), 128))
399
423
  ], 512)) : createCommentVNode("", true)
400
424
  ], 64);
@@ -402,15 +426,15 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
402
426
  }
403
427
  });
404
428
  const index_vue_vue_type_style_index_0_scoped_ca800e14_lang = "";
405
- const RepoCardFooter = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-ca800e14"]]);
406
- const _hoisted_1$1 = ["innerHTML"];
407
- const _hoisted_2$1 = {
429
+ const RepoCardFooter = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-ca800e14"]]);
430
+ const _hoisted_1 = ["innerHTML"];
431
+ const _hoisted_2 = {
408
432
  key: 0,
409
433
  class: "is-recommend ml-[8px]"
410
434
  };
411
- const _hoisted_3$1 = ["innerHTML"];
412
- const _hoisted_4$1 = { key: 0 };
413
- const _sfc_main$1 = /* @__PURE__ */ defineComponent({
435
+ const _hoisted_3 = ["innerHTML"];
436
+ const _hoisted_4 = { key: 0 };
437
+ const _sfc_main = /* @__PURE__ */ defineComponent({
414
438
  __name: "index",
415
439
  props: {
416
440
  info: {},
@@ -419,7 +443,9 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
419
443
  noborder: { type: Boolean },
420
444
  hover: { type: Boolean },
421
445
  hideTopicTags: { type: Boolean },
422
- urlParams: {}
446
+ urlParams: {},
447
+ hideStarBtn: { type: Boolean },
448
+ hideFooter: { type: Boolean }
423
449
  },
424
450
  emits: ["report"],
425
451
  setup(__props, { emit: __emit }) {
@@ -510,7 +536,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
510
536
  flex: "auto"
511
537
  }, {
512
538
  default: withCtx(() => [
513
- createVNode(Icon, {
539
+ createVNode(GIcon, {
514
540
  class: normalizeClass(["mr-[8px]", { "align-middle": _ctx.info.is_gh_mirrors }]),
515
541
  name: iconName.value,
516
542
  color: "var(--theme-placeholder)"
@@ -518,17 +544,18 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
518
544
  createElementVNode("span", {
519
545
  class: "repo-title",
520
546
  innerHTML: preHandWord()
521
- }, null, 8, _hoisted_1$1),
522
- _ctx.info.show_recommend_icon ? (openBlock(), createElementBlock("span", _hoisted_2$1, toDisplayString(unref($t)("gitCodeLayout.search.recommendTag")), 1)) : createCommentVNode("", true)
547
+ }, null, 8, _hoisted_1),
548
+ _ctx.info.show_recommend_icon ? (openBlock(), createElementBlock("span", _hoisted_2, toDisplayString(unref($t)("gitCodeLayout.search.recommendTag")), 1)) : createCommentVNode("", true)
523
549
  ]),
524
550
  _: 1
525
551
  }),
526
552
  createVNode(unref(Col), { flex: "none" }, {
527
553
  default: withCtx(() => [
528
- createVNode(StarTag, {
554
+ !_ctx.hideStarBtn ? (openBlock(), createBlock(StarTag, {
555
+ key: 0,
529
556
  "star-info": starInfo.value,
530
557
  onReport: handleStarReport
531
- }, null, 8, ["star-info"])
558
+ }, null, 8, ["star-info"])) : createCommentVNode("", true)
532
559
  ]),
533
560
  _: 1
534
561
  })
@@ -538,8 +565,8 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
538
565
  createElementVNode("div", {
539
566
  innerHTML: unref(highlightWords)("", _ctx.info.description),
540
567
  class: "i-search-projects-card-desc ellipsis"
541
- }, null, 8, _hoisted_3$1),
542
- _ctx.info.index === 0 && _ctx.info.is_recommend ? (openBlock(), createElementBlock("div", _hoisted_4$1, [
568
+ }, null, 8, _hoisted_3),
569
+ _ctx.info.index === 0 && _ctx.info.is_recommend ? (openBlock(), createElementBlock("div", _hoisted_4, [
543
570
  queryLoading.value ? (openBlock(), createBlock(_component_d_skeleton, { key: 0 }, {
544
571
  placeholder: withCtx(() => [
545
572
  createVNode(unref(Row), {
@@ -577,157 +604,26 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
577
604
  ]),
578
605
  _: 1
579
606
  })) : createCommentVNode("", true)
580
- ])) : (openBlock(), createBlock(RepoCardFooter, {
581
- key: 1,
582
- hideTopicTags: _ctx.hideTopicTags,
583
- hideStarCount: "",
584
- tagInfo: tagInfo.value,
585
- repoInfo: _ctx.info,
586
- searchCard: "",
587
- class: "i-search-projects-card-bottom mt-[8px]",
588
- onTopicClick: handleTopicClick
589
- }, null, 8, ["hideTopicTags", "tagInfo", "repoInfo"]))
607
+ ])) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
608
+ !_ctx.hideFooter ? (openBlock(), createBlock(RepoCardFooter, {
609
+ key: 0,
610
+ hideTopicTags: _ctx.hideTopicTags,
611
+ hideStarCount: "",
612
+ tagInfo: tagInfo.value,
613
+ repoInfo: _ctx.info,
614
+ searchCard: "",
615
+ class: "i-search-projects-card-bottom mt-[8px]",
616
+ onTopicClick: handleTopicClick
617
+ }, null, 8, ["hideTopicTags", "tagInfo", "repoInfo"])) : createCommentVNode("", true)
618
+ ], 64))
590
619
  ], 2);
591
620
  };
592
621
  }
593
622
  });
594
- const index_vue_vue_type_style_index_0_scoped_f42b3680_lang = "";
595
- const SearchRepoCard = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-f42b3680"]]);
596
- const _hoisted_1 = { class: "g-header-search-recommed" };
597
- const _hoisted_2 = { key: 0 };
598
- const _hoisted_3 = { class: "g-header-search-recommed-title" };
599
- const _hoisted_4 = { key: 1 };
600
- const _sfc_main = /* @__PURE__ */ defineComponent({
601
- __name: "SearchRecommed",
602
- setup(__props) {
603
- const { t: $t } = i18n.global;
604
- const API = headRequest(inject("request"));
605
- const useReport = inject("useReport");
606
- const { triggerReport } = useReportRepo({ moduleName: REPO_MODULE.SEARCH_RECOMMEND_CARD }, API.viewReport);
607
- const recommendRepoList = ref([]);
608
- const handleReport = (repo, index, evt) => {
609
- const params = evt === "starReport" ? {
610
- module_name: REPO_MODULE.SEARCH_RECOMMEND_CARD,
611
- repo_id: repo.id,
612
- Project_card_star: "star",
613
- repo_index: index
614
- } : { module_name: REPO_MODULE.SEARCH_RECOMMEND_CARD, repo_id: repo.id, repo_index: index };
615
- useReport(REPO_EVENT.CLICK, params, () => {
616
- });
617
- };
618
- const getRecommendRepo = async () => {
619
- var _a;
620
- let localSearchText = JSON.parse(localStorage.getItem("localSearchText") || "[]").splice(0, 10);
621
- if (localSearchText == null ? void 0 : localSearchText.length) {
622
- localSearchText = localSearchText.map((item) => ({
623
- ...item,
624
- count: item.count || 1
625
- }));
626
- }
627
- const params = { history: JSON.stringify(localSearchText) };
628
- const res = await API.openSourceProject(params);
629
- const data = (((_a = res == null ? void 0 : res.data) == null ? void 0 : _a.content) || []).map((item) => ({
630
- ...item,
631
- tags: item.tags || item.topic_names
632
- }));
633
- data.forEach((item, index) => {
634
- triggerReport("expo", { ...item, index });
635
- });
636
- recommendRepoList.value = data;
637
- };
638
- onMounted(() => {
639
- console.log("onMounted");
640
- getRecommendRepo();
641
- });
642
- return (_ctx, _cache) => {
643
- const _component_DSkeletonItem = resolveComponent("DSkeletonItem");
644
- return openBlock(), createElementBlock("div", _hoisted_1, [
645
- recommendRepoList.value.length ? (openBlock(), createElementBlock("div", _hoisted_2, [
646
- createElementVNode("div", _hoisted_3, toDisplayString(unref($t)("gitCodeLayout.search.trendingToday")), 1),
647
- (openBlock(true), createElementBlock(Fragment, null, renderList(recommendRepoList.value, (item, index) => {
648
- return openBlock(), createBlock(SearchRepoCard, {
649
- key: item.id,
650
- class: "mb-[8px]",
651
- info: { ...item, index },
652
- keyword: "",
653
- hover: "",
654
- hideTopicTags: "",
655
- onReport: (evt) => handleReport(item, index, evt),
656
- cardType: "repo",
657
- "url-params": { source_module: "today_trending" }
658
- }, null, 8, ["info", "onReport"]);
659
- }), 128))
660
- ])) : (openBlock(), createElementBlock("div", _hoisted_4, [
661
- (openBlock(), createElementBlock(Fragment, null, renderList(5, (item) => {
662
- return createElementVNode("div", {
663
- class: "pt-[8px] pb-[16px]",
664
- key: item
665
- }, [
666
- createVNode(unref(Row), {
667
- align: "middle",
668
- gutter: 16
669
- }, {
670
- default: withCtx(() => [
671
- createVNode(unref(Col), { flex: "auto" }, {
672
- default: withCtx(() => [
673
- createVNode(_component_DSkeletonItem, { style: { "width": "50%", "height": "20px" } })
674
- ]),
675
- _: 1
676
- }),
677
- createVNode(unref(Col), { flex: "none" }, {
678
- default: withCtx(() => [
679
- createVNode(_component_DSkeletonItem, { style: { "width": "40px", "height": "20px" } })
680
- ]),
681
- _: 1
682
- })
683
- ]),
684
- _: 1
685
- }),
686
- createVNode(unref(Row), {
687
- class: "mt-[12px]",
688
- align: "middle",
689
- gutter: 16
690
- }, {
691
- default: withCtx(() => [
692
- createVNode(unref(Col), { flex: "auto" }, {
693
- default: withCtx(() => [
694
- createVNode(_component_DSkeletonItem, { style: { "width": "80%", "height": "20px" } })
695
- ]),
696
- _: 1
697
- })
698
- ]),
699
- _: 1
700
- }),
701
- createVNode(unref(Row), {
702
- class: "mt-[12px]",
703
- align: "middle",
704
- gutter: 16
705
- }, {
706
- default: withCtx(() => [
707
- createVNode(unref(Col), { flex: "none" }, {
708
- default: withCtx(() => [
709
- createVNode(_component_DSkeletonItem, { style: { "width": "50px", "height": "20px", "border-radius": "20px" } })
710
- ]),
711
- _: 1
712
- }),
713
- createVNode(unref(Col), { flex: "none" }, {
714
- default: withCtx(() => [
715
- createVNode(_component_DSkeletonItem, { style: { "width": "60px", "height": "20px" } })
716
- ]),
717
- _: 1
718
- })
719
- ]),
720
- _: 1
721
- })
722
- ]);
723
- }), 64))
724
- ]))
725
- ]);
726
- };
727
- }
728
- });
729
- const SearchRecommed_vue_vue_type_style_index_0_scoped_d4635f7a_lang = "";
730
- const SearchRecommed = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-d4635f7a"]]);
623
+ const index_vue_vue_type_style_index_0_scoped_89269cfe_lang = "";
624
+ const SearchRepoCard = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-89269cfe"]]);
731
625
  export {
732
- SearchRecommed as default
626
+ SearchRepoCard as S,
627
+ formatNameSpace as f,
628
+ useReportRepo as u
733
629
  };
@@ -1,6 +1,6 @@
1
1
  import { defineComponent, onMounted, openBlock, createBlock, unref, withCtx, createElementVNode } from "vue";
2
2
  import { FixedOverlay } from "vue-devui-lal/overlay";
3
- import { l as useLayoutConfig, _ as _export_sfc } from "./index-20dfcc22.js";
3
+ import { l as useLayoutConfig, _ as _export_sfc } from "./index-840e7c95.js";
4
4
  import "vue-devui-lal/overlay/style.css";
5
5
  import "vue-devui-lal/button";
6
6
  import "vue-devui-lal/popover";
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { G, o, q, n, S, m, v, s, p } from "./index-20dfcc22.js";
1
+ import { o, p, v, n, S, m, w, s, q } from "./index-840e7c95.js";
2
2
  import "vue";
3
3
  import "vue-devui-lal/button";
4
4
  import "vue-devui-lal/popover";
@@ -46,13 +46,13 @@ import "vue-devui-lal/checkbox/style.css";
46
46
  import "vue-devui-lal/modal";
47
47
  import "vue-devui-lal/modal/style.css";
48
48
  export {
49
- G as GitCodeAside,
50
- o as GitCodeHeader,
51
- q as GitCodeLayoutEmitter,
49
+ o as GitCodeAside,
50
+ p as GitCodeHeader,
51
+ v as GitCodeLayoutEmitter,
52
52
  n as Login,
53
53
  S as SceneValue,
54
54
  m as ToolsFloat,
55
- v as default,
55
+ w as default,
56
56
  s as setLayoutConfig,
57
- p as useLogin
57
+ q as useLogin
58
58
  };
@@ -1,5 +1,5 @@
1
1
  import { defineComponent, computed, openBlock, createBlock, unref, isRef, withCtx, createElementVNode, normalizeClass, createVNode, createTextVNode } from "vue";
2
- import { i as isPhone, u as useModel } from "./index-20dfcc22.js";
2
+ import { i as isPhone, u as useModel } from "./index-840e7c95.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";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vue-layout-gitcode",
3
- "version": "1.1.7",
3
+ "version": "1.1.9",
4
4
  "description": "用于gitcode站点编程使用",
5
5
  "main": "index.js",
6
6
  "types": "./index.d.ts",