@johnmorrisdotca/kyogijo-stadiums 0.4.0 → 0.6.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 +133 -0
- package/NOTICE.md +182 -2
- package/README.md +106 -19
- package/dist/annotate.js +1 -1
- package/dist/arenas-entry.d.ts +4 -0
- package/dist/arenas-entry.js +3 -0
- package/dist/arenas.d.ts +125 -0
- package/dist/arenas.data.d.ts +2 -0
- package/dist/arenas.data.js +3763 -0
- package/dist/arenas.js +72 -0
- package/dist/athletics/describe.d.ts +8 -0
- package/dist/athletics/describe.js +41 -0
- package/dist/athletics/events.d.ts +17 -0
- package/dist/athletics/events.js +48 -0
- package/dist/athletics/facilities.d.ts +80 -0
- package/dist/athletics/facilities.js +176 -0
- package/dist/athletics/infield.d.ts +79 -0
- package/dist/athletics/infield.js +166 -0
- package/dist/athletics/layout.d.ts +13 -0
- package/dist/athletics/layout.js +98 -0
- package/dist/athletics/oval.d.ts +57 -0
- package/dist/athletics/oval.js +116 -0
- package/dist/athletics/plan.d.ts +97 -0
- package/dist/athletics/plan.js +355 -0
- package/dist/athletics/races.d.ts +102 -0
- package/dist/athletics/races.js +355 -0
- package/dist/athletics/steeplechase.d.ts +72 -0
- package/dist/athletics/steeplechase.js +196 -0
- package/dist/athletics/stencil.d.ts +13 -0
- package/dist/athletics/stencil.js +85 -0
- package/dist/athletics/track.d.ts +54 -0
- package/dist/athletics/track.js +105 -0
- package/dist/athletics/types.d.ts +77 -0
- package/dist/athletics/types.js +1 -0
- package/dist/athletics-entry.d.ts +17 -0
- package/dist/athletics-entry.js +11 -0
- package/dist/athletics.style.d.ts +16 -0
- package/dist/athletics.style.js +51 -0
- package/dist/atlas-entry.d.ts +6 -2
- package/dist/atlas-entry.js +4 -2
- package/dist/atlas.d.ts +117 -23
- package/dist/atlas.js +197 -12
- package/dist/background.js +2 -1
- package/dist/budo/describe.d.ts +13 -0
- package/dist/budo/describe.js +120 -0
- package/dist/budo/dojo.api.d.ts +64 -0
- package/dist/budo/dojo.api.js +46 -0
- package/dist/budo/dojo.d.ts +72 -0
- package/dist/budo/dojo.js +300 -0
- package/dist/budo/judo.d.ts +61 -0
- package/dist/budo/judo.js +109 -0
- package/dist/budo/karate.d.ts +29 -0
- package/dist/budo/karate.js +80 -0
- package/dist/budo/kendo.d.ts +18 -0
- package/dist/budo/kendo.js +44 -0
- package/dist/budo/kimarite.d.ts +19 -0
- package/dist/budo/kimarite.js +33 -0
- package/dist/budo/kit.d.ts +16 -0
- package/dist/budo/kit.js +24 -0
- package/dist/budo/kyudo.d.ts +28 -0
- package/dist/budo/kyudo.js +66 -0
- package/dist/budo/looks.d.ts +28 -0
- package/dist/budo/looks.js +58 -0
- package/dist/budo/parts.d.ts +32 -0
- package/dist/budo/parts.js +10 -0
- package/dist/budo/plan.d.ts +64 -0
- package/dist/budo/plan.js +139 -0
- package/dist/budo/room.d.ts +133 -0
- package/dist/budo/room.js +111 -0
- package/dist/budo/sumo.d.ts +31 -0
- package/dist/budo/sumo.js +71 -0
- package/dist/budo/tatami.d.ts +55 -0
- package/dist/budo/tatami.js +156 -0
- package/dist/budo/types.d.ts +192 -0
- package/dist/budo/types.js +2 -0
- package/dist/budo-entry.d.ts +22 -0
- package/dist/budo-entry.js +13 -0
- package/dist/budo.board.d.ts +28 -0
- package/dist/budo.board.js +81 -0
- package/dist/budo.score.d.ts +18 -0
- package/dist/budo.score.js +52 -0
- package/dist/budo.style.d.ts +6 -0
- package/dist/budo.style.js +67 -0
- package/dist/charts-entry.d.ts +6 -1
- package/dist/charts-entry.js +3 -0
- package/dist/charts.athletics.d.ts +183 -0
- package/dist/charts.athletics.js +455 -0
- package/dist/charts.baseball.js +1 -1
- package/dist/charts.curling.heat.d.ts +24 -0
- package/dist/charts.curling.heat.js +116 -0
- package/dist/charts.curling.js +14 -3
- package/dist/charts.js +4 -4
- package/dist/charts.pool.d.ts +67 -0
- package/dist/charts.pool.js +76 -0
- package/dist/charts.skating.d.ts +204 -0
- package/dist/charts.skating.js +426 -0
- package/dist/charts.soccer.js +3 -3
- package/dist/charts.types.d.ts +63 -1
- package/dist/colour.d.ts +4 -4
- package/dist/colour.js +4 -4
- package/dist/court.d.ts +85 -2
- package/dist/court.js +102 -7
- package/dist/court.more.d.ts +46 -0
- package/dist/court.more.js +219 -0
- package/dist/courts.style.d.ts +14 -2
- package/dist/courts.style.js +51 -4
- package/dist/crowd.d.ts +164 -0
- package/dist/crowd.draw.d.ts +17 -0
- package/dist/crowd.draw.js +204 -0
- package/dist/crowd.js +480 -0
- package/dist/crowd.park.d.ts +19 -0
- package/dist/crowd.park.js +153 -0
- package/dist/curling.stats.d.ts +271 -0
- package/dist/curling.stats.js +301 -0
- package/dist/draw.d.ts +16 -0
- package/dist/draw.js +462 -54
- package/dist/element-entry.d.ts +3 -1
- package/dist/element-entry.js +2 -1
- package/dist/element.d.ts +13 -2
- package/dist/element.js +79 -4
- package/dist/emblems-source.d.ts +50 -0
- package/dist/emblems-source.js +56 -0
- package/dist/eras.d.ts +3 -1
- package/dist/eras.js +8 -3
- package/dist/features.js +204 -0
- package/dist/field.data.d.ts +16 -0
- package/dist/field.data.js +50 -0
- package/dist/fields.kit.d.ts +2 -2
- package/dist/fields.types.d.ts +24 -4
- package/dist/formations.js +18 -7
- package/dist/formations.sports.d.ts +8 -0
- package/dist/formations.sports.js +251 -0
- package/dist/frames.providers.js +71 -8
- package/dist/geojson.js +3 -0
- package/dist/geometry-entry.d.ts +2 -1
- package/dist/geometry-entry.js +2 -1
- package/dist/geometry.d.ts +20 -0
- package/dist/geometry.js +78 -1
- package/dist/grounds.d.ts +4 -0
- package/dist/grounds.data.js +12 -0
- package/dist/halls.d.ts +65 -0
- package/dist/halls.js +122 -0
- package/dist/hardwood.d.ts +31 -0
- package/dist/hardwood.js +157 -0
- package/dist/heat.js +21 -13
- package/dist/heat.types.d.ts +5 -0
- package/dist/heat.zones.d.ts +4 -2
- package/dist/heat.zones.js +207 -7
- package/dist/homeside.js +24 -0
- package/dist/index.d.ts +30 -4
- package/dist/index.js +18 -2
- package/dist/layers-entry.d.ts +2 -1
- package/dist/layers-entry.js +1 -0
- package/dist/layers.d.ts +2 -1
- package/dist/layers.env.d.ts +12 -1
- package/dist/layers.env.js +36 -4
- package/dist/layers.js +32 -13
- package/dist/layers.types.d.ts +9 -2
- package/dist/leagues/athletics.d.ts +63 -0
- package/dist/leagues/athletics.js +87 -0
- package/dist/leagues/budo.d.ts +196 -0
- package/dist/leagues/budo.js +105 -0
- package/dist/leagues/courts.d.ts +269 -4
- package/dist/leagues/courts.js +155 -1
- package/dist/leagues/hockey.js +41 -19
- package/dist/leagues/skating.d.ts +145 -0
- package/dist/leagues/skating.js +73 -0
- package/dist/leagues/sources.js +41 -0
- package/dist/leagues/types.d.ts +1 -1
- package/dist/leagues-entry.d.ts +4 -2
- package/dist/leagues-entry.js +2 -1
- package/dist/leagues.d.ts +17 -4
- package/dist/leagues.js +246 -5
- package/dist/lineup.codes.d.ts +23 -0
- package/dist/lineup.codes.js +122 -0
- package/dist/logo.d.ts +25 -0
- package/dist/logo.js +47 -0
- package/dist/look.d.ts +3 -3
- package/dist/look.js +39 -6
- package/dist/outline.d.ts +1 -1
- package/dist/outline.js +46 -4
- package/dist/pageant.d.ts +120 -0
- package/dist/pageant.draw.d.ts +21 -0
- package/dist/pageant.draw.js +171 -0
- package/dist/pageant.js +211 -0
- package/dist/pageant.style.d.ts +8 -0
- package/dist/pageant.style.js +42 -0
- package/dist/png.d.ts +8 -1
- package/dist/png.js +21 -1
- package/dist/pointer-entry.d.ts +2 -0
- package/dist/pointer-entry.js +2 -0
- package/dist/pointer.d.ts +113 -0
- package/dist/pointer.js +151 -0
- package/dist/pool.d.ts +176 -0
- package/dist/pool.figures.d.ts +306 -0
- package/dist/pool.figures.js +148 -0
- package/dist/pool.js +304 -0
- package/dist/pool.kit.d.ts +48 -0
- package/dist/pool.kit.js +141 -0
- package/dist/pool.labels.d.ts +20 -0
- package/dist/pool.labels.js +258 -0
- package/dist/pool.race.d.ts +65 -0
- package/dist/pool.race.js +140 -0
- package/dist/pool.replay.d.ts +46 -0
- package/dist/pool.replay.js +127 -0
- package/dist/pool.section.d.ts +13 -0
- package/dist/pool.section.js +83 -0
- package/dist/pool.style.d.ts +20 -0
- package/dist/pool.style.js +169 -0
- package/dist/pool.types.d.ts +145 -0
- package/dist/pool.types.js +3 -0
- package/dist/pool.words.d.ts +13 -0
- package/dist/pool.words.js +101 -0
- package/dist/ranges.names.js +53 -3
- package/dist/replay-entry.d.ts +3 -0
- package/dist/replay-entry.js +2 -0
- package/dist/restyle.js +1 -1
- package/dist/road.draw.js +3 -2
- package/dist/road.js +2 -1
- package/dist/road.types.d.ts +3 -0
- package/dist/rules.d.ts +138 -0
- package/dist/rules.js +511 -0
- package/dist/rules.types.d.ts +4 -0
- package/dist/rules.types.js +64 -0
- package/dist/score.d.ts +3 -0
- package/dist/score.js +93 -6
- package/dist/sheet.d.ts +3 -0
- package/dist/sheet.js +7 -3
- package/dist/situation.d.ts +135 -0
- package/dist/situation.draw.d.ts +34 -0
- package/dist/situation.draw.js +202 -0
- package/dist/situation.js +337 -0
- package/dist/situation.style.d.ts +2 -0
- package/dist/situation.style.js +45 -0
- package/dist/situation.types.d.ts +77 -0
- package/dist/situation.types.js +3 -0
- package/dist/situation.widgets.d.ts +39 -0
- package/dist/situation.widgets.js +129 -0
- package/dist/skating/describe.d.ts +7 -0
- package/dist/skating/describe.js +44 -0
- package/dist/skating/events.d.ts +24 -0
- package/dist/skating/events.js +47 -0
- package/dist/skating/figure.d.ts +24 -0
- package/dist/skating/figure.js +37 -0
- package/dist/skating/long.d.ts +54 -0
- package/dist/skating/long.js +111 -0
- package/dist/skating/parts.d.ts +43 -0
- package/dist/skating/parts.js +40 -0
- package/dist/skating/plan.d.ts +55 -0
- package/dist/skating/plan.js +197 -0
- package/dist/skating/short.d.ts +47 -0
- package/dist/skating/short.js +89 -0
- package/dist/skating/track.d.ts +66 -0
- package/dist/skating/track.js +94 -0
- package/dist/skating/types.d.ts +57 -0
- package/dist/skating/types.js +3 -0
- package/dist/skating-entry.d.ts +17 -0
- package/dist/skating-entry.js +11 -0
- package/dist/skating.style.d.ts +4 -0
- package/dist/skating.style.js +24 -0
- package/dist/strings.d.ts +470 -0
- package/dist/strings.js +674 -13
- package/dist/style.d.ts +2 -0
- package/dist/style.js +19 -2
- package/dist/surfaces/artistic.d.ts +9 -0
- package/dist/surfaces/artistic.js +94 -0
- package/dist/surfaces/athletics.d.ts +16 -0
- package/dist/surfaces/athletics.js +132 -0
- package/dist/surfaces/baseball.js +17 -0
- package/dist/surfaces/basketball.floor.d.ts +27 -0
- package/dist/surfaces/basketball.floor.js +83 -0
- package/dist/surfaces/basketball.gear.d.ts +27 -0
- package/dist/surfaces/basketball.gear.js +90 -0
- package/dist/surfaces/basketball.js +44 -22
- package/dist/surfaces/budo.d.ts +6 -0
- package/dist/surfaces/budo.js +104 -0
- package/dist/surfaces/curling.d.ts +16 -0
- package/dist/surfaces/curling.fold.d.ts +67 -0
- package/dist/surfaces/curling.fold.js +107 -0
- package/dist/surfaces/curling.js +37 -3
- package/dist/surfaces/dive.d.ts +9 -0
- package/dist/surfaces/dive.js +128 -0
- package/dist/surfaces/field.d.ts +7 -2
- package/dist/surfaces/field.js +15 -9
- package/dist/surfaces/football.js +7 -0
- package/dist/surfaces/hockey.js +4 -2
- package/dist/surfaces/net.d.ts +2 -1
- package/dist/surfaces/net.js +160 -15
- package/dist/surfaces/polo.d.ts +12 -0
- package/dist/surfaces/polo.js +159 -0
- package/dist/surfaces/pool.d.ts +27 -0
- package/dist/surfaces/pool.js +198 -0
- package/dist/surfaces/skating.d.ts +6 -0
- package/dist/surfaces/skating.js +62 -0
- package/dist/surfaces/soccer.js +2 -1
- package/dist/surfaces/surface.d.ts +76 -0
- package/dist/surfaces/venue.d.ts +15 -0
- package/dist/surfaces/venue.js +95 -0
- package/dist/target-entry.d.ts +2 -0
- package/dist/target-entry.js +2 -0
- package/dist/target.d.ts +200 -0
- package/dist/target.js +525 -0
- package/dist/team.common.d.ts +1 -1
- package/dist/team.common.js +3 -3
- package/dist/team.formation.d.ts +3 -1
- package/dist/team.formation.js +3 -3
- package/dist/team.layers.d.ts +2 -2
- package/dist/team.layers.js +4 -1
- package/dist/team.lineup.d.ts +27 -0
- package/dist/team.lineup.js +207 -0
- package/dist/team.network.js +6 -5
- package/dist/team.shape.js +5 -5
- package/dist/team.types.d.ts +40 -1
- package/dist/tenants.d.ts +77 -0
- package/dist/tenants.data.d.ts +8 -0
- package/dist/tenants.data.js +1793 -0
- package/dist/tenants.js +46 -0
- package/dist/turn-entry.d.ts +12 -0
- package/dist/turn-entry.js +7 -0
- package/dist/turn.camera.d.ts +116 -0
- package/dist/turn.camera.js +184 -0
- package/dist/turn.dom.d.ts +40 -0
- package/dist/turn.dom.js +353 -0
- package/dist/turn.kit.d.ts +86 -0
- package/dist/turn.kit.js +110 -0
- package/dist/turn.markup.d.ts +48 -0
- package/dist/turn.markup.js +108 -0
- package/dist/turn.model.d.ts +78 -0
- package/dist/turn.model.js +91 -0
- package/dist/turn.style.d.ts +5 -0
- package/dist/turn.style.js +56 -0
- package/dist/types.d.ts +221 -20
- package/dist/units.d.ts +1 -1
- package/dist/units.js +22 -1
- package/dist/uprights.board.d.ts +17 -0
- package/dist/uprights.board.js +59 -0
- package/dist/uprights.budo.d.ts +17 -0
- package/dist/uprights.budo.js +87 -0
- package/dist/uprights.d.ts +37 -0
- package/dist/uprights.fields.d.ts +32 -0
- package/dist/uprights.fields.js +172 -0
- package/dist/uprights.goal.d.ts +49 -0
- package/dist/uprights.goal.js +69 -0
- package/dist/uprights.js +169 -0
- package/dist/uprights.more.d.ts +7 -0
- package/dist/uprights.more.js +183 -0
- package/dist/uprights.net.d.ts +12 -0
- package/dist/uprights.net.js +109 -0
- package/dist/uprights.netkit.d.ts +28 -0
- package/dist/uprights.netkit.js +67 -0
- package/dist/uprights.pools.d.ts +8 -0
- package/dist/uprights.pools.js +190 -0
- package/dist/uprights.rinks.d.ts +27 -0
- package/dist/uprights.rinks.js +106 -0
- package/dist/uprights.track.d.ts +50 -0
- package/dist/uprights.track.js +246 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/zones-entry.d.ts +2 -0
- package/dist/zones-entry.js +2 -0
- package/package.json +56 -3
package/dist/element-entry.d.ts
CHANGED
|
@@ -1 +1,3 @@
|
|
|
1
|
-
export { KYOGIJO_ATTRIBUTES, KYOGIJO_TAG, KyogijoField, defineKyogijoField, optionsFromAttributes, replaySettingsFromAttributes } from "./element.ts";
|
|
1
|
+
export { KYOGIJO_ATTRIBUTES, KYOGIJO_TAG, KyogijoField, defineKyogijoField, optionsFromAttributes, replaySettingsFromAttributes, turnSettingsFromAttributes, turnWanted } from "./element.ts";
|
|
2
|
+
export { useEmblems } from "./emblems-source.ts";
|
|
3
|
+
export type { EmblemRenderer } from "./emblems-source.ts";
|
package/dist/element-entry.js
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
// The custom element's class and its registration function; importing this entry registers nothing.
|
|
2
|
-
export { KYOGIJO_ATTRIBUTES, KYOGIJO_TAG, KyogijoField, defineKyogijoField, optionsFromAttributes, replaySettingsFromAttributes } from "./element.js";
|
|
2
|
+
export { KYOGIJO_ATTRIBUTES, KYOGIJO_TAG, KyogijoField, defineKyogijoField, optionsFromAttributes, replaySettingsFromAttributes, turnSettingsFromAttributes, turnWanted } from "./element.js";
|
|
3
|
+
export { useEmblems } from "./emblems-source.js";
|
package/dist/element.d.ts
CHANGED
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
import { type KyogijoReplay } from "./mount.ts";
|
|
2
|
+
import { type KyogijoTurn } from "./turn.dom.ts";
|
|
3
|
+
import type { TurnSettings } from "./turn.model.ts";
|
|
2
4
|
import type { ReplaySettings, ReplayTimeline } from "./replay.types.ts";
|
|
3
5
|
import type { ScoreOptions, SurfaceOptions } from "./types.ts";
|
|
4
6
|
/** The tag of the element. */
|
|
5
7
|
export declare const KYOGIJO_TAG = "kyogijo-field";
|
|
6
8
|
/** The attributes the element reads. */
|
|
7
|
-
export declare const KYOGIJO_ATTRIBUTES: readonly ["sport", "league", "size", "theme", "language", "orientation", "park", "ground", "year", "detail", "margin", "stripes", "exact-lines", "uppercase", "pitch", "pitch-type", "half", "range", "range-end", "goals", "stripe-pattern", "corner-flags", "look", "line-width", "line-dash", "line-opacity", "landmarks", "walls", "quirks", "home", "away", "home-abbr", "away-abbr", "home-score", "away-score", "home-penalties", "away-penalties", "score", "home-logo", "away-logo", "home-color", "away-color", "status", "competition", "date", "label", "winner", "home-side", "description", "options", "loop", "speed", "autoplay", "controls", "trail"];
|
|
9
|
+
export declare const KYOGIJO_ATTRIBUTES: readonly ["sport", "league", "size", "theme", "language", "orientation", "park", "ground", "arena", "year", "detail", "margin", "stripes", "exact-lines", "uppercase", "pitch", "pitch-type", "half", "range", "range-end", "goals", "stripe-pattern", "corner-flags", "look", "line-width", "line-dash", "line-opacity", "landmarks", "walls", "quirks", "home", "away", "home-abbr", "away-abbr", "home-score", "away-score", "home-penalties", "away-penalties", "score", "home-logo", "away-logo", "home-color", "away-color", "status", "competition", "date", "label", "winner", "home-side", "pageant", "description", "options", "loop", "speed", "autoplay", "controls", "trail", "turn", "turn-view", "turn-controls", "turn-uprights", "turn-score", "turn-touch"];
|
|
10
|
+
/** The settings of a 3D view an element's attributes make: `turn-view` names the viewpoint it opens on, `turn-controls="false"` and `turn-uprights="false"` leave the buttons and what stands on the surface out, `turn-score="floor"` leaves the score panel on the floor, `turn-touch="turn"` keeps every touch for the view. */
|
|
11
|
+
export declare function turnSettingsFromAttributes(read: (name: string) => string | null, base?: TurnSettings): TurnSettings;
|
|
12
|
+
/** Whether an element's `turn` attribute asks for the 3D view: present, and not `false`. */
|
|
13
|
+
export declare const turnWanted: (read: (name: string) => string | null) => boolean;
|
|
8
14
|
/** The settings of a replay an element's attributes make: `loop`, `autoplay` and `controls="false"` are switches, `speed` and `trail` numbers. */
|
|
9
15
|
export declare function replaySettingsFromAttributes(read: (name: string) => string | null, base?: ReplaySettings): ReplaySettings;
|
|
10
16
|
/** The options an element's attributes (and its `options` attribute and property) make. */
|
|
@@ -18,7 +24,7 @@ export declare function optionsFromAttributes(read: (name: string) => string | n
|
|
|
18
24
|
declare const Base: typeof HTMLElement;
|
|
19
25
|
export declare class KyogijoField extends Base {
|
|
20
26
|
#private;
|
|
21
|
-
static observedAttributes: readonly ["sport", "league", "size", "theme", "language", "orientation", "park", "ground", "year", "detail", "margin", "stripes", "exact-lines", "uppercase", "pitch", "pitch-type", "half", "range", "range-end", "goals", "stripe-pattern", "corner-flags", "look", "line-width", "line-dash", "line-opacity", "landmarks", "walls", "quirks", "home", "away", "home-abbr", "away-abbr", "home-score", "away-score", "home-penalties", "away-penalties", "score", "home-logo", "away-logo", "home-color", "away-color", "status", "competition", "date", "label", "winner", "home-side", "description", "options", "loop", "speed", "autoplay", "controls", "trail"];
|
|
27
|
+
static observedAttributes: readonly ["sport", "league", "size", "theme", "language", "orientation", "park", "ground", "arena", "year", "detail", "margin", "stripes", "exact-lines", "uppercase", "pitch", "pitch-type", "half", "range", "range-end", "goals", "stripe-pattern", "corner-flags", "look", "line-width", "line-dash", "line-opacity", "landmarks", "walls", "quirks", "home", "away", "home-abbr", "away-abbr", "home-score", "away-score", "home-penalties", "away-penalties", "score", "home-logo", "away-logo", "home-color", "away-color", "status", "competition", "date", "label", "winner", "home-side", "pageant", "description", "options", "loop", "speed", "autoplay", "controls", "trail", "turn", "turn-view", "turn-controls", "turn-uprights", "turn-score", "turn-touch"];
|
|
22
28
|
/** The options given as a property: an object, laid under the attributes. */
|
|
23
29
|
get options(): Partial<ScoreOptions> | undefined;
|
|
24
30
|
set options(value: Partial<ScoreOptions> | undefined);
|
|
@@ -30,6 +36,11 @@ export declare class KyogijoField extends Base {
|
|
|
30
36
|
set replaySettings(value: ReplaySettings | undefined);
|
|
31
37
|
/** The controller of the replay while there is one: play, pause, seek, step, speed. */
|
|
32
38
|
get replay(): KyogijoReplay | undefined;
|
|
39
|
+
/** Settings of the 3D view beyond the attributes: `motion`, `lens`, `floor`, `onChange` and the rest of `TurnSettings`. */
|
|
40
|
+
get turnSettings(): TurnSettings | undefined;
|
|
41
|
+
set turnSettings(value: TurnSettings | undefined);
|
|
42
|
+
/** The 3D view while the element has the `turn` attribute: its viewpoints, `set`, `reset`. */
|
|
43
|
+
get turn(): KyogijoTurn | undefined;
|
|
33
44
|
connectedCallback(): void;
|
|
34
45
|
disconnectedCallback(): void;
|
|
35
46
|
attributeChangedCallback(name: string): void;
|
package/dist/element.js
CHANGED
|
@@ -9,23 +9,44 @@ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (
|
|
|
9
9
|
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
10
10
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
11
11
|
};
|
|
12
|
-
var _KyogijoField_instances, _KyogijoField_mount, _KyogijoField_host, _KyogijoField_options, _KyogijoField_theme, _KyogijoField_timeline, _KyogijoField_replaySettings, _KyogijoField_replay, _KyogijoField_replayOf, _KyogijoField_attach, _KyogijoField_draw;
|
|
12
|
+
var _KyogijoField_instances, _KyogijoField_mount, _KyogijoField_host, _KyogijoField_options, _KyogijoField_theme, _KyogijoField_timeline, _KyogijoField_replaySettings, _KyogijoField_replay, _KyogijoField_replayOf, _KyogijoField_turn, _KyogijoField_turnSettings, _KyogijoField_attach, _KyogijoField_draw;
|
|
13
13
|
import { SPORTS } from "./draw.js";
|
|
14
14
|
import { leagueIds } from "./leagues.js";
|
|
15
15
|
import { parseRange } from "./ranges.names.js";
|
|
16
16
|
import { mountKyogijo } from "./mount.js";
|
|
17
|
+
import { TURN_PRESET_NAMES } from "./turn.camera.js";
|
|
18
|
+
import { mountKyogijoTurn } from "./turn.dom.js";
|
|
17
19
|
/** The tag of the element. */
|
|
18
20
|
export const KYOGIJO_TAG = "kyogijo-field";
|
|
19
21
|
/** The attributes the element reads. */
|
|
20
22
|
export const KYOGIJO_ATTRIBUTES = [
|
|
21
|
-
"sport", "league", "size", "theme", "language", "orientation", "park", "ground", "year", "detail", "margin", "stripes", "exact-lines", "uppercase",
|
|
23
|
+
"sport", "league", "size", "theme", "language", "orientation", "park", "ground", "arena", "year", "detail", "margin", "stripes", "exact-lines", "uppercase",
|
|
22
24
|
"pitch", "pitch-type", "half", "range", "range-end", "goals", "stripe-pattern", "corner-flags", "look", "line-width", "line-dash", "line-opacity", "landmarks", "walls", "quirks",
|
|
23
25
|
"home", "away", "home-abbr", "away-abbr", "home-score", "away-score", "home-penalties", "away-penalties", "score", "home-logo", "away-logo", "home-color", "away-color",
|
|
24
|
-
"status", "competition", "date", "label", "winner", "home-side", "description", "options",
|
|
26
|
+
"status", "competition", "date", "label", "winner", "home-side", "pageant", "description", "options",
|
|
25
27
|
"loop", "speed", "autoplay", "controls", "trail",
|
|
28
|
+
"turn", "turn-view", "turn-controls", "turn-uprights", "turn-score", "turn-touch",
|
|
26
29
|
];
|
|
27
30
|
/** The attributes that are about a replay and not about the drawing. */
|
|
28
31
|
const REPLAY_ATTRIBUTES = ["loop", "speed", "autoplay", "controls", "trail"];
|
|
32
|
+
/** The settings of a 3D view an element's attributes make: `turn-view` names the viewpoint it opens on, `turn-controls="false"` and `turn-uprights="false"` leave the buttons and what stands on the surface out, `turn-score="floor"` leaves the score panel on the floor, `turn-touch="turn"` keeps every touch for the view. */
|
|
33
|
+
export function turnSettingsFromAttributes(read, base = {}) {
|
|
34
|
+
const out = { ...base };
|
|
35
|
+
const view = read("turn-view");
|
|
36
|
+
if (view !== null && TURN_PRESET_NAMES.includes(view))
|
|
37
|
+
out.preset = view;
|
|
38
|
+
if (read("turn-controls") === "false")
|
|
39
|
+
out.controls = false;
|
|
40
|
+
if (read("turn-uprights") === "false")
|
|
41
|
+
out.uprights = false;
|
|
42
|
+
if (read("turn-score") === "floor")
|
|
43
|
+
out.score = "floor";
|
|
44
|
+
if (read("turn-touch") === "turn")
|
|
45
|
+
out.touch = "turn";
|
|
46
|
+
return out;
|
|
47
|
+
}
|
|
48
|
+
/** Whether an element's `turn` attribute asks for the 3D view: present, and not `false`. */
|
|
49
|
+
export const turnWanted = (read) => read("turn") !== null && read("turn") !== "false";
|
|
29
50
|
/** The settings of a replay an element's attributes make: `loop`, `autoplay` and `controls="false"` are switches, `speed` and `trail` numbers. */
|
|
30
51
|
export function replaySettingsFromAttributes(read, base = {}) {
|
|
31
52
|
const out = { ...base };
|
|
@@ -88,6 +109,7 @@ export function optionsFromAttributes(read, base) {
|
|
|
88
109
|
text("orientation");
|
|
89
110
|
text("park");
|
|
90
111
|
text("ground");
|
|
112
|
+
text("arena");
|
|
91
113
|
text("detail");
|
|
92
114
|
text("pitch");
|
|
93
115
|
text("pitch-type");
|
|
@@ -127,6 +149,16 @@ export function optionsFromAttributes(read, base) {
|
|
|
127
149
|
const status = read("status");
|
|
128
150
|
if (status !== null && status !== "")
|
|
129
151
|
o.status = status;
|
|
152
|
+
// `pageant="carpet"` or `"stage"`, or `"true"` for a carpet; `"false"` leaves out what the `options` say.
|
|
153
|
+
const pageant = read("pageant");
|
|
154
|
+
if (pageant !== null) {
|
|
155
|
+
if (pageant === "carpet" || pageant === "stage")
|
|
156
|
+
o.pageant = pageant;
|
|
157
|
+
else if (pageant === "true" || pageant === "")
|
|
158
|
+
o.pageant = true;
|
|
159
|
+
else if (pageant === "false")
|
|
160
|
+
delete o.pageant;
|
|
161
|
+
}
|
|
130
162
|
const side = read("home-side");
|
|
131
163
|
if (side === "left" || side === "right")
|
|
132
164
|
o.homeSide = side;
|
|
@@ -222,6 +254,8 @@ export class KyogijoField extends Base {
|
|
|
222
254
|
_KyogijoField_replaySettings.set(this, void 0);
|
|
223
255
|
_KyogijoField_replay.set(this, void 0);
|
|
224
256
|
_KyogijoField_replayOf.set(this, void 0);
|
|
257
|
+
_KyogijoField_turn.set(this, void 0);
|
|
258
|
+
_KyogijoField_turnSettings.set(this, void 0);
|
|
225
259
|
}
|
|
226
260
|
/** The options given as a property: an object, laid under the attributes. */
|
|
227
261
|
get options() {
|
|
@@ -251,6 +285,20 @@ export class KyogijoField extends Base {
|
|
|
251
285
|
get replay() {
|
|
252
286
|
return __classPrivateFieldGet(this, _KyogijoField_replay, "f");
|
|
253
287
|
}
|
|
288
|
+
/** Settings of the 3D view beyond the attributes: `motion`, `lens`, `floor`, `onChange` and the rest of `TurnSettings`. */
|
|
289
|
+
get turnSettings() {
|
|
290
|
+
return __classPrivateFieldGet(this, _KyogijoField_turnSettings, "f");
|
|
291
|
+
}
|
|
292
|
+
set turnSettings(value) {
|
|
293
|
+
__classPrivateFieldSet(this, _KyogijoField_turnSettings, value, "f");
|
|
294
|
+
__classPrivateFieldGet(this, _KyogijoField_turn, "f")?.destroy();
|
|
295
|
+
__classPrivateFieldSet(this, _KyogijoField_turn, undefined, "f");
|
|
296
|
+
__classPrivateFieldGet(this, _KyogijoField_instances, "m", _KyogijoField_draw).call(this);
|
|
297
|
+
}
|
|
298
|
+
/** The 3D view while the element has the `turn` attribute: its viewpoints, `set`, `reset`. */
|
|
299
|
+
get turn() {
|
|
300
|
+
return __classPrivateFieldGet(this, _KyogijoField_turn, "f");
|
|
301
|
+
}
|
|
254
302
|
connectedCallback() {
|
|
255
303
|
if (__classPrivateFieldGet(this, _KyogijoField_host, "f") === undefined) {
|
|
256
304
|
const root = this.shadowRoot ?? this.attachShadow({ mode: "open" });
|
|
@@ -266,19 +314,27 @@ export class KyogijoField extends Base {
|
|
|
266
314
|
__classPrivateFieldGet(this, _KyogijoField_theme, "f")?.disconnect();
|
|
267
315
|
__classPrivateFieldGet(this, _KyogijoField_mount, "f")?.destroy();
|
|
268
316
|
__classPrivateFieldSet(this, _KyogijoField_mount, undefined, "f");
|
|
317
|
+
__classPrivateFieldGet(this, _KyogijoField_turn, "f")?.destroy();
|
|
318
|
+
__classPrivateFieldSet(this, _KyogijoField_turn, undefined, "f");
|
|
269
319
|
__classPrivateFieldSet(this, _KyogijoField_replay, undefined, "f");
|
|
270
320
|
__classPrivateFieldSet(this, _KyogijoField_replayOf, undefined, "f");
|
|
271
321
|
}
|
|
272
322
|
attributeChangedCallback(name) {
|
|
273
323
|
if (!this.isConnected)
|
|
274
324
|
return;
|
|
325
|
+
if (name === "turn-view" && __classPrivateFieldGet(this, _KyogijoField_turn, "f") !== undefined) {
|
|
326
|
+
const view = this.getAttribute("turn-view");
|
|
327
|
+
if (view !== null && TURN_PRESET_NAMES.includes(view))
|
|
328
|
+
__classPrivateFieldGet(this, _KyogijoField_turn, "f").preset(view);
|
|
329
|
+
return;
|
|
330
|
+
}
|
|
275
331
|
if (REPLAY_ATTRIBUTES.includes(name) && __classPrivateFieldGet(this, _KyogijoField_replay, "f") !== undefined)
|
|
276
332
|
__classPrivateFieldGet(this, _KyogijoField_instances, "m", _KyogijoField_attach).call(this, name !== "speed" && name !== "loop");
|
|
277
333
|
else
|
|
278
334
|
__classPrivateFieldGet(this, _KyogijoField_instances, "m", _KyogijoField_draw).call(this);
|
|
279
335
|
}
|
|
280
336
|
}
|
|
281
|
-
_KyogijoField_mount = new WeakMap(), _KyogijoField_host = new WeakMap(), _KyogijoField_options = new WeakMap(), _KyogijoField_theme = new WeakMap(), _KyogijoField_timeline = new WeakMap(), _KyogijoField_replaySettings = new WeakMap(), _KyogijoField_replay = new WeakMap(), _KyogijoField_replayOf = new WeakMap(), _KyogijoField_instances = new WeakSet(), _KyogijoField_attach = function _KyogijoField_attach(again) {
|
|
337
|
+
_KyogijoField_mount = new WeakMap(), _KyogijoField_host = new WeakMap(), _KyogijoField_options = new WeakMap(), _KyogijoField_theme = new WeakMap(), _KyogijoField_timeline = new WeakMap(), _KyogijoField_replaySettings = new WeakMap(), _KyogijoField_replay = new WeakMap(), _KyogijoField_replayOf = new WeakMap(), _KyogijoField_turn = new WeakMap(), _KyogijoField_turnSettings = new WeakMap(), _KyogijoField_instances = new WeakSet(), _KyogijoField_attach = function _KyogijoField_attach(again) {
|
|
282
338
|
if (__classPrivateFieldGet(this, _KyogijoField_mount, "f") === undefined || __classPrivateFieldGet(this, _KyogijoField_timeline, "f") === undefined)
|
|
283
339
|
return;
|
|
284
340
|
const settings = replaySettingsFromAttributes((name) => this.getAttribute(name), __classPrivateFieldGet(this, _KyogijoField_replaySettings, "f"));
|
|
@@ -300,6 +356,25 @@ _KyogijoField_mount = new WeakMap(), _KyogijoField_host = new WeakMap(), _Kyogij
|
|
|
300
356
|
const page = document.documentElement.getAttribute("data-theme");
|
|
301
357
|
if (options.theme === undefined && (page === "light" || page === "dark"))
|
|
302
358
|
options.theme = page;
|
|
359
|
+
if (turnWanted((name) => this.getAttribute(name))) {
|
|
360
|
+
// The 3D view takes the container over from the flat drawing; a replay does not play on it.
|
|
361
|
+
if (__classPrivateFieldGet(this, _KyogijoField_mount, "f") !== undefined) {
|
|
362
|
+
__classPrivateFieldGet(this, _KyogijoField_mount, "f").destroy();
|
|
363
|
+
__classPrivateFieldSet(this, _KyogijoField_mount, undefined, "f");
|
|
364
|
+
__classPrivateFieldSet(this, _KyogijoField_replay, undefined, "f");
|
|
365
|
+
__classPrivateFieldSet(this, _KyogijoField_replayOf, undefined, "f");
|
|
366
|
+
}
|
|
367
|
+
const settings = turnSettingsFromAttributes((name) => this.getAttribute(name), __classPrivateFieldGet(this, _KyogijoField_turnSettings, "f"));
|
|
368
|
+
if (__classPrivateFieldGet(this, _KyogijoField_turn, "f") === undefined)
|
|
369
|
+
__classPrivateFieldSet(this, _KyogijoField_turn, mountKyogijoTurn(__classPrivateFieldGet(this, _KyogijoField_host, "f"), options, settings), "f");
|
|
370
|
+
else
|
|
371
|
+
__classPrivateFieldGet(this, _KyogijoField_turn, "f").update(options);
|
|
372
|
+
return;
|
|
373
|
+
}
|
|
374
|
+
if (__classPrivateFieldGet(this, _KyogijoField_turn, "f") !== undefined) {
|
|
375
|
+
__classPrivateFieldGet(this, _KyogijoField_turn, "f").destroy();
|
|
376
|
+
__classPrivateFieldSet(this, _KyogijoField_turn, undefined, "f");
|
|
377
|
+
}
|
|
303
378
|
if (__classPrivateFieldGet(this, _KyogijoField_mount, "f") === undefined)
|
|
304
379
|
__classPrivateFieldSet(this, _KyogijoField_mount, mountKyogijo(__classPrivateFieldGet(this, _KyogijoField_host, "f"), options), "f");
|
|
305
380
|
else
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/** The styles an emblem is drawn in: full colour with metallic gradients, one outline in the page's ink, or flat fills. */
|
|
2
|
+
export type EmblemStyleName = "metal" | "line" | "color";
|
|
3
|
+
/** What kyogijo asks of a renderer. It is a subset of dougu-sports' `EmblemOptions`. */
|
|
4
|
+
export interface EmblemDrawOptions {
|
|
5
|
+
style?: EmblemStyleName;
|
|
6
|
+
/** The colour of the emblem's main part: a crest takes the team's colour. */
|
|
7
|
+
tint?: string;
|
|
8
|
+
/** A second colour: a crest's band. */
|
|
9
|
+
accent?: string;
|
|
10
|
+
/** The letters of a crest, up to three. */
|
|
11
|
+
initials?: string;
|
|
12
|
+
/** `inherit`, `auto` (by the device's setting), `light` or `dark`. */
|
|
13
|
+
theme?: "inherit" | "auto" | "light" | "dark";
|
|
14
|
+
size?: number;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* A function that draws an emblem from its id as a document of SVG, and throws for an id it does not know: `renderEmblem` of `@johnmorrisdotca/dougu-sports/emblems` is one.
|
|
18
|
+
* The id may end in `/metal`, `/line` or `/color`, and the renderer reads that suffix.
|
|
19
|
+
*/
|
|
20
|
+
export type EmblemRenderer = (id: string, options?: EmblemDrawOptions) => string;
|
|
21
|
+
type Known<T> = 0 extends 1 & T ? string : T;
|
|
22
|
+
/** @ts-ignore optional: resolves only where @johnmorrisdotca/dougu-sports is installed; elsewhere it is `any`, which `Known` turns into `string`. */
|
|
23
|
+
type DouguId = import("@johnmorrisdotca/dougu-sports/emblems").EmblemId;
|
|
24
|
+
/**
|
|
25
|
+
* The ids of dougu-sports' emblems (`"trophy:cup"`, `"crest:shield"`), when that package is installed, so that an editor completes them; any other string otherwise. An id may end in `/metal`, `/line` or `/color`,
|
|
26
|
+
* and a trophy or an award may be written without its group (`"cup"`). Nothing is imported at run time.
|
|
27
|
+
*/
|
|
28
|
+
export type EmblemId = Known<DouguId>;
|
|
29
|
+
/** An emblem as a logo, a mark or a pageant's emblem is given: its id, with or without a style, or any string (an address, a data address or an SVG document). */
|
|
30
|
+
export type EmblemRef = EmblemId | `${EmblemId}/${EmblemStyleName}` | (string & {});
|
|
31
|
+
/**
|
|
32
|
+
* Plug a renderer of ready-made emblems into kyogijo, for every drawing on the page: after this `logo: "crest:shield"` and `emblem: "trophy:hockey-cup"` are drawn. Call it once, at start-up. Without one, an id is
|
|
33
|
+
* an address and is refused. `useEmblems(undefined)` unplugs it.
|
|
34
|
+
* @example
|
|
35
|
+
* ```ts
|
|
36
|
+
* import { useEmblems } from "@johnmorrisdotca/kyogijo-stadiums";
|
|
37
|
+
* import { renderEmblem } from "@johnmorrisdotca/dougu-sports/emblems";
|
|
38
|
+
* useEmblems(renderEmblem);
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
export declare function useEmblems(render: EmblemRenderer | undefined): void;
|
|
42
|
+
/** Run a drawing with a renderer for that drawing alone (the `emblems` option), putting back whatever was there. Without a renderer it runs as it is. */
|
|
43
|
+
export declare function withEmblems<T>(render: EmblemRenderer | undefined, draw: () => T): T;
|
|
44
|
+
/** The renderer in use: the drawing's own, else the page's, else none. */
|
|
45
|
+
export declare function emblemRenderer(): EmblemRenderer | undefined;
|
|
46
|
+
/** An id with its group, which no address has in practice: what a missing renderer is told about. */
|
|
47
|
+
export declare const GROUPED_ID: RegExp;
|
|
48
|
+
/** The SVG document for a value that names an emblem, drawn by the renderer in use, or `undefined` (no renderer, not the look of an id, or an id the renderer does not know). */
|
|
49
|
+
export declare function renderedEmblem(value: unknown, options?: EmblemDrawOptions): string | undefined;
|
|
50
|
+
export {};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
// Where kyogijo gets ready-made emblems from: a renderer that the page plugs in, so that kyogijo bundles no art and keeps zero dependencies. The renderer is
|
|
2
|
+
// `renderEmblem` of @johnmorrisdotca/dougu-sports (or any function with its shape); `useEmblems(renderEmblem)` plugs it in for the page, `emblems: renderEmblem` for one drawing.
|
|
3
|
+
// This module knows nothing of any emblem: it only decides whether a string might be an emblem's id, asks the renderer, and keeps what the renderer gives back.
|
|
4
|
+
let plugged;
|
|
5
|
+
let scoped;
|
|
6
|
+
/**
|
|
7
|
+
* Plug a renderer of ready-made emblems into kyogijo, for every drawing on the page: after this `logo: "crest:shield"` and `emblem: "trophy:hockey-cup"` are drawn. Call it once, at start-up. Without one, an id is
|
|
8
|
+
* an address and is refused. `useEmblems(undefined)` unplugs it.
|
|
9
|
+
* @example
|
|
10
|
+
* ```ts
|
|
11
|
+
* import { useEmblems } from "@johnmorrisdotca/kyogijo-stadiums";
|
|
12
|
+
* import { renderEmblem } from "@johnmorrisdotca/dougu-sports/emblems";
|
|
13
|
+
* useEmblems(renderEmblem);
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
16
|
+
export function useEmblems(render) {
|
|
17
|
+
plugged = typeof render === "function" ? render : undefined;
|
|
18
|
+
}
|
|
19
|
+
/** Run a drawing with a renderer for that drawing alone (the `emblems` option), putting back whatever was there. Without a renderer it runs as it is. */
|
|
20
|
+
export function withEmblems(render, draw) {
|
|
21
|
+
if (typeof render !== "function")
|
|
22
|
+
return draw();
|
|
23
|
+
const before = scoped;
|
|
24
|
+
scoped = render;
|
|
25
|
+
try {
|
|
26
|
+
return draw();
|
|
27
|
+
}
|
|
28
|
+
finally {
|
|
29
|
+
scoped = before;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
/** The renderer in use: the drawing's own, else the page's, else none. */
|
|
33
|
+
export function emblemRenderer() {
|
|
34
|
+
return scoped ?? plugged;
|
|
35
|
+
}
|
|
36
|
+
/** The look of an id: lower-case words, optionally `group:name`, optionally a style. An address, a path with a dot or a slash, a data address or an SVG document never has it. */
|
|
37
|
+
const ID = /^[a-z0-9]+(?:-[a-z0-9]+)*(?::[a-z0-9]+(?:-[a-z0-9]+)*)?(?:\/(?:metal|line|color))?$/;
|
|
38
|
+
/** An id with its group, which no address has in practice: what a missing renderer is told about. */
|
|
39
|
+
export const GROUPED_ID = /^(?:trophy|medal|award|crest|sport|ball|gear):[a-z0-9]+(?:-[a-z0-9]+)*(?:\/(?:metal|line|color))?$/;
|
|
40
|
+
/** The SVG document for a value that names an emblem, drawn by the renderer in use, or `undefined` (no renderer, not the look of an id, or an id the renderer does not know). */
|
|
41
|
+
export function renderedEmblem(value, options) {
|
|
42
|
+
const render = emblemRenderer();
|
|
43
|
+
if (render === undefined || typeof value !== "string")
|
|
44
|
+
return undefined;
|
|
45
|
+
const text = value.trim();
|
|
46
|
+
if (text.length > 60 || !ID.test(text))
|
|
47
|
+
return undefined;
|
|
48
|
+
let svg;
|
|
49
|
+
try {
|
|
50
|
+
svg = render(text, options);
|
|
51
|
+
}
|
|
52
|
+
catch {
|
|
53
|
+
return undefined;
|
|
54
|
+
}
|
|
55
|
+
return typeof svg === "string" && /^\s*(?:<\?xml|<svg)\b/i.test(svg) ? svg : undefined;
|
|
56
|
+
}
|
package/dist/eras.d.ts
CHANGED
|
@@ -54,6 +54,8 @@ export interface NhlRules {
|
|
|
54
54
|
} | null;
|
|
55
55
|
/** The gap between the two hash marks beside an end-zone face-off circle (Rule 1.9). */
|
|
56
56
|
hashApart: number;
|
|
57
|
+
/** The centre red line judges the offside pass: a pass from inside a team's own defensive zone across both its blue line and the centre line, to a team-mate who has not touched it, stops play. Data only: the lines are drawn the same. */
|
|
58
|
+
twoLinePass: boolean;
|
|
57
59
|
}
|
|
58
60
|
/** The NBA court's markings in a season. Lengths are feet. */
|
|
59
61
|
export interface NbaRules {
|
|
@@ -138,7 +140,7 @@ export interface EraChange {
|
|
|
138
140
|
* import { eraChanges } from "@johnmorrisdotca/kyogijo-stadiums/eras";
|
|
139
141
|
* const nhl = eraChanges("nhl");
|
|
140
142
|
* console.log(nhl.length, nhl[0].id, nhl[0].from);
|
|
141
|
-
* //
|
|
143
|
+
* // 12 nhl.centreLine.1943 1943
|
|
142
144
|
* ```
|
|
143
145
|
*/
|
|
144
146
|
export declare function eraChanges(sport: EraSport): EraChange[];
|
package/dist/eras.js
CHANGED
|
@@ -29,7 +29,7 @@ const wikipedia = (id, title, revision, note) => ({
|
|
|
29
29
|
});
|
|
30
30
|
/** Every page a change was read from, by id. Wikipedia is cited by revision, for facts only. */
|
|
31
31
|
export const ERA_SOURCES = Object.freeze(Object.fromEntries([
|
|
32
|
-
wikipedia("wp-offside", "Offside (ice hockey)", 1366324643, "the two blue lines of 1928-29, the centre red line introduced in 1943-44"),
|
|
32
|
+
wikipedia("wp-offside", "Offside (ice hockey)", 1366324643, "the two blue lines of 1928-29, the centre red line introduced in 1943-44, the offside pass judged by it until the 2005 collective bargaining agreement"),
|
|
33
33
|
wikipedia("wp-rink", "Ice hockey rink", 1369579112, "the NHL's blue lines at 75 feet and goal lines at 11 feet; the trapezoid from 2005-06, 18 feet at the goal line, 22 feet from 2014-15"),
|
|
34
34
|
wikipedia("wp-nhl-rules", "National Hockey League rules", 1379666522, "the trapezoid since 2005-06, lengthened by 2 feet each side in 2014"),
|
|
35
35
|
{
|
|
@@ -152,6 +152,11 @@ const NHL_SPANS = {
|
|
|
152
152
|
{ from: 2005, value: { atGoalLine: 18, atBoards: 28 }, what: "The goaltender's trapezoid is marked behind each net: 18 feet at the goal line, 28 feet at the end boards.", ja: "各ゴールの裏に、ゴーリーがパックを扱える区域として台形(トラペゾイド)が引かれます。ゴールライン側が18フィート、エンドボード側が28フィートです。", sources: ["wp-rink", "wp-nhl-rules"] },
|
|
153
153
|
{ from: 2014, value: { atGoalLine: NHL.trapezoid.atGoalLine, atBoards: NHL.trapezoid.atBoards }, what: "The trapezoid is widened to 22 feet at the goal line (2 feet each side).", ja: "トラペゾイドのゴールライン側が左右2フィートずつ広がり、22フィートになります。", sources: ["wp-rink", "wp-nhl-rules"] },
|
|
154
154
|
],
|
|
155
|
+
twoLinePass: [
|
|
156
|
+
{ from: null, value: false, what: "No two-line pass rule: there is no centre line to judge it by.", ja: "ツーライン・パス(2本のラインをまたぐパス)の反則はありません。判定に使うセンターラインがまだないためです。", sources: ["wp-offside"] },
|
|
157
|
+
{ from: 1943, value: true, what: "The centre red line judges the two-line pass: a pass across both a team's own blue line and the centre line, to a team-mate who has not touched it, is an offside pass.", ja: "センターレッドラインでツーライン・パスを判定します。自陣のブルーラインとセンターラインの両方をまたぐパスを、まだ触れていない味方が受けると、オフサイドパスの反則になります。", sources: ["wp-offside"] },
|
|
158
|
+
{ from: 2005, value: false, what: "The centre line no longer judges the offside pass, under the 2005 collective bargaining agreement, so a pass across two lines is legal.", ja: "2005年の労使協定により、センターラインはオフサイドパスの判定に使われなくなり、ツーライン・パスは反則ではなくなります。", sources: ["wp-offside"] },
|
|
159
|
+
],
|
|
155
160
|
hashApart: [
|
|
156
161
|
{ from: 2012, value: 3, what: "The two hash marks beside each end-zone face-off circle are 3 feet apart (Rule 1.9 of 2012-13; no earlier season is cited).", ja: "エンドゾーンのフェイスオフサークルの両脇にある2本のハッシュマークは、間隔が3フィート(約91cm)です(2012-13シーズンのルール1.9。それ以前のシーズンを示す資料は見つかっていません)。", sources: ["nhl-rules-2012", "nhl-hash-2014", "cbs-hash-2014"] },
|
|
157
162
|
{ from: 2014, value: NHL.hashApart, what: "The hash marks move apart to 5 feet 7 inches, more in line with the marks on international ice.", ja: "2本のハッシュマークの間隔が5フィート7インチ(約1.7m)に広がり、国際大会のリンクにあるマークに近づきます。", sources: ["nhl-hash-2014", "cbs-hash-2014"] },
|
|
@@ -258,7 +263,7 @@ const SPANS = {
|
|
|
258
263
|
function present(sport) {
|
|
259
264
|
switch (sport) {
|
|
260
265
|
case "nhl":
|
|
261
|
-
return { centreLine: true, goalLine: NHL.goalLine, blueLine: NHL.blueLine, trapezoid: { atGoalLine: NHL.trapezoid.atGoalLine, atBoards: NHL.trapezoid.atBoards }, hashApart: NHL.hashApart };
|
|
266
|
+
return { centreLine: true, goalLine: NHL.goalLine, blueLine: NHL.blueLine, trapezoid: { atGoalLine: NHL.trapezoid.atGoalLine, atBoards: NHL.trapezoid.atBoards }, hashApart: NHL.hashApart, twoLinePass: false };
|
|
262
267
|
case "nba":
|
|
263
268
|
return { keyWidth: NBA.lane, threePoint: { radius: NBA.threePoint.radius }, restrictedArea: true };
|
|
264
269
|
case "nfl":
|
|
@@ -298,7 +303,7 @@ const featuresOf = (sport) => Object.entries(SPANS[sport]);
|
|
|
298
303
|
* import { eraChanges } from "@johnmorrisdotca/kyogijo-stadiums/eras";
|
|
299
304
|
* const nhl = eraChanges("nhl");
|
|
300
305
|
* console.log(nhl.length, nhl[0].id, nhl[0].from);
|
|
301
|
-
* //
|
|
306
|
+
* // 12 nhl.centreLine.1943 1943
|
|
302
307
|
* ```
|
|
303
308
|
*/
|
|
304
309
|
export function eraChanges(sport) {
|