-
Notifications
You must be signed in to change notification settings - Fork 800
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
AI Featured Image: add media source entry point for the tool (#37166)
* Add AI generated image button on external media dropdown * Accept the placement value as a parameter of the component * Set the placement when using the component on the Jetpack sidebar * Rename const to follow the standard of the other existing const * Support the media source dropdown placement * Only show the sidebar generate button for the jetpack sidebar placement * Add extra onClose handling to support the close event on the media source dropdown * Trigger the image generation automatically when the tool is placed on the media source dropdown * Fix error when clicking outside of modal, was trying to close without handler; prevent closing as well * Add flag to ensure only one automattic generation call * changelog * Show message when the post has no content * Prevent image generation when the site does not have enough requests to generate the image
- Loading branch information
1 parent
3e9adbe
commit a9a6ead
Showing
9 changed files
with
157 additions
and
28 deletions.
There are no files selected for viewing
4 changes: 4 additions & 0 deletions
4
projects/plugins/jetpack/changelog/update-ai-featured-image-add-external-media-entrypoint
This file contains 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,4 @@ | ||
Significance: minor | ||
Type: other | ||
|
||
AI Featured Image: add entry point on the media source dropdown menu. |
This file contains 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 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 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 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 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 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 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
14 changes: 14 additions & 0 deletions
14
...cts/plugins/jetpack/extensions/shared/external-media/sources/jetpack-ai-featured-image.js
This file contains 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,14 @@ | ||
import FeaturedImage, { | ||
FEATURED_IMAGE_PLACEMENT_MEDIA_SOURCE_DROPDOWN, | ||
} from '../../../plugins/ai-assistant-plugin/components/featured-image'; | ||
|
||
function JetpackAIFeaturedImage( { onClose = () => {} } ) { | ||
return ( | ||
<FeaturedImage | ||
placement={ FEATURED_IMAGE_PLACEMENT_MEDIA_SOURCE_DROPDOWN } | ||
onClose={ onClose } | ||
/> | ||
); | ||
} | ||
|
||
export default JetpackAIFeaturedImage; |