@wral/hsot-data 0.1.4 → 0.1.6

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
@@ -9,13 +9,19 @@ exactly one of these elements.
9
9
 
10
10
  | Component | Page | Key attributes |
11
11
  |---|---|---|
12
- | `<hsot-scores>` | Scores/Schedules (the scoreboard; future dates are schedules) | `sport`, `date` (YYYY-MM-DD, default today, deep-linkable via `?date=`), `season`, `refresh-interval` |
12
+ | `<hsot-scores>` | Scores/Schedules (the scoreboard; future dates are schedules) | `sport`, `date` (YYYY-MM-DD, deep-linkable via `?date=`; defaults to the closest matchday: today when games are on, otherwise the previous one), `season`, `refresh-interval` |
13
13
  | `<hsot-standings>` | Standings, every conference for a sport | `sport`, `season` |
14
14
  | `<hsot-rankings>` | The weekly Top 25 with movement + rank history | `sport`, `gender` (poll family), `season`, deep link `?poll=YYYY-MM-DD` |
15
15
  | `<hsot-school>` | School hub: hero, team tabs, schedule, roster, honors | `school-id`, `sport` (initial tab, deep link `?sport=`), `season` |
16
16
  | `<hsot-boxscore>` | Game detail: line score, coverage, season context | `game-id`, `refresh-interval` |
17
+ | `<hsot-school-search>` | "Find Your School" typeahead for the right rail (standalone: fetches `GET /schools?q=` itself, no injected client) | `api`, `school-href`, `limit`, `placeholder` |
17
18
 
18
- Shared attributes on every component:
19
+ `hsot-scores` lists live games first, then matchups featuring ranked teams
20
+ (#1 at the top, using the poll in effect on the game date), then the rest in
21
+ schedule order.
22
+
23
+ Shared attributes on every data component (`hsot-school-search` takes only
24
+ `api` and `school-href`):
19
25
 
20
26
  - `api` — base URL of the api-hsot **public read surface** (tokenless):
21
27
  `https://api.highschoolot.com/hsot/v1/public`.
@@ -28,6 +34,55 @@ Shared attributes on every component:
28
34
  `/{sport}/{view}/`. The site's URL space belongs to Studio publications, so
29
35
  these are overridable per mount.
30
36
  - `refresh-interval` — milliseconds between reloads (live surfaces). 0 = off.
37
+ - `promo-image`, `promo-href`, `promo-alt` — a sponsor banner across the top
38
+ of the view content. The image is required; without an href it renders
39
+ unlinked. Links open in a new tab with `rel="sponsored noopener"`.
40
+
41
+ ## The section band
42
+
43
+ `hsot-scores`, `hsot-standings` and `hsot-rankings` open with the section-front
44
+ band from the public site (`hsot-section-header`): the sport title on the dark
45
+ red-baselined header, with the section sub-nav beneath it. The sub-nav row
46
+ renders only when the current URL is one of the sport's general section pages —
47
+ the component matches `location.pathname` (or a `#/…` hash route, as in the
48
+ demo harness) against its own `section-href` template, and school or game
49
+ detail URLs (per `school-href` / `game-href`) never qualify — so the section
50
+ front's sub-nav persists across the data pages it links to without appearing
51
+ on a page scoped to one team or game.
52
+
53
+ The default links are Home, Scores/Schedule, Playoff Brackets, Standings
54
+ (split into Boys/Girls when the sport's teams field both sides) and
55
+ Polls &amp; Rankings, filled from `section-href`. To reproduce a section
56
+ front's custom items exactly, slot the same anchors its `hsot-section-header`
57
+ takes; `aria-current="page"` is kept in sync from the URL either way:
58
+
59
+ ```html
60
+ <hsot-scores sport="football" api="…">
61
+ <a slot="nav" href="/football/">Football News</a>
62
+ <a slot="nav" href="/football/scores/">Scores/Schedules</a>
63
+ <a slot="nav" href="/football/rankings/">Polls &amp; Rankings</a>
64
+ <a slot="nav" href="/football/page/14674638/">Football Friday</a>
65
+ </hsot-scores>
66
+ ```
67
+
68
+ ## The right rail
69
+
70
+ Every data component accepts light-DOM children with `slot="rail"`. When any
71
+ are present the view content and the rail share a divided two-column layout
72
+ (300px rail at 1200px and up; stacked beneath the content below that). The
73
+ data-page template supplies the rail units — promo, school search, ad slots —
74
+ so the components never know what lives there:
75
+
76
+ ```html
77
+ <hsot-standings sport="football" api="…"
78
+ promo-image="https://…/sponsor.png" promo-href="https://sponsor.example" promo-alt="Presented by …">
79
+ <div slot="rail">
80
+ <hsot-school-search api="…" school-href="/school/{id}/"></hsot-school-search>
81
+ </div>
82
+ </hsot-standings>
83
+ ```
84
+
85
+ Without slotted rail content the view renders full width, unchanged.
31
86
 
32
87
  ## Derivation lives here, for now
33
88
 
@@ -84,7 +139,7 @@ alias (`/hsot-data/v0/`) rather than `latest`.
84
139
  From an app:
85
140
 
86
141
  ```js
87
- import '@wral/hsot-data/define'; // defines all five elements
142
+ import '@wral/hsot-data/define'; // defines all six elements
88
143
  // or
89
144
  import { HsotStandings } from '@wral/hsot-data';
90
145
  ```
package/dist/define.mjs CHANGED
@@ -1,18 +1,19 @@
1
- import { H as e, b as n, a as c, d as i, c as a } from "./hsot-boxscore-HfW4EnqW.js";
1
+ import { c as e, H as n, b as c, a, e as i, d as h } from "./hsot-school-search-DTqWAryB.js";
2
2
  const r = {
3
- "hsot-scores": a,
3
+ "hsot-scores": h,
4
4
  "hsot-standings": i,
5
- "hsot-rankings": c,
6
- "hsot-school": n,
7
- "hsot-boxscore": e
5
+ "hsot-rankings": a,
6
+ "hsot-school": c,
7
+ "hsot-boxscore": n,
8
+ "hsot-school-search": e
8
9
  };
9
- function f() {
10
+ function l() {
10
11
  const s = globalThis?.customElements;
11
12
  if (s)
12
13
  for (const [o, t] of Object.entries(r))
13
14
  s.get(o) || s.define(o, t);
14
15
  }
15
- typeof window < "u" && globalThis.customElements && f();
16
+ typeof window < "u" && globalThis.customElements && l();
16
17
  export {
17
- f as defineAll
18
+ l as defineAll
18
19
  };