@rspress/core 2.0.20 → 2.0.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/index.js +12 -13
- package/dist/config/loadConfigFile.d.ts +3 -4
- package/dist/config/loadConfigFile.js +13 -17
- package/dist/{7748~0.js → d~0.js} +0 -2
- package/dist/eject-theme/components/Banner/index.tsx +50 -9
- package/dist/eject-theme/components/Callout/index.scss +6 -1
- package/dist/eject-theme/components/CodeBlock/index.scss +2 -0
- package/dist/eject-theme/components/DocContent/doc.scss +2 -2
- package/dist/eject-theme/components/Link/getHref.test.ts +33 -0
- package/dist/eject-theme/components/Link/getHref.ts +60 -0
- package/dist/eject-theme/components/Link/index.tsx +7 -6
- package/dist/eject-theme/components/Link/useLinkNavigate.ts +6 -51
- package/dist/eject-theme/components/Llms/LlmsHint.test.tsx +8 -0
- package/dist/eject-theme/components/Llms/LlmsHint.tsx +11 -3
- package/dist/eject-theme/components/Nav/NavMenu.scss +19 -3
- package/dist/eject-theme/components/Nav/NavMenu.tsx +20 -13
- package/dist/eject-theme/components/Nav/index.scss +3 -1
- package/dist/eject-theme/components/Nav/index.tsx +30 -4
- package/dist/eject-theme/components/NavHamburger/index.tsx +11 -3
- package/dist/eject-theme/components/NavList/context.ts +3 -0
- package/dist/eject-theme/components/NavList/index.tsx +24 -0
- package/dist/eject-theme/components/NavScreen/NavScreenMenu.test.tsx +59 -0
- package/dist/eject-theme/components/NavScreen/NavScreenMenu.tsx +43 -2
- package/dist/eject-theme/components/NavScreen/index.scss +0 -6
- package/dist/eject-theme/components/NavScreen/index.tsx +20 -3
- package/dist/eject-theme/components/Prompt/index.scss +2 -1
- package/dist/eject-theme/components/ReadPercent/useReadPercent.ts +1 -1
- package/dist/eject-theme/components/Search/SearchButton.scss +1 -0
- package/dist/eject-theme/components/Search/SearchPanel.scss +51 -12
- package/dist/eject-theme/components/Search/SearchPanel.tsx +54 -212
- package/dist/eject-theme/components/Search/logic/providers/LocalProvider.ts +38 -16
- package/dist/eject-theme/components/Search/useSearchPanel.ts +216 -0
- package/dist/eject-theme/components/Steps/index.scss +1 -1
- package/dist/eject-theme/components/SwitchAppearance/getClipPath.test.ts +15 -0
- package/dist/eject-theme/components/SwitchAppearance/getClipPath.ts +26 -0
- package/dist/eject-theme/components/SwitchAppearance/global.scss +18 -0
- package/dist/eject-theme/components/SwitchAppearance/index.tsx +26 -35
- package/dist/eject-theme/components/Tabs/index.tsx +14 -14
- package/dist/index.js +1 -1
- package/dist/node/PluginDriver.d.ts +1 -1
- package/dist/node/PluginDriver.js +5 -9
- package/dist/node/auto-nav-sidebar/index.js +1 -1
- package/dist/node/auto-nav-sidebar/locales.js +1 -1
- package/dist/node/auto-nav-sidebar/normalize.js +6 -6
- package/dist/node/auto-nav-sidebar/utils.js +1 -1
- package/dist/node/auto-nav-sidebar/walk.js +1 -1
- package/dist/node/build.d.ts +3 -2
- package/dist/node/build.js +9 -3
- package/dist/node/constants.js +1 -1
- package/dist/node/dev.d.ts +4 -4
- package/dist/node/dev.js +8 -6
- package/dist/node/eject.js +5 -5
- package/dist/node/initRsbuild.d.ts +2 -3
- package/dist/node/initRsbuild.js +9 -7
- package/dist/node/last-updated/index.js +2 -2
- package/dist/node/logger/hint.js +4 -4
- package/dist/node/mdx/options.js +1 -1
- package/dist/node/mdx/processor.js +3 -3
- package/dist/node/mdx/rehypePlugins/codeMeta.js +1 -1
- package/dist/node/mdx/rehypePlugins/headerAnchor.js +1 -1
- package/dist/node/mdx/rehypePlugins/shiki.js +1 -1
- package/dist/node/mdx/remarkPlugins/builtin.js +1 -1
- package/dist/node/mdx/remarkPlugins/containerSyntax.js +6 -5
- package/dist/node/mdx/remarkPlugins/fileCodeBlock.js +5 -5
- package/dist/node/mdx/remarkPlugins/image.js +5 -5
- package/dist/node/mdx/remarkPlugins/link.js +5 -5
- package/dist/node/mdx/remarkPlugins/toc.js +1 -1
- package/dist/node/medium-zoom/index.js +1 -1
- package/dist/node/route/RoutePage.js +6 -4
- package/dist/node/route/RouteService.js +3 -3
- package/dist/node/route/extractPageData.js +20 -7
- package/dist/node/route/normalizeRoutePath.js +1 -1
- package/dist/node/runtimeModule/i18n.js +5 -5
- package/dist/node/runtimeModule/pageData/createPageData.js +1 -1
- package/dist/node/runtimeModule/pageData/rsbuildPlugin.js +1 -1
- package/dist/node/runtimeModule/searchHooks.js +1 -1
- package/dist/node/runtimeModule/siteData/createSiteData.js +1 -1
- package/dist/node/runtimeModule/siteData/normalizeThemeConfig.js +1 -1
- package/dist/node/runtimeModule/siteData/rsbuildPlugin.js +1 -1
- package/dist/node/serve.d.ts +3 -3
- package/dist/node/serve.js +10 -4
- package/dist/node/ssg/alternateLinks.js +1 -1
- package/dist/node/ssg/htmlFile.js +1 -1
- package/dist/node/ssg/renderHtmlTemplate.js +1 -1
- package/dist/node/ssg/renderPage.js +5 -5
- package/dist/node/ssg/renderPageWorker.js +2 -2
- package/dist/node/ssg/renderPages.js +6 -6
- package/dist/node/ssg/rsbuildPluginSSG.js +1 -1
- package/dist/node/ssg/ssgEnv.js +1 -1
- package/dist/node/ssg-md/llms/emitLlmsTxt.js +1 -1
- package/dist/node/ssg-md/llms/llmsTxt.js +1 -1
- package/dist/node/ssg-md/remarkSplitMdx.js +1 -1
- package/dist/node/ssg-md/renderPage.js +5 -5
- package/dist/node/ssg-md/renderPages.js +6 -6
- package/dist/node/ssg-md/rsbuildPluginSSGMD.js +1 -1
- package/dist/node/utils/checkLanguageParity.js +5 -7
- package/dist/node/utils/createHash.js +1 -1
- package/dist/node/utils/error.js +4 -4
- package/dist/node/utils/flattenMdxContent.js +2 -2
- package/dist/node/utils/fs.js +1 -1
- package/dist/node/utils/getPageKey.js +1 -1
- package/dist/node/utils/index.d.ts +1 -1
- package/dist/node/utils/reactAlias.js +5 -5
- package/dist/node/utils/slash.d.ts +1 -0
- package/dist/node/utils/slash.js +4 -0
- package/dist/{864~0.js → n~0.js} +41 -41
- package/dist/{2711~0.js → o~0.js} +90 -56
- package/dist/rslib-runtime~0.js +27 -35
- package/dist/theme/components/Banner/index.js +53 -9
- package/dist/theme/components/Callout/index.css +6 -1
- package/dist/theme/components/CodeBlock/index.css +2 -0
- package/dist/theme/components/DocContent/doc.css +2 -2
- package/dist/theme/components/Link/getHref.d.ts +8 -0
- package/dist/theme/components/Link/getHref.js +33 -0
- package/dist/theme/components/Link/index.js +7 -6
- package/dist/theme/components/Link/useLinkNavigate.d.ts +0 -7
- package/dist/theme/components/Link/useLinkNavigate.js +8 -32
- package/dist/theme/components/Llms/LlmsHint.js +23 -6
- package/dist/theme/components/Nav/NavMenu.css +18 -6
- package/dist/theme/components/Nav/NavMenu.d.ts +4 -2
- package/dist/theme/components/Nav/NavMenu.js +17 -9
- package/dist/theme/components/Nav/index.css +3 -1
- package/dist/theme/components/Nav/index.d.ts +7 -1
- package/dist/theme/components/Nav/index.js +13 -4
- package/dist/theme/components/NavHamburger/index.d.ts +2 -1
- package/dist/theme/components/NavHamburger/index.js +8 -2
- package/dist/theme/components/NavList/context.d.ts +1 -0
- package/dist/theme/components/NavList/context.js +3 -0
- package/dist/theme/components/NavList/index.d.ts +6 -0
- package/dist/theme/components/NavList/index.js +17 -0
- package/dist/theme/components/NavScreen/NavScreenMenu.d.ts +3 -2
- package/dist/theme/components/NavScreen/NavScreenMenu.js +42 -6
- package/dist/theme/components/NavScreen/index.css +0 -10
- package/dist/theme/components/NavScreen/index.d.ts +2 -1
- package/dist/theme/components/NavScreen/index.js +11 -3
- package/dist/theme/components/PackageManagerTabs/index.js +2 -2
- package/dist/theme/components/Prompt/index.css +2 -1
- package/dist/theme/components/ReadPercent/useReadPercent.js +1 -0
- package/dist/theme/components/Search/SearchButton.css +1 -0
- package/dist/theme/components/Search/SearchPanel.css +47 -9
- package/dist/theme/components/Search/SearchPanel.js +97 -205
- package/dist/theme/components/Search/logic/providers/LocalProvider.d.ts +1 -0
- package/dist/theme/components/Search/logic/providers/LocalProvider.js +23 -13
- package/dist/theme/components/Search/logic/search.js +1 -1
- package/dist/theme/components/Search/useSearchPanel.d.ts +23 -0
- package/dist/theme/components/Search/useSearchPanel.js +155 -0
- package/dist/theme/components/Steps/index.css +3 -3
- package/dist/theme/components/SwitchAppearance/getClipPath.d.ts +8 -0
- package/dist/theme/components/SwitchAppearance/getClipPath.js +13 -0
- package/dist/theme/components/SwitchAppearance/global.css +12 -0
- package/dist/theme/components/SwitchAppearance/index.js +11 -15
- package/dist/theme/components/Tabs/index.js +4 -4
- package/dist/theme/components/Tag/index.js +2 -2
- package/dist/theme/index.d.ts +1 -0
- package/dist/theme/index.js +1 -0
- package/dist/theme/layout/DocLayout/index.js +2 -2
- package/dist/theme/layout/Layout/index.js +12 -4
- package/dist/theme/logic/applyThemeToDOM.d.ts +2 -0
- package/dist/theme/logic/applyThemeToDOM.js +17 -0
- package/dist/theme/logic/useFullTextSearch.js +6 -1
- package/dist/theme/logic/useThemeState.d.ts +1 -2
- package/dist/theme/logic/useThemeState.js +1 -7
- package/dist/theme/styles/vars/shiki-vars.css +1 -1
- package/dist/tinypool~0.js +5 -3
- package/dist/{4538~0.js → t~0.js} +2 -2
- package/dist/{8472~0.js → v~0.js} +1 -1
- package/package.json +11 -12
- package/dist/eject-theme/components/NavScreen/NavScreenMenuOthers.tsx +0 -29
- package/dist/node/utils/normalizePath.d.ts +0 -3
- package/dist/node/utils/normalizePath.js +0 -10
- package/dist/theme/components/NavScreen/NavScreenMenuOthers.d.ts +0 -2
- package/dist/theme/components/NavScreen/NavScreenMenuOthers.js +0 -30
- package/dist/theme/logic/useHandler.d.ts +0 -6
- package/dist/theme/logic/useHandler.js +0 -7
- /package/dist/{9857~0.js → 4~0.js} +0 -0
- /package/dist/{8016~0.js → i~0.js} +0 -0
- /package/dist/{5357~0.js → r~0.js} +0 -0
- /package/dist/{102~0.js → t2~0.js} +0 -0
- /package/dist/{9940~0.js → tx~0.js} +0 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { describe, expect, it } from '@rstest/core';
|
|
2
|
+
import { getClipPath } from './getClipPath';
|
|
3
|
+
|
|
4
|
+
describe('getClipPath', () => {
|
|
5
|
+
it('uses percentages relative to the view transition snapshot', () => {
|
|
6
|
+
expect(
|
|
7
|
+
getClipPath({
|
|
8
|
+
height: 600,
|
|
9
|
+
width: 800,
|
|
10
|
+
x: 800,
|
|
11
|
+
y: 0,
|
|
12
|
+
}),
|
|
13
|
+
).toEqual(['circle(0% at 100% 0%)', 'circle(160% at 100% 0%)']);
|
|
14
|
+
});
|
|
15
|
+
});
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
type ClipPathOptions = {
|
|
2
|
+
height: number;
|
|
3
|
+
width: number;
|
|
4
|
+
x: number;
|
|
5
|
+
y: number;
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
const roundPercentage = (value: number) => Math.round(value * 1e6) / 1e6;
|
|
9
|
+
|
|
10
|
+
export const getClipPath = ({ height, width, x, y }: ClipPathOptions) => {
|
|
11
|
+
const endRadius = Math.hypot(
|
|
12
|
+
Math.max(x, width - x + 200),
|
|
13
|
+
Math.max(y, height - y + 200),
|
|
14
|
+
);
|
|
15
|
+
const normalizedDiagonal = Math.hypot(width, height) / Math.SQRT2;
|
|
16
|
+
const xPercentage = roundPercentage((x / width) * 100);
|
|
17
|
+
const yPercentage = roundPercentage((y / height) * 100);
|
|
18
|
+
const endRadiusPercentage = roundPercentage(
|
|
19
|
+
(endRadius / normalizedDiagonal) * 100,
|
|
20
|
+
);
|
|
21
|
+
|
|
22
|
+
return [
|
|
23
|
+
`circle(0% at ${xPercentage}% ${yPercentage}%)`,
|
|
24
|
+
`circle(${endRadiusPercentage}% at ${xPercentage}% ${yPercentage}%)`,
|
|
25
|
+
];
|
|
26
|
+
};
|
|
@@ -4,6 +4,24 @@
|
|
|
4
4
|
mix-blend-mode: normal;
|
|
5
5
|
}
|
|
6
6
|
|
|
7
|
+
/* Toggled by applyThemeToDOM for one frame while the theme class flips, so
|
|
8
|
+
every themed surface switches in sync instead of fading at its own pace.
|
|
9
|
+
A static rule toggled via a root class (rather than an injected <style>)
|
|
10
|
+
stays compatible with strict CSP. */
|
|
11
|
+
html.rp-theme-switching *,
|
|
12
|
+
html.rp-theme-switching *::before,
|
|
13
|
+
html.rp-theme-switching *::after,
|
|
14
|
+
html.rp-theme-switching *::-webkit-scrollbar-thumb {
|
|
15
|
+
transition: none !important;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/* Toggled by SwitchAppearance while the appearance view transition runs; the
|
|
19
|
+
'flip' and 'root' view-transition names conflict otherwise, see
|
|
20
|
+
https://github.com/web-infra-dev/rspress/pull/1272 */
|
|
21
|
+
html.rp-appearance-transition .rspress-doc {
|
|
22
|
+
view-transition-name: none !important;
|
|
23
|
+
}
|
|
24
|
+
|
|
7
25
|
::view-transition-old(root),
|
|
8
26
|
.dark::view-transition-new(root) {
|
|
9
27
|
z-index: 1;
|
|
@@ -4,6 +4,7 @@ import { type MouseEvent, useContext } from 'react';
|
|
|
4
4
|
import './global.scss';
|
|
5
5
|
import './index.scss';
|
|
6
6
|
import { flushSync } from 'react-dom';
|
|
7
|
+
import { getClipPath } from './getClipPath';
|
|
7
8
|
|
|
8
9
|
const supportAppearanceTransition = () => {
|
|
9
10
|
return (
|
|
@@ -12,17 +13,12 @@ const supportAppearanceTransition = () => {
|
|
|
12
13
|
);
|
|
13
14
|
};
|
|
14
15
|
|
|
15
|
-
//
|
|
16
|
+
// Toggles the `html.rp-appearance-transition` rule in global.scss — see the
|
|
17
|
+
// comment there and https://github.com/web-infra-dev/rspress/pull/1272
|
|
16
18
|
const removeClipViewTransition = () => {
|
|
17
|
-
|
|
18
|
-
styleDom.innerHTML = `
|
|
19
|
-
.rspress-doc {
|
|
20
|
-
view-transition-name: none !important;
|
|
21
|
-
}
|
|
22
|
-
`;
|
|
23
|
-
document.head.appendChild(styleDom);
|
|
19
|
+
document.documentElement.classList.add('rp-appearance-transition');
|
|
24
20
|
return () => {
|
|
25
|
-
document.
|
|
21
|
+
document.documentElement.classList.remove('rp-appearance-transition');
|
|
26
22
|
};
|
|
27
23
|
};
|
|
28
24
|
|
|
@@ -41,11 +37,6 @@ export function SwitchAppearance({ onClick }: { onClick?: () => void }) {
|
|
|
41
37
|
const x = event.clientX;
|
|
42
38
|
const y = event.clientY;
|
|
43
39
|
|
|
44
|
-
const endRadius = Math.hypot(
|
|
45
|
-
Math.max(x, innerWidth - x + 200),
|
|
46
|
-
Math.max(y, innerHeight - y + 200),
|
|
47
|
-
);
|
|
48
|
-
|
|
49
40
|
const dispose = removeClipViewTransition();
|
|
50
41
|
const transition = document.startViewTransition(async () => {
|
|
51
42
|
flushSync(() => {
|
|
@@ -54,30 +45,30 @@ export function SwitchAppearance({ onClick }: { onClick?: () => void }) {
|
|
|
54
45
|
});
|
|
55
46
|
});
|
|
56
47
|
|
|
57
|
-
const clipPath =
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
48
|
+
const clipPath = getClipPath({
|
|
49
|
+
height: innerHeight,
|
|
50
|
+
width: innerWidth,
|
|
51
|
+
x,
|
|
52
|
+
y,
|
|
53
|
+
});
|
|
61
54
|
transition.ready.then(() => {
|
|
62
|
-
document.documentElement
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
55
|
+
document.documentElement.animate(
|
|
56
|
+
{
|
|
57
|
+
clipPath: isDark ? [...clipPath].reverse() : clipPath,
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
duration: 400,
|
|
61
|
+
easing: 'ease-in',
|
|
62
|
+
fill: 'both',
|
|
63
|
+
pseudoElement: isDark
|
|
64
|
+
? '::view-transition-old(root)'
|
|
65
|
+
: '::view-transition-new(root)',
|
|
73
66
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
.finished.then(() => {
|
|
78
|
-
dispose();
|
|
79
|
-
});
|
|
67
|
+
id: '',
|
|
68
|
+
},
|
|
69
|
+
);
|
|
80
70
|
});
|
|
71
|
+
transition.finished.then(dispose, dispose);
|
|
81
72
|
} else {
|
|
82
73
|
setTheme(nextTheme);
|
|
83
74
|
onClick?.();
|
|
@@ -116,6 +116,20 @@ export const Tabs = forwardRef(
|
|
|
116
116
|
return getTabValuesFromChildren(children, values);
|
|
117
117
|
}, [children, values]);
|
|
118
118
|
|
|
119
|
+
const defaultValueIndex =
|
|
120
|
+
defaultValue !== undefined
|
|
121
|
+
? tabValues.findIndex(item => item.value === defaultValue)
|
|
122
|
+
: -1;
|
|
123
|
+
const initialActiveIndex =
|
|
124
|
+
defaultValueIndex === -1 ? (defaultIndex ?? 0) : defaultValueIndex;
|
|
125
|
+
|
|
126
|
+
const [activeIndex, setActiveIndex] = useState(initialActiveIndex);
|
|
127
|
+
|
|
128
|
+
const [storageIndex, setStorageIndex] = useStorageValue<string>(
|
|
129
|
+
`${groupIdPrefix}${groupId}`,
|
|
130
|
+
initialActiveIndex.toString(),
|
|
131
|
+
);
|
|
132
|
+
|
|
119
133
|
if (import.meta.env.SSG_MD) {
|
|
120
134
|
return (
|
|
121
135
|
<>
|
|
@@ -132,20 +146,6 @@ export const Tabs = forwardRef(
|
|
|
132
146
|
);
|
|
133
147
|
}
|
|
134
148
|
|
|
135
|
-
const defaultValueIndex =
|
|
136
|
-
defaultValue !== undefined
|
|
137
|
-
? tabValues.findIndex(item => item.value === defaultValue)
|
|
138
|
-
: -1;
|
|
139
|
-
const initialActiveIndex =
|
|
140
|
-
defaultValueIndex === -1 ? (defaultIndex ?? 0) : defaultValueIndex;
|
|
141
|
-
|
|
142
|
-
const [activeIndex, setActiveIndex] = useState(initialActiveIndex);
|
|
143
|
-
|
|
144
|
-
const [storageIndex, setStorageIndex] = useStorageValue<string>(
|
|
145
|
-
`${groupIdPrefix}${groupId}`,
|
|
146
|
-
initialActiveIndex.toString(),
|
|
147
|
-
);
|
|
148
|
-
|
|
149
149
|
const currentIndex: number = groupId ? Number(storageIndex) : activeIndex;
|
|
150
150
|
|
|
151
151
|
return (
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { PluginDriver } from "./node/PluginDriver.js";
|
|
2
|
-
export { RSPRESS_TEMP_DIR, getIconUrlPath, getNodeAttribute, getSidebarDataGroup, logger, matchPath, mergeDocConfig, normalizeHref, normalizePosixPath, removeTrailingSlash, withBase, withSiteOrigin } from "./
|
|
2
|
+
export { RSPRESS_TEMP_DIR, getIconUrlPath, getNodeAttribute, getSidebarDataGroup, logger, matchPath, mergeDocConfig, normalizeHref, normalizePosixPath, removeTrailingSlash, withBase, withSiteOrigin } from "./t2~0.js";
|
|
3
3
|
export { RouteService } from "./node/route/RouteService.js";
|
|
4
4
|
export { build } from "./node/build.js";
|
|
5
5
|
export { defineConfig } from "./config/defineConfig.js";
|
|
@@ -4,9 +4,9 @@ type RspressPluginHookKeys = 'beforeBuild' | 'config' | 'afterBuild' | 'addPages
|
|
|
4
4
|
export declare class PluginDriver {
|
|
5
5
|
#private;
|
|
6
6
|
haveNavSidebarConfig: boolean;
|
|
7
|
+
static create(config: UserConfig, isProd: boolean): Promise<PluginDriver>;
|
|
7
8
|
static create(config: UserConfig, configFilePath: string, isProd: boolean): Promise<PluginDriver>;
|
|
8
9
|
private constructor();
|
|
9
|
-
getConfigFilePath(): string;
|
|
10
10
|
init(): Promise<void>;
|
|
11
11
|
addPlugin(plugin: RspressPlugin): void;
|
|
12
12
|
getPlugins(): RspressPlugin[];
|
|
@@ -1,26 +1,22 @@
|
|
|
1
|
-
import { addTrailingSlash, node_path, addLeadingSlash } from "../
|
|
1
|
+
import { addTrailingSlash, node_path, addLeadingSlash } from "../o~0.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 {
|
|
5
5
|
#config;
|
|
6
|
-
#configFilePath;
|
|
7
6
|
#plugins;
|
|
8
7
|
#isProd;
|
|
9
8
|
haveNavSidebarConfig = false;
|
|
10
|
-
static async create(config,
|
|
11
|
-
|
|
9
|
+
static async create(config, configFilePathOrIsProd, isProd = false) {
|
|
10
|
+
if ('boolean' == typeof configFilePathOrIsProd) isProd = configFilePathOrIsProd;
|
|
11
|
+
const pluginDriver = new PluginDriver(config, isProd);
|
|
12
12
|
await pluginDriver.init();
|
|
13
13
|
return pluginDriver;
|
|
14
14
|
}
|
|
15
|
-
constructor(config,
|
|
15
|
+
constructor(config, isProd){
|
|
16
16
|
this.#config = config;
|
|
17
|
-
this.#configFilePath = configFilePath;
|
|
18
17
|
this.#isProd = isProd;
|
|
19
18
|
this.#plugins = [];
|
|
20
19
|
}
|
|
21
|
-
getConfigFilePath() {
|
|
22
|
-
return this.#configFilePath;
|
|
23
|
-
}
|
|
24
20
|
async init() {
|
|
25
21
|
this.clearPlugins();
|
|
26
22
|
const config = this.#config;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DEFAULT_PAGE_EXTENSIONS, node_path } from "../../
|
|
1
|
+
import { DEFAULT_PAGE_EXTENSIONS, node_path } from "../../o~0.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,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "../../
|
|
3
|
-
import { extname, logger, promises_readdir, external_node_path_relative, isExternalUrl, slash, promises_stat, join } from "../../
|
|
1
|
+
import { rspackRequire, compatGetDefaultExport } from "../../rslib-runtime~0.js";
|
|
2
|
+
import "../../t~0.js";
|
|
3
|
+
import { extname, logger, promises_readdir, external_node_path_relative, isExternalUrl, slash, promises_stat, join } from "../../o~0.js";
|
|
4
4
|
import { createError } from "../utils/error.js";
|
|
5
5
|
import { pathExists, extractInfoFromFrontmatterWithAbsolutePath, readJson } from "./utils.js";
|
|
6
6
|
import { absolutePathToRoutePath, addRoutePrefix } from "../route/RoutePage.js";
|
|
7
7
|
import { RouteService } from "../route/RouteService.js";
|
|
8
|
-
const picocolors =
|
|
9
|
-
var picocolors_default = /*#__PURE__*/
|
|
8
|
+
const picocolors = rspackRequire("../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js");
|
|
9
|
+
var picocolors_default = /*#__PURE__*/ compatGetDefaultExport(picocolors);
|
|
10
10
|
const AUTO_NAV_SIDEBAR_ERROR_PREFIX = '[auto-nav-sidebar] ';
|
|
11
11
|
function getFileKey(realPath, docsDir) {
|
|
12
12
|
return realPath ? slash(external_node_path_relative(docsDir, realPath).replace(extname(realPath), '')) : '';
|
|
@@ -168,7 +168,7 @@ async function metaDirItemToSidebarItem(metaItem, workDir, docsDir, extensions,
|
|
|
168
168
|
context: metaJsonContext,
|
|
169
169
|
_fileKey: getFileKey(dirAbsolutePath, docsDir)
|
|
170
170
|
};
|
|
171
|
-
{
|
|
171
|
+
else {
|
|
172
172
|
const indexFile = await metaFileItemToSidebarItem('index', dirAbsolutePath, docsDir, extensions, mdFileSet);
|
|
173
173
|
if (!indexFile) return {
|
|
174
174
|
text: label || name,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { node_path, extractTextAndId, promises, loadFrontMatter } from "../../
|
|
1
|
+
import { node_path, extractTextAndId, promises, loadFrontMatter } from "../../o~0.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 "../../
|
|
1
|
+
import { isExternalUrl, node_path, promises } from "../../o~0.js";
|
|
2
2
|
import { pathExists } from "../utils/fs.js";
|
|
3
3
|
import { readJson } from "./utils.js";
|
|
4
4
|
import { addRoutePrefix } from "../route/RoutePage.js";
|
package/dist/node/build.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import type { LoadConfigResult } from '@rsbuild/core';
|
|
1
2
|
import type { UserConfig } from '@rspress/shared';
|
|
2
3
|
interface BuildOptions {
|
|
3
4
|
docDirectory: string;
|
|
4
|
-
config: UserConfig
|
|
5
|
-
configFilePath
|
|
5
|
+
config: UserConfig | LoadConfigResult<UserConfig>;
|
|
6
|
+
configFilePath?: string;
|
|
6
7
|
}
|
|
7
8
|
export declare function build(options: BuildOptions): Promise<void>;
|
|
8
9
|
export {};
|
package/dist/node/build.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { normalizeConfigResult } from "../config/loadConfigFile.js";
|
|
1
2
|
import { PluginDriver } from "./PluginDriver.js";
|
|
2
3
|
import { RouteService } from "./route/RouteService.js";
|
|
3
4
|
import { modifyConfigWithAutoNavSide } from "./auto-nav-sidebar/index.js";
|
|
@@ -5,8 +6,10 @@ import { initRsbuild } from "./initRsbuild.js";
|
|
|
5
6
|
import { checkLanguageParity } from "./utils/checkLanguageParity.js";
|
|
6
7
|
import { hintSSGFalse } from "./logger/hint.js";
|
|
7
8
|
async function build(options) {
|
|
8
|
-
const { docDirectory
|
|
9
|
-
const
|
|
9
|
+
const { docDirectory } = options;
|
|
10
|
+
const configResult = normalizeConfigResult(options.config, options.configFilePath);
|
|
11
|
+
const { content: config } = configResult;
|
|
12
|
+
const pluginDriver = await PluginDriver.create(configResult.content, true);
|
|
10
13
|
const modifiedConfig = await pluginDriver.modifyConfig();
|
|
11
14
|
const enableSSG = Boolean((modifiedConfig.ssg || modifiedConfig.llms) ?? true);
|
|
12
15
|
const additionalPages = await pluginDriver.addPages();
|
|
@@ -20,7 +23,10 @@ async function build(options) {
|
|
|
20
23
|
await modifyConfigWithAutoNavSide(modifiedConfig);
|
|
21
24
|
try {
|
|
22
25
|
await pluginDriver.beforeBuild();
|
|
23
|
-
const rsbuild = await initRsbuild(docDirectory,
|
|
26
|
+
const rsbuild = await initRsbuild(docDirectory, {
|
|
27
|
+
...configResult,
|
|
28
|
+
content: modifiedConfig
|
|
29
|
+
}, pluginDriver, routeService, enableSSG);
|
|
24
30
|
await rsbuild.build();
|
|
25
31
|
} finally{
|
|
26
32
|
await checkLanguageParity(config);
|
package/dist/node/constants.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isDarkModeSwitchEnabled, node_path, package_namespaceObject, getDefaultDarkModeValue, createRequire } from "../
|
|
1
|
+
import { isDarkModeSwitchEnabled, node_path, package_namespaceObject, getDefaultDarkModeValue, createRequire } from "../v~0.js";
|
|
2
2
|
const constants_require = createRequire(import.meta.url);
|
|
3
3
|
const RSPRESS_VERSION = package_namespaceObject.rE;
|
|
4
4
|
const APPEARANCE_KEY = 'rspress-theme-appearance';
|
package/dist/node/dev.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import type { RestartFn, RsbuildConfig } from '@rsbuild/core';
|
|
1
|
+
import type { LoadConfigResult, RestartFn, RsbuildConfig } from '@rsbuild/core';
|
|
2
2
|
import type { UserConfig } from '@rspress/shared';
|
|
3
3
|
interface ServerInstance {
|
|
4
4
|
close: () => Promise<void>;
|
|
5
5
|
}
|
|
6
6
|
interface DevOptions {
|
|
7
|
-
appDirectory
|
|
7
|
+
appDirectory?: string;
|
|
8
8
|
docDirectory: string;
|
|
9
|
-
config: UserConfig
|
|
10
|
-
configFilePath
|
|
9
|
+
config: UserConfig | LoadConfigResult<UserConfig>;
|
|
10
|
+
configFilePath?: string;
|
|
11
11
|
extraBuilderConfig?: RsbuildConfig;
|
|
12
12
|
restart?: RestartFn;
|
|
13
13
|
}
|
package/dist/node/dev.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
+
import { normalizeConfigResult } from "../config/loadConfigFile.js";
|
|
1
2
|
import { PluginDriver } from "./PluginDriver.js";
|
|
2
3
|
import { RouteService } from "./route/RouteService.js";
|
|
3
4
|
import { initRsbuild } from "./initRsbuild.js";
|
|
4
5
|
import { checkLanguageParity } from "./utils/checkLanguageParity.js";
|
|
5
6
|
async function dev(options) {
|
|
6
|
-
const { docDirectory,
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const pluginDriver = await PluginDriver.create(config, configFilePath, isProd);
|
|
7
|
+
const { docDirectory, extraBuilderConfig, restart } = options;
|
|
8
|
+
const configResult = normalizeConfigResult(options.config, options.configFilePath);
|
|
9
|
+
const pluginDriver = await PluginDriver.create(configResult.content, false);
|
|
10
10
|
const modifiedConfig = await pluginDriver.modifyConfig();
|
|
11
11
|
try {
|
|
12
12
|
const additionalPages = await pluginDriver.addPages();
|
|
@@ -18,8 +18,10 @@ async function dev(options) {
|
|
|
18
18
|
await pluginDriver.routeGenerated(routeService.getRoutes());
|
|
19
19
|
await pluginDriver.routeServiceGenerated(routeService);
|
|
20
20
|
await pluginDriver.beforeBuild();
|
|
21
|
-
const rsbuild = await initRsbuild(docDirectory,
|
|
22
|
-
|
|
21
|
+
const rsbuild = await initRsbuild(docDirectory, {
|
|
22
|
+
...configResult,
|
|
23
|
+
content: modifiedConfig
|
|
24
|
+
}, pluginDriver, routeService, false, {
|
|
23
25
|
extraRsbuildConfig: extraBuilderConfig,
|
|
24
26
|
restart
|
|
25
27
|
});
|
package/dist/node/eject.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "../
|
|
3
|
-
import { node_path, logger, promises } from "../
|
|
1
|
+
import { rspackRequire, compatGetDefaultExport } from "../rslib-runtime~0.js";
|
|
2
|
+
import "../t~0.js";
|
|
3
|
+
import { node_path, logger, promises } from "../o~0.js";
|
|
4
4
|
import { EJECTED_THEME } from "./constants.js";
|
|
5
|
-
const picocolors =
|
|
6
|
-
var picocolors_default = /*#__PURE__*/
|
|
5
|
+
const picocolors = rspackRequire("../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js");
|
|
6
|
+
var picocolors_default = /*#__PURE__*/ compatGetDefaultExport(picocolors);
|
|
7
7
|
let _themeComponentsPathOverride;
|
|
8
8
|
function getThemeComponentsPath() {
|
|
9
9
|
if (_themeComponentsPathOverride) return _themeComponentsPathOverride;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import type { RestartFn, RsbuildConfig, RsbuildInstance } from '@rsbuild/core';
|
|
1
|
+
import type { LoadConfigResult, RestartFn, RsbuildConfig, RsbuildInstance } from '@rsbuild/core';
|
|
2
2
|
import { type UserConfig } from '@rspress/shared';
|
|
3
3
|
import type { PluginDriver } from './PluginDriver.js';
|
|
4
4
|
import type { RouteService } from './route/RouteService.js';
|
|
5
|
-
export declare function initRsbuild(rootDir: string,
|
|
6
|
-
configFileMeta?: RsbuildConfig['_privateMeta'];
|
|
5
|
+
export declare function initRsbuild(rootDir: string, configResult: LoadConfigResult<UserConfig>, pluginDriver: PluginDriver, routeService: RouteService, enableSSG: boolean, options?: {
|
|
7
6
|
extraRsbuildConfig?: RsbuildConfig;
|
|
8
7
|
restart?: RestartFn;
|
|
9
8
|
}): Promise<RsbuildInstance>;
|
package/dist/node/initRsbuild.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { external_node_process_cwd, node_path, fileURLToPath, addTrailingSlash, PLUGIN_REACT_NAME, removeTrailingSlash, normalizeDarkMode, pluginVirtualModule, pluginReact, createRequire, MDX_OR_MD_REGEXP } from "../
|
|
1
|
+
import { external_node_process_cwd, node_path, fileURLToPath, addTrailingSlash, PLUGIN_REACT_NAME, removeTrailingSlash, normalizeDarkMode, pluginVirtualModule, pluginReact, createRequire, MDX_OR_MD_REGEXP } from "../o~0.js";
|
|
2
2
|
import { createError } from "./utils/error.js";
|
|
3
3
|
import { CSR_CLIENT_ENTRY, SSR_CLIENT_ENTRY, OUTPUT_DIR, SSG_MD_SERVER_ENTRY, NODE_SSG_BUNDLE_FOLDER, getInlineLocaleRedirectScript, isProduction, PACKAGE_ROOT, SSR_SERVER_ENTRY, TEMPLATE_PATH, NODE_SSG_MD_BUNDLE_FOLDER, DEFAULT_THEME, NODE_SSG_MD_BUNDLE_NAME, getInlineThemeScript, DEFAULT_TITLE, NODE_SSG_BUNDLE_NAME } from "./constants.js";
|
|
4
4
|
import { isLlmsUIEnabled, isLlmsHintEnabled } from "./llms.js";
|
|
@@ -16,7 +16,7 @@ import { siteDataVMPlugin } from "./runtimeModule/siteData/rsbuildPlugin.js";
|
|
|
16
16
|
import { rsbuildPluginSSG } from "./ssg/rsbuildPluginSSG.js";
|
|
17
17
|
import { rsbuildPluginCSR } from "./ssg/rsbuildPluginCSR.js";
|
|
18
18
|
import { rsbuildPluginSSGMD } from "./ssg-md/rsbuildPluginSSGMD.js";
|
|
19
|
-
import { package_namespaceObject } from "../
|
|
19
|
+
import { package_namespaceObject } from "../v~0.js";
|
|
20
20
|
function isPluginIncluded(config, pluginName) {
|
|
21
21
|
return Boolean(config.builderConfig?.plugins?.some((plugin)=>plugin && plugin.name === pluginName));
|
|
22
22
|
}
|
|
@@ -197,8 +197,7 @@ async function createInternalBuildConfig(userDocRoot, config, enableSSG, routeSe
|
|
|
197
197
|
...'false' !== process.env.RSPRESS_PERSISTENT_CACHE ? {
|
|
198
198
|
buildCache: {
|
|
199
199
|
buildDependencies: [
|
|
200
|
-
fileURLToPath(import.meta.url)
|
|
201
|
-
pluginDriver.getConfigFilePath()
|
|
200
|
+
fileURLToPath(import.meta.url)
|
|
202
201
|
],
|
|
203
202
|
cacheDigest: [
|
|
204
203
|
routeService.generateRoutesCode(),
|
|
@@ -376,17 +375,20 @@ async function createInternalBuildConfig(userDocRoot, config, enableSSG, routeSe
|
|
|
376
375
|
}
|
|
377
376
|
};
|
|
378
377
|
}
|
|
379
|
-
async function initRsbuild(rootDir,
|
|
378
|
+
async function initRsbuild(rootDir, configResult, pluginDriver, routeService, enableSSG, options = {}) {
|
|
379
|
+
const { content: config } = configResult;
|
|
380
380
|
const userDocRoot = node_path.resolve(rootDir || config.root);
|
|
381
381
|
hintBuilderPluginsBreakingChange(config);
|
|
382
382
|
const { createRsbuild, mergeRsbuildConfig } = await import("@rsbuild/core");
|
|
383
383
|
const internalRsbuildConfig = await createInternalBuildConfig(userDocRoot, config, enableSSG, routeService, pluginDriver, options.restart);
|
|
384
384
|
const rsbuildConfig = mergeRsbuildConfig(internalRsbuildConfig, ...pluginDriver.getPlugins()?.map((plugin)=>plugin.builderConfig ?? {}) || [], config.builderConfig || {}, options.extraRsbuildConfig || {});
|
|
385
|
-
if (options.configFileMeta) rsbuildConfig._privateMeta = options.configFileMeta;
|
|
386
385
|
const rsbuild = await createRsbuild({
|
|
387
386
|
callerName: 'rspress',
|
|
388
387
|
restart: options.restart,
|
|
389
|
-
|
|
388
|
+
config: {
|
|
389
|
+
...configResult,
|
|
390
|
+
content: rsbuildConfig
|
|
391
|
+
}
|
|
390
392
|
});
|
|
391
393
|
return rsbuild;
|
|
392
394
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { node_path, execa } from "../../
|
|
2
|
-
import { slash } from "../utils/
|
|
1
|
+
import { node_path, execa } from "../../n~0.js";
|
|
2
|
+
import { slash } from "../utils/slash.js";
|
|
3
3
|
function transform(timestamp, lang) {
|
|
4
4
|
return new Date(timestamp).toLocaleString(lang || 'zh');
|
|
5
5
|
}
|
package/dist/node/logger/hint.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { relative, logger, join, readFile } from "../../
|
|
1
|
+
import { rspackRequire, compatGetDefaultExport } from "../../rslib-runtime~0.js";
|
|
2
|
+
import { relative, logger, join, readFile } from "../../t~0.js";
|
|
3
3
|
import { pathExists } from "../utils/fs.js";
|
|
4
|
-
const picocolors =
|
|
5
|
-
var picocolors_default = /*#__PURE__*/
|
|
4
|
+
const picocolors = rspackRequire("../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js");
|
|
5
|
+
var picocolors_default = /*#__PURE__*/ compatGetDefaultExport(picocolors);
|
|
6
6
|
const THEME_DEFAULT_EXPORT_PATTERN = /export\s+default\s+\{/;
|
|
7
7
|
const THEME_OLD_IMPORT_0 = /from\s+['"]rspress\/theme['"]/;
|
|
8
8
|
const THEME_OLD_IMPORT_1 = /from\s+['"]@rspress\/core\/theme['"]/;
|
package/dist/node/mdx/options.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { node_path, rehype_external_links, rehype_raw, remark_cjk_friendly, nodeTypes, remark_gfm, rehype, remark_cjk_friendly_gfm_strikethrough } from "../../
|
|
1
|
+
import { node_path, rehype_external_links, rehype_raw, remark_cjk_friendly, nodeTypes, remark_gfm, rehype, remark_cjk_friendly_gfm_strikethrough } from "../../tx~0.js";
|
|
2
2
|
import { remarkToc } from "./remarkPlugins/toc.js";
|
|
3
3
|
import { remarkContainerSyntax } from "./remarkPlugins/containerSyntax.js";
|
|
4
4
|
import { remarkFileCodeBlock } from "./remarkPlugins/fileCodeBlock.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { node_path, extractTextAndId, createProcessor, loadFrontMatter } from "../../
|
|
1
|
+
import { node_path, extractTextAndId, createProcessor, loadFrontMatter } from "../../tx~0.js";
|
|
2
2
|
import { createMDXOptions } from "./options.js";
|
|
3
3
|
import { applyReplaceRules } from "../utils/applyReplaceRules.js";
|
|
4
4
|
import { escapeMarkdownHeadingIds } from "../utils/escapeHeadingIds.js";
|
|
5
|
-
import {
|
|
5
|
+
import { slash } from "../utils/slash.js";
|
|
6
6
|
import { createError } from "../utils/error.js";
|
|
7
7
|
async function compile(options) {
|
|
8
8
|
const { source, filepath, docDirectory, config, routeService, pluginDriver, addDependency, isSsgMd = false } = options;
|
|
@@ -49,7 +49,7 @@ async function compile(options) {
|
|
|
49
49
|
const result = `${compileResult}
|
|
50
50
|
|
|
51
51
|
MDXContent.__RSPRESS_PAGE_META = {};
|
|
52
|
-
MDXContent.__RSPRESS_PAGE_META["${encodeURIComponent(
|
|
52
|
+
MDXContent.__RSPRESS_PAGE_META["${encodeURIComponent(slash(node_path.relative(docDirectory, filepath)))}"] = ${JSON.stringify(pageMeta)};
|
|
53
53
|
`;
|
|
54
54
|
return result;
|
|
55
55
|
} catch (e) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { visit } from "../../../
|
|
1
|
+
import { visit } from "../../../tx~0.js";
|
|
2
2
|
const rehypeCodeMeta = ()=>(tree)=>{
|
|
3
3
|
visit(tree, 'element', (node)=>{
|
|
4
4
|
if ('pre' === node.tagName && node.children[0]?.type === 'element' && 'code' === node.children[0].tagName) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { visit, extractTextAndId, github_slugger, headingRank } from "../../../
|
|
1
|
+
import { visit, extractTextAndId, github_slugger, headingRank } from "../../../tx~0.js";
|
|
2
2
|
const rehypeHeaderAnchor = ()=>{
|
|
3
3
|
const slugger = new github_slugger();
|
|
4
4
|
return (tree)=>{
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { transformerAddLang, transformerAddLineNumbers, transformerAddTitle, transformerAddFold, createCssVariablesTheme, transformerAddWrapCode } from "../../../
|
|
1
|
+
import { transformerAddLang, transformerAddLineNumbers, transformerAddTitle, transformerAddFold, createCssVariablesTheme, transformerAddWrapCode } from "../../../tx~0.js";
|
|
2
2
|
const cssVariablesTheme = createCssVariablesTheme({
|
|
3
3
|
name: 'css-variables',
|
|
4
4
|
variablePrefix: '--shiki-',
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { node_path } from "../../../
|
|
1
|
+
import { node_path } from "../../../tx~0.js";
|
|
2
2
|
import { getDefaultImportAstNode } from "../../utils/getImportAstNode.js";
|
|
3
3
|
const remarkBuiltin = ({ globalComponents })=>(tree)=>{
|
|
4
4
|
const demos = globalComponents.map((componentPath)=>{
|
|
@@ -170,12 +170,13 @@ function transformer(tree, warnUnknownType) {
|
|
|
170
170
|
const newChild = createContainer(type, title, wrappedChildren);
|
|
171
171
|
tree.children.splice(i, j - i + 1, newChild);
|
|
172
172
|
break;
|
|
173
|
+
} else {
|
|
174
|
+
wrappedChildren.push({
|
|
175
|
+
...currentParagraph,
|
|
176
|
+
children: currentParagraph.children.filter((child)=>child !== firstTextNode)
|
|
177
|
+
});
|
|
178
|
+
j++;
|
|
173
179
|
}
|
|
174
|
-
wrappedChildren.push({
|
|
175
|
-
...currentParagraph,
|
|
176
|
-
children: currentParagraph.children.filter((child)=>child !== firstTextNode)
|
|
177
|
-
});
|
|
178
|
-
j++;
|
|
179
180
|
}
|
|
180
181
|
}
|
|
181
182
|
i++;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "../../../
|
|
3
|
-
import { visit, node_path, logger, cwd, readFile } from "../../../
|
|
1
|
+
import { rspackRequire, compatGetDefaultExport } from "../../../rslib-runtime~0.js";
|
|
2
|
+
import "../../../t~0.js";
|
|
3
|
+
import { visit, node_path, logger, cwd, readFile } from "../../../r~0.js";
|
|
4
4
|
import { createError } from "../../utils/error.js";
|
|
5
|
-
const picocolors =
|
|
6
|
-
var picocolors_default = /*#__PURE__*/
|
|
5
|
+
const picocolors = rspackRequire("../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js");
|
|
6
|
+
var picocolors_default = /*#__PURE__*/ compatGetDefaultExport(picocolors);
|
|
7
7
|
const ERROR_PREFIX = '[remarkFileCodeBlock]';
|
|
8
8
|
function parseFileFromMeta(meta) {
|
|
9
9
|
if (!meta) return '';
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "../../../
|
|
3
|
-
import { visit, node_path, logger, isDataUrl, existsSync, getNodeAttribute, isExternalUrl, isProduction, parseUrl } from "../../../
|
|
1
|
+
import { rspackRequire, compatGetDefaultExport } from "../../../rslib-runtime~0.js";
|
|
2
|
+
import "../../../t~0.js";
|
|
3
|
+
import { visit, node_path, logger, isDataUrl, existsSync, getNodeAttribute, isExternalUrl, isProduction, parseUrl } from "../../../r~0.js";
|
|
4
4
|
import { createError } from "../../utils/error.js";
|
|
5
5
|
import { getDefaultImportAstNode } from "../../utils/getImportAstNode.js";
|
|
6
|
-
const picocolors =
|
|
7
|
-
var picocolors_default = /*#__PURE__*/
|
|
6
|
+
const picocolors = rspackRequire("../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js");
|
|
7
|
+
var picocolors_default = /*#__PURE__*/ compatGetDefaultExport(picocolors);
|
|
8
8
|
const normalizeImageUrl = (imageUrl)=>{
|
|
9
9
|
if (isExternalUrl(imageUrl) || imageUrl.startsWith('/')) return '';
|
|
10
10
|
return imageUrl;
|