Noen deler av denne siden har ikke blitt oversatt enda, vi beklager for det inntrufnet
Dokumentasjon

/*

# Quick Start

Every plugin consists of three files:
 - main.html - plugin html template (uses [Mustache](https://mustache.github.io/) templating engine).
 - main.js - contains plugin configuration and logic while in builder (uses JavaScript ES5 version).
 - main.png - plugin icon that will be displayed in builders UI (size 24x24 pixels).

This is sample code from Vimeo video plugin:
[
```html
<iframe id="{{id}}_vimeo" src="http://player.vimeo.com/video/{{content.groupId}}?portrait={{content.portrait}}&title={{content.title}}&autoplay={{content.autoplay}}&color={{content.color}}" width="{{width}}px" height="{{height}}px" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>
```

```javascript
PluginWrapper.registerPlugin('vimeo', {
	name: 'Vimeo',
	element: {
		minSize: {width: 100, height: 100},
		defaultSize: {width: 480, height: 300},
		resizable: true
	},
	propertyDialog: {
		noScroll: true,
		tabs: [
			{children: [
				{type: 'VerticalLayout', children: [
					{type: 'Label', text: __('Vimeo ID or URL'),
						helpText: __('Vimeo video id or url with format https://vimeo.com/{video_id}')
					},
					{type: 'TextField', id: 'groupId'}
				]},
				{type: 'HorizontalLayout', css: {marginTop: 15}, children: [
					{type: 'VerticalLayout', children: [
						{type: 'Label', text: __('Portrait'), helpText: __('Show the user’s portrait on the video')},
						{type: 'RadioBox', id: 'portrait0', label: __('Yes'), group: 'portrait'},
						{type: 'RadioBox', id: 'portrait1', label: __('No'), group: 'portrait'}
					]},
					{type: 'VerticalLayout', children: [
						{type: 'Label', text: __('Title'), helpText: __('Show the title on the video.')},
						{type: 'RadioBox', id: 'title0', label: __('Yes'), group: 'title'},
						{type: 'RadioBox', id: 'title1', label: __('No'), group: 'title'}
					]},
					{type: 'VerticalLayout', children: [
						{type: 'Label', text: __('Autoplay'), helpText: __('Play the video automatically on load.')},
						{type: 'RadioBox', id: 'autoplay0', label: __('Yes'), group: 'autoplay'},
						{type: 'RadioBox', id: 'autoplay1', label: __('No'), group: 'autoplay'}
					]},
					{type: 'VerticalLayout', children: [
						{type: 'Label', text: __('Color'), helpText: __('Specify the color of the video controls.')},
						{type: 'ColorSelector', id: 'color'}
					]}
				]}
			]}
		]
	},
	resizeTimeout: null,
	resizeAction: function(data, elem) {
		if (!this.resizeTimeout) {
			var self = this;
			this.resizeTimeout = setTimeout(function () {
				self.resizeTimeout = null;
				self.updateElement();
			}, 1000);
		}
	},
	openAction: function(fields, data, elem) {
		fields.groupId.setText(data.content.groupId);
		fields.portrait0.setValue(data.content.portrait === '1');
		fields.portrait1.setValue(data.content.portrait === '0');

		fields.title0.setValue(data.content.title === '1');
		fields.title1.setValue(data.content.title === '0');

		fields.autoplay0.setValue(data.content.autoplay === '1');
		fields.autoplay1.setValue(data.content.autoplay === '0');

		fields.color.setValue(data.content.color);

		fields.groupId.on('change', function() {
			var url = fields.groupId.getText();
			var regExp = /https:\/\/(www\.)?vimeo.com\/(\d+)($|\/)/;
			var match = url.match(regExp);
			if (match) {
				fields.groupId.setText(match[2]);
			}
		});
	},
	applyAction: function(fields, data, elem) {
		if (fields.portrait0.getValue()) data.content.portrait = '1';
		if (fields.portrait1.getValue()) data.content.portrait = '0';

		if (fields.title0.getValue()) data.content.title = '1';
		if (fields.title1.getValue()) data.content.title = '0';

		if (fields.autoplay0.getValue()) data.content.autoplay = '1';
		if (fields.autoplay1.getValue()) data.content.autoplay = '0';

		data.content.color = fields.color.getValue().replace('#', '');
		data.content.groupId = fields.groupId.getText();
	},
	loadAction: function (data) {
		if (!data.content.groupId) data.content.groupId = '7976699';
		if (!data.content.portrait) data.content.portrait = '1';
		if (!data.content.title) data.content.title = '1';
		if (!data.content.autoplay) data.content.autoplay = '0';
		if (!data.content.color) data.content.color = '#00adef';
	}
});
```
]


 ## Template (main.html)

Here should be html code (with [Mustache](https://mustache.github.io/) templating engine)
that will be rendered to builder and final published site.
If you need different html for different cases (when in builder, on preview or on plublish) there
variables added to template for that:
 - isPublished - will be true when plugin is rendered on published/previewed in builder website.
 - isPreview - will be true when plugin is rendered on previewed in builder website.

Template will also be populated with properties from plugins data object (@see PluginDataObject).


## Plugin render and configuration logic (main.js)

Here should be plugin registration script, that defines plugins property dialog and all logic
how configuration is saved, loaded from to property dialog (@see PluginWrapper.registerPlugin).


# API Specification

## Plugin registration

```javascript
*/


