@rspress/core 2.1.0-beta.1 → 2.1.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 (133) hide show
  1. package/dist/cli/index.js +2 -2
  2. package/dist/config/loadConfigFile.js +1 -1
  3. package/dist/eject-theme/components/CdnTabs/index.test.tsx +71 -0
  4. package/dist/eject-theme/components/CdnTabs/index.tsx +175 -0
  5. package/dist/eject-theme/components/DocContent/index.tsx +0 -3
  6. package/dist/eject-theme/components/FallbackHeading/index.tsx +6 -1
  7. package/dist/eject-theme/components/Link/index.tsx +9 -18
  8. package/dist/eject-theme/components/Link/useLinkNavigate.ts +17 -3
  9. package/dist/eject-theme/components/NavTitle/index.test.tsx +78 -0
  10. package/dist/eject-theme/components/NavTitle/index.tsx +9 -5
  11. package/dist/eject-theme/components/PackageManagerTabs/index.test.tsx +79 -1
  12. package/dist/eject-theme/components/PackageManagerTabs/index.tsx +25 -12
  13. package/dist/eject-theme/components/Search/NoSearchResult.scss +1 -2
  14. package/dist/eject-theme/components/Search/SearchPanel.scss +75 -63
  15. package/dist/eject-theme/components/Search/SuggestItem.scss +28 -41
  16. package/dist/eject-theme/components/Sidebar/SidebarItem.scss +8 -0
  17. package/dist/eject-theme/components/Sidebar/SidebarSectionHeader.scss +3 -0
  18. package/dist/node/PluginDriver.d.ts +5 -0
  19. package/dist/node/PluginDriver.js +14 -5
  20. package/dist/node/auto-nav-sidebar/index.js +1 -1
  21. package/dist/node/auto-nav-sidebar/locales.js +1 -1
  22. package/dist/node/auto-nav-sidebar/normalize.js +1 -1
  23. package/dist/node/auto-nav-sidebar/utils.js +1 -1
  24. package/dist/node/auto-nav-sidebar/walk.js +1 -1
  25. package/dist/node/constants.js +1 -1
  26. package/dist/node/eject.js +1 -1
  27. package/dist/node/initRsbuild.js +12 -4
  28. package/dist/node/mdx/rehypePlugins/headerAnchor.js +1 -0
  29. package/dist/node/mdx/remarkPlugins/link.js +1 -1
  30. package/dist/node/route/RoutePage.js +1 -1
  31. package/dist/node/route/RouteService.js +1 -1
  32. package/dist/node/route/extractPageData.js +1 -1
  33. package/dist/node/route/normalizeRoutePath.js +1 -1
  34. package/dist/node/runtimeModule/{DEFAULT_I18N_TEXT.d.ts → i18n/DEFAULT_I18N_TEXT.d.ts} +34 -0
  35. package/dist/node/runtimeModule/{DEFAULT_I18N_TEXT.js → i18n/DEFAULT_I18N_TEXT.js} +68 -34
  36. package/dist/node/runtimeModule/i18n/getI18nData.d.ts +11 -0
  37. package/dist/node/runtimeModule/{i18n.js → i18n/getI18nData.js} +35 -22
  38. package/dist/node/runtimeModule/i18n/rsbuildPlugin.d.ts +5 -0
  39. package/dist/node/runtimeModule/i18n/rsbuildPlugin.js +21 -0
  40. package/dist/node/runtimeModule/pageData/createPageData.js +1 -1
  41. package/dist/node/runtimeModule/pageData/rsbuildPlugin.js +1 -1
  42. package/dist/node/runtimeModule/searchHooks.js +1 -1
  43. package/dist/node/runtimeModule/siteData/createSiteData.d.ts +2 -1
  44. package/dist/node/runtimeModule/siteData/createSiteData.js +3 -3
  45. package/dist/node/runtimeModule/siteData/normalizeThemeConfig.d.ts +2 -1
  46. package/dist/node/runtimeModule/siteData/normalizeThemeConfig.js +3 -4
  47. package/dist/node/runtimeModule/siteData/rsbuildPlugin.js +2 -2
  48. package/dist/node/serve.js +1 -1
  49. package/dist/node/sitemap.d.ts +7 -2
  50. package/dist/node/sitemap.js +40 -57
  51. package/dist/node/ssg/alternateLinks.js +1 -1
  52. package/dist/node/ssg/htmlFile.js +1 -1
  53. package/dist/node/ssg/renderHtmlTemplate.js +1 -1
  54. package/dist/node/ssg/renderPage.js +1 -1
  55. package/dist/node/ssg/renderPageWorker.js +1 -1
  56. package/dist/node/ssg/renderPages.js +2 -2
  57. package/dist/node/ssg/rsbuildPluginSSG.js +1 -1
  58. package/dist/node/ssg/ssgEnv.js +1 -1
  59. package/dist/node/ssg-md/llms/emitLlmsTxt.js +1 -1
  60. package/dist/node/ssg-md/llms/llmsTxt.js +1 -1
  61. package/dist/node/ssg-md/renderPage.js +1 -1
  62. package/dist/node/ssg-md/renderPages.js +2 -2
  63. package/dist/node/ssg-md/rsbuildPluginSSGMD.js +1 -1
  64. package/dist/node/utils/checkLanguageParity.js +1 -1
  65. package/dist/node/utils/createHash.js +1 -1
  66. package/dist/node/utils/flattenMdxContent.js +1 -1
  67. package/dist/node/utils/getPageKey.js +1 -1
  68. package/dist/node/utils/reactAlias.js +2 -2
  69. package/dist/{h~0.js → p~0.js} +6 -4
  70. package/dist/runtime/App.js +14 -10
  71. package/dist/runtime/BrowserOnly.d.ts +1 -1
  72. package/dist/runtime/BrowserOnly.js +53 -20
  73. package/dist/runtime/ClientApp.js +4 -0
  74. package/dist/runtime/NoSSR.d.ts +7 -3
  75. package/dist/runtime/NoSSR.js +30 -9
  76. package/dist/runtime/PageRoute.js +20 -8
  77. package/dist/runtime/index.d.ts +3 -2
  78. package/dist/runtime/index.js +3 -4
  79. package/dist/runtime/react.d.ts +5 -0
  80. package/dist/runtime/react.js +4 -0
  81. package/dist/runtime/reactDom.d.ts +6 -0
  82. package/dist/runtime/reactDom.js +2 -1
  83. package/dist/runtime/socialLinks.d.ts +1 -0
  84. package/dist/runtime/socialLinks.js +3 -0
  85. package/dist/theme/assets/bun.js +101 -0
  86. package/dist/theme/assets/deno.js +15 -0
  87. package/dist/theme/assets/jsdelivr.js +53 -0
  88. package/dist/theme/{components/PackageManagerTabs/icons/Npm.js → assets/npm.js} +4 -4
  89. package/dist/theme/{components/PackageManagerTabs/icons/Pnpm.js → assets/pnpm.js} +4 -4
  90. package/dist/theme/assets/unpkg.js +15 -0
  91. package/dist/theme/assets/yarn.js +22 -0
  92. package/dist/theme/components/CdnTabs/index.d.ts +10 -0
  93. package/dist/theme/components/CdnTabs/index.js +146 -0
  94. package/dist/theme/components/DocContent/index.js +1 -2
  95. package/dist/theme/components/FallbackHeading/index.js +1 -0
  96. package/dist/theme/components/Link/index.js +4 -13
  97. package/dist/theme/components/Link/useLinkNavigate.js +12 -4
  98. package/dist/theme/components/NavTitle/index.js +10 -5
  99. package/dist/theme/components/PackageManagerTabs/index.d.ts +2 -0
  100. package/dist/theme/components/PackageManagerTabs/index.js +22 -12
  101. package/dist/theme/components/Search/NoSearchResult.css +1 -2
  102. package/dist/theme/components/Search/SearchPanel.css +72 -51
  103. package/dist/theme/components/Search/SuggestItem.css +21 -34
  104. package/dist/theme/components/Sidebar/SidebarItem.css +5 -0
  105. package/dist/theme/components/Sidebar/SidebarSectionHeader.css +1 -0
  106. package/dist/theme/hooks/useDynamicToc.js +27 -34
  107. package/dist/theme/icons.d.ts +7 -0
  108. package/dist/theme/icons.js +15 -1
  109. package/dist/theme/index.d.ts +1 -2
  110. package/dist/theme/index.js +1 -2
  111. package/dist/theme/layout/Layout/index.js +1 -2
  112. package/dist/y~0.js +168 -0
  113. package/package.json +17 -17
  114. package/dist/b~0.js +0 -104
  115. package/dist/eject-theme/components/PackageManagerTabs/icons/Bun.tsx +0 -101
  116. package/dist/eject-theme/components/PackageManagerTabs/icons/Deno.tsx +0 -18
  117. package/dist/eject-theme/components/PackageManagerTabs/icons/Npm.tsx +0 -16
  118. package/dist/eject-theme/components/PackageManagerTabs/icons/Pnpm.tsx +0 -22
  119. package/dist/eject-theme/components/PackageManagerTabs/icons/Yarn.tsx +0 -18
  120. package/dist/node/runtimeModule/i18n.d.ts +0 -8
  121. package/dist/theme/components/PackageManagerTabs/icons/Bun.d.ts +0 -2
  122. package/dist/theme/components/PackageManagerTabs/icons/Bun.js +0 -137
  123. package/dist/theme/components/PackageManagerTabs/icons/Deno.d.ts +0 -2
  124. package/dist/theme/components/PackageManagerTabs/icons/Deno.js +0 -15
  125. package/dist/theme/components/PackageManagerTabs/icons/Npm.d.ts +0 -2
  126. package/dist/theme/components/PackageManagerTabs/icons/Pnpm.d.ts +0 -2
  127. package/dist/theme/components/PackageManagerTabs/icons/Yarn.d.ts +0 -2
  128. package/dist/theme/components/PackageManagerTabs/icons/Yarn.js +0 -22
  129. package/dist/theme/logic/useScrollAfterNav.d.ts +0 -5
  130. package/dist/theme/logic/useScrollAfterNav.js +0 -35
  131. package/dist/theme/logic/useScrollReset.d.ts +0 -5
  132. package/dist/theme/logic/useScrollReset.js +0 -12
  133. package/dist/tu~0.js +0 -3
