@rspress/core 1.0.0-beta.0 → 1.0.0-beta.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rspress/core",
3
- "version": "1.0.0-beta.0",
3
+ "version": "1.0.0-beta.2",
4
4
  "description": "The Rspress Documentation Framework",
5
5
  "bugs": "https://github.com/web-infra-dev/rspress/issues",
6
6
  "repository": {
@@ -89,11 +89,11 @@
89
89
  "unist-util-visit-children": "^2.0.1",
90
90
  "yaml-front-matter": "^4.1.1",
91
91
  "rspack-plugin-virtual-module": "0.1.12",
92
- "@rspress/shared": "1.0.0-beta.0",
93
- "@rspress/plugin-medium-zoom": "1.0.0-beta.0",
94
- "@rspress/plugin-last-updated": "1.0.0-beta.0",
95
- "@rspress/plugin-auto-nav-sidebar": "1.0.0-beta.0",
96
- "@rspress/plugin-container-syntax": "1.0.0-beta.0"
92
+ "@rspress/shared": "1.0.0-beta.2",
93
+ "@rspress/plugin-medium-zoom": "1.0.0-beta.2",
94
+ "@rspress/plugin-last-updated": "1.0.0-beta.2",
95
+ "@rspress/plugin-auto-nav-sidebar": "1.0.0-beta.2",
96
+ "@rspress/plugin-container-syntax": "1.0.0-beta.2"
97
97
  },
98
98
  "peerDependencies": {
99
99
  "react": ">=17"
@@ -21,6 +21,7 @@ interface TabsProps {
21
21
  children: ReactNode;
22
22
  groupId?: string;
23
23
  tabContainerClassName?: string;
24
+ tabPosition?: 'left' | 'center';
24
25
  }
25
26
 
26
27
  function isTabItem(item: unknown): item is TabItem {
@@ -44,6 +45,7 @@ export function Tabs(props: TabsProps): ReactElement {
44
45
  onChange,
45
46
  children,
46
47
  groupId,
48
+ tabPosition = 'left',
47
49
  tabContainerClassName,
48
50
  } = props;
49
51
  let tabValues = values || [];
@@ -74,7 +76,13 @@ export function Tabs(props: TabsProps): ReactElement {
74
76
  <div className={styles.container}>
75
77
  <div className={tabContainerClassName}>
76
78
  {tabValues.length ? (
77
- <div className={styles.tabList}>
79
+ <div
80
+ className={styles.tabList}
81
+ style={{
82
+ justifyContent:
83
+ tabPosition === 'center' ? 'center' : 'flex-start',
84
+ }}
85
+ >
78
86
  {tabValues.map((item, index) => {
79
87
  return (
80
88
  <div
@@ -31,7 +31,7 @@ export function Pre({
31
31
  return (
32
32
  <div className={className || DEFAULT_LANGUAGE_CLASS}>
33
33
  {codeTitle && <div className="rspress-code-title">{codeTitle}</div>}
34
- <div className="rspress-code-content">{children}</div>
34
+ <div className="rspress-code-content rspress-scrollbar">{children}</div>
35
35
  </div>
36
36
  );
37
37
  }
@@ -29,6 +29,10 @@ export const Layout: React.FC<LayoutProps> = props => {
29
29
  beforeNavTitle,
30
30
  afterNavTitle,
31
31
  beforeNav,
32
+ beforeHero,
33
+ afterHero,
34
+ beforeFeatures,
35
+ afterFeatures,
32
36
  } = props;
33
37
  const docProps: DocLayoutProps = {
34
38
  beforeDocFooter,
@@ -37,6 +41,12 @@ export const Layout: React.FC<LayoutProps> = props => {
37
41
  beforeOutline,
38
42
  afterOutline,
39
43
  };
44
+ const homeProps: HomeLayoutProps = {
45
+ beforeHero,
46
+ afterHero,
47
+ beforeFeatures,
48
+ afterFeatures,
49
+ };
40
50
  const { siteData, page } = usePageData();
41
51
  const { themeConfig } = siteData;
42
52
  const {
@@ -72,7 +82,7 @@ export const Layout: React.FC<LayoutProps> = props => {
72
82
  const getContentLayout = () => {
73
83
  switch (pageType) {
74
84
  case 'home':
75
- return <Theme.HomeLayout />;
85
+ return <Theme.HomeLayout {...homeProps} />;
76
86
  case 'doc':
77
87
  return <DocLayout {...docProps} />;
78
88
  case '404':