demoup-react
Advanced tools
Comparing version 0.1.19 to 0.1.20
@@ -11,2 +11,4 @@ "use strict"; | ||
var window = require("global/window"); | ||
module.exports = function (scope) { | ||
@@ -21,14 +23,10 @@ return createClass({ | ||
var t = this; | ||
var props = _extends({}, t.props); | ||
if (window.DemoUpPlaybuttonRenderer) { | ||
console.log('mounting button, using existing renderer'); | ||
window.DemoUpPlaybuttonRenderer(t.$container, t.props); | ||
window.DemoUpPlaybuttonRenderer(t.$container, props); | ||
} else { | ||
console.log('mounting button, loading renderer'); | ||
scriptLoader(config.stage2Path(scope), function () { | ||
window.DemoUpPlaybuttonRenderer && window.DemoUpPlaybuttonRenderer(t.$container, t.props); | ||
t.forceUpdate(function () { | ||
window.DemoUpPlaybuttonRenderer && window.DemoUpPlaybuttonRenderer(t.$container, props); | ||
}); | ||
}); | ||
@@ -39,3 +37,4 @@ } | ||
componentWillUnmount: function () { | ||
document.dispatchEvent(new CustomEvent('demoup.unmounted')); | ||
var CrossCustomEvent = require('customevent'); | ||
document.dispatchEvent(new CrossCustomEvent('demoup.unmounted')); | ||
}, | ||
@@ -48,14 +47,15 @@ | ||
render: function () { | ||
console.log('rendering button'); | ||
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) | ||
})); | ||
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 | ||
); | ||
} | ||
}); | ||
}; |
@@ -6,2 +6,3 @@ "use strict"; | ||
var playerCreator = require("./player"); | ||
return { | ||
@@ -8,0 +9,0 @@ button: buttonCreator(scope), |
@@ -28,3 +28,4 @@ "use strict"; | ||
componentWillUnmount: function () { | ||
document.dispatchEvent(new CustomEvent('demoup.unmounted')); | ||
var CrossCustomEvent = require('customevent'); | ||
document.dispatchEvent(new CrossCustomEvent('demoup.unmounted')); | ||
}, | ||
@@ -31,0 +32,0 @@ |
{ | ||
"name": "demoup-react", | ||
"version": "0.1.19", | ||
"version": "0.1.20", | ||
"description": "React components for integrating the demoup video player solution in react based websites", | ||
"main": "distribution/index.js", | ||
"scripts": { | ||
"build": "babel src --presets react --out-dir distribution", | ||
"build": "babel src --presets react --plugins transform-object-assign --out-dir distribution", | ||
"prepublish": "npm run build" | ||
@@ -20,2 +20,4 @@ }, | ||
"create-react-class": "", | ||
"customevent": "^1.0.0", | ||
"global": "", | ||
"load-script": "", | ||
@@ -26,4 +28,5 @@ "react": "" | ||
"babel-cli": "^6.24.1", | ||
"babel-plugin-transform-object-assign": "^6.22.0", | ||
"babel-preset-react": "^6.24.1" | ||
} | ||
} |
@@ -9,2 +9,4 @@ "use strict"; | ||
var window = require("global/window"); | ||
module.exports = function(scope) { | ||
@@ -19,22 +21,18 @@ return createClass({ | ||
var t = this; | ||
var props = Object.assign({}, t.props); | ||
if (window.DemoUpPlaybuttonRenderer) { | ||
console.log('mounting button, using existing renderer'); | ||
window.DemoUpPlaybuttonRenderer(t.$container, t.props); | ||
window.DemoUpPlaybuttonRenderer(t.$container, props); | ||
} | ||
else { | ||
console.log('mounting button, loading renderer'); | ||
scriptLoader(config.stage2Path(scope), function() { | ||
window.DemoUpPlaybuttonRenderer && window.DemoUpPlaybuttonRenderer(t.$container, t.props); | ||
t.forceUpdate(function() { | ||
window.DemoUpPlaybuttonRenderer && window.DemoUpPlaybuttonRenderer(t.$container, props); | ||
}); | ||
}); | ||
} | ||
}, | ||
componentWillUnmount : function() { | ||
document.dispatchEvent(new CustomEvent('demoup.unmounted')); | ||
var CrossCustomEvent = require('customevent'); | ||
document.dispatchEvent(new CrossCustomEvent('demoup.unmounted')); | ||
}, | ||
@@ -47,5 +45,2 @@ | ||
render : function() { | ||
console.log('rendering button'); | ||
var props = this.props; | ||
@@ -58,5 +53,9 @@ return <div | ||
src={config.stage3Path(scope)} | ||
/>; | ||
> | ||
{ | ||
(window && window.DemoUpPlaybuttonRenderer) ? null : props.children | ||
} | ||
</div>; | ||
} | ||
}); | ||
}; |
"use strict"; | ||
module.exports = function(scope) { | ||
var buttonCreator = require("./button"); | ||
var playerCreator = require("./player"); | ||
return { | ||
@@ -7,0 +9,0 @@ button : buttonCreator(scope), |
@@ -28,3 +28,4 @@ "use strict"; | ||
componentWillUnmount : function() { | ||
document.dispatchEvent(new CustomEvent('demoup.unmounted')); | ||
var CrossCustomEvent = require('customevent'); | ||
document.dispatchEvent(new CrossCustomEvent('demoup.unmounted')); | ||
}, | ||
@@ -31,0 +32,0 @@ |
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
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
10867
14
229
6
3
5
+ Addedcustomevent@^1.0.0
+ Addedglobal@
+ Addedcustomevent@1.0.1(transitive)
+ Addeddom-walk@0.1.2(transitive)
+ Addedglobal@4.4.0(transitive)
+ Addedmin-document@2.19.0(transitive)
+ Addedprocess@0.11.10(transitive)