[ Index ]

PHP Cross Reference of WordPress Trunk (Updated Daily)

Search

title

Body

[close]

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

(no description)

File Size: 5344 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.

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

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.

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

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.

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

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.

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

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.

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

ownKeys(object, enumerableOnly)   X-Ref
No description

_objectSpread(target)   X-Ref
No description

reducer_formatTypes()   X-Ref
Reducer managing the format types

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

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

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

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.

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

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

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

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

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

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

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

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

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

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.

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

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.

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

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.

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

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.

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
return: {Object} A rich text value.

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.

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.
return: {?Object} Object containing range properties.

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.

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
return: {Object} A rich text value.

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.

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
return: {Object} A rich text value.

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

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

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

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

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

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

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

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
return: {?Object} Active format objects.

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.

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

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

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

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

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

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

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

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

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

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

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
return: {boolean} True if the current list type matches `type`, false if not.

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()`.

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

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

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

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

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

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`.

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

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

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.

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

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.

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

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.

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

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`.

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
return: {Object} A new value with replacements applied.

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.

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

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.

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

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.

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

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`.

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

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.

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.
return: {Array} An array of new values.

splitAtSelection(_ref2)   X-Ref
No description

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

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

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).

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
return: {Object}                            Information to be used for

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.

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.
return: {Array} The path from the root node to the node.

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

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

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.

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

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.

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
return: {string} HTML string.

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.

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

unregisterFormatType(name)   X-Ref
Unregisters a format.

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

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

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

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

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

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.

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

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

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

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.

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

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

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

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.

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

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.

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

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`.

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.
return: {Object} Mutated value.

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.

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

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.

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

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

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

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

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

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 : Thu Jul 16 08:20:02 2020 Cross-referenced by PHPXref