malinajs 0.7.0-a10 → 0.7.0-a11

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/malina.js +8 -4
  2. package/package.json +1 -1
package/malina.js CHANGED
@@ -4607,12 +4607,16 @@
4607
4607
  function makeDom(data) {
4608
4608
  function build(parent, list) {
4609
4609
  list.forEach(e => {
4610
- if(e.type == 'each' || e.type == 'fragment' || e.type == 'slot') {
4610
+ if(e.type == 'fragment' || e.type == 'slot') {
4611
4611
  if(e.body && e.body.length) build(parent, e.body);
4612
4612
  return;
4613
+ } else if(e.type == 'each') {
4614
+ build(parent, e.mainBlock);
4615
+ e.elseBlock?.length && build(parent, e.elseBlock);
4616
+ return;
4613
4617
  } else if(e.type == 'if') {
4614
- if(e.bodyMain && e.bodyMain.length) build(parent, e.bodyMain);
4615
- if(e.body && e.body.length) build(parent, e.body);
4618
+ e.parts.forEach(p => build(parent, p.body));
4619
+ e.elsePart?.length && build(parent, e.elsePart);
4616
4620
  return;
4617
4621
  } else if(e.type == 'await') {
4618
4622
  if(e.parts.main && e.parts.main.length) build(parent, e.parts.main);
@@ -6524,7 +6528,7 @@
6524
6528
  return { event, fn, rootModifier };
6525
6529
  }
6526
6530
 
6527
- const version = '0.7.0-a10';
6531
+ const version = '0.7.0-a11';
6528
6532
 
6529
6533
 
6530
6534
  async function compile(source, config = {}) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "malinajs",
3
- "version": "0.7.0-a10",
3
+ "version": "0.7.0-a11",
4
4
  "license": "MIT",
5
5
  "scripts": {
6
6
  "prepare": "npm run build",