[ Index ]

PHP Cross Reference of WordPress Trunk (Updated Daily)

Search

title

Body

[close]

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

(no description)

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

Defines 1 class

DecodeEntityParser:: (112 methods):
  getTextPiecesSplitOnWhitespace()
  getTextWithCollapsedWhitespace()
  getMeaningfulAttributePairs()
  isEquivalentTextTokens()
  getNormalizedLength()
  getNormalizedStyleValue()
  getStyleProperties()
  isEqualTagAttributePairs()
  getNextNonWhitespaceToken()
  getHTMLTokens()
  isClosedByToken()
  isEquivalentHTML()
  validateBlock()
  isValidBlockContent()
  convertLegacyBlockNameAndAttributes()
  getPath()
  parse()
  prop()
  attr()
  html()
  es_text()
  query()
  memize()
  memoized()
  matchers_html()
  isNodeOfType()
  getNamedNodeMapAsObject()
  fromDOM()
  toHTML()
  node_matcher()
  getSerializeCapableElement()
  getChildrenArray()
  concat()
  children_fromDOM()
  children_toHTML()
  children_matcher()
  isOfType()
  isOfTypes()
  getBlockAttribute()
  isValidByType()
  isValidByEnum()
  parseHtml()
  parseWithAttributeSchema()
  getBlockAttributes()
  getHTMLRootElementClasses()
  fixCustomClassname()
  applyBuiltInValidationFixes()
  stubFalse()
  applyBlockDeprecatedVersions()
  convertLegacyBlocks()
  normalizeRawBlock()
  createMissingBlockType()
  applyBlockValidation()
  parseRawBlock()
  parser_parse()
  getRawTransforms()
  htmlToBlocks()
  normaliseBlocks()
  specialCommentConverter()
  moreCommentConverter()
  createMore()
  createNextpage()
  isList()
  shallowTextContent()
  listReducer()
  blockquoteNormaliser()
  isFigureContent()
  canHaveAnchor()
  wrapFigureContent()
  figureContentReducer()
  segmentHTMLToShortcodeBlock()
  getBlockContentSchemaFromTransforms()
  mergeTagNameSchemaProperties()
  mergeTagNameSchemas()
  mergeSchemas()
  getBlockContentSchema()
  isPlain()
  deepFilterNodeList()
  deepFilterHTML()
  getSibling()
  deprecatedGetPhrasingContentSchema()
  rawHandler()
  commentRemover()
  isInline()
  deepCheck()
  isDoubleBR()
  isInlineContent()
  phrasingContentReducer()
  headRemover()
  msListIgnore()
  ms_list_converter_isList()
  msListConverter()
  imageCorrector()
  divNormaliser()
  slackMarkdownVariantCorrector()
  bulletsToAsterisks()
  markdownConverter()
  iframeRemover()
  googleDocsUIdRemover()
  isFormattingSpace()
  htmlFormattingRemover()
  brRemover()
  emptyParagraphRemover()
  slackParagraphCorrector()
  filterInlineHTML()
  pasteHandler()
  categories_getCategories()
  categories_setCategories()
  categories_updateCategory()
  doBlocksMatchTemplate()
  synchronizeBlocksWithTemplate()
  withBlockContentContext()

