Comparing version 0.3.0 to 0.3.1
@@ -14,5 +14,3 @@ 'use strict'; | ||
const attributeNode = document.createAttributeNS( | ||
`http://www.w3.org/${ | ||
'ownerSVGElement' in node ? '2000/svg' : '1999/xhtml' | ||
}`, | ||
'ownerSVGElement' in node ? 'http://www.w3.org/2000/svg' : null, | ||
name | ||
@@ -19,0 +17,0 @@ ); |
@@ -1,1 +0,1 @@ | ||
var uhtmlHandlers=function(t){"use strict";const{isArray:e}=Array;return t.aria=t=>e=>{for(const r in e)t.setAttribute("role"===r?r:"aria-"+r,e[r])},t.attribute=(t,e)=>{let r,n=!0;const o=document.createAttributeNS("http://www.w3.org/"+("ownerSVGElement"in t?"2000/svg":"1999/xhtml"),e);return e=>{r!==e&&(r=e,null==r?n||(t.removeAttributeNode(o),n=!0):(o.value=e,n&&(t.setAttributeNode(o),n=!1)))}},t.data=({dataset:t})=>e=>{for(const r in e)t[r]=e[r]},t.event=(t,r)=>{let n,o=r.slice(2);return!(r in t)&&r.toLowerCase()in t&&(o=o.toLowerCase()),r=>{const i=e(r)?r:[r,!1];n!==i[0]&&(n&&t.removeEventListener(o,n,i[1]),(n=i[0])&&t.addEventListener(o,n,i[1]))}},t.ref=t=>e=>{"function"==typeof e?e(t):e.current=t},t.setter=(t,e)=>r=>{t[e]=r},t.text=t=>{let e;return r=>{e!=r&&(e=r,t.textContent=null==r?"":r)}},t}({}); | ||
var uhtmlHandlers=function(t){"use strict";const{isArray:e}=Array;return t.aria=t=>e=>{for(const r in e)t.setAttribute("role"===r?r:"aria-"+r,e[r])},t.attribute=(t,e)=>{let r,n=!0;const o=document.createAttributeNS("ownerSVGElement"in t?"http://www.w3.org/2000/svg":null,e);return e=>{r!==e&&(r=e,null==r?n||(t.removeAttributeNode(o),n=!0):(o.value=e,n&&(t.setAttributeNode(o),n=!1)))}},t.data=({dataset:t})=>e=>{for(const r in e)t[r]=e[r]},t.event=(t,r)=>{let n,o=r.slice(2);return!(r in t)&&r.toLowerCase()in t&&(o=o.toLowerCase()),r=>{const i=e(r)?r:[r,!1];n!==i[0]&&(n&&t.removeEventListener(o,n,i[1]),(n=i[0])&&t.addEventListener(o,n,i[1]))}},t.ref=t=>e=>{"function"==typeof e?e(t):e.current=t},t.setter=(t,e)=>r=>{t[e]=r},t.text=t=>{let e;return r=>{e!=r&&(e=r,t.textContent=null==r?"":r)}},t}({}); |
@@ -12,5 +12,3 @@ import {isArray} from 'uarray'; | ||
const attributeNode = document.createAttributeNS( | ||
`http://www.w3.org/${ | ||
'ownerSVGElement' in node ? '2000/svg' : '1999/xhtml' | ||
}`, | ||
'ownerSVGElement' in node ? 'http://www.w3.org/2000/svg' : null, | ||
name | ||
@@ -17,0 +15,0 @@ ); |
@@ -18,3 +18,3 @@ var uhtmlHandlers = (function (exports) { | ||
var attributeNode = document.createAttributeNS("http://www.w3.org/".concat('ownerSVGElement' in node ? '2000/svg' : '1999/xhtml'), name); | ||
var attributeNode = document.createAttributeNS('ownerSVGElement' in node ? 'http://www.w3.org/2000/svg' : null, name); | ||
return function (newValue) { | ||
@@ -21,0 +21,0 @@ if (oldValue !== newValue) { |
@@ -1,1 +0,1 @@ | ||
var uhtmlHandlers=function(t){"use strict";var o=Array.isArray;return t.aria=function(r){return function(t){for(var n in t)r.setAttribute("role"===n?n:"aria-".concat(n),t[n])}},t.attribute=function(n,t){var r,e=!0,u=document.createAttributeNS("http://www.w3.org/".concat("ownerSVGElement"in n?"2000/svg":"1999/xhtml"),t);return function(t){r!==t&&(null==(r=t)?e||(n.removeAttributeNode(u),e=!0):(u.value=t,e&&(n.setAttributeNode(u),e=!1)))}},t.data=function(t){var r=t.dataset;return function(t){for(var n in t)r[n]=t[n]}},t.event=function(r,t){var e,u=t.slice(2);return!(t in r)&&t.toLowerCase()in r&&(u=u.toLowerCase()),function(t){var n=o(t)?t:[t,!1];e!==n[0]&&(e&&r.removeEventListener(u,e,n[1]),(e=n[0])&&r.addEventListener(u,e,n[1]))}},t.ref=function(n){return function(t){"function"==typeof t?t(n):t.current=n}},t.setter=function(n,r){return function(t){n[r]=t}},t.text=function(n){var r;return function(t){r!=t&&(r=t,n.textContent=null==t?"":t)}},t}({}); | ||
var uhtmlHandlers=function(t){"use strict";var i=Array.isArray;return t.aria=function(r){return function(t){for(var n in t)r.setAttribute("role"===n?n:"aria-".concat(n),t[n])}},t.attribute=function(n,t){var r,e=!0,u=document.createAttributeNS("ownerSVGElement"in n?"http://www.w3.org/2000/svg":null,t);return function(t){r!==t&&(null==(r=t)?e||(n.removeAttributeNode(u),e=!0):(u.value=t,e&&(n.setAttributeNode(u),e=!1)))}},t.data=function(t){var r=t.dataset;return function(t){for(var n in t)r[n]=t[n]}},t.event=function(r,t){var e,u=t.slice(2);return!(t in r)&&t.toLowerCase()in r&&(u=u.toLowerCase()),function(t){var n=i(t)?t:[t,!1];e!==n[0]&&(e&&r.removeEventListener(u,e,n[1]),(e=n[0])&&r.addEventListener(u,e,n[1]))}},t.ref=function(n){return function(t){"function"==typeof t?t(n):t.current=n}},t.setter=function(n,r){return function(t){n[r]=t}},t.text=function(n){var r;return function(t){r!=t&&(r=t,n.textContent=null==t?"":t)}},t}({}); |
{ | ||
"name": "uhandlers", | ||
"version": "0.3.0", | ||
"version": "0.3.1", | ||
"description": "µhtml attributes handlers", | ||
@@ -5,0 +5,0 @@ "main": "./cjs/index.js", |
13264
227