@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.mjs CHANGED
@@ -1993,7 +1993,9 @@ function ChatModal({
1993
1993
  ] }) : displayMessages.map((msg, idx) => {
1994
1994
  const isLast = idx === displayMessages.length - 1;
1995
1995
  const isUser = msg.role === "user";
1996
- const displayContent = !isUser && isLast && lastIntent === "compare" && sources.length >= 2 ? stripMarkdownTables(msg.content) : msg.content;
1996
+ const compareSources = sources.filter((s) => s.id && referencedIds.includes(s.id));
1997
+ const showMatrix = isLast && lastIntent === "compare" && compareSources.length >= 2;
1998
+ const displayContent = !isUser && showMatrix ? stripMarkdownTables(msg.content) : msg.content;
1997
1999
  return /* @__PURE__ */ jsx7("div", { className: "hsk-cb-msg-group", ref: (el) => {
1998
2000
  messageRefs.current[idx] = el;
1999
2001
  }, children: isUser ? /* @__PURE__ */ jsxs6("div", { className: "hsk-cb-user-msg", children: [
@@ -2019,18 +2021,21 @@ function ChatModal({
2019
2021
  /* @__PURE__ */ jsx7("span", { className: "hsk-cb-viz-spinner" }),
2020
2022
  /* @__PURE__ */ jsx7("span", { children: "Visualizing\u2026" })
2021
2023
  ] }),
2022
- msg.visualization && /* @__PURE__ */ jsx7("div", { className: "hsk-cb-viz", children: /* @__PURE__ */ jsx7(
2023
- "img",
2024
- {
2025
- src: msg.visualization,
2026
- alt: "Product visualized in your photo",
2027
- className: "hsk-markdown-img",
2028
- onError: (e) => {
2029
- e.target.style.display = "none";
2024
+ msg.visualization && /* @__PURE__ */ jsxs6("div", { className: "hsk-cb-viz", children: [
2025
+ /* @__PURE__ */ jsx7(
2026
+ "img",
2027
+ {
2028
+ src: msg.visualization,
2029
+ alt: "Product visualized in your photo",
2030
+ className: "hsk-markdown-img",
2031
+ onError: (e) => {
2032
+ e.target.style.display = "none";
2033
+ }
2030
2034
  }
2031
- }
2032
- ) }),
2033
- isLast && lastIntent === "compare" && sources.length >= 2 && /* @__PURE__ */ jsx7(ComparisonMatrix, { sources, defaultCurrency }),
2035
+ ),
2036
+ /* @__PURE__ */ jsx7("div", { className: "hsk-cb-viz-disclaimer", children: "AI-generated preview \u2014 colours, size and placement may differ from the real product." })
2037
+ ] }),
2038
+ showMatrix && /* @__PURE__ */ jsx7(ComparisonMatrix, { sources: compareSources, defaultCurrency }),
2034
2039
  (() => {
2035
2040
  const msgReferencedIds = isLast ? referencedIds : msg.referencedIds ?? [];
2036
2041
  const msgSources = isLast ? sources : msg.sources ?? [];