@patterkit/model 0.11.0 → 0.13.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.
package/dist/index.cjs CHANGED
@@ -26,11 +26,14 @@ __export(index_exports, {
26
26
  DEFAULT_CAPTION_DELIMITERS: () => DEFAULT_CAPTION_DELIMITERS,
27
27
  DEFAULT_DOCUMENTATION_CLASSES: () => DEFAULT_DOCUMENTATION_CLASSES,
28
28
  DEFAULT_LAYOUT: () => DEFAULT_LAYOUT,
29
+ DEFAULT_PAD_AFTER: () => DEFAULT_PAD_AFTER,
29
30
  DEFAULT_QUALIFIERS: () => DEFAULT_QUALIFIERS,
30
31
  DEFAULT_RECORDING_STATUSES: () => DEFAULT_RECORDING_STATUSES,
31
32
  DEFAULT_WRITING_STATUSES: () => DEFAULT_WRITING_STATUSES,
32
33
  FLOW_SCHEMA: () => FLOW_SCHEMA,
33
34
  HANDOFF_SCHEMA: () => HANDOFF_SCHEMA,
35
+ PAD_AFTER_MAX: () => PAD_AFTER_MAX,
36
+ PAD_AFTER_MIN: () => PAD_AFTER_MIN,
34
37
  PROJECT_LOCALE_SCENE: () => PROJECT_LOCALE_SCENE,
35
38
  PROJECT_SCHEMA: () => PROJECT_SCHEMA,
36
39
  RERECORD_STATUS: () => RERECORD_STATUS,
@@ -104,6 +107,9 @@ function usedQualifiers(project, scenes) {
104
107
  }
105
108
  return projectQualifiers(project).filter((q) => used.has(q.gameId));
106
109
  }
110
+ var DEFAULT_PAD_AFTER = 0.6;
111
+ var PAD_AFTER_MIN = -10;
112
+ var PAD_AFTER_MAX = 60;
107
113
  var DEFAULT_WRITING_STATUSES = [
108
114
  { name: "stub", colour: 0 },
109
115
  // red
@@ -173,11 +179,14 @@ var AUTHORING_SCHEMA = "patter/authoring@0";
173
179
  DEFAULT_CAPTION_DELIMITERS,
174
180
  DEFAULT_DOCUMENTATION_CLASSES,
175
181
  DEFAULT_LAYOUT,
182
+ DEFAULT_PAD_AFTER,
176
183
  DEFAULT_QUALIFIERS,
177
184
  DEFAULT_RECORDING_STATUSES,
178
185
  DEFAULT_WRITING_STATUSES,
179
186
  FLOW_SCHEMA,
180
187
  HANDOFF_SCHEMA,
188
+ PAD_AFTER_MAX,
189
+ PAD_AFTER_MIN,
181
190
  PROJECT_LOCALE_SCENE,
182
191
  PROJECT_SCHEMA,
183
192
  RERECORD_STATUS,
package/dist/index.d.cts CHANGED
@@ -27,6 +27,11 @@ interface LineBeat {
27
27
  * how the line is delivered (`TAM (O.S.)`), not who says it. Absent = none. The speaker is still
28
28
  * `character` for every authoring and reporting purpose. See `SpeakerQualifier`. */
29
29
  qualifier?: string;
30
+ /** The pause after this beat, before the next, in seconds (`padAfter`, design/proposals/line-padding.md):
31
+ * positive waits, zero follows at once, negative starts the next line that long before this one ends (a
32
+ * cut-in). Absent = the nearest `padAfterDefault` above it, else the project's, else `DEFAULT_PAD_AFTER`.
33
+ * Never negative on a snippet's last line or text beat: the runtime clamps it to zero there. */
34
+ padAfter?: number;
30
35
  gameData?: GameData;
31
36
  /** Author-defined freeform tags (#215): a cross-cutting label layer that travels to the runtime.
32
37
  * At runtime a beat's tags are the UNION of its own and every ancestor's (scene → block → group(s) →
@@ -42,6 +47,11 @@ interface LineBeat {
42
47
  interface TextBeat {
43
48
  id: string;
44
49
  kind: "text";
50
+ /** The pause after this beat, before the next, in seconds (`padAfter`, design/proposals/line-padding.md):
51
+ * positive waits, zero follows at once, negative starts the next line that long before this one ends (a
52
+ * cut-in). Absent = the nearest `padAfterDefault` above it, else the project's, else `DEFAULT_PAD_AFTER`.
53
+ * Never negative on a snippet's last line or text beat: the runtime clamps it to zero there. */
54
+ padAfter?: number;
45
55
  gameData?: GameData;
46
56
  /** Author tags (#215). See LineBeat.tags. */
47
57
  tags?: string[];
@@ -89,6 +99,9 @@ interface Snippet {
89
99
  beats?: Beat[];
90
100
  onEnter?: Effect[];
91
101
  onExit?: Effect[];
102
+ /** The default `padAfter` for the line and text beats inside it that set none (the nearest default wins:
103
+ * snippet, then each group, innermost first, then block, then scene, then the project). */
104
+ padAfterDefault?: number;
92
105
  gameData?: GameData;
93
106
  /** Author tags (#215). See LineBeat.tags. */
94
107
  tags?: string[];
@@ -123,6 +136,9 @@ interface Group {
123
136
  /** `sequence` config (order × exhaust, spec §4). */
124
137
  options?: SequenceOptions;
125
138
  children: Array<Group | Snippet>;
139
+ /** The default `padAfter` for the line and text beats inside it that set none (the nearest default wins:
140
+ * snippet, then each group, innermost first, then block, then scene, then the project). */
141
+ padAfterDefault?: number;
126
142
  gameData?: GameData;
127
143
  /** Author tags (#215). See LineBeat.tags. */
128
144
  tags?: string[];
@@ -153,6 +169,9 @@ interface Block {
153
169
  */
154
170
  gameId?: string;
155
171
  children: Array<Group | Snippet>;
172
+ /** The default `padAfter` for the line and text beats inside it that set none (the nearest default wins:
173
+ * snippet, then each group, innermost first, then block, then scene, then the project). */
174
+ padAfterDefault?: number;
156
175
  gameData?: GameData;
157
176
  /** Author tags (#215). See LineBeat.tags. */
158
177
  tags?: string[];
@@ -169,6 +188,9 @@ interface Scene {
169
188
  gameId?: string;
170
189
  /** Host metadata - e.g. `location` lives here, not as a core field. */
171
190
  gameData?: GameData;
191
+ /** The default `padAfter` for the line and text beats inside it that set none (the nearest default wins:
192
+ * snippet, then each group, innermost first, then block, then scene, then the project). */
193
+ padAfterDefault?: number;
172
194
  /** Author tags (#215). See LineBeat.tags. */
173
195
  tags?: string[];
174
196
  /** Entry behaviour / setup (spec §15). */
@@ -350,6 +372,12 @@ declare const DEFAULT_QUALIFIERS: SpeakerQualifier[];
350
372
  declare function projectQualifiers(project: Pick<ProjectFile, "qualifiers">): SpeakerQualifier[];
351
373
  /** The project's qualifiers that some line (or line prompt) in these scenes uses, in the project's order. */
352
374
  declare function usedQualifiers(project: Pick<ProjectFile, "qualifiers">, scenes: Scene[]): SpeakerQualifier[];
375
+ /** The built-in `padAfter`, in seconds, for a project that sets no default of its own: the same on every runtime
376
+ * and in Patterpad's Play window (design/proposals/line-padding.md section 4). */
377
+ declare const DEFAULT_PAD_AFTER = 0.6;
378
+ /** The range validation keeps a `padAfter` or `padAfterDefault` within, in seconds. */
379
+ declare const PAD_AFTER_MIN = -10;
380
+ declare const PAD_AFTER_MAX = 60;
353
381
  /** A qualifier as it reaches a compiled bundle: its `gameId` and authored name (the unlocalised fallback). */
354
382
  interface BundleQualifier {
355
383
  gameId: string;
@@ -595,6 +623,9 @@ interface ProjectFile {
595
623
  /** The speaker qualifiers a line can pick from, in display order; default `DEFAULT_QUALIFIERS`. An empty
596
624
  * list means the project uses none. */
597
625
  qualifiers?: SpeakerQualifier[];
626
+ /** The project's default `padAfter` for every line and text beat that sets none and has no default above it.
627
+ * Absent = `DEFAULT_PAD_AFTER`. */
628
+ padAfterDefault?: number;
598
629
  gameDataFields?: GameDataFields;
599
630
  /** Ordered writing-status ladder (not-done -> done); default `DEFAULT_WRITING_STATUSES`. */
600
631
  writingStatuses?: WritingStatusDecl[];
@@ -836,6 +867,10 @@ interface HandoffLine {
836
867
  /** The speaker, speaker qualifier (`gameId`), and direction as sent (spoken lines only). */
837
868
  character?: string;
838
869
  qualifier?: string;
870
+ /** The qualifier's name as the cue printed it (`O.S.` in `TAM (O.S.)`), so a returned cue is read against
871
+ * what the editor saw even after the name changes in settings. Absent in handoffs written before it was
872
+ * recorded, which compare against the qualifier's current name. */
873
+ qualifierName?: string;
839
874
  direction?: string;
840
875
  /** The text as sent: the baseline for every comparison on reimport. */
841
876
  baseline: string;
@@ -880,6 +915,7 @@ interface CompiledSnippet {
880
915
  beats?: Beat[];
881
916
  onEnter?: CompiledEffect[];
882
917
  onExit?: CompiledEffect[];
918
+ padAfterDefault?: number;
883
919
  gameData?: GameData;
884
920
  tags?: string[];
885
921
  jump?: Jump;
@@ -899,6 +935,7 @@ interface CompiledGroup {
899
935
  shared?: boolean;
900
936
  options?: SequenceOptions;
901
937
  children: Array<CompiledGroup | CompiledSnippet>;
938
+ padAfterDefault?: number;
902
939
  gameData?: GameData;
903
940
  tags?: string[];
904
941
  /** Option-position fields (spec §5) - only when a direct child of a `choice`. */
@@ -916,6 +953,7 @@ interface CompiledBlock {
916
953
  /** Host-facing address (spec §6); the runtime resolves it to `id`. Absent = derived from `name`. */
917
954
  gameId?: string;
918
955
  children: Array<CompiledGroup | CompiledSnippet>;
956
+ padAfterDefault?: number;
919
957
  gameData?: GameData;
920
958
  tags?: string[];
921
959
  }
@@ -925,6 +963,7 @@ interface CompiledScene {
925
963
  name: string;
926
964
  /** Host-facing address (spec §6); the runtime resolves it to `id`. Absent = derived from `name`. */
927
965
  gameId?: string;
966
+ padAfterDefault?: number;
928
967
  gameData?: GameData;
929
968
  tags?: string[];
930
969
  onEntry?: CompiledEffect[];
@@ -952,6 +991,8 @@ interface Bundle {
952
991
  /** The speaker qualifiers the content uses, in the project's order. Absent when no line has one, so a
953
992
  * bundle without qualifiers is exactly as before. */
954
993
  qualifiers?: BundleQualifier[];
994
+ /** The project's own `padAfterDefault`, when it sets one; absent = `DEFAULT_PAD_AFTER`. */
995
+ padAfterDefault?: number;
955
996
  properties?: PropertyDecl[];
956
997
  /** Host / world scope declarations, baked from the project so the runtime can self-back a declared
957
998
  * scope (`@world`, ...) when no host resolver claims its token. Absent = no host scopes. */
@@ -1035,6 +1076,8 @@ interface SavedChoicePrompt {
1035
1076
  direction?: string;
1036
1077
  qualifier?: string;
1037
1078
  qualifierName?: string;
1079
+ /** The prompt's resolved pause (line padding). Absent in a save written before it existed. */
1080
+ padAfter?: number;
1038
1081
  }
1039
1082
  /** One option of a pending choice, saved VERBATIM: re-deriving on load would re-evaluate conditions. */
1040
1083
  interface SavedChoiceOption {
@@ -1092,13 +1135,26 @@ interface SaveGame {
1092
1135
  /** Each live flow's snapshot, keyed by flow id. */
1093
1136
  flows: Record<string, FlowSnapshot>;
1094
1137
  }
1095
- /** A version 2 flow snapshot, which carried the flow's property values itself. Still read. */
1096
- interface FlowSnapshotV2 extends FlowSnapshot {
1138
+ /** One flow's own property values, without its id: the sections a version 2 save carried per flow, and a
1139
+ * `FlowState` carries now. */
1140
+ interface FlowValues {
1097
1141
  /** The NOT-shared `@patter` globals, under token "patter". */
1098
1142
  scopes: EngineSave;
1099
1143
  /** Per-scene NOT-shared `@scene` bags (scene id -> name -> value). */
1100
1144
  sceneBags: Record<string, Record<string, ScalarValue>>;
1101
1145
  }
1146
+ /** A version 2 flow snapshot, which carried the flow's property values itself. Still read. */
1147
+ interface FlowSnapshotV2 extends FlowSnapshot, FlowValues {
1148
+ }
1149
+ /**
1150
+ * One flow taken out of an engine (`engine.captureFlow`) to be put back later (`engine.restoreFlow`), under the
1151
+ * same id or another: its snapshot as a save writes it, and its own property values without its id. Plain data
1152
+ * in the save's spelling, so a game saves it as it saves anything else. Shared state (shared properties, world
1153
+ * visit counts, shared selectors) is never in it, so restoring one rewinds nothing else.
1154
+ */
1155
+ interface FlowState extends FlowSnapshot, FlowValues {
1156
+ version: typeof SAVE_VERSION;
1157
+ }
1102
1158
  /** A version 2 save, from before the registry held the properties. Every runtime still reads it: its
1103
1159
  * property sections move into the registry (under the keys in the header above) as it loads. */
1104
1160
  interface SaveGameV2 {
@@ -1136,4 +1192,4 @@ declare const PROJECT_SCHEMA = "patter/project@0";
1136
1192
  declare const STRINGS_SCHEMA = "patter/strings@0";
1137
1193
  declare const AUTHORING_SCHEMA = "patter/authoring@0";
1138
1194
 
1139
- export { AUTHORING_SCHEMA, type AuthoringFile, type Beat, type Block, type Bundle, type BundleCastMember, type BundleQualifier, COMMON_GENDERS, type CaptionDelimiters, type CastMember, type Comment, type CommentMessage, type CommentRange, type CompiledBlock, type CompiledEffect, type CompiledGroup, type CompiledScene, type CompiledSnippet, type CoverageDriver, DEFAULT_CAPTION_CHARACTER, DEFAULT_CAPTION_DELIMITERS, DEFAULT_DOCUMENTATION_CLASSES, DEFAULT_LAYOUT, DEFAULT_QUALIFIERS, DEFAULT_RECORDING_STATUSES, DEFAULT_WRITING_STATUSES, type DocLine, type DocumentationClass, type EditRecord, type Effect, type EngineSave, type EstimatingConfig, type Expression, FLOW_SCHEMA, type FlowCursor, type FlowFile, type FlowNode, type FlowSnapshot, type FlowSnapshotV2, type GameData, type GameDataField, type GameDataFieldType, type GameDataFields, type GameDataNodeKind, type GameEventBeat, type GrammaticalGender, type Group, HANDOFF_SCHEMA, type HandoffFile, type HandoffImport, type HandoffLine, type HandoffRow, type HostScopeDecl, type HostScopeRegistry, type HostScopeSpec, type Jump, type JumpTarget, type LineBeat, type LocaleFile, PROJECT_LOCALE_SCENE, PROJECT_SCHEMA, type ProjectDictionary, type ProjectFile, type PromptBeat, type PropertyDecl, type PropertyType, RERECORD_STATUS, RERECORD_STATUS_DECL, type RecordingFolder, type RecordingStatusDecl, SAVE_SCHEMA, SAVE_VERSION, STRINGS_SCHEMA, type SaveEnvelope, type SaveGame, type SaveGameV2, type SavedChoice, type SavedChoiceOption, type SavedChoicePrompt, type ScalarValue, type Scene, type Selector, type SelectorExhaust, type SelectorOrder, type SelectorSnapshot, type SequenceOptions, type Snippet, type SpeakerQualifier, type StackFrame, type Suggestion, type SuggestionSource, type TextBeat, type VcsKind, type WritingStatusDecl, castStringKey, deriveRecordingFolders, effectiveGameId, gameIdify, isContentlessBeat, isValidGameId, projectLayout, projectQualifiers, qualifierStringKey, usedQualifiers, walkNodes };
1195
+ export { AUTHORING_SCHEMA, type AuthoringFile, type Beat, type Block, type Bundle, type BundleCastMember, type BundleQualifier, COMMON_GENDERS, type CaptionDelimiters, type CastMember, type Comment, type CommentMessage, type CommentRange, type CompiledBlock, type CompiledEffect, type CompiledGroup, type CompiledScene, type CompiledSnippet, type CoverageDriver, DEFAULT_CAPTION_CHARACTER, DEFAULT_CAPTION_DELIMITERS, DEFAULT_DOCUMENTATION_CLASSES, DEFAULT_LAYOUT, DEFAULT_PAD_AFTER, DEFAULT_QUALIFIERS, DEFAULT_RECORDING_STATUSES, DEFAULT_WRITING_STATUSES, type DocLine, type DocumentationClass, type EditRecord, type Effect, type EngineSave, type EstimatingConfig, type Expression, FLOW_SCHEMA, type FlowCursor, type FlowFile, type FlowNode, type FlowSnapshot, type FlowSnapshotV2, type FlowState, type FlowValues, type GameData, type GameDataField, type GameDataFieldType, type GameDataFields, type GameDataNodeKind, type GameEventBeat, type GrammaticalGender, type Group, HANDOFF_SCHEMA, type HandoffFile, type HandoffImport, type HandoffLine, type HandoffRow, type HostScopeDecl, type HostScopeRegistry, type HostScopeSpec, type Jump, type JumpTarget, type LineBeat, type LocaleFile, PAD_AFTER_MAX, PAD_AFTER_MIN, PROJECT_LOCALE_SCENE, PROJECT_SCHEMA, type ProjectDictionary, type ProjectFile, type PromptBeat, type PropertyDecl, type PropertyType, RERECORD_STATUS, RERECORD_STATUS_DECL, type RecordingFolder, type RecordingStatusDecl, SAVE_SCHEMA, SAVE_VERSION, STRINGS_SCHEMA, type SaveEnvelope, type SaveGame, type SaveGameV2, type SavedChoice, type SavedChoiceOption, type SavedChoicePrompt, type ScalarValue, type Scene, type Selector, type SelectorExhaust, type SelectorOrder, type SelectorSnapshot, type SequenceOptions, type Snippet, type SpeakerQualifier, type StackFrame, type Suggestion, type SuggestionSource, type TextBeat, type VcsKind, type WritingStatusDecl, castStringKey, deriveRecordingFolders, effectiveGameId, gameIdify, isContentlessBeat, isValidGameId, projectLayout, projectQualifiers, qualifierStringKey, usedQualifiers, walkNodes };
package/dist/index.d.ts CHANGED
@@ -27,6 +27,11 @@ interface LineBeat {
27
27
  * how the line is delivered (`TAM (O.S.)`), not who says it. Absent = none. The speaker is still
28
28
  * `character` for every authoring and reporting purpose. See `SpeakerQualifier`. */
29
29
  qualifier?: string;
30
+ /** The pause after this beat, before the next, in seconds (`padAfter`, design/proposals/line-padding.md):
31
+ * positive waits, zero follows at once, negative starts the next line that long before this one ends (a
32
+ * cut-in). Absent = the nearest `padAfterDefault` above it, else the project's, else `DEFAULT_PAD_AFTER`.
33
+ * Never negative on a snippet's last line or text beat: the runtime clamps it to zero there. */
34
+ padAfter?: number;
30
35
  gameData?: GameData;
31
36
  /** Author-defined freeform tags (#215): a cross-cutting label layer that travels to the runtime.
32
37
  * At runtime a beat's tags are the UNION of its own and every ancestor's (scene → block → group(s) →
@@ -42,6 +47,11 @@ interface LineBeat {
42
47
  interface TextBeat {
43
48
  id: string;
44
49
  kind: "text";
50
+ /** The pause after this beat, before the next, in seconds (`padAfter`, design/proposals/line-padding.md):
51
+ * positive waits, zero follows at once, negative starts the next line that long before this one ends (a
52
+ * cut-in). Absent = the nearest `padAfterDefault` above it, else the project's, else `DEFAULT_PAD_AFTER`.
53
+ * Never negative on a snippet's last line or text beat: the runtime clamps it to zero there. */
54
+ padAfter?: number;
45
55
  gameData?: GameData;
46
56
  /** Author tags (#215). See LineBeat.tags. */
47
57
  tags?: string[];
@@ -89,6 +99,9 @@ interface Snippet {
89
99
  beats?: Beat[];
90
100
  onEnter?: Effect[];
91
101
  onExit?: Effect[];
102
+ /** The default `padAfter` for the line and text beats inside it that set none (the nearest default wins:
103
+ * snippet, then each group, innermost first, then block, then scene, then the project). */
104
+ padAfterDefault?: number;
92
105
  gameData?: GameData;
93
106
  /** Author tags (#215). See LineBeat.tags. */
94
107
  tags?: string[];
@@ -123,6 +136,9 @@ interface Group {
123
136
  /** `sequence` config (order × exhaust, spec §4). */
124
137
  options?: SequenceOptions;
125
138
  children: Array<Group | Snippet>;
139
+ /** The default `padAfter` for the line and text beats inside it that set none (the nearest default wins:
140
+ * snippet, then each group, innermost first, then block, then scene, then the project). */
141
+ padAfterDefault?: number;
126
142
  gameData?: GameData;
127
143
  /** Author tags (#215). See LineBeat.tags. */
128
144
  tags?: string[];
@@ -153,6 +169,9 @@ interface Block {
153
169
  */
154
170
  gameId?: string;
155
171
  children: Array<Group | Snippet>;
172
+ /** The default `padAfter` for the line and text beats inside it that set none (the nearest default wins:
173
+ * snippet, then each group, innermost first, then block, then scene, then the project). */
174
+ padAfterDefault?: number;
156
175
  gameData?: GameData;
157
176
  /** Author tags (#215). See LineBeat.tags. */
158
177
  tags?: string[];
@@ -169,6 +188,9 @@ interface Scene {
169
188
  gameId?: string;
170
189
  /** Host metadata - e.g. `location` lives here, not as a core field. */
171
190
  gameData?: GameData;
191
+ /** The default `padAfter` for the line and text beats inside it that set none (the nearest default wins:
192
+ * snippet, then each group, innermost first, then block, then scene, then the project). */
193
+ padAfterDefault?: number;
172
194
  /** Author tags (#215). See LineBeat.tags. */
173
195
  tags?: string[];
174
196
  /** Entry behaviour / setup (spec §15). */
@@ -350,6 +372,12 @@ declare const DEFAULT_QUALIFIERS: SpeakerQualifier[];
350
372
  declare function projectQualifiers(project: Pick<ProjectFile, "qualifiers">): SpeakerQualifier[];
351
373
  /** The project's qualifiers that some line (or line prompt) in these scenes uses, in the project's order. */
352
374
  declare function usedQualifiers(project: Pick<ProjectFile, "qualifiers">, scenes: Scene[]): SpeakerQualifier[];
375
+ /** The built-in `padAfter`, in seconds, for a project that sets no default of its own: the same on every runtime
376
+ * and in Patterpad's Play window (design/proposals/line-padding.md section 4). */
377
+ declare const DEFAULT_PAD_AFTER = 0.6;
378
+ /** The range validation keeps a `padAfter` or `padAfterDefault` within, in seconds. */
379
+ declare const PAD_AFTER_MIN = -10;
380
+ declare const PAD_AFTER_MAX = 60;
353
381
  /** A qualifier as it reaches a compiled bundle: its `gameId` and authored name (the unlocalised fallback). */
354
382
  interface BundleQualifier {
355
383
  gameId: string;
@@ -595,6 +623,9 @@ interface ProjectFile {
595
623
  /** The speaker qualifiers a line can pick from, in display order; default `DEFAULT_QUALIFIERS`. An empty
596
624
  * list means the project uses none. */
597
625
  qualifiers?: SpeakerQualifier[];
626
+ /** The project's default `padAfter` for every line and text beat that sets none and has no default above it.
627
+ * Absent = `DEFAULT_PAD_AFTER`. */
628
+ padAfterDefault?: number;
598
629
  gameDataFields?: GameDataFields;
599
630
  /** Ordered writing-status ladder (not-done -> done); default `DEFAULT_WRITING_STATUSES`. */
600
631
  writingStatuses?: WritingStatusDecl[];
@@ -836,6 +867,10 @@ interface HandoffLine {
836
867
  /** The speaker, speaker qualifier (`gameId`), and direction as sent (spoken lines only). */
837
868
  character?: string;
838
869
  qualifier?: string;
870
+ /** The qualifier's name as the cue printed it (`O.S.` in `TAM (O.S.)`), so a returned cue is read against
871
+ * what the editor saw even after the name changes in settings. Absent in handoffs written before it was
872
+ * recorded, which compare against the qualifier's current name. */
873
+ qualifierName?: string;
839
874
  direction?: string;
840
875
  /** The text as sent: the baseline for every comparison on reimport. */
841
876
  baseline: string;
@@ -880,6 +915,7 @@ interface CompiledSnippet {
880
915
  beats?: Beat[];
881
916
  onEnter?: CompiledEffect[];
882
917
  onExit?: CompiledEffect[];
918
+ padAfterDefault?: number;
883
919
  gameData?: GameData;
884
920
  tags?: string[];
885
921
  jump?: Jump;
@@ -899,6 +935,7 @@ interface CompiledGroup {
899
935
  shared?: boolean;
900
936
  options?: SequenceOptions;
901
937
  children: Array<CompiledGroup | CompiledSnippet>;
938
+ padAfterDefault?: number;
902
939
  gameData?: GameData;
903
940
  tags?: string[];
904
941
  /** Option-position fields (spec §5) - only when a direct child of a `choice`. */
@@ -916,6 +953,7 @@ interface CompiledBlock {
916
953
  /** Host-facing address (spec §6); the runtime resolves it to `id`. Absent = derived from `name`. */
917
954
  gameId?: string;
918
955
  children: Array<CompiledGroup | CompiledSnippet>;
956
+ padAfterDefault?: number;
919
957
  gameData?: GameData;
920
958
  tags?: string[];
921
959
  }
@@ -925,6 +963,7 @@ interface CompiledScene {
925
963
  name: string;
926
964
  /** Host-facing address (spec §6); the runtime resolves it to `id`. Absent = derived from `name`. */
927
965
  gameId?: string;
966
+ padAfterDefault?: number;
928
967
  gameData?: GameData;
929
968
  tags?: string[];
930
969
  onEntry?: CompiledEffect[];
@@ -952,6 +991,8 @@ interface Bundle {
952
991
  /** The speaker qualifiers the content uses, in the project's order. Absent when no line has one, so a
953
992
  * bundle without qualifiers is exactly as before. */
954
993
  qualifiers?: BundleQualifier[];
994
+ /** The project's own `padAfterDefault`, when it sets one; absent = `DEFAULT_PAD_AFTER`. */
995
+ padAfterDefault?: number;
955
996
  properties?: PropertyDecl[];
956
997
  /** Host / world scope declarations, baked from the project so the runtime can self-back a declared
957
998
  * scope (`@world`, ...) when no host resolver claims its token. Absent = no host scopes. */
@@ -1035,6 +1076,8 @@ interface SavedChoicePrompt {
1035
1076
  direction?: string;
1036
1077
  qualifier?: string;
1037
1078
  qualifierName?: string;
1079
+ /** The prompt's resolved pause (line padding). Absent in a save written before it existed. */
1080
+ padAfter?: number;
1038
1081
  }
1039
1082
  /** One option of a pending choice, saved VERBATIM: re-deriving on load would re-evaluate conditions. */
1040
1083
  interface SavedChoiceOption {
@@ -1092,13 +1135,26 @@ interface SaveGame {
1092
1135
  /** Each live flow's snapshot, keyed by flow id. */
1093
1136
  flows: Record<string, FlowSnapshot>;
1094
1137
  }
1095
- /** A version 2 flow snapshot, which carried the flow's property values itself. Still read. */
1096
- interface FlowSnapshotV2 extends FlowSnapshot {
1138
+ /** One flow's own property values, without its id: the sections a version 2 save carried per flow, and a
1139
+ * `FlowState` carries now. */
1140
+ interface FlowValues {
1097
1141
  /** The NOT-shared `@patter` globals, under token "patter". */
1098
1142
  scopes: EngineSave;
1099
1143
  /** Per-scene NOT-shared `@scene` bags (scene id -> name -> value). */
1100
1144
  sceneBags: Record<string, Record<string, ScalarValue>>;
1101
1145
  }
1146
+ /** A version 2 flow snapshot, which carried the flow's property values itself. Still read. */
1147
+ interface FlowSnapshotV2 extends FlowSnapshot, FlowValues {
1148
+ }
1149
+ /**
1150
+ * One flow taken out of an engine (`engine.captureFlow`) to be put back later (`engine.restoreFlow`), under the
1151
+ * same id or another: its snapshot as a save writes it, and its own property values without its id. Plain data
1152
+ * in the save's spelling, so a game saves it as it saves anything else. Shared state (shared properties, world
1153
+ * visit counts, shared selectors) is never in it, so restoring one rewinds nothing else.
1154
+ */
1155
+ interface FlowState extends FlowSnapshot, FlowValues {
1156
+ version: typeof SAVE_VERSION;
1157
+ }
1102
1158
  /** A version 2 save, from before the registry held the properties. Every runtime still reads it: its
1103
1159
  * property sections move into the registry (under the keys in the header above) as it loads. */
1104
1160
  interface SaveGameV2 {
@@ -1136,4 +1192,4 @@ declare const PROJECT_SCHEMA = "patter/project@0";
1136
1192
  declare const STRINGS_SCHEMA = "patter/strings@0";
1137
1193
  declare const AUTHORING_SCHEMA = "patter/authoring@0";
1138
1194
 
1139
- export { AUTHORING_SCHEMA, type AuthoringFile, type Beat, type Block, type Bundle, type BundleCastMember, type BundleQualifier, COMMON_GENDERS, type CaptionDelimiters, type CastMember, type Comment, type CommentMessage, type CommentRange, type CompiledBlock, type CompiledEffect, type CompiledGroup, type CompiledScene, type CompiledSnippet, type CoverageDriver, DEFAULT_CAPTION_CHARACTER, DEFAULT_CAPTION_DELIMITERS, DEFAULT_DOCUMENTATION_CLASSES, DEFAULT_LAYOUT, DEFAULT_QUALIFIERS, DEFAULT_RECORDING_STATUSES, DEFAULT_WRITING_STATUSES, type DocLine, type DocumentationClass, type EditRecord, type Effect, type EngineSave, type EstimatingConfig, type Expression, FLOW_SCHEMA, type FlowCursor, type FlowFile, type FlowNode, type FlowSnapshot, type FlowSnapshotV2, type GameData, type GameDataField, type GameDataFieldType, type GameDataFields, type GameDataNodeKind, type GameEventBeat, type GrammaticalGender, type Group, HANDOFF_SCHEMA, type HandoffFile, type HandoffImport, type HandoffLine, type HandoffRow, type HostScopeDecl, type HostScopeRegistry, type HostScopeSpec, type Jump, type JumpTarget, type LineBeat, type LocaleFile, PROJECT_LOCALE_SCENE, PROJECT_SCHEMA, type ProjectDictionary, type ProjectFile, type PromptBeat, type PropertyDecl, type PropertyType, RERECORD_STATUS, RERECORD_STATUS_DECL, type RecordingFolder, type RecordingStatusDecl, SAVE_SCHEMA, SAVE_VERSION, STRINGS_SCHEMA, type SaveEnvelope, type SaveGame, type SaveGameV2, type SavedChoice, type SavedChoiceOption, type SavedChoicePrompt, type ScalarValue, type Scene, type Selector, type SelectorExhaust, type SelectorOrder, type SelectorSnapshot, type SequenceOptions, type Snippet, type SpeakerQualifier, type StackFrame, type Suggestion, type SuggestionSource, type TextBeat, type VcsKind, type WritingStatusDecl, castStringKey, deriveRecordingFolders, effectiveGameId, gameIdify, isContentlessBeat, isValidGameId, projectLayout, projectQualifiers, qualifierStringKey, usedQualifiers, walkNodes };
1195
+ export { AUTHORING_SCHEMA, type AuthoringFile, type Beat, type Block, type Bundle, type BundleCastMember, type BundleQualifier, COMMON_GENDERS, type CaptionDelimiters, type CastMember, type Comment, type CommentMessage, type CommentRange, type CompiledBlock, type CompiledEffect, type CompiledGroup, type CompiledScene, type CompiledSnippet, type CoverageDriver, DEFAULT_CAPTION_CHARACTER, DEFAULT_CAPTION_DELIMITERS, DEFAULT_DOCUMENTATION_CLASSES, DEFAULT_LAYOUT, DEFAULT_PAD_AFTER, DEFAULT_QUALIFIERS, DEFAULT_RECORDING_STATUSES, DEFAULT_WRITING_STATUSES, type DocLine, type DocumentationClass, type EditRecord, type Effect, type EngineSave, type EstimatingConfig, type Expression, FLOW_SCHEMA, type FlowCursor, type FlowFile, type FlowNode, type FlowSnapshot, type FlowSnapshotV2, type FlowState, type FlowValues, type GameData, type GameDataField, type GameDataFieldType, type GameDataFields, type GameDataNodeKind, type GameEventBeat, type GrammaticalGender, type Group, HANDOFF_SCHEMA, type HandoffFile, type HandoffImport, type HandoffLine, type HandoffRow, type HostScopeDecl, type HostScopeRegistry, type HostScopeSpec, type Jump, type JumpTarget, type LineBeat, type LocaleFile, PAD_AFTER_MAX, PAD_AFTER_MIN, PROJECT_LOCALE_SCENE, PROJECT_SCHEMA, type ProjectDictionary, type ProjectFile, type PromptBeat, type PropertyDecl, type PropertyType, RERECORD_STATUS, RERECORD_STATUS_DECL, type RecordingFolder, type RecordingStatusDecl, SAVE_SCHEMA, SAVE_VERSION, STRINGS_SCHEMA, type SaveEnvelope, type SaveGame, type SaveGameV2, type SavedChoice, type SavedChoiceOption, type SavedChoicePrompt, type ScalarValue, type Scene, type Selector, type SelectorExhaust, type SelectorOrder, type SelectorSnapshot, type SequenceOptions, type Snippet, type SpeakerQualifier, type StackFrame, type Suggestion, type SuggestionSource, type TextBeat, type VcsKind, type WritingStatusDecl, castStringKey, deriveRecordingFolders, effectiveGameId, gameIdify, isContentlessBeat, isValidGameId, projectLayout, projectQualifiers, qualifierStringKey, usedQualifiers, walkNodes };
package/dist/index.js CHANGED
@@ -53,6 +53,9 @@ function usedQualifiers(project, scenes) {
53
53
  }
54
54
  return projectQualifiers(project).filter((q) => used.has(q.gameId));
55
55
  }
56
+ var DEFAULT_PAD_AFTER = 0.6;
57
+ var PAD_AFTER_MIN = -10;
58
+ var PAD_AFTER_MAX = 60;
56
59
  var DEFAULT_WRITING_STATUSES = [
57
60
  { name: "stub", colour: 0 },
58
61
  // red
@@ -121,11 +124,14 @@ export {
121
124
  DEFAULT_CAPTION_DELIMITERS,
122
125
  DEFAULT_DOCUMENTATION_CLASSES,
123
126
  DEFAULT_LAYOUT,
127
+ DEFAULT_PAD_AFTER,
124
128
  DEFAULT_QUALIFIERS,
125
129
  DEFAULT_RECORDING_STATUSES,
126
130
  DEFAULT_WRITING_STATUSES,
127
131
  FLOW_SCHEMA,
128
132
  HANDOFF_SCHEMA,
133
+ PAD_AFTER_MAX,
134
+ PAD_AFTER_MIN,
129
135
  PROJECT_LOCALE_SCENE,
130
136
  PROJECT_SCHEMA,
131
137
  RERECORD_STATUS,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@patterkit/model",
3
- "version": "0.11.0",
3
+ "version": "0.13.0",
4
4
  "description": "Patter data-model types: source (scene/block/group/snippet/beat/jump), project, locale, authoring. The shape source-of-truth.",
5
5
  "type": "module",
6
6
  "license": "MIT",