react-shadow
Advanced tools
Comparing version 0.1.11 to 0.1.12
{ | ||
"name": "react-shadow", | ||
"version": "0.1.11", | ||
"version": "0.1.12", | ||
"homepage": "https://github.com/Wildhoney/ReactShadow", | ||
@@ -5,0 +5,0 @@ "authors": [ |
@@ -1,2 +0,2 @@ | ||
(function main($window, $document, $react) { | ||
(function main($window, $document) { | ||
@@ -46,3 +46,3 @@ "use strict"; | ||
shadowRoot.appendChild(mainElement); | ||
$react.render(this.render(), mainElement); | ||
React.render(this.render(), mainElement); | ||
this._interceptEvents(); | ||
@@ -58,3 +58,3 @@ | ||
var containerElement = this._shadowRoot.querySelector(REACT_SHADOW_ROOT); | ||
$react.render(this.render(), containerElement); | ||
React.render(this.render(), containerElement); | ||
}, | ||
@@ -139,2 +139,2 @@ | ||
})(window, window.document, window.React); | ||
})(window, window.document); |
@@ -1,2 +0,2 @@ | ||
(function main($window, $document, $react) { | ||
(function main($window, $document) { | ||
@@ -46,3 +46,3 @@ "use strict"; | ||
shadowRoot.appendChild(mainElement); | ||
$react.render(this.render(), mainElement); | ||
React.render(this.render(), mainElement); | ||
this._interceptEvents(); | ||
@@ -58,3 +58,3 @@ | ||
var containerElement = this._shadowRoot.querySelector(REACT_SHADOW_ROOT); | ||
$react.render(this.render(), containerElement); | ||
React.render(this.render(), containerElement); | ||
}, | ||
@@ -139,2 +139,2 @@ | ||
})(window, window.document, window.React); | ||
})(window, window.document); |
@@ -1,1 +0,1 @@ | ||
!function(t,e,n){"use strict";var o="data-reactid",i="main";t.ReactShadow={_shadowRoot:{},componentDidMount:function(){var t=this._shadowRoot=this.getDOMNode().parentNode.createShadowRoot(),o=e.createElement(i);this._attachCSSDocuments(t),t.appendChild(o),t.appendChild(o),n.render(this.render(),o),this._interceptEvents()},componentDidUpdate:function(){var t=this._shadowRoot.querySelector(i);n.render(this.render(),t)},_interceptEvents:function(){var t=this.getDOMNode().getAttribute(o),n=this.getDOMNode().parentNode,i=function(i){i.stopPropagation();var s=i.target.getAttribute(o);if(s){var c=s.replace(/\.[0-9]+/,t),r=n.querySelector("*["+o+'="'+c+'"]'),a=e.createEvent("Events");a.initEvent(i.type,!0,!1),r.dispatchEvent(a)}}.bind(this),s=["click","dblclick","mouseup","mouseout","mouseover","mousedown","mouseenter","mouseleave","contextmenu","keyup"];s.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,window.React); | ||
!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()},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 s=i.target.getAttribute(n);if(s){var c=s.replace(/\.[0-9]+/,t),a=o.querySelector("*["+n+'="'+c+'"]'),r=e.createEvent("Events");r.initEvent(i.type,!0,!1),a.dispatchEvent(r)}}.bind(this),s=["click","dblclick","mouseup","mouseout","mouseover","mousedown","mouseenter","mouseleave","contextmenu","keyup"];s.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); |
{ | ||
"name": "react-shadow", | ||
"version": "0.1.11", | ||
"version": "0.1.12", | ||
"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", |
22846