readLivePreviewPanelCookie
readLivePreviewPanelCookie(
props):boolean
Defined in: packages/core/src/livePreview/panelCookie.ts:48
Resolves the preview panel’s initial open state from its cookie.
Pure, so the server component reading cookies() and any other caller share
one interpretation of the stored value.
Decision 51: props.cookieValue is now the consolidated admin cookie’s
OWN raw value — vex-admin:<collection> for a collection’s edit/list
views, or vex-admin itself for a global’s edit view (both parse
cleanly through parseAdminCollectionCookie; see its own doc
comment for why a vex-admin-shaped blob still resolves .livePreview
correctly here) — read via its livePreview.panelOpen field, not a raw
"1"/"0" string from a dedicated vex-live-preview-panel:<slug> cookie.
Parameters
Section titled “Parameters”cookieValue
Section titled “cookieValue”string | undefined
The raw consolidated admin cookie value, or undefined when unset.
defaultOpen
Section titled “defaultOpen”boolean
The collection/global’s admin.livePreview.defaultOpen —
the fallback used when no cookie has been written yet.
Returns
Section titled “Returns”boolean
true/false when livePreview.panelOpen is set, else props.defaultOpen.