@textbus/adapter-viewfly 4.0.0-alpha.18 → 4.0.0-alpha.19

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,10 +1,10 @@
1
- import { JSXComponent, JSXInternal, Ref } from '@viewfly/core';
1
+ import { JSXComponent, JSXInternal, DynamicRef } from '@viewfly/core';
2
2
  import { Subject } from '@tanbo/stream';
3
3
  import { Component, ComponentInstance, ExtractComponentInstanceType, Slot, VElement, VTextNode } from '@textbus/core';
4
4
  import { DomAdapter } from '@textbus/platform-browser';
5
5
  export interface ViewComponentProps<T extends Component = Component> {
6
6
  component: ExtractComponentInstanceType<T>;
7
- rootRef: Ref<HTMLElement>;
7
+ rootRef: DynamicRef<HTMLElement>;
8
8
  }
9
9
  export interface ViewflyAdapterComponents {
10
10
  [key: string]: JSXInternal.ComponentSetup<ViewComponentProps>;
@@ -1,4 +1,4 @@
1
- import { getCurrentInstance, onUpdated, useRef, jsx, Ref } from '@viewfly/core';
1
+ import { getCurrentInstance, onUpdated, createDynamicRef, jsx, DynamicRef } from '@viewfly/core';
2
2
  import { Subject } from '@tanbo/stream';
3
3
  import { makeError, VElement, VTextNode, replaceEmpty } from '@textbus/core';
4
4
  import { DomAdapter } from '@textbus/platform-browser';
@@ -41,7 +41,7 @@ class Adapter extends DomAdapter {
41
41
  if (comp) {
42
42
  let ref = this.componentRefs.get(component);
43
43
  if (!ref) {
44
- ref = useRef(rootNode => {
44
+ ref = createDynamicRef(rootNode => {
45
45
  this.componentRootElementCaches.set(component, rootNode);
46
46
  return () => {
47
47
  this.componentRootElementCaches.remove(component);
@@ -93,13 +93,13 @@ class Adapter extends DomAdapter {
93
93
  };
94
94
  const jsxNode = vNodeToJSX(vElement);
95
95
  const currentRef = jsxNode.props.ref;
96
- const ref = useRef(nativeNode => {
96
+ const ref = createDynamicRef(nativeNode => {
97
97
  this.slotRootNativeElementCaches.set(slot, nativeNode);
98
98
  return () => {
99
99
  this.slotRootNativeElementCaches.remove(slot);
100
100
  };
101
101
  });
102
- if (currentRef instanceof Ref) {
102
+ if (currentRef instanceof DynamicRef) {
103
103
  jsxNode.props.ref = [currentRef, ref];
104
104
  }
105
105
  else if (Array.isArray(currentRef)) {
package/bundles/index.js CHANGED
@@ -43,7 +43,7 @@ class Adapter extends platformBrowser.DomAdapter {
43
43
  if (comp) {
44
44
  let ref = this.componentRefs.get(component);
45
45
  if (!ref) {
46
- ref = core$1.useRef(rootNode => {
46
+ ref = core$1.createDynamicRef(rootNode => {
47
47
  this.componentRootElementCaches.set(component, rootNode);
48
48
  return () => {
49
49
  this.componentRootElementCaches.remove(component);
@@ -95,13 +95,13 @@ class Adapter extends platformBrowser.DomAdapter {
95
95
  };
96
96
  const jsxNode = vNodeToJSX(vElement);
97
97
  const currentRef = jsxNode.props.ref;
98
- const ref = core$1.useRef(nativeNode => {
98
+ const ref = core$1.createDynamicRef(nativeNode => {
99
99
  this.slotRootNativeElementCaches.set(slot, nativeNode);
100
100
  return () => {
101
101
  this.slotRootNativeElementCaches.remove(slot);
102
102
  };
103
103
  });
104
- if (currentRef instanceof core$1.Ref) {
104
+ if (currentRef instanceof core$1.DynamicRef) {
105
105
  jsxNode.props.ref = [currentRef, ref];
106
106
  }
107
107
  else if (Array.isArray(currentRef)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@textbus/adapter-viewfly",
3
- "version": "4.0.0-alpha.18",
3
+ "version": "4.0.0-alpha.19",
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.0",
29
- "@textbus/core": "^4.0.0-alpha.18",
30
- "@textbus/platform-browser": "^4.0.0-alpha.18",
31
- "@viewfly/core": "^0.4.0"
29
+ "@textbus/core": "^4.0.0-alpha.19",
30
+ "@textbus/platform-browser": "^4.0.0-alpha.19",
31
+ "@viewfly/core": "^0.5.0"
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": "e7887ee051c488286d669dd8ba396a05b7989107"
51
+ "gitHead": "7f951b0c4cf33aa7873e26d6e04da5a4301ca066"
52
52
  }