demoup-react
Advanced tools
Comparing version 0.1.25 to 0.2.0
@@ -5,86 +5,45 @@ "use strict"; | ||
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } | ||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } | ||
var React = require("react"); | ||
var config = require("./config"); | ||
var classNames = require("classnames"); | ||
var createClass = require('create-react-class'); | ||
var scriptLoader = require("load-script"); | ||
var window = require("global/window"); | ||
module.exports = function (scope) { | ||
var Button = function (_React$PureComponent) { | ||
_inherits(Button, _React$PureComponent); | ||
return createClass({ | ||
defaultProps: { | ||
nodeAttrs: [], | ||
scope: scope | ||
}, | ||
function Button(props) { | ||
_classCallCheck(this, Button); | ||
componentDidMount: function () { | ||
var t = this; | ||
var _this = _possibleConstructorReturn(this, (Button.__proto__ || Object.getPrototypeOf(Button)).call(this, props)); | ||
if (window.DemoUpPlaybuttonRenderer) { | ||
window.DemoUpPlaybuttonRenderer(t.$container, t.props); | ||
} else { | ||
scriptLoader(config.stage2Path(scope), function () { | ||
window.DemoUpPlaybuttonRenderer && window.DemoUpPlaybuttonRenderer(t.$container, t.props); | ||
}); | ||
} | ||
}, | ||
_this.setRef = _this.setRef.bind(_this); | ||
return _this; | ||
} | ||
componentWillUnmount: function () { | ||
document.dispatchEvent(new CustomEvent('demoup.unmounted')); | ||
}, | ||
_createClass(Button, [{ | ||
key: "componentDidMount", | ||
value: function componentDidMount() { | ||
var t = this; | ||
var props = _extends({}, t.props); | ||
if (window.DemoUpPlaybuttonRenderer) { | ||
window.DemoUpPlaybuttonRenderer(t.$container, props); | ||
} else { | ||
scriptLoader(config.stage2Path(scope), function () { | ||
t.forceUpdate(function () { | ||
window.DemoUpPlaybuttonRenderer && window.DemoUpPlaybuttonRenderer(t.$container, props); | ||
}); | ||
}); | ||
} | ||
} | ||
}, { | ||
key: "componentWillUnmount", | ||
value: function componentWillUnmount() { | ||
var CrossCustomEvent = require("customevent"); | ||
document.dispatchEvent(new CrossCustomEvent("demoup.unmounted", { | ||
detail: { | ||
node: this.$container | ||
} | ||
})); | ||
} | ||
}, { | ||
key: "setRef", | ||
value: function setRef(node) { | ||
this.$container = node; | ||
} | ||
}, { | ||
key: "render", | ||
value: function render() { | ||
var props = this.props; | ||
return React.createElement( | ||
"div", | ||
_extends({}, props.nodeAttrs, { | ||
className: classNames("demoup-trigger", props.className), | ||
id: "demoup_stage2_script", | ||
ref: this.setRef, | ||
src: config.stage3Path(scope) | ||
}), | ||
window && window.DemoUpPlaybuttonRenderer ? null : props.children | ||
); | ||
} | ||
}]); | ||
setRef: function (node) { | ||
this.$container = node; | ||
}, | ||
return Button; | ||
}(React.PureComponent); | ||
Button.defaultProps = { | ||
nodeAttrs: [], | ||
scope: scope | ||
}; | ||
return Button; | ||
render: function () { | ||
var props = this.props; | ||
return React.createElement("div", _extends({}, props.nodeAttrs, { | ||
className: classNames("demoup-trigger", props.className), | ||
id: "demoup_stage2_script", | ||
ref: this.setRef, | ||
src: config.stage3Path(scope) | ||
})); | ||
} | ||
}); | ||
}; |
@@ -1,25 +0,30 @@ | ||
"use strict"; | ||
module.exports = { | ||
stage2Path: function stage2Path(scope) { | ||
if (process.env.NODE_ENV === "development" || process.env.NODE_ENV === "testing") { | ||
return "//staging.demoup.com/" + scope + "/playbuttonRenderer.js"; | ||
} else { | ||
return "//static.demoup.com/" + scope + "/playbuttonRenderer.min.js"; | ||
} | ||
}, | ||
stage3Path: function stage3Path(scope) { | ||
if (process.env.NODE_ENV === "development" || process.env.NODE_ENV === "testing") { | ||
return "//staging.demoup.com/" + scope + "/stage3.js"; | ||
} else { | ||
return "//static.demoup.com/" + scope + "/stage3.min.js"; | ||
} | ||
}, | ||
playerRenderer: function playerRenderer(scope) { | ||
if (process.env.NODE_ENV === "development" || process.env.NODE_ENV === "testing") { | ||
return "//staging.demoup.com/" + scope + "/playerRenderer.js"; | ||
} else { | ||
return "//static.demoup.com/" + scope + "/playerRenderer.min.js"; | ||
} | ||
} | ||
stage2Path: function (scope) { | ||
if (process.env.NODE_ENV === "development" || process.env.NODE_ENV === "testing") { | ||
return "//staging.demoup.com/" + scope + "/playbuttonRenderer.js"; | ||
} else { | ||
return "//static.demoup.com/" + scope + "/playbuttonRenderer.min.js"; | ||
} | ||
}, | ||
containerPath: function (scope) { | ||
if (process.env.NODE_ENV === "development" || process.env.NODE_ENV === "testing") { | ||
return "//staging.demoup.com/" + scope + "/playbuttonContainer.js"; | ||
} else { | ||
return "//static.demoup.com/" + scope + "/playbuttonContainer.min.js"; | ||
} | ||
}, | ||
stage3Path: function (scope) { | ||
if (process.env.NODE_ENV === "development" || process.env.NODE_ENV === "testing") { | ||
return "//staging.demoup.com/" + scope + "/stage3.js"; | ||
} else { | ||
return "//static.demoup.com/" + scope + "/stage3.min.js"; | ||
} | ||
}, | ||
playerRenderer: function (scope) { | ||
if (process.env.NODE_ENV === "development" || process.env.NODE_ENV === "testing") { | ||
return "//staging.demoup.com/" + scope + "/playerRenderer.js"; | ||
} else { | ||
return "//static.demoup.com/" + scope + "/playerRenderer.min.js"; | ||
} | ||
} | ||
}; |
"use strict"; | ||
module.exports = function (scope) { | ||
var buttonCreator = require("./button"); | ||
var playerCreator = require("./player"); | ||
return { | ||
button: buttonCreator(scope), | ||
player: playerCreator(scope) | ||
}; | ||
var buttonCreator = require("./button"); | ||
var playerCreator = require("./player"); | ||
var containerCreator = require("./container"); | ||
return { | ||
button: buttonCreator(scope), | ||
player: playerCreator(scope), | ||
container: containerCreator(scope) | ||
}; | ||
}; |
"use strict"; | ||
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } | ||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } | ||
var React = require("react"); | ||
@@ -15,59 +7,34 @@ | ||
var classNames = require("classnames"); | ||
var createClass = require('create-react-class'); | ||
var scriptLoader = require("load-script"); | ||
module.exports = function (scope) { | ||
var Player = function (_React$PureComponent) { | ||
_inherits(Player, _React$PureComponent); | ||
return createClass({ | ||
defaultProps: { | ||
scope: scope | ||
}, | ||
function Player(props) { | ||
_classCallCheck(this, Player); | ||
componentDidMount: function () { | ||
var t = this; | ||
if (window.DemoUpPlayerRenderer) { | ||
window.DemoUpPlayerRenderer(t.$container, t.props); | ||
} else { | ||
scriptLoader(config.playerRenderer(scope), function () { | ||
window.DemoUpPlayerRenderer && window.DemoUpPlayerRenderer(t.$container, t.props); | ||
}); | ||
} | ||
}, | ||
var _this = _possibleConstructorReturn(this, (Player.__proto__ || Object.getPrototypeOf(Player)).call(this, props)); | ||
componentWillUnmount: function () { | ||
document.dispatchEvent(new CustomEvent('demoup.unmounted')); | ||
}, | ||
_this.setRef = _this.setRef.bind(_this); | ||
return _this; | ||
} | ||
setRef: function (node) { | ||
this.$container = node; | ||
}, | ||
_createClass(Player, [{ | ||
key: "componentDidMount", | ||
value: function componentDidMount() { | ||
var t = this; | ||
if (window.DemoUpPlayerRenderer) { | ||
window.DemoUpPlayerRenderer(t.$container, t.props); | ||
} else { | ||
scriptLoader(config.playerRenderer(scope), function () { | ||
window.DemoUpPlayerRenderer && window.DemoUpPlayerRenderer(t.$container, t.props); | ||
}); | ||
} | ||
} | ||
}, { | ||
key: "componentWillUnmount", | ||
value: function componentWillUnmount() { | ||
var CrossCustomEvent = require("customevent"); | ||
document.dispatchEvent(new CrossCustomEvent("demoup.unmounted")); | ||
} | ||
}, { | ||
key: "setRef", | ||
value: function setRef(node) { | ||
this.$container = node; | ||
} | ||
}, { | ||
key: "render", | ||
value: function render() { | ||
return React.createElement("div", { | ||
className: classNames("demoup-player", this.props.className), | ||
ref: this.setRef | ||
}); | ||
} | ||
}]); | ||
return Player; | ||
}(React.PureComponent); | ||
Player.defaultProps = { | ||
nodeAttrs: [], | ||
scope: scope | ||
}; | ||
return Player; | ||
render: function () { | ||
return React.createElement("div", { className: classNames("demoup-player", this.props.className), ref: this.setRef }); | ||
} | ||
}); | ||
}; |
{ | ||
"name": "demoup-react", | ||
"version": "0.1.25", | ||
"version": "0.2.0", | ||
"description": "React components for integrating the demoup video player solution in react based websites", | ||
"main": "distribution/index.js", | ||
"scripts": { | ||
"build": "babel src --presets react,es2015 --plugins transform-object-assign --out-dir distribution", | ||
"build": "babel src --presets react --out-dir distribution", | ||
"prepublish": "npm run build" | ||
@@ -19,4 +19,3 @@ }, | ||
"classnames": "", | ||
"customevent": "^1.0.0", | ||
"global": "", | ||
"create-react-class": "", | ||
"load-script": "", | ||
@@ -27,11 +26,4 @@ "react": "" | ||
"babel-cli": "^6.24.1", | ||
"babel-plugin-transform-object-assign": "^6.22.0", | ||
"babel-preset-es2015": "^6.24.1", | ||
"babel-preset-react": "^6.24.1", | ||
"eslint": "^4.12.1", | ||
"eslint-config-prettier": "^2.9.0", | ||
"eslint-plugin-prettier": "^2.3.1", | ||
"eslint-plugin-react": "^7.5.1", | ||
"prettier": "^1.8.2" | ||
"babel-preset-react": "^6.24.1" | ||
} | ||
} |
"use strict"; | ||
var React = require("react"); | ||
var config = require("./config"); | ||
var classNames = require("classnames"); | ||
var scriptLoader = require("load-script"); | ||
var React = require("react"); | ||
var config = require("./config"); | ||
var classNames = require("classnames"); | ||
var createClass = require('create-react-class'); | ||
var scriptLoader = require("load-script"); | ||
var window = require("global/window"); | ||
module.exports = function(scope) { | ||
class Button extends React.PureComponent { | ||
constructor(props) { | ||
super(props); | ||
this.setRef = this.setRef.bind(this); | ||
} | ||
return createClass({ | ||
defaultProps : { | ||
nodeAttrs: [], | ||
scope : scope | ||
}, | ||
componentDidMount() { | ||
var t = this; | ||
var props = Object.assign({}, t.props); | ||
if (window.DemoUpPlaybuttonRenderer) { | ||
window.DemoUpPlaybuttonRenderer(t.$container, props); | ||
} else { | ||
scriptLoader(config.stage2Path(scope), function() { | ||
t.forceUpdate(function() { | ||
window.DemoUpPlaybuttonRenderer && | ||
window.DemoUpPlaybuttonRenderer(t.$container, props); | ||
}); | ||
}); | ||
} | ||
} | ||
componentDidMount : function() { | ||
var t = this; | ||
componentWillUnmount() { | ||
var CrossCustomEvent = require("customevent"); | ||
document.dispatchEvent( | ||
new CrossCustomEvent("demoup.unmounted", { | ||
detail: { | ||
node: this.$container | ||
} | ||
}) | ||
); | ||
} | ||
if (window.DemoUpPlaybuttonRenderer) { | ||
window.DemoUpPlaybuttonRenderer(t.$container, t.props); | ||
} | ||
else { | ||
scriptLoader(config.stage2Path(scope), function() { | ||
window.DemoUpPlaybuttonRenderer && window.DemoUpPlaybuttonRenderer(t.$container, t.props); | ||
}); | ||
} | ||
setRef(node) { | ||
this.$container = node; | ||
} | ||
}, | ||
render() { | ||
var props = this.props; | ||
return ( | ||
<div | ||
{...props.nodeAttrs} | ||
className={classNames("demoup-trigger", props.className)} | ||
id="demoup_stage2_script" | ||
ref={this.setRef} | ||
src={config.stage3Path(scope)} | ||
> | ||
{window && window.DemoUpPlaybuttonRenderer ? null : props.children} | ||
</div> | ||
); | ||
} | ||
} | ||
componentWillUnmount : function() { | ||
document.dispatchEvent(new CustomEvent('demoup.unmounted')); | ||
}, | ||
Button.defaultProps = { | ||
nodeAttrs: [], | ||
scope: scope | ||
}; | ||
setRef : function(node) { | ||
this.$container = node; | ||
}, | ||
return Button; | ||
render : function() { | ||
var props = this.props; | ||
return <div | ||
{...props.nodeAttrs} | ||
className={classNames("demoup-trigger", props.className)} | ||
id="demoup_stage2_script" | ||
ref={this.setRef} | ||
src={config.stage3Path(scope)} | ||
/>; | ||
} | ||
}); | ||
}; |
module.exports = { | ||
stage2Path: function(scope) { | ||
if ( | ||
process.env.NODE_ENV === "development" || | ||
process.env.NODE_ENV === "testing" | ||
) { | ||
return "//staging.demoup.com/" + scope + "/playbuttonRenderer.js"; | ||
} else { | ||
return "//static.demoup.com/" + scope + "/playbuttonRenderer.min.js"; | ||
} | ||
}, | ||
stage3Path: function(scope) { | ||
if ( | ||
process.env.NODE_ENV === "development" || | ||
process.env.NODE_ENV === "testing" | ||
) { | ||
return "//staging.demoup.com/" + scope + "/stage3.js"; | ||
} else { | ||
return "//static.demoup.com/" + scope + "/stage3.min.js"; | ||
} | ||
}, | ||
playerRenderer: function(scope) { | ||
if ( | ||
process.env.NODE_ENV === "development" || | ||
process.env.NODE_ENV === "testing" | ||
) { | ||
return "//staging.demoup.com/" + scope + "/playerRenderer.js"; | ||
} else { | ||
return "//static.demoup.com/" + scope + "/playerRenderer.min.js"; | ||
} | ||
} | ||
stage2Path : function(scope) { | ||
if (process.env.NODE_ENV === "development" || process.env.NODE_ENV === "testing") { | ||
return "//staging.demoup.com/" + scope + "/playbuttonRenderer.js"; | ||
} | ||
else { | ||
return "//static.demoup.com/" + scope + "/playbuttonRenderer.min.js"; | ||
} | ||
}, | ||
containerPath : function(scope) { | ||
if (process.env.NODE_ENV === "development" || process.env.NODE_ENV === "testing") { | ||
return "//staging.demoup.com/" + scope + "/playbuttonContainer.js"; | ||
} | ||
else { | ||
return "//static.demoup.com/" + scope + "/playbuttonContainer.min.js"; | ||
} | ||
}, | ||
stage3Path : function(scope) { | ||
if (process.env.NODE_ENV === "development" || process.env.NODE_ENV === "testing") { | ||
return "//staging.demoup.com/" + scope + "/stage3.js"; | ||
} | ||
else { | ||
return "//static.demoup.com/" + scope + "/stage3.min.js"; | ||
} | ||
}, | ||
playerRenderer : function(scope) { | ||
if (process.env.NODE_ENV === "development" || process.env.NODE_ENV === "testing") { | ||
return "//staging.demoup.com/" + scope + "/playerRenderer.js"; | ||
} | ||
else { | ||
return "//static.demoup.com/" + scope + "/playerRenderer.min.js"; | ||
} | ||
} | ||
}; |
"use strict"; | ||
module.exports = function(scope) { | ||
var buttonCreator = require("./button"); | ||
var playerCreator = require("./player"); | ||
return { | ||
button: buttonCreator(scope), | ||
player: playerCreator(scope) | ||
}; | ||
var buttonCreator = require("./button"); | ||
var playerCreator = require("./player"); | ||
var containerCreator = require("./container"); | ||
return { | ||
button : buttonCreator(scope), | ||
player : playerCreator(scope), | ||
container : containerCreator(scope) | ||
}; | ||
}; |
"use strict"; | ||
var React = require("react"); | ||
var React = require("react"); | ||
var config = require("./config"); | ||
var classNames = require("classnames"); | ||
var scriptLoader = require("load-script"); | ||
var config = require("./config"); | ||
var classNames = require("classnames"); | ||
var createClass = require('create-react-class'); | ||
var scriptLoader = require("load-script"); | ||
module.exports = function(scope) { | ||
class Player extends React.PureComponent { | ||
constructor(props) { | ||
super(props); | ||
this.setRef = this.setRef.bind(this); | ||
} | ||
return createClass({ | ||
defaultProps : { | ||
scope : scope | ||
}, | ||
componentDidMount() { | ||
var t = this; | ||
if (window.DemoUpPlayerRenderer) { | ||
window.DemoUpPlayerRenderer(t.$container, t.props); | ||
} else { | ||
scriptLoader(config.playerRenderer(scope), function() { | ||
window.DemoUpPlayerRenderer && | ||
window.DemoUpPlayerRenderer(t.$container, t.props); | ||
}); | ||
} | ||
} | ||
componentDidMount : function() { | ||
var t = this; | ||
if (window.DemoUpPlayerRenderer) { | ||
window.DemoUpPlayerRenderer(t.$container, t.props); | ||
} | ||
else { | ||
scriptLoader(config.playerRenderer(scope), function() { | ||
window.DemoUpPlayerRenderer && window.DemoUpPlayerRenderer(t.$container, t.props); | ||
}); | ||
} | ||
}, | ||
componentWillUnmount() { | ||
var CrossCustomEvent = require("customevent"); | ||
document.dispatchEvent(new CrossCustomEvent("demoup.unmounted")); | ||
} | ||
componentWillUnmount : function() { | ||
document.dispatchEvent(new CustomEvent('demoup.unmounted')); | ||
}, | ||
setRef(node) { | ||
this.$container = node; | ||
} | ||
setRef : function(node) { | ||
this.$container = node; | ||
}, | ||
render() { | ||
return ( | ||
<div | ||
className={classNames("demoup-player", this.props.className)} | ||
ref={this.setRef} | ||
/> | ||
); | ||
} | ||
} | ||
Player.defaultProps = { | ||
nodeAttrs: [], | ||
scope: scope | ||
}; | ||
return Player; | ||
render : function() { | ||
return <div className={classNames("demoup-player", this.props.className)} ref={this.setRef} />; | ||
} | ||
}); | ||
}; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Wildcard dependency
QualityPackage has a dependency with a floating version range. This can cause issues if the dependency publishes a new major version.
Found 1 instance in 1 package
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Wildcard dependency
QualityPackage has a dependency with a floating version range. This can cause issues if the dependency publishes a new major version.
Found 1 instance in 1 package
20576
4
2
14
343
2
+ Addedcreate-react-class@
+ Addedcreate-react-class@15.7.0(transitive)
+ Addedobject-assign@4.1.1(transitive)
- Removedcustomevent@^1.0.0
- Removedglobal@
- Removedcustomevent@1.0.1(transitive)
- Removeddom-walk@0.1.2(transitive)
- Removedglobal@4.4.0(transitive)
- Removedmin-document@2.19.0(transitive)
- Removedprocess@0.11.10(transitive)