zidane-ui/ views/ preview
import { … } from 'zidane-ui/views/preview'ui/src/views/preview.ts
Components#
ViewPreviewComponent#
zidane-ui/views/preview: the page a view renderer loads, so the model
can see the view it made (docs/VIEWS.md, The model sees its result). An app
builds a small page that imports the kit's stylesheet and calls
installViewPreviewPage.
function ViewPreview(props: ViewPreviewProps): ElementParameters
| Name | Type | Description |
|---|---|---|
| props | ViewPreviewProps |
Returns
ElementProps
| Name | Type | Description |
|---|---|---|
| inputs? | boolean | The requesting host has inputs on: Choice, Form and Action draw enabled. |
| view | Pick<StoredView, 'anchor' | 'id' | 'title' | 'tree' | 'alt' | 'origin' | 'sessionId' | 'createdAt' | 'heights'> & Partial<StoredView> | The stored view to draw. |
Functions#
installViewPreviewPageFunction#
zidane-ui/views/preview: the page a view renderer loads, so the model
can see the view it made (docs/VIEWS.md, The model sees its result). An app
builds a small page that imports the kit's stylesheet and calls
installViewPreviewPage.
function installViewPreviewPage(options?: ViewPreviewPageOptions): ViewPreviewPageApiParameters
| Name | Type | Default | Description |
|---|---|---|---|
| options? | ViewPreviewPageOptions | {} |
Returns
ViewPreviewPageApimeasureViewPreviewFunction#
zidane-ui/views/preview: the page a view renderer loads, so the model
can see the view it made (docs/VIEWS.md, The model sees its result). An app
builds a small page that imports the kit's stylesheet and calls
installViewPreviewPage.
function measureViewPreview(root: HTMLElement): ViewPreviewPageResultParameters
| Name | Type | Description |
|---|---|---|
| root | HTMLElement | The page's root element. |
Returns
ViewPreviewPageResultConstants#
VIEW_PREVIEW_SETTLE_MSConstant#
The longest the page waits for a view to hold still before it measures what is there, unless the driver says (settleMs).
const VIEW_PREVIEW_SETTLE_MS = 10_000Interfaces#
ViewPreviewPageOptionsInterface#
Options of installViewPreviewPage.
interface ViewPreviewPageOptionsProperties
| Name | Type | Description |
|---|---|---|
| root? | HTMLElement | Where the view draws. Default: |
| themes? | { dark?: string; light?: string } | Theme ids for each appearance ( |
ViewPreviewPropsInterface#
Props of ViewPreview.
interface ViewPreviewPropsProperties
| Name | Type | Description |
|---|---|---|
| inputs? | boolean | The requesting host has inputs on: Choice, Form and Action draw enabled. |
| view | Pick<StoredView, 'anchor' | 'id' | 'title' | 'tree' | 'alt' | 'origin' | 'sessionId' | 'createdAt' | 'heights'> & Partial<StoredView> | The stored view to draw. |