@vexcms/next 0.1.0-alpha.26 → 0.1.0-alpha.28
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/HydrationBoundaryClient.d.ts +17 -0
- package/dist/HydrationBoundaryClient.d.ts.map +1 -0
- package/dist/HydrationBoundaryClient.js +9 -0
- package/dist/HydrationBoundaryClient.js.map +1 -0
- package/dist/NextAdminLayout.d.ts +21 -13
- package/dist/NextAdminLayout.d.ts.map +1 -1
- package/dist/NextAdminLayout.js +1 -1
- package/dist/NextAdminLayoutClient.d.ts +10 -4
- package/dist/NextAdminLayoutClient.d.ts.map +1 -1
- package/dist/NextAdminLayoutClient.js +104 -7
- package/dist/NextAdminLayoutClient.js.map +1 -1
- package/dist/NextAdminPage.d.ts +52 -5
- package/dist/NextAdminPage.d.ts.map +1 -1
- package/dist/NextAdminPage.js +1 -1
- package/dist/auth/VexAdminAuthAdapterContext.d.ts +66 -0
- package/dist/auth/VexAdminAuthAdapterContext.d.ts.map +1 -0
- package/dist/auth/index.d.ts +2 -0
- package/dist/auth/index.d.ts.map +1 -0
- package/dist/auth/index.js +12 -0
- package/dist/auth/index.js.map +1 -0
- package/dist/chunk-JB3GMZPF.js +525 -0
- package/dist/chunk-JB3GMZPF.js.map +1 -0
- package/dist/chunk-NE2VUFS2.js +15 -0
- package/dist/chunk-NE2VUFS2.js.map +1 -0
- package/dist/chunk-T7DNJLSX.js +21 -0
- package/dist/chunk-T7DNJLSX.js.map +1 -0
- package/dist/index.js +2 -2
- package/dist/navigation/index.d.ts +3 -0
- package/dist/navigation/index.d.ts.map +1 -0
- package/dist/navigation/useNextNavigate.d.ts +19 -0
- package/dist/navigation/useNextNavigate.d.ts.map +1 -0
- package/dist/navigation/useNextNavigationBlocker.d.ts +32 -0
- package/dist/navigation/useNextNavigationBlocker.d.ts.map +1 -0
- package/dist/serverQueryClient.d.ts +48 -0
- package/dist/serverQueryClient.d.ts.map +1 -0
- package/package.json +11 -4
- package/dist/chunk-DDH2TJTP.js +0 -195
- package/dist/chunk-DDH2TJTP.js.map +0 -1
- package/dist/chunk-UMJTAD5A.js +0 -22
- package/dist/chunk-UMJTAD5A.js.map +0 -1
package/dist/chunk-UMJTAD5A.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
// src/NextAdminLayout.tsx
|
|
2
|
-
import { NextAdminLayoutClient } from "./NextAdminLayoutClient";
|
|
3
|
-
import { cookies } from "next/headers";
|
|
4
|
-
import { jsx } from "react/jsx-runtime";
|
|
5
|
-
async function NextAdminLayout(props) {
|
|
6
|
-
const cookieStore = await cookies();
|
|
7
|
-
const sidebarOpen = String(cookieStore.get("sidebar_state")?.value) === "true";
|
|
8
|
-
return /* @__PURE__ */ jsx(
|
|
9
|
-
NextAdminLayoutClient,
|
|
10
|
-
{
|
|
11
|
-
user: props.user,
|
|
12
|
-
organization: props.organization,
|
|
13
|
-
sidebarOpen,
|
|
14
|
-
children: props.children
|
|
15
|
-
}
|
|
16
|
-
);
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export {
|
|
20
|
-
NextAdminLayout
|
|
21
|
-
};
|
|
22
|
-
//# sourceMappingURL=chunk-UMJTAD5A.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/NextAdminLayout.tsx"],"sourcesContent":["import type { ReactNode } from \"react\";\nimport type { AdminUser } from \"@vexcms/react\";\nimport { NextAdminLayoutClient } from \"./NextAdminLayoutClient\";\nimport { cookies } from \"next/headers\";\n\n/**\n * Next.js admin layout shell for VexCMS.\n *\n * A **server component** that reads the `sidebar_state` cookie server-side\n * (so the sidebar's open/closed state is correct on first paint, with no\n * client flash) and passes it, plus `user`/`organization`/`children`, to the\n * client leaf `NextAdminLayoutClient`. Config no longer crosses this\n * boundary at all — the admin panel's client tree gets its config from the\n * app's own root `VexConfigProvider` mount\n * (`components/providers/client.tsx`), not from a prop threaded through this\n * layout.\n *\n * Render it from your admin `layout.tsx`. Because this is a server component,\n * your `layout.tsx` may itself be an `async` server component (e.g. to run auth\n * checks).\n *\n * @param props - Layout props.\n * @param props.children - The page content from `[[...slug]]/page.tsx`.\n * @param props.user - Current user for the admin shell.\n * @returns The rendered admin shell, wrapping `children` in the client boundary\n * ({@link NextAdminLayoutClient}) with the server-read sidebar cookie state.\n * @example\n * ```tsx\n * // app/admin/layout.tsx\n * import { NextAdminLayout } from \"@vexcms/next/client\";\n * import { getCurrentUser } from \"~/auth/serverUtils\";\n *\n * export default async function AdminLayout({ children }: { children: ReactNode }) {\n * const user = await getCurrentUser();\n * return (\n * <NextAdminLayout user={user ?? undefined}>\n * {children}\n * </NextAdminLayout>\n * );\n * }\n * ```\n */\nexport async function NextAdminLayout(props: {\n children: ReactNode;\n user?: AdminUser;\n organization?: Record<string, unknown>;\n}) {\n const cookieStore = await cookies();\n const sidebarOpen = String(cookieStore.get(\"sidebar_state\")?.value) === \"true\";\n\n return (\n <NextAdminLayoutClient\n user={props.user}\n organization={props.organization}\n sidebarOpen={sidebarOpen}\n >\n {props.children}\n </NextAdminLayoutClient>\n );\n}\n"],"mappings":";AAEA,SAAS,6BAA6B;AACtC,SAAS,eAAe;AAgDpB;AATJ,eAAsB,gBAAgB,OAInC;AACD,QAAM,cAAc,MAAM,QAAQ;AAClC,QAAM,cAAc,OAAO,YAAY,IAAI,eAAe,GAAG,KAAK,MAAM;AAExE,SACE;AAAA,IAAC;AAAA;AAAA,MACC,MAAM,MAAM;AAAA,MACZ,cAAc,MAAM;AAAA,MACpB;AAAA,MAEC,gBAAM;AAAA;AAAA,EACT;AAEJ;","names":[]}
|