Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add "components" docs #8337

Merged
merged 18 commits into from
Aug 8, 2018
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/data/data-core-editor.md
Original file line number Diff line number Diff line change
Expand Up @@ -1435,4 +1435,4 @@ Returns an action object used in signalling that the editor settings have been u

*Parameters*

* settings: Updated settings
* settings: Updated settings
72 changes: 71 additions & 1 deletion docs/data/data-core.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,20 @@ otherwise.

Whether a request is in progress for categories.

### isRequestingEmbedPreview

Returns true if a request is in progress for embed preview data, or false
otherwise.

*Parameters*

* state: Data state.
* url: URL the preview would be for.

*Returns*

Whether a request is in progress for an embed preview.

### getAuthors

Returns all available authors.
Expand Down Expand Up @@ -104,6 +118,21 @@ Returns the Entity's record object by key.

Record.

### getEntityRecords

Returns the Entity's records.

*Parameters*

* state: State tree
* kind: Entity kind.
* name: Entity name.
* query: Optional terms query.

*Returns*

Records.

### getThemeSupports

Return theme supports data in the index.
Expand All @@ -116,6 +145,36 @@ Return theme supports data in the index.

Index data.

### getEmbedPreview

Returns the embed preview for the given URL.

*Parameters*

* state: Data state.
* url: Embedded URL.

*Returns*

Undefined if the preview has not been fetched, otherwise, the preview fetched from the embed preview API.

### isPreviewEmbedFallback

Determines if the returned preview is an oEmbed link fallback.

WordPress can be configured to return a simple link to a URL if it is not embeddable.
We need to be able to determine if a URL is embeddable or not, based on what we
get back from the oEmbed preview API.

*Parameters*

* state: Data state.
* url: Embedded URL.

*Returns*

Is the preview for the URL an oEmbed link fallback.

## Actions

### receiveTerms
Expand Down Expand Up @@ -154,11 +213,22 @@ Returns an action object used in signalling that entity records have been receiv
* kind: Kind of the received entity.
* name: Name of the received entity.
* records: Records received.
* query: Query Object.

### receiveThemeSupportsFromIndex

Returns an action object used in signalling that the index has been received.

*Parameters*

* index: Index received.
* index: Index received.

### receiveEmbedPreview

Returns an action object used in signalling that the preview data for
a given URl has been received.

*Parameters*

* url: URL to preview the embed for.
* preview: Preview data.
Loading