pawajs 1.4.7 → 1.4.9
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/CHANGELOG.md +1 -0
- package/README.md +3 -0
- package/index.js +9 -3
- package/package.json +1 -1
- package/power.js +2 -2
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -7,6 +7,8 @@ pawajs - power the web (reactivity and html runtime)
|
|
|
7
7
|
|
|
8
8
|
PawaJS is a JavaScript library designed for building dynamic user interfaces. It combines a component-based architecture and progressive enhancement with a powerful reactivity system no v-dom. Its intuitive, directive-based templating feels familiar and makes it easy to create interactive applications, from simple widgets to complex single-page apps. With built-in support for server-side rendering, PawaJS is equipped for performance and scalability.
|
|
9
9
|
|
|
10
|
+
🌐 **Website:** [pawajs.vercel.app](https://pawajs.vercel.app)
|
|
11
|
+
|
|
10
12
|
---
|
|
11
13
|
|
|
12
14
|
## Features
|
|
@@ -340,6 +342,7 @@ useValidateComponent(TodoList, {
|
|
|
340
342
|
- `pawaStartApp(rootElement, initialContext)`: Initializes the PawaJS application on a given root DOM element.
|
|
341
343
|
- `RegisterComponent(...components)`: Registers one or more components to be used in templates.
|
|
342
344
|
- `$state(initialValue, localStorageKey?)`: Creates a new reactive state object.
|
|
345
|
+
- `PluginSystem(plugin)`: Registers a plugin to extend PawaJS functionality (e.g., Routers, Global Stores).
|
|
343
346
|
- `html`: A tagged template literal for syntax highlighting and potential future optimizations.
|
|
344
347
|
|
|
345
348
|
### Component Hooks
|
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
|
-
|
|
895
|
-
|
|
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 -
|
|
903
|
+
const numberComponentChildren = notRender.index + children.length - 1
|
|
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
|
}
|
package/package.json
CHANGED
package/power.js
CHANGED
|
@@ -63,7 +63,7 @@ export const If = (el, attr, stateContext,resume=false,notRender,stopResume) =>
|
|
|
63
63
|
const setEndComment=(c)=>endComment=c
|
|
64
64
|
getComment(el,setComment,id)
|
|
65
65
|
getEndComment(comment,setEndComment,id,children)
|
|
66
|
-
const numberIfChildren=notRender.index + children.length -
|
|
66
|
+
const numberIfChildren=notRender.index + children.length - 2
|
|
67
67
|
notRender.notRender=numberIfChildren
|
|
68
68
|
resumer.resume_if?.(el,attr,stateContext,{comment,endComment,id,children})
|
|
69
69
|
|
|
@@ -126,7 +126,7 @@ export const Switch = (el, attr, stateContext,resume=false,notRender,stopResume)
|
|
|
126
126
|
const setEndComment=(c)=>endComment=c
|
|
127
127
|
getComment(el,setComment,id)
|
|
128
128
|
getEndComment(comment,setEndComment,id,children)
|
|
129
|
-
const numberIfChildren=notRender.index + children.length -
|
|
129
|
+
const numberIfChildren=notRender.index + children.length - 2
|
|
130
130
|
notRender.notRender=numberIfChildren
|
|
131
131
|
resumer.resume_switch?.(el,attr,stateContext,{comment,endComment,id,children})
|
|
132
132
|
|