Skip to content

Commit

Permalink
Update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
oandregal committed Mar 6, 2019
1 parent 7f8ace7 commit 2b684f0
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 19 deletions.
39 changes: 20 additions & 19 deletions packages/dom/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand All @@ -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.
Expand All @@ -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
Expand All @@ -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.

Expand All @@ -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.

Expand All @@ -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.
Expand All @@ -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.
Expand All @@ -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.

Expand All @@ -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.
Expand All @@ -158,7 +159,7 @@ See: <https://html.spec.whatwg.org/#textFieldSelection>

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

Expand All @@ -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.

Expand All @@ -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.

Expand All @@ -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.

Expand All @@ -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.

Expand All @@ -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.

Expand All @@ -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.

Expand All @@ -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.

Expand Down
4 changes: 4 additions & 0 deletions packages/dom/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';

0 comments on commit 2b684f0

Please sign in to comment.