@wordpress/primitives 3.33.0 → 3.33.2
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/horizontal-rule/index.native.js +4 -5
- package/build/horizontal-rule/index.native.js.map +1 -1
- package/build/svg/index.js +2 -1
- package/build/svg/index.js.map +1 -1
- package/build/svg/index.native.js +8 -8
- package/build/svg/index.native.js.map +1 -1
- package/build-module/horizontal-rule/index.native.js +4 -4
- package/build-module/horizontal-rule/index.native.js.map +1 -1
- package/build-module/svg/index.js +2 -1
- package/build-module/svg/index.js.map +1 -1
- package/build-module/svg/index.native.js +8 -7
- package/build-module/svg/index.native.js.map +1 -1
- package/package.json +3 -3
|
@@ -9,8 +9,6 @@ exports.HorizontalRule = void 0;
|
|
|
9
9
|
|
|
10
10
|
var _element = require("@wordpress/element");
|
|
11
11
|
|
|
12
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
13
|
-
|
|
14
12
|
var _reactNative = require("react-native");
|
|
15
13
|
|
|
16
14
|
var _compose = require("@wordpress/compose");
|
|
@@ -56,12 +54,13 @@ const HR = ({
|
|
|
56
54
|
return [renderLine(1), renderText(2), renderLine(3)];
|
|
57
55
|
};
|
|
58
56
|
|
|
59
|
-
return (0, _element.createElement)(_reactNative.View,
|
|
57
|
+
return (0, _element.createElement)(_reactNative.View, {
|
|
60
58
|
style: [_styles.default.container, {
|
|
61
59
|
marginLeft,
|
|
62
60
|
marginRight
|
|
63
|
-
}, props.style]
|
|
64
|
-
|
|
61
|
+
}, props.style],
|
|
62
|
+
...props
|
|
63
|
+
}, renderInner());
|
|
65
64
|
};
|
|
66
65
|
|
|
67
66
|
const HorizontalRule = (0, _compose.withPreferredColorScheme)(HR);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/primitives/src/horizontal-rule/index.native.js"],"names":["HR","getStylesFromColorScheme","lineStyle","marginLeft","marginRight","textStyle","text","props","renderLine","key","styles","line","lineDark","renderText","renderInner","container","style","HorizontalRule"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["@wordpress/primitives/src/horizontal-rule/index.native.js"],"names":["HR","getStylesFromColorScheme","lineStyle","marginLeft","marginRight","textStyle","text","props","renderLine","key","styles","line","lineDark","renderText","renderInner","container","style","HorizontalRule"],"mappings":";;;;;;;;;;;AAGA;;AAKA;;AAKA;;AAbA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;AAGA,MAAMA,EAAE,GAAG,CAAE;AACZC,EAAAA,wBADY;AAEZC,EAAAA,SAFY;AAGZC,EAAAA,UAHY;AAIZC,EAAAA,WAJY;AAKZC,EAAAA,SALY;AAMZC,EAAAA,IANY;AAOZ,KAAGC;AAPS,CAAF,KAQJ;AACN,QAAMC,UAAU,GAAKC,GAAF,IAClB,4BAAC,iBAAD;AACC,IAAA,GAAG,EAAGA,GADP;AAEC,IAAA,KAAK,EAAGR,wBAAwB,CAAES,gBAAOC,IAAT,EAAeD,gBAAOE,QAAtB;AAFjC,IADD;;AAOA,QAAMC,UAAU,GAAKJ,GAAF,IAClB,4BAAC,iBAAD;AAAM,IAAA,GAAG,EAAGA;AAAZ,KACC,4BAAC,iBAAD;AAAM,IAAA,KAAK,EAAG,CAAEC,gBAAOJ,IAAT,EAAeD,SAAf;AAAd,KAA6CC,IAA7C,CADD,CADD;;AAMA,QAAMQ,WAAW,GAAG,MAAM;AACzB,QAAK,CAAER,IAAP,EAAc;AACb,aAAOE,UAAU,EAAjB;AACA;;AACD,WAAO,CAAEA,UAAU,CAAE,CAAF,CAAZ,EAAmBK,UAAU,CAAE,CAAF,CAA7B,EAAoCL,UAAU,CAAE,CAAF,CAA9C,CAAP;AACA,GALD;;AAOA,SACC,4BAAC,iBAAD;AACC,IAAA,KAAK,EAAG,CACPE,gBAAOK,SADA,EAEP;AAAEZ,MAAAA,UAAF;AAAcC,MAAAA;AAAd,KAFO,EAGPG,KAAK,CAACS,KAHC,CADT;AAAA,OAMMT;AANN,KAQGO,WAAW,EARd,CADD;AAYA,CAzCD;;AA2CO,MAAMG,cAAc,GAAG,uCAA0BjB,EAA1B,CAAvB","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\ttextStyle,\n\ttext,\n\t...props\n} ) => {\n\tconst renderLine = ( key ) => (\n\t\t<View\n\t\t\tkey={ key }\n\t\t\tstyle={ getStylesFromColorScheme( styles.line, styles.lineDark ) }\n\t\t/>\n\t);\n\n\tconst renderText = ( key ) => (\n\t\t<View key={ key }>\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={ [\n\t\t\t\tstyles.container,\n\t\t\t\t{ marginLeft, marginRight },\n\t\t\t\tprops.style,\n\t\t\t] }\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"]}
|
package/build/svg/index.js
CHANGED
|
@@ -142,7 +142,8 @@ const SVG = ({
|
|
|
142
142
|
}; // Disable reason: We need to have a way to render HTML tag for web.
|
|
143
143
|
// eslint-disable-next-line react/forbid-elements
|
|
144
144
|
|
|
145
|
-
return (0, _element.createElement)("svg", appliedProps
|
|
145
|
+
return (0, _element.createElement)("svg", { ...appliedProps
|
|
146
|
+
});
|
|
146
147
|
};
|
|
147
148
|
|
|
148
149
|
exports.SVG = SVG;
|
package/build/svg/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/primitives/src/svg/index.js"],"names":["Circle","props","G","Line","Path","Polygon","Rect","Defs","RadialGradient","LinearGradient","Stop","SVG","className","isPressed","appliedProps","undefined","focusable"],"mappings":";;;;;;;;;AAGA;;AAKA;;AARA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;;AAEA;AACA;AACA;AACA;AACA;AACO,MAAMA,MAAM,GAAKC,KAAF,IAAa,4BAAe,QAAf,EAAyBA,KAAzB,CAA5B;AAEP;AACA;AACA;AACA;AACA;;;;;AACO,MAAMC,CAAC,GAAKD,KAAF,IAAa,4BAAe,GAAf,EAAoBA,KAApB,CAAvB;AAEP;AACA;AACA;AACA;AACA;;;;;AACO,MAAME,IAAI,GAAKF,KAAF,IAAa,4BAAe,MAAf,EAAuBA,KAAvB,CAA1B;AAEP;AACA;AACA;AACA;AACA;;;;;AACO,MAAMG,IAAI,GAAKH,KAAF,IAAa,4BAAe,MAAf,EAAuBA,KAAvB,CAA1B;AAEP;AACA;AACA;AACA;AACA;;;;;AACO,MAAMI,OAAO,GAAKJ,KAAF,IAAa,4BAAe,SAAf,EAA0BA,KAA1B,CAA7B;AAEP;AACA;AACA;AACA;AACA;;;;;AACO,MAAMK,IAAI,GAAKL,KAAF,IAAa,4BAAe,MAAf,EAAuBA,KAAvB,CAA1B;AAEP;AACA;AACA;AACA;AACA;;;;;AACO,MAAMM,IAAI,GAAKN,KAAF,IAAa,4BAAe,MAAf,EAAuBA,KAAvB,CAA1B;AAEP;AACA;AACA;AACA;AACA;;;;;AACO,MAAMO,cAAc,GAAKP,KAAF,IAC7B,4BAAe,gBAAf,EAAiCA,KAAjC,CADM;AAGP;AACA;AACA;AACA;AACA;;;;;AACO,MAAMQ,cAAc,GAAKR,KAAF,IAC7B,4BAAe,gBAAf,EAAiCA,KAAjC,CADM;AAGP;AACA;AACA;AACA;AACA;;;;;AACO,MAAMS,IAAI,GAAKT,KAAF,IAAa,4BAAe,MAAf,EAAuBA,KAAvB,CAA1B;AAEP;AACA;AACA;AACA;AACA;AACA;AACA;;;;;AACO,MAAMU,GAAG,GAAG,CAAE;AAAEC,EAAAA,SAAF;AAAaC,EAAAA,SAAb;AAAwB,KAAGZ;AAA3B,CAAF,KAA0C;AAC5D,QAAMa,YAAY,GAAG,EACpB,GAAGb,KADiB;AAEpBW,IAAAA,SAAS,EACR,yBAAYA,SAAZ,EAAuB;AAAE,oBAAcC;AAAhB,KAAvB,KAAwDE,SAHrC;AAIpB,mBAAe,IAJK;AAKpBC,IAAAA,SAAS,EAAE;AALS,GAArB,CAD4D,CAS5D;AACA;;AACA,SAAO,
|
|
1
|
+
{"version":3,"sources":["@wordpress/primitives/src/svg/index.js"],"names":["Circle","props","G","Line","Path","Polygon","Rect","Defs","RadialGradient","LinearGradient","Stop","SVG","className","isPressed","appliedProps","undefined","focusable"],"mappings":";;;;;;;;;AAGA;;AAKA;;AARA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;;AAEA;AACA;AACA;AACA;AACA;AACO,MAAMA,MAAM,GAAKC,KAAF,IAAa,4BAAe,QAAf,EAAyBA,KAAzB,CAA5B;AAEP;AACA;AACA;AACA;AACA;;;;;AACO,MAAMC,CAAC,GAAKD,KAAF,IAAa,4BAAe,GAAf,EAAoBA,KAApB,CAAvB;AAEP;AACA;AACA;AACA;AACA;;;;;AACO,MAAME,IAAI,GAAKF,KAAF,IAAa,4BAAe,MAAf,EAAuBA,KAAvB,CAA1B;AAEP;AACA;AACA;AACA;AACA;;;;;AACO,MAAMG,IAAI,GAAKH,KAAF,IAAa,4BAAe,MAAf,EAAuBA,KAAvB,CAA1B;AAEP;AACA;AACA;AACA;AACA;;;;;AACO,MAAMI,OAAO,GAAKJ,KAAF,IAAa,4BAAe,SAAf,EAA0BA,KAA1B,CAA7B;AAEP;AACA;AACA;AACA;AACA;;;;;AACO,MAAMK,IAAI,GAAKL,KAAF,IAAa,4BAAe,MAAf,EAAuBA,KAAvB,CAA1B;AAEP;AACA;AACA;AACA;AACA;;;;;AACO,MAAMM,IAAI,GAAKN,KAAF,IAAa,4BAAe,MAAf,EAAuBA,KAAvB,CAA1B;AAEP;AACA;AACA;AACA;AACA;;;;;AACO,MAAMO,cAAc,GAAKP,KAAF,IAC7B,4BAAe,gBAAf,EAAiCA,KAAjC,CADM;AAGP;AACA;AACA;AACA;AACA;;;;;AACO,MAAMQ,cAAc,GAAKR,KAAF,IAC7B,4BAAe,gBAAf,EAAiCA,KAAjC,CADM;AAGP;AACA;AACA;AACA;AACA;;;;;AACO,MAAMS,IAAI,GAAKT,KAAF,IAAa,4BAAe,MAAf,EAAuBA,KAAvB,CAA1B;AAEP;AACA;AACA;AACA;AACA;AACA;AACA;;;;;AACO,MAAMU,GAAG,GAAG,CAAE;AAAEC,EAAAA,SAAF;AAAaC,EAAAA,SAAb;AAAwB,KAAGZ;AAA3B,CAAF,KAA0C;AAC5D,QAAMa,YAAY,GAAG,EACpB,GAAGb,KADiB;AAEpBW,IAAAA,SAAS,EACR,yBAAYA,SAAZ,EAAuB;AAAE,oBAAcC;AAAhB,KAAvB,KAAwDE,SAHrC;AAIpB,mBAAe,IAJK;AAKpBC,IAAAA,SAAS,EAAE;AALS,GAArB,CAD4D,CAS5D;AACA;;AACA,SAAO,wCAAUF;AAAV,IAAP;AACA,CAZM","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { createElement } from '@wordpress/element';\n\n/** @typedef {{isPressed?: boolean} & import('react').ComponentPropsWithoutRef<'svg'>} SVGProps */\n\n/**\n * @param {import('react').ComponentPropsWithoutRef<'circle'>} props\n *\n * @return {JSX.Element} Circle component\n */\nexport const Circle = ( props ) => createElement( 'circle', props );\n\n/**\n * @param {import('react').ComponentPropsWithoutRef<'g'>} props\n *\n * @return {JSX.Element} G component\n */\nexport const G = ( props ) => createElement( 'g', props );\n\n/**\n * @param {import('react').ComponentPropsWithoutRef<'line'>} props\n *\n * @return {JSX.Element} Path component\n */\nexport const Line = ( props ) => createElement( 'line', props );\n\n/**\n * @param {import('react').ComponentPropsWithoutRef<'path'>} props\n *\n * @return {JSX.Element} Path component\n */\nexport const Path = ( props ) => createElement( 'path', props );\n\n/**\n * @param {import('react').ComponentPropsWithoutRef<'polygon'>} props\n *\n * @return {JSX.Element} Polygon component\n */\nexport const Polygon = ( props ) => createElement( 'polygon', props );\n\n/**\n * @param {import('react').ComponentPropsWithoutRef<'rect'>} props\n *\n * @return {JSX.Element} Rect component\n */\nexport const Rect = ( props ) => createElement( 'rect', props );\n\n/**\n * @param {import('react').ComponentPropsWithoutRef<'defs'>} props\n *\n * @return {JSX.Element} Defs component\n */\nexport const Defs = ( props ) => createElement( 'defs', props );\n\n/**\n * @param {import('react').ComponentPropsWithoutRef<'radialGradient'>} props\n *\n * @return {JSX.Element} RadialGradient component\n */\nexport const RadialGradient = ( props ) =>\n\tcreateElement( 'radialGradient', props );\n\n/**\n * @param {import('react').ComponentPropsWithoutRef<'linearGradient'>} props\n *\n * @return {JSX.Element} LinearGradient component\n */\nexport const LinearGradient = ( props ) =>\n\tcreateElement( 'linearGradient', props );\n\n/**\n * @param {import('react').ComponentPropsWithoutRef<'stop'>} props\n *\n * @return {JSX.Element} Stop component\n */\nexport const Stop = ( props ) => createElement( 'stop', props );\n\n/**\n *\n * @param {SVGProps} props isPressed indicates whether the SVG should appear as pressed.\n * Other props will be passed through to svg component.\n *\n * @return {JSX.Element} Stop component\n */\nexport const SVG = ( { className, isPressed, ...props } ) => {\n\tconst appliedProps = {\n\t\t...props,\n\t\tclassName:\n\t\t\tclassnames( className, { 'is-pressed': isPressed } ) || undefined,\n\t\t'aria-hidden': true,\n\t\tfocusable: false,\n\t};\n\n\t// Disable reason: We need to have a way to render HTML tag for web.\n\t// eslint-disable-next-line react/forbid-elements\n\treturn <svg { ...appliedProps } />;\n};\n"]}
|
|
@@ -69,8 +69,6 @@ Object.defineProperty(exports, "Stop", {
|
|
|
69
69
|
|
|
70
70
|
var _element = require("@wordpress/element");
|
|
71
71
|
|
|
72
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
73
|
-
|
|
74
72
|
var _reactNativeSvg = require("react-native-svg");
|
|
75
73
|
|
|
76
74
|
var _reactNative = require("react-native");
|
|
@@ -88,9 +86,10 @@ var _style = _interopRequireDefault(require("./style.scss"));
|
|
|
88
86
|
/**
|
|
89
87
|
* Internal dependencies
|
|
90
88
|
*/
|
|
91
|
-
const AnimatedSvg = _reactNative.Animated.createAnimatedComponent((0, _element.forwardRef)((props, ref) => (0, _element.createElement)(_reactNativeSvg.Svg,
|
|
92
|
-
ref: ref
|
|
93
|
-
|
|
89
|
+
const AnimatedSvg = _reactNative.Animated.createAnimatedComponent((0, _element.forwardRef)((props, ref) => (0, _element.createElement)(_reactNativeSvg.Svg, {
|
|
90
|
+
ref: ref,
|
|
91
|
+
...props
|
|
92
|
+
})));
|
|
94
93
|
|
|
95
94
|
const SVG = ({
|
|
96
95
|
className = '',
|
|
@@ -112,11 +111,12 @@ const SVG = ({
|
|
|
112
111
|
};
|
|
113
112
|
const SvgWrapper = animated ? AnimatedSvg : _reactNativeSvg.Svg;
|
|
114
113
|
return (0, _element.createElement)(SvgWrapper // We want to re-render when style color is changed.
|
|
115
|
-
,
|
|
114
|
+
, {
|
|
116
115
|
key: appliedProps.style.color,
|
|
117
116
|
height: "100%",
|
|
118
|
-
width: "100%"
|
|
119
|
-
|
|
117
|
+
width: "100%",
|
|
118
|
+
...appliedProps
|
|
119
|
+
});
|
|
120
120
|
};
|
|
121
121
|
|
|
122
122
|
exports.SVG = SVG;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/primitives/src/svg/index.native.js"],"names":["AnimatedSvg","Animated","createAnimatedComponent","props","ref","SVG","className","isPressed","animated","colorScheme","stylesFromClasses","split","map","element","styles","filter","Boolean","defaultStyle","propStyle","Array","isArray","style","reduce","acc","el","styleValues","Object","assign","appliedProps","SvgWrapper","Svg","color"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASA
|
|
1
|
+
{"version":3,"sources":["@wordpress/primitives/src/svg/index.native.js"],"names":["AnimatedSvg","Animated","createAnimatedComponent","props","ref","SVG","className","isPressed","animated","colorScheme","stylesFromClasses","split","map","element","styles","filter","Boolean","defaultStyle","propStyle","Array","isArray","style","reduce","acc","el","styleValues","Object","assign","appliedProps","SvgWrapper","Svg","color"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASA;;AANA;;AACA;;AAUA;;AAdA;AACA;AACA;;AAIA;AACA;AACA;;AAGA;AACA;AACA;AAgBA,MAAMA,WAAW,GAAGC,sBAASC,uBAAT,CACnB,yBAAY,CAAEC,KAAF,EAASC,GAAT,KAAkB,4BAAC,mBAAD;AAAK,EAAA,GAAG,EAAGA,GAAX;AAAA,KAAsBD;AAAtB,EAA9B,CADmB,CAApB;;AAIO,MAAME,GAAG,GAAG,CAAE;AACpBC,EAAAA,SAAS,GAAG,EADQ;AAEpBC,EAAAA,SAFoB;AAGpBC,EAAAA,QAAQ,GAAG,KAHS;AAIpB,KAAGL;AAJiB,CAAF,KAKZ;AACN,QAAMM,WAAW,GAAGN,KAAK,CAACM,WAAN,IAAqB,OAAzC;AACA,QAAMC,iBAAiB,GAAGJ,SAAS,CACjCK,KADwB,CACjB,GADiB,EAExBC,GAFwB,CAEjBC,OAAF,IAAeC,eAAQD,OAAR,CAFI,EAGxBE,MAHwB,CAGhBC,OAHgB,CAA1B;AAIA,QAAMC,YAAY,GAAGV,SAAS,GAC3BO,eAAQ,YAAR,CAD2B,GAE3BA,eAAQ,iCAAiCL,WAAzC,CAFH;AAGA,QAAMS,SAAS,GAAGC,KAAK,CAACC,OAAN,CAAejB,KAAK,CAACkB,KAArB,IACflB,KAAK,CAACkB,KAAN,CAAYC,MAAZ,CAAoB,CAAEC,GAAF,EAAOC,EAAP,KAAe;AACnC,WAAO,EAAE,GAAGD,GAAL;AAAU,SAAGC;AAAb,KAAP;AACC,GAFD,EAEG,EAFH,CADe,GAIfrB,KAAK,CAACkB,KAJT;AAKA,QAAMI,WAAW,GAAGC,MAAM,CAACC,MAAP,CACnB,EADmB,EAEnBV,YAFmB,EAGnBC,SAHmB,EAInB,GAAGR,iBAJgB,CAApB;AAOA,QAAMkB,YAAY,GAAG,EAAE,GAAGzB,KAAL;AAAYkB,IAAAA,KAAK,EAAEI;AAAnB,GAArB;AAEA,QAAMI,UAAU,GAAGrB,QAAQ,GAAGR,WAAH,GAAiB8B,mBAA5C;AAEA,SACC,4BAAC,UAAD,CACC;AADD;AAEC,IAAA,GAAG,EAAGF,YAAY,CAACP,KAAb,CAAmBU,KAF1B;AAGC,IAAA,MAAM,EAAC,MAHR;AAIC,IAAA,KAAK,EAAC,MAJP;AAAA,OAKMH;AALN,IADD;AASA,CAvCM","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';\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} 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 = props.colorScheme || 'light';\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' ]\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"]}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
1
|
import { createElement } from "@wordpress/element";
|
|
3
2
|
|
|
4
3
|
/**
|
|
@@ -44,12 +43,13 @@ const HR = ({
|
|
|
44
43
|
return [renderLine(1), renderText(2), renderLine(3)];
|
|
45
44
|
};
|
|
46
45
|
|
|
47
|
-
return createElement(View,
|
|
46
|
+
return createElement(View, {
|
|
48
47
|
style: [styles.container, {
|
|
49
48
|
marginLeft,
|
|
50
49
|
marginRight
|
|
51
|
-
}, props.style]
|
|
52
|
-
|
|
50
|
+
}, props.style],
|
|
51
|
+
...props
|
|
52
|
+
}, renderInner());
|
|
53
53
|
};
|
|
54
54
|
|
|
55
55
|
export const HorizontalRule = withPreferredColorScheme(HR);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/primitives/src/horizontal-rule/index.native.js"],"names":["Text","View","withPreferredColorScheme","styles","HR","getStylesFromColorScheme","lineStyle","marginLeft","marginRight","textStyle","text","props","renderLine","key","line","lineDark","renderText","renderInner","container","style","HorizontalRule"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["@wordpress/primitives/src/horizontal-rule/index.native.js"],"names":["Text","View","withPreferredColorScheme","styles","HR","getStylesFromColorScheme","lineStyle","marginLeft","marginRight","textStyle","text","props","renderLine","key","line","lineDark","renderText","renderInner","container","style","HorizontalRule"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,IAAT,EAAeC,IAAf,QAA2B,cAA3B;AAEA;AACA;AACA;;AACA,SAASC,wBAAT,QAAyC,oBAAzC;AAEA;AACA;AACA;;AACA,OAAOC,MAAP,MAAmB,eAAnB;;AAEA,MAAMC,EAAE,GAAG,CAAE;AACZC,EAAAA,wBADY;AAEZC,EAAAA,SAFY;AAGZC,EAAAA,UAHY;AAIZC,EAAAA,WAJY;AAKZC,EAAAA,SALY;AAMZC,EAAAA,IANY;AAOZ,KAAGC;AAPS,CAAF,KAQJ;AACN,QAAMC,UAAU,GAAKC,GAAF,IAClB,cAAC,IAAD;AACC,IAAA,GAAG,EAAGA,GADP;AAEC,IAAA,KAAK,EAAGR,wBAAwB,CAAEF,MAAM,CAACW,IAAT,EAAeX,MAAM,CAACY,QAAtB;AAFjC,IADD;;AAOA,QAAMC,UAAU,GAAKH,GAAF,IAClB,cAAC,IAAD;AAAM,IAAA,GAAG,EAAGA;AAAZ,KACC,cAAC,IAAD;AAAM,IAAA,KAAK,EAAG,CAAEV,MAAM,CAACO,IAAT,EAAeD,SAAf;AAAd,KAA6CC,IAA7C,CADD,CADD;;AAMA,QAAMO,WAAW,GAAG,MAAM;AACzB,QAAK,CAAEP,IAAP,EAAc;AACb,aAAOE,UAAU,EAAjB;AACA;;AACD,WAAO,CAAEA,UAAU,CAAE,CAAF,CAAZ,EAAmBI,UAAU,CAAE,CAAF,CAA7B,EAAoCJ,UAAU,CAAE,CAAF,CAA9C,CAAP;AACA,GALD;;AAOA,SACC,cAAC,IAAD;AACC,IAAA,KAAK,EAAG,CACPT,MAAM,CAACe,SADA,EAEP;AAAEX,MAAAA,UAAF;AAAcC,MAAAA;AAAd,KAFO,EAGPG,KAAK,CAACQ,KAHC,CADT;AAAA,OAMMR;AANN,KAQGM,WAAW,EARd,CADD;AAYA,CAzCD;;AA2CA,OAAO,MAAMG,cAAc,GAAGlB,wBAAwB,CAAEE,EAAF,CAA/C","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\ttextStyle,\n\ttext,\n\t...props\n} ) => {\n\tconst renderLine = ( key ) => (\n\t\t<View\n\t\t\tkey={ key }\n\t\t\tstyle={ getStylesFromColorScheme( styles.line, styles.lineDark ) }\n\t\t/>\n\t);\n\n\tconst renderText = ( key ) => (\n\t\t<View key={ key }>\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={ [\n\t\t\t\tstyles.container,\n\t\t\t\t{ marginLeft, marginRight },\n\t\t\t\tprops.style,\n\t\t\t] }\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"]}
|
|
@@ -101,6 +101,7 @@ export const SVG = ({
|
|
|
101
101
|
}; // Disable reason: We need to have a way to render HTML tag for web.
|
|
102
102
|
// eslint-disable-next-line react/forbid-elements
|
|
103
103
|
|
|
104
|
-
return createElement("svg", appliedProps
|
|
104
|
+
return createElement("svg", { ...appliedProps
|
|
105
|
+
});
|
|
105
106
|
};
|
|
106
107
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/primitives/src/svg/index.js"],"names":["classnames","createElement","Circle","props","G","Line","Path","Polygon","Rect","Defs","RadialGradient","LinearGradient","Stop","SVG","className","isPressed","appliedProps","undefined","focusable"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,YAAvB;AAEA;AACA;AACA;;AACA,SAASC,aAAT,QAA8B,oBAA9B;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AACA,OAAO,MAAMC,MAAM,GAAKC,KAAF,IAAaF,aAAa,CAAE,QAAF,EAAYE,KAAZ,CAAzC;AAEP;AACA;AACA;AACA;AACA;;AACA,OAAO,MAAMC,CAAC,GAAKD,KAAF,IAAaF,aAAa,CAAE,GAAF,EAAOE,KAAP,CAApC;AAEP;AACA;AACA;AACA;AACA;;AACA,OAAO,MAAME,IAAI,GAAKF,KAAF,IAAaF,aAAa,CAAE,MAAF,EAAUE,KAAV,CAAvC;AAEP;AACA;AACA;AACA;AACA;;AACA,OAAO,MAAMG,IAAI,GAAKH,KAAF,IAAaF,aAAa,CAAE,MAAF,EAAUE,KAAV,CAAvC;AAEP;AACA;AACA;AACA;AACA;;AACA,OAAO,MAAMI,OAAO,GAAKJ,KAAF,IAAaF,aAAa,CAAE,SAAF,EAAaE,KAAb,CAA1C;AAEP;AACA;AACA;AACA;AACA;;AACA,OAAO,MAAMK,IAAI,GAAKL,KAAF,IAAaF,aAAa,CAAE,MAAF,EAAUE,KAAV,CAAvC;AAEP;AACA;AACA;AACA;AACA;;AACA,OAAO,MAAMM,IAAI,GAAKN,KAAF,IAAaF,aAAa,CAAE,MAAF,EAAUE,KAAV,CAAvC;AAEP;AACA;AACA;AACA;AACA;;AACA,OAAO,MAAMO,cAAc,GAAKP,KAAF,IAC7BF,aAAa,CAAE,gBAAF,EAAoBE,KAApB,CADP;AAGP;AACA;AACA;AACA;AACA;;AACA,OAAO,MAAMQ,cAAc,GAAKR,KAAF,IAC7BF,aAAa,CAAE,gBAAF,EAAoBE,KAApB,CADP;AAGP;AACA;AACA;AACA;AACA;;AACA,OAAO,MAAMS,IAAI,GAAKT,KAAF,IAAaF,aAAa,CAAE,MAAF,EAAUE,KAAV,CAAvC;AAEP;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,MAAMU,GAAG,GAAG,CAAE;AAAEC,EAAAA,SAAF;AAAaC,EAAAA,SAAb;AAAwB,KAAGZ;AAA3B,CAAF,KAA0C;AAC5D,QAAMa,YAAY,GAAG,EACpB,GAAGb,KADiB;AAEpBW,IAAAA,SAAS,EACRd,UAAU,CAAEc,SAAF,EAAa;AAAE,oBAAcC;AAAhB,KAAb,CAAV,IAAwDE,SAHrC;AAIpB,mBAAe,IAJK;AAKpBC,IAAAA,SAAS,EAAE;AALS,GAArB,CAD4D,CAS5D;AACA;;AACA,SAAO,
|
|
1
|
+
{"version":3,"sources":["@wordpress/primitives/src/svg/index.js"],"names":["classnames","createElement","Circle","props","G","Line","Path","Polygon","Rect","Defs","RadialGradient","LinearGradient","Stop","SVG","className","isPressed","appliedProps","undefined","focusable"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,YAAvB;AAEA;AACA;AACA;;AACA,SAASC,aAAT,QAA8B,oBAA9B;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AACA,OAAO,MAAMC,MAAM,GAAKC,KAAF,IAAaF,aAAa,CAAE,QAAF,EAAYE,KAAZ,CAAzC;AAEP;AACA;AACA;AACA;AACA;;AACA,OAAO,MAAMC,CAAC,GAAKD,KAAF,IAAaF,aAAa,CAAE,GAAF,EAAOE,KAAP,CAApC;AAEP;AACA;AACA;AACA;AACA;;AACA,OAAO,MAAME,IAAI,GAAKF,KAAF,IAAaF,aAAa,CAAE,MAAF,EAAUE,KAAV,CAAvC;AAEP;AACA;AACA;AACA;AACA;;AACA,OAAO,MAAMG,IAAI,GAAKH,KAAF,IAAaF,aAAa,CAAE,MAAF,EAAUE,KAAV,CAAvC;AAEP;AACA;AACA;AACA;AACA;;AACA,OAAO,MAAMI,OAAO,GAAKJ,KAAF,IAAaF,aAAa,CAAE,SAAF,EAAaE,KAAb,CAA1C;AAEP;AACA;AACA;AACA;AACA;;AACA,OAAO,MAAMK,IAAI,GAAKL,KAAF,IAAaF,aAAa,CAAE,MAAF,EAAUE,KAAV,CAAvC;AAEP;AACA;AACA;AACA;AACA;;AACA,OAAO,MAAMM,IAAI,GAAKN,KAAF,IAAaF,aAAa,CAAE,MAAF,EAAUE,KAAV,CAAvC;AAEP;AACA;AACA;AACA;AACA;;AACA,OAAO,MAAMO,cAAc,GAAKP,KAAF,IAC7BF,aAAa,CAAE,gBAAF,EAAoBE,KAApB,CADP;AAGP;AACA;AACA;AACA;AACA;;AACA,OAAO,MAAMQ,cAAc,GAAKR,KAAF,IAC7BF,aAAa,CAAE,gBAAF,EAAoBE,KAApB,CADP;AAGP;AACA;AACA;AACA;AACA;;AACA,OAAO,MAAMS,IAAI,GAAKT,KAAF,IAAaF,aAAa,CAAE,MAAF,EAAUE,KAAV,CAAvC;AAEP;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,MAAMU,GAAG,GAAG,CAAE;AAAEC,EAAAA,SAAF;AAAaC,EAAAA,SAAb;AAAwB,KAAGZ;AAA3B,CAAF,KAA0C;AAC5D,QAAMa,YAAY,GAAG,EACpB,GAAGb,KADiB;AAEpBW,IAAAA,SAAS,EACRd,UAAU,CAAEc,SAAF,EAAa;AAAE,oBAAcC;AAAhB,KAAb,CAAV,IAAwDE,SAHrC;AAIpB,mBAAe,IAJK;AAKpBC,IAAAA,SAAS,EAAE;AALS,GAArB,CAD4D,CAS5D;AACA;;AACA,SAAO,0BAAUF;AAAV,IAAP;AACA,CAZM","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { createElement } from '@wordpress/element';\n\n/** @typedef {{isPressed?: boolean} & import('react').ComponentPropsWithoutRef<'svg'>} SVGProps */\n\n/**\n * @param {import('react').ComponentPropsWithoutRef<'circle'>} props\n *\n * @return {JSX.Element} Circle component\n */\nexport const Circle = ( props ) => createElement( 'circle', props );\n\n/**\n * @param {import('react').ComponentPropsWithoutRef<'g'>} props\n *\n * @return {JSX.Element} G component\n */\nexport const G = ( props ) => createElement( 'g', props );\n\n/**\n * @param {import('react').ComponentPropsWithoutRef<'line'>} props\n *\n * @return {JSX.Element} Path component\n */\nexport const Line = ( props ) => createElement( 'line', props );\n\n/**\n * @param {import('react').ComponentPropsWithoutRef<'path'>} props\n *\n * @return {JSX.Element} Path component\n */\nexport const Path = ( props ) => createElement( 'path', props );\n\n/**\n * @param {import('react').ComponentPropsWithoutRef<'polygon'>} props\n *\n * @return {JSX.Element} Polygon component\n */\nexport const Polygon = ( props ) => createElement( 'polygon', props );\n\n/**\n * @param {import('react').ComponentPropsWithoutRef<'rect'>} props\n *\n * @return {JSX.Element} Rect component\n */\nexport const Rect = ( props ) => createElement( 'rect', props );\n\n/**\n * @param {import('react').ComponentPropsWithoutRef<'defs'>} props\n *\n * @return {JSX.Element} Defs component\n */\nexport const Defs = ( props ) => createElement( 'defs', props );\n\n/**\n * @param {import('react').ComponentPropsWithoutRef<'radialGradient'>} props\n *\n * @return {JSX.Element} RadialGradient component\n */\nexport const RadialGradient = ( props ) =>\n\tcreateElement( 'radialGradient', props );\n\n/**\n * @param {import('react').ComponentPropsWithoutRef<'linearGradient'>} props\n *\n * @return {JSX.Element} LinearGradient component\n */\nexport const LinearGradient = ( props ) =>\n\tcreateElement( 'linearGradient', props );\n\n/**\n * @param {import('react').ComponentPropsWithoutRef<'stop'>} props\n *\n * @return {JSX.Element} Stop component\n */\nexport const Stop = ( props ) => createElement( 'stop', props );\n\n/**\n *\n * @param {SVGProps} props isPressed indicates whether the SVG should appear as pressed.\n * Other props will be passed through to svg component.\n *\n * @return {JSX.Element} Stop component\n */\nexport const SVG = ( { className, isPressed, ...props } ) => {\n\tconst appliedProps = {\n\t\t...props,\n\t\tclassName:\n\t\t\tclassnames( className, { 'is-pressed': isPressed } ) || undefined,\n\t\t'aria-hidden': true,\n\t\tfocusable: false,\n\t};\n\n\t// Disable reason: We need to have a way to render HTML tag for web.\n\t// eslint-disable-next-line react/forbid-elements\n\treturn <svg { ...appliedProps } />;\n};\n"]}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
1
|
import { createElement } from "@wordpress/element";
|
|
3
2
|
|
|
4
3
|
/**
|
|
@@ -17,9 +16,10 @@ import { forwardRef } from '@wordpress/element';
|
|
|
17
16
|
|
|
18
17
|
import styles from './style.scss';
|
|
19
18
|
export { Circle, G, Path, Polygon, Rect, Defs, RadialGradient, LinearGradient, Stop, Line } from 'react-native-svg';
|
|
20
|
-
const AnimatedSvg = Animated.createAnimatedComponent(forwardRef((props, ref) => createElement(Svg,
|
|
21
|
-
ref: ref
|
|
22
|
-
|
|
19
|
+
const AnimatedSvg = Animated.createAnimatedComponent(forwardRef((props, ref) => createElement(Svg, {
|
|
20
|
+
ref: ref,
|
|
21
|
+
...props
|
|
22
|
+
})));
|
|
23
23
|
export const SVG = ({
|
|
24
24
|
className = '',
|
|
25
25
|
isPressed,
|
|
@@ -40,10 +40,11 @@ export const SVG = ({
|
|
|
40
40
|
};
|
|
41
41
|
const SvgWrapper = animated ? AnimatedSvg : Svg;
|
|
42
42
|
return createElement(SvgWrapper // We want to re-render when style color is changed.
|
|
43
|
-
,
|
|
43
|
+
, {
|
|
44
44
|
key: appliedProps.style.color,
|
|
45
45
|
height: "100%",
|
|
46
|
-
width: "100%"
|
|
47
|
-
|
|
46
|
+
width: "100%",
|
|
47
|
+
...appliedProps
|
|
48
|
+
});
|
|
48
49
|
};
|
|
49
50
|
//# sourceMappingURL=index.native.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/primitives/src/svg/index.native.js"],"names":["Svg","Animated","forwardRef","styles","Circle","G","Path","Polygon","Rect","Defs","RadialGradient","LinearGradient","Stop","Line","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","color"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["@wordpress/primitives/src/svg/index.native.js"],"names":["Svg","Animated","forwardRef","styles","Circle","G","Path","Polygon","Rect","Defs","RadialGradient","LinearGradient","Stop","Line","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","color"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,GAAT,QAAoB,kBAApB;AACA,SAASC,QAAT,QAAyB,cAAzB;AAEA;AACA;AACA;;AACA,SAASC,UAAT,QAA2B,oBAA3B;AAEA;AACA;AACA;;AACA,OAAOC,MAAP,MAAmB,cAAnB;AAEA,SACCC,MADD,EAECC,CAFD,EAGCC,IAHD,EAICC,OAJD,EAKCC,IALD,EAMCC,IAND,EAOCC,cAPD,EAQCC,cARD,EASCC,IATD,EAUCC,IAVD,QAWO,kBAXP;AAaA,MAAMC,WAAW,GAAGb,QAAQ,CAACc,uBAAT,CACnBb,UAAU,CAAE,CAAEc,KAAF,EAASC,GAAT,KAAkB,cAAC,GAAD;AAAK,EAAA,GAAG,EAAGA,GAAX;AAAA,KAAsBD;AAAtB,EAApB,CADS,CAApB;AAIA,OAAO,MAAME,GAAG,GAAG,CAAE;AACpBC,EAAAA,SAAS,GAAG,EADQ;AAEpBC,EAAAA,SAFoB;AAGpBC,EAAAA,QAAQ,GAAG,KAHS;AAIpB,KAAGL;AAJiB,CAAF,KAKZ;AACN,QAAMM,WAAW,GAAGN,KAAK,CAACM,WAAN,IAAqB,OAAzC;AACA,QAAMC,iBAAiB,GAAGJ,SAAS,CACjCK,KADwB,CACjB,GADiB,EAExBC,GAFwB,CAEjBC,OAAF,IAAevB,MAAM,CAAEuB,OAAF,CAFF,EAGxBC,MAHwB,CAGhBC,OAHgB,CAA1B;AAIA,QAAMC,YAAY,GAAGT,SAAS,GAC3BjB,MAAM,CAAE,YAAF,CADqB,GAE3BA,MAAM,CAAE,iCAAiCmB,WAAnC,CAFT;AAGA,QAAMQ,SAAS,GAAGC,KAAK,CAACC,OAAN,CAAehB,KAAK,CAACiB,KAArB,IACfjB,KAAK,CAACiB,KAAN,CAAYC,MAAZ,CAAoB,CAAEC,GAAF,EAAOC,EAAP,KAAe;AACnC,WAAO,EAAE,GAAGD,GAAL;AAAU,SAAGC;AAAb,KAAP;AACC,GAFD,EAEG,EAFH,CADe,GAIfpB,KAAK,CAACiB,KAJT;AAKA,QAAMI,WAAW,GAAGC,MAAM,CAACC,MAAP,CACnB,EADmB,EAEnBV,YAFmB,EAGnBC,SAHmB,EAInB,GAAGP,iBAJgB,CAApB;AAOA,QAAMiB,YAAY,GAAG,EAAE,GAAGxB,KAAL;AAAYiB,IAAAA,KAAK,EAAEI;AAAnB,GAArB;AAEA,QAAMI,UAAU,GAAGpB,QAAQ,GAAGP,WAAH,GAAiBd,GAA5C;AAEA,SACC,cAAC,UAAD,CACC;AADD;AAEC,IAAA,GAAG,EAAGwC,YAAY,CAACP,KAAb,CAAmBS,KAF1B;AAGC,IAAA,MAAM,EAAC,MAHR;AAIC,IAAA,KAAK,EAAC,MAJP;AAAA,OAKMF;AALN,IADD;AASA,CAvCM","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';\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} 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 = props.colorScheme || 'light';\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' ]\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"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/primitives",
|
|
3
|
-
"version": "3.33.
|
|
3
|
+
"version": "3.33.2",
|
|
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.12.
|
|
34
|
+
"@wordpress/element": "^5.12.2",
|
|
35
35
|
"classnames": "^2.3.1"
|
|
36
36
|
},
|
|
37
37
|
"publishConfig": {
|
|
38
38
|
"access": "public"
|
|
39
39
|
},
|
|
40
|
-
"gitHead": "
|
|
40
|
+
"gitHead": "86d483d54c987f4d324a760deacb0af29fff8332"
|
|
41
41
|
}
|