@scrippsproduct/networks-ui-library 1.1.3 → 1.1.4

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,58 +1,58 @@
1
1
  import { jsx as t, jsxs as b } from "react/jsx-runtime";
2
- import { useRef as l, 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";
2
+ import { useRef as s, useCallback as w, useEffect as h } from "react";
3
+ import { f as L } from "../../format-YhWt2D8M.mjs";
4
+ import { l as g } from "../../logger-C0N7U0YY.mjs";
5
+ import { classes as E } from "../../utils/helpers.js";
6
+ import { ScheduleProvider as q } from "./ScheduleContext.js";
7
+ import { useScheduleContext as T } from "./useScheduleContext.js";
8
8
  import { DateNavigation as k } from "../DateNavigation/DateNavigation.js";
9
- import { ScheduleList as T } from "../ScheduleList/ScheduleList.js";
10
- L.setComponent("ScheduleLayout");
11
- import '../../assets/ScheduleLayout.css';function C({
12
- handleScheduleClicks: d = () => !0
9
+ import { ScheduleList as C } from "../ScheduleList/ScheduleList.js";
10
+ g.setComponent("ScheduleLayout");
11
+ import '../../assets/ScheduleLayout.css';function x({
12
+ handleScheduleClicks: f = () => !0
13
13
  }) {
14
14
  console.warn("ScheduleLayoutContent rendered");
15
- const { currentDate: n } = q(), r = l(null), f = l(0), o = l(null), s = l(null), m = l(!0), a = w((c) => {
15
+ const { currentDate: n } = T(), r = s(null), m = s(0), o = s(null), u = s(null), a = s(null), p = s(!0), l = w((c) => {
16
16
  const i = () => {
17
17
  let e;
18
- const u = document.querySelector(`.date-navigation__day[aria-controls="${S(c, "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(
18
+ const d = document.querySelector(`.date-navigation__day[aria-controls="${L(c, "yyyy-MM-dd")}"]`);
19
+ if (d && (e = d.parentElement), e && r.current) {
20
+ const S = e.offsetLeft + e.offsetWidth / 2;
21
+ m.current = S, r.current.style.setProperty(
22
22
  "--pointer-position",
23
- `${v}px`
23
+ `${S}px`
24
24
  );
25
25
  }
26
- }, h = () => {
27
- s.current || (s.current = document.querySelector("sticky-content-wrapper"));
26
+ }, v = () => {
27
+ a.current || (a.current = document.querySelector("sticky-content-wrapper")), u.current || (u.current = document.querySelector(".schedule-list"));
28
28
  const e = document.querySelector(".mobile-nav");
29
- if (s.current) {
30
- const u = e && window.getComputedStyle(e).display !== "none" ? e.offsetHeight + 8 : 16;
29
+ if (u.current && (u.current.scrollTop = 0), a.current) {
30
+ const d = e && window.getComputedStyle(e).display !== "none" ? e.offsetHeight + 8 : 16;
31
31
  window.scrollTo({
32
32
  behavior: "smooth",
33
- top: s.current.offsetTop - u,
33
+ top: a.current.offsetTop - d,
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), s.current = document.querySelector("sticky-content-wrapper"), i());
40
+ r.current = document.querySelector(".date-navigation__list"), r.current && (clearInterval(e), a.current = document.querySelector("sticky-content-wrapper"), i());
41
41
  }, 100);
42
42
  setTimeout(() => {
43
43
  clearInterval(e);
44
44
  }, 3e3);
45
45
  return;
46
46
  }
47
- i(), m.current || h();
48
- }, []), p = w(() => {
47
+ i(), p.current || v();
48
+ }, []), y = w(() => {
49
49
  o.current && clearTimeout(o.current), o.current = window.setTimeout(() => {
50
- a(n);
50
+ l(n);
51
51
  }, 250);
52
- }, [n, a]);
53
- return y(() => (window.addEventListener("resize", p), () => {
54
- window.removeEventListener("resize", p), o.current && clearTimeout(o.current);
55
- }), [a, p]), y(() => {
52
+ }, [n, l]);
53
+ return h(() => (window.addEventListener("resize", y), () => {
54
+ window.removeEventListener("resize", y), o.current && clearTimeout(o.current);
55
+ }), [l, y]), h(() => {
56
56
  const c = document.querySelector(".header-divider"), i = document.querySelector("sticky-content-wrapper");
57
57
  i && c && new IntersectionObserver(
58
58
  ([e]) => {
@@ -63,18 +63,18 @@ import '../../assets/ScheduleLayout.css';function C({
63
63
  rootMargin: "-37px"
64
64
  }
65
65
  ).observe(c);
66
- }, []), y(() => {
66
+ }, []), h(() => {
67
67
  const c = requestAnimationFrame(() => {
68
68
  requestAnimationFrame(() => {
69
- a(n), m.current && (m.current = !1);
69
+ l(n), p.current && (p.current = !1);
70
70
  });
71
71
  });
72
72
  return () => cancelAnimationFrame(c);
73
- }, [n, a]), /* @__PURE__ */ b("schedule-layout", { children: [
73
+ }, [n, l]), /* @__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: g([
77
+ class: E([
78
78
  "content-constrainer--no-padding",
79
79
  "content-constrainer--no-border",
80
80
  "content-constrainer--lead-container",
@@ -83,28 +83,28 @@ import '../../assets/ScheduleLayout.css';function C({
83
83
  children: /* @__PURE__ */ t(k, {})
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: S(n, "yyyy-MM-dd"), role: "tabpanel", children: /* @__PURE__ */ t(T, { handleClicks: d }) }) }) })
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: L(n, "yyyy-MM-dd"), role: "tabpanel", children: /* @__PURE__ */ t(C, { handleClicks: f }) }) }) })
87
87
  ] });
88
88
  }
89
- function _({
90
- fetchSchedule: d,
89
+ function A({
90
+ fetchSchedule: f,
91
91
  initialSchedule: n = [],
92
92
  weeks: r = [],
93
- handleScheduleClicks: f = () => !0,
93
+ handleScheduleClicks: m = () => !0,
94
94
  handleDateChanged: o = () => !0
95
95
  }) {
96
96
  return /* @__PURE__ */ t(
97
- E,
97
+ q,
98
98
  {
99
- fetchSchedule: d,
99
+ fetchSchedule: f,
100
100
  handleDateChanged: o,
101
101
  initialSchedule: n,
102
102
  weeks: r,
103
- children: /* @__PURE__ */ t(C, { handleScheduleClicks: f })
103
+ children: /* @__PURE__ */ t(x, { handleScheduleClicks: m })
104
104
  }
105
105
  );
106
106
  }
107
107
  export {
108
- _ as ScheduleLayout,
109
- _ as default
108
+ A as ScheduleLayout,
109
+ A as default
110
110
  };
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.1.3",
2
+ "version": "1.1.4",
3
3
  "name": "@scrippsproduct/networks-ui-library",
4
4
  "description": "React Component Library for use in Scripps Networks external applications",
5
5
  "author": {