Defines 112 functions

  v()
  matcher()
  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()
  __webpack_require__()
  __extends()
  __()
  __rest()
  __decorate()
  __param()
  __esDecorate()
  accept()
  __runInitializers()
  __propKey()
  __setFunctionName()
  __metadata()
  __awaiter()
  adopt()
  fulfilled()
  rejected()
  step()
  __generator()
  verb()
  step()
  __exportStar()
  __values()
  __read()
  __spread()
  __spreadArrays()
  __spreadArray()
  __await()
  __asyncGenerator()
  verb()
  resume()
  step()
  fulfill()
  reject()
  settle()
  __asyncDelegator()
  verb()
  __asyncValues()
  verb()
  settle()
  __makeTemplateObject()
  __importStar()
  __importDefault()
  __classPrivateFieldGet()
  __classPrivateFieldSet()
  __classPrivateFieldIn()
  __addDisposableResource()
  __disposeResources()
  fail()
  next()
  localeLowerCase()
  lowerCase()
  noCase()
  replace()
  pascalCaseTransform()
  dist_es2015_pascalCaseTransformMerge()
  pascalCase()
  camelCaseTransform()
  camelCaseTransformMerge()
  camelCase()
  names()
  isObject()
  unstable__bootstrapServerSideBlockDefinitions()
  getBlockSettingsFromMetadata()
  registerBlockType()
  translateBlockSettingUsingI18nSchema()
  registerBlockCollection()
  unregisterBlockCollection()
  unregisterBlockType()
  setFreeformContentHandlerName()
  getFreeformContentHandlerName()
  getGroupingBlockName()
  setUnregisteredTypeHandlerName()
  getUnregisteredTypeHandlerName()
  setDefaultBlockName()
  setGroupingBlockName()
  getDefaultBlockName()
  getBlockType()
  getBlockTypes()
  getBlockSupport()
  hasBlockSupport()
  isReusableBlock()
  isTemplatePart()
  isUnmodifiedBlock()
  isUnmodifiedDefaultBlock()
  isValidIcon()
  normalizeIconObject()
  normalizeBlockType()
  getBlockLabel()
  getAccessibleBlockLabel()
  getDefault()
  __experimentalSanitizeBlockAttributes()
  __experimentalGetBlockAttributesNamesByRole()
  omit()
  keyBlockTypesByName()
  getUniqueItemsByName()
  bootstrappedBlockTypes()
  unprocessedBlockTypes()
  blockTypes()
  blockStyles()
  blockVariations()
  createBlockNameSetterReducer()
  categories()
  collections()
  blockBindingsSources()
  arrayOf()
  isObjectLike()
  createCache()
  isShallowEqual()
  rememo()
  getCache()
  clear()
  callSelector()
  selectors_getBlockType()
  getBlockStyles()
  getActiveBlockVariation()
  getDefaultBlockVariation()
  getCategories()
  getCollections()
  selectors_getDefaultBlockName()
  getFreeformFallbackBlockName()
  getUnregisteredFallbackBlockName()
  selectors_getGroupingBlockName()
  selectors_hasBlockSupport()
  isMatchingSearchTerm()
  filterElementBlockSupports()
  getBootstrappedBlockType()
  getUnprocessedBlockTypes()
  getAllBlockBindingsSources()
  getBlockBindingsSource()
  is_plain_object_isObject()
  isPlainObject()
  addBlockTypes()
  reapplyBlockTypeFilters()
  __experimentalReapplyBlockFilters()
  removeBlockTypes()
  addBlockStyles()
  removeBlockStyles()
  addBlockVariations()
  removeBlockVariations()
  actions_setDefaultBlockName()
  setFreeformFallbackBlockName()
  setUnregisteredFallbackBlockName()
  actions_setGroupingBlockName()
  setCategories()
  updateCategory()
  addBlockCollection()
  removeBlockCollection()
  addBootstrappedBlockType()
  addUnprocessedBlockType()
  registerBlockBindingsSource()
  rng()
  unsafeStringify()
  stringify()
  v4()
  createBlock()
  createBlocksFromInnerBlocksTemplate()
  __experimentalCloneSanitizedBlock()
  cloneBlock()
  getPossibleBlockTransformations()
  findTransform()
  getBlockTransforms()
  maybeCheckTransformIsMatch()
  switchToBlockType()
  serializeRawBlock()
  getBlockDefaultClassName()
  getBlockMenuDefaultClassName()
  getBlockProps()
  getInnerBlocksProps()
  getSaveElement()
  getSaveContent()
  getCommentAttributes()
  serializeAttributes()
  getBlockInnerHTML()
  getCommentDelimitedContent()
  serializeBlock()
  __unstableSerializeAndClean()
  serialize()
  EntityParser()
  isSpace()
  isAlpha()
  preprocessInput()
  EventedTokenizer()
  Tokenizer()
  tokenize()
  createLogger()
  createLogHandler()
  createQueuedLogger()
  isValidCharacterReference()

Class: DecodeEntityParser  - X-Ref

Subsitute EntityParser class for `simple-html-tokenizer` which uses the
implementation of `decodeEntities` from `html-entities`, in order to avoid
bundling a massive named character reference.

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, logger = createLogger()   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.

getNormalizedLength(value)   X-Ref
Given a CSS length value, returns a normalized CSS length value for strict equality
comparison.

param: {string} value CSS length value.
return: {string} Normalized CSS length value.

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, logger = createLogger()   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 | undefined} Next non-whitespace token.

getHTMLTokens(html, logger = createLogger()   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, logger = createLogger()   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.

validateBlock(block, blockTypeOrName = block.name)   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: {WPBlock}            block                          block object.
param: {WPBlockType|string} [blockTypeOrName = block.name] Block type or name, inferred from block if not given.
return: {[boolean,Array<LoggerItem>]} validation results.

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.

convertLegacyBlockNameAndAttributes(name, attributes)   X-Ref
Convert legacy blocks to their canonical form. This function is used
both in the parser level for previous content and to convert such blocks
used in Custom Post Types templates.

param: {string} name       The block's name
param: {Object} attributes The block's attributes
return: {[string, Object]} The block's name and attributes, changed accordingly if a match was found

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

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

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)

memize(fn, options)   X-Ref
Accepts a function to be memoized, and returns a new memoized function, with
optional options.

param: {F}             fn        Function to memoize.
param: {MemizeOptions} [options] Options object.
return: {((...args: Parameters<F>) => ReturnType<F>) & MemizeMemoizedFunction} Memoized function.

memoized()   X-Ref
No description

matchers_html(selector, multilineTag)   X-Ref
Internal dependencies


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.

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.

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.

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

