Skip to content

Commit

Permalink
[RNMobile] Enable new block in Gutenberg Mobile (#47836)
Browse files Browse the repository at this point in the history
This PR introduces a new block to the Gutenberg Mobile editor.
  • Loading branch information
Siobhan Bamber authored Feb 15, 2023
1 parent 0b8de64 commit 55b0c38
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ data class GutenbergProps @JvmOverloads constructor(
val enableContactInfoBlock: Boolean,
val enableLayoutGridBlock: Boolean,
val enableTiledGalleryBlock: Boolean,
val enableVideoPressBlock: Boolean,
val enableFacebookEmbed: Boolean,
val enableInstagramEmbed: Boolean,
val enableLoomEmbed: Boolean,
Expand Down Expand Up @@ -68,6 +69,7 @@ data class GutenbergProps @JvmOverloads constructor(
putBoolean(PROP_CAPABILITIES_CONTACT_INFO_BLOCK, enableContactInfoBlock)
putBoolean(PROP_CAPABILITIES_LAYOUT_GRID_BLOCK, enableLayoutGridBlock)
putBoolean(PROP_CAPABILITIES_TILED_GALLERY_BLOCK, enableTiledGalleryBlock)
putBoolean(PROP_CAPABILITIES_VIDEOPRESS_BLOCK, enableVideoPressBlock)
putBoolean(PROP_CAPABILITIES_MEDIAFILES_COLLECTION_BLOCK, enableMediaFilesCollectionBlocks)
putBoolean(PROP_CAPABILITIES_UNSUPPORTED_BLOCK_EDITOR, enableUnsupportedBlockEditor)
putBoolean(PROP_CAPABILITIES_CAN_ENABLE_UNSUPPORTED_BLOCK_EDITOR, canEnableUnsupportedBlockEditor)
Expand Down Expand Up @@ -111,6 +113,7 @@ data class GutenbergProps @JvmOverloads constructor(
const val PROP_CAPABILITIES_CONTACT_INFO_BLOCK = "contactInfoBlock"
const val PROP_CAPABILITIES_LAYOUT_GRID_BLOCK = "layoutGridBlock"
const val PROP_CAPABILITIES_TILED_GALLERY_BLOCK = "tiledGalleryBlock"
const val PROP_CAPABILITIES_VIDEOPRESS_BLOCK = "videoPressBlock"
const val PROP_CAPABILITIES_FACEBOOK_EMBED_BLOCK = "facebookEmbed"
const val PROP_CAPABILITIES_INSTAGRAM_EMBED_BLOCK = "instagramEmbed"
const val PROP_CAPABILITIES_LOOM_EMBED_BLOCK = "loomEmbed"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ public enum Capabilities: String {
case contactInfoBlock
case layoutGridBlock
case tiledGalleryBlock
case videoPressBlock
case mediaFilesCollectionBlock
case mentions
case xposts
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ protected Bundle getLaunchOptions() {
capabilities.putBoolean(GutenbergProps.PROP_CAPABILITIES_REUSABLE_BLOCK, false);
capabilities.putBoolean(GutenbergProps.PROP_CAPABILITIES_IS_AUDIO_BLOCK_MEDIA_UPLOAD_ENABLED, true);
capabilities.putBoolean(GutenbergProps.PROP_CAPABILITIES_TILED_GALLERY_BLOCK, true);
capabilities.putBoolean(GutenbergProps.PROP_CAPABILITIES_VIDEOPRESS_BLOCK, true);
capabilities.putBoolean(GutenbergProps.PROP_CAPABILITIES_FACEBOOK_EMBED_BLOCK, true);
capabilities.putBoolean(GutenbergProps.PROP_CAPABILITIES_INSTAGRAM_EMBED_BLOCK, true);
capabilities.putBoolean(GutenbergProps.PROP_CAPABILITIES_LOOM_EMBED_BLOCK, true);
Expand Down
1 change: 1 addition & 0 deletions packages/react-native-editor/babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ module.exports = function ( api ) {
'../../node_modules/@babel/plugin-proposal-async-generator-functions'
),
'@babel/plugin-transform-runtime',
'@babel/plugin-transform-named-capturing-groups-regex',
[
'react-native-platform-specific-extensions',
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,7 @@ extension GutenbergViewController: GutenbergBridgeDataSource {
.canEnableUnsupportedBlockEditor: unsupportedBlockCanBeActivated,
.mediaFilesCollectionBlock: true,
.tiledGalleryBlock: true,
.videoPressBlock: true,
.isAudioBlockMediaUploadEnabled: true,
.reusableBlock: false,
.facebookEmbed: true,
Expand Down

1 comment on commit 55b0c38

@github-actions
Copy link

Choose a reason for hiding this comment

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

Flaky tests detected in 55b0c38.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/4182079866
📝 Reported issues:

Please sign in to comment.