@automattic/jetpack-shared-extension-utils 0.9.0 → 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,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.9.2] - 2023-03-23
|
|
9
|
+
### Changed
|
|
10
|
+
- Updated package dependencies.
|
|
11
|
+
|
|
12
|
+
## [0.9.1] - 2023-03-08
|
|
13
|
+
### Changed
|
|
14
|
+
- Updated package dependencies. [#29216]
|
|
15
|
+
|
|
8
16
|
## [0.9.0] - 2023-02-20
|
|
9
17
|
### Added
|
|
10
18
|
- Add a new section to describe including assets from backend [#29016]
|
|
@@ -173,6 +181,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
173
181
|
### Changed
|
|
174
182
|
- Core: prepare utility for release
|
|
175
183
|
|
|
184
|
+
[0.9.2]: https://github.com/Automattic/jetpack-shared-extension-utils/compare/0.9.1...0.9.2
|
|
185
|
+
[0.9.1]: https://github.com/Automattic/jetpack-shared-extension-utils/compare/0.9.0...0.9.1
|
|
176
186
|
[0.9.0]: https://github.com/Automattic/jetpack-shared-extension-utils/compare/0.8.4...0.9.0
|
|
177
187
|
[0.8.4]: https://github.com/Automattic/jetpack-shared-extension-utils/compare/0.8.3...0.8.4
|
|
178
188
|
[0.8.3]: https://github.com/Automattic/jetpack-shared-extension-utils/compare/0.8.2...0.8.3
|
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": {
|
|
@@ -17,11 +17,11 @@
|
|
|
17
17
|
"dependencies": {
|
|
18
18
|
"@automattic/jetpack-analytics": "workspace:*",
|
|
19
19
|
"@automattic/jetpack-connection": "workspace:*",
|
|
20
|
-
"@wordpress/compose": "6.
|
|
21
|
-
"@wordpress/element": "5.
|
|
22
|
-
"@wordpress/i18n": "4.
|
|
23
|
-
"@wordpress/plugins": "5.
|
|
24
|
-
"@wordpress/url": "3.
|
|
20
|
+
"@wordpress/compose": "6.5.0",
|
|
21
|
+
"@wordpress/element": "5.5.0",
|
|
22
|
+
"@wordpress/i18n": "4.28.0",
|
|
23
|
+
"@wordpress/plugins": "5.5.0",
|
|
24
|
+
"@wordpress/url": "3.29.0",
|
|
25
25
|
"lodash": "4.17.21"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
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
|
);
|