vue-layout-gitcode 1.12.15-beta.17 → 1.12.15-beta.19

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,10 +1,10 @@
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-Br1fy5_D.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-CdGNxKZI.js";
5
5
  import "lodash/debounce";
6
- import { u as useReportRepo, S as SearchRepoCard, f as formatNameSpace } from "./index-BHsDObhI.js";
7
- import "./transWebUrl-Cg0htQOi.js";
6
+ import { u as useReportRepo, S as SearchRepoCard, f as formatNameSpace } from "./index-AfSq7g-p.js";
7
+ import "./transWebUrl-Cmpy6PO-.js";
8
8
  import "vue-devui-lal/tooltip";
9
9
  import "vue-devui-lal/tooltip/style.css";
10
10
  import "vue-router";
@@ -1,5 +1,5 @@
1
1
  import { defineComponent, inject, useSlots, computed, ref, createBlock, openBlock, unref, withCtx, createElementVNode, normalizeClass, createElementBlock, createCommentVNode, createTextVNode, toDisplayString, renderSlot } from "vue";
2
- import { a as i18n, y as useLayoutConfig, A as ThemeType, B as currentTheme, L as LANG_ZH, C as LANG_EN, D as getLocaleLang, G as GIcon, F as emitEvent, b as REPO_EVENT, H as ASIDE_MENU_REPO, I as isHttps, J as navigateWithMigrationGuard, _ as _export_sfc } from "./index-Br1fy5_D.js";
2
+ import { a as i18n, y as useLayoutConfig, A as ThemeType, B as currentTheme, L as LANG_ZH, C as LANG_EN, D as getLocaleLang, G as GIcon, F as emitEvent, b as REPO_EVENT, H as ASIDE_MENU_REPO, I as isHttps, J as navigateWithMigrationGuard, _ as _export_sfc } from "./index-CdGNxKZI.js";
3
3
  import { useRouter } from "vue-router";
4
4
  import { Popover } from "vue-devui-lal/popover";
5
5
  import "vue-devui-lal/popover/style.css";
@@ -1,7 +1,7 @@
1
1
  import { defineComponent, inject, ref, reactive, watch, computed, createElementBlock, openBlock, createCommentVNode, createBlock, withDirectives, Fragment, createElementVNode, createVNode, toDisplayString, unref, withModifiers, normalizeClass, withCtx, renderList, createTextVNode, vShow } from "vue";
2
- import { a as i18n, y as useLayoutConfig, G as GIcon, t as transformUrl, M as _sfc_main$1, N as loadAsideData, J as navigateWithMigrationGuard, F as emitEvent, s as setLoginTriggerSource, f as useRequestReport, K as asideRequest, _ as _export_sfc } from "./index-Br1fy5_D.js";
2
+ import { a as i18n, y as useLayoutConfig, G as GIcon, t as transformUrl, M as _sfc_main$1, N as loadAsideData, J as navigateWithMigrationGuard, F as emitEvent, s as setLoginTriggerSource, f as useRequestReport, K as asideRequest, _ as _export_sfc } from "./index-CdGNxKZI.js";
3
3
  import { useRouter } from "vue-router";
4
- import { t as transWebUrl } from "./transWebUrl-Cg0htQOi.js";
4
+ import { t as transWebUrl } from "./transWebUrl-Cmpy6PO-.js";
5
5
  import { Select, Option } from "vue-devui-lal/select";
6
6
  import { Input } from "vue-devui-lal/input";
7
7
  import { Skeleton } from "vue-devui-lal/skeleton";
@@ -1,7 +1,7 @@
1
1
  import { defineComponent, inject, ref, reactive, computed, watch, createElementBlock, openBlock, createElementVNode, createVNode, createBlock, createCommentVNode, withDirectives, toDisplayString, unref, withModifiers, normalizeClass, withCtx, Fragment, renderList, createTextVNode, vShow } from "vue";
2
- import { a as i18n, y as useLayoutConfig, t as transformUrl, K as asideRequest, G as GIcon, J as navigateWithMigrationGuard, F as emitEvent, s as setLoginTriggerSource, f as useRequestReport, _ as _export_sfc } from "./index-Br1fy5_D.js";
2
+ import { a as i18n, y as useLayoutConfig, t as transformUrl, K as asideRequest, G as GIcon, J as navigateWithMigrationGuard, F as emitEvent, s as setLoginTriggerSource, f as useRequestReport, _ as _export_sfc } from "./index-CdGNxKZI.js";
3
3
  import { useRouter } from "vue-router";
4
- import { t as transWebUrl } from "./transWebUrl-Cg0htQOi.js";
4
+ import { t as transWebUrl } from "./transWebUrl-Cmpy6PO-.js";
5
5
  import { Input } from "vue-devui-lal/input";
