rpg-engine 0.4.1 → 0.5.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 (80) hide show
  1. package/README.md +1 -1
  2. package/dist/commands/ask.d.ts +37 -2
  3. package/dist/commands/ask.js +46 -17
  4. package/dist/commands/config.js +4 -2
  5. package/dist/commands/game-extension-list.js +12 -0
  6. package/dist/commands/game-extensions.d.ts +1 -1
  7. package/dist/commands/game-extensions.js +242 -17
  8. package/dist/commands/game-system-code.d.ts +9 -1
  9. package/dist/commands/game-system-code.js +27 -11
  10. package/dist/commands/game-widgets.d.ts +6 -1
  11. package/dist/commands/game-widgets.js +52 -4
  12. package/dist/commands/game-world.d.ts +15 -3
  13. package/dist/commands/game-world.js +45 -14
  14. package/dist/commands/package.d.ts +7 -1
  15. package/dist/commands/package.js +17 -2
  16. package/dist/commands/scene.d.ts +1 -1
  17. package/dist/commands/view.d.ts +4 -0
  18. package/dist/commands/view.js +5 -3
  19. package/dist/core/context.d.ts +19 -0
  20. package/dist/core/files.d.ts +2 -0
  21. package/dist/core/files.js +10 -1
  22. package/dist/core/registry.d.ts +2 -0
  23. package/dist/dashboard/api.js +11 -3
  24. package/dist/dashboard/app.js +88 -8
  25. package/dist/dashboard/ask-card.js +118 -0
  26. package/dist/dashboard/dice/tray.js +5 -3
  27. package/dist/dashboard/extension-widgets.js +35 -9
  28. package/dist/dashboard/faces.js +6 -4
  29. package/dist/dashboard/help.js +10 -3
  30. package/dist/dashboard/i18n/ar.json +9 -0
  31. package/dist/dashboard/i18n/cs.json +9 -0
  32. package/dist/dashboard/i18n/da.json +9 -0
  33. package/dist/dashboard/i18n/de.json +9 -0
  34. package/dist/dashboard/i18n/el.json +9 -0
  35. package/dist/dashboard/i18n/es.json +9 -0
  36. package/dist/dashboard/i18n/fi.json +9 -0
  37. package/dist/dashboard/i18n/fr.json +9 -0
  38. package/dist/dashboard/i18n/he.json +9 -0
  39. package/dist/dashboard/i18n/hi.json +9 -0
  40. package/dist/dashboard/i18n/hu.json +9 -0
  41. package/dist/dashboard/i18n/is.json +9 -0
  42. package/dist/dashboard/i18n/it.json +9 -0
  43. package/dist/dashboard/i18n/ja.json +9 -0
  44. package/dist/dashboard/i18n/ko.json +9 -0
  45. package/dist/dashboard/i18n/nb.json +9 -0
  46. package/dist/dashboard/i18n/nl.json +9 -0
  47. package/dist/dashboard/i18n/pl.json +9 -0
  48. package/dist/dashboard/i18n/pt.json +9 -0
  49. package/dist/dashboard/i18n/ro.json +9 -0
  50. package/dist/dashboard/i18n/ru.json +9 -0
  51. package/dist/dashboard/i18n/sv.json +9 -0
  52. package/dist/dashboard/i18n/tr.json +9 -0
  53. package/dist/dashboard/i18n/uk.json +9 -0
  54. package/dist/dashboard/i18n/zh.json +9 -0
  55. package/dist/dashboard/pack-card.js +92 -0
  56. package/dist/dashboard/packages.js +11 -4
  57. package/dist/dashboard/rolls.js +2 -2
  58. package/dist/dashboard/style.css +521 -3
  59. package/dist/dashboard-server.js +57 -1
  60. package/dist/extensions/api.d.ts +148 -17
  61. package/dist/extensions/extension.d.ts +10 -3
  62. package/dist/extensions/extension.js +16 -3
  63. package/dist/extensions/index.d.ts +3 -3
  64. package/dist/extensions/index.js +2 -2
  65. package/dist/extensions/packages.d.ts +8 -0
  66. package/dist/extensions/packages.js +48 -1
  67. package/dist/extensions/words.d.ts +2 -1
  68. package/dist/extensions/words.js +5 -4
  69. package/dist/index.d.ts +1 -1
  70. package/dist/mcp-server.js +1 -1
  71. package/dist/pages/index.d.ts +1 -1
  72. package/dist/pages/index.js +1 -1
  73. package/dist/pages/standard-fields.d.ts +2 -0
  74. package/dist/pages/standard-fields.js +8 -1
  75. package/dist/systems/game-system.d.ts +14 -9
  76. package/dist/systems/game-system.js +29 -19
  77. package/dist/systems/index.d.ts +1 -1
  78. package/dist/testing.d.ts +61 -0
  79. package/dist/testing.js +162 -0
  80. package/package.json +7 -2
@@ -315,6 +315,7 @@
315
315
  "Factions": "Фракции",
316
316
  "factions, threats and places with secrets, no main plot: you choose where to go": "фракции, угрозы и места с тайнами, без главного сюжета: ты сам выбираешь, куда идти",
317
317
  "Failed": "Проваленные",
318
+ "failed: {count}": "провалено: {count}",
318
319
  "Failure": "Провал",
319
320
  "Farm": "Ферма",
320
321
  "feet and miles": "футы и мили",
@@ -347,6 +348,7 @@
347
348
  "Game system": "Игровая система",
348
349
  "Game systems, extensions and languages come from npm: a file, a link or a folder can be added all the same.": "Игровые системы, расширения и языки берутся из npm, но файл, ссылку или папку всё равно можно добавить.",
349
350
  "GitHub does not answer.": "GitHub не отвечает.",
351
+ "GitHub is the site where RPG Engine is made: you write there with a free account, as in a forum, and anyone can read it.": "GitHub — это сайт, где создаётся RPG Engine: там ты пишешь с бесплатной учётной записью, как на форуме, и прочитать это может любой.",
350
352
  "github.com/someone/an-adventure": "github.com/someone/an-adventure",
