tutuca 0.9.78 → 0.9.80

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 (33) hide show
  1. package/README.md +1 -1
  2. package/dist/tutuca-cli.js +132 -58
  3. package/dist/tutuca-dev.ext.js +155 -83
  4. package/dist/tutuca-dev.js +155 -83
  5. package/dist/tutuca-dev.min.js +3 -3
  6. package/dist/tutuca-extra.ext.js +92 -72
  7. package/dist/tutuca-extra.js +92 -72
  8. package/dist/tutuca-extra.min.js +3 -3
  9. package/dist/tutuca.ext.js +93 -73
  10. package/dist/tutuca.js +92 -72
  11. package/dist/tutuca.min.js +3 -3
  12. package/package.json +1 -1
  13. package/skill/tutuca/SKILL.md +4 -3
  14. package/skill/tutuca/advanced.md +22 -18
  15. package/skill/tutuca/core.md +57 -2
  16. package/skill/tutuca/patterns/README.md +42 -0
  17. package/skill/tutuca/patterns/bind-text-and-attributes.md +30 -0
  18. package/skill/tutuca/patterns/conditional-attribute-value.md +29 -0
  19. package/skill/tutuca/patterns/coordinate-components.md +26 -0
  20. package/skill/tutuca/patterns/edit-through-a-dynamic-target.md +27 -0
  21. package/skill/tutuca/patterns/enrich-each-item.md +25 -0
  22. package/skill/tutuca/patterns/filter-a-list.md +23 -0
  23. package/skill/tutuca/patterns/handle-events.md +27 -0
  24. package/skill/tutuca/patterns/iterate-a-list.md +18 -0
  25. package/skill/tutuca/patterns/paginate-a-list.md +27 -0
  26. package/skill/tutuca/patterns/render-a-child-component.md +20 -0
  27. package/skill/tutuca/patterns/reuse-markup-with-macros.md +35 -0
  28. package/skill/tutuca/patterns/share-state-without-prop-drilling.md +30 -0
  29. package/skill/tutuca/patterns/show-or-hide-content.md +22 -0
  30. package/skill/tutuca/patterns/switch-between-views.md +26 -0
  31. package/skill/tutuca/patterns/tabbed-interface.md +38 -0
  32. package/skill/tutuca/semantics.md +2 -2
  33. package/skill/tutuca-source/tutuca.ext.js +93 -73
@@ -8142,6 +8142,7 @@ var G_BOOL = K_FIELD | K_METHOD | K_BIND | K_DYN | K_CONST;
8142
8142
  var G_TEXT = G_BOOL | K_STRTPL;
8143
8143
  var G_COMPONENT = K_FIELD | K_SEQ | K_DYN;
8144
8144
  var G_SEQUENCE = K_FIELD | K_DYN;
8145
+ var G_PROVIDE = K_FIELD | K_SEQ;
8145
8146
  var G_FIELD = K_FIELD | K_METHOD | K_CONST | K_STR | K_SEQ;
8146
8147
  var G_VALUE = K_FIELD | K_METHOD | K_BIND | K_DYN | K_NAME | K_TYPE | K_REQUEST | K_CONST;
8147
8148
  var G_PRED_ARG = G_BOOL | K_STR;
