@rspress/shared 0.0.0-nightly-20231105160159 → 0.0.0-nightly-20231107160249
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 +12 -6
- package/dist/index.js +5 -0
- package/dist/index.mjs +4 -0
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
@@ -65,9 +65,11 @@ interface Config$1 {
|
|
65
65
|
*/
|
66
66
|
outline?: boolean;
|
67
67
|
/**
|
68
|
-
* The nav items.
|
68
|
+
* The nav items. When it's an object, the key is the version of current doc.
|
69
69
|
*/
|
70
|
-
nav?: NavItem[]
|
70
|
+
nav?: NavItem[] | {
|
71
|
+
[key: string]: NavItem[];
|
72
|
+
};
|
71
73
|
/**
|
72
74
|
* The sidebar items.
|
73
75
|
*/
|
@@ -141,7 +143,7 @@ interface LocaleConfig {
|
|
141
143
|
/**
|
142
144
|
* Theme i18n config
|
143
145
|
*/
|
144
|
-
nav?:
|
146
|
+
nav?: Nav;
|
145
147
|
sidebar?: Sidebar;
|
146
148
|
outlineTitle?: string;
|
147
149
|
lastUpdatedText?: string;
|
@@ -151,6 +153,9 @@ interface LocaleConfig {
|
|
151
153
|
nextPageText?: string;
|
152
154
|
langRoutePrefix?: string;
|
153
155
|
}
|
156
|
+
type Nav = NavItem[] | {
|
157
|
+
[key: string]: NavItem[];
|
158
|
+
};
|
154
159
|
type NavItem = NavItemWithLink | NavItemWithChildren | NavItemWithLinkAndChildren;
|
155
160
|
type NavItemWithLink = {
|
156
161
|
text: string;
|
@@ -162,13 +167,13 @@ type NavItemWithLink = {
|
|
162
167
|
interface NavItemWithChildren {
|
163
168
|
text?: string;
|
164
169
|
tag?: string;
|
165
|
-
items:
|
170
|
+
items: NavItemWithLink[];
|
166
171
|
position?: 'left' | 'right';
|
167
172
|
}
|
168
173
|
interface NavItemWithLinkAndChildren {
|
169
174
|
text: string;
|
170
175
|
link: string;
|
171
|
-
items:
|
176
|
+
items: NavItemWithLink[];
|
172
177
|
tag?: string;
|
173
178
|
activeMatch?: string;
|
174
179
|
position?: 'left' | 'right';
|
@@ -668,6 +673,7 @@ declare function normalizePosixPath(id: string): string;
|
|
668
673
|
declare const inBrowser: () => boolean;
|
669
674
|
declare function addLeadingSlash(url: string): string;
|
670
675
|
declare function removeLeadingSlash(url: string): string;
|
676
|
+
declare function addTrailingSlash(url: string): string;
|
671
677
|
declare function removeTrailingSlash(url: string): string;
|
672
678
|
declare function normalizeSlash(url: string): string;
|
673
679
|
declare function isExternalUrl(url: string): boolean;
|
@@ -699,4 +705,4 @@ declare function removeBase(url: string, base: string): string;
|
|
699
705
|
declare function withoutHash(url: string): string;
|
700
706
|
declare const mergeDocConfig: (...configs: UserConfig[]) => UserConfig;
|
701
707
|
|
702
|
-
export { APPEARANCE_KEY, AdditionalPage, BaseRuntimePageInfo, Config, Config$1 as DefaultThemeConfig, DocFooter, EditLink, Feature, Footer, FrontMatterMeta, HASH_REGEXP, Header, Hero, Image, LocalSearchOptions, Locale, LocaleConfig, LocaleLink, LocaleLinks, MDX_REGEXP, MarkdownOptions, 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, SidebarGroup, SidebarItem, SiteData, SocialLink, SocialLinkIcon, UserConfig, addLeadingSlash, cleanUrl, inBrowser, isDebugMode, isExternalUrl, isProduction, isSCM, mergeDocConfig, normalizeHref, normalizePosixPath, normalizeSlash, omit, parseUrl, removeBase, removeLeadingSlash, removeTrailingSlash, replaceLang, replaceVersion, slash, withBase, withoutBase, withoutHash, withoutLang };
|
708
|
+
export { APPEARANCE_KEY, AdditionalPage, BaseRuntimePageInfo, Config, 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, SidebarGroup, SidebarItem, SiteData, SocialLink, SocialLinkIcon, UserConfig, addLeadingSlash, addTrailingSlash, cleanUrl, inBrowser, isDebugMode, isExternalUrl, isProduction, isSCM, mergeDocConfig, normalizeHref, normalizePosixPath, normalizeSlash, omit, parseUrl, removeBase, removeLeadingSlash, removeTrailingSlash, replaceLang, replaceVersion, slash, withBase, withoutBase, withoutHash, withoutLang };
|
package/dist/index.js
CHANGED
@@ -27,6 +27,7 @@ __export(src_exports, {
|
|
27
27
|
RSPRESS_TEMP_DIR: () => RSPRESS_TEMP_DIR,
|
28
28
|
SEARCH_INDEX_NAME: () => SEARCH_INDEX_NAME,
|
29
29
|
addLeadingSlash: () => addLeadingSlash,
|
30
|
+
addTrailingSlash: () => addTrailingSlash,
|
30
31
|
cleanUrl: () => cleanUrl,
|
31
32
|
inBrowser: () => inBrowser,
|
32
33
|
isDebugMode: () => isDebugMode,
|
@@ -1152,6 +1153,9 @@ function addLeadingSlash(url) {
|
|
1152
1153
|
function removeLeadingSlash(url) {
|
1153
1154
|
return url.charAt(0) === "/" ? url.slice(1) : url;
|
1154
1155
|
}
|
1156
|
+
function addTrailingSlash(url) {
|
1157
|
+
return url.charAt(url.length - 1) === "/" ? url : `${url}/`;
|
1158
|
+
}
|
1155
1159
|
function removeTrailingSlash(url) {
|
1156
1160
|
return url.charAt(url.length - 1) === "/" ? url.slice(0, -1) : url;
|
1157
1161
|
}
|
@@ -1290,6 +1294,7 @@ var mergeDocConfig = (...configs) => mergeWith_default({}, ...configs, (target,
|
|
1290
1294
|
RSPRESS_TEMP_DIR,
|
1291
1295
|
SEARCH_INDEX_NAME,
|
1292
1296
|
addLeadingSlash,
|
1297
|
+
addTrailingSlash,
|
1293
1298
|
cleanUrl,
|
1294
1299
|
inBrowser,
|
1295
1300
|
isDebugMode,
|
package/dist/index.mjs
CHANGED
@@ -1098,6 +1098,9 @@ function addLeadingSlash(url) {
|
|
1098
1098
|
function removeLeadingSlash(url) {
|
1099
1099
|
return url.charAt(0) === "/" ? url.slice(1) : url;
|
1100
1100
|
}
|
1101
|
+
function addTrailingSlash(url) {
|
1102
|
+
return url.charAt(url.length - 1) === "/" ? url : `${url}/`;
|
1103
|
+
}
|
1101
1104
|
function removeTrailingSlash(url) {
|
1102
1105
|
return url.charAt(url.length - 1) === "/" ? url.slice(0, -1) : url;
|
1103
1106
|
}
|
@@ -1235,6 +1238,7 @@ export {
|
|
1235
1238
|
RSPRESS_TEMP_DIR,
|
1236
1239
|
SEARCH_INDEX_NAME,
|
1237
1240
|
addLeadingSlash,
|
1241
|
+
addTrailingSlash,
|
1238
1242
|
cleanUrl,
|
1239
1243
|
inBrowser,
|
1240
1244
|
isDebugMode,
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@rspress/shared",
|
3
|
-
"version": "0.0.0-nightly-
|
3
|
+
"version": "0.0.0-nightly-20231107160249",
|
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.0.
|
25
|
+
"@rsbuild/core": "0.0.14",
|
26
26
|
"unified": "10.1.2",
|
27
27
|
"chalk": "4.1.2",
|
28
28
|
"rslog": "^1.1.0"
|