DataStore Selectors
Table of Contents
- Viewport Selectors
- Status Indicator Selectors
- Range Selectors
- Block Status Selectors
- Block Data Selectors
- Editor & CSS Selectors
Viewport Selectors
getViewports
Description: Returns all defined viewports.
Returns: object – All viewports
getViewport
Description: Returns the current active viewport. Defaults to DOM width if viewport is 0.
Returns: number – Active viewport width
getDesktop / getTablet / getMobile
Description: Returns the default desktop, tablet, or mobile viewport.
Returns: number – Viewport width for the device
getIframeSize
Description: Returns the size of the iframe.
Returns: Size – Width and height
getIframeViewport
Description: Returns the viewport currently applied inside the iframe.
Returns: number – Iframe viewport
Status Indicator Selectors
| Selector | Description | Return |
|---|---|---|
isRegistering | Checks if registering | boolean |
isLoading | Checks if loading | boolean |
isSaving | Checks if saving | boolean |
isAutoSaving | Checks if autosaving | boolean |
isActive | Checks if active | boolean |
isEditing | Checks if editing | boolean |
isInspecting | Checks if inspecting | boolean |
Range Selectors
| Selector | Description | Return |
|---|---|---|
inDesktopRange | Indicates if viewport is in desktop range | boolean |
inTabletRange | Indicates if viewport is in tablet range | boolean |
inMobileRange | Indicates if viewport is in mobile range | boolean |
Block Status Selectors
| Selector | Description | Parameters | Return |
|---|---|---|---|
isRegistered | Checks if a block is registered | clientId: string | boolean |
hasBlockViewports | Checks if a block has saves, changes, or removes | clientId: string | boolean |
hasBlockDefaults | Checks if block has default style saves | clientId: string | boolean |
hasBlockSaves | Checks if block has any saved states | clientId: string | boolean |
hasBlockChanges | Checks if block has any changes | clientId: string | boolean |
hasBlockPropertyChanges | Checks if block property has changes for a viewport | clientId: string,viewport: number,property: string | boolean |
hasBlockValids | Checks if block has valid entries | clientId: string | boolean |
hasBlockRemoves | Checks if block has removals | clientId: string | boolean |
hasBlockPropertyRemoves | Checks if a block property has been removed for a viewport | clientId: string,viewport: number,property: string | boolean |
Block Data Selectors
| Selector | Description | Parameters | Return |
|---|---|---|---|
getSaves | Returns all saves | – | object |
getBlockSaves | Returns saves for a single block | clientId: string | object |
getBlockPropertySaves | Returns saves for a block property in a viewport | clientId: string,viewport: number,property: string | object |
getGeneratedBlockSaves | Returns computed block saves (merges changes, cleans removes) | clientId: string | object |
getChanges | Returns all changes | – | object |
getBlockChanges | Returns changes for a single block | clientId: string | object |
getBlockPropertyChanges | Returns changes for a block property in a viewport | clientId: string,viewport: number,property: string | object |
getValids | Returns all valids | – | object |
getBlockValids | Returns valids for a single block | clientId: string | object |
getViewportBlockValids | Returns block valids for the current viewport | clientId: string | object |
getRemoves | Returns all removes | – | object |
getBlockRemoves | Returns removes for a single block | clientId: string | object |
getBlockPropertyRemoves | Returns removes for a block property in a viewport | clientId: string,viewport: number,property: string | object |
Editor & CSS Selectors
| Selector | Description | Parameters | Return |
|---|---|---|---|
getLastEdit | Returns timestamp of last edit outside block context | – | number |
getRendererPropertySet | Returns all registered renderers | – | RendererPropertySet |
getRendererSet | Returns renderer set for a specific key | key: string | RendererSet | false |
needsRenderer | Checks if style properties require a renderer | style: BlockStyles | boolean |
hasRenderer | Checks if a renderer exists for a property | key: string | boolean |
getCSS | Returns generated CSS for a block | clientId: string | string |
getPreviewCSS | Returns preview CSS for block attributes | clientId: string,blockName: string,attributes: BlockAttributes | string |
getSpectrumSet | Returns spectrum set for a block | clientId: string | SpectrumSet |
getPropertySpectrumSet | Returns spectrum set filtered by property | clientId: string,property: string | SpectrumSet |
getIndicatorPropertySet | Returns grouped indicator properties for renderers | – | IndicatorPropertySet |