@rspress/core 2.0.10 → 2.0.12

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 (115) hide show
  1. package/dist/0~execa.js +1 -1
  2. package/dist/3323.js +8 -0
  3. package/dist/{2240.js → 6162.js} +1 -4
  4. package/dist/8006.js +1 -1
  5. package/dist/8857.js +1 -1
  6. package/dist/common-Qw-RoVFD.js +25 -0
  7. package/dist/eject-theme/components/Llms/LlmsContainer.tsx +1 -2
  8. package/dist/eject-theme/components/Llms/LlmsCopyButton.tsx +1 -2
  9. package/dist/eject-theme/components/Llms/LlmsViewOptions.tsx +1 -2
  10. package/dist/eject-theme/components/PackageManagerTabs/index.tsx +16 -17
  11. package/dist/eject-theme/components/Prompt/icons.tsx +1 -1
  12. package/dist/eject-theme/components/Prompt/index.scss +325 -380
  13. package/dist/eject-theme/components/Search/SearchPanel.tsx +1 -6
  14. package/dist/eject-theme/components/Search/logic/search.ts +10 -5
  15. package/dist/eject-theme/components/Search/logic/util.test.ts +20 -1
  16. package/dist/eject-theme/components/Search/logic/util.ts +4 -1
  17. package/dist/eject-theme/components/Sidebar/SidebarItem.tsx +1 -1
  18. package/dist/eject-theme/components/Tabs/index.tsx +48 -41
  19. package/dist/entry/process.d.ts +1 -0
  20. package/dist/entry/process.js +65 -0
  21. package/dist/entry/utils.d.ts +7 -0
  22. package/dist/entry/utils.js +2 -0
  23. package/dist/entry/worker.d.ts +1 -0
  24. package/dist/entry/worker.js +74 -0
  25. package/dist/index.d.ts +1 -1
  26. package/dist/index.js +1 -0
  27. package/dist/node/PluginDriver.js +1 -1
  28. package/dist/node/auto-nav-sidebar/index.js +1 -1
  29. package/dist/node/auto-nav-sidebar/locales.js +1 -1
  30. package/dist/node/auto-nav-sidebar/normalize.d.ts +1 -1
  31. package/dist/node/auto-nav-sidebar/normalize.js +1 -1
  32. package/dist/node/auto-nav-sidebar/utils.js +1 -1
  33. package/dist/node/auto-nav-sidebar/walk.js +1 -1
  34. package/dist/node/index.d.ts +1 -0
  35. package/dist/node/initRsbuild.js +1 -1
  36. package/dist/node/mdx/options.js +2 -1
  37. package/dist/node/mdx/processor.js +1 -1
  38. package/dist/node/mdx/rehypePlugins/codeMeta.js +1 -1
  39. package/dist/node/mdx/rehypePlugins/headerAnchor.js +1 -1
  40. package/dist/node/mdx/rehypePlugins/shiki.js +1 -1
  41. package/dist/node/mdx/rehypePlugins/transformers/add-title.js +3 -6
  42. package/dist/node/mdx/rehypePlugins/transformers/index.d.ts +1 -1
  43. package/dist/node/mdx/remarkPlugins/builtin.js +1 -1
  44. package/dist/node/mdx/remarkPlugins/containerSyntax.d.ts +1 -1
  45. package/dist/node/mdx/remarkPlugins/fileCodeBlock.d.ts +1 -0
  46. package/dist/node/mdx/remarkPlugins/fileCodeBlock.js +9 -4
  47. package/dist/node/mdx/remarkPlugins/image.d.ts +1 -1
  48. package/dist/node/mdx/remarkPlugins/image.js +2 -1
  49. package/dist/node/mdx/remarkPlugins/link.d.ts +1 -1
  50. package/dist/node/mdx/remarkPlugins/link.js +1 -1
  51. package/dist/node/route/RoutePage.js +1 -1
  52. package/dist/node/route/RouteService.js +1 -1
  53. package/dist/node/route/extractPageData.js +1 -1
  54. package/dist/node/route/normalizeRoutePath.js +1 -1
  55. package/dist/node/runtimeModule/DEFAULT_I18N_TEXT.d.ts +140 -140
  56. package/dist/node/runtimeModule/i18n.js +1 -1
  57. package/dist/node/runtimeModule/pageData/createPageData.js +1 -1
  58. package/dist/node/runtimeModule/pageData/rsbuildPlugin.d.ts +1 -1
  59. package/dist/node/runtimeModule/pageData/rsbuildPlugin.js +1 -1
  60. package/dist/node/runtimeModule/searchHooks.js +1 -1
  61. package/dist/node/runtimeModule/siteData/createSiteData.js +1 -1
  62. package/dist/node/runtimeModule/siteData/normalizeThemeConfig.js +1 -1
  63. package/dist/node/runtimeModule/siteData/rsbuildPlugin.js +1 -1
  64. package/dist/node/serve.js +1 -1
  65. package/dist/node/ssg/renderPages.js +2 -2
  66. package/dist/node/ssg/rsbuildPluginSSG.js +1 -1
  67. package/dist/node/ssg/ssgEnv.js +1 -1
  68. package/dist/node/ssg-md/llms/emitLlmsTxt.js +1 -1
  69. package/dist/node/ssg-md/llms/llmsTxt.js +1 -1
  70. package/dist/node/ssg-md/remarkSplitMdx.js +1 -1
  71. package/dist/node/ssg-md/renderPage.js +1 -1
  72. package/dist/node/ssg-md/renderPages.js +1 -1
  73. package/dist/node/ssg-md/rsbuildPluginSSGMD.js +1 -1
  74. package/dist/node/utils/checkLanguageParity.js +1 -1
  75. package/dist/node/utils/createHash.js +1 -1
  76. package/dist/node/utils/flattenMdxContent.js +1 -1
  77. package/dist/node/utils/getPageKey.js +1 -1
  78. package/dist/node/utils/reactAlias.js +1 -1
  79. package/dist/runtime/BrowserOnly.d.ts +7 -0
  80. package/dist/runtime/BrowserOnly.js +40 -0
  81. package/dist/runtime/BrowserOnly.test.d.ts +1 -0
  82. package/dist/runtime/index.d.ts +1 -0
  83. package/dist/runtime/index.js +1 -0
  84. package/dist/theme/components/DocContent/docComponents/a.d.ts +1 -1
  85. package/dist/theme/components/DocContent/docComponents/hr.d.ts +1 -1
  86. package/dist/theme/components/DocContent/docComponents/img.d.ts +1 -1
  87. package/dist/theme/components/DocContent/docComponents/index.d.ts +18 -18
  88. package/dist/theme/components/DocContent/docComponents/list.d.ts +3 -3
  89. package/dist/theme/components/DocContent/docComponents/paragraph.d.ts +3 -3
  90. package/dist/theme/components/DocContent/docComponents/table.d.ts +3 -3
  91. package/dist/theme/components/DocContent/docComponents/title.d.ts +6 -6
  92. package/dist/theme/components/Nav/hooks.d.ts +1 -1
  93. package/dist/theme/components/PackageManagerTabs/index.js +17 -17
  94. package/dist/theme/components/Prompt/icons.js +1 -1
  95. package/dist/theme/components/Prompt/index.css +11 -37
  96. package/dist/theme/components/Search/SearchPanel.js +1 -2
  97. package/dist/theme/components/Search/logic/search.js +5 -3
  98. package/dist/theme/components/Search/logic/util.js +2 -1
  99. package/dist/theme/components/Sidebar/SidebarItem.js +1 -0
  100. package/dist/theme/components/Tabs/index.d.ts +8 -4
  101. package/dist/theme/components/Tabs/index.js +19 -19
  102. package/dist/theme/layout/DocLayout/index.css +4 -0
  103. package/dist/theme/layout/DocLayout/index.js +3 -2
  104. package/dist/theme/logic/useThemeState.d.ts +5 -10
  105. package/dist/theme/logic/useThemeState.js +15 -20
  106. package/dist/utils-B--2TaWv.js +34 -0
  107. package/dist/utils-De75vAgL.js +7 -0
  108. package/package.json +13 -13
  109. package/dist/3425.js +0 -6
  110. package/dist/runtime/getSidebarDataGroup.test.js +0 -68
  111. package/dist/runtime/hooks/useWindowSize.test.js +0 -36
  112. package/dist/runtime/route.test.js +0 -154
  113. package/dist/runtime/utils.test.js +0 -34
  114. package/dist/theme/components/Search/logic/util.test.js +0 -51
  115. /package/dist/{2287.js → 2235.js} +0 -0
