@wayke-se/components-react 5.2.0 → 6.0.0-beta.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 (126) hide show
  1. package/README.md +222 -122
  2. package/dist/index.js +1365 -1489
  3. package/dist/index.js.map +4 -4
  4. package/dist/index.mjs +1381 -1505
  5. package/dist/index.mjs.map +4 -4
  6. package/dist/types/src/@types/filter.d.ts +7 -1
  7. package/dist/types/src/Gql/ad/legacyWaykeId.d.ts +1 -0
  8. package/dist/types/src/Gql/ad/propertyTree.d.ts +5 -0
  9. package/dist/types/src/Gql/ad/queries.d.ts +9 -0
  10. package/dist/types/src/Gql/ad/types.d.ts +378 -0
  11. package/dist/types/src/Gql/ad/useAd.d.ts +8 -0
  12. package/dist/types/src/Gql/ad/useInsuranceInquiry.d.ts +11 -0
  13. package/dist/types/src/Gql/ad/useLoanCalculation.d.ts +14 -0
  14. package/dist/types/src/Gql/ad/useRelatedAds.d.ts +12 -0
  15. package/dist/types/src/Gql/ad/view.d.ts +94 -0
  16. package/dist/types/src/Gql/client.d.ts +11 -0
  17. package/dist/types/src/Gql/config.d.ts +9 -0
  18. package/dist/types/src/Gql/facets.d.ts +19 -0
  19. package/dist/types/src/Gql/hit.d.ts +5 -0
  20. package/dist/types/src/Gql/legacyParams.d.ts +7 -0
  21. package/dist/types/src/Gql/queries.d.ts +17 -0
  22. package/dist/types/src/Gql/searchParams.d.ts +55 -0
  23. package/dist/types/src/Gql/suggest.d.ts +8 -0
  24. package/dist/types/src/Gql/types.d.ts +131 -0
  25. package/dist/types/src/Gql/useAdsSearch.d.ts +21 -0
  26. package/dist/types/src/State/Ad/AdContext.d.ts +5 -0
  27. package/dist/types/src/State/Router/RouterContext.d.ts +15 -0
  28. package/dist/types/src/State/Router/RouterProvider.d.ts +6 -0
  29. package/dist/types/src/State/Router/useRouter.d.ts +2 -0
  30. package/dist/types/src/State/Search/SearchContext.d.ts +15 -9
  31. package/dist/types/src/State/Search/SearchProvider.d.ts +1 -5
  32. package/dist/types/src/State/Settings/SettingsContext.d.ts +2 -12
  33. package/dist/types/src/State/Settings/settings.d.ts +56 -0
  34. package/dist/types/src/State/Settings/useSettings.d.ts +1 -1
  35. package/dist/types/src/components/ActionList/index.d.ts +3 -10
  36. package/dist/types/src/components/DocumentList/index.d.ts +3 -3
  37. package/dist/types/src/components/Filter/index.d.ts +1 -3
  38. package/dist/types/src/components/FilterPanel/checkListFacet.d.ts +2 -3
  39. package/dist/types/src/components/FilterPanel/colorFacet.d.ts +2 -3
  40. package/dist/types/src/components/FilterPanel/faceSelector.d.ts +2 -3
  41. package/dist/types/src/components/FilterPanel/index.d.ts +8 -15
  42. package/dist/types/src/components/FilterPanel/rangeFacet.d.ts +3 -3
  43. package/dist/types/src/components/FinancialOptions/LoanModal.d.ts +3 -7
  44. package/dist/types/src/components/FinancialOptions/index.d.ts +5 -7
  45. package/dist/types/src/components/FinancialOptions/leasing.d.ts +3 -3
  46. package/dist/types/src/components/FinancialOptions/loan.d.ts +3 -7
  47. package/dist/types/src/components/Gallery/index.d.ts +3 -5
  48. package/dist/types/src/components/Grid/index.d.ts +3 -7
  49. package/dist/types/src/components/InsuranceOptions/Insurance.d.ts +4 -6
  50. package/dist/types/src/components/InsuranceOptions/InsuranceFree.d.ts +5 -7
  51. package/dist/types/src/components/InsuranceOptions/InsuranceFreeModal.d.ts +4 -4
  52. package/dist/types/src/components/InsuranceOptions/InsuranceModal.d.ts +4 -6
  53. package/dist/types/src/components/InsuranceOptions/index.d.ts +5 -6
  54. package/dist/types/src/components/LeadForm/index.d.ts +1 -6
  55. package/dist/types/src/components/Lightbox/index.d.ts +2 -2
  56. package/dist/types/src/components/Map/index.d.ts +4 -2
  57. package/dist/types/src/components/OpeningHours/index.d.ts +2 -2
  58. package/dist/types/src/components/ProductCard/HitCard.d.ts +10 -0
  59. package/dist/types/src/components/ProductCard/index.d.ts +9 -13
  60. package/dist/types/src/components/SearchBar/index.d.ts +4 -1
  61. package/dist/types/src/components/SearchBar/wrapper.d.ts +10 -0
  62. package/dist/types/src/components/SortSelect/index.d.ts +1 -2
  63. package/dist/types/src/hooks/useSubmitLead.d.ts +1 -1
  64. package/dist/types/src/index.d.ts +5 -4
  65. package/dist/types/src/layouts/WaykeComposite.d.ts +3 -8
  66. package/dist/types/src/layouts/WaykeCompositeWithProvider.d.ts +1 -1
  67. package/dist/types/src/layouts/search/index.d.ts +6 -7
  68. package/dist/types/src/layouts/searchItem/Accessories/AccessoryModal.d.ts +2 -2
  69. package/dist/types/src/layouts/searchItem/Accessories/index.d.ts +2 -2
  70. package/dist/types/src/layouts/searchItem/Branch.d.ts +3 -4
  71. package/dist/types/src/layouts/searchItem/CheckList.d.ts +3 -15
  72. package/dist/types/src/layouts/searchItem/Documents.d.ts +2 -2
  73. package/dist/types/src/layouts/searchItem/ManufacturerPackagesOption.d.ts +2 -2
  74. package/dist/types/src/layouts/searchItem/PackageOptions.d.ts +3 -3
  75. package/dist/types/src/layouts/searchItem/Property.d.ts +1 -6
  76. package/dist/types/src/layouts/searchItem/Related.d.ts +5 -6
  77. package/dist/types/src/layouts/searchItem/index.d.ts +8 -6
  78. package/dist/types/src/layouts/searchItem/useEcom.d.ts +7 -3
  79. package/dist/types/src/providers/WaykeProvider.d.ts +7 -21
  80. package/dist/types/src/utils/image.d.ts +14 -0
  81. package/dist/types/src/utils/sortOptions.d.ts +4 -13
  82. package/package.json +10 -16
  83. package/dist/types/src/@types/action.d.ts +0 -3
  84. package/dist/types/src/@types/codegen/types.d.ts +0 -433
  85. package/dist/types/src/@types/queryFilter.d.ts +0 -5
  86. package/dist/types/src/@types/search.d.ts +0 -114
  87. package/dist/types/src/State/CentralStorage/CentralStorageContext.d.ts +0 -5
  88. package/dist/types/src/State/CentralStorage/CentralStorageProvider.d.ts +0 -6
  89. package/dist/types/src/State/CentralStorage/useCentralStorage.d.ts +0 -6
  90. package/dist/types/src/State/Path/PathContext.d.ts +0 -8
  91. package/dist/types/src/State/Path/PathProvider.d.ts +0 -6
  92. package/dist/types/src/State/Path/reducer.d.ts +0 -14
  93. package/dist/types/src/State/Path/usePath.d.ts +0 -3
  94. package/dist/types/src/State/RelatedSearch/RelatedSearchContext.d.ts +0 -9
  95. package/dist/types/src/State/RelatedSearch/RelatedSearchProvider.d.ts +0 -9
  96. package/dist/types/src/State/RelatedSearch/useRelatedSearch.d.ts +0 -2
  97. package/dist/types/src/State/Settings/SettingsProvider.d.ts +0 -11
  98. package/dist/types/src/components/Video/QuickNavVideo.d.ts +0 -7
  99. package/dist/types/src/hooks/apolloTypes.d.ts +0 -6
  100. package/dist/types/src/hooks/useHasBeenVisible.d.ts +0 -2
  101. package/dist/types/src/hooks/useHashGuid.d.ts +0 -2
  102. package/dist/types/src/hooks/useInsurance.d.ts +0 -4
  103. package/dist/types/src/hooks/useLoan.d.ts +0 -4
  104. package/dist/types/src/hooks/useOnScreen.d.ts +0 -2
  105. package/dist/types/src/hooks/usePrevious.d.ts +0 -2
  106. package/dist/types/src/hooks/useSearchItem.d.ts +0 -4
  107. package/dist/types/src/hooks/useSearchItemBranch.d.ts +0 -4
  108. package/dist/types/src/hooks/useSessionStorage.d.ts +0 -7
  109. package/dist/types/src/layouts/searchItem/BranchModal.d.ts +0 -9
  110. package/dist/types/src/providers/WaykeItemProvidet.d.ts +0 -24
  111. package/dist/types/src/providers/graphqlProvider.d.ts +0 -6
  112. package/dist/types/src/queries/INSURANCE_CALCULATION.d.ts +0 -2
  113. package/dist/types/src/queries/LOAN_CALCULATION.d.ts +0 -2
  114. package/dist/types/src/queries/SEARCH_ITEM_BRANCH_QUERY.d.ts +0 -2
  115. package/dist/types/src/queries/SEARCH_ITEM_QUERY.d.ts +0 -2
  116. package/dist/types/src/utils/deep-copy.d.ts +0 -5
  117. package/dist/types/src/utils/regex.d.ts +0 -3
  118. package/dist/types/src/utils/specification.d.ts +0 -28
  119. package/dist/types/src/utils/url.d.ts +0 -1
  120. package/dist/types/src/utils/vehicle-properties/compare-basic-properties.d.ts +0 -3
  121. package/dist/types/src/utils/vehicle-properties/compare-categories.d.ts +0 -3
  122. package/dist/types/src/utils/vehicle-properties/compare-properties.d.ts +0 -3
  123. package/dist/types/src/utils/vehicle-properties/custom-property-adder.d.ts +0 -13
  124. package/dist/types/src/utils/vehicle-properties/property-remover.d.ts +0 -7
  125. package/dist/types/src/utils/vehicle-properties/property-tree-creator.d.ts +0 -31
  126. package/dist/types/src/utils/vehicle-properties/property-tree-sorter.d.ts +0 -3
