@almadar/ui 5.41.0 → 5.42.0

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.
@@ -46871,6 +46871,10 @@ function SequencerBoard({
46871
46871
  stepDurationMs = 1e3,
46872
46872
  playEvent,
46873
46873
  completeEvent,
46874
+ placeEvent,
46875
+ removeEvent,
46876
+ checkEvent,
46877
+ playAgainEvent,
46874
46878
  className
46875
46879
  }) {
46876
46880
  const { emit } = useEventBus();
@@ -46906,7 +46910,8 @@ function SequencerBoard({
46906
46910
  return next;
46907
46911
  });
46908
46912
  emit("UI:PLAY_SOUND", { key: "drop_slot" });
46909
- }, [emit]);
46913
+ if (placeEvent) emit(`UI:${placeEvent}`, { slotIndex: index, actionId: item.id });
46914
+ }, [emit, placeEvent]);
46910
46915
  const handleSlotRemove = React91.useCallback((index) => {
46911
46916
  setSlots((prev) => {
46912
46917
  const next = [...prev];
@@ -46919,7 +46924,8 @@ function SequencerBoard({
46919
46924
  return next;
46920
46925
  });
46921
46926
  emit("UI:PLAY_SOUND", { key: "back" });
46922
- }, [emit]);
46927
+ if (removeEvent) emit(`UI:${removeEvent}`, { slotIndex: index });
46928
+ }, [emit, removeEvent]);
46923
46929
  const handleReset = React91.useCallback(() => {
46924
46930
  if (timerRef.current) clearTimeout(timerRef.current);
46925
46931
  setSlots(Array.from({ length: maxSlots }, () => void 0));
@@ -46927,7 +46933,8 @@ function SequencerBoard({
46927
46933
  setCurrentStep(-1);
46928
46934
  setAttempts(0);
46929
46935
  setSlotFeedback(Array.from({ length: maxSlots }, () => null));
46930
- }, [maxSlots]);
46936
+ if (playAgainEvent) emit(`UI:${playAgainEvent}`, {});
46937
+ }, [maxSlots, playAgainEvent, emit]);
46931
46938
  const filledSlots = slots.filter((s) => !!s);
46932
46939
  const canPlay = filledSlots.length > 0 && playState === "idle";
46933
46940
  const handlePlay = React91.useCallback(() => {
@@ -46949,6 +46956,7 @@ function SequencerBoard({
46949
46956
  const success = solutions.some(
46950
46957
  (sol) => sol.length === playerIds.length && sol.every((id, i) => id === playerIds[i])
46951
46958
  );
46959
+ if (checkEvent) emit(`UI:${checkEvent}`, { sequence: playerIds });
46952
46960
  if (success) {
46953
46961
  setPlayState("success");
46954
46962
  setCurrentStep(-1);
@@ -46976,7 +46984,7 @@ function SequencerBoard({
46976
46984
  }
46977
46985
  };
46978
46986
  timerRef.current = setTimeout(advance, stepDurationMs);
46979
- }, [canPlay, slots, maxSlots, solutions, stepDurationMs, playEvent, completeEvent, emit]);
46987
+ }, [canPlay, slots, maxSlots, solutions, stepDurationMs, playEvent, completeEvent, checkEvent, emit]);
46980
46988
  const machine = {
46981
46989
  name: str(resolved?.title),
46982
46990
  description: str(resolved?.description),
package/dist/avl/index.js CHANGED
@@ -46825,6 +46825,10 @@ function SequencerBoard({
46825
46825
  stepDurationMs = 1e3,
46826
46826
  playEvent,
46827
46827
  completeEvent,
46828
+ placeEvent,
46829
+ removeEvent,
46830
+ checkEvent,
46831
+ playAgainEvent,
46828
46832
  className
46829
46833
  }) {
46830
46834
  const { emit } = useEventBus();
@@ -46860,7 +46864,8 @@ function SequencerBoard({
46860
46864
  return next;
46861
46865
  });
46862
46866
  emit("UI:PLAY_SOUND", { key: "drop_slot" });
46863
- }, [emit]);
46867
+ if (placeEvent) emit(`UI:${placeEvent}`, { slotIndex: index, actionId: item.id });
46868
+ }, [emit, placeEvent]);
46864
46869
  const handleSlotRemove = useCallback((index) => {
46865
46870
  setSlots((prev) => {
46866
46871
  const next = [...prev];
@@ -46873,7 +46878,8 @@ function SequencerBoard({
46873
46878
  return next;
46874
46879
  });
46875
46880
  emit("UI:PLAY_SOUND", { key: "back" });
46876
- }, [emit]);
46881
+ if (removeEvent) emit(`UI:${removeEvent}`, { slotIndex: index });
46882
+ }, [emit, removeEvent]);
46877
46883
  const handleReset = useCallback(() => {
46878
46884
  if (timerRef.current) clearTimeout(timerRef.current);
46879
46885
  setSlots(Array.from({ length: maxSlots }, () => void 0));
@@ -46881,7 +46887,8 @@ function SequencerBoard({
46881
46887
  setCurrentStep(-1);
46882
46888
  setAttempts(0);
46883
46889
  setSlotFeedback(Array.from({ length: maxSlots }, () => null));
46884
- }, [maxSlots]);
46890
+ if (playAgainEvent) emit(`UI:${playAgainEvent}`, {});
46891
+ }, [maxSlots, playAgainEvent, emit]);
46885
46892
  const filledSlots = slots.filter((s) => !!s);
