@rspress/shared 1.8.0 → 1.8.1
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 +2 -1
- package/dist/index.js +5 -0
- package/dist/index.mjs +4 -0
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
@@ -686,6 +686,7 @@ declare function addTrailingSlash(url: string): string;
|
|
686
686
|
declare function removeTrailingSlash(url: string): string;
|
687
687
|
declare function normalizeSlash(url: string): string;
|
688
688
|
declare function isExternalUrl(url?: string): boolean;
|
689
|
+
declare function isDataUrl(url?: string): boolean;
|
689
690
|
declare function replaceLang(rawUrl: string, lang: {
|
690
691
|
current: string;
|
691
692
|
target: string;
|
@@ -714,4 +715,4 @@ declare function removeBase(url: string, base: string): string;
|
|
714
715
|
declare function withoutHash(url: string): string;
|
715
716
|
declare const mergeDocConfig: (...configs: UserConfig[]) => UserConfig;
|
716
717
|
|
717
|
-
export { APPEARANCE_KEY, AdditionalPage, BaseRuntimePageInfo, Config, DEFAULT_HIGHLIGHT_LANGUAGES, Config$1 as DefaultThemeConfig, DocFooter, EditLink, Feature, Footer, FrontMatterMeta, HASH_REGEXP, Header, Hero, Image, LocalSearchOptions, Locale, LocaleConfig, LocaleLink, LocaleLinks, MDX_REGEXP, MarkdownOptions, Nav, NavItem, NavItemWithChildren, NavItemWithLink, NavItemWithLinkAndChildren, NormalizedConfig, NormalizedConfig as NormalizedDefaultThemeConfig, NormalizedLocales, NormalizedSidebar, NormalizedSidebarGroup, PageData, PageIndexInfo, PageModule, PageType, RspressPlugin as Plugin, QUERY_REGEXP, RSPRESS_TEMP_DIR, RemotePageInfo, RemoteSearchIndexInfo, RemoteSearchOptions, ReplaceRule, Route, RouteMeta, RouteOptions, RspressPlugin, SEARCH_INDEX_NAME, SearchHooks, SearchOptions, Sidebar, SidebarDivider, SidebarGroup, SidebarItem, SiteData, SocialLink, SocialLinkIcon, UserConfig, addLeadingSlash, addTrailingSlash, cleanUrl, inBrowser, isDebugMode, isExternalUrl, isProduction, isSCM, mergeDocConfig, normalizeHref, normalizePosixPath, normalizeSlash, omit, parseUrl, removeBase, removeHash, removeLeadingSlash, removeTrailingSlash, replaceLang, replaceVersion, slash, withBase, withoutBase, withoutHash, withoutLang };
|
718
|
+
export { APPEARANCE_KEY, AdditionalPage, BaseRuntimePageInfo, Config, DEFAULT_HIGHLIGHT_LANGUAGES, Config$1 as DefaultThemeConfig, DocFooter, EditLink, Feature, Footer, FrontMatterMeta, HASH_REGEXP, Header, Hero, Image, LocalSearchOptions, Locale, LocaleConfig, LocaleLink, LocaleLinks, MDX_REGEXP, MarkdownOptions, Nav, NavItem, NavItemWithChildren, NavItemWithLink, NavItemWithLinkAndChildren, NormalizedConfig, NormalizedConfig as NormalizedDefaultThemeConfig, NormalizedLocales, NormalizedSidebar, NormalizedSidebarGroup, PageData, PageIndexInfo, PageModule, PageType, RspressPlugin as Plugin, QUERY_REGEXP, RSPRESS_TEMP_DIR, RemotePageInfo, RemoteSearchIndexInfo, RemoteSearchOptions, ReplaceRule, Route, RouteMeta, RouteOptions, RspressPlugin, SEARCH_INDEX_NAME, SearchHooks, SearchOptions, Sidebar, SidebarDivider, SidebarGroup, SidebarItem, SiteData, SocialLink, SocialLinkIcon, UserConfig, addLeadingSlash, addTrailingSlash, cleanUrl, inBrowser, isDataUrl, isDebugMode, isExternalUrl, isProduction, isSCM, mergeDocConfig, normalizeHref, normalizePosixPath, normalizeSlash, omit, parseUrl, removeBase, removeHash, removeLeadingSlash, removeTrailingSlash, replaceLang, replaceVersion, slash, withBase, withoutBase, withoutHash, withoutLang };
|
package/dist/index.js
CHANGED
@@ -31,6 +31,7 @@ __export(src_exports, {
|
|
31
31
|
addTrailingSlash: () => addTrailingSlash,
|
32
32
|
cleanUrl: () => cleanUrl,
|
33
33
|
inBrowser: () => inBrowser,
|
34
|
+
isDataUrl: () => isDataUrl,
|
34
35
|
isDebugMode: () => isDebugMode,
|
35
36
|
isExternalUrl: () => isExternalUrl,
|
36
37
|
isProduction: () => isProduction,
|
@@ -1186,6 +1187,9 @@ function normalizeSlash(url) {
|
|
1186
1187
|
function isExternalUrl(url = "") {
|
1187
1188
|
return url.startsWith("http://") || url.startsWith("https://") || url.startsWith("mailto:") || url.startsWith("tel:");
|
1188
1189
|
}
|
1190
|
+
function isDataUrl(url = "") {
|
1191
|
+
return /^\s*data:/i.test(url);
|
1192
|
+
}
|
1189
1193
|
function replaceLang(rawUrl, lang, version, base = "") {
|
1190
1194
|
let url = removeBase(rawUrl, base);
|
1191
1195
|
if (!url) {
|
@@ -1323,6 +1327,7 @@ var mergeDocConfig = (...configs) => mergeWith_default({}, ...configs, (target,
|
|
1323
1327
|
addTrailingSlash,
|
1324
1328
|
cleanUrl,
|
1325
1329
|
inBrowser,
|
1330
|
+
isDataUrl,
|
1326
1331
|
isDebugMode,
|
1327
1332
|
isExternalUrl,
|
1328
1333
|
isProduction,
|
package/dist/index.mjs
CHANGED
@@ -1129,6 +1129,9 @@ function normalizeSlash(url) {
|
|
1129
1129
|
function isExternalUrl(url = "") {
|
1130
1130
|
return url.startsWith("http://") || url.startsWith("https://") || url.startsWith("mailto:") || url.startsWith("tel:");
|
1131
1131
|
}
|
1132
|
+
function isDataUrl(url = "") {
|
1133
|
+
return /^\s*data:/i.test(url);
|
1134
|
+
}
|
1132
1135
|
function replaceLang(rawUrl, lang, version, base = "") {
|
1133
1136
|
let url = removeBase(rawUrl, base);
|
1134
1137
|
if (!url) {
|
@@ -1265,6 +1268,7 @@ export {
|
|
1265
1268
|
addTrailingSlash,
|
1266
1269
|
cleanUrl,
|
1267
1270
|
inBrowser,
|
1271
|
+
isDataUrl,
|
1268
1272
|
isDebugMode,
|
1269
1273
|
isExternalUrl,
|
1270
1274
|
isProduction,
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@rspress/shared",
|
3
|
-
"version": "1.8.
|
3
|
+
"version": "1.8.1",
|
4
4
|
"types": "./dist/index.d.ts",
|
5
5
|
"main": "./dist/index.js",
|
6
6
|
"module": "./dist/index.mjs",
|
@@ -22,7 +22,7 @@
|
|
22
22
|
}
|
23
23
|
},
|
24
24
|
"dependencies": {
|
25
|
-
"@rsbuild/core": "0.1.
|
25
|
+
"@rsbuild/core": "0.1.9",
|
26
26
|
"unified": "10.1.2",
|
27
27
|
"chalk": "4.1.2",
|
28
28
|
"rslog": "^1.1.0"
|