@rspress/shared 0.0.0-next-20240306032153 → 0.0.0-next-20240407073144

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
@@ -140,6 +140,11 @@ interface Config$1 {
140
140
  * @default false
141
141
  */
142
142
  enableScrollToTop?: boolean;
143
+ /**
144
+ * Whether to redirect to the closest locale when the user visits the site
145
+ * @default 'auto'
146
+ */
147
+ localeRedirect?: 'auto' | 'never';
143
148
  }
144
149
  /**
145
150
  * locale config
@@ -196,8 +201,9 @@ type Image = string | {
196
201
  src: string;
197
202
  alt?: string;
198
203
  };
204
+ type OverViewDepth = 'h1' | 'h2';
199
205
  interface Sidebar {
200
- [path: string]: (SidebarGroup | SidebarItem | SidebarDivider)[];
206
+ [path: string]: (SidebarGroup | SidebarItem | SidebarDivider | SidebarSectionHeader)[];
201
207
  }
202
208
  interface SidebarGroup {
203
209
  text: string;
@@ -210,6 +216,7 @@ interface SidebarGroup {
210
216
  * For hmr usage in development
211
217
  */
212
218
  _fileKey?: string;
219
+ overviewDepth?: OverViewDepth;
213
220
  }
214
221
  type SidebarItem = {
215
222
  text: string;
@@ -219,10 +226,15 @@ type SidebarItem = {
219
226
  * For hmr usage in development
220
227
  */
221
228
  _fileKey?: string;
229
+ overviewDepth?: OverViewDepth;
222
230
  };
223
231
  type SidebarDivider = {
224
232
  dividerType: 'dashed' | 'solid';
225
233
  };
234
+ type SidebarSectionHeader = {
235
+ sectionHeaderText: string;
236
+ tag?: string;
237
+ };
226
238
  interface EditLink {
227
239
  /**
228
240
  * Custom repository url for edit link.
@@ -406,6 +418,10 @@ interface UserConfig<ThemeConfig = Config$1> {
406
418
  dark: string;
407
419
  light: string;
408
420
  };
421
+ /**
422
+ * The text of the logo in nav bar.
423
+ */
424
+ logoText?: string;
409
425
  /**
410
426
  * Base path of the site.
411
427
  */
@@ -529,6 +545,7 @@ interface SiteData<ThemeConfig = NormalizedConfig> {
529
545
  dark: string;
530
546
  light: string;
531
547
  };
548
+ logoText: string;
532
549
  pages: BaseRuntimePageInfo[];
533
550
  search: SearchOptions;
534
551
  ssg: boolean;
@@ -744,4 +761,4 @@ declare function removeBase(url: string, base: string): string;
744
761
  declare function withoutHash(url: string): string;
745
762
  declare const mergeDocConfig: (...configs: UserConfig[]) => UserConfig;
746
763
 
747
- export { APPEARANCE_KEY, type AdditionalPage, type BaseRuntimePageInfo, type Config, DEFAULT_HIGHLIGHT_LANGUAGES, type Config$1 as DefaultThemeConfig, type DocFooter, type EditLink, type Feature, type Footer, type FrontMatterMeta, HASH_REGEXP, type Header, type Hero, type Image, type LocalSearchOptions, type Locale, type LocaleConfig, type LocaleLink, type LocaleLinks, MDX_REGEXP, type MarkdownOptions, type MdxRsOptions, type Nav, type NavItem, type NavItemWithChildren, type NavItemWithLink, type NavItemWithLinkAndChildren, type NormalizedConfig, type NormalizedConfig as NormalizedDefaultThemeConfig, type NormalizedLocales, type NormalizedSidebar, type NormalizedSidebarGroup, type PageData, type PageIndexInfo, type PageModule, type PageType, type RspressPlugin as Plugin, QUERY_REGEXP, RSPRESS_TEMP_DIR, type RemotePageInfo, type RemoteSearchIndexInfo, type RemoteSearchOptions, type ReplaceRule, type Route, type RouteMeta, type RouteOptions, type RspressPlugin, SEARCH_INDEX_NAME, type SearchHooks, type SearchOptions, type Sidebar, type SidebarDivider, type SidebarGroup, type SidebarItem, type SiteData, type SocialLink, type SocialLinkIcon, type 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 };
764
+ export { APPEARANCE_KEY, type AdditionalPage, type BaseRuntimePageInfo, type Config, DEFAULT_HIGHLIGHT_LANGUAGES, type Config$1 as DefaultThemeConfig, type DocFooter, type EditLink, type Feature, type Footer, type FrontMatterMeta, HASH_REGEXP, type Header, type Hero, type Image, type LocalSearchOptions, type Locale, type LocaleConfig, type LocaleLink, type LocaleLinks, MDX_REGEXP, type MarkdownOptions, type MdxRsOptions, type Nav, type NavItem, type NavItemWithChildren, type NavItemWithLink, type NavItemWithLinkAndChildren, type NormalizedConfig, type NormalizedConfig as NormalizedDefaultThemeConfig, type NormalizedLocales, type NormalizedSidebar, type NormalizedSidebarGroup, type OverViewDepth, type PageData, type PageIndexInfo, type PageModule, type PageType, type RspressPlugin as Plugin, QUERY_REGEXP, RSPRESS_TEMP_DIR, type RemotePageInfo, type RemoteSearchIndexInfo, type RemoteSearchOptions, type ReplaceRule, type Route, type RouteMeta, type RouteOptions, type RspressPlugin, SEARCH_INDEX_NAME, type SearchHooks, type SearchOptions, type Sidebar, type SidebarDivider, type SidebarGroup, type SidebarItem, type SidebarSectionHeader, type SiteData, type SocialLink, type SocialLinkIcon, type 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
@@ -1151,7 +1151,6 @@ function normalizePosixPath(id) {
1151
1151
  const normalizedParts = [];
1152
1152
  for (const part of parts) {
1153
1153
  if (part === "." || part === "") {
1154
- continue;
1155
1154
  } else if (part === "..") {
1156
1155
  if (normalizedParts.length > 0 && normalizedParts[normalizedParts.length - 1] !== "..") {
1157
1156
  normalizedParts.pop();
package/dist/index.mjs CHANGED
@@ -1093,7 +1093,6 @@ function normalizePosixPath(id) {
1093
1093
  const normalizedParts = [];
1094
1094
  for (const part of parts) {
1095
1095
  if (part === "." || part === "") {
1096
- continue;
1097
1096
  } else if (part === "..") {
1098
1097
  if (normalizedParts.length > 0 && normalizedParts[normalizedParts.length - 1] !== "..") {
1099
1098
  normalizedParts.pop();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rspress/shared",
3
- "version": "0.0.0-next-20240306032153",
3
+ "version": "0.0.0-next-20240407073144",
4
4
  "types": "./dist/index.d.ts",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
@@ -42,7 +42,7 @@
42
42
  }
43
43
  },
44
44
  "dependencies": {
45
- "@rsbuild/core": "0.4.11",
45
+ "@rsbuild/core": "0.5.1",
46
46
  "unified": "10.1.2",
47
47
  "chalk": "4.1.2",
48
48
  "execa": "5.1.1",