import { narrationsOf } from "umtool-report-to-video/narration"; import { draftsView } from "@/lib/report/drafts.mjs"; import { readFieldProvenance } from "@/lib/report/draft-provenance.mjs"; import { manifestToken } from "@/lib/report/manifest.mjs"; import { draftRowsOf, draftRuns, projectIteration } from "@/lib/articles/projectDraft"; import MediaDrafts, { type FieldProvenance } from "../MediaDrafts"; import OnscreenSection from "../OnscreenSection"; import ModulesPanel from "../ModulesPanel"; import YoutubeSection from "../YoutubeSection"; import SocialPostSection from "../SocialPostSection"; import HandFill, { type HandFillView } from "../HandFill"; import { handFillView } from "@/lib/report/hand-fill.mjs"; import type { DraftsView } from "../drafts"; import type { ReportTabProps } from "./shared"; // THE MEDIA TAB (P4b; canvas "Piece · Media"): ONE surface for what the cut // says over its footage -- every drafted field with its provenance and // review, each section's "Draft with ", Draft everything and Approve // all (components/projects/MediaDrafts.tsx); then the on-screen panel whole // (moved out of Build), the upload's text and the promotion posts. Release 28's review page, // Draft panel and the Iterations tab's media drafts are this now; the // narration's words are edited and played on its bench (…/narration), the // fields walked one at a time on the review bench (…/review). Under the drafts, // Fill by hand (release 32 R2): the empty fields as blanks a person fills, no // model (components/projects/HandFill.tsx). export default async function MediaTab({ project, detail }: ReportTabProps) { const { manifest: m, build, entries } = detail; const [view, provenance, link, token] = await Promise.all([ draftsView(project.dir, m) as Promise, readFieldProvenance(project.dir, m) as Promise>, projectIteration(project.dir), manifestToken(project.dir), ]); const runs = link.ok ? await draftRuns(project.dir) : {}; return ( <> )} runs={runs} narrated={narrationsOf(m).length} /> ), token }} /> {/* --- what is drawn over it --------------------------------------- */} {/* The on-screen panel: its settings, its words and a live preview of both, whole (P4a-1 parked it on Build; its words are media). "Re-render on-screen" still runs the build over the segments it already built. */} ({ id: e.id, kind: e.kind, segment: !!e.segment }))} built={!!build.built} /> {/* --- every video module from its own descriptor (release 39) ----- */} {/* The generic module panel: on/off, settings, checks, a preview of each module alone, and the cut's look preset. The bespoke editors above stay; this covers the modules without one. */} e.id)} /> {/* --- the upload's text (out/youtube.txt, or its preview) --------- */} } /> {/* --- the promotion posts (publish.x, publish.bluesky; text only) - */} } iteration={link.ok && link.status === "done" ? { article: link.article, n: link.n } : null} /> ); }