Types: StaticBlockDefinition to EditableTextProps
The types of @poltura/theme-sdk/elements, StaticBlockDefinition to EditableTextProps.
Ezen az oldalon
import { … } from '@poltura/theme-sdk/elements';StaticBlockDefinition
One fixed child of a section or block that merchants can hide and restyle but never move or delete.
idrequiredstringDeveloper id, unique in this definition: lowercase letters, digits, `-` and `_`.
typerequiredstring | AcceptedBlockThe child's type key, or the `defineBlock` result.
slotstringRegion it renders in; omit to place it only where the component draws it.
requiredbooleanWhether merchants cannot hide it either.
settingsElementSettingsSeedSettings it starts with.
styleElementStyleStyle it starts with, in theme tokens.
blocksreadonly ElementSeed[]Children it starts with.
ElementBlocksRule
Which child elements an element accepts, in the customizer and in saved layouts.
acceptsrequiredreadonly (string | AcceptedBlock)[]Accepted children: `defineBlock` results, type keys, or the wildcards `ELEMENT_WILDCARD` and `THEME_BLOCK_WILDCARD`.
maxnumberUpper bound on direct children; static children do not count.
staticreadonly StaticBlockDefinition[]Fixed children with developer ids.
ElementContextRule
Scopes an element reads from above (requires) and opens for its children (provides).
requiresreadonly ElementScope[]Scopes that must be open above the element; the editor refuses it anywhere else.
providesreadonly ElementScope[]Scopes the element opens for its children.
ElementDefinitionBase
What sections and blocks share in their definition; every property is literal data the compiler reads statically.
type ElementDefinitionBase<S extends SettingsSchema>typerequiredstringStable type key saved in every layout file; reusing a platform key replaces that element everywhere.
labelrequiredstringPicker and navigator label, in the theme's base language.
descriptionstringOne line shown under the label in the picker and in the inspector's "What is this?".
i18nElementWordingThe element's own label and description per admin language; it wins over machine translation.
iconElementIconIdPicker and navigator icon.
categoryElementCategoryPicker group; theme elements without one appear under "This theme".
settingsSInspector settings built with `field.*`; key order is the inspector order.
blocksElementBlocksRuleChild elements this element accepts; omit for a leaf element.
slotsreadonly ElementSlot[]Named regions the component draws with `Slot`.
stylereadonly StyleCapability[]Style groups the inspector's Style tab offers.
presetsreadonly ElementPreset[]Named starting configurations offered on insert; `default` is what a plain insert applies.
contextElementContextRuleScopes the element reads and opens.
keywordsreadonly string[]Extra picker search terms, such as synonyms in other languages.
renamedFromstring | readonly string[]Type keys this element used to have, so saved layouts are rewritten on the next build.
templatesreadonly string[]Page templates the element may be added to; omit to allow every template.
SectionDefinition
The object passed to defineSection.
type SectionDefinition<S extends SettingsSchema>typerequiredstringStable type key saved in every layout file; reusing a platform key replaces that element everywhere.
labelrequiredstringPicker and navigator label, in the theme's base language.
descriptionstringOne line shown under the label in the picker and in the inspector's "What is this?".
i18nElementWordingThe element's own label and description per admin language; it wins over machine translation.
iconElementIconIdPicker and navigator icon.
categoryElementCategoryPicker group; theme elements without one appear under "This theme".
settingsSInspector settings built with `field.*`; key order is the inspector order.
blocksElementBlocksRuleChild elements this element accepts; omit for a leaf element.
slotsreadonly ElementSlot[]Named regions the component draws with `Slot`.
stylereadonly StyleCapability[]Style groups the inspector's Style tab offers.
presetsreadonly ElementPreset[]Named starting configurations offered on insert; `default` is what a plain insert applies.
contextElementContextRuleScopes the element reads and opens.
keywordsreadonly string[]Extra picker search terms, such as synonyms in other languages.
renamedFromstring | readonly string[]Type keys this element used to have, so saved layouts are rewritten on the next build.
templatesreadonly string[]Page templates the element may be added to; omit to allow every template.
intentElementIntentWhat the section is for, so a search can offer it by kind, mood and photos; omit for none.
groupsreadonly SectionGroup[]Section groups outside the templates the section may also be added to.
limitnumberMost instances of the section in one template or section group.
componentrequiredElementComponent<SettingsOf<NoInfer<S>>>Draws the section.
BlockDefinition
The object passed to defineBlock.
type BlockDefinition<S extends SettingsSchema>typerequiredstringStable type key saved in every layout file; reusing a platform key replaces that element everywhere.
labelrequiredstringPicker and navigator label, in the theme's base language.
descriptionstringOne line shown under the label in the picker and in the inspector's "What is this?".
i18nElementWordingThe element's own label and description per admin language; it wins over machine translation.
iconElementIconIdPicker and navigator icon.
categoryElementCategoryPicker group; theme elements without one appear under "This theme".
settingsSInspector settings built with `field.*`; key order is the inspector order.
blocksElementBlocksRuleChild elements this element accepts; omit for a leaf element.
slotsreadonly ElementSlot[]Named regions the component draws with `Slot`.
stylereadonly StyleCapability[]Style groups the inspector's Style tab offers.
presetsreadonly ElementPreset[]Named starting configurations offered on insert; `default` is what a plain insert applies.
contextElementContextRuleScopes the element reads and opens.
keywordsreadonly string[]Extra picker search terms, such as synonyms in other languages.
renamedFromstring | readonly string[]Type keys this element used to have, so saved layouts are rewritten on the next build.
templatesreadonly string[]Page templates the element may be added to; omit to allow every template.
frameBlockFrameTagThe box drawn around each instance; `div` when omitted, `li` inside a list region, `span` for inline content.
componentrequiredElementComponent<SettingsOf<NoInfer<S>>>Draws the block.
SectionElement
A declared section, ready to export from a file under src/sections.
kindrequired'section'Always `section`.
typerequiredstringThe section's type key.
BlockElement
A declared block, ready to export from a file under src/blocks or src/sections.
kindrequired'block'Always `block`.
typerequiredstringThe block's type key.
SectionOverride
A theme renderer for a platform section type whose schema, inspector and data the platform keeps.
type SectionOverride<T extends PlatformSectionType>kindrequired'section'Always `section`.
typerequiredTThe platform section type it draws.
overriderequiredtrueAlways true: the schema stays the platform's.
BlockOverride
A theme renderer for a platform block type whose schema, inspector and data the platform keeps.
type BlockOverride<T extends PlatformBlockType>kindrequired'block'Always `block`.
typerequiredTThe platform block type it draws.
overriderequiredtrueAlways true: the schema stays the platform's.
SlotTag
The element type of a slot's box; none draws the children straight into the parent.
type SlotTag = 'div' | 'ul' | 'ol' | 'nav' | 'none'SlotProps
Props of Slot.
namestringA region the definition declares in `slots`; omit for the default region.
classNamestringClasses for the region's box, which is the children's layout box.
asSlotTagElement type of the region's box; `div` when omitted.
EditableTextTag
A tag EditableText can render.
type EditableTextTag = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'p' | 'span' | 'div' | 'strong' | 'em' | 'small' | 'label' | 'li' | 'figcaption' | 'blockquote'EditableTextProps
Props of EditableText.
settingrequiredstringId of a `text` or `textarea` setting of the current element.
asEditableTextTagTag to render; `span` when omitted.
classNamestringClasses added to the tag.