@alauda/doom 2.3.1 → 2.5.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.
Files changed (44) hide show
  1. package/lib/cli/helpers.d.ts +12 -0
  2. package/lib/cli/helpers.js +58 -1
  3. package/lib/cli/load-config.js +1 -1
  4. package/lib/cli/translate.js +25 -39
  5. package/lib/global/Intelligence/AIAssistant/Chat/ChatRefDocs/index.d.ts +2 -2
  6. package/lib/global/Intelligence/AIAssistant/Chat/ThinkingProcess/index.js +2 -1
  7. package/lib/global/Intelligence/AIAssistant/Chat/index.js +1 -1
  8. package/lib/global/Intelligence/AIAssistant/index.js +21 -55
  9. package/lib/global/Intelligence/AIAssistant/types.d.ts +3 -8
  10. package/lib/global/Intelligence/index.js +2 -7
  11. package/lib/plugins/global/index.js +20 -5
  12. package/lib/plugins/replace/parse-toc.js +1 -1
  13. package/lib/products/index.d.ts +15 -0
  14. package/lib/products/index.js +25 -0
  15. package/lib/remark-lint/check-dead-links.js +6 -1
  16. package/lib/runtime/components/ExternalSiteLink.js +3 -2
  17. package/lib/runtime/components/Markdown.js +0 -1
  18. package/lib/runtime/components/Masonry.js +0 -1
  19. package/lib/runtime/components/OpenAPIPath.d.ts +1 -1
  20. package/lib/runtime/components/OpenAPIPath.js +1 -1
  21. package/lib/runtime/components/_HeadingTitle.d.ts +1 -1
  22. package/lib/runtime/components/_HeadingTitle.js +1 -1
  23. package/lib/runtime/hooks/useSiteOverrides.js +2 -5
  24. package/lib/runtime/hooks/useTranslation.d.ts +1 -1
  25. package/lib/runtime/translation.d.ts +12 -0
  26. package/lib/runtime/translation.js +9 -0
  27. package/lib/shared/context.d.ts +5 -0
  28. package/lib/shared/context.js +2 -0
  29. package/lib/theme/AutoExpandable.js +0 -1
  30. package/lib/theme/Breadcrumb/index.d.ts +6 -0
  31. package/lib/theme/Breadcrumb/index.js +85 -0
  32. package/lib/theme/Layout.js +6 -3
  33. package/lib/theme/_X.d.ts +23 -0
  34. package/lib/theme/_X.js +2 -0
  35. package/package.json +24 -23
  36. package/styles/_mixins.scss +19 -0
  37. package/styles/breadcrumb.scss +42 -0
  38. package/styles/chat-ref-docs.module.scss +4 -0
  39. package/styles/chat.module.scss +85 -6
  40. package/styles/global.scss +1 -0
  41. package/styles/login.module.scss +3 -12
  42. package/styles/products.module.scss +45 -0
  43. package/lib/global/Intelligence/AIAssistant/utils.d.ts +0 -19
  44. package/lib/global/Intelligence/AIAssistant/utils.js +0 -131
