@automattic/jetpack-connection 1.4.52 → 1.4.54
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 +12 -0
- package/SECURITY.md +0 -1
- package/components/connect-button/index.jsx +11 -7
- package/components/connect-screen/basic/style.scss +8 -17
- package/components/connect-screen/basic/visual.tsx +15 -8
- package/components/connect-screen/required-plan/style.scss +25 -38
- package/components/connect-screen/required-plan/visual.jsx +24 -17
- package/components/manage-connection-dialog/index.jsx +3 -4
- package/hooks/use-product-checkout-workflow/index.tsx +1 -1
- package/package.json +8 -6
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
### This is a list detailing changes for the Jetpack RNA Connection Component releases.
|
|
4
4
|
|
|
5
|
+
## [1.4.54] - 2026-06-01
|
|
6
|
+
### Changed
|
|
7
|
+
- Connection: Migrate ActionButton, Button, and Text consumers off @automattic/jetpack-components to @wordpress/ui equivalents; brings the package to zero migration-relevant jetpack-components imports. [#49099]
|
|
8
|
+
- Update package dependencies. [#48404]
|
|
9
|
+
|
|
10
|
+
## [1.4.53] - 2026-05-25
|
|
11
|
+
### Added
|
|
12
|
+
- Add direct `useProductCheckoutWorkflow` hook export. [#49032]
|
|
13
|
+
- Expose the `useConnectionErrorNotice` hook and `ConnectionError` component via a dedicated sub-path so consumers can opt out of the full package barrel. [#48829]
|
|
14
|
+
|
|
5
15
|
## [1.4.52] - 2026-05-21
|
|
6
16
|
### Changed
|
|
7
17
|
- Update package dependencies. [#48405]
|
|
@@ -1347,6 +1357,8 @@
|
|
|
1347
1357
|
- `Main` and `ConnectUser` components added.
|
|
1348
1358
|
- `JetpackRestApiClient` API client added.
|
|
1349
1359
|
|
|
1360
|
+
[1.4.54]: https://github.com/Automattic/jetpack-connection-js/compare/v1.4.53...v1.4.54
|
|
1361
|
+
[1.4.53]: https://github.com/Automattic/jetpack-connection-js/compare/v1.4.52...v1.4.53
|
|
1350
1362
|
[1.4.52]: https://github.com/Automattic/jetpack-connection-js/compare/v1.4.51...v1.4.52
|
|
1351
1363
|
[1.4.51]: https://github.com/Automattic/jetpack-connection-js/compare/v1.4.50...v1.4.51
|
|
1352
1364
|
[1.4.50]: https://github.com/Automattic/jetpack-connection-js/compare/v1.4.49...v1.4.50
|
package/SECURITY.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ActionButton } from '@automattic/jetpack-components';
|
|
2
1
|
import { __ } from '@wordpress/i18n';
|
|
2
|
+
import { Button } from '@wordpress/ui';
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
4
|
import useConnection from '../use-connection';
|
|
5
5
|
|
|
@@ -39,12 +39,16 @@ const ConnectButton = props => {
|
|
|
39
39
|
return (
|
|
40
40
|
<>
|
|
41
41
|
{ ( ! isRegistered || ! isUserConnected ) && (
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
42
|
+
<>
|
|
43
|
+
<Button onClick={ handleRegisterSite } loading={ siteIsRegistering || userIsConnecting }>
|
|
44
|
+
{ connectLabel }
|
|
45
|
+
</Button>
|
|
46
|
+
{ registrationError && (
|
|
47
|
+
<p className="jp-action-button__error">
|
|
48
|
+
{ __( 'An error occurred. Please try again.', 'jetpack-connection-js' ) }
|
|
49
|
+
</p>
|
|
50
|
+
) }
|
|
51
|
+
</>
|
|
48
52
|
) }
|
|
49
53
|
</>
|
|
50
54
|
);
|
|
@@ -17,25 +17,16 @@
|
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
// Structural-only: top spacing + responsive width. All other treatment
|
|
21
|
+
// (colors, padding, border-radius, font-weight) honors the
|
|
22
|
+
// @wordpress/ui Button defaults.
|
|
23
|
+
.jp-connection__connect-screen__action-button {
|
|
21
24
|
margin-top: 40px;
|
|
25
|
+
max-width: 100%;
|
|
22
26
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
button {
|
|
29
|
-
max-width: 100%;
|
|
30
|
-
|
|
31
|
-
&:disabled {
|
|
32
|
-
color: hsla(0, 0%, 100%, 0.4);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
@media ( max-width: breakpoints.$break-medium ) {
|
|
36
|
-
max-width: none;
|
|
37
|
-
width: 100%;
|
|
38
|
-
}
|
|
27
|
+
@media ( max-width: breakpoints.$break-medium ) {
|
|
28
|
+
max-width: none;
|
|
29
|
+
width: 100%;
|
|
39
30
|
}
|
|
40
31
|
}
|
|
41
32
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { TermsOfService, getRedirectUrl } from '@automattic/jetpack-components';
|
|
2
2
|
import { createInterpolateElement } from '@wordpress/element';
|
|
3
3
|
import { __ } from '@wordpress/i18n';
|
|
4
|
+
import { Button } from '@wordpress/ui';
|
|
4
5
|
import ConnectScreenLayout from '../layout';
|
|
5
6
|
import type { Props as ConnectScreenProps } from '../basic';
|
|
6
7
|
import type { WithRequired } from '../types';
|
|
@@ -102,14 +103,20 @@ const ConnectScreenVisual: FC< Props > = ( {
|
|
|
102
103
|
<div className="jp-connection__connect-screen__tos">
|
|
103
104
|
<TermsOfService agreeButtonLabel={ buttonLabel } />
|
|
104
105
|
</div>
|
|
105
|
-
<
|
|
106
|
-
|
|
106
|
+
<Button
|
|
107
|
+
className="jp-connection__connect-screen__action-button"
|
|
107
108
|
onClick={ handleButtonClick }
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
109
|
+
loading={ buttonIsLoading }
|
|
110
|
+
disabled={ isOfflineMode }
|
|
111
|
+
>
|
|
112
|
+
{ buttonLabel }
|
|
113
|
+
</Button>
|
|
114
|
+
{ ( displayButtonError || isOfflineMode ) && (
|
|
115
|
+
<p className="jp-connection__connect-screen__error">
|
|
116
|
+
{ getErrorMessage( errorCode, isOfflineMode ) ||
|
|
117
|
+
__( 'An error occurred. Please try again.', 'jetpack-connection-js' ) }
|
|
118
|
+
</p>
|
|
119
|
+
) }
|
|
113
120
|
<span className="jp-connection__connect-screen__loading-message" role="status">
|
|
114
121
|
{ buttonIsLoading ? loadingLabel || __( 'Loading', 'jetpack-connection-js' ) : '' }
|
|
115
122
|
</span>
|
|
@@ -43,23 +43,12 @@
|
|
|
43
43
|
right: calc(var(--spacing-base) * 12);
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
|
|
46
|
+
// Structural-only: span the pricing card width and keep the vertical
|
|
47
|
+
// rhythm inside the card. All other treatment (colors, padding,
|
|
48
|
+
// font-size, border-radius) honors the @wordpress/ui Button defaults.
|
|
49
|
+
.jp-connection__connect-screen__action-button {
|
|
47
50
|
width: 100%;
|
|
48
|
-
|
|
49
|
-
font-size: 18px;
|
|
50
|
-
font-weight: 500;
|
|
51
|
-
background: var(--jp-black) !important;
|
|
52
|
-
color: var(--jp-white) !important;
|
|
53
|
-
border-radius: var(--jp-border-radius);
|
|
54
|
-
padding: 14px 24px;
|
|
55
|
-
margin: 24px 0 32px;
|
|
56
|
-
justify-content: center;
|
|
57
|
-
align-items: center;
|
|
58
|
-
|
|
59
|
-
&:disabled {
|
|
60
|
-
background: var(--jp-gray) !important;
|
|
61
|
-
color: var(--jp-gray-20) !important;
|
|
62
|
-
}
|
|
51
|
+
margin: 24px 0;
|
|
63
52
|
}
|
|
64
53
|
|
|
65
54
|
.terms-of-service {
|
|
@@ -77,33 +66,31 @@
|
|
|
77
66
|
gap: 1ch;
|
|
78
67
|
line-height: 1;
|
|
79
68
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
69
|
+
// Inline button styled as a text link inside the surrounding sentence.
|
|
70
|
+
// `variant="unstyled"` strips @wordpress/ui Button's chrome so we can
|
|
71
|
+
// flow it inline with the prefix copy; we keep `<button>` semantics so
|
|
72
|
+
// the element stays keyboard-focusable and screen readers announce
|
|
73
|
+
// "button" + aria-busy when in-flight (a `<Link>` couldn't do that).
|
|
74
|
+
// `inline-flex` + `align-items: center` keeps either the label or the
|
|
75
|
+
// loading spinner vertically centered within the button row, and
|
|
76
|
+
// `align-self: baseline` aligns the whole button with the prefix
|
|
77
|
+
// text's baseline inside the parent flex container.
|
|
78
|
+
.jp-connection__connect-screen__inline-action {
|
|
79
|
+
display: inline-flex;
|
|
80
|
+
align-items: center;
|
|
81
|
+
align-self: baseline;
|
|
84
82
|
text-decoration: underline;
|
|
85
|
-
|
|
86
|
-
width: auto;
|
|
87
|
-
min-width: 0;
|
|
88
|
-
height: auto;
|
|
89
83
|
font: inherit;
|
|
90
84
|
padding: 0;
|
|
85
|
+
min-width: calc(var(--spacing-base) * 8);
|
|
86
|
+
justify-content: center;
|
|
91
87
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
&:focus {
|
|
98
|
-
background: inherit;
|
|
99
|
-
box-shadow: none !important;
|
|
88
|
+
// @wordpress/components Spinner ships with `margin: 5px 11px 0`
|
|
89
|
+
// for use inside button chrome we no longer have. Zero it out
|
|
90
|
+
// so the spinner sits flush in the inline-flex row.
|
|
91
|
+
.components-spinner {
|
|
92
|
+
margin: 0;
|
|
100
93
|
}
|
|
101
94
|
}
|
|
102
|
-
|
|
103
|
-
.jp-components-spinner__inner,
|
|
104
|
-
.jp-components-spinner__outer {
|
|
105
|
-
border-top-color: var(--jp-black);
|
|
106
|
-
border-right-color: var(--jp-black);
|
|
107
|
-
}
|
|
108
95
|
}
|
|
109
96
|
}
|
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
getRedirectUrl,
|
|
4
|
-
PricingCard,
|
|
5
|
-
TermsOfService,
|
|
6
|
-
} from '@automattic/jetpack-components';
|
|
1
|
+
import { getRedirectUrl, PricingCard, TermsOfService } from '@automattic/jetpack-components';
|
|
2
|
+
import { Spinner } from '@wordpress/components';
|
|
7
3
|
import { createInterpolateElement } from '@wordpress/element';
|
|
8
4
|
import { __ } from '@wordpress/i18n';
|
|
5
|
+
import { Button } from '@wordpress/ui';
|
|
9
6
|
import clsx from 'clsx';
|
|
10
7
|
import debugFactory from 'debug';
|
|
11
8
|
import PropTypes from 'prop-types';
|
|
@@ -45,11 +42,15 @@ const ConnectScreenRequiredPlanVisual = props => {
|
|
|
45
42
|
__( 'Already have a subscription? <connectButton/>', 'jetpack-connection-js' ),
|
|
46
43
|
{
|
|
47
44
|
connectButton: (
|
|
48
|
-
<
|
|
49
|
-
|
|
45
|
+
<Button
|
|
46
|
+
variant="unstyled"
|
|
47
|
+
className="jp-connection__connect-screen__inline-action"
|
|
50
48
|
onClick={ handleButtonClick }
|
|
51
|
-
|
|
52
|
-
|
|
49
|
+
disabled={ buttonIsLoading }
|
|
50
|
+
aria-busy={ buttonIsLoading }
|
|
51
|
+
>
|
|
52
|
+
{ buttonIsLoading ? <Spinner /> : __( 'Log in to get started', 'jetpack-connection-js' ) }
|
|
53
|
+
</Button>
|
|
53
54
|
),
|
|
54
55
|
}
|
|
55
56
|
);
|
|
@@ -92,14 +93,20 @@ const ConnectScreenRequiredPlanVisual = props => {
|
|
|
92
93
|
priceAfter={ priceAfter }
|
|
93
94
|
>
|
|
94
95
|
<TermsOfService agreeButtonLabel={ buttonLabel } />
|
|
95
|
-
<
|
|
96
|
-
|
|
96
|
+
<Button
|
|
97
|
+
className="jp-connection__connect-screen__action-button"
|
|
97
98
|
onClick={ handleButtonClick }
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
99
|
+
loading={ buttonIsLoading }
|
|
100
|
+
disabled={ isOfflineMode }
|
|
101
|
+
>
|
|
102
|
+
{ buttonLabel }
|
|
103
|
+
</Button>
|
|
104
|
+
{ ( displayButtonError || isOfflineMode ) && (
|
|
105
|
+
<p className="jp-connection__connect-screen__error">
|
|
106
|
+
{ errorMessage ||
|
|
107
|
+
__( 'An error occurred. Please try again.', 'jetpack-connection-js' ) }
|
|
108
|
+
</p>
|
|
109
|
+
) }
|
|
103
110
|
</PricingCard>
|
|
104
111
|
</div>
|
|
105
112
|
|
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import jetpackAnalytics from '@automattic/jetpack-analytics';
|
|
5
5
|
import restApi from '@automattic/jetpack-api';
|
|
6
|
-
import {
|
|
6
|
+
import { getRedirectUrl } from '@automattic/jetpack-components';
|
|
7
7
|
import { isWoASite } from '@automattic/jetpack-script-data';
|
|
8
8
|
import { Modal } from '@wordpress/components';
|
|
9
9
|
import { createInterpolateElement } from '@wordpress/element';
|
|
10
10
|
import { __ } from '@wordpress/i18n';
|
|
11
11
|
import { Icon, chevronRight, external } from '@wordpress/icons';
|
|
12
|
-
import { Link } from '@wordpress/ui';
|
|
12
|
+
import { Button, Link, Text } from '@wordpress/ui';
|
|
13
13
|
import clsx from 'clsx';
|
|
14
14
|
import PropTypes from 'prop-types';
|
|
15
15
|
import { useCallback, useEffect, useState, useMemo } from 'react';
|
|
@@ -316,8 +316,7 @@ const HelpFooter = ( { onClose, disabled } ) => {
|
|
|
316
316
|
</div>
|
|
317
317
|
<div className="jp-connection__manage-dialog__button-wrap lg-col-span-3 md-col-span-1 sm-col-span-1">
|
|
318
318
|
<Button
|
|
319
|
-
|
|
320
|
-
variant="secondary"
|
|
319
|
+
variant="outline"
|
|
321
320
|
onClick={ onClose }
|
|
322
321
|
className="jp-connection__manage-dialog__btn-dismiss"
|
|
323
322
|
disabled={ disabled }
|
|
@@ -3,8 +3,8 @@ import { getScriptData } from '@automattic/jetpack-script-data';
|
|
|
3
3
|
import { useDispatch, useSelect } from '@wordpress/data';
|
|
4
4
|
import debugFactory from 'debug';
|
|
5
5
|
import { useEffect, useState, useMemo } from 'react';
|
|
6
|
-
import { getCalypsoOrigin } from '@automattic/jetpack-connection';
|
|
7
6
|
import useConnection from '../../components/use-connection';
|
|
7
|
+
import getCalypsoOrigin from '../../helpers/get-calypso-origin';
|
|
8
8
|
import { STORE_ID } from '../../state/store.jsx';
|
|
9
9
|
import type { UseProductCheckoutWorkflowProps } from './types';
|
|
10
10
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@automattic/jetpack-connection",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.54",
|
|
4
4
|
"description": "Jetpack Connection Component",
|
|
5
5
|
"homepage": "https://github.com/Automattic/jetpack/tree/HEAD/projects/js-packages/connection/#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -20,7 +20,9 @@
|
|
|
20
20
|
"type": "module",
|
|
21
21
|
"exports": {
|
|
22
22
|
".": "./index.jsx",
|
|
23
|
-
"./use-
|
|
23
|
+
"./hooks/use-product-checkout-workflow": "./hooks/use-product-checkout-workflow/index.tsx",
|
|
24
|
+
"./use-connection": "./components/use-connection/index.ts",
|
|
25
|
+
"./use-connection-error-notice": "./hooks/use-connection-error-notice/index.tsx"
|
|
24
26
|
},
|
|
25
27
|
"scripts": {
|
|
26
28
|
"test": "NODE_OPTIONS=--experimental-vm-modules jest",
|
|
@@ -30,7 +32,7 @@
|
|
|
30
32
|
"dependencies": {
|
|
31
33
|
"@automattic/jetpack-analytics": "^1.0.13",
|
|
32
34
|
"@automattic/jetpack-api": "^1.0.26",
|
|
33
|
-
"@automattic/jetpack-components": "^1.
|
|
35
|
+
"@automattic/jetpack-components": "^1.12.1",
|
|
34
36
|
"@automattic/jetpack-config": "^1.0.11",
|
|
35
37
|
"@automattic/jetpack-script-data": "^0.6.4",
|
|
36
38
|
"@wordpress/base-styles": "8.0.0",
|
|
@@ -39,15 +41,15 @@
|
|
|
39
41
|
"@wordpress/data": "10.46.0",
|
|
40
42
|
"@wordpress/element": "6.46.0",
|
|
41
43
|
"@wordpress/i18n": "6.19.0",
|
|
42
|
-
"@wordpress/icons": "
|
|
43
|
-
"@wordpress/ui": "0.
|
|
44
|
+
"@wordpress/icons": "13.1.0",
|
|
45
|
+
"@wordpress/ui": "0.13.0",
|
|
44
46
|
"@wordpress/url": "4.46.0",
|
|
45
47
|
"clsx": "2.1.1",
|
|
46
48
|
"debug": "4.4.3",
|
|
47
49
|
"prop-types": "^15.7.2"
|
|
48
50
|
},
|
|
49
51
|
"devDependencies": {
|
|
50
|
-
"@automattic/jetpack-base-styles": "^1.2.
|
|
52
|
+
"@automattic/jetpack-base-styles": "^1.2.5",
|
|
51
53
|
"@babel/core": "7.29.0",
|
|
52
54
|
"@babel/preset-react": "7.28.5",
|
|
53
55
|
"@testing-library/dom": "10.4.1",
|