@automattic/jetpack-connection 0.35.14 → 0.35.16
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
CHANGED
|
@@ -2,6 +2,19 @@
|
|
|
2
2
|
|
|
3
3
|
### This is a list detailing changes for the Jetpack RNA Connection Component releases.
|
|
4
4
|
|
|
5
|
+
## [0.35.16] - 2024-11-11
|
|
6
|
+
### Changed
|
|
7
|
+
- Updated package dependencies. [#39999]
|
|
8
|
+
- Updated package dependencies. [#40000]
|
|
9
|
+
- Updated package dependencies. [#40060]
|
|
10
|
+
|
|
11
|
+
## [0.35.15] - 2024-11-04
|
|
12
|
+
### Added
|
|
13
|
+
- Enable test coverage. [#39961]
|
|
14
|
+
|
|
15
|
+
### Changed
|
|
16
|
+
- Skip pricing page when connecting via block editor. [#39865]
|
|
17
|
+
|
|
5
18
|
## [0.35.14] - 2024-10-15
|
|
6
19
|
### Changed
|
|
7
20
|
- Update dependencies.
|
|
@@ -875,6 +888,8 @@
|
|
|
875
888
|
- `Main` and `ConnectUser` components added.
|
|
876
889
|
- `JetpackRestApiClient` API client added.
|
|
877
890
|
|
|
891
|
+
[0.35.16]: https://github.com/Automattic/jetpack-connection-js/compare/v0.35.15...v0.35.16
|
|
892
|
+
[0.35.15]: https://github.com/Automattic/jetpack-connection-js/compare/v0.35.14...v0.35.15
|
|
878
893
|
[0.35.14]: https://github.com/Automattic/jetpack-connection-js/compare/v0.35.13...v0.35.14
|
|
879
894
|
[0.35.13]: https://github.com/Automattic/jetpack-connection-js/compare/v0.35.12...v0.35.13
|
|
880
895
|
[0.35.12]: https://github.com/Automattic/jetpack-connection-js/compare/v0.35.11...v0.35.12
|
|
@@ -30,6 +30,8 @@ export type Props = {
|
|
|
30
30
|
assetBaseUrl?: string;
|
|
31
31
|
// Whether to not require a user connection and just redirect after site connection
|
|
32
32
|
skipUserConnection?: boolean;
|
|
33
|
+
// Whether to skip the pricing page after the connection screen
|
|
34
|
+
skipPricingPage?: boolean;
|
|
33
35
|
// Additional page elements to show after the call to action
|
|
34
36
|
footer?: React.ReactNode;
|
|
35
37
|
// The logo to display at the top of the component
|
|
@@ -54,6 +56,7 @@ const ConnectScreen: React.FC< Props > = ( {
|
|
|
54
56
|
autoTrigger,
|
|
55
57
|
footer,
|
|
56
58
|
skipUserConnection,
|
|
59
|
+
skipPricingPage,
|
|
57
60
|
logo,
|
|
58
61
|
} ) => {
|
|
59
62
|
const {
|
|
@@ -70,6 +73,7 @@ const ConnectScreen: React.FC< Props > = ( {
|
|
|
70
73
|
autoTrigger,
|
|
71
74
|
from,
|
|
72
75
|
skipUserConnection,
|
|
76
|
+
skipPricingPage,
|
|
73
77
|
} );
|
|
74
78
|
|
|
75
79
|
const displayButtonError = Boolean( registrationError );
|
|
@@ -14,6 +14,7 @@ export default ( {
|
|
|
14
14
|
autoTrigger,
|
|
15
15
|
from,
|
|
16
16
|
skipUserConnection,
|
|
17
|
+
skipPricingPage,
|
|
17
18
|
} = {} ) => {
|
|
18
19
|
const { registerSite, connectUser, refreshConnectedPlugins } = useDispatch( STORE_ID );
|
|
19
20
|
|
|
@@ -45,7 +46,7 @@ export default ( {
|
|
|
45
46
|
*/
|
|
46
47
|
const handleConnectUser = () => {
|
|
47
48
|
if ( ! skipUserConnection ) {
|
|
48
|
-
return connectUser( { from, redirectUri } );
|
|
49
|
+
return connectUser( { from, redirectUri, skipPricingPage } );
|
|
49
50
|
} else if ( redirectUri ) {
|
|
50
51
|
window.location = redirectUri;
|
|
51
52
|
return Promise.resolve( redirectUri );
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@automattic/jetpack-connection",
|
|
3
|
-
"version": "0.35.
|
|
3
|
+
"version": "0.35.16",
|
|
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,31 +14,31 @@
|
|
|
14
14
|
"author": "Automattic",
|
|
15
15
|
"license": "GPL-2.0-or-later",
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@automattic/jetpack-analytics": "^0.1.
|
|
18
|
-
"@automattic/jetpack-api": "^0.17.
|
|
19
|
-
"@automattic/jetpack-components": "^0.
|
|
20
|
-
"@automattic/jetpack-config": "^0.1.
|
|
21
|
-
"@automattic/jetpack-script-data": "^0.1.
|
|
22
|
-
"@wordpress/base-styles": "5.
|
|
23
|
-
"@wordpress/browserslist-config": "6.
|
|
24
|
-
"@wordpress/components": "28.
|
|
25
|
-
"@wordpress/data": "10.
|
|
26
|
-
"@wordpress/element": "6.
|
|
27
|
-
"@wordpress/i18n": "5.
|
|
28
|
-
"@wordpress/icons": "10.
|
|
17
|
+
"@automattic/jetpack-analytics": "^0.1.32",
|
|
18
|
+
"@automattic/jetpack-api": "^0.17.17",
|
|
19
|
+
"@automattic/jetpack-components": "^0.59.0",
|
|
20
|
+
"@automattic/jetpack-config": "^0.1.26",
|
|
21
|
+
"@automattic/jetpack-script-data": "^0.1.4",
|
|
22
|
+
"@wordpress/base-styles": "5.11.0",
|
|
23
|
+
"@wordpress/browserslist-config": "6.11.0",
|
|
24
|
+
"@wordpress/components": "28.11.0",
|
|
25
|
+
"@wordpress/data": "10.11.0",
|
|
26
|
+
"@wordpress/element": "6.11.0",
|
|
27
|
+
"@wordpress/i18n": "5.11.0",
|
|
28
|
+
"@wordpress/icons": "10.11.0",
|
|
29
29
|
"clsx": "2.1.1",
|
|
30
30
|
"debug": "4.3.4",
|
|
31
31
|
"prop-types": "^15.7.2"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
|
-
"@automattic/jetpack-base-styles": "^0.6.
|
|
35
|
-
"@babel/core": "7.
|
|
36
|
-
"@babel/preset-react": "7.
|
|
34
|
+
"@automattic/jetpack-base-styles": "^0.6.35",
|
|
35
|
+
"@babel/core": "7.26.0",
|
|
36
|
+
"@babel/preset-react": "7.25.9",
|
|
37
37
|
"@storybook/addon-actions": "8.3.5",
|
|
38
38
|
"@testing-library/dom": "10.4.0",
|
|
39
39
|
"@testing-library/react": "16.0.1",
|
|
40
40
|
"@testing-library/user-event": "14.5.2",
|
|
41
|
-
"@types/react": "18.3.
|
|
41
|
+
"@types/react": "18.3.12",
|
|
42
42
|
"jest": "29.7.0",
|
|
43
43
|
"jest-environment-jsdom": "29.7.0",
|
|
44
44
|
"react": "18.3.1",
|
|
@@ -59,6 +59,7 @@
|
|
|
59
59
|
"*.scss"
|
|
60
60
|
],
|
|
61
61
|
"scripts": {
|
|
62
|
-
"test": "NODE_OPTIONS=--experimental-vm-modules jest"
|
|
62
|
+
"test": "NODE_OPTIONS=--experimental-vm-modules jest",
|
|
63
|
+
"test-coverage": "pnpm run test --coverage"
|
|
63
64
|
}
|
|
64
65
|
}
|
package/state/actions.jsx
CHANGED
|
@@ -72,15 +72,16 @@ const setIsOfflineMode = isOfflineMode => {
|
|
|
72
72
|
/**
|
|
73
73
|
* Connect site with wp.com user
|
|
74
74
|
*
|
|
75
|
-
* @param {object} Object
|
|
76
|
-
* @param {string} Object.from
|
|
77
|
-
* @param {Function} Object.redirectFunc
|
|
78
|
-
* @param {string} [Object.redirectUri]
|
|
75
|
+
* @param {object} Object - contains from and redirectFunc
|
|
76
|
+
* @param {string} Object.from - Value that represents the redirect origin
|
|
77
|
+
* @param {Function} Object.redirectFunc - A function to handle the redirect, defaults to location.assign
|
|
78
|
+
* @param {string} [Object.redirectUri] - A URI that the user will be redirected to
|
|
79
|
+
* @param {boolean} [Object.skipPricingPage] - A flag to skip the pricing page in the connection flow
|
|
79
80
|
* @yield {object} Action object that will be yielded
|
|
80
81
|
*/
|
|
81
|
-
function* connectUser( { from, redirectFunc, redirectUri } = {} ) {
|
|
82
|
+
function* connectUser( { from, redirectFunc, redirectUri, skipPricingPage } = {} ) {
|
|
82
83
|
yield setUserIsConnecting( true );
|
|
83
|
-
yield { type: CONNECT_USER, from, redirectFunc, redirectUri };
|
|
84
|
+
yield { type: CONNECT_USER, from, redirectFunc, redirectUri, skipPricingPage };
|
|
84
85
|
}
|
|
85
86
|
|
|
86
87
|
/**
|
package/state/controls.jsx
CHANGED
|
@@ -7,7 +7,7 @@ const REGISTER_SITE = ( { registrationNonce, redirectUri, from } ) =>
|
|
|
7
7
|
|
|
8
8
|
const CONNECT_USER = createRegistryControl(
|
|
9
9
|
( { resolveSelect } ) =>
|
|
10
|
-
( { from, redirectFunc, redirectUri } = {} ) => {
|
|
10
|
+
( { from, redirectFunc, redirectUri, skipPricingPage } = {} ) => {
|
|
11
11
|
return new Promise( ( resolve, reject ) => {
|
|
12
12
|
resolveSelect( STORE_ID )
|
|
13
13
|
.getAuthorizationUrl( redirectUri )
|
|
@@ -16,6 +16,10 @@ const CONNECT_USER = createRegistryControl(
|
|
|
16
16
|
|
|
17
17
|
const url = new URL( authorizationUrl );
|
|
18
18
|
|
|
19
|
+
if ( skipPricingPage ) {
|
|
20
|
+
url.searchParams.set( 'skip_pricing', 'true' );
|
|
21
|
+
}
|
|
22
|
+
|
|
19
23
|
if ( from ) {
|
|
20
24
|
url.searchParams.set( 'from', encodeURIComponent( from ) );
|
|
21
25
|
}
|