Skip to content

Commit

Permalink
Merge pull request #17224 from wordpress-mobile/gutenberg/embed-block…
Browse files Browse the repository at this point in the history
…-jetpack-variants

[Gutenberg][Embed block] Include Jetpack embed variants
  • Loading branch information
fluiddot authored Oct 6, 2021
2 parents db6a2ae + 76d0501 commit 887c65e
Show file tree
Hide file tree
Showing 6 changed files with 123 additions and 95 deletions.
2 changes: 1 addition & 1 deletion Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ abstract_target 'Apps' do
## Gutenberg (React Native)
## =====================
##
gutenberg :tag => 'v1.63.0'
gutenberg :tag => 'v1.64.0-alpha2'

## Third party libraries
## =====================
Expand Down
186 changes: 93 additions & 93 deletions Podfile.lock

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions RELEASE-NOTES.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
18.5
-----
* [**] Block editor: Embed block: Include Jetpack embed variants. [https://github.com/wordpress-mobile/gutenberg-mobile/pull/4008]


18.4
Expand Down
9 changes: 9 additions & 0 deletions WordPress/Classes/Models/Blog.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,15 @@ typedef NS_ENUM(NSUInteger, BlogFeature) {
BlogFeatureBlockEditorSettings,
/// Does the blog support the Layout grid block?
BlogFeatureLayoutGrid,
/// Does the blog support Facebook embed block?
BlogFeatureFacebookEmbed,
/// Does the blog support Instagram embed block?
BlogFeatureInstagramEmbed,
/// Does the blog support Loom embed block?
BlogFeatureLoomEmbed,
/// Does the blog support Smartframe embed block?
BlogFeatureSmartframeEmbed,

};

typedef NS_ENUM(NSInteger, SiteVisibility) {
Expand Down
13 changes: 13 additions & 0 deletions WordPress/Classes/Models/Blog.m
Original file line number Diff line number Diff line change
Expand Up @@ -580,6 +580,14 @@ - (BOOL)supports:(BlogFeature)feature
return [self supportsBlockEditorSettings];
case BlogFeatureLayoutGrid:
return [self supportsLayoutGrid];
case BlogFeatureFacebookEmbed:
return [self supportsEmbedVariation: @"9.0"];
case BlogFeatureInstagramEmbed:
return [self supportsEmbedVariation: @"9.0"];
case BlogFeatureLoomEmbed:
return [self supportsEmbedVariation: @"9.0"];
case BlogFeatureSmartframeEmbed:
return [self supportsEmbedVariation: @"10.2"];
}
}

Expand Down Expand Up @@ -680,6 +688,11 @@ - (BOOL)supportsLayoutGrid
return self.isHostedAtWPcom || self.isAtomic;
}

- (BOOL)supportsEmbedVariation:(NSString *)requiredJetpackVersion
{
return [self hasRequiredJetpackVersion:requiredJetpackVersion] || self.isHostedAtWPcom;
}

- (BOOL)accountIsDefaultAccount
{
AccountService *accountService = [[AccountService alloc] initWithManagedObjectContext:self.managedObjectContext];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1152,7 +1152,12 @@ extension GutenbergViewController: GutenbergBridgeDataSource {
// (https://github.com/wordpress-mobile/gutenberg-mobile/issues/3457) in self-hosted sites is fixed
.reusableBlock: isWPComSite,
.editorOnboarding: canViewEditorOnboarding(),
.firstGutenbergEditorSession: !gutenbergSettings.hasLaunchedGutenbergEditor
.firstGutenbergEditorSession: !gutenbergSettings.hasLaunchedGutenbergEditor,
// Jetpack embeds
.facebookEmbed: post.blog.supports(.facebookEmbed),
.instagramEmbed: post.blog.supports(.instagramEmbed),
.loomEmbed: post.blog.supports(.loomEmbed),
.smartframeEmbed: post.blog.supports(.smartframeEmbed)
]
}

Expand Down

0 comments on commit 887c65e

Please sign in to comment.