vue-layout-gitcode 1.1.8 → 1.1.10

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,8 +1,8 @@
1
- import { inject, ref, watch, onMounted, openBlock, createElementBlock, createElementVNode, toDisplayString, unref, Fragment, renderList, createVNode, createCommentVNode } from "vue";
2
- import { a as i18n, h as headRequest, R as REPO_MODULE, t as transWebUrl, I as Icon, b as REPO_EVENT, c as REPO_TYPE, e as extractRepoInfoWithURL } from "./index-6fe144dc.js";
3
- import { u as useReportRepo, f as formatNameSpace } from "./formatNameSpace-10290913.js";
1
+ import { inject, ref, watch, onMounted, openBlock, createElementBlock, createElementVNode, toDisplayString, unref, Fragment, renderList, createBlock, createCommentVNode } from "vue";
4
2
  import "vue-devui-lal/icon";
5
3
  import "vue-devui-lal/icon/style.css";
4
+ import { a as i18n, h as headRequest, R as REPO_MODULE, b as REPO_EVENT, c as REPO_TYPE, e as extractRepoInfoWithURL } from "./index-a7c6ab0b.js";
5
+ import { u as useReportRepo, S as SearchRepoCard, f as formatNameSpace } from "./index-465c9f4c.js";
6
6
  import "vue-devui-lal/button";
7
7
  import "vue-devui-lal/popover";
8
8
  import "vue-devui-lal/tooltip";
@@ -46,15 +46,14 @@ import "vue-devui-lal/checkbox";
46
46
  import "vue-devui-lal/checkbox/style.css";
47
47
  import "vue-devui-lal/modal";
48
48
  import "vue-devui-lal/modal/style.css";
49
+ import "vue-devui-lal/grid";
50
+ import "vue-devui-lal/grid/style.css";
49
51
  const GloabarSearch_vue_vue_type_style_index_0_lang = "";
50
52
  const _hoisted_1 = {
51
53
  key: 0,
52
54
  class: "px-[8px] history-list-project pl-[8px]"
53
55
  };
54
56
  const _hoisted_2 = { class: "history-list-project-globartitle mb-[4px] mt-[16px]" };
