Wocart

@wocart/storefront v3.1.0


@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?

optional content?: Record<string, Record<string, string>>

The draft text edits, per language, replacing the saved edits of those languages.


document?

optional document?: Record<string, unknown>

The draft page document; the theme reads it with @wocart/theme's parsePageData.


locale?

optional locale?: string

The language to render in; absent: the store's primary.


path?

optional path?: string

For a template, the resource route it is previewed for (/products/robe-kabyle).


settings?

optional settings?: Record<string, unknown>

The draft theme settings, replacing the saved ones.


surface

surface: string

The surface to render (home, product).