@@ -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 res.text());
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,5 @@
1
+ import type { BuildInfoGroup } from '../products/index.tsx';
2
+ export declare const BuildInfoContext: import("react").Context<{
3
+ groups: BuildInfoGroup[];
4
+ setGroups: (items: BuildInfoGroup[]) => void;
5
+ }>;
@@ -0,0 +1,2 @@
1
+ import { createContext } from 'react';
2
+ export const BuildInfoContext = createContext(null);
@@ -18,7 +18,6 @@ export const AutoExpandable = ({ threshold = 240, children, }) => {
18
18
  let observer;
19
19
  const calculate = () => {
20
20
  if (containerEl.scrollHeight > threshold) {
21
- // eslint-disable-next-line @eslint-react/set-state-in-effect
22
21
  setExpandable(true);
23
22
  }
24
23
  observer?.disconnect();
@@ -0,0 +1,6 @@
1
+ export interface BreadcrumbItem {
2
+ text: string;
3
+ link?: string;
4
+ }
5
+ export declare const BreadCrumb: () => import("react/jsx-runtime").JSX.Element;
6
+ export default BreadCrumb;
@@ -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;
@@ -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, getCustomMDXComponent, } from '@rspress/core/theme-original';
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
- const X = getCustomMDXComponent();
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
- return (_jsxs(ForceRenderContext, { value: useMemo(() => ({ value: render, setValue: forceRender }), [forceRender, render]), children: [_jsx(VersionsNav, {}), _jsx(OriginalLayout, { 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') }) })) })] }));
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
+ };
@@ -0,0 +1,2 @@
1
+ import { getCustomMDXComponent } from '@rspress/core/theme-original';
2
+ export const X = getCustomMDXComponent();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alauda/doom",
3
- "version": "2.3.1",
3
+ "version": "2.5.0",
4
4
  "type": "module",
5
5
  "description": "Doctor Doom making docs.",
6
6
  "repository": {
@@ -43,20 +43,21 @@
43
43
  "rspress-plugins"
44
44
  ],
45
45
  "dependencies": {
46
+ "@alauda/doc-stream-sdk": "0.1.0",
46
47
  "@alauda/doom-export": "^0.4.1",
47
48
  "@cspell/eslint-plugin": "^10.0.0",
48
- "@eslint-react/eslint-plugin": "^4.2.3",
49
+ "@eslint-react/eslint-plugin": "^5.7.6",
49
50
  "@eslint/js": "^10.0.1",
50
- "@inquirer/prompts": "^8.4.1",
51
+ "@inquirer/prompts": "^8.4.3",
51
52
  "@openapi-contrib/openapi-schema-to-json-schema": "^5.1.0",
52
- "@rsbuild/plugin-react": "^1.4.6",
53
- "@rsbuild/plugin-sass": "^1.5.1",
54
- "@rsbuild/plugin-svgr": "^1.3.1",
53
+ "@rsbuild/plugin-react": "^2.0.0",
54
+ "@rsbuild/plugin-sass": "^1.5.2",
55
+ "@rsbuild/plugin-svgr": "^2.0.2",
55
56
  "@rsbuild/plugin-yaml": "^1.0.4",
56
- "@rspress/core": "2.0.8",
57
- "@rspress/plugin-algolia": "2.0.8",
58
- "@rspress/plugin-sitemap": "2.0.8",
59
- "@rspress/shared": "2.0.8",
57
+ "@rspress/core": "2.0.11",
58
+ "@rspress/plugin-algolia": "2.0.11",
59
+ "@rspress/plugin-sitemap": "2.0.11",
60
+ "@rspress/shared": "2.0.11",
60
61
  "@shikijs/transformers": "^4.0.2",
61
62
  "@total-typescript/ts-reset": "^0.6.1",
62
63
  "@types/react": "^19.2.14",
@@ -64,11 +65,11 @@
64
65
  "chokidar": "^5.0.0",
65
66
  "clsx": "^2.1.1",
66
67
  "commander": "^14.0.3",
67
- "ejs": "^5.0.1",
68
- "es-toolkit": "^1.45.1",
69
- "eslint": "^10.2.0",
68
+ "ejs": "^5.0.2",
69
+ "es-toolkit": "^1.46.1",
70
+ "eslint": "^10.3.0",
70
71
  "eslint-plugin-mdx": "^3.7.0",
71
- "globals": "^17.4.0",
72
+ "globals": "^17.6.0",
72
73
  "hastscript": "^9.0.1",
73
74
  "html-tag-names": "^2.1.0",
74
75
  "jsencrypt": "^3.5.4",
@@ -78,14 +79,14 @@
78
79
  "mdast-util-phrasing": "^4.1.0",
79
80
  "mdast-util-to-markdown": "^2.1.2",
80
81
  "mdast-util-to-string": "^4.0.0",
81
- "mermaid": "^11.14.0",
82
- "openai": "^6.33.0",
82
+ "mermaid": "^11.15.0",
83
+ "openai": "^6.37.0",
83
84
  "openapi-types": "^12.1.3",
84
85
  "p-ratelimit": "^1.0.1",
85
86
  "picomatch": "^4.0.4",
86
87
  "pluralize": "^8.0.0",
87
88
  "react-markdown": "^10.1.0",
88
- "react-tooltip": "^5.30.0",
89
+ "react-tooltip": "^6.0.2",
89
90
  "rehype-raw": "^7.0.0",
90
91
  "rehype-sanitize": "^6.0.0",
91
92
  "remark-directive": "^4.0.0",
@@ -100,19 +101,19 @@
100
101
  "remark-mdx": "^3.1.1",
101
102
  "remark-message-control": "^8.0.0",
102
103
  "remark-stringify": "^11.0.0",
103
- "simple-git": "^3.35.2",
104
- "string-width": "^8.2.0",
104
+ "simple-git": "^3.36.0",
105
+ "string-width": "^8.2.1",
105
106
  "swagger2openapi": "^7.0.8",
106
107
  "tinyglobby": "^0.2.16",
107
- "type-fest": "^5.5.0",
108
- "typescript": "^6.0.2",
109
- "typescript-eslint": "^8.58.1",
108
+ "type-fest": "^5.6.0",
109
+ "typescript": "^6.0.3",
110
+ "typescript-eslint": "^8.59.3",
110
111
  "unified": "^11.0.5",
111
112
  "unified-lint-rule": "^3.0.1",
112
113
  "unist-util-position": "^5.0.0",
113
114
  "unist-util-visit-parents": "^6.0.2",
114
115
  "x-fetch": "^0.2.6",
115
- "yaml": "^2.8.3",
116
+ "yaml": "^2.9.0",
116
117
  "yoctocolors": "^2.1.2"
117
118
  }
118
119
  }
@@ -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
+ }
@@ -37,6 +37,10 @@
37
37
  }
38
38
 
39
39
  .docs {
40
+ margin-bottom: 0;
41
+ padding-left: 0;
42
+ line-height: normal;
43
+
40
44
  &,
41
45
  .doc + .doc {
42
46
  margin-top: 8px;
@@ -17,12 +17,6 @@
17
17
  font-size: 14px;
18
18
  width: calc(100% - 36px);
19
19
 
20
- h2 {
21
- margin-bottom: 0;
22
- padding-top: 0;
23
- border: 0;
24
- }
25
-
26
20
  &,
27
21
  p {
28
22
  line-height: calc(20 / 14);
@@ -52,6 +46,91 @@
52
46
  }
53
47
  }
54
48
 
49
+ .markdown {
50
+ &:global(.rp-doc) {
51
+ > :first-child {
52
+ margin-top: 0;
53
+ padding-top: 0;
54
+ border-top: 0;
55
+ }
56
+
57
+ > :last-child {
58
+ margin-bottom: 0;
59
+ padding-bottom: 0;
60
+ border-bottom: 0;
61
+ }
62
+
63
+ p {
64
+ margin-top: 0.75rem;
65
+ margin-bottom: 0.75rem;
66
+ line-height: calc(20 / 14);
67
+ }
68
+
69
+ h1,
70
+ h2,
71
+ h3,
72
+ h4,
73
+ h5,
74
+ h6 {
75
+ line-height: 1.4;
76
+ }
77
+
78
+ h1 {
79
+ margin-bottom: 1rem;
80
+ font-size: 1.5rem;
81
+ }
82
+
83
+ h2 {
84
+ margin-top: 1.25rem;
85
+ margin-bottom: 0.5rem;
86
+ padding-top: 0;
87
+ border: 0;
88
+ font-size: 1.25rem;
89
+
90
+ &:first-of-type:before {
91
+ display: none;
92
+ }
93
+ }
94
+
95
+ h3 {
96
+ margin-top: 1rem;
97
+ margin-bottom: 0.5rem;
98
+ font-size: 1.125rem;
99
+ }
100
+
101
+ h4,
102
+ h5,
103
+ h6 {
104
+ margin-top: 0.75rem;
105
+ margin-bottom: 0.375rem;
106
+ font-size: 1rem;
107
+ }
108
+
109
+ ul,
110
+ ol {
111
+ margin-top: 0.75rem;
112
+ margin-bottom: 0.75rem;
113
+ padding-left: 1.125rem;
114
+ line-height: calc(20 / 14);
115
+ }
116
+
117
+ ul li:not(:first-child),
118
+ ol li:not(:first-child) {
119
+ margin-top: 0.25rem;
120
+ }
121
+
122
+ blockquote {
123
+ margin-top: 1rem;
124
+ margin-bottom: 1rem;
125
+ padding-left: 0.75rem;
126
+ }
127
+
128
+ hr {
129
+ margin: 1.5rem 0;
130
+ }
131
+ }
132
+ }
133
+
55
134
  .assistant {
56
135
  display: flex;
57
136
 
@@ -234,3 +234,4 @@ td {
234
234
  }
235
235
 
236
236
  @import 'intelligence.scss';
237
+ @import 'breadcrumb.scss';
@@ -1,16 +1,7 @@
1
- body:has(.container) :global {
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
- .rspress-doc {
12
- max-width: 1440px;
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
+ }
@@ -1,19 +0,0 @@
1
- import type { RefDoc } from './types.js';
2
- export interface SSEEvent {
3
- data: string;
4
- event?: string;
5
- }
6
- export interface SSEConsumeResult {
7
- event?: string;
8
- events: SSEEvent[];
9
- remainder: string;
10
- }
11
- export declare const unicodeToString: (unicodeStr: string) => string;
12
- export declare const removePrefix: (prefix: string | null | undefined, text: string) => string;
13
- export declare const consumeSSEEvents: (buffer: string, event?: string) => SSEConsumeResult;
14
- export declare const getAnswerDelta: ({ event, data }: SSEEvent) => string;
15
- export declare function parseStreamContent(text: string): {
16
- refDocs: RefDoc[];
17
- thinkingProcess: string | undefined;
18
- content: string;
19
- };