@wral/hsot-data 0.1.0 → 0.1.1
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
|
@@ -17,7 +17,8 @@ exactly one of these elements.
|
|
|
17
17
|
|
|
18
18
|
Shared attributes on every component:
|
|
19
19
|
|
|
20
|
-
- `api` — base URL of api-hsot
|
|
20
|
+
- `api` — base URL of the api-hsot **public read surface** (tokenless):
|
|
21
|
+
`https://api.highschoolot.com/hsot/v1/public`.
|
|
21
22
|
Alternatively set the `.client` **property** to any object with the client
|
|
22
23
|
method surface (see `src/lib/client.mjs`) — the demo client, a test double,
|
|
23
24
|
or the future `@wral/sdk-hsot`. The property wins over the attribute.
|
|
@@ -61,19 +62,25 @@ npm run build # dist/index.mjs + dist/define.mjs (lit external)
|
|
|
61
62
|
The demo harness (`index.html`) runs the components against a seeded
|
|
62
63
|
in-memory client (`src/demo/demo-client.mjs`): a full football season with
|
|
63
64
|
live, overtime, forfeit and postponed games, nine weekly polls, and three
|
|
64
|
-
rosters. **Player names in the demo data are pseudonyms**
|
|
65
|
-
|
|
66
|
-
|
|
65
|
+
rosters. **Player names in the demo data are pseudonyms** and stay that way —
|
|
66
|
+
the minors'-names decision (approved 2026-08-19, roster-table fields only)
|
|
67
|
+
covers the live public surface, not this repo's fixtures. No live api-hsot
|
|
68
|
+
call is made by the harness.
|
|
67
69
|
|
|
68
70
|
## Consuming
|
|
69
71
|
|
|
70
72
|
From a page template (the data-page pattern):
|
|
71
73
|
|
|
72
74
|
```html
|
|
73
|
-
<script type="module" src="https://
|
|
74
|
-
<hsot-standings sport="football" api="https://api.highschoolot.com/v1"></hsot-standings>
|
|
75
|
+
<script type="module" src="https://web-components.cdn.highschoolot.com/hsot-data/latest/define.standalone.js"></script>
|
|
76
|
+
<hsot-standings sport="football" api="https://api.highschoolot.com/hsot/v1/public"></hsot-standings>
|
|
75
77
|
```
|
|
76
78
|
|
|
79
|
+
The CDN serves every tagged release at `/hsot-data/vX.Y.Z/` (immutable, 1-year
|
|
80
|
+
TTL) plus rolling aliases `/hsot-data/vX/`, `/hsot-data/vX.Y/` and
|
|
81
|
+
`/hsot-data/latest/` (5-minute TTL). Production pages should pin the major
|
|
82
|
+
alias (`/hsot-data/v0/`) rather than `latest`.
|
|
83
|
+
|
|
77
84
|
From an app:
|
|
78
85
|
|
|
79
86
|
```js
|
package/dist/define.mjs
CHANGED
|
@@ -601,7 +601,7 @@ class b extends R {
|
|
|
601
601
|
this._refreshId && (clearInterval(this._refreshId), this._refreshId = null);
|
|
602
602
|
}
|
|
603
603
|
render() {
|
|
604
|
-
return this.error === "not-configured" ? d`<div class="error">This component needs an <code>api</code> attribute (the api-hsot
|
|
604
|
+
return this.error === "not-configured" ? d`<div class="error">This component needs an <code>api</code> attribute (the api-hsot public read-surface base URL) or an injected client.</div>` : this.error ? d`<div class="error">Unable to load right now. <button class="chip" @click=${() => this.load()}>Retry</button></div>` : this.data ? this.renderView() : d`<div class="loading" role="status">Loading…</div>`;
|
|
605
605
|
}
|
|
606
606
|
renderView() {
|
|
607
607
|
return d``;
|
|
@@ -642,24 +642,24 @@ const g = (r) => Object.fromEntries((r || []).map((t) => [t.id, t])), ge = w`
|
|
|
642
642
|
}
|
|
643
643
|
.mut { color: var(--hsot-gray-5); }
|
|
644
644
|
`, $e = w`
|
|
645
|
-
.band { background: var(--hsot-
|
|
645
|
+
.band { background: var(--hsot-white); color: var(--hsot-black); }
|
|
646
646
|
.band .inner { max-width: 1366px; margin: 0 auto; padding: 1.1rem 1.25rem 0; }
|
|
647
647
|
.band h1, .band h2.bandtitle {
|
|
648
648
|
margin: 0; font-family: var(--hsot-heading-font); font-size: 2.4rem; font-weight: 500;
|
|
649
|
-
letter-spacing: -0.035em; line-height: 1.1; text-transform: capitalize; color: var(--hsot-
|
|
649
|
+
letter-spacing: -0.035em; line-height: 1.1; text-transform: capitalize; color: var(--hsot-black);
|
|
650
650
|
}
|
|
651
|
-
.band .sub { margin: 0.25rem 0 0.9rem; color:
|
|
651
|
+
.band .sub { margin: 0.25rem 0 0.9rem; color: var(--hsot-gray-5); font-size: 0.95rem; }
|
|
652
652
|
.band nav.tabs {
|
|
653
|
-
display: flex; gap: 1rem; border-top: 1px solid
|
|
653
|
+
display: flex; gap: 1rem; border-top: 1px solid var(--hsot-gray-2);
|
|
654
654
|
max-width: 1366px; margin: 0 auto; padding: 0 1.25rem; overflow-x: auto;
|
|
655
655
|
}
|
|
656
656
|
.band nav.tabs a, .band nav.tabs span {
|
|
657
657
|
font-family: var(--hsot-heading-font); font-weight: 500; font-size: 0.875rem;
|
|
658
|
-
text-transform: uppercase; text-decoration: none; color: var(--hsot-
|
|
658
|
+
text-transform: uppercase; text-decoration: none; color: var(--hsot-black);
|
|
659
659
|
padding: 0.55rem 0.15rem; white-space: nowrap; border-bottom: 3px solid transparent;
|
|
660
660
|
}
|
|
661
661
|
.band nav.tabs a.on { border-bottom-color: var(--hsot-red); }
|
|
662
|
-
.band nav.tabs span.off { color:
|
|
662
|
+
.band nav.tabs span.off { color: var(--hsot-gray-4); cursor: not-allowed; }
|
|
663
663
|
@media (max-width: 720px) { .band h1, .band h2.bandtitle { font-size: 1.8rem; } }
|
|
664
664
|
`, ve = w`
|
|
665
665
|
.view { max-width: 1366px; margin: 0 auto; padding: 1.25rem; box-sizing: border-box; }
|
|
@@ -1386,7 +1386,9 @@ class Gt extends b {
|
|
|
1386
1386
|
t.listConferences(),
|
|
1387
1387
|
i ? t.listRankings({ sport: i.sport }) : Promise.resolve({ items: [] }),
|
|
1388
1388
|
i ? t.listRosters({ teamId: i.id }) : Promise.resolve({ items: [] }),
|
|
1389
|
-
|
|
1389
|
+
// teamId is the public surface's one players filter (roster
|
|
1390
|
+
// membership) — never fetch the whole collection.
|
|
1391
|
+
i ? t.listPlayers({ teamId: i.id }) : Promise.resolve({ items: [] })
|
|
1390
1392
|
]);
|
|
1391
1393
|
return {
|
|
1392
1394
|
season: e,
|
|
@@ -101,7 +101,7 @@ class y extends J {
|
|
|
101
101
|
this._refreshId && (clearInterval(this._refreshId), this._refreshId = null);
|
|
102
102
|
}
|
|
103
103
|
render() {
|
|
104
|
-
return this.error === "not-configured" ? l`<div class="error">This component needs an <code>api</code> attribute (the api-hsot
|
|
104
|
+
return this.error === "not-configured" ? l`<div class="error">This component needs an <code>api</code> attribute (the api-hsot public read-surface base URL) or an injected client.</div>` : this.error ? l`<div class="error">Unable to load right now. <button class="chip" @click=${() => this.load()}>Retry</button></div>` : this.data ? this.renderView() : l`<div class="loading" role="status">Loading…</div>`;
|
|
105
105
|
}
|
|
106
106
|
renderView() {
|
|
107
107
|
return l``;
|
|
@@ -142,24 +142,24 @@ const g = (a) => Object.fromEntries((a || []).map((e) => [e.id, e])), se = b`
|
|
|
142
142
|
}
|
|
143
143
|
.mut { color: var(--hsot-gray-5); }
|
|
144
144
|
`, ae = b`
|
|
145
|
-
.band { background: var(--hsot-
|
|
145
|
+
.band { background: var(--hsot-white); color: var(--hsot-black); }
|
|
146
146
|
.band .inner { max-width: 1366px; margin: 0 auto; padding: 1.1rem 1.25rem 0; }
|
|
147
147
|
.band h1, .band h2.bandtitle {
|
|
148
148
|
margin: 0; font-family: var(--hsot-heading-font); font-size: 2.4rem; font-weight: 500;
|
|
149
|
-
letter-spacing: -0.035em; line-height: 1.1; text-transform: capitalize; color: var(--hsot-
|
|
149
|
+
letter-spacing: -0.035em; line-height: 1.1; text-transform: capitalize; color: var(--hsot-black);
|
|
150
150
|
}
|
|
151
|
-
.band .sub { margin: 0.25rem 0 0.9rem; color:
|
|
151
|
+
.band .sub { margin: 0.25rem 0 0.9rem; color: var(--hsot-gray-5); font-size: 0.95rem; }
|
|
152
152
|
.band nav.tabs {
|
|
153
|
-
display: flex; gap: 1rem; border-top: 1px solid
|
|
153
|
+
display: flex; gap: 1rem; border-top: 1px solid var(--hsot-gray-2);
|
|
154
154
|
max-width: 1366px; margin: 0 auto; padding: 0 1.25rem; overflow-x: auto;
|
|
155
155
|
}
|
|
156
156
|
.band nav.tabs a, .band nav.tabs span {
|
|
157
157
|
font-family: var(--hsot-heading-font); font-weight: 500; font-size: 0.875rem;
|
|
158
|
-
text-transform: uppercase; text-decoration: none; color: var(--hsot-
|
|
158
|
+
text-transform: uppercase; text-decoration: none; color: var(--hsot-black);
|
|
159
159
|
padding: 0.55rem 0.15rem; white-space: nowrap; border-bottom: 3px solid transparent;
|
|
160
160
|
}
|
|
161
161
|
.band nav.tabs a.on { border-bottom-color: var(--hsot-red); }
|
|
162
|
-
.band nav.tabs span.off { color:
|
|
162
|
+
.band nav.tabs span.off { color: var(--hsot-gray-4); cursor: not-allowed; }
|
|
163
163
|
@media (max-width: 720px) { .band h1, .band h2.bandtitle { font-size: 1.8rem; } }
|
|
164
164
|
`, re = b`
|
|
165
165
|
.view { max-width: 1366px; margin: 0 auto; padding: 1.25rem; box-sizing: border-box; }
|
|
@@ -892,7 +892,9 @@ class $e extends y {
|
|
|
892
892
|
e.listConferences(),
|
|
893
893
|
n ? e.listRankings({ sport: n.sport }) : Promise.resolve({ items: [] }),
|
|
894
894
|
n ? e.listRosters({ teamId: n.id }) : Promise.resolve({ items: [] }),
|
|
895
|
-
|
|
895
|
+
// teamId is the public surface's one players filter (roster
|
|
896
|
+
// membership) — never fetch the whole collection.
|
|
897
|
+
n ? e.listPlayers({ teamId: n.id }) : Promise.resolve({ items: [] })
|
|
896
898
|
]);
|
|
897
899
|
return {
|
|
898
900
|
season: t,
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { D as o, H as e, a as t, b as r, c as n, d as l, e as c, f as i, g as H, h as g, p as d, r as m, i as R, s as S, j as f, t as p } from "./hsot-boxscore-
|
|
1
|
+
import { D as o, H as e, a as t, b as r, c as n, d as l, e as c, f as i, g as H, h as g, p as d, r as m, i as R, s as S, j as f, t as p } from "./hsot-boxscore-D-tEuTZe.js";
|
|
2
2
|
export {
|
|
3
3
|
o as DEFAULT_HREFS,
|
|
4
4
|
e as HsotBoxscore,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wral/hsot-data",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Lit web components for the HighSchoolOT public data pages: scores/schedules, standings, rankings, school pages, and box scores, rendered from api-hsot v1 read payloads.",
|
|
6
6
|
"author": "WRAL Digital",
|