6
6
  import { Skeleton } from "vue-devui-lal/skeleton";
7
7
  import { MenuItem } from "vue-devui-lal/menu";
@@ -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-Br1fy5_D.js";
2
+ import { a as i18n, h as headRequest, G as GIcon, r as reqCatch } from "./index-CdGNxKZI.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-Br1fy5_D.js";
2
+ import { a as i18n, G as GIcon, _ as _export_sfc } from "./index-CdGNxKZI.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,6 +1,6 @@
1
1
  import { defineComponent, inject, ref, onMounted, createElementBlock, openBlock, createElementVNode, toDisplayString, unref, Fragment, renderList, renderSlot, createBlock, createVNode, withCtx } from "vue";
2
- import { u as useReportRepo, S as SearchRepoCard } from "./index-BHsDObhI.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-Br1fy5_D.js";
2
+ import { u as useReportRepo, S as SearchRepoCard } from "./index-AfSq7g-p.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-CdGNxKZI.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-Br1fy5_D.js";
2
+ import { a as i18n, G as GIcon, _ as _export_sfc } from "./index-CdGNxKZI.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, t as transformUrl } from "./index-Br1fy5_D.js";
2
+ import { a as i18n, h as headRequest, G as GIcon, t as transformUrl } from "./index-CdGNxKZI.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-project history-list-project--padded" };
@@ -1,7 +1,7 @@
1
1
  import { ref, watchEffect, defineComponent, toDisplayString, unref, mergeModels, useModel, watch, createElementBlock, openBlock, createVNode, withDirectives, normalizeClass, createElementVNode, vShow, inject, withModifiers, createBlock, Fragment, computed, createCommentVNode, normalizeStyle, createTextVNode, onMounted, onUnmounted, renderList, withCtx, reactive } from "vue";
2
2
  import debounce from "lodash/debounce";
3
- import { d as transferNumber, G as GIcon, _ as _export_sfc, s as setLoginTriggerSource, f as useRequestReport, r as reqCatch, h as headRequest, a as i18n, T as TOPIC_TYPE, g as useTimeFormat, j as useCookie, k as usePageResize, L as LANG_ZH, m as isGstarRepo, n as _sfc_main$b, o as isIncubationRepo, p as highlightWords, t as transformUrl, q as _frEventTrack, E as EVENT_NAME, c as REPO_TYPE, e as extractRepoInfoWithURL, w as LANG_KEY } from "./index-Br1fy5_D.js";
4
- import { t as transWebUrl } from "./transWebUrl-Cg0htQOi.js";
3
+ import { d as transferNumber, G as GIcon, _ as _export_sfc, s as setLoginTriggerSource, f as useRequestReport, r as reqCatch, h as headRequest, a as i18n, T as TOPIC_TYPE, g as useTimeFormat, j as useCookie, k as usePageResize, L as LANG_ZH, m as isGstarRepo, n as _sfc_main$b, o as isIncubationRepo, p as highlightWords, t as transformUrl, q as _frEventTrack, E as EVENT_NAME, c as REPO_TYPE, e as extractRepoInfoWithURL, w as LANG_KEY } from "./index-CdGNxKZI.js";
4
+ import { t as transWebUrl } from "./transWebUrl-Cmpy6PO-.js";
5
5
  import { useRouter } from "vue-router";
6
6
  import { Row, Col } from "vue-devui-lal/grid";
7
7
  import { Skeleton, SkeletonItem } from "vue-devui-lal/skeleton";