param: {WPBlockChildren} children Block children object to convert.
return: {Element} 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(...blockNodes)   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.

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

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

isOfType(value, type)   X-Ref
Returns true if value is of the given JSON schema type, or false otherwise.

param: {*}      value Value to test.
param: {string} type  Type to test.
return: {boolean} Whether value is of type.

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.

getBlockAttribute(attributeKey, attributeSchema, innerDOM, commentAttributes, innerHTML)   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: {Node}   innerDOM          Parsed DOM of block's inner HTML.
param: {Object} commentAttributes Block's comment attributes.
param: {string} innerHTML         Raw HTML from block node's innerHTML property.
return: {*} Attribute value.

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.

parseHtml(innerHTML)   X-Ref
Parse a HTML string into DOM tree.

param: {string|Node} innerHTML HTML string or already parsed DOM node.
return: {Node} Parsed DOM node.

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|Node} innerHTML       Block's raw content.
param: {Object}      attributeSchema Attribute's schema.
return: {*} Attribute value.

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

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

getHTMLRootElementClasses(innerHTML)   X-Ref
Given an HTML string, returns an array of class names assigned to the root
element in the markup.

param: {string} innerHTML Markup string from which to extract classes.
return: {string[]} Array of class names assigned to the root element.

fixCustomClassname(blockAttributes, blockType, innerHTML)   X-Ref
Given a parsed set of block attributes, if the block supports custom class
names and an unknown class (per the block's serialization behavior) is
found, the unknown classes are treated as custom classes. This prevents the
block from being considered as invalid.

param: {Object} blockAttributes Original block attributes.
param: {Object} blockType       Block type settings.
param: {string} innerHTML       Original block markup.
return: {Object} Filtered block attributes.

applyBuiltInValidationFixes(block, blockType)   X-Ref
Attempts to fix block invalidation by applying build-in validation fixes
like moving all extra classNames to the className attribute.

param: {WPBlock}                               block     block object.
param: {import('../registration').WPBlockType} blockType Block type. This is normalize not necessary and
return: {WPBlock} Fixed block object

stubFalse()   X-Ref
Function that takes no arguments and always returns false.

return: {boolean} Always returns false.

applyBlockDeprecatedVersions(block, rawBlock, blockType)   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: {import(".").WPBlock}                   block     Parsed and invalid block object.
param: {import(".").WPRawBlock}                rawBlock  Raw block object.
param: {import('../registration').WPBlockType} blockType Block type. This is normalize not necessary and
return: {import(".").WPBlock} Migrated block object.

convertLegacyBlocks(rawBlock)   X-Ref
Convert legacy blocks to their canonical form. This function is used
both in the parser level for previous content and to convert such blocks
used in Custom Post Types templates.

param: {WPRawBlock} rawBlock
return: {WPRawBlock} The block's name and attributes, changed accordingly if a match was found

normalizeRawBlock(rawBlock, options)   X-Ref
Normalize the raw block by applying the fallback block name if none given,
sanitize the parsed HTML...

param: {WPRawBlock}    rawBlock The raw block object.
param: {ParseOptions?} options  Extra options for handling block parsing.
return: {WPRawBlock} The normalized block object.

createMissingBlockType(rawBlock)   X-Ref
Uses the "unregistered blockType" to create a block object.

param: {WPRawBlock} rawBlock block.
return: {WPRawBlock} The unregistered block object.

applyBlockValidation(unvalidatedBlock, blockType)   X-Ref
Validates a block and wraps with validation meta.

The name here is regrettable but `validateBlock` is already taken.

param: {WPBlock}                               unvalidatedBlock
param: {import('../registration').WPBlockType} blockType
return: {WPBlock}                              validated block, with auto-fixes if initially invalid

parseRawBlock(rawBlock, options)   X-Ref
Given a raw block returned by grammar parsing, returns a fully parsed block.

param: {WPRawBlock}   rawBlock The raw block object.
param: {ParseOptions} options  Extra options for handling block parsing.
return: {WPBlock | undefined} Fully parsed block.

parser_parse(content, options)   X-Ref
Utilizes an optimized token-driven parser based on the Gutenberg grammar spec
defined through a parsing expression grammar to take advantage of the regular
cadence provided by block delimiters -- composed syntactically through HTML
comments -- which, given a general HTML document as an input, returns a block
list array representation.

This is a recursive-descent parser that scans linearly once through the input
document. Instead of directly recursing it utilizes a trampoline mechanism to
prevent stack overflow. This initial pass is mainly interested in separating
and isolating the blocks serialized in the document and manifestly not in the
content within the blocks.

param: {string}       content The post content.
param: {ParseOptions} options Extra options for handling block parsing.
return: {Array} Block list.

getRawTransforms()   X-Ref
Internal dependencies


htmlToBlocks(html, handler)   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: {string}   html    HTML to convert.
param: {Function} handler The handler calling htmlToBlocks: either rawHandler
return: {Array} An array of blocks.

normaliseBlocks(HTML)   X-Ref
WordPress dependencies


specialCommentConverter(node, doc)   X-Ref
Looks for `<!--nextpage-->` and `<!--more-->` comments and
replaces them with a custom element representing a future block.

The custom element is a way to bypass the rest of the `raw-handling`
transforms, which would eliminate other kinds of node with which to carry
`<!--more-->`'s data: nodes with `data` attributes, empty paragraphs, etc.

The custom element is then expected to be recognized by any registered
block's `raw` transform.

param: {Node}     node The node to be processed.
param: {Document} doc  The document of the node.
return: {void}

moreCommentConverter(node, doc)   X-Ref
Convert `<!--more-->` as well as the `<!--more Some text-->` variant
and its `<!--noteaser-->` companion into the custom element
described in `specialCommentConverter()`.

param: {Node}     node The node to be processed.
param: {Document} doc  The document of the node.
return: {void}

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

listReducer(node)   X-Ref
No description

blockquoteNormaliser(node)   X-Ref
Internal dependencies


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.

wrapFigureContent(element, beforeElement = element)   X-Ref
Wraps the given element in a figure element.

param: {Element} element       The element to wrap.
param: {Element} beforeElement The element before which to place the figure.

figureContentReducer(node, doc, schema)   X-Ref
This filter takes figure content out of paragraphs, wraps it in a figure
element, and moves any anchors with it if needed.

param: {Node}     node   The node to filter.
param: {Document} doc    The document of the node.
param: {Object}   schema The schema to use.
return: {void}

segmentHTMLToShortcodeBlock(HTML, lastIndex = 0, excludedBlockNames = [])   X-Ref
No description

getBlockContentSchemaFromTransforms(transforms, context)   X-Ref
Internal dependencies


mergeTagNameSchemaProperties(objValue, srcValue, key)   X-Ref
No description

mergeTagNameSchemas(a, b)   X-Ref
No description

mergeSchemas(a, b)   X-Ref
No description

getBlockContentSchema(context)   X-Ref
Gets the block content schema, which is extracted and merged from all
registered blocks with raw transfroms.

param: {string} context Set to "paste" when in paste context, where the
return: {Object} A complete block content schema.

isPlain(HTML)   X-Ref
Checks whether 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} Whether 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, filters = [], schema)   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.

