@almadar/ui 4.10.1 → 4.10.3

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.
@@ -51445,8 +51445,12 @@ function useResolvedSchema(schema, pageName) {
51445
51445
  for (const traitRef of orb.traits ?? []) {
51446
51446
  if (typeof traitRef === "string") continue;
51447
51447
  const t = traitRef;
51448
- if (typeof t.name !== "string" || !t.listens?.length) continue;
51449
- callSiteListensByTrait.set(t.name, t.listens);
51448
+ const inlineListens = t.listens?.length ? t.listens : void 0;
51449
+ const resolvedListens = t._resolved?.listens?.length ? t._resolved.listens : void 0;
51450
+ const listens = inlineListens ?? resolvedListens;
51451
+ const traitName = t.name ?? t._resolved?.name;
51452
+ if (typeof traitName !== "string" || !listens) continue;
51453
+ callSiteListensByTrait.set(traitName, listens);
51450
51454
  }
51451
51455
  }
51452
51456
  for (const [traitName, trait] of resolved.traits) {
@@ -52066,32 +52070,6 @@ function useTraitStateMachine(traitBindings, slotsActions, options) {
52066
52070
  fromBridge: true
52067
52071
  });
52068
52072
  }
52069
- const executedTraits = new Set(results.map((r2) => r2.traitName));
52070
- for (const binding of bindings) {
52071
- const traitName = binding.trait.name;
52072
- if (executedTraits.has(traitName)) continue;
52073
- const { events: traitEvents, transitions: traitTransitions } = binding.trait;
52074
- const eventDeclared = traitEvents.some((e) => e.key === normalizedEvent);
52075
- const hasTransition = traitTransitions.some((t) => t.event === normalizedEvent);
52076
- crossTraitLog.debug("rebroadcast:second-pass:candidate", {
52077
- event: normalizedEvent,
52078
- traitName,
52079
- eventDeclared,
52080
- hasTransition,
52081
- orbitalName: orbitalsByTrait?.[traitName],
52082
- traitEventKeys: traitEvents.map((e) => e.key).join(",")
52083
- });
52084
- if (!eventDeclared || hasTransition) continue;
52085
- const orbitalName = orbitalsByTrait?.[traitName];
52086
- if (!orbitalName) continue;
52087
- const busKey = `UI:${orbitalName}.${traitName}.${normalizedEvent}`;
52088
- crossTraitLog.info("rebroadcast:emit", { busKey, traitName, event: normalizedEvent });
52089
- eventBus.emit(busKey, payload, {
52090
- orbital: orbitalName,
52091
- trait: traitName,
52092
- fromBridge: true
52093
- });
52094
- }
52095
52073
  }
52096
52074
  if (results.length > 0) {
52097
52075
  setTraitStates(currentManager.getAllStates());
package/dist/avl/index.js CHANGED
@@ -51399,8 +51399,12 @@ function useResolvedSchema(schema, pageName) {
51399
51399
  for (const traitRef of orb.traits ?? []) {
51400
51400
  if (typeof traitRef === "string") continue;
51401
51401
  const t = traitRef;
51402
- if (typeof t.name !== "string" || !t.listens?.length) continue;
51403
- callSiteListensByTrait.set(t.name, t.listens);
51402
+ const inlineListens = t.listens?.length ? t.listens : void 0;
51403
+ const resolvedListens = t._resolved?.listens?.length ? t._resolved.listens : void 0;
51404
+ const listens = inlineListens ?? resolvedListens;
51405
+ const traitName = t.name ?? t._resolved?.name;
51406
+ if (typeof traitName !== "string" || !listens) continue;
51407
+ callSiteListensByTrait.set(traitName, listens);
51404
51408
  }
51405
51409
  }
51406
51410
  for (const [traitName, trait] of resolved.traits) {
@@ -52020,32 +52024,6 @@ function useTraitStateMachine(traitBindings, slotsActions, options) {
52020
52024
  fromBridge: true
52021
52025
  });
52022
52026
  }
52023
- const executedTraits = new Set(results.map((r2) => r2.traitName));
52024
- for (const binding of bindings) {
52025
- const traitName = binding.trait.name;
52026
- if (executedTraits.has(traitName)) continue;
52027
- const { events: traitEvents, transitions: traitTransitions } = binding.trait;
52028
- const eventDeclared = traitEvents.some((e) => e.key === normalizedEvent);
52029
- const hasTransition = traitTransitions.some((t) => t.event === normalizedEvent);
52030
- crossTraitLog.debug("rebroadcast:second-pass:candidate", {
52031
- event: normalizedEvent,
52032
- traitName,
52033
- eventDeclared,
52034
- hasTransition,
52035
- orbitalName: orbitalsByTrait?.[traitName],
52036
- traitEventKeys: traitEvents.map((e) => e.key).join(",")
52037
- });
52038
- if (!eventDeclared || hasTransition) continue;
52039
- const orbitalName = orbitalsByTrait?.[traitName];
52040
- if (!orbitalName) continue;
52041
- const busKey = `UI:${orbitalName}.${traitName}.${normalizedEvent}`;
52042
- crossTraitLog.info("rebroadcast:emit", { busKey, traitName, event: normalizedEvent });
52043
- eventBus.emit(busKey, payload, {
52044
- orbital: orbitalName,
52045
- trait: traitName,
52046
- fromBridge: true
52047
- });
52048
- }
52049
52027
  }
52050
52028
  if (results.length > 0) {
52051
52029
  setTraitStates(currentManager.getAllStates());
@@ -38691,32 +38691,6 @@ function useTraitStateMachine(traitBindings, slotsActions, options) {
38691
38691
  fromBridge: true
38692
38692
  });
