Constructor function that acceptsconfig
object. Theconfig
object must contain at least the el
property that points to a container DOM element where the Designer will be rendered. el
can either be a CSS selector or a reference to a DOM element. Note that the recommended width of your container is at least 1200px for best Designer UI/UX. config.options.menu
can optionally define the flow menu inside Designer. For example: { options: { menu: [ { label: 'Rename', event: 'flow:rename' }, { label: 'Insights', event: 'flow:insights' }, { label: 'Clone', event: 'flow:clone' }, { label: 'Export to SVG', event: 'flow:export-svg' }, { label: 'Export to PNG', event: 'flow:export-png' }, { label: 'Print', event: 'flow:print' } ] }
defines a menu with 6 items. Note that each item can also optionally contain icon
property (which we omitted from the example above to save space. The icon
property is a URL of an image. It's important to note that the designer supports built-in events: "flow:rename"
, "flow:export-svg"
, "flow:export-png"
and "flow:print"
. These events cannot be re-defined. These events trigger built-in UX for renaming, exporting to SVG and PNG, and printing flows. If you don't want to use this built-in behaviour, just redefine your menu with your own custom events. config.sharePermissions
can optionally define the sharing options for the flow. For example:
sharePermissions: [
{ label: 'Read', value: 'read' },
{ label: 'Start', value: 'start' },
{ label: 'Stop', value: 'stop' }
]
Define a share dialog box that gives the user permission to share the flow for all the read/start/stop permissions. Additionally, you can also define the scope of the share with config.shareTypes
:
shareTypes: [
{ label: 'Email', value: 'email', placeholder: 'Enter an email' },
{ label: 'Scope', value: 'scope', placeholder: 'Enter a scope' },
{ label: 'Domain', value: 'domain', placeholder: 'Enter a domain' },
]
config.options.toolbar
can define buttons of the Designer toolbar which is empty by default. Use presets (all shown in the example below) or Vue Component options for custom buttons. The custom button definition is the same as for Custom Inspector Fields. Complete toolbar definition example:
toolbar: [
['undo', 'redo'],
['zoom-to-fit', 'zoom-in', 'zoom-out'],
['logs'],
[{
tooltip: 'Lorem ipsum',
widget: { template: 'My button' },
}],
]