// THE SUBTITLE (module `subtitle`, a part of the shell): each clip's source // line under its title -- who said it, the source's title, the date, the // clock in the source -- in the deck's page (deck.mjs `deckText`, // attribution.mjs `deckSubtitle`). `lines: 2` draws it in two: the source's // title (`head`) a size up over the rest, the band one line taller (deck.mjs // `subtitleBoxes`, which deckGeometry -- the layout's `footer` slot -- reads), // so every module placed by the slots moves with it. import { DECK_DEFAULTS, SUBTITLE_LINES, SUBTITLE_TOKENS, settingsOf } from "./settings.mjs"; import { defineModule } from "./contract.mjs"; export default defineModule({ id: "subtitle", version: 1, z: 11, kind: "part", host: "shell", slot: "inline", // Its form in the stacked vertical deck (vertical-deck.mjs). vertical: { slot: "inline" }, title: "Subtitle", summary: "Each clip's source line under its title: the channel, the source's title, the date, the clock, and (when on) what became of the source.", configKey: "render.chrome.deck.subtitle", defaults: DECK_DEFAULTS.subtitle, validate: settingsOf("subtitle").validate, resolve: (render) => ({ ...DECK_DEFAULTS.subtitle, ...(render?.chrome?.deck?.subtitle ?? {}) }), ui: [ { key: "parts", type: "list", options: ["auto", ...SUBTITLE_TOKENS], label: "Parts", default: "auto", help: "\"auto\", or the parts in order: channel, title, date, clock, status" }, { key: "dateFormat", type: "enum", options: ["long", "iso"], label: "Date format", default: "long" }, { key: "lines", type: "number", min: SUBTITLE_LINES[0], max: SUBTITLE_LINES[SUBTITLE_LINES.length - 1], step: 1, label: "Lines", default: 1, help: "2: the source's title on a line of its own (it shrinks to fit before it ellipsizes), the channel, date and clock under it; the deck grows by that line" }, { key: "head", type: "list", options: ["auto", ...SUBTITLE_TOKENS], label: "First line", default: "auto", when: { lines: 2 }, help: "\"auto\" (the source's title), or the parts on the first line; the rest of the parts go on the second" }, { key: "status", type: "enum", options: ["off", "end"], label: "Source status", default: "off", help: "end: \"now private (public when streamed)\" after the last part, for a source a viewer can no longer watch -- from the stamp `umtool source-status

refresh` writes" }, ], docs: { heading: "Subtitle", intro: "The source line under each clip's title, in the deck. The automatic line is set by what each part IS, wherever it stands: when it runs long the title gives way first (an ellipsis at its end), a channel ellipsizes only past 40 % of the line, and the date and the clock always show whole -- so `[channel, title, date, clock]` never reads \"… · Oct … · 1:08:48\" (the schedule's `subtitleParts`, chrome-deck.mjs subtitleMarkup; the finale's copy of the line too). An entry's typed `onscreen.subtitle` has no parts to name: its middle parts give way, its first and last show whole.", rows: [ ["`deck.subtitle.parts`", "`auto` · a list of distinct `channel` `title` `date` `clock` `status` · default `auto`", "`umtool look

deck.subtitle='{\"parts\":[\"channel\",\"date\",\"clock\"]}'`"], ["`deck.subtitle.dateFormat`", "`long` (24 Oct 2020) · `iso` · default `long`", "`umtool look

deck.subtitle='{\"dateFormat\":\"iso\"}'`"], ["`deck.subtitle.lines`", "`1` · `2`: the source's title on a line of its own (a size up; it shrinks to 70 % before it ellipsizes), the other parts under it. The deck grows by that line (39 px at the default title size) and the footage must still fit above it: with full-width footage that needs `footageScale` at most about 0.78 · default `1`", "`umtool look

deck.subtitle.lines=2 deck.footageScale=0.78`"], ["`deck.subtitle.status`", "`off` · `end`: the SOURCE STATUS after the last part (or name `status` in `parts` to place it; an explicit `off` wins over that) -- `now private` / `now members-only` / `now deleted`, with `(public when streamed)` or `(was public)` only when the archive's records prove it; nothing for a public, unlisted or age-gated source, or when the records disagree. Never drawn cut: where the line cannot hold it whole it drops the parenthesis, then lets the channel give way, then is not drawn. Read from the manifest's `sourceStatus` stamp alone (`umtool source-status

refresh`; never the network at render) · default `off`", "`umtool look

deck.subtitle.status=end` then `umtool source-status

refresh`"], ["`deck.subtitle.head`", "`auto` (the source's title) · a list of distinct parts for the first of two lines; the rest of `parts` take the second · default `auto`", "`umtool look

deck.subtitle.head='[\"channel\",\"title\"]'`"], ], }, });