@almadar/ui 4.6.11 → 4.6.13

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.
@@ -51712,7 +51712,24 @@ function useTraitStateMachine(traitBindings, slotsActions, options) {
51712
51712
  const actions = slotsActionsRef.current;
51713
51713
  console.log("[TraitStateMachine] Processing event:", normalizedEvent, "payload:", payload);
51714
51714
  const bindingMap = new Map(bindings.map((b) => [b.trait.name, b]));
51715
+ for (const traitName of bindingMap.keys()) {
51716
+ const traitState = currentManager.getState(traitName);
51717
+ eventBus.emit(`${traitName}:DISPATCH`, {
51718
+ event: normalizedEvent,
51719
+ payload,
51720
+ currentState: traitState?.currentState
51721
+ });
51722
+ }
51715
51723
  const results = currentManager.sendEvent(normalizedEvent, payload);
51724
+ for (const { traitName, result } of results) {
51725
+ const suffix = result.executed ? "SUCCESS" : "ERROR";
51726
+ eventBus.emit(`${traitName}:${normalizedEvent}:${suffix}`, {
51727
+ event: normalizedEvent,
51728
+ payload,
51729
+ newState: result.newState,
51730
+ currentState: result.previousState
51731
+ });
51732
+ }
51716
51733
  const emittedByTrait = /* @__PURE__ */ new Map();
51717
51734
  for (const { traitName, result } of results) {
51718
51735
  const binding = bindingMap.get(traitName);
package/dist/avl/index.js CHANGED
@@ -51666,7 +51666,24 @@ function useTraitStateMachine(traitBindings, slotsActions, options) {
51666
51666
  const actions = slotsActionsRef.current;
51667
51667
  console.log("[TraitStateMachine] Processing event:", normalizedEvent, "payload:", payload);
51668
51668
  const bindingMap = new Map(bindings.map((b) => [b.trait.name, b]));
51669
+ for (const traitName of bindingMap.keys()) {
51670
+ const traitState = currentManager.getState(traitName);
51671
+ eventBus.emit(`${traitName}:DISPATCH`, {
51672
+ event: normalizedEvent,
51673
+ payload,
51674
+ currentState: traitState?.currentState
51675
+ });
51676
+ }
51669
51677
  const results = currentManager.sendEvent(normalizedEvent, payload);
51678
+ for (const { traitName, result } of results) {
51679
+ const suffix = result.executed ? "SUCCESS" : "ERROR";
51680
+ eventBus.emit(`${traitName}:${normalizedEvent}:${suffix}`, {
51681
+ event: normalizedEvent,
51682
+ payload,
51683
+ newState: result.newState,
51684
+ currentState: result.previousState
51685
+ });
51686
+ }
51670
51687
  const emittedByTrait = /* @__PURE__ */ new Map();
51671
51688
  for (const { traitName, result } of results) {
51672
51689
  const binding = bindingMap.get(traitName);
@@ -38391,7 +38391,24 @@ function useTraitStateMachine(traitBindings, slotsActions, options) {
38391
38391
  const actions = slotsActionsRef.current;
38392
38392
  console.log("[TraitStateMachine] Processing event:", normalizedEvent, "payload:", payload);
38393
38393
  const bindingMap = new Map(bindings.map((b) => [b.trait.name, b]));
38394
+ for (const traitName of bindingMap.keys()) {
38395
+ const traitState = currentManager.getState(traitName);
38396
+ eventBus.emit(`${traitName}:DISPATCH`, {
38397
+ event: normalizedEvent,
38398
+ payload,
38399
+ currentState: traitState?.currentState
38400
+ });
38401
+ }
38394
38402
  const results = currentManager.sendEvent(normalizedEvent, payload);
38403
+ for (const { traitName, result } of results) {
38404
+ const suffix = result.executed ? "SUCCESS" : "ERROR";
38405
+ eventBus.emit(`${traitName}:${normalizedEvent}:${suffix}`, {
38406
+ event: normalizedEvent,
38407
+ payload,
38408
+ newState: result.newState,
38409
+ currentState: result.previousState
38410
+ });
38411
+ }
38395
38412
  const emittedByTrait = /* @__PURE__ */ new Map();
38396
38413
  for (const { traitName, result } of results) {
38397
38414
  const binding = bindingMap.get(traitName);
@@ -38346,7 +38346,24 @@ function useTraitStateMachine(traitBindings, slotsActions, options) {
38346
38346
  const actions = slotsActionsRef.current;
38347
38347
  console.log("[TraitStateMachine] Processing event:", normalizedEvent, "payload:", payload);
38348
38348
  const bindingMap = new Map(bindings.map((b) => [b.trait.name, b]));
38349
+ for (const traitName of bindingMap.keys()) {
38350
+ const traitState = currentManager.getState(traitName);
38351
+ eventBus.emit(`${traitName}:DISPATCH`, {
38352
+ event: normalizedEvent,
38353
+ payload,
38354
+ currentState: traitState?.currentState
38355
+ });
38356
+ }
38349
38357
  const results = currentManager.sendEvent(normalizedEvent, payload);
38358
+ for (const { traitName, result } of results) {
38359
+ const suffix = result.executed ? "SUCCESS" : "ERROR";
38360
+ eventBus.emit(`${traitName}:${normalizedEvent}:${suffix}`, {
38361
+ event: normalizedEvent,
38362
+ payload,
38363
+ newState: result.newState,
38364
+ currentState: result.previousState
38365
+ });
38366
+ }
38350
38367
  const emittedByTrait = /* @__PURE__ */ new Map();
38351
38368
  for (const { traitName, result } of results) {
38352
38369
  const binding = bindingMap.get(traitName);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@almadar/ui",
3
- "version": "4.6.11",
3
+ "version": "4.6.13",
4
4
  "description": "React UI components, hooks, and providers for Almadar",
5
5
  "type": "module",
6
6
  "main": "./dist/components/index.js",