[ Index ]

PHP Cross Reference of WordPress

title

Body

[close]

/wp-includes/js/dist/ -> blocks.js (summary)

(no description)

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

Defines 240 functions

  __webpack_require__()
  getDefault()
  getModuleExports()
  _defineProperty()
  _defineProperties()
  _createClass()
  _classCallCheck()
  _arrayWithoutHoles()
  _nonIterableSpread()
  _toConsumableArray()
  _extends()
  getDefaultOpts()
  allOptionsOn()
  validate()
  escapeCharactersCallback()
  _constructor()
  _parseExtension()
  legacyExtensionLoading()
  listen()
  rTrimInputText()
  clean()
  substitutePreCodeTags()
  hashHTMLSpan()
  headerId()
  writeImageTagBase64()
  writeImageTag()
  parseInside()
  processListItems()
  styleStartNumber()
  parseConsecutiveLists()
  parseMetadataContents()
  parseInside()
  parseStyles()
  parseHeaders()
  parseCells()
  buildTable()
  parseTable()
  _iterableToArrayLimit()
  _slicedToArray()
  _iterableToArray()
  reducer_blockTypes()
  blockStyles()
  createBlockNameSetterReducer()
  reducer_categories()
  getBlockType()
  getBlockStyles()
  getCategories()
  getDefaultBlockName()
  getFreeformFallbackBlockName()
  getUnregisteredFallbackBlockName()
  getGroupingBlockName()
  hasBlockSupport()
  isMatchingSearchTerm()
  addBlockTypes()
  removeBlockTypes()
  addBlockStyles()
  removeBlockStyles()
  setDefaultBlockName()
  setFreeformFallbackBlockName()
  setUnregisteredFallbackBlockName()
  setGroupingBlockName()
  setCategories()
  updateCategory()
  isUnmodifiedDefaultBlock()
  isValidIcon()
  normalizeIconObject()
  normalizeBlockType()
  unstable__bootstrapServerSideBlockDefinitions()
  registerBlockType()
  unregisterBlockType()
  setFreeformContentHandlerName()
  getFreeformContentHandlerName()
  registration_getGroupingBlockName()
  setUnregisteredTypeHandlerName()
  getUnregisteredTypeHandlerName()
  registration_setDefaultBlockName()
  registration_setGroupingBlockName()
  registration_getDefaultBlockName()
  registration_getBlockType()
  registration_getBlockTypes()
  registration_getBlockSupport()
  registration_hasBlockSupport()
  isReusableBlock()
  createBlock()
  cloneBlock()
  getPossibleBlockTransformations()
  findTransform()
  getBlockTransforms()
  switchToBlockType()
  getPath()
  es_parse()
  prop()
  attr()
  es_html()
  es_text()
  query()
  _toArray()
  EntityParser()
  isSpace()
  isAlpha()
  preprocessInput()
  EventedTokenizer()
  Tokenizer()
  tokenize()
  createLogger()
  createLogHandler()
  createQueuedLogger()
  getBlockDefaultClassName()
  getBlockMenuDefaultClassName()
  getSaveElement()
  getSaveContent()
  getCommentAttributes()
  serializeAttributes()
  getBlockContent()
  getCommentDelimitedContent()
  serializeBlock()
  serialize()
  isValidCharacterReference()
  DecodeEntityParser()
  getTextPiecesSplitOnWhitespace()
  getTextWithCollapsedWhitespace()
  getMeaningfulAttributePairs()
  isEquivalentTextTokens()
  getNormalizedStyleValue()
  getStyleProperties()
  isEqualTagAttributePairs()
  getNextNonWhitespaceToken()
  getHTMLTokens()
  isClosedByToken()
  isEquivalentHTML()
  getBlockContentValidationResult()
  isValidBlockContent()
  getSerializeCapableElement()
  getChildrenArray()
  concat()
  fromDOM()
  toHTML()
  children_matcher()
  isNodeOfType()
  getNamedNodeMapAsObject()
  node_fromDOM()
  node_toHTML()
  node_matcher()
  matchers_html()
  isOfType()
  isOfTypes()
  isValidByType()
  isValidByEnum()
  isAmbiguousStringSource()
  matcherFromSource()
  parseWithAttributeSchema()
  getBlockAttribute()
  getBlockAttributes()
  getMigratedBlock()
  createBlockWithFallback()
  serializeBlockNode()
  getPhrasingContentSchema()
  isPhrasingContent()
  getBlockContentSchema()
  isEmpty()
  isPlain()
  deepFilterNodeList()
  deepFilterHTML()
  cleanNodeList()
  removeInvalidHTML()
  createMore()
  createNextpage()
  isList()
  shallowTextContent()
  isFigureContent()
  canHaveAnchor()
  segmentHTMLToShortcodeBlock()
  isInline()
  deepCheck()
  isDoubleBR()
  ms_list_converter_isList()
  slackMarkdownVariantCorrector()
  filterInlineHTML()
  getRawTransformations()
  htmlToBlocks()
  pasteHandler()
  raw_handling_getRawTransformations()
  raw_handling_htmlToBlocks()
  rawHandler()
  categories_getCategories()
  categories_setCategories()
  categories_updateCategory()
  doBlocksMatchTemplate()
  synchronizeBlocksWithTemplate()
  arrayOf()
  isObjectLike()
  createCache()
  isShallowEqual()
  getRootCache()
  getWeakMapCache()
  clear()
  callSelector()
  _arrayWithHoles()
  _nonIterableRest()
  tinycolor()
  inputToRGB()
  rgbToRgb()
  rgbToHsl()
  hslToRgb()
  hue2rgb()
  rgbToHsv()
  hsvToRgb()
  rgbToHex()
  rgbaToHex()
  rgbaToArgbHex()
  desaturate()
  saturate()
  greyscale()
  lighten()
  brighten()
  darken()
  spin()
  complement()
  triad()
  tetrad()
  splitcomplement()
  analogous()
  monochromatic()
  flip()
  boundAlpha()
  bound01()
  clamp01()
  parseIntFromHex()
  isOnePointZero()
  isPercentage()
  pad2()
  convertToPercentage()
  convertDecimalToHex()
  convertHexToDecimal()
  isValidCSSUnit()
  stringInputToObject()
  validateWCAG2Parms()
  v4()
  _objectSpread()
  bytesToUuid()

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

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

