@alauda/doom 2.3.1 → 2.4.0
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.
- package/lib/cli/translate.js +1 -1
- package/lib/plugins/global/index.js +20 -5
- package/lib/products/index.d.ts +15 -0
- package/lib/products/index.js +25 -0
- package/lib/runtime/components/ExternalSiteLink.js +3 -2
- package/lib/runtime/hooks/useSiteOverrides.js +2 -5
- package/lib/runtime/hooks/useTranslation.d.ts +1 -1
- package/lib/runtime/translation.d.ts +12 -0
- package/lib/runtime/translation.js +9 -0
- package/lib/shared/context.d.ts +5 -0
- package/lib/shared/context.js +2 -0
- package/lib/theme/Breadcrumb/index.d.ts +6 -0
- package/lib/theme/Breadcrumb/index.js +85 -0
- package/lib/theme/Layout.js +6 -3
- package/lib/theme/_X.d.ts +23 -0
- package/lib/theme/_X.js +2 -0
- package/package.json +1 -1
- package/styles/_mixins.scss +19 -0
- package/styles/breadcrumb.scss +42 -0
- package/styles/global.scss +1 -0
- package/styles/login.module.scss +3 -12
- package/styles/products.module.scss +45 -0
package/lib/cli/translate.js
CHANGED
|
@@ -173,7 +173,7 @@ export const translate = async ({ source, sourceContent, target, systemPrompt, u
|
|
|
173
173
|
sourceLang,
|
|
174
174
|
targetLang,
|
|
175
175
|
userPrompt,
|
|
176
|
-
additionalPrompts
|
|
176
|
+
additionalPrompts,
|
|
177
177
|
terms,
|
|
178
178
|
titleTranslationPrompt,
|
|
179
179
|
}, { async: true });
|
|
@@ -41,9 +41,11 @@ export const globalPlugin = ({ version, download, }) => {
|
|
|
41
41
|
},
|
|
42
42
|
addPages(config) {
|
|
43
43
|
let loginPath;
|
|
44
|
+
let productsPath;
|
|
44
45
|
for (const ext of ['.js', '.tsx']) {
|
|
45
46
|
loginPath = baseResolve(`login/index${ext}`);
|
|
46
|
-
|
|
47
|
+
productsPath = baseResolve(`products/index${ext}`);
|
|
48
|
+
if (fs.existsSync(loginPath) && fs.existsSync(productsPath)) {
|
|
47
49
|
break;
|
|
48
50
|
}
|
|
49
51
|
}
|
|
@@ -53,13 +55,26 @@ export const globalPlugin = ({ version, download, }) => {
|
|
|
53
55
|
routePath: '/login',
|
|
54
56
|
filepath: loginPath,
|
|
55
57
|
},
|
|
58
|
+
{
|
|
59
|
+
routePath: '/products',
|
|
60
|
+
filepath: productsPath,
|
|
61
|
+
},
|
|
56
62
|
];
|
|
57
63
|
}
|
|
58
64
|
const lang = config.lang;
|
|
59
|
-
return config.themeConfig.locales.
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
65
|
+
return config.themeConfig.locales.flatMap((l) => {
|
|
66
|
+
const prefix = l.lang && l.lang !== lang ? `/${l.lang}` : '';
|
|
67
|
+
return [
|
|
68
|
+
{
|
|
69
|
+
routePath: `${prefix}/login`,
|
|
70
|
+
filepath: loginPath,
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
routePath: `${prefix}/products`,
|
|
74
|
+
filepath: productsPath,
|
|
75
|
+
},
|
|
76
|
+
];
|
|
77
|
+
});
|
|
63
78
|
},
|
|
64
79
|
};
|
|
65
80
|
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export interface BuildInfoItem {
|
|
2
|
+
base: string;
|
|
3
|
+
version: string;
|
|
4
|
+
displayName?: {
|
|
5
|
+
en: string;
|
|
6
|
+
zh?: string;
|
|
7
|
+
ru?: string;
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
export interface BuildInfoGroup {
|
|
11
|
+
id: string;
|
|
12
|
+
items: BuildInfoItem[];
|
|
13
|
+
}
|
|
14
|
+
declare const _default: () => import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export default _default;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { addLeadingSlash, NoSSR, useSite } from '@rspress/core/runtime';
|
|
3
|
+
import virtual from 'doom-@global-virtual';
|
|
4
|
+
import { use } from 'react';
|
|
5
|
+
import { BuildInfoContext } from "../shared/context.js";
|
|
6
|
+
import { isUnversioned } from '../shared/helpers.js';
|
|
7
|
+
import { useIsPrint, useLang, useTranslation } from '@alauda/doom/runtime';
|
|
8
|
+
import classes from '@alauda/doom/styles/products.module.scss';
|
|
9
|
+
const Products = () => {
|
|
10
|
+
const lang = useLang();
|
|
11
|
+
const isPrint = useIsPrint();
|
|
12
|
+
const { site } = useSite();
|
|
13
|
+
const { groups: buildInfoGroups } = use(BuildInfoContext);
|
|
14
|
+
return (_jsx("div", { className: classes.container, children: buildInfoGroups.map((group) => (_jsxs("div", { className: classes.group, children: [_jsx("h2", { children: group.id.toUpperCase() }), _jsx("ul", { children: group.items.map((item) => (_jsx("li", { children: _jsx("a", { className: "rp-link", href: (isPrint ? 'https://docs.alauda.io' : '') +
|
|
15
|
+
(virtual.prefix || '') +
|
|
16
|
+
addLeadingSlash(item.base) +
|
|
17
|
+
(isUnversioned(virtual.version) ? '' : `/${item.version}`) +
|
|
18
|
+
(lang !== site.lang ? addLeadingSlash(lang) : ''), target: "_blank", rel: "noopener noreferrer", children: item.displayName?.[lang] ||
|
|
19
|
+
item.displayName?.en ||
|
|
20
|
+
item.base }) }, item.base))) })] }, group.id))) }));
|
|
21
|
+
};
|
|
22
|
+
export default () => {
|
|
23
|
+
const t = useTranslation();
|
|
24
|
+
return (_jsxs(_Fragment, { children: [_jsx("h1", { children: t('all_product_documentation') }), _jsx("p", { children: t('explore_doc_all_products') }), _jsx(NoSSR, { children: _jsx(Products, {}) })] }));
|
|
25
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { useSite } from '@rspress/core/runtime';
|
|
3
3
|
import { addTrailingSlash, isExternalUrl, normalizeHref, parseUrl, removeLeadingSlash, } from '@rspress/shared';
|
|
4
4
|
import { DEFAULT_PAGE_EXTENSIONS } from '@rspress/shared/constants';
|
|
5
5
|
import { clsx } from 'clsx';
|
|
@@ -7,6 +7,7 @@ import virtual from 'doom-@global-virtual';
|
|
|
7
7
|
import { useMemo } from 'react';
|
|
8
8
|
import { isUnversioned } from '../../shared/helpers.js';
|
|
9
9
|
import { useIsPrint } from '../hooks/index.js';
|
|
10
|
+
import { useLang } from '@alauda/doom/runtime';
|
|
10
11
|
const ExternalSiteLink_ = ({ name, href = '', className, ...props }) => {
|
|
11
12
|
const isPrint = useIsPrint();
|
|
12
13
|
const { site: siteData } = useSite();
|
|
@@ -31,7 +32,7 @@ const ExternalSiteLink_ = ({ name, href = '', className, ...props }) => {
|
|
|
31
32
|
(isUnversioned(virtual.version)
|
|
32
33
|
? site.base
|
|
33
34
|
: addTrailingSlash(site.base + site.version)) +
|
|
34
|
-
(lang
|
|
35
|
+
(lang !== siteData.lang ? addTrailingSlash(lang) : '') +
|
|
35
36
|
(hash ? `${url}#${hash}` : url), target: "_blank", rel: "noopener noreferrer", className: clsx('rp-link', className), ...props }));
|
|
36
37
|
};
|
|
37
38
|
export const ExternalSiteLink = (props) => (_jsx(ExternalSiteLink_, { ...props }));
|
|
@@ -2,6 +2,7 @@ import { isProduction, withBase } from '@rspress/core/runtime';
|
|
|
2
2
|
import virtual from 'doom-@global-virtual';
|
|
3
3
|
import { merge } from 'es-toolkit/compat';
|
|
4
4
|
import { useEffect, useMemo, useState } from 'react';
|
|
5
|
+
import { xfetch } from 'x-fetch';
|
|
5
6
|
import { parse } from 'yaml';
|
|
6
7
|
import { isUnversioned } from '../../shared/index.js';
|
|
7
8
|
import { namedTerms } from '../../terms.js';
|
|
@@ -35,12 +36,8 @@ const fetchSiteOverrides = async (version, acpSite) => {
|
|
|
35
36
|
if (!url) {
|
|
36
37
|
return;
|
|
37
38
|
}
|
|
38
|
-
const res = await fetch(url);
|
|
39
|
-
if (!res.ok) {
|
|
40
|
-
return;
|
|
41
|
-
}
|
|
42
39
|
try {
|
|
43
|
-
return parse(await
|
|
40
|
+
return parse(await xfetch(url, { type: 'text' }));
|
|
44
41
|
}
|
|
45
42
|
catch {
|
|
46
43
|
//
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { Language } from '../../shared/index.js';
|
|
2
2
|
export declare const useLang: () => Language;
|
|
3
|
-
export declare const useTranslation: () => (key: "function" | "name" | "description" | "delete" | "toc" | "create" | "update" | "password" | "close" | "collapse_all" | "expand_all" | "crd_no_schema" | "action" | "view" | "chinese" | "english" | "chinese_bad_cases" | "english_bad_cases" | "download_pdf" | "view_docs_as_pdf" | "ai_assistant" | "exclamation" | "semicolon" | "period" | "colon" | "user_login" | "user_login_tip1" | "user_login_tip2" | "customer_portal_global" | "customer_portal_china" | "account_id" | "username" | "captcha" | "login" | "current_field" | "field_required" | "ERR_INTERNET_DISCONNECTED" | "AccountDisabledError" | "CaptchaError" | "LoginError" | "NetworkError" | "TenantError" | "TenantNotFoundError" | "logout" | "hi_there" | "ai_assistant_tip" | "ai_assistant_placeholder" | "max_chars_exceeded_tip" | "thinking" | "thinking_process" | "referenced_doc_links" | "view_more_related_docs" | "view_less_related_docs" | "new_chat" | "show_more" | "show_less") => string;
|
|
3
|
+
export declare const useTranslation: () => (key: "function" | "name" | "description" | "delete" | "toc" | "create" | "update" | "password" | "close" | "collapse_all" | "expand_all" | "crd_no_schema" | "action" | "view" | "chinese" | "english" | "chinese_bad_cases" | "english_bad_cases" | "download_pdf" | "view_docs_as_pdf" | "ai_assistant" | "exclamation" | "semicolon" | "period" | "colon" | "user_login" | "user_login_tip1" | "user_login_tip2" | "customer_portal_global" | "customer_portal_china" | "account_id" | "username" | "captcha" | "login" | "current_field" | "field_required" | "ERR_INTERNET_DISCONNECTED" | "AccountDisabledError" | "CaptchaError" | "LoginError" | "NetworkError" | "TenantError" | "TenantNotFoundError" | "logout" | "hi_there" | "ai_assistant_tip" | "ai_assistant_placeholder" | "max_chars_exceeded_tip" | "thinking" | "thinking_process" | "referenced_doc_links" | "view_more_related_docs" | "view_less_related_docs" | "new_chat" | "show_more" | "show_less" | "products" | "all_product_documentation" | "explore_doc_all_products") => string;
|
|
@@ -55,6 +55,9 @@ declare const en: {
|
|
|
55
55
|
new_chat: string;
|
|
56
56
|
show_more: string;
|
|
57
57
|
show_less: string;
|
|
58
|
+
products: string;
|
|
59
|
+
all_product_documentation: string;
|
|
60
|
+
explore_doc_all_products: string;
|
|
58
61
|
};
|
|
59
62
|
export type Translation = typeof en;
|
|
60
63
|
export declare const TRANSLATIONS: {
|
|
@@ -115,6 +118,9 @@ export declare const TRANSLATIONS: {
|
|
|
115
118
|
new_chat: string;
|
|
116
119
|
show_more: string;
|
|
117
120
|
show_less: string;
|
|
121
|
+
products: string;
|
|
122
|
+
all_product_documentation: string;
|
|
123
|
+
explore_doc_all_products: string;
|
|
118
124
|
};
|
|
119
125
|
zh: {
|
|
120
126
|
collapse_all: string;
|
|
@@ -173,6 +179,9 @@ export declare const TRANSLATIONS: {
|
|
|
173
179
|
new_chat: string;
|
|
174
180
|
show_more: string;
|
|
175
181
|
show_less: string;
|
|
182
|
+
products: string;
|
|
183
|
+
all_product_documentation: string;
|
|
184
|
+
explore_doc_all_products: string;
|
|
176
185
|
};
|
|
177
186
|
ru: {
|
|
178
187
|
collapse_all: string;
|
|
@@ -231,6 +240,9 @@ export declare const TRANSLATIONS: {
|
|
|
231
240
|
new_chat: string;
|
|
232
241
|
show_more: string;
|
|
233
242
|
show_less: string;
|
|
243
|
+
products: string;
|
|
244
|
+
all_product_documentation: string;
|
|
245
|
+
explore_doc_all_products: string;
|
|
234
246
|
};
|
|
235
247
|
};
|
|
236
248
|
export {};
|
|
@@ -55,6 +55,9 @@ const en = {
|
|
|
55
55
|
new_chat: 'New Chat',
|
|
56
56
|
show_more: 'Show more',
|
|
57
57
|
show_less: 'Show less',
|
|
58
|
+
products: 'Products',
|
|
59
|
+
all_product_documentation: 'All Product Documentation',
|
|
60
|
+
explore_doc_all_products: 'Explore and find documentation for all products',
|
|
58
61
|
};
|
|
59
62
|
const zh = {
|
|
60
63
|
collapse_all: '全部收起',
|
|
@@ -113,6 +116,9 @@ const zh = {
|
|
|
113
116
|
new_chat: '新会话',
|
|
114
117
|
show_more: '显示更多',
|
|
115
118
|
show_less: '显示更少',
|
|
119
|
+
products: '产品',
|
|
120
|
+
all_product_documentation: '所有产品文档',
|
|
121
|
+
explore_doc_all_products: '探索并查找所有产品的文档',
|
|
116
122
|
};
|
|
117
123
|
const ru = {
|
|
118
124
|
collapse_all: 'Свернуть всё',
|
|
@@ -171,5 +177,8 @@ const ru = {
|
|
|
171
177
|
new_chat: 'Новый чат',
|
|
172
178
|
show_more: 'Показать больше',
|
|
173
179
|
show_less: 'Показать меньше',
|
|
180
|
+
products: 'Продукты',
|
|
181
|
+
all_product_documentation: 'Документация по всем продуктам',
|
|
182
|
+
explore_doc_all_products: 'Исследуйте и найдите документацию для всех продуктов',
|
|
174
183
|
};
|
|
175
184
|
export const TRANSLATIONS = { en, zh, ru };
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { addTrailingSlash, isActive, useLocation, useSidebar, useSite, } from '@rspress/core/runtime';
|
|
3
|
+
import { IconArrowRight, SvgWrapper } from '@rspress/core/theme';
|
|
4
|
+
import virtual from 'doom-@global-virtual';
|
|
5
|
+
import { use, useEffect, useMemo } from 'react';
|
|
6
|
+
import { xfetch } from 'x-fetch';
|
|
7
|
+
import { parse } from 'yaml';
|
|
8
|
+
import { BuildInfoContext } from "../../shared/context.js";
|
|
9
|
+
import { X } from "../_X.js";
|
|
10
|
+
import { useLang, useSiteOverrides, useTranslation } from '@alauda/doom/runtime';
|
|
11
|
+
const isBuildInfoItem = (obj) => 'base' in obj && 'version' in obj;
|
|
12
|
+
export const BreadCrumb = () => {
|
|
13
|
+
const lang = useLang();
|
|
14
|
+
const t = useTranslation();
|
|
15
|
+
const { pathname } = useLocation();
|
|
16
|
+
const sidebar = useSidebar();
|
|
17
|
+
const site = useSiteOverrides();
|
|
18
|
+
const { site: siteData } = useSite();
|
|
19
|
+
const breadcrumbItems = useMemo(() => {
|
|
20
|
+
function walk(sidebarItems, parents = []) {
|
|
21
|
+
for (const sidebarItem of sidebarItems) {
|
|
22
|
+
if ('link' in sidebarItem &&
|
|
23
|
+
sidebarItem.link &&
|
|
24
|
+
isActive(sidebarItem.link, pathname)) {
|
|
25
|
+
return [
|
|
26
|
+
...parents.map((p) => ({
|
|
27
|
+
text: p.text,
|
|
28
|
+
link: p.link,
|
|
29
|
+
})),
|
|
30
|
+
{
|
|
31
|
+
text: sidebarItem.text,
|
|
32
|
+
},
|
|
33
|
+
];
|
|
34
|
+
}
|
|
35
|
+
if ('items' in sidebarItem && sidebarItem.items.length) {
|
|
36
|
+
const found = walk(sidebarItem.items, [...parents, sidebarItem]);
|
|
37
|
+
if (found) {
|
|
38
|
+
return found;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
return walk(sidebar);
|
|
44
|
+
}, [pathname, sidebar]);
|
|
45
|
+
const prefix = addTrailingSlash(`/${lang === siteData.lang ? '' : lang}`);
|
|
46
|
+
const { groups, setGroups: setBuildInfoGroups } = use(BuildInfoContext);
|
|
47
|
+
const hasGroups = !!groups.length;
|
|
48
|
+
useEffect(() => {
|
|
49
|
+
const fetchBuildInfo = async () => {
|
|
50
|
+
let rawBuildInfo;
|
|
51
|
+
try {
|
|
52
|
+
rawBuildInfo = parse(await xfetch((virtual.prefix || '') + '/build-info.yaml', {
|
|
53
|
+
type: 'text',
|
|
54
|
+
}));
|
|
55
|
+
}
|
|
56
|
+
catch {
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
const buildInfoGroups = [];
|
|
60
|
+
for (const [base, items] of Object.entries(rawBuildInfo)) {
|
|
61
|
+
const id = base
|
|
62
|
+
.replace('alauda-build-of-', '')
|
|
63
|
+
.replace('alauda-', '')[0];
|
|
64
|
+
let group = buildInfoGroups.find((g) => g.id === id);
|
|
65
|
+
if (!group) {
|
|
66
|
+
group = { id, items: [] };
|
|
67
|
+
buildInfoGroups.push(group);
|
|
68
|
+
}
|
|
69
|
+
if (isBuildInfoItem(items)) {
|
|
70
|
+
group.items.push(items);
|
|
71
|
+
}
|
|
72
|
+
else {
|
|
73
|
+
const latest = Object.values(items).at(-1);
|
|
74
|
+
if (latest) {
|
|
75
|
+
group.items.push(latest);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
setBuildInfoGroups(buildInfoGroups.sort((a, b) => a.id.localeCompare(b.id)));
|
|
80
|
+
};
|
|
81
|
+
void fetchBuildInfo();
|
|
82
|
+
}, [setBuildInfoGroups]);
|
|
83
|
+
return (_jsx("div", { className: "breadcrumb-container", children: _jsxs("ul", { className: "breadcrumb-content", children: [hasGroups && (_jsx("li", { className: "breadcrumb-item rp-doc", children: _jsx(X.a, { href: prefix + 'products', children: t('products') }) })), _jsxs("li", { className: "breadcrumb-item rp-doc", children: [hasGroups && _jsx(SvgWrapper, { icon: IconArrowRight }), _jsx(X.a, { href: prefix, children: site.title || siteData.title })] }), breadcrumbItems?.map((item, index) => (_jsxs("li", { className: "breadcrumb-item rp-doc", children: [_jsx(SvgWrapper, { icon: IconArrowRight }), item.link ? (_jsx(X.a, { href: item.link, children: item.text })) : (_jsx("span", { className: "breadcrumb-item-text", children: item.text }))] }, index)))] }) }));
|
|
84
|
+
};
|
|
85
|
+
export default BreadCrumb;
|
package/lib/theme/Layout.js
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useLang, useSite } from '@rspress/core/runtime';
|
|
3
|
-
import { Link, Layout as OriginalLayout
|
|
3
|
+
import { Link, Layout as OriginalLayout } from '@rspress/core/theme-original';
|
|
4
4
|
import virtual from 'doom-@global-virtual';
|
|
5
5
|
import { useCallback, useMemo, useState } from 'react';
|
|
6
6
|
import { useLocation } from 'react-router';
|
|
7
7
|
import { useTranslation } from "../runtime/index.js";
|
|
8
|
+
import { BuildInfoContext } from "../shared/context.js";
|
|
9
|
+
import { BreadCrumb } from "./Breadcrumb/index.js";
|
|
8
10
|
import { ForceRenderContext } from "./VersionsNav/context.js";
|
|
9
11
|
import { VersionsNav } from "./VersionsNav/index.js";
|
|
10
|
-
|
|
12
|
+
import { X } from "./_X.js";
|
|
11
13
|
const cleanupUrlPath = (urlPath) => {
|
|
12
14
|
if (urlPath.endsWith('.html')) {
|
|
13
15
|
urlPath = urlPath.slice(0, -5);
|
|
@@ -85,5 +87,6 @@ export const Layout = () => {
|
|
|
85
87
|
const forceRender = useCallback(() => {
|
|
86
88
|
setRender((v) => !v);
|
|
87
89
|
}, []);
|
|
88
|
-
|
|
90
|
+
const [buildInfoGroups, setBuildInfoGroups] = useState([]);
|
|
91
|
+
return (_jsxs(ForceRenderContext, { value: useMemo(() => ({ value: render, setValue: forceRender }), [forceRender, render]), children: [_jsx(VersionsNav, {}), _jsx(BuildInfoContext, { value: useMemo(() => ({ groups: buildInfoGroups, setGroups: setBuildInfoGroups }), [buildInfoGroups, setBuildInfoGroups]), children: _jsx(OriginalLayout, { afterNav: _jsx(BreadCrumb, {}), beforeOutline: pdfLink && (_jsx(X.p, { className: "rp-doc", style: { marginBottom: 16 }, children: _jsx(Link, { href: pdfLink, target: "_blank", rel: "noopener noreferrer", children: t('view_docs_as_pdf') }) })) }) })] }));
|
|
89
92
|
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export declare const X: {
|
|
2
|
+
h1: (props: React.ComponentProps<"h1">) => import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
h2: (props: React.ComponentProps<"h2">) => import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
h3: (props: React.ComponentProps<"h3">) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
h4: (props: React.ComponentProps<"h4">) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
h5: (props: React.ComponentProps<"h5">) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
h6: (props: React.ComponentProps<"h6">) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
ul: (props: import("react").ComponentProps<"ul">) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
ol: (props: import("react").ComponentProps<"ol">) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
li: (props: import("react").ComponentProps<"li">) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
table: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").TableHTMLAttributes<HTMLTableElement>, HTMLTableElement>, "ref"> & import("react").RefAttributes<HTMLTableElement>>;
|
|
12
|
+
td: (props: import("react").ComponentProps<"td">) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
th: (props: import("react").ComponentProps<"th">) => import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
tr: (props: import("react").ComponentProps<"tr">) => import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
hr: (props: import("react").ComponentProps<"hr">) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
p: (props: import("react").ComponentProps<"p">) => import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
blockquote: (props: import("react").ComponentProps<"blockquote">) => import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
strong: (props: import("react").ComponentProps<"strong">) => import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
a: (props: import("react").ComponentProps<"a">) => import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
code: typeof import("@rspress/core/dist/theme/components/DocContent/docComponents/code.js").Code;
|
|
21
|
+
img: (props: import("react").ComponentProps<"img">) => import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
pre: typeof import("@rspress/core/dist/theme/components/DocContent/docComponents/pre.js").ShikiPre;
|
|
23
|
+
};
|
package/lib/theme/_X.js
ADDED
package/package.json
CHANGED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
@mixin special {
|
|
2
|
+
.rp-search-button,
|
|
3
|
+
.rp-doc-layout__menu,
|
|
4
|
+
.rp-sidebar-menu-container,
|
|
5
|
+
.rp-nav-menu__divider,
|
|
6
|
+
.rp-nav-screen-divider,
|
|
7
|
+
aside,
|
|
8
|
+
.rp-doc-footer {
|
|
9
|
+
display: none;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.rp-doc-layout__container {
|
|
13
|
+
justify-content: center;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.rp-doc-layout__doc {
|
|
17
|
+
max-width: 1440px;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
:root:has(.breadcrumb-container) {
|
|
2
|
+
--rp-banner-height: 50px;
|
|
3
|
+
|
|
4
|
+
.rp-nav {
|
|
5
|
+
top: 0;
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.breadcrumb {
|
|
10
|
+
&-container {
|
|
11
|
+
position: sticky;
|
|
12
|
+
top: var(--rp-nav-height);
|
|
13
|
+
z-index: calc(var(--rp-z-index-nav) - 1);
|
|
14
|
+
height: var(--rp-banner-height);
|
|
15
|
+
border-bottom: 1px solid var(--rp-c-divider-light);
|
|
16
|
+
padding: 0 20px;
|
|
17
|
+
background-color: var(--rp-c-bg);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
&-content {
|
|
21
|
+
white-space: nowrap;
|
|
22
|
+
overflow-x: auto;
|
|
23
|
+
display: flex;
|
|
24
|
+
align-items: center;
|
|
25
|
+
height: 100%;
|
|
26
|
+
|
|
27
|
+
@media (min-width: 1280px) {
|
|
28
|
+
margin-left: calc(var(--rp-sidebar-margin-left));
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
&-item {
|
|
33
|
+
display: inline-flex;
|
|
34
|
+
align-items: center;
|
|
35
|
+
margin-top: 0;
|
|
36
|
+
|
|
37
|
+
.rp-link,
|
|
38
|
+
&-text {
|
|
39
|
+
margin: 0 8px;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
package/styles/global.scss
CHANGED
package/styles/login.module.scss
CHANGED
|
@@ -1,16 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
#search-container,
|
|
3
|
-
.rspress-nav-search-button,
|
|
4
|
-
.rspress-sidebar-menu-container,
|
|
5
|
-
aside,
|
|
6
|
-
.rspress-doc-footer,
|
|
7
|
-
[class^='aside-container'] {
|
|
8
|
-
display: none;
|
|
9
|
-
}
|
|
1
|
+
@use 'mixins';
|
|
10
2
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}
|
|
3
|
+
body:has(.container) :global {
|
|
4
|
+
@include mixins.special;
|
|
14
5
|
}
|
|
15
6
|
|
|
16
7
|
.container {
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
@use 'mixins';
|
|
2
|
+
|
|
3
|
+
body:has(.container) :global {
|
|
4
|
+
@include mixins.special;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.container {
|
|
8
|
+
column-count: 5;
|
|
9
|
+
column-gap: 1lh;
|
|
10
|
+
|
|
11
|
+
@media (max-width: 1366px) {
|
|
12
|
+
column-count: 4;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
@media (max-width: 1024px) {
|
|
16
|
+
column-count: 3;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
@media (max-width: 768px) {
|
|
20
|
+
column-count: 2;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
h2 {
|
|
24
|
+
margin-top: 0;
|
|
25
|
+
|
|
26
|
+
&:before {
|
|
27
|
+
display: none;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
ul {
|
|
32
|
+
margin-top: 0;
|
|
33
|
+
margin-bottom: 0;
|
|
34
|
+
padding-left: 0;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
li {
|
|
38
|
+
list-style: none;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.group {
|
|
43
|
+
margin-bottom: 1lh;
|
|
44
|
+
break-inside: avoid;
|
|
45
|
+
}
|