351
353
  "Glass": "Стекло",
352
354
  "Go back": "Вернуться",
@@ -359,6 +361,7 @@
359
361
  "happy": "рад",
360
362
  "Hard": "Тяжёлая",
361
363
  "has code: asks your yes": "содержит код: нужно твоё согласие",
364
+ "held: {count}": "под вопросом: {count}",
362
365
  "Help": "Справка",
363
366
  "Here": "Здесь",
364
367
  "hidden": "скрыто",
@@ -611,6 +614,7 @@
611
614
  "Onyx": "Оникс",
612
615
  "Open": "Открыть",
613
616
  "Open a new chat with the master.": "Открой новый чат с мастером.",
617
+ "Open a report on GitHub": "Написать о проблеме на GitHub",
614
618
  "Open source, under the MIT licence.": "Открытый исходный код под лицензией MIT.",
615
619
  "Open the question": "Открыть вопрос",
616
620
  "Open the sheet": "Открыть лист персонажа",
@@ -673,6 +677,8 @@
673
677
  "Ready buttons": "Готовые кнопки",
674
678
  "Region": "Регион",
675
679
  "Regions and ways": "Регионы и пути",
680
+ "Report a problem": "Сообщить о проблеме",
681
+ "Report a problem with {name}": "Сообщить о проблеме с пакетом {name}",
676
682
  "reroll once {condition}": "перебросить один раз {condition}",
677
683
  "rest": "отдых",
678
684
  "Restore the cleared rolls": "Вернуть очищенные броски",
@@ -744,6 +750,7 @@
744
750
  "Someone": "Кто-то",
745
751
  "Someone else's": "Чужое",
746
752
  "Someone else's · {author}": "Чужое · {author}",
753
+ "Something doesn't work, confuses you or could be better? Tell us what you did, what you expected and what happened: every report helps.": "Что-то не работает, сбивает с толку или могло бы быть лучше? Расскажи, что было сделано, чего ты ждёшь и что произошло: каждое сообщение помогает.",
747
754
  "Sometimes": "Иногда",
748
755
  "somewhere": "где-то",
749
756
  "somewhere you do not know": "неизвестное тебе место",
@@ -790,6 +797,7 @@
790
797
  "Tales and events": "Предания и события",
791
798
  "Talk to {name}": "Поговорить с {name}",
792
799
  "Tell the master": "Сказать мастеру",
800
+ "Tell us": "Расскажи нам",
793
801
  "Temple": "Храм",
794
802
  "tense action, strong colours, each message ending on a threat or a hook": "напряжённое действие, яркие краски, каждое сообщение заканчивается угрозой или зацепкой",
795
803
  "Text, or PDFs whose text can be selected, read best; a scanned PDF is read from the pictures of its pages, on Windows only, in a few minutes.": "Лучше всего читаются текстовые файлы и PDF с выделяемым текстом; отсканированный PDF читается по изображениям страниц, только в Windows и за несколько минут.",
@@ -893,6 +901,7 @@
893
901
  "This computer is translating the page into {language}: until then it stays in English.": "Этот компьютер переводит страницу на язык «{language}», а пока она остаётся на английском.",
894
902
  "This page": "Эта страница",
895
903
  "This page could not be read now: try again in a moment.": "Сейчас эту страницу не прочесть: попробуй ещё раз чуть позже.",
904
+ "this roll: {count}": "в этом броске: {count}",
896
905
  "This turn": "Этот ход",
897
906
  "those you ask for": "только по твоей просьбе",
898
907
  "Time is up": "Время вышло",
@@ -315,6 +315,7 @@
315
315
  "Factions": "Fraktioner",
316
316
  "factions, threats and places with secrets, no main plot: you choose where to go": "fraktioner, hot och platser med hemligheter, ingen huvudintrig: du väljer vart du går",
317
317
  "Failed": "Misslyckade",
318
+ "failed: {count}": "misslyckade: {count}",
318
319
  "Failure": "Misslyckande",
319
320
  "Farm": "Gård",
320
321
  "feet and miles": "fot och engelska mil",
@@ -347,6 +348,7 @@
347
348
  "Game system": "Spelsystem",
348
349
  "Game systems, extensions and languages come from npm: a file, a link or a folder can be added all the same.": "Spelsystem, tillägg och språk kommer från npm: du kan ändå lägga till en fil, en länk eller en mapp.",
349
350
  "GitHub does not answer.": "GitHub svarar inte.",
351
+ "GitHub is the site where RPG Engine is made: you write there with a free account, as in a forum, and anyone can read it.": "GitHub är webbplatsen där RPG Engine görs: där skriver du med ett gratiskonto, som i ett forum, och alla kan läsa det.",
350
352
  "github.com/someone/an-adventure": "github.com/nagon/ett-aventyr",
351
353
  "Glass": "Glas",
352
354
  "Go back": "Gå tillbaka",
@@ -359,6 +361,7 @@
359
361
  "happy": "glad",
360
362
  "Hard": "Svår",
361
363
  "has code: asks your yes": "har kod: kräver ditt ja",
364
+ "held: {count}": "osäkra: {count}",
362
365
  "Help": "Hjälp",
363
366
  "Here": "Här",
364
367
  "hidden": "dold",
@@ -611,6 +614,7 @@
611
614
  "Onyx": "Onyx",
612
615
  "Open": "Öppna",
613
616
  "Open a new chat with the master.": "Öppna en ny chatt med spelledaren.",
617
+ "Open a report on GitHub": "Skapa en rapport på GitHub",
614
618
  "Open source, under the MIT licence.": "Öppen källkod under MIT-licensen.",
615
619
  "Open the question": "Öppna frågan",
616
620
  "Open the sheet": "Öppna rollformuläret",
@@ -673,6 +677,8 @@
673
677
  "Ready buttons": "Färdiga knappar",
674
678
  "Region": "Region",
