@rspress/core 2.0.9 → 2.0.10

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 (74) hide show
  1. package/dist/0~execa.js +1 -1
  2. package/dist/{740.js → 2287.js} +127 -139
  3. package/dist/8006.js +1 -1
  4. package/dist/8857.js +2 -3
  5. package/dist/cli/index.js +7 -4
  6. package/dist/eject-theme/components/CodeButtonGroup/CopyCodeButton.tsx +17 -21
  7. package/dist/eject-theme/components/DocContent/doc.scss +14 -41
  8. package/dist/eject-theme/components/Llms/LlmsCopyButton.tsx +13 -6
  9. package/dist/eject-theme/components/Llms/LlmsCopyRow.tsx +13 -5
  10. package/dist/eject-theme/components/Llms/LlmsViewOptions.tsx +7 -3
  11. package/dist/eject-theme/components/Outline/index.scss +1 -1
  12. package/dist/eject-theme/components/Prompt/icons.tsx +80 -0
  13. package/dist/eject-theme/components/Prompt/index.scss +478 -0
  14. package/dist/eject-theme/components/Prompt/index.tsx +335 -0
  15. package/dist/eject-theme/components/SidebarMenu/index.tsx +5 -1
  16. package/dist/node/PluginDriver.js +1 -1
  17. package/dist/node/auto-nav-sidebar/index.js +1 -1
  18. package/dist/node/auto-nav-sidebar/locales.js +1 -1
  19. package/dist/node/auto-nav-sidebar/normalize.js +2 -2
  20. package/dist/node/auto-nav-sidebar/utils.js +1 -1
  21. package/dist/node/auto-nav-sidebar/walk.js +1 -1
  22. package/dist/node/eject.js +1 -0
  23. package/dist/node/initRsbuild.js +1 -1
  24. package/dist/node/route/RoutePage.js +1 -1
  25. package/dist/node/route/RouteService.js +1 -1
  26. package/dist/node/route/extractPageData.js +1 -1
  27. package/dist/node/route/normalizeRoutePath.js +1 -1
  28. package/dist/node/runtimeModule/DEFAULT_I18N_TEXT.d.ts +28 -0
  29. package/dist/node/runtimeModule/DEFAULT_I18N_TEXT.js +28 -0
  30. package/dist/node/runtimeModule/i18n.js +1 -1
  31. package/dist/node/runtimeModule/pageData/createPageData.js +1 -1
  32. package/dist/node/runtimeModule/pageData/rsbuildPlugin.js +1 -1
  33. package/dist/node/runtimeModule/searchHooks.js +1 -1
  34. package/dist/node/runtimeModule/siteData/createSiteData.js +1 -1
  35. package/dist/node/runtimeModule/siteData/normalizeThemeConfig.js +1 -1
  36. package/dist/node/runtimeModule/siteData/rsbuildPlugin.js +1 -1
  37. package/dist/node/serve.js +1 -1
  38. package/dist/node/ssg/renderPages.js +1 -1
  39. package/dist/node/ssg/rsbuildPluginSSG.js +1 -1
  40. package/dist/node/ssg/ssgEnv.js +1 -1
  41. package/dist/node/ssg-md/llms/emitLlmsTxt.js +1 -1
  42. package/dist/node/ssg-md/llms/llmsTxt.js +1 -1
  43. package/dist/node/ssg-md/renderPage.js +1 -1
  44. package/dist/node/ssg-md/renderPages.js +1 -1
  45. package/dist/node/ssg-md/rsbuildPluginSSGMD.js +1 -1
  46. package/dist/node/utils/checkLanguageParity.js +1 -1
  47. package/dist/node/utils/createHash.js +1 -1
  48. package/dist/node/utils/flattenMdxContent.js +1 -1
  49. package/dist/node/utils/getPageKey.js +1 -1
  50. package/dist/node/utils/reactAlias.js +1 -1
  51. package/dist/theme/components/CodeButtonGroup/CopyCodeButton.js +14 -12
  52. package/dist/theme/components/DocContent/doc.css +13 -21
  53. package/dist/theme/components/Llms/LlmsCopyButton.js +5 -6
  54. package/dist/theme/components/Llms/LlmsCopyRow.js +5 -5
  55. package/dist/theme/components/Llms/LlmsViewOptions.js +1 -3
  56. package/dist/theme/components/Outline/index.css +1 -1
  57. package/dist/theme/components/Prompt/icons.d.ts +10 -0
  58. package/dist/theme/components/Prompt/icons.js +64 -0
  59. package/dist/theme/components/Prompt/index.css +352 -0
  60. package/dist/theme/components/Prompt/index.d.ts +33 -0
  61. package/dist/theme/components/Prompt/index.js +262 -0
  62. package/dist/theme/components/SidebarMenu/index.js +2 -1
  63. package/dist/theme/index.d.ts +3 -0
  64. package/dist/theme/index.js +3 -0
  65. package/dist/theme/layout/DocLayout/index.css +5 -1
  66. package/dist/theme/layout/DocLayout/index.js +8 -4
  67. package/dist/theme/logic/copyToClipboard.d.ts +1 -0
  68. package/dist/theme/{components/Llms/copy.js → logic/copyToClipboard.js} +4 -3
  69. package/dist/theme/logic/getCopyableText.d.ts +5 -0
  70. package/dist/theme/logic/getCopyableText.js +52 -0
  71. package/dist/theme/styles/vars/base-vars.css +4 -4
  72. package/package.json +13 -13
  73. package/dist/eject-theme/components/Llms/copy.ts +0 -12
  74. package/dist/theme/components/Llms/copy.d.ts +0 -1
