@admin-layout/ai-chat-ext-browser 12.2.5-alpha.22 → 12.2.5-alpha.27
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/lib/components/MessageWidgets/MessageBooking.d.ts +17 -0
- package/lib/components/MessageWidgets/MessageBooking.d.ts.map +1 -0
- package/lib/components/MessageWidgets/MessageBooking.js +174 -0
- package/lib/components/MessageWidgets/MessageBooking.js.map +1 -0
- package/lib/components/MessageWidgets/MessageFlights.d.ts +7 -1
- package/lib/components/MessageWidgets/MessageFlights.d.ts.map +1 -1
- package/lib/components/MessageWidgets/MessageFlights.js +86 -13
- package/lib/components/MessageWidgets/MessageFlights.js.map +1 -1
- package/lib/components/MessageWidgets/MessageResults.d.ts +2 -0
- package/lib/components/MessageWidgets/MessageResults.d.ts.map +1 -1
- package/lib/components/MessageWidgets/MessageResults.js +20 -5
- package/lib/components/MessageWidgets/MessageResults.js.map +1 -1
- package/lib/components/MessageWidgets/ResultCards.d.ts +3 -1
- package/lib/components/MessageWidgets/ResultCards.d.ts.map +1 -1
- package/lib/components/MessageWidgets/ResultCards.js +3 -1
- package/lib/components/MessageWidgets/ResultCards.js.map +1 -1
- package/lib/components/MessageWidgets/ResultRow.d.ts +36 -2
- package/lib/components/MessageWidgets/ResultRow.d.ts.map +1 -1
- package/lib/components/MessageWidgets/ResultRow.js +63 -4
- package/lib/components/MessageWidgets/ResultRow.js.map +1 -1
- package/lib/components/MessageWidgets/index.d.ts +2 -1
- package/lib/components/MessageWidgets/index.d.ts.map +1 -1
- package/lib/index.d.ts +2 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -1
- package/lib/module.d.ts.map +1 -1
- package/lib/module.js +6 -1
- package/lib/module.js.map +1 -1
- package/lib/slot-fill/index.d.ts +1 -0
- package/lib/slot-fill/index.d.ts.map +1 -1
- package/lib/slot-fill/message-booking-fill.d.ts +7 -0
- package/lib/slot-fill/message-booking-fill.d.ts.map +1 -0
- package/lib/slot-fill/message-booking-fill.js +9 -0
- package/lib/slot-fill/message-booking-fill.js.map +1 -0
- package/package.json +3 -3
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { IPost } from 'common';
|
|
3
|
+
export interface IMessageBookingProps {
|
|
4
|
+
message: IPost;
|
|
5
|
+
index: number;
|
|
6
|
+
/** The host's card handler: the go-ahead reaches it as a `{ type: 'reply' }` action. */
|
|
7
|
+
onMessageClick?: (ref: IPost) => void;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* The booking summary the agent shows before it books or buys (inset 8px inside the bubble like every
|
|
11
|
+
* chat-pro card, which hosts' reply layouts count on): who and what, the itinerary or the
|
|
12
|
+
* items, the details, the charges and the total, and one button - the go-ahead ("Book it · $194"),
|
|
13
|
+
* or "Retry $194" after a declined payment. The go-ahead answers the agent word for word through
|
|
14
|
+
* the host (its `cardReplies`); money moves later, on the payment page, so it never says "pay".
|
|
15
|
+
*/
|
|
16
|
+
export declare const MessageBooking: ({ message, onMessageClick }: IMessageBookingProps) => React.JSX.Element;
|
|
17
|
+
//# sourceMappingURL=MessageBooking.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MessageBooking.d.ts","sourceRoot":"","sources":["../../../src/components/MessageWidgets/MessageBooking.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4B,MAAM,OAAO,CAAC;AAKjD,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAI/B,MAAM,WAAW,oBAAoB;IACjC,OAAO,EAAE,KAAK,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,wFAAwF;IACxF,cAAc,CAAC,EAAE,CAAC,GAAG,EAAE,KAAK,KAAK,IAAI,CAAC;CACzC;AA8CD;;;;;;GAMG;AACH,eAAO,MAAM,cAAc,GAAI,6BAA6B,oBAAoB,sBAqK/E,CAAC"}
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
import React,{useMemo,useState}from'react';import {FiAlertCircle}from'@react-icons/all-files/fi/FiAlertCircle.js';import {FiCheck}from'@react-icons/all-files/fi/FiCheck.js';import {FiLoader}from'@react-icons/all-files/fi/FiLoader.js';import {FiRotateCcw}from'@react-icons/all-files/fi/FiRotateCcw.js';import {toBookingView,isFallbackFavicon}from'@admin-layout/client';import {withWidgetAction}from'./ResultRow.js';const STATUS_TONES = {
|
|
2
|
+
declined: {
|
|
3
|
+
Icon: FiAlertCircle,
|
|
4
|
+
className: 'bg-rose-50 text-rose-700 dark:bg-rose-500/15 dark:text-rose-300'
|
|
5
|
+
},
|
|
6
|
+
confirmed: {
|
|
7
|
+
Icon: FiCheck,
|
|
8
|
+
className: 'bg-emerald-50 text-emerald-700 dark:bg-emerald-500/15 dark:text-emerald-300'
|
|
9
|
+
},
|
|
10
|
+
processing: {
|
|
11
|
+
Icon: FiLoader,
|
|
12
|
+
className: 'bg-gray-50 text-gray-600 dark:bg-gray-700/40 dark:text-gray-300'
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
const NEUTRAL_TONE = {
|
|
16
|
+
Icon: FiAlertCircle,
|
|
17
|
+
className: 'bg-gray-50 text-gray-600 dark:bg-gray-700/40 dark:text-gray-300'
|
|
18
|
+
};
|
|
19
|
+
/** The vendor's mark, else its monogram: a logo that fails, or a site icon that is only the service's globe. */
|
|
20
|
+
const VendorMark = ({
|
|
21
|
+
booking
|
|
22
|
+
}) => {
|
|
23
|
+
const [failed, setFailed] = useState(false);
|
|
24
|
+
if (booking.logo && !failed) {
|
|
25
|
+
return React.createElement("span", {
|
|
26
|
+
"aria-hidden": "true",
|
|
27
|
+
className: "flex h-9 w-9 shrink-0 items-center justify-center overflow-hidden rounded-lg bg-white ring-1 ring-inset ring-gray-100 dark:ring-gray-700"
|
|
28
|
+
}, React.createElement("img", {
|
|
29
|
+
src: booking.logo,
|
|
30
|
+
alt: "",
|
|
31
|
+
className: "h-8 w-8 object-contain",
|
|
32
|
+
onError: () => setFailed(true),
|
|
33
|
+
onLoad: e => isFallbackFavicon(e.currentTarget) && setFailed(true)
|
|
34
|
+
}));
|
|
35
|
+
}
|
|
36
|
+
return React.createElement("span", {
|
|
37
|
+
"aria-hidden": "true",
|
|
38
|
+
className: "flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-blue-50 text-[11px] font-bold tracking-wide text-blue-700 dark:bg-blue-500/15 dark:text-blue-300"
|
|
39
|
+
}, booking.monogram);
|
|
40
|
+
};
|
|
41
|
+
const ROW = 'border-t border-gray-100 px-4 py-3 dark:border-gray-700';
|
|
42
|
+
/**
|
|
43
|
+
* The booking summary the agent shows before it books or buys (inset 8px inside the bubble like every
|
|
44
|
+
* chat-pro card, which hosts' reply layouts count on): who and what, the itinerary or the
|
|
45
|
+
* items, the details, the charges and the total, and one button - the go-ahead ("Book it · $194"),
|
|
46
|
+
* or "Retry $194" after a declined payment. The go-ahead answers the agent word for word through
|
|
47
|
+
* the host (its `cardReplies`); money moves later, on the payment page, so it never says "pay".
|
|
48
|
+
*/
|
|
49
|
+
const MessageBooking = ({
|
|
50
|
+
message,
|
|
51
|
+
onMessageClick
|
|
52
|
+
}) => {
|
|
53
|
+
const attachment = message?.props?.attachment ?? message?.propsConfiguration?.contents?.attachment;
|
|
54
|
+
const booking = useMemo(() => toBookingView(attachment), [attachment]);
|
|
55
|
+
const [sent, setSent] = useState(false);
|
|
56
|
+
if (!booking) return null;
|
|
57
|
+
const replies = !!onMessageClick && message?.props?.cardReplies === true;
|
|
58
|
+
const {
|
|
59
|
+
trip,
|
|
60
|
+
action
|
|
61
|
+
} = booking;
|
|
62
|
+
const tone = STATUS_TONES[booking.status] ?? NEUTRAL_TONE;
|
|
63
|
+
const go = () => {
|
|
64
|
+
if (sent || !action) return;
|
|
65
|
+
onMessageClick?.(withWidgetAction(message, {
|
|
66
|
+
type: 'reply',
|
|
67
|
+
text: action.reply
|
|
68
|
+
}));
|
|
69
|
+
setSent(true);
|
|
70
|
+
};
|
|
71
|
+
return React.createElement("div", {
|
|
72
|
+
className: "mx-2 my-2 w-[calc(100%-1rem)] max-w-md overflow-hidden rounded-2xl border border-gray-200 bg-white text-left shadow-sm dark:border-gray-700 dark:bg-gray-800",
|
|
73
|
+
role: "group",
|
|
74
|
+
"aria-label": `${booking.vendor} booking${booking.total ? `, ${booking.total} total` : ''}`,
|
|
75
|
+
"data-booking-card": ""
|
|
76
|
+
}, booking.statusLabel && booking.status !== 'review' ? React.createElement("div", {
|
|
77
|
+
className: `flex items-center gap-2 px-4 py-2 text-xs font-semibold ${tone.className}`
|
|
78
|
+
}, React.createElement(tone.Icon, {
|
|
79
|
+
className: `h-3.5 w-3.5 ${booking.status === 'processing' ? 'animate-spin' : ''}`,
|
|
80
|
+
"aria-hidden": "true"
|
|
81
|
+
}), booking.statusLabel) : null, React.createElement("div", {
|
|
82
|
+
className: "px-4 pb-3 pt-3.5"
|
|
83
|
+
}, React.createElement("div", {
|
|
84
|
+
className: "flex items-start justify-between gap-3"
|
|
85
|
+
}, React.createElement("div", {
|
|
86
|
+
className: "flex min-w-0 items-center gap-2.5"
|
|
87
|
+
}, React.createElement(VendorMark, {
|
|
88
|
+
booking: booking
|
|
89
|
+
}), React.createElement("div", {
|
|
90
|
+
className: "min-w-0"
|
|
91
|
+
}, React.createElement("p", {
|
|
92
|
+
className: "truncate text-sm font-semibold text-gray-900 dark:text-gray-50"
|
|
93
|
+
}, booking.vendor), booking.title ? React.createElement("p", {
|
|
94
|
+
className: "truncate text-xs text-gray-500 dark:text-gray-400"
|
|
95
|
+
}, booking.title) : null)), booking.date || trip?.stops ? React.createElement("div", {
|
|
96
|
+
className: "shrink-0 text-right"
|
|
97
|
+
}, booking.date ? React.createElement("p", {
|
|
98
|
+
className: "text-[13px] text-gray-900 dark:text-gray-100"
|
|
99
|
+
}, booking.date) : null, trip?.stops ? React.createElement("p", {
|
|
100
|
+
className: "text-xs text-gray-500 dark:text-gray-400"
|
|
101
|
+
}, trip.stops) : null) : null), trip && (trip.from || trip.departs) ? React.createElement("p", {
|
|
102
|
+
className: "mt-2.5 flex flex-wrap items-baseline gap-x-1.5 text-sm tabular-nums"
|
|
103
|
+
}, trip.from ? React.createElement("span", {
|
|
104
|
+
className: "text-gray-500 dark:text-gray-400"
|
|
105
|
+
}, trip.from) : null, trip.departs ? React.createElement("span", {
|
|
106
|
+
className: "font-semibold text-gray-900 dark:text-gray-50"
|
|
107
|
+
}, trip.departs) : null, React.createElement("span", {
|
|
108
|
+
"aria-hidden": "true",
|
|
109
|
+
className: "text-gray-400"
|
|
110
|
+
}, "\u2192"), trip.arrives ? React.createElement("span", {
|
|
111
|
+
className: "font-semibold text-gray-900 dark:text-gray-50"
|
|
112
|
+
}, trip.arrives, trip.arrivesDayOffset ? React.createElement("sup", {
|
|
113
|
+
className: "ml-0.5 text-[10px] font-semibold text-amber-600 dark:text-amber-400"
|
|
114
|
+
}, trip.arrivesDayOffset) : null) : null, trip.to ? React.createElement("span", {
|
|
115
|
+
className: "text-gray-500 dark:text-gray-400"
|
|
116
|
+
}, trip.to) : null, trip.duration ? React.createElement("span", {
|
|
117
|
+
className: "ml-1 text-xs text-gray-500 dark:text-gray-400"
|
|
118
|
+
}, "\u00B7 ", trip.duration) : null) : null), booking.items.length > 0 ? React.createElement("ul", {
|
|
119
|
+
className: `space-y-2 ${ROW}`
|
|
120
|
+
}, booking.items.map(item => React.createElement("li", {
|
|
121
|
+
key: item.key,
|
|
122
|
+
className: "flex items-center gap-3"
|
|
123
|
+
}, item.imageUrl ? React.createElement("img", {
|
|
124
|
+
src: item.imageUrl,
|
|
125
|
+
alt: "",
|
|
126
|
+
loading: "lazy",
|
|
127
|
+
className: "h-10 w-10 shrink-0 rounded-lg bg-white object-contain p-0.5 ring-1 ring-gray-100 dark:ring-gray-700"
|
|
128
|
+
}) : null, React.createElement("div", {
|
|
129
|
+
className: "min-w-0 flex-1"
|
|
130
|
+
}, React.createElement("p", {
|
|
131
|
+
className: "truncate text-[13px] font-medium text-gray-900 dark:text-gray-50"
|
|
132
|
+
}, item.quantity ? `${item.quantity}× ` : '', item.title), item.detail ? React.createElement("p", {
|
|
133
|
+
className: "truncate text-xs text-gray-500 dark:text-gray-400"
|
|
134
|
+
}, item.detail) : null), item.price ? React.createElement("span", {
|
|
135
|
+
className: "shrink-0 text-[13px] tabular-nums text-gray-900 dark:text-gray-100"
|
|
136
|
+
}, item.price) : null))) : null, booking.lines.length > 0 ? React.createElement("dl", {
|
|
137
|
+
className: `space-y-1.5 text-[13px] ${ROW}`
|
|
138
|
+
}, booking.lines.map(line => React.createElement("div", {
|
|
139
|
+
key: line.label,
|
|
140
|
+
className: "flex justify-between gap-4"
|
|
141
|
+
}, React.createElement("dt", {
|
|
142
|
+
className: "text-gray-600 dark:text-gray-300"
|
|
143
|
+
}, line.label), React.createElement("dd", {
|
|
144
|
+
className: "text-right text-gray-900 dark:text-gray-100"
|
|
145
|
+
}, line.value)))) : null, booking.charges.length > 0 ? React.createElement("dl", {
|
|
146
|
+
className: `space-y-1 text-xs text-gray-500 dark:text-gray-400 ${ROW}`
|
|
147
|
+
}, booking.charges.map(charge => React.createElement("div", {
|
|
148
|
+
key: charge.label,
|
|
149
|
+
className: "flex justify-between gap-4"
|
|
150
|
+
}, React.createElement("dt", null, charge.label), React.createElement("dd", {
|
|
151
|
+
className: "tabular-nums"
|
|
152
|
+
}, charge.amount)))) : null, booking.total ? React.createElement("div", {
|
|
153
|
+
className: `flex items-baseline justify-between ${ROW}`
|
|
154
|
+
}, React.createElement("span", {
|
|
155
|
+
className: "text-[13px] font-semibold text-gray-900 dark:text-gray-50"
|
|
156
|
+
}, "Total"), React.createElement("span", {
|
|
157
|
+
className: "text-base font-bold tabular-nums text-gray-900 dark:text-white"
|
|
158
|
+
}, booking.total)) : null, action && replies ? React.createElement("div", {
|
|
159
|
+
className: "flex items-center justify-end gap-3 border-t border-gray-100 bg-gray-50/70 px-4 py-3 dark:border-gray-700 dark:bg-gray-900/30"
|
|
160
|
+
}, sent ? React.createElement("span", {
|
|
161
|
+
className: "text-xs text-gray-500 dark:text-gray-400"
|
|
162
|
+
}, "Sent") : null, React.createElement("button", {
|
|
163
|
+
type: "button",
|
|
164
|
+
onClick: go,
|
|
165
|
+
disabled: sent,
|
|
166
|
+
className: "inline-flex items-center gap-1.5 rounded-full bg-blue-600 px-4 py-2 text-[13px] font-semibold text-white shadow-sm transition hover:bg-blue-700 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2 disabled:opacity-60 dark:focus-visible:ring-offset-gray-900"
|
|
167
|
+
}, sent ? React.createElement(FiCheck, {
|
|
168
|
+
className: "h-3.5 w-3.5",
|
|
169
|
+
"aria-hidden": "true"
|
|
170
|
+
}) : null, !sent && booking.status === 'declined' ? React.createElement(FiRotateCcw, {
|
|
171
|
+
className: "h-3.5 w-3.5",
|
|
172
|
+
"aria-hidden": "true"
|
|
173
|
+
}) : null, action.label)) : null);
|
|
174
|
+
};export{MessageBooking};//# sourceMappingURL=MessageBooking.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MessageBooking.js","sources":["../../../src/components/MessageWidgets/MessageBooking.tsx"],"sourcesContent":[null],"names":[],"mappings":"8ZAgBA,MAAM,YAAY,GAAwF;UACtG,EAAQ;AACR,IAAA,IAAA,EAAA,aAAW;AACP,IAAA,WAAM;AACN,GAAA;AACH,EAAA,SAAA,EAAA;IACD,IAAA,EAAA;IACF,SAAA,EAAA;AACF,GAAA;AACI,EAAA,UAAM,EAAA;AACN,IAAA,IAAA,EAAA,QAAW;IACb,SAAA,EAAA;AAEF;AACA,CAAA;MACI,YAAa,GAAE;AACf,EAAA,IAAA,EAAI;AACA,EAAA,SAAA,EAAA;;;AAeJ,MAAA,UACI,GAAA,CAAA;AAOR,EAAE;AAEF,CAAA,KAAM;AAEN,EAAA,MAAA,CAAA,MAAA,EAAA,SAAA,CAAA,GAAA,QAAA,CAAA,KAAA,CAAA;;;;;;AAMG,MAAA,GAAA,EA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G,EAAA,QAAU,KAAA,GAAA,CAAA,EAAA,EAAA,OAAA,CAAA,KAAA,CAAA,MAAA,CAAA,GAAA,EAAA,CAAA,CAAA;AACR,IAAA,mBAAA,EAAK;wBACD,WACL,CAAA,MAAA,KAAA,QAAA,GAAA,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA;gBACH,wDACgB,EAAA,IAAA,CAAA,SAAA,CAAA;AAGpB,GAAA,EAAA,KAAA,CAAA,aAAY,CAAC,IACV,CAAA,IAAA,EAAA;AASnB,IAAA,SAAA,EAAO,CAAC,YAAY,EAAA,kCACb;AAGQ,IAAA,aAAA,EAAA;AACA,GAAA,CAAA,EAAA,OAAA,CAAA,WAAA,CAAA,GAAA,IAAA,EAAA,KAAI,cAAU,CAAA,KAAA,EAAA;AAM7B,IAAA,SAAA,EAAO;wBAIQ,CAAA,KAAA,EAAA;AACA,IAAA,SAAA,EAAA;UAMf,CAAA,aAAgB,CACb,KAAA,EAAA;aACI,EAAA;AACA,GAAA,EAAA,KAAA,CAAA,aAAA,CAAA,UAAA,EAAA;WAMP,EAAA;YAEQ,aAAO,CAAA,KAAA,EAAA;AACR,IAAA,SAAA,EAAA;AAMK,GAAA,EAAA,KAAA,CAAA,aAAO,CAAA,GAAA,EAAA;;mBAIP,CAAA,EAAM,OACF,CACP,KACN,GAAI,KAEd,CAAA,aAAA,CAAA,GAAA,EAAA;AACN,IAAE,SAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -25,8 +25,14 @@ export interface IFlightCardProps {
|
|
|
25
25
|
showDate?: boolean;
|
|
26
26
|
/** Briefly outlined, e.g. after a quick-pick chip jumped to it. */
|
|
27
27
|
highlighted?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Book this flight through the agent: the whole card answers it with `card.bookReply`, and the
|
|
30
|
+
* seller's page (when there is one) is a small link to book it yourself. Without it a card with a
|
|
31
|
+
* seller link opens that page, and one without opens `onOpen`.
|
|
32
|
+
*/
|
|
33
|
+
onBook?: () => void;
|
|
28
34
|
}
|
|
29
|
-
export declare const FlightCard: ({ card, onOpen, fullWidth, showDate, highlighted, }: IFlightCardProps) => React.JSX.Element;
|
|
35
|
+
export declare const FlightCard: ({ card, onOpen, fullWidth, showDate, highlighted, onBook, }: IFlightCardProps) => React.JSX.Element;
|
|
30
36
|
export interface IFlightCardListProps {
|
|
31
37
|
attachment: TravelAttachmentsInterface;
|
|
32
38
|
/** Fired by a card with no seller link; omit it to render such cards as plain content. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MessageFlights.d.ts","sourceRoot":"","sources":["../../../src/components/MessageWidgets/MessageFlights.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4D,MAAM,OAAO,CAAC;AAKjF,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"MessageFlights.d.ts","sourceRoot":"","sources":["../../../src/components/MessageWidgets/MessageFlights.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4D,MAAM,OAAO,CAAC;AAKjF,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAE/B,OAAO,EAAE,0BAA0B,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EAEH,cAAc,EACd,eAAe,EACf,UAAU,EAIb,MAAM,sBAAsB,CAAC;AAE9B,MAAM,WAAW,oBAAoB;IACjC,OAAO,EAAE,KAAK,CAAC;IACf,UAAU,EAAE,0BAA0B,CAAC;IACvC,0DAA0D;IAC1D,cAAc,CAAC,EAAE,CAAC,GAAG,EAAE,KAAK,KAAK,IAAI,CAAC;CACzC;AAED,yFAAyF;AACzF,eAAO,MAAM,KAAK,UASjB,CAAC;AA4BF;;;GAGG;AACH,eAAO,MAAM,SAAS,GAAI,WAAW;IAAE,KAAK,EAAE,eAAe,CAAA;CAAE,sBAiC9D,CAAC;AA6EF,MAAM,WAAW,gBAAgB;IAC7B,IAAI,EAAE,cAAc,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,wFAAwF;IACxF,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,mEAAmE;IACnE,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;CACvB;AAED,eAAO,MAAM,UAAU,GAAI,6DAOxB,gBAAgB,sBAmJlB,CAAC;AAEF,MAAM,WAAW,oBAAoB;IACjC,UAAU,EAAE,0BAA0B,CAAC;IACvC,0FAA0F;IAC1F,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,iEAAiE;IACjE,IAAI,CAAC,EAAE,UAAU,CAAC;CACrB;AAED,sFAAsF;AACtF,eAAO,MAAM,cAAc,GAAI,8BAA8C,oBAAoB,sBAchG,CAAC;AAIF;;;;;;GAMG;AACH,eAAO,MAAM,cAAc,GAAI,yCAAyC,oBAAoB,sBA4K3F,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React,{useMemo,useRef,useState,useCallback,useEffect}from'react';import {FaPlane}from'@react-icons/all-files/fa/FaPlane.js';import {FiChevronLeft}from'@react-icons/all-files/fi/FiChevronLeft.js';import {FiChevronRight}from'@react-icons/all-files/fi/FiChevronRight.js';import {FiExternalLink}from'@react-icons/all-files/fi/FiExternalLink.js';import {toFlightCards,flightResultSummary,sortFlightCards}from'@admin-layout/client';/** Soft monogram tile colours, indexed by `airlineTone`; shared by every result card. */
|
|
1
|
+
import React,{useMemo,useRef,useState,useCallback,useEffect}from'react';import {FaPlane}from'@react-icons/all-files/fa/FaPlane.js';import {FiChevronLeft}from'@react-icons/all-files/fi/FiChevronLeft.js';import {FiChevronRight}from'@react-icons/all-files/fi/FiChevronRight.js';import {FiExternalLink}from'@react-icons/all-files/fi/FiExternalLink.js';import {OpenAppButton,withWidgetAction}from'./ResultRow.js';import {toFlightCards,flightResultSummary,sortFlightCards}from'@admin-layout/client';/** Soft monogram tile colours, indexed by `airlineTone`; shared by every result card. */
|
|
2
2
|
const TONES = ['bg-sky-100 text-sky-700 dark:bg-sky-500/20 dark:text-sky-300', 'bg-violet-100 text-violet-700 dark:bg-violet-500/20 dark:text-violet-300', 'bg-emerald-100 text-emerald-700 dark:bg-emerald-500/20 dark:text-emerald-300', 'bg-amber-100 text-amber-700 dark:bg-amber-500/20 dark:text-amber-300', 'bg-rose-100 text-rose-700 dark:bg-rose-500/20 dark:text-rose-300', 'bg-indigo-100 text-indigo-700 dark:bg-indigo-500/20 dark:text-indigo-300', 'bg-teal-100 text-teal-700 dark:bg-teal-500/20 dark:text-teal-300', 'bg-orange-100 text-orange-700 dark:bg-orange-500/20 dark:text-orange-300'];
|
|
3
3
|
const BADGE = {
|
|
4
4
|
cheapest: {
|
|
@@ -55,6 +55,37 @@ const RouteLine = ({
|
|
|
55
55
|
className: `text-[11px] font-medium leading-4 ${stops === 0 && slice.stops ? 'text-emerald-600 dark:text-emerald-400' : stops > 0 ? 'text-amber-600 dark:text-amber-400' : 'text-gray-400'}`
|
|
56
56
|
}, slice.stops ?? ' '));
|
|
57
57
|
};
|
|
58
|
+
/** "6:28 PM" with the period set smaller, so the hour reads first and two times fit beside the route. */
|
|
59
|
+
const ClockTime = ({
|
|
60
|
+
value
|
|
61
|
+
}) => {
|
|
62
|
+
const m = value?.match(/^(\d{1,2}:\d{2})\s*([AP]M)$/);
|
|
63
|
+
if (!m) return React.createElement(React.Fragment, null, value ?? '--:--');
|
|
64
|
+
return React.createElement(React.Fragment, null, m[1], React.createElement("span", {
|
|
65
|
+
className: "ml-0.5 text-[13px] font-semibold tracking-normal"
|
|
66
|
+
}, m[2]));
|
|
67
|
+
};
|
|
68
|
+
/** The airline's own logo when the card has one, else its monogram tile; a logo that fails to load falls back too. */
|
|
69
|
+
const AirlineMark = ({
|
|
70
|
+
card
|
|
71
|
+
}) => {
|
|
72
|
+
const [failed, setFailed] = useState(false);
|
|
73
|
+
if (card.airlineLogo && !failed) {
|
|
74
|
+
return React.createElement("span", {
|
|
75
|
+
"aria-hidden": "true",
|
|
76
|
+
className: "flex h-8 w-8 shrink-0 items-center justify-center overflow-hidden rounded-lg bg-white ring-1 ring-inset ring-gray-100 dark:ring-gray-700"
|
|
77
|
+
}, React.createElement("img", {
|
|
78
|
+
src: card.airlineLogo,
|
|
79
|
+
alt: "",
|
|
80
|
+
className: "h-7 w-7 object-contain",
|
|
81
|
+
onError: () => setFailed(true)
|
|
82
|
+
}));
|
|
83
|
+
}
|
|
84
|
+
return React.createElement("span", {
|
|
85
|
+
"aria-hidden": "true",
|
|
86
|
+
className: `flex h-8 w-8 shrink-0 items-center justify-center rounded-lg text-[11px] font-bold tracking-wide ${TONES[card.airlineTone % TONES.length]}`
|
|
87
|
+
}, card.airlineCode);
|
|
88
|
+
};
|
|
58
89
|
const SliceRow = ({
|
|
59
90
|
slice,
|
|
60
91
|
caption
|
|
@@ -64,7 +95,9 @@ const SliceRow = ({
|
|
|
64
95
|
className: "grid grid-cols-[auto_1fr_auto] items-center gap-2"
|
|
65
96
|
}, React.createElement("div", null, React.createElement("p", {
|
|
66
97
|
className: "text-[22px] font-bold leading-none tracking-tight tabular-nums text-gray-900 dark:text-gray-50"
|
|
67
|
-
},
|
|
98
|
+
}, React.createElement(ClockTime, {
|
|
99
|
+
value: slice.departTime
|
|
100
|
+
})), React.createElement("p", {
|
|
68
101
|
className: "mt-1.5 text-xs font-medium text-gray-500 dark:text-gray-400"
|
|
69
102
|
}, slice.origin)), React.createElement(RouteLine, {
|
|
70
103
|
slice: slice
|
|
@@ -72,7 +105,9 @@ const SliceRow = ({
|
|
|
72
105
|
className: "text-right"
|
|
73
106
|
}, React.createElement("p", {
|
|
74
107
|
className: "text-[22px] font-bold leading-none tracking-tight tabular-nums text-gray-900 dark:text-gray-50"
|
|
75
|
-
},
|
|
108
|
+
}, React.createElement(ClockTime, {
|
|
109
|
+
value: slice.arriveTime
|
|
110
|
+
}), slice.dayOffset ? React.createElement("sup", {
|
|
76
111
|
className: "ml-0.5 text-[11px] font-semibold text-amber-600 dark:text-amber-400"
|
|
77
112
|
}, slice.dayOffset) : null), React.createElement("p", {
|
|
78
113
|
className: "mt-1.5 text-xs font-medium text-gray-500 dark:text-gray-400"
|
|
@@ -84,7 +119,8 @@ const FlightCard = ({
|
|
|
84
119
|
onOpen,
|
|
85
120
|
fullWidth = false,
|
|
86
121
|
showDate = false,
|
|
87
|
-
highlighted = false
|
|
122
|
+
highlighted = false,
|
|
123
|
+
onBook
|
|
88
124
|
}) => {
|
|
89
125
|
const className = `${CARD_CLASS} ${fullWidth ? 'w-full' : IN_ROW} ${highlighted ? 'border-blue-400 ring-2 ring-blue-500/40 dark:border-blue-400' : 'border-gray-200 dark:border-gray-700'}`;
|
|
90
126
|
const subtitle = [card.flightNumber, card.cabin].filter(Boolean).join(' · ') || (card.roundTrip ? 'Round trip' : 'One way');
|
|
@@ -94,10 +130,9 @@ const FlightCard = ({
|
|
|
94
130
|
};
|
|
95
131
|
const body = React.createElement(React.Fragment, null, React.createElement("div", {
|
|
96
132
|
className: "flex items-center gap-2.5"
|
|
97
|
-
}, React.createElement(
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
}, card.airlineCode), React.createElement("div", {
|
|
133
|
+
}, React.createElement(AirlineMark, {
|
|
134
|
+
card: card
|
|
135
|
+
}), React.createElement("div", {
|
|
101
136
|
className: "min-w-0 flex-1"
|
|
102
137
|
}, React.createElement("p", {
|
|
103
138
|
className: "truncate text-sm font-semibold leading-5 text-gray-900 dark:text-gray-50"
|
|
@@ -121,14 +156,39 @@ const FlightCard = ({
|
|
|
121
156
|
}, part, i < parts.length - 1 ? ' ·' : ''), i < parts.length - 1 ? ' ' : ''))) : null, React.createElement("div", {
|
|
122
157
|
className: "mt-auto flex items-center justify-between gap-3 border-t border-gray-100 pt-3 dark:border-gray-700"
|
|
123
158
|
}, React.createElement("p", {
|
|
124
|
-
className:
|
|
125
|
-
}, card.seller ? `via ${card.seller}` : card.roundTrip ? 'Round trip' :
|
|
159
|
+
className: `min-w-0 truncate text-xs ${onBook ? 'font-semibold text-blue-600 dark:text-blue-400' : 'text-gray-500 dark:text-gray-400'}`
|
|
160
|
+
}, onBook ? 'Book' : card.seller ? `via ${card.seller}` : card.roundTrip ? 'Round trip' : ''), React.createElement("span", {
|
|
126
161
|
className: "flex shrink-0 items-center gap-1.5"
|
|
127
162
|
}, card.price ? React.createElement("span", {
|
|
128
163
|
className: "text-lg font-bold leading-none tabular-nums text-gray-900 dark:text-white"
|
|
129
|
-
}, card.price) : null, card.url ? React.createElement(
|
|
164
|
+
}, card.price) : null, card.url && onBook ? React.createElement("a", {
|
|
165
|
+
href: card.url,
|
|
166
|
+
target: "_blank",
|
|
167
|
+
rel: "noopener noreferrer",
|
|
168
|
+
"aria-label": `Book it yourself${card.seller ? ` on ${card.seller}` : ''}`,
|
|
169
|
+
title: "Book it yourself",
|
|
170
|
+
className: "pointer-events-auto relative z-10 -m-1 rounded-full p-1 text-gray-400 transition-colors hover:bg-blue-50 hover:text-blue-600 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 dark:hover:bg-blue-500/10"
|
|
171
|
+
}, React.createElement(FiExternalLink, {
|
|
172
|
+
className: "h-3.5 w-3.5"
|
|
173
|
+
})) : card.url ? React.createElement(FiExternalLink, {
|
|
130
174
|
className: "h-3.5 w-3.5 text-gray-400 transition-colors group-hover/card:text-blue-500"
|
|
131
175
|
}) : null)));
|
|
176
|
+
// Booked through the agent: the whole card is the button (stretched under the content), and the
|
|
177
|
+
// seller link above it stays its own control - never a link nested in a button.
|
|
178
|
+
if (onBook) {
|
|
179
|
+
return React.createElement("div", {
|
|
180
|
+
className: `${className} focus-within:ring-2 focus-within:ring-blue-500 focus-within:ring-offset-2 dark:focus-within:ring-offset-gray-900`,
|
|
181
|
+
"data-flight-card": "",
|
|
182
|
+
"data-flight-key": card.key
|
|
183
|
+
}, React.createElement("button", {
|
|
184
|
+
type: "button",
|
|
185
|
+
onClick: onBook,
|
|
186
|
+
"aria-label": `Book: ${card.accessibleLabel}`,
|
|
187
|
+
className: "absolute inset-0 rounded-2xl focus-visible:outline-none"
|
|
188
|
+
}), React.createElement("div", {
|
|
189
|
+
className: "pointer-events-none relative flex flex-1 flex-col"
|
|
190
|
+
}, body));
|
|
191
|
+
}
|
|
132
192
|
// A bookable offer goes straight to the seller; without a link the card
|
|
133
193
|
// opens the full results in the side panel instead.
|
|
134
194
|
if (card.url) {
|
|
@@ -247,6 +307,13 @@ const MessageFlights = ({
|
|
|
247
307
|
setHighlighted(key);
|
|
248
308
|
};
|
|
249
309
|
const open = () => onMessageClick?.(message);
|
|
310
|
+
// The host sends a card's reply as the person's next turn (it says so on the message): then a tap
|
|
311
|
+
// books that flight through the agent, word for word, and the seller link books it by hand.
|
|
312
|
+
const replies = !!onMessageClick && message?.props?.cardReplies === true;
|
|
313
|
+
const book = card => () => onMessageClick?.(withWidgetAction(message, {
|
|
314
|
+
type: 'reply',
|
|
315
|
+
text: card.bookReply
|
|
316
|
+
}));
|
|
250
317
|
const count = summary.count;
|
|
251
318
|
const title = summary.route ?? attachment.title ?? 'Flights';
|
|
252
319
|
const subtitle = [summary.date, `${count} ${count === 1 ? 'flight' : 'flights'}`, summary.fromPrice ? `from ${summary.fromPrice}` : undefined, summary.seller].filter(Boolean).join(' · ');
|
|
@@ -273,13 +340,18 @@ const MessageFlights = ({
|
|
|
273
340
|
className: "truncate text-sm font-semibold leading-5 text-gray-900 dark:text-gray-50"
|
|
274
341
|
}, title), React.createElement("p", {
|
|
275
342
|
className: "truncate text-xs leading-4 text-gray-500 dark:text-gray-400"
|
|
276
|
-
}, subtitle))),
|
|
343
|
+
}, subtitle))), React.createElement("div", {
|
|
344
|
+
className: "flex shrink-0 items-center gap-1"
|
|
345
|
+
}, onMessageClick ? React.createElement(OpenAppButton, {
|
|
346
|
+
app: "Travel",
|
|
347
|
+
onClick: () => onMessageClick(withWidgetAction(message, 'open-app'))
|
|
348
|
+
}) : null, onMessageClick && count > 1 ? React.createElement("button", {
|
|
277
349
|
type: "button",
|
|
278
350
|
onClick: open,
|
|
279
351
|
className: "inline-flex shrink-0 items-center gap-0.5 rounded-full px-2.5 py-1 text-xs font-semibold text-blue-600 transition hover:bg-blue-50 dark:text-blue-400 dark:hover:bg-blue-500/10"
|
|
280
352
|
}, "View all ", count, React.createElement(FiChevronRight, {
|
|
281
353
|
className: "h-3.5 w-3.5"
|
|
282
|
-
})) : null), picks.length > 0 ? React.createElement("div", {
|
|
354
|
+
})) : null)), picks.length > 0 ? React.createElement("div", {
|
|
283
355
|
className: "mx-2 mb-2 flex flex-wrap gap-1.5",
|
|
284
356
|
"aria-label": "Quick picks"
|
|
285
357
|
}, picks.map(p => React.createElement("button", {
|
|
@@ -306,6 +378,7 @@ const MessageFlights = ({
|
|
|
306
378
|
key: c.key,
|
|
307
379
|
card: c,
|
|
308
380
|
onOpen: open,
|
|
381
|
+
onBook: replies ? book(c) : undefined,
|
|
309
382
|
showDate: !summary.sameDate,
|
|
310
383
|
highlighted: highlighted === c.key
|
|
311
384
|
}))), React.createElement("button", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MessageFlights.js","sources":["../../../src/components/MessageWidgets/MessageFlights.tsx"],"sourcesContent":[null],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"MessageFlights.js","sources":["../../../src/components/MessageWidgets/MessageFlights.tsx"],"sourcesContent":[null],"names":[],"mappings":"6eAyBA;AACO,MAAM,KAAK,GAAG,CAAA,8DAAA,EAAA,0EAAA,EAAA,8EAAA,EAAA,sEAAA,EAAA,kEAAA,EAAA,0EAAA,EAAA,kEAAA,EAAA,0EAAA;MACjB,KAAA,GAAA;UACA,EAAA;IACA,KAAA,EAAA,UAAA;IACA,IAAA,EAAA,uHAAsE;IACtE,IAAA,EAAA;;SAEA,EAAA;IACA,KAAA,EAAA,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YhB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -14,6 +14,8 @@ interface VerticalSpec {
|
|
|
14
14
|
Card: ComponentType<IResultCardProps<any>>;
|
|
15
15
|
icon: (a: ResultSetLike, cards: ResultCardBase[]) => ReactNode;
|
|
16
16
|
sorts: ResultSort[];
|
|
17
|
+
/** The app these results also open in ("Open in Travel"); none for a vertical without one. */
|
|
18
|
+
app?: string;
|
|
17
19
|
}
|
|
18
20
|
export declare const VERTICALS: Record<ResultVertical, VerticalSpec>;
|
|
19
21
|
/** Which vertical a travel attachment that is not flights belongs to. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MessageResults.d.ts","sourceRoot":"","sources":["../../../src/components/MessageWidgets/MessageResults.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,aAAa,EAAE,SAAS,EAAW,MAAM,OAAO,CAAC;AAQjE,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAC/B,OAAO,EACH,cAAc,EACd,aAAa,EACb,UAAU,EACV,aAAa,EAgBhB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAGH,gBAAgB,EAMnB,MAAM,eAAe,CAAC;AAGvB;;;;GAIG;AACH,MAAM,MAAM,cAAc,GAAG,OAAO,GAAG,MAAM,GAAG,QAAQ,GAAG,UAAU,GAAG,QAAQ,GAAG,MAAM,CAAC;AAE1F,UAAU,YAAY;IAClB,OAAO,EAAE,CAAC,CAAC,EAAE,aAAa,KAAK,cAAc,EAAE,CAAC;IAChD,OAAO,EAAE,CAAC,CAAC,EAAE,aAAa,EAAE,KAAK,EAAE,cAAc,EAAE,KAAK,aAAa,CAAC;IACtE,IAAI,EAAE,aAAa,CAAC,gB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@@
|
|
|
1
|
-
import React,{useMemo}from'react';import {FaBed}from'@react-icons/all-files/fa/FaBed.js';import {FaBus}from'@react-icons/all-files/fa/FaBus.js';import {FaCar}from'@react-icons/all-files/fa/FaCar.js';import {FaTrain}from'@react-icons/all-files/fa/FaTrain.js';import {FiBriefcase}from'@react-icons/all-files/fi/FiBriefcase.js';import {FiFilm}from'@react-icons/all-files/fi/FiFilm.js';import {FiShoppingBag}from'@react-icons/all-files/fi/FiShoppingBag.js';import {toResumeCard,toMovieCards,toProductCards,toGroundCards,toCarCards,toStayCards,travelResultKind,jobSummary,toJobCards,movieSummary,productSummary,groundSummary,carSummary,staySummary,sortResultCards}from'@admin-layout/client';import {ResumeCard,JobCard,MovieCard,ProductCard,GroundCard,CarCard,StayCard}from'./ResultCards.js';import {ResultRow}from'./ResultRow.js';const ICON = 'h-4 w-4';
|
|
1
|
+
import React,{useMemo}from'react';import {FaBed}from'@react-icons/all-files/fa/FaBed.js';import {FaBus}from'@react-icons/all-files/fa/FaBus.js';import {FaCar}from'@react-icons/all-files/fa/FaCar.js';import {FaTrain}from'@react-icons/all-files/fa/FaTrain.js';import {FiBriefcase}from'@react-icons/all-files/fi/FiBriefcase.js';import {FiFilm}from'@react-icons/all-files/fi/FiFilm.js';import {FiShoppingBag}from'@react-icons/all-files/fi/FiShoppingBag.js';import {toResumeCard,toMovieCards,toProductCards,toGroundCards,toCarCards,toStayCards,travelResultKind,jobSummary,toJobCards,movieSummary,productSummary,groundSummary,carSummary,staySummary,sortResultCards}from'@admin-layout/client';import {ResumeCard,JobCard,MovieCard,ProductCard,GroundCard,CarCard,StayCard}from'./ResultCards.js';import {withWidgetAction,ResultRow}from'./ResultRow.js';const ICON = 'h-4 w-4';
|
|
2
2
|
const VERTICALS = {
|
|
3
3
|
stays: {
|
|
4
4
|
toCards: toStayCards,
|
|
@@ -7,7 +7,8 @@ const VERTICALS = {
|
|
|
7
7
|
icon: () => React.createElement(FaBed, {
|
|
8
8
|
className: ICON
|
|
9
9
|
}),
|
|
10
|
-
sorts: ['recommended', 'cheapest', 'rating']
|
|
10
|
+
sorts: ['recommended', 'cheapest', 'rating'],
|
|
11
|
+
app: 'Travel'
|
|
11
12
|
},
|
|
12
13
|
cars: {
|
|
13
14
|
toCards: toCarCards,
|
|
@@ -16,7 +17,8 @@ const VERTICALS = {
|
|
|
16
17
|
icon: () => React.createElement(FaCar, {
|
|
17
18
|
className: ICON
|
|
18
19
|
}),
|
|
19
|
-
sorts: ['recommended', 'cheapest', 'rating']
|
|
20
|
+
sorts: ['recommended', 'cheapest', 'rating'],
|
|
21
|
+
app: 'Travel'
|
|
20
22
|
},
|
|
21
23
|
ground: {
|
|
22
24
|
toCards: toGroundCards,
|
|
@@ -27,7 +29,8 @@ const VERTICALS = {
|
|
|
27
29
|
}) : React.createElement(FaTrain, {
|
|
28
30
|
className: ICON
|
|
29
31
|
}),
|
|
30
|
-
sorts: ['recommended', 'cheapest', 'fastest', 'departure']
|
|
32
|
+
sorts: ['recommended', 'cheapest', 'fastest', 'departure'],
|
|
33
|
+
app: 'Travel'
|
|
31
34
|
},
|
|
32
35
|
shopping: {
|
|
33
36
|
toCards: toProductCards,
|
|
@@ -36,7 +39,8 @@ const VERTICALS = {
|
|
|
36
39
|
icon: () => React.createElement(FiShoppingBag, {
|
|
37
40
|
className: ICON
|
|
38
41
|
}),
|
|
39
|
-
sorts: ['recommended', 'cheapest', 'rating']
|
|
42
|
+
sorts: ['recommended', 'cheapest', 'rating'],
|
|
43
|
+
app: 'Shopping'
|
|
40
44
|
},
|
|
41
45
|
movies: {
|
|
42
46
|
toCards: toMovieCards,
|
|
@@ -84,9 +88,17 @@ const MessageResults = ({
|
|
|
84
88
|
const summary = useMemo(() => a ? spec.summary(a, cards) : null, [a, spec, cards]);
|
|
85
89
|
if (!a || !summary || cards.length === 0) return null;
|
|
86
90
|
const open = onMessageClick ? () => onMessageClick(message) : undefined;
|
|
91
|
+
const openApp = onMessageClick && spec.app ? () => onMessageClick(withWidgetAction(message, 'open-app')) : undefined;
|
|
87
92
|
const {
|
|
88
93
|
Card
|
|
89
94
|
} = spec;
|
|
95
|
+
// The host sends a card's reply as the person's next turn (it says so on the message): then a card
|
|
96
|
+
// that carries one - a product's "I'll take the …" - answers the agent with a tap.
|
|
97
|
+
const replies = !!onMessageClick && message?.props?.cardReplies === true;
|
|
98
|
+
const pick = card => replies && card.pickReply ? () => onMessageClick?.(withWidgetAction(message, {
|
|
99
|
+
type: 'reply',
|
|
100
|
+
text: card.pickReply
|
|
101
|
+
})) : undefined;
|
|
90
102
|
return React.createElement(ResultRow, {
|
|
91
103
|
icon: spec.icon(a, cards),
|
|
92
104
|
title: summary.title,
|
|
@@ -94,11 +106,14 @@ const MessageResults = ({
|
|
|
94
106
|
picks: cards.length > 2 ? summary.picks : [],
|
|
95
107
|
count: summary.count,
|
|
96
108
|
onViewAll: open,
|
|
109
|
+
onOpenApp: openApp,
|
|
110
|
+
appLabel: spec.app,
|
|
97
111
|
ariaLabel: summary.title
|
|
98
112
|
}, highlighted => cards.map(c => React.createElement(Card, {
|
|
99
113
|
key: c.key,
|
|
100
114
|
card: c,
|
|
101
115
|
onOpen: open,
|
|
116
|
+
onPick: pick(c),
|
|
102
117
|
highlighted: highlighted === c.key
|
|
103
118
|
})));
|
|
104
119
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MessageResults.js","sources":["../../../src/components/MessageWidgets/MessageResults.tsx"],"sourcesContent":[null],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"MessageResults.js","sources":["../../../src/components/MessageWidgets/MessageResults.tsx"],"sourcesContent":[null],"names":[],"mappings":"00BA2DA,MAAM,IAAI,GAAG,SAAS;AAEf,MAAM,SAAS,GAAyC;AAC3D,EAAA,KAAA,EAAK;AACD,IAAA,OAAA,EAAA,WAAS;AACT,IAAA,OAAA,EAAA,CAAA,CAAO,EAAE,CAAC,KAAI,WAAK,CAAA,CAAA,EAAW,CAAC,CAAC;AAChC,IAAA,I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A,IAAA,CAAA,CAAA,EAAA,KAAe;AAC5B,IAAA,KAAO,EAAA,OAAM,CAAA,KAAA;AACb,IAAA,QAAO,EAAM,OAAA,CAAA,QAAe;AAE5B,IAAA,KAAA,EAAA,KAAA,CAAA,MAAA,GAAA,CAAA,GAAA,OAAA,CAAA,KAAA,GAAA,EAAA;AACA,IAAA,KAAO,EAAA,OAAM,CAAA,KAAA;AACT,IAAA,SAAO,EAAI,IAAA;AACP,IAAA,kBAAa;AACjB,IAAA,UAAU,IAAG,CAAA,GAAA;AACb,IAAA,SAAS,EAAA,OAAA,CAAA;AAAE,GAAA,EAAA,eAAY,KAAA,CAAA,GAAA,CAAA,CAAA,IAAA,KAAA,CAAA,aAAA,CAAA,IAAA,EAAA;IACvB,GAAA,EAAA,CAAA,CAAO,GAAA;AACX,IAAE,IAAA,EAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -3,13 +3,15 @@ import type { CarCardView, GroundCardView, JobCardView, MovieCardView, ProductCa
|
|
|
3
3
|
export interface IResultCardProps<T> {
|
|
4
4
|
card: T;
|
|
5
5
|
onOpen?: () => void;
|
|
6
|
+
/** Answer the agent with this card (a card that carries a reply, when the host sends replies). */
|
|
7
|
+
onPick?: () => void;
|
|
6
8
|
fullWidth?: boolean;
|
|
7
9
|
highlighted?: boolean;
|
|
8
10
|
}
|
|
9
11
|
export declare const StayCard: ({ card, onOpen, fullWidth, highlighted }: IResultCardProps<StayCardView>) => React.JSX.Element;
|
|
10
12
|
export declare const CarCard: ({ card, onOpen, fullWidth, highlighted }: IResultCardProps<CarCardView>) => React.JSX.Element;
|
|
11
13
|
export declare const GroundCard: ({ card, onOpen, fullWidth, highlighted }: IResultCardProps<GroundCardView>) => React.JSX.Element;
|
|
12
|
-
export declare const ProductCard: ({ card, onOpen, fullWidth, highlighted }: IResultCardProps<ProductCardView>) => React.JSX.Element;
|
|
14
|
+
export declare const ProductCard: ({ card, onOpen, onPick, fullWidth, highlighted }: IResultCardProps<ProductCardView>) => React.JSX.Element;
|
|
13
15
|
export declare const MovieCard: ({ card, onOpen, fullWidth, highlighted }: IResultCardProps<MovieCardView>) => React.JSX.Element;
|
|
14
16
|
export declare const JobCard: ({ card, onOpen, fullWidth, highlighted }: IResultCardProps<JobCardView>) => React.JSX.Element;
|
|
15
17
|
export declare const ResumeCard: ({ card, onOpen }: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ResultCards.d.ts","sourceRoot":"","sources":["../../../src/components/MessageWidgets/ResultCards.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAc1B,OAAO,KAAK,EACR,WAAW,EACX,cAAc,EACd,WAAW,EACX,aAAa,EACb,eAAe,EACf,cAAc,EACd,YAAY,EACf,MAAM,sBAAsB,CAAC;AAI9B,MAAM,WAAW,gBAAgB,CAAC,CAAC;IAC/B,IAAI,EAAE,CAAC,CAAC;IACR,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,WAAW,CAAC,EAAE,OAAO,CAAC;CACzB;AAiED,eAAO,MAAM,QAAQ,GAAI,0CAA0C,gBAAgB,CAAC,YAAY,CAAC,sBAuDhG,CAAC;AAIF,eAAO,MAAM,OAAO,GAAI,0CAA0C,gBAAgB,CAAC,WAAW,CAAC,sBAmE9F,CAAC;AAIF,eAAO,MAAM,UAAU,GAAI,0CAA0C,gBAAgB,CAAC,cAAc,CAAC,sBAgGpG,CAAC;AAIF,eAAO,MAAM,WAAW,GAAI,
|
|
1
|
+
{"version":3,"file":"ResultCards.d.ts","sourceRoot":"","sources":["../../../src/components/MessageWidgets/ResultCards.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAc1B,OAAO,KAAK,EACR,WAAW,EACX,cAAc,EACd,WAAW,EACX,aAAa,EACb,eAAe,EACf,cAAc,EACd,YAAY,EACf,MAAM,sBAAsB,CAAC;AAI9B,MAAM,WAAW,gBAAgB,CAAC,CAAC;IAC/B,IAAI,EAAE,CAAC,CAAC;IACR,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,kGAAkG;IAClG,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,WAAW,CAAC,EAAE,OAAO,CAAC;CACzB;AAiED,eAAO,MAAM,QAAQ,GAAI,0CAA0C,gBAAgB,CAAC,YAAY,CAAC,sBAuDhG,CAAC;AAIF,eAAO,MAAM,OAAO,GAAI,0CAA0C,gBAAgB,CAAC,WAAW,CAAC,sBAmE9F,CAAC;AAIF,eAAO,MAAM,UAAU,GAAI,0CAA0C,gBAAgB,CAAC,cAAc,CAAC,sBAgGpG,CAAC;AAIF,eAAO,MAAM,WAAW,GAAI,kDAAkD,gBAAgB,CAAC,eAAe,CAAC,sBAyD9G,CAAC;AAIF,eAAO,MAAM,SAAS,GAAI,0CAA0C,gBAAgB,CAAC,aAAa,CAAC,sBAyFlG,CAAC;AAkBF,eAAO,MAAM,OAAO,GAAI,0CAA0C,gBAAgB,CAAC,WAAW,CAAC,sBAyD9F,CAAC;AAMF,eAAO,MAAM,UAAU,GAAI,kBAAkB;IAAE,IAAI,EAAE,cAAc,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,IAAI,CAAA;CAAE,sBA4FzF,CAAC"}
|
|
@@ -272,11 +272,13 @@ const GroundCard = ({
|
|
|
272
272
|
const ProductCard = ({
|
|
273
273
|
card,
|
|
274
274
|
onOpen,
|
|
275
|
+
onPick,
|
|
275
276
|
fullWidth,
|
|
276
277
|
highlighted
|
|
277
278
|
}) => React.createElement(CardShell, {
|
|
278
279
|
url: card.url,
|
|
279
280
|
onOpen: onOpen,
|
|
281
|
+
onPick: onPick,
|
|
280
282
|
label: card.accessibleLabel,
|
|
281
283
|
cardKey: card.key,
|
|
282
284
|
className: shellClass(fullWidth, highlighted, fullWidth ? '' : '!w-[min(15rem,70%)]')
|
|
@@ -319,7 +321,7 @@ const ProductCard = ({
|
|
|
319
321
|
className: "mt-auto flex items-center justify-between gap-2 pt-2 text-xs text-gray-500 dark:text-gray-400"
|
|
320
322
|
}, React.createElement("span", {
|
|
321
323
|
className: "truncate"
|
|
322
|
-
}, card.sourceLabel ?? ' '), card.url ? React.createElement(FiExternalLink, {
|
|
324
|
+
}, card.sourceLabel ?? ' '), card.url && !onPick ? React.createElement(FiExternalLink, {
|
|
323
325
|
className: "h-3.5 w-3.5 shrink-0 text-gray-400 group-hover/card:text-blue-500"
|
|
324
326
|
}) : null)));
|
|
325
327
|
// ─── Movies ──────────────────────────────────────────────────────
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ResultCards.js","sources":["../../../src/components/MessageWidgets/ResultCards.tsx"],"sourcesContent":[null],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ResultCards.js","sources":["../../../src/components/MessageWidgets/ResultCards.tsx"],"sourcesContent":[null],"names":[],"mappings":"29BAmCA,MAAM,UAAU,GAAG,CAAC,SAAmB,EAAE,WAAqB,EAAE,KAAK,GAAG,EAAE,KACtE,GAAG,iBAAiB,CAAA,CAAA,EAAI,gBAAgB,CAAC,WAAW,CAAC,CAAA,CAAA,EAAI,SAAS,GAAG,QAAQ,GAAG,MAAM,CAAA,CAAA,EAAI,KAAK,EAAE;AAErG,MAAM,MAAM,GAAG,CAAC;AAGJ,EAAA,IAAA;AACA,EAAA,OAAA;AACC,EAAA;;WAES,EAAA;QACD,CAAA,oBAAqB,EAAE;aAE/B;AAIb,CAAA,CAAA,EAAA,mBAAuB,CAAA;AAEf,EAAA,SAAA,EAAA;OACA,CAAA,EAAA,OAAA,GAAA,KAAA,CAAA,aAAM,CAAA,MAAU,EAAA;AACX,EAAA,SAAA,EAAK;QAKL,OAAK,EAAI,MAAM,GAAC,CAAA,CAAA,EAAA,MAAA,CAAA,CAAA,GAAA,EA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;AAIH,MAAA,SAAA,EAAK;oBAEO,MAAM,CAAA,WACP,IAAA,aAAA,EAAA,KAAK,cAAU,CAAC,cAClB,EAAA;iBACD;AAAmC,KAAA,CAAA,CAAA,CAAA;;gBAG5C,GAAA,CAAA,IAAA,CAAA,WAAA,EAAA,IAAK,CAAA,IAAA,CAAA,CAAA,MAAU,CAAA,OAAA,CAAA,CAAA,IAAA,CAAA,KAAA,CAAA,KAAA,IAAA,CAAA,IAAmC,KAAA,KAAA,GAAA,KAAA,GAAA,OAAA,CAAA;AAE7C,EAAA,OAAA,KAAA,CAAA;AAMQ,IAAA,GAAA,EAAA,IAAA,CAAA,GAAA;;gBAIR,eAAU;;yBAGH,CAAA,SAAA,EAAA,WAAC,EAAA,KAAc;wBAGf,CAAA,KAAK,EAAA;AAEL,IAAA,SAAA,EAAA;iCAGN,EAAE;AAKxB,IAAE,IAAA,EAAA,IAAA,CAAA,YAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -23,9 +23,16 @@ export declare const IN_ROW = "w-[min(18rem,82%)] shrink-0 snap-start";
|
|
|
23
23
|
* A card as a link to its seller when it has one, a button that opens the
|
|
24
24
|
* rail when it does not, and plain content when neither applies.
|
|
25
25
|
*/
|
|
26
|
-
export declare const CardShell: ({ url, onOpen, label, className, cardKey, children, }: {
|
|
26
|
+
export declare const CardShell: ({ url, onOpen, onPick, pickLabel, label, className, cardKey, children, }: {
|
|
27
27
|
url?: string;
|
|
28
28
|
onOpen?: () => void;
|
|
29
|
+
/**
|
|
30
|
+
* Answer the agent with this card (the host's `{ type: 'reply' }` action): the whole card is the
|
|
31
|
+
* button, and its page, when it has one, is a small link of its own in the corner.
|
|
32
|
+
*/
|
|
33
|
+
onPick?: () => void;
|
|
34
|
+
/** What the pick does, for the button's name: "Pick", "Book". */
|
|
35
|
+
pickLabel?: string;
|
|
29
36
|
label: string;
|
|
30
37
|
className: string;
|
|
31
38
|
cardKey: string;
|
|
@@ -39,6 +46,29 @@ export declare const SafeImage: ({ src, alt, className, fallback, fit, }: {
|
|
|
39
46
|
fallback: ReactNode;
|
|
40
47
|
fit?: "cover" | "contain";
|
|
41
48
|
}) => React.JSX.Element;
|
|
49
|
+
/**
|
|
50
|
+
* "Open in Travel" / "Open in Shopping": the same result set, on the vertical's own page.
|
|
51
|
+
* Icon-only on a narrow row so the title keeps its room.
|
|
52
|
+
*/
|
|
53
|
+
export declare const OpenAppButton: ({ app, onClick }: {
|
|
54
|
+
app: string;
|
|
55
|
+
onClick: () => void;
|
|
56
|
+
}) => React.JSX.Element;
|
|
57
|
+
/**
|
|
58
|
+
* The message a card hands `onMessageClick` for a second action on the same widget: the post
|
|
59
|
+
* with `props.widgetAction` set, so the host can tell "Open in app" from "View all".
|
|
60
|
+
*/
|
|
61
|
+
/**
|
|
62
|
+
* What a card asks its host to do: a named action ("open-app"), or a reply - the person's next turn,
|
|
63
|
+
* word for word, which the host sends as if typed (`message.props.cardReplies` says it will).
|
|
64
|
+
*/
|
|
65
|
+
export type WidgetAction = string | {
|
|
66
|
+
type: 'reply';
|
|
67
|
+
text: string;
|
|
68
|
+
};
|
|
69
|
+
export declare const withWidgetAction: <T extends {
|
|
70
|
+
props?: Record<string, unknown> | null;
|
|
71
|
+
}>(message: T, widgetAction: WidgetAction) => T;
|
|
42
72
|
export interface IResultRowProps {
|
|
43
73
|
icon: ReactNode;
|
|
44
74
|
title: string;
|
|
@@ -49,9 +79,13 @@ export interface IResultRowProps {
|
|
|
49
79
|
/** Opens the full list (the side rail). */
|
|
50
80
|
onViewAll?: () => void;
|
|
51
81
|
viewAllLabel?: string;
|
|
82
|
+
/** Opens the same results in the vertical's app (Travel, Shopping) - the host decides how. */
|
|
83
|
+
onOpenApp?: () => void;
|
|
84
|
+
/** The app's name, for "Open in {app}". */
|
|
85
|
+
appLabel?: string;
|
|
52
86
|
ariaLabel: string;
|
|
53
87
|
/** The cards; each must render through {@link CardShell} so quick picks can find it. */
|
|
54
88
|
children: (highlighted: string | null) => ReactNode;
|
|
55
89
|
}
|
|
56
|
-
export declare const ResultRow: ({ icon, title, subtitle, picks, count, onViewAll, viewAllLabel, ariaLabel, children, }: IResultRowProps) => React.JSX.Element;
|
|
90
|
+
export declare const ResultRow: ({ icon, title, subtitle, picks, count, onViewAll, viewAllLabel, onOpenApp, appLabel, ariaLabel, children, }: IResultRowProps) => React.JSX.Element;
|
|
57
91
|
//# sourceMappingURL=ResultRow.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ResultRow.d.ts","sourceRoot":"","sources":["../../../src/components/MessageWidgets/ResultRow.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAA4C,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"ResultRow.d.ts","sourceRoot":"","sources":["../../../src/components/MessageWidgets/ResultRow.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAA4C,MAAM,OAAO,CAAC;AAInF,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAEpE;;;;;GAKG;AAEH,eAAO,MAAM,WAAW,EAAE,MAAM,CAAC,WAAW,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAa3E,CAAC;AAIF,eAAO,MAAM,eAAe,GAAI,qBAA6B;IAAE,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AC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAA;CAAE,EACjF,SAAS,CAAC,EACV,cAAc,YAAY,KAC3B,CAGD,CAAC;AAEH,MAAM,WAAW,eAAe;IAC5B,IAAI,EAAE,SAAS,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,UAAU,EAAE,CAAC;IACrB,yDAAyD;IACzD,KAAK,EAAE,MAAM,CAAC;IACd,2CAA2C;IAC3C,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,8FAA8F;IAC9F,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,2CAA2C;IAC3C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,wFAAwF;IACxF,QAAQ,EAAE,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,KAAK,SAAS,CAAC;CACvD;AAID,eAAO,MAAM,SAAS,GAAI,6GAYvB,eAAe,sBAqIjB,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React,{useRef,useState,useCallback,useEffect}from'react';import {FiChevronLeft}from'@react-icons/all-files/fi/FiChevronLeft.js';import {FiChevronRight}from'@react-icons/all-files/fi/FiChevronRight.js';/**
|
|
1
|
+
import React,{useRef,useState,useCallback,useEffect}from'react';import {FiChevronLeft}from'@react-icons/all-files/fi/FiChevronLeft.js';import {FiChevronRight}from'@react-icons/all-files/fi/FiChevronRight.js';import {FiExternalLink}from'@react-icons/all-files/fi/FiExternalLink.js';/**
|
|
2
2
|
* The frame every list-shaped chat widget shares (stays, cars, trains, buses,
|
|
3
3
|
* products, showtimes, jobs): the result set named once, quick picks that
|
|
4
4
|
* jump to their card, and a swipeable row with the next card peeking in.
|
|
@@ -41,6 +41,8 @@ const IN_ROW = 'w-[min(18rem,82%)] shrink-0 snap-start';
|
|
|
41
41
|
const CardShell = ({
|
|
42
42
|
url,
|
|
43
43
|
onOpen,
|
|
44
|
+
onPick,
|
|
45
|
+
pickLabel = 'Pick',
|
|
44
46
|
label,
|
|
45
47
|
className,
|
|
46
48
|
cardKey,
|
|
@@ -52,6 +54,31 @@ const CardShell = ({
|
|
|
52
54
|
'data-result-card': '',
|
|
53
55
|
'data-result-key': cardKey
|
|
54
56
|
};
|
|
57
|
+
if (onPick) {
|
|
58
|
+
// The button is stretched under the content, so the page link above it stays its own
|
|
59
|
+
// control - never a link nested in a button.
|
|
60
|
+
return React.createElement("div", {
|
|
61
|
+
className: `${className} focus-within:ring-2 focus-within:ring-blue-500 focus-within:ring-offset-2 dark:focus-within:ring-offset-gray-900`,
|
|
62
|
+
"data-result-card": "",
|
|
63
|
+
"data-result-key": cardKey
|
|
64
|
+
}, React.createElement("button", {
|
|
65
|
+
type: "button",
|
|
66
|
+
onClick: onPick,
|
|
67
|
+
"aria-label": `${pickLabel}: ${label}`,
|
|
68
|
+
className: "absolute inset-0 z-[1] rounded-2xl focus-visible:outline-none"
|
|
69
|
+
}), React.createElement("div", {
|
|
70
|
+
className: "pointer-events-none relative flex flex-1 flex-col"
|
|
71
|
+
}, children), url && /^https?:\/\//i.test(url) ? React.createElement("a", {
|
|
72
|
+
href: url,
|
|
73
|
+
target: "_blank",
|
|
74
|
+
rel: "noopener noreferrer",
|
|
75
|
+
"aria-label": "Open its page",
|
|
76
|
+
title: "Open its page",
|
|
77
|
+
className: "absolute right-2.5 top-2.5 z-[2] flex h-7 w-7 items-center justify-center rounded-full bg-white/90 text-gray-500 shadow-sm ring-1 ring-gray-200 transition hover:text-blue-600 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 dark:bg-gray-800/90 dark:ring-gray-700"
|
|
78
|
+
}, React.createElement(FiExternalLink, {
|
|
79
|
+
className: "h-3.5 w-3.5"
|
|
80
|
+
})) : null);
|
|
81
|
+
}
|
|
55
82
|
if (url && /^https?:\/\//i.test(url)) {
|
|
56
83
|
return React.createElement("a", {
|
|
57
84
|
href: url,
|
|
@@ -93,6 +120,31 @@ const SafeImage = ({
|
|
|
93
120
|
})
|
|
94
121
|
);
|
|
95
122
|
};
|
|
123
|
+
/**
|
|
124
|
+
* "Open in Travel" / "Open in Shopping": the same result set, on the vertical's own page.
|
|
125
|
+
* Icon-only on a narrow row so the title keeps its room.
|
|
126
|
+
*/
|
|
127
|
+
const OpenAppButton = ({
|
|
128
|
+
app,
|
|
129
|
+
onClick
|
|
130
|
+
}) => React.createElement("button", {
|
|
131
|
+
type: "button",
|
|
132
|
+
onClick: onClick,
|
|
133
|
+
title: `Open in ${app}`,
|
|
134
|
+
"aria-label": `Open these results in ${app}`,
|
|
135
|
+
className: "inline-flex shrink-0 items-center gap-1 rounded-full border border-gray-200 px-2.5 py-1 text-xs font-semibold text-gray-700 transition hover:border-blue-300 hover:bg-blue-50/60 hover:text-blue-700 dark:border-gray-700 dark:text-gray-200 dark:hover:border-blue-500/60 dark:hover:bg-blue-500/10 dark:hover:text-blue-300"
|
|
136
|
+
}, React.createElement(FiExternalLink, {
|
|
137
|
+
className: "h-3.5 w-3.5"
|
|
138
|
+
}), React.createElement("span", {
|
|
139
|
+
className: "hidden sm:inline"
|
|
140
|
+
}, "Open in ", app));
|
|
141
|
+
const withWidgetAction = (message, widgetAction) => ({
|
|
142
|
+
...message,
|
|
143
|
+
props: {
|
|
144
|
+
...(message?.props ?? {}),
|
|
145
|
+
widgetAction
|
|
146
|
+
}
|
|
147
|
+
});
|
|
96
148
|
const HIGHLIGHT_MS = 1600;
|
|
97
149
|
const ResultRow = ({
|
|
98
150
|
icon,
|
|
@@ -102,6 +154,8 @@ const ResultRow = ({
|
|
|
102
154
|
count,
|
|
103
155
|
onViewAll,
|
|
104
156
|
viewAllLabel,
|
|
157
|
+
onOpenApp,
|
|
158
|
+
appLabel,
|
|
105
159
|
ariaLabel,
|
|
106
160
|
children
|
|
107
161
|
}) => {
|
|
@@ -170,13 +224,18 @@ const ResultRow = ({
|
|
|
170
224
|
className: "truncate text-sm font-semibold leading-5 text-gray-900 dark:text-gray-50"
|
|
171
225
|
}, title), subtitle ? React.createElement("p", {
|
|
172
226
|
className: "truncate text-xs leading-4 text-gray-500 dark:text-gray-400"
|
|
173
|
-
}, subtitle) : null)),
|
|
227
|
+
}, subtitle) : null)), React.createElement("div", {
|
|
228
|
+
className: "flex shrink-0 items-center gap-1"
|
|
229
|
+
}, onOpenApp && appLabel ? React.createElement(OpenAppButton, {
|
|
230
|
+
app: appLabel,
|
|
231
|
+
onClick: onOpenApp
|
|
232
|
+
}) : null, onViewAll && count > 1 ? React.createElement("button", {
|
|
174
233
|
type: "button",
|
|
175
234
|
onClick: onViewAll,
|
|
176
235
|
className: "inline-flex shrink-0 items-center gap-0.5 rounded-full px-2.5 py-1 text-xs font-semibold text-blue-600 transition hover:bg-blue-50 dark:text-blue-400 dark:hover:bg-blue-500/10"
|
|
177
236
|
}, viewAllLabel || `View all ${count}`, React.createElement(FiChevronRight, {
|
|
178
237
|
className: "h-3.5 w-3.5"
|
|
179
|
-
})) : null), picks.length > 0 ? React.createElement("div", {
|
|
238
|
+
})) : null)), picks.length > 0 ? React.createElement("div", {
|
|
180
239
|
className: "mx-2 mb-2 flex flex-wrap gap-1.5",
|
|
181
240
|
"aria-label": "Quick picks"
|
|
182
241
|
}, picks.map(p => React.createElement("button", {
|
|
@@ -213,4 +272,4 @@ const ResultRow = ({
|
|
|
213
272
|
}, React.createElement(FiChevronRight, {
|
|
214
273
|
className: "h-5 w-5"
|
|
215
274
|
}))));
|
|
216
|
-
};export{BADGE_STYLE,CardShell,IN_ROW,RESULT_CARD_CLASS,ResultBadgePill,ResultRow,SafeImage,resultCardBorder};//# sourceMappingURL=ResultRow.js.map
|
|
275
|
+
};export{BADGE_STYLE,CardShell,IN_ROW,OpenAppButton,RESULT_CARD_CLASS,ResultBadgePill,ResultRow,SafeImage,resultCardBorder,withWidgetAction};//# sourceMappingURL=ResultRow.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ResultRow.js","sources":["../../../src/components/MessageWidgets/ResultRow.tsx"],"sourcesContent":[null],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ResultRow.js","sources":["../../../src/components/MessageWidgets/ResultRow.tsx"],"sourcesContent":[null],"names":[],"mappings":"yRAMA;;;;;AAKG;AAEI,MAAM,WAAW,GAAwD;AAC5E,EAAA,QAAA,EAAQ;AACJ,IAAA,IAAA,EAAA,uHAAM;AACN,IAAA,IAAA,EAAA;AACH,GAAA;AACD,EAAA,OAAA,EAAO;AACH,IAAA,IAAA,EAAA,iHAAM;AACN,IAAA,IAAA,EAAA;AACH,GAAA;AACD,EAAA,WAAA,EAAW;AACP,IAAA,IAAA,EAAA,2GAAM;AACN,IAAA,IAAA,EAAA;AACH;;AAGL,MAAM,UAAU,GAAgC;AAEhD,EAAA,oBAAa;AAUb,EAAA,OAAA,EAAA,SAAA;AACA,EAAA,WAAa,EAAA;;AAGT,MAAA,eAAA,GAAA,CAAA;AACA,EAAA,KAAA;AAEJ,EAAA,WAAa;AAEL,CAAA,KAAE,KAAA,CAAA,aAAA,CAAA,MAAA,EAAA;+HACuC,EAAA,WAAA,CAAA,KAAA,CAAA,CAAA,IAAA,CAAA,CAAA,EAAA,QAAA,GAAA,yBAAA,GAAA,EAAA,CAAA;AAEjD,CAAA,EAAA,UAAA,CAAA,KAAA,CAAA;AACA;AAEA,MAAA,iBAAA,GAAA,gIAAA,GAAA,wFAAA,GAAA,0GAAA,GAAA;;;AAGG,MAAA,MAAA,GAAA;AACH;AAwBI;;;AAGI,MAAA,SAAA,GAAA,CAAA;;AAOQ,EAAA,MAAA;AAMA,EAAA,MAAA;AACC,EAAA,SAAA,GAAA,MAAO;AASA,EAAA,KAAA;WAKnB;SACG;AACA,EAAA;MAKH;QACG,MAAM,GAAG;AACT,IAAA,YACI,EAAA,KAAA;IAIR,SAAC;IACD,kBACI,EAAA,EAAA;AAIR,IAAE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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -24,5 +24,6 @@ export type { IMessageConnectorProps } from './MessageConnector';
|
|
|
24
24
|
export { MessageResults, MessageShopping, MessageMovies, MessageJobs, MessageResume, ResultCardList, VERTICALS, RESULT_SORT_LABELS, travelVertical, resultSummaryOf, resultIconOf, } from './MessageResults';
|
|
25
25
|
export type { ResultVertical, IMessageResultsProps, IResultCardListProps, IMessageVerticalProps, } from './MessageResults';
|
|
26
26
|
export { StayCard, CarCard, GroundCard, ProductCard, MovieCard, JobCard, ResumeCard } from './ResultCards';
|
|
27
|
-
export { ResultRow } from './ResultRow';
|
|
27
|
+
export { OpenAppButton, ResultRow, withWidgetAction } from './ResultRow';
|
|
28
|
+
export type { WidgetAction } from './ResultRow';
|
|
28
29
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/MessageWidgets/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,YAAY,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AACrE,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,YAAY,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,YAAY,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,YAAY,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,YAAY,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAA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,MAAM,oBAAoB,CAAC;AACjE,OAAO,EACH,cAAc,EACd,eAAe,EACf,aAAa,EACb,WAAW,EACX,aAAa,EACb,cAAc,EACd,SAAS,EACT,kBAAkB,EAClB,cAAc,EACd,eAAe,EACf,YAAY,GACf,MAAM,kBAAkB,CAAC;AAC1B,YAAY,EACR,cAAc,EACd,oBAAoB,EACpB,oBAAoB,EACpB,qBAAqB,GACxB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3G,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AACzE,YAAY,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC"}
|
package/lib/index.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export { feature as default } from './module';
|
|
2
2
|
export { parseWidgetPost } from './utils/parseWidgetPost';
|
|
3
3
|
export { MessageFlights, FlightCardList, FlightCard } from './components/MessageWidgets/MessageFlights';
|
|
4
|
+
export { MessageBooking } from './components/MessageWidgets/MessageBooking';
|
|
5
|
+
export type { IMessageBookingProps } from './components/MessageWidgets/MessageBooking';
|
|
4
6
|
export type { IMessageFlightsProps, IFlightCardListProps, IFlightCardProps, } from './components/MessageWidgets/MessageFlights';
|
|
5
7
|
export type { TravelAttachmentsInterface, TravelPropertyItem, TravelFlightDetails, TravelFlightSlice, } from './interfaces';
|
|
6
8
|
export { MessageResults, MessageShopping, MessageMovies, MessageJobs, MessageResume, ResultCardList, RESULT_SORT_LABELS, VERTICALS, travelVertical, resultSummaryOf, resultIconOf, } from './components/MessageWidgets/MessageResults';
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,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,EAC1B,kBAAkB,EAClB,mBAAmB,EACnB,iBAAiB,GACpB,MAAM,cAAc,CAAC;AACtB,OAAO,EACH,cAAc,EACd,eAAe,EACf,aAAa,EACb,WAAW,EACX,aAAa,EACb,cAAc,EACd,kBAAkB,EAClB,SAAS,EACT,cAAc,EACd,eAAe,EACf,YAAY,GACf,MAAM,4CAA4C,CAAC;AACpD,YAAY,EACR,cAAc,EACd,oBAAoB,EACpB,oBAAoB,EACpB,qBAAqB,GACxB,MAAM,4CAA4C,CAAC;AACpD,OAAO,EACH,QAAQ,EACR,OAAO,EACP,UAAU,EACV,WAAW,EACX,SAAS,EACT,OAAO,EACP,UAAU,GACb,MAAM,yCAAyC,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,uCAAuC,CAAC"}
|
package/lib/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{feature as default}from'./module.js';export{parseWidgetPost}from'./utils/parseWidgetPost.js';export{FlightCard,FlightCardList,MessageFlights}from'./components/MessageWidgets/MessageFlights.js';export{MessageJobs,MessageMovies,MessageResults,MessageResume,MessageShopping,RESULT_SORT_LABELS,ResultCardList,VERTICALS,resultIconOf,resultSummaryOf,travelVertical}from'./components/MessageWidgets/MessageResults.js';export{CarCard,GroundCard,JobCard,MovieCard,ProductCard,ResumeCard,StayCard}from'./components/MessageWidgets/ResultCards.js';export{ResultRow}from'./components/MessageWidgets/ResultRow.js';//# sourceMappingURL=index.js.map
|
|
1
|
+
export{feature as default}from'./module.js';export{parseWidgetPost}from'./utils/parseWidgetPost.js';export{FlightCard,FlightCardList,MessageFlights}from'./components/MessageWidgets/MessageFlights.js';export{MessageBooking}from'./components/MessageWidgets/MessageBooking.js';export{MessageJobs,MessageMovies,MessageResults,MessageResume,MessageShopping,RESULT_SORT_LABELS,ResultCardList,VERTICALS,resultIconOf,resultSummaryOf,travelVertical}from'./components/MessageWidgets/MessageResults.js';export{CarCard,GroundCard,JobCard,MovieCard,ProductCard,ResumeCard,StayCard}from'./components/MessageWidgets/ResultCards.js';export{ResultRow}from'./components/MessageWidgets/ResultRow.js';//# sourceMappingURL=index.js.map
|
package/lib/module.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../src/module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../src/module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAqBrD,eAAO,MAAM,OAAO,SAqDlB,CAAC"}
|
package/lib/module.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {Feature}from'@common-stack/client-react';import {PostTypeEnum}from'common';import {MessageAiAssistantFill}from'./slot-fill/message-ai-assistant-fill.js';import {MessageThinkingFill}from'./slot-fill/message-thinking-fill.js';import {MessageCodeBlockFill}from'./slot-fill/message-codeblock-fill.js';import {MessageToolUseFill}from'./slot-fill/message-tooluse-fill.js';import {MessageServiceFill}from'./slot-fill/message-service-fill.js';import {MessageMediaFill}from'./slot-fill/message-media-fill.js';import {MessageTravelFill}from'./slot-fill/message-travel-fill.js';import {MessageWorkflowFill}from'./slot-fill/message-workflow-fill.js';import {MessageGenericFill}from'./slot-fill/message-generic-fill.js';import {MessageConnectorFill}from'./slot-fill/message-connector-fill.js';import {ChatSettingsFill}from'./slot-fill/chat-settings-fill.js';import {MessageShoppingFill}from'./slot-fill/message-shopping-fill.js';import {MessageMoviesFill}from'./slot-fill/message-movies-fill.js';import {MessageJobsFill}from'./slot-fill/message-jobs-fill.js';import {MessageResumeFill}from'./slot-fill/message-resume-fill.js';const feature = new Feature({
|
|
1
|
+
import {Feature}from'@common-stack/client-react';import {PostTypeEnum}from'common';import {MessageAiAssistantFill}from'./slot-fill/message-ai-assistant-fill.js';import {MessageThinkingFill}from'./slot-fill/message-thinking-fill.js';import {MessageCodeBlockFill}from'./slot-fill/message-codeblock-fill.js';import {MessageToolUseFill}from'./slot-fill/message-tooluse-fill.js';import {MessageServiceFill}from'./slot-fill/message-service-fill.js';import {MessageMediaFill}from'./slot-fill/message-media-fill.js';import {MessageTravelFill}from'./slot-fill/message-travel-fill.js';import {MessageWorkflowFill}from'./slot-fill/message-workflow-fill.js';import {MessageGenericFill}from'./slot-fill/message-generic-fill.js';import {MessageConnectorFill}from'./slot-fill/message-connector-fill.js';import {ChatSettingsFill}from'./slot-fill/chat-settings-fill.js';import {MessageShoppingFill}from'./slot-fill/message-shopping-fill.js';import {MessageMoviesFill}from'./slot-fill/message-movies-fill.js';import {MessageJobsFill}from'./slot-fill/message-jobs-fill.js';import {MessageResumeFill}from'./slot-fill/message-resume-fill.js';import {MessageBookingFill}from'./slot-fill/message-booking-fill.js';const feature = new Feature({
|
|
2
2
|
componentFillPlugins: [{
|
|
3
3
|
name: PostTypeEnum.Aiassistant.toLowerCase(),
|
|
4
4
|
render: MessageAiAssistantFill
|
|
@@ -41,6 +41,11 @@ import {Feature}from'@common-stack/client-react';import {PostTypeEnum}from'commo
|
|
|
41
41
|
}, {
|
|
42
42
|
name: 'resume',
|
|
43
43
|
render: MessageResumeFill
|
|
44
|
+
},
|
|
45
|
+
// Any widget card gets a slot named after it, so a new card is only a Fill here.
|
|
46
|
+
{
|
|
47
|
+
name: 'booking',
|
|
48
|
+
render: MessageBookingFill
|
|
44
49
|
}, {
|
|
45
50
|
name: 'chat-settings',
|
|
46
51
|
render: ChatSettingsFill
|
package/lib/module.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module.js","sources":["../src/module.ts"],"sourcesContent":[null],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"module.js","sources":["../src/module.ts"],"sourcesContent":[null],"names":[],"mappings":"sqCAqBO,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC;AAC/B,EAAA,oBAAA,EAAoB,CAAA;AAChB,IAAA,IAAA,EAAA,YAAA,CAAA,WAAA,CAAA,WAAA,EAAA;AACI,IAAA,MAAA,EAAA;AACA,GAAA,EAAA;AACH,IAAA,IAAA,EAAA,UAAA;AACD,IAAA,MAAA,EAAA;AACI,GAAA,EAAA;AACA,IAAA,IAAA,EAAA,WAAQ;AACX,IAAA,MAAA,EAAA;AACD,GAAA,EAAA;AACI,IAAA,IAAA,EAAA,SAAM;AACN,IAAA,MAAA,EAAA;AACH,GAAA,EAAA;AACD,IAAA,IAAA,EAAA,YAAA,CAAA,OAAA,CAAA,WAAA,EAAA;AACI,IAAA,MAAA,EAAA;AACA,GAAA,EAAA;AACH,IAAA,IAAA,EAAA,OAAA;AACD,IAAA,MAAA,EAAA;AACI,GAAA,EAAA;AACA,IAAA,IAAA,EAAA,QAAM;AACT,IAAA,MAAA,EAAA;AACD,GAAA,EAAA;AACI,IAAA,IAAA,EAAA,UAAM;AACN,IAAA,MAAA,EAAA;AACH,GAAA,EAAA;AACD,IAAA,IAAA,EAAA,SAAA;AACI,IAAA,MAAA,EAAA;AACA,GAAA,EAAA;AACH,IAAA,IAAA,EAAA,WAAA;AACD,IAAA,MAAA,EAAA;AACI,GAAA,EAAA;AACA,IAAA,IAAA,EAAA,UAAQ;AACX,IAAA,MAAA,EAAA;AACD,GAAA,EAAA;AACI,IAAA,IAAA,EAAA,QAAM;AACN,IAAA,MAAA,EAAA;AACH,GAAA,EAAA;AACD,IAAA,IAAA,EAAA,MAAA;AACI,IAAA,MAAA,EAAA;AACA,GAAA,EAAA;AACH,IAAA,IAAA,EAAA,QAAA;AACD,IAAA,MAAE;AACF,GAAA;AACA;AACA,EAAA;QACA,EAAA,SAAA;AACA,IAAA,MAAE;AACF,GAAA,EAAA;AACI,IAAA,IAAA,EAAA,eAAM;AACN,IAAA,MAAA,EAAA;AACH,GAAA;AACJ,CAAA"}
|
package/lib/slot-fill/index.d.ts
CHANGED
|
@@ -13,4 +13,5 @@ export { MessageShoppingFill } from './message-shopping-fill';
|
|
|
13
13
|
export { MessageMoviesFill } from './message-movies-fill';
|
|
14
14
|
export { MessageJobsFill } from './message-jobs-fill';
|
|
15
15
|
export { MessageResumeFill } from './message-resume-fill';
|
|
16
|
+
export { MessageBookingFill } from './message-booking-fill';
|
|
16
17
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/slot-fill/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/slot-fill/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Fill name: "booking" - the summary the agent shows before it books or buys. The bubble gives every
|
|
4
|
+
* widget card a slot named after it (getMessageSlotName), so this needs no entry in its list.
|
|
5
|
+
*/
|
|
6
|
+
export declare const MessageBookingFill: () => React.JSX.Element;
|
|
7
|
+
//# sourceMappingURL=message-booking-fill.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"message-booking-fill.d.ts","sourceRoot":"","sources":["../../src/slot-fill/message-booking-fill.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B;;;GAGG;AACH,eAAO,MAAM,kBAAkB,yBAI9B,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from'react';import {Fill}from'@common-stack/components-pro';import {MessageBooking}from'../components/MessageWidgets/MessageBooking.js';/**
|
|
2
|
+
* Fill name: "booking" - the summary the agent shows before it books or buys. The bubble gives every
|
|
3
|
+
* widget card a slot named after it (getMessageSlotName), so this needs no entry in its list.
|
|
4
|
+
*/
|
|
5
|
+
const MessageBookingFill = () => React.createElement(Fill, {
|
|
6
|
+
name: "booking"
|
|
7
|
+
}, props => props.active ? React.createElement(MessageBooking, {
|
|
8
|
+
...props
|
|
9
|
+
}) : null);export{MessageBookingFill};//# sourceMappingURL=message-booking-fill.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"message-booking-fill.js","sources":["../../src/slot-fill/message-booking-fill.tsx"],"sourcesContent":[null],"names":[],"mappings":"qJAIA;;;AAGG;AACI,MAAM,kBAAkB,GAAG,MAAM,KACpC,CAAA,aAAA,CAAA,IAAC;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@admin-layout/ai-chat-ext-browser",
|
|
3
|
-
"version": "12.2.5-alpha.
|
|
3
|
+
"version": "12.2.5-alpha.27",
|
|
4
4
|
"description": "AI Chat extension for Messenger - supports AI assistant, thinking, code blocks, tool use, and service messages",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"author": "CDMBase LLC",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"watch": "npm run build:lib:watch"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@admin-layout/client": "12.2.5-alpha.
|
|
24
|
+
"@admin-layout/client": "12.2.5-alpha.27",
|
|
25
25
|
"@admin-layout/connector-widgets-browser": "12.2.5-alpha.2",
|
|
26
26
|
"@react-icons/all-files": "^4.1.0",
|
|
27
27
|
"html-react-parser": "^3.0.1"
|
|
@@ -41,5 +41,5 @@
|
|
|
41
41
|
"typescript": {
|
|
42
42
|
"definition": "lib/index.d.ts"
|
|
43
43
|
},
|
|
44
|
-
"gitHead": "
|
|
44
|
+
"gitHead": "2d8af32aaf824c047e7767cc4c9ae97bb1115f64"
|
|
45
45
|
}
|