@blank-utils/llm 0.3.3 → 0.3.5
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.
|
@@ -1551,10 +1551,13 @@ function injectChatStyles(theme) {
|
|
|
1551
1551
|
.llm-chat-bubble--user {
|
|
1552
1552
|
align-self: flex-end;
|
|
1553
1553
|
max-width: 80%;
|
|
1554
|
+
overflow-wrap: break-word;
|
|
1554
1555
|
}
|
|
1555
1556
|
.llm-chat-bubble--assistant {
|
|
1556
1557
|
align-self: flex-start;
|
|
1557
1558
|
width: 100%;
|
|
1559
|
+
min-width: 0; /* Prevents flex children from expanding past 100% */
|
|
1560
|
+
overflow-x: hidden;
|
|
1558
1561
|
}
|
|
1559
1562
|
|
|
1560
1563
|
/* User message \u2014 flat, subtle bg, no radius */
|
|
@@ -1568,30 +1571,96 @@ function injectChatStyles(theme) {
|
|
|
1568
1571
|
color: ${text};
|
|
1569
1572
|
}
|
|
1570
1573
|
|
|
1571
|
-
/*
|
|
1574
|
+
/* Streamdown Overrides / Markdown Styling */
|
|
1572
1575
|
.llm-chat-assistant-content {
|
|
1573
1576
|
font-size: 14px;
|
|
1574
1577
|
line-height: 1.7;
|
|
1575
|
-
color: ${
|
|
1578
|
+
color: ${text};
|
|
1579
|
+
word-wrap: break-word;
|
|
1580
|
+
}
|
|
1581
|
+
.llm-chat-assistant-content > *:first-child { margin-top: 0; }
|
|
1582
|
+
.llm-chat-assistant-content > *:last-child { margin-bottom: 0; }
|
|
1583
|
+
|
|
1584
|
+
.llm-chat-assistant-content p {
|
|
1585
|
+
margin: 0 0 12px 0;
|
|
1586
|
+
}
|
|
1587
|
+
|
|
1588
|
+
.llm-chat-assistant-content h1,
|
|
1589
|
+
.llm-chat-assistant-content h2,
|
|
1590
|
+
.llm-chat-assistant-content h3,
|
|
1591
|
+
.llm-chat-assistant-content h4 {
|
|
1592
|
+
margin: 20px 0 10px 0;
|
|
1593
|
+
color: ${text};
|
|
1594
|
+
font-weight: 600;
|
|
1595
|
+
line-height: 1.3;
|
|
1596
|
+
}
|
|
1597
|
+
.llm-chat-assistant-content h1 { font-size: 1.5em; }
|
|
1598
|
+
.llm-chat-assistant-content h2 { font-size: 1.3em; }
|
|
1599
|
+
.llm-chat-assistant-content h3 { font-size: 1.1em; }
|
|
1600
|
+
|
|
1601
|
+
.llm-chat-assistant-content ul,
|
|
1602
|
+
.llm-chat-assistant-content ol {
|
|
1603
|
+
margin: 0 0 12px 0;
|
|
1604
|
+
padding-left: 24px;
|
|
1605
|
+
}
|
|
1606
|
+
.llm-chat-assistant-content li {
|
|
1607
|
+
margin-bottom: 4px;
|
|
1576
1608
|
}
|
|
1577
1609
|
|
|
1578
|
-
/* Streamdown Overrides */
|
|
1579
1610
|
.llm-chat-assistant-content pre {
|
|
1580
1611
|
background: ${surfaceSubtle} !important;
|
|
1581
1612
|
border: 1px solid ${borderSubtle} !important;
|
|
1582
|
-
border-radius:
|
|
1613
|
+
border-radius: 6px !important;
|
|
1583
1614
|
padding: 12px !important;
|
|
1584
1615
|
margin: 12px 0 !important;
|
|
1616
|
+
overflow-x: auto !important;
|
|
1617
|
+
white-space: pre !important;
|
|
1618
|
+
max-width: 100%;
|
|
1585
1619
|
}
|
|
1586
1620
|
.llm-chat-assistant-content code {
|
|
1587
1621
|
font-family: ${monoFont} !important;
|
|
1588
1622
|
font-size: 13px !important;
|
|
1623
|
+
white-space: inherit;
|
|
1589
1624
|
}
|
|
1590
1625
|
.llm-chat-assistant-content :not(pre) > code {
|
|
1591
1626
|
background: ${surfaceSubtle};
|
|
1592
1627
|
border: 1px solid ${borderSubtle};
|
|
1593
|
-
|
|
1628
|
+
border-radius: 4px;
|
|
1629
|
+
padding: 2px 5px;
|
|
1594
1630
|
font-size: 12.5px !important;
|
|
1631
|
+
white-space: pre-wrap !important;
|
|
1632
|
+
word-break: break-word;
|
|
1633
|
+
}
|
|
1634
|
+
|
|
1635
|
+
.llm-chat-assistant-content blockquote {
|
|
1636
|
+
border-left: 3px solid ${borderSubtle};
|
|
1637
|
+
margin: 0 0 12px 0;
|
|
1638
|
+
padding-left: 12px;
|
|
1639
|
+
color: ${textTertiary};
|
|
1640
|
+
}
|
|
1641
|
+
|
|
1642
|
+
.llm-chat-assistant-content a {
|
|
1643
|
+
color: #3b82f6;
|
|
1644
|
+
text-decoration: none;
|
|
1645
|
+
}
|
|
1646
|
+
.llm-chat-assistant-content a:hover {
|
|
1647
|
+
text-decoration: underline;
|
|
1648
|
+
}
|
|
1649
|
+
|
|
1650
|
+
.llm-chat-assistant-content table {
|
|
1651
|
+
border-collapse: collapse;
|
|
1652
|
+
width: 100%;
|
|
1653
|
+
margin: 12px 0;
|
|
1654
|
+
}
|
|
1655
|
+
.llm-chat-assistant-content th,
|
|
1656
|
+
.llm-chat-assistant-content td {
|
|
1657
|
+
border: 1px solid ${borderSubtle};
|
|
1658
|
+
padding: 6px 10px;
|
|
1659
|
+
text-align: left;
|
|
1660
|
+
}
|
|
1661
|
+
.llm-chat-assistant-content th {
|
|
1662
|
+
background: ${surfaceSubtle};
|
|
1663
|
+
font-weight: 600;
|
|
1595
1664
|
}
|
|
1596
1665
|
|
|
1597
1666
|
/* Attachments in message */
|
|
@@ -1643,12 +1712,29 @@ function injectChatStyles(theme) {
|
|
|
1643
1712
|
background: ${d ? "rgba(255,50,50,0.08)" : "rgba(200,0,0,0.04)"};
|
|
1644
1713
|
}
|
|
1645
1714
|
|
|
1646
|
-
/* Input Area */
|
|
1647
1715
|
.llm-chat-input-area {
|
|
1648
1716
|
padding: 12px 16px 16px;
|
|
1649
1717
|
border-top: 1px solid ${borderSubtle};
|
|
1650
1718
|
}
|
|
1651
1719
|
|
|
1720
|
+
/* Streamdown Animation CSS */
|
|
1721
|
+
@keyframes sd-fadeIn {
|
|
1722
|
+
from { opacity: 0; }
|
|
1723
|
+
to { opacity: 1; }
|
|
1724
|
+
}
|
|
1725
|
+
@keyframes sd-blurIn {
|
|
1726
|
+
from { opacity: 0; filter: blur(4px); }
|
|
1727
|
+
to { opacity: 1; filter: blur(0); }
|
|
1728
|
+
}
|
|
1729
|
+
@keyframes sd-slideUp {
|
|
1730
|
+
from { opacity: 0; transform: translateY(4px); }
|
|
1731
|
+
to { opacity: 1; transform: translateY(0); }
|
|
1732
|
+
}
|
|
1733
|
+
[data-sd-animate] {
|
|
1734
|
+
animation: var(--sd-animation, sd-fadeIn) var(--sd-duration, 150ms)
|
|
1735
|
+
var(--sd-easing, ease) both;
|
|
1736
|
+
}
|
|
1737
|
+
|
|
1652
1738
|
@keyframes llm-pulse {
|
|
1653
1739
|
0%, 100% { opacity: 1; }
|
|
1654
1740
|
50% { opacity: 0.2; }
|
|
@@ -1923,11 +2009,13 @@ function Chat({
|
|
|
1923
2009
|
] }),
|
|
1924
2010
|
messages.map((msg, i) => /* @__PURE__ */ jsx3("div", { className: `llm-chat-bubble llm-chat-bubble--${msg.role}`, children: msg.role === "user" ? /* @__PURE__ */ jsxs3(Fragment3, { children: [
|
|
1925
2011
|
msg.images && msg.images.length > 0 && /* @__PURE__ */ jsx3("div", { className: "llm-chat-msg-images", children: msg.images.map((img) => /* @__PURE__ */ jsx3("img", { src: img.dataUrl, className: "llm-chat-msg-img", alt: "attachment" }, img.id)) }),
|
|
1926
|
-
/* @__PURE__ */ jsx3("div", { className: "llm-chat-user-content", children: msg.content })
|
|
2012
|
+
/* @__PURE__ */ jsx3("div", { className: "llm-chat-user-content", style: { padding: "0px" }, children: /* @__PURE__ */ jsx3("div", { className: "llm-chat-assistant-content", style: { padding: "10px 14px" }, children: /* @__PURE__ */ jsx3(Streamdown, { plugins: { code, mermaid }, children: msg.content }) }) })
|
|
1927
2013
|
] }) : /* @__PURE__ */ jsx3("div", { className: "llm-chat-assistant-content", children: /* @__PURE__ */ jsx3(
|
|
1928
2014
|
Streamdown,
|
|
1929
2015
|
{
|
|
1930
2016
|
plugins: { code, mermaid },
|
|
2017
|
+
animated: true,
|
|
2018
|
+
isAnimating: false,
|
|
1931
2019
|
children: msg.content
|
|
1932
2020
|
}
|
|
1933
2021
|
) }) }, i)),
|
|
@@ -1935,6 +2023,8 @@ function Chat({
|
|
|
1935
2023
|
Streamdown,
|
|
1936
2024
|
{
|
|
1937
2025
|
plugins: { code, mermaid },
|
|
2026
|
+
animated: true,
|
|
2027
|
+
isAnimating: isGenerating,
|
|
1938
2028
|
children: streamingText
|
|
1939
2029
|
}
|
|
1940
2030
|
) }) }),
|
package/dist/index.js
CHANGED
package/dist/react/index.js
CHANGED
package/package.json
CHANGED