_defineProperties(target, props)   X-Ref
No description

_createClass(Constructor, protoProps, staticProps)   X-Ref
No description

_classCallCheck(instance, Constructor)   X-Ref
No description

_arrayWithoutHoles(arr)   X-Ref
No description

_nonIterableSpread()   X-Ref
No description

_toConsumableArray(arr)   X-Ref
No description

_extends()   X-Ref
No description

getDefaultOpts(simple)   X-Ref
Created by Tivie on 13-07-2015.


allOptionsOn()   X-Ref
No description

validate(extension, name)   X-Ref
Validate extension

returns: {{valid: boolean, error: string}}
param: {array} extension
param: {string} name

escapeCharactersCallback(wholeMatch, m1)   X-Ref
No description

_constructor()   X-Ref
No description

_parseExtension(ext, name)   X-Ref
Parse extension

param: {*} ext
param: {string} [name='']

legacyExtensionLoading(ext, name)   X-Ref
LEGACY_SUPPORT

param: {*} ext
param: {string} name

listen(name, callback)   X-Ref
Listen to an event

param: {string} name
param: {function} callback

rTrimInputText(text)   X-Ref
No description

clean(node)   X-Ref
No description

substitutePreCodeTags(doc)   X-Ref
No description

hashHTMLSpan(html)   X-Ref
No description

headerId(m)   X-Ref
No description

writeImageTagBase64(wholeMatch, altText, linkId, url, width, height, m5, title)   X-Ref
No description

writeImageTag(wholeMatch, altText, linkId, url, width, height, m5, title)   X-Ref
No description

parseInside(txt, left, right)   X-Ref
No description

processListItems(listStr, trimTrailing)   X-Ref
Process the contents of a single ordered or unordered list, splitting it
into individual list items.

returns: {string}
param: {string} listStr
param: {boolean} trimTrailing

styleStartNumber(list, listType)   X-Ref
No description

