@automattic/jetpack-shared-extension-utils 1.3.1 → 1.3.3
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
|
+
## [1.3.3] - 2025-07-10
|
|
9
|
+
### Changed
|
|
10
|
+
- Internal updates.
|
|
11
|
+
|
|
12
|
+
## [1.3.2] - 2025-07-08
|
|
13
|
+
### Changed
|
|
14
|
+
- Internal updates.
|
|
15
|
+
|
|
8
16
|
## [1.3.1] - 2025-07-08
|
|
9
17
|
### Changed
|
|
10
18
|
- Update package dependencies. [#44217]
|
|
@@ -707,6 +715,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
707
715
|
### Changed
|
|
708
716
|
- Core: prepare utility for release
|
|
709
717
|
|
|
718
|
+
[1.3.3]: https://github.com/Automattic/jetpack-shared-extension-utils/compare/1.3.2...1.3.3
|
|
719
|
+
[1.3.2]: https://github.com/Automattic/jetpack-shared-extension-utils/compare/1.3.1...1.3.2
|
|
710
720
|
[1.3.1]: https://github.com/Automattic/jetpack-shared-extension-utils/compare/1.3.0...1.3.1
|
|
711
721
|
[1.3.0]: https://github.com/Automattic/jetpack-shared-extension-utils/compare/1.2.4...1.3.0
|
|
712
722
|
[1.2.4]: https://github.com/Automattic/jetpack-shared-extension-utils/compare/1.2.3...1.2.4
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@automattic/jetpack-shared-extension-utils",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.3",
|
|
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": {
|
|
@@ -20,10 +20,10 @@
|
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"@automattic/color-studio": "4.1.0",
|
|
22
22
|
"@automattic/jetpack-analytics": "^1.0.3",
|
|
23
|
-
"@automattic/jetpack-base-styles": "^1.0.
|
|
24
|
-
"@automattic/jetpack-components": "^1.1.
|
|
25
|
-
"@automattic/jetpack-connection": "^1.2.
|
|
26
|
-
"@automattic/jetpack-script-data": "^0.
|
|
23
|
+
"@automattic/jetpack-base-styles": "^1.0.4",
|
|
24
|
+
"@automattic/jetpack-components": "^1.1.13",
|
|
25
|
+
"@automattic/jetpack-connection": "^1.2.13",
|
|
26
|
+
"@automattic/jetpack-script-data": "^0.5.0",
|
|
27
27
|
"@wordpress/api-fetch": "7.26.0",
|
|
28
28
|
"@wordpress/block-editor": "14.21.0",
|
|
29
29
|
"@wordpress/components": "29.12.0",
|
package/src/plan-utils.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { isWoASite, isSimpleSite } from '@automattic/jetpack-script-data';
|
|
2
2
|
import { __ } from '@wordpress/i18n';
|
|
3
3
|
import { addQueryArgs } from '@wordpress/url';
|
|
4
|
-
import {
|
|
4
|
+
import { get } from 'lodash';
|
|
5
5
|
import getJetpackData from './get-jetpack-data';
|
|
6
6
|
import getJetpackExtensionAvailability from './get-jetpack-extension-availability';
|
|
7
7
|
import getSiteFragment from './get-site-fragment';
|
|
@@ -19,7 +19,7 @@ import getSiteFragment from './get-site-fragment';
|
|
|
19
19
|
*/
|
|
20
20
|
export function getUpgradeUrl( { planSlug, plan, postId, postType } ) {
|
|
21
21
|
// WP.com plan objects have a dedicated `path_slug` field, Jetpack plan objects don't.
|
|
22
|
-
const planPathSlug = startsWith(
|
|
22
|
+
const planPathSlug = planSlug.startsWith( 'jetpack_' ) ? planSlug : get( plan, [ 'path_slug' ] );
|
|
23
23
|
|
|
24
24
|
// The full site editor has no set post type.
|
|
25
25
|
const redirect_to = (
|
|
@@ -45,12 +45,9 @@ export function getUpgradeUrl( { planSlug, plan, postId, postType } ) {
|
|
|
45
45
|
return isSimpleSite()
|
|
46
46
|
? addQueryArgs(
|
|
47
47
|
'/' +
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
getSiteFragment(),
|
|
52
|
-
postId,
|
|
53
|
-
] ).join( '/' ),
|
|
48
|
+
[ postTypeEditorRoutePrefix, postType, getSiteFragment(), postId ]
|
|
49
|
+
.filter( Boolean )
|
|
50
|
+
.join( '/' ),
|
|
54
51
|
{
|
|
55
52
|
plan_upgraded: 1,
|
|
56
53
|
}
|
|
@@ -174,7 +171,7 @@ export function isUpgradeNudgeEnabled() {
|
|
|
174
171
|
* @returns {boolean} True is the block is usable with a Free plan. Otherwise, False.
|
|
175
172
|
*/
|
|
176
173
|
export const isStillUsableWithFreePlan = name =>
|
|
177
|
-
|
|
174
|
+
usableBlockWithFreePlan.some( v => v.name === name );
|
|
178
175
|
|
|
179
176
|
export const getUsableBlockProps = blockName =>
|
|
180
|
-
|
|
177
|
+
usableBlockWithFreePlan.filter( ( { name } ) => name === blockName )[ 0 ];
|