@@ -8260,6 +8261,9 @@ class ValParser {
8260
8261
  parseField(s, px) {
8261
8262
  return this._parseSingle(s, px, G_FIELD);
8262
8263
  }
8264
+ parseProvide(s, px) {
8265
+ return this._parseSingle(s, px, G_PROVIDE);
8266
+ }
8263
8267
  parseHandlerArg(s, px) {
8264
8268
  return this._parseSingle(s, px, G_HANDLER_ARG);
8265
8269
  }
@@ -9246,21 +9250,22 @@ function h(tagName, properties, children, namespace) {
9246
9250
  }
9247
9251
 
9248
9252
  // src/anode.js
9249
- function resolveDynProducer(comp, dynName) {
9250
- const dyn = comp?.dynamic?.[dynName];
9251
- if (dyn == null)
9252
- return null;
9253
- let producerComp, producerDyn;
9254
- if (dyn.compName != null) {
9255
- producerComp = comp.scope?.lookupComponent(dyn.compName);
9256
- producerDyn = producerComp?.dynamic?.[dyn.dynName];
9253
+ function resolveDynProducer(comp, name) {
9254
+ let producerComp, producerProvide;
9255
+ const lk = comp?.lookup?.[name];
9256
+ if (lk != null) {
9257
+ producerComp = comp.scope?.lookupComponent(lk.compName);
9258
+ producerProvide = producerComp?.provide?.[lk.provideName];
9257
9259
  } else {
9260
+ const p = comp?.provide?.[name];
9261
+ if (p == null)
9262
+ return null;
9258
9263
  producerComp = comp;
9259
- producerDyn = dyn;
9264
+ producerProvide = p;
9260
9265
  }
9261
- if (producerComp == null || producerDyn == null)
9266
+ if (producerComp == null || producerProvide == null)
9262
9267
  return null;
9263
- const pi = producerDyn.val?.toPathItem?.() ?? null;
9268
+ const pi = producerProvide.val?.toPathItem?.() ?? null;
9264
9269
  return { producerCompId: producerComp.id, producerSteps: pi ? [pi] : [] };
9265
9270
  }
9266
9271
 
@@ -12385,7 +12390,7 @@ function closestName(name, candidates, maxDistance = 2) {
12385
12390
  }
12386
12391
 
12387
12392
  // tools/core/lint-check.js
12388
- var KNOWN_COMPONENT_SPEC_KEYS = new Set("name view style commonStyle globalStyle input receive bubble response alter on views dynamic fields methods statics".split(" "));
12393
+ var KNOWN_COMPONENT_SPEC_KEYS = new Set("name view style commonStyle globalStyle input receive bubble response alter views provide lookup fields methods statics".split(" "));
12389
12394
  var EMPTY_SET2 = new Set;
12390
12395
  var KNOWN_DIRECTIVE_NAMES = new Set([
12391
12396
  "dangerouslysetinnerhtml",
@@ -12405,6 +12410,9 @@ var ALT_HANDLER_NOT_DEFINED = "ALT_HANDLER_NOT_DEFINED";
12405
12410
  var ALT_HANDLER_NOT_REFERENCED = "ALT_HANDLER_NOT_REFERENCED";
12406
12411
  var DYN_VAL_NOT_DEFINED = "DYN_VAL_NOT_DEFINED";
12407
12412
  var DYN_ALIAS_NOT_REFERENCED = "DYN_ALIAS_NOT_REFERENCED";
12413
+ var PROVIDE_NOT_ADDRESSABLE = "PROVIDE_NOT_ADDRESSABLE";
12414
+ var LOOKUP_BAD_SHAPE = "LOOKUP_BAD_SHAPE";
12415
+ var LOOKUP_TARGET_MALFORMED = "LOOKUP_TARGET_MALFORMED";
12408
12416
  var RENDER_IT_OUTSIDE_OF_LOOP = "RENDER_IT_OUTSIDE_OF_LOOP";
12409
12417
  var UNKNOWN_EVENT_MODIFIER = "UNKNOWN_EVENT_MODIFIER";
12410
12418
  var UNKNOWN_HANDLER_ARG_NAME = "UNKNOWN_HANDLER_ARG_NAME";
@@ -12491,8 +12499,6 @@ function classifyBadValue(value) {
12491
12499
  const s = value.trim();
12492
12500
  if (s === "")
12493
12501
  return null;
12494
- if (/\{[^}]*\}/.test(s) && !s.startsWith("$'"))
12495
- return "legacy-template";
12496
12502
  if (/\s\?\s.+\s:\s/.test(s))
12497
12503
  return "ternary";
12498
12504
  if (/===|!==|==|!=|<=|>=|\s<\s|\s>\s/.test(s))
@@ -12504,7 +12510,6 @@ function classifyBadValue(value) {
12504
12510
  return null;
12505
12511
  }
12506
12512
  var UNSUPPORTED_EXPR_GUIDANCE = {
12507
- "legacy-template": "Unquoted {...} string templates are no longer supported. Wrap the value in $'...', e.g. $'flex {.color}'.",
12508
12513
  ternary: "Ternary expressions aren't supported in dynamic attributes. Define a method or computed field on the component that returns the value, then reference it as '$methodName'.",
12509
12514
  comparison: "Comparisons aren't supported in dynamic attributes. Define a method like 'isFooSelected' that returns the boolean, then reference it as '$isFooSelected'.",
12510
12515
  logical: "Logical operators aren't supported in dynamic attributes. Combine the conditions in a method on the component and reference it as '$methodName'.",
@@ -12514,6 +12519,8 @@ function checkComponent(Comp, lx = new LintContext, { wellKnownExtras = EMPTY_SE
12514
12519
  return lx.push({ componentName: Comp.name }, () => {
12515
12520
  checkUnknownSpecKeys(lx, Comp, wellKnownExtras);
12516
12521
  checkFieldDeclarations(lx, Comp);
12522
+ checkProvidesAreAddressable(lx, Comp);
12523
+ checkLookupShapes(lx, Comp);
12517
12524
  const referencedAlters = new Set;
12518
12525
  const referencedInputs = new Set;
12519
12526
  const referencedDynamics = new Set;
@@ -12694,10 +12701,11 @@ function checkKnownHandlerNames(lx, view, Comp, referencedAlters, referencedDyna
12694
12701
  }
12695
12702
  }
12696
12703
  function mkAttrValEnv(Comp, referencedAlters, referencedDynamics) {
12697
- const { scope, alter, dynamic, Class } = Comp;
12704
+ const { scope, alter, provide, lookup, Class } = Comp;
12698
12705
  const { prototype: proto } = Class;
12699
12706
  const { fields } = Class.getMetaClass();
12700
- return { fields, proto, scope, alter, referencedAlters, dynamicMap: dynamic, referencedDynamics };
12707
+ const dynamicMap = { ...provide, ...lookup };
12708
+ return { fields, proto, scope, alter, referencedAlters, dynamicMap, referencedDynamics };
12701
12709
  }
12702
12710
  function checkEventHandlersHaveImpls(lx, Comp, referencedInputs) {
12703
12711
  const { input, views, Class } = Comp;
@@ -13011,10 +13019,51 @@ function checkUnreferencedInputHandlers(lx, Comp, referencedInputs) {
13011
13019
  }
13012
13020
  }
13013
13021
  }
13022
+ function checkProvidesAreAddressable(lx, Comp) {
13023
+ for (const name in Comp._rawProvide) {
13024
+ if (Comp.provide[name] === undefined) {
13025
+ lx.error(PROVIDE_NOT_ADDRESSABLE, { name, value: Comp._rawProvide[name] });
13026
+ }
13027
+ }
13028
+ }
13029
+ var KNOWN_LOOKUP_KEYS = new Set(["for", "default"]);
13030
+ function checkLookupShapes(lx, Comp) {
13031
+ for (const name in Comp._rawLookup) {
13032
+ const raw = Comp._rawLookup[name];
13033
+ let target;
13034
+ if (typeof raw === "string") {
13035
+ target = raw;
13036
+ } else if (raw === null || typeof raw !== "object" || Array.isArray(raw)) {
13037
+ lx.error(LOOKUP_BAD_SHAPE, {
13038
+ name,
13039
+ problem: 'must be a "Producer.provideName" string or a { for, default } object'
13040
+ });
13041
+ continue;
13042
+ } else {
13043
+ const extra = Object.keys(raw).filter((k) => !KNOWN_LOOKUP_KEYS.has(k));
13044
+ if (extra.length > 0) {
13045
+ lx.error(LOOKUP_BAD_SHAPE, { name, problem: `unknown key(s): ${extra.join(", ")}` });
13046
+ continue;
13047
+ }
13048
+ if (typeof raw.for !== "string") {
13049
+ lx.error(LOOKUP_BAD_SHAPE, { name, problem: "'for' is required and must be a string" });
13050
+ continue;
13051
+ }
13052
+ if (raw.default !== undefined && typeof raw.default !== "string") {
13053
+ lx.error(LOOKUP_BAD_SHAPE, { name, problem: "'default' must be a string" });
13054
+ continue;
13055
+ }
13056
+ target = raw.for;
13057
+ }
13058
+ const parts = target.split(".");
13059
+ if (parts.length !== 2 || !parts[0] || !parts[1]) {
13060
+ lx.error(LOOKUP_TARGET_MALFORMED, { name, target });
13061
+ }
13062
+ }
13063
+ }
13014
13064
  function checkUnreferencedDynamics(lx, Comp, referencedDynamics) {
13015
- for (const name in Comp.dynamic) {
13016
- const dyn = Comp.dynamic[name];
13017
- if (dyn.constructor.name === "DynamicAlias" && !referencedDynamics.has(name)) {
13065
+ for (const name in Comp.lookup) {
13066
+ if (!referencedDynamics.has(name)) {
13018
13067
  lx.hint(DYN_ALIAS_NOT_REFERENCED, { name });
13019
13068
  }
13020
13069
  }
@@ -13496,7 +13545,6 @@ function reportTestReportToConsole(report) {
13496
13545
 
13497
13546
  // tools/format/lint.js
13498
13547
  var UNSUPPORTED_EXPR_LABEL = {
13499
- "legacy-template": "string template",
13500
13548
  ternary: "ternary expression",
13501
13549
  comparison: "comparison",
13502
13550
  logical: "logical expression",
@@ -13616,7 +13664,13 @@ function lintIdToMessage(id, info) {
13616
13664
  case "DYN_VAL_NOT_DEFINED":
13617
13665
  return `Dynamic variable '*${info.name}' is not defined${fmtOriginSuffix(info)}`;
13618
13666
  case "DYN_ALIAS_NOT_REFERENCED":
13619
- return `Dynamic '${info.name}' is defined but never used — remove it or reference it as '*${info.name}' in a view`;
13667
+ return `Lookup '${info.name}' is defined but never used — remove it or reference it as '*${info.name}' in a view`;
13668
+ case "PROVIDE_NOT_ADDRESSABLE":
13669
+ return `Provide '${info.name}' value '${info.value}' must be a field ('.f') or seq-access ('.s[.k]') — a method/constant can't be a render target`;
13670
+ case "LOOKUP_BAD_SHAPE":
13671
+ return `Lookup '${info.name}' has an invalid shape: ${info.problem}`;
13672
+ case "LOOKUP_TARGET_MALFORMED":
13673
+ return `Lookup '${info.name}' target '${info.target}' must be 'Producer.provideName' (a string, or the 'for' of { for, default })`;
13620
13674
  case "UNKNOWN_MACRO_ARG":
13621
13675
  return `Argument '${info.name}' is not declared in macro '${info.macroName}'`;
13622
13676
  case "UNKNOWN_DIRECTIVE":
@@ -13746,9 +13800,6 @@ class Components {
13746
13800
  getCompFor(v) {
13747
13801
  return v?.[this.getComponentSymbol]?.() ?? null;
13748
13802
  }
13749
- getOnEnterFor(v) {
13750
- return this.getCompFor(v)?.on.stackEnter ?? defaultOnStackEnter;
13751
- }
13752
13803
  getHandlerFor(v, name, key) {
13753
13804
  return this.getCompFor(v)?.[key][name] ?? null;
13754
13805
  }
@@ -13818,36 +13869,30 @@ class ComponentStack {
13818
13869
  }
13819
13870
  }
13820
13871
 
13821
- class Dynamic {
13872
+ class ProvideInfo {
13822
13873
  constructor(name, val, symbol) {
13823
13874
  this.name = name;
13824
13875
  this.val = val;
13825
13876
  this.symbol = symbol;
13826
13877
  }
13827
- getSymbol(_stack) {
13828
- return this.symbol;
13829
- }
13830
- evalAndBind(stack, binds) {
13831
- binds[this.getSymbol(stack)] = this.val.eval(stack);
13832
- }
13833
13878
  }
13834
13879
 
13835
- class DynamicAlias extends Dynamic {
13836
- constructor(name, val, compName, dynName) {
13837
- super(name, val, null);
13880
+ class LookupInfo {
13881
+ constructor(name, compName, provideName, val) {
13882
+ this.name = name;
13838
13883
  this.compName = compName;
13839
- this.dynName = dynName;
13840
- }
13841
- _resolveSymbol(stack) {
13842
- return stack.lookupType(this.compName)?.dynamic[this.dynName]?.symbol ?? null;
13884
+ this.provideName = provideName;
13885
+ this.val = val;
13886
+ this._sym = undefined;
13843
13887
  }
13844
- getSymbol(stack) {
13845
- this.symbol ??= this._resolveSymbol(stack);
13846
- return this.symbol;
13888
+ getProducerSymbol(stack) {
13889
+ if (this._sym === undefined)
13890
+ this._sym = stack.lookupType(this.compName)?.provide?.[this.provideName]?.symbol ?? null;
13891
+ return this._sym;
13847
13892
  }
13848
13893
  }
13849
13894
  var isString = (v) => typeof v === "string";
13850
- var _rawSpecKeys = "name view style commonStyle globalStyle input receive bubble response alter on views dynamic fields methods statics";
13895
+ var _rawSpecKeys = "name view style commonStyle globalStyle input receive bubble response alter views provide lookup fields methods statics";
13851
13896
  var KNOWN_SPEC_KEYS = new Set(_rawSpecKeys.split(" "));
13852
13897
  var _compId = 0;
13853
13898
 
@@ -13864,35 +13909,47 @@ class Component {
13864
13909
  this.bubble = o.bubble ?? {};
13865
13910
  this.response = o.response ?? {};
13866
13911
  this.alter = o.alter ?? {};
13867
- this.on = { stackEnter: o.on?.stackEnter ?? defaultOnStackEnter };
13868
13912
  for (const name in o.views ?? {}) {
13869
13913
  const v = o.views[name];
13870
13914
  const { view, style } = isString(v) ? { view: v } : v;
13871
13915
  this.views[name] = new View(name, view, style);
13872
13916
  }
13873
- this._rawDynamic = o.dynamic ?? {};
13874
- this.dynamic = {};
13917
+ this._rawProvide = o.provide ?? {};
13918
+ this._rawLookup = o.lookup ?? {};
13919
+ this.provide = {};
13920
+ this.lookup = {};
13875
13921
  this.scope = null;
13922
+ this.spec = o;
13876
13923
  this.extra = {};
13877
13924
  for (const key of Object.keys(o))
13878
13925
  if (!KNOWN_SPEC_KEYS.has(key))
13879
13926
  this.extra[key] = o[key];
13880
13927
  }
13928
+ clone() {
13929
+ return Component.fromSpec(this.spec);
13930
+ }
13881
13931
  compile(ParseContext2) {
13882
13932
  for (const name in this.views)
13883
13933
  this.views[name].compile(new ParseContext2, this.scope, this.id);
13884
- for (const key in this._rawDynamic) {
13885
- const dinfo = this._rawDynamic[key];
13886
- if (isString(dinfo)) {
13887
- const val = vp.parseField(dinfo, this.views.main.ctx);
13888
- this.dynamic[key] = new Dynamic(key, val, Symbol(key));
13889
- } else if (isString(dinfo?.default) && isString(dinfo?.for)) {
13890
- const val = vp.parseField(dinfo.default, this.views.main.ctx);
13891
- const [compName, dynName] = dinfo.for.split(".");
13892
- if (isString(compName) && isString(dynName))
13893
- this.dynamic[key] = new DynamicAlias(key, val, compName, dynName);
13894
- }
13934
+ const ctx = this.views.main.ctx;
13935
+ for (const key in this._rawProvide) {
13936
+ const val = vp.parseProvide(this._rawProvide[key], ctx);
13937
+ if (val)
13938
+ this.provide[key] = new ProvideInfo(key, val, Symbol(key));
13939
+ }
13940
+ for (const key in this._rawLookup) {
13941
+ const linfo = this._rawLookup[key];
13942
+ const forStr = isString(linfo) ? linfo : isString(linfo?.for) ? linfo.for : null;
13943
+ const [compName, provideName] = forStr === null ? [] : forStr.split(".");
13944
+ if (!isString(compName) || !isString(provideName))
13945
+ continue;
13946
+ const defStr = isString(linfo?.default) ? linfo.default : null;
13947
+ const val = defStr === null ? null : vp.parseField(defStr, ctx);
13948
+ this.lookup[key] = new LookupInfo(key, compName, provideName, val);
13895
13949
  }
13950
+ for (const key in this.lookup)
13951
+ if (this.provide[key] !== undefined)
13952
+ console.warn("name declared in both provide and lookup", this.name, key);
13896
13953
  }
13897
13954
  make(args, opts) {
13898
13955
  return this.Class.make(args, opts ?? { scope: this.scope });
@@ -13920,9 +13977,6 @@ class Component {
13920
13977
  `);
13921
13978
  }
13922
13979
  }
13923
- function defaultOnStackEnter() {
13924
- return null;
13925
- }
13926
13980
 
13927
13981
  // src/stack.js
13928
13982
  var STOP = Symbol("STOP");
@@ -13981,47 +14035,61 @@ class Stack2 {
13981
14035
  this.viewsId = viewsId;
13982
14036
  this.ctx = ctx;
13983
14037
  }
13984
- _enrichOnEnter() {
13985
- return this.withDynamicBinds(this.comps.getOnEnterFor(this.it).call(this.it));
14038
+ _pushProvides() {
14039
+ const provide = this.comps.getCompFor(this.it)?.provide;
14040
+ if (provide == null)
14041
+ return this;
14042
+ const dynObj = {};
14043
+ let has2 = false;
14044
+ for (const k in provide) {
14045
+ dynObj[provide[k].symbol] = provide[k].val.eval(this);
14046
+ has2 = true;
14047
+ }
14048
+ if (!has2)
14049
+ return this;
14050
+ const newDynBinds = [new ObjectFrame(dynObj), this.dynBinds];
14051
+ const { comps, it, binds, views, viewsId, ctx } = this;
14052
+ return new Stack2(comps, it, binds, newDynBinds, views, viewsId, ctx);
13986
14053
  }
13987
14054
  static root(comps, it, ctx) {
13988
14055
  const binds = [new BindFrame(it, { it }, true), null];
13989
14056
  const dynBinds = [new ObjectFrame({}), null];
13990
14057
  const views = ["main", null];
13991
- return new Stack2(comps, it, binds, dynBinds, views, "", ctx)._enrichOnEnter();
14058
+ return new Stack2(comps, it, binds, dynBinds, views, "", ctx)._pushProvides();
13992
14059
  }
13993
14060
  enter(it, bindings = {}, isFrame = true) {
13994
14061
  const { comps, binds, dynBinds, views, viewsId, ctx } = this;
13995
14062
  const newBinds = [new BindFrame(it, bindings, isFrame), binds];
13996
14063
  const stack = new Stack2(comps, it, newBinds, dynBinds, views, viewsId, ctx);
13997
- return isFrame ? stack._enrichOnEnter() : stack;
14064
+ return isFrame ? stack._pushProvides() : stack;
13998
14065
  }
13999
14066
  pushViewName(name) {
14000
14067
  const { comps, it, binds, dynBinds, views, ctx } = this;
14001
14068
  const newViews = [name, views];
14002
14069
  return new Stack2(comps, it, binds, dynBinds, newViews, computeViewsId(newViews), ctx);
14003
14070
  }
14004
- withDynamicBinds(dynamics) {
14005
- if (dynamics == null || dynamics.length === 0)
14006
- return this;
14007
- const dynObj = {};
14008
- const comp = this.comps.getCompFor(this.it);
14009
- for (const dynName of dynamics)
14010
- comp.dynamic[dynName].evalAndBind(this, dynObj);
14011
- const newDynBinds = [new ObjectFrame(dynObj), this.dynBinds];
14012
- const { comps, it, binds, views, viewsId, ctx } = this;
14013
- return new Stack2(comps, it, binds, newDynBinds, views, viewsId, ctx);
14071
+ _pushDynBindValuesToArray(arr, comp) {
14072
+ for (const k in comp.provide)
14073
+ arr.push(this._lookupProvide(comp.provide[k]));
14074
+ for (const k in comp.lookup)
14075
+ arr.push(this._lookupAlias(comp.lookup[k]));
14014
14076
  }
14015
- _pushDynBindValuesToArray(arr, dyns) {
14016
- for (const k in dyns)
14017
- arr.push(this._lookupDynamicWithDynVal(dyns[k]));
14077
+ _lookupProvide(p) {
14078
+ return lookup(this.dynBinds, p.symbol) ?? p.val.eval(this) ?? null;
14018
14079
  }
14019
- _lookupDynamicWithDynVal(d) {
14020
- return lookup(this.dynBinds, d.getSymbol(this)) ?? d.val?.eval(this) ?? null;
14080
+ _lookupAlias(lk) {
14081
+ const sym = lk.getProducerSymbol(this);
14082
+ return (sym != null ? lookup(this.dynBinds, sym) : null) ?? lk.val?.eval(this) ?? null;
14021
14083
  }
14022
14084
  lookupDynamic(name) {
14023
- const d = this.comps.getCompFor(this.it)?.dynamic[name];
14024
- return d ? this._lookupDynamicWithDynVal(d) : null;
14085
+ const comp = this.comps.getCompFor(this.it);
14086
+ if (comp == null)
14087
+ return null;
14088
+ const lk = comp.lookup[name];
14089
+ if (lk !== undefined)
14090
+ return this._lookupAlias(lk);
14091
+ const p = comp.provide[name];
14092
+ return p !== undefined ? this._lookupProvide(p) : null;
14025
14093
  }
14026
14094
  lookupBind(name) {
14027
14095
  return lookup(this.binds, name);
@@ -15052,7 +15120,8 @@ function classFromData(name, { fields = {}, methods, statics }) {
15052
15120
  b.statics(statics);
15053
15121
  return b.build();
15054
15122
  }
15055
- var component = (opts) => new Component(classFromData(opts.name, opts), opts);
15123
+ Component.fromSpec = (opts) => new Component(classFromData(opts.name, opts), opts);
15124
+ var component = (opts) => Component.fromSpec(opts);
15056
15125
 
15057
15126
  // src/cache.js
15058
15127
  class NullDomCache {
@@ -15171,7 +15240,7 @@ class Renderer {
15171
15240
  _rValComp(stack, val, comp, node, key, viewName) {
15172
15241
  const cacheKey = `${viewName ?? stack.viewsId ?? ""}-${key}`;
15173
15242
  const cachePath = [node, val];
15174
- stack._pushDynBindValuesToArray(cachePath, comp.dynamic);
15243
+ stack._pushDynBindValuesToArray(cachePath, comp);
15175
15244
  const cachedNode = this.cache.get(cachePath, cacheKey);
15176
15245
  if (cachedNode)
15177
15246
  return cachedNode;
@@ -15776,6 +15845,7 @@ export {
15776
15845
  REDUNDANT_TEMPLATE_STRING,
15777
15846
  ParseContext,
15778
15847
  PairSorting,
15848
+ PROVIDE_NOT_ADDRESSABLE,
15779
15849
  PLACEHOLDERLESS_TEMPLATE_STRING,
15780
15850
  OrderedSet,
15781
15851
  OrderedMap,
@@ -15795,6 +15865,8 @@ export {
15795
15865
  LintContext,
15796
15866
  LintComponentResult,
15797
15867
  LintClassCollectorCtx,
15868
+ LOOKUP_TARGET_MALFORMED,
15869
+ LOOKUP_BAD_SHAPE,
15798
15870
  KList,
15799
15871
  Set2 as ISet,
15800
15872
  INPUT_HANDLER_NOT_REFERENCED,