@chatwarden/player-react 0.1.2 → 0.1.3

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 CHANGED
@@ -20,7 +20,7 @@ exist in 18.3 (`useId`, `useRef`). The unit and interaction tests run on React 1
20
20
  only: no run-time import of it, or of the HTTP package, is in the bundle. Node 22.13 or newer for the tooling; the components
21
21
  themselves run in a browser and import no `node:` module.
22
22
 
23
- Your server needs `@chatwarden/http` for the routes the components call (`playerRoutes`). The JavaScript is under 15 KB gzipped
23
+ Your server needs `@chatwarden/http` for the routes the components call (`playerRoutes`). The JavaScript is under 10 KB gzipped
24
24
  with React external, and the stylesheet under 6 KB.
25
25
 
26
26
  ## Quick start
@@ -54,24 +54,20 @@ export function GameShell({ inMatch }: { inMatch: boolean }) {
54
54
  }
55
55
  ```
56
56
 
57
- How reporting works is the studio's setting (the Reporting section of the moderator hub, or `reporting` in code): one tap, pick a reason
58
- first, or reason required, with the reasons, their groups and hints, and the thank-you. Read it from `GET /rules` and pass it to the
59
- dialog. Your server adds the room and the seats and calls the kit:
57
+ Reporting is one step. The dialog asks "Report this message?", shows the line, and has an optional "Why?" (one select, the reasons in
58
+ groups) and a Report button; a note is behind "Add a note". How it works is the studio's setting (the Reporting section of the moderator
59
+ hub, or `reporting` in code): which reasons, their groups and hints, whether a reason is required, and the thank-you. Read it from
60
+ `GET /rules` and pass it to the dialog. Your server adds the room and the seats and calls the kit:
60
61
 
61
62
  ```ts
62
- import type { ReportDetailResult, ReportResult } from '@chatwarden/core';
63
- import type { ReportFollowUp, ReportDraft } from '@chatwarden/player-react';
63
+ import type { ReportResult } from '@chatwarden/core';
64
+ import type { ReportDraft } from '@chatwarden/player-react';
64
65
 
65
- // `cw` is your createChatwarden(...) instance. Call these behind your own routes, for example POST /report and POST /report/:id/detail:
66
- // `roomId` and the seats come from your session, never from the client.
66
+ // `cw` is your createChatwarden(...) instance. Call this behind your own route, for example POST /report: `roomId` and the seats come
67
+ // from your session, never from the client. The draft is the kit's own `reason` and `note`, so it spreads straight in.
67
68
  export function takeReport(roomId: string, mySeat: string, theirSeat: string, draft: ReportDraft): Promise<ReportResult> {
68
69
  return cw.reports.submit({ roomId, reporterSeat: mySeat, targetSeat: theirSeat, ...draft });
69
70
  }
70
-
71
- // The optional follow-up of a one-tap report: a reason and a note, within ten minutes, once, from the reporter only.
72
- export function addToReport(reportId: string, mySeat: string, detail: ReportFollowUp): Promise<ReportDetailResult> {
73
- return cw.reports.addDetail(reportId, mySeat, detail);
74
- }
75
71
  ```
76
72
 
77
73
  Load the settings before the dialog is drawn, so it opens in the right flow and never changes under the player's hands. A failed load
@@ -82,7 +78,7 @@ spells it out, with the dialog's own words:
82
78
  import { useEffect, useState } from 'react';
83
79
  import type { PlayerClient, PlayerReporting } from '@chatwarden/player-react';
84
80
 
85
- /** One tap, no reasons to offer afterwards, the dialog's own thank-you: what a player gets when the settings cannot be loaded. */
81
+ /** One tap, no reasons to offer, the dialog's own thank-you: what a player gets when the settings cannot be loaded. */
86
82
  const ONE_TAP: PlayerReporting = { flow: 'one_tap', thanks: '', reasons: [] };
87
83
 
88
84
  /** The studio's reporting settings from `GET /rules`: `undefined` while they load, the one-tap fallback if that fails. */
@@ -116,23 +112,51 @@ export function ReportMessage({ client, line, name, close }: { client: PlayerCli
116
112
  reporting={reporting}
117
113
  onClose={close}
118
114
  onSubmit={(draft) => fetch('/report', { method: 'POST', body: JSON.stringify(draft) }).then((r) => r.json())}
119
- onAddDetail={(id, detail) => fetch(`/report/${id}/detail`, { method: 'POST', body: JSON.stringify(detail) }).then((r) => r.json())}
120
115
  />
121
116
  );
122
117
  }
123
118
  ```
124
119
 
