@textbus/adapter-viewfly 5.2.3 → 5.2.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.
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../src/viewfly-adapter.ts","../src/viewfly-vdom-adapter.ts"],"sourcesContent":["import { Component, CompositionState, makeError, VElement, ViewMount, VTextNode, merge, Adapter } from '@textbus/core'\nimport {\n ComponentSetup,\n createDynamicRef,\n DynamicRef,\n getCurrentInstance, Injector,\n jsx,\n JSXNode, onUnmounted,\n onUpdated, ReflectiveInjector,\n ViewFlyNode,\n} from '@viewfly/core'\nimport { DomAdapter } from '@textbus/platform-browser'\n\nconst adapterError = makeError('ViewflyDOMRenderer')\n\nexport interface ViewComponentProps<T extends Component> {\n component: T\n rootRef: DynamicRef<Element>\n}\n\nexport interface ViewflyAdapterComponents {\n [key: string]: ComponentSetup<ViewComponentProps<any>>\n}\n\nexport class ViewflyAdapter extends DomAdapter<ViewFlyNode, ViewFlyNode> {\n private components: ViewflyAdapterComponents = {}\n\n private componentRefs = new WeakMap<Component, DynamicRef<Element>>()\n\n constructor(components: ViewflyAdapterComponents,\n mount: ViewMount<ViewFlyNode, Element>\n ) {\n super({\n createCompositionNode(compositionState: CompositionState,\n updateNativeCompositionNode: (nativeNode: (Element | null)) => void): VElement {\n const ref = createDynamicRef<Element>(node => {\n updateNativeCompositionNode(node)\n return () => {\n updateNativeCompositionNode(null)\n }\n })\n return new VElement('span', {\n style: {\n textDecoration: 'underline'\n },\n ref\n }, [\n new VTextNode(compositionState.text)\n ])\n },\n getParentNode(node: Element | Text): Element | null {\n return (node as Node).parentNode as Element\n },\n getChildNodes(parentElement: Element): Array<Element | Text> {\n return Array.from(parentElement.childNodes) as Element[]\n },\n isNativeElementNode(node: Element | Text): node is Element {\n return node instanceof Element\n },\n getChildByIndex(parentElement, index) {\n return parentElement.childNodes[index] as Element\n },\n getAndUpdateSlotRootNativeElement(vEle: VElement, update: (nativeElement: (Element | null)) => void) {\n const currentRef = vEle.attrs.get('ref')\n const ref = createDynamicRef<Element>(nativeNode => {\n update(nativeNode)\n return () => {\n update(null)\n }\n })\n if (typeof currentRef === 'function') {\n vEle.attrs.set('ref', [currentRef, ref])\n } else if (Array.isArray(currentRef)) {\n currentRef.push(ref)\n } else {\n vEle.attrs.set('ref', ref)\n }\n },\n componentRender: (component: Component<any>): ViewFlyNode => {\n const comp = this.components[component.name] || this.components['*']\n if (comp) {\n let ref = this.componentRefs.get(component)\n if (!ref) {\n ref = createDynamicRef<Element>(rootNode => {\n this.componentRootElementCaches.set(component, rootNode)\n return () => {\n // 当组件移动层级位置到原位置之前并重新渲染后,由于时序的原因,再删除缓存会导致组件找不到对应视图节点\n if (this.componentRootElementCaches.get(component) === rootNode) {\n this.componentRootElementCaches.remove(component)\n }\n }\n })\n this.componentRefs.set(component, ref)\n }\n return jsx(comp, {\n component,\n rootRef: ref\n }, component.id)\n }\n throw adapterError(`cannot found view component \\`${component.name}\\`!`)\n },\n vElementToViewElement(vNode: VElement, children: Array<JSXNode>): ViewFlyNode {\n let key: any\n const props = Array.from(vNode.attrs).reduce((a, b) => {\n const propName = b[0]\n if (propName === 'key') {\n key = b[1]\n return a\n }\n a[propName] = b[1]\n return a\n }, {} as Record<string, any>)\n if (vNode.classes.size) {\n props.class = Array.from(vNode.classes).join(' ')\n }\n if (vNode.styles) {\n props.style = Array.from(vNode.styles).reduce((a, b) => {\n a[b[0]] = b[1]\n return a\n }, {} as Record<string, any>)\n }\n if (children.length) {\n props.children = children\n }\n return jsx(vNode.tagName, props, key)\n }\n }, mount)\n\n let isRoot = true\n Object.entries(components).forEach(([key, viewFlyComponent]) => {\n this.components[key] = (props: ViewComponentProps<Component>) => {\n const comp = getCurrentInstance()\n const textbusComponent = props.component\n const subscription = merge(textbusComponent.changeMarker.onChange,\n textbusComponent.changeMarker.onForceChange).subscribe(() => {\n if (textbusComponent.changeMarker.dirty) {\n comp.markAsDirtied()\n }\n })\n onUnmounted(() => {\n subscription.unsubscribe()\n })\n if (isRoot) {\n onUpdated(() => {\n this.onViewUpdated.next()\n })\n isRoot = false\n }\n onUpdated(() => {\n textbusComponent.changeMarker.rendered()\n if (!this.componentRootElementCaches.get(textbusComponent)) {\n // eslint-disable-next-line max-len\n throw adapterError(`Component \\`${textbusComponent.name}\\` is not bound to rootRef, you must bind rootRef to the root element node of the component view.`)\n }\n })\n return viewFlyComponent(props)\n }\n })\n }\n\n override render(rootComponent: Component, injector: Injector): void | (() => void) {\n const childInjector = new ReflectiveInjector(injector, [{\n provide: Adapter,\n useValue: this\n }, {\n provide: DomAdapter,\n useValue: this\n }, {\n provide: ViewflyAdapter,\n useValue: this\n }])\n return super.render(rootComponent, childInjector)\n }\n\n override copy() {\n document.execCommand('copy')\n }\n}\n","import { NodeViewAdapter } from '@textbus/platform-node'\nimport { Injector, ReflectiveInjector } from '@viewfly/core'\nimport { Adapter, Component } from '@textbus/core'\nimport { DomAdapter } from '@textbus/platform-browser'\nimport { ViewflyAdapter } from './viewfly-adapter'\n\nexport class ViewflyVDomAdapter extends NodeViewAdapter {\n override render(rootComponent: Component, injector: Injector): void | (() => void) {\n const childInjector = new ReflectiveInjector(injector, [{\n provide: Adapter,\n useValue: this\n }, {\n provide: DomAdapter,\n useValue: this\n }, {\n provide: ViewflyAdapter,\n useValue: this\n }])\n return super.render(rootComponent, childInjector)\n }\n}\n"],"names":["makeError","DomAdapter","createDynamicRef","VElement","VTextNode","jsx","getCurrentInstance","merge","onUnmounted","onUpdated","ReflectiveInjector","Adapter","NodeViewAdapter"],"mappings":";;;;;;AAaA,MAAM,eAAeA,KAAAA,UAAU,oBAAoB;AAW5C,MAAM,uBAAuBC,gBAAAA,WAAqC;AAAA,EAC/D,aAAuC,CAAA;AAAA,EAEvC,oCAAoB,QAAA;AAAA,EAE5B,YAAY,YACA,OACV;AACA,UAAM;AAAA,MACJ,sBAAsB,kBACA,6BAA+E;AACnG,cAAM,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AAU;AAAA,IAAA,GACT;AAAA,MACD,SAASV,gBAAAA;AAAAA,MACT,UAAU;AAAA,IAAA,GACT;AAAA,MACD,SAAS;AAAA,MACT,UAAU;AAAA,IAAA,CACX,CAAC;AACF,WAAO,MAAM,OAAO,eAAe,aAAa;AAAA,EAClD;AACF;;;"}
1
+ {"version":3,"file":"index.js","sources":["../src/viewfly-adapter.ts","../src/viewfly-vdom-adapter.ts"],"sourcesContent":["import { Component, CompositionState, makeError, VElement, ViewMount, VTextNode, merge, Adapter } from '@textbus/core'\nimport {\n ComponentSetup,\n createDynamicRef,\n DynamicRef,\n getCurrentInstance, Injector,\n jsx,\n JSXNode, onUnmounted,\n onUpdated, ReflectiveInjector,\n ViewFlyNode,\n} from '@viewfly/core'\nimport { DomAdapter } from '@textbus/platform-browser'\n\nconst adapterError = makeError('ViewflyDOMRenderer')\n\nexport interface ViewComponentProps<T extends Component> {\n component: T\n rootRef: DynamicRef<Element>\n}\n\nexport interface ViewflyAdapterComponents {\n [key: string]: ComponentSetup<ViewComponentProps<any>>\n}\n\nexport class ViewflyAdapter extends DomAdapter<ViewFlyNode, ViewFlyNode> {\n private components: ViewflyAdapterComponents = {}\n\n private componentRefs = new WeakMap<Component, DynamicRef<Element>>()\n\n constructor(components: ViewflyAdapterComponents,\n mount: ViewMount<ViewFlyNode, Element>\n ) {\n super({\n createCompositionNode(compositionState: CompositionState,\n updateNativeCompositionNode: (nativeNode: (Element | null)) => void): VElement {\n const ref = createDynamicRef<Element>(node => {\n updateNativeCompositionNode(node)\n return () => {\n updateNativeCompositionNode(null)\n }\n })\n return new VElement('span', {\n style: {\n textDecoration: 'underline'\n },\n ref\n }, [\n new VTextNode(compositionState.text)\n ])\n },\n getParentNode(node: Element | Text): Element | null {\n return (node as Node).parentNode as Element\n },\n getChildNodes(parentElement: Element): Array<Element | Text> {\n return Array.from(parentElement.childNodes) as Element[]\n },\n isNativeElementNode(node: Element | Text): node is Element {\n return node instanceof Element\n },\n getChildByIndex(parentElement, index) {\n return parentElement.childNodes[index] as Element\n },\n getAndUpdateSlotRootNativeElement(vEle: VElement, update: (nativeElement: (Element | null)) => void) {\n const currentRef = vEle.attrs.get('ref')\n const ref = createDynamicRef<Element>(nativeNode => {\n update(nativeNode)\n return () => {\n update(null)\n }\n })\n if (Array.isArray(currentRef)) {\n currentRef.push(ref)\n } else if (typeof currentRef === 'function' || typeof currentRef === 'object') {\n // 两个判断用于兼容 viewfly 2/3\n vEle.attrs.set('ref', [currentRef, ref])\n } else {\n vEle.attrs.set('ref', ref)\n }\n },\n componentRender: (component: Component<any>): ViewFlyNode => {\n const comp = this.components[component.name] || this.components['*']\n if (comp) {\n let ref = this.componentRefs.get(component)\n if (!ref) {\n ref = createDynamicRef<Element>(rootNode => {\n this.componentRootElementCaches.set(component, rootNode)\n return () => {\n // 当组件移动层级位置到原位置之前并重新渲染后,由于时序的原因,再删除缓存会导致组件找不到对应视图节点\n if (this.componentRootElementCaches.get(component) === rootNode) {\n this.componentRootElementCaches.remove(component)\n }\n }\n })\n this.componentRefs.set(component, ref)\n }\n return jsx(comp, {\n component,\n rootRef: ref\n }, component.id)\n }\n throw adapterError(`cannot found view component \\`${component.name}\\`!`)\n },\n vElementToViewElement(vNode: VElement, children: Array<JSXNode>): ViewFlyNode {\n let key: any\n const props = Array.from(vNode.attrs).reduce((a, b) => {\n const propName = b[0]\n if (propName === 'key') {\n key = b[1]\n return a\n }\n a[propName] = b[1]\n return a\n }, {} as Record<string, any>)\n if (vNode.classes.size) {\n props.class = Array.from(vNode.classes).join(' ')\n }\n if (vNode.styles) {\n props.style = Array.from(vNode.styles).reduce((a, b) => {\n a[b[0]] = b[1]\n return a\n }, {} as Record<string, any>)\n }\n if (children.length) {\n props.children = children\n }\n return jsx(vNode.tagName, props, key)\n }\n }, mount)\n\n let isRoot = true\n Object.entries(components).forEach(([key, viewFlyComponent]) => {\n this.components[key] = (props: ViewComponentProps<Component>) => {\n const comp = getCurrentInstance()\n const textbusComponent = props.component\n const subscription = merge(textbusComponent.changeMarker.onChange,\n textbusComponent.changeMarker.onForceChange).subscribe(() => {\n if (textbusComponent.changeMarker.dirty) {\n comp.markAsDirtied()\n }\n })\n onUnmounted(() => {\n subscription.unsubscribe()\n })\n if (isRoot) {\n onUpdated(() => {\n this.onViewUpdated.next()\n })\n isRoot = false\n }\n onUpdated(() => {\n textbusComponent.changeMarker.rendered()\n if (!this.componentRootElementCaches.get(textbusComponent)) {\n // eslint-disable-next-line max-len\n throw adapterError(`Component \\`${textbusComponent.name}\\` is not bound to rootRef, you must bind rootRef to the root element node of the component view.`)\n }\n })\n return viewFlyComponent(props)\n }\n })\n }\n\n override render(rootComponent: Component, injector: Injector): void | (() => void) {\n const childInjector = new ReflectiveInjector(injector, [{\n provide: Adapter,\n useValue: this\n }, {\n provide: DomAdapter,\n useValue: this\n }, {\n provide: ViewflyAdapter,\n useValue: this\n }])\n return super.render(rootComponent, childInjector)\n }\n\n override copy() {\n document.execCommand('copy')\n }\n}\n","import { NodeViewAdapter } from '@textbus/platform-node'\nimport { Injector, ReflectiveInjector } from '@viewfly/core'\nimport { Adapter, Component } from '@textbus/core'\nimport { DomAdapter } from '@textbus/platform-browser'\nimport { ViewflyAdapter } from './viewfly-adapter'\n\nexport class ViewflyVDomAdapter extends NodeViewAdapter {\n override render(rootComponent: Component, injector: Injector): void | (() => void) {\n const childInjector = new ReflectiveInjector(injector, [{\n provide: Adapter,\n useValue: this\n }, {\n provide: DomAdapter,\n useValue: this\n }, {\n provide: ViewflyAdapter,\n useValue: this\n }])\n return super.render(rootComponent, childInjector)\n }\n}\n"],"names":["adapterError","makeError","ViewflyAdapter","components","mount","_call_super","createCompositionNode","compositionState","updateNativeCompositionNode","ref","createDynamicRef","node","VElement","style","textDecoration","VTextNode","text","getParentNode","parentNode","getChildNodes","parentElement","Array","from","childNodes","isNativeElementNode","Element","getChildByIndex","index","getAndUpdateSlotRootNativeElement","vEle","update","currentRef","attrs","get","nativeNode","isArray","push","_type_of","set","componentRender","component","comp","_assert_this_initialized","name","componentRefs","rootNode","componentRootElementCaches","remove","jsx","rootRef","id","vElementToViewElement","vNode","children","key","props","reduce","a","b","propName","classes","size","class","join","styles","length","tagName","WeakMap","isRoot","Object","entries","forEach","viewFlyComponent","getCurrentInstance","textbusComponent","subscription","merge","changeMarker","onChange","onForceChange","subscribe","dirty","markAsDirtied","onUnmounted","unsubscribe","onUpdated","onViewUpdated","next","rendered","render","rootComponent","injector","childInjector","ReflectiveInjector","provide","Adapter","useValue","DomAdapter","_get","_get_prototype_of","copy","document","execCommand","ViewflyVDomAdapter","NodeViewAdapter"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAaA,IAAMA,eAAeC,cAAAA,CAAU,oBAAA,CAAA;AAWxB,IAAA,cAAMC,iBAAN,SAAA,WAAA,EAAA;AAAMA,IAAAA,WAAAA,CAAAA,cAAAA,EAAAA,WAAAA,CAAAA;aAAAA,cAAAA,CAKCC,UAAoC,EACpCC,KAAsC,EAAA;AANvCF,QAAAA,mBAAAA,CAAAA,IAAAA,EAAAA,cAAAA,CAAAA;;gBAQTG,aAAA,CAAA,IAAA,EARSH,cAAAA,EAAAA;AAQH,YAAA;AACJI,gBAAAA,qBAAAA,EAAAA,SAAAA,qBAAAA,CAAsBC,gBAAkC,EAClCC,2BAAmE,EAAA;oBACvF,IAAMC,GAAAA,GAAMC,wBAA0BC,SAAAA,IAAAA,EAAAA;wBACpCH,2BAAAA,CAA4BG,IAAAA,CAAAA;wBAC5B,OAAO,WAAA;4BACLH,2BAAAA,CAA4B,IAAA,CAAA;AAC9B,wBAAA,CAAA;AACF,oBAAA,CAAA,CAAA;oBACA,OAAO,IAAII,cAAS,MAAA,EAAQ;wBAC1BC,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QC,aAAAA,EAAeE,aAAAA,CAAAA;AACrC,YAAA;;;AAbWW,IAAAA,OAAAA,kBAAAA;EAA2BC,4BAAAA;;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@textbus/adapter-viewfly",
3
- "version": "5.2.3",
3
+ "version": "5.2.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": "./dist/index.js",
6
6
  "module": "./dist/index.esm.js",
@@ -33,11 +33,11 @@
33
33
  ],
34
34
  "dependencies": {
35
35
  "@tanbo/stream": "^1.2.7",
36
- "@viewfly/core": "^2.2.0 || >=3.0.0-alpha.3 <4",
37
- "@viewfly/platform-browser": "^2.2.0 || >=3.0.0-alpha.3 <4",
38
- "@textbus/core": "^5.2.3",
39
- "@textbus/platform-node": "^5.2.3",
40
- "@textbus/platform-browser": "^5.2.3"
36
+ "@viewfly/core": "3.0.0-alpha.7",
37
+ "@viewfly/platform-browser": "3.0.0-alpha.7",
38
+ "@textbus/core": "^5.2.5",
39
+ "@textbus/platform-node": "^5.2.5",
40
+ "@textbus/platform-browser": "^5.2.5"
41
41
  },
42
42
  "devDependencies": {
43
43
  "rimraf": "^3.0.2",