@rnaga/wp-next-admin 1.0.5 → 1.0.6
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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RootLayout.d.ts","sourceRoot":"","sources":["../../../src/client/components/RootLayout.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"RootLayout.d.ts","sourceRoot":"","sources":["../../../src/client/components/RootLayout.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAQpC,OAAO,KAAK,KAAK,WAAW,MAAM,2BAA2B,CAAC;AAE9D,OAAO,KAAK,KAAK,KAAK,MAAM,aAAa,CAAC;AAE1C,eAAO,MAAM,UAAU,GAAI,OAAO;IAChC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC;IAC7B,IAAI,EAAE,WAAW,CAAC,MAAM,CAAC,IAAI,CAAC;IAC9B,SAAS,EAAE,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC;IAClC,kBAAkB,EAAE,KAAK,CAAC,MAAM,CAAC,gBAAgB,CAAC;IAClD,OAAO,EAAE,OAAO,CAAC;CAClB,4CAiBA,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -2,12 +2,10 @@
|
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
3
|
import { SessionProvider } from "next-auth/react";
|
|
4
4
|
import { WPProvider } from "@rnaga/wp-next-core/client/wp";
|
|
5
|
-
import { FormDataProvider } from "@rnaga/wp-next-ui/FormDataProvider";
|
|
6
|
-
import ThemeRegistry from "@rnaga/wp-next-ui/ThemeRegistry";
|
|
7
5
|
import { WPAdminProvider } from "../wp-admin";
|
|
8
6
|
import { initialState } from "../wp-admin/initial-global-state";
|
|
9
7
|
export const RootLayout = (props) => {
|
|
10
8
|
const { site, user, adminUser, children, session, defaultMenuSegment } = props;
|
|
11
|
-
return (_jsx(SessionProvider, { session: session, children: _jsx(WPProvider, { initialState: initialState, user: user, children: _jsx(
|
|
9
|
+
return (_jsx(SessionProvider, { session: session, children: _jsx(WPProvider, { initialState: initialState, user: user, children: _jsx(WPAdminProvider, { site: site, adminUser: adminUser, defaultMenuSegment: defaultMenuSegment, children: children }) }) }));
|
|
12
10
|
};
|
|
13
11
|
export default RootLayout;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Layout.d.ts","sourceRoot":"","sources":["../../../../src/client/components/layout/Layout.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Layout.d.ts","sourceRoot":"","sources":["../../../../src/client/components/layout/Layout.tsx"],"names":[],"mappings":"AAmBA,eAAO,MAAM,MAAM,+CAgGlB,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { useEffect } from "react";
|
|
4
4
|
import { ErrorBoundary } from "react-error-boundary";
|
|
5
5
|
import { Box } from "@mui/material";
|
|
@@ -12,7 +12,8 @@ import { Main } from "./Main";
|
|
|
12
12
|
import { Overlay } from "./Overlay";
|
|
13
13
|
import { Sidebar } from "./sidebar";
|
|
14
14
|
import { Title } from "./Title";
|
|
15
|
-
import { useWPTheme } from "@rnaga/wp-next-ui/ThemeRegistry";
|
|
15
|
+
import ThemeRegistry, { useWPTheme } from "@rnaga/wp-next-ui/ThemeRegistry";
|
|
16
|
+
import { FormDataProvider } from "@rnaga/wp-next-ui/FormDataProvider";
|
|
16
17
|
export const Layout = () => {
|
|
17
18
|
const wpAdmin = useWPAdmin();
|
|
18
19
|
const adminNavigation = useAdminNavigation();
|
|
@@ -49,21 +50,21 @@ export const Layout = () => {
|
|
|
49
50
|
globalState.set("page", page);
|
|
50
51
|
}
|
|
51
52
|
}, [pathname]);
|
|
52
|
-
return (_jsxs(
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
width: "100%",
|
|
57
|
-
height: 50,
|
|
58
|
-
}, children: _jsx(Header, {}) }, layoutKeys.header), _jsx(Box, { children: _jsx(Sidebar, {}) }, layoutKeys.sidebar), _jsx(Box, { className: "MainContainer", sx: {
|
|
59
|
-
display: "flex",
|
|
60
|
-
ml: `${sidebar.state.marginLeft}px`,
|
|
61
|
-
pt: 5,
|
|
62
|
-
height: "100vh",
|
|
63
|
-
}, children: _jsx(Box, { sx: {
|
|
64
|
-
p: 3,
|
|
65
|
-
zIndex: 0,
|
|
53
|
+
return (_jsx(ThemeRegistry, { children: _jsxs(FormDataProvider, { children: [_jsx(Overlay, {}), _jsx(Box, { component: "header", sx: {
|
|
54
|
+
position: "fixed",
|
|
55
|
+
zIndex: 2,
|
|
56
|
+
display: "block",
|
|
66
57
|
width: "100%",
|
|
67
|
-
|
|
58
|
+
height: 50,
|
|
59
|
+
}, children: _jsx(Header, {}) }, layoutKeys.header), _jsx(Box, { children: _jsx(Sidebar, {}) }, layoutKeys.sidebar), _jsx(Box, { className: "MainContainer", sx: {
|
|
60
|
+
display: "flex",
|
|
61
|
+
ml: `${sidebar.state.marginLeft}px`,
|
|
62
|
+
pt: 5,
|
|
63
|
+
height: "100vh",
|
|
64
|
+
}, children: _jsx(Box, { sx: {
|
|
65
|
+
p: 3,
|
|
66
|
+
zIndex: 0,
|
|
67
|
+
width: "100%",
|
|
68
|
+
}, children: _jsxs(ErrorBoundary, { FallbackComponent: ErrorFallback, children: [_jsx(Title, {}), _jsx(Main, {})] }) }) }, layoutKeys.main)] }) }));
|
|
68
69
|
};
|
|
69
70
|
export default Layout;
|