@palbase/web 1.6.0 → 1.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -1,6 +1,6 @@
1
- export { A as AnalyticsProperties, a as AuthChangeEvent, b as AuthState, c as AuthSuccess, d as AuthUser, C as Call, e as CallChangeCallback, f as CallParticipant, g as CallState, h as Chat, i as ChatBackend, j as ChatDraft, k as ChatKind, l as ChatMember, m as ChatMessage, n as ChatMessageKind, o as ChatRole, p as ChatState, q as CommsPrefs, F as FlagsView, M as MagicLinkResult, r as MentionRange, s as MessageDirection, O as OAuthExchangeResult, P as PalbeAnalytics, t as PalbeAuth, u as PalbeCalls, v as PalbeConfig, w as PalbeFlags, x as PalbeMessaging, y as PalbeOAuthConfig, z as PalbeRealtime, B as PresenceState, R as RealtimeChannel, D as RealtimeConnectionState, E as RealtimeHandler, G as RealtimePayload, H as RealtimeStatus, I as RealtimeStatusSnapshot, J as RealtimeSubscription, K as ResolvedMention, L as ResolvedReply, S as SentReceipt, U as Unsubscribe } from './analytics-facade-iAWinswQ.cjs';
1
+ export { A as AnalyticsProperties, a as AuthChangeEvent, b as AuthState, c as AuthSuccess, d as AuthUser, C as Call, e as CallChangeCallback, f as CallParticipant, g as CallState, h as Chat, i as ChatBackend, j as ChatDraft, k as ChatKind, l as ChatMember, m as ChatMessage, n as ChatMessageKind, o as ChatRole, p as ChatState, q as CommsPrefs, F as FlagsView, M as MagicLinkResult, r as MentionRange, s as MessageDirection, O as OAuthExchangeResult, P as PalbeAnalytics, t as PalbeAuth, u as PalbeCalls, v as PalbeConfig, w as PalbeFlags, x as PalbeMessaging, y as PalbeOAuthConfig, z as PalbeRealtime, B as PresenceState, R as RealtimeChannel, D as RealtimeConnectionState, E as RealtimeHandler, G as RealtimePayload, H as RealtimeStatus, I as RealtimeStatusSnapshot, J as RealtimeSubscription, K as ResolvedMention, L as ResolvedReply, S as SentReceipt, U as Unsubscribe } from './analytics-facade-ATGUv2-f.cjs';
2
2
  export { B as BackendError, a as BackendErrorKind, F as FieldError, i as isBackendError } from './errors-fDoNdTrJ.cjs';
3
- export { C as CallOptions, P as PB, U as UploadOptions, a as UploadProgress, p as pb } from './pb-Blj85_cg.cjs';
3
+ export { C as CallOptions, P as PB, U as UploadOptions, a as UploadProgress, p as pb } from './pb-VzJvX7Gg.cjs';
4
4
  export { P as PersistedSession, S as SessionStorageAdapter, l as localStorageSessionStorage, m as memorySessionStorage } from './storage-BPaeSG8K.cjs';
5
5
  export { F as FlagValue } from './pooled-flags-Bwq4usn0.js';
6
6
  import 'livekit-client';