46886
46893
  const canPlay = filledSlots.length > 0 && playState === "idle";
46887
46894
  const handlePlay = useCallback(() => {
@@ -46903,6 +46910,7 @@ function SequencerBoard({
46903
46910
  const success = solutions.some(
46904
46911
  (sol) => sol.length === playerIds.length && sol.every((id, i) => id === playerIds[i])
46905
46912
  );
46913
+ if (checkEvent) emit(`UI:${checkEvent}`, { sequence: playerIds });
46906
46914
  if (success) {
46907
46915
  setPlayState("success");
46908
46916
  setCurrentStep(-1);
@@ -46930,7 +46938,7 @@ function SequencerBoard({
46930
46938
  }
46931
46939
  };
46932
46940
  timerRef.current = setTimeout(advance, stepDurationMs);
46933
- }, [canPlay, slots, maxSlots, solutions, stepDurationMs, playEvent, completeEvent, emit]);
46941
+ }, [canPlay, slots, maxSlots, solutions, stepDurationMs, playEvent, completeEvent, checkEvent, emit]);
46934
46942
  const machine = {
46935
46943
  name: str(resolved?.title),
46936
46944
  description: str(resolved?.description),
@@ -14,7 +14,7 @@
14
14
  * @packageDocumentation
15
15
  */
16
16
  import * as React from 'react';
17
- import type { EntityRow } from '@almadar/core';
17
+ import type { EntityRow, EventEmit } from '@almadar/core';
18
18
  import { type BattleBoardProps } from './BattleBoard';
19
19
  import type { IsometricTile, IsometricUnit, IsometricFeature } from './types/isometric';
20
20
  export interface UncontrolledBattleBoardProps extends Omit<BattleBoardProps, 'entity'> {
@@ -27,6 +27,14 @@ export interface UncontrolledBattleBoardProps extends Omit<BattleBoardProps, 'en
27
27
  features?: IsometricFeature[];
28
28
  /** Direct asset manifest — takes priority over entity-derived manifest. */
29
29
  assetManifest?: BattleBoardProps['assetManifest'];
30
+ /** Emits UI:{stepEvent} with { attackerId, targetId, damage } each battle round */
31
+ stepEvent?: EventEmit<{
32
+ attackerId: string;
33
+ targetId: string;
34
+ damage: number;
35
+ }>;
36
+ /** Emits UI:{playAgainEvent} with {} on restart */
37
+ playAgainEvent?: EventEmit<Record<string, never>>;
30
38
  }
31
39
  export declare function UncontrolledBattleBoard({ entity, tiles, units, features, assetManifest, ...rest }: UncontrolledBattleBoardProps): React.JSX.Element | null;
32
40
  export declare namespace UncontrolledBattleBoard {
@@ -42,8 +42,23 @@ export interface SequencerBoardProps extends DisplayStateProps {
42
42
  success: boolean;
43
43
  sequence: string[];
44
44
  }>;
45
+ /** Emits UI:{placeEvent} with { slotIndex, actionId } when an action is dropped into a slot */
46
+ placeEvent?: EventEmit<{
47
+ slotIndex: number;
48
+ actionId: string;
49
+ }>;
50
+ /** Emits UI:{removeEvent} with { slotIndex } when an action is removed from a slot */
51
+ removeEvent?: EventEmit<{
52
+ slotIndex: number;
53
+ }>;
54
+ /** Emits UI:{checkEvent} with { sequence } when the player submits the sequence */
55
+ checkEvent?: EventEmit<{
56
+ sequence: string[];
57
+ }>;
58
+ /** Emits UI:{playAgainEvent} with {} on reset */
59
+ playAgainEvent?: EventEmit<Record<string, never>>;
45
60
  }
46
- export declare function SequencerBoard({ entity, categoryColors, stepDurationMs, playEvent, completeEvent, className, }: SequencerBoardProps): React.JSX.Element | null;
61
+ export declare function SequencerBoard({ entity, categoryColors, stepDurationMs, playEvent, completeEvent, placeEvent, removeEvent, checkEvent, playAgainEvent, className, }: SequencerBoardProps): React.JSX.Element | null;
47
62
  export declare namespace SequencerBoard {
48
63
  var displayName: string;
49
64
  }
@@ -45508,6 +45508,10 @@ function SequencerBoard({
45508
45508
  stepDurationMs = 1e3,
45509
45509
  playEvent,
45510
45510
  completeEvent,
45511
+ placeEvent,
45512
+ removeEvent,
45513
+ checkEvent,
45514
+ playAgainEvent,
45511
45515
  className
45512
45516
  }) {
45513
45517
  const { emit } = useEventBus();
@@ -45543,7 +45547,8 @@ function SequencerBoard({
45543
45547
  return next;
45544
45548
  });
45545
45549
  emit("UI:PLAY_SOUND", { key: "drop_slot" });
45546
- }, [emit]);
45550
+ if (placeEvent) emit(`UI:${placeEvent}`, { slotIndex: index, actionId: item.id });
45551
+ }, [emit, placeEvent]);
45547
45552
  const handleSlotRemove = React77.useCallback((index) => {
45548
45553
  setSlots((prev) => {
45549
45554
  const next = [...prev];
@@ -45556,7 +45561,8 @@ function SequencerBoard({
45556
45561
  return next;
45557
45562
  });
45558
45563
  emit("UI:PLAY_SOUND", { key: "back" });
45559
- }, [emit]);
45564
+ if (removeEvent) emit(`UI:${removeEvent}`, { slotIndex: index });
45565
+ }, [emit, removeEvent]);
45560
45566
  const handleReset = React77.useCallback(() => {
45561
45567
  if (timerRef.current) clearTimeout(timerRef.current);
45562
45568
  setSlots(Array.from({ length: maxSlots }, () => void 0));
@@ -45564,7 +45570,8 @@ function SequencerBoard({
45564
45570
  setCurrentStep(-1);
45565
45571
  setAttempts(0);
45566
45572
  setSlotFeedback(Array.from({ length: maxSlots }, () => null));
45567
- }, [maxSlots]);
45573
+ if (playAgainEvent) emit(`UI:${playAgainEvent}`, {});
45574
+ }, [maxSlots, playAgainEvent, emit]);
45568
45575
  const filledSlots = slots.filter((s) => !!s);
