@wocart/storefront / server / PreviewDraft
Interface: PreviewDraft
What an editor sends to be previewed. The storefront renders it as if it
were saved — document for surface, settings for the theme settings,
content for the text edits of the languages it names — and stores none of
it. Each part is optional: what is absent renders as saved.
Properties
content?
optionalcontent?:Record<string,Record<string,string>>
The draft text edits, per language, replacing the saved edits of those languages.
document?
optionaldocument?:Record<string,unknown>
The draft page document; the theme reads it with @wocart/theme's parsePageData.
locale?
optionallocale?:string
The language to render in; absent: the store's primary.
path?
optionalpath?:string
For a template, the resource route it is previewed for (/products/robe-kabyle).
settings?
optionalsettings?:Record<string,unknown>
The draft theme settings, replacing the saved ones.
surface
surface:
string
The surface to render (home, product).