vue-layout-gitcode 1.9.39 → 1.9.41

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-hid9J4d_.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-DmbFNzpN.js";
5
5
  import "lodash/debounce";
6
- import { u as useReportRepo, S as SearchRepoCard, f as formatNameSpace } from "./index-lESFtt1t.js";
7
- import "./transWebUrl-B0WSLQJn.js";
6
+ import { u as useReportRepo, S as SearchRepoCard, f as formatNameSpace } from "./index-DhA0x031.js";
7
+ import "./transWebUrl-BHRP7AYo.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, ref, computed, createBlock, openBlock, unref, withCtx, createElementVNode, normalizeClass, createElementBlock, createTextVNode, createCommentVNode, toDisplayString, renderSlot } from "vue";
2
- import { a as i18n, y as useLayoutConfig, z as ThemeType, A as currentTheme, L as LANG_ZH, B as LANG_EN, x as getLocaleLang, G as GIcon, C as emitEvent, D as isHttps, b as REPO_EVENT, _ as _export_sfc } from "./index-hid9J4d_.js";
2
+ import { a as i18n, y as useLayoutConfig, z as ThemeType, A as currentTheme, L as LANG_ZH, B as LANG_EN, x as getLocaleLang, G as GIcon, C as emitEvent, D as isHttps, b as REPO_EVENT, _ as _export_sfc } from "./index-DmbFNzpN.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, F as _sfc_main$1, H as loadAsideData, C as emitEvent, s as setLoginTriggerSource, f as useRequestReport, I as asideRequest, _ as _export_sfc } from "./index-hid9J4d_.js";
2
+ import { a as i18n, y as useLayoutConfig, G as GIcon, t as transformUrl, F as _sfc_main$1, H as loadAsideData, C as emitEvent, s as setLoginTriggerSource, f as useRequestReport, I as asideRequest, _ as _export_sfc } from "./index-DmbFNzpN.js";
3
3
  import { useRouter } from "vue-router";
4
- import { t as transWebUrl } from "./transWebUrl-B0WSLQJn.js";
4
+ import { t as transWebUrl } from "./transWebUrl-BHRP7AYo.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, G as GIcon, C as emitEvent, s as setLoginTriggerSource, f as useRequestReport, t as transformUrl, _ as _export_sfc } from "./index-hid9J4d_.js";
2
+ import { a as i18n, y as useLayoutConfig, G as GIcon, C as emitEvent, s as setLoginTriggerSource, f as useRequestReport, t as transformUrl, _ as _export_sfc } from "./index-DmbFNzpN.js";
3
3
  import { useRouter } from "vue-router";
