Global

Type Definitions


Design

Allowed components with metadata allowing to easily sort when in array

Rank is based on the number and position of segments that were used to find the design:

1. all available segments used => 2x max available number of segments
2. some (>=0) are used + the last one => number of segments used + max available number of segments + tiebreaker
3. any other case => number of segments used + tiebreaker

For calculating the tiebreaker, the used segments are represented by a binary mask, putting the most specific
(having bigger index), on the most significant places. Then, the mask is normalized to be in the (0, 1) range.

Example: available segments => [0,1,2,3,4,5,6], segments used => [0,4,5]
the main rank is 3 (#4 => number of segments used)
tie breaker [0,4,5] => (0b)0110001 => 49;
max number of segments => 7 so (2^7) 128 used to normalize
49 / 128 => 0.3828125 will be the tie breaker
so the final rank => 3.3828125

Type:
  • Object
Properties:
Name Type Description
nodeContent string | Array.<string>

content of the node from the designs

segments Array.<number>

indexes of segments used to find the design

rank number

ranking as described above

Source:
util/designResolver.js

EditorConfig

Represents an Editor Configuration object

Type:
  • Object
Properties:
Name Type Argument Default Description
name string

Name of the Editor

layerManager Granite.author.LayerManager <optional>
Granite.author.LayerManager

The constructor of the Layer Manager for the Editor

layers Array.<Granite.author.Layer> <optional>
[Granite.author.edit.Layer, Granite.author.PreviewLayer]

The list the different Layer constructors

loaders Array.<function()> <optional>
[Granite.author.loadPageInfo, Granite.author.loadPageDesign, Granite.author.loadComponents, Granite.author.loadEditablesAsync]

The list of the different "loaders"

dropControllers Array.<object> <optional>
[Granite.author.ui.ComponentDragAndDrop, Granite.author.ui.assetFinder.AssetDragAndDrop, Granite.author.ui.EditableDragAndDrop]

The list of drop controllers

tourUrl string <optional>
"/libs/wcm/core/content/editor/tour/content.html"

Relative url from where to load the content of the tour

toolbarActionOrder Array.<string>

A list defining the order of the actions in the Component Toolbar

assetTypeOrder Array.<string>

A list defining the order of the asset types in the Asset Finder

Source:
editor.js

InteractionConfig

Type:
  • object
Properties:
Name Type Description
onOverlayHover function

The handler that gets executed when an overlay is hovered

onOverlayClick function

The handler that gets executed when an overlay is clicked

onOverlayFastDblClick function

The handler that gets executed when an overlay is fastly double clicked

onOverlaySlowDblClick function

The handler that gets executed when an overlay is slowly double clicked

onOutsideOverlayClick function

The handler that gets executed when a click outside of any overlay occurs

ignoreGroupSelection boolean

Should the group selection be ignored

Source:
selection.js

LayerConfig

Represents a Layer Configuration object

Type:
  • Object
Properties:
Name Type Argument Description
name string

The name identifier of the Layer.

title string

The displayed title of the Layer.

icon string <optional>

The value of the icon that represents the Layer in the Layer selector.

overlayConstructor Granite.author.ui.Overlay <optional>

The constructor for the Overlays representing Editables.

toolbarConstructor Granite.author.ui.Toolbar <optional>

The constructor for the Toolbar for Editables.

editableConstructor Granite.author.Editable <optional>

The constructor for the Editables.

editableActions Object <optional>

The configuration object for the low-level Granite.author.ui.EditableActions on Editables.

toolbarActions Object <optional>

The configuration object for the high-level Granite.author.ui.ToolbarActions on Editables.

sidePanel Object <optional>

The SidePanel configuration object.

Properties
Name Type Argument Description
setUp function <optional>

The function that sets up the SidePanel.

tearDown function <optional>

The function that tears down the SidePanel .

findEditables function <optional>

The function used to provide a list of Editables. If not provided, the ContentFrame will use the default function.

interactions InteractionConfig <optional>

The configuration object describing interactions with Overlays.

iconClass string <optional>

The class of the icon that represents the Layer in the Layer selector. (Deprecated since 6.3)

Source:
layers/Layer.js

LayerManagerConfig

Represent a LayerManager Configuration object

Type:
  • object
Properties:
Name Type Argument Description
layerOrder Array.<string> <optional>

Order in which the layers should be displayed

getDefaultLayer function <optional>

Should return the name of the Layer to activate. Will be called when Granite.author.LayerManager is initializing.

Source:
layers/LayerManager.js