interface PluginWrapper {

	/**
	 * Register plugin
	 * @param {string} id unique plugin identifier (use standard variable naming conventions).
	 * @param {PluginDefinition} definition plugin definition object.
	 */
	registerPlugin(id: string, definition: PluginDefinition): void;

}

/**
 * With this you define your plugin.
 */
interface PluginDefinition {
	
	/**
	 * Display name of the plugin. This is the name that will be visible in plugin toolbar in builder.
	 * (required)
	 */
	name: string;
	
	/**
	 * Rendered element options. They define how element will be rendered in builder.
	 * (required)
	 */
	element: PluginElementOptions;
	
	/**
	 * Property dialog definition object. This defines how property/configuration dialog will look.
	 * (required)
	 */
	propertyDialog: PropertyDialogDefinition;
	
	/**
	 * Custom object that (its instance) will be shared between different instances of this plugin.
	 * You can use this to make sure something (ex. external script loaded) is initialised only once.
	 * (optional)
	 */
	pluginScoped: Object;
	
	/**
	 * Callback that will be called when element is being resized.
	 * This callback will be called in realtime (a lots of times), so do not do anything heavy in it.
	 * (optional)
	 * @param data plugin data object that describes your plugin.
	 * @param elem plugins content root element (in this element your plugins template will be rendered).
	 */
	resizeAction: (data: PluginDataObject, elem: jQueryElement) => void;
	
	/**
	 * Callback that will be called before opening property dialog.
	 * It is usually used to load values prom data object to property dialogs fields.
	 * (optional)
	 * @param fields object with controls with reference ids from property dialog.
	 * @param data plugin data object that describes your plugin.
	 * @param elem plugins content root element (in this element your plugins template will be rendered).
	 */
	openAction: (fields: FieldsIndex, data: PluginDataObject, elem: jQueryElement) => void;
	
	/**
	 * Callback that will be called when apply button in property dialog is clicked.
	 * It is usually used to store values from property dialogs fields to data object.
	 * (optional)
	 * @param fields object with controls with reference ids from property dialog.
	 * @param data plugin data object that describes your plugin.
	 * @param elem plugins content root element (in this element your plugins template will be rendered).
	 */
	applyAction: (fields: FieldsIndex, data: PluginDataObject, elem: jQueryElement) => void;
	
	/**
	 * Callback that will be called when user saves website in builder.
	 * This is the last chance to modify data object before it will be serialized and saved.
	 * (optional)
	 * @param data plugin data object that describes your plugin.
	 * @param elem plugins content root element (in this element your plugins template will be rendered).
	 */
	saveAction: (data: PluginDataObject, elem: jQueryElement) => void;
	