675
679
  "Regions and ways": "Regioner och vägar",
680
+ "Report a problem": "Rapportera ett problem",
681
+ "Report a problem with {name}": "Rapportera ett problem med {name}",
676
682
  "reroll once {condition}": "slå om en gång {condition}",
677
683
  "rest": "vila",
678
684
  "Restore the cleared rolls": "Återställ rensade slag",
@@ -744,6 +750,7 @@
744
750
  "Someone": "Någon",
745
751
  "Someone else's": "Någon annans",
746
752
  "Someone else's · {author}": "Någon annans · {author}",
753
+ "Something doesn't work, confuses you or could be better? Tell us what you did, what you expected and what happened: every report helps.": "Fungerar något inte, förvirrar det dig eller kunde det vara bättre? Berätta vad du gjorde, vad du väntade dig och vad som hände: varje rapport hjälper.",
747
754
  "Sometimes": "Ibland",
748
755
  "somewhere": "någonstans",
749
756
  "somewhere you do not know": "någonstans du inte känner till",
@@ -790,6 +797,7 @@
790
797
  "Tales and events": "Sagor och händelser",
791
798
  "Talk to {name}": "Prata med {name}",
792
799
  "Tell the master": "Säg till spelledaren",
800
+ "Tell us": "Berätta för oss",
793
801
  "Temple": "Tempel",
794
802
  "tense action, strong colours, each message ending on a threat or a hook": "spänd action, starka färger, varje meddelande slutar med ett hot eller en krok",
795
803
  "Text, or PDFs whose text can be selected, read best; a scanned PDF is read from the pictures of its pages, on Windows only, in a few minutes.": "Text eller PDF-filer med markerbar text läses bäst; en skannad PDF läses från bilderna av sidorna, bara på Windows, på några minuter.",
@@ -893,6 +901,7 @@
893
901
  "This computer is translating the page into {language}: until then it stays in English.": "Den här datorn översätter sidan till {language}: tills dess förblir den på engelska.",
894
902
  "This page": "Den här sidan",
895
903
  "This page could not be read now: try again in a moment.": "Sidan kunde inte läsas just nu: försök igen om en stund.",
904
+ "this roll: {count}": "i det här slaget: {count}",
896
905
  "This turn": "Denna tur",
897
906
  "those you ask for": "de du ber om",
898
907
  "Time is up": "Tiden är ute",
@@ -315,6 +315,7 @@
315
315
  "Factions": "Hizipler",
316
316
  "factions, threats and places with secrets, no main plot: you choose where to go": "hizipler, tehditler ve sırlarla dolu yerler, ana olay örgüsü yok: nereye gideceğini sen seçersin",
317
317
  "Failed": "Başarısız",
318
+ "failed: {count}": "başarısız: {count}",
318
319
  "Failure": "Başarısızlık",
319
320
  "Farm": "Çiftlik",
320
321
  "feet and miles": "fit ve mil",
@@ -347,6 +348,7 @@
347
348
  "Game system": "Oyun sistemi",
348
349
  "Game systems, extensions and languages come from npm: a file, a link or a folder can be added all the same.": "Oyun sistemleri, eklentiler ve diller npm'den gelir; yine de dosya, bağlantı veya klasör eklenebilir.",
349
350
  "GitHub does not answer.": "GitHub yanıt vermiyor.",
351
+ "GitHub is the site where RPG Engine is made: you write there with a free account, as in a forum, and anyone can read it.": "GitHub, RPG Engine'in yapıldığı site: orada ücretsiz bir hesapla, bir forumdaki gibi yazarsın ve herkes okuyabilir.",
350
352
  "github.com/someone/an-adventure": "github.com/biri/bir-macera",
351
353
  "Glass": "Cam",
352
354
  "Go back": "Geri dön",
@@ -359,6 +361,7 @@
359
361
  "happy": "mutlu",
360
362
  "Hard": "Zor",
361
363
  "has code: asks your yes": "kod içerir: onayını ister",
364
+ "held: {count}": "belirsiz: {count}",
362
365
  "Help": "Yardım",
363
366
  "Here": "Burası",
364
367
  "hidden": "gizli",
@@ -611,6 +614,7 @@
611
614
  "Onyx": "Oniks",
612
615
  "Open": "Aç",
613
616
  "Open a new chat with the master.": "Oyun yöneticisiyle yeni bir sohbet aç.",
617
+ "Open a report on GitHub": "GitHub'da bildirim aç",
614
618
  "Open source, under the MIT licence.": "MIT lisansıyla açık kaynak.",
615
619
  "Open the question": "Soruyu aç",
616
620
  "Open the sheet": "Karakter kağıdını aç",
@@ -673,6 +677,8 @@
673
677
  "Ready buttons": "Hazır düğmeler",
674
678
  "Region": "Bölge",
675
679
  "Regions and ways": "Bölgeler ve yollar",
680
+ "Report a problem": "Sorun bildir",
681
+ "Report a problem with {name}": "{name} ile ilgili sorun bildir",
676
682
  "reroll once {condition}": "{condition} bir kez yeniden at",
677
683
  "rest": "dinlenme",
678
684
  "Restore the cleared rolls": "Temizlenen atışları geri getir",
@@ -744,6 +750,7 @@
744
750
  "Someone": "Biri",
745
751
  "Someone else's": "Başkasının",
746
752
  "Someone else's · {author}": "Başkasının · {author}",
753
+ "Something doesn't work, confuses you or could be better? Tell us what you did, what you expected and what happened: every report helps.": "Bir şey çalışmıyor mu, kafanı mı karıştırıyor ya da daha iyi olabilir mi? Ne yaptığını, ne beklediğini ve ne olduğunu anlat: her bildirim işe yarar.",
747
754
  "Sometimes": "Ara sıra",
748
755
  "somewhere": "bir yerde",
749
756
  "somewhere you do not know": "bilmediğin bir yer",
@@ -790,6 +797,7 @@
790
797
  "Tales and events": "Hikâyeler ve olaylar",