45569
45576
  const canPlay = filledSlots.length > 0 && playState === "idle";
45570
45577
  const handlePlay = React77.useCallback(() => {
@@ -45586,6 +45593,7 @@ function SequencerBoard({
45586
45593
  const success = solutions.some(
45587
45594
  (sol) => sol.length === playerIds.length && sol.every((id, i) => id === playerIds[i])
45588
45595
  );
45596
+ if (checkEvent) emit(`UI:${checkEvent}`, { sequence: playerIds });
45589
45597
  if (success) {
45590
45598
  setPlayState("success");
45591
45599
  setCurrentStep(-1);
@@ -45613,7 +45621,7 @@ function SequencerBoard({
45613
45621
  }
45614
45622
  };
45615
45623
  timerRef.current = setTimeout(advance, stepDurationMs);
45616
- }, [canPlay, slots, maxSlots, solutions, stepDurationMs, playEvent, completeEvent, emit]);
45624
+ }, [canPlay, slots, maxSlots, solutions, stepDurationMs, playEvent, completeEvent, checkEvent, emit]);
45617
45625
  const machine = {
45618
45626
  name: str(resolved?.title),
45619
45627
  description: str(resolved?.description),
@@ -45463,6 +45463,10 @@ function SequencerBoard({
45463
45463
  stepDurationMs = 1e3,
45464
45464
  playEvent,
45465
45465
  completeEvent,
45466
+ placeEvent,
45467
+ removeEvent,
45468
+ checkEvent,
45469
+ playAgainEvent,
45466
45470
  className
45467
45471
  }) {
45468
45472
  const { emit } = useEventBus();
@@ -45498,7 +45502,8 @@ function SequencerBoard({
45498
45502
  return next;
45499
45503
  });
45500
45504
  emit("UI:PLAY_SOUND", { key: "drop_slot" });
45501
- }, [emit]);
45505
+ if (placeEvent) emit(`UI:${placeEvent}`, { slotIndex: index, actionId: item.id });
45506
+ }, [emit, placeEvent]);
45502
45507
  const handleSlotRemove = useCallback((index) => {
45503
45508
  setSlots((prev) => {
45504
45509
  const next = [...prev];
@@ -45511,7 +45516,8 @@ function SequencerBoard({
45511
45516
  return next;
45512
45517
  });
45513
45518
  emit("UI:PLAY_SOUND", { key: "back" });
45514
- }, [emit]);
45519
+ if (removeEvent) emit(`UI:${removeEvent}`, { slotIndex: index });
45520
+ }, [emit, removeEvent]);
45515
45521
  const handleReset = useCallback(() => {
45516
45522
  if (timerRef.current) clearTimeout(timerRef.current);
45517
45523
  setSlots(Array.from({ length: maxSlots }, () => void 0));
@@ -45519,7 +45525,8 @@ function SequencerBoard({
45519
45525
  setCurrentStep(-1);
45520
45526
  setAttempts(0);
45521
45527
  setSlotFeedback(Array.from({ length: maxSlots }, () => null));
45522
- }, [maxSlots]);
45528
+ if (playAgainEvent) emit(`UI:${playAgainEvent}`, {});
45529
+ }, [maxSlots, playAgainEvent, emit]);
45523
45530
  const filledSlots = slots.filter((s) => !!s);