@@ -16340,12 +16340,12 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
16340
16340
  setup(__props) {
16341
16341
  const layoutConfig2 = useLayoutConfig();
16342
16342
  const { t: $t } = i18n.global;
16343
- const ProjectSearch = defineAsyncComponent(() => import("./ProjectSearch-DZmw-rlF.js"));
16344
- const UserSearch = defineAsyncComponent(() => import("./UserSearch-Cxhi3du4.js"));
16345
- const GloabarSearch = defineAsyncComponent(() => import("./GloabarSearch-BMVvtDW1.js"));
16346
- const SearchHistoryList = defineAsyncComponent(() => import("./SearchHistoryList-YbVh1LSu.js"));
16347
- const SearchScopeList = defineAsyncComponent(() => import("./SearchScopeList-NDSNIf2T.js"));
16348
- const SearchRecommed = defineAsyncComponent(() => import("./SearchRecommed-0WK3JW4L.js"));
16343
+ const ProjectSearch = defineAsyncComponent(() => import("./ProjectSearch-CTFbcFFk.js"));
16344
+ const UserSearch = defineAsyncComponent(() => import("./UserSearch-DrPy9UZk.js"));
16345
+ const GloabarSearch = defineAsyncComponent(() => import("./GloabarSearch-qcZ4oS7J.js"));
16346
+ const SearchHistoryList = defineAsyncComponent(() => import("./SearchHistoryList-B62oSJ8Q.js"));
16347
+ const SearchScopeList = defineAsyncComponent(() => import("./SearchScopeList-BC_V4bID.js"));
16348
+ const SearchRecommed = defineAsyncComponent(() => import("./SearchRecommed-C0YIqmoZ.js"));
16349
16349
  const props = __props;
16350
16350
  const repoInfo = inject("repoInfo");
16351
16351
  const orgInfo = inject("orgInfo");
@@ -17253,14 +17253,14 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
17253
17253
  const sidebarUrls = ref(null);
17254
17254
  const actionUrls = computed(() => sidebarUrls.value ?? fallbackUrls.value);
17255
17255
  const discoverLinks = computed(() => [
17256
- {
17257
- label: t2("gitCodeLayout.home.aiCommunity"),
17258
- href: actionUrls.value.aiCommunity
17259
- },
17260
17256
  {
17261
17257
  label: "AtomCode",
17262
17258
  href: actionUrls.value.atomCode
17263
17259
  },
17260
+ {
17261
+ label: t2("gitCodeLayout.home.aiCommunity"),
17262
+ href: actionUrls.value.aiCommunity
17263
+ },
17264
17264
  {
17265
17265
  label: t2("gitCodeLayout.home.competition"),
17266
17266
  href: actionUrls.value.competition
@@ -17369,7 +17369,7 @@ const autoAvokeLogin = ({ isLogin, loginFunc, openHarmonyGuide, loginSuccess, lo
17369
17369
  loginFunc({ type: "login", triggerType: "", loginTriggerSource: "router_login_auth", ...loginFuncOpts }, loginSuccess, openHarmonyGuide);
17370
17370
  }
17371
17371
  };
17372
- const NoticeModal = defineAsyncComponent(() => import("./notice-Cwymytr3.js"));
17372
+ const NoticeModal = defineAsyncComponent(() => import("./notice-m4odxsof.js"));
17373
17373
  function clearNotice() {
17374
17374
  if (localStorage$2.getItem("validator_email")) {
17375
17375
  localStorage$2.removeItem("validator_email");
@@ -18583,9 +18583,9 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
18583
18583
  const layoutConfig2 = useLayoutConfig();
18584
18584
  const { t: t2 } = i18n.global;
18585
18585
  const route = useRoute();
18586
- const MenuItem = defineAsyncComponent(() => import("./MenuItem-Bce2QrrP.js"));
18587
- const ProjectMenuListV2 = defineAsyncComponent(() => import("./ProjectMenuListV2-BxegipPo.js"));
18588
- const ProjectMenuList = defineAsyncComponent(() => import("./ProjectMenuList-CCxFdHf7.js"));
18586
+ const MenuItem = defineAsyncComponent(() => import("./MenuItem-dLXqaM49.js"));
18587
+ const ProjectMenuListV2 = defineAsyncComponent(() => import("./ProjectMenuListV2-DoaouJ41.js"));
18588
+ const ProjectMenuList = defineAsyncComponent(() => import("./ProjectMenuList-BF-c6bAL.js"));
18589
18589
  const props = __props;
18590
18590
  const useReport2 = inject("useReport");
18591
18591
  const userInfo = inject("userInfo");
@@ -20043,13 +20043,17 @@ const _hoisted_23$1 = {
20043
20043
  "stroke-linecap": "round",
20044
20044
  "stroke-linejoin": "round"
20045
20045
  };
20046
- const _hoisted_24$1 = { class: "home-channel-side-nav__footer-tools-container" };
20046
+ const _hoisted_24$1 = {
20047
+ key: 0,
20048
+ class: "home-channel-side-nav__footer-tools-container"
20049
+ };
20047
20050
  const _hoisted_25$1 = { class: "home-channel-side-nav__footer-tools-inner" };
20048
20051
  const _sfc_main$g = /* @__PURE__ */ defineComponent({
20049
20052
  ...{ name: "AsideV2Content", inheritAttrs: false },
20050
20053
  __name: "asideV2Content",
20051
20054
  props: {
20052
20055
  sceneValue: { default: SceneValue.home },
20056
+ disableFlatMode: { type: Boolean, default: false },
20053
20057
  singleCol: { type: Boolean, default: false },
20054
20058
  channels: { default: void 0 },
20055
20059
  modelValue: { default: "" },
@@ -20059,6 +20063,8 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
20059
20063
  request: { type: Function, default: proxyService },
20060
20064
  globalStore: { default: () => ({ httpStatus: 200 }) },
20061
20065
  independence: { type: Boolean, default: false },
20066
+ showThemeSetting: { type: Boolean, default: void 0 },
20067
+ showLangSetting: { type: Boolean, default: void 0 },
20062
20068
  onChannelChange: { type: Function, default: void 0 }
20063
20069
  },
20064
20070
  emits: ["update:modelValue", "update:activeChannel", "channelChange", "select"],
@@ -20084,6 +20090,14 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
20084
20090
  const { useReport: useReport2 } = useRequestReport(injectRequest, injectGlobalStore);
20085
20091
  const API = asideV2Request(injectRequest);
20086
20092
  const isEn = computed(() => getLocaleLang() === LANG_EN);
20093
+ const showThemeSetting = computed(() => {
20094
+ if (props.showThemeSetting !== void 0) return props.showThemeSetting;
20095
+ return ![SceneValue.aiHome, SceneValue.aiRepo, SceneValue.aiGuide].includes(props.sceneValue);
20096
+ });
20097
+ const showLangSetting = computed(() => {
20098
+ if (props.showLangSetting !== void 0) return props.showLangSetting;
20099
+ return true;
20100
+ });
20087
20101
  const isDarkTheme = computed(() => currentTheme.value === "black");
20088
20102
  const newTagSrc = computed(() => isDarkTheme.value ? newTagDarkImg : newTagImg);
20089
20103
  const copyright = computed(() => createSetting().copyright);
@@ -20516,11 +20530,15 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
20516
20530
  ]),
20517
20531
  _: 1
20518
20532
  }, 512),
20519
- createElementVNode("div", _hoisted_24$1, [
20533
+ showThemeSetting.value || showLangSetting.value ? (openBlock(), createElementBlock("div", _hoisted_24$1, [
20520
20534
  createElementVNode("div", _hoisted_25$1, [
20521
- createVNode(AsideFooterTools, { position: ["top-start", "top-end"] })
20535
+ createVNode(AsideFooterTools, {
20536
+ "show-theme-setting": showThemeSetting.value,
20537
+ "show-lang-setting": showLangSetting.value,
20538
+ position: ["top-start", "top-end"]
20539
+ }, null, 8, ["show-theme-setting", "show-lang-setting"])
20522
20540
  ])
20523
- ])
20541
+ ])) : createCommentVNode("", true)
20524
20542
  ])
20525
20543
  ], 2);
