From 557dca70db5c163fa4bc400fc26e0aa64ad47ad3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s?= Date: Wed, 27 Mar 2019 11:17:33 +0100 Subject: [PATCH] Remove/docgen url symbol (#14656) It suffers from a few problems: - relative URLs don't work on Gutenberg handbook and npm packages - the <> is escaped so is rendered in a weird way that looks like an error --- packages/a11y/README.md | 4 +- packages/autop/README.md | 4 +- packages/blob/README.md | 8 +- packages/block-editor/README.md | 112 +++++++++--------- packages/block-library/README.md | 2 +- .../README.md | 2 +- packages/blocks/README.md | 96 +++++++-------- packages/compose/README.md | 16 +-- packages/data/README.md | 32 ++--- packages/date/README.md | 14 +-- packages/deprecated/README.md | 4 +- packages/docgen/src/markdown/formatter.js | 19 +-- .../docgen/src/test/formatter-markdown.js | 2 +- packages/dom-ready/README.md | 2 +- packages/dom/README.md | 36 +++--- packages/e2e-test-utils/README.md | 110 ++++++++--------- packages/edit-post/README.md | 18 +-- packages/element/README.md | 62 +++++----- packages/escape-html/README.md | 12 +- packages/html-entities/README.md | 2 +- packages/i18n/README.md | 12 +- packages/keycodes/README.md | 42 +++---- packages/plugins/README.md | 12 +- packages/priority-queue/README.md | 2 +- packages/redux-routine/README.md | 2 +- packages/rich-text/README.md | 40 +++---- packages/shortcode/README.md | 14 +-- packages/url/README.md | 38 +++--- packages/viewport/README.md | 4 +- packages/wordcount/README.md | 2 +- 30 files changed, 356 insertions(+), 369 deletions(-) diff --git a/packages/a11y/README.md b/packages/a11y/README.md index b4f3f0018158d..a45253197e7e6 100644 --- a/packages/a11y/README.md +++ b/packages/a11y/README.md @@ -16,11 +16,11 @@ _This package assumes that your code will run in an **ES2015+** environment. If -# **setup** [\<>](src/index.js#L16-L26) +# **setup** Create the live regions. -# **speak** [\<>](src/index.js#L52-L66) +# **speak** Allows you to easily announce dynamic interface updates to screen readers using ARIA live regions. This module is inspired by the `speak` function in wp-a11y.js diff --git a/packages/autop/README.md b/packages/autop/README.md index 3288ccf9eb5f0..882affe18946e 100644 --- a/packages/autop/README.md +++ b/packages/autop/README.md @@ -16,7 +16,7 @@ _This package assumes that your code will run in an **ES2015+** environment. If -# **autop** [\<>](src/index.js#L129-L285) +# **autop** Replaces double line-breaks with paragraph elements. @@ -40,7 +40,7 @@ _Returns_ - `string`: Text which has been converted into paragraph tags. -# **removep** [\<>](src/index.js#L303-L426) +# **removep** Replaces `

` tags with two line breaks. "Opposite" of autop(). diff --git a/packages/blob/README.md b/packages/blob/README.md index 4d94b85d8d14e..dfb1971f423f4 100644 --- a/packages/blob/README.md +++ b/packages/blob/README.md @@ -14,7 +14,7 @@ npm install @wordpress/blob --save -# **createBlobURL** [\<>](src/index.js#L15-L21) +# **createBlobURL** Create a blob URL from a file. @@ -26,7 +26,7 @@ _Returns_ - `string`: The blob URL. -# **getBlobByURL** [\<>](src/index.js#L32-L34) +# **getBlobByURL** Retrieve a file based on a blob URL. The file must have been created by `createBlobURL` and not removed by `revokeBlobURL`, otherwise it will return @@ -40,7 +40,7 @@ _Returns_ - `?File`: The file for the blob URL. -# **isBlobURL** [\<>](src/index.js#L56-L61) +# **isBlobURL** Check whether a url is a blob url. @@ -52,7 +52,7 @@ _Returns_ - `boolean`: Is the url a blob url? -# **revokeBlobURL** [\<>](src/index.js#L41-L47) +# **revokeBlobURL** Remove the resource and file cache from memory. diff --git a/packages/block-editor/README.md b/packages/block-editor/README.md index 4722cfa49e448..d96fbbd9331f2 100644 --- a/packages/block-editor/README.md +++ b/packages/block-editor/README.md @@ -68,91 +68,91 @@ registerCoreBlockTypes(); -# **AlignmentToolbar** [\<>](src/index.js#L15-L15) +# **AlignmentToolbar** Undocumented declaration. -# **Autocomplete** [\<>](src/index.js#L15-L15) +# **Autocomplete** Undocumented declaration. -# **BlockAlignmentToolbar** [\<>](src/index.js#L15-L15) +# **BlockAlignmentToolbar** Undocumented declaration. -# **BlockControls** [\<>](src/index.js#L15-L15) +# **BlockControls** Undocumented declaration. -# **BlockEdit** [\<>](src/index.js#L15-L15) +# **BlockEdit** Undocumented declaration. -# **BlockEditorKeyboardShortcuts** [\<>](src/index.js#L15-L15) +# **BlockEditorKeyboardShortcuts** Undocumented declaration. -# **BlockEditorProvider** [\<>](src/index.js#L15-L15) +# **BlockEditorProvider** Undocumented declaration. -# **BlockFormatControls** [\<>](src/index.js#L15-L15) +# **BlockFormatControls** Undocumented declaration. -# **BlockIcon** [\<>](src/index.js#L15-L15) +# **BlockIcon** Undocumented declaration. -# **BlockInspector** [\<>](src/index.js#L15-L15) +# **BlockInspector** Undocumented declaration. -# **BlockList** [\<>](src/index.js#L15-L15) +# **BlockList** Undocumented declaration. -# **BlockMover** [\<>](src/index.js#L15-L15) +# **BlockMover** Undocumented declaration. -# **BlockNavigationDropdown** [\<>](src/index.js#L15-L15) +# **BlockNavigationDropdown** Undocumented declaration. -# **BlockSelectionClearer** [\<>](src/index.js#L15-L15) +# **BlockSelectionClearer** Undocumented declaration. -# **BlockSettingsMenu** [\<>](src/index.js#L15-L15) +# **BlockSettingsMenu** Undocumented declaration. -# **BlockTitle** [\<>](src/index.js#L15-L15) +# **BlockTitle** Undocumented declaration. -# **BlockToolbar** [\<>](src/index.js#L15-L15) +# **BlockToolbar** Undocumented declaration. -# **BlockVerticalAlignmentToolbar** [\<>](src/index.js#L15-L15) +# **BlockVerticalAlignmentToolbar** Undocumented declaration. -# **ColorPalette** [\<>](src/index.js#L15-L15) +# **ColorPalette** Undocumented declaration. -# **ContrastChecker** [\<>](src/index.js#L15-L15) +# **ContrastChecker** Undocumented declaration. -# **CopyHandler** [\<>](src/index.js#L15-L15) +# **CopyHandler** Undocumented declaration. -# **createCustomColorsHOC** [\<>](src/index.js#L15-L15) +# **createCustomColorsHOC** A higher-order component factory for creating a 'withCustomColors' HOC, which handles color logic for class generation color value, retrieval and color attribute setting. @@ -179,15 +179,15 @@ _Returns_ - `Function`: Higher-order component. -# **DefaultBlockAppender** [\<>](src/index.js#L15-L15) +# **DefaultBlockAppender** Undocumented declaration. -# **FontSizePicker** [\<>](src/index.js#L15-L15) +# **FontSizePicker** Undocumented declaration. -# **getColorClassName** [\<>](src/index.js#L15-L15) +# **getColorClassName** Returns a class based on the context a color is being used and its slug. @@ -200,7 +200,7 @@ _Returns_ - `string`: String with the class corresponding to the color in the provided context. -# **getColorObjectByAttributeValues** [\<>](src/index.js#L15-L15) +# **getColorObjectByAttributeValues** Provided an array of color objects as set by the theme or by the editor defaults, and the values of the defined color or custom color returns a color object describing the color. @@ -215,7 +215,7 @@ _Returns_ - `?string`: If definedColor is passed and the name is found in colors, the color object exactly as set by the theme or editor defaults is returned. Otherwise, an object that just sets the color is defined. -# **getColorObjectByColorValue** [\<>](src/index.js#L15-L15) +# **getColorObjectByColorValue** Provided an array of color objects as set by the theme or by the editor defaults, and a color value returns the color object matching that value or undefined. @@ -228,7 +228,7 @@ _Returns_ - `?string`: Returns the color object included in the colors array whose color property equals colorValue. Returns undefined if no color object matches this requirement. -# **getFontSize** [\<>](src/index.js#L15-L15) +# **getFontSize** Returns the font size object based on an array of named font sizes and the namedFontSize and customFontSize values. If namedFontSize is undefined or not found in fontSizes an object with just the size value based on customFontSize is returned. @@ -243,7 +243,7 @@ _Returns_ - `?string`: If fontSizeAttribute is set and an equal slug is found in fontSizes it returns the font size object for that slug. Otherwise, an object with just the size value based on customFontSize is returned. -# **getFontSizeClass** [\<>](src/index.js#L15-L15) +# **getFontSizeClass** Returns a class based on fontSizeName. @@ -255,75 +255,75 @@ _Returns_ - `string`: String with the class corresponding to the fontSize passed. The class is generated by appending 'has-' followed by fontSizeSlug in kebabCase and ending with '-font-size'. -# **InnerBlocks** [\<>](src/index.js#L15-L15) +# **InnerBlocks** Undocumented declaration. -# **Inserter** [\<>](src/index.js#L15-L15) +# **Inserter** Undocumented declaration. -# **InspectorAdvancedControls** [\<>](src/index.js#L15-L15) +# **InspectorAdvancedControls** Undocumented declaration. -# **InspectorControls** [\<>](src/index.js#L15-L15) +# **InspectorControls** Undocumented declaration. -# **MediaPlaceholder** [\<>](src/index.js#L15-L15) +# **MediaPlaceholder** Undocumented declaration. -# **MediaUpload** [\<>](src/index.js#L15-L15) +# **MediaUpload** Undocumented declaration. -# **MediaUploadCheck** [\<>](src/index.js#L15-L15) +# **MediaUploadCheck** Undocumented declaration. -# **MultiBlocksSwitcher** [\<>](src/index.js#L15-L15) +# **MultiBlocksSwitcher** Undocumented declaration. -# **MultiSelectScrollIntoView** [\<>](src/index.js#L15-L15) +# **MultiSelectScrollIntoView** Undocumented declaration. -# **NavigableToolbar** [\<>](src/index.js#L15-L15) +# **NavigableToolbar** Undocumented declaration. -# **ObserveTyping** [\<>](src/index.js#L15-L15) +# **ObserveTyping** Undocumented declaration. -# **PanelColorSettings** [\<>](src/index.js#L15-L15) +# **PanelColorSettings** Undocumented declaration. -# **PlainText** [\<>](src/index.js#L15-L15) +# **PlainText** Undocumented declaration. -# **PreserveScrollInReorder** [\<>](src/index.js#L15-L15) +# **PreserveScrollInReorder** Undocumented declaration. -# **RichText** [\<>](src/index.js#L15-L15) +# **RichText** Undocumented declaration. -# **RichTextShortcut** [\<>](src/index.js#L15-L15) +# **RichTextShortcut** Undocumented declaration. -# **RichTextToolbarButton** [\<>](src/index.js#L15-L15) +# **RichTextToolbarButton** Undocumented declaration. -# **SETTINGS_DEFAULTS** [\<>](src/index.js#L17-L17) +# **SETTINGS_DEFAULTS** The default editor settings @@ -344,31 +344,31 @@ The default editor settings bodyPlaceholder string Empty post placeholder titlePlaceholder string Empty title placeholder -# **SkipToSelectedBlock** [\<>](src/index.js#L15-L15) +# **SkipToSelectedBlock** Undocumented declaration. -# **URLInput** [\<>](src/index.js#L15-L15) +# **URLInput** Undocumented declaration. -# **URLInputButton** [\<>](src/index.js#L15-L15) +# **URLInputButton** Undocumented declaration. -# **URLPopover** [\<>](src/index.js#L15-L15) +# **URLPopover** Undocumented declaration. -# **Warning** [\<>](src/index.js#L15-L15) +# **Warning** Undocumented declaration. -# **withColorContext** [\<>](src/index.js#L15-L15) +# **withColorContext** Undocumented declaration. -# **withColors** [\<>](src/index.js#L15-L15) +# **withColors** A higher-order component, which handles color logic for class generation color value, retrieval and color attribute setting. @@ -391,7 +391,7 @@ _Returns_ - `Function`: Higher-order component. -# **withFontSizes** [\<>](src/index.js#L15-L15) +# **withFontSizes** Higher-order component, which handles font size logic for class generation, font size value retrieval, and font size change handling. @@ -404,7 +404,7 @@ _Returns_ - `Function`: Higher-order component. -# **WritingFlow** [\<>](src/index.js#L15-L15) +# **WritingFlow** Undocumented declaration. diff --git a/packages/block-library/README.md b/packages/block-library/README.md index 1a87ac2572622..a572fa1c39754 100644 --- a/packages/block-library/README.md +++ b/packages/block-library/README.md @@ -16,7 +16,7 @@ _This package assumes that your code will run in an **ES2015+** environment. If -# **registerCoreBlocks** [\<>](src/index.js#L70-L132) +# **registerCoreBlocks** Function to register core blocks provided by the block editor. diff --git a/packages/block-serialization-default-parser/README.md b/packages/block-serialization-default-parser/README.md index f0f7e0c7913e9..e7cf1987b45d5 100644 --- a/packages/block-serialization-default-parser/README.md +++ b/packages/block-serialization-default-parser/README.md @@ -16,7 +16,7 @@ _This package assumes that your code will run in an **ES2015+** environment. If -# **parse** [\<>](src/index.js#L150-L162) +# **parse** Parser function, that converts input HTML into a block based structure. diff --git a/packages/blocks/README.md b/packages/blocks/README.md index 116a4dd19711c..e6b041aa7fb57 100644 --- a/packages/blocks/README.md +++ b/packages/blocks/README.md @@ -176,11 +176,11 @@ In the random image block above, we've given the `alt` attribute of the image a -# **children** [\<>](src/index.js#L16-L16) +# **children** Undocumented declaration. -# **cloneBlock** [\<>](src/index.js#L16-L16) +# **cloneBlock** Given a block object, returns a copy of the block object, optionally merging new attributes and/or replacing its inner blocks. @@ -195,7 +195,7 @@ _Returns_ - `Object`: A cloned block. -# **createBlock** [\<>](src/index.js#L16-L16) +# **createBlock** Returns a block object given its type and attributes. @@ -209,7 +209,7 @@ _Returns_ - `Object`: Block object. -# **doBlocksMatchTemplate** [\<>](src/index.js#L16-L16) +# **doBlocksMatchTemplate** Checks whether a list of blocks matches a template by comparing the block names. @@ -222,7 +222,7 @@ _Returns_ - `boolean`: Whether the list of blocks matches a templates -# **findTransform** [\<>](src/index.js#L16-L16) +# **findTransform** Given an array of transforms, returns the highest-priority transform where the predicate function returns a truthy value. A higher-priority transform @@ -239,7 +239,7 @@ _Returns_ - `?Object`: Highest-priority transform candidate. -# **getBlockAttributes** [\<>](src/index.js#L16-L16) +# **getBlockAttributes** Returns the block attributes of a registered block node given its type. @@ -253,7 +253,7 @@ _Returns_ - `Object`: All block attributes. -# **getBlockContent** [\<>](src/index.js#L16-L16) +# **getBlockContent** Given a block object, returns the Block's Inner HTML markup. @@ -265,7 +265,7 @@ _Returns_ - `string`: HTML. -# **getBlockDefaultClassName** [\<>](src/index.js#L16-L16) +# **getBlockDefaultClassName** Returns the block's default classname from its name. @@ -277,7 +277,7 @@ _Returns_ - `string`: The block's default class. -# **getBlockMenuDefaultClassName** [\<>](src/index.js#L16-L16) +# **getBlockMenuDefaultClassName** Returns the block's default menu item classname from its name. @@ -289,7 +289,7 @@ _Returns_ - `string`: The block's default menu item class. -# **getBlockSupport** [\<>](src/index.js#L16-L16) +# **getBlockSupport** Returns the block support value for a feature, if defined. @@ -303,7 +303,7 @@ _Returns_ - `?*`: Block support value -# **getBlockTransforms** [\<>](src/index.js#L16-L16) +# **getBlockTransforms** 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. @@ -319,7 +319,7 @@ _Returns_ - `Array`: Block transforms for direction. -# **getBlockType** [\<>](src/index.js#L16-L16) +# **getBlockType** Returns a registered block type. @@ -331,7 +331,7 @@ _Returns_ - `?Object`: Block type. -# **getBlockTypes** [\<>](src/index.js#L16-L16) +# **getBlockTypes** Returns all registered blocks. @@ -339,7 +339,7 @@ _Returns_ - `Array`: Block settings. -# **getCategories** [\<>](src/index.js#L16-L16) +# **getCategories** Returns all the block categories. @@ -347,7 +347,7 @@ _Returns_ - `Array`: Block categories. -# **getChildBlockNames** [\<>](src/index.js#L16-L16) +# **getChildBlockNames** Returns an array with the child blocks of a given block. @@ -359,7 +359,7 @@ _Returns_ - `Array`: Array of child block names. -# **getDefaultBlockName** [\<>](src/index.js#L16-L16) +# **getDefaultBlockName** Retrieves the default block name. @@ -367,7 +367,7 @@ _Returns_ - `?string`: Block name. -# **getFreeformContentHandlerName** [\<>](src/index.js#L16-L16) +# **getFreeformContentHandlerName** Retrieves name of block handling non-block content, or undefined if no handler has been defined. @@ -376,7 +376,7 @@ _Returns_ - `?string`: Blog name. -# **getPhrasingContentSchema** [\<>](src/index.js#L16-L16) +# **getPhrasingContentSchema** Get schema of possible paths for phrasing content. @@ -388,7 +388,7 @@ _Returns_ - `Object`: Schema. -# **getPossibleBlockTransformations** [\<>](src/index.js#L16-L16) +# **getPossibleBlockTransformations** Returns an array of block types that the set of blocks received as argument can be transformed into. @@ -401,7 +401,7 @@ _Returns_ - `Array`: Block types that the blocks argument can be transformed to. -# **getSaveContent** [\<>](src/index.js#L16-L16) +# **getSaveContent** Given a block type containing a save render implementation and attributes, returns the static markup to be saved. @@ -416,7 +416,7 @@ _Returns_ - `string`: Save content. -# **getSaveElement** [\<>](src/index.js#L16-L16) +# **getSaveElement** Given a block type containing a save render implementation and attributes, returns the enhanced element to be saved or string when raw HTML expected. @@ -431,7 +431,7 @@ _Returns_ - `(Object|string)`: Save element or raw HTML string. -# **getUnregisteredTypeHandlerName** [\<>](src/index.js#L16-L16) +# **getUnregisteredTypeHandlerName** Retrieves name of block handling unregistered block types, or undefined if no handler has been defined. @@ -440,7 +440,7 @@ _Returns_ - `?string`: Blog name. -# **hasBlockSupport** [\<>](src/index.js#L16-L16) +# **hasBlockSupport** Returns true if the block defines support for a feature, or false otherwise. @@ -454,7 +454,7 @@ _Returns_ - `boolean`: Whether block supports feature. -# **hasChildBlocks** [\<>](src/index.js#L16-L16) +# **hasChildBlocks** Returns a boolean indicating if a block has child blocks or not. @@ -466,7 +466,7 @@ _Returns_ - `boolean`: True if a block contains child blocks and false otherwise. -# **hasChildBlocksWithInserterSupport** [\<>](src/index.js#L16-L16) +# **hasChildBlocksWithInserterSupport** Returns a boolean indicating if a block has at least one child block with inserter support. @@ -478,7 +478,7 @@ _Returns_ - `boolean`: True if a block contains at least one child blocks with inserter support and false otherwise. -# **isReusableBlock** [\<>](src/index.js#L16-L16) +# **isReusableBlock** 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 @@ -492,7 +492,7 @@ _Returns_ - `boolean`: Whether the given block is a reusable block. -# **isUnmodifiedDefaultBlock** [\<>](src/index.js#L16-L16) +# **isUnmodifiedDefaultBlock** Determines whether the block is a default block and its attributes are equal to the default attributes @@ -506,7 +506,7 @@ _Returns_ - `boolean`: Whether the block is an unmodified default block -# **isValidBlockContent** [\<>](src/index.js#L16-L16) +# **isValidBlockContent** 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 @@ -524,7 +524,7 @@ _Returns_ - `boolean`: Whether block is valid. -# **isValidIcon** [\<>](src/index.js#L16-L16) +# **isValidIcon** Function that checks if the parameter is a valid icon. @@ -536,11 +536,11 @@ _Returns_ - `boolean`: True if the parameter is a valid icon and false otherwise. -# **node** [\<>](src/index.js#L16-L16) +# **node** Undocumented declaration. -# **normalizeIconObject** [\<>](src/index.js#L16-L16) +# **normalizeIconObject** 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 @@ -554,7 +554,7 @@ _Returns_ - `Object`: Object describing the icon. -# **parse** [\<>](src/index.js#L16-L16) +# **parse** Parses the post content with a PegJS grammar and returns a list of blocks. @@ -566,7 +566,7 @@ _Returns_ - `Array`: Block list. -# **parseWithAttributeSchema** [\<>](src/index.js#L16-L16) +# **parseWithAttributeSchema** Given a block's raw content and an attribute's schema returns the attribute's value depending on its source. @@ -580,7 +580,7 @@ _Returns_ - `*`: Attribute value. -# **pasteHandler** [\<>](src/index.js#L16-L16) +# **pasteHandler** Converts an HTML string to known blocks. Strips everything else. @@ -596,7 +596,7 @@ _Returns_ - `(Array|string)`: A list of blocks or a string, depending on `handlerMode`. -# **rawHandler** [\<>](src/index.js#L16-L16) +# **rawHandler** Converts an HTML string to known blocks. @@ -608,7 +608,7 @@ _Returns_ - `Array`: A list of blocks. -# **registerBlockStyle** [\<>](src/index.js#L16-L16) +# **registerBlockStyle** Registers a new block style variation for the given block. @@ -617,7 +617,7 @@ _Parameters_ - _blockName_ `string`: Name of block (example: “core/latest-posts”). - _styleVariation_ `Object`: Object containing `name` which is the class name applied to the block and `label` which identifies the variation to the user. -# **registerBlockType** [\<>](src/index.js#L16-L16) +# **registerBlockType** 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 @@ -632,7 +632,7 @@ _Returns_ - `?WPBlock`: The block, if it has been successfully registered; otherwise `undefined`. -# **serialize** [\<>](src/index.js#L16-L16) +# **serialize** Takes a block or set of blocks and returns the serialized post content. @@ -644,7 +644,7 @@ _Returns_ - `string`: The post content. -# **setCategories** [\<>](src/index.js#L16-L16) +# **setCategories** Sets the block categories. @@ -652,7 +652,7 @@ _Parameters_ - _categories_ `Array`: Block categories. -# **setDefaultBlockName** [\<>](src/index.js#L16-L16) +# **setDefaultBlockName** Assigns the default block name. @@ -660,7 +660,7 @@ _Parameters_ - _name_ `string`: Block name. -# **setFreeformContentHandlerName** [\<>](src/index.js#L16-L16) +# **setFreeformContentHandlerName** Assigns name of block for handling non-block content. @@ -668,7 +668,7 @@ _Parameters_ - _blockName_ `string`: Block name. -# **setUnregisteredTypeHandlerName** [\<>](src/index.js#L16-L16) +# **setUnregisteredTypeHandlerName** Assigns name of block handling unregistered block types. @@ -676,7 +676,7 @@ _Parameters_ - _blockName_ `string`: Block name. -# **switchToBlockType** [\<>](src/index.js#L16-L16) +# **switchToBlockType** Switch one or more blocks into one or more blocks of the new block type. @@ -689,7 +689,7 @@ _Returns_ - `Array`: Array of blocks. -# **synchronizeBlocksWithTemplate** [\<>](src/index.js#L16-L16) +# **synchronizeBlocksWithTemplate** Synchronize a block list with a block template. @@ -707,7 +707,7 @@ _Returns_ - `Array`: Updated Block list. -# **unregisterBlockStyle** [\<>](src/index.js#L16-L16) +# **unregisterBlockStyle** Unregisters a block style variation for the given block. @@ -716,7 +716,7 @@ _Parameters_ - _blockName_ `string`: Name of block (example: “core/latest-posts”). - _styleVariationName_ `string`: Name of class applied to the block. -# **unregisterBlockType** [\<>](src/index.js#L16-L16) +# **unregisterBlockType** Unregisters a block. @@ -728,7 +728,7 @@ _Returns_ - `?WPBlock`: The previous block value, if it has been successfully unregistered; otherwise `undefined`. -# **updateCategory** [\<>](src/index.js#L16-L16) +# **updateCategory** Updates a category. @@ -737,7 +737,7 @@ _Parameters_ - _slug_ `string`: Block category slug. - _category_ `Object`: Object containing the category properties that should be updated. -# **withBlockContentContext** [\<>](src/index.js#L17-L17) +# **withBlockContentContext** A Higher Order Component used to inject BlockContent using context to the wrapped component. diff --git a/packages/compose/README.md b/packages/compose/README.md index 00dfc8e98f34d..0540c0e2753e5 100644 --- a/packages/compose/README.md +++ b/packages/compose/README.md @@ -65,7 +65,7 @@ For more details, you can refer to each Higher Order Component's README file. [A -# **compose** [\<>](src/index.js#L22-L22) +# **compose** Composes multiple higher-order components into a single higher-order component. Performs right-to-left function composition, where each successive invocation is supplied the return value of the previous. @@ -78,7 +78,7 @@ _Returns_ - `Function`: Returns the new composite function. -# **createHigherOrderComponent** [\<>](src/index.js#L6-L6) +# **createHigherOrderComponent** Given a function mapping a component to an enhanced component and modifier name, returns the enhanced component augmented with a generated displayName. @@ -92,7 +92,7 @@ _Returns_ - `WPComponent`: Component class with generated display name assigned. -# **ifCondition** [\<>](src/index.js#L7-L7) +# **ifCondition** Higher-order component creator, creating a new component which renders if the given condition is satisfied or with the given optional prop name. @@ -105,7 +105,7 @@ _Returns_ - `Function`: Higher-order component. -# **pure** [\<>](src/index.js#L8-L8) +# **pure** Given a component returns the enhanced component augmented with a component only rerendering when its props/state change @@ -119,11 +119,11 @@ _Returns_ - `WPComponent`: Component class with generated display name assigned. -# **withGlobalEvents** [\<>](src/index.js#L9-L9) +# **withGlobalEvents** Undocumented declaration. -# **withInstanceId** [\<>](src/index.js#L10-L10) +# **withInstanceId** A Higher Order Component used to be provide a unique instance ID by component. @@ -136,7 +136,7 @@ _Returns_ - `Component`: Component with an instanceId prop. -# **withSafeTimeout** [\<>](src/index.js#L11-L11) +# **withSafeTimeout** A higher-order component used to provide and manage delayed function calls that ought to be bound to a component's lifecycle. @@ -149,7 +149,7 @@ _Returns_ - `Component`: Wrapped component. -# **withState** [\<>](src/index.js#L12-L12) +# **withState** A Higher Order Component used to provide and manage internal component state via props. diff --git a/packages/data/README.md b/packages/data/README.md index e40efa3ab1a0b..66bdc2faa5b42 100644 --- a/packages/data/README.md +++ b/packages/data/README.md @@ -248,7 +248,7 @@ Specific implementation differences from Redux and React Redux: -# **combineReducers** [\<>](src/index.js#L58-L58) +# **combineReducers** The combineReducers helper function turns an object whose values are different reducing functions into a single reducing function you can pass to registerReducer. @@ -289,7 +289,7 @@ _Returns_ - `Function`: A reducer that invokes every reducer inside the reducers object, and constructs a state object with the same shape. -# **createRegistry** [\<>](src/index.js#L17-L17) +# **createRegistry** Creates a new store registry, given an optional object of initial store configurations. @@ -302,7 +302,7 @@ _Returns_ - `WPDataRegistry`: Data registry. -# **createRegistryControl** [\<>](src/index.js#L19-L19) +# **createRegistryControl** Mark a control as a registry control. @@ -314,7 +314,7 @@ _Returns_ - `function`: marked registry control. -# **createRegistrySelector** [\<>](src/index.js#L19-L19) +# **createRegistrySelector** Mark a selector as a registry selector. @@ -326,7 +326,7 @@ _Returns_ - `function`: marked registry selector. -# **dispatch** [\<>](src/index.js#L92-L92) +# **dispatch** Given the name of a registered store, returns an object of the store's action creators. Calling an action creator will cause it to be dispatched, updating the state value accordingly. @@ -347,11 +347,11 @@ _Returns_ - `Object`: Object containing the action creators. -# **plugins** [\<>](src/index.js#L18-L18) +# **plugins** Undocumented declaration. -# **registerGenericStore** [\<>](src/index.js#L122-L122) +# **registerGenericStore** Registers a generic store. @@ -360,7 +360,7 @@ _Parameters_ - _key_ `string`: Store registry key. - _config_ `Object`: Configuration (getSelectors, getActions, subscribe). -# **registerStore** [\<>](src/index.js#L132-L132) +# **registerStore** Registers a standard `@wordpress/data` store. @@ -373,15 +373,15 @@ _Returns_ - `Object`: Registered store object. -# **RegistryConsumer** [\<>](src/index.js#L15-L15) +# **RegistryConsumer** Undocumented declaration. -# **RegistryProvider** [\<>](src/index.js#L15-L15) +# **RegistryProvider** Undocumented declaration. -# **select** [\<>](src/index.js#L76-L76) +# **select** Given the name of a registered store, returns an object of the store's selectors. The selector functions are been pre-bound to pass the current state automatically. @@ -403,7 +403,7 @@ _Returns_ - `Object`: Object containing the store's selectors. -# **subscribe** [\<>](src/index.js#L114-L114) +# **subscribe** Given a listener function, the function will be called any time the state value of one of the registered stores has changed. This function returns a `unsubscribe` @@ -427,11 +427,11 @@ _Parameters_ - _listener_ `Function`: Callback function. -# **use** [\<>](src/index.js#L133-L133) +# **use** Undocumented declaration. -# **withDispatch** [\<>](src/index.js#L13-L13) +# **withDispatch** Higher-order component used to add dispatch props using registered action creators. @@ -497,7 +497,7 @@ _Returns_ - `Component`: Enhanced component with merged dispatcher props. -# **withRegistry** [\<>](src/index.js#L14-L14) +# **withRegistry** Higher-order component which renders the original component with the current registry context passed as its `registry` prop. @@ -510,7 +510,7 @@ _Returns_ - `WPComponent`: Enhanced component. -# **withSelect** [\<>](src/index.js#L12-L12) +# **withSelect** Higher-order component used to inject state-derived props using registered selectors. diff --git a/packages/date/README.md b/packages/date/README.md index 8e26a27e82ff7..5c30a6f4ee532 100644 --- a/packages/date/README.md +++ b/packages/date/README.md @@ -16,7 +16,7 @@ _This package assumes that your code will run in an **ES2015+** environment. If -# **date** [\<>](src/index.js#L323-L327) +# **date** Formats a date (like `date()` in PHP), in the site's timezone. @@ -29,7 +29,7 @@ _Returns_ - `string`: Formatted date. -# **dateI18n** [\<>](src/index.js#L356-L366) +# **dateI18n** Formats a date (like `dateI18n()` in PHP). @@ -43,7 +43,7 @@ _Returns_ - `string`: Formatted date. -# **format** [\<>](src/index.js#L282-L311) +# **format** Formats a date. Does not alter the date's timezone. @@ -56,7 +56,7 @@ _Returns_ - `string`: Formatted date. -# **getDate** [\<>](src/index.js#L389-L395) +# **getDate** Create and return a JavaScript Date Object from a date string in the WP timezone. @@ -68,7 +68,7 @@ _Returns_ - `Date`: Date -# **gmdate** [\<>](src/index.js#L339-L342) +# **gmdate** Formats a date (like `date()` in PHP), in the UTC timezone. @@ -81,7 +81,7 @@ _Returns_ - `string`: Formatted date. -# **isInTheFuture** [\<>](src/index.js#L375-L380) +# **isInTheFuture** Check whether a date is considered in the future according to the WordPress settings. @@ -93,7 +93,7 @@ _Returns_ - `boolean`: Is in the future. -# **setSettings** [\<>](src/index.js#L36-L83) +# **setSettings** Adds a locale to moment, using the format supplied by `wp_localize_script()`. diff --git a/packages/deprecated/README.md b/packages/deprecated/README.md index b1eeec998ff55..38e5543f0834d 100644 --- a/packages/deprecated/README.md +++ b/packages/deprecated/README.md @@ -32,7 +32,7 @@ addAction( 'deprecated', 'my-plugin/add-deprecation-alert', addDeprecationAlert -# **default** [\<>](src/index.js#L39-L78) +# **default** Logs a message to notify developers about a deprecated feature. @@ -61,7 +61,7 @@ _Parameters_ - _options.link_ `?string`: Link to documentation - _options.hint_ `?string`: Additional message to help transition away from the deprecated feature. -# **logged** [\<>](src/index.js#L12-L12) +# **logged** Object map tracking messages which have been logged, for use in ensuring a message is only logged once. diff --git a/packages/docgen/src/markdown/formatter.js b/packages/docgen/src/markdown/formatter.js index df74712155afa..0912b7d034316 100644 --- a/packages/docgen/src/markdown/formatter.js +++ b/packages/docgen/src/markdown/formatter.js @@ -1,8 +1,3 @@ -/** - * External dependencies - */ -const path = require( 'path' ); - const getTagsByName = ( tags, ...names ) => tags.filter( ( tag ) => names.some( ( name ) => name === tag.title ) ); const cleanSpaces = ( paragraph ) => @@ -57,8 +52,8 @@ const getHeading = ( index, text ) => { return '#'.repeat( index ) + ' ' + text; }; -const getSymbolHeading = ( text, source ) => { - return `# **${ text }** ${ `[<>](${ source })` }`; +const getSymbolHeading = ( text ) => { + return `# **${ text }**`; }; module.exports = function( rootDir, docPath, symbols, headingTitle, headingStartIndex ) { @@ -83,15 +78,7 @@ module.exports = function( rootDir, docPath, symbols, headingTitle, headingStart } ); if ( symbols && symbols.length > 0 ) { symbols.forEach( ( symbol ) => { - const symbolPath = path.join( - path.relative( - path.dirname( docPath ), - path.join( rootDir, path.dirname( symbol.path ) ) - ), - path.basename( symbol.path ), - ); - const symbolPathWithLines = `${ symbolPath }#L${ symbol.lineStart }-L${ symbol.lineEnd }`; - docs.push( getSymbolHeading( symbol.name, symbolPathWithLines ) ); + docs.push( getSymbolHeading( symbol.name ) ); formatDeprecated( getTagsByName( symbol.tags, 'deprecated' ), docs ); formatDescription( symbol.description, docs ); formatTag( diff --git a/packages/docgen/src/test/formatter-markdown.js b/packages/docgen/src/test/formatter-markdown.js index b311551927919..d0b07d4fd8ac5 100644 --- a/packages/docgen/src/test/formatter-markdown.js +++ b/packages/docgen/src/test/formatter-markdown.js @@ -28,7 +28,7 @@ describe( 'Formatter', () => { lineEnd: 2, } ], 'API docs' ); expect( docs ).toBe( - '# API docs\n\n# **myDeclaration** [<>](home/my-path/docs-code.js#L1-L2)\n\nMy declaration example.\n\n*Parameters*\n\n- *firstParam* `number`: First declaration parameter.\n\n*Returns*\n\n- `number`: The result of the declaration.\n' + '# API docs\n\n# **myDeclaration**\n\nMy declaration example.\n\n*Parameters*\n\n- *firstParam* `number`: First declaration parameter.\n\n*Returns*\n\n- `number`: The result of the declaration.\n' ); } ); } ); diff --git a/packages/dom-ready/README.md b/packages/dom-ready/README.md index 7c6aa2c433301..559c3e4954036 100644 --- a/packages/dom-ready/README.md +++ b/packages/dom-ready/README.md @@ -16,7 +16,7 @@ _This package assumes that your code will run in an **ES2015+** environment. If -# **default** [\<>](src/index.js#L29-L29) +# **default** Specify a function to execute when the DOM is fully loaded. diff --git a/packages/dom/README.md b/packages/dom/README.md index 13f5601494097..8a2186890d5e4 100644 --- a/packages/dom/README.md +++ b/packages/dom/README.md @@ -14,7 +14,7 @@ npm install @wordpress/dom --save -# **computeCaretRect** [\<>](src/index.js#L13-L13) +# **computeCaretRect** Get the rectangle for the selection in a container. @@ -26,7 +26,7 @@ _Returns_ - `?DOMRect`: The rectangle. -# **documentHasSelection** [\<>](src/index.js#L13-L13) +# **documentHasSelection** Check wether the current document has a selection. This checks both for focus in an input field and general text selection. @@ -35,12 +35,12 @@ _Returns_ - `boolean`: True if there is selection, false if not. -# **focus** [\<>](src/index.js#L11-L11) +# **focus** Object grouping `focusable` and `tabbable` utils under the keys with the same name. -# **getOffsetParent** [\<>](src/index.js#L13-L13) +# **getOffsetParent** Returns the closest positioned element, or null under any of the conditions of the offsetParent specification. Unlike offsetParent, this function is not @@ -58,7 +58,7 @@ _Returns_ - `?Node`: Offset parent. -# **getRectangleFromRange** [\<>](src/index.js#L13-L13) +# **getRectangleFromRange** Get the rectangle of a given Range. @@ -70,7 +70,7 @@ _Returns_ - `DOMRect`: The rectangle. -# **getScrollContainer** [\<>](src/index.js#L13-L13) +# **getScrollContainer** Given a DOM node, finds the closest scrollable container node. @@ -82,7 +82,7 @@ _Returns_ - `?Element`: Scrollable container node, if found. -# **insertAfter** [\<>](src/index.js#L13-L13) +# **insertAfter** Given two DOM nodes, inserts the former in the DOM as the next sibling of the latter. @@ -96,7 +96,7 @@ _Returns_ - `void`: -# **isEntirelySelected** [\<>](src/index.js#L13-L13) +# **isEntirelySelected** Check whether the contents of the element have been entirely selected. Returns true if there is no possibility of selection. @@ -109,7 +109,7 @@ _Returns_ - `boolean`: True if entirely selected, false if not. -# **isHorizontalEdge** [\<>](src/index.js#L13-L13) +# **isHorizontalEdge** Check whether the selection is horizontally at the edge of the container. @@ -122,7 +122,7 @@ _Returns_ - `boolean`: True if at the horizontal edge, false if not. -# **isTextField** [\<>](src/index.js#L13-L13) +# **isTextField** Check whether the given element is a text field, where text field is defined by the ability to select within the input, or that it is contenteditable. @@ -137,7 +137,7 @@ _Returns_ - `boolean`: True if the element is an text field, false if not. -# **isVerticalEdge** [\<>](src/index.js#L13-L13) +# **isVerticalEdge** Check whether the selection is vertically at the edge of the container. @@ -150,7 +150,7 @@ _Returns_ - `boolean`: True if at the edge, false if not. -# **placeCaretAtHorizontalEdge** [\<>](src/index.js#L13-L13) +# **placeCaretAtHorizontalEdge** Places the caret at start or end of a given element. @@ -159,7 +159,7 @@ _Parameters_ - _container_ `Element`: Focusable element. - _isReverse_ `boolean`: True for end, false for start. -# **placeCaretAtVerticalEdge** [\<>](src/index.js#L13-L13) +# **placeCaretAtVerticalEdge** Places the caret at the top or bottom of a given element. @@ -170,7 +170,7 @@ _Parameters_ - _rect_ `[DOMRect]`: The rectangle to position the caret with. - _mayUseScroll_ `[boolean]`: True to allow scrolling, false to disallow. -# **remove** [\<>](src/index.js#L13-L13) +# **remove** Given a DOM node, removes it from the DOM. @@ -182,7 +182,7 @@ _Returns_ - `void`: -# **replace** [\<>](src/index.js#L13-L13) +# **replace** Given two DOM nodes, replaces the former with the latter in the DOM. @@ -195,7 +195,7 @@ _Returns_ - `void`: -# **replaceTag** [\<>](src/index.js#L13-L13) +# **replaceTag** Replaces the given node with a new node with the given tag name. @@ -208,7 +208,7 @@ _Returns_ - `Element`: The new node. -# **unwrap** [\<>](src/index.js#L13-L13) +# **unwrap** Unwrap the given node. This means any child nodes are moved to the parent. @@ -220,7 +220,7 @@ _Returns_ - `void`: -# **wrap** [\<>](src/index.js#L13-L13) +# **wrap** Wraps the given node with a new node with the given tag name. diff --git a/packages/e2e-test-utils/README.md b/packages/e2e-test-utils/README.md index da4138a9376d1..8cfd7554eb782 100644 --- a/packages/e2e-test-utils/README.md +++ b/packages/e2e-test-utils/README.md @@ -14,7 +14,7 @@ npm install @wordpress/e2e-test-utils --save-dev -# **activatePlugin** [\<>](src/index.js#L1-L1) +# **activatePlugin** Activates an installed plugin. @@ -22,7 +22,7 @@ _Parameters_ - _slug_ `string`: Plugin slug. -# **arePrePublishChecksEnabled** [\<>](src/index.js#L2-L2) +# **arePrePublishChecksEnabled** Verifies if publish checks are enabled. @@ -30,15 +30,15 @@ _Returns_ - `boolean`: Boolean which represents the state of prepublish checks. -# **clearLocalStorage** [\<>](src/index.js#L3-L3) +# **clearLocalStorage** Clears the local storage. -# **clickBlockAppender** [\<>](src/index.js#L4-L4) +# **clickBlockAppender** Clicks the default block appender. -# **clickBlockToolbarButton** [\<>](src/index.js#L5-L5) +# **clickBlockToolbarButton** Clicks a block toolbar button. @@ -46,7 +46,7 @@ _Parameters_ - _buttonAriaLabel_ `string`: The aria label of the button to click. -# **clickButton** [\<>](src/index.js#L6-L6) +# **clickButton** Clicks a button based on the text on the button. @@ -54,7 +54,7 @@ _Parameters_ - _buttonText_ `string`: The text that appears on the button to click. -# **clickOnCloseModalButton** [\<>](src/index.js#L7-L7) +# **clickOnCloseModalButton** Click on the close button of an open modal. @@ -62,7 +62,7 @@ _Parameters_ - _modalClassName_ `?string`: Class name for the modal to close -# **clickOnMoreMenuItem** [\<>](src/index.js#L8-L8) +# **clickOnMoreMenuItem** Clicks on More Menu item, searches for the button with the text provided and clicks it. @@ -70,7 +70,7 @@ _Parameters_ - _buttonLabel_ `string`: The label to search the button for. -# **createEmbeddingMatcher** [\<>](src/index.js#L52-L52) +# **createEmbeddingMatcher** Creates a function to determine if a request is embedding a certain URL. @@ -82,7 +82,7 @@ _Returns_ - `function`: Function that determines if a request is for the embed API, embedding a specific URL. -# **createJSONResponse** [\<>](src/index.js#L52-L52) +# **createJSONResponse** Respond to a request with a JSON response. @@ -94,7 +94,7 @@ _Returns_ - `Promise`: Promise that responds to a request with the mock JSON response. -# **createNewPost** [\<>](src/index.js#L9-L9) +# **createNewPost** Creates new post. @@ -102,7 +102,7 @@ _Parameters_ - _obj_ `Object`: Object to create new post, along with tips enabling option. -# **createURL** [\<>](src/index.js#L10-L10) +# **createURL** Creates new URL by parsing base URL, WPPath and query string. @@ -115,7 +115,7 @@ _Returns_ - `string`: String which represents full URL. -# **createURLMatcher** [\<>](src/index.js#L52-L52) +# **createURLMatcher** Creates a function to determine if a request is calling a URL with the substring present. @@ -127,7 +127,7 @@ _Returns_ - `function`: Function that determines if a request's URL contains substring. -# **deactivatePlugin** [\<>](src/index.js#L11-L11) +# **deactivatePlugin** Deactivates an active plugin. @@ -135,20 +135,20 @@ _Parameters_ - _slug_ `string`: Plugin slug. -# **disablePrePublishChecks** [\<>](src/index.js#L12-L12) +# **disablePrePublishChecks** Disables Pre-publish checks. -# **enablePageDialogAccept** [\<>](src/index.js#L13-L13) +# **enablePageDialogAccept** Enables even listener which accepts a page dialog which may appear when navigating away from Gutenberg. -# **enablePrePublishChecks** [\<>](src/index.js#L14-L14) +# **enablePrePublishChecks** Enables Pre-publish checks. -# **ensureSidebarOpened** [\<>](src/index.js#L15-L15) +# **ensureSidebarOpened** Verifies that the edit post sidebar is opened, and if it is not, opens it. @@ -156,7 +156,7 @@ _Returns_ - `Promise`: Promise resolving once the edit post sidebar is opened. -# **findSidebarPanelToggleButtonWithTitle** [\<>](src/index.js#L16-L16) +# **findSidebarPanelToggleButtonWithTitle** Finds a sidebar panel with the provided title. @@ -168,7 +168,7 @@ _Returns_ - `?ElementHandle`: Object that represents an in-page DOM element. -# **findSidebarPanelWithTitle** [\<>](src/index.js#L17-L17) +# **findSidebarPanelWithTitle** Finds the button responsible for toggling the sidebar panel with the provided title. @@ -180,7 +180,7 @@ _Returns_ - `?ElementHandle`: Object that represents an in-page DOM element. -# **getAllBlockInserterItemTitles** [\<>](src/index.js#L18-L18) +# **getAllBlockInserterItemTitles** Returns an array of strings with all inserter item titles. @@ -188,7 +188,7 @@ _Returns_ - `Promise`: Promise resolving with an array containing all inserter item titles. -# **getAllBlocks** [\<>](src/index.js#L19-L19) +# **getAllBlocks** Returns an array with all blocks; Equivalent to calling wp.data.select( 'core/editor' ).getBlocks(); @@ -196,7 +196,7 @@ _Returns_ - `Promise`: Promise resolving with an array containing all blocks in the document. -# **getAvailableBlockTransforms** [\<>](src/index.js#L20-L20) +# **getAvailableBlockTransforms** Returns an array of strings with all block titles, that the current selected block can be transformed into. @@ -205,7 +205,7 @@ _Returns_ - `Promise`: Promise resolving with an array containing all possible block transforms -# **getBlockSetting** [\<>](src/index.js#L21-L21) +# **getBlockSetting** Returns a string containing the block title associated with the provided block name. @@ -218,7 +218,7 @@ _Returns_ - `Promise`: Promise resolving with a string containing the block title. -# **getEditedPostContent** [\<>](src/index.js#L22-L22) +# **getEditedPostContent** Returns a promise which resolves with the edited post content (HTML string). @@ -226,7 +226,7 @@ _Returns_ - `Promise`: Promise resolving with post content markup. -# **hasBlockSwitcher** [\<>](src/index.js#L23-L23) +# **hasBlockSwitcher** Returns a boolean indicating if the current selected block has a block switcher or not. @@ -234,7 +234,7 @@ _Returns_ - `Promise`: Promise resolving with a boolean. -# **insertBlock** [\<>](src/index.js#L24-L24) +# **insertBlock** Opens the inserter, searches for the given term, then selects the first result that appears. @@ -244,7 +244,7 @@ _Parameters_ - _searchTerm_ `string`: The text to search the inserter for. - _panelName_ `string`: The inserter panel to open (if it's closed by default). -# **installPlugin** [\<>](src/index.js#L25-L25) +# **installPlugin** Installs a plugin from the WP.org repository. @@ -253,7 +253,7 @@ _Parameters_ - _slug_ `string`: Plugin slug. - _searchTerm_ `?string`: If the plugin is not findable by its slug use an alternative term to search. -# **isCurrentURL** [\<>](src/index.js#L26-L26) +# **isCurrentURL** Checks if current URL is a WordPress path. @@ -266,7 +266,7 @@ _Returns_ - `boolean`: Boolean represents whether current URL is or not a WordPress path. -# **isInDefaultBlock** [\<>](src/index.js#L27-L27) +# **isInDefaultBlock** Checks if the block that is focused is the default block. @@ -274,7 +274,7 @@ _Returns_ - `Promise`: Promise resolving with a boolean indicating if the focused block is the default block. -# **loginUser** [\<>](src/index.js#L28-L28) +# **loginUser** Performs log in with specified username and password. @@ -283,7 +283,7 @@ _Parameters_ - _username_ `?string`: String to be used as user credential. - _password_ `?string`: String to be used as user credential. -# **mockOrTransform** [\<>](src/index.js#L52-L52) +# **mockOrTransform** Mocks a request with the supplied mock object, or allows it to run with an optional transform, based on the deserialised JSON response for the request. @@ -298,28 +298,28 @@ _Returns_ - `Promise`: Promise that uses `mockCheck` to see if a request should be mocked with `mock`, and optionally transforms the response with `responseObjectTransform`. -# **observeFocusLoss** [\<>](src/index.js#L29-L29) +# **observeFocusLoss** Binds to the document on page load which throws an error if a `focusout` event occurs without a related target (i.e. focus loss). -# **openAllBlockInserterCategories** [\<>](src/index.js#L30-L30) +# **openAllBlockInserterCategories** Opens all block inserter categories. -# **openDocumentSettingsSidebar** [\<>](src/index.js#L31-L31) +# **openDocumentSettingsSidebar** Clicks on the button in the header which opens Document Settings sidebar when it is closed. -# **openGlobalBlockInserter** [\<>](src/index.js#L32-L32) +# **openGlobalBlockInserter** Opens the global block inserter. -# **openPublishPanel** [\<>](src/index.js#L33-L33) +# **openPublishPanel** Opens the publish panel. -# **pressKeyTimes** [\<>](src/index.js#L34-L34) +# **pressKeyTimes** Presses the given keyboard key a number of times in sequence. @@ -332,7 +332,7 @@ _Returns_ - `Promise`: Promise resolving when key presses complete. -# **pressKeyWithModifier** [\<>](src/index.js#L35-L35) +# **pressKeyWithModifier** Performs a key press with modifier (Shift, Control, Meta, Alt), where each modifier is normalized to platform-specific modifier. @@ -342,7 +342,7 @@ _Parameters_ - _modifier_ `string`: Modifier key. - _key_ `string`: Key to press while modifier held. -# **publishPost** [\<>](src/index.js#L36-L36) +# **publishPost** Publishes the post, resolving once the request is complete (once a notice is displayed). @@ -351,7 +351,7 @@ _Returns_ - `Promise`: Promise resolving when publish is complete. -# **publishPostWithPrePublishChecksDisabled** [\<>](src/index.js#L37-L37) +# **publishPostWithPrePublishChecksDisabled** Publishes the post without the pre-publish checks, resolving once the request is complete (once a notice is displayed). @@ -360,7 +360,7 @@ _Returns_ - `Promise`: Promise resolving when publish is complete. -# **saveDraft** [\<>](src/index.js#L38-L38) +# **saveDraft** Saves the post as a draft, resolving once the request is complete (once the "Saved" indicator is displayed). @@ -369,7 +369,7 @@ _Returns_ - `Promise`: Promise resolving when draft save is complete. -# **searchForBlock** [\<>](src/index.js#L39-L39) +# **searchForBlock** Search for block in the global inserter @@ -377,7 +377,7 @@ _Parameters_ - _searchTerm_ `string`: The text to search the inserter for. -# **selectBlockByClientId** [\<>](src/index.js#L40-L40) +# **selectBlockByClientId** Given the clientId of a block, selects the block on the editor. @@ -385,7 +385,7 @@ _Parameters_ - _clientId_ `string`: Identified of the block. -# **setBrowserViewport** [\<>](src/index.js#L41-L41) +# **setBrowserViewport** Sets browser viewport to specified type. @@ -393,7 +393,7 @@ _Parameters_ - _type_ `string`: String to represent dimensions type; can be either small or large. -# **setPostContent** [\<>](src/index.js#L42-L42) +# **setPostContent** Sets code editor content @@ -405,7 +405,7 @@ _Returns_ - `Promise`: Promise resolving with an array containing all blocks in the document. -# **setUpResponseMocking** [\<>](src/index.js#L52-L52) +# **setUpResponseMocking** Sets up mock checks and responses. Accepts a list of mock settings with the following properties: @@ -434,7 +434,7 @@ _Parameters_ - _mocks_ `Array`: Array of mock settings. -# **switchEditorModeTo** [\<>](src/index.js#L43-L43) +# **switchEditorModeTo** Switches editor mode. @@ -442,17 +442,17 @@ _Parameters_ - _mode_ `string`: String editor mode. -# **switchUserToAdmin** [\<>](src/index.js#L44-L44) +# **switchUserToAdmin** Switches the current user to the admin user (if the user running the test is not already the admin user). -# **switchUserToTest** [\<>](src/index.js#L45-L45) +# **switchUserToTest** Switches the current user to whichever user we should be running the tests as (if we're not already that user). -# **toggleScreenOption** [\<>](src/index.js#L46-L46) +# **toggleScreenOption** Toggles the screen option with the given label. @@ -461,7 +461,7 @@ _Parameters_ - _label_ `string`: The label of the screen option, e.g. 'Show Tips'. - _shouldBeChecked_ `?boolean`: If true, turns the option on. If false, off. If undefined, the option will be toggled. -# **transformBlockTo** [\<>](src/index.js#L47-L47) +# **transformBlockTo** Converts editor's block type. @@ -469,7 +469,7 @@ _Parameters_ - _name_ `string`: Block name. -# **uninstallPlugin** [\<>](src/index.js#L48-L48) +# **uninstallPlugin** Uninstalls a plugin. @@ -477,7 +477,7 @@ _Parameters_ - _slug_ `string`: Plugin slug. -# **visitAdminPage** [\<>](src/index.js#L49-L49) +# **visitAdminPage** Visits admin page; if user is not logged in then it logging in it first, then visits admin page. @@ -486,7 +486,7 @@ _Parameters_ - _adminPath_ `string`: String to be serialized as pathname. - _query_ `string`: String to be serialized as query portion of URL. -# **waitForWindowDimensions** [\<>](src/index.js#L50-L50) +# **waitForWindowDimensions** Function that waits until the page viewport has the required dimensions. It is being used to address a problem where after using setViewport the execution may continue, diff --git a/packages/edit-post/README.md b/packages/edit-post/README.md index 2192cc6dbcf42..1ad054b97bce0 100644 --- a/packages/edit-post/README.md +++ b/packages/edit-post/README.md @@ -27,7 +27,7 @@ They can be found in the global variable `wp.editPost` when defining `wp-edit-po -# **initializeEditor** [\<>](src/index.js#L66-L96) +# **initializeEditor** Initializes and returns an instance of Editor. @@ -42,7 +42,7 @@ _Parameters_ - _settings_ `?Object`: Editor settings object. - _initialEdits_ `Object`: Programmatic edits to apply initially, to be considered as non-user-initiated (bypass for unsaved changes prompt). -# **PluginBlockSettingsMenuItem** [\<>](src/index.js#L98-L98) +# **PluginBlockSettingsMenuItem** Renders a new item in the block settings menu. @@ -100,7 +100,7 @@ _Returns_ - `WPElement`: The WPElement to be rendered. -# **PluginMoreMenuItem** [\<>](src/index.js#L99-L99) +# **PluginMoreMenuItem** Renders a menu item in `Plugins` group in `More Menu` drop down, and can be used to as a button or link depending on the props provided. The text within the component appears as the menu item label. @@ -159,7 +159,7 @@ _Returns_ - `WPElement`: The element to be rendered. -# **PluginPostPublishPanel** [\<>](src/index.js#L100-L100) +# **PluginPostPublishPanel** Renders provided content to the post-publish panel in the publish flow (side panel that opens after a user publishes the post). @@ -211,7 +211,7 @@ _Returns_ - `WPElement`: The WPElement to be rendered. -# **PluginPostStatusInfo** [\<>](src/index.js#L101-L101) +# **PluginPostStatusInfo** Renders a row in the Status & Visibility panel of the Document sidebar. It should be noted that this is named and implemented around the function it serves @@ -258,7 +258,7 @@ _Returns_ - `WPElement`: The WPElement to be rendered. -# **PluginPrePublishPanel** [\<>](src/index.js#L102-L102) +# **PluginPrePublishPanel** Renders provided content to the pre-publish side panel in the publish flow (side panel that opens when a user first pushes "Publish" from the main editor). @@ -310,7 +310,7 @@ _Returns_ - `WPElement`: The WPElement to be rendered. -# **PluginSidebar** [\<>](src/index.js#L103-L103) +# **PluginSidebar** Renders a sidebar when activated. The contents within the `PluginSidebar` will appear as content within the sidebar. If you wish to display the sidebar, you can with use the `PluginSidebarMoreMenuItem` component or the `wp.data.dispatch` API: @@ -381,7 +381,7 @@ _Returns_ - `WPElement`: Plugin sidebar component. -# **PluginSidebarMoreMenuItem** [\<>](src/index.js#L104-L104) +# **PluginSidebarMoreMenuItem** Renders a menu item in `Plugins` group in `More Menu` drop down, and can be used to activate the corresponding `PluginSidebar` component. @@ -431,7 +431,7 @@ _Returns_ - `WPElement`: The element to be rendered. -# **reinitializeEditor** [\<>](src/index.js#L35-L50) +# **reinitializeEditor** Reinitializes the editor after the user chooses to reboot the editor after an unhandled error occurs, replacing previously mounted editor element using diff --git a/packages/element/README.md b/packages/element/README.md index 2e23c82aa5470..c3d916c558736 100755 --- a/packages/element/README.md +++ b/packages/element/README.md @@ -78,11 +78,11 @@ This assumes that you will import the `createElement` function in any file where -# **Children** [\<>](src/index.js#L1-L1) +# **Children** Object that provides utilities for dealing with React children. -# **cloneElement** [\<>](src/index.js#L1-L1) +# **cloneElement** Creates a copy of an element with extended props. @@ -95,11 +95,11 @@ _Returns_ - `WPElement`: Cloned element. -# **Component** [\<>](src/index.js#L1-L1) +# **Component** A base class to create WordPress Components (Refs, state and lifecycle hooks) -# **concatChildren** [\<>](src/index.js#L1-L1) +# **concatChildren** Concatenate two or more React children objects. @@ -111,7 +111,7 @@ _Returns_ - `Array`: The concatenated value. -# **createContext** [\<>](src/index.js#L1-L1) +# **createContext** Creates a context object containing two components: a provider and consumer. @@ -123,7 +123,7 @@ _Returns_ - `Object`: Context object. -# **createElement** [\<>](src/index.js#L1-L1) +# **createElement** Returns a new element of given type. Type can be either a string tag name or another function which itself returns an element. @@ -138,7 +138,7 @@ _Returns_ - `WPElement`: Element. -# **createPortal** [\<>](src/index.js#L2-L2) +# **createPortal** Creates a portal into which a component can be rendered. @@ -151,7 +151,7 @@ _Parameters_ - _component_ `Component`: Component - _target_ `Element`: DOM node into which element should be rendered -# **createRef** [\<>](src/index.js#L1-L1) +# **createRef** Returns an object tracking a reference to a rendered element via its `current` property as either a DOMElement or Element, dependent upon the @@ -161,7 +161,7 @@ _Returns_ - `Object`: Ref object. -# **findDOMNode** [\<>](src/index.js#L2-L2) +# **findDOMNode** Finds the dom node of a React component @@ -170,7 +170,7 @@ _Parameters_ - _component_ `Component`: component's instance - _target_ `Element`: DOM node into which element should be rendered -# **forwardRef** [\<>](src/index.js#L1-L1) +# **forwardRef** Component enhancer used to enable passing a ref to its wrapped component. Pass a function argument which receives `props` and `ref` as its arguments, @@ -185,11 +185,11 @@ _Returns_ - `WPComponent`: Enhanced component. -# **Fragment** [\<>](src/index.js#L1-L1) +# **Fragment** A component which renders its children without any wrapping element. -# **isEmptyElement** [\<>](src/index.js#L3-L3) +# **isEmptyElement** Checks if the provided WP element is empty. @@ -201,7 +201,7 @@ _Returns_ - `boolean`: True when an element is considered empty. -# **isValidElement** [\<>](src/index.js#L1-L1) +# **isValidElement** Checks if an object is a valid WPElement @@ -213,13 +213,13 @@ _Returns_ - `boolean`: true if objectToTest is a valid WPElement and false otherwise. -# **lazy** [\<>](src/index.js#L1-L1) +# **lazy** _Related_ - -# **RawHTML** [\<>](src/index.js#L5-L5) +# **RawHTML** Component used as equivalent of Fragment with unescaped HTML, in cases where it is desirable to render dangerous HTML without needing a wrapper element. @@ -234,7 +234,7 @@ _Returns_ - `WPElement`: Dangerously-rendering element. -# **render** [\<>](src/index.js#L2-L2) +# **render** Renders a given element into the target DOM node. @@ -243,7 +243,7 @@ _Parameters_ - _element_ `WPElement`: Element to render - _target_ `Element`: DOM node into which element should be rendered -# **renderToString** [\<>](src/index.js#L4-L4) +# **renderToString** Serializes a React element to string. @@ -257,17 +257,17 @@ _Returns_ - `string`: Serialized element. -# **StrictMode** [\<>](src/index.js#L1-L1) +# **StrictMode** Component that activates additional checks and warnings for its descendants. -# **Suspense** [\<>](src/index.js#L1-L1) +# **Suspense** _Related_ - -# **switchChildrenNodeName** [\<>](src/index.js#L1-L1) +# **switchChildrenNodeName** Switches the nodeName of all the elements in the children object. @@ -280,7 +280,7 @@ _Returns_ - `?Object`: The updated children object. -# **unmountComponentAtNode** [\<>](src/index.js#L2-L2) +# **unmountComponentAtNode** Removes any mounted element from the target DOM node. @@ -288,61 +288,61 @@ _Parameters_ - _target_ `Element`: DOM node in which element is to be removed -# **useCallback** [\<>](src/index.js#L1-L1) +# **useCallback** _Related_ - -# **useContext** [\<>](src/index.js#L1-L1) +# **useContext** _Related_ - -# **useDebugValue** [\<>](src/index.js#L1-L1) +# **useDebugValue** _Related_ - -# **useEffect** [\<>](src/index.js#L1-L1) +# **useEffect** _Related_ - -# **useImperativeHandle** [\<>](src/index.js#L1-L1) +# **useImperativeHandle** _Related_ - -# **useLayoutEffect** [\<>](src/index.js#L1-L1) +# **useLayoutEffect** _Related_ - -# **useMemo** [\<>](src/index.js#L1-L1) +# **useMemo** _Related_ - -# **useReducer** [\<>](src/index.js#L1-L1) +# **useReducer** _Related_ - -# **useRef** [\<>](src/index.js#L1-L1) +# **useRef** _Related_ - -# **useState** [\<>](src/index.js#L1-L1) +# **useState** _Related_ diff --git a/packages/escape-html/README.md b/packages/escape-html/README.md index c6f4769c298e7..764a6052d7e79 100644 --- a/packages/escape-html/README.md +++ b/packages/escape-html/README.md @@ -16,7 +16,7 @@ _This package assumes that your code will run in an **ES2015+** environment. If -# **escapeAmpersand** [\<>](src/index.js#L33-L35) +# **escapeAmpersand** Returns a string with ampersands escaped. Note that this is an imperfect implementation, where only ampersands which do not appear as a pattern of @@ -37,7 +37,7 @@ _Returns_ - `string`: Escaped string. -# **escapeAttribute** [\<>](src/index.js#L79-L81) +# **escapeAttribute** Returns an escaped attribute value. @@ -64,7 +64,7 @@ _Returns_ - `string`: Escaped attribute value. -# **escapeHTML** [\<>](src/index.js#L95-L97) +# **escapeHTML** Returns an escaped HTML element value. @@ -83,7 +83,7 @@ _Returns_ - `string`: Escaped HTML element value. -# **escapeLessThan** [\<>](src/index.js#L55-L57) +# **escapeLessThan** Returns a string with less-than sign replaced. @@ -95,7 +95,7 @@ _Returns_ - `string`: Escaped string. -# **escapeQuotationMark** [\<>](src/index.js#L44-L46) +# **escapeQuotationMark** Returns a string with quotation marks replaced. @@ -107,7 +107,7 @@ _Returns_ - `string`: Escaped string. -# **isValidAttributeName** [\<>](src/index.js#L106-L108) +# **isValidAttributeName** Returns true if the given attribute name is valid, or false otherwise. diff --git a/packages/html-entities/README.md b/packages/html-entities/README.md index 3f5f4ec7256d2..562c835faf53b 100644 --- a/packages/html-entities/README.md +++ b/packages/html-entities/README.md @@ -16,7 +16,7 @@ _This package assumes that your code will run in an **ES2015+** environment. If -# **decodeEntities** [\<>](src/index.js#L16-L35) +# **decodeEntities** Decodes the HTML entities from a given string. diff --git a/packages/i18n/README.md b/packages/i18n/README.md index 83a3337eb2b16..d20f94cb1425d 100644 --- a/packages/i18n/README.md +++ b/packages/i18n/README.md @@ -27,7 +27,7 @@ For a complete example, see the [Internationalization section of the Gutenberg H -# **setLocaleData** [\<>](src/index.js#L45-L58) +# **setLocaleData** Merges locale data into the Tannin instance by domain. Accepts data in a Jed-formatted JSON object shape. @@ -41,7 +41,7 @@ _Parameters_ - _data_ `?Object`: Locale data configuration. - _domain_ `?string`: Domain for which configuration applies. -# **sprintf** [\<>](src/index.js#L159-L167) +# **sprintf** Returns a formatted string. If an error occurs in applying the format, the original format string is returned. @@ -59,7 +59,7 @@ _Returns_ - `string`: The formatted string. -# **\_n** [\<>](src/index.js#L125-L127) +# **\_n** Translates and retrieves the singular or plural form based on the supplied number. @@ -79,7 +79,7 @@ _Returns_ - `string`: The translated singular or plural form. -# **\_nx** [\<>](src/index.js#L144-L146) +# **\_nx** Translates and retrieves the singular or plural form based on the supplied number, with gettext context. @@ -100,7 +100,7 @@ _Returns_ - `string`: The translated singular or plural form. -# **\_x** [\<>](src/index.js#L107-L109) +# **\_x** Retrieve translated string with gettext context. @@ -118,7 +118,7 @@ _Returns_ - `string`: Translated context string without pipe. -# **\_\_** [\<>](src/index.js#L92-L94) +# **\_\_** Retrieve the translation of text. diff --git a/packages/keycodes/README.md b/packages/keycodes/README.md index 99501bfc78865..fb3a7440255fc 100644 --- a/packages/keycodes/README.md +++ b/packages/keycodes/README.md @@ -38,27 +38,27 @@ onKeyDown( event ) { -# **ALT** [\<>](src/index.js#L74-L74) +# **ALT** Keycode for ALT key. -# **BACKSPACE** [\<>](src/index.js#L30-L30) +# **BACKSPACE** Keycode for BACKSPACE key. -# **COMMAND** [\<>](src/index.js#L82-L82) +# **COMMAND** Keycode for COMMAND/META key. -# **CTRL** [\<>](src/index.js#L78-L78) +# **CTRL** Keycode for CTRL key. -# **DELETE** [\<>](src/index.js#L66-L66) +# **DELETE** Keycode for DELETE key. -# **displayShortcut** [\<>](src/index.js#L166-L168) +# **displayShortcut** An object that contains functions to display shortcuts. E.g. displayShortcut.primary( 'm' ) will return '⌘M' on Mac. @@ -67,7 +67,7 @@ _Type_ - `Object` Keyed map of functions to display shortcuts. -# **displayShortcutList** [\<>](src/index.js#L135-L158) +# **displayShortcutList** Return an array of the parts of a keyboard shortcut chord for display E.g displayShortcutList.primary( 'm' ) will return [ '⌘', 'M' ] on Mac. @@ -76,23 +76,23 @@ _Type_ - `Object` keyed map of functions to shortcut sequences -# **DOWN** [\<>](src/index.js#L62-L62) +# **DOWN** Keycode for DOWN key. -# **ENTER** [\<>](src/index.js#L38-L38) +# **ENTER** Keycode for ENTER key. -# **ESCAPE** [\<>](src/index.js#L42-L42) +# **ESCAPE** Keycode for ESCAPE key. -# **F10** [\<>](src/index.js#L70-L70) +# **F10** Keycode for F10 key. -# **isKeyboardEvent** [\<>](src/index.js#L204-L218) +# **isKeyboardEvent** An object that contains functions to check if a keyboard event matches a predefined shortcut combination. @@ -103,11 +103,11 @@ _Type_ - `Object` Keyed map of functions to match events. -# **LEFT** [\<>](src/index.js#L50-L50) +# **LEFT** Keycode for LEFT key. -# **modifiers** [\<>](src/index.js#L103-L114) +# **modifiers** Object that contains functions that return the available modifier depending on platform. @@ -123,7 +123,7 @@ depending on platform. - `shift` - `shiftAlt` -# **rawShortcut** [\<>](src/index.js#L123-L127) +# **rawShortcut** An object that contains functions to get raw shortcuts. E.g. rawShortcut.primary( 'm' ) will return 'meta+m' on Mac. @@ -133,28 +133,28 @@ _Type_ - `Object` Keyed map of functions to raw shortcuts. -# **RIGHT** [\<>](src/index.js#L58-L58) +# **RIGHT** Keycode for RIGHT key. -# **SHIFT** [\<>](src/index.js#L86-L86) +# **SHIFT** Keycode for SHIFT key. -# **shortcutAriaLabel** [\<>](src/index.js#L174-L194) +# **shortcutAriaLabel** An object that contains functions to return an aria label for a keyboard shortcut. E.g. shortcutAriaLabel.primary( '.' ) will return 'Command + Period' on Mac. -# **SPACE** [\<>](src/index.js#L46-L46) +# **SPACE** Keycode for SPACE key. -# **TAB** [\<>](src/index.js#L34-L34) +# **TAB** Keycode for TAB key. -# **UP** [\<>](src/index.js#L54-L54) +# **UP** Keycode for UP key. diff --git a/packages/plugins/README.md b/packages/plugins/README.md index 31588557221e8..e3b7eb00cd0e9 100644 --- a/packages/plugins/README.md +++ b/packages/plugins/README.md @@ -16,7 +16,7 @@ _This package assumes that your code will run in an **ES2015+** environment. If -# **getPlugin** [\<>](src/index.js#L2-L2) +# **getPlugin** Returns a registered plugin settings. @@ -28,7 +28,7 @@ _Returns_ - `?Object`: Plugin setting. -# **getPlugins** [\<>](src/index.js#L2-L2) +# **getPlugins** Returns all registered plugins. @@ -36,7 +36,7 @@ _Returns_ - `Array`: Plugin settings. -# **PluginArea** [\<>](src/index.js#L1-L1) +# **PluginArea** A component that renders all plugin fills in a hidden div. @@ -73,7 +73,7 @@ _Returns_ - `WPElement`: Plugin area. -# **registerPlugin** [\<>](src/index.js#L2-L2) +# **registerPlugin** Registers a plugin to the editor. @@ -153,7 +153,7 @@ _Returns_ - `Object`: The final plugin settings object. -# **unregisterPlugin** [\<>](src/index.js#L2-L2) +# **unregisterPlugin** Unregisters a plugin by name. @@ -181,7 +181,7 @@ _Returns_ - `?WPPlugin`: The previous plugin settings object, if it has been successfully unregistered; otherwise `undefined`. -# **withPluginContext** [\<>](src/index.js#L1-L1) +# **withPluginContext** A Higher Order Component used to inject Plugin context to the wrapped component. diff --git a/packages/priority-queue/README.md b/packages/priority-queue/README.md index 60923ef28aa28..d786173a3b5f1 100644 --- a/packages/priority-queue/README.md +++ b/packages/priority-queue/README.md @@ -16,7 +16,7 @@ _This package assumes that your code will run in an **ES2015+** environment. If -# **createQueue** [\<>](src/index.js#L25-L72) +# **createQueue** Creates a context-aware queue that only executes the last task of a given context. diff --git a/packages/redux-routine/README.md b/packages/redux-routine/README.md index 5eb35117ee2d4..067ae8fb331cb 100644 --- a/packages/redux-routine/README.md +++ b/packages/redux-routine/README.md @@ -59,7 +59,7 @@ request has completed does the action creator procede to return the `SET_TEMPERA -# **default** [\<>](src/index.js#L19-L30) +# **default** Creates a Redux middleware, given an object of controls where each key is an action type for which to act upon, the value a function which returns either diff --git a/packages/rich-text/README.md b/packages/rich-text/README.md index 06d9506d47576..36fa10fae53e0 100644 --- a/packages/rich-text/README.md +++ b/packages/rich-text/README.md @@ -16,7 +16,7 @@ _This package assumes that your code will run in an **ES2015+** environment. If -# **applyFormat** [\<>](src/index.js#L6-L6) +# **applyFormat** Apply a format object to a Rich Text value from the given `startIndex` to the given `endIndex`. Indices are retrieved from the selection if none are @@ -33,7 +33,7 @@ _Returns_ - `Object`: A new value with the format applied. -# **concat** [\<>](src/index.js#L8-L8) +# **concat** Combine all Rich Text values into one. This is similar to `String.prototype.concat`. @@ -46,7 +46,7 @@ _Returns_ - `Object`: A new value combining all given records. -# **create** [\<>](src/index.js#L9-L9) +# **create** Create a RichText value from an `Element` tree (DOM), an HTML string or a plain text string, with optionally a `Range` object to set the selection. If @@ -89,7 +89,7 @@ _Returns_ - `Object`: A rich text value. -# **getActiveFormat** [\<>](src/index.js#L10-L10) +# **getActiveFormat** Gets the format object by type at the start of the selection. This can be used to get e.g. the URL of a link format at the current selection, but also @@ -105,7 +105,7 @@ _Returns_ - `(Object|undefined)`: Active format object of the specified type, or undefined. -# **getActiveObject** [\<>](src/index.js#L11-L11) +# **getActiveObject** Gets the active object, if there is any. @@ -117,7 +117,7 @@ _Returns_ - `?Object`: Active object, or undefined. -# **getTextContent** [\<>](src/index.js#L14-L14) +# **getTextContent** Get the textual content of a Rich Text value. This is similar to `Element.textContent`. @@ -130,7 +130,7 @@ _Returns_ - `string`: The text content. -# **insert** [\<>](src/index.js#L22-L22) +# **insert** Insert a Rich Text value, an HTML string, or a plain text string, into a Rich Text value at the given `startIndex`. Any content between `startIndex` @@ -148,7 +148,7 @@ _Returns_ - `Object`: A new value with the value inserted. -# **insertObject** [\<>](src/index.js#L25-L25) +# **insertObject** Insert a format as an object into a Rich Text value at the given `startIndex`. Any content between `startIndex` and `endIndex` will be @@ -165,7 +165,7 @@ _Returns_ - `Object`: A new value with the object inserted. -# **isCollapsed** [\<>](src/index.js#L15-L15) +# **isCollapsed** Check if the selection of a Rich Text value is collapsed or not. Collapsed means that no characters are selected, but there is a caret present. If there @@ -180,7 +180,7 @@ _Returns_ - `(boolean|undefined)`: True if the selection is collapsed, false if not, undefined if there is no selection. -# **isEmpty** [\<>](src/index.js#L16-L16) +# **isEmpty** Check if a Rich Text value is Empty, meaning it contains no text or any objects (such as images). @@ -193,7 +193,7 @@ _Returns_ - `boolean`: True if the value is empty, false if not. -# **join** [\<>](src/index.js#L17-L17) +# **join** Combine an array of Rich Text values into one, optionally separated by `separator`, which can be a Rich Text value, HTML string, or plain text @@ -208,7 +208,7 @@ _Returns_ - `Object`: A new combined value. -# **registerFormatType** [\<>](src/index.js#L18-L18) +# **registerFormatType** Registers a new format provided a unique name and an object defining its behavior. @@ -226,7 +226,7 @@ _Returns_ - `(WPFormat|undefined)`: The format, if it has been successfully registered; otherwise `undefined`. -# **remove** [\<>](src/index.js#L20-L20) +# **remove** Remove content from a Rich Text value between the given `startIndex` and `endIndex`. Indices are retrieved from the selection if none are provided. @@ -241,7 +241,7 @@ _Returns_ - `Object`: A new value with the content removed. -# **removeFormat** [\<>](src/index.js#L19-L19) +# **removeFormat** Remove any format object from a Rich Text value by type from the given `startIndex` to the given `endIndex`. Indices are retrieved from the @@ -258,7 +258,7 @@ _Returns_ - `Object`: A new value with the format applied. -# **replace** [\<>](src/index.js#L21-L21) +# **replace** Search a Rich Text value and replace the match(es) with `replacement`. This is similar to `String.prototype.replace`. @@ -273,7 +273,7 @@ _Returns_ - `Object`: A new value with replacements applied. -# **slice** [\<>](src/index.js#L26-L26) +# **slice** Slice a Rich Text value from `startIndex` to `endIndex`. Indices are retrieved from the selection if none are provided. This is similar to @@ -289,7 +289,7 @@ _Returns_ - `Object`: A new extracted value. -# **split** [\<>](src/index.js#L27-L27) +# **split** Split a Rich Text value in two at the given `startIndex` and `endIndex`, or split at the given separator. This is similar to `String.prototype.split`. @@ -305,7 +305,7 @@ _Returns_ - `Array`: An array of new values. -# **toggleFormat** [\<>](src/index.js#L30-L30) +# **toggleFormat** Toggles a format object to a Rich Text value at the current selection. @@ -318,7 +318,7 @@ _Returns_ - `Object`: A new value with the format applied or removed. -# **toHTMLString** [\<>](src/index.js#L29-L29) +# **toHTMLString** Create an HTML string from a Rich Text value. If a `multilineTag` is provided, text separated by a line separator will be wrapped in it. @@ -333,7 +333,7 @@ _Returns_ - `string`: HTML string. -# **unregisterFormatType** [\<>](src/index.js#L32-L32) +# **unregisterFormatType** Unregisters a format. diff --git a/packages/shortcode/README.md b/packages/shortcode/README.md index d848919f39ae4..1179a3a3d2472 100644 --- a/packages/shortcode/README.md +++ b/packages/shortcode/README.md @@ -16,7 +16,7 @@ _This package assumes that your code will run in an **ES2015+** environment. If -# **attrs** [\<>](src/index.js#L167-L210) +# **attrs** Parse shortcode attributes. @@ -38,7 +38,7 @@ _Returns_ - `WPShortcodeAttrs`: Parsed shortcode attributes. -# **default** [\<>](src/index.js#L363-L363) +# **default** Creates a shortcode instance. @@ -55,7 +55,7 @@ _Returns_ - `WPShortcode`: Shortcode instance. -# **fromMatch** [\<>](src/index.js#L223-L240) +# **fromMatch** Generate a Shortcode Object from a RegExp match. @@ -71,7 +71,7 @@ _Returns_ - `WPShortcode`: Shortcode instance. -# **next** [\<>](src/index.js#L45-L80) +# **next** Find the next matching shortcode. @@ -85,7 +85,7 @@ _Returns_ - `?WPShortcodeMatch`: Matched information. -# **regexp** [\<>](src/index.js#L146-L148) +# **regexp** Generate a RegExp to identify a shortcode. @@ -110,7 +110,7 @@ _Returns_ - `RegExp`: Shortcode RegExp. -# **replace** [\<>](src/index.js#L92-L107) +# **replace** Replace matching shortcodes in a block of text. @@ -124,7 +124,7 @@ _Returns_ - `string`: Text with shortcodes replaced. -# **string** [\<>](src/index.js#L122-L124) +# **string** Generate a string from shortcode parameters. diff --git a/packages/url/README.md b/packages/url/README.md index fc9f9bdb06ee8..5343364079a09 100644 --- a/packages/url/README.md +++ b/packages/url/README.md @@ -16,7 +16,7 @@ _This package assumes that your code will run in an **ES2015+** environment. If -# **addQueryArgs** [\<>](src/index.js#L242-L264) +# **addQueryArgs** Appends arguments as querystring to the provided URL. If the URL already includes query arguments, the arguments are merged with (and take precedent @@ -37,7 +37,7 @@ _Returns_ - `string`: URL with arguments applied. -# **filterURLForDisplay** [\<>](src/index.js#L379-L389) +# **filterURLForDisplay** Returns a URL for display. @@ -55,7 +55,7 @@ _Returns_ - `string`: Displayed URL. -# **getAuthority** [\<>](src/index.js#L79-L84) +# **getAuthority** Returns the authority part of the URL. @@ -74,7 +74,7 @@ _Returns_ - `?string`: The authority part of the URL. -# **getFragment** [\<>](src/index.js#L199-L204) +# **getFragment** Returns the fragment part of the URL. @@ -93,7 +93,7 @@ _Returns_ - `?string`: The fragment part of the URL. -# **getPath** [\<>](src/index.js#L119-L124) +# **getPath** Returns the path part of the URL. @@ -112,7 +112,7 @@ _Returns_ - `?string`: The path part of the URL. -# **getProtocol** [\<>](src/index.js#L39-L44) +# **getProtocol** Returns the protocol part of the URL. @@ -131,7 +131,7 @@ _Returns_ - `?string`: The protocol part of the URL. -# **getQueryArg** [\<>](src/index.js#L279-L284) +# **getQueryArg** Returns a single query argument of the url @@ -150,7 +150,7 @@ _Returns_ - `(Array|string)`: Query arg value. -# **getQueryString** [\<>](src/index.js#L159-L164) +# **getQueryString** Returns the query string part of the URL. @@ -169,7 +169,7 @@ _Returns_ - `?string`: The query string part of the URL. -# **hasQueryArg** [\<>](src/index.js#L299-L301) +# **hasQueryArg** Determines whether the URL contains a given query arg. @@ -188,7 +188,7 @@ _Returns_ - `boolean`: Whether or not the URL contains the query arg. -# **isURL** [\<>](src/index.js#L22-L24) +# **isURL** Determines whether the given string looks like a URL. @@ -206,7 +206,7 @@ _Returns_ - `boolean`: Whether or not it looks like a URL. -# **isValidAuthority** [\<>](src/index.js#L99-L104) +# **isValidAuthority** Checks for invalid characters within the provided authority. @@ -225,7 +225,7 @@ _Returns_ - `boolean`: True if the argument contains a valid authority. -# **isValidFragment** [\<>](src/index.js#L219-L224) +# **isValidFragment** Checks for invalid characters within the provided fragment. @@ -244,7 +244,7 @@ _Returns_ - `boolean`: True if the argument contains a valid fragment. -# **isValidPath** [\<>](src/index.js#L139-L144) +# **isValidPath** Checks for invalid characters within the provided path. @@ -263,7 +263,7 @@ _Returns_ - `boolean`: True if the argument contains a valid path -# **isValidProtocol** [\<>](src/index.js#L59-L64) +# **isValidProtocol** Tests if a url protocol is valid. @@ -282,7 +282,7 @@ _Returns_ - `boolean`: True if the argument is a valid protocol (e.g. http\:, tel:). -# **isValidQueryString** [\<>](src/index.js#L179-L184) +# **isValidQueryString** Checks for invalid characters within the provided query string. @@ -301,7 +301,7 @@ _Returns_ - `boolean`: True if the argument contains a valid query string. -# **prependHTTP** [\<>](src/index.js#L338-L344) +# **prependHTTP** Prepends "http\://" to a url, if it looks like something that is meant to be a TLD. @@ -319,7 +319,7 @@ _Returns_ - `string`: The updated URL -# **removeQueryArgs** [\<>](src/index.js#L316-L324) +# **removeQueryArgs** Removes arguments from the query string of the url @@ -338,7 +338,7 @@ _Returns_ - `string`: Updated URL -# **safeDecodeURI** [\<>](src/index.js#L359-L365) +# **safeDecodeURI** Safely decodes a URI with `decodeURI`. Returns the URI unmodified if `decodeURI` throws an error. @@ -357,7 +357,7 @@ _Returns_ - `string`: Decoded URI if possible. -# **safeDecodeURIComponent** [\<>](src/index.js#L399-L405) +# **safeDecodeURIComponent** Safely decodes a URI component with `decodeURIComponent`. Returns the URI component unmodified if `decodeURIComponent` throws an error. diff --git a/packages/viewport/README.md b/packages/viewport/README.md index cd1ed4d2d02b3..320f46daf8d43 100644 --- a/packages/viewport/README.md +++ b/packages/viewport/README.md @@ -49,7 +49,7 @@ This package provides a set of HOCs to author components whose behavior should v -# **ifViewportMatches** [\<>](src/index.js#L16-L16) +# **ifViewportMatches** Higher-order component creator, creating a new component which renders if the viewport query is satisfied. @@ -76,7 +76,7 @@ _Returns_ - `Function`: Higher-order component. -# **withViewportMatch** [\<>](src/index.js#L17-L17) +# **withViewportMatch** Higher-order component creator, creating a new component which renders with the given prop names, where the value passed to the underlying component is diff --git a/packages/wordcount/README.md b/packages/wordcount/README.md index 76599096ef5a2..d987ddfeccd13 100644 --- a/packages/wordcount/README.md +++ b/packages/wordcount/README.md @@ -16,7 +16,7 @@ _This package assumes that your code will run in an **ES2015+** environment. If -# **count** [\<>](src/index.js#L107-L121) +# **count** Count some words.