@@ -0,0 +1,55 @@
1
+ import { MarketCode } from '../@types/market';
2
+ export declare const FREE_TEXT = "q";
3
+ export declare const SORT = "sort";
4
+ export declare const PAGE = "page";
5
+ /** Facet filters whose URL key, facet field and search argument share a name. */
6
+ export declare const LIST_FILTERS: readonly ['manufacturer', 'model', 'modelSeries', 'fuelType', 'gearboxType', 'branchDisplayName', 'colorName', 'environmentClass', 'segment', 'drivetrainType', 'bodyStyle', 'engineBaseType', 'trimLevel', 'inventoryStatus', 'branchCity'];
7
+ export type ListFilter = (typeof LIST_FILTERS)[number];
8
+ /** Range filters: URL base key → the `…Min`/`…Max` argument pair. */
9
+ export declare const RANGE_FILTERS: {
10
+ readonly price: 'cashPrice';
11
+ readonly odometer: 'odometerReading';
12
+ readonly modelYear: 'modelYear';
13
+ readonly privateLease: 'leasingPrice';
14
+ readonly businessLease: 'companyLeasingPrice';
15
+ };
16
+ export type RangeFilter = keyof typeof RANGE_FILTERS;
17
+ export declare const BOOLEAN_FILTERS: readonly ['certifiedPreOwned', 'isDemoVersion', 'deductibleVat', 'ecom', 'leasing', 'businessLeasing'];
18
+ export interface SortDefinition {
19
+ field: string;
20
+ direction: 'asc' | 'desc';
21
+ /** Legacy token the sort panel translates; see Utils/SortOptions.ts. */
22
+ legacyName: string;
23
+ }
24
+ /** `sort=` keys, in the order the sort panel lists them. The first is the default. */
25
+ export declare const SORT_OPTIONS: Record<string, SortDefinition>;
26
+ export declare const DEFAULT_SORT = "published-desc";
27
+ /** Page size as components-react's legacy search had it: 30, also after a filter. */
28
+ export declare const pageSize: (_params: URLSearchParams) => number;
29
+ export declare const isKnownKey: (key: string) => boolean;
30
+ /** Odometer values in the URL are in the market's display unit; the API takes km. */
31
+ export declare const kmPerOdometerUnit: (market: MarketCode) => 1 | 10;
32
+ export interface AdsVariables {
33
+ market: string[];
34
+ q?: string;
35
+ page: number;
36
+ perPage: number;
37
+ sort?: {
38
+ field: string;
39
+ direction: 'asc' | 'desc';
40
+ };
41
+ [key: string]: unknown;
42
+ }
43
+ /**
44
+ * URL params → `search.ads` variables. Unknown keys are ignored; the page is read
45
+ * from `page` unless given explicitly (load more passes it).
46
+ */
47
+ export declare const toSearchVariables: (params: URLSearchParams, market: MarketCode, options?: {
48
+ page?: number;
49
+ perPage?: number;
50
+ }) => AdsVariables;
51
+ /** The canonical form written to the address bar: known keys only, sorted, no paging. */
52
+ export declare const canonicalParams: (params: URLSearchParams) => URLSearchParams;
53
+ export declare const toggleListValue: (params: URLSearchParams, key: string, value: string) => URLSearchParams;
54
+ export declare const withSort: (params: URLSearchParams, sortKey: string) => URLSearchParams;
55
+ export declare const withPage: (params: URLSearchParams, page: number) => URLSearchParams;
@@ -0,0 +1,8 @@
1
+ import { PublicApiSettings } from './config';
2
+ import { Suggestion } from './types';
3
+ export declare const fetchSuggestions: (settings: PublicApiSettings, q: string, limit?: number) => Promise<Suggestion[]>;
4
+ /**
5
+ * The suggestion's filters as URL params. Built with URLSearchParams so values
6
+ * with `+` or `&` (Bensin+El) survive the round trip.
7
+ */
8
+ export declare const suggestionParams: (suggestion: Suggestion) => URLSearchParams;
@@ -0,0 +1,131 @@
1
+ export interface Money {
2
+ amount: string;
3
+ }
4
+ export interface AdImageFormat {
5
+ format: string;
6
+ url: string;
7
+ }
8
+ export interface SearchHit {
9
+ ad: {
10
+ id: string;
11
+ salesDescription: {
12
+ title: string;
13
+ } | null;
14
+ pricing: {
15
+ cash: {
16
+ price: Money;
17
+ oldPrice: Money | null;
18
+ deductibleVat: boolean;
19
+ } | null;
20
+ leasing: {
21
+ leasingMonthlyPayment: Money | null;
22
+ } | null;
23
+ companyLeasing: {
24
+ leasingMonthlyPayment: Money | null;
25
+ } | null;
26
+ } | null;
27
+ media: {
28
+ items: ({
29
+ id?: string;
30
+ url?: string;
31
+ formats?: AdImageFormat[];
32
+ } | null)[];
33
+ };
34
+ branch: {
35
+ id: string;
36
+ displayName: string | null;
37
+ };
38
+ channels: ({
39
+ status?: string;
40
+ soldAt?: string | null;
41
+ } | null)[];
42
+ };
43
+ iteration: {
44
+ logistics: {
45
+ odometerReading: {
46
+ value: number;
47
+ unit: 'KILOMETER' | 'SCANDINAVIAN_MILE';
48
+ } | null;
49
+ } | null;
50
+ item: {
51
+ displayName?: string;
52
+ manufacturer?: {
53
+ stringValue: string;
54
+ } | null;
55
+ modelSeries?: {
56
+ stringValue: string;
57
+ } | null;
58
+ modelYear?: {
59
+ intValue: number;
60
+ } | null;
61
+ registrationNumber?: {
62
+ stringValue: string;
63
+ } | null;
64
+ driveline?: {
65
+ fuelTypesString: {
66
+ stringValue: string;
67
+ } | null;
68
+ } | null;
69
+ attributes?: {
70
+ transmission: {
71
+ formattedValue: string;
72
+ } | null;
73
+ } | null;
74
+ } | null;
75
+ } | null;
76
+ }
77
+ export interface FacetCount {
78
+ value: string;
79
+ count: number;
80
+ }
81
+ export interface Facet {
82
+ field: string;
83
+ counts: FacetCount[];
84
+ }
85
+ export interface HistogramBucket {
86
+ value: number;
87
+ count: number;
88
+ }
89
+ export interface AdsResult {
90
+ found: number;
91
+ page: number;
92
+ perPage: number;
93
+ hits: SearchHit[];
94
+ facets?: Facet[] | null;
95
+ histograms?: {
96
+ price: HistogramBucket[];
97
+ odometerReading: HistogramBucket[];
98
+ leasingPrice: HistogramBucket[];
99
+ businessLeasingPrice: HistogramBucket[];
100
+ } | null;
101
+ }
102
+ export interface Suggestion {
103
+ label: string;
104
+ count: number;
105
+ dimension: string;
106
+ filters: {
107
+ field: string;
108
+ value: string;
109
+ }[];
110
+ }
111
+ export interface SearchData {
112
+ search: {
113
+ ads: AdsResult | null;
114
+ /** facets_<field>: that facet counted without its own filter */
115
+ [alias: string]: {
116
+ facets?: Facet[] | null;
117
+ } | AdsResult | null | undefined;
118
+ } | null;
119
+ }
120
+ export interface FacetsData {
121
+ search: {
122
+ ads: AdsResult | null;
123
+ } | null;
124
+ }
125
+ export interface SuggestData {
126
+ search: {
127
+ ads: {
128
+ suggest: Suggestion[];
129
+ } | null;
130
+ } | null;
131
+ }
@@ -0,0 +1,21 @@
1
+ import { PublicApiSettings } from './config';
2
+ import { AdsResult, Facet, SearchHit } from './types';
3
+ export interface AdsSearchResult {
4
+ found: number;
5
+ page: number;
6
+ perPage: number;
7
+ /** Every page loaded so far */
8
+ hits: SearchHit[];
9
+ /** List facets of the filtered result, each selected one counted without its own filter */
10
+ facets: Facet[];
11
+ }
12
+ declare const useAdsSearch: (params: URLSearchParams | undefined, settings: PublicApiSettings) => {
13
+ unfiltered: AdsResult | undefined;
14
+ result: AdsSearchResult | undefined;
15
+ loading: boolean;
16
+ loadingMore: boolean;
17
+ error: boolean;
18
+ hasMore: boolean;
19
+ loadMore: () => Promise<void>;
20
+ };
21
+ export default useAdsSearch;
@@ -0,0 +1,5 @@
1
+ import { Ad } from '../../Gql/ad/types';
2
+ /** The ad the page shows, for the parts of the page that need more than their props. */
3
+ export declare const AdContext: import("react").Context<Ad | undefined>;
4
+ declare const useAdContext: () => Ad;
5
+ export default useAdContext;
@@ -0,0 +1,15 @@
1
+ export interface RouterContextProps {
2
+ /** The vehicle that is open, from the hash or the path */
3
+ id?: string;
4
+ /** The query string in the address bar, without `?` */
5
+ search: string;
6
+ /** Link to a vehicle; undefined when routing is `none` */
7
+ itemHref: (id: string) => string | undefined;
8
+ /** Link back to the search from a vehicle; undefined when there is none */
9
+ searchHref?: string;
10
+ /** Click handler for the links above: same-site path links open without a reload */
11
+ onLinkClick: (e: React.MouseEvent<HTMLAnchorElement>, href: string) => void;
12
+ /** Writes the search filters to the address bar when routing.syncUrl is on */
13
+ writeSearch: (params: URLSearchParams, replace?: boolean) => void;
14
+ }
15
+ export declare const RouterContext: import("react").Context<RouterContextProps>;
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ interface RouterProviderProps {
3
+ children: React.ReactNode;
4
+ }
5
+ declare const RouterProvider: ({ children }: RouterProviderProps) => React.JSX.Element;
6
+ export default RouterProvider;
@@ -0,0 +1,2 @@
1
+ declare const useRouter: () => import("./RouterContext").RouterContextProps;
2
+ export default useRouter;
@@ -1,14 +1,20 @@
1
- import { QueryFilter } from '../../@types/queryFilter';
2
- import { Document, Facet, Search } from '../../@types/search';
1
+ import { AdsResult } from '../../Gql/types';
2
+ import { AdsSearchResult } from '../../Gql/useAdsSearch';
3
3
  export interface SearchContextProps {
4
+ /** The filters in the searchParams.ts grammar; empty until the search has initialized */
5
+ params: URLSearchParams;
6
+ /** The filtered result, every page loaded so far */
7
+ result?: AdsSearchResult;
8
+ /** Facets and histograms without filters: the panel's full value lists and slider domains */
9
+ unfiltered?: AdsResult;
4
10
  loading: boolean;
5
- response?: Search;
11
+ loadingMore: boolean;
6
12
  error: boolean;
7
- documents?: Document[];
8
- initialFacets?: Facet[];
9
- queryFilter: QueryFilter;
10
- onFilterUpdate: (nextQuery: string) => void;
11
- onLoadMore: () => void;
12
- onInitialize: (initialQueryParams?: URLSearchParams) => void;
13
+ hasMore: boolean;
14
+ /** Applies new filters. Old keys and sort tokens are translated. */
15
+ update: (next: URLSearchParams | string) => void;
16
+ loadMore: () => void;
17
+ /** Starts the search with the url's filters and/or initialQueryParams */
18
+ initialize: (initialQueryParams?: URLSearchParams) => void;
13
19
  }
