rpg-engine 0.14.0 → 0.14.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/dist/dashboard/choices.js +22 -17
- package/dist/dashboard/guide/ar.md +7 -5
- package/dist/dashboard/guide/cs.md +7 -5
- package/dist/dashboard/guide/da.md +7 -5
- package/dist/dashboard/guide/de.md +7 -5
- package/dist/dashboard/guide/el.md +7 -5
- package/dist/dashboard/guide/en.md +6 -4
- package/dist/dashboard/guide/es.md +7 -5
- package/dist/dashboard/guide/fi.md +7 -5
- package/dist/dashboard/guide/fr.md +7 -5
- package/dist/dashboard/guide/he.md +7 -5
- package/dist/dashboard/guide/hi.md +7 -5
- package/dist/dashboard/guide/hu.md +7 -5
- package/dist/dashboard/guide/is.md +7 -5
- package/dist/dashboard/guide/it.md +7 -5
- package/dist/dashboard/guide/ja.md +7 -5
- package/dist/dashboard/guide/ko.md +8 -6
- package/dist/dashboard/guide/nb.md +7 -5
- package/dist/dashboard/guide/nl.md +7 -5
- package/dist/dashboard/guide/pl.md +7 -5
- package/dist/dashboard/guide/pt.md +7 -5
- package/dist/dashboard/guide/ro.md +7 -5
- package/dist/dashboard/guide/ru.md +7 -5
- package/dist/dashboard/guide/sv.md +7 -5
- package/dist/dashboard/guide/tr.md +7 -5
- package/dist/dashboard/guide/uk.md +8 -6
- package/dist/dashboard/guide/zh.md +7 -5
- package/dist/dashboard/i18n/ar.json +1 -0
- package/dist/dashboard/i18n/cs.json +1 -0
- package/dist/dashboard/i18n/da.json +1 -0
- package/dist/dashboard/i18n/de.json +1 -0
- package/dist/dashboard/i18n/el.json +1 -0
- package/dist/dashboard/i18n/es.json +1 -0
- package/dist/dashboard/i18n/fi.json +1 -0
- package/dist/dashboard/i18n/fr.json +1 -0
- package/dist/dashboard/i18n/he.json +1 -0
- package/dist/dashboard/i18n/hi.json +1 -0
- package/dist/dashboard/i18n/hu.json +1 -0
- package/dist/dashboard/i18n/is.json +1 -0
- package/dist/dashboard/i18n/it.json +1 -0
- package/dist/dashboard/i18n/ja.json +1 -0
- package/dist/dashboard/i18n/ko.json +1 -0
- package/dist/dashboard/i18n/nb.json +1 -0
- package/dist/dashboard/i18n/nl.json +1 -0
- package/dist/dashboard/i18n/pl.json +1 -0
- package/dist/dashboard/i18n/pt.json +1 -0
- package/dist/dashboard/i18n/ro.json +1 -0
- package/dist/dashboard/i18n/ru.json +1 -0
- package/dist/dashboard/i18n/sv.json +1 -0
- package/dist/dashboard/i18n/tr.json +1 -0
- package/dist/dashboard/i18n/uk.json +1 -0
- package/dist/dashboard/i18n/zh.json +1 -0
- package/dist/dashboard/style.css +15 -5
- package/dist/server/dashboard/choices.d.ts +8 -5
- package/dist/server/dashboard/choices.js +6 -4
- package/package.json +1 -1
|
@@ -991,6 +991,7 @@
|
|
|
991
991
|
"The page stays in English: Codex or Claude Code would translate it into {language} on this computer.": "Sayfa İngilizce kalır: Codex veya Claude Code bu bilgisayarda sayfayı {language} diline çevirebilir.",
|
|
992
992
|
"The page's": "Sayfanın",
|
|
993
993
|
"the page's look": "sayfanın görünümü",
|
|
994
|
+
"The pages this option names": "Bu seçeneğin adını verdiği sayfalar",
|
|
994
995
|
"The party is in no place the character knows, as on a road between two.": "Grup, karakterin bildiği hiçbir yerde değil; örneğin iki yer arasındaki bir yolda.",
|
|
995
996
|
"the pictures of places, quests and those you meet, made on this computer": "yerlerin, görevlerin ve tanıştıklarının bu bilgisayarda oluşturulan görselleri",
|
|
996
997
|
"the pictures on your coins, heads first": "madeni paralarındaki resimler, önce yazı değil tura tarafı",
|
|
@@ -991,6 +991,7 @@
|
|
|
991
991
|
"The page stays in English: Codex or Claude Code would translate it into {language} on this computer.": "Сторінка залишається англійською: Codex або Claude Code могли б перекласти її мовою «{language}» на цьому комп'ютері.",
|
|
992
992
|
"The page's": "Сторінки",
|
|
993
993
|
"the page's look": "вигляд сторінки",
|
|
994
|
+
"The pages this option names": "Сторінки, на які посилається цей параметр",
|
|
994
995
|
"The party is in no place the character knows, as on a road between two.": "Загін не в жодному місці, яке знає персонаж, як-от на дорозі між двома.",
|
|
995
996
|
"the pictures of places, quests and those you meet, made on this computer": "зображення місць, завдань та зустрінутих персонажів, створені на цьому комп’ютері",
|
|
996
997
|
"the pictures on your coins, heads first": "зображення на твоїх монетах, спочатку аверс",
|
|
@@ -991,6 +991,7 @@
|
|
|
991
991
|
"The page stays in English: Codex or Claude Code would translate it into {language} on this computer.": "页面仍显示英文:可由这台电脑上的 Codex 或 Claude Code 将其翻译成{language}。",
|
|
992
992
|
"The page's": "页面的",
|
|
993
993
|
"the page's look": "页面外观",
|
|
994
|
+
"The pages this option names": "此选项所指的页面",
|
|
994
995
|
"The party is in no place the character knows, as on a road between two.": "队伍不在角色所知的任何地点,比如在两地之间的路上。",
|
|
995
996
|
"the pictures of places, quests and those you meet, made on this computer": "在这台电脑上生成的地点、任务和所遇之人的图片",
|
|
996
997
|
"the pictures on your coins, heads first": "硬币上的图案,先正面后反面",
|
package/dist/dashboard/style.css
CHANGED
|
@@ -378,7 +378,7 @@
|
|
|
378
378
|
outline-offset: 0 !important;
|
|
379
379
|
}
|
|
380
380
|
|
|
381
|
-
.filter-chips button:focus-visible,
|
|
381
|
+
.filter-chips :is(button, a):focus-visible,
|
|
382
382
|
.package-show:focus-visible,
|
|
383
383
|
.package-row:focus-visible {
|
|
384
384
|
outline: 2px solid var(--accent) !important;
|
|
@@ -2064,7 +2064,7 @@
|
|
|
2064
2064
|
margin: 6px 0 4px;
|
|
2065
2065
|
}
|
|
2066
2066
|
|
|
2067
|
-
.filter-chips button {
|
|
2067
|
+
.filter-chips :is(button, a) {
|
|
2068
2068
|
display: inline-flex;
|
|
2069
2069
|
align-items: center;
|
|
2070
2070
|
gap: 6px;
|
|
@@ -2080,18 +2080,18 @@
|
|
|
2080
2080
|
cursor: pointer;
|
|
2081
2081
|
}
|
|
2082
2082
|
|
|
2083
|
-
.filter-chips button:hover {
|
|
2083
|
+
.filter-chips :is(button, a):hover {
|
|
2084
2084
|
background: color-mix(in srgb, var(--ink) 5%, transparent);
|
|
2085
2085
|
}
|
|
2086
2086
|
|
|
2087
|
-
.filter-chips button[aria-pressed="true"] {
|
|
2087
|
+
.filter-chips :is(button[aria-pressed="true"], a[aria-current="page"]) {
|
|
2088
2088
|
border-color: var(--accent);
|
|
2089
2089
|
background: color-mix(in srgb, var(--accent) 14%, transparent);
|
|
2090
2090
|
}
|
|
2091
2091
|
|
|
2092
2092
|
/* A finger needs the room of a target, after the chip's own height. */
|
|
2093
2093
|
@media (pointer: coarse) {
|
|
2094
|
-
.filter-chips button {
|
|
2094
|
+
.filter-chips :is(button, a) {
|
|
2095
2095
|
min-height: var(--target);
|
|
2096
2096
|
}
|
|
2097
2097
|
}
|
|
@@ -15304,6 +15304,16 @@
|
|
|
15304
15304
|
justify-content: space-between;
|
|
15305
15305
|
}
|
|
15306
15306
|
|
|
15307
|
+
/* The other pages an option names, each a chip that opens it in the reader. */
|
|
15308
|
+
.choices-pages {
|
|
15309
|
+
margin: 0;
|
|
15310
|
+
padding: 2px 16px 8px;
|
|
15311
|
+
}
|
|
15312
|
+
|
|
15313
|
+
.choices-pages a {
|
|
15314
|
+
text-decoration: none;
|
|
15315
|
+
}
|
|
15316
|
+
|
|
15307
15317
|
.choice-picked {
|
|
15308
15318
|
display: inline-flex;
|
|
15309
15319
|
align-items: center;
|
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
import type { IncomingMessage, ServerResponse } from "node:http";
|
|
2
2
|
import type { Served } from "./index.ts";
|
|
3
|
-
/** An option as the page shows it: the master's words, its label without dice, its dice when it is a roll, the
|
|
3
|
+
/** An option as the page shows it: the master's words, its label without dice, its dice when it is a roll, the pages it names with their titles and first sentences. */
|
|
4
4
|
export interface ShownOption {
|
|
5
5
|
text: string;
|
|
6
6
|
label: string;
|
|
7
7
|
notation?: string;
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
pages?: OptionPage[];
|
|
9
|
+
}
|
|
10
|
+
/** A page an option names: its name, its title in the campaign's language, its first sentence as the character may read it. */
|
|
11
|
+
export interface OptionPage {
|
|
12
|
+
name: string;
|
|
13
|
+
title: string;
|
|
14
|
+
opening: string;
|
|
12
15
|
}
|
|
13
16
|
/** A set of choices as the page shows it. */
|
|
14
17
|
export interface ShownChoices {
|
|
@@ -87,14 +87,16 @@ function shownChoices(root, served) {
|
|
|
87
87
|
}
|
|
88
88
|
function shownOption(world, knowledge, option) {
|
|
89
89
|
const parts = optionParts(option);
|
|
90
|
-
const
|
|
91
|
-
const
|
|
92
|
-
|
|
90
|
+
const found = parts.pages.map((name) => findPage(world, name)).filter((page) => page !== undefined);
|
|
91
|
+
const pages = found.filter((page, index) => found.findIndex((other) => other.name === page.name) === index).map((page) => {
|
|
92
|
+
const introduction = knowledge === undefined ? withoutComments(introductionText(page.translated ?? page.body)) : knownIntroduction(world, knowledge, page);
|
|
93
|
+
return { name: page.name, title: page.title ?? page.name, opening: firstSentence(linkWords(world, introduction).replace(/\s+/g, " ").trim()) };
|
|
94
|
+
});
|
|
93
95
|
return {
|
|
94
96
|
text: option,
|
|
95
97
|
label: linkWords(world, parts.label).trim(),
|
|
96
98
|
...(parts.notation === undefined ? {} : { notation: parts.notation }),
|
|
97
|
-
...(
|
|
99
|
+
...(pages.length === 0 ? {} : { pages }),
|
|
98
100
|
};
|
|
99
101
|
}
|
|
100
102
|
/** A text's links as their words; one without words as its page's name in the campaign's language, a system page's title (D-542). */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rpg-engine",
|
|
3
|
-
"version": "0.14.
|
|
3
|
+
"version": "0.14.1",
|
|
4
4
|
"description": "Play a tabletop role-playing game with an AI as your game master: the AI tells the story; RPG Engine remembers the world, rolls the dice and keeps the accounts.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|