rpg-engine 0.19.0 → 0.20.0

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 (152) hide show
  1. package/README.md +9 -6
  2. package/dist/campaign/create-campaign.js +2 -2
  3. package/dist/campaign/find-campaign.d.ts +4 -0
  4. package/dist/campaign/find-campaign.js +5 -1
  5. package/dist/campaign/host-files.js +22 -0
  6. package/dist/campaign/index.d.ts +2 -2
  7. package/dist/campaign/index.js +2 -2
  8. package/dist/campaign/last-choices.d.ts +10 -4
  9. package/dist/campaign/last-choices.js +43 -17
  10. package/dist/campaign/settings.d.ts +10 -2
  11. package/dist/campaign/settings.js +30 -6
  12. package/dist/chats/chat.d.ts +33 -0
  13. package/dist/chats/chat.js +50 -0
  14. package/dist/chats/claude-code.d.ts +5 -0
  15. package/dist/chats/claude-code.js +39 -0
  16. package/dist/chats/codex.d.ts +3 -0
  17. package/dist/chats/codex.js +42 -0
  18. package/dist/chats/index.d.ts +5 -0
  19. package/dist/chats/index.js +12 -0
  20. package/dist/chats/keep.d.ts +10 -0
  21. package/dist/chats/keep.js +50 -0
  22. package/dist/chats/read.d.ts +8 -0
  23. package/dist/chats/read.js +46 -0
  24. package/dist/cli/cli.js +6 -1
  25. package/dist/cli/command-line.js +3 -2
  26. package/dist/commands/book.d.ts +55 -0
  27. package/dist/commands/book.js +105 -0
  28. package/dist/commands/chats.d.ts +38 -0
  29. package/dist/commands/chats.js +93 -0
  30. package/dist/commands/config/config.js +1 -1
  31. package/dist/commands/config/dashboard.d.ts +8 -1
  32. package/dist/commands/config/dashboard.js +63 -15
  33. package/dist/commands/config/words.d.ts +1 -1
  34. package/dist/commands/config/words.js +17 -4
  35. package/dist/commands/find.js +1 -1
  36. package/dist/commands/image.d.ts +9 -0
  37. package/dist/commands/image.js +95 -18
  38. package/dist/commands/index.js +4 -0
  39. package/dist/commands/init.js +3 -3
  40. package/dist/commands/scene/close.d.ts +2 -0
  41. package/dist/commands/scene/close.js +13 -2
  42. package/dist/commands/scene/result.d.ts +2 -0
  43. package/dist/commands/scene/scene.d.ts +2 -0
  44. package/dist/commands/shared/campaign/book.d.ts +29 -0
  45. package/dist/commands/shared/campaign/book.js +95 -0
  46. package/dist/commands/shared/campaign/chats.d.ts +11 -0
  47. package/dist/commands/shared/campaign/chats.js +29 -0
  48. package/dist/commands/shared/campaign/images.js +7 -1
  49. package/dist/commands/shared/campaign/mode.js +3 -1
  50. package/dist/commands/shared/campaign/saves.js +13 -5
  51. package/dist/commands/shared/sheet/sheet.d.ts +7 -0
  52. package/dist/commands/shared/sheet/sheet.js +27 -0
  53. package/dist/commands/shared/time/dawn.d.ts +1 -1
  54. package/dist/commands/shared/time/dawn.js +19 -7
  55. package/dist/commands/status.d.ts +1 -0
  56. package/dist/commands/status.js +4 -0
  57. package/dist/commands/view/page.js +4 -3
  58. package/dist/commands/view/result.d.ts +2 -0
  59. package/dist/commands/view/view.d.ts +1 -0
  60. package/dist/commands/view/view.js +4 -0
  61. package/dist/core/consents.d.ts +2 -2
  62. package/dist/core/consents.js +3 -3
  63. package/dist/core/context.d.ts +38 -2
  64. package/dist/core/download.js +1 -1
  65. package/dist/dashboard/acts/names.js +10 -5
  66. package/dist/dashboard/acts/sending.js +5 -2
  67. package/dist/dashboard/acts/sheet.js +66 -15
  68. package/dist/dashboard/api.js +3 -3
  69. package/dist/dashboard/app.js +2 -2
  70. package/dist/dashboard/guide/ar.md +11 -10
  71. package/dist/dashboard/guide/cs.md +10 -9
  72. package/dist/dashboard/guide/da.md +12 -11
  73. package/dist/dashboard/guide/de.md +12 -11
  74. package/dist/dashboard/guide/el.md +12 -11
  75. package/dist/dashboard/guide/en.md +9 -8
  76. package/dist/dashboard/guide/es.md +10 -9
  77. package/dist/dashboard/guide/fi.md +10 -9
  78. package/dist/dashboard/guide/fr.md +16 -15
  79. package/dist/dashboard/guide/he.md +11 -10
  80. package/dist/dashboard/guide/hi.md +10 -9
  81. package/dist/dashboard/guide/hu.md +14 -13
  82. package/dist/dashboard/guide/is.md +10 -9
  83. package/dist/dashboard/guide/it.md +13 -12
  84. package/dist/dashboard/guide/ja.md +10 -9
  85. package/dist/dashboard/guide/ko.md +11 -10
  86. package/dist/dashboard/guide/nb.md +12 -11
  87. package/dist/dashboard/guide/nl.md +10 -9
  88. package/dist/dashboard/guide/pl.md +11 -10
  89. package/dist/dashboard/guide/pt.md +12 -11
  90. package/dist/dashboard/guide/ro.md +10 -9
  91. package/dist/dashboard/guide/ru.md +12 -11
  92. package/dist/dashboard/guide/sv.md +10 -9
  93. package/dist/dashboard/guide/tr.md +13 -12
  94. package/dist/dashboard/guide/uk.md +13 -12
  95. package/dist/dashboard/guide/zh.md +11 -10
  96. package/dist/dashboard/i18n/ar.json +31 -5
  97. package/dist/dashboard/i18n/cs.json +31 -5
  98. package/dist/dashboard/i18n/da.json +31 -5
  99. package/dist/dashboard/i18n/de.json +31 -5
  100. package/dist/dashboard/i18n/el.json +31 -5
  101. package/dist/dashboard/i18n/es.json +31 -5
  102. package/dist/dashboard/i18n/fi.json +31 -5
  103. package/dist/dashboard/i18n/fr.json +31 -5
  104. package/dist/dashboard/i18n/he.json +31 -5
  105. package/dist/dashboard/i18n/hi.json +31 -5
  106. package/dist/dashboard/i18n/hu.json +31 -5
  107. package/dist/dashboard/i18n/is.json +31 -5
  108. package/dist/dashboard/i18n/it.json +32 -6
  109. package/dist/dashboard/i18n/ja.json +31 -5
  110. package/dist/dashboard/i18n/ko.json +31 -5
  111. package/dist/dashboard/i18n/nb.json +31 -5
  112. package/dist/dashboard/i18n/nl.json +31 -5
  113. package/dist/dashboard/i18n/pl.json +31 -5
  114. package/dist/dashboard/i18n/pt.json +31 -5
  115. package/dist/dashboard/i18n/ro.json +31 -5
  116. package/dist/dashboard/i18n/ru.json +31 -5
  117. package/dist/dashboard/i18n/sv.json +31 -5
  118. package/dist/dashboard/i18n/tr.json +31 -5
  119. package/dist/dashboard/i18n/uk.json +31 -5
  120. package/dist/dashboard/i18n/zh.json +31 -5
  121. package/dist/dashboard/journal/book.js +106 -0
  122. package/dist/dashboard/journal/journal.js +9 -8
  123. package/dist/dashboard/parts/labels.js +6 -0
  124. package/dist/dashboard/parts/widgets.js +1 -1
  125. package/dist/dashboard/place/view.js +1 -1
  126. package/dist/dashboard/settings/settings.js +10 -4
  127. package/dist/dashboard/settings/setup.js +5 -3
  128. package/dist/dashboard/sheet/sheet.js +8 -5
  129. package/dist/dashboard/style.css +459 -96
  130. package/dist/dashboard/world/calendar.js +1 -1
  131. package/dist/dashboard/world/lore.js +1 -1
  132. package/dist/helpers/briefs.d.ts +5 -0
  133. package/dist/helpers/briefs.js +8 -0
  134. package/dist/helpers/chosen.d.ts +8 -2
  135. package/dist/helpers/chosen.js +110 -6
  136. package/dist/helpers/codex.js +2 -1
  137. package/dist/helpers/index.d.ts +2 -2
  138. package/dist/helpers/index.js +2 -2
  139. package/dist/images/images.d.ts +2 -0
  140. package/dist/images/images.js +16 -2
  141. package/dist/images/index.d.ts +1 -1
  142. package/dist/images/index.js +1 -1
  143. package/dist/server/approver.d.ts +6 -0
  144. package/dist/server/approver.js +28 -0
  145. package/dist/server/chats.d.ts +3 -0
  146. package/dist/server/chats.js +27 -0
  147. package/dist/server/dashboard/news.js +36 -5
  148. package/dist/server/mcp.js +37 -6
  149. package/dist/server/player-acts.d.ts +7 -2
  150. package/dist/server/player-acts.js +10 -3
  151. package/instructions/start.md +1 -1
  152. package/package.json +2 -2
