@scrippsproduct/networks-ui-library 1.1.0-alpha.5 → 1.1.0-alpha.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.
@@ -1,6 +1,6 @@
1
- import { jsx as a, jsxs as d } from "react/jsx-runtime";
2
- import { useReducer as u, useState as R, useRef as w, useCallback as A, useEffect as c } from "react";
3
- import { classes as T, getMinutesFromStr as L } from "../../utils/helpers.js";
1
+ import { jsx as a, jsxs as y } from "react/jsx-runtime";
2
+ import { useReducer as R, useState as A, useRef as w, useCallback as L, useEffect as v } from "react";
3
+ import { classes as T, getMinutesFromStr as u } from "../../utils/helpers.js";
4
4
  import { useScheduleContext as b } from "../ScheduleLayout/useScheduleContext.js";
5
5
  import { Loading as x } from "../Loading/Loading.js";
6
6
  import { SportsItem as D } from "./schedule-list-items/SportsItem.js";
@@ -22,7 +22,7 @@ import '../../assets/ScheduleList.css';const f = {
22
22
  "image-card__content": "_image-card__content_wmqq1_122"
23
23
  };
24
24
  function S(r) {
25
- return typeof r == "object" && !Array.isArray(r) && "queryStatus" in r && r.queryStatus === "no-results";
25
+ return typeof r == "object" && !Array.isArray(r) && (r == null ? void 0 : r.queryStatus) && r.queryStatus === "no-results";
26
26
  }
