rpg-engine 0.16.0 → 0.17.1

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 (116) hide show
  1. package/dist/adventures/source.d.ts +3 -1
  2. package/dist/adventures/source.js +31 -1
  3. package/dist/campaign/find-campaign.js +8 -4
  4. package/dist/commands/import/import.js +23 -1
  5. package/dist/commands/package/package.js +43 -9
  6. package/dist/commands/package/result.d.ts +3 -4
  7. package/dist/commands/save.d.ts +1 -1
  8. package/dist/commands/shared/books/adventure-layers.d.ts +89 -0
  9. package/dist/commands/shared/books/adventure-layers.js +201 -0
  10. package/dist/commands/shared/books/adventures.d.ts +25 -8
  11. package/dist/commands/shared/books/adventures.js +60 -22
  12. package/dist/commands/shared/characters/thoughts.d.ts +7 -4
  13. package/dist/commands/shared/characters/thoughts.js +15 -5
  14. package/dist/commands/shared/scene/scene.js +3 -1
  15. package/dist/commands/shared/sheet/sheet.d.ts +2 -0
  16. package/dist/commands/show.d.ts +6 -0
  17. package/dist/commands/show.js +16 -2
  18. package/dist/commands/thoughts.d.ts +1 -0
  19. package/dist/commands/thoughts.js +23 -15
  20. package/dist/commands/view/layers.d.ts +36 -0
  21. package/dist/commands/view/layers.js +53 -0
  22. package/dist/commands/view/memory.js +12 -6
  23. package/dist/commands/view/page.js +4 -1
  24. package/dist/commands/view/result.d.ts +8 -1
  25. package/dist/commands/view/view.d.ts +3 -0
  26. package/dist/commands/view/view.js +5 -2
  27. package/dist/commands/write/inheritance.js +1 -5
  28. package/dist/commands/write/layer.d.ts +11 -3
  29. package/dist/commands/write/layer.js +27 -7
  30. package/dist/commands/write/write.d.ts +1 -0
  31. package/dist/commands/write/write.js +6 -2
  32. package/dist/core/length.d.ts +4 -1
  33. package/dist/core/length.js +13 -2
  34. package/dist/core/text.d.ts +2 -0
  35. package/dist/core/text.js +4 -0
  36. package/dist/dashboard/api.js +18 -0
  37. package/dist/dashboard/app.js +5 -1
  38. package/dist/dashboard/guide/ar.md +3 -1
  39. package/dist/dashboard/guide/cs.md +5 -3
  40. package/dist/dashboard/guide/da.md +5 -3
  41. package/dist/dashboard/guide/de.md +3 -1
  42. package/dist/dashboard/guide/el.md +5 -3
  43. package/dist/dashboard/guide/en.md +2 -0
  44. package/dist/dashboard/guide/es.md +5 -3
  45. package/dist/dashboard/guide/fi.md +5 -3
  46. package/dist/dashboard/guide/fr.md +5 -3
  47. package/dist/dashboard/guide/he.md +4 -2
  48. package/dist/dashboard/guide/hi.md +5 -3
  49. package/dist/dashboard/guide/hu.md +5 -3
  50. package/dist/dashboard/guide/is.md +5 -3
  51. package/dist/dashboard/guide/it.md +3 -1
  52. package/dist/dashboard/guide/ja.md +3 -1
  53. package/dist/dashboard/guide/ko.md +3 -1
  54. package/dist/dashboard/guide/nb.md +5 -3
  55. package/dist/dashboard/guide/nl.md +4 -2
  56. package/dist/dashboard/guide/pl.md +5 -3
  57. package/dist/dashboard/guide/pt.md +4 -2
  58. package/dist/dashboard/guide/ro.md +5 -3
  59. package/dist/dashboard/guide/ru.md +4 -2
  60. package/dist/dashboard/guide/sv.md +5 -3
  61. package/dist/dashboard/guide/tr.md +4 -2
  62. package/dist/dashboard/guide/uk.md +5 -3
  63. package/dist/dashboard/guide/zh.md +4 -2
  64. package/dist/dashboard/i18n/ar.json +25 -0
  65. package/dist/dashboard/i18n/cs.json +25 -0
  66. package/dist/dashboard/i18n/da.json +25 -0
  67. package/dist/dashboard/i18n/de.json +25 -0
  68. package/dist/dashboard/i18n/el.json +25 -0
  69. package/dist/dashboard/i18n/es.json +25 -0
  70. package/dist/dashboard/i18n/fi.json +25 -0
  71. package/dist/dashboard/i18n/fr.json +25 -0
  72. package/dist/dashboard/i18n/he.json +25 -0
  73. package/dist/dashboard/i18n/hi.json +25 -0
  74. package/dist/dashboard/i18n/hu.json +25 -0
  75. package/dist/dashboard/i18n/is.json +25 -0
  76. package/dist/dashboard/i18n/it.json +25 -0
  77. package/dist/dashboard/i18n/ja.json +25 -0
  78. package/dist/dashboard/i18n/ko.json +25 -0
  79. package/dist/dashboard/i18n/nb.json +25 -0
  80. package/dist/dashboard/i18n/nl.json +25 -0
  81. package/dist/dashboard/i18n/pl.json +25 -0
  82. package/dist/dashboard/i18n/pt.json +25 -0
  83. package/dist/dashboard/i18n/ro.json +25 -0
  84. package/dist/dashboard/i18n/ru.json +25 -0
  85. package/dist/dashboard/i18n/sv.json +25 -0
  86. package/dist/dashboard/i18n/tr.json +25 -0
  87. package/dist/dashboard/i18n/uk.json +25 -0
  88. package/dist/dashboard/i18n/zh.json +25 -0
  89. package/dist/dashboard/packages/changes.js +111 -0
  90. package/dist/dashboard/packages/installed.js +2 -2
  91. package/dist/dashboard/packages/packages.js +12 -7
  92. package/dist/dashboard/parts/changed.js +37 -0
  93. package/dist/dashboard/parts/refusals.js +4 -0
  94. package/dist/dashboard/parts/widgets.js +3 -1
  95. package/dist/dashboard/play/choices.js +3 -2
  96. package/dist/dashboard/sheet/sheet.js +10 -7
  97. package/dist/dashboard/shell/shown.js +1 -0
  98. package/dist/dashboard/style.css +214 -1
  99. package/dist/dashboard/world/lore.js +5 -1
  100. package/dist/pages/index.d.ts +3 -3
  101. package/dist/pages/index.js +3 -3
  102. package/dist/pages/layers.d.ts +5 -3
  103. package/dist/pages/layers.js +15 -7
  104. package/dist/pages/load.d.ts +2 -0
  105. package/dist/pages/load.js +16 -3
  106. package/dist/pages/markdown.d.ts +5 -1
  107. package/dist/pages/markdown.js +13 -1
  108. package/dist/pages/write-layer.d.ts +5 -0
  109. package/dist/pages/write-layer.js +59 -5
  110. package/dist/server/dashboard/choices.d.ts +2 -0
  111. package/dist/server/dashboard/choices.js +4 -2
  112. package/dist/server/dashboard/index.js +5 -1
  113. package/dist/server/dashboard/writes.d.ts +7 -0
  114. package/dist/server/dashboard/writes.js +39 -0
  115. package/instructions/voices.md +1 -1
  116. package/package.json +1 -1
@@ -1,9 +1,9 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "preact/jsx-runtime";
2
- // The Packages section (D-485, D-486, D-488), in three tabs: Installed first, what is here by kind: the game system, the campaign's adventures with its own
3
- // export last, the extensions with whether the campaign uses each, the languages; its tab counts the updates and marks what the campaign lacks. Then Add: one
4
- // card to add a package: the catalog of what npm and GitHub offer first, always open, then a link, an npm name, a folder or a file. Then Library: the folders
5
- // of the player's books for this campaign alone (D-491 (13)). One work at a time; one not ours with code, or a folder added to the library, waits for the
6
- // player's yes in a window of their computer, said in every tab.
2
+ // The Packages section (D-485, D-486, D-488), in three tabs: Installed first, what is here by kind: the game system, with the pages of it the campaign changed
3
+ // under the one it plays (D-564), the campaign's adventures with its own export last, the extensions with whether the campaign uses each, the languages; its
4
+ // tab counts the updates and marks what the campaign lacks. Then Add: one card to add a package: the catalog of what npm and GitHub offer first, always open,
5
+ // then a link, an npm name, a folder or a file. Then Library: the folders of the player's books for this campaign alone (D-491 (13)). One work at a time; one
6
+ // not ours with code, or a folder added to the library, waits for the player's yes in a window of their computer, said in every tab.
7
7
  import { useEffect, useRef, useState } from "preact/hooks";
