vue-layout-gitcode 1.5.6 → 1.5.8

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
1
  import { defineComponent, inject, createElementBlock, openBlock, Fragment, createElementVNode, toDisplayString, createVNode, unref, renderList, withDirectives, createBlock, ref, watch, onMounted, createCommentVNode } from "vue";
2
2
  import "vue-devui-lal/icon";
3
3
  import "vue-devui-lal/icon/style.css";
4
- import { h as headRequest, R as REPO_MODULE, a as i18n, G as GIcon, v as vElementExposure, b as REPO_EVENT, _ as _export_sfc, c as REPO_TYPE, e as extractRepoInfoWithURL } from "./index-rpfv9sUu.js";
5
- import { u as useReportRepo, S as SearchRepoCard, f as formatNameSpace } from "./index-CAZ8HuwO.js";
4
+ import { h as headRequest, R as REPO_MODULE, a as i18n, G as GIcon, v as vElementExposure, b as REPO_EVENT, _ as _export_sfc, c as REPO_TYPE, e as extractRepoInfoWithURL } from "./index-ByE2A0WE.js";
5
+ import { u as useReportRepo, S as SearchRepoCard, f as formatNameSpace } from "./index-DBnMY6hD.js";
6
6
  import "vue-devui-lal/tooltip";
7
7
  import "vue-devui-lal/tooltip/style.css";
8
8
  import "vue-router";
@@ -1,5 +1,5 @@
1
1
  import { ref, computed, createElementBlock, openBlock, normalizeClass, createBlock, createElementVNode, toDisplayString } from "vue";
2
- import { _ as _export_sfc, y as ThemeType, z as currentTheme, j as LANG_ZH, A as LANG_EN, B as getLocaleLang, G as GIcon } from "./index-rpfv9sUu.js";
2
+ import { _ as _export_sfc, y as ThemeType, z as currentTheme, j as LANG_ZH, A as LANG_EN, B as getLocaleLang, G as GIcon, C as isHttps } from "./index-ByE2A0WE.js";
3
3
  const _hoisted_1 = ["src"];
4
4
  const _sfc_main = {
5
5
  __name: "MenuItem",
@@ -8,13 +8,17 @@ const _sfc_main = {
8
8
  type: Object,
9
9
  default: () => {
10
10
  }
11
+ },
12
+ active: {
13
+ type: Boolean,
14
+ default: false
11
15
  }
12
16
  },
