tutuca 0.9.110 → 0.9.112
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/dist/tutuca-cli.js +148 -74
- package/dist/tutuca-dev.ext.js +11 -5
- package/dist/tutuca-dev.js +11 -5
- package/dist/tutuca-dev.min.js +2 -2
- package/dist/tutuca-extra.ext.js +11 -5
- package/dist/tutuca-extra.js +11 -5
- package/dist/tutuca-extra.min.js +2 -2
- package/dist/tutuca.ext.js +11 -5
- package/dist/tutuca.js +11 -5
- package/dist/tutuca.min.js +2 -2
- package/package.json +2 -2
- package/skill/tutuca/testing.md +8 -2
- package/skill/tutuca-source/tutuca.ext.js +11 -5
package/dist/tutuca-extra.ext.js
CHANGED
|
@@ -540,7 +540,6 @@ var PREDICATES = {
|
|
|
540
540
|
|
|
541
541
|
class ValParser {
|
|
542
542
|
constructor() {
|
|
543
|
-
this.bindValIt = new BindVal("it");
|
|
544
543
|
this.nullConstVal = new ConstVal(null);
|
|
545
544
|
}
|
|
546
545
|
const(v) {
|
|
@@ -2086,7 +2085,7 @@ function parseXOp(attrs, childs, opIdx, px) {
|
|
|
2086
2085
|
node = px.addNodeIf(RenderNode, parseXOpVal(name, value, px, vp.parseComponent), as);
|
|
2087
2086
|
break;
|
|
2088
2087
|
case "render-it":
|
|
2089
|
-
node = px.
|
|
2088
|
+
node = px.addNode(RenderItNode, as);
|
|
2090
2089
|
break;
|
|
2091
2090
|
case "render-each":
|
|
2092
2091
|
node = parseRenderEach(px, value, as, attrs);
|
|
@@ -2269,7 +2268,7 @@ function parseRenderEach(px, value, as, attrs) {
|
|
|
2269
2268
|
const seqVal = parseXOpVal("render-each", value, px, vp.parseSequence);
|
|
2270
2269
|
if (seqVal === null)
|
|
2271
2270
|
return null;
|
|
2272
|
-
const renderIt = px.
|
|
2271
|
+
const renderIt = px.addNode(RenderItNode, as);
|
|
2273
2272
|
const attrParser = getAttrParser(px);
|
|
2274
2273
|
const eachAttr = attrParser.eachAttr = attrParser.pushWrapper("each", value, seqVal);
|
|
2275
2274
|
const when = attrs.getNamedItem("@when") ?? attrs.getNamedItem("when");
|
|
@@ -2469,6 +2468,12 @@ class ParseContext {
|
|
|
2469
2468
|
}
|
|
2470
2469
|
return null;
|
|
2471
2470
|
}
|
|
2471
|
+
addNode(Class, extra) {
|
|
2472
|
+
const nodeId = this.nodes.length;
|
|
2473
|
+
const node = new Class(nodeId, null, extra);
|
|
2474
|
+
this.nodes.push(node);
|
|
2475
|
+
return node;
|
|
2476
|
+
}
|
|
2472
2477
|
registerEvents() {
|
|
2473
2478
|
const id = this.events.length;
|
|
2474
2479
|
const events = new NodeEvents(id);
|
|
@@ -2900,7 +2905,7 @@ class Stack {
|
|
|
2900
2905
|
return new Stack(comps, it, binds, newDynBinds, views, viewsId, ctx);
|
|
2901
2906
|
}
|
|
2902
2907
|
static root(comps, it, ctx) {
|
|
2903
|
-
const binds = [new BindFrame(it, {
|
|
2908
|
+
const binds = [new BindFrame(it, {}, true), null];
|
|
2904
2909
|
const dynBinds = [new ObjectFrame({}), null];
|
|
2905
2910
|
const views = ["main", null];
|
|
2906
2911
|
return new Stack(comps, it, binds, dynBinds, views, "", ctx)._pushProvides();
|
|
@@ -3532,6 +3537,7 @@ class App {
|
|
|
3532
3537
|
this._compiled = false;
|
|
3533
3538
|
this._renderOpts = { document: rootNode.ownerDocument };
|
|
3534
3539
|
this._renderState = null;
|
|
3540
|
+
this.rootViewName = null;
|
|
3535
3541
|
}
|
|
3536
3542
|
get state() {
|
|
3537
3543
|
return this.transactor.state;
|
|
@@ -3643,7 +3649,7 @@ class App {
|
|
|
3643
3649
|
const root = this.state.val;
|
|
3644
3650
|
const stack = this.makeStack(root);
|
|
3645
3651
|
const { renderer, rootNode, _renderOpts, _renderState } = this;
|
|
3646
|
-
const newState = render(renderer.renderRoot(stack, root), rootNode, _renderOpts, _renderState);
|
|
3652
|
+
const newState = render(renderer.renderRoot(stack, root, this.rootViewName), rootNode, _renderOpts, _renderState);
|
|
3647
3653
|
this._renderState = newState;
|
|
3648
3654
|
return newState.dom;
|
|
3649
3655
|
}
|
package/dist/tutuca-extra.js
CHANGED
|
@@ -4911,7 +4911,6 @@ var PREDICATES = {
|
|
|
4911
4911
|
|
|
4912
4912
|
class ValParser {
|
|
4913
4913
|
constructor() {
|
|
4914
|
-
this.bindValIt = new BindVal("it");
|
|
4915
4914
|
this.nullConstVal = new ConstVal(null);
|
|
4916
4915
|
}
|
|
4917
4916
|
const(v) {
|
|
@@ -6454,7 +6453,7 @@ function parseXOp(attrs, childs, opIdx, px) {
|
|
|
6454
6453
|
node = px.addNodeIf(RenderNode, parseXOpVal(name, value, px, vp.parseComponent), as);
|
|
6455
6454
|
break;
|
|
6456
6455
|
case "render-it":
|
|
6457
|
-
node = px.
|
|
6456
|
+
node = px.addNode(RenderItNode, as);
|
|
6458
6457
|
break;
|
|
6459
6458
|
case "render-each":
|
|
6460
6459
|
node = parseRenderEach(px, value, as, attrs);
|
|
@@ -6637,7 +6636,7 @@ function parseRenderEach(px, value, as, attrs) {
|
|
|
6637
6636
|
const seqVal = parseXOpVal("render-each", value, px, vp.parseSequence);
|
|
6638
6637
|
if (seqVal === null)
|
|
6639
6638
|
return null;
|
|
6640
|
-
const renderIt = px.
|
|
6639
|
+
const renderIt = px.addNode(RenderItNode, as);
|
|
6641
6640
|
const attrParser = getAttrParser(px);
|
|
6642
6641
|
const eachAttr = attrParser.eachAttr = attrParser.pushWrapper("each", value, seqVal);
|
|
6643
6642
|
const when = attrs.getNamedItem("@when") ?? attrs.getNamedItem("when");
|
|
@@ -6837,6 +6836,12 @@ class ParseContext {
|
|
|
6837
6836
|
}
|
|
6838
6837
|
return null;
|
|
6839
6838
|
}
|
|
6839
|
+
addNode(Class, extra) {
|
|
6840
|
+
const nodeId = this.nodes.length;
|
|
6841
|
+
const node = new Class(nodeId, null, extra);
|
|
6842
|
+
this.nodes.push(node);
|
|
6843
|
+
return node;
|
|
6844
|
+
}
|
|
6840
6845
|
registerEvents() {
|
|
6841
6846
|
const id = this.events.length;
|
|
6842
6847
|
const events = new NodeEvents(id);
|
|
@@ -7268,7 +7273,7 @@ class Stack2 {
|
|
|
7268
7273
|
return new Stack2(comps, it, binds, newDynBinds, views, viewsId, ctx);
|
|
7269
7274
|
}
|
|
7270
7275
|
static root(comps, it, ctx) {
|
|
7271
|
-
const binds = [new BindFrame(it, {
|
|
7276
|
+
const binds = [new BindFrame(it, {}, true), null];
|
|
7272
7277
|
const dynBinds = [new ObjectFrame({}), null];
|
|
7273
7278
|
const views = ["main", null];
|
|
7274
7279
|
return new Stack2(comps, it, binds, dynBinds, views, "", ctx)._pushProvides();
|
|
@@ -7900,6 +7905,7 @@ class App {
|
|
|
7900
7905
|
this._compiled = false;
|
|
7901
7906
|
this._renderOpts = { document: rootNode.ownerDocument };
|
|
7902
7907
|
this._renderState = null;
|
|
7908
|
+
this.rootViewName = null;
|
|
7903
7909
|
}
|
|
7904
7910
|
get state() {
|
|
7905
7911
|
return this.transactor.state;
|
|
@@ -8011,7 +8017,7 @@ class App {
|
|
|
8011
8017
|
const root = this.state.val;
|
|
8012
8018
|
const stack = this.makeStack(root);
|
|
8013
8019
|
const { renderer, rootNode, _renderOpts, _renderState } = this;
|
|
8014
|
-
const newState = render(renderer.renderRoot(stack, root), rootNode, _renderOpts, _renderState);
|
|
8020
|
+
const newState = render(renderer.renderRoot(stack, root, this.rootViewName), rootNode, _renderOpts, _renderState);
|
|
8015
8021
|
this._renderState = newState;
|
|
8016
8022
|
return newState.dom;
|
|
8017
8023
|
}
|