45524
45531
  const canPlay = filledSlots.length > 0 && playState === "idle";
45525
45532
  const handlePlay = useCallback(() => {
@@ -45541,6 +45548,7 @@ function SequencerBoard({
45541
45548
  const success = solutions.some(
45542
45549
  (sol) => sol.length === playerIds.length && sol.every((id, i) => id === playerIds[i])
45543
45550
  );
45551
+ if (checkEvent) emit(`UI:${checkEvent}`, { sequence: playerIds });
45544
45552
  if (success) {
45545
45553
  setPlayState("success");
45546
45554
  setCurrentStep(-1);
@@ -45568,7 +45576,7 @@ function SequencerBoard({
45568
45576
  }
45569
45577
  };
45570
45578
  timerRef.current = setTimeout(advance, stepDurationMs);
45571
- }, [canPlay, slots, maxSlots, solutions, stepDurationMs, playEvent, completeEvent, emit]);
45579
+ }, [canPlay, slots, maxSlots, solutions, stepDurationMs, playEvent, completeEvent, checkEvent, emit]);
45572
45580
  const machine = {
45573
45581
  name: str(resolved?.title),
45574
45582
  description: str(resolved?.description),
@@ -44784,6 +44784,10 @@ function SequencerBoard({
44784
44784
  stepDurationMs = 1e3,
44785
44785
  playEvent,
44786
44786
  completeEvent,
44787
+ placeEvent,
44788
+ removeEvent,
44789
+ checkEvent,
44790
+ playAgainEvent,
44787
44791
  className
44788
44792
  }) {
44789
44793
  const { emit } = useEventBus();
@@ -44819,7 +44823,8 @@ function SequencerBoard({
44819
44823
  return next;
44820
44824
  });
44821
44825
  emit("UI:PLAY_SOUND", { key: "drop_slot" });
44822
- }, [emit]);
44826
+ if (placeEvent) emit(`UI:${placeEvent}`, { slotIndex: index, actionId: item.id });
44827
+ }, [emit, placeEvent]);
44823
44828
  const handleSlotRemove = React83.useCallback((index) => {
44824
44829
  setSlots((prev) => {
44825
44830
  const next = [...prev];
@@ -44832,7 +44837,8 @@ function SequencerBoard({
44832
44837
  return next;
44833
44838
  });
44834
44839
  emit("UI:PLAY_SOUND", { key: "back" });
44835
- }, [emit]);
44840
+ if (removeEvent) emit(`UI:${removeEvent}`, { slotIndex: index });
44841
+ }, [emit, removeEvent]);
44836
44842
  const handleReset = React83.useCallback(() => {
44837
44843
  if (timerRef.current) clearTimeout(timerRef.current);
44838
44844
  setSlots(Array.from({ length: maxSlots }, () => void 0));
@@ -44840,7 +44846,8 @@ function SequencerBoard({
44840
44846
  setCurrentStep(-1);
44841
44847
  setAttempts(0);
44842
44848
  setSlotFeedback(Array.from({ length: maxSlots }, () => null));
44843
- }, [maxSlots]);
44849
+ if (playAgainEvent) emit(`UI:${playAgainEvent}`, {});
44850
+ }, [maxSlots, playAgainEvent, emit]);
44844
44851
  const filledSlots = slots.filter((s) => !!s);