4
- import { t as transWebUrl } from "./transWebUrl-B0WSLQJn.js";
4
+ import { t as transWebUrl } from "./transWebUrl-BHRP7AYo.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-hid9J4d_.js";
2
+ import { a as i18n, h as headRequest, G as GIcon, r as reqCatch } from "./index-DmbFNzpN.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-hid9J4d_.js";
2
+ import { a as i18n, G as GIcon, _ as _export_sfc } from "./index-DmbFNzpN.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-hid9J4d_.js";
2
+ import { G as GIcon, _ as _export_sfc } from "./index-DmbFNzpN.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, renderSlot, createBlock, createVNode, withCtx } from "vue";
2
- import { u as useReportRepo, S as SearchRepoCard } from "./index-lESFtt1t.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-hid9J4d_.js";
2
+ import { u as useReportRepo, S as SearchRepoCard } from "./index-DhA0x031.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-DmbFNzpN.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-hid9J4d_.js";
2
+ import { a as i18n, G as GIcon, _ as _export_sfc } from "./index-DmbFNzpN.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-hid9J4d_.js";
2
+ import { a as i18n, h as headRequest, G as GIcon, t as transformUrl } from "./index-DmbFNzpN.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]" };
@@ -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, x as getLocaleLang, L as LANG_ZH, _ as _export_sfc } from "./index-hid9J4d_.js";
11
+ import { a as i18n, k as usePageResize, x as getLocaleLang, L as LANG_ZH, _ as _export_sfc } from "./index-DmbFNzpN.js";
12
12
  const _YunpianCaptchaManager = class _YunpianCaptchaManager {
13
13
  constructor() {
14
14
  __publicField(this, "ypRiddlerInstance", null);
@@ -1,5 +1,5 @@
1
1
  import { defineComponent, onMounted, onUnmounted, createBlock, openBlock, unref, withCtx, createElementVNode } from "vue";
2
- import { x as getLocaleLang, L as LANG_ZH, y as useLayoutConfig, _ as _export_sfc } from "./index-hid9J4d_.js";
2
+ import { x as getLocaleLang, L as LANG_ZH, y as useLayoutConfig, _ as _export_sfc } from "./index-DmbFNzpN.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:";
@@ -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-hid9J4d_.js";
4
- import { t as transWebUrl } from "./transWebUrl-B0WSLQJn.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-DmbFNzpN.js";
4
+ import { t as transWebUrl } from "./transWebUrl-BHRP7AYo.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";
@@ -11070,6 +11070,132 @@ const proxyService = (params, customConfigs) => {
11070
11070
  );
11071
11071
  return service(params);
11072
11072
  };
11073
+ const transformUrl = (url) => {
11074
+ var _a;
11075
+ if (!url) return url;
11076
+ if (url.startsWith("/") && !url.startsWith("//")) return url;
11077
+ if (typeof window !== "undefined" && typeof location !== "undefined") {
11078
+ if (url == null ? void 0 : url.startsWith("https://cdn-")) {
11079
+ return url;
11080
+ }
11081
+ if (url == null ? void 0 : url.includes("myhuaweicloud.com")) {
11082
+ return url;
11083
+ }
11084
+ const host = (_a = location.host) == null ? void 0 : _a.replace(/^ai\./, "");
11085
+ if (host.includes("gitcode.host")) {
11086
+ return url == null ? void 0 : url.replace(/gitcode\.com/g, host);
11087
+ }
11088
+ if (url == null ? void 0 : url.includes("test.gitcode.net")) {
11089
+ return url == null ? void 0 : url.replace(/test\.gitcode\.net/g, host);
11090
+ }
11091
+ try {
11092
+ const urlObj = new URL(url);
11093
+ if (urlObj.host === host) {
11094
+ return url;
11095
+ }
11096
+ } catch (error) {
11097
+ console.error("transformUrl: URL 解析失败", error);
11098
+ }
11099
+ return transformUrlWithSpecialPrefix({ url, host });
11100
+ }
11101
+ return url;
11102
+ };
11103
+ const transformUrlWithSpecialPrefix = ({ url, host }) => {
11104
+ const specialPrefix = ["-tianqi", "-ai", "-news", "-competition"];
11105
+ const isTestEnv = /^(test|local)\./i.test(host);
11106
+ const isPreEnv = /^(pre|loc-pre)\./i.test(host);
11107
+ const isNonProdEnv = isTestEnv || isPreEnv;
11108
+ if (!isNonProdEnv) {
11109
+ return url == null ? void 0 : url.replace(/gitcode\.com/g, host);
11110
+ }
11111
+ if (specialPrefix.some((prefix) => url == null ? void 0 : url.includes(prefix))) {
11112
+ try {
11113
+ const urlObj = new URL(url);
11114
+ const urlHost = urlObj.host;
11115
+ const specialPrefixMatch = specialPrefix.find((prefix) => urlHost.includes(prefix));
11116
+ if (specialPrefixMatch) {
11117
+ const prefixPart = urlHost.split(".")[0];
11118
+ const mainDomain = host.replace(/^(test|pre|local|loc-pre)\./, "");
11119
+ urlObj.host = `${prefixPart}.${mainDomain}`;
11120
+ return urlObj.toString();
11121
+ }
11122
+ } catch (error) {
11123
+ return url == null ? void 0 : url.replace(/gitcode\.com/g, host);
11124
+ }
11125
+ }
11126
+ return url == null ? void 0 : url.replace(/gitcode\.com/g, host);
11127
+ };
11128
+ const transformNewsUrl = (url) => {
11129
+ if (url.startsWith("/") && !url.startsWith("//")) return url;
11130
+ if (url.includes("-news.")) return url;
11131
+ let transformedUrl = transformUrl(url);
11132
+ if (typeof window !== "undefined" && typeof location !== "undefined") {
11133
+ const host = location.host;
11134
+ const isGitcodeHost = host.includes("gitcode");
11135
+ if (host.includes("gitcode.host")) {
11136
+ try {
11137
+ const urlObj = new URL(url);
11138
+ const pathAndQuery = urlObj.pathname + urlObj.search + urlObj.hash;
11139
+ return `https://news.${host}${pathAndQuery}`;
11140
+ } catch (error) {
11141
+ return transformedUrl;
11142
+ }
11143
+ }
11144
+ let needAppendPath = false;
11145
+ if (host === "local.atomgit.com" || host === "local.gitcode.net" || transformedUrl.includes("news.local.")) {
11146
+ transformedUrl = isGitcodeHost ? "https://test-news.gitcode.net" : "https://test-news.atomgit.com";
11147
+ needAppendPath = true;
11148
+ } else if (transformedUrl.includes("news.test.")) {
11149
+ transformedUrl = isGitcodeHost ? "https://test-news.gitcode.net" : "https://test-news.atomgit.com";
11150
+ needAppendPath = true;
11151
+ } else if (transformedUrl.includes("news.pre.")) {
11152
+ transformedUrl = isGitcodeHost ? "https://pre-news.gitcode.com" : "https://pre-news.atomgit.com";
11153
+ needAppendPath = true;
11154
+ }
11155
+ if (needAppendPath) {
11156
+ try {
11157
+ const originalUrlObj = new URL(url);
11158
+ const pathAndQuery = originalUrlObj.pathname + originalUrlObj.search + originalUrlObj.hash;
11159
+ if (pathAndQuery && pathAndQuery !== "/") {
11160
+ transformedUrl = transformedUrl + pathAndQuery;
11161
+ }
11162
+ } catch (error) {
11163
+ console.error("transformNewsUrl: URL 解析失败", error);
11164
+ }
11165
+ }
11166
+ }
11167
+ return transformedUrl;
11168
+ };
11169
+ const replaceHost = ({ url, customHost }) => {
11170
+ if (!url || !customHost) return url;
11171
+ try {
11172
+ const urlObj = new URL(url);
11173
+ let pureHost = customHost;
11174
+ if (customHost.includes("://")) {
11175
+ const customUrlObj = new URL(customHost);
11176
+ pureHost = customUrlObj.host;
11177
+ }
11178
+ urlObj.host = pureHost;
11179
+ return urlObj.toString();
11180
+ } catch (error) {
11181
+ return url;
11182
+ }
11183
+ };
11184
+ const getCurrentLogoMap = () => {
11185
+ if (typeof window === "undefined" || typeof location === "undefined") {
11186
+ console.warn("[getCurrentLogoMap] 在 SSR 环境中被调用,返回默认配置");
11187
+ return LOGO_MAP.gitcode;
11188
+ }
11189
+ const siteType = location.host.includes("atomgit") ? "atomgit" : "gitcode";
11190
+ return LOGO_MAP[siteType];
11191
+ };
11192
+ const isGitCodeHost = () => {
11193
+ if (typeof window === "undefined" || typeof location === "undefined") return false;
11194
+ return location.hostname.includes("gitcode");
11195
+ };
11196
+ const currentHelpDocsUrl = () => isGitCodeHost() ? HELP_DOCS_URL_GITCODE : HELP_DOCS_URL_ATOMGIT;
11197
+ const currentHelpDocsAboutUsUrl = () => isGitCodeHost() ? HELP_DOCS_URL_GITCODE + "/docs/help/home/aboutus/" : HELP_DOCS_URL_ATOMGIT + "/docs/help/home/aboutus/";
11198
+ const currentHelpDocsAiCommunityUrl = () => isGitCodeHost() ? HELP_DOCS_URL_GITCODE + "/docs/help/home/ai-community/" : HELP_DOCS_URL_ATOMGIT + "/docs/help/home/ai-community/";
11073
11199
  const _hoisted_1$w = { class: "home-nav-right" };
11074
11200
  const _hoisted_2$m = { class: "home-nav-item" };
11075
11201
  const _hoisted_3$l = { class: "tooltip-sign" };
@@ -11177,7 +11303,8 @@ const _sfc_main$D = /* @__PURE__ */ defineComponent({
11177
11303
  emits("toggle-growth-center");
11178
11304
  };
11179
11305
  const handleInvite = () => {
11180
- window.open("https://gitcode.com/setting/points?type=invite", "_blank");
11306
+ const link = transformUrl("https://gitcode.com/setting/points?type=invite");
11307
+ window.open(link, "_blank");
11181
11308
  };
11182
11309
  const showDesk = () => {
11183
11310
  if (window.ud) {
@@ -12412,132 +12539,6 @@ if (isBrowser) {
12412
12539
  }
12413
12540
  const sessionStorage$1 = sessionStorage;
12414
12541
  const _imports_0 = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAA4CAYAAACohjseAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAmsSURBVHgB7VpdbxxnFT7nfccmRam6/gXZXIBy1y3qRe8YR6kUoUpdbhACJNtShFJUSCyBBFd2I1ClAoklVAE32BYXRAJqIwEyUOrNL4h70dtm+wvqNG7deGbe03PO+7Gzlr27/kpzsSeazO5kZvZ95jnnOR8TgLGNbWxjG9vYDjWEp8zyNjUg22lBiS1TuOeNo5YFbBgyTUMAFgz4PXYnDEzf3XimO+h+GTwFls9S43G5O2NLaLtqp2VKaJiSCB0yGEQEJAHFIMkwKXxMjl8AopwvXxl07y8V4EvXdnMo3cye+6xtK3jOVISmYCAlb/KZgTBT4Pd8TD+TfGegiApyiH0pAF+6vpvzOhegoNxUvNiSwZS88II32VcAniVhTIAya6AgeS9/AK0AFXKH2BMFmN+kxqfF4wVXwA0snQdUgQcXtwoFgLJk/T6xqG7Kx2w4xi5Mw37ziQF88fXd/NHe58scZxfYBdGzBQkYFkxVpSBQAXkXZJC8CYMUXTQCxZEU0sATsG/c+PwOL3/TVnhBY0v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GsQyzNbeMdSczuwVnDfD//3x2+vxXqqmswhdSJ06hM+BRAlRm8wdXuOvYZ3/qTK78sZNNy1CWF7uqOU3Z8e6X1DMd90OkkOxD/JmRBkonAigmM0t+yg27r8XxsQVNbjs2Zy/vLV87AKgMZTNrHphepRJryyQq3j1DUpcyLdNOovvjpdNR0KEAxfg3W2mkUJuraCog7Q1moMLNH+buw+t5P1BTYybLVDUpxCKpm6ZeT87V7kEGSieuXo4EkJ/zq71SLPV2aHsvJH1sAl3k5JD33TxUK6FhpSyopWctdQuh7lT3nH/t9mjTslFtaKKX/+Vgomv29pReK8euHczK2x1c7Lv5pNOXzCE1qFJpM5tRck3f97FqUjn/o99Mnpq4jASwnX/cCFVJlxN6B8m9n7lJjo9ShrGbCSgquLn91xumS1XReLc0me/5bOr54GNm+dbrS2YJzsgGAlzvTG2323Txr+v9b3Gu57vgaBJC4bx6EDi9eVZ9pNWo1pYI/eCwU1mc+8nSyevNQXbsfvC13K2xi24fBk5scZYaWUUfcgxOxZqT43Cbg3d+/nenG2uH2Zn/T6e3ZvdarCJrIjA8w181k9nS/NLw93pjG9vYxja2p8G+ADz7MtW/3lU1AAAAAElFTkSuQmCC";
12415
- const transformUrl = (url) => {
12416
- var _a;
12417
- if (!url) return url;
12418
- if (url.startsWith("/") && !url.startsWith("//")) return url;
12419
- if (typeof window !== "undefined" && typeof location !== "undefined") {
12420
- if (url == null ? void 0 : url.startsWith("https://cdn-")) {
12421
- return url;
12422
- }
12423
- if (url == null ? void 0 : url.includes("myhuaweicloud.com")) {
12424
- return url;
12425
- }
12426
- const host = (_a = location.host) == null ? void 0 : _a.replace(/^ai\./, "");
12427
- if (host.includes("gitcode.host")) {
12428
- return url == null ? void 0 : url.replace(/gitcode\.com/g, host);
12429
- }
12430
- if (url == null ? void 0 : url.includes("test.gitcode.net")) {
12431
- return url == null ? void 0 : url.replace(/test\.gitcode\.net/g, host);
12432
- }
12433
- try {
12434
- const urlObj = new URL(url);
12435
- if (urlObj.host === host) {
12436
- return url;
12437
- }
12438
- } catch (error) {
12439
- console.error("transformUrl: URL 解析失败", error);
12440
- }
12441
- return transformUrlWithSpecialPrefix({ url, host });
12442
- }
12443
- return url;
12444
- };
12445
- const transformUrlWithSpecialPrefix = ({ url, host }) => {
12446
- const specialPrefix = ["-tianqi", "-ai", "-news", "-competition"];
12447
- const isTestEnv = /^(test|local)\./i.test(host);
12448
- const isPreEnv = /^(pre|loc-pre)\./i.test(host);
12449
- const isNonProdEnv = isTestEnv || isPreEnv;
12450
- if (!isNonProdEnv) {
12451
- return url == null ? void 0 : url.replace(/gitcode\.com/g, host);
12452
- }
12453
- if (specialPrefix.some((prefix) => url == null ? void 0 : url.includes(prefix))) {
12454
- try {
12455
- const urlObj = new URL(url);
12456
- const urlHost = urlObj.host;
12457
- const specialPrefixMatch = specialPrefix.find((prefix) => urlHost.includes(prefix));
12458
- if (specialPrefixMatch) {
12459
- const prefixPart = urlHost.split(".")[0];
12460
- const mainDomain = host.replace(/^(test|pre|local|loc-pre)\./, "");
12461
- urlObj.host = `${prefixPart}.${mainDomain}`;
12462
- return urlObj.toString();
12463
- }
12464
- } catch (error) {
12465
- return url == null ? void 0 : url.replace(/gitcode\.com/g, host);
12466
- }
12467
- }
12468
- return url == null ? void 0 : url.replace(/gitcode\.com/g, host);
12469
- };
12470
- const transformNewsUrl = (url) => {
12471
- if (url.startsWith("/") && !url.startsWith("//")) return url;
12472
- if (url.includes("-news.")) return url;
12473
- let transformedUrl = transformUrl(url);
12474
- if (typeof window !== "undefined" && typeof location !== "undefined") {
12475
- const host = location.host;
12476
- const isGitcodeHost = host.includes("gitcode");
12477
- if (host.includes("gitcode.host")) {
12478
- try {
12479
- const urlObj = new URL(url);
12480
- const pathAndQuery = urlObj.pathname + urlObj.search + urlObj.hash;
12481
- return `https://news.${host}${pathAndQuery}`;
12482
- } catch (error) {
12483
- return transformedUrl;
12484
- }
12485
- }
12486
- let needAppendPath = false;
12487
- if (host === "local.atomgit.com" || host === "local.gitcode.net" || transformedUrl.includes("news.local.")) {
12488
- transformedUrl = isGitcodeHost ? "https://test-news.gitcode.net" : "https://test-news.atomgit.com";
12489
- needAppendPath = true;
12490
- } else if (transformedUrl.includes("news.test.")) {
12491
- transformedUrl = isGitcodeHost ? "https://test-news.gitcode.net" : "https://test-news.atomgit.com";
12492
- needAppendPath = true;
12493
- } else if (transformedUrl.includes("news.pre.")) {
12494
- transformedUrl = isGitcodeHost ? "https://pre-news.gitcode.com" : "https://pre-news.atomgit.com";
12495
- needAppendPath = true;
12496
- }
12497
- if (needAppendPath) {
12498
- try {
12499
- const originalUrlObj = new URL(url);
12500
- const pathAndQuery = originalUrlObj.pathname + originalUrlObj.search + originalUrlObj.hash;
12501
- if (pathAndQuery && pathAndQuery !== "/") {
12502
- transformedUrl = transformedUrl + pathAndQuery;
12503
- }
12504
- } catch (error) {
12505
- console.error("transformNewsUrl: URL 解析失败", error);
12506
- }
12507
- }
12508
- }
12509
- return transformedUrl;
12510
- };
12511
- const replaceHost = ({ url, customHost }) => {
12512
- if (!url || !customHost) return url;
12513
- try {
12514
- const urlObj = new URL(url);
12515
- let pureHost = customHost;
12516
- if (customHost.includes("://")) {
12517
- const customUrlObj = new URL(customHost);
12518
- pureHost = customUrlObj.host;
12519
- }
12520
- urlObj.host = pureHost;
12521
- return urlObj.toString();
12522
- } catch (error) {
12523
- return url;
12524
- }
12525
- };
12526
- const getCurrentLogoMap = () => {
12527
- if (typeof window === "undefined" || typeof location === "undefined") {
12528
- console.warn("[getCurrentLogoMap] 在 SSR 环境中被调用,返回默认配置");
12529
- return LOGO_MAP.gitcode;
12530
- }
12531
- const siteType = location.host.includes("atomgit") ? "atomgit" : "gitcode";
12532
- return LOGO_MAP[siteType];
12533
- };
12534
- const isGitCodeHost = () => {
12535
- if (typeof window === "undefined" || typeof location === "undefined") return false;
12536
- return location.hostname.includes("gitcode");
12537
- };
12538
- const currentHelpDocsUrl = () => isGitCodeHost() ? HELP_DOCS_URL_GITCODE : HELP_DOCS_URL_ATOMGIT;
12539
- const currentHelpDocsAboutUsUrl = () => isGitCodeHost() ? HELP_DOCS_URL_GITCODE + "/docs/help/home/aboutus/" : HELP_DOCS_URL_ATOMGIT + "/docs/help/home/aboutus/";
12540
- const currentHelpDocsAiCommunityUrl = () => isGitCodeHost() ? HELP_DOCS_URL_GITCODE + "/docs/help/home/ai-community/" : HELP_DOCS_URL_ATOMGIT + "/docs/help/home/ai-community/";
12541
12542
  const _sfc_main$B = /* @__PURE__ */ defineComponent({
12542
12543
  ...{
12543
12544
  name: "GAvatar"
@@ -17216,13 +17217,13 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
17216
17217
  var _a;
17217
17218
  const layoutConfig2 = useLayoutConfig();
17218
17219
  const { t: $t } = i18n.global;
17219
- const ProjectSearch = defineAsyncComponent(() => import("./ProjectSearch-BxNKmoRm.js"));
17220
- const UserSearch = defineAsyncComponent(() => import("./UserSearch-RYPUU_oM.js"));
17221
- const GloabarSearch = defineAsyncComponent(() => import("./GloabarSearch-BR1xWK3V.js"));
17222
- const SearchHistoryList = defineAsyncComponent(() => import("./SearchHistoryList-BmGFZFLu.js"));
17223
- const SearchScopeList = defineAsyncComponent(() => import("./SearchScopeList-DCOUVKdB.js"));
17224
- const SearchPrefixTag = defineAsyncComponent(() => import("./SearchPrefixTag-BuX-_b30.js"));
17225
- const SearchRecommed = defineAsyncComponent(() => import("./SearchRecommed-CiJVc_Cy.js"));
17220
+ const ProjectSearch = defineAsyncComponent(() => import("./ProjectSearch-C2PbyRQF.js"));
17221
+ const UserSearch = defineAsyncComponent(() => import("./UserSearch-CTGP9z_W.js"));
17222
+ const GloabarSearch = defineAsyncComponent(() => import("./GloabarSearch-znQCeisB.js"));
17223
+ const SearchHistoryList = defineAsyncComponent(() => import("./SearchHistoryList-_M-0XEZJ.js"));
17224
+ const SearchScopeList = defineAsyncComponent(() => import("./SearchScopeList-CHSuNob5.js"));
17225
+ const SearchPrefixTag = defineAsyncComponent(() => import("./SearchPrefixTag-TLHlJsPk.js"));
17226
+ const SearchRecommed = defineAsyncComponent(() => import("./SearchRecommed-9zEgW3dQ.js"));
17226
17227
  const props = __props;
17227
17228
  const repoInfo = inject("repoInfo");
17228
17229
  const orgInfo = inject("orgInfo");
@@ -17879,13 +17880,9 @@ const announcementLeft = "0";
17879
17880
  const _sfc_main$o = /* @__PURE__ */ defineComponent({
17880
17881
  ...{ name: "SiteAnnouncement" },
17881
17882
  __name: "SiteAnnouncement",
17882
- props: {
17883
- asideCollapseMode: { type: Boolean, default: false }
17884
- },
17885
17883
  setup(__props) {
17886
17884
  const { t: t2 } = i18n.global;
17887
17885
  const isShow = ref(SITE_STATUS.DISABLE);
17888
- const asideShow = ref(true);
17889
17886
  const handleClose = (type) => {
17890
17887
  isShow.value = false;
17891
17888
  {
@@ -17897,12 +17894,7 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
17897
17894
  const migrationAnnounceUrl = computed(() => {
17898
17895
  return window.location.hostname.includes("gitcode") ? "https://gitcode.com/gitcode" : "https://atomgit.com/gitcode";
17899
17896
  });
17900
- addEventListener("handleAsideVisible", (value) => {
17901
- asideShow.value = value;
17902
- });
17903
- onMounted(() => {
17904
- const asideDefaultWidth = Number(localStorage$2.getItem("asideDefaultWidth") || 0);
17905
- asideShow.value = asideDefaultWidth > 0;
17897
+ const initShowStatus = () => {
17906
17898
  if (!SITE_STATUS.DISABLE) {
17907
17899
  isShow.value = false;
17908
17900
  return;
@@ -17921,9 +17913,9 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
17921
17913
  isShow.value = false;
17922
17914
  }
17923
17915
  }
17924
- });
17925
- onBeforeUnmount(() => {
17926
- offEvent("handleAsideVisible");
17916
+ };
17917
+ onMounted(() => {
17918
+ initShowStatus();
17927
17919
  });
17928
17920
  return (_ctx, _cache) => {
17929
17921
  return isShow.value ? (openBlock(), createElementBlock("div", {
@@ -17963,7 +17955,7 @@ const autoAvokeLogin = ({ isLogin, loginFunc, openHarmonyGuide, loginSuccess, lo
17963
17955
  loginFunc({ type: "login", triggerType: "", loginTriggerSource: "router_login_auth", ...loginFuncOpts }, loginSuccess, openHarmonyGuide);
17964
17956
  }
17965
17957
  };
17966
- const NoticeModal = defineAsyncComponent(() => import("./notice-N3HPlAbG.js"));
17958
+ const NoticeModal = defineAsyncComponent(() => import("./notice-BzHgFXx5.js"));
17967
17959
  function clearNotice() {
17968
17960
  if (localStorage$2.getItem("validator_email")) {
17969
17961
  localStorage$2.removeItem("validator_email");
@@ -18030,7 +18022,6 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
18030
18022
  independence: { type: Boolean, default: true },
18031
18023
  userMenus: {},
18032
18024
  loginChildComponents: {},
18033
- asideCollapseMode: { type: Boolean, default: false },
18034
18025
  bgConfig: { default: () => ({
18035
18026
  index_head: "",
18036
18027
  detail_top: "",
@@ -18411,7 +18402,7 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
18411
18402
  ], 4)), [
18412
18403
  [unref(vElementExposure), { trigger: (type) => handleStickyNoticeExpo() }]
18413
18404
  ]) : createCommentVNode("", true),
18414
- createVNode(SiteAnnouncement, { asideCollapseMode: _ctx.asideCollapseMode }, null, 8, ["asideCollapseMode"]),
18405
+ createVNode(SiteAnnouncement),
18415
18406
  withDirectives((openBlock(), createElementBlock("div", {
18416
18407
  class: "g-toolbar w-full overflow-hidden allow-click-stop",
18417
18408
  onClick: withModifiers(handleToolbarClick, ["stop"])
@@ -18766,9 +18757,9 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
18766
18757
  const layoutConfig2 = useLayoutConfig();
18767
18758
  const { t: t2 } = i18n.global;
18768
18759
  const route = useRoute();
18769
- const MenuItem = defineAsyncComponent(() => import("./MenuItem-CJpgYqu-.js"));
18770
- const ProjectMenuListV2 = defineAsyncComponent(() => import("./ProjectMenuListV2-llIsa9x2.js"));
18771
- const ProjectMenuList = defineAsyncComponent(() => import("./ProjectMenuList-DwnKUmou.js"));
18760
+ const MenuItem = defineAsyncComponent(() => import("./MenuItem-Dxs9PGzd.js"));
18761
+ const ProjectMenuListV2 = defineAsyncComponent(() => import("./ProjectMenuListV2-C5nnEThN.js"));
18762
+ const ProjectMenuList = defineAsyncComponent(() => import("./ProjectMenuList-D9QE85hq.js"));
18772
18763
  const props = __props;
18773
18764
  console.log("slotKeys", props.slotKeys);
18774
18765
  console.log("props", props);
@@ -24613,7 +24604,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
24613
24604
  }
24614
24605
  });
24615
24606
  const MFA = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-vue-layout-gitcode"]]);
24616
- const SlidCaptcha = defineAsyncComponent(() => import("./index-rzsB-DJF.js"));
24607
+ const SlidCaptcha = defineAsyncComponent(() => import("./index-CdEPRuSl.js"));
24617
24608
  const useSlidCaptcha = () => {
24618
24609
  const { mount, unMount } = usePopup("slid-captcha-popup");
24619
24610
  const open = (config) => {
@@ -24632,7 +24623,7 @@ const useSlidCaptcha = () => {
24632
24623
  close: unMount
24633
24624
  };
24634
24625
  };
24635
- const YunpianCaptcha = defineAsyncComponent(() => import("./index-tHbeAZYq.js"));
24626
+ const YunpianCaptcha = defineAsyncComponent(() => import("./index-BDgAr0hd.js"));
24636
24627
  const useYunpianCaptcha = () => {
24637
24628
  const { mount, unMount } = usePopup("yunpian-captcha-popup");
24638
24629
  const open = (config) => {
@@ -26659,14 +26650,15 @@ export {
26659
26650
  LANG_ZH as L,
26660
26651
  GitCodeAside as M,
26661
26652
  GitCodeHeader as N,
26662
- useLogin as O,
26663
- setLayoutConfig as P,
26664
- GitCodeLayoutEmitter as Q,
26653
+ SiteAnnouncement as O,
26654
+ useLogin as P,
26655
+ setLayoutConfig as Q,
26665
26656
  REPO_MODULE as R,
26666
26657
  SceneValue as S,
26667
26658
  TOPIC_TYPE as T,
26668
- setTheme as U,
26669
- index as V,
26659
+ GitCodeLayoutEmitter as U,
26660
+ setTheme as V,
26661
+ index as W,
26670
26662
  _export_sfc as _,
26671
26663
  i18n as a,
26672
26664
  REPO_EVENT as b,
package/index.d.ts CHANGED
@@ -313,11 +313,6 @@ export declare const GitCodeHeader: DefineComponent<ExtractPropTypes<{
313
313
  type: PropType<any>;
314
314
  required: true;
315
315
  };
316
- asideCollapseMode: {
317
- type: PropType<boolean | undefined>;
318
- required: false;
319
- default: boolean;
320
- };
321
316
  bgConfig: {
322
317
  type: PropType<{
323
318
  index_head: string;
@@ -431,11 +426,6 @@ export declare const GitCodeHeader: DefineComponent<ExtractPropTypes<{
431
426
  type: PropType<any>;
432
427
  required: true;
433
428
  };
434
- asideCollapseMode: {
435
- type: PropType<boolean | undefined>;
436
- required: false;
437
- default: boolean;
438
- };
439
429
  bgConfig: {
440
430
  type: PropType<{
441
431
  index_head: string;
@@ -474,7 +464,6 @@ export declare const GitCodeHeader: DefineComponent<ExtractPropTypes<{
474
464
  orgInfo: OrgInfo | undefined;
475
465
  otherUserInfo: UserInfo | undefined;
476
466
  headerBorder: boolean | undefined;
477
- asideCollapseMode: boolean | undefined;
478
467
  bgConfig: {
479
468
  index_head: string;
480
469
  detail_top: string;
@@ -604,6 +593,8 @@ export declare function setLayoutConfig(customConfig: BaseLayoutConfig): void;
604
593
 
605
594
  export { setTheme }
606
595
 
596
+ export declare const SiteAnnouncement: DefineComponent<{}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
597
+
607
598
  export declare const ToolsFloat: DefineComponent<ExtractPropTypes<{
608
599
  sceneValue: {
609
600
  type: PropType<SceneValue>;
package/index.js CHANGED
@@ -1,14 +1,15 @@
1
- import { M, N, Q, K, S, J, A, V, P, U, O } from "./index-hid9J4d_.js";
1
+ import { M, N, U, K, S, O, J, A, W, Q, V, P } from "./index-DmbFNzpN.js";
2
2
  export {
3
3
  M as GitCodeAside,
4
4
  N as GitCodeHeader,
5
- Q as GitCodeLayoutEmitter,
5
+ U as GitCodeLayoutEmitter,
6
6
  K as Login,
7
7
  S as SceneValue,
8
+ O as SiteAnnouncement,
8
9
  J as ToolsFloat,
9
10
  A as currentTheme,
10
- V as default,
11
- P as setLayoutConfig,
12
- U as setTheme,
13
- O as useLogin
11
+ W as default,
12
+ Q as setLayoutConfig,
13
+ V as setTheme,
14
+ P as useLogin
14
15
  };
@@ -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-hid9J4d_.js";
2
+ import { i as isPhone, u as useModel } from "./index-DmbFNzpN.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.9.39",
3
+ "version": "1.9.41",
4
4
  "description": "用于 gitcode 站点生产环境使用",
5
5
  "main": "index.js",
6
6
  "types": "./index.d.ts",
@@ -1,4 +1,4 @@
1
- import { y as useLayoutConfig } from "./index-hid9J4d_.js";
1
+ import { y as useLayoutConfig } from "./index-DmbFNzpN.js";
2
2
  const layoutConfig = useLayoutConfig();
3
3
  const transWebUrl = (url, params) => {
4
4
  if (!url) return url;