@rspress/plugin-medium-zoom 2.0.0-beta.2 → 2.0.0-beta.20

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
@@ -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
@@ -274,7 +275,7 @@ declare type LocalSearchOptions = SearchHooks & {
274
275
  versioned?: boolean;
275
276
  /**
276
277
  * If enabled, the search index will include code block content, which allows users to search code blocks.
277
- * @default false
278
+ * @default true
278
279
  */
279
280
  codeBlocks?: boolean;
280
281
  };
@@ -296,13 +297,14 @@ 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
+ shiki?: Partial<PluginShikiOptions>;
302
303
  /**
303
- * Register prism languages
304
+ * Speed up build time by caching mdx parsing result in `rspress build`
305
+ * @default true
304
306
  */
305
- highlightLanguages?: (string | [string, string])[];
307
+ crossCompilerCache?: boolean;
306
308
  }
307
309
 
308
310
  declare type Nav = NavItem[] | {
@@ -346,9 +348,8 @@ declare interface Options {
346
348
  * and should not be used in the runtime (usePageData).
347
349
  */
348
350
  declare interface PageIndexInfo {
349
- id: number;
350
- title: string;
351
351
  routePath: string;
352
+ title: string;
352
353
  toc: Header[];
353
354
  content: string;
354
355
  _flattenContent?: string;
@@ -368,6 +369,8 @@ declare type PageType = 'home' | 'doc' | 'custom' | '404' | 'blank';
368
369
  */
369
370
  export declare function pluginMediumZoom(options?: Options): RspressPlugin;
370
371
 
372
+ declare type PluginShikiOptions = RehypeShikiOptions;
373
+
371
374
  declare type RemoteSearchIndexInfo = string | {
372
375
  value: string;
373
376
  label: string;
@@ -466,6 +469,7 @@ declare interface RspressPlugin {
466
469
  addPages?: (config: UserConfig, isProd: boolean) => AdditionalPage[] | Promise<AdditionalPage[]>;
467
470
  /**
468
471
  * Add runtime modules
472
+ * @deprecated use [rsbuild-plugin-virtual-module](https://github.com/rspack-contrib/rsbuild-plugin-virtual-module) instead.
469
473
  */
470
474
  addRuntimeModules?: (config: UserConfig, isProd: boolean) => Record<string, string> | Promise<Record<string, string>>;
471
475
  /**
@@ -512,7 +516,7 @@ declare interface SidebarGroup {
512
516
  text: string;
513
517
  link?: string;
514
518
  tag?: string;
515
- items: (SidebarItem | SidebarDivider | SidebarGroup | string)[];
519
+ items: (SidebarGroup | SidebarItem | SidebarDivider | SidebarSectionHeader)[];
516
520
  collapsible?: boolean;
517
521
  collapsed?: boolean;
518
522
  /**
@@ -576,7 +580,7 @@ declare interface UserConfig<ThemeConfig = DefaultThemeConfig> {
576
580
  /**
577
581
  * Path to html icon file.
578
582
  */
579
- icon?: string;
583
+ icon?: string | URL;
580
584
  /**
581
585
  * Default language of the site.
582
586
  */
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
- import * as __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__ from "node:path";
2
- import * as __WEBPACK_EXTERNAL_MODULE_node_url_e96de089__ from "node:url";
1
+ import node_path from "node:path";
2
+ import { fileURLToPath } from "node:url";
3
3
  function slash(str) {
4
4
  return str.replace(/\\/g, '/');
5
5
  }
@@ -18,12 +18,12 @@ function normalizePosixPath(id) {
18
18
  return normalizedPath;
19
19
  }
20
20
  function pluginMediumZoom(options = {}) {
21
- const __dirname = normalizePosixPath(__WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__["default"].dirname((0, __WEBPACK_EXTERNAL_MODULE_node_url_e96de089__.fileURLToPath)(import.meta.url)));
21
+ const __dirname = normalizePosixPath(node_path.dirname(fileURLToPath(import.meta.url)));
22
22
  return {
23
23
  name: '@rspress/plugin-medium-zoom',
24
24
  globalUIComponents: [
25
25
  [
26
- __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__["default"].join(__dirname, '../static/MediumZoom.tsx'),
26
+ node_path.join(__dirname, '../static/MediumZoom.tsx'),
27
27
  options
28
28
  ]
29
29
  ]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rspress/plugin-medium-zoom",
3
- "version": "2.0.0-beta.2",
3
+ "version": "2.0.0-beta.20",
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": {
@@ -32,19 +32,19 @@
32
32
  "medium-zoom": "1.1.0"
33
33
  },
34
34
  "devDependencies": {
35
- "@microsoft/api-extractor": "^7.52.4",
36
- "@rslib/core": "0.6.5",
37
- "@types/node": "^18.11.17",
38
- "@types/react": "^18.3.20",
39
- "@types/react-dom": "^18.3.6",
35
+ "@microsoft/api-extractor": "^7.52.8",
36
+ "@rslib/core": "0.10.4",
37
+ "@types/node": "^22.8.1",
38
+ "@types/react": "^19.1.8",
39
+ "@types/react-dom": "^19.1.6",
40
40
  "react": "^19.1.0",
41
- "rsbuild-plugin-publint": "^0.3.0",
41
+ "rsbuild-plugin-publint": "^0.3.2",
42
42
  "typescript": "^5.8.2",
43
43
  "@rspress/config": "1.0.0",
44
- "@rspress/shared": "2.0.0-beta.2"
44
+ "@rspress/shared": "2.0.0-beta.20"
45
45
  },
46
46
  "peerDependencies": {
47
- "@rspress/runtime": "^2.0.0-beta.2"
47
+ "@rspress/runtime": "^2.0.0-beta.20"
48
48
  },
49
49
  "engines": {
50
50
  "node": ">=18.0.0"