14
20
  export declare const SearchContext: import("react").Context<SearchContextProps>;
@@ -1,10 +1,6 @@
1
1
  import React from 'react';
2
2
  interface SearchProviderProps {
3
- url: string;
4
- apiKey?: string;
5
- useQueryParamsFromUrl?: boolean;
6
- pathRoute?: string;
7
3
  children: React.ReactNode;
8
4
  }
9
- declare const SearchProvider: ({ url, apiKey, useQueryParamsFromUrl, pathRoute, children, }: SearchProviderProps) => React.JSX.Element;
5
+ declare const SearchProvider: ({ children }: SearchProviderProps) => React.JSX.Element;
10
6
  export default SearchProvider;
@@ -1,12 +1,2 @@
1
- export interface SettingsContextProps {
2
- /** Base URL of the Wayke API (same host as the search url). Used for lead submission. */
3
- apiUrl?: string;
4
- googleMapsApiKey?: string;
5
- googleMapsMarker?: string;
6
- ecomSettings?: {
7
- url: string;
8
- serviceLogotypeUrl?: string;
9
- bankIdThumbprint?: string;
10
- };
11
- }
12
- export declare const SettingsContext: import("react").Context<SettingsContextProps>;
1
+ import { Settings } from './settings';
2
+ export declare const SettingsContext: import("react").Context<Settings>;
@@ -0,0 +1,56 @@
1
+ import { MarketCode } from '../../@types/market';
2
+ import { PublicApiSettings } from '../../Gql/config';
3
+ export type Environment = 'production' | 'test';
4
+ export type RoutingMode = 'hash' | 'path' | 'none';
5
+ export interface RoutingSettings {
6
+ /**
7
+ * How a vehicle is opened from the search. `hash` (default) adds `#<id>` to
8
+ * the url, `path` links to `<basePath>/<id>`, `none` makes the vehicles plain
9
+ * cards and only publishes `ItemClicked`.
10
+ */
11
+ mode?: RoutingMode;
12
+ /** Required for `path`. Relative to the current page, or an absolute url to another site. */
13
+ basePath?: string;
14
+ /** Reads and writes the search filters in the url. */
15
+ syncUrl?: boolean;
16
+ }
17
+ export interface EcomSettings {
18
+ /** Defaults to the ecom API of `environment`. */
19
+ url?: string;
20
+ /** Url to the logo shown in buy online, as an image file (not a `data:` url). */
21
+ serviceLogotypeUrl?: string;
22
+ bankIdThumbprint?: string;
23
+ }
24
+ export interface WaykeProviderSettings {
25
+ /** Which Wayke environment to use. Default `production`. */
26
+ environment?: Environment;
27
+ /** Identifies the site instead of its domain. Sent as `x-api-key`. */
28
+ apiKey?: string;
29
+ /** Limits the vehicles to a group of branches. By default the key decides which vehicles are shown. */
30
+ branchGroupId?: string;
31
+ /** Language and market. Default `SE`. */
32
+ marketCode?: MarketCode;
33
+ routing?: RoutingSettings;
34
+ /** Turns on buy online. */
35
+ ecomSettings?: EcomSettings;
36
+ /** A Google Maps Static API key. Without it, the map button opens Google Maps. */
37
+ googleMapsApiKey?: string;
38
+ /** Url to a custom marker for the map. */
39
+ googleMapsMarker?: string;
40
+ /** Overrides the public API url of `environment`. */
41
+ publicApiUrl?: string;
42
+ /** Overrides the lead url of `environment`. */
43
+ leadUrl?: string;
44
+ }
45
+ export interface Settings {
46
+ publicApi: PublicApiSettings;
47
+ marketCode: MarketCode;
48
+ leadUrl: string;
49
+ routing: Required<Omit<RoutingSettings, 'basePath'>> & {
50
+ basePath?: string;
51
+ };
52
+ ecom?: Required<Pick<EcomSettings, 'url'>> & EcomSettings;
53
+ googleMapsApiKey?: string;
54
+ googleMapsMarker?: string;
55
+ }
56
+ export declare const resolveSettings: (settings?: WaykeProviderSettings) => Settings;
@@ -1,2 +1,2 @@
1
- declare const useSettings: () => import("./SettingsContext").SettingsContextProps;
1
+ declare const useSettings: () => import("./settings").Settings;
2
2
  export default useSettings;
