Other / Uncategorized

Every iPrintessApi method or property in printess-editor.d.ts that has no #ai-api:<category> JSDoc tag - grouped here so the reference stays complete rather than silently omitting them. Custom types referenced below (parameter and return shapes) are documented on the Types reference.

acceptDefaultTextIfMandatory

acceptDefaultTextIfMandatory(): boolean

Returns all default english translations or if language property is set / browser language is detected (if set to auto) the respective translation if available

Returns: boolean

addStyle

addStyle(className: string, properties: Record<string, unknown>, scope?: "document" | "template"): Promise<iExternalStyleResult>

Appends another block for a class name, leaving existing ones alone - the way to build the several-blocks-one-class pattern where each block carries its own if and Printess uses the one that is active. setStyle cannot express it, because it replaces.

The new block is last, so where it and an earlier block set the same property, this one wins.

Parameter Type Description
className string
properties Record<string, unknown>
scope? “document” | “template”

Returns: Promise<iExternalStyleResult>

addTableRow

addTableRow(fieldNameOrId: string, type: string): number | null

Adds a new row to a table form field. Returns row-index of added row.

Parameter Type Description
fieldNameOrId string The property-id or a form-field-name or form-field-id
type string each form field table should have a type column which can be set on insert.

Returns: number | null

addTableRowExt

addTableRowExt(fieldNameOrId: string, type: string, insertPosition?: number): { index: number | null; row: Record<string, any> | null }

Adds a new row to a table form field. Returns row-index of added row and the added row itself.

Parameter Type Description
fieldNameOrId string The property-id or a form-field-name or form-field-id
type string each form field table should have a type column which can be set on insert.
insertPosition? number

Returns: { index: number | null; row: Record<string, any> | null }

addTableRows

addTableRows(fieldNameOrId: string, type: string, ffLibName: string, libIndizies: Array<number>): number | null

Adds multiple table rows at once from another table from field

Parameter Type Description
fieldNameOrId string The property-id or a form-field-name or form-field-id
type string each form field table should have a type column which can be set on insert.
ffLibName string Name of form-field which contains row-library
libIndizies Array<number> list if row-indizies of row-library

Returns: number | null

addTableRowsExt

addTableRowsExt(fieldNameOrId: string, type: string, ffLibName: string, libIndizies: Array<number>, insertPosition?: number): { index: number | null, table: Array<Record<string, any>> | null }

Adds multiple table rows at once from another table from field

Parameter Type Description
fieldNameOrId string The property-id or a form-field-name or form-field-id
type string each form field table should have a type column which can be set on insert.
ffLibName string Name of form-field which contains row-library
libIndizies Array<number> list if row-indizies of row-library
insertPosition? number

Returns: { index: number | null, table: Array<Record<string, any>> | null }

aiDesignKeywords

aiDesignKeywords(): Array<string>

Returns: Array<string>

aiDesignMode

aiDesignMode(): "none" | "printess-make" | "claude-design"

Returns: “none” | “printess-make” | “claude-design”

aiTextEditOptionAllows

aiTextEditOptionAllows(): Array<AiTextEditOptionAllow>

returns an array of AI Text Edit Options the customer can choose from (in a dropdown) when enabling the showAiTextEditOptions.

Returns: Array<AiTextEditOptionAllow>

allowBackgroundFaceRemove

allowBackgroundFaceRemove(propertyId: string): boolean

Tells UI to show the button which cuts out the face (bg-face) without adding a contour.

Parameter Type Description
propertyId string The selected property-id

Returns: boolean

allowImageBackgroundRemove

allowImageBackgroundRemove(propertyId: string): boolean

Tells UI to always show image background remove button.

Parameter Type Description
propertyId string The selected property-id

Returns: boolean

allowImageUpscale

allowImageUpscale(propertyId: string): boolean

Tells UI to always show image background remove button.

Parameter Type Description
propertyId string The selected property-id

Returns: boolean

applyImageFilterSnippet

applyImageFilterSnippet(filterSnippetUrl: string): Promise<void>

Applies image-filter-snippet to selected image

Parameter Type Description
filterSnippetUrl string

Returns: Promise<void>

applyNumOfColsToLayoutsDialogMobile

applyNumOfColsToLayoutsDialogMobile(): boolean

Apply number of columns for layouts also to mobile Layout Selection Overlay

Returns: boolean

bcuiLoaded

bcuiLoaded(): Promise<void>

Called by BCUI when fully loaded and executes center spread in view first center

Returns: Promise<void>

bringErrorIntoView

bringErrorIntoView(err: iExternalError): Promise<void>

Select and zoom to the frame(s) mentioned in the error object.

Parameter Type Description
err iExternalError

Returns: Promise<void>

bringErrorIntoViewV2

bringErrorIntoViewV2(err: iErrorType): Promise<void>
Parameter Type Description
err iErrorType

Returns: Promise<void>

canChangeTableRowIndex

canChangeTableRowIndex(propertyId: string): boolean

Tells if a change position input should be displayed for the table row that is being edited changing the position (index) value in the table edit row moves the row accordingly to the new position

Parameter Type Description
propertyId string

Returns: boolean

canHaveDesktopFramePropertiesBar

canHaveDesktopFramePropertiesBar(): boolean

Returns if desktop ui should display a frame properties bar

Returns: boolean

canIgnoreLowImageResolution

canIgnoreLowImageResolution(): boolean

Tells if user is allowed to ignore low image resoution warnings

Returns: boolean

canPasteTableRowsJSON

canPasteTableRowsJSON(propertyId: string): boolean

Tells if user is allowed to paste JSON data to a table form field.

Parameter Type Description
propertyId string

Returns: boolean

canResizeFrame

canResizeFrame(propertyId: string): boolean

