alice-and-bot 1.0.92 → 1.0.94
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.
|
@@ -307,6 +307,7 @@ export declare class ChatBox extends LitElement {
|
|
|
307
307
|
private _prevMessageCount: any;
|
|
308
308
|
private _pendingEditLastOwn: any;
|
|
309
309
|
private _stuckToBottom: any;
|
|
310
|
+
private _userTouchingMessages: any;
|
|
310
311
|
private _loadingMore: any;
|
|
311
312
|
private _prevScrollHeight: any;
|
|
312
313
|
private _resizeObserver: any;
|
|
@@ -344,6 +345,8 @@ export declare class ChatBox extends LitElement {
|
|
|
344
345
|
private _renderBottomMenu: any;
|
|
345
346
|
private _removeAttachOutside: any;
|
|
346
347
|
private _scrollToBottom: any;
|
|
348
|
+
private _onMessagesTouchStart: any;
|
|
349
|
+
private _onMessagesTouchEnd: any;
|
|
347
350
|
private _handleScroll: any;
|
|
348
351
|
private _stopRecording: any;
|
|
349
352
|
private _startRecording: any;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat-box.d.ts","sources":["../../../lit/components/chat-box.ts"],"names":[],"mappings":"AAAA,SAAe,UAAU,EAAW,KAAK,cAAc,cAAwB;AAmE/E,cACE,kBAAkB,EAClB,cAAc,EACd,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,gBAAgB,qBAEE;
|
|
1
|
+
{"version":3,"file":"chat-box.d.ts","sources":["../../../lit/components/chat-box.ts"],"names":[],"mappings":"AAAA,SAAe,UAAU,EAAW,KAAK,cAAc,cAAwB;AAmE/E,cACE,kBAAkB,EAClB,cAAc,EACd,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,gBAAgB,qBAEE;AAioBpB,OAAO,cAAM,gBAAgB;EAC3B,gBAAgB;IACd;MAAY;;IACZ;MAAe;;IACf;MAAa;MAAe;;IAC5B;MAAe;;IACf;MAAY;;IACZ;MAAU;;IACV;MAAU;;IACV;MAAyB;;IACzB;MAAU;;IACV;MAA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LitElement as LitElement8, nothing as nothing4 } from "l
|
|
|
1548
1548
|
import { repeat } from "lit/directives/repeat.js";
|
|
1549
1549
|
|
|
1550
1550
|
// lit/components/design.ts
|
|
1551
|
-
var
|
|
1551
|
+
var chatWallpaperSvg = (isDarkMode) => {
|
|
1552
|
+
const bg = isDarkMode ? "#0c0c0b" : "#f6f4ee";
|
|
1553
|
+
const stroke = isDarkMode ? "#ded8cc" : "#8d8270";
|
|
1554
|
+
const opacity = isDarkMode ? "0.068" : "0.145";
|
|
1555
|
+
const dotOpacity = isDarkMode ? "0.09" : "0.18";
|
|
1556
|
+
const svg = `<svg width="280" height="280" viewBox="0 0 280 280" xmlns="http://www.w3.org/2000/svg"><rect width="280" height="280" fill="${bg}"/><g fill="none" stroke="${stroke}" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round" opacity="${opacity}"><g transform="translate(36 38) rotate(-11)"><path d="M-12 -9h20a5 5 0 0 1 5 5v8a5 5 0 0 1-5 5h-11l-6 5v-5h-3a5 5 0 0 1-5-5v-8a5 5 0 0 1 5-5z"/></g><g transform="translate(198 42) rotate(14)"><path d="M-11 -6l22 7-9 4-4 9-9-20zM-2 5l13-4"/></g><g transform="translate(118 28) rotate(8)"><path d="M0 -8l2 6 6 2-6 2-2 6-2-6-6-2 6-2z"/></g><g transform="translate(46 138) rotate(9)"><rect x="-8" y="-3" width="16" height="13" rx="3"/><path d="M-4 -3v-4a4 4 0 0 1 8 0v4"/></g><g transform="translate(148 118) rotate(-13)"><path d="M-10 -8h18a5 5 0 0 1 5 5v7a5 5 0 0 1-5 5h-3v4l-5-4h-10a5 5 0 0 1-5-5v-7a5 5 0 0 1 5-5z"/></g><g transform="translate(242 132) rotate(-7)"><path d="M-10 -5v10M-5 -8v16M0 -4v8M5 -7v14M10 -3v6"/></g><g transform="translate(82 224) rotate(-10)"><rect x="-9" y="-6" width="18" height="14" rx="4"/><path d="M0 -11v5M-4 1h.01M4 1h.01"/></g><g transform="translate(208 218) rotate(16)"><circle cx="-7" cy="0" r="4.5"/><path d="M-2.5 0h13M6.5 0v4M10 0v3"/></g><g transform="translate(152 246) rotate(-15)"><path d="M0 -6.5l1.6 4.9 4.9 1.6-4.9 1.6-1.6 4.9-1.6-4.9-4.9-1.6 4.9-1.6z"/></g><g transform="translate(256 264) rotate(12)"><path d="M-3 0h6M0 -3v6"/></g><path d="M96 82h6M99 79v6M248 76h6M251 73v6M186 172h6M189 169v6M20 202h6M23 199v6"/></g><g fill="${stroke}" opacity="${dotOpacity}"><circle cx="158" cy="64" r="1.35"/><circle cx="76" cy="108" r="1.35"/><circle cx="204" cy="104" r="1.25"/><circle cx="108" cy="176" r="1.35"/><circle cx="256" cy="186" r="1.25"/><circle cx="34" cy="256" r="1.35"/><circle cx="132" cy="196" r="1.2"/><circle cx="18" cy="92" r="1.25"/></g></svg>`;
|
|
1557
|
+
return `url('data:image/svg+xml,${encodeURIComponent(svg)}')`;
|
|
1558
|
+
};
|
|
1559
|
+
var chatBackgroundPattern = (isDarkMode) => chatWallpaperSvg(isDarkMode);
|
|
1560
|
+
var messageWrapMaxWidth = (noBubble) => noBubble ? "100%" : "min(80%, 600px)";
|
|
1561
|
+
var messageBubbleRadius = ({ noBubble, isOwn, isStartOfSequence }) => noBubble ? "0" : isStartOfSequence ? isOwn ? "12px 4px 12px 12px" : "4px 12px 12px 12px" : "12px";
|
|
1552
1562
|
var widgetColors = (isDarkMode, custom) => ({
|
|
1553
1563
|
background: custom?.background ?? chatBackgroundPattern(isDarkMode),
|
|
1554
1564
|
backgroundColor: custom?.background ?? (isDarkMode ? "#0c0c0b" : "#f6f4ee"),
|
|
@@ -2123,6 +2133,8 @@ var computeTextareaResize = (scrollHeight) => ({
|
|
|
2123
2133
|
height: Math.min(Math.max(scrollHeight, minTextareaHeight), maxTextareaHeight),
|
|
2124
2134
|
overflow: scrollHeight > maxTextareaHeight ? "auto" : "hidden"
|
|
2125
2135
|
});
|
|
2136
|
+
var nearBottomThresholdPx = 40;
|
|
2137
|
+
var isNearBottom = (scrollHeight, scrollTop, clientHeight) => scrollHeight - scrollTop - clientHeight < nearBottomThresholdPx;
|
|
2126
2138
|
var shouldShowScrollDownButton = (scrollHeight, scrollTop, clientHeight) => scrollHeight - scrollTop - clientHeight > 400;
|
|
2127
2139
|
var locationZoom = 15;
|
|
2128
2140
|
var tileSize = 256;
|
|
@@ -2936,7 +2948,7 @@ var ChatAttachment = class extends LitElement4 {
|
|
|
2936
2948
|
<img
|
|
2937
2949
|
src="${this._decryptedUrl}"
|
|
2938
2950
|
alt="${attachment.name}"
|
|
2939
|
-
style="max-width:100%;border-radius:8px;cursor:pointer;transition:
|
|
2951
|
+
style="max-width:100%;border-radius:8px;cursor:pointer;transition:box-shadow .15s${isSelected ? ";box-shadow:0 0 0 3px rgba(57,88,127,0.35),0 6px 18px rgba(57,88,127,0.22)" : ""}${this.longPressActive && isSelected ? ";animation:msg-highlight .3s ease forwards" : ""}"
|
|
2940
2952
|
/>
|
|
2941
2953
|
` : this._failed ? unavailableAttachmentHtml(isDark) : html5`
|
|
2942
2954
|
<div style="${imagePlaceholderStyle(isDark)}">${spinnerHtml(isDark)}</div>
|
|
@@ -6547,7 +6559,10 @@ var quickEmojis = quickReactionEmojis;
|
|
|
6547
6559
|
var keyboardSelectedRowStyle = (isDark) => `;border-radius:14px;padding:4px 6px;margin:-4px -6px;background:${isDark ? "rgba(125,162,207,0.12)" : "rgba(57,88,127,0.08)"};outline:1.5px solid ${isDark ? "rgba(125,162,207,0.45)" : "rgba(57,88,127,0.38)"};outline-offset:1px;transition:background 0.15s,outline-color 0.15s`;
|
|
6548
6560
|
var keyboardHintBarStyle = (isDark) => `display:inline-flex;align-items:center;gap:6px;margin-top:4px;padding:2px 8px;border-radius:999px;font-size:11px;background:${isDark ? "#1e1d1a" : "#f3f1ea"};border:1px solid ${isDark ? "#2e2d28" : "#dcd8cc"};color:${isDark ? "#b8b2a6" : "#5a564f"};user-select:none`;
|
|
6549
6561
|
var keyboardHintKeyStyle = (isDark) => `font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:10px;padding:0 4px;border-radius:4px;background:${isDark ? "#2c2b26" : "#e5e1d6"};color:${isDark ? "#f3f1ea" : "#181715"}`;
|
|
6550
|
-
var longPressHighlightCss = `@keyframes msg-highlight{0%{
|
|
6562
|
+
var longPressHighlightCss = `@keyframes msg-highlight{0%{box-shadow:0 0 0 0 rgba(57,88,127,0)}100%{box-shadow:0 0 0 3px rgba(57,88,127,0.32),0 6px 20px rgba(57,88,127,0.18)}}`;
|
|
6563
|
+
var longPressHighlightDelayMs = 150;
|
|
6564
|
+
var longPressTriggerDelayMs = 500;
|
|
6565
|
+
var longPressMoveSlopPx = 8;
|
|
6551
6566
|
var msgEntranceCss = `@keyframes msg-enter{from{opacity:0;transform:translateY(4px)}to{opacity:1;transform:translateY(0)}}`;
|
|
6552
6567
|
var liveCursorCss = `@keyframes msg-live-cursor{0%,100%{opacity:.35;transform:scaleY(.9)}50%{opacity:1;transform:scaleY(1)}}`;
|
|
6553
6568
|
var streamTickMs = 20;
|
|
@@ -6807,6 +6822,7 @@ var ChatMessage = class extends LitElement6 {
|
|
|
6807
6822
|
_menuEl = null;
|
|
6808
6823
|
_outsideClickHandler = null;
|
|
6809
6824
|
_longPressTimer = 0;
|
|
6825
|
+
_longPressHighlightTimer = 0;
|
|
6810
6826
|
constructor() {
|
|
6811
6827
|
super();
|
|
6812
6828
|
this.isOwn = false;
|
|
@@ -6852,6 +6868,7 @@ var ChatMessage = class extends LitElement6 {
|
|
|
6852
6868
|
clearInterval(this._timeInterval);
|
|
6853
6869
|
clearTimeout(this._streamTimer);
|
|
6854
6870
|
clearTimeout(this._longPressTimer);
|
|
6871
|
+
clearTimeout(this._longPressHighlightTimer);
|
|
6855
6872
|
document.removeEventListener("mousedown", this._dismissQuickEmojis);
|
|
6856
6873
|
this._removeOutsideClick();
|
|
6857
6874
|
this.removeEventListener("click", this._handleCopyCode);
|
|
@@ -7052,18 +7069,33 @@ var ChatMessage = class extends LitElement6 {
|
|
|
7052
7069
|
if (target instanceof HTMLElement && target.closest("button, a, input, textarea")) {
|
|
7053
7070
|
return;
|
|
7054
7071
|
}
|
|
7055
|
-
this.
|
|
7072
|
+
clearTimeout(this._longPressTimer);
|
|
7073
|
+
clearTimeout(this._longPressHighlightTimer);
|
|
7056
7074
|
this._touchY = e.touches[0]?.clientY ?? 0;
|
|
7057
7075
|
this._touchX = e.touches[0]?.clientX ?? 0;
|
|
7058
7076
|
this._selectedMedia = resolveTargetMedia(target, this.msg, this);
|
|
7077
|
+
this._longPressHighlightTimer = globalThis.setTimeout(() => {
|
|
7078
|
+
this._longPressActive = true;
|
|
7079
|
+
}, longPressHighlightDelayMs);
|
|
7059
7080
|
this._longPressTimer = globalThis.setTimeout(() => {
|
|
7060
7081
|
this._longPressActive = false;
|
|
7061
7082
|
this._showMobileContext = true;
|
|
7062
7083
|
clearSelection();
|
|
7063
|
-
},
|
|
7084
|
+
}, longPressTriggerDelayMs);
|
|
7085
|
+
};
|
|
7086
|
+
_longPressMove = (e) => {
|
|
7087
|
+
const touch = e.touches[0];
|
|
7088
|
+
if (!touch) {
|
|
7089
|
+
this._longPressEnd();
|
|
7090
|
+
return;
|
|
7091
|
+
}
|
|
7092
|
+
if (Math.hypot(touch.clientX - this._touchX, touch.clientY - this._touchY) > longPressMoveSlopPx) {
|
|
7093
|
+
this._longPressEnd();
|
|
7094
|
+
}
|
|
7064
7095
|
};
|
|
7065
7096
|
_longPressEnd = () => {
|
|
7066
7097
|
clearTimeout(this._longPressTimer);
|
|
7098
|
+
clearTimeout(this._longPressHighlightTimer);
|
|
7067
7099
|
this._longPressActive = false;
|
|
7068
7100
|
if (this._showMobileContext) {
|
|
7069
7101
|
clearSelection();
|
|
@@ -7121,7 +7153,7 @@ var ChatMessage = class extends LitElement6 {
|
|
|
7121
7153
|
customColors,
|
|
7122
7154
|
authorId
|
|
7123
7155
|
});
|
|
7124
|
-
const noBubble = !isOwn && customColors?.hideOtherBubble;
|
|
7156
|
+
const noBubble = Boolean(!isOwn && customColors?.hideOtherBubble);
|
|
7125
7157
|
const showAvatar = shouldShowAvatar({
|
|
7126
7158
|
isStartOfSequence,
|
|
7127
7159
|
isOwn,
|
|
@@ -7166,19 +7198,23 @@ var ChatMessage = class extends LitElement6 {
|
|
|
7166
7198
|
` : nothing3}
|
|
7167
7199
|
<div
|
|
7168
7200
|
class="msg-wrap"
|
|
7169
|
-
style="display:flex;flex-direction:column;min-width:0;align-items:${isOwn ? "flex-end" : "flex-start"};position:relative;max-width:${noBubble
|
|
7201
|
+
style="display:flex;flex-direction:column;min-width:0;align-items:${isOwn ? "flex-end" : "flex-start"};position:relative;max-width:${messageWrapMaxWidth(noBubble)}${noBubble ? ";width:100%" : ""}${this.isMobile ? ";user-select:none;-webkit-user-select:none;-webkit-touch-callout:none" : ""}"
|
|
7170
7202
|
@contextmenu="${(e) => {
|
|
7171
7203
|
if (this.isMobile) e.preventDefault();
|
|
7172
7204
|
}}"
|
|
7173
7205
|
@touchstart="${this._longPressStart}"
|
|
7174
7206
|
@touchend="${this._longPressEnd}"
|
|
7175
|
-
@touchmove="${this.
|
|
7207
|
+
@touchmove="${this._longPressMove}"
|
|
7176
7208
|
@touchcancel="${this._longPressEnd}"
|
|
7177
7209
|
>
|
|
7178
7210
|
<div
|
|
7179
7211
|
class="msg-bubble"
|
|
7180
7212
|
dir="${textDirection(displayedText)}"
|
|
7181
|
-
style="display:${noBubble ? "block" : "inline-block"};min-width:0;max-width:100%;box-sizing:border-box;${noBubble ? "width:100%;" : ""}background:${noBubble ? "transparent" : baseColor};color:${textColor};align-self:${isOwn ? "flex-end" : "flex-start"};border-radius:${
|
|
7213
|
+
style="display:${noBubble ? "block" : "inline-block"};min-width:0;max-width:100%;box-sizing:border-box;${noBubble ? "width:100%;" : ""}background:${noBubble ? "transparent" : baseColor};color:${textColor};align-self:${isOwn ? "flex-end" : "flex-start"};border-radius:${messageBubbleRadius({
|
|
7214
|
+
noBubble,
|
|
7215
|
+
isOwn,
|
|
7216
|
+
isStartOfSequence
|
|
7217
|
+
})};padding:${noBubble ? "2px 0" : "8px 13px"};margin-left:${isOwn ? "0" : showAvatar ? "0" : avatarSpace + "px"};margin-right:${isOwn ? showAvatar ? "0" : avatarSpace + "px" : "0"};overflow-x:hidden;overflow-y:hidden;word-break:break-word;overflow-wrap:anywhere${bubbleDecoration}${this._longPressActive && !this._selectedMedia ? ";animation:msg-highlight .3s ease forwards" : ""}"
|
|
7182
7218
|
>
|
|
7183
7219
|
${shouldShowName({
|
|
7184
7220
|
isStartOfSequence,
|
|
@@ -7220,7 +7256,7 @@ var ChatMessage = class extends LitElement6 {
|
|
|
7220
7256
|
<span
|
|
7221
7257
|
data-testid="message-text"
|
|
7222
7258
|
dir="${textDirection(displayedText)}"
|
|
7223
|
-
style="${callDetails ? "display:flex;align-items:center;gap:8px;" : "display:inline;"}user-select:text;-webkit-user-select:text;overflow-wrap:anywhere;word-break:break-word;min-width:0"
|
|
7259
|
+
style="${callDetails ? "display:flex;align-items:center;gap:8px;" : "display:inline;"}user-select:${this.isMobile ? "none" : "text"};-webkit-user-select:${this.isMobile ? "none" : "text"};overflow-wrap:anywhere;word-break:break-word;min-width:0"
|
|
7224
7260
|
>${callDetails ? faPhoneAlt : nothing3}${unsafeHTML((this.streamActive || isRevealing) && displayedText.trim() ? injectCursorAtEnd(markdownHtml, liveCursorHtml(isDark)) : markdownHtml)}</span>
|
|
7225
7261
|
` : nothing3}${attachments && attachments.length > 0 ? html7`
|
|
7226
7262
|
<div
|
|
@@ -7687,22 +7723,30 @@ var spinnerEl = (isDark, color) => html9`
|
|
|
7687
7723
|
style="width:40px;height:40px;border:4px solid ${isDark ? "#ffffff1a" : "#00000010"};border-top:4px solid ${color ?? (isDark ? "#ffffff80" : "#00000040")};border-radius:50%;animation:spin 1s linear infinite"
|
|
7688
7724
|
></div>
|
|
7689
7725
|
`;
|
|
7690
|
-
var
|
|
7691
|
-
var
|
|
7692
|
-
var
|
|
7726
|
+
var syncingBarKeyframes = `@keyframes syncingSweep{0%{transform:translateX(-100%)}100%{transform:translateX(350%)}}`;
|
|
7727
|
+
var messageAreaWrapperStyle = "position:relative;display:flex;flex-direction:column;flex:1;min-height:0;min-width:0;overflow:hidden";
|
|
7728
|
+
var syncingOverlayStyle = "position:absolute;top:0;left:0;right:0;z-index:9;pointer-events:none;display:flex;flex-direction:column;align-items:center";
|
|
7729
|
+
var syncingTrackStyle = (isDark) => `width:100%;height:2px;overflow:hidden;background:${isDark ? "rgba(255,255,255,0.06)" : "rgba(24,23,21,0.05)"}`;
|
|
7730
|
+
var syncingTrackBarStyle = (isDark, color) => `height:100%;width:32%;border-radius:9999px;background:${color ?? (isDark ? "rgba(147,197,253,0.75)" : "rgba(57,88,127,0.65)")};animation:syncingSweep 1.3s ease-in-out infinite`;
|
|
7731
|
+
var syncingPillStyle = (isDark, textColor) => `margin-top:8px;display:inline-flex;align-items:center;gap:6px;padding:3px 10px;border-radius:9999px;font-size:11px;font-weight:500;letter-spacing:0.01em;backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);background:${isDark ? "rgba(24,24,22,0.78)" : "rgba(250,249,245,0.84)"};color:${textColor ?? (isDark ? "#b8b3a8" : "#625e56")};border:1px solid ${isDark ? "rgba(255,255,255,0.08)" : "rgba(24,23,21,0.08)"};box-shadow:0 2px 8px ${isDark ? "rgba(0,0,0,0.28)" : "rgba(24,23,21,0.06)"}`;
|
|
7732
|
+
var syncingSpinnerStyle = (isDark, color) => `width:10px;height:10px;border:1.5px solid ${isDark ? "rgba(255,255,255,0.16)" : "rgba(24,23,21,0.14)"};border-top:1.5px solid ${color ?? (isDark ? "#93c5fd" : "#39587f")};border-radius:50%;animation:spin 0.85s linear infinite;flex-shrink:0`;
|
|
7693
7733
|
var syncingIndicator = (isDark, color) => html9`
|
|
7694
|
-
<div
|
|
7734
|
+
<div
|
|
7735
|
+
data-testid="messages-syncing-indicator"
|
|
7736
|
+
role="status"
|
|
7737
|
+
aria-live="polite"
|
|
7738
|
+
style="${syncingOverlayStyle}"
|
|
7739
|
+
>
|
|
7695
7740
|
<style>
|
|
7696
7741
|
${spinnerKeyframes}
|
|
7742
|
+
${syncingBarKeyframes}
|
|
7697
7743
|
</style>
|
|
7698
|
-
<div
|
|
7699
|
-
|
|
7700
|
-
|
|
7701
|
-
|
|
7702
|
-
style="${syncingPillStyle(isDark, color)}"
|
|
7703
|
-
>
|
|
7744
|
+
<div style="${syncingTrackStyle(isDark)}">
|
|
7745
|
+
<div style="${syncingTrackBarStyle(isDark, color)}"></div>
|
|
7746
|
+
</div>
|
|
7747
|
+
<div style="${syncingPillStyle(isDark, color)}">
|
|
7704
7748
|
<span style="${syncingSpinnerStyle(isDark, color)}"></span>
|
|
7705
|
-
<span>Syncing
|
|
7749
|
+
<span>Syncing…</span>
|
|
7706
7750
|
</div>
|
|
7707
7751
|
</div>
|
|
7708
7752
|
`;
|
|
@@ -8118,6 +8162,7 @@ var ChatBox = class extends LitElement8 {
|
|
|
8118
8162
|
_prevMessageCount = 0;
|
|
8119
8163
|
_pendingEditLastOwn = false;
|
|
8120
8164
|
_stuckToBottom = true;
|
|
8165
|
+
_userTouchingMessages = false;
|
|
8121
8166
|
_loadingMore = false;
|
|
8122
8167
|
_prevScrollHeight = 0;
|
|
8123
8168
|
_resizeObserver = null;
|
|
@@ -8545,10 +8590,16 @@ var ChatBox = class extends LitElement8 {
|
|
|
8545
8590
|
el.scrollTop = el.scrollHeight;
|
|
8546
8591
|
this._showScrollDownButton = false;
|
|
8547
8592
|
}
|
|
8593
|
+
_onMessagesTouchStart = () => {
|
|
8594
|
+
this._userTouchingMessages = true;
|
|
8595
|
+
};
|
|
8596
|
+
_onMessagesTouchEnd = () => {
|
|
8597
|
+
this._userTouchingMessages = false;
|
|
8598
|
+
};
|
|
8548
8599
|
_handleScroll = () => {
|
|
8549
8600
|
const el = this._messagesContainerEl;
|
|
8550
8601
|
if (!el) return;
|
|
8551
|
-
this._stuckToBottom = el.scrollHeight
|
|
8602
|
+
this._stuckToBottom = isNearBottom(el.scrollHeight, el.scrollTop, el.clientHeight);
|
|
8552
8603
|
this._showScrollDownButton = shouldShowScrollDownButton(el.scrollHeight, el.scrollTop, el.clientHeight);
|
|
8553
8604
|
if (!this._loadingMore && el.scrollTop === 0 && this.canLoadMore) {
|
|
8554
8605
|
this._loadingMore = true;
|
|
@@ -9055,14 +9106,18 @@ var ChatBox = class extends LitElement8 {
|
|
|
9055
9106
|
}
|
|
9056
9107
|
if (this._contentEl && !this._resizeObserver) {
|
|
9057
9108
|
this._resizeObserver = new ResizeObserver(() => {
|
|
9058
|
-
if (this._stuckToBottom
|
|
9109
|
+
if (this._stuckToBottom && !this._userTouchingMessages) {
|
|
9110
|
+
this._scrollToBottom();
|
|
9111
|
+
}
|
|
9059
9112
|
});
|
|
9060
9113
|
this._resizeObserver.observe(this._contentEl);
|
|
9061
9114
|
}
|
|
9062
9115
|
if (this._inputAreaEl && this._contentEl && !this._inputResizeObserver) {
|
|
9063
9116
|
this._inputResizeObserver = new ResizeObserver(([entry]) => {
|
|
9064
9117
|
this._inputAreaHeight = entry.contentRect.height + 8;
|
|
9065
|
-
if (this._stuckToBottom
|
|
9118
|
+
if (this._stuckToBottom && !this._userTouchingMessages) {
|
|
9119
|
+
this._scrollToBottom();
|
|
9120
|
+
}
|
|
9066
9121
|
});
|
|
9067
9122
|
this._inputResizeObserver.observe(this._inputAreaEl);
|
|
9068
9123
|
}
|
|
@@ -9116,9 +9171,14 @@ var ChatBox = class extends LitElement8 {
|
|
|
9116
9171
|
this._messagesContainerEl.scrollTop = this._messagesContainerEl.scrollHeight - this._prevScrollHeight;
|
|
9117
9172
|
this._loadingMore = false;
|
|
9118
9173
|
if (this._fetchingMore) this._fetchingMore = false;
|
|
9119
|
-
} else if (this._stuckToBottom || this._initialLoad) {
|
|
9174
|
+
} else if ((this._stuckToBottom || this._initialLoad) && !this._userTouchingMessages) {
|
|
9175
|
+
const wasInitialLoad = this._initialLoad;
|
|
9120
9176
|
this._scrollToBottom();
|
|
9121
|
-
requestAnimationFrame(() =>
|
|
9177
|
+
requestAnimationFrame(() => {
|
|
9178
|
+
if (!this._userTouchingMessages && (this._stuckToBottom || wasInitialLoad)) {
|
|
9179
|
+
this._scrollToBottom();
|
|
9180
|
+
}
|
|
9181
|
+
});
|
|
9122
9182
|
if (this.messages.length > 0 && !this.isLoading) {
|
|
9123
9183
|
this._initialLoad = false;
|
|
9124
9184
|
}
|
|
@@ -9440,11 +9500,16 @@ var ChatBox = class extends LitElement8 {
|
|
|
9440
9500
|
|
|
9441
9501
|
<audio data-remote-audio autoplay style="display:none"></audio>
|
|
9442
9502
|
|
|
9443
|
-
<div
|
|
9444
|
-
|
|
9445
|
-
|
|
9446
|
-
|
|
9447
|
-
|
|
9503
|
+
<div style="${messageAreaWrapperStyle}">
|
|
9504
|
+
${this.isSyncing && !this.isLoading ? syncingIndicator(isDark, customColors?.text) : nothing4}
|
|
9505
|
+
<div
|
|
9506
|
+
data-testid="message-list"
|
|
9507
|
+
data-scrollable
|
|
9508
|
+
@touchstart="${this._onMessagesTouchStart}"
|
|
9509
|
+
@touchend="${this._onMessagesTouchEnd}"
|
|
9510
|
+
@touchcancel="${this._onMessagesTouchEnd}"
|
|
9511
|
+
style="${messageContainerStyle(isDark, customColors)}"
|
|
9512
|
+
>
|
|
9448
9513
|
<div
|
|
9449
9514
|
data-content-inner
|
|
9450
9515
|
style="display:flex;flex-direction:column;gap:8px;padding:12px 12px ${this._inputAreaHeight}px 12px;flex-grow:1;width:100%;max-width:100%;box-sizing:border-box;min-width:0;${contentMaxWidthStyle(customColors)}"
|
|
@@ -9497,9 +9562,10 @@ var ChatBox = class extends LitElement8 {
|
|
|
9497
9562
|
}
|
|
9498
9563
|
if (entry.kind === "stream") return entry.stream.elementId;
|
|
9499
9564
|
return "typing";
|
|
9500
|
-
}, (entry) => this._renderTimelineEntry(entry, customColors, isDark, quickReplyEntryId, unreadDivider))} ${this._isSending ? sendingIndicator(sendingStatusText(this._sendingType), customColors?.primary ?? defaultPrimary(isDark), isDark) : nothing4}
|
|
9565
|
+
}, (entry) => this._renderTimelineEntry(entry, customColors, isDark, quickReplyEntryId, unreadDivider))} ${this._isSending ? sendingIndicator(sendingStatusText(this._sendingType), customColors?.primary ?? defaultPrimary(isDark), isDark) : nothing4}
|
|
9501
9566
|
`}
|
|
9502
9567
|
</div>
|
|
9568
|
+
</div>
|
|
9503
9569
|
</div>
|
|
9504
9570
|
|
|
9505
9571
|
${this._showScrollDownButton ? html9`
|
|
@@ -10218,7 +10284,7 @@ var uiOverridesMap = (uiElements) => new Map(uiElements.map((el) => [
|
|
|
10218
10284
|
}
|
|
10219
10285
|
]));
|
|
10220
10286
|
var chatSwitcherContainerStyle = "display:flex;flex-direction:row;width:100%;height:100%;min-height:0;min-width:0;overflow:hidden;position:relative";
|
|
10221
|
-
var sidebarContainerStyle = (isDark, customColors) => `width:280px;min-width:240px;max-width:
|
|
10287
|
+
var sidebarContainerStyle = (isDark, customColors) => `width:clamp(280px, 24vw, 420px);min-width:240px;max-width:420px;flex-shrink:0;display:flex;flex-direction:column;height:100%;min-height:0;background:${customColors?.background ?? (isDark ? "#111110" : "#f6f4ee")};border-right:1px solid ${isDark ? "#252420" : "#e7e4dc"};font-family:sans-serif;box-sizing:border-box`;
|
|
10222
10288
|
var sidebarHeaderStyle = (isDark) => `padding:12px 14px;border-bottom:1px solid ${isDark ? "#222222" : "#eeeeee"};display:flex;flex-direction:column;gap:8px;flex-shrink:0`;
|
|
10223
10289
|
var sidebarSearchInputStyle = (isDark, customColors) => `width:100%;padding:8px 12px;border-radius:8px;font-size:13px;outline:none;border:1px solid ${inputBorderColor(isDark, customColors)};background:${customColors?.inputBackground ?? defaultInputBackground(isDark)};color:${customColors?.inputBackground ? inputTextColor(isDark, customColors) : customColors?.text ?? (isDark ? "#f4f4f4" : "#111827")};box-sizing:border-box`;
|
|
10224
10290
|
var sidebarListStyle = (scrollbarColor) => `flex:1;min-height:0;overflow-y:auto;padding:6px 8px;display:flex;flex-direction:column;gap:2px;${scrollbarColor ? `scrollbar-color:${scrollbarColor};` : ""}`;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "alice-and-bot",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.94",
|
|
4
4
|
"description": "A chat network for agents. Open-source, end-to-end encrypted messaging SDK, React chat UI, and embeddable widgets for AI agents and humans.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|