@rspress/plugin-medium-zoom 1.42.0 → 1.42.1-canary-20240227
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
CHANGED
@@ -159,6 +159,14 @@ declare interface EditLink {
|
|
159
159
|
text?: string;
|
160
160
|
}
|
161
161
|
|
162
|
+
declare interface Feature {
|
163
|
+
icon: string;
|
164
|
+
title: string;
|
165
|
+
details: string;
|
166
|
+
span?: number;
|
167
|
+
link?: string;
|
168
|
+
}
|
169
|
+
|
162
170
|
/**
|
163
171
|
* The config of filter component
|
164
172
|
*/
|
@@ -172,6 +180,23 @@ declare interface Footer {
|
|
172
180
|
message?: string;
|
173
181
|
}
|
174
182
|
|
183
|
+
declare interface FrontMatterMeta {
|
184
|
+
title?: string;
|
185
|
+
description?: string;
|
186
|
+
overview?: boolean;
|
187
|
+
pageType?: PageType;
|
188
|
+
features?: Feature[];
|
189
|
+
hero?: Hero;
|
190
|
+
sidebar?: boolean;
|
191
|
+
outline?: boolean;
|
192
|
+
lineNumbers?: boolean;
|
193
|
+
overviewHeaders?: number[];
|
194
|
+
titleSuffix?: string;
|
195
|
+
head?: [string, Record<string, string>][];
|
196
|
+
context?: string;
|
197
|
+
[key: string]: unknown;
|
198
|
+
}
|
199
|
+
|
175
200
|
declare interface Header {
|
176
201
|
id: string;
|
177
202
|
text: string;
|
@@ -179,6 +204,30 @@ declare interface Header {
|
|
179
204
|
charIndex: number;
|
180
205
|
}
|
181
206
|
|
207
|
+
declare interface Hero {
|
208
|
+
name: string;
|
209
|
+
text: string;
|
210
|
+
tagline: string;
|
211
|
+
image?: {
|
212
|
+
src: string | {
|
213
|
+
dark: string;
|
214
|
+
light: string;
|
215
|
+
};
|
216
|
+
alt: string;
|
217
|
+
/**
|
218
|
+
* `srcset` and `sizes` are attributes of `<img>` tag. Please refer to https://mdn.io/srcset for the usage.
|
219
|
+
* When the value is an array, rspress will join array members with commas.
|
220
|
+
**/
|
221
|
+
sizes?: string | string[];
|
222
|
+
srcset?: string | string[];
|
223
|
+
};
|
224
|
+
actions: {
|
225
|
+
text: string;
|
226
|
+
link: string;
|
227
|
+
theme: 'brand' | 'alt';
|
228
|
+
}[];
|
229
|
+
}
|
230
|
+
|
182
231
|
declare interface Locale {
|
183
232
|
lang: string;
|
184
233
|
label: string;
|
@@ -310,20 +359,22 @@ declare interface Options {
|
|
310
359
|
* "_foo" is the private field that won't be written to search-index.json file
|
311
360
|
* and should not be used in the runtime (usePageData).
|
312
361
|
*/
|
313
|
-
declare
|
362
|
+
declare interface PageIndexInfo {
|
314
363
|
id: number;
|
315
364
|
title: string;
|
316
365
|
routePath: string;
|
317
366
|
toc: Header[];
|
318
367
|
content: string;
|
319
368
|
_html: string;
|
320
|
-
frontmatter:
|
369
|
+
frontmatter: FrontMatterMeta;
|
321
370
|
lang: string;
|
322
371
|
version: string;
|
323
372
|
domain: string;
|
324
373
|
_filepath: string;
|
325
374
|
_relativePath: string;
|
326
|
-
}
|
375
|
+
}
|
376
|
+
|
377
|
+
declare type PageType = 'home' | 'doc' | 'custom' | '404' | 'blank';
|
327
378
|
|
328
379
|
/**
|
329
380
|
* The plugin is used to add medium-zoom to the doc site.
|
@@ -421,9 +472,7 @@ declare interface RspressPlugin {
|
|
421
472
|
/**
|
422
473
|
* Extend every page's data
|
423
474
|
*/
|
424
|
-
extendPageData?: (pageData: PageIndexInfo
|
425
|
-
[key: string]: unknown;
|
426
|
-
}, isProd: boolean) => void | Promise<void>;
|
475
|
+
extendPageData?: (pageData: PageIndexInfo, isProd: boolean) => void | Promise<void>;
|
427
476
|
/**
|
428
477
|
* Add custom route
|
429
478
|
*/
|
@@ -646,15 +695,15 @@ declare interface UserConfig<ThemeConfig = DefaultThemeConfig> {
|
|
646
695
|
/**
|
647
696
|
* Whether to enable language parity checking
|
648
697
|
*/
|
649
|
-
enabled
|
698
|
+
enabled?: boolean;
|
650
699
|
/**
|
651
700
|
* Directories to include in the parity check
|
652
701
|
*/
|
653
|
-
include
|
702
|
+
include?: string[];
|
654
703
|
/**
|
655
704
|
* Directories to exclude from the parity check
|
656
705
|
*/
|
657
|
-
exclude
|
706
|
+
exclude?: string[];
|
658
707
|
};
|
659
708
|
}
|
660
709
|
|
package/dist/index.js
CHANGED
@@ -23,7 +23,7 @@ function pluginMediumZoom(options = {}) {
|
|
23
23
|
name: '@rspress/plugin-medium-zoom',
|
24
24
|
globalUIComponents: [
|
25
25
|
[
|
26
|
-
__WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__["default"].
|
26
|
+
__WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__["default"].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": "1.42.
|
3
|
+
"version": "1.42.1-canary-20240227",
|
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": {
|
@@ -21,21 +21,21 @@
|
|
21
21
|
"types": "./dist/index.d.ts",
|
22
22
|
"files": [
|
23
23
|
"dist",
|
24
|
-
"
|
24
|
+
"static"
|
25
25
|
],
|
26
26
|
"dependencies": {
|
27
27
|
"medium-zoom": "1.1.0"
|
28
28
|
},
|
29
29
|
"devDependencies": {
|
30
30
|
"@microsoft/api-extractor": "^7.49.2",
|
31
|
-
"@
|
32
|
-
"@rslib/core": "0.4.1",
|
31
|
+
"@rslib/core": "0.5.2",
|
33
32
|
"@types/node": "^18.11.17",
|
34
33
|
"@types/react": "^18.3.18",
|
35
34
|
"@types/react-dom": "^18.3.5",
|
36
35
|
"react": "^18.3.1",
|
37
36
|
"typescript": "^5.5.3",
|
38
|
-
"@rspress/
|
37
|
+
"@rspress/config": "1.0.0",
|
38
|
+
"@rspress/shared": "1.42.1-canary-20240227"
|
39
39
|
},
|
40
40
|
"peerDependencies": {
|
41
41
|
"@rspress/runtime": "^1.42.0"
|
@@ -48,7 +48,6 @@
|
|
48
48
|
"provenance": true,
|
49
49
|
"registry": "https://registry.npmjs.org/"
|
50
50
|
},
|
51
|
-
"jsnext:source": "./src/index.ts",
|
52
51
|
"scripts": {
|
53
52
|
"build": "rslib build",
|
54
53
|
"dev": "rslib build -w",
|
package/src/env.d.ts
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
/// <reference types='@rslib/core/types' />
|
package/src/index.ts
DELETED
@@ -1,25 +0,0 @@
|
|
1
|
-
import path from 'node:path';
|
2
|
-
import { fileURLToPath } from 'node:url';
|
3
|
-
import { type RspressPlugin, normalizePosixPath } from '@rspress/shared';
|
4
|
-
import type { ZoomOptions } from 'medium-zoom';
|
5
|
-
|
6
|
-
interface Options {
|
7
|
-
selector?: string;
|
8
|
-
options?: ZoomOptions;
|
9
|
-
}
|
10
|
-
|
11
|
-
/**
|
12
|
-
* The plugin is used to add medium-zoom to the doc site.
|
13
|
-
*/
|
14
|
-
export function pluginMediumZoom(options: Options = {}): RspressPlugin {
|
15
|
-
const __dirname = normalizePosixPath(
|
16
|
-
path.dirname(fileURLToPath(import.meta.url)),
|
17
|
-
);
|
18
|
-
|
19
|
-
return {
|
20
|
-
name: '@rspress/plugin-medium-zoom',
|
21
|
-
globalUIComponents: [
|
22
|
-
[path.posix.join(__dirname, '../src/components/MediumZoom.tsx'), options],
|
23
|
-
],
|
24
|
-
};
|
25
|
-
}
|
File without changes
|
File without changes
|