// THE STATUS LEDGER (module `status`, region `status`): a row per item -- // "announced 12 Mar 2022 → no follow-up found" -- in a column in a corner of // the footage box that fills as the cut plays (`render.chrome.status`): a // row comes in on its first clip, its outcome on the outcome's clip (else at // the end of its last). chrome-story.mjs writes the page. import path from "node:path"; import { resolveStatus, statusGeometry, statusHtml, statusRows } from "../chrome-story.mjs"; import { assertRegion, defineModule } from "./contract.mjs"; import { STATUS_DEFAULTS, STATUS_LIMITS, STATUS_MODES, STATUS_POSITIONS, validateStatus } from "./story-settings.mjs"; export default defineModule({ id: "status", version: 1, z: 55, kind: "overlay-whole", slot: "footage", // Its form in the stacked vertical deck (vertical-deck.mjs). vertical: { slot: "picture" }, title: "Status ledger", summary: "A row per item -- announced, then followed up or not -- filling a column as the cut plays.", configKey: "render.chrome.status", defaults: STATUS_DEFAULTS, validate: (v) => validateStatus(v), resolve: resolveStatus, ui: [ { key: "title", type: "text", label: "Heading", default: STATUS_DEFAULTS.title }, { key: "mode", type: "enum", options: STATUS_MODES, label: "Rows", default: "fill" }, { key: "position", type: "enum", options: STATUS_POSITIONS, label: "Corner", default: "top-right" }, { key: "rows", type: "number", min: STATUS_LIMITS.rows[0], max: STATUS_LIMITS.rows[1], label: "Rows shown", default: 4 }, { key: "width", type: "number", min: STATUS_LIMITS.width[0], max: STATUS_LIMITS.width[1], label: "Width (px)", default: 640 }, { key: "items", type: "list", label: "Items", item: [ { key: "item", type: "text", label: "Item" }, { key: "announced.clip", type: "clip", label: "Announced in" }, { key: "announced.date", type: "date", label: "Announced on" }, { key: "announced.text", type: "text", label: "Announced (words)" }, { key: "outcome.clip", type: "clip", label: "Outcome in" }, { key: "outcome.date", type: "date", label: "Outcome on" }, { key: "outcome.text", type: "text", label: "Outcome" }, ] }, ], docs: { heading: "Status ledger", intro: "A ledger of items, each announced and then followed up -- or not (`render.chrome.status`, chrome-story.mjs): a column in a corner of the footage box that fills as the cut plays. A row comes in on its first clip (its announcement's, else its first evidence clip); its outcome is written on the outcome's clip, else at the end of its last clip. `fill` keeps the last `rows` rows up from the first on; `each` shows a row alone over its own clips.", rows: [ ["`chrome.status.items[]`", `1–${STATUS_LIMITS.items} \`{item ≤${STATUS_LIMITS.item}, announced: words | {clip?, date?, text?}, outcome?: words | {clip?, date?, text?}, evidence?: [clip…]}\` -- at least one clip named`, "`umtool modules apply
--config module-config.json` · `umtool look
status='{…}'`"], ["`chrome.status.mode`", "`fill` · `each` · default `fill`", "`umtool look
status.mode=each`"], ["`chrome.status.position`, `.rows`, `.width`, `.title`", `a corner of the footage box · ${STATUS_LIMITS.rows.join("–")} · ${STATUS_LIMITS.width.join("–")} px · ≤${STATUS_LIMITS.title} · default \`top-right\`, 4, 640, "On the record"`, "`umtool look
status.position=bottom-left`"], ], }, region: "status", workers: "narrow", noun: "the status ledger's", on: (schedule, render) => !!schedule?.segments && statusRows(schedule, render).length > 0, check: (schedule, render) => (statusRows(schedule, render).length ? null : "the status region needs render.chrome.status with an item whose clips the cut plays"), async page(ctx) { const fonts = await ctx.fonts({ regular: "DeckSans", bold: "DeckSansBold" }, { strict: true }); return statusHtml(ctx.schedule, ctx.render, { fonts, from: ctx.from, duration: ctx.duration }); }, regions(schedule, { render, outDir, frames = null }) { return [assertRegion({ name: "status", frames: frames ?? path.join(outDir, "chrome", "status-frames"), ...statusGeometry(render, { feed: schedule.layout === "feed" }), })]; }, preview: (_slice, { render }) => ({ region: "status", geometry: statusGeometry(render) }), // Its page is its live preview: Play the cut seeks it in the cut's seconds (contract.mjs, PLAY). play: { clock: "cut", ready: "status:ready" }, // A cue interpreter: each state of the ledger an item, keyed only where it is shown. frameKeys: { data: "status-data", omit: ["init", "cues", "window", "total", "ids"] }, });