791
798
  "Talk to {name}": "{name} ile konuş",
792
799
  "Tell the master": "Oyun yöneticisine söyle",
800
+ "Tell us": "Bize anlat",
793
801
  "Temple": "Tapınak",
794
802
  "tense action, strong colours, each message ending on a threat or a hook": "gergin aksiyon, canlı renkler, her mesaj bir tehdit ya da merak uyandıran bir kancayla biter",
795
803
  "Text, or PDFs whose text can be selected, read best; a scanned PDF is read from the pictures of its pages, on Windows only, in a few minutes.": "En iyi metinler ve metni seçilebilen PDF'ler okunur; taranmış bir PDF sayfa görüntülerinden okunur, yalnızca Windows'ta ve birkaç dakikada.",
@@ -893,6 +901,7 @@
893
901
  "This computer is translating the page into {language}: until then it stays in English.": "Bu bilgisayar sayfayı {language} diline çeviriyor: o zamana kadar sayfa İngilizce kalır.",
894
902
  "This page": "Bu sayfa",
895
903
  "This page could not be read now: try again in a moment.": "Bu sayfa şu an okunamadı: birazdan tekrar dene.",
904
+ "this roll: {count}": "bu atışta: {count}",
896
905
  "This turn": "Bu tur",
897
906
  "those you ask for": "istediklerin",
898
907
  "Time is up": "Süre doldu",
@@ -315,6 +315,7 @@
315
315
  "Factions": "Фракції",
316
316
  "factions, threats and places with secrets, no main plot: you choose where to go": "фракції, загрози та місця з таємницями, без головного сюжету: ти сам обираєш, куди йти",
317
317
  "Failed": "Провалені",
318
+ "failed: {count}": "провалено: {count}",
318
319
  "Failure": "Невдача",
319
320
  "Farm": "Ферма",
320
321
  "feet and miles": "фути та милі",
@@ -347,6 +348,7 @@
347
348
  "Game system": "Система гри",
348
349
  "Game systems, extensions and languages come from npm: a file, a link or a folder can be added all the same.": "Системи гри, розширення та мови беруться з npm, але файл, посилання чи теку все одно можна додати.",
349
350
  "GitHub does not answer.": "GitHub не відповідає.",
351
+ "GitHub is the site where RPG Engine is made: you write there with a free account, as in a forum, and anyone can read it.": "GitHub — це сайт, де створюють RPG Engine: там ти пишеш із безкоштовним обліковим записом, як на форумі, і кожен може це прочитати.",
350
352
  "github.com/someone/an-adventure": "github.com/someone/an-adventure",
351
353
  "Glass": "Скло",
352
354
  "Go back": "Повернутися",
@@ -359,6 +361,7 @@
359
361
  "happy": "радісний",
360
362
  "Hard": "Важко",
361
363
  "has code: asks your yes": "має код: попросить твоєї згоди",
364
+ "held: {count}": "під питанням: {count}",
362
365
  "Help": "Довідка",
363
366
  "Here": "Тут",
364
367
  "hidden": "приховано",
@@ -611,6 +614,7 @@
611
614
  "Onyx": "Онікс",
612
615
  "Open": "Відкрити",
613
616
  "Open a new chat with the master.": "Відкрий новий чат із майстром.",
617
+ "Open a report on GitHub": "Написати про проблему на GitHub",
614
618
  "Open source, under the MIT licence.": "Відкритий код за ліцензією MIT.",
615
619
  "Open the question": "Відкрити питання",
616
620
  "Open the sheet": "Відкрити аркуш персонажа",
@@ -673,6 +677,8 @@
673
677
  "Ready buttons": "Готові кнопки",
674
678
  "Region": "Регіон",
675
679
  "Regions and ways": "Регіони та шляхи",
680
+ "Report a problem": "Повідомити про проблему",
681
+ "Report a problem with {name}": "Повідомити про проблему з пакетом {name}",
676
682
  "reroll once {condition}": "перекинути один раз {condition}",
677
683
  "rest": "відпочинок",
678
684
  "Restore the cleared rolls": "Відновити очищені кидки",
@@ -744,6 +750,7 @@
744
750
  "Someone": "Хтось",
745
751
  "Someone else's": "Чужий внесок",
746
752
  "Someone else's · {author}": "Чужий внесок · {author}",
753
+ "Something doesn't work, confuses you or could be better? Tell us what you did, what you expected and what happened: every report helps.": "Щось не працює, бентежить або могло б бути краще? Розкажи, що було зроблено, чого ти очікуєш і що сталося: кожне повідомлення допомагає.",
747
754
  "Sometimes": "Іноді",
748
755
  "somewhere": "десь",
749
756
  "somewhere you do not know": "місце, якого ти не знаєш",
@@ -790,6 +797,7 @@
790
797
  "Tales and events": "Історії та події",
791
798
  "Talk to {name}": "Говорити з {name}",
792
799
  "Tell the master": "Сказати майстру",
800
+ "Tell us": "Розкажи нам",
793
801
  "Temple": "Храм",
794
802
  "tense action, strong colours, each message ending on a threat or a hook": "напружена дія, яскраві барви, кожне повідомлення завершується загрозою або зачіпкою",
795
803
  "Text, or PDFs whose text can be selected, read best; a scanned PDF is read from the pictures of its pages, on Windows only, in a few minutes.": "Найкраще читаються текст або PDF із виділюваним текстом; скановані PDF читаються із зображень сторінок, лише у Windows, за кілька хвилин.",
@@ -893,6 +901,7 @@
893
901
  "This computer is translating the page into {language}: until then it stays in English.": "Цей комп'ютер перекладає сторінку мовою «{language}»: до того часу вона залишається англійською.",
894
902
  "This page": "Ця сторінка",
895
903
  "This page could not be read now: try again in a moment.": "Цю сторінку зараз не вдалося прочитати: спробуй ще раз за хвилину.",
