-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
[RNMobile] Add paused media state handlers to Android bridge code #57476
[RNMobile] Add paused media state handlers to Android bridge code #57476
Conversation
* Fix incorrect heading level. * Update manifest.
…le. (#57402) * Make increment and decrement buttons keyboard accessible. * Fix typo in documentation. * Add changelog entry.
* Navigation Block: Use dom.focus for focus control * Try adding a focus trap test for Safari * Don't use dom package
…56302) * Initial commit * It works, but is stripping comments * Added an extra return for debugging * Refactor to use string instead of arrays to compare * Use hidden textarea to save comments in production html * Use divs as delimiters, comments not working for interactive innner components * Back to array for references and comment delimiters * Something is working :-) * Refactor, process working * experiment replacing inner blocks * now working if there is only 1 interactive block * now working with 2 interactive blocks * Commented stopping at first custom element, after innerblocks is not being processed otherwise * Try using bookmarks, fix autoclosing tag not working * Not using bookmarks anymore, just processing inner inside processing function * Seems to be working, still needs a good test battery * Fix interactivity API directive processing * Remove tests that will be updated in next commits * Add markup tests * Use correct div group structure * Small refactor * remove not needed block name in interactive markers * Add more markup tests * refactor tests * Make inner blocks optional * Move directives declaration to declare them only if needed * Refactor more code, thanks to @DAreRodz * Remove only the first ocurrence * Improve comments and format * Update tests to use HTML API, fix non interactive blocks not being parsed * Unmark children of interactive blocks according to @DAreRodz comment * Add a p tag check test * Execute directives by priority * Remove gutenberg name from tests and use camelCase for context property * Fix empty style attribute error * Add test for directive ordering * Fix evaluate should only execute anonymous functions test * Fix wp-style tests * Improve tests * Test that we don't process non-interactive blocks * Stop unmarking children of interactive blocks * Move directives inside gutenberg_process_interactive_html --------- Co-authored-by: Luis Herranz <luisherranz@gmail.com> Co-authored-by: David Arenas <david.arenas@automattic.com>
* Remove usage of has_font_mime_type function * Remove definition of has_font_mime_type function * Remove test cases for has_font_mime_type
* Change doc slug to avoid conflicts. * Revert change to curation doc and modify URL of themes doc * Update docs/how-to-guides/themes/theme-support.md Co-authored-by: Aki Hamano <54422211+t-hamano@users.noreply.github.com> * Update docs/reference-guides/block-api/block-supports.md Co-authored-by: Aki Hamano <54422211+t-hamano@users.noreply.github.com> * Update docs/reference-guides/block-api/block-supports.md Co-authored-by: Aki Hamano <54422211+t-hamano@users.noreply.github.com> * Update packages/block-editor/src/components/height-control/README.md Co-authored-by: Aki Hamano <54422211+t-hamano@users.noreply.github.com> * Update packages/style-engine/docs/using-the-style-engine-with-block-supports.md Co-authored-by: Aki Hamano <54422211+t-hamano@users.noreply.github.com> * Fix link. --------- Co-authored-by: Aki Hamano <54422211+t-hamano@users.noreply.github.com>
* Migrate 'allowed patterns' e2e tests to Playwright * Remove old test file * Update test setup
* Migrate 'preferences' e2e tests to Playwright * Remove old test file Co-authored-by: Pooja Killekar <41000648+pooja-muchandikar@users.noreply.github.com> --------- Co-authored-by: Pooja Killekar <41000648+pooja-muchandikar@users.noreply.github.com>
* Migrate remaining 'publish panel' e2e tests to Playwright * Remove old test file
…ditor package (#57411) * Initial commit: rename method, move code and tests. * Refactor to use a hook so that we can get the blockNames via getBlockTypes and use useMemo Change function signature to something like getGlobalStylesChangelist( next, previous, options = {} ) Move max-length functionality from the revision buttons to the util. * Extract truncation logic. useGlobalStylesChangelist should return cached results where necessary so truncation can occur on these too. * Refactors to avoid using a hook. We can use memize for the same effect. Exporting a single function with the option to truncate. * Update tests
…ssed to additionalPrompt (#57473)
* Migrate 'sidebar' e2e tests to Playwright * Remove old test file
* Add `useScrollToSection` hook * Add `useScrollToElement` hook * Update logic to retrieve `KeyboardAwareFlatList` ref using `forwardRef` * Replace `useScrollToTextInput` with `useScrollToSection` * Expose `scrollToSection` and `scrollToElement` in Android implementation of `KeyboardAwareFlatList ` * Add `useScrollUponInsertion` hook * Add `useScroll` hook to abstract common logic in `KeyboardAwareFlatList` * Calculate `nativeScrollRef` based on platform in `useScroll` hook * Update unit test to adapt `useScrollToSection` hook * Remove `nativeScrollRef` in favor of calculating the ref in `KeyboardAwareFlatList` platform-specific components * Add unit test for `useScroll` hook * Ensure layout event of `BlockListItemCell` is triggered in tests * Avoid triggering auto-scroll for the same client ID * Update `react-native-editor` changelog
Update tests to use custom, registered block
* DataViews: Use in patterns page * add export JSON action * add rename action * add delete and reset actions * remove comments
…7279) * Mobile - WPAndroidGlueCode - Implement BackHandler functionality * Mobile - Editor Provider - Add BackHandler listener to unselect blocks * Mobile - Jest setup - Adds BackHandler mocks * Mobile - Edit post tests - Adds test for unselecting blocks using the hardware back button * Track when it should handle the back press button for cases when there's another activity instanced and the editor is in the background * Mobile - Keyboard Handling on Android - Set currentFocusedElement to null when hiding the soft keyboard. It also adds a check to not attempt to show the soft keyboard if there's no element set in currentFocusedElement * Update Changelog * Use InputState isFocused method instead of manually checking if there's a focused element * [RNMobile] Ensure Aztec input state function `blurOnUnmount` updates its state (#57486) * Ensure `blurOnUnmount` updates internal input state * Add unit test to cover `blurOnUnmount` logic --------- Co-authored-by: Carlos Garcia <fluiddot@gmail.com>
* Remove deprecated `behaviors` syntax * remove the imports * Remove `Gutenberg` suffix in WP_Theme_JSON_Schema_Gutenberg() call * Remove legacy lightbox settings for 'core/image' block * Remove reference to WP_Theme_JSON_Schema_Gutenberg that we missed
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.
Thank you for starting the investigation into this. I left a few questions on which I'd love your thoughts.
If you decide to move these changes (or others) forward in some manner, feel free to merge the PRs into rnmobile/android-media-paused
as you see fit.
void onMediaFileSaveProgress(String mediaId, float progress); | ||
void onMediaFileSaveSucceeded(String mediaId, String mediaUrl); | ||
void onMediaFileSaveFailed(String mediaId); | ||
void onMediaFileSaveFailed(String mediaId, float progress); |
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.
Were the float progress
additions in the name of consistency? I noted the Android implementation has a dedicated progress event/method.
Lines 1145 to 1147 in 0aabb54
public void mediaFileSaveProgress(final String mediaId, final float progress) { | |
mDeferredEventEmitter.onMediaFileSaveProgress(mediaId, progress); | |
} |
I.e., I wondered if Android is currently implemented in a way that negates the need to pass progress to the other methods. Should we avoid adding these float progress
?
iOS is implemented very differently and does not have a dedicated progress event/method. iOS relies upon a enum state that is passed to a single media observer method with a switch statement that communicates different states/progresses to the JavaScript app. The single method can receive a progress event with a value.
|
||
@Override | ||
public void onMediaFileUploadPaused(int mediaId, float progress) { | ||
setMediaFileUploadDataInJS(MEDIA_UPLOAD_STATE_PAUSED, mediaId, null, progress); |
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 believe MEDIA_UPLOAD_STATE_PAUSED
needs to be defined as 11
atop this file. Currently it is undefined.
* Extracts block editor iframe styles and adds a default background color. * Removing duplicate styles that apply to the editor canvas iframe
…, remote-tracking branch 'origin' into rnmobile/android-media-paused
This pull request has changed or added PHP files. Please confirm whether these changes need to be synced to WordPress Core, and therefore featured in the next release of WordPress. If so, it is recommended to create a new Trac ticket and submit a pull request to the WordPress Core Github repository soon after this pull request is merged. If you're unsure, you can always ask for help in the #core-editor channel in WordPress Slack. Thank you! ❤️ View changed files❔ lib/blocks.php ❔ lib/class-wp-theme-json-gutenberg.php ❔ lib/compat/wordpress-6.5/class-wp-navigation-block-renderer.php ❔ lib/experimental/fonts/font-library/class-wp-font-family-utils.php ❔ lib/experimental/fonts/font-library/class-wp-font-family.php ❔ lib/experimental/interactivity-api/class-wp-directive-processor.php ❔ lib/experimental/interactivity-api/directive-processing.php ❔ lib/experimental/interactivity-api/directives/wp-style.php ❔ lib/load.php ❔ phpunit/block-supports/background-test.php ❔ phpunit/experimental/interactivity-api/directive-processing-test.php ❔ phpunit/experimental/interactivity-api/directives/wp-style-test.php ❔ phpunit/style-engine/style-engine-test.php |
Size Change: -213 B (0%) Total Size: 1.69 MB
ℹ️ View Unchanged
|
Closing, rethinking this approach to focus more on the paused state (instead of passing progress to the failed state) and to better align with the iOS implementation by reducing boilerplate handlers. |
What?
Adds Android bridge handlers for
MEDIA_UPLOAD_STATE_PAUSED
.Branched from
rnmobile/media-upload-progress-connection-subscription
.References:
Why?
To allow the media upload progress bar status to persist when an upload is paused.
More info:
How?
onMediaFileUploadPaused
handlerprogress
values toonMediaFileUploadFailed
andonUploadMediaFileClear
handlers for consistency and to reduce the effort to access these values in the future, if needed.Testing Instructions
N/A currently, WIP