@textbus/adapter-vue 4.2.0 → 4.2.1
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.esm.js +15 -1
- package/bundles/index.js +14 -0
- package/bundles/vue-adapter.d.ts +2 -0
- package/package.json +3 -3
package/bundles/index.esm.js
CHANGED
@@ -1,6 +1,7 @@
|
|
1
|
-
import { makeError, VElement, VTextNode } from '@textbus/core';
|
1
|
+
import { makeError, VElement, VTextNode, Adapter } from '@textbus/core';
|
2
2
|
import { ref, h, getCurrentInstance, onMounted, onUpdated, onUnmounted } from 'vue';
|
3
3
|
import { DomAdapter } from '@textbus/platform-browser';
|
4
|
+
import { ReflectiveInjector } from '@viewfly/core';
|
4
5
|
|
5
6
|
const adapterError = makeError('VueAdapter');
|
6
7
|
class VueAdapter extends DomAdapter {
|
@@ -121,6 +122,19 @@ class VueAdapter extends DomAdapter {
|
|
121
122
|
this.components[key] = vueComponent;
|
122
123
|
});
|
123
124
|
}
|
125
|
+
render(rootComponent, injector) {
|
126
|
+
const childrenInjector = new ReflectiveInjector(injector, [{
|
127
|
+
provide: Adapter,
|
128
|
+
useValue: this
|
129
|
+
}, {
|
130
|
+
provide: DomAdapter,
|
131
|
+
useValue: this,
|
132
|
+
}, {
|
133
|
+
provide: VueAdapter,
|
134
|
+
useValue: this
|
135
|
+
}]);
|
136
|
+
return super.render(rootComponent, childrenInjector);
|
137
|
+
}
|
124
138
|
copy() {
|
125
139
|
document.execCommand('copy');
|
126
140
|
}
|
package/bundles/index.js
CHANGED
@@ -3,6 +3,7 @@
|
|
3
3
|
var core = require('@textbus/core');
|
4
4
|
var vue = require('vue');
|
5
5
|
var platformBrowser = require('@textbus/platform-browser');
|
6
|
+
var core$1 = require('@viewfly/core');
|
6
7
|
|
7
8
|
const adapterError = core.makeError('VueAdapter');
|
8
9
|
class VueAdapter extends platformBrowser.DomAdapter {
|
@@ -123,6 +124,19 @@ class VueAdapter extends platformBrowser.DomAdapter {
|
|
123
124
|
this.components[key] = vueComponent;
|
124
125
|
});
|
125
126
|
}
|
127
|
+
render(rootComponent, injector) {
|
128
|
+
const childrenInjector = new core$1.ReflectiveInjector(injector, [{
|
129
|
+
provide: core.Adapter,
|
130
|
+
useValue: this
|
131
|
+
}, {
|
132
|
+
provide: platformBrowser.DomAdapter,
|
133
|
+
useValue: this,
|
134
|
+
}, {
|
135
|
+
provide: VueAdapter,
|
136
|
+
useValue: this
|
137
|
+
}]);
|
138
|
+
return super.render(rootComponent, childrenInjector);
|
139
|
+
}
|
126
140
|
copy() {
|
127
141
|
document.execCommand('copy');
|
128
142
|
}
|
package/bundles/vue-adapter.d.ts
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
import { Component, ViewMount } from '@textbus/core';
|
2
2
|
import { DefineComponent, Ref, VNode } from 'vue';
|
3
3
|
import { DomAdapter } from '@textbus/platform-browser';
|
4
|
+
import { Injector } from '@viewfly/core';
|
4
5
|
export interface ViewComponentProps<T extends Component> {
|
5
6
|
component: T;
|
6
7
|
rootRef: Ref<Element | undefined>;
|
@@ -12,5 +13,6 @@ export declare class VueAdapter extends DomAdapter<VNode, VNode> {
|
|
12
13
|
private componentRefs;
|
13
14
|
private components;
|
14
15
|
constructor(components: VueAdapterComponents, mount: ViewMount<VNode, Element>);
|
16
|
+
render(rootComponent: Component, injector: Injector): void | (() => void);
|
15
17
|
copy(): void;
|
16
18
|
}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@textbus/adapter-vue",
|
3
|
-
"version": "4.2.
|
3
|
+
"version": "4.2.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.5",
|
29
|
-
"@textbus/core": "^4.2.
|
30
|
-
"@textbus/platform-browser": "^4.2.
|
29
|
+
"@textbus/core": "^4.2.1",
|
30
|
+
"@textbus/platform-browser": "^4.2.1",
|
31
31
|
"vue": "^3.4.28"
|
32
32
|
},
|
33
33
|
"devDependencies": {
|