@@ -81,7 +81,7 @@ export function PlaceMap({ map, place, acting, picking, choosing, bare = false,
81
81
  box.scrollLeft = Math.max(0, x * shown - box.clientWidth / 2);
82
82
  }, [map.columns, map.rows, self?.at.column, self?.at.row]);
83
83
  const drawn = (_jsxs(_Fragment, { children: [_jsx("path", { class: "lm-floor-fill", d: floor, "fill-rule": "evenodd" }), _jsx("g", { class: "lm-ground", "clip-path": "url(#lm-open)", children: open.filter((square) => groundKinds.includes(kindAt(map, square))).map((square) => _jsx(Ground, { kind: kindAt(map, square), x: X(square.column), y: Y(square.row), side: size, seed: square }, squareName(square))) }), _jsx("path", { class: "lm-grid", d: open.map((square) => `M${X(square.column)} ${Y(square.row)}h${size}v${size}h${-size}z`).join(""), "clip-path": "url(#lm-open)" }), open.filter((square) => featureAt(square)?.difficult).map((square) => _jsx(Corner, { x: X(square.column), y: Y(square.row), side: size }, squareName(square))), things.map((feature) => piecesOf(map, feature.symbol, feature.kind).map((piece) => (_jsxs("g", { class: `lm-thing ${feature.kind}`, children: [_jsx("title", { children: [featureName(feature), feature.blocks ? t("blocks") : "", feature.difficult ? t("difficult") : ""].filter((part) => part !== "").join(", ") }), _jsx(Thing, { kind: feature.kind, symbol: feature.symbol, x: X(piece.left), y: Y(piece.top), w: (piece.right - piece.left) * size, h: (piece.bottom - piece.top) * size, cells: piece.squares.map((square) => [X(square.column), Y(square.row)]) })] }, `${feature.symbol} ${piece.left} ${piece.top}`)))), _jsx("path", { class: "lm-shade", d: outline, "clip-path": "url(#lm-open)", filter: "url(#lm-blur)" })] }));
