@mappedin/viewer 0.35.2-826fca7.0 → 0.35.2-9c5b2e5.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.
Files changed (42) hide show
  1. package/dist/index.js +60886 -60855
  2. package/dist/types/src/components/action-toast/action-toast.stories.d.ts +2 -0
  3. package/dist/types/src/components/action-toast/index.d.ts +10 -0
  4. package/dist/types/src/components/area-marker/area-marker.stories.d.ts +2 -0
  5. package/dist/types/src/components/area-marker/index.d.ts +6 -0
  6. package/dist/types/src/components/button/index.d.ts +5 -1
  7. package/dist/types/src/components/carousel/nav-chevrons.d.ts +1 -0
  8. package/dist/types/src/components/categories-view/active-category.d.ts +9 -0
  9. package/dist/types/src/components/categories-view/categories-view.stories.d.ts +4 -0
  10. package/dist/types/src/components/categories-view/categories.d.ts +10 -0
  11. package/dist/types/src/components/categories-view/category-item.d.ts +15 -0
  12. package/dist/types/src/components/categories-view/category-result-list.d.ts +9 -0
  13. package/dist/types/src/components/categories-view/index.d.ts +7 -0
  14. package/dist/types/src/components/categories-view/utils.d.ts +13 -0
  15. package/dist/types/src/components/categories-view/utils.test.d.ts +1 -0
  16. package/dist/types/src/components/category-icon/category-icon.stories.d.ts +2 -0
  17. package/dist/types/src/components/category-icon/index.d.ts +8 -0
  18. package/dist/types/src/components/common/fullscreen-overlay.d.ts +1 -1
  19. package/dist/types/src/components/directions/warning-text.d.ts +1 -1
  20. package/dist/types/src/components/legacy-metadata-card/card.d.ts +1 -0
  21. package/dist/types/src/components/search-results/search-result.d.ts +2 -1
  22. package/dist/types/src/components/toast/index.d.ts +8 -2
  23. package/dist/types/src/components/toast/utils.d.ts +3 -1
  24. package/dist/types/src/components/with-content/index.d.ts +1 -1
  25. package/dist/types/src/lib/hooks/use-max-size-list.d.ts +18 -0
  26. package/dist/types/src/lib/hooks/use-max-size-list.test.d.ts +1 -0
  27. package/dist/types/src/lib/time/opening-hours.d.ts +72 -0
  28. package/dist/types/src/lib/time/opening-hours.test.d.ts +1 -0
  29. package/dist/types/src/lib/time/time.d.ts +64 -0
  30. package/dist/types/src/lib/time/time.test.d.ts +1 -0
  31. package/dist/types/src/lib/time/types.d.ts +33 -0
  32. package/dist/types/src/lib/time/utils.d.ts +34 -0
  33. package/dist/types/src/lib/time/utils.test.d.ts +1 -0
  34. package/dist/types/src/lib/types/search.d.ts +2 -0
  35. package/dist/types/src/lib/utils/language-utils.d.ts +1 -0
  36. package/dist/types/src/stores/feature-flag-store/index.d.ts +3 -1
  37. package/dist/types/src/stores/root-store/index.d.ts +11 -3
  38. package/dist/types/src/stores/ui-store/index.d.ts +3 -0
  39. package/dist/types/src/stores/ui-store/reactive-toasts/similar-places-toast.d.ts +13 -0
  40. package/dist/types/src/stores/ui-store/reactive-toasts/similar-places-toast.test.d.ts +1 -0
  41. package/dist/types/src/test-utils/test-suite.d.ts +18 -0
  42. package/package.json +3 -3