Whether the buyer may change the size of that frame, which is one way out of a poor print resolution. False when the template locks the size or does not allow frame handling at all.

Parameter Type Description
propertyId string The selected property-id

Returns: boolean

canUpscale

canUpscale(propertyId: string): Promise<boolean>

Asks the server whether the image behind that property can still be upscaled. Does not upscale anything, use it to decide what to offer the buyer before calling upscaleImage().

Parameter Type Description
propertyId string The selected property-id

Returns: Promise<boolean>

closePropertiesOverlay

closePropertiesOverlay(): Promise<void>

for example: in bcui you can close the the overlay if a form field changes

Returns: Promise<void>

colorIntensity

colorIntensity(color: string): "super-light" | "super-dark" | "light" | "dark" | "normal" | "no-color"

Calculates the brightness of a color, return no-color if color can’t be parsed

Parameter Type Description
color string hex or rgb() color

Returns: “super-light” | “super-dark” | “light” | “dark” | “normal” | “no-color”

createCropUi

createCropUi(propertyId: string, forDesktopDialog: boolean): null | { container: HTMLDivElement, setScale: (s: number) => void, getCropBox(): { top: number, left: number, width: number, height: number } }

Returns a simple ui to change the postion of an image

Parameter Type Description
propertyId string
forDesktopDialog boolean give more space if for desktop dialog

Returns: null | { container: HTMLDivElement, setScale: (s: number) => void, getCropBox(): { top: number, left: number, width: number, height: number } }

createCutContour

createCutContour(propertyId: string, outline?: number): Promise<boolean>

Creates a cut contour around the image

Parameter Type Description
propertyId string The selected property-id
outline? number

Returns: Promise<boolean>

createImageEdit

createImageEdit(propertyId: string, prompt: string, quality?: iExternalImageEditQuality, images?: string[], imageInfo?: { boxId: string | undefined, aspect: number, parentBoxId?: string }, model?: string, settings?: ImageEditSettings): Promise<boolean>

Modifies an existing image based on a prompt and uploads & assigns it to current frame.

Parameter Type Description
propertyId string
prompt string
quality? iExternalImageEditQuality
images? string[]
imageInfo? { boxId: string | undefined, aspect: number, parentBoxId?: string }
model? string
settings? ImageEditSettings

Returns: Promise<boolean>

createText2Image

createText2Image(prompt: string, style: SdxlStyle, negativePrompt?: string, model?: string, imageInfo?: { boxId: string | undefined, aspect: number, parentBoxId?: string }): Promise<void>

Creates an image based on a prompt and style and uploads & assigns it to current frame.

Parameter Type Description
prompt string
style SdxlStyle
negativePrompt? string
model? string
imageInfo? { boxId: string | undefined, aspect: number, parentBoxId?: string }

Returns: Promise<void>

debug

debug(): boolean

Returns global debug flag

Returns: boolean

editTableFullscreen

editTableFullscreen(): boolean

Indicates if a table can be edited in fullscreen mode

Returns: boolean

enableA11yForTableControl

enableA11yForTableControl(): boolean

Returns wether UI should show up/down buttons in table-control

Returns: boolean

enableCustomColors

enableCustomColors(): boolean

Returns if buyer ui should display option for custom colors in color dropdown

Returns: boolean

executeFormFieldScript

executeFormFieldScript(propertyId: string): Promise<string>

Runs a form field script, property-id must point to form field.

Parameter Type Description
propertyId string

Returns: Promise<string>

executeScript

executeScript(scriptName: string, args: string[]): string | Promise<string>
Parameter Type Description
scriptName string name of script in current template
args string[] all arguments as an array of string

Returns: string | Promise<string>

Used in these examples:

focusActiveTextEditor

focusActiveTextEditor(): boolean

Focus single or multi line editor when active

Returns: boolean

generateLiveTextFromAI

generateLiveTextFromAI(pid: string, promptForAI: string, usePreviousText: boolean): Promise<void>

Streams AI-generated text based on the given prompt and current editor content. Updates the editor live as the response is received in chunks.

Parameter Type Description
pid string
promptForAI string - Instructional prompt to guide the AI generation.
usePreviousText boolean

Returns: Promise<void>

getAddToBasketCallback

getAddToBasketCallback(): null | ((saveToken: string, url: string) => void)

Returns the add to basket callback you have set in attachPrintess()

Returns: null | ((saveToken: string, url: string) => void)

getAiDesignMakeData

getAiDesignMakeData(): iMakeData | null

returns make-data received on attach printess

Returns: iMakeData | null

getAiDesignProperties

getAiDesignProperties(): { name: string, p: iExternalProperty }[]

Returns: { name: string, p: iExternalProperty }[]

getAiImageEffects

getAiImageEffects(): Promise<ImageAIFilterCategory[]>

loads all available Image AI Filters

Returns: Promise<ImageAIFilterCategory[]>

getAllRequiredPropertiesBySpreadIdSync

getAllRequiredPropertiesBySpreadIdSync(spreadId: string): Array<Array<iExternalProperty>>

Returns a list of all required properties on a specific spread (sync)

Parameter Type Description
spreadId string

Returns: Array<Array<iExternalProperty>>

getAllRequiredPropertiesSync

getAllRequiredPropertiesSync(): Array<Array<iExternalProperty>>

Returns a list of all required properties (sync)

Returns: Array<Array<iExternalProperty>>

getAspectControl

getAspectControl(): HTMLElement | ""

Returns the Designer Side Aspect Control

Returns: HTMLElement | “”

getAvailableFontSizes

getAvailableFontSizes(size: string): { sizes: Array<number>, unit: string }

Returns list of available Font Sizes based on “size” unit.

Parameter Type Description
size string

Returns: { sizes: Array<number>, unit: string }

