@epam/ai-dial-celebrations 1.2.0-dev.260 → 1.2.0-dev.262

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.
@@ -0,0 +1,8 @@
1
+ import { LottieSceneSessionResult, UseLottieSceneSessionOptions } from '../models/lottie-scene';
2
+ /**
3
+ * Runs one Lottie session per scene activation, so a StrictMode rehearsal
4
+ * never imports the player twice, and a cancelled scene never reappears as
5
+ * its static fallback.
6
+ */
7
+ export declare const useLottieSceneSession: <P>({ enabled, playback, prepare, }: UseLottieSceneSessionOptions<P>) => LottieSceneSessionResult<P>;
8
+ //# sourceMappingURL=useLottieSceneSession.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useLottieSceneSession.d.ts","sourceRoot":"","sources":["../../src/hooks/useLottieSceneSession.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAEV,wBAAwB,EACxB,4BAA4B,EAC7B,MAAM,wBAAwB,CAAC;AAIhC;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,GAAI,CAAC,EAAE,iCAItC,4BAA4B,CAAC,CAAC,CAAC,KAAG,wBAAwB,CAAC,CAAC,CA2D9D,CAAC"}
@@ -0,0 +1,81 @@
1
+ import { RefObject } from 'react';
2
+ import { LottieDataOwnership, LottieSceneOutcome, LottieScenePhase, LottieSceneSessionState } from '../types/lottie-scene';
3
+ import { LottiePlayer } from '../utils/lottie-player';
4
+ /** The three sequential waits of one playback, in milliseconds. */
5
+ export interface LottieSceneTimings {
6
+ /** Time allowed for the player import. */
7
+ loadTimeoutMs: number;
8
+ /** Time from renderer creation to readiness. */
9
+ readyTimeoutMs: number;
10
+ /** Story length, counted from readiness. */
11
+ playbackMs: number;
12
+ }
13
+ /** What a scene adapter receives once its renderer exists. */
14
+ export interface LottieAnimationContext<P> {
15
+ /** The scene's measured and composed preparation. */
16
+ preparation: P;
17
+ /** The element the renderer draws into. */
18
+ host: HTMLElement;
19
+ /** Registers a cleanup that runs once when the session ends. */
20
+ addDisposer: (dispose: () => void) => void;
21
+ /** Ends the session as cancelled. */
22
+ cancel: () => void;
23
+ }
24
+ /** A scene's fixed contribution to its Lottie session. */
25
+ export interface LottieScenePlayback<P> {
26
+ /** Deadlines of the session. */
27
+ timings: LottieSceneTimings;
28
+ /** Whether the animation data is single-use or must be cloned per playback. */
29
+ ownership: LottieDataOwnership;
30
+ /** Returns the Lottie JSON of a preparation. */
31
+ getAnimationData: (preparation: P) => object;
32
+ /** Installs scene observers once the renderer exists. */
33
+ onAnimationCreated?: (context: LottieAnimationContext<P>) => void;
34
+ }
35
+ /** Inputs of one Lottie scene session. */
36
+ export interface LottieSceneSessionOptions<P> {
37
+ /** The scene's timings, data ownership and observers. */
38
+ playback: LottieScenePlayback<P>;
39
+ /** Measures targets and builds the composition after the player loads. */
40
+ prepare: (player: LottiePlayer) => P;
41
+ /** Receives the preparation so the host element can render. */
42
+ onPrepared: (preparation: P) => void;
43
+ /** Receives the outcome once, unless the session was disposed. */
44
+ onTerminal: (outcome: LottieSceneOutcome) => void;
45
+ /** Loads the player. Defaults to `loadLottiePlayer`. */
46
+ loadPlayer?: () => Promise<LottiePlayer>;
47
+ }
48
+ /** One activation's player import, readiness, playback and teardown. */
49
+ export interface LottieSceneSession {
50
+ /** The current lifecycle state. */
51
+ readonly state: LottieSceneSessionState;
52
+ /** Starts the player import after one microtask. */
53
+ start: () => void;
54
+ /** Creates the renderer in `host` when the session is prepared. */
55
+ attach: (host: HTMLElement) => void;
56
+ /** Ends the session as cancelled and reports it. */
57
+ cancel: () => void;
58
+ /** Ends the session as cancelled without reporting it. */
59
+ dispose: () => void;
60
+ }
61
+ /** Inputs of `useLottieSceneSession`. */
62
+ export interface UseLottieSceneSessionOptions<P> {
63
+ /** Whether a session may run; false never loads the player. */
64
+ enabled: boolean;
65
+ /** The scene's timings, data ownership and observers. */
66
+ playback: LottieScenePlayback<P>;
67
+ /** Measures targets and builds the composition after the player loads. */
68
+ prepare: (player: LottiePlayer) => P;
69
+ }
70
+ /** State and controls a scene component renders from. */
71
+ export interface LottieSceneSessionResult<P> {
72
+ /** What the scene renders. */
73
+ phase: LottieScenePhase;
74
+ /** The current session's preparation, once available. */
75
+ preparation: P | null;
76
+ /** Ref for the element the renderer draws into. */
77
+ hostRef: RefObject<HTMLDivElement | null>;
78
+ /** Ends the scene; stable across renders. */
79
+ cancel: () => void;
80
+ }
81
+ //# sourceMappingURL=lottie-scene.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lottie-scene.d.ts","sourceRoot":"","sources":["../../src/models/lottie-scene.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EACV,mBAAmB,EACnB,kBAAkB,EAClB,gBAAgB,EAChB,uBAAuB,EACxB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAE3D,mEAAmE;AACnE,MAAM,WAAW,kBAAkB;IACjC,0CAA0C;IAC1C,aAAa,EAAE,MAAM,CAAC;IACtB,gDAAgD;IAChD,cAAc,EAAE,MAAM,CAAC;IACvB,4CAA4C;IAC5C,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,8DAA8D;AAC9D,MAAM,WAAW,sBAAsB,CAAC,CAAC;IACvC,qDAAqD;IACrD,WAAW,EAAE,CAAC,CAAC;IACf,2CAA2C;IAC3C,IAAI,EAAE,WAAW,CAAC;IAClB,gEAAgE;IAChE,WAAW,EAAE,CAAC,OAAO,EAAE,MAAM,IAAI,KAAK,IAAI,CAAC;IAC3C,qCAAqC;IACrC,MAAM,EAAE,MAAM,IAAI,CAAC;CACpB;AAED,0DAA0D;AAC1D,MAAM,WAAW,mBAAmB,CAAC,CAAC;IACpC,gCAAgC;IAChC,OAAO,EAAE,kBAAkB,CAAC;IAC5B,+EAA+E;IAC/E,SAAS,EAAE,mBAAmB,CAAC;IAC/B,gDAAgD;IAChD,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zC,8BAA8B;IAC9B,KAAK,EAAE,gBAAgB,CAAC;IACxB,yDAAyD;IACzD,WAAW,EAAE,CAAC,GAAG,IAAI,CAAC;IACtB,mDAAmD;IACnD,OAAO,EAAE,SAAS,CAAC,cAAc,GAAG,IAAI,CAAC,CAAC;IAC1C,6CAA6C;IAC7C,MAAM,EAAE,MAAM,IAAI,CAAC;CACpB"}
@@ -1 +1 @@
1
- {"version":3,"file":"NewYearGiftWrapping.d.ts","sourceRoot":"","sources":["../../../../src/new-year/components/NewYearGiftWrapping/NewYearGiftWrapping.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA+B,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAoB7D,yEAAyE;AACzE,QAAA,MAAM,mBAAmB,EAAE,EAyJ1B,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
1
+ {"version":3,"file":"NewYearGiftWrapping.d.ts","sourceRoot":"","sources":["../../../../src/new-year/components/NewYearGiftWrapping/NewYearGiftWrapping.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAuB,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAUrD,yEAAyE;AACzE,QAAA,MAAM,mBAAmB,EAAE,EA0F1B,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
@@ -1,5 +1,7 @@
1
+ import { LottieScenePlayback, LottieSceneTimings } from '../../models/lottie-scene';
1
2
  import { GiftWrappingComposition } from './gift-wrapping-composition';
2
- import { LottiePlayer } from './gift-wrapping-player';
3
- /** Plays the prepared scene and releases every resource on interruption. */
4
- export declare const animateGiftWrapping: (plan: GiftWrappingComposition, host: HTMLElement, player: LottiePlayer, onStop: (failed: boolean) => void) => (() => void);
3
+ /** Load, readiness and playback deadlines of the scene; the provider lifetime adds a 2500 ms exit allowance. */
4
+ export declare const GIFT_WRAPPING_TIMINGS: LottieSceneTimings;
5
+ /** The scene's contribution to its Lottie session: timings, single-use data and composer observers. */
6
+ export declare const GIFT_WRAPPING_PLAYBACK: LottieScenePlayback<GiftWrappingComposition>;
5
7
  //# sourceMappingURL=gift-wrapping-animation.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"gift-wrapping-animation.d.ts","sourceRoot":"","sources":["../../../src/new-year/utils/gift-wrapping-animation.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,KAAK,uBAAuB,EAC7B,MAAM,6BAA6B,CAAC;AACrC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAE3D,4EAA4E;AAC5E,eAAO,MAAM,mBAAmB,GAC9B,MAAM,uBAAuB,EAC7B,MAAM,WAAW,EACjB,QAAQ,YAAY,EACpB,QAAQ,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,KAChC,CAAC,MAAM,IAAI,CAqIb,CAAC"}
1
+ {"version":3,"file":"gift-wrapping-animation.d.ts","sourceRoot":"","sources":["../../../src/new-year/utils/gift-wrapping-animation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,mBAAmB,EACnB,kBAAkB,EACnB,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EAEL,KAAK,uBAAuB,EAC7B,MAAM,6BAA6B,CAAC;AAErC,gHAAgH;AAChH,eAAO,MAAM,qBAAqB,EAAE,kBAInC,CAAC;AA2EF,uGAAuG;AACvG,eAAO,MAAM,sBAAsB,EAAE,mBAAmB,CAAC,uBAAuB,CAM7E,CAAC"}
@@ -1,4 +1,4 @@
1
- import { LottiePlayer } from './gift-wrapping-player';
1
+ import { LottiePlayer } from '../../utils/lottie-player';
2
2
  import { PenguinStarComposition } from './penguin-star-composition';
3
3
  /** Play the scene and release its resources on completion or interruption. */
4
4
  export declare const animatePenguinStar: (plan: PenguinStarComposition, host: HTMLElement, player: LottiePlayer, onStop: (failed: boolean) => void) => (() => void);
@@ -1 +1 @@
1
- {"version":3,"file":"penguin-star-animation.d.ts","sourceRoot":"","sources":["../../../src/new-year/utils/penguin-star-animation.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAEL,KAAK,sBAAsB,EAC5B,MAAM,4BAA4B,CAAC;AAGpC,8EAA8E;AAC9E,eAAO,MAAM,kBAAkB,GAC7B,MAAM,sBAAsB,EAC5B,MAAM,WAAW,EACjB,QAAQ,YAAY,EACpB,QAAQ,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,KAChC,CAAC,MAAM,IAAI,CAqKb,CAAC"}
1
+ {"version":3,"file":"penguin-star-animation.d.ts","sourceRoot":"","sources":["../../../src/new-year/utils/penguin-star-animation.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,KAAK,YAAY,EAClB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAEL,KAAK,sBAAsB,EAC5B,MAAM,4BAA4B,CAAC;AAGpC,8EAA8E;AAC9E,eAAO,MAAM,kBAAkB,GAC7B,MAAM,sBAAsB,EAC5B,MAAM,WAAW,EACjB,QAAQ,YAAY,EACpB,QAAQ,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,KAChC,CAAC,MAAM,IAAI,CAyJb,CAAC"}