@voyant-travel/flights-react 0.119.2
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.
- package/LICENSE +201 -0
- package/README.md +74 -0
- package/dist/admin/index.d.ts +134 -0
- package/dist/admin/index.d.ts.map +1 -0
- package/dist/admin/index.js +122 -0
- package/dist/admin/pages/flight-book-page.d.ts +12 -0
- package/dist/admin/pages/flight-book-page.d.ts.map +1 -0
- package/dist/admin/pages/flight-book-page.js +40 -0
- package/dist/admin/pages/flights-index-page.d.ts +14 -0
- package/dist/admin/pages/flights-index-page.d.ts.map +1 -0
- package/dist/admin/pages/flights-index-page.js +28 -0
- package/dist/client.d.ts +16 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +75 -0
- package/dist/components/airline-logo.d.ts +19 -0
- package/dist/components/airline-logo.d.ts.map +1 -0
- package/dist/components/airline-logo.js +18 -0
- package/dist/components/airport-combobox.d.ts +20 -0
- package/dist/components/airport-combobox.d.ts.map +1 -0
- package/dist/components/airport-combobox.js +31 -0
- package/dist/components/billing-pickers.d.ts +19 -0
- package/dist/components/billing-pickers.d.ts.map +1 -0
- package/dist/components/billing-pickers.js +148 -0
- package/dist/components/flight-baggage-step.d.ts +32 -0
- package/dist/components/flight-baggage-step.d.ts.map +1 -0
- package/dist/components/flight-baggage-step.js +119 -0
- package/dist/components/flight-billing-step.d.ts +69 -0
- package/dist/components/flight-billing-step.d.ts.map +1 -0
- package/dist/components/flight-billing-step.js +117 -0
- package/dist/components/flight-booking-journey.d.ts +31 -0
- package/dist/components/flight-booking-journey.d.ts.map +1 -0
- package/dist/components/flight-booking-journey.js +103 -0
- package/dist/components/flight-booking-ledger.d.ts +53 -0
- package/dist/components/flight-booking-ledger.d.ts.map +1 -0
- package/dist/components/flight-booking-ledger.js +104 -0
- package/dist/components/flight-booking-page.d.ts +25 -0
- package/dist/components/flight-booking-page.d.ts.map +1 -0
- package/dist/components/flight-booking-page.js +175 -0
- package/dist/components/flight-booking-shell-helpers.d.ts +29 -0
- package/dist/components/flight-booking-shell-helpers.d.ts.map +1 -0
- package/dist/components/flight-booking-shell-helpers.js +204 -0
- package/dist/components/flight-booking-shell-panels.d.ts +24 -0
- package/dist/components/flight-booking-shell-panels.d.ts.map +1 -0
- package/dist/components/flight-booking-shell-panels.js +39 -0
- package/dist/components/flight-booking-shell-types.d.ts +49 -0
- package/dist/components/flight-booking-shell-types.d.ts.map +1 -0
- package/dist/components/flight-booking-shell-types.js +18 -0
- package/dist/components/flight-booking-shell.d.ts +12 -0
- package/dist/components/flight-booking-shell.d.ts.map +1 -0
- package/dist/components/flight-booking-shell.js +210 -0
- package/dist/components/flight-contact-form.d.ts +16 -0
- package/dist/components/flight-contact-form.d.ts.map +1 -0
- package/dist/components/flight-contact-form.js +25 -0
- package/dist/components/flight-fare-upsell-step.d.ts +26 -0
- package/dist/components/flight-fare-upsell-step.d.ts.map +1 -0
- package/dist/components/flight-fare-upsell-step.js +169 -0
- package/dist/components/flight-filters-bar.d.ts +19 -0
- package/dist/components/flight-filters-bar.d.ts.map +1 -0
- package/dist/components/flight-filters-bar.js +98 -0
- package/dist/components/flight-itinerary.d.ts +28 -0
- package/dist/components/flight-itinerary.d.ts.map +1 -0
- package/dist/components/flight-itinerary.js +110 -0
- package/dist/components/flight-offer-detail.d.ts +21 -0
- package/dist/components/flight-offer-detail.d.ts.map +1 -0
- package/dist/components/flight-offer-detail.js +49 -0
- package/dist/components/flight-offer-row.d.ts +25 -0
- package/dist/components/flight-offer-row.d.ts.map +1 -0
- package/dist/components/flight-offer-row.js +78 -0
- package/dist/components/flight-order-confirmation.d.ts +13 -0
- package/dist/components/flight-order-confirmation.d.ts.map +1 -0
- package/dist/components/flight-order-confirmation.js +46 -0
- package/dist/components/flight-passenger-form.d.ts +49 -0
- package/dist/components/flight-passenger-form.d.ts.map +1 -0
- package/dist/components/flight-passenger-form.js +159 -0
- package/dist/components/flight-payment-selector.d.ts +13 -0
- package/dist/components/flight-payment-selector.d.ts.map +1 -0
- package/dist/components/flight-payment-selector.js +32 -0
- package/dist/components/flight-payment-step.d.ts +32 -0
- package/dist/components/flight-payment-step.d.ts.map +1 -0
- package/dist/components/flight-payment-step.js +81 -0
- package/dist/components/flight-search-form.d.ts +14 -0
- package/dist/components/flight-search-form.d.ts.map +1 -0
- package/dist/components/flight-search-form.js +58 -0
- package/dist/components/flight-seat-map.d.ts +32 -0
- package/dist/components/flight-seat-map.d.ts.map +1 -0
- package/dist/components/flight-seat-map.js +101 -0
- package/dist/components/flight-seats-step.d.ts +40 -0
- package/dist/components/flight-seats-step.d.ts.map +1 -0
- package/dist/components/flight-seats-step.js +214 -0
- package/dist/components/flight-services-step.d.ts +27 -0
- package/dist/components/flight-services-step.d.ts.map +1 -0
- package/dist/components/flight-services-step.js +123 -0
- package/dist/components/flights-page-panels.d.ts +27 -0
- package/dist/components/flights-page-panels.d.ts.map +1 -0
- package/dist/components/flights-page-panels.js +40 -0
- package/dist/components/flights-page-types.d.ts +39 -0
- package/dist/components/flights-page-types.d.ts.map +1 -0
- package/dist/components/flights-page-types.js +1 -0
- package/dist/components/flights-page-utils.d.ts +14 -0
- package/dist/components/flights-page-utils.d.ts.map +1 -0
- package/dist/components/flights-page-utils.js +79 -0
- package/dist/components/flights-page.d.ts +4 -0
- package/dist/components/flights-page.d.ts.map +1 -0
- package/dist/components/flights-page.js +209 -0
- package/dist/components/passenger-contact-picker.d.ts +16 -0
- package/dist/components/passenger-contact-picker.d.ts.map +1 -0
- package/dist/components/passenger-contact-picker.js +45 -0
- package/dist/components/pax-cabin-popover.d.ts +18 -0
- package/dist/components/pax-cabin-popover.d.ts.map +1 -0
- package/dist/components/pax-cabin-popover.js +35 -0
- package/dist/components/popular-routes.d.ts +42 -0
- package/dist/components/popular-routes.d.ts.map +1 -0
- package/dist/components/popular-routes.js +108 -0
- package/dist/hooks/index.d.ts +13 -0
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks/index.js +12 -0
- package/dist/hooks/use-aircraft.d.ts +17 -0
- package/dist/hooks/use-aircraft.d.ts.map +1 -0
- package/dist/hooks/use-aircraft.js +18 -0
- package/dist/hooks/use-airlines.d.ts +18 -0
- package/dist/hooks/use-airlines.d.ts.map +1 -0
- package/dist/hooks/use-airlines.js +18 -0
- package/dist/hooks/use-airport-search.d.ts +28 -0
- package/dist/hooks/use-airport-search.d.ts.map +1 -0
- package/dist/hooks/use-airport-search.js +23 -0
- package/dist/hooks/use-airports.d.ts +21 -0
- package/dist/hooks/use-airports.d.ts.map +1 -0
- package/dist/hooks/use-airports.js +17 -0
- package/dist/hooks/use-flight-ancillaries.d.ts +63 -0
- package/dist/hooks/use-flight-ancillaries.d.ts.map +1 -0
- package/dist/hooks/use-flight-ancillaries.js +24 -0
- package/dist/hooks/use-flight-book.d.ts +139 -0
- package/dist/hooks/use-flight-book.d.ts.map +1 -0
- package/dist/hooks/use-flight-book.js +24 -0
- package/dist/hooks/use-flight-offer.d.ts +106 -0
- package/dist/hooks/use-flight-offer.d.ts.map +1 -0
- package/dist/hooks/use-flight-offer.js +20 -0
- package/dist/hooks/use-flight-order.d.ts +286 -0
- package/dist/hooks/use-flight-order.d.ts.map +1 -0
- package/dist/hooks/use-flight-order.js +38 -0
- package/dist/hooks/use-flight-orders.d.ts +147 -0
- package/dist/hooks/use-flight-orders.d.ts.map +1 -0
- package/dist/hooks/use-flight-orders.js +31 -0
- package/dist/hooks/use-flight-search.d.ts +110 -0
- package/dist/hooks/use-flight-search.d.ts.map +1 -0
- package/dist/hooks/use-flight-search.js +18 -0
- package/dist/hooks/use-flight-seat-map.d.ts +49 -0
- package/dist/hooks/use-flight-seat-map.d.ts.map +1 -0
- package/dist/hooks/use-flight-seat-map.js +23 -0
- package/dist/hooks/use-saved-payment-methods.d.ts +23 -0
- package/dist/hooks/use-saved-payment-methods.d.ts.map +1 -0
- package/dist/hooks/use-saved-payment-methods.js +20 -0
- package/dist/i18n/en.d.ts +465 -0
- package/dist/i18n/en.d.ts.map +1 -0
- package/dist/i18n/en.js +520 -0
- package/dist/i18n/index.d.ts +5 -0
- package/dist/i18n/index.d.ts.map +1 -0
- package/dist/i18n/index.js +3 -0
- package/dist/i18n/messages.d.ts +392 -0
- package/dist/i18n/messages.d.ts.map +1 -0
- package/dist/i18n/messages.js +1 -0
- package/dist/i18n/provider.d.ts +952 -0
- package/dist/i18n/provider.d.ts.map +1 -0
- package/dist/i18n/provider.js +44 -0
- package/dist/i18n/ro.d.ts +465 -0
- package/dist/i18n/ro.d.ts.map +1 -0
- package/dist/i18n/ro.js +520 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +6 -0
- package/dist/provider.d.ts +2 -0
- package/dist/provider.d.ts.map +1 -0
- package/dist/provider.js +1 -0
- package/dist/query-keys.d.ts +42 -0
- package/dist/query-keys.d.ts.map +1 -0
- package/dist/query-keys.js +22 -0
- package/dist/query-options.d.ts +827 -0
- package/dist/query-options.d.ts.map +1 -0
- package/dist/query-options.js +58 -0
- package/dist/schemas.d.ts +1658 -0
- package/dist/schemas.d.ts.map +1 -0
- package/dist/schemas.js +295 -0
- package/dist/ui.d.ts +31 -0
- package/dist/ui.d.ts.map +1 -0
- package/dist/ui.js +28 -0
- package/package.json +148 -0
- package/src/styles.css +11 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for describing the origin of the Work and
|
|
141
|
+
reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may accept and charge a
|
|
167
|
+
fee for, the acceptance of support, warranty, indemnity, or
|
|
168
|
+
other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright 2026 PixelMakers Studio SRL
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
package/README.md
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
# @voyant-travel/flights-react
|
|
2
|
+
|
|
3
|
+
The flights client tier: headless data hooks/clients plus the styled UI
|
|
4
|
+
components and page compositions (formerly `@voyant-travel/flights-ui`).
|
|
5
|
+
|
|
6
|
+
Headless consumers (storefronts, portals) import from the root, `./hooks`,
|
|
7
|
+
`./client`, or `./query-keys` — these pull no styling peers. Styled surfaces
|
|
8
|
+
live under `./ui`, `./components/*`, `./i18n`, and `./styles.css`, whose
|
|
9
|
+
heavier peers (`@voyant-travel/ui`, `@voyant-travel/relationships-react`, `@voyant-travel/finance-react/checkout-ui`,
|
|
10
|
+
`@tanstack/react-table`) are optional and only needed when you import those
|
|
11
|
+
subpaths.
|
|
12
|
+
|
|
13
|
+
## Install
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
pnpm add @voyant-travel/flights-react @voyant-travel/flights @voyant-travel/relationships-react @voyant-travel/ui @tanstack/react-query react react-dom
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
`@voyant-travel/ui` provides the design-system primitives. The root and `./hooks`
|
|
20
|
+
subpaths provide the data-layer hooks. CRM-backed contact and billing pickers
|
|
21
|
+
use `@voyant-travel/relationships-react`.
|
|
22
|
+
|
|
23
|
+
## Pages
|
|
24
|
+
|
|
25
|
+
`FlightsPage` renders the search, filter, per-leg round-trip picker, offer
|
|
26
|
+
detail sheet, and booking handoff. The route owns URL validation and navigation:
|
|
27
|
+
|
|
28
|
+
```tsx
|
|
29
|
+
import { FlightsPage } from "@voyant-travel/flights-react/ui"
|
|
30
|
+
|
|
31
|
+
<FlightsPage
|
|
32
|
+
search={search}
|
|
33
|
+
onSearchChange={(next, options) => updateRouteSearch(next, options)}
|
|
34
|
+
onBookOffer={({ outboundOfferId, returnOfferId, passengers, cabin }) =>
|
|
35
|
+
goToBooking({ outboundOfferId, returnOfferId, passengers, cabin })
|
|
36
|
+
}
|
|
37
|
+
/>
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
`FlightBookingPage` renders the repricing, ancillaries, seat-map, passenger,
|
|
41
|
+
billing, payment, and confirmation flow around `FlightBookingShell`. The route
|
|
42
|
+
or app supplies booking and navigation callbacks:
|
|
43
|
+
|
|
44
|
+
```tsx
|
|
45
|
+
import { FlightBookingPage } from "@voyant-travel/flights-react/ui"
|
|
46
|
+
|
|
47
|
+
<FlightBookingPage
|
|
48
|
+
outboundOfferId={offerId}
|
|
49
|
+
returnOfferId={returnOfferId}
|
|
50
|
+
passengers={{ adults: 1, children: 0, infants: 0 }}
|
|
51
|
+
paymentCapabilities={{ chargeSavedCard: false, newCard: false }}
|
|
52
|
+
onBackToSearch={() => navigateToFlights()}
|
|
53
|
+
onBook={(request) => bookFlight(request)}
|
|
54
|
+
onBooked={(order) => navigateToBooking(order.orderId)}
|
|
55
|
+
/>
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
Router behavior, booking submission, payment capabilities, billing-default
|
|
59
|
+
persistence, and contact creation are callbacks or slots so applications keep
|
|
60
|
+
deployment-specific ownership.
|
|
61
|
+
|
|
62
|
+
## I18n
|
|
63
|
+
|
|
64
|
+
Components render English by default. To localize them, wrap your UI in
|
|
65
|
+
`FlightsUiMessagesProvider` and import only the locales your app supports.
|
|
66
|
+
|
|
67
|
+
```tsx
|
|
68
|
+
import { FlightsUiMessagesProvider } from "@voyant-travel/flights-react/ui"
|
|
69
|
+
import { flightsUiEn } from "@voyant-travel/flights-react/i18n/en"
|
|
70
|
+
import { flightsUiRo } from "@voyant-travel/flights-react/i18n/ro"
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
English-only apps should import only `./i18n/en`. Bilingual apps can import
|
|
74
|
+
`./i18n/en` and `./i18n/ro`.
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import { type AdminExtension } from "@voyant-travel/admin";
|
|
2
|
+
import type { CabinClass } from "@voyant-travel/flights/contract/types";
|
|
3
|
+
import { z } from "zod";
|
|
4
|
+
/**
|
|
5
|
+
* Semantic destinations the flights admin surfaces navigate to
|
|
6
|
+
* (packaged-admin RFC §4.7). `booking.detail` (where the wizard lands after
|
|
7
|
+
* booking) comes from the bookings-ui augmentation bound above; declared here
|
|
8
|
+
* are the flights-owned keys plus `person.list`, re-declared shape-locked —
|
|
9
|
+
* also declared by `@voyant-travel/relationships-react/admin`, and interface merging requires
|
|
10
|
+
* the member shape to stay identical across packages.
|
|
11
|
+
*/
|
|
12
|
+
declare module "@voyant-travel/admin" {
|
|
13
|
+
interface AdminDestinations {
|
|
14
|
+
/** The flight search page (the flights area's landing surface). */
|
|
15
|
+
"flight.search": Record<string, never>;
|
|
16
|
+
/**
|
|
17
|
+
* The flight booking wizard for a picked offer (round-trip carries the
|
|
18
|
+
* return-leg offer id). NOT route-backed: the resolver constructs the
|
|
19
|
+
* `return`/`pax_*`/`cabin` search params, which is beyond pure path
|
|
20
|
+
* interpolation — it stays hand-written in the host map.
|
|
21
|
+
*/
|
|
22
|
+
"flightBooking.start": {
|
|
23
|
+
offerId: string;
|
|
24
|
+
returnOfferId?: string;
|
|
25
|
+
adults: number;
|
|
26
|
+
children: number;
|
|
27
|
+
infants: number;
|
|
28
|
+
cabin: CabinClass;
|
|
29
|
+
};
|
|
30
|
+
/** The CRM people list page (the wizard's "add passenger contact" jump). */
|
|
31
|
+
"person.list": Record<string, never>;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Search contract for the flight search page. Everything the page renders is
|
|
36
|
+
* derived from this — the form values, the active filters, the page cursor,
|
|
37
|
+
* the current leg being picked, and (when round-trip) the already-picked
|
|
38
|
+
* outbound — so URLs are shareable, the back button works, and reload
|
|
39
|
+
* preserves state.
|
|
40
|
+
*
|
|
41
|
+
* The per-leg pick model: round-trip searches show outbound results first;
|
|
42
|
+
* once the user picks an outbound (`outboundOfferId` set, `leg` flips to
|
|
43
|
+
* "return"), the page shows return results with the picked outbound pinned
|
|
44
|
+
* at the top.
|
|
45
|
+
*/
|
|
46
|
+
export declare const flightsIndexSearchSchema: z.ZodObject<{
|
|
47
|
+
tripType: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
|
|
48
|
+
round_trip: "round_trip";
|
|
49
|
+
one_way: "one_way";
|
|
50
|
+
}>>>;
|
|
51
|
+
from: z.ZodOptional<z.ZodString>;
|
|
52
|
+
to: z.ZodOptional<z.ZodString>;
|
|
53
|
+
depart: z.ZodOptional<z.ZodString>;
|
|
54
|
+
ret: z.ZodOptional<z.ZodString>;
|
|
55
|
+
leg: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
|
|
56
|
+
outbound: "outbound";
|
|
57
|
+
return: "return";
|
|
58
|
+
}>>>;
|
|
59
|
+
outboundOfferId: z.ZodOptional<z.ZodString>;
|
|
60
|
+
returnOfferId: z.ZodOptional<z.ZodString>;
|
|
61
|
+
pax_a: z.ZodOptional<z.ZodDefault<z.ZodCoercedNumber<unknown>>>;
|
|
62
|
+
pax_c: z.ZodOptional<z.ZodDefault<z.ZodCoercedNumber<unknown>>>;
|
|
63
|
+
pax_i: z.ZodOptional<z.ZodDefault<z.ZodCoercedNumber<unknown>>>;
|
|
64
|
+
cabin: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
|
|
65
|
+
economy: "economy";
|
|
66
|
+
premium_economy: "premium_economy";
|
|
67
|
+
business: "business";
|
|
68
|
+
first: "first";
|
|
69
|
+
}>>>;
|
|
70
|
+
carriers: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
71
|
+
maxStops: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
72
|
+
maxPrice: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
73
|
+
page: z.ZodOptional<z.ZodDefault<z.ZodCoercedNumber<unknown>>>;
|
|
74
|
+
}, z.core.$strip>;
|
|
75
|
+
export type FlightsIndexSearchParams = z.infer<typeof flightsIndexSearchSchema>;
|
|
76
|
+
/**
|
|
77
|
+
* Search contract for the booking wizard route. Pax counts + cabin live in
|
|
78
|
+
* the URL so the page survives a refresh. The route's `$offerId` param is the
|
|
79
|
+
* outbound offer id; the optional `return` search param carries the
|
|
80
|
+
* return-leg offer id when round-trip. Both offers are read from the
|
|
81
|
+
* TanStack Query cache populated by the search page; if the cache is cold
|
|
82
|
+
* the page surfaces an "offer expired" prompt with a back-to-search CTA.
|
|
83
|
+
*/
|
|
84
|
+
export declare const flightsBookSearchSchema: z.ZodObject<{
|
|
85
|
+
return: z.ZodOptional<z.ZodString>;
|
|
86
|
+
pax_a: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
87
|
+
pax_c: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
88
|
+
pax_i: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
89
|
+
cabin: z.ZodDefault<z.ZodEnum<{
|
|
90
|
+
economy: "economy";
|
|
91
|
+
premium_economy: "premium_economy";
|
|
92
|
+
business: "business";
|
|
93
|
+
first: "first";
|
|
94
|
+
}>>;
|
|
95
|
+
}, z.core.$strip>;
|
|
96
|
+
export type FlightsBookSearchParams = z.infer<typeof flightsBookSearchSchema>;
|
|
97
|
+
export interface CreateFlightsAdminExtensionOptions {
|
|
98
|
+
/** Mount path of the flights pages inside the admin workspace. Default `/flights`. */
|
|
99
|
+
basePath?: string;
|
|
100
|
+
/** Localized page titles. Defaults are the English operator nav labels. */
|
|
101
|
+
labels?: {
|
|
102
|
+
flights?: string;
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* The flights admin contribution (packaged-admin RFC Phase 3,
|
|
107
|
+
* `@voyant-travel/<domain>-ui/admin` convention).
|
|
108
|
+
*
|
|
109
|
+
* NAVIGATION: deliberately none. The Flights nav item is part of the BASE
|
|
110
|
+
* operator navigation — see `createOperatorAdminNavigation` in
|
|
111
|
+
* `@voyant-travel/admin` — so contributing a nav entry here would duplicate it.
|
|
112
|
+
* If the base nav ever drops the flights item, this extension is where the
|
|
113
|
+
* entry moves.
|
|
114
|
+
*
|
|
115
|
+
* ROUTES: full implementations (packaged-admin RFC §4.8 endgame) — the
|
|
116
|
+
* package-owned search contracts ({@link flightsIndexSearchSchema} for the
|
|
117
|
+
* search page, {@link flightsBookSearchSchema} for the wizard) and lazy
|
|
118
|
+
* `page` modules; no loaders, because both pages fetch client-side (search
|
|
119
|
+
* results are interactive POSTs, and the wizard reads its offers from the
|
|
120
|
+
* query cache the search page populated). The wizard route is a SIBLING of
|
|
121
|
+
* the search route, not a child: in the operator's old file-based tree it
|
|
122
|
+
* was `flights_.book.$offerId` (the `_` escape opting out of the `/flights`
|
|
123
|
+
* section chrome), and the code-assembled tree reproduces that exactly
|
|
124
|
+
* because every contribution mounts flat under the workspace layout.
|
|
125
|
+
*
|
|
126
|
+
* `component:` stays unattached; each contribution carries a lazy `page`
|
|
127
|
+
* loader instead, so the pages land in their own chunks and the wrappers
|
|
128
|
+
* read route state off `AdminRoutePageProps`. Cross-route links resolve
|
|
129
|
+
* through the semantic destinations declared above.
|
|
130
|
+
*
|
|
131
|
+
* WIDGETS: none today. No cross-domain flights card is slot-mounted.
|
|
132
|
+
*/
|
|
133
|
+
export declare function createFlightsAdminExtension(options?: CreateFlightsAdminExtensionOptions): AdminExtension;
|
|
134
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/admin/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAwB,MAAM,sBAAsB,CAAA;AAOhF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uCAAuC,CAAA;AACvE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB;;;;;;;GAOG;AACH,OAAO,QAAQ,sBAAsB,CAAC;IACpC,UAAU,iBAAiB;QACzB,mEAAmE;QACnE,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAA;QACtC;;;;;WAKG;QACH,qBAAqB,EAAE;YACrB,OAAO,EAAE,MAAM,CAAA;YACf,aAAa,CAAC,EAAE,MAAM,CAAA;YACtB,MAAM,EAAE,MAAM,CAAA;YACd,QAAQ,EAAE,MAAM,CAAA;YAChB,OAAO,EAAE,MAAM,CAAA;YACf,KAAK,EAAE,UAAU,CAAA;SAClB,CAAA;QACD,4EAA4E;QAC5E,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAA;KACrC;CACF;AAED;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAiCjC,CAAA;AAEJ,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAA;AAE/E;;;;;;;GAOG;AACH,eAAO,MAAM,uBAAuB;;;;;;;;;;;iBAOlC,CAAA;AAEF,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAA;AAE7E,MAAM,WAAW,kCAAkC;IACjD,sFAAsF;IACtF,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,2EAA2E;IAC3E,MAAM,CAAC,EAAE;QACP,OAAO,CAAC,EAAE,MAAM,CAAA;KACjB,CAAA;CACF;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAgB,2BAA2B,CACzC,OAAO,GAAE,kCAAuC,GAC/C,cAAc,CA8BhB"}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { defineAdminExtension } from "@voyant-travel/admin";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
/**
|
|
4
|
+
* Search contract for the flight search page. Everything the page renders is
|
|
5
|
+
* derived from this — the form values, the active filters, the page cursor,
|
|
6
|
+
* the current leg being picked, and (when round-trip) the already-picked
|
|
7
|
+
* outbound — so URLs are shareable, the back button works, and reload
|
|
8
|
+
* preserves state.
|
|
9
|
+
*
|
|
10
|
+
* The per-leg pick model: round-trip searches show outbound results first;
|
|
11
|
+
* once the user picks an outbound (`outboundOfferId` set, `leg` flips to
|
|
12
|
+
* "return"), the page shows return results with the picked outbound pinned
|
|
13
|
+
* at the top.
|
|
14
|
+
*/
|
|
15
|
+
export const flightsIndexSearchSchema = z
|
|
16
|
+
.object({
|
|
17
|
+
tripType: z.enum(["round_trip", "one_way"]).default("round_trip"),
|
|
18
|
+
from: z.string().optional(),
|
|
19
|
+
to: z.string().optional(),
|
|
20
|
+
depart: z.string().optional(),
|
|
21
|
+
ret: z.string().optional(),
|
|
22
|
+
leg: z.enum(["outbound", "return"]).default("outbound"),
|
|
23
|
+
/** Set once the outbound is picked; drives the return-leg search. */
|
|
24
|
+
outboundOfferId: z.string().optional(),
|
|
25
|
+
/**
|
|
26
|
+
* Set once the return is picked. Both ids set = "ready to book" state —
|
|
27
|
+
* the page shows a trip summary with a Continue CTA instead of the
|
|
28
|
+
* search results.
|
|
29
|
+
*/
|
|
30
|
+
returnOfferId: z.string().optional(),
|
|
31
|
+
pax_a: z.coerce.number().int().min(1).default(1),
|
|
32
|
+
pax_c: z.coerce.number().int().min(0).default(0),
|
|
33
|
+
pax_i: z.coerce.number().int().min(0).default(0),
|
|
34
|
+
cabin: z.enum(["economy", "premium_economy", "business", "first"]).default("economy"),
|
|
35
|
+
carriers: z.array(z.string()).optional(),
|
|
36
|
+
maxStops: z.coerce.number().int().min(0).optional(),
|
|
37
|
+
maxPrice: z.coerce.number().min(0).optional(),
|
|
38
|
+
page: z.coerce.number().int().min(1).default(1),
|
|
39
|
+
})
|
|
40
|
+
.partial({
|
|
41
|
+
tripType: true,
|
|
42
|
+
pax_a: true,
|
|
43
|
+
pax_c: true,
|
|
44
|
+
pax_i: true,
|
|
45
|
+
cabin: true,
|
|
46
|
+
page: true,
|
|
47
|
+
leg: true,
|
|
48
|
+
});
|
|
49
|
+
/**
|
|
50
|
+
* Search contract for the booking wizard route. Pax counts + cabin live in
|
|
51
|
+
* the URL so the page survives a refresh. The route's `$offerId` param is the
|
|
52
|
+
* outbound offer id; the optional `return` search param carries the
|
|
53
|
+
* return-leg offer id when round-trip. Both offers are read from the
|
|
54
|
+
* TanStack Query cache populated by the search page; if the cache is cold
|
|
55
|
+
* the page surfaces an "offer expired" prompt with a back-to-search CTA.
|
|
56
|
+
*/
|
|
57
|
+
export const flightsBookSearchSchema = z.object({
|
|
58
|
+
/** Return-leg offer id — present only when the trip is round-trip. */
|
|
59
|
+
return: z.string().optional(),
|
|
60
|
+
pax_a: z.coerce.number().int().min(1).default(1),
|
|
61
|
+
pax_c: z.coerce.number().int().min(0).default(0),
|
|
62
|
+
pax_i: z.coerce.number().int().min(0).default(0),
|
|
63
|
+
cabin: z.enum(["economy", "premium_economy", "business", "first"]).default("economy"),
|
|
64
|
+
});
|
|
65
|
+
/**
|
|
66
|
+
* The flights admin contribution (packaged-admin RFC Phase 3,
|
|
67
|
+
* `@voyant-travel/<domain>-ui/admin` convention).
|
|
68
|
+
*
|
|
69
|
+
* NAVIGATION: deliberately none. The Flights nav item is part of the BASE
|
|
70
|
+
* operator navigation — see `createOperatorAdminNavigation` in
|
|
71
|
+
* `@voyant-travel/admin` — so contributing a nav entry here would duplicate it.
|
|
72
|
+
* If the base nav ever drops the flights item, this extension is where the
|
|
73
|
+
* entry moves.
|
|
74
|
+
*
|
|
75
|
+
* ROUTES: full implementations (packaged-admin RFC §4.8 endgame) — the
|
|
76
|
+
* package-owned search contracts ({@link flightsIndexSearchSchema} for the
|
|
77
|
+
* search page, {@link flightsBookSearchSchema} for the wizard) and lazy
|
|
78
|
+
* `page` modules; no loaders, because both pages fetch client-side (search
|
|
79
|
+
* results are interactive POSTs, and the wizard reads its offers from the
|
|
80
|
+
* query cache the search page populated). The wizard route is a SIBLING of
|
|
81
|
+
* the search route, not a child: in the operator's old file-based tree it
|
|
82
|
+
* was `flights_.book.$offerId` (the `_` escape opting out of the `/flights`
|
|
83
|
+
* section chrome), and the code-assembled tree reproduces that exactly
|
|
84
|
+
* because every contribution mounts flat under the workspace layout.
|
|
85
|
+
*
|
|
86
|
+
* `component:` stays unattached; each contribution carries a lazy `page`
|
|
87
|
+
* loader instead, so the pages land in their own chunks and the wrappers
|
|
88
|
+
* read route state off `AdminRoutePageProps`. Cross-route links resolve
|
|
89
|
+
* through the semantic destinations declared above.
|
|
90
|
+
*
|
|
91
|
+
* WIDGETS: none today. No cross-domain flights card is slot-mounted.
|
|
92
|
+
*/
|
|
93
|
+
export function createFlightsAdminExtension(options = {}) {
|
|
94
|
+
const { basePath = "/flights", labels = {} } = options;
|
|
95
|
+
const { flights = "Flights" } = labels;
|
|
96
|
+
return defineAdminExtension({
|
|
97
|
+
id: "flights",
|
|
98
|
+
routes: [
|
|
99
|
+
{
|
|
100
|
+
id: "flights-index",
|
|
101
|
+
path: basePath,
|
|
102
|
+
title: flights,
|
|
103
|
+
// Route-backed destination (RFC §4.7 endgame): the key resolves by
|
|
104
|
+
// pure path interpolation of this route, so the host's resolver is
|
|
105
|
+
// generated (`voyant admin generate --destinations`).
|
|
106
|
+
// `flightBooking.start` is deliberately NOT bound: its resolver
|
|
107
|
+
// constructs search params, which is beyond path interpolation — it
|
|
108
|
+
// stays hand-written.
|
|
109
|
+
destination: "flight.search",
|
|
110
|
+
validateSearch: (search) => flightsIndexSearchSchema.parse(search),
|
|
111
|
+
page: () => import("./pages/flights-index-page.js"),
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
id: "flights-book",
|
|
115
|
+
path: `${basePath}/book/$offerId`,
|
|
116
|
+
title: flights,
|
|
117
|
+
validateSearch: (search) => flightsBookSearchSchema.parse(search),
|
|
118
|
+
page: () => import("./pages/flight-book-page.js"),
|
|
119
|
+
},
|
|
120
|
+
],
|
|
121
|
+
});
|
|
122
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type AdminRoutePageProps } from "@voyant-travel/admin";
|
|
2
|
+
/**
|
|
3
|
+
* Packaged route page for the flight booking wizard: binds the matched
|
|
4
|
+
* route's `$offerId` param (the outbound offer) and the validated
|
|
5
|
+
* pax/cabin/`return` search params onto {@link FlightBookingPage}, books
|
|
6
|
+
* through the package's own mutation hook, and resolves every cross-route
|
|
7
|
+
* link through semantic destinations — back to `flight.search`, the
|
|
8
|
+
* passenger-contact jump to `person.list` (new tab), and the post-booking
|
|
9
|
+
* landing on `booking.detail` (a flight order confirms into a booking).
|
|
10
|
+
*/
|
|
11
|
+
export default function FlightBookRoutePage({ params, search }: AdminRoutePageProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
//# sourceMappingURL=flight-book-page.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flight-book-page.d.ts","sourceRoot":"","sources":["../../../src/admin/pages/flight-book-page.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,mBAAmB,EAAkC,MAAM,sBAAsB,CAAA;AAoB/F;;;;;;;;GAQG;AACH,MAAM,CAAC,OAAO,UAAU,mBAAmB,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,mBAAmB,2CAyBlF"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { useAdminHref, useAdminNavigate } from "@voyant-travel/admin";
|
|
4
|
+
import { FlightBookingPage } from "../../components/flight-booking-page.js";
|
|
5
|
+
import { useFlightBook } from "../../hooks/use-flight-book.js";
|
|
6
|
+
/** Card charging is not wired for the demo connector — collect details only. */
|
|
7
|
+
const paymentCapabilities = { chargeSavedCard: false, newCard: false };
|
|
8
|
+
/**
|
|
9
|
+
* Open a resolved destination href in a new tab (keeps the wizard in place).
|
|
10
|
+
* No-op during SSR and for unresolvable destinations (`"#"` is the
|
|
11
|
+
* `useAdminHref` fallback — opening it would just clone the current page).
|
|
12
|
+
*/
|
|
13
|
+
function openHrefInNewTab(href) {
|
|
14
|
+
if (typeof window === "undefined" || href === "#")
|
|
15
|
+
return;
|
|
16
|
+
window.open(href, "_blank", "noopener,noreferrer");
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Packaged route page for the flight booking wizard: binds the matched
|
|
20
|
+
* route's `$offerId` param (the outbound offer) and the validated
|
|
21
|
+
* pax/cabin/`return` search params onto {@link FlightBookingPage}, books
|
|
22
|
+
* through the package's own mutation hook, and resolves every cross-route
|
|
23
|
+
* link through semantic destinations — back to `flight.search`, the
|
|
24
|
+
* passenger-contact jump to `person.list` (new tab), and the post-booking
|
|
25
|
+
* landing on `booking.detail` (a flight order confirms into a booking).
|
|
26
|
+
*/
|
|
27
|
+
export default function FlightBookRoutePage({ params, search }) {
|
|
28
|
+
const navigateTo = useAdminNavigate();
|
|
29
|
+
const resolveHref = useAdminHref();
|
|
30
|
+
const bookMutation = useFlightBook();
|
|
31
|
+
const bookSearch = search;
|
|
32
|
+
return (_jsx(FlightBookingPage, { outboundOfferId: params.offerId ?? "", returnOfferId: bookSearch.return, passengers: {
|
|
33
|
+
adults: bookSearch.pax_a ?? 1,
|
|
34
|
+
children: bookSearch.pax_c ?? 0,
|
|
35
|
+
infants: bookSearch.pax_i ?? 0,
|
|
36
|
+
}, paymentCapabilities: paymentCapabilities, onBackToSearch: () => navigateTo("flight.search", {}), onAddPassengerContact: () => openHrefInNewTab(resolveHref("person.list", {})), onBook: async (request) => {
|
|
37
|
+
const result = await bookMutation.mutateAsync(request);
|
|
38
|
+
return result.order;
|
|
39
|
+
}, onBooked: (order) => navigateTo("booking.detail", { bookingId: order.orderId }) }));
|
|
40
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type AdminRoutePageProps } from "@voyant-travel/admin";
|
|
2
|
+
/**
|
|
3
|
+
* Packaged route page for the flight search surface. The contribution's
|
|
4
|
+
* `validateSearch` ({@link flightsIndexSearchSchema}) already validated
|
|
5
|
+
* `search`, so the cast onto the page's search contract is sound.
|
|
6
|
+
*
|
|
7
|
+
* Search updates default to PUSH (not replace): each leg pick / filter
|
|
8
|
+
* change is a history entry, which is what makes the back button walk the
|
|
9
|
+
* outbound → return → ready flow. Booking continues into the wizard through
|
|
10
|
+
* the `flightBooking.start` destination (host-resolved — its href carries
|
|
11
|
+
* the pax/cabin search params).
|
|
12
|
+
*/
|
|
13
|
+
export default function FlightsIndexPage({ search, updateSearch }: AdminRoutePageProps): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
//# sourceMappingURL=flights-index-page.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flights-index-page.d.ts","sourceRoot":"","sources":["../../../src/admin/pages/flights-index-page.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,mBAAmB,EAAoB,MAAM,sBAAsB,CAAA;AAKjF;;;;;;;;;;GAUG;AACH,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,EAAE,MAAM,EAAE,YAAY,EAAE,EAAE,mBAAmB,2CAuBrF"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { useAdminNavigate } from "@voyant-travel/admin";
|
|
4
|
+
import { FlightsPage } from "../../components/flights-page.js";
|
|
5
|
+
/**
|
|
6
|
+
* Packaged route page for the flight search surface. The contribution's
|
|
7
|
+
* `validateSearch` ({@link flightsIndexSearchSchema}) already validated
|
|
8
|
+
* `search`, so the cast onto the page's search contract is sound.
|
|
9
|
+
*
|
|
10
|
+
* Search updates default to PUSH (not replace): each leg pick / filter
|
|
11
|
+
* change is a history entry, which is what makes the back button walk the
|
|
12
|
+
* outbound → return → ready flow. Booking continues into the wizard through
|
|
13
|
+
* the `flightBooking.start` destination (host-resolved — its href carries
|
|
14
|
+
* the pax/cabin search params).
|
|
15
|
+
*/
|
|
16
|
+
export default function FlightsIndexPage({ search, updateSearch }) {
|
|
17
|
+
const navigateTo = useAdminNavigate();
|
|
18
|
+
return (_jsx(FlightsPage, { search: search, onSearchChange: (next, options) => updateSearch(() => next, {
|
|
19
|
+
replace: options?.replace ?? false,
|
|
20
|
+
}), onBookOffer: ({ outboundOfferId, returnOfferId, passengers, cabin }) => navigateTo("flightBooking.start", {
|
|
21
|
+
offerId: outboundOfferId,
|
|
22
|
+
...(returnOfferId ? { returnOfferId } : {}),
|
|
23
|
+
adults: passengers.adults,
|
|
24
|
+
children: passengers.children ?? 0,
|
|
25
|
+
infants: passengers.infants ?? 0,
|
|
26
|
+
cabin,
|
|
27
|
+
}) }));
|
|
28
|
+
}
|
package/dist/client.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { z } from "zod";
|
|
2
|
+
export type VoyantFetcher = (url: string, init?: RequestInit) => Promise<Response>;
|
|
3
|
+
export declare const defaultFetcher: VoyantFetcher;
|
|
4
|
+
export declare class VoyantApiError extends Error {
|
|
5
|
+
readonly status: number;
|
|
6
|
+
readonly body: unknown;
|
|
7
|
+
constructor(message: string, status: number, body: unknown);
|
|
8
|
+
}
|
|
9
|
+
export interface FetchWithValidationOptions {
|
|
10
|
+
baseUrl: string;
|
|
11
|
+
fetcher: VoyantFetcher;
|
|
12
|
+
}
|
|
13
|
+
export declare function fetchWithValidation<TOut>(path: string, schema: z.ZodType<TOut>, options: FetchWithValidationOptions, init?: RequestInit): Promise<TOut>;
|
|
14
|
+
export type QueryParamValue = string | number | boolean | null | undefined | Array<string | number | boolean>;
|
|
15
|
+
export declare function withQueryParams(path: string, params: Record<string, QueryParamValue>): string;
|
|
16
|
+
//# sourceMappingURL=client.d.ts.map
|