@automattic/jetpack-shared-extension-utils 1.3.26 → 1.3.27
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,10 @@ 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.27] - 2025-11-20
|
|
9
|
+
### Fixed
|
|
10
|
+
- Jetpack: remove getIconColor functions from block icons [#45992]
|
|
11
|
+
|
|
8
12
|
## [1.3.26] - 2025-11-18
|
|
9
13
|
### Changed
|
|
10
14
|
- Update dependencies. [#44940]
|
|
@@ -807,6 +811,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
807
811
|
### Changed
|
|
808
812
|
- Core: prepare utility for release
|
|
809
813
|
|
|
814
|
+
[1.3.27]: https://github.com/Automattic/jetpack-shared-extension-utils/compare/1.3.26...1.3.27
|
|
810
815
|
[1.3.26]: https://github.com/Automattic/jetpack-shared-extension-utils/compare/1.3.25...1.3.26
|
|
811
816
|
[1.3.25]: https://github.com/Automattic/jetpack-shared-extension-utils/compare/1.3.24...1.3.25
|
|
812
817
|
[1.3.24]: https://github.com/Automattic/jetpack-shared-extension-utils/compare/1.3.23...1.3.24
|
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.27",
|
|
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": {
|
|
@@ -32,8 +32,8 @@
|
|
|
32
32
|
"@automattic/color-studio": "4.1.0",
|
|
33
33
|
"@automattic/jetpack-analytics": "^1.0.5",
|
|
34
34
|
"@automattic/jetpack-base-styles": "^1.0.11",
|
|
35
|
-
"@automattic/jetpack-components": "^1.3.
|
|
36
|
-
"@automattic/jetpack-connection": "^1.4.
|
|
35
|
+
"@automattic/jetpack-components": "^1.3.12",
|
|
36
|
+
"@automattic/jetpack-connection": "^1.4.19",
|
|
37
37
|
"@automattic/jetpack-script-data": "^0.5.4",
|
|
38
38
|
"@types/jest": "30.0.0",
|
|
39
39
|
"@wordpress/api-fetch": "7.35.0",
|
package/src/block-icons.js
CHANGED
|
@@ -1,25 +1,10 @@
|
|
|
1
|
-
import colorStudio from '@automattic/color-studio';
|
|
2
|
-
import { isWpcomPlatformSite } from '@automattic/jetpack-script-data';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Constants
|
|
6
|
-
*/
|
|
7
|
-
const PALETTE = colorStudio.colors;
|
|
8
|
-
const COLOR_JETPACK = PALETTE[ 'Jetpack Green 40' ];
|
|
9
|
-
|
|
10
1
|
/**
|
|
11
2
|
* Returns the icon color for Jetpack blocks.
|
|
12
3
|
*
|
|
13
4
|
* Green in the Jetpack context, otherwise black for Simple sites or Atomic sites.
|
|
14
5
|
*
|
|
15
|
-
* @return {
|
|
6
|
+
* @return {null} HEX color for block editor icons
|
|
16
7
|
*/
|
|
17
8
|
export function getIconColor() {
|
|
18
|
-
|
|
19
|
-
// Return null to match core block styling
|
|
20
|
-
return null;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
// Jetpack Green
|
|
24
|
-
return COLOR_JETPACK;
|
|
9
|
+
return null;
|
|
25
10
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { createElement } from '@wordpress/element';
|
|
2
|
-
import getIconColor from './get-icon-color';
|
|
3
2
|
|
|
4
3
|
/**
|
|
5
4
|
* Generate an icon as a React component from the SVG markup defined in a block.json metadata file.
|
|
@@ -50,6 +49,5 @@ export function getBlockIconComponent( metadata ) {
|
|
|
50
49
|
export function getBlockIconProp( metadata ) {
|
|
51
50
|
return {
|
|
52
51
|
src: getBlockIconComponent( metadata ),
|
|
53
|
-
foreground: getIconColor(),
|
|
54
52
|
};
|
|
55
53
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { SvgXml } from '@wordpress/primitives';
|
|
2
|
-
import getIconColor from './get-icon-color';
|
|
3
2
|
|
|
4
3
|
/**
|
|
5
4
|
* Generate an icon as a React component from the SVG markup defined in a block.json metadata file.
|
|
@@ -31,6 +30,5 @@ export function getBlockIconComponent( metadata ) {
|
|
|
31
30
|
export function getBlockIconProp( metadata ) {
|
|
32
31
|
return {
|
|
33
32
|
src: getBlockIconComponent( metadata ),
|
|
34
|
-
foreground: getIconColor(),
|
|
35
33
|
};
|
|
36
34
|
}
|
package/src/get-icon-color.js
CHANGED
|
@@ -1,23 +1,10 @@
|
|
|
1
|
-
import { isWpcomPlatformSite } from '@automattic/jetpack-script-data';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Constants
|
|
5
|
-
*/
|
|
6
|
-
const JETPACK_GREEN_40 = '#069e08';
|
|
7
|
-
|
|
8
1
|
/**
|
|
9
2
|
* Returns the icon color for Jetpack blocks.
|
|
10
3
|
*
|
|
11
4
|
* Green in the Jetpack context, otherwise black for Simple sites or Atomic sites.
|
|
12
5
|
*
|
|
13
|
-
* @return {
|
|
6
|
+
* @return {null} HEX color for block editor icons
|
|
14
7
|
*/
|
|
15
8
|
export default function getIconColor() {
|
|
16
|
-
|
|
17
|
-
// Return null to match core block styling
|
|
18
|
-
return null;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
// Jetpack Green
|
|
22
|
-
return JETPACK_GREEN_40;
|
|
9
|
+
return null;
|
|
23
10
|
}
|
package/src/icons.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import colorStudio from '@automattic/color-studio';
|
|
2
2
|
import { G, Path, Polygon, Rect, SVG, Circle } from '@wordpress/components';
|
|
3
3
|
import clsx from 'clsx';
|
|
4
|
-
import { getIconColor } from './block-icons';
|
|
5
4
|
|
|
6
5
|
import './icons.scss';
|
|
7
6
|
|
|
@@ -321,7 +320,6 @@ export const JetpackAppIcon = () => {
|
|
|
321
320
|
};
|
|
322
321
|
|
|
323
322
|
export const LoomIcon = {
|
|
324
|
-
foreground: getIconColor(),
|
|
325
323
|
src: (
|
|
326
324
|
<SVG viewBox="0 0 100 100">
|
|
327
325
|
<Path d="M100,44H72.4l23.9-13.8l-6-10.4L66.4,33.6L80.2,9.7l-10.4-6L56,27.59V0H44v27.6L30.2,3.7l-10.4,6l13.8,23.9 L9.7,19.8l-6,10.4L27.6,44H0V56h27.6L3.7,69.8l6,10.4l23.9-13.8L19.8,90.3l10.4,6L44,72.4V100H56V72.41l13.8,23.9l10.4-6L66.4,66.4 l23.9,13.8l6-10.4L72.4,56H100V44z M50,65.23c-8.41,0-15.23-6.82-15.23-15.23c0-8.41,6.82-15.23,15.23-15.23S65.23,41.59,65.23,50 C65.23,58.41,58.41,65.23,50,65.23z" />
|
|
@@ -330,7 +328,6 @@ export const LoomIcon = {
|
|
|
330
328
|
};
|
|
331
329
|
|
|
332
330
|
export const SmartFrameIcon = {
|
|
333
|
-
foreground: getIconColor(),
|
|
334
331
|
src: (
|
|
335
332
|
<SVG xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20.7 17" xmlSpace="preserve">
|
|
336
333
|
<Path d="m20.7 12.9-.9-11c0-.5-.2-.9-.5-1.3-.3-.3-.8-.5-1.3-.5L1.9 0h-.1c-.2 0-.5 0-.7.1C.9.2.7.4.5.5.4.7.2.9.1 1.1c-.1.2-.1.5-.1.7v.1l.9 13.4c0 .5.2.9.5 1.3.3.2.8.4 1.3.4H3l16.1-2c.4 0 .9-.3 1.1-.6.3-.3.5-.8.5-1.2v-.3zm-3.1.8L4.2 15.3H4c-.4 0-.8-.1-1-.4-.3-.3-.4-.6-.5-1L1.7 3.2v-.1c0-.4.2-.8.5-1 .3-.3.7-.4 1-.4h.1l13.5.1c.4 0 .8.1 1 .4.3.3.4.6.5 1L19 12v.3c0 .4-.2.7-.4 1-.3.2-.6.4-1 .4z" />
|
|
@@ -339,7 +336,6 @@ export const SmartFrameIcon = {
|
|
|
339
336
|
};
|
|
340
337
|
|
|
341
338
|
export const DescriptIcon = {
|
|
342
|
-
foreground: getIconColor(),
|
|
343
339
|
src: (
|
|
344
340
|
<SVG xmlns="http://www.w3.org/2000/svg" viewBox="0 0 43 43" xmlSpace="preserve">
|
|
345
341
|
<Path
|
|
@@ -352,7 +348,6 @@ export const DescriptIcon = {
|
|
|
352
348
|
};
|
|
353
349
|
|
|
354
350
|
export const DonationsIcon = {
|
|
355
|
-
foreground: getIconColor(),
|
|
356
351
|
src: (
|
|
357
352
|
<SVG viewBox="0 0 24 24">
|
|
358
353
|
<Rect x="0" fill="none" width="24" height="24" />
|
|
@@ -364,7 +359,6 @@ export const DonationsIcon = {
|
|
|
364
359
|
};
|
|
365
360
|
|
|
366
361
|
export const ConversationIcon = {
|
|
367
|
-
foreground: getIconColor(),
|
|
368
362
|
src: (
|
|
369
363
|
<SVG viewBox="0 0 24 24">
|
|
370
364
|
<Rect x="0" fill="none" width="24" height="24" />
|
|
@@ -376,7 +370,6 @@ export const ConversationIcon = {
|
|
|
376
370
|
};
|
|
377
371
|
|
|
378
372
|
export const DialogueIcon = {
|
|
379
|
-
foreground: getIconColor(),
|
|
380
373
|
src: (
|
|
381
374
|
<SVG viewBox="0 0 24 24">
|
|
382
375
|
<Rect x="0" fill="none" width="24" height="24" />
|
|
@@ -388,25 +381,19 @@ export const DialogueIcon = {
|
|
|
388
381
|
};
|
|
389
382
|
|
|
390
383
|
export const TranscriptIcon = {
|
|
391
|
-
foreground: getIconColor(),
|
|
392
384
|
src: (
|
|
393
385
|
<SVG viewBox="0 0 24 24">
|
|
394
386
|
<Rect x="0" fill="none" width="24" height="24" />
|
|
395
387
|
<G>
|
|
396
|
-
<Path
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
strokeWidth="1.5"
|
|
400
|
-
/>
|
|
401
|
-
<Path d="M4 10V6L8 8L4 10Z" fill={ getIconColor() } />
|
|
402
|
-
<Path d="M4 17V13L8 15L4 17Z" fill={ getIconColor() } />
|
|
388
|
+
<Path d="M11.1114 8H20.0002M11.1113 15H20.0002" strokeWidth="1.5" />
|
|
389
|
+
<Path d="M4 10V6L8 8L4 10Z" />
|
|
390
|
+
<Path d="M4 17V13L8 15L4 17Z" />
|
|
403
391
|
</G>
|
|
404
392
|
</SVG>
|
|
405
393
|
),
|
|
406
394
|
};
|
|
407
395
|
|
|
408
396
|
export const TranscriptSpeakerIcon = {
|
|
409
|
-
foreground: getIconColor(),
|
|
410
397
|
src: (
|
|
411
398
|
<SVG viewBox="0 0 24 24">
|
|
412
399
|
<Rect x="0" fill="none" width="24" height="24" />
|