pawajs 1.4.8 → 1.4.10

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/index.js CHANGED
@@ -877,10 +877,12 @@ const component = (el, resume = false, attr, notRender, stopResume) => {
877
877
  }
878
878
  }
879
879
  const getEndComment = (comment) => {
880
+ if(endComment) return;
880
881
  const isComment = comment.nextSibling
881
882
  if (comment.nextSibling.nodeType === 8) {
882
883
  if (isComment.data.split('+')[1] === id) {
883
884
  endComment = isComment
885
+ return
884
886
  } else {
885
887
  getEndComment(isComment)
886
888
  }
@@ -891,10 +893,14 @@ const component = (el, resume = false, attr, notRender, stopResume) => {
891
893
  getEndComment(isComment)
892
894
  }
893
895
  }
894
- getComment(el)
895
- getEndComment(comment)
896
+ try {
897
+ getComment(el)
898
+ getEndComment(comment)
899
+ } catch (error) {
900
+ // el has no previous Sibling
901
+ }
896
902
  el.removeAttribute(attr.name)
897
- const numberComponentChildren = notRender.index + children.length - 1
903
+ const numberComponentChildren = notRender.index -2 + children.length
898
904
  notRender.notRender = numberComponentChildren
899
905
  resumer.resume_component?.(el, attr, setStateContext, mapsPlugins, formerStateContext, pawaContext, stateWatch, { comment, endComment, name, serialized, id, children })
900
906
  }
@@ -13,15 +13,19 @@ export const templates=(el,notRender)=>{
13
13
  pawaWayRemover(comment,endComment)
14
14
  comment.remove(),endComment.remove();
15
15
  }
16
+ if (!endComment.parentElement) {
17
+ return
18
+ }
16
19
  endComment.parentElement.insertBefore(comment,endComment)
20
+
17
21
  el._underControl=comment
18
22
  let element=[]
19
23
  Array.from(el.content.children).forEach((child) => {
20
24
  endComment.parentElement.insertBefore(child,endComment)
21
25
  element.push(child)
22
26
  })
23
-
27
+
24
28
  element.forEach(child=>{
25
- render(child,el._context,isResume?notRender:{ notRender: null, index: null })
26
- })
29
+ render(child,el._context,isResume?notRender:{ notRender: null, index: null })
30
+ })
27
31
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pawajs",
3
- "version": "1.4.8",
3
+ "version": "1.4.10",
4
4
  "type":"module",
5
5
  "description": "pawajs library (html runtime) for easily building web ui, enhancing html element, micro frontend etc ",
6
6
  "main": "index.js",