@wordpress/primitives 4.47.0 → 4.48.1
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 +8 -0
- package/package.json +5 -5
- package/src/block-quotation/README.md +1 -1
- package/src/horizontal-rule/README.md +1 -1
- package/src/block-quotation/index.native.js +0 -59
- package/src/block-quotation/style.native.scss +0 -25
- package/src/horizontal-rule/index.native.js +0 -59
- package/src/horizontal-rule/styles.native.scss +0 -26
- package/src/svg/index.native.js +0 -75
- package/src/svg/style.native.scss +0 -51
- package/src/view/index.native.js +0 -4
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
## 4.48.1 (2026-06-16)
|
|
6
|
+
|
|
7
|
+
## 4.48.0 (2026-06-10)
|
|
8
|
+
|
|
9
|
+
### Code Quality
|
|
10
|
+
|
|
11
|
+
- Add missing `@types/react` dependency. [#78882](https://github.com/WordPress/gutenberg/pull/78882).
|
|
12
|
+
|
|
5
13
|
## 4.47.0 (2026-05-27)
|
|
6
14
|
|
|
7
15
|
## 4.46.0 (2026-05-14)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/primitives",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.48.1",
|
|
4
4
|
"description": "WordPress cross-platform primitives.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -40,21 +40,21 @@
|
|
|
40
40
|
},
|
|
41
41
|
"./package.json": "./package.json"
|
|
42
42
|
},
|
|
43
|
-
"react-native": "src/index",
|
|
44
43
|
"wpScript": true,
|
|
45
44
|
"types": "build-types",
|
|
46
45
|
"sideEffects": [
|
|
47
46
|
"src/**/*.scss"
|
|
48
47
|
],
|
|
49
48
|
"dependencies": {
|
|
50
|
-
"@
|
|
49
|
+
"@types/react": "^18.3.27",
|
|
50
|
+
"@wordpress/element": "^8.0.1",
|
|
51
51
|
"clsx": "^2.1.1"
|
|
52
52
|
},
|
|
53
53
|
"peerDependencies": {
|
|
54
|
-
"react": "^
|
|
54
|
+
"react": "^18.0.0"
|
|
55
55
|
},
|
|
56
56
|
"publishConfig": {
|
|
57
57
|
"access": "public"
|
|
58
58
|
},
|
|
59
|
-
"gitHead": "
|
|
59
|
+
"gitHead": "99df7432c5c7cb83ba41146fd1f57f3c19004305"
|
|
60
60
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Block Quotation
|
|
2
2
|
|
|
3
|
-
A drop-in replacement for the HTML [blockquote](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/blockquote) element
|
|
3
|
+
A drop-in replacement for the HTML [blockquote](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/blockquote) element. It indicates that the enclosed text is an extended quotation.
|
|
4
4
|
|
|
5
5
|
## Usage
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# HorizontalRule
|
|
2
2
|
|
|
3
|
-
A drop-in replacement for the HTML [hr](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/hr) element
|
|
3
|
+
A drop-in replacement for the HTML [hr](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/hr) element. It represents a thematic break between paragraph-level elements: for example, a change of scene in a story, or a shift of topic within a section.
|
|
4
4
|
|
|
5
5
|
## Usage
|
|
6
6
|
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* External dependencies
|
|
3
|
-
*/
|
|
4
|
-
import { View } from 'react-native';
|
|
5
|
-
/**
|
|
6
|
-
* WordPress dependencies
|
|
7
|
-
*/
|
|
8
|
-
import { Children, cloneElement, forwardRef } from '@wordpress/element';
|
|
9
|
-
import { usePreferredColorSchemeStyle } from '@wordpress/compose';
|
|
10
|
-
/**
|
|
11
|
-
* Internal dependencies
|
|
12
|
-
*/
|
|
13
|
-
import styles from './style.scss';
|
|
14
|
-
|
|
15
|
-
export const BlockQuotation = forwardRef( ( { ...props }, ref ) => {
|
|
16
|
-
const { style } = props;
|
|
17
|
-
|
|
18
|
-
const blockQuoteStyle = [
|
|
19
|
-
usePreferredColorSchemeStyle(
|
|
20
|
-
styles.wpBlockQuoteLight,
|
|
21
|
-
styles.wpBlockQuoteDark
|
|
22
|
-
),
|
|
23
|
-
style?.baseColors?.color?.text && {
|
|
24
|
-
borderLeftColor: style.baseColors.color.text,
|
|
25
|
-
},
|
|
26
|
-
style?.color && {
|
|
27
|
-
borderLeftColor: style.color,
|
|
28
|
-
},
|
|
29
|
-
style,
|
|
30
|
-
style?.backgroundColor && styles.paddingWithBackground,
|
|
31
|
-
];
|
|
32
|
-
const colorStyle = style?.color ? { color: style.color } : {};
|
|
33
|
-
|
|
34
|
-
const newChildren = Children.map( props.children, ( child ) => {
|
|
35
|
-
const { identifier, attributeKey } = child?.props || {};
|
|
36
|
-
const identifierKey = identifier ?? attributeKey;
|
|
37
|
-
|
|
38
|
-
if ( identifierKey === 'citation' ) {
|
|
39
|
-
return cloneElement( child, {
|
|
40
|
-
style: {
|
|
41
|
-
...styles.wpBlockQuoteCitation,
|
|
42
|
-
...colorStyle,
|
|
43
|
-
},
|
|
44
|
-
} );
|
|
45
|
-
}
|
|
46
|
-
if ( child && child.props.identifier === 'value' ) {
|
|
47
|
-
return cloneElement( child, {
|
|
48
|
-
tagsToEliminate: [ 'div' ],
|
|
49
|
-
style: colorStyle,
|
|
50
|
-
} );
|
|
51
|
-
}
|
|
52
|
-
return child;
|
|
53
|
-
} );
|
|
54
|
-
return (
|
|
55
|
-
<View ref={ ref } style={ blockQuoteStyle }>
|
|
56
|
-
{ newChildren }
|
|
57
|
-
</View>
|
|
58
|
-
);
|
|
59
|
-
} );
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
%wpBlockQuote-shared {
|
|
2
|
-
border-left-width: 4px;
|
|
3
|
-
border-left-style: solid;
|
|
4
|
-
padding-left: $block-edge-to-content;
|
|
5
|
-
margin-left: 0;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
.wpBlockQuoteLight {
|
|
9
|
-
@extend %wpBlockQuote-shared;
|
|
10
|
-
border-left-color: $black;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
.wpBlockQuoteDark {
|
|
14
|
-
@extend %wpBlockQuote-shared;
|
|
15
|
-
border-left-color: $white;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
.wpBlockQuoteCitation {
|
|
19
|
-
margin-top: 16px;
|
|
20
|
-
font-size: 14px;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
.paddingWithBackground {
|
|
24
|
-
padding-top: $block-edge-to-content - $block-selected-margin;
|
|
25
|
-
}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* External dependencies
|
|
3
|
-
*/
|
|
4
|
-
import { Text, View } from 'react-native';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* WordPress dependencies
|
|
8
|
-
*/
|
|
9
|
-
import { withPreferredColorScheme } from '@wordpress/compose';
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Internal dependencies
|
|
13
|
-
*/
|
|
14
|
-
import styles from './styles.scss';
|
|
15
|
-
|
|
16
|
-
const HR = ( {
|
|
17
|
-
getStylesFromColorScheme,
|
|
18
|
-
lineStyle,
|
|
19
|
-
marginLeft,
|
|
20
|
-
marginRight,
|
|
21
|
-
style,
|
|
22
|
-
textStyle,
|
|
23
|
-
text,
|
|
24
|
-
...props
|
|
25
|
-
} ) => {
|
|
26
|
-
const renderLine = ( key ) => (
|
|
27
|
-
<View
|
|
28
|
-
key={ key }
|
|
29
|
-
style={ [
|
|
30
|
-
getStylesFromColorScheme( styles.line, styles.lineDark ),
|
|
31
|
-
lineStyle,
|
|
32
|
-
] }
|
|
33
|
-
/>
|
|
34
|
-
);
|
|
35
|
-
|
|
36
|
-
const renderText = ( key ) => (
|
|
37
|
-
<View key={ key } style={ styles.textContainer }>
|
|
38
|
-
<Text style={ [ styles.text, textStyle ] }>{ text }</Text>
|
|
39
|
-
</View>
|
|
40
|
-
);
|
|
41
|
-
|
|
42
|
-
const renderInner = () => {
|
|
43
|
-
if ( ! text ) {
|
|
44
|
-
return renderLine();
|
|
45
|
-
}
|
|
46
|
-
return [ renderLine( 1 ), renderText( 2 ), renderLine( 3 ) ];
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
return (
|
|
50
|
-
<View
|
|
51
|
-
style={ [ styles.container, { marginLeft, marginRight }, style ] }
|
|
52
|
-
{ ...props }
|
|
53
|
-
>
|
|
54
|
-
{ renderInner() }
|
|
55
|
-
</View>
|
|
56
|
-
);
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
export const HorizontalRule = withPreferredColorScheme( HR );
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
.container {
|
|
2
|
-
align-items: center;
|
|
3
|
-
flex-direction: row;
|
|
4
|
-
margin-left: 0;
|
|
5
|
-
margin-right: 0;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
.line {
|
|
9
|
-
background-color: $gray-lighten-20;
|
|
10
|
-
flex: 1 0 10px;
|
|
11
|
-
height: 2;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
.lineDark {
|
|
15
|
-
background-color: $gray-50;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
.textContainer {
|
|
19
|
-
flex: 0 1 auto;
|
|
20
|
-
margin-left: 15px;
|
|
21
|
-
margin-right: 15px;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
.text {
|
|
25
|
-
text-align: center;
|
|
26
|
-
}
|
package/src/svg/index.native.js
DELETED
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* External dependencies
|
|
3
|
-
*/
|
|
4
|
-
import { Svg } from 'react-native-svg';
|
|
5
|
-
import { Animated } from 'react-native';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* WordPress dependencies
|
|
9
|
-
*/
|
|
10
|
-
import { forwardRef } from '@wordpress/element';
|
|
11
|
-
import { usePreferredColorScheme } from '@wordpress/compose';
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Internal dependencies
|
|
15
|
-
*/
|
|
16
|
-
import styles from './style.scss';
|
|
17
|
-
|
|
18
|
-
export {
|
|
19
|
-
Circle,
|
|
20
|
-
G,
|
|
21
|
-
Path,
|
|
22
|
-
Polygon,
|
|
23
|
-
Rect,
|
|
24
|
-
Defs,
|
|
25
|
-
RadialGradient,
|
|
26
|
-
LinearGradient,
|
|
27
|
-
Stop,
|
|
28
|
-
Line,
|
|
29
|
-
SvgXml,
|
|
30
|
-
} from 'react-native-svg';
|
|
31
|
-
|
|
32
|
-
const AnimatedSvg = Animated.createAnimatedComponent(
|
|
33
|
-
forwardRef( ( props, ref ) => <Svg ref={ ref } { ...props } /> )
|
|
34
|
-
);
|
|
35
|
-
|
|
36
|
-
export const SVG = ( {
|
|
37
|
-
className = '',
|
|
38
|
-
isPressed,
|
|
39
|
-
animated = false,
|
|
40
|
-
...props
|
|
41
|
-
} ) => {
|
|
42
|
-
const colorScheme = usePreferredColorScheme();
|
|
43
|
-
const stylesFromClasses = className
|
|
44
|
-
.split( ' ' )
|
|
45
|
-
.map( ( element ) => styles[ element ] )
|
|
46
|
-
.filter( Boolean );
|
|
47
|
-
const defaultStyle = isPressed
|
|
48
|
-
? styles[ `is-pressed--${ colorScheme }` ]
|
|
49
|
-
: styles[ 'components-toolbar__control-' + colorScheme ];
|
|
50
|
-
const propStyle = Array.isArray( props.style )
|
|
51
|
-
? props.style.reduce( ( acc, el ) => {
|
|
52
|
-
return { ...acc, ...el };
|
|
53
|
-
}, {} )
|
|
54
|
-
: props.style;
|
|
55
|
-
const styleValues = Object.assign(
|
|
56
|
-
{},
|
|
57
|
-
defaultStyle,
|
|
58
|
-
propStyle,
|
|
59
|
-
...stylesFromClasses
|
|
60
|
-
);
|
|
61
|
-
|
|
62
|
-
const appliedProps = { ...props, style: styleValues };
|
|
63
|
-
|
|
64
|
-
const SvgWrapper = animated ? AnimatedSvg : Svg;
|
|
65
|
-
|
|
66
|
-
return (
|
|
67
|
-
<SvgWrapper
|
|
68
|
-
// We want to re-render when style color is changed.
|
|
69
|
-
key={ appliedProps.style.color }
|
|
70
|
-
height="100%"
|
|
71
|
-
width="100%"
|
|
72
|
-
{ ...appliedProps }
|
|
73
|
-
/>
|
|
74
|
-
);
|
|
75
|
-
};
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
.dashicon-light,
|
|
2
|
-
.components-toolbar__control-light {
|
|
3
|
-
color: $light-primary;
|
|
4
|
-
fill: currentColor;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
.dashicon-dark,
|
|
8
|
-
.components-toolbar__control-dark {
|
|
9
|
-
color: $dark-primary;
|
|
10
|
-
fill: currentColor;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
.dashicon-active {
|
|
14
|
-
color: #fff;
|
|
15
|
-
fill: currentColor;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
.is-pressed--light {
|
|
19
|
-
color: $light-primary;
|
|
20
|
-
fill: currentColor;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
.is-pressed--dark {
|
|
24
|
-
color: $dark-primary;
|
|
25
|
-
fill: currentColor;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
.dashicons-insert {
|
|
29
|
-
color: #87a6bc;
|
|
30
|
-
fill: currentColor;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
.unsupported-icon-light {
|
|
34
|
-
color: $gray-dark;
|
|
35
|
-
fill: currentColor;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
.unsupported-icon-dark {
|
|
39
|
-
color: $white;
|
|
40
|
-
fill: currentColor;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
.warning-icon-light {
|
|
44
|
-
color: $gray-dark;
|
|
45
|
-
fill: currentColor;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
.warning-icon-dark {
|
|
49
|
-
color: $white;
|
|
50
|
-
fill: currentColor;
|
|
51
|
-
}
|
package/src/view/index.native.js
DELETED