package/dist/0~execa.js CHANGED
@@ -8,7 +8,7 @@ import { createReadStream, createWriteStream, readFileSync } from "node:fs";
8
8
  import { setTimeout as promises_setTimeout } from "node:timers/promises";
9
9
  import { debuglog } from "node:util";
10
10
  import { __webpack_require__ } from "./0~rslib-runtime.js";
11
- import "./2287.js";
11
+ import "./2235.js";
12
12
  __webpack_require__.add({
13
13
  "../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/index.js" (module, __unused_rspack_exports, __webpack_require__) {
14
14
  const cp = __webpack_require__("child_process");
package/dist/3323.js ADDED
@@ -0,0 +1,8 @@
1
+ export { readFile } from "node:fs/promises";
2
+ export { default as node_path } from "node:path";
3
+ export { cwd } from "node:process";
4
+ export { logger } from "@rspress/shared/logger";
5
+ export { visit } from "unist-util-visit";
6
+ export { existsSync } from "node:fs";
7
+ export { addLeadingSlash, isDataUrl, isExternalUrl, isProduction, normalizeHref, parseUrl, withBase } from "@rspress/shared";
8
+ export { getNodeAttribute } from "@rspress/shared/node-utils";
@@ -1,6 +1,6 @@
1
1
  export { default as node_path } from "node:path";
2
2
  export { createProcessor, nodeTypes } from "@mdx-js/mdx";
3
- export { extractTextAndId, getNodeAttribute, loadFrontMatter } from "@rspress/shared/node-utils";
3
+ export { extractTextAndId, loadFrontMatter } from "@rspress/shared/node-utils";
4
4
  export { default as rehype } from "@shikijs/rehype";
5
5
  export { default as rehype_external_links } from "rehype-external-links";
6
6
  export { default as rehype_raw } from "rehype-raw";
@@ -15,6 +15,3 @@ export { default as github_slugger } from "@rspress/shared/github-slugger";
15
15
  export { headingRank } from "hast-util-heading-rank";
16
16
  export { transformerAddFold, transformerAddLang, transformerAddLineNumbers, transformerAddTitle, transformerAddWrapCode } from "@rspress/core/shiki-transformers";
17
17
  export { createCssVariablesTheme } from "shiki";
18
- export { existsSync } from "node:fs";
19
- export { isDataUrl, isExternalUrl, isProduction, parseUrl } from "@rspress/shared";
20
- export { logger } from "@rspress/shared/logger";
package/dist/8006.js CHANGED
@@ -68,7 +68,7 @@ __webpack_require__.add({
68
68
  }
69
69
  });
70
70
  var package_namespaceObject = {
71
- rE: "2.0.10"
71
+ rE: "2.0.12"
72
72
  };
73
73
  export { default as promises, readFile } from "node:fs/promises";
74
74
  export { default as node_path, join, relative } from "node:path";
package/dist/8857.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /*! LICENSE: 8857.js.LICENSE.txt */
2
2
  import { __webpack_require__ } from "./0~rslib-runtime.js";
3
- import "./2287.js";
3
+ import "./2235.js";
4
4
  import { createRequire as __rspack_createRequire } from "node:module";
5
5
  const __rspack_createRequire_require = __rspack_createRequire(import.meta.url);
6
6
  __webpack_require__.add({
@@ -0,0 +1,25 @@
1
+ const kMovable = Symbol("Tinypool.kMovable");
2
+ const kTransferable = Symbol.for("Tinypool.transferable");
3
+ const kValue = Symbol.for("Tinypool.valueOf");
4
+ const kQueueOptions = Symbol.for("Tinypool.queueOptions");
5
+ function isTransferable(value) {
6
+ return null != value && "object" == typeof value && kTransferable in value && kValue in value;
7
+ }
8
+ function isMovable(value) {
9
+ return isTransferable(value) && true === value[kMovable];
10
+ }
11
+ function markMovable(value) {
12
+ Object.defineProperty(value, kMovable, {
13
+ enumerable: false,
14
+ configurable: true,
15
+ writable: true,
16
+ value: true
17
+ });
18
+ }
19
+ function isTaskQueue(value) {
20
+ return "object" == typeof value && null !== value && "size" in value && "function" == typeof value.shift && "function" == typeof value.remove && "function" == typeof value.push;
21
+ }
22
+ const kRequestCountField = 0;
23
+ const kResponseCountField = 1;
24
+ const kFieldCount = 2;
25
+ export { isMovable, isTaskQueue, isTransferable, kFieldCount, kQueueOptions, kRequestCountField, kResponseCountField, kTransferable, kValue, markMovable };
@@ -1,8 +1,7 @@
1
1
  import type React from 'react';
2
2
  import './LlmsContainer.scss';
3
3
 
4
- export interface LlmsContainerProps
5
- extends React.HTMLAttributes<HTMLDivElement> {}
4
+ export interface LlmsContainerProps extends React.HTMLAttributes<HTMLDivElement> {}
6
5
 
7
6
  export function LlmsContainer(props: LlmsContainerProps) {
8
7
  return <div {...props} className={'rp-not-doc rp-llms-container'} />;
@@ -15,8 +15,7 @@ import './index.scss';
15
15
  import './LlmsCopyButton.scss';
16
16
  import { useMdUrl } from './useMdUrl';
17
17
 
18
- export interface LlmsCopyButtonProps
19
- extends React.ButtonHTMLAttributes<HTMLButtonElement> {
18
+ export interface LlmsCopyButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
20
19
  /**
21
20
  * Text by language, used with `useLang`.
22
21
  * @default en: 'Copy Markdown', zh: '\u590d\u5236 Markdown'
@@ -32,8 +32,7 @@ type Option =
32
32
  | 'chatgpt'
33
33
  | 'claude';
34
34
 
35
- export interface LlmsViewOptionsProps
36
- extends React.ButtonHTMLAttributes<HTMLButtonElement> {
35
+ export interface LlmsViewOptionsProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
37
36
  /**
38
37
  * Default options for the dropdown.
39
38
  * @default ['markdownLink', 'chatgpt', 'claude']
@@ -231,27 +231,26 @@ export function PackageManagerTabs({
231
231
  }
232
232
 
233
233
  return (
234
- <Tabs
235
- groupId="package.manager"
236
- values={Object.entries(commandInfo).map(([key]) => (
237
- <div
238
- key={key}
239
- style={{
240
- display: 'flex',
241
- alignItems: 'center',
242
- fontSize: 15,
243
- }}
244
- >
245
- {packageMangerToIcon[key]}
246
- <span style={{ marginLeft: 6, marginBottom: 2 }}>{key}</span>
247
- </div>
248
- ))}
249
- >
234
+ <Tabs groupId="package.manager">
250
235
  {Object.entries(commandInfo).map(([key, value]) => {
251
236
  const [packageManager, command] = splitTo2Parts(value);
252
237
 
253
238
  return (
254
- <Tab key={key}>
239
+ <Tab
240
+ key={key}
241
+ label={
242
+ <div
243
+ style={{
244
+ display: 'flex',
245
+ alignItems: 'center',
246
+ fontSize: 15,
247
+ }}
248
+ >
249
+ {packageMangerToIcon[key]}
250
+ <span style={{ marginLeft: 6, marginBottom: 2 }}>{key}</span>
251
+ </div>
252
+ }
253
+ >
255
254
  <Pre
256
255
  lang="bash"
257
256
  className="shiki css-variables"
@@ -50,7 +50,7 @@ export const AGENT_ICONS: AgentIcon[] = [
50
50
  },
51
51
  {
52
52
  name: 'Cursor',
53
- color: '#434343',
53
+ color: '#737373',
54
54
  svg: (
55
55
  <svg
56
56
  aria-hidden="true"