@scrippsproduct/networks-ui-library 1.1.4 → 1.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.
|
@@ -1,110 +1,110 @@
|
|
|
1
1
|
import { jsx as t, jsxs as b } from "react/jsx-runtime";
|
|
2
|
-
import { useRef as
|
|
3
|
-
import { f as
|
|
4
|
-
import { l as
|
|
5
|
-
import { classes as
|
|
6
|
-
import { ScheduleProvider as
|
|
7
|
-
import { useScheduleContext as
|
|
8
|
-
import { DateNavigation as
|
|
9
|
-
import { ScheduleList as
|
|
10
|
-
|
|
11
|
-
import '../../assets/ScheduleLayout.css';function
|
|
12
|
-
handleScheduleClicks:
|
|
2
|
+
import { useRef as a, useCallback as w, useEffect as y } from "react";
|
|
3
|
+
import { f as S } from "../../format-YhWt2D8M.mjs";
|
|
4
|
+
import { l as L } from "../../logger-C0N7U0YY.mjs";
|
|
5
|
+
import { classes as g } from "../../utils/helpers.js";
|
|
6
|
+
import { ScheduleProvider as E } from "./ScheduleContext.js";
|
|
7
|
+
import { useScheduleContext as q } from "./useScheduleContext.js";
|
|
8
|
+
import { DateNavigation as T } from "../DateNavigation/DateNavigation.js";
|
|
9
|
+
import { ScheduleList as k } from "../ScheduleList/ScheduleList.js";
|
|
10
|
+
L.setComponent("ScheduleLayout");
|
|
11
|
+
import '../../assets/ScheduleLayout.css';function C({
|
|
12
|
+
handleScheduleClicks: d = () => !0
|
|
13
13
|
}) {
|
|
14
14
|
console.warn("ScheduleLayoutContent rendered");
|
|
15
|
-
const { currentDate: n } =
|
|
16
|
-
const
|
|
15
|
+
const { currentDate: n } = q(), r = a(null), f = a(0), o = a(null), l = a(null), m = a(!0), s = w((i) => {
|
|
16
|
+
const c = () => {
|
|
17
17
|
let e;
|
|
18
|
-
const
|
|
19
|
-
if (
|
|
20
|
-
const
|
|
21
|
-
|
|
18
|
+
const u = document.querySelector(`.date-navigation__day[aria-controls="${S(i, "yyyy-MM-dd")}"]`);
|
|
19
|
+
if (u && (e = u.parentElement), e && r.current) {
|
|
20
|
+
const v = e.offsetLeft + e.offsetWidth / 2;
|
|
21
|
+
f.current = v, r.current.style.setProperty(
|
|
22
22
|
"--pointer-position",
|
|
23
|
-
`${
|
|
23
|
+
`${v}px`
|
|
24
24
|
);
|
|
25
25
|
}
|
|
26
|
-
},
|
|
27
|
-
|
|
26
|
+
}, h = () => {
|
|
27
|
+
l.current || (l.current = document.querySelector("sticky-content-wrapper"));
|
|
28
28
|
const e = document.querySelector(".mobile-nav");
|
|
29
|
-
if (
|
|
30
|
-
const
|
|
29
|
+
if (l.current) {
|
|
30
|
+
const u = e && window.getComputedStyle(e).display !== "none" ? e.offsetHeight + 8 : 16;
|
|
31
31
|
window.scrollTo({
|
|
32
|
-
behavior: "
|
|
33
|
-
top:
|
|
32
|
+
behavior: "auto",
|
|
33
|
+
top: l.current.offsetTop - u,
|
|
34
34
|
left: 0
|
|
35
35
|
});
|
|
36
36
|
}
|
|
37
37
|
};
|
|
38
38
|
if (!r.current) {
|
|
39
39
|
const e = setInterval(() => {
|
|
40
|
-
r.current = document.querySelector(".date-navigation__list"), r.current && (clearInterval(e),
|
|
40
|
+
r.current = document.querySelector(".date-navigation__list"), r.current && (clearInterval(e), c());
|
|
41
41
|
}, 100);
|
|
42
42
|
setTimeout(() => {
|
|
43
43
|
clearInterval(e);
|
|
44
44
|
}, 3e3);
|
|
45
45
|
return;
|
|
46
46
|
}
|
|
47
|
-
|
|
48
|
-
}, []),
|
|
47
|
+
c(), m.current || h();
|
|
48
|
+
}, []), p = w(() => {
|
|
49
49
|
o.current && clearTimeout(o.current), o.current = window.setTimeout(() => {
|
|
50
|
-
|
|
50
|
+
s(n);
|
|
51
51
|
}, 250);
|
|
52
|
-
}, [n,
|
|
53
|
-
return
|
|
54
|
-
window.removeEventListener("resize",
|
|
55
|
-
}), [
|
|
56
|
-
const
|
|
57
|
-
|
|
52
|
+
}, [n, s]);
|
|
53
|
+
return y(() => (window.addEventListener("resize", p), () => {
|
|
54
|
+
window.removeEventListener("resize", p), o.current && clearTimeout(o.current);
|
|
55
|
+
}), [s, p]), y(() => {
|
|
56
|
+
const i = document.querySelector(".header-divider"), c = document.querySelector("sticky-content-wrapper");
|
|
57
|
+
c && i && new IntersectionObserver(
|
|
58
58
|
([e]) => {
|
|
59
|
-
e.intersectionRatio < 1 ?
|
|
59
|
+
e.intersectionRatio < 1 ? c.dataset.pinnedState = "pinned" : c.dataset.pinnedState = "unpinned";
|
|
60
60
|
},
|
|
61
61
|
{
|
|
62
62
|
threshold: [1],
|
|
63
63
|
rootMargin: "-37px"
|
|
64
64
|
}
|
|
65
|
-
).observe(
|
|
66
|
-
}, []),
|
|
67
|
-
const
|
|
65
|
+
).observe(i);
|
|
66
|
+
}, []), y(() => {
|
|
67
|
+
const i = requestAnimationFrame(() => {
|
|
68
68
|
requestAnimationFrame(() => {
|
|
69
|
-
|
|
69
|
+
s(n), m.current && (m.current = !1);
|
|
70
70
|
});
|
|
71
71
|
});
|
|
72
|
-
return () => cancelAnimationFrame(
|
|
73
|
-
}, [n,
|
|
72
|
+
return () => cancelAnimationFrame(i);
|
|
73
|
+
}, [n, s]), /* @__PURE__ */ b("schedule-layout", { children: [
|
|
74
74
|
/* @__PURE__ */ t("sticky-content-wrapper", { "data-pinned-state": "unpinned", children: /* @__PURE__ */ t(
|
|
75
75
|
"content-constrainer",
|
|
76
76
|
{
|
|
77
|
-
class:
|
|
77
|
+
class: g([
|
|
78
78
|
"content-constrainer--no-padding",
|
|
79
79
|
"content-constrainer--no-border",
|
|
80
80
|
"content-constrainer--lead-container",
|
|
81
81
|
"schedule-date-nav-constrainer"
|
|
82
82
|
]),
|
|
83
|
-
children: /* @__PURE__ */ t(
|
|
83
|
+
children: /* @__PURE__ */ t(T, {})
|
|
84
84
|
}
|
|
85
85
|
) }),
|
|
86
|
-
/* @__PURE__ */ t("section", { className: "page-section", id: "schedule-section", children: /* @__PURE__ */ t("content-constrainer", { class: "content-constrainer--no-border schedule-content-constrainer", children: /* @__PURE__ */ t("div", { id:
|
|
86
|
+
/* @__PURE__ */ t("section", { className: "page-section", id: "schedule-section", children: /* @__PURE__ */ t("content-constrainer", { class: "content-constrainer--no-border schedule-content-constrainer", children: /* @__PURE__ */ t("div", { id: S(n, "yyyy-MM-dd"), role: "tabpanel", children: /* @__PURE__ */ t(k, { handleClicks: d }) }) }) })
|
|
87
87
|
] });
|
|
88
88
|
}
|
|
89
|
-
function
|
|
90
|
-
fetchSchedule:
|
|
89
|
+
function _({
|
|
90
|
+
fetchSchedule: d,
|
|
91
91
|
initialSchedule: n = [],
|
|
92
92
|
weeks: r = [],
|
|
93
|
-
handleScheduleClicks:
|
|
93
|
+
handleScheduleClicks: f = () => !0,
|
|
94
94
|
handleDateChanged: o = () => !0
|
|
95
95
|
}) {
|
|
96
96
|
return /* @__PURE__ */ t(
|
|
97
|
-
|
|
97
|
+
E,
|
|
98
98
|
{
|
|
99
|
-
fetchSchedule:
|
|
99
|
+
fetchSchedule: d,
|
|
100
100
|
handleDateChanged: o,
|
|
101
101
|
initialSchedule: n,
|
|
102
102
|
weeks: r,
|
|
103
|
-
children: /* @__PURE__ */ t(
|
|
103
|
+
children: /* @__PURE__ */ t(C, { handleScheduleClicks: f })
|
|
104
104
|
}
|
|
105
105
|
);
|
|
106
106
|
}
|
|
107
107
|
export {
|
|
108
|
-
|
|
109
|
-
|
|
108
|
+
_ as ScheduleLayout,
|
|
109
|
+
_ as default
|
|
110
110
|
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useReducer as A, useState as
|
|
3
|
-
import { classes as
|
|
4
|
-
import { useScheduleContext as
|
|
5
|
-
import { Loading as
|
|
6
|
-
import { SportsItem as
|
|
7
|
-
import { SeriesItem as
|
|
8
|
-
import { MovieItem as
|
|
9
|
-
import '../../assets/ScheduleList.css';const
|
|
1
|
+
import { jsx as n, jsxs as v } from "react/jsx-runtime";
|
|
2
|
+
import { useReducer as A, useState as x, useRef as u, useCallback as C, useEffect as c } from "react";
|
|
3
|
+
import { classes as S, getMinutesFromStr as D } from "../../utils/helpers.js";
|
|
4
|
+
import { useScheduleContext as M } from "../ScheduleLayout/useScheduleContext.js";
|
|
5
|
+
import { Loading as O } from "../Loading/Loading.js";
|
|
6
|
+
import { SportsItem as P } from "./schedule-list-items/SportsItem.js";
|
|
7
|
+
import { SeriesItem as k } from "./schedule-list-items/SeriesItem.js";
|
|
8
|
+
import { MovieItem as N } from "./schedule-list-items/MovieItem.js";
|
|
9
|
+
import '../../assets/ScheduleList.css';const y = {
|
|
10
10
|
"schedule-list__item": "_schedule-list__item_686v7_1",
|
|
11
11
|
"schedule-list__airdate": "_schedule-list__airdate_686v7_14",
|
|
12
12
|
"airdate-formatter__date": "_airdate-formatter__date_686v7_22",
|
|
@@ -19,11 +19,11 @@ import '../../assets/ScheduleList.css';const l = {
|
|
|
19
19
|
"schedule-content-constrainer": "_schedule-content-constrainer_686v7_102",
|
|
20
20
|
"image-card__content": "_image-card__content_686v7_116"
|
|
21
21
|
};
|
|
22
|
-
function
|
|
22
|
+
function w(r) {
|
|
23
23
|
return typeof r == "object" && !Array.isArray(r) && (r == null ? void 0 : r.queryStatus) && r.queryStatus === "no-results";
|
|
24
24
|
}
|
|
25
|
-
function
|
|
26
|
-
switch (
|
|
25
|
+
function $(r, o) {
|
|
26
|
+
switch (o.type) {
|
|
27
27
|
case "START_EXIT":
|
|
28
28
|
return "exiting";
|
|
29
29
|
case "EXIT_COMPLETE":
|
|
@@ -36,9 +36,9 @@ function P(r, a) {
|
|
|
36
36
|
return r;
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
|
-
const
|
|
40
|
-
var a,
|
|
41
|
-
return (
|
|
39
|
+
const T = (r) => {
|
|
40
|
+
var o, a, d, t, e, s, E, l, p, f, i;
|
|
41
|
+
return (o = r.video) != null && o.brightcove_id ? {
|
|
42
42
|
label: "Watch Preview",
|
|
43
43
|
type: "play-video",
|
|
44
44
|
href: "",
|
|
@@ -69,10 +69,10 @@ const d = (r) => {
|
|
|
69
69
|
//'film',
|
|
70
70
|
position: void 0
|
|
71
71
|
//'inline',
|
|
72
|
-
} : (((
|
|
72
|
+
} : (((a = r == null ? void 0 : r.content) == null ? void 0 : a.external_link) !== void 0 && ((d = r == null ? void 0 : r.content) == null ? void 0 : d.external_link) !== "" || ((t = r == null ? void 0 : r.content) == null ? void 0 : t.slug) !== void 0 && ((e = r == null ? void 0 : r.content) == null ? void 0 : e.slug) !== "") && !((s = r == null ? void 0 : r.content) != null && s.prevent_detail_page) ? {
|
|
73
73
|
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",
|
|
74
74
|
type: (E = r == null ? void 0 : r.content) != null && E.external_link ? "external-link" : "internal-link",
|
|
75
|
-
href: (
|
|
75
|
+
href: (l = r == null ? void 0 : r.content) != null && l.external_link ? (p = r == null ? void 0 : r.content) == null ? void 0 : p.external_link : r.program_class === "Episode" ? `/show/${(f = r == null ? void 0 : r.content) == null ? void 0 : f.slug}` : `/movie/${(i = r == null ? void 0 : r.content) == null ? void 0 : i.slug}`,
|
|
76
76
|
position: "inline"
|
|
77
77
|
} : {
|
|
78
78
|
label: "",
|
|
@@ -81,28 +81,39 @@ const d = (r) => {
|
|
|
81
81
|
position: void 0
|
|
82
82
|
};
|
|
83
83
|
};
|
|
84
|
-
function
|
|
84
|
+
function B({
|
|
85
85
|
handleClicks: r = () => !0
|
|
86
86
|
}) {
|
|
87
|
-
const { schedule:
|
|
88
|
-
p.current && (clearTimeout(p.current), p.current = null),
|
|
89
|
-
}, [
|
|
90
|
-
return
|
|
91
|
-
const i =
|
|
87
|
+
const { schedule: o, isLoading: a, isError: d } = M(), [t, e] = A($, "idle"), [s, E] = x(o), l = u(null), p = u(null), f = C(() => {
|
|
88
|
+
p.current && (clearTimeout(p.current), p.current = null), t === "exiting" ? e({ type: "EXIT_COMPLETE" }) : t === "entering" && e({ type: "ENTER_COMPLETE" });
|
|
89
|
+
}, [t]);
|
|
90
|
+
return c(() => {
|
|
91
|
+
const i = l.current;
|
|
92
92
|
if (i)
|
|
93
|
-
return i.addEventListener("animationend",
|
|
94
|
-
i.removeEventListener("animationend",
|
|
93
|
+
return i.addEventListener("animationend", f), () => {
|
|
94
|
+
i.removeEventListener("animationend", f);
|
|
95
95
|
};
|
|
96
|
-
}, [
|
|
97
|
-
|
|
98
|
-
}, [
|
|
99
|
-
!
|
|
100
|
-
}, [
|
|
101
|
-
const i =
|
|
102
|
-
!
|
|
103
|
-
}, [
|
|
96
|
+
}, [f]), c(() => {
|
|
97
|
+
a && t === "idle" && e({ type: "START_EXIT" });
|
|
98
|
+
}, [a, t]), c(() => {
|
|
99
|
+
!a && t === "exiting" && e({ type: "EXIT_COMPLETE" });
|
|
100
|
+
}, [a, t]), c(() => {
|
|
101
|
+
const i = w(o) || Array.isArray(o) && o.length >= 0;
|
|
102
|
+
!a && t === "loading" && i && (E(o), e({ type: "SCHEDULE_LOADED" }));
|
|
103
|
+
}, [a, t, o]), c(() => {
|
|
104
|
+
if (t === "exiting" && l.current) {
|
|
105
|
+
const i = document.querySelector("sticky-content-wrapper"), g = document.querySelector(".mobile-nav");
|
|
106
|
+
let _ = 0;
|
|
107
|
+
i && (_ += i.offsetHeight), g && window.getComputedStyle(g).display !== "none" && (_ += g.offsetHeight), _ += 16;
|
|
108
|
+
const R = l.current.getBoundingClientRect(), L = window.pageYOffset || document.documentElement.scrollTop, b = R.top + L - _;
|
|
109
|
+
window.scrollTo({
|
|
110
|
+
top: b,
|
|
111
|
+
behavior: "auto"
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
}, [t]), c(() => () => {
|
|
104
115
|
p.current && clearTimeout(p.current);
|
|
105
|
-
}, []),
|
|
116
|
+
}, []), t === "loading" ? /* @__PURE__ */ n(
|
|
106
117
|
"div",
|
|
107
118
|
{
|
|
108
119
|
style: {
|
|
@@ -111,82 +122,82 @@ function q({
|
|
|
111
122
|
minHeight: "100dvh",
|
|
112
123
|
paddingTop: "6rem"
|
|
113
124
|
},
|
|
114
|
-
children: /* @__PURE__ */
|
|
125
|
+
children: /* @__PURE__ */ n(O, {})
|
|
115
126
|
}
|
|
116
|
-
) :
|
|
117
|
-
/* @__PURE__ */
|
|
118
|
-
/* @__PURE__ */
|
|
127
|
+
) : d ? /* @__PURE__ */ v("div", { className: "schedule-list__no-schedule", children: [
|
|
128
|
+
/* @__PURE__ */ n("h2", { children: "There was an error loading the schedule for this day." }),
|
|
129
|
+
/* @__PURE__ */ v("p", { children: [
|
|
119
130
|
"Please try again later. If this problem persists report it at ",
|
|
120
|
-
/* @__PURE__ */
|
|
131
|
+
/* @__PURE__ */ n("a", { href: "https://support.iontelevision.com/support/home", children: "our support page" }),
|
|
121
132
|
"."
|
|
122
133
|
] })
|
|
123
|
-
] }) :
|
|
134
|
+
] }) : w(s) ? /* @__PURE__ */ v(
|
|
124
135
|
"div",
|
|
125
136
|
{
|
|
126
|
-
className:
|
|
127
|
-
|
|
137
|
+
className: S([
|
|
138
|
+
y["schedule-list__no-schedule"],
|
|
128
139
|
"schedule-list__no-schedule"
|
|
129
140
|
]),
|
|
130
|
-
"data-state":
|
|
141
|
+
"data-state": t,
|
|
131
142
|
style: { animationDelay: "500ms" },
|
|
132
143
|
children: [
|
|
133
|
-
/* @__PURE__ */
|
|
134
|
-
/* @__PURE__ */
|
|
144
|
+
/* @__PURE__ */ n("h2", { children: "There are no shows scheduled for this day." }),
|
|
145
|
+
/* @__PURE__ */ v("p", { children: [
|
|
135
146
|
"Please try again later. If this problem persists report it at ",
|
|
136
|
-
/* @__PURE__ */
|
|
147
|
+
/* @__PURE__ */ n("a", { href: "https://support.iontelevision.com/support/home", children: "our support page" }),
|
|
137
148
|
"."
|
|
138
149
|
] })
|
|
139
150
|
]
|
|
140
151
|
}
|
|
141
|
-
) : Array.isArray(
|
|
152
|
+
) : Array.isArray(s) && s.length === 0 ? /* @__PURE__ */ v(
|
|
142
153
|
"div",
|
|
143
154
|
{
|
|
144
|
-
className:
|
|
145
|
-
|
|
155
|
+
className: S([
|
|
156
|
+
y["schedule-list__no-schedule"],
|
|
146
157
|
"schedule-list__no-schedule"
|
|
147
158
|
]),
|
|
148
|
-
"data-state":
|
|
159
|
+
"data-state": t,
|
|
149
160
|
children: [
|
|
150
|
-
/* @__PURE__ */
|
|
151
|
-
/* @__PURE__ */
|
|
161
|
+
/* @__PURE__ */ n("h2", { children: "Our programming schedule for today has completed." }),
|
|
162
|
+
/* @__PURE__ */ n("p", { children: "Our programming will restart at 6am." })
|
|
152
163
|
]
|
|
153
164
|
}
|
|
154
|
-
) : /* @__PURE__ */
|
|
165
|
+
) : /* @__PURE__ */ n(
|
|
155
166
|
"ul",
|
|
156
167
|
{
|
|
157
|
-
className: `${
|
|
158
|
-
"data-state":
|
|
159
|
-
ref:
|
|
160
|
-
children: Array.isArray(
|
|
161
|
-
const
|
|
162
|
-
return i.program_class === "Episode" ? /* @__PURE__ */
|
|
163
|
-
|
|
168
|
+
className: `${y["schedule-list"]} schedule-list`,
|
|
169
|
+
"data-state": t,
|
|
170
|
+
ref: l,
|
|
171
|
+
children: Array.isArray(s) && s.map((i) => {
|
|
172
|
+
const g = D(i.element_length), _ = T(i).type === "" ? [g, i.rating] : [g, i.rating, " "];
|
|
173
|
+
return i.program_class === "Episode" ? /* @__PURE__ */ n(
|
|
174
|
+
k,
|
|
164
175
|
{
|
|
165
|
-
determineCTA:
|
|
176
|
+
determineCTA: T,
|
|
166
177
|
handleClicks: r,
|
|
167
178
|
scheduleItem: i,
|
|
168
|
-
strListArr:
|
|
169
|
-
styles:
|
|
179
|
+
strListArr: _,
|
|
180
|
+
styles: y
|
|
170
181
|
},
|
|
171
182
|
`schedule-list-${i.id}`
|
|
172
|
-
) : i.program_class === "Film" || i.program_class === "Movie" || i.program_class === "Special" ? /* @__PURE__ */
|
|
173
|
-
|
|
183
|
+
) : i.program_class === "Film" || i.program_class === "Movie" || i.program_class === "Special" ? /* @__PURE__ */ n(
|
|
184
|
+
N,
|
|
174
185
|
{
|
|
175
|
-
determineCTA:
|
|
186
|
+
determineCTA: T,
|
|
176
187
|
handleClicks: r,
|
|
177
188
|
scheduleItem: i,
|
|
178
|
-
strListArr:
|
|
179
|
-
styles:
|
|
189
|
+
strListArr: _,
|
|
190
|
+
styles: y
|
|
180
191
|
},
|
|
181
192
|
`schedule-list-${i.id}`
|
|
182
|
-
) : i.program_class === "Sports" ? /* @__PURE__ */
|
|
183
|
-
|
|
193
|
+
) : i.program_class === "Sports" ? /* @__PURE__ */ n(
|
|
194
|
+
P,
|
|
184
195
|
{
|
|
185
|
-
determineCTA:
|
|
196
|
+
determineCTA: T,
|
|
186
197
|
handleClicks: r,
|
|
187
198
|
scheduleItem: i,
|
|
188
|
-
strListArr:
|
|
189
|
-
styles:
|
|
199
|
+
strListArr: _,
|
|
200
|
+
styles: y
|
|
190
201
|
},
|
|
191
202
|
`schedule-list-${i.id}`
|
|
192
203
|
) : null;
|
|
@@ -195,6 +206,6 @@ function q({
|
|
|
195
206
|
);
|
|
196
207
|
}
|
|
197
208
|
export {
|
|
198
|
-
|
|
199
|
-
|
|
209
|
+
B as ScheduleList,
|
|
210
|
+
B as default
|
|
200
211
|
};
|
package/package.json
CHANGED