@automattic/jetpack-connection 0.39.11 → 0.39.13

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,10 +2,27 @@
2
2
 
3
3
  ### This is a list detailing changes for the Jetpack RNA Connection Component releases.
4
4
 
5
+ ## [0.39.13] - 2025-05-05
6
+ ### Changed
7
+ - Update package dependencies. [#43326]
8
+
9
+ ### Fixed
10
+ - Linting: Address final rules in WordPress Stylelint config. [#43296]
11
+ - Linting: Do additional stylesheet cleanup. [#43247]
12
+
13
+ ## [0.39.12] - 2025-04-28
14
+ ### Changed
15
+ - Mark external links with extra markup. [#43152]
16
+
17
+ ### Fixed
18
+ - Linting: Fix more Stylelint violations. [#43213]
19
+ - Linting: Remove outdated vendor prefixes in stylesheets. [#43219]
20
+ - My Jetpack: Fix TS type checking and the corresponding errors [#43205]
21
+
5
22
  ## [0.39.11] - 2025-04-14
6
23
  ### Fixed
7
24
  - Linting: Update stylesheets to use WordPress rules for fonts and colors. [#42920] [#42928]
8
- - Linting: Clean up various Styleline violations. [#43010]
25
+ - Linting: Clean up various Stylelint violations. [#43010]
9
26
  - Linting: Use double colon notation for pseudo-element selectors. [#43019]
10
27
 
11
28
  ## [0.39.10] - 2025-04-07
@@ -1002,6 +1019,8 @@
1002
1019
  - `Main` and `ConnectUser` components added.
1003
1020
  - `JetpackRestApiClient` API client added.
1004
1021
 
1022
+ [0.39.13]: https://github.com/Automattic/jetpack-connection-js/compare/v0.39.12...v0.39.13
1023
+ [0.39.12]: https://github.com/Automattic/jetpack-connection-js/compare/v0.39.11...v0.39.12
1005
1024
  [0.39.11]: https://github.com/Automattic/jetpack-connection-js/compare/v0.39.10...v0.39.11
1006
1025
  [0.39.10]: https://github.com/Automattic/jetpack-connection-js/compare/v0.39.9...v0.39.10
1007
1026
  [0.39.9]: https://github.com/Automattic/jetpack-connection-js/compare/v0.39.8...v0.39.9
@@ -53,7 +53,7 @@
53
53
  color: var(--jp-white) !important;
54
54
  border-radius: var(--jp-border-radius);
55
55
  padding: 14px 24px;
56
- margin: 24px 0px 32px;
56
+ margin: 24px 0 32px;
57
57
  justify-content: center;
58
58
  align-items: center;
59
59
 
@@ -20,7 +20,7 @@
20
20
  }
21
21
 
22
22
  // notice content
23
- & :global(.components-notice__content) {
23
+ :global(.components-notice__content) {
24
24
  display: flex;
25
25
  margin: 0;
26
26
  padding: 12px 4px;
@@ -29,14 +29,14 @@
29
29
  }
30
30
 
31
31
  // action button
32
- & :global(.is-link) {
32
+ :global(.is-link) {
33
33
  color: var( --jp-black );
34
34
  font-size: 16px;
35
35
  font-weight: 600;
36
36
  }
37
37
 
38
38
  // X close button
39
- & :global(.components-notice__dismiss) {
39
+ :global(.components-notice__dismiss) {
40
40
  align-self: center;
41
41
  }
42
42
 
@@ -65,7 +65,7 @@
65
65
  white-space: nowrap;
66
66
  }
67
67
 
68
- & :global(.components-notice__content) {
68
+ :global(.components-notice__content) {
69
69
  flex-direction: row;
70
70
  align-items: center;
71
71
  }
@@ -76,23 +76,19 @@
76
76
  margin-bottom: 25px;
77
77
  }
78
78
 
79
- .error {
80
- margin-bottom: 25px;
81
- }
82
-
83
79
  .message {
84
80
  margin-right: var( --spacing-base ); // 8px
85
81
  flex-grow: 1;
86
82
  display: flex;
87
83
 
88
84
  // left icon
89
- & > svg {
85
+ > svg {
90
86
  flex-shrink: 0;
91
87
  align-self: flex-start;
92
88
  margin-right: calc( var( --spacing-base ) * 2 ); // 16px
93
89
  }
94
90
 
95
- & :global(.jp-components-spinner) {
91
+ :global(.jp-components-spinner) {
96
92
  margin-right: calc( var( --spacing-base ) * 2 ); // 16px
97
93
  }
98
94
  }
@@ -47,7 +47,7 @@
47
47
  // smaller screens
48
48
  @media only screen and (max-width: 782px) {
49
49
  // When a headline is above a stats block, add some space.
50
- & + .jp-disconnect-card__card-stat-block {
50
+ + .jp-disconnect-card__card-stat-block {
51
51
  margin-top: 0.5rem;
52
52
  }
53
53
  }
@@ -79,19 +79,6 @@
79
79
  width: calc(100% - 48px); // Help with the margin on the row.
80
80
  }
81
81
 
82
- &__content{
83
- background: var( --jp-white-off );
84
- margin: 0;
85
- padding: 2rem 1rem;
86
- border-radius: 4px;
87
- text-align: center;
88
- flex-grow: 1;
89
- display: flex;
90
- flex-direction: column;
91
- justify-content: center;
92
- align-items: center;
93
- }
94
-
95
82
  &__actions{
96
83
  background: var( --jp-white );
97
84
  padding: 2rem 0;
@@ -157,9 +144,19 @@
157
144
  }
158
145
  }
159
146
 
160
- // When the screen height is shorter, hide the decorative cards to show the text and controls without scrolling.
161
147
  .jp-connection__disconnect-dialog__content {
162
-
148
+ background: var( --jp-white-off );
149
+ margin: 0;
150
+ padding: 2rem 1rem;
151
+ border-radius: 4px;
152
+ text-align: center;
153
+ flex-grow: 1;
154
+ display: flex;
155
+ flex-direction: column;
156
+ justify-content: center;
157
+ align-items: center;
158
+
159
+ // When the screen height is shorter, hide the decorative cards to show the text and controls without scrolling.
163
160
  @media (max-height: 900px) {
164
161
 
165
162
  .jp-components__decorative-card {
@@ -220,6 +217,6 @@
220
217
  }
221
218
 
222
219
  .jp-row {
223
- margin-left: 0px;
220
+ margin-left: 0;
224
221
  }
225
222
  }
@@ -3,11 +3,7 @@
3
3
  }
4
4
 
5
5
  .fade-in {
6
- animation: fadeIn ease 1.5s;
7
- -webkit-animation: fadeIn ease 1.5s;
8
- -moz-animation: fadeIn ease 1.5s;
9
- -o-animation: fadeIn ease 1.5s;
10
- -ms-animation: fadeIn ease 1.5s;
6
+ animation: fadein ease 1.5s;
11
7
  }
12
8
 
13
9
  @keyframes fadeIn {
@@ -16,31 +12,3 @@
16
12
 
17
13
  100% {opacity:1;}
18
14
  }
19
-
20
- @-moz-keyframes fadeIn {
21
-
22
- 0% {opacity:0;}
23
-
24
- 100% {opacity:1;}
25
- }
26
-
27
- @-webkit-keyframes fadeIn {
28
-
29
- 0% {opacity:0;}
30
-
31
- 100% {opacity:1;}
32
- }
33
-
34
- @-o-keyframes fadeIn {
35
-
36
- 0% {opacity:0;}
37
-
38
- 100% {opacity:1;}
39
- }
40
-
41
- @-ms-keyframes fadeIn {
42
-
43
- 0% {opacity:0;}
44
-
45
- 100% {opacity:1;}
46
- }
@@ -34,7 +34,7 @@
34
34
 
35
35
  &__actions{
36
36
  background: var( --jp-white );
37
- margin:0px !important;
37
+ margin:0 !important;
38
38
  border-top: 1px solid var( --jp-gray );
39
39
  max-width: 1200px !important;
40
40
  padding: calc( var( --spacing-base ) * 4 ) calc( var( --spacing-base ) * 5 );
package/declarations.d.ts CHANGED
@@ -6,3 +6,12 @@ declare module '@automattic/jetpack-script-data' {
6
6
  connection: ConnectionScriptData;
7
7
  }
8
8
  }
9
+
10
+ declare global {
11
+ interface Window {
12
+ /**
13
+ * @deprecated In favor of getScriptData from @automattic/jetpack-script-data
14
+ */
15
+ JP_CONNECTION_INITIAL_STATE: ConnectionScriptData;
16
+ }
17
+ }
@@ -22,17 +22,17 @@ const defaultAdminUrl = () =>
22
22
  * Custom hook that performs the needed steps
23
23
  * to concrete the checkout workflow.
24
24
  *
25
- * @param {object} props - The props passed to the hook.
26
- * @param {string} props.productSlug - The WordPress product slug.
27
- * @param {string} props.redirectUrl - The URI to redirect to after checkout.
28
- * @param {string} [props.siteSuffix] - The site suffix.
29
- * @param {string} [props.adminUrl] - The site wp-admin url.
30
- * @param {boolean} props.connectAfterCheckout - Whether or not to conect after checkout if not connected (default false - connect before).
31
- * @param {Function} props.siteProductAvailabilityHandler - The function used to check whether the site already has the requested product. This will be checked after registration and the checkout page will be skipped if the promise returned resloves true.
32
- * @param {Function} props.from - The plugin slug initiated the flow.
33
- * @param {number} [props.quantity] - The quantity of the product to purchase.
34
- * @param {boolean} [props.useBlogIdSuffix] - Use blog ID instead of site suffix in the checkout URL.
35
- * @return {Function} The useEffect hook.
25
+ * @param {object} props - The props passed to the hook.
26
+ * @param {string} props.productSlug - The WordPress product slug.
27
+ * @param {string} props.redirectUrl - The URI to redirect to after checkout.
28
+ * @param {string} [props.siteSuffix] - The site suffix.
29
+ * @param {string} [props.adminUrl] - The site wp-admin url.
30
+ * @param {boolean} [props.connectAfterCheckout] - Whether or not to conect after checkout if not connected (default false - connect before).
31
+ * @param {Function} [props.siteProductAvailabilityHandler] - The function used to check whether the site already has the requested product. This will be checked after registration and the checkout page will be skipped if the promise returned resloves true.
32
+ * @param {string} props.from - The plugin slug initiated the flow.
33
+ * @param {number} [props.quantity] - The quantity of the product to purchase.
34
+ * @param {boolean} [props.useBlogIdSuffix] - Use blog ID instead of site suffix in the checkout URL.
35
+ * @return {object} The useEffect hook.
36
36
  */
37
37
  export default function useProductCheckoutWorkflow( {
38
38
  productSlug,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@automattic/jetpack-connection",
3
- "version": "0.39.11",
3
+ "version": "0.39.13",
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,23 +15,23 @@
15
15
  "license": "GPL-2.0-or-later",
16
16
  "dependencies": {
17
17
  "@automattic/jetpack-analytics": "^0.1.36",
18
- "@automattic/jetpack-api": "^0.20.1",
19
- "@automattic/jetpack-components": "^0.72.4",
18
+ "@automattic/jetpack-api": "^0.20.2",
19
+ "@automattic/jetpack-components": "^0.72.6",
20
20
  "@automattic/jetpack-config": "^0.1.29",
21
- "@automattic/jetpack-script-data": "^0.4.0",
22
- "@wordpress/base-styles": "5.21.0",
23
- "@wordpress/browserslist-config": "6.21.0",
24
- "@wordpress/components": "29.7.0",
25
- "@wordpress/data": "10.21.0",
26
- "@wordpress/element": "6.21.0",
27
- "@wordpress/i18n": "5.21.0",
28
- "@wordpress/icons": "10.21.0",
21
+ "@automattic/jetpack-script-data": "^0.4.1",
22
+ "@wordpress/base-styles": "5.22.0",
23
+ "@wordpress/browserslist-config": "6.22.0",
24
+ "@wordpress/components": "29.8.0",
25
+ "@wordpress/data": "10.22.0",
26
+ "@wordpress/element": "6.22.0",
27
+ "@wordpress/i18n": "5.22.0",
28
+ "@wordpress/icons": "10.22.0",
29
29
  "clsx": "2.1.1",
30
30
  "debug": "4.4.0",
31
31
  "prop-types": "^15.7.2"
32
32
  },
33
33
  "devDependencies": {
34
- "@automattic/jetpack-base-styles": "^0.7.1",
34
+ "@automattic/jetpack-base-styles": "^0.7.3",
35
35
  "@babel/core": "7.26.10",
36
36
  "@babel/preset-react": "7.26.3",
37
37
  "@storybook/addon-actions": "8.6.7",
package/types.ts CHANGED
@@ -1,3 +1,55 @@
1
1
  export type ConnectionScriptData = {
2
+ apiRoot: string;
3
+ apiNonce: string;
4
+ registrationNonce: string;
2
5
  calypsoEnv: string;
6
+ connectionStatus: {
7
+ isActive: boolean;
8
+ isStaging: boolean;
9
+ isRegistered: boolean;
10
+ isUserConnected: boolean;
11
+ hasConnectedOwner: boolean;
12
+ offlineMode: {
13
+ isActive: boolean;
14
+ constant: boolean;
15
+ url: boolean;
16
+ filter: boolean;
17
+ wpLocalConstant: boolean;
18
+ };
19
+ isPublic: boolean;
20
+ };
21
+ userConnectionData: {
22
+ currentUser: {
23
+ isConnected: boolean;
24
+ isMaster: boolean;
25
+ username: string;
26
+ id: number;
27
+ blogId: number;
28
+ wpcomUser: {
29
+ avatar: boolean;
30
+ display_name: string;
31
+ email: string;
32
+ };
33
+ gravatar: string;
34
+ permissions: {
35
+ admin_page?: boolean;
36
+ connect: boolean;
37
+ connect_user: boolean;
38
+ disconnect: boolean;
39
+ edit_posts?: boolean;
40
+ manage_modules?: boolean;
41
+ manage_options?: boolean;
42
+ manage_plugins?: boolean;
43
+ network_admin?: boolean;
44
+ network_sites_page?: boolean;
45
+ publish_posts?: boolean;
46
+ view_stats?: boolean;
47
+ };
48
+ };
49
+ connectionOwner: null;
50
+ };
51
+ connectedPlugins: object;
52
+ wpVersion: string;
53
+ siteSuffix: string;
54
+ connectionErrors: Array< string | object >;
3
55
  };