@rspress/shared 2.0.8 → 2.0.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.
- package/dist/584.js +710 -0
- package/dist/github-slugger.d.ts +47 -0
- package/dist/github-slugger.js +29 -0
- package/dist/gray-matter.d.ts +14 -0
- package/dist/gray-matter.js +2772 -0
- package/dist/gray-matter.js.LICENSE.txt +13 -0
- package/dist/index.d.ts +16 -1
- package/dist/index.js +3 -1
- package/dist/lodash-es.d.ts +14 -0
- package/dist/lodash-es.js +678 -0
- package/dist/node-utils.d.ts +16 -1
- package/dist/node-utils.js +4 -6
- package/dist/rslib-runtime.js +38 -0
- package/package.json +18 -5
- package/LICENSE +0 -21
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* is-extendable <https://github.com/jonschlinkert/is-extendable>
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) 2015, Jon Schlinkert.
|
|
5
|
+
* Licensed under the MIT License.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
/*!
|
|
9
|
+
* strip-bom-string <https://github.com/jonschlinkert/strip-bom-string>
|
|
10
|
+
*
|
|
11
|
+
* Copyright (c) 2015, 2017, Jon Schlinkert.
|
|
12
|
+
* Released under the MIT License.
|
|
13
|
+
*/
|
package/dist/index.d.ts
CHANGED
|
@@ -74,7 +74,7 @@ export declare interface FrontMatterMeta {
|
|
|
74
74
|
hero?: Hero;
|
|
75
75
|
tag?: string;
|
|
76
76
|
navbar?: boolean;
|
|
77
|
-
sidebar?: boolean;
|
|
77
|
+
sidebar?: boolean | 'placeholder';
|
|
78
78
|
outline?: boolean;
|
|
79
79
|
footer?: boolean;
|
|
80
80
|
lineNumbers?: boolean;
|
|
@@ -155,6 +155,10 @@ export declare interface I18nText {
|
|
|
155
155
|
codeButtonGroupCopyButtonText?: I18nTextValue;
|
|
156
156
|
notFoundText?: I18nTextValue;
|
|
157
157
|
takeMeHomeText?: I18nTextValue;
|
|
158
|
+
promptCopyText?: I18nTextValue;
|
|
159
|
+
promptCopiedText?: I18nTextValue;
|
|
160
|
+
promptExpandText?: I18nTextValue;
|
|
161
|
+
promptCollapseText?: I18nTextValue;
|
|
158
162
|
}
|
|
159
163
|
|
|
160
164
|
declare type I18nTextValue = {
|
|
@@ -252,6 +256,7 @@ export declare interface MarkdownOptions {
|
|
|
252
256
|
remarkPlugins?: PluggableList;
|
|
253
257
|
rehypePlugins?: PluggableList;
|
|
254
258
|
link?: RemarkLinkOptions;
|
|
259
|
+
image?: RemarkImageOptions;
|
|
255
260
|
showLineNumbers?: boolean;
|
|
256
261
|
/**
|
|
257
262
|
* Whether to wrap code by default
|
|
@@ -428,6 +433,16 @@ export declare const parseUrl: (url: string) => {
|
|
|
428
433
|
|
|
429
434
|
export declare const QUERY_REGEXP: RegExp;
|
|
430
435
|
|
|
436
|
+
export declare type RemarkImageOptions = {
|
|
437
|
+
/**
|
|
438
|
+
* Whether to enable check dead images
|
|
439
|
+
* @default true
|
|
440
|
+
*/
|
|
441
|
+
checkDeadImages?: boolean | {
|
|
442
|
+
excludes: string[] | ((url: string) => boolean);
|
|
443
|
+
};
|
|
444
|
+
};
|
|
445
|
+
|
|
431
446
|
export declare type RemarkLinkOptions = {
|
|
432
447
|
/**
|
|
433
448
|
* Whether to enable check dead links
|
package/dist/index.js
CHANGED
|
@@ -48,8 +48,10 @@ function addTrailingSlash(url) {
|
|
|
48
48
|
function removeTrailingSlash(url) {
|
|
49
49
|
return '/' === url.charAt(url.length - 1) ? url.slice(0, -1) : url;
|
|
50
50
|
}
|
|
51
|
+
const EXTERNAL_URL_SCHEME_REGEXP = /^[a-zA-Z][a-zA-Z\d+\-.]*:/;
|
|
52
|
+
const UNSAFE_EXTERNAL_URL_SCHEME_REGEXP = /^(?:javascript|data|file):/i;
|
|
51
53
|
function isExternalUrl(url = '') {
|
|
52
|
-
return
|
|
54
|
+
return EXTERNAL_URL_SCHEME_REGEXP.test(url) && !UNSAFE_EXTERNAL_URL_SCHEME_REGEXP.test(url);
|
|
53
55
|
}
|
|
54
56
|
function isDataUrl(url = '') {
|
|
55
57
|
return /^\s*data:/i.test(url);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { chunk } from 'lodash';
|
|
2
|
+
import { debounce } from 'lodash';
|
|
3
|
+
import { groupBy } from 'lodash';
|
|
4
|
+
import { mergeWith } from 'lodash';
|
|
5
|
+
|
|
6
|
+
export { chunk }
|
|
7
|
+
|
|
8
|
+
export { debounce }
|
|
9
|
+
|
|
10
|
+
export { groupBy }
|
|
11
|
+
|
|
12
|
+
export { mergeWith }
|
|
13
|
+
|
|
14
|
+
export { }
|