@rspress/shared 2.0.18 → 2.0.19

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
@@ -76,6 +76,7 @@ export declare interface FrontMatterMeta {
76
76
  pageType?: PageType;
77
77
  features?: Feature[];
78
78
  hero?: Hero;
79
+ icon?: string;
79
80
  tag?: string;
80
81
  navbar?: boolean;
81
82
  sidebar?: boolean | 'placeholder';
@@ -290,8 +291,11 @@ export declare interface LlmsTxtSection {
290
291
  */
291
292
  export declare type LlmsUI = {
292
293
  /**
293
- * Whether to inject a hidden hint into SSG HTML pages that points LLMs
294
- * to llms.txt and llms-full.txt.
294
+ * Whether to inject an LLM directive hint into generated pages. In SSG
295
+ * HTML output, it is rendered as a visually hidden plain-text DOM element
296
+ * with llms.txt, llms-full.txt, and the current page's Markdown version.
297
+ * In SSG-MD Markdown output, it is rendered as a leading blockquote
298
+ * string.
295
299
  * @default true
296
300
  */
297
301
  injectLlmsHint?: boolean;
@@ -446,6 +450,7 @@ export declare type NavItem = NavItemWithLink | NavItemWithChildren | NavItemWit
446
450
 
447
451
  export declare interface NavItemWithChildren {
448
452
  text?: string;
453
+ icon?: string;
449
454
  tag?: string;
450
455
  items: NavItem[];
451
456
  position?: 'left' | 'right';
@@ -455,6 +460,7 @@ export declare type NavItemWithLink = {
455
460
  text: string;
456
461
  link: string;
457
462
  download?: boolean;
463
+ icon?: string;
458
464
  tag?: string;
459
465
  activeMatch?: string;
460
466
  position?: 'left' | 'right';
@@ -466,6 +472,7 @@ export declare interface NavItemWithLinkAndChildren {
466
472
  text: string;
467
473
  link: string;
468
474
  items: NavItem[];
475
+ icon?: string;
469
476
  tag?: string;
470
477
  activeMatch?: string;
471
478
  position?: 'left' | 'right';
@@ -707,6 +714,12 @@ export declare interface RouteOptions {
707
714
  * @default false
708
715
  */
709
716
  cleanUrls?: boolean;
717
+ /**
718
+ * How to redirect first-time visitors to the closest configured locale
719
+ * based on their browser language.
720
+ * @default 'auto'
721
+ */
722
+ localeRedirect?: 'auto' | 'never' | 'only-default-lang';
710
723
  /**
711
724
  * Enable concurrent, optimized routing for internal links rendered by
712
725
  * Rspress' default Link component.
@@ -821,6 +834,7 @@ export declare type SidebarDivider = {
821
834
  export declare interface SidebarGroup {
822
835
  text: string;
823
836
  link?: string;
837
+ icon?: string;
824
838
  tag?: string;
825
839
  items: (SidebarGroup | SidebarItem | SidebarDivider | SidebarSectionHeader)[];
826
840
  collapsible?: boolean;
@@ -836,6 +850,7 @@ export declare interface SidebarGroup {
836
850
  export declare type SidebarItem = {
837
851
  text: string;
838
852
  link: string;
853
+ icon?: string;
839
854
  tag?: string;
840
855
  /**
841
856
  * For hmr usage in development
@@ -847,6 +862,7 @@ export declare type SidebarItem = {
847
862
 
848
863
  export declare type SidebarSectionHeader = {
849
864
  sectionHeaderText: string;
865
+ icon?: string;
850
866
  tag?: string;
851
867
  };
852
868
 
@@ -971,7 +987,8 @@ declare type ThemeConfig = {
971
987
  */
972
988
  enableScrollToTop?: boolean;
973
989
  /**
974
- * Whether to redirect to the closest locale when the user visits the site
990
+ * Whether to redirect to the closest locale when the user visits the site.
991
+ * @deprecated Use `route.localeRedirect` instead.
975
992
  * @default 'auto'
976
993
  */
977
994
  localeRedirect?: 'auto' | 'never' | 'only-default-lang';
@@ -73,6 +73,7 @@ declare interface FrontMatterMeta {
73
73
  pageType?: PageType;
74
74
  features?: Feature[];
75
75
  hero?: Hero;
76
+ icon?: string;
76
77
  tag?: string;
77
78
  navbar?: boolean;
78
79
  sidebar?: boolean | 'placeholder';
@@ -277,8 +278,11 @@ declare interface LlmsTxtSection {
277
278
  */
278
279
  declare type LlmsUI = {
279
280
  /**
280
- * Whether to inject a hidden hint into SSG HTML pages that points LLMs
281
- * to llms.txt and llms-full.txt.
281
+ * Whether to inject an LLM directive hint into generated pages. In SSG
282
+ * HTML output, it is rendered as a visually hidden plain-text DOM element
283
+ * with llms.txt, llms-full.txt, and the current page's Markdown version.
284
+ * In SSG-MD Markdown output, it is rendered as a leading blockquote
285
+ * string.
282
286
  * @default true
283
287
  */
284
288
  injectLlmsHint?: boolean;
@@ -430,6 +434,7 @@ declare type NavItem = NavItemWithLink | NavItemWithChildren | NavItemWithLinkAn
430
434
 
431
435
  declare interface NavItemWithChildren {
432
436
  text?: string;
437
+ icon?: string;
433
438
  tag?: string;
434
439
  items: NavItem[];
435
440
  position?: 'left' | 'right';
@@ -439,6 +444,7 @@ declare type NavItemWithLink = {
439
444
  text: string;
440
445
  link: string;
441
446
  download?: boolean;
447
+ icon?: string;
442
448
  tag?: string;
443
449
  activeMatch?: string;
444
450
  position?: 'left' | 'right';
@@ -450,6 +456,7 @@ declare interface NavItemWithLinkAndChildren {
450
456
  text: string;
451
457
  link: string;
452
458
  items: NavItem[];
459
+ icon?: string;
453
460
  tag?: string;
454
461
  activeMatch?: string;
455
462
  position?: 'left' | 'right';
@@ -581,6 +588,12 @@ declare interface RouteOptions {
581
588
  * @default false
582
589
  */
583
590
  cleanUrls?: boolean;
591
+ /**
592
+ * How to redirect first-time visitors to the closest configured locale
593
+ * based on their browser language.
594
+ * @default 'auto'
595
+ */
596
+ localeRedirect?: 'auto' | 'never' | 'only-default-lang';
584
597
  /**
585
598
  * Enable concurrent, optimized routing for internal links rendered by
586
599
  * Rspress' default Link component.
@@ -687,6 +700,7 @@ declare type SidebarDivider = {
687
700
  declare interface SidebarGroup {
688
701
  text: string;
689
702
  link?: string;
703
+ icon?: string;
690
704
  tag?: string;
691
705
  items: (SidebarGroup | SidebarItem | SidebarDivider | SidebarSectionHeader)[];
692
706
  collapsible?: boolean;
@@ -702,6 +716,7 @@ declare interface SidebarGroup {
702
716
  declare type SidebarItem = {
703
717
  text: string;
704
718
  link: string;
719
+ icon?: string;
705
720
  tag?: string;
706
721
  /**
707
722
  * For hmr usage in development
@@ -713,6 +728,7 @@ declare type SidebarItem = {
713
728
 
714
729
  declare type SidebarSectionHeader = {
715
730
  sectionHeaderText: string;
731
+ icon?: string;
716
732
  tag?: string;
717
733
  };
718
734
 
@@ -804,7 +820,8 @@ declare type ThemeConfig = {
804
820
  */
805
821
  enableScrollToTop?: boolean;
806
822
  /**
807
- * Whether to redirect to the closest locale when the user visits the site
823
+ * Whether to redirect to the closest locale when the user visits the site.
824
+ * @deprecated Use `route.localeRedirect` instead.
808
825
  * @default 'auto'
809
826
  */
810
827
  localeRedirect?: 'auto' | 'never' | 'only-default-lang';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rspress/shared",
3
- "version": "2.0.18",
3
+ "version": "2.0.19",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/web-infra-dev/rspress.git",
@@ -44,19 +44,19 @@
44
44
  "dist"
45
45
  ],
46
46
  "dependencies": {
47
- "@rsbuild/core": "^2.1.5",
47
+ "@rsbuild/core": "^2.1.8",
48
48
  "@shikijs/rehype": "^4.2.0",
49
+ "@types/react": "^19.2.17",
50
+ "mdast-util-mdx-jsx": "^3.2.0",
49
51
  "unified": "^11.0.5"
50
52
  },
51
53
  "devDependencies": {
52
- "@rslib/core": "0.23.2",
54
+ "@rslib/core": "1.0.0-beta.1",
53
55
  "@types/lodash-es": "^4.17.12",
54
56
  "@types/node": "^22.8.1",
55
- "@types/react": "^19.2.17",
56
57
  "github-slugger": "^2.0.0",
57
58
  "gray-matter": "4.0.3",
58
59
  "lodash-es": "^4.18.1",
59
- "mdast-util-mdx-jsx": "^3.2.0",
60
60
  "medium-zoom": "1.1.0",
61
61
  "rimraf": "^6.1.3",
62
62
  "rsbuild-plugin-publint": "^1.0.0",