Socket
Socket
Sign inDemoInstall

react-tradingview-widget

Package Overview
Dependencies
8
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.2.2 to 1.2.3

yarn-error.log

5

CHANGELOG.md

@@ -0,1 +1,6 @@

# Version 1.2.3
Released 2018-03-21
- Fixed a bug that caused the component to break when multiple instances were created
# Version 1.2.2

@@ -2,0 +7,0 @@ Released 2018-01-21

2

dist/index.js

@@ -1,1 +0,1 @@

!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["react-tradingview-widget"]=t():e["react-tradingview-widget"]=t()}("undefined"!=typeof self?self:this,function(){return webpackJsonpreact_tradingview_widget([1],[,function(e,t,n){"use strict";function o(e,t){var n={};for(var o in e)t.indexOf(o)>=0||Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o]);return n}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0}),n.d(t,"IntervalTypes",function(){return d}),n.d(t,"Themes",function(){return f}),n.d(t,"BarStyles",function(){return g});var p=n(2),l=n.n(p),s=n(6),u=n.n(s),c=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},d={D:"D",W:"W"},f={LIGHT:"Light",DARK:"Dark"},g={BARS:"0",CANDLES:"1",HOLLOW_CANDLES:"9",HEIKIN_ASHI:"8",LINE:"2",AREA:"3",RENKO:"4",LINE_BREAK:"7",KAGI:"5",POINT_AND_FIGURE:"6"},h="tradingview-widget-script",y="tradingview-widget",b=function(e){function t(){var e,n,a,p;i(this,t);for(var s=arguments.length,u=Array(s),d=0;d<s;d++)u[d]=arguments[d];return n=a=r(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(u))),a.state={containerStyle:{}},a.componentDidMount=function(){return a.appendScript(a.initWidget)},a.componentDidUpdate=function(){a.cleanWidget(),a.initWidget()},a.appendScript=function(e){if(a.scriptExists())return void e();var t=document.createElement("script");t.id=h,t.type="text/javascript",t.async=!0,t.src="https://s3.tradingview.com/tv.js",t.onload=e,document.getElementsByTagName("head")[0].appendChild(t)},a.scriptExists=function(){return null!==document.getElementById(h)},a.initWidget=function(){var e=a.props,t=e.widgetType,n=o(e,["widgetType"]),i=c({},n,{container_id:y});if(i.autosize){delete i.width,delete i.height;var r=document.getElementById(y);r.style.width="100%",r.style.height="100%"}"number"==typeof i.interval&&(i.interval=i.interval.toString()),i.popup_width&&"number"==typeof i.popup_width&&(i.popup_width=i.popup_width.toString()),i.popup_height&&"number"==typeof i.popup_height&&(i.popup_height=i.popup_height.toString()),new TradingView[t](i)},a.cleanWidget=function(){document.getElementById(y).innerHTML=""},a.render=function(){return l.a.createElement("article",{id:y})},p=n,r(a,p)}return a(t,e),t}(p.PureComponent);b.propTypes={widgetType:u.a.string,width:u.a.number,height:u.a.number,autosize:u.a.bool,symbol:u.a.string.isRequired,interval:u.a.oneOf([1,3,5,15,30,60,120,180,"1","3","5","15","30","60","120","180",d.D,d.W]),timezone:u.a.string,theme:u.a.oneOf([f.LIGHT,f.DARK]),style:u.a.oneOf([g.BARS,g.CANDLES,g.HOLLOW_CANDLES,g.HEIKIN_ASHI,g.LINE,g.AREA,g.RENKO,g.LINE_BREAK,g.KAGI,g.POINT_AND_FIGURE]),locale:u.a.string,toolbar_bg:u.a.string,enable_publishing:u.a.bool,allow_symbol_change:u.a.bool,withdateranges:u.a.bool,hide_side_toolbar:u.a.bool,hideideas:u.a.bool,watchlist:u.a.arrayOf(u.a.string),details:u.a.bool,hotlist:u.a.bool,calendar:u.a.bool,news:u.a.arrayOf(u.a.string),studies:u.a.arrayOf(u.a.string),show_popup_button:u.a.bool,popup_width:u.a.oneOfType([u.a.number,u.a.string]),popup_height:u.a.oneOfType([u.a.number,u.a.string]),no_referral_id:u.a.bool,referral_id:u.a.string},b.defaultProps={widgetType:"widget",width:980,height:610,autosize:!1,interval:d.D,timezone:"Etc/UTC",theme:f.LIGHT,style:g.CANDLES,locale:"en",toolbar_bg:"#F1F3F6",enable_publishing:!1,allow_symbol_change:!0,hideideas:!0},t.default=b}],[1])});
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["react-tradingview-widget"]=t():e["react-tradingview-widget"]=t()}("undefined"!=typeof self?self:this,function(){return webpackJsonpreact_tradingview_widget([1],[,function(e,t,n){"use strict";function i(e,t){var n={};for(var i in e)t.indexOf(i)>=0||Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i]);return n}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0}),n.d(t,"IntervalTypes",function(){return s}),n.d(t,"Themes",function(){return f}),n.d(t,"BarStyles",function(){return g});var p=n(2),d=n.n(p),l=n(6),u=n.n(l),c=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},s={D:"D",W:"W"},f={LIGHT:"Light",DARK:"Dark"},g={BARS:"0",CANDLES:"1",HOLLOW_CANDLES:"9",HEIKIN_ASHI:"8",LINE:"2",AREA:"3",RENKO:"4",LINE_BREAK:"7",KAGI:"5",POINT_AND_FIGURE:"6"},h="tradingview-widget-script",y="tradingview-widget",b=function(e){function t(){var e,n,a,p;o(this,t);for(var l=arguments.length,u=Array(l),s=0;s<l;s++)u[s]=arguments[s];return n=a=r(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(u))),a.containerId=y+"-"+Math.random(),a.componentDidMount=function(){return a.appendScript(a.initWidget)},a.componentDidUpdate=function(){a.cleanWidget(),a.initWidget()},a.appendScript=function(e){if(a.scriptExists())return"undefined"==typeof TradingView?void a.updateOnloadListener(e):void e();var t=document.createElement("script");t.id=h,t.type="text/javascript",t.async=!0,t.src="https://s3.tradingview.com/tv.js",t.onload=e,document.getElementsByTagName("head")[0].appendChild(t)},a.getScriptElement=function(){return document.getElementById(h)},a.scriptExists=function(){return null!==a.getScriptElement()},a.updateOnloadListener=function(e){var t=a.getScriptElement(),n=t.onload;return t.onload=function(){n(),e()}},a.initWidget=function(){if("undefined"!=typeof TradingView){var e=a.props,t=e.widgetType,n=i(e,["widgetType"]),o=c({},n,{container_id:a.containerId});if(o.autosize){delete o.width,delete o.height;var r=document.getElementById(a.containerId);r.style.width="100%",r.style.height="100%"}"number"==typeof o.interval&&(o.interval=o.interval.toString()),o.popup_width&&"number"==typeof o.popup_width&&(o.popup_width=o.popup_width.toString()),o.popup_height&&"number"==typeof o.popup_height&&(o.popup_height=o.popup_height.toString()),new TradingView[t](o)}},a.cleanWidget=function(){document.getElementById(a.containerId).innerHTML=""},a.render=function(){return d.a.createElement("article",{id:a.containerId})},p=n,r(a,p)}return a(t,e),t}(p.PureComponent);b.propTypes={widgetType:u.a.string,width:u.a.number,height:u.a.number,autosize:u.a.bool,symbol:u.a.string.isRequired,interval:u.a.oneOf([1,3,5,15,30,60,120,180,"1","3","5","15","30","60","120","180",s.D,s.W]),timezone:u.a.string,theme:u.a.oneOf([f.LIGHT,f.DARK]),style:u.a.oneOf([g.BARS,g.CANDLES,g.HOLLOW_CANDLES,g.HEIKIN_ASHI,g.LINE,g.AREA,g.RENKO,g.LINE_BREAK,g.KAGI,g.POINT_AND_FIGURE]),locale:u.a.string,toolbar_bg:u.a.string,enable_publishing:u.a.bool,allow_symbol_change:u.a.bool,withdateranges:u.a.bool,hide_side_toolbar:u.a.bool,hideideas:u.a.bool,watchlist:u.a.arrayOf(u.a.string),details:u.a.bool,hotlist:u.a.bool,calendar:u.a.bool,news:u.a.arrayOf(u.a.string),studies:u.a.arrayOf(u.a.string),show_popup_button:u.a.bool,popup_width:u.a.oneOfType([u.a.number,u.a.string]),popup_height:u.a.oneOfType([u.a.number,u.a.string]),no_referral_id:u.a.bool,referral_id:u.a.string},b.defaultProps={widgetType:"widget",width:980,height:610,autosize:!1,interval:s.D,timezone:"Etc/UTC",theme:f.LIGHT,style:g.CANDLES,locale:"en",toolbar_bg:"#F1F3F6",enable_publishing:!1,allow_symbol_change:!0,hideideas:!0},t.default=b}],[1])});
{
"name": "react-tradingview-widget",
"version": "1.2.2",
"version": "1.2.3",
"description": "React component for rendering the TradingView Advanced Real-Time Chart Widget",

@@ -36,3 +36,3 @@ "repository": {

"babel-loader": "^7.1.2",
"babel-preset-es2015": "^6.24.1",
"babel-preset-env": "^1.6.1",
"babel-preset-react": "^6.24.1",

@@ -44,2 +44,3 @@ "babel-preset-stage-0": "^6.24.1",

"jest": "^21.2.1",
"jest-cli": "^23.0.0-alpha.0",
"react": "^16.2.0",

@@ -46,0 +47,0 @@ "react-dom": "^16.2.0",

@@ -29,3 +29,3 @@ import path from 'path';

babelrc: false,
presets: [['es2015', { modules: false }], 'react', 'stage-0']
presets: [['env', { modules: false }], 'react', 'stage-0']
}

@@ -42,4 +42,4 @@ }

//CommonChunksPlugin will now extract all the common modules from vendor and main bundles
//https://medium.com/@adamrackis/vendor-and-code-splitting-in-webpack-2-6376358f1923
// CommonChunksPlugin will now extract all the common modules from vendor and main bundles
// https://medium.com/@adamrackis/vendor-and-code-splitting-in-webpack-2-6376358f1923
new webpack.optimize.CommonsChunkPlugin({

@@ -46,0 +46,0 @@ name: 'vendor',

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc