@@ -124,12 +124,14 @@ import { QError, qError } from '../shared/error/error';
124124import { DEBUG_TYPE , QContainerValue , VirtualType , VirtualTypeName } from '../shared/types' ;
125125import { isText } from '../shared/utils/element' ;
126126import {
127+ dangerouslySetInnerHTML ,
127128 ELEMENT_ID ,
128129 ELEMENT_KEY ,
129130 ELEMENT_PROPS ,
130131 ELEMENT_SEQ ,
131132 ELEMENT_SEQ_IDX ,
132133 OnRenderProp ,
134+ Q_PROPS_SEPARATOR ,
133135 QContainerAttr ,
134136 QContainerAttrEnd ,
135137 QContainerIsland ,
@@ -142,27 +144,25 @@ import {
142144 QSlotParent ,
143145 QStyle ,
144146 QStylesAllSelector ,
145- Q_PROPS_SEPARATOR ,
146- dangerouslySetInnerHTML ,
147147} from '../shared/utils/markers' ;
148148import { isHtmlElement } from '../shared/utils/types' ;
149149import { VNodeDataChar } from '../shared/vnode-data-types' ;
150150import { getDomContainer } from './dom-container' ;
151151import { mapApp_findIndx , mapArray_get , mapArray_set } from './util-mapArray' ;
152152import {
153- ElementVNodeProps ,
154- TextVNodeProps ,
155- VNodeFlags ,
156- VNodeFlagsIndex ,
157- VNodeProps ,
158- VirtualVNodeProps ,
159153 type ClientContainer ,
160154 type ContainerElement ,
161155 type ElementVNode ,
156+ ElementVNodeProps ,
162157 type QDocument ,
163158 type TextVNode ,
164- type VNode ,
159+ TextVNodeProps ,
165160 type VirtualVNode ,
161+ VirtualVNodeProps ,
162+ type VNode ,
163+ VNodeFlags ,
164+ VNodeFlagsIndex ,
165+ VNodeProps ,
166166} from './types' ;
167167import {
168168 vnode_getDomChildrenWithCorrectNamespacesToInsert ,
@@ -1131,17 +1131,6 @@ export const vnode_truncate = (
11311131 vParent [ ElementVNodeProps . lastChild ] = vPrevious ;
11321132} ;
11331133
1134- export const vnode_isChildOf = ( vParent : VNode , vChild : VNode ) : boolean => {
1135- let vNode = vChild ;
1136- while ( vNode ) {
1137- if ( vNode === vParent ) {
1138- return true ;
1139- }
1140- vNode = vnode_getParent ( vNode ) ! ;
1141- }
1142- return false ;
1143- } ;
1144-
11451134//////////////////////////////////////////////////////////////////////////////////////////////////////
11461135
11471136export const vnode_getElementName = ( vnode : ElementVNode ) : string => {
@@ -1888,7 +1877,7 @@ const isElement = (node: any): node is Element =>
18881877 * parents.
18891878 *
18901879 * However, if during traversal we encounter a projection, than we have to follow the projection,
1891- * and nod weth the projection component is further away (it is the parent's parent of the
1880+ * and node with the projection component is further away (it is the parent's parent of the
18921881 * projection's)
18931882 *
18941883 * So in general we have to go up as many parent components as there are projections nestings.
@@ -1899,7 +1888,7 @@ const isElement = (node: any): node is Element =>
18991888 * - And so on.
19001889 *
19011890 * @param vHost
1902- * @param getObjectById
1891+ * @param rootVNode
19031892 * @returns
19041893 */
19051894export const vnode_getProjectionParentComponent = (
@@ -1929,7 +1918,7 @@ export const vnode_getProjectionParentComponent = (
19291918 return vHost as VirtualVNode | null ;
19301919} ;
19311920
1932- const VNodeArray = class VNode extends Array {
1921+ const VNodeArray = class VNode extends Array < any > {
19331922 static createElement (
19341923 flags : VNodeFlags ,
19351924 parent : VNode | null ,
@@ -1940,7 +1929,7 @@ const VNodeArray = class VNode extends Array {
19401929 element : Element ,
19411930 elementName : string | undefined
19421931 ) {
1943- const vnode = new VNode (
1932+ return new VNode (
19441933 flags ,
19451934 parent ,
19461935 previousSibling ,
@@ -1950,8 +1939,7 @@ const VNodeArray = class VNode extends Array {
19501939 element ,
19511940 elementName ,
19521941 [ ]
1953- ) as any ;
1954- return vnode ;
1942+ ) as ElementVNode ;
19551943 }
19561944
19571945 static createText (
@@ -1962,8 +1950,7 @@ const VNodeArray = class VNode extends Array {
19621950 textNode : Text | null ,
19631951 text : string | undefined
19641952 ) {
1965- const vnode = new VNode ( flags , parent , previousSibling , nextSibling , textNode , text ) as any ;
1966- return vnode ;
1953+ return new VNode ( flags , parent , previousSibling , nextSibling , textNode , text ) as TextVNode ;
19671954 }
19681955
19691956 static createVirtual (
@@ -1974,16 +1961,15 @@ const VNodeArray = class VNode extends Array {
19741961 firstChild : VNode | null ,
19751962 lastChild : VNode | null
19761963 ) {
1977- const vnode = new VNode (
1964+ return new VNode (
19781965 flags ,
19791966 parent ,
19801967 previousSibling ,
19811968 nextSibling ,
19821969 firstChild ,
19831970 lastChild ,
19841971 [ ]
1985- ) as any ;
1986- return vnode ;
1972+ ) as VirtualVNode ;
19871973 }
19881974
19891975 constructor (
@@ -1993,7 +1979,6 @@ const VNodeArray = class VNode extends Array {
19931979 nextSibling : VNode | null | undefined ,
19941980 ...rest : ( VNode | Element | Text | string | null | undefined ) [ ]
19951981 ) {
1996- // @ts -expect-error
19971982 super ( flags , parent , previousSibling , nextSibling , ...rest ) ;
19981983 if ( isDev ) {
19991984 this . toString = vnode_toString ;
0 commit comments