@akropolys/kiku 1.7.2 → 1.7.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/index.js +17 -12
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +17 -12
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +10 -3
- package/dist/styles.css.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2025,7 +2025,9 @@ function ChatModal({
|
|
|
2025
2025
|
] }) : displayMessages.map((msg, idx) => {
|
|
2026
2026
|
const isLast = idx === displayMessages.length - 1;
|
|
2027
2027
|
const isUser = msg.role === "user";
|
|
2028
|
-
const
|
|
2028
|
+
const compareSources = sources.filter((s) => s.id && referencedIds.includes(s.id));
|
|
2029
|
+
const showMatrix = isLast && lastIntent === "compare" && compareSources.length >= 2;
|
|
2030
|
+
const displayContent = !isUser && showMatrix ? stripMarkdownTables(msg.content) : msg.content;
|
|
2029
2031
|
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "hsk-cb-msg-group", ref: (el) => {
|
|
2030
2032
|
messageRefs.current[idx] = el;
|
|
2031
2033
|
}, children: isUser ? /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "hsk-cb-user-msg", children: [
|
|
@@ -2051,18 +2053,21 @@ function ChatModal({
|
|
|
2051
2053
|
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "hsk-cb-viz-spinner" }),
|
|
2052
2054
|
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { children: "Visualizing\u2026" })
|
|
2053
2055
|
] }),
|
|
2054
|
-
msg.visualization && /* @__PURE__ */ (0, import_jsx_runtime7.
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
e
|
|
2056
|
+
msg.visualization && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "hsk-cb-viz", children: [
|
|
2057
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
2058
|
+
"img",
|
|
2059
|
+
{
|
|
2060
|
+
src: msg.visualization,
|
|
2061
|
+
alt: "Product visualized in your photo",
|
|
2062
|
+
className: "hsk-markdown-img",
|
|
2063
|
+
onError: (e) => {
|
|
2064
|
+
e.target.style.display = "none";
|
|
2065
|
+
}
|
|
2062
2066
|
}
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2067
|
+
),
|
|
2068
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "hsk-cb-viz-disclaimer", children: "AI-generated preview \u2014 colours, size and placement may differ from the real product." })
|
|
2069
|
+
] }),
|
|
2070
|
+
showMatrix && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(ComparisonMatrix, { sources: compareSources, defaultCurrency }),
|
|
2066
2071
|
(() => {
|
|
2067
2072
|
const msgReferencedIds = isLast ? referencedIds : msg.referencedIds ?? [];
|
|
2068
2073
|
const msgSources = isLast ? sources : msg.sources ?? [];
|