20526
20544
  };
@@ -20532,15 +20550,21 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
20532
20550
  ...{ name: "GitCodeAsideV2", inheritAttrs: false },
20533
20551
  __name: "index",
20534
20552
  props: {
20553
+ showThemeSetting: { type: Boolean, default: void 0 },
20554
+ showLangSetting: { type: Boolean, default: void 0 },
20555
+ collapseMode: { type: Boolean, default: false },
20535
20556
  sceneValue: { default: SceneValue.home },
20557
+ disableFlatMode: { type: Boolean, default: false },
20536
20558
  singleCol: { type: Boolean, default: false },
20537
20559
  channels: { default: void 0 },
20538
20560
  modelValue: { default: "" },
20539
20561
  activeChannel: { default: "" },
20540
20562
  userInfo: { default: () => ({}) },
20541
- isLogin: { type: Boolean, default: false },
20563
+ isLogin: { type: Boolean },
20542
20564
  request: { type: Function, default: proxyService },
20543
- globalStore: { default: () => ({ httpStatus: 200 }) },
20565
+ globalStore: { default: () => ({
20566
+ httpStatus: 200
20567
+ }) },
20544
20568
  independence: { type: Boolean, default: false },
20545
20569
  onChannelChange: { type: Function, default: void 0 }
20546
20570
  },
