@voyant-travel/bookings-react 0.155.0 → 0.155.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/dist/hooks/use-public-booking-session-flow-mutation.d.ts +1 -1
- package/dist/hooks/use-public-booking-session.d.ts +1 -1
- package/dist/query-options.d.ts +4 -4
- package/package.json +29 -29
- package/dist/extras/components/extra-catalog-card.d.ts +0 -13
- package/dist/extras/components/extra-catalog-card.d.ts.map +0 -1
- package/dist/extras/components/extra-catalog-card.js +0 -52
- package/dist/extras/ui.d.ts +0 -4
- package/dist/extras/ui.d.ts.map +0 -1
- package/dist/extras/ui.js +0 -3
|
@@ -105,7 +105,7 @@ export declare function usePublicBookingSessionFlowMutation(sessionId: string):
|
|
|
105
105
|
availabilitySlotId: string | null;
|
|
106
106
|
quantity: number;
|
|
107
107
|
allocationType: "resource" | "unit" | "pickup";
|
|
108
|
-
status: "cancelled" | "fulfilled" | "confirmed" | "expired" | "
|
|
108
|
+
status: "cancelled" | "fulfilled" | "confirmed" | "expired" | "held" | "released";
|
|
109
109
|
holdExpiresAt: string | null;
|
|
110
110
|
confirmedAt: string | null;
|
|
111
111
|
releasedAt: string | null;
|
|
@@ -69,7 +69,7 @@ export declare function usePublicBookingSession(sessionId: string | null | undef
|
|
|
69
69
|
availabilitySlotId: string | null;
|
|
70
70
|
quantity: number;
|
|
71
71
|
allocationType: "resource" | "unit" | "pickup";
|
|
72
|
-
status: "cancelled" | "fulfilled" | "confirmed" | "expired" | "
|
|
72
|
+
status: "cancelled" | "fulfilled" | "confirmed" | "expired" | "held" | "released";
|
|
73
73
|
holdExpiresAt: string | null;
|
|
74
74
|
confirmedAt: string | null;
|
|
75
75
|
releasedAt: string | null;
|
package/dist/query-options.d.ts
CHANGED
|
@@ -1739,7 +1739,7 @@ export declare function getPublicBookingSessionQueryOptions(client: FetchWithVal
|
|
|
1739
1739
|
availabilitySlotId: string | null;
|
|
1740
1740
|
quantity: number;
|
|
1741
1741
|
allocationType: "resource" | "unit" | "pickup";
|
|
1742
|
-
status: "cancelled" | "fulfilled" | "confirmed" | "expired" | "
|
|
1742
|
+
status: "cancelled" | "fulfilled" | "confirmed" | "expired" | "held" | "released";
|
|
1743
1743
|
holdExpiresAt: string | null;
|
|
1744
1744
|
confirmedAt: string | null;
|
|
1745
1745
|
releasedAt: string | null;
|
|
@@ -1835,7 +1835,7 @@ export declare function getPublicBookingSessionQueryOptions(client: FetchWithVal
|
|
|
1835
1835
|
availabilitySlotId: string | null;
|
|
1836
1836
|
quantity: number;
|
|
1837
1837
|
allocationType: "resource" | "unit" | "pickup";
|
|
1838
|
-
status: "cancelled" | "fulfilled" | "confirmed" | "expired" | "
|
|
1838
|
+
status: "cancelled" | "fulfilled" | "confirmed" | "expired" | "held" | "released";
|
|
1839
1839
|
holdExpiresAt: string | null;
|
|
1840
1840
|
confirmedAt: string | null;
|
|
1841
1841
|
releasedAt: string | null;
|
|
@@ -1932,7 +1932,7 @@ export declare function getPublicBookingSessionQueryOptions(client: FetchWithVal
|
|
|
1932
1932
|
availabilitySlotId: string | null;
|
|
1933
1933
|
quantity: number;
|
|
1934
1934
|
allocationType: "resource" | "unit" | "pickup";
|
|
1935
|
-
status: "cancelled" | "fulfilled" | "confirmed" | "expired" | "
|
|
1935
|
+
status: "cancelled" | "fulfilled" | "confirmed" | "expired" | "held" | "released";
|
|
1936
1936
|
holdExpiresAt: string | null;
|
|
1937
1937
|
confirmedAt: string | null;
|
|
1938
1938
|
releasedAt: string | null;
|
|
@@ -2031,7 +2031,7 @@ export declare function getPublicBookingSessionQueryOptions(client: FetchWithVal
|
|
|
2031
2031
|
availabilitySlotId: string | null;
|
|
2032
2032
|
quantity: number;
|
|
2033
2033
|
allocationType: "resource" | "unit" | "pickup";
|
|
2034
|
-
status: "cancelled" | "fulfilled" | "confirmed" | "expired" | "
|
|
2034
|
+
status: "cancelled" | "fulfilled" | "confirmed" | "expired" | "held" | "released";
|
|
2035
2035
|
holdExpiresAt: string | null;
|
|
2036
2036
|
confirmedAt: string | null;
|
|
2037
2037
|
releasedAt: string | null;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@voyant-travel/bookings-react",
|
|
3
|
-
"version": "0.155.
|
|
3
|
+
"version": "0.155.2",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -150,22 +150,22 @@
|
|
|
150
150
|
"react-dom": "^19.0.0",
|
|
151
151
|
"react-hook-form": "^7.80.0",
|
|
152
152
|
"zod": "^4.0.0",
|
|
153
|
-
"@voyant-travel/accommodations": "^0.115.
|
|
154
|
-
"@voyant-travel/admin": "^0.123.
|
|
155
|
-
"@voyant-travel/bookings": "^0.155.
|
|
156
|
-
"@voyant-travel/catalog": "^0.153.
|
|
157
|
-
"@voyant-travel/catalog-react": "^0.153.
|
|
158
|
-
"@voyant-travel/distribution-react": "^0.145.
|
|
153
|
+
"@voyant-travel/accommodations": "^0.115.1",
|
|
154
|
+
"@voyant-travel/admin": "^0.123.1",
|
|
155
|
+
"@voyant-travel/bookings": "^0.155.2",
|
|
156
|
+
"@voyant-travel/catalog": "^0.153.2",
|
|
157
|
+
"@voyant-travel/catalog-react": "^0.153.2",
|
|
158
|
+
"@voyant-travel/distribution-react": "^0.145.1",
|
|
159
159
|
"@voyant-travel/relationships-react": "^0.155.0",
|
|
160
|
-
"@voyant-travel/finance": "^0.155.
|
|
161
|
-
"@voyant-travel/finance-react": "^0.155.
|
|
162
|
-
"@voyant-travel/identity-react": "^0.155.
|
|
163
|
-
"@voyant-travel/legal-react": "^0.155.
|
|
160
|
+
"@voyant-travel/finance": "^0.155.2",
|
|
161
|
+
"@voyant-travel/finance-react": "^0.155.2",
|
|
162
|
+
"@voyant-travel/identity-react": "^0.155.1",
|
|
163
|
+
"@voyant-travel/legal-react": "^0.155.1",
|
|
164
164
|
"@voyant-travel/commerce-react": "^0.37.0",
|
|
165
|
-
"@voyant-travel/cruises": "^0.154.
|
|
165
|
+
"@voyant-travel/cruises": "^0.154.2",
|
|
166
166
|
"@voyant-travel/inventory-react": "^0.37.0",
|
|
167
|
-
"@voyant-travel/inventory": "^0.9.
|
|
168
|
-
"@voyant-travel/storefront-react": "^0.157.
|
|
167
|
+
"@voyant-travel/inventory": "^0.9.3",
|
|
168
|
+
"@voyant-travel/storefront-react": "^0.157.2",
|
|
169
169
|
"@voyant-travel/ui": "^0.109.0",
|
|
170
170
|
"@voyant-travel/operations-react": "^0.36.0"
|
|
171
171
|
},
|
|
@@ -233,10 +233,10 @@
|
|
|
233
233
|
},
|
|
234
234
|
"dependencies": {
|
|
235
235
|
"sonner": "^2.0.7",
|
|
236
|
-
"@voyant-travel/catalog-contracts": "^0.109.0",
|
|
237
236
|
"@voyant-travel/i18n": "^0.110.0",
|
|
238
237
|
"@voyant-travel/react": "^0.104.1",
|
|
239
|
-
"@voyant-travel/types": "^0.109.0"
|
|
238
|
+
"@voyant-travel/types": "^0.109.0",
|
|
239
|
+
"@voyant-travel/catalog-contracts": "^0.109.1"
|
|
240
240
|
},
|
|
241
241
|
"devDependencies": {
|
|
242
242
|
"@tanstack/react-query": "^5.101.2",
|
|
@@ -251,23 +251,23 @@
|
|
|
251
251
|
"typescript": "^6.0.3",
|
|
252
252
|
"vitest": "^4.1.9",
|
|
253
253
|
"zod": "^4.4.3",
|
|
254
|
-
"@voyant-travel/accommodations": "^0.115.
|
|
255
|
-
"@voyant-travel/admin": "^0.123.
|
|
256
|
-
"@voyant-travel/bookings": "^0.155.
|
|
257
|
-
"@voyant-travel/catalog": "^0.153.
|
|
258
|
-
"@voyant-travel/catalog-react": "^0.153.
|
|
259
|
-
"@voyant-travel/distribution-react": "^0.145.
|
|
254
|
+
"@voyant-travel/accommodations": "^0.115.1",
|
|
255
|
+
"@voyant-travel/admin": "^0.123.1",
|
|
256
|
+
"@voyant-travel/bookings": "^0.155.2",
|
|
257
|
+
"@voyant-travel/catalog": "^0.153.2",
|
|
258
|
+
"@voyant-travel/catalog-react": "^0.153.2",
|
|
259
|
+
"@voyant-travel/distribution-react": "^0.145.1",
|
|
260
260
|
"@voyant-travel/relationships-react": "^0.155.0",
|
|
261
|
-
"@voyant-travel/finance": "^0.155.
|
|
262
|
-
"@voyant-travel/finance-react": "^0.155.
|
|
263
|
-
"@voyant-travel/identity-react": "^0.155.
|
|
264
|
-
"@voyant-travel/legal-react": "^0.155.
|
|
261
|
+
"@voyant-travel/finance": "^0.155.2",
|
|
262
|
+
"@voyant-travel/finance-react": "^0.155.2",
|
|
263
|
+
"@voyant-travel/identity-react": "^0.155.1",
|
|
264
|
+
"@voyant-travel/legal-react": "^0.155.1",
|
|
265
265
|
"@voyant-travel/commerce-react": "^0.37.0",
|
|
266
|
-
"@voyant-travel/cruises": "^0.154.
|
|
266
|
+
"@voyant-travel/cruises": "^0.154.2",
|
|
267
267
|
"@voyant-travel/inventory-react": "^0.37.0",
|
|
268
|
-
"@voyant-travel/inventory": "^0.9.
|
|
268
|
+
"@voyant-travel/inventory": "^0.9.3",
|
|
269
269
|
"@voyant-travel/react": "^0.104.1",
|
|
270
|
-
"@voyant-travel/storefront-react": "^0.157.
|
|
270
|
+
"@voyant-travel/storefront-react": "^0.157.2",
|
|
271
271
|
"@voyant-travel/ui": "^0.109.0",
|
|
272
272
|
"@voyant-travel/voyant-typescript-config": "^0.1.0",
|
|
273
273
|
"@voyant-travel/operations-react": "^0.36.0"
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { CatalogSearchHit } from "@voyant-travel/catalog-react";
|
|
2
|
-
export interface ExtraCatalogCardProps {
|
|
3
|
-
hit: CatalogSearchHit;
|
|
4
|
-
onClick?: (hit: CatalogSearchHit) => void;
|
|
5
|
-
className?: string;
|
|
6
|
-
}
|
|
7
|
-
/**
|
|
8
|
-
* Search-result card for an extras hit (sub-line-item add-ons attached
|
|
9
|
-
* to bookings). Reads: `name`, `category`, `priceCents`, `currency`,
|
|
10
|
-
* `unit` (per_person | per_booking | per_night), `tags`.
|
|
11
|
-
*/
|
|
12
|
-
export declare function ExtraCatalogCard({ hit, onClick, className }: ExtraCatalogCardProps): import("react").JSX.Element;
|
|
13
|
-
//# sourceMappingURL=extra-catalog-card.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"extra-catalog-card.d.ts","sourceRoot":"","sources":["../../../src/extras/components/extra-catalog-card.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAA;AAMpE,MAAM,WAAW,qBAAqB;IACpC,GAAG,EAAE,gBAAgB,CAAA;IACrB,OAAO,CAAC,EAAE,CAAC,GAAG,EAAE,gBAAgB,KAAK,IAAI,CAAA;IACzC,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,EAAE,GAAG,EAAE,OAAO,EAAE,SAAS,EAAE,EAAE,qBAAqB,+BA8DlF"}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { Badge } from "@voyant-travel/ui/components/badge";
|
|
4
|
-
import { Card, CardContent } from "@voyant-travel/ui/components/card";
|
|
5
|
-
import { cn } from "@voyant-travel/ui/lib/utils";
|
|
6
|
-
import { useExtrasUiI18nOrDefault } from "../i18n/index.js";
|
|
7
|
-
/**
|
|
8
|
-
* Search-result card for an extras hit (sub-line-item add-ons attached
|
|
9
|
-
* to bookings). Reads: `name`, `category`, `priceCents`, `currency`,
|
|
10
|
-
* `unit` (per_person | per_booking | per_night), `tags`.
|
|
11
|
-
*/
|
|
12
|
-
export function ExtraCatalogCard({ hit, onClick, className }) {
|
|
13
|
-
const i18n = useExtrasUiI18nOrDefault();
|
|
14
|
-
const messages = i18n.messages.catalogCard;
|
|
15
|
-
const f = hit.document.fields;
|
|
16
|
-
const name = stringOr(f.name, messages.untitled);
|
|
17
|
-
const category = stringOr(f.category, null);
|
|
18
|
-
const unit = stringOr(f.unit, null);
|
|
19
|
-
const status = stringOr(f.status, null);
|
|
20
|
-
const tags = stringArray(f.tags);
|
|
21
|
-
const price = numberOr(f.priceCents, null);
|
|
22
|
-
const currency = stringOr(f.currency ?? f.sellCurrency, null);
|
|
23
|
-
const priceLabel = price != null && currency
|
|
24
|
-
? i18n.formatCurrency(price / 100, currency, {
|
|
25
|
-
maximumFractionDigits: 2,
|
|
26
|
-
})
|
|
27
|
-
: null;
|
|
28
|
-
return (_jsx(Card, { className: cn("h-full cursor-pointer transition-colors hover:border-primary/40", onClick == null && "cursor-default", className), onClick: onClick ? () => onClick(hit) : undefined, children: _jsxs(CardContent, { className: "flex h-full flex-col gap-2 p-4", children: [_jsxs("div", { className: "flex items-start justify-between gap-2", children: [_jsx("h3", { className: "line-clamp-2 font-medium text-sm", children: name }), status && (_jsx(Badge, { variant: status === "active" ? "default" : "secondary", className: "shrink-0", children: status }))] }), _jsxs("div", { className: "flex flex-wrap items-center gap-2 text-muted-foreground text-xs", children: [category && _jsx("span", { children: category }), priceLabel && (_jsxs("span", { className: "ml-auto font-medium text-foreground", children: [priceLabel, unit && (_jsx("span", { className: "ml-1 text-muted-foreground", children: formatTemplate(messages.unitPrefix, { unit: unit.replace(/_/g, " ") }) }))] }))] }), tags.length > 0 && (_jsx("div", { className: "mt-auto flex flex-wrap gap-1", children: tags.slice(0, 4).map((tag) => (_jsx(Badge, { variant: "outline", className: "text-[10px]", children: tag }, tag))) }))] }) }));
|
|
29
|
-
}
|
|
30
|
-
function formatTemplate(template, values) {
|
|
31
|
-
return template.replace(/\{(\w+)\}/g, (_, key) => {
|
|
32
|
-
const value = values[key];
|
|
33
|
-
return value === undefined ? "" : String(value);
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
function stringOr(value, fallback) {
|
|
37
|
-
return typeof value === "string" && value.length > 0 ? value : fallback;
|
|
38
|
-
}
|
|
39
|
-
function numberOr(value, fallback) {
|
|
40
|
-
if (typeof value === "number")
|
|
41
|
-
return value;
|
|
42
|
-
if (typeof value === "string") {
|
|
43
|
-
const n = Number(value);
|
|
44
|
-
return Number.isFinite(n) ? n : fallback;
|
|
45
|
-
}
|
|
46
|
-
return fallback;
|
|
47
|
-
}
|
|
48
|
-
function stringArray(value) {
|
|
49
|
-
if (!Array.isArray(value))
|
|
50
|
-
return [];
|
|
51
|
-
return value.filter((v) => typeof v === "string" && v.length > 0);
|
|
52
|
-
}
|
package/dist/extras/ui.d.ts
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
export { ProductCombobox } from "./components/product-combobox.js";
|
|
2
|
-
export { SlotExtrasManifestPanel } from "./components/slot-extras-manifest-panel.js";
|
|
3
|
-
export { type ExtrasUiMessageOverrides, type ExtrasUiMessages, ExtrasUiMessagesProvider, extrasUiEn, extrasUiMessageDefinitions, extrasUiRo, getExtrasUiI18n, resolveExtrasUiMessages, useExtrasUiI18n, useExtrasUiI18nOrDefault, useExtrasUiMessages, useExtrasUiMessagesOrDefault, } from "./i18n/index.js";
|
|
4
|
-
//# sourceMappingURL=ui.d.ts.map
|
package/dist/extras/ui.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ui.d.ts","sourceRoot":"","sources":["../../src/extras/ui.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAA;AAClE,OAAO,EAAE,uBAAuB,EAAE,MAAM,4CAA4C,CAAA;AACpF,OAAO,EACL,KAAK,wBAAwB,EAC7B,KAAK,gBAAgB,EACrB,wBAAwB,EACxB,UAAU,EACV,0BAA0B,EAC1B,UAAU,EACV,eAAe,EACf,uBAAuB,EACvB,eAAe,EACf,wBAAwB,EACxB,mBAAmB,EACnB,4BAA4B,GAC7B,MAAM,iBAAiB,CAAA"}
|
package/dist/extras/ui.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
export { ProductCombobox } from "./components/product-combobox.js";
|
|
2
|
-
export { SlotExtrasManifestPanel } from "./components/slot-extras-manifest-panel.js";
|
|
3
|
-
export { ExtrasUiMessagesProvider, extrasUiEn, extrasUiMessageDefinitions, extrasUiRo, getExtrasUiI18n, resolveExtrasUiMessages, useExtrasUiI18n, useExtrasUiI18nOrDefault, useExtrasUiMessages, useExtrasUiMessagesOrDefault, } from "./i18n/index.js";
|