27
27
  function C(r, p) {
28
28
  switch (p.type) {
@@ -38,8 +38,8 @@ function C(r, p) {
38
38
  return r;
39
39
  }
40
40
  }
41
- const v = (r) => {
42
- var p, t, s, n, e, o, y, g, _, l, i;
41
+ const E = (r) => {
42
+ var p, t, s, n, e, o, d, g, _, l, i;
43
43
  return (p = r.video) != null && p.brightcove_id ? {
44
44
  label: "Watch Preview",
45
45
  type: "play-video",
@@ -73,7 +73,7 @@ const v = (r) => {
73
73
  //'inline',
74
74
  } : (((t = r == null ? void 0 : r.content) == null ? void 0 : t.external_link) !== void 0 && ((s = r == null ? void 0 : r.content) == null ? void 0 : s.external_link) !== "" || ((n = r == null ? void 0 : r.content) == null ? void 0 : n.slug) !== void 0 && ((e = r == null ? void 0 : r.content) == null ? void 0 : e.slug) !== "") && !((o = r == null ? void 0 : r.content) != null && o.prevent_detail_page) ? {
75
75
  label: (r == null ? void 0 : r.program_class) === "Episode" ? "View Series Details" : (r == null ? void 0 : r.program_class) === "Film" ? "View Movie Details" : "Learn More",
76
- type: (y = r == null ? void 0 : r.content) != null && y.external_link ? "external-link" : "internal-link",
76
+ type: (d = r == null ? void 0 : r.content) != null && d.external_link ? "external-link" : "internal-link",
77
77
  href: (g = r == null ? void 0 : r.content) != null && g.external_link ? (_ = r == null ? void 0 : r.content) == null ? void 0 : _.external_link : r.program_class === "Episode" ? `/show/${(l = r == null ? void 0 : r.content) == null ? void 0 : l.slug}` : `/movie/${(i = r == null ? void 0 : r.content) == null ? void 0 : i.slug}`,
78
78
  position: "inline"
79
79
  } : {
@@ -87,21 +87,21 @@ function H({
87
87
  handleClicks: r = () => !0,
88
88
  fetchError: p = !1
89
89
  }) {
90
- const { schedule: t, isLoading: s } = b(), [n, e] = u(C, "idle"), [o, y] = R(t), g = w(null), _ = w(null), l = A(() => {
90
+ const { schedule: t, isLoading: s } = b(), [n, e] = R(C, "idle"), [o, d] = A(t), g = w(null), _ = w(null), l = L(() => {
91
91
  _.current && (clearTimeout(_.current), _.current = null), n === "exiting" ? e({ type: "EXIT_COMPLETE" }) : n === "entering" && e({ type: "ENTER_COMPLETE" });
92
92
  }, [n]);
93
- return c(() => {
93
+ return v(() => {
94
94
  const i = g.current;
95
95
  if (i)
96
96
  return i.addEventListener("animationend", l), () => {
97
97
  i.removeEventListener("animationend", l);
98
98
  };
99
- }, [l]), c(() => {
99
+ }, [l]), v(() => {
100
100
  s && n === "idle" && e({ type: "START_EXIT" });
101
- }, [s, n]), c(() => {
101
+ }, [s, n]), v(() => {
102
102
  const i = S(t) || Array.isArray(t) && t.length >= 0;
103
- !s && n === "loading" && i && (y(t), e({ type: "SCHEDULE_LOADED" }));
104
- }, [s, n, t]), c(() => () => {
103
+ !s && n === "loading" && i && (d(t), e({ type: "SCHEDULE_LOADED" }));
104
+ }, [s, n, t]), v(() => () => {
105
105
  _.current && clearTimeout(_.current);
106
106
  }, []), n === "loading" ? /* @__PURE__ */ a(
107
107
  "div",
@@ -114,14 +114,14 @@ function H({
114
114
  },
115
115
  children: /* @__PURE__ */ a(x, {})
116
116
  }
117
- ) : p ? /* @__PURE__ */ d("div", { className: "schedule-list__no-schedule", children: [
117
+ ) : p ? /* @__PURE__ */ y("div", { className: "schedule-list__no-schedule", children: [
118
118
  /* @__PURE__ */ a("h2", { children: "There was an error loading the schedule for this day." }),
119
- /* @__PURE__ */ d("p", { children: [
119
+ /* @__PURE__ */ y("p", { children: [
120
120
  "Please try again later. If this problem persists report it at ",
121
121
  /* @__PURE__ */ a("a", { href: "https://support.iontelevision.com/support/home", children: "our support page" }),
122
122
  "."
123
123
  ] })
124
- ] }) : S(o) ? /* @__PURE__ */ d(
124
+ ] }) : S(o) ? /* @__PURE__ */ y(
125
125
  "div",
126
126
  {
127
127
  className: T([
@@ -132,14 +132,14 @@ function H({
132
132
  style: { animationDelay: "500ms" },
133
133
  children: [
134
134
  /* @__PURE__ */ a("h2", { children: "There are no shows scheduled for this day." }),
135
- /* @__PURE__ */ d("p", { children: [
135
+ /* @__PURE__ */ y("p", { children: [
136
136
  "Please try again later. If this problem persists report it at ",
137
137
  /* @__PURE__ */ a("a", { href: "https://support.iontelevision.com/support/home", children: "our support page" }),
138
138
  "."
139
139
  ] })
140
140
  ]
141
141
  }
142
- ) : Array.isArray(o) && o.length === 0 ? /* @__PURE__ */ d(
142
+ ) : Array.isArray(o) && o.length === 0 ? /* @__PURE__ */ y(
143
143
  "div",
144
144
  {
145
145
  className: T([
@@ -159,34 +159,34 @@ function H({
159
159
  "data-state": n,
160
160
  ref: g,
161
161
  children: Array.isArray(o) && o.map((i) => {
162
- const q = L(i.element_length), E = v(i).type === "" ? [q, i.rating] : [q, i.rating, " "];
162
+ const c = u(i.element_length), q = E(i).type === "" ? [c, i.rating] : [c, i.rating, " "];
163
163
  return i.program_class === "Episode" ? /* @__PURE__ */ a(
164
164
  M,
165
165
  {
166
- determineCTA: v,
166
+ determineCTA: E,
167
167
  handleClicks: r,
168
168
  scheduleItem: i,
169
- strListArr: E,
169
+ strListArr: q,
170
170
  styles: f
171
171
  },
172
172
  `schedule-list-${i.id}`
173
173
  ) : i.program_class === "Film" || i.program_class === "Movie" || i.program_class === "Special" ? /* @__PURE__ */ a(
174
174
  k,
175
175
  {
176
- determineCTA: v,
176
+ determineCTA: E,
177
177
  handleClicks: r,
178
178
  scheduleItem: i,
179
- strListArr: E,
179
+ strListArr: q,
180
180
  styles: f
181
181
  },
182
182
  `schedule-list-${i.id}`
183
183
  ) : i.program_class === "Sports" ? /* @__PURE__ */ a(
184
184
  D,
185
185
  {
186
- determineCTA: v,
186
+ determineCTA: E,
187
187
  handleClicks: r,
188
188
  scheduleItem: i,
189
- strListArr: E,
189
+ strListArr: q,
190
190
  styles: f
191
191
  },
192
192
  `schedule-list-${i.id}`
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.1.0-alpha.5",
2
+ "version": "1.1.0-alpha.6",
3
3
  "name": "@scrippsproduct/networks-ui-library",
4
4
  "description": "React Component Library for use in Scripps Networks external applications",
5
5
  "author": {