@textbus/adapter-viewfly 4.0.0-alpha.30 → 4.0.0-alpha.32

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.
@@ -1,4 +1,4 @@
1
- import { JSXInternal, JSXNode, DynamicRef } from '@viewfly/core';
1
+ import { DynamicRef, JSXNode } from '@viewfly/core';
2
2
  import { Subject } from '@tanbo/stream';
3
3
  import { Component, Slot, VElement, VTextNode } from '@textbus/core';
4
4
  import { DomAdapter } from '@textbus/platform-browser';
@@ -1,6 +1,6 @@
1
1
  import { getCurrentInstance, onUpdated, createDynamicRef, jsx, DynamicRef } from '@viewfly/core';
2
- import { Subject } from '@tanbo/stream';
3
- import { makeError, VElement, VTextNode, replaceEmpty } from '@textbus/core';
2
+ import { Subject, merge } from '@tanbo/stream';
3
+ import { makeError, VElement, VTextNode, replaceEmpty, invokeListener } from '@textbus/core';
4
4
  import { DomAdapter } from '@textbus/platform-browser';
5
5
 
6
6
  const adapterError = makeError('ViewflyAdapter');
@@ -19,7 +19,7 @@ class Adapter extends DomAdapter {
19
19
  this.components[key] = (props) => {
20
20
  const comp = getCurrentInstance();
21
21
  const textbusComponent = props.component;
22
- textbusComponent.changeMarker.onChange.subscribe(() => {
22
+ merge(textbusComponent.changeMarker.onChange, textbusComponent.changeMarker.onForceChange).subscribe(() => {
23
23
  if (textbusComponent.changeMarker.dirty) {
24
24
  comp.markAsDirtied();
25
25
  }
@@ -31,6 +31,7 @@ class Adapter extends DomAdapter {
31
31
  isRoot = false;
32
32
  }
33
33
  onUpdated(() => {
34
+ this.componentRendingStack.pop();
34
35
  textbusComponent.changeMarker.rendered();
35
36
  });
36
37
  const component = props.component;
@@ -39,18 +40,14 @@ class Adapter extends DomAdapter {
39
40
  return () => {
40
41
  component.__slots__.length = 0;
41
42
  this.componentRendingStack.push(component);
42
- const vNode = instance();
43
- this.componentRendingStack.pop();
44
- return vNode;
43
+ return instance();
45
44
  };
46
45
  }
47
46
  const self = this;
48
47
  return Object.assign(Object.assign({}, instance), { $render() {
49
48
  component.__slots__.length = 0;
50
49
  self.componentRendingStack.push(component);
51
- const vNode = instance.$render();
52
- self.componentRendingStack.pop();
53
- return vNode;
50
+ return instance.$render();
54
51
  } });
55
52
  };
56
53
  });
@@ -92,6 +89,9 @@ class Adapter extends DomAdapter {
92
89
  }
93
90
  else {
94
91
  children.push(this.componentRender(child));
92
+ if (!this.firstRending) {
93
+ invokeListener(child, 'onParentSlotUpdated');
94
+ }
95
95
  }
96
96
  }
97
97
  const props = Object.assign({}, (Array.from(vNode.attrs).reduce((a, b) => {
package/bundles/index.js CHANGED
@@ -21,7 +21,7 @@ class Adapter extends platformBrowser.DomAdapter {
21
21
  this.components[key] = (props) => {
22
22
  const comp = core$1.getCurrentInstance();
23
23
  const textbusComponent = props.component;
24
- textbusComponent.changeMarker.onChange.subscribe(() => {
24
+ stream.merge(textbusComponent.changeMarker.onChange, textbusComponent.changeMarker.onForceChange).subscribe(() => {
25
25
  if (textbusComponent.changeMarker.dirty) {
26
26
  comp.markAsDirtied();
27
27
  }
@@ -33,6 +33,7 @@ class Adapter extends platformBrowser.DomAdapter {
33
33
  isRoot = false;
34
34
  }
35
35
  core$1.onUpdated(() => {
36
+ this.componentRendingStack.pop();
36
37
  textbusComponent.changeMarker.rendered();
37
38
  });
38
39
  const component = props.component;
@@ -41,18 +42,14 @@ class Adapter extends platformBrowser.DomAdapter {
41
42
  return () => {
42
43
  component.__slots__.length = 0;
43
44
  this.componentRendingStack.push(component);
44
- const vNode = instance();
45
- this.componentRendingStack.pop();
46
- return vNode;
45
+ return instance();
47
46
  };
48
47
  }
49
48
  const self = this;
50
49
  return Object.assign(Object.assign({}, instance), { $render() {
51
50
  component.__slots__.length = 0;
52
51
  self.componentRendingStack.push(component);
53
- const vNode = instance.$render();
54
- self.componentRendingStack.pop();
55
- return vNode;
52
+ return instance.$render();
56
53
  } });
57
54
  };
58
55
  });
@@ -94,6 +91,9 @@ class Adapter extends platformBrowser.DomAdapter {
94
91
  }
95
92
  else {
96
93
  children.push(this.componentRender(child));
94
+ if (!this.firstRending) {
95
+ core.invokeListener(child, 'onParentSlotUpdated');
96
+ }
97
97
  }
98
98
  }
99
99
  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-viewfly",
3
- "version": "4.0.0-alpha.30",
3
+ "version": "4.0.0-alpha.32",
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,9 +26,9 @@
26
26
  ],
27
27
  "dependencies": {
28
28
  "@tanbo/stream": "^1.2.3",
29
- "@textbus/core": "^4.0.0-alpha.30",
30
- "@textbus/platform-browser": "^4.0.0-alpha.30",
31
- "@viewfly/core": "^0.6.0"
29
+ "@textbus/core": "^4.0.0-alpha.31",
30
+ "@textbus/platform-browser": "^4.0.0-alpha.32",
31
+ "@viewfly/core": "^0.6.1"
32
32
  },
33
33
  "devDependencies": {
34
34
  "@rollup/plugin-commonjs": "^23.0.2",
@@ -48,5 +48,5 @@
48
48
  "bugs": {
49
49
  "url": "https://github.com/textbus/textbus.git/issues"
50
50
  },
51
- "gitHead": "9b14d8cf2a2473f31a36b51ee3d988ddecf776fb"
51
+ "gitHead": "00d52c23dde48068e14e46379b85ddac0743c6ff"
52
52
  }