@automattic/jetpack-shared-extension-utils 0.4.13 → 0.5.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 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
+ ## [0.5.0] - 2022-07-26
9
+ ### Added
10
+ - Add a new utility function for native use. The function returns the namespace of the host app e.g. Jetpack or WordPress. [#25155]
11
+
12
+ ### Changed
13
+ - Updated package dependencies. [#25158]
14
+
8
15
  ## [0.4.13] - 2022-07-12
9
16
  ### Changed
10
17
  - Updated package dependencies.
@@ -93,6 +100,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
93
100
  ### Changed
94
101
  - Core: prepare utility for release
95
102
 
103
+ [0.5.0]: https://github.com/Automattic/jetpack-shared-extension-utils/compare/0.4.13...0.5.0
96
104
  [0.4.13]: https://github.com/Automattic/jetpack-shared-extension-utils/compare/0.4.12...0.4.13
97
105
  [0.4.12]: https://github.com/Automattic/jetpack-shared-extension-utils/compare/0.4.11...0.4.12
98
106
  [0.4.11]: https://github.com/Automattic/jetpack-shared-extension-utils/compare/0.4.10...0.4.11
@@ -0,0 +1,3 @@
1
+ export * from './index.js';
2
+
3
+ export { default as getHostAppNamespace } from './src/get-host-app-namespace';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@automattic/jetpack-shared-extension-utils",
3
- "version": "0.4.13",
3
+ "version": "0.5.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": {
@@ -0,0 +1,14 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { store as blockEditorStore } from '@wordpress/block-editor';
5
+ import { select } from '@wordpress/data';
6
+
7
+ /**
8
+ * Retrieves host app's namespace e.g. "WordPress" or "Jetpack".
9
+ *
10
+ * @returns {string} hostAppNamespace The host app's namespace.
11
+ */
12
+ export default function getHostAppNamespace() {
13
+ return select( blockEditorStore ).getSettings().hostAppNamespace;
14
+ }