@@ -20548,15 +20572,46 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
20548
20572
  setup(__props, { emit: __emit }) {
20549
20573
  const props = __props;
20550
20574
  const emit = __emit;
20551
- useRoute();
20575
+ const route = useRoute();
20552
20576
  const router2 = useRouter();
20553
20577
  const layoutConfig2 = useLayoutConfig();
20578
+ async function handleDrawerLogoClick(e) {
20579
+ if (props.independence) return;
20580
+ if (e.metaKey || e.ctrlKey || e.shiftKey || e.button !== 0) return;
20581
+ let href;
20582
+ try {
20583
+ href = router2.resolve({ name: "home" }).href;
20584
+ } catch {
20585
+ return;
20586
+ }
20587
+ e.preventDefault();
20588
+ try {
20589
+ const migrated = await isMigratedHref(href);
20590
+ if (migrated) {
20591
+ window.open(href, "_self");
20592
+ } else {
20593
+ router2.push({ name: "home" });
20594
+ }
20595
+ } catch {
20596
+ router2.push({ name: "home" });
20597
+ }
20598
+ }
20554
20599
  const { headerHeight: headerHeight2 } = useHeaderHeight();
20555
20600
  const { useReport: useReport2 } = useRequestReport(props.request, props.globalStore);
20556
- provide("globalStore", computed(() => props.globalStore));
20601
+ provide(
20602
+ "globalStore",
20603
+ computed(() => props.globalStore)
20604
+ );
20557
20605
  provide("request", props.request);
20558
- provide("userInfo", computed(() => props.userInfo));
20606
+ provide(
20607
+ "userInfo",
20608
+ computed(() => props.userInfo)
20609
+ );
20559
20610
  provide("useReport", useReport2);
20611
+ computed(() => {
20612
+ if (route.meta.showBgColor) return true;
20613
+ return false;
20614
+ });
20560
20615
  const logoConfig = getCurrentLogoMap();
20561
20616
  const logoStyle = computed(() => {
20562
20617
  const isBlackTheme = currentTheme.value === "black";
@@ -20571,14 +20626,43 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
20571
20626
  const sizeStore = usePageResize();
20572
20627
  const asideSetShow = computed(() => {
20573
20628
  if (props.singleCol) return false;
20574
- return props.sceneValue === SceneValue.home && !sizeStore.isMobile.value;
20629
+ return (props.sceneValue === SceneValue.home && !sizeStore.isMobile.value || props.collapseMode) && !props.disableFlatMode;
20575
20630
  });
20576
20631
  provide("asideSetShow", asideSetShow);
20632
+ console.log("indexasideSetShow", asideSetShow.value);
20633
+ const isHome = computed(() => {
20634
+ return props.sceneValue === SceneValue.home && ["home", "issues", "kanban", "discussionCreated", "merge", "dashboard", "marketplace", "marketplaceDetail"].includes(route == null ? void 0 : route.name);
20635
+ });
20636
+ const asideSize = computed(() => {
20637
+ if (props.collapseMode) {
20638
+ return ASIDE_MENU_MODE.collapse;
20639
+ } else {
20640
+ return ASIDE_MENU_MODE.default;
20641
+ }
20642
+ });
20643
+ const asideSetShowLittle = useStorage("asideSetShowLittle", false);
20644
+ const asideSetShowLittleMode = computed(() => {
20645
+ if (props.collapseMode) {
20646
+ return true;
20647
+ } else if (isHome.value) {
20648
+ return false;
20649
+ } else {
20650
+ return asideSetShowLittle.value;
20651
+ }
20652
+ });
20653
+ const asideDefaultWidth = useStorage("asideDefaultWidth", sizeStore.isMobile.value ? 0 : asideSize.value.expand);
20577
20654
  const mainMarginLeftWidth = computed(() => {
20578
20655
  if (!asideSetShow.value || sizeStore.isMobile.value) {
20579
20656
  return 0;
20580
20657
  }
20581
- return 240;
20658
+ if (isHome.value) {
20659
+ return 240;
20660
+ }
20661
+ if (props.collapseMode) {
20662
+ return asideDefaultWidth.value >= asideSize.value.expand ? asideSize.value.expand : asideDefaultWidth.value;
20663
+ } else {
20664
+ return asideDefaultWidth.value < asideSize.value.expand ? asideSize.value.collapse : asideDefaultWidth.value;
20665
+ }
20582
20666
  });
20583
20667
  const asideVisible = ref(false);
20584
20668
  const handleAsideVisible = (val) => {
@@ -20589,34 +20673,27 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
20589
20673
  if (sizeStore.isMobile.value || !asideSetShow.value) {
20590
20674
  asideVisible.value = !asideVisible.value;
20591
20675
  emitEvent("handleAsideVisible", asideVisible.value);
20676
+ } else {
20677
+ const { collapse, expand } = asideSize.value;
20678
+ asideDefaultWidth.value = asideDefaultWidth.value >= expand ? collapse : expand;
20679
+ emitEvent("handleAsideVisible", asideDefaultWidth.value >= expand);
20680
+ asideSetShowLittle.value = props.collapseMode || !(asideDefaultWidth.value >= expand);
20681
+ }
20682
+ };
20683
+ const initHomePageAside = () => {
20684
+ if (isHome.value) {
20685
+ asideVisible.value = false;
20686
+ asideDefaultWidth.value = 240;
20687
+ asideSetShowLittle.value = true;
20688
+ emitEvent("handleAsideVisible", asideVisible.value);
20592
20689
  }
20593
20690
  };
20691
+ initHomePageAside();
20594
20692
  const handleDrawerChannelChange = (item) => {
20595
20693
  var _a;
20596
20694
  handleAsideVisible(false);
20597
20695
  (_a = props.onChannelChange) == null ? void 0 : _a.call(props, item);
20598
20696
  };
20599
- async function handleDrawerLogoClick(e) {
20600
- if (props.independence) return;
20601
- if (e.metaKey || e.ctrlKey || e.shiftKey || e.button !== 0) return;
20602
- let href;
20603
- try {
20604
- href = router2.resolve({ name: "home" }).href;
20605
- } catch {
20606
- return;
20607
- }
20608
- e.preventDefault();
20609
- try {
20610
- const migrated = await isMigratedHref(href);
20611
- if (migrated) {
20612
- window.open(href, "_self");
20613
- } else {
20614
- router2.push({ name: "home" });
20615
- }
20616
- } catch {
20617
- router2.push({ name: "home" });
20618
- }
20619
- }
20620
20697
  onMounted(() => {
20621
20698
  addEventListener("toggleAsideMenuByHamburger", () => {
20622
20699
  handleClickMenu();
@@ -20628,22 +20705,26 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
20628
20705
  });
20629
20706
  return (_ctx, _cache) => {
20630
20707
  return props.singleCol ? (openBlock(), createBlock(AsideV2Content, mergeProps({ key: 0 }, props, {
20708
+ showThemeSetting: _ctx.showThemeSetting,
20709
+ showLangSetting: _ctx.showLangSetting,
20631
20710
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => emit("update:modelValue", $event)),
20632
20711
  "onUpdate:activeChannel": _cache[1] || (_cache[1] = ($event) => emit("update:activeChannel", $event)),
20633
20712
  onChannelChange: _cache[2] || (_cache[2] = ($event) => emit("channelChange", $event)),
20634
20713
  onSelect: _cache[3] || (_cache[3] = ($event) => emit("select", $event))
20635
- }), null, 16)) : asideSetShow.value ? (openBlock(), createElementBlock("div", {
20714
+ }), null, 16, ["showThemeSetting", "showLangSetting"])) : asideSetShow.value ? (openBlock(), createElementBlock("div", {
20636
20715
  key: 1,
20637
- class: "left-side-bar gitcode-aside-v2-container",
20716
+ class: normalizeClass(["left-side-bar gitcode-aside-v2-container", { oldWhite: asideSetShowLittleMode.value, higherZIndex: unref(SITE_STATUS).DISABLE }]),
20638
20717
  style: normalizeStyle({ width: mainMarginLeftWidth.value + "px", top: unref(headerHeight2) + "px" })
20639
20718
  }, [
20640
20719
  createVNode(AsideV2Content, mergeProps(props, {
20720
+ showThemeSetting: _ctx.showThemeSetting,
20721
+ showLangSetting: _ctx.showLangSetting,
20641
20722
  "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => emit("update:modelValue", $event)),
20642
20723
  "onUpdate:activeChannel": _cache[5] || (_cache[5] = ($event) => emit("update:activeChannel", $event)),
20643
20724
  onChannelChange: _cache[6] || (_cache[6] = ($event) => emit("channelChange", $event)),
20644
20725
  onSelect: _cache[7] || (_cache[7] = ($event) => emit("select", $event))
20645
- }), null, 16)
20646
- ], 4)) : (openBlock(), createBlock(unref(Drawer), {
20726
+ }), null, 16, ["showThemeSetting", "showLangSetting"])
20727
+ ], 6)) : (openBlock(), createBlock(unref(Drawer), {
20647
20728
  key: 2,
20648
20729
  modelValue: asideVisible.value,
20649
20730
  "onUpdate:modelValue": _cache[13] || (_cache[13] = ($event) => asideVisible.value = $event),
@@ -20670,12 +20751,14 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
20670
20751
  ]),
20671
20752
  createVNode(AsideV2Content, mergeProps(props, {
20672
20753
  "single-col": "",
20754
+ showThemeSetting: _ctx.showThemeSetting,
20755
+ showLangSetting: _ctx.showLangSetting,
20673
20756
  "on-channel-change": handleDrawerChannelChange,
20674
20757
  "onUpdate:modelValue": _cache[9] || (_cache[9] = ($event) => emit("update:modelValue", $event)),
20675
20758
  "onUpdate:activeChannel": _cache[10] || (_cache[10] = ($event) => emit("update:activeChannel", $event)),
20676
20759
  onChannelChange: _cache[11] || (_cache[11] = ($event) => emit("channelChange", $event)),
20677
20760
  onSelect: _cache[12] || (_cache[12] = ($event) => emit("select", $event))
20678
- }), null, 16)
20761
+ }), null, 16, ["showThemeSetting", "showLangSetting"])
20679
20762
  ]),
