@textbus/adapter-viewfly 4.0.0-alpha.39 → 4.0.0-alpha.41

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 { getCurrentInstance, onUpdated, createDynamicRef, jsx, DynamicRef } from '@viewfly/core';
1
+ import { withAnnotation, getCurrentInstance, onUpdated, createDynamicRef, jsx, DynamicRef } from '@viewfly/core';
2
2
  import { Subject, merge } from '@tanbo/stream';
3
3
  import { makeError, VElement, VTextNode, replaceEmpty, invokeListener } from '@textbus/core';
4
4
  import { DomAdapter } from '@textbus/platform-browser';
@@ -15,8 +15,8 @@ class Adapter extends DomAdapter {
15
15
  this.componentRefs = new WeakMap();
16
16
  this.componentRendingStack = [];
17
17
  let isRoot = true;
18
- Object.keys(components).forEach(key => {
19
- this.components[key] = (props) => {
18
+ Object.entries(components).forEach(([key, viewFlyComponent]) => {
19
+ this.components[key] = withAnnotation(Object.assign({}, viewFlyComponent.annotation), (props) => {
20
20
  const comp = getCurrentInstance();
21
21
  const textbusComponent = props.component;
22
22
  merge(textbusComponent.changeMarker.onChange, textbusComponent.changeMarker.onForceChange).subscribe(() => {
@@ -42,7 +42,7 @@ class Adapter extends DomAdapter {
42
42
  }
43
43
  });
44
44
  const component = props.component;
45
- const instance = components[key](props);
45
+ const instance = viewFlyComponent(props);
46
46
  if (typeof instance === 'function') {
47
47
  return () => {
48
48
  component.__slots__.forEach(i => this.renderedSlotCache.delete(i));
@@ -58,7 +58,7 @@ class Adapter extends DomAdapter {
58
58
  self.componentRendingStack.push(component);
59
59
  return instance.$render();
60
60
  } });
61
- };
61
+ });
62
62
  });
63
63
  }
64
64
  componentRender(component) {
package/bundles/index.js CHANGED
@@ -17,8 +17,8 @@ class Adapter extends platformBrowser.DomAdapter {
17
17
  this.componentRefs = new WeakMap();
18
18
  this.componentRendingStack = [];
19
19
  let isRoot = true;
20
- Object.keys(components).forEach(key => {
21
- this.components[key] = (props) => {
20
+ Object.entries(components).forEach(([key, viewFlyComponent]) => {
21
+ this.components[key] = core$1.withAnnotation(Object.assign({}, viewFlyComponent.annotation), (props) => {
22
22
  const comp = core$1.getCurrentInstance();
23
23
  const textbusComponent = props.component;
24
24
  stream.merge(textbusComponent.changeMarker.onChange, textbusComponent.changeMarker.onForceChange).subscribe(() => {
@@ -44,7 +44,7 @@ class Adapter extends platformBrowser.DomAdapter {
44
44
  }
45
45
  });
46
46
  const component = props.component;
47
- const instance = components[key](props);
47
+ const instance = viewFlyComponent(props);
48
48
  if (typeof instance === 'function') {
49
49
  return () => {
50
50
  component.__slots__.forEach(i => this.renderedSlotCache.delete(i));
@@ -60,7 +60,7 @@ class Adapter extends platformBrowser.DomAdapter {
60
60
  self.componentRendingStack.push(component);
61
61
  return instance.$render();
62
62
  } });
63
- };
63
+ });
64
64
  });
65
65
  }
66
66
  componentRender(component) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@textbus/adapter-viewfly",
3
- "version": "4.0.0-alpha.39",
3
+ "version": "4.0.0-alpha.41",
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.39",
30
- "@textbus/platform-browser": "^4.0.0-alpha.39",
31
- "@viewfly/core": "^1.0.0-alpha.0"
29
+ "@textbus/core": "^4.0.0-alpha.41",
30
+ "@textbus/platform-browser": "^4.0.0-alpha.41",
31
+ "@viewfly/core": "^1.0.0-alpha.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": "6c5f853e09df7cdc7464af4946b487574ae6dcda"
51
+ "gitHead": "b5c18b176790c339fb7fb35e3d427b8a81ffcd84"
52
52
  }