@@ -1,17 +1,10 @@
1
1
  import React from 'react';
2
- import { Branch, ContactOptions, Ecommerce, Maybe, VehicleData } from '../../@types/codegen/types';
3
2
  import { ConversionOption } from '../../@types/conversion';
4
- import { MarketCode } from '../../@types/market';
5
3
  interface ActionListProps {
6
- id: string;
7
- title?: string | null;
8
- vehicleData?: Maybe<VehicleData>;
9
- branch?: Maybe<Branch>;
10
- contact?: Maybe<ContactOptions>;
11
- ecommerce?: Maybe<Ecommerce>;
12
- marketCode?: MarketCode;
4
+ title: string;
13
5
  conversionOptions?: ConversionOption[];
6
+ /** Undefined when the site has no ecomSettings, which hides the buy button. */
14
7
  toggleEcomModal?: () => void;
15
8
  }
16
- declare const ActionList: ({ id, title, vehicleData, contact, branch, ecommerce, marketCode, conversionOptions, toggleEcomModal, }: ActionListProps) => React.JSX.Element;
9
+ declare const ActionList: ({ title, conversionOptions, toggleEcomModal, }: ActionListProps) => React.JSX.Element;
17
10
  export default ActionList;
@@ -1,11 +1,11 @@
1
1
  import React from 'react';