44845
44852
  const canPlay = filledSlots.length > 0 && playState === "idle";
44846
44853
  const handlePlay = React83.useCallback(() => {
@@ -44862,6 +44869,7 @@ function SequencerBoard({
44862
44869
  const success = solutions.some(
44863
44870
  (sol) => sol.length === playerIds.length && sol.every((id, i) => id === playerIds[i])
44864
44871
  );
44872
+ if (checkEvent) emit(`UI:${checkEvent}`, { sequence: playerIds });
44865
44873
  if (success) {
44866
44874
  setPlayState("success");
44867
44875
  setCurrentStep(-1);
@@ -44889,7 +44897,7 @@ function SequencerBoard({
44889
44897
  }
44890
44898
  };
44891
44899
  timerRef.current = setTimeout(advance, stepDurationMs);
44892
- }, [canPlay, slots, maxSlots, solutions, stepDurationMs, playEvent, completeEvent, emit]);
44900
+ }, [canPlay, slots, maxSlots, solutions, stepDurationMs, playEvent, completeEvent, checkEvent, emit]);
44893
44901
  const machine = {
44894
44902
  name: str(resolved?.title),
44895
44903
  description: str(resolved?.description),
@@ -44738,6 +44738,10 @@ function SequencerBoard({
44738
44738
  stepDurationMs = 1e3,
44739
44739
  playEvent,
44740
44740
  completeEvent,
44741
+ placeEvent,
44742
+ removeEvent,
44743
+ checkEvent,
44744
+ playAgainEvent,
44741
44745
  className
44742
44746
  }) {
44743
44747
  const { emit } = useEventBus();
@@ -44773,7 +44777,8 @@ function SequencerBoard({
44773
44777
  return next;
44774
44778
  });
44775
44779
  emit("UI:PLAY_SOUND", { key: "drop_slot" });
44776
- }, [emit]);
44780
+ if (placeEvent) emit(`UI:${placeEvent}`, { slotIndex: index, actionId: item.id });
44781
+ }, [emit, placeEvent]);
44777
44782
  const handleSlotRemove = useCallback((index) => {
44778
44783
  setSlots((prev) => {
44779
44784
  const next = [...prev];
@@ -44786,7 +44791,8 @@ function SequencerBoard({
44786
44791
  return next;
44787
44792
  });
44788
44793
  emit("UI:PLAY_SOUND", { key: "back" });
44789
- }, [emit]);
44794
+ if (removeEvent) emit(`UI:${removeEvent}`, { slotIndex: index });
44795
+ }, [emit, removeEvent]);
44790
44796
  const handleReset = useCallback(() => {
44791
44797
  if (timerRef.current) clearTimeout(timerRef.current);
44792
44798
  setSlots(Array.from({ length: maxSlots }, () => void 0));
@@ -44794,7 +44800,8 @@ function SequencerBoard({
44794
44800
  setCurrentStep(-1);
44795
44801
  setAttempts(0);
44796
44802
  setSlotFeedback(Array.from({ length: maxSlots }, () => null));
44797
- }, [maxSlots]);
44803
+ if (playAgainEvent) emit(`UI:${playAgainEvent}`, {});
44804
+ }, [maxSlots, playAgainEvent, emit]);
44798
44805
  const filledSlots = slots.filter((s) => !!s);
