@viewfly/platform-browser 1.1.4 → 1.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -48,13 +48,14 @@ class DomRenderer extends NativeRenderer {
48
48
  }
49
49
  setProperty(node, key, value, namespace) {
50
50
  if (namespace) {
51
- const NAMESPACE = DomRenderer.NAMESPACES;
52
- const [prefix, ...unqualifiedName] = key.split(/(?=[A-Z])/);
53
- let ns = DomRenderer.NAMESPACES[namespace];
54
- if (prefix === 'xmlns' || unqualifiedName.length && NAMESPACE[prefix]) {
55
- ns = NAMESPACE[prefix];
51
+ const prefix = 'xlink:';
52
+ if (key.startsWith(prefix)) {
53
+ const ns = key.substring(prefix.length);
54
+ node.setAttributeNS(ns, key, String(value));
55
+ }
56
+ else {
57
+ node.setAttribute(key, String(value));
56
58
  }
57
- node.setAttributeNS(ns, key, String(value));
58
59
  return;
59
60
  }
60
61
  const map = this.propMap[node.tagName];
@@ -73,13 +74,14 @@ class DomRenderer extends NativeRenderer {
73
74
  }
74
75
  removeProperty(node, key, namespace) {
75
76
  if (namespace) {
76
- const NAMESPACE = DomRenderer.NAMESPACES;
77
- const [prefix, ...unqualifiedName] = key.split(/(?=[A-Z])/);
78
- let ns = DomRenderer.NAMESPACES[namespace];
79
- if (prefix === 'xmlns' || unqualifiedName.length && NAMESPACE[prefix]) {
80
- ns = NAMESPACE[prefix];
77
+ const prefix = 'xlink:';
78
+ if (key.startsWith(prefix)) {
79
+ const ns = key.substring(prefix.length);
80
+ node.removeAttributeNS(ns, key.substring(prefix.length));
81
+ }
82
+ else {
83
+ node.removeAttribute(key);
81
84
  }
82
- node.removeAttributeNS(ns, key);
83
85
  return;
84
86
  }
85
87
  if (key in node) {
package/bundles/index.js CHANGED
@@ -50,13 +50,14 @@ class DomRenderer extends core.NativeRenderer {
50
50
  }
51
51
  setProperty(node, key, value, namespace) {
52
52
  if (namespace) {
53
- const NAMESPACE = DomRenderer.NAMESPACES;
54
- const [prefix, ...unqualifiedName] = key.split(/(?=[A-Z])/);
55
- let ns = DomRenderer.NAMESPACES[namespace];
56
- if (prefix === 'xmlns' || unqualifiedName.length && NAMESPACE[prefix]) {
57
- ns = NAMESPACE[prefix];
53
+ const prefix = 'xlink:';
54
+ if (key.startsWith(prefix)) {
55
+ const ns = key.substring(prefix.length);
56
+ node.setAttributeNS(ns, key, String(value));
57
+ }
58
+ else {
59
+ node.setAttribute(key, String(value));
58
60
  }
59
- node.setAttributeNS(ns, key, String(value));
60
61
  return;
61
62
  }
62
63
  const map = this.propMap[node.tagName];
@@ -75,13 +76,14 @@ class DomRenderer extends core.NativeRenderer {
75
76
  }
76
77
  removeProperty(node, key, namespace) {
77
78
  if (namespace) {
78
- const NAMESPACE = DomRenderer.NAMESPACES;
79
- const [prefix, ...unqualifiedName] = key.split(/(?=[A-Z])/);
80
- let ns = DomRenderer.NAMESPACES[namespace];
81
- if (prefix === 'xmlns' || unqualifiedName.length && NAMESPACE[prefix]) {
82
- ns = NAMESPACE[prefix];
79
+ const prefix = 'xlink:';
80
+ if (key.startsWith(prefix)) {
81
+ const ns = key.substring(prefix.length);
82
+ node.removeAttributeNS(ns, key.substring(prefix.length));
83
+ }
84
+ else {
85
+ node.removeAttribute(key);
83
86
  }
84
- node.removeAttributeNS(ns, key);
85
87
  return;
86
88
  }
87
89
  if (key in node) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@viewfly/platform-browser",
3
- "version": "1.1.4",
3
+ "version": "1.1.5",
4
4
  "description": "This project is used to enable the Viewfly framework to run in a browser.",
5
5
  "main": "./bundles/index.js",
6
6
  "module": "./bundles/index.esm.js",
@@ -36,5 +36,5 @@
36
36
  "bugs": {
37
37
  "url": "https://github.com/viewfly/viewfly.git/issues"
38
38
  },
39
- "gitHead": "df4511ea7b631c5291da71b094c9da7d6d2d617f"
39
+ "gitHead": "984a2fbe9b736a7bbaed8996a3f25f4614bbeb14"
40
40
  }