getBackButtonCallback

getBackButtonCallback(): null | ((saveToken: string, thumbnailUrl: string) => void)

Returns the back button callback you have set in attachPrintess()

Returns: null | ((saveToken: string, thumbnailUrl: string) => void)

getButtonCircleModel

getButtonCircleModel(m: iMobileUIButton, isSelected: boolean, customHandwriting?: boolean, customSplitterButton?: boolean, customTableRecordButton?: boolean): iButtonCircle

Mobile UI helper method to get model to draw a circle button including icons, gauge, etc. uiHelper contains a method to create an SVG from this circle model

Parameter Type Description
m iMobileUIButton The mobile button to create a circle for
isSelected boolean If the button is selected
customHandwriting? boolean
customSplitterButton? boolean
customTableRecordButton? boolean

Returns: iButtonCircle

getColorInfo

getColorInfo(p: iExternalProperty): iExternalColor | null
Parameter Type Description
p iExternalProperty

Returns: iExternalColor | null

getContentEditables

This method is deprecated.

getContentEditables(): TemplateEditables

Returns: TemplateEditables

getErrorCallback

getErrorCallback(): null | ((errorName: ErrorName, data?: Record<string, string>) => void)

Returns the error callback you have set in attachPrintess()

Returns: null | ((errorName: ErrorName, data?: Record<string, string>) => void)

getFirstLevelImageButtons

getFirstLevelImageButtons(p: iExternalProperty, addImageTools: boolean): Array<iMobileUIButton>

Used in BCUI, gets new basic image categorie buttons

Parameter Type Description
p iExternalProperty
addImageTools boolean

Returns: Array<iMobileUIButton>

getFrameUiHintPosition

getFrameUiHintPosition(): Promise<iExternalFrame>

Get frames available on spread. Return first editable frame.

Returns: Promise<iExternalFrame>

getFreestylePhotobookWizardHeadline

getFreestylePhotobookWizardHeadline(): string

Returns headline to display in wizard for freestyle photobooks.

Returns: string

getImageBoxesForColorPalette

getImageBoxesForColorPalette(): string[]

Returns maximum two image IDs with biggest boxes on a spread (to define colors from it)

Returns: string[]

getImageFilterSnippets

getImageFilterSnippets(tags: Array<string> | ReadonlyArray<string>): Promise<Array<iExternalSnippet>>

Get a list of all image-filter-snippets having any of the provided tags

Parameter Type Description
tags Array<string> | ReadonlyArray<string>

Returns: Promise<Array<iExternalSnippet>>

getInitialTabId

getInitialTabId(): string

Get the id if the tab to display on start-up default is #PHOTOS

Returns: string

getLetterGeneratorJson

getLetterGeneratorJson(): Promise<string | undefined>

Returns the JSON required to generate an AI Letter

Returns: Promise<string | undefined>

getLetterGeneratorMenuTitle

getLetterGeneratorMenuTitle(): string

Get the menu title displayed when opening the AI Text Generator dropdown in the Buyer Side

Returns: string

getLoadTemplateButtonCallback

getLoadTemplateButtonCallback(): null | (() => void)

Returns the loadTemplateButtonCallback you have set in attachPrintess()

Returns: null | (() => void)

getMagicPhotobookSettingsTab

getMagicPhotobookSettingsTab(): "NONE" | "#FORMFIELDS" | "#FORMFIELDS1" | "#FORMFIELDS2"

Returns tab displayed in magic photobook settings

Returns: “NONE” | “#FORMFIELDS” | “#FORMFIELDS1” | “#FORMFIELDS2”

getMagicPhotobookWizardHeadline

getMagicPhotobookWizardHeadline(): string

Returns headline to display in wizard for magic photobooks.

Returns: string

getMaxUpscaleFactor

getMaxUpscaleFactor(propertyId: string): number

How much bigger the image behind that property can still get, as a linear factor: 1 when no upscale is left, 2 for one step, 4 for two and so on. Multiply the current dpi by it to learn the best resolution the frame can still reach.

Parameter Type Description
propertyId string The selected property-id

Returns: number

getMobileImageCropModeEnabled

getMobileImageCropModeEnabled(): boolean

get if mobile image crop mode is enabled and should show the circular image pan-icon

Returns: boolean

getMobileUiBackgroundButton

getMobileUiBackgroundButton(): Array<iMobileUIButton>

Returns change background button if available

Returns: Array<iMobileUIButton>

getMobileUiButtons

getMobileUiButtons(properties: Array<iExternalProperty>, propertyIdFilter: "all" | "root" | string, customHandwriting?: boolean): Array<iMobileUIButton>

Mobile UI helper method to convert a list of properties to a list of mobile buttons to show to the buyer

Parameter Type Description
properties Array<iExternalProperty> list of properties to get buttons from
propertyIdFilter “all” | “root” | string can be the id of a specific property to get only property related buttons (for images and multi-line text)
customHandwriting? boolean

Returns: Array<iMobileUIButton>

getMobileUiRecordNavigationArrows

getMobileUiRecordNavigationArrows(): Array<iMobileUIButton>

Mobile UI helper method to go through a table form-field which is set as data-source in the template

Returns: Array<iMobileUIButton>

getMobileUiScissorsButtons

getMobileUiScissorsButtons(): Array<iMobileUIButton>

Returns horizontal and vertical scissor buttons if available

Returns: Array<iMobileUIButton>

getMobileUiSplitterGapButton

getMobileUiSplitterGapButton(): Array<iMobileUIButton>

Returns grid gap button for splitter frames

Returns: Array<iMobileUIButton>

getMobileUiSplitterLayoutsButton

getMobileUiSplitterLayoutsButton(): Array<iMobileUIButton>

Returns change layouts button for splitter text frames

Returns: Array<iMobileUIButton>

