@nodaro/prompts 1.27.0 → 1.28.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 +887 -598
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +166 -8
- package/dist/index.d.ts +166 -8
- package/dist/index.js +870 -599
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/src/__tests__/fixtures/parameter-hint-golden.json +33 -1
- package/src/__tests__/hint-join.test.ts +64 -1
- package/src/__tests__/motion-hint.test.ts +20 -0
- package/src/__tests__/parameter-registry-sync.test.ts +1 -0
- package/src/__tests__/person-mixed-heritage.test.ts +43 -0
- package/src/__tests__/resolve-prompt.test.ts +13 -1
- package/src/__tests__/transition-options.test.ts +223 -0
- package/src/__tests__/transition-styles.test.ts +202 -0
- package/src/__tests__/transitions-instant.test.ts +9 -5
- package/src/__tests__/transitions-scope.test.ts +415 -3
- package/src/__tests__/video-own-motion.test.ts +26 -0
- package/src/hint-join.ts +33 -1
- package/src/index.ts +1 -0
- package/src/parameter-prompt-hint.ts +20 -3
- package/src/person.ts +24 -8
- package/src/picker-art/character-art-files.generated.ts +536 -536
- package/src/picker-catalogs.ts +55 -2
- package/src/prompt-builder.ts +2 -1
- package/src/prompt-hint-join.ts +8 -2
- package/src/prompt-style-section.ts +3 -5
- package/src/resolve-prompt.ts +22 -4
- package/src/transitions.ts +309 -40
- package/src/video-own-motion.ts +29 -0
package/src/transitions.ts
CHANGED
|
@@ -65,6 +65,211 @@ export interface Transition {
|
|
|
65
65
|
* anti-blend instruction that made the model render a true single-frame cut.
|
|
66
66
|
*/
|
|
67
67
|
readonly instant?: boolean
|
|
68
|
+
/**
|
|
69
|
+
* PER-ROW OPTIONS — extra choices that only mean something for THIS
|
|
70
|
+
* transition (a wipe's direction), each written into the row's own hint.
|
|
71
|
+
*
|
|
72
|
+
* Unlike the timing scales (every row has a position), an option is declared
|
|
73
|
+
* by the row that reads it, so it never appears beside a transition it would
|
|
74
|
+
* not change. The row authors `promptTemplate` — its hint with one
|
|
75
|
+
* `{<field>}` token per option — and `promptHint` is DERIVED from it with
|
|
76
|
+
* every option on its `auto` choice (see `withOptionSlots`), so a reader of
|
|
77
|
+
* the plain `promptHint` (the picker catalog, the analyzer, a catalog pack)
|
|
78
|
+
* always sees a finished sentence and never a token.
|
|
79
|
+
*
|
|
80
|
+
* The choice's `phrase` is what fills the token, so the row BODY and the
|
|
81
|
+
* option WORDING are separate: a reworded body keeps its options as long as
|
|
82
|
+
* it keeps the token. `transition-options.test.ts` pins that every template
|
|
83
|
+
* carries exactly one token per option and no other.
|
|
84
|
+
*/
|
|
85
|
+
readonly options?: ReadonlyArray<TransitionOption>
|
|
86
|
+
/** The hint with a `{<field>}` token per `options` entry — see `options`. */
|
|
87
|
+
readonly promptTemplate?: string
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* One choice of a per-row option. `auto` leads every option and is the choice
|
|
92
|
+
* `promptHint` is written with: picking it (or picking nothing) sends no value.
|
|
93
|
+
*/
|
|
94
|
+
export interface TransitionOptionChoice {
|
|
95
|
+
readonly id: string
|
|
96
|
+
readonly label: string
|
|
97
|
+
readonly description: string
|
|
98
|
+
/** The words that fill the row template's `{<field>}` token. */
|
|
99
|
+
readonly phrase: string
|
|
100
|
+
/** The compact term for the choice ("left to right"); `""` on `auto`. */
|
|
101
|
+
readonly term: string
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/** A per-row option (see `Transition.options`). */
|
|
105
|
+
export interface TransitionOption {
|
|
106
|
+
/** The node-data field the chosen id is stored under — also the template
|
|
107
|
+
* token's name (`{wipeDirection}`). Unique within a row; SHARED across rows
|
|
108
|
+
* only where the rows mean the same kind of setting (`style`, see
|
|
109
|
+
* `TRANSITION_STYLE_FIELD`) — each row still declares its own choices, and
|
|
110
|
+
* a value is read only by the row that declares it. */
|
|
111
|
+
readonly field: string
|
|
112
|
+
readonly label: string
|
|
113
|
+
/** `auto` first. */
|
|
114
|
+
readonly choices: ReadonlyArray<TransitionOptionChoice>
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* The chosen option ids, keyed by `TransitionOption.field`
|
|
119
|
+
* (`{ wipeDirection: "left-to-right" }`). One flat record for a whole pick: a
|
|
120
|
+
* row reads only the fields it declares, so the other row of a two-pick, or a
|
|
121
|
+
* value left behind by an earlier pick, changes nothing.
|
|
122
|
+
*/
|
|
123
|
+
export type TransitionOptionValues = Readonly<Record<string, string | undefined>>
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* The wipe's direction. The phrase is the edge AND its travel, so the row's
|
|
127
|
+
* body is free to change around it (`a clean {wipeDirection}, revealing …`).
|
|
128
|
+
* `auto` names no orientation at all — a straight edge — and is what a pick
|
|
129
|
+
* with no direction has always meant.
|
|
130
|
+
*/
|
|
131
|
+
export const WIPE_DIRECTION: TransitionOption = {
|
|
132
|
+
field: "wipeDirection",
|
|
133
|
+
label: "Direction",
|
|
134
|
+
choices: [
|
|
135
|
+
{ id: "auto", label: "Auto", description: "Let the model choose the direction", term: "",
|
|
136
|
+
phrase: "straight edge sweeps across the frame" },
|
|
137
|
+
{ id: "left-to-right", label: "Left → Right", description: "A vertical edge travels from the left side to the right", term: "left to right",
|
|
138
|
+
phrase: "vertical edge sweeps across the frame from left to right" },
|
|
139
|
+
{ id: "right-to-left", label: "Right → Left", description: "A vertical edge travels from the right side to the left", term: "right to left",
|
|
140
|
+
phrase: "vertical edge sweeps across the frame from right to left" },
|
|
141
|
+
{ id: "top-to-bottom", label: "Top → Bottom", description: "A horizontal edge travels down from the top", term: "top to bottom",
|
|
142
|
+
phrase: "horizontal edge sweeps down the frame from top to bottom" },
|
|
143
|
+
{ id: "bottom-to-top", label: "Bottom → Top", description: "A horizontal edge travels up from the bottom", term: "bottom to top",
|
|
144
|
+
phrase: "horizontal edge sweeps up the frame from bottom to top" },
|
|
145
|
+
{ id: "top-left-to-bottom-right", label: "Top-left → Bottom-right", description: "A diagonal edge travels from the top-left corner to the bottom-right", term: "top-left to bottom-right",
|
|
146
|
+
phrase: "diagonal edge sweeps across the frame from the top-left corner to the bottom-right corner" },
|
|
147
|
+
{ id: "top-right-to-bottom-left", label: "Top-right → Bottom-left", description: "A diagonal edge travels from the top-right corner to the bottom-left", term: "top-right to bottom-left",
|
|
148
|
+
phrase: "diagonal edge sweeps across the frame from the top-right corner to the bottom-left corner" },
|
|
149
|
+
],
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* STYLE — a row's alternative LOOKS, each a complete description.
|
|
154
|
+
*
|
|
155
|
+
* A styled row's `promptTemplate` is the single token `{style}`, so choosing a
|
|
156
|
+
* style swaps the row's whole body, not a phrase inside it. The field is SHARED
|
|
157
|
+
* by every styled row (one document key, `style`), but each row declares its
|
|
158
|
+
* own choices, and every choice id but `auto` carries the row's id as a prefix
|
|
159
|
+
* (`debris-shower-light-sweep`), so a stored style can never mean something on
|
|
160
|
+
* another row: re-pointing the pick drops it, and a row reads a foreign id as
|
|
161
|
+
* its default.
|
|
162
|
+
*
|
|
163
|
+
* `auto` is the row's DEFAULT look — labelled with that look's name
|
|
164
|
+
* ("Full cover (default)"), never "Auto", because it is a specific look and not
|
|
165
|
+
* "the model decides". Picking it stores nothing, so a pick with no style (every
|
|
166
|
+
* pick made before styles existed) reads as the default.
|
|
167
|
+
*
|
|
168
|
+
* Every body below is the text a tested A/B take was generated from (tidied:
|
|
169
|
+
* first letter lower-cased, final full stop dropped). `term` is `""` on every
|
|
170
|
+
* choice: the row's own term leads the compact rendering whatever the style.
|
|
171
|
+
*/
|
|
172
|
+
function rowStyle(
|
|
173
|
+
row: string,
|
|
174
|
+
choices: ReadonlyArray<{ readonly slug?: string; readonly label: string; readonly description: string; readonly phrase: string }>,
|
|
175
|
+
): TransitionOption {
|
|
176
|
+
return {
|
|
177
|
+
field: TRANSITION_STYLE_FIELD,
|
|
178
|
+
label: "Style",
|
|
179
|
+
choices: choices.map((c, i) => ({
|
|
180
|
+
id: i === 0 ? "auto" : `${row}-${c.slug}`,
|
|
181
|
+
label: i === 0 ? `${c.label} (default)` : c.label,
|
|
182
|
+
description: c.description,
|
|
183
|
+
phrase: c.phrase,
|
|
184
|
+
term: "",
|
|
185
|
+
})),
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
/** The shared node-data field every styled row stores its look under. */
|
|
190
|
+
export const TRANSITION_STYLE_FIELD = "style"
|
|
191
|
+
|
|
192
|
+
export const DEBRIS_SHOWER_STYLE: TransitionOption = rowStyle("debris-shower", [
|
|
193
|
+
{ label: "Full cover", description: "Debris fills the whole screen, then blows past to reveal the next scene",
|
|
194
|
+
phrase: "a dense shower of loose leaves, paper scraps and dust whips across the frame from one side, close to the lens, thick enough to hide the whole picture. The camera stays where it is and the framing does not change. As the last of the debris blows past the far edge, the second shot is revealed behind it. The shot ends on the second shot, clear and fully resolved, with no debris left. The debris passes in front of the picture in one direction, and the second shot appears only once it has passed" },
|
|
195
|
+
{ slug: "light-sweep", label: "Light sweep", description: "A quick scatter of debris crosses the screen; the scene has changed behind it",
|
|
196
|
+
phrase: "a shower of debris — leaves, papers, dust — sweeps across the frame in front of the camera, and once the debris clears the scene behind has changed" },
|
|
197
|
+
])
|
|
198
|
+
|
|
199
|
+
export const GARDEN_BLOOM_STYLE: TransitionOption = rowStyle("garden-bloom", [
|
|
200
|
+
{ label: "Grow & part", description: "Flowers and vines grow over the picture, then part like curtains on the next scene",
|
|
201
|
+
phrase: "lush flowers and vines rapidly grow and bloom outward from the edges of the frame, the foliage spreads to overtake the entire image, then parts open like curtains to reveal the new scene behind" },
|
|
202
|
+
{ slug: "hedge-doors", label: "Hedge doors", description: "Leafy panels close over the picture, then slide apart to the sides",
|
|
203
|
+
phrase: "vines and flowers grow rapidly inward from the edges of the frame, blooming as they spread, until leaves and blossoms cover the whole picture. The camera stays where it is and the framing does not change. The foliage then splits down the middle and draws apart toward the side edges, opening onto the second shot behind it. The shot ends on the second shot, clear and fully resolved, with no leaves or flowers left. The plants grow over the front of the picture, and the first shot stays unchanged until they cover it completely" },
|
|
204
|
+
])
|
|
205
|
+
|
|
206
|
+
export const SMOKE_PUFF_STYLE: TransitionOption = rowStyle("smoke-puff", [
|
|
207
|
+
{ label: "Engulf", description: "Smoke billows up around the subject, and the new subject appears inside it",
|
|
208
|
+
phrase: "the subject vanishes in a soft puff of smoke that billows outward and fills the frame, the smoke then clears to reveal the new subject in the new scene" },
|
|
209
|
+
{ slug: "full-cover", label: "Full cover", description: "Smoke from the subject fills the whole screen, then clears on the next scene",
|
|
210
|
+
phrase: "the first subject vanishes in a sudden soft puff of smoke that billows outward from where it stood until the smoke fills the frame. The camera stays where it is and the framing does not change. The smoke thins and clears from the centre outward, revealing the second shot with the second subject at the same place in the frame. The shot ends on the second shot, clear and fully resolved, with no smoke left. The smoke comes only from where the first subject was" },
|
|
211
|
+
])
|
|
212
|
+
|
|
213
|
+
export const SAKURA_PETALS_STYLE: TransitionOption = rowStyle("sakura-petals", [
|
|
214
|
+
{ label: "Swirling veil", description: "A swirl of pink petals veils the picture, then drifts past",
|
|
215
|
+
phrase: "a dense storm of cherry blossom petals swirls in from one side and fills the frame in soft pink motion, the petals cluster to fully veil the image, then drift past to reveal the new scene" },
|
|
216
|
+
{ slug: "side-sweep", label: "Side sweep", description: "Petals sweep across from one side and leave by the other, uncovering the next scene",
|
|
217
|
+
phrase: "a dense storm of pink cherry blossom petals swirls in from one side of the frame, close to the lens, and thickens until the petals veil the whole picture. The camera stays where it is and the framing does not change. The petals keep drifting the same way and thin out, revealing the second shot behind them. The shot ends on the second shot, clear and fully resolved, with no petals left. The petals fly across the front of the picture in one direction, and the first shot stays unchanged until they hide it completely" },
|
|
218
|
+
])
|
|
219
|
+
|
|
220
|
+
export const AURORA_SWEEP_STYLE: TransitionOption = rowStyle("aurora-sweep", [
|
|
221
|
+
{ label: "Sky glow", description: "Aurora light glows over the scene, then fades to reveal the next one",
|
|
222
|
+
phrase: "a luminous curtain of green and violet aurora light ripples across the whole frame, and its bright bands veil the first shot. The camera stays where it is and the framing does not change. As the bands fade, the second shot is revealed behind them. The shot ends on the second shot, clear and fully resolved, with no aurora light left. The aurora glows over the front of the picture, and the second shot appears only as it fades" },
|
|
223
|
+
{ slug: "veil", label: "Veil", description: "Aurora curtains drop over the whole picture, then fade to reveal the next scene",
|
|
224
|
+
phrase: "a luminous green and violet aurora curtain ripples across the entire frame, the bright bands obscure the first scene, and as the aurora dissipates the second scene resolves in the clear sky" },
|
|
225
|
+
])
|
|
226
|
+
|
|
227
|
+
export const SAND_STORM_STYLE: TransitionOption = rowStyle("sand-storm", [
|
|
228
|
+
{ label: "Full cover", description: "A wall of sand hides the whole picture, then clears on the next scene",
|
|
229
|
+
phrase: "a wall of opaque, swirling ochre sand sweeps in from one side of the frame and surges across it until the whole picture is hidden in dust. The camera stays where it is and the framing does not change. The dust then thins and sinks away toward the lower edge of the frame, revealing the second shot behind it. The shot ends on the second shot, clear and fully resolved, with no dust left. The first shot stays as it is until the sand covers it completely, and the second shot appears only as the dust clears" },
|
|
230
|
+
{ slug: "light-sweep", label: "Light sweep", description: "A streak of blown sand crosses the screen with the next scene already behind it",
|
|
231
|
+
phrase: "a narrow streak of blown sand races across the frame close to the lens in one direction. The first shot stays clear ahead of the streak and the second shot is already clear behind it. The camera stays where it is and the framing does not change. The shot ends on the second shot, fully resolved, with no sand left" },
|
|
232
|
+
])
|
|
233
|
+
|
|
234
|
+
export const WHITE_FLASH_STYLE: TransitionOption = rowStyle("white-flash", [
|
|
235
|
+
{ label: "Flash", description: "A camera flash pops the picture to white, holds, then fades down on the next scene",
|
|
236
|
+
phrase: "a bright camera-flash bloom fills the whole frame with pure white. The camera stays where it is and the framing does not change. The white holds for a clear beat, then fades down to reveal the second shot. The shot ends on the second shot, fully resolved, with no white haze left. The first shot is gone once the frame is white, and the second shot appears only out of the white" },
|
|
237
|
+
{ slug: "overexposure", label: "Overexposure", description: "The picture blooms to white and resolves into the next scene",
|
|
238
|
+
phrase: "a bright camera-flash bloom fills the frame with pure white, holds for a fraction of a second, then resolves into the new scene" },
|
|
239
|
+
])
|
|
240
|
+
|
|
241
|
+
const optionToken = (field: string): string => `{${field}}`
|
|
242
|
+
|
|
243
|
+
/**
|
|
244
|
+
* Fill a template's option tokens: each option's chosen choice when `values`
|
|
245
|
+
* names one of its ids, its `auto` choice otherwise (an unknown id included).
|
|
246
|
+
*/
|
|
247
|
+
function fillOptionSlots(
|
|
248
|
+
template: string,
|
|
249
|
+
options: ReadonlyArray<TransitionOption>,
|
|
250
|
+
values?: TransitionOptionValues,
|
|
251
|
+
): string {
|
|
252
|
+
let out = template
|
|
253
|
+
for (const option of options) {
|
|
254
|
+
const picked = values?.[option.field]
|
|
255
|
+
const choice =
|
|
256
|
+
option.choices.find((c) => c.id === picked) ?? option.choices[0]
|
|
257
|
+
out = out.split(optionToken(option.field)).join(choice?.phrase ?? "")
|
|
258
|
+
}
|
|
259
|
+
return out
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
/**
|
|
263
|
+
* Author a row that has options: the row is written with its `promptTemplate`,
|
|
264
|
+
* and its `promptHint` is the template on every `auto` choice.
|
|
265
|
+
*/
|
|
266
|
+
function withOptionSlots(
|
|
267
|
+
row: Omit<Transition, "promptHint"> & {
|
|
268
|
+
readonly promptTemplate: string
|
|
269
|
+
readonly options: ReadonlyArray<TransitionOption>
|
|
270
|
+
},
|
|
271
|
+
): Transition {
|
|
272
|
+
return { ...row, promptHint: fillOptionSlots(row.promptTemplate, row.options) }
|
|
68
273
|
}
|
|
69
274
|
|
|
70
275
|
/**
|
|
@@ -105,33 +310,34 @@ export const TRANSITIONS: ReadonlyArray<Transition> = [
|
|
|
105
310
|
{ id: "fade-to-white", label: "Fade to White", category: "standard", description: "Blooms to white, second emerges",
|
|
106
311
|
promptHint: "fade to white: the first shot brightens until the frame is pure white, then the second shot resolves out of the white" },
|
|
107
312
|
{ id: "snap-to-black", label: "Snap to Black", category: "standard", description: "Instant cut to full black for a beat, then the next shot",
|
|
108
|
-
promptHint: "snap to black: the first shot cuts
|
|
313
|
+
promptHint: "snap to black: the first shot cuts straight to full black on a single frame. The camera holds its framing right up to the cut. The frame stays pure black for a single beat, then the second shot cuts in at full brightness on a single frame. The shot ends on the second shot, fully resolved", term: "snap to black" , instant: true },
|
|
109
314
|
{ id: "match-cut", label: "Match Cut", category: "standard", description: "Shape or motion match across shots",
|
|
110
|
-
promptHint: "match cut: the
|
|
315
|
+
promptHint: "match cut: the last picture of the first shot and the first picture of the second share one shape, at the same place and the same size in the frame. The camera holds that shape in place across the cut. On the next frame everything around the shape has changed while the shape itself stays put. The shot ends on the second shot, fully resolved, with no flash frame or zoom between the two" , instant: true },
|
|
111
316
|
{ id: "smash-cut", label: "Smash Cut", category: "standard", description: "Jarring abrupt cut between contrasting shots",
|
|
112
317
|
promptHint: "smash cut: an abrupt jarring transition between two visually or tonally contrasting shots with no fade, on a beat" , instant: true },
|
|
113
318
|
{ id: "iris", label: "Iris", category: "standard", description: "Circular iris closes, then opens on second",
|
|
114
319
|
promptHint: "iris transition: a circular vignette closes inward over the first shot until the frame is black, then opens outward to reveal the second shot", term: "iris wipe" },
|
|
115
|
-
{ id: "wipe",
|
|
116
|
-
|
|
320
|
+
withOptionSlots({ id: "wipe", label: "Wipe", category: "standard", description: "Linear wipe replaces first shot",
|
|
321
|
+
promptTemplate: "linear wipe transition: a clean {wipeDirection}, revealing the second shot behind it", term: "linear wipe",
|
|
322
|
+
options: [WIPE_DIRECTION] }),
|
|
117
323
|
{ id: "roll-transition", label: "Roll", category: "standard", description: "Frame rolls 90-180°, second shot upright on landing",
|
|
118
|
-
promptHint: "the
|
|
324
|
+
promptHint: "the picture rolls around its centre in one smooth, fast turn, blurred by the speed of the turn. The camera stays in the same spot, turning only around its lens axis. During the turn the second shot takes over, and the roll slows and stops with it level and upright. The shot ends on the second shot, level, upright and still. The roll turns one way only and stops once, with no swing back", term: "camera roll transition" },
|
|
119
325
|
{ id: "seamless-match", label: "Seamless Match", category: "standard", description: "Hidden cut disguised by matched motion and color",
|
|
120
326
|
promptHint: "hidden seamless transition: the camera motion, color palette, and on-screen motion at the end of the first shot continue exactly across the cut into the second shot, so the boundary is invisible and the two shots feel like one unbroken take", term: "invisible cut" , instant: true },
|
|
121
327
|
{ id: "whip-pan", label: "Whip Pan", category: "standard", description: "Camera whips sideways into blur, next shot rides the same direction",
|
|
122
328
|
promptHint: "whip pan transition: the camera whips sideways at high speed, smearing the frame into heavy horizontal motion blur, and the second shot enters already travelling in the same direction before it settles into its framing", term: "whip pan" },
|
|
123
329
|
{ id: "jump-cut", label: "Jump Cut", category: "standard", description: "Same framing, time skips forward",
|
|
124
|
-
promptHint: "jump cut: the framing, lens, and camera position stay identical across the cut while time skips abruptly forward, so the subject snaps to a new position inside what still reads as one continuous shot", term: "jump cut" , instant: true },
|
|
330
|
+
promptHint: "jump cut: the framing, lens, and camera position stay identical across the cut while time skips abruptly forward, so the subject snaps to a new position inside what still reads as one continuous shot. No leap, no run, no lunge and no motion blur between the two positions; the subject is in the old place on one frame and already in the new place on the next", term: "jump cut" , instant: true },
|
|
125
331
|
|
|
126
332
|
// ============================================================================
|
|
127
333
|
// TIME — 8 entries — temporal shifts (same or related scene, different time, or memory)
|
|
128
334
|
// ============================================================================
|
|
129
335
|
{ id: "fast-forward-day-night", label: "Fast-Forward (Day → Night)", category: "time", description: "Time-lapse day to night same scene",
|
|
130
|
-
promptHint: "fast-forward time-lapse transition: the
|
|
336
|
+
promptHint: "fast-forward time-lapse transition: the same view with framing locked while hours pass in seconds: light and shadows sweep across the scene, daylight warms to dusk and fades to night, lights come on, until the picture matches the end frame", term: "day-to-night time-lapse" },
|
|
131
337
|
{ id: "fast-forward-night-day", label: "Fast-Forward (Night → Day)", category: "time", description: "Time-lapse night to dawn same scene",
|
|
132
338
|
promptHint: "fast-forward time-lapse transition: stars fade, the sky shifts from deep night through pre-dawn blue to golden sunrise, shadows sweep in reverse, all while framing and camera position remain locked on the same scene", term: "night-to-day time-lapse" },
|
|
133
339
|
{ id: "seasonal-shift", label: "Seasonal Shift", category: "time", description: "Same scene through changing seasons",
|
|
134
|
-
promptHint: "accelerated seasonal time-lapse:
|
|
340
|
+
promptHint: "accelerated seasonal time-lapse: the same view races through the seasons in fast motion, from the season of the first shot to the season of the second, as growing things bud, turn and fall and snow comes or goes. The camera stays where it is and the framing does not change. The change flows continuously across the whole picture, every part moving on together, until the view matches the second shot. The shot ends on the second shot's season, still and fully resolved. Only the season changes, and the layout of the view stays exactly the same", term: "seasonal time-lapse" },
|
|
135
341
|
{ id: "aging", label: "Aging", category: "time", description: "Subject visibly ages forward in time",
|
|
136
342
|
promptHint: "accelerated aging transition: the subject visibly ages forward - fine lines deepen into wrinkles, hair greys to silver, posture settles - while the framing stays unchanged", term: "accelerated aging" },
|
|
137
343
|
{ id: "rewind", label: "Rewind", category: "time", description: "Time reverses, motion plays backward",
|
|
@@ -141,7 +347,7 @@ export const TRANSITIONS: ReadonlyArray<Transition> = [
|
|
|
141
347
|
{ id: "weather-shift", label: "Weather Shift", category: "time", description: "Same scene through changing weather",
|
|
142
348
|
promptHint: "accelerated weather transition: same scene, framing locked — clear sky darkens to storm clouds, rain begins and intensifies then clears, sun returns through breaking clouds", term: "weather time-lapse" },
|
|
143
349
|
{ id: "flashback", label: "Flashback", category: "time", description: "Memory-flashback into a past moment of the subject",
|
|
144
|
-
promptHint: "brief flashback transition:
|
|
350
|
+
promptHint: "brief flashback transition: a soft warm wash spreads over the whole picture and a faint ripple drifts across it as the present moment fades. The camera stays where it is and the framing does not change. Through the ripple an earlier moment of the same subject comes into focus, like a memory. The shot ends on the remembered moment, steady and fully resolved, with the ripple gone. The subject stays at the same place in the frame while the moment around it changes" },
|
|
145
351
|
|
|
146
352
|
// ============================================================================
|
|
147
353
|
// ELEMENT — 14 entries — teleport via natural element
|
|
@@ -154,24 +360,29 @@ export const TRANSITIONS: ReadonlyArray<Transition> = [
|
|
|
154
360
|
promptHint: "the subject crumbles into fine sand that is swept away by a gust of wind in a swirling vortex, then the sand particles converge and re-form into the new subject" },
|
|
155
361
|
{ id: "fire-burnup", label: "Burn-Up", category: "element", description: "Subject burns to embers, embers reform",
|
|
156
362
|
promptHint: "the subject ignites and burns from edges inward into glowing embers and ash, the embers swirl through the frame and re-ignite into the new subject", term: "burn to embers and reform" },
|
|
157
|
-
{ id: "smoke-puff", label: "Smoke Puff", category: "element", description: "Subject vanishes in smoke, reappears",
|
|
158
|
-
|
|
363
|
+
withOptionSlots({ id: "smoke-puff", label: "Smoke Puff", category: "element", description: "Subject vanishes in smoke, reappears",
|
|
364
|
+
promptTemplate: "{style}",
|
|
365
|
+
options: [SMOKE_PUFF_STYLE] }),
|
|
159
366
|
{ id: "magic-sparkles", label: "Magic Sparkles", category: "element", description: "Particle dissolve à la Avengers / apparition",
|
|
160
367
|
promptHint: "the subject disintegrates into a cloud of glowing golden sparkles that scatter outward, then the sparkles converge from across the frame and re-coalesce into the new subject" },
|
|
161
368
|
{ id: "lightning-flash", label: "Lightning Strike", category: "element", description: "Lightning strikes, scene changes in flash",
|
|
162
369
|
promptHint: "a brilliant jagged bolt of lightning cracks across the frame and its flash turns the whole picture white. The camera stays where it is and the framing does not change. As the flash dies away, the second shot is revealed in its place. The shot ends on the second shot, fully resolved, with no bolt or flash left. The change happens inside the flash, and the second shot appears only as the white fades" },
|
|
163
370
|
{ id: "ink-splash", label: "Ink Splash", category: "element", description: "Ink splashes across, scene changes",
|
|
164
371
|
promptHint: "black ink splashes across the frame in expanding tendrils that fully cover the image, then the ink retracts inward and pulls back to reveal the new scene" },
|
|
165
|
-
{ id: "sand-storm", label: "Sand Storm", category: "element", description: "Sand storm engulfs the frame, scene changes inside",
|
|
166
|
-
|
|
372
|
+
withOptionSlots({ id: "sand-storm", label: "Sand Storm", category: "element", description: "Sand storm engulfs the frame, scene changes inside",
|
|
373
|
+
promptTemplate: "{style}",
|
|
374
|
+
options: [SAND_STORM_STYLE] }),
|
|
167
375
|
{ id: "paint-splash", label: "Paint Splash", category: "element", description: "Vivid paint splash covers, retracts into new scene",
|
|
168
376
|
promptHint: "vivid splashes of coloured paint fly across the frame in arcing streaks and pile over one another until the whole picture is covered in wet paint. The camera stays where it is and the framing does not change. The paint then gathers toward the centre of the frame and shrinks to nothing, uncovering the second shot from the edges inward. The shot ends on the second shot, clean and fully resolved, with no paint left. The paint lies on the surface of the picture itself, and the second shot appears only where the paint has gone" },
|
|
169
|
-
{ id: "aurora-sweep", label: "Aurora Sweep", category: "element", description: "Aurora curtain sweeps across, scene changes behind",
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
377
|
+
withOptionSlots({ id: "aurora-sweep", label: "Aurora Sweep", category: "element", description: "Aurora curtain sweeps across, scene changes behind",
|
|
378
|
+
promptTemplate: "{style}",
|
|
379
|
+
options: [AURORA_SWEEP_STYLE] }),
|
|
380
|
+
withOptionSlots({ id: "sakura-petals", label: "Sakura Storm", category: "element", description: "Cherry blossom petals storm across the frame",
|
|
381
|
+
promptTemplate: "{style}", term: "cherry blossom petal storm",
|
|
382
|
+
options: [SAKURA_PETALS_STYLE] }),
|
|
383
|
+
withOptionSlots({ id: "garden-bloom", label: "Garden Bloom", category: "element", description: "Flowers bloom outward, parting to reveal new scene",
|
|
384
|
+
promptTemplate: "{style}",
|
|
385
|
+
options: [GARDEN_BLOOM_STYLE] }),
|
|
175
386
|
{ id: "powder-burst", label: "Powder Burst", category: "element", description: "Colored powder bursts across frame and clears",
|
|
176
387
|
promptHint: "a burst of vivid colored powder explodes from the center of the frame in slow motion, the cloud of pigment expands to fill the image, then drifts apart and settles to reveal the second scene" },
|
|
177
388
|
|
|
@@ -203,7 +414,7 @@ export const TRANSITIONS: ReadonlyArray<Transition> = [
|
|
|
203
414
|
{ id: "zoom-into-eye", label: "Zoom Into Eye", category: "portal", description: "Push into pupil, new world inside",
|
|
204
415
|
promptHint: "the camera pushes into a tight macro of the subject's eye, the pupil dilates and fills the frame, and the new scene materialises from within the pupil as if the pupil itself were a portal" },
|
|
205
416
|
{ id: "zoom-into-mirror", label: "Zoom Into Mirror", category: "portal", description: "Push into mirror, scene inside reflection",
|
|
206
|
-
promptHint: "the camera pushes
|
|
417
|
+
promptHint: "the camera pushes straight at a mirror in the frame. As the lens meets the glass, the mirror's surface turns liquid and rings ripple out across the whole picture, and the camera keeps moving forward through the rippling surface, out the far side into the second shot. Until the lens touches the glass, the mirror keeps its own reflection. The shot ends in the second shot, still and fully resolved, with no ripples left" },
|
|
207
418
|
{ id: "zoom-into-screen", label: "Zoom Into Screen", category: "portal", description: "Push into TV/phone screen",
|
|
208
419
|
promptHint: "the camera pushes toward a screen visible in the scene, such as a TV, phone or monitor, the screen's image fills the frame, and the camera passes through into that image which becomes the new scene" },
|
|
209
420
|
{ id: "zoom-into-book", label: "Zoom Into Book", category: "portal", description: "Push into book page illustration",
|
|
@@ -234,8 +445,9 @@ export const TRANSITIONS: ReadonlyArray<Transition> = [
|
|
|
234
445
|
promptHint: "a flash at the exact centre of the frame bursts into a sharp, bright ring that races past every edge in a moment, trailing a smear of motion blur behind its rim and warping the picture as it goes. The camera stays where it is and the picture stays level. The second shot shows only inside the ring and the first only outside it, with the bright ring as the one hard border and no blending anywhere" },
|
|
235
446
|
{ id: "punch-into-camera", label: "Punch Into Camera", category: "physics", description: "Fist strikes camera, scene changes",
|
|
236
447
|
promptHint: "a fist or object swings rapidly toward the camera and strikes the lens with motion blur and impact frames, and the moment of impact reveals the new scene" },
|
|
237
|
-
{ id: "debris-shower", label: "Debris Shower", category: "physics", description: "Debris flies past, scene changes behind",
|
|
238
|
-
|
|
448
|
+
withOptionSlots({ id: "debris-shower", label: "Debris Shower", category: "physics", description: "Debris flies past, scene changes behind",
|
|
449
|
+
promptTemplate: "{style}",
|
|
450
|
+
options: [DEBRIS_SHOWER_STYLE] }),
|
|
239
451
|
{ id: "gravity-flip", label: "Gravity Flip", category: "physics", description: "Gravity inverts, camera rotates 180",
|
|
240
452
|
promptHint: "gravity inverts and the camera rotates a full 180 degrees as objects and the subject reorient to the new down, settling into the new scene oriented correctly" },
|
|
241
453
|
{ id: "building-explosion", label: "Building Explosion", category: "physics", description: "Structure detonates, scene shifts through smoke",
|
|
@@ -243,7 +455,7 @@ export const TRANSITIONS: ReadonlyArray<Transition> = [
|
|
|
243
455
|
{ id: "vehicle-explosion", label: "Vehicle Explosion", category: "physics", description: "Vehicle detonates in foreground, scene changes behind",
|
|
244
456
|
promptHint: "a vehicle in the frame bursts into a violent explosion of fire and twisted metal, and the fireball billows toward the lens until orange flame fills the whole picture. The camera stays where it is and the framing does not change. The flame gives way to thick smoke, and as the smoke parts the second shot is revealed. The shot ends on the second shot, clear and fully resolved, with no fire or smoke left. The explosion comes from that vehicle itself, and the second shot appears only as the smoke parts" },
|
|
245
457
|
{ id: "jump-match", label: "Jump Match", category: "physics", description: "Subject jumps, landing matches into new scene",
|
|
246
|
-
promptHint: "the subject
|
|
458
|
+
promptHint: "the subject launches into a jump, and at the height of the leap the picture cuts to a new place. The camera follows the arc of the jump at the same speed on both sides of the cut, and the subject stays at the same place in the frame. In the second shot the same jump carries on without a break, and the subject comes down and lands in the new place. The shot ends on the subject landed in the second shot, fully resolved", term: "match cut on a jump" , instant: true },
|
|
247
459
|
{ id: "hand-swipe", label: "Hand Swipe", category: "physics", description: "Hand swipes across lens, scene changes during occlusion",
|
|
248
460
|
promptHint: "a hand sweeps across the camera lens at close range, fully occluding the frame in motion blur for a single beat, and as the hand exits the opposite side the scene has changed to the new setting" },
|
|
249
461
|
{ id: "action-relay", label: "Action Match", category: "physics", description: "Subject exits on an action and lands in the new scene mid-move",
|
|
@@ -252,14 +464,15 @@ export const TRANSITIONS: ReadonlyArray<Transition> = [
|
|
|
252
464
|
// ============================================================================
|
|
253
465
|
// LIGHT — 8 entries — flash and lens FX
|
|
254
466
|
// ============================================================================
|
|
255
|
-
{ id: "white-flash", label: "White Flash", category: "light", description: "Frame blooms to white",
|
|
256
|
-
|
|
467
|
+
withOptionSlots({ id: "white-flash", label: "White Flash", category: "light", description: "Frame blooms to white",
|
|
468
|
+
promptTemplate: "{style}",
|
|
469
|
+
options: [WHITE_FLASH_STYLE] }),
|
|
257
470
|
{ id: "lens-flare-swipe", label: "Lens Flare Swipe", category: "light", description: "Anamorphic lens flare swipes",
|
|
258
471
|
promptHint: "a horizontal anamorphic lens flare sweeps across the frame from one side to the other, and as it crosses the frame the scene behind it has changed to the new setting" },
|
|
259
472
|
{ id: "light-streak", label: "Light Streak", category: "light", description: "Light streak wipes across",
|
|
260
473
|
promptHint: "a bright streak of light races across the frame leaving motion-blur trails, and as the streak exits the opposite side the scene is now the new setting" },
|
|
261
474
|
{ id: "color-invert", label: "Color Invert Flash", category: "light", description: "Colors invert briefly",
|
|
262
|
-
promptHint: "
|
|
475
|
+
promptHint: "the colours of the whole picture turn to their photographic negative in an instant. The camera stays where it is and the framing does not change. The negative holds for a single beat, and when the colours snap back to normal the second shot is in place. The shot ends on the second shot in natural colour, fully resolved. The change of shot happens while the picture is in negative, and the picture stays upright and in place throughout" },
|
|
263
476
|
{ id: "sun-glare", label: "Sun Glare", category: "light", description: "Sun glare washes frame",
|
|
264
477
|
promptHint: "intense warm glare floods the lens from one corner of the frame, blooming and scattering flares until the whole picture is washed out to a bright haze. The camera stays where it is and the framing does not change. As the glare fades, the second shot emerges through the haze. The shot ends on the second shot, clear and fully resolved, with no glare left. The glare comes from the lens itself, and the second shot appears only as the haze clears" },
|
|
265
478
|
{ id: "lens-crack", label: "Lens Crack", category: "light", description: "Lens cracks, scene through fractured glass",
|
|
@@ -277,15 +490,15 @@ export const TRANSITIONS: ReadonlyArray<Transition> = [
|
|
|
277
490
|
{ id: "vhs-rewind", label: "VHS Rewind", category: "glitch", description: "VHS tracking distortion",
|
|
278
491
|
promptHint: "VHS-style tracking distortion and tape-rewind artifacts sweep the frame with horizontal scanline noise, then resolve into the new scene as if rewinding to a different recording" },
|
|
279
492
|
{ id: "datamosh", label: "Datamosh", category: "glitch", description: "Motion-vector smear bleeds scenes",
|
|
280
|
-
promptHint: "datamosh transition: the
|
|
493
|
+
promptHint: "datamosh transition: the first shot's pixels tear loose in square compression blocks and slide sideways across the frame in long smeared streaks. The camera stays where it is and the framing does not change. The blocks pile up into the shapes of the second shot, still in the first shot's colours, until the true colours snap in block by block. The shot ends on the second shot, sharp and fully resolved, with no smears or blocks left. The smear covers the whole frame" },
|
|
281
494
|
{ id: "channel-flip", label: "Channel Flip", category: "glitch", description: "TV channel flip with static",
|
|
282
|
-
promptHint: "a brief burst of
|
|
495
|
+
promptHint: "the whole picture breaks into a brief burst of black-and-white static, the image jumping and tearing as if the channel were being changed. The camera stays where it is and the framing does not change. The static clears as quickly as it came, and the second shot snaps in, steady, like the next channel. The shot ends on the second shot, clean and fully resolved, with no static left. The static covers the whole frame, so the picture itself is what changes channel", term: "tv channel flip with static" },
|
|
283
496
|
{ id: "hologram-flicker", label: "Hologram Flicker", category: "glitch", description: "Hologram-style flicker materialises new scene",
|
|
284
|
-
promptHint: "
|
|
497
|
+
promptHint: "the first shot breaks into thin lines of cyan light that flicker out from the top down, leaving the frame black. The camera stays where it is and the framing does not change. A bright scan line sweeps down and draws the second shot behind it in flickering cyan lines that steady into natural colour. The shot ends on the second shot, solid and fully resolved, with no scan lines left. The second shot is drawn only on black, never over the first shot" },
|
|
285
498
|
{ id: "display-wipe", label: "Display Wipe", category: "glitch", description: "Scene compresses into display, expands to new scene",
|
|
286
|
-
promptHint: "the first
|
|
499
|
+
promptHint: "the whole first shot shrinks toward the centre of the frame into a small glowing rectangle, then collapses to a bright line and a dot as if its power were cut. The camera stays where it is and the framing does not change. From the dot a line snaps open and widens into a rectangle showing the second shot, which grows until it fills the frame. The shot ends on the second shot, full frame and fully resolved, with no border or scanlines left. The picture itself shrinks and grows on a black field, with the camera holding still throughout", term: "compress into a screen and expand out" },
|
|
287
500
|
{ id: "double-exposure", label: "Double Exposure", category: "glitch", description: "Two scenes overlay translucent, first fades to second",
|
|
288
|
-
promptHint: "the first
|
|
501
|
+
promptHint: "the first subject becomes a crisp silhouette filled solid with the second shot, while the rest of the first shot stays untouched around it. The camera stays where it is and the framing does not change. The silhouette holds for a clear beat, both pictures plainly seen at once, then the first shot around it gives way to the second shot. The shot ends on the second shot alone, fully resolved" },
|
|
289
502
|
]
|
|
290
503
|
|
|
291
504
|
export const TRANSITION_CATEGORY_ORDER: ReadonlyArray<TransitionCategory> = [
|
|
@@ -319,8 +532,54 @@ export function getTransitionLabel(id: string | undefined | null, fallback?: str
|
|
|
319
532
|
return (id ?? "").replace(/-/g, " ").replace(/\b\w/g, (c) => c.toUpperCase())
|
|
320
533
|
}
|
|
321
534
|
|
|
322
|
-
|
|
323
|
-
|
|
535
|
+
/**
|
|
536
|
+
* The row's hint. With `values`, a row that declares `options` is written with
|
|
537
|
+
* the chosen choices in its template (an absent or unknown choice reads as
|
|
538
|
+
* `auto`, which IS `promptHint`); every other row ignores them.
|
|
539
|
+
*
|
|
540
|
+
* A catalog pack that REWROTE the row's hint owns its words: its text has no
|
|
541
|
+
* token to fill, so it is returned as written and the options add nothing.
|
|
542
|
+
*/
|
|
543
|
+
export function getTransitionPromptHint(
|
|
544
|
+
id: string | undefined | null,
|
|
545
|
+
values?: TransitionOptionValues,
|
|
546
|
+
): string {
|
|
547
|
+
const t = getTransition(id)
|
|
548
|
+
if (!t) return ""
|
|
549
|
+
if (!values || !t.promptTemplate || !t.options?.length) return t.promptHint
|
|
550
|
+
if (t.promptHint !== fillOptionSlots(t.promptTemplate, t.options)) return t.promptHint
|
|
551
|
+
return fillOptionSlots(t.promptTemplate, t.options, values)
|
|
552
|
+
}
|
|
553
|
+
|
|
554
|
+
/** The per-row options a transition declares (`[]` for most rows, an unknown
|
|
555
|
+
* id and `auto`). Reads through `getTransition`, like every other getter. */
|
|
556
|
+
export function getTransitionOptions(
|
|
557
|
+
id: string | undefined | null,
|
|
558
|
+
): ReadonlyArray<TransitionOption> {
|
|
559
|
+
return getTransition(id)?.options ?? []
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
/** Every option field any row declares, in catalog order — what a node-data
|
|
563
|
+
* reader collects into `TransitionOptionValues`. */
|
|
564
|
+
export const TRANSITION_OPTION_FIELDS: ReadonlyArray<string> = Array.from(
|
|
565
|
+
new Set(TRANSITIONS.flatMap((t) => (t.options ?? []).map((o) => o.field))),
|
|
566
|
+
)
|
|
567
|
+
|
|
568
|
+
/**
|
|
569
|
+
* Collect `TransitionOptionValues` from a node-data-shaped record: every
|
|
570
|
+
* declared option field whose value is a non-empty string. Validation against
|
|
571
|
+
* a row's choices happens at render (an unknown id reads as `auto`).
|
|
572
|
+
*/
|
|
573
|
+
export function readTransitionOptionValues(
|
|
574
|
+
data: Readonly<Record<string, unknown>> | undefined | null,
|
|
575
|
+
): TransitionOptionValues | undefined {
|
|
576
|
+
if (!data) return undefined
|
|
577
|
+
const out: Record<string, string> = {}
|
|
578
|
+
for (const field of TRANSITION_OPTION_FIELDS) {
|
|
579
|
+
const v = data[field]
|
|
580
|
+
if (typeof v === "string" && v.length > 0) out[field] = v
|
|
581
|
+
}
|
|
582
|
+
return Object.keys(out).length > 0 ? out : undefined
|
|
324
583
|
}
|
|
325
584
|
|
|
326
585
|
/**
|
|
@@ -385,8 +644,8 @@ const normalizePhrase = (s: string): string => s.trim().toLowerCase().replace(/\
|
|
|
385
644
|
* any comma-separated item that merely restates the term dropped (`none`'s
|
|
386
645
|
* "no transition, hard cut, instantaneous switch …" loses its "hard cut").
|
|
387
646
|
*/
|
|
388
|
-
function transitionHintBody(id: string, term: string): string {
|
|
389
|
-
const hint = getTransitionPromptHint(id).replace(LEADING_LABEL, "").trim()
|
|
647
|
+
function transitionHintBody(id: string, term: string, values?: TransitionOptionValues): string {
|
|
648
|
+
const hint = getTransitionPromptHint(id, values).replace(LEADING_LABEL, "").trim()
|
|
390
649
|
const t = normalizePhrase(term)
|
|
391
650
|
return hint
|
|
392
651
|
.split(/,\s*/)
|
|
@@ -403,10 +662,10 @@ function transitionHintBody(id: string, term: string): string {
|
|
|
403
662
|
* `; INSTANT_CUT_CLAUSE` inside the parentheses. A row whose hint is just its
|
|
404
663
|
* term (or empty) renders as the term alone; an unknown id or "auto" as "".
|
|
405
664
|
*/
|
|
406
|
-
function transitionFragment(id: string, withCutClause: boolean): string {
|
|
665
|
+
function transitionFragment(id: string, withCutClause: boolean, values?: TransitionOptionValues): string {
|
|
407
666
|
const term = getTransitionTerm(id)
|
|
408
667
|
if (!term) return ""
|
|
409
|
-
const inner = [transitionHintBody(id, term), withCutClause ? INSTANT_CUT_CLAUSE : ""]
|
|
668
|
+
const inner = [transitionHintBody(id, term, values), withCutClause ? INSTANT_CUT_CLAUSE : ""]
|
|
410
669
|
.filter((part) => part.length > 0)
|
|
411
670
|
.join("; ")
|
|
412
671
|
return inner.length > 0 && normalizePhrase(inner) !== normalizePhrase(term)
|
|
@@ -436,16 +695,21 @@ function transitionFragment(id: string, withCutClause: boolean): string {
|
|
|
436
695
|
* Studio's transition clauses) and the direction registry's `transition` row
|
|
437
696
|
* (the server fold of `direction.transition`), so both paths word a transition
|
|
438
697
|
* identically.
|
|
698
|
+
*
|
|
699
|
+
* `values` are the per-row option choices (`TransitionOptionValues`) — a wipe's
|
|
700
|
+
* direction. The direction registry passes none, so a `direction.transition`
|
|
701
|
+
* wipe reads as `auto`.
|
|
439
702
|
*/
|
|
440
703
|
export function renderTransitionBases(
|
|
441
704
|
ids: ReadonlyArray<string>,
|
|
442
705
|
_mode: PickerHintMode = "full",
|
|
706
|
+
values?: TransitionOptionValues,
|
|
443
707
|
): string[] {
|
|
444
708
|
// Only ids that contribute a fragment count — a no-op "auto" beside a cut
|
|
445
709
|
// must not make the pick look non-instant.
|
|
446
710
|
const picked = ids.filter((id) => getTransitionTerm(id).length > 0)
|
|
447
711
|
const instant = isInstantTransition(picked)
|
|
448
|
-
return picked.map((id, i) => transitionFragment(id, instant && i === 0))
|
|
712
|
+
return picked.map((id, i) => transitionFragment(id, instant && i === 0, values))
|
|
449
713
|
}
|
|
450
714
|
|
|
451
715
|
// ---------------------------------------------------------------------------
|
|
@@ -528,6 +792,9 @@ export type TransitionHintScope = "clip" | "shot"
|
|
|
528
792
|
|
|
529
793
|
export interface TransitionHintOptions {
|
|
530
794
|
readonly scope?: TransitionHintScope
|
|
795
|
+
/** The per-row option choices (a wipe's `wipeDirection`) — see
|
|
796
|
+
* `Transition.options`. Absent, every row reads as `auto`. */
|
|
797
|
+
readonly optionValues?: TransitionOptionValues
|
|
531
798
|
}
|
|
532
799
|
|
|
533
800
|
/**
|
|
@@ -571,7 +838,9 @@ const INTENSITY_CLAUSES = clausesOf(TRANSITION_INTENSITIES)
|
|
|
571
838
|
* @param options `scope: "shot"` when the hint is folded into one shot's time
|
|
572
839
|
* window of a multi-shot prompt — the position clause then says "of this
|
|
573
840
|
* shot" instead of "of the clip" (and `full`, on a non-cut, "spans this
|
|
574
|
-
* entire shot"). Omitted, the wording is the clip's.
|
|
841
|
+
* entire shot"). Omitted, the wording is the clip's. `optionValues` are the
|
|
842
|
+
* per-row option choices (a wipe's direction), written into the row's own
|
|
843
|
+
* description; omitted, every row reads as `auto`.
|
|
575
844
|
*/
|
|
576
845
|
export function composeTransitionHintFromConnections(
|
|
577
846
|
transitionId: string | ReadonlyArray<string> | undefined,
|
|
@@ -584,7 +853,7 @@ export function composeTransitionHintFromConnections(
|
|
|
584
853
|
const ids = Array.isArray(transitionId)
|
|
585
854
|
? Array.from(new Set(transitionId)).slice(0, 2)
|
|
586
855
|
: transitionId ? [transitionId] : []
|
|
587
|
-
const baseHints = renderTransitionBases(ids, mode)
|
|
856
|
+
const baseHints = renderTransitionBases(ids, mode, options?.optionValues)
|
|
588
857
|
if (baseHints.length === 0) return ""
|
|
589
858
|
// Same "contributes a fragment" filter `renderTransitionBases` applies.
|
|
590
859
|
const instant = isInstantTransition(ids.filter((id) => getTransitionTerm(id).length > 0))
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A video node's OWN Motion setting (`motionEnabled` + `motion`) as the clause
|
|
3
|
+
* its prompt carries, e.g. "dynamic motion".
|
|
4
|
+
*
|
|
5
|
+
* Only the node types that offer the setting add it: the legacy Image to Video
|
|
6
|
+
* node, and Generate Video in either mode (with or without a start frame). A
|
|
7
|
+
* legacy Text to Video node has no such setting. `nodeType` is the node's REAL
|
|
8
|
+
* type: the editor re-types Generate Video to image-to-video / text-to-video
|
|
9
|
+
* before composing, so a re-typed node must still pass "generate-video". The
|
|
10
|
+
* editor applied it only with a start frame while workflow runs applied it
|
|
11
|
+
* always; one rule for both is what keeps them in step.
|
|
12
|
+
*
|
|
13
|
+
* Separate from the Motion node wired into a Settings input, whose clause comes
|
|
14
|
+
* from `getParameterPromptHint` through the cinematography collectors.
|
|
15
|
+
*/
|
|
16
|
+
export const OWN_MOTION_NODE_TYPES: ReadonlySet<string> = new Set(["image-to-video", "generate-video"])
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* The step the Motion control shows before one is picked, and so the step an
|
|
20
|
+
* enabled setting runs with when none is stored. Ticking the checkbox stores
|
|
21
|
+
* no step, so the prompt used to get nothing while the panel showed Moderate.
|
|
22
|
+
*/
|
|
23
|
+
export const DEFAULT_OWN_MOTION = "moderate"
|
|
24
|
+
|
|
25
|
+
export function ownMotionHint(nodeType: string, data: Readonly<Record<string, unknown>>): string | undefined {
|
|
26
|
+
if (!OWN_MOTION_NODE_TYPES.has(nodeType) || !data.motionEnabled) return undefined
|
|
27
|
+
const step = typeof data.motion === "string" && data.motion ? data.motion : DEFAULT_OWN_MOTION
|
|
28
|
+
return `${step} motion`
|
|
29
|
+
}
|