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
@@ -1,5 +1,6 @@
1
1
  {
2
2
  "“{title}” is read: the master asks you where to start": "«{title}» прочитано: майстер запитає, з чого почати",
3
+ "{by} makes them meanwhile.": "Тим часом їх створює {by}.",
3
4
  "{count} being read": "Читається: {count}",
4
5
  "{count} books read": "Прочитано книг: {count}",
5
6
  "{count} feet": "{count} фт",
@@ -34,6 +35,7 @@
34
35
  "{game} of the story for every {real} you are away: when you come back, at your first move the master lets it pass and tells what the world did meanwhile": "{game} історії за кожні {real} твоєї відсутності: коли повернешся, після твого першого ходу майстер пропускає цей час і розповідає, що за цей час відбулося у світі",
35
36
  "{hours}h": "{hours} год",
36
37
  "{length} across": "{length} упоперек",
38
+ "{maker} refused the last picture: {why}. {by} makes them instead.": "{maker} відхилив останнє зображення: {why}. Натомість їх створює {by}.",
37
39
  "{minutes}m": "{minutes} хв",
38
40
  "{month} {year}": "{month} {year}",
39
41
  "{name} {version} needs a newer RPG Engine: update it in Installed.": "{name} {version} потребує новішої версії RPG Engine: онови її в розділі «Установлені».",
@@ -80,6 +82,7 @@
80
82
  "{name}'s sheet": "аркуш персонажа {name}",
81
83
  "{name}'s turn": "Хід: {name}",
82
84
  "{names} found out": "{names} дізнаються",
85
+ "{number} of {count}": "{number} з {count}",
83
86
  "{page} is no longer changed in this campaign: there is nothing to put back.": "{page} більше не має змін у цій кампанії: нічого повертати.",
84
87
  "{path}: in this campaign": "{path}: у цій кампанії",
85
88
  "{place}, on {map}": "{place}, на {map}",
@@ -176,11 +179,13 @@
176
179
  "An author's name": "Ім'я автора",
177
180
  "and": "і",
178
181
  "angry": "розлючений",
182
+ "another image tool connected to your AI app: the master asks you which in the chat": "інший інструмент для зображень, підключений до твого ШІ-застосунку: майстер запитає в чаті, який саме",
183
+ "Another tool": "Інший інструмент",
179
184
  "Answer in the window of your computer.": "Відповідай у вікні на комп'ютері.",
180
185
  "Answer the master": "Відповісти майстру",
181
186
  "Answer: {check}": "Відповісти: {check}",
182
- "Answers the master": "Відповідь майстру",
183
187
  "Answers the master: {check}": "Відповідь майстру: {check}",
188
+ "Antigravity makes them in your chat, from your Google plan.": "Їх створює Antigravity у твоєму чаті за твоїм планом Google.",
184
189
  "Arcs": "Арки",
185
190
  "Around": "Навколо",
186
191
  "Arrows move the map, plus and minus zoom, Escape closes a place's card. The list of places below says the same.": "Стрілки рухають мапу, плюс і мінус змінюють масштаб, Escape закриває картку місця. Список місць нижче розповідає те саме.",
@@ -246,6 +251,7 @@
246
251
  "Changed: your character does not know what changed.": "Змінено: твій персонаж не знає, що змінилося.",
247
252
  "Changing the library…": "Змінюємо бібліотеку…",
248
253
  "Chapter {number}": "Розділ {number}",
254
+ "Chapters": "Розділи",
249
255
  "Character voices": "Голоси персонажів",
250
256
  "Checkpoint": "Контрольна точка",
251
257
  "Checks": "Перевірки",
@@ -275,6 +281,7 @@
275
281
  "Codex is on this computer but not logged in. To have pictures:\n1. Open a terminal: on Windows, Start, then type Terminal.\n2. Paste `codex login` and sign in with your ChatGPT account in the browser that opens.\nCodex makes them with your ChatGPT plan, never paying by the picture.": "Codex є на цьому комп'ютері, але вхід не виконано. Щоб мати зображення:\n1. Відкрий термінал: у Windows натисни «Пуск», потім введи Terminal.\n2. Встав `codex login` і увійди через свій обліковий запис ChatGPT у браузері, що відкриється.\nCodex створює їх за твоїм планом ChatGPT, без оплати за кожне зображення.",
276
282
  "Codex makes them on this computer, from your ChatGPT plan.": "Їх створює Codex на цьому комп'ютері за твоїм планом ChatGPT.",
277
283
  "Codex on this computer pays for each picture with an API key, which the engine never uses. To make them with your ChatGPT plan instead:\n1. Open a terminal: on Windows, Start, then type Terminal.\n2. Paste `codex login` and sign in with your ChatGPT account in the browser that opens.": "Codex на цьому комп'ютері платить за кожне зображення через ключ API, який рушій ніколи не використовує. Щоб натомість створювати їх за планом ChatGPT:\n1. Відкрий термінал: у Windows натисни «Пуск», потім введи Terminal.\n2. Встав `codex login` і увійди через свій обліковий запис ChatGPT у браузері, що відкриється.",
284
+ "Codex paints them on this computer, from your ChatGPT plan (Plus or higher)": "Codex малює їх на цьому комп'ютері за твоїм планом ChatGPT (Plus або вище)",
278
285
  "Coin": "Монета",
279
286
  "Coin design": "Дизайн монет",
280
287
  "Coins": "Монети",
@@ -339,6 +346,7 @@
339
346
  "Difficulty": "Складність",
340
347
  "Digital": "Цифрові",
341
348
  "disgusted": "з огидою",
349
+ "Do you want pictures of places and of those you meet?": "Хочеш зображення місць і тих, кого зустрічаєш?",
342
350
  "Documents": "Документи",
343
351
  "done": "виконано",
344
352
  "Done": "Готово",
@@ -348,6 +356,8 @@
348
356
  "down": "повалений",
349
357
  "Download": "Завантажити",
350
358
  "Download {name}": "Завантажити {name}",
359
+ "Download as a web page": "Завантажити як веб-сторінку",
360
+ "Download as Markdown": "Завантажити як Markdown",
351
361
  "drop the {count} highest": "відкинути {count} найвищих",
352
362
  "drop the {count} lowest": "відкинути {count} найнижчих",
353
363
  "drop the highest": "відкинути найвищий",
@@ -444,6 +454,7 @@
444
454
  "held: {count}": "під питанням: {count}",
445
455
  "Help": "Довідка",
446
456
  "Here": "Тут",
457
+ "Here the master writes the story as a book: a chapter for each scene, once it ends.": "Тут майстер записує історію як книгу: розділ для кожної сцени після її завершення.",
447
458
  "hidden": "приховано",
448
459
  "Hidden": "Приховано",
449
460
  "hidden: the master tells you only what comes of them": "приховані: майстер каже тобі лише, чим вони закінчилися",
@@ -468,7 +479,7 @@
468
479
  "how the dice's edges are cut": "як обрізано ребра кубиків",
469
480
  "how the master builds the stories they invent; a written adventure keeps its own": "як майстер будує історії, які вигадує; готова пригода зберігає власну структуру",
470
481
  "how the master writes": "як пише майстер",
471
- "How well do you know this game?": "Наскільки добре ти знаєш цю гру?",
482
+ "How well do you know role-playing games?": "Наскільки добре ти знаєш рольові ігри?",
472
483
  "how your character is made in session zero": "як створюється твій персонаж на нульовій сесії",
473
484
  "I already have one": "У мене вже є",
474
485
  "I attack {target} with {item}.": "Атакую {target} ({item}).",
@@ -488,7 +499,6 @@
488
499
  "I'm ready": "Готово",
489
500
  "Ice": "Лід",
490
501
  "if they all die, or if the table chooses it when one dies: back to the end of the last scene": "якщо гинуть усі, або якщо стіл так вирішить, коли загине один: повернення до кінця останньої сцени",
491
- "if your character dies: back to the end of the last scene": "якщо персонаж гине: повернення до кінця останньої сцени",
492
502
  "Imperial": "Імперські",
493
503
  "Importing “{title}” in the chat": "Імпорт «{title}» у чаті",
494
504
  "Importing “{title}”: opening the document": "Імпорт «{title}»: відкриваю документ",
@@ -496,6 +506,7 @@
496
506
  "Importing “{title}”: reading its parts": "Імпорт «{title}»: читаю частини",
497
507
  "Importing “{title}”: writing the world": "Імпорт «{title}»: створюю світ",
498
508
  "in {container}": "у {container}",
509
+ "In a campaign begun before, ask the master to write the story so far.": "Якщо кампанію розпочато раніше, попроси майстра записати історію, що вже відбулася.",
499
510
  "In the campaign": "У кампанії",
500
511
  "In the chat, with the master: {settings}.": "У чаті, з майстром: {settings}.",
501
512
  "In the open": "Просто неба",
@@ -716,6 +727,7 @@
716
727
  "Only the highest {die} counts": "Враховується лише найвищий {die}",
717
728
  "Only the lowest {die} counts": "Враховується лише найнижчий {die}",
718
729
  "only the story; ask in brackets whenever you want": "лише історія; питай у дужках, коли захочеш",
730
+ "only when all is lost: back to the end of the last scene": "лише коли все втрачено: повернення до кінця останньої сцени",
719
731
  "only when the story turns on them": "лише коли від них залежить історія",
720
732
  "Onyx": "Онікс",
721
733
  "Open": "Відкрити",
@@ -786,6 +798,7 @@
786
798
  "Read {name}": "Читати {name}",
787
799
  "Read all you know": "Прочитати все відоме",
788
800
  "Read elsewhere": "Прочитано деінде",
801
+ "Read it": "Читати",
789
802
  "Read the MIT licence": "Прочитати ліцензію MIT",
790
803
  "Reading the map…": "Читаю мапу…",
791
804
  "Reading…": "Читання…",
@@ -808,6 +821,7 @@
808
821
  "roll one more {condition}": "кинути ще один кубик {condition}",
809
822
  "rolled at {time}": "кинуто о {time}",
810
823
  "Rolled better: {why}": "Кидок кращий: {why}",
824
+ "rolled in the game, on the dashboard": "кидаються в грі, на панелі",
811
825
  "Rolled with the dashboard's dice": "Кинуто кубиками з панелі",
812
826
  "Rolled with your dice": "Кинуто твоїми кубиками",
813
827
  "Rolled worse: {why}": "Кидок гірший: {why}",
@@ -964,7 +978,6 @@
964
978
  "The dice are rolling…": "Кубики котяться…",
965
979
  "the dice as they roll": "кубики, коли їх кидають",
966
980
  "the dice decide": "вирішують кубики",
967
- "the engine rolls them": "кидає рушій",
968
981
  "The extension is in the campaign: it counts from now on.": "Розширення в кампанії: воно діє відтепер.",
969
982
  "The file is more than {size} MB: no package is that big.": "Файл завеликий, понад {size} МБ: пакетів такого розміру не буває.",
970
983
  "The folder {name} has characters npm cannot take: move it to another path.": "У назві папки {name} є символи, які npm не приймає: перемісти її в інше місце.",
@@ -993,7 +1006,9 @@
993
1006
  "The language is on this computer, for every campaign.": "Мова є на цьому комп'ютері, для всіх кампаній.",
994
1007
  "the language of this page": "мова цієї сторінки",
995
1008
  "the language the master plays in, and the page's too when it is translated": "мова, якою грає майстер, а також мова сторінки, якщо її перекладено",
1009
+ "The last chapter": "Останній розділ",
996
1010
  "The master": "Майстер",
1011
+ "The master asks you in the chat which tool to use.": "Майстер запитає в чаті, який інструмент використати.",
997
1012
  "The master goes on with {version} in this chat. To play with {next}:": "У цьому чаті майстер продовжує з версією {version}. Щоб грати з {next}:",
998
1013
  "The master has already heard it.": "Майстер це вже почув.",
999
1014
  "The master has read it": "Майстер її прочитав",
@@ -1004,6 +1019,9 @@
1004
1019
  "The master makes it": "Створює майстер",
1005
1020
  "the master makes it from a few words of yours": "майстер створює його з кількох твоїх слів",
1006
1021
  "the master makes them in session zero": "майстер створює їх на нульовій сесії",
1022
+ "the master makes them with {tool}": "майстер створює їх за допомогою {tool}",
1023
+ "The master makes them with {tool}.": "Майстер створює їх за допомогою {tool}.",
1024
+ "the master makes them with ElevenLabs, connected to your AI app, from your ElevenLabs plan": "майстер створює їх за допомогою ElevenLabs, підключеного до твого ШІ-застосунку, за твоїм планом ElevenLabs",
1007
1025
  "The master plays in {language}, and the page is written in it too.": "Майстер грає мовою {language}, і сторінка теж нею написана.",
1008
1026
  "The master plays in {language}; the page stays in English: Codex or Claude Code would translate it on this computer.": "Майстер грає мовою {language}; сторінка залишається англійською: Codex або Claude Code переклали б її на цьому комп’ютері.",
1009
1027
  "The master plays in {language}; the page stays in English.": "Майстер грає мовою {language}; сторінка залишається англійською.",
@@ -1058,6 +1076,8 @@
1058
1076
  "There is no player character yet: the sheet comes when the master writes one.": "Персонажа ще немає: аркуш персонажа з'явиться, коли майстер його напише.",
1059
1077
  "These pages of the game system changed for this campaign: each line has what the game system gave, then what it is now, in bold.": "У цій кампанії ці сторінки ігрової системи змінилися: у кожному рядку спершу те, що було в системі, а потім жирним те, що є тепер.",
1060
1078
  "These pages of the game system changed for this campaign.": "У цій кампанії ці сторінки ігрової системи змінилися.",
1079
+ "These words answer the master instead of a roll or a button: {question}": "Ці слова відповідають майстру замість кидка чи кнопки: {question}",
1080
+ "These words answer the master's question: {question}": "Ці слова — відповідь на запитання майстра: {question}",
1061
1081
  "This campaign does not use {name}.": "Ця кампанія не використовує {name}.",
1062
1082
  "this campaign has": "ця кампанія має",
1063
1083
  "This campaign has {name} {version}, already in play: an adventure in play is not updated.": "У цій кампанії є {name} {version}, яка вже в грі: пригода в грі не оновлюється.",
@@ -1078,6 +1098,7 @@
1078
1098
  "Threat clocks": "Годинники загроз",
1079
1099
  "Time is up": "Час вичерпано",
1080
1100
  "Time passes: {from} → {to}": "Минає час: {from} → {to}",
1101
+ "Timeline": "Хронологія",
1081
1102
  "Title": "Заголовок",
1082
1103
  "to": "до",
1083
1104
  "To choose": "Треба обрати",
@@ -1141,7 +1162,7 @@
1141
1162
  "What is already in play stays as it is, and you can go back whenever you want.": "Усе, що вже в грі, лишається як є, а повернутися можна будь-коли.",
1142
1163
  "What it wrote in the campaign stays, and comes back if you install it again.": "Те, що він записав у кампанію, залишиться і повернеться, якщо встановити його знову.",
1143
1164
  "what lights your way, as long as it lasts": "те, що освітлює твій шлях, поки вистачає",
1144
- "what never appears in the game": "що ніколи не з'являється в грі",
1165
+ "what must never appear in the game": "те, що ніколи не має з'являтися в грі",
1145
1166
  "What runs the game: the master's tools and this page.": "Те, на чому працює гра: інструменти майстра і ця сторінка.",
1146
1167
  "What the master asks": "Що питає майстер",
1147
1168
  "what the master asks you to roll": "що майстер просить кинути",
@@ -1162,6 +1183,9 @@
1162
1183
  "whether the story's time runs while you are away, from one session to the next": "чи спливає час історії, поки тебе немає, між сесіями",
1163
1184
  "Which page": "Яка сторінка",
1164
1185
  "Who is where": "Хто де",
1186
+ "who makes the pictures": "хто створює зображення",
1187
+ "Who makes them": "Хто їх створює",
1188
+ "Who makes them?": "Хто їх створює?",
1165
1189
  "who rolls your character's dice": "хто кидає кубики персонажа",
1166
1190
  "who speaks for the characters you meet": "хто говорить за персонажів, яких ти зустрічаєш",
1167
1191
  "Whose card": "Чия картка",
@@ -1206,7 +1230,9 @@
1206
1230
  "You read it": "Це прочитано тобою",
1207
1231
  "you roll your own and tell the values": "кидаєш свої кубики й кажеш значення",
1208
1232
  "You said no: nothing changed.": "Відмову прийнято: нічого не змінилося.",
1233
+ "Your AI app": "Твій ШІ-застосунок",
1209
1234
  "your AI app decides, as it does in any chat": "ваш ШІ-застосунок вирішує сам, як і в будь-якому чаті",
1235
+ "your AI app, by its own means: Claude draws them as vector pictures, Codex and Antigravity paint them, each from your plan": "твій ШІ-застосунок власними засобами: Claude малює їх як векторні зображення, Codex і Antigravity — як растрові, кожен за твоїм планом",
1210
1236
  "Your app decides": "Вирішує застосунок",
1211
1237
  "Your books": "Твої книги",
1212
1238
  "Your character": "Твій персонаж",
@@ -1,5 +1,6 @@
1
1
  {
2
2
  "“{title}” is read: the master asks you where to start": "“{title}”已读完:主持人会问你从哪里开始",
3
+ "{by} makes them meanwhile.": "期间由 {by} 生成。",
3
4
  "{count} being read": "{count} 本读取中",
4
5
  "{count} books read": "已读取 {count} 本书",
5
6
  "{count} feet": "{count}英尺",
@@ -34,6 +35,7 @@
34
35
  "{game} of the story for every {real} you are away: when you come back, at your first move the master lets it pass and tells what the world did meanwhile": "你每离开{real},故事就过去{game}:你回来后的第一步行动时,主持人会让这段时间流逝,并讲述这期间世界发生了什么",
35
36
  "{hours}h": "{hours}小时",
36
37
  "{length} across": "宽 {length}",
38
+ "{maker} refused the last picture: {why}. {by} makes them instead.": "{maker} 拒绝了上一张图片:{why}。改由 {by} 生成。",
37
39
  "{minutes}m": "{minutes}分钟",
38
40
  "{month} {year}": "{year}年{month}",
39
41
  "{name} {version} needs a newer RPG Engine: update it in Installed.": "{name} {version} 需要更新版本的 RPG Engine,请在“已安装”中更新。",
@@ -80,6 +82,7 @@
80
82
  "{name}'s sheet": "{name}的角色卡",
81
83
  "{name}'s turn": "{name}的回合",
82
84
  "{names} found out": "{names}发现了",
85
+ "{number} of {count}": "第 {number} 章,共 {count} 章",
83
86
  "{page} is no longer changed in this campaign: there is nothing to put back.": "{page} 在本战役中已没有修改,无需恢复。",
84
87
  "{path}: in this campaign": "{path}:用于本战役",
85
88
  "{place}, on {map}": "{map}上的{place}",
@@ -176,11 +179,13 @@
176
179
  "An author's name": "作者姓名",
177
180
  "and": "和",
178
181
  "angry": "愤怒",
182
+ "another image tool connected to your AI app: the master asks you which in the chat": "使用已连接到你的 AI 应用的其他图片工具:主持人会在聊天中问你用哪一个",
183
+ "Another tool": "其他工具",
179
184
  "Answer in the window of your computer.": "请在你电脑的窗口中回答。",
180
185
  "Answer the master": "回答主持人",
181
186
  "Answer: {check}": "回应:{check}",
182
- "Answers the master": "回应主持人",
183
187
  "Answers the master: {check}": "回应主持人:{check}",
188
+ "Antigravity makes them in your chat, from your Google plan.": "由 Antigravity 在你的对话中使用你的 Google 套餐生成。",
184
189
  "Arcs": "长线",
185
190
  "Around": "周围",
186
191
  "Arrows move the map, plus and minus zoom, Escape closes a place's card. The list of places below says the same.": "方向键移动地图,加号和减号缩放,Esc 关闭地点卡片。下方的地点列表内容相同。",
@@ -246,6 +251,7 @@
246
251
  "Changed: your character does not know what changed.": "已修改:你的角色不知道改了什么。",
247
252
  "Changing the library…": "正在更改资料库…",
248
253
  "Chapter {number}": "第{number}章",
254
+ "Chapters": "章节",
249
255
  "Character voices": "角色配音",
250
256
  "Checkpoint": "存档点",
251
257
  "Checks": "检定",
@@ -275,6 +281,7 @@
275
281
  "Codex is on this computer but not logged in. To have pictures:\n1. Open a terminal: on Windows, Start, then type Terminal.\n2. Paste `codex login` and sign in with your ChatGPT account in the browser that opens.\nCodex makes them with your ChatGPT plan, never paying by the picture.": "这台电脑上已安装 Codex,但尚未登录。要使用图片:\n1. 打开终端:在 Windows 中点击开始,然后输入“终端”。\n2. 粘贴 `codex login`,并在弹出的浏览器中登录你的 ChatGPT 账号。\nCodex 使用你的 ChatGPT 套餐生成图片,无需按张付费。",
276
282
  "Codex makes them on this computer, from your ChatGPT plan.": "由 Codex 在这台电脑上使用你的 ChatGPT 套餐生成。",
277
283
  "Codex on this computer pays for each picture with an API key, which the engine never uses. To make them with your ChatGPT plan instead:\n1. Open a terminal: on Windows, Start, then type Terminal.\n2. Paste `codex login` and sign in with your ChatGPT account in the browser that opens.": "这台电脑上的 Codex 使用 API 密钥按张付费,而引擎从不使用该方式。若要改用你的 ChatGPT 套餐生成图片:\n1. 打开终端:在 Windows 中点击开始,然后输入“终端”。\n2. 粘贴 `codex login`,并在弹出的浏览器中登录你的 ChatGPT 账号。",
284
+ "Codex paints them on this computer, from your ChatGPT plan (Plus or higher)": "由 Codex 在这台电脑上绘制,使用你的 ChatGPT 套餐(Plus 或更高)",
278
285
  "Coin": "硬币",
279
286
  "Coin design": "硬币图案",
280
287
  "Coins": "硬币",
@@ -339,6 +346,7 @@
339
346
  "Difficulty": "难度",
340
347
  "Digital": "数字",
341
348
  "disgusted": "厌恶",
349
+ "Do you want pictures of places and of those you meet?": "要为地点和遇到的人物生成图片吗?",
342
350
  "Documents": "文档",
343
351
  "done": "已完成",
344
352
  "Done": "完成",
@@ -348,6 +356,8 @@
348
356
  "down": "倒下",
349
357
  "Download": "下载",
350
358
  "Download {name}": "下载 {name}",
359
+ "Download as a web page": "下载为网页",
360
+ "Download as Markdown": "下载为 Markdown",
351
361
  "drop the {count} highest": "去掉最高的{count}个",
352
362
  "drop the {count} lowest": "去掉最低的{count}个",
353
363
  "drop the highest": "去掉最高的",
@@ -444,6 +454,7 @@
444
454
  "held: {count}": "待定:{count}",
445
455
  "Help": "帮助",
446
456
  "Here": "此处",
457
+ "Here the master writes the story as a book: a chapter for each scene, once it ends.": "主持人会把故事写成一本书:每个场景结束后,就成为一章。",
447
458
  "hidden": "隐藏",
448
459
  "Hidden": "隐藏",
449
460
  "hidden: the master tells you only what comes of them": "隐藏:主持人只告诉你结果",
@@ -468,7 +479,7 @@
468
479
  "how the dice's edges are cut": "骰子边缘的切削方式",
469
480
  "how the master builds the stories they invent; a written adventure keeps its own": "主持人如何构建自创的故事;已有的成稿冒险沿用自身结构",
470
481
  "how the master writes": "主持人的写作方式",
471
- "How well do you know this game?": "你对这个游戏有多熟悉?",
482
+ "How well do you know role-playing games?": "你对角色扮演游戏了解多少?",
472
483
  "how your character is made in session zero": "零号团里如何创建你的角色",
473
484
  "I already have one": "我已有了",
474
485
  "I attack {target} with {item}.": "我用{item}攻击{target}。",
@@ -488,7 +499,6 @@
488
499
  "I'm ready": "我准备好了",
489
500
  "Ice": "冰",
490
501
  "if they all die, or if the table chooses it when one dies: back to the end of the last scene": "全员死亡时,或有一人死亡而玩家们选择回档时:回到上一个场景结束时",
491
- "if your character dies: back to the end of the last scene": "角色死亡时:回到上一个场景结束时",
492
502
  "Imperial": "英制",
493
503
  "Importing “{title}” in the chat": "正在聊天中导入“{title}”",
494
504
  "Importing “{title}”: opening the document": "正在导入“{title}”:打开文档",
@@ -496,6 +506,7 @@
496
506
  "Importing “{title}”: reading its parts": "正在导入“{title}”:读取各部分",
497
507
  "Importing “{title}”: writing the world": "正在导入“{title}”:撰写世界",
498
508
  "in {container}": "在{container}中",
509
+ "In a campaign begun before, ask the master to write the story so far.": "如果战役是之前开始的,可以请主持人写出到目前为止的故事。",
499
510
  "In the campaign": "已在战役中",
500
511
  "In the chat, with the master: {settings}.": "在聊天中与主持人一起决定:{settings}。",
501
512
  "In the open": "在野外",
@@ -716,6 +727,7 @@
716
727
  "Only the highest {die} counts": "只计最高的{die}",
717
728
  "Only the lowest {die} counts": "只计最低的{die}",
718
729
  "only the story; ask in brackets whenever you want": "只有故事;想问时用括号提问",
730
+ "only when all is lost: back to the end of the last scene": "仅在全盘皆输时使用:回到上一个场景的结尾",
719
731
  "only when the story turns on them": "仅当故事取决于它们时",
720
732
  "Onyx": "缟玛瑙",
721
733
  "Open": "打开",
@@ -786,6 +798,7 @@
786
798
  "Read {name}": "阅读{name}",
787
799
  "Read all you know": "阅读全部所知",
788
800
  "Read elsewhere": "在别处读过",
801
+ "Read it": "阅读",
789
802
  "Read the MIT licence": "查看 MIT 许可证",
790
803
  "Reading the map…": "正在读取地图…",
791
804
  "Reading…": "阅读中…",
@@ -808,6 +821,7 @@
808
821
  "roll one more {condition}": "{condition}时多掷一个骰子",
809
822
  "rolled at {time}": "于 {time} 掷骰",
810
823
  "Rolled better: {why}": "掷骰占优:{why}",
824
+ "rolled in the game, on the dashboard": "在游戏中掷骰,结果显示在面板上",
811
825
  "Rolled with the dashboard's dice": "用面板的骰子掷出",
812
826
  "Rolled with your dice": "用你的骰子掷出",
813
827
  "Rolled worse: {why}": "掷骰吃亏:{why}",
@@ -964,7 +978,6 @@
964
978
  "The dice are rolling…": "骰子正在滚动……",
965
979
  "the dice as they roll": "骰子滚动时的声音",
966
980
  "the dice decide": "由骰子决定",
967
- "the engine rolls them": "由引擎掷骰",
968
981
  "The extension is in the campaign: it counts from now on.": "扩展已加入战役,从现在起生效。",
969
982
  "The file is more than {size} MB: no package is that big.": "文件超过 {size} MB,没有哪个包会这么大。",
970
983
  "The folder {name} has characters npm cannot take: move it to another path.": "文件夹 {name} 含有 npm 不支持的字符,请移到其他路径。",
@@ -993,7 +1006,9 @@
993
1006
  "The language is on this computer, for every campaign.": "语言已在本机,所有战役通用。",
994
1007
  "the language of this page": "本页面的语言",
995
1008
  "the language the master plays in, and the page's too when it is translated": "主持人游戏时使用的语言;页面若已翻译,也使用该语言",
1009
+ "The last chapter": "最新一章",
996
1010
  "The master": "主持人",
1011
+ "The master asks you in the chat which tool to use.": "主持人会在聊天中问你使用哪个工具。",
997
1012
  "The master goes on with {version} in this chat. To play with {next}:": "在这个聊天中,主持人继续使用 {version}。要使用 {next} 来玩:",
998
1013
  "The master has already heard it.": "主持人已经听到了。",
999
1014
  "The master has read it": "主持人已读",
@@ -1004,6 +1019,9 @@
1004
1019
  "The master makes it": "由主持人生成",
1005
1020
  "the master makes it from a few words of yours": "主持人根据你的几句描述来创建",
1006
1021
  "the master makes them in session zero": "由主持人在零号团中创建",
1022
+ "the master makes them with {tool}": "由主持人用 {tool} 生成",
1023
+ "The master makes them with {tool}.": "由主持人用 {tool} 生成。",
1024
+ "the master makes them with ElevenLabs, connected to your AI app, from your ElevenLabs plan": "由主持人用已连接到你的 AI 应用的 ElevenLabs 生成,使用你的 ElevenLabs 套餐",
1007
1025
  "The master plays in {language}, and the page is written in it too.": "主持人使用{language}进行游戏,页面也使用这种语言。",
1008
1026
  "The master plays in {language}; the page stays in English: Codex or Claude Code would translate it on this computer.": "主持人使用{language}进行游戏;页面仍显示英文:Codex 或 Claude Code 可以在这台电脑上翻译页面。",
1009
1027
  "The master plays in {language}; the page stays in English.": "主持人使用{language}进行游戏,页面仍为英文。",
@@ -1058,6 +1076,8 @@
1058
1076
  "There is no player character yet: the sheet comes when the master writes one.": "还没有角色:主持人写好角色后,角色卡就会出现。",
1059
1077
  "These pages of the game system changed for this campaign: each line has what the game system gave, then what it is now, in bold.": "本战役中,游戏系统的这些页面有所改动:每行先是系统原有的内容,再用粗体显示现在的内容。",
1060
1078
  "These pages of the game system changed for this campaign.": "本战役中,游戏系统的这些页面有所改动。",
1079
+ "These words answer the master instead of a roll or a button: {question}": "这些话代替掷骰或按钮回答主持人:{question}",
1080
+ "These words answer the master's question: {question}": "这些话回答主持人的问题:{question}",
1061
1081
  "This campaign does not use {name}.": "这个战役没有使用 {name}。",
1062
1082
  "this campaign has": "本战役设定",
1063
1083
  "This campaign has {name} {version}, already in play: an adventure in play is not updated.": "这个战役已有 {name} {version},并且正在进行,进行中的冒险不会更新。",
@@ -1078,6 +1098,7 @@
1078
1098
  "Threat clocks": "威胁进度钟",
1079
1099
  "Time is up": "时间到了",
1080
1100
  "Time passes: {from} → {to}": "时间流逝:{from} → {to}",
1101
+ "Timeline": "时间线",
1081
1102
  "Title": "标题",
1082
1103
  "to": "通往",
1083
1104
  "To choose": "待选择",
@@ -1141,7 +1162,7 @@
1141
1162
  "What is already in play stays as it is, and you can go back whenever you want.": "已经在进行中的内容保持不变,你随时可以改回来。",
1142
1163
  "What it wrote in the campaign stays, and comes back if you install it again.": "它在战役中写入的内容会保留,重新安装后会恢复。",
1143
1164
  "what lights your way, as long as it lasts": "为你照亮前路的东西,直到用完为止",
1144
- "what never appears in the game": "游戏中绝不出现的内容",
1165
+ "what must never appear in the game": "游戏中绝不能出现的内容",
1145
1166
  "What runs the game: the master's tools and this page.": "驱动游戏的部分:主持人的工具和这个页面。",
1146
1167
  "What the master asks": "主持人的提问",
1147
1168
  "what the master asks you to roll": "主持人要你掷的骰子",
@@ -1162,6 +1183,9 @@
1162
1183
  "whether the story's time runs while you are away, from one session to the next": "从一次游戏到下一次,你不在时故事时间是否流逝",
1163
1184
  "Which page": "哪个页面",
1164
1185
  "Who is where": "谁在哪里",
1186
+ "who makes the pictures": "由谁生成图片",
1187
+ "Who makes them": "由谁生成",
1188
+ "Who makes them?": "由谁生成?",
1165
1189
  "who rolls your character's dice": "谁来替你的角色掷骰",
1166
1190
  "who speaks for the characters you meet": "由谁来为你遇到的角色发声",
1167
1191
  "Whose card": "谁的卡片",
@@ -1206,7 +1230,9 @@
1206
1230
  "You read it": "你读过它",
1207
1231
  "you roll your own and tell the values": "你自己掷骰并报出点数",
1208
1232
  "You said no: nothing changed.": "你选择了拒绝,没有任何更改。",
1233
+ "Your AI app": "你的 AI 应用",
1209
1234
  "your AI app decides, as it does in any chat": "由你的 AI 应用决定,和平时聊天一样",
1235
+ "your AI app, by its own means: Claude draws them as vector pictures, Codex and Antigravity paint them, each from your plan": "由你的 AI 应用自行生成:Claude 绘制矢量图,Codex 和 Antigravity 绘制画作,均使用你的套餐",
1210
1236
  "Your app decides": "由你的应用决定",
1211
1237
  "Your books": "你的书",
1212
1238
  "Your character": "你的角色",
@@ -0,0 +1,106 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "preact/jsx-runtime";
2
+ // The story told as a book (T-227): the master's prose, a chapter for each closed scene, set as a book's pages: one chapter at a time on paper, its paragraphs
3
+ // justified and indented, a capital at its start; the chapters listed beside it, closing to the left, the last with its bookmark; downloaded as Markdown or as a
4
+ // web page that prints as the book.
5
+ import { render } from "preact";
6
+ import { useEffect, useRef, useState } from "preact/hooks";
7
+ import { sectionAddress } from "../address.js";
8
+ import { Icon } from "../parts/icons.js";
9
+ import { InlineText } from "../parts/markdown.js";
10
+ import { useChoice } from "../shell/prefs.js";
11
+ import { t } from "../text.js";
12
+ // Whether the list of chapters is open beside the page, kept in this browser; on a narrow screen it is above the page, closed until asked for.
13
+ const indexChoice = { key: "rpg-engine.book-index", initial: "open", values: ["open", "closed"] };
14
+ /** The book: the chapter the address asks for, or the last; the list of chapters beside it, and the pages turned by chapter, each a link to its address. */
15
+ export function Book({ chapters, asked, campaign }) {
16
+ const [index, setIndex] = useChoice(indexChoice);
17
+ const page = useRef(null);
18
+ const title = useRef(null);
19
+ const shown = useRef(false);
20
+ const [above, setAbove] = useState(false);
21
+ const narrow = window.matchMedia("(max-width: 760px)").matches;
22
+ const open = narrow ? above : index === "open";
23
+ const toggle = () => (narrow ? setAbove(!open) : setIndex(open ? "closed" : "open"));
24
+ // A chapter turned to, from the list or the page's foot, as #/journal/story/3: the focus on its title, its start in view; the book as opened keeps both.
25
+ useEffect(() => {
26
+ if (!shown.current) {
27
+ shown.current = true;
28
+ return;
29
+ }
30
+ setAbove(false);
31
+ title.current?.focus({ preventScroll: true });
32
+ // Its start hidden over the window or under the top: brought just under them.
33
+ if (page.current !== null && page.current.getBoundingClientRect().top < Number.parseFloat(getComputedStyle(page.current).scrollMarginTop)) {
34
+ page.current?.scrollIntoView({ block: "start", behavior: matchMedia("(prefers-reduced-motion: reduce)").matches ? "auto" : "smooth" });
35
+ }
36
+ }, [asked]);
37
+ if (chapters.length === 0) {
38
+ return (_jsxs("div", { class: "book-empty", children: [_jsx("p", { children: t("Here the master writes the story as a book: a chapter for each scene, once it ends.") }), _jsx("p", { children: t("In a campaign begun before, ask the master to write the story so far.") })] }));
39
+ }
40
+ const last = chapters[chapters.length - 1];
41
+ const current = chapters.find((chapter) => String(chapter.number) === asked) ?? last;
42
+ const at = chapters.indexOf(current);
43
+ const before = chapters[at - 1];
44
+ const after = chapters[at + 1];
45
+ return (_jsxs("div", { class: open ? "book" : "book index-closed", children: [_jsxs("nav", { class: "book-index", "aria-label": t("Chapters"), children: [_jsxs("button", { type: "button", class: "button quiet book-index-toggle", "aria-expanded": open, onClick: toggle, children: [_jsx(Icon, { name: "list" }), _jsx("span", { children: t("Chapters") })] }), open && (_jsx("ol", { children: chapters.map((chapter) => (_jsx("li", { children: _jsxs("a", { href: chapterAddress(chapter), "aria-current": chapter === current ? "page" : undefined, "aria-describedby": chapter === last ? `book-line-${chapter.number} book-last` : `book-line-${chapter.number}`, children: [_jsxs("span", { class: "book-index-title", children: [_jsx("span", { class: "book-index-number", children: chapter.number }), " ", chapter.title] }), _jsx("span", { class: "book-index-line", id: `book-line-${chapter.number}`, "aria-hidden": "true", children: openingWords(chapter.text) }), chapter === last && _jsx("span", { class: "book-mark", "aria-hidden": "true" }), chapter === last && _jsx("span", { class: "visually-hidden", id: "book-last", children: t("The last chapter") })] }) }, chapter.number))) }))] }), _jsxs("article", { class: current === last ? "book-page marked" : "book-page", ref: page, "aria-labelledby": "book-chapter-title", children: [_jsxs("header", { class: "book-head", children: [_jsx("p", { class: "book-number", children: t("Chapter {number}", { number: current.number }) }), _jsx("h3", { id: "book-chapter-title", ref: title, tabIndex: -1, children: current.title }), _jsx("span", { class: "book-ornament", "aria-hidden": "true", children: "\u2766" })] }), _jsx(BookText, { text: current.text }), _jsxs("footer", { class: "book-turn", children: [before === undefined ? _jsx("span", {}) : (_jsxs("a", { href: chapterAddress(before), children: [_jsx("span", { class: "book-arrow", "aria-hidden": "true", children: "\u2190" }), _jsxs("span", { class: "visually-hidden", children: [t("Chapter {number}", { number: before.number }), ":"] }), " ", before.title] })), _jsx("span", { class: "book-folio", children: t("{number} of {count}", { number: at + 1, count: chapters.length }) }), after === undefined ? _jsx("span", {}) : (_jsxs("a", { href: chapterAddress(after), class: "book-on", children: [_jsxs("span", { class: "visually-hidden", children: [t("Chapter {number}", { number: after.number }), ":"] }), " ", after.title, " ", _jsx("span", { class: "book-arrow", "aria-hidden": "true", children: "\u2192" })] }))] })] }), _jsxs("div", { class: "book-export", children: [_jsxs("button", { type: "button", class: "button quiet", onClick: () => download(fileName(campaign, "md"), "text/markdown", bookMarkdown(chapters, campaign)), children: [_jsx(Icon, { name: "download" }), t("Download as Markdown")] }), _jsxs("button", { type: "button", class: "button quiet", onClick: () => download(fileName(campaign, "html"), "text/html", bookPage(chapters, campaign)), children: [_jsx(Icon, { name: "download" }), t("Download as a web page")] })] })] }));
46
+ }
47
+ /** A chapter's prose: paragraphs apart by a blank line, a line of three marks alone a break within it, italics and bold as written. */
48
+ function BookText({ text }) {
49
+ return (_jsx("div", { class: "book-text", children: text.split(/\n\s*\n/).map((block) => block.trim()).filter((block) => block !== "").map((block, index) => isBreak(block)
50
+ ? _jsx("p", { class: "book-break", "aria-hidden": "true", children: "\u2042" }, index)
51
+ : (_jsx("p", { children: _jsx(InlineText, { text: block.replace(/^#+\s*/, "").replace(/\s*\n\s*/g, " ") }) }, index))) }));
52
+ }
53
+ /** A chapter's address, as #/journal/story/3: pushed, so that Back turns the page back. */
54
+ function chapterAddress(chapter) {
55
+ return sectionAddress("journal", "story", String(chapter.number));
56
+ }
57
+ function isBreak(block) {
58
+ return /^(?:[*\-_]\s*){3,}$|^⁂$/.test(block);
59
+ }
60
+ /** The first words of a chapter, for its line in the list. */
61
+ function openingWords(text) {
62
+ const first = text.split(/\n\s*\n/).map((block) => block.trim()).find((block) => block !== "" && !isBreak(block)) ?? "";
63
+ const plain = first.replace(/[*_#]/g, "").replace(/\s+/g, " ");
64
+ return plain.length <= 60 ? plain : `${plain.slice(0, plain.lastIndexOf(" ", 60) > 30 ? plain.lastIndexOf(" ", 60) : 60)}…`;
65
+ }
66
+ /** The book as one Markdown file: the campaign's name, then each chapter under its number and title. */
67
+ function bookMarkdown(chapters, campaign) {
68
+ const head = campaign === undefined ? "" : `# ${campaign}\n\n`;
69
+ return `${head}${chapters.map((chapter) => `## ${t("Chapter {number}", { number: chapter.number })}: ${chapter.title}\n\n${chapter.text}`).join("\n\n")}\n`;
70
+ }
71
+ /** The book as a web page of its own, set as the page sets it, each chapter starting a new sheet when printed. */
72
+ function bookPage(chapters, campaign) {
73
+ const holder = document.createElement("div");
74
+ render(_jsxs(_Fragment, { children: [campaign !== undefined && _jsx("h1", { children: campaign }), chapters.map((chapter) => (_jsxs("section", { class: "chapter", children: [_jsx("p", { class: "number", children: t("Chapter {number}", { number: chapter.number }) }), _jsx("h2", { children: chapter.title }), _jsx("p", { class: "ornament", "aria-hidden": "true", children: "\u2766" }), _jsx(BookText, { text: chapter.text })] }, chapter.number)))] }), holder);
75
+ const language = document.documentElement.lang || "en";
76
+ const title = (campaign ?? t("Story")).replace(/[<&]/g, (mark) => (mark === "<" ? "&lt;" : "&amp;"));
77
+ return `<!doctype html>\n<html lang="${language}" dir="${document.documentElement.dir || "ltr"}">\n<head>\n<meta charset="utf-8">\n<meta name="viewport" content="width=device-width, initial-scale=1">\n<title>${title}</title>\n<style>${exportStyle}</style>\n</head>\n<body>\n${holder.innerHTML}\n</body>\n</html>\n`;
78
+ }
79
+ // The exported page's own style: the book's setting, with no font of its own, and a sheet for each chapter in print.
80
+ const exportStyle = `
81
+ body { margin: 0 auto; padding: 3rem 1.5rem; max-width: 36rem; background: #f6eedb; color: #2f261b; font: 1.125rem/1.65 "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif; }
82
+ h1 { text-align: center; font-weight: normal; font-size: 2.2rem; margin: 2rem 0 4rem; }
83
+ .chapter { margin-bottom: 4rem; }
84
+ .number { text-align: center; letter-spacing: .15em; text-transform: uppercase; font-size: .8rem; margin: 0; }
85
+ h2 { text-align: center; font-weight: normal; font-size: 1.6rem; margin: .3rem 0 0; }
86
+ .ornament { text-align: center; margin: .4rem 0 1.6rem; }
87
+ .book-text p { margin: 0; text-indent: 1.5em; text-align: justify; hyphens: auto; text-wrap: pretty; orphans: 2; widows: 2; }
88
+ .book-text p:first-child, .book-text .book-break + p { text-indent: 0; }
89
+ .book-text p:first-child:not(:lang(ar), :lang(hi), :lang(ja), :lang(zh), :lang(ko))::first-letter { float: inline-start; font-size: 3.2em; line-height: .85; padding-block-start: .05em; padding-inline-end: .08em; }
90
+ .book-text .book-break { text-align: center; text-indent: 0; margin: .8rem 0; }
91
+ @media (max-width: 30rem) { body { padding: 2rem 1.25rem; } .book-text p { text-align: start; } }
92
+ @media print { body { background: none; padding: 0; } .chapter { break-before: page; } h1 + .chapter { break-before: auto; } }
93
+ `;
94
+ function fileName(campaign, extension) {
95
+ const name = (campaign ?? t("Story")).replace(/[\\/:*?"<>|]+/g, " ").trim();
96
+ return `${name === "" ? "story" : name}.${extension}`;
97
+ }
98
+ /** Gives the browser a file to save. */
99
+ function download(name, type, text) {
100
+ const address = URL.createObjectURL(new Blob([text], { type: `${type};charset=utf-8` }));
101
+ const link = document.createElement("a");
102
+ link.href = address;
103
+ link.download = name;
104
+ link.click();
105
+ setTimeout(() => URL.revokeObjectURL(address), 1000);
106
+ }
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "preact/jsx-runtime";
2
- // The Journal section (D-367, D-369, D-371, D-384, D-388): the quests the character knows as a video game's quest log, each with the time left before its deadline at its top, its
2
+ // The Journal section (D-367, D-369, D-371, D-384, D-388, T-227): the quests the character knows as a video game's quest log, each with the time left before its deadline at its top, its
3
3
  // goals, its counters as bars and its clock with its name, the main ones first and in gold; the ones the player follows, the main one until they choose, shown
4
- // small beside the page, or in Scene and Combat on a narrow screen; the story by its scenes, as chapters, the last first, each with what the diary tells of it; the companions'
4
+ // small beside the page, or in Scene and Combat on a narrow screen; the story told as a book; its timeline by scenes, as chapters, the last first, each with what the diary tells of it; the companions'
5
5
  // diaries (D-497); and the player's own notes.
6
6
  import { useEffect, useRef, useState } from "preact/hooks";
7
7
  import { sectionAddress } from "../address.js";
@@ -18,10 +18,11 @@ import { PageHead } from "../shell/pages.js";
18
18
  import { useChoice, useKeptText } from "../shell/prefs.js";
19
19
  import { PageTabs } from "../shell/tabs.js";
20
20
  import { arrowStep, t } from "../text.js";
21
+ import { Book } from "./book.js";
21
22
  import { Notes } from "./notes.js";
22
23
  // The tab the player last chose, kept in this browser.
23
- const tabChoice = { key: "rpg-engine.journal-tab", initial: "quests", values: ["quests", "story", "companions", "notes"] };
24
- /** The Journal: the tab the player last chose, or the one the address says, as #/journal/story, and a chapter in the story, as #/journal/story/3. */
24
+ const tabChoice = { key: "rpg-engine.journal-tab", initial: "quests", values: ["quests", "story", "timeline", "companions", "notes"] };
25
+ /** The Journal: the tab the player last chose, or the one the address says, as #/journal/story, and a chapter, of the book or of the timeline, as #/journal/story/3. */
25
26
  export function JournalView({ version, campaign, tab: asked, item }) {
26
27
  const journal = useJournal(version);
27
28
  const [chosen, setTab] = useChoice(tabChoice);
@@ -37,11 +38,11 @@ export function JournalView({ version, campaign, tab: asked, item }) {
37
38
  }, [asked]);
38
39
  // A chapter the address says, as the calendar's scenes lead to, brought into view once the story is read.
39
40
  useEffect(() => {
40
- const chapter = item === undefined || tab !== "story" ? null : document.querySelector(`.chapter[data-number="${CSS.escape(item)}"]`);
41
+ const chapter = item === undefined || tab !== "timeline" ? null : document.querySelector(`.chapter[data-number="${CSS.escape(item)}"]`);
41
42
  chapter?.scrollIntoView({ block: "center" });
42
43
  chapter?.focus({ preventScroll: true });
43
44
  }, [item, tab, journal.read !== undefined]);
44
- return (_jsxs("section", { class: "journal", "aria-labelledby": "journal-title", children: [_jsx(PageHead, { section: "journal", id: "journal-title" }), _jsx(PageTabs, { section: "journal", label: t("Journal"), chosen: tab, tabs: shown.map((key) => ({ key, name: tabName(key) })), onChoose: setTab }), _jsxs("div", { id: "journal-panel", role: "tabpanel", "aria-labelledby": `journal-tab-${tab}`, children: [journal.problem !== undefined && _jsx("p", { class: "journal-problem", role: "alert", children: journal.problem }), journal.read !== undefined && tab === "quests" && _jsx(QuestLog, { quests: journal.read.quests, followed: followed, onFollow: setFollowed }), journal.read !== undefined && tab === "story" && _jsx(Story, { chapters: journal.read.chapters, now: journal.read.now }), journal.read !== undefined && tab === "companions" && _jsx(Diaries, { thoughts: journal.read.thoughts ?? [] }), tab === "notes" && _jsx(Notes, { version: version }), journal.read === undefined && journal.problem === undefined && journal.done && tab !== "notes" && _jsx("p", { class: "journal-none", children: t("The journal starts with the player character.") })] }), _jsx(WidgetCards, { place: "page", page: "journal" })] }));
45
+ return (_jsxs("section", { class: "journal", "aria-labelledby": "journal-title", children: [_jsx(PageHead, { section: "journal", id: "journal-title" }), _jsx(PageTabs, { section: "journal", label: t("Journal"), chosen: tab, tabs: shown.map((key) => ({ key, name: tabName(key) })), onChoose: setTab }), _jsxs("div", { id: "journal-panel", role: "tabpanel", "aria-labelledby": `journal-tab-${tab}`, children: [journal.problem !== undefined && _jsx("p", { class: "journal-problem", role: "alert", children: journal.problem }), journal.read !== undefined && tab === "quests" && _jsx(QuestLog, { quests: journal.read.quests, followed: followed, onFollow: setFollowed }), journal.read !== undefined && tab === "story" && _jsx(Book, { chapters: journal.read.book ?? [], asked: item, campaign: campaign }), journal.read !== undefined && tab === "timeline" && _jsx(Timeline, { chapters: journal.read.chapters, now: journal.read.now }), journal.read !== undefined && tab === "companions" && _jsx(Diaries, { thoughts: journal.read.thoughts ?? [] }), tab === "notes" && _jsx(Notes, { version: version }), journal.read === undefined && journal.problem === undefined && journal.done && tab !== "notes" && _jsx("p", { class: "journal-none", children: t("The journal starts with the player character.") })] }), _jsx(WidgetCards, { place: "page", page: "journal" })] }));
45
46
  }
46
47
  /**
47
48
  * The quests the player follows (D-369), the main ones first, then the others, each group in the order they were followed. Beside the page one card, as a video
@@ -210,7 +211,7 @@ export function Deadline({ deadline }) {
210
211
  return (_jsxs("span", { class: near ? "quest-deadline near" : "quest-deadline", "data-tip": phraseLabel(byDateLabel(deadline.date)), children: [_jsx(Icon, { name: "hourglass" }), _jsxs("span", { children: [text, left && _jsx("span", { class: "quest-deadline-left", children: ` ${t("left")}` })] })] }));
211
212
  }
212
213
  /** The story by its scenes, the last first: each with its place and date, its summary, and what the diary tells of it, folded. */
213
- function Story({ chapters, now }) {
214
+ function Timeline({ chapters, now }) {
214
215
  if (chapters.length === 0) {
215
216
  return _jsx("p", { class: "journal-none", children: t("The story starts with the first scene.") });
216
217
  }
@@ -338,7 +339,7 @@ function plainText(text) {
338
339
  }
339
340
  /** A tab's name in the page's language. */
340
341
  function tabName(tab) {
341
- return tab === "quests" ? t("Quests") : tab === "story" ? t("Story") : tab === "companions" ? t("Companions") : t("Notes");
342
+ return tab === "quests" ? t("Quests") : tab === "story" ? t("Story") : tab === "timeline" ? t("Timeline") : tab === "companions" ? t("Companions") : t("Notes");
342
343
  }
343
344
  /** A chapter's key as the story grows, newest first: its number; a stretch between scenes by the chapter after it, so that what is open stays with it. */
344
345
  function chapterKey(chapters, index) {
@@ -230,6 +230,7 @@ export function settingLabel(name) {
230
230
  units: t("Units"),
231
231
  voices: t("Character voices"),
232
232
  pictures: t("Pictures"),
233
+ "pictures-by": t("Who makes them"),
233
234
  effort: t("Master's thinking"),
234
235
  lines: t("Lines"),
235
236
  veils: t("Veils"),
@@ -333,6 +334,11 @@ export function valueLabel(value) {
333
334
  stops: t("Stops"),
334
335
  "1d per 7d": t("A day a week"),
335
336
  "1d per 1d": t("Real time"),
337
+ chat: t("Your AI app"),
338
+ other: t("Another tool"),
339
+ // Names of programs, the same in every language.
340
+ codex: "Codex",
341
+ elevenlabs: "ElevenLabs",
336
342
  };
337
343
  return labels[value] ?? itemLabel(value);
338
344
  }
@@ -68,7 +68,7 @@ function Items({ items, field, fields }) {
68
68
  return (_jsx("ul", { class: [sentences ? "notes" : "chips", acting ? "acting" : ""].filter((name) => name !== "").join(" "), children: items.map((item) => {
69
69
  const label = itemLabel(item, fields);
70
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));
71
+ return (_jsxs("li", { children: [acting ? _jsx(ActName, { verbs: verbs, item: label, page: item, children: label }) : label, isChanged(item) && _jsx(ChangedMark, {})] }, item));
72
72
  }) }));
73
73
  }
74
74
  /** Someone's effects as tags, each with its end; past `most`, how many more. */