getMobileUiSplitterToImageButton

getMobileUiSplitterToImageButton(): Array<iMobileUIButton>

Returns text to image convert button if available

Returns: Array<iMobileUIButton>

getMobileUiSplitterToTextButton

getMobileUiSplitterToTextButton(): Array<iMobileUIButton>

Returns image to text convert button if available

Returns: Array<iMobileUIButton>

getPanelUiHintVisibility

getPanelUiHintVisibility(pos: PanelUiHintPos, view: "mobile" | "desktop"): boolean

Returns view dependend visibility of a certain panel-ui-hint

Parameter Type Description
pos PanelUiHintPos
view “mobile” | “desktop”

Returns: boolean

getPasteboardColor

getPasteboardColor(): string

Returns current pasteboard color

Returns: string

getPhotoPlacementContext

getPhotoPlacementContext(): { canAddLayout: boolean, canAddFrame: boolean, clickPlacesItself: boolean, pageNumbers: number[] }

Returns: { canAddLayout: boolean, canAddFrame: boolean, clickPlacesItself: boolean, pageNumbers: number[] }

getPhotoPlacementLayouts

getPhotoPlacementLayouts(imageId: string): Promise<iExternalCollageLayout[]>
Parameter Type Description
imageId string

Returns: Promise<iExternalCollageLayout[]>

getRegExp

getRegExp(key: string | "europe-letters"): string | null
Parameter Type Description
key string | “europe-letters” retrieves a regexp expression from dictonary

Returns: string | null

getSaveTemplateCallback

getSaveTemplateCallback(): null | ((saveToken: string, type: "save" | "close", thumbnailUrl: string) => void)

Returns the save button callback you have set in attachPrintess()

Returns: null | ((saveToken: string, type: “save” | “close”, thumbnailUrl: string) => void)

getScaledFontSize

getScaledFontSize(direction: "up" | "down", propertyId: string | "ED_selection", overrideSize?: string): string | null

Gets the current font-size either in text-editor or form mode as Length (string like 12% or 14pt)

Parameter Type Description
direction “up” | “down”
propertyId string | “ED_selection”
overrideSize? string

Returns: string | null

getScriptButtons

getScriptButtons(): Array<iExternalButton>

Returns all PanelUi button objects defined in global scripts

Returns: Array<iExternalButton>

getShopDataCallback

getShopDataCallback(): null | (() => Promise<IShopData>)

Returns the shop data callback you have set in attachPrintess()

Returns: null | (() => Promise<IShopData>)

getShopDataLoadedCallback

getShopDataLoadedCallback(): null | ((data: ISavedShopData) => void)

Returns the shop callback that needs to be called if the user clicks on load and selects a saved design

Returns: null | ((data: ISavedShopData) => void)

getShopLoginCallback

getShopLoginCallback(): null | ((type: "register" | "login", saveToken: string, thumbnailUrl: string, displayName: string) => void)

Returns the shop login callback you have set in attachPrintess()

Returns: null | ((type: “register” | “login”, saveToken: string, thumbnailUrl: string, displayName: string) => void)

getShopProjectDisplayNameCallback

getShopProjectDisplayNameCallback(): null | (() => Promise<string>)

Returns the display name callback you have set in attachPrintess()

Returns: null | (() => Promise<string>)

getShopSavedDataCallback

getShopSavedDataCallback(): null | ((shopData: IShopDataProjectName) => void)

Returns the shop saved data callback you have set in attachPrintess()

Returns: null | ((shopData: IShopDataProjectName) => void)

getSimilarImages

getSimilarImages(referenceImageId?: string, maxImages?: number): Array<iExternalImage>

Returns the buyer side images ordered by how similar they are to the reference image (first = near identical, last = vaguely similar). The reference image itself is not included.

Parameter Type Description
referenceImageId? string
maxImages? number

Returns: Array<iExternalImage>

getStyleValue

getStyleValue(className: string, propertyName: string): string

Retrieves a style value from a particular class

Parameter Type Description
className string
propertyName string

Returns: string

getTableGroupNav

getTableGroupNav(): iTableGroupNav

Returns which jump-to-group navigation buyer-side tables offer. Only tables which are organised by groups - i.e. which offer adding one - show it.

Returns: iTableGroupNav

getTableGroupType

getTableGroupType(): string

Returns group type as string for table form fields

Returns: string

getTableRowIndex

getTableRowIndex(propertyId: string): number

Retrieves the current row index for a table-property if table is set to be data-source of template the call returns current data-index

Parameter Type Description
propertyId string id of a table property

Returns: number

getTableRowsToAdd

getTableRowsToAdd(ffName: string): Array<{ index: number, label: string }>

Returns the row-indizies of a table form field to add to another table form field. An array of those indizies can be passed to ‘addTableRows()’

Parameter Type Description
ffName string Form Field Name

Returns: Array<{ index: number, label: string }>

getTableSelectListByFormFieldName

getTableSelectListByFormFieldName(ffName: string): Array<{ value: string, label: string }> | null

Returns name/value-list only from table form field

Parameter Type Description
ffName string Name of FormField

Returns: Array<{ value: string, label: string }> | null

getText2ImageStyles

getText2ImageStyles(): Array<string>

Returns list of available SDXL Styles

Returns: Array<string>

getThemeDocId

getThemeDocId(): string

Retrieve doc-id of current theme

Returns: string

getThemeName

getThemeName(): string

Retrieve panel-theme of current document

Returns: string

hasImageAssignAction

hasImageAssignAction(propertyId: string): boolean

Indicates if the frame of the given image property has an assign action (e.g. background removal or face swap), which runs on every image assigned to that frame. The UI offers no AI image tools for such a frame.

Parameter Type Description
propertyId string The selected property-id

