-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Conversation
It's now possible to associate entities to a whole block. These are retrieved with block.getBlockEntity() When spliting a block, the entity only remains linked to the first block of the split
@angelf Thanks for this PR! Would it be possible to add to the documentation explaining this addition in a little bit more detail? |
@facebook-github-bot import |
}); | ||
}); | ||
|
||
describe('caracter entity retrieval', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
caracter
should be character
This is awesome! Thanks, @angelf. |
Thanks for importing. If you are an FB employee go to Phabricator to review. |
It's not currently clear how to apply or remove a block entity. Some |
I'll be happy to propose a PR to fix this, but I personally think that #216 is a better solution for "Block level metadatas" because:
|
I'm happy with #216 approach. I actually find it more natural. @hellendag can you offer your thoughts on why you suggested to go with the Entity store? |
All right! I'm closing this one then. |
Summary: This commit add support for block level metadata. It is the same feature as #157 This PR does not rely on entity, but just add a data field to ContentBlock. hense block metadata are store in contentState and are supported by undo/redo. Why not using entities? - Entity are not made for block. what does type and mutability would map to? - Entity are planned to be integrated into contentState anyway (see #185) Closes #216 Reviewed By: spicyj Differential Revision: D3123774 fbshipit-source-id: 27fdf0090d8faafba2848cb72f584987af3bbe0e
Summary: This commit add support for block level metadata. It is the same feature as facebookarchive#157 This PR does not rely on entity, but just add a data field to ContentBlock. hense block metadata are store in contentState and are supported by undo/redo. Why not using entities? - Entity are not made for block. what does type and mutability would map to? - Entity are planned to be integrated into contentState anyway (see facebookarchive#185) Closes facebookarchive#216 Reviewed By: spicyj Differential Revision: D3123774 fbshipit-source-id: 27fdf0090d8faafba2848cb72f584987af3bbe0e
Summary: This commit add support for block level metadata. It is the same feature as facebookarchive/draft-js#157 This PR does not rely on entity, but just add a data field to ContentBlock. hense block metadata are store in contentState and are supported by undo/redo. Why not using entities? - Entity are not made for block. what does type and mutability would map to? - Entity are planned to be integrated into contentState anyway (see #185) Closes facebookarchive/draft-js#216 Reviewed By: spicyj Differential Revision: D3123774 fbshipit-source-id: 27fdf0090d8faafba2848cb72f584987af3bbe0e
It's now possible to associate entities to a whole block. These are
retrieved with block.getBlockEntity()
When spliting a block, the entity only remains linked to the first block
of the split