From 2b684f02b9ac5702cf111822542be5a90224037c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s?= Date: Wed, 6 Mar 2019 14:28:33 +0100 Subject: [PATCH] Update documentation --- packages/dom/README.md | 39 ++++++++++++++++++++------------------- packages/dom/src/index.js | 4 ++++ 2 files changed, 24 insertions(+), 19 deletions(-) diff --git a/packages/dom/README.md b/packages/dom/README.md index 594babb0230d4..bf572a4741b50 100644 --- a/packages/dom/README.md +++ b/packages/dom/README.md @@ -16,7 +16,7 @@ npm install @wordpress/dom --save ### computeCaretRect -[src/index.js#L9-L9](src/index.js#L9-L9) +[src/index.js#L13-L13](src/index.js#L13-L13) Get the rectangle for the selection in a container. @@ -30,7 +30,7 @@ Get the rectangle for the selection in a container. ### documentHasSelection -[src/index.js#L9-L9](src/index.js#L9-L9) +[src/index.js#L13-L13](src/index.js#L13-L13) Check wether the current document has a selection. This checks both for focus in an input field and general text selection. @@ -41,13 +41,14 @@ This checks both for focus in an input field and general text selection. ### focus -[src/index.js#L7-L7](src/index.js#L7-L7) +[src/index.js#L11-L11](src/index.js#L11-L11) -Undocumented declaration. +Object grouping `focusable` and `tabbable` utils +under the keys with the same name. ### getOffsetParent -[src/index.js#L9-L9](src/index.js#L9-L9) +[src/index.js#L13-L13](src/index.js#L13-L13) Returns the closest positioned element, or null under any of the conditions of the offsetParent specification. Unlike offsetParent, this function is not @@ -67,7 +68,7 @@ limited to HTMLElement and accepts any Node (e.g. Node.TEXT_NODE). ### getRectangleFromRange -[src/index.js#L9-L9](src/index.js#L9-L9) +[src/index.js#L13-L13](src/index.js#L13-L13) Get the rectangle of a given Range. @@ -81,7 +82,7 @@ Get the rectangle of a given Range. ### getScrollContainer -[src/index.js#L9-L9](src/index.js#L9-L9) +[src/index.js#L13-L13](src/index.js#L13-L13) Given a DOM node, finds the closest scrollable container node. @@ -95,7 +96,7 @@ Given a DOM node, finds the closest scrollable container node. ### insertAfter -[src/index.js#L9-L9](src/index.js#L9-L9) +[src/index.js#L13-L13](src/index.js#L13-L13) Given two DOM nodes, inserts the former in the DOM as the next sibling of the latter. @@ -111,7 +112,7 @@ the latter. ### isEntirelySelected -[src/index.js#L9-L9](src/index.js#L9-L9) +[src/index.js#L13-L13](src/index.js#L13-L13) Check whether the contents of the element have been entirely selected. Returns true if there is no possibility of selection. @@ -126,7 +127,7 @@ Returns true if there is no possibility of selection. ### isHorizontalEdge -[src/index.js#L9-L9](src/index.js#L9-L9) +[src/index.js#L13-L13](src/index.js#L13-L13) Check whether the selection is horizontally at the edge of the container. @@ -141,7 +142,7 @@ Check whether the selection is horizontally at the edge of the container. ### isTextField -[src/index.js#L9-L9](src/index.js#L9-L9) +[src/index.js#L13-L13](src/index.js#L13-L13) 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. @@ -158,7 +159,7 @@ See: ### isVerticalEdge -[src/index.js#L9-L9](src/index.js#L9-L9) +[src/index.js#L13-L13](src/index.js#L13-L13) Check whether the selection is vertically at the edge of the container. @@ -173,7 +174,7 @@ Check whether the selection is vertically at the edge of the container. ### placeCaretAtHorizontalEdge -[src/index.js#L9-L9](src/index.js#L9-L9) +[src/index.js#L13-L13](src/index.js#L13-L13) Places the caret at start or end of a given element. @@ -184,7 +185,7 @@ Places the caret at start or end of a given element. ### placeCaretAtVerticalEdge -[src/index.js#L9-L9](src/index.js#L9-L9) +[src/index.js#L13-L13](src/index.js#L13-L13) Places the caret at the top or bottom of a given element. @@ -197,7 +198,7 @@ Places the caret at the top or bottom of a given element. ### remove -[src/index.js#L9-L9](src/index.js#L9-L9) +[src/index.js#L13-L13](src/index.js#L13-L13) Given a DOM node, removes it from the DOM. @@ -211,7 +212,7 @@ Given a DOM node, removes it from the DOM. ### replace -[src/index.js#L9-L9](src/index.js#L9-L9) +[src/index.js#L13-L13](src/index.js#L13-L13) Given two DOM nodes, replaces the former with the latter in the DOM. @@ -226,7 +227,7 @@ Given two DOM nodes, replaces the former with the latter in the DOM. ### replaceTag -[src/index.js#L9-L9](src/index.js#L9-L9) +[src/index.js#L13-L13](src/index.js#L13-L13) Replaces the given node with a new node with the given tag name. @@ -241,7 +242,7 @@ Replaces the given node with a new node with the given tag name. ### unwrap -[src/index.js#L9-L9](src/index.js#L9-L9) +[src/index.js#L13-L13](src/index.js#L13-L13) Unwrap the given node. This means any child nodes are moved to the parent. @@ -255,7 +256,7 @@ Unwrap the given node. This means any child nodes are moved to the parent. ### wrap -[src/index.js#L9-L9](src/index.js#L9-L9) +[src/index.js#L13-L13](src/index.js#L13-L13) Wraps the given node with a new node with the given tag name. diff --git a/packages/dom/src/index.js b/packages/dom/src/index.js index 9fde374193ad5..7d514005846c2 100644 --- a/packages/dom/src/index.js +++ b/packages/dom/src/index.js @@ -4,6 +4,10 @@ import * as focusable from './focusable'; import * as tabbable from './tabbable'; +/** + * Object grouping `focusable` and `tabbable` utils + * under the keys with the same name. + */ export const focus = { focusable, tabbable }; export * from './dom';