125
- - **One tap is the studio's default, applied when you pass `reporting`.** The dialog asks "Report this message?" with the line in quotes and a
126
- Report button. The report is filed at once and the studio's thank-you is shown. With `onAddDetail` there is then an optional "Add a reason"
127
- step (a reason and a note) that attaches to the same report, offered until `detailUntil` (the kit's ten minutes). Closing at any point is
128
- fine: the report is already filed. The heading then reads "Report sent" and the thank-you is announced.
129
- - **Pick a reason first / reason required.** The reasons in groups, with "Something else" last, then a note when the reason asks for one.
130
- A reason is optional in the first ("Skip and report") and required in the second.
120
+ - **One step, whatever the flow.** Report with nothing chosen files the report at once. A reason chosen in the select, and a note typed
121
+ behind "Add a note" (shown straight away when the chosen reason asks for one), go in the same report: `onSubmit` gets
122
+ `{ reason?, note? }` once. The dialog then reads "Report sent", shows the studio's thank-you (and how many reports are left today) and
123
+ has Close. There is no second step.
124
+ - **Reason required** (`flow: 'reason_required'`): the label is "Why?" and the select is required. Report without a reason shows an inline
125
+ error, puts focus on the select and sends nothing. In the other flows the select is "Why? (optional)".
126
+ - **`onAddDetail` is deprecated.** It is still accepted (and `ReportFollowUp` is still exported) so existing code compiles, but the dialog
127
+ never calls it. Remove it. `cw.reports.addDetail` is still there if you want a follow-up screen of your own.
131
128
  - **A reason is a hint.** The kit stores it as `reportedReason`; the moderators (and later the AI) decide what the report really is.
132
- - **Without `reporting`** the dialog is one tap with its own words and no reasons to offer afterwards: the same as when `GET /rules` cannot be
133
- loaded. Pass `reporting` before the dialog opens: one that arrives later changes the flow under the player.
129
+ - **Without `reporting`** the dialog has no reasons to offer: one press files the report, with its own words. That is the same as when
130
+ `GET /rules` cannot be loaded. Pass `reporting` before the dialog opens: one that arrives later changes the flow under the player.
134
131
  - **Stale settings.** If the studio changes the list while a dialog is open, the kit refuses an unknown reason (`reason_unknown`) or a
135
132
  missing one (`reason_required`) and the dialog says so. Read `GET /rules` again before the next report.
133
+ - **Your own controls (`extra`, experimental).** A node placed inside the form under the reason and the note, above Report and Cancel,
134
+ for something of your own, such as an "Also mute this player" checkbox. You own its state; the dialog only places it (spacing, no other
135
+ styling), keeps its controls in the Tab order (reason, note, yours, Report, Cancel) and in the focus trap, and drops it once the report
136
+ is sent. It is inside the dialog's form, so give your buttons `type="button"`: a plain `<button>`, or Enter in a text field of
137
+ yours, sends the report. Send what you chose from your own `onSubmit`:
138
+
139
+ ```tsx
140
+ import { useState } from 'react';
141
+ import { ReportDialog } from '@chatwarden/player-react';
142
+ import type { PlayerReporting, ReportResult } from '@chatwarden/player-react';
143
+
144
+ export function ReportAndMaybeMute(props: { reporting: PlayerReporting; close: () => void; send: (mute: boolean, draft: object) => Promise<ReportResult> }) {
145
+ const [mute, setMute] = useState(false);
146
+ return (
147
+ <ReportDialog
148
+ reporting={props.reporting}
149
+ onClose={props.close}
150
+ onSubmit={(draft) => props.send(mute, draft)}
151
+ extra={
152
+ <label>
153
+ <input type="checkbox" checked={mute} onChange={(e) => setMute(e.target.checked)} /> Also mute this player
154
+ </label>
155
+ }
156
+ />
157
+ );
158
+ }
159
+ ```
136
160
 
137
161
  ## Put it on your server
138
162
 
@@ -215,7 +239,7 @@ Theming).
215
239
  | `NoticeQueue` | The pending notices, oldest first, one at a time in a modal dialog. A warning has an Acknowledge button; every other notice has Got it. Both call `POST /notices/:id/ack`. Nothing is rendered when there is nothing to show. | `client`, `canShow` (default `true`), `appealUrl`, `refreshKey`, `onAcknowledged(notice)`, `onPendingChange(count)` |
216
240
  | `MyRecord` | What is on the player's record now, newest first, from `GET /record`; or "Your record is clear". | `client`, `appealUrl`, `refreshKey` |
217
241
  | `RulesPage` | The summary and the numbered rules from `GET /rules`. The numbers are the kit's: a retired rule leaves a gap. | `client`, `refreshKey` |