@@ -0,0 +1,335 @@
1
+ import { useI18n } from '@rspress/core/runtime';
2
+ import {
3
+ copyToClipboard,
4
+ IconArrowDown,
5
+ IconCopy,
6
+ IconSuccess,
7
+ renderInlineMarkdown,
8
+ SvgWrapper,
9
+ } from '@rspress/core/theme';
10
+ import clsx from 'clsx';
11
+ import { useCallback, useEffect, useId, useRef, useState } from 'react';
12
+ import { AGENT_ICONS } from './icons';
13
+ import './index.scss';
14
+
15
+ const ROTATE_INTERVAL = 3500;
16
+ const FADE_DURATION = 400;
17
+
18
+ function RotatingIcon({ index, fading }: { index: number; fading: boolean }) {
19
+ return (
20
+ <span
21
+ className={clsx('rp-prompt__icon', fading && 'rp-prompt__icon--fade-out')}
22
+ title={AGENT_ICONS[index].name}
23
+ >
24
+ {AGENT_ICONS[index].svg}
25
+ </span>
26
+ );
27
+ }
28
+
29
+ function useRotatingIcon() {
30
+ const [iconIndex, setIconIndex] = useState(0);
31
+ const [fading, setFading] = useState(false);
32
+ const rotateTimeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null);
33
+
34
+ useEffect(() => {
35
+ const timer = setInterval(() => {
36
+ setFading(true);
37
+ rotateTimeoutRef.current = setTimeout(() => {
38
+ setIconIndex(prev => (prev + 1) % AGENT_ICONS.length);
39
+ setFading(false);
40
+ rotateTimeoutRef.current = null;
41
+ }, FADE_DURATION);
42
+ }, ROTATE_INTERVAL);
43
+ return () => {
44
+ clearInterval(timer);
45
+ if (rotateTimeoutRef.current) {
46
+ clearTimeout(rotateTimeoutRef.current);
47
+ }
48
+ };
49
+ }, []);
50
+
51
+ return { fading, iconIndex };
52
+ }
53
+
54
+ export interface PromptProps extends React.HTMLAttributes<HTMLDivElement> {
55
+ /**
56
+ * Render custom MDX content without copy or collapse behavior.
57
+ * @default false
58
+ */
59
+ custom?: boolean;
60
+ /**
61
+ * Inline description rendered in the prompt header.
62
+ */
63
+ description?: string;
64
+ /**
65
+ * Header label for the prompt block.
66
+ * @default 'Agent Prompt'
67
+ */
68
+ title?: string;
69
+ /**
70
+ * Eyebrow label shown above the title.
71
+ * @default 'For your Agent'
72
+ */
73
+ eyebrow?: string;
74
+ /**
75
+ * Controls the initial folded state.
76
+ * @default true
77
+ */
78
+ defaultCollapsed?: boolean;
79
+ /**
80
+ * The prompt text to display and copy.
81
+ */
82
+ prompt?: string;
83
+ }
84
+
85
+ function CustomPrompt({
86
+ children,
87
+ className,
88
+ defaultCollapsed: _defaultCollapsed,
89
+ description: _description,
90
+ eyebrow = 'For your Agent',
91
+ prompt: _prompt,
92
+ style,
93
+ title: _title,
94
+ ...props
95
+ }: PromptProps) {
96
+ const { fading, iconIndex } = useRotatingIcon();
97
+
98
+ return (
99
+ <div
100
+ {...props}
101
+ className={clsx('rp-prompt', 'rp-prompt--custom', className)}
102
+ style={
103
+ {
104
+ '--rp-prompt-accent': AGENT_ICONS[iconIndex].color,
105
+ ...style,
106
+ } as React.CSSProperties
107
+ }
108
+ >
109
+ <div className="rp-prompt__backdrop" />
110
+ <div className="rp-prompt__panel">
111
+ <div className="rp-prompt__meta">
112
+ <span className="rp-prompt__eyebrow">
113
+ <RotatingIcon index={iconIndex} fading={fading} />
114
+ {eyebrow}
115
+ </span>
116
+ </div>
117
+ <div className="rp-prompt__custom-content">{children}</div>
118
+ </div>
119
+ </div>
120
+ );
121
+ }
122
+
123
+ function CopyablePrompt({
124
+ className,
125
+ defaultCollapsed = true,
126
+ description,
127
+ eyebrow = 'For your Agent',
128
+ onClick,
129
+ prompt,
130
+ style,
131
+ title = 'Agent Prompt',
132
+ ...props
133
+ }: PromptProps) {
134
+ const t = useI18n();
135
+ const contentId = useId();
136
+ const [collapsed, setCollapsed] = useState(defaultCollapsed);
137
+ const [copied, setCopied] = useState(false);
138
+ const { fading, iconIndex } = useRotatingIcon();
139
+ const [ripples, setRipples] = useState<
140
+ Array<{ id: number; x: number; y: number }>
141
+ >([]);
142
+ const cardRef = useRef<HTMLDivElement>(null);
143
+ const copyTimerRef = useRef<ReturnType<typeof setTimeout> | null>(null);
144
+ const rippleTimersRef = useRef<Set<ReturnType<typeof setTimeout>>>(new Set());
145
+
146
+ useEffect(() => {
147
+ return () => {
148
+ copyTimerRef.current && clearTimeout(copyTimerRef.current);
149
+ rippleTimersRef.current.forEach(clearTimeout);
150
+ rippleTimersRef.current.clear();
151
+ };
152
+ }, []);
153
+
154
+ const handleCopy = useCallback(async () => {
155
+ if (!prompt) {
156
+ return;
157
+ }
158
+
159
+ const isCopied = await copyToClipboard(prompt);
160
+ if (!isCopied) {
161
+ return;
162
+ }
163
+
164
+ setCopied(true);
165
+
166
+ if (copyTimerRef.current) {
167
+ clearTimeout(copyTimerRef.current);
168
+ }
169
+
170
+ copyTimerRef.current = setTimeout(() => {
171
+ setCopied(false);
172
+ copyTimerRef.current = null;
173
+ }, 2000);
174
+ }, [prompt]);
175
+
176
+ const handleCardActivate = useCallback(
177
+ (e: React.MouseEvent<HTMLDivElement>) => {
178
+ onClick?.(e);
179
+ if (e.defaultPrevented) {
180
+ return;
181
+ }
182
+
183
+ if (window.getSelection()?.toString()) {
184
+ return;
185
+ }
186
+
187
+ const target = e.target as HTMLElement;
188
+ if (
189
+ target.closest(
190
+ 'a, button, .rp-prompt__action-copy, .rp-prompt__action-toggle',
191
+ )
192
+ ) {
193
+ return;
194
+ }
195
+
196
+ const rect = cardRef.current?.getBoundingClientRect();
197
+ if (!rect) {
198
+ return;
199
+ }
200
+
201
+ const id = Date.now() + Math.random();
202
+ setRipples(prev => [
203
+ ...prev,
204
+ { id, x: e.clientX - rect.left, y: e.clientY - rect.top },
205
+ ]);
206
+ const timer = setTimeout(() => {
207
+ setRipples(prev => prev.filter(r => r.id !== id));
208
+ rippleTimersRef.current.delete(timer);
209
+ }, 600);
210
+ rippleTimersRef.current.add(timer);
211
+
212
+ void handleCopy();
213
+ },
214
+ [handleCopy, onClick],
215
+ );
216
+
217
+ return (
218
+ <div
219
+ {...props}
220
+ ref={cardRef}
221
+ className={clsx('rp-prompt', className)}
222
+ style={
223
+ {
224
+ '--rp-prompt-accent': AGENT_ICONS[iconIndex].color,
225
+ ...style,
226
+ } as React.CSSProperties
227
+ }
228
+ onClick={handleCardActivate}
229
+ >
230
+ <div className="rp-prompt__backdrop" />
231
+ {ripples.map(r => (
232
+ <span
233
+ key={r.id}
234
+ className="rp-prompt__ripple"
235
+ style={{ left: r.x, top: r.y }}
236
+ />
237
+ ))}
238
+ <div className="rp-prompt__panel">
239
+ <div className="rp-prompt__header">
240
+ <div
241
+ className={clsx(
242
+ 'rp-prompt__meta',
243
+ copied && 'rp-prompt__meta--copied',
244
+ )}
245
+ >
246
+ <span className="rp-prompt__eyebrow">
247
+ <RotatingIcon index={iconIndex} fading={fading} />
248
+ {eyebrow}
249
+ </span>
250
+ </div>
251
+ <div className="rp-prompt__header-row">
252
+ <div className="rp-prompt__header-left">
253
+ <div className="rp-prompt__title-with-icon">
254
+ <div className="rp-prompt__title">{title}</div>
255
+ </div>
256
+ {description ? (
257
+ <p
258
+ className="rp-prompt__description"
259
+ {...renderInlineMarkdown(description)}
260
+ />
261
+ ) : null}
262
+ </div>
263
+ <div className="rp-prompt__header-actions">
264
+ <button
265
+ type="button"
266
+ className={clsx(
267
+ 'rp-prompt__action-copy',
268
+ copied && 'rp-prompt__action-copy--copied',
269
+ )}
270
+ onClick={e => {
271
+ e.stopPropagation();
272
+ void handleCopy();
273
+ }}
274
+ title={t('promptCopyText')}
275
+ >
276
+ <SvgWrapper
277
+ icon={copied ? IconSuccess : IconCopy}
278
+ className="rp-prompt__action-icon"
279
+ />
280
+ <span>
281
+ {copied ? t('promptCopiedText') : t('promptCopyText')}
282
+ </span>
283
+ </button>
284
+ <button
285
+ type="button"
286
+ className="rp-prompt__action-toggle"
287
+ onClick={e => {
288
+ e.stopPropagation();
289
+ setCollapsed(value => !value);
290
+ }}
291
+ aria-controls={contentId}
292
+ aria-expanded={!collapsed}
293
+ title={
294
+ collapsed ? t('promptExpandText') : t('promptCollapseText')
295
+ }
296
+ >
297
+ <SvgWrapper
298
+ icon={IconArrowDown}
299
+ className={clsx(
300
+ 'rp-prompt__action-toggle-icon',
301
+ !collapsed && 'rp-prompt__action-toggle-icon--expanded',
302
+ )}
303
+ />
304
+ </button>
305
+ </div>
306
+ </div>
307
+ </div>
308
+
309
+ <div
310
+ id={contentId}
311
+ className={clsx(
312
+ 'rp-prompt__content',
313
+ collapsed && 'rp-prompt__content--collapsed',
314
+ )}
315
+ aria-hidden={collapsed}
316
+ >
317
+ <div className="rp-prompt__content-inner">
318
+ <div
319
+ className="rp-prompt__content-body"
320
+ style={{ whiteSpace: 'pre-wrap' }}
321
+ >
322
+ {prompt}
323
+ </div>
324
+ </div>
325
+ </div>
326
+ </div>
327
+ </div>
328
+ );
329
+ }
330
+
331
+ export function Prompt({ custom = false, ...props }: PromptProps) {
332
+ return custom ? <CustomPrompt {...props} /> : <CopyablePrompt {...props} />;
333
+ }
334
+
335
+ export default Prompt;
@@ -37,8 +37,12 @@ export const SidebarMenu = forwardRef(
37
37
  const { scrolledHeader } = useActiveAnchor(headers);
38
38
 
39
39
  const {
40
- frontmatter: { sidebar: showSidebar = true, outline: showOutline = true },
40
+ frontmatter: {
41
+ sidebar: sidebarConfig = true,
42
+ outline: showOutline = true,
43
+ },
41
44
  } = useFrontmatter();
45
+ const showSidebar = sidebarConfig === true;
42
46
 
43
47
  function openSidebar() {
44
48
  onIsSidebarOpenChange(true);
@@ -1,4 +1,4 @@
1
- import { addTrailingSlash, node_path, addLeadingSlash } from "../740.js";
1
+ import { addTrailingSlash, node_path, addLeadingSlash } from "../2287.js";
2
2
  import { createError } from "./utils/error.js";
3
3
  import { haveNavSidebarConfig as auto_nav_sidebar_haveNavSidebarConfig } from "./auto-nav-sidebar/index.js";
4
4
  class PluginDriver {
@@ -1,4 +1,4 @@
1
- import { DEFAULT_PAGE_EXTENSIONS, node_path } from "../../740.js";
1
+ import { DEFAULT_PAGE_EXTENSIONS, node_path } from "../../2287.js";
2
2
  import { processLocales, combineWalkResult } from "./locales.js";
3
3
  import { walk } from "./walk.js";
4
4
  async function runAutoNavSide(config, metaFileSet, mdFileSet) {
@@ -1,4 +1,4 @@
1
- import { node_path } from "../../740.js";
1
+ import { node_path } from "../../2287.js";
2
2
  import { walk } from "./walk.js";
3
3
  function combineWalkResult(walks, versions) {
4
4
  return walks.reduce((acc, cur, curIndex)=>({
@@ -1,6 +1,6 @@
1
1
  import { __webpack_require__ } from "../../0~rslib-runtime.js";
2
2
  import "../../8006.js";
3
- import { extname, logger, external_node_path_relative, readdir, isExternalUrl, slash, promises_stat, join } from "../../740.js";
3
+ import { extname, logger, promises_readdir, external_node_path_relative, isExternalUrl, slash, promises_stat, join } from "../../2287.js";
4
4
  import { createError } from "../utils/error.js";
5
5
  import { PUBLIC_DIR } from "../constants.js";
6
6
  import { pathExists, extractInfoFromFrontmatterWithAbsolutePath, readJson } from "./utils.js";
@@ -15,7 +15,7 @@ function getFileKey(realPath, docsDir) {
15
15
  async function fsDirToMetaItems(workDir, docsDir, extensions) {
16
16
  let subItems;
17
17
  try {
18
- subItems = (await readdir(workDir)).sort((a, b)=>{
18
+ subItems = (await promises_readdir(workDir)).sort((a, b)=>{
19
19
  const aIsIndex = 'index' === a.replace(/\.[^/.]+$/, '');
20
20
  const bIsIndex = 'index' === b.replace(/\.[^/.]+$/, '');
21
21
  if (aIsIndex !== bIsIndex) return aIsIndex ? -1 : 1;
@@ -1,4 +1,4 @@
1
- import { node_path, extractTextAndId, promises, loadFrontMatter } from "../../740.js";
1
+ import { node_path, extractTextAndId, promises, loadFrontMatter } from "../../2287.js";
2
2
  import { createError } from "../utils/error.js";
3
3
  async function pathExists(path) {
4
4
  try {
@@ -1,4 +1,4 @@
1
- import { isExternalUrl, node_path, promises } from "../../740.js";
1
+ import { isExternalUrl, node_path, promises } from "../../2287.js";
2
2
  import { pathExists } from "../utils/fs.js";
3
3
  import { readJson } from "./utils.js";
4
4
  import { addRoutePrefix } from "../route/RoutePage.js";
@@ -28,6 +28,7 @@ async function getAvailableComponents() {
28
28
  'PackageManagerTabs',
29
29
  'PrevNextPage',
30
30
  'OverviewGroup',
31
+ 'Prompt',
31
32
  'Root',
32
33
  'SocialLinks',
33
34
  'Steps'
@@ -1,4 +1,4 @@
1
- import { external_node_process_cwd, node_path, external_node_url_fileURLToPath, addTrailingSlash, PLUGIN_REACT_NAME, external_node_module_createRequire, removeTrailingSlash, pluginVirtualModule, pluginReact, MDX_OR_MD_REGEXP } from "../740.js";
1
+ import { external_node_process_cwd, node_path, external_node_url_fileURLToPath, addTrailingSlash, PLUGIN_REACT_NAME, external_node_module_createRequire, removeTrailingSlash, pluginVirtualModule, pluginReact, MDX_OR_MD_REGEXP } from "../2287.js";
2
2
  import { createError } from "./utils/error.js";
3
3
  import { PUBLIC_DIR, CSR_CLIENT_ENTRY, SSR_CLIENT_ENTRY, OUTPUT_DIR, SSG_MD_SERVER_ENTRY, inlineThemeScript, NODE_SSG_BUNDLE_FOLDER, isProduction, PACKAGE_ROOT, SSR_SERVER_ENTRY, TEMPLATE_PATH, NODE_SSG_MD_BUNDLE_FOLDER, DEFAULT_THEME, NODE_SSG_MD_BUNDLE_NAME, DEFAULT_TITLE, NODE_SSG_BUNDLE_NAME } from "./constants.js";
4
4
  import { hintBuilderPluginsBreakingChange, hintThemeBreakingChange } from "./logger/hint.js";
@@ -1,4 +1,4 @@
1
- import { node_path } from "../../740.js";
1
+ import { node_path } from "../../2287.js";
2
2
  import { RouteService } from "./RouteService.js";
3
3
  import { normalizePath, slash } from "../utils/normalizePath.js";
4
4
  import { getPageKey } from "../utils/getPageKey.js";
@@ -1,4 +1,4 @@
1
- import { RSPRESS_TEMP_DIR, node_path, removeTrailingSlash, promises, addTrailingSlash, DEFAULT_PAGE_EXTENSIONS, glob } from "../../740.js";
1
+ import { RSPRESS_TEMP_DIR, node_path, removeTrailingSlash, promises, addTrailingSlash, DEFAULT_PAGE_EXTENSIONS, glob } from "../../2287.js";
2
2
  import { PUBLIC_DIR } from "../constants.js";
3
3
  import { RoutePage, absolutePathToRoutePath, absolutePathToRelativePath } from "./RoutePage.js";
4
4
  import { createError } from "../utils/error.js";
@@ -1,4 +1,4 @@
1
- import { unified, node_path, promises, loadFrontMatter, remove, remark_gfm, MDX_OR_MD_REGEXP, remark_parse } from "../../740.js";
1
+ import { unified, node_path, promises, loadFrontMatter, remove, remark_gfm, MDX_OR_MD_REGEXP, remark_parse } from "../../2287.js";
2
2
  import { applyReplaceRules } from "../utils/applyReplaceRules.js";
3
3
  import { flattenMdxContent } from "../utils/flattenMdxContent.js";
4
4
  import { importStatementRegex } from "../constants.js";
@@ -1,4 +1,4 @@
1
- import { addTrailingSlash, DEFAULT_PAGE_EXTENSIONS, addLeadingSlash } from "../../740.js";
1
+ import { addTrailingSlash, DEFAULT_PAGE_EXTENSIONS, addLeadingSlash } from "../../2287.js";
2
2
  const getRoutePathParts = (relativePath, lang, version, langs, versions)=>{
3
3
  const [versionPart, langPart, purePath] = splitRoutePathParts(relativePath, lang, version, langs, versions);
4
4
  return [
@@ -167,4 +167,32 @@ export declare const DEFAULT_I18N_TEXT: {
167
167
  readonly ko: "홈으로 이동";
168
168
  readonly ru: "Вернуться на главную";
169
169
  };
170
+ readonly promptCopyText: {
171
+ readonly en: "Copy Prompt";
172
+ readonly zh: "复制 Prompt";
173
+ readonly ja: "Prompt をコピー";
174
+ readonly ko: "프롬프트 복사";
175
+ readonly ru: "Скопировать Prompt";
176
+ };
177
+ readonly promptCopiedText: {
178
+ readonly en: "Copied";
179
+ readonly zh: "已复制";
180
+ readonly ja: "コピーしました";
181
+ readonly ko: "복사됨";
182
+ readonly ru: "Скопировано";
183
+ };
184
+ readonly promptExpandText: {
185
+ readonly en: "Expand";
186
+ readonly zh: "展开";
187
+ readonly ja: "展開";
188
+ readonly ko: "펼치기";
189
+ readonly ru: "Развернуть";
190
+ };
191
+ readonly promptCollapseText: {
192
+ readonly en: "Collapse";
193
+ readonly zh: "折叠";
194
+ readonly ja: "折りたたむ";
195
+ readonly ko: "접기";
196
+ readonly ru: "Свернуть";
197
+ };
170
198
  };
@@ -166,6 +166,34 @@ const DEFAULT_I18N_TEXT = {
166
166
  ja: 'ホームに連れてって',
167
167
  ko: '홈으로 이동',
168
168
  ru: 'Вернуться на главную'
169
+ },
170
+ promptCopyText: {
171
+ en: 'Copy Prompt',
172
+ zh: '复制 Prompt',
173
+ ja: 'Prompt をコピー',
174
+ ko: '프롬프트 복사',
175
+ ru: 'Скопировать Prompt'
176
+ },
177
+ promptCopiedText: {
178
+ en: 'Copied',
179
+ zh: '已复制',
180
+ ja: 'コピーしました',
181
+ ko: '복사됨',
182
+ ru: 'Скопировано'
183
+ },
184
+ promptExpandText: {
185
+ en: 'Expand',
186
+ zh: '展开',
187
+ ja: '展開',
188
+ ko: '펼치기',
189
+ ru: 'Развернуть'
190
+ },
191
+ promptCollapseText: {
192
+ en: 'Collapse',
193
+ zh: '折叠',
194
+ ja: '折りたたむ',
195
+ ko: '접기',
196
+ ru: 'Свернуть'
169
197
  }
170
198
  };
171
199
  export { DEFAULT_I18N_TEXT };
@@ -1,6 +1,6 @@
1
1
  import { __webpack_require__ } from "../../0~rslib-runtime.js";
2
2
  import "../../8006.js";
3
- import { external_node_module_createRequire, join, logger } from "../../740.js";
3
+ import { external_node_module_createRequire, join, logger } from "../../2287.js";
4
4
  import { DEFAULT_I18N_TEXT } from "./DEFAULT_I18N_TEXT.js";
5
5
  import { createError } from "../utils/error.js";
6
6
  import { pathExists } from "../utils/fs.js";
@@ -1,4 +1,4 @@
1
- import { SEARCH_INDEX_NAME, groupBy } from "../../../740.js";
1
+ import { SEARCH_INDEX_NAME, groupBy } from "../../../2287.js";
2
2
  import { extractPageData } from "../../route/extractPageData.js";
3
3
  import { createHash } from "../../utils/createHash.js";
4
4
  function deletePrivateField(obj) {
@@ -1,4 +1,4 @@
1
- import { logger, pluginVirtualModule } from "../../../740.js";
1
+ import { logger, pluginVirtualModule } from "../../../2287.js";
2
2
  import { createPageData } from "./createPageData.js";
3
3
  const rsbuildPluginDocVM = async ({ config, userDocRoot, routeService, pluginDriver })=>{
4
4
  const ref = {
@@ -1,4 +1,4 @@
1
- import { node_path } from "../../740.js";
1
+ import { node_path } from "../../2287.js";
2
2
  const searchHookVMPlugin = (context)=>({
3
3
  ["virtual-search-hooks"]: ()=>{
4
4
  const { config } = context;
@@ -1,4 +1,4 @@
1
- import { getIconUrlPath } from "../../../740.js";
1
+ import { getIconUrlPath } from "../../../2287.js";
2
2
  import { normalizeThemeConfig } from "./normalizeThemeConfig.js";
3
3
  async function createSiteData(userConfig) {
4
4
  const tempSearchObj = Object.assign({}, userConfig.search);
@@ -1,4 +1,4 @@
1
- import { isExternalUrl, slash, addLeadingSlash, normalizeHref } from "../../../740.js";
1
+ import { isExternalUrl, slash, addLeadingSlash, normalizeHref } from "../../../2287.js";
2
2
  import { getI18nData } from "../i18n.js";
3
3
  import { applyReplaceRules } from "../../utils/applyReplaceRules.js";
4
4
  async function normalizeThemeConfig(docConfig) {
@@ -1,4 +1,4 @@
1
- import { logger } from "../../../740.js";
1
+ import { logger } from "../../../2287.js";
2
2
  import { modifyConfigWithAutoNavSide } from "../../auto-nav-sidebar/index.js";
3
3
  import { createSiteData } from "./createSiteData.js";
4
4
  const siteDataVMPlugin = (context)=>{
@@ -1,4 +1,4 @@
1
- import { mergeRsbuildConfig } from "../740.js";
1
+ import { mergeRsbuildConfig } from "../2287.js";
2
2
  import { PluginDriver } from "./PluginDriver.js";
3
3
  import { initRsbuild } from "./initRsbuild.js";
4
4
  import { RouteService } from "./route/RouteService.js";
@@ -1,7 +1,7 @@
1
1
  /*! LICENSE: renderPages.js.LICENSE.txt */
2
2
  import { __webpack_require__ } from "../../0~rslib-runtime.js";
3
3
  import "../../8006.js";
4
- import { chunk, logger } from "../../740.js";
4
+ import { chunk, logger } from "../../2287.js";
5
5
  import { SSGWorkerThreadTaskSize, getNumberOfThreads, SSGWorkerThreadRecyclerMaxMemory, SSGConcurrency } from "./ssgEnv.js";
6
6
  import { pMap } from "../../1688.js";
7
7
  import { renderPage } from "./renderPage.js";
@@ -1,4 +1,4 @@
1
- import { logger, writeFile, mkdir, rm, join, isDebugMode } from "../../740.js";
1
+ import { logger, writeFile, mkdir, rm, join, isDebugMode } from "../../2287.js";
2
2
  import { NODE_SSG_BUNDLE_FOLDER, NODE_SSG_BUNDLE_NAME } from "../constants.js";
3
3
  import { renderPages } from "./renderPages.js";
4
4
  const rsbuildPluginSSG = ({ routeService, config })=>({
@@ -1,5 +1,5 @@
1
1
  /*! LICENSE: ssgEnv.js.LICENSE.txt */
2
- import { node_os } from "../../740.js";
2
+ import { node_os } from "../../2287.js";
3
3
  /**
4
4
  * these codes are copied from
5
5
  * @link https://github.com/facebook/docusaurus/blob/45065e8d2b5831117b8d69fec1be28f5520cf105/packages/docusaurus/src/ssg/ssgEnv.ts#L11
@@ -1,4 +1,4 @@
1
- import { matchPath, getSidebarDataGroup } from "../../../740.js";
1
+ import { matchPath, getSidebarDataGroup } from "../../../2287.js";
2
2
  import { generateLlmsTxt, generateLlmsFullTxt } from "./llmsTxt.js";
3
3
  async function emitLlmsTxt(config, routeService, emitAsset, mdContents) {
4
4
  const base = config.base ?? '/';
@@ -1,4 +1,4 @@
1
- import { normalizeHref, logger, withBase } from "../../../740.js";
1
+ import { normalizeHref, logger, withBase } from "../../../2287.js";
2
2
  import { extractInfoFromFrontmatterWithAbsolutePath } from "../../auto-nav-sidebar/utils.js";
3
3
  function routePathToMdPath(routePath, base) {
4
4
  let url = routePath;
@@ -1,6 +1,6 @@
1
1
  import { __webpack_require__ } from "../../0~rslib-runtime.js";
2
2
  import "../../8006.js";
3
- import { createHead, pathToFileURL, logger } from "../../740.js";
3
+ import { createHead, pathToFileURL, logger } from "../../2287.js";
4
4
  import { hintSSGFailed } from "../logger/hint.js";
5
5
  const picocolors = __webpack_require__("../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js");
6
6
  var picocolors_default = /*#__PURE__*/ __webpack_require__.n(picocolors);
@@ -1,6 +1,6 @@
1
1
  import { __webpack_require__ } from "../../0~rslib-runtime.js";
2
2
  import "../../8006.js";
3
- import { logger } from "../../740.js";
3
+ import { logger } from "../../2287.js";
4
4
  import { pMap } from "../../1688.js";
5
5
  import { renderPage } from "./renderPage.js";
6
6
  import { SSGConcurrency } from "../ssg/ssgEnv.js";
@@ -1,4 +1,4 @@
1
- import { writeFile, mkdir, rm, join, isDebugMode } from "../../740.js";
1
+ import { writeFile, mkdir, rm, join, isDebugMode } from "../../2287.js";
2
2
  import { NODE_SSG_MD_BUNDLE_FOLDER, NODE_SSG_MD_BUNDLE_NAME } from "../constants.js";
3
3
  import { renderPages } from "./renderPages.js";
4
4
  import { emitLlmsTxt } from "./llms/emitLlmsTxt.js";
@@ -1,4 +1,4 @@
1
- import { node_path, logger, promises } from "../../740.js";
1
+ import { node_path, logger, promises } from "../../2287.js";
2
2
  import { createError } from "./error.js";
3
3
  function normalizePath(filePath) {
4
4
  return filePath.split(node_path.sep).join('/');
@@ -1,4 +1,4 @@
1
- import { createHash as external_node_crypto_createHash } from "../../740.js";
1
+ import { createHash as external_node_crypto_createHash } from "../../2287.js";
2
2
  function createHash(str) {
3
3
  return external_node_crypto_createHash('sha256').update(str).digest('hex').slice(0, 8);
4
4
  }