2
- import { Scalars } from '../../@types/codegen/types';
2
+ import { AdDocument } from '../../Gql/ad/types';
3
3
  interface PdfDownloadItemProps {
4
- document: Scalars['FileDocument']['input'];
4
+ document: AdDocument;
5
5
  }
6
6
  export declare const PdfDownloadItem: ({ document }: PdfDownloadItemProps) => React.JSX.Element;
7
7
  interface IDocumentList {
8
- documents: Scalars['FileDocument']['input'][];
8
+ documents: AdDocument[];
9
9
  }
10
10
  export declare const DocumentList: ({ documents }: IDocumentList) => React.JSX.Element;
11
11
  export default DocumentList;
@@ -1,9 +1,7 @@
1
1
  import React from 'react';
2
2
  import { SearchFilterTypes } from '../../@types/filter';
3
- import { MarketCode } from '../../@types/market';
4
3
  interface FilterProps {
5
- marketCode?: MarketCode;
6
4
  filterList?: SearchFilterTypes[];
7
5
  }
8
- declare const Filter: ({ marketCode, filterList }: FilterProps) => React.JSX.Element | null;
6
+ declare const Filter: ({ filterList }: FilterProps) => React.JSX.Element | null;
9
7
  export default Filter;
@@ -1,7 +1,6 @@
1
1
  import React from 'react';