20680
20763
  _: 1
20681
20764
  }, 8, ["modelValue"]));
@@ -21511,7 +21594,9 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
21511
21594
  isLogin: isLogin.value,
21512
21595
  request: unref(proxyService),
21513
21596
  globalStore: globalStore.value,
21514
- independence: independence.value
21597
+ independence: independence.value,
21598
+ showLangSetting: "",
21599
+ showThemeSetting: ""
21515
21600
  }, null, 8, ["sceneValue", "userInfo", "isLogin", "request", "globalStore", "independence"])) : (openBlock(), createBlock(GitCodeAside, {
21516
21601
  key: 1,
21517
21602
  sceneValue: sceneSelected.value,
@@ -26201,7 +26286,7 @@ const _SlidCaptchaManager = class _SlidCaptchaManager {
26201
26286
  __publicField(_SlidCaptchaManager, "instance");
26202
26287
  let SlidCaptchaManager = _SlidCaptchaManager;
26203
26288
  const slidCaptchaManager = SlidCaptchaManager.getInstance();
26204
- const SlidCaptcha = defineAsyncComponent(() => import("./index-C52-QZeq.js"));
26289
+ const SlidCaptcha = defineAsyncComponent(() => import("./index-D2Wao1Fv.js"));
26205
26290
  const useSlidCaptcha = () => {
26206
26291
  const { mount, unMount, isMounted } = usePopup("slid-captcha-popup");
26207
26292
  const open = (config) => {
@@ -26231,7 +26316,7 @@ const useSlidCaptcha = () => {
26231
26316
  close
26232
26317
  };
26233
26318
  };
26234
- const YunpianCaptcha = defineAsyncComponent(() => import("./index-CgY7MDYx.js"));
26319
+ const YunpianCaptcha = defineAsyncComponent(() => import("./index-CwwSyL4G.js"));
26235
26320
  const useYunpianCaptcha = () => {
26236
26321
  const { mount, unMount } = usePopup("yunpian-captcha-popup");
26237
26322
  const open = (config) => {
@@ -8,7 +8,7 @@ import { Message } from "vue-devui-lal/message";
8
8
  import "vue-devui-lal/message/style.css";
9
9
  import { FixedOverlay } from "vue-devui-lal/overlay";
10
10
  import "vue-devui-lal/overlay/style.css";
11
- import { a as i18n, k as usePageResize, z as isZh, _ as _export_sfc } from "./index-Br1fy5_D.js";
11
+ import { a as i18n, k as usePageResize, z as isZh, _ as _export_sfc } from "./index-CdGNxKZI.js";
12
12
  const _YunpianCaptchaManager = class _YunpianCaptchaManager {
13
13
  // eslint-disable-next-line no-useless-constructor
14
14
  constructor() {
@@ -1,5 +1,5 @@
1
1
  import { defineComponent, onMounted, nextTick, onUnmounted, createBlock, openBlock, unref, withCtx, createElementVNode } from "vue";
2
- import { x as slidCaptchaManager, y as useLayoutConfig, z as isZh, _ as _export_sfc } from "./index-Br1fy5_D.js";
2
+ import { x as slidCaptchaManager, y as useLayoutConfig, z as isZh, _ as _export_sfc } from "./index-CdGNxKZI.js";
3
3
  import { FixedOverlay } from "vue-devui-lal/overlay";
4
4
  import "vue-devui-lal/overlay/style.css";
5
5
  const TARGET_TEXT = "Click in order:";
package/index.d.ts CHANGED
@@ -31,7 +31,7 @@ collapseMode: boolean;
31
31
  disableFlatMode: boolean;
32
32
  }, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
33
33
 
34
- declare const __VLS_component_2: DefineComponent<Props_3, {
34
+ declare const __VLS_component_2: DefineComponent<Props_4, {
35
35
  containerEl: Ref<HTMLElement | null, HTMLElement | null>;
36
36
  contentEl: Ref<HTMLElement | null, HTMLElement | null>;
37
37
  trackEl: Ref<HTMLDivElement | null, HTMLDivElement | null>;
@@ -39,7 +39,7 @@ trackEl: Ref<HTMLDivElement | null, HTMLDivElement | null>;
39
39
  mouseenter: (event: MouseEvent) => any;
40
40
  mouseleave: (event: MouseEvent) => any;
41
41
  scroll: (event: Event) => any;
42
- }, string, PublicProps, Readonly<Props_3> & Readonly<{
42
+ }, string, PublicProps, Readonly<Props_4> & Readonly<{
43
43
  onMouseenter?: ((event: MouseEvent) => any) | undefined;
44
44
  onMouseleave?: ((event: MouseEvent) => any) | undefined;
45
45
  onScroll?: ((event: Event) => any) | undefined;
@@ -347,24 +347,27 @@ declare type EventBus = {
347
347
 
348
348
  export declare const GitCodeAside: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
349
349
 
350
- export declare const GitCodeAsideV2: DefineComponent<GitCodeAsideV2Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
350
+ export declare const GitCodeAsideV2: DefineComponent<Props_3, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
351
351
  select: (item: HomeChannelStoreItem) => any;
352
352
  "update:modelValue": (val: string) => any;
353
353
  "update:activeChannel": (val: string) => any;
354
354
  channelChange: (item: HomeChannelStoreItem) => any;
355
- }, string, PublicProps, Readonly<GitCodeAsideV2Props> & Readonly<{
355
+ }, string, PublicProps, Readonly<Props_3> & Readonly<{
356
356
  onSelect?: ((item: HomeChannelStoreItem) => any) | undefined;
357
357
  "onUpdate:modelValue"?: ((val: string) => any) | undefined;
358
358
  "onUpdate:activeChannel"?: ((val: string) => any) | undefined;
359
359
  onChannelChange?: ((item: HomeChannelStoreItem) => any) | undefined;
360
360
  }>, {
361
361
  globalStore: Record<string, unknown>;
362
- isLogin: boolean;
363
362
  sceneValue: SceneValue;
364
363
  request: Function;
365
364
  modelValue: string;
366
365
  userInfo: AccountInfo;
367
366
  independence: boolean;
367
+ showThemeSetting: boolean;
368
+ showLangSetting: boolean;
369
+ collapseMode: boolean;
370
+ disableFlatMode: boolean;
368
371
  singleCol: boolean;
369
372
  channels: HomeChannelStoreItem[];
370
373
  activeChannel: string;
@@ -377,6 +380,8 @@ onChannelChange: (item: HomeChannelStoreItem) => void;
377
380
  declare interface GitCodeAsideV2Props {
378
381
  /** 场景值,默认为 home */
379
382
  sceneValue?: SceneValue;
383
+ /** 禁用 flat 模式 */
384
+ disableFlatMode?: boolean;
380
385
  /** 单列模式:移动端抽屉或紧凑容器内展示,不包含外层固定定位 */
381
386
  singleCol?: boolean;
382
387
  /** 外部传入的一级频道列表(若不传则组件内部请求接口获取) */
@@ -394,6 +399,10 @@ declare interface GitCodeAsideV2Props {
394
399
  globalStore?: Record<string, unknown>;
395
400
  /** 是否独立部署 */
396
401
  independence?: boolean;
402
+ /** 是否显示主题设置 */
403
+ showThemeSetting?: boolean;
404
+ /** 是否显示语言设置 */
405
+ showLangSetting?: boolean;
397
406
  /** 频道切换完成回调 */
398
407
  onChannelChange?: (item: HomeChannelStoreItem) => void;
399
408
  }
@@ -543,7 +552,15 @@ declare interface Props_2 {
543
552
  slotKeys?: Array<string>;
544
553
  }
545
554
 
546
- declare interface Props_3 {
555
+ declare interface Props_3 extends GitCodeAsideV2Props {
556
+ /** 是否显示主题设置 */
557
+ showThemeSetting?: boolean | undefined;
558
+ /** 是否显示语言设置 */
559
+ showLangSetting?: boolean | undefined;
560
+ collapseMode?: boolean;
561
+ }
562
+
563
+ declare interface Props_4 {
547
564
  /** 容器使用的 DOM 元素标签,默认为 'div' */
548
565
  tag?: string;
549
566
  /** 滚动停止后取消 isScrolling 状态的延迟时间 (毫秒),默认 300 */
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { $, Y, Q, U, W, a2, X, P, S, V, Z, O, B, a4, a1, a3, a0 } from "./index-Br1fy5_D.js";
1
+ import { $, Y, Q, U, W, a2, X, P, S, V, Z, O, B, a4, a1, a3, a0 } from "./index-CdGNxKZI.js";
2
2
  export {
3
3
  $ as AsideFooterTools,
4
4
  Y as EnterpriseHeader,
@@ -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, _ as _export_sfc } from "./index-Br1fy5_D.js";
2
+ import { i as isPhone, u as useModel, _ as _export_sfc } from "./index-CdGNxKZI.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.12.15-beta.17",
3
+ "version": "1.12.15-beta.19",
4
4
  "description": "用于 gitcode 站点生产环境使用",
5
5
  "main": "index.js",
6
6
  "types": "./index.d.ts",