@qite/tide-components 1.0.6 → 1.0.7

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 (23) hide show
  1. package/build/build-cjs/index.js +1046 -340
  2. package/build/build-cjs/src/search-results/components/itinerary/itinerary-utils.d.ts +12 -0
  3. package/build/build-cjs/src/search-results/components/itinerary/traject-itinerary.d.ts +9 -0
  4. package/build/build-cjs/src/search-results/components/traject/traject-day-activities-flyin.d.ts +6 -0
  5. package/build/build-cjs/src/search-results/components/traject/traject-flights-flyin.d.ts +13 -0
  6. package/build/build-cjs/src/search-results/components/traject/traject-node-card.d.ts +6 -3
  7. package/build/build-cjs/src/search-results/hooks/use-traject-day-activities.d.ts +6 -0
  8. package/build/build-cjs/src/search-results/store/search-results-slice.d.ts +11 -1
  9. package/build/build-cjs/src/search-results/types.d.ts +12 -2
  10. package/build/build-cjs/src/search-results/utils/traject-utils.d.ts +37 -1
  11. package/build/build-esm/index.js +1046 -340
  12. package/build/build-esm/src/search-results/components/itinerary/itinerary-utils.d.ts +12 -0
  13. package/build/build-esm/src/search-results/components/itinerary/traject-itinerary.d.ts +9 -0
  14. package/build/build-esm/src/search-results/components/traject/traject-day-activities-flyin.d.ts +6 -0
  15. package/build/build-esm/src/search-results/components/traject/traject-flights-flyin.d.ts +13 -0
  16. package/build/build-esm/src/search-results/components/traject/traject-node-card.d.ts +6 -3
  17. package/build/build-esm/src/search-results/hooks/use-traject-day-activities.d.ts +6 -0
  18. package/build/build-esm/src/search-results/store/search-results-slice.d.ts +11 -1
  19. package/build/build-esm/src/search-results/types.d.ts +12 -2
  20. package/build/build-esm/src/search-results/utils/traject-utils.d.ts +37 -1
  21. package/package.json +2 -2
  22. package/styles/booking-search-results-variables.scss +6 -0
  23. package/styles/components/_search.scss +94 -5
@@ -0,0 +1,12 @@
1
+ import { PackagingEntryLine, PackagingEntryLineFlightLine, PackagingTrajectNode } from '@qite/tide-client';
2
+ export declare const getFlightLines: (flight?: PackagingEntryLine) => PackagingEntryLineFlightLine[];
3
+ export declare const getDepartureTime: (flight?: PackagingEntryLine) => string;
4
+ export declare const getArrivalTime: (flight?: PackagingEntryLine) => string;
5
+ export declare const getDuration: (flight?: PackagingEntryLine) => string;
6
+ export declare const numberOfNights: (segment: PackagingEntryLine) => number;
7
+ /** Icon per service type, so every node on the itinerary reads at a glance. */
8
+ export declare const getServiceTypeIcon: (serviceType?: number) => string;
9
+ export declare const getServiceTypeBadgeModifier: (serviceType?: number) => string;
10
+ export declare const POI_TRAJECT_NODE_TYPE = 2;
11
+ export declare const getTrajectNodeIcon: (node: PackagingTrajectNode) => string;
12
+ export declare const getTrajectNodeBadgeModifier: (node: PackagingTrajectNode) => string;
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import { PackagingEntry, PackagingTrajectResponse } from '@qite/tide-client';
3
+ interface TrajectItineraryProps {
4
+ trajectEntry: PackagingTrajectResponse;
5
+ packagingEntry: PackagingEntry;
6
+ translations: any;
7
+ }
8
+ declare const TrajectItinerary: React.FC<TrajectItineraryProps>;
9
+ export default TrajectItinerary;
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ interface TrajectDayActivitiesFlyInProps {
3
+ isLoading?: boolean;
4
+ }
5
+ declare const TrajectDayActivitiesFlyIn: React.FC<TrajectDayActivitiesFlyInProps>;
6
+ export default TrajectDayActivitiesFlyIn;
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ interface TrajectFlightsFlyInProps {
3
+ isLoading?: boolean;
4
+ }
5
+ /**
6
+ * Every flight found for one traject leg, shown in the fly-in.
7
+ *
8
+ * A one-way search can return far more options than belong in the results column, so the column
9
+ * keeps three and hands the rest to this list — the same shape the regular flight results use.
10
+ * Each leg is searched on its own, so the single leg of a result always sits in `outward`.
11
+ */
12
+ declare const TrajectFlightsFlyIn: React.FC<TrajectFlightsFlyInProps>;
13
+ export default TrajectFlightsFlyIn;
@@ -1,8 +1,8 @@
1
1
  import React from 'react';
