tutuca 0.9.100 → 0.9.101

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.
@@ -9958,7 +9958,8 @@ function parseXOp(attrs, childs, opIdx, px) {
9958
9958
  if (attrs.length <= opIdx)
9959
9959
  return maybeFragment(childs);
9960
9960
  const { name, value } = attrs[opIdx];
9961
- const as = attrs.getNamedItem("as")?.value ?? null;
9961
+ const asAttr = attrs.getNamedItem("as")?.value ?? null;
9962
+ const as = asAttr === null ? null : parseViewName(asAttr, px);
9962
9963
  let node;
9963
9964
  switch (name) {
9964
9965
  case "slot":
@@ -9998,6 +9999,9 @@ function parseXOpVal(opName, value, px, parserFn) {
9998
9999
  px.onParseIssue("bad-value", { role: "x-op", op: opName, value });
9999
10000
  return val;
10000
10001
  }
10002
+ function parseViewName(s, px) {
10003
+ return vp.parseText(s, px) ?? vp.const(s);
10004
+ }
10001
10005
  function processXExtras(node, attrs, opName, startIdx, px) {
10002
10006
  const { consumed, wrappable } = X_OPS[opName];
10003
10007
  const wrappers = [];
@@ -10427,16 +10431,19 @@ var init_anode = __esm(() => {
10427
10431
  }
10428
10432
  };
10429
10433
  RenderViewId = class RenderViewId extends ANode {
10430
- constructor(nodeId, val, viewId) {
10434
+ constructor(nodeId, val, viewVal) {
10431
10435
  super(nodeId, val);
10432
- this.viewId = viewId;
10436
+ this.viewVal = viewVal;
10437
+ }
10438
+ evalViewName(stack) {
10439
+ return this.viewVal ? this.viewVal.eval(stack) : null;
10433
10440
  }
10434
10441
  setDataAttr(_key, _val) {}
10435
10442
  };
10436
10443
  RenderNode = class RenderNode extends RenderViewId {
10437
10444
  render(stack, rx) {
10438
10445
  const newStack = stack.enter(this.val.eval(stack), {}, true);
10439
- return rx.renderIt(newStack, this, "", this.viewId);
10446
+ return rx.renderIt(newStack, this, "", this.evalViewName(stack));
10440
10447
  }
10441
10448
  toPathStep(ctx) {
10442
10449
  if (this.val instanceof DynVal)
@@ -10447,7 +10454,7 @@ var init_anode = __esm(() => {
10447
10454
  RenderItNode = class RenderItNode extends RenderViewId {
10448
10455
  render(stack, rx) {
10449
10456
  const newStack = stack.enter(stack.it, {}, true);
10450
- return rx.renderIt(newStack, this, "", this.viewId);
10457
+ return rx.renderIt(newStack, this, "", this.evalViewName(stack));
10451
10458
  }
10452
10459
  toPathStep(ctx) {
10453
10460
  const next = ctx.next();
@@ -10463,12 +10470,12 @@ var init_anode = __esm(() => {
10463
10470
  }
10464
10471
  };
10465
10472
  RenderEachNode = class RenderEachNode extends RenderViewId {
10466
- constructor(nodeId, val, viewId) {
10467
- super(nodeId, val, viewId);
10473
+ constructor(nodeId, val, viewVal) {
10474
+ super(nodeId, val, viewVal);
10468
10475
  this.iterInfo = new IterInfo(val, null, null, null);
10469
10476
  }
10470
10477
  render(stack, rx) {
10471
- return rx.renderEach(stack, this.iterInfo, this, this.viewId);
10478
+ return rx.renderEach(stack, this.iterInfo, this, this.evalViewName(stack));
10472
10479
  }
10473
10480
  toPathStep(ctx) {
10474
10481
  if (this.val instanceof DynVal)
@@ -2156,7 +2156,8 @@ function parseXOp(attrs, childs, opIdx, px) {
2156
2156
  if (attrs.length <= opIdx)
2157
2157
  return maybeFragment(childs);
2158
2158
  const { name, value } = attrs[opIdx];
2159
- const as = attrs.getNamedItem("as")?.value ?? null;
2159
+ const asAttr = attrs.getNamedItem("as")?.value ?? null;
2160
+ const as = asAttr === null ? null : parseViewName(asAttr, px);
2160
2161
  let node;
2161
2162
  switch (name) {
2162
2163
  case "slot":
@@ -2196,6 +2197,9 @@ function parseXOpVal(opName, value, px, parserFn) {
2196
2197
  px.onParseIssue("bad-value", { role: "x-op", op: opName, value });
2197
2198
  return val;
2198
2199
  }
2200
+ function parseViewName(s, px) {
2201
+ return vp.parseText(s, px) ?? vp.const(s);
2202
+ }
2199
2203
  function processXExtras(node, attrs, opName, startIdx, px) {
2200
2204
  const { consumed, wrappable } = X_OPS[opName];
2201
2205
  const wrappers = [];
@@ -2292,9 +2296,12 @@ class Macro {
2292
2296
  }
2293
2297
 
2294
2298
  class RenderViewId extends ANode {
2295
- constructor(nodeId, val, viewId) {
2299
+ constructor(nodeId, val, viewVal) {
2296
2300
  super(nodeId, val);
2297
- this.viewId = viewId;
2301
+ this.viewVal = viewVal;
2302
+ }
2303
+ evalViewName(stack) {
2304
+ return this.viewVal ? this.viewVal.eval(stack) : null;
2298
2305
  }
2299
2306
  setDataAttr(_key, _val) {}
2300
2307
  }
@@ -2308,7 +2315,7 @@ function dynRenderStep(comp, name, key) {
2308
2315
  class RenderNode extends RenderViewId {
2309
2316
  render(stack, rx) {
2310
2317
  const newStack = stack.enter(this.val.eval(stack), {}, true);
2311
- return rx.renderIt(newStack, this, "", this.viewId);
2318
+ return rx.renderIt(newStack, this, "", this.evalViewName(stack));
2312
2319
  }
2313
2320
  toPathStep(ctx) {
2314
2321
  if (this.val instanceof DynVal)
@@ -2320,7 +2327,7 @@ class RenderNode extends RenderViewId {
2320
2327
  class RenderItNode extends RenderViewId {
2321
2328
  render(stack, rx) {
2322
2329
  const newStack = stack.enter(stack.it, {}, true);
2323
- return rx.renderIt(newStack, this, "", this.viewId);
2330
+ return rx.renderIt(newStack, this, "", this.evalViewName(stack));
2324
2331
  }
2325
2332
  toPathStep(ctx) {
2326
2333
  const next = ctx.next();
@@ -2337,12 +2344,12 @@ class RenderItNode extends RenderViewId {
2337
2344
  }
2338
2345
 
2339
2346
  class RenderEachNode extends RenderViewId {
2340
- constructor(nodeId, val, viewId) {
2341
- super(nodeId, val, viewId);
2347
+ constructor(nodeId, val, viewVal) {
2348
+ super(nodeId, val, viewVal);
2342
2349
  this.iterInfo = new IterInfo(val, null, null, null);
2343
2350
  }
2344
2351
  render(stack, rx) {
2345
- return rx.renderEach(stack, this.iterInfo, this, this.viewId);
2352
+ return rx.renderEach(stack, this.iterInfo, this, this.evalViewName(stack));
2346
2353
  }
2347
2354
  toPathStep(ctx) {
2348
2355
  if (this.val instanceof DynVal)
@@ -9807,7 +9807,8 @@ function parseXOp(attrs, childs, opIdx, px) {
9807
9807
  if (attrs.length <= opIdx)
9808
9808
  return maybeFragment(childs);
9809
9809
  const { name, value } = attrs[opIdx];
9810
- const as = attrs.getNamedItem("as")?.value ?? null;
9810
+ const asAttr = attrs.getNamedItem("as")?.value ?? null;
9811
+ const as = asAttr === null ? null : parseViewName(asAttr, px);
9811
9812
  let node;
9812
9813
  switch (name) {
9813
9814
  case "slot":
@@ -9847,6 +9848,9 @@ function parseXOpVal(opName, value, px, parserFn) {
9847
9848
  px.onParseIssue("bad-value", { role: "x-op", op: opName, value });
9848
9849
  return val;
9849
9850
  }
9851
+ function parseViewName(s, px) {
9852
+ return vp.parseText(s, px) ?? vp.const(s);
9853
+ }
9850
9854
  function processXExtras(node, attrs, opName, startIdx, px) {
9851
9855
  const { consumed, wrappable } = X_OPS[opName];
9852
9856
  const wrappers = [];
@@ -9943,9 +9947,12 @@ class Macro {
9943
9947
  }
9944
9948
 
9945
9949
  class RenderViewId extends ANode {
9946
- constructor(nodeId, val, viewId) {
9950
+ constructor(nodeId, val, viewVal) {
9947
9951
  super(nodeId, val);
9948
- this.viewId = viewId;
9952
+ this.viewVal = viewVal;
9953
+ }
9954
+ evalViewName(stack) {
9955
+ return this.viewVal ? this.viewVal.eval(stack) : null;
9949
9956
  }
9950
9957
  setDataAttr(_key, _val) {}
9951
9958
  }
@@ -9959,7 +9966,7 @@ function dynRenderStep(comp, name, key) {
9959
9966
  class RenderNode extends RenderViewId {
9960
9967
  render(stack, rx) {
9961
9968
  const newStack = stack.enter(this.val.eval(stack), {}, true);
9962
- return rx.renderIt(newStack, this, "", this.viewId);
9969
+ return rx.renderIt(newStack, this, "", this.evalViewName(stack));
9963
9970
  }
9964
9971
  toPathStep(ctx) {
9965
9972
  if (this.val instanceof DynVal)
@@ -9971,7 +9978,7 @@ class RenderNode extends RenderViewId {
9971
9978
  class RenderItNode extends RenderViewId {
9972
9979
  render(stack, rx) {
9973
9980
  const newStack = stack.enter(stack.it, {}, true);
9974
- return rx.renderIt(newStack, this, "", this.viewId);
9981
+ return rx.renderIt(newStack, this, "", this.evalViewName(stack));
9975
9982
  }
9976
9983
  toPathStep(ctx) {
9977
9984
  const next = ctx.next();
@@ -9988,12 +9995,12 @@ class RenderItNode extends RenderViewId {
9988
9995
  }
9989
9996
 
9990
9997
  class RenderEachNode extends RenderViewId {
9991
- constructor(nodeId, val, viewId) {
9992
- super(nodeId, val, viewId);
9998
+ constructor(nodeId, val, viewVal) {
9999
+ super(nodeId, val, viewVal);
9993
10000
  this.iterInfo = new IterInfo(val, null, null, null);
9994
10001
  }
9995
10002
  render(stack, rx) {
9996
- return rx.renderEach(stack, this.iterInfo, this, this.viewId);
10003
+ return rx.renderEach(stack, this.iterInfo, this, this.evalViewName(stack));
9997
10004
  }
9998
10005
  toPathStep(ctx) {
9999
10006
  if (this.val instanceof DynVal)