@wordpress/primitives 3.38.1 → 3.39.1-next.5a1d1283.0
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 +2 -0
- package/build/horizontal-rule/index.native.js +5 -3
- package/build/horizontal-rule/index.native.js.map +1 -1
- package/build-module/horizontal-rule/index.native.js +5 -3
- package/build-module/horizontal-rule/index.native.js.map +1 -1
- package/package.json +3 -3
- package/src/horizontal-rule/index.native.js +7 -7
- package/src/horizontal-rule/styles.native.scss +6 -3
package/CHANGELOG.md
CHANGED
|
@@ -26,16 +26,18 @@ const HR = ({
|
|
|
26
26
|
lineStyle,
|
|
27
27
|
marginLeft,
|
|
28
28
|
marginRight,
|
|
29
|
+
style,
|
|
29
30
|
textStyle,
|
|
30
31
|
text,
|
|
31
32
|
...props
|
|
32
33
|
}) => {
|
|
33
34
|
const renderLine = key => (0, _element.createElement)(_reactNative.View, {
|
|
34
35
|
key: key,
|
|
35
|
-
style: getStylesFromColorScheme(_styles.default.line, _styles.default.lineDark)
|
|
36
|
+
style: [getStylesFromColorScheme(_styles.default.line, _styles.default.lineDark), lineStyle]
|
|
36
37
|
});
|
|
37
38
|
const renderText = key => (0, _element.createElement)(_reactNative.View, {
|
|
38
|
-
key: key
|
|
39
|
+
key: key,
|
|
40
|
+
style: _styles.default.textContainer
|
|
39
41
|
}, (0, _element.createElement)(_reactNative.Text, {
|
|
40
42
|
style: [_styles.default.text, textStyle]
|
|
41
43
|
}, text));
|
|
@@ -49,7 +51,7 @@ const HR = ({
|
|
|
49
51
|
style: [_styles.default.container, {
|
|
50
52
|
marginLeft,
|
|
51
53
|
marginRight
|
|
52
|
-
},
|
|
54
|
+
}, style],
|
|
53
55
|
...props
|
|
54
56
|
}, renderInner());
|
|
55
57
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNative","require","_compose","_styles","_interopRequireDefault","HR","getStylesFromColorScheme","lineStyle","marginLeft","marginRight","textStyle","text","props","renderLine","key","_element","createElement","View","
|
|
1
|
+
{"version":3,"names":["_reactNative","require","_compose","_styles","_interopRequireDefault","HR","getStylesFromColorScheme","lineStyle","marginLeft","marginRight","style","textStyle","text","props","renderLine","key","_element","createElement","View","styles","line","lineDark","renderText","textContainer","Text","renderInner","container","HorizontalRule","withPreferredColorScheme","exports"],"sources":["@wordpress/primitives/src/horizontal-rule/index.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { Text, View } from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport { withPreferredColorScheme } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport styles from './styles.scss';\n\nconst HR = ( {\n\tgetStylesFromColorScheme,\n\tlineStyle,\n\tmarginLeft,\n\tmarginRight,\n\tstyle,\n\ttextStyle,\n\ttext,\n\t...props\n} ) => {\n\tconst renderLine = ( key ) => (\n\t\t<View\n\t\t\tkey={ key }\n\t\t\tstyle={ [\n\t\t\t\tgetStylesFromColorScheme( styles.line, styles.lineDark ),\n\t\t\t\tlineStyle,\n\t\t\t] }\n\t\t/>\n\t);\n\n\tconst renderText = ( key ) => (\n\t\t<View key={ key } style={ styles.textContainer }>\n\t\t\t<Text style={ [ styles.text, textStyle ] }>{ text }</Text>\n\t\t</View>\n\t);\n\n\tconst renderInner = () => {\n\t\tif ( ! text ) {\n\t\t\treturn renderLine();\n\t\t}\n\t\treturn [ renderLine( 1 ), renderText( 2 ), renderLine( 3 ) ];\n\t};\n\n\treturn (\n\t\t<View\n\t\t\tstyle={ [ styles.container, { marginLeft, marginRight }, style ] }\n\t\t\t{ ...props }\n\t\t>\n\t\t\t{ renderInner() }\n\t\t</View>\n\t);\n};\n\nexport const HorizontalRule = withPreferredColorScheme( HR );\n"],"mappings":";;;;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AAKA,IAAAE,OAAA,GAAAC,sBAAA,CAAAH,OAAA;AAbA;AACA;AACA;;A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ACwB,OAAA,CAAAF,cAAA,GAAAA,cAAA"}
|
|
@@ -18,16 +18,18 @@ const HR = ({
|
|
|
18
18
|
lineStyle,
|
|
19
19
|
marginLeft,
|
|
20
20
|
marginRight,
|
|
21
|
+
style,
|
|
21
22
|
textStyle,
|
|
22
23
|
text,
|
|
23
24
|
...props
|
|
24
25
|
}) => {
|
|
25
26
|
const renderLine = key => createElement(View, {
|
|
26
27
|
key: key,
|
|
27
|
-
style: getStylesFromColorScheme(styles.line, styles.lineDark)
|
|
28
|
+
style: [getStylesFromColorScheme(styles.line, styles.lineDark), lineStyle]
|
|
28
29
|
});
|
|
29
30
|
const renderText = key => createElement(View, {
|
|
30
|
-
key: key
|
|
31
|
+
key: key,
|
|
32
|
+
style: styles.textContainer
|
|
31
33
|
}, createElement(Text, {
|
|
32
34
|
style: [styles.text, textStyle]
|
|
33
35
|
}, text));
|
|
@@ -41,7 +43,7 @@ const HR = ({
|
|
|
41
43
|
style: [styles.container, {
|
|
42
44
|
marginLeft,
|
|
43
45
|
marginRight
|
|
44
|
-
},
|
|
46
|
+
}, style],
|
|
45
47
|
...props
|
|
46
48
|
}, renderInner());
|
|
47
49
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Text","View","withPreferredColorScheme","styles","HR","getStylesFromColorScheme","lineStyle","marginLeft","marginRight","textStyle","text","props","renderLine","key","createElement","
|
|
1
|
+
{"version":3,"names":["Text","View","withPreferredColorScheme","styles","HR","getStylesFromColorScheme","lineStyle","marginLeft","marginRight","style","textStyle","text","props","renderLine","key","createElement","line","lineDark","renderText","textContainer","renderInner","container","HorizontalRule"],"sources":["@wordpress/primitives/src/horizontal-rule/index.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { Text, View } from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport { withPreferredColorScheme } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport styles from './styles.scss';\n\nconst HR = ( {\n\tgetStylesFromColorScheme,\n\tlineStyle,\n\tmarginLeft,\n\tmarginRight,\n\tstyle,\n\ttextStyle,\n\ttext,\n\t...props\n} ) => {\n\tconst renderLine = ( key ) => (\n\t\t<View\n\t\t\tkey={ key }\n\t\t\tstyle={ [\n\t\t\t\tgetStylesFromColorScheme( styles.line, styles.lineDark ),\n\t\t\t\tlineStyle,\n\t\t\t] }\n\t\t/>\n\t);\n\n\tconst renderText = ( key ) => (\n\t\t<View key={ key } style={ styles.textContainer }>\n\t\t\t<Text style={ [ styles.text, textStyle ] }>{ text }</Text>\n\t\t</View>\n\t);\n\n\tconst renderInner = () => {\n\t\tif ( ! text ) {\n\t\t\treturn renderLine();\n\t\t}\n\t\treturn [ renderLine( 1 ), renderText( 2 ), renderLine( 3 ) ];\n\t};\n\n\treturn (\n\t\t<View\n\t\t\tstyle={ [ styles.container, { marginLeft, marginRight }, style ] }\n\t\t\t{ ...props }\n\t\t>\n\t\t\t{ renderInner() }\n\t\t</View>\n\t);\n};\n\nexport const HorizontalRule = withPreferredColorScheme( HR );\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,IAAI,EAAEC,IAAI,QAAQ,cAAc;;AAEzC;AACA;AACA;AACA,SAASC,wBAAwB,QAAQ,oBAAoB;;AAE7D;AACA;AACA;AACA,OAAOC,MAAM,MAAM,eAAe;AAElC,MAAMC,EAAE,GAAGA,CAAE;EACZC,wBAAwB;EACxBC,SAAS;EACTC,UAAU;EACVC,WAAW;EACXC,KAAK;EACLC,SAAS;EACTC,IAAI;EACJ,GAAGC;AACJ,CAAC,KAAM;EACN,MAAMC,UAAU,GAAKC,GAAG,IACvBC,aAAA,CAACd,IAAI;IACJa,GAAG,EAAGA,GAAK;IACXL,KAAK,EAAG,CACPJ,wBAAwB,CAAEF,MAAM,CAACa,IAAI,EAAEb,MAAM,CAACc,QAAS,CAAC,EACxDX,SAAS;EACP,CACH,CACD;EAED,MAAMY,UAAU,GAAKJ,GAAG,IACvBC,aAAA,CAACd,IAAI;IAACa,GAAG,EAAGA,GAAK;IAACL,KAAK,EAAGN,MAAM,CAACgB;EAAe,GAC/CJ,aAAA,CAACf,IAAI;IAACS,KAAK,EAAG,CAAEN,MAAM,CAACQ,IAAI,EAAED,SAAS;EAAI,GAAGC,IAAY,CACpD,CACN;EAED,MAAMS,WAAW,GAAGA,CAAA,KAAM;IACzB,IAAK,CAAET,IAAI,EAAG;MACb,OAAOE,UAAU,CAAC,CAAC;IACpB;IACA,OAAO,CAAEA,UAAU,CAAE,CAAE,CAAC,EAAEK,UAAU,CAAE,CAAE,CAAC,EAAEL,UAAU,CAAE,CAAE,CAAC,CAAE;EAC7D,CAAC;EAED,OACCE,aAAA,CAACd,IAAI;IACJQ,KAAK,EAAG,CAAEN,MAAM,CAACkB,SAAS,EAAE;MAAEd,UAAU;MAAEC;IAAY,CAAC,EAAEC,KAAK,CAAI;IAAA,GAC7DG;EAAK,GAERQ,WAAW,CAAC,CACT,CAAC;AAET,CAAC;AAED,OAAO,MAAME,cAAc,GAAGpB,wBAAwB,CAAEE,EAAG,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/primitives",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.39.1-next.5a1d1283.0",
|
|
4
4
|
"description": "WordPress cross-platform primitives.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -31,11 +31,11 @@
|
|
|
31
31
|
"types": "build-types",
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@babel/runtime": "^7.16.0",
|
|
34
|
-
"@wordpress/element": "^5.
|
|
34
|
+
"@wordpress/element": "^5.18.1-next.5a1d1283.0",
|
|
35
35
|
"classnames": "^2.3.1"
|
|
36
36
|
},
|
|
37
37
|
"publishConfig": {
|
|
38
38
|
"access": "public"
|
|
39
39
|
},
|
|
40
|
-
"gitHead": "
|
|
40
|
+
"gitHead": "fa0b66987dab5a15f38663e06036d09bccffaa4b"
|
|
41
41
|
}
|
|
@@ -18,6 +18,7 @@ const HR = ( {
|
|
|
18
18
|
lineStyle,
|
|
19
19
|
marginLeft,
|
|
20
20
|
marginRight,
|
|
21
|
+
style,
|
|
21
22
|
textStyle,
|
|
22
23
|
text,
|
|
23
24
|
...props
|
|
@@ -25,12 +26,15 @@ const HR = ( {
|
|
|
25
26
|
const renderLine = ( key ) => (
|
|
26
27
|
<View
|
|
27
28
|
key={ key }
|
|
28
|
-
style={
|
|
29
|
+
style={ [
|
|
30
|
+
getStylesFromColorScheme( styles.line, styles.lineDark ),
|
|
31
|
+
lineStyle,
|
|
32
|
+
] }
|
|
29
33
|
/>
|
|
30
34
|
);
|
|
31
35
|
|
|
32
36
|
const renderText = ( key ) => (
|
|
33
|
-
<View key={ key }>
|
|
37
|
+
<View key={ key } style={ styles.textContainer }>
|
|
34
38
|
<Text style={ [ styles.text, textStyle ] }>{ text }</Text>
|
|
35
39
|
</View>
|
|
36
40
|
);
|
|
@@ -44,11 +48,7 @@ const HR = ( {
|
|
|
44
48
|
|
|
45
49
|
return (
|
|
46
50
|
<View
|
|
47
|
-
style={ [
|
|
48
|
-
styles.container,
|
|
49
|
-
{ marginLeft, marginRight },
|
|
50
|
-
props.style,
|
|
51
|
-
] }
|
|
51
|
+
style={ [ styles.container, { marginLeft, marginRight }, style ] }
|
|
52
52
|
{ ...props }
|
|
53
53
|
>
|
|
54
54
|
{ renderInner() }
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
.line {
|
|
9
9
|
background-color: $gray-lighten-20;
|
|
10
|
-
flex: 1;
|
|
10
|
+
flex: 1 0 10px;
|
|
11
11
|
height: 2;
|
|
12
12
|
}
|
|
13
13
|
|
|
@@ -15,9 +15,12 @@
|
|
|
15
15
|
background-color: $gray-50;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
.
|
|
19
|
-
flex: 1;
|
|
18
|
+
.textContainer {
|
|
19
|
+
flex: 0 1 auto;
|
|
20
20
|
margin-left: 15px;
|
|
21
21
|
margin-right: 15px;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.text {
|
|
22
25
|
text-align: center;
|
|
23
26
|
}
|