@@ -0,0 +1,2 @@
1
+ import { Story } from '@ladle/react';
2
+ export declare const Default: Story;
@@ -0,0 +1,10 @@
1
+ import { Trans } from 'react-i18next';
2
+ import { ComponentProps, ReactElement } from 'react';
3
+ type TActionToastProps = {
4
+ text: string | ReactElement<ComponentProps<typeof Trans>>;
5
+ action: string;
6
+ onClick?: () => void;
7
+ onClose?: () => void;
8
+ };
9
+ export declare const ActionToast: React.FC<TActionToastProps>;
10
+ export {};
@@ -0,0 +1,2 @@
1
+ import { Story } from '@ladle/react';
2
+ export declare const Default: Story;
@@ -0,0 +1,6 @@
1
+ import { Area } from '../../lib/sdk';
2
+ type TAreaMarkerProps = {
3
+ area: Area;
4
+ };
5
+ declare const AreaMarker: React.FC<TAreaMarkerProps>;
6
+ export default AreaMarker;
@@ -1,6 +1,6 @@
1
1
  import { TTheme } from 'lib/types/theme';
2
2
  import { TFocusOutlineOptions, Untrasient } from '../common/utils';
3
- export declare const clickableStyle: import("styled-components").RuleSet<object>;
3
+ export declare const clickableStyle: readonly [import("styled-components").RuleSet<object>, import("styled-components").RuleSet<object>];
4
4
  export type TOnClickOrPressPayload = {
5
5
  type: 'click';
6
6
  event: React.MouseEvent<HTMLDivElement>;
@@ -24,6 +24,10 @@ type TButtonProps = {
24
24
  * If true, the button will be styled as if it is :focus-visible, even when it is not.
25
25
  */
26
26
  pseudoFocus?: boolean;
27
+ /**
28
+ * What hover and active styling set to use.
29
+ */
30
+ clickableStyling?: keyof typeof clickableStyle;
27
31
  } & Untrasient<TFocusOutlineOptions>;
28
32
  /**
29
33
  * Webkit has a bug where the relatedTarget of a focus event is null for buttons. In
@@ -272,6 +272,7 @@ export declare const SideNavButton: import("styled-components").IStyledComponent
272
272
  theme?: TTheme | undefined;
273
273
  disabled?: boolean | undefined;
274
274
  pseudoFocus?: boolean | undefined;
275
+ clickableStyling?: keyof typeof import("../button").clickableStyle | undefined;
275
276
  outlineOffset?: number | undefined;
276
277
  outlineColor?: string | undefined;
277
278
  outlineWidth?: number | undefined;
@@ -0,0 +1,9 @@
1
+ import { TCategory } from '../../lib/types/search';
2
+ import { ComponentProps } from 'react';
3
+ import CategoryResultList from './category-result-list';
4
+ type TActiveCategoryProps = ComponentProps<typeof CategoryResultList> & {
5
+ category: TCategory;
6
+ onBackClick?: () => void;
7
+ };
8
+ declare const ActiveCategory: React.FC<TActiveCategoryProps>;
9
+ export default ActiveCategory;
@@ -0,0 +1,4 @@
1
+ import { Story } from '@ladle/react';
2
+ export declare const Item: Story;
3
+ export declare const Content: Story;
4
+ export declare const Default: Story;
@@ -0,0 +1,10 @@
1
+ import { TCategory } from '../../lib/types/search';
2
+ type TCategoriesProps = {
3
+ categories: TCategory[];
4
+ activeCategoryId?: string;
5
+ onCategoryClick?: (categoryId: string) => void;
6
+ onResultClick?: (ids: string[]) => void;
7
+ onBackClick?: () => void;
8
+ };
9
+ declare const Categories: import("react").ForwardRefExoticComponent<TCategoriesProps & import("react").RefAttributes<HTMLDivElement>>;
10
+ export default Categories;
@@ -0,0 +1,15 @@
1
+ import CategoryIcon from '../category-icon';
2
+ import { ComponentProps } from 'react';
3
+ type TCategoryItemProps = {
4
+ name: string;
5
+ className?: string;
6
+ icon?: ComponentProps<typeof CategoryIcon>['icon'];
7
+ onClick?: () => void;
8
+ textStyle?: React.CSSProperties;
9
+ style?: React.CSSProperties;
10
+ pseudoFocus?: boolean;
11
+ tabIndex?: number;
12
+ left?: React.ReactNode;
13
+ };
14
+ declare const CategoryItem: import("react").ForwardRefExoticComponent<TCategoryItemProps & import("react").RefAttributes<HTMLLIElement>>;
15
+ export default CategoryItem;
@@ -0,0 +1,9 @@
1
+ import { TCategory } from '../../lib/types/search';
2
+ type TListItem = TCategory['results'][number] | TCategory;
3
+ type TCategoryResultListProps = {
4
+ results: TListItem[];
5
+ onCategoryClick?: (categoryId: string) => void;
6
+ onResultClick?: (ids: string[]) => void;
7
+ };
8
+ declare const CategoryResultList: React.FC<TCategoryResultListProps>;
9
+ export default CategoryResultList;
@@ -0,0 +1,7 @@
1
+ import { ComponentProps } from 'react';
2
+ import Categories from './categories';
3
+ type TCategoriesViewProps = {
4
+ visible: boolean;
5
+ } & ComponentProps<typeof Categories>;
6
+ declare const CategoriesView: React.FC<TCategoriesViewProps>;
7
+ export default CategoriesView;
@@ -0,0 +1,13 @@
1
+ import { TCategory } from '../../lib/types/search';
2
+ export declare const CATEGORY_CARD_TOP_BOTTOM_PADDING = 8;
3
+ export declare const CATEGORY_ITEM_HEIGHT = 40;
4
+ export declare const MAX_CATEGORIES_DESKTOP: 6.5;
5
+ export declare const MAX_CATEGORIES_MOBILE: 4.5;
6
+ export declare const useActiveCategory: (categories: TCategory[], activeCategoryId: string | undefined) => {
7
+ activeCategory: TCategory | undefined;
8
+ rootCategories: TCategory[];
9
+ results: ({
10
+ label: string;
11
+ ids: string[];
12
+ } | TCategory)[];
13
+ };
@@ -0,0 +1,2 @@
1
+ import { Story } from '@ladle/react';
2
+ export declare const Default: Story;
@@ -0,0 +1,8 @@
1
+ type TCategoryIconProps = {
2
+ className?: string;
3
+ icon?: string | React.ReactElement;
4
+ size?: number;
5
+ style?: React.CSSProperties;
6
+ };
7
+ declare const CategoryIcon: React.FC<TCategoryIconProps>;
8
+ export default CategoryIcon;
@@ -13,7 +13,6 @@ export declare const FullscreenOverlay: import("styled-components").IStyledCompo
13
13
  children?: import("react").ReactNode | Iterable<import("react").ReactNode>;
14
14
  nonce?: string | undefined | undefined;
15
15
  tabIndex?: number | undefined | undefined;
16
- onClick?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
17
16
  key?: import("react").Key | null | undefined;
18
17
  defaultChecked?: boolean | undefined | undefined;
19
18
  defaultValue?: string | number | readonly string[] | undefined;
@@ -194,6 +193,7 @@ export declare const FullscreenOverlay: import("styled-components").IStyledCompo
194
193
  onWaitingCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
195
194
  onAuxClick?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
196
195
  onAuxClickCapture?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
196
+ onClick?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
197
197
  onClickCapture?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
198
198
  onContextMenu?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
199
199
  onContextMenuCapture?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
@@ -14,7 +14,6 @@ declare const WarningText: import("styled-components").IStyledComponent<"web", i
14
14
  children?: import("react").ReactNode | Iterable<import("react").ReactNode>;
15
15
  nonce?: string | undefined | undefined;
16
16
  tabIndex?: number | undefined | undefined;
17
- onClick?: import("react").MouseEventHandler<HTMLParagraphElement> | undefined;
18
17
  key?: import("react").Key | null | undefined;
19
18
  defaultChecked?: boolean | undefined | undefined;
20
19
  defaultValue?: string | number | readonly string[] | undefined;
@@ -195,6 +194,7 @@ declare const WarningText: import("styled-components").IStyledComponent<"web", i
195
194
  onWaitingCapture?: import("react").ReactEventHandler<HTMLParagraphElement> | undefined;
196
195
  onAuxClick?: import("react").MouseEventHandler<HTMLParagraphElement> | undefined;
197
196
  onAuxClickCapture?: import("react").MouseEventHandler<HTMLParagraphElement> | undefined;
197
+ onClick?: import("react").MouseEventHandler<HTMLParagraphElement> | undefined;
198
198
  onClickCapture?: import("react").MouseEventHandler<HTMLParagraphElement> | undefined;
199
199
  onContextMenu?: import("react").MouseEventHandler<HTMLParagraphElement> | undefined;
200
200
  onContextMenuCapture?: import("react").MouseEventHandler<HTMLParagraphElement> | undefined;
@@ -1,6 +1,7 @@
1
1
  import React, { ComponentProps } from 'react';
2
2
  import { TOnClickOrPressPayload } from '../button';
3
3
  import DetailsSection from './details-section';
4
+ export declare const METADATA_CARD_WIDTH_DESKTOP = 320;
4
5
  export type TMetadataCardProps = {
5
6
  name: ComponentProps<typeof DetailsSection>['name'];
6
7
  description?: ComponentProps<typeof DetailsSection>['description'];
@@ -1,6 +1,6 @@
1
1
  import { TSearchResult } from '../../lib/types/search';
2
2
  import { TTheme } from '../../lib/types/theme';
3
- export declare const SEARCH_RESULT_MAX_WIDTH_DESKTOP: 320;
3
+ export declare const SEARCH_RESULT_MAX_WIDTH_DESKTOP = 320;
4
4
  export declare const SEARCH_RESULT_HEIGHT: 38;
5
5
  export declare const SEARCH_RESULT_HEIGHT_WITH_MATCH_DETAILS: 48;
6
6
  export declare const ResultWrapper: import("styled-components").IStyledComponent<"web", {
@@ -276,6 +276,7 @@ export declare const ResultWrapper: import("styled-components").IStyledComponent
276
276
  theme?: TTheme | undefined;
277
277
  disabled?: boolean | undefined;
278
278
  pseudoFocus?: boolean | undefined;
279
+ clickableStyling?: keyof typeof import("../button").clickableStyle | undefined;
279
280
  outlineOffset?: number | undefined;
280
281
  outlineColor?: string | undefined;
281
282
  outlineWidth?: number | undefined;
@@ -1,7 +1,13 @@
1
1
  import { TToast } from './utils';
2
- export declare const ToastContainer: React.FC;
2
+ type TToastContainerProps = {
3
+ style?: React.CSSProperties;
4
+ };
5
+ export declare const ToastContainer: React.FC<TToastContainerProps>;
3
6
  /**
4
7
  * Render a toast on the page.
5
8
  */
6
- declare const toast: (content: TToast["content"], options?: Partial<Omit<TToast, "id" | "content">>) => void;
9
+ declare const toast: {
10
+ (content: TToast["content"], options?: Partial<Omit<TToast, "id" | "content">>): string;
11
+ hide(id: string): void;
12
+ };
7
13
  export default toast;
@@ -10,10 +10,12 @@ export type TToast = TBaseToast & {
10
10
  content: string | TCustomToastFn;
11
11
  };
12
12
  export declare enum E_TOAST_EVENT {
13
- SHOW = "SHOW"
13
+ SHOW = "SHOW",
14
+ HIDE = "HIDE"
14
15
  }
15
16
  type TToastEventPayload = {
16
17
  [E_TOAST_EVENT.SHOW]: TToast;
18
+ [E_TOAST_EVENT.HIDE]: string;
17
19
  };
18
20
  /**
19
21
  * A singleton event bus for toast events.
@@ -13,7 +13,6 @@ declare const Wrapper: import("styled-components").IStyledComponent<"web", {
13
13
  children?: import("react").ReactNode | Iterable<import("react").ReactNode>;
14
14
  nonce?: string | undefined | undefined;
15
15
  tabIndex?: number | undefined | undefined;
16
- onClick?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
17
16
  key?: import("react").Key | null | undefined;
18
17
  defaultChecked?: boolean | undefined | undefined;
19
18
  defaultValue?: string | number | readonly string[] | undefined;
@@ -194,6 +193,7 @@ declare const Wrapper: import("styled-components").IStyledComponent<"web", {
194
193
  onWaitingCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
195
194
  onAuxClick?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
196
195
  onAuxClickCapture?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
196
+ onClick?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
197
197
  onClickCapture?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
198
198
  onContextMenu?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
199
199
  onContextMenuCapture?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
@@ -0,0 +1,18 @@
1
+ import { VariableSizeList } from 'react-window';
2
+ type TUseMaxHeightListProps<T> = {
3
+ maxSize: number;
4
+ itemSize: number | ((index: number) => number);
5
+ items: T[];
6
+ ref?: React.RefObject<VariableSizeList>;
7
+ };
8
+ /**
9
+ * Returns some props that can be used with a react-window list to have the list grow naturally
10
+ * until a max size is reached. Optionally, a VariableSizeList ref can be provided to reset the
11
+ * list cache when the items change.
12
+ */
13
+ declare const useMaxSizeList: <T>({ maxSize, itemSize, items, ref }: TUseMaxHeightListProps<T>) => {
14
+ size: number;
15
+ totalSize: number;
16
+ itemSize: number[];
17
+ };
18
+ export default useMaxSizeList;
@@ -0,0 +1,72 @@
1
+ import Time from './time';
2
+ import { TOpeningHours } from './types';
3
+ /**
4
+ * Class with a time and day of the week.
5
+ */
6
+ declare class TimeOfWeek {
7
+ #private;
8
+ constructor(time: Time, day: number);
9
+ get day(): number;
10
+ get time(): Time;
11
+ toLocaleString(locale: string, options?: Partial<{
12
+ includeDay: boolean;
13
+ }>): string;
14
+ }
15
+ /**
16
+ * A set of opening hours for a location defined in local time within a specific timezone.
17
+ */
18
+ declare class OpeningHours {
19
+ #private;
20
+ /**
21
+ * Create a new OpeningHours object.
22
+ */
23
+ constructor(openingHours: TOpeningHours, tz: string);
24
+ /**
25
+ * Return a {@link Time} object in the store's timezone. Defaults to the current date.
26
+ */
27
+ getTime(date?: Date): Time;
28
+ /**
29
+ * Return a day of the week as a number in the store's timezone. Defaults to the current date.
30
+ */
31
+ getDay(date?: Date): number;
32
+ /**
33
+ * Return an array of localized, formatted string representations of the opening hours for each
34
+ * day of the week. The first entry in the array is the provided date's opening hours. If no
35
+ * date is provided, the current date is used.
36
+ */
37
+ toLocaleStrings(locale: string, date?: Date): (readonly [string, string])[];
38
+ /**
39
+ * Return true if the opening hours are open 24/7.
40
+ */
41
+ isOpen247(): boolean;
42
+ /**
43
+ * Return true if the opening hours are always closed.
44
+ */
45
+ isClosed247(): boolean;
46
+ /**
47
+ * Returns true if a given {@link Date} is within the opening hours. Defaults to checking the
48
+ * current date.
49
+ */
50
+ isOpen(date?: Date): boolean;
51
+ /**
52
+ * Return true if a given {@link Date} is within 1 hour of the opening hours. Returns false if
53
+ * the store is already open. Defaults to checking the current date.
54
+ */
55
+ isOpeningSoon(date?: Date): boolean;
56
+ /**
57
+ * Return true if a given {@link Date} is within 1 hour of the closing hours. Returns false if
58
+ * the store is already closed. Defaults to checking the current date.
59
+ */
60
+ isClosingSoon(date?: Date): boolean;
61
+ /**
62
+ * Returns the next time the store will open from a given date. Defaults to checking the current
63
+ * date.
64
+ */
65
+ opensAt(date?: Date): TimeOfWeek | null;
66
+ /**
67
+ * Returns the next time the store will close from a given date. Defaults to checking the current
68
+ * date.
69
+ */
70
+ closesAt(date?: Date): TimeOfWeek | null;
71
+ }
72
+ export default OpeningHours;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,64 @@
1
+ /**
2
+ * A time in minutes and hours, without a date.
3
+ */
4
+ declare class Time {
5
+ #private;
6
+ /**
7
+ * Create a new Time object. If no arguments are provided, the current time is used.
8
+ * If a Date is provided, the time is set to the time of the provided date. If two
9
+ * numbers are provided, the time is set to the given hours and minutes.
10
+ */
11
+ constructor();
12
+ constructor(date: Date);
13
+ constructor(hour: number, minute: number);
14
+ /**
15
+ * Get the hours of this time.
16
+ */
17
+ get hours(): number;
18
+ /**
19
+ * Get the minutes of this time.
20
+ */
21
+ get minutes(): number;
22
+ /**
23
+ * Returns true if this time is midnight. This can be either 00:00 or 24:00.
24
+ */
25
+ isMidnight(): boolean;
26
+ /**
27
+ * Returns true if this time is noon.
28
+ */
29
+ isNoon(): boolean;
30
+ /**
31
+ * Returns true if this time is equal to another time. 00:00 and 24:00 are considered
32
+ * to be equal.
33
+ */
34
+ isEqual(other: Time): boolean;
35
+ /**
36
+ * Returns true if this time is later than another time, assuming the times are on the
37
+ * same day. 00:00 is considered to be earlier than any other time; 24:00 is considered
38
+ * to be later than any other time.
39
+ */
40
+ isLaterThan(other: Time): boolean;
41
+ /**
42
+ * Returns true if this time is later than or equal to another time. Unlike {@link isLaterThan},
43
+ * 00:00 is considered to be equal to 24:00.
44
+ */
45
+ isLaterThanOrEqual(other: Time): boolean;
46
+ /**
47
+ * Returns true if the given time is between the start and end time, inclusive.
48
+ *
49
+ * Assumes the start time is on the same day. If the end time is earlier than the start time,
50
+ * it is assumed to be on the next day. If the start time is equal to the end time, it is
51
+ * assumed to include the entire day and this function will always return true.
52
+ */
53
+ isBetween(start: Time, end: Time): boolean;
54
+ /**
55
+ * Return the number of minutes forward in time required to reach another time. If the
56
+ * other time is earlier than this time, it is assumed to be on the next day.
57
+ */
58
+ minutesTo(other: Time): number;
59
+ /**
60
+ * Return a localized, formatted string representation of the time.
61
+ */
62
+ toLocaleString(locale?: string, options?: Intl.DateTimeFormatOptions): string;
63
+ }
64
+ export default Time;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,33 @@
1
+ /**
2
+ * An array representing a time range in hours and minutes. If the second time is earlier
3
+ * than the first time, it is assumed to be on the next day.
4
+ */
5
+ export type TTimeRange = [number, number, number, number];
6
+ /**
7
+ * Opening hours for a single day. For a store with hours, it is either a {@link TTimeRange}
8
+ * or a pair of {@link TTimeRange}s, or null if the store is closed for the day. The second
9
+ * time range, if specified, must begin after the first time range ends. Otherwise, the meaning
10
+ * is undefined.
11
+ */
12
+ export type TSingleDayOpeningHours = [TTimeRange] | [TTimeRange, TTimeRange] | null;
13
+ /**
14
+ * A collection of {@link TSingleDayOpeningHours} for Sunday to Saturday.
15
+ */
16
+ export type TRegularOpeningHours = [
17
+ TSingleDayOpeningHours,
18
+ TSingleDayOpeningHours,
19
+ TSingleDayOpeningHours,
20
+ TSingleDayOpeningHours,
21
+ TSingleDayOpeningHours,
22
+ TSingleDayOpeningHours,
23
+ TSingleDayOpeningHours
24
+ ];
25
+ /**
26
+ * A collection of {@link TSingleDayOpeningHours} for every day of the week and for
27
+ * holidays. The first entry is for Sunday, the second for Monday, etc. The last entry
28
+ * is for holidays.
29
+ */
30
+ export type TOpeningHours = TRegularOpeningHours | [
31
+ ...TRegularOpeningHours,
32
+ TSingleDayOpeningHours
33
+ ];
@@ -0,0 +1,34 @@
1
+ import Time from './time';
2
+ import { TSingleDayOpeningHours, TTimeRange } from './types';
3
+ /**
4
+ * Returns true if the given locale uses a 24-hour time format.
5
+ */
6
+ export declare const is24HourTime: (locale: string) => boolean;
7
+ /**
8
+ * Convert the name of a day of the week to a number between 0 and 6. Returns -1 if the day is not
9
+ * valid.
10
+ */
11
+ export declare const dayOfWeekNum: (day: string) => number;
12
+ /**
13
+ * Get the current timezone of the client.
14
+ */
15
+ export declare const getTZ: () => string;
16
+ /**
17
+ * Given a timezone and a date, return the hours, minutes, and day of week in that timezone.
18
+ * Day of week is 0-6, where 0 is Sunday. If no timezone is specified, uses the client's local
19
+ * timezone. If no date is specified, uses the current date.
20
+ */
21
+ export declare const getTimePartsAtTZ: (tz: string, date: Date) => {
22
+ hours: number;
23
+ minutes: number;
24
+ dayOfWeek: number;
25
+ };
26
+ /**
27
+ * Given a single day's opening hours, return the start and end times. If the opening
28
+ * hours are a pair of time ranges, return the start and end times for both ranges.
29
+ * Returns null if the store is closed for the day.
30
+ */
31
+ export declare function singleDayOpeningHoursTimes(hours: null): null;
32
+ export declare function singleDayOpeningHoursTimes(hours: [TTimeRange]): [Time, Time];
33
+ export declare function singleDayOpeningHoursTimes(hours: [TTimeRange, TTimeRange]): [Time, Time, Time, Time];
34
+ export declare function singleDayOpeningHoursTimes(hours: TSingleDayOpeningHours): [Time, Time] | [Time, Time, Time, Time] | null;
@@ -0,0 +1 @@
1
+ export {};
@@ -16,6 +16,8 @@ export type TSearchResult = {
16
16
  export type TCategory = {
17
17
  id: string;
18
18
  name: string;
19
+ icon?: string;
20
+ parent?: string;
19
21
  results: {
20
22
  label: string;
21
23
  ids: string[];
@@ -0,0 +1 @@
1
+ export declare const getLocale: (locale?: string) => string;
@@ -14,7 +14,8 @@ export declare enum E_FEATURE_FLAGS {
14
14
  WINTER_MODE = "winter-mode",
15
15
  AUTH_URL = "auth-url",
16
16
  MULTI_FLOOR_VIEW = "multi-floor-view",
17
- SAFETY_MODE = "safety-mode"
17
+ SAFETY_MODE = "safety-mode",
18
+ SIMILAR_PLACES_TOAST = "similar-places-toast"
18
19
  }
19
20
  type TFeatureFlagPayloads = {
20
21
  [E_FEATURE_FLAGS.MAKER_POP_UP]: boolean;
@@ -24,6 +25,7 @@ type TFeatureFlagPayloads = {
24
25
  [E_FEATURE_FLAGS.AUTH_URL]: string[];
25
26
  [E_FEATURE_FLAGS.MULTI_FLOOR_VIEW]: boolean;
26
27
  [E_FEATURE_FLAGS.SAFETY_MODE]: boolean;
28
+ [E_FEATURE_FLAGS.SIMILAR_PLACES_TOAST]: boolean;
27
29
  };
28
30
  type TFeatureFlag<Key extends E_FEATURE_FLAGS> = {
29
31
  /**
@@ -107,7 +107,7 @@ declare class RootStore {
107
107
  get initialPitch(): number | undefined;
108
108
  get initialBearing(): number | undefined;
109
109
  get exteriorDoors(): {
110
- "__#17@#private": any;
110
+ "__#15@#private": any;
111
111
  readonly __type: "door";
112
112
  readonly name: string;
113
113
  readonly externalId: string;
@@ -115,6 +115,13 @@ declare class RootStore {
115
115
  readonly floor: Floor;
116
116
  readonly center: Coordinate;
117
117
  readonly isExterior: boolean;
118
+ readonly geoJSON: {
119
+ properties: null;
120
+ type: import("@mappedin/mvf").FeatureType;
121
+ geometry: import("@mappedin/mvf").LineString;
122
+ };
123
+ readonly focusTarget: Coordinate;
124
+ readonly anchorTarget: Coordinate;
118
125
  toJSON(): {
119
126
  id: string;
120
127
  name: string;
@@ -128,7 +135,7 @@ declare class RootStore {
128
135
  destroy(): void;
129
136
  readonly id: string;
130
137
  links: {
131
- "__#24@#private": any;
138
+ "__#22@#private": any;
132
139
  readonly url: string;
133
140
  readonly name: string | undefined;
134
141
  toJSON(): {
@@ -140,7 +147,7 @@ declare class RootStore {
140
147
  readonly id: string;
141
148
  }[];
142
149
  images: {
143
- "__#25@#private": any;
150
+ "__#23@#private": any;
144
151
  readonly url: string | undefined;
145
152
  readonly name: string | undefined;
146
153
  readonly altText: string | undefined;
@@ -163,6 +170,7 @@ declare class RootStore {
163
170
  get selectedMVFFeatures(): Feature<MVFGeometry, {
164
171
  id: string;
165
172
  }>[] | undefined;
173
+ get similarPlaces(): Place[] | undefined;
166
174
  get departures(): Place[] | undefined;
167
175
  get placeIdsWithImageLabels(): Set<string>;
168
176
  get youAreHere(): Coordinate | undefined;
@@ -13,6 +13,9 @@ declare class UIStore {
13
13
  private makerPopUpDismissed;
14
14
  private searchBarFocusTimeout?;
15
15
  private themeBase;
16
+ reactiveToasts: {
17
+ cleanup: () => void;
18
+ }[];
16
19
  searchQuery: string;
17
20
  departureSearchQuery: string;
18
21
  droppedPinNotificationVisible: boolean;
@@ -0,0 +1,13 @@
1
+ import type RootStore from '../../root-store';
2
+ declare class SimilarPlacesToast {
3
+ rootStore: RootStore;
4
+ private toastId;
5
+ private reactionDisposers;
6
+ constructor(rootStore: RootStore);
7
+ private onClick;
8
+ private show;
9
+ private hide;
10
+ private update;
11
+ cleanup(): void;
12
+ }
13
+ export default SimilarPlacesToast;
@@ -0,0 +1,18 @@
1
+ /**
2
+ * A set of given and expected values for testing.
3
+ */
4
+ export type TTestCondition<Given, Expected> = readonly [Given, Expected];
5
+ /**
6
+ * A test case with a name and a {@link TTestCondition}s.
7
+ */
8
+ export type TTestCase<Given, Expected> = [string, readonly TTestCondition<Given, Expected>[]];
9
+ /**
10
+ * A suite of {@link TTestCase}s.
11
+ */
12
+ export type TTestSuite<Given, Expected> = readonly TTestCase<Given, Expected>[];
13
+ /**
14
+ * Run a callback with tests for each {@link TTestCase} in a {@link TTestSuite}. This is useful for
15
+ * running many tests with the same exact format, where the input and output can be easily abstracted.
16
+ */
17
+ declare const testSuite: <Given, Expected>(name: string, config: TTestSuite<Given, Expected>, cb: (language: string, value: TTestCondition<Given, Expected>) => void) => void;
18
+ export default testSuite;