904
+ "this roll: {count}": "у цьому кидку: {count}",
896
905
  "This turn": "Цей хід",
897
906
  "those you ask for": "ті, які попросиш",
898
907
  "Time is up": "Час вичерпано",
@@ -315,6 +315,7 @@
315
315
  "Factions": "势力",
316
316
  "factions, threats and places with secrets, no main plot: you choose where to go": "势力、威胁和藏有秘密的地点,没有主线:去哪里由你决定",
317
317
  "Failed": "已失败",
318
+ "failed: {count}": "失败:{count}",
318
319
  "Failure": "失败",
319
320
  "Farm": "农场",
320
321
  "feet and miles": "英尺和英里",
@@ -347,6 +348,7 @@
347
348
  "Game system": "游戏系统",
348
349
  "Game systems, extensions and languages come from npm: a file, a link or a folder can be added all the same.": "游戏系统、扩展和语言来自 npm;也可以通过文件、链接或文件夹添加。",
349
350
  "GitHub does not answer.": "GitHub 没有响应。",
351
+ "GitHub is the site where RPG Engine is made: you write there with a free account, as in a forum, and anyone can read it.": "GitHub 是制作 RPG Engine 的网站:用免费账号就能在上面发帖,就像在论坛里一样,任何人都能看到。",
350
352
  "github.com/someone/an-adventure": "github.com/someone/an-adventure",
351
353
  "Glass": "玻璃",
352
354
  "Go back": "回到存档",
@@ -359,6 +361,7 @@
359
361
  "happy": "开心",
360
362
  "Hard": "困难",
361
363
  "has code: asks your yes": "含代码:需要你确认",
364
+ "held: {count}": "待定:{count}",
362
365
  "Help": "帮助",
363
366
  "Here": "此处",
364
367
  "hidden": "隐藏",
@@ -611,6 +614,7 @@
611
614
  "Onyx": "缟玛瑙",
612
615
  "Open": "打开",
613
616
  "Open a new chat with the master.": "与主持人开启新的聊天。",
617
+ "Open a report on GitHub": "在 GitHub 上反馈",
614
618
  "Open source, under the MIT licence.": "采用 MIT 许可证开源。",
615
619
  "Open the question": "打开问题",
616
620
  "Open the sheet": "打开角色卡",
@@ -673,6 +677,8 @@
673
677
  "Ready buttons": "快捷按钮",
674
678
  "Region": "区域",
675
679
  "Regions and ways": "区域与路径",
680
+ "Report a problem": "反馈问题",
681
+ "Report a problem with {name}": "反馈 {name} 的问题",
676
682
  "reroll once {condition}": "{condition}时重掷一次",
677
683
  "rest": "休息",
678
684
  "Restore the cleared rolls": "恢复已清空的掷骰",
@@ -744,6 +750,7 @@
744
750
  "Someone": "某人",
745
751
  "Someone else's": "他人作品",
746
752
  "Someone else's · {author}": "他人作品 · {author}",
753
+ "Something doesn't work, confuses you or could be better? Tell us what you did, what you expected and what happened: every report helps.": "有什么不好用、让你困惑,或者可以做得更好?说说你做了什么、本来期望什么、实际发生了什么:每一条反馈都有帮助。",
747
754
  "Sometimes": "有时",
748
755
  "somewhere": "别处",
749
756
  "somewhere you do not know": "你不知道的地方",
@@ -790,6 +797,7 @@
790
797
  "Tales and events": "传说与事件",
791
798
  "Talk to {name}": "与{name}交谈",
792
799
  "Tell the master": "告诉主持人",
800
+ "Tell us": "告诉我们",
793
801
  "Temple": "神庙",
794
802
  "tense action, strong colours, each message ending on a threat or a hook": "动作紧张,色彩浓烈,每条消息都以威胁或悬念收尾",
795
803
  "Text, or PDFs whose text can be selected, read best; a scanned PDF is read from the pictures of its pages, on Windows only, in a few minutes.": "文本或可选中文字的 PDF 读取效果最好;扫描版 PDF 会根据页面图片读取,仅限 Windows,需要几分钟。",
@@ -893,6 +901,7 @@
893
901
  "This computer is translating the page into {language}: until then it stays in English.": "这台电脑正在将页面翻译成{language},在此之前仍显示英文。",
894
902
  "This page": "本页",
895
903
  "This page could not be read now: try again in a moment.": "现在无法读取此页,请稍后再试。",
904
+ "this roll: {count}": "本次掷骰:{count}",
896
905
  "This turn": "本回合",
897
906
  "those you ask for": "只生成你要求的",
898
907
  "Time is up": "时间到了",
