@automattic/jetpack-shared-extension-utils 1.3.2 → 1.3.4

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.4] - 2025-07-14
9
+ ### Removed
10
+ - Remove no-longer-needed dependency on `lodash`. [#44269]
11
+
12
+ ## [1.3.3] - 2025-07-10
13
+ ### Changed
14
+ - Internal updates.
15
+
8
16
  ## [1.3.2] - 2025-07-08
9
17
  ### Changed
10
18
  - Internal updates.
@@ -711,6 +719,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
711
719
  ### Changed
712
720
  - Core: prepare utility for release
713
721
 
722
+ [1.3.4]: https://github.com/Automattic/jetpack-shared-extension-utils/compare/1.3.3...1.3.4
723
+ [1.3.3]: https://github.com/Automattic/jetpack-shared-extension-utils/compare/1.3.2...1.3.3
714
724
  [1.3.2]: https://github.com/Automattic/jetpack-shared-extension-utils/compare/1.3.1...1.3.2
715
725
  [1.3.1]: https://github.com/Automattic/jetpack-shared-extension-utils/compare/1.3.0...1.3.1
716
726
  [1.3.0]: https://github.com/Automattic/jetpack-shared-extension-utils/compare/1.2.4...1.3.0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@automattic/jetpack-shared-extension-utils",
3
- "version": "1.3.2",
3
+ "version": "1.3.4",
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,9 +20,9 @@
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.3",
24
- "@automattic/jetpack-components": "^1.1.12",
25
- "@automattic/jetpack-connection": "^1.2.12",
23
+ "@automattic/jetpack-base-styles": "^1.0.4",
24
+ "@automattic/jetpack-components": "^1.1.13",
25
+ "@automattic/jetpack-connection": "^1.2.13",
26
26
  "@automattic/jetpack-script-data": "^0.5.0",
27
27
  "@wordpress/api-fetch": "7.26.0",
28
28
  "@wordpress/block-editor": "14.21.0",
@@ -37,8 +37,7 @@
37
37
  "@wordpress/primitives": "4.26.0",
38
38
  "@wordpress/url": "4.26.0",
39
39
  "clsx": "2.1.1",
40
- "debug": "4.4.1",
41
- "lodash": "4.17.21"
40
+ "debug": "4.4.1"
42
41
  },
43
42
  "devDependencies": {
44
43
  "@automattic/jetpack-webpack-config": "workspace:*",
package/src/plan-utils.js CHANGED
@@ -1,7 +1,6 @@
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 { compact, get, map, filter } from 'lodash';
5
4
  import getJetpackData from './get-jetpack-data';
6
5
  import getJetpackExtensionAvailability from './get-jetpack-extension-availability';
7
6
  import getSiteFragment from './get-site-fragment';
@@ -19,7 +18,7 @@ import getSiteFragment from './get-site-fragment';
19
18
  */
20
19
  export function getUpgradeUrl( { planSlug, plan, postId, postType } ) {
21
20
  // WP.com plan objects have a dedicated `path_slug` field, Jetpack plan objects don't.
22
- const planPathSlug = planSlug.startsWith( 'jetpack_' ) ? planSlug : get( plan, [ 'path_slug' ] );
21
+ const planPathSlug = planSlug.startsWith( 'jetpack_' ) ? planSlug : plan?.path_slug;
23
22
 
24
23
  // The full site editor has no set post type.
25
24
  const redirect_to = (
@@ -45,12 +44,9 @@ export function getUpgradeUrl( { planSlug, plan, postId, postType } ) {
45
44
  return isSimpleSite()
46
45
  ? addQueryArgs(
47
46
  '/' +
48
- compact( [
49
- postTypeEditorRoutePrefix,
50
- postType,
51
- getSiteFragment(),
52
- postId,
53
- ] ).join( '/' ),
47
+ [ postTypeEditorRoutePrefix, postType, getSiteFragment(), postId ]
48
+ .filter( Boolean )
49
+ .join( '/' ),
54
50
  {
55
51
  plan_upgraded: 1,
56
52
  }
@@ -161,7 +157,7 @@ const usableBlockWithFreePlan = [
161
157
  * @return {boolean} True if the Upgrade Nudge is enable. Otherwise, False.
162
158
  */
163
159
  export function isUpgradeNudgeEnabled() {
164
- return get( getJetpackData(), 'jetpack.enable_upgrade_nudge', false );
160
+ return getJetpackData()?.jetpack?.enable_upgrade_nudge ?? false;
165
161
  }
166
162
 
167
163
  /*
@@ -174,7 +170,7 @@ export function isUpgradeNudgeEnabled() {
174
170
  * @returns {boolean} True is the block is usable with a Free plan. Otherwise, False.
175
171
  */
176
172
  export const isStillUsableWithFreePlan = name =>
177
- map( usableBlockWithFreePlan, 'name' ).includes( name );
173
+ usableBlockWithFreePlan.some( v => v.name === name );
178
174
 
179
175
  export const getUsableBlockProps = blockName =>
180
- filter( usableBlockWithFreePlan, ( { name } ) => name === blockName )[ 0 ];
176
+ usableBlockWithFreePlan.filter( ( { name } ) => name === blockName )[ 0 ];