2
- import { Facet } from '../../@types/search';
3
2
  interface ChecklistFacetProps {
4
- facet: Facet;
3
+ id: string;
5
4
  }
6
- declare const ChecklistFacet: ({ facet }: ChecklistFacetProps) => React.JSX.Element;
5
+ declare const ChecklistFacet: ({ id }: ChecklistFacetProps) => React.JSX.Element;
7
6
  export default ChecklistFacet;
@@ -1,7 +1,6 @@
1
1
  import React from 'react';
2
- import { Facet } from '../../@types/search';
3
2
  interface ColorSelectFacetProps {
4
- facet: Facet;
3
+ id: string;
5
4
  }
6
- declare const ColorSelectFacet: ({ facet }: ColorSelectFacetProps) => React.JSX.Element;
5
+ declare const ColorSelectFacet: ({ id }: ColorSelectFacetProps) => React.JSX.Element;
7
6
  export default ColorSelectFacet;
@@ -1,7 +1,6 @@
1
1
  import React from 'react';
2
- import { Facet } from '../../@types/search';
3
2
  interface FacetSelectorProps {
4
- facet: Facet;
3
+ id: string;
5
4
  }
6
- declare const FacetSelector: ({ facet }: FacetSelectorProps) => React.JSX.Element | null;
5
+ declare const FacetSelector: ({ id }: FacetSelectorProps) => React.JSX.Element | null;
7
6
  export default FacetSelector;
