From 44d4886d6a11bdc27d528ff62be488a8edf0b44f Mon Sep 17 00:00:00 2001 From: Siobhan Bamber Date: Fri, 23 Feb 2024 17:09:29 +0000 Subject: [PATCH] feat: Enable new feature in Gutenberg Mobile (#59144) --- .../java/org/wordpress/mobile/WPAndroidGlue/GutenbergProps.kt | 3 +++ packages/react-native-bridge/ios/GutenbergBridgeDelegate.swift | 1 + .../android/app/src/main/java/com/gutenberg/MainActivity.java | 1 + .../ios/GutenbergDemo/GutenbergViewController.swift | 1 + 4 files changed, 6 insertions(+) diff --git a/packages/react-native-bridge/android/react-native-bridge/src/main/java/org/wordpress/mobile/WPAndroidGlue/GutenbergProps.kt b/packages/react-native-bridge/android/react-native-bridge/src/main/java/org/wordpress/mobile/WPAndroidGlue/GutenbergProps.kt index e56a9bf204e749..00b44aeb24c443 100644 --- a/packages/react-native-bridge/android/react-native-bridge/src/main/java/org/wordpress/mobile/WPAndroidGlue/GutenbergProps.kt +++ b/packages/react-native-bridge/android/react-native-bridge/src/main/java/org/wordpress/mobile/WPAndroidGlue/GutenbergProps.kt @@ -9,6 +9,7 @@ data class GutenbergProps @JvmOverloads constructor( val enableLayoutGridBlock: Boolean, val enableTiledGalleryBlock: Boolean, val enableVideoPressBlock: Boolean, + val enableVideoPressV5Support: Boolean, val enableFacebookEmbed: Boolean, val enableInstagramEmbed: Boolean, val enableLoomEmbed: Boolean, @@ -69,6 +70,7 @@ data class GutenbergProps @JvmOverloads constructor( putBoolean(PROP_CAPABILITIES_LAYOUT_GRID_BLOCK, enableLayoutGridBlock) putBoolean(PROP_CAPABILITIES_TILED_GALLERY_BLOCK, enableTiledGalleryBlock) putBoolean(PROP_CAPABILITIES_VIDEOPRESS_BLOCK, enableVideoPressBlock) + putBoolean(PROP_CAPABILITIES_VIDEOPRESS_V5_SUPPORT, enableVideoPressV5Support) putBoolean(PROP_CAPABILITIES_UNSUPPORTED_BLOCK_EDITOR, enableUnsupportedBlockEditor) putBoolean(PROP_CAPABILITIES_CAN_ENABLE_UNSUPPORTED_BLOCK_EDITOR, canEnableUnsupportedBlockEditor) putBoolean(PROP_CAPABILITIES_IS_AUDIO_BLOCK_MEDIA_UPLOAD_ENABLED, isAudioBlockMediaUploadEnabled) @@ -112,6 +114,7 @@ data class GutenbergProps @JvmOverloads constructor( 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_VIDEOPRESS_V5_SUPPORT = "videoPressV5Support" const val PROP_CAPABILITIES_FACEBOOK_EMBED_BLOCK = "facebookEmbed" const val PROP_CAPABILITIES_INSTAGRAM_EMBED_BLOCK = "instagramEmbed" const val PROP_CAPABILITIES_LOOM_EMBED_BLOCK = "loomEmbed" diff --git a/packages/react-native-bridge/ios/GutenbergBridgeDelegate.swift b/packages/react-native-bridge/ios/GutenbergBridgeDelegate.swift index 71d1e11836c6f0..d1bf6c8ba42722 100644 --- a/packages/react-native-bridge/ios/GutenbergBridgeDelegate.swift +++ b/packages/react-native-bridge/ios/GutenbergBridgeDelegate.swift @@ -30,6 +30,7 @@ public enum Capabilities: String { case layoutGridBlock case tiledGalleryBlock case videoPressBlock + case videoPressV5Support case mentions case xposts case unsupportedBlockEditor diff --git a/packages/react-native-editor/android/app/src/main/java/com/gutenberg/MainActivity.java b/packages/react-native-editor/android/app/src/main/java/com/gutenberg/MainActivity.java index 3ea19fa97b3831..a7fad00e15c414 100644 --- a/packages/react-native-editor/android/app/src/main/java/com/gutenberg/MainActivity.java +++ b/packages/react-native-editor/android/app/src/main/java/com/gutenberg/MainActivity.java @@ -209,6 +209,7 @@ private Bundle getAppOptions() { 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_VIDEOPRESS_V5_SUPPORT, 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); diff --git a/packages/react-native-editor/ios/GutenbergDemo/GutenbergViewController.swift b/packages/react-native-editor/ios/GutenbergDemo/GutenbergViewController.swift index 6e7d8fb3cdf54b..b4bdcea15915dd 100644 --- a/packages/react-native-editor/ios/GutenbergDemo/GutenbergViewController.swift +++ b/packages/react-native-editor/ios/GutenbergDemo/GutenbergViewController.swift @@ -421,6 +421,7 @@ extension GutenbergViewController: GutenbergBridgeDataSource { .canEnableUnsupportedBlockEditor: unsupportedBlockCanBeActivated, .tiledGalleryBlock: true, .videoPressBlock: true, + .videoPressV5Support: true, .isAudioBlockMediaUploadEnabled: true, .reusableBlock: false, .facebookEmbed: true,