narraleaf-react 1.1.0 → 1.1.1

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.
@@ -20,6 +20,16 @@ export declare class VideoAction<T extends Values<typeof VideoActionTypes> = Val
20
20
  readonly seek: "video:seek";
21
21
  };
22
22
  executeAction(gameState: GameState, injection: ActionExecutionInjection): Awaitable<CalledActionResult>;
23
+ /**
24
+ * A transport row - pause, resume, seek, stop - aimed at a clip that is no longer on the stage.
25
+ *
26
+ * There is nothing to talk to, and nothing it could have done: a clip that has left has stopped,
27
+ * and the next show puts it back from the start. Which side of the clip leaving such a row lands
28
+ * on is not always the author's to decide - a clip played without waiting for it leaves when it
29
+ * ends, at a moment set by how fast the player reads - so a row that would have worked a click
30
+ * earlier must not stop the story a click later. The same answer `hide` gives.
31
+ */
32
+ private skipOffStage;
23
33
  private changeStateBase;
24
34
  /**
25
35
  * {@link changeStateBase} for a fade, which the player can walk away from halfway.
@@ -133,6 +133,14 @@ export type PlayerStateData = {
133
133
  * { [layerName]: [displayableId][] }
134
134
  */
135
135
  layers: Record<string, string[]>;
136
+ /**
137
+ * The ids of the clips this scene put on the stage. Their state is in
138
+ * {@link PlayerStateData.videos}; this says which scene each one leaves with.
139
+ *
140
+ * Written only when the scene has any. Absent in saves written before clips belonged to
141
+ * scenes, and a clip no scene names is given to the scene the story is running in.
142
+ */
143
+ videos?: string[];
136
144
  };
137
145
  }[];
138
146
  audio: AudioManagerDataRaw;
@@ -156,6 +164,14 @@ export type PlayerStateElementSnapshot = {
156
164
  * scene that is on the stage and one that is on the stage waiting for a call to return.
157
165
  */
158
166
  suspended?: boolean;
167
+ /**
168
+ * The clips this scene had on the stage, each with its state, in stage order.
169
+ *
170
+ * A clip is drawn over the scene rather than inside one of its layers, but it belongs to the
171
+ * scene that put it there all the same, and leaves with it. Absent in snapshots taken before
172
+ * clips belonged to scenes; read as none.
173
+ */
174
+ videos?: [Video, VideoStateRaw][];
159
175
  };
160
176
  export type PlayerAction = CalledActionResult;
161
177
  interface StageUtils {
@@ -210,6 +226,16 @@ export declare class GameState {
210
226
  * See {@link VideoWarmQueue}.
211
227
  */
212
228
  private readonly videoWarmQueue;
229
+ /**
230
+ * Which scene each of the story's clips belongs to: the one running when the clip went on.
231
+ *
232
+ * A clip is not on one of the scene's layers - it is a sibling of the scene's root, so that a clip
233
+ * the preloader warmed can be taken over without being remounted - so nothing about where it sits
234
+ * says whose it is. And it has to be somebody's, because a scene takes everything it put on the
235
+ * stage with it when it leaves. Kept beside {@link PlayerState.videos} rather than in it, because
236
+ * the stage order of clips is not grouped by scene.
237
+ */
238
+ private videoOwners;
213
239
  private videoMissingReporter;
214
240
  /** Sources already reported as unwarmed, so one clip in a loop does not report every pass. */
215
241
  private readonly reportedUnwarmedVideos;
@@ -547,6 +573,21 @@ export declare class GameState {
547
573
  * excluded explicitly rather than by trusting that route to stay closed.
548
574
  */
549
575
  private resetLayers;
576
+ /**
577
+ * The clip half of leaving a scene: every clip the scene put on the stage leaves with it, and
578
+ * goes back to its authored state, exactly as the sprites on its layers do in
579
+ * {@link resetLayers}.
580
+ *
581
+ * Without this a clip outlived its scene, and since a clip paints over its scene's sprites, one
582
+ * that stopped on its last frame covered the whole of the next scene - where nothing could take it
583
+ * down, because a host that names stage objects per scene cannot even name it.
584
+ *
585
+ * Every path that takes a scene off the stage comes through here - a plain jump's exit, a call
586
+ * returning, a jump giving up the callers parked behind it, stepping back over a scene's entrance
587
+ * - and each of them snapshots the scene first (see {@link createElementSnapshot}), so the clips
588
+ * come back with it when the step is undone.
589
+ */
590
+ private releaseVideosOf;
550
591
  private syncNvlDerivedState;
551
592
  private emitNvlStateChange;
552
593
  private resolveNvlAdvance;