218
- | `ReportDialog` | The studio's report flow (one tap, reason first, reason required) with grouped reasons and an optional note, and an optional "Add a reason" step after a one-tap report. Maps every refusal the kit has to its own plain message and shows how many reports are left today. | `onSubmit(draft)` returning a `ReportResult`, `onClose`, `reporting` (from `GET /rules`), `onAddDetail(reportId, detail)`, `line`, `targetName` |
242
+ | `ReportDialog` | A one-step report: "Report this message?", the line, an optional "Why?" select (the studio's reasons in groups; required in the reason-required flow) and a note behind "Add a note". Maps every refusal the kit has to its own plain message and shows how many reports are left today. | `onSubmit(draft)` returning a `ReportResult`, `onClose`, `reporting` (from `GET /rules`), `line`, `targetName`, `extra` (experimental: your own controls in the form) (`onAddDetail` is deprecated and unused) |
219
243
  | `RestrictedChatLine` | One line for where a chat box would be: why the player cannot type and until when. | `until` (epoch ms or `null`), `byModerator`, `refCode` |
220
244
 
221
245
  - **The hold.** `canShow={false}` keeps notices and shows nothing, so a notice never interrupts a match. They are kept, not dropped and
@@ -1 +1 @@
1
- {"version":3,"file":"Dialog.d.ts","sourceRoot":"","sources":["../../src/Dialog.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAiB,SAAS,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAyBjE,wBAAgB,MAAM,CAAC,EACrB,UAAU,EACV,YAAY,EACZ,QAAQ,EACR,aAAa,EACb,QAAQ,GACT,EAAE;IACD,mDAAmD;IACnD,UAAU,EAAE,MAAM,CAAC;IACnB,mDAAmD;IACnD,YAAY,EAAE,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;IAC5C,4EAA4E;IAC5E,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,6EAA6E;IAC7E,aAAa,CAAC,EAAE,MAAM,WAAW,GAAG,IAAI,CAAC;IACzC,QAAQ,EAAE,SAAS,CAAC;CACrB,+BA0EA"}
1
+ {"version":3,"file":"Dialog.d.ts","sourceRoot":"","sources":["../../src/Dialog.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAiB,SAAS,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAejE,wBAAgB,MAAM,CAAC,EACrB,UAAU,EACV,YAAY,EACZ,QAAQ,EACR,aAAa,EACb,QAAQ,GACT,EAAE;IACD,mDAAmD;IACnD,UAAU,EAAE,MAAM,CAAC;IACnB,mDAAmD;IACnD,YAAY,EAAE,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;IAC5C,4EAA4E;IAC5E,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,6EAA6E;IAC7E,aAAa,CAAC,EAAE,MAAM,WAAW,GAAG,IAAI,CAAC;IACzC,QAAQ,EAAE,SAAS,CAAC;CACrB,+BA0EA"}
@@ -8,19 +8,8 @@ import { useEffect, useRef, useState } from 'react';
8
8
  // does not move focus (mousedown is cancelled), and a document-wide `focusin` guard pulls focus back if anything outside the window
9
9
  // gets it (a script, a click on a game control that is still reachable).
10
10
  const FOCUSABLE = 'a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])';
11
- /**
12
- * The controls Tab visits, in order. A radio group is one stop (the checked radio, or the first when none is checked), because the
13
- * browser moves between its radios with the arrow keys: counting every radio would make "the first control" the wrong one to wrap at.
14
- */
15
- function tabStops(box) {
16
- const all = [...box.querySelectorAll(FOCUSABLE)];
17
- return all.filter((el) => {
18
- if (!(el instanceof HTMLInputElement) || el.type !== 'radio' || el.name === '')
19
- return true;
20
- const group = all.filter((o) => o instanceof HTMLInputElement && o.type === 'radio' && o.name === el.name);
21
- return el === (group.find((r) => r.checked) ?? group[0]);
22
- });
23
- }
11
+ /** The controls Tab visits, in order. */
12
+ const tabStops = (box) => [...box.querySelectorAll(FOCUSABLE)];
24
13
  export function Dialog({ labelledBy, initialFocus, onEscape, returnFocusTo, children, }) {
25
14
  const box = useRef(null);
26
15
  const fallback = useRef(returnFocusTo);
@@ -1 +1 @@
1
- {"version":3,"file":"Dialog.js","sourceRoot":"","sources":["../../src/Dialog.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAGpD,mIAAmI;AACnI,kIAAkI;AAClI,2EAA2E;AAC3E,EAAE;AACF,mIAAmI;AACnI,oIAAoI;AACpI,yEAAyE;AAEzE,MAAM,SAAS,GAAG,2IAA2I,CAAC;AAE9J;;;GAGG;AACH,SAAS,QAAQ,CAAC,GAAgB;IAChC,MAAM,GAAG,GAAG,CAAC,GAAG,GAAG,CAAC,gBAAgB,CAAc,SAAS,CAAC,CAAC,CAAC;IAC9D,OAAO,GAAG,CA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C,aAAa,CAAC;QACtC,oHAAoH;QACpH,MAAM,MAAM,GAAG,KAAK,CAAC,QAAQ,CAAC,MAAqB,CAAC,CAAC;QACrD,IAAI,CAAC,CAAC,QAAQ,IAAI,CAAC,MAAM,KAAK,KAAK,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC;YAChD,CAAC,CAAC,cAAc,EAAE,CAAC;YACnB,IAAI,CAAC,KAAK,EAAE,CAAC;QACf,CAAC;aAAM,IAAI,CAAC,CAAC,CAAC,QAAQ,IAAI,CAAC,MAAM,KAAK,IAAI,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC;YACvD,CAAC,CAAC,cAAc,EAAE,CAAC;YACnB,KAAK,CAAC,KAAK,EAAE,CAAC;QAChB,CAAC;IACH,CAAC,CAAC;IAEF,OAAO,CACL,cACE,SAAS,EAAC,UAAU,EACpB,WAAW,EAAE,CAAC,CAAC,EAAE,EAAE;YACjB,2HAA2H;YAC3H,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,aAAa;gBAAE,CAAC,CAAC,cAAc,EAAE,CAAC;QACvD,CAAC,YAED,cAAK,GAAG,EAAE,GAAG,EAAE,SAAS,EAAC,WAAW,EAAC,IAAI,EAAC,QAAQ,gBAAY,MAAM,qBAAkB,UAAU,EAAE,QAAQ,EAAE,CAAC,CAAC,EAAE,SAAS,EAAE,SAAS,YACjI,QAAQ,GACL,GACF,CACP,CAAC;AACJ,CAAC"}
@@ -1,10 +1,10 @@
1
+ import type { ReactNode } from 'react';
1
2
  import type { PlayerReporting, ReportDetailResult, ReportResult } from '@chatwarden/core';
2
- import type { ReportFollowUp } from './FollowUp.js';
3
3
  import type { DialogHostProps, PlayerUiProps } from './ui.js';
4
4
  /**
5
5
  * What the player filled in. Your server adds the room and the seats and calls `cw.reports.submit({ ...draft, roomId, reporterSeat,
6
- * targetSeat })`. The dialog sends `reason` (an id from the studio's `reporting` list, or nothing, as in one tap). A reason is only a
7
- * hint: the moderators decide what a report really is.
6
+ * targetSeat })`. The dialog sends `reason` (an id from the studio's `reporting` list, or nothing) and `note` in the one report. A
7
+ * reason is only a hint: the moderators decide what a report really is.
8
8
  */
9
9
  export interface ReportDraft {
10
10
  /** The reason the player chose: an id from `reporting.reasons`. Left out when none was chosen. */
@@ -12,7 +12,14 @@ export interface ReportDraft {
12
12
  /** The note, trimmed; left out when blank. */
13
13
  note?: string;
14
14
  }
15
- export type { ReportFollowUp } from './FollowUp.js';
15
+ /**
16
+ * A reason and a note added to a report after it was filed (`cw.reports.addDetail`). The dialog no longer has a follow-up step (the
17
+ * reason and the note go in the one report), so this is only the shape a follow-up of your own may take.
18
+ */
19
+ export interface ReportFollowUp {
20
+ reason?: string;
21
+ note?: string;
22
+ }
16
23
  export interface ReportDialogProps extends PlayerUiProps, DialogHostProps {
17
24
  /**
18
25
  * Sends the report: your server calls `cw.reports.submit({ ...draft, roomId, reporterSeat, targetSeat })` and returns its
@@ -20,31 +27,38 @@ export interface ReportDialogProps extends PlayerUiProps, DialogHostProps {
20
27
  */
21
28
  onSubmit: (draft: ReportDraft) => Promise<ReportResult>;
22
29
  /**
23
- * The optional follow-up after a one-tap report: your server calls `cw.reports.addDetail(reportId, reporterSeat, detail)` (the seat
24
- * from its own session, never from the page) and returns its `ReportDetailResult`. Without it the "Add a reason" step is not shown.
30
+ * @deprecated The dialog is one step now: the reason and the note go in the single `onSubmit`, so this is accepted but never
31
+ * called. Remove it. (`cw.reports.addDetail` is still there for a follow-up of your own.)
25
32
  */
26
33
  onAddDetail?: (reportId: string, detail: ReportFollowUp) => Promise<ReportDetailResult>;
27
34
  /** Called on Escape, Cancel and Close. Unmount the dialog in answer. */
28
35
  onClose: () => void;
29
36
  /**
30
- * How reporting works here: `(await createPlayerClient.rules()).reporting`, the `reporting` part of `GET /rules`. It sets the flow
31
- * (one tap, pick a reason first, reason required), the reasons (grouped, with hints) and the thank-you. Without it the dialog is
32
- * one tap with the dialog's own words, the same as when `GET /rules` cannot be loaded.
37
+ * How reporting works here: `(await createPlayerClient.rules()).reporting`, the `reporting` part of `GET /rules`. It gives the
38
+ * reasons (grouped, with hints), whether a reason is required, and the thank-you. Without it the dialog has no reasons to offer:
39
+ * one press files the report, with the dialog's own words, the same as when `GET /rules` cannot be loaded.
33
40
  */
34
41
  reporting?: PlayerReporting;
35
42
  /** Who is being reported, as the player knows them (a handle). Shown as text in the heading. */
36
43
  targetName?: string;
37
44
  /** The message being reported. Shown as quoted text (cut if very long) so the player sees what they are reporting. */
38
45
  line?: string;
46
+ /**
47
+ * @experimental Your own controls, placed inside the form under the reason and the note and above Report and Cancel (for example
48
+ * an "Also mute this player" checkbox and a line about false reports). You own their state; the dialog only places them, adds no
49
+ * styling beyond the spacing, and keeps their focusable controls in its Tab order (reason, note, yours, Report, Cancel) and its
50
+ * focus trap. They are not shown once the report is sent. They sit inside the dialog's form, so give your buttons `type="button"`:
51
+ * a plain button, or Enter in a text field of yours, sends the report.
52
+ */
53
+ extra?: ReactNode;
39
54
  }
40
55
  /**
41
- * A dialog for reporting a message or a player. How it works is the studio's setting (`reporting`, from `GET /rules`):
42
- * - `one_tap` (the default): one step, "Report this message?" and a Report button. The report is filed at once and the thank-you
43
- * shown; an optional "Add a reason" step then attaches a reason and a note to the same report (`onAddDetail`).
44
- * - `reason_first`: the reasons in groups, then an optional note; a reason can be skipped.
45
- * - `reason_required`: the same without the skip.
46
- * The reason is only a hint for the moderators. Every refusal the kit can give has its own plain message. Render it when the player
47
- * chooses to report, and unmount it in `onClose`.
56
+ * A dialog for reporting a message or a player, in one step: "Report this message?", the quoted line, an optional "Why?" (one
57
+ * select, the reasons in groups) and a Report button. A note is behind "Add a note", or shown when the chosen reason asks for one.
58
+ * Report sends the reason and the note together (`onSubmit`); the dialog then says "Report sent" and the thank-you. The studio's
59
+ * `reporting` setting decides whether the reason is required (`reason_required`: the select is required, and Report without a
60
+ * reason asks for one and sends nothing), what the reasons are, and the thank-you. The reason is only a hint for the moderators.
61
+ * Every refusal the kit can give has its own plain message. Render it when the player chooses to report, and unmount it in `onClose`.
48
62
  */
49
63
  export declare function ReportDialog(props: ReportDialogProps): import("react").JSX.Element;
50
64
  //# sourceMappingURL=ReportDialog.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ReportDialog.d.ts","sourceRoot":"","sources":["../../src/ReportDialog.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,kBAAkB,EAA6B,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAKrH,OAAO,KAAK,EAAmB,cAAc,EAAE,MAAM,eAAe,CAAC;AAMrE,OAAO,KAAK,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE9D;;;;GAIG;AACH,MAAM,WAAW,WAAW;IAC1B,kGAAkG;IAClG,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,8CAA8C;IAC9C,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,YAAY,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAEpD,MAAM,WAAW,iBAAkB,SAAQ,aAAa,EAAE,eAAe;IACvE;;;OAGG;IACH,QAAQ,EAAE,CAAC,KAAK,EAAE,WAAW,KAAK,OAAO,CAAC,YAAY,CAAC,CAAC;IACxD;;;OAGG;IACH,WAAW,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,cAAc,KAAK,OAAO,CAAC,kBAAkB,CAAC,CAAC;IACxF,wEAAwE;IACxE,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB;;;;OAIG;IACH,SAAS,CAAC,EAAE,eAAe,CAAC;IAC5B,gGAAgG;IAChG,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,sHAAsH;IACtH,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAoCD;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,+BA8MpD"}
1
+ {"version":3,"file":"ReportDialog.d.ts","sourceRoot":"","sources":["../../src/ReportDialog.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAa,SAAS,EAAE,MAAM,OAAO,CAAC;AAClD,OAAO,KAAK,EAAE,eAAe,EAAE,kBAAkB,EAAiB,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAOzG,OAAO,KAAK,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE9D;;;;GAIG;AACH,MAAM,WAAW,WAAW;IAC1B,kGAAkG;IAClG,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,8CAA8C;IAC9C,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,iBAAkB,SAAQ,aAAa,EAAE,eAAe;IACvE;;;OAGG;IACH,QAAQ,EAAE,CAAC,KAAK,EAAE,WAAW,KAAK,OAAO,CAAC,YAAY,CAAC,CAAC;IACxD;;;OAGG;IACH,WAAW,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,cAAc,KAAK,OAAO,CAAC,kBAAkB,CAAC,CAAC;IACxF,wEAAwE;IACxE,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB;;;;OAIG;IACH,SAAS,CAAC,EAAE,eAAe,CAAC;IAC5B,gGAAgG;IAChG,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,sHAAsH;IACtH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;;;OAMG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB;AA6BD;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,+BA0NpD"}
@@ -3,8 +3,6 @@ import { useEffect, useId, useRef, useState } from 'react';
3
3
  import { NOTE_MAX } from './constants.js';
4
4
  import { PlayerError } from './client.js';
5
5
  import { Dialog } from './Dialog.js';
6
- import { DETAIL_REFUSED_TEXT, FollowUp } from './FollowUp.js';
7
- import { Picker } from './Picker.js';
8
6
  import { groupReasons, readReporting } from './reporting.js';
9
7
  import { errorText, Portal, Root, useUi } from './ui.js';
10
8
  // One plain message for each refusal the kit has. Anything else (a refusal a newer kit adds) gets the last one.
@@ -29,73 +27,64 @@ const quoted = (line) => {
29
27
  return plain.length > LINE_MAX ? `${plain.slice(0, LINE_MAX).trimEnd()}…` : plain;
30
28
  };
31
29
  /**
32
- * A dialog for reporting a message or a player. How it works is the studio's setting (`reporting`, from `GET /rules`):
33
- * - `one_tap` (the default): one step, "Report this message?" and a Report button. The report is filed at once and the thank-you
34
- * shown; an optional "Add a reason" step then attaches a reason and a note to the same report (`onAddDetail`).
35
- * - `reason_first`: the reasons in groups, then an optional note; a reason can be skipped.
36
- * - `reason_required`: the same without the skip.
37
- * The reason is only a hint for the moderators. Every refusal the kit can give has its own plain message. Render it when the player
38
- * chooses to report, and unmount it in `onClose`.
30
+ * A dialog for reporting a message or a player, in one step: "Report this message?", the quoted line, an optional "Why?" (one
31
+ * select, the reasons in groups) and a Report button. A note is behind "Add a note", or shown when the chosen reason asks for one.
32
+ * Report sends the reason and the note together (`onSubmit`); the dialog then says "Report sent" and the thank-you. The studio's
33
+ * `reporting` setting decides whether the reason is required (`reason_required`: the select is required, and Report without a
34
+ * reason asks for one and sends nothing), what the reasons are, and the thank-you. The reason is only a hint for the moderators.
35
+ * Every refusal the kit can give has its own plain message. Render it when the player chooses to report, and unmount it in `onClose`.
39
36
  */
40
37
  export function ReportDialog(props) {
41
- const { onSubmit, onAddDetail, onClose, targetName, line, theme, className, container, returnFocusTo } = props;
38
+ const { onSubmit, onClose, targetName, line, theme, className, container, returnFocusTo, extra } = props;
42
39
  const ui = useUi(props);
43
40
  const { t } = ui;
44
41
  const heading = useRef(null);
45
- const picker = useRef(null);
46
- // One thing on its way at a time, report or follow-up: a second click, or a second Enter, does nothing.
42
+ const select = useRef(null);
43
+ const noteField = useRef(null);
44
+ // One report on its way at a time: a second click, or a second Enter, does nothing.
47
45
  const sending = useRef(false);
48
46
  const titleId = useId();
49
- const groupName = useId();
47
+ const reasonId = useId();
50
48
  const noteId = useId();
51
- const hintId = useId();
49
+ const noteHintId = useId();
50
+ const reasonHintId = useId();
52
51
  const missingId = useId();
53
- const [reason, setReason] = useState(null);
52
+ const [reason, setReason] = useState('');
54
53
  const [note, setNote] = useState('');
54
+ // The note is shown once it was asked for (the "Add a note" button, or a reason that asks for one) and then stays.
55
+ const [noteOpen, setNoteOpen] = useState(false);
56
+ const [focusNote, setFocusNote] = useState(false);
55
57
  const [missing, setMissing] = useState(false);
56
58
  const [busy, setBusy] = useState(false);
57
59
  const [failure, setFailure] = useState(null);
58
60
  const [result, setResult] = useState(null);
59
- // How the follow-up after a one-tap report ended, and whether its time is up (the kit takes one until `detailUntil`).
60
- const [dDone, setDDone] = useState(null);
61
- const [expired, setExpired] = useState(false);
62
- const screen = (() => {
63
- // No `reporting` (or something that is not the payload): one tap with the dialog's own words, as when `GET /rules` cannot be loaded.
64
- const read = readReporting(props.reporting) ?? { flow: 'one_tap', reasons: [], thanks: '' };
65
- // A flow that asks for a reason has nothing to ask with when the list is empty: it is one tap.
66
- return { flow: read.reasons.length === 0 ? 'one_tap' : read.flow, reasons: read.reasons, thanks: read.thanks.trim() };
67
- })();
68
- const { flow } = screen;
69
- const groups = groupReasons(screen.reasons);
70
- const chosen = screen.reasons.find((r) => r.id === reason);
71
- // The note: when the chosen reason asks for it.
72
- const showNote = chosen?.asksNote === true;
61
+ // No `reporting` (or something that is not the payload): no reasons to offer, as when `GET /rules` cannot be loaded.
62
+ const read = readReporting(props.reporting) ?? { flow: 'one_tap', reasons: [], thanks: '' };
63
+ const thanks = read.thanks.trim();
64
+ const hasReasons = read.reasons.length > 0;
65
+ // A flow that asks for a reason has nothing to ask with when the list is empty.
66
+ const required = hasReasons && read.flow === 'reason_required';
67
+ const groups = groupReasons(read.reasons);
68
+ const named = groups.filter((g) => g.name !== '');
69
+ const bare = groups.filter((g) => g.name === '').flatMap((g) => g.items);
70
+ // The reason is read from the CURRENT list: if `reporting` changes while the dialog is open and the id the player chose is gone, the
71
+ // select shows the placeholder, and this is undefined, so nothing stale is sent (and a required reason is asked for again).
72
+ const chosen = read.reasons.find((r) => r.id === reason);
73
+ const reasonValue = chosen === undefined ? '' : chosen.id;
74
+ const hint = chosen !== undefined && chosen.hint !== '' ? chosen.hint : null;
75
+ const noteShown = hasReasons && noteOpen;
73
76
  // The form is gone once there is an answer: focus goes back to the heading, so the answer is read and focus is not lost.
74
77
  useEffect(() => {
75
78
  if (result !== null)
76
79
  heading.current?.focus();
77
80
  }, [result]);
81
+ // "Add a note" is replaced by the field: focus follows it.
78
82
  useEffect(() => {
79
- if (dDone !== null)
80
- heading.current?.focus();
81
- }, [dDone]);
82
- // The follow-up stops being offered when the kit would no longer take it.
83
- const until = result?.ok === true && typeof result.detailUntil === 'number' && Number.isFinite(result.detailUntil) ? result.detailUntil : null;
84
- useEffect(() => {
85
- if (until === null)
86
- return undefined;
87
- let timer;
88
- // Looks at the clock again when the time comes, so a clock that has not moved does not end the offer early.
89
- const check = () => {
90
- const left = until - ui.now();
91
- if (left < 0)
92
- setExpired(true);
93
- else
94
- timer = setTimeout(check, Math.min(Math.max(left + 1, 50), 2_000_000_000));
95
- };
96
- check();
97
- return () => clearTimeout(timer);
98
- }, [until]);
83
+ if (focusNote) {
84
+ noteField.current?.focus();
85
+ setFocusNote(false);
86
+ }
87
+ }, [focusNote]);
99
88
  const send = async (draft) => {
100
89
  sending.current = true;
101
90
  setBusy(true);
@@ -116,25 +105,20 @@ export function ReportDialog(props) {
116
105
  e.preventDefault();
117
106
  if (sending.current)
118
107
  return;
119
- if (flow !== 'one_tap' && reason === null) {
108
+ if (required && reasonValue === '') {
120
109
  setMissing(true);
121
- picker.current?.querySelector('input')?.focus();
110
+ select.current?.focus();
122
111
  return;
123
112
  }
124
- const draft = flow === 'one_tap' ? {} : { reason: reason };
125
- if (showNote && trimmed !== '')
113
+ const draft = {};
114
+ if (reasonValue !== '')
115
+ draft.reason = reasonValue;
116
+ if (noteShown && trimmed !== '')
126
117
  draft.note = trimmed;
127
118
  void send(draft);
128
119
  };
129
- const skip = () => {
130
- if (sending.current)
131
- return;
132
- void send(showNote && trimmed !== '' ? { note: trimmed } : {});
133
- };
134
- const reportId = result?.ok === true && typeof result.reportId === 'string' && result.reportId !== '' ? result.reportId : null;
135
120
  const quote = quoted(line);
136
- const oneTapTitle = quote !== '' ? t('player.report.titleOneTap') : targetName === undefined ? t('player.report.titleOneTapPlayer') : t('player.report.titleOneTapNamed', { name: targetName });
137
- const title = flow === 'one_tap' ? oneTapTitle : targetName === undefined ? t('player.report.title') : t('player.report.titleNamed', { name: targetName });
121
+ const title = quote !== '' ? t('player.report.titleOneTap') : targetName === undefined ? t('player.report.titleOneTapPlayer') : t('player.report.titleOneTapNamed', { name: targetName });
138
122
  const taken = result?.ok === true;
139
123
  const refusal = result !== null && !taken ? result : null;
140
124
  // After an answer the heading says what happened (a question would be stale), and focus is on it.
@@ -144,14 +128,19 @@ export function ReportDialog(props) {
144
128
  const refused = r.refused;
145
129
  return typeof refused === 'string' && Object.hasOwn(REFUSED_TEXT, refused) ? REFUSED_TEXT[refused] : 'player.report.refused.unknown';
146
130
  };
147
- const detailRefusedKey = (refused) => (Object.hasOwn(DETAIL_REFUSED_TEXT, refused) ? DETAIL_REFUSED_TEXT[refused] : 'player.report.detail.failed');
148
- const detailUntil = taken && typeof result.detailUntil === 'number' && Number.isFinite(result.detailUntil) ? result.detailUntil : null;
149
- const timeUp = expired || (detailUntil !== null && ui.now() > detailUntil);
150
- const canFollow = taken && flow === 'one_tap' && reportId !== null && onAddDetail !== undefined && screen.reasons.length > 0 && !timeUp;
151
- const needText = flow === 'reason_first' ? 'player.report.needReasonOrSkip' : 'player.report.needReason';
152
- return (_jsx(Portal, { container: container, children: _jsx(Root, { theme: theme, className: className, children: _jsxs(Dialog, { labelledBy: titleId, initialFocus: heading, onEscape: () => !sending.current && onClose(), ...(returnFocusTo === undefined ? {} : { returnFocusTo }), children: [_jsx("h2", { id: titleId, ref: heading, className: "cw-title", tabIndex: -1, children: shownTitle }), _jsxs("div", { role: "status", className: "cw-live", children: [taken && (_jsxs("p", { className: "cw-result", children: [screen.thanks === '' ? t('player.report.thanks') : screen.thanks, remaining !== null && ` ${t('player.report.remaining', { count: remaining })}`] })), dDone?.ok === true && _jsx("p", { className: "cw-result", children: t('player.report.detail.added') })] }), result === null ? (_jsxs("form", { onSubmit: submit, noValidate: true, children: [_jsx("p", { className: "cw-body", children: flow === 'one_tap' ? t('player.report.oneTap.intro') : t('player.report.intro') }), quote !== '' && _jsx("blockquote", { className: "cw-quote", children: t('player.report.quote', { line: quote }) }), flow !== 'one_tap' && (_jsx(Picker, { groups: groups, name: groupName, value: reason, legend: t('player.report.legend'), invalid: missing, describedBy: missingId, fieldset: picker, onChange: (id) => {
153
- setReason(id);
154
- setMissing(false);
155
- } })), missing && (_jsx("p", { id: missingId, className: "cw-field-error", role: "alert", children: t(needText) })), showNote && (_jsxs(_Fragment, { children: [_jsx("label", { className: "cw-label", htmlFor: noteId, children: t('player.report.note') }), _jsx("textarea", { id: noteId, className: "cw-textarea", rows: 4, maxLength: NOTE_MAX, value: note, "aria-describedby": hintId, onChange: (e) => setNote(e.target.value) }), _jsx("p", { id: hintId, className: "cw-hint", children: t('player.report.noteHint', { max: NOTE_MAX }) })] })), failure !== null && (_jsxs("p", { className: "cw-error", role: "alert", children: [t('player.report.failed'), " ", errorText(t, failure)] })), _jsxs("div", { className: "cw-actions", children: [_jsx("button", { type: "submit", className: "cw-btn cw-btn--primary", "aria-disabled": busy || undefined, "aria-busy": busy || undefined, children: flow === 'one_tap' ? t('player.report.oneTap.send') : t('player.report.send') }), flow === 'reason_first' && (_jsx("button", { type: "button", className: "cw-btn", "aria-disabled": busy || undefined, "aria-busy": busy || undefined, onClick: skip, children: t('player.report.skip') })), _jsx("button", { type: "button", className: "cw-btn", "aria-disabled": busy || undefined, onClick: () => !sending.current && onClose(), children: t('player.report.cancel') })] })] })) : (_jsxs(_Fragment, { children: [!taken && (_jsx("p", { className: "cw-error", role: "alert", children: t(refusedKey(refusal)) })), canFollow && dDone === null && (_jsx(FollowUp, { t: t, groups: groups, reportId: reportId, onAddDetail: onAddDetail, sending: sending, busy: busy, onBusy: setBusy, onDone: setDDone })), dDone !== null && !dDone.ok && (_jsx("p", { className: "cw-error", role: "alert", children: t(detailRefusedKey(dDone.refused)) })), _jsx("div", { className: "cw-actions", children: _jsx("button", { type: "button", className: "cw-btn cw-btn--primary", "aria-disabled": busy || undefined, onClick: () => !sending.current && onClose(), children: t('player.report.close') }) })] }))] }) }) }));
131
+ const option = (r) => (_jsx("option", { value: r.id, children: r.label }, r.id));
132
+ const describedBy = [hint === null ? '' : reasonHintId, missing ? missingId : ''].filter((id) => id !== '').join(' ');
133
+ return (_jsx(Portal, { container: container, children: _jsx(Root, { theme: theme, className: className, children: _jsxs(Dialog, { labelledBy: titleId, initialFocus: heading, onEscape: () => !sending.current && onClose(), ...(returnFocusTo === undefined ? {} : { returnFocusTo }), children: [_jsx("h2", { id: titleId, ref: heading, className: "cw-title", tabIndex: -1, children: shownTitle }), _jsx("div", { role: "status", className: "cw-live", children: taken && (_jsxs("p", { className: "cw-result", children: [thanks === '' ? t('player.report.thanks') : thanks, remaining !== null && ` ${t('player.report.remaining', { count: remaining })}`] })) }), result === null ? (_jsxs("form", { onSubmit: submit, noValidate: true, children: [_jsx("p", { className: "cw-body", children: required ? t('player.report.intro') : t('player.report.oneTap.intro') }), quote !== '' && _jsx("blockquote", { className: "cw-quote", children: t('player.report.quote', { line: quote }) }), hasReasons && (_jsxs("div", { className: "cw-field", children: [_jsx("label", { className: "cw-label", htmlFor: reasonId, children: required ? t('player.report.whyRequired') : t('player.report.why') }), _jsxs("select", { id: reasonId, ref: select, className: "cw-select", value: reasonValue, required: required, "aria-invalid": missing || undefined, "aria-describedby": describedBy === '' ? undefined : describedBy, onChange: (e) => {
134
+ const id = e.target.value;
135
+ setReason(id);
136
+ setMissing(false);
137
+ if (read.reasons.find((r) => r.id === id)?.asksNote === true)
138
+ setNoteOpen(true);
139
+ }, children: [_jsx("option", { value: "", children: required ? t('player.report.chooseRequired') : t('player.report.choose') }), named.map((g) => (_jsx("optgroup", { label: g.name, children: g.items.map(option) }, g.name))), bare.map(option)] }), hint !== null && (_jsx("p", { id: reasonHintId, className: "cw-hint", children: hint })), missing && (_jsx("p", { id: missingId, className: "cw-field-error", role: "alert", children: t('player.report.needReason') }))] })), noteShown && (_jsxs("div", { className: "cw-field", children: [_jsx("label", { className: "cw-label", htmlFor: noteId, children: t('player.report.note') }), _jsx("textarea", { id: noteId, ref: noteField, className: "cw-textarea", rows: 3, maxLength: NOTE_MAX, value: note, "aria-describedby": noteHintId, onChange: (e) => setNote(e.target.value) }), _jsx("p", { id: noteHintId, className: "cw-hint", children: t('player.report.noteHint', { max: NOTE_MAX }) })] })), hasReasons && !noteShown && (
140
+ // No aria-expanded: this is a one-way door. It is removed when pressed (the note takes its place) and focus moves to the note.
141
+ _jsx("button", { type: "button", className: "cw-linkbtn", onClick: () => {
142
+ setNoteOpen(true);
143
+ setFocusNote(true);
144
+ }, children: t('player.report.addNote') })), extra !== undefined && extra !== null && extra !== false && _jsx("div", { className: "cw-extra", children: extra }), failure !== null && (_jsxs("p", { className: "cw-error", role: "alert", children: [t('player.report.failed'), " ", errorText(t, failure)] })), _jsxs("div", { className: "cw-actions", children: [_jsx("button", { type: "submit", className: "cw-btn cw-btn--primary", "aria-disabled": busy || undefined, "aria-busy": busy || undefined, children: t('player.report.oneTap.send') }), _jsx("button", { type: "button", className: "cw-btn", "aria-disabled": busy || undefined, onClick: () => !sending.current && onClose(), children: t('player.report.cancel') })] })] })) : (_jsxs(_Fragment, { children: [!taken && (_jsx("p", { className: "cw-error", role: "alert", children: t(refusedKey(refusal)) })), _jsx("div", { className: "cw-actions", children: _jsx("button", { type: "button", className: "cw-btn cw-btn--primary", "aria-disabled": busy || undefined, onClick: () => !sending.current && onClose(), children: t('player.report.close') }) })] }))] }) }) }));
156
145
  }
157
146
  //# sourceMappingURL=ReportDialog.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ReportDialog.js","sourceRoot":"","sources":["../../src/ReportDialog.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAG3D,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,mBAAmB,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAE9D,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAE7D,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AA0CzD,gHAAgH;AAChH,MAAM,YAAY,GAAgD;IAChE,SAAS,EAAE,iCAAiC;IAC5C,IAAI,EAAE,4BAA4B;IAClC,IAAI,EAAE,4BAA4B;IAClC,UAAU,EAAE,kCAAkC;IAC9C,GAAG,EAAE,2BAA2B;IAChC,SAAS,EAAE,iCAAiC;IAC5C,eAAe,EAAE,uCAAuC;IACxD,cAAc,EAAE,sCAAsC;CACvD,CAAC;AAEF,gEAAgE;AAChE,MAAM,QAAQ,GAAG,GAAG,CAAC;AAErB,iIAAiI;AACjI,MAAM,SAAS,GAAG,CAAC,CAAU,EAAe,EAAE,CAC5C,CAAC,YAAY,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,6BA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EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC,OAAO,CAAC,OAAO,IAAI,OAAO,EAAE,YACpH,CAAC,CAAC,sBAAsB,CAAC,GACnB,IACL,IACD,CACR,CAAC,CAAC,CAAC,CACF,8BACG,CAAC,KAAK,IAAI,CACT,YAAG,SAAS,EAAC,UAAU,EAAC,IAAI,EAAC,OAAO,YACjC,CAAC,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,GACrB,CACL,EACD,cAAK,SAAS,EAAC,YAAY,YACzB,iBAAQ,IAAI,EAAC,QAAQ,EAAC,SAAS,EAAC,wBAAwB,mBAAgB,IAAI,IAAI,SAAS,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC,OAAO,CAAC,OAAO,IAAI,OAAO,EAAE,YACpI,CAAC,CAAC,qBAAqB,CAAC,GAClB,GACL,IACL,CACJ,IACM,GACJ,GACE,CACV,CAAC;AACJ,CAAC"}
@@ -59,9 +59,12 @@ export declare const en: {
59
59
  readonly 'player.restricted.filter.noEnd': "Your chat is off. It does not end on its own. The automatic filter caught a message.";
60
60
  readonly 'player.restricted.ended': "Your chat is back on. The restriction ended {when}.";
61
61
  readonly 'player.restricted.ref': "Reference {code}";
62
+ /** @deprecated unused since 0.1.3; removed in a later minor */
62
63
  readonly 'player.report.title': "Report a player";
64
+ /** @deprecated unused since 0.1.3; removed in a later minor */
63
65
  readonly 'player.report.titleNamed': "Report {name}";
64
- readonly 'player.report.intro': "Tell us what happened and a moderator will look at it.";
66
+ readonly 'player.report.intro': "Tell us why and a moderator will look at it.";
67
+ /** @deprecated unused since 0.1.3; removed in a later minor */
65
68
  readonly 'player.report.legend': "What happened?";
66
69
  readonly 'player.report.titleOneTap': "Report this message?";
67
70
  readonly 'player.report.titleOneTapNamed': "Report {name}?";
@@ -71,24 +74,45 @@ export declare const en: {
71
74
  readonly 'player.report.oneTap.intro': "We will pass it to the moderators. You do not need to say why.";
72
75
  readonly 'player.report.oneTap.send': "Report";
73
76
  readonly 'player.report.quote': "“{line}”";
77
+ /** @deprecated unused since 0.1.3; removed in a later minor */
74
78
  readonly 'player.report.skip': "Skip and report";
75
79
  readonly 'player.report.needReason': "Choose a reason.";
80
+ /** @deprecated unused since 0.1.3; removed in a later minor */
76
81
  readonly 'player.report.needReasonOrSkip': "Choose what happened, or skip.";
82
+ /** @deprecated unused since 0.1.3; removed in a later minor */
77
83
  readonly 'player.report.addReason': "Add a reason";
84
+ /** @deprecated unused since 0.1.3; removed in a later minor */
78
85
  readonly 'player.report.addReasonHint': "This helps, but the moderators decide what it really is. You can add this for a few minutes after you report.";
86
+ /** @deprecated unused since 0.1.3; removed in a later minor */
79
87
  readonly 'player.report.detail.legend': "What was it about?";
88
+ /** @deprecated unused since 0.1.3; removed in a later minor */
80
89
  readonly 'player.report.detail.send': "Add to my report";
90
+ /** @deprecated unused since 0.1.3; removed in a later minor */
81
91
  readonly 'player.report.detail.need': "Choose a reason or write a note.";
92
+ /** @deprecated unused since 0.1.3; removed in a later minor */
82
93
  readonly 'player.report.detail.added': "Added. Thanks.";
94
+ /** @deprecated unused since 0.1.3; removed in a later minor */
83
95
  readonly 'player.report.detail.failed': "We could not add that.";
96
+ /** @deprecated unused since 0.1.3; removed in a later minor */
84
97
  readonly 'player.report.detail.refused.off': "Adding to a report is not available right now.";
98
+ /** @deprecated unused since 0.1.3; removed in a later minor */
85
99
  readonly 'player.report.detail.refused.not_found': "We cannot find that report any more.";
100
+ /** @deprecated unused since 0.1.3; removed in a later minor */
86
101
  readonly 'player.report.detail.refused.not_reporter': "Only the player who sent a report can add to it.";
102
+ /** @deprecated unused since 0.1.3; removed in a later minor */
87
103
  readonly 'player.report.detail.refused.too_late': "It is too late to add to this report. We still have the report.";
104
+ /** @deprecated unused since 0.1.3; removed in a later minor */
88
105
  readonly 'player.report.detail.refused.already_added': "You already added to this report.";
106
+ /** @deprecated unused since 0.1.3; removed in a later minor */
89
107
  readonly 'player.report.detail.refused.reason_unknown': "That reason is not available any more. Your report is still with us.";
90
- readonly 'player.report.note': "Add a note (optional)";
108
+ readonly 'player.report.note': "Note (optional)";
109
+ readonly 'player.report.addNote': "Add a note";
110
+ readonly 'player.report.why': "Why? (optional)";
111
+ readonly 'player.report.whyRequired': "Why?";
112
+ readonly 'player.report.choose': "Choose a reason (optional)";
113
+ readonly 'player.report.chooseRequired': "Choose a reason";
91
114
  readonly 'player.report.noteHint': "A moderator will read this. Up to {max} characters. Do not include passwords or personal details.";
115
+ /** @deprecated unused since 0.1.3; removed in a later minor */
92
116
  readonly 'player.report.send': "Send report";
93
117
  readonly 'player.report.cancel': "Cancel";
94
118
  readonly 'player.report.close': "Close";