pawajs-continue 1.0.4 → 1.0.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.
Files changed (2) hide show
  1. package/component.js +23 -0
  2. package/package.json +2 -2
package/component.js CHANGED
@@ -49,6 +49,18 @@ const oldState=getCurrentContext()
49
49
  }
50
50
  comment.data=`<${name}>`
51
51
  endComment.data=`</${name}>`
52
+ const getCorrectContext=(contexts)=>{
53
+ /**@type {[]} */
54
+ const context=props.context
55
+ const paired=Object.entries(contexts)
56
+ if (context.length === paired.length) {
57
+ const onMatched= paired.filter(([key])=> !context.includes(key))
58
+ return onMatched > 0 ?true:false
59
+ }else{
60
+ return true
61
+ }
62
+
63
+ }
52
64
  if(!compo){
53
65
 
54
66
  const fakeComponent=new PawaComponent(()=>null)
@@ -103,6 +115,14 @@ const oldState=getCurrentContext()
103
115
  keepContext(stateContexts._formerContext)
104
116
  return
105
117
  }
118
+ for (const [key,value] of Object.entries(prop)) {
119
+ let keys
120
+ if(key.includes('-')){
121
+ keys=key.replace(/-([a-z])/g, (g) => g[1].toUpperCase());
122
+ delete prop[key]
123
+ prop[keys]=value
124
+ }
125
+ }
106
126
  for (const [key,value] of Object.entries(props.slots)) {
107
127
  prop[key]=()=>value
108
128
  }
@@ -165,6 +185,9 @@ const oldState=getCurrentContext()
165
185
  // console.log(el,el._context)
166
186
  }
167
187
  const childInsert=()=>{
188
+ // if (getCorrectContext(component._insert)) { // check if the component context doesn't match with the servers
189
+ // return
190
+ // }
168
191
  element._component?._hook?.beforeMount?.forEach((bfm) => {
169
192
  const result= bfm(comment)
170
193
  if (typeof result === 'function') {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pawajs-continue",
3
- "version": "1.0.4",
3
+ "version": "1.0.5",
4
4
  "description": "Pawajs continuity initializer library for ssr",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -23,6 +23,6 @@
23
23
  },
24
24
  "homepage": "https://github.com/Allisboy/pawajs-continue#readme",
25
25
  "dependencies": {
26
- "pawajs": "^1.3.8"
26
+ "pawajs": "^1.4.7"
27
27
  }
28
28
  }