@@ -3,6 +3,7 @@ export { Badge } from "./components/Badge/index.js";
3
3
  export { Banner } from "./components/Banner/index.js";
4
4
  export { Button } from "./components/Button/index.js";
5
5
  export { Callout } from "./components/Callout/index.js";
6
+ export { CdnTabs } from "./components/CdnTabs/index.js";
6
7
  export { CodeBlock } from "./components/CodeBlock/index.js";
7
8
  export { CodeBlockRuntime } from "./components/CodeBlockRuntime/index.js";
8
9
  export { CodeButtonGroup, useCodeButtonGroup } from "./components/CodeButtonGroup/index.js";
@@ -67,8 +68,6 @@ export { getCopyableText } from "./logic/getCopyableText.js";
67
68
  export { mergeRefs } from "./logic/mergeRefs.js";
68
69
  export { useFullTextSearch } from "./logic/useFullTextSearch.js";
69
70
  export { usePrevNextPage } from "./logic/usePrevNextPage.js";
70
- export { useScrollAfterNav } from "./logic/useScrollAfterNav.js";
71
- export { useScrollReset } from "./logic/useScrollReset.js";
72
71
  export { useSetup } from "./logic/useSetup.js";
73
72
  export { useStorageValue } from "./logic/useStorageValue.js";