38693
38693
  }
38694
- const executedTraits = new Set(results.map((r) => r.traitName));
38695
- for (const binding of bindings) {
38696
- const traitName = binding.trait.name;
38697
- if (executedTraits.has(traitName)) continue;
38698
- const { events: traitEvents, transitions: traitTransitions } = binding.trait;
38699
- const eventDeclared = traitEvents.some((e) => e.key === normalizedEvent);
38700
- const hasTransition = traitTransitions.some((t) => t.event === normalizedEvent);
38701
- crossTraitLog.debug("rebroadcast:second-pass:candidate", {
38702
- event: normalizedEvent,
38703
- traitName,
38704
- eventDeclared,
38705
- hasTransition,
38706
- orbitalName: orbitalsByTrait?.[traitName],
38707
- traitEventKeys: traitEvents.map((e) => e.key).join(",")
38708
- });
38709
- if (!eventDeclared || hasTransition) continue;
38710
- const orbitalName = orbitalsByTrait?.[traitName];
38711
- if (!orbitalName) continue;
38712
- const busKey = `UI:${orbitalName}.${traitName}.${normalizedEvent}`;
38713
- crossTraitLog.info("rebroadcast:emit", { busKey, traitName, event: normalizedEvent });
38714
- eventBus.emit(busKey, payload, {
38715
- orbital: orbitalName,
38716
- trait: traitName,
38717
- fromBridge: true
38718
- });
38719
- }
38720
38694
  }
38721
38695
  if (results.length > 0) {
38722
38696
  setTraitStates(currentManager.getAllStates());
@@ -38843,8 +38817,12 @@ function useResolvedSchema(schema, pageName) {
38843
38817
  for (const traitRef of orb.traits ?? []) {
38844
38818
  if (typeof traitRef === "string") continue;
38845
38819
  const t = traitRef;
38846
- if (typeof t.name !== "string" || !t.listens?.length) continue;
38847
- callSiteListensByTrait.set(t.name, t.listens);
38820
+ const inlineListens = t.listens?.length ? t.listens : void 0;
38821
+ const resolvedListens = t._resolved?.listens?.length ? t._resolved.listens : void 0;
38822
+ const listens = inlineListens ?? resolvedListens;
38823
+ const traitName = t.name ?? t._resolved?.name;
38824
+ if (typeof traitName !== "string" || !listens) continue;
38825
+ callSiteListensByTrait.set(traitName, listens);
38848
38826
  }
38849
38827
  }
38850
38828
  for (const [traitName, trait] of resolved.traits) {
@@ -38646,32 +38646,6 @@ function useTraitStateMachine(traitBindings, slotsActions, options) {
38646
38646
  fromBridge: true
38647
38647
  });
38648
38648
  }
38649
- const executedTraits = new Set(results.map((r) => r.traitName));
38650
- for (const binding of bindings) {
38651
- const traitName = binding.trait.name;
38652
- if (executedTraits.has(traitName)) continue;
38653
- const { events: traitEvents, transitions: traitTransitions } = binding.trait;
38654
- const eventDeclared = traitEvents.some((e) => e.key === normalizedEvent);
38655
- const hasTransition = traitTransitions.some((t) => t.event === normalizedEvent);
38656
- crossTraitLog.debug("rebroadcast:second-pass:candidate", {
38657
- event: normalizedEvent,
38658
- traitName,
38659
- eventDeclared,
38660
- hasTransition,
38661
- orbitalName: orbitalsByTrait?.[traitName],
38662
- traitEventKeys: traitEvents.map((e) => e.key).join(",")
38663
- });
38664
- if (!eventDeclared || hasTransition) continue;
38665
- const orbitalName = orbitalsByTrait?.[traitName];
38666
- if (!orbitalName) continue;
38667
- const busKey = `UI:${orbitalName}.${traitName}.${normalizedEvent}`;
38668
- crossTraitLog.info("rebroadcast:emit", { busKey, traitName, event: normalizedEvent });
38669
- eventBus.emit(busKey, payload, {
38670
- orbital: orbitalName,
38671
- trait: traitName,
38672
- fromBridge: true
38673
- });
38674
- }
38675
38649
  }
38676
38650
  if (results.length > 0) {
38677
38651
  setTraitStates(currentManager.getAllStates());
@@ -38798,8 +38772,12 @@ function useResolvedSchema(schema, pageName) {
38798
38772
  for (const traitRef of orb.traits ?? []) {
38799
38773
  if (typeof traitRef === "string") continue;
38800
38774
  const t = traitRef;
38801
- if (typeof t.name !== "string" || !t.listens?.length) continue;
38802
- callSiteListensByTrait.set(t.name, t.listens);
38775
+ const inlineListens = t.listens?.length ? t.listens : void 0;
38776
+ const resolvedListens = t._resolved?.listens?.length ? t._resolved.listens : void 0;
38777
+ const listens = inlineListens ?? resolvedListens;
38778
+ const traitName = t.name ?? t._resolved?.name;
38779
+ if (typeof traitName !== "string" || !listens) continue;
38780
+ callSiteListensByTrait.set(traitName, listens);
38803
38781
  }
38804
38782
  }
38805
38783
  for (const [traitName, trait] of resolved.traits) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@almadar/ui",
3
- "version": "4.10.1",
3
+ "version": "4.10.3",
4
4
  "description": "React UI components, hooks, and providers for Almadar",
5
5
  "type": "module",
6
6
  "main": "./dist/components/index.js",