Returns: boolean

hasImageLayoutSelection

hasImageLayoutSelection(): boolean

Returns if auto image layout selection is enabled

Returns: boolean

hasImageSwap

hasImageSwap(): boolean

Indicates if current selected image can swap

Returns: boolean

hasMetaProperties

hasMetaProperties(p: iExternalProperty): boolean

Returns if an externalProperty resolves to multiple mobile-ui-buttons

Parameter Type Description
p iExternalProperty

Returns: boolean

hasOverlayTextEditing

hasOverlayTextEditing(): boolean

Returns if text-editing should be displayed as overlay on desktop

Returns: boolean

hasSimilarImagePicker

hasSimilarImagePicker(): boolean

Indicates if the buyer may pick another image for the current selection from a list of similar images.

Returns: boolean

hasSimilarImages

hasSimilarImages(referenceImageId?: string): boolean

Indicates if the given image has at least one similar companion among the buyer side images. Similarity comes from the similarity clusters in iExternalImage.groupAnalysis.

Parameter Type Description
referenceImageId? string

Returns: boolean

hasTextOverflow

hasTextOverflow(propertyId: string): boolean

Returns true if the associated mutli-line text-frame has text which does not fit into the frame

Parameter Type Description
propertyId string

Returns: boolean

hideDoneButtonInUiHelper

This method is deprecated.

hideDoneButtonInUiHelper(): boolean

Hides Done Button in UI-Helper

Returns: boolean

hideOverlay

hideOverlay(): void

Hides printess editor overlay (see showOverlay())

Returns: void

imageSwapActive

imageSwapActive(): boolean

Indicates if editor is in image swap mode

Returns: boolean

isDataSource

isDataSource(propertyId: string): boolean

tells if the propertyId refers to a table form-field which is set as data-source in the template

Parameter Type Description
propertyId string

Returns: boolean

isOffCanvasProperty

isOffCanvasProperty(p: iExternalProperty): boolean

For off-canvas displays of to many frame properties. Determines if the property is suitable to be displayed off canvas.

Parameter Type Description
p iExternalProperty the property to look for

Returns: boolean

isPrintessSystem

isPrintessSystem(): boolean

Returns true if the system is the Printess SaaS system.

Returns: boolean

isScrolledToBottom

isScrolledToBottom(): boolean

indicates if printess view scrolling has reached the bottom

Returns: boolean

Used in these examples:

isScrolledToTop

isScrolledToTop(): boolean

indicates if printess view scrolling has reached the top

Returns: boolean

isShopUserLoggedInCallback

isShopUserLoggedInCallback(): null | (() => Promise<boolean>)

Returns the login state callback you have set in attachPrintess()

Returns: null | (() => Promise<boolean>)

isTabletLayout

isTabletLayout(): boolean

True when the buyer ui shows its desktop panel layout on a device with a software keyboard (tablet, big phone in landscape). Text properties are then edited in the full-screen overlay, because panel inputs would be covered by the keyboard.

Returns: boolean

isTextButton

isTextButton(m: iMobileUIButton): boolean

Returns if a iMobileUIButton should display text instead of an icon

Parameter Type Description
m iMobileUIButton

Returns: boolean

isTextEditorOpen

isTextEditorOpen(): boolean

Returns true if either rich- or simple-text-editor is currently active

Returns: boolean

jumpToFormFieldsAfterLayoutApply

jumpToFormFieldsAfterLayoutApply(): boolean

Wether UI should jump to FormFields Tab after Layout Selection

Returns: boolean

languageLong

languageLong(): string

Returns long language code if available. Otherwise returns short code like languageShort(). Format: lower case main language + sub language in upper case, like “en-GB” or “de-DE”

Returns: string

languageShort

languageShort(): string

Returns short language code in lower case, like “en” or “de”

Returns: string

listScripts

listScripts(): Promise<Array<iExternalScriptInfo>>

Every script the template has - name, type, signature and length, with no bodies. Host-page scripts (config.scripts) are included and marked readOnly, because they hold their name and win every lookup even though they are not part of the template.

Returns: Promise<Array<iExternalScriptInfo>>

logout

logout(): void

Logs the current printess user out Not available for buyer-side users! Only if userInBuyerSide() === true

Returns: void

modifyStyle

modifyStyle(className: string, patch: Record<string, unknown>, scope?: "document" | "template"): Promise<iExternalStyleResult>

Patches the properties of a class written as a single block: a property given is set, a property passed as null is removed, and everything else - the block’s other properties, its if and its comments - is left as it was.

null deletes because a style property has no default: absence means “fall through to the frame”. Refused when the class does not exist, or is written as more than one block.

Parameter Type Description
className string
patch Record<string, unknown>
scope? “document” | “template”

Returns: Promise<iExternalStyleResult>

neverHideMobileToolbar

neverHideMobileToolbar(): boolean

Returns status of config-flag neverHideMobileToolbar, default is false.

Returns: boolean

numberOfColumns

numberOfColumns(): number

Returns how many columns a Change Layout overview should have to display layout snippets more properly

Returns: number

placePhotoInNewLayout

placePhotoInNewLayout(imageId: string, splitVariantId: string): Promise<void>
Parameter Type Description
imageId string
splitVariantId string

Returns: Promise<void>

populateDesign

populateDesign(autoSelectLayout: boolean, callback: (percent: number, textPreview: string) => void, errorCallback: (error: any) => void): Promise<void>
Parameter Type Description
autoSelectLayout boolean
callback (percent: number, textPreview: string) => void
errorCallback (error: any) => void

Returns: Promise<void>

raiseTabChangeEvent

raiseTabChangeEvent(tabId: string): void

Used by panel-ui to call an existing onTabChanged script (event)

Parameter Type Description
tabId string

Returns: void