	/**
	 * Callback that will be called when plugin elements data is loaded.
	 * This is perfect place to set default values (if they not already set or this is new element).
	 * (optional)
	 * @param data plugin data object that describes your plugin.
	 */
	loadAction: (data: PluginDataObject) => void;
	
	/**
	 * Callback that will be called when HTML DOM elements of this element are initialised.
	 * You can do some initial html element initialisation processing.
	 * (optional)
	 * @param data plugin data object that describes your plugin.
	 * @param elem plugins content root element (in this element your plugins template will be rendered).
	 */
	loadedAction: (data: PluginDataObject, elem: jQueryElement) => void;
	
}

/**
 * This is plugin data object, it contains data about your plugin element.
 */
interface PluginDataObject {
	/** Unique id of the element. (read-only) */
	id: string;
	/** Element X position in pixels. (read-only) */
	x: number;
	/** Element Y position in pixels. (read-only) */
	y: number;
	/** Element width in pixels. (read-only) */
	width: number;
	/** Element height in pixels. (read-only) */
	height: number;
	/** Element Z index. (read-only) */
	zIndex: number;
	/**
	 * Custon object that will contain all plugin element specific options.
	 * This is where you store data (as object properties) about your plugin.
	 * Data should consist only of scalar values and plain objects.
	 */
	content: Object;
}

/** jQuery element with all its jquery stuff. */
interface jQueryElement {}

/**
 * This object defines how element will be rendered in builder.
 * (All properties in this object are optional)
 */
interface PluginElementOptions {
	/**
	 * If true plugin element in builder will only be rendered once.
	 * If false it will be re-rendered on every update call.
	 * (default: false)
	 */
	renderOnce: boolean;
	/**
	 * If true content of the plugin element will be rendered in iframe.
	 * This can be used to prevent element plugins external scripts from interfering with builder.
	 * (default: false)
	 */
	isolatedRendering: boolean;
	/** Minimum plugin element size definition. Users will not be able to make element smaller than this size. */
	minSize: Size;
	/** Default plugin element size definition. This is the size element will be when added to builder. */
	defaultSize: Size;
	/** If true then users will be able to resize element in builder. (default: true) */
	resizable: boolean;
}

/**
 * This object define size.
 * (All properties in this object are optional)
 */
interface Size {
	width: number;
	height: number;
}

/**
 * This object defined dialog size.
 * (All properties in this object are optional)
 */
interface DialogSize extends Size {
	/** Min content height, content will not be smaller height, event if there is no content to fill it. */
	minBodyHeight: number;
	/** Max content height after witch scroll will appiear. */
	maxBodyHeight: number;
}

/**
 * Property dialog definition object.
 * (All properties in this object are optional)
 */
interface PropertyDialogDefinition {
	/** Dialog window size. */
	size: DialogSize;
	/** If true controls overlaping dialogs borsers will not generate scrolls. (default: true) */
	noScroll: boolean;
	/**
	 * Property dialogs tabs definitions.
	 * This defines tabs that property dialog will contain.
	 * Property dialog will always have standard options tab.
	 */
	tabs: DialogTabDefinition[];
	/** Dialogs button list. Buttons that will be added to dialogs footer. (default: will have two default buttons "Cancel" and "Apply") */
	buttons: DialogButtonDefinition[];
	/**
	 * Callback that will be called when dialog is initialised.
	 * @param {FieldsIndex} fields object that contains controls referenced in this dialog.
	 */
	init: (fields: FieldsIndex) => void;
	/**
	 * Callback that will be called when dialog is openend.
	 * @param {FieldsIndex} fields object that contains controls referenced in this dialog.
	 */
	open: (fields: FieldsIndex) => void;
	/**
	 * Callback that will be called when dialog is closed.
	 * @param {FieldsIndex} fields object that contains controls referenced in this dialog.
	 */
	close: (fields: FieldsIndex) => void;
}

