@rspress/plugin-medium-zoom 2.0.0-beta.0 → 2.0.0-beta.10

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.
Files changed (3) hide show
  1. package/README.md +1 -1
  2. package/dist/index.d.ts +12 -23
  3. package/package.json +17 -11
package/README.md CHANGED
@@ -2,4 +2,4 @@
2
2
 
3
3
  > Medium zoom plugin for rspress
4
4
 
5
- [Documentation](https://rspress.dev/plugin/official-plugins/medium-zoom)
5
+ [Documentation](https://rspress.rs/plugin/official-plugins/medium-zoom)
package/dist/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import type { PluggableList } from 'unified';
2
+ import type { RehypeShikiOptions } from '@shikijs/rehype';
2
3
  import type { RsbuildConfig } from '@rsbuild/core';
3
4
  import type { RsbuildPlugin } from '@rsbuild/core';
4
5
  import type { ZoomOptions } from 'medium-zoom';
@@ -127,7 +128,7 @@ declare interface DefaultThemeConfig {
127
128
  * Whether to redirect to the closest locale when the user visits the site
128
129
  * @default 'auto'
129
130
  */
130
- localeRedirect?: 'auto' | 'never';
131
+ localeRedirect?: 'auto' | 'never' | 'only-default-lang';
131
132
  /**
132
133
  * Whether to show the fallback heading title when the heading title is not presented but `frontmatter.title` exists
133
134
  * @default true
@@ -296,28 +297,9 @@ declare interface MarkdownOptions {
296
297
  */
297
298
  globalComponents?: string[];
298
299
  /**
299
- * Code highlighter, default is prism for performance reason
300
+ * @type import('@shikijs/rehype').RehypeShikiOptions
300
301
  */
301
- codeHighlighter?: 'prism' | 'shiki';
302
- /**
303
- * Register prism languages
304
- */
305
- highlightLanguages?: (string | [string, string])[];
306
- /**
307
- * Whether to enable mdx-rs, default is true
308
- */
309
- mdxRs?: boolean | MdxRsOptions;
310
- /**
311
- * @deprecated, use `mdxRs` instead
312
- */
313
- experimentalMdxRs?: boolean;
314
- }
315
-
316
- declare interface MdxRsOptions {
317
- /**
318
- * Determine whether the file use mdxRs compiler
319
- */
320
- include?: (filepath: string) => boolean;
302
+ shiki?: Partial<PluginShikiOptions>;
321
303
  }
322
304
 
323
305
  declare type Nav = NavItem[] | {
@@ -366,6 +348,7 @@ declare interface PageIndexInfo {
366
348
  routePath: string;
367
349
  toc: Header[];
368
350
  content: string;
351
+ _flattenContent?: string;
369
352
  _html: string;
370
353
  frontmatter: FrontMatterMeta;
371
354
  lang: string;
@@ -382,6 +365,8 @@ declare type PageType = 'home' | 'doc' | 'custom' | '404' | 'blank';
382
365
  */
383
366
  export declare function pluginMediumZoom(options?: Options): RspressPlugin;
384
367
 
368
+ declare type PluginShikiOptions = RehypeShikiOptions;
369
+
385
370
  declare type RemoteSearchIndexInfo = string | {
386
371
  value: string;
387
372
  label: string;
@@ -486,6 +471,10 @@ declare interface RspressPlugin {
486
471
  * Callback after route generated
487
472
  */
488
473
  routeGenerated?: (routes: RouteMeta[], isProd: boolean) => Promise<void> | void;
474
+ /**
475
+ * Callback after routeService generated
476
+ */
477
+ routeServiceGenerated?: (routeService: any, isProd: boolean) => Promise<void> | void;
489
478
  /**
490
479
  * Add addition ssg routes, for dynamic routes.
491
480
  */
@@ -586,7 +575,7 @@ declare interface UserConfig<ThemeConfig = DefaultThemeConfig> {
586
575
  /**
587
576
  * Path to html icon file.
588
577
  */
589
- icon?: string;
578
+ icon?: string | URL;
590
579
  /**
591
580
  * Default language of the site.
592
581
  */
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@rspress/plugin-medium-zoom",
3
- "version": "2.0.0-beta.0",
3
+ "version": "2.0.0-beta.10",
4
4
  "description": "A plugin for rspress to zoom images in docs.",
5
5
  "bugs": "https://github.com/web-infra-dev/rspress/issues",
6
6
  "repository": {
7
7
  "type": "git",
8
- "url": "https://github.com/web-infra-dev/rspress",
8
+ "url": "git+https://github.com/web-infra-dev/rspress.git",
9
9
  "directory": "packages/plugin-medium-zoom"
10
10
  },
11
11
  "license": "MIT",
@@ -16,7 +16,12 @@
16
16
  "*.scss"
17
17
  ],
18
18
  "type": "module",
19
- "main": "./dist/index.js",
19
+ "exports": {
20
+ ".": {
21
+ "types": "./dist/index.d.ts",
22
+ "default": "./dist/index.js"
23
+ }
24
+ },
20
25
  "module": "./dist/index.js",
21
26
  "types": "./dist/index.d.ts",
22
27
  "files": [
@@ -27,21 +32,22 @@
27
32
  "medium-zoom": "1.1.0"
28
33
  },
29
34
  "devDependencies": {
30
- "@microsoft/api-extractor": "^7.52.4",
31
- "@rslib/core": "0.6.5",
32
- "@types/node": "^18.11.17",
33
- "@types/react": "^18.3.20",
34
- "@types/react-dom": "^18.3.6",
35
+ "@microsoft/api-extractor": "^7.52.8",
36
+ "@rslib/core": "0.8.0",
37
+ "@types/node": "^22.8.1",
38
+ "@types/react": "^18.3.22",
39
+ "@types/react-dom": "^18.3.7",
35
40
  "react": "^19.1.0",
41
+ "rsbuild-plugin-publint": "^0.3.2",
36
42
  "typescript": "^5.8.2",
37
43
  "@rspress/config": "1.0.0",
38
- "@rspress/shared": "2.0.0-beta.0"
44
+ "@rspress/shared": "2.0.0-beta.10"
39
45
  },
40
46
  "peerDependencies": {
41
- "@rspress/runtime": "^2.0.0-beta.0"
47
+ "@rspress/runtime": "^2.0.0-beta.10"
42
48
  },
43
49
  "engines": {
44
- "node": ">=14.17.6"
50
+ "node": ">=18.0.0"
45
51
  },
46
52
  "publishConfig": {
47
53
  "access": "public",