@hypersocial/decks-cli 0.9.23 → 0.9.24

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.
Files changed (86) hide show
  1. package/package.json +1 -1
  2. package/skills/hyperdecks/SKILL.md +113 -67
  3. package/skills/hyperdecks/chat.md +11 -8
  4. package/skills/hyperdecks/terminal.md +82 -0
  5. package/src/bars.mjs +268 -0
  6. package/src/brand.mjs +51 -8
  7. package/src/check.mjs +311 -15
  8. package/src/checkRules.mjs +616 -27
  9. package/src/commands.mjs +157 -28
  10. package/src/deckSlug.mjs +41 -0
  11. package/src/export-video.mjs +20 -3
  12. package/src/files.mjs +35 -0
  13. package/src/guide.mjs +91 -13
  14. package/src/hosted.mjs +18 -8
  15. package/src/iconAliasNames.mjs +70 -0
  16. package/src/iconChoice.mjs +97 -0
  17. package/src/iconSets.mjs +89 -0
  18. package/src/iconSlots.mjs +48 -0
  19. package/src/icons.mjs +285 -45
  20. package/src/iconsCli.mjs +76 -0
  21. package/src/layoutRoutes.mjs +92 -0
  22. package/src/layouts.mjs +4 -4
  23. package/src/mediaPreviews.mjs +3 -1
  24. package/src/narrate.mjs +31 -4
  25. package/src/opening.mjs +9 -3
  26. package/src/ops.mjs +49 -0
  27. package/src/photosGuide.mjs +47 -0
  28. package/src/picturesGuide.mjs +53 -0
  29. package/src/play.mjs +3 -2
  30. package/src/presenter.mjs +3 -1
  31. package/src/release.mjs +13 -5
  32. package/src/runtime.mjs +9 -2
  33. package/src/scaffold.mjs +73 -13
  34. package/src/source.mjs +86 -14
  35. package/src/stockMedia.mjs +299 -0
  36. package/src/themeCli.mjs +41 -0
  37. package/src/themes.mjs +345 -0
  38. package/templates/icons/material.LICENSE +202 -0
  39. package/templates/icons/material.json.gz +0 -0
  40. package/templates/icons/phosphor.LICENSE +21 -0
  41. package/templates/icons/phosphor.json.gz +0 -0
  42. package/templates/icons/tabler.LICENSE +21 -0
  43. package/templates/icons/tabler.json.gz +0 -0
  44. package/templates/layouts/_deck.html +177 -36
  45. package/templates/layouts/bento.html +75 -0
  46. package/templates/layouts/chart.html +6 -4
  47. package/templates/layouts/closer.html +10 -3
  48. package/templates/layouts/compare.html +13 -4
  49. package/templates/layouts/cover-band.html +10 -8
  50. package/templates/layouts/cover-frame.html +9 -7
  51. package/templates/layouts/cover-poster.html +8 -5
  52. package/templates/layouts/cover-split.html +7 -6
  53. package/templates/layouts/cover-type.html +1 -0
  54. package/templates/layouts/features.html +9 -7
  55. package/templates/layouts/funnel.html +60 -0
  56. package/templates/layouts/hero.html +40 -22
  57. package/templates/layouts/lanes.html +63 -0
  58. package/templates/layouts/loop.html +81 -0
  59. package/templates/layouts/number.html +2 -1
  60. package/templates/layouts/phone-stage.html +68 -0
  61. package/templates/layouts/phones.html +1 -0
  62. package/templates/layouts/picture-full.html +48 -0
  63. package/templates/layouts/portrait.html +45 -0
  64. package/templates/layouts/product.html +7 -6
  65. package/templates/layouts/quote.html +2 -1
  66. package/templates/layouts/rail.html +71 -0
  67. package/templates/layouts/scorecard.html +70 -0
  68. package/templates/layouts/screens.html +85 -0
  69. package/templates/layouts/sentence.html +39 -0
  70. package/templates/layouts/split.html +22 -7
  71. package/templates/layouts/spotlight.html +77 -0
  72. package/templates/layouts/stack.html +83 -0
  73. package/templates/layouts/staircase.html +76 -0
  74. package/templates/layouts/strike.html +46 -0
  75. package/templates/layouts/tap-through.html +73 -0
  76. package/templates/layouts/team.html +3 -2
  77. package/templates/layouts/timeline.html +16 -6
  78. package/templates/layouts/two-bars.html +53 -0
  79. package/templates/layouts/two-by-two.html +71 -0
  80. package/templates/layouts/video-beats.html +66 -0
  81. package/templates/layouts/video-full.html +62 -0
  82. package/templates/layouts/wall.html +81 -0
  83. package/templates/layouts/zoom.html +144 -0
  84. package/templates/narrated-deck.html +12 -7
  85. package/templates/script.md +2 -2
  86. /package/templates/icons/{LICENSE → lucide.LICENSE} +0 -0
package/src/guide.mjs CHANGED
@@ -1,14 +1,22 @@
1
1
  // hyperdecks guide [topic]
2
2
  //
3
3
  // The skill, served in sections, for agents that cannot install it (chat apps on
4
- // the hosted MCP call deck_guide). `workflow` is chat.md; the other topics are
4
+ // the hosted MCP call deck_guide). `workflow` is chat.md on the hosted MCP and
5
+ // terminal.md for the CLI (surface "cli"); the other topics are
5
6
  // the SKILL.md sections marked <!-- topic: … -->, and `layouts` is built from
6
- // each layout file's leading comment.
7
+ // each layout file's leading comment (an index, or named layouts' detail).
7
8
  import { packageText } from "./files.mjs";
8
- import { LAYOUTS, readLayout } from "./layouts.mjs";
9
+ import { LAYOUTS, parseLayouts, readLayout } from "./layouts.mjs";
9
10
  import { fontPairingsMarkdown } from "./brand.mjs";
11
+ import { themesMarkdown } from "./themes.mjs";
12
+ import { photosGuide } from "./photosGuide.mjs";
13
+ import { picturesGuide } from "./picturesGuide.mjs";
14
+ import { ICON_SLOTS } from "./iconSlots.mjs";
15
+ import { routesMarkdown, suggestLayouts } from "./layoutRoutes.mjs";
10
16
 