55
- const _hoisted_3 = ["href", "onClick"];
56
- const _hoisted_4 = { class: "flex history-list-project-globarbox" };
57
- const _hoisted_5 = { class: "ml-[8px] ellipsis" };
58
57
  const _sfc_main = {
59
58
  __name: "GloabarSearch",
60
59
  props: ["searchStr"],
@@ -67,7 +66,7 @@ const _sfc_main = {
67
66
  const origin = window.location.origin;
68
67
  const props = __props;
69
68
  let timer = null;
70
- const handleClick = (item) => {
69
+ const handleReport = (item) => {
71
70
  useReport(REPO_EVENT.CLICK, { module_name: REPO_MODULE.SEARCH_SUGGESTION_CARD, repo_id: item.id });
72
71
  };
73
72
  const getData = async () => {
@@ -85,7 +84,8 @@ const _sfc_main = {
85
84
  return {
86
85
  ...item,
87
86
  path: `${origin}/${item.path_with_namespace}`,
88
- displayName
87
+ displayName,
88
+ web_url: `${origin}/${item.path_with_namespace}`
89
89
  };
90
90
  });
91
91
  searchFileList.value.forEach((item, index) => {
@@ -116,22 +116,20 @@ const _sfc_main = {
116
116
  return (_ctx, _cache) => {
117
117
  return searchFileList.value.length ? (openBlock(), createElementBlock("div", _hoisted_1, [
118
118
  createElementVNode("p", _hoisted_2, toDisplayString(unref($t)("gitCodeLayout.header.repo")), 1),
119
- (openBlock(true), createElementBlock(Fragment, null, renderList(searchFileList.value, (item) => {
120
- return openBlock(), createElementBlock("a", {
121
- href: unref(transWebUrl)(item.path, { source_module: "search_project" }),
122
- key: item.path,
123
- target: "_blank",
124
- onClick: ($event) => handleClick(item)
125
- }, [
126
- createElementVNode("p", _hoisted_4, [
127
- createVNode(Icon, {
128
- name: "gt-line-repositories",
129
- color: "var(--theme-placeholder)",
130
- style: { "flex-shrink": "0" }
131
- }),
132
- createElementVNode("span", _hoisted_5, toDisplayString(item.displayName), 1)
133
- ])
134
- ], 8, _hoisted_3);
119
+ (openBlock(true), createElementBlock(Fragment, null, renderList(searchFileList.value, (item, index) => {
120
+ return openBlock(), createBlock(SearchRepoCard, {
121
+ key: item.id,
122
+ class: "mb-[8px]",
123
+ info: { ...item, index },
124
+ keyword: __props.searchStr,
125
+ hover: "",
126
+ hideTopicTags: "",
127
+ hideStarBtn: "",
128
+ hideFooter: "",
129
+ onReport: (evt) => handleReport(item),
130
+ cardType: "repo",
131
+ "url-params": { source_module: "search_project" }
132
+ }, null, 8, ["info", "keyword", "onReport"]);
135
133
  }), 128))
136
134
  ])) : createCommentVNode("", true);
137
135
  };
@@ -1,5 +1,5 @@
1
1
  import { ref, inject, computed, withDirectives, openBlock, createElementBlock, createElementVNode, toDisplayString, unref, Fragment, renderList, createVNode, vShow } from "vue";
2
- import { a as i18n, h as headRequest, I as Icon, r as reqCatch } from "./index-6fe144dc.js";
2
+ import { a as i18n, h as headRequest, G as GIcon, r as reqCatch } from "./index-a7c6ab0b.js";
3
3
  import { useRoute, useRouter } from "vue-router";
4
4
  import "vue-devui-lal/icon";
5
5
  import "vue-devui-lal/icon/style.css";
@@ -112,7 +112,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign({ name: "SearchFileList" }, {
112
112
  href: getRoutePath(item)
113
113
  }, [
114
114
  createElementVNode("p", _hoisted_4, [
115
- createVNode(Icon, {
115
+ createVNode(GIcon, {
116
116
  name: "gt-file-c",
117
117
  style: { "flex-shrink": "0" }
118
118
  }),
@@ -1,5 +1,5 @@
1
1
  import { defineComponent, computed, openBlock, createElementBlock, Fragment, renderList, normalizeClass, createElementVNode, createVNode, toDisplayString, withModifiers, createCommentVNode } from "vue";
2
- import { a as i18n, I as Icon, _ as _export_sfc } from "./index-6fe144dc.js";
2
+ import { a as i18n, G as GIcon, _ as _export_sfc } from "./index-a7c6ab0b.js";
3
3
  import "vue-devui-lal/icon";
4
4
  import "vue-devui-lal/icon/style.css";
5
5
  import "vue-devui-lal/button";
@@ -109,7 +109,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
109
109
  onMouseenter: ($event) => onSearchEnter(index)
110
110
  }, [
111
111
  createElementVNode("div", _hoisted_3, [
112
- createVNode(Icon, {
112
+ createVNode(GIcon, {
113
113
  name: "gt-line-time",
114
114
  color: "var(--devui-aide-text)",
115
115
  class: "mr-[8px]"
@@ -124,7 +124,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
124
124
  }, toDisplayString(item.namespaceTitle), 9, _hoisted_5),
125
125
  createElementVNode("span", _hoisted_6, toDisplayString(item.q || item), 1)
126
126
  ]),
127
- createVNode(Icon, {
127
+ createVNode(GIcon, {
128
128
  name: "gt-line-close",
129
129
  class: "itemClose",
130
130
  onClick: withModifiers(($event) => onDeleteHistory(index), ["stop"])
@@ -1,5 +1,5 @@
1
1
  import { defineComponent, openBlock, createElementBlock, createElementVNode, toDisplayString, withDirectives, withModifiers, createVNode, vShow } from "vue";
2
- import { I as Icon, _ as _export_sfc } from "./index-6fe144dc.js";
2
+ import { G as GIcon, _ as _export_sfc } from "./index-a7c6ab0b.js";
3
3
  import "vue-devui-lal/icon";
4
4
  import "vue-devui-lal/icon/style.css";
5
5
  import "vue-devui-lal/button";
@@ -71,7 +71,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
71
71
  class: "g-header-search-projectname-close ml-[12px] flex",
72
72
  onClick: withModifiers(onCloseTag, ["stop"])
73
73
  }, [
74
- createVNode(Icon, {
74
+ createVNode(GIcon, {
75
75
  name: "icon-close",
76
76
  color: "#fff",
77
77
  size: "7px"
@@ -0,0 +1,188 @@
1
+ import { defineComponent, inject, ref, onMounted, resolveComponent, openBlock, createElementBlock, createElementVNode, toDisplayString, unref, Fragment, renderList, createBlock, createVNode, withCtx } from "vue";
2
+ import { u as useReportRepo, S as SearchRepoCard } from "./index-465c9f4c.js";
3
+ import { a as i18n, h as headRequest, R as REPO_MODULE, b as REPO_EVENT, _ as _export_sfc } from "./index-a7c6ab0b.js";
4
+ import { Row, Col } from "vue-devui-lal/grid";
5
+ import "vue-devui-lal/grid/style.css";
6
+ import "vue-router";
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 _hoisted_1 = { class: "g-header-search-recommed" };
52
+ const _hoisted_2 = { key: 0 };
53
+ const _hoisted_3 = { class: "g-header-search-recommed-title" };
54
+ const _hoisted_4 = { key: 1 };
55
+ const _sfc_main = /* @__PURE__ */ defineComponent({
56
+ __name: "SearchRecommed",
57
+ setup(__props) {
58
+ const { t: $t } = i18n.global;
59
+ const API = headRequest(inject("request"));
60
+ const useReport = inject("useReport");
61
+ const { triggerReport } = useReportRepo({ moduleName: REPO_MODULE.SEARCH_RECOMMEND_CARD }, API.viewReport);
62
+ const recommendRepoList = ref([]);
63
+ const handleReport = (repo, index, evt) => {
64
+ const params = evt === "starReport" ? {
65
+ module_name: REPO_MODULE.SEARCH_RECOMMEND_CARD,
66
+ repo_id: repo.id,
67
+ Project_card_star: "star",
68
+ repo_index: index
69
+ } : { module_name: REPO_MODULE.SEARCH_RECOMMEND_CARD, repo_id: repo.id, repo_index: index };
70
+ useReport(REPO_EVENT.CLICK, params, () => {
71
+ });
72
+ };
73
+ const getRecommendRepo = async () => {
74
+ var _a;
75
+ let localSearchText = JSON.parse(localStorage.getItem("localSearchText") || "[]").splice(0, 10);
76
+ if (localSearchText == null ? void 0 : localSearchText.length) {
77
+ localSearchText = localSearchText.map((item) => ({
78
+ ...item,
79
+ count: item.count || 1
80
+ }));
81
+ }
82
+ const params = { history: JSON.stringify(localSearchText) };
83
+ const res = await API.openSourceProject(params);
84
+ const data = (((_a = res == null ? void 0 : res.data) == null ? void 0 : _a.content) || []).map((item) => ({
85
+ ...item,
86
+ tags: item.tags || item.topic_names
87
+ }));
88
+ data.forEach((item, index) => {
89
+ triggerReport("expo", { ...item, index });
90
+ });
91
+ recommendRepoList.value = data;
92
+ };
93
+ onMounted(() => {
94
+ console.log("onMounted");
95
+ getRecommendRepo();
96
+ });
97
+ return (_ctx, _cache) => {
98
+ const _component_DSkeletonItem = resolveComponent("DSkeletonItem");
99
+ return openBlock(), createElementBlock("div", _hoisted_1, [
100
+ recommendRepoList.value.length ? (openBlock(), createElementBlock("div", _hoisted_2, [
101
+ createElementVNode("div", _hoisted_3, toDisplayString(unref($t)("gitCodeLayout.search.trendingToday")), 1),
102
+ (openBlock(true), createElementBlock(Fragment, null, renderList(recommendRepoList.value, (item, index) => {
103
+ return openBlock(), createBlock(SearchRepoCard, {
104
+ key: item.id,
105
+ class: "mb-[8px]",
106
+ info: { ...item, index },
107
+ keyword: "",
108
+ hover: "",
109
+ hideTopicTags: "",
110
+ onReport: (evt) => handleReport(item, index, evt),
111
+ cardType: "repo",
112
+ "url-params": { source_module: "today_trending" }
113
+ }, null, 8, ["info", "onReport"]);
114
+ }), 128))
115
+ ])) : (openBlock(), createElementBlock("div", _hoisted_4, [
116
+ (openBlock(), createElementBlock(Fragment, null, renderList(5, (item) => {
117
+ return createElementVNode("div", {
118
+ class: "pt-[8px] pb-[16px]",
119
+ key: item
120
+ }, [
121
+ createVNode(unref(Row), {
122
+ align: "middle",
123
+ gutter: 16
124
+ }, {
125
+ default: withCtx(() => [
126
+ createVNode(unref(Col), { flex: "auto" }, {
127
+ default: withCtx(() => [
128
+ createVNode(_component_DSkeletonItem, { style: { "width": "50%", "height": "20px" } })
129
+ ]),
130
+ _: 1
131
+ }),
132
+ createVNode(unref(Col), { flex: "none" }, {
133
+ default: withCtx(() => [
134
+ createVNode(_component_DSkeletonItem, { style: { "width": "40px", "height": "20px" } })
135
+ ]),
136
+ _: 1
137
+ })
138
+ ]),
139
+ _: 1
140
+ }),
141
+ createVNode(unref(Row), {
142
+ class: "mt-[12px]",
143
+ align: "middle",
144
+ gutter: 16
145
+ }, {
146
+ default: withCtx(() => [
147
+ createVNode(unref(Col), { flex: "auto" }, {
148
+ default: withCtx(() => [
149
+ createVNode(_component_DSkeletonItem, { style: { "width": "80%", "height": "20px" } })
150
+ ]),
151
+ _: 1
152
+ })
153
+ ]),
154
+ _: 1
155
+ }),
156
+ createVNode(unref(Row), {
157
+ class: "mt-[12px]",
158
+ align: "middle",
159
+ gutter: 16
160
+ }, {
161
+ default: withCtx(() => [
162
+ createVNode(unref(Col), { flex: "none" }, {
163
+ default: withCtx(() => [
164
+ createVNode(_component_DSkeletonItem, { style: { "width": "50px", "height": "20px", "border-radius": "20px" } })
165
+ ]),
166
+ _: 1
167
+ }),
168
+ createVNode(unref(Col), { flex: "none" }, {
169
+ default: withCtx(() => [
170
+ createVNode(_component_DSkeletonItem, { style: { "width": "60px", "height": "20px" } })
171
+ ]),
172
+ _: 1
173
+ })
174
+ ]),
175
+ _: 1
176
+ })
177
+ ]);
178
+ }), 64))
179
+ ]))
180
+ ]);
181
+ };
182
+ }
183
+ });
184
+ const SearchRecommed_vue_vue_type_style_index_0_scoped_a36f22ee_lang = "";
185
+ const SearchRecommed = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-a36f22ee"]]);
186
+ export {
187
+ SearchRecommed as default
188
+ };
@@ -1,5 +1,5 @@
1
1
  import { defineComponent, openBlock, createElementBlock, Fragment, renderList, createElementVNode, createVNode, toDisplayString, createCommentVNode, unref } from "vue";
2
- import { a as i18n, I as Icon, _ as _export_sfc } from "./index-6fe144dc.js";
2
+ import { a as i18n, G as GIcon, _ as _export_sfc } from "./index-a7c6ab0b.js";
3
3
  import "vue-devui-lal/icon";
4
4
  import "vue-devui-lal/icon/style.css";
5
5
  import "vue-devui-lal/button";
@@ -78,7 +78,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
78
78
  }, [
79
79
  createElementVNode("div", _hoisted_2, [
80
80
  createElementVNode("p", _hoisted_3, [
81
- createVNode(Icon, {
81
+ createVNode(GIcon, {
82
82
  name: "gt-search",
83
83
  class: "g-header-search-icon"
84
84
  }),
@@ -88,7 +88,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
88
88
  ]),
89
89
  createElementVNode("p", _hoisted_7, [
90
90
  createElementVNode("span", null, toDisplayString(item.label ? `${item.label}${unref($t)("gitCodeLayout.header.underSearch")}` : item.title), 1),
91
- createVNode(Icon, { name: "gt-line-right" })
91
+ createVNode(GIcon, { name: "gt-line-right" })
92
92
  ])
93
93
  ]),
94
94
  _cache[0] || (_cache[0] = createElementVNode("hr", { class: "line" }, null, -1))
@@ -1,5 +1,5 @@
1
1
  import { inject, ref, watch, withDirectives, openBlock, createElementBlock, createElementVNode, toDisplayString, unref, Fragment, renderList, createVNode, vShow } from "vue";
2
- import { a as i18n, h as headRequest, I as Icon } from "./index-6fe144dc.js";
2
+ import { a as i18n, h as headRequest, G as GIcon } from "./index-a7c6ab0b.js";
3
3
  import "vue-devui-lal/icon";
4
4
  import "vue-devui-lal/icon/style.css";
5
5
  import "vue-devui-lal/button";
@@ -110,7 +110,7 @@ const _sfc_main = {
110
110
  href: item.web_url
111
111
  }, [
112
112
  createElementVNode("p", _hoisted_4, [
113
- createVNode(Icon, {
113
+ createVNode(GIcon, {
114
114
  name: "icon-folder-2",
115
115
  style: { "flex-shrink": "0" }
116
116
  }),