readScript

readScript(name: string): Promise<iExternalScriptSource>

One script’s full source by name. Reports the names that do exist when there is no match.

Parameter Type Description
name string

Returns: Promise<iExternalScriptSource>

readStyles

readStyles(): Promise<Record<string, unknown>>

Both stylesheets of the open template, as the blocks they are written as: templateStyles (the global sheet, which works across documents) and documentStyles (the open document’s own, null on design and group templates). Each carries the raw text - the only lossless form - plus a blocks projection with each block’s selector, class names, if condition and properties as source text.

Read this before writing a style. A style overrides the frame’s own setting for the same property, which is the opposite of CSS; several blocks may share one class name; and the write verbs refuse the cases where “the” block is ambiguous.

Returns: Promise<Record<string, unknown>>

removeAiImageFramesFromPrimaryDocument

removeAiImageFramesFromPrimaryDocument(): Promise<void>

Returns: Promise<void>

removeBackgroundFace

removeBackgroundFace(propertyId: string): Promise<boolean>

Cut out face of currently selected images

Parameter Type Description
propertyId string The selected property-id

Returns: Promise<boolean>

removeHandwritingImage

removeHandwritingImage(): Promise<boolean>

removes image for rich-text-frames which have a handwriting image set Sets back to text

Returns: Promise<boolean>

removeImageBackground

removeImageBackground(propertyId: string): Promise<boolean>

Removes Background of currently selected images

Parameter Type Description
propertyId string The selected property-id

Returns: Promise<boolean>

removeScript

removeScript(name: string, force?: boolean): Promise<iExternalScriptResult>

Deletes a script. Refuses while a form field, a frame click action or another script still names it, since those references fail silently rather than reporting anything - pass force to delete anyway and get the broken referrers listed back.

Parameter Type Description
name string
force? boolean

Returns: Promise<iExternalScriptResult>

removeStyle

removeStyle(className: string, scope?: "document" | "template"): Promise<iExternalStyleResult>

Removes every block carrying a class name. Frames keep the class name - a class no style defines simply falls through to the frame’s own settings - and the number of frames still carrying it is reported so the caller can decide what to do about them.

Parameter Type Description
className string
scope? “document” | “template”

Returns: Promise<iExternalStyleResult>

reportIgnoredError

reportIgnoredError(err: iErrorType): void

Only for internal use by the Printess buyer UI: records that the buyer dismissed this error with an “Ignore” button, so that validateAsyncV2 returns it with isIgnored: true. You only need this if you replace the buyer UI with your own validation dialog.

Parameter Type Description
err iErrorType

Returns: void

resetUndoBufferAfterInitialLayoutSelection

resetUndoBufferAfterInitialLayoutSelection(spreadId: string): void

Lets printess know that the layout has been applied

Parameter Type Description
spreadId string

Returns: void

saveScript

saveScript(js: string, type: string, replaceExisting?: boolean): Promise<iExternalScriptResult>

Creates a script, or replaces one when replaceExisting is set.

There is no name parameter: the name is the function <name> in js. The Scripts dialog re-derives the map key from the body, so a script saved under a name that disagrees with its own function name is silently renamed the moment a designer edits it - which breaks every triggerScript, click action and ${script.x()} pointing at it.

The body is validated the way Printess runs it (as an expression, not as a function body), so a body that saves here is a body that runs. type is one of "script", "dialog", "panel", "button-definition", "event"; for "event" the function name must be a template event name.

Parameter Type Description
js string
type string
replaceExisting? boolean

Returns: Promise<iExternalScriptResult>

selectedFrameBarFeature

selectedFrameBarFeature(): { images: number, texts: number, shapes: number, storys: number, total: number }

Tells the ui if it can rely that only one of the returned frame-types is selected

Returns: { images: number, texts: number, shapes: number, storys: number, total: number }

selectLayoutDialogHasBeenShownForCurrentSpread

selectLayoutDialogHasBeenShownForCurrentSpread(spreadId: string): void

Register Select Layout Dialog shown for specific Spread

Parameter Type Description
spreadId string

Returns: void

selectLayoutsTabOneTime

selectLayoutsTabOneTime(): boolean

Indicates if a Layouts Tab should be auto selected;

Returns: boolean

selectTab

selectTab(tab: "#NONE" | "#LAYOUTS" | "#PHOTOS" | "#THEME" | "#PAGES" | "#ADD-TEXT" | "#ADD-IMAGE" |
    "#FORMFIELDS" | "#FORMFIELDS1" | "#FORMFIELDS2" | string): Promise<void>

Selects Tab in Panel-Ui

Parameter Type Description
tab “#NONE” | “#LAYOUTS” | “#PHOTOS” | “#THEME” | “#PAGES” | “#ADD-TEXT” | “#ADD-IMAGE” | “#FORMFIELDS” | “#FORMFIELDS1” | “#FORMFIELDS2” | string

Returns: Promise<void>

setBcuiMobile

setBcuiMobile(v: boolean): void
Parameter Type Description
v boolean

Returns: void

setCustomIcons

setCustomIcons(icons: Partial<Record<iconName, string>>, addToExisting: boolean): void

Sets attach-parameter icons later in the game

Parameter Type Description
icons Partial<Record<iconName, string>>
addToExisting boolean

Returns: void

setCustomScripts

setCustomScripts(scripts: Partial<Record<string, string>>, addToExisting: boolean): void

Sets attach-parameter scripts later in the game

Parameter Type Description
scripts Partial<Record<string, string>>
addToExisting boolean

Returns: void

setDefaultHyphenationLanguage

setDefaultHyphenationLanguage(lang: iExternalHyphenationLanguage): Promise<boolean>

Sets global hyphenation language which overrides local language set on story/text-frame level.

