@admin-layout/ai-chat-ext-browser 12.2.4-alpha.81 → 12.2.4-alpha.83
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.
|
@@ -7,11 +7,8 @@ export interface IMessageTravelProps {
|
|
|
7
7
|
onMessageClick?: (ref: IPost) => void;
|
|
8
8
|
}
|
|
9
9
|
/**
|
|
10
|
-
* Travel listings card —
|
|
11
|
-
*
|
|
12
|
-
* range; clicking opens the full results in the travel side panel
|
|
13
|
-
* (via `onMessageClick`). The listings themselves live on the message's
|
|
14
|
-
* propsConfiguration, so they persist with the chat.
|
|
10
|
+
* Travel listings card — summary + property rows from yantra-resortifi connector results.
|
|
11
|
+
* Clicking opens the full results on the travel page (via `onMessageClick`).
|
|
15
12
|
*/
|
|
16
13
|
export declare const MessageTravel: (props: IMessageTravelProps) => React.JSX.Element;
|
|
17
14
|
//# sourceMappingURL=MessageTravel.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MessageTravel.d.ts","sourceRoot":"","sources":["../../../src/components/MessageWidgets/MessageTravel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAG/B,MAAM,WAAW,mBAAmB;IAChC,OAAO,EAAE,KAAK,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,iFAAiF;IACjF,cAAc,CAAC,EAAE,CAAC,GAAG,EAAE,KAAK,KAAK,IAAI,CAAC;CACzC;
|
|
1
|
+
{"version":3,"file":"MessageTravel.d.ts","sourceRoot":"","sources":["../../../src/components/MessageWidgets/MessageTravel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAG/B,MAAM,WAAW,mBAAmB;IAChC,OAAO,EAAE,KAAK,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,iFAAiF;IACjF,cAAc,CAAC,EAAE,CAAC,GAAG,EAAE,KAAK,KAAK,IAAI,CAAC;CACzC;AAuBD;;;GAGG;AACH,eAAO,MAAM,aAAa,GAAI,OAAO,mBAAmB,sBAuHvD,CAAC"}
|
|
@@ -1,4 +1,11 @@
|
|
|
1
|
-
import React from'react';import {FiMapPin}from'@react-icons/all-files/fi/FiMapPin.js';import {FiStar}from'@react-icons/all-files/fi/FiStar.js';import {FiChevronRight}from'@react-icons/all-files/fi/FiChevronRight.js';const
|
|
1
|
+
import React from'react';import {FiMapPin}from'@react-icons/all-files/fi/FiMapPin.js';import {FiStar}from'@react-icons/all-files/fi/FiStar.js';import {FiChevronRight}from'@react-icons/all-files/fi/FiChevronRight.js';const LIST_PREVIEW = 5;
|
|
2
|
+
const formatPrice = p => p.priceLabel ?? (typeof p.price === 'number' ? `$${Math.round(p.price)}` : undefined);
|
|
3
|
+
const formatSource = source => {
|
|
4
|
+
if (!source) return undefined;
|
|
5
|
+
if (source === 'resortifi') return 'Resortifi';
|
|
6
|
+
return source.charAt(0).toUpperCase() + source.slice(1);
|
|
7
|
+
};
|
|
8
|
+
const priceRange = a => {
|
|
2
9
|
const prices = (a.properties ?? []).map(p => p.price).filter(n => typeof n === 'number' && Number.isFinite(n));
|
|
3
10
|
const from = a.priceFrom ?? (prices.length ? Math.min(...prices) : undefined);
|
|
4
11
|
const to = a.priceTo ?? (prices.length ? Math.max(...prices) : undefined);
|
|
@@ -6,11 +13,8 @@ import React from'react';import {FiMapPin}from'@react-icons/all-files/fi/FiMapPi
|
|
|
6
13
|
return to != null && to !== from ? `$${Math.round(from)}–$${Math.round(to)}` : `$${Math.round(from)}`;
|
|
7
14
|
};
|
|
8
15
|
/**
|
|
9
|
-
* Travel listings card —
|
|
10
|
-
*
|
|
11
|
-
* range; clicking opens the full results in the travel side panel
|
|
12
|
-
* (via `onMessageClick`). The listings themselves live on the message's
|
|
13
|
-
* propsConfiguration, so they persist with the chat.
|
|
16
|
+
* Travel listings card — summary + property rows from yantra-resortifi connector results.
|
|
17
|
+
* Clicking opens the full results on the travel page (via `onMessageClick`).
|
|
14
18
|
*/
|
|
15
19
|
const MessageTravel = props => {
|
|
16
20
|
const {
|
|
@@ -30,11 +34,10 @@ const MessageTravel = props => {
|
|
|
30
34
|
const range = priceRange(attachment);
|
|
31
35
|
const actionLabel = attachment.actionLabel || 'View stays';
|
|
32
36
|
const thumbs = properties.filter(p => p.imageUrl).slice(0, 4);
|
|
37
|
+
const listItems = properties.slice(0, LIST_PREVIEW);
|
|
33
38
|
const open = () => onMessageClick?.(message);
|
|
34
|
-
return React.createElement("
|
|
35
|
-
|
|
36
|
-
onClick: open,
|
|
37
|
-
className: "my-2 mx-2 w-[calc(100%-1rem)] text-left rounded-xl border border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800/60 hover:border-blue-400 dark:hover:border-blue-500 hover:shadow-sm transition-colors overflow-hidden"
|
|
39
|
+
return React.createElement("div", {
|
|
40
|
+
className: "my-2 mx-2 w-[calc(100%-1rem)] rounded-xl border border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800/60 overflow-hidden"
|
|
38
41
|
}, thumbs.length > 0 && React.createElement("div", {
|
|
39
42
|
className: "flex gap-0.5"
|
|
40
43
|
}, thumbs.map((p, i) =>
|
|
@@ -45,8 +48,12 @@ const MessageTravel = props => {
|
|
|
45
48
|
alt: p.title,
|
|
46
49
|
className: "h-24 flex-1 object-cover",
|
|
47
50
|
loading: "lazy"
|
|
48
|
-
}))), React.createElement("
|
|
49
|
-
|
|
51
|
+
}))), React.createElement("button", {
|
|
52
|
+
type: "button",
|
|
53
|
+
onClick: open,
|
|
54
|
+
className: "w-full text-left hover:bg-gray-50 dark:hover:bg-gray-800/80 transition-colors"
|
|
55
|
+
}, React.createElement("div", {
|
|
56
|
+
className: "flex items-center gap-3 p-3 border-b border-gray-100 dark:border-gray-700/80"
|
|
50
57
|
}, React.createElement("div", {
|
|
51
58
|
className: "flex-shrink-0 text-blue-500"
|
|
52
59
|
}, React.createElement(FiMapPin, {
|
|
@@ -57,13 +64,47 @@ const MessageTravel = props => {
|
|
|
57
64
|
className: "text-sm font-semibold text-gray-900 dark:text-gray-100 truncate"
|
|
58
65
|
}, title), React.createElement("p", {
|
|
59
66
|
className: "mt-0.5 text-xs text-gray-500 dark:text-gray-400"
|
|
60
|
-
}, count, " ", count === 1 ? 'stay' : 'stays', range ? ` · ${range}/night` : '',
|
|
61
|
-
className: "inline-flex items-center gap-0.5 ml-1"
|
|
62
|
-
}, "\u00B7 ", React.createElement(FiStar, {
|
|
63
|
-
className: "w-3 h-3 text-amber-400"
|
|
64
|
-
}), " ", properties[0].rating) : null)), React.createElement("span", {
|
|
67
|
+
}, count, " ", count === 1 ? 'stay' : 'stays', range ? ` · ${range}/night` : '')), React.createElement("span", {
|
|
65
68
|
className: "flex-shrink-0 inline-flex items-center gap-1 text-xs font-medium text-blue-600 dark:text-blue-400"
|
|
66
69
|
}, actionLabel, " ", React.createElement(FiChevronRight, {
|
|
67
70
|
className: "w-4 h-4"
|
|
68
|
-
}))))
|
|
71
|
+
})))), React.createElement("ul", {
|
|
72
|
+
className: "divide-y divide-gray-100 dark:divide-gray-700/80"
|
|
73
|
+
}, listItems.map((p, i) => {
|
|
74
|
+
const price = formatPrice(p);
|
|
75
|
+
const unit = p.priceUnit ?? 'night';
|
|
76
|
+
const source = formatSource(p.source);
|
|
77
|
+
return React.createElement("li", {
|
|
78
|
+
key: p.id ?? i
|
|
79
|
+
}, React.createElement("button", {
|
|
80
|
+
type: "button",
|
|
81
|
+
onClick: open,
|
|
82
|
+
className: "w-full flex items-center gap-3 p-3 text-left hover:bg-gray-50 dark:hover:bg-gray-800/80 transition-colors"
|
|
83
|
+
}, p.imageUrl ?
|
|
84
|
+
// eslint-disable-next-line @next/next/no-img-element
|
|
85
|
+
React.createElement("img", {
|
|
86
|
+
src: p.imageUrl,
|
|
87
|
+
alt: "",
|
|
88
|
+
className: "h-12 w-12 rounded-lg object-cover flex-shrink-0",
|
|
89
|
+
loading: "lazy"
|
|
90
|
+
}) : React.createElement("div", {
|
|
91
|
+
className: "h-12 w-12 rounded-lg bg-gray-100 dark:bg-gray-700 flex-shrink-0"
|
|
92
|
+
}), React.createElement("div", {
|
|
93
|
+
className: "flex-1 min-w-0"
|
|
94
|
+
}, React.createElement("p", {
|
|
95
|
+
className: "text-sm font-medium text-gray-900 dark:text-gray-100 line-clamp-2"
|
|
96
|
+
}, p.title), React.createElement("p", {
|
|
97
|
+
className: "mt-0.5 text-xs text-gray-500 dark:text-gray-400 flex flex-wrap items-center gap-x-1.5 gap-y-0.5"
|
|
98
|
+
}, price ? React.createElement("span", {
|
|
99
|
+
className: "font-medium text-gray-700 dark:text-gray-300"
|
|
100
|
+
}, price, "/", unit) : null, typeof p.rating === 'number' ? React.createElement("span", {
|
|
101
|
+
className: "inline-flex items-center gap-0.5"
|
|
102
|
+
}, React.createElement(FiStar, {
|
|
103
|
+
className: "w-3 h-3 text-amber-400"
|
|
104
|
+
}), p.rating.toFixed(1)) : null, source ? React.createElement("span", null, "via ", source) : null))));
|
|
105
|
+
})), count > LIST_PREVIEW ? React.createElement("button", {
|
|
106
|
+
type: "button",
|
|
107
|
+
onClick: open,
|
|
108
|
+
className: "w-full py-2.5 text-xs font-medium text-blue-600 dark:text-blue-400 hover:bg-gray-50 dark:hover:bg-gray-800/80 border-t border-gray-100 dark:border-gray-700/80"
|
|
109
|
+
}, "View all ", count, " stays") : null);
|
|
69
110
|
};export{MessageTravel};//# sourceMappingURL=MessageTravel.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MessageTravel.js","sources":["../../../src/components/MessageWidgets/MessageTravel.tsx"],"sourcesContent":[null],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"MessageTravel.js","sources":["../../../src/components/MessageWidgets/MessageTravel.tsx"],"sourcesContent":[null],"names":[],"mappings":"wNAcA,MAAM,YAAY,GAAG,CAAC;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KAAA;yCACA;;;;;;wBAMC,CAAA,KAAA,EAAW;;wBAAE,CAAA,KAAA,EAAA;AAK1B,IAAA,SAAA,EAAA;AAEQ,GAAA,EAAA,KAAA,CAAA,aAAW,CAAA,QAAG,EAAA;AACd,IAAA,SAAA,EAAA;YACA,CAAA,cAAe,KAAA,EAAA;aACf,EAAA;wBAEQ,CAAA,GAAA,EAAA;AAKK,IAAA,SAAA,EAAA;gCACG,CAAA,GAAA,EAAA;AACA,IAAA,SAAA,EAAA;sBASJ,KAAA,CAAA,GAAA,MAAA,GAAA,OAAA,EAAK,KAAA,GAAA,CAAS,GAAC,EAAA,KAAA,CAAA,MAAA,CAAgB,GAAA,EAAA,CAAA,CAAA,EAAA,KAAA,CAAA,aAAA,CAAA,MAAA,EAAA;AAC3B,IAAA,SAAA,EAAA;4BAGA,CAAA,aAAA,CAAA,cAAG,EAAA;AACE,IAAA,SAAA,EAAA;iCAEQ,EAAA;;AAAQ,GAAA,EAAA,SAAA,CAAA,GAAA,CAAA,CAAA,CAAA,EAAA,CAAA,KAAA;AAGhB,IAAA,MAAA,KAAA,GAAA,WAAA,CAAA,CAAA,CAAA;AAEO,IAAA,MAAA,IAAA,GAAA,CAAA,CAAA,SAAA,IAAA,OAAA;AACC,IAAA,MAAA,MAAA,GAAA,YAAA,CAAA,CAAC,CAAC,MAAM,CAAC;8BAGjB,CAAA,IAAO,EAAE;;mCAAW,EAAA;AAM7C,MAAA,IAAE,EACD,QAAA;AAEJ,MAAA,OAAK,MAAG;;iBAMc;AACV;AAIzB,IAAE,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@admin-layout/ai-chat-ext-browser",
|
|
3
|
-
"version": "12.2.4-alpha.
|
|
3
|
+
"version": "12.2.4-alpha.83",
|
|
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",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"publishConfig": {
|
|
36
36
|
"access": "public"
|
|
37
37
|
},
|
|
38
|
-
"gitHead": "
|
|
38
|
+
"gitHead": "97ac9095a6f50325a1a4ef3c44667e00f2bef93b",
|
|
39
39
|
"typescript": {
|
|
40
40
|
"definition": "lib/index.d.ts"
|
|
41
41
|
}
|