84
- return (_jsxs("section", { class: "lm", "aria-labelledby": "lm-title", children: [_jsx(CardHead, { icon: iconPath("world"), title: _jsx("h3", { id: "lm-title", children: t("Map") }), note: place }), _jsx("div", { ref: frame, class: picking === undefined && choosing === undefined ? "lm-frame" : "lm-frame panned", style: { "--map-width": String(width) }, children: _jsxs("svg", { ref: svg, class: `lm-svg lm-look-${map.ground}`, viewBox: `0 0 ${width} ${height}`, ...(picking === undefined && choosing === undefined ? {} : { width: width * 1.2 }), role: "img", "aria-label": t("Map of {place}", { place }), children: [_jsxs("defs", { children: [_jsx(Patterns, {}), _jsx(GlassDefs, { prefix: "lm" }), _jsxs("radialGradient", { id: "lm-hostile-glow", children: [_jsx("stop", { offset: "0.75", "stop-color": "#c8321f", "stop-opacity": "0.3" }), _jsx("stop", { offset: "1", "stop-color": "#c8321f", "stop-opacity": "0" })] }), _jsx("clipPath", { id: "lm-open", children: _jsx("path", { d: floor, "clip-rule": "evenodd" }) }), !walled && (_jsx("mask", { id: "lm-fade", maskUnits: "userSpaceOnUse", x: 0, y: 0, width: width, height: height, children: _jsx("rect", { x: X(0) + size * 0.35, y: Y(0) + size * 0.35, width: map.columns * size - size * 0.7, height: map.rows * size - size * 0.7, fill: "#fff", filter: "url(#lm-soft)" }) })), standing.map((one, index) => (_jsx("clipPath", { id: `lm-token-${index}`, children: _jsx("circle", { cx: middle(one)[0], cy: middle(one)[1], r: size * (one.side ?? 1) * 0.43 }) }, index)))] }), _jsx("rect", { class: "lm-paper", width: width, height: height }), _jsx("g", { class: "lm-walls", children: squares.filter((square) => ["wall", "rock", "window"].includes(kindAt(map, square)) && nearRoom(square)).map((square) => (_jsxs(Fragment, { children: [_jsx("rect", { class: "lm-wall-under", x: X(square.column), y: Y(square.row), width: size, height: size }), _jsx("rect", { class: `lm-wall ${kindAt(map, square)}`, x: X(square.column), y: Y(square.row), width: size, height: size })] }, squareName(square)))) }), walled ? drawn : _jsx("g", { mask: "url(#lm-fade)", children: drawn }), reach.length > 0 && (_jsx("g", { class: "lm-out", "aria-hidden": "true", "clip-path": "url(#lm-open)", children: open.filter((square) => !reach.some((near) => near.column === square.column && near.row === square.row)).map((square) => (_jsx("rect", { x: X(square.column), y: Y(square.row), width: size, height: size }, squareName(square)))) })), _jsx("path", { class: "lm-outline", d: outline, filter: "url(#lm-ink)" }), squares.filter((square) => ["door", "open-door", "secret-door"].includes(kindAt(map, square))).map((square) => (_jsx(Door, { kind: kindAt(map, square), name: featureAt(square)?.name ?? "door", square: square, map: map, x: X(square.column), y: Y(square.row) }, squareName(square)))), map.exits.map((exit, index) => {
84
+ return (_jsxs("section", { class: bare ? "lm bare" : "lm", ...(bare ? { "aria-label": `${t("Map")}: ${place}` } : { "aria-labelledby": "lm-title" }), children: [!bare && _jsx(CardHead, { icon: iconPath("world"), title: _jsx("h3", { id: "lm-title", children: t("Map") }), note: place }), _jsx("div", { ref: frame, class: picking === undefined && choosing === undefined ? "lm-frame" : "lm-frame panned", style: { "--map-width": String(width) }, children: _jsxs("svg", { ref: svg, class: `lm-svg lm-look-${map.ground}`, viewBox: `0 0 ${width} ${height}`, ...(picking === undefined && choosing === undefined ? {} : { width: width * 1.2 }), role: "img", "aria-label": t("Map of {place}", { place }), children: [_jsxs("defs", { children: [_jsx(Patterns, {}), _jsx(GlassDefs, { prefix: "lm" }), _jsxs("radialGradient", { id: "lm-hostile-glow", children: [_jsx("stop", { offset: "0.75", "stop-color": "#c8321f", "stop-opacity": "0.3" }), _jsx("stop", { offset: "1", "stop-color": "#c8321f", "stop-opacity": "0" })] }), _jsx("clipPath", { id: "lm-open", children: _jsx("path", { d: floor, "clip-rule": "evenodd" }) }), !walled && (_jsx("mask", { id: "lm-fade", maskUnits: "userSpaceOnUse", x: 0, y: 0, width: width, height: height, children: _jsx("rect", { x: X(0) + size * 0.35, y: Y(0) + size * 0.35, width: map.columns * size - size * 0.7, height: map.rows * size - size * 0.7, fill: "#fff", filter: "url(#lm-soft)" }) })), standing.map((one, index) => (_jsx("clipPath", { id: `lm-token-${index}`, children: _jsx("circle", { cx: middle(one)[0], cy: middle(one)[1], r: size * (one.side ?? 1) * 0.43 }) }, index)))] }), _jsx("rect", { class: "lm-paper", width: width, height: height }), _jsx("g", { class: "lm-walls", children: squares.filter((square) => ["wall", "rock", "window"].includes(kindAt(map, square)) && nearRoom(square)).map((square) => (_jsxs(Fragment, { children: [_jsx("rect", { class: "lm-wall-under", x: X(square.column), y: Y(square.row), width: size, height: size }), _jsx("rect", { class: `lm-wall ${kindAt(map, square)}`, x: X(square.column), y: Y(square.row), width: size, height: size })] }, squareName(square)))) }), walled ? drawn : _jsx("g", { mask: "url(#lm-fade)", children: drawn }), reach.length > 0 && (_jsx("g", { class: "lm-out", "aria-hidden": "true", "clip-path": "url(#lm-open)", children: open.filter((square) => !reach.some((near) => near.column === square.column && near.row === square.row)).map((square) => (_jsx("rect", { x: X(square.column), y: Y(square.row), width: size, height: size }, squareName(square)))) })), _jsx("path", { class: "lm-outline", d: outline, filter: "url(#lm-ink)" }), squares.filter((square) => ["door", "open-door", "secret-door"].includes(kindAt(map, square))).map((square) => (_jsx(Door, { kind: kindAt(map, square), name: featureAt(square)?.name ?? "door", square: square, map: map, x: X(square.column), y: Y(square.row) }, squareName(square)))), map.exits.map((exit, index) => {
85
85
  const square = squareOf(exit.square);
86
86
  return square === undefined ? null : _jsx(Exit, { side: sides[index], to: exit.to, x: X(square.column) + size / 2, y: Y(square.row) + size / 2, letters: Math.max(13, 12 / scale) }, exit.square);
87
87
  }), _jsxs("g", { class: "lm-coordinates", "font-size": letters, children: [Array.from({ length: map.columns }, (_, column) => _jsx("text", { x: X(column) + size / 2, y: top - 10, "text-anchor": "middle", children: columnName(column) }, `c${column}`)), Array.from({ length: map.rows }, (_, row) => _jsx("text", { x: left - 10, y: Y(row) + size / 2, "text-anchor": "end", "dominant-baseline": "middle", children: row + 1 }, `r${row}`))] }), _jsx("g", { class: "lm-tokens", children: standing.map((one, index) => {
@@ -23,7 +23,7 @@ const groups = [
23
23
  { names: ["dice", "master-rolls", "units"], system: true },
24
24
  { names: ["lines", "veils"] },
25
25
  { names: ["orders"] },
26
- { names: ["pictures", "language"] },
26
+ { names: ["pictures", "pictures-by", "language"] },
27
27
  ];
28
28
  /** The Settings section; with `several` player characters, what a value means says so where it speaks of one character (D-480 (2)). */
29
29
  export function SettingsView({ version, several = false }) {
@@ -159,8 +159,14 @@ function writtenLabel(setting, value) {
159
159
  const rate = setting === "between-sessions" ? rateParts(value) : undefined;
160
160
  return rate === undefined ? valueLabel(value) : t("{game} every {real}", rate);
161
161
  }
162
- /** What a value the page does not offer means: a rate of the time between sessions as the others say it, or that it reads as none (D-133); undefined for another setting's. */
162
+ /**
163
+ * What a value the page does not offer means: a rate of the time between sessions as the others say it, or that it reads as none (D-133); an image tool of
164
+ * the master's that makes the pictures (D-572); undefined for another setting's.
165
+ */
163
166
  function writtenMeans(setting, value) {
167
+ if (setting === "pictures-by") {
168
+ return t("the master makes them with {tool}", { tool: value });
169
+ }
164
170
  if (setting !== "between-sessions") {
165
171
  return undefined;
166
172
  }
@@ -299,9 +305,9 @@ function TextSetting({ setting, label, onChange }) {
299
305
  field.current?.focus();
300
306
  }, children: t("Clear") }))] })] }));
301
307
  }
302
- /** What the player should know of a setting on this computer, as how to have pictures: its lines, its steps in order, and the commands to copy. */
308
+ /** What the player should know of a setting on this computer, as how to have pictures: its lines, its steps in order, the commands to copy, and a line after. */
303
309
  function SettingNote({ note }) {
304
- const blocks = noteBlocks(t(note.text));
310
+ const blocks = [...noteBlocks(t(note.text, note.values)), ...(note.also === undefined ? [] : [t(note.also, note.values)])];
305
311
  return (_jsxs("div", { class: note.fix ? "setting-note fix" : "setting-note", children: [_jsx(Icon, { name: "info" }), _jsx("div", { class: "setting-note-text", children: blocks.map((block, index) => typeof block === "string" ? _jsx("p", { children: withCommands(block) }, index) : (_jsx("ol", { children: block.map((step) => _jsx("li", { children: withCommands(step) }, step)) }, index))) })] }));
306
312
  }
307
313
  /** A note's lines, those numbered as steps together. */
@@ -5,7 +5,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "preact/jsx-runtime";
5
5
  import { useEffect, useRef, useState } from "preact/hooks";
6
6
  import { changeSetting, readSetup, sendSetupWord } from "../api.js";
7
7
  import { Icon } from "../parts/icons.js";
8
- import { phraseLabel, settingLabel, valueLabel } from "../parts/labels.js";
8
+ import { phraseLabel, settingLabel, systemNameLabel, valueLabel } from "../parts/labels.js";
9
9
  import { Master } from "../shell/master.js";
10
10
  import { arrowStep, t } from "../text.js";
11
11
  // The steps of a campaign before play (MOD-1).
@@ -71,7 +71,7 @@ function Question({ question, count, left, focus, onBack, onNext, onLeave, onTou
71
71
  const resting = useRef(undefined);
72
72
  const heading = useRef(null);
73
73
  const value = picked ?? question.value;
74
- const title = question.question === undefined ? settingLabel(question.name) : t(question.question);
74
+ const title = question.question === undefined ? settingLabel(question.name) : t(question.question, question.game === undefined ? {} : { game: systemNameLabel(question.game) });
75
75
  const id = `setup-${question.name.replace(/[^a-z0-9]+/gi, "-")}`;
76
76
  const isList = lists.has(question.name);
77
77
  const open = value === undefined && question.items === undefined && !left;
@@ -122,7 +122,9 @@ function Choices({ question, value, labelledBy, onPick }) {
122
122
  onPick(choices[next].value, true);
123
123
  buttons[next]?.focus();
124
124
  };
125
- return (_jsx("div", { class: "setup-choices", role: "radiogroup", "aria-labelledby": labelledBy, onKeyDown: move, children: choices.map((choice, index) => (_jsxs("button", { type: "button", role: "radio", "aria-checked": value === choice.value, tabIndex: index === stop ? 0 : -1, class: "setup-choice", onClick: () => onPick(choice.value, false), children: [_jsxs("strong", { children: [choice.label === undefined ? valueLabel(choice.value) : phraseLabel(t(choice.label)), choice.value === question.suggested && _jsx("span", { class: "setup-suggested", children: choice.value === question.last ? t("Like last time") : t("Suggested") })] }), choice.means !== undefined && _jsx("span", { children: phraseLabel(t(choice.means)) })] }, choice.value))) }));
125
+ return (_jsx("div", { class: "setup-choices", role: "radiogroup", "aria-labelledby": labelledBy, onKeyDown: move, children: choices.map((choice, index) => (_jsxs("button", { type: "button", role: "radio", "aria-checked": value === choice.value, tabIndex: index === stop ? 0 : -1, class: "setup-choice", onClick: () => onPick(choice.value, false), children: [_jsxs("strong", { children: [choice.label === undefined ? valueLabel(choice.value) : phraseLabel(t(choice.label)), choice.value === question.last
126
+ ? _jsx("span", { class: "setup-last", children: t("Like last time") })
127
+ : choice.value === question.suggested && _jsx("span", { class: "setup-suggested", children: t("Suggested") })] }), choice.means !== undefined && _jsx("span", { children: phraseLabel(t(choice.means)) })] }, choice.value))) }));
126
128
  }
127
129
  /** A list of the setup, lines or veils: its items to take off, a field to add one, and None for a player who wants none. */
128
130
  function ListQuestion({ question, onTouch, onProblem }) {
@@ -231,21 +231,24 @@ function ItemsTable({ group, fields }) {
231
231
  }
232
232
  const name = itemName(item.item);
233
233
  const bonds = (item.bonds ?? []).map((list) => fieldLabel(list, fields));
234
- const said = [
234
+ const parts = [
235
235
  item.inside === undefined ? undefined : t("in {container}", { container: itemName(item.inside) }),
236
236
  item.equipped === true ? t("Equipped") : undefined,
237
237
  ...bonds,
238
- ].filter((part) => part !== undefined).map((part) => `, ${part}`).join("");
238
+ ].filter((part) => part !== undefined);
239
+ const said = parts.map((part) => `, ${part}`).join("");
240
+ // What the thing's card says under its name: how many, where it is, whether equipped.
241
+ const facts = [...(count(item) === "" ? [] : [`×${count(item)}`]), ...parts];
239
242
  const words = (_jsxs(_Fragment, { children: [marked && _jsx(ItemPicture, { image: item.image, equipped: item.equipped === true }), _jsx("span", { children: name }), count(item) !== "" && _jsx("span", { class: "item-count", children: ` (${count(item)})` }), bonds.length > 0 && (_jsx("span", { class: "item-bond", "data-tip": bonds.join(", "), "aria-hidden": "true", children: _jsx(Icon, { name: "bond" }) })), said !== "" && _jsx("span", { class: "visually-hidden", children: said })] }));
240
243
  // The campaign changed its page of the game system (D-564): an asterisk after its name, outside what acts.
241
244
  const changed = item.layered === true && _jsx(ChangedMark, {});
242
- // The name acts, when the system names a verb for it; a container's opens and closes what it holds (D-495).
245
+ // The name opens the thing's card, with its verbs when the system names some; a container's opens and closes what it holds (D-495).
243
246
  const verbs = holds(index) ? undefined : itemVerbs(acts?.actions, item);
244
247
  return (_jsxs("tr", { class: item.depth === undefined ? undefined : "inside", children: [_jsxs("th", { scope: "row", class: holds(index) ? "holds" : undefined, style: item.depth === undefined ? undefined : { "--depth": item.depth }, children: [holds(index)
245
248
  ? (_jsxs("button", { type: "button", class: "fold", "aria-expanded": !closed.has(key(index)), onClick: () => toggle(index), children: [_jsx(Icon, { name: "fold" }), words] }))
246
- : verbs === undefined
249
+ : acts === undefined
247
250
  ? words
248
- : _jsx(ActName, { verbs: verbs, item: name, said: `${count(item) === "" ? "" : ` (${count(item)})`}${said}`, children: words }), changed] }), !carried && item.values.map((value) => _jsx("td", { class: widgetOf(value) === "text" ? undefined : "num", children: shownText(value.text, value.kind) }, value.field))] }, key(index)));
251
+ : (_jsx(ActName, { verbs: verbs ?? [], item: name, page: item.item, facts: facts, ...(item.document === true ? { document: true } : {}), said: `${count(item) === "" ? "" : ` (${count(item)})`}${said}`, children: words })), changed] }), !carried && item.values.map((value) => _jsx("td", { class: widgetOf(value) === "text" ? undefined : "num", children: shownText(value.text, value.kind) }, value.field))] }, key(index)));
249
252
  }) })] }));
250
253
  }
251
254
  /** A thing's picture, one colour as the words beside it, gold when equipped: the game's drawing of its kind as a mask, or the page's own of any thing. */