/** This defines property dialogs tab. */
interface DialogTabDefinition {
	/** Tab ordering priority. Lowest priority makes left most tab. (optional) */
	priority: number;
	/** Tab display name. (default: General) (optional) */
	name: string;
	/** If true will not be rendered or initialised. (optional) */
	ignore: boolean;
	/** (optional) */
	general: boolean;
	/** (optional) */
	options: boolean;
	/** Control list for this tab. (required) */
	children: ControlDefinition[];
}

/** This defines property dialogs buttons added to dialogs footer. */
interface DialogButtonDefinition {
	/** Display name for the button. (required) */
	name: string;
	/** Callback called when button is clicked. (default: will close dialog) (optional) */
	click: () => void;
	/** If true will make button different color. */
	primary: boolean;
}

/**
 * This defines control used in property dialog.
 * All other control definitions extend this control.
 * All control definitions are writen as plain JavaScript objects
 * (ex. {type: 'Label', text: 'Name', helpText: 'Name of something.'}).
 */
interface ControlDefinition {
	/** Control type, tells what kind of control this is. (required) */
	type: string;
	/** Reference id of the control, it will be used to reference this control in the code throuth FieldsIndex objects. (optional) */
	id: string;
	/** If true this control definition will be ignored and control will not be initiated. (optional) */
	ignore: boolean;
	/** Set initial visibility of control. (default: true) (optional) */
	visible: boolean;
	/** If true control will be enabled if false control will be disabled (inactive). (default: true) (optional) */
	enabled: boolean;
	/** Style class to add on root element of the control. (optional) */
	styleClass: string;
	/** Object defining css styles for controls root element. (optional) */
	css: Object;
	/** Object defining html attributes for controls root element. (optional) */
	attr: Object;
	/**
	 * Callback that will be called when control is initialised. (optional)
	 * @param {ControlDefinition} def definition object of this control.
	 * @param {FieldsIndex} fields object that contains controls referenced up to this point in this dialog.
	 */
	init: (def: ControlDefinition, fields: FieldsIndex) => void;
	/**
	 * Callback that will be called when control is clicked. (optional)
	 * @param {Event} e click event object.
	 * @param {FieldsIndex} fields object that contains controls referenced in this dialog.
	 */
	click: (e: Event, fields: FieldsIndex) => void;
}

/**
 * Object that contains controls referenced in this plugins property dialog.
 * Every property of this object is named by controls reference id.
 * All controls in this index object implements PropertyDialogControl interface.
 * @see PropertyDialogControl
 */
interface FieldsIndex {}

/**
 * This is control instance from FieldsIndex.
 */
interface PropertyDialogControl {
	/**
	 * Get control value.
	 */
	getValue(): any;
	/**
	 * Set control value.
	 */
	setValue(value: any): void;
}

/*
```

## Controls

```javascript
*/

/** This is custom container for creating custom controls. */
interface CustomContainerDefinition extends ControlDefinition {
	// type: string = 'CustomContainer';
	/** HTML tag to use for root element of this control. (default: div) (optional) */
	tag: string;
	/** HTML content of the control element. (optional) */
	content: string;
}

/** This is HTML form control. */
interface FormDefinition extends ControlDefinition {
	// type: string = 'Form';
	/** HTML Form action attribute. (optional) */
	action: string;
	/** HTML Form method attribute. (optional) */
	method: string;
	/** HTML Form enctype attribute. (optional) */
	enctype: string;
	/** Callback called on form submit. (optional) */
	submit: (fields: FieldsIndex) => void;
	/** Child control list for this control. (optional) */
	children: ControlDefinition[];
}

/**
 * This control is for arranging other controls in a responsive way.
 * This will arrange controls vertically.
 */
interface VerticalLayoutDefinition extends ControlDefinition {
	// type: string = 'VerticalLayout';
	/** Set CSS class to use for every row of this layout. (optional) */
	rowStyleClass: string;
	/** Spacing in pixels between controls in the layout. (default: 0) (optional) */
	spacing: number;
	/** Child control list for this control. (required) */
	children: ControlDefinition[];
}

/**
 * This control is for arranging other controls in a responsive way.
 * This will arrange controls hirizontaly (space for controls will be distributed evenly).
 */
