@johnmorrisdotca/dougu-sports 0.3.2 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/CHANGELOG.md +18 -1
  2. package/NOTICE.md +1 -0
  3. package/README.md +6 -5
  4. package/dist/emblems/ball/ball.art.d.ts +24 -0
  5. package/dist/emblems/ball/ball.art.js +67 -0
  6. package/dist/emblems/ball/ball.core.d.ts +6 -0
  7. package/dist/emblems/ball/ball.core.js +12 -1
  8. package/dist/emblems/ball/ball.face.d.ts +54 -0
  9. package/dist/emblems/ball/ball.face.js +287 -0
  10. package/dist/emblems/ball/ball.image.d.ts +8 -0
  11. package/dist/emblems/ball/ball.image.js +122 -0
  12. package/dist/emblems/ball/ball.index.d.ts +3 -1
  13. package/dist/emblems/ball/ball.index.js +7 -5
  14. package/dist/emblems/ball/ball.letters.d.ts +32 -0
  15. package/dist/emblems/ball/ball.letters.js +142 -0
  16. package/dist/emblems/ball/ball.object.js +1 -1
  17. package/dist/emblems/ball/ball.puck.d.ts +8 -0
  18. package/dist/emblems/ball/ball.puck.js +19 -12
  19. package/dist/emblems/ball/ball.puck.print.d.ts +76 -0
  20. package/dist/emblems/ball/ball.puck.print.js +46 -0
  21. package/dist/emblems/ball/ball.signature.d.ts +4 -0
  22. package/dist/emblems/ball/ball.signature.js +58 -0
  23. package/dist/emblems/ball/ball.stack.d.ts +10 -0
  24. package/dist/emblems/ball/ball.stack.js +8 -1
  25. package/dist/emblems/emblem.api.d.ts +5 -5
  26. package/dist/emblems/emblem.api.js +27 -8
  27. package/dist/emblems/emblem.core.d.ts +6 -0
  28. package/dist/emblems/emblem.descriptions.js +8 -0
  29. package/dist/emblems/emblem.ids.d.ts +6 -1
  30. package/dist/emblems/emblem.ids.js +4 -1
  31. package/dist/emblems/emblem.registry.js +2 -2
  32. package/dist/emblems-entry.d.ts +3 -2
  33. package/dist/emblems-entry.js +1 -1
  34. package/dist/index.d.ts +1 -0
  35. package/dist/index.js +1 -0
  36. package/dist/version.d.ts +1 -1
  37. package/dist/version.js +1 -1
  38. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  import type { Emblem, EmblemLocale, EmblemOptions, EmblemStyle, EmblemTheme, FrameOptions } from "./emblem.core.ts";
2
- import { type BallId, type CrestShape, type EmblemId, type MedalKind, type SportName } from "./emblem.ids.ts";
2
+ import { type BallId, type PuckId, type CrestShape, type EmblemId, type MedalKind, type SportName } from "./emblem.ids.ts";
3
3
  import type { PieceSize } from "./ball/ball.core.ts";
4
4
  import { type EmblemDescription } from "./emblem.descriptions.ts";
5
5
  /** What can name an emblem: an id, a short name (`"cup"` for `"trophy:cup"`), either with a style (`"trophy:cup/line"`), or the emblem itself. */
