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

Docs: Transforms - file and priority example #8076

Merged
merged 5 commits into from
Jul 25, 2018
Merged

Conversation

Soean
Copy link
Member

@Soean Soean commented Jul 20, 2018

Description

A dropped file can be transformed into a block. I added the information and an example for the usage of files and priority.

@Soean Soean added the [Type] Developer Documentation Documentation for developers label Jul 20, 2018
@gziolo gziolo requested review from talldan and noisysocks July 23, 2018 06:07
@gziolo gziolo added this to the 3.4 milestone Jul 23, 2018
Copy link
Contributor

@talldan talldan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, just a couple of minor changes.

I wonder if it's also worth mentioning that file transforms can only be used as 'from' transforms. Might be too obvious and implied by the examples to warrant mentioning.

{
type: 'files',
isMatch: function ( files ) {
return files.length === 1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing semi-colon

@@ -310,6 +310,63 @@ transforms: {

To control the priority with which a transform is applied, define a `priority` numeric property on your transform object, where a lower value will take precedence over higher values. This behaves much like a [WordPress hook](https://codex.wordpress.org/Plugin_API#Hook_to_WordPress). Like hooks, the default priority is `10` when not otherwise set.

A file can be dropped into the editor and transformed into a (specific) file block.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The use of 'file block' here might be confusing. Maybe just "A file can be dropped into the editor and converted into a block with a matching transform"

@Soean
Copy link
Member Author

Soean commented Jul 23, 2018

@talldan Thanks for your review, I updated the PR. I don't think we have to mention the from, this should be obvious in this case.

Copy link
Contributor

@talldan talldan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for making the change, I'm happy 👍

@gziolo gziolo added the [Feature] Block API API that allows to express the block paradigm. label Jul 25, 2018
@gziolo gziolo merged commit 0fec0f3 into master Jul 25, 2018
@gziolo gziolo deleted the update/block-api-docs branch July 25, 2018 04:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Block API API that allows to express the block paradigm. [Type] Developer Documentation Documentation for developers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants