@johnmorrisdotca/kyogijo-stadiums 0.18.1 → 0.19.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/CHANGELOG.md +18 -0
- package/README.md +33 -19
- package/dist/common.d.ts +5 -0
- package/dist/common.js +6 -1
- package/dist/judging-entry.d.ts +6 -1
- package/dist/judging-entry.js +5 -1
- package/dist/judging.board.d.ts +26 -0
- package/dist/judging.board.js +125 -0
- package/dist/judging.broadcast.d.ts +6 -0
- package/dist/judging.broadcast.js +72 -0
- package/dist/judging.d.ts +5 -0
- package/dist/judging.draw.d.ts +19 -6
- package/dist/judging.draw.js +14 -104
- package/dist/judging.js +14 -2
- package/dist/judging.mount.d.ts +16 -0
- package/dist/judging.mount.js +69 -0
- package/dist/judging.plan.d.ts +52 -0
- package/dist/judging.plan.js +91 -0
- package/dist/judging.print.d.ts +58 -0
- package/dist/judging.print.js +86 -0
- package/dist/judging.style.d.ts +5 -0
- package/dist/judging.style.js +22 -0
- package/dist/judging.text.d.ts +7 -0
- package/dist/judging.text.js +23 -0
- package/dist/judging.types.d.ts +9 -0
- package/dist/judging.words.d.ts +1 -0
- package/dist/judging.words.js +2 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// What a judging picture says in words: the title and the description of an assignment, each mat with each seat and who is in it. Shared by the plan view, the broadcast view and the 3D view.
|
|
2
|
+
import { JUDGING_WORDS } from "./judging.words.js";
|
|
3
|
+
import { fill } from "./strings.js";
|
|
4
|
+
/** The sentence that names one seat and who sits in it. */
|
|
5
|
+
function seatSentence(a, setting) {
|
|
6
|
+
const w = JUDGING_WORDS[setting.language].say;
|
|
7
|
+
const seat = a.seat.label[setting.language];
|
|
8
|
+
if (!a.assigned)
|
|
9
|
+
return fill(w.seatVacant, { seat });
|
|
10
|
+
if (a.id === "")
|
|
11
|
+
return fill(w.seatNoId, { seat, name: a.name });
|
|
12
|
+
return fill(w.seat, { seat, name: a.name === "" ? "—" : a.name, id: a.id });
|
|
13
|
+
}
|
|
14
|
+
/** The title and the description of an assignment: each mat with each seat and who is in it. */
|
|
15
|
+
export function judgingText(setting, options, chart, view = setting.view) {
|
|
16
|
+
const words = JUDGING_WORDS[setting.language];
|
|
17
|
+
const style = fill(words.styleName[setting.style], { count: setting.mats[0].seats.length });
|
|
18
|
+
const mats = setting.total === 1 ? words.say.matsOne : fill(words.say.matsMany, { n: setting.total });
|
|
19
|
+
const title = options.title ?? fill(words.say.title, { style, mats });
|
|
20
|
+
const sentences = setting.mats.map((m) => fill(words.say.mat, { label: m.label, seats: m.seats.map((a) => seatSentence(a, setting)).join(words.say.join) }));
|
|
21
|
+
const description = options.description ?? [...sentences, view === "broadcast" ? words.say.board : chart && setting.seatNames ? words.say.names : words.say.chartOnly].join(setting.language === "ja" ? "" : " ");
|
|
22
|
+
return { title, description };
|
|
23
|
+
}
|
package/dist/judging.types.d.ts
CHANGED
|
@@ -15,6 +15,8 @@ export interface JudgingMat {
|
|
|
15
15
|
label?: string;
|
|
16
16
|
/** Who sits where. A seat that is not named is shown as not assigned. */
|
|
17
17
|
officials?: readonly JudgingOfficial[];
|
|
18
|
+
/** A line for the broadcast board's foot, before the style: `Round 2`, `Pool B`, `Final block`. At most 60 characters. */
|
|
19
|
+
line?: string;
|
|
18
20
|
}
|
|
19
21
|
/** A judging assignment as the drawing asks for it. */
|
|
20
22
|
export interface JudgingOptions {
|
|
@@ -33,6 +35,11 @@ export interface JudgingOptions {
|
|
|
33
35
|
* evenly (never stretched or condensed), in the biggest size that fits its card and no smaller than a readable one; a seat whose name does not fit shows its number alone.
|
|
34
36
|
*/
|
|
35
37
|
seatNames?: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* What is drawn: the `plan` with its chart (the default, the layout to print) or the `broadcast` picture: the mat large, as a television would show it, with the officials on a board at its side like a graphic, the seats' number
|
|
40
|
+
* badges where the officials sit, and no chart. The picture is 16:9 and scales as a whole, type and all, so it is as sharp on a tablet as on a television.
|
|
41
|
+
*/
|
|
42
|
+
view?: "plan" | "broadcast";
|
|
36
43
|
/** Where the chart is laid: beside the plan (`landscape`, the default) or under it (`portrait`). */
|
|
37
44
|
orientation?: "landscape" | "portrait";
|
|
38
45
|
/** What the plan shows: the whole `mat` (the default) or the judges' `bench`, close up, so that the names in the seats are as large as they can be. */
|
|
@@ -79,5 +86,7 @@ export interface JudgingResolved {
|
|
|
79
86
|
/** From 1. */
|
|
80
87
|
n: number;
|
|
81
88
|
label: string;
|
|
89
|
+
/** The line for the broadcast board's foot; empty when there is none. */
|
|
90
|
+
line: string;
|
|
82
91
|
seats: JudgingAssignment[];
|
|
83
92
|
}
|
package/dist/judging.words.d.ts
CHANGED
package/dist/judging.words.js
CHANGED
|
@@ -13,6 +13,7 @@ export const JUDGING_WORDS = {
|
|
|
13
13
|
seatVacant: "{seat} not assigned",
|
|
14
14
|
names: "The names are in the seats where they fit, and in the chart of mat, seat, name and ID.",
|
|
15
15
|
chartOnly: "The names are in the chart of mat, seat, name and ID.",
|
|
16
|
+
board: "The officials are listed on a board at the side of the mat, each with the number of the seat, name and ID; the numbers are on the seats.",
|
|
16
17
|
join: "; ",
|
|
17
18
|
},
|
|
18
19
|
table: { caption: "{title}", mat: "Mat", seat: "Seat", name: "Name", id: "ID" },
|
|
@@ -32,6 +33,7 @@ export const JUDGING_WORDS = {
|
|
|
32
33
|
seatVacant: "{seat}は未定",
|
|
33
34
|
names: "氏名は、席に収まる場合は各席の中に表示し、試合場・席・氏名・IDの一覧表にも載せています。",
|
|
34
35
|
chartOnly: "氏名は、試合場・席・氏名・IDの一覧表に載せています。",
|
|
36
|
+
board: "審判員は、席の番号・氏名・IDとともに試合場の横の表示板に載せ、席の番号は各席に表示しています。",
|
|
35
37
|
join: "、",
|
|
36
38
|
},
|
|
37
39
|
table: { caption: "{title}", mat: "試合場", seat: "席", name: "氏名", id: "ID" },
|
package/dist/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/** The package's version: the same as package.json's, and a test holds them to each other. */
|
|
2
|
-
export declare const VERSION = "0.
|
|
2
|
+
export declare const VERSION = "0.19.0";
|
package/dist/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/** The package's version: the same as package.json's, and a test holds them to each other. */
|
|
2
|
-
export const VERSION = "0.
|
|
2
|
+
export const VERSION = "0.19.0";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@johnmorrisdotca/kyogijo-stadiums",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.19.0",
|
|
4
4
|
"description": "Kyogijo Stadiums 競技場, 39 sports' surfaces as SVG, drawn to scale from the rulebooks: NFL, CFL and IFAF football fields, an NHL rink, an NBA court, MLB ballparks, soccer pitches, curling sheets, athletics stadiums, speed skating, short track and figure skating rinks, swimming pools, water polo fields, diving wells, artistic swimming areas, and the courts and fields of tennis, volleyball (indoor, beach and sitting), badminton, pickleball, table tennis, padel, squash, racquetball, sepak takraw, teqball, roundnet, netball, lacrosse, rugby, Australian football, Gaelic games, cricket, field hockey and handball, and the budo of judo, karate, kendo, sumo and kyudo with a dojo of tatami laid as real units, with each team's name and logo on its side and the score in the middle, stands and a crowd, a pageant of flags, and a 3D view. Light and dark, accessible, a compact badge for lists, a helper for React and a custom element. Zero dependencies.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"sports",
|