@automattic/jetpack-shared-extension-utils 0.4.12 → 0.6.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,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.0] - 2022-08-03
9
+ ### Fixed
10
+ - Change Site Editor route to `site-editor.php` [#25281]
11
+
12
+ ## [0.5.0] - 2022-07-26
13
+ ### Added
14
+ - Add a new utility function for native use. The function returns the namespace of the host app e.g. Jetpack or WordPress. [#25155]
15
+
16
+ ### Changed
17
+ - Updated package dependencies. [#25158]
18
+
19
+ ## [0.4.13] - 2022-07-12
20
+ ### Changed
21
+ - Updated package dependencies.
22
+
8
23
  ## [0.4.12] - 2022-07-06
9
24
  ### Changed
10
25
  - Updated package dependencies. [#24923]
@@ -89,6 +104,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
89
104
  ### Changed
90
105
  - Core: prepare utility for release
91
106
 
107
+ [0.6.0]: https://github.com/Automattic/jetpack-shared-extension-utils/compare/0.5.0...0.6.0
108
+ [0.5.0]: https://github.com/Automattic/jetpack-shared-extension-utils/compare/0.4.13...0.5.0
109
+ [0.4.13]: https://github.com/Automattic/jetpack-shared-extension-utils/compare/0.4.12...0.4.13
92
110
  [0.4.12]: https://github.com/Automattic/jetpack-shared-extension-utils/compare/0.4.11...0.4.12
93
111
  [0.4.11]: https://github.com/Automattic/jetpack-shared-extension-utils/compare/0.4.10...0.4.11
94
112
  [0.4.10]: https://github.com/Automattic/jetpack-shared-extension-utils/compare/0.4.9...0.4.10
@@ -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.12",
3
+ "version": "0.6.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
+ }
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,