parseConsecutiveLists(list, listType, trimTrailing)   X-Ref
Check and parse consecutive lists (better fix for issue #142)

returns: {string}
param: {string} list
param: {string} listType
param: {boolean} trimTrailing

parseMetadataContents(content)   X-Ref
No description

parseInside(txt)   X-Ref
No description

parseStyles(sLine)   X-Ref
No description

parseHeaders(header, style)   X-Ref
No description

parseCells(cell, style)   X-Ref
No description

buildTable(headers, cells)   X-Ref
No description

parseTable(rawTable)   X-Ref
No description

_iterableToArrayLimit(arr, i)   X-Ref
No description

_slicedToArray(arr, i)   X-Ref
No description

_iterableToArray(iter)   X-Ref
No description

reducer_blockTypes()   X-Ref
Reducer managing the block types

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

blockStyles()   X-Ref
Reducer managing the block style variations.

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

createBlockNameSetterReducer(setActionType)   X-Ref
Higher-order Reducer creating a reducer keeping track of given block name.

param: {string} setActionType  Action type.
return: {Function} Reducer.

reducer_categories()   X-Ref
Reducer managing the categories

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

getBlockType(state, name)   X-Ref
Returns a block type by name.

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

getBlockStyles(state, name)   X-Ref
Returns block styles by block name.

param: {Object} state Data state.
param: {string} name  Block type name.
return: {Array?} Block Styles.

getCategories(state)   X-Ref
Returns all the available categories.

param: {Object} state Data state.
return: {Array} Categories list.

getDefaultBlockName(state)   X-Ref
Returns the name of the default block name.

param: {Object} state Data state.
return: {string?} Default block name.

getFreeformFallbackBlockName(state)   X-Ref
Returns the name of the block for handling non-block content.

param: {Object} state Data state.
return: {string?} Name of the block for handling non-block content.

getUnregisteredFallbackBlockName(state)   X-Ref
Returns the name of the block for handling unregistered blocks.

param: {Object} state Data state.
return: {string?} Name of the block for handling unregistered blocks.

getGroupingBlockName(state)   X-Ref
Returns the name of the block for handling unregistered blocks.

param: {Object} state Data state.
return: {string?} Name of the block for handling unregistered blocks.

hasBlockSupport(state, nameOrType, feature, defaultSupports)   X-Ref
Returns true if the block defines support for a feature, or false otherwise.

param: {Object}         state           Data state.
param: {(string|Object)} nameOrType      Block name or type object.
param: {string}          feature         Feature to test.
param: {boolean}         defaultSupports Whether feature is supported by
return: {boolean} Whether block supports feature.

isMatchingSearchTerm(state, nameOrType, searchTerm)   X-Ref
Returns true if the block type by the given name or object value matches a
search term, or false otherwise.

param: {Object}          state      Blocks state.
param: {(string|Object)} nameOrType Block name or type object.
param: {string}          searchTerm Search term by which to filter.
return: {Object[]} Whether block type matches search term.

addBlockTypes(blockTypes)   X-Ref
No description

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

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

addBlockStyles(blockName, styles)   X-Ref
Returns an action object used in signalling that new block styles have been added.

param: {string}       blockName  Block name.
param: {Array|Object} styles     Block styles.
return: {Object} Action object.

removeBlockStyles(blockName, styleNames)   X-Ref
Returns an action object used in signalling that block styles have been removed.

param: {string}       blockName  Block name.
param: {Array|string} styleNames Block style names.
return: {Object} Action object.

setDefaultBlockName(name)   X-Ref
Returns an action object used to set the default block name.

param: {string} name Block name.
return: {Object} Action object.

setFreeformFallbackBlockName(name)   X-Ref
Returns an action object used to set the name of the block used as a fallback
for non-block content.

param: {string} name Block name.
return: {Object} Action object.

setUnregisteredFallbackBlockName(name)   X-Ref
Returns an action object used to set the name of the block used as a fallback
for unregistered blocks.

param: {string} name Block name.
return: {Object} Action object.

setGroupingBlockName(name)   X-Ref
Returns an action object used to set the name of the block used
when grouping other blocks
eg: in "Group/Ungroup" interactions

param: {string} name Block name.
return: {Object} Action object.

setCategories(categories)   X-Ref
Returns an action object used to set block categories.

param: {Object[]} categories Block categories.
return: {Object} Action object.

updateCategory(slug, category)   X-Ref
Returns an action object used to update a category.

param: {string} slug     Block category slug.
param: {Object} category Object containing the category properties that should be updated.
return: {Object} Action object.

isUnmodifiedDefaultBlock(block)   X-Ref
Determines whether the block is a default block
and its attributes are equal to the default attributes
which means the block is unmodified.

param: {WPBlock} block Block Object
return: {boolean}       Whether the block is an unmodified default block

isValidIcon(icon)   X-Ref
Function that checks if the parameter is a valid icon.

param: {*} icon  Parameter to be checked.
return: {boolean} True if the parameter is a valid icon and false otherwise.

normalizeIconObject(icon)   X-Ref
Function that receives an icon as set by the blocks during the registration
and returns a new icon object that is normalized so we can rely on just on possible icon structure
in the codebase.

param: {WPBlockTypeIconRender} icon Render behavior of a block type icon;
return: {WPBlockTypeIconDescriptor} Object describing the icon.

normalizeBlockType(blockTypeOrName)   X-Ref
Normalizes block type passed as param. When string is passed then
it converts it to the matching block type object.
It passes the original object otherwise.

param: {string|Object} blockTypeOrName  Block type or name.
return: {?Object} Block type.

unstable__bootstrapServerSideBlockDefinitions(definitions)   X-Ref
Sets the server side block definition of blocks.

param: {Object} definitions Server-side block definitions

registerBlockType(name, settings)   X-Ref
Registers a new block provided a unique name and an object defining its
behavior. Once registered, the block is made available as an option to any
editor interface where blocks are implemented.

param: {string} name     Block name.
param: {Object} settings Block settings.
return: {?WPBlock} The block, if it has been successfully registered;

unregisterBlockType(name)   X-Ref
Unregisters a block.

param: {string} name Block name.
return: {?WPBlock} The previous block value, if it has been successfully

setFreeformContentHandlerName(blockName)   X-Ref
Assigns name of block for handling non-block content.

param: {string} blockName Block name.

getFreeformContentHandlerName()   X-Ref
Retrieves name of block handling non-block content, or undefined if no
handler has been defined.

return: {?string} Block name.

registration_getGroupingBlockName()   X-Ref
Retrieves name of block used for handling grouping interactions.

return: {?string} Block name.

setUnregisteredTypeHandlerName(blockName)   X-Ref
Assigns name of block handling unregistered block types.

param: {string} blockName Block name.

getUnregisteredTypeHandlerName()   X-Ref
Retrieves name of block handling unregistered block types, or undefined if no
handler has been defined.

return: {?string} Block name.

registration_setDefaultBlockName(name)   X-Ref
Assigns the default block name.

param: {string} name Block name.

registration_setGroupingBlockName(name)   X-Ref
Assigns name of block for handling block grouping interactions.

param: {string} name Block name.

registration_getDefaultBlockName()   X-Ref
Retrieves the default block name.

return: {?string} Block name.

registration_getBlockType(name)   X-Ref
Returns a registered block type.

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

registration_getBlockTypes()   X-Ref
Returns all registered blocks.

return: {Array} Block settings.

registration_getBlockSupport(nameOrType, feature, defaultSupports)   X-Ref
Returns the block support value for a feature, if defined.

param: {(string|Object)} nameOrType      Block name or type object
param: {string}          feature         Feature to retrieve
param: {*}               defaultSupports Default value to return if not
return: {?*} Block support value

registration_hasBlockSupport(nameOrType, feature, defaultSupports)   X-Ref
Returns true if the block defines support for a feature, or false otherwise.

param: {(string|Object)} nameOrType      Block name or type object.
param: {string}          feature         Feature to test.
param: {boolean}         defaultSupports Whether feature is supported by
return: {boolean} Whether block supports feature.

isReusableBlock(blockOrType)   X-Ref
Determines whether or not the given block is a reusable block. This is a
special block type that is used to point to a global block stored via the
API.

param: {Object} blockOrType Block or Block Type to test.
return: {boolean} Whether the given block is a reusable block.

createBlock(name)   X-Ref
Returns a block object given its type and attributes.

param: {string} name        Block name.
param: {Object} attributes  Block attributes.
param: {?Array} innerBlocks Nested blocks.
return: {Object} Block object.

cloneBlock(block)   X-Ref
Given a block object, returns a copy of the block object, optionally merging
new attributes and/or replacing its inner blocks.

param: {Object} block              Block instance.
param: {Object} mergeAttributes    Block attributes.
param: {?Array} newInnerBlocks     Nested blocks.
return: {Object} A cloned block.

getPossibleBlockTransformations(blocks)   X-Ref
Returns an array of block types that the set of blocks received as argument
can be transformed into.

param: {Array} blocks Blocks array.
return: {Array} Block types that the blocks argument can be transformed to.

findTransform(transforms, predicate)   X-Ref
Given an array of transforms, returns the highest-priority transform where
the predicate function returns a truthy value. A higher-priority transform
is one with a lower priority value (i.e. first in priority order). Returns
null if the transforms set is empty or the predicate function returns a
falsey value for all entries.

param: {Object[]} transforms Transforms to search.
param: {Function} predicate  Function returning true on matching transform.
return: {?Object} Highest-priority transform candidate.

getBlockTransforms(direction, blockTypeOrName)   X-Ref
Returns normal block transforms for a given transform direction, optionally
for a specific block by name, or an empty array if there are no transforms.
If no block name is provided, returns transforms for all blocks. A normal
transform object includes `blockName` as a property.

param: {string}  direction Transform direction ("to", "from").
param: {string|Object} blockTypeOrName  Block type or name.
return: {Array} Block transforms for direction.

switchToBlockType(blocks, name)   X-Ref
Switch one or more blocks into one or more blocks of the new block type.

param: {Array|Object} blocks Blocks array or block object.
param: {string}       name   Block name.
return: {?Array} Array of blocks or null.

getPath(object, path)   X-Ref
Given object and string of dot-delimited path segments, returns value at
path or undefined if path cannot be resolved.

param: {Object} object Lookup object
param: {string} path   Path to resolve
return: {?*}            Resolved value

es_parse(source, matchers)   X-Ref
Given a markup string or DOM element, creates an object aligning with the
shape of the matchers object, or the value returned by the matcher.

param: {(string|Element)}  source   Source content
param: {(Object|Function)} matchers Matcher function or object of matchers
return: {(Object|*)}                 Matched value(s), shaped by object

prop(selector, name)   X-Ref
Generates a function which matches node of type selector, returning an
attribute by property if the attribute exists. If no selector is passed,
returns property of the query element.

param: {?string} selector Optional selector
param: {string}  name     Property name
return: {*}                Property value

attr(selector, name)   X-Ref
Generates a function which matches node of type selector, returning an
attribute by name if the attribute exists. If no selector is passed,
returns attribute of the query element.

param: {?string} selector Optional selector
param: {string}  name     Attribute name
return: {?string}          Attribute value

es_html(selector)   X-Ref
Convenience for `prop( selector, 'innerHTML' )`.

param: {?string} selector Optional selector
return: {string}           Inner HTML

es_text(selector)   X-Ref
Convenience for `prop( selector, 'textContent' )`.

param: {?string} selector Optional selector
return: {string}           Text content

query(selector, matchers)   X-Ref
Creates a new matching context by first finding elements matching selector
using querySelectorAll before then running another `parse` on `matchers`
scoped to the matched elements.

param: {string}            selector Selector to match
param: {(Object|Function)} matchers Matcher function or object of matchers
return: {Array.<*,Object>}           Array of matched value(s)

_toArray(arr)   X-Ref
No description

EntityParser(named)   X-Ref
No description

isSpace(char)   X-Ref
No description

isAlpha(char)   X-Ref
No description

preprocessInput(input)   X-Ref
No description

EventedTokenizer(delegate, entityParser)   X-Ref
No description

Tokenizer(entityParser, options)   X-Ref
No description

tokenize(input, options)   X-Ref
No description

createLogger()   X-Ref
No description

createLogHandler(logger)   X-Ref
Creates a log handler with block validation prefix.

param: {Function} logger Original logger function.
return: {Function} Augmented logger function.

createQueuedLogger()   X-Ref
No description

getBlockDefaultClassName(blockName)   X-Ref
Returns the block's default classname from its name.

param: {string} blockName The block name.
return: {string} The block's default class.

getBlockMenuDefaultClassName(blockName)   X-Ref
Returns the block's default menu item classname from its name.

param: {string} blockName The block name.
return: {string} The block's default menu item class.

getSaveElement(blockTypeOrName, attributes)   X-Ref
Given a block type containing a save render implementation and attributes, returns the
enhanced element to be saved or string when raw HTML expected.

param: {string|Object} blockTypeOrName   Block type or name.
param: {Object}        attributes        Block attributes.
param: {?Array}        innerBlocks       Nested blocks.
return: {Object|string} Save element or raw HTML string.

getSaveContent(blockTypeOrName, attributes, innerBlocks)   X-Ref
Given a block type containing a save render implementation and attributes, returns the
static markup to be saved.

param: {string|Object} blockTypeOrName Block type or name.
param: {Object}        attributes      Block attributes.
param: {?Array}        innerBlocks     Nested blocks.
return: {string} Save content.

getCommentAttributes(blockType, attributes)   X-Ref
Returns attributes which are to be saved and serialized into the block
comment delimiter.

When a block exists in memory it contains as its attributes both those
parsed the block comment delimiter _and_ those which matched from the
contents of the block.

This function returns only those attributes which are needed to persist and
which cannot be matched from the block content.

param: {Object<string,*>} blockType     Block type.
param: {Object<string,*>} attributes Attributes from in-memory block data.
return: {Object<string,*>} Subset of attributes for comment serialization.

serializeAttributes(attributes)   X-Ref
Given an attributes object, returns a string in the serialized attributes
format prepared for post content.

param: {Object} attributes Attributes object.
return: {string} Serialized attributes.

getBlockContent(block)   X-Ref
Given a block object, returns the Block's Inner HTML markup.

param: {Object} block Block instance.
return: {string} HTML.

getCommentDelimitedContent(rawBlockName, attributes, content)   X-Ref
Returns the content of a block, including comment delimiters.

param: {string} rawBlockName Block name.
param: {Object} attributes   Block attributes.
param: {string} content      Block save content.
return: {string} Comment-delimited block content.

serializeBlock(block)   X-Ref
Returns the content of a block, including comment delimiters, determining
serialized attributes and content form from the current state of the block.

param: {Object}                      block   Block instance.
param: {WPBlockSerializationOptions} options Serialization options.
return: {string} Serialized block.

serialize(blocks, options)   X-Ref
Takes a block or set of blocks and returns the serialized post content.

param: {Array}                       blocks  Block(s) to serialize.
param: {WPBlockSerializationOptions} options Serialization options.
return: {string} The post content.

isValidCharacterReference(text)   X-Ref
Returns true if the given string is a valid character reference segment, or
false otherwise. The text should be stripped of `&` and `;` demarcations.

param: {string} text Text to test.
return: {boolean} Whether text is valid character reference.

DecodeEntityParser()   X-Ref
No description

getTextPiecesSplitOnWhitespace(text)   X-Ref
Given a specified string, returns an array of strings split by consecutive
whitespace, ignoring leading or trailing whitespace.

param: {string} text Original text.
return: {string[]} Text pieces split on whitespace.

getTextWithCollapsedWhitespace(text)   X-Ref
Given a specified string, returns a new trimmed string where all consecutive
whitespace is collapsed to a single space.

param: {string} text Original text.
return: {string} Trimmed text with consecutive whitespace collapsed.

getMeaningfulAttributePairs(token)   X-Ref
Returns attribute pairs of the given StartTag token, including only pairs
where the value is non-empty or the attribute is a boolean attribute, an
enumerated attribute, or a custom data- attribute.

param: {Object} token StartTag token.
return: {Array[]} Attribute pairs.

isEquivalentTextTokens(actual, expected)   X-Ref
Returns true if two text tokens (with `chars` property) are equivalent, or
false otherwise.

param: {Object} actual   Actual token.
param: {Object} expected Expected token.
param: {Object} logger   Validation logger object.
return: {boolean} Whether two text tokens are equivalent.

getNormalizedStyleValue(value)   X-Ref
Given a style value, returns a normalized style value for strict equality
comparison.

param: {string} value Style value.
return: {string} Normalized style value.

getStyleProperties(text)   X-Ref
Given a style attribute string, returns an object of style properties.

param: {string} text Style attribute.
return: {Object} Style properties.

isEqualTagAttributePairs(actual, expected)   X-Ref
Given two sets of attribute tuples, returns true if the attribute sets are
equivalent.

param: {Array[]} actual   Actual attributes tuples.
param: {Array[]} expected Expected attributes tuples.
param: {Object}  logger   Validation logger object.
return: {boolean} Whether attributes are equivalent.

getNextNonWhitespaceToken(tokens)   X-Ref
Given an array of tokens, returns the first token which is not purely
whitespace.

Mutates the tokens array.

param: {Object[]} tokens Set of tokens to search.
return: {Object} Next non-whitespace token.

getHTMLTokens(html)   X-Ref
Tokenize an HTML string, gracefully handling any errors thrown during
underlying tokenization.

param: {string} html   HTML string to tokenize.
param: {Object} logger Validation logger object.
return: {Object[]|null} Array of valid tokenized HTML elements, or null on error

isClosedByToken(currentToken, nextToken)   X-Ref
Returns true if the next HTML token closes the current token.

param: {Object} currentToken Current token to compare with.
param: {Object|undefined} nextToken Next token to compare against.
return: {boolean} true if `nextToken` closes `currentToken`, false otherwise

isEquivalentHTML(actual, expected)   X-Ref
Returns true if the given HTML strings are effectively equivalent, or
false otherwise. Invalid HTML is not considered equivalent, even if the
strings directly match.

param: {string} actual   Actual HTML string.
param: {string} expected Expected HTML string.
param: {Object} logger   Validation logger object.
return: {boolean} Whether HTML strings are equivalent.

getBlockContentValidationResult(blockTypeOrName, attributes, originalBlockContent)   X-Ref
Returns an object with `isValid` property set to `true` if the parsed block
is valid given the input content. A block is considered valid if, when serialized
with assumed attributes, the content matches the original value. If block is
invalid, this function returns all validations issues as well.

param: {string|Object} blockTypeOrName      Block type.
param: {Object}        attributes           Parsed block attributes.
param: {string}        originalBlockContent Original block content.
param: {Object}        logger                  Validation logger object.
return: {Object} Whether block is valid and contains validation messages.

isValidBlockContent(blockTypeOrName, attributes, originalBlockContent)   X-Ref
Returns true if the parsed block is valid given the input content. A block
is considered valid if, when serialized with assumed attributes, the content
matches the original value.

Logs to console in development environments when invalid.

param: {string|Object} blockTypeOrName      Block type.
param: {Object}        attributes           Parsed block attributes.
param: {string}        originalBlockContent Original block content.
return: {boolean} Whether block is valid.

getSerializeCapableElement(children)   X-Ref
Given block children, returns a serialize-capable WordPress element.

param: {WPBlockChildren} children Block children object to convert.
return: {WPElement} A serialize-capable element.

getChildrenArray(children)   X-Ref
Given block children, returns an array of block nodes.

param: {WPBlockChildren} children Block children object to convert.
return: {Array<WPBlockNode>} An array of individual block nodes.

concat()   X-Ref
Given two or more block nodes, returns a new block node representing a
concatenation of its values.

param: {...WPBlockChildren} blockNodes Block nodes to concatenate.
return: {WPBlockChildren} Concatenated block node.

fromDOM(domNodes)   X-Ref
Given an iterable set of DOM nodes, returns equivalent block children.
Ignores any non-element/text nodes included in set.

param: {Iterable.<Node>} domNodes Iterable set of DOM nodes to convert.
return: {WPBlockChildren} Block children equivalent to DOM nodes.

toHTML(children)   X-Ref
Given a block node, returns its HTML string representation.

param: {WPBlockChildren} children Block node(s) to convert to string.
return: {string} String HTML representation of block node.

children_matcher(selector)   X-Ref
Given a selector, returns an hpq matcher generating a WPBlockChildren value
matching the selector result.

param: {string} selector DOM selector.
return: {Function} hpq matcher.

isNodeOfType(node, type)   X-Ref
Given a single node and a node type (e.g. `'br'`), returns true if the node
corresponds to that type, false otherwise.

param: {WPBlockNode} node Block node to test
param: {string} type      Node to type to test against.
return: {boolean} Whether node is of intended type.

getNamedNodeMapAsObject(nodeMap)   X-Ref
Given an object implementing the NamedNodeMap interface, returns a plain
object equivalent value of name, value key-value pairs.

param: {NamedNodeMap} nodeMap NamedNodeMap to convert to object.
return: {Object} Object equivalent value of NamedNodeMap.

node_fromDOM(domNode)   X-Ref
Given a DOM Element or Text node, returns an equivalent block node. Throws
if passed any node type other than element or text.

param: {Node} domNode DOM node to convert.
return: {WPBlockNode} Block node equivalent to DOM node.

node_toHTML(node)   X-Ref
Given a block node, returns its HTML string representation.

param: {WPBlockNode} node Block node to convert to string.
return: {string} String HTML representation of block node.

node_matcher(selector)   X-Ref
Given a selector, returns an hpq matcher generating a WPBlockNode value
matching the selector result.

param: {string} selector DOM selector.
return: {Function} hpq matcher.

matchers_html(selector, multilineTag)   X-Ref
No description

isOfType(value, type)   X-Ref
No description

isOfTypes(value, types)   X-Ref
Returns true if value is of an array of given JSON schema types, or false
otherwise.

param: {*}        value Value to test.
param: {string[]} types Types to test.
return: {boolean} Whether value is of types.

isValidByType(value, type)   X-Ref
Returns true if value is valid per the given block attribute schema type
definition, or false otherwise.

param: {*}                       value Value to test.
param: {?(Array<string>|string)} type  Block attribute schema type.
return: {boolean} Whether value is valid.

isValidByEnum(value, enumSet)   X-Ref
Returns true if value is valid per the given block attribute schema enum
definition, or false otherwise.

param: {*}      value   Value to test.
param: {?Array} enumSet Block attribute schema enum.
return: {boolean} Whether value is valid.

isAmbiguousStringSource(attributeSchema)   X-Ref
Returns true if the given attribute schema describes a value which may be
an ambiguous string.

Some sources are ambiguously serialized as strings, for which value casting
is enabled. This is only possible when a singular type is assigned to the
attribute schema, since the string ambiguity makes it impossible to know the
correct type of multiple to which to cast.

param: {Object} attributeSchema Attribute's schema.
return: {boolean} Whether attribute schema defines an ambiguous string

matcherFromSource(sourceConfig)   X-Ref
Returns an hpq matcher given a source object.

param: {Object} sourceConfig Attribute Source object.
return: {Function} A hpq Matcher.

parseWithAttributeSchema(innerHTML, attributeSchema)   X-Ref
Given a block's raw content and an attribute's schema returns the attribute's
value depending on its source.

param: {string} innerHTML         Block's raw content.
param: {Object} attributeSchema   Attribute's schema.
return: {*} Attribute value.

getBlockAttribute(attributeKey, attributeSchema, innerHTML, commentAttributes)   X-Ref
Given an attribute key, an attribute's schema, a block's raw content and the
commentAttributes returns the attribute value depending on its source
definition of the given attribute key.

param: {string} attributeKey      Attribute key.
param: {Object} attributeSchema   Attribute's schema.
param: {string} innerHTML         Block's raw content.
param: {Object} commentAttributes Block's comment attributes.
return: {*} Attribute value.

getBlockAttributes(blockTypeOrName, innerHTML)   X-Ref
Returns the block attributes of a registered block node given its type.

param: {string|Object} blockTypeOrName Block type or name.
param: {string}        innerHTML       Raw block content.
param: {?Object}       attributes      Known block attributes (from delimiters).
return: {Object} All block attributes.

getMigratedBlock(block, parsedAttributes)   X-Ref
Given a block object, returns a new copy of the block with any applicable
deprecated migrations applied, or the original block if it was both valid
and no eligible migrations exist.

param: {WPBlock} block            Original block object.
param: {Object}  parsedAttributes Attributes as parsed from the initial
return: {WPBlock} Migrated block object.

createBlockWithFallback(blockNode)   X-Ref
Creates a block with fallback to the unknown type handler.

param: {Object} blockNode Parsed block node.
return: {?Object} An initialized block object (if possible).

serializeBlockNode(blockNode)   X-Ref
Serializes a block node into the native HTML-comment-powered block format.
CAVEAT: This function is intended for reserializing blocks as parsed by
valid parsers and skips any validation steps. This is NOT a generic
serialization function for in-memory blocks. For most purposes, see the
following functions available in the `@wordpress/blocks` package:

param: {Object}   blockNode                  A block node as returned by a valid parser.
param: {?Object}  options                    Serialization options.
param: {?boolean} options.isCommentDelimited Whether to output HTML comments around blocks.
return: {string} An HTML string representing a block.

getPhrasingContentSchema()   X-Ref
Get schema of possible paths for phrasing content.

return: {Object} Schema.

isPhrasingContent(node)   X-Ref
Find out whether or not the given node is phrasing content.

param: {Element} node The node to test.
return: {boolean} True if phrasing content, false if not.

getBlockContentSchema(transforms)   X-Ref
Given raw transforms from blocks, merges all schemas into one.

param: {Array} transforms Block transforms, of the `raw` type.
return: {Object} A complete block content schema.

isEmpty(element)   X-Ref
Recursively checks if an element is empty. An element is not empty if it
contains text or contains elements with attributes such as images.

param: {Element} element The element to check.
return: {boolean} Wether or not the element is empty.

isPlain(HTML)   X-Ref
Checks wether HTML can be considered plain text. That is, it does not contain
any elements that are not line breaks.

param: {string} HTML The HTML to check.
return: {boolean} Wether the HTML can be considered plain text.

deepFilterNodeList(nodeList, filters, doc, schema)   X-Ref
Given node filters, deeply filters and mutates a NodeList.

param: {NodeList} nodeList The nodeList to filter.
param: {Array}    filters  An array of functions that can mutate with the provided node.
param: {Document} doc      The document of the nodeList.
param: {Object}   schema   The schema to use.

deepFilterHTML(HTML)   X-Ref
Given node filters, deeply filters HTML tags.
Filters from the deepest nodes to the top.

param: {string} HTML    The HTML to filter.
param: {Array}  filters An array of functions that can mutate with the provided node.
param: {Object} schema  The schema to use.
return: {string} The filtered HTML.

cleanNodeList(nodeList, doc, schema, inline)   X-Ref
Given a schema, unwraps or removes nodes, attributes and classes on a node
list.

param: {NodeList} nodeList The nodeList to filter.
param: {Document} doc      The document of the nodeList.
param: {Object}   schema   An array of functions that can mutate with the provided node.
param: {Object}   inline   Whether to clean for inline mode.

removeInvalidHTML(HTML, schema, inline)   X-Ref
Given a schema, unwraps or removes nodes, attributes and classes on HTML.

param: {string} HTML   The HTML to clean up.
param: {Object} schema Schema for the HTML.
param: {Object} inline Whether to clean for inline mode.
return: {string} The cleaned up HTML.

createMore(customText, noTeaser, doc)   X-Ref
No description

createNextpage(doc)   X-Ref
No description

isList(node)   X-Ref
WordPress dependencies


shallowTextContent(element)   X-Ref
No description

isFigureContent(node, schema)   X-Ref
Whether or not the given node is figure content.

param: {Node}   node   The node to check.
param: {Object} schema The schema to use.
return: {boolean} True if figure content, false if not.

canHaveAnchor(node, schema)   X-Ref
Whether or not the given node can have an anchor.

param: {Node}   node   The node to check.
param: {Object} schema The schema to use.
return: {boolean} True if it can, false if not.

segmentHTMLToShortcodeBlock(HTML)   X-Ref
No description

isInline(node, contextTag)   X-Ref
No description

deepCheck(nodes, contextTag)   X-Ref
No description

isDoubleBR(node)   X-Ref
No description

ms_list_converter_isList(node)   X-Ref
No description

slackMarkdownVariantCorrector(text)   X-Ref
Corrects the Slack Markdown variant of the code block.
If uncorrected, it will be converted to inline code.

param: {string} text The potential Markdown text to correct.
return: {string} The corrected Markdown.

filterInlineHTML(HTML)   X-Ref
Filters HTML to only contain phrasing content.

param: {string} HTML The HTML to filter.
return: {string} HTML only containing phrasing content.

getRawTransformations()   X-Ref
No description

htmlToBlocks(_ref)   X-Ref
Converts HTML directly to blocks. Looks for a matching transform for each
top-level tag. The HTML should be filtered to not have any text between
top-level tags and formatted in a way that blocks can handle the HTML.

param: {Object} $1               Named parameters.
param: {string} $1.html          HTML to convert.
param: {Array}  $1.rawTransforms Transforms that can be used.
return: {Array} An array of blocks.

pasteHandler(_ref3)   X-Ref
Converts an HTML string to known blocks. Strips everything else.

param: {Object}  options
param: {string}  [options.HTML]                     The HTML to convert.
param: {string}  [options.plainText]                Plain text version.
param: {string}  [options.mode]                     Handle content as blocks or inline content.
param: {Array}   [options.tagName]                  The tag into which content will be inserted.
param: {boolean} [options.canUserUseUnfilteredHTML] Whether or not the user can use unfiltered HTML.
return: {Array|string} A list of blocks or a string, depending on `handlerMode`.

raw_handling_getRawTransformations()   X-Ref
No description

raw_handling_htmlToBlocks(_ref)   X-Ref
Converts HTML directly to blocks. Looks for a matching transform for each
top-level tag. The HTML should be filtered to not have any text between
top-level tags and formatted in a way that blocks can handle the HTML.

param: {Object} $1               Named parameters.
param: {string} $1.html          HTML to convert.
param: {Array}  $1.rawTransforms Transforms that can be used.
return: {Array} An array of blocks.

rawHandler(_ref3)   X-Ref
Converts an HTML string to known blocks.

param: {Object} $1
param: {string} $1.HTML The HTML to convert.
return: {Array} A list of blocks.

categories_getCategories()   X-Ref
Returns all the block categories.

return: {Object[]} Block categories.

categories_setCategories(categories)   X-Ref
Sets the block categories.

param: {Object[]} categories Block categories.

categories_updateCategory(slug, category)   X-Ref
Updates a category.

param: {string} slug          Block category slug.
param: {Object} category Object containing the category properties that should be updated.

doBlocksMatchTemplate()   X-Ref
Checks whether a list of blocks matches a template by comparing the block names.

param: {Array} blocks    Block list.
param: {Array} template  Block template.
return: {boolean}        Whether the list of blocks matches a templates

synchronizeBlocksWithTemplate()   X-Ref
Synchronize a block list with a block template.

Synchronizing a block list with a block template means that we loop over the blocks
keep the block as is if it matches the block at the same position in the template
(If it has the same name) and if doesn't match, we create a new block based on the template.
Extra blocks not present in the template are removed.

param: {Array} blocks    Block list.
param: {Array} template  Block template.
return: {Array}          Updated Block list.

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.

_arrayWithHoles(arr)   X-Ref
No description

_nonIterableRest()   X-Ref
No description

tinycolor(color, opts)   X-Ref
No description

inputToRGB(color)   X-Ref
No description

rgbToRgb(r, g, b)   X-Ref
No description

rgbToHsl(r, g, b)   X-Ref
No description

hslToRgb(h, s, l)   X-Ref
No description

hue2rgb(p, q, t)   X-Ref
No description

rgbToHsv(r, g, b)   X-Ref
No description

hsvToRgb(h, s, v)   X-Ref
No description

rgbToHex(r, g, b, allow3Char)   X-Ref
No description

rgbaToHex(r, g, b, a, allow4Char)   X-Ref
No description

rgbaToArgbHex(r, g, b, a)   X-Ref
No description

desaturate(color, amount)   X-Ref
No description

saturate(color, amount)   X-Ref
No description

greyscale(color)   X-Ref
No description

lighten(color, amount)   X-Ref
No description

brighten(color, amount)   X-Ref
No description

darken(color, amount)   X-Ref
No description

spin(color, amount)   X-Ref
No description

complement(color)   X-Ref
No description

triad(color)   X-Ref
No description

tetrad(color)   X-Ref
No description

splitcomplement(color)   X-Ref
No description

analogous(color, results, slices)   X-Ref
No description

monochromatic(color, results)   X-Ref
No description

flip(o)   X-Ref
No description

boundAlpha(a)   X-Ref
No description

bound01(n, max)   X-Ref
No description

clamp01(val)   X-Ref
No description

parseIntFromHex(val)   X-Ref
No description

isOnePointZero(n)   X-Ref
No description

isPercentage(n)   X-Ref
No description

pad2(c)   X-Ref
No description

convertToPercentage(n)   X-Ref
No description

convertDecimalToHex(d)   X-Ref
No description

convertHexToDecimal(h)   X-Ref
No description

isValidCSSUnit(color)   X-Ref
No description

stringInputToObject(color)   X-Ref
No description

validateWCAG2Parms(parms)   X-Ref
No description

v4(options, buf, offset)   X-Ref
No description

_objectSpread(target)   X-Ref
No description

bytesToUuid(buf, offset)   X-Ref
No description



Generated: Mon Nov 18 01:00:04 2019 Cross-referenced by PHPXref 0.7.1