@automattic/jetpack-connection 0.33.5 → 0.33.7

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,14 @@
2
2
 
3
3
  ### This is a list detailing changes for the Jetpack RNA Connection Component releases.
4
4
 
5
+ ## [0.33.7] - 2024-04-08
6
+ ### Added
7
+ - Add 'from' property to connection call to WP.com. [#36741]
8
+
9
+ ## [0.33.6] - 2024-04-08
10
+ ### Changed
11
+ - Updated package dependencies. [#36756, #36760, #36761]
12
+
5
13
  ## [0.33.5] - 2024-03-27
6
14
  ### Changed
7
15
  - Updated package dependencies. [#36539, #36585]
@@ -741,6 +749,8 @@
741
749
  - `Main` and `ConnectUser` components added.
742
750
  - `JetpackRestApiClient` API client added.
743
751
 
752
+ [0.33.7]: https://github.com/Automattic/jetpack-connection-js/compare/v0.33.6...v0.33.7
753
+ [0.33.6]: https://github.com/Automattic/jetpack-connection-js/compare/v0.33.5...v0.33.6
744
754
  [0.33.5]: https://github.com/Automattic/jetpack-connection-js/compare/v0.33.4...v0.33.5
745
755
  [0.33.4]: https://github.com/Automattic/jetpack-connection-js/compare/v0.33.3...v0.33.4
746
756
  [0.33.3]: https://github.com/Automattic/jetpack-connection-js/compare/v0.33.2...v0.33.3
@@ -72,7 +72,7 @@ export default ( {
72
72
  return handleConnectUser();
73
73
  }
74
74
 
75
- return registerSite( { registrationNonce, redirectUri } ).then( () => {
75
+ return registerSite( { registrationNonce, redirectUri, from } ).then( () => {
76
76
  return handleConnectUser();
77
77
  } );
78
78
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@automattic/jetpack-connection",
3
- "version": "0.33.5",
3
+ "version": "0.33.7",
4
4
  "description": "Jetpack Connection Component",
5
5
  "homepage": "https://github.com/Automattic/jetpack/tree/HEAD/projects/js-packages/connection/#readme",
6
6
  "bugs": {
@@ -15,29 +15,29 @@
15
15
  "license": "GPL-2.0-or-later",
16
16
  "dependencies": {
17
17
  "@automattic/jetpack-analytics": "^0.1.29",
18
- "@automattic/jetpack-api": "^0.17.3",
19
- "@automattic/jetpack-components": "^0.50.4",
18
+ "@automattic/jetpack-api": "^0.17.5",
19
+ "@automattic/jetpack-components": "^0.51.0",
20
20
  "@automattic/jetpack-config": "^0.1.24",
21
- "@wordpress/base-styles": "4.45.0",
22
- "@wordpress/browserslist-config": "5.37.0",
23
- "@wordpress/components": "27.2.0",
24
- "@wordpress/data": "9.24.0",
25
- "@wordpress/element": "5.31.0",
26
- "@wordpress/i18n": "4.54.0",
27
- "@wordpress/icons": "9.45.0",
21
+ "@wordpress/base-styles": "4.46.0",
22
+ "@wordpress/browserslist-config": "5.38.0",
23
+ "@wordpress/components": "27.3.0",
24
+ "@wordpress/data": "9.25.0",
25
+ "@wordpress/element": "5.32.0",
26
+ "@wordpress/i18n": "4.55.0",
27
+ "@wordpress/icons": "9.46.0",
28
28
  "classnames": "2.3.2",
29
29
  "debug": "4.3.4",
30
30
  "prop-types": "^15.7.2"
31
31
  },
32
32
  "devDependencies": {
33
- "@automattic/jetpack-base-styles": "^0.6.20",
33
+ "@automattic/jetpack-base-styles": "^0.6.21",
34
34
  "@babel/core": "7.24.0",
35
35
  "@babel/preset-react": "7.23.3",
36
- "@storybook/addon-actions": "8.0.4",
36
+ "@storybook/addon-actions": "8.0.6",
37
37
  "@testing-library/dom": "9.3.4",
38
38
  "@testing-library/react": "14.2.1",
39
39
  "@testing-library/user-event": "14.5.2",
40
- "@types/react": "18.2.67",
40
+ "@types/react": "18.2.74",
41
41
  "jest": "29.7.0",
42
42
  "jest-environment-jsdom": "29.7.0",
43
43
  "react": "18.2.0",
package/state/actions.jsx CHANGED
@@ -90,15 +90,16 @@ function* connectUser( { from, redirectFunc, redirectUri } = {} ) {
90
90
  * @param {object} Object - contains registrationNonce and redirectUri
91
91
  * @param {string} Object.registrationNonce - Registration nonce
92
92
  * @param {string} Object.redirectUri - URI that user will be redirected
93
+ * @param {string} [Object.from] - Value that represents the origin of the request (optional)
93
94
  * @yields {object} Action object that will be yielded
94
95
  * @returns {Promise} Resolved or rejected value of registerSite
95
96
  */
96
- function* registerSite( { registrationNonce, redirectUri } ) {
97
+ function* registerSite( { registrationNonce, redirectUri, from = '' } ) {
97
98
  yield clearRegistrationError();
98
99
  yield setSiteIsRegistering( true );
99
100
 
100
101
  try {
101
- const response = yield { type: REGISTER_SITE, registrationNonce, redirectUri };
102
+ const response = yield { type: REGISTER_SITE, registrationNonce, redirectUri, from };
102
103
  yield setConnectionStatus( { isRegistered: true } );
103
104
  yield setAuthorizationUrl( response.authorizeUrl );
104
105
  yield setSiteIsRegistering( false );
@@ -2,8 +2,8 @@ import restApi from '@automattic/jetpack-api';
2
2
  import { createRegistryControl } from '@wordpress/data';
3
3
  import STORE_ID from './store-id';
4
4
 
5
- const REGISTER_SITE = ( { registrationNonce, redirectUri } ) =>
6
- restApi.registerSite( registrationNonce, redirectUri );
5
+ const REGISTER_SITE = ( { registrationNonce, redirectUri, from } ) =>
6
+ restApi.registerSite( registrationNonce, redirectUri, from );
7
7
 
8
8
  const CONNECT_USER = createRegistryControl(
9
9
  ( { resolveSelect } ) =>