2
- import { PackagingAccommodationResponse } from '@qite/tide-client';
3
- import { TrajectNodeWithLine } from '../../utils/traject-utils';
2
+ import { PackagingAccommodationResponse, PackagingTrajectNode } from '@qite/tide-client';
4
3
  interface TrajectNodeCardProps {
5
- item: TrajectNodeWithLine;
4
+ /** The traject node this result answers, where there is one. A suggestion has none. */
5
+ node?: PackagingTrajectNode;
6
6
  result: PackagingAccommodationResponse;
7
7
  isSelected: boolean;
8
8
  languageCode?: string;
@@ -10,6 +10,9 @@ interface TrajectNodeCardProps {
10
10
  onSelect: () => void;
11
11
  onEditOptions?: () => void;
12
12
  showNights?: boolean;
13
+ /** Wording for the button. Defaults to select/selected; suggestions say add/remove instead. */
14
+ selectLabel?: string;
15
+ selectedLabel?: string;
13
16
  }
14
17
  declare const TrajectNodeCard: React.FC<TrajectNodeCardProps>;
15
18
  export default TrajectNodeCard;
@@ -0,0 +1,6 @@
1
+ export interface TrajectDay {
2
+ order: number;
3
+ date: string;
4
+ }
5
+ declare const useTrajectDayActivities: () => (day: TrajectDay) => Promise<void>;
6
+ export default useTrajectDayActivities;
@@ -42,7 +42,9 @@ export interface SearchResultsState {
42
42
  trajectNodeAvailability: Record<string, TrajectNodeAvailability>;
43
43
  /** Per-flight-node one-way search results, keyed by the entry line guid. */
44
44
  trajectFlightAvailability: Record<string, TrajectFlightAvailability>;
45
+ trajectDaySuggestions: Record<number, TrajectDaySuggestions>;
45
46
  trajectEditLineGuid: string | null;
47
+ trajectActivitiesDayOrder: number | null;
46
48
  }
47
49
  export type TrajectNodeStatus = 'idle' | 'loading' | 'resolved' | 'unavailable';
48
50
  export interface TrajectNodeAvailability {
@@ -52,6 +54,11 @@ export interface TrajectNodeAvailability {
52
54
  selectedCode: string | null;
53
55
  preferredUnavailable: boolean;
54
56
  }
57
+ export interface TrajectDaySuggestions {
58
+ dayOrder: number;
59
+ status: TrajectNodeStatus;
60
+ results: PackagingAccommodationResponse[];
61
+ }
55
62
  export interface TrajectFlightAvailability {
56
63
  lineGuid: string;
57
64
  status: TrajectNodeStatus;
@@ -86,7 +93,10 @@ export declare const setResults: import("@reduxjs/toolkit").ActionCreatorWithPay
86
93
  }, "searchResults/setTrajectFlightAvailability">, setTrajectFlightSelection: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
87
94
  lineGuid: string;
88
95
  guid: string;
89
- }, "searchResults/setTrajectFlightSelection">, setTrajectEditLineGuid: import("@reduxjs/toolkit").ActionCreatorWithPayload<string | null, "searchResults/setTrajectEditLineGuid">, updateTrajectNodeResult: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
96
+ }, "searchResults/setTrajectFlightSelection">, setTrajectEditLineGuid: import("@reduxjs/toolkit").ActionCreatorWithPayload<string | null, "searchResults/setTrajectEditLineGuid">, setTrajectActivitiesDayOrder: import("@reduxjs/toolkit").ActionCreatorWithPayload<number | null, "searchResults/setTrajectActivitiesDayOrder">, setTrajectDaySuggestionsLoading: import("@reduxjs/toolkit").ActionCreatorWithPayload<number, "searchResults/setTrajectDaySuggestionsLoading">, setTrajectDaySuggestions: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
97
+ dayOrder: number;
98
+ results: PackagingAccommodationResponse[];
99
+ }, "searchResults/setTrajectDaySuggestions">, addEditableEntryLines: import("@reduxjs/toolkit").ActionCreatorWithPayload<PackagingEntryLine[], "searchResults/addEditableEntryLines">, updateTrajectNodeResult: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
90
100
  lineGuid: string;