getSibling(node, which)   X-Ref
Gets a sibling within text-level context.

param: {Element} node  The subject node.
param: {string}  which "next" or "previous".

deprecatedGetPhrasingContentSchema(context)   X-Ref
No description

rawHandler({HTML = ''})   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.

commentRemover(node)   X-Ref
Looks for comments, and removes them.

param: {Node} node The node to be processed.
return: {void}

isInline(node, contextTag)   X-Ref
Checks if the given node should be considered inline content, optionally
depending on a context tag.

param: {Node}   node       Node name.
param: {string} contextTag Tag name.
return: {boolean} True if the node is inline content, false if nohe.

deepCheck(nodes, contextTag)   X-Ref
No description

isDoubleBR(node)   X-Ref
No description

isInlineContent(HTML, contextTag)   X-Ref
No description

phrasingContentReducer(node, doc)   X-Ref
WordPress dependencies


headRemover(node)   X-Ref
No description

msListIgnore(node)   X-Ref
Looks for comments, and removes them.

param: {Node} node The node to be processed.
return: {void}

ms_list_converter_isList(node)   X-Ref
Internal dependencies


msListConverter(node, doc)   X-Ref
No description

imageCorrector(node)   X-Ref
WordPress dependencies


divNormaliser(node)   X-Ref
Internal dependencies


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.

bulletsToAsterisks(text)   X-Ref
No description

markdownConverter(text)   X-Ref
Converts a piece of text into HTML based on any Markdown present.
Also decodes any encoded HTML.

param: {string} text The plain text to convert.
return: {string} HTML.

iframeRemover(node)   X-Ref
Removes iframes.

param: {Node} node The node to check.
return: {void}

googleDocsUIdRemover(node)   X-Ref
WordPress dependencies


isFormattingSpace(character)   X-Ref
Internal dependencies


htmlFormattingRemover(node)   X-Ref
Removes spacing that formats HTML.

param: {Node} node The node to be processed.
return: {void}

brRemover(node)   X-Ref
Removes trailing br elements from text-level content.

param: {Element} node Node to check.

emptyParagraphRemover(node)   X-Ref
Removes empty paragraph elements.

param: {Element} node Node to check.

slackParagraphCorrector(node)   X-Ref
Replaces Slack paragraph markup with a double line break (later converted to
a proper paragraph).

param: {Element} node Node to check.

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.

pasteHandler({HTML = '',plainText = '',mode = 'AUTO',tagName})   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.
return: {Array|string} A list of blocks or a string, depending on `handlerMode`.

categories_getCategories()   X-Ref
Returns all the block categories.
Ignored from documentation as the recommended usage is via useSelect from @wordpress/data.

