pawajs 1.3.5 → 1.3.7
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 +4 -7
- package/package.json +1 -1
- package/pawaElement.js +3 -2
- package/server.js +0 -3
package/index.js
CHANGED
|
@@ -200,7 +200,7 @@ export const PluginSystem = (...func) => {
|
|
|
200
200
|
console.warn(`attribute plugin already exist ${attrPlugins.fullName}`)
|
|
201
201
|
return
|
|
202
202
|
}
|
|
203
|
-
|
|
203
|
+
|
|
204
204
|
applyMode(attrPlugins?.mode, () => {
|
|
205
205
|
pawaAttributes.add(attrPlugins.fullName)
|
|
206
206
|
fullNamePlugin.add(attrPlugins.fullName)
|
|
@@ -295,7 +295,9 @@ const setPrimaryAttibute = (...name) => {
|
|
|
295
295
|
primaryDirective.add(att)
|
|
296
296
|
})
|
|
297
297
|
}
|
|
298
|
-
|
|
298
|
+
|
|
299
|
+
export const getPrimaryDirectives=()=>primaryDirective
|
|
300
|
+
|
|
299
301
|
setPrimaryAttibute('if', 'else-if', 'for', 'else','switch','case','default','case','key')
|
|
300
302
|
setPawaAttributes('if', 'else-if', 'for', 'else', 'mount',
|
|
301
303
|
'unmount', 'forKey', 'state-', 'on-', 'out-','key','switch','case','default')
|
|
@@ -442,7 +444,6 @@ export const setContext = () => {
|
|
|
442
444
|
setValue
|
|
443
445
|
}
|
|
444
446
|
} else {
|
|
445
|
-
console.log('setcontext')
|
|
446
447
|
return serverInstance.setContext?.()
|
|
447
448
|
}
|
|
448
449
|
|
|
@@ -467,7 +468,6 @@ export const useContext = (context) => {
|
|
|
467
468
|
}
|
|
468
469
|
|
|
469
470
|
} else {
|
|
470
|
-
console.log('usecontext')
|
|
471
471
|
return serverInstance.useContext?.(context)
|
|
472
472
|
}
|
|
473
473
|
}
|
|
@@ -484,7 +484,6 @@ export const useInnerContext = () => {
|
|
|
484
484
|
}
|
|
485
485
|
return stateContext._elementContext
|
|
486
486
|
} else {
|
|
487
|
-
console.log('innercontext')
|
|
488
487
|
return serverInstance.useInnerContext?.()
|
|
489
488
|
}
|
|
490
489
|
}
|
|
@@ -549,7 +548,6 @@ export const useInsert = (obj = {}) => {
|
|
|
549
548
|
}
|
|
550
549
|
Object.assign(stateContext._insert, obj)
|
|
551
550
|
} else {
|
|
552
|
-
// console.log(serverInstance.useInsert)
|
|
553
551
|
const res = serverInstance.useInsert(obj)
|
|
554
552
|
}
|
|
555
553
|
}
|
|
@@ -1071,7 +1069,6 @@ export const render = (el, contexts = {}, notRender, isName) => {
|
|
|
1071
1069
|
} else if (attr.name.startsWith('c-t')) {
|
|
1072
1070
|
resumer.resume_text(el, attr, isName)
|
|
1073
1071
|
} else if (attr.name.startsWith('c-if-')) {
|
|
1074
|
-
// console.log('resume -if',el,el._attributes)
|
|
1075
1072
|
directives['if'](el, attr, stateContext, true, notRender, stopResume)
|
|
1076
1073
|
} else if (attr.name === 'c-for') {
|
|
1077
1074
|
directives['for'](el, attr, stateContext, true, notRender, stopResume)
|
package/package.json
CHANGED
package/pawaElement.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {components,escapePawaAttribute,getPawaAttributes,getDependentAttribute} from './index.js';
|
|
1
|
+
import {components,escapePawaAttribute,getPawaAttributes,getDependentAttribute,getPrimaryDirectives } from './index.js';
|
|
2
2
|
import {splitAndAdd,replaceTemplateOperators,setPawaDevError,getEvalValues,safeEval} from './utils.js';
|
|
3
3
|
import PawaComponent from './pawaComponent.js';
|
|
4
4
|
|
|
@@ -163,8 +163,9 @@ export class PawaElement {
|
|
|
163
163
|
this._attr[attr.name]=attr.value
|
|
164
164
|
})
|
|
165
165
|
}
|
|
166
|
+
|
|
166
167
|
hasForOrIf(){
|
|
167
|
-
const primary=
|
|
168
|
+
const primary=getPrimaryDirectives()
|
|
168
169
|
let truth=false
|
|
169
170
|
primary.forEach((att)=>{
|
|
170
171
|
if(truth) return
|
package/server.js
CHANGED
|
@@ -13,11 +13,8 @@ const serverInstance={
|
|
|
13
13
|
export const getServerInstance=()=>serverInstance
|
|
14
14
|
export const setServer=(obj={})=>{
|
|
15
15
|
for (const [key,value] of Object.entries(obj)) {
|
|
16
|
-
console.log(key,'is start')
|
|
17
|
-
console.log(serverInstance)
|
|
18
16
|
if (serverInstance[key] === null) {
|
|
19
17
|
serverInstance[key]=value
|
|
20
|
-
console.log(serverInstance[key])
|
|
21
18
|
}
|
|
22
19
|
}
|
|
23
20
|
}
|