-
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.
Merge remote-tracking branch 'origin/trunk' into add/ab-experiment-we…
…lcome-flow
- Loading branch information
Showing
186 changed files
with
2,958 additions
and
304 deletions.
There are no files selected for viewing
4 changes: 4 additions & 0 deletions
4
projects/js-packages/ai-client/changelog/update-ai-logo-generator-fix-upgrade-message
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: patch | ||
Type: fixed | ||
|
||
AI Logo Generator: update upgrade message. |
4 changes: 4 additions & 0 deletions
4
projects/js-packages/ai-client/changelog/update-ai-logo-generator-small-ui-fixes
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: patch | ||
Type: fixed | ||
|
||
AI Logo Generator: fix small UI issues. |
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
4 changes: 4 additions & 0 deletions
4
projects/js-packages/components/changelog/add-preview-section-to-the-social-post-modal
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: patch | ||
Type: fixed | ||
|
||
Fixed TS types for Notice components by marking optional props as such |
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
4 changes: 4 additions & 0 deletions
4
...js-packages/publicize-components/changelog/add-connection-toggle-to-the-social-post-modal
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: patch | ||
Type: added | ||
|
||
Added connection toggle to social post preview |
4 changes: 4 additions & 0 deletions
4
...s/js-packages/publicize-components/changelog/add-preview-section-to-the-social-post-modal
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: patch | ||
Type: added | ||
|
||
Added preview section to the social post modal |
4 changes: 4 additions & 0 deletions
4
...ects/js-packages/publicize-components/changelog/add-settings-section-to-social-post-modal
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: patch | ||
Type: added | ||
|
||
Social: Added settings section to the social post modal |
4 changes: 4 additions & 0 deletions
4
projects/js-packages/publicize-components/changelog/add-social-feature-flag-management-fixed
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: added | ||
|
||
Added feature flag management for social |
4 changes: 4 additions & 0 deletions
4
projects/js-packages/publicize-components/changelog/add-social-post-ui-modal
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: added | ||
|
||
Added Social post UI modal and trigger |
4 changes: 4 additions & 0 deletions
4
...-packages/publicize-components/changelog/fix-no-media-notice-for-instagram-when-sig-is-on
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: patch | ||
Type: fixed | ||
|
||
Fix the media validation notice for Instagram when SIG is enabled |
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
34 changes: 34 additions & 0 deletions
34
projects/js-packages/publicize-components/src/components/services/use-service.ts
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,34 @@ | ||
import { useCallback, useMemo } from 'react'; | ||
import { SupportedService, useSupportedServices } from './use-supported-services'; | ||
|
||
export interface GetService { | ||
/** | ||
* @param {string} service_name - The name of the service. | ||
*/ | ||
( service_name: string ): SupportedService; | ||
} | ||
|
||
export type SupportedServicesMap = Record< string, SupportedService >; | ||
|
||
/** | ||
* Returns the service object for a service name. | ||
* | ||
* @returns {GetService} - The service object. | ||
*/ | ||
export function useService() { | ||
const supportedServices = useSupportedServices(); | ||
|
||
const servicesMap = useMemo( () => { | ||
return supportedServices.reduce< SupportedServicesMap >( ( acc, service ) => { | ||
acc[ service.ID ] = service; | ||
return acc; | ||
}, {} ); | ||
}, [ supportedServices ] ); | ||
|
||
return useCallback< GetService >( | ||
service_name => { | ||
return servicesMap[ service_name ]; | ||
}, | ||
[ servicesMap ] | ||
); | ||
} |
35 changes: 35 additions & 0 deletions
35
...packages/publicize-components/src/components/social-post-modal/instagram-media-notice.tsx
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,35 @@ | ||
import { Notice, getRedirectUrl } from '@automattic/jetpack-components'; | ||
import { ExternalLink } from '@wordpress/components'; | ||
import { __, _x } from '@wordpress/i18n'; | ||
import usePublicizeConfig from '../../hooks/use-publicize-config'; | ||
|
||
/** | ||
* Instagram media notice component. | ||
* | ||
* @returns {import('react').ReactNode} - Instagram media notice component. | ||
*/ | ||
export function InstagramMediaNotice() { | ||
const { isEnhancedPublishingEnabled } = usePublicizeConfig(); | ||
|
||
return ( | ||
<Notice | ||
hideCloseButton | ||
actions={ [ | ||
<ExternalLink href={ getRedirectUrl( 'jetpack-social-share-to-instagram' ) }> | ||
{ __( 'Learn more', 'jetpack' ) } | ||
</ExternalLink>, | ||
] } | ||
> | ||
{ isEnhancedPublishingEnabled | ||
? __( | ||
'To share to Instagram, add an image/video, or enable Social Image Generator.', | ||
'jetpack' | ||
) | ||
: _x( | ||
'You need a featured image to share to Instagram.', | ||
'The message shown in the Instagram social preview', | ||
'jetpack' | ||
) } | ||
</Notice> | ||
); | ||
} |
43 changes: 43 additions & 0 deletions
43
projects/js-packages/publicize-components/src/components/social-post-modal/modal.tsx
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,43 @@ | ||
import { Modal, PanelRow, Button } from '@wordpress/components'; | ||
import { useReducer } from '@wordpress/element'; | ||
import { __ } from '@wordpress/i18n'; | ||
import { close } from '@wordpress/icons'; | ||
import { PreviewSection } from './preview-section'; | ||
import { SettingsSection } from './settings-section'; | ||
import styles from './styles.module.scss'; | ||
|
||
/** | ||
* The Social Post Modal component. | ||
* | ||
* @returns {import('react').ReactNode} - Social Post Modal component. | ||
*/ | ||
export function SocialPostModal() { | ||
const [ isModalOpen, toggleModal ] = useReducer( state => ! state, false ); | ||
|
||
return ( | ||
<PanelRow className={ styles.panel }> | ||
{ isModalOpen && ( | ||
<Modal | ||
onRequestClose={ toggleModal } | ||
title={ __( 'Social Previews', 'jetpack' ) } | ||
className={ styles.modal } | ||
__experimentalHideHeader | ||
> | ||
<div className={ styles[ 'modal-content' ] }> | ||
<SettingsSection /> | ||
<PreviewSection /> | ||
</div> | ||
<Button | ||
className={ styles[ 'close-button' ] } | ||
onClick={ toggleModal } | ||
icon={ close } | ||
label={ __( 'Close', 'jetpack' ) } | ||
/> | ||
</Modal> | ||
) } | ||
<Button variant="secondary" onClick={ toggleModal }> | ||
{ __( 'Preview social posts', 'jetpack' ) } | ||
</Button> | ||
</PanelRow> | ||
); | ||
} |
Oops, something went wrong.