// THE QR (module `qr`, a part of the shell): each clip's code in the deck's // source cell, and the host it resolves to read up its side -- linked to the // archive at the clip (`site`) or to the record itself (`original`). The // deck's QR maker (compose-chrome.mjs `qrPngsFor`) draws the codes. import { DECK_DEFAULTS, QR_LINKS, settingsOf } from "./settings.mjs"; import { defineModule } from "./contract.mjs"; export default defineModule({ id: "qr", version: 1, z: 12, kind: "part", host: "shell", slot: "inline", // Its form in the stacked vertical deck (vertical-deck.mjs). vertical: { slot: "inline" }, title: "QR", summary: "Each clip's code in the deck, to the archive at the clip or to the record itself.", configKey: "render.chrome.deck.qr", defaults: DECK_DEFAULTS.qr, validate: settingsOf("qr").validate, resolve: (render) => ({ ...DECK_DEFAULTS.qr, ...(render?.chrome?.deck?.qr ?? {}) }), ui: [ { key: "show", type: "boolean", label: "Show the code", default: true }, { key: "size", type: "number", min: 80, max: 380, step: 2, label: "Size (px)", default: 150 }, { key: "links", type: "enum", options: QR_LINKS, label: "Links to", default: "site" }, ], docs: { heading: "QR", intro: "Each clip's QR in the deck's source cell. An entry's `citeUrl` wins either way.", rows: [ ["`deck.qr.show`", "bool · default `true`", "`umtool look
deck.qr='{\"show\":false}'`"], ["`deck.qr.size`", "80–380 px, at most the deck's height less 20 · default 150", "`umtool look
deck.qr='{\"size\":130}'`"], ["`deck.qr.links`", "`site` (the archive at the clip's start) · `original` (YouTube at the second, a Rumble page, an X post) · default `site`", "`umtool look
deck.qr='{\"links\":\"original\"}'`"], ], }, });