@voyant-travel/catalog-react 0.117.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 +36 -0
- package/dist/admin/catalog-vertical-host.d.ts +45 -0
- package/dist/admin/catalog-vertical-host.d.ts.map +1 -0
- package/dist/admin/catalog-vertical-host.js +230 -0
- package/dist/admin/cruise-detail-host.d.ts +11 -0
- package/dist/admin/cruise-detail-host.d.ts.map +1 -0
- package/dist/admin/cruise-detail-host.js +33 -0
- package/dist/admin/dynamic-catalog-host.d.ts +13 -0
- package/dist/admin/dynamic-catalog-host.d.ts.map +1 -0
- package/dist/admin/dynamic-catalog-host.js +17 -0
- package/dist/admin/index.d.ts +133 -0
- package/dist/admin/index.d.ts.map +1 -0
- package/dist/admin/index.js +144 -0
- package/dist/admin/open-in-new-tab.d.ts +7 -0
- package/dist/admin/open-in-new-tab.d.ts.map +1 -0
- package/dist/admin/open-in-new-tab.js +10 -0
- package/dist/admin/pages/catalog-accommodations-detail-page.d.ts +4 -0
- package/dist/admin/pages/catalog-accommodations-detail-page.d.ts.map +1 -0
- package/dist/admin/pages/catalog-accommodations-detail-page.js +7 -0
- package/dist/admin/pages/catalog-accommodations-index-page.d.ts +8 -0
- package/dist/admin/pages/catalog-accommodations-index-page.d.ts.map +1 -0
- package/dist/admin/pages/catalog-accommodations-index-page.js +17 -0
- package/dist/admin/pages/catalog-cruises-detail-page.d.ts +4 -0
- package/dist/admin/pages/catalog-cruises-detail-page.d.ts.map +1 -0
- package/dist/admin/pages/catalog-cruises-detail-page.js +7 -0
- package/dist/admin/pages/catalog-cruises-index-page.d.ts +8 -0
- package/dist/admin/pages/catalog-cruises-index-page.d.ts.map +1 -0
- package/dist/admin/pages/catalog-cruises-index-page.js +19 -0
- package/dist/admin/pages/catalog-excursions-detail-page.d.ts +4 -0
- package/dist/admin/pages/catalog-excursions-detail-page.d.ts.map +1 -0
- package/dist/admin/pages/catalog-excursions-detail-page.js +7 -0
- package/dist/admin/pages/catalog-excursions-index-page.d.ts +8 -0
- package/dist/admin/pages/catalog-excursions-index-page.d.ts.map +1 -0
- package/dist/admin/pages/catalog-excursions-index-page.js +12 -0
- package/dist/admin/pages/catalog-products-detail-page.d.ts +8 -0
- package/dist/admin/pages/catalog-products-detail-page.d.ts.map +1 -0
- package/dist/admin/pages/catalog-products-detail-page.js +12 -0
- package/dist/admin/pages/catalog-products-index-page.d.ts +8 -0
- package/dist/admin/pages/catalog-products-index-page.d.ts.map +1 -0
- package/dist/admin/pages/catalog-products-index-page.js +12 -0
- package/dist/admin/pages/catalog-tours-detail-page.d.ts +4 -0
- package/dist/admin/pages/catalog-tours-detail-page.d.ts.map +1 -0
- package/dist/admin/pages/catalog-tours-detail-page.js +7 -0
- package/dist/admin/pages/catalog-tours-index-page.d.ts +8 -0
- package/dist/admin/pages/catalog-tours-index-page.d.ts.map +1 -0
- package/dist/admin/pages/catalog-tours-index-page.js +12 -0
- package/dist/admin/product-detail-host.d.ts +18 -0
- package/dist/admin/product-detail-host.d.ts.map +1 -0
- package/dist/admin/product-detail-host.js +40 -0
- package/dist/admin/scheduled-catalog-host.d.ts +15 -0
- package/dist/admin/scheduled-catalog-host.d.ts.map +1 -0
- package/dist/admin/scheduled-catalog-host.js +19 -0
- package/dist/admin/vertical-detail-host.d.ts +13 -0
- package/dist/admin/vertical-detail-host.d.ts.map +1 -0
- package/dist/admin/vertical-detail-host.js +62 -0
- package/dist/booking-engine/index.d.ts +26 -0
- package/dist/booking-engine/index.d.ts.map +1 -0
- package/dist/booking-engine/index.js +25 -0
- package/dist/booking-engine/use-booking-commit.d.ts +61 -0
- package/dist/booking-engine/use-booking-commit.d.ts.map +1 -0
- package/dist/booking-engine/use-booking-commit.js +47 -0
- package/dist/booking-engine/use-booking-draft-shape.d.ts +20 -0
- package/dist/booking-engine/use-booking-draft-shape.d.ts.map +1 -0
- package/dist/booking-engine/use-booking-draft-shape.js +9 -0
- package/dist/booking-engine/use-booking-draft.d.ts +102 -0
- package/dist/booking-engine/use-booking-draft.d.ts.map +1 -0
- package/dist/booking-engine/use-booking-draft.js +93 -0
- package/dist/booking-engine/use-booking-hold.d.ts +30 -0
- package/dist/booking-engine/use-booking-hold.d.ts.map +1 -0
- package/dist/booking-engine/use-booking-hold.js +44 -0
- package/dist/booking-engine/use-booking-journey-api.d.ts +23 -0
- package/dist/booking-engine/use-booking-journey-api.d.ts.map +1 -0
- package/dist/booking-engine/use-booking-journey-api.js +24 -0
- package/dist/booking-engine/use-booking-quote.d.ts +711 -0
- package/dist/booking-engine/use-booking-quote.d.ts.map +1 -0
- package/dist/booking-engine/use-booking-quote.js +122 -0
- package/dist/catalog-enrichment-mappers.d.ts +162 -0
- package/dist/catalog-enrichment-mappers.d.ts.map +1 -0
- package/dist/catalog-enrichment-mappers.js +190 -0
- package/dist/catalog-enrichment.d.ts +203 -0
- package/dist/catalog-enrichment.d.ts.map +1 -0
- package/dist/catalog-enrichment.js +130 -0
- package/dist/catalog-offers-client.d.ts +58 -0
- package/dist/catalog-offers-client.d.ts.map +1 -0
- package/dist/catalog-offers-client.js +61 -0
- package/dist/catalog-search-params.d.ts +45 -0
- package/dist/catalog-search-params.d.ts.map +1 -0
- package/dist/catalog-search-params.js +30 -0
- package/dist/catalog-surfaces.d.ts +17 -0
- package/dist/catalog-surfaces.d.ts.map +1 -0
- package/dist/catalog-surfaces.js +26 -0
- package/dist/client.d.ts +20 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +65 -0
- package/dist/components/availability-calendar.d.ts +33 -0
- package/dist/components/availability-calendar.d.ts.map +1 -0
- package/dist/components/availability-calendar.js +65 -0
- package/dist/components/catalog-browse-page.d.ts +41 -0
- package/dist/components/catalog-browse-page.d.ts.map +1 -0
- package/dist/components/catalog-browse-page.js +47 -0
- package/dist/components/catalog-card.d.ts +68 -0
- package/dist/components/catalog-card.d.ts.map +1 -0
- package/dist/components/catalog-card.js +52 -0
- package/dist/components/catalog-detail-cruise-cards.d.ts +16 -0
- package/dist/components/catalog-detail-cruise-cards.d.ts.map +1 -0
- package/dist/components/catalog-detail-cruise-cards.js +54 -0
- package/dist/components/catalog-detail-departures.d.ts +25 -0
- package/dist/components/catalog-detail-departures.d.ts.map +1 -0
- package/dist/components/catalog-detail-departures.js +240 -0
- package/dist/components/catalog-detail-parts.d.ts +70 -0
- package/dist/components/catalog-detail-parts.d.ts.map +1 -0
- package/dist/components/catalog-detail-parts.js +282 -0
- package/dist/components/catalog-detail-sheet.d.ts +93 -0
- package/dist/components/catalog-detail-sheet.d.ts.map +1 -0
- package/dist/components/catalog-detail-sheet.js +68 -0
- package/dist/components/catalog-detail-view.d.ts +39 -0
- package/dist/components/catalog-detail-view.d.ts.map +1 -0
- package/dist/components/catalog-detail-view.js +157 -0
- package/dist/components/catalog-enrichment-fetchers.d.ts +8 -0
- package/dist/components/catalog-enrichment-fetchers.d.ts.map +1 -0
- package/dist/components/catalog-enrichment-fetchers.js +7 -0
- package/dist/components/catalog-faceted-filter.d.ts +30 -0
- package/dist/components/catalog-faceted-filter.d.ts.map +1 -0
- package/dist/components/catalog-faceted-filter.js +24 -0
- package/dist/components/catalog-filter-rail.d.ts +25 -0
- package/dist/components/catalog-filter-rail.d.ts.map +1 -0
- package/dist/components/catalog-filter-rail.js +88 -0
- package/dist/components/catalog-gallery.d.ts +27 -0
- package/dist/components/catalog-gallery.d.ts.map +1 -0
- package/dist/components/catalog-gallery.js +66 -0
- package/dist/components/catalog-hit.d.ts +27 -0
- package/dist/components/catalog-hit.d.ts.map +1 -0
- package/dist/components/catalog-hit.js +57 -0
- package/dist/components/catalog-page-cards.d.ts +21 -0
- package/dist/components/catalog-page-cards.d.ts.map +1 -0
- package/dist/components/catalog-page-cards.js +174 -0
- package/dist/components/catalog-page-config.d.ts +17 -0
- package/dist/components/catalog-page-config.d.ts.map +1 -0
- package/dist/components/catalog-page-config.js +369 -0
- package/dist/components/catalog-page.d.ts +88 -0
- package/dist/components/catalog-page.d.ts.map +1 -0
- package/dist/components/catalog-page.js +148 -0
- package/dist/components/catalog-range-filter.d.ts +34 -0
- package/dist/components/catalog-range-filter.d.ts.map +1 -0
- package/dist/components/catalog-range-filter.js +72 -0
- package/dist/components/catalog-search-page.d.ts +239 -0
- package/dist/components/catalog-search-page.d.ts.map +1 -0
- package/dist/components/catalog-search-page.js +63 -0
- package/dist/components/catalog-search-tab-panel.d.ts +42 -0
- package/dist/components/catalog-search-tab-panel.d.ts.map +1 -0
- package/dist/components/catalog-search-tab-panel.js +199 -0
- package/dist/components/catalog-vertical-detail-page.d.ts +33 -0
- package/dist/components/catalog-vertical-detail-page.d.ts.map +1 -0
- package/dist/components/catalog-vertical-detail-page.js +100 -0
- package/dist/components/cruise-detail-page-parts.d.ts +72 -0
- package/dist/components/cruise-detail-page-parts.d.ts.map +1 -0
- package/dist/components/cruise-detail-page-parts.js +146 -0
- package/dist/components/cruise-detail-page.d.ts +21 -0
- package/dist/components/cruise-detail-page.d.ts.map +1 -0
- package/dist/components/cruise-detail-page.js +201 -0
- package/dist/components/dynamic-catalog-page-parts.d.ts +40 -0
- package/dist/components/dynamic-catalog-page-parts.d.ts.map +1 -0
- package/dist/components/dynamic-catalog-page-parts.js +43 -0
- package/dist/components/dynamic-catalog-page.d.ts +23 -0
- package/dist/components/dynamic-catalog-page.d.ts.map +1 -0
- package/dist/components/dynamic-catalog-page.js +270 -0
- package/dist/components/media-gallery.d.ts +13 -0
- package/dist/components/media-gallery.d.ts.map +1 -0
- package/dist/components/media-gallery.js +42 -0
- package/dist/components/product-detail-page-parts.d.ts +106 -0
- package/dist/components/product-detail-page-parts.d.ts.map +1 -0
- package/dist/components/product-detail-page-parts.js +130 -0
- package/dist/components/product-detail-page.d.ts +57 -0
- package/dist/components/product-detail-page.d.ts.map +1 -0
- package/dist/components/product-detail-page.js +175 -0
- package/dist/components/scheduled-catalog-page.d.ts +34 -0
- package/dist/components/scheduled-catalog-page.d.ts.map +1 -0
- package/dist/components/scheduled-catalog-page.js +6 -0
- package/dist/hooks/index.d.ts +3 -0
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks/index.js +2 -0
- package/dist/hooks/use-catalog-offers.d.ts +186 -0
- package/dist/hooks/use-catalog-offers.d.ts.map +1 -0
- package/dist/hooks/use-catalog-offers.js +105 -0
- package/dist/hooks/use-catalog-search.d.ts +109 -0
- package/dist/hooks/use-catalog-search.d.ts.map +1 -0
- package/dist/hooks/use-catalog-search.js +52 -0
- package/dist/i18n/en.d.ts +397 -0
- package/dist/i18n/en.d.ts.map +1 -0
- package/dist/i18n/en.js +396 -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 +335 -0
- package/dist/i18n/messages.d.ts.map +1 -0
- package/dist/i18n/messages.js +1 -0
- package/dist/i18n/provider.d.ts +816 -0
- package/dist/i18n/provider.d.ts.map +1 -0
- package/dist/i18n/provider.js +44 -0
- package/dist/i18n/ro.d.ts +397 -0
- package/dist/i18n/ro.d.ts.map +1 -0
- package/dist/i18n/ro.js +396 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +17 -0
- package/dist/provider.d.ts +2 -0
- package/dist/provider.d.ts.map +1 -0
- package/dist/provider.js +1 -0
- package/dist/schemas-catalog-offers.d.ts +290 -0
- package/dist/schemas-catalog-offers.d.ts.map +1 -0
- package/dist/schemas-catalog-offers.js +155 -0
- package/dist/schemas.d.ts +143 -0
- package/dist/schemas.d.ts.map +1 -0
- package/dist/schemas.js +76 -0
- package/dist/ui.d.ts +19 -0
- package/dist/ui.d.ts.map +1 -0
- package/dist/ui.js +18 -0
- package/package.json +150 -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,36 @@
|
|
|
1
|
+
# @voyant-travel/catalog-react
|
|
2
|
+
|
|
3
|
+
The catalog client tier: headless data hooks/clients plus the styled UI
|
|
4
|
+
primitives and page-level compositions (formerly `@voyant-travel/catalog-ui`).
|
|
5
|
+
|
|
6
|
+
Headless consumers (storefronts, portals) import from the root, `./hooks`,
|
|
7
|
+
`./client`, or `./booking-engine` — these pull no styling peers. Styled
|
|
8
|
+
surfaces live under `./ui`, `./components/*`, `./admin`, `./i18n`, and
|
|
9
|
+
`./styles.css`, whose heavier peers (`@voyant-travel/ui`, `@voyant-travel/admin`,
|
|
10
|
+
`@tanstack/react-table`, `sonner`) are optional and only needed when you
|
|
11
|
+
import those subpaths.
|
|
12
|
+
|
|
13
|
+
## Page Compositions
|
|
14
|
+
|
|
15
|
+
`CatalogPage` owns the tabbed catalog search layout and default vertical columns.
|
|
16
|
+
Apps provide routing and deployment-specific behavior through callbacks:
|
|
17
|
+
|
|
18
|
+
- `search`, `onTabChange`, `onQueryChange`, and `onPageChange` for URL state.
|
|
19
|
+
- `formatSupplier` for supplier id labels.
|
|
20
|
+
- `onBookHit`, `onBookDeparture`, `onOpenProductEditor`, and
|
|
21
|
+
`onLoadProductDetail` for route transitions and content APIs.
|
|
22
|
+
- `detailSheetWidth`, `detailHeaderExtras`, `renderDetailBrochure`,
|
|
23
|
+
`renderDetailMedia`, `renderDetailItineraryDay`, and
|
|
24
|
+
`renderDetailExtraSections` for consumer-specific catalog detail sections
|
|
25
|
+
such as brochure downloads, print actions, provenance cards, and richer
|
|
26
|
+
media or itinerary layouts.
|
|
27
|
+
|
|
28
|
+
`CatalogBookingPage` owns the quote-to-book form. Apps pass the route state plus
|
|
29
|
+
`fetchers`, typically from `createCatalogBookingFetchers({ baseUrl })`, and may
|
|
30
|
+
slot in their own contact picker via `renderContactPicker`.
|
|
31
|
+
|
|
32
|
+
## I18n
|
|
33
|
+
|
|
34
|
+
The package exports `CatalogUiMessagesProvider`, `catalogUiEn`, and
|
|
35
|
+
`catalogUiRo` from `@voyant-travel/catalog-react/i18n`. Components fall back to English
|
|
36
|
+
when no provider is mounted.
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { CatalogVerticalPageId } from "../catalog-surfaces.js";
|
|
2
|
+
import type { CatalogSearchHit, CatalogSearchParams } from "../index.js";
|
|
3
|
+
export interface CatalogVerticalHostProps {
|
|
4
|
+
vertical: CatalogVerticalPageId;
|
|
5
|
+
search: CatalogSearchParams;
|
|
6
|
+
onSearchChange: (updater: (prev: CatalogSearchParams) => CatalogSearchParams, replace?: boolean) => void;
|
|
7
|
+
/**
|
|
8
|
+
* Embedded under another surface's unified search bar (the Dynamic page).
|
|
9
|
+
* Hides this page's own search box, title and market/locale chrome so there
|
|
10
|
+
* is a single search experience; `search.q` is driven externally.
|
|
11
|
+
*/
|
|
12
|
+
embedded?: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Facet filters always applied to this surface, on top of the user's
|
|
15
|
+
* URL-driven filters and never erased by them (e.g. a Scheduled page pins
|
|
16
|
+
* `supplyModel: ["scheduled"]`). Kept out of URL state.
|
|
17
|
+
*/
|
|
18
|
+
lockedFacets?: Record<string, Array<string | number>>;
|
|
19
|
+
/**
|
|
20
|
+
* Range filters always applied to this surface (e.g. an Excursions page pins
|
|
21
|
+
* `durationDays: { lte: 1 }`). Like {@link CatalogVerticalHostProps.lockedFacets},
|
|
22
|
+
* kept out of URL.
|
|
23
|
+
*/
|
|
24
|
+
lockedRanges?: Record<string, {
|
|
25
|
+
gte?: number;
|
|
26
|
+
lte?: number;
|
|
27
|
+
}>;
|
|
28
|
+
/**
|
|
29
|
+
* Open a result's dedicated detail page (in a new tab) instead of the in-page
|
|
30
|
+
* detail sheet. Each surface passes its own opener so the right detail route
|
|
31
|
+
* is used (packages → its bespoke page; cruises/accommodations/excursions/
|
|
32
|
+
* tours → the generic vertical detail). When omitted, the sheet is used.
|
|
33
|
+
*/
|
|
34
|
+
onOpenDetail?: (hit: CatalogSearchHit) => void;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* The indexed catalog browse grid bound to its data wiring (markets, locales,
|
|
38
|
+
* suppliers, product tag mutations, slot availability) — the packaged admin
|
|
39
|
+
* host that turns the presentational `CatalogPage` into a working operator
|
|
40
|
+
* surface. API access comes from the shell's catalog provider context
|
|
41
|
+
* (`useVoyantCatalogContext`); cross-route links resolve through the semantic
|
|
42
|
+
* destination keys declared in `./index.tsx` (packaged-admin RFC §4.7).
|
|
43
|
+
*/
|
|
44
|
+
export declare function CatalogVerticalHost({ vertical, search, onSearchChange, embedded, lockedFacets, lockedRanges, onOpenDetail, }: CatalogVerticalHostProps): import("react/jsx-runtime").JSX.Element;
|
|
45
|
+
//# sourceMappingURL=catalog-vertical-host.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"catalog-vertical-host.d.ts","sourceRoot":"","sources":["../../src/admin/catalog-vertical-host.tsx"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAA;AAGnE,OAAO,KAAK,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AAgBxE,MAAM,WAAW,wBAAwB;IACvC,QAAQ,EAAE,qBAAqB,CAAA;IAC/B,MAAM,EAAE,mBAAmB,CAAA;IAC3B,cAAc,EAAE,CACd,OAAO,EAAE,CAAC,IAAI,EAAE,mBAAmB,KAAK,mBAAmB,EAC3D,OAAO,CAAC,EAAE,OAAO,KACd,IAAI,CAAA;IACT;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB;;;;OAIG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC,CAAA;IACrD;;;;OAIG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE;QAAE,GAAG,CAAC,EAAE,MAAM,CAAC;QAAC,GAAG,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;IAC7D;;;;;OAKG;IACH,YAAY,CAAC,EAAE,CAAC,GAAG,EAAE,gBAAgB,KAAK,IAAI,CAAA;CAC/C;AAED;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CAAC,EAClC,QAAQ,EACR,MAAM,EACN,cAAc,EACd,QAAgB,EAChB,YAAY,EACZ,YAAY,EACZ,YAAY,GACb,EAAE,wBAAwB,2CAuP1B"}
|
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
import { useAdminHref, useAdminNavigate, useOperatorAdminMessages } from "@voyant-travel/admin";
|
|
4
|
+
import { useMarketLocales, useMarkets } from "@voyant-travel/commerce-react/markets";
|
|
5
|
+
import { useSuppliers } from "@voyant-travel/distribution-react/suppliers";
|
|
6
|
+
import { useProductMutation } from "@voyant-travel/inventory-react";
|
|
7
|
+
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue, } from "@voyant-travel/ui/components/select";
|
|
8
|
+
import { useMemo } from "react";
|
|
9
|
+
import { toast } from "sonner";
|
|
10
|
+
import { CatalogPage as CatalogUiPage } from "../components/catalog-page.js";
|
|
11
|
+
import { useCatalogUiMessagesOrDefault } from "../i18n/index.js";
|
|
12
|
+
import { createCatalogEnrichmentFetchers, fetchCatalogSlots, useVoyantCatalogContext, } from "../index.js";
|
|
13
|
+
const DEFAULT_MARKET_VALUE = "__default__";
|
|
14
|
+
const DEFAULT_CATALOG_LOCALE = "en-GB";
|
|
15
|
+
/**
|
|
16
|
+
* The indexed catalog browse grid bound to its data wiring (markets, locales,
|
|
17
|
+
* suppliers, product tag mutations, slot availability) — the packaged admin
|
|
18
|
+
* host that turns the presentational `CatalogPage` into a working operator
|
|
19
|
+
* surface. API access comes from the shell's catalog provider context
|
|
20
|
+
* (`useVoyantCatalogContext`); cross-route links resolve through the semantic
|
|
21
|
+
* destination keys declared in `./index.tsx` (packaged-admin RFC §4.7).
|
|
22
|
+
*/
|
|
23
|
+
export function CatalogVerticalHost({ vertical, search, onSearchChange, embedded = false, lockedFacets, lockedRanges, onOpenDetail, }) {
|
|
24
|
+
const resolveHref = useAdminHref();
|
|
25
|
+
const navigateTo = useAdminNavigate();
|
|
26
|
+
const { baseUrl, fetcher } = useVoyantCatalogContext();
|
|
27
|
+
const browserMessages = useOperatorAdminMessages().products.operations.catalogBrowser;
|
|
28
|
+
const catalogMessages = useCatalogUiMessagesOrDefault().catalogPage;
|
|
29
|
+
const suppliersQuery = useSuppliers({ limit: 100 });
|
|
30
|
+
const marketsQuery = useMarkets({ status: "active", limit: 100 });
|
|
31
|
+
const selectedMarketId = search.market;
|
|
32
|
+
const selectedMarket = (marketsQuery.data?.data ?? []).find((market) => market.id === selectedMarketId);
|
|
33
|
+
const localesQuery = useMarketLocales({
|
|
34
|
+
marketId: selectedMarketId,
|
|
35
|
+
active: true,
|
|
36
|
+
limit: 100,
|
|
37
|
+
enabled: Boolean(selectedMarketId),
|
|
38
|
+
});
|
|
39
|
+
const localeOptions = useMemo(() => {
|
|
40
|
+
const tags = new Set();
|
|
41
|
+
if (selectedMarket) {
|
|
42
|
+
tags.add(selectedMarket.defaultLanguageTag);
|
|
43
|
+
for (const locale of localesQuery.data?.data ?? [])
|
|
44
|
+
tags.add(locale.languageTag);
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
tags.add(DEFAULT_CATALOG_LOCALE);
|
|
48
|
+
}
|
|
49
|
+
return Array.from(tags).sort((left, right) => left.localeCompare(right));
|
|
50
|
+
}, [localesQuery.data, selectedMarket]);
|
|
51
|
+
const fallbackLocale = selectedMarket?.defaultLanguageTag ?? DEFAULT_CATALOG_LOCALE;
|
|
52
|
+
const selectedLocale = search.locale && localeOptions.includes(search.locale) ? search.locale : fallbackLocale;
|
|
53
|
+
const supplierMap = useMemo(() => {
|
|
54
|
+
const m = new Map();
|
|
55
|
+
for (const s of suppliersQuery.data?.data ?? [])
|
|
56
|
+
m.set(s.id, s.name);
|
|
57
|
+
return m;
|
|
58
|
+
}, [suppliersQuery.data]);
|
|
59
|
+
const formatSupplier = (id) => supplierMap.get(String(id)) ?? String(id);
|
|
60
|
+
const productMutation = useProductMutation();
|
|
61
|
+
const enrichmentFetchers = useMemo(() => createCatalogEnrichmentFetchers({
|
|
62
|
+
baseUrl,
|
|
63
|
+
// Route the detail-sheet content fetch to each vertical's content
|
|
64
|
+
// mount (the host API's createProductContentRoutes mounts). Verticals
|
|
65
|
+
// omitted here have no content route mounted, so their sheet renders
|
|
66
|
+
// the projection only.
|
|
67
|
+
contentBasePathByVertical: {
|
|
68
|
+
products: "/v1/admin/products",
|
|
69
|
+
cruises: "/v1/admin/cruises",
|
|
70
|
+
accommodations: "/v1/admin/accommodations",
|
|
71
|
+
},
|
|
72
|
+
formatSupplier: (id) => supplierMap.get(String(id)) ?? String(id),
|
|
73
|
+
locale: selectedLocale,
|
|
74
|
+
market: selectedMarketId,
|
|
75
|
+
loadSlotAvailability: (productId) => loadProductSlotAvailability(baseUrl, fetcher, productId),
|
|
76
|
+
}), [baseUrl, fetcher, supplierMap, selectedLocale, selectedMarketId]);
|
|
77
|
+
// Merge the always-on locked facets/ranges with the user's URL-driven filters.
|
|
78
|
+
// Memoized so locked surfaces hand a STABLE `filters` object to the tab panel:
|
|
79
|
+
// a fresh object every render reads as "selections changed" and resets back to
|
|
80
|
+
// page 1, breaking pagination. Key on the locked values' content (callers pass
|
|
81
|
+
// inline literals), not their identity. `search` is already stable (router).
|
|
82
|
+
const lockedFacetsKey = JSON.stringify(lockedFacets ?? null);
|
|
83
|
+
const lockedRangesKey = JSON.stringify(lockedRanges ?? null);
|
|
84
|
+
// biome-ignore lint/correctness/useExhaustiveDependencies: keyed on serialized locked filters, not their object identity -- owner: catalog-react; existing suppression is intentional pending typed cleanup.
|
|
85
|
+
const effectiveSearch = useMemo(() => lockedFacets || lockedRanges
|
|
86
|
+
? {
|
|
87
|
+
...search,
|
|
88
|
+
locale: selectedLocale,
|
|
89
|
+
filters: {
|
|
90
|
+
...search.filters,
|
|
91
|
+
facets: { ...(search.filters?.facets ?? {}), ...(lockedFacets ?? {}) },
|
|
92
|
+
ranges: { ...(search.filters?.ranges ?? {}), ...(lockedRanges ?? {}) },
|
|
93
|
+
},
|
|
94
|
+
}
|
|
95
|
+
: { ...search, locale: selectedLocale }, [search, selectedLocale, lockedFacetsKey, lockedRangesKey]);
|
|
96
|
+
return (_jsx(CatalogUiPage, { vertical: vertical, search: effectiveSearch, formatSupplier: formatSupplier, hideSearchInput: embedded, className: embedded ? "px-0 py-0 lg:px-0" : undefined, title:
|
|
97
|
+
// `false` (not `undefined`) so catalog-ui's `title ?? default` does NOT
|
|
98
|
+
// fall back to its generic "Catalog" header — the embedding surface
|
|
99
|
+
// (Dynamic/Scheduled page) renders its own header on top instead.
|
|
100
|
+
embedded ? (false) : (_jsx("div", { children: _jsx("h1", { className: "font-semibold text-2xl", children: catalogMessages.tabs[vertical] }) })), toolbarEnd: embedded ? undefined : (_jsx(CatalogScopeControls, { messages: browserMessages, markets: marketsQuery.data?.data ?? [], localeOptions: localeOptions, market: selectedMarketId, locale: selectedLocale, onMarketChange: (marketId) => {
|
|
101
|
+
const nextMarket = (marketsQuery.data?.data ?? []).find((market) => market.id === marketId);
|
|
102
|
+
onSearchChange((prev) => ({
|
|
103
|
+
...prev,
|
|
104
|
+
market: marketId,
|
|
105
|
+
locale: nextMarket?.defaultLanguageTag,
|
|
106
|
+
page: 1,
|
|
107
|
+
}), true);
|
|
108
|
+
}, onDefaultMarket: () => {
|
|
109
|
+
onSearchChange((prev) => ({
|
|
110
|
+
...prev,
|
|
111
|
+
market: undefined,
|
|
112
|
+
locale: undefined,
|
|
113
|
+
page: 1,
|
|
114
|
+
}), true);
|
|
115
|
+
}, onLocaleChange: (locale) => {
|
|
116
|
+
onSearchChange((prev) => ({ ...prev, locale, page: 1 }), true);
|
|
117
|
+
} })), onQueryChange: (q) => onSearchChange((prev) => ({
|
|
118
|
+
...prev,
|
|
119
|
+
q: q.length > 0 ? q : undefined,
|
|
120
|
+
page: 1,
|
|
121
|
+
}), true), onPageChange: (p) => onSearchChange((prev) => ({ ...prev, page: p }), true), onViewChange: (view) => onSearchChange((prev) => ({ ...prev, view }), true), onSortChange: (sort) => onSearchChange((prev) => ({ ...prev, sort }), true), onFiltersChange: (next) => {
|
|
122
|
+
// Prune empty selections so the URL stays clean; reset to page 1.
|
|
123
|
+
const facets = {};
|
|
124
|
+
for (const [field, values] of Object.entries(next.facets ?? {})) {
|
|
125
|
+
if (values.length > 0)
|
|
126
|
+
facets[field] = values;
|
|
127
|
+
}
|
|
128
|
+
const ranges = {};
|
|
129
|
+
for (const [field, range] of Object.entries(next.ranges ?? {})) {
|
|
130
|
+
if (range && (range.gte != null || range.lte != null))
|
|
131
|
+
ranges[field] = range;
|
|
132
|
+
}
|
|
133
|
+
const hasAny = Object.keys(facets).length > 0 || Object.keys(ranges).length > 0;
|
|
134
|
+
onSearchChange((prev) => ({
|
|
135
|
+
...prev,
|
|
136
|
+
filters: hasAny ? { facets, ranges } : undefined,
|
|
137
|
+
page: 1,
|
|
138
|
+
}), true);
|
|
139
|
+
}, onBookHit: (hit, entityModule) => goToBookingPage(hit, entityModule, navigateTo, browserMessages), onBookDeparture: (hit, entityModule, departure) => goToBookingPage(hit, entityModule, navigateTo, browserMessages, departure), onBookOption: (hit, entityModule, departure, option) => goToBookingPage(hit, entityModule, navigateTo, browserMessages, departure, option), onOpenProductEditor: (hit) => navigateTo("product.detail", { productId: hit.id }),
|
|
140
|
+
// When the surface provides a detail-page opener, results open it (new
|
|
141
|
+
// tab) instead of the in-page sheet. Surface-specific so each vertical
|
|
142
|
+
// routes to the right detail page.
|
|
143
|
+
onOpenProductDetail: onOpenDetail ? (hit) => onOpenDetail(hit) : undefined, enrichmentFetchers: enrichmentFetchers, renderSupplierLink: (supplierId, displayName) => (_jsx("a", { href: resolveHref("supplier.detail", { supplierId }), onClick: (event) => {
|
|
144
|
+
// Keep modified/middle clicks native (new tab etc.); plain clicks
|
|
145
|
+
// navigate through the host router so the workspace doesn't reload.
|
|
146
|
+
if (event.defaultPrevented ||
|
|
147
|
+
event.button !== 0 ||
|
|
148
|
+
event.metaKey ||
|
|
149
|
+
event.ctrlKey ||
|
|
150
|
+
event.shiftKey ||
|
|
151
|
+
event.altKey) {
|
|
152
|
+
return;
|
|
153
|
+
}
|
|
154
|
+
event.preventDefault();
|
|
155
|
+
navigateTo("supplier.detail", { supplierId });
|
|
156
|
+
}, className: "font-medium text-primary hover:underline", children: displayName })), onTagsChange: async (hit, nextTags) => {
|
|
157
|
+
// Owned products only — sourced rows are read-only mirrors of
|
|
158
|
+
// the upstream so we can't write tags through to them.
|
|
159
|
+
const sourceKind = stringField(hit, "source.kind", null);
|
|
160
|
+
if (sourceKind && sourceKind !== "owned") {
|
|
161
|
+
toast.info(browserMessages.tagsReadOnly);
|
|
162
|
+
throw new Error("read-only source kind");
|
|
163
|
+
}
|
|
164
|
+
try {
|
|
165
|
+
await productMutation.update.mutateAsync({
|
|
166
|
+
id: hit.id,
|
|
167
|
+
input: { tags: nextTags },
|
|
168
|
+
});
|
|
169
|
+
// Intentionally don't invalidate the catalog search query —
|
|
170
|
+
// Typesense reindex is async, so a refetch right after the
|
|
171
|
+
// PATCH would return the pre-mutation tags and clobber the
|
|
172
|
+
// local optimistic state. The editor keeps its own working
|
|
173
|
+
// set keyed on hit.id; the next time the user opens this
|
|
174
|
+
// product the index has caught up.
|
|
175
|
+
}
|
|
176
|
+
catch (err) {
|
|
177
|
+
toast.error(err instanceof Error ? err.message : browserMessages.tagsUpdateFailed);
|
|
178
|
+
throw err;
|
|
179
|
+
}
|
|
180
|
+
} }));
|
|
181
|
+
}
|
|
182
|
+
function CatalogScopeControls({ messages, markets, localeOptions, market, locale, onMarketChange, onDefaultMarket, onLocaleChange, }) {
|
|
183
|
+
return (_jsxs(_Fragment, { children: [_jsxs(Select, { value: market ?? DEFAULT_MARKET_VALUE, onValueChange: (value) => {
|
|
184
|
+
if (!value)
|
|
185
|
+
return;
|
|
186
|
+
value === DEFAULT_MARKET_VALUE ? onDefaultMarket() : onMarketChange(value);
|
|
187
|
+
}, children: [_jsx(SelectTrigger, { className: "w-[220px]", children: _jsx(SelectValue, {}) }), _jsxs(SelectContent, { children: [_jsx(SelectItem, { value: DEFAULT_MARKET_VALUE, children: messages.defaultMarket }), markets.map((item) => (_jsxs(SelectItem, { value: item.id, children: [item.name, " \u00B7 ", item.code] }, item.id)))] })] }), _jsxs(Select, { value: locale, onValueChange: (value) => value && onLocaleChange(value), children: [_jsx(SelectTrigger, { className: "w-[150px]", children: _jsx(SelectValue, {}) }), _jsx(SelectContent, { children: localeOptions.map((item) => (_jsx(SelectItem, { value: item, children: item }, item))) })] })] }));
|
|
188
|
+
}
|
|
189
|
+
function goToBookingPage(hit, entityModule, navigateTo, messages, departure, option) {
|
|
190
|
+
const sourceKind = stringField(hit, "source.kind", null) ?? "owned";
|
|
191
|
+
if (!sourceKind) {
|
|
192
|
+
toast.info(messages.cannotBookYet, {
|
|
193
|
+
description: messages.missingSourceInfo,
|
|
194
|
+
});
|
|
195
|
+
return;
|
|
196
|
+
}
|
|
197
|
+
const sourceRef = stringField(hit, "source.ref", null) ?? undefined;
|
|
198
|
+
const sourceConnectionId = stringField(hit, "source.connectionId", null) ?? undefined;
|
|
199
|
+
const isSourced = sourceKind !== "owned";
|
|
200
|
+
const entityName = stringField(hit, "name", null) ?? undefined;
|
|
201
|
+
const entityImageUrl = stringField(hit, "thumbnailUrl", null) ?? stringField(hit, "heroImageUrl", null) ?? undefined;
|
|
202
|
+
navigateTo("bookingJourney.start", {
|
|
203
|
+
entityModule,
|
|
204
|
+
entityId: hit.id,
|
|
205
|
+
sourceKind,
|
|
206
|
+
...(sourceConnectionId ? { sourceConnectionId } : {}),
|
|
207
|
+
...(sourceRef ? { sourceRef } : {}),
|
|
208
|
+
...(departure
|
|
209
|
+
? isSourced
|
|
210
|
+
? { departureDate: departure.startsAt.slice(0, 10) }
|
|
211
|
+
: { departureId: departure.id }
|
|
212
|
+
: {}),
|
|
213
|
+
...(option ? { optionId: option.id } : {}),
|
|
214
|
+
...(entityName ? { entityName } : {}),
|
|
215
|
+
...(entityImageUrl ? { entityImageUrl } : {}),
|
|
216
|
+
});
|
|
217
|
+
}
|
|
218
|
+
async function loadProductSlotAvailability(baseUrl, fetcher, productId) {
|
|
219
|
+
try {
|
|
220
|
+
const response = await fetchCatalogSlots({ baseUrl, fetcher }, { entityModule: "products", entityId: productId });
|
|
221
|
+
return new Map(response.rows.map((slot) => [slot.id, slot]));
|
|
222
|
+
}
|
|
223
|
+
catch {
|
|
224
|
+
return new Map();
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
function stringField(hit, key, fallback) {
|
|
228
|
+
const v = hit.document.fields[key];
|
|
229
|
+
return typeof v === "string" && v.length > 0 ? v : fallback;
|
|
230
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface CruiseDetailHostProps {
|
|
2
|
+
id: string;
|
|
3
|
+
locale?: string;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Packaged admin host for `CruiseDetailPage` — injects the localized
|
|
7
|
+
* "Cruises" label, semantic-destination navigation to the booking journey
|
|
8
|
+
* (packaged-admin RFC §4.7), and breadcrumbs.
|
|
9
|
+
*/
|
|
10
|
+
export declare function CruiseDetailHost({ id, locale }: CruiseDetailHostProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
//# sourceMappingURL=cruise-detail-host.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cruise-detail-host.d.ts","sourceRoot":"","sources":["../../src/admin/cruise-detail-host.tsx"],"names":[],"mappings":"AAYA,MAAM,WAAW,qBAAqB;IACpC,EAAE,EAAE,MAAM,CAAA;IACV,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,qBAAqB,2CAiCrE"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { useAdminBreadcrumbs, useAdminHref, useAdminNavigate, useOperatorAdminMessages, } from "@voyant-travel/admin";
|
|
4
|
+
import { useState } from "react";
|
|
5
|
+
import { CruiseDetailPage } from "../components/cruise-detail-page.js";
|
|
6
|
+
/**
|
|
7
|
+
* Packaged admin host for `CruiseDetailPage` — injects the localized
|
|
8
|
+
* "Cruises" label, semantic-destination navigation to the booking journey
|
|
9
|
+
* (packaged-admin RFC §4.7), and breadcrumbs.
|
|
10
|
+
*/
|
|
11
|
+
export function CruiseDetailHost({ id, locale }) {
|
|
12
|
+
const resolveHref = useAdminHref();
|
|
13
|
+
const navigateTo = useAdminNavigate();
|
|
14
|
+
const cruisesLabel = useOperatorAdminMessages().nav.catalogCruises;
|
|
15
|
+
const cruisesHref = resolveHref("catalog.browse", { surface: "cruises" });
|
|
16
|
+
const [crumbs, setCrumbs] = useState([
|
|
17
|
+
{ label: cruisesLabel, href: cruisesHref },
|
|
18
|
+
]);
|
|
19
|
+
useAdminBreadcrumbs(crumbs);
|
|
20
|
+
return (_jsx(CruiseDetailPage, { id: id, locale: locale, cruisesLabel: cruisesLabel, cruisesHref: cruisesHref, onBreadcrumbs: setCrumbs,
|
|
21
|
+
// Connect-sourced cruise → the unified journey. The sailing's date locks
|
|
22
|
+
// the departure step; cabin is the option; name/hero preview the panel.
|
|
23
|
+
onBook: (cruiseId, opts) => navigateTo("bookingJourney.start", {
|
|
24
|
+
entityModule: "cruises",
|
|
25
|
+
entityId: cruiseId,
|
|
26
|
+
sourceKind: "voyant-connect",
|
|
27
|
+
...(opts.departureId ? { departureId: opts.departureId } : {}),
|
|
28
|
+
...(opts.departureDate ? { departureDate: opts.departureDate.slice(0, 10) } : {}),
|
|
29
|
+
...(opts.optionId ? { optionId: opts.optionId } : {}),
|
|
30
|
+
...(opts.name ? { entityName: opts.name } : {}),
|
|
31
|
+
...(opts.heroImageUrl ? { entityImageUrl: opts.heroImageUrl } : {}),
|
|
32
|
+
}) }));
|
|
33
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { CatalogSearchParams } from "../index.js";
|
|
2
|
+
export interface DynamicCatalogHostProps {
|
|
3
|
+
search: CatalogSearchParams;
|
|
4
|
+
onSearchChange: (updater: (prev: CatalogSearchParams) => CatalogSearchParams, replace?: boolean) => void;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Packaged admin host for `DynamicCatalogPage` — supplies the localized
|
|
8
|
+
* header, the `catalog.detail` destination href (opened in a new tab), and
|
|
9
|
+
* renders `CatalogVerticalHost` (markets/suppliers/products wiring) as the
|
|
10
|
+
* no-search browse grid.
|
|
11
|
+
*/
|
|
12
|
+
export declare function DynamicCatalogHost({ search, onSearchChange }: DynamicCatalogHostProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
//# sourceMappingURL=dynamic-catalog-host.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dynamic-catalog-host.d.ts","sourceRoot":"","sources":["../../src/admin/dynamic-catalog-host.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AAItD,MAAM,WAAW,uBAAuB;IACtC,MAAM,EAAE,mBAAmB,CAAA;IAC3B,cAAc,EAAE,CACd,OAAO,EAAE,CAAC,IAAI,EAAE,mBAAmB,KAAK,mBAAmB,EAC3D,OAAO,CAAC,EAAE,OAAO,KACd,IAAI,CAAA;CACV;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,EAAE,MAAM,EAAE,cAAc,EAAE,EAAE,uBAAuB,2CA2BrF"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { useAdminHref, useOperatorAdminMessages } from "@voyant-travel/admin";
|
|
4
|
+
import { DynamicCatalogPage as DynamicCatalogPageUi } from "../components/dynamic-catalog-page.js";
|
|
5
|
+
import { CatalogVerticalHost } from "./catalog-vertical-host.js";
|
|
6
|
+
import { openHrefInNewTab } from "./open-in-new-tab.js";
|
|
7
|
+
/**
|
|
8
|
+
* Packaged admin host for `DynamicCatalogPage` — supplies the localized
|
|
9
|
+
* header, the `catalog.detail` destination href (opened in a new tab), and
|
|
10
|
+
* renders `CatalogVerticalHost` (markets/suppliers/products wiring) as the
|
|
11
|
+
* no-search browse grid.
|
|
12
|
+
*/
|
|
13
|
+
export function DynamicCatalogHost({ search, onSearchChange }) {
|
|
14
|
+
const resolveHref = useAdminHref();
|
|
15
|
+
const nav = useOperatorAdminMessages().nav;
|
|
16
|
+
return (_jsx(DynamicCatalogPageUi, { search: search, onSearchChange: onSearchChange, productsLabel: nav.catalogProducts, productsTagline: nav.catalogProductsTagline, buildDetailHref: (productId, { adults, nights }) => resolveHref("catalog.detail", { surface: "products", id: productId, adults, nights }), renderBrowseGrid: ({ lockedFacets }) => (_jsx(CatalogVerticalHost, { vertical: "products", search: search, onSearchChange: onSearchChange, embedded: true, lockedFacets: lockedFacets, onOpenDetail: (hit) => openHrefInNewTab(resolveHref("catalog.detail", { surface: "products", id: hit.id })) })) }));
|
|
17
|
+
}
|