@automattic/jetpack-shared-extension-utils 0.9.1 → 0.9.2
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,7 +5,11 @@ 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.9.
|
|
8
|
+
## [0.9.2] - 2023-03-23
|
|
9
|
+
### Changed
|
|
10
|
+
- Updated package dependencies.
|
|
11
|
+
|
|
12
|
+
## [0.9.1] - 2023-03-08
|
|
9
13
|
### Changed
|
|
10
14
|
- Updated package dependencies. [#29216]
|
|
11
15
|
|
|
@@ -177,6 +181,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
177
181
|
### Changed
|
|
178
182
|
- Core: prepare utility for release
|
|
179
183
|
|
|
184
|
+
[0.9.2]: https://github.com/Automattic/jetpack-shared-extension-utils/compare/0.9.1...0.9.2
|
|
180
185
|
[0.9.1]: https://github.com/Automattic/jetpack-shared-extension-utils/compare/0.9.0...0.9.1
|
|
181
186
|
[0.9.0]: https://github.com/Automattic/jetpack-shared-extension-utils/compare/0.8.4...0.9.0
|
|
182
187
|
[0.8.4]: https://github.com/Automattic/jetpack-shared-extension-utils/compare/0.8.3...0.8.4
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@automattic/jetpack-shared-extension-utils",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.2",
|
|
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": {
|
package/src/plan-utils.js
CHANGED
|
@@ -22,45 +22,50 @@ export function getUpgradeUrl( { planSlug, plan, postId, postType } ) {
|
|
|
22
22
|
const planPathSlug = startsWith( planSlug, 'jetpack_' ) ? planSlug : get( plan, [ 'path_slug' ] );
|
|
23
23
|
|
|
24
24
|
// The full site editor has no set post type.
|
|
25
|
-
const redirect_to = (
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
25
|
+
const redirect_to = (
|
|
26
|
+
undefined === postType
|
|
27
|
+
? () => {
|
|
28
|
+
const queryParams = new URLSearchParams( window.location.search );
|
|
29
|
+
|
|
30
|
+
return addQueryArgs(
|
|
31
|
+
window.location.protocol +
|
|
32
|
+
`//${ getSiteFragment().replace( '::', '/' ) }/wp-admin/site-editor.php`,
|
|
33
|
+
{
|
|
34
|
+
postId: queryParams.get( 'postId' ),
|
|
35
|
+
postType: queryParams.get( 'postType' ),
|
|
36
|
+
plan_upgraded: 1,
|
|
37
|
+
}
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
: () => {
|
|
41
|
+
// The editor for CPTs has an `edit/` route fragment prefixed.
|
|
42
|
+
const postTypeEditorRoutePrefix = [ 'page', 'post' ].includes( postType ) ? '' : 'edit';
|
|
43
|
+
|
|
44
|
+
// Post-checkout: redirect back here.
|
|
45
|
+
return isSimpleSite()
|
|
46
|
+
? addQueryArgs(
|
|
47
|
+
'/' +
|
|
48
|
+
compact( [
|
|
49
|
+
postTypeEditorRoutePrefix,
|
|
50
|
+
postType,
|
|
51
|
+
getSiteFragment(),
|
|
52
|
+
postId,
|
|
53
|
+
] ).join( '/' ),
|
|
54
|
+
{
|
|
55
|
+
plan_upgraded: 1,
|
|
56
|
+
}
|
|
57
|
+
)
|
|
58
|
+
: addQueryArgs(
|
|
59
|
+
window.location.protocol +
|
|
60
|
+
`//${ getSiteFragment().replace( '::', '/' ) }/wp-admin/post.php`,
|
|
61
|
+
{
|
|
62
|
+
action: 'edit',
|
|
63
|
+
post: postId,
|
|
64
|
+
plan_upgraded: 1,
|
|
65
|
+
}
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
)();
|
|
64
69
|
|
|
65
70
|
// Redirect to calypso plans page for WoC sites.
|
|
66
71
|
if ( isAtomicSite() ) {
|
|
@@ -10,11 +10,12 @@ import './style.scss';
|
|
|
10
10
|
// We thus add a new `is-interactive` class to be able to override that behavior.
|
|
11
11
|
export default name =>
|
|
12
12
|
createHigherOrderComponent(
|
|
13
|
-
BlockListBlock => props =>
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
13
|
+
BlockListBlock => props =>
|
|
14
|
+
(
|
|
15
|
+
<BlockListBlock
|
|
16
|
+
{ ...props }
|
|
17
|
+
className={ props.name === name ? 'has-warning is-interactive' : props.className }
|
|
18
|
+
/>
|
|
19
|
+
),
|
|
19
20
|
'withHasWarningIsInteractiveClassNames'
|
|
20
21
|
);
|