@akropolys/kiku 1.7.7 → 1.7.8
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 +24 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +24 -2
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +90 -0
- package/dist/styles.css.map +1 -1
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -1607,9 +1607,13 @@ function ThinkingBlock({ text, isComplete, seconds: fixedSeconds }) {
|
|
|
1607
1607
|
onClick: expandable ? () => setIsOpen((o) => !o) : void 0,
|
|
1608
1608
|
"aria-expanded": expandable ? isOpen : void 0,
|
|
1609
1609
|
children: [
|
|
1610
|
-
/* @__PURE__ */ jsxs6("svg", { width: "13", height: "13", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round",
|
|
1610
|
+
isComplete ? /* @__PURE__ */ jsxs6("svg", { width: "13", height: "13", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
1611
1611
|
/* @__PURE__ */ jsx7("circle", { cx: "12", cy: "12", r: "10" }),
|
|
1612
1612
|
/* @__PURE__ */ jsx7("path", { d: "M12 6v6l4 2" })
|
|
1613
|
+
] }) : /* @__PURE__ */ jsxs6("span", { className: "hsk-cb-typing", "aria-hidden": "true", children: [
|
|
1614
|
+
/* @__PURE__ */ jsx7("span", {}),
|
|
1615
|
+
/* @__PURE__ */ jsx7("span", {}),
|
|
1616
|
+
/* @__PURE__ */ jsx7("span", {})
|
|
1613
1617
|
] }),
|
|
1614
1618
|
/* @__PURE__ */ jsx7("span", { children: label }),
|
|
1615
1619
|
expandable && /* @__PURE__ */ jsx7("span", { className: cn("hsk-cb-think-chevron", isOpen && "hsk-cb-think-chevron--open"), children: "\u25B6" })
|
|
@@ -2042,13 +2046,14 @@ function ChatModal({
|
|
|
2042
2046
|
)) })
|
|
2043
2047
|
] }) : displayMessages.map((msg, idx) => {
|
|
2044
2048
|
const isLast = idx === displayMessages.length - 1;
|
|
2049
|
+
const isLastUser = msg.role === "user" && !displayMessages.slice(idx + 1).some((m) => m.role === "user");
|
|
2045
2050
|
const isUser = msg.role === "user";
|
|
2046
2051
|
const compareSources = sources.filter((s) => s.id && referencedIds.includes(s.id));
|
|
2047
2052
|
const showMatrix = isLast && lastIntent === "compare" && compareSources.length >= 2;
|
|
2048
2053
|
const displayContent = !isUser && showMatrix ? stripMarkdownTables(msg.content) : msg.content;
|
|
2049
2054
|
return /* @__PURE__ */ jsx7("div", { className: "hsk-cb-msg-group", ref: (el) => {
|
|
2050
2055
|
messageRefs.current[idx] = el;
|
|
2051
|
-
}, children: isUser ? /* @__PURE__ */ jsxs6("div", { className:
|
|
2056
|
+
}, children: isUser ? /* @__PURE__ */ jsxs6("div", { className: `hsk-cb-user-msg${isLastUser ? " hsk-sent" : ""}`, children: [
|
|
2052
2057
|
msg.images && msg.images.length > 0 && /* @__PURE__ */ jsx7("div", { className: "hsk-cb-user-imgs", children: msg.images.map((img, i) => /* @__PURE__ */ jsx7("img", { src: img, alt: `attachment ${i + 1}`, className: "hsk-cb-user-img-thumb" }, i)) }),
|
|
2053
2058
|
msg.content && /* @__PURE__ */ jsx7("div", { className: "hsk-cb-user-bubble", children: /^@kiku\b/i.test(msg.content) ? /* @__PURE__ */ jsxs6(Fragment3, { children: [
|
|
2054
2059
|
/* @__PURE__ */ jsx7("span", { className: "hsk-kiku-badge", children: "@kiku" }),
|
|
@@ -2088,6 +2093,23 @@ function ChatModal({
|
|
|
2088
2093
|
),
|
|
2089
2094
|
/* @__PURE__ */ jsx7("div", { className: "hsk-cb-viz-disclaimer", children: "AI-generated preview \u2014 colours, size and placement may differ from the real product." })
|
|
2090
2095
|
] }),
|
|
2096
|
+
!isUser && (msg.knowledgeImages?.length ?? 0) > 0 && /* @__PURE__ */ jsx7("div", { className: "hsk-cb-kimgs", children: msg.knowledgeImages.map((ref) => /* @__PURE__ */ jsxs6("div", { className: "hsk-cb-kimg-group", children: [
|
|
2097
|
+
/* @__PURE__ */ jsx7("div", { className: "hsk-cb-kimg-grid", children: ref.images.map((img, i) => /* @__PURE__ */ jsx7(
|
|
2098
|
+
"img",
|
|
2099
|
+
{
|
|
2100
|
+
src: img.url,
|
|
2101
|
+
alt: img.note || ref.title || "Reference image",
|
|
2102
|
+
className: "hsk-cb-kimg",
|
|
2103
|
+
loading: "lazy",
|
|
2104
|
+
onClick: () => setLightboxSrc(img.url),
|
|
2105
|
+
onError: (e) => {
|
|
2106
|
+
e.target.style.display = "none";
|
|
2107
|
+
}
|
|
2108
|
+
},
|
|
2109
|
+
i
|
|
2110
|
+
)) }),
|
|
2111
|
+
(ref.title || ref.images[0]?.note) && /* @__PURE__ */ jsx7("div", { className: "hsk-cb-kimg-caption", children: ref.title || ref.images[0]?.note })
|
|
2112
|
+
] }, ref.entryId)) }),
|
|
2091
2113
|
showMatrix && /* @__PURE__ */ jsx7(ComparisonMatrix, { sources: compareSources, defaultCurrency }),
|
|
2092
2114
|
(() => {
|
|
2093
2115
|
const msgReferencedIds = isLast ? referencedIds : msg.referencedIds ?? [];
|