@wral/active-alerts 0.2.5 → 0.2.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/dist/define.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { W as t } from "./wral-active-alerts-C_bQfb95.js";
1
+ import { W as t } from "./wral-active-alerts-BrdwAfki.js";
2
2
  function i() {
3
3
  const e = globalThis?.customElements;
4
4
  e && (e.get("wral-active-alerts") || e.define("wral-active-alerts", t));
@@ -759,6 +759,7 @@ class ot extends C {
759
759
  }
760
760
  @media (max-width: 720px) {
761
761
  .wrapper { padding: .75rem .75rem 1.25rem; }
762
+ .alert-card { grid-template-columns: 1fr; }
762
763
  }
763
764
  `;
764
765
  async firstUpdated() {
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { W as r, n as s, s as l } from "./wral-active-alerts-C_bQfb95.js";
1
+ import { W as r, n as s, s as l } from "./wral-active-alerts-BrdwAfki.js";
2
2
  export {
3
3
  r as WralActiveAlerts,
4
4
  s as normalizeAlert,
@@ -4,13 +4,13 @@ const v = {
4
4
  lg: 1366
5
5
  }, y = "https://api.wral.com/alerts/v1/active/alerts", x = "https://assets.wral.com/a1cc0e86-adab-48e9-bd80-703cd2c56aff?w=1200&h=630", $ = (e) => String(e || "Alert").replace(/[^\p{L}\p{N}]/gu, " ").replace(/\s+/g, " ").trim() || "Alert", I = (e) => {
6
6
  if (!e) return null;
7
- const t = e.link || e.url || e.href || "", s = e.title || e.headline || "";
8
- if (!s) return null;
9
- const a = String(e.topic || "").trim(), l = a.toLowerCase(), r = e.caption || a || "Alert", n = e.image || e.imageUrl || e.image_url || x;
7
+ const t = e.link || e.url || e.href || "", l = e.title || e.headline || "";
8
+ if (!l) return null;
9
+ const a = String(e.topic || "").trim(), s = a.toLowerCase(), r = e.caption || a || "Alert", n = e.image || e.imageUrl || e.image_url || x;
10
10
  return {
11
11
  url: t,
12
- title: s,
13
- topic: l || a,
12
+ title: l,
13
+ topic: s || a,
14
14
  caption: r,
15
15
  image: n,
16
16
  body: e.body || e.summary || "",
@@ -178,6 +178,7 @@ class _ extends g {
178
178
  }
179
179
  @media (max-width: 720px) {
180
180
  .wrapper { padding: .75rem .75rem 1.25rem; }
181
+ .alert-card { grid-template-columns: 1fr; }
181
182
  }
182
183
  `;
183
184
  async firstUpdated() {
@@ -219,7 +220,7 @@ class _ extends g {
219
220
  this._refreshId && (globalThis.clearInterval(this._refreshId), this._refreshId = null);
220
221
  }
221
222
  render() {
222
- const { items: t, loading: s, error: a } = this, l = (r, n) => {
223
+ const { items: t, loading: l, error: a } = this, s = (r, n) => {
223
224
  const o = A(r.effectiveFrom), h = String(r.topic || "").trim().toLowerCase(), c = r.title || r.body, d = String(r.title || "").trim(), m = String(r.body || "").trim(), f = d && m && d !== m ? r.body : "", p = i`
224
225
  <div class="thumb">
225
226
  <img
@@ -260,17 +261,17 @@ class _ extends g {
260
261
  return i`
261
262
  <div class="wrapper" role="region" aria-live="polite">
262
263
  <div class="heading">
263
- ${s ? i`<span class="pill">Loading…</span>` : ""}
264
+ ${l ? i`<span class="pill">Loading…</span>` : ""}
264
265
  </div>
265
266
 
266
267
  ${a ? i`<div class="status error">${a}</div>` : ""}
267
- ${!a && !s && !t.length ? i`
268
+ ${!a && !l && !t.length ? i`
268
269
  <div class="empty">No active alerts right now.</div>
269
270
  ` : ""}
270
271
 
271
272
  ${t.length ? i`
272
273
  <ul class="list">
273
- ${t.map(l)}
274
+ ${t.map(s)}
274
275
  </ul>
275
276
  ` : ""}
276
277
  </div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wral/active-alerts",
3
- "version": "0.2.5",
3
+ "version": "0.2.6",
4
4
  "type": "module",
5
5
  "description": "Lit web component for rendering the current set of active WRAL alerts.",
6
6
  "author": "Dominick Jones <djones@wral.com>",