8
8
  import { sectionAddress } from "../address.js";
9
9
  import { addFile, addSource, changeLibrary, changePackage, readCatalog, readEngine, readLibrary, readPackages, updateEngine, } from "../api.js";
@@ -15,13 +15,18 @@ import { PageHead } from "../shell/pages.js";
15
15
  import { PageTabs } from "../shell/tabs.js";
16
16
  import { t } from "../text.js";
17
17
  import { AddField, CatalogList, entryOf, entryTitle, newerOf, updateCount } from "./catalog.js";
18
+ import { ChangedPages } from "./changes.js";
18
19
  import { EngineCard, engineName, focusEngine, keepUpdate, keptUpdate, NeedsEngine } from "./engine.js";
19
20
  import { AdventureRow, ExtensionRow, LanguageRow, languageTitle, MissingRow, SystemRow } from "./installed.js";
20
21
  import { libraryReading, LibraryTab } from "./library.js";
21
22
  import { addedText, doneText, failure, uninstallText } from "./outcomes.js";
22
23
  import { CardSaid, SaidNote, WorkNote } from "./rows.js";
23
24
  import { ShareCampaign } from "./share.js";
24
- export function PackagesPage({ version, tab }) {
25
+ /**
26
+ * The page as the game last changed (`version`), at the tab the address names and what it names in it (`item`); with the pages of the game system the
27
+ * campaign changed, as the overview gives them (D-564), whether a scene is being played, when none is put back, and what reads the game again once one is.
28
+ */
29
+ export function PackagesPage({ version, tab, item, layers = [], sceneOpen = false, onChanged }) {
25
30
  const [view, setView] = useState();
26
31
  const [problem, setProblem] = useState();
27
32
  const [catalog, setCatalog] = useState({ asking: true });
@@ -213,7 +218,7 @@ export function PackagesPage({ version, tab }) {
213
218
  { key: "installed", name: t("Installed"), label: [t("Installed"), ...marksText(updates, missing)].join(", "), marks: _jsx(TabMarks, { updates: updates, missing: missing }) },
214
219
  { key: "add", name: t("Add") },
215
220
  { key: "library", name: t("Library"), label: [t("Library"), ...marksText(0, away)].join(", "), marks: _jsx(TabMarks, { updates: 0, missing: away }) },
216
- ] }), view !== undefined && (_jsxs("div", { class: "package-panel", id: "packages-panel", role: "tabpanel", "aria-label": shownTab === "add" ? t("Add") : shownTab === "library" ? t("Library") : t("Installed"), children: [elsewhere !== undefined && _jsx(WorkNote, { work: elsewhere, whose: workTitle(elsewhere, catalog.read) }), saidElsewhere !== undefined && _jsx(SaidNote, { said: saidElsewhere }), shownTab === "library" && (_jsx(LibraryTab, { view: library, problem: libraryProblem, state: rowState, onAdd: (path) => void addToLibrary(path), onUse: (path, use, away) => void useInCampaign(path, use, away), onForget: (path, name) => setAsking({ kind: "library", path, name }) })), shownTab === "add" && (_jsx("section", { class: "card", "aria-label": t("Add"), children: _jsxs("div", { class: "card-body package-body", children: [_jsx(CatalogList, { catalog: catalog, view: view, state: (entry) => rowState(`catalog:${entry.source}`), needs: (entry) => needs(entry.newer), onAdd: (entry) => void add(`catalog:${entry.source}`, entry.source), onUpdate: (entry) => void change(`catalog:${entry.source}`, "update", entry.source, entryTitle(entry)), onRetry: () => askCatalog(true) }), _jsx(AddField, { state: rowState("add"), onAdd: (source) => void add("add", source), onFile: (file) => void addTheFile(file) })] }) })), shownTab === "installed" && (_jsxs(_Fragment, { children: [!engine.hidden && _jsx(EngineCard, { engine: engine.read, updated: updated, newer: engineNew, state: rowState("engine"), onUpdate: () => void updateTheEngine() }), _jsxs("section", { class: "card", "aria-labelledby": "packages-systems", children: [_jsx(CardHead, { icon: iconPath("dice"), title: _jsx("h3", { id: "packages-systems", tabIndex: -1, children: t("Game system") }) }), _jsxs("div", { class: "card-body package-body", children: [_jsx("ul", { class: "package-list", children: systems.map((system) => (_jsx(SystemRow, { system: system, newer: system.package === undefined ? undefined : newerOf(system.package, "system", catalog.read), needs: system.package === undefined ? null : needs(entryOf(system.package, "system", catalog.read)?.newer), fresh: fresh.includes(`system:${system.name}`), state: rowState(`system:${system.name}`), onUpdate: (target) => void change(`system:${system.name}`, "update", target, system.name), onUninstall: (target) => setAsking({ kind: "uninstall", what: "system", name: system.name, target, at: `system:${system.name}` }) }, system.name))) }), _jsx(CardSaid, { said: said, at: "systems" })] })] }), _jsxs("section", { class: "card", "aria-labelledby": "packages-adventures", children: [_jsx(CardHead, { icon: iconPath("world"), title: _jsx("h3", { id: "packages-adventures", tabIndex: -1, children: t("Adventures") }), ...(adventures.length === 0 ? {} : { note: String(adventures.length) }) }), _jsxs("div", { class: "card-body package-body", children: [adventures.length === 0 && _jsx("p", { class: "package-note", children: t("None yet: add one in Add, from the catalog, a .zip or a link.") }), adventures.length > 0 && (_jsx("ul", { class: "package-list", children: adventures.map((adventure) => (_jsx(AdventureRow, { adventure: adventure, fresh: fresh.includes(`adventure:${adventure.title}`), state: rowState(`adventure:${adventure.title}`), onTakeOut: () => setAsking({ kind: "adventure", title: adventure.title }) }, adventure.title))) })), _jsx(CardSaid, { said: said, at: "adventures" }), _jsx(ShareCampaign, {})] })] }), _jsxs("section", { class: "card", "aria-labelledby": "packages-extensions", children: [_jsx(CardHead, { icon: iconPath("packages"), title: _jsx("h3", { id: "packages-extensions", tabIndex: -1, children: t("Extensions") }), ...(view.installed.length + view.missing.length === 0 ? {} : { note: t("{count} in use", { count: usedCount(view) }) }) }), _jsxs("div", { class: "card-body package-body", children: [view.installed.length + view.missing.length === 0 && _jsx("p", { class: "package-note", children: t("None: an extension adds rules and tools to the game; you find them in Add, in the catalog.") }), view.installed.length + view.missing.length > 0 && (_jsxs("ul", { class: "package-list", children: [view.installed.map((extension) => (_jsx(ExtensionRow, { extension: extension, newer: newerOf(extension.package, "extension", catalog.read), needs: needs(entryOf(extension.package, "extension", catalog.read)?.newer), fresh: fresh.includes(`extension:${extension.package}`), state: rowState(`extension:${extension.package}`), onUse: (use) => void (use
221
+ ] }), view !== undefined && (_jsxs("div", { class: "package-panel", id: "packages-panel", role: "tabpanel", "aria-label": shownTab === "add" ? t("Add") : shownTab === "library" ? t("Library") : t("Installed"), children: [elsewhere !== undefined && _jsx(WorkNote, { work: elsewhere, whose: workTitle(elsewhere, catalog.read) }), saidElsewhere !== undefined && _jsx(SaidNote, { said: saidElsewhere }), shownTab === "library" && (_jsx(LibraryTab, { view: library, problem: libraryProblem, state: rowState, onAdd: (path) => void addToLibrary(path), onUse: (path, use, away) => void useInCampaign(path, use, away), onForget: (path, name) => setAsking({ kind: "library", path, name }) })), shownTab === "add" && (_jsx("section", { class: "card", "aria-label": t("Add"), children: _jsxs("div", { class: "card-body package-body", children: [_jsx(CatalogList, { catalog: catalog, view: view, state: (entry) => rowState(`catalog:${entry.source}`), needs: (entry) => needs(entry.newer), onAdd: (entry) => void add(`catalog:${entry.source}`, entry.source), onUpdate: (entry) => void change(`catalog:${entry.source}`, "update", entry.source, entryTitle(entry)), onRetry: () => askCatalog(true) }), _jsx(AddField, { state: rowState("add"), onAdd: (source) => void add("add", source), onFile: (file) => void addTheFile(file) })] }) })), shownTab === "installed" && (_jsxs(_Fragment, { children: [!engine.hidden && _jsx(EngineCard, { engine: engine.read, updated: updated, newer: engineNew, state: rowState("engine"), onUpdate: () => void updateTheEngine() }), _jsxs("section", { class: "card", "aria-labelledby": "packages-systems", children: [_jsx(CardHead, { icon: iconPath("dice"), title: _jsx("h3", { id: "packages-systems", tabIndex: -1, children: t("Game system") }) }), _jsxs("div", { class: "card-body package-body", children: [_jsx("ul", { class: "package-list", children: systems.map((system) => (_jsx(SystemRow, { system: system, newer: system.package === undefined ? undefined : newerOf(system.package, "system", catalog.read), needs: system.package === undefined ? null : needs(entryOf(system.package, "system", catalog.read)?.newer), changes: system.used ? _jsx(ChangedPages, { layers: layers, sceneOpen: sceneOpen, open: item, onChanged: onChanged }) : undefined, fresh: fresh.includes(`system:${system.name}`), state: rowState(`system:${system.name}`), onUpdate: (target) => void change(`system:${system.name}`, "update", target, system.name), onUninstall: (target) => setAsking({ kind: "uninstall", what: "system", name: system.name, target, at: `system:${system.name}` }) }, system.name))) }), _jsx(CardSaid, { said: said, at: "systems" })] })] }), _jsxs("section", { class: "card", "aria-labelledby": "packages-adventures", children: [_jsx(CardHead, { icon: iconPath("world"), title: _jsx("h3", { id: "packages-adventures", tabIndex: -1, children: t("Adventures") }), ...(adventures.length === 0 ? {} : { note: String(adventures.length) }) }), _jsxs("div", { class: "card-body package-body", children: [adventures.length === 0 && _jsx("p", { class: "package-note", children: t("None yet: add one in Add, from the catalog, a .zip or a link.") }), adventures.length > 0 && (_jsx("ul", { class: "package-list", children: adventures.map((adventure) => (_jsx(AdventureRow, { adventure: adventure, fresh: fresh.includes(`adventure:${adventure.title}`), state: rowState(`adventure:${adventure.title}`), onTakeOut: () => setAsking({ kind: "adventure", title: adventure.title }) }, adventure.title))) })), _jsx(CardSaid, { said: said, at: "adventures" }), _jsx(ShareCampaign, {})] })] }), _jsxs("section", { class: "card", "aria-labelledby": "packages-extensions", children: [_jsx(CardHead, { icon: iconPath("packages"), title: _jsx("h3", { id: "packages-extensions", tabIndex: -1, children: t("Extensions") }), ...(view.installed.length + view.missing.length === 0 ? {} : { note: t("{count} in use", { count: usedCount(view) }) }) }), _jsxs("div", { class: "card-body package-body", children: [view.installed.length + view.missing.length === 0 && _jsx("p", { class: "package-note", children: t("None: an extension adds rules and tools to the game; you find them in Add, in the catalog.") }), view.installed.length + view.missing.length > 0 && (_jsxs("ul", { class: "package-list", children: [view.installed.map((extension) => (_jsx(ExtensionRow, { extension: extension, newer: newerOf(extension.package, "extension", catalog.read), needs: needs(entryOf(extension.package, "extension", catalog.read)?.newer), fresh: fresh.includes(`extension:${extension.package}`), state: rowState(`extension:${extension.package}`), onUse: (use) => void (use
217
222
  ? add(`extension:${extension.package}`, extension.package)
218
223
  : change(`extension:${extension.package}`, "remove", extension.package, phraseLabel(extension.name))), onUpdate: () => void change(`extension:${extension.package}`, "update", extension.package, phraseLabel(extension.name)), onUninstall: () => setAsking({ kind: "uninstall", what: "extension", name: phraseLabel(extension.name), target: extension.package, at: `extension:${extension.package}` }) }, extension.package))), view.missing.map((name) => _jsx(MissingRow, { name: name, state: rowState(`extension:${name}`), onInstall: () => void add(`extension:${name}`, name) }, name))] })), _jsx(CardSaid, { said: said, at: "extensions" })] })] }), _jsxs("section", { class: "card", "aria-labelledby": "packages-languages", children: [_jsx(CardHead, { icon: iconPath("language"), title: _jsx("h3", { id: "packages-languages", tabIndex: -1, children: t("Languages") }) }), _jsxs("div", { class: "card-body package-body", children: [languages.length === 0 && _jsx("p", { class: "package-note", children: t("None. The dashboard has its own languages; a language package takes the place of one with a translation made by hand.") }), languages.length > 0 && (_jsx("ul", { class: "package-list", children: languages.map((language) => (_jsx(LanguageRow, { language: language, newer: newerOf(language.package, "language", catalog.read), needs: needs(entryOf(language.package, "language", catalog.read)?.newer), fresh: fresh.includes(`language:${language.code}`), state: rowState(`language:${language.code}`), onUpdate: () => void change(`language:${language.code}`, "update", language.package, languageTitle(language)), onUninstall: () => setAsking({ kind: "uninstall", what: "language", name: languageTitle(language), target: language.package, at: `language:${language.code}` }) }, language.package))) })), _jsx(CardSaid, { said: said, at: "languages" })] })] })] }))] })), asking?.kind === "adventure" && (_jsxs(Confirm, { title: t("Take {name} out of the campaign?", { name: asking.title }), onClose: () => setAsking(undefined), children: [_jsx("p", { children: t("Its places, people and pages leave the world. To have it again, add it once more.") }), _jsxs("div", { class: "confirm-buttons", children: [_jsx("button", { type: "button", class: "button", autoFocus: true, onClick: () => setAsking(undefined), children: t("Cancel") }), _jsx("button", { type: "button", class: "button danger final", onClick: () => confirmed(asking), children: t("Take out") })] })] })), asking?.kind === "library" && (_jsxs(Confirm, { title: t("Take {path} off this computer?", { path: asking.name }), onClose: () => setAsking(undefined), children: [_jsx("p", { children: t("No campaign searches it any more, and the text RPG Engine read of its books is deleted. The books stay where they are.") }), _jsxs("div", { class: "confirm-buttons", children: [_jsx("button", { type: "button", class: "button", autoFocus: true, onClick: () => setAsking(undefined), children: t("Cancel") }), _jsx("button", { type: "button", class: "button danger final", onClick: () => confirmed(asking), children: t("Take off") })] })] })), asking?.kind === "uninstall" && (_jsxs(Confirm, { title: t("Uninstall {name} from this computer?", { name: asking.name }), onClose: () => setAsking(undefined), children: [uninstallText(asking.what), _jsxs("div", { class: "confirm-buttons", children: [_jsx("button", { type: "button", class: "button", autoFocus: true, onClick: () => setAsking(undefined), children: t("Cancel") }), _jsx("button", { type: "button", class: "button danger final", onClick: () => confirmed(asking), children: t("Uninstall") })] })] }))] }));
219
224
  }
@@ -0,0 +1,37 @@
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "preact/jsx-runtime";
2
+ // A page of the game system that the campaign changed (D-564), wherever the page shows one: a small asterisk after its name, as a note's in a book, its words in its tooltip and for a
3
+ // screen reader; in the head of a page read whole, the words too, which lead to what changed, listed in Packages under the game system.
4
+ import { sectionAddress } from "../address.js";
5
+ import { foldedText, t } from "../text.js";
6
+ /** What the address names in Packages' Installed tab to show the pages the campaign changed. */
7
+ export const changedItem = "changed";
8
+ // The pages the campaign changed in what the character knows, by their names and titles without case and accents, as the page last read them; and whether
9
+ // it changed any, which the page lists.
10
+ let changed = new Set();
11
+ let listed = false;
12
+ /**
13
+ * Sets the pages the campaign changed, as the view gives them; none, no page. One changed only in what the character does not know, as a creature never met,
14
+ * is told by no name of a list: a sheet holds none of it, and its name may be another thing's, as a language's.
15
+ */
16
+ export function setChangedPages(layers) {
17
+ const known = (layers ?? []).filter((layer) => layer.fields.length > 0 || layer.sections.length > 0 || layer.introduction === true);
18
+ changed = new Set(known.flatMap((layer) => [layer.name, ...(layer.title === undefined ? [] : [layer.title])]).map(foldedText));
19
+ listed = (layers ?? []).length > 0;
20
+ }
21
+ /** Whether a name of a list, as a spell's on a sheet, which is only a name, is of a page the campaign changed. */
22
+ export function isChanged(name) {
23
+ return changed.has(foldedText(name.trim()));
24
+ }
25
+ /** The asterisk after a name: no control, its words for a screen reader and in its tooltip. */
26
+ export function ChangedMark() {
27
+ return (_jsx("span", { class: "changed-mark", role: "img", "aria-label": t("Changed in this campaign"), "data-tip": t("Changed in this campaign: Packages lists what changed"), children: _jsx(Asterisk, {}) }));
28
+ }
29
+ /** In the head of a page read whole: the asterisk and its words, as the note it stands for, a link to what changed while the page lists it, else words. */
30
+ export function ChangedLine() {
31
+ const words = (_jsxs(_Fragment, { children: [_jsx(Asterisk, {}), t("Changed in this campaign")] }));
32
+ return _jsx("p", { class: "changed-line", children: listed ? _jsx("a", { href: sectionAddress("packages", "installed", changedItem), children: words }) : _jsx("span", { children: words }) });
33
+ }
34
+ /** An asterisk of six arms, never five, which at 12 px read as a favourite's star: it says there is a note, never that something can be edited. */
35
+ function Asterisk() {
36
+ return (_jsx("svg", { class: "changed-icon", viewBox: "0 0 24 24", "aria-hidden": "true", children: _jsx("path", { d: "M12 2.4v19.2M3.7 7.2l16.6 9.6M3.7 16.8l16.6-9.6" }) }));
37
+ }
@@ -35,6 +35,8 @@ const phrases = {
35
35
  "adventure-halfway": (values) => t("Adding {name} stopped halfway: add it again first.", values),
36
36
  "adventure-names": (values) => t("{name} has pages with names this campaign already uses: {names}", values),
37
37
  "adventure-in-story": (values) => t("{name} is part of the story now: it stays.", values),
38
+ "adventure-copies": (values) => t("{name} changes something of the game system that is in the scene being played: try again once the scene is over.", values),
39
+ "adventure-layers": (values) => t("{name} brings changes to the game system that cannot be used as they are written: whoever made it has to fix them.", values),
38
40
  "adventure-needs": (values) => t("{name} needs the extension {needs}: add it first.", values),
39
41
  "adventure-needs-newer": (values) => t("{name} needs {needs} {version} or later, and this campaign has {has}: update it first.", values),
40
42
  "export-played": () => t("The campaign has been played and has no save of its start: keep it as a save of the whole game instead."),
@@ -56,6 +58,8 @@ const phrases = {
56
58
  "engine-link": (values) => t("This RPG Engine is a development link to {name}: update it there.", values),
57
59
  "engine-elsewhere": (values) => t("This RPG Engine runs from {name}: update it the way it was installed.", values),
58
60
  "engine-failed": (values) => t("npm could not update RPG Engine: {why}", values),
61
+ "no-layer": (values) => t("{page} is no longer changed in this campaign: there is nothing to put back.", values),
62
+ "scene-open": () => t("It can be put back once the scene being played is over."),
59
63
  "file-big": (values) => t("The file is more than {size} MB: no package is that big.", values),
60
64
  "file-kind": (values) => t("{name} is neither a .zip nor a .tgz.", values),
61
65
  };
@@ -3,6 +3,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "preact/jsx-runtime";
3
3
  // for a screen reader.
4
4
  import { ActName, usePlayerActs } from "../acts/names.js";
5
5
  import { numberText, t } from "../text.js";
6
+ import { ChangedMark, isChanged } from "./changed.js";
6
7
  import { Coins } from "./coins.js";
7
8
  import { besideLabel, burnsLabel, effectEndLabel, effectLabel, effectName } from "./game-words.js";
8
9
  import { itemLabel, shownText } from "./labels.js";
@@ -66,7 +67,8 @@ function Items({ items, field, fields }) {
66
67
  const sentences = items.some((item) => item.trim().split(/\s+/).length >= sentenceWords);
67
68
  return (_jsx("ul", { class: [sentences ? "notes" : "chips", acting ? "acting" : ""].filter((name) => name !== "").join(" "), children: items.map((item) => {
68
69
  const label = itemLabel(item, fields);
69
- return _jsx("li", { children: acting ? _jsx(ActName, { verbs: verbs, item: label, children: label }) : label }, item);
70
+ // An item is only a name: one of a page of the game system the campaign changed has the asterisk after it (D-564).
71
+ return (_jsxs("li", { children: [acting ? _jsx(ActName, { verbs: verbs, item: label, children: label }) : label, isChanged(item) && _jsx(ChangedMark, {})] }, item));
70
72
  }) }));
71
73
  }
72
74
  /** Someone's effects as tags, each with its end; past `most`, how many more. */
@@ -3,6 +3,7 @@ import { useEffect, useRef, useState } from "preact/hooks";
3
3
  import { choicesAddress } from "../address.js";
4
4
  import { changeChoices, readChoices, readView } from "../api.js";
5
5
  import { useMedia } from "../parts/card.js";
6
+ import { ChangedLine, ChangedMark } from "../parts/changed.js";
6
7
  import { Icon, NotationIcons } from "../parts/icons.js";
7
8
  import { diceIn, shownNotation } from "../parts/labels.js";
8
9
  import { Markdown } from "../parts/markdown.js";
@@ -238,7 +239,7 @@ function ItemState({ item }) {
238
239
  function OptionCard({ id, option, role, checked, closed, tabIndex, read, href, total, about, hand, onChoose }) {
239
240
  const opening = about ?? option.pages?.[0].opening;
240
241
  const kinds = ["choice-card", checked ? "chosen" : "", closed && !checked ? "closed" : "", option.notation === undefined ? "" : "choice-roll", href === undefined ? "alone" : ""];
241
- return (_jsxs("div", { class: kinds.filter((kind) => kind !== "").join(" "), children: [_jsxs("button", { type: "button", class: "choice-pick", role: role, "aria-checked": checked, "aria-disabled": closed ? true : undefined, tabIndex: tabIndex, "aria-labelledby": total === undefined ? `${id}-name` : `${id}-name ${id}-total`, "aria-describedby": opening === undefined || opening === "" ? undefined : `${id}-about`, onClick: onChoose, children: [_jsx("span", { class: role === "checkbox" ? "choice-mark square" : "choice-mark", "aria-hidden": "true", children: _jsx(Icon, { name: "check" }) }), _jsxs("span", { class: "choice-words", children: [_jsxs("strong", { id: `${id}-name`, class: option.notation === undefined ? undefined : "choice-dice", children: [option.notation !== undefined && _jsx(NotationIcons, { notation: option.notation }), _jsx("bdi", { children: option.label }), option.notation !== undefined && _jsx("bdi", { class: "num", children: shownNotation(option.notation) })] }), opening !== undefined && opening !== "" && _jsx("span", { class: "choice-about", id: `${id}-about`, dir: "auto", children: opening })] }), total !== undefined && _jsx("span", { class: "choice-total num", id: `${id}-total`, children: total })] }), href !== undefined && option.pages !== undefined && (_jsx("a", { class: "icon-button choice-read tip-left", href: href, "data-name": option.pages[0].name, "aria-label": t("Read {name}", { name: option.label }), "data-tip": t("Read {name}", { name: option.label }), "aria-current": read ? "true" : undefined, children: _jsx(Icon, { name: "read" }) })), hand] }));
242
+ return (_jsxs("div", { class: kinds.filter((kind) => kind !== "").join(" "), children: [_jsxs("button", { type: "button", class: "choice-pick", role: role, "aria-checked": checked, "aria-disabled": closed ? true : undefined, tabIndex: tabIndex, "aria-labelledby": total === undefined ? `${id}-name` : `${id}-name ${id}-total`, "aria-describedby": opening === undefined || opening === "" ? undefined : `${id}-about`, onClick: onChoose, children: [_jsx("span", { class: role === "checkbox" ? "choice-mark square" : "choice-mark", "aria-hidden": "true", children: _jsx(Icon, { name: "check" }) }), _jsxs("span", { class: "choice-words", children: [_jsxs("strong", { id: `${id}-name`, class: option.notation === undefined ? undefined : "choice-dice", children: [option.notation !== undefined && _jsx(NotationIcons, { notation: option.notation }), _jsx("bdi", { children: option.label }), option.notation !== undefined && _jsx("bdi", { class: "num", children: shownNotation(option.notation) }), option.pages?.some((page) => page.layered === true) === true && _jsx(ChangedMark, {})] }), opening !== undefined && opening !== "" && _jsx("span", { class: "choice-about", id: `${id}-about`, dir: "auto", children: opening })] }), total !== undefined && _jsx("span", { class: "choice-total num", id: `${id}-total`, children: total })] }), href !== undefined && option.pages !== undefined && (_jsx("a", { class: "icon-button choice-read tip-left", href: href, "data-name": option.pages[0].name, "aria-label": t("Read {name}", { name: option.label }), "data-tip": t("Read {name}", { name: option.label }), "aria-current": read ? "true" : undefined, children: _jsx(Icon, { name: "read" }) })), hand] }));
242
243
  }
243
244
  /** The field of a roll made with the player's own dice: a number for each die, as it landed, then Write. */
244
245
  function HandDice({ notation, id, onWrite }) {
@@ -301,7 +302,7 @@ function ChoiceReader({ set, at, option, page, version, phone, link, closed, onP
301
302
  const checked = item.answer.includes(option.text);
302
303
  const shut = closed || item.rolled !== undefined || (!single && !checked && item.answer.length >= item.most);
303
304
  const count = single ? undefined : t("{count} of {most}", { count: item.answer.length, most: item.most });
304
- return (_jsxs("article", { class: "browse-reader choices-reader", "aria-labelledby": `${key}-title`, children: [_jsxs("header", { class: "reader-head", children: [_jsxs("div", { children: [_jsxs("p", { class: "eyebrow", children: [_jsx("bdi", { children: item.question }), count !== undefined && _jsx("span", { class: "num", children: ` · ${count}` })] }), _jsx("h3", { id: `${key}-title`, tabIndex: -1, ref: title, dir: "auto", children: heading })] }), phone !== true && (_jsx("a", { class: "icon-button tip-left", href: choicesAddress(set.who), "aria-label": t("Close the page"), "data-tip": t("Close the page"), children: _jsx(Icon, { name: "close" }) }))] }), _jsx("p", { class: "reader-actions", children: single && checked
305
+ return (_jsxs("article", { class: "browse-reader choices-reader", "aria-labelledby": `${key}-title`, children: [_jsxs("header", { class: "reader-head", children: [_jsxs("div", { children: [_jsxs("p", { class: "eyebrow", children: [_jsx("bdi", { children: item.question }), count !== undefined && _jsx("span", { class: "num", children: ` · ${count}` })] }), _jsx("h3", { id: `${key}-title`, tabIndex: -1, ref: title, dir: "auto", children: heading }), page.layered === true && _jsx(ChangedLine, {})] }), phone !== true && (_jsx("a", { class: "icon-button tip-left", href: choicesAddress(set.who), "aria-label": t("Close the page"), "data-tip": t("Close the page"), children: _jsx(Icon, { name: "close" }) }))] }), _jsx("p", { class: "reader-actions", children: single && checked
305
306
  ? (_jsxs("span", { class: "choice-picked", children: [_jsx(Icon, { name: "check" }), t("Your choice")] }))
306
307
  : (_jsxs("button", { type: "button", class: "button", "aria-disabled": shut ? true : undefined, onClick: () => !shut && onPick(single ? [option.text] : checked ? item.answer.filter((one) => one !== option.text) : [...item.answer, option.text]), children: [_jsx(Icon, { name: checked ? "minus" : "plus" }), checked ? t("Take {item} off", { item: option.label }) : t("Choose {name}", { name: option.label })] })) }), pages.length > 1 && (_jsx("nav", { class: "filter-chips choices-pages", "aria-label": t("The pages this option names"), children: pages.map((one) => (_jsx("a", { href: choicesAddress(set.who, one.name), "aria-current": one.name === page.name ? "page" : undefined, children: _jsx("bdi", { children: one.title }) }, one.name))) })), _jsxs("div", { class: "reader-text", children: [text === undefined && !problem && page.opening !== "" && _jsx("p", { children: page.opening }), text !== undefined && text.trim() !== "" && _jsx(Markdown, { text: text, link: link }), text !== undefined && text.trim() === "" && _jsx("p", { children: page.opening }), problem && _jsx("p", { class: "choices-none", children: t("This page could not be read now: try again in a moment.") })] })] }));
307
308
  }
@@ -5,6 +5,7 @@ import { ActName, usePlayerActs } from "../acts/names.js";
5
5
  import { readExplanations } from "../api.js";
6
6
  import { WidgetCards, WidgetsContext } from "../packages/widgets.js";
7
7
  import { CardHeader, useOpen } from "../parts/card.js";
8
+ import { ChangedLine, ChangedMark } from "../parts/changed.js";
8
9
  import { besideLabel, memberPlaceLabel } from "../parts/game-words.js";
9
10
  import { cardIcons, DieIcon, Icon } from "../parts/icons.js";
10
11
  import { fieldLabel, groupLabels, itemLabel, phraseLabel, readableIds, rollLabel, shownNotation, shownText } from "../parts/labels.js";
@@ -23,7 +24,7 @@ import { StoryBox } from "./story.js";
23
24
  // The cards of the page's text, after the system's groups, the whole width: the player character's story in the player's words, then the rest of the text.
24
25
  const descriptionCard = "Description";
25
26
  const backstoryCard = "Backstory";
26
- export function MemberSheet({ member, headline, sheet, cards, text, knownBy, story, version, onRoll, scene, choices = [] }) {
27
+ export function MemberSheet({ member, headline, layered, sheet, cards, text, knownBy, story, version, onRoll, scene, choices = [] }) {
27
28
  const { rail, others } = arrangedGroups(sheet, cards);
28
29
  const fields = sheetFields(member, sheet);
29
30
  const group = (shown) => _jsx(Group, { member: member.name, group: shown, fields: fields, version: version, onRoll: onRoll, first: shown === others[0] }, shown.name);
@@ -38,7 +39,7 @@ export function MemberSheet({ member, headline, sheet, cards, text, knownBy, sto
38
39
  const described = story !== undefined && story.trim() !== "" && text.startsWith(story) ? text.slice(story.length).trimStart() : text;
39
40
  return (_jsxs("section", { class: "sheet", "aria-label": member.name, children: [_jsxs("header", { class: "band", children: [_jsxs("div", { class: "identity", children: [_jsx(MemberToken, { member: member, large: true, status: status }), _jsxs("div", { class: "who", children: [_jsx("h2", { children: member.name }), (headline !== undefined && headline !== "") || member.mood !== undefined
40
41
  ? (_jsxs("p", { class: "headline", children: [headline, headline !== undefined && headline !== "" && member.mood !== undefined && " · ", member.mood !== undefined && (_jsxs("span", { class: "mood-word", children: [_jsx(MoodFace, { mood: member.mood }), moodLabel(member.mood)] }))] }))
41
- : null, member.place && (_jsxs("p", { class: "place", children: [_jsx(Icon, { name: "place" }), memberPlaceLabel(member.place)] }))] })] }), choices.map((set) => _jsx(ChoicesNotice, { set: set }, set.id)), person.map((shown) => _jsx(PersonPanel, { shown: shown }, shown.widget.id)), _jsx(ValueLine, { values: member.counters.filter((value) => !shownApart.has(value.field)), fields: fields, boxes: boxes }), _jsx(Effects, { effects: besideWord(member.effects, status.person) })] }), _jsxs("div", { class: "sheet-body", children: [rail.length > 0 && _jsx("div", { class: "rail", children: rail.map(group) }), _jsxs("div", { class: "sheet-main", children: [_jsx(FixedColumns, { cards: others.map((shown) => ({ key: shown.name, node: group(shown) })) }), _jsxs("div", { class: "wide-cards", children: [story !== undefined && (_jsxs(Card, { name: backstoryCard, title: t("Backstory"), icon: cardIcons.backstory, layout: "lore", preview: plainLine(story) ?? t("Not written yet"), children: [story.trim() !== "" && _jsx(Markdown, { text: story }), _jsx(StoryBox, { story: story, who: member.name })] })), described.trim() !== "" && (_jsx(Card, { name: descriptionCard, title: t("Description"), icon: cardIcons.description, layout: "lore", preview: plainLine(described), children: _jsx(Markdown, { text: described, secretKnowers: knowersOf(knownBy) }) }))] }), _jsx(WidgetCards, { place: "page", page: "sheet", who: member.name, view: member })] })] })] }));
42
+ : null, member.place && (_jsxs("p", { class: "place", children: [_jsx(Icon, { name: "place" }), memberPlaceLabel(member.place)] })), layered === true && _jsx(ChangedLine, {})] })] }), choices.map((set) => _jsx(ChoicesNotice, { set: set }, set.id)), person.map((shown) => _jsx(PersonPanel, { shown: shown }, shown.widget.id)), _jsx(ValueLine, { values: member.counters.filter((value) => !shownApart.has(value.field)), fields: fields, boxes: boxes }), _jsx(Effects, { effects: besideWord(member.effects, status.person) })] }), _jsxs("div", { class: "sheet-body", children: [rail.length > 0 && _jsx("div", { class: "rail", children: rail.map(group) }), _jsxs("div", { class: "sheet-main", children: [_jsx(FixedColumns, { cards: others.map((shown) => ({ key: shown.name, node: group(shown) })) }), _jsxs("div", { class: "wide-cards", children: [story !== undefined && (_jsxs(Card, { name: backstoryCard, title: t("Backstory"), icon: cardIcons.backstory, layout: "lore", preview: plainLine(story) ?? t("Not written yet"), children: [story.trim() !== "" && _jsx(Markdown, { text: story }), _jsx(StoryBox, { story: story, who: member.name })] })), described.trim() !== "" && (_jsx(Card, { name: descriptionCard, title: t("Description"), icon: cardIcons.description, layout: "lore", preview: plainLine(described), children: _jsx(Markdown, { text: described, secretKnowers: knowersOf(knownBy) }) }))] }), _jsx(WidgetCards, { place: "page", page: "sheet", who: member.name, view: member })] })] })] }));
42
43
  }
43
44
  /** What of someone's sheet the Combat section keeps at hand (D-315): the fields it names in a line of boxes, as under the name, then the groups it names as their cards. */
44
45
  export function SheetAtHand({ member, sheet, names, version, onRoll }) {
@@ -236,13 +237,15 @@ function ItemsTable({ group, fields }) {
236
237
  ...bonds,
237
238
  ].filter((part) => part !== undefined).map((part) => `, ${part}`).join("");
238
239
  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
+ // The campaign changed its page of the game system (D-564): an asterisk after its name, outside what acts.
241
+ const changed = item.layered === true && _jsx(ChangedMark, {});
239
242
  // The name acts, when the system names a verb for it; a container's opens and closes what it holds (D-495).
240
243
  const verbs = holds(index) ? undefined : itemVerbs(acts?.actions, item);
241
- return (_jsxs("tr", { class: item.depth === undefined ? undefined : "inside", children: [_jsx("th", { scope: "row", class: holds(index) ? "holds" : undefined, style: item.depth === undefined ? undefined : { "--depth": item.depth }, children: holds(index)
242
- ? (_jsxs("button", { type: "button", class: "fold", "aria-expanded": !closed.has(key(index)), onClick: () => toggle(index), children: [_jsx(Icon, { name: "fold" }), words] }))
243
- : verbs === undefined
244
- ? words
245
- : _jsx(ActName, { verbs: verbs, item: name, said: `${count(item) === "" ? "" : ` (${count(item)})`}${said}`, children: words }) }), !carried && item.values.map((value) => _jsx("td", { class: widgetOf(value) === "text" ? undefined : "num", children: shownText(value.text, value.kind) }, value.field))] }, key(index)));
244
+ 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
+ ? (_jsxs("button", { type: "button", class: "fold", "aria-expanded": !closed.has(key(index)), onClick: () => toggle(index), children: [_jsx(Icon, { name: "fold" }), words] }))
246
+ : verbs === undefined
247
+ ? 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)));
246
249
  }) })] }));
247
250
  }
248
251
  /** 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. */
@@ -8,6 +8,7 @@ export function withHeld(before, next, hold) {
8
8
  party: shown.party,
9
9
  chosen: shown.chosen,
10
10
  headline: shown.headline,
11
+ layered: shown.layered,
11
12
  sheet: shown.sheet,
12
13
  cards: shown.cards,
13
14
  text: shown.text,
@@ -244,6 +244,13 @@
244
244
  translate: 0 0 !important;
245
245
  }
246
246
 
247
+ /* The asterisk of a changed page stands in narrow cards: its tooltip in lines, never wider than its card. */
248
+ .changed-mark[data-tip]::before {
249
+ width: max-content !important;
250
+ max-width: 200px !important;
251
+ white-space: normal !important;
252
+ }
253
+
247
254
  /* How a number is made, in its tooltip (FOR-8): lines that wrap, its free roll on the last. */
248
255
  [data-tip].tip-wide::before {
249
256
  width: max-content !important;
@@ -7553,6 +7560,79 @@
7553
7560
  font-weight: 650;
7554
7561
  }
7555
7562
  }
7563
+ /* A page of the game system that the campaign changed: the asterisk after its name, and its line in the head of a page read whole. */
7564
+ @layer parts {
7565
+ /* The asterisk after a name, no control: quiet, never the accent, which on the dark page is the gold of what is equipped or chosen. */
7566
+ .changed-mark {
7567
+ position: relative;
7568
+ display: inline-block;
7569
+ margin-inline-start: 0.35em;
7570
+ color: var(--muted);
7571
+ text-indent: 0;
7572
+ vertical-align: -0.08em;
7573
+ }
7574
+
7575
+ .changed-icon {
7576
+ display: block;
7577
+ flex: none;
7578
+ width: 0.75rem;
7579
+ height: 0.75rem;
7580
+ fill: none;
7581
+ stroke: currentColor;
7582
+ stroke-width: 2.8;
7583
+ stroke-linecap: round;
7584
+ /* Raised, as a note's mark stands over its word: in a line of text and in a chip alike. */
7585
+ translate: 0 -0.22em;
7586
+ }
7587
+
7588
+ /* In a chip the asterisk stands inside it, after the name; after a name that acts, inside the chip's own room. */
7589
+ .chips li:has(> .changed-mark) {
7590
+ display: inline-flex;
7591
+ align-items: center;
7592
+ }
7593
+
7594
+ .chips.acting li > .changed-mark {
7595
+ margin-inline: -4px 8px;
7596
+ }
7597
+
7598
+ /* On touch a name that acts is taller: the asterisk after it keeps the middle of its line. */
7599
+ @media (pointer: coarse) {
7600
+ .items th > .act + .changed-mark {
7601
+ display: inline-flex;
7602
+ align-items: center;
7603
+ min-height: 36px;
7604
+ vertical-align: top;
7605
+ }
7606
+ }
7607
+
7608
+ /* In the head of a page read whole: the asterisk and the words, which lead to what changed. */
7609
+ .changed-line {
7610
+ margin: 6px 0 0;
7611
+ color: var(--muted);
7612
+ font-size: 0.85rem;
7613
+ }
7614
+
7615
+ .changed-line > :is(a, span) {
7616
+ display: inline-flex;
7617
+ align-items: center;
7618
+ gap: 5px;
7619
+ border-radius: var(--radius-xs);
7620
+ }
7621
+
7622
+ .changed-line > a {
7623
+ color: var(--accent);
7624
+ font-weight: 600;
7625
+ text-decoration: underline;
7626
+ text-decoration-thickness: 1px;
7627
+ text-underline-offset: 2px;
7628
+ }
7629
+
7630
+ @media (pointer: coarse) {
7631
+ .changed-line > a {
7632
+ min-height: var(--target);
7633
+ }
7634
+ }
7635
+ }
7556
7636
  /* Settings. */
7557
7637
  @layer pages {
7558
7638
  /* The Settings section (D-341): the player's settings of the campaign in groups, each with what it is and its values, the chosen one in gold and what it
@@ -14559,6 +14639,119 @@
14559
14639
  color: var(--ink);
14560
14640
  }
14561
14641
 
14642
+ /* The pages of the game system the campaign changed (D-564), under the system it plays, from the words' column: a small heading, a line of what they
14643
+ are, then each page, its name and Put back on a line, what changed under them. */
14644
+ .package-row > .package-changes {
14645
+ grid-column: 2 / -1;
14646
+ }
14647
+
14648
+ .package-changes {
14649
+ display: grid;
14650
+ grid-template-columns: minmax(0, 1fr);
14651
+ gap: 4px;
14652
+ margin-top: 6px;
14653
+ padding-top: 12px;
14654
+ border-top: 1px dashed var(--rule);
14655
+ }
14656
+
14657
+ .package-changes > .package-sub {
14658
+ display: flex;
14659
+ align-items: baseline;
14660
+ gap: 8px;
14661
+ }
14662
+
14663
+ .package-changes > .package-sub .package-count {
14664
+ letter-spacing: 0;
14665
+ }
14666
+
14667
+ .changed-list {
14668
+ display: grid;
14669
+ margin: 4px 0 0;
14670
+ padding: 0;
14671
+ list-style: none;
14672
+ }
14673
+
14674
+ .changed-page {
14675
+ display: grid;
14676
+ grid-template-columns: minmax(0, 1fr) auto;
14677
+ align-items: center;
14678
+ gap: 2px 12px;
14679
+ padding: 8px 0;
14680
+ border-top: 1px solid var(--rule);
14681
+ }
14682
+
14683
+ .changed-page > :is(.changed-fields, .package-note, .package-said) {
14684
+ grid-column: 1 / -1;
14685
+ }
14686
+
14687
+ /* What changed, a line each: the field's label in its column, as wide in every page, then what the system gave, an arrow, what the campaign has. */
14688
+ .changed-fields {
14689
+ display: grid;
14690
+ grid-template-columns: 8.5em minmax(0, 1fr);
14691
+ gap: 2px 12px;
14692
+ margin: 0;
14693
+ padding: 0;
14694
+ list-style: none;
14695
+ font-size: 0.85rem;
14696
+ overflow-wrap: anywhere;
14697
+ }
14698
+
14699
+ .changed-fields > li {
14700
+ display: grid;
14701
+ grid-template-columns: subgrid;
14702
+ grid-column: 1 / -1;
14703
+ align-items: baseline;
14704
+ }
14705
+
14706
+ .changed-field,
14707
+ .changed-was,
14708
+ .changed-new {
14709
+ color: var(--muted);
14710
+ }
14711
+
14712
+ .changed-values {
14713
+ display: flex;
14714
+ flex-wrap: wrap;
14715
+ align-items: baseline;
14716
+ gap: 0 6px;
14717
+ min-width: 0;
14718
+ }
14719
+
14720
+ .changed-now {
14721
+ font-weight: 650;
14722
+ }
14723
+
14724
+ /* The arrow and what it leads to: together on a new line when the two values do not fit on one. */
14725
+ .changed-to {
14726
+ display: inline-flex;
14727
+ align-items: baseline;
14728
+ gap: 6px;
14729
+ min-width: 0;
14730
+ }
14731
+
14732
+ .changed-arrow {
14733
+ flex: none;
14734
+ align-self: center;
14735
+ color: var(--muted);
14736
+ }
14737
+
14738
+ .changed-arrow svg.icon {
14739
+ display: block;
14740
+ width: 14px;
14741
+ height: 14px;
14742
+ }
14743
+
14744
+ /* While a scene is played nothing is put back: said over the list in the ink, apart from the line of what the list is. */
14745
+ .changed-waits {
14746
+ color: var(--ink);
14747
+ font-weight: 600;
14748
+ }
14749
+
14750
+ /* In the question, what goes back: the list's lines turned round, under their sentence. */
14751
+ .confirm .changed-fields {
14752
+ margin-top: 8px;
14753
+ }
14754
+
14562
14755
  /* What a package's latest needs of the engine (D-515 (2)), under its meta: the words in --muted, the way to the engine's card in the accent. */
14563
14756
  .package-needs {
14564
14757
  display: flex;
@@ -14773,11 +14966,31 @@
14773
14966
  grid-column: auto;
14774
14967
  }
14775
14968
 
14776
- .package-row > :is(.package-progress, .package-window, .package-said),
14969
+ .package-row > :is(.package-progress, .package-window, .package-said, .package-changes),
14777
14970
  .package-credits {
14778
14971
  grid-column: 1 / -1;
14779
14972
  }
14780
14973
 
14974
+ /* A changed page: Put back goes under its name when the two do not fit, as with the text zoomed; the labels take what they need, half at most. */
14975
+ .changed-page {
14976
+ display: flex;
14977
+ flex-wrap: wrap;
14978
+ justify-content: space-between;
14979
+ }
14980
+
14981
+ .changed-page > .package-title {
14982
+ flex: 1 1 8em;
14983
+ min-width: 0;
14984
+ }
14985
+
14986
+ .changed-page > :is(.changed-fields, .package-note, .package-said) {
14987
+ flex: 0 0 100%;
14988
+ }
14989
+
14990
+ .changed-fields {
14991
+ grid-template-columns: fit-content(45%) minmax(0, 1fr);
14992
+ }
14993
+
14781
14994
  .package-add-line input {
14782
14995
  flex-basis: 100%;
14783
14996
  }
@@ -3,6 +3,7 @@ import { useEffect, useRef, useState } from "preact/hooks";
3
3
  import { sectionAddress } from "../address.js";
4
4
  import { pictureAddress, readView } from "../api.js";
5
5
  import { useMedia } from "../parts/card.js";
6
+ import { ChangedLine } from "../parts/changed.js";
6
7
  import { Icon } from "../parts/icons.js";
7
8
  import { placeKindLabel, placeKinds } from "../parts/map-symbols.js";
8
9
  import { knowersOf, Markdown, plainLine } from "../parts/markdown.js";
@@ -112,6 +113,8 @@ function LoreReader({ entry, version, link, onMap, focus, several, kinds }) {
112
113
  const [text, setText] = useState();
113
114
  // Who knows each secret, when not all the player characters do: said after its title, the one place the page names them (D-480 (7)).
114
115
  const [knowers, setKnowers] = useState([]);
116
+ // Whether the campaign changed it, or the page of the game system it derives from (D-564).
117
+ const [changed, setChanged] = useState(false);
115
118
  const [problem, setProblem] = useState(false);
116
119
  const reads = useRef(0);
117
120
  const title = useRef(null);
@@ -122,6 +125,7 @@ function LoreReader({ entry, version, link, onMap, focus, several, kinds }) {
122
125
  if (reading === reads.current) {
123
126
  setText(page.kind === "page" ? page.text : "");
124
127
  setKnowers(page.kind === "page" ? page.knownBy ?? [] : []);
128
+ setChanged(page.kind === "page" && page.layered === true);
125
129
  setProblem(false);
126
130
  }
127
131
  }, () => reading === reads.current && text === undefined && setProblem(true));
@@ -129,7 +133,7 @@ function LoreReader({ entry, version, link, onMap, focus, several, kinds }) {
129
133
  useOpened(title, focus);
130
134
  const person = entry.type === "character" || entry.type === "creature";
131
135
  const banner = entry.picture !== undefined && !person;
132
- return (_jsxs("article", { class: "browse-reader", "aria-labelledby": "reader-title", children: [banner && _jsx("img", { class: "reader-banner", src: pictureAddress(entry.picture), alt: "" }), _jsxs("header", { class: "reader-head", children: [person && _jsx(Token, { member: { name: entry.name, image: entry.picture, role: entry.companion ? "companion" : "other" }, large: true, ...(entry.companion ? { side: "ally" } : {}) }), _jsxs("div", { children: [_jsx("p", { class: "eyebrow", children: entryKind(entry, kinds) }), _jsx("h3", { id: "reader-title", tabIndex: -1, ref: title, children: entry.name }), entry.within !== undefined && (_jsxs("p", { class: "reader-where", children: [_jsx(Icon, { name: "place" }), _jsx("span", { class: "reader-path", children: entry.within.toReversed().map((place, index) => (_jsxs("span", { children: [index > 0 && _jsx("span", { class: "reader-step", "aria-hidden": "true" }), _jsx("a", { class: "md-link", href: sectionAddress("world", "lore", place), children: place })] }, place))) })] }))] })] }), (onMap !== undefined || entry.companion) && (_jsxs("p", { class: "reader-actions", children: [onMap !== undefined && (_jsxs("a", { class: "button package-button", href: onMap, children: [_jsx(Icon, { name: "world" }), t("Show on the map")] })), entry.companion && (_jsxs("a", { class: "button package-button", href: `#/party/${encodeURIComponent(entry.name)}`, children: [_jsx(Icon, { name: "party" }), t("Open the sheet")] }))] })), _jsxs("div", { class: "reader-text", children: [text === undefined && !problem && entry.summary !== "" && _jsx(Markdown, { text: entry.summary, link: link }), text !== undefined && text.trim() !== "" && _jsx(Markdown, { text: text, link: link, secretKnowers: several ? knowersOf(knowers) : undefined }), ((text !== undefined && text.trim() === "") || (text === undefined && entry.summary === "")) && !problem && (_jsx("p", { class: "browse-none", children: text === undefined ? t("Reading…") : t("Your character knows its name, and nothing more yet.") })), problem && _jsx("p", { class: "browse-none", children: t("This page could not be read now: try again in a moment.") })] })] }));
136
+ return (_jsxs("article", { class: "browse-reader", "aria-labelledby": "reader-title", children: [banner && _jsx("img", { class: "reader-banner", src: pictureAddress(entry.picture), alt: "" }), _jsxs("header", { class: "reader-head", children: [person && _jsx(Token, { member: { name: entry.name, image: entry.picture, role: entry.companion ? "companion" : "other" }, large: true, ...(entry.companion ? { side: "ally" } : {}) }), _jsxs("div", { children: [_jsx("p", { class: "eyebrow", children: entryKind(entry, kinds) }), _jsx("h3", { id: "reader-title", tabIndex: -1, ref: title, children: entry.name }), entry.within !== undefined && (_jsxs("p", { class: "reader-where", children: [_jsx(Icon, { name: "place" }), _jsx("span", { class: "reader-path", children: entry.within.toReversed().map((place, index) => (_jsxs("span", { children: [index > 0 && _jsx("span", { class: "reader-step", "aria-hidden": "true" }), _jsx("a", { class: "md-link", href: sectionAddress("world", "lore", place), children: place })] }, place))) })] })), changed && _jsx(ChangedLine, {})] })] }), (onMap !== undefined || entry.companion) && (_jsxs("p", { class: "reader-actions", children: [onMap !== undefined && (_jsxs("a", { class: "button package-button", href: onMap, children: [_jsx(Icon, { name: "world" }), t("Show on the map")] })), entry.companion && (_jsxs("a", { class: "button package-button", href: `#/party/${encodeURIComponent(entry.name)}`, children: [_jsx(Icon, { name: "party" }), t("Open the sheet")] }))] })), _jsxs("div", { class: "reader-text", children: [text === undefined && !problem && entry.summary !== "" && _jsx(Markdown, { text: entry.summary, link: link }), text !== undefined && text.trim() !== "" && _jsx(Markdown, { text: text, link: link, secretKnowers: several ? knowersOf(knowers) : undefined }), ((text !== undefined && text.trim() === "") || (text === undefined && entry.summary === "")) && !problem && (_jsx("p", { class: "browse-none", children: text === undefined ? t("Reading…") : t("Your character knows its name, and nothing more yet.") })), problem && _jsx("p", { class: "browse-none", children: t("This page could not be read now: try again in a moment.") })] })] }));
133
137
  }
134
138
  /** A document on its paper, as what it is: a letter, a notice, a torn page; its picture first, larger at a click, for a map above all. */
135
139
  function DocumentReader({ document, link, focus, several }) {
@@ -3,8 +3,8 @@ export { applyMove, type MovePlan, MoveStopped, planLeave, planMove, type StackC
3
3
  export { changedEnvironment, environmentAt, type EnvironmentEntry, formatEnvironmentEntry, placesAround, readEnvironment } from "./environment.ts";
4
4
  export { changedFields, type FieldChange, formatFields, linkListItems, readFields, readFieldValue, splitPageFile } from "./file.ts";
5
5
  export { baseChain, baseFieldOf, baseValue, derivedPages, followersOf, holdsField, type Inherited, inheritedByBase, inheritedFields, introductionFollowersOf, isNeverInherited, keepersOf, newBaseProblem, ownField, ownFieldChange, removedFieldName, sameAsBase, sectionFollowersOf, shownPart, uniquePage, writtenFieldName, } from "./inheritance.ts";
6
- export { layeredPage, layeredPages, layerFolder, type LayerMark, layersFolderName, systemOriginal } from "./layers.ts";
7
- export { carriedWeight, type LoadRule, weightUnit } from "./load.ts";
6
+ export { layeredPage, layeredPages, layerFolder, type LayerMark, layerParts, layersFolderName, layerTakes, systemOriginal } from "./layers.ts";
7
+ export { carriedWeight, type LoadRule, poundsInKilograms, weightUnit } from "./load.ts";
8
8
  export { type MapField, mapKey, mapOf, mapProblems, type PlaceMap, readMapField, sameFrame } from "./maps.ts";
9
9
  export { everyGoalTicked, firstTable, goalsIn, introductionText, type Link, links, partContent, readSection, secretNames, sectionTitles, type TextMode, textParts, withLinksAsWords, withoutComments, withoutFencedBlocks, withoutUnreadSecrets, } from "./markdown.ts";
10
10
  export { formatPosition, type Position, readPosition } from "./positions.ts";
@@ -16,5 +16,5 @@ export { canHold, containerFieldOf, isCoreField, isCounterField, isEmptyField, i
16
16
  export { alwaysInList, declaredKind, hidingMessage, isDeclaredUncounted, kindMessage, readOnlyMessage, systemKnowsReason, systemLabel } from "./system-pages.ts";
17
17
  export { type PageType, pageTypeNames, worldFolderName } from "./types.ts";
18
18
  export { type Backlink, backlinks, bonusPages, concernsPlayer, createWorld, findPage, isCountedItem, isInParty, isPartyMember, isPlayerCharacter, linksIn, loadWorld, locate, namesakes, type Page, pageFileNamed, type PageMatch, pageNamed, pagesWithName, pagesWithNameOrAlias, pageWithPath, parsePageReference, playerCharacters, searchPages, searchSystemPages, systemFirstFix, type SystemInfo, systemPageNamed, type SystemPages, textsIn, validHoldersOf, versionTranslations, withPage, type World, } from "./world.ts";
19
- export { type LayerWrite, writeLayer } from "./write-layer.ts";
19
+ export { type LayerWrite, removeLayer, writeLayer } from "./write-layer.ts";
20
20
  export { checkFieldChange, type PageChange, writePage } from "./write-page.ts";
@@ -4,8 +4,8 @@ export { applyMove, MoveStopped, planLeave, planMove } from "./containers.js";
4
4
  export { changedEnvironment, environmentAt, formatEnvironmentEntry, placesAround, readEnvironment } from "./environment.js";
5
5
  export { changedFields, formatFields, linkListItems, readFields, readFieldValue, splitPageFile } from "./file.js";
6
6
  export { baseChain, baseFieldOf, baseValue, derivedPages, followersOf, holdsField, inheritedByBase, inheritedFields, introductionFollowersOf, isNeverInherited, keepersOf, newBaseProblem, ownField, ownFieldChange, removedFieldName, sameAsBase, sectionFollowersOf, shownPart, uniquePage, writtenFieldName, } from "./inheritance.js";
7
- export { layeredPage, layeredPages, layerFolder, layersFolderName, systemOriginal } from "./layers.js";
8
- export { carriedWeight, weightUnit } from "./load.js";
7
+ export { layeredPage, layeredPages, layerFolder, layerParts, layersFolderName, layerTakes, systemOriginal } from "./layers.js";
8
+ export { carriedWeight, poundsInKilograms, weightUnit } from "./load.js";
9
9
  export { mapKey, mapOf, mapProblems, readMapField, sameFrame } from "./maps.js";
10
10
  export { everyGoalTicked, firstTable, goalsIn, introductionText, links, partContent, readSection, secretNames, sectionTitles, textParts, withLinksAsWords, withoutComments, withoutFencedBlocks, withoutUnreadSecrets, } from "./markdown.js";
11
11
  export { formatPosition, readPosition } from "./positions.js";
@@ -17,5 +17,5 @@ export { canHold, containerFieldOf, isCoreField, isCounterField, isEmptyField, i
17
17
  export { alwaysInList, declaredKind, hidingMessage, isDeclaredUncounted, kindMessage, readOnlyMessage, systemKnowsReason, systemLabel } from "./system-pages.js";
18
18
  export { pageTypeNames, worldFolderName } from "./types.js";
19
19
  export { backlinks, bonusPages, concernsPlayer, createWorld, findPage, isCountedItem, isInParty, isPartyMember, isPlayerCharacter, linksIn, loadWorld, locate, namesakes, pageFileNamed, pageNamed, pagesWithName, pagesWithNameOrAlias, pageWithPath, parsePageReference, playerCharacters, searchPages, searchSystemPages, systemFirstFix, systemPageNamed, textsIn, validHoldersOf, versionTranslations, withPage, } from "./world.js";
20
- export { writeLayer } from "./write-layer.js";
20
+ export { removeLayer, writeLayer } from "./write-layer.js";
21
21
  export { checkFieldChange, writePage } from "./write-page.js";
@@ -27,8 +27,9 @@ export declare function layeredPages(pages: Page[], layers: Page[], prefix: stri
27
27
  stray: string[];
28
28
  };
29
29
  /**
30
- * A page of the game system with a layer over it: the layer's fields take the place of the page's, a section of the layer that of the section with its name, or is added,
31
- * and its introduction, when it has one, that of the page's. The translated text changes the same way where it has the section, else it goes, so that the
30
+ * A page of the game system with a layer over it: the layer's fields take the place of the page's, the text of a section of the layer that of the section with its name,
31
+ * at any level, or the section is added, inside the one the layer writes it under when the page has that one; and its introduction, when it has one, that of the
32
+ * page's. A heading with no text of its own takes nothing away. The translated text changes the same way where it has the section, else it goes, so that the
32
33
  * campaign's text is never hidden. The page stays the system's.
33
34
  */
34
35
  export declare function layeredPage(page: Page, layer: {
@@ -42,9 +43,10 @@ export declare function systemOriginal(page: Page): Page;
42
43
  * make it known, nor a counter of uses to an item that has none, which would make a kind no kind (STK-1); a field the system `declared` uncounted is no counter.
43
44
  */
44
45
  export declare function layerTakes(page: Page, field: string, value: unknown, declared?: Record<string, FieldKind>): boolean;
45
- /** The sections and secrets of a layer's text, each with its own text and whether it is a secret. */
46
+ /** The sections and secrets of a layer's text, in order: each with its own text, none for a heading that only holds others, whether it is a secret, and the section it is written under. */
46
47
  export declare function layerParts(body: string): {
47
48
  name: string;
48
49
  content: string;
49
50
  secret: boolean;
51
+ under?: string;
50
52
  }[];