@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.js
CHANGED
|
@@ -1639,9 +1639,13 @@ function ThinkingBlock({ text, isComplete, seconds: fixedSeconds }) {
|
|
|
1639
1639
|
onClick: expandable ? () => setIsOpen((o) => !o) : void 0,
|
|
1640
1640
|
"aria-expanded": expandable ? isOpen : void 0,
|
|
1641
1641
|
children: [
|
|
1642
|
-
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("svg", { width: "13", height: "13", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round",
|
|
1642
|
+
isComplete ? /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("svg", { width: "13", height: "13", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
1643
1643
|
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("circle", { cx: "12", cy: "12", r: "10" }),
|
|
1644
1644
|
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("path", { d: "M12 6v6l4 2" })
|
|
1645
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("span", { className: "hsk-cb-typing", "aria-hidden": "true", children: [
|
|
1646
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", {}),
|
|
1647
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", {}),
|
|
1648
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", {})
|
|
1645
1649
|
] }),
|
|
1646
1650
|
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { children: label }),
|
|
1647
1651
|
expandable && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: cn("hsk-cb-think-chevron", isOpen && "hsk-cb-think-chevron--open"), children: "\u25B6" })
|
|
@@ -2074,13 +2078,14 @@ function ChatModal({
|
|
|
2074
2078
|
)) })
|
|
2075
2079
|
] }) : displayMessages.map((msg, idx) => {
|
|
2076
2080
|
const isLast = idx === displayMessages.length - 1;
|
|
2081
|
+
const isLastUser = msg.role === "user" && !displayMessages.slice(idx + 1).some((m) => m.role === "user");
|
|
2077
2082
|
const isUser = msg.role === "user";
|
|
2078
2083
|
const compareSources = sources.filter((s) => s.id && referencedIds.includes(s.id));
|
|
2079
2084
|
const showMatrix = isLast && lastIntent === "compare" && compareSources.length >= 2;
|
|
2080
2085
|
const displayContent = !isUser && showMatrix ? stripMarkdownTables(msg.content) : msg.content;
|
|
2081
2086
|
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "hsk-cb-msg-group", ref: (el) => {
|
|
2082
2087
|
messageRefs.current[idx] = el;
|
|
2083
|
-
}, children: isUser ? /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className:
|
|
2088
|
+
}, children: isUser ? /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: `hsk-cb-user-msg${isLastUser ? " hsk-sent" : ""}`, children: [
|
|
2084
2089
|
msg.images && msg.images.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "hsk-cb-user-imgs", children: msg.images.map((img, i) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("img", { src: img, alt: `attachment ${i + 1}`, className: "hsk-cb-user-img-thumb" }, i)) }),
|
|
2085
2090
|
msg.content && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "hsk-cb-user-bubble", children: /^@kiku\b/i.test(msg.content) ? /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
|
|
2086
2091
|
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "hsk-kiku-badge", children: "@kiku" }),
|
|
@@ -2120,6 +2125,23 @@ function ChatModal({
|
|
|
2120
2125
|
),
|
|
2121
2126
|
/* @__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." })
|
|
2122
2127
|
] }),
|
|
2128
|
+
!isUser && (msg.knowledgeImages?.length ?? 0) > 0 && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "hsk-cb-kimgs", children: msg.knowledgeImages.map((ref) => /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "hsk-cb-kimg-group", children: [
|
|
2129
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "hsk-cb-kimg-grid", children: ref.images.map((img, i) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
2130
|
+
"img",
|
|
2131
|
+
{
|
|
2132
|
+
src: img.url,
|
|
2133
|
+
alt: img.note || ref.title || "Reference image",
|
|
2134
|
+
className: "hsk-cb-kimg",
|
|
2135
|
+
loading: "lazy",
|
|
2136
|
+
onClick: () => setLightboxSrc(img.url),
|
|
2137
|
+
onError: (e) => {
|
|
2138
|
+
e.target.style.display = "none";
|
|
2139
|
+
}
|
|
2140
|
+
},
|
|
2141
|
+
i
|
|
2142
|
+
)) }),
|
|
2143
|
+
(ref.title || ref.images[0]?.note) && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "hsk-cb-kimg-caption", children: ref.title || ref.images[0]?.note })
|
|
2144
|
+
] }, ref.entryId)) }),
|
|
2123
2145
|
showMatrix && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(ComparisonMatrix, { sources: compareSources, defaultCurrency }),
|
|
2124
2146
|
(() => {
|
|
2125
2147
|
const msgReferencedIds = isLast ? referencedIds : msg.referencedIds ?? [];
|