diff --git a/packages/editor/src/components/provider/index.native.js b/packages/editor/src/components/provider/index.native.js index 8c9d7f8089bcf..470a8fdf729ef 100644 --- a/packages/editor/src/components/provider/index.native.js +++ b/packages/editor/src/components/provider/index.native.js @@ -89,10 +89,15 @@ class NativeEditorProvider extends Component { } componentDidMount() { - const { capabilities, updateSettings } = this.props; + const { + capabilities, + updateSettings, + galleryWithImageBlocks, + } = this.props; updateSettings( { ...capabilities, + ...{ __unstableGalleryWithImageBlocks: galleryWithImageBlocks }, ...this.getThemeColors( this.props ), } ); @@ -142,8 +147,13 @@ class NativeEditorProvider extends Component { this.subscriptionParentUpdateEditorSettings = subscribeUpdateEditorSettings( ( editorSettings ) => { - const themeColors = this.getThemeColors( editorSettings ); - updateSettings( themeColors ); + updateSettings( { + ...{ + __unstableGalleryWithImageBlocks: + editorSettings.galleryWithImageBlocks, + }, + ...this.getThemeColors( editorSettings ), + } ); } ); 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 a08225d57d422..5b35db5335f8d 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 @@ -41,6 +41,10 @@ data class GutenbergProps @JvmOverloads constructor( ?.let { putSerializable(PROP_STYLES, it) } theme.getSerializable(PROP_FEATURES) ?.let { putSerializable(PROP_FEATURES, it) } + theme.getSerializable(PROP_IS_FSE_THEME) + ?.let { putSerializable(PROP_IS_FSE_THEME, it) } + theme.getSerializable(PROP_GALLERY_WITH_IMAGE_BLOCKS) + ?.let { putSerializable(PROP_GALLERY_WITH_IMAGE_BLOCKS, it) } } } @@ -77,6 +81,8 @@ data class GutenbergProps @JvmOverloads constructor( private const val PROP_GRADIENTS = "gradients" private const val PROP_STYLES = "rawStyles" private const val PROP_FEATURES = "rawFeatures" + private const val PROP_IS_FSE_THEME = "isFSETheme" + private const val PROP_GALLERY_WITH_IMAGE_BLOCKS = "galleryWithImageBlocks" const val PROP_CAPABILITIES = "capabilities" const val PROP_CAPABILITIES_CONTACT_INFO_BLOCK = "contactInfoBlock" diff --git a/packages/react-native-bridge/ios/Gutenberg.swift b/packages/react-native-bridge/ios/Gutenberg.swift index 778967c66685b..b926c36cb3bf3 100644 --- a/packages/react-native-bridge/ios/Gutenberg.swift +++ b/packages/react-native-bridge/ios/Gutenberg.swift @@ -199,6 +199,7 @@ public class Gutenberg: NSObject { private func properties(from editorSettings: GutenbergEditorSettings?) -> [String : Any] { var settingsUpdates = [String : Any]() settingsUpdates["isFSETheme"] = editorSettings?.isFSETheme ?? false + settingsUpdates["galleryWithImageBlocks"] = editorSettings?.galleryWithImageBlocks ?? false if let rawStyles = editorSettings?.rawStyles { settingsUpdates["rawStyles"] = rawStyles diff --git a/packages/react-native-bridge/ios/GutenbergBridgeDataSource.swift b/packages/react-native-bridge/ios/GutenbergBridgeDataSource.swift index 166b257fd3319..d2cb398a36bc9 100644 --- a/packages/react-native-bridge/ios/GutenbergBridgeDataSource.swift +++ b/packages/react-native-bridge/ios/GutenbergBridgeDataSource.swift @@ -77,6 +77,7 @@ public extension GutenbergBridgeDataSource { public protocol GutenbergEditorSettings { var isFSETheme: Bool { get } + var galleryWithImageBlocks: Bool { get } var rawStyles: String? { get } var rawFeatures: String? { get } var colors: [[String: String]]? { get } diff --git a/packages/react-native-editor/src/index.js b/packages/react-native-editor/src/index.js index c8b8fd8b152ab..3fd18a1674648 100644 --- a/packages/react-native-editor/src/index.js +++ b/packages/react-native-editor/src/index.js @@ -83,6 +83,7 @@ const setupInitHooks = () => { gradients, rawStyles, rawFeatures, + galleryWithImageBlocks, } = props; if ( initialData === undefined && __DEV__ ) { @@ -110,6 +111,7 @@ const setupInitHooks = () => { gradients, rawStyles, rawFeatures, + galleryWithImageBlocks, }; } );