@textbus/adapter-viewfly 5.1.0 → 5.1.2

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.
@@ -74,12 +74,16 @@ class ViewflyAdapter extends DomAdapter {
74
74
  throw adapterError(`cannot found view component \`${component.name}\`!`);
75
75
  },
76
76
  vElementToViewElement(vNode, children) {
77
- const key = vNode.attrs.get('key');
78
- vNode.attrs.delete('key');
79
- const props = Object.assign({}, (Array.from(vNode.attrs).reduce((a, b) => {
80
- a[b[0]] = b[1];
77
+ let key;
78
+ const props = Array.from(vNode.attrs).reduce((a, b) => {
79
+ const propName = b[0];
80
+ if (propName === 'key') {
81
+ key = b[1];
82
+ return a;
83
+ }
84
+ a[propName] = b[1];
81
85
  return a;
82
- }, {})));
86
+ }, {});
83
87
  if (vNode.classes.size) {
84
88
  props.class = Array.from(vNode.classes).join(' ');
85
89
  }
package/bundles/index.js CHANGED
@@ -76,12 +76,16 @@ class ViewflyAdapter extends platformBrowser.DomAdapter {
76
76
  throw adapterError(`cannot found view component \`${component.name}\`!`);
77
77
  },
78
78
  vElementToViewElement(vNode, children) {
79
- const key = vNode.attrs.get('key');
80
- vNode.attrs.delete('key');
81
- const props = Object.assign({}, (Array.from(vNode.attrs).reduce((a, b) => {
82
- a[b[0]] = b[1];
79
+ let key;
80
+ const props = Array.from(vNode.attrs).reduce((a, b) => {
81
+ const propName = b[0];
82
+ if (propName === 'key') {
83
+ key = b[1];
84
+ return a;
85
+ }
86
+ a[propName] = b[1];
83
87
  return a;
84
- }, {})));
88
+ }, {});
85
89
  if (vNode.classes.size) {
86
90
  props.class = Array.from(vNode.classes).join(' ');
87
91
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@textbus/adapter-viewfly",
3
- "version": "5.1.0",
3
+ "version": "5.1.2",
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,11 +26,11 @@
26
26
  ],
27
27
  "dependencies": {
28
28
  "@tanbo/stream": "^1.2.7",
29
- "@textbus/core": "^5.1.0",
30
- "@textbus/platform-browser": "^5.1.0",
31
- "@textbus/platform-node": "^5.1.0",
32
- "@viewfly/core": "^2.0.0-alpha.6",
33
- "@viewfly/platform-browser": "^2.0.0-alpha.6"
29
+ "@textbus/core": "^5.1.2",
30
+ "@textbus/platform-browser": "^5.1.2",
31
+ "@textbus/platform-node": "^5.1.2",
32
+ "@viewfly/core": "^2.0.0",
33
+ "@viewfly/platform-browser": "^2.0.0"
34
34
  },
35
35
  "devDependencies": {
36
36
  "@rollup/plugin-commonjs": "^28.0.2",