@rspress/shared 0.0.0-nightly-20231107160249 → 0.0.0-nightly-20231109160316
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 +9 -5
- package/dist/index.js +5 -0
- package/dist/index.mjs +4 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
@@ -183,13 +183,13 @@ type Image = string | {
|
|
183
183
|
alt?: string;
|
184
184
|
};
|
185
185
|
interface Sidebar {
|
186
|
-
[path: string]: (SidebarGroup | SidebarItem)[];
|
186
|
+
[path: string]: (SidebarGroup | SidebarItem | SidebarDivider)[];
|
187
187
|
}
|
188
188
|
interface SidebarGroup {
|
189
189
|
text: string;
|
190
190
|
link?: string;
|
191
191
|
tag?: string;
|
192
|
-
items: (SidebarItem | SidebarGroup | string)[];
|
192
|
+
items: (SidebarItem | SidebarDivider | SidebarGroup | string)[];
|
193
193
|
collapsible?: boolean;
|
194
194
|
collapsed?: boolean;
|
195
195
|
}
|
@@ -198,6 +198,9 @@ type SidebarItem = {
|
|
198
198
|
link: string;
|
199
199
|
tag?: string;
|
200
200
|
};
|
201
|
+
type SidebarDivider = {
|
202
|
+
dividerType: 'dashed' | 'solid';
|
203
|
+
};
|
201
204
|
interface EditLink {
|
202
205
|
/**
|
203
206
|
* Custom repository url for edit link.
|
@@ -240,12 +243,12 @@ interface LocaleLink {
|
|
240
243
|
link: string;
|
241
244
|
}
|
242
245
|
interface NormalizedSidebarGroup extends Omit<SidebarGroup, 'items'> {
|
243
|
-
items: (SidebarItem | NormalizedSidebarGroup)[];
|
246
|
+
items: (SidebarDivider | SidebarItem | NormalizedSidebarGroup)[];
|
244
247
|
collapsible: boolean;
|
245
248
|
collapsed: boolean;
|
246
249
|
}
|
247
250
|
interface NormalizedSidebar {
|
248
|
-
[path: string]: (NormalizedSidebarGroup | SidebarItem)[];
|
251
|
+
[path: string]: (NormalizedSidebarGroup | SidebarItem | SidebarDivider)[];
|
249
252
|
}
|
250
253
|
interface NormalizedLocales extends Omit<LocaleConfig, 'sidebar'> {
|
251
254
|
sidebar: NormalizedSidebar;
|
@@ -669,6 +672,7 @@ declare const isProduction: () => boolean;
|
|
669
672
|
declare const isDebugMode: () => boolean;
|
670
673
|
declare const cleanUrl: (url: string) => string;
|
671
674
|
declare function slash(str: string): string;
|
675
|
+
declare function removeHash(str: string): string;
|
672
676
|
declare function normalizePosixPath(id: string): string;
|
673
677
|
declare const inBrowser: () => boolean;
|
674
678
|
declare function addLeadingSlash(url: string): string;
|
@@ -705,4 +709,4 @@ declare function removeBase(url: string, base: string): string;
|
|
705
709
|
declare function withoutHash(url: string): string;
|
706
710
|
declare const mergeDocConfig: (...configs: UserConfig[]) => UserConfig;
|
707
711
|
|
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 };
|
712
|
+
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, 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 };
|
package/dist/index.js
CHANGED
@@ -41,6 +41,7 @@ __export(src_exports, {
|
|
41
41
|
omit: () => omit,
|
42
42
|
parseUrl: () => parseUrl,
|
43
43
|
removeBase: () => removeBase,
|
44
|
+
removeHash: () => removeHash,
|
44
45
|
removeLeadingSlash: () => removeLeadingSlash,
|
45
46
|
removeTrailingSlash: () => removeTrailingSlash,
|
46
47
|
replaceLang: () => replaceLang,
|
@@ -1122,6 +1123,9 @@ var cleanUrl = (url) => url.replace(HASH_REGEXP, "").replace(QUERY_REGEXP, "");
|
|
1122
1123
|
function slash(str) {
|
1123
1124
|
return str.replace(/\\/g, "/");
|
1124
1125
|
}
|
1126
|
+
function removeHash(str) {
|
1127
|
+
return str.replace(/#.*$/, "");
|
1128
|
+
}
|
1125
1129
|
function normalizePosixPath(id) {
|
1126
1130
|
const path = slash(id);
|
1127
1131
|
const isAbsolutePath = path.startsWith("/");
|
@@ -1308,6 +1312,7 @@ var mergeDocConfig = (...configs) => mergeWith_default({}, ...configs, (target,
|
|
1308
1312
|
omit,
|
1309
1313
|
parseUrl,
|
1310
1314
|
removeBase,
|
1315
|
+
removeHash,
|
1311
1316
|
removeLeadingSlash,
|
1312
1317
|
removeTrailingSlash,
|
1313
1318
|
replaceLang,
|
package/dist/index.mjs
CHANGED
@@ -1067,6 +1067,9 @@ var cleanUrl = (url) => url.replace(HASH_REGEXP, "").replace(QUERY_REGEXP, "");
|
|
1067
1067
|
function slash(str) {
|
1068
1068
|
return str.replace(/\\/g, "/");
|
1069
1069
|
}
|
1070
|
+
function removeHash(str) {
|
1071
|
+
return str.replace(/#.*$/, "");
|
1072
|
+
}
|
1070
1073
|
function normalizePosixPath(id) {
|
1071
1074
|
const path = slash(id);
|
1072
1075
|
const isAbsolutePath = path.startsWith("/");
|
@@ -1252,6 +1255,7 @@ export {
|
|
1252
1255
|
omit,
|
1253
1256
|
parseUrl,
|
1254
1257
|
removeBase,
|
1258
|
+
removeHash,
|
1255
1259
|
removeLeadingSlash,
|
1256
1260
|
removeTrailingSlash,
|
1257
1261
|
replaceLang,
|