return: {WPBlockCategory[]} Block categories.

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

param: {WPBlockCategory[]} categories Block categories.

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

param: {string}          slug     Block category slug.
param: {WPBlockCategory} category Object containing the category properties

doBlocksMatchTemplate(blocks = [], template = [])   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(blocks = [], template)   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.

withBlockContentContext(OriginalComponent)   X-Ref
A Higher Order Component used to inject BlockContent using context to the
wrapped component.

param: {Component} OriginalComponent The component to enhance.
return: {Component} The same component.

Functions
Functions that are not part of a class:

v(a)   X-Ref


matcher(match)   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

__webpack_require__(moduleId)   X-Ref
No description

__extends(d, b)   X-Ref
No description

__()   X-Ref
No description

__rest(s, e)   X-Ref
No description

__decorate(decorators, target, key, desc)   X-Ref
No description

__param(paramIndex, decorator)   X-Ref
No description

__esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers)   X-Ref
No description

accept(f)   X-Ref
No description

__runInitializers(thisArg, initializers, value)   X-Ref
No description

__propKey(x)   X-Ref
No description

__setFunctionName(f, name, prefix)   X-Ref
No description

__metadata(metadataKey, metadataValue)   X-Ref
No description

__awaiter(thisArg, _arguments, P, generator)   X-Ref
No description

adopt(value)   X-Ref
No description

fulfilled(value)   X-Ref
No description

rejected(value)   X-Ref
No description

step(result)   X-Ref
No description

__generator(thisArg, body)   X-Ref
No description

verb(n)   X-Ref
No description

step(op)   X-Ref
No description

__exportStar(m, o)   X-Ref
No description

__values(o)   X-Ref
No description

__read(o, n)   X-Ref
No description

__spread()   X-Ref
No description

__spreadArrays()   X-Ref
No description

__spreadArray(to, from, pack)   X-Ref
No description

__await(v)   X-Ref
No description

__asyncGenerator(thisArg, _arguments, generator)   X-Ref
No description

verb(n)   X-Ref
No description

resume(n, v)   X-Ref
No description

step(r)   X-Ref
No description

fulfill(value)   X-Ref
No description

reject(value)   X-Ref
No description

settle(f, v)   X-Ref
No description

__asyncDelegator(o)   X-Ref
No description

verb(n, f)   X-Ref
No description

__asyncValues(o)   X-Ref
No description

verb(n)   X-Ref
No description

settle(resolve, reject, d, v)   X-Ref
No description

__makeTemplateObject(cooked, raw)   X-Ref
No description

__importStar(mod)   X-Ref
No description

__importDefault(mod)   X-Ref
No description

__classPrivateFieldGet(receiver, state, kind, f)   X-Ref
No description

__classPrivateFieldSet(receiver, state, value, kind, f)   X-Ref
No description

__classPrivateFieldIn(state, receiver)   X-Ref
No description

__addDisposableResource(env, value, async)   X-Ref
No description

__disposeResources(env)   X-Ref
No description

fail(e)   X-Ref
No description

next()   X-Ref
No description

localeLowerCase(str, locale)   X-Ref
Localized lower case.


lowerCase(str)   X-Ref
Lower case as a function.


noCase(input, options)   X-Ref
Normalize the string into something other libraries can manipulate easier.


replace(input, re, value)   X-Ref
Replace `re` in the input string with the replacement value.


pascalCaseTransform(input, index)   X-Ref
No description

dist_es2015_pascalCaseTransformMerge(input)   X-Ref
No description

pascalCase(input, options)   X-Ref
No description

camelCaseTransform(input, index)   X-Ref
No description

camelCaseTransformMerge(input, index)   X-Ref
No description

camelCase(input, options)   X-Ref
No description

names(e,f)   X-Ref
No description

isObject(object)   X-Ref
Defined behavior of a block type.


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

param: {Object} definitions Server-side block definitions

getBlockSettingsFromMetadata({textdomain,...metadata})   X-Ref
Gets block settings from metadata loaded from `block.json` file.

param: {Object} metadata            Block metadata loaded from `block.json`.
param: {string} metadata.textdomain Textdomain to use with translations.
return: {Object} Block settings.

