@wordpress/primitives 4.32.0 → 4.32.1-next.b8c8708f3.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/build/block-quotation/index.js +27 -6
- package/build/block-quotation/index.js.map +7 -1
- package/build/horizontal-rule/index.js +27 -6
- package/build/horizontal-rule/index.js.map +7 -1
- package/build/index.js +27 -48
- package/build/index.js.map +7 -1
- package/build/svg/index.js +87 -127
- package/build/svg/index.js.map +7 -1
- package/build/view/index.js +27 -6
- package/build/view/index.js.map +7 -1
- package/build-module/block-quotation/index.js +5 -2
- package/build-module/block-quotation/index.js.map +7 -1
- package/build-module/horizontal-rule/index.js +5 -2
- package/build-module/horizontal-rule/index.js.map +7 -1
- package/build-module/index.js +5 -5
- package/build-module/index.js.map +7 -1
- package/build-module/svg/index.js +46 -113
- package/build-module/svg/index.js.map +7 -1
- package/build-module/view/index.js +5 -2
- package/build-module/view/index.js.map +7 -1
- package/package.json +10 -4
- package/build/block-quotation/index.native.js +0 -67
- package/build/block-quotation/index.native.js.map +0 -1
- package/build/horizontal-rule/index.native.js +0 -60
- package/build/horizontal-rule/index.native.js.map +0 -1
- package/build/svg/index.native.js +0 -126
- package/build/svg/index.native.js.map +0 -1
- package/build/view/index.native.js +0 -13
- package/build/view/index.native.js.map +0 -1
- package/build-module/block-quotation/index.native.js +0 -57
- package/build-module/block-quotation/index.native.js.map +0 -1
- package/build-module/horizontal-rule/index.native.js +0 -52
- package/build-module/horizontal-rule/index.native.js.map +0 -1
- package/build-module/svg/index.native.js +0 -52
- package/build-module/svg/index.native.js.map +0 -1
- package/build-module/view/index.native.js +0 -5
- package/build-module/view/index.native.js.map +0 -1
|
@@ -1,52 +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
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
16
|
-
const HR = ({
|
|
17
|
-
getStylesFromColorScheme,
|
|
18
|
-
lineStyle,
|
|
19
|
-
marginLeft,
|
|
20
|
-
marginRight,
|
|
21
|
-
style,
|
|
22
|
-
textStyle,
|
|
23
|
-
text,
|
|
24
|
-
...props
|
|
25
|
-
}) => {
|
|
26
|
-
const renderLine = key => /*#__PURE__*/_jsx(View, {
|
|
27
|
-
style: [getStylesFromColorScheme(styles.line, styles.lineDark), lineStyle]
|
|
28
|
-
}, key);
|
|
29
|
-
const renderText = key => /*#__PURE__*/_jsx(View, {
|
|
30
|
-
style: styles.textContainer,
|
|
31
|
-
children: /*#__PURE__*/_jsx(Text, {
|
|
32
|
-
style: [styles.text, textStyle],
|
|
33
|
-
children: text
|
|
34
|
-
})
|
|
35
|
-
}, key);
|
|
36
|
-
const renderInner = () => {
|
|
37
|
-
if (!text) {
|
|
38
|
-
return renderLine();
|
|
39
|
-
}
|
|
40
|
-
return [renderLine(1), renderText(2), renderLine(3)];
|
|
41
|
-
};
|
|
42
|
-
return /*#__PURE__*/_jsx(View, {
|
|
43
|
-
style: [styles.container, {
|
|
44
|
-
marginLeft,
|
|
45
|
-
marginRight
|
|
46
|
-
}, style],
|
|
47
|
-
...props,
|
|
48
|
-
children: renderInner()
|
|
49
|
-
});
|
|
50
|
-
};
|
|
51
|
-
export const HorizontalRule = withPreferredColorScheme(HR);
|
|
52
|
-
//# sourceMappingURL=index.native.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["Text","View","withPreferredColorScheme","styles","jsx","_jsx","HR","getStylesFromColorScheme","lineStyle","marginLeft","marginRight","style","textStyle","text","props","renderLine","key","line","lineDark","renderText","textContainer","children","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;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAEnC,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,iBACvBX,IAAA,CAACJ,IAAI;IAEJU,KAAK,EAAG,CACPJ,wBAAwB,CAAEJ,MAAM,CAACc,IAAI,EAAEd,MAAM,CAACe,QAAS,CAAC,EACxDV,SAAS;EACP,GAJGQ,GAKN,CACD;EAED,MAAMG,UAAU,GAAKH,GAAG,iBACvBX,IAAA,CAACJ,IAAI;IAAaU,KAAK,EAAGR,MAAM,CAACiB,aAAe;IAAAC,QAAA,eAC/ChB,IAAA,CAACL,IAAI;MAACW,KAAK,EAAG,CAAER,MAAM,CAACU,IAAI,EAAED,SAAS,CAAI;MAAAS,QAAA,EAAGR;IAAI,CAAQ;EAAC,GAD/CG,GAEN,CACN;EAED,MAAMM,WAAW,GAAGA,CAAA,KAAM;IACzB,IAAK,CAAET,IAAI,EAAG;MACb,OAAOE,UAAU,CAAC,CAAC;IACpB;IACA,OAAO,CAAEA,UAAU,CAAE,CAAE,CAAC,EAAEI,UAAU,CAAE,CAAE,CAAC,EAAEJ,UAAU,CAAE,CAAE,CAAC,CAAE;EAC7D,CAAC;EAED,oBACCV,IAAA,CAACJ,IAAI;IACJU,KAAK,EAAG,CAAER,MAAM,CAACoB,SAAS,EAAE;MAAEd,UAAU;MAAEC;IAAY,CAAC,EAAEC,KAAK,CAAI;IAAA,GAC7DG,KAAK;IAAAO,QAAA,EAERC,WAAW,CAAC;EAAC,CACV,CAAC;AAET,CAAC;AAED,OAAO,MAAME,cAAc,GAAGtB,wBAAwB,CAAEI,EAAG,CAAC","ignoreList":[]}
|
|
@@ -1,52 +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
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
18
|
-
export { Circle, G, Path, Polygon, Rect, Defs, RadialGradient, LinearGradient, Stop, Line, SvgXml } from 'react-native-svg';
|
|
19
|
-
const AnimatedSvg = Animated.createAnimatedComponent(forwardRef((props, ref) => /*#__PURE__*/_jsx(Svg, {
|
|
20
|
-
ref: ref,
|
|
21
|
-
...props
|
|
22
|
-
})));
|
|
23
|
-
export const SVG = ({
|
|
24
|
-
className = '',
|
|
25
|
-
isPressed,
|
|
26
|
-
animated = false,
|
|
27
|
-
...props
|
|
28
|
-
}) => {
|
|
29
|
-
const colorScheme = usePreferredColorScheme();
|
|
30
|
-
const stylesFromClasses = className.split(' ').map(element => styles[element]).filter(Boolean);
|
|
31
|
-
const defaultStyle = isPressed ? styles[`is-pressed--${colorScheme}`] : styles['components-toolbar__control-' + colorScheme];
|
|
32
|
-
const propStyle = Array.isArray(props.style) ? props.style.reduce((acc, el) => {
|
|
33
|
-
return {
|
|
34
|
-
...acc,
|
|
35
|
-
...el
|
|
36
|
-
};
|
|
37
|
-
}, {}) : props.style;
|
|
38
|
-
const styleValues = Object.assign({}, defaultStyle, propStyle, ...stylesFromClasses);
|
|
39
|
-
const appliedProps = {
|
|
40
|
-
...props,
|
|
41
|
-
style: styleValues
|
|
42
|
-
};
|
|
43
|
-
const SvgWrapper = animated ? AnimatedSvg : Svg;
|
|
44
|
-
return /*#__PURE__*/_jsx(SvgWrapper
|
|
45
|
-
// We want to re-render when style color is changed.
|
|
46
|
-
, {
|
|
47
|
-
height: "100%",
|
|
48
|
-
width: "100%",
|
|
49
|
-
...appliedProps
|
|
50
|
-
}, appliedProps.style.color);
|
|
51
|
-
};
|
|
52
|
-
//# sourceMappingURL=index.native.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["Svg","Animated","forwardRef","usePreferredColorScheme","styles","jsx","_jsx","Circle","G","Path","Polygon","Rect","Defs","RadialGradient","LinearGradient","Stop","Line","SvgXml","AnimatedSvg","createAnimatedComponent","props","ref","SVG","className","isPressed","animated","colorScheme","stylesFromClasses","split","map","element","filter","Boolean","defaultStyle","propStyle","Array","isArray","style","reduce","acc","el","styleValues","Object","assign","appliedProps","SvgWrapper","height","width","color"],"sources":["@wordpress/primitives/src/svg/index.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { Svg } from 'react-native-svg';\nimport { Animated } from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport { forwardRef } from '@wordpress/element';\nimport { usePreferredColorScheme } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport styles from './style.scss';\n\nexport {\n\tCircle,\n\tG,\n\tPath,\n\tPolygon,\n\tRect,\n\tDefs,\n\tRadialGradient,\n\tLinearGradient,\n\tStop,\n\tLine,\n\tSvgXml,\n} from 'react-native-svg';\n\nconst AnimatedSvg = Animated.createAnimatedComponent(\n\tforwardRef( ( props, ref ) => <Svg ref={ ref } { ...props } /> )\n);\n\nexport const SVG = ( {\n\tclassName = '',\n\tisPressed,\n\tanimated = false,\n\t...props\n} ) => {\n\tconst colorScheme = usePreferredColorScheme();\n\tconst stylesFromClasses = className\n\t\t.split( ' ' )\n\t\t.map( ( element ) => styles[ element ] )\n\t\t.filter( Boolean );\n\tconst defaultStyle = isPressed\n\t\t? styles[ `is-pressed--${ colorScheme }` ]\n\t\t: styles[ 'components-toolbar__control-' + colorScheme ];\n\tconst propStyle = Array.isArray( props.style )\n\t\t? props.style.reduce( ( acc, el ) => {\n\t\t\t\treturn { ...acc, ...el };\n\t\t }, {} )\n\t\t: props.style;\n\tconst styleValues = Object.assign(\n\t\t{},\n\t\tdefaultStyle,\n\t\tpropStyle,\n\t\t...stylesFromClasses\n\t);\n\n\tconst appliedProps = { ...props, style: styleValues };\n\n\tconst SvgWrapper = animated ? AnimatedSvg : Svg;\n\n\treturn (\n\t\t<SvgWrapper\n\t\t\t// We want to re-render when style color is changed.\n\t\t\tkey={ appliedProps.style.color }\n\t\t\theight=\"100%\"\n\t\t\twidth=\"100%\"\n\t\t\t{ ...appliedProps }\n\t\t/>\n\t);\n};\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,GAAG,QAAQ,kBAAkB;AACtC,SAASC,QAAQ,QAAQ,cAAc;;AAEvC;AACA;AACA;AACA,SAASC,UAAU,QAAQ,oBAAoB;AAC/C,SAASC,uBAAuB,QAAQ,oBAAoB;;AAE5D;AACA;AACA;AACA,OAAOC,MAAM,MAAM,cAAc;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAElC,SACCC,MAAM,EACNC,CAAC,EACDC,IAAI,EACJC,OAAO,EACPC,IAAI,EACJC,IAAI,EACJC,cAAc,EACdC,cAAc,EACdC,IAAI,EACJC,IAAI,EACJC,MAAM,QACA,kBAAkB;AAEzB,MAAMC,WAAW,GAAGjB,QAAQ,CAACkB,uBAAuB,CACnDjB,UAAU,CAAE,CAAEkB,KAAK,EAAEC,GAAG,kBAAMf,IAAA,CAACN,GAAG;EAACqB,GAAG,EAAGA,GAAK;EAAA,GAAMD;AAAK,CAAI,CAAE,CAChE,CAAC;AAED,OAAO,MAAME,GAAG,GAAGA,CAAE;EACpBC,SAAS,GAAG,EAAE;EACdC,SAAS;EACTC,QAAQ,GAAG,KAAK;EAChB,GAAGL;AACJ,CAAC,KAAM;EACN,MAAMM,WAAW,GAAGvB,uBAAuB,CAAC,CAAC;EAC7C,MAAMwB,iBAAiB,GAAGJ,SAAS,CACjCK,KAAK,CAAE,GAAI,CAAC,CACZC,GAAG,CAAIC,OAAO,IAAM1B,MAAM,CAAE0B,OAAO,CAAG,CAAC,CACvCC,MAAM,CAAEC,OAAQ,CAAC;EACnB,MAAMC,YAAY,GAAGT,SAAS,GAC3BpB,MAAM,CAAE,eAAgBsB,WAAW,EAAG,CAAE,GACxCtB,MAAM,CAAE,8BAA8B,GAAGsB,WAAW,CAAE;EACzD,MAAMQ,SAAS,GAAGC,KAAK,CAACC,OAAO,CAAEhB,KAAK,CAACiB,KAAM,CAAC,GAC3CjB,KAAK,CAACiB,KAAK,CAACC,MAAM,CAAE,CAAEC,GAAG,EAAEC,EAAE,KAAM;IACnC,OAAO;MAAE,GAAGD,GAAG;MAAE,GAAGC;IAAG,CAAC;EACxB,CAAC,EAAE,CAAC,CAAE,CAAC,GACPpB,KAAK,CAACiB,KAAK;EACd,MAAMI,WAAW,GAAGC,MAAM,CAACC,MAAM,CAChC,CAAC,CAAC,EACFV,YAAY,EACZC,SAAS,EACT,GAAGP,iBACJ,CAAC;EAED,MAAMiB,YAAY,GAAG;IAAE,GAAGxB,KAAK;IAAEiB,KAAK,EAAEI;EAAY,CAAC;EAErD,MAAMI,UAAU,GAAGpB,QAAQ,GAAGP,WAAW,GAAGlB,GAAG;EAE/C,oBACCM,IAAA,CAACuC;EACA;EAAA;IAEAC,MAAM,EAAC,MAAM;IACbC,KAAK,EAAC,MAAM;IAAA,GACPH;EAAY,GAHXA,YAAY,CAACP,KAAK,CAACW,KAIzB,CAAC;AAEJ,CAAC","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["View"],"sources":["@wordpress/primitives/src/view/index.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nexport { View } from 'react-native';\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,IAAI,QAAQ,cAAc","ignoreList":[]}
|