74
73
  export { useThemeState } from "./logic/useThemeState.js";
@@ -1,6 +1,6 @@
1
1
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
2
  import { Content, useFrontmatter, useLocaleSiteData, usePage, useSite } from "@rspress/core/runtime";
3
- import { DocLayout, HomeLayout as theme_HomeLayout, Nav, NotFoundLayout as theme_NotFoundLayout, useScrollReset, useSetup } from "@rspress/core/theme";
3
+ import { DocLayout, HomeLayout as theme_HomeLayout, Nav, NotFoundLayout as theme_NotFoundLayout, useSetup } from "@rspress/core/theme";
4
4
  import { Head, useHead } from "@unhead/react";
5
5
  import react, { memo, useMemo } from "react";
6
6
  const concatTitle = (title, suffix)=>{
@@ -60,7 +60,6 @@ const HeadTags = /*#__PURE__*/ memo((props)=>{
60
60
  });
61
61
  const ClientEffects = ()=>{
62
62
  useSetup();
63
- useScrollReset();
64
63
  return null;
65
64
  };
66
65
  function Layout(props) {
package/dist/y~0.js ADDED
@@ -0,0 +1,168 @@
1
+ var package_namespaceObject = {
2
+ rE: "2.1.0"
3
+ };
4
+ function pMap(iterable, mapper, options) {
5
+ return mapConcurrently(iterable, mapper, options, false);
6
+ }
7
+ async function mapConcurrently(iterable, mapper, { concurrency = 1 / 0, stopOnError = true, signal } = {}, isSettled) {
8
+ return new Promise((resolve_, reject_)=>{
9
+ validateOptions(iterable, mapper, concurrency);
10
+ const result = [];
11
+ const errors = [];
12
+ let skippedCount = 0;
13
+ let isResolved = false;
14
+ let isIterableDone = false;
15
+ const pendingIndexes = new Set();
16
+ let doneIndex = 1 / 0;
17
+ let currentIndex = 0;
18
+ const iterator = getIterator(iterable);
19
+ const signalListener = ()=>{
20
+ reject(signal.reason);
21
+ };
22
+ const cleanup = ()=>{
23
+ signal?.removeEventListener('abort', signalListener);
24
+ };
25
+ const resolve = (value)=>{
26
+ resolve_(value);
27
+ cleanup();
28
+ };
29
+ const reject = (reason)=>{
30
+ if (isResolved) return;
31
+ isResolved = true;
32
+ reject_(reason);
33
+ cleanup();
34
+ if (!isIterableDone) closeIterator(iterator);
35
+ };
36
+ if (signal) {
37
+ if (signal.aborted) return void reject(signal.reason);
38
+ signal.addEventListener('abort', signalListener, {
39
+ once: true
40
+ });
41
+ }
42
+ const pull = createPuller(iterator);
43
+ const settleIfFinished = ()=>{
44
+ if (isResolved || 1 / 0 === doneIndex) return;
45
+ for (const index of pendingIndexes)if (index < doneIndex) return;
46
+ if (!stopOnError) {
47
+ const collectedErrors = [];
48
+ for(let index = 0; index < Math.min(doneIndex, errors.length); index++)if (index in errors) collectedErrors.push(errors[index]);
49
+ if (collectedErrors.length > 0) return void reject(new AggregateError(collectedErrors));
50
+ }
51
+ isResolved = true;
52
+ if (!isIterableDone) closeIterator(iterator);
53
+ const lastIndex = Math.min(doneIndex, result.length);
54
+ if (lastIndex === result.length && 0 === skippedCount) return void resolve(result);
55
+ resolve(result.slice(0, lastIndex).filter((value)=>value !== pMapSkip));
56
+ };
57
+ const next = async ()=>{
58
+ if (isResolved || currentIndex >= doneIndex) return;
59
+ const index = currentIndex++;
60
+ pendingIndexes.add(index);
61
+ let nextItem;
62
+ try {
63
+ nextItem = await pull();
64
+ } catch (error) {
65
+ pendingIndexes.delete(index);
66
+ if (index < doneIndex) throw error;
67
+ settleIfFinished();
68
+ return;
69
+ }
70
+ if (nextItem.done) {
71
+ pendingIndexes.delete(index);
72
+ doneIndex = Math.min(doneIndex, index);
73
+ isIterableDone = true;
74
+ settleIfFinished();
75
+ return;
76
+ }
77
+ const runner = (async ()=>{
78
+ try {
79
+ const element = await nextItem.value;
80
+ if (isResolved || index >= doneIndex) return;
81
+ const value = await mapper(element, index);
82
+ if (index >= doneIndex) return;
83
+ if (value === pMapStop) {
84
+ doneIndex = index;
85
+ return;
86
+ }
87
+ if (value === pMapSkip) skippedCount++;
88
+ result[index] = isSettled && value !== pMapSkip ? {
89
+ status: 'fulfilled',
90
+ value
91
+ } : value;
92
+ } catch (error) {
93
+ if (index >= doneIndex) return;
94
+ if (isSettled) result[index] = {
95
+ status: 'rejected',
96
+ reason: error
97
+ };
98
+ else {
99
+ if (stopOnError) return void reject(error);
100
+ errors[index] = error;
101
+ }
102
+ } finally{
103
+ pendingIndexes.delete(index);
104
+ settleIfFinished();
105
+ }
106
+ try {
107
+ await next();
108
+ } catch (error) {
109
+ reject(error);
110
+ }
111
+ })();
112
+ runner.then(()=>new Promise(()=>{})).then(resolve_);
113
+ };
114
+ (async ()=>{
115
+ for(let index = 0; index < concurrency; index++){
116
+ try {
117
+ await next();
118
+ } catch (error) {
119
+ reject(error);
120
+ break;
121
+ }
122
+ if (isResolved || currentIndex >= doneIndex) break;
123
+ }
124
+ })();
125
+ });
126
+ }
127
+ const pMapSkip = Symbol('skip');
128
+ const pMapStop = Symbol('stop');
129
+ function validateOptions(iterable, mapper, concurrency) {
130
+ if (iterable?.[Symbol.iterator] === void 0 && iterable?.[Symbol.asyncIterator] === void 0) throw new TypeError(`Expected \`input\` to be either an \`Iterable\` or \`AsyncIterable\`, got (${typeof iterable})`);
131
+ if ('function' != typeof mapper) throw new TypeError('Mapper function is required');
132
+ if (!isLimit(concurrency, 1)) throw new TypeError(`Expected \`concurrency\` to be an integer from 1 and up or \`Infinity\`, got \`${concurrency}\` (${typeof concurrency})`);
133
+ }
134
+ function isLimit(value, minimum) {
135
+ return Number.isSafeInteger(value) && value >= minimum || 1 / 0 === value;
136
+ }
137
+ function getIterator(iterable) {
138
+ return void 0 === iterable[Symbol.asyncIterator] ? iterable[Symbol.iterator]() : iterable[Symbol.asyncIterator]();
139
+ }
140
+ async function closeIterator(iterator) {
141
+ try {
142
+ await iterator.return?.();
143
+ } catch {}
144
+ }
145
+ function createPuller(iterator) {
146
+ let isSourceDone = false;
147
+ const markDone = (item)=>{
148
+ if (item?.done) isSourceDone = true;
149
+ };
150
+ return ()=>{
151
+ if (isSourceDone) return {
152
+ done: true
153
+ };
154
+ const result = iterator.next();
155
+ markDone(result);
156
+ if ('function' != typeof result?.then) return result;
157
+ const promise = Promise.resolve(result);
158
+ promise.then(markDone, ()=>{});
159
+ return promise;
160
+ };
161
+ }
162
+ export { getDefaultDarkModeValue, isDarkModeSwitchEnabled } from "@rspress/shared";
163
+ export { createRequire } from "node:module";
164
+ export { default as node_path, isAbsolute, posix, relative, resolve as external_node_path_resolve } from "node:path";
165
+ export { pathToFileURL } from "node:url";
166
+ export { logger } from "@rspress/shared/logger";
167
+ export { createHead, transformHtmlTemplate } from "@unhead/react/server";
168
+ export { pMap, package_namespaceObject };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rspress/core",
3
- "version": "2.1.0-beta.1",
3
+ "version": "2.1.0",
4
4
  "description": "The Rspress Documentation Framework",
5
5
  "bugs": "https://github.com/web-infra-dev/rspress/issues",
6
6
  "repository": {
@@ -60,32 +60,32 @@
60
60
  "dependencies": {
61
61
  "@mdx-js/mdx": "^3.1.1",
62
62
  "@mdx-js/react": "^3.1.1",
63
- "@rsbuild/core": "^2.2.12",
63
+ "@rsbuild/core": "^2.2.14",
64
64
  "@rsbuild/plugin-react": "~2.1.1",
65
- "@rspress/shared": "2.1.0-beta.1",
65
+ "@rspress/shared": "2.1.0",
66
66
  "@shikijs/rehype": "^4.2.0",
67
67
  "@types/mdast": "^4.0.4",
68
- "@types/react": "^19.2.18",
68
+ "@types/react": "^19.3.0",
69
69
  "@unhead/react": "^2.1.17",
70
70
  "body-scroll-lock": "4.0.0-beta.0",
71
71
  "clsx": "2.1.1",
72
72
  "copy-to-clipboard": "^3.3.3",
73
73
  "flexsearch": "0.8.212",
74
74
  "hast-util-heading-rank": "^3.0.0",
75
- "hast-util-to-jsx-runtime": "^2.3.6",
75
+ "hast-util-to-jsx-runtime": "^2.3.7",
76
76
  "mdast-util-mdx": "^3.0.0",
77
77
  "mdast-util-mdxjs-esm": "^2.0.1",
78
- "medium-zoom": "1.1.0",
78
+ "medium-zoom": "1.1.2",
79
79
  "nprogress": "^0.2.0",
80
- "react": "^19.2.8",
81
- "react-dom": "^19.2.8",
80
+ "react": "^19.3.1",
81
+ "react-dom": "^19.3.1",
82
82
  "react-lazy-with-preload": "^2.2.1",
83
83
  "react-render-to-markdown": "19.1.0",
84
- "react-router-dom": "^7.18.4",
84
+ "react-router-dom": "^7.18.5",
85
85
  "rehype-external-links": "^3.0.0",
86
86
  "rehype-raw": "^7.0.0",
87
- "remark-cjk-friendly": "^2.3.2",
88
- "remark-cjk-friendly-gfm-strikethrough": "^2.3.1",
87
+ "remark-cjk-friendly": "^2.3.3",
88
+ "remark-cjk-friendly-gfm-strikethrough": "^2.3.2",
89
89
  "remark-gfm": "^4.0.1",
90
90
  "remark-mdx": "^3.1.1",
91
91
  "remark-parse": "^11.0.0",
@@ -98,7 +98,7 @@
98
98
  "vfile": "^6.0.3"
99
99
  },
100
100
  "devDependencies": {
101
- "@microsoft/api-extractor": "^7.59.4",
101
+ "@microsoft/api-extractor": "^7.60.1",
102
102
  "@rsbuild/plugin-sass": "~2.0.1",
103
103
  "@rsbuild/plugin-svgr": "^2.0.5",
104
104
  "@rspress/config": "1.0.0",
@@ -106,16 +106,16 @@
106
106
  "@types/hast": "^3.0.5",
107
107
  "@types/node": "^22.8.1",
108
108
  "@types/nprogress": "^0.2.3",
109
- "@types/react-dom": "^19.2.7",
110
- "@types/web": "^0.0.358",
111
- "cac": "^7.0.1",
109
+ "@types/react-dom": "^19.3.0",
110
+ "@types/web": "^0.0.359",
111
+ "cac": "^7.1.0",
112
112
  "execa": "8.0.1",
113
113
  "mdast-util-directive": "^3.1.1",
114
114
  "mdast-util-mdx-expression": "^2.0.1",
115
115
  "memfs": "^4.80.0",
116
- "p-map": "^7.0.8",
116
+ "p-map": "^7.1.1",
117
117
  "picocolors": "^1.1.1",
118
- "postcss": "8.5.29",
118
+ "postcss": "8.5.32",
119
119
  "remark-directive": "^4.0.0",
120
120
  "rsbuild-plugin-publint": "^1.0.0",
121
121
  "rsbuild-plugin-virtual-module": "0.4.5",
package/dist/b~0.js DELETED
@@ -1,104 +0,0 @@
1
- var package_namespaceObject = /*#__PURE__*/ JSON.parse('{"rE":"2.1.0-beta.1"}');
2
- async function pMap(iterable, mapper, { concurrency = 1 / 0, stopOnError = true, signal } = {}) {
3
- return new Promise((resolve_, reject_)=>{
4
- if (void 0 === iterable[Symbol.iterator] && void 0 === iterable[Symbol.asyncIterator]) throw new TypeError(`Expected \`input\` to be either an \`Iterable\` or \`AsyncIterable\`, got (${typeof iterable})`);
5
- if ('function' != typeof mapper) throw new TypeError('Mapper function is required');
6
- if (!(Number.isSafeInteger(concurrency) && concurrency >= 1 || 1 / 0 === concurrency)) throw new TypeError(`Expected \`concurrency\` to be an integer from 1 and up or \`Infinity\`, got \`${concurrency}\` (${typeof concurrency})`);
7
- const result = [];
8
- const errors = [];
9
- const skippedIndexesMap = new Map();
10
- let isRejected = false;
11
- let isResolved = false;
12
- let isIterableDone = false;
13
- let resolvingCount = 0;
14
- let currentIndex = 0;
15
- const iterator = void 0 === iterable[Symbol.asyncIterator] ? iterable[Symbol.iterator]() : iterable[Symbol.asyncIterator]();
16
- const signalListener = ()=>{
17
- reject(signal.reason);
18
- };
19
- const cleanup = ()=>{
20
- signal?.removeEventListener('abort', signalListener);
21
- };
22
- const resolve = (value)=>{
23
- resolve_(value);
24
- cleanup();
25
- };
26
- const reject = (reason)=>{
27
- if (isResolved) return;
28
- isRejected = true;
29
- isResolved = true;
30
- reject_(reason);
31
- cleanup();
32
- if (!isIterableDone) closeIterator(iterator);
33
- };
34
- if (signal) {
35
- if (signal.aborted) return void reject(signal.reason);
36
- signal.addEventListener('abort', signalListener, {
37
- once: true
38
- });
39
- }
40
- const next = async ()=>{
41
- if (isResolved) return;
42
- const nextItem = isIterableDone ? {
43
- done: true
44
- } : await iterator.next();
45
- const index = currentIndex;
46
- currentIndex++;
47
- if (nextItem.done) {
48
- isIterableDone = true;
49
- if (0 === resolvingCount && !isResolved) {
50
- if (!stopOnError && errors.length > 0) return void reject(new AggregateError(errors));
51
- isResolved = true;
52
- if (0 === skippedIndexesMap.size) return void resolve(result);
53
- const pureResult = [];
54
- for (const [index, value] of result.entries())if (skippedIndexesMap.get(index) !== pMapSkip) pureResult.push(value);
55
- resolve(pureResult);
56
- }
57
- return;
58
- }
59
- resolvingCount++;
60
- (async ()=>{
61
- try {
62
- const element = await nextItem.value;
63
- if (isResolved) return;
64
- const value = await mapper(element, index);
65
- if (value === pMapSkip) skippedIndexesMap.set(index, value);
66
- result[index] = value;
67
- } catch (error) {
68
- if (stopOnError) return void reject(error);
69
- errors.push(error);
70
- }
71
- resolvingCount--;
72
- try {
73
- await next();
74
- } catch (error) {
75
- reject(error);
76
- }
77
- })();
78
- };
79
- (async ()=>{
80
- for(let index = 0; index < concurrency; index++){
81
- try {
82
- await next();
83
- } catch (error) {
84
- reject(error);
85
- break;
86
- }
87
- if (isIterableDone || isRejected) break;
88
- }
89
- })();
90
- });
91
- }
92
- const pMapSkip = Symbol('skip');
93
- async function closeIterator(iterator) {
94
- try {
95
- await iterator.return?.();
96
- } catch {}
97
- }
98
- export { getDefaultDarkModeValue, isDarkModeSwitchEnabled } from "@rspress/shared";
99
- export { createRequire } from "node:module";
100
- export { default as node_path, isAbsolute, posix, relative, resolve as external_node_path_resolve } from "node:path";
101
- export { pathToFileURL } from "node:url";
102
- export { logger } from "@rspress/shared/logger";
103
- export { createHead, transformHtmlTemplate } from "@unhead/react/server";
104
- export { pMap, package_namespaceObject };
@@ -1,101 +0,0 @@
1
- import type { ComponentProps } from 'react';
2
-
3
- export function Bun(props: ComponentProps<'svg'>) {
4
- return (
5
- <svg id="Bun" width="1.2em" height="1.2em" viewBox="0 0 80 70" {...props}>
6
- <path
7
- id="Shadow"
8
- d="M71.09,20.74c-.16-.17-.33-.34-.5-.5s-.33-.34-.5-.5-.33-.34-.5-.5-.33-.34-.5-.5-.33-.34-.5-.5-.33-.34-.5-.5-.33-.34-.5-.5A26.46,26.46,0,0,1,75.5,35.7c0,16.57-16.82,30.05-37.5,30.05-11.58,0-21.94-4.23-28.83-10.86l.5.5.5.5.5.5.5.5.5.5.5.5.5.5C19.55,65.3,30.14,69.75,42,69.75c20.68,0,37.5-13.48,37.5-30C79.5,32.69,76.46,26,71.09,20.74Z"
9
- />
10
- <g id="Body">
11
- <path
12
- id="Background"
13
- d="M73,35.7c0,15.21-15.67,27.54-35,27.54S3,50.91,3,35.7C3,26.27,9,17.94,18.22,13S33.18,3,38,3s8.94,4.13,19.78,10C67,17.94,73,26.27,73,35.7Z"
14
- style={{ fill: '#fbf0df' }}
15
- />
16
- <path
17
- id="Bottom_Shadow"
18
- data-name="Bottom Shadow"
19
- d="M73,35.7a21.67,21.67,0,0,0-.8-5.78c-2.73,33.3-43.35,34.9-59.32,24.94A40,40,0,0,0,38,63.24C57.3,63.24,73,50.89,73,35.7Z"
20
- style={{ fill: '#f6dece' }}
21
- />
22
- <path
23
- id="Light_Shine"
24
- data-name="Light Shine"
25
- d="M24.53,11.17C29,8.49,34.94,3.46,40.78,3.45A9.29,9.29,0,0,0,38,3c-2.42,0-5,1.25-8.25,3.13-1.13.66-2.3,1.39-3.54,2.15-2.33,1.44-5,3.07-8,4.7C8.69,18.13,3,26.62,3,35.7c0,.4,0,.8,0,1.19C9.06,15.48,20.07,13.85,24.53,11.17Z"
26
- style={{ fill: '#fffefc' }}
27
- />
28
- <path
29
- id="Top"
30
- d="M35.12,5.53A16.41,16.41,0,0,1,29.49,18c-.28.25-.06.73.3.59,3.37-1.31,7.92-5.23,6-13.14C35.71,5,35.12,5.12,35.12,5.53Zm2.27,0A16.24,16.24,0,0,1,39,19c-.12.35.31.65.55.36C41.74,16.56,43.65,11,37.93,5,37.64,4.74,37.19,5.14,37.39,5.49Zm2.76-.17A16.42,16.42,0,0,1,47,17.12a.33.33,0,0,0,.65.11c.92-3.49.4-9.44-7.17-12.53C40.08,4.54,39.82,5.08,40.15,5.32ZM21.69,15.76a16.94,16.94,0,0,0,10.47-9c.18-.36.75-.22.66.18-1.73,8-7.52,9.67-11.12,9.45C21.32,16.4,21.33,15.87,21.69,15.76Z"
31
- style={{ fill: '#ccbea7', fillRule: 'evenodd' }}
32
- />
33
- <path
34
- id="Outline"
35
- d="M38,65.75C17.32,65.75.5,52.27.5,35.7c0-10,6.18-19.33,16.53-24.92,3-1.6,5.57-3.21,7.86-4.62,1.26-.78,2.45-1.51,3.6-2.19C32,1.89,35,.5,38,.5s5.62,1.2,8.9,3.14c1,.57,2,1.19,3.07,1.87,2.49,1.54,5.3,3.28,9,5.27C69.32,16.37,75.5,25.69,75.5,35.7,75.5,52.27,58.68,65.75,38,65.75ZM38,3c-2.42,0-5,1.25-8.25,3.13-1.13.66-2.3,1.39-3.54,2.15-2.33,1.44-5,3.07-8,4.7C8.69,18.13,3,26.62,3,35.7,3,50.89,18.7,63.25,38,63.25S73,50.89,73,35.7C73,26.62,67.31,18.13,57.78,13,54,11,51.05,9.12,48.66,7.64c-1.09-.67-2.09-1.29-3-1.84C42.63,4,40.42,3,38,3Z"
36
- />
37
- </g>
38
- <g id="Mouth">
39
- <g id="Background-2" data-name="Background">
40
- <path
41
- d="M45.05,43a8.93,8.93,0,0,1-2.92,4.71,6.81,6.81,0,0,1-4,1.88A6.84,6.84,0,0,1,34,47.71,8.93,8.93,0,0,1,31.12,43a.72.72,0,0,1,.8-.81H44.26A.72.72,0,0,1,45.05,43Z"
42
- style={{ fill: '#b71422' }}
43
- />
44
- </g>
45
- <g id="Tongue">
46
- <path
47
- id="Background-3"
48
- data-name="Background"
49
- d="M34,47.79a6.91,6.91,0,0,0,4.12,1.9,6.91,6.91,0,0,0,4.11-1.9,10.63,10.63,0,0,0,1-1.07,6.83,6.83,0,0,0-4.9-2.31,6.15,6.15,0,0,0-5,2.78C33.56,47.4,33.76,47.6,34,47.79Z"
50
- style={{ fill: '#ff6164' }}
51
- />
52
- <path
53
- id="Outline-2"
54
- data-name="Outline"
55
- d="M34.16,47a5.36,5.36,0,0,1,4.19-2.08,6,6,0,0,1,4,1.69c.23-.25.45-.51.66-.77a7,7,0,0,0-4.71-1.93,6.36,6.36,0,0,0-4.89,2.36A9.53,9.53,0,0,0,34.16,47Z"
56
- />
57
- </g>
58
- <path
59
- id="Outline-3"
60
- data-name="Outline"
61
- d="M38.09,50.19a7.42,7.42,0,0,1-4.45-2,9.52,9.52,0,0,1-3.11-5.05,1.2,1.2,0,0,1,.26-1,1.41,1.41,0,0,1,1.13-.51H44.26a1.44,1.44,0,0,1,1.13.51,1.19,1.19,0,0,1,.25,1h0a9.52,9.52,0,0,1-3.11,5.05A7.42,7.42,0,0,1,38.09,50.19Zm-6.17-7.4c-.16,0-.2.07-.21.09a8.29,8.29,0,0,0,2.73,4.37A6.23,6.23,0,0,0,38.09,49a6.28,6.28,0,0,0,3.65-1.73,8.3,8.3,0,0,0,2.72-4.37.21.21,0,0,0-.2-.09Z"
62
- />
63
- </g>
64
- <g id="Face">
65
- <ellipse
66
- id="Right_Blush"
67
- data-name="Right Blush"
68
- cx="53.22"
69
- cy="40.18"
70
- rx="5.85"
71
- ry="3.44"
72
- style={{
73
- fill: '#febbd0',
74
- }}
75
- />
76
- <ellipse
77
- id="Left_Bluch"
78
- data-name="Left Bluch"
79
- cx="22.95"
80
- cy="40.18"
81
- rx="5.85"
82
- ry="3.44"
83
- style={{ fill: '#febbd0' }}
84
- />
85
- <path
86
- id="Eyes"
87
- d="M25.7,38.8a5.51,5.51,0,1,0-5.5-5.51A5.51,5.51,0,0,0,25.7,38.8Zm24.77,0A5.51,5.51,0,1,0,45,33.29,5.5,5.5,0,0,0,50.47,38.8Z"
88
- style={{ fillRule: 'evenodd' }}
89
- />
90
- <path
91
- id="Iris"
92
- d="M24,33.64a2.07,2.07,0,1,0-2.06-2.07A2.07,2.07,0,0,0,24,33.64Zm24.77,0a2.07,2.07,0,1,0-2.06-2.07A2.07,2.07,0,0,0,48.75,33.64Z"
93
- style={{
94
- fill: '#fff',
95
- fillRule: 'evenodd',
96
- }}
97
- />
98
- </g>
99
- </svg>
100
- );
101
- }
@@ -1,18 +0,0 @@
1
- import type { ComponentProps } from 'react';
2
-
3
- export function Deno(props: ComponentProps<'svg'>) {
4
- return (
5
- <svg
6
- xmlns="http://www.w3.org/2000/svg"
7
- width="1em"
8
- height="1em"
9
- viewBox="0 0 24 24"
10
- {...props}
11
- >
12
- <path
13
- fill="currentColor"
14
- d="M1.105 18.02A11.9 11.9 0 0 1 0 12.985q0-.698.078-1.376a12 12 0 0 1 .231-1.34A12 12 0 0 1 4.025 4.02a12 12 0 0 1 5.46-2.771a12 12 0 0 1 3.428-.23c1.452.112 2.825.477 4.077 1.05a12 12 0 0 1 2.78 1.774a12.02 12.02 0 0 1 4.053 7.078A12 12 0 0 1 24 12.985q0 .454-.036.914a12 12 0 0 1-.728 3.305a12 12 0 0 1-2.38 3.875c-1.33 1.357-3.02 1.962-4.43 1.936a4.4 4.4 0 0 1-2.724-1.024c-.99-.853-1.391-1.83-1.53-2.919a5 5 0 0 1 .128-1.518c.105-.38.37-1.116.76-1.437c-.455-.197-1.04-.624-1.226-.829c-.045-.05-.04-.13 0-.183a.155.155 0 0 1 .177-.053c.392.134.869.267 1.372.35c.66.111 1.484.25 2.317.292c2.03.1 4.153-.813 4.812-2.627s.403-3.609-1.96-4.685s-3.454-2.356-5.363-3.128c-1.247-.505-2.636-.205-4.06.582c-3.838 2.121-7.277 8.822-5.69 15.032a.191.191 0 0 1-.315.19a12 12 0 0 1-1.25-1.634a12 12 0 0 1-.769-1.404M11.57 6.087c.649-.051 1.214.501 1.31 1.236c.13.979-.228 1.99-1.41 2.013c-1.01.02-1.315-.997-1.248-1.614c.066-.616.574-1.575 1.35-1.635"
15
- />
16
- </svg>
17
- );
18
- }
@@ -1,16 +0,0 @@
1
- import type { ComponentProps } from 'react';
2
-
3
- export function Npm(props: ComponentProps<'svg'>) {
4
- return (
5
- <svg
6
- xmlns="http://www.w3.org/2000/svg"
7
- width="1em"
8
- height="1em"
9
- viewBox="0 0 256 256"
10
- {...props}
11
- >
12
- <path fill="#C12127" d="M0 256V0h256v256z"></path>
13
- <path fill="#FFF" d="M48 48h160v160h-32V80h-48v128H48z"></path>
14
- </svg>
15
- );
16
- }
@@ -1,22 +0,0 @@
1
- import type { ComponentProps } from 'react';
2
-
3
- export function Pnpm(props: ComponentProps<'svg'>) {
4
- return (
5
- <svg
6
- xmlns="http://www.w3.org/2000/svg"
7
- width="1em"
8
- height="1em"
9
- viewBox="0 0 128 128"
10
- {...props}
11
- >
12
- <path
13
- fill="#f8ab00"
14
- d="M0 .004V40h39.996V.004Zm43.996 0V40h40V.004Zm44.008 0V40H128V.004Zm0 43.996v39.996H128V44Z"
15
- ></path>
16
- <path
17
- fill="#4c4c4c"
18
- d="M43.996 44v39.996h40V44ZM0 87.996v40h39.996v-40Zm43.996 0v40h40v-40Zm44.008 0v40H128v-40Z"
19
- ></path>
20
- </svg>
21
- );
22
- }
@@ -1,18 +0,0 @@
1
- import type { ComponentProps } from 'react';
2
-
3
- export function Yarn(props: ComponentProps<'svg'>) {
4
- return (
5
- <svg
6
- xmlns="http://www.w3.org/2000/svg"
7
- width="1em"
8
- height="1em"
9
- viewBox="0 0 128 128"
10
- {...props}
11
- >
12
- <g fill="#2c8ebb">
13
- <path d="M99.24 80.71C94.9 80.76 91.1 83 87.89 85c-6 3.71-9 3.47-9 3.47l-.1-.17c-.41-.67 1.92-6.68-.69-13.84c-2.82-7.83-7.3-9.72-6.94-10.32c1.53-2.59 5.36-6.7 6.89-14.36c.91-4.64.67-12.28-1.39-16.28c-.38-.74-3.78 1.24-3.78 1.24s-3.18-7.09-4.07-7.66c-2.87-1.84-6 7.61-6 7.61a14 14 0 0 0-11.71 4.5a9.64 9.64 0 0 1-3.85 2.27c-.41.14-.91.12-2.15 3.47c-1.9 5.07 3.24 10.81 3.24 10.81s-6.13 4.33-8.4 9.72a24.78 24.78 0 0 0-1.75 11.68s-4.36 3.78-4.64 7.68a12.87 12.87 0 0 0 1.77 7.83a1.94 1.94 0 0 0 2.63.91s-2.9 3.38-.19 4.81c2.47 1.29 6.63 2 8.83-.19c1.6-1.6 1.92-5.17 2.51-6.63c.14-.34.62.57 1.08 1a10 10 0 0 0 1.36 1s-3.9 1.68-2.3 5.51c.53 1.27 2.42 2.08 5.51 2.06c1.15 0 13.76-.72 17.12-1.53a4.33 4.33 0 0 0 2.61-1.46a63 63 0 0 0 15.49-7c4.74-3.09 6.68-3.93 10.51-4.84c3.16-.75 2.95-5.65-1.24-5.58z"></path>
14
- <path d="M64 2a62 62 0 1 0 62 62A62 62 0 0 0 64 2zm37.3 87.83c-3.35.81-4.91 1.44-9.41 4.36a67 67 0 0 1-15.56 7.18a8.71 8.71 0 0 1-3.64 1.77c-3.81.93-16.88 1.63-17.91 1.63h-.24c-4 0-6.27-1.24-7.49-2.54c-3.4 1.7-7.8 1-11-.69a5.55 5.55 0 0 1-3-3.9a6 6 0 0 1 0-2.06a6.66 6.66 0 0 1-.79-1A16.38 16.38 0 0 1 30 84.52c.29-3.73 2.87-7.06 4.55-8.83A28.56 28.56 0 0 1 36.61 64a26.82 26.82 0 0 1 6.82-9c-1.65-2.78-3.33-7.06-1.7-11.42c1.17-3.11 2.13-4.84 4.24-5.58a6.84 6.84 0 0 0 2.51-1.34A17.65 17.65 0 0 1 60.34 31c.19-.48.41-1 .65-1.46c1.6-3.4 3.3-5.31 5.29-6a4.88 4.88 0 0 1 4.4.5c.65.43 1.48 1 3.9 6a4.69 4.69 0 0 1 2.85-.1a3.81 3.81 0 0 1 2.39 1.94c2.47 4.74 2.8 13.19 1.72 18.62a33.8 33.8 0 0 1-5.84 13.31a25.73 25.73 0 0 1 5.77 9.43a25.42 25.42 0 0 1 1.41 10.41A28.7 28.7 0 0 0 86 81.91c3.06-1.89 7.68-4.74 13.19-4.81a6.62 6.62 0 0 1 7 5.7a6.35 6.35 0 0 1-4.89 7.03z"></path>
15
- </g>
16
- </svg>
17
- );
18
- }
@@ -1,8 +0,0 @@
1
- import type { UserConfig } from '@rspress/shared';
2
- import type { PluginDriver } from '../PluginDriver.js';
3
- import { type VirtualModulePlugin } from './types.js';
4
- export declare function getI18nData(docConfig: UserConfig, pluginDriver?: PluginDriver): Promise<Record<string, Record<string, string>>>;
5
- /**
6
- * Generate i18n text for client runtime
7
- */
8
- export declare const i18nVMPlugin: VirtualModulePlugin;
@@ -1,2 +0,0 @@
1
- import type { ComponentProps } from 'react';
2
- export declare function Bun(props: ComponentProps<'svg'>): import("react").JSX.Element;