rvlib-shipkit 2.20.0 → 2.21.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/CHANGELOG.md +16 -0
- package/package.json +1 -1
- package/src/checks/SK004-gitignore-policy.check.ts +6 -3
- package/src/cli/cmd_GlobalProcesses.ts +2 -107
- package/src/cli/cmd_Home.ts +1 -1
- package/src/cli/cmd_Overview.ts +2 -1
- package/src/cli/cmd_Releases.ts +39 -3
- package/src/cli/cmd_Review.ts +22 -13
- package/src/cli/cmd_Social.ts +13 -7
- package/src/cli/cmd_Sound.ts +17 -4
- package/src/cli/cmd_Trailer.ts +67 -1
- package/src/cli/registry.ts +2 -1
- package/src/collections/collection-types.ts +1 -1
- package/src/collections/review.ts +23 -4
- package/src/core/layout.ts +6 -0
- package/src/home/gui-app/ShipkitGui.swift +35 -0
- package/src/home/gui-app.ts +1 -0
- package/src/home/pm-switch.ts +112 -0
- package/src/identities/identities.ts +11 -6
- package/src/messages/brief.ts +3 -3
- package/src/messages/score.ts +2 -0
- package/src/releases/add.ts +33 -5
- package/src/releases/before.ts +31 -0
- package/src/releases/from-card.ts +104 -19
- package/src/releases/model.ts +73 -13
- package/src/releases/pictures.ts +29 -8
- package/src/review/http.ts +1 -1
- package/src/review/model.ts +12 -2
- package/src/review/stage-card.ts +1 -1
- package/src/review/store.ts +12 -2
- package/src/review/trailer-desk.ts +19 -0
- package/src/review/trailer-model.ts +65 -0
- package/src/review/trailer-routes.ts +98 -1
- package/src/review/trailer-voices.ts +144 -0
- package/src/review/watchers.ts +58 -1
- package/src/serve/hub-app/benign-errors.ts +22 -0
- package/src/serve/hub-app/hash-route.ts +27 -15
- package/src/serve/hub-app/home-st.ts +8 -0
- package/src/serve/hub-app/hub-app.tsx +2 -0
- package/src/serve/hub-app/project-list.css +7 -2
- package/src/serve/hub-app/project-list.tsx +9 -0
- package/src/serve/hub-app/projects-svc.ts +16 -6
- package/src/serve/hub-app/releases/releases-page.tsx +121 -28
- package/src/serve/hub-app/releases/releases-st.ts +46 -4
- package/src/serve/hub-app/releases.css +30 -3
- package/src/serve/hub-app/repo-sections.ts +1 -1
- package/src/serve/hub-app/repo-st.ts +15 -10
- package/src/serve/hub-app/review/clip-st.ts +3 -1
- package/src/serve/hub-app/review/kit.tsx +3 -3
- package/src/serve/hub-app/review/trailer-page.tsx +31 -6
- package/src/serve/hub-app/review/trailer-st.ts +168 -8
- package/src/serve/hub-app/review/trailer-timeline.tsx +36 -4
- package/src/serve/hub-app/review/trailer-voices-st.ts +370 -0
- package/src/serve/hub-app/review/trailer-voices.tsx +574 -0
- package/src/serve/hub-app/review.css +88 -0
- package/src/serve/hub-app/social/comms-page.tsx +10 -5
- package/src/serve/hub-app/social/next-release.tsx +118 -0
- package/src/serve/hub-app/social/social-model.ts +2 -0
- package/src/serve/hub-app/social/social-st.ts +38 -1
- package/src/serve/hub-app/social.css +8 -0
- package/src/serve/hub-app/tree-build.ts +2 -0
- package/src/serve/project-gutter-route.ts +8 -0
- package/src/serve/project-gutter.ts +4 -2
- package/src/shot/box.ts +33 -12
- package/src/shot/client.ts +1 -1
- package/src/shot/shooter.ts +19 -9
- package/src/social/desk-index.ts +49 -8
- package/src/social/discord-layout.ts +6 -2
- package/src/social/drafts.ts +1 -1
- package/src/social/kinds.ts +3 -2
- package/src/social/load.ts +26 -7
- package/src/social/publish/index.ts +24 -9
- package/src/social/release-stage.ts +133 -29
- package/src/social/routes.ts +2 -1
- package/src/social/stage.ts +39 -20
- package/src/trailer/bed.ts +111 -0
- package/src/trailer/build.ts +57 -38
- package/src/trailer/ffmpeg.ts +6 -0
- package/src/trailer/grammar.ts +23 -2
- package/src/trailer/graph.ts +12 -1
- package/src/trailer/shot-plan.ts +75 -0
- package/src/trailer/shot-state.ts +191 -0
- package/src/trailer/sound/audio.ts +28 -0
- package/src/trailer/sound/brand.ts +53 -3
- package/src/trailer/sound/gen.ts +61 -2
- package/src/trailer/sound/index.ts +25 -11
- package/src/trailer/sound/presets.ts +86 -5
- package/src/trailer/sound/run.ts +1 -1
- package/src/trailer/sound/takes.ts +94 -0
- package/src/trailer/titles.ts +36 -0
- package/src/trailer/url.ts +1 -1
|
@@ -20,11 +20,14 @@ import {
|
|
|
20
20
|
type TrailerDesk,
|
|
21
21
|
type TrailerInfo,
|
|
22
22
|
type TrailerNote,
|
|
23
|
+
type VoicesDesk,
|
|
23
24
|
} from '../../../review/trailer-model.ts'
|
|
24
25
|
import { reach } from '../reach.ts'
|
|
25
26
|
import type { RepoSt } from '../repo-st.ts'
|
|
26
27
|
import { ClipSt } from './clip-st.ts'
|
|
28
|
+
import { VoicesSt } from './trailer-voices-st.ts'
|
|
27
29
|
import { LIT_S } from '../../../review/trailer-notes.ts'
|
|
30
|
+
import type { CutStates } from '../../../trailer/shot-state.ts'
|
|
28
31
|
|
|
29
32
|
const POLL_MS = 3000
|
|
30
33
|
|
|
@@ -57,6 +60,18 @@ export interface PlacedNote {
|
|
|
57
60
|
|
|
58
61
|
type NoteFilter = 'open' | 'all'
|
|
59
62
|
|
|
63
|
+
/** the whole cut with his takes (the standin where he made none), or with the standin on every line */
|
|
64
|
+
export type VoiceSide = 'takes' | 'standin'
|
|
65
|
+
|
|
66
|
+
/** who reads a working cut's lines of his voice, for the render on screen (`at`) */
|
|
67
|
+
export interface OwnVoice {
|
|
68
|
+
at: string
|
|
69
|
+
who: string
|
|
70
|
+
standin: string
|
|
71
|
+
/** the brand plays his takes */
|
|
72
|
+
takes: boolean
|
|
73
|
+
}
|
|
74
|
+
|
|
60
75
|
const ZOOMS = [1, 1.5, 2, 3, 4, 6, 8, 12, 16] as const
|
|
61
76
|
|
|
62
77
|
/** the caption's text as the title draws it: `\n` in the file is a line break */
|
|
@@ -101,10 +116,22 @@ export class TrailerSt {
|
|
|
101
116
|
/** the montage page of the cut on screen, its markdown, once asked */
|
|
102
117
|
montage: { key: string; md: string | null } | null = null
|
|
103
118
|
montageOpen = false
|
|
119
|
+
/** the voice side he picked; null: the brand's */
|
|
120
|
+
voiceSide: VoiceSide | null = null
|
|
121
|
+
/** the cut on screen's lines of his voice; null while unknown or when it has none */
|
|
122
|
+
own: OwnVoice | null = null
|
|
123
|
+
/** the side asked for the render on screen: its file's key once made, or why it is refused */
|
|
124
|
+
voiced: { id: string; key: string | null; error: string | null } | null = null
|
|
125
|
+
/** the last side made for a render, on screen while the next is made */
|
|
126
|
+
private lastVoiced: { at: string; key: string } | null = null
|
|
127
|
+
/** a play asked while the side was being made: it plays once it is */
|
|
128
|
+
private held = false
|
|
104
129
|
private landing: { shot: string; offset: number; play: boolean } | null = null
|
|
105
130
|
private noteLanding: string | null = null
|
|
106
131
|
private timer: ReturnType<typeof setInterval> | null = null
|
|
107
132
|
private readonly prefs: string
|
|
133
|
+
/** the Voices view: the lines of the trailer, his takes, his microphone */
|
|
134
|
+
readonly voices: VoicesSt
|
|
108
135
|
|
|
109
136
|
constructor(
|
|
110
137
|
private readonly st: RepoSt,
|
|
@@ -112,19 +139,21 @@ export class TrailerSt {
|
|
|
112
139
|
readonly card: { id: string; spec: TrailerCard; lane: () => LaneMark[] } | null = null,
|
|
113
140
|
) {
|
|
114
141
|
this.prefs = `shipkit.trailer.${st.key}`
|
|
142
|
+
this.voices = new VoicesSt(st, () => this.trailer?.id ?? null)
|
|
115
143
|
if (card) {
|
|
116
144
|
this.trailerId = card.spec.trailer
|
|
117
145
|
this.cutId = card.spec.after.cut
|
|
118
146
|
}
|
|
119
147
|
try {
|
|
120
|
-
const p = JSON.parse(localStorage.getItem(this.prefs) ?? '{}') as { zoom?: number; filter?: NoteFilter; rate?: number }
|
|
148
|
+
const p = JSON.parse(localStorage.getItem(this.prefs) ?? '{}') as { zoom?: number; filter?: NoteFilter; rate?: number; voice?: VoiceSide }
|
|
121
149
|
if (p.zoom && ZOOMS.includes(p.zoom as never)) this.zoom = p.zoom
|
|
122
150
|
if (p.filter === 'open' || p.filter === 'all') this.filter = p.filter
|
|
123
151
|
if (p.rate) this.clock.setRate(p.rate)
|
|
152
|
+
if (p.voice === 'takes' || p.voice === 'standin') this.voiceSide = p.voice
|
|
124
153
|
} catch {
|
|
125
154
|
// a blocked storage only loses the kept choices
|
|
126
155
|
}
|
|
127
|
-
makeAutoObservable<this, 'st' | 'landing' | 'timer' | 'prefs' | 'noteLanding'>(this, { st: false, card: false, clock: false, shown: observableRef, landing: false, timer: false, prefs: false, noteLanding: false })
|
|
156
|
+
makeAutoObservable<this, 'st' | 'landing' | 'timer' | 'prefs' | 'noteLanding' | 'held'>(this, { st: false, card: false, clock: false, voices: false, shown: observableRef, landing: false, timer: false, prefs: false, noteLanding: false, held: false })
|
|
128
157
|
// a trailer is heard: the clock starts with its sound on
|
|
129
158
|
this.clock.hear(true)
|
|
130
159
|
// a card plays its pinned render from the start; no address is its own
|
|
@@ -152,8 +181,32 @@ export class TrailerSt {
|
|
|
152
181
|
() => [this.shown?.version ?? null, this.notes.length] as const,
|
|
153
182
|
() => this.landOnNote(),
|
|
154
183
|
)
|
|
184
|
+
// the render on screen, or the page back from Voices (a take recorded, edited): who reads its lines, read again
|
|
155
185
|
reaction(
|
|
156
|
-
() =>
|
|
186
|
+
() => [this.shownAt, this.voices.on] as const,
|
|
187
|
+
([, voicesOn]) => void (voicesOn ? undefined : this.readOwn()),
|
|
188
|
+
{ fireImmediately: true },
|
|
189
|
+
)
|
|
190
|
+
// a side flipped, or known at last: its file asked for
|
|
191
|
+
reaction(
|
|
192
|
+
() => this.voicedId,
|
|
193
|
+
() => void this.askVoiced(),
|
|
194
|
+
)
|
|
195
|
+
// nothing of the other side plays: a play while the side is made or refused waits, and plays once it is made
|
|
196
|
+
reaction(
|
|
197
|
+
() => [this.voicing, this.voiceError !== null, this.clock.paused] as const,
|
|
198
|
+
([making, refused, paused]) => {
|
|
199
|
+
if ((making || refused) && !paused) {
|
|
200
|
+
this.held = making
|
|
201
|
+
this.clock.pause()
|
|
202
|
+
} else if (!making && !refused && this.held) {
|
|
203
|
+
this.held = false
|
|
204
|
+
if (paused) this.clock.play()
|
|
205
|
+
}
|
|
206
|
+
},
|
|
207
|
+
)
|
|
208
|
+
reaction(
|
|
209
|
+
() => JSON.stringify({ zoom: this.zoom, filter: this.filter, rate: this.clock.rate, ...(this.voiceSide ? { voice: this.voiceSide } : {}) }),
|
|
157
210
|
(s) => {
|
|
158
211
|
try {
|
|
159
212
|
localStorage.setItem(this.prefs, s)
|
|
@@ -173,9 +226,11 @@ export class TrailerSt {
|
|
|
173
226
|
if (this.timer !== null) clearInterval(this.timer)
|
|
174
227
|
this.timer = null
|
|
175
228
|
if (!this.clock.paused) this.clock.pause()
|
|
229
|
+
void this.voices.cancel()
|
|
176
230
|
}
|
|
177
231
|
|
|
178
232
|
async refresh(): Promise<void> {
|
|
233
|
+
if (!this.card) void this.voices.refresh()
|
|
179
234
|
try {
|
|
180
235
|
const desk = await send<TrailerDesk>(this.st.url('/api/trailer'), 'GET')
|
|
181
236
|
runInAction(() => {
|
|
@@ -200,6 +255,18 @@ export class TrailerSt {
|
|
|
200
255
|
return cuts.find((c) => c.cut === this.cutId) ?? latestCut(cuts) ?? cuts.find((c) => c.video !== null) ?? cuts[0] ?? null
|
|
201
256
|
}
|
|
202
257
|
|
|
258
|
+
/** each shot of the cut on screen in plain words, and the summary (trailer/shot-state.ts); none on a card, whose
|
|
259
|
+
* renders are pinned history */
|
|
260
|
+
get shotStates(): CutStates | null {
|
|
261
|
+
const c = this.cut
|
|
262
|
+
return this.card || !c || this.shown?.cut !== c.cut ? null : c.shots
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
/** a card a shot waits on, opened in the review page */
|
|
266
|
+
openCard(id: string): void {
|
|
267
|
+
this.st.showReview(id)
|
|
268
|
+
}
|
|
269
|
+
|
|
203
270
|
/** a finished render newer than the one on screen */
|
|
204
271
|
get newer(): boolean {
|
|
205
272
|
const v = this.cut?.video
|
|
@@ -208,7 +275,11 @@ export class TrailerSt {
|
|
|
208
275
|
|
|
209
276
|
/** the cut the address names, the note open on it (the player lands on its frame), the notes filter; an address
|
|
210
277
|
* with no filter keeps the one the page remembers */
|
|
211
|
-
select(trailer: string | null, cut: string | null, note: string | null = null, filter: NoteFilter | null = null): void {
|
|
278
|
+
select(trailer: string | null, cut: string | null, note: string | null = null, filter: NoteFilter | null = null, voices?: string): void {
|
|
279
|
+
// the Voices view rides on the address: '' is the view on its first line
|
|
280
|
+
if (voices === undefined) {
|
|
281
|
+
if (this.voices.on) this.voices.show(false)
|
|
282
|
+
} else this.voices.open(voices || null)
|
|
212
283
|
if (cut !== this.cutId || trailer !== this.trailerId) {
|
|
213
284
|
this.draft = null
|
|
214
285
|
this.editing = null
|
|
@@ -224,8 +295,9 @@ export class TrailerSt {
|
|
|
224
295
|
}
|
|
225
296
|
|
|
226
297
|
/** what the address carries of this page; RepoSt.setSel writes it, the one place an address is written */
|
|
227
|
-
get address(): { t: 'trailer'; trailer: string | null; cut: string | null; note: string | null; filter: NoteFilter | null } {
|
|
228
|
-
|
|
298
|
+
get address(): { t: 'trailer'; trailer: string | null; cut: string | null; note: string | null; filter: NoteFilter | null; voices?: string } {
|
|
299
|
+
const v = this.voices
|
|
300
|
+
return { t: 'trailer', trailer: this.trailerId, cut: this.cutId, note: this.selected, filter: this.filter === 'all' ? null : this.filter, ...(v.on ? { voices: v.openKey ?? '' } : {}) }
|
|
229
301
|
}
|
|
230
302
|
|
|
231
303
|
/** the note an address opened: the player lands on its frame once the cut on screen places it */
|
|
@@ -244,7 +316,9 @@ export class TrailerSt {
|
|
|
244
316
|
if (cut !== null) this.side(cut)
|
|
245
317
|
return
|
|
246
318
|
}
|
|
247
|
-
|
|
319
|
+
// a cut picked plays it; a trailer picked keeps the view on screen
|
|
320
|
+
const voices = cut === null && this.voices.on ? '' : undefined
|
|
321
|
+
this.st.showTrailer(trailer, cut, trailer === this.trailerId ? this.selected : null, this.filter === 'all' ? null : this.filter, voices)
|
|
248
322
|
}
|
|
249
323
|
|
|
250
324
|
showCurrent(): void {
|
|
@@ -342,9 +416,94 @@ export class TrailerSt {
|
|
|
342
416
|
this.showCurrent()
|
|
343
417
|
}
|
|
344
418
|
|
|
419
|
+
/** the render on screen, the cut with the side he hears once it is made (its picture is the render's) */
|
|
345
420
|
get videoUrl(): string | null {
|
|
346
421
|
const s = this.shown
|
|
347
|
-
|
|
422
|
+
if (!s) return null
|
|
423
|
+
// a side being made keeps the last side's file on screen, paused: the same picture, no reload
|
|
424
|
+
const v = this.voiced
|
|
425
|
+
const key = v && v.id === this.voicedId && v.key ? v.key : this.lastVoiced?.at === this.shownAt ? this.lastVoiced.key : null
|
|
426
|
+
return key ? this.st.url(`/api/trailer/voiced/${key}.mp4`) : this.st.url(`/api/trailer/video/${s.trailer}/${s.cut}/${s.version}.mp4`)
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
// ── his voice or the standin's (wiki tools/trailer/trailer-sound.md, Your own voice) ──
|
|
430
|
+
|
|
431
|
+
private get shownAt(): string | null {
|
|
432
|
+
const s = this.shown
|
|
433
|
+
return s && !this.card ? `${s.trailer}/${s.cut}/${s.version}` : null
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
/** the lines of his voice of the render on screen; null when it has none */
|
|
437
|
+
get ownHere(): OwnVoice | null {
|
|
438
|
+
return this.own && this.own.at === this.shownAt ? this.own : null
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
/** the side heard: his pick, else the brand's; null when the cut has no line of his voice */
|
|
442
|
+
get heard(): VoiceSide | null {
|
|
443
|
+
const o = this.ownHere
|
|
444
|
+
return o ? (this.voiceSide ?? (o.takes ? 'takes' : 'standin')) : null
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
private get voicedId(): string | null {
|
|
448
|
+
const at = this.shownAt
|
|
449
|
+
return at && this.heard ? `${at}/${this.heard}` : null
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
/** the side heard is still being made */
|
|
453
|
+
get voicing(): boolean {
|
|
454
|
+
const id = this.voicedId
|
|
455
|
+
return id !== null && (this.voiced?.id !== id || (this.voiced.key === null && this.voiced.error === null))
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
/** why the side heard cannot play */
|
|
459
|
+
get voiceError(): string | null {
|
|
460
|
+
return this.voiced && this.voiced.id === this.voicedId ? this.voiced.error : null
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
setVoice(side: VoiceSide): void {
|
|
464
|
+
this.voiceSide = side
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
/** who reads the cut on screen's lines: the trailer's Voices, its uses on this cut */
|
|
468
|
+
private async readOwn(): Promise<void> {
|
|
469
|
+
const at = this.shownAt
|
|
470
|
+
const s = this.shown
|
|
471
|
+
const cut = this.cut
|
|
472
|
+
if (!at || !s || cut?.cut !== s.cut || cut.version || !cut.files.trailer) {
|
|
473
|
+
this.own = null
|
|
474
|
+
return
|
|
475
|
+
}
|
|
476
|
+
try {
|
|
477
|
+
const d = await send<VoicesDesk>(this.st.url(`/api/trailer/voices/${s.trailer}`), 'GET')
|
|
478
|
+
const use = d.lines.flatMap((l) => l.uses).find((u) => u.cut === s.cut && u.mine)
|
|
479
|
+
const had = this.voiced?.id ?? null
|
|
480
|
+
runInAction(() => {
|
|
481
|
+
this.own = use && d.recorder ? { at, who: d.recorder.who, standin: use.standin?.name ?? "the brand's voice", takes: d.recorder.takes } : null
|
|
482
|
+
})
|
|
483
|
+
// back from Voices: the same side asked again, a take made since changes its file
|
|
484
|
+
if (had !== null && had === this.voicedId) void this.askVoiced()
|
|
485
|
+
} catch (e) {
|
|
486
|
+
runInAction(() => (this.error = `voices: ${(e as Error).message}`))
|
|
487
|
+
}
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
/** the side heard, made on the hub when it is not yet; the file on screen stays until the new one is made */
|
|
491
|
+
private async askVoiced(): Promise<void> {
|
|
492
|
+
const id = this.voicedId
|
|
493
|
+
if (!id) return
|
|
494
|
+
const was = this.voiced
|
|
495
|
+
if (was?.key && this.shownAt) this.lastVoiced = { at: this.shownAt, key: was.key }
|
|
496
|
+
if (was?.id !== id) this.voiced = { id, key: null, error: null }
|
|
497
|
+
try {
|
|
498
|
+
const r = await send<{ key: string }>(this.st.url(`/api/trailer/voiced/${id}`), 'GET')
|
|
499
|
+
runInAction(() => {
|
|
500
|
+
if (this.voiced?.id === id) this.voiced = { id, key: r.key, error: null }
|
|
501
|
+
})
|
|
502
|
+
} catch (e) {
|
|
503
|
+
runInAction(() => {
|
|
504
|
+
if (this.voiced?.id === id) this.voiced = { id, key: null, error: (e as Error).message }
|
|
505
|
+
})
|
|
506
|
+
}
|
|
348
507
|
}
|
|
349
508
|
|
|
350
509
|
get stripUrl(): string | null {
|
|
@@ -689,6 +848,7 @@ export class TrailerSt {
|
|
|
689
848
|
* note), N a note on this frame, M the sound, - and + the timeline's zoom, Home the start. Arrows and plain keys,
|
|
690
849
|
* so an AZERTY keyboard reaches every one */
|
|
691
850
|
key(e: Pick<KeyboardEvent, 'key' | 'shiftKey'>): boolean {
|
|
851
|
+
if (this.voices.on) return this.voices.key(e)
|
|
692
852
|
const k = e.key.toLowerCase()
|
|
693
853
|
if (e.key === ' ') {
|
|
694
854
|
// a focused button would click again on the key's release
|
|
@@ -5,6 +5,7 @@ import { observer } from 'mobx-react-lite'
|
|
|
5
5
|
import { useEffect, useRef, useState, type CSSProperties, type RefObject } from 'react'
|
|
6
6
|
import { clock, shotAt, type LaneMark, type ShotSpan, type Timeline } from '../../../review/trailer-model.ts'
|
|
7
7
|
import { captionText, type TrailerSt } from './trailer-st.ts'
|
|
8
|
+
import type { ShotStatus } from '../../../trailer/shot-state.ts'
|
|
8
9
|
|
|
9
10
|
const RULER = 18
|
|
10
11
|
const SECTIONS = 22
|
|
@@ -115,7 +116,7 @@ export const TrailerTimeline = observer(({ st }: { st: TrailerSt }) => {
|
|
|
115
116
|
{s.name}
|
|
116
117
|
</div>
|
|
117
118
|
))}
|
|
118
|
-
{tl.shots.map((s, i) => <ShotBlock key={`${s.name}@${i}`} s={s} i={i} x={xOf(s.start)} w={xOf(s.end) - xOf(s.start)} on={cur === s} hue={hueOf(tl, s.section)} changed={st.changed.has(s.name)} />)}
|
|
119
|
+
{tl.shots.map((s, i) => <ShotBlock key={`${s.name}@${i}`} s={s} i={i} x={xOf(s.start)} w={xOf(s.end) - xOf(s.start)} on={cur === s} hue={hueOf(tl, s.section)} changed={st.changed.has(s.name)} status={st.shotStates?.states[s.name]} />)}
|
|
119
120
|
{tl.shots.flatMap((s) =>
|
|
120
121
|
s.captions.map((c, j) => (
|
|
121
122
|
<div key={`${s.name}-${j}`} className={`tr-caption${lit.has(`${c.start}|${c.text}`) ? ' on' : ''}`} title={captionText(c)}
|
|
@@ -135,14 +136,43 @@ export const TrailerTimeline = observer(({ st }: { st: TrailerSt }) => {
|
|
|
135
136
|
)
|
|
136
137
|
})
|
|
137
138
|
|
|
138
|
-
|
|
139
|
-
|
|
139
|
+
/** a shot's state as its tooltip says it: the state, the lane and why, the card, then the dim details */
|
|
140
|
+
export const stateTip = (st: ShotStatus): string =>
|
|
141
|
+
[`${st.word}${st.state === 'waiting' && st.card ? ` on card ${st.card}` : ''}${st.by && st.state !== 'ready' ? ` · by ${st.by}` : ''}`, ...(st.why ? [`why: ${st.why}`] : []), ...st.detail].join('\n')
|
|
142
|
+
|
|
143
|
+
const ShotBlock = ({ s, i, x, w, on, hue, changed, status }: { s: ShotSpan; i: number; x: number; w: number; on: boolean; hue: string; changed: boolean; status: ShotStatus | undefined }) => (
|
|
144
|
+
<div className={`tr-shot ${hue}${on ? ' on' : ''}${i % 2 ? ' odd' : ''}${changed ? ' changed' : ''}`} title={`${s.name} · ${clock(s.start)} · ${secsOf(s.length)}${changed ? ' · changed' : ''}${status ? `\n${stateTip(status)}` : ''}`}
|
|
140
145
|
style={{ left: x + 0.5, width: Math.max(1, w - 1), top: ROW.shots, height: SHOTS }}>
|
|
141
146
|
{w > 26 ? s.name : ''}
|
|
142
147
|
{w > 44 ? <div className="tr-shottime">{clock(s.start)}</div> : null}
|
|
148
|
+
{status ? <div className={`tr-sbar ss-${status.state}`} /> : null}
|
|
143
149
|
</div>
|
|
144
150
|
)
|
|
145
151
|
|
|
152
|
+
/** the cut at a glance, over its timeline: how many shots are ready, queued, filming, not filmed, and the cards whose
|
|
153
|
+
* new takes wait for the owner's answer */
|
|
154
|
+
export const ShotSummary = observer(({ st }: { st: TrailerSt }) => {
|
|
155
|
+
const ss = st.shotStates
|
|
156
|
+
if (!ss) return null
|
|
157
|
+
const { counts: c, total, cards } = ss.summary
|
|
158
|
+
const cut = st.cut?.cut
|
|
159
|
+
return (
|
|
160
|
+
<div className="tr-summary" title="each shot's state: a coloured bar under it on the timeline, a line on its card; a lane writes it with sk trailer plan">
|
|
161
|
+
<span className="ss-ready"><span className="tr-sdot" /><b>{c.ready} of {total}</b> shots ready</span>
|
|
162
|
+
<span className="ss-queued"><span className="tr-sdot" />{c.queued} queued</span>
|
|
163
|
+
<span className="ss-filming"><span className="tr-sdot" />{c.filming} filming</span>
|
|
164
|
+
{c.unfilmed > 0 ? <span className="ss-unfilmed"><span className="tr-sdot" />{c.unfilmed} not filmed</span> : null}
|
|
165
|
+
<span className="ss-waiting">
|
|
166
|
+
<span className="tr-sdot" />cards waiting: {cards.length === 0 ? 'none' : cards.map((x) => (
|
|
167
|
+
<button key={x.card} type="button" className="tr-cardlink" title={`open card ${x.card}: the new take of ${x.shots.join(', ')}`} onClick={() => st.openCard(x.card)}>{x.card} ({x.shots.join(', ')})</button>
|
|
168
|
+
))}
|
|
169
|
+
</span>
|
|
170
|
+
{ss.plan !== cut ? <span className="tr-dim tr-small">the plan of {ss.plan}, the cut this version keeps</span> : null}
|
|
171
|
+
{ss.read === null && !st.cut?.version ? <span className="tr-dim tr-small">takes not read yet: sk trailer check shows which are filmed</span> : null}
|
|
172
|
+
</div>
|
|
173
|
+
)
|
|
174
|
+
})
|
|
175
|
+
|
|
146
176
|
/** one note on the lane, numbered in the order of the cut: a click lands on its frame */
|
|
147
177
|
const LaneMarker = ({ m, x }: { m: LaneMark; x: number }) => (
|
|
148
178
|
<>
|
|
@@ -206,11 +236,13 @@ export const ShotCards = observer(({ st }: { st: TrailerSt }) => {
|
|
|
206
236
|
{tl.shots.map((s, i) => {
|
|
207
237
|
const n = counts.get(s.name) ?? 0
|
|
208
238
|
const changed = st.changed.has(s.name)
|
|
239
|
+
const status = st.shotStates?.states[s.name]
|
|
209
240
|
return (
|
|
210
|
-
<button type="button" key={`${s.name}@${i}`} className={`tr-shotcard ${hueOf(tl, s.section)}${i === cur ? ' on' : ''}${changed ? ' changed' : ''}`} onMouseDown={(e) => e.preventDefault()} onClick={() => st.seek(s.start)}>
|
|
241
|
+
<button type="button" key={`${s.name}@${i}`} className={`tr-shotcard ${hueOf(tl, s.section)}${i === cur ? ' on' : ''}${changed ? ' changed' : ''}`} title={status ? stateTip(status) : undefined} onMouseDown={(e) => e.preventDefault()} onClick={() => st.seek(s.start)}>
|
|
211
242
|
<Thumb st={st} index={i} w={136} />
|
|
212
243
|
<div className="tr-shotname"><span className="tr-dim">{i + 1} </span>{s.name}{changed ? <span className="tr-changed" title="the change touched this shot">changed</span> : null}</div>
|
|
213
244
|
<div className="tr-dim tr-small">{clock(s.start)} · {secsOf(s.length)}{s.captions.length > 0 ? ` · ${s.captions.length} title${s.captions.length > 1 ? 's' : ''}` : ''}</div>
|
|
245
|
+
{status ? <div className={`tr-sstate ss-${status.state}`}><span className="tr-sdot" />{status.word}{status.state === 'waiting' && status.card ? <span className="tr-dim">{status.card}</span> : status.why && status.state !== 'ready' ? <span className="tr-dim">{status.why}</span> : null}</div> : null}
|
|
214
246
|
{n > 0 ? <span className="tr-shotnotes">{n}</span> : null}
|
|
215
247
|
</button>
|
|
216
248
|
)
|