interface HorizontalLayoutDefinition extends ControlDefinition {
	// type: string = 'HorizontalLayout';
	/**
	 * Weights for distributing space for controls in this layout.
	 * This is an array of integer numbers, sum of which must not exceed 12.
	 * Number of array items must match number of child controls.
	 * Higher number means more space is asigned for this control.
	 * (default: space is distributed evenly)
	 * (optional)
	 */
	columnWeights: number[];
	/**
	 * Weights for distributing space for controls on smaller screens in this layout.
	 * This is an array of integer numbers, sum of which must not exceed 12.
	 * Number of array items must match number of child controls.
	 * Higher number means more space is asigned for this control.
	 * (default: space is distributed evenly)
	 * (optional)
	 */
	columnWeightsSmall: number[];
	/** Child control list for this control. (required) */
	children: ControlDefinition[];
}

/**
 * This control is for arranging other controls in a responsive way.
 * This will arrange controls hirizontaly (aligned to left or right).
 */
interface FlowLayoutDefinition extends ControlDefinition {
	// type: string = 'FlowLayout';
	/** Spacing in pixels between controls in the layout. (default: 10) (optional) */
	spacing: number;
	/** Horizontal alignment of controls ('left' or 'right'). (default: left) (optional) */
	align: string;
	/**
	 * Vertical alignment of controls (if they are in different height) ('top', 'middle' or 'bottom').
	 * (default: top)
	 * (optional)
	 */
	verticalAlign: string;
	/** Child control list for this control. (required) */
	children: ControlDefinition[];
}

/**
 * This creates tooltip icon, that will show tooltip text on mouse over.
 */
interface TooltipDefinition extends ControlDefinition {
	// type: string = 'Tooltip';
	/** Tooltip icon text. (default: '?') (optional) */
	label: string;
	/** Text that will be shown when mouse over on tooltip icon. (required) */
	text: string;
	/** Tooltip placement around tooltip icon ('top', 'right', 'bottom' or 'left'). (default: right) (optional) */
	placement: string;
}

/** This creates HTML image control. */
interface ImageDefinition extends ControlDefinition {
	// type: string = 'Image';
	/** HTML image src attribute. (required) */
	src: string;
}

/** This creates button control. */
interface ButtonDefinition extends ControlDefinition {
	// type: string = 'Button';
	/** Buttons display text. (required) */
	text: string;
	/** Buttons icon (css style class, use bootstraps 'glyphicon glyphicon-*' classes). (optional) */
	icon: string;
	/** Buttons visual style. ('success', 'info', 'danger', 'warning', 'primary', 'default' or 'link)
	 * (default: default)
	 * (optional)
	 */
	buttonStyle: string;
	/** Button type ('button' or 'submit'). (default: button) (optional) */
	buttonType: string;
}

/** This creates label control. */
interface LabelDefinition extends ControlDefinition {
	// type: string = 'Label';
	/** Labels display text. (required, optional if html is set) */
	text: string;
	/** Labels display text as HTML. (optional, required if text is not set) */
	html: string;
	/** Adds tooltip icon, that will show this tooltip text. (optional) */
	helpText: string;
	/**
	 * Tooltip placement direction when tooltip is shown ('top', 'right', 'bottom' or  'left').
	 * (default: right)
	 * (optional)
	 */
	helpPlacement: string;
}

/** This creates text field control. */
interface TextFieldDefinition extends ControlDefinition {
	// type: string = 'TextField';
	/** Placeholder text for this text field. (optional) */
	placeholder: string;
	/** Enable multiline text input. (default: false) (optional) */
	textArea: boolean;
	/** If true and multiline text input enabled this control will be resizable by user. (default: false) (optional) */
	resizable: boolean;
	/** Initial value of this control. (optional) */
	value: string;
	/** If true and not in multiline input mode, it will make this control into password input field. (default: false) (optional) */
	password: boolean;
	/** HTML title attribute of this control. (optional) */
	title: string;
	/** Callback that is called when content of this field is changed. (optional) */
	change: (fields: FieldsIndex) => void;
}

