@automattic/jetpack-shared-extension-utils 0.4.13 → 0.6.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,21 @@ 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.6.1] - 2022-08-23
9
+ ### Changed
10
+ - Updated package dependencies. [#25338, #25339, #25762]
11
+
12
+ ## [0.6.0] - 2022-08-03
13
+ ### Fixed
14
+ - Change Site Editor route to `site-editor.php` [#25281]
15
+
16
+ ## [0.5.0] - 2022-07-26
17
+ ### Added
18
+ - Add a new utility function for native use. The function returns the namespace of the host app e.g. Jetpack or WordPress. [#25155]
19
+
20
+ ### Changed
21
+ - Updated package dependencies. [#25158]
22
+
8
23
  ## [0.4.13] - 2022-07-12
9
24
  ### Changed
10
25
  - Updated package dependencies.
@@ -93,6 +108,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
93
108
  ### Changed
94
109
  - Core: prepare utility for release
95
110
 
111
+ [0.6.1]: https://github.com/Automattic/jetpack-shared-extension-utils/compare/0.6.0...0.6.1
112
+ [0.6.0]: https://github.com/Automattic/jetpack-shared-extension-utils/compare/0.5.0...0.6.0
113
+ [0.5.0]: https://github.com/Automattic/jetpack-shared-extension-utils/compare/0.4.13...0.5.0
96
114
  [0.4.13]: https://github.com/Automattic/jetpack-shared-extension-utils/compare/0.4.12...0.4.13
97
115
  [0.4.12]: https://github.com/Automattic/jetpack-shared-extension-utils/compare/0.4.11...0.4.12
98
116
  [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.6.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": {
@@ -15,14 +15,14 @@
15
15
  "author": "Automattic",
16
16
  "scripts": {},
17
17
  "dependencies": {
18
- "@wordpress/compose": "5.10.0",
19
- "@wordpress/i18n": "4.12.0",
20
- "@wordpress/plugins": "4.10.0",
21
- "@wordpress/url": "3.13.0",
18
+ "@wordpress/compose": "5.13.0",
19
+ "@wordpress/i18n": "4.15.0",
20
+ "@wordpress/plugins": "4.13.0",
21
+ "@wordpress/url": "3.16.0",
22
22
  "lodash": "4.17.21"
23
23
  },
24
24
  "devDependencies": {
25
- "@babel/core": "7.18.6",
25
+ "@babel/core": "7.18.13",
26
26
  "@babel/preset-react": "7.18.6",
27
27
  "react": "17.0.2"
28
28
  },
@@ -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
+ }
package/src/plan-utils.js CHANGED
@@ -28,9 +28,8 @@ export function getUpgradeUrl( { planSlug, plan, postId, postType } ) {
28
28
 
29
29
  return addQueryArgs(
30
30
  window.location.protocol +
31
- `//${ getSiteFragment().replace( '::', '/' ) }/wp-admin/admin.php`,
31
+ `//${ getSiteFragment().replace( '::', '/' ) }/wp-admin/site-editor.php`,
32
32
  {
33
- page: 'gutenberg-edit-site',
34
33
  postId: queryParams.get( 'postId' ),
35
34
  postType: queryParams.get( 'postType' ),
36
35
  plan_upgraded: 1,