tutuca 0.9.19 → 0.9.21

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.js CHANGED
@@ -1644,9 +1644,14 @@ class ComponentStack {
1644
1644
  comp.scope = this.enter();
1645
1645
  this.comps.registerComponent(comp);
1646
1646
  this.byName[comp.name] = comp;
1647
- const alias = aliases[comp.name];
1648
- if (alias)
1647
+ }
1648
+ for (const alias in aliases) {
1649
+ const comp = this.byName[aliases[alias]];
1650
+ console.assert(this.byName[alias] === undefined, "alias overrides component", alias);
1651
+ if (comp !== undefined)
1649
1652
  this.byName[alias] = comp;
1653
+ else
1654
+ console.warn("alias", alias, "to inexistent component", aliases[alias]);
1650
1655
  }
1651
1656
  }
1652
1657
  registerMacros(macros) {
@@ -1981,9 +1986,10 @@ class Transactor {
1981
1986
  }
1982
1987
  }
1983
1988
  function mkReq404(name) {
1984
- return () => {
1989
+ const fn = () => {
1985
1990
  throw new Error(`Request not found: ${name}`);
1986
1991
  };
1992
+ return { fn };
1987
1993
  }
1988
1994
  function nullHandler() {
1989
1995
  return this;
@@ -2624,15 +2630,13 @@ class App {
2624
2630
  _dispatchEvent(e) {
2625
2631
  const { type } = e;
2626
2632
  const isDrag = type === "dragover" || type === "dragstart" || type === "dragend";
2627
- const { rootNode: root, maxEventNodeDepth: maxDepth, comps } = this;
2633
+ const { rootNode: root, maxEventNodeDepth: maxDepth, comps, transactor } = this;
2628
2634
  const [path, handlers] = Path.fromEvent(e, root, maxDepth, comps, !isDrag);
2629
2635
  if (isDrag)
2630
2636
  this._handleDragEvent(e, type, path);
2631
- if (path !== null && handlers !== null) {
2632
- for (const handler of handlers) {
2633
- this.transactor.transactInputNow(path, e, handler, this.dragInfo);
2634
- }
2635
- }
2637
+ if (path !== null && handlers !== null)
2638
+ for (const handler of handlers)
2639
+ transactor.transactInputNow(path, e, handler, this.dragInfo);
2636
2640
  }
2637
2641
  _handleTouchEvent(e) {
2638
2642
  const { type } = e;