@viewfly/platform-browser 2.0.0-alpha.5 → 2.0.0-alpha.7
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.
- package/bundles/index.d.ts +2 -0
- package/bundles/index.esm.js +18 -0
- package/bundles/index.js +18 -0
- package/package.json +3 -3
package/bundles/index.d.ts
CHANGED
|
@@ -87,6 +87,7 @@ declare class HTMLRenderer extends NativeRenderer<VDOMElement, VDOMText> {
|
|
|
87
87
|
cleanChildren(node: VDOMElement): void;
|
|
88
88
|
syncTextContent(target: VDOMText, content: string): void;
|
|
89
89
|
insertAfter(newNode: VDOMElement | VDOMText, ref: VDOMElement | VDOMText): void;
|
|
90
|
+
getNameSpace(): void;
|
|
90
91
|
}
|
|
91
92
|
/**
|
|
92
93
|
* 轻量 DOM 转换为 HTML 字符串的转换器
|
|
@@ -126,6 +127,7 @@ declare class DomRenderer extends NativeRenderer<HTMLElement, Text> {
|
|
|
126
127
|
listen<T = any>(node: HTMLElement, type: string, callback: (ev: T) => any): void;
|
|
127
128
|
unListen(node: HTMLElement, type: string, callback: (ev: any) => any): void;
|
|
128
129
|
syncTextContent(target: Text, content: string): void;
|
|
130
|
+
getNameSpace(type: string, namespace: ElementNamespace): string | void;
|
|
129
131
|
private normalizedEventType;
|
|
130
132
|
private insertBefore;
|
|
131
133
|
}
|
package/bundles/index.esm.js
CHANGED
|
@@ -124,6 +124,21 @@ class DomRenderer extends NativeRenderer {
|
|
|
124
124
|
syncTextContent(target, content) {
|
|
125
125
|
target.textContent = content;
|
|
126
126
|
}
|
|
127
|
+
getNameSpace(type, namespace) {
|
|
128
|
+
if (namespace === 'svg') {
|
|
129
|
+
if (type === 'foreignObject') {
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
return namespace;
|
|
133
|
+
}
|
|
134
|
+
if (type === 'svg') {
|
|
135
|
+
return type;
|
|
136
|
+
}
|
|
137
|
+
if (type === 'math') {
|
|
138
|
+
return 'mathml';
|
|
139
|
+
}
|
|
140
|
+
return namespace;
|
|
141
|
+
}
|
|
127
142
|
normalizedEventType(type) {
|
|
128
143
|
return type.substring(2).toLowerCase();
|
|
129
144
|
}
|
|
@@ -329,6 +344,9 @@ class HTMLRenderer extends NativeRenderer {
|
|
|
329
344
|
console.warn(`Element "${ref instanceof VDOMText ? ref.text : ref.name}" was accidentally deleted, and viewfly is unable to update the current view`);
|
|
330
345
|
}
|
|
331
346
|
}
|
|
347
|
+
getNameSpace() {
|
|
348
|
+
//
|
|
349
|
+
}
|
|
332
350
|
}
|
|
333
351
|
/**
|
|
334
352
|
* 轻量 DOM 转换为 HTML 字符串的转换器
|
package/bundles/index.js
CHANGED
|
@@ -126,6 +126,21 @@ class DomRenderer extends core.NativeRenderer {
|
|
|
126
126
|
syncTextContent(target, content) {
|
|
127
127
|
target.textContent = content;
|
|
128
128
|
}
|
|
129
|
+
getNameSpace(type, namespace) {
|
|
130
|
+
if (namespace === 'svg') {
|
|
131
|
+
if (type === 'foreignObject') {
|
|
132
|
+
return;
|
|
133
|
+
}
|
|
134
|
+
return namespace;
|
|
135
|
+
}
|
|
136
|
+
if (type === 'svg') {
|
|
137
|
+
return type;
|
|
138
|
+
}
|
|
139
|
+
if (type === 'math') {
|
|
140
|
+
return 'mathml';
|
|
141
|
+
}
|
|
142
|
+
return namespace;
|
|
143
|
+
}
|
|
129
144
|
normalizedEventType(type) {
|
|
130
145
|
return type.substring(2).toLowerCase();
|
|
131
146
|
}
|
|
@@ -331,6 +346,9 @@ class HTMLRenderer extends core.NativeRenderer {
|
|
|
331
346
|
console.warn(`Element "${ref instanceof VDOMText ? ref.text : ref.name}" was accidentally deleted, and viewfly is unable to update the current view`);
|
|
332
347
|
}
|
|
333
348
|
}
|
|
349
|
+
getNameSpace() {
|
|
350
|
+
//
|
|
351
|
+
}
|
|
334
352
|
}
|
|
335
353
|
/**
|
|
336
354
|
* 轻量 DOM 转换为 HTML 字符串的转换器
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@viewfly/platform-browser",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
3
|
+
"version": "2.0.0-alpha.7",
|
|
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": "^2.0.0-alpha.
|
|
17
|
+
"@viewfly/core": "^2.0.0-alpha.7",
|
|
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": "
|
|
39
|
+
"gitHead": "b66ca589f7662cd518fc2e5955b3e3ff9de83f94"
|
|
40
40
|
}
|