@admin-layout/ai-chat-ext-browser 12.2.5-alpha.2 → 12.2.5-alpha.6
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/MessageFlights.d.ts +18 -4
- package/lib/components/MessageWidgets/MessageFlights.d.ts.map +1 -1
- package/lib/components/MessageWidgets/MessageFlights.js +192 -64
- package/lib/components/MessageWidgets/MessageFlights.js.map +1 -1
- package/lib/components/MessageWidgets/index.d.ts +2 -2
- package/lib/components/MessageWidgets/index.d.ts.map +1 -1
- package/lib/components/index.d.ts +1 -1
- package/lib/components/index.d.ts.map +1 -1
- package/lib/index.d.ts +2 -2
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -1
- package/package.json +3 -3
|
@@ -1,24 +1,38 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { IPost } from 'common';
|
|
3
3
|
import { TravelAttachmentsInterface } from '../../interfaces';
|
|
4
|
+
import { FlightCardView, FlightSort } from '@admin-layout/client';
|
|
4
5
|
export interface IMessageFlightsProps {
|
|
5
6
|
message: IPost;
|
|
6
7
|
attachment: TravelAttachmentsInterface;
|
|
7
8
|
/** Opens the full result set in the travel side panel. */
|
|
8
9
|
onMessageClick?: (ref: IPost) => void;
|
|
9
10
|
}
|
|
11
|
+
export interface IFlightCardProps {
|
|
12
|
+
card: FlightCardView;
|
|
13
|
+
onOpen?: () => void;
|
|
14
|
+
fullWidth?: boolean;
|
|
15
|
+
/** Show the departure date on the card (offers on different dates, or a round trip). */
|
|
16
|
+
showDate?: boolean;
|
|
17
|
+
/** Briefly outlined, e.g. after a quick-pick chip jumped to it. */
|
|
18
|
+
highlighted?: boolean;
|
|
19
|
+
}
|
|
20
|
+
export declare const FlightCard: ({ card, onOpen, fullWidth, showDate, highlighted, }: IFlightCardProps) => React.JSX.Element;
|
|
10
21
|
export interface IFlightCardListProps {
|
|
11
22
|
attachment: TravelAttachmentsInterface;
|
|
12
23
|
/** Fired by a card with no seller link; omit it to render such cards as plain content. */
|
|
13
24
|
onOpen?: () => void;
|
|
25
|
+
/** Ordering; `recommended` (default) keeps the agent's order. */
|
|
26
|
+
sort?: FlightSort;
|
|
14
27
|
}
|
|
15
28
|
/** Every flight as a full-width vertical list, for a side panel or a results page. */
|
|
16
|
-
export declare const FlightCardList: ({ attachment, onOpen }: IFlightCardListProps) => React.JSX.Element;
|
|
29
|
+
export declare const FlightCardList: ({ attachment, onOpen, sort }: IFlightCardListProps) => React.JSX.Element;
|
|
17
30
|
/**
|
|
18
31
|
* Flight results as a swipeable row of cards: one card per offer, the next
|
|
19
|
-
* one peeking in so the row reads as scrollable.
|
|
20
|
-
*
|
|
21
|
-
*
|
|
32
|
+
* one peeking in so the row reads as scrollable. Above it, the route and date
|
|
33
|
+
* once, and quick picks (cheapest, fastest, best value) that jump to their
|
|
34
|
+
* card. Touch swipes and snaps; a pointer gets arrow buttons, since sideways
|
|
35
|
+
* scrolling is awkward with a mouse.
|
|
22
36
|
*/
|
|
23
37
|
export declare const MessageFlights: ({ message, attachment, onMessageClick }: IMessageFlightsProps) => React.JSX.Element;
|
|
24
38
|
//# sourceMappingURL=MessageFlights.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MessageFlights.d.ts","sourceRoot":"","sources":["../../../src/components/MessageWidgets/MessageFlights.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
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;AAC/B,OAAO,EAAE,0BAA0B,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EAEH,cAAc,EAEd,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;AAqHD,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;CACzB;AAED,eAAO,MAAM,UAAU,GAAI,qDAMxB,gBAAgB,sBAoGlB,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,sBA8J3F,CAAC"}
|
|
@@ -1,62 +1,127 @@
|
|
|
1
|
-
import React,{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 {toFlightCards}from'@admin-layout/client'
|
|
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 tile colours for the airline monogram, indexed by `airlineTone`. */
|
|
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
|
+
const BADGE = {
|
|
4
|
+
cheapest: {
|
|
5
|
+
label: 'Cheapest',
|
|
6
|
+
pill: 'bg-emerald-50 text-emerald-700 ring-emerald-200 dark:bg-emerald-500/15 dark:text-emerald-300 dark:ring-emerald-500/30',
|
|
7
|
+
text: 'text-emerald-600 dark:text-emerald-400'
|
|
8
|
+
},
|
|
9
|
+
fastest: {
|
|
10
|
+
label: 'Fastest',
|
|
11
|
+
pill: 'bg-violet-50 text-violet-700 ring-violet-200 dark:bg-violet-500/15 dark:text-violet-300 dark:ring-violet-500/30',
|
|
12
|
+
text: 'text-violet-600 dark:text-violet-400'
|
|
13
|
+
},
|
|
14
|
+
best: {
|
|
15
|
+
label: 'Best value',
|
|
16
|
+
pill: 'bg-blue-50 text-blue-700 ring-blue-200 dark:bg-blue-500/15 dark:text-blue-300 dark:ring-blue-500/30',
|
|
17
|
+
text: 'text-blue-600 dark:text-blue-400'
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
const BadgePill = ({
|
|
21
|
+
badge
|
|
22
|
+
}) => React.createElement("span", {
|
|
23
|
+
className: `inline-flex shrink-0 items-center rounded-full px-2 py-0.5 text-[11px] font-semibold leading-4 ring-1 ring-inset ${BADGE[badge].pill}`
|
|
24
|
+
}, BADGE[badge].label);
|
|
25
|
+
/**
|
|
26
|
+
* The route between the two times: duration above, a line with one amber dot
|
|
27
|
+
* per stop and the plane at the arrival end, stops below.
|
|
28
|
+
*/
|
|
29
|
+
const RouteLine = ({
|
|
2
30
|
slice
|
|
3
31
|
}) => {
|
|
32
|
+
const stops = slice.stopCount ?? 0;
|
|
4
33
|
return React.createElement("div", {
|
|
5
|
-
className: "
|
|
6
|
-
}, React.createElement("div", null, React.createElement("p", {
|
|
7
|
-
className: "text-2xl font-bold leading-none tracking-tight tabular-nums text-gray-900 dark:text-gray-50"
|
|
8
|
-
}, slice.departTime ?? '--:--'), React.createElement("p", {
|
|
9
|
-
className: "mt-1.5 text-sm text-gray-500 dark:text-gray-400"
|
|
10
|
-
}, slice.origin)), React.createElement("div", {
|
|
11
|
-
className: "flex min-w-0 flex-col items-center",
|
|
34
|
+
className: "flex min-w-0 flex-col items-center self-center px-1",
|
|
12
35
|
"aria-hidden": "true"
|
|
13
|
-
}, React.createElement("
|
|
14
|
-
className: "
|
|
36
|
+
}, React.createElement("p", {
|
|
37
|
+
className: "text-[11px] font-medium leading-4 text-gray-500 dark:text-gray-400"
|
|
38
|
+
}, slice.duration ?? ' '), React.createElement("div", {
|
|
39
|
+
className: "my-1 flex w-full items-center"
|
|
15
40
|
}, React.createElement("span", {
|
|
16
|
-
className: "h-
|
|
17
|
-
}), React.createElement(FaPlane, {
|
|
18
|
-
className: "h-3.5 w-3.5 shrink-0 text-blue-500"
|
|
41
|
+
className: "h-1.5 w-1.5 shrink-0 rounded-full border border-gray-400 bg-white dark:border-gray-500 dark:bg-gray-800"
|
|
19
42
|
}), React.createElement("span", {
|
|
20
|
-
className: "h-px flex-1
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
},
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}
|
|
30
|
-
className: "
|
|
31
|
-
},
|
|
43
|
+
className: "relative h-px flex-1 bg-gray-300 dark:bg-gray-600"
|
|
44
|
+
}, Array.from({
|
|
45
|
+
length: stops
|
|
46
|
+
}, (_, i) => React.createElement("span", {
|
|
47
|
+
key: i,
|
|
48
|
+
className: "absolute top-1/2 h-1.5 w-1.5 -translate-x-1/2 -translate-y-1/2 rounded-full bg-amber-400 ring-2 ring-white dark:ring-gray-800",
|
|
49
|
+
style: {
|
|
50
|
+
left: `${(i + 1) / (stops + 1) * 100}%`
|
|
51
|
+
}
|
|
52
|
+
}))), React.createElement(FaPlane, {
|
|
53
|
+
className: "ml-0.5 h-3 w-3 shrink-0 text-blue-500 dark:text-blue-400"
|
|
54
|
+
})), React.createElement("p", {
|
|
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
|
+
}, slice.stops ?? ' '));
|
|
32
57
|
};
|
|
33
|
-
const
|
|
34
|
-
|
|
58
|
+
const SliceRow = ({
|
|
59
|
+
slice,
|
|
60
|
+
caption
|
|
61
|
+
}) => React.createElement("div", null, caption ? React.createElement("p", {
|
|
62
|
+
className: "mb-1.5 text-[11px] font-semibold uppercase tracking-wide text-gray-400 dark:text-gray-500"
|
|
63
|
+
}, caption) : null, React.createElement("div", {
|
|
64
|
+
className: "grid grid-cols-[auto_1fr_auto] items-center gap-2"
|
|
65
|
+
}, React.createElement("div", null, React.createElement("p", {
|
|
66
|
+
className: "text-[22px] font-bold leading-none tracking-tight tabular-nums text-gray-900 dark:text-gray-50"
|
|
67
|
+
}, slice.departTime ?? '--:--'), React.createElement("p", {
|
|
68
|
+
className: "mt-1.5 text-xs font-medium text-gray-500 dark:text-gray-400"
|
|
69
|
+
}, slice.origin)), React.createElement(RouteLine, {
|
|
70
|
+
slice: slice
|
|
71
|
+
}), React.createElement("div", {
|
|
72
|
+
className: "text-right"
|
|
73
|
+
}, React.createElement("p", {
|
|
74
|
+
className: "text-[22px] font-bold leading-none tracking-tight tabular-nums text-gray-900 dark:text-gray-50"
|
|
75
|
+
}, slice.arriveTime ?? '--:--', slice.dayOffset ? React.createElement("sup", {
|
|
76
|
+
className: "ml-0.5 text-[11px] font-semibold text-amber-600 dark:text-amber-400"
|
|
77
|
+
}, slice.dayOffset) : null), React.createElement("p", {
|
|
78
|
+
className: "mt-1.5 text-xs font-medium text-gray-500 dark:text-gray-400"
|
|
79
|
+
}, slice.destination))));
|
|
80
|
+
const CARD_CLASS = 'group/card relative flex flex-col rounded-2xl border bg-white p-4 text-left shadow-sm transition-all duration-200 ' + 'hover:-translate-y-0.5 hover:border-blue-300 hover:shadow-lg hover:shadow-blue-500/10 ' + 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2 ' + 'dark:bg-gray-800 dark:hover:border-blue-500/60 dark:hover:shadow-black/30 dark:focus-visible:ring-offset-gray-900';
|
|
81
|
+
const IN_ROW = 'w-[min(20rem,85%)] shrink-0 snap-start';
|
|
35
82
|
const FlightCard = ({
|
|
36
83
|
card,
|
|
37
84
|
onOpen,
|
|
38
|
-
fullWidth = false
|
|
85
|
+
fullWidth = false,
|
|
86
|
+
showDate = false,
|
|
87
|
+
highlighted = false
|
|
39
88
|
}) => {
|
|
40
|
-
const className = `${CARD_CLASS} ${fullWidth ? 'w-full' : IN_ROW}`;
|
|
89
|
+
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
|
+
const subtitle = [card.flightNumber, card.cabin].filter(Boolean).join(' · ') || (card.roundTrip ? 'Round trip' : 'One way');
|
|
91
|
+
const captionFor = (s, i) => {
|
|
92
|
+
if (card.roundTrip) return [i === 0 ? 'Outbound' : 'Return', s.date].filter(Boolean).join(' · ');
|
|
93
|
+
return showDate ? s.date : undefined;
|
|
94
|
+
};
|
|
41
95
|
const body = React.createElement(React.Fragment, null, React.createElement("div", {
|
|
42
|
-
className: "flex items-center gap-2"
|
|
43
|
-
},
|
|
96
|
+
className: "flex items-center gap-2.5"
|
|
97
|
+
}, React.createElement("span", {
|
|
44
98
|
"aria-hidden": "true",
|
|
45
|
-
className:
|
|
46
|
-
}, card.
|
|
47
|
-
className: "
|
|
48
|
-
},
|
|
49
|
-
className: "
|
|
99
|
+
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]}`
|
|
100
|
+
}, card.airlineCode), React.createElement("div", {
|
|
101
|
+
className: "min-w-0 flex-1"
|
|
102
|
+
}, React.createElement("p", {
|
|
103
|
+
className: "truncate text-sm font-semibold leading-5 text-gray-900 dark:text-gray-50"
|
|
104
|
+
}, card.airline ?? card.footer), React.createElement("p", {
|
|
105
|
+
className: "truncate text-xs leading-4 text-gray-500 dark:text-gray-400"
|
|
106
|
+
}, subtitle)), card.badges[0] ? React.createElement(BadgePill, {
|
|
107
|
+
badge: card.badges[0]
|
|
108
|
+
}) : null), React.createElement("div", {
|
|
109
|
+
className: "my-4 space-y-4"
|
|
50
110
|
}, card.slices.map((s, i) => React.createElement(SliceRow, {
|
|
51
111
|
key: i,
|
|
52
|
-
slice: s
|
|
112
|
+
slice: s,
|
|
113
|
+
caption: captionFor(s, i)
|
|
53
114
|
}))), React.createElement("div", {
|
|
54
115
|
className: "mt-auto flex items-center justify-between gap-3 border-t border-gray-100 pt-3 dark:border-gray-700"
|
|
55
116
|
}, React.createElement("p", {
|
|
56
|
-
className: "min-w-0 truncate text-
|
|
57
|
-
}, card.
|
|
58
|
-
className: "shrink-0
|
|
59
|
-
}, card.price
|
|
117
|
+
className: "min-w-0 truncate text-xs text-gray-500 dark:text-gray-400"
|
|
118
|
+
}, card.seller ? `via ${card.seller}` : card.roundTrip ? 'Round trip' : card.slices[0].stops ?? ''), React.createElement("span", {
|
|
119
|
+
className: "flex shrink-0 items-center gap-1.5"
|
|
120
|
+
}, card.price ? React.createElement("span", {
|
|
121
|
+
className: "text-lg font-bold leading-none tabular-nums text-gray-900 dark:text-white"
|
|
122
|
+
}, card.price) : null, card.url ? React.createElement(FiExternalLink, {
|
|
123
|
+
className: "h-3.5 w-3.5 text-gray-400 transition-colors group-hover/card:text-blue-500"
|
|
124
|
+
}) : null)));
|
|
60
125
|
// A bookable offer goes straight to the seller; without a link the card
|
|
61
126
|
// opens the full results in the side panel instead.
|
|
62
127
|
if (card.url) {
|
|
@@ -66,7 +131,8 @@ const FlightCard = ({
|
|
|
66
131
|
rel: "noopener noreferrer",
|
|
67
132
|
"aria-label": card.accessibleLabel,
|
|
68
133
|
className: className,
|
|
69
|
-
"data-flight-card": ""
|
|
134
|
+
"data-flight-card": "",
|
|
135
|
+
"data-flight-key": card.key
|
|
70
136
|
}, body);
|
|
71
137
|
}
|
|
72
138
|
if (!onOpen) {
|
|
@@ -75,7 +141,8 @@ const FlightCard = ({
|
|
|
75
141
|
role: "group",
|
|
76
142
|
"aria-label": card.accessibleLabel,
|
|
77
143
|
className: className,
|
|
78
|
-
"data-flight-card": ""
|
|
144
|
+
"data-flight-card": "",
|
|
145
|
+
"data-flight-key": card.key
|
|
79
146
|
}, body);
|
|
80
147
|
}
|
|
81
148
|
return React.createElement("button", {
|
|
@@ -83,44 +150,53 @@ const FlightCard = ({
|
|
|
83
150
|
onClick: onOpen,
|
|
84
151
|
"aria-label": card.accessibleLabel,
|
|
85
152
|
className: className,
|
|
86
|
-
"data-flight-card": ""
|
|
153
|
+
"data-flight-card": "",
|
|
154
|
+
"data-flight-key": card.key
|
|
87
155
|
}, body);
|
|
88
156
|
};
|
|
89
157
|
/** Every flight as a full-width vertical list, for a side panel or a results page. */
|
|
90
158
|
const FlightCardList = ({
|
|
91
159
|
attachment,
|
|
92
|
-
onOpen
|
|
160
|
+
onOpen,
|
|
161
|
+
sort = 'recommended'
|
|
93
162
|
}) => {
|
|
94
|
-
const cards = toFlightCards(attachment);
|
|
163
|
+
const cards = useMemo(() => toFlightCards(attachment), [attachment]);
|
|
164
|
+
const summary = useMemo(() => flightResultSummary(attachment, cards), [attachment, cards]);
|
|
165
|
+
const ordered = useMemo(() => sortFlightCards(cards, sort), [cards, sort]);
|
|
95
166
|
if (cards.length === 0) return null;
|
|
96
167
|
return React.createElement("ul", {
|
|
97
168
|
className: "space-y-3",
|
|
98
169
|
"aria-label": attachment.title || 'Flight options'
|
|
99
|
-
},
|
|
170
|
+
}, ordered.map(c => React.createElement("li", {
|
|
100
171
|
key: c.key
|
|
101
172
|
}, React.createElement(FlightCard, {
|
|
102
173
|
card: c,
|
|
103
174
|
onOpen: onOpen,
|
|
104
|
-
fullWidth: true
|
|
175
|
+
fullWidth: true,
|
|
176
|
+
showDate: !summary.sameDate
|
|
105
177
|
}))));
|
|
106
178
|
};
|
|
179
|
+
const HIGHLIGHT_MS = 1600;
|
|
107
180
|
/**
|
|
108
181
|
* Flight results as a swipeable row of cards: one card per offer, the next
|
|
109
|
-
* one peeking in so the row reads as scrollable.
|
|
110
|
-
*
|
|
111
|
-
*
|
|
182
|
+
* one peeking in so the row reads as scrollable. Above it, the route and date
|
|
183
|
+
* once, and quick picks (cheapest, fastest, best value) that jump to their
|
|
184
|
+
* card. Touch swipes and snaps; a pointer gets arrow buttons, since sideways
|
|
185
|
+
* scrolling is awkward with a mouse.
|
|
112
186
|
*/
|
|
113
187
|
const MessageFlights = ({
|
|
114
188
|
message,
|
|
115
189
|
attachment,
|
|
116
190
|
onMessageClick
|
|
117
191
|
}) => {
|
|
118
|
-
const cards = toFlightCards(attachment);
|
|
192
|
+
const cards = useMemo(() => toFlightCards(attachment), [attachment]);
|
|
193
|
+
const summary = useMemo(() => flightResultSummary(attachment, cards), [attachment, cards]);
|
|
119
194
|
const rowRef = useRef(null);
|
|
120
195
|
const [edges, setEdges] = useState({
|
|
121
196
|
atStart: true,
|
|
122
197
|
atEnd: true
|
|
123
198
|
});
|
|
199
|
+
const [highlighted, setHighlighted] = useState(null);
|
|
124
200
|
const measure = useCallback(() => {
|
|
125
201
|
const el = rowRef.current;
|
|
126
202
|
if (!el) return;
|
|
@@ -137,6 +213,11 @@ const MessageFlights = ({
|
|
|
137
213
|
ro.observe(el);
|
|
138
214
|
return () => ro.disconnect();
|
|
139
215
|
}, [measure, cards.length]);
|
|
216
|
+
useEffect(() => {
|
|
217
|
+
if (!highlighted) return undefined;
|
|
218
|
+
const t = setTimeout(() => setHighlighted(null), HIGHLIGHT_MS);
|
|
219
|
+
return () => clearTimeout(t);
|
|
220
|
+
}, [highlighted]);
|
|
140
221
|
if (cards.length === 0) return null;
|
|
141
222
|
const step = dir => {
|
|
142
223
|
const el = rowRef.current;
|
|
@@ -147,15 +228,66 @@ const MessageFlights = ({
|
|
|
147
228
|
behavior: 'smooth'
|
|
148
229
|
});
|
|
149
230
|
};
|
|
231
|
+
const jumpTo = key => {
|
|
232
|
+
const el = rowRef.current;
|
|
233
|
+
const card = el?.querySelector(`[data-flight-key="${CSS.escape(key)}"]`);
|
|
234
|
+
if (!el || !card) return;
|
|
235
|
+
// 8px: the row's px-2, so the card lands where the first one sits.
|
|
236
|
+
el.scrollTo({
|
|
237
|
+
left: card.offsetLeft - 8,
|
|
238
|
+
behavior: 'smooth'
|
|
239
|
+
});
|
|
240
|
+
setHighlighted(key);
|
|
241
|
+
};
|
|
150
242
|
const open = () => onMessageClick?.(message);
|
|
151
|
-
const count =
|
|
152
|
-
const
|
|
243
|
+
const count = summary.count;
|
|
244
|
+
const title = summary.route ?? attachment.title ?? 'Flights';
|
|
245
|
+
const subtitle = [summary.date, `${count} ${count === 1 ? 'flight' : 'flights'}`, summary.fromPrice ? `from ${summary.fromPrice}` : undefined, summary.seller].filter(Boolean).join(' · ');
|
|
246
|
+
const picks = cards.length > 2 ? summary.picks : [];
|
|
247
|
+
// Arrows sit over the first and last visible card, so they show on hover or
|
|
248
|
+
// keyboard focus only; the next card peeking in already says the row scrolls.
|
|
249
|
+
const arrow = 'absolute top-1/2 z-10 hidden h-9 w-9 -translate-y-1/2 items-center justify-center rounded-full border border-gray-200 bg-white/95 text-gray-700 shadow-md transition hover:bg-white ' + 'opacity-0 group-hover/row:opacity-100 focus-visible:opacity-100 disabled:pointer-events-none disabled:!opacity-0 [@media(pointer:fine)]:flex ' + 'dark:border-gray-600 dark:bg-gray-800/95 dark:text-gray-200';
|
|
153
250
|
return React.createElement("div", {
|
|
154
251
|
className: "my-2 w-full",
|
|
155
252
|
role: "group",
|
|
156
253
|
"aria-label": attachment.title || 'Flight options'
|
|
157
254
|
}, React.createElement("div", {
|
|
158
|
-
className: "
|
|
255
|
+
className: "mx-2 mb-2 flex items-center justify-between gap-3"
|
|
256
|
+
}, React.createElement("div", {
|
|
257
|
+
className: "flex min-w-0 items-center gap-2.5"
|
|
258
|
+
}, React.createElement("span", {
|
|
259
|
+
"aria-hidden": "true",
|
|
260
|
+
className: "flex h-9 w-9 shrink-0 items-center justify-center rounded-xl bg-blue-50 text-blue-600 dark:bg-blue-500/15 dark:text-blue-300"
|
|
261
|
+
}, React.createElement(FaPlane, {
|
|
262
|
+
className: "h-4 w-4"
|
|
263
|
+
})), React.createElement("div", {
|
|
264
|
+
className: "min-w-0"
|
|
265
|
+
}, React.createElement("p", {
|
|
266
|
+
className: "truncate text-sm font-semibold leading-5 text-gray-900 dark:text-gray-50"
|
|
267
|
+
}, title), React.createElement("p", {
|
|
268
|
+
className: "truncate text-xs leading-4 text-gray-500 dark:text-gray-400"
|
|
269
|
+
}, subtitle))), onMessageClick && count > 1 ? React.createElement("button", {
|
|
270
|
+
type: "button",
|
|
271
|
+
onClick: open,
|
|
272
|
+
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"
|
|
273
|
+
}, "View all ", count, React.createElement(FiChevronRight, {
|
|
274
|
+
className: "h-3.5 w-3.5"
|
|
275
|
+
})) : null), picks.length > 0 ? React.createElement("div", {
|
|
276
|
+
className: "mx-2 mb-2 flex flex-wrap gap-1.5",
|
|
277
|
+
"aria-label": "Quick picks"
|
|
278
|
+
}, picks.map(p => React.createElement("button", {
|
|
279
|
+
key: p.badge,
|
|
280
|
+
type: "button",
|
|
281
|
+
onClick: () => jumpTo(p.key),
|
|
282
|
+
className: "inline-flex items-center gap-1.5 rounded-full border border-gray-200 bg-white px-2.5 py-1 text-xs transition hover:border-blue-300 hover:bg-blue-50/60 dark:border-gray-700 dark:bg-gray-800 dark:hover:border-blue-500/60 dark:hover:bg-blue-500/10"
|
|
283
|
+
}, React.createElement("span", {
|
|
284
|
+
className: `font-semibold ${BADGE[p.badge].text}`
|
|
285
|
+
}, p.label), React.createElement("span", {
|
|
286
|
+
className: "font-semibold tabular-nums text-gray-900 dark:text-gray-50"
|
|
287
|
+
}, p.badge === 'fastest' ? p.duration ?? p.price : p.price), p.airline ? React.createElement("span", {
|
|
288
|
+
className: "truncate text-gray-500 dark:text-gray-400"
|
|
289
|
+
}, "\u00B7 ", p.airline) : null))) : null, React.createElement("div", {
|
|
290
|
+
className: "group/row relative"
|
|
159
291
|
}, React.createElement("div", {
|
|
160
292
|
ref: rowRef,
|
|
161
293
|
onScroll: measure,
|
|
@@ -166,7 +298,9 @@ const MessageFlights = ({
|
|
|
166
298
|
}, cards.map(c => React.createElement(FlightCard, {
|
|
167
299
|
key: c.key,
|
|
168
300
|
card: c,
|
|
169
|
-
onOpen: open
|
|
301
|
+
onOpen: open,
|
|
302
|
+
showDate: !summary.sameDate,
|
|
303
|
+
highlighted: highlighted === c.key
|
|
170
304
|
}))), React.createElement("button", {
|
|
171
305
|
type: "button",
|
|
172
306
|
"aria-label": "Previous flights",
|
|
@@ -183,11 +317,5 @@ const MessageFlights = ({
|
|
|
183
317
|
className: `${arrow} right-0`
|
|
184
318
|
}, React.createElement(FiChevronRight, {
|
|
185
319
|
className: "h-5 w-5"
|
|
186
|
-
})))
|
|
187
|
-
|
|
188
|
-
onClick: open,
|
|
189
|
-
className: "mx-2 mt-1 inline-flex items-center gap-1 text-sm font-medium text-blue-600 hover:underline dark:text-blue-400"
|
|
190
|
-
}, attachment.actionLabel || `View all ${count} flights`, React.createElement(FiChevronRight, {
|
|
191
|
-
className: "h-4 w-4"
|
|
192
|
-
})) : null);
|
|
193
|
-
};export{FlightCardList,MessageFlights};//# sourceMappingURL=MessageFlights.js.map
|
|
320
|
+
}))));
|
|
321
|
+
};export{FlightCard,FlightCardList,MessageFlights};//# sourceMappingURL=MessageFlights.js.map
|
|
@@ -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":"ibAwBA;AACA,MAAM,KAAK,GAAG,CAAA,8DAAA,EAAA,0EAAA,EAAA,8EAAA,EAAA,sEAAA,EAAA,kEAAA,EAAA,0EAAA,EAAA,kEAAA,EAAA,0EAAA,CAAA;MACV,KAAA,GAAA;UACA,EAAA;IACA,KAAA,EAAA,UAAA;IACA,IAAA,EAAA,uHAAsE;IACtE,IAAA,EAAA;;SAEA,EAAA;IACA,KAAA,EAAA,SAAA;IACF,IAAA,EAAA,iHAAA;AAEF,IAAA;AACI,GAAA;AACI,EAAA,IAAA,EAAA;AACA,IAAA,KAAA,EAAA,YAAM;AACN,IAAA,IAAA,EAAA,qGAA8C;AACjD,IAAA,IAAA,EAAA;AACD;AACI,CAAA;AACA,MAAA,SAAM,GAAA,CAAA;AACN,EAAA;AACH,CAAA,KAAA,KAAA,CAAA,aAAA,CAAA,MAAA,EAAA;AACD,EAAA,SAAM,EAAA,CAAA,iHAAA,EAAA,KAAA,CAAA,KAAA,CAAA,CAAA,IAAA,CAAA;AACF,CAAA,EAAA,KAAA,CAAA,MAAO,CAAA,KAAA,CAAA;AACP;AAC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AA,CAAA,EAAA,CAAA,UAAA,CAAA,CAAA;AACf,EAAA,MAAA,OAAA,GAAA,OAAA,CAAA,MAAA,mBAAe,CAAA,UAAC,EAAS,KAAC,CAAA,EAAA,CAAA,UAEjC,EAAE,KAAK,CACN,CAAA;QAEL,MAAM,SAAS,CAAC,IACb,CAAA;AAQY,EAAA,MAAA,CAAA,KAAA,EAAA,QAAA,CAAA,GAAA,QAAA,CAAA;aACA,IAAA;;;AAImE,EAAA,MAAA,CAAA,WAAE,EAAA,cAG5E,CAAC,GAER,QAAM,CAAA,IAAA,CAAA;QAER,OAAA,GAAA,WAAA,CAAA,MAAA;AACI,IAAA,MAAA,EAAA,GAAA,MAAA,CAAA,OAAA;;;iBAKI,CAAA,UAAA,IAAA,CAAA;gBACA,UAAS;;AAmBT,EAAA,CAAA,EAAA,EAAA,CAAA;YAEJ,MAAA;;AAYhB,IAAE,MAAA,EAAA,GAAA,MAAA,CAAA,OAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -13,8 +13,8 @@ export type { IMessageMediaProps } from './MessageMedia';
|
|
|
13
13
|
export { MessageTravel } from './MessageTravel';
|
|
14
14
|
export type { IMessageTravelProps } from './MessageTravel';
|
|
15
15
|
export { MessageFlights } from './MessageFlights';
|
|
16
|
-
export { FlightCardList } from './MessageFlights';
|
|
17
|
-
export type { IMessageFlightsProps, IFlightCardListProps } from './MessageFlights';
|
|
16
|
+
export { FlightCardList, FlightCard } from './MessageFlights';
|
|
17
|
+
export type { IMessageFlightsProps, IFlightCardListProps, IFlightCardProps } from './MessageFlights';
|
|
18
18
|
export { MessageWorkflow } from './MessageWorkflow';
|
|
19
19
|
export type { IMessageWorkflowProps } from './MessageWorkflow';
|
|
20
20
|
export { MessageGeneric } from './MessageGeneric';
|
|
@@ -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,CAAC;AAC7D,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,YAAY,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,YAAY,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;
|
|
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,CAAC;AAC7D,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,YAAY,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,YAAY,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9D,YAAY,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACrG,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,YAAY,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,YAAY,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,YAAY,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { MessageAiAssistant, MessageThinking, MessageCodeBlock, MessageToolUse, MessageService, MessageMedia, MessageTravel, MessageWorkflow, MessageGeneric, MessageConnector, MessageFlights, FlightCardList, } from './MessageWidgets';
|
|
2
|
-
export type { IMessageFlightsProps, IFlightCardListProps } from './MessageWidgets';
|
|
2
|
+
export type { IMessageFlightsProps, IFlightCardListProps, IFlightCardProps } from './MessageWidgets';
|
|
3
3
|
export { ChatSettingsPanel, ConnectedChatSettingsPanel } from './ChatSettingsPanel';
|
|
4
4
|
export type { ChatSettingsPanelProps, SettingsEntry, ConnectedChatSettingsPanelProps } from './ChatSettingsPanel';
|
|
5
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,kBAAkB,EAClB,eAAe,EACf,gBAAgB,EAChB,cAAc,EACd,cAAc,EACd,YAAY,EACZ,aAAa,EACb,eAAe,EACf,cAAc,EACd,gBAAgB,EAChB,cAAc,EACd,cAAc,GACjB,MAAM,kBAAkB,CAAC;AAC1B,YAAY,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,kBAAkB,EAClB,eAAe,EACf,gBAAgB,EAChB,cAAc,EACd,cAAc,EACd,YAAY,EACZ,aAAa,EACb,eAAe,EACf,cAAc,EACd,gBAAgB,EAChB,cAAc,EACd,cAAc,GACjB,MAAM,kBAAkB,CAAC;AAC1B,YAAY,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACrG,OAAO,EAAE,iBAAiB,EAAE,0BAA0B,EAAE,MAAM,qBAAqB,CAAC;AACpF,YAAY,EAAE,sBAAsB,EAAE,aAAa,EAAE,+BAA+B,EAAE,MAAM,qBAAqB,CAAC"}
|
package/lib/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { feature as default } from './module';
|
|
2
2
|
export { parseWidgetPost } from './utils/parseWidgetPost';
|
|
3
|
-
export { MessageFlights, FlightCardList } from './components/MessageWidgets/MessageFlights';
|
|
4
|
-
export type { IMessageFlightsProps, IFlightCardListProps } from './components/MessageWidgets/MessageFlights';
|
|
3
|
+
export { MessageFlights, FlightCardList, FlightCard } from './components/MessageWidgets/MessageFlights';
|
|
4
|
+
export type { IMessageFlightsProps, IFlightCardListProps, IFlightCardProps, } from './components/MessageWidgets/MessageFlights';
|
|
5
5
|
export type { TravelAttachmentsInterface, TravelPropertyItem, TravelFlightDetails, TravelFlightSlice, } from './interfaces';
|
|
6
6
|
//# sourceMappingURL=index.d.ts.map
|
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,OAAO,IAAI,OAAO,EAAE,MAAM,UAAU,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,4CAA4C,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,UAAU,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,4CAA4C,CAAC;AACxG,YAAY,EACR,oBAAoB,EACpB,oBAAoB,EACpB,gBAAgB,GACnB,MAAM,4CAA4C,CAAC;AACpD,YAAY,EACR,0BAA0B,EAC1B,kBAAkB,EAClB,mBAAmB,EACnB,iBAAiB,GACpB,MAAM,cAAc,CAAC"}
|
package/lib/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{feature as default}from'./module.js';export{parseWidgetPost}from'./utils/parseWidgetPost.js';export{FlightCardList,MessageFlights}from'./components/MessageWidgets/MessageFlights.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';//# sourceMappingURL=index.js.map
|
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.6",
|
|
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.6",
|
|
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": "39fe142eb31f78df53a5de2963fcae009d3c9fbd"
|
|
45
45
|
}
|