alice-and-bot 1.0.89 → 1.0.91
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/lit/components/chat-box.d.ts +4 -0
- package/_dist/lit/components/chat-box.d.ts.map +1 -1
- package/_dist/lit/components/connected-chat.d.ts +2 -0
- package/_dist/lit/components/connected-chat.d.ts.map +1 -1
- package/_dist/lit/core/subscriptions.d.ts +2 -0
- package/_dist/lit/core/subscriptions.d.ts.map +1 -1
- package/{chunk-S2542ELT.js → chunk-LUSXWTWB.js} +168 -22
- package/components.js +78 -18
- package/mod.js +1 -1
- package/package.json +1 -1
|
@@ -53,6 +53,9 @@ export declare class ChatBox extends LitElement {
|
|
|
53
53
|
isLoading: {
|
|
54
54
|
type: any;
|
|
55
55
|
};
|
|
56
|
+
isSyncing: {
|
|
57
|
+
type: any;
|
|
58
|
+
};
|
|
56
59
|
darkModeOverride: {
|
|
57
60
|
type: any;
|
|
58
61
|
};
|
|
@@ -223,6 +226,7 @@ export declare class ChatBox extends LitElement {
|
|
|
223
226
|
typingUsers: string[];
|
|
224
227
|
onInputActivity: (() => void) | undefined;
|
|
225
228
|
isLoading: boolean;
|
|
229
|
+
isSyncing: boolean;
|
|
226
230
|
darkModeOverride: boolean | undefined;
|
|
227
231
|
customColors: CustomColors | undefined;
|
|
228
232
|
onDecryptAttachment: ((url: string) => Promise<string>) | undefined;
|
|
@@ -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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AAS,WAAW,SAAS,IAAI,MAAM,EAAE,OAAO,CAAC;EAejD,SAAS,QAAQ,SAAS,IAAI,MAAM,EAAE,OAAO,CAAC;EA6K9C,SAAS,UAAU;UA08BX;UA0CA;AAwDV"}
|
|
@@ -123,6 +123,8 @@ export declare class ConnectedChat extends LitElement {
|
|
|
123
123
|
private _responsiveUnsub: any;
|
|
124
124
|
private _conversationKey: any;
|
|
125
125
|
private _messages: any;
|
|
126
|
+
private _isSyncingMessages: any;
|
|
127
|
+
private _hasFreshMessages: any;
|
|
126
128
|
private _hadMessages: any;
|
|
127
129
|
private _lastMessageSubscriptionKey: any;
|
|
128
130
|
private _lastMessageCount: 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,mCAWe;AAuDlC,cAKE,YAAY,EAGZ,gBAAgB,qBACE;AAiqBpB,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;MAA2B;;IAC3B;MAAsB;;IACtB;MAA6B;;IAC7B;MAAuB;;IACvB;MAAU;;IACV;MAAgB;;IAChB;MAAgB;;IAChB;MAAqB;;IACrB;MAAc;;IACd;MAAe;;IACf;MAAwB;;IACxB;MAA+B;;IAC/B;MAAoB;;IACpB;EAEM,aAAa,cAAc,IAAI,CAAC;EAChC,gBAAgB,MAAM,CAAC;EACvB,qBAAqB,eAAe,IAAI,GAAG,SAAS,CAAC;EACrD,eAAe,IAAI,IAAI,SAAS,CAAC;EACjC,gBAAgB,IAAI,IAAI,SAAS,CA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BAA0D;UAE1D;UA0BA;EAcR,QAAQ,iBA6BN;EAEF,QAAQ,gCA0CN;EAEF,QAAQ,8BAON;EAEF,QAAQ,iBAaN;EAEF,QAAQ,kBAaN;EAEF,QAAQ,yBAiBN;EAEF,QAAQ,0BAEN;EAEF,QAAQ,wBAGN;EAEF,QAAQ,6BAGN;EAEF,QAAQ,sBA8BN;EAEF,QAAQ,8BAGN;UAEM;EAcR,QAAQ,yBAaN;EAEF,QAAQ,2BAIN;EAEF,QAAQ,0BAKN;EAEF,QAAQ,0BAUN;EAEF,QAAQ,6BAQN;EAEF,QAAQ,+BAMN;EAEF,QAAQ,mBAuCN;EAEF,QAAQ,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;UAEM;EAgBR,QAAQ,0BA+BN;EAEF,QAAQ,wBAGN;EAEF,QAAQ,0BAiBN;UAEM;UAwLA;EA+FR,SAAS,UAAU,wBAAwB;AAiT7C"}
|
|
@@ -21,6 +21,8 @@ export type DecryptedMessagesResult = {
|
|
|
21
21
|
messages: DecipheredMessage[] | null;
|
|
22
22
|
canLoadMore: boolean;
|
|
23
23
|
loadMore: () => void;
|
|
24
|
+
isSyncing?: boolean;
|
|
25
|
+
hasFreshData?: boolean;
|
|
24
26
|
};
|
|
25
27
|
export declare const subscribeIdentityProfile: (publicSignKey: string, onChange: (profile: {
|
|
26
28
|
id: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subscriptions.d.ts","sources":["../../../lit/core/subscriptions.ts"],"names":[],"mappings":"AAGA,SAEE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;AAiRJ,OAAO,cAAM,0BACX,aAAa,aACb,cAAc,MAAM,IACpB,iBAAiB,IAAI,MAAM,KAAK,IAAI,EACpC,yBACO,IAAI,CAmEX"}
|
|
@@ -693,6 +693,12 @@ var _schema = i.schema({
|
|
|
693
693
|
btcAmount: i.number(),
|
|
694
694
|
claimedTxid: i.string().optional().indexed(),
|
|
695
695
|
createdAt: i.number().indexed()
|
|
696
|
+
}),
|
|
697
|
+
chatFolders: i.entity({
|
|
698
|
+
name: i.string(),
|
|
699
|
+
ownerEmail: i.string().indexed(),
|
|
700
|
+
order: i.number().optional(),
|
|
701
|
+
createdAt: i.number()
|
|
696
702
|
})
|
|
697
703
|
},
|
|
698
704
|
links: {
|
|
@@ -917,6 +923,31 @@ var _schema = i.schema({
|
|
|
917
923
|
label: "pinnedBy",
|
|
918
924
|
has: "many"
|
|
919
925
|
}
|
|
926
|
+
},
|
|
927
|
+
identityChatFolders: {
|
|
928
|
+
forward: {
|
|
929
|
+
on: "identities",
|
|
930
|
+
label: "chatFolders",
|
|
931
|
+
has: "many"
|
|
932
|
+
},
|
|
933
|
+
reverse: {
|
|
934
|
+
on: "chatFolders",
|
|
935
|
+
label: "owner",
|
|
936
|
+
has: "one",
|
|
937
|
+
onDelete: "cascade"
|
|
938
|
+
}
|
|
939
|
+
},
|
|
940
|
+
chatFolderConversations: {
|
|
941
|
+
forward: {
|
|
942
|
+
on: "chatFolders",
|
|
943
|
+
label: "conversations",
|
|
944
|
+
has: "many"
|
|
945
|
+
},
|
|
946
|
+
reverse: {
|
|
947
|
+
on: "conversations",
|
|
948
|
+
label: "folders",
|
|
949
|
+
has: "many"
|
|
950
|
+
}
|
|
920
951
|
}
|
|
921
952
|
},
|
|
922
953
|
rooms: {
|
|
@@ -1046,9 +1077,21 @@ var defaultMaxAuthRetries = 5;
|
|
|
1046
1077
|
var defaultAuthRetryDelayMs = (attempt) => Math.min(15e3, 500 * 2 ** Math.max(0, attempt - 1));
|
|
1047
1078
|
var normalizeAuthOutcome = (outcome) => outcome === true ? "ok" : outcome === false ? "retry" : outcome;
|
|
1048
1079
|
var makeSubscribeAuthedQuery = (deps) => (credentialsOrKey, query, cb) => {
|
|
1080
|
+
const subscribeWithCacheMeta = (q, onResult) => {
|
|
1081
|
+
const callState = {
|
|
1082
|
+
sync: true
|
|
1083
|
+
};
|
|
1084
|
+
const unsub = deps.subscribeQuery(q, (resp) => {
|
|
1085
|
+
onResult(resp, {
|
|
1086
|
+
fromCache: callState.sync
|
|
1087
|
+
});
|
|
1088
|
+
});
|
|
1089
|
+
callState.sync = false;
|
|
1090
|
+
return unsub;
|
|
1091
|
+
};
|
|
1049
1092
|
const creds = resolveCredentials(credentialsOrKey);
|
|
1050
1093
|
if (!creds || !deps.isBrowserAuthCapable()) {
|
|
1051
|
-
return
|
|
1094
|
+
return subscribeWithCacheMeta(query, cb);
|
|
1052
1095
|
}
|
|
1053
1096
|
const delayFor = deps.retryDelayMs ?? defaultAuthRetryDelayMs;
|
|
1054
1097
|
const maxRetries = deps.maxAuthRetries ?? defaultMaxAuthRetries;
|
|
@@ -1076,9 +1119,9 @@ var makeSubscribeAuthedQuery = (deps) => (credentialsOrKey, query, cb) => {
|
|
|
1076
1119
|
const isAuthedForExpected = () => Boolean(state2.expectedEmail && state2.currentEmail === state2.expectedEmail);
|
|
1077
1120
|
const attachQueryIfReady = () => {
|
|
1078
1121
|
if (state2.cancelled || !isAuthedForExpected() || state2.innerUnsub) return;
|
|
1079
|
-
state2.innerUnsub =
|
|
1122
|
+
state2.innerUnsub = subscribeWithCacheMeta(query, (resp, meta) => {
|
|
1080
1123
|
if (state2.cancelled || !isAuthedForExpected()) return;
|
|
1081
|
-
cb(resp);
|
|
1124
|
+
cb(resp, meta);
|
|
1082
1125
|
});
|
|
1083
1126
|
};
|
|
1084
1127
|
const triggerAuth = () => {
|
|
@@ -1129,7 +1172,7 @@ var makeSubscribeAuthedQuery = (deps) => (credentialsOrKey, query, cb) => {
|
|
|
1129
1172
|
]).then(([signable, expectedEmail]) => {
|
|
1130
1173
|
if (state2.cancelled) return;
|
|
1131
1174
|
if (!signable) {
|
|
1132
|
-
state2.innerUnsub =
|
|
1175
|
+
state2.innerUnsub = subscribeWithCacheMeta(query, cb);
|
|
1133
1176
|
return;
|
|
1134
1177
|
}
|
|
1135
1178
|
state2.expectedEmail = expectedEmail;
|
|
@@ -1221,7 +1264,8 @@ var subscribePaginatedQuery = (query) => (subscribeQueryFn, cb) => {
|
|
|
1221
1264
|
cb({
|
|
1222
1265
|
error: void 0,
|
|
1223
1266
|
data: resp.data,
|
|
1224
|
-
canLoadNextPage
|
|
1267
|
+
canLoadNextPage,
|
|
1268
|
+
fromCache: resp.fromCache
|
|
1225
1269
|
});
|
|
1226
1270
|
});
|
|
1227
1271
|
if (isExpansion) state2.pendingUnsub = unsub;
|
|
@@ -1244,14 +1288,17 @@ var subscribePaginatedQuery = (query) => (subscribeQueryFn, cb) => {
|
|
|
1244
1288
|
}
|
|
1245
1289
|
};
|
|
1246
1290
|
};
|
|
1247
|
-
var subscribeAuthedInfiniteQuery = (credentialsOrKey, query, cb) => subscribePaginatedQuery(query)((q, innerCb) => subscribeAuthedQuery(credentialsOrKey, q, (resp) => {
|
|
1291
|
+
var subscribeAuthedInfiniteQuery = (credentialsOrKey, query, cb) => subscribePaginatedQuery(query)((q, innerCb) => subscribeAuthedQuery(credentialsOrKey, q, (resp, meta) => {
|
|
1248
1292
|
if (resp.error) innerCb({
|
|
1249
1293
|
error: resp.error
|
|
1250
1294
|
});
|
|
1251
|
-
else
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1295
|
+
else {
|
|
1296
|
+
innerCb({
|
|
1297
|
+
data: resp.data,
|
|
1298
|
+
pageInfo: resp.pageInfo,
|
|
1299
|
+
fromCache: meta?.fromCache
|
|
1300
|
+
});
|
|
1301
|
+
}
|
|
1255
1302
|
}), (resp) => {
|
|
1256
1303
|
if (resp.error) {
|
|
1257
1304
|
cb({
|
|
@@ -1263,7 +1310,8 @@ var subscribeAuthedInfiniteQuery = (credentialsOrKey, query, cb) => subscribePag
|
|
|
1263
1310
|
cb({
|
|
1264
1311
|
error: void 0,
|
|
1265
1312
|
data: resp.data,
|
|
1266
|
-
canLoadNextPage: resp.canLoadNextPage
|
|
1313
|
+
canLoadNextPage: resp.canLoadNextPage,
|
|
1314
|
+
fromCache: resp.fromCache
|
|
1267
1315
|
});
|
|
1268
1316
|
}
|
|
1269
1317
|
});
|
|
@@ -1730,6 +1778,7 @@ var subscribeConversationKey = makeSubscribeConversationKey({
|
|
|
1730
1778
|
});
|
|
1731
1779
|
var initialDecryptBatch = 20;
|
|
1732
1780
|
var wakeupCatchUpCooldownMs = 3e4;
|
|
1781
|
+
var defaultStaleHoldTimeoutMs = 2500;
|
|
1733
1782
|
var postSendReconcileDelaysMs = [
|
|
1734
1783
|
1500,
|
|
1735
1784
|
5e3,
|
|
@@ -1768,13 +1817,18 @@ var messagesInfiniteQuery = (conversationId) => ({
|
|
|
1768
1817
|
}
|
|
1769
1818
|
}
|
|
1770
1819
|
});
|
|
1771
|
-
var createConversationMessagesStream = (subscribeInfiniteQuery) => (conversationId, onChange, initialKey = null
|
|
1820
|
+
var createConversationMessagesStream = (subscribeInfiniteQuery) => (conversationId, onChange, initialKey = null, initialSync = {
|
|
1821
|
+
isSyncing: false,
|
|
1822
|
+
hasFreshData: true
|
|
1823
|
+
}) => {
|
|
1772
1824
|
if (!conversationId) {
|
|
1773
1825
|
onChange({
|
|
1774
1826
|
messages: null,
|
|
1775
1827
|
canLoadMore: false,
|
|
1776
1828
|
loadMore: () => {
|
|
1777
|
-
}
|
|
1829
|
+
},
|
|
1830
|
+
isSyncing: false,
|
|
1831
|
+
hasFreshData: true
|
|
1778
1832
|
});
|
|
1779
1833
|
return {
|
|
1780
1834
|
setConversationKey: () => Promise.resolve(),
|
|
@@ -1782,6 +1836,8 @@ var createConversationMessagesStream = (subscribeInfiniteQuery) => (conversation
|
|
|
1782
1836
|
},
|
|
1783
1837
|
mergeMessages: () => {
|
|
1784
1838
|
},
|
|
1839
|
+
setSyncState: () => {
|
|
1840
|
+
},
|
|
1785
1841
|
unsubscribe: () => {
|
|
1786
1842
|
}
|
|
1787
1843
|
};
|
|
@@ -1797,14 +1853,22 @@ var createConversationMessagesStream = (subscribeInfiniteQuery) => (conversation
|
|
|
1797
1853
|
generation: 0,
|
|
1798
1854
|
active: true,
|
|
1799
1855
|
loadNext: () => {
|
|
1800
|
-
}
|
|
1856
|
+
},
|
|
1857
|
+
isSyncing: initialSync.isSyncing,
|
|
1858
|
+
hasFreshData: initialSync.hasFreshData,
|
|
1859
|
+
hasEmittedOnce: false,
|
|
1860
|
+
lastEmittedMessages: null
|
|
1801
1861
|
};
|
|
1802
1862
|
const emit = (messages) => {
|
|
1803
1863
|
if (!state2.active) return;
|
|
1864
|
+
state2.hasEmittedOnce = true;
|
|
1865
|
+
state2.lastEmittedMessages = messages;
|
|
1804
1866
|
onChange({
|
|
1805
1867
|
messages,
|
|
1806
1868
|
canLoadMore: state2.canLoadMore,
|
|
1807
|
-
loadMore: () => state2.loadNext()
|
|
1869
|
+
loadMore: () => state2.loadNext(),
|
|
1870
|
+
isSyncing: state2.isSyncing,
|
|
1871
|
+
hasFreshData: state2.hasFreshData
|
|
1808
1872
|
});
|
|
1809
1873
|
};
|
|
1810
1874
|
const decryptSlice = (key, slice) => {
|
|
@@ -1893,6 +1957,14 @@ var createConversationMessagesStream = (subscribeInfiniteQuery) => (conversation
|
|
|
1893
1957
|
fresh.forEach((m) => supplementalMessages.set(m.id, m));
|
|
1894
1958
|
decryptAndEmit();
|
|
1895
1959
|
},
|
|
1960
|
+
setSyncState: ({ isSyncing, hasFreshData }) => {
|
|
1961
|
+
if (state2.isSyncing === isSyncing && state2.hasFreshData === hasFreshData) {
|
|
1962
|
+
return;
|
|
1963
|
+
}
|
|
1964
|
+
state2.isSyncing = isSyncing;
|
|
1965
|
+
state2.hasFreshData = hasFreshData;
|
|
1966
|
+
if (state2.hasEmittedOnce) emit(state2.lastEmittedMessages);
|
|
1967
|
+
},
|
|
1896
1968
|
unsubscribe: () => {
|
|
1897
1969
|
state2.active = false;
|
|
1898
1970
|
state2.generation++;
|
|
@@ -1911,13 +1983,14 @@ var toDbMessages = (rows) => rows.flatMap((m) => isEncryptedMsgPayload(m.payload
|
|
|
1911
1983
|
timestamp: m.timestamp
|
|
1912
1984
|
}
|
|
1913
1985
|
] : []);
|
|
1914
|
-
var makeSubscribeConversationMessagesStream = ({ subscribeInfiniteQuery, keyStore = defaultPushKeyStore, fetchMessages = getMessagesSigned, canFetchDirect = isBrowserAuthCapable, waitForAuth = ensureInstantAuth, reconcileDelaysMs = postSendReconcileDelaysMs }) => (conversationId, credentials, onChange, initialKey = null) => {
|
|
1986
|
+
var makeSubscribeConversationMessagesStream = ({ subscribeInfiniteQuery, keyStore = defaultPushKeyStore, fetchMessages = getMessagesSigned, canFetchDirect = isBrowserAuthCapable, waitForAuth = ensureInstantAuth, reconcileDelaysMs = postSendReconcileDelaysMs, staleHoldTimeoutMs = defaultStaleHoldTimeoutMs, subscribeConnectionStatus }) => (conversationId, credentials, onChange, initialKey = null) => {
|
|
1915
1987
|
const publicSignKey = credentials?.publicSignKey ?? "";
|
|
1916
1988
|
if (publicSignKey && conversationId) {
|
|
1917
1989
|
hintColdBootstrap(publicSignKey, {
|
|
1918
1990
|
conversationId
|
|
1919
1991
|
});
|
|
1920
1992
|
}
|
|
1993
|
+
const canSyncFromBackend = Boolean(credentials && conversationId && canFetchDirect());
|
|
1921
1994
|
const postSendTimers = /* @__PURE__ */ new Set();
|
|
1922
1995
|
const clearPostSendTimers = () => {
|
|
1923
1996
|
postSendTimers.forEach((timer) => clearTimeout(timer));
|
|
@@ -1925,27 +1998,75 @@ var makeSubscribeConversationMessagesStream = ({ subscribeInfiniteQuery, keyStor
|
|
|
1925
1998
|
};
|
|
1926
1999
|
const syncState = {
|
|
1927
2000
|
cancelled: false,
|
|
2001
|
+
registeringQuery: true,
|
|
2002
|
+
connectionStatus: null,
|
|
1928
2003
|
bootstrapReceived: false,
|
|
2004
|
+
initialSyncPending: canSyncFromBackend,
|
|
2005
|
+
hasFreshServerData: !canSyncFromBackend,
|
|
2006
|
+
hasPushedMessage: false,
|
|
2007
|
+
staleHoldExpired: false,
|
|
1929
2008
|
catchUpInFlight: false,
|
|
2009
|
+
showCatchUpIndicator: false,
|
|
1930
2010
|
lastCatchUpAt: 0,
|
|
1931
|
-
awaitingPostSendLiveCount: 0
|
|
2011
|
+
awaitingPostSendLiveCount: 0,
|
|
2012
|
+
staleHoldTimer: null
|
|
2013
|
+
};
|
|
2014
|
+
const unsubConnectionStatus = subscribeConnectionStatus ? subscribeConnectionStatus((status) => {
|
|
2015
|
+
syncState.connectionStatus = status;
|
|
2016
|
+
}) : () => {
|
|
2017
|
+
};
|
|
2018
|
+
const isConnectionLive = () => syncState.connectionStatus === null || syncState.connectionStatus === "authenticated";
|
|
2019
|
+
const clearStaleHoldTimer = () => {
|
|
2020
|
+
if (syncState.staleHoldTimer !== null) {
|
|
2021
|
+
clearTimeout(syncState.staleHoldTimer);
|
|
2022
|
+
syncState.staleHoldTimer = null;
|
|
2023
|
+
}
|
|
1932
2024
|
};
|
|
1933
2025
|
const stream = createConversationMessagesStream((query, cb) => subscribeInfiniteQuery(credentials, query, (resp) => {
|
|
1934
2026
|
if (resp.data?.messages && syncState.awaitingPostSendLiveCount > 0) {
|
|
1935
2027
|
syncState.awaitingPostSendLiveCount = Math.max(0, syncState.awaitingPostSendLiveCount - 1);
|
|
1936
2028
|
if (syncState.awaitingPostSendLiveCount === 0) clearPostSendTimers();
|
|
1937
2029
|
}
|
|
2030
|
+
if (!resp.fromCache && !syncState.registeringQuery && isConnectionLive() && resp.data?.messages !== void 0) {
|
|
2031
|
+
syncState.hasFreshServerData = true;
|
|
2032
|
+
syncState.initialSyncPending = false;
|
|
2033
|
+
publishSyncState();
|
|
2034
|
+
}
|
|
1938
2035
|
cb(resp);
|
|
1939
|
-
}))(conversationId, onChange, initialKey
|
|
2036
|
+
}))(conversationId, onChange, initialKey, {
|
|
2037
|
+
isSyncing: syncState.initialSyncPending,
|
|
2038
|
+
hasFreshData: syncState.hasFreshServerData
|
|
2039
|
+
});
|
|
2040
|
+
syncState.registeringQuery = false;
|
|
2041
|
+
const publishSyncState = () => {
|
|
2042
|
+
if (syncState.cancelled) return;
|
|
2043
|
+
const isSyncing = syncState.initialSyncPending || syncState.catchUpInFlight && syncState.showCatchUpIndicator;
|
|
2044
|
+
const hasFreshData = syncState.hasFreshServerData || syncState.hasPushedMessage || syncState.staleHoldExpired;
|
|
2045
|
+
if (hasFreshData) clearStaleHoldTimer();
|
|
2046
|
+
stream.setSyncState?.({
|
|
2047
|
+
isSyncing,
|
|
2048
|
+
hasFreshData
|
|
2049
|
+
});
|
|
2050
|
+
};
|
|
2051
|
+
if (canSyncFromBackend && staleHoldTimeoutMs > 0) {
|
|
2052
|
+
syncState.staleHoldTimer = setTimeout(() => {
|
|
2053
|
+
syncState.staleHoldTimer = null;
|
|
2054
|
+
if (syncState.cancelled || syncState.hasFreshServerData) return;
|
|
2055
|
+
syncState.staleHoldExpired = true;
|
|
2056
|
+
publishSyncState();
|
|
2057
|
+
}, staleHoldTimeoutMs);
|
|
2058
|
+
}
|
|
1940
2059
|
const pullStoredPushMessages = () => {
|
|
1941
2060
|
if (!conversationId) return;
|
|
1942
2061
|
keyStore.getConversationMessages(conversationId).then((stored) => {
|
|
1943
2062
|
if (syncState.cancelled || empty(stored)) return;
|
|
2063
|
+
syncState.hasPushedMessage = true;
|
|
2064
|
+
publishSyncState();
|
|
1944
2065
|
stream.mergeMessages(toDbMessages(stored));
|
|
1945
2066
|
}).catch(() => {
|
|
1946
2067
|
});
|
|
1947
2068
|
};
|
|
1948
|
-
const catchUpFromBackend = (force = false) => {
|
|
2069
|
+
const catchUpFromBackend = (force = false, silent = false) => {
|
|
1949
2070
|
if (syncState.cancelled || syncState.catchUpInFlight || !credentials || !conversationId || !canFetchDirect()) {
|
|
1950
2071
|
return;
|
|
1951
2072
|
}
|
|
@@ -1954,7 +2075,9 @@ var makeSubscribeConversationMessagesStream = ({ subscribeInfiniteQuery, keyStor
|
|
|
1954
2075
|
return;
|
|
1955
2076
|
}
|
|
1956
2077
|
syncState.catchUpInFlight = true;
|
|
2078
|
+
syncState.showCatchUpIndicator = !silent;
|
|
1957
2079
|
syncState.lastCatchUpAt = now;
|
|
2080
|
+
publishSyncState();
|
|
1958
2081
|
canSignWithPrivateKey(credentials.privateSignKey).then((canSign) => {
|
|
1959
2082
|
if (!canSign || syncState.cancelled) return;
|
|
1960
2083
|
return fetchMessages({
|
|
@@ -1963,6 +2086,11 @@ var makeSubscribeConversationMessagesStream = ({ subscribeInfiniteQuery, keyStor
|
|
|
1963
2086
|
credentials
|
|
1964
2087
|
}).then((res) => {
|
|
1965
2088
|
if (syncState.cancelled || "error" in res) return;
|
|
2089
|
+
syncState.hasFreshServerData = true;
|
|
2090
|
+
syncState.initialSyncPending = false;
|
|
2091
|
+
syncState.catchUpInFlight = false;
|
|
2092
|
+
syncState.showCatchUpIndicator = false;
|
|
2093
|
+
publishSyncState();
|
|
1966
2094
|
const dbMsgs = toDbMessages(res.messages);
|
|
1967
2095
|
stream.feedBootstrapMessages(dbMsgs, res.hasMore);
|
|
1968
2096
|
stream.mergeMessages(dbMsgs);
|
|
@@ -1970,11 +2098,16 @@ var makeSubscribeConversationMessagesStream = ({ subscribeInfiniteQuery, keyStor
|
|
|
1970
2098
|
}).catch(() => {
|
|
1971
2099
|
}).finally(() => {
|
|
1972
2100
|
syncState.catchUpInFlight = false;
|
|
2101
|
+
syncState.showCatchUpIndicator = false;
|
|
2102
|
+
syncState.initialSyncPending = false;
|
|
2103
|
+
publishSyncState();
|
|
1973
2104
|
});
|
|
1974
2105
|
};
|
|
1975
2106
|
pullStoredPushMessages();
|
|
1976
2107
|
const unsubSw = conversationId ? listenServiceWorkerMessages((data) => {
|
|
1977
2108
|
if (isSwPushMessageData(data) && data.conversationId === conversationId) {
|
|
2109
|
+
syncState.hasPushedMessage = true;
|
|
2110
|
+
publishSyncState();
|
|
1978
2111
|
stream.setConversationKey(data.conversationKey);
|
|
1979
2112
|
stream.mergeMessages(toDbMessages([
|
|
1980
2113
|
data.message
|
|
@@ -2003,17 +2136,26 @@ var makeSubscribeConversationMessagesStream = ({ subscribeInfiniteQuery, keyStor
|
|
|
2003
2136
|
return;
|
|
2004
2137
|
}
|
|
2005
2138
|
syncState.bootstrapReceived = true;
|
|
2139
|
+
syncState.hasFreshServerData = true;
|
|
2140
|
+
syncState.initialSyncPending = false;
|
|
2141
|
+
publishSyncState();
|
|
2006
2142
|
const dbMsgs = toDbMessages(conversationBootstrap.messages);
|
|
2007
2143
|
stream.feedBootstrapMessages(dbMsgs, conversationBootstrap.hasMore);
|
|
2008
2144
|
stream.mergeMessages(dbMsgs);
|
|
2009
2145
|
}) : () => {
|
|
2010
2146
|
};
|
|
2011
|
-
if (
|
|
2147
|
+
if (canSyncFromBackend && credentials) {
|
|
2012
2148
|
waitForAuth(credentials).then(() => {
|
|
2149
|
+
if (syncState.cancelled) return;
|
|
2013
2150
|
if (!syncState.bootstrapReceived) {
|
|
2014
2151
|
catchUpFromBackend(true);
|
|
2152
|
+
} else {
|
|
2153
|
+
syncState.initialSyncPending = false;
|
|
2154
|
+
publishSyncState();
|
|
2015
2155
|
}
|
|
2016
2156
|
}).catch(() => {
|
|
2157
|
+
syncState.initialSyncPending = false;
|
|
2158
|
+
publishSyncState();
|
|
2017
2159
|
});
|
|
2018
2160
|
}
|
|
2019
2161
|
const reconcileAfterSend = () => {
|
|
@@ -2023,7 +2165,7 @@ var makeSubscribeConversationMessagesStream = ({ subscribeInfiniteQuery, keyStor
|
|
|
2023
2165
|
reconcileDelaysMs.forEach((delayMs) => {
|
|
2024
2166
|
const timer = setTimeout(() => {
|
|
2025
2167
|
postSendTimers.delete(timer);
|
|
2026
|
-
catchUpFromBackend(true);
|
|
2168
|
+
catchUpFromBackend(true, true);
|
|
2027
2169
|
}, delayMs);
|
|
2028
2170
|
postSendTimers.add(timer);
|
|
2029
2171
|
});
|
|
@@ -2032,10 +2174,13 @@ var makeSubscribeConversationMessagesStream = ({ subscribeInfiniteQuery, keyStor
|
|
|
2032
2174
|
setConversationKey: stream.setConversationKey,
|
|
2033
2175
|
feedBootstrapMessages: stream.feedBootstrapMessages,
|
|
2034
2176
|
mergeMessages: stream.mergeMessages,
|
|
2177
|
+
setSyncState: stream.setSyncState,
|
|
2035
2178
|
reconcileAfterSend,
|
|
2036
2179
|
unsubscribe: () => {
|
|
2037
2180
|
syncState.cancelled = true;
|
|
2181
|
+
clearStaleHoldTimer();
|
|
2038
2182
|
clearPostSendTimers();
|
|
2183
|
+
unsubConnectionStatus();
|
|
2039
2184
|
if (typeof globalThis.removeEventListener === "function") {
|
|
2040
2185
|
globalThis.removeEventListener("focus", onVisibilityOrFocus);
|
|
2041
2186
|
}
|
|
@@ -2049,7 +2194,8 @@ var makeSubscribeConversationMessagesStream = ({ subscribeInfiniteQuery, keyStor
|
|
|
2049
2194
|
};
|
|
2050
2195
|
};
|
|
2051
2196
|
var subscribeConversationMessagesStream = makeSubscribeConversationMessagesStream({
|
|
2052
|
-
subscribeInfiniteQuery: (credentials, query, cb) => subscribeAuthedInfiniteQuery(credentials, query, cb)
|
|
2197
|
+
subscribeInfiniteQuery: (credentials, query, cb) => subscribeAuthedInfiniteQuery(credentials, query, cb),
|
|
2198
|
+
subscribeConnectionStatus: (cb) => accessDb().subscribeConnectionStatus(cb)
|
|
2053
2199
|
});
|
|
2054
2200
|
var subscribeDecryptedMessages = (conversationId, conversationKey, onChange) => makeSubscribeDecryptedMessages((query, cb) => subscribeAuthedInfiniteQuery(conversationKey ? lookupConversationKeyCredentials(conversationKey) : void 0, query, cb))(conversationId, conversationKey, onChange);
|
|
2055
2201
|
var subscribeIdentityDetailsMap = (publicKeys, onChange) => {
|
package/components.js
CHANGED
|
@@ -45,7 +45,7 @@ import {
|
|
|
45
45
|
subscribeUserName,
|
|
46
46
|
typingTtl,
|
|
47
47
|
uploadAttachment
|
|
48
|
-
} from "./chunk-
|
|
48
|
+
} from "./chunk-LUSXWTWB.js";
|
|
49
49
|
import {
|
|
50
50
|
actOnCanvas,
|
|
51
51
|
canvasFromRow,
|
|
@@ -1564,6 +1564,9 @@ var chatContainerStyle = (isDarkMode, custom) => {
|
|
|
1564
1564
|
"flex-grow:1",
|
|
1565
1565
|
"min-height:0",
|
|
1566
1566
|
"min-width:0",
|
|
1567
|
+
"width:100%",
|
|
1568
|
+
"max-width:100%",
|
|
1569
|
+
"box-sizing:border-box",
|
|
1567
1570
|
"transition:background 0.2s,color 0.2s,border-color 0.2s",
|
|
1568
1571
|
`background:${w.background}`,
|
|
1569
1572
|
`background-color:${w.backgroundColor}`,
|
|
@@ -1619,12 +1622,12 @@ var shouldShowAvatar = ({ isStartOfSequence, isOwn, isGroupChat }) => isStartOfS
|
|
|
1619
1622
|
var shouldShowName = ({ isStartOfSequence, isOwn, isGroupChat, hideNames }) => isStartOfSequence && !isOwn && !hideNames && isGroupChat;
|
|
1620
1623
|
var titleStyle = (isDark, custom) => {
|
|
1621
1624
|
if (custom?.headerBackground) {
|
|
1622
|
-
return `display:flex;align-items:center;justify-content:center;font-weight:600;padding:13px 0;font-size:15px;letter-spacing:-0.01em;background:${custom.headerBackground};color:${isLightColor(custom.headerBackground, isDark) ? "#222" : "#fff"};transition:background 0.2s,color 0.2s`;
|
|
1625
|
+
return `display:flex;align-items:center;justify-content:center;width:100%;max-width:100%;box-sizing:border-box;overflow:hidden;font-weight:600;padding:13px 0;font-size:15px;letter-spacing:-0.01em;background:${custom.headerBackground};color:${isLightColor(custom.headerBackground, isDark) ? "#222" : "#fff"};transition:background 0.2s,color 0.2s`;
|
|
1623
1626
|
}
|
|
1624
1627
|
const bg = isDark ? "#141412" : "#faf9f5";
|
|
1625
1628
|
const fg = isDark ? "#f3f1ea" : "#181715";
|
|
1626
1629
|
const border = isDark ? "rgba(255,255,255,0.07)" : "rgba(24,23,21,0.08)";
|
|
1627
|
-
return `display:flex;align-items:center;justify-content:center;font-weight:600;padding:13px 0;font-size:15px;letter-spacing:-0.01em;background:${bg};color:${fg};border-bottom:1px solid ${border};transition:background 0.2s,color 0.2s,border-color 0.2s`;
|
|
1630
|
+
return `display:flex;align-items:center;justify-content:center;width:100%;max-width:100%;box-sizing:border-box;overflow:hidden;font-weight:600;padding:13px 0;font-size:15px;letter-spacing:-0.01em;background:${bg};color:${fg};border-bottom:1px solid ${border};transition:background 0.2s,color 0.2s,border-color 0.2s`;
|
|
1628
1631
|
};
|
|
1629
1632
|
var emptySuggestionsWrapStyle = "max-width:680px;width:100%;padding:20px 12px;box-sizing:border-box;display:flex;flex-direction:column;align-items:center;gap:20px";
|
|
1630
1633
|
var emptyHeadingStyle = (isDark, textColor) => `font-size:15px;font-weight:500;line-height:1.5;max-width:520px;color:${textColor ?? (isDark ? "#d6d3cb" : "#57534e")}`;
|
|
@@ -2399,7 +2402,7 @@ var mergeOptimisticMessages = (messages, optimistic, userId) => {
|
|
|
2399
2402
|
var shouldApplyInitialInput = ({ initialInput, lastAppliedInitialInput, currentInput }) => Boolean(initialInput) && initialInput !== lastAppliedInitialInput && currentInput === "";
|
|
2400
2403
|
|
|
2401
2404
|
// lit/components/chat-audio-player.ts
|
|
2402
|
-
var playerStyle = (isDark) => `display:flex;align-items:center;gap:10px;padding:10px 14px;border-radius:20px;background:${isDark ? "#ffffff15" : "#00000008"};min-width:200px`;
|
|
2405
|
+
var playerStyle = (isDark) => `display:flex;align-items:center;gap:10px;padding:10px 14px;border-radius:20px;background:${isDark ? "#ffffff15" : "#00000008"};min-width:200px;max-width:100%;box-sizing:border-box`;
|
|
2403
2406
|
var playBtnStyle = (primaryColor, isDark) => `width:36px;height:36px;border-radius:50%;border:none;background:${primaryColor};color:${isLightColor(primaryColor, isDark) ? "#222" : "#fff"};cursor:pointer;display:flex;align-items:center;justify-content:center;flex-shrink:0`;
|
|
2404
2407
|
var barColor = (isPlayed, primaryColor, isDark) => isPlayed ? primaryColor : isDark ? "#ffffff40" : "#00000020";
|
|
2405
2408
|
var barHeight = (i) => 6 + Math.sin(i * 0.8) * 6 + Math.random() * 4;
|
|
@@ -2575,8 +2578,8 @@ if (!customElements.get("chat-location-card")) {
|
|
|
2575
2578
|
import { html as html4, LitElement as LitElement3, nothing } from "lit";
|
|
2576
2579
|
var pulseKeyframes = `@keyframes video-pulse{0%,100%{opacity:0.4}50%{opacity:1}}`;
|
|
2577
2580
|
var videoStyle = "display:block;max-width:100%;height:auto;border-radius:8px;margin-top:6px;background:#000";
|
|
2578
|
-
var placeholderStyle = (isDark) => `display:flex;align-items:center;justify-content:center;max-width:100%;width:480px;aspect-ratio:16/9;border-radius:8px;margin-top:6px;background:${isDark ? "#1a1a1a" : "#e5e7eb"}`;
|
|
2579
|
-
var brokenStyle = (isDark) => `display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;max-width:100%;width:480px;aspect-ratio:16/9;border-radius:8px;margin-top:6px;background:${isDark ? "#1a1a1a" : "#e5e7eb"};color:${isDark ? "#6b7280" : "#9ca3af"};font-size:13px`;
|
|
2581
|
+
var placeholderStyle = (isDark) => `display:flex;align-items:center;justify-content:center;max-width:100%;width:480px;box-sizing:border-box;aspect-ratio:16/9;border-radius:8px;margin-top:6px;background:${isDark ? "#1a1a1a" : "#e5e7eb"}`;
|
|
2582
|
+
var brokenStyle = (isDark) => `display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;max-width:100%;width:480px;box-sizing:border-box;aspect-ratio:16/9;border-radius:8px;margin-top:6px;background:${isDark ? "#1a1a1a" : "#e5e7eb"};color:${isDark ? "#6b7280" : "#9ca3af"};font-size:13px`;
|
|
2580
2583
|
var actionsStyle = "display:flex;align-items:center;justify-content:space-between;gap:8px;margin-top:4px;color:inherit;opacity:0.85";
|
|
2581
2584
|
var actionBtnGroupStyle = "display:flex;align-items:center;gap:4px;margin-left:auto";
|
|
2582
2585
|
var nameStyle = "font-size:11px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:55%;opacity:0.75";
|
|
@@ -2602,6 +2605,13 @@ var ChatVideoPlayer = class extends LitElement3 {
|
|
|
2602
2605
|
createRenderRoot() {
|
|
2603
2606
|
return this;
|
|
2604
2607
|
}
|
|
2608
|
+
connectedCallback() {
|
|
2609
|
+
super.connectedCallback();
|
|
2610
|
+
this.style.display = "block";
|
|
2611
|
+
this.style.maxWidth = "100%";
|
|
2612
|
+
this.style.minWidth = "0";
|
|
2613
|
+
this.style.width = "100%";
|
|
2614
|
+
}
|
|
2605
2615
|
_onLoaded = () => {
|
|
2606
2616
|
this._state = "ready";
|
|
2607
2617
|
};
|
|
@@ -2695,7 +2705,7 @@ var spinnerHtml = (isDark) => html5`
|
|
|
2695
2705
|
style="width:40px;height:40px;border:4px solid ${isDark ? "#ffffff1a" : "#00000010"};border-top:4px solid ${isDark ? "#ffffff80" : "#00000040"};border-radius:50%;animation:spin 1s linear infinite"
|
|
2696
2706
|
></div>
|
|
2697
2707
|
`;
|
|
2698
|
-
var audioPlaceholderStyle = (isDark) => `display:flex;align-items:center;gap:10px;padding:10px 14px;border-radius:20px;background:${isDark ? "#ffffff15" : "#00000008"};min-width:200px`;
|
|
2708
|
+
var audioPlaceholderStyle = (isDark) => `display:flex;align-items:center;gap:10px;padding:10px 14px;border-radius:20px;background:${isDark ? "#ffffff15" : "#00000008"};min-width:200px;max-width:100%;box-sizing:border-box`;
|
|
2699
2709
|
var audioBtnStyle = (primaryColor, isDark) => `width:36px;height:36px;border-radius:50%;border:none;background:${primaryColor};color:${isLightColor(primaryColor, isDark) ? "#222" : "#fff"};cursor:pointer;display:flex;align-items:center;justify-content:center;flex-shrink:0`;
|
|
2700
2710
|
var audioBars = Array.from({
|
|
2701
2711
|
length: 30
|
|
@@ -2704,8 +2714,8 @@ var audioBars = Array.from({
|
|
|
2704
2714
|
height: 6 + Math.sin(i * 0.8) * 6
|
|
2705
2715
|
}));
|
|
2706
2716
|
var fileStyle = (isDark) => `display:flex;align-items:center;gap:8px;padding:8px 12px;border-radius:8px;background:${isDark ? "#ffffff15" : "#00000010"};text-decoration:none;color:inherit`;
|
|
2707
|
-
var imagePlaceholderStyle = (isDark) => `width:200px;height:150px;border-radius:8px;background:${isDark ? "#ffffff10" : "#00000008"};display:flex;align-items:center;justify-content:center`;
|
|
2708
|
-
var videoPlaceholderStyle = (isDark) => `display:flex;align-items:center;justify-content:center;max-width:100%;width:480px;aspect-ratio:16/9;border-radius:8px;margin-top:6px;background:${isDark ? "#1a1a1a" : "#e5e7eb"}`;
|
|
2717
|
+
var imagePlaceholderStyle = (isDark) => `width:200px;max-width:100%;box-sizing:border-box;height:150px;border-radius:8px;background:${isDark ? "#ffffff10" : "#00000008"};display:flex;align-items:center;justify-content:center`;
|
|
2718
|
+
var videoPlaceholderStyle = (isDark) => `display:flex;align-items:center;justify-content:center;max-width:100%;width:480px;box-sizing:border-box;aspect-ratio:16/9;border-radius:8px;margin-top:6px;background:${isDark ? "#1a1a1a" : "#e5e7eb"}`;
|
|
2709
2719
|
var expiredAttachmentStyle = (isDark) => `display:flex;align-items:center;gap:8px;padding:10px 12px;border-radius:10px;border:1px dashed ${isDark ? "rgba(255,255,255,0.2)" : "rgba(0,0,0,0.18)"};background:${isDark ? "rgba(255,255,255,0.06)" : "rgba(0,0,0,0.04)"};color:${isDark ? "#d1d5db" : "#4b5563"};font-size:13px;max-width:280px`;
|
|
2710
2720
|
var expiredSubtitleStyle = (isDark) => `font-size:11px;color:${isDark ? "#9ca3af" : "#6b7280"};margin-top:2px`;
|
|
2711
2721
|
var expiredAttachmentLabel = (type) => type === "image" ? "Image expired" : type === "video" ? "Video expired" : type === "audio" ? "Voice note expired" : "File expired";
|
|
@@ -2850,6 +2860,8 @@ var ChatAttachment = class extends LitElement4 {
|
|
|
2850
2860
|
super.connectedCallback();
|
|
2851
2861
|
this.style.display = "block";
|
|
2852
2862
|
this.style.maxWidth = "100%";
|
|
2863
|
+
this.style.minWidth = "0";
|
|
2864
|
+
this.style.width = "100%";
|
|
2853
2865
|
this._maybeAutoDecrypt();
|
|
2854
2866
|
}
|
|
2855
2867
|
updated(changed) {
|
|
@@ -7166,7 +7178,7 @@ var ChatMessage = class extends LitElement6 {
|
|
|
7166
7178
|
<div
|
|
7167
7179
|
class="msg-bubble"
|
|
7168
7180
|
dir="${textDirection(displayedText)}"
|
|
7169
|
-
style="display:${noBubble ? "block" : "inline-block"};min-width:0;max-width:100
|
|
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:${noBubble ? "0" : "18px"};padding:${noBubble ? "2px 0" : "7px 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" : ""}"
|
|
7170
7182
|
>
|
|
7171
7183
|
${shouldShowName({
|
|
7172
7184
|
isStartOfSequence,
|
|
@@ -7211,7 +7223,8 @@ var ChatMessage = class extends LitElement6 {
|
|
|
7211
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"
|
|
7212
7224
|
>${callDetails ? faPhoneAlt : nothing3}${unsafeHTML((this.streamActive || isRevealing) && displayedText.trim() ? injectCursorAtEnd(markdownHtml, liveCursorHtml(isDark)) : markdownHtml)}</span>
|
|
7213
7225
|
` : nothing3}${attachments && attachments.length > 0 ? html7`
|
|
7214
|
-
<div
|
|
7226
|
+
<div
|
|
7227
|
+
style="display:flex;flex-direction:column;gap:6px;margin-top:6px;min-width:0;max-width:100%">
|
|
7215
7228
|
${attachments.map((att) => html7`
|
|
7216
7229
|
<chat-attachment
|
|
7217
7230
|
.attachment="${att}"
|
|
@@ -7668,9 +7681,31 @@ var spinnerEl = (isDark, color) => html9`
|
|
|
7668
7681
|
${spinnerKeyframes}
|
|
7669
7682
|
</style>
|
|
7670
7683
|
<div
|
|
7684
|
+
data-testid="messages-loading-spinner"
|
|
7685
|
+
role="status"
|
|
7686
|
+
aria-label="Loading messages"
|
|
7671
7687
|
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"
|
|
7672
7688
|
></div>
|
|
7673
7689
|
`;
|
|
7690
|
+
var syncingPillWrapStyle = "display:flex;justify-content:center;padding:8px 0 4px";
|
|
7691
|
+
var syncingPillStyle = (isDark, textColor) => `display:inline-flex;align-items:center;gap:8px;padding:6px 14px;border-radius:9999px;font-size:12px;font-weight:500;background:${isDark ? "rgba(255,255,255,0.07)" : "rgba(24,23,21,0.06)"};color:${textColor ?? (isDark ? "#d6d3cb" : "#4b4842")};border:1px solid ${isDark ? "rgba(255,255,255,0.1)" : "rgba(24,23,21,0.09)"}`;
|
|
7692
|
+
var syncingSpinnerStyle = (isDark, color) => `width:13px;height:13px;border:2px solid ${isDark ? "rgba(255,255,255,0.16)" : "rgba(24,23,21,0.14)"};border-top:2px solid ${color ?? (isDark ? "#93c5fd" : "#2563eb")};border-radius:50%;animation:spin 0.85s linear infinite;flex-shrink:0`;
|
|
7693
|
+
var syncingIndicator = (isDark, color) => html9`
|
|
7694
|
+
<div style="${syncingPillWrapStyle}">
|
|
7695
|
+
<style>
|
|
7696
|
+
${spinnerKeyframes}
|
|
7697
|
+
</style>
|
|
7698
|
+
<div
|
|
7699
|
+
data-testid="messages-syncing-indicator"
|
|
7700
|
+
role="status"
|
|
7701
|
+
aria-live="polite"
|
|
7702
|
+
style="${syncingPillStyle(isDark, color)}"
|
|
7703
|
+
>
|
|
7704
|
+
<span style="${syncingSpinnerStyle(isDark, color)}"></span>
|
|
7705
|
+
<span>Syncing latest messages…</span>
|
|
7706
|
+
</div>
|
|
7707
|
+
</div>
|
|
7708
|
+
`;
|
|
7674
7709
|
var sendingIndicator = (label, primaryColor, isDark) => html9`
|
|
7675
7710
|
<div style="display:flex;flex-direction:row-reverse;gap:6px">
|
|
7676
7711
|
<div
|
|
@@ -7849,6 +7884,9 @@ var ChatBox = class extends LitElement8 {
|
|
|
7849
7884
|
isLoading: {
|
|
7850
7885
|
type: Boolean
|
|
7851
7886
|
},
|
|
7887
|
+
isSyncing: {
|
|
7888
|
+
type: Boolean
|
|
7889
|
+
},
|
|
7852
7890
|
darkModeOverride: {
|
|
7853
7891
|
type: Boolean
|
|
7854
7892
|
},
|
|
@@ -8015,6 +8053,7 @@ var ChatBox = class extends LitElement8 {
|
|
|
8015
8053
|
this.title = "";
|
|
8016
8054
|
this.typingUsers = [];
|
|
8017
8055
|
this.isLoading = false;
|
|
8056
|
+
this.isSyncing = false;
|
|
8018
8057
|
this.enableAttachments = false;
|
|
8019
8058
|
this.enableAudioRecording = false;
|
|
8020
8059
|
this.enableVoiceCall = false;
|
|
@@ -8108,6 +8147,8 @@ var ChatBox = class extends LitElement8 {
|
|
|
8108
8147
|
this.style.minHeight = "0";
|
|
8109
8148
|
this.style.minWidth = "0";
|
|
8110
8149
|
this.style.maxWidth = "100%";
|
|
8150
|
+
this.style.width = "100%";
|
|
8151
|
+
this.style.overflow = "hidden";
|
|
8111
8152
|
this._isMobile = isMobileCheck();
|
|
8112
8153
|
globalThis.addEventListener("keydown", this._globalKeydownHandler);
|
|
8113
8154
|
globalThis.addEventListener("click", this._outsideClickHandler);
|
|
@@ -9410,7 +9451,7 @@ var ChatBox = class extends LitElement8 {
|
|
|
9410
9451
|
data-content-inner
|
|
9411
9452
|
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)}"
|
|
9412
9453
|
>
|
|
9413
|
-
${this.isLoading ? html9`
|
|
9454
|
+
${this.isLoading || this.isSyncing && allMsgs.length === 0 && this.activeSpinners.length === 0 && this.activeProgress.length === 0 && this.activeStreams.length === 0 ? html9`
|
|
9414
9455
|
<div style="${centerFillStyle(isDark)}">${spinnerEl(isDark, customColors?.text)}</div>
|
|
9415
9456
|
` : allMsgs.length === 0 && this.activeSpinners.length === 0 && this.activeProgress.length === 0 && this.activeStreams.length === 0 ? html9`
|
|
9416
9457
|
<div style="${centerFillStyle(isDark)}">
|
|
@@ -9458,7 +9499,7 @@ var ChatBox = class extends LitElement8 {
|
|
|
9458
9499
|
}
|
|
9459
9500
|
if (entry.kind === "stream") return entry.stream.elementId;
|
|
9460
9501
|
return "typing";
|
|
9461
|
-
}, (entry) => this._renderTimelineEntry(entry, customColors, isDark, quickReplyEntryId, unreadDivider))} ${this._isSending ? sendingIndicator(sendingStatusText(this._sendingType), customColors?.primary ?? defaultPrimary(isDark), isDark) : nothing4}
|
|
9502
|
+
}, (entry) => this._renderTimelineEntry(entry, customColors, isDark, quickReplyEntryId, unreadDivider))} ${this._isSending ? sendingIndicator(sendingStatusText(this._sendingType), customColors?.primary ?? defaultPrimary(isDark), isDark) : nothing4} ${this.isSyncing ? syncingIndicator(isDark, customColors?.text) : nothing4}
|
|
9462
9503
|
`}
|
|
9463
9504
|
</div>
|
|
9464
9505
|
</div>
|
|
@@ -10390,6 +10431,8 @@ var ConnectedChat = class extends LitElement10 {
|
|
|
10390
10431
|
_responsiveUnsub = null;
|
|
10391
10432
|
_conversationKey = null;
|
|
10392
10433
|
_messages = null;
|
|
10434
|
+
_isSyncingMessages = false;
|
|
10435
|
+
_hasFreshMessages = false;
|
|
10393
10436
|
_hadMessages = false;
|
|
10394
10437
|
_lastMessageSubscriptionKey = void 0;
|
|
10395
10438
|
_lastMessageCount = 0;
|
|
@@ -10441,6 +10484,8 @@ var ConnectedChat = class extends LitElement10 {
|
|
|
10441
10484
|
this.style.minHeight = "0";
|
|
10442
10485
|
this.style.minWidth = "0";
|
|
10443
10486
|
this.style.maxWidth = "100%";
|
|
10487
|
+
this.style.width = "100%";
|
|
10488
|
+
this.style.overflow = "hidden";
|
|
10444
10489
|
this._activeConversationId = this.conversationId;
|
|
10445
10490
|
this.addEventListener("click", this._handleClick);
|
|
10446
10491
|
globalThis.addEventListener("keydown", this._handleGlobalKeydown);
|
|
@@ -10535,6 +10580,8 @@ var ConnectedChat = class extends LitElement10 {
|
|
|
10535
10580
|
this._showParticipantsPopup = false;
|
|
10536
10581
|
this._copiedParticipantId = null;
|
|
10537
10582
|
this._messages = null;
|
|
10583
|
+
this._isSyncingMessages = false;
|
|
10584
|
+
this._hasFreshMessages = false;
|
|
10538
10585
|
this._conversationKey = null;
|
|
10539
10586
|
this._ephemeralStreams = [];
|
|
10540
10587
|
this._uiElements = [];
|
|
@@ -10756,12 +10803,23 @@ var ConnectedChat = class extends LitElement10 {
|
|
|
10756
10803
|
this._resubscribeIdentities();
|
|
10757
10804
|
this.requestUpdate();
|
|
10758
10805
|
}));
|
|
10759
|
-
this._messagesStream = subscribeConversationMessagesStream(targetId, this.credentials, ({ messages, canLoadMore, loadMore }) => {
|
|
10760
|
-
|
|
10761
|
-
|
|
10806
|
+
this._messagesStream = subscribeConversationMessagesStream(targetId, this.credentials, ({ messages, canLoadMore, loadMore, isSyncing, hasFreshData }) => {
|
|
10807
|
+
const nextIsSyncing = Boolean(isSyncing);
|
|
10808
|
+
const nextHasFresh = hasFreshData ?? true;
|
|
10809
|
+
const syncChanged = this._isSyncingMessages !== nextIsSyncing || this._hasFreshMessages !== nextHasFresh;
|
|
10810
|
+
this._isSyncingMessages = nextIsSyncing;
|
|
10811
|
+
this._hasFreshMessages = nextHasFresh;
|
|
10812
|
+
if (!messages) {
|
|
10813
|
+
if (syncChanged) this.requestUpdate();
|
|
10814
|
+
return;
|
|
10815
|
+
}
|
|
10816
|
+
if (messages.length === 0 && this._hadMessages) {
|
|
10817
|
+
if (syncChanged) this.requestUpdate();
|
|
10818
|
+
return;
|
|
10819
|
+
}
|
|
10762
10820
|
const messagesChanged = !this._messages || this._messages.length !== messages.length || this._messages.some((m, i) => m.id !== messages[i].id);
|
|
10763
10821
|
const canLoadMoreChanged = this._canLoadMore !== canLoadMore;
|
|
10764
|
-
if (!messagesChanged && !canLoadMoreChanged) return;
|
|
10822
|
+
if (!messagesChanged && !canLoadMoreChanged && !syncChanged) return;
|
|
10765
10823
|
if (messages.length > this._lastMessageCount) {
|
|
10766
10824
|
const latestMessage = messages[0];
|
|
10767
10825
|
if (latestMessage) {
|
|
@@ -11519,6 +11577,7 @@ var ConnectedChat = class extends LitElement10 {
|
|
|
11519
11577
|
return accessDeniedHtml(this.onClose ?? this.onBack, this.customColors, isDark);
|
|
11520
11578
|
}
|
|
11521
11579
|
const { chatMessages, activeSpinners, activeProgress, activeStreams } = this._processMessages();
|
|
11580
|
+
const isLoadingMessages = !this._messages || !this._hasFreshMessages && this._isSyncingMessages;
|
|
11522
11581
|
return html11`
|
|
11523
11582
|
<chat-box
|
|
11524
11583
|
.messages="${chatMessages}"
|
|
@@ -11538,7 +11597,8 @@ var ConnectedChat = class extends LitElement10 {
|
|
|
11538
11597
|
.disableAutoFocus="${this.disableAutoFocus}"
|
|
11539
11598
|
.title="${this._currentDisplayTitle()}"
|
|
11540
11599
|
.typingUsers="${this._typingNames}"
|
|
11541
|
-
.isLoading="${
|
|
11600
|
+
.isLoading="${isLoadingMessages}"
|
|
11601
|
+
.isSyncing="${!isLoadingMessages && this._isSyncingMessages}"
|
|
11542
11602
|
.darkModeOverride="${this.darkModeOverride}"
|
|
11543
11603
|
.customColors="${this.customColors}"
|
|
11544
11604
|
.onDecryptAttachment="${this._handleDecryptAttachment}"
|
package/mod.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "alice-and-bot",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.91",
|
|
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",
|