@automattic/jetpack-shared-extension-utils 0.17.2 → 0.17.4
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 -2
- package/package.json +15 -15
- package/src/hooks/use-autosave-and-redirect/index.js +4 -2
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,14 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [0.17.4] - 2025-03-03
|
|
9
|
+
### Changed
|
|
10
|
+
- Update package dependencies. [#42163]
|
|
11
|
+
|
|
12
|
+
## [0.17.3] - 2025-02-24
|
|
13
|
+
### Changed
|
|
14
|
+
- Update dependencies. [#40231]
|
|
15
|
+
|
|
8
16
|
## [0.17.2] - 2025-02-17
|
|
9
17
|
### Changed
|
|
10
18
|
- Update dependencies. [#40231]
|
|
@@ -15,8 +23,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
15
23
|
|
|
16
24
|
## [0.17.0] - 2025-02-05
|
|
17
25
|
### Changed
|
|
18
|
-
- External Media: Move
|
|
19
|
-
-
|
|
26
|
+
- External Media: Move GooglePhotosMedia, OpenverseMedia, and PexelsMedia components to @automattic/jetpack-shared-extension-utils. [#41078]
|
|
27
|
+
- Update package dependencies. [#41491] [#41577]
|
|
20
28
|
|
|
21
29
|
## [0.16.5] - 2025-01-27
|
|
22
30
|
### Changed
|
|
@@ -536,6 +544,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
536
544
|
### Changed
|
|
537
545
|
- Core: prepare utility for release
|
|
538
546
|
|
|
547
|
+
[0.17.4]: https://github.com/Automattic/jetpack-shared-extension-utils/compare/0.17.3...0.17.4
|
|
548
|
+
[0.17.3]: https://github.com/Automattic/jetpack-shared-extension-utils/compare/0.17.2...0.17.3
|
|
539
549
|
[0.17.2]: https://github.com/Automattic/jetpack-shared-extension-utils/compare/0.17.1...0.17.2
|
|
540
550
|
[0.17.1]: https://github.com/Automattic/jetpack-shared-extension-utils/compare/0.17.0...0.17.1
|
|
541
551
|
[0.17.0]: https://github.com/Automattic/jetpack-shared-extension-utils/compare/0.16.5...0.17.0
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@automattic/jetpack-shared-extension-utils",
|
|
3
|
-
"version": "0.17.
|
|
3
|
+
"version": "0.17.4",
|
|
4
4
|
"description": "Utility functions used by the block editor extensions",
|
|
5
5
|
"homepage": "https://github.com/Automattic/jetpack/tree/HEAD/projects/js-packages/shared-extension-utils/#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -19,19 +19,19 @@
|
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"@automattic/color-studio": "4.0.0",
|
|
22
|
-
"@automattic/jetpack-analytics": "^0.1.
|
|
23
|
-
"@automattic/jetpack-base-styles": "^0.6.
|
|
24
|
-
"@automattic/jetpack-components": "^0.
|
|
25
|
-
"@automattic/jetpack-connection": "^0.
|
|
26
|
-
"@wordpress/api-fetch": "7.
|
|
27
|
-
"@wordpress/block-editor": "14.
|
|
28
|
-
"@wordpress/components": "29.
|
|
29
|
-
"@wordpress/compose": "7.
|
|
30
|
-
"@wordpress/data": "10.
|
|
31
|
-
"@wordpress/element": "6.
|
|
32
|
-
"@wordpress/i18n": "5.
|
|
33
|
-
"@wordpress/plugins": "7.
|
|
34
|
-
"@wordpress/url": "4.
|
|
22
|
+
"@automattic/jetpack-analytics": "^0.1.36",
|
|
23
|
+
"@automattic/jetpack-base-styles": "^0.6.44",
|
|
24
|
+
"@automattic/jetpack-components": "^0.68.0",
|
|
25
|
+
"@automattic/jetpack-connection": "^0.38.0",
|
|
26
|
+
"@wordpress/api-fetch": "7.19.0",
|
|
27
|
+
"@wordpress/block-editor": "14.14.0",
|
|
28
|
+
"@wordpress/components": "29.5.0",
|
|
29
|
+
"@wordpress/compose": "7.19.0",
|
|
30
|
+
"@wordpress/data": "10.19.0",
|
|
31
|
+
"@wordpress/element": "6.19.0",
|
|
32
|
+
"@wordpress/i18n": "5.19.0",
|
|
33
|
+
"@wordpress/plugins": "7.19.0",
|
|
34
|
+
"@wordpress/url": "4.19.0",
|
|
35
35
|
"clsx": "2.1.1",
|
|
36
36
|
"debug": "4.4.0",
|
|
37
37
|
"lodash": "4.17.21"
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"@testing-library/dom": "10.4.0",
|
|
46
46
|
"@testing-library/react": "16.2.0",
|
|
47
47
|
"@testing-library/user-event": "14.6.1",
|
|
48
|
-
"@wordpress/babel-plugin-import-jsx-pragma": "5.
|
|
48
|
+
"@wordpress/babel-plugin-import-jsx-pragma": "5.19.0",
|
|
49
49
|
"babel-jest": "29.3.1",
|
|
50
50
|
"jest": "29.7.0",
|
|
51
51
|
"jest-environment-jsdom": "29.7.0",
|
|
@@ -24,7 +24,7 @@ function redirect( url, callback, shouldOpenNewWindow = false ) {
|
|
|
24
24
|
* @param {Function} onRedirect - To handle the redirection.
|
|
25
25
|
* @return {object} - Object containing properties to handle autosave and redirect.
|
|
26
26
|
*/
|
|
27
|
-
export default function useAutosaveAndRedirect( redirectUrl, onRedirect = noop ) {
|
|
27
|
+
export default function useAutosaveAndRedirect( redirectUrl = null, onRedirect = noop ) {
|
|
28
28
|
const [ isRedirecting, setIsRedirecting ] = useState( false );
|
|
29
29
|
|
|
30
30
|
const { isAutosaveablePost, isDirtyPost, currentPost } = useSelect( select => {
|
|
@@ -95,7 +95,9 @@ export default function useAutosaveAndRedirect( redirectUrl, onRedirect = noop )
|
|
|
95
95
|
setIsRedirecting( true );
|
|
96
96
|
|
|
97
97
|
autosave( event ).then( () => {
|
|
98
|
-
|
|
98
|
+
if ( redirectUrl ) {
|
|
99
|
+
redirect( redirectUrl, onRedirect, isWidgetEditor );
|
|
100
|
+
}
|
|
99
101
|
} );
|
|
100
102
|
};
|
|
101
103
|
|