@scrippsproduct/networks-ui-library 1.1.7 → 1.1.8
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.
|
@@ -37,7 +37,7 @@ function $(r, o) {
|
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
39
|
const T = (r) => {
|
|
40
|
-
var o, a, d, t, e, s, E,
|
|
40
|
+
var o, a, d, t, e, s, E, p, _, f, i;
|
|
41
41
|
return (o = r.video) != null && o.brightcove_id ? {
|
|
42
42
|
label: "Watch Preview",
|
|
43
43
|
type: "play-video",
|
|
@@ -72,7 +72,7 @@ const T = (r) => {
|
|
|
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: (p = r == null ? void 0 : r.content) != null && p.external_link ? (_ = r == null ? void 0 : r.content) == null ? void 0 : _.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: "",
|
|
@@ -84,11 +84,11 @@ const T = (r) => {
|
|
|
84
84
|
function B({
|
|
85
85
|
handleClicks: r = () => !0
|
|
86
86
|
}) {
|
|
87
|
-
const { schedule: o, isLoading: a, isError: d } = M(), [t, e] = A($, "idle"), [s, E] = x(o),
|
|
88
|
-
|
|
87
|
+
const { schedule: o, isLoading: a, isError: d } = M(), [t, e] = A($, "idle"), [s, E] = x(o), p = u(null), _ = u(null), f = C(() => {
|
|
88
|
+
_.current && (clearTimeout(_.current), _.current = null), t === "exiting" ? e({ type: "EXIT_COMPLETE" }) : t === "entering" && e({ type: "ENTER_COMPLETE" });
|
|
89
89
|
}, [t]);
|
|
90
90
|
return c(() => {
|
|
91
|
-
const i =
|
|
91
|
+
const i = p.current;
|
|
92
92
|
if (i)
|
|
93
93
|
return i.addEventListener("animationend", f), () => {
|
|
94
94
|
i.removeEventListener("animationend", f);
|
|
@@ -101,18 +101,20 @@ function B({
|
|
|
101
101
|
const i = w(o) || Array.isArray(o) && o.length >= 0;
|
|
102
102
|
!a && t === "loading" && i && (E(o), e({ type: "SCHEDULE_LOADED" }));
|
|
103
103
|
}, [a, t, o]), c(() => {
|
|
104
|
-
if (t === "exiting" &&
|
|
104
|
+
if (t === "exiting" && p.current && p.current) {
|
|
105
105
|
const i = document.querySelector("sticky-content-wrapper"), g = document.querySelector(".mobile-nav");
|
|
106
|
-
let
|
|
107
|
-
i && (
|
|
108
|
-
const R =
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
106
|
+
let l = 0;
|
|
107
|
+
i && (l += i.offsetHeight), g && window.getComputedStyle(g).display !== "none" && (l += g.offsetHeight), l += 16;
|
|
108
|
+
const R = p.current.getBoundingClientRect(), L = window.pageYOffset || document.documentElement.scrollTop, b = R.top + L - l;
|
|
109
|
+
setTimeout(() => {
|
|
110
|
+
window.scrollTo({
|
|
111
|
+
top: b,
|
|
112
|
+
behavior: "auto"
|
|
113
|
+
});
|
|
114
|
+
}, 400);
|
|
113
115
|
}
|
|
114
116
|
}, [t]), c(() => () => {
|
|
115
|
-
|
|
117
|
+
_.current && clearTimeout(_.current);
|
|
116
118
|
}, []), t === "loading" ? /* @__PURE__ */ n(
|
|
117
119
|
"div",
|
|
118
120
|
{
|
|
@@ -167,16 +169,16 @@ function B({
|
|
|
167
169
|
{
|
|
168
170
|
className: `${y["schedule-list"]} schedule-list`,
|
|
169
171
|
"data-state": t,
|
|
170
|
-
ref:
|
|
172
|
+
ref: p,
|
|
171
173
|
children: Array.isArray(s) && s.map((i) => {
|
|
172
|
-
const g = D(i.element_length),
|
|
174
|
+
const g = D(i.element_length), l = T(i).type === "" ? [g, i.rating] : [g, i.rating, " "];
|
|
173
175
|
return i.program_class === "Episode" ? /* @__PURE__ */ n(
|
|
174
176
|
k,
|
|
175
177
|
{
|
|
176
178
|
determineCTA: T,
|
|
177
179
|
handleClicks: r,
|
|
178
180
|
scheduleItem: i,
|
|
179
|
-
strListArr:
|
|
181
|
+
strListArr: l,
|
|
180
182
|
styles: y
|
|
181
183
|
},
|
|
182
184
|
`schedule-list-${i.id}`
|
|
@@ -186,7 +188,7 @@ function B({
|
|
|
186
188
|
determineCTA: T,
|
|
187
189
|
handleClicks: r,
|
|
188
190
|
scheduleItem: i,
|
|
189
|
-
strListArr:
|
|
191
|
+
strListArr: l,
|
|
190
192
|
styles: y
|
|
191
193
|
},
|
|
192
194
|
`schedule-list-${i.id}`
|
|
@@ -196,7 +198,7 @@ function B({
|
|
|
196
198
|
determineCTA: T,
|
|
197
199
|
handleClicks: r,
|
|
198
200
|
scheduleItem: i,
|
|
199
|
-
strListArr:
|
|
201
|
+
strListArr: l,
|
|
200
202
|
styles: y
|
|
201
203
|
},
|
|
202
204
|
`schedule-list-${i.id}`
|
package/package.json
CHANGED