Parameter Type Description
lang iExternalHyphenationLanguage language

Returns: Promise<boolean>

setEditorText

setEditorText(text: string): boolean

Replaces multi-line text only works with a current active multi-line-text-editor

Parameter Type Description
text string The text to insert into the active multi-line editor

Returns: boolean

setIFrameViewPort

setIFrameViewPort(v: { offsetTop: number, height: number }): void

only for internal use, to transfer visual-viewport to iOs in iframe-mode

Parameter Type Description
v { offsetTop: number, height: number }

Returns: void

setStyle

setStyle(className: string, properties: Record<string, unknown>, scope?: "document" | "template"): Promise<iExternalStyleResult>

Replaces a style class’s whole block, creating the class when it does not exist yet.

A set*, so a property left out is a property removed - “make .headline exactly this”. Refused when the class is written as more than one block, or shares a selector with another class, because replacing “the” block has no single meaning there.

A frame opts into a style by carrying the class name - set that with modifyFrame(id, { styleClassNames: [...] }).

A value is written exactly as it appears in the stylesheet, so it may be a literal ("24pt", "[Black]", "#aa22aa") or a template-literal expression ("${form.color}"). Literals are validated the way the renderer parses them - including colours, which the stylesheet parser itself would silently turn into black. frame.… in a value is refused for scope: "template", where it throws at render time and discards the whole block.

Parameter Type Description
className string
properties Record<string, unknown>
scope? “document” | “template”

Returns: Promise<iExternalStyleResult>

setTableCell

setTableCell(fieldNameOrId: string, rowIndex: number, col: iExternalTableColumn, value: string | number | boolean): Promise<iExternalError | null>

updates a specific cell of a form field of type “table” Any then all other updates, this will NOT trigger a selection change event on buyer side

Parameter Type Description
fieldNameOrId string
rowIndex number
col iExternalTableColumn
value string | number | boolean

Returns: Promise<iExternalError | null>

setTableCellV2

setTableCellV2(fieldNameOrId: string, rowIndex: number, col: iExternalTableColumn, value: string | number | boolean): Promise<iErrorType | null>
Parameter Type Description
fieldNameOrId string
rowIndex number
col iExternalTableColumn
value string | number | boolean

Returns: Promise<iErrorType | null>

setTableRowIndex

setTableRowIndex(propertyId: string, index: number): void

Sets the selected index of the primary data-source if the propertyId refers to a table form-field which is set as data-source in the template

Parameter Type Description
propertyId string id of a table property
index number current row-index to select

Returns: void

setTextStyleProperty

setTextStyleProperty(propertyId: string, name: "font" | "lineHeight" | "color" | "size" | "tracking" | "hAlign" | "vAlign" | "pStyle" | "baselineScript", value: string, textStyleMode?: textStyleModeEnum): Promise<string>

Method to set a text style meta-property

Parameter Type Description
propertyId string
name “font” | “lineHeight” | “color” | “size” | “tracking” | “hAlign” | “vAlign” | “pStyle” | “baselineScript”
value string
textStyleMode? textStyleModeEnum

Returns: Promise<string>

setUserHasZoomedFlag

setUserHasZoomedFlag(newValue: boolean): void

Tells printess that a user interaction has changed the zoom, no automatic spread zoom will be executed after this

Parameter Type Description
newValue boolean

Returns: void

showAiImageEffects

showAiImageEffects(): boolean

Returns if buyer should be able to use advanced ai image effects

Returns: boolean

showAiTextEditOptions

showAiTextEditOptions(): boolean

Allow AI Text editing like spell checking, changing writing-style, etc.

Returns: boolean

showColorDialog

showColorDialog(p: iExternalProperty, bcuiCssVariables?: any): Promise<iExternalColor | null>

Shows internal color dialog to select cmyk color

Parameter Type Description
p iExternalProperty
bcuiCssVariables? any

Returns: Promise<iExternalColor | null>

showContextMenu

showContextMenu(e: MouseEvent, items: Array<iExternalContextMenuItem>): void

Displays a dropdown Menu at the target position with the set menu items

Parameter Type Description
e MouseEvent MouseEvent to get the target and mouse position
items Array<iExternalContextMenuItem> Menu items that should be displayed

Returns: void

showDocumentBackButton

showDocumentBackButton(): boolean

Returns: boolean

showEnterTextEditorButton

showEnterTextEditorButton(): boolean

Returns true if either rich- or simple-text-editing is allowed (text-content is turned on)

Returns: boolean

showFormFieldTabsAsSteps

showFormFieldTabsAsSteps(): boolean

Returns true if a previous step is availabel

Returns: boolean

showLayoutsDialog

showLayoutsDialog(): boolean

Indicates if a Layouts Dialog should be displayed when initially opening the Buyer Side to choose a Layout Snippet

Returns: boolean

showLoadButton

showLoadButton(): boolean

Returns true if the ui should show a “load” button.

Returns: boolean

showMobileTabNavigation

showMobileTabNavigation(): boolean

Returns Buyer-Side Flag if ui should show bottom tab bar on mobile

Returns: boolean

showOverlay

showOverlay(message: string): void

Displays a grey overlay on printess editor

Parameter Type Description
message string Message to show on overlay

Returns: void

showPagesOnLoad

showPagesOnLoad(): iShowPagesPreviewMode

Tells UI to show pages-overview after magic-photobook-wizzard has been completeted

Returns: iShowPagesPreviewMode

showPhotoTab

showPhotoTab(): boolean

If Tab-Navigation is enabled, this method tells if a “PHOTO” tab makes sense.

Returns: boolean

showSimplifiedPagesView

showSimplifiedPagesView(): iShowPagesPreviewMode

Tells UI to show simplified pages view as last step of the magic-photobook-wizzard

