[ Index ]

PHP Cross Reference of WordPress

title

Body

[close]

/wp-includes/js/dist/ -> rich-text.js (summary)

(no description)

File Size: 5350 lines (177 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 177 functions

  __webpack_require__()
  getDefault()
  getModuleExports()
  classNames()
  _iterableToArrayLimit()
  _slicedToArray()
  _objectWithoutProperties()
  _arrayWithoutHoles()
  _nonIterableSpread()
  _toConsumableArray()
  _arrayLikeToArray()
  _unsupportedIterableToArray()
  _iterableToArray()
  _arrayWithHoles()
  _nonIterableRest()
  _typeof()
  _objectWithoutPropertiesLoose()
  arrayOf()
  isObjectLike()
  createCache()
  isShallowEqual()
  getRootCache()
  getWeakMapCache()
  clear()
  callSelector()
  ownKeys()
  _objectSpread()
  reducer_formatTypes()
  getFormatType()
  getFormatTypeForBareElement()
  getFormatTypeForClassName()
  addFormatTypes()
  removeFormatTypes()
  isFormatEqual()
  normalise_formats_ownKeys()
  normalise_formats_objectSpread()
  normaliseFormats()
  apply_format_ownKeys()
  apply_format_objectSpread()
  replace()
  applyFormat()
  createElement()
  create_ownKeys()
  create_objectSpread()
  createEmptyValue()
  simpleFindKey()
  toFormat()
  create()
  accumulateSelection()
  filterRange()
  collapseWhiteSpace()
  removePadding()
  createFromElement()
  mergeFormats()
  createFromMultilineElement()
  getAttributes()
  mergePair()
  concat()
  getActiveFormats()
  getActiveFormat()
  getActiveObject()
  getTextContent()
  getLineIndex()
  isListRootSelected()
  isActiveListType()
  isCollapsed()
  isEmpty()
  isEmptyLine()
  join()
  register_format_type_ownKeys()
  register_format_type_objectSpread()
  registerFormatType()
  remove_format_ownKeys()
  remove_format_objectSpread()
  removeFormat()
  filterFormats()
  insert()
  remove_remove()
  replace_replace()
  insertLineSeparator()
  remove_line_separator_ownKeys()
  remove_line_separator_objectSpread()
  removeLineSeparator()
  insertObject()
  slice_ownKeys()
  slice_objectSpread()
  slice()
  split()
  splitAtSelection()
  get_format_type_getFormatType()
  to_tree_ownKeys()
  to_tree_objectSpread()
  fromFormat()
  isEqualUntil()
  toTree()
  to_dom_ownKeys()
  to_dom_objectSpread()
  createPathToNode()
  getNodeByPath()
  to_dom_append()
  to_dom_appendText()
  to_dom_getLastChild()
  to_dom_getParent()
  to_dom_isText()
  to_dom_getText()
  to_dom_remove()
  toDom()
  apply()
  applyValue()
  isRangeEqual()
  applySelection()
  toHTMLString()
  to_html_string_createEmpty()
  to_html_string_getLastChild()
  to_html_string_append()
  to_html_string_appendText()
  to_html_string_getParent()
  to_html_string_isText()
  to_html_string_getText()
  to_html_string_remove()
  createElementHTML()
  createChildrenHTML()
  toggleFormat()
  unregisterFormatType()
  canIndentListItems()
  canOutdentListItems()
  indent_list_items_ownKeys()
  indent_list_items_objectSpread()
  getTargetLevelLineIndex()
  indentListItems()
  getParentLineIndex()
  getLastChildIndex()
  outdent_list_items_ownKeys()
  outdent_list_items_objectSpread()
  outdentListItems()
  change_list_type_ownKeys()
  change_list_type_objectSpread()
  changeListType()
  FormatEdit()
  updateFormats()
  with_format_types_ownKeys()
  with_format_types_objectSpread()
  formatTypesSelector()
  withFormatTypes()
  useBoundaryStyle()
  useInlineWarning()
  component_ownKeys()
  component_objectSpread()
  createPrepareEditableTree()
  fixPlaceholderSelection()
  component_RichText()
  getDoc()
  getWin()
  formatToValue()
  removeEditorOnlyFormats()
  valueToFormat()
  createRecord()
  applyRecord()
  handlePaste()
  handleDelete()
  handleEnter()
  handleSpace()
  handleHorizontalNavigation()
  handleKeyDown()
  createUndoLevel()
  handleInput()
  handleCompositionStart()
  handleCompositionEnd()
  handleSelectionChange()
  handleChange()
  handlePointerDown()
  handleFocus()
  handleBlur()
  applyFromProps()
  focus()
  _defineProperty()
  _extends()

Functions
Functions that are not part of a class:

__webpack_require__(moduleId)   X-Ref
No description

getDefault()   X-Ref
No description

getModuleExports()   X-Ref
No description

classNames()   X-Ref
No description

_iterableToArrayLimit(arr, i)   X-Ref
No description

_slicedToArray(arr, i)   X-Ref
No description

_objectWithoutProperties(source, excluded)   X-Ref
No description

_arrayWithoutHoles(arr)   X-Ref
No description

_nonIterableSpread()   X-Ref
No description

_toConsumableArray(arr)   X-Ref
No description

_arrayLikeToArray(arr, len)   X-Ref
No description

_unsupportedIterableToArray(o, minLen)   X-Ref
No description

_iterableToArray(iter)   X-Ref
No description

_arrayWithHoles(arr)   X-Ref
No description

_nonIterableRest()   X-Ref
No description

_typeof(obj)   X-Ref
No description

_objectWithoutPropertiesLoose(source, excluded)   X-Ref
No description

arrayOf( value )   X-Ref
Returns the first argument as the sole entry in an array.

return: {Array} Value returned as entry in array.
param: {*} value Value to return.

isObjectLike( value )   X-Ref
Returns true if the value passed is object-like, or false otherwise. A value
is object-like if it can support property assignment, e.g. object or array.

return: {boolean} Whether value is object-like.
param: {*} value Value to test.

createCache()   X-Ref
Creates and returns a new cache object.

return: {Object} Cache object.

isShallowEqual( a, b, fromIndex )   X-Ref
Returns true if entries within the two arrays are strictly equal by
reference from a starting index.

return: {boolean} Whether arrays are shallowly equal.
param: {Array}  a         First array.
param: {Array}  b         Second array.
param: {number} fromIndex Index from which to start comparison.

getRootCache()   X-Ref
Returns the root cache. If WeakMap is supported, this is assigned to the
root WeakMap cache set, otherwise it is a shared instance of the default
cache object.

return: {(WeakMap|Object)} Root cache object.

getWeakMapCache( dependants )   X-Ref
Returns the cache for a given dependants array. When possible, a WeakMap
will be used to create a unique cache for each set of dependants. This
is feasible due to the nature of WeakMap in allowing garbage collection
to occur on entries where the key object is no longer referenced. Since
WeakMap requires the key to be an object, this is only possible when the
dependant is object-like. The root cache is created as a hierarchy where
each top-level key is the first entry in a dependants set, the value a
WeakMap where each key is the next dependant, and so on. This continues
so long as the dependants are object-like. If no dependants are object-
like, then the cache is shared across all invocations.

return: {Object} Cache object.
param: {Array} dependants Selector dependants.

clear()   X-Ref
Resets root memoization cache.


callSelector( )   X-Ref
The augmented selector call, considering first whether dependants have
changed before passing it to underlying memoize function.

return: {*} Selector result.
param: {Object} source    Source object for derivation.
param: {...*}   extraArgs Additional arguments to pass to selector.

ownKeys(object, enumerableOnly)   X-Ref
No description

_objectSpread(target)   X-Ref
No description

reducer_formatTypes()   X-Ref
Reducer managing the format types

return: {Object} Updated state.
param: {Object} state  Current state.
param: {Object} action Dispatched action.

getFormatType(state, name)   X-Ref
Returns a format type by name.

return: {Object?} Format type.
param: {Object} state Data state.
param: {string} name Format type name.

getFormatTypeForBareElement(state, bareElementTagName)   X-Ref
Gets the format type, if any, that can handle a bare element (without a
data-format-type attribute), given the tag name of this element.

return: {?Object} Format type.
param: {Object} state              Data state.
param: {string} bareElementTagName The tag name of the element to find a

getFormatTypeForClassName(state, elementClassName)   X-Ref
Gets the format type, if any, that can handle an element, given its classes.

return: {?Object} Format type.
param: {Object} state            Data state.
param: {string} elementClassName The classes of the element to find a format

addFormatTypes(formatTypes)   X-Ref
Returns an action object used in signalling that format types have been
added.

return: {Object} Action object.
param: {Array|Object} formatTypes Format types received.

removeFormatTypes(names)   X-Ref
Returns an action object used to remove a registered format type.

return: {Object} Action object.
param: {string|Array} names Format name.

isFormatEqual(format1, format2)   X-Ref
Optimised equality check for format objects.

return: {boolean} True if formats are equal, false if not.
param: {?Object} format1 Format to compare.
param: {?Object} format2 Format to compare.

normalise_formats_ownKeys(object, enumerableOnly)   X-Ref
No description

normalise_formats_objectSpread(target)   X-Ref
No description

normaliseFormats(value)   X-Ref
Normalises formats: ensures subsequent adjacent equal formats have the same
reference.

return: {Object} New value with normalised formats.
param: {Object} value Value to normalise formats of.

apply_format_ownKeys(object, enumerableOnly)   X-Ref
No description

apply_format_objectSpread(target)   X-Ref
No description

replace(array, index, value)   X-Ref
No description

applyFormat(value, format)   X-Ref
Apply a format object to a Rich Text value from the given `startIndex` to the
given `endIndex`. Indices are retrieved from the selection if none are
provided.

return: {Object} A new value with the format applied.
param: {Object} value        Value to modify.
param: {Object} format       Format to apply.
param: {number} [startIndex] Start index.
param: {number} [endIndex]   End index.

createElement(_ref, html)   X-Ref
Parse the given HTML into a body element.

Note: The current implementation will return a shared reference, reset on
each call to `createElement`. Therefore, you should not hold a reference to
the value to operate upon asynchronously, as it may have unexpected results.

return: {HTMLBodyElement} Body element with parsed HTML.
param: {HTMLDocument} document The HTML document to use to parse.
param: {string}       html     The HTML to parse.

create_ownKeys(object, enumerableOnly)   X-Ref
No description

create_objectSpread(target)   X-Ref
No description

createEmptyValue()   X-Ref
No description

simpleFindKey(object, value)   X-Ref
No description

toFormat(_ref)   X-Ref
No description

create()   X-Ref
Create a RichText value from an `Element` tree (DOM), an HTML string or a
plain text string, with optionally a `Range` object to set the selection. If
called without any input, an empty value will be created. If
`multilineTag` is provided, any content of direct children whose type matches
`multilineTag` will be separated by two newlines. The optional functions can
be used to filter out content.

A value will have the following shape, which you are strongly encouraged not
to modify without the use of helper functions:

```js
{
text: string,
formats: Array,
replacements: Array,
?start: number,
?end: number,
}
```

As you can see, text and formatting are separated. `text` holds the text,
including any replacement characters for objects and lines. `formats`,
`objects` and `lines` are all sparse arrays of the same length as `text`. It
holds information about the formatting at the relevant text indices. Finally
`start` and `end` state which text indices are selected. They are only
provided if a `Range` was given.

return: {Object} A rich text value.
param: {Object}  [$1]                      Optional named arguments.
param: {Element} [$1.element]              Element to create value from.
param: {string}  [$1.text]                 Text to create value from.
param: {string}  [$1.html]                 HTML to create value from.
param: {Range}   [$1.range]                Range to create value from.
param: {string}  [$1.multilineTag]         Multiline tag if the structure is
param: {Array}   [$1.multilineWrapperTags] Tags where lines can be found if
param: {?boolean} [$1.preserveWhiteSpace]  Whether or not to collapse white

accumulateSelection(accumulator, node, range, value)   X-Ref
Helper to accumulate the value's selection start and end from the current
node and range.

param: {Object} accumulator Object to accumulate into.
param: {Node}   node        Node to create value with.
param: {Range}  range       Range to create value with.
param: {Object} value       Value that is being accumulated.

filterRange(node, range, filter)   X-Ref
Adjusts the start and end offsets from a range based on a text filter.

return: {?Object} Object containing range properties.
param: {Node}     node   Node of which the text should be filtered.
param: {Range}    range  The range to filter.
param: {Function} filter Function to use to filter the text.

collapseWhiteSpace(string)   X-Ref
Collapse any whitespace used for HTML formatting to one space character,
because it will also be displayed as such by the browser.

param: {string} string

removePadding(string)   X-Ref
Removes padding (zero width non breaking spaces) added by `toTree`.

param: {string} string

createFromElement(_ref3)   X-Ref
Creates a Rich Text value from a DOM element and range.

return: {Object} A rich text value.
param: {Object}    $1                      Named argements.
param: {?Element}  $1.element              Element to create value from.
param: {?Range}    $1.range                Range to create value from.
param: {?string}   $1.multilineTag         Multiline tag if the structure is
param: {?Array}    $1.multilineWrapperTags Tags where lines can be found if
param: {?boolean} $1.preserveWhiteSpace    Whether or not to collapse white

mergeFormats(formats)   X-Ref
No description

createFromMultilineElement(_ref4)   X-Ref
Creates a rich text value from a DOM element and range that should be
multiline.

return: {Object} A rich text value.
param: {Object}   $1                      Named argements.
param: {?Element} $1.element              Element to create value from.
param: {?Range}   $1.range                Range to create value from.
param: {?string}  $1.multilineTag         Multiline tag if the structure is
param: {?Array}   $1.multilineWrapperTags Tags where lines can be found if
param: {boolean}  $1.currentWrapperTags   Whether to prepend a line
param: {?boolean} $1.preserveWhiteSpace   Whether or not to collapse white

getAttributes(_ref5)   X-Ref
Gets the attributes of an element in object shape.

return: {?Object} Attribute object or `undefined` if the element has no
param: {Object}    $1                 Named argements.
param: {Element}   $1.element         Element to get attributes from.

mergePair(a, b)   X-Ref
Concats a pair of rich text values. Not that this mutates `a` and does NOT
normalise formats!

return: {Object} `a`, mutated.
param: {Object} a Value to mutate.
param: {Object} b Value to add read from.

concat()   X-Ref
Combine all Rich Text values into one. This is similar to
`String.prototype.concat`.

return: {Object} A new value combining all given records.
param: {...Object} values Objects to combine.

getActiveFormats(_ref)   X-Ref
Gets the all format objects at the start of the selection.

return: {?Object} Active format objects.
param: {Object}        value                Value to inspect.
param: {Array<Array>}  value.formats        Formats object data values.
param: {number}        value.start          Index to start from.
param: {number}        value.end            Index to end.
param: {Array}         value.activeFormats  Array to return if there are active formats.
param: {Array}         EMPTY_ACTIVE_FORMATS Array to return if there are no active

getActiveFormat(value, formatType)   X-Ref
Gets the format object by type at the start of the selection. This can be
used to get e.g. the URL of a link format at the current selection, but also
to check if a format is active at the selection. Returns undefined if there
is no format at the selection.

return: {Object|undefined} Active format object of the specified type, or undefined.
param: {Object} value      Value to inspect.
param: {string} formatType Format type to look for.

getActiveObject(_ref)   X-Ref
Gets the active object, if there is any.

return: {?Object} Active object, or undefined.
param: {Object} value Value to inspect.

getTextContent(_ref)   X-Ref
Get the textual content of a Rich Text value. This is similar to
`Element.textContent`.

return: {string} The text content.
param: {Object} value Value to use.

getLineIndex(_ref)   X-Ref
Gets the currently selected line index, or the first line index if the
selection spans over multiple items.

return: {?boolean} The line index. Undefined if not found.
param: {Object}  value      Value to get the line index from.
param: {boolean} startIndex Optional index that should be contained by the

isListRootSelected(value)   X-Ref
Whether or not the root list is selected.

return: {boolean} True if the root list or nothing is selected, false if an
param: {Object} value The value to check.

isActiveListType(value, type, rootType)   X-Ref
Wether or not the selected list has the given tag name.

return: {boolean} True if the current list type matches `type`, false if not.
param: {Object}  value    The value to check.
param: {string}  type     The tag name the list should have.
param: {string}  rootType The current root tag name, to compare with in case

isCollapsed(_ref)   X-Ref
Check if the selection of a Rich Text value is collapsed or not. Collapsed
means that no characters are selected, but there is a caret present. If there
is no selection, `undefined` will be returned. This is similar to
`window.getSelection().isCollapsed()`.

return: {boolean|undefined} True if the selection is collapsed, false if not,
param: {Object} value The rich text value to check.

isEmpty(_ref)   X-Ref
Check if a Rich Text value is Empty, meaning it contains no text or any
objects (such as images).

return: {boolean} True if the value is empty, false if not.
param: {Object} value Value to use.

isEmptyLine(_ref2)   X-Ref
Check if the current collapsed selection is on an empty line in case of a
multiline value.

return: {boolean} True if the line is empty, false if not.
param: {Object} value Value te check.

join(values)   X-Ref
Combine an array of Rich Text values into one, optionally separated by
`separator`, which can be a Rich Text value, HTML string, or plain text
string. This is similar to `Array.prototype.join`.

return: {Object} A new combined value.
param: {Array<Object>} values      An array of values to join.
param: {string|Object} [separator] Separator string or value.

register_format_type_ownKeys(object, enumerableOnly)   X-Ref
No description

register_format_type_objectSpread(target)   X-Ref
No description

registerFormatType(name, settings)   X-Ref
Registers a new format provided a unique name and an object defining its
behavior.

return: {WPFormat|undefined} The format, if it has been successfully registered;
param: {string}   name                 Format name.
param: {WPFormat} settings             Format settings.

remove_format_ownKeys(object, enumerableOnly)   X-Ref
No description

remove_format_objectSpread(target)   X-Ref
No description

removeFormat(value, formatType)   X-Ref
Remove any format object from a Rich Text value by type from the given
`startIndex` to the given `endIndex`. Indices are retrieved from the
selection if none are provided.

return: {Object} A new value with the format applied.
param: {Object} value        Value to modify.
param: {string} formatType   Format type to remove.
param: {number} [startIndex] Start index.
param: {number} [endIndex]   End index.

filterFormats(formats, index, formatType)   X-Ref
No description

insert(value, valueToInsert)   X-Ref
Insert a Rich Text value, an HTML string, or a plain text string, into a
Rich Text value at the given `startIndex`. Any content between `startIndex`
and `endIndex` will be removed. Indices are retrieved from the selection if
none are provided.

return: {Object} A new value with the value inserted.
param: {Object}        value         Value to modify.
param: {Object|string} valueToInsert Value to insert.
param: {number}        [startIndex]  Start index.
param: {number}        [endIndex]    End index.

remove_remove(value, startIndex, endIndex)   X-Ref
Remove content from a Rich Text value between the given `startIndex` and
`endIndex`. Indices are retrieved from the selection if none are provided.

return: {Object} A new value with the content removed.
param: {Object} value        Value to modify.
param: {number} [startIndex] Start index.
param: {number} [endIndex]   End index.

replace_replace(_ref, pattern, replacement)   X-Ref
Search a Rich Text value and replace the match(es) with `replacement`. This
is similar to `String.prototype.replace`.

return: {Object} A new value with replacements applied.
param: {Object}         value        The value to modify.
param: {RegExp|string}  pattern      A RegExp object or literal. Can also be
param: {Function|string} replacement The match or matches are replaced with

insertLineSeparator(value)   X-Ref
Insert a line break character into a Rich Text value at the given
`startIndex`. Any content between `startIndex` and `endIndex` will be
removed. Indices are retrieved from the selection if none are provided.

return: {Object} A new value with the value inserted.
param: {Object} value        Value to modify.
param: {number} [startIndex] Start index.
param: {number} [endIndex]   End index.

remove_line_separator_ownKeys(object, enumerableOnly)   X-Ref
No description

remove_line_separator_objectSpread(target)   X-Ref
No description

removeLineSeparator(value)   X-Ref
Removes a line separator character, if existing, from a Rich Text value at the current
indices. If no line separator exists on the indices it will return undefined.

return: {Object|undefined} A new value with the line separator removed. Or undefined if no line separator is found on the position.
param: {Object} value Value to modify.
param: {boolean} backward indicates if are removing from the start index or the end index.

insertObject(value, formatToInsert, startIndex, endIndex)   X-Ref
Insert a format as an object into a Rich Text value at the given
`startIndex`. Any content between `startIndex` and `endIndex` will be
removed. Indices are retrieved from the selection if none are provided.

return: {Object} A new value with the object inserted.
param: {Object} value          Value to modify.
param: {Object} formatToInsert Format to insert as object.
param: {number} [startIndex]   Start index.
param: {number} [endIndex]     End index.

slice_ownKeys(object, enumerableOnly)   X-Ref
No description

slice_objectSpread(target)   X-Ref
No description

slice(value)   X-Ref
Slice a Rich Text value from `startIndex` to `endIndex`. Indices are
retrieved from the selection if none are provided. This is similar to
`String.prototype.slice`.

return: {Object} A new extracted value.
param: {Object} value        Value to modify.
param: {number} [startIndex] Start index.
param: {number} [endIndex]   End index.

split(_ref, string)   X-Ref
Split a Rich Text value in two at the given `startIndex` and `endIndex`, or
split at the given separator. This is similar to `String.prototype.split`.
Indices are retrieved from the selection if none are provided.

return: {Array} An array of new values.
param: {Object}        value
param: {Object[]}      value.formats
param: {Object[]}      value.replacements
param: {string}        value.text
param: {number}        value.start
param: {number}        value.end
param: {number|string} [string] Start index, or string at which to split.

splitAtSelection(_ref2)   X-Ref
No description

get_format_type_getFormatType(name)   X-Ref
Returns a registered format type.

return: {?Object} Format type.
param: {string} name Format name.

to_tree_ownKeys(object, enumerableOnly)   X-Ref
No description

to_tree_objectSpread(target)   X-Ref
No description

fromFormat(_ref)   X-Ref
Converts a format object to information that can be used to create an element
from (type, attributes and object).

return: {Object}                            Information to be used for
param: {Object}  $1                        Named parameters.
param: {string}  $1.type                   The format type.
param: {Object}  $1.attributes             The format attributes.
param: {Object}  $1.unregisteredAttributes The unregistered format
param: {boolean} $1.object                 Wether or not it is an object
param: {boolean} $1.boundaryClass          Wether or not to apply a boundary

isEqualUntil(a, b, index)   X-Ref
Checks if both arrays of formats up until a certain index are equal.

param: {Array}  a     Array of formats to compare.
param: {Array}  b     Array of formats to compare.
param: {number} index Index to check until.

toTree(_ref2)   X-Ref
No description

to_dom_ownKeys(object, enumerableOnly)   X-Ref
No description

to_dom_objectSpread(target)   X-Ref
No description

createPathToNode(node, rootNode, path)   X-Ref
Creates a path as an array of indices from the given root node to the given
node.

return: {Array} The path from the root node to the node.
param: {Node}        node     Node to find the path of.
param: {HTMLElement} rootNode Root node to find the path from.
param: {Array}       path     Initial path to build on.

getNodeByPath(node, path)   X-Ref
Gets a node given a path (array of indices) from the given node.

return: {Object} Object with the found node and the remaining offset (if any).
param: {HTMLElement} node Root node to find the wanted node in.
param: {Array}       path Path (indices) to the wanted node.

to_dom_append(element, child)   X-Ref
No description

to_dom_appendText(node, text)   X-Ref
No description

to_dom_getLastChild(_ref)   X-Ref
No description

to_dom_getParent(_ref2)   X-Ref
No description

to_dom_isText(node)   X-Ref
No description

to_dom_getText(_ref3)   X-Ref
No description

to_dom_remove(node)   X-Ref
No description

toDom(_ref4)   X-Ref
No description

apply(_ref5)   X-Ref
Create an `Element` tree from a Rich Text value and applies the difference to
the `Element` tree contained by `current`. If a `multilineTag` is provided,
text separated by two new lines will be wrapped in an `Element` of that type.

param: {Object}      $1                        Named arguments.
param: {Object}      $1.value                  Value to apply.
param: {HTMLElement} $1.current                The live root node to apply the element tree to.
param: {string}      [$1.multilineTag]         Multiline tag.
param: {Array}       [$1.multilineWrapperTags] Tags where lines can be found if nesting is possible.

applyValue(future, current)   X-Ref
No description

isRangeEqual(a, b)   X-Ref
Returns true if two ranges are equal, or false otherwise. Ranges are
considered equal if their start and end occur in the same container and
offset.

return: {boolean} Whether the two ranges are equal.
param: {Range} a First range object to test.
param: {Range} b First range object to test.

applySelection(_ref6, current)   X-Ref
No description

toHTMLString(_ref)   X-Ref
Create an HTML string from a Rich Text value. If a `multilineTag` is
provided, text separated by a line separator will be wrapped in it.

return: {string} HTML string.
param: {Object}   $1                      Named argements.
param: {Object}   $1.value                Rich text value.
param: {string}   [$1.multilineTag]       Multiline tag.
param: {?boolean} [$1.preserveWhiteSpace] Whether or not to use newline

to_html_string_createEmpty()   X-Ref
No description

to_html_string_getLastChild(_ref2)   X-Ref
No description

to_html_string_append(parent, object)   X-Ref
No description

to_html_string_appendText(object, text)   X-Ref
No description

to_html_string_getParent(_ref3)   X-Ref
No description

to_html_string_isText(_ref4)   X-Ref
No description

to_html_string_getText(_ref5)   X-Ref
No description

to_html_string_remove(object)   X-Ref
No description

createElementHTML(_ref6)   X-Ref
No description

createChildrenHTML()   X-Ref
No description

toggleFormat(value, format)   X-Ref
Toggles a format object to a Rich Text value at the current selection.

return: {Object} A new value with the format applied or removed.
param: {Object} value  Value to modify.
param: {Object} format Format to apply or remove.

unregisterFormatType(name)   X-Ref
Unregisters a format.

return: {WPFormat|undefined} The previous format value, if it has been successfully
param: {string} name Format name.

canIndentListItems(value)   X-Ref
Checks if the selected list item can be indented.

return: {boolean} Whether or not the selected list item can be indented.
param: {Object} value Value to check.

canOutdentListItems(value)   X-Ref
Checks if the selected list item can be outdented.

return: {boolean} Whether or not the selected list item can be outdented.
param: {Object} value Value to check.

indent_list_items_ownKeys(object, enumerableOnly)   X-Ref
No description

indent_list_items_objectSpread(target)   X-Ref
No description

getTargetLevelLineIndex(_ref, lineIndex)   X-Ref
Gets the line index of the first previous list item with higher indentation.

return: {boolean} The line index.
param: {Object} value      Value to search.
param: {number} lineIndex  Line index of the list item to compare with.

indentListItems(value, rootFormat)   X-Ref
Indents any selected list items if possible.

return: {Object} The changed value.
param: {Object} value      Value to change.
param: {Object} rootFormat Root format.

getParentLineIndex(_ref, lineIndex)   X-Ref
Gets the index of the first parent list. To get the parent list formats, we
go through every list item until we find one with exactly one format type
less.

return: {Array} The parent list line index.
param: {Object} value     Value to search.
param: {number} lineIndex Line index of a child list item.

getLastChildIndex(_ref, lineIndex)   X-Ref
Gets the line index of the last child in the list.

return: {Array} The index of the last child.
param: {Object} value     Value to search.
param: {number} lineIndex Line index of a list item in the list.

outdent_list_items_ownKeys(object, enumerableOnly)   X-Ref
No description

outdent_list_items_objectSpread(target)   X-Ref
No description

outdentListItems(value)   X-Ref
Outdents any selected list items if possible.

return: {Object} The changed value.
param: {Object} value Value to change.

change_list_type_ownKeys(object, enumerableOnly)   X-Ref
No description

change_list_type_objectSpread(target)   X-Ref
No description

changeListType(value, newFormat)   X-Ref
Changes the list type of the selected indented list, if any. Looks at the
currently selected list item and takes the parent list, then changes the list
type of this list. When multiple lines are selected, the parent lists are
takes and changed.

return: {Object} The changed value.
param: {Object} value     Value to change.
param: {Object} newFormat The new list format object. Choose between

FormatEdit(_ref)   X-Ref
Set of all interactive content tags.


updateFormats(_ref)   X-Ref
Efficiently updates all the formats from `start` (including) until `end`
(excluding) with the active formats. Mutates `value`.

return: {Object} Mutated value.
param: {Object} $1         Named paramentes.
param: {Object} $1.value   Value te update.
param: {number} $1.start   Index to update from.
param: {number} $1.end     Index to update until.
param: {Array}  $1.formats Replacement formats.

with_format_types_ownKeys(object, enumerableOnly)   X-Ref
No description

with_format_types_objectSpread(target)   X-Ref
No description

formatTypesSelector(select)   X-Ref
No description

withFormatTypes(RichText)   X-Ref
This higher-order component provides RichText with the `formatTypes` prop
and its derived props from experimental format type settings.

return: {WPComponent} New enhanced component.
param: {WPComponent} RichText The rich text component to add props for.

useBoundaryStyle(_ref)   X-Ref
Calculates and renders the format boundary style when the active formats
change.


useInlineWarning(_ref)   X-Ref
WordPress dependencies


component_ownKeys(object, enumerableOnly)   X-Ref
No description

component_objectSpread(target)   X-Ref
No description

createPrepareEditableTree(props, prefix)   X-Ref
No description

fixPlaceholderSelection(defaultView)   X-Ref
If the selection is set on the placeholder element, collapse the selection to
the start (before the placeholder).

param: {Window} defaultView

component_RichText(_ref)   X-Ref
No description

getDoc()   X-Ref
No description

getWin()   X-Ref
No description

formatToValue(string)   X-Ref
Converts the outside data structure to our internal representation.

return: {Object} An internal rich-text value.
param: {*} string The outside value, data type depends on props.

removeEditorOnlyFormats(val)   X-Ref
Removes editor only formats from the value.

Editor only formats are applied using `prepareEditableTree`, so we need to
remove them before converting the internal state

return: {Object} A new rich-text value.
param: {Object} val The internal rich-text value.

valueToFormat(val)   X-Ref
Converts the internal value to the external data format.

return: {*} The external data format, data type depends on props.
param: {Object} val The internal rich-text value.

createRecord()   X-Ref
No description

applyRecord(newRecord)   X-Ref
No description

handlePaste(event)   X-Ref
Handles a paste event.

Saves the pasted data as plain text in `pastedPlainText`.

param: {ClipboardEvent} event The paste event.

handleDelete(event)   X-Ref
Handles delete on keydown:
- outdent list items,
- delete content if everything is selected,
- trigger the onDelete prop when selection is uncollapsed and at an edge.

param: {WPSyntheticEvent} event A synthetic keyboard event.

handleEnter(event)   X-Ref
Triggers the `onEnter` prop on keydown.

param: {WPSyntheticEvent} event A synthetic keyboard event.

handleSpace(event)   X-Ref
Indents list items on space keydown.

param: {WPSyntheticEvent} event A synthetic keyboard event.

handleHorizontalNavigation(event)   X-Ref
Handles horizontal keyboard navigation when no modifiers are pressed. The
navigation is handled separately to move correctly around format
boundaries.

param: {WPSyntheticEvent} event A synthetic keyboard event.

handleKeyDown(event)   X-Ref
No description

createUndoLevel()   X-Ref
No description

handleInput(event)   X-Ref
Handle input on the next selection change event.

param: {WPSyntheticEvent} event Synthetic input event.

handleCompositionStart()   X-Ref
No description

handleCompositionEnd()   X-Ref
No description

handleSelectionChange(event)   X-Ref
Syncs the selection to local state. A callback for the `selectionchange`
native events, `keyup`, `mouseup` and `touchend` synthetic events, and
animation frames after the `focus` event.

param: {Event|WPSyntheticEvent|DOMHighResTimeStamp} event

handleChange(newRecord)   X-Ref
Sync the value to global state. The node tree and selection will also be
updated if differences are found.

param: {Object}  newRecord         The record to sync and apply.
param: {Object}  $2                Named options.
param: {boolean} $2.withoutHistory If true, no undo level will be

handlePointerDown(event)   X-Ref
Select object when they are clicked. The browser will not set any
selection when clicking e.g. an image.

param: {WPSyntheticEvent} event Synthetic mousedown or touchstart event.

handleFocus()   X-Ref
Handles a focus event on the contenteditable field, calling the
`unstableOnFocus` prop callback if one is defined. The callback does not
receive any arguments.

This is marked as a private API and the `unstableOnFocus` prop is not
documented, as the current requirements where it is used are subject to
future refactoring following `isSelected` handling.

In contrast with `setFocusedElement`, this is only triggered in response
to focus within the contenteditable field, whereas `setFocusedElement`
is triggered on focus within any `RichText` descendent element.


handleBlur()   X-Ref
No description

applyFromProps()   X-Ref
No description

focus()   X-Ref
No description

_defineProperty(obj, key, value)   X-Ref
No description

_extends()   X-Ref
No description



Generated: Sat Sep 19 01:00:03 2020 Cross-referenced by PHPXref 0.7.1