import { F as createSettingsQueryClient, I as isApiStatus, L as louiseQueryKey, N as apiGet, P as apiSend, R as louiseQueryKeys, a as PanelActionsProvider, c as CollectionTab, j as LouiseApiError, l as FrameworkPanel, u as SurfaceConfig } from "../../panel-actions-BoKPAUiW.js"; import { a as revealActiveNavLink, c as studioHref, i as focusScreenHeading, n as StudioNavItem, o as screenTitle, r as activeNavItem, s as studioBasepath, t as ScreenTitleOptions } from "../../navigation-CxWPh_sL.js"; //#region src/client/settings/studio.d.ts interface StudioConfig extends SurfaceConfig { /** * Header title. **Static config, never session data**—a site name, not an * editor name. Anything per-editor here would defeat the cacheability this * shell is built for. Default `"Studio"`. */ title?: string; /** * Where to send the browser when a panel query answers 401. Default * `"/signin"`. * * A full-page app cannot degrade to "render the public page" the way the * drawer can—there is no page underneath it—so an expired session has to * become a navigation rather than an empty shell with failing panels. */ signInPath?: string; } /** * The full-page studio. Mount it inside a `client:only` island; see * `reference/client.md` for the routed variant. */ declare function Studio(props: StudioConfig): ReturnType; interface StudioMountOptions extends StudioConfig { /** Element or selector to render into. Omit for a body-appended root. */ target?: HTMLElement | string; } /** * Mount the full-page studio. * * Idempotent per target, like `mountSettings`—a client-side route change or an * soft navigation can re-run this without stacking two apps. Returns a * disposer for the cases that need one (a router unmounting the island). */ declare function mountStudio(config?: StudioMountOptions): () => void; //#endregion //#region src/client/studio/editing.d.ts interface UnsavedChangesOptions { /** * A dirtiness the snapshot can't see—for example, a rich-text document that loads * after the form opens, so it has no value to compare at open. */ alsoDirty?: () => boolean; /** The question asked before discarding changes. */ message?: string; /** How to ask. Default `window.confirm`. */ confirm?: (message: string) => boolean; } interface UnsavedChanges { /** Whether the form differs from when it opened (or was last saved). */ dirty: () => boolean; /** For an exit inside the form (Back, Cancel): ask first if there's anything to lose. */ leave: (go: () => void) => void; /** * For a router's navigation blocker: `true` means stay. Asks the question * only when dirty. With TanStack Router: * `useBlocker({ shouldBlockFn: guard.shouldBlock, enableBeforeUnload: guard.dirty })`. */ shouldBlock: () => boolean; /** Re-baseline after a save, so the form is clean again without closing it. */ markSaved: () => void; /** * Prompt on refresh / close / leaving the site while dirty (the browser's * own prompt; its wording is the browser's). Returns the detach function—call * it on unmount. Skip this if your router's blocker already does it. */ watchUnload: () => () => void; } /** * "You have unsaved changes" for a studio form. * * Dirty is decided by comparing `snapshot()`—the form's save payload—with * its value when the guard was created, so typing a letter and deleting it * again is not a change, and no field has to remember to mark itself dirty. * The snapshot must be JSON-serializable. * * Router-agnostic on purpose: in-form exits call `leave`, a router's blocker * calls `shouldBlock`, and the browser's own exits go through `watchUnload`. * A form that forgets one of the three drops edits without a word—which is * what happened on each of them before this existed. */ declare function unsavedChanges(snapshot: () => unknown, options?: UnsavedChangesOptions): UnsavedChanges; interface SettledSelectHandlers { onPointerDown: () => void; onKeyDown: (e: KeyboardEvent) => void; onChange: (e: Event) => void; onBlur: () => void; } /** * Event handlers for a ``. */ declare function settledSelect(commit: (value: string) => void): SettledSelectHandlers; //#endregion //#region src/client/settings/upload.d.ts interface UploadOutcome { uploaded: { file: File; url: string; }[]; /** One entry per file that didn't make it, with the server's reason. */ failed: { file: File; error: string; }[]; } /** * Upload `files` one at a time to the media route and report each outcome. * * Every failure is kept. A loop that set a single error message on each failure * showed only the LAST one: pick five images, have two refused, and you were told * about one of them—or, if the last file succeeded, none. The form then showed * fewer images than were picked, with nothing to say why. * * `onUploaded` fires as each file lands, so a form can add images as they * arrive rather than after the whole batch. */ declare function uploadMediaFiles(files: readonly File[], options?: { endpoint?: string; onUploaded?: (url: string, file: File) => void; }): Promise; /** One line naming every file that failed and why—for an alert. `null` when none did. */ declare function describeUploadFailures(outcome: UploadOutcome): string | null; //#endregion export { type CollectionTab, type FrameworkPanel, LouiseApiError, type ScreenTitleOptions, type SettledSelectHandlers, Studio, type StudioConfig, type StudioMountOptions, type StudioNavItem, type SurfaceConfig, type UnsavedChanges, type UnsavedChangesOptions, type UploadOutcome, activeNavItem, apiGet, apiSend, createSettingsQueryClient, describeUploadFailures, focusScreenHeading, isApiStatus, louiseQueryKey, louiseQueryKeys, mountStudio, revealActiveNavLink, screenTitle, settledSelect, studioBasepath, studioHref, unsavedChanges, uploadMediaFiles };