44799
44806
  const canPlay = filledSlots.length > 0 && playState === "idle";
44800
44807
  const handlePlay = useCallback(() => {
@@ -44816,6 +44823,7 @@ function SequencerBoard({
44816
44823
  const success = solutions.some(
44817
44824
  (sol) => sol.length === playerIds.length && sol.every((id, i) => id === playerIds[i])
44818
44825
  );
44826
+ if (checkEvent) emit(`UI:${checkEvent}`, { sequence: playerIds });
44819
44827
  if (success) {
44820
44828
  setPlayState("success");
44821
44829
  setCurrentStep(-1);
@@ -44843,7 +44851,7 @@ function SequencerBoard({
44843
44851
  }
44844
44852
  };
44845
44853
  timerRef.current = setTimeout(advance, stepDurationMs);
44846
- }, [canPlay, slots, maxSlots, solutions, stepDurationMs, playEvent, completeEvent, emit]);
44854
+ }, [canPlay, slots, maxSlots, solutions, stepDurationMs, playEvent, completeEvent, checkEvent, emit]);
44847
44855
  const machine = {
44848
44856
  name: str(resolved?.title),
44849
44857
  description: str(resolved?.description),
@@ -44370,6 +44370,10 @@ function SequencerBoard({
44370
44370
  stepDurationMs = 1e3,
44371
44371
  playEvent,
44372
44372
  completeEvent,
44373
+ placeEvent,
44374
+ removeEvent,
44375
+ checkEvent,
44376
+ playAgainEvent,
44373
44377
  className
44374
44378
  }) {
44375
44379
  const { emit } = useEventBus();
@@ -44405,7 +44409,8 @@ function SequencerBoard({
44405
44409
  return next;
44406
44410
  });
44407
44411
  emit("UI:PLAY_SOUND", { key: "drop_slot" });
44408
- }, [emit]);
44412
+ if (placeEvent) emit(`UI:${placeEvent}`, { slotIndex: index, actionId: item.id });
44413
+ }, [emit, placeEvent]);
44409
44414
  const handleSlotRemove = React82.useCallback((index) => {
44410
44415
  setSlots((prev) => {
44411
44416
  const next = [...prev];
@@ -44418,7 +44423,8 @@ function SequencerBoard({
44418
44423
  return next;
44419
44424
  });
44420
44425
  emit("UI:PLAY_SOUND", { key: "back" });
44421
- }, [emit]);
44426
+ if (removeEvent) emit(`UI:${removeEvent}`, { slotIndex: index });
44427
+ }, [emit, removeEvent]);
44422
44428
  const handleReset = React82.useCallback(() => {
44423
44429
  if (timerRef.current) clearTimeout(timerRef.current);
44424
44430
  setSlots(Array.from({ length: maxSlots }, () => void 0));
@@ -44426,7 +44432,8 @@ function SequencerBoard({
44426
44432
  setCurrentStep(-1);
44427
44433
  setAttempts(0);
44428
44434
  setSlotFeedback(Array.from({ length: maxSlots }, () => null));
44429
- }, [maxSlots]);
44435
+ if (playAgainEvent) emit(`UI:${playAgainEvent}`, {});
44436
+ }, [maxSlots, playAgainEvent, emit]);
44430
44437
  const filledSlots = slots.filter((s) => !!s);
44431
44438
  const canPlay = filledSlots.length > 0 && playState === "idle";
