/** * Builds the editor component a site mounts at its P1 editor route. * * The shell around the Puck canvas — provider nesting, auth gating, document * loading, the remote-datasource context, the post-login return redirect, and * the loading / error / reload states — is the same for every P1 site. Assembled * by hand in each app's route file it froze a copy into every scaffold, so a fix * to any of it could never reach a project once that project existed. It lives * here instead, and the route file becomes a shim. * * What genuinely differs per app flows in as options: the app's puck config, its * sign-in page, the extra editor plugins it wants, and the publish handling it * wants on top of the defaults. * * Usage: * const P1Editor = createP1Editor({ * puckConfig: config, * signInPage: , * }); * * // In the route, with the site's own router: * * * Next.js apps use `createP1EditorClient`, which passes the Next.js router in. * * The stylesheet is imported by the route rather than by this module: it is * only wanted where the editor actually mounts, and importing it here would put * the editor's CSS on every page that touches this package. * * The shell itself is three components — `EditorShell` (providers, role, auth), * `EditorContent` (the open document) and `EditorCanvas` (what is on screen) — * each reading its inputs from the `EditorRuntime` this factory builds. */ import React from "react"; import type { CreateP1EditorClientOptions, P1EditorRouter } from "./types"; export declare function createP1Editor(options: CreateP1EditorClientOptions): ({ router }: { router: P1EditorRouter; }) => React.JSX.Element;