Returns: iShowPagesPreviewMode

showSnippetPreviewOverlay

showSnippetPreviewOverlay(): boolean

Enables snippet preview overlay on snippet thumbnail hover

Returns: boolean

showTabNavigation

showTabNavigation(): boolean

Returns Buyer-Side Flag if ui should show left tab bar

Returns: boolean

showTabNavigationSetting

showTabNavigationSetting(): boolean

Returns the pure setting from buyer-side dialog

Returns: boolean

showText2Image

showText2Image(): null | { selectStyle: boolean, prompt: string, prefix: string, postfix: string, defaultPrompt: string, style: SdxlStyle | null, negativePrompt: string, model: string, transparency: string, allowUpload: boolean }

Returns not null if buyer should be able to use generative ai image creation

Returns: null | { selectStyle: boolean, prompt: string, prefix: string, postfix: string, defaultPrompt: string, style: SdxlStyle | null, negativePrompt: string, model: string, transparency: string, allowUpload: boolean }

showTextEditor

showTextEditor(): void

Open rich- or simple-text-editor

Returns: void

showTextStyleCaptions

showTextStyleCaptions(): boolean

Returns true if text styles should have a caption

Returns: boolean

startOrStopImageSwap

startOrStopImageSwap(): void

Activates Image Swap Mode

Returns: void

streamAnthropicPrompt

streamAnthropicPrompt(
    request: {
      prompt: string,
      model?: "fable-5.1" | "fable-5.0" | "opus-5.5" | "opus-5.0" | "opus-4.8" | "opus-4.7" | "sonnet-5.5" | "sonnet-5.0" | "sonnet-4.6" | "haiku-4.5",
      skill?: string,
      maxTokens?: number,
      effort?: TextEffort_Anthropic,
      imageUrls?: string[],
      sessionId?: string,
      containerId?: string,
      purpose?: "Claude Design" | "Script Creation"
    },
    onMessage: (message: string) => void,
    onFinished: (skillResults?: Array<{ filename: string, mimeType: string, encoding: "utf8" | "base64", data: string }>) => void
  ): Promise<{ sessionId?: string, containerId?: string, aiCreditsUsed?: number }>

Stream a prompt to Anthropic (Claude). Forwards text deltas to onMessage as they arrive and calls onFinished once the stream completes, passing any skill-generated files.

Parameter Type Description
request { prompt: string, model?: “fable-5.1” | “fable-5.0” | “opus-5.5” | “opus-5.0” | “opus-4.8” | “opus-4.7” | “sonnet-5.5” | “sonnet-5.0” | “sonnet-4.6” | “haiku-4.5”, skill?: string, maxTokens?: number, effort?: TextEffort_Anthropic, imageUrls?: string[], sessionId?: string, containerId?: string, purpose?: “Claude Design” | “Script Creation” }
onMessage (message: string) => void
onFinished (skillResults?: Array<{ filename: string, mimeType: string, encoding: “utf8” | “base64”, data: string }>) => void

Returns: Promise<{ sessionId?: string, containerId?: string, aiCreditsUsed?: number }>

streamPrompt

streamPrompt(prompt: string, onMessage: (message: string) => void, onFinished: () => void): Promise<void>
Parameter Type Description
prompt string
onMessage (message: string) => void
onFinished () => void

Returns: Promise<void>

toggleMobileImageCropModeEnabled

toggleMobileImageCropModeEnabled(): boolean

toggle mobile image crop mode

Returns: boolean

uiHintsDisplay

uiHintsDisplay(): Array<"splitterGuide" | "layoutSnippets" | "groupSnippets" | "editableFrames" | "expertMode">

returns an array of uiHints to be displayed on buyer side.

Returns: Array<“splitterGuide” | “layoutSnippets” | “groupSnippets” | “editableFrames” | “expertMode”>

upscaleImage

upscaleImage(propertyId: string): Promise<boolean>

Upscales Image of currently selected images

Parameter Type Description
propertyId string The selected property-id

Returns: Promise<boolean>

userInBuyerSide

userInBuyerSide(): boolean

Returns if a real user is logged in - in buyer side only mode with only print option

Returns: boolean

validate

This method is deprecated.

validate(mode?: "all" | "until-current-step" | "selection"): Array<iExternalError>
Parameter Type Description
mode? “all” | “until-current-step” | “selection” Specifies when and up to which point the validation should be done.

Returns: Array<iExternalError>

validateAsync

validateAsync(mode?: "all" | "until-current-step" | "selection"): Promise<Array<iExternalError>>

Closes open editors and returns an array of external property errors that can be used to display errors like missing text to the customer

Parameter Type Description
mode? “all” | “until-current-step” | “selection” Specifies when and up to which point the validation should be done.

Returns: Promise<Array<iExternalError>>

validateAsyncV2

validateAsyncV2(mode?: "all" | "until-current-step" | "selection"): Promise<Array<iErrorType>>

Closes open editors and returns every validation error of the design.

Errors the buyer dismissed with the “Ignore” button are still returned, flagged with isIgnored: true - so a shop can tell that the buyer knowingly proceeded past a low-resolution image or a blank book page. Filter them out with errors.filter(e => !e.isIgnored) if you only want the blocking ones.

Parameter Type Description
mode? “all” | “until-current-step” | “selection” Specifies when and up to which point the validation should be done.

Returns: Promise<Array<iErrorType>>

validateCurrentTabId

validateCurrentTabId(curTabId: string): string

Returns passed tab-id or initial tab id if current is invalid

Parameter Type Description
curTabId string

Returns: string

WcBc

WcBc: {
    masterStyles: () => string
    getStrokeUi: () => HTMLElement // TemplateResult
  }

Returns: { masterStyles: () => string getStrokeUi: () => HTMLElement // TemplateResult }