44432
44439
  const handlePlay = React82.useCallback(() => {
@@ -44448,6 +44455,7 @@ function SequencerBoard({
44448
44455
  const success = solutions.some(
44449
44456
  (sol) => sol.length === playerIds.length && sol.every((id, i) => id === playerIds[i])
44450
44457
  );
44458
+ if (checkEvent) emit(`UI:${checkEvent}`, { sequence: playerIds });
44451
44459
  if (success) {
44452
44460
  setPlayState("success");
44453
44461
  setCurrentStep(-1);
@@ -44475,7 +44483,7 @@ function SequencerBoard({
44475
44483
  }
44476
44484
  };
44477
44485
  timerRef.current = setTimeout(advance, stepDurationMs);
44478
- }, [canPlay, slots, maxSlots, solutions, stepDurationMs, playEvent, completeEvent, emit]);
44486
+ }, [canPlay, slots, maxSlots, solutions, stepDurationMs, playEvent, completeEvent, checkEvent, emit]);
44479
44487
  const machine = {
44480
44488
  name: str(resolved?.title),
44481
44489
  description: str(resolved?.description),
@@ -44324,6 +44324,10 @@ function SequencerBoard({
44324
44324
  stepDurationMs = 1e3,
44325
44325
  playEvent,
44326
44326
  completeEvent,
44327
+ placeEvent,
44328
+ removeEvent,
44329
+ checkEvent,
44330
+ playAgainEvent,
44327
44331
  className
44328
44332
  }) {
44329
44333
  const { emit } = useEventBus();
@@ -44359,7 +44363,8 @@ function SequencerBoard({
44359
44363
  return next;
44360
44364
  });
44361
44365
  emit("UI:PLAY_SOUND", { key: "drop_slot" });
44362
- }, [emit]);
44366
+ if (placeEvent) emit(`UI:${placeEvent}`, { slotIndex: index, actionId: item.id });
44367
+ }, [emit, placeEvent]);
44363
44368
  const handleSlotRemove = useCallback((index) => {
44364
44369
  setSlots((prev) => {
44365
44370
  const next = [...prev];
@@ -44372,7 +44377,8 @@ function SequencerBoard({
44372
44377
  return next;
44373
44378
  });
44374
44379
  emit("UI:PLAY_SOUND", { key: "back" });
44375
- }, [emit]);
44380
+ if (removeEvent) emit(`UI:${removeEvent}`, { slotIndex: index });
44381
+ }, [emit, removeEvent]);
44376
44382
  const handleReset = useCallback(() => {
44377
44383
  if (timerRef.current) clearTimeout(timerRef.current);
44378
44384
  setSlots(Array.from({ length: maxSlots }, () => void 0));
@@ -44380,7 +44386,8 @@ function SequencerBoard({
44380
44386
  setCurrentStep(-1);
44381
44387
  setAttempts(0);
44382
44388
  setSlotFeedback(Array.from({ length: maxSlots }, () => null));
44383
- }, [maxSlots]);
44389
+ if (playAgainEvent) emit(`UI:${playAgainEvent}`, {});
44390
+ }, [maxSlots, playAgainEvent, emit]);
44384
44391
  const filledSlots = slots.filter((s) => !!s);
44385
44392
  const canPlay = filledSlots.length > 0 && playState === "idle";
44386
44393
  const handlePlay = useCallback(() => {
@@ -44402,6 +44409,7 @@ function SequencerBoard({
44402
44409
  const success = solutions.some(
44403
44410
  (sol) => sol.length === playerIds.length && sol.every((id, i) => id === playerIds[i])
44404
44411
  );
44412
+ if (checkEvent) emit(`UI:${checkEvent}`, { sequence: playerIds });
44405
44413
  if (success) {
44406
44414
  setPlayState("success");
44407
44415
  setCurrentStep(-1);
@@ -44429,7 +44437,7 @@ function SequencerBoard({
44429
44437
  }
44430
44438
  };
44431
44439
  timerRef.current = setTimeout(advance, stepDurationMs);
44432
- }, [canPlay, slots, maxSlots, solutions, stepDurationMs, playEvent, completeEvent, emit]);
44440
+ }, [canPlay, slots, maxSlots, solutions, stepDurationMs, playEvent, completeEvent, checkEvent, emit]);
44433
44441
  const machine = {
44434
44442
  name: str(resolved?.title),
44435
44443
  description: str(resolved?.description),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@almadar/ui",
3
- "version": "5.41.0",
3
+ "version": "5.42.0",
4
4
  "description": "React UI components, hooks, and providers for Almadar",
5
5
  "type": "module",
6
6
  "sideEffects": [