react-shadow
Advanced tools
Comparing version 0.2.4 to 0.2.5
{ | ||
"name": "react-shadow", | ||
"version": "0.2.4", | ||
"version": "0.2.5", | ||
"homepage": "https://github.com/Wildhoney/ReactShadow", | ||
@@ -5,0 +5,0 @@ "authors": [ |
@@ -205,6 +205,10 @@ (function main($window, $document) { | ||
// Export the module attached to the `$window` element or as a CommonJS module. | ||
var root = typeof exports !== 'undefined' && exports !== null ? exports : $window; | ||
root.ReactShadow = ReactShadow; | ||
// Export the module as a CommonJS module if possible | ||
if (typeof module !== 'undefined' && module != null) { | ||
module.exports = ReactShadow; | ||
return; | ||
} | ||
})(window, window.document); | ||
$window.ReactShadow = ReactShadow; | ||
})(window, window.document); |
@@ -205,6 +205,10 @@ (function main($window, $document) { | ||
// Export the module attached to the `$window` element or as a CommonJS module. | ||
var root = typeof exports !== 'undefined' && exports !== null ? exports : $window; | ||
root.ReactShadow = ReactShadow; | ||
// Export the module as a CommonJS module if possible | ||
if (typeof module !== 'undefined' && module != null) { | ||
module.exports = ReactShadow; | ||
return; | ||
} | ||
})(window, window.document); | ||
$window.ReactShadow = ReactShadow; | ||
})(window, window.document); |
@@ -1,1 +0,1 @@ | ||
!function(t,e){"use strict";var n;n="function"==typeof require?require("react"):t.React;var o="data-reactid",i="main",r={_shadowRoot:{},componentDidMount:function(){var t=this._shadowRoot=this.getDOMNode().parentNode.createShadowRoot(),o=e.createElement(i);this._attachCSS(t),t.appendChild(o),n.render(this.render(),o),this._interceptEvents();var r=e.createElement("script");this.getDOMNode().parentNode.appendChild(r),r.appendChild(this.getDOMNode())},componentDidUpdate:function(){var t=this._shadowRoot.querySelector(i);n.render(this.render(),t)},_attachCSS:function(t){this.cssDocuments&&this._attachCSSDocuments(t),this.cssSource&&this._attachCSSSource(t)},_interceptEvents:function(){var t=this.getDOMNode().getAttribute(o),n=this.getDOMNode().parentNode,i=function(i){i.stopPropagation();var r=i.target.getAttribute(o);if(r){var s=r.replace(/\.[0-9]+/,t),a=n.querySelector("*["+o+'="'+s+'"]');i.target.value&&a.setAttribute("value",i.target.value);var c=e.createEvent("Events");c.initEvent(i.type,!0,!1),a.dispatchEvent(c)}}.bind(this),r=["click","dblclick","mouseup","mouseout","mouseover","mousedown","mouseenter","mouseleave","contextmenu","keyup","keydown","change"];r.forEach(function(t){this._shadowRoot.addEventListener(t,i)}.bind(this))},_createStyle:function(t,n){var o=e.createElement("style");return o.innerHTML=n,t.appendChild(o),t},_attachCSSSource:function(t){this._createStyle(t,this.cssSource)},_attachCSSDocuments:function(t){var e=this;if(this.cssDocuments){var n="function"==typeof this.cssDocuments,o=n?this.cssDocuments():this.cssDocuments;o.forEach(function(n){e._createStyle(t,'@import "'+n+'"')})}return t}},s="undefined"!=typeof exports&&null!==exports?exports:t;s.ReactShadow=r}(window,window.document); | ||
!function(t,e){"use strict";var n;n="function"==typeof require?require("react"):t.React;var o="data-reactid",i="main",r={_shadowRoot:{},componentDidMount:function(){var t=this._shadowRoot=this.getDOMNode().parentNode.createShadowRoot(),o=e.createElement(i);this._attachCSS(t),t.appendChild(o),n.render(this.render(),o),this._interceptEvents();var r=e.createElement("script");this.getDOMNode().parentNode.appendChild(r),r.appendChild(this.getDOMNode())},componentDidUpdate:function(){var t=this._shadowRoot.querySelector(i);n.render(this.render(),t)},_attachCSS:function(t){this.cssDocuments&&this._attachCSSDocuments(t),this.cssSource&&this._attachCSSSource(t)},_interceptEvents:function(){var t=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]+/,t),c=n.querySelector("*["+o+'="'+a+'"]');i.target.value&&c.setAttribute("value",i.target.value);var s=e.createEvent("Events");s.initEvent(i.type,!0,!1),c.dispatchEvent(s)}}.bind(this),r=["click","dblclick","mouseup","mouseout","mouseover","mousedown","mouseenter","mouseleave","contextmenu","keyup","keydown","change"];r.forEach(function(t){this._shadowRoot.addEventListener(t,i)}.bind(this))},_createStyle:function(t,n){var o=e.createElement("style");return o.innerHTML=n,t.appendChild(o),t},_attachCSSSource:function(t){this._createStyle(t,this.cssSource)},_attachCSSDocuments:function(t){var e=this;if(this.cssDocuments){var n="function"==typeof this.cssDocuments,o=n?this.cssDocuments():this.cssDocuments;o.forEach(function(n){e._createStyle(t,'@import "'+n+'"')})}return t}};return"undefined"!=typeof module&&null!=module?void(module.exports=r):void(t.ReactShadow=r)}(window,window.document); |
{ | ||
"name": "react-shadow", | ||
"version": "0.2.4", | ||
"version": "0.2.5", | ||
"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", |
27898
535