@scrippsproduct/networks-ui-library 1.1.0-alpha.12 → 1.1.0-alpha.14

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 +1 @@
1
- .schedule-content-constrainer{min-height:100vh;min-height:100dvh}sticky-content-wrapper{position:sticky;z-index:10;top:-1px;display:block}@media screen and (max-width:60rem){sticky-content-wrapper{top:6.3rem}}sticky-content-wrapper[data-pinned-state=pinned]{background-image:radial-gradient(ellipse at top left,var(--theme-color-200) 0,var(--theme-color-200) 50%,var(--theme-color-100) 90%)}.date-navigation__list:before{content:"";width:0;height:0;border-style:solid;border-width:0 14px 14px;border-color:transparent transparent var(--mono-color-100) transparent;position:absolute;bottom:-1px;transform:translate(calc(var(--pointer-position) - 100%));transition:transform .325s ease-in-out}@media screen and (max-width:80rem){.schedule-content-constrainer{padding-top:.01rem}}@media screen and (max-width:60rem){.schedule-date-nav-constrainer{width:calc(100% - 1.8rem);padding-block-start:.5rem}.schedule-page .header-divider{display:none}sticky-content-wrapper{top:5rem}}
1
+ .schedule-content-constrainer{min-height:100vh;min-height:100dvh}sticky-content-wrapper{display:block;position:sticky;z-index:10;top:-1px}sticky-content-wrapper[data-pinned-state=pinned]{background-image:radial-gradient(ellipse at top left,var(--theme-color-200) 0,var(--theme-color-200) 50%,var(--theme-color-100) 90%)}.date-navigation__list:before{content:"";width:0;height:0;border-style:solid;border-width:0 14px 14px;border-color:transparent transparent var(--mono-color-100) transparent;position:absolute;bottom:-1px;transform:translate(calc(var(--pointer-position) - 100%));transition:transform .325s ease-in-out}@media screen and (max-width:80rem){.schedule-content-constrainer{padding-top:.01rem}}@media screen and (max-width:60rem){.schedule-date-nav-constrainer{width:calc(100% - 1.8rem);padding-block-start:.5rem}.schedule-page .header-divider{display:none}sticky-content-wrapper{top:5rem}}
@@ -1 +1 @@
1
- ._schedule-list__item_wmqq1_1{display:grid;grid-template-columns:10% 1fr;column-gap:2.5rem;padding:1rem 0;padding:2rem 0 2.4rem;border-bottom:1px solid}._schedule-list__item_wmqq1_1:last-child{border:none}._schedule-list__airdate_wmqq1_14{align-self:center;font-size:2.25rem;font-weight:500;color:var(--mono-color-400);text-wrap:balance;overflow-wrap:break-word}._schedule-list__airdate_wmqq1_14 ._airdate-formatter__date_wmqq1_22,._schedule-list__airdate_wmqq1_14 ._airdate-formatter__day_wmqq1_23{display:none}._schedule-list__airdate_wmqq1_14 ._airdate-formatter__time-wrap_wmqq1_26 br{display:inline}._schedule-list_wmqq1_1{padding:0;opacity:1}._schedule-list_wmqq1_1[data-state=idle]{opacity:1}._schedule-list_wmqq1_1[data-state=exiting]{animation-name:_fade-out_wmqq1_1;animation-duration:.4s;animation-timing-function:ease-in-out;animation-fill-mode:forwards}._schedule-list_wmqq1_1[data-state=entering]{animation-name:_fade-in_wmqq1_1;animation-duration:.4s;animation-timing-function:ease-in-out;animation-fill-mode:forwards}._schedule-list__no-schedule_wmqq1_50{padding:2rem;text-align:center;opacity:1}._schedule-list__no-schedule_wmqq1_50[data-state=idle]{opacity:1}._schedule-list__no-schedule_wmqq1_50[data-state=exiting]{animation-name:_fade-out_wmqq1_1;animation-duration:.4s;animation-timing-function:ease-in-out;animation-fill-mode:forwards}._schedule-list__no-schedule_wmqq1_50[data-state=entering]{animation-name:_fade-in_wmqq1_1;animation-duration:.4s;animation-timing-function:ease-in-out;animation-fill-mode:forwards}._schedule-list__no-schedule_wmqq1_50 h2{margin-bottom:1rem}._schedule-list__no-schedule_wmqq1_50 p{margin:0}._schedule-list__no-schedule_wmqq1_50 a{color:inherit;text-decoration:underline}@media screen and (max-width:93.75rem){._schedule-list__airdate_wmqq1_14{font-size:2rem}}@media screen and (max-width:80rem){._schedule-list__item_wmqq1_1{display:block}._schedule-list__airdate_wmqq1_14{margin-block-end:.5rem}._schedule-list__airdate_wmqq1_14 ._airdate-formatter__time-wrap_wmqq1_26 br{display:none}._schedule-content-constrainer_wmqq1_102{padding-top:.01rem}}@media screen and (max-width:71.5rem){._schedule-list__item_wmqq1_1{grid-template-columns:15% 1fr}._date-navigation__weekday_wmqq1_110{font-size:1.4rem}._date-navigation__date_wmqq1_113{font-size:1rem}}@media screen and (max-width:50rem){._schedule-list__item_wmqq1_1 image-card{flex-direction:column;gap:1.5rem}._schedule-list__item_wmqq1_1 ._image-card__content_wmqq1_122{align-self:flex-start}}@keyframes _fade-in_wmqq1_1{0%{opacity:0}to{opacity:1}}@keyframes _fade-out_wmqq1_1{0%{opacity:1}to{opacity:0}}.schedule-list__airdate .airdate-formatter__date,.schedule-list__airdate .airdate-formatter__day{display:none}.schedule-list__item .h4{margin-bottom:.5rem;font-size:clamp(1.8rem,1.5vw + 1rem,2.625rem);line-height:1.2;color:var(--mono-color-400);text-transform:uppercase}.schedule-list__item .image-card__content{font-size:1.125rem}.schedule-list__item .image-card__content:first-of-type,.schedule-list__item .image-card__content~div{max-inline-size:80ch;margin-top:1.5rem;line-height:1.5;color:#444}@media screen and (max-width:50rem){.schedule-list__item .image-card__content:first-of-type{margin-block-start:0}}.schedule-list__item .image-card__content>div{margin:.5rem 0 1rem}.schedule-list__item .image-card__content>div:first-of-type:not(:last-of-type){font-size:1.372rem;font-weight:400;color:#444}.schedule-list__item .image-card__content>.string-list{color:var(--mono-color-400)}.schedule-list__item .string-list__pipe{margin:0 .4em;margin-inline:.4em;font-size:1.1em;vertical-align:baseline}.schedule-list__item .image-card__cta{font-weight:500;color:#861d42}.schedule-list__item .image-card__img-wrapper{flex:0 0 clamp(330px,47%,580px);align-self:flex-start;padding-top:.75rem}.schedule-list__on-now{width:max-content;margin-bottom:.75rem;margin-block-end:.75rem;padding:.5rem 1.75rem;font-size:1.125rem;color:var(--mono-color-100);text-transform:uppercase;text-wrap:nowrap;overflow-wrap:normal;white-space:nowrap;background-image:var(--on-now-gradient)}@keyframes fade-in{0%{opacity:0}to{opacity:1}}@keyframes fade-out{0%{opacity:1}to{opacity:0}}
1
+ ._schedule-list__item_686v7_1{display:grid;grid-template-columns:10% 1fr;column-gap:2.5rem;padding:1rem 0;padding:2rem 0 2.4rem;border-bottom:1px solid}._schedule-list__item_686v7_1:last-child{border:none}._schedule-list__airdate_686v7_14{align-self:center;font-size:2.25rem;font-weight:500;color:var(--mono-color-400);text-wrap:balance;overflow-wrap:break-word}._schedule-list__airdate_686v7_14 ._airdate-formatter__date_686v7_22,._schedule-list__airdate_686v7_14 ._airdate-formatter__day_686v7_23{display:none}._schedule-list__airdate_686v7_14 ._airdate-formatter__time-wrap_686v7_26 br{display:inline}._schedule-list_686v7_1{padding:0;opacity:1}._schedule-list_686v7_1[data-state=idle]{opacity:1}._schedule-list_686v7_1[data-state=exiting]{animation-name:_fade-out_686v7_1;animation-duration:.4s;animation-timing-function:ease-in-out;animation-fill-mode:forwards}._schedule-list_686v7_1[data-state=entering]{animation-name:_fade-in_686v7_1;animation-duration:.4s;animation-timing-function:ease-in-out;animation-fill-mode:forwards}._schedule-list__no-schedule_686v7_50{padding:2rem;text-align:center;opacity:1}._schedule-list__no-schedule_686v7_50[data-state=idle]{opacity:1}._schedule-list__no-schedule_686v7_50[data-state=exiting]{animation-name:_fade-out_686v7_1;animation-duration:.4s;animation-timing-function:ease-in-out;animation-fill-mode:forwards}._schedule-list__no-schedule_686v7_50[data-state=entering]{animation-name:_fade-in_686v7_1;animation-duration:.4s;animation-timing-function:ease-in-out;animation-fill-mode:forwards}._schedule-list__no-schedule_686v7_50 h2{margin-bottom:1rem}._schedule-list__no-schedule_686v7_50 p{margin:0}._schedule-list__no-schedule_686v7_50 a{color:inherit;text-decoration:underline}@media screen and (max-width:93.75rem){._schedule-list__airdate_686v7_14{font-size:2rem}}@media screen and (max-width:80rem){._schedule-list__item_686v7_1{display:block}._schedule-list__airdate_686v7_14{margin-block-end:.5rem}._schedule-list__airdate_686v7_14 ._airdate-formatter__time-wrap_686v7_26 br{display:none}._schedule-content-constrainer_686v7_102{padding-top:.01rem}}@media screen and (max-width:71.5rem){._schedule-list__item_686v7_1{grid-template-columns:15% 1fr}}@media screen and (max-width:50rem){._schedule-list__item_686v7_1 image-card{flex-direction:column;gap:1.5rem}._schedule-list__item_686v7_1 ._image-card__content_686v7_116{align-self:flex-start}}@keyframes _fade-in_686v7_1{0%{opacity:0}to{opacity:1}}@keyframes _fade-out_686v7_1{0%{opacity:1}to{opacity:0}}.schedule-list__airdate .airdate-formatter__date,.schedule-list__airdate .airdate-formatter__day{display:none}.schedule-list__item .h4{margin-bottom:.5rem;font-size:clamp(1.8rem,1.5vw + 1rem,2.625rem);line-height:1.2;color:var(--mono-color-400);text-transform:uppercase}.schedule-list__item .image-card__content{font-size:1.125rem}.schedule-list__item .image-card__content:first-of-type,.schedule-list__item .image-card__content~div{max-inline-size:80ch;margin-top:1.5rem;line-height:1.5;color:#444}@media screen and (max-width:50rem){.schedule-list__item .image-card__content:first-of-type{margin-block-start:0}}.schedule-list__item .image-card__content>div{margin:.5rem 0 1rem}.schedule-list__item .image-card__content>div:first-of-type:not(:last-of-type){font-size:1.372rem;font-weight:400;color:#444}.schedule-list__item .image-card__content>.string-list{color:var(--mono-color-400)}.schedule-list__item .string-list__pipe{margin:0 .4em;margin-inline:.4em;font-size:1.1em;vertical-align:baseline}.schedule-list__item .image-card__cta{font-weight:500;color:#861d42}.schedule-list__item .image-card__img-wrapper{flex:0 0 clamp(330px,47%,580px);align-self:flex-start;padding-top:.75rem}.schedule-list__on-now{width:max-content;margin-bottom:.75rem;margin-block-end:.75rem;padding:.5rem 1.75rem;font-size:1.125rem;color:var(--mono-color-100);text-transform:uppercase;text-wrap:nowrap;overflow-wrap:normal;white-space:nowrap;background-image:var(--on-now-gradient)}@keyframes fade-in{0%{opacity:0}to{opacity:1}}@keyframes fade-out{0%{opacity:1}to{opacity:0}}
@@ -1,13 +1,13 @@
1
1
  import { jsxs as o, jsx as a, Fragment as I } from "react/jsx-runtime";
2
- import { useRef as v, useState as C, useEffect as x } from "react";
3
- import { statesForCustomList as S } from "../../data-resources/FakeDataResource.js";
2
+ import { useRef as T, useState as $, useEffect as x } from "react";
3
+ import { statesForCustomList as k } from "../../data-resources/FakeDataResource.js";
4
4
  import { publish as V } from "../../utils/events.js";
5
- import { classes as l } from "../../utils/helpers.js";
5
+ import { classes as r } from "../../utils/helpers.js";
6
6
  import { Input as j } from "../Input/Input.js";
7
7
  import { CustomDataList as z } from "../CustomDataList/CustomDataList.js";
8
8
  import { ActionButton as K } from "../ActionButton/ActionButton.js";
9
- import { ResultsTable as A } from "../ResultsTable/ResultsTable.js";
10
- import { AdBlock as F } from "../AdBlock/AdBlock.js";
9
+ import { ResultsTable as F } from "../ResultsTable/ResultsTable.js";
10
+ import { AdBlock as Y } from "../AdBlock/AdBlock.js";
11
11
  import '../../assets/ChannelSearch.css';const n = {
12
12
  "channel-search": "_channel-search_1kyd9_6",
13
13
  "channel-search__inputs": "_channel-search__inputs_1kyd9_19",
@@ -18,13 +18,13 @@ import '../../assets/ChannelSearch.css';const n = {
18
18
  "channel-search__label": "_channel-search__label_1kyd9_90"
19
19
  };
20
20
  function M({
21
- network: c,
22
- baseApiUrl: T,
23
- allowZipcodeSearch: _ = !0,
24
- allowStateSearch: m = !0,
25
- compactLayout: d = !1,
26
- allowAutoScroll: $ = !0,
27
- autoScrollOffset: k = 25,
21
+ network: l,
22
+ baseApiUrl: N,
23
+ allowZipcodeSearch: u = !0,
24
+ allowStateSearch: p = !0,
25
+ compactLayout: _ = !1,
26
+ allowAutoScroll: w = !0,
27
+ autoScrollOffset: v = 25,
28
28
  ad: i = {
29
29
  campaign: "",
30
30
  source: "",
@@ -32,9 +32,9 @@ function M({
32
32
  content: ""
33
33
  }
34
34
  }) {
35
- const g = v(""), h = async (r = { type: "", term: "" }) => {
36
- const y = async () => {
37
- const e = `${T}/${c.slug}?${r.type}=${r.term}`;
35
+ const C = T(""), m = async (c = { type: "", term: "" }) => {
36
+ const g = async () => {
37
+ const e = `${N}/${l.slug}?${c.type}=${c.term}`;
38
38
  try {
39
39
  const t = await fetch(e);
40
40
  return t.ok ? (await t.json()).map((s) => ({
@@ -47,24 +47,24 @@ function M({
47
47
  return console.error(t), [];
48
48
  }
49
49
  };
50
- return r.term === "" ? [] : await y();
51
- }, N = async (r) => {
52
- r.preventDefault();
53
- const y = new FormData(document.getElementById("channel-search"));
50
+ return c.term === "" ? [] : await g();
51
+ }, S = async (c) => {
52
+ c.preventDefault();
53
+ const g = new FormData(document.getElementById("channel-search"));
54
54
  let e = {};
55
- for (let [t, p] of y.entries())
55
+ for (let [t, h] of g.entries())
56
56
  e = {
57
57
  ...e,
58
- [t]: p
58
+ [t]: h
59
59
  };
60
60
  if (e.zipcode && (e == null ? void 0 : e.zipcode) !== "") {
61
- const t = await h({ type: "zip", term: e.zipcode });
62
- u(t.length === 0 ? [] : t), b(!0);
61
+ const t = await m({ type: "zip", term: e.zipcode });
62
+ d(t.length === 0 ? [] : t), f(!0);
63
63
  } else if (e.state && (e == null ? void 0 : e.state) !== "") {
64
- const t = S.find((p) => Number.parseInt(p.id, 10) === Number.parseInt(e.state, 10));
65
- g.current = t === void 0 ? "" : t.label, u(await h({ type: "state", term: t == null ? void 0 : t.value })), b(!0);
64
+ const t = k.find((h) => Number.parseInt(h.id, 10) === Number.parseInt(e.state, 10));
65
+ C.current = t === void 0 ? "" : t.label, d(await m({ type: "state", term: t == null ? void 0 : t.value })), f(!0);
66
66
  } else
67
- u(await h()), b(!1);
67
+ d(await m()), f(!1);
68
68
  setTimeout(() => {
69
69
  V("scripps:action:completed");
70
70
  }, 250);
@@ -85,39 +85,37 @@ function M({
85
85
  title: "Cable/Satellite",
86
86
  resultKey: "provider"
87
87
  }
88
- ], [w, u] = C([]), [R, b] = C(!1), f = v(null);
88
+ ], [R, d] = $([]), [b, f] = $(!1), y = T(null);
89
89
  return x(() => {
90
- R && $ && setTimeout(() => {
91
- f.current !== null && window.scroll({
90
+ b && w && setTimeout(() => {
91
+ y.current !== null && window.scroll({
92
92
  left: 0,
93
- top: f.current.getBoundingClientRect().y + window.pageYOffset - k,
93
+ top: y.current.getBoundingClientRect().y + window.pageYOffset - v,
94
94
  behavior: "smooth"
95
95
  });
96
- }, 100), (async () => {
97
- u(await h());
98
- })();
99
- }), /* @__PURE__ */ o("channel-search__wrapper", { children: [
96
+ }, 100);
97
+ }, [b, w, v]), /* @__PURE__ */ o("channel-search__wrapper", { children: [
100
98
  /* @__PURE__ */ o(
101
99
  "form",
102
100
  {
103
- className: l([
101
+ className: r([
104
102
  n["channel-search"],
105
103
  "channel-search"
106
104
  ]),
107
105
  id: "channel-search",
108
106
  children: [
109
- /* @__PURE__ */ o("span", { className: l([n["channel-search__label"], "channel-search__label"]), children: [
110
- c.brand_name,
107
+ /* @__PURE__ */ o("span", { className: r([n["channel-search__label"], "channel-search__label"]), children: [
108
+ l.brand_name,
111
109
  " Channel Search:"
112
110
  ] }),
113
- /* @__PURE__ */ o("span", { className: l([n["channel-search__inputs"], "channel-search__inputs"]), children: [
114
- _ && /* @__PURE__ */ a(j, { name: "zipcode", placeholder: "Enter ZIP Code", showValidation: !1 }),
115
- _ && m && "or",
116
- m && /* @__PURE__ */ a(
111
+ /* @__PURE__ */ o("span", { className: r([n["channel-search__inputs"], "channel-search__inputs"]), children: [
112
+ u && /* @__PURE__ */ a(j, { name: "zipcode", placeholder: "Enter ZIP Code", showValidation: !1 }),
113
+ u && p && "or",
114
+ p && /* @__PURE__ */ a(
117
115
  z,
118
116
  {
119
117
  name: "state",
120
- options: S,
118
+ options: k,
121
119
  placeholder: "Select Your State",
122
120
  showValidation: !1
123
121
  }
@@ -126,40 +124,40 @@ function M({
126
124
  /* @__PURE__ */ a(
127
125
  K,
128
126
  {
129
- classname: l(["channel-search__submit-btn", n["channel-search__submit-btn"]]),
127
+ classname: r(["channel-search__submit-btn", n["channel-search__submit-btn"]]),
130
128
  label: "Submit",
131
129
  type: "submit",
132
- onClick: N
130
+ onClick: S
133
131
  }
134
132
  )
135
133
  ]
136
134
  }
137
135
  ),
138
- R && /* @__PURE__ */ o(I, { children: [
136
+ b && /* @__PURE__ */ o(I, { children: [
139
137
  /* @__PURE__ */ a(
140
138
  "div",
141
139
  {
142
- className: l([
140
+ className: r([
143
141
  n["results-table__header"],
144
142
  "search-results-header",
145
- d ? n["results-table__header--compact"] : ""
143
+ _ ? n["results-table__header--compact"] : ""
146
144
  ]),
147
- ref: f,
148
- children: w.length > 1 ? `${m && !_ ? g.current : "Your"} ${c.brand_name} Channels` : `Your ${c.brand_name} Channel`
145
+ ref: y,
146
+ children: R.length > 1 ? `${p && !u ? C.current : "Your"} ${l.brand_name} Channels` : `Your ${l.brand_name} Channel`
149
147
  }
150
148
  ),
151
149
  /* @__PURE__ */ a(
152
- A,
150
+ F,
153
151
  {
154
152
  columns: B,
155
- compactLayout: d,
156
- noResultsMsg: `Sorry there are no channels carrying ${c.brand_name} in your area at this time.`,
157
- results: w
153
+ compactLayout: _,
154
+ noResultsMsg: `Sorry there are no channels carrying ${l.brand_name} in your area at this time.`,
155
+ results: R
158
156
  }
159
157
  )
160
158
  ] }),
161
- !d && /* @__PURE__ */ a("div", { className: l([n["ad-wrapper"], "ad-wrapper"]), children: /* @__PURE__ */ a(
162
- F,
159
+ !_ && /* @__PURE__ */ a("div", { className: r([n["ad-wrapper"], "ad-wrapper"]), children: /* @__PURE__ */ a(
160
+ Y,
163
161
  {
164
162
  ad: {
165
163
  header: "Fall in love with subscription-free TV.",
@@ -1,31 +1,29 @@
1
- import { jsx as a, jsxs as g } from "react/jsx-runtime";
2
- import { useReducer as R, useState as L, useRef as w, useCallback as A, useEffect as y } from "react";
3
- import { classes as T, getMinutesFromStr as u } from "../../utils/helpers.js";
4
- import { useScheduleContext as x } from "../ScheduleLayout/useScheduleContext.js";
5
- import { Loading as b } from "../Loading/Loading.js";
6
- import { SportsItem as D } from "./schedule-list-items/SportsItem.js";
7
- import { SeriesItem as M } from "./schedule-list-items/SeriesItem.js";
8
- import { MovieItem as C } from "./schedule-list-items/MovieItem.js";
1
+ import { jsx as t, jsxs as g } from "react/jsx-runtime";
2
+ import { useReducer as A, useState as u, useRef as S, useCallback as x, useEffect as y } from "react";
3
+ import { classes as R, getMinutesFromStr as b } from "../../utils/helpers.js";
4
+ import { useScheduleContext as w } from "../ScheduleLayout/useScheduleContext.js";
5
+ import { Loading as D } from "../Loading/Loading.js";
6
+ import { SportsItem as M } from "./schedule-list-items/SportsItem.js";
7
+ import { SeriesItem as C } from "./schedule-list-items/SeriesItem.js";
8
+ import { MovieItem as O } from "./schedule-list-items/MovieItem.js";
9
9
  import '../../assets/ScheduleList.css';const l = {
10
- "schedule-list__item": "_schedule-list__item_wmqq1_1",
11
- "schedule-list__airdate": "_schedule-list__airdate_wmqq1_14",
12
- "airdate-formatter__date": "_airdate-formatter__date_wmqq1_22",
13
- "airdate-formatter__day": "_airdate-formatter__day_wmqq1_23",
14
- "airdate-formatter__time-wrap": "_airdate-formatter__time-wrap_wmqq1_26",
15
- "schedule-list": "_schedule-list_wmqq1_1",
16
- "fade-out": "_fade-out_wmqq1_1",
17
- "fade-in": "_fade-in_wmqq1_1",
18
- "schedule-list__no-schedule": "_schedule-list__no-schedule_wmqq1_50",
19
- "schedule-content-constrainer": "_schedule-content-constrainer_wmqq1_102",
20
- "date-navigation__weekday": "_date-navigation__weekday_wmqq1_110",
21
- "date-navigation__date": "_date-navigation__date_wmqq1_113",
22
- "image-card__content": "_image-card__content_wmqq1_122"
10
+ "schedule-list__item": "_schedule-list__item_686v7_1",
11
+ "schedule-list__airdate": "_schedule-list__airdate_686v7_14",
12
+ "airdate-formatter__date": "_airdate-formatter__date_686v7_22",
13
+ "airdate-formatter__day": "_airdate-formatter__day_686v7_23",
14
+ "airdate-formatter__time-wrap": "_airdate-formatter__time-wrap_686v7_26",
15
+ "schedule-list": "_schedule-list_686v7_1",
16
+ "fade-out": "_fade-out_686v7_1",
17
+ "fade-in": "_fade-in_686v7_1",
18
+ "schedule-list__no-schedule": "_schedule-list__no-schedule_686v7_50",
19
+ "schedule-content-constrainer": "_schedule-content-constrainer_686v7_102",
20
+ "image-card__content": "_image-card__content_686v7_116"
23
21
  };
24
- function S(r) {
22
+ function L(r) {
25
23
  return typeof r == "object" && !Array.isArray(r) && (r == null ? void 0 : r.queryStatus) && r.queryStatus === "no-results";
26
24
  }
27
- function O(r, t) {
28
- switch (t.type) {
25
+ function P(r, a) {
26
+ switch (a.type) {
29
27
  case "START_EXIT":
30
28
  return "exiting";
31
29
  case "EXIT_COMPLETE":
@@ -38,9 +36,9 @@ function O(r, t) {
38
36
  return r;
39
37
  }
40
38
  }
41
- const v = (r) => {
42
- var t, o, d, n, _, s, E, f, e, p, i;
43
- return (t = r.video) != null && t.brightcove_id ? {
39
+ const d = (r) => {
40
+ var a, o, v, n, s, _, E, f, p, e, i;
41
+ return (a = r.video) != null && a.brightcove_id ? {
44
42
  label: "Watch Preview",
45
43
  type: "play-video",
46
44
  href: "",
@@ -71,10 +69,10 @@ const v = (r) => {
71
69
  //'film',
72
70
  position: void 0
73
71
  //'inline',
74
- } : (((o = r == null ? void 0 : r.content) == null ? void 0 : o.external_link) !== void 0 && ((d = r == null ? void 0 : r.content) == null ? void 0 : d.external_link) !== "" || ((n = r == null ? void 0 : r.content) == null ? void 0 : n.slug) !== void 0 && ((_ = r == null ? void 0 : r.content) == null ? void 0 : _.slug) !== "") && !((s = r == null ? void 0 : r.content) != null && s.prevent_detail_page) ? {
72
+ } : (((o = r == null ? void 0 : r.content) == null ? void 0 : o.external_link) !== void 0 && ((v = r == null ? void 0 : r.content) == null ? void 0 : v.external_link) !== "" || ((n = r == null ? void 0 : r.content) == null ? void 0 : n.slug) !== void 0 && ((s = r == null ? void 0 : r.content) == null ? void 0 : s.slug) !== "") && !((_ = r == null ? void 0 : r.content) != null && _.prevent_detail_page) ? {
75
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",
76
74
  type: (E = r == null ? void 0 : r.content) != null && E.external_link ? "external-link" : "internal-link",
77
- href: (f = r == null ? void 0 : r.content) != null && f.external_link ? (e = r == null ? void 0 : r.content) == null ? void 0 : e.external_link : r.program_class === "Episode" ? `/show/${(p = r == null ? void 0 : r.content) == null ? void 0 : p.slug}` : `/movie/${(i = r == null ? void 0 : r.content) == null ? void 0 : i.slug}`,
75
+ href: (f = r == null ? void 0 : r.content) != null && f.external_link ? (p = r == null ? void 0 : r.content) == null ? void 0 : p.external_link : r.program_class === "Episode" ? `/show/${(e = r == null ? void 0 : r.content) == null ? void 0 : e.slug}` : `/movie/${(i = r == null ? void 0 : r.content) == null ? void 0 : i.slug}`,
78
76
  position: "inline"
79
77
  } : {
80
78
  label: "",
@@ -83,28 +81,28 @@ const v = (r) => {
83
81
  position: void 0
84
82
  };
85
83
  };
86
- function H({
84
+ function q({
87
85
  handleClicks: r = () => !0
88
86
  }) {
89
- const { schedule: t, isLoading: o, isError: d } = x(), [n, _] = R(O, "idle"), [s, E] = L(t), f = w(null), e = w(null), p = A(() => {
90
- e.current && (clearTimeout(e.current), e.current = null), n === "exiting" ? _({ type: "EXIT_COMPLETE" }) : n === "entering" && _({ type: "ENTER_COMPLETE" });
87
+ const { schedule: a, isLoading: o, isError: v } = w(), [n, s] = A(P, "idle"), [_, E] = u(a), f = S(null), p = S(null), e = x(() => {
88
+ p.current && (clearTimeout(p.current), p.current = null), n === "exiting" ? s({ type: "EXIT_COMPLETE" }) : n === "entering" && s({ type: "ENTER_COMPLETE" });
91
89
  }, [n]);
92
90
  return y(() => {
93
91
  const i = f.current;
94
92
  if (i)
95
- return i.addEventListener("animationend", p), () => {
96
- i.removeEventListener("animationend", p);
93
+ return i.addEventListener("animationend", e), () => {
94
+ i.removeEventListener("animationend", e);
97
95
  };
98
- }, [p]), y(() => {
99
- o && n === "idle" && _({ type: "START_EXIT" });
96
+ }, [e]), y(() => {
97
+ o && n === "idle" && s({ type: "START_EXIT" });
100
98
  }, [o, n]), y(() => {
101
- !o && n === "exiting" && _({ type: "EXIT_COMPLETE" });
99
+ !o && n === "exiting" && s({ type: "EXIT_COMPLETE" });
102
100
  }, [o, n]), y(() => {
103
- const i = S(t) || Array.isArray(t) && t.length >= 0;
104
- !o && n === "loading" && i && (E(t), _({ type: "SCHEDULE_LOADED" }));
105
- }, [o, n, t]), y(() => () => {
106
- e.current && clearTimeout(e.current);
107
- }, []), n === "loading" ? /* @__PURE__ */ a(
101
+ const i = L(a) || Array.isArray(a) && a.length >= 0;
102
+ !o && n === "loading" && i && (E(a), s({ type: "SCHEDULE_LOADED" }));
103
+ }, [o, n, a]), y(() => () => {
104
+ p.current && clearTimeout(p.current);
105
+ }, []), n === "loading" ? /* @__PURE__ */ t(
108
106
  "div",
109
107
  {
110
108
  style: {
@@ -113,81 +111,81 @@ function H({
113
111
  minHeight: "100dvh",
114
112
  paddingTop: "6rem"
115
113
  },
116
- children: /* @__PURE__ */ a(b, {})
114
+ children: /* @__PURE__ */ t(D, {})
117
115
  }
118
- ) : d ? /* @__PURE__ */ g("div", { className: "schedule-list__no-schedule", children: [
119
- /* @__PURE__ */ a("h2", { children: "There was an error loading the schedule for this day." }),
116
+ ) : v ? /* @__PURE__ */ g("div", { className: "schedule-list__no-schedule", children: [
117
+ /* @__PURE__ */ t("h2", { children: "There was an error loading the schedule for this day." }),
120
118
  /* @__PURE__ */ g("p", { children: [
121
119
  "Please try again later. If this problem persists report it at ",
122
- /* @__PURE__ */ a("a", { href: "https://support.iontelevision.com/support/home", children: "our support page" }),
120
+ /* @__PURE__ */ t("a", { href: "https://support.iontelevision.com/support/home", children: "our support page" }),
123
121
  "."
124
122
  ] })
125
- ] }) : S(s) ? /* @__PURE__ */ g(
123
+ ] }) : L(_) ? /* @__PURE__ */ g(
126
124
  "div",
127
125
  {
128
- className: T([
126
+ className: R([
129
127
  l["schedule-list__no-schedule"],
130
128
  "schedule-list__no-schedule"
131
129
  ]),
132
130
  "data-state": n,
133
131
  style: { animationDelay: "500ms" },
134
132
  children: [
135
- /* @__PURE__ */ a("h2", { children: "There are no shows scheduled for this day." }),
133
+ /* @__PURE__ */ t("h2", { children: "There are no shows scheduled for this day." }),
136
134
  /* @__PURE__ */ g("p", { children: [
137
135
  "Please try again later. If this problem persists report it at ",
138
- /* @__PURE__ */ a("a", { href: "https://support.iontelevision.com/support/home", children: "our support page" }),
136
+ /* @__PURE__ */ t("a", { href: "https://support.iontelevision.com/support/home", children: "our support page" }),
139
137
  "."
140
138
  ] })
141
139
  ]
142
140
  }
143
- ) : Array.isArray(s) && s.length === 0 ? /* @__PURE__ */ g(
141
+ ) : Array.isArray(_) && _.length === 0 ? /* @__PURE__ */ g(
144
142
  "div",
145
143
  {
146
- className: T([
144
+ className: R([
147
145
  l["schedule-list__no-schedule"],
148
146
  "schedule-list__no-schedule"
149
147
  ]),
150
148
  "data-state": n,
151
149
  children: [
152
- /* @__PURE__ */ a("h2", { children: "Our programming schedule for today has completed." }),
153
- /* @__PURE__ */ a("p", { children: "Our programming will restart at 6am." })
150
+ /* @__PURE__ */ t("h2", { children: "Our programming schedule for today has completed." }),
151
+ /* @__PURE__ */ t("p", { children: "Our programming will restart at 6am." })
154
152
  ]
155
153
  }
156
- ) : /* @__PURE__ */ a(
154
+ ) : /* @__PURE__ */ t(
157
155
  "ul",
158
156
  {
159
157
  className: `${l["schedule-list"]} schedule-list`,
160
158
  "data-state": n,
161
159
  ref: f,
162
- children: Array.isArray(s) && s.map((i) => {
163
- const c = u(i.element_length), q = v(i).type === "" ? [c, i.rating] : [c, i.rating, " "];
164
- return i.program_class === "Episode" ? /* @__PURE__ */ a(
165
- M,
160
+ children: Array.isArray(_) && _.map((i) => {
161
+ const T = b(i.element_length), c = d(i).type === "" ? [T, i.rating] : [T, i.rating, " "];
162
+ return i.program_class === "Episode" ? /* @__PURE__ */ t(
163
+ C,
166
164
  {
167
- determineCTA: v,
165
+ determineCTA: d,
168
166
  handleClicks: r,
169
167
  scheduleItem: i,
170
- strListArr: q,
168
+ strListArr: c,
171
169
  styles: l
172
170
  },
173
171
  `schedule-list-${i.id}`
174
- ) : i.program_class === "Film" || i.program_class === "Movie" || i.program_class === "Special" ? /* @__PURE__ */ a(
175
- C,
172
+ ) : i.program_class === "Film" || i.program_class === "Movie" || i.program_class === "Special" ? /* @__PURE__ */ t(
173
+ O,
176
174
  {
177
- determineCTA: v,
175
+ determineCTA: d,
178
176
  handleClicks: r,
179
177
  scheduleItem: i,
180
- strListArr: q,
178
+ strListArr: c,
181
179
  styles: l
182
180
  },
183
181
  `schedule-list-${i.id}`
184
- ) : i.program_class === "Sports" ? /* @__PURE__ */ a(
185
- D,
182
+ ) : i.program_class === "Sports" ? /* @__PURE__ */ t(
183
+ M,
186
184
  {
187
- determineCTA: v,
185
+ determineCTA: d,
188
186
  handleClicks: r,
189
187
  scheduleItem: i,
190
- strListArr: q,
188
+ strListArr: c,
191
189
  styles: l
192
190
  },
193
191
  `schedule-list-${i.id}`
@@ -197,6 +195,6 @@ function H({
197
195
  );
198
196
  }
199
197
  export {
200
- H as ScheduleList,
201
- H as default
198
+ q as ScheduleList,
199
+ q as default
202
200
  };
@@ -0,0 +1,22 @@
1
+ import { ScheduleItem } from '../types';
2
+ type UseGetScheduleParams = {
3
+ dateStr: string;
4
+ schedEndpoint: string;
5
+ network?: string | null;
6
+ showEpisodeNumber?: boolean;
7
+ showUpcoming?: boolean;
8
+ };
9
+ /**
10
+ *
11
+ * @param {*} param0
12
+ * @param {string} param0.dateStr - The date to get the schedule for
13
+ * @param {string} param0.schedEndpoint - The endpoint to get the schedule from
14
+ * @param {string|null} param0.network - The network to get the schedule for
15
+ * @param {boolean} param0.showEpisodeNumber - Whether episode numbers should be shown
16
+ *
17
+ * @returns {Object[]|{ queryStatus: 'no-results' }} - Array of objects or an object with a queryStatus of 'no-results'
18
+ */
19
+ declare const useGetSchedule: ({ dateStr, schedEndpoint, network, showEpisodeNumber, showUpcoming, }: UseGetScheduleParams) => Promise<ScheduleItem[] | [{
20
+ queryStatus: string;
21
+ }]>;
22
+ export default useGetSchedule;
@@ -0,0 +1,62 @@
1
+ import { a as p } from "../add-UWUc_nrO.mjs";
2
+ import { f as d } from "../format-YhWt2D8M.mjs";
3
+ import { determineSeasonNumber as S, determineEpisodeNumber as _, determineSeasonNumberFromSeriesPrefix as b } from "../utils/series-helpers.js";
4
+ import { convert12to24 as O } from "../utils/helpers.js";
5
+ import { determineIfShowIsOnNow as v } from "../utils/date-helpers.js";
6
+ import { g as x } from "../index-0wieGV50.mjs";
7
+ const P = async ({
8
+ dateStr: o,
9
+ schedEndpoint: h,
10
+ network: $ = null,
11
+ showEpisodeNumber: u = !1,
12
+ showUpcoming: w = !1
13
+ }) => {
14
+ const c = x("America/New_York", new Date(o)) / 36e5, T = d(/* @__PURE__ */ new Date(`${o}T00:00:00`), "yyyy-MM-dd"), i = d(new Date(p(/* @__PURE__ */ new Date(`${o}T00:00:00`), { days: 1 })), "yyyy-MM-dd"), m = (s) => {
15
+ const e = /* @__PURE__ */ new Date(`${o}T06:00:00-0${c * -1}:00`), r = /* @__PURE__ */ new Date(`${i}T06:00:00-0${c * -1}:00`);
16
+ return s.filter((n) => {
17
+ if (!(n != null && n.start_ts_parse)) return !1;
18
+ const l = (n == null ? void 0 : n.start_ts_parse) * 1e3;
19
+ return l >= e.valueOf() && l < r.valueOf();
20
+ });
21
+ }, y = async () => {
22
+ let s = [], e = {
23
+ next: null,
24
+ results: []
25
+ }, r = 0, f = "";
26
+ const n = T, l = i;
27
+ do {
28
+ f = `${h}/${$}?ordering=start_ts_parse&start_date__range=${n},${l}&limit=100&offset=${r}`;
29
+ try {
30
+ const t = await fetch(f);
31
+ if (t != null && t.ok)
32
+ e = await t.json(), s = [...s, ...e.results];
33
+ else {
34
+ console.error(`An error was returned from fetch. HTTP Response Code: ', ${t == null ? void 0 : t.status}`);
35
+ break;
36
+ }
37
+ } catch (t) {
38
+ console.error("Fetch failed with error:", t);
39
+ break;
40
+ }
41
+ r += 100;
42
+ } while (e.next !== null);
43
+ return s.length === 0 ? void 0 : m(s).map((t) => ({
44
+ ...t,
45
+ showUpcoming: w
46
+ }));
47
+ }, D = (s) => s.filter((e) => {
48
+ if (e.series_prefix === null && e.title_code === null) return !1;
49
+ const r = /* @__PURE__ */ new Date();
50
+ return e.start_ts_parse ? !!(e.start_ts_parse * 1e3 > r.valueOf() || v(`${e.start_date_parse}T${O(e.start_time)}`, e.element_length)) : !1;
51
+ }).map((e) => {
52
+ let r = "";
53
+ return e.series_prefix === null ? r = u ? `${S(e)}${_(e)}` : "" : r = u ? `${b(e)}${_(e)}` : "", {
54
+ ...e,
55
+ episode_number: r
56
+ };
57
+ }), a = await y();
58
+ return a === void 0 || a.length === 0 ? [{ queryStatus: "no-results" }] : D(a);
59
+ };
60
+ export {
61
+ P as default
62
+ };
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.1.0-alpha.12",
2
+ "version": "1.1.0-alpha.14",
3
3
  "name": "@scrippsproduct/networks-ui-library",
4
4
  "description": "React Component Library for use in Scripps Networks external applications",
5
5
  "author": {