@automattic/jetpack-shared-extension-utils 0.14.19 → 0.15.0
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 +10 -0
- package/index.js +1 -0
- package/package.json +2 -2
- package/src/is-my-jetpack-available.js +13 -0
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.15.0] - 2024-07-26
|
|
9
|
+
### Added
|
|
10
|
+
- Shared Extension Utils: add isMyJetpackAvailable export [#38529]
|
|
11
|
+
|
|
12
|
+
## [0.14.20] - 2024-07-23
|
|
13
|
+
### Fixed
|
|
14
|
+
- Updated package dependencies. [#38464]
|
|
15
|
+
|
|
8
16
|
## [0.14.19] - 2024-07-22
|
|
9
17
|
### Changed
|
|
10
18
|
- Update dependencies. [#37356]
|
|
@@ -408,6 +416,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
408
416
|
### Changed
|
|
409
417
|
- Core: prepare utility for release
|
|
410
418
|
|
|
419
|
+
[0.15.0]: https://github.com/Automattic/jetpack-shared-extension-utils/compare/0.14.20...0.15.0
|
|
420
|
+
[0.14.20]: https://github.com/Automattic/jetpack-shared-extension-utils/compare/0.14.19...0.14.20
|
|
411
421
|
[0.14.19]: https://github.com/Automattic/jetpack-shared-extension-utils/compare/0.14.18...0.14.19
|
|
412
422
|
[0.14.18]: https://github.com/Automattic/jetpack-shared-extension-utils/compare/0.14.17...0.14.18
|
|
413
423
|
[0.14.17]: https://github.com/Automattic/jetpack-shared-extension-utils/compare/0.14.16...0.14.17
|
package/index.js
CHANGED
|
@@ -20,3 +20,4 @@ export { default as JetpackEditorPanelLogo } from './src/components/jetpack-edit
|
|
|
20
20
|
export { getBlockIconComponent, getBlockIconProp } from './src/get-block-icon-from-metadata';
|
|
21
21
|
export { default as getJetpackBlocksVariation } from './src/get-jetpack-blocks-variation';
|
|
22
22
|
export * from './src/modules-state';
|
|
23
|
+
export { default as isMyJetpackAvailable } from './src/is-my-jetpack-available';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@automattic/jetpack-shared-extension-utils",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.15.0",
|
|
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": {
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"@automattic/jetpack-analytics": "^0.1.29",
|
|
21
|
-
"@automattic/jetpack-components": "^0.55.
|
|
21
|
+
"@automattic/jetpack-components": "^0.55.2",
|
|
22
22
|
"@automattic/jetpack-connection": "^0.34.1",
|
|
23
23
|
"@wordpress/api-fetch": "7.2.0",
|
|
24
24
|
"@wordpress/compose": "7.2.0",
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import getJetpackData from './get-jetpack-data';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Return whether My Jetpack is available or not while in editor context.
|
|
5
|
+
*
|
|
6
|
+
* @see https://github.com/Automattic/jetpack/pull/38500 introduced the is_my_jetpack_available flag
|
|
7
|
+
* The value is the same that can be found on Initial_State.siteData.showMyJetpack (dashboard context)
|
|
8
|
+
*
|
|
9
|
+
* @returns {boolean} Object indicating if My Jetpack is available (so to navigate to interstitials and product pages)
|
|
10
|
+
*/
|
|
11
|
+
export default function isMyJetpackAvailable() {
|
|
12
|
+
return getJetpackData()?.jetpack?.is_my_jetpack_available === true;
|
|
13
|
+
}
|