-
Notifications
You must be signed in to change notification settings - Fork 13
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
Use a view props instead to update the currently selected formats #105
Conversation
We can't really remove those methods until the other PRs are merged, right? |
Well we 'll need this merged for wordpress-mobile/gutenberg-mobile#275 but I haven't laid out a merge plan yet. |
@objc var activeFormats: NSSet? = nil { | ||
didSet { | ||
let currentTypingAttributes = formattingIdentifiersForTypingAttributes() | ||
for (key, value) in formatStringMap where currentTypingAttributes.contains(key) != activeFormats?.contains(value) { |
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.
It's a bit hard to follow but it seems this is adding any missing format to the typing attributes, but should it also be removing anything that's currently there and not in activeFormats
?
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.
I think that's what it does, see apply()
actually toggles a given format. It's a bit unfortunate that I didn't find any public method in Aztec to force set a format instead
OK, let's keep reviewing here but not merge until the other parts are ready |
743bc69
to
019e341
Compare
We've folded this repo into gutenberg-mobile so, if this PR is still active please, migrate it to a PR on the gutenberg-mobile repo. Thanks! |
f0e362a
to
b17db43
Compare
This PR removes our existing formatting callbacks (
onActiveFormatsChange
andonActiveFormatAttributesChange
) and uses a view props (activeFormats
) instead to update the currently selected formats.With WordPress/gutenberg#12249 the formatting will be handled over to gutenberg's format-library and Aztec will be "mostly" rendering the HTML. However, we also want to be able to render formatted text without delay, thus we need Aztec to be able to edit a rich text directly without formatting changes while the text entered cycles back to RN.
FYI, this "feature" is added to the format-library PR with this commit.
I'm not a Swift programmer so I'm interested in your feedback and really welcome contributions on this one :)
Edit: Added an implementation for Android but it's currently buggy