@meetelise/chat 1.22.78 → 1.24.0

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,9 +1,3 @@
1
- /*
2
- object-assign
3
- (c) Sindre Sorhus
4
- @license MIT
5
- */
6
-
7
1
  /*!
8
2
  Copyright (c) 2018 Jed Watson.
9
3
  Licensed under the MIT License (MIT), see
@@ -58,12 +52,3 @@ object-assign
58
52
  * Copyright 2021 Google LLC
59
53
  * SPDX-License-Identifier: BSD-3-Clause
60
54
  */
61
-
62
- /** @license React v17.0.2
63
- * react.production.min.js
64
- *
65
- * Copyright (c) Facebook, Inc. and its affiliates.
66
- *
67
- * This source code is licensed under the MIT license found in the
68
- * LICENSE file in the root directory of this source tree.
69
- */
@@ -14,7 +14,7 @@ import {
14
14
  getAvailabilitiesGroupedByDay,
15
15
  getExistenceOfAvailabilitiesByTourType,
16
16
  } from "../../getAvailabilities";
17
- import { TourAvailabilityResponseRankOrderedSupportedTourTypesEnum } from "@meetelise/rest-sdk";
17
+ import { TourAvailabilityResponseRankOrderedSupportedTourTypesEnum } from "../../types/rest-sdk.types";
18
18
  import { format } from "date-fns";
19
19
  import { DatePicker } from "./date-picker";
20
20
  import { MESelect } from "../me-select";
@@ -8,7 +8,7 @@ import axios from "axios";
8
8
  import {
9
9
  TourAvailabilityResponse,
10
10
  TourAvailabilityResponseRankOrderedSupportedTourTypesEnum,
11
- } from "@meetelise/rest-sdk";
11
+ } from "./types/rest-sdk.types";
12
12
  import groupBy from "lodash/groupBy";
13
13
  import { TourType } from "./WebComponent/Scheduler/tour-scheduler";
14
14
  import isPast from "date-fns/isPast";
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Redeclare enum from rest-sdk to avoid pulling in entire module.
3
+ */
4
+ export enum TourAvailabilityResponseRankOrderedSupportedTourTypesEnum {
5
+ Unknown = "UNKNOWN",
6
+ SelfGuided = "SELF_GUIDED",
7
+ VirtualShowing = "VIRTUAL_SHOWING",
8
+ WithAgent = "WITH_AGENT",
9
+ MediaTour = "MEDIA_TOUR",
10
+ }
11
+
12
+ // Types are safe to re-export as they are not included in runtime code.
13
+ export type { TourAvailabilityResponse } from "@meetelise/rest-sdk";
package/src/utils.ts CHANGED
@@ -1,5 +1,3 @@
1
- import { useEffect, useRef, useLayoutEffect } from "react";
2
-
3
1
  import camelCase from "lodash/camelCase";
4
2
  import snakeCase from "lodash/snakeCase";
5
3
  import isArray from "lodash/isArray";
@@ -46,29 +44,6 @@ export const snakify = <T>(
46
44
  }
47
45
  ) as T;
48
46
 
49
- // https://usehooks-ts.com/react-hook/use-interval
50
- export function useInterval(callback: () => void, delay: number | null): void {
51
- const savedCallback = useRef(callback);
52
-
53
- // Remember the latest callback if it changes.
54
- useLayoutEffect(() => {
55
- savedCallback.current = callback;
56
- }, [callback]);
57
-
58
- // Set up the interval.
59
- useEffect(() => {
60
- // Don't schedule if no delay is specified.
61
- // Note: 0 is a valid value for delay, so we can't just check for falsiness.
62
- if (!delay && delay !== 0) {
63
- return;
64
- }
65
-
66
- const id = setInterval(() => savedCallback.current(), delay);
67
-
68
- return () => clearInterval(id);
69
- }, [delay]);
70
- }
71
-
72
47
  export const isMobile = (): boolean =>
73
48
  window.matchMedia("(max-width: 767px)").matches ||
74
49
  window.matchMedia("(max-height: 400px)").matches;