@automattic/jetpack-connection 1.2.7 → 1.2.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +5 -0
- package/README.md +4 -4
- package/components/connect-button/index.jsx +1 -2
- package/components/connect-screen/basic/index.tsx +5 -5
- package/components/connect-screen/basic/visual.tsx +2 -2
- package/components/connect-screen/layout/image-slider.tsx +5 -4
- package/components/connect-screen/layout/index.tsx +2 -2
- package/components/connect-screen/required-plan/index.jsx +1 -2
- package/components/connect-screen/required-plan/visual.jsx +1 -2
- package/components/connected-plugins/index.jsx +4 -4
- package/components/connection-error-notice/index.jsx +1 -2
- package/components/disconnect-card/index.jsx +1 -2
- package/components/disconnect-dialog/index.jsx +3 -3
- package/components/disconnect-dialog/steps/step-disconnect-confirm.jsx +1 -2
- package/components/disconnect-dialog/steps/step-disconnect.jsx +6 -6
- package/components/disconnect-dialog/steps/step-survey.jsx +1 -2
- package/components/disconnect-dialog/steps/step-thank-you.jsx +1 -2
- package/components/disconnect-survey/index.jsx +6 -6
- package/components/disconnect-survey/survey-choice.jsx +7 -7
- package/components/in-place-connection/index.jsx +2 -2
- package/components/manage-connection-dialog/index.jsx +2 -2
- package/components/owner-disconnect-dialog/index.jsx +2 -2
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
### This is a list detailing changes for the Jetpack RNA Connection Component releases.
|
|
4
4
|
|
|
5
|
+
## [1.2.8] - 2025-07-01
|
|
6
|
+
### Changed
|
|
7
|
+
- Internal updates.
|
|
8
|
+
|
|
5
9
|
## [1.2.7] - 2025-06-30
|
|
6
10
|
### Changed
|
|
7
11
|
- Update dependencies.
|
|
@@ -1080,6 +1084,7 @@
|
|
|
1080
1084
|
- `Main` and `ConnectUser` components added.
|
|
1081
1085
|
- `JetpackRestApiClient` API client added.
|
|
1082
1086
|
|
|
1087
|
+
[1.2.8]: https://github.com/Automattic/jetpack-connection-js/compare/v1.2.7...v1.2.8
|
|
1083
1088
|
[1.2.7]: https://github.com/Automattic/jetpack-connection-js/compare/v1.2.6...v1.2.7
|
|
1084
1089
|
[1.2.6]: https://github.com/Automattic/jetpack-connection-js/compare/v1.2.5...v1.2.6
|
|
1085
1090
|
[1.2.5]: https://github.com/Automattic/jetpack-connection-js/compare/v1.2.4...v1.2.5
|
package/README.md
CHANGED
|
@@ -40,7 +40,7 @@ The component implements the connection screen page, and loads the `ConnectButto
|
|
|
40
40
|
|
|
41
41
|
### Usage
|
|
42
42
|
```jsx
|
|
43
|
-
import
|
|
43
|
+
import { useState, useCallback } from 'react';
|
|
44
44
|
import { ConnectScreen } from '@automattic/jetpack-connection';
|
|
45
45
|
|
|
46
46
|
const [ connectionStatus, setConnectionStatus ] = useState( {} );
|
|
@@ -81,7 +81,7 @@ The component displays the connection button and handles the connection process,
|
|
|
81
81
|
|
|
82
82
|
### Basic Usage
|
|
83
83
|
```jsx
|
|
84
|
-
import
|
|
84
|
+
import { useCallback } from 'react';
|
|
85
85
|
import { ConnectButton } from '@automattic/jetpack-connection';
|
|
86
86
|
|
|
87
87
|
const onUserConnected = useCallback( () => alert( 'User Connected' ) );
|
|
@@ -184,7 +184,7 @@ This way we ensure that `onDisconnected` will always be called via clicking the
|
|
|
184
184
|
|
|
185
185
|
### Basic Usage
|
|
186
186
|
```jsx
|
|
187
|
-
import
|
|
187
|
+
import { useCallback } from 'react';
|
|
188
188
|
import { DisconnectDialog } from '@automattic/jetpack-connection';
|
|
189
189
|
|
|
190
190
|
const onDisconnectedCallback = useCallback( () => alert( 'Successfully Disconnected' ) );
|
|
@@ -230,7 +230,7 @@ The `Disconnect` functionality is **temporary**. In the future, it will be repla
|
|
|
230
230
|
|
|
231
231
|
### Basic Usage
|
|
232
232
|
```jsx
|
|
233
|
-
import
|
|
233
|
+
import { useCallback } from 'react';
|
|
234
234
|
import { ConnectionStatusCard } from '@automattic/jetpack-connection';
|
|
235
235
|
|
|
236
236
|
const onDisconnectedCallback = useCallback( () => alert( 'Successfully Disconnected' ) );
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import { ActionButton } from '@automattic/jetpack-components';
|
|
2
2
|
import { __ } from '@wordpress/i18n';
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
|
-
import React from 'react';
|
|
5
4
|
import useConnection from '../use-connection';
|
|
6
5
|
|
|
7
6
|
/**
|
|
8
7
|
* The RNA connection component.
|
|
9
8
|
*
|
|
10
9
|
* @param {object} props -- The properties.
|
|
11
|
-
* @return {
|
|
10
|
+
* @return {import('react').Component} The RNA connection component.
|
|
12
11
|
*/
|
|
13
12
|
const ConnectButton = props => {
|
|
14
13
|
const {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { __ } from '@wordpress/i18n';
|
|
2
|
-
import React from 'react';
|
|
3
2
|
import useConnection from '../../use-connection';
|
|
4
3
|
import ConnectScreenVisual from './visual';
|
|
4
|
+
import type { FC, ReactNode } from 'react';
|
|
5
5
|
|
|
6
6
|
export type Props = {
|
|
7
7
|
// API root
|
|
@@ -13,7 +13,7 @@ export type Props = {
|
|
|
13
13
|
// The redirect admin UR
|
|
14
14
|
redirectUri: string;
|
|
15
15
|
// Additional page elements to show before the call to action
|
|
16
|
-
children:
|
|
16
|
+
children: ReactNode;
|
|
17
17
|
// The Title
|
|
18
18
|
title?: string;
|
|
19
19
|
// The Connect Button label
|
|
@@ -33,15 +33,15 @@ export type Props = {
|
|
|
33
33
|
// Whether to skip the pricing page after the connection screen
|
|
34
34
|
skipPricingPage?: boolean;
|
|
35
35
|
// Additional page elements to show after the call to action
|
|
36
|
-
footer?:
|
|
36
|
+
footer?: ReactNode;
|
|
37
37
|
// The logo to display at the top of the component
|
|
38
|
-
logo?:
|
|
38
|
+
logo?: ReactNode;
|
|
39
39
|
};
|
|
40
40
|
|
|
41
41
|
/*
|
|
42
42
|
* The Connection Screen component.
|
|
43
43
|
*/
|
|
44
|
-
const ConnectScreen:
|
|
44
|
+
const ConnectScreen: FC< Props > = ( {
|
|
45
45
|
title,
|
|
46
46
|
buttonLabel,
|
|
47
47
|
loadingLabel,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { ActionButton, TermsOfService, getRedirectUrl } from '@automattic/jetpack-components';
|
|
2
2
|
import { createInterpolateElement } from '@wordpress/element';
|
|
3
3
|
import { __ } from '@wordpress/i18n';
|
|
4
|
-
import React from 'react';
|
|
5
4
|
import ConnectScreenLayout from '../layout';
|
|
6
5
|
import type { Props as ConnectScreenProps } from '../basic';
|
|
7
6
|
import type { WithRequired } from '../types';
|
|
7
|
+
import type { FC } from 'react';
|
|
8
8
|
import './style.scss';
|
|
9
9
|
|
|
10
10
|
type SharedProps = Pick<
|
|
@@ -70,7 +70,7 @@ const getErrorMessage = ( errorCode, isOfflineMode ) => {
|
|
|
70
70
|
/*
|
|
71
71
|
* The Connection Screen Visual component.
|
|
72
72
|
*/
|
|
73
|
-
const ConnectScreenVisual:
|
|
73
|
+
const ConnectScreenVisual: FC< Props > = ( {
|
|
74
74
|
title,
|
|
75
75
|
images,
|
|
76
76
|
children,
|
|
@@ -1,20 +1,21 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Fragment } from 'react';
|
|
2
2
|
import type { Props as ConnectScreenProps } from '../basic';
|
|
3
|
+
import type { FC } from 'react';
|
|
3
4
|
|
|
4
5
|
export type Props = Pick< ConnectScreenProps, 'images' | 'assetBaseUrl' >;
|
|
5
6
|
|
|
6
7
|
/*
|
|
7
8
|
* The ImageSlider component.
|
|
8
9
|
*/
|
|
9
|
-
const ImageSlider:
|
|
10
|
+
const ImageSlider: FC< Props > = ( { images, assetBaseUrl = '' } ) => {
|
|
10
11
|
if ( ! images?.length ) {
|
|
11
12
|
return null;
|
|
12
13
|
}
|
|
13
14
|
|
|
14
15
|
const imagesHTML = images.map( ( image, index ) => (
|
|
15
|
-
<
|
|
16
|
+
<Fragment key={ index }>
|
|
16
17
|
<img src={ assetBaseUrl + image } alt="" />
|
|
17
|
-
</
|
|
18
|
+
</Fragment>
|
|
18
19
|
) );
|
|
19
20
|
|
|
20
21
|
return <div className="jp-connection__connect-screen__image-slider">{ imagesHTML }</div>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { JetpackLogo } from '@automattic/jetpack-components';
|
|
2
2
|
import clsx from 'clsx';
|
|
3
|
-
import React from 'react';
|
|
4
3
|
import ImageSlider from './image-slider';
|
|
5
4
|
import type { Props as ConnectScreenProps } from '../basic';
|
|
6
5
|
import type { WithRequired } from '../types';
|
|
6
|
+
import type { FC } from 'react';
|
|
7
7
|
import './style.scss';
|
|
8
8
|
|
|
9
9
|
type SharedProps = Pick<
|
|
@@ -22,7 +22,7 @@ export type Props = WithRequired< SharedProps, 'title' > & OwnProps;
|
|
|
22
22
|
/*
|
|
23
23
|
* The Connection Screen Layout component.
|
|
24
24
|
*/
|
|
25
|
-
const ConnectScreenLayout:
|
|
25
|
+
const ConnectScreenLayout: FC< Props > = ( {
|
|
26
26
|
title,
|
|
27
27
|
children,
|
|
28
28
|
className,
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { __ } from '@wordpress/i18n';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
import React from 'react';
|
|
4
3
|
import useProductCheckoutWorkflow from '../../../hooks/use-product-checkout-workflow';
|
|
5
4
|
import useConnection from '../../use-connection';
|
|
6
5
|
import ConnectScreenRequiredPlanVisual from './visual';
|
|
@@ -9,7 +8,7 @@ import ConnectScreenRequiredPlanVisual from './visual';
|
|
|
9
8
|
* The Connection Screen Visual component for consumers that require a Plan.
|
|
10
9
|
*
|
|
11
10
|
* @param {object} props -- The properties.
|
|
12
|
-
* @return {
|
|
11
|
+
* @return {import('react').Component} The `ConnectScreenForRequiredPlan` component.
|
|
13
12
|
*/
|
|
14
13
|
const ConnectScreenRequiredPlan = props => {
|
|
15
14
|
const {
|
|
@@ -9,7 +9,6 @@ import { __ } from '@wordpress/i18n';
|
|
|
9
9
|
import clsx from 'clsx';
|
|
10
10
|
import debugFactory from 'debug';
|
|
11
11
|
import PropTypes from 'prop-types';
|
|
12
|
-
import React from 'react';
|
|
13
12
|
import ConnectScreenLayout from '../layout';
|
|
14
13
|
import './style.scss';
|
|
15
14
|
|
|
@@ -19,7 +18,7 @@ const debug = debugFactory( 'jetpack:connection:ConnectScreenRequiredPlanVisual'
|
|
|
19
18
|
* The Connection Screen Visual component for consumers that require a Plan.
|
|
20
19
|
*
|
|
21
20
|
* @param {object} props -- The properties.
|
|
22
|
-
* @return {
|
|
21
|
+
* @return {import('react').Component} The `ConnectScreenRequiredPlanVisual` component.
|
|
23
22
|
*/
|
|
24
23
|
const ConnectScreenRequiredPlanVisual = props => {
|
|
25
24
|
const {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { __ } from '@wordpress/i18n';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
import
|
|
3
|
+
import { Fragment, useMemo } from 'react';
|
|
4
4
|
import DisconnectCard from '../disconnect-card';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Render a list of connected plugins.
|
|
8
8
|
*
|
|
9
9
|
* @param {object} props - The properties
|
|
10
|
-
* @return {
|
|
10
|
+
* @return {import('react').Component} - The ConnectedPlugins React component
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
13
|
const ConnectedPlugins = props => {
|
|
@@ -35,7 +35,7 @@ const ConnectedPlugins = props => {
|
|
|
35
35
|
|
|
36
36
|
if ( connectedPlugins && connectedPluginsArray.length > 0 ) {
|
|
37
37
|
return (
|
|
38
|
-
<
|
|
38
|
+
<Fragment>
|
|
39
39
|
<div className="jp-connection__disconnect-dialog__step-copy">
|
|
40
40
|
<p className="jp-connection__disconnect-dialog__large-text">
|
|
41
41
|
{ __(
|
|
@@ -49,7 +49,7 @@ const ConnectedPlugins = props => {
|
|
|
49
49
|
return <DisconnectCard title={ plugin.name } key={ plugin.slug } />;
|
|
50
50
|
} ) }
|
|
51
51
|
</div>
|
|
52
|
-
</
|
|
52
|
+
</Fragment>
|
|
53
53
|
);
|
|
54
54
|
}
|
|
55
55
|
|
|
@@ -2,14 +2,13 @@ import { Spinner, useBreakpointMatch } from '@automattic/jetpack-components';
|
|
|
2
2
|
import { Icon, Notice, Path, SVG } from '@wordpress/components';
|
|
3
3
|
import { __, sprintf } from '@wordpress/i18n';
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
5
|
-
import React from 'react';
|
|
6
5
|
import styles from './styles.module.scss';
|
|
7
6
|
|
|
8
7
|
/**
|
|
9
8
|
* The RNA Connection Error Notice component.
|
|
10
9
|
*
|
|
11
10
|
* @param {object} props -- The properties.
|
|
12
|
-
* @return {
|
|
11
|
+
* @return {import('react').Component} The `ConnectionErrorNotice` component.
|
|
13
12
|
*/
|
|
14
13
|
const ConnectionErrorNotice = props => {
|
|
15
14
|
const {
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import PropTypes from 'prop-types';
|
|
2
|
-
import React from 'react';
|
|
3
2
|
|
|
4
3
|
import './style.scss';
|
|
5
4
|
|
|
@@ -8,7 +7,7 @@ import './style.scss';
|
|
|
8
7
|
* Used in the disconnection flow.
|
|
9
8
|
*
|
|
10
9
|
* @param {object} props - The Properties.
|
|
11
|
-
* @return {
|
|
10
|
+
* @return {import('react').Component} DisconnectCard - The disconnect card component.
|
|
12
11
|
*/
|
|
13
12
|
const DisconnectCard = props => {
|
|
14
13
|
const { title, value, description } = props;
|
|
@@ -4,7 +4,7 @@ import { jetpackConfigHas, jetpackConfigGet } from '@automattic/jetpack-config';
|
|
|
4
4
|
import { Modal } from '@wordpress/components';
|
|
5
5
|
import { __ } from '@wordpress/i18n';
|
|
6
6
|
import PropTypes from 'prop-types';
|
|
7
|
-
import
|
|
7
|
+
import { useMemo, useEffect, useCallback, useState } from 'react';
|
|
8
8
|
import './style.scss';
|
|
9
9
|
import StepDisconnect from './steps/step-disconnect';
|
|
10
10
|
import StepDisconnectConfirm from './steps/step-disconnect-confirm';
|
|
@@ -15,7 +15,7 @@ import StepThankYou from './steps/step-thank-you';
|
|
|
15
15
|
* The RNA Disconnect Dialog component.
|
|
16
16
|
*
|
|
17
17
|
* @param {object} props -- The properties.
|
|
18
|
-
* @return {
|
|
18
|
+
* @return {import('react').Component} The `DisconnectDialog` component.
|
|
19
19
|
*/
|
|
20
20
|
const DisconnectDialog = props => {
|
|
21
21
|
const [ isDisconnecting, setIsDisconnecting ] = useState( false );
|
|
@@ -302,7 +302,7 @@ const DisconnectDialog = props => {
|
|
|
302
302
|
/**
|
|
303
303
|
* Determine what step to show based on the current state
|
|
304
304
|
*
|
|
305
|
-
* @return {
|
|
305
|
+
* @return { import('react').Component|undefined } - component for current step
|
|
306
306
|
*/
|
|
307
307
|
const getCurrentStep = () => {
|
|
308
308
|
if ( ! isDisconnected ) {
|
|
@@ -3,7 +3,6 @@ import { Button } from '@wordpress/components';
|
|
|
3
3
|
import { createInterpolateElement } from '@wordpress/element';
|
|
4
4
|
import { __ } from '@wordpress/i18n';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
|
-
import React from 'react';
|
|
7
6
|
import disconnectImage from '../images/disconnect-confirm.jpg';
|
|
8
7
|
|
|
9
8
|
/**
|
|
@@ -11,7 +10,7 @@ import disconnectImage from '../images/disconnect-confirm.jpg';
|
|
|
11
10
|
* Will only show option to provide feedback if the canProvideFeedback prop is true.
|
|
12
11
|
*
|
|
13
12
|
* @param {object} props - The properties.
|
|
14
|
-
* @return {
|
|
13
|
+
* @return {import('react').Component} - StepDisconnectConfirm Component
|
|
15
14
|
*/
|
|
16
15
|
const StepDisconnectConfirm = props => {
|
|
17
16
|
const { onExit, canProvideFeedback, onProvideFeedback } = props;
|
|
@@ -3,14 +3,14 @@ import { Button, ExternalLink } from '@wordpress/components';
|
|
|
3
3
|
import { createInterpolateElement } from '@wordpress/element';
|
|
4
4
|
import { __ } from '@wordpress/i18n';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
|
-
import
|
|
6
|
+
import { Fragment, useCallback, useEffect } from 'react';
|
|
7
7
|
import ConnectedPlugins from '../../connected-plugins';
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* Disconnect step in disconnection flow.
|
|
11
11
|
*
|
|
12
12
|
* @param {object} props - The properties.
|
|
13
|
-
* @return {
|
|
13
|
+
* @return {import('react').Component} - The StepDisconnect component
|
|
14
14
|
*/
|
|
15
15
|
const StepDisconnect = props => {
|
|
16
16
|
const {
|
|
@@ -66,7 +66,7 @@ const StepDisconnect = props => {
|
|
|
66
66
|
/**
|
|
67
67
|
* Render the disconnect button, allows for some variance based on context.
|
|
68
68
|
*
|
|
69
|
-
* @return {
|
|
69
|
+
* @return {import('react').Component} - Button used for disconnect.
|
|
70
70
|
*/
|
|
71
71
|
const renderDisconnectButton = () => {
|
|
72
72
|
let buttonText = __( 'Disconnect', 'jetpack-connection-js' );
|
|
@@ -93,7 +93,7 @@ const StepDisconnect = props => {
|
|
|
93
93
|
* Show some fallback output if there are no connected plugins to show and no passed disconnect component.
|
|
94
94
|
* This is a more generic message about disconnecting Jetpack.
|
|
95
95
|
*
|
|
96
|
-
* @return {
|
|
96
|
+
* @return {import('react').ElementType|undefined} - Fallback message for when there are no connected plugins or passed components to show.
|
|
97
97
|
*/
|
|
98
98
|
const renderFallbackOutput = () => {
|
|
99
99
|
const hasOtherConnectedPlugins =
|
|
@@ -122,7 +122,7 @@ const StepDisconnect = props => {
|
|
|
122
122
|
};
|
|
123
123
|
|
|
124
124
|
return (
|
|
125
|
-
<
|
|
125
|
+
<Fragment>
|
|
126
126
|
<div className="jp-connection__disconnect-dialog__content">
|
|
127
127
|
<h1 id="jp-connection__disconnect-dialog__heading">{ title }</h1>
|
|
128
128
|
<ConnectedPlugins
|
|
@@ -186,7 +186,7 @@ const StepDisconnect = props => {
|
|
|
186
186
|
<p className="jp-connection__disconnect-dialog__error">{ disconnectError }</p>
|
|
187
187
|
) }
|
|
188
188
|
</div>
|
|
189
|
-
</
|
|
189
|
+
</Fragment>
|
|
190
190
|
);
|
|
191
191
|
};
|
|
192
192
|
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { __ } from '@wordpress/i18n';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
import React from 'react';
|
|
4
3
|
import '../../disconnect-survey/_jp-connect_disconnect-survey-card.scss';
|
|
5
4
|
import DisconnectSurvey from '../../disconnect-survey';
|
|
6
5
|
|
|
@@ -8,7 +7,7 @@ import DisconnectSurvey from '../../disconnect-survey';
|
|
|
8
7
|
* Show the survey step and allow the user to select a response.
|
|
9
8
|
*
|
|
10
9
|
* @param {object} props - The properties.
|
|
11
|
-
* @return {
|
|
10
|
+
* @return {import('react').Component} The StepSurvey Component
|
|
12
11
|
*/
|
|
13
12
|
const StepSurvey = props => {
|
|
14
13
|
const { onExit, onFeedBackProvided, isSubmittingFeedback } = props;
|
|
@@ -3,14 +3,13 @@ import { Button } from '@wordpress/components';
|
|
|
3
3
|
import { createInterpolateElement } from '@wordpress/element';
|
|
4
4
|
import { __ } from '@wordpress/i18n';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
|
-
import React from 'react';
|
|
7
6
|
import disconnectImage from '../images/disconnect-thanks.jpg';
|
|
8
7
|
|
|
9
8
|
/**
|
|
10
9
|
* Show the "thank you" step following survey submission
|
|
11
10
|
*
|
|
12
11
|
* @param {object} props - The properties.
|
|
13
|
-
* @return {
|
|
12
|
+
* @return {import('react').Component} - The StepThankYou Component
|
|
14
13
|
*/
|
|
15
14
|
const StepThankYou = props => {
|
|
16
15
|
const { onExit } = props;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { Button } from '@wordpress/components';
|
|
2
2
|
import { __ } from '@wordpress/i18n';
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
|
-
import
|
|
4
|
+
import { Fragment, useCallback, useState } from 'react';
|
|
5
5
|
import SurveyChoice from './survey-choice';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Handles showing the disconnect survey.
|
|
9
9
|
*
|
|
10
10
|
* @param {object} props - The component props.
|
|
11
|
-
* @return {
|
|
11
|
+
* @return {import('react').Component} - DisconnectSurvey component.
|
|
12
12
|
*/
|
|
13
13
|
const DisconnectSurvey = props => {
|
|
14
14
|
const { onSubmit, isSubmittingFeedback } = props;
|
|
@@ -105,7 +105,7 @@ const DisconnectSurvey = props => {
|
|
|
105
105
|
/**
|
|
106
106
|
* Show all the survey options from the options array.
|
|
107
107
|
*
|
|
108
|
-
* @return {
|
|
108
|
+
* @return {import('react').ElementType []} - Mapped array of rendered survey options.
|
|
109
109
|
*/
|
|
110
110
|
const renderOptions = () => {
|
|
111
111
|
return options.map( option => {
|
|
@@ -127,7 +127,7 @@ const DisconnectSurvey = props => {
|
|
|
127
127
|
* Show the custom input survey option.
|
|
128
128
|
* Contains an input field for a custom response.
|
|
129
129
|
*
|
|
130
|
-
* @return {
|
|
130
|
+
* @return {import('react').ElementType} - The custom survey option with an input field.
|
|
131
131
|
*/
|
|
132
132
|
const renderCustomOption = () => {
|
|
133
133
|
return (
|
|
@@ -154,7 +154,7 @@ const DisconnectSurvey = props => {
|
|
|
154
154
|
};
|
|
155
155
|
|
|
156
156
|
return (
|
|
157
|
-
<
|
|
157
|
+
<Fragment>
|
|
158
158
|
<div className="jp-connection__disconnect-dialog__survey">
|
|
159
159
|
{ renderOptions() }
|
|
160
160
|
{ renderCustomOption() }
|
|
@@ -175,7 +175,7 @@ const DisconnectSurvey = props => {
|
|
|
175
175
|
) }
|
|
176
176
|
</Button>
|
|
177
177
|
</p>
|
|
178
|
-
</
|
|
178
|
+
</Fragment>
|
|
179
179
|
);
|
|
180
180
|
};
|
|
181
181
|
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { useCallback } from 'react';
|
|
2
2
|
|
|
3
3
|
import './_jp-connect_disconnect-survey-card.scss';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* SurveyChoice - Present one choice in the survey.
|
|
7
7
|
*
|
|
8
|
-
* @param {string}
|
|
9
|
-
* @param {Function}
|
|
10
|
-
* @param {Function}
|
|
11
|
-
* @param {
|
|
12
|
-
* @param {string}
|
|
13
|
-
* @return {
|
|
8
|
+
* @param {string} props.id - The ID/slug string of the survey option
|
|
9
|
+
* @param {Function} props.onClick - Event handler for clicking on the survey option.
|
|
10
|
+
* @param {Function} props.onKeydown - Event handler for pressing a key on the survey option.
|
|
11
|
+
* @param {import('react').ElementType} props.children - Any passed elements as children to this component.
|
|
12
|
+
* @param {string} props.className - A class name to apply to the survey choice.
|
|
13
|
+
* @return {import('react').Component} SurveyChoice - The SurveyChoice component.
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
16
|
const SurveyChoice = props => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { __ } from '@wordpress/i18n';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
import
|
|
3
|
+
import { useEffect, useRef } from 'react';
|
|
4
4
|
|
|
5
5
|
import './style.scss';
|
|
6
6
|
|
|
@@ -18,7 +18,7 @@ import './style.scss';
|
|
|
18
18
|
* @param {Function} props.onComplete -- The callback to be called upon complete of the connection process.
|
|
19
19
|
* @param {Function} props.onThirdPartyCookiesBlocked -- The callback to be called if third-party cookies are disabled.
|
|
20
20
|
* @param {string} props.location -- Component location identifier passed to WP.com.
|
|
21
|
-
* @return {
|
|
21
|
+
* @return {import('react').Component} The in-place connection component.
|
|
22
22
|
*/
|
|
23
23
|
const InPlaceConnection = props => {
|
|
24
24
|
const {
|
|
@@ -11,7 +11,7 @@ import { __ } from '@wordpress/i18n';
|
|
|
11
11
|
import { Icon, chevronRight, external } from '@wordpress/icons';
|
|
12
12
|
import clsx from 'clsx';
|
|
13
13
|
import PropTypes from 'prop-types';
|
|
14
|
-
import
|
|
14
|
+
import { useCallback, useEffect, useState, useMemo } from 'react';
|
|
15
15
|
/**
|
|
16
16
|
* Internal dependencies
|
|
17
17
|
*/
|
|
@@ -24,7 +24,7 @@ import './style.scss';
|
|
|
24
24
|
* The RNA Manage Connection Dialog component.
|
|
25
25
|
*
|
|
26
26
|
* @param {object} props -- The properties.
|
|
27
|
-
* @return {
|
|
27
|
+
* @return {import('react').JSX} The `ManageConnectionDialog` component.
|
|
28
28
|
*/
|
|
29
29
|
const ManageConnectionDialog = props => {
|
|
30
30
|
const {
|
|
@@ -10,7 +10,7 @@ import { __ } from '@wordpress/i18n';
|
|
|
10
10
|
import { Icon, chevronRight, external } from '@wordpress/icons';
|
|
11
11
|
import clsx from 'clsx';
|
|
12
12
|
import PropTypes from 'prop-types';
|
|
13
|
-
import
|
|
13
|
+
import { useCallback, useState, useEffect } from 'react';
|
|
14
14
|
import './style.scss';
|
|
15
15
|
|
|
16
16
|
/**
|
|
@@ -23,7 +23,7 @@ import './style.scss';
|
|
|
23
23
|
* @param {string} props.apiNonce - API nonce.
|
|
24
24
|
* @param {Function} props.onDisconnected - Callback after successful disconnection.
|
|
25
25
|
* @param {Function} props.onUnlinked - Callback after user is unlinked.
|
|
26
|
-
* @return {
|
|
26
|
+
* @return {import('react').Component} The OwnerDisconnectDialog component.
|
|
27
27
|
*/
|
|
28
28
|
const OwnerDisconnectDialog = ( {
|
|
29
29
|
isOpen,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@automattic/jetpack-connection",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.8",
|
|
4
4
|
"description": "Jetpack Connection Component",
|
|
5
5
|
"homepage": "https://github.com/Automattic/jetpack/tree/HEAD/projects/js-packages/connection/#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -14,10 +14,10 @@
|
|
|
14
14
|
"author": "Automattic",
|
|
15
15
|
"license": "GPL-2.0-or-later",
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@automattic/jetpack-analytics": "^1.0.
|
|
18
|
-
"@automattic/jetpack-api": "^1.0.
|
|
19
|
-
"@automattic/jetpack-components": "^1.1.
|
|
20
|
-
"@automattic/jetpack-config": "^1.0.
|
|
17
|
+
"@automattic/jetpack-analytics": "^1.0.2",
|
|
18
|
+
"@automattic/jetpack-api": "^1.0.3",
|
|
19
|
+
"@automattic/jetpack-components": "^1.1.8",
|
|
20
|
+
"@automattic/jetpack-config": "^1.0.2",
|
|
21
21
|
"@automattic/jetpack-script-data": "^0.4.4",
|
|
22
22
|
"@wordpress/base-styles": "6.1.0",
|
|
23
23
|
"@wordpress/browserslist-config": "6.25.0",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"prop-types": "^15.7.2"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
|
-
"@automattic/jetpack-base-styles": "^1.0.
|
|
34
|
+
"@automattic/jetpack-base-styles": "^1.0.2",
|
|
35
35
|
"@babel/core": "7.27.4",
|
|
36
36
|
"@babel/preset-react": "7.27.1",
|
|
37
37
|
"@storybook/addon-actions": "8.6.7",
|