react-shadow
Advanced tools
Comparing version 0.2.1 to 0.2.2
{ | ||
"name": "react-shadow", | ||
"version": "0.2.1", | ||
"version": "0.2.2", | ||
"homepage": "https://github.com/Wildhoney/ReactShadow", | ||
@@ -5,0 +5,0 @@ "authors": [ |
@@ -5,2 +5,10 @@ (function main($window, $document) { | ||
var React; | ||
if (typeof require === 'function') { | ||
React = require('react'); | ||
} else { | ||
React = $window.React; | ||
} | ||
/** | ||
@@ -7,0 +15,0 @@ * @constant REACT_ID_ATTRIBUTE |
@@ -5,2 +5,10 @@ (function main($window, $document) { | ||
var React; | ||
if (typeof require === 'function') { | ||
React = require('react'); | ||
} else { | ||
React = $window.React; | ||
} | ||
/** | ||
@@ -7,0 +15,0 @@ * @constant REACT_ID_ATTRIBUTE |
@@ -1,1 +0,1 @@ | ||
!function(t,e){"use strict";var n="data-reactid",o="main";t.ReactShadow={_shadowRoot:{},componentDidMount:function(){var t=this._shadowRoot=this.getDOMNode().parentNode.createShadowRoot(),n=e.createElement(o);this._attachCSSDocuments(t),t.appendChild(n),t.appendChild(n),React.render(this.render(),n),this._interceptEvents();var i=e.createElement("script");this.getDOMNode().parentNode.appendChild(i),i.appendChild(this.getDOMNode())},componentDidUpdate:function(){var t=this._shadowRoot.querySelector(o);React.render(this.render(),t)},_interceptEvents:function(){var t=this.getDOMNode().getAttribute(n),o=this.getDOMNode().parentNode,i=function(i){i.stopPropagation();var a=i.target.getAttribute(n);if(a){var s=a.replace(/\.[0-9]+/,t),r=o.querySelector("*["+n+'="'+s+'"]');i.target.value&&r.setAttribute("value",i.target.value);var c=e.createEvent("Events");c.initEvent(i.type,!0,!1),r.dispatchEvent(c)}}.bind(this),a=["click","dblclick","mouseup","mouseout","mouseover","mousedown","mouseenter","mouseleave","contextmenu","keyup","keydown","change"];a.forEach(function(t){this._shadowRoot.addEventListener(t,i)}.bind(this))},_attachCSSDocuments:function(t){if(this.cssDocuments){var n="function"==typeof this.cssDocuments,o=n?this.cssDocuments():this.cssDocuments;o.forEach(function(n){var o=e.createElement("style");o.innerHTML='@import "'+n+'"',t.appendChild(o)})}return t}}}(window,window.document); | ||
!function(e,t){"use strict";var n;n="function"==typeof require?require("react"):e.React;var o="data-reactid",i="main";e.ReactShadow={_shadowRoot:{},componentDidMount:function(){var e=this._shadowRoot=this.getDOMNode().parentNode.createShadowRoot(),o=t.createElement(i);this._attachCSSDocuments(e),e.appendChild(o),e.appendChild(o),n.render(this.render(),o),this._interceptEvents();var r=t.createElement("script");this.getDOMNode().parentNode.appendChild(r),r.appendChild(this.getDOMNode())},componentDidUpdate:function(){var e=this._shadowRoot.querySelector(i);n.render(this.render(),e)},_interceptEvents:function(){var e=this.getDOMNode().getAttribute(o),n=this.getDOMNode().parentNode,i=function(i){i.stopPropagation();var r=i.target.getAttribute(o);if(r){var a=r.replace(/\.[0-9]+/,e),s=n.querySelector("*["+o+'="'+a+'"]');i.target.value&&s.setAttribute("value",i.target.value);var c=t.createEvent("Events");c.initEvent(i.type,!0,!1),s.dispatchEvent(c)}}.bind(this),r=["click","dblclick","mouseup","mouseout","mouseover","mousedown","mouseenter","mouseleave","contextmenu","keyup","keydown","change"];r.forEach(function(e){this._shadowRoot.addEventListener(e,i)}.bind(this))},_attachCSSDocuments:function(e){if(this.cssDocuments){var n="function"==typeof this.cssDocuments,o=n?this.cssDocuments():this.cssDocuments;o.forEach(function(n){var o=t.createElement("style");o.innerHTML='@import "'+n+'"',e.appendChild(o)})}return e}}}(window,window.document); |
{ | ||
"name": "react-shadow", | ||
"version": "0.2.1", | ||
"version": "0.2.2", | ||
"description": "Use Shadow DOM with React.js and CSS imports; write your component styles in CSS!", | ||
@@ -5,0 +5,0 @@ "main": "dist/react-shadow.min.js", |
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
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
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
24672
445
2