registerBlockType(blockNameOrMetadata, 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.

For more in-depth information on registering a custom block see the
[Create a block tutorial](https://developer.wordpress.org/block-editor/getting-started/create-block/).

param: {string|Object} blockNameOrMetadata Block type name or its metadata.
param: {Object}        settings            Block settings.
return: {WPBlockType | undefined} The block, if it has been successfully registered;

translateBlockSettingUsingI18nSchema(i18nSchema, settingValue, textdomain)   X-Ref
Translates block settings provided with metadata using the i18n schema.

param: {string|string[]|Object[]} i18nSchema   I18n schema for the block setting.
param: {string|string[]|Object[]} settingValue Value for the block setting.
param: {string}                   textdomain   Textdomain to use with translations.
return: {string|string[]|Object[]} Translated setting.

registerBlockCollection(namespace, {title,icon})   X-Ref
Registers a new block collection to group blocks in the same namespace in the inserter.

param: {string} namespace       The namespace to group blocks by in the inserter; corresponds to the block namespace.
param: {Object} settings        The block collection settings.
param: {string} settings.title  The title to display in the block inserter.
param: {Object} [settings.icon] The icon to display in the block inserter.

unregisterBlockCollection(namespace)   X-Ref
Unregisters a block collection

param: {string} namespace The namespace to group blocks by in the inserter; corresponds to the block namespace

unregisterBlockType(name)   X-Ref
Unregisters a block.

param: {string} name Block name.
return: {WPBlockType | undefined} 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.

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.

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

param: {string} name Block name.

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

This function lets you select a different block to group other blocks in instead of the
default `core/group` block. This function must be used in a component or when the DOM is fully
loaded. See https://developer.wordpress.org/block-editor/reference-guides/packages/packages-dom-ready/

param: {string} name Block name.

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

return: {?string} Block name.

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

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

getBlockTypes()   X-Ref
Returns all registered blocks.

return: {Array} Block settings.

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

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.

isTemplatePart(blockOrType)   X-Ref
Determines whether or not the given block is a template part. This is a
special block type that allows composing a page template out of reusable
design elements.

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

isUnmodifiedBlock(block)   X-Ref
Determines whether the block's 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 block.

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.

getBlockLabel(blockType, attributes, context = 'visual')   X-Ref
Get the label for the block, usually this is either the block title,
or the value of the block's `label` function when that's specified.

param: {Object} blockType  The block type.
param: {Object} attributes The values of the block's attributes.
param: {Object} context    The intended use for the label.
return: {string} The block label.

getAccessibleBlockLabel(blockType, attributes, position, direction = 'vertical')   X-Ref
Get a label for the block for use by screenreaders, this is more descriptive
than the visual label and includes the block title and the value of the
`getLabel` function if it's specified.

param: {?Object} blockType              The block type.
param: {Object}  attributes             The values of the block's attributes.
param: {?number} position               The position of the block in the block list.
param: {string}  [direction='vertical'] The direction of the block layout.
return: {string} The block label.

getDefault(attributeSchema)   X-Ref
No description

__experimentalSanitizeBlockAttributes(name, attributes)   X-Ref
Ensure attributes contains only values defined by block type, and merge
default values for missing attributes.

param: {string} name       The block's name.
param: {Object} attributes The block's attributes.
return: {Object} The sanitized attributes.

__experimentalGetBlockAttributesNamesByRole(name, role)   X-Ref
Filter block attributes by `role` and return their names.

param: {string} name Block attribute's name.
param: {string} role The role of a block attribute.
return: {string[]} The attribute names that have the provided role.

omit(object, keys)   X-Ref
Return a new object with the specified keys omitted.

param: {Object} object Original object.
param: {Array}  keys   Keys to be omitted.
return: {Object} Object with omitted keys.

keyBlockTypesByName(types)   X-Ref
No description

getUniqueItemsByName(items)   X-Ref
No description

bootstrappedBlockTypes(state = {}, action)   X-Ref
No description

unprocessedBlockTypes(state = {}, action)   X-Ref
Reducer managing the unprocessed block types in a form passed when registering the by block.
It's for internal use only. It allows recomputing the processed block types on-demand after block type filters
get added or removed.

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

blockTypes(state = {}, action)   X-Ref
Reducer managing the processed block types with all filters applied.
The state is derived from the `unprocessedBlockTypes` reducer.

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

blockStyles(state = {}, action)   X-Ref
Reducer managing the block styles.

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

blockVariations(state = {}, action)   X-Ref
Reducer managing the block 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.

categories(state = DEFAULT_CATEGORIES, action)   X-Ref
Reducer managing the categories

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

collections(state = {}, action)   X-Ref
No description

blockBindingsSources(state = {}, action)   X-Ref
No description

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

param: {T} value Value to return.
return: {[T]} 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: {Cache} 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: {*[]} a First array.
param: {*[]} b Second array.
param: {number} fromIndex Index from which to start comparison.
return: {boolean} Whether arrays are shallowly equal.

rememo(selector, getDependants)   X-Ref
Returns a memoized selector function. The getDependants function argument is
called before the memoized selector and is expected to return an immutable
reference or array of references on which the selector depends for computing
its own return value. The memoize cache is preserved only as long as those
dependant references remain the same. If getDependants returns a different
reference(s), the cache is cleared and the selector value regenerated.

param: {S} selector Selector function.
param: {GetDependants=} getDependants Dependant getter returning an array of

getCache(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: {*[]} dependants Selector dependants.
return: {Cache} 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: {*}    source    Source object for derivation.
param: {...*} extraArgs Additional arguments to pass to selector.
return: {*} Selector result.

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

getActiveBlockVariation(state, blockName, attributes, scope)   X-Ref
Returns the active block variation for a given block based on its attributes.
Variations are determined by their `isActive` property.
Which is either an array of block attribute keys or a function.

In case of an array of block attribute keys, the `attributes` are compared
to the variation's attributes using strict equality check.

In case of function type, the function should accept a block's attributes
and the variation's attributes and determines if a variation is active.
A function that accepts a block's attributes and the variation's attributes and determines if a variation is active.

param: {Object}                state      Data state.
param: {string}                blockName  Name of block (example: “core/columns”).
param: {Object}                attributes Block attributes used to determine active variation.
param: {WPBlockVariationScope} [scope]    Block variation scope name.
return: {(WPBlockVariation|undefined)} Active block variation.

getDefaultBlockVariation(state, blockName, scope)   X-Ref
Returns the default block variation for the given block type.
When there are multiple variations annotated as the default one,
the last added item is picked. This simplifies registering overrides.
When there is no default variation set, it returns the first item.

param: {Object}                state     Data state.
param: {string}                blockName Block type name.
param: {WPBlockVariationScope} [scope]   Block variation scope name.
return: {?WPBlockVariation} The default block variation.

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

param: {Object} state Data state.
return: {WPBlockCategory[]} Categories list.

getCollections(state)   X-Ref
Returns all the available collections.

param: {Object} state Data state.
return: {Object} Collections list.

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

selectors_getGroupingBlockName(state)   X-Ref
Returns the name of the block for handling the grouping of blocks.

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

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

filterElementBlockSupports(blockSupports, name, element)   X-Ref
Filters the list of supported styles for a given element.

param: {string[]}         blockSupports list of supported styles.
param: {string|undefined} name          block name.
param: {string|undefined} element       element name.
return: {string[]} filtered list of supported styles.

getBootstrappedBlockType(state, name)   X-Ref
Returns the bootstrapped block type metadata for a give block name.

param: {Object} state Data state.
param: {string} name  Block name.
return: {Object} Bootstrapped block type metadata for a block.

getUnprocessedBlockTypes(state)   X-Ref
Returns all the unprocessed (before applying the `registerBlockType` filter)
block type settings as passed during block registration.

param: {Object} state Data state.
return: {Array} Unprocessed block type settings for all blocks.

getAllBlockBindingsSources(state)   X-Ref
Returns all the block bindings sources registered.

param: {Object} state Data state.
return: {Object} All the registered sources and their properties.

getBlockBindingsSource(state, sourceName)   X-Ref
Returns a specific block bindings source.

param: {Object} state      Data state.
param: {string} sourceName Name of the source to get.
return: {Object} The specific block binding source and its properties.

is_plain_object_isObject(o)   X-Ref
No description

isPlainObject(o)   X-Ref
No description

addBlockTypes(blockTypes)   X-Ref
Returns an action object used in signalling that block types have been added.
Ignored from documentation as the recommended usage for this action through registerBlockType from @wordpress/blocks.

param: {WPBlockType|WPBlockType[]} blockTypes Object or array of objects representing blocks to added.
return: {Object} Action object.

reapplyBlockTypeFilters()   X-Ref
Signals that all block types should be computed again.
It uses stored unprocessed block types and all the most recent list of registered filters.

It addresses the issue where third party block filters get registered after third party blocks. A sample sequence:
1. Filter A.
2. Block B.
3. Block C.
4. Filter D.
5. Filter E.
6. Block F.
7. Filter G.
In this scenario some filters would not get applied for all blocks because they are registered too late.

__experimentalReapplyBlockFilters()   X-Ref
No description

removeBlockTypes(names)   X-Ref
Returns an action object used to remove a registered block type.
Ignored from documentation as the recommended usage for this action through unregisterBlockType from @wordpress/blocks.

param: {string|string[]} names Block name or array of block names to be removed.
return: {Object} Action object.

addBlockStyles(blockName, styles)   X-Ref
Returns an action object used in signalling that new block styles have been added.
Ignored from documentation as the recommended usage for this action through registerBlockStyle from @wordpress/blocks.

param: {string}       blockName Block name.
param: {Array|Object} styles    Block style object or array of block style objects.
return: {Object} Action object.

removeBlockStyles(blockName, styleNames)   X-Ref
Returns an action object used in signalling that block styles have been removed.
Ignored from documentation as the recommended usage for this action through unregisterBlockStyle from @wordpress/blocks.

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

addBlockVariations(blockName, variations)   X-Ref
Returns an action object used in signalling that new block variations have been added.
Ignored from documentation as the recommended usage for this action through registerBlockVariation from @wordpress/blocks.

param: {string}                              blockName  Block name.
param: {WPBlockVariation|WPBlockVariation[]} variations Block variations.
return: {Object} Action object.

removeBlockVariations(blockName, variationNames)   X-Ref
Returns an action object used in signalling that block variations have been removed.
Ignored from documentation as the recommended usage for this action through unregisterBlockVariation from @wordpress/blocks.

param: {string}          blockName      Block name.
param: {string|string[]} variationNames Block variation names.
return: {Object} Action object.

actions_setDefaultBlockName(name)   X-Ref
Returns an action object used to set the default block name.
Ignored from documentation as the recommended usage for this action through setDefaultBlockName from @wordpress/blocks.

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.
Ignored from documentation as the recommended usage for this action through setFreeformContentHandlerName from @wordpress/blocks.

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.
Ignored from documentation as the recommended usage for this action through setUnregisteredTypeHandlerName from @wordpress/blocks.

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

actions_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
Ignored from documentation as the recommended usage for this action through setGroupingBlockName from @wordpress/blocks.

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

setCategories(categories)   X-Ref
Returns an action object used to set block categories.
Ignored from documentation as the recommended usage for this action through setCategories from @wordpress/blocks.

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

updateCategory(slug, category)   X-Ref
Returns an action object used to update a category.
Ignored from documentation as the recommended usage for this action through updateCategory from @wordpress/blocks.

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

addBlockCollection(namespace, title, icon)   X-Ref
Returns an action object used to add block collections
Ignored from documentation as the recommended usage for this action through registerBlockCollection from @wordpress/blocks.

param: {string} namespace The namespace of the blocks to put in the collection
param: {string} title     The title to display in the block inserter
param: {Object} icon      (optional) The icon to display in the block inserter
return: {Object} Action object.

removeBlockCollection(namespace)   X-Ref
Returns an action object used to remove block collections
Ignored from documentation as the recommended usage for this action through unregisterBlockCollection from @wordpress/blocks.

param: {string} namespace The namespace of the blocks to put in the collection
return: {Object} Action object.

addBootstrappedBlockType(name, blockType)   X-Ref
Add bootstrapped block type metadata to the store. These metadata usually come from
the `block.json` file and are either statically boostrapped from the server, or
passed as the `metadata` parameter to the `registerBlockType` function.

param: {string}      name      Block name.
param: {WPBlockType} blockType Block type metadata.

addUnprocessedBlockType(name, blockType)   X-Ref
Add unprocessed block type settings to the store. These data are passed as the
`settings` parameter to the client-side `registerBlockType` function.

param: {string}      name      Block name.
param: {WPBlockType} blockType Unprocessed block type settings.

registerBlockBindingsSource(source)   X-Ref
Register new block bindings source.

param: {string} source Name of the source to register.

rng()   X-Ref
No description

unsafeStringify(arr, offset = 0)   X-Ref
No description

stringify(arr, offset = 0)   X-Ref
No description

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

createBlock(name, attributes = {}, innerBlocks = [])   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.

createBlocksFromInnerBlocksTemplate(innerBlocksOrTemplate = [])   X-Ref
Given an array of InnerBlocks templates or Block Objects,
returns an array of created Blocks from them.
It handles the case of having InnerBlocks as Blocks by
converting them to the proper format to continue recursively.

param: {Array} innerBlocksOrTemplate Nested blocks or InnerBlocks templates.
return: {Object[]} Array of Block objects.

__experimentalCloneSanitizedBlock(block, mergeAttributes = {}, newInnerBlocks)   X-Ref
Given a block object, returns a copy of the block object while sanitizing its attributes,
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.

cloneBlock(block, mergeAttributes = {}, newInnerBlocks)   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.

maybeCheckTransformIsMatch(transform, blocks)   X-Ref
Checks that a given transforms isMatch method passes for given source blocks.

param: {Object} transform A transform object.
param: {Array}  blocks    Blocks array.
return: {boolean} True if given blocks are a match for the transform.

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.

serializeRawBlock(rawBlock, options = {})   X-Ref
Serializes a block node into the native HTML-comment-powered block format.
CAVEAT: This function is intended for re-serializing 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: {WPRawBlock} rawBlock     A block node as returned by a valid parser.
param: {Options}    [options={}] Serialization options.
return: {string} An HTML string representing a block.

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.

getBlockProps(props = {})   X-Ref
Call within a save function to get the props for the block wrapper.

param: {Object} props Optional. Props to pass to the element.

getInnerBlocksProps(props = {})   X-Ref
Call within a save function to get the props for the inner blocks wrapper.

param: {Object} props Optional. Props to pass to the element.

getSaveElement(blockTypeOrName, attributes, innerBlocks = [])   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.

getBlockInnerHTML(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, {isInnerBlocks = false} = {})   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: {WPBlock}                     block   Block instance.
param: {WPBlockSerializationOptions} options Serialization options.
return: {string} Serialized block.

__unstableSerializeAndClean(blocks)   X-Ref
No description

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.

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, mode)   X-Ref
No description

Tokenizer(entityParser, options)   X-Ref
No description

tokenize(input, options)   X-Ref
No description

createLogger()   X-Ref


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

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.



Generated : Tue Mar 19 08:20:01 2024 Cross-referenced by PHPXref