@textbus/adapter-react 4.0.0-alpha.0 → 4.0.0-alpha.1
Sign up to get free protection for your applications and to get access to all the features.
- package/bundles/adapter.d.ts +3 -0
- package/bundles/index.esm.js +4 -2
- package/bundles/index.js +4 -2
- package/package.json +4 -4
package/bundles/adapter.d.ts
CHANGED
@@ -9,6 +9,9 @@ export interface ViewComponentProps<T extends Component = Component> {
|
|
9
9
|
export interface ReactAdapterComponents {
|
10
10
|
[key: string]: (props: ViewComponentProps) => JSX.Element;
|
11
11
|
}
|
12
|
+
/**
|
13
|
+
* Textbus 桥接 React 渲染能力适配器,用于在 React 项目中渲染 Textbus 数据
|
14
|
+
*/
|
12
15
|
export declare class Adapter extends DomAdapter<JSX.Element, JSX.Element> {
|
13
16
|
onViewUpdated: Subject<void>;
|
14
17
|
private components;
|
package/bundles/index.esm.js
CHANGED
@@ -16,6 +16,9 @@ Node.prototype.removeChild = function (child) {
|
|
16
16
|
};
|
17
17
|
// hack end
|
18
18
|
const adapterError = makeError('ReactAdapter');
|
19
|
+
/**
|
20
|
+
* Textbus 桥接 React 渲染能力适配器,用于在 React 项目中渲染 Textbus 数据
|
21
|
+
*/
|
19
22
|
class Adapter extends DomAdapter {
|
20
23
|
constructor(components, mount) {
|
21
24
|
super(mount);
|
@@ -45,7 +48,7 @@ class Adapter extends DomAdapter {
|
|
45
48
|
this.componentRootElementCaches.set(component, rootNode);
|
46
49
|
}
|
47
50
|
else {
|
48
|
-
this.componentRootElementCaches.
|
51
|
+
this.componentRootElementCaches.remove(component);
|
49
52
|
}
|
50
53
|
}
|
51
54
|
});
|
@@ -78,7 +81,6 @@ class Adapter extends DomAdapter {
|
|
78
81
|
}
|
79
82
|
else {
|
80
83
|
children.push(this.componentRender(child));
|
81
|
-
child.changeMarker.rendered();
|
82
84
|
}
|
83
85
|
}
|
84
86
|
const props = Object.assign({}, (Array.from(vNode.attrs).reduce((a, b) => {
|
package/bundles/index.js
CHANGED
@@ -18,6 +18,9 @@ Node.prototype.removeChild = function (child) {
|
|
18
18
|
};
|
19
19
|
// hack end
|
20
20
|
const adapterError = core.makeError('ReactAdapter');
|
21
|
+
/**
|
22
|
+
* Textbus 桥接 React 渲染能力适配器,用于在 React 项目中渲染 Textbus 数据
|
23
|
+
*/
|
21
24
|
class Adapter extends platformBrowser.DomAdapter {
|
22
25
|
constructor(components, mount) {
|
23
26
|
super(mount);
|
@@ -47,7 +50,7 @@ class Adapter extends platformBrowser.DomAdapter {
|
|
47
50
|
this.componentRootElementCaches.set(component, rootNode);
|
48
51
|
}
|
49
52
|
else {
|
50
|
-
this.componentRootElementCaches.
|
53
|
+
this.componentRootElementCaches.remove(component);
|
51
54
|
}
|
52
55
|
}
|
53
56
|
});
|
@@ -80,7 +83,6 @@ class Adapter extends platformBrowser.DomAdapter {
|
|
80
83
|
}
|
81
84
|
else {
|
82
85
|
children.push(this.componentRender(child));
|
83
|
-
child.changeMarker.rendered();
|
84
86
|
}
|
85
87
|
}
|
86
88
|
const props = Object.assign({}, (Array.from(vNode.attrs).reduce((a, b) => {
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@textbus/adapter-react",
|
3
|
-
"version": "4.0.0-alpha.
|
3
|
+
"version": "4.0.0-alpha.1",
|
4
4
|
"description": "Textbus is a rich text editor and framework that is highly customizable and extensible to achieve rich wysiwyg effects.",
|
5
5
|
"main": "./bundles/index.js",
|
6
6
|
"module": "./bundles/index.esm.js",
|
@@ -26,8 +26,8 @@
|
|
26
26
|
],
|
27
27
|
"dependencies": {
|
28
28
|
"@tanbo/stream": "^1.2.0",
|
29
|
-
"@textbus/core": "^4.0.0-alpha.
|
30
|
-
"@textbus/platform-browser": "^4.0.0-alpha.
|
29
|
+
"@textbus/core": "^4.0.0-alpha.1",
|
30
|
+
"@textbus/platform-browser": "^4.0.0-alpha.1",
|
31
31
|
"react": "^18.2.0"
|
32
32
|
},
|
33
33
|
"devDependencies": {
|
@@ -49,5 +49,5 @@
|
|
49
49
|
"bugs": {
|
50
50
|
"url": "https://github.com/textbus/textbus.git/issues"
|
51
51
|
},
|
52
|
-
"gitHead": "
|
52
|
+
"gitHead": "c66a476c5776f8cf719ebb0f9e7adebb391f82c1"
|
53
53
|
}
|