Skip to content

Commit

Permalink
Changelog and readme.txt edits. (#40461)
Browse files Browse the repository at this point in the history
  • Loading branch information
tbradsha authored and matticbot committed Dec 4, 2024
1 parent 8398189 commit f6ae8f1
Show file tree
Hide file tree
Showing 212 changed files with 5,384 additions and 3,520 deletions.
354 changes: 341 additions & 13 deletions CHANGELOG.md

Large diffs are not rendered by default.

7 changes: 5 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"license": "GPL-2.0-or-later",
"require": {},
"require-dev": {
"yoast/phpunit-polyfills": "1.1.0",
"automattic/jetpack-changelogger": "^4.2.4"
"yoast/phpunit-polyfills": "^1.1.1",
"automattic/jetpack-changelogger": "^5.1.0"
},
"autoload": {
"classmap": [
Expand All @@ -16,6 +16,9 @@
"scripts": {
"test-js": [
"pnpm run test"
],
"test-coverage": [
"pnpm run test-coverage"
]
},
"minimum-stability": "dev",
Expand Down
17 changes: 9 additions & 8 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,36 +3,37 @@
//store for the components, but at the moment they're tied.
import './src/social-store';

// Ensure that module augmentation is applied
export type {} from './src/declarations';

export { default as Connection } from './src/components/connection';
export { default as ConnectionVerify } from './src/components/connection-verify';
export { default as Form } from './src/components/form';
export { default as SocialPreviewsModal } from './src/components/social-previews/modal';
export { default as SocialPreviewsPanel } from './src/components/social-previews/panel';
export { default as SocialImageGeneratorPanel } from './src/components/social-image-generator/panel';
export { default as SocialImageGeneratorTemplatePickerModal } from './src/components/social-image-generator/template-picker/modal';
export { default as SocialImageGeneratorToggle } from './src/components/social-image-generator/toggle';
export { default as AutoConversionToggle } from './src/components/auto-conversion/toggle';
export { default as TemplatePickerButton } from './src/components/social-image-generator/template-picker/button';
export { default as PublicizePanel } from './src/components/panel';
export { default as ReviewPrompt } from './src/components/review-prompt';
export { default as PostPublishReviewPrompt } from './src/components/post-publish-review-prompt';
export { default as PostPublishManualSharing } from './src/components/post-publish-manual-sharing';
export { default as RefreshJetpackSocialSettingsWrapper } from './src/components/refresh-jetpack-social-settings';
export { default as PostPublishPanels } from './src/components/post-publish-panels';
export { default as ConnectionManagement } from './src/components/connection-management';
export { default as UtmToggle } from './src/components/utm-toggle';

export { default as useSocialMediaConnections } from './src/hooks/use-social-media-connections';
export { default as useSocialMediaMessage } from './src/hooks/use-social-media-message';
export { default as usePublicizeConfig } from './src/hooks/use-publicize-config';
export { default as useSharePost } from './src/hooks/use-share-post';
export { default as useDismissNotice } from './src/hooks/use-dismiss-notice';

export * from './src/social-store';
export * from './src/utils';
export * from './src/components/share-post';
export * from './src/hooks/use-sync-post-data-to-store';
export * from './src/components/share-limits-bar';
export * from './src/hooks/use-saving-post';
export * from './src/hooks/use-share-limits';
export * from './src/hooks/use-post-meta';
export * from './src/hooks/use-post-can-use-sig';
export * from './src/components/share-buttons';
export * from './src/components/manage-connections-modal';
export * from './src/utils/script-data';
export * from './src/utils/shares-data';
export * from './src/components/global-modals';
69 changes: 37 additions & 32 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"private": true,
"name": "@automattic/jetpack-publicize-components",
"version": "0.54.5-alpha",
"version": "0.75.0-alpha",
"description": "A library of JS components required by the Publicize editor plugin",
"homepage": "https://github.com/Automattic/jetpack/tree/HEAD/projects/js-packages/publicize-components/#readme",
"bugs": {
Expand All @@ -15,50 +15,55 @@
"license": "GPL-2.0-or-later",
"author": "Automattic",
"scripts": {
"test": "jest"
"test": "jest",
"test-coverage": "pnpm run test --coverage"
},
"dependencies": {
"@automattic/jetpack-analytics": "^0.1.29",
"@automattic/jetpack-components": "^0.53.10",
"@automattic/jetpack-connection": "^0.33.17",
"@automattic/jetpack-shared-extension-utils": "^0.14.15",
"@automattic/jetpack-analytics": "^0.1.33",
"@automattic/jetpack-components": "^0.64.0",
"@automattic/jetpack-connection": "^0.36.0",
"@automattic/jetpack-script-data": "^0.1.5",
"@automattic/jetpack-shared-extension-utils": "^0.16.0",
"@automattic/popup-monitor": "1.0.2",
"@automattic/social-previews": "2.0.1",
"@wordpress/annotations": "3.0.0",
"@wordpress/api-fetch": "7.0.0",
"@wordpress/block-editor": "13.0.0",
"@wordpress/blocks": "13.0.0",
"@wordpress/components": "28.0.0",
"@wordpress/compose": "7.0.0",
"@wordpress/data": "10.0.0",
"@wordpress/edit-post": "8.0.0",
"@wordpress/editor": "14.0.0",
"@wordpress/element": "6.0.0",
"@wordpress/hooks": "4.0.0",
"@wordpress/html-entities": "4.0.0",
"@wordpress/i18n": "5.0.0",
"@wordpress/icons": "10.0.0",
"@wordpress/notices": "5.0.0",
"@automattic/social-previews": "2.1.0-beta.8",
"@wordpress/annotations": "3.13.0",
"@wordpress/api-fetch": "7.13.0",
"@wordpress/block-editor": "14.8.0",
"@wordpress/blocks": "14.2.0",
"@wordpress/components": "28.13.0",
"@wordpress/compose": "7.13.0",
"@wordpress/core-data": "7.13.0",
"@wordpress/data": "10.13.0",
"@wordpress/dataviews": "4.9.0",
"@wordpress/date": "5.13.0",
"@wordpress/edit-post": "8.13.0",
"@wordpress/editor": "14.13.0",
"@wordpress/element": "6.13.0",
"@wordpress/hooks": "4.13.0",
"@wordpress/html-entities": "4.13.0",
"@wordpress/i18n": "5.13.0",
"@wordpress/icons": "10.13.0",
"@wordpress/media-utils": "5.13.0",
"@wordpress/notices": "5.13.0",
"clsx": "2.1.1",
"prop-types": "15.8.1",
"react-page-visibility": "7.0.0",
"rememo": "4.0.1"
},
"devDependencies": {
"@automattic/color-studio": "2.6.0",
"@automattic/jetpack-base-styles": "^0.6.27",
"@automattic/jetpack-base-styles": "^0.6.38",
"@automattic/jetpack-webpack-config": "workspace:*",
"@babel/core": "7.24.7",
"@babel/plugin-transform-react-jsx": "7.24.7",
"@babel/preset-react": "7.24.7",
"@babel/runtime": "7.24.7",
"@testing-library/dom": "10.1.0",
"@testing-library/react": "15.0.7",
"@babel/core": "7.26.0",
"@babel/plugin-transform-react-jsx": "7.25.9",
"@babel/preset-react": "7.25.9",
"@babel/runtime": "7.26.0",
"@testing-library/dom": "10.4.0",
"@testing-library/react": "16.0.1",
"@testing-library/user-event": "14.5.2",
"@types/jest": "29.5.12",
"@types/react": "18.3.1",
"@wordpress/babel-plugin-import-jsx-pragma": "5.0.0",
"@wordpress/core-data": "7.0.0",
"@types/react": "18.3.12",
"@wordpress/babel-plugin-import-jsx-pragma": "5.13.0",
"babel-jest": "29.4.3",
"jest": "29.7.0",
"jest-environment-jsdom": "29.7.0",
Expand Down
Binary file modified src/assets/connections-facebook.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/assets/connections-instagram-business.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/assets/connections-linkedin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/assets/connections-nextdoor.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/connections-threads.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/assets/connections-tumblr.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
58 changes: 0 additions & 58 deletions src/components/auto-conversion/toggle/index.tsx

This file was deleted.

10 changes: 5 additions & 5 deletions src/components/connection-management/connection-info.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ type ConnectionInfoProps = ConnectionStatusProps;
*
* @param {ConnectionInfoProps} props - component props
*
* @returns {import('react').ReactNode} - React element
* @return {import('react').ReactNode} - React element
*/
export function ConnectionInfo( { connection, service }: ConnectionInfoProps ) {
const [ isPanelOpen, togglePanel ] = useReducer( state => ! state, false );
Expand All @@ -27,7 +27,7 @@ export function ConnectionInfo( { connection, service }: ConnectionInfoProps ) {
<div className={ styles[ 'connection-item' ] }>
<ConnectionIcon
serviceName={ connection.service_name }
label={ connection.display_name }
label={ connection.display_name || connection.external_display }
profilePicture={ connection.profile_picture }
/>
<div className={ styles[ 'connection-name-wrapper' ] }>
Expand All @@ -43,8 +43,8 @@ export function ConnectionInfo( { connection, service }: ConnectionInfoProps ) {
onClick={ togglePanel }
aria-label={
isPanelOpen
? __( 'Close panel', 'jetpack' )
: _x( 'Open panel', 'Accessibility label', 'jetpack' )
? __( 'Close panel', 'jetpack-publicize-components' )
: _x( 'Open panel', 'Accessibility label', 'jetpack-publicize-components' )
}
>
{ <Icon className={ styles.chevron } icon={ isPanelOpen ? chevronUp : chevronDown } /> }
Expand All @@ -57,7 +57,7 @@ export function ConnectionInfo( { connection, service }: ConnectionInfoProps ) {
<IconTooltip>
{ __(
'If enabled, the connection will be available to all administrators, editors, and authors.',
'jetpack'
'jetpack-publicize-components'
) }
</IconTooltip>
</div>
Expand Down
13 changes: 9 additions & 4 deletions src/components/connection-management/connection-name.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ type ConnectionNameProps = {
*
* @param {ConnectionNameProps} props - component props
*
* @returns {import('react').ReactNode} - React element
* @return {import('react').ReactNode} - React element
*/
export function ConnectionName( { connection }: ConnectionNameProps ) {
const isUpdating = useSelect(
Expand All @@ -27,14 +27,19 @@ export function ConnectionName( { connection }: ConnectionNameProps ) {
return (
<div className={ styles[ 'connection-name' ] }>
{ ! connection.profile_link ? (
<span className={ styles[ 'profile-link' ] }>{ connection.display_name }</span>
<span className={ styles[ 'profile-link' ] }>
{ connection.display_name || connection.external_name }
</span>
) : (
<ExternalLink className={ styles[ 'profile-link' ] } href={ connection.profile_link }>
{ connection.display_name || connection.external_display }
{ connection.display_name || connection.external_display || connection.external_name }
</ExternalLink>
) }
{ isUpdating ? (
<Spinner color="black" aria-label={ __( 'Updating account', 'jetpack' ) } />
<Spinner
color="black"
aria-label={ __( 'Updating account', 'jetpack-publicize-components' ) }
/>
) : null }
</div>
);
Expand Down
25 changes: 21 additions & 4 deletions src/components/connection-management/connection-status.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import { __, _x } from '@wordpress/i18n';
import { getRedirectUrl } from '@automattic/jetpack-components';
import { ExternalLink } from '@wordpress/components';
import { createInterpolateElement } from '@wordpress/element';
import { __, sprintf } from '@wordpress/i18n';
import { Connection } from '../../social-store/types';
import { SupportedService } from '../services/use-supported-services';
import { Disconnect } from './disconnect';
Expand All @@ -14,7 +17,7 @@ export type ConnectionStatusProps = {
*
* @param {ConnectionStatusProps} props - component props
*
* @returns {import('react').ReactNode} - React element
* @return {import('react').ReactNode} - React element
*/
export function ConnectionStatus( { connection, service }: ConnectionStatusProps ) {
if ( connection.status !== 'broken' ) {
Expand All @@ -25,8 +28,22 @@ export function ConnectionStatus( { connection, service }: ConnectionStatusProps
<div>
<span className="description">
{ service
? __( 'There is an issue with this connection.', 'jetpack' )
: _x( 'This platform is no longer supported.', '', 'jetpack' ) }
? __( 'There is an issue with this connection.', 'jetpack-publicize-components' )
: createInterpolateElement(
sprintf(
'%1$s %2$s',
__( 'This platform is no longer supported.', 'jetpack-publicize-components' ),
__(
'You can use our <link>Manual Sharing</link> feature instead.',
'jetpack-publicize-components'
)
),
{
link: (
<ExternalLink href={ getRedirectUrl( 'jetpack-social-manual-sharing-help' ) } />
),
}
) }
</span>
&nbsp;
{ service ? (
Expand Down
22 changes: 14 additions & 8 deletions src/components/connection-management/disconnect.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Button } from '@automattic/jetpack-components';
// eslint-disable-next-line wpcalypso/no-unsafe-wp-apis
import { __experimentalConfirmDialog as ConfirmDialog } from '@wordpress/components';
import { __experimentalConfirmDialog as ConfirmDialog } from '@wordpress/components'; // eslint-disable-line @wordpress/no-unsafe-wp-apis
import { useDispatch, useSelect } from '@wordpress/data';
import { createInterpolateElement, useCallback, useReducer } from '@wordpress/element';
import { __, _x, sprintf } from '@wordpress/i18n';
Expand All @@ -19,7 +18,7 @@ export type DisconnectProps = {
*
* @param {DisconnectProps} props - component props
*
* @returns {import('react').ReactNode} - React element
* @return {import('react').ReactNode} - React element
*/
export function Disconnect( {
connection,
Expand Down Expand Up @@ -61,13 +60,16 @@ export function Disconnect( {
isOpen={ isConfirmOpen }
onConfirm={ onClickDisconnect }
onCancel={ toggleConfirm }
cancelButtonText={ __( 'Cancel', 'jetpack' ) }
confirmButtonText={ __( 'Yes', 'jetpack' ) }
cancelButtonText={ __( 'Cancel', 'jetpack-publicize-components' ) }
confirmButtonText={ __( 'Yes', 'jetpack-publicize-components' ) }
>
{ createInterpolateElement(
sprintf(
// translators: %s: The name of the connection the user is disconnecting.
__( 'Are you sure you want to disconnect <strong>%s</strong>?', 'jetpack' ),
__(
'Are you sure you want to disconnect <strong>%s</strong>?',
'jetpack-publicize-components'
),
connection.display_name
),
{ strong: <strong></strong> }
Expand All @@ -82,8 +84,12 @@ export function Disconnect( {
className={ buttonClassName }
>
{ isDisconnecting
? __( 'Disconnecting…', 'jetpack' )
: _x( 'Disconnect', 'Disconnect a social media account', 'jetpack' ) }
? __( 'Disconnecting…', 'jetpack-publicize-components' )
: _x(
'Disconnect',
'Disconnect a social media account',
'jetpack-publicize-components'
) }
</Button>
</>
);
Expand Down
Loading

0 comments on commit f6ae8f1

Please sign in to comment.