@automattic/jetpack-shared-extension-utils 0.14.20 → 0.15.1

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,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.1] - 2024-07-30
9
+ ### Changed
10
+ - React: Changing global JSX namespace to React.JSX [#38585]
11
+
12
+ ## [0.15.0] - 2024-07-26
13
+ ### Added
14
+ - Shared Extension Utils: add isMyJetpackAvailable export [#38529]
15
+
8
16
  ## [0.14.20] - 2024-07-23
9
17
  ### Fixed
10
18
  - Updated package dependencies. [#38464]
@@ -412,6 +420,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
412
420
  ### Changed
413
421
  - Core: prepare utility for release
414
422
 
423
+ [0.15.1]: https://github.com/Automattic/jetpack-shared-extension-utils/compare/0.15.0...0.15.1
424
+ [0.15.0]: https://github.com/Automattic/jetpack-shared-extension-utils/compare/0.14.20...0.15.0
415
425
  [0.14.20]: https://github.com/Automattic/jetpack-shared-extension-utils/compare/0.14.19...0.14.20
416
426
  [0.14.19]: https://github.com/Automattic/jetpack-shared-extension-utils/compare/0.14.18...0.14.19
417
427
  [0.14.18]: https://github.com/Automattic/jetpack-shared-extension-utils/compare/0.14.17...0.14.18
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.14.20",
3
+ "version": "0.15.1",
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.0",
21
+ "@automattic/jetpack-components": "^0.55.3",
22
22
  "@automattic/jetpack-connection": "^0.34.1",
23
23
  "@wordpress/api-fetch": "7.2.0",
24
24
  "@wordpress/compose": "7.2.0",
@@ -10,7 +10,7 @@ import getIconColor from './get-icon-color';
10
10
  * dynamically set the icon color later on.
11
11
  *
12
12
  * @param {object} metadata - Block.json content
13
- * @returns {JSX.Element|string} Icon component
13
+ * @returns {React.JSX.Element|string} Icon component
14
14
  */
15
15
  export function getBlockIconComponent( metadata ) {
16
16
  // If the SVG has been passed as a string, use SvgXml to correctly parse it.
@@ -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
+ }