@rspress/plugin-preview 0.0.0-next-20230927072732 → 0.0.0-next-20231108104528
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/README.md +4 -0
- package/dist/index.d.ts +21 -3
- package/dist/index.js +149 -2571
- package/dist/index.js.map +1 -1
- package/dist/utils.d.ts +16 -0
- package/dist/utils.js +57 -0
- package/dist/utils.js.map +1 -0
- package/dist/virtual-demo.js +9 -21
- package/mdx-meta-loader.cjs +1 -0
- package/package.json +8 -5
- package/static/global-components/Container.scss +1 -37
- package/static/global-components/Container.tsx +77 -5
- package/static/global-components/Device.tsx +6 -10
- package/static/global-components/common/index.scss +37 -0
- package/static/global-components/common/mobile-operation.tsx +12 -2
- package/static/global-components/icons/Codesandbox.tsx +22 -0
- package/static/global-styles/web.css +0 -6
package/README.md
CHANGED
package/dist/index.d.ts
CHANGED
@@ -1,17 +1,35 @@
|
|
1
1
|
import { RouteMeta, RspressPlugin } from '@rspress/shared';
|
2
2
|
|
3
|
+
/**
|
4
|
+
* remove .html extension and validate
|
5
|
+
* @param routePath id from pathname
|
6
|
+
* @returns normalized id
|
7
|
+
*/
|
8
|
+
declare const normalizeId: (routePath: string) => string;
|
9
|
+
|
3
10
|
type Options = {
|
4
11
|
/**
|
5
12
|
* preview in mobile mode or not
|
6
13
|
* when isMobile is true, 1. aside will hide. 2. default preview component by iframe
|
7
14
|
* @default false
|
8
15
|
*/
|
9
|
-
isMobile
|
16
|
+
isMobile?: boolean;
|
10
17
|
/**
|
11
18
|
* position of the iframe
|
12
19
|
* @default 'follow'
|
13
20
|
*/
|
14
|
-
iframePosition
|
21
|
+
iframePosition?: 'fixed' | 'follow';
|
22
|
+
/**
|
23
|
+
* whether the demo can open in codesandbox
|
24
|
+
* @default false
|
25
|
+
* @experimental
|
26
|
+
*/
|
27
|
+
enableCodesandbox?: boolean;
|
28
|
+
/**
|
29
|
+
* determine how to handle a internal code block without meta
|
30
|
+
* @default 'preview'
|
31
|
+
*/
|
32
|
+
defaultRenderMode?: 'pure' | 'preview';
|
15
33
|
};
|
16
34
|
declare let routeMeta: RouteMeta[];
|
17
35
|
declare const demoRoutes: {
|
@@ -27,4 +45,4 @@ declare const demoMeta: Record<string, {
|
|
27
45
|
*/
|
28
46
|
declare function pluginPreview(options?: Options): RspressPlugin;
|
29
47
|
|
30
|
-
export { Options, demoMeta, demoRoutes, pluginPreview, routeMeta };
|
48
|
+
export { Options, demoMeta, demoRoutes, normalizeId, pluginPreview, routeMeta };
|