@rspress/core 1.0.0-beta.4 → 1.0.0-beta.5

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.
@@ -1,9 +1,10 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import siteData from "virtual-site-data";
3
3
  import { matchRoutes, useLocation } from "react-router-dom";
4
4
  import { HelmetProvider } from "react-helmet-async";
5
- import { useContext, useLayoutEffect } from "react";
5
+ import React, { useContext, useLayoutEffect } from "react";
6
6
  import { cleanUrl, isProduction } from "@rspress/shared";
7
+ import globalComponents from "virtual-global-components";
7
8
  import { isEqualPath, normalizeRoutePath } from "./utils";
8
9
  import { DataContext } from "./hooks";
9
10
  import "virtual-global-styles";
@@ -82,8 +83,27 @@ export function App({ helmetContext }) {
82
83
  pathname,
83
84
  setPageData
84
85
  ]);
85
- return /* @__PURE__ */ _jsx(HelmetProvider, {
86
+ return /* @__PURE__ */ _jsxs(HelmetProvider, {
86
87
  context: helmetContext,
87
- children: /* @__PURE__ */ _jsx(Theme.Layout, {})
88
+ children: [
89
+ /* @__PURE__ */ _jsx(Theme.Layout, {}),
90
+ // Global UI
91
+ globalComponents.map((componentInfo, index) => {
92
+ if (Array.isArray(componentInfo)) {
93
+ const [component, props] = componentInfo;
94
+ return /* @__PURE__ */ React.createElement(component, {
95
+ // The component order is stable
96
+ // eslint-disable-next-line react/no-array-index-key
97
+ key: index,
98
+ ...props
99
+ });
100
+ } else {
101
+ return /* @__PURE__ */ React.createElement(componentInfo, {
102
+ // eslint-disable-next-line react/no-array-index-key
103
+ key: index
104
+ });
105
+ }
106
+ })
107
+ ]
88
108
  });
89
109
  }
@@ -3,7 +3,8 @@
3
3
  "rootDir": ".",
4
4
  "baseUrl": ".",
5
5
  "skipLibCheck": true,
6
- "jsx": "react-jsx"
6
+ "jsx": "react-jsx",
7
+ "esModuleInterop": true
7
8
  },
8
9
  "include": ["./**/*"]
9
10
  }
@@ -43,10 +43,9 @@ function NotFoundLayout() {
43
43
  // src/theme-default/layout/Layout/index.tsx
44
44
  import { jsx as _jsx16, jsxs as _jsxs10 } from "react/jsx-runtime";
45
45
  import "nprogress/nprogress.css";
46
- import React5, { useEffect as useEffect10 } from "react";
46
+ import { useEffect as useEffect10 } from "react";
47
47
  import { Helmet } from "react-helmet-async";
48
48
  import Theme, { Nav } from "@theme";
49
- import globalComponents from "virtual-global-components";
50
49
 
51
50
  // src/theme-default/layout/DocLayout/index.tsx
52
51
  import { jsx as _jsx15, jsxs as _jsxs9 } from "react/jsx-runtime";
@@ -1872,23 +1871,7 @@ var Layout = (props) => {
1872
1871
  /* @__PURE__ */ _jsx16("section", {
1873
1872
  children: getContentLayout()
1874
1873
  }),
1875
- bottom,
1876
- // Global UI
1877
- globalComponents.map((componentInfo, index) => {
1878
- if (Array.isArray(componentInfo)) {
1879
- const [component, props2] = componentInfo;
1880
- return /* @__PURE__ */ React5.createElement(component, _object_spread9({
1881
- // The component order is stable
1882
- // eslint-disable-next-line react/no-array-index-key
1883
- key: index
1884
- }, props2));
1885
- } else {
1886
- return /* @__PURE__ */ React5.createElement(componentInfo, {
1887
- // eslint-disable-next-line react/no-array-index-key
1888
- key: index
1889
- });
1890
- }
1891
- })
1874
+ bottom
1892
1875
  ]
1893
1876
  });
1894
1877
  };