Back to Website
Show / Hide Table of Contents

Class AuWizard

Implements a multi-step editor.

Package: ui-framework

Constructors

AuWizard()

Declaration
new AuWizard()

Properties

downloadUrl

Url of the blob object to download by the user, which is created in downloadFilesAsZip.

Declaration
public downloadUrl: string = ""
Property Value
Type Description
string

Url of the blob object to download by the user, which is created in downloadFilesAsZip.

driver

A reference to an e-commerce driver.

Declaration
public driver: IDriver
Property Value
Type Description
IDriver

A reference to an e-commerce driver.

editorState

An editor state calculated in createEditorSnapshot.

Declaration
public editorState: string = ""
Property Value
Type Description
string

An editor state calculated in createEditorSnapshot.

varManager

An object for managing variables.

Declaration
public varManager: IVariableManager = new VariableManager(this)
Property Value
Type Description
IVariableManager

An object for managing variables.

Methods

addCustomPropertyInScope(string, any, boolean)

Adds a custom property to the compilation scope.

Declaration
function addCustomPropertyInScope(name: string, property: any, inform: boolean)
Parameters
Type Name Description
string name

The property name.

any property

A value of the property.

boolean inform

appendVars(kvObject<string, any>)

Deprecated, use varManager.append() instead. Appends values to the current vars object.

Declaration
function appendVars(varsDictionary: kvObject<string, any>)
Parameters
Type Name Description
kvObject<string, any> varsDictionary

An object, which will be merged with the current vars.

closeEditorPopup(boolean)

Close editor popup and dispose editor instance.

Declaration
function closeEditorPopup(isForce: boolean)
Parameters
Type Name Description
boolean isForce

closeModal(string)

Close a modal window by its name.

Declaration
function closeModal(name: string)
Parameters
Type Name Description
string name
Returns
Type Description
Promise<void>

createEditorSnapshot(boolean)

Creates an editor snapshot, which can be used to restore the editor state.

Declaration
function createEditorSnapshot(force: boolean)
Parameters
Type Name Description
boolean force

If true, then this method also saves the product by using the Customer's Canvas IFrame API.

Returns
Type Description
Promise<string>

A compressed Base64 string, which can be passed to restoreEditor.

debug(string | string[])

Debugs widgets.

Declaration
function debug(name: string | string[])
Parameters
Type Name Description
string | string[] name

The widget name or an array of widget names for debugging.

downloadFile(string, string, boolean)

Downloads a file by URL.

Declaration
function downloadFile(url: string, filename: string, newTab: boolean)
Parameters
Type Name Description
string url

The URL of the file that should be downloaded.

string filename

The name to be assigned to the downloaded file.

boolean newTab

If true, opens the link in a new tab.

Returns
Type Description
Promise<void>

downloadFilesAsZip(Array<DownloadingModel>)

Downloads multiple files and packs them to a ZIP archive.

Declaration
function downloadFilesAsZip(files: Array<DownloadingModel>)
Parameters
Type Name Description
Array<DownloadingModel> files

An array of objects {url:string, filename:string} describing files that should be downloaded and zipped.

Returns
Type Description
Promise<string>

The URL of the archive.

getJsonProcessor()

Returns an instance of the JsonProcessor.

Declaration
function getJsonProcessor()
Returns
Type Description
JsonProcessor

getUncompiledWidgetNames()

Declaration
function getUncompiledWidgetNames()
Returns
Type Description
string[]

hideEditorPopup()

Hide editor popup

Declaration
function hideEditorPopup()

manageCustomTopBarVisibility(boolean)

Changes the visibility of a custom TopBar.

Declaration
function manageCustomTopBarVisibility(display: boolean)
Parameters
Type Name Description
boolean display

If true, displays the TopBar. By default, the custom TopBar is hidden.

manageDefaultTopBarVisibility(boolean)

Changes the visibility of the default TopBar.

Declaration
function manageDefaultTopBarVisibility(display: boolean)
Parameters
Type Name Description
boolean display

If true, displays the TopBar. By default, the default TopBar is hidden.

nextStep()

Activates the next step in the editor.

Declaration
function nextStep()

onBackToProductButtonClick()

Declaration
function onBackToProductButtonClick()

openProjects()

Open popup window with saved projects

Declaration
function openProjects()

prevStep()

Activates the previous step in the editor.

Declaration
function prevStep()

restoreEditor(string)

Restores the editor state.

Declaration
function restoreEditor(snapshot: string)
Parameters
Type Name Description
string snapshot

A compressed Base64 string representing the editor snapshot. You can obtain this string in createEditorSnapshot.

Returns
Type Description
Promise<void>

saveProject()

Open dialog for entering project name

Declaration
function saveProject()

showEditorPopup()

Show editor popup

Declaration
function showEditorPopup()

showModal(string, boolean)

Shows a modal window by its name.

Declaration
function showModal(name: string, isAutoStart: boolean)
Parameters
Type Name Description
string name

The name of the modal window.

boolean isAutoStart

If true, shows the modal window after initializing the editor.

Returns
Type Description
Promise<void>

showPreloader(boolean, string | string[], number)

Shows and hides a preloader. Under the hood, this method uses a counter to manage the preloader. If counter > 0, then it shows the preloader, otherwise, it hides the preloader. The default value of the counter is 0.

"onClick": [
  "{{#function main.showPreloader(true, 'Creating print files...')}}",
  "{{#function $['editor'].getHiResImages(800,800)}}",
  "{{#function main.showPreloader(false)}}"
]
Declaration
function showPreloader(isPreload: boolean, message: string | string[], timeout: number)
Parameters
Type Name Description
boolean isPreload

If true, increments the counter. If false, decrements the counter.

string | string[] message

A text message that appears next to the preloader icon.

number timeout

showToast(Object)

Declaration
function showToast(eventData: Object)
Parameters
Type Name Description
Object eventData

switchToStep(number, boolean)

Activates a step by its index.

Declaration
function switchToStep(index: number, force: boolean)
Parameters
Type Name Description
number index

The zero-based index of the required step.

boolean force

toggleDrawerByClickOnShade()

Declaration
function toggleDrawerByClickOnShade()

toggleShade(boolean)

Declaration
function toggleShade(value: boolean)
Parameters
Type Name Description
boolean value
Was this page helpful?
Thanks for your feedback!
Back to top Copyright © 2001–2024 Aurigma, Inc. All rights reserved.
Loading...
    Thank for your vote
    Your opinion is important to us. To provide details, send feedback.
    Send feedback