@automattic/jetpack-shared-extension-utils 1.5.2 → 1.5.3
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
|
@@ -5,6 +5,13 @@ 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.3] - 2026-03-09
|
|
9
|
+
### Changed
|
|
10
|
+
- Switch to Native TypeScript compiler based on Go. [#47375]
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
- Fix TS type errors detected by tsgo. [#47423]
|
|
14
|
+
|
|
8
15
|
## [1.5.2] - 2026-03-02
|
|
9
16
|
### Changed
|
|
10
17
|
- Convert `useAutosaveAndRedirect` and `getJetpackExtensionAvailability` to TypeScript. [#47382]
|
|
@@ -886,6 +893,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
886
893
|
### Changed
|
|
887
894
|
- Core: prepare utility for release
|
|
888
895
|
|
|
896
|
+
[1.5.3]: https://github.com/Automattic/jetpack-shared-extension-utils/compare/1.5.2...1.5.3
|
|
889
897
|
[1.5.2]: https://github.com/Automattic/jetpack-shared-extension-utils/compare/1.5.1...1.5.2
|
|
890
898
|
[1.5.1]: https://github.com/Automattic/jetpack-shared-extension-utils/compare/1.5.0...1.5.1
|
|
891
899
|
[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.3",
|
|
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,15 +26,15 @@
|
|
|
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
34
|
"@automattic/jetpack-base-styles": "^1.0.18",
|
|
35
|
-
"@automattic/jetpack-components": "^1.
|
|
36
|
-
"@automattic/jetpack-connection": "^1.4.
|
|
37
|
-
"@automattic/jetpack-script-data": "^0.6.
|
|
35
|
+
"@automattic/jetpack-components": "^1.5.0",
|
|
36
|
+
"@automattic/jetpack-connection": "^1.4.39",
|
|
37
|
+
"@automattic/jetpack-script-data": "^0.6.1",
|
|
38
38
|
"@types/jest": "30.0.0",
|
|
39
39
|
"@wordpress/api-fetch": "7.40.0",
|
|
40
40
|
"@wordpress/block-editor": "15.13.1",
|
|
@@ -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(
|