@rspress/plugin-preview 1.11.2 → 1.12.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.
- package/dist/index.d.ts +35 -23
- package/dist/index.js +402 -417
- package/dist/index.js.map +1 -1
- package/dist/utils.js +1 -1
- package/dist/utils.js.map +1 -1
- package/package.json +7 -2
- package/static/global-components/Container.tsx +9 -6
- package/static/global-components/Device.tsx +13 -11
- package/static/global-components/common/mobile-operation.tsx +3 -10
- package/static/global-styles/entry.css +20 -0
- package/static/global-styles/internal.css +5 -0
- package/static/modern-app-env.d.ts +1 -1
- package/dist/virtual-demo.js +0 -73
- package/mdx-meta-loader.cjs +0 -27
- package/static/global-styles/web.css +0 -5
- /package/static/global-styles/{mobile.css → iframe.css} +0 -0
package/dist/index.d.ts
CHANGED
@@ -1,42 +1,54 @@
|
|
1
|
-
import {
|
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;
|
1
|
+
import { RspressPlugin } from '@rspress/shared';
|
9
2
|
|
10
3
|
type Options = {
|
11
4
|
/**
|
12
|
-
*
|
13
|
-
*
|
14
|
-
*
|
5
|
+
* @deprecated Use previewMode instead.
|
6
|
+
* true = 'iframe'
|
7
|
+
* false = 'internal'
|
15
8
|
*/
|
16
9
|
isMobile?: boolean;
|
17
10
|
/**
|
18
|
-
*
|
19
|
-
* @default 'follow'
|
11
|
+
* @deprecated Use iframeOptions.position instead.
|
20
12
|
*/
|
21
13
|
iframePosition?: 'fixed' | 'follow';
|
14
|
+
/**
|
15
|
+
* internal mode: component will be rendered inside the documentation, only support react.
|
16
|
+
*
|
17
|
+
* inframe mode: component will be rendered in iframe, note that aside will hide.
|
18
|
+
* @default 'internal'
|
19
|
+
*/
|
20
|
+
previewMode?: 'internal' | 'iframe';
|
21
|
+
/**
|
22
|
+
* enable when preview mode is iframe.
|
23
|
+
*/
|
24
|
+
iframeOptions?: IframeOptions;
|
22
25
|
/**
|
23
26
|
* determine how to handle a internal code block without meta
|
24
27
|
* @default 'preview'
|
25
28
|
*/
|
26
29
|
defaultRenderMode?: 'pure' | 'preview';
|
27
30
|
};
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
31
|
+
type IframeOptions = {
|
32
|
+
/**
|
33
|
+
* framework in the iframe
|
34
|
+
* @default 'react'
|
35
|
+
*/
|
36
|
+
framework?: 'react' | 'solid';
|
37
|
+
/**
|
38
|
+
* position of the iframe
|
39
|
+
* @default 'follow'
|
40
|
+
*/
|
41
|
+
position?: 'fixed' | 'follow';
|
42
|
+
/**
|
43
|
+
* dev server port for the iframe
|
44
|
+
* @default 7890
|
45
|
+
*/
|
46
|
+
devPort?: number;
|
47
|
+
};
|
48
|
+
|
37
49
|
/**
|
38
50
|
* The plugin is used to preview component.
|
39
51
|
*/
|
40
52
|
declare function pluginPreview(options?: Options): RspressPlugin;
|
41
53
|
|
42
|
-
export { type Options,
|
54
|
+
export { type Options, pluginPreview };
|