@textbus/adapter-vue 4.3.3 → 4.3.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.
@@ -2,6 +2,7 @@ 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
4
  import { ReflectiveInjector } from '@viewfly/core';
5
+ import { merge } from '@tanbo/stream';
5
6
 
6
7
  const adapterError = makeError('VueAdapter');
7
8
  class VueAdapter extends DomAdapter {
@@ -80,8 +81,18 @@ class VueAdapter extends DomAdapter {
80
81
  }
81
82
  }, mount);
82
83
  // private compositionRef = ref<Element>()
83
- this.componentRefs = new WeakMap();
84
- this.components = {};
84
+ Object.defineProperty(this, "componentRefs", {
85
+ enumerable: true,
86
+ configurable: true,
87
+ writable: true,
88
+ value: new WeakMap()
89
+ });
90
+ Object.defineProperty(this, "components", {
91
+ enumerable: true,
92
+ configurable: true,
93
+ writable: true,
94
+ value: {}
95
+ });
85
96
  // watchEffect(() => {
86
97
  // this.compositionNode = this.compositionRef.value || null
87
98
  // })
@@ -92,7 +103,7 @@ class VueAdapter extends DomAdapter {
92
103
  vueComponent.setup = function (props, context, ...args) {
93
104
  const component = props.component;
94
105
  const vueInstance = getCurrentInstance();
95
- const sub = component.changeMarker.onChange.subscribe(() => {
106
+ const sub = merge(component.changeMarker.onChange, component.changeMarker.onForceChange).subscribe(() => {
96
107
  if (component.changeMarker.dirty) {
97
108
  vueInstance.proxy.$forceUpdate();
98
109
  }
package/bundles/index.js CHANGED
@@ -4,6 +4,7 @@ var core = require('@textbus/core');
4
4
  var vue = require('vue');
5
5
  var platformBrowser = require('@textbus/platform-browser');
6
6
  var core$1 = require('@viewfly/core');
7
+ var stream = require('@tanbo/stream');
7
8
 
8
9
  const adapterError = core.makeError('VueAdapter');
9
10
  class VueAdapter extends platformBrowser.DomAdapter {
@@ -82,8 +83,18 @@ class VueAdapter extends platformBrowser.DomAdapter {
82
83
  }
83
84
  }, mount);
84
85
  // private compositionRef = ref<Element>()
85
- this.componentRefs = new WeakMap();
86
- this.components = {};
86
+ Object.defineProperty(this, "componentRefs", {
87
+ enumerable: true,
88
+ configurable: true,
89
+ writable: true,
90
+ value: new WeakMap()
91
+ });
92
+ Object.defineProperty(this, "components", {
93
+ enumerable: true,
94
+ configurable: true,
95
+ writable: true,
96
+ value: {}
97
+ });
87
98
  // watchEffect(() => {
88
99
  // this.compositionNode = this.compositionRef.value || null
89
100
  // })
@@ -94,7 +105,7 @@ class VueAdapter extends platformBrowser.DomAdapter {
94
105
  vueComponent.setup = function (props, context, ...args) {
95
106
  const component = props.component;
96
107
  const vueInstance = vue.getCurrentInstance();
97
- const sub = component.changeMarker.onChange.subscribe(() => {
108
+ const sub = stream.merge(component.changeMarker.onChange, component.changeMarker.onForceChange).subscribe(() => {
98
109
  if (component.changeMarker.dirty) {
99
110
  vueInstance.proxy.$forceUpdate();
100
111
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@textbus/adapter-vue",
3
- "version": "4.3.3",
3
+ "version": "4.3.5",
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.6",
29
- "@textbus/core": "^4.3.3",
30
- "@textbus/platform-browser": "^4.3.3",
29
+ "@textbus/core": "^4.3.5",
30
+ "@textbus/platform-browser": "^4.3.5",
31
31
  "vue": "^3.4.28"
32
32
  },
33
33
  "devDependencies": {
@@ -48,5 +48,5 @@
48
48
  "bugs": {
49
49
  "url": "https://github.com/textbus/textbus.git/issues"
50
50
  },
51
- "gitHead": "d07e5acf88c96bb8eb37760fd71ccc00ae5d3f5b"
51
+ "gitHead": "f67cb5a86aa108dfdb3bc28078b07824dd93e60d"
52
52
  }