@akropolys/kiku 1.7.1 → 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 +22 -15
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +22 -15
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +64 -22
- package/dist/styles.css.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1367,7 +1367,7 @@ function SourceImg({ src, alt, onImageClick }) {
|
|
|
1367
1367
|
}
|
|
1368
1368
|
);
|
|
1369
1369
|
}
|
|
1370
|
-
function SourcesCarousel({ sources, defaultCurrency, onSelectSource, onImageClick, referencedIds = [] }) {
|
|
1370
|
+
function SourcesCarousel({ sources, defaultCurrency, onSelectSource, onImageClick, referencedIds = [], compact = false }) {
|
|
1371
1371
|
const client = (0, import_sdk6.useAkropolysContext)();
|
|
1372
1372
|
const isProperty = client?.vertical === "property";
|
|
1373
1373
|
const railRef = (0, import_react5.useRef)(null);
|
|
@@ -1395,7 +1395,7 @@ function SourcesCarousel({ sources, defaultCurrency, onSelectSource, onImageClic
|
|
|
1395
1395
|
};
|
|
1396
1396
|
const display = sources.filter((s) => s.id && referencedIds.includes(s.id));
|
|
1397
1397
|
if (display.length === 0) return null;
|
|
1398
|
-
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "hsk-cb-sources-wrap", children: [
|
|
1398
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: cn("hsk-cb-sources-wrap", compact && "hsk-cb-sources-wrap--compact"), children: [
|
|
1399
1399
|
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "hsk-cb-sources", ref: railRef, children: display.map((src, si) => {
|
|
1400
1400
|
const isReferenced = !!(src.id && referencedIds.includes(src.id));
|
|
1401
1401
|
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
@@ -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 ?? [];
|
|
@@ -2076,7 +2081,8 @@ function ChatModal({
|
|
|
2076
2081
|
defaultCurrency,
|
|
2077
2082
|
onSelectSource: handleSourceClick,
|
|
2078
2083
|
onImageClick: setLightboxSrc,
|
|
2079
|
-
referencedIds: msgReferencedIds
|
|
2084
|
+
referencedIds: msgReferencedIds,
|
|
2085
|
+
compact: !!msg.visualization
|
|
2080
2086
|
}
|
|
2081
2087
|
);
|
|
2082
2088
|
})(),
|
|
@@ -2117,6 +2123,7 @@ function ChatModal({
|
|
|
2117
2123
|
loading && !streaming && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "hsk-cb-typing-row", style: { display: "flex", alignItems: "center", gap: "10px" }, children: [
|
|
2118
2124
|
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "hsk-cb-thinking-icon", children: [
|
|
2119
2125
|
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("svg", { className: "hsk-brand-mark", viewBox: "0 0 100 100", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("path", { d: "M39.4 10.4 Q44 0 48.6 10.4 L86.1 95.8 Q88 100 83.4 100 L4.6 100 Q0 100 1.9 95.8 Z M24 100 L24 65 Q24 60 27.4 56.3 Q44 38 60.6 56.3 Q64 60 64 65 L64 100 Z", transform: "translate(22.7 19) scale(0.62)", fillRule: "evenodd" }) }),
|
|
2126
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("svg", { className: "hsk-brand-mark hsk-brand-mark--sheen", viewBox: "0 0 100 100", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("path", { d: "M39.4 10.4 Q44 0 48.6 10.4 L86.1 95.8 Q88 100 83.4 100 L4.6 100 Q0 100 1.9 95.8 Z M24 100 L24 65 Q24 60 27.4 56.3 Q44 38 60.6 56.3 Q64 60 64 65 L64 100 Z", transform: "translate(22.7 19) scale(0.62)", fillRule: "evenodd" }) }),
|
|
2120
2127
|
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "hsk-handle-orbit", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("span", { className: "hsk-handle-ring", children: [
|
|
2121
2128
|
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "hsk-handle-ball" }),
|
|
2122
2129
|
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "hsk-handle-ball" }),
|