alice-and-bot 1.0.74 → 1.0.75
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.
|
@@ -178,6 +178,12 @@ export declare class ChatBox extends LitElement {
|
|
|
178
178
|
_showScrollDownButton: {
|
|
179
179
|
state: boolean;
|
|
180
180
|
};
|
|
181
|
+
_isEditingTitle: {
|
|
182
|
+
state: boolean;
|
|
183
|
+
};
|
|
184
|
+
_titleDraft: {
|
|
185
|
+
state: boolean;
|
|
186
|
+
};
|
|
181
187
|
};
|
|
182
188
|
messages: AbstracChatMessage[];
|
|
183
189
|
credentials: import("../../protocol/src/clientApi.js").Credentials | null;
|
|
@@ -242,6 +248,8 @@ export declare class ChatBox extends LitElement {
|
|
|
242
248
|
private _replyingTo: any;
|
|
243
249
|
private _autocompleteState: any;
|
|
244
250
|
private _showScrollDownButton: any;
|
|
251
|
+
private _isEditingTitle: any;
|
|
252
|
+
private _titleDraft: any;
|
|
245
253
|
constructor();
|
|
246
254
|
private _messagesContainerEl: any;
|
|
247
255
|
private _contentEl: any;
|
|
@@ -276,7 +284,11 @@ export declare class ChatBox extends LitElement {
|
|
|
276
284
|
override disconnectedCallback(): void;
|
|
277
285
|
private _outsideClickHandler: any;
|
|
278
286
|
private _handleMenuCall: any;
|
|
279
|
-
private
|
|
287
|
+
private _startEditingTitle: any;
|
|
288
|
+
private _onTitleDraftInput: any;
|
|
289
|
+
private _cancelEditingTitle: any;
|
|
290
|
+
private _commitEditingTitle: any;
|
|
291
|
+
private _onTitleDraftKeydown: any;
|
|
280
292
|
private _handleMenuNewThread: any;
|
|
281
293
|
private _handleMenuSecretIdentity: any;
|
|
282
294
|
private _handleMenuImportIdentity: 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;AAgD/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;AAgD/E,cACE,kBAAkB,EAClB,cAAc,EACd,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,gBAAgB,qBAEE;AAuepB,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;MAAW;;IACX;;IACA;MAAgB;;IAChB;MAAqB;;IACrB;MAAe;;IACf;MAAmB;;IACnB;MAAa;;IACb;MAAoB;;IACpB;MAAgB;;IAChB;MAAuB;;IACvB;MAAqB;;IACrB;MAAwB;;IACxB;MAAmB;;IACnB;;IACA;MAAqB;;IACrB;MAAkB;;IAClB;MAAgB;;IAChB;MAAe;;IACf;MAAgB;;IAChB;MAAgB;;IAChB;MAAa;;IACb;MAAgB;;IAChB;MAAU;;IACV;MAAW;;IACX;MAAiB;;IACjB;MAAkB;;IAClB;MAAkB;;IAClB;MAAkB;;IAClB;MAAiB;;IACjB;MAAe;;IACf;MAAoB;;IACpB;MAAU;;IACV;MAAgB;;IAChB;MAAU;;IACV;MAAiB;;IACjB;MAAmB;;IACnB;MAAgB;;IAChB;MAAsB;;IACtB;MAAsB;;IACtB;MAAgB;;IAChB;MAAuB;;IACvB;MAAc;;IACd;MAAgB;;IAChB;MAAiB;;IACjB;MAAmB;;IACnB;MAAqB;;IACrB;MAAoB;;IACpB;MAAe;;IACf;MAAsB;;IACtB;MAAyB;;IACzB;MAAmB;;IACnB;MAAe;;IACf;EAEM,UAAU,qBAAqB;EAC/B,uDACsC,cAC1C,IAAI,CAAC;EACD,WAAW,OAAO,CAAC;EACnB,aAA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QAAQ,0BAAmD;EAC3D,QAAQ,kBAA2C;EACnD,QAAQ,iBAAwD;EAChE,QAAQ,2BAA+D;EACvE,QAAQ,eAAkB;EAE1B,SAAS,oBAAoB;EAI7B,SAAS;EAkBT,SAAS;EAmBT,QAAQ,0BA4BN;UAEM;EAMR,QAAQ,wBAaN;EAEF,QAAQ,wBAIN;EAEF,QAAQ,yBAGN;EAEF,QAAQ,yBAaN;EAEF,QAAQ,0BAQN;EAEF,QAAQ,0BAMN;UAEM;UAQA;UAQA;UAQA;UA0CA;UAuCA;UAyCA;UAOA;EAOR,QAAQ,mBAgBN;UAEM;UAwBM;UA0DN;EAQR,QAAQ,uBAIN;EAEF,QAAQ,2BAkBN;UAEY;EA+Dd,QAAQ,kBASN;UAEM;EA0BR,QAAQ,6BAEN;UAEM;EAwBR,QAAQ,sBAKN;EAEF,QAAQ,sBAUN;EAEF,QAAQ,wBAiDN;EAEF,QAAQ,mBAIN;EAEF,QAAQ,uBAaN;EAEF,QAAQ,qBAIN;EAEF,QAAQ,oBAIN;EAEF,QAAQ,uBAIN;EAEF,QAAQ,uBAQN;EAEF,QAAQ,iBAON;EAEF,QAAQ,kBAEN;EAEF,QAAQ,oBAIN;EAEF,QAAQ,qBAEN;UAEU;EAMZ,SAAS,QAAQ,SAAS,IAAI,MAAM,EAAE,OAAO,CAAC;EAgJ9C,SAAS,UAAU;UAs1BX;UAkCA;AA2DV"}
|
|
@@ -116,9 +116,8 @@ export declare class ConnectedChat extends LitElement {
|
|
|
116
116
|
private _copiedParticipantId: any;
|
|
117
117
|
private _showSecretIdentityPopup: any;
|
|
118
118
|
private _showImportIdentityPopup: any;
|
|
119
|
-
private
|
|
120
|
-
private
|
|
121
|
-
private _renameInput: any;
|
|
119
|
+
private _editingSidebarConvId: any;
|
|
120
|
+
private _sidebarRenameInput: any;
|
|
122
121
|
private _renaming: any;
|
|
123
122
|
private _qrCodeDataUrl: any;
|
|
124
123
|
private _transferUrl: any;
|
|
@@ -160,12 +159,13 @@ export declare class ConnectedChat extends LitElement {
|
|
|
160
159
|
private _handleNewThread: any;
|
|
161
160
|
private _handleCloseParticipants: any;
|
|
162
161
|
private _currentDisplayTitle: any;
|
|
163
|
-
private
|
|
164
|
-
private
|
|
165
|
-
private
|
|
166
|
-
private
|
|
167
|
-
private
|
|
168
|
-
private
|
|
162
|
+
private _startSidebarRename: any;
|
|
163
|
+
private _onSidebarRenameInput: any;
|
|
164
|
+
private _cancelSidebarRename: any;
|
|
165
|
+
private _commitSidebarRename: any;
|
|
166
|
+
private _onSidebarRenameKeydown: any;
|
|
167
|
+
private _handleRenameConversation: any;
|
|
168
|
+
private _submitRename: any;
|
|
169
169
|
private _handleSecretIdentity: any;
|
|
170
170
|
private _chatWithInFlight: any;
|
|
171
171
|
private _handleClick: any;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connected-chat.d.ts","sources":["../../../lit/components/connected-chat.ts"],"names":[],"mappings":"AAAA,SAAe,UAAU,EAAE,OAAO,EAAE,KAAK,cAAc,cAAwB;AAE/E,cAEE,WAAW,0CAI4B;AAoBzC,SAEE,KAAK,YAAY,mCAUe;AA0ClC,cAKE,YAAY,EAGZ,gBAAgB,qBACE;
|
|
1
|
+
{"version":3,"file":"connected-chat.d.ts","sources":["../../../lit/components/connected-chat.ts"],"names":[],"mappings":"AAAA,SAAe,UAAU,EAAE,OAAO,EAAE,KAAK,cAAc,cAAwB;AAE/E,cAEE,WAAW,0CAI4B;AAoBzC,SAEE,KAAK,YAAY,mCAUe;AA0ClC,cAKE,YAAY,EAGZ,gBAAgB,qBACE;AA6nBpB,OAAO,cAAM,sBAAsB;EACjC,gBAAgB;IACd;MAAe;;IACf;MAAkB;;IAClB;MAAuB;;IACvB;MAAU;;IACV;MAAW;;IACX;MAAoB;;IACpB;MAAoB;;IACpB;MAAgB;;IAChB;MAAqB;;IACrB;MAAwB;;IACxB;MAAmB;;IACnB;MAAuB;;IACvB;MAAU;;IACV;MAAgB;;IAChB;MAAqB;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AQ,2BAyBN;EAEF,QAAQ,uBAA0B;EAElC,QAAQ,kBAiBN;EAEF,QAAQ,qBA0DN;EAEF,QAAQ,2BAIN;EAEF,QAAQ,4BAcN;EAEF,QAAQ,0BAKN;EAEF,QAAQ,yBAoCN;EAEF,QAAQ,6BAIN;EAEF,QAAQ,4BAaN;EAEF,QAAQ,sBAEN;EACF,QAAQ,uBAEN;EACF,QAAQ,uBAEN;EACF,QAAQ,oBAEN;EACF,QAAQ,uBAEN;EAEF,QAAQ,mBAGN;EAEF,QAAQ,wBAGN;UAEM;UAgJA;EAqFR,SAAS,UAAU,wBAAwB;AA6S7C"}
|
package/components.js
CHANGED
|
@@ -4736,6 +4736,7 @@ var renderReplyBar = (reply, isDark, onClear, custom) => {
|
|
|
4736
4736
|
`;
|
|
4737
4737
|
};
|
|
4738
4738
|
var headerButtonStyle = "background:transparent;border:none;cursor:pointer;color:inherit;display:flex;align-items:center;justify-content:center;width:28px;height:28px;border-radius:50%;padding:0;font-size:16px;line-height:1;flex-shrink:0";
|
|
4739
|
+
var inlineTitleInputStyle = (headerIsLight) => `width:100%;max-width:240px;box-sizing:border-box;padding:1px 8px;margin:0;border-radius:6px;border:1px solid ${headerIsLight ? "rgba(24,23,21,0.22)" : "rgba(255,255,255,0.22)"};background:${headerIsLight ? "rgba(24,23,21,0.05)" : "rgba(255,255,255,0.08)"};color:inherit;font:inherit;letter-spacing:inherit;text-align:center;outline:none;line-height:1.35`;
|
|
4739
4740
|
var messageContainerStyle = (isDark, custom) => `flex-grow:1;display:flex;flex-direction:column;overflow-y:auto;overflow-x:hidden;min-height:0;scrollbar-color:${custom?.scrollbarColor ?? (isDark ? "#2a2a2a #111" : "#cbd5e1 #e2e8f0")};scrollbar-width:thin`;
|
|
4740
4741
|
var isTransparentInput = (custom) => custom?.inputBackground === "transparent";
|
|
4741
4742
|
var sendButtonStyle = (isDark, custom) => {
|
|
@@ -4961,6 +4962,12 @@ var ChatBox = class extends LitElement8 {
|
|
|
4961
4962
|
},
|
|
4962
4963
|
_showScrollDownButton: {
|
|
4963
4964
|
state: true
|
|
4965
|
+
},
|
|
4966
|
+
_isEditingTitle: {
|
|
4967
|
+
state: true
|
|
4968
|
+
},
|
|
4969
|
+
_titleDraft: {
|
|
4970
|
+
state: true
|
|
4964
4971
|
}
|
|
4965
4972
|
};
|
|
4966
4973
|
constructor() {
|
|
@@ -5010,6 +5017,8 @@ var ChatBox = class extends LitElement8 {
|
|
|
5010
5017
|
this._replyingTo = null;
|
|
5011
5018
|
this._autocompleteState = null;
|
|
5012
5019
|
this._showScrollDownButton = false;
|
|
5020
|
+
this._isEditingTitle = false;
|
|
5021
|
+
this._titleDraft = "";
|
|
5013
5022
|
}
|
|
5014
5023
|
_messagesContainerEl = null;
|
|
5015
5024
|
_contentEl = null;
|
|
@@ -5108,14 +5117,51 @@ var ChatBox = class extends LitElement8 {
|
|
|
5108
5117
|
this._showMenu = false;
|
|
5109
5118
|
this.onStartCall?.();
|
|
5110
5119
|
}
|
|
5111
|
-
|
|
5120
|
+
_startEditingTitle = (e) => {
|
|
5121
|
+
if (!this.credentials) return;
|
|
5112
5122
|
e.stopPropagation();
|
|
5113
5123
|
this._showMenu = false;
|
|
5124
|
+
this._titleDraft = this.title;
|
|
5125
|
+
this._isEditingTitle = true;
|
|
5126
|
+
this.updateComplete.then(() => {
|
|
5127
|
+
const input = this.shadowRoot?.querySelector('[data-testid="rename-conversation-input"]');
|
|
5128
|
+
input?.focus();
|
|
5129
|
+
input?.select();
|
|
5130
|
+
}).catch(() => {
|
|
5131
|
+
});
|
|
5132
|
+
};
|
|
5133
|
+
_onTitleDraftInput = (e) => {
|
|
5134
|
+
if (e.target instanceof HTMLInputElement) {
|
|
5135
|
+
this._titleDraft = e.target.value;
|
|
5136
|
+
}
|
|
5137
|
+
};
|
|
5138
|
+
_cancelEditingTitle = () => {
|
|
5139
|
+
this._isEditingTitle = false;
|
|
5140
|
+
this._titleDraft = "";
|
|
5141
|
+
};
|
|
5142
|
+
_commitEditingTitle = () => {
|
|
5143
|
+
if (!this._isEditingTitle) return;
|
|
5144
|
+
const trimmed = this._titleDraft.trim();
|
|
5145
|
+
this._isEditingTitle = false;
|
|
5146
|
+
this._titleDraft = "";
|
|
5147
|
+
if (!trimmed || trimmed === this.title) return;
|
|
5114
5148
|
this.dispatchEvent(new CustomEvent("rename-conversation", {
|
|
5115
5149
|
bubbles: true,
|
|
5116
|
-
composed: true
|
|
5150
|
+
composed: true,
|
|
5151
|
+
detail: {
|
|
5152
|
+
title: trimmed
|
|
5153
|
+
}
|
|
5117
5154
|
}));
|
|
5118
5155
|
};
|
|
5156
|
+
_onTitleDraftKeydown = (e) => {
|
|
5157
|
+
if (e.key === "Enter") {
|
|
5158
|
+
e.preventDefault();
|
|
5159
|
+
this._commitEditingTitle();
|
|
5160
|
+
} else if (e.key === "Escape") {
|
|
5161
|
+
e.preventDefault();
|
|
5162
|
+
this._cancelEditingTitle();
|
|
5163
|
+
}
|
|
5164
|
+
};
|
|
5119
5165
|
_handleMenuNewThread = (e) => {
|
|
5120
5166
|
e.stopPropagation();
|
|
5121
5167
|
this._showMenu = false;
|
|
@@ -5158,13 +5204,6 @@ var ChatBox = class extends LitElement8 {
|
|
|
5158
5204
|
Voice Call
|
|
5159
5205
|
</div>
|
|
5160
5206
|
` : nothing4} ${this.credentials ? html9`
|
|
5161
|
-
<div
|
|
5162
|
-
class="menu-item"
|
|
5163
|
-
data-testid="menu-rename-chat"
|
|
5164
|
-
@click="${this._handleMenuRenameConversation}"
|
|
5165
|
-
>
|
|
5166
|
-
Rename Chat
|
|
5167
|
-
</div>
|
|
5168
5207
|
<div
|
|
5169
5208
|
class="menu-item"
|
|
5170
5209
|
@click="${this._handleMenuNewThread}"
|
|
@@ -5651,6 +5690,9 @@ var ChatBox = class extends LitElement8 {
|
|
|
5651
5690
|
if (changed.has("title")) this._inputEl.focus();
|
|
5652
5691
|
}
|
|
5653
5692
|
const prevTitle = changed.get("title");
|
|
5693
|
+
if (changed.has("title") && prevTitle !== void 0) {
|
|
5694
|
+
this._isEditingTitle = false;
|
|
5695
|
+
}
|
|
5654
5696
|
if (changed.has("title") && prevTitle !== void 0 && prevTitle !== "Chat" && !empty(this._optimisticMessages)) {
|
|
5655
5697
|
this._optimisticMessages = [];
|
|
5656
5698
|
}
|
|
@@ -5901,15 +5943,29 @@ var ChatBox = class extends LitElement8 {
|
|
|
5901
5943
|
</button>
|
|
5902
5944
|
` : nothing4}
|
|
5903
5945
|
<div style="flex:1;display:flex;justify-content:center;min-width:0;overflow:hidden">
|
|
5904
|
-
|
|
5905
|
-
|
|
5906
|
-
|
|
5907
|
-
|
|
5908
|
-
|
|
5909
|
-
|
|
5910
|
-
|
|
5911
|
-
|
|
5912
|
-
|
|
5946
|
+
${this._isEditingTitle ? html9`
|
|
5947
|
+
<input
|
|
5948
|
+
type="text"
|
|
5949
|
+
data-testid="rename-conversation-input"
|
|
5950
|
+
maxlength="100"
|
|
5951
|
+
aria-label="Rename chat"
|
|
5952
|
+
.value="${this._titleDraft}"
|
|
5953
|
+
style="${inlineTitleInputStyle(headerIsLight)}"
|
|
5954
|
+
@input="${this._onTitleDraftInput}"
|
|
5955
|
+
@keydown="${this._onTitleDraftKeydown}"
|
|
5956
|
+
@blur="${this._commitEditingTitle}"
|
|
5957
|
+
/>
|
|
5958
|
+
` : html9`
|
|
5959
|
+
<div
|
|
5960
|
+
data-testid="title-text"
|
|
5961
|
+
class="${this.credentials ? "title-editable" : ""}"
|
|
5962
|
+
title="${this.credentials ? "Click to rename" : ""}"
|
|
5963
|
+
@click="${this.credentials ? this._startEditingTitle : void 0}"
|
|
5964
|
+
style="text-align:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis"
|
|
5965
|
+
>
|
|
5966
|
+
<span style="overflow:hidden;text-overflow:ellipsis">${this.title}</span>${this.credentials ? html9`<span class="title-edit-icon">${faPen}</span>` : nothing4}
|
|
5967
|
+
</div>
|
|
5968
|
+
`}
|
|
5913
5969
|
</div>
|
|
5914
5970
|
${this._renderHeaderMenu()} ${this.onClose ? html9`
|
|
5915
5971
|
<button
|
|
@@ -6539,7 +6595,7 @@ var participantIdStyle = (isDark) => `font-size:11px;font-family:monospace;color
|
|
|
6539
6595
|
var copyButtonStyle = (isDark) => `background:${isDark ? "#2a2a2a" : "#e5e7eb"};border:none;cursor:pointer;padding:6px 12px;border-radius:6px;font-size:12px;font-weight:500;color:${isDark ? "#f4f4f4" : "#222"};transition:background 0.15s;flex-shrink:0`;
|
|
6540
6596
|
var popupTitleStyle = (isDark) => `font-size:18px;font-weight:700;color:${isDark ? "#f4f4f4" : "#222"};margin:0;text-align:center`;
|
|
6541
6597
|
var closeButtonStyle = (isDark) => `padding:8px 16px;border-radius:8px;border:none;cursor:pointer;font-size:14px;font-weight:500;background:${isDark ? "#2a2a2a" : "#e5e7eb"};color:${isDark ? "#f4f4f4" : "#222"};transition:background 0.15s;align-self:center;margin-top:8px`;
|
|
6542
|
-
var
|
|
6598
|
+
var sidebarInlineRenameInputStyle = (isDark) => `width:100%;box-sizing:border-box;padding:1px 6px;margin:0;border-radius:4px;border:1px solid ${isDark ? "rgba(255,255,255,0.24)" : "rgba(24,23,21,0.22)"};background:${isDark ? "rgba(255,255,255,0.08)" : "rgba(24,23,21,0.05)"};color:${isDark ? "#f3f1ea" : "#181715"};font-size:13px;font-weight:500;line-height:18px;outline:none`;
|
|
6543
6599
|
var sidebarRenameButtonStyle = (isDark, customColors) => `background:transparent;border:none;cursor:pointer;padding:6px;border-radius:6px;color:${customColors?.text ?? (isDark ? "#9ca3af" : "#6b7280")};display:flex;align-items:center;justify-content:center;font-size:12px;transition:opacity 0.15s,background 0.15s;flex-shrink:0`;
|
|
6544
6600
|
var sidebarItemBodyStyle = "flex:1;min-width:0;display:flex;flex-direction:column;gap:2px";
|
|
6545
6601
|
var sidebarItemTopRowStyle = "display:flex;align-items:center;justify-content:space-between;gap:8px;min-width:0;min-height:18px";
|
|
@@ -6883,9 +6939,8 @@ var ConnectedChat = class extends LitElement10 {
|
|
|
6883
6939
|
_copiedParticipantId = null;
|
|
6884
6940
|
_showSecretIdentityPopup = false;
|
|
6885
6941
|
_showImportIdentityPopup = false;
|
|
6886
|
-
|
|
6887
|
-
|
|
6888
|
-
_renameInput = "";
|
|
6942
|
+
_editingSidebarConvId = null;
|
|
6943
|
+
_sidebarRenameInput = "";
|
|
6889
6944
|
_renaming = false;
|
|
6890
6945
|
_qrCodeDataUrl = "";
|
|
6891
6946
|
_transferUrl = "";
|
|
@@ -7414,44 +7469,52 @@ var ConnectedChat = class extends LitElement10 {
|
|
|
7414
7469
|
participants: this._participants
|
|
7415
7470
|
}, this.credentials?.publicSignKey ?? "", this._nameCache, this._identityDetails);
|
|
7416
7471
|
}
|
|
7417
|
-
|
|
7472
|
+
_startSidebarRename = (convId, currentTitle) => {
|
|
7418
7473
|
if (!this.credentials || !convId) return;
|
|
7419
|
-
this.
|
|
7420
|
-
this.
|
|
7421
|
-
this._renaming = false;
|
|
7422
|
-
this._showRenamePopup = true;
|
|
7474
|
+
this._editingSidebarConvId = convId;
|
|
7475
|
+
this._sidebarRenameInput = currentTitle;
|
|
7423
7476
|
this.requestUpdate();
|
|
7424
7477
|
this.updateComplete.then(() => {
|
|
7425
|
-
const input = this.querySelector("
|
|
7478
|
+
const input = this.querySelector('[data-testid="sidebar-rename-input"]');
|
|
7426
7479
|
input?.focus();
|
|
7427
7480
|
input?.select();
|
|
7428
7481
|
}).catch(() => {
|
|
7429
7482
|
});
|
|
7430
7483
|
};
|
|
7431
|
-
|
|
7432
|
-
|
|
7433
|
-
|
|
7484
|
+
_onSidebarRenameInput = (e) => {
|
|
7485
|
+
if (e.target instanceof HTMLInputElement) {
|
|
7486
|
+
this._sidebarRenameInput = e.target.value;
|
|
7487
|
+
}
|
|
7434
7488
|
};
|
|
7435
|
-
|
|
7436
|
-
this.
|
|
7437
|
-
this.
|
|
7489
|
+
_cancelSidebarRename = () => {
|
|
7490
|
+
this._editingSidebarConvId = null;
|
|
7491
|
+
this._sidebarRenameInput = "";
|
|
7438
7492
|
this.requestUpdate();
|
|
7439
7493
|
};
|
|
7440
|
-
|
|
7441
|
-
|
|
7494
|
+
_commitSidebarRename = () => {
|
|
7495
|
+
const convId = this._editingSidebarConvId;
|
|
7496
|
+
if (!convId) return;
|
|
7497
|
+
const trimmed = this._sidebarRenameInput.trim();
|
|
7498
|
+
this._editingSidebarConvId = null;
|
|
7499
|
+
this._sidebarRenameInput = "";
|
|
7500
|
+
this.requestUpdate();
|
|
7501
|
+
if (trimmed) this._submitRename(convId, trimmed);
|
|
7442
7502
|
};
|
|
7443
|
-
|
|
7503
|
+
_onSidebarRenameKeydown = (e) => {
|
|
7444
7504
|
if (e.key === "Enter") {
|
|
7445
7505
|
e.preventDefault();
|
|
7446
|
-
this.
|
|
7506
|
+
this._commitSidebarRename();
|
|
7447
7507
|
} else if (e.key === "Escape") {
|
|
7448
7508
|
e.preventDefault();
|
|
7449
|
-
this.
|
|
7509
|
+
this._cancelSidebarRename();
|
|
7450
7510
|
}
|
|
7451
7511
|
};
|
|
7452
|
-
|
|
7453
|
-
const trimmed =
|
|
7454
|
-
const convId = this.
|
|
7512
|
+
_handleRenameConversation = (e) => {
|
|
7513
|
+
const trimmed = e.detail?.title?.trim();
|
|
7514
|
+
const convId = this._activeConversationId || this.conversationId;
|
|
7515
|
+
if (trimmed && convId) this._submitRename(convId, trimmed);
|
|
7516
|
+
};
|
|
7517
|
+
_submitRename = async (convId, trimmed) => {
|
|
7455
7518
|
if (!trimmed || !this.credentials || !convId || this._renaming) return;
|
|
7456
7519
|
this._renaming = true;
|
|
7457
7520
|
this.requestUpdate();
|
|
@@ -7485,7 +7548,6 @@ var ConnectedChat = class extends LitElement10 {
|
|
|
7485
7548
|
}
|
|
7486
7549
|
}));
|
|
7487
7550
|
}
|
|
7488
|
-
this._showRenamePopup = false;
|
|
7489
7551
|
} catch (err) {
|
|
7490
7552
|
if (convId === activeId) this._conversationTitle = prevTitle;
|
|
7491
7553
|
console.error("Failed to rename conversation", err);
|
|
@@ -7741,10 +7803,24 @@ var ConnectedChat = class extends LitElement10 {
|
|
|
7741
7803
|
></chat-avatar>
|
|
7742
7804
|
<div style="${sidebarItemBodyStyle}">
|
|
7743
7805
|
<div style="${sidebarItemTopRowStyle}">
|
|
7744
|
-
|
|
7745
|
-
|
|
7746
|
-
|
|
7747
|
-
|
|
7806
|
+
${this._editingSidebarConvId === conv.id ? html11`
|
|
7807
|
+
<input
|
|
7808
|
+
type="text"
|
|
7809
|
+
data-testid="sidebar-rename-input"
|
|
7810
|
+
maxlength="100"
|
|
7811
|
+
aria-label="Rename chat"
|
|
7812
|
+
.value="${this._sidebarRenameInput}"
|
|
7813
|
+
style="${sidebarInlineRenameInputStyle(isDark)}"
|
|
7814
|
+
@click="${(e) => e.stopPropagation()}"
|
|
7815
|
+
@input="${this._onSidebarRenameInput}"
|
|
7816
|
+
@keydown="${this._onSidebarRenameKeydown}"
|
|
7817
|
+
@blur="${this._commitSidebarRename}"
|
|
7818
|
+
/>
|
|
7819
|
+
` : html11`
|
|
7820
|
+
<div style="${sidebarItemTitleStyle(isDark, isSelected, this.customColors)}">
|
|
7821
|
+
${displayName}
|
|
7822
|
+
</div>
|
|
7823
|
+
`} ${timeLabel && this._editingSidebarConvId !== conv.id ? html11`
|
|
7748
7824
|
<span style="${sidebarItemTimeStyle(isDark)}">${timeLabel}</span>
|
|
7749
7825
|
` : nothing6}
|
|
7750
7826
|
</div>
|
|
@@ -7762,7 +7838,7 @@ var ConnectedChat = class extends LitElement10 {
|
|
|
7762
7838
|
style="${sidebarRenameButtonStyle(isDark, this.customColors)}"
|
|
7763
7839
|
@click="${(e) => {
|
|
7764
7840
|
e.stopPropagation();
|
|
7765
|
-
this.
|
|
7841
|
+
this._startSidebarRename(conv.id, displayName);
|
|
7766
7842
|
}}"
|
|
7767
7843
|
>
|
|
7768
7844
|
${faPen}
|
|
@@ -7837,7 +7913,7 @@ var ConnectedChat = class extends LitElement10 {
|
|
|
7837
7913
|
.emptyMessage="${this.emptyMessage}"
|
|
7838
7914
|
.suggestedMessages="${this.suggestedMessages}"
|
|
7839
7915
|
@new-thread="${this._handleNewThread}"
|
|
7840
|
-
@rename-conversation="${this.
|
|
7916
|
+
@rename-conversation="${this._handleRenameConversation}"
|
|
7841
7917
|
@show-participants="${this._handleShowParticipants}"
|
|
7842
7918
|
@secret-identity="${this._handleSecretIdentity}"
|
|
7843
7919
|
@import-identity="${this._handleImportIdentity}"
|
|
@@ -8003,41 +8079,6 @@ var ConnectedChat = class extends LitElement10 {
|
|
|
8003
8079
|
</div>
|
|
8004
8080
|
</div>
|
|
8005
8081
|
</div>
|
|
8006
|
-
` : nothing6} ${this._showRenamePopup ? html11`
|
|
8007
|
-
<div style="${participantsOverlayStyle}" @click="${this._handleCloseRename}">
|
|
8008
|
-
<div style="${participantsPopupStyle(isDark)}" @click="${(e) => e.stopPropagation()}">
|
|
8009
|
-
<h3 style="${popupTitleStyle(isDark)}">Rename Chat</h3>
|
|
8010
|
-
<input
|
|
8011
|
-
type="text"
|
|
8012
|
-
id="rename-conversation-input"
|
|
8013
|
-
data-testid="rename-conversation-input"
|
|
8014
|
-
maxlength="100"
|
|
8015
|
-
placeholder="Chat name"
|
|
8016
|
-
.value="${this._renameInput}"
|
|
8017
|
-
style="${popupInputStyle(isDark)}"
|
|
8018
|
-
@input="${this._handleRenameInput}"
|
|
8019
|
-
@keydown="${this._handleRenameKeyDown}"
|
|
8020
|
-
/>
|
|
8021
|
-
<div style="display:flex;gap:8px;justify-content:center;width:100%">
|
|
8022
|
-
<button
|
|
8023
|
-
type="button"
|
|
8024
|
-
style="${closeButtonStyle(isDark)};flex:1;padding:10px;border-radius:8px;cursor:pointer;margin-top:0"
|
|
8025
|
-
@click="${this._handleCloseRename}"
|
|
8026
|
-
>
|
|
8027
|
-
Cancel
|
|
8028
|
-
</button>
|
|
8029
|
-
<button
|
|
8030
|
-
type="button"
|
|
8031
|
-
data-testid="rename-conversation-save"
|
|
8032
|
-
style="${copyButtonStyle(isDark)};flex:1;padding:10px;border-radius:8px;background:${isDark ? "#3b82f6" : "#2563eb"};color:#ffffff;cursor:pointer"
|
|
8033
|
-
?disabled="${this._renaming || !this._renameInput.trim()}"
|
|
8034
|
-
@click="${this._handleRenameSubmit}"
|
|
8035
|
-
>
|
|
8036
|
-
${this._renaming ? "Saving..." : "Save"}
|
|
8037
|
-
</button>
|
|
8038
|
-
</div>
|
|
8039
|
-
</div>
|
|
8040
|
-
</div>
|
|
8041
8082
|
` : nothing6}
|
|
8042
8083
|
`;
|
|
8043
8084
|
if (!this.enableChatSwitching) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "alice-and-bot",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.75",
|
|
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",
|