This repository was archived by the owner on Jul 9, 2026. It is now read-only.
Repository navigation
Issue/1851 insert captions #2156
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
eb1ae56
Use captions defined in Media Library when inserting image.
SergioEstevao fd4121a
Use caption for Media in Android.
SergioEstevao 6d7d411
Update release notes.
SergioEstevao bf44825
Update tests to get predefined caption.
SergioEstevao 1462e09
Fix image tests.
SergioEstevao 75da962
Find the caption element ignoring the current value set on it.
SergioEstevao 25f9115
Make sure caption element is cleared before adding new text.
SergioEstevao ca78090
Fix heading test now that clear actually works.
SergioEstevao 3695f29
Merge branch 'develop' into issue/1851_insert_captions
SergioEstevao 37458b0
Update GB reference.
SergioEstevao 80c0265
Merge branch 'develop' into issue/1851_insert_captions
SergioEstevao 6906be5
Merge branch 'develop' into issue/1851_insert_captions
SergioEstevao File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| package com.gutenberg; | ||
|
|
||
| import androidx.annotation.NonNull; | ||
|
|
||
| import org.wordpress.mobile.ReactNativeGutenbergBridge.GutenbergBridgeJS2Parent.MediaType; | ||
| import org.wordpress.mobile.ReactNativeGutenbergBridge.GutenbergBridgeJS2Parent.RNMedia; | ||
| import com.facebook.react.bridge.WritableMap; | ||
| import com.facebook.react.bridge.WritableNativeMap; | ||
|
|
||
| import java.util.Locale; | ||
|
|
||
| public class Media implements RNMedia { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I wish we had the kotlin dependency setup to reduce this to 4 LoCs :)
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Transformed the wish to a ticket 🤷♂️ #2203 |
||
| private int mId; | ||
| private String mUrl; | ||
| private String mType; | ||
| private String mCaption; | ||
|
|
||
| public Media(int id, String url, String type, String caption) { | ||
| this.mId = id; | ||
| this.mUrl = url; | ||
| this.mType = type; | ||
| this.mCaption = caption; | ||
| } | ||
|
|
||
| public int getId() { | ||
| return mId; | ||
| } | ||
|
|
||
| public void setId(int id) { | ||
| this.mId = id; | ||
| } | ||
|
|
||
| public String getUrl() { | ||
| return mUrl; | ||
| } | ||
|
|
||
| public void setUrl(String url) { | ||
| this.mUrl = url; | ||
| } | ||
|
|
||
| public String getType() { | ||
| return mType; | ||
| } | ||
|
|
||
| public void setType(String mediaType) { | ||
| this.mType = mediaType; | ||
| } | ||
|
|
||
| public String getCaption() { | ||
| return mCaption; | ||
| } | ||
|
|
||
| public void setCaption(String caption) { | ||
| this.mCaption = caption; | ||
| } | ||
|
|
||
| public WritableMap toMap() { | ||
| WritableMap map = new WritableNativeMap(); | ||
| map.putInt("id", mId); | ||
| map.putString("url", mUrl); | ||
| map.putString("type", mType); | ||
| map.putString("caption", mCaption); | ||
| return map; | ||
| } | ||
| } | ||
Submodule gutenberg
updated
2 files
| +9 −7 | docs/designers-developers/developers/block-api/README.md | |
| +1 −0 | packages/block-library/src/image/edit.native.js |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.