@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 CHANGED
@@ -1 +1,5 @@
1
1
  # @rspress/plugin-preview
2
+
3
+ > Preview plugin for rspress
4
+
5
+ [Documentation](https://rspress.dev/plugin/official-plugins/preview)
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: boolean;
16
+ isMobile?: boolean;
10
17
  /**
11
18
  * position of the iframe
12
19
  * @default 'follow'
13
20
  */
14
- iframePosition: 'fixed' | 'follow';
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 };