Comparing version 0.1.8 to 0.1.9
63
index.js
@@ -16,2 +16,4 @@ 'use strict'; | ||
var svgNS = 'http://www.w3.org/2000/svg'; | ||
var testedNodeTypes = { | ||
@@ -27,2 +29,57 @@ ELEMENT_NODE: ELEMENT_NODE, | ||
var svgnames = { | ||
'svg': 1, | ||
'g': 1, | ||
'defs': 1, | ||
'desc': 1, | ||
'title': 1, | ||
'symbol': 1, | ||
'script': 1, | ||
'use': 1, | ||
'image': 1, | ||
'switch': 1, | ||
'style': 1, | ||
'path': 1, | ||
'rect': 1, | ||
'circle': 1, | ||
'ellipse': 1, | ||
'line': 1, | ||
'link': 1, | ||
'polyline': 1, | ||
'polygon': 1, | ||
'text': 1, | ||
'tspan': 1, | ||
'tref': 1, | ||
'textPath': 1, | ||
'altGlyph': 1, | ||
'glyphRef': 1, | ||
'altGlyphItem': 1, | ||
'altGlyphDef': 1, | ||
'marker': 1, | ||
'color-profile': 1, | ||
'filter': 1, | ||
'cursor': 1, | ||
'view': 1, | ||
'animate': 1, | ||
'set': 1, | ||
'animateMotion': 1, | ||
'animateColor': 1, | ||
'animateTransform': 1, | ||
'font': 1, | ||
'glyph': 1, | ||
'missing-glyph': 1, | ||
'hkern': 1, | ||
'vkern': 1, | ||
'font-face': 1, | ||
'font-face-src': 1, | ||
'font-face-uri': 1, | ||
'font-face-format': 1, | ||
'font-face-name': 1, | ||
'foreignObject': 1 | ||
}; | ||
var svgConversions = { | ||
'link': 'a' | ||
}; | ||
var plugins = []; | ||
@@ -35,3 +92,3 @@ | ||
// check if a property with the name exists on the instance and set it instead if true | ||
if (attrName in node || attrName in reactDebugAttributes) { | ||
if (!node.namespaceURI === svgNS && attrName in node || attrName in reactDebugAttributes) { | ||
var curValue = node[attrName]; | ||
@@ -112,2 +169,6 @@ if (curValue && (typeof curValue === 'undefined' ? 'undefined' : _typeof(curValue)) === 'object') { | ||
newNode = name; | ||
} else if (name in svgnames) { | ||
var conversion = svgConversions[name]; | ||
newNode = doc.createElementNS(svgNS, conversion || name); | ||
addChildren(newNode, arguments, 1); | ||
} else { | ||
@@ -114,0 +175,0 @@ newNode = doc.createElement(name); |
{ | ||
"name": "bdom", | ||
"version": "0.1.8", | ||
"version": "0.1.9", | ||
"description": "a jsx compatible shorthand library for generating actual dom elements instead of virtual ones", | ||
@@ -30,8 +30,8 @@ "main": "index.js", | ||
"devDependencies": { | ||
"babel-cli": "^6.26.0", | ||
"babel-preset-es2015": "^6.24.1", | ||
"expect.js": "^0.3.1", | ||
"jsdom": "^11.1.0", | ||
"mocha": "^3.5.0" | ||
"babel-cli": "6.26.0", | ||
"babel-preset-es2015": "6.24.1", | ||
"expect.js": "0.3.1", | ||
"jsdom": "11.1.0", | ||
"mocha": "3.5.0" | ||
} | ||
} |
14500
393