diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 44d50cdbb21b1..0d50f7f558382 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -367,8 +367,8 @@ importers:
specifier: 10.4.0
version: 10.4.0
'@testing-library/react':
- specifier: 15.0.7
- version: 15.0.7(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)
+ specifier: 16.0.1
+ version: 16.0.1(@testing-library/dom@10.4.0)(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)
'@testing-library/user-event':
specifier: 14.5.2
version: 14.5.2(@testing-library/dom@10.4.0)
@@ -387,9 +387,6 @@ importers:
'@types/react-slider':
specifier: 1.3.6
version: 1.3.6
- '@types/testing-library__jest-dom':
- specifier: 5.14.9
- version: 5.14.9
jest:
specifier: 29.7.0
version: 29.7.0
@@ -497,8 +494,8 @@ importers:
specifier: 10.4.0
version: 10.4.0
'@testing-library/react':
- specifier: 15.0.7
- version: 15.0.7(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)
+ specifier: 16.0.1
+ version: 16.0.1(@testing-library/dom@10.4.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)
'@testing-library/user-event':
specifier: 14.5.2
version: 14.5.2(@testing-library/dom@10.4.0)
@@ -879,8 +876,8 @@ importers:
specifier: 10.4.0
version: 10.4.0
'@testing-library/react':
- specifier: 15.0.7
- version: 15.0.7(react-dom@18.3.1(react@18.3.1))(react@18.3.1)
+ specifier: 16.0.1
+ version: 16.0.1(@testing-library/dom@10.4.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)
'@testing-library/user-event':
specifier: 14.5.2
version: 14.5.2(@testing-library/dom@10.4.0)
@@ -937,8 +934,8 @@ importers:
specifier: 10.4.0
version: 10.4.0
'@testing-library/react':
- specifier: 15.0.7
- version: 15.0.7(react-dom@18.3.1(react@18.3.1))(react@18.3.1)
+ specifier: 16.0.1
+ version: 16.0.1(@testing-library/dom@10.4.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)
'@testing-library/user-event':
specifier: 14.5.2
version: 14.5.2(@testing-library/dom@10.4.0)
@@ -1079,8 +1076,8 @@ importers:
specifier: 10.4.0
version: 10.4.0
'@testing-library/react':
- specifier: 15.0.7
- version: 15.0.7(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)
+ specifier: 16.0.1
+ version: 16.0.1(@testing-library/dom@10.4.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)
'@testing-library/user-event':
specifier: 14.5.2
version: 14.5.2(@testing-library/dom@10.4.0)
@@ -1221,9 +1218,12 @@ importers:
'@storybook/react':
specifier: 8.2.9
version: 8.2.9(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(storybook@8.2.9)(typescript@5.0.4)
+ '@testing-library/dom':
+ specifier: 10.4.0
+ version: 10.4.0
'@testing-library/react':
- specifier: 15.0.7
- version: 15.0.7(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)
+ specifier: 16.0.1
+ version: 16.0.1(@testing-library/dom@10.4.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)
'@types/jest':
specifier: 29.5.12
version: 29.5.12
@@ -1303,8 +1303,8 @@ importers:
specifier: 10.4.0
version: 10.4.0
'@testing-library/react':
- specifier: 15.0.7
- version: 15.0.7(react-dom@18.3.1(react@18.3.1))(react@18.3.1)
+ specifier: 16.0.1
+ version: 16.0.1(@testing-library/dom@10.4.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)
'@testing-library/user-event':
specifier: 14.5.2
version: 14.5.2(@testing-library/dom@10.4.0)
@@ -1772,8 +1772,8 @@ importers:
specifier: 10.4.0
version: 10.4.0
'@testing-library/react':
- specifier: 15.0.7
- version: 15.0.7(react-dom@18.3.1(react@18.3.1))(react@18.3.1)
+ specifier: 16.0.1
+ version: 16.0.1(@testing-library/dom@10.4.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)
'@testing-library/user-event':
specifier: 14.5.2
version: 14.5.2(@testing-library/dom@10.4.0)
@@ -2540,8 +2540,8 @@ importers:
specifier: 6.5.0
version: 6.5.0
'@testing-library/react':
- specifier: 15.0.7
- version: 15.0.7(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)
+ specifier: 16.0.1
+ version: 16.0.1(@testing-library/dom@10.4.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)
'@testing-library/user-event':
specifier: 14.5.2
version: 14.5.2(@testing-library/dom@10.4.0)
@@ -2761,8 +2761,8 @@ importers:
specifier: 3.2.4
version: 3.2.4(preact@10.22.1)
'@testing-library/react':
- specifier: 15.0.7
- version: 15.0.7(react-dom@18.3.1(react@18.3.1))(react@18.3.1)
+ specifier: 16.0.1
+ version: 16.0.1(@testing-library/dom@10.4.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)
'@wordpress/babel-plugin-import-jsx-pragma':
specifier: 5.7.0
version: 5.7.0(@babel/core@7.24.7)
@@ -2946,8 +2946,8 @@ importers:
specifier: 10.4.0
version: 10.4.0
'@testing-library/react':
- specifier: 15.0.7
- version: 15.0.7(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)
+ specifier: 16.0.1
+ version: 16.0.1(@testing-library/dom@10.4.0)(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)
'@types/jest':
specifier: 29.5.12
version: 29.5.12
@@ -2957,9 +2957,6 @@ importers:
'@types/react-dom':
specifier: 18.3.0
version: 18.3.0
- '@types/testing-library__jest-dom':
- specifier: 5.14.9
- version: 5.14.9
'@wordpress/browserslist-config':
specifier: 6.7.0
version: 6.7.0
@@ -3118,8 +3115,8 @@ importers:
specifier: 3.2.4
version: 3.2.4(preact@10.22.1)
'@testing-library/react':
- specifier: 15.0.7
- version: 15.0.7(react-dom@18.3.1(react@18.3.1))(react@18.3.1)
+ specifier: 16.0.1
+ version: 16.0.1(@testing-library/dom@10.4.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)
'@wordpress/babel-plugin-import-jsx-pragma':
specifier: 5.7.0
version: 5.7.0(@babel/core@7.24.7)
@@ -3281,8 +3278,8 @@ importers:
specifier: 10.4.0
version: 10.4.0
'@testing-library/react':
- specifier: 15.0.7
- version: 15.0.7(react-dom@18.3.1(react@18.3.1))(react@18.3.1)
+ specifier: 16.0.1
+ version: 16.0.1(@testing-library/dom@10.4.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)
'@wordpress/browserslist-config':
specifier: 6.7.0
version: 6.7.0
@@ -3526,8 +3523,8 @@ importers:
specifier: 10.4.0
version: 10.4.0
'@testing-library/react':
- specifier: 15.0.7
- version: 15.0.7(react-dom@18.3.1(react@18.3.1))(react@18.3.1)
+ specifier: 16.0.1
+ version: 16.0.1(@testing-library/dom@10.4.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)
'@wordpress/browserslist-config':
specifier: 6.7.0
version: 6.7.0
@@ -3641,8 +3638,8 @@ importers:
specifier: 10.4.0
version: 10.4.0
'@testing-library/react':
- specifier: 15.0.7
- version: 15.0.7(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)
+ specifier: 16.0.1
+ version: 16.0.1(@testing-library/dom@10.4.0)(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)
'@types/jest':
specifier: 29.5.12
version: 29.5.12
@@ -4001,8 +3998,8 @@ importers:
specifier: 10.4.0
version: 10.4.0
'@testing-library/react':
- specifier: 15.0.7
- version: 15.0.7(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)
+ specifier: 16.0.1
+ version: 16.0.1(@testing-library/dom@10.4.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)
'@testing-library/user-event':
specifier: 14.5.2
version: 14.5.2(@testing-library/dom@10.4.0)
@@ -4404,8 +4401,8 @@ importers:
specifier: 10.4.0
version: 10.4.0
'@testing-library/react':
- specifier: 15.0.7
- version: 15.0.7(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)
+ specifier: 16.0.1
+ version: 16.0.1(@testing-library/dom@10.4.0)(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)
'@types/react':
specifier: 18.3.3
version: 18.3.3
@@ -4513,8 +4510,8 @@ importers:
specifier: 10.4.0
version: 10.4.0
'@testing-library/react':
- specifier: 15.0.7
- version: 15.0.7(react-dom@18.3.1(react@18.3.1))(react@18.3.1)
+ specifier: 16.0.1
+ version: 16.0.1(@testing-library/dom@10.4.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)
'@wordpress/browserslist-config':
specifier: 6.7.0
version: 6.7.0
@@ -4847,8 +4844,8 @@ importers:
specifier: 6.21.0
version: 6.21.0(eslint@8.57.0)(typescript@5.0.4)
'@wordpress/eslint-plugin':
- specifier: 20.3.0
- version: 20.3.0(2g4wiqq3ubewvaaot6et2pay5m)
+ specifier: 21.0.0
+ version: 21.0.0(2g4wiqq3ubewvaaot6et2pay5m)
'@wordpress/jest-console':
specifier: 8.7.0
version: 8.7.0(jest@29.7.0)
@@ -7264,16 +7261,20 @@ packages:
peerDependencies:
preact: '>=10 || ^10.0.0-alpha.0 || ^10.0.0-beta.0'
- '@testing-library/react@15.0.7':
- resolution: {integrity: sha512-cg0RvEdD1TIhhkm1IeYMQxrzy0MtUNfa3minv4MjbgcYzJAZ7yD0i0lwoPOTPr+INtiXFezt2o8xMSnyHhEn2Q==}
+ '@testing-library/react@16.0.1':
+ resolution: {integrity: sha512-dSmwJVtJXmku+iocRhWOUFbrERC76TX2Mnf0ATODz8brzAZrMBbzLwQixlBSanZxR6LddK3eiwpSFZgDET1URg==}
engines: {node: '>=18'}
peerDependencies:
+ '@testing-library/dom': ^10.0.0
'@types/react': ^18.0.0
+ '@types/react-dom': ^18.0.0
react: ^18.0.0
react-dom: ^18.0.0
peerDependenciesMeta:
'@types/react':
optional: true
+ '@types/react-dom':
+ optional: true
'@testing-library/user-event@14.5.2':
resolution: {integrity: sha512-YAh82Wh4TIrxYLmfGcixwD18oIjyC1pFQC2Y01F2lzV2HTMiYrI0nze0FD0ocB//CKS/7jIUgae+adPqxK5yCQ==}
@@ -7502,9 +7503,6 @@ packages:
'@types/stack-utils@2.0.3':
resolution: {integrity: sha512-9aEbYZ3TbYMznPdcdr3SmIrLXwC/AKZXQeCf9Pgao5CKb8CyHuEX5jzWPTkvregvhRJHcpRO6BFoGW9ycaOkYw==}
- '@types/testing-library__jest-dom@5.14.9':
- resolution: {integrity: sha512-FSYhIjFlfOpGSRyVoMBMuS3ws5ehFQODymf3vlI7U1K8c7PHwWwFY7VREfmsuzHSOnoKs/9/Y983ayOs7eRzqw==}
-
'@types/tough-cookie@4.0.5':
resolution: {integrity: sha512-/Ad8+nIOV7Rl++6f1BdKxFSMgmoqEoYbHRpPcx3JEfv8VRsQe9Z4mCXeJBzxs7mbHY/XOZZuXlRNfhpVPbs6ZA==}
@@ -7870,8 +7868,8 @@ packages:
resolution: {integrity: sha512-VqLQGNMs1BF6LnS+5eNjpM/sCUQhjn4QOfhDlWdVDi0ZxpZgssPzKhJ1ils/7FC0qF3vrMg8EH5xXxw2xz8A/w==}
engines: {node: '>=18.12.0', npm: '>=8.19.2'}
- '@wordpress/eslint-plugin@20.3.0':
- resolution: {integrity: sha512-Y272ZtosmXPJJ0K5X7j0ufcpuDf1unEEDOmdyStHhYV3DGjfETPKgMBVjpmWIObu5oMlqqkTiiQaNb+lho3EIQ==}
+ '@wordpress/eslint-plugin@21.0.0':
+ resolution: {integrity: sha512-4ioakbwSZNL8eXkfK0hcY93e5Fj9dZljxj3lEFkCBWMkSpU8/pPw/7UMS0OBbGQK8rqmvnXF1y/LFH7ihCxuww==}
engines: {node: '>=18.12.0', npm: '>=8.19.2'}
peerDependencies:
'@babel/core': '>=7'
@@ -17534,21 +17532,29 @@ snapshots:
'@testing-library/dom': 8.20.1
preact: 10.22.1
- '@testing-library/react@15.0.7(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)':
+ '@testing-library/react@16.0.1(@testing-library/dom@10.4.0)(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)':
dependencies:
'@babel/runtime': 7.24.7
'@testing-library/dom': 10.4.0
+ react: 18.3.1
+ react-dom: 18.3.1(react@18.3.1)
+ optionalDependencies:
+ '@types/react': 18.3.3
'@types/react-dom': 18.3.0
+
+ '@testing-library/react@16.0.1(@testing-library/dom@10.4.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)':
+ dependencies:
+ '@babel/runtime': 7.24.7
+ '@testing-library/dom': 10.4.0
react: 18.3.1
react-dom: 18.3.1(react@18.3.1)
optionalDependencies:
'@types/react': 18.3.3
- '@testing-library/react@15.0.7(react-dom@18.3.1(react@18.3.1))(react@18.3.1)':
+ '@testing-library/react@16.0.1(@testing-library/dom@10.4.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)':
dependencies:
'@babel/runtime': 7.24.7
'@testing-library/dom': 10.4.0
- '@types/react-dom': 18.3.0
react: 18.3.1
react-dom: 18.3.1(react@18.3.1)
@@ -17804,10 +17810,6 @@ snapshots:
'@types/stack-utils@2.0.3': {}
- '@types/testing-library__jest-dom@5.14.9':
- dependencies:
- '@types/jest': 29.5.12
-
'@types/tough-cookie@4.0.5': {}
'@types/triple-beam@1.3.5': {}
@@ -19241,7 +19243,7 @@ snapshots:
dependencies:
'@babel/runtime': 7.24.7
- '@wordpress/eslint-plugin@20.3.0(2g4wiqq3ubewvaaot6et2pay5m)':
+ '@wordpress/eslint-plugin@21.0.0(2g4wiqq3ubewvaaot6et2pay5m)':
dependencies:
'@babel/core': 7.24.7
'@babel/eslint-parser': 7.24.7(@babel/core@7.24.7)(eslint@8.57.0)
diff --git a/projects/js-packages/components/changelog/renovate-major-js-unit-testing-packages b/projects/js-packages/components/changelog/renovate-major-js-unit-testing-packages
new file mode 100644
index 0000000000000..c47cb18e82997
--- /dev/null
+++ b/projects/js-packages/components/changelog/renovate-major-js-unit-testing-packages
@@ -0,0 +1,4 @@
+Significance: patch
+Type: changed
+
+Updated package dependencies.
diff --git a/projects/js-packages/components/package.json b/projects/js-packages/components/package.json
index c4794eb0127a5..0d7b6e59a4553 100644
--- a/projects/js-packages/components/package.json
+++ b/projects/js-packages/components/package.json
@@ -43,14 +43,13 @@
"@storybook/blocks": "8.2.9",
"@storybook/react": "8.2.9",
"@testing-library/dom": "10.4.0",
- "@testing-library/react": "15.0.7",
+ "@testing-library/react": "16.0.1",
"@testing-library/user-event": "14.5.2",
"@types/jest": "29.5.12",
"@types/qrcode.react": "1.0.5",
"@types/react": "18.3.3",
"@types/react-dom": "18.3.0",
"@types/react-slider": "1.3.6",
- "@types/testing-library__jest-dom": "5.14.9",
"jest": "29.7.0",
"jest-environment-jsdom": "29.7.0",
"react": "18.3.1",
diff --git a/projects/js-packages/connection/changelog/renovate-major-js-unit-testing-packages b/projects/js-packages/connection/changelog/renovate-major-js-unit-testing-packages
new file mode 100644
index 0000000000000..c47cb18e82997
--- /dev/null
+++ b/projects/js-packages/connection/changelog/renovate-major-js-unit-testing-packages
@@ -0,0 +1,4 @@
+Significance: patch
+Type: changed
+
+Updated package dependencies.
diff --git a/projects/js-packages/connection/package.json b/projects/js-packages/connection/package.json
index d84a872e95f12..254f1c82f0961 100644
--- a/projects/js-packages/connection/package.json
+++ b/projects/js-packages/connection/package.json
@@ -36,7 +36,7 @@
"@babel/preset-react": "7.24.7",
"@storybook/addon-actions": "8.2.9",
"@testing-library/dom": "10.4.0",
- "@testing-library/react": "15.0.7",
+ "@testing-library/react": "16.0.1",
"@testing-library/user-event": "14.5.2",
"@types/react": "18.3.3",
"jest": "29.7.0",
diff --git a/projects/js-packages/licensing/changelog/renovate-major-js-unit-testing-packages b/projects/js-packages/licensing/changelog/renovate-major-js-unit-testing-packages
new file mode 100644
index 0000000000000..c47cb18e82997
--- /dev/null
+++ b/projects/js-packages/licensing/changelog/renovate-major-js-unit-testing-packages
@@ -0,0 +1,4 @@
+Significance: patch
+Type: changed
+
+Updated package dependencies.
diff --git a/projects/js-packages/licensing/package.json b/projects/js-packages/licensing/package.json
index 03cf53da4b8fe..c0b9080349075 100644
--- a/projects/js-packages/licensing/package.json
+++ b/projects/js-packages/licensing/package.json
@@ -37,7 +37,7 @@
"@babel/plugin-transform-react-jsx": "7.24.7",
"@babel/preset-react": "7.24.7",
"@testing-library/dom": "10.4.0",
- "@testing-library/react": "15.0.7",
+ "@testing-library/react": "16.0.1",
"@testing-library/user-event": "14.5.2",
"@wordpress/babel-plugin-import-jsx-pragma": "5.7.0",
"babel-jest": "29.7.0",
diff --git a/projects/js-packages/partner-coupon/changelog/renovate-major-js-unit-testing-packages b/projects/js-packages/partner-coupon/changelog/renovate-major-js-unit-testing-packages
new file mode 100644
index 0000000000000..c47cb18e82997
--- /dev/null
+++ b/projects/js-packages/partner-coupon/changelog/renovate-major-js-unit-testing-packages
@@ -0,0 +1,4 @@
+Significance: patch
+Type: changed
+
+Updated package dependencies.
diff --git a/projects/js-packages/partner-coupon/package.json b/projects/js-packages/partner-coupon/package.json
index 9d1fa0cf2a8d5..80ce295b344cd 100644
--- a/projects/js-packages/partner-coupon/package.json
+++ b/projects/js-packages/partner-coupon/package.json
@@ -24,7 +24,7 @@
"@babel/core": "7.24.7",
"@babel/preset-react": "7.24.7",
"@testing-library/dom": "10.4.0",
- "@testing-library/react": "15.0.7",
+ "@testing-library/react": "16.0.1",
"@testing-library/user-event": "14.5.2",
"@wordpress/base-styles": "5.7.0",
"@wordpress/data": "10.7.0",
diff --git a/projects/js-packages/publicize-components/changelog/renovate-major-js-unit-testing-packages b/projects/js-packages/publicize-components/changelog/renovate-major-js-unit-testing-packages
new file mode 100644
index 0000000000000..c47cb18e82997
--- /dev/null
+++ b/projects/js-packages/publicize-components/changelog/renovate-major-js-unit-testing-packages
@@ -0,0 +1,4 @@
+Significance: patch
+Type: changed
+
+Updated package dependencies.
diff --git a/projects/js-packages/publicize-components/changelog/update-social-share-status-show-spinner-on-retry b/projects/js-packages/publicize-components/changelog/update-social-share-status-show-spinner-on-retry
new file mode 100644
index 0000000000000..0ff9bf1ff31e5
--- /dev/null
+++ b/projects/js-packages/publicize-components/changelog/update-social-share-status-show-spinner-on-retry
@@ -0,0 +1,4 @@
+Significance: patch
+Type: added
+
+Social: Share status | Updated retry to show spinner and start polling
diff --git a/projects/js-packages/publicize-components/package.json b/projects/js-packages/publicize-components/package.json
index fec716cbd7164..010aaca8e53e5 100644
--- a/projects/js-packages/publicize-components/package.json
+++ b/projects/js-packages/publicize-components/package.json
@@ -57,7 +57,7 @@
"@babel/preset-react": "7.24.7",
"@babel/runtime": "7.24.7",
"@testing-library/dom": "10.4.0",
- "@testing-library/react": "15.0.7",
+ "@testing-library/react": "16.0.1",
"@testing-library/user-event": "14.5.2",
"@types/jest": "29.5.12",
"@types/react": "18.3.3",
diff --git a/projects/js-packages/publicize-components/src/components/share-status/retry.tsx b/projects/js-packages/publicize-components/src/components/share-status/retry.tsx
index e95e56625a88d..3917ec6aa9992 100644
--- a/projects/js-packages/publicize-components/src/components/share-status/retry.tsx
+++ b/projects/js-packages/publicize-components/src/components/share-status/retry.tsx
@@ -1,14 +1,17 @@
import { IconTooltip } from '@automattic/jetpack-components';
import { useAnalytics } from '@automattic/jetpack-shared-extension-utils';
-import { Button } from '@wordpress/components';
-import { useSelect } from '@wordpress/data';
+import { Button, Spinner } from '@wordpress/components';
+import { useDispatch, useSelect } from '@wordpress/data';
import { store as editorStore } from '@wordpress/editor';
import { __, _x } from '@wordpress/i18n';
-import { useCallback } from 'react';
+import { useCallback, useState } from 'react';
import useSharePost from '../../hooks/use-share-post';
import { store as socialStore } from '../../social-store';
import { ShareStatusItem } from '../../social-store/types';
-import { connectionMatchesShareItem } from '../../utils/share-status';
+import {
+ areShareItemsForSameConnection,
+ connectionMatchesShareItem,
+} from '../../utils/share-status';
import styles from './styles.module.scss';
export type RetryProps = {
@@ -31,6 +34,9 @@ export function Retry( { shareItem }: RetryProps ) {
const connectionStillExists = connections.some( connectionMatchesShareItem( shareItem ) );
const { doPublicize } = useSharePost( postId );
+ const { pollForPostShareStatus } = useDispatch( socialStore );
+
+ const [ isRetrying, setIsRetrying ] = useState( false );
const onRetry = useCallback( async () => {
recordEvent( 'jetpack_social_share_status_retry', {
@@ -50,8 +56,30 @@ export function Retry( { shareItem }: RetryProps ) {
return;
}
+ setIsRetrying( true );
+
await doPublicize( skippedConnections );
- }, [ shareItem, connections, doPublicize, recordEvent ] );
+
+ await pollForPostShareStatus( {
+ isRequestComplete( { postShareStatus, lastTimestamp } ) {
+ const isComplete = postShareStatus.shares.some( share => {
+ return (
+ share.timestamp > lastTimestamp && areShareItemsForSameConnection( shareItem, share )
+ );
+ } );
+
+ if ( isComplete ) {
+ setIsRetrying( false );
+ }
+
+ return isComplete;
+ },
+ } );
+ }, [ recordEvent, shareItem, connections, doPublicize, pollForPostShareStatus ] );
+
+ if ( isRetrying ) {
+ return
{ createInterpolateElement(
__(
- ' Get in touch with us to get your site backups going again.',
+ 'Get in touch with us to get your site backups going again.',
'jetpack-backup-pkg'
),
{
diff --git a/projects/packages/classic-theme-helper/changelog/add-require-content-options-in-classic-theme-helper-package b/projects/packages/classic-theme-helper/changelog/add-require-content-options-in-classic-theme-helper-package
new file mode 100644
index 0000000000000..58e968282a271
--- /dev/null
+++ b/projects/packages/classic-theme-helper/changelog/add-require-content-options-in-classic-theme-helper-package
@@ -0,0 +1,4 @@
+Significance: minor
+Type: added
+
+Content Options: Ensuring feature is now required.
diff --git a/projects/packages/classic-theme-helper/src/class-main.php b/projects/packages/classic-theme-helper/src/class-main.php
index 8b230e3d2a7c6..27dce7a41d518 100644
--- a/projects/packages/classic-theme-helper/src/class-main.php
+++ b/projects/packages/classic-theme-helper/src/class-main.php
@@ -26,6 +26,7 @@ class Main {
'site-breadcrumbs.php',
'social-menu.php',
'jetpack-color.php',
+ 'content-options.php',
);
/** Holds the singleton instance of the Loader
diff --git a/projects/packages/classic-theme-helper/src/content-options/customizer.js b/projects/packages/classic-theme-helper/src/content-options/customizer.js
index e853604242cdd..5170db0277d57 100644
--- a/projects/packages/classic-theme-helper/src/content-options/customizer.js
+++ b/projects/packages/classic-theme-helper/src/content-options/customizer.js
@@ -1,4 +1,4 @@
-/* global blogDisplay, postDetails */
+/* global blogDisplay, postDetails, wp */
/**
* customizer.js
@@ -6,213 +6,143 @@
* Theme Customizer enhancements for a better user experience.
*
* Contains handlers to make Theme Customizer preview reload changes asynchronously.
- * @param $
*/
-jQuery( function ( $, wp ) {
- // Blog Display
- wp.customize( 'jetpack_content_blog_display', function ( value ) {
- if ( 'content' === blogDisplay.display ) {
- $( '.jetpack-blog-display.jetpack-the-excerpt' ).css( {
- clip: 'rect(1px, 1px, 1px, 1px)',
- position: 'absolute',
- } );
- $( '.jetpack-blog-display.jetpack-the-content' ).css( {
- clip: 'auto',
- position: 'relative',
- } );
- } else if ( 'excerpt' === blogDisplay.display ) {
- $( '.jetpack-blog-display.jetpack-the-content' ).css( {
+/**
+ * Function to apply styles to elements based on the display type
+ * @param {object} selectors - HTML selectors which styles will apply to.
+ * @param {object} styles - Styles to be applied to selectors.
+ */
+function applyStyles( selectors, styles ) {
+ document.querySelectorAll( selectors ).forEach( el => {
+ for ( const [ key, value ] of Object.entries( styles ) ) {
+ el.style[ key ] = value;
+ }
+ } );
+}
+
+// Blog Display
+wp.customize( 'jetpack_content_blog_display', function ( value ) {
+ /**
+ * Updates the blog display based on the selected option.
+ * @param {string} to - Content display option.
+ */
+ function updateBlogDisplay( to ) {
+ const contentSelectors = '.jetpack-blog-display.jetpack-the-content';
+ const excerptSelectors = '.jetpack-blog-display.jetpack-the-excerpt';
+ const featuredContentSelectors = '.featured-content .jetpack-blog-display';
+
+ if ( to === 'content' ) {
+ applyStyles( `${ excerptSelectors }, ${ featuredContentSelectors }.jetpack-the-excerpt`, {
clip: 'rect(1px, 1px, 1px, 1px)',
position: 'absolute',
} );
- $( '.jetpack-blog-display.jetpack-the-excerpt' ).css( {
+ applyStyles( `${ contentSelectors }, ${ featuredContentSelectors }.jetpack-the-content`, {
clip: 'auto',
position: 'relative',
} );
- } else if ( 'mixed' === blogDisplay.display ) {
- $( '.jetpack-blog-display.jetpack-the-content.output-the-content' ).css( {
- clip: 'auto',
- position: 'relative',
- } );
- $( '.jetpack-blog-display.jetpack-the-excerpt.output-the-content' ).css( {
- clip: 'rect(1px, 1px, 1px, 1px)',
- position: 'absolute',
- } );
- $( '.jetpack-blog-display.jetpack-the-content.output-the-excerpt' ).css( {
+ } else if ( to === 'excerpt' ) {
+ applyStyles( `${ contentSelectors }, ${ featuredContentSelectors }.jetpack-the-content`, {
clip: 'rect(1px, 1px, 1px, 1px)',
position: 'absolute',
} );
- $( '.jetpack-blog-display.jetpack-the-excerpt.output-the-excerpt' ).css( {
+ applyStyles( `${ excerptSelectors }, ${ featuredContentSelectors }.jetpack-the-excerpt`, {
clip: 'auto',
position: 'relative',
} );
- }
- value.bind( function ( to ) {
- if ( 'content' === to ) {
- $( '.jetpack-blog-display.jetpack-the-excerpt' ).css( {
- clip: 'rect(1px, 1px, 1px, 1px)',
- position: 'absolute',
- } );
- $( '.jetpack-blog-display.jetpack-the-content' ).css( {
- clip: 'auto',
- position: 'relative',
- } );
- } else if ( 'excerpt' === to ) {
- $( '.jetpack-blog-display.jetpack-the-content' ).css( {
- clip: 'rect(1px, 1px, 1px, 1px)',
- position: 'absolute',
- } );
- $( '.jetpack-blog-display.jetpack-the-excerpt' ).css( {
- clip: 'auto',
- position: 'relative',
- } );
- } else if ( 'mixed' === to ) {
- $( '.jetpack-blog-display.jetpack-the-content.output-the-content' ).css( {
+ } else if ( to === 'mixed' ) {
+ applyStyles(
+ `${ contentSelectors }.output-the-content, ${ featuredContentSelectors }.jetpack-the-content.output-the-content`,
+ {
clip: 'auto',
position: 'relative',
- } );
- $( '.jetpack-blog-display.jetpack-the-excerpt.output-the-content' ).css( {
- clip: 'rect(1px, 1px, 1px, 1px)',
- position: 'absolute',
- } );
- $( '.jetpack-blog-display.jetpack-the-content.output-the-excerpt' ).css( {
+ }
+ );
+ applyStyles(
+ `${ excerptSelectors }.output-the-content, ${ contentSelectors }.output-the-excerpt, ${ featuredContentSelectors }.jetpack-the-excerpt.output-the-content, ${ featuredContentSelectors }.jetpack-the-content.output-the-excerpt`,
+ {
clip: 'rect(1px, 1px, 1px, 1px)',
position: 'absolute',
- } );
- $( '.jetpack-blog-display.jetpack-the-excerpt.output-the-excerpt' ).css( {
+ }
+ );
+ applyStyles(
+ `${ excerptSelectors }.output-the-excerpt, ${ featuredContentSelectors }.jetpack-the-excerpt.output-the-excerpt`,
+ {
clip: 'auto',
position: 'relative',
- } );
- }
- if ( blogDisplay.masonry ) {
- $( blogDisplay.masonry ).masonry();
+ }
+ );
+ }
+
+ if ( blogDisplay.masonry ) {
+ const masonryElement = document.querySelector( blogDisplay.masonry );
+ if ( masonryElement ) {
+ masonryElement.masonry();
}
- } );
+ }
+ }
+
+ updateBlogDisplay( blogDisplay.display );
+ value.bind( updateBlogDisplay );
+} );
+
+/**
+ * Function to update post details visibility
+ * @param {object} selectors - HTML selectors which styles will apply to.
+ * @param {string} to - Content display option.
+ * @param {string} hiddenClass - Class to be added to the body when the post details are hidden.
+ */
+function updatePostDetails( selectors, to, hiddenClass ) {
+ document.querySelectorAll( selectors ).forEach( element => {
+ if ( to === false ) {
+ element.style.clip = 'rect(1px, 1px, 1px, 1px)';
+ element.style.height = '1px';
+ element.style.overflow = 'hidden';
+ element.style.position = 'absolute';
+ element.style.width = '1px';
+ document.body.classList.add( hiddenClass );
+ } else {
+ element.style.clip = 'auto';
+ element.style.height = 'auto';
+ element.style.overflow = 'auto';
+ element.style.position = 'relative';
+ element.style.width = 'auto';
+ document.body.classList.remove( hiddenClass );
+ }
} );
+}
- // Post Details: Date.
- wp.customize( 'jetpack_content_post_details_date', function ( value ) {
- value.bind( function ( to ) {
- if ( false === to ) {
- $( postDetails.date ).css( {
- clip: 'rect(1px, 1px, 1px, 1px)',
- height: '1px',
- overflow: 'hidden',
- position: 'absolute',
- width: '1px',
- } );
- $( 'body' ).addClass( 'date-hidden' );
- } else {
- $( postDetails.date ).css( {
- clip: 'auto',
- height: 'auto',
- overflow: 'auto',
- position: 'relative',
- width: 'auto',
- } );
- $( 'body' ).removeClass( 'date-hidden' );
- }
- } );
+// Post Details: Date
+wp.customize( 'jetpack_content_post_details_date', function ( value ) {
+ value.bind( function ( to ) {
+ updatePostDetails( postDetails.date, to, 'date-hidden' );
} );
+} );
- // Post Details: Categories.
- wp.customize( 'jetpack_content_post_details_categories', function ( value ) {
- value.bind( function ( to ) {
- if ( false === to ) {
- $( postDetails.categories ).css( {
- clip: 'rect(1px, 1px, 1px, 1px)',
- height: '1px',
- overflow: 'hidden',
- position: 'absolute',
- width: '1px',
- } );
- $( 'body' ).addClass( 'categories-hidden' );
- } else {
- $( postDetails.categories ).css( {
- clip: 'auto',
- height: 'auto',
- overflow: 'auto',
- position: 'relative',
- width: 'auto',
- } );
- $( 'body' ).removeClass( 'categories-hidden' );
- }
- } );
+// Post Details: Categories
+wp.customize( 'jetpack_content_post_details_categories', function ( value ) {
+ value.bind( function ( to ) {
+ updatePostDetails( postDetails.categories, to, 'categories-hidden' );
} );
+} );
- // Post Details: Tags.
- wp.customize( 'jetpack_content_post_details_tags', function ( value ) {
- value.bind( function ( to ) {
- if ( false === to ) {
- $( postDetails.tags ).css( {
- clip: 'rect(1px, 1px, 1px, 1px)',
- height: '1px',
- overflow: 'hidden',
- position: 'absolute',
- width: '1px',
- } );
- $( 'body' ).addClass( 'tags-hidden' );
- } else {
- $( postDetails.tags ).css( {
- clip: 'auto',
- height: 'auto',
- overflow: 'auto',
- position: 'relative',
- width: 'auto',
- } );
- $( 'body' ).removeClass( 'tags-hidden' );
- }
- } );
+// Post Details: Tags
+wp.customize( 'jetpack_content_post_details_tags', function ( value ) {
+ value.bind( function ( to ) {
+ updatePostDetails( postDetails.tags, to, 'tags-hidden' );
} );
+} );
- // Post Details: Author.
- wp.customize( 'jetpack_content_post_details_author', function ( value ) {
- value.bind( function ( to ) {
- if ( false === to ) {
- $( postDetails.author ).css( {
- clip: 'rect(1px, 1px, 1px, 1px)',
- height: '1px',
- overflow: 'hidden',
- position: 'absolute',
- width: '1px',
- } );
- $( 'body' ).addClass( 'author-hidden' );
- } else {
- $( postDetails.author ).css( {
- clip: 'auto',
- height: 'auto',
- overflow: 'auto',
- position: 'relative',
- width: 'auto',
- } );
- $( 'body' ).removeClass( 'author-hidden' );
- }
- } );
+// Post Details: Author
+wp.customize( 'jetpack_content_post_details_author', function ( value ) {
+ value.bind( function ( to ) {
+ updatePostDetails( postDetails.author, to, 'author-hidden' );
} );
+} );
- // Post Details: Comment link.
- wp.customize( 'jetpack_content_post_details_comment', function ( value ) {
- value.bind( function ( to ) {
- if ( false === to ) {
- $( postDetails.comment ).css( {
- clip: 'rect(1px, 1px, 1px, 1px)',
- height: '1px',
- overflow: 'hidden',
- position: 'absolute',
- width: '1px',
- } );
- $( 'body' ).addClass( 'comment-hidden' );
- } else {
- $( postDetails.comment ).css( {
- clip: 'auto',
- height: 'auto',
- overflow: 'auto',
- position: 'relative',
- width: 'auto',
- } );
- $( 'body' ).removeClass( 'comment-hidden' );
- }
- } );
+// Post Details: Comment link
+wp.customize( 'jetpack_content_post_details_comment', function ( value ) {
+ value.bind( function ( to ) {
+ updatePostDetails( postDetails.comment, to, 'comment-hidden' );
} );
-} )( jQuery );
+} );
diff --git a/projects/packages/classic-theme-helper/src/content-options/customizer.php b/projects/packages/classic-theme-helper/src/content-options/customizer.php
index 7cbe45cac7a59..b5305c97d0baa 100644
--- a/projects/packages/classic-theme-helper/src/content-options/customizer.php
+++ b/projects/packages/classic-theme-helper/src/content-options/customizer.php
@@ -5,6 +5,8 @@
* @package automattic/jetpack-classic-theme-helper
*/
+use Automattic\Jetpack\Assets;
+
if ( ! function_exists( 'jetpack_content_options_customize_register' ) ) {
/**
@@ -493,7 +495,18 @@ function jetpack_content_options_customize_preview_js() {
$author = ( ! empty( $post_details['author'] ) ) ? $post_details['author'] : null;
$comment = ( ! empty( $post_details['comment'] ) ) ? $post_details['comment'] : null;
- wp_enqueue_script( 'jetpack-content-options-customizer', plugins_url( 'customizer.js', __FILE__ ), array( 'jquery', 'customize-preview' ), '1.0', true );
+ Assets::register_script(
+ 'jetpack-content-options-customizer',
+ '../../dist/content-options/customizer.js',
+ __FILE__,
+ array(
+ 'dependencies' => array(
+ 'customize-preview',
+ ),
+ 'in_footer' => true,
+ 'enqueue' => true,
+ )
+ );
wp_localize_script(
'jetpack-content-options-customizer',
diff --git a/projects/packages/classic-theme-helper/src/content-options/post-details.php b/projects/packages/classic-theme-helper/src/content-options/post-details.php
index 3e4fbc3f9f526..dc21f60d3b6bb 100644
--- a/projects/packages/classic-theme-helper/src/content-options/post-details.php
+++ b/projects/packages/classic-theme-helper/src/content-options/post-details.php
@@ -60,8 +60,10 @@ function jetpack_post_details_enqueue_scripts() {
$css = $elements . ' { clip: rect(1px, 1px, 1px, 1px); height: 1px; position: absolute; overflow: hidden; width: 1px; }';
// Add the CSS to the stylesheet.
- // @phan-suppress-next-line PhanTypeArraySuspiciousNullable.
- wp_add_inline_style( $post_details['stylesheet'], $css );
+
+ if ( is_array( $post_details ) && isset( $post_details['stylesheet'] ) ) {
+ wp_add_inline_style( $post_details['stylesheet'], $css );
+ }
}
add_action( 'wp_enqueue_scripts', 'jetpack_post_details_enqueue_scripts' );
diff --git a/projects/packages/connection/changelog/fix-connected-plugins-on-multisites b/projects/packages/connection/changelog/fix-connected-plugins-on-multisites
new file mode 100644
index 0000000000000..a608ebf17009c
--- /dev/null
+++ b/projects/packages/connection/changelog/fix-connected-plugins-on-multisites
@@ -0,0 +1,4 @@
+Significance: patch
+Type: fixed
+
+Fix the connected plugins option on multisites.
diff --git a/projects/packages/connection/src/class-plugin-storage.php b/projects/packages/connection/src/class-plugin-storage.php
index 21d9402bf0e29..c722a7f022a60 100644
--- a/projects/packages/connection/src/class-plugin-storage.php
+++ b/projects/packages/connection/src/class-plugin-storage.php
@@ -144,7 +144,10 @@ private static function ensure_configured() {
}
if ( is_multisite() && get_current_blog_id() !== self::$current_blog_id ) {
- self::$plugins = (array) get_option( self::ACTIVE_PLUGINS_OPTION_NAME, array() );
+ if ( self::$current_blog_id ) {
+ // If blog ID got changed, pull the list of active plugins for that blog from the database.
+ self::$plugins = (array) get_option( self::ACTIVE_PLUGINS_OPTION_NAME, array() );
+ }
self::$current_blog_id = get_current_blog_id();
}
diff --git a/projects/packages/device-detection/changelog/update-device-detection b/projects/packages/device-detection/changelog/update-device-detection
new file mode 100644
index 0000000000000..e413e8177c7f6
--- /dev/null
+++ b/projects/packages/device-detection/changelog/update-device-detection
@@ -0,0 +1,4 @@
+Significance: patch
+Type: changed
+
+Device_Detection::get_info() will now memoize its result
diff --git a/projects/packages/device-detection/src/class-device-detection.php b/projects/packages/device-detection/src/class-device-detection.php
index 767a552ccbee6..62361d7edb498 100644
--- a/projects/packages/device-detection/src/class-device-detection.php
+++ b/projects/packages/device-detection/src/class-device-detection.php
@@ -23,6 +23,20 @@
*/
class Device_Detection {
+ /**
+ * Memoization cache for get_info() results.
+ *
+ * @var array
+ */
+ private static $get_info_memo = array();
+
+ /**
+ * Maximum size of the memoization cache.
+ *
+ * @var int
+ */
+ private static $max_memo_size = 100;
+
/**
* Returns information about the current device accessing the page.
*
@@ -41,6 +55,16 @@ class Device_Detection {
* );
*/
public static function get_info( $ua = '' ) {
+ // Return memoized result if available.
+ // phpcs:disable WordPress.Security.ValidatedSanitizedInput
+ $memo_key = ! empty( $ua ) ? $ua : ( $_SERVER['HTTP_USER_AGENT'] ?? '' );
+ // Note: UA string used raw for compatibility reasons.
+ // No sanitization is needed as the value is never output or persisted, and is only used for memoization.
+ // phpcs:enable WordPress.Security.ValidatedSanitizedInput
+ if ( isset( self::$get_info_memo[ $memo_key ] ) ) {
+ return self::$get_info_memo[ $memo_key ];
+ }
+
$ua_info = new User_Agent_Info( $ua );
$info = array(
@@ -68,6 +92,13 @@ public static function get_info( $ua = '' ) {
*/
$info = apply_filters( 'jetpack_device_detection_get_info', $info, $ua, $ua_info );
}
+
+ // Memoize the result.
+ self::$get_info_memo[ $memo_key ] = $info;
+ if ( count( self::$get_info_memo ) > self::$max_memo_size ) {
+ array_shift( self::$get_info_memo );
+ }
+
return $info;
}
diff --git a/projects/packages/forms/changelog/update-wordpress-eslint-plugin b/projects/packages/forms/changelog/update-wordpress-eslint-plugin
new file mode 100644
index 0000000000000..b7741525f5678
--- /dev/null
+++ b/projects/packages/forms/changelog/update-wordpress-eslint-plugin
@@ -0,0 +1,4 @@
+Significance: patch
+Type: fixed
+
+Use en-dash in numeric range in i18n message to conform to guidelines.
diff --git a/projects/packages/forms/src/blocks/contact-form/components/jetpack-salesforce-lead-form/jetpack-salesforce-lead-form-settings.js b/projects/packages/forms/src/blocks/contact-form/components/jetpack-salesforce-lead-form/jetpack-salesforce-lead-form-settings.js
index 4feab8bb8a60a..989d8aa665215 100644
--- a/projects/packages/forms/src/blocks/contact-form/components/jetpack-salesforce-lead-form/jetpack-salesforce-lead-form-settings.js
+++ b/projects/packages/forms/src/blocks/contact-form/components/jetpack-salesforce-lead-form/jetpack-salesforce-lead-form-settings.js
@@ -141,7 +141,7 @@ export default ( { salesforceData, setAttributes, instanceId } ) => {
{ organizationIdError && (