Line

You are reading the unreleased docs (next). See latest (v0.9)

ui/client/features/live-preview/domain/PreviewSize

Pure (DOMAIN-001): the device sizes the live preview can be shown at.

Cockpit client (features), next. Source: ui/client/features/live-preview/domain/PreviewSize.ts.

Type Aliases#

PreviewSizeId#

PreviewSizeId = "fit" | "w390" | "w768" | "w1280" | "fluid"

Defined in: ui/client/features/live-preview/domain/PreviewSize.ts:11

Identifier of a preview size, as stored per project.


PreviewSizeOption#

PreviewSizeOption = object

Defined in: ui/client/features/live-preview/domain/PreviewSize.ts:14

One entry of the size picker. width/maxWidth are CSS pixels; null means "follow the stage".

Properties#

id

id: PreviewSizeId

Defined in: ui/client/features/live-preview/domain/PreviewSize.ts:15

label

label: string

Defined in: ui/client/features/live-preview/domain/PreviewSize.ts:16

maxWidth

maxWidth: number | null

Defined in: ui/client/features/live-preview/domain/PreviewSize.ts:20

title

title: string

Defined in: ui/client/features/live-preview/domain/PreviewSize.ts:18

Plain-language explanation, used as the option's title.

width

width: number | null

Defined in: ui/client/features/live-preview/domain/PreviewSize.ts:19

Variables#

PREVIEW_SIZES#

const PREVIEW_SIZES: PreviewSizeOption[]

Defined in: ui/client/features/live-preview/domain/PreviewSize.ts:23

Functions#

previewSizeOption()#

previewSizeOption(id): PreviewSizeOption

Defined in: ui/client/features/live-preview/domain/PreviewSize.ts:37

The option for an id; Fit for anything else, so a caller never has to handle undefined.

Parameters#

id

unknown

Returns#

PreviewSizeOption


sanitizePreviewSize()#

sanitizePreviewSize(raw): PreviewSizeId

Defined in: ui/client/features/live-preview/domain/PreviewSize.ts:32

Anything unrecognised (nothing stored yet, garbage, an id from a later version) is Fit.

Parameters#

raw

unknown

Returns#

PreviewSizeId