91
101
  result: PackagingAccommodationResponse;
92
102
  }, "searchResults/updateTrajectNodeResult">, resetTrajectAvailability: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"searchResults/resetTrajectAvailability">, updateEditableEntryLine: import("@reduxjs/toolkit").ActionCreatorWithPayload<PackagingEntryLine, "searchResults/updateEditableEntryLine">, removeEditableEntryLines: import("@reduxjs/toolkit").ActionCreatorWithPayload<string[], "searchResults/removeEditableEntryLines">;
@@ -39,7 +39,17 @@ export interface SearchResultsConfiguration {
39
39
  onFlightBook?: (result: ExtendedFlightSearchResponseItem) => void;
40
40
  packagingEntry?: PackagingEntry | null;
41
41
  trajectEntry?: PackagingTrajectResponse | null;
42
- showNonPreferredItems?: boolean;
42
+ /**
43
+ * From the website portal configuration. When true a traject node may also offer externally
44
+ * sourced (API/vendor) hotels and excursions; when false only products held internally in Tide
45
+ * are searched and shown.
46
+ */
47
+ showApiItems?: boolean;
48
+ /**
49
+ * From the website portal configuration. Hides the "show more" button that opens a traject
50
+ * node's remaining results in the fly-in.
51
+ */
52
+ hideShowMoreResults?: boolean;
43
53
  generatePaymentUrl?: boolean;
44
54
  entryStatus?: number;
45
55
  customEntryStatusId?: number;
@@ -166,7 +176,7 @@ export type SearchSeed = {
166
176
  destinationAirport?: string | null;
167
177
  rooms: BookingPackageRequestRoom[];
168
178
  };
169
- export type FlyInType = 'flight-outward-results' | 'flight-return-results' | 'flight-details' | 'acco-results' | 'acco-details' | 'excursion-results' | 'excursion-details';
179
+ export type FlyInType = 'flight-outward-results' | 'flight-return-results' | 'flight-details' | 'acco-results' | 'acco-details' | 'excursion-results' | 'excursion-details' | 'traject-flight-results' | 'traject-day-activities';
170
180
  export interface ExcursionSearchParams {
171
181
  date: string;
172
182
  fromDate: string;
@@ -1,4 +1,5 @@
1
- import { FlightSearchRequest, PackagingAccommodationRequest, PackagingAccommodationResponse, PackagingEntry, PackagingEntryLine, PackagingFlightResponse, PackagingRoom, PackagingTrajectAlternative, PackagingTrajectNode, PackagingTrajectResponse } from '@qite/tide-client';
1
+ import { FlightSearchRequest, TideClientConfig, PackagingAccommodationRequest, PackagingAccommodationResponse, PackagingDestination, PackagingEntry, PackagingEntryLine, PackagingFlightResponse, PackagingRoom, PackagingTrajectAlternative, PackagingTrajectNode, PackagingTrajectResponse } from '@qite/tide-client';
2
+ import { SearchResultsConfiguration } from '../types';
2
3
  export declare const REGULAR_TRAJECT_NODE_TYPE = 0;
3
4
  export declare const CONNECTING_TRAJECT_NODE_TYPE = 1;
4
5
  export interface TrajectNodeWithLine {
@@ -9,6 +10,7 @@ export interface TrajectNodeWithLine {
9
10
  export declare const isSearchableTrajectNode: (node: PackagingTrajectNode) => boolean;
10
11
  export declare const isTrajectFlightNode: (node: PackagingTrajectNode) => boolean;
11
12
  export declare const getTrajectNodesWithLines: (trajectEntry: PackagingTrajectResponse) => TrajectNodeWithLine[];
13
+ export declare const hasDestination: (destination: PackagingDestination | null) => boolean;
12
14
  export interface TrajectSearchContext {
13
15
  transactionId: string;
14
16
  officeId: number;
@@ -19,7 +21,34 @@ export interface TrajectSearchContext {
19
21
  language: string;
20
22
  rooms: PackagingAccommodationRequest['rooms'];
21
23
  }
24
+ export declare const buildTrajectClientConfig: (context: SearchResultsConfiguration) => TideClientConfig;
25
+ export declare const buildTrajectSearchContext: (context: SearchResultsConfiguration, trajectEntry: PackagingTrajectResponse) => TrajectSearchContext;
22
26
  export declare const buildTrajectNodeRequest: ({ node, line }: TrajectNodeWithLine, context: TrajectSearchContext, productCode: string) => PackagingAccommodationRequest;
27
+ export declare const getDayDestinationItem: (items: TrajectNodeWithLine[], dayOrder: number) => TrajectNodeWithLine | null;
28
+ export declare const getDayDestination: (items: TrajectNodeWithLine[], availability: Record<string, {
29
+ results: PackagingAccommodationResponse[];
30
+ selectedCode: string | null;
31
+ }>, dayOrder: number) => PackagingDestination | null;
32
+ export declare const buildTrajectDayExcursionRequest: (date: string, destination: PackagingDestination, context: TrajectSearchContext) => PackagingAccommodationRequest;
33
+ /**
34
+ * Entry lines for an excursion the traveller picked out of the suggestions.
35
+ *
36
+ * A traject node already has its lines and only needs stamping; a suggestion has none, so this
37
+ * builds them — one per selected option, as the regular day-by-day excursion flow does, since an
38
+ * excursion's options are ticket types (adult, child) rather than rooms. Where the search marks no
39
+ * default, the first option of each room stands in.
40
+ */
41
+ export declare const buildTrajectExcursionLines: (result: PackagingAccommodationResponse) => PackagingEntryLine[];
42
+ export interface DayActivityCard {
43
+ result: PackagingAccommodationResponse;
44
+ /** The traject node this result answers, where it is one of the trip's own excursions. */
45
+ item?: TrajectNodeWithLine;
46
+ }
47
+ export declare const buildDayActivityCards: (items: TrajectNodeWithLine[], availability: Record<string, {
48
+ results: PackagingAccommodationResponse[];
49
+ selectedCode: string | null;
50
+ }>, suggestions: PackagingAccommodationResponse[]) => DayActivityCard[];
51
+ export declare const getConfiguredExcursionCodes: (items: TrajectNodeWithLine[], dayOrder: number) => Set<string>;
23
52
  export declare const getNodeCandidates: (node: PackagingTrajectNode) => PackagingTrajectAlternative[];
24
53
  export declare const findCandidateForResult: (node: PackagingTrajectNode, result: PackagingAccommodationResponse) => PackagingTrajectAlternative | null;
25
54
  export declare const matchesCode: (result: PackagingAccommodationResponse, code: string) => boolean;
@@ -30,3 +59,10 @@ export declare const applyResultToLine: (line: PackagingEntryLine, result: Packa
30
59
  export declare const buildTrajectFlightRequest: ({ node, line }: TrajectNodeWithLine, context: TrajectSearchContext, pax: FlightSearchRequest["pax"]) => FlightSearchRequest;
31
60
  export declare const pickCheapestFlight: (flights: PackagingFlightResponse[]) => PackagingFlightResponse | null;
32
61
  export declare const applyFlightToLine: (line: PackagingEntryLine, flight: PackagingFlightResponse) => PackagingEntryLine;
62
+ /**
63
+ * Externally sourced products carry a vendor configuration; products held internally in Tide have
64
+ * none. `vendorType` is not a reliable signal — the packaging service nulls it out when the search
65
+ * configuration has ExposeProvider off — so the vendor ids are what we go on.
66
+ */
67
+ export declare const isExternalResult: (result: PackagingAccommodationResponse) => boolean;
68
+ export declare const isExternalCandidate: (candidate: PackagingTrajectAlternative) => boolean;