[ Index ]

PHP Cross Reference of WordPress

title

Body

[close]

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

(no description)

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

Defines 64 functions

  __webpack_require__()
  getDefault()
  getModuleExports()
  _arrayWithoutHoles()
  _defineProperty()
  _iterableToArray()
  _nonIterableSpread()
  _objectSpread()
  _toConsumableArray()
  _typeof2()
  _typeof()
  applyFormat()
  applyFormats()
  concat()
  createElement()
  createEmptyValue()
  create()
  accumulateSelection()
  filterRange()
  createFromElement()
  createFromMultilineElement()
  getAttributes()
  getActiveFormat()
  getTextContent()
  insert()
  isCollapsed()
  isEmpty()
  isEmptyLine()
  isFormatEqual()
  join()
  normaliseFormats()
  removeFormat()
  filterFormats()
  remove()
  replace()
  slice()
  split()
  splitAtSelection()
  createPathToNode()
  getNodeByPath()
  createEmpty()
  append()
  appendText()
  getLastChild()
  getParent()
  isText()
  getText()
  remove()
  toDom()
  apply()
  applyValue()
  applySelection()
  toHTMLString()
  createEmpty()
  getLastChild()
  append()
  appendText()
  getParent()
  isText()
  getText()
  remove()
  createElementHTML()
  createChildrenHTML()
  toTree()

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

_arrayWithoutHoles(arr)   X-Ref
No description

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

_iterableToArray(iter)   X-Ref
No description

_nonIterableSpread()   X-Ref
No description

_objectSpread(target)   X-Ref
No description

_toConsumableArray(arr)   X-Ref
No description

_typeof2(obj)   X-Ref
No description

_typeof(obj)   X-Ref
No description

applyFormat(_ref, 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.

applyFormats(formats, index, format)   X-Ref
No description

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 An array of all values to combine.

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

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

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

return: {Object} A rich text value.
param: {?Object}   $1                 Optional named argements.
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: {?Function} $1.removeNode      Function to declare whether the given
param: {?Function} $1.unwrapNode      Function to declare whether the given
param: {?Function} $1.filterString    Function to filter the given string.
param: {?Function} $1.removeAttribute Wether to remove an attribute based on

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.

createFromElement(_ref2)   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: {?Function} $1.removeNode      Function to declare whether the given
param: {?Function} $1.unwrapNode      Function to declare whether the given
param: {?Function} $1.filterString    Function to filter the given string.
param: {?Function} $1.removeAttribute Wether to remove an attribute based on

createFromMultilineElement(_ref3)   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: {?Function} $1.removeNode      Function to declare whether the given
param: {?Function} $1.unwrapNode      Function to declare whether the given
param: {?Function} $1.filterString    Function to filter the given string.
param: {?Function} $1.removeAttribute Wether to remove an attribute based on

getAttributes(_ref4)   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.
param: {?Function} $1.removeAttribute Wether to remove an attribute based on

getActiveFormat(_ref, 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} Active format object of the specified type, or undefined.
param: {Object} value      Value to inspect.
param: {string} formatType Format type to look for.

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.

insert(_ref, 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: {string} valueToInsert Value to insert.
param: {number} startIndex    Start index.
param: {number} endIndex      End index.

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

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.

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}         values    An array of values to join.
param: {string|Object} separator Separator string or value.

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

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

removeFormat(_ref, 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

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(_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

slice(_ref)   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   Value to modify.
param: {number|string} string  Start index, or string at which to split.
param: {number}        end     End index.

splitAtSelection(_ref2)   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.

createEmpty(type)   X-Ref
No description

append(element, child)   X-Ref
No description

appendText(node, text)   X-Ref
No description

getLastChild(_ref)   X-Ref
No description

getParent(_ref2)   X-Ref
No description

isText(_ref3)   X-Ref
No description

getText(_ref4)   X-Ref
No description

remove(node)   X-Ref
No description

toDom(value, multilineTag)   X-Ref
No description

apply(value, current, multilineTag)   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}      value        Value to apply.
param: {HTMLElement} current      The live root node to apply the element
param: {string}      multilineTag Multiline tag.

applyValue(future, current)   X-Ref
No description

applySelection(selection, current)   X-Ref
No description

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

return: {string} HTML string.
param: {Object} value        Rich text value.
param: {string} multilineTag Multiline tag.

createEmpty(type)   X-Ref
No description

getLastChild(_ref)   X-Ref
No description

append(parent, object)   X-Ref
No description

appendText(object, text)   X-Ref
No description

getParent(_ref2)   X-Ref
No description

isText(_ref3)   X-Ref
No description

getText(_ref4)   X-Ref
No description

remove(object)   X-Ref
No description

createElementHTML(_ref5)   X-Ref
No description

createChildrenHTML()   X-Ref
No description

toTree(value, multilineTag, settings)   X-Ref
Internal dependencies




Generated: Mon Jan 7 01:00:05 2019 Cross-referenced by PHPXref 0.7.1