/** This creates text field control with multilingual input. */
interface MultilangTextFieldDefinition extends ControlDefinition {
	// type: string = 'MultilangTextField';
	/** Enable multiline text input. (default: false) (optional) */
	textArea: boolean;
	/** If true and multiline text input enabled this control will be resizable by user. (default: false) (optional) */
	resizable: boolean;
	/** Initial value of this control. (optional) */
	value: string|Object;
}

/** This creates HTML file input element control. */
interface FileFieldDefinition extends ControlDefinition {
	// type: string = 'FileField';
	/** HTML name attribute. (optional) */
	name: string;
}

/** This will create radio-button control. */
interface RadioBoxDefinition extends ControlDefinition {
	// type: string = 'RadioBox';
	/** Radio button label. (optional) */
	label: string;
	/** Group name for grouping multiple radio button controls. (required) */
	group: string;
	/** (optional) */
	inline: boolean;
	/** HTML value attribute for this control. (optional) */
	inputValue: string;
	/** If true radio button will be selected else unselected. (default: false) (optional) */
	value: boolean;
	/** HTML title attribute of this control. (optional) */
	title: string;
	/** Adds tooltip icon, that will show this tooltip text. (optional) */
	helpText: string;
	/** Callback that is called when radio button is selected/unselected. (optional) */
	change: (fields: FieldsIndex) => void;
}

/** This will create check-box control. */
interface CheckBoxDefinition extends ControlDefinition {
	// type: string = 'CheckBox';
	/** Check box label. (optional) */
	label: string;
	/** (optional) */
	inline: boolean;
	/** If true check box will be checked else unchecked. (default: false) (optional) */
	value: boolean;
	/** Adds tooltip icon, that will show this tooltip text. (optional) */
	helpText: string;
	/** Callback that is called when check box is checked/unchecked. (optional) */
	change: (fields: FieldsIndex) => void;
}

/** This will create dropdown control. */
interface DropdownBoxDefinition extends ControlDefinition {
	// type: string = 'DropdownBox';
	/** List of options for dropdown box. (required) */
	options: DropdownBoxOptionDefinition[];
	/** Option id to select in dropdown box. (optional) */
	value: string;
	/** Callback that will be called when option is selected. (optional) */
	change: (fields: FieldsIndex) => void;
}

/** This will create option for dropdown box. */
interface DropdownBoxOptionDefinition {
	// type: string = 'DropdownBoxOption';
	/** Option unique identifier (needs to unique in this dropdown). (required) */
	id: string;
	/** Display name of this option. (required, optional if html property is set) */
	name: string;
	/** Display name as HTML of this option. (optional, required if name property is not set) */
	html: string;
}

/**
 * This will create menu item selector.
 * It will allow selecting menu item of any currently available menu element.
 */
interface MenuItemSelectorDefinition extends ControlDefinition {
	// type: string = 'MenuItemSelector';
	/** Menu item id to select. (optional) */
	value: number;
}

/** This will create link edit control. */
interface LinkEditSelectorDefinition extends ControlDefinition {
	// type: string = 'LinkEditSelector';
	/** Initial value for this control. (optional) */
	value: string;
	/** Message when no value is set. (required) */
	emptyMsg: string;
}

/** This will create color picker. */
interface ColorSelectorDefinition extends ControlDefinition {
	// type: string = 'ColorSelector';
	/** If true will not allow to select transparent color. (default: false) (optional) */
	noTransparent: boolean;
	/** if true will render color picker control as big thumbnail. (default: false) (optional) */
	big: boolean;
	/** If true control width will ajust to parent width else will be fixed width. (default: false) (optional) */
	noFidexWidth: boolean;
	/** Initial color in a hex form (ex. #000000). (optional) */
	value: string;
	/** Callback that will be called when color is changed. (optional) */
	change: (fields: FieldsIndex) => void;
}