@@ -1,20 +1,13 @@
1
1
  import React from 'react';
2
- import { SearchFilterTypes } from '../../@types/filter';
3
- import { QueryFilter } from '../../@types/queryFilter';
4
- import { Facet } from '../../@types/search';
5
- export interface FilterProps {
6
- label: string;
7
- activeFilters?: number;
2
+ export interface PanelFilter {
3
+ id: string;
4
+ displayName: string;
8
5
  }
9
- export interface Props {
10
- queryFilter: QueryFilter;
11
- facet?: Facet;
12
- loading: boolean;
13
- filteredFacets: Facet[];
14
- filterList?: SearchFilterTypes[];
15
- numberOfHits: number;
6
+ interface Props {
7
+ filters: PanelFilter[];
8
+ /** The filter whose section is open */
9
+ open: string;
16
10
  onClose: () => void;
17
- onFilterUpdate: (nextQuery: string) => void;
18
11
  }
19
- declare const FilterPanel: ({ queryFilter, facet, filteredFacets, numberOfHits, loading, onFilterUpdate, onClose, }: Props) => React.JSX.Element;
12
+ declare const FilterPanel: ({ filters, open, onClose }: Props) => React.JSX.Element;
20
13
  export default FilterPanel;
@@ -1,9 +1,9 @@
1
1
  import React from 'react';
2
- import { Facet } from '../../@types/search';
2
+ import { RangeFilter } from '../../Gql/searchParams';
3
3
  interface RangeFacetProps {
4
- facet: Facet;
4
+ id: RangeFilter;
5
5
  unit?: string;
6
6
  formatValues?: boolean;
7
7
  }
8
- declare const RangeFacet: ({ facet, unit, formatValues }: RangeFacetProps) => React.JSX.Element;
8
+ declare const RangeFacet: ({ id, unit, formatValues }: RangeFacetProps) => React.JSX.Element | null;
9
9
  export default RangeFacet;
@@ -1,12 +1,8 @@
1
1
  import React from 'react';
2
- import { Branch, FinancialOption, Maybe } from '../../@types/codegen/types';
3
- import { MarketCode } from '../../@types/market';
2
+ import { PaymentResponse } from '../../Gql/ad/types';
4
3
  interface LoanModalProps {
5
- id: string;
6
- branch?: Maybe<Branch>;
7
- financialOption: FinancialOption;
8
- marketCode?: MarketCode;
4
+ loan: PaymentResponse;
9
5
  onClose: () => void;
10
6
  }
11
- declare const LoanModal: ({ id, branch, financialOption, marketCode, onClose }: LoanModalProps) => React.JSX.Element;
7
+ declare const LoanModal: ({ loan: option, onClose }: LoanModalProps) => React.JSX.Element;
12
8
  export default LoanModal;
@@ -1,11 +1,9 @@
1
1
  import React from 'react';
2
- import { Branch, FinancialOption, Maybe } from '../../@types/codegen/types';
3
- import { MarketCode } from '../../@types/market';
2
+ import { PaymentResponse } from '../../Gql/ad/types';
3
+ import { LeasingOffer } from '../../Gql/ad/view';
4
4
  interface FinancialOptionsProps {
5
- id: string;
6
- branch?: Maybe<Branch>;
7
- financialOptions: FinancialOption[];
8
- marketCode?: MarketCode;
5
+ loans: PaymentResponse[];
6
+ leasing: LeasingOffer[];
9
7
  }
10
- declare const FinancialOptions: ({ id, branch, financialOptions, marketCode }: FinancialOptionsProps) => React.JSX.Element;
8
+ declare const FinancialOptions: ({ loans, leasing }: FinancialOptionsProps) => React.JSX.Element;
11
9
  export default FinancialOptions;
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
- import { FinancialOption } from '../../@types/codegen/types';
2
+ import { LeasingOffer } from '../../Gql/ad/view';
3
3
  interface LeasingProps {
4
- financialOption: FinancialOption;
4
+ offer: LeasingOffer;
5
5
  }
6
- declare const Leasing: ({ financialOption }: LeasingProps) => React.JSX.Element;
6
+ declare const Leasing: ({ offer }: LeasingProps) => React.JSX.Element;
7
7
  export default Leasing;
@@ -1,11 +1,7 @@
1
1
  import React from 'react';
2
- import { Branch, FinancialOption, Maybe } from '../../@types/codegen/types';
3
- import { MarketCode } from '../../@types/market';
2
+ import { PaymentResponse } from '../../Gql/ad/types';
4
3
  interface LoanProps {
5
- id: string;
6
- branch?: Maybe<Branch>;
7
- financialOption: FinancialOption;
8
- marketCode?: MarketCode;
4
+ loan: PaymentResponse;
9
5
  }
10
- declare const Loan: ({ id, branch, financialOption, marketCode }: LoanProps) => React.JSX.Element;
6
+ declare const Loan: ({ loan }: LoanProps) => React.JSX.Element;
11
7
  export default Loan;
@@ -1,10 +1,8 @@
1
1
  import React from 'react';
2
- import { Branch, Maybe, Media } from '../../@types/codegen/types';
2
+ import { GalleryMedia } from '../../Gql/ad/view';
3
3
  interface GalleryProps {
4
- id: string;
5
- branch?: Maybe<Branch>;
6
- media?: Media[];
4
+ media: GalleryMedia[];
7
5
  placeholderImage?: string;
8
6
  }
9
- declare const Gallery: ({ id, branch, media, placeholderImage }: GalleryProps) => React.JSX.Element;
7
+ declare const Gallery: ({ media, placeholderImage }: GalleryProps) => React.JSX.Element;
10
8
  export default Gallery;
@@ -1,13 +1,9 @@
1
1
  import React from 'react';
2
- import { Document } from '../../@types/search';
3
- import { OnItemClick } from '../ProductCard';
2
+ import { SearchHit } from '../../Gql/types';
4
3
  interface GridProps {
5
- documents?: Document[];
6
- hashRoute?: boolean;
7
- pathRoute?: string;
4
+ hits: SearchHit[];
8
5
  placeholderImage?: string;
9
6
  displayBranchName?: boolean;
10
- onClickItem?: (data: OnItemClick) => void;
11
7
  }
12
- declare const Grid: ({ documents, placeholderImage, hashRoute, pathRoute, displayBranchName, onClickItem, }: GridProps) => React.JSX.Element | null;
8
+ declare const Grid: ({ hits, placeholderImage, displayBranchName }: GridProps) => React.JSX.Element;
13
9
  export default Grid;
@@ -1,9 +1,7 @@
1
1
  import React from 'react';
2
- import { Branch, InsuranceOption } from '../../@types/codegen/types';
3
- interface InsuranceOptions {
4
- id: string;
5
- branch?: Branch | null;
6
- insuranceOptions: InsuranceOption[];
2
+ import { InsuranceProvider } from '../../Gql/ad/types';
3
+ interface InsuranceProps {
4
+ provider: InsuranceProvider;
7
5
  }
8
- declare const Insurance: ({ id, branch, insuranceOptions }: InsuranceOptions) => React.JSX.Element | null;
6
+ declare const Insurance: ({ provider }: InsuranceProps) => React.JSX.Element;
9
7
  export default Insurance;
@@ -1,9 +1,7 @@
1
1
  import React from 'react';
2
- import { Branch, InsuranceOption, Maybe } from '../../@types/codegen/types';
3
- interface InsuranceOptions {
4
- id: string;
5
- branch?: Maybe<Branch>;
6
- insuranceOptions: InsuranceOption[];
2
+ import { InsuranceProvider } from '../../Gql/ad/types';
3
+ interface InsuranceFreeProps {
4
+ provider: InsuranceProvider;
7
5
  }
8
- declare const Insurance: ({ id, branch, insuranceOptions }: InsuranceOptions) => React.JSX.Element | null;
9
- export default Insurance;
6
+ declare const InsuranceFree: ({ provider }: InsuranceFreeProps) => React.JSX.Element;
7
+ export default InsuranceFree;
@@ -1,8 +1,8 @@
1
1
  import React from 'react';
2
- import { InsuranceOption } from '../../@types/codegen/types';
3
- interface InsuranceFreeModal {
2
+ import { InsuranceProvider } from '../../Gql/ad/types';
3
+ interface InsuranceFreeModalProps {
4
4
  onClose: () => void;
5
- insuranceOptions: InsuranceOption;
5
+ provider: InsuranceProvider;
6
6
  }
7
- declare const InsuranceFreeModal: ({ onClose, insuranceOptions }: InsuranceFreeModal) => React.JSX.Element;
7
+ declare const InsuranceFreeModal: ({ onClose, provider }: InsuranceFreeModalProps) => React.JSX.Element;
8
8
  export default InsuranceFreeModal;