@wral/active-alerts 0.2.4 → 0.2.5

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-CrVfjdZW.js";
1
+ import { W as t } from "./wral-active-alerts-C_bQfb95.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));
@@ -841,7 +841,6 @@ class ot extends C {
841
841
  return $`
842
842
  <div class="wrapper" role="region" aria-live="polite">
843
843
  <div class="heading">
844
- <span>Active Alerts</span>
845
844
  ${e ? $`<span class="pill">Loading…</span>` : ""}
846
845
  </div>
847
846
 
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { W as r, n as s, s as l } from "./wral-active-alerts-CrVfjdZW.js";
1
+ import { W as r, n as s, s as l } from "./wral-active-alerts-C_bQfb95.js";
2
2
  export {
3
3
  r as WralActiveAlerts,
4
4
  s as normalizeAlert,
@@ -2,7 +2,7 @@ import { LitElement as g, css as u, html as i } from "lit";
2
2
  import { createClient as b } from "@wral/sdk-alerts/v1";
3
3
  const v = {
4
4
  lg: 1366
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", A = (e) => {
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
7
  const t = e.link || e.url || e.href || "", s = e.title || e.headline || "";
8
8
  if (!s) return null;
@@ -16,7 +16,7 @@ const v = {
16
16
  body: e.body || e.summary || "",
17
17
  effectiveFrom: e.effectiveFrom || e.effective_from || ""
18
18
  };
19
- }, I = (e) => {
19
+ }, A = (e) => {
20
20
  if (!e) return "";
21
21
  try {
22
22
  const t = new Date(e);
@@ -202,7 +202,7 @@ class _ extends g {
202
202
  this.loading = !0, this.error = "";
203
203
  try {
204
204
  const t = await this.fetchActiveAlerts();
205
- this.items = (t?.items || []).map(A).filter(Boolean);
205
+ this.items = (t?.items || []).map(I).filter(Boolean);
206
206
  } catch (t) {
207
207
  console.error("[wral-active-alerts]", t), this.items = [], this.error = "Unable to load active alerts.";
208
208
  } finally {
@@ -220,7 +220,7 @@ class _ extends g {
220
220
  }
221
221
  render() {
222
222
  const { items: t, loading: s, error: a } = this, l = (r, n) => {
223
- const o = I(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`
223
+ 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
224
  <div class="thumb">
225
225
  <img
226
226
  src=${r.image}
@@ -260,7 +260,6 @@ class _ extends g {
260
260
  return i`
261
261
  <div class="wrapper" role="region" aria-live="polite">
262
262
  <div class="heading">
263
- <span>Active Alerts</span>
264
263
  ${s ? i`<span class="pill">Loading…</span>` : ""}
265
264
  </div>
266
265
 
@@ -281,6 +280,6 @@ class _ extends g {
281
280
  globalThis?.customElements && !globalThis.customElements.get("wral-active-alerts") && globalThis.customElements.define("wral-active-alerts", _);
282
281
  export {
283
282
  _ as W,
284
- A as n,
283
+ I as n,
285
284
  $ as s
286
285
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wral/active-alerts",
3
- "version": "0.2.4",
3
+ "version": "0.2.5",
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>",