@bikeshaving/crank
Advanced tools
Comparing version 0.1.4 to 0.1.5
@@ -9,2 +9,6 @@ 'use strict'; | ||
var SVG_NAMESPACE = "http://www.w3.org/2000/svg"; | ||
// TODO: refine/explain the NO_TOUCH set | ||
// Gleaned from: | ||
// https://github.com/preactjs/preact/blob/05e5d2c0d2d92c5478eeffdbd96681c96500d29f/src/diff/props.js#L111-L117 | ||
var NO_TOUCH = new Set(["form", "list", "type", "size"]); | ||
// TODO: create an allowlist/blocklist of props | ||
@@ -20,7 +24,7 @@ function updateProps(el, props, newProps, namespace) { | ||
case "className": { | ||
if (namespace === SVG_NAMESPACE) { | ||
el.setAttribute("class", newValue); | ||
if (namespace === undefined) { | ||
el.className = newValue; | ||
} | ||
else { | ||
el.className = newValue; | ||
el.setAttribute("class", newValue); | ||
} | ||
@@ -54,3 +58,3 @@ break; | ||
default: { | ||
if (name_1 in el) { | ||
if (namespace === undefined && name_1 in el && !NO_TOUCH.has(name_1)) { | ||
el[name_1] = newValue; | ||
@@ -57,0 +61,0 @@ break; |
@@ -5,2 +5,6 @@ import { D as Default, _ as __generator, R as Raw, P as Portal, S as Scopes, d as __extends, b as Renderer, e as __values, f as __assign } from './index-e98190bc.js'; | ||
var SVG_NAMESPACE = "http://www.w3.org/2000/svg"; | ||
// TODO: refine/explain the NO_TOUCH set | ||
// Gleaned from: | ||
// https://github.com/preactjs/preact/blob/05e5d2c0d2d92c5478eeffdbd96681c96500d29f/src/diff/props.js#L111-L117 | ||
var NO_TOUCH = new Set(["form", "list", "type", "size"]); | ||
// TODO: create an allowlist/blocklist of props | ||
@@ -16,7 +20,7 @@ function updateProps(el, props, newProps, namespace) { | ||
case "className": { | ||
if (namespace === SVG_NAMESPACE) { | ||
el.setAttribute("class", newValue); | ||
if (namespace === undefined) { | ||
el.className = newValue; | ||
} | ||
else { | ||
el.className = newValue; | ||
el.setAttribute("class", newValue); | ||
} | ||
@@ -50,3 +54,3 @@ break; | ||
default: { | ||
if (name_1 in el) { | ||
if (namespace === undefined && name_1 in el && !NO_TOUCH.has(name_1)) { | ||
el[name_1] = newValue; | ||
@@ -53,0 +57,0 @@ break; |
{ | ||
"name": "@bikeshaving/crank", | ||
"version": "0.1.4", | ||
"version": "0.1.5", | ||
"description": "JSX-based components with functions, promises and generators.", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
329514
6184
0