@@ -40,10 +40,10 @@ export declare const emblemSvg: typeof renderEmblem;
40
40
  * ```
41
41
  */
42
42
  export declare function emblemFrame(ref: EmblemRef, options?: FrameOptions): string;
43
- /** Whether a value is the id of a ball. */
44
- export declare const isBallId: (value: unknown) => value is BallId;
45
- /** A ball rolled: the same as `emblemFrame`, for a ball's id only. A value that is not a ball is an error. */
46
- export declare function ballFrame(id: BallId, options?: FrameOptions): string;
43
+ /** Whether a value is the id of a ball (a printed puck, `puck:canada`, is a ball too). */
44
+ export declare const isBallId: (value: unknown) => value is BallId | PuckId;
45
+ /** A ball rolled: the same as `emblemFrame`, for a ball's id only (a printed puck's too). A value that is not a ball is an error. */
46
+ export declare function ballFrame(id: BallId | PuckId, options?: FrameOptions): string;
47
47
  /** Every emblem as markup in the metal style at 64 pixels, by id. Use `renderEmblem` for another style or size. */
48
48
  export declare const EMBLEMS: Readonly<Record<EmblemId, string>>;
49
49
  /** What an emblem is, without its drawing. */
@@ -1,5 +1,5 @@
1
1
  import { EMBLEM_STYLES } from "./emblem.core.js";
2
- import { BALL_IDS, CREST_SHAPES, EMBLEM_ALIASES, EMBLEM_IDS } from "./emblem.ids.js";
2
+ import { BALL_IDS, CREST_SHAPES, EMBLEM_ALIASES, EMBLEM_IDS, PUCK_IDS } from "./emblem.ids.js";
3
3
  import { EMBLEM_DESCRIPTIONS } from "./emblem.descriptions.js";
4
4
  import { EMBLEM_TABLE } from "./emblem.registry.js";
5
5
  /** The id and style a string names, or `undefined` when it is not an emblem. An id may end in `/metal`, `/line` or `/color`, and a trophy or an award may be written without its group (`cup`, `crown`). */
@@ -35,6 +35,22 @@ export function emblemOf(ref) {
35
35
  return { emblem: EMBLEM_TABLE[parsed.id], style: parsed.style };
36
36
  }
37
37
  const withStyle = (style, options) => (style === undefined || options?.style !== undefined ? options : { ...options, style });
38
+ /**
39
+ * The print a puck is asked for, with an emblem id turned into the drawing it names (a puck module cannot see the registry, so it is done here) and a plain `ball:puck` that was given a face drawn as the souvenir puck,
40
+ * which is the generic one. Anything else is as it came.
41
+ */
42
+ function printed(emblem, options) {
43
+ const face = options?.face;
44
+ if (typeof face !== "object" || face === null)
45
+ return { emblem, options };
46
+ const target = emblem.id === "ball:puck" ? EMBLEM_TABLE["puck:souvenir"] : emblem;
47
+ if (!target.id.startsWith("puck:"))
48
+ return { emblem, options };
49
+ const id = typeof face.emblem === "string" ? parseEmblem(face.emblem)?.id : undefined;
50
+ // The emblem is drawn flat in colour at a size that is plenty for the middle of a puck; a puck inside a puck is left plain (no face passed on).
51
+ const inner = id === undefined || face.image !== undefined ? undefined : EMBLEM_TABLE[id].svg({ title: false, style: "metal", grain: false, size: 160 });
52
+ return { emblem: target, options: inner === undefined ? options : { ...options, face: { ...face, image: inner } } };
53
+ }
38
54
  /**
39
55
  * An emblem as a document of SVG: `renderEmblem("award:medal")`, `renderEmblem("ball:soccer/line", { size: 20 })`. `style` is `metal` (full colour with gradients, the default), `line` (one outline in the
40
56
  * page's text colour) or `color` (flat fills); `tint` replaces the main colour; `theme` is `inherit` (the default), `auto`, `light` or `dark`. A pure function: the same arguments give the same string.
@@ -48,7 +64,8 @@ const withStyle = (style, options) => (style === undefined || options?.style !==
48
64
  */
49
65
  export function renderEmblem(ref, options) {
50
66
  const { emblem, style } = emblemOf(ref);
51
- return emblem.svg(withStyle(style, options));
67
+ const p = printed(emblem, withStyle(style, options));
68
+ return p.emblem.svg(p.options);
52
69
  }
53
70
  /** The same as `renderEmblem`. */
54
71
  export const emblemSvg = renderEmblem;
@@ -63,15 +80,17 @@ export const emblemSvg = renderEmblem;
63
80
  */
64
81
  export function emblemFrame(ref, options) {
65
82
  const { emblem, style } = emblemOf(ref);
66
- return emblem.frame(withStyle(style, options));
83
+ const p = printed(emblem, withStyle(style, options));
84
+ return p.emblem.frame(p.options);
67
85
  }
68
- /** Whether a value is the id of a ball. */
69
- export const isBallId = (value) => typeof value === "string" && BALL_IDS.includes(value);
70
- /** A ball rolled: the same as `emblemFrame`, for a ball's id only. A value that is not a ball is an error. */
86
+ /** Whether a value is the id of a ball (a printed puck, `puck:canada`, is a ball too). */
87
+ export const isBallId = (value) => typeof value === "string" && (BALL_IDS.includes(value) || PUCK_IDS.includes(value));
88
+ /** A ball rolled: the same as `emblemFrame`, for a ball's id only (a printed puck's too). A value that is not a ball is an error. */
71
89
  export function ballFrame(id, options) {
72
90
  if (!isBallId(id))
73
- throw new Error(`"${String(id).slice(0, 60)}" is not a ball: ids look like "ball:soccer"; see BALL_IDS.`);
74
- return EMBLEM_TABLE[id].frame(options);
91
+ throw new Error(`"${String(id).slice(0, 60)}" is not a ball: ids look like "ball:soccer" or "puck:canada"; see BALL_IDS and PUCK_IDS.`);
92
+ const p = printed(EMBLEM_TABLE[id], options);
93
+ return p.emblem.frame(p.options);
75
94
  }
76
95
  /** Every emblem as markup in the metal style at 64 pixels, by id. Use `renderEmblem` for another style or size. */
77
96
  export const EMBLEMS = Object.freeze(Object.fromEntries(EMBLEM_IDS.map((id) => [id, EMBLEM_TABLE[id].svg()])));
@@ -1,3 +1,4 @@
1
+ import type { PuckFace } from "./ball/ball.face.ts";
1
2
  /** `metal`: full colour with a gradient. `line`: one outline in `currentColor`. `color`: flat fills of the main colour, with no gradient. */
2
3
  export type EmblemStyle = "metal" | "line" | "color";
3
4
  export declare const EMBLEM_STYLES: readonly ["metal", "line", "color"];
@@ -50,6 +51,11 @@ export interface EmblemOptions {
50
51
  * box and every turned frame (`frame`) is in the box of the turn, so nothing is cut off while it turns and the size does not change from one angle to the next.
51
52
  */
52
53
  turnBox?: boolean;
54
+ /**
55
+ * The print on the top face of a puck: the printed pucks (`puck:*`) start from a face of their own and this replaces any part of it, and `ball:puck` given a face is drawn as `puck:souvenir` with it. `image` takes any SVG
56
+ * (made safe first), `emblem` a dougu id, `flag` a country code (`ca` and `us` are drawn here; another needs `flags`, a renderer like hata's). See `PuckFace`. Anything that is not a puck ignores it.
57
+ */
58
+ face?: PuckFace;
53
59
  }
54
60
  /** A turn, in degrees from the resting view (0 and 0 is the still drawing): `yaw` about the vertical axis, `pitch` the tilt toward the eye. */
55
61
  export interface FrameOptions extends EmblemOptions {
@@ -52,6 +52,14 @@ export const EMBLEM_DESCRIPTIONS = {
52
52
  "ball:squash-blue": { en: "Squash ball, blue dot", ja: "スカッシュボール(ブルードット)" },
53
53
  "ball:shuttlecock-feather": { en: "Shuttlecock, feather", ja: "シャトルコック(水鳥の羽根)" },
54
54
  "ball:shuttlecock-nylon": { en: "Shuttlecock, nylon", ja: "シャトルコック(ナイロン)" },
55
+ "puck:canada": { en: "Black puck printed with our own flag of the Canadian pattern, CANADA under it and a red ring of words", ja: "黒いパックの天面に、独自に描いたカナダ風の旗とその下の CANADA の文字、縁には文字の入った赤い輪を印刷したもの" },
56
+ "puck:canada-red": { en: "Black puck printed with a red face, a big white maple leaf of our own drawing, CANADA under it and a dark ring of words", ja: "黒いパックの天面に、赤地に白い大きなメープルの葉(独自の絵)、その下の CANADA の文字、縁には文字の入った暗い輪を印刷したもの" },
57
+ "puck:canada-white": { en: "Black puck printed with a white face, red bands left and right, a big red maple leaf and CANADA under it", ja: "黒いパックの天面に、白地に左右の赤い帯、大きな赤いメープルの葉とその下の CANADA の文字を印刷したもの" },
58
+ "puck:usa": { en: "Black puck printed with a disc of stars and stripes, USA lettered across it and a navy ring of words", ja: "黒いパックの天面に、星と縞模様の円盤、その上に大きく書いた USA の文字、縁には文字の入った紺の輪を印刷したもの" },
59
+ "puck:usa-navy": { en: "Black puck printed with a navy face, a red ring with a white rim, five stars and USA in big white letters", ja: "黒いパックの天面に、紺地に白い細線にはさまれた赤い輪、5 つの星、大きな白い USA の文字を印刷したもの" },
60
+ "puck:player": { en: "Black puck printed like a jersey: a made-up surname round the top, a big number and a gold ring", ja: "ジャージのように、縁の上側に沿った架空の姓、大きな背番号、金色の輪を印刷した黒いパック" },
61
+ "puck:signed": { en: "The navy puck with a made-up gold marker signature across the face, drawn by a seeded pen and never a real person's hand", ja: "紺地のパックの天面に、金色のマーカーで書いたような架空のサインを重ねたもの(シード値から描くので、実在の人物の筆跡ではない)" },
62
+ "puck:souvenir": { en: "A generic souvenir puck: a cream face, a navy ring of words you choose and a star, or your own picture", ja: "汎用の記念パック。クリーム色の地に、好きな文字を入れた紺の輪と星(または自分で用意した絵)" },
55
63
  "gear:hockey-stick": { en: "Hockey stick and puck", ja: "アイスホッケーのスティックとパック" },
56
64
  "gear:goalie-stick": { en: "Ice hockey goalie stick", ja: "アイスホッケーのゴーリーのスティック" },
57
65
  "gear:hockey-skate": { en: "Hockey skate", ja: "アイスホッケーのスケート靴" },
@@ -20,6 +20,9 @@ export type CrestId = (typeof CREST_IDS)[number];
20
20
  /** The balls: one for each ball and implement the sports use, in 3D, with the official size it comes from. The balls of one family (the three crickets, the five squash balls) share a module. */
21
21
  export declare const BALL_IDS: readonly ["ball:soccer", "ball:soccer-colour", "ball:soccer-26", "ball:soccer-18", "ball:soccer-14", "ball:soccer-12", "ball:soccer-6", "ball:soccer-orange", "ball:soccer-26-orange", "ball:soccer-18-orange", "ball:soccer-14-orange", "ball:soccer-12-orange", "ball:soccer-6-orange", "ball:soccer-yellow", "ball:soccer-26-yellow", "ball:soccer-18-yellow", "ball:soccer-14-yellow", "ball:soccer-12-yellow", "ball:soccer-6-yellow", "ball:futsal", "ball:beach-soccer", "ball:teqball", "ball:basketball", "ball:basketball-6", "ball:basketball-3x3", "ball:baseball", "ball:softball", "ball:tennis", "ball:padel", "ball:sliotar", "ball:volleyball", "ball:volleyball-8", "ball:beach-volleyball", "ball:cricket-red", "ball:cricket-white", "ball:cricket-pink", "ball:football", "ball:football-cfl", "ball:football-ifaf", "ball:rugby", "ball:afl", "ball:gaelic-football", "ball:netball", "ball:pickleball-outdoor", "ball:pickleball-indoor", "ball:squash", "ball:squash-yellow", "ball:squash-green", "ball:squash-red", "ball:squash-blue", "ball:racquetball", "ball:lacrosse", "ball:field-hockey", "ball:table-tennis", "ball:handball", "ball:water-polo", "ball:golf", "ball:puck", "ball:curling-stone", "ball:shot", "ball:discus", "ball:hammer", "ball:sepak-takraw", "ball:roundnet", "ball:shuttlecock-feather", "ball:shuttlecock-nylon"];
22
22
  export type BallId = (typeof BALL_IDS)[number];
23
+ /** The printed pucks: the same puck as `ball:puck` with a print on its top face (a flag, a leaf, stars and stripes, a player's name and number, a made-up signature, a souvenir's ring of words). All drawn here, none a team's or a league's own. */
24
+ export declare const PUCK_IDS: readonly ["puck:canada", "puck:canada-red", "puck:canada-white", "puck:usa", "puck:usa-navy", "puck:player", "puck:signed", "puck:souvenir"];
25
+ export type PuckId = (typeof PUCK_IDS)[number];
23
26
  /** The pieces of gear: a piece of equipment for each sport, flat, drawn for this package, turning like a coin. */
24
27
  export declare const GEAR_IDS: readonly ["gear:hockey-stick", "gear:goalie-stick", "gear:hockey-skate", "gear:goalie-mask", "gear:goal-net", "gear:field-hockey-stick", "gear:lacrosse-stick", "gear:cricket-bat", "gear:wicket", "gear:table-tennis-paddle", "gear:badminton-racket", "gear:tennis-racket", "gear:squash-racket", "gear:racquetball-racket", "gear:padel-racket", "gear:pickleball-paddle", "gear:roundnet-set", "gear:volleyball-net", "gear:basketball-hoop", "gear:baseball-bat", "gear:baseball-glove", "gear:football-helmet", "gear:goalposts", "gear:hurley", "gear:curling-broom", "gear:figure-skate", "gear:speed-skate", "gear:diving-board", "gear:swim-goggles", "gear:starting-blocks", "gear:relay-baton", "gear:javelin", "gear:hurdles", "gear:gunbai", "gear:mawashi", "gear:shinai", "gear:kendo-men", "gear:judogi", "gear:obi", "gear:yumi", "gear:ya", "gear:karate-gi"];
25
28
  export type GearId = (typeof GEAR_IDS)[number];
@@ -33,7 +36,7 @@ export type PennantId = (typeof PENNANT_IDS)[number];
33
36
  export type SportEmblemId = `sport:${SportName}`;
34
37
  export declare const SPORT_IDS: readonly SportEmblemId[];
35
38
  /** Every emblem id. */
36
- export type EmblemId = AwardId | TrophyId | MedalId | CrestId | BallId | GearId | SportEmblemId | PennantId;
39
+ export type EmblemId = AwardId | TrophyId | MedalId | CrestId | BallId | PuckId | GearId | SportEmblemId | PennantId;
37
40
  /** The groups of ids, in the order a gallery shows them. */
38
41
  export declare const EMBLEM_GROUPS: {
39
42
  readonly award: readonly ["award:medal", "award:badge", "award:crown", "award:star", "award:shield"];
@@ -41,6 +44,7 @@ export declare const EMBLEM_GROUPS: {
41
44
  readonly medal: readonly ["medal:gold", "medal:silver", "medal:bronze", "medal:place-1", "medal:place-2", "medal:place-3"];
42
45
  readonly crest: readonly ["crest:shield", "crest:roundel", "crest:diamond", "crest:pennant"];
43
46
  readonly ball: readonly ["ball:soccer", "ball:soccer-colour", "ball:soccer-26", "ball:soccer-18", "ball:soccer-14", "ball:soccer-12", "ball:soccer-6", "ball:soccer-orange", "ball:soccer-26-orange", "ball:soccer-18-orange", "ball:soccer-14-orange", "ball:soccer-12-orange", "ball:soccer-6-orange", "ball:soccer-yellow", "ball:soccer-26-yellow", "ball:soccer-18-yellow", "ball:soccer-14-yellow", "ball:soccer-12-yellow", "ball:soccer-6-yellow", "ball:futsal", "ball:beach-soccer", "ball:teqball", "ball:basketball", "ball:basketball-6", "ball:basketball-3x3", "ball:baseball", "ball:softball", "ball:tennis", "ball:padel", "ball:sliotar", "ball:volleyball", "ball:volleyball-8", "ball:beach-volleyball", "ball:cricket-red", "ball:cricket-white", "ball:cricket-pink", "ball:football", "ball:football-cfl", "ball:football-ifaf", "ball:rugby", "ball:afl", "ball:gaelic-football", "ball:netball", "ball:pickleball-outdoor", "ball:pickleball-indoor", "ball:squash", "ball:squash-yellow", "ball:squash-green", "ball:squash-red", "ball:squash-blue", "ball:racquetball", "ball:lacrosse", "ball:field-hockey", "ball:table-tennis", "ball:handball", "ball:water-polo", "ball:golf", "ball:puck", "ball:curling-stone", "ball:shot", "ball:discus", "ball:hammer", "ball:sepak-takraw", "ball:roundnet", "ball:shuttlecock-feather", "ball:shuttlecock-nylon"];
47
+ readonly puck: readonly ["puck:canada", "puck:canada-red", "puck:canada-white", "puck:usa", "puck:usa-navy", "puck:player", "puck:signed", "puck:souvenir"];
44
48
  readonly gear: readonly ["gear:hockey-stick", "gear:goalie-stick", "gear:hockey-skate", "gear:goalie-mask", "gear:goal-net", "gear:field-hockey-stick", "gear:lacrosse-stick", "gear:cricket-bat", "gear:wicket", "gear:table-tennis-paddle", "gear:badminton-racket", "gear:tennis-racket", "gear:squash-racket", "gear:racquetball-racket", "gear:padel-racket", "gear:pickleball-paddle", "gear:roundnet-set", "gear:volleyball-net", "gear:basketball-hoop", "gear:baseball-bat", "gear:baseball-glove", "gear:football-helmet", "gear:goalposts", "gear:hurley", "gear:curling-broom", "gear:figure-skate", "gear:speed-skate", "gear:diving-board", "gear:swim-goggles", "gear:starting-blocks", "gear:relay-baton", "gear:javelin", "gear:hurdles", "gear:gunbai", "gear:mawashi", "gear:shinai", "gear:kendo-men", "gear:judogi", "gear:obi", "gear:yumi", "gear:ya", "gear:karate-gi"];
45
49
  readonly sport: readonly ("sport:sumo" | "sport:kendo" | "sport:judo" | "sport:kyudo" | "sport:karate" | "sport:nfl" | "sport:cfl" | "sport:ifaf" | "sport:nhl" | "sport:nba" | "sport:mlb" | "sport:soccer" | "sport:curling" | "sport:tennis" | "sport:volleyball" | "sport:badminton" | "sport:pickleball" | "sport:tabletennis" | "sport:padel" | "sport:squash" | "sport:racquetball" | "sport:sepaktakraw" | "sport:teqball" | "sport:roundnet" | "sport:netball" | "sport:swimming" | "sport:waterpolo" | "sport:diving" | "sport:artisticswimming" | "sport:lacrosse" | "sport:rugby" | "sport:afl" | "sport:gaelic" | "sport:cricket" | "sport:fieldhockey" | "sport:handball" | "sport:athletics" | "sport:skating")[];
46
50
  readonly pennant: readonly ["pennant:championship"];
@@ -55,6 +59,7 @@ export declare const EMBLEM_FOLDERS: {
55
59
  readonly medal: "medal";
56
60
  readonly crest: "crest";
57
61
  readonly ball: "ball";
62
+ readonly puck: "ball";
58
63
  readonly gear: "gear";
59
64
  readonly sport: "sport";
60
65
  readonly pennant: "pennant";
@@ -30,6 +30,8 @@ export const BALL_IDS = [
30
30
  "ball:squash-green", "ball:squash-red", "ball:squash-blue", "ball:racquetball", "ball:lacrosse", "ball:field-hockey", "ball:table-tennis", "ball:handball", "ball:water-polo", "ball:golf",
31
31
  "ball:puck", "ball:curling-stone", "ball:shot", "ball:discus", "ball:hammer", "ball:sepak-takraw", "ball:roundnet", "ball:shuttlecock-feather", "ball:shuttlecock-nylon"
32
32
  ];
33
+ /** The printed pucks: the same puck as `ball:puck` with a print on its top face (a flag, a leaf, stars and stripes, a player's name and number, a made-up signature, a souvenir's ring of words). All drawn here, none a team's or a league's own. */
34
+ export const PUCK_IDS = ["puck:canada", "puck:canada-red", "puck:canada-white", "puck:usa", "puck:usa-navy", "puck:player", "puck:signed", "puck:souvenir"];
33
35
  /** The pieces of gear: a piece of equipment for each sport, flat, drawn for this package, turning like a coin. */
34
36
  export const GEAR_IDS = [
35
37
  "gear:hockey-stick", "gear:goalie-stick", "gear:hockey-skate", "gear:goalie-mask", "gear:goal-net", "gear:field-hockey-stick", "gear:lacrosse-stick", "gear:cricket-bat", "gear:wicket",
@@ -57,6 +59,7 @@ export const EMBLEM_GROUPS = {
57
59
  medal: MEDAL_IDS,
58
60
  crest: CREST_IDS,
59
61
  ball: BALL_IDS,
62
+ puck: PUCK_IDS,
60
63
  gear: GEAR_IDS,
61
64
  sport: SPORT_IDS,
62
65
  pennant: PENNANT_IDS,
@@ -64,6 +67,6 @@ export const EMBLEM_GROUPS = {
64
67
  /** Every id, in group order. */
65
68
  export const EMBLEM_IDS = Object.values(EMBLEM_GROUPS).flat();
66
69
  /** The folder under `src/emblems/` that holds a group's art, one module per item named by the id's last part: `trophy:hockey-cup` is `trophy/hockey-cup.ts`, `ball:soccer` is `ball/soccer.ts`. Each group has a folder of its own, so no two ids share a file name. */
67
- export const EMBLEM_FOLDERS = { award: "award", trophy: "trophy", medal: "medal", crest: "crest", ball: "ball", gear: "gear", sport: "sport", pennant: "pennant" };
70
+ export const EMBLEM_FOLDERS = { award: "award", trophy: "trophy", medal: "medal", crest: "crest", ball: "ball", puck: "ball", gear: "gear", sport: "sport", pennant: "pennant" };
68
71
  /** The short names of the trophies and awards that stand for a full id: `"cup"` is `"trophy:cup"` and `"crown"` is `"award:crown"`. */
69
72
  export const EMBLEM_ALIASES = Object.fromEntries([...TROPHY_IDS, ...AWARD_IDS].map((id) => [id.slice(id.indexOf(":") + 1), id]));
@@ -38,7 +38,7 @@ import { CREST_ROUNDEL } from "./crest/roundel.js";
38
38
  import { CREST_DIAMOND } from "./crest/diamond.js";
39
39
  import { CREST_PENNANT } from "./crest/pennant.js";
40
40
  import { PENNANT_CHAMPIONSHIP } from "./pennant/championship.js";
41
- import { BALLS } from "./ball/ball.index.js";
41
+ import { BALLS, PUCKS } from "./ball/ball.index.js";
42
42
  import { GEARS } from "./gear/gear.index.js";
43
43
  import { SPORT_NFL } from "./sport/nfl.js";
44
44
  import { SPORT_CFL } from "./sport/cfl.js";
@@ -79,7 +79,7 @@ import { SPORT_JUDO } from "./sport/judo.js";
79
79
  import { SPORT_KYUDO } from "./sport/kyudo.js";
80
80
  import { SPORT_KARATE } from "./sport/karate.js";
81
81
  /** The balls and the gear are drawn by families, each family in a module of its own, and listed in order by their own indexes. */
82
- const PIECES = Object.fromEntries([...BALLS, ...GEARS].map((piece) => [piece.id, piece]));
82
+ const PIECES = Object.fromEntries([...BALLS, ...PUCKS, ...GEARS].map((piece) => [piece.id, piece]));
83
83
  /** The emblems drawn one to a module: every id but the balls and the gear. A missing or extra entry is a type error. */
84
84
  const OWN = {
85
85
  "award:medal": AWARD_MEDAL,
@@ -2,8 +2,8 @@ export { EMBLEM_DESCRIPTIONS } from "./emblems/emblem.descriptions.ts";
2
2
  export type { EmblemDescription } from "./emblems/emblem.descriptions.ts";
3
3
  export { EMBLEMS, crest, emblemInfo, emblemModel, emblemName, emblemOf, emblemSvg, isBallId, isEmblemId, medal, parseEmblem, pennant, renderEmblem, sportIcon } from "./emblems/emblem.api.ts";
4
4
  export type { CrestOptions, EmblemInfo, EmblemRef, PennantOptions } from "./emblems/emblem.api.ts";
5
- export { AWARD_IDS, BALL_IDS, CREST_IDS, CREST_SHAPES, EMBLEM_ALIASES, EMBLEM_FOLDERS, EMBLEM_GROUPS, EMBLEM_IDS, GEAR_IDS, JAPANESE_IDS, MEDAL_IDS, MEDAL_KINDS, PENNANT_IDS, SPORT_IDS, SPORT_NAMES, TROPHY_IDS } from "./emblems/emblem.ids.ts";
6
- export type { AwardId, BallId, CrestId, CrestShape, EmblemGroup, EmblemId, GearId, JapaneseId, MedalId, MedalKind, PennantId, SportEmblemId, SportName, TrophyId } from "./emblems/emblem.ids.ts";
5
+ export { AWARD_IDS, BALL_IDS, CREST_IDS, CREST_SHAPES, EMBLEM_ALIASES, EMBLEM_FOLDERS, EMBLEM_GROUPS, EMBLEM_IDS, GEAR_IDS, JAPANESE_IDS, MEDAL_IDS, MEDAL_KINDS, PENNANT_IDS, PUCK_IDS, SPORT_IDS, SPORT_NAMES, TROPHY_IDS } from "./emblems/emblem.ids.ts";
6
+ export type { AwardId, BallId, CrestId, CrestShape, EmblemGroup, EmblemId, GearId, JapaneseId, MedalId, MedalKind, PennantId, PuckId, SportEmblemId, SportName, TrophyId } from "./emblems/emblem.ids.ts";
7
7
  export { EMBLEM_INK, EMBLEM_PAGE, EMBLEM_STYLES, METALS } from "./emblems/emblem.core.ts";
8
8
  export type { Emblem, EmblemKind, EmblemLocale, EmblemOptions, EmblemSource, EmblemStyle, EmblemTheme, FrameOptions } from "./emblems/emblem.core.ts";
9
9
  export { lineup } from "./emblems/ball/ball.index.ts";
@@ -19,3 +19,4 @@ export { sportEquipment } from "./emblems/emblem.equipment.ts";
19
19
  export type { SportEquipment } from "./emblems/emblem.equipment.ts";
20
20
  export { awardCase, podium } from "./emblems/emblem.display.ts";
21
21
  export type { AwardCaseOptions, AwardItem, DisplayOptions, PodiumOptions, PodiumPlace } from "./emblems/emblem.display.ts";
22
+ export type { FaceColors, FlagRenderer, PuckDesign, PuckFace } from "./emblems/ball/ball.face.ts";
@@ -2,7 +2,7 @@
2
2
  // emblem and nothing else import its own module (`@johnmorrisdotca/dougu-sports/ball/soccer`).
3
3
  export { EMBLEM_DESCRIPTIONS } from "./emblems/emblem.descriptions.js";
4
4
  export { EMBLEMS, crest, emblemInfo, emblemModel, emblemName, emblemOf, emblemSvg, isBallId, isEmblemId, medal, parseEmblem, pennant, renderEmblem, sportIcon } from "./emblems/emblem.api.js";
5
- export { AWARD_IDS, BALL_IDS, CREST_IDS, CREST_SHAPES, EMBLEM_ALIASES, EMBLEM_FOLDERS, EMBLEM_GROUPS, EMBLEM_IDS, GEAR_IDS, JAPANESE_IDS, MEDAL_IDS, MEDAL_KINDS, PENNANT_IDS, SPORT_IDS, SPORT_NAMES, TROPHY_IDS } from "./emblems/emblem.ids.js";
5
+ export { AWARD_IDS, BALL_IDS, CREST_IDS, CREST_SHAPES, EMBLEM_ALIASES, EMBLEM_FOLDERS, EMBLEM_GROUPS, EMBLEM_IDS, GEAR_IDS, JAPANESE_IDS, MEDAL_IDS, MEDAL_KINDS, PENNANT_IDS, PUCK_IDS, SPORT_IDS, SPORT_NAMES, TROPHY_IDS } from "./emblems/emblem.ids.js";
6
6
  export { EMBLEM_INK, EMBLEM_PAGE, EMBLEM_STYLES, METALS } from "./emblems/emblem.core.js";
7
7
  export { lineup } from "./emblems/ball/ball.index.js";
8
8
  export { emblemSprite } from "./emblems/emblem.sprite.js";
package/dist/index.d.ts CHANGED
@@ -98,6 +98,7 @@ export { BALL_HANDBALL } from "./emblems/ball/ball.handball.ts";
98
98
  export { BALL_PADEL } from "./emblems/ball/ball.padel.ts";
99
99
  export { BALL_PICKLEBALL_OUTDOOR, BALL_PICKLEBALL_INDOOR } from "./emblems/ball/ball.pickleball.ts";
100
100
  export { BALL_PUCK } from "./emblems/ball/ball.puck.ts";
101
+ export { PUCK_CANADA, PUCK_CANADA_RED, PUCK_CANADA_WHITE, PUCK_USA, PUCK_USA_NAVY, PUCK_PLAYER, PUCK_SIGNED, PUCK_SOUVENIR } from "./emblems/ball/ball.puck.print.ts";
101
102
  export { BALL_ROUNDNET } from "./emblems/ball/ball.roundnet.ts";
102
103
  export { BALL_RUGBY } from "./emblems/ball/ball.rugby.ts";
103
104
  export { BALL_SEPAK_TAKRAW } from "./emblems/ball/ball.sepaktakraw.ts";
package/dist/index.js CHANGED
@@ -99,6 +99,7 @@ export { BALL_HANDBALL } from "./emblems/ball/ball.handball.js";
99
99
  export { BALL_PADEL } from "./emblems/ball/ball.padel.js";
100
100
  export { BALL_PICKLEBALL_OUTDOOR, BALL_PICKLEBALL_INDOOR } from "./emblems/ball/ball.pickleball.js";
101
101
  export { BALL_PUCK } from "./emblems/ball/ball.puck.js";
102
+ export { PUCK_CANADA, PUCK_CANADA_RED, PUCK_CANADA_WHITE, PUCK_USA, PUCK_USA_NAVY, PUCK_PLAYER, PUCK_SIGNED, PUCK_SOUVENIR } from "./emblems/ball/ball.puck.print.js";
102
103
  export { BALL_ROUNDNET } from "./emblems/ball/ball.roundnet.js";
103
104
  export { BALL_RUGBY } from "./emblems/ball/ball.rugby.js";
104
105
  export { BALL_SEPAK_TAKRAW } from "./emblems/ball/ball.sepaktakraw.js";
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const VERSION = "0.3.2";
1
+ export declare const VERSION = "0.4.0";
package/dist/version.js CHANGED
@@ -1 +1 @@
1
- export const VERSION = "0.3.2";
1
+ export const VERSION = "0.4.0";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@johnmorrisdotca/dougu-sports",
3
- "version": "0.3.2",
3
+ "version": "0.4.0",
4
4
  "description": "Dougu Sports 道具, sports emblems as SVG strings: trophies, medals, crests, sport icons, and the ball and gear of every sport, in metal, line or flat colour, with optional 3D turning. Light and dark, accessible, tree-shakeable. Zero dependencies.",
5
5
  "keywords": [
6
6
  "sports",