11
- export const GUIDE_TOPICS = ["workflow", "format", "script", "scripts", "design", "look", "layouts", "presenter", "transitions", "check"];
17
+ export const GUIDE_TOPICS = ["workflow", "format", "script", "scripts", "design", "look", "themes", "layouts", "photos", "pictures", "presenter", "transitions", "check"];
18
+ // Other names a topic answers to: gifs is the photos topic, icons the pictures one.
19
+ const TOPIC_ALIASES = { gifs: "photos", icons: "pictures" };
12
20
  const CLI_NOTE = "_Written for the CLI. On the hosted MCP there is no folder: use the tool names in `deck_guide` (workflow), hosted URLs for every file, and write_deck_source for edits._\n\n";
13
21
 
14
22
  // One <!-- topic: name --> section of SKILL.md: its heading and body, up to the
@@ -26,21 +34,81 @@ export function skillSection(skill, topic) {
26
34
  return out.join("\n").trim();
27
35
  }
28
36
 
29
- function layoutsTopic() {
37
+ // The layouts topic is an index: one line a layout (its name, what it says and
38
+ // needs, a short brief), small enough for the whole library in one read. The
39
+ // detail (what to put in, slots, cues, without a presenter) is read by name.
40
+ function layoutsIndex(surface) {
30
41
  const rows = LAYOUTS.map((name) => {
31
42
  const { meta } = readLayout(name);
32
- return [`### ${name}`, meta.summary, meta.use && `Use: ${meta.use}`, meta.slot && `Slots: ${meta.slot}`, meta.nopresenter && `Without a presenter: ${meta.nopresenter}`, meta.cues && `Cues: ${meta.cues}`].filter(Boolean).join("\n");
43
+ const tags = [meta.says, meta.needs].filter(Boolean).join(" · ");
44
+ return `- \`${name}\`${tags ? ` (${tags})` : ""}: ${meta.brief ?? meta.summary}`;
33
45
  });
34
- return `# Layouts\n\nPass any of these, in order, as new_deck's \`layouts\` (repeat one for more of the same: number, number gives slides number and number-2).\n\n${rows.join("\n\n")}`;
46
+ const suggest = surface === "cli" ? '`hyperdecks layouts suggest "<what the slide says>"`' : '`deck_guide { topic: "layouts", suggest: "<what the slide says>" }`';
47
+ return `# Layouts\n\n## Pick the shape from what the slide says\n\nName what each slide carries, then take a shape from its row; ${suggest} does the same from a slide's words. Vary the shapes: one layout on more than about a third of the slides, or three in a row, reads as the same slide again (check warns). Where a row offers a picture layout and a word shape, take the picture layout when you have the real screenshot, recording or photo; the word shape is for when you do not. For a list of what is allowed and what is not, use compare: put the allowed items in the right-hand column, the highlighted one, and label both columns. For a single rule and the right way to do it, use strike.\n\n${routesMarkdown()}\n\n## Every layout\n\nPass any of these, in order, as new_deck's \`layouts\` (repeat one for more of the same: number, number gives slides number and number-2). Read a layout's detail (what to put in, slots, cues, without a presenter) before you fill it: \`deck_guide { topic: "layouts", layouts: ["zoom"] }\` (CLI: \`hyperdecks guide layouts zoom\`); several names in one call is fine.\n\n${rows.join("\n")}`;
35
48
  }
36
49
 
37
- // { topic, topics, text } for one topic; no topic gives the workflow.
38
- export function deckGuide(topic = "workflow") {
39
- const t = String(topic || "workflow").toLowerCase();
50
+ // The built-in themes, each with what it is for, and how an agent picks one.
51
+ function themesGuide(surface) {
52
+ const pick = surface === "cli" ? "`hyperdecks deck new <slug> \"<title>\" --narrated --layouts … --theme <name>`" : "`new_deck { …, theme: \"<name>\" }`";
53
+ const change = surface === "cli" ? "`hyperdecks theme set <deck-dir> <name>` (it keeps the deck's words and swaps only the look; a released deck changes when it is released again)" : "make the deck again with new_deck and the other theme, or ask the person to run `hyperdecks theme set`";
54
+ return [
55
+ "# Themes",
56
+ "",
57
+ `A theme is a whole look: outlines, corners, shadows, tilt, title style and case, the grounds the slides alternate, a texture, and how photos and charts are drawn. Mark each picture by what it is, whatever its frame: a photo or illustration is \`pic\` (\`art\` on a cover), a capture of a screen or a recording is \`shot\` (\`clip\`); screenshots and recordings are never recoloured. \`data-as-is\` on a photo keeps its own colours (an illustration whose colour matters). A photo can carry a caption: \`<figure class='mount' data-caption='Where, when'><img class='pic' …></figure>\`. A named theme comes in its own colours and fonts, with no brand logo; the saved brand goes on only with no theme named, or when asked (\`${surface === "cli" ? "--brand" : "brand: true"}\`), and then recolours the theme (its colours and logo, and its fonts only if it set them) while the shape and title style stay the theme's.`,
58
+ "",
59
+ themesMarkdown(),
60
+ "",
61
+ `Pick one with ${pick}. When the person names none, pick one from the subject and the audience (a fund's update: quiet; a founder's essay: longform; a dev tool: blueprint; a launch: loud) and say which you picked and why in one line, so they can ask for another. With no theme the deck is in house.`,
62
+ "",
63
+ `To change a deck's theme: ${change}.`,
64
+ ].join("\n");
65
+ }
66
+
67
+ // A layout's markup as a deck gets it (deck new --layouts), for the guide: its own <section>, comments out and each
68
+ // inline SVG (an icon, a stand-in) shortened, so an agent sees the classes and structure it writes. Generated from the
69
+ // layout file, so it cannot drift from the scaffold.
70
+ export function layoutMarkup(section) {
71
+ // An <svg>'s opening tag stays whole (its id, role and aria-* are what cues and readers use); only its drawing is cut.
72
+ return section.replace(/<!--[\s\S]*?-->\s*/g, "").replace(/(<svg\b[^>]*[^/]>)[\s\S]*?<\/svg>/g, "$1…</svg>").replace(/\n\s*\n/g, "\n").trim();
73
+ }
74
+
75
+ // The full entry of each named layout (aliases work), in the order asked.
76
+ function layoutsDetail(names) {
77
+ const rows = parseLayouts(names.join(",")).filter((n, i, all) => all.indexOf(n) === i).map((name) => {
78
+ const { meta, section } = readLayout(name);
79
+ return [`### ${name}`, meta.summary, meta.says && `Says: ${meta.says}`, meta.needs && `Needs: ${meta.needs}`, meta.use && `Use: ${meta.use}`, meta.slot && `Slots: ${meta.slot}`, ICON_SLOTS[name] && `Icon slot (optional): ${ICON_SLOTS[name].where}; \`hyperdecks icons search <word> --for ${name}\` (search_icons { query, for: "${name}" }) gives the svg. Use one where it helps the reader find or remember an item; leave it out where the words carry it (deck_guide topic pictures).`, meta.nopresenter && `Without a presenter: ${meta.nopresenter}`, meta.cues && `Cues: ${meta.cues}`, `Markup (ids start with the slide's id; __ID__ in the scaffold):\n\n\`\`\`html\n${layoutMarkup(section)}\n\`\`\``].filter(Boolean).join("\n");
80
+ });
81
+ return `# Layouts: detail\n\n${rows.join("\n\n")}`;
82
+ }
83
+
84
+ // Two or three layouts for what one slide says, from the routing table's keywords (no model call).
85
+ export function suggestText(says, surface) {
86
+ const found = suggestLayouts(says);
87
+ const detail = surface === "cli" ? "`hyperdecks guide layouts <name>`" : '`deck_guide { topic: "layouts", layouts: ["<name>"] }`';
88
+ if (!found.length) return `# Layouts for "${says}"\n\nNo row of the table matched these words. Name what the slide carries (a process, a cycle, who does what, one claim, a choice, status, numbers, a person, the product…) and read the table in the layouts topic.`;
89
+ return `# Layouts for "${says}"\n\n${found.map((s) => `- \`${s.layout}\`: ${s.kind} (${s.why}); matched ${s.matched.map((w) => `"${w}"`).join(", ")}`).join("\n")}\n\nFirst one first. These come from keywords, so check the fit; read one's detail before you fill it: ${detail}.`;
90
+ }
91
+
92
+ // { topic, topics, text } for one topic; no topic gives the workflow. `layouts`
93
+ // (names, with topic layouts) gives those layouts' detail instead of the index;
94
+ // `suggest` (what a slide says) gives the layouts that fit it.
95
+ export function deckGuide(topic, { layouts, surface, suggest } = {}) {
96
+ const names = [layouts ?? []].flat().flatMap((n) => String(n).split(",")).map((n) => n.trim()).filter(Boolean);
97
+ const says = String(suggest ?? "").trim();
98
+ // Names or a suggest alone (no topic) mean the layouts topic.
99
+ const asked = String(topic || (names.length || says ? "layouts" : "workflow")).toLowerCase();
100
+ const t = TOPIC_ALIASES[asked] ?? asked;
40
101
  if (!GUIDE_TOPICS.includes(t)) throw new Error(`unknown topic "${topic}": pick one of ${GUIDE_TOPICS.join(", ")}`);
102
+ if (names.length && t !== "layouts") throw new Error(`layout names go with the layouts topic, not ${t}`);
103
+ if (says && t !== "layouts") throw new Error(`suggest goes with the layouts topic, not ${t}`);
104
+ if (says && names.length) throw new Error("pass layout names or suggest, not both");
105
+ if (says) return { topic: t, topics: GUIDE_TOPICS, text: suggestText(says, surface), suggestions: suggestLayouts(says) };
41
106
  let text;
42
- if (t === "workflow") text = packageText("skills/hyperdecks/chat.md");
43
- else if (t === "layouts") text = layoutsTopic();
107
+ if (t === "workflow") text = packageText(surface === "cli" ? "skills/hyperdecks/terminal.md" : "skills/hyperdecks/chat.md");
108
+ else if (t === "themes") text = themesGuide(surface);
109
+ else if (t === "photos") text = photosGuide(surface);
110
+ else if (t === "pictures") text = picturesGuide(surface);
111
+ else if (t === "layouts") text = names.length ? layoutsDetail(names) : layoutsIndex(surface);
44
112
  else {
45
113
  const section = skillSection(packageText("skills/hyperdecks/SKILL.md"), t);
46
114
  if (!section) throw new Error(`SKILL.md has no <!-- topic: ${t} --> section`);
@@ -50,8 +118,18 @@ export function deckGuide(topic = "workflow") {
50
118
  return { topic: t, topics: GUIDE_TOPICS, text };
51
119
  }
52
120
 
121
+ // hyperdecks guide layouts zoom wall (or zoom,wall): those layouts' detail.
53
122
  export async function guide(pos, opts = {}, { log = (line) => console.log(line) } = {}) {
54
- const out = deckGuide(pos[0]);
123
+ const out = deckGuide(pos[0], { layouts: pos.slice(1), surface: "cli" });
124
+ if (!opts.json) log(out.text);
125
+ return out;
126
+ }
127
+
128
+ // hyperdecks layouts suggest "<what the slide says>": two or three layouts that fit it.
129
+ export async function layoutsSuggest(words, opts = {}, { log = (line) => console.log(line) } = {}) {
130
+ const says = words.join(" ").trim();
131
+ if (!says) throw new Error('usage: layouts suggest "<what the slide says>" [--json]');
132
+ const out = deckGuide("layouts", { suggest: says, surface: "cli" });
55
133
  if (!opts.json) log(out.text);
56
134
  return out;
57
135
  }
package/src/hosted.mjs CHANGED
@@ -4,8 +4,9 @@
4
4
  import { api, client, target } from "./runtime.mjs";
5
5
  import { PRESENTER_STYLES } from "./checkRules.mjs";
6
6
  import { NARRATED_FILES, assembleLayoutDeck, fillTemplate, parseLayouts } from "./layouts.mjs";
7
- import { applyBrand, brandForNewDeck, brandSummary } from "./brand.mjs";
7
+ import { applyBrand, brandForNewDeck, brandSummary, brandWanted } from "./brand.mjs";
8
8
  import { getBrand } from "./ops.mjs";
9
+ import { DEFAULT_THEME, applyTheme, themeOrThrow, themeScript } from "./themes.mjs";
9
10
 
10
11
  export const SOURCE_FILES = Object.keys(NARRATED_FILES);
11
12
  const SLUG = /^[a-z0-9][a-z0-9-]{0,63}$/;
@@ -16,21 +17,29 @@ const urls = (opts, slug, previewToken) => {
16
17
 
17
18
  // Scaffold the files (the same templates as deck new) and register the draft.
18
19
  // The account's brand (colours, fonts, logo, presenter style) goes on the
19
- // template unless brand is false; an explicit presenterStyle wins over it.
20
- export async function hostedNewDeck(opts, { slug, title, layouts, presenterStyle, brand: useBrand } = {}) {
20
+ // template when no theme is named; a named theme keeps its own colours unless
21
+ // brand is true (brand false: never). An explicit presenterStyle wins over it.
22
+ export async function hostedNewDeck(opts, { slug, title, layouts, presenterStyle, brand: useBrand, theme: themeName } = {}) {
21
23
  if (!slug || !title) throw new Error("slug and title are required");
22
24
  if (!SLUG.test(slug)) throw new Error("slug must be lowercase letters, digits and dashes (max 64)");
23
25
  if (presenterStyle !== undefined && !PRESENTER_STYLES.includes(presenterStyle)) throw new Error(`presenterStyle must be one of ${PRESENTER_STYLES.join(", ")}`);
24
26
  const list = Array.isArray(layouts) ? layouts.join(",") : layouts;
25
27
  if (list) parseLayouts(list);
26
- const { brand, readError } = await brandForNewDeck(() => getBrand(opts), useBrand);
28
+ // No theme named is House, written out and marked like any other (see scaffold.mjs deckNew).
29
+ const named = themeName !== undefined && themeName !== null;
30
+ const theme = named ? themeOrThrow(themeName).id : DEFAULT_THEME;
31
+ if (useBrand !== undefined && useBrand !== null && typeof useBrand !== "boolean") throw new Error("brand must be true or false");
32
+ const wanted = brandWanted(useBrand ?? undefined, named);
33
+ const { brand, readError } = await brandForNewDeck(() => getBrand(opts), wanted);
27
34
  const style = presenterStyle ?? (PRESENTER_STYLES.includes(brand?.presenterStyle) ? brand.presenterStyle : undefined);
28
35
  const files = list
29
36
  ? assembleLayoutDeck({ slug, title, presenterStyle: style, layouts: list })
30
37
  : Object.fromEntries(Object.entries(NARRATED_FILES).map(([out, file]) => [out, fillTemplate(file, { slug, title, presenterStyle: style })]));
31
- files["index.html"] = applyBrand(files["index.html"], brand);
38
+ files["index.html"] = applyBrand(applyTheme(files["index.html"], theme), brand);
39
+ files["script.md"] = themeScript(files["script.md"], theme);
32
40
  const made = await (await client(opts)).mutation(api.deckSources.create, { slug, title, files });
33
- return { slug, rev: made.rev, files, brand: brandSummary(brand, readError), ...urls(opts, slug, made.previewToken) };
41
+ const themeNote = `In the ${theme} theme${named ? "" : " (the default)"}. Say which theme you used; another is new_deck again with theme (deck_guide { topic: "themes" } lists them).`;
42
+ return { slug, rev: made.rev, files, theme, themeNote, brand: brandSummary(brand, readError, { theme: named ? theme : undefined, wanted }), ...urls(opts, slug, made.previewToken) };
34
43
  }
35
44
 
36
45
  export async function getDeckSource(opts, { slug, file } = {}) {
@@ -48,7 +57,8 @@ export async function writeDeckSource(opts, { slug, file, content, edits, baseRe
48
57
  }
49
58
 
50
59
  // A public URL (or a ChatGPT upload's download_url) filed under the deck.
51
- export async function uploadDeckAsset(opts, { slug, name, url, file } = {}) {
60
+ // Returns { url, name, contentType, bytes, bars, trimmed? }: bars is a PNG's (bars.mjs), else null.
61
+ export async function uploadDeckAsset(opts, { slug, name, url, file, trim } = {}) {
52
62
  if (!slug) throw new Error("slug is required");
53
63
  const from = url ?? file?.download_url;
54
64
  if (!from) throw new Error("pass url, or file (a chat upload with a download_url)");
@@ -58,7 +68,7 @@ export async function uploadDeckAsset(opts, { slug, name, url, file } = {}) {
58
68
  const clean = (s) => String(s).replace(/[^A-Za-z0-9._-]+/g, "-").replace(/^[^A-Za-z0-9]+/, "");
59
69
  const unique = (s) => { const m = /^(.*?)(\.[A-Za-z0-9]{1,8})?$/.exec(clean(s) || "asset"); return `${(m[1] || "asset").slice(0, 100)}-${Date.now().toString(36)}${m[2] ?? ""}`; };
60
70
  const assetName = name ? clean(name).slice(0, 120) || "asset" : unique(fallback || "asset");
61
- return (await client(opts)).action(api.assetsNode.importAssetFromUrl, { slug, name: assetName, url: String(from), ...(file?.mime_type ? { mimeType: String(file.mime_type) } : {}) });
71
+ return (await client(opts)).action(api.assetsNode.importAssetFromUrl, { slug, name: assetName, url: String(from), ...(file?.mime_type ? { mimeType: String(file.mime_type) } : {}), ...(trim ? { trim: true } : {}) });
62
72
  }
63
73
 
64
74
  export async function hostedCheck(opts, { slug, forbid, maxDuration, strict } = {}) {
@@ -0,0 +1,70 @@
1
+ // The alias table (ICON_ALIASES in icons.mjs) names Lucide icons. Where another set has an icon of the same name it
2
+ // is used as it is (tabler's trending-up); these are the rest, each Lucide name with the set's icon that draws the
3
+ // same idea (Phosphor's money for banknote, Material's group for users). A Lucide name with no fair match in a set
4
+ // is left out, so the alias finds nothing there and the set's own names and tags answer. A set that has the name but
5
+ // not in every weight may name a stand-in for the weights it lacks (iconIn uses it only there). lib/iconSets.test.ts checks
6
+ // that each one is a real icon.
7
+ export const ICON_ALIAS_NAMES = {
8
+ phosphor: {
9
+ "arrow-left-right": "arrows-left-right", "audio-lines": "waveform", award: "medal", "badge-check": "seal-check", ban: "prohibit",
10
+ banknote: "money", blocks: "cube", bot: "robot", brush: "paint-brush", "calendar-clock": "calendar-dots", "calendar-days": "calendar-dots",
11
+ "chart-column": "chart-bar", "circle-alert": "warning-circle", "circle-check": "check-circle", "circle-dollar-sign": "currency-circle-dollar",
12
+ "circle-question-mark": "question", "circle-stop": "stop-circle", "circle-x": "x-circle", droplet: "drop", droplets: "drop",
13
+ earth: "globe-hemisphere-west", "eye-off": "eye-slash", "face-grinning": "smiley", "face-slightly-frowning": "smiley-sad",
14
+ "face-slightly-smiling": "smiley", "flower-2": "flower", "hand-helping": "hand-heart", "heart-handshake": "handshake",
15
+ "heart-pulse": "heartbeat", layers: "stack", "layout-grid": "squares-four", "life-buoy": "lifebuoy", "log-in": "sign-in",
16
+ luggage: "suitcase-rolling", mail: "envelope-simple", "mail-plus": "envelope-simple", map: "map-trifold", "message-circle": "chat-circle",
17
+ "message-circle-question-mark": "question", "message-square": "chat-centered", "message-square-reply": "arrow-bend-up-left",
18
+ "message-square-text": "chat-centered-text", "messages-square": "chats", mic: "microphone", "octagon-x": "hand-palm",
19
+ "party-popper": "confetti", "pen-tool": "pen-nib", plane: "airplane", puzzle: "puzzle-piece", "refresh-cw": "arrows-clockwise",
20
+ reply: "arrow-bend-up-left", "rotate-cw": "arrow-clockwise", route: "path", salad: "bowl-food", scale: "scales", "scroll-text": "scroll",
21
+ send: "paper-plane-tilt", "share-2": "share-network", smartphone: "device-mobile", split: "arrows-split", "spray-can": "spray-bottle",
22
+ sprout: "plant", store: "storefront", vote: "check-square", "tree-deciduous": "tree", trees: "tree-evergreen", "trending-up": "trend-up",
23
+ "triangle-alert": "warning", utensils: "fork-knife", workflow: "flow-arrow", zap: "lightning",
24
+ "calendar-clock": "calendar-dots", "clipboard-list": "clipboard-text", "clipboard-check": "clipboard-text", "id-card": "identification-card", "pill-bottle": "pill",
25
+ "pen-line": "pencil-line",
26
+ },
27
+ tabler: {
28
+ "audio-lines": "waveform", baby: "baby-carriage", "badge-check": "rosette-discount-check", banknote: "cash-banknote", "book-open": "book",
29
+ bot: "robot", "calendar-days": "calendar", "circle-alert": "alert-circle", "circle-dollar-sign": "currency-dollar",
30
+ "circle-question-mark": "help-circle", "cloud-sun": "sun", "door-open": "door-enter", earth: "world", "face-grinning": "mood-happy",
31
+ "face-slightly-frowning": "mood-sad", "face-slightly-smiling": "mood-smile", "flower-2": "flower", goal: "target",
32
+ "graduation-cap": "school", hand: "hand-stop", "hand-coins": "coins", "hand-heart": "heart-handshake", "hand-helping": "heart-handshake",
33
+ handshake: "heart-handshake", "heart-pulse": "heart-rate-monitor", house: "home", layers: "stack-2", "life-buoy": "lifebuoy",
34
+ lightbulb: "bulb", "list-checks": "list-check", "log-in": "login", "message-circle-question-mark": "help-circle",
35
+ "message-square": "message", "message-square-reply": "message-reply", "message-square-text": "message-2", "messages-square": "messages",
36
+ mic: "microphone", "octagon-x": "hand-stop", "party-popper": "confetti", "pen-tool": "pencil", "piggy-bank": "pig-money",
37
+ play: "player-play", "refresh-cw": "refresh", reply: "message-reply", "rotate-cw": "rotate-clockwise", "scroll-text": "file-text",
38
+ signpost: "direction-sign", smartphone: "device-mobile", split: "arrows-split", "spray-can": "spray", sprout: "seedling",
39
+ store: "building-store", "thumbs-up": "thumb-up", timer: "stopwatch", "tree-deciduous": "tree", "triangle-alert": "alert-triangle", vote: "checkbox",
40
+ utensils: "tools-kitchen-2", workflow: "automation", wrench: "tool", zap: "bolt",
41
+ "pill-bottle": "pill", "id-card": "id", "calendar-check": "calendar-check",
42
+ "pen-line": "pencil",
43
+ // Tabler draws no filled arrow-right; its fill weight takes the big arrow (the outline keeps arrow-right).
44
+ "arrow-right": "arrow-big-right",
45
+ },
46
+ material: {
47
+ apple: "nutrition", "arrow-left-right": "sync-alt", "audio-lines": "graphic-eq", award: "military-tech", baby: "child-care",
48
+ "badge-check": "verified", ban: "block", banknote: "payments", blocks: "extension", bot: "smart-toy", brain: "psychology",
49
+ briefcase: "work", calendar: "calendar-month", "calendar-days": "calendar-month", "chart-column": "bar-chart", "chart-line": "show-chart",
50
+ "circle-alert": "error", "circle-check": "check-circle", "circle-dollar-sign": "paid", "circle-question-mark": "help",
51
+ "circle-stop": "stop-circle", "circle-x": "cancel", clock: "schedule", "cloud-sun": "partly-cloudy-day", coins: "paid", compass: "explore",
52
+ droplet: "water-drop", droplets: "water-drop", ear: "hearing", earth: "public", eye: "visibility", "eye-off": "visibility-off",
53
+ "face-grinning": "sentiment-very-satisfied", "face-slightly-frowning": "sentiment-dissatisfied", "face-slightly-smiling": "sentiment-satisfied",
54
+ "file-text": "description", flower: "local-florist", "flower-2": "local-florist", gauge: "speed", gift: "redeem", goal: "sports-score",
55
+ "graduation-cap": "school", hammer: "construction", hand: "front-hand", "hand-coins": "savings", "hand-heart": "volunteer-activism",
56
+ "hand-helping": "volunteer-activism", headset: "headset-mic", heart: "favorite", "heart-handshake": "volunteer-activism",
57
+ "heart-pulse": "monitor-heart", "layout-grid": "grid-view", leaf: "eco", "life-buoy": "support", "list-checks": "checklist",
58
+ "log-in": "login", "mail-plus": "mail", "map-pin": "location-on", medal: "military-tech", "message-circle": "chat-bubble",
59
+ "message-circle-question-mark": "contact-support", "message-square": "chat", "message-square-reply": "reply", "message-square-text": "sms",
60
+ "messages-square": "forum", moon: "dark-mode", "octagon-x": "block", "party-popper": "celebration", "pen-tool": "draw",
61
+ "piggy-bank": "savings", plane: "flight", play: "play-arrow", plug: "power", presentation: "slideshow", puzzle: "extension",
62
+ recycle: "recycling", "refresh-cw": "refresh", "rotate-cw": "rotate-right", salad: "restaurant", "scroll-text": "policy", "share-2": "share",
63
+ "shield-check": "verified-user", shovel: "yard", split: "call-split", "spray-can": "sanitizer", sprout: "potted-plant",
64
+ "thumbs-up": "thumb-up", trash: "delete", "tree-deciduous": "park", trees: "forest", "triangle-alert": "warning", truck: "local-shipping",
65
+ user: "person", "user-plus": "person-add", users: "group", utensils: "restaurant", wind: "air", workflow: "account-tree", wrench: "build",
66
+ vote: "how-to-vote", x: "close", zap: "bolt", smartphone: "mobile", sparkles: "star-shine",
67
+ "calendar-check": "event-available", "clipboard-list": "assignment", "clipboard-check": "assignment-turned-in", "pill-bottle": "medication", "pill": "pill", "id-card": "id-card",
68
+ "pen-line": "edit",
69
+ },
70
+ };
@@ -0,0 +1,97 @@
1
+ // The icon sets' names and weights, and reading the choice a deck records, with no Node imports: the CLI, the
2
+ // hosted MCP route and check's rules (checkRules.mjs) all use it. The data itself loads in iconSets.mjs.
3
+
4
+ // draw: "stroke" for line icons (stroked in currentColor, stroke width
5
+ // adjustable), "fill" for solid shapes (filled in currentColor), "duotone" for
6
+ // a fill plus a second tone in the deck's accent.
7
+ export const ICON_SETS = [
8
+ {
9
+ id: "lucide",
10
+ name: "Lucide",
11
+ file: "templates/icons/lucide.json",
12
+ weights: { line: "stroke" },
13
+ character: "even line icons, plain and friendly (about 1,900); stroke weight set by --stroke-width, as with Tabler outline",
14
+ sample: ["rocket", "users", "shield-check", "sprout"],
15
+ },
16
+ {
17
+ id: "phosphor",
18
+ name: "Phosphor",
19
+ file: "templates/icons/phosphor.json.gz",
20
+ weights: { regular: "fill", thin: "fill", light: "fill", bold: "fill", fill: "fill", duotone: "duotone" },
21
+ character: "rounded and warm, in six weights: thin or light for a quiet or technical deck, bold or fill for a loud one, duotone (a light tint of the icon filling its body) for a soft one; a duotone row mixes solid-looking shapes (a chat bubble) with line-like ones (a stethoscope), so pick regular where the row must look even",
22
+ sample: ["rocket", "users", "shield-check", "plant"],
23
+ },
24
+ {
25
+ id: "tabler",
26
+ name: "Tabler",
27
+ file: "templates/icons/tabler.json.gz",
28
+ weights: { outline: "stroke", fill: "fill" },
29
+ character: "the largest set (about 5,000), crisp geometric lines on a 24px grid; outline for most icons, fill for about one in five",
30
+ sample: ["rocket", "users", "shield-check", "plant"],
31
+ },
32
+ {
33
+ id: "material",
34
+ name: "Material Symbols",
35
+ file: "templates/icons/material.json.gz",
36
+ weights: { outline: "fill", fill: "fill" },
37
+ character: "Google's system icons (about 3,900), sturdy and neutral; good for product, data and how-to decks",
38
+ sample: ["rocket", "group", "verified-user", "potted-plant"],
39
+ },
40
+ ];
41
+ export const ICON_SET_IDS = ICON_SETS.map((s) => s.id);
42
+ const WEIGHT_ALIASES = { filled: "fill", outlined: "outline", solid: "fill", stroke: "line" };
43
+
44
+ export function setMeta(id) {
45
+ const meta = ICON_SETS.find((s) => s.id === String(id ?? "").toLowerCase());
46
+ if (!meta) throw new Error(`unknown icon set "${id}"; one of ${ICON_SET_IDS.join(", ")} or all`);
47
+ return meta;
48
+ }
49
+
50
+ // A weight name as the set spells it (filled → fill), or the set's first weight when none is given; an
51
+ // unknown weight is an error that lists the set's own.
52
+ export function setWeight(id, weight) {
53
+ const meta = setMeta(id);
54
+ const names = Object.keys(meta.weights);
55
+ if (weight == null || weight === "") return names[0];
56
+ const w = String(weight).toLowerCase();
57
+ const plain = WEIGHT_ALIASES[w] ?? w;
58
+ if (names.includes(plain)) return plain;
59
+ if (id === "lucide" && ["regular", "outline"].includes(plain)) return "line";
60
+ throw new Error(`${meta.name} has no ${weight} weight; it has ${names.join(", ")}`);
61
+ }
62
+
63
+ // The weight in one set closest to a weight asked of all sets, or null when the set has nothing like it.
64
+ export function nearestWeight(id, weight) {
65
+ if (weight == null || weight === "") return setWeight(id);
66
+ try {
67
+ return setWeight(id, weight);
68
+ } catch {
69
+ const w = WEIGHT_ALIASES[String(weight).toLowerCase()] ?? String(weight).toLowerCase();
70
+ // Every set has a plain weight: regular, line and outline are one ask.
71
+ if (["regular", "line", "outline"].includes(w)) return setWeight(id);
72
+ return null;
73
+ }
74
+ }
75
+
76
+ // The set and weight a deck recorded in <meta name="hd-icons" content="<set> <weight>">: null when there is no
77
+ // tag; { set, weight } when it reads; and with problem (and raw, the tag's content) when it does not quite: an
78
+ // unknown weight keeps the set at its plainest weight, an unknown set has no set at all. A search says so, and
79
+ // check warns, so a typo in a hand-written tag is never taken for the deck's real choice.
80
+ export function deckIconChoice(html) {
81
+ const tag = /<meta\b[^>]*\bname=["']hd-icons["'][^>]*>/i.exec(String(html ?? ""))?.[0];
82
+ if (!tag) return null;
83
+ const raw = (/\bcontent=["']([^"']*)["']/i.exec(tag)?.[1] ?? "").trim();
84
+ const [set, weight] = raw.toLowerCase().split(/[\s/:,]+/).filter(Boolean);
85
+ if (!ICON_SET_IDS.includes(set)) return { raw, problem: `<meta name="hd-icons" content="${raw}"> names no icon set; one of ${ICON_SET_IDS.join(", ")}, e.g. content="phosphor duotone"` };
86
+ try {
87
+ return { set, weight: setWeight(set, weight) };
88
+ } catch (e) {
89
+ return { set, weight: setWeight(set), raw, problem: `<meta name="hd-icons" content="${raw}">: ${e.message}; searched ${setWeight(set)}` };
90
+ }
91
+ }
92
+
93
+ // A starting set and weight for each built-in theme: a suggestion, not a rule (the author picks for the subject too).
94
+ export const THEME_ICON_PAIRINGS = {
95
+ house: "phosphor bold", longform: "phosphor light", blueprint: "tabler outline", soft: "phosphor duotone", loud: "phosphor fill",
96
+ print: "material fill", quiet: "lucide line", evening: "phosphor light", carousel: "phosphor thin",
97
+ };
@@ -0,0 +1,89 @@
1
+ // The icon sets a deck can draw from, all vendored in templates/icons/ by
2
+ // scripts/sync-icons.mjs with their licence text beside them, and all offline:
3
+ // Lucide (plain JSON) and Phosphor, Tabler and Material Symbols (gzipped JSON,
4
+ // unzipped on first use). Brand and logo icons are left out of every set.
5
+ //
6
+ // A deck records the set and weight it draws from in one place, a meta tag in
7
+ // its <head>: <meta name="hd-icons" content="phosphor duotone">
8
+ // Later searches default to it (deckIconChoice). Icons are optional: a deck
9
+ // with no icons, or no choice recorded, is fine.
10
+ import { packageGzipText, packageText } from "./files.mjs";
11
+ import { ICON_SETS, THEME_ICON_PAIRINGS, setMeta, setWeight } from "./iconChoice.mjs";
12
+
13
+ export { ICON_SETS, ICON_SET_IDS, THEME_ICON_PAIRINGS, deckIconChoice, nearestWeight, setWeight } from "./iconChoice.mjs";
14
+
15
+ const loaded = new Map();
16
+ // A set's icons as { name: [tags[], markup per weight] } plus its viewBox, source and licence.
17
+ export function loadIconSet(id) {
18
+ const meta = setMeta(id);
19
+ if (!loaded.has(id)) {
20
+ const raw = JSON.parse(id === "lucide" ? packageText(meta.file) : packageGzipText(meta.file));
21
+ const icons = new Map();
22
+ for (const [name, entry] of Object.entries(raw.icons)) {
23
+ // Lucide keeps its original shape [markup, tags]; the others are [tags, ...markup per weight].
24
+ const [tagText, marks] = id === "lucide" ? [entry[1], [entry[0]]] : [entry[0], entry.slice(1)];
25
+ icons.set(name, [tagText ? tagText.split(",") : [], marks]);
26
+ }
27
+ loaded.set(id, { ...meta, viewBox: raw.viewBox ?? "0 0 24 24", source: raw.source, license: raw.license, icons });
28
+ }
29
+ return loaded.get(id);
30
+ }
31
+
32
+ const attrEsc = (v) => String(v).replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;");
33
+
34
+ // One icon as inline SVG in currentColor, or null when the set has no such icon in that weight. Lucide keeps the
35
+ // exact markup it always had (class "icon lucide-<name>"); the other sets carry data-icon="<set> <weight>" so
36
+ // check can tell them apart.
37
+ export function renderIcon(id, name, { weight, strokeWidth = 2 } = {}) {
38
+ const set = loadIconSet(id);
39
+ const w = setWeight(id, weight);
40
+ const entry = set.icons.get(name);
41
+ const markup = entry?.[1][Object.keys(set.weights).indexOf(w)];
42
+ if (!markup) return null;
43
+ const draw = set.weights[w];
44
+ const sw = Number(strokeWidth);
45
+ const width = Number.isFinite(sw) && sw > 0 && sw <= 4 ? sw : 2;
46
+ if (id === "lucide")
47
+ return `<svg class="icon lucide-${name}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="${width}" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">${markup}</svg>`;
48
+ const head = `<svg class="icon ${id}-${attrEsc(name)}" data-icon="${id} ${w}" xmlns="http://www.w3.org/2000/svg" viewBox="${set.viewBox}"`;
49
+ if (draw === "stroke")
50
+ return `${head} fill="none" stroke="currentColor" stroke-width="${width}" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">${markup}</svg>`;
51
+ // Two-tone: Phosphor marks its second tone opacity="0.2". It takes the theme's --icon-duo (the icon's own colour
52
+ // unless a theme or brand sets another) at Phosphor's own 20%: a tint of the icon, not a muddy fill (at 30% a chat
53
+ // bubble or clipboard on Soft's pink tile read as a filled shape beside line-like ones). It still shows on every ground.
54
+ const body = draw === "duotone" ? markup.replace(/ opacity="0\.2"/g, ' class="duo" style="fill:var(--icon-duo,currentColor)" opacity="0.2"') : markup;
55
+ return `${head} fill="currentColor" aria-hidden="true">${body}</svg>`;
56
+ }
57
+
58
+ // The tag that records a choice, for a deck's <head>.
59
+ export const iconChoiceTag = (set, weight) => `<meta name="hd-icons" content="${set} ${setWeight(set, weight)}">`;
60
+
61
+ // Put the choice in a deck's HTML: replace the tag if there is one, else add it at the end of <head>.
62
+ export function recordIconChoice(html, set, weight) {
63
+ const tag = iconChoiceTag(set, weight);
64
+ if (/<meta\b[^>]*\bname=["']hd-icons["'][^>]*>/i.test(html)) return html.replace(/<meta\b[^>]*\bname=["']hd-icons["'][^>]*>/i, tag);
65
+ if (/<\/head>/i.test(html)) return html.replace(/<\/head>/i, ` ${tag}\n</head>`);
66
+ throw new Error("the deck's index.html has no <head> to record the icon set in");
67
+ }
68
+
69
+ // The sets, for `icons sets` and icon_sets: each with its weights, character, size, licence and a sample.
70
+ export function listIconSets() {
71
+ return {
72
+ sets: ICON_SETS.map((meta) => {
73
+ const set = loadIconSet(meta.id);
74
+ return {
75
+ id: meta.id,
76
+ name: meta.name,
77
+ weights: Object.keys(meta.weights),
78
+ draws: meta.weights,
79
+ icons: set.icons.size,
80
+ character: meta.character,
81
+ source: set.source,
82
+ license: set.license,
83
+ sample: meta.sample.map((name) => ({ name, svg: renderIcon(meta.id, name) })).filter((s) => s.svg),
84
+ };
85
+ }),
86
+ pairings: THEME_ICON_PAIRINGS,
87
+ record: `Pick one set and weight for the deck, to suit its theme and subject, and record it with use_icon_set { slug, set, weight } (CLI: hyperdecks icons use <deck> <set> [weight]): it writes ${iconChoiceTag("phosphor", "duotone")} in the deck's <head> and puts the icons already there (the layouts' own too) in the set. Later searches default to it. pairings suggests a start per built-in theme; the subject may suggest otherwise. Icons are optional; a deck with none is fine.`,
88
+ };
89
+ }
@@ -0,0 +1,48 @@
1
+ // Where an icon goes in each layout that has an icon slot (layouts/*.html, "Icon slot"). No imports: check
2
+ // (checkRules.mjs, which Convex loads) reads it as well as the icon search and the guide.
3
+
4
+ // What a layout's icon slot takes (layouts/*.html, "Icon slot"): where the icon goes, said as the markup an agent
5
+ // sees, and how one is put there mechanically (fillIconSlots: each match of `at` keeps its first group, the item's
6
+ // opening, and the icon follows it; the rest of a match, rail's number or the features card's old icon, is replaced).
7
+ // `count`, where given, finds every item whether or not it holds an icon yet (rail's `at` stops at a filled dot).
8
+ // Every slot is optional (the owner, 2026-11-28: icons are never required). A slide that uses one keeps it on all its
9
+ // items alike.
10
+ export const ICON_SLOTS = {
11
+ features: { where: 'first inside each <li class="card">, in place of the icon there', at: /(<li\b[^>]*\bclass="card\b[^"]*"[^>]*>)(?:<svg\b[^>]*class="icon[\s\S]*?<\/svg>|<img\b[^>]*class="icon[^>]*>)?/g },
12
+ staircase: { where: 'first inside each step\'s <li>, before its <span class="n">', at: /(<li\b[^>]*>)/g },
13
+ bento: { where: 'first inside each tile (<div class="big"> and each <div class="small">)', at: /(<div class="(?:big|small)"[^>]*>)/g },
14
+ rail: { where: 'inside each stop\'s <span class="dot">, in place of its number', at: /(<span class="dot">)[^<]*(?=<\/span>)/g, count: /<span class="dot">/g },
15
+ lanes: { where: 'first inside each <b class="who">, before the actor\'s name', at: /(<b class="who">)/g },
16
+ scorecard: { where: 'first inside each row\'s <li>, before its <b>', at: /(<li\b[^>]*>)/g },
17
+ spotlight: { where: 'first inside each option\'s <li> (the picked one too), before its <b>', at: /(<li\b[^>]*>)/g },
18
+ stack: { where: 'first inside each layer\'s <li>, before its <b>', at: /(<li\b[^>]*>)/g },
19
+ timeline: { where: 'first inside each milestone\'s <li>, before its <time>', at: /(<li\b[^>]*>)/g },
20
+ split: { where: 'inside the <span class="sticker">, in place of its icon (or put the product\'s logo there instead)', at: /(<span class="sticker"[^>]*>)(?:<svg\b[\s\S]*?<\/svg>)?/g, count: /<span class="sticker"/g },
21
+ compare: { where: 'first inside each <div class="label">, before its text', at: /(<div class="label">)/g },
22
+ };
23
+ export const ICON_SLOT_LAYOUTS = Object.keys(ICON_SLOTS);
24
+
25
+ // Glyphs a layout ships that are not item icons: the closer's button arrow. --for finds them so the author can put it in
26
+ // the deck's set, and the answer draws it bare (no class "icon": the button's text colour and size, never a tile).
27
+ // Not an icon slot: check never counts it, and the pictures guide does not offer it.
28
+ export const ICON_GLYPHS = {
29
+ closer: { where: 'inside the <a class="cta">, after its text, in place of its arrow', at: /(<a\b[^>]*\bclass="cta"[^>]*>[^<]*)(?:<svg\b[\s\S]*?<\/svg>)?/g, bare: true },
30
+ };
31
+
32
+ // --for names a layout with an icon slot, a slide made from one (staircase-2) or layout:slide-id; the icon carries
33
+ // no id, so only the layout matters. Its slot, or a readable error.
34
+ export function iconSlot(target) {
35
+ const t = String(target ?? "").trim().toLowerCase();
36
+ const name = t.includes(":") ? t.split(":")[0] : t;
37
+ const glyph = Object.keys(ICON_GLYPHS).find((n) => name === n || new RegExp(`^${n}-\\d+$`).test(name));
38
+ if (glyph) return { layout: glyph, where: ICON_GLYPHS[glyph].where, bare: true, oneSet: "Draw it from the deck's set, as its other icons; paste it unedited (bare: the button sizes and colours it)." };
39
+ const layout = ICON_SLOT_LAYOUTS.find((n) => name === n || new RegExp(`^${n}-\\d+$`).test(name));
40
+ if (!layout) throw new Error(`--for takes a layout with an icon slot: ${ICON_SLOT_LAYOUTS.join(", ")}, or closer for its button's arrow (or a slide made from one, like staircase-2); "${target}" is not one`);
41
+ return { layout, where: ICON_SLOTS[layout].where, oneSet: "Optional: use an icon where it helps the reader find or remember the item, and leave it out where the words carry it. If this slide has icons, its items match (all with one, or none), in one style for the deck (one set and weight, or one generated set, not both). The theme sizes and colours it, so paste it unedited." };
42
+ }
43
+
44
+ // A section's markup with `markup` in each of its icon slots (what the guide tells an agent to do, done mechanically).
45
+ export function fillIconSlots(section, layout, markup) {
46
+ return section.replace((ICON_SLOTS[layout] ?? ICON_GLYPHS[layout]).at, (_, open) => `${open}${typeof markup === "function" ? markup() : markup}`);
47
+ }
48
+