13
17
  setup(__props) {
14
18
  const props = __props;
15
19
  const isHover = ref(false);
16
20
  const isSelected = computed(() => {
17
- return props.item.id === 0 || isHover.value;
21
+ return props.active || isHover.value;
18
22
  });
19
23
  const currentImg = computed(() => {
20
24
  const imgMap = {
@@ -49,10 +53,12 @@ const _sfc_main = {
49
53
  const handleMenuClick = () => {
50
54
  if (props.item.is_open_new_tab) {
51
55
  window.open(props.item.left_menu_url, "_blank");
52
- } else if (props.item.jump_type === 3) {
53
- router.push(props.item.left_menu_url);
54
- } else {
56
+ } else if (isHttps(props.item.left_menu_url)) {
55
57
  window.location.href = props.item.left_menu_url;
58
+ } else {
59
+ router.push({
60
+ path: props.item.left_menu_url
61
+ });
56
62
  }
57
63
  };
58
64
  return (_ctx, _cache) => {
@@ -1,5 +1,5 @@
1
1
  import { ref, inject, computed, withDirectives, createElementBlock, openBlock, createElementVNode, toDisplayString, unref, Fragment, renderList, createVNode, vShow } from "vue";
2
- import { a as i18n, h as headRequest, G as GIcon, r as reqCatch } from "./index-rpfv9sUu.js";
2
+ import { a as i18n, h as headRequest, G as GIcon, r as reqCatch } from "./index-ByE2A0WE.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";
@@ -1,5 +1,5 @@
1
1
  import { defineComponent, computed, createElementBlock, openBlock, createCommentVNode, Fragment, renderList, normalizeClass, createElementVNode, createVNode, toDisplayString, withModifiers } from "vue";
2
- import { a as i18n, G as GIcon, _ as _export_sfc } from "./index-rpfv9sUu.js";
2
+ import { a as i18n, G as GIcon, _ as _export_sfc } from "./index-ByE2A0WE.js";
3
3
  import "vue-devui-lal/icon";
4
4
  import "vue-devui-lal/icon/style.css";
5
5
  const _hoisted_1 = { class: "history-list" };
@@ -1,5 +1,5 @@
1
1
  import { defineComponent, createElementBlock, openBlock, createElementVNode, withDirectives, toDisplayString, withModifiers, createVNode, vShow } from "vue";
2
- import { G as GIcon, _ as _export_sfc } from "./index-rpfv9sUu.js";
2
+ import { G as GIcon, _ as _export_sfc } from "./index-ByE2A0WE.js";
3
3
  import "vue-devui-lal/icon";
4
4
  import "vue-devui-lal/icon/style.css";
5
5
  const _hoisted_1 = { class: "ellipsis" };
@@ -1,6 +1,6 @@
1
1
  import { defineComponent, inject, ref, onMounted, createElementBlock, openBlock, createElementVNode, toDisplayString, unref, Fragment, renderList, createBlock, createVNode, withCtx } from "vue";
2
- import { u as useReportRepo, S as SearchRepoCard } from "./index-CAZ8HuwO.js";
3
- import { a as i18n, h as headRequest, R as REPO_MODULE, b as REPO_EVENT, l as localStorage, _ as _export_sfc } from "./index-rpfv9sUu.js";
2
+ import { u as useReportRepo, S as SearchRepoCard } from "./index-DBnMY6hD.js";
3
+ import { a as i18n, h as headRequest, R as REPO_MODULE, b as REPO_EVENT, l as localStorage, _ as _export_sfc } from "./index-ByE2A0WE.js";
4
4
  import { Row, Col } from "vue-devui-lal/grid";
5
5
  import { SkeletonItem } from "vue-devui-lal/skeleton";
6
6
  import "vue-devui-lal/grid/style.css";
@@ -1,5 +1,5 @@
1
1
  import { defineComponent, createElementBlock, openBlock, Fragment, renderList, createElementVNode, createVNode, createCommentVNode, toDisplayString, unref } from "vue";
2
- import { a as i18n, G as GIcon, _ as _export_sfc } from "./index-rpfv9sUu.js";
2
+ import { a as i18n, G as GIcon, _ as _export_sfc } from "./index-ByE2A0WE.js";
3
3
  import "vue-devui-lal/icon";
4
4
  import "vue-devui-lal/icon/style.css";
5
5
  const _hoisted_1 = ["onClick"];
@@ -1,5 +1,5 @@
1
1
  import { inject, ref, watch, withDirectives, createElementBlock, openBlock, createElementVNode, toDisplayString, unref, Fragment, renderList, createVNode, vShow } from "vue";
2
- import { a as i18n, h as headRequest, G as GIcon } from "./index-rpfv9sUu.js";
2
+ import { a as i18n, h as headRequest, G as GIcon } from "./index-ByE2A0WE.js";
3
3
  import "vue-devui-lal/icon";
4
4
  import "vue-devui-lal/icon/style.css";
5
5
  const _hoisted_1 = { class: "px-[8px] history-list-project pl-[8px]" };
@@ -8357,6 +8357,9 @@ const transferNumber = ({ number: number2, fixed = 2, byte, gt100 }) => {
8357
8357
  }
8358
8358
  return `${number2}`;
8359
8359
  };
8360
+ const isHttps = (url) => {
8361
+ return url.startsWith("https://") || url.startsWith("http://");
8362
+ };
8360
8363
  function mitt(n) {
8361
8364
  return { all: n = n || /* @__PURE__ */ new Map(), on: function(t2, e) {
8362
8365
  var i = n.get(t2);
@@ -18130,13 +18133,13 @@ const _sfc_main$q = /* @__PURE__ */ defineComponent({
18130
18133
  var _a;
18131
18134
  const layoutConfig2 = useLayoutConfig();
18132
18135
  const { t: $t } = i18n.global;
18133
- const ProjectSearch = defineAsyncComponent(() => import("./ProjectSearch-DBM8wKqh.js"));
18134
- const UserSearch = defineAsyncComponent(() => import("./UserSearch-D9RXvXQd.js"));
18135
- const GloabarSearch = defineAsyncComponent(() => import("./GloabarSearch-ChdR4YRS.js"));
18136
- const SearchHistoryList = defineAsyncComponent(() => import("./SearchHistoryList-CvN98188.js"));
18137
- const SearchScopeList = defineAsyncComponent(() => import("./SearchScopeList-Gd61hSpd.js"));
18138
- const SearchPrefixTag = defineAsyncComponent(() => import("./SearchPrefixTag-LuGY9WhO.js"));
18139
- const SearchRecommed = defineAsyncComponent(() => import("./SearchRecommed-CVWFQ_cZ.js"));
18136
+ const ProjectSearch = defineAsyncComponent(() => import("./ProjectSearch-ZoS1Ig-y.js"));
18137
+ const UserSearch = defineAsyncComponent(() => import("./UserSearch-1ZqPBdTR.js"));
18138
+ const GloabarSearch = defineAsyncComponent(() => import("./GloabarSearch-C851KUF_.js"));
18139
+ const SearchHistoryList = defineAsyncComponent(() => import("./SearchHistoryList-W0mwC20Y.js"));
18140
+ const SearchScopeList = defineAsyncComponent(() => import("./SearchScopeList-DnFT5FNB.js"));
18141
+ const SearchPrefixTag = defineAsyncComponent(() => import("./SearchPrefixTag-Bl3tAmP4.js"));
18142
+ const SearchRecommed = defineAsyncComponent(() => import("./SearchRecommed-D9i1_O8t.js"));
18140
18143
  const props = __props;
18141
18144
  const repoInfo = inject("repoInfo");
18142
18145
  const orgInfo = inject("orgInfo");
@@ -18746,7 +18749,7 @@ const _sfc_main$q = /* @__PURE__ */ defineComponent({
18746
18749
  }
18747
18750
  });
18748
18751
  const Search = /* @__PURE__ */ _export_sfc(_sfc_main$q, [["__scopeId", "data-v-gitcode-layout-lib"]]);
18749
- const NoticeModal = defineAsyncComponent(() => import("./notice-DB50sgrD.js"));
18752
+ const NoticeModal = defineAsyncComponent(() => import("./notice-DG8Cui_E.js"));
18750
18753
  function clearNotice() {
18751
18754
  if (localStorage$2.getItem("validator_email")) {
18752
18755
  localStorage$2.removeItem("validator_email");
@@ -20808,7 +20811,8 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
20808
20811
  },
20809
20812
  setup(__props) {
20810
20813
  const { t: t2 } = useI18n();
20811
- const MenuItem2 = defineAsyncComponent(() => import("./MenuItem-1bB7qOxV.js"));
20814
+ const route = useRoute();
20815
+ const MenuItem2 = defineAsyncComponent(() => import("./MenuItem-BDNMpjgb.js"));
20812
20816
  const ProjectMenuListV22 = defineAsyncComponent(() => Promise.resolve().then(() => ProjectMenuListV2$1));
20813
20817
  const ProjectMenuList2 = defineAsyncComponent(() => Promise.resolve().then(() => ProjectMenuList$1));
20814
20818
  const props = __props;
@@ -20819,9 +20823,6 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
20819
20823
  project: true,
20820
20824
  team: true
20821
20825
  });
20822
- const isMenu = (item) => {
20823
- return item.jump_type === 1;
20824
- };
20825
20826
  const isProject = (item) => {
20826
20827
  return item.jump_type === 2 && item.search_type === 1;
20827
20828
  };
@@ -20852,6 +20853,14 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
20852
20853
  username: username.value
20853
20854
  };
20854
20855
  });
20856
+ const getMenuItemProps = (item) => {
20857
+ const currentPath = route.path;
20858
+ const currentDomain = window.location.hostname;
20859
+ const isActive = isHttps(item.left_menu_url) || item.is_open_new_tab ? item.left_menu_url.includes(currentDomain) : item.left_menu_url === currentPath;
20860
+ return {
20861
+ active: isActive
20862
+ };
20863
+ };
20855
20864
  const getProps = (item) => {
20856
20865
  if (isProject(item)) {
20857
20866
  return projectProps.value;
@@ -20859,17 +20868,16 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
20859
20868
  if (isOrganization(item)) {
20860
20869
  return orgProps.value;
20861
20870
  }
20871
+ return getMenuItemProps(item);
20862
20872
  };
20863
20873
  const renderComponent = (item) => {
20864
- if (isMenu(item)) {
20865
- return MenuItem2;
20866
- }
20867
20874
  if (isProject(item)) {
20868
20875
  return ProjectMenuListV22;
20869
20876
  }
20870
20877
  if (isOrganization(item)) {
20871
20878
  return ProjectMenuList2;
20872
20879
  }
20880
+ return MenuItem2;
20873
20881
  };
20874
20882
  const defaultProject = ref({ loading: true });
20875
20883
  const defaultOrg = ref({});
@@ -20934,7 +20942,7 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
20934
20942
  showLangSetting: { type: Boolean }
20935
20943
  },
20936
20944
  setup(__props) {
20937
- const { t: t2 } = useI18n();
20945
+ const { t: t2 } = i18n.global;
20938
20946
  return (_ctx, _cache) => {
20939
20947
  return openBlock(), createBlock(unref(Dropdown), {
20940
20948
  position: ["bottom"],
@@ -20978,7 +20986,7 @@ const FEEDBACK_CENTER_URL = "https://gitcode.com/Gitcode-offical-team/GitCode-Do
20978
20986
  const _sfc_main$h = /* @__PURE__ */ defineComponent({
20979
20987
  __name: "SubMenuList",
20980
20988
  setup(__props) {
20981
- const { t: t2 } = useI18n();
20989
+ const { t: t2 } = i18n.global;
20982
20990
  const isEn = computed(() => {
20983
20991
  return getLocaleLang() === LANG_EN;
20984
20992
  });
@@ -21198,6 +21206,15 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
21198
21206
  asideSetShowLittle.value = props.collapseMode || !(asideDefaultWidth.value >= expand);
21199
21207
  }
21200
21208
  };
21209
+ const initHomePageAside = () => {
21210
+ if (isHome.value) {
21211
+ asideVisible.value = true;
21212
+ asideDefaultWidth.value = 240;
21213
+ asideSetShowLittle.value = true;
21214
+ emitEvent("handleAsideVisible", true);
21215
+ }
21216
+ };
21217
+ initHomePageAside();
21201
21218
  onMounted(() => {
21202
21219
  addEventListener("toggleAsideMenuByHamburger", () => {
21203
21220
  handleClickMenu();
@@ -26009,7 +26026,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
26009
26026
  }
26010
26027
  });
26011
26028
  const MFA = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-gitcode-layout-lib"]]);
26012
- const SlidCaptcha = defineAsyncComponent(() => import("./index-DVZwVm8Q.js"));
26029
+ const SlidCaptcha = defineAsyncComponent(() => import("./index-C23ra_xw.js"));
26013
26030
  const useSlidCaptcha = () => {
26014
26031
  const { mount, unMount } = usePopup("slid-captcha-popup");
26015
26032
  const open = (config) => {
@@ -27717,18 +27734,19 @@ const index = {
27717
27734
  export {
27718
27735
  LANG_EN as A,
27719
27736
  getLocaleLang as B,
27720
- ToolsFloat as C,
27721
- _sfc_main as D,
27737
+ isHttps as C,
27738
+ ToolsFloat as D,
27722
27739
  EVENT_NAME as E,
27723
- GitCodeAside as F,
27740
+ _sfc_main as F,
27724
27741
  GIcon as G,
27725
- GitCodeHeader as H,
27726
- useLogin as I,
27727
- setLayoutConfig as J,
27728
- GitCodeLayoutEmitter as K,
27742
+ GitCodeAside as H,
27743
+ GitCodeHeader as I,
27744
+ useLogin as J,
27745
+ setLayoutConfig as K,
27729
27746
  LANG_KEY as L,
27730
- setTheme as M,
27731
- index as N,
27747
+ GitCodeLayoutEmitter as M,
27748
+ setTheme as N,
27749
+ index as O,
27732
27750
  REPO_MODULE as R,
27733
27751
  SceneValue as S,
27734
27752
  TOPIC_TYPE as T,
@@ -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 { x as useLayoutConfig, _ as _export_sfc } from "./index-rpfv9sUu.js";
3
+ import { x as useLayoutConfig, _ as _export_sfc } from "./index-ByE2A0WE.js";
4
4
  import "vue-devui-lal/overlay/style.css";
5
5
  const _sfc_main = /* @__PURE__ */ defineComponent({
6
6
  __name: "index",
@@ -1,5 +1,5 @@
1
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-rpfv9sUu.js";
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-ByE2A0WE.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";
package/index.js CHANGED
@@ -1,14 +1,14 @@
1
- import { F, H, K, D, S, C, z, N, J, M, I } from "./index-rpfv9sUu.js";
1
+ import { H, I, M, F, S, D, z, O, K, N, J } from "./index-ByE2A0WE.js";
2
2
  export {
3
- F as GitCodeAside,
4
- H as GitCodeHeader,
5
- K as GitCodeLayoutEmitter,
6
- D as Login,
3
+ H as GitCodeAside,
4
+ I as GitCodeHeader,
5
+ M as GitCodeLayoutEmitter,
6
+ F as Login,
7
7
  S as SceneValue,
8
- C as ToolsFloat,
8
+ D as ToolsFloat,
9
9
  z as currentTheme,
10
- N as default,
11
- J as setLayoutConfig,
12
- M as setTheme,
13
- I as useLogin
10
+ O as default,
11
+ K as setLayoutConfig,
12
+ N as setTheme,
13
+ J 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-rpfv9sUu.js";
2
+ import { i as isPhone, u as useModel } from "./index-ByE2A0WE.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.5.6",
3
+ "version": "1.5.8",
4
4
  "description": "用于 gitcode 站点生产环境使用",
5
5
  "main": "index.js",
6
6
  "types": "./index.d.ts",