Comparing version 0.0.190 to 0.0.191
@@ -62,9 +62,9 @@ "use strict"; | ||
_createClass(Text, [{ | ||
key: "componentWillMount", | ||
value: function componentWillMount() { | ||
key: "UNSAFE_componentWillMount", | ||
value: function UNSAFE_componentWillMount() { | ||
this.updateWordsByLines(this.props, true); | ||
} | ||
}, { | ||
key: "componentWillReceiveProps", | ||
value: function componentWillReceiveProps(nextProps) { | ||
key: "UNSAFE_componentWillReceiveProps", | ||
value: function UNSAFE_componentWillReceiveProps(nextProps) { | ||
var needCalculate = this.props.children !== nextProps.children || this.props.style !== nextProps.style; | ||
@@ -71,0 +71,0 @@ this.updateWordsByLines(nextProps, needCalculate); |
@@ -1031,9 +1031,9 @@ import PropTypes from 'prop-types'; | ||
_createClass(Text, [{ | ||
key: "componentWillMount", | ||
value: function componentWillMount() { | ||
key: "UNSAFE_componentWillMount", | ||
value: function UNSAFE_componentWillMount() { | ||
this.updateWordsByLines(this.props, true); | ||
} | ||
}, { | ||
key: "componentWillReceiveProps", | ||
value: function componentWillReceiveProps(nextProps) { | ||
key: "UNSAFE_componentWillReceiveProps", | ||
value: function UNSAFE_componentWillReceiveProps(nextProps) { | ||
var needCalculate = this.props.children !== nextProps.children || this.props.style !== nextProps.style; | ||
@@ -1040,0 +1040,0 @@ this.updateWordsByLines(nextProps, needCalculate); |
@@ -1,1 +0,1 @@ | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("prop-types"),require("react"),require("reduce-css-calc")):"function"==typeof define&&define.amd?define(["exports","prop-types","react","reduce-css-calc"],e):e(t.vx=t.vx||{},t.PropTypes,t.React,t.reduceCSSCalc)}(this,function(t,e,i,O){"use strict";e=e&&e.hasOwnProperty("default")?e.default:e;var m="default"in i?i.default:i;function a(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function j(){return(j=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t}).apply(this,arguments)}function c(t){return(c=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function s(t,e){return(s=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function x(t,e){if(null==t)return{};var r,n,o=function(t,e){if(null==t)return{};var r,n,o={},i=Object.keys(t);for(n=0;n<i.length;n++)r=i[n],0<=e.indexOf(r)||(o[r]=t[r]);return o}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(n=0;n<i.length;n++)r=i[n],0<=e.indexOf(r)||Object.prototype.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}function u(t,e){return!e||"object"!=typeof e&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}O=O&&O.hasOwnProperty("default")?O.default:O;var r="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n="object"==typeof r&&r&&r.Object===Object&&r,o="object"==typeof self&&self&&self.Object===Object&&self,l=n||o||Function("return this")(),p=l.Symbol,h=Object.prototype,f=h.hasOwnProperty,d=h.toString,y=p?p.toStringTag:void 0;var v=function(t){var e=f.call(t,y),r=t[y];try{t[y]=void 0}catch(t){}var n=d.call(t);return e?t[y]=r:delete t[y],n},_=Object.prototype.toString;var g=function(t){return _.call(t)},b=p?p.toStringTag:void 0;var w=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":b&&b in Object(t)?v(t):g(t)};var S=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)};var T,P=function(t){if(!S(t))return!1;var e=w(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e},W=l["__core-js_shared__"],C=(T=/[^.]+$/.exec(W&&W.keys&&W.keys.IE_PROTO||""))?"Symbol(src)_1."+T:"";var A=function(t){return!!C&&C in t},E=Function.prototype.toString;var k=function(t){if(null!=t){try{return E.call(t)}catch(t){}try{return t+""}catch(t){}}return""},z=/^\[object .+?Constructor\]$/,F=Function.prototype,B=Object.prototype,L=F.toString,H=B.hasOwnProperty,R=RegExp("^"+L.call(H).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var $=function(t){return!(!S(t)||A(t))&&(P(t)?R:z).test(k(t))};var N=function(t,e){return null==t?void 0:t[e]};var q=function(t,e){var r=N(t,e);return $(r)?r:void 0},I=q(Object,"create");var M=function(){this.__data__=I?I(null):{},this.size=0};var G=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},J=Object.prototype.hasOwnProperty;var U=function(t){var e=this.__data__;if(I){var r=e[t];return"__lodash_hash_undefined__"===r?void 0:r}return J.call(e,t)?e[t]:void 0},D=Object.prototype.hasOwnProperty;var K=function(t){var e=this.__data__;return I?void 0!==e[t]:D.call(e,t)};var Q=function(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=I&&void 0===e?"__lodash_hash_undefined__":e,this};function V(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}V.prototype.clear=M,V.prototype.delete=G,V.prototype.get=U,V.prototype.has=K,V.prototype.set=Q;var X=V;var Y=function(){this.__data__=[],this.size=0};var Z=function(t,e){return t===e||t!=t&&e!=e};var tt=function(t,e){for(var r=t.length;r--;)if(Z(t[r][0],e))return r;return-1},et=Array.prototype.splice;var rt=function(t){var e=this.__data__,r=tt(e,t);return!(r<0||(r==e.length-1?e.pop():et.call(e,r,1),--this.size,0))};var nt=function(t){var e=this.__data__,r=tt(e,t);return r<0?void 0:e[r][1]};var ot=function(t){return-1<tt(this.__data__,t)};var it=function(t,e){var r=this.__data__,n=tt(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this};function at(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}at.prototype.clear=Y,at.prototype.delete=rt,at.prototype.get=nt,at.prototype.has=ot,at.prototype.set=it;var ct=at,st=q(l,"Map");var ut=function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t};var lt=function(t,e){var r=t.__data__;return ut(e)?r["string"==typeof e?"string":"hash"]:r.map};var pt=function(t){var e=lt(this,t).delete(t);return this.size-=e?1:0,e};var ht=function(t){return lt(this,t).get(t)};var ft=function(t){return lt(this,t).has(t)};var dt=function(t,e){var r=lt(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this};function yt(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}yt.prototype.clear=function(){this.size=0,this.__data__={hash:new X,map:new(st||ct),string:new X}},yt.prototype.delete=pt,yt.prototype.get=ht,yt.prototype.has=ft,yt.prototype.set=dt;var vt=yt,_t="Expected a function";function gt(o,i){if("function"!=typeof o||null!=i&&"function"!=typeof i)throw new TypeError(_t);var a=function(){var t=arguments,e=i?i.apply(this,t):t[0],r=a.cache;if(r.has(e))return r.get(e);var n=o.apply(this,t);return a.cache=r.set(e,n)||r,n};return a.cache=new(gt.Cache||vt),a}gt.Cache=vt;var bt="__react_svg_text_measurement_id";var wt=gt(function(t,e){try{var r=document.getElementById(bt);if(!r){var n=document.createElementNS("http://www.w3.org/2000/svg","svg");n.style.width=0,n.style.height=0,n.style.position="absolute",n.style.top="-100%",n.style.left="-100%",(r=document.createElementNS("http://www.w3.org/2000/svg","text")).setAttribute("id",bt),n.appendChild(r),document.body.appendChild(n)}return Object.assign(r.style,e),r.textContent=t,r.getComputedTextLength()}catch(t){return null}},function(t,e){return"".concat(t,"_").concat(JSON.stringify(e))}),Ot=function(t){function r(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,r),(e=u(this,c(r).call(this,t))).state={wordsByLines:[]},e}var e,n,o;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&s(t,e)}(r,i.Component),e=r,(n=[{key:"componentWillMount",value:function(){this.updateWordsByLines(this.props,!0)}},{key:"componentWillReceiveProps",value:function(t){var e=this.props.children!==t.children||this.props.style!==t.style;this.updateWordsByLines(t,e)}},{key:"updateWordsByLines",value:function(e,t){if(e.width||e.scaleToFit){if(t){var r=e.children?e.children.toString().split(/(?:(?!\u00A0+)\s+)/):[];this.wordsWithComputedWidth=r.map(function(t){return{word:t,width:wt(t,e.style)}}),this.spaceWidth=wt(" ",e.style)}var n=this.calculateWordsByLines(this.wordsWithComputedWidth,this.spaceWidth,e.width);this.setState({wordsByLines:n})}else this.updateWordsWithoutCalculate(e)}},{key:"updateWordsWithoutCalculate",value:function(t){var e=t.children?t.children.toString().split(/(?:(?!\u00A0+)\s+)/):[];this.setState({wordsByLines:[{words:e}]})}},{key:"calculateWordsByLines",value:function(t,a,c){var s=this.props.scaleToFit;return t.reduce(function(t,e){var r=e.word,n=e.width,o=t[t.length-1];if(o&&(null==c||s||o.width+n+a<c))o.words.push(r),o.width+=n+a;else{var i={words:[r],width:n};t.push(i)}return t},[])}},{key:"render",value:function(){var r,t=this.props,e=t.dx,n=t.dy,o=t.textAnchor,i=t.verticalAnchor,a=t.scaleToFit,c=t.angle,s=t.lineHeight,u=t.capHeight,l=t.innerRef,p=x(t,["dx","dy","textAnchor","verticalAnchor","scaleToFit","angle","lineHeight","capHeight","innerRef"]),h=this.state.wordsByLines,f=p.x,d=p.y;switch(i){case"start":r=O("calc(".concat(u,")"));break;case"middle":r=O("calc(".concat((h.length-1)/2," * -").concat(s," + (").concat(u," / 2))"));break;default:r=O("calc(".concat(h.length-1," * -").concat(s,")"))}var y=[];if(a&&h.length){var v=h[0].width,_=this.props.width/v,g=_,b=f-_*f,w=d-g*d;y.push("matrix(".concat(_,", 0, 0, ").concat(g,", ").concat(b,", ").concat(w,")"))}return c&&y.push("rotate(".concat(c,", ").concat(f,", ").concat(d,")")),y.length&&(p.transform=y.join(" ")),m.createElement("svg",{ref:l,x:e,y:n,fontSize:p.fontSize,style:{overflow:"visible"}},m.createElement("text",j({},p,{textAnchor:o}),h.map(function(t,e){return m.createElement("tspan",{x:f,dy:0===e?r:s,key:e},t.words.join(" "))})))}}])&&a(e.prototype,n),o&&a(e,o),r}();Ot.defaultProps={x:0,y:0,dx:0,dy:0,lineHeight:"1em",capHeight:"0.71em",scaleToFit:!1,textAnchor:"start",verticalAnchor:"end"},Ot.propTypes={scaleToFit:e.bool,angle:e.number,textAnchor:e.oneOf(["start","middle","end","inherit"]),verticalAnchor:e.oneOf(["start","middle","end"]),style:e.object,innerRef:e.oneOfType([e.func,e.object]),x:e.oneOfType([e.number,e.string]),y:e.oneOfType([e.number,e.string]),dx:e.oneOfType([e.number,e.string]),dy:e.oneOfType([e.number,e.string]),lineHeight:e.oneOfType([e.number,e.string]),capHeight:e.oneOfType([e.number,e.string])},t.Text=Ot,t.getStringWidth=wt,Object.defineProperty(t,"__esModule",{value:!0})}); | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("prop-types"),require("react"),require("reduce-css-calc")):"function"==typeof define&&define.amd?define(["exports","prop-types","react","reduce-css-calc"],e):e(t.vx=t.vx||{},t.PropTypes,t.React,t.reduceCSSCalc)}(this,function(t,e,i,O){"use strict";e=e&&e.hasOwnProperty("default")?e.default:e;var m="default"in i?i.default:i;function a(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function j(){return(j=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t}).apply(this,arguments)}function c(t){return(c=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function s(t,e){return(s=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function x(t,e){if(null==t)return{};var r,n,o=function(t,e){if(null==t)return{};var r,n,o={},i=Object.keys(t);for(n=0;n<i.length;n++)r=i[n],0<=e.indexOf(r)||(o[r]=t[r]);return o}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(n=0;n<i.length;n++)r=i[n],0<=e.indexOf(r)||Object.prototype.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}function u(t,e){return!e||"object"!=typeof e&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}O=O&&O.hasOwnProperty("default")?O.default:O;var r="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n="object"==typeof r&&r&&r.Object===Object&&r,o="object"==typeof self&&self&&self.Object===Object&&self,l=n||o||Function("return this")(),p=l.Symbol,h=Object.prototype,f=h.hasOwnProperty,d=h.toString,y=p?p.toStringTag:void 0;var v=function(t){var e=f.call(t,y),r=t[y];try{t[y]=void 0}catch(t){}var n=d.call(t);return e?t[y]=r:delete t[y],n},_=Object.prototype.toString;var g=function(t){return _.call(t)},b=p?p.toStringTag:void 0;var w=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":b&&b in Object(t)?v(t):g(t)};var S=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)};var T,P=function(t){if(!S(t))return!1;var e=w(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e},W=l["__core-js_shared__"],A=(T=/[^.]+$/.exec(W&&W.keys&&W.keys.IE_PROTO||""))?"Symbol(src)_1."+T:"";var E=function(t){return!!A&&A in t},C=Function.prototype.toString;var F=function(t){if(null!=t){try{return C.call(t)}catch(t){}try{return t+""}catch(t){}}return""},k=/^\[object .+?Constructor\]$/,z=Function.prototype,B=Object.prototype,L=z.toString,H=B.hasOwnProperty,R=RegExp("^"+L.call(H).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var N=function(t){return!(!S(t)||E(t))&&(P(t)?R:k).test(F(t))};var $=function(t,e){return null==t?void 0:t[e]};var q=function(t,e){var r=$(t,e);return N(r)?r:void 0},I=q(Object,"create");var M=function(){this.__data__=I?I(null):{},this.size=0};var U=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},G=Object.prototype.hasOwnProperty;var J=function(t){var e=this.__data__;if(I){var r=e[t];return"__lodash_hash_undefined__"===r?void 0:r}return G.call(e,t)?e[t]:void 0},D=Object.prototype.hasOwnProperty;var K=function(t){var e=this.__data__;return I?void 0!==e[t]:D.call(e,t)};var Q=function(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=I&&void 0===e?"__lodash_hash_undefined__":e,this};function V(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}V.prototype.clear=M,V.prototype.delete=U,V.prototype.get=J,V.prototype.has=K,V.prototype.set=Q;var X=V;var Y=function(){this.__data__=[],this.size=0};var Z=function(t,e){return t===e||t!=t&&e!=e};var tt=function(t,e){for(var r=t.length;r--;)if(Z(t[r][0],e))return r;return-1},et=Array.prototype.splice;var rt=function(t){var e=this.__data__,r=tt(e,t);return!(r<0||(r==e.length-1?e.pop():et.call(e,r,1),--this.size,0))};var nt=function(t){var e=this.__data__,r=tt(e,t);return r<0?void 0:e[r][1]};var ot=function(t){return-1<tt(this.__data__,t)};var it=function(t,e){var r=this.__data__,n=tt(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this};function at(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}at.prototype.clear=Y,at.prototype.delete=rt,at.prototype.get=nt,at.prototype.has=ot,at.prototype.set=it;var ct=at,st=q(l,"Map");var ut=function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t};var lt=function(t,e){var r=t.__data__;return ut(e)?r["string"==typeof e?"string":"hash"]:r.map};var pt=function(t){var e=lt(this,t).delete(t);return this.size-=e?1:0,e};var ht=function(t){return lt(this,t).get(t)};var ft=function(t){return lt(this,t).has(t)};var dt=function(t,e){var r=lt(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this};function yt(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}yt.prototype.clear=function(){this.size=0,this.__data__={hash:new X,map:new(st||ct),string:new X}},yt.prototype.delete=pt,yt.prototype.get=ht,yt.prototype.has=ft,yt.prototype.set=dt;var vt=yt,_t="Expected a function";function gt(o,i){if("function"!=typeof o||null!=i&&"function"!=typeof i)throw new TypeError(_t);var a=function(){var t=arguments,e=i?i.apply(this,t):t[0],r=a.cache;if(r.has(e))return r.get(e);var n=o.apply(this,t);return a.cache=r.set(e,n)||r,n};return a.cache=new(gt.Cache||vt),a}gt.Cache=vt;var bt="__react_svg_text_measurement_id";var wt=gt(function(t,e){try{var r=document.getElementById(bt);if(!r){var n=document.createElementNS("http://www.w3.org/2000/svg","svg");n.style.width=0,n.style.height=0,n.style.position="absolute",n.style.top="-100%",n.style.left="-100%",(r=document.createElementNS("http://www.w3.org/2000/svg","text")).setAttribute("id",bt),n.appendChild(r),document.body.appendChild(n)}return Object.assign(r.style,e),r.textContent=t,r.getComputedTextLength()}catch(t){return null}},function(t,e){return"".concat(t,"_").concat(JSON.stringify(e))}),Ot=function(t){function r(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,r),(e=u(this,c(r).call(this,t))).state={wordsByLines:[]},e}var e,n,o;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&s(t,e)}(r,i.Component),e=r,(n=[{key:"UNSAFE_componentWillMount",value:function(){this.updateWordsByLines(this.props,!0)}},{key:"UNSAFE_componentWillReceiveProps",value:function(t){var e=this.props.children!==t.children||this.props.style!==t.style;this.updateWordsByLines(t,e)}},{key:"updateWordsByLines",value:function(e,t){if(e.width||e.scaleToFit){if(t){var r=e.children?e.children.toString().split(/(?:(?!\u00A0+)\s+)/):[];this.wordsWithComputedWidth=r.map(function(t){return{word:t,width:wt(t,e.style)}}),this.spaceWidth=wt(" ",e.style)}var n=this.calculateWordsByLines(this.wordsWithComputedWidth,this.spaceWidth,e.width);this.setState({wordsByLines:n})}else this.updateWordsWithoutCalculate(e)}},{key:"updateWordsWithoutCalculate",value:function(t){var e=t.children?t.children.toString().split(/(?:(?!\u00A0+)\s+)/):[];this.setState({wordsByLines:[{words:e}]})}},{key:"calculateWordsByLines",value:function(t,a,c){var s=this.props.scaleToFit;return t.reduce(function(t,e){var r=e.word,n=e.width,o=t[t.length-1];if(o&&(null==c||s||o.width+n+a<c))o.words.push(r),o.width+=n+a;else{var i={words:[r],width:n};t.push(i)}return t},[])}},{key:"render",value:function(){var r,t=this.props,e=t.dx,n=t.dy,o=t.textAnchor,i=t.verticalAnchor,a=t.scaleToFit,c=t.angle,s=t.lineHeight,u=t.capHeight,l=t.innerRef,p=x(t,["dx","dy","textAnchor","verticalAnchor","scaleToFit","angle","lineHeight","capHeight","innerRef"]),h=this.state.wordsByLines,f=p.x,d=p.y;switch(i){case"start":r=O("calc(".concat(u,")"));break;case"middle":r=O("calc(".concat((h.length-1)/2," * -").concat(s," + (").concat(u," / 2))"));break;default:r=O("calc(".concat(h.length-1," * -").concat(s,")"))}var y=[];if(a&&h.length){var v=h[0].width,_=this.props.width/v,g=_,b=f-_*f,w=d-g*d;y.push("matrix(".concat(_,", 0, 0, ").concat(g,", ").concat(b,", ").concat(w,")"))}return c&&y.push("rotate(".concat(c,", ").concat(f,", ").concat(d,")")),y.length&&(p.transform=y.join(" ")),m.createElement("svg",{ref:l,x:e,y:n,fontSize:p.fontSize,style:{overflow:"visible"}},m.createElement("text",j({},p,{textAnchor:o}),h.map(function(t,e){return m.createElement("tspan",{x:f,dy:0===e?r:s,key:e},t.words.join(" "))})))}}])&&a(e.prototype,n),o&&a(e,o),r}();Ot.defaultProps={x:0,y:0,dx:0,dy:0,lineHeight:"1em",capHeight:"0.71em",scaleToFit:!1,textAnchor:"start",verticalAnchor:"end"},Ot.propTypes={scaleToFit:e.bool,angle:e.number,textAnchor:e.oneOf(["start","middle","end","inherit"]),verticalAnchor:e.oneOf(["start","middle","end"]),style:e.object,innerRef:e.oneOfType([e.func,e.object]),x:e.oneOfType([e.number,e.string]),y:e.oneOfType([e.number,e.string]),dx:e.oneOfType([e.number,e.string]),dy:e.oneOfType([e.number,e.string]),lineHeight:e.oneOfType([e.number,e.string]),capHeight:e.oneOfType([e.number,e.string])},t.Text=Ot,t.getStringWidth=wt,Object.defineProperty(t,"__esModule",{value:!0})}); |
{ | ||
"name": "@vx/text", | ||
"version": "0.0.190", | ||
"version": "0.0.191", | ||
"description": "vx text", | ||
@@ -39,4 +39,4 @@ "sideEffects": false, | ||
"classnames": "^2.2.5", | ||
"lodash": "^4.17.4", | ||
"prop-types": "^15.6.2", | ||
"lodash": "^4.17.15", | ||
"prop-types": "^15.7.2", | ||
"reduce-css-calc": "^1.3.0" | ||
@@ -74,5 +74,5 @@ }, | ||
"raf": "^3.4.0", | ||
"react": "^16.0.0", | ||
"react-dom": "^16.0.0", | ||
"react-test-renderer": "^16.0.0", | ||
"react": "^16.9.0", | ||
"react-dom": "^16.9.0", | ||
"react-test-renderer": "^16.9.0", | ||
"rollup": "^0.67.4", | ||
@@ -86,3 +86,3 @@ "rollup-plugin-babel": "^4.0.1", | ||
"peerDependencies": { | ||
"react": "^15.0.0-0 || ^16.0.0-0" | ||
"react": "^16.3.0-0" | ||
}, | ||
@@ -89,0 +89,0 @@ "publishConfig": { |
59914
Updatedlodash@^4.17.15
Updatedprop-types@^15.7.2