InitLivePreviewProps
Configuration options for the initLivePreview() function.
interface InitLivePreviewProps {
allowedOrigins?: string[];
allowedOriginsAttributeName?: string;
onComponentUpdated?: (...args: any[]) => void;
page: Record<string, any>;
previewTokenCookieName?: string;
previewTokenParamName?: string;
scriptId?: string;
scriptSrc?: string;
tailwindCompatStyles?: boolean;
}Properties
| Name | Required | Type | Description |
|---|---|---|---|
allowedOrigins | Optional | string[] | A list of allowed origins for the live preview. |
allowedOriginsAttributeName | Optional | string | The attribute name for allowed origins. |
onComponentUpdated | Optional | (...args: any[]) => void | Callback to execute when the component is updated in SmartEdit. |
page | Required | Record<string, any> | A SmartEdit page object. |
previewTokenCookieName | Optional | string | Name of the cookie storing the SmartEdit preview token. |
previewTokenParamName | Optional | string | Name of the query parameter containing the SmartEdit preview token. 'cmsTicketId' |
scriptId | Optional | string | Unique identifier for the webApplicationInjector script. 'smartedit-injector' |
scriptSrc | Optional | string | Path to the webApplicationInjector script. |
tailwindCompatStyles | Optional | boolean | Whether to inject a stylesheet which protects Tailwind's responsive re-show utilities (e.g. hidden md:flex) from the .hidden{display:none!important} rule that SmartEdit injects into the storefront iframe together with its editing overlay. |