@automattic/jetpack-shared-extension-utils 1.5.2 → 1.5.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 +13 -0
- package/package.json +20 -20
- package/src/get-jetpack-data.js +3 -1
- package/src/hooks/use-module-status/index.js +9 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,17 @@ 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
|
+
## [1.5.4] - 2026-03-16
|
|
9
|
+
### Changed
|
|
10
|
+
- Update dependencies. [#47472]
|
|
11
|
+
|
|
12
|
+
## [1.5.3] - 2026-03-09
|
|
13
|
+
### Changed
|
|
14
|
+
- Switch to Native TypeScript compiler based on Go. [#47375]
|
|
15
|
+
|
|
16
|
+
### Fixed
|
|
17
|
+
- Fix TS type errors detected by tsgo. [#47423]
|
|
18
|
+
|
|
8
19
|
## [1.5.2] - 2026-03-02
|
|
9
20
|
### Changed
|
|
10
21
|
- Convert `useAutosaveAndRedirect` and `getJetpackExtensionAvailability` to TypeScript. [#47382]
|
|
@@ -886,6 +897,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
886
897
|
### Changed
|
|
887
898
|
- Core: prepare utility for release
|
|
888
899
|
|
|
900
|
+
[1.5.4]: https://github.com/Automattic/jetpack-shared-extension-utils/compare/1.5.3...1.5.4
|
|
901
|
+
[1.5.3]: https://github.com/Automattic/jetpack-shared-extension-utils/compare/1.5.2...1.5.3
|
|
889
902
|
[1.5.2]: https://github.com/Automattic/jetpack-shared-extension-utils/compare/1.5.1...1.5.2
|
|
890
903
|
[1.5.1]: https://github.com/Automattic/jetpack-shared-extension-utils/compare/1.5.0...1.5.1
|
|
891
904
|
[1.5.0]: https://github.com/Automattic/jetpack-shared-extension-utils/compare/1.4.13...1.5.0
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@automattic/jetpack-shared-extension-utils",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.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": {
|
|
@@ -26,28 +26,28 @@
|
|
|
26
26
|
"scripts": {
|
|
27
27
|
"test": "jest",
|
|
28
28
|
"test-coverage": "pnpm run test --coverage",
|
|
29
|
-
"typecheck": "
|
|
29
|
+
"typecheck": "tsgo --noEmit"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@automattic/color-studio": "4.1.0",
|
|
33
33
|
"@automattic/jetpack-analytics": "^1.0.8",
|
|
34
|
-
"@automattic/jetpack-base-styles": "^1.0.
|
|
35
|
-
"@automattic/jetpack-components": "^1.
|
|
36
|
-
"@automattic/jetpack-connection": "^1.4.
|
|
37
|
-
"@automattic/jetpack-script-data": "^0.6.
|
|
34
|
+
"@automattic/jetpack-base-styles": "^1.0.19",
|
|
35
|
+
"@automattic/jetpack-components": "^1.6.0",
|
|
36
|
+
"@automattic/jetpack-connection": "^1.4.40",
|
|
37
|
+
"@automattic/jetpack-script-data": "^0.6.1",
|
|
38
38
|
"@types/jest": "30.0.0",
|
|
39
|
-
"@wordpress/api-fetch": "7.
|
|
40
|
-
"@wordpress/block-editor": "15.
|
|
41
|
-
"@wordpress/components": "32.
|
|
42
|
-
"@wordpress/compose": "7.
|
|
43
|
-
"@wordpress/data": "10.
|
|
44
|
-
"@wordpress/dom-ready": "4.
|
|
45
|
-
"@wordpress/element": "6.
|
|
46
|
-
"@wordpress/hooks": "4.
|
|
47
|
-
"@wordpress/i18n": "6.
|
|
48
|
-
"@wordpress/plugins": "7.
|
|
49
|
-
"@wordpress/primitives": "4.
|
|
50
|
-
"@wordpress/url": "4.
|
|
39
|
+
"@wordpress/api-fetch": "7.41.0",
|
|
40
|
+
"@wordpress/block-editor": "15.14.0",
|
|
41
|
+
"@wordpress/components": "32.3.0",
|
|
42
|
+
"@wordpress/compose": "7.41.0",
|
|
43
|
+
"@wordpress/data": "10.41.0",
|
|
44
|
+
"@wordpress/dom-ready": "4.41.0",
|
|
45
|
+
"@wordpress/element": "6.41.0",
|
|
46
|
+
"@wordpress/hooks": "4.41.0",
|
|
47
|
+
"@wordpress/i18n": "6.14.0",
|
|
48
|
+
"@wordpress/plugins": "7.41.0",
|
|
49
|
+
"@wordpress/primitives": "4.41.0",
|
|
50
|
+
"@wordpress/url": "4.41.0",
|
|
51
51
|
"clsx": "2.1.1",
|
|
52
52
|
"debug": "4.4.3"
|
|
53
53
|
},
|
|
@@ -60,11 +60,11 @@
|
|
|
60
60
|
"@testing-library/dom": "10.4.1",
|
|
61
61
|
"@testing-library/react": "16.3.0",
|
|
62
62
|
"@testing-library/user-event": "14.6.1",
|
|
63
|
+
"@typescript/native-preview": "7.0.0-dev.20260225.1",
|
|
63
64
|
"babel-jest": "30.2.0",
|
|
64
65
|
"jest": "30.2.0",
|
|
65
66
|
"jetpack-js-tools": "workspace:*",
|
|
66
67
|
"react": "18.3.1",
|
|
67
|
-
"react-dom": "18.3.1"
|
|
68
|
-
"typescript": "5.9.3"
|
|
68
|
+
"react-dom": "18.3.1"
|
|
69
69
|
}
|
|
70
70
|
}
|
package/src/get-jetpack-data.js
CHANGED
|
@@ -3,7 +3,9 @@ export const JETPACK_DATA_PATH = 'Jetpack_Editor_Initial_State';
|
|
|
3
3
|
/**
|
|
4
4
|
* Retrieves Jetpack editor state
|
|
5
5
|
*
|
|
6
|
-
* @
|
|
6
|
+
* @deprecated Use the consolidated initial state using `getScriptData` from `@automattic/jetpack-script-data` instead. Feel free to extend it if needed.
|
|
7
|
+
*
|
|
8
|
+
* @return {object|null} The Jetpack Editor State.
|
|
7
9
|
*/
|
|
8
10
|
export default function getJetpackData() {
|
|
9
11
|
return 'object' === typeof window ? window?.[ JETPACK_DATA_PATH ] ?? null : null;
|
|
@@ -2,11 +2,19 @@ import { useDispatch, useSelect } from '@wordpress/data';
|
|
|
2
2
|
import { useMemo, useCallback } from '@wordpress/element';
|
|
3
3
|
import { JETPACK_MODULES_STORE_ID } from '../../modules-state';
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
* @typedef {object} ModuleStatus
|
|
7
|
+
* @property {boolean} isModuleActive - Whether the module is active.
|
|
8
|
+
* @property {boolean} isChangingStatus - Whether the module's status is currently being changed.
|
|
9
|
+
* @property {boolean} isLoadingModules - Whether the modules are currently being loaded.
|
|
10
|
+
* @property {Function} changeStatus - Function to change the module's status.
|
|
11
|
+
*/
|
|
12
|
+
|
|
5
13
|
/**
|
|
6
14
|
* Manage a Jetpack module's status (get and set).
|
|
7
15
|
*
|
|
8
16
|
* @param {string} name - The module's name.
|
|
9
|
-
* @return {
|
|
17
|
+
* @return {ModuleStatus} Module status/control object.
|
|
10
18
|
*/
|
|
11
19
|
const useModuleStatus = name => {
|
|
12
20
|
const { isModuleActive, isChangingStatus, isLoadingModules } = useSelect(
|