@@ -207,6 +207,6 @@ interface MlsGlue {
207
207
  */
208
208
  declare function initMls(): Promise<MlsGlue>;
209
209
 
210
- declare const VERSION = "1.6.0";
210
+ declare const VERSION = "1.6.1";
211
211
 
212
212
  export { VERSION, initMls };
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- export { A as AnalyticsProperties, a as AuthChangeEvent, b as AuthState, c as AuthSuccess, d as AuthUser, C as Call, e as CallChangeCallback, f as CallParticipant, g as CallState, h as Chat, i as ChatBackend, j as ChatDraft, k as ChatKind, l as ChatMember, m as ChatMessage, n as ChatMessageKind, o as ChatRole, p as ChatState, q as CommsPrefs, F as FlagsView, M as MagicLinkResult, r as MentionRange, s as MessageDirection, O as OAuthExchangeResult, P as PalbeAnalytics, t as PalbeAuth, u as PalbeCalls, v as PalbeConfig, w as PalbeFlags, x as PalbeMessaging, y as PalbeOAuthConfig, z as PalbeRealtime, B as PresenceState, R as RealtimeChannel, D as RealtimeConnectionState, E as RealtimeHandler, G as RealtimePayload, H as RealtimeStatus, I as RealtimeStatusSnapshot, J as RealtimeSubscription, K as ResolvedMention, L as ResolvedReply, S as SentReceipt, U as Unsubscribe } from './analytics-facade-DYNLUW0L.js';
1
+ export { A as AnalyticsProperties, a as AuthChangeEvent, b as AuthState, c as AuthSuccess, d as AuthUser, C as Call, e as CallChangeCallback, f as CallParticipant, g as CallState, h as Chat, i as ChatBackend, j as ChatDraft, k as ChatKind, l as ChatMember, m as ChatMessage, n as ChatMessageKind, o as ChatRole, p as ChatState, q as CommsPrefs, F as FlagsView, M as MagicLinkResult, r as MentionRange, s as MessageDirection, O as OAuthExchangeResult, P as PalbeAnalytics, t as PalbeAuth, u as PalbeCalls, v as PalbeConfig, w as PalbeFlags, x as PalbeMessaging, y as PalbeOAuthConfig, z as PalbeRealtime, B as PresenceState, R as RealtimeChannel, D as RealtimeConnectionState, E as RealtimeHandler, G as RealtimePayload, H as RealtimeStatus, I as RealtimeStatusSnapshot, J as RealtimeSubscription, K as ResolvedMention, L as ResolvedReply, S as SentReceipt, U as Unsubscribe } from './analytics-facade-DhcTP_kw.js';
2
2
  export { B as BackendError, a as BackendErrorKind, F as FieldError, i as isBackendError } from './errors-fDoNdTrJ.js';
3
- export { C as CallOptions, P as PB, U as UploadOptions, a as UploadProgress, p as pb } from './pb-DPPpThNg.js';
3
+ export { C as CallOptions, P as PB, U as UploadOptions, a as UploadProgress, p as pb } from './pb-TAUNVyT6.js';
4
4
  export { P as PersistedSession, S as SessionStorageAdapter, l as localStorageSessionStorage, m as memorySessionStorage } from './storage-BPaeSG8K.js';
5
5
  export { F as FlagValue } from './pooled-flags-Bwq4usn0.js';
6
6
  import 'livekit-client';
@@ -207,6 +207,6 @@ interface MlsGlue {
207
207
  */
208
208
  declare function initMls(): Promise<MlsGlue>;
209
209
 
210
- declare const VERSION = "1.6.0";
210
+ declare const VERSION = "1.6.1";
211
211
 
212
212
  export { VERSION, initMls };
package/dist/index.js CHANGED
@@ -13,7 +13,7 @@ import {
13
13
  localStorageSessionStorage,
14
14
  memorySessionStorage,
15
15
  pb
16
- } from "./chunk-A5WIPBGQ.js";
16
+ } from "./chunk-EQAHM3ZJ.js";
17
17
  export {
18
18
  BackendError,
19
19
  PalbeAnalytics,
package/dist/internal.cjs CHANGED
@@ -4595,24 +4595,38 @@ var Chat = class {
4595
4595
  resolvedReplyTo = resolveReply(replyRef, (id) => this.byClientMsgId.get(id) ?? null);
4596
4596
  }
4597
4597
  const bodyRanges = opts?.mentions ?? null;
4598
- const start = opts?.expiresIn?.start ?? "send";
4599
- const expiry = opts?.expiresIn ? {
4600
- v: 1,
4601
- ttlSeconds: opts.expiresIn.ttlSeconds,
4602
- start,
4603
- senderSendTs: start === "send" ? Math.floor(Date.now() / 1e3) : null
4604
- } : null;
4598
+ const effectiveExpiry = this.composeExpiry(opts?.expiresIn);
4605
4599
  const { receipt, clientMsgId } = await this.backend.sendText(
4606
4600
  group,
4607
4601
  text,
4608
4602
  replyRef,
4609
4603
  bodyRanges,
4610
- expiry
4604
+ effectiveExpiry
4611
4605
  );
4612
- this.appendOwnSend(text, receipt, clientMsgId, resolvedReplyTo, bodyRanges);
4613
- if (expiry) void this.armPurge(expiry, receipt.serverSeq, clientMsgId);
4606
+ this.appendOwnSend(text, receipt, clientMsgId, resolvedReplyTo, bodyRanges, effectiveExpiry);
4607
+ if (effectiveExpiry) void this.armPurge(effectiveExpiry, receipt.serverSeq, clientMsgId);
4614
4608
  return receipt;
4615
4609
  }
4610
+ /** Resolve a send's effective per-message expiry at COMPOSE TIME: the caller's explicit
4611
+ * `expiresIn` if present, ELSE the chat's active default timer stamped onto the message
4612
+ * NOW (the durable record per spec §"Compose-time stamping"). A `send`-anchored expiry
4613
+ * (explicit or default-inherited) stamps `senderSendTs` = the sender's compose epoch
4614
+ * seconds; a `read`-anchored one carries none (the deadline is the recipient's local
4615
+ * first-read). Returns null when there is neither an explicit expiry nor an active
4616
+ * default (a plain, non-disappearing send). Mirrors the iOS compose-time stamping. */
4617
+ composeExpiry(explicit) {
4618
+ const base = explicit ? {
4619
+ v: 1,
4620
+ ttlSeconds: explicit.ttlSeconds,
4621
+ start: explicit.start ?? "send",
4622
+ senderSendTs: null
4623
+ } : this.defaultExpiry();
4624
+ if (!base) return null;
4625
+ return {
4626
+ ...base,
4627
+ senderSendTs: base.start === "send" ? Math.floor(Date.now() / 1e3) : null
4628
+ };
4629
+ }
4616
4630
  /** Set (or DISABLE) this chat's DEFAULT disappearing timer. Emits a `timer_set` control
4617
4631
  * envelope (server-blind — an opaque application message, NEVER a bubble) and folds the
4618
4632
  * own-set locally so the default applies immediately to subsequent sends that carry no
@@ -4637,7 +4651,7 @@ var Chat = class {
4637
4651
  eventClientMsgId: clientMsgId
4638
4652
  });
4639
4653
  }
4640
- appendOwnSend(text, receipt, clientMsgId, resolvedReplyTo, bodyRanges) {
4654
+ appendOwnSend(text, receipt, clientMsgId, resolvedReplyTo, bodyRanges, expiry) {
4641
4655
  if (receipt.serverSeq <= 0) return;
4642
4656
  const key = this.internalKey(receipt.serverSeq);
4643
4657
  if (this.seenKeys.has(key)) return;
@@ -4666,9 +4680,11 @@ var Chat = class {
4666
4680
  // Mentions T6: resolve the own-sent bubble's mentions for its own render (the
4667
4681
  // sender never gets a wire echo of its own message — this is the only local copy).
4668
4682
  mentions: this.resolveMentions(text, bodyRanges),
4669
- // Disappearing T10: the surfaced deadline is set by armPurge (own-send with a TTL)
4670
- // via the messageList overlay; default null here (a plain own-send has no deadline).
4671
- expiresAt: null
4683
+ // Disappearing T10: the surfaced deadline reflects the message's effective expiry
4684
+ // (explicit `expiresIn` OR the chat default stamped at compose time). null only when
4685
+ // this send is non-disappearing. armPurge re-derives the durable monotonic deadline;
4686
+ // this is the immediate UI countdown baseline (own sender and receiver are symmetric).
4687
+ expiresAt: this.deadlineFor(expiry ?? null)
4672
4688
  });
4673
4689
  this.messageList.sort((a, b) => a.serverSeq - b.serverSeq);
4674
4690
  this.emit();
@@ -8289,7 +8305,7 @@ function defaultSessionStorage(key) {
8289
8305
  }
8290
8306
 
8291
8307
  // src/version.ts
8292
- var VERSION = "1.6.0";
8308
+ var VERSION = "1.6.1";
8293
8309
 
8294
8310
  // src/runtime.ts
8295
8311
  function buildRuntime(config) {