@@ -0,0 +1,92 @@
1
+ /**
2
+ * The card after a reading of what the master asks: the question's card once its widget answered, the one before while it has not; the card a call left
3
+ * once over, unless the player let it go; the one before while the button pressed goes; else none, as when another question takes its place. `gone`: the
4
+ * attempts the player let go, each with the question they did it at.
5
+ */
6
+ export function nextPackCard(before, now, gone) {
7
+ const asked = now.asked ?? undefined;
8
+ if (asked !== undefined) {
9
+ const card = asked.card;
10
+ const kept = before?.key === card?.key ? before : undefined;
11
+ // Let go by the player at this very question, which the master has not taken back yet.
12
+ if (card === undefined || card.shows === undefined || (gone.has(card.key) && gone.get(card.key) === asked.id)) {
13
+ return card?.coming === true && kept !== undefined ? { card: kept } : {};
14
+ }
15
+ const sent = kept?.asked?.id === asked.id && kept.sent !== undefined ? { sent: kept.sent } : {};
16
+ return { card: { widget: card.widget, key: card.key, shows: card.shows, title: kept?.title ?? asked.question, asked, ...sent } };
17
+ }
18
+ const ended = now.card;
19
+ // The call over with nothing for its card to show, as a roll turned down before its first die: the card goes.
20
+ if (ended?.ended === true && ended.shows === undefined && before?.key === ended.key) {
21
+ return {};
22
+ }
23
+ if (ended?.ended === true && ended.shows !== undefined && !gone.has(ended.key)) {
24
+ const kept = before?.key === ended.key ? before : undefined;
25
+ const title = kept?.title === undefined ? {} : { title: kept.title };
26
+ return { card: { widget: ended.widget, key: ended.key, shows: ended.shows, ...title, ...(kept?.asked === undefined ? {} : { asked: kept.asked }), ended: true } };
27
+ }
28
+ // Its question gone with no button of it pressed, as answered in words or taken back by the master: the card goes, and what the call leaves stays away.
29
+ if (before !== undefined && before.ended !== true) {
30
+ return before.sent !== undefined ? { card: before } : { let: before.key };
31
+ }
32
+ return {};
33
+ }
34
+ /** Whether a question is asked in a package's card, coming or come, which shows in place of the banner and alone answers it (D-507). */
35
+ export function inCard(asked) {
36
+ return asked?.card !== undefined && (asked.card.shows !== undefined || asked.card.coming === true);
37
+ }
38
+ /** A widget's parts as a card lays them out: a count with no place in the middle, the facts in the place of the last count at the end, else the middle. */
39
+ export function cardLayout(shows) {
40
+ const layout = { places: { start: [], center: [], end: [] }, facts: [], texts: [], others: [] };
41
+ for (const part of shows.parts ?? []) {
42
+ if ("lead" in part) {
43
+ layout.lead ??= part;
44
+ }
45
+ else if ("track" in part) {
46
+ layout.places[part.track.stage ?? "center"].push(part.track);
47
+ }
48
+ else if ("facts" in part) {
49
+ layout.facts.push(...part.facts);
50
+ }
51
+ else if ("text" in part) {
52
+ layout.texts.push(part.text);
53
+ }
54
+ else {
55
+ layout.others.push(part);
56
+ }
57
+ }
58
+ return layout;
59
+ }
60
+ /** What changed on each count from one look of a card to the next, by its label: only the counts that changed. */
61
+ export function trackChanges(before, after) {
62
+ const changes = new Map();
63
+ const was = new Map(tracksOf(before).map((track) => [labelKey(track.label), track]));
64
+ for (const track of tracksOf(after)) {
65
+ const old = was.get(labelKey(track.label));
66
+ if (old === undefined) {
67
+ continue;
68
+ }
69
+ const [from, to] = [litOf(old), litOf(track)];
70
+ const marked = range(to, to + (track.marked ?? 0)).filter((index) => index < litOf(old) || index >= litOf(old) + (old.marked ?? 0));
71
+ const change = { lit: range(from, to), out: range(to, from).reverse(), marked };
72
+ if (change.lit.length + change.out.length + change.marked.length > 0) {
73
+ changes.set(labelKey(track.label), change);
74
+ }
75
+ }
76
+ return changes;
77
+ }
78
+ /** A count's label as a key, the same however its values are given. */
79
+ export function labelKey(label) {
80
+ return JSON.stringify(label);
81
+ }
82
+ /** The marks a count shows filled: those lit, then those held. */
83
+ function litOf(track) {
84
+ return track.value + (track.held ?? 0);
85
+ }
86
+ function tracksOf(shows) {
87
+ return (shows?.parts ?? []).flatMap((part) => ("track" in part ? [part.track] : []));
88
+ }
89
+ /** The whole numbers from one to the other, the last left out; none when the second is not past the first. */
90
+ function range(from, to) {
91
+ return Array.from({ length: Math.max(0, to - from) }, (_, index) => from + index);
92
+ }
@@ -374,7 +374,7 @@ function CatalogRow({ entry, named, view, state, onAdd, onUpdate }) {
374
374
  */
375
375
  function SystemRow({ system, newer, fresh, state, onUpdate, onUninstall }) {
376
376
  const target = system.package ?? system.name;
377
- return (_jsxs(PackageRow, { tile: "dice", tone: system.used ? undefined : "dim", name: _jsx("span", { class: "system-chip", children: system.name }), badges: _jsx(Trust, { verified: system.verified, code: system.code }), about: systemTitleLabel(system.title), meta: _jsx(VersionMeta, { version: system.version, newer: newer }), row: `system:${system.name}`, fresh: fresh, actions: _jsxs(_Fragment, { children: [newer !== undefined && _jsx(UpdateButton, { name: system.name, version: newer, busy: state.busy, onClick: () => onUpdate(target) }), system.used
377
+ return (_jsxs(PackageRow, { tile: "dice", tone: system.used ? undefined : "dim", name: _jsx("span", { class: "system-chip", children: system.name }), badges: _jsx(Trust, { verified: system.verified, code: system.code }), about: systemTitleLabel(system.title), meta: _jsxs(_Fragment, { children: [_jsx(VersionMeta, { version: system.version, newer: newer }), _jsx(ReportLink, { issues: system.issues, name: system.name, after: system.version !== undefined || newer !== undefined })] }), row: `system:${system.name}`, fresh: fresh, actions: _jsxs(_Fragment, { children: [newer !== undefined && _jsx(UpdateButton, { name: system.name, version: newer, busy: state.busy, onClick: () => onUpdate(target) }), system.used
378
378
  ? (_jsxs("span", { class: "package-lock", children: [_jsx(Icon, { name: "lock" }), t("In use · chosen in the setup")] }))
379
379
  : (_jsxs(_Fragment, { children: [_jsx("span", { class: "package-quiet", children: t("Not in this campaign") }), system.package !== undefined && _jsx(UninstallButton, { name: system.name, busy: state.busy, onClick: () => onUninstall(target) })] }))] }), children: [_jsx(WorkNote, { work: state.work }), _jsx(SaidNote, { said: state.said })] }));
380
380
  }
@@ -389,9 +389,9 @@ function AdventureRow({ adventure, fresh, state, onTakeOut }) {
389
389
  function ExtensionRow({ extension, newer, fresh, state, onUse, onUpdate, onUninstall }) {
390
390
  const name = phraseLabel(extension.name);
391
391
  if ("broken" in extension) {
392
- return (_jsxs(PackageRow, { tile: "alert", tone: "broken", name: name, about: _jsx("span", { class: "package-red", children: t("It does not read: install it again.") }), meta: _jsx("bdi", { class: "package-why", children: extension.broken }), actions: _jsxs(_Fragment, { children: [_jsxs("button", { type: "button", class: "button package-button", "aria-label": t("Install {name} again", { name }), "aria-disabled": state.busy, onClick: () => !state.busy && onUpdate(), children: [_jsx(Icon, { name: "update" }), t("Install it again")] }), _jsx(UninstallButton, { name: name, busy: state.busy, onClick: onUninstall })] }), children: [_jsx(WorkNote, { work: state.work }), _jsx(SaidNote, { said: state.said })] }));
392
+ return (_jsxs(PackageRow, { tile: "alert", tone: "broken", name: name, about: _jsx("span", { class: "package-red", children: t("It does not read: install it again.") }), meta: _jsxs(_Fragment, { children: [_jsx("bdi", { class: "package-why", children: extension.broken }), _jsx(ReportLink, { issues: extension.issues, name: name, after: true })] }), actions: _jsxs(_Fragment, { children: [_jsxs("button", { type: "button", class: "button package-button", "aria-label": t("Install {name} again", { name }), "aria-disabled": state.busy, onClick: () => !state.busy && onUpdate(), children: [_jsx(Icon, { name: "update" }), t("Install it again")] }), _jsx(UninstallButton, { name: name, busy: state.busy, onClick: onUninstall })] }), children: [_jsx(WorkNote, { work: state.work }), _jsx(SaidNote, { said: state.said })] }));
393
393
  }
394
- return (_jsxs(PackageRow, { tile: "packages", name: name, badges: _jsx(Trust, { verified: extension.verified, code: false }), about: `${phraseLabel(extension.about.replace(/\.$/, ""))}.`, meta: _jsx(VersionMeta, { version: extension.version, newer: newer }), row: `extension:${extension.package}`, fresh: fresh, actions: _jsxs(_Fragment, { children: [newer !== undefined && _jsx(UpdateButton, { name: name, version: newer, busy: state.busy, onClick: onUpdate }), _jsxs("label", { class: "package-use", children: [_jsx("input", { type: "checkbox", role: "switch", checked: extension.used, "aria-label": t("{name}: in use", { name }), "aria-disabled": state.busy, onClick: (event) => {
394
+ return (_jsxs(PackageRow, { tile: "packages", name: name, badges: _jsx(Trust, { verified: extension.verified, code: false }), about: `${phraseLabel(extension.about.replace(/\.$/, ""))}.`, meta: _jsxs(_Fragment, { children: [_jsx(VersionMeta, { version: extension.version, newer: newer }), _jsx(ReportLink, { issues: extension.issues, name: name, after: true })] }), row: `extension:${extension.package}`, fresh: fresh, actions: _jsxs(_Fragment, { children: [newer !== undefined && _jsx(UpdateButton, { name: name, version: newer, busy: state.busy, onClick: onUpdate }), _jsxs("label", { class: "package-use", children: [_jsx("input", { type: "checkbox", role: "switch", checked: extension.used, "aria-label": t("{name}: in use", { name }), "aria-disabled": state.busy, onClick: (event) => {
395
395
  event.preventDefault();
396
396
  if (!state.busy) {
397
397
  onUse(!extension.used);
@@ -407,7 +407,7 @@ function MissingRow({ name, state, onInstall }) {
407
407
  function LanguageRow({ language, newer, fresh, state, onUpdate, onUninstall }) {
408
408
  const page = pageLanguage().toLowerCase().split("-")[0] === language.code.toLowerCase().split("-")[0];
409
409
  const name = languageTitle(language);
410
- return (_jsxs(PackageRow, { tile: "language", name: name, badges: _jsx(Trust, { verified: language.verified, code: false }), meta: _jsxs(_Fragment, { children: [_jsx(VersionMeta, { version: language.version, newer: newer }), page && ` · ${t("the language of this page")}`] }), row: `language:${language.code}`, fresh: fresh, actions: _jsxs(_Fragment, { children: [newer !== undefined && _jsx(UpdateButton, { name: name, version: newer, busy: state.busy, onClick: onUpdate }), _jsx(UninstallButton, { name: name, busy: state.busy, onClick: onUninstall })] }), children: [_jsx(WorkNote, { work: state.work }), _jsx(SaidNote, { said: state.said })] }));
410
+ return (_jsxs(PackageRow, { tile: "language", name: name, badges: _jsx(Trust, { verified: language.verified, code: false }), meta: _jsxs(_Fragment, { children: [_jsx(VersionMeta, { version: language.version, newer: newer }), page && ` · ${t("the language of this page")}`, _jsx(ReportLink, { issues: language.issues, name: name, after: true })] }), row: `language:${language.code}`, fresh: fresh, actions: _jsxs(_Fragment, { children: [newer !== undefined && _jsx(UpdateButton, { name: name, version: newer, busy: state.busy, onClick: onUpdate }), _jsx(UninstallButton, { name: name, busy: state.busy, onClick: onUninstall })] }), children: [_jsx(WorkNote, { work: state.work }), _jsx(SaidNote, { said: state.said })] }));
411
411
  }
412
412
  /** A row of the page: the tile, the words, what can be done at the end; under them, the work going on and what happened. */
413
413
  function PackageRow({ tile, tone, name, badges, about, meta, actions, focusable, row, fresh, children }) {
@@ -428,6 +428,13 @@ function Trust({ verified, code, author }) {
428
428
  function VersionMeta({ version, newer }) {
429
429
  return (_jsxs(_Fragment, { children: [version, version !== undefined && newer !== undefined && " · ", newer !== undefined && (_jsxs("span", { class: "package-update", children: [_jsx(Icon, { name: "update" }), t("new {version}", { version: newer })] }))] }));
430
430
  }
431
+ /** Where the package's problems are reported, as its package.json says: after what its meta says before it, on a line of its own on a phone; nothing when it says nowhere. */
432
+ export function ReportLink({ issues, name, after }) {
433
+ if (issues === undefined) {
434
+ return null;
435
+ }
436
+ return (_jsxs(_Fragment, { children: [after && _jsx("span", { class: "package-report-gap", children: " · " }), _jsx("a", { class: "package-report", href: issues, target: "_blank", rel: "noreferrer", "aria-label": t("Report a problem with {name}", { name }), children: t("Report a problem") })] }));
437
+ }
431
438
  /** Update, for a row npm has a newer version of. */
432
439
  function UpdateButton({ name, version, busy, onClick }) {
433
440
  return (_jsxs("button", { type: "button", class: "button package-button accent", "aria-label": t("Update {name} to {version}", { name, version }), "aria-disabled": busy, onClick: () => !busy && onClick(), children: [_jsx(Icon, { name: "update" }), t("Update")] }));
@@ -52,7 +52,7 @@ export function RollLog({ rolls, free, unread, campaign, party, several = false,
52
52
  onMore();
53
53
  }
54
54
  };
55
- return (_jsx("aside", { class: "rolls", "aria-labelledby": "rolls-title", children: _jsxs("details", { class: "rolls-card", open: open, children: [_jsx(CardHeader, { icon: cardIcons.rolls, title: _jsx("h2", { id: "rolls-title", class: "rolls-title", children: t("Rolls") }), preview: newest === undefined ? undefined : `${[nameOf(newest, of), newest.check].filter((part) => part !== undefined && part !== "").join(" · ")} · ${newest.total}`, open: open, onToggle: toggle }), _jsx("div", { class: "rolls-tools folding", children: (listed.shown.length > 0 || listed.more) && (_jsx("button", { type: "button", class: "icon-button tip-left", "aria-label": t("Clear the rolls"), "data-tip": t("Clear the list"), onClick: clear, children: _jsx(Icon, { name: "clearAll" }) })) }), _jsxs("div", { class: "roll-frame", children: [_jsxs("div", { class: "roll-scroll", ref: setScroller, children: [listed.shown.length === 0
55
+ return (_jsx("aside", { class: "rolls", "aria-labelledby": "rolls-title", children: _jsxs("details", { class: "rolls-card", open: open, children: [_jsx(CardHeader, { icon: cardIcons.rolls, title: _jsx("h2", { id: "rolls-title", class: "rolls-title", children: t("Rolls") }), preview: newest === undefined ? undefined : `${[nameOf(newest, of), newest.check].filter((part) => part !== undefined && part !== "").join(" · ")} · ${newest.says ?? newest.total}`, open: open, onToggle: toggle }), _jsx("div", { class: "rolls-tools folding", children: (listed.shown.length > 0 || listed.more) && (_jsx("button", { type: "button", class: "icon-button tip-left", "aria-label": t("Clear the rolls"), "data-tip": t("Clear the list"), onClick: clear, children: _jsx(Icon, { name: "clearAll" }) })) }), _jsxs("div", { class: "roll-frame", children: [_jsxs("div", { class: "roll-scroll", ref: setScroller, children: [listed.shown.length === 0
56
56
  ? _jsx("p", { class: "rolls-none", children: emptyText(rolls.length, listed.before) })
57
57
  : (_jsx("ol", { class: "roll-list", children: [...listed.shown].reverse().map((roll) => (_jsx(RollRow, { roll: roll, name: nameOf(roll, of), token: tokenOf(roll, party, of), fresh: fresh.has(roll.id), greeted: greeted.current, several: several }, roll.id))) })), listed.more
58
58
  ? _jsx("button", { type: "button", class: "rolls-more", onClick: loadMore, children: t("Load more") })
@@ -84,7 +84,7 @@ function RollRow({ roll, name, token, fresh, greeted, several }) {
84
84
  ? _jsx("img", { class: "roll-robot", src: "/assets/favicon.svg", alt: "" })
85
85
  : token === "die"
86
86
  ? (_jsx("span", { class: "token roll-die", "aria-hidden": "true", children: _jsx(Icon, { name: "dice" }) }))
87
- : _jsx(Token, { member: token }), _jsxs("span", { class: "roll-who", children: [_jsx("span", { class: "visually-hidden", children: `${marked ? t("New.") + " " : ""}${free ? t("Your free roll, not logged:") : player ? (several ? t("The players' roll:") : t("Your roll:")) : t("The master's roll:")} ` }), name] }), roll.check && _jsx("span", { class: "roll-check", children: roll.check }), _jsx("span", { class: "roll-total num", children: roll.total }), _jsxs("span", { class: "roll-dice", children: [_jsx(DiceFaces, { dice: roll.dice, modifier: notationModifier(roll.notation) }), _jsx("span", { class: "visually-hidden", children: roll.text })] })] }));
87
+ : _jsx(Token, { member: token }), _jsxs("span", { class: "roll-who", children: [_jsx("span", { class: "visually-hidden", children: `${marked ? t("New.") + " " : ""}${free ? t("Your free roll, not logged:") : player ? (several ? t("The players' roll:") : t("Your roll:")) : t("The master's roll:")} ` }), name] }), roll.check && _jsx("span", { class: "roll-check", children: roll.check }), roll.says === undefined ? _jsx("span", { class: "roll-total num", children: roll.total }) : _jsx("span", { class: "roll-total roll-says", children: roll.says }), _jsxs("span", { class: "roll-dice", children: [_jsx(DiceFaces, { dice: roll.dice, modifier: notationModifier(roll.notation), tones: roll.tones }), _jsx("span", { class: "visually-hidden", children: roll.text })] })] }));
88
88
  }
89
89
  /** What the list says with no roll in it: what comes there, that the last half hour had none, or that the player cleared it. */
90
90
  function emptyText(read, older) {