/** This will create number only input field with increase/decrease buttons. */
interface SizeSelectorDefinition extends ControlDefinition {
	// type: string = 'SizeSelector';
	/** Minimum allowed value. (default: 1) (optional) */
	min: number;
	/** Maximum allowed value. (default: 9999) (optional) */
	max: number;
	/** Value by what controls value will change when increase/decrease buttons are pressed. (default: 1) (optional) */
	step: number;
	/** If true then when value is at max and increase button is pressed value will change to min instead of stopping. (default: false) (optional) */
	repeat: boolean;
	/** If true control width will ajust to parent width else will be fixed width. (default: false) (optional) */
	noFixedWidth: boolean;
	/** Initial control value. (optional) */
	value: number;
	/** Units name to be rendered on the right of the field (ex. 'px' for pixels). (optional) */
	units: string;
	/** Callback that will be called when value changed. (optional) */
	change: (fields: FieldsIndex) => void;
}

/**
 * This will create media picker.
 * It will allow to select one or more files from gallery.
 */
interface ImageSelectorDefinition extends ControlDefinition {
	// type: string = 'ImageSelector';
	/** Control mode ('all', 'image', 'sound' or 'flash') defines what kind of files can be selected. (required) */
	mode: string;
	/** Size (in pixels) of the controls freview thumbnail. (default: 60) (optional) */
	thumbSize: number;
	/** If true will allow to select multiple files. (default: false) (optional) */
	multiselect: boolean;
	/** If true will enable additional options to select external images. (default: true) (optional) */
	mediatabs: boolean;
	/** Initially selected files. (optional) */
	value: string[];
	/** Callback that will be called when selected files changes. (optional) */
	select: (fields: FieldsIndex) => void;
}

/**
 * This will create link selector control.
 * It will allow user to enter URL manually, choose one of the pages from site or choose file from gallery.
 */
interface LinkSelectorDefinition extends ControlDefinition {
	// type: string = 'LinkSelector';
	/** Enable multilingual mode. (default: false) (optional) */
	multilang: boolean;
	/** Initial value. (optional) */
	value: Object;
}

/** This will create control to select one of text styles from builder styles dialog. */
interface StyleSelectorDefinition extends ControlDefinition {
	// type: string = 'StyleSelector';
	/** If true will add option to choose none. (default: false) (optional) */
	emptyChoice: boolean;
	/** Initially selected style id. (optional) */
	value: string;
}

/** This will create font selector. */
interface FontSelectorDefinition extends ControlDefinition {
	// type: string = 'FontSelector';
	/** If true allows to select line height. (default: false) (optional) */
	needLineHeight: boolean;
	/** Informational tooltip placement in control. (default: left) (optional) */
	ttPlacement: string;
	/** If true will add font preview box. (default: false) (optional) */
	needPreview: boolean;
	/** If false will allow to select font style. (default: false) (optional) */
	noStyle: boolean;
	/** If false will allow to select font alignment. (default: false) (optional) */
	noAlign: boolean;
	/** If true control layout will be more horizontal. (default: false) (optional) */
	horizontal: boolean;
	/** Initial value. (optional) */
	value: Object;
}

/** This will create font family selector control. */
interface FontFamilySelectorDefinition extends ControlDefinition {
	// type: string = 'FontFamilySelector';
	/** If true control width will ajust to parent width else will be fixed width. (default: false) (optional) */
	noFixedWidth: boolean;
	/** Initial value. (optional) */
	value: string;
	/** Callback that will be called when selection changes. (optional) */
	change: (fields: FieldsIndex) => void;
}

/** This will create font style selector control. */
interface FontStyleSelectorDefinition extends ControlDefinition {
	// type: string = 'FontStyleSelector';
	/** Initial value. (optional) */
	value: Object;
	/** Callback that will be called when selection changes. (optional) */
	change: (fields: FieldsIndex) => void;
}

/** This will create font transform selector control. */
interface FontTransformSelectorDefinition extends ControlDefinition {
	// type: string = 'FontTransformSelector';
	/** Initial value. (optional) */
	value: string|Object;
}

/** This will create spacing selector control. */
interface SpacingSelectorDefinition extends ControlDefinition {
	// type: string = 'SpacingSelector';
	/** Initial value. (optional) */
	value: Object;
}

/** This will create horizontal alignment selector control. */
interface HAlignSelectorDefinition extends ControlDefinition {
	// type: string = 'HAlignSelector';
	/** Initial value. (optional) */
	value: string;
	/** Callback that will be called when selection changes. (optional) */
	change: (fields: FieldsIndex) => void;
}

/** This will create border selector control. */
interface BorderSelectorDefinition extends ControlDefinition {
	// type: string = 'BorderSelector';
	/** Placement of border editor popup ('top', 'right', 'bottom' or 'left'). (default: bottom) (optional) */
	placement: string;
	/** If true will allow to select border radius. (default: false) (optional) */
	showRadius: boolean;
	/** If false will allow to select transparent border color. (default: true) (optional) */
	noTransparent: boolean;
	/** Initial value. (optional) */
	value: Object;
}

/** This will create horizontal and vertical alignment selector control. */
interface AlignSelectorDefinition extends ControlDefinition {
	// type: string = 'AlignSelector';
	/** Initial value. (optional) */
	value: string;
	/** Callback that will be called when selection changes. (optional) */
	change: (fields: FieldsIndex) => void;
}

/** This will create background (image, image-position, image-repeat, color) selector control. */
interface BackgroundSelectorDefinition extends ControlDefinition {
	// type: string = 'BackgroundSelector';
	/** Initial value. (optional) */
	value: Object;
	/** Callback that will be called when selection changes. (optional) */
	change: (fields: FieldsIndex) => void;
}

/** This will create corner roundness selector control. */
interface RoundCornersSelectorDefinition extends ControlDefinition {
	// type: string = 'RoundCornersSelector';
	/** Initial value. (optional) */
	value: Object;
}

/** This will create layout blocks selector control. */
interface LayoutBlocksControlDefinition extends ControlDefinition {
	// type: string = 'LayoutBlocksControl';
	/** Initial value. (optional) */
	value: string;
	/** Callback that will be called when selection changes. (optional) */
	change: (fields: FieldsIndex) => void;
}

/** This will create editable list-box control. */
interface ListDefinition extends ControlDefinition {
	// type: string = 'List';
	/** Item class. (required) */
	itemType: typeof Object,
	/** If true will be editable. (default: false) (optional) */
	editable: boolean;
	/** List box height in pixels. (optional) */
	listHeight: number;
	/** Callback that will be called when list item is selected. (optional) */
	select: (fields: FieldsIndex, item: Object) => void;
	/** Callback that will be called when add item link is clicked. (optional) */
	add: (fields: FieldsIndex, item: Object) => void;
}

/** This will create HTML form element control. */
interface IFrameDefinition extends ControlDefinition {
	// type: string = 'IFrame';
	/** HTML src attribute (iframe URL). (default: 'about:blank') (optional) */
	url: string;
	/** Query params that will be added to url. (optional) */
	params: Object;
}

/** This will create informational box control. */
interface AlertBoxDefinition extends ControlDefinition {
	// type: string = 'AlertBox';
	/** Information message to be displayed. (required) */
	text: string;
	/** Alert box style ('success', 'info', 'danger', 'warning', 'primary' or 'default'). (default: default) (optional) */
	style: string;
}

/** This will create preloader overlay control. */
interface PreloaderOverlayDefinition extends ControlDefinition {
	// type: string = 'PreloaderOverlay';
	/** Initial value. (optional) */
	value: number;
}

/** This will create contact form configurator control. */
interface ContactFormDefinition extends ControlDefinition {
	// type: string = 'ContactForm';
}

/** This will create tabbed pane control. */
interface TabbedPaneDefinition extends ControlDefinition {
	// type: string = 'TabbedPane';
	/** Tabbed pane height in pixels. (optional) */
	fixedHeight: number;
	/** If true scroll will be hidden. (default: false) (optional) */
	noScroll: boolean;
	/** Dialog tabs. (required) */
	tabs: DialogTabDefinition[];
	/** Callback that will be called when tab is selected. (optional) */
	change: (fields: FieldsIndex, tab: Object, prevTab: Object) => void;
}

/*
```

*/