@rspress/plugin-preview 1.40.2 → 1.41.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 +68 -67
- package/dist/index.js +545 -707
- package/dist/utils.d.ts +19 -16
- package/dist/utils.js +43 -48
- package/package.json +10 -9
- package/static/global-components/Device.tsx +1 -0
- package/dist/index.js.map +0 -1
- package/dist/utils.js.map +0 -1
package/dist/index.d.ts
CHANGED
@@ -1,67 +1,68 @@
|
|
1
|
-
import {
|
2
|
-
import {
|
3
|
-
|
4
|
-
type
|
5
|
-
/**
|
6
|
-
*
|
7
|
-
*
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
* @
|
13
|
-
*/
|
14
|
-
|
15
|
-
/**
|
16
|
-
*
|
17
|
-
*
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
*
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
*
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
*
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
*
|
52
|
-
*/
|
53
|
-
|
54
|
-
/**
|
55
|
-
*
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
};
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
1
|
+
import type { RsbuildConfig } from '@rsbuild/core';
|
2
|
+
import { RspressPlugin } from '@rspress/shared';
|
3
|
+
|
4
|
+
declare type IframeOptions = {
|
5
|
+
/**
|
6
|
+
* framework in the iframe
|
7
|
+
* @default 'react'
|
8
|
+
*/
|
9
|
+
framework?: 'react' | 'solid';
|
10
|
+
/**
|
11
|
+
* position of the iframe
|
12
|
+
* @default 'follow'
|
13
|
+
*/
|
14
|
+
position?: 'fixed' | 'follow';
|
15
|
+
/**
|
16
|
+
* dev server port for the iframe
|
17
|
+
* @default 7890
|
18
|
+
*/
|
19
|
+
devPort?: number;
|
20
|
+
builderConfig?: RsbuildConfig;
|
21
|
+
};
|
22
|
+
|
23
|
+
export declare type Options = {
|
24
|
+
/**
|
25
|
+
* @deprecated Use previewMode instead.
|
26
|
+
* true = 'iframe'
|
27
|
+
* false = 'internal'
|
28
|
+
*/
|
29
|
+
isMobile?: boolean;
|
30
|
+
/**
|
31
|
+
* @deprecated Use iframeOptions.position instead.
|
32
|
+
*/
|
33
|
+
iframePosition?: 'fixed' | 'follow';
|
34
|
+
/**
|
35
|
+
* internal mode: component will be rendered inside the documentation, only support react.
|
36
|
+
*
|
37
|
+
* iframe mode: component will be rendered in iframe, note that aside will hide.
|
38
|
+
* @default 'internal'
|
39
|
+
*/
|
40
|
+
previewMode?: 'internal' | 'iframe';
|
41
|
+
/**
|
42
|
+
* enable when preview mode is iframe.
|
43
|
+
*/
|
44
|
+
iframeOptions?: IframeOptions;
|
45
|
+
/**
|
46
|
+
* determine how to handle a internal code block without meta
|
47
|
+
* @default 'preview'
|
48
|
+
*/
|
49
|
+
defaultRenderMode?: 'pure' | 'preview';
|
50
|
+
/**
|
51
|
+
* Supported languages to be previewed
|
52
|
+
*/
|
53
|
+
previewLanguages?: string[];
|
54
|
+
/**
|
55
|
+
* Transform previewed code in custom way
|
56
|
+
*/
|
57
|
+
previewCodeTransform?: (codeInfo: {
|
58
|
+
language: string;
|
59
|
+
code: string;
|
60
|
+
}) => string;
|
61
|
+
};
|
62
|
+
|
63
|
+
/**
|
64
|
+
* The plugin is used to preview component.
|
65
|
+
*/
|
66
|
+
export declare function pluginPreview(options?: Options): RspressPlugin;
|
67
|
+
|
68
|
+
export { }
|