@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 +1 -1
- package/dist/index.d.ts +14 -10
- package/dist/index.js +4 -4
- package/package.json +9 -9
package/README.md
CHANGED
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
|
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
|
-
*
|
300
|
+
* @type import('@shikijs/rehype').RehypeShikiOptions
|
300
301
|
*/
|
301
|
-
|
302
|
+
shiki?: Partial<PluginShikiOptions>;
|
302
303
|
/**
|
303
|
-
*
|
304
|
+
* Speed up build time by caching mdx parsing result in `rspress build`
|
305
|
+
* @default true
|
304
306
|
*/
|
305
|
-
|
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: (
|
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
|
2
|
-
import
|
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(
|
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
|
-
|
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.
|
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.
|
36
|
-
"@rslib/core": "0.
|
37
|
-
"@types/node": "^
|
38
|
-
"@types/react": "^
|
39
|
-
"@types/react-dom": "^
|
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.
|
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.
|
44
|
+
"@rspress/shared": "2.0.0-beta.20"
|
45
45
|
},
|
46
46
|
"peerDependencies": {
|
47
|
-
"@rspress/runtime": "^2.0.0-beta.
|
47
|
+
"@rspress/runtime": "^2.0.0-beta.20"
|
48
48
|
},
|
49
49
|
"engines": {
|
50
50
|
"node": ">=18.0.0"
|