@viewfly/platform-browser 1.0.0-alpha.11 → 1.0.0-alpha.13

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.
@@ -132,6 +132,7 @@ declare class DomRenderer extends NativeRenderer<HTMLElement, Text> {
132
132
  listen<T = any>(node: HTMLElement, type: string, callback: (ev: T) => any): void;
133
133
  unListen(node: HTMLElement, type: string, callback: (ev: any) => any): void;
134
134
  syncTextContent(target: Text, content: string): void;
135
+ private normalizedEventType;
135
136
  private insertBefore;
136
137
  }
137
138
 
@@ -95,14 +95,19 @@ class DomRenderer extends NativeRenderer {
95
95
  target.style[key] = '';
96
96
  }
97
97
  listen(node, type, callback) {
98
- node.addEventListener(type, callback);
98
+ const normalizedType = this.normalizedEventType(type);
99
+ node.addEventListener(normalizedType, callback);
99
100
  }
100
101
  unListen(node, type, callback) {
101
- node.removeEventListener(type, callback);
102
+ const normalizedType = this.normalizedEventType(type);
103
+ node.removeEventListener(normalizedType, callback);
102
104
  }
103
105
  syncTextContent(target, content) {
104
106
  target.textContent = content;
105
107
  }
108
+ normalizedEventType(type) {
109
+ return type.substring(2).toLowerCase();
110
+ }
106
111
  insertBefore(newNode, ref) {
107
112
  if (ref.parentNode) {
108
113
  ref.parentNode.insertBefore(newNode, ref);
package/bundles/index.js CHANGED
@@ -97,14 +97,19 @@ class DomRenderer extends core.NativeRenderer {
97
97
  target.style[key] = '';
98
98
  }
99
99
  listen(node, type, callback) {
100
- node.addEventListener(type, callback);
100
+ const normalizedType = this.normalizedEventType(type);
101
+ node.addEventListener(normalizedType, callback);
101
102
  }
102
103
  unListen(node, type, callback) {
103
- node.removeEventListener(type, callback);
104
+ const normalizedType = this.normalizedEventType(type);
105
+ node.removeEventListener(normalizedType, callback);
104
106
  }
105
107
  syncTextContent(target, content) {
106
108
  target.textContent = content;
107
109
  }
110
+ normalizedEventType(type) {
111
+ return type.substring(2).toLowerCase();
112
+ }
108
113
  insertBefore(newNode, ref) {
109
114
  if (ref.parentNode) {
110
115
  ref.parentNode.insertBefore(newNode, ref);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@viewfly/platform-browser",
3
- "version": "1.0.0-alpha.11",
3
+ "version": "1.0.0-alpha.13",
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",
@@ -14,7 +14,7 @@
14
14
  "license": "MIT",
15
15
  "keywords": [],
16
16
  "dependencies": {
17
- "@viewfly/core": "^1.0.0-alpha.11",
17
+ "@viewfly/core": "^1.0.0-alpha.13",
18
18
  "csstype": "^3.1.2"
19
19
  },
20
20
  "devDependencies": {
@@ -36,5 +36,5 @@
36
36
  "bugs": {
37
37
  "url": "https://github.com/viewfly/viewfly.git/issues"
38
38
  },
39
- "gitHead": "723da75a9e8e13e8addbe4646358667f476e06f3"
39
+ "gitHead": "ef79169385a2b104fc58cb0b38123443e5baccd7"
40
40
  }