Show: Inherited Protected Private Deprecated

# Core Class

Defined in: `src/ui/react/src/adapter/alloy-editor.js:4`

AlloyEditor main class. Creates instance of the editor and provides the user configuration to the UI.

## Constructor

### `Core`

()

Defined in `src/ui/react/src/adapter/alloy-editor.js:4`

## Index

### Methods

- _addReadOnlyLinkClickListener
- _clearSelections
- _defaultReadOnlyClickFn
- _getNativeEditor
- _redirectLink
- _renderUI
- _toElement
- _validateAllowedContent
- _validateToolbars
- destructor
- initializer

### Properties

- allowedContent
- enableContentEditable
- eventsDelay
- extraPlugins
- nativeEditor
- placeholderClass
- removePlugins
- selectionKeystrokes
- srcNode
- toolbars
- uiNode

## Methods

### `_addReadOnlyLinkClickListener`

(

- `editor`

)
protected

Defined in `src/ui/react/src/adapter/alloy-editor.js:120`

Method to set default link behavior

#### Parameters:

- `editor` Object

### `_clearSelections`

() protected

Defined in `src/ui/react/src/adapter/alloy-editor.js:103`

Clear selections from window object

### `_defaultReadOnlyClickFn`

(

- `event`

)
protected

Defined in `src/ui/react/src/adapter/alloy-editor.js:133`

Called on `click` event when the editor is in read only mode. Navigates to link's URL or opens the link in a new window.

#### Parameters:

- `event` Object

  The fired `click` event payload

### `_getNativeEditor`

() Object protected

Defined in `src/ui/react/src/adapter/alloy-editor.js:165`

Retrieves the native CKEditor instance. Having this, the developer may use the API of CKEditor OOTB.

#### Returns:

Object:

The current instance of CKEditor.

### `_redirectLink`

(

- `href`
- `target`

)
protected

Defined in `src/ui/react/src/adapter/alloy-editor.js:176`

Redirects the browser to a given link

#### Parameters:

- `href` String

  The href to take the browser to

- `target` String=

  Specifies where to display the link

### `_renderUI`

() protected

Defined in `src/ui/react/src/adapter/alloy-editor.js:193`

Renders the specified from the user toolbars.

### `_toElement`

(

- `value`

)
HTMLElement protected

Defined in `src/ui/react/src/adapter/alloy-editor.js:220`

The function returns an HTML element from the passed value. If the passed value is a string, it should be the Id of the element which have to be retrieved from the DOM. If an HTML Element is passed, the element itself will be returned.

#### Parameters:

- `value` !(String | HTMLElement)

  String, which have to correspond to an HTML element from the DOM, or the HTML element itself. If Id is passed, the HTML element will be retrieved from the DOM.

#### Returns:

HTMLElement:

An HTML element.

### `_validateAllowedContent`

(

- `The`

)
Boolean protected

Defined in `src/ui/react/src/adapter/alloy-editor.js:239`

Validates the allowed content attribute. Look here for more information about the supported values.

#### Parameters:

- `The` Any

  value to be checked

#### Returns:

Boolean:

True if the current value is valid configuration, false otherwise

### `_validateToolbars`

(

- `The`

)
Boolean protected

Defined in `src/ui/react/src/adapter/alloy-editor.js:253`

Validates the value of toolbars attribute

#### Parameters:

- `The` Any

  value to be checked

#### Returns:

Boolean:

True if the current value is valid toolbars configuration, false otherwise

### `destructor`

() protected

Defined in `src/ui/react/src/adapter/alloy-editor.js:68`

Destructor lifecycle implementation for the AlloyEdtor class. Destroys the CKEditor instance and destroys all created toolbars.

### `initializer`

(

- `config`

)
protected

Defined in `src/ui/react/src/adapter/alloy-editor.js:16`

Initializer lifecycle implementation for the AlloyEditor class. Creates a CKEditor instance, passing it the provided configuration attributes.

#### Parameters:

- `config` Object

  Configuration object literal for the editor.

## Properties

### `allowedContent`

Boolean, String, Object

Defined in `src/ui/react/src/adapter/alloy-editor.js:266`

Configures the allowed content for the current instance of AlloyEditor. Look on the official CKEditor API for more information about the valid values.

Default: true

### `enableContentEditable`

Boolean

Defined in `src/ui/react/src/adapter/alloy-editor.js:282`

Specifies whether AlloyEditor set the contenteditable attribute to "true" on its srcNode.

Default: true

### `eventsDelay`

Number

Defined in `src/ui/react/src/adapter/alloy-editor.js:297`

The delay (timeout), in ms, after which events such like key or mouse events will be processed.

### `extraPlugins`

String

Defined in `src/ui/react/src/adapter/alloy-editor.js:308`

Specifies the extra plugins which have to be loaded to the current CKEditor instance in order to make AlloyEditor to work properly.

Default: 'uicore,selectionregion,dragresize,addimages,placeholder,tabletools,tableresize,autolink'

### `nativeEditor`

Object

Defined in `src/ui/react/src/adapter/alloy-editor.js:323`

Retrieves the native CKEditor instance. Having this, the developer may use the full API of CKEditor.

### `placeholderClass`

String

Defined in `src/ui/react/src/adapter/alloy-editor.js:335`

Specifies the class, which should be added by Placeholder plugin {{#crossLink "CKEDITOR.plugins.ae_placeholder}}{{/crossLink}} when editor is not focused.

Default: 'ae-placeholder'

### `removePlugins`

String

Defined in `src/ui/react/src/adapter/alloy-editor.js:351`

Specifies the plugins, which come by default with CKEditor, but which are not needed by AlloyEditor. These plugins add the default UI for CKeditor, which is no more needed. Please note that AlloyEdtor comes with its own highly optimized copy of CKEditor (just customized via their official download page). This version does not come with the unneeded plugins, so the value of this property won't be needed. However, if you decide to go with the OOTB version of CKEditor, you will have to remove some of the plugins if you decide to use AlloyEditor. Keep in mind that removing these plugins doesn't remove them entirely from CKEditor. It just removes them from its current instance, in which you will use different UI - those of AlloyEditor. You will be fully able to use both OOTB CKEditor and AlloyEditor on the same page!

Default: 'contextmenu,toolbar,elementspath,resize,liststyle,link'

### `selectionKeystrokes`

Array

Defined in `src/ui/react/src/adapter/alloy-editor.js:373`

Array of manual selection triggers. They can be configured to manually show a specific selection toolbar by forcing the selection type. A selectionKeystroke item consists of a keys property with a CKEditor keystroke definition and a selection property with the selection name to trigger.

### `srcNode`

String | Node

Defined in `src/ui/react/src/adapter/alloy-editor.js:393`

The Node ID or HTMl node, which AlloyEditor should use as an editable area.

### `toolbars`

Object

Defined in `src/ui/react/src/adapter/alloy-editor.js:405`

The toolbars configuration for this editor instance

### `uiNode`

String | Node

Defined in `src/ui/react/src/adapter/alloy-editor.js:424`

The Node ID or HTMl node, where AlloyEditor's UI should be rendered.