Editor integration SDK reference

Safe section and block attributes used by the visual editor.

Import these public values from @upstorr/theme-sdk/v1. Do not import their internal source files.

getThemeBlockProps

getThemeBlockProps(block: ThemeEditorBlock, options?: ThemeEditorBlockOptions): { 'data-editor-block-id': string; 'data-editor-block-type': string; 'data-editor-block-name': string | undefined; 'data-editor-slot-id': string | undefined; 'data-editor-render-id': string | undefined; 'data-upstorr-block-id': string; 'data-upstorr-block-type': string; 'data-upstorr-block-name': string | undefined; 'data-upstorr-slot-id': string | undefined; 'data-upstorr-render-id': string | undefined; }

getThemeSectionProps

getThemeSectionProps(section: ThemeEditorSection, options?: ThemeEditorSectionOptions): { 'data-editor-section-id': string; 'data-editor-section-type': string; 'data-editor-section-name': string | undefined; 'data-editor-section-group': string | undefined; 'data-editor-page-type': string | undefined; 'data-upstorr-section-id': string; 'data-upstorr-section-type': string; 'data-upstorr-section-name': string | undefined; 'data-upstorr-section-group': string | undefined; 'data-upstorr-section-page-type': string | undefined; }

ThemeEditorBlock

type ThemeEditorBlock = {
    id: string
    type: string
    label?: string | null
    renderId?: string | null
    renderSlotId?: string | null
    settings?: Record<string, unknown> | null
}

ThemeEditorBlockOptions

type ThemeEditorBlockOptions = {
    name?: string | null
    renderId?: string | null
    renderSlotId?: string | null
}

ThemeEditorSection

type ThemeEditorSection = {
    id: string
    type: string
    label?: string | null
    group?: string | null
    pageType?: string | null
    settings?: Record<string, unknown> | null
}

ThemeEditorSectionOptions

type ThemeEditorSectionOptions = {
    name?: string | null
    group?: string | null
    pageType?: string | null
}