@webless/agent 0.9.2 → 0.9.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-3E632FNE.js → chunk-JIM5AOVC.js} +23 -3
- package/dist/chunk-JIM5AOVC.js.map +1 -0
- package/dist/embed.cjs +21 -1
- package/dist/embed.cjs.map +1 -1
- package/dist/embed.js +1 -1
- package/dist/react.cjs +23 -1
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.cts +2 -1
- package/dist/react.d.ts +2 -1
- package/dist/react.js +3 -1
- package/dist/react.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-3E632FNE.js.map +0 -1
|
@@ -5292,7 +5292,21 @@ function InteractiveBookingCard({
|
|
|
5292
5292
|
}
|
|
5293
5293
|
|
|
5294
5294
|
// src/react/components/MessageBubble/MessageBubble.tsx
|
|
5295
|
-
import { Streamdown } from "streamdown";
|
|
5295
|
+
import { Streamdown, defaultUrlTransform } from "streamdown";
|
|
5296
|
+
|
|
5297
|
+
// src/react/lib/resolve-message-url.ts
|
|
5298
|
+
function resolveMessageUrl(safeUrl, baseUrl) {
|
|
5299
|
+
if (!safeUrl || !baseUrl) return safeUrl;
|
|
5300
|
+
try {
|
|
5301
|
+
const base = new URL(baseUrl);
|
|
5302
|
+
if (base.protocol !== "https:" && base.protocol !== "http:") return "";
|
|
5303
|
+
return new URL(safeUrl, base).href;
|
|
5304
|
+
} catch {
|
|
5305
|
+
return "";
|
|
5306
|
+
}
|
|
5307
|
+
}
|
|
5308
|
+
|
|
5309
|
+
// src/react/components/MessageBubble/MessageBubble.tsx
|
|
5296
5310
|
import "streamdown/styles.css";
|
|
5297
5311
|
import { jsx as jsx8, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
5298
5312
|
function normalizeDedupeText(text2) {
|
|
@@ -5335,6 +5349,7 @@ function MessageBubble({
|
|
|
5335
5349
|
brandLogoUrl,
|
|
5336
5350
|
bookingDisabled = false,
|
|
5337
5351
|
bookingReadOnly = false,
|
|
5352
|
+
linkBaseUrl,
|
|
5338
5353
|
offer,
|
|
5339
5354
|
onBook
|
|
5340
5355
|
}) {
|
|
@@ -5367,6 +5382,10 @@ function MessageBubble({
|
|
|
5367
5382
|
isAnimating: isStreaming,
|
|
5368
5383
|
linkSafety: { enabled: false },
|
|
5369
5384
|
mode: isStreaming ? "streaming" : "static",
|
|
5385
|
+
urlTransform: (url, key, node) => resolveMessageUrl(
|
|
5386
|
+
defaultUrlTransform(url, key, node) ?? "",
|
|
5387
|
+
key === "href" ? linkBaseUrl : void 0
|
|
5388
|
+
),
|
|
5370
5389
|
skipHtml: true,
|
|
5371
5390
|
children: displayText
|
|
5372
5391
|
}
|
|
@@ -5384,7 +5403,8 @@ function MessageBubble({
|
|
|
5384
5403
|
/* @__PURE__ */ jsx8("span", { children: citation.label })
|
|
5385
5404
|
] }) }, citation.id)) }) : null
|
|
5386
5405
|
] });
|
|
5387
|
-
if (!displayText && !message.searchResults?.length && offers.length === 0)
|
|
5406
|
+
if (!displayText && !message.searchResults?.length && offers.length === 0)
|
|
5407
|
+
return null;
|
|
5388
5408
|
return /* @__PURE__ */ jsxs8("article", { className: "message-bubble message-bubble--agent", children: [
|
|
5389
5409
|
displayText || message.searchResults?.length ? showBrandLogo ? /* @__PURE__ */ jsxs8("div", { className: "message-bubble__agent-row", children: [
|
|
5390
5410
|
/* @__PURE__ */ jsx8("span", { className: "message-bubble__agent-avatar", "aria-hidden": "true", children: /* @__PURE__ */ jsx8(
|
|
@@ -7290,4 +7310,4 @@ export {
|
|
|
7290
7310
|
sendAgentAnswerFeedback,
|
|
7291
7311
|
AgentWidget
|
|
7292
7312
|
};
|
|
7293
|
-
//# sourceMappingURL=chunk-
|
|
7313
|
+
//# sourceMappingURL=chunk-JIM5AOVC.js.map
|