rpg-engine 0.22.0 → 0.24.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.
- package/README.md +5 -5
- package/dist/campaign/create-campaign.d.ts +6 -1
- package/dist/campaign/create-campaign.js +41 -13
- package/dist/campaign/find-campaign.d.ts +5 -0
- package/dist/campaign/find-campaign.js +20 -5
- package/dist/campaign/host-files.d.ts +14 -4
- package/dist/campaign/host-files.js +193 -36
- package/dist/campaign/index.d.ts +2 -2
- package/dist/campaign/index.js +2 -2
- package/dist/campaign/settings.d.ts +3 -3
- package/dist/campaign/settings.js +5 -4
- package/dist/cli/cli.js +28 -7
- package/dist/commands/config/config.js +1 -1
- package/dist/commands/config/dashboard.js +28 -6
- package/dist/commands/config/words.js +2 -1
- package/dist/commands/image.d.ts +3 -0
- package/dist/commands/image.js +32 -5
- package/dist/commands/import/import.d.ts +3 -1
- package/dist/commands/import/import.js +16 -3
- package/dist/commands/init.d.ts +2 -0
- package/dist/commands/init.js +21 -3
- package/dist/commands/instructions.js +1 -1
- package/dist/commands/shared/campaign/git.js +1 -1
- package/dist/commands/shared/campaign/images.js +6 -3
- package/dist/commands/shared/campaign/mode.js +1 -1
- package/dist/commands/shared/characters/voices.d.ts +2 -2
- package/dist/commands/shared/characters/voices.js +9 -6
- package/dist/commands/shared/sheet/sheet.d.ts +2 -2
- package/dist/commands/shared/sheet/sheet.js +3 -3
- package/dist/core/context.d.ts +21 -6
- package/dist/core/context.js +2 -1
- package/dist/dashboard/acts/acts.js +39 -11
- package/dist/dashboard/acts/head.js +7 -0
- package/dist/dashboard/acts/names.js +4 -2
- package/dist/dashboard/acts/sending.js +23 -22
- package/dist/dashboard/acts/sheet.js +7 -149
- package/dist/dashboard/acts/strip.js +10 -14
- package/dist/dashboard/acts/talk.js +51 -0
- package/dist/dashboard/acts/thing.js +169 -0
- package/dist/dashboard/app.js +3 -3
- package/dist/dashboard/guide/ar.md +17 -14
- package/dist/dashboard/guide/cs.md +15 -12
- package/dist/dashboard/guide/da.md +15 -12
- package/dist/dashboard/guide/de.md +14 -11
- package/dist/dashboard/guide/el.md +14 -11
- package/dist/dashboard/guide/en.md +13 -10
- package/dist/dashboard/guide/es.md +14 -11
- package/dist/dashboard/guide/fi.md +14 -11
- package/dist/dashboard/guide/fr.md +14 -11
- package/dist/dashboard/guide/he.md +14 -11
- package/dist/dashboard/guide/hi.md +14 -11
- package/dist/dashboard/guide/hu.md +14 -11
- package/dist/dashboard/guide/is.md +14 -11
- package/dist/dashboard/guide/it.md +57 -54
- package/dist/dashboard/guide/ja.md +14 -11
- package/dist/dashboard/guide/ko.md +15 -12
- package/dist/dashboard/guide/nb.md +14 -11
- package/dist/dashboard/guide/nl.md +16 -13
- package/dist/dashboard/guide/pl.md +14 -11
- package/dist/dashboard/guide/pt.md +14 -11
- package/dist/dashboard/guide/ro.md +15 -12
- package/dist/dashboard/guide/ru.md +14 -11
- package/dist/dashboard/guide/sv.md +15 -12
- package/dist/dashboard/guide/tr.md +15 -12
- package/dist/dashboard/guide/uk.md +15 -12
- package/dist/dashboard/guide/zh.md +15 -12
- package/dist/dashboard/i18n/ar.json +28 -11
- package/dist/dashboard/i18n/cs.json +28 -11
- package/dist/dashboard/i18n/da.json +28 -11
- package/dist/dashboard/i18n/de.json +28 -11
- package/dist/dashboard/i18n/el.json +28 -11
- package/dist/dashboard/i18n/es.json +28 -11
- package/dist/dashboard/i18n/fi.json +28 -11
- package/dist/dashboard/i18n/fr.json +28 -11
- package/dist/dashboard/i18n/he.json +28 -11
- package/dist/dashboard/i18n/hi.json +28 -11
- package/dist/dashboard/i18n/hu.json +28 -11
- package/dist/dashboard/i18n/is.json +28 -11
- package/dist/dashboard/i18n/it.json +104 -87
- package/dist/dashboard/i18n/ja.json +28 -11
- package/dist/dashboard/i18n/ko.json +28 -11
- package/dist/dashboard/i18n/nb.json +28 -11
- package/dist/dashboard/i18n/nl.json +28 -11
- package/dist/dashboard/i18n/pl.json +28 -11
- package/dist/dashboard/i18n/pt.json +28 -11
- package/dist/dashboard/i18n/ro.json +28 -11
- package/dist/dashboard/i18n/ru.json +28 -11
- package/dist/dashboard/i18n/sv.json +28 -11
- package/dist/dashboard/i18n/tr.json +28 -11
- package/dist/dashboard/i18n/uk.json +28 -11
- package/dist/dashboard/i18n/zh.json +28 -11
- package/dist/dashboard/packages/packages.js +1 -1
- package/dist/dashboard/parts/icons.js +2 -0
- package/dist/dashboard/parts/labels.js +2 -1
- package/dist/dashboard/parts/layout.js +34 -0
- package/dist/dashboard/parts/widgets.js +6 -2
- package/dist/dashboard/settings/language-choice.js +1 -1
- package/dist/dashboard/settings/settings.js +73 -39
- package/dist/dashboard/settings/tabs.js +14 -0
- package/dist/dashboard/sheet/sheet.js +54 -33
- package/dist/dashboard/shell/notices.js +2 -2
- package/dist/dashboard/style.css +135 -52
- package/dist/helpers/antigravity.d.ts +47 -0
- package/dist/helpers/antigravity.js +434 -0
- package/dist/helpers/briefs.d.ts +4 -0
- package/dist/helpers/briefs.js +13 -0
- package/dist/helpers/chosen.d.ts +15 -7
- package/dist/helpers/chosen.js +96 -45
- package/dist/helpers/index.d.ts +4 -2
- package/dist/helpers/index.js +6 -3
- package/dist/helpers/opencode.d.ts +13 -0
- package/dist/helpers/opencode.js +295 -0
- package/dist/helpers/programs.d.ts +8 -0
- package/dist/helpers/programs.js +35 -2
- package/dist/helpers/stop.d.ts +2 -0
- package/dist/helpers/stop.js +20 -1
- package/dist/helpers/svg.d.ts +4 -1
- package/dist/helpers/svg.js +16 -4
- package/dist/instructions/index.d.ts +4 -2
- package/dist/instructions/index.js +6 -3
- package/dist/server/approver.d.ts +4 -2
- package/dist/server/approver.js +27 -7
- package/dist/server/bell/antigravity.d.ts +15 -0
- package/dist/server/bell/antigravity.js +113 -0
- package/dist/server/bell/index.d.ts +2 -0
- package/dist/server/bell/index.js +2 -0
- package/dist/server/bell/listener.d.ts +43 -0
- package/dist/server/bell/listener.js +154 -0
- package/dist/server/dashboard/index.d.ts +10 -1
- package/dist/server/dashboard/index.js +6 -1
- package/dist/server/dashboard/news.d.ts +3 -1
- package/dist/server/dashboard/news.js +64 -10
- package/dist/server/fence.d.ts +21 -0
- package/dist/server/fence.js +69 -0
- package/dist/server/mcp.d.ts +3 -2
- package/dist/server/mcp.js +37 -7
- package/dist/server/player-acts.d.ts +21 -1
- package/dist/server/player-acts.js +39 -3
- package/dist/server/route/front.d.ts +3 -0
- package/dist/server/route/front.js +97 -0
- package/dist/server/route/index.d.ts +3 -0
- package/dist/server/route/index.js +3 -0
- package/dist/server/route/notes.d.ts +8 -0
- package/dist/server/route/notes.js +50 -0
- package/dist/server/route/router.d.ts +31 -0
- package/dist/server/route/router.js +215 -0
- package/dist/server/subagent.d.ts +4 -0
- package/dist/server/subagent.js +30 -0
- package/instructions/start.md +1 -1
- package/instructions/voices-antigravity.md +1 -0
- package/instructions/voices-codex.md +1 -0
- package/instructions/voices-opencode.md +1 -0
- package/package.json +3 -2
- package/plugins/opencode.js +174 -0
- package/dist/server/bell-listener.d.ts +0 -10
- package/dist/server/bell-listener.js +0 -52
package/dist/core/context.js
CHANGED
|
@@ -18,6 +18,7 @@ export function defaultContext(folder = process.cwd()) {
|
|
|
18
18
|
extensionFolders: [join(packagesFolder(), "node_modules")],
|
|
19
19
|
unpacked: join(packagesFolder(), "unpacked"),
|
|
20
20
|
home: userDataFolder(),
|
|
21
|
+
userHome: homedir(),
|
|
21
22
|
bookIndex: join(dirname(packagesFolder()), "library"),
|
|
22
23
|
// The built page is in dist/dashboard, two levels up from src/core/ and from dist/core/ alike.
|
|
23
24
|
pageFolder: fileURLToPath(new URL("../../dist/dashboard/", import.meta.url)),
|
|
@@ -36,7 +37,7 @@ export function packagesFolder() {
|
|
|
36
37
|
: join(process.env.XDG_DATA_HOME || join(home, ".local", "share"), "rpg-engine", "packages");
|
|
37
38
|
}
|
|
38
39
|
/** Where this player's data is kept on this computer (D-406): the folder the system gives a program's data. */
|
|
39
|
-
function userDataFolder() {
|
|
40
|
+
export function userDataFolder() {
|
|
40
41
|
const home = homedir();
|
|
41
42
|
if (process.platform === "win32") {
|
|
42
43
|
return join(process.env.APPDATA || join(home, "AppData", "Roaming"), "rpg-engine");
|
|
@@ -101,6 +101,36 @@ export function itemVerbs(actions, item) {
|
|
|
101
101
|
}
|
|
102
102
|
return (item.equipped === true ? actions?.equipped : undefined) ?? actions?.inventory;
|
|
103
103
|
}
|
|
104
|
+
/**
|
|
105
|
+
* The verbs of each thing of a sheet, by its page's name in any case (D-581 (D)): those every place of the sheet gives it, its lines by itemVerbs and the items
|
|
106
|
+
* of the lists the system names, in the order they first come in the groups, without repeats; the same verbs wherever the thing is clicked.
|
|
107
|
+
*/
|
|
108
|
+
export function thingVerbs(actions, sheet) {
|
|
109
|
+
const verbs = new Map();
|
|
110
|
+
const add = (page, more) => {
|
|
111
|
+
const key = thingKey(page);
|
|
112
|
+
const before = verbs.get(key) ?? [];
|
|
113
|
+
verbs.set(key, [...before, ...(more ?? []).filter((verb) => !before.includes(verb))]);
|
|
114
|
+
};
|
|
115
|
+
for (const group of sheet) {
|
|
116
|
+
for (const value of group.values) {
|
|
117
|
+
const named = actions?.[value.field];
|
|
118
|
+
if (named !== undefined && named.length > 0) {
|
|
119
|
+
[...(value.items ?? []), ...(value.always?.items ?? [])].forEach((item) => add(item, named));
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
(group.items ?? []).forEach((item) => add(item.item, itemVerbs(actions, item)));
|
|
123
|
+
}
|
|
124
|
+
return verbs;
|
|
125
|
+
}
|
|
126
|
+
/** How thingVerbs keys a thing's page: its name trimmed, in any case. */
|
|
127
|
+
export function thingKey(page) {
|
|
128
|
+
return page.trim().toLocaleLowerCase();
|
|
129
|
+
}
|
|
130
|
+
/** A sentence as a button's label says it: without its final full stop. */
|
|
131
|
+
export function withoutFullStop(sentence) {
|
|
132
|
+
return sentence.trimEnd().replace(/[.。]$/u, "");
|
|
133
|
+
}
|
|
104
134
|
/**
|
|
105
135
|
* Who the player may name in a sentence: the other player characters there, the party's companions, then those at the place, as the map has them or else
|
|
106
136
|
* the scene or the place, by the page's labels, as Hooded Bandit 1, never a name the character does not know; never the one acting, `self`, which is Myself,
|
|
@@ -121,23 +151,21 @@ export function actPeople(place, scene, companions, self) {
|
|
|
121
151
|
}
|
|
122
152
|
/**
|
|
123
153
|
* Each sentence said on this page with how it stands, as the server tells it: waiting while it is pending, called once the doorbell rang for it, heard once
|
|
124
|
-
* the master's call took it; while the game is away, and after, what was not heard is lost, to say again
|
|
125
|
-
*
|
|
154
|
+
* the master's call took it; while the game is away, and after, what was not heard is lost, to say again. One the server no longer knows of, heard long
|
|
155
|
+
* ago, is left out.
|
|
126
156
|
*/
|
|
127
157
|
export function saidStates(said, shown, live) {
|
|
128
158
|
return said.flatMap((act) => {
|
|
129
159
|
const pending = shown?.pending.find((one) => one.id === act.id);
|
|
130
160
|
const heard = shown?.heard.includes(act.id) === true;
|
|
131
161
|
const waiting = pending?.rung === true ? "called" : "said";
|
|
132
|
-
const state =
|
|
133
|
-
? "
|
|
134
|
-
:
|
|
135
|
-
?
|
|
136
|
-
:
|
|
137
|
-
?
|
|
138
|
-
:
|
|
139
|
-
? "lost"
|
|
140
|
-
: undefined;
|
|
162
|
+
const state = heard
|
|
163
|
+
? "heard"
|
|
164
|
+
: pending !== undefined && live
|
|
165
|
+
? waiting
|
|
166
|
+
: !live || act.lost === true
|
|
167
|
+
? "lost"
|
|
168
|
+
: undefined;
|
|
141
169
|
return state === undefined ? [] : [{ act, state }];
|
|
142
170
|
});
|
|
143
171
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "preact/jsx-runtime";
|
|
2
|
+
import { Icon } from "../parts/icons.js";
|
|
3
|
+
import { t } from "../text.js";
|
|
4
|
+
/** The head of an action's card: `facts` under the title, as ×5 · in Backpack; `onBack`, when there is a step to go back to. */
|
|
5
|
+
export function ActHead({ title, facts = [], closer, onBack, onClose }) {
|
|
6
|
+
return (_jsxs("header", { class: "map-sheet-head act-head", children: [onBack !== undefined && (_jsx("button", { type: "button", class: "icon-button tip-right act-back", "aria-label": t("Back"), "data-tip": t("Back"), onClick: onBack, children: _jsx(Icon, { name: "fold" }) })), _jsxs("div", { class: "act-heading", children: [_jsx("h2", { id: "act-sheet-title", children: title }), facts.length > 0 && _jsx("p", { id: "act-facts", class: "act-facts", children: facts.join(" · ") })] }), _jsx("button", { ref: closer, type: "button", class: "icon-button tip-left", "aria-label": t("Close"), "data-tip": t("Close"), onClick: onClose, children: _jsx(Icon, { name: "close" }) })] }));
|
|
7
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as _jsx,
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment } from "preact/jsx-runtime";
|
|
2
2
|
// What starts the player's action (D-495): a thing's name of the sheet, or someone's, as a button where the page has the player's actions; else as it was.
|
|
3
3
|
import { createContext } from "preact";
|
|
4
4
|
import { useContext } from "preact/hooks";
|
|
@@ -6,6 +6,8 @@ import { t } from "../text.js";
|
|
|
6
6
|
import { verbLabel } from "./acts.js";
|
|
7
7
|
/** The player's actions where the page has them: none for a system that names none, and the page is as it was. */
|
|
8
8
|
export const PlayerActsContext = createContext(undefined);
|
|
9
|
+
/** The verbs of each thing of the sheet shown, by thingVerbs (D-581 (D)): none outside a sheet, where a name keeps the verbs of its own list. */
|
|
10
|
+
export const ThingVerbsContext = createContext(undefined);
|
|
9
11
|
/** The player's actions, when the page has them. */
|
|
10
12
|
export function usePlayerActs() {
|
|
11
13
|
return useContext(PlayerActsContext);
|
|
@@ -19,7 +21,7 @@ export function ActName({ verbs, item, page, facts, document, said = "", childre
|
|
|
19
21
|
// The click opens the card: the tooltip names what can be done there, a screen reader the thing and what the sheet says of it.
|
|
20
22
|
const title = verbs.length === 0 ? undefined : verbs.map(verbLabel).join(" · ");
|
|
21
23
|
const start = { verbs, item, ...(page === undefined ? {} : { page }), ...(facts === undefined ? {} : { facts }), ...(document === undefined ? {} : { document }) };
|
|
22
|
-
return (
|
|
24
|
+
return (_jsx("button", { type: "button", class: verbs.length === 0 ? "act reads" : "act", "data-tip": title, "aria-label": `${item}${said}`, onClick: (event) => acts?.start(start, event.currentTarget), children: children }));
|
|
23
25
|
}
|
|
24
26
|
/** Someone's name that starts talking to them (D-495), where the page has the player's actions; else the name as it is. */
|
|
25
27
|
export function TalkName({ name, children }) {
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
// The player's sentences to the master (D-495), as the page holds them: the verbs of the sheet, the sentence being written, those said
|
|
2
|
-
// server holds them, sent, taken back,
|
|
1
|
+
// The player's sentences to the master (D-495), as the page holds them: the verbs of the sheet, the sentence being written, those said and how the
|
|
2
|
+
// server holds them, sent, taken back, said again and gone from the strip after a while. The page's read() sets the acts and the verbs it reads, by their setters.
|
|
3
3
|
import { useEffect, useState } from "preact/hooks";
|
|
4
4
|
import { answer, readView, sayAct, withdrawAct } from "../api.js";
|
|
5
5
|
import { t } from "../text.js";
|
|
6
6
|
import { saidStates } from "./acts.js";
|
|
7
|
-
// How long a sentence the master heard
|
|
7
|
+
// How long a sentence the master heard stays in the strip (D-495).
|
|
8
8
|
const heardTime = 6000;
|
|
9
9
|
/** The player's sentences to the master and what the page does with them (D-495). */
|
|
10
10
|
export function useActs({ read, live, asked, foreground, version, players, member, several }) {
|
|
11
|
-
// The verbs of the player character's sheet, the sentences said
|
|
11
|
+
// The verbs of the player character's sheet, the sentences said and how the server holds them, and the action the player is writing, with
|
|
12
12
|
// what started it, which has the focus back.
|
|
13
13
|
const [actions, setActions] = useState();
|
|
14
14
|
const [acts, setActs] = useState();
|
|
@@ -39,8 +39,8 @@ export function useActs({ read, live, asked, foreground, version, players, membe
|
|
|
39
39
|
}
|
|
40
40
|
}, [live]);
|
|
41
41
|
const strip = saidStates(said, acts, live);
|
|
42
|
-
const leaving = strip.filter((entry) => entry.state === "heard"
|
|
43
|
-
// A sentence heard
|
|
42
|
+
const leaving = strip.filter((entry) => entry.state === "heard").map((entry) => entry.act.id).join();
|
|
43
|
+
// A sentence heard goes from the strip after a while.
|
|
44
44
|
useEffect(() => {
|
|
45
45
|
if (leaving === "") {
|
|
46
46
|
return;
|
|
@@ -52,9 +52,9 @@ export function useActs({ read, live, asked, foreground, version, players, membe
|
|
|
52
52
|
setSaid((before) => before.filter((one) => !ids.includes(one.id)));
|
|
53
53
|
setActProblem(undefined);
|
|
54
54
|
};
|
|
55
|
-
// With a question of the master's open, the sentence answers it (ASK-10); else it
|
|
55
|
+
// With a question of the master's open, the sentence answers it (ASK-10); else it goes to the master, who reads it at once with a doorbell, else at their next call.
|
|
56
56
|
const question = asked !== undefined && asked.spend === undefined && asked.forced !== true ? asked : undefined;
|
|
57
|
-
const reply = question !== undefined ? "answer" :
|
|
57
|
+
const reply = question !== undefined ? "answer" : "tell";
|
|
58
58
|
const answering = question === undefined ? undefined : { question: question.question, buttons: question.labels.length > 0 };
|
|
59
59
|
const sendAct = async (text) => {
|
|
60
60
|
setActProblem(undefined);
|
|
@@ -63,31 +63,32 @@ export function useActs({ read, live, asked, foreground, version, players, membe
|
|
|
63
63
|
void read();
|
|
64
64
|
return taken ? undefined : t("The answer did not reach the game: try again.");
|
|
65
65
|
}
|
|
66
|
-
if (reply === "copy") {
|
|
67
|
-
return await copyAct(text) ? undefined : t("Copy did not work: select the words and copy them yourself.");
|
|
68
|
-
}
|
|
69
66
|
// The thing it starts from, for the master to hear what the character already knows of it (T-218).
|
|
70
67
|
const item = acting !== undefined && "verbs" in acting.start ? acting.start.page ?? acting.start.item : undefined;
|
|
68
|
+
return await say(text, item);
|
|
69
|
+
};
|
|
70
|
+
// Sends a sentence to the master and puts it in the strip: undefined when done, else what went wrong.
|
|
71
|
+
const say = async (text, item, instead) => {
|
|
71
72
|
const result = await sayAct(text, item);
|
|
72
73
|
if ("error" in result) {
|
|
73
74
|
return result.error;
|
|
74
75
|
}
|
|
75
|
-
setSaid((before) => [...before, { id: result.id, text }]);
|
|
76
|
+
setSaid((before) => [...before.filter((one) => one.id !== instead), { id: result.id, text, ...(item === undefined ? {} : { item }) }]);
|
|
76
77
|
setActs(result.shown);
|
|
77
78
|
return undefined;
|
|
78
79
|
};
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
return
|
|
80
|
+
// A sentence lost with the chat, said again with the same words, in place of the lost one.
|
|
81
|
+
const sayAgain = async (id) => {
|
|
82
|
+
const lost = said.find((one) => one.id === id);
|
|
83
|
+
if (lost === undefined) {
|
|
84
|
+
return;
|
|
84
85
|
}
|
|
85
|
-
|
|
86
|
-
|
|
86
|
+
setActProblem(undefined);
|
|
87
|
+
const failed = await say(lost.text, lost.item, id);
|
|
88
|
+
if (failed !== undefined) {
|
|
89
|
+
setActProblem(failed);
|
|
87
90
|
}
|
|
88
91
|
};
|
|
89
|
-
// A sentence copied again from the strip goes from it; one that would not copy says so.
|
|
90
|
-
const copyFromStrip = (id, text) => void copyAct(text).then((done) => (done ? dismissAct(id) : setActProblem(t("Copy did not work: select the words and copy them yourself."))));
|
|
91
92
|
const withdraw = async (id) => {
|
|
92
93
|
const result = await withdrawAct(id);
|
|
93
94
|
if (result === "heard") {
|
|
@@ -109,5 +110,5 @@ export function useActs({ read, live, asked, foreground, version, players, membe
|
|
|
109
110
|
requestAnimationFrame(() => opener?.isConnected === true && opener.focus());
|
|
110
111
|
};
|
|
111
112
|
const playerActs = actions === undefined || players.length === 0 ? undefined : { actions, start: (start, opener) => setActing({ start, opener }) };
|
|
112
|
-
return { setActs, setActions, playerActs, acting, actsElsewhere, actPlace, reply, answering, strip, actProblem, sendAct, closeAct, withdraw,
|
|
113
|
+
return { setActs, setActions, playerActs, acting, actsElsewhere, actPlace, reply, bell: acts?.bell === true, answering, strip, actProblem, sendAct, closeAct, withdraw, sayAgain, dismissAct };
|
|
113
114
|
}
|
|
@@ -1,151 +1,9 @@
|
|
|
1
|
-
import { jsx as _jsx
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
import { Icon } from "../parts/icons.js";
|
|
6
|
-
import { fieldLabel, phraseLabel, shownText } from "../parts/labels.js";
|
|
7
|
-
import { Markdown } from "../parts/markdown.js";
|
|
8
|
-
import { PlaceMap } from "../place/view.js";
|
|
9
|
-
import { t } from "../text.js";
|
|
10
|
-
import { actPeople, actSentence, actTitle, spokenBy, talkSentence, targetMode, verbLabel } from "./acts.js";
|
|
11
|
-
// How many characters a sentence may have, as the server takes them.
|
|
12
|
-
const mostWords = 500;
|
|
13
|
-
/**
|
|
14
|
-
* The card of an action (D-495, D-573): a thing first, its page's text and its verbs; a verb chosen, on whom as chips and on the place's map,
|
|
15
|
-
* then the sentence in a field, which Enter sends and Escape closes. A card in the middle, wider with the map; a sheet from the foot on a phone.
|
|
16
|
-
*/
|
|
1
|
+
import { jsx as _jsx } from "preact/jsx-runtime";
|
|
2
|
+
import { TalkSheet } from "./talk.js";
|
|
3
|
+
import { ThingSheet } from "./thing.js";
|
|
4
|
+
/** The card of an action: a thing's (D-573) or talking to someone's. A card in the middle, wider with the map; a sheet from the foot on a phone. */
|
|
17
5
|
export function ActSheet({ start, self, place, scene, companions, reply, asked, onSend, onClose }) {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
const verbsBar = useRef(null);
|
|
22
|
-
const closer = useRef(null);
|
|
23
|
-
const thing = "verbs" in start;
|
|
24
|
-
// A thing opens on itself until a verb is chosen; talking goes straight to the words.
|
|
25
|
-
const [verb, setVerb] = useState();
|
|
26
|
-
const acting = !thing || verb !== undefined;
|
|
27
|
-
const mode = verb === undefined ? "none" : targetMode(verb);
|
|
28
|
-
const [target, setTarget] = useState();
|
|
29
|
-
const [square, setSquare] = useState("");
|
|
30
|
-
const map = place?.map;
|
|
31
|
-
// With a map at the place, on whom is chosen on it too, by a click.
|
|
32
|
-
const mapShown = map !== undefined && place !== undefined && mode !== "none";
|
|
33
|
-
const people = actPeople(place, scene, companions, self);
|
|
34
|
-
const shownTarget = target === undefined ? "none" : target === "square" ? (square.trim() === "" ? "none" : { square: square.trim().toUpperCase() }) : target;
|
|
35
|
-
// With more than one player character the sentence starts with who acts (D-480 (8)).
|
|
36
|
-
const composed = spokenBy("talk" in start ? talkSentence(start.talk) : actSentence(verb ?? "use", start.item, shownTarget), self);
|
|
37
|
-
const [text, setText] = useState(composed);
|
|
38
|
-
// What the page wrote last: changed by the player, the sentence is theirs and a new target leaves it as it is; a new verb writes it again.
|
|
39
|
-
const written = useRef(composed);
|
|
40
|
-
const writtenFor = useRef(verb);
|
|
41
|
-
const [problem, setProblem] = useState();
|
|
42
|
-
const [sending, setSending] = useState(false);
|
|
43
|
-
// The text of the thing's page: undefined while it is read, empty for a page of data alone, null when the character knows no page of it.
|
|
44
|
-
const [about, setAbout] = useState();
|
|
45
|
-
// What the page says of the thing as data, as damage and weight (D-573).
|
|
46
|
-
const [data, setData] = useState([]);
|
|
47
|
-
const title = "talk" in start ? t("Talk to {name}", { name: start.talk }) : verb === undefined ? start.item : actTitle(verb, start.item);
|
|
48
|
-
useEffect(() => {
|
|
49
|
-
if (text === written.current || writtenFor.current !== verb) {
|
|
50
|
-
setText(composed);
|
|
51
|
-
}
|
|
52
|
-
written.current = composed;
|
|
53
|
-
writtenFor.current = verb;
|
|
54
|
-
}, [composed, verb]);
|
|
55
|
-
// A modal dialog lies over everything on the page and closes with Escape by itself; a thing's page is read once, when it opens.
|
|
56
|
-
useEffect(() => {
|
|
57
|
-
dialog.current?.showModal();
|
|
58
|
-
if (!thing) {
|
|
59
|
-
focusEnd(field.current);
|
|
60
|
-
return;
|
|
61
|
-
}
|
|
62
|
-
(verbsBar.current?.querySelector("a, button") ?? closer.current)?.focus();
|
|
63
|
-
let live = true;
|
|
64
|
-
readView(start.page ?? start.item).then((page) => {
|
|
65
|
-
if (live) {
|
|
66
|
-
setAbout(page.kind === "page" ? page.text.trim() : null);
|
|
67
|
-
setData(page.kind === "page" ? page.sheet.flatMap((group) => group.values) : []);
|
|
68
|
-
}
|
|
69
|
-
}, () => live && setAbout(null));
|
|
70
|
-
return () => {
|
|
71
|
-
live = false;
|
|
72
|
-
};
|
|
73
|
-
}, []);
|
|
74
|
-
// The focus goes where the player chooses next: on whom, for a verb that needs someone; else the sentence, the cursor at its end.
|
|
75
|
-
useEffect(() => {
|
|
76
|
-
if (verb === undefined) {
|
|
77
|
-
return;
|
|
78
|
-
}
|
|
79
|
-
if (mode === "asks") {
|
|
80
|
-
list.current?.querySelector("input[type=radio]")?.focus();
|
|
81
|
-
}
|
|
82
|
-
else {
|
|
83
|
-
focusEnd(field.current);
|
|
84
|
-
}
|
|
85
|
-
}, [verb]);
|
|
86
|
-
const pick = (chosen) => {
|
|
87
|
-
setVerb(chosen);
|
|
88
|
-
setTarget(targetMode(chosen) === "lets" ? "none" : undefined);
|
|
89
|
-
setProblem(undefined);
|
|
90
|
-
};
|
|
91
|
-
// Back to the thing, the focus on the verb that was chosen.
|
|
92
|
-
const back = () => {
|
|
93
|
-
const was = verb;
|
|
94
|
-
setVerb(undefined);
|
|
95
|
-
setProblem(undefined);
|
|
96
|
-
requestAnimationFrame(() => verbsBar.current?.querySelector(`button[data-verb="${was ?? ""}"]`)?.focus());
|
|
97
|
-
};
|
|
98
|
-
const choose = (chosen) => {
|
|
99
|
-
setTarget(chosen);
|
|
100
|
-
setProblem(undefined);
|
|
101
|
-
};
|
|
102
|
-
const send = async (event) => {
|
|
103
|
-
event.preventDefault();
|
|
104
|
-
const words = text.trim();
|
|
105
|
-
if (words === "" || sending) {
|
|
106
|
-
return;
|
|
107
|
-
}
|
|
108
|
-
setSending(true);
|
|
109
|
-
const failed = await onSend(words);
|
|
110
|
-
setSending(false);
|
|
111
|
-
if (failed === undefined) {
|
|
112
|
-
dialog.current?.close();
|
|
113
|
-
}
|
|
114
|
-
else {
|
|
115
|
-
setProblem(failed);
|
|
116
|
-
}
|
|
117
|
-
};
|
|
118
|
-
// Enter sends, Shift+Enter starts a new line; never while an input method composes a word.
|
|
119
|
-
const keys = (event) => {
|
|
120
|
-
if (event.key === "Enter" && !event.shiftKey && !event.isComposing) {
|
|
121
|
-
void send(event);
|
|
122
|
-
}
|
|
123
|
-
};
|
|
124
|
-
// Enter on a choice of the list takes the player to the sentence.
|
|
125
|
-
const toSentence = (event) => {
|
|
126
|
-
if (event.key === "Enter") {
|
|
127
|
-
event.preventDefault();
|
|
128
|
-
focusEnd(field.current);
|
|
129
|
-
}
|
|
130
|
-
};
|
|
131
|
-
const close = () => dialog.current?.close();
|
|
132
|
-
const personChosen = typeof target === "object" && "person" in target ? target.person : undefined;
|
|
133
|
-
const option = (key, chosen, label, kind = "") => (_jsxs("label", { class: ["act-who-one", kind].filter((name) => name !== "").join(" "), children: [_jsx("input", { type: "radio", name: "act-who", checked: sameTarget(target, chosen), onChange: () => choose(chosen), onKeyDown: toSentence }), label] }, key));
|
|
134
|
-
const button = reply === "copy" ? t("Copy") : reply === "answer" ? t("Answer the master") : t("Tell the master");
|
|
135
|
-
const facts = thing ? start.facts ?? [] : [];
|
|
136
|
-
return (_jsxs("dialog", { ref: dialog, class: mapShown ? "map-sheet act-sheet wide" : "map-sheet act-sheet", "aria-labelledby": "act-sheet-title", "aria-describedby": !acting && facts.length > 0 ? "act-facts" : undefined, onClose: onClose, children: [_jsxs("header", { class: "map-sheet-head act-head", children: [thing && acting && (_jsx("button", { type: "button", class: "icon-button tip-right act-back", "aria-label": t("Back"), "data-tip": t("Back"), onClick: back, children: _jsx(Icon, { name: "fold" }) })), _jsxs("div", { class: "act-heading", children: [_jsx("h2", { id: "act-sheet-title", children: title }), !acting && facts.length > 0 && _jsx("p", { id: "act-facts", class: "act-facts", children: facts.join(" · ") })] }), _jsx("button", { ref: closer, type: "button", class: "icon-button tip-left", "aria-label": t("Close"), "data-tip": t("Close"), onClick: close, children: _jsx(Icon, { name: "close" }) })] }), thing && !acting && (_jsxs(_Fragment, { children: [data.length > 0 && (_jsx("dl", { class: "act-data", children: data.map((value) => (_jsxs("div", { children: [_jsx("dt", { children: phraseLabel(fieldLabel(value.field)) }), _jsx("dd", { children: shownText(value.text, value.kind) })] }, value.field))) })), about !== undefined && about !== "" && (about !== null || data.length === 0) && (_jsx("div", { class: "act-about", children: about === null ? _jsx("p", { class: "browse-none", children: t("Your character knows its name, and nothing more yet.") }) : _jsx(Markdown, { text: about }) })), (start.verbs.length > 0 || start.document === true) && (_jsxs("div", { ref: verbsBar, class: "act-buttons act-verbs", role: "group", "aria-label": t("What you do"), children: [start.document === true && (_jsx("a", { class: "map-sheet-go act-go", href: sectionAddress("world", "documents", start.page ?? start.item), onClick: close, children: t("Read it") })), start.verbs.map((one, index) => (_jsx("button", { type: "button", "data-verb": one, class: index === 0 && start.document !== true ? "map-sheet-go act-go" : "act-cancel", onClick: () => pick(one), children: verbLabel(one) }, one)))] }))] })), acting && mode !== "none" && (_jsxs("div", { class: "act-body", children: [_jsxs("fieldset", { ref: list, class: "act-who", children: [_jsx("legend", { class: "eyebrow", children: t("On whom") }), people.map((person, index) => option(`person ${index}`, { person: person.name }, _jsxs(_Fragment, { children: [_jsxs("span", { class: "act-who-name", children: [person.name, person.count !== undefined && _jsx("span", { class: "count", children: ` ×${person.count}` })] }), person.square !== undefined && _jsx("span", { class: "lm-key-square", children: person.square })] }), [person.role, person.hostile === true ? "hostile" : ""].filter((name) => name !== "").join(" "))), option("self", "self", _jsx("span", { class: "act-who-name", children: t("Myself") }), "plain"), option("none", "none", _jsx("span", { class: "act-who-name", children: t("No one in particular") }), "plain"), mapShown && option("square", "square", _jsx("span", { class: "act-who-name", children: t("A square…") }), "plain"), target === "square" && mapShown && (_jsx("input", { type: "text", class: "act-square", value: square, maxLength: 5, placeholder: "E4", "aria-label": t("The square, such as E4"), onInput: (event) => setSquare(event.currentTarget.value), onKeyDown: toSentence }))] }), mapShown && (_jsx(PlaceMap, { map: map, place: place.name, bare: true, self: self, choosing: { selected: personChosen, onChoose: (name) => choose(name === undefined ? "self" : { person: name }) }, ...(target === "square" ? { picking: { selected: square.trim().toUpperCase(), onSelect: setSquare } } : {}) }))] })), acting && (_jsxs("form", { class: "act-bar", onSubmit: (event) => void send(event), children: [reply === "answer" && (_jsxs("p", { id: "act-note", class: "act-note act-answer", children: [_jsx(Icon, { name: "bell" }), asked?.buttons === true
|
|
137
|
-
? t("These words answer the master instead of a roll or a button: {question}", { question: asked.question })
|
|
138
|
-
: t("These words answer the master's question: {question}", { question: asked?.question ?? "" })] })), _jsxs("label", { for: "act-words", class: "eyebrow act-words-label", children: [_jsx(Icon, { name: "chat" }), t("Your words to the master")] }), _jsx("textarea", { ref: field, id: "act-words", class: "act-words", value: text, rows: 2, maxLength: mostWords, "aria-describedby": reply === "tell" ? undefined : "act-note", onInput: (event) => setText(event.currentTarget.value), onKeyDown: keys }), reply === "copy" && (_jsxs("p", { id: "act-note", class: "act-note", children: [_jsx(Icon, { name: "info" }), t("This chat does not hear it by itself: copy it, then paste it in the chat.")] })), problem && _jsx("p", { class: "act-problem", role: "alert", children: problem }), _jsxs("div", { class: "act-buttons", children: [_jsx("button", { type: "button", class: "act-cancel", onClick: close, children: t("Cancel") }), _jsxs("button", { type: "submit", class: "map-sheet-go act-go", disabled: sending || text.trim() === "", children: [button, _jsx(Icon, { name: reply === "copy" ? "copy" : "send" })] })] })] }))] }));
|
|
139
|
-
}
|
|
140
|
-
/** Whether two choices of the list are the same. */
|
|
141
|
-
function sameTarget(target, other) {
|
|
142
|
-
if (typeof target === "object" && typeof other === "object") {
|
|
143
|
-
return "person" in target && "person" in other && target.person === other.person;
|
|
144
|
-
}
|
|
145
|
-
return target === other;
|
|
146
|
-
}
|
|
147
|
-
/** Focuses a field with its cursor at the end of what it holds. */
|
|
148
|
-
function focusEnd(field) {
|
|
149
|
-
field?.focus();
|
|
150
|
-
field?.setSelectionRange(field.value.length, field.value.length);
|
|
6
|
+
return "talk" in start
|
|
7
|
+
? _jsx(TalkSheet, { name: start.talk, self: self, reply: reply, asked: asked, onSend: onSend, onClose: onClose })
|
|
8
|
+
: _jsx(ThingSheet, { start: start, self: self, place: place, scene: scene, companions: companions, reply: reply, onSend: onSend, onClose: onClose });
|
|
151
9
|
}
|
|
@@ -1,35 +1,33 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "preact/jsx-runtime";
|
|
2
|
-
// The player's sentences after they go (D-495), in words and with a sign: said, with a button to take it back while it waits
|
|
3
|
-
// heard; or never heard, the chat gone, to say again
|
|
2
|
+
// The player's sentences after they go (D-495), in words and with a sign: said, with a button to take it back while it waits, and without a doorbell when the
|
|
3
|
+
// master reads it; called, the doorbell rang; heard; or never heard, the chat gone, to say again. A screen reader hears only the change of state.
|
|
4
4
|
import { useEffect, useRef, useState } from "preact/hooks";
|
|
5
5
|
import { Icon } from "../parts/icons.js";
|
|
6
6
|
import { t } from "../text.js";
|
|
7
|
-
export function ActStrip({ entries, problem, onWithdraw,
|
|
7
|
+
export function ActStrip({ entries, problem, bell, live, onWithdraw, onSayAgain, onDismiss }) {
|
|
8
8
|
const before = useRef(new Map());
|
|
9
9
|
const [told, setTold] = useState("");
|
|
10
|
-
// Only what changed is told, the newest change last: a sentence said, heard
|
|
10
|
+
// Only what changed is told, the newest change last: a sentence said, heard or lost.
|
|
11
11
|
useEffect(() => {
|
|
12
12
|
const changed = entries.filter(({ act, state }) => before.current.get(act.id) !== state).at(-1);
|
|
13
13
|
before.current = new Map(entries.map(({ act, state }) => [act.id, state]));
|
|
14
14
|
if (changed !== undefined) {
|
|
15
|
-
setTold(stateWords(changed.state));
|
|
15
|
+
setTold(stateWords(changed.state, bell));
|
|
16
16
|
}
|
|
17
17
|
}, [entries.map(({ act, state }) => `${act.id} ${state}`).join()]);
|
|
18
|
-
return (_jsxs(_Fragment, { children: [_jsx("p", { class: "visually-hidden", role: "status", children: told }), (entries.length > 0 || problem !== undefined) && (_jsxs("section", { class: "act-strip", "aria-label": t("Your sentences"), children: [entries.map(({ act, state }) => (_jsxs("p", { class: `act-line ${state}`, children: [_jsx("span", { class: "act-sign", children: _jsx(Icon, { name: stateIcon(state) }) }), _jsxs("span", { class: "act-said", children: [_jsx("q", { children: act.text }), _jsx("span", { class: "act-state", children: stateWords(state) })] }), state === "said" && _jsx("button", { type: "button", class: "act-small", "aria-label": t("Take it back from the master"), onClick: () => onWithdraw(act.id), children: t("Take back") }), state === "lost" && _jsx("button", { type: "button", class: "act-small", onClick: () =>
|
|
18
|
+
return (_jsxs(_Fragment, { children: [_jsx("p", { class: "visually-hidden", role: "status", children: told }), (entries.length > 0 || problem !== undefined) && (_jsxs("section", { class: "act-strip", "aria-label": t("Your sentences"), children: [entries.map(({ act, state }) => (_jsxs("p", { class: `act-line ${state}`, children: [_jsx("span", { class: "act-sign", children: _jsx(Icon, { name: stateIcon(state) }) }), _jsxs("span", { class: "act-said", children: [_jsx("q", { children: act.text }), _jsx("span", { class: "act-state", children: stateWords(state, bell) })] }), state === "said" && _jsx("button", { type: "button", class: "act-small", "aria-label": t("Take it back from the master"), onClick: () => onWithdraw(act.id), children: t("Take back") }), state === "lost" && _jsx("button", { type: "button", class: "act-small", disabled: !live, onClick: () => onSayAgain(act.id), children: t("Say it again") }), state !== "said" && (_jsx("button", { type: "button", class: "icon-button act-close tip-left", "aria-label": t("Close"), "data-tip": t("Close"), onClick: () => onDismiss(act.id), children: _jsx(Icon, { name: "close" }) }))] }, act.id))), problem !== undefined && _jsx("p", { class: "act-problem", role: "alert", children: problem })] }))] }));
|
|
19
19
|
}
|
|
20
|
-
/** How a sentence stands, in words. */
|
|
21
|
-
function stateWords(state) {
|
|
20
|
+
/** How a sentence stands, in words; said without a doorbell, when the master reads it. */
|
|
21
|
+
function stateWords(state, bell) {
|
|
22
22
|
switch (state) {
|
|
23
23
|
case "said":
|
|
24
|
-
return t("Said to the master");
|
|
24
|
+
return bell ? t("Said to the master") : t("Said to the master: they read it as soon as you write in the chat");
|
|
25
25
|
case "called":
|
|
26
26
|
return t("The master is about to read it");
|
|
27
27
|
case "heard":
|
|
28
28
|
return t("The master is reading it");
|
|
29
29
|
case "lost":
|
|
30
|
-
return t("Not heard:
|
|
31
|
-
case "copied":
|
|
32
|
-
return t("Copied: paste it in the chat");
|
|
30
|
+
return t("Not heard: the chat was closed");
|
|
33
31
|
}
|
|
34
32
|
}
|
|
35
33
|
/** How a sentence stands, as a sign beside its words. */
|
|
@@ -43,7 +41,5 @@ function stateIcon(state) {
|
|
|
43
41
|
return "check";
|
|
44
42
|
case "lost":
|
|
45
43
|
return "offline";
|
|
46
|
-
case "copied":
|
|
47
|
-
return "copy";
|
|
48
44
|
}
|
|
49
45
|
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "preact/jsx-runtime";
|
|
2
|
+
// Talking to someone from the page (D-495): the start of the sentence in a field, which the player goes on and sends; Enter sends, Escape closes.
|
|
3
|
+
import { useEffect, useRef, useState } from "preact/hooks";
|
|
4
|
+
import { Icon } from "../parts/icons.js";
|
|
5
|
+
import { t } from "../text.js";
|
|
6
|
+
import { spokenBy, talkSentence } from "./acts.js";
|
|
7
|
+
import { ActHead } from "./head.js";
|
|
8
|
+
// How many characters a sentence may have, as the server takes them.
|
|
9
|
+
const mostWords = 500;
|
|
10
|
+
/** The card of talking to someone: the player's words under a visible label, and how they go, told or as the answer to the master's question (ASK-10). */
|
|
11
|
+
export function TalkSheet({ name, self, reply, asked, onSend, onClose }) {
|
|
12
|
+
const dialog = useRef(null);
|
|
13
|
+
const field = useRef(null);
|
|
14
|
+
// With more than one player character the sentence starts with who acts (D-480 (8)).
|
|
15
|
+
const [text, setText] = useState(spokenBy(talkSentence(name), self));
|
|
16
|
+
const [problem, setProblem] = useState();
|
|
17
|
+
const [sending, setSending] = useState(false);
|
|
18
|
+
// A modal dialog lies over everything on the page and closes with Escape by itself; the cursor waits at the end of the words.
|
|
19
|
+
useEffect(() => {
|
|
20
|
+
dialog.current?.showModal();
|
|
21
|
+
field.current?.focus();
|
|
22
|
+
field.current?.setSelectionRange(field.current.value.length, field.current.value.length);
|
|
23
|
+
}, []);
|
|
24
|
+
const send = async (event) => {
|
|
25
|
+
event.preventDefault();
|
|
26
|
+
const words = text.trim();
|
|
27
|
+
if (words === "" || sending) {
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
setSending(true);
|
|
31
|
+
const failed = await onSend(words);
|
|
32
|
+
setSending(false);
|
|
33
|
+
if (failed === undefined) {
|
|
34
|
+
dialog.current?.close();
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
setProblem(failed);
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
// Enter sends, Shift+Enter starts a new line; never while an input method composes a word.
|
|
41
|
+
const keys = (event) => {
|
|
42
|
+
if (event.key === "Enter" && !event.shiftKey && !event.isComposing) {
|
|
43
|
+
void send(event);
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
const close = () => dialog.current?.close();
|
|
47
|
+
const button = reply === "answer" ? t("Answer the master") : t("Tell the master");
|
|
48
|
+
return (_jsxs("dialog", { ref: dialog, class: "map-sheet act-sheet", "aria-labelledby": "act-sheet-title", onClose: onClose, children: [_jsx(ActHead, { title: t("Talk to {name}", { name }), onClose: close }), _jsxs("form", { class: "act-bar", onSubmit: (event) => void send(event), children: [reply === "answer" && (_jsxs("p", { id: "act-note", class: "act-note act-answer", children: [_jsx(Icon, { name: "bell" }), asked?.buttons === true
|
|
49
|
+
? t("These words answer the master instead of a roll or a button: {question}", { question: asked.question })
|
|
50
|
+
: t("These words answer the master's question: {question}", { question: asked?.question ?? "" })] })), _jsxs("label", { for: "act-words", class: "eyebrow act-words-label", children: [_jsx(Icon, { name: "chat" }), t("Your words to the master")] }), _jsx("textarea", { ref: field, id: "act-words", class: "act-words", value: text, rows: 2, maxLength: mostWords, "aria-describedby": reply === "tell" ? undefined : "act-note", onInput: (event) => setText(event.currentTarget.value), onKeyDown: keys }), problem && _jsx("p", { class: "act-problem", role: "alert", children: problem }), _jsxs("div", { class: "act-buttons", children: [_jsx("button", { type: "button", class: "act-cancel", onClick: close, children: t("Cancel") }), _jsxs("button", { type: "submit", class: "map-sheet-go act-go", disabled: sending || text.trim() === "", children: [button, _jsx(Icon, { name: "send" })] })] })] })] }));
|
|
51
|
+
}
|