@palbase/web 1.6.0 → 1.6.2

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.
@@ -1,7 +1,7 @@
1
- import { v as PalbeConfig, N as PalbeRuntime } from './analytics-facade-iAWinswQ.cjs';
2
- export { Q as buildRuntime } from './analytics-facade-iAWinswQ.cjs';
1
+ import { v as PalbeConfig, N as PalbeRuntime } from './analytics-facade-ATGUv2-f.cjs';
2
+ export { Q as buildRuntime } from './analytics-facade-ATGUv2-f.cjs';
3
3
  import { B as BackendError } from './errors-fDoNdTrJ.cjs';
4
- export { P as PB, c as createBoundClient } from './pb-Blj85_cg.cjs';
4
+ export { P as PB, c as createBoundClient } from './pb-VzJvX7Gg.cjs';
5
5
  import 'livekit-client';
6
6
  import './storage-BPaeSG8K.cjs';
7
7
  import './pooled-flags-Bwq4usn0.js';
@@ -1,7 +1,7 @@
1
- import { v as PalbeConfig, N as PalbeRuntime } from './analytics-facade-DYNLUW0L.js';
2
- export { Q as buildRuntime } from './analytics-facade-DYNLUW0L.js';
1
+ import { v as PalbeConfig, N as PalbeRuntime } from './analytics-facade-DhcTP_kw.js';
2
+ export { Q as buildRuntime } from './analytics-facade-DhcTP_kw.js';
3
3
  import { B as BackendError } from './errors-fDoNdTrJ.js';
4
- export { P as PB, c as createBoundClient } from './pb-DPPpThNg.js';
4
+ export { P as PB, c as createBoundClient } from './pb-TAUNVyT6.js';
5
5
  import 'livekit-client';
6
6
  import './storage-BPaeSG8K.js';
7
7
  import './pooled-flags-Bwq4usn0.js';
package/dist/internal.js CHANGED
@@ -6,7 +6,7 @@ import {
6
6
  createBoundClient,
7
7
  getRuntime,
8
8
  onConfigured
9
- } from "./chunk-A5WIPBGQ.js";
9
+ } from "./chunk-XQZ53URR.js";
10
10
  export {
11
11
  __configure,
12
12
  __registerNamespaces,
@@ -4396,24 +4396,38 @@ var Chat = class {
4396
4396
  resolvedReplyTo = resolveReply(replyRef, (id) => this.byClientMsgId.get(id) ?? null);
4397
4397
  }
4398
4398
  const bodyRanges = opts?.mentions ?? null;
4399
- const start = opts?.expiresIn?.start ?? "send";
4400
- const expiry = opts?.expiresIn ? {
4401
- v: 1,
4402
- ttlSeconds: opts.expiresIn.ttlSeconds,
4403
- start,
4404
- senderSendTs: start === "send" ? Math.floor(Date.now() / 1e3) : null
4405
- } : null;
4399
+ const effectiveExpiry = this.composeExpiry(opts?.expiresIn);
4406
4400
  const { receipt, clientMsgId } = await this.backend.sendText(
4407
4401
  group,
4408
4402
  text,
4409
4403
  replyRef,
4410
4404
  bodyRanges,
4411
- expiry
4405
+ effectiveExpiry
4412
4406
  );
4413
- this.appendOwnSend(text, receipt, clientMsgId, resolvedReplyTo, bodyRanges);
4414
- if (expiry) void this.armPurge(expiry, receipt.serverSeq, clientMsgId);
4407
+ this.appendOwnSend(text, receipt, clientMsgId, resolvedReplyTo, bodyRanges, effectiveExpiry);
4408
+ if (effectiveExpiry) void this.armPurge(effectiveExpiry, receipt.serverSeq, clientMsgId);
4415
4409
  return receipt;
4416
4410
  }
4411
+ /** Resolve a send's effective per-message expiry at COMPOSE TIME: the caller's explicit
4412
+ * `expiresIn` if present, ELSE the chat's active default timer stamped onto the message
4413
+ * NOW (the durable record per spec §"Compose-time stamping"). A `send`-anchored expiry
4414
+ * (explicit or default-inherited) stamps `senderSendTs` = the sender's compose epoch
4415
+ * seconds; a `read`-anchored one carries none (the deadline is the recipient's local
4416
+ * first-read). Returns null when there is neither an explicit expiry nor an active
4417
+ * default (a plain, non-disappearing send). Mirrors the iOS compose-time stamping. */
4418
+ composeExpiry(explicit) {
4419
+ const base = explicit ? {
4420
+ v: 1,
4421
+ ttlSeconds: explicit.ttlSeconds,
4422
+ start: explicit.start ?? "send",
4423
+ senderSendTs: null
4424
+ } : this.defaultExpiry();
4425
+ if (!base) return null;
4426
+ return {
4427
+ ...base,
4428
+ senderSendTs: base.start === "send" ? Math.floor(Date.now() / 1e3) : null
4429
+ };
4430
+ }
4417
4431
  /** Set (or DISABLE) this chat's DEFAULT disappearing timer. Emits a `timer_set` control
4418
4432
  * envelope (server-blind — an opaque application message, NEVER a bubble) and folds the
4419
4433
  * own-set locally so the default applies immediately to subsequent sends that carry no
@@ -4438,7 +4452,7 @@ var Chat = class {
4438
4452
  eventClientMsgId: clientMsgId
4439
4453
  });
4440
4454
  }
4441
- appendOwnSend(text, receipt, clientMsgId, resolvedReplyTo, bodyRanges) {
4455
+ appendOwnSend(text, receipt, clientMsgId, resolvedReplyTo, bodyRanges, expiry) {
4442
4456
  if (receipt.serverSeq <= 0) return;
4443
4457
  const key = this.internalKey(receipt.serverSeq);
4444
4458
  if (this.seenKeys.has(key)) return;
@@ -4467,9 +4481,11 @@ var Chat = class {
4467
4481
  // Mentions T6: resolve the own-sent bubble's mentions for its own render (the
4468
4482
  // sender never gets a wire echo of its own message — this is the only local copy).
4469
4483
  mentions: this.resolveMentions(text, bodyRanges),
4470
- // Disappearing T10: the surfaced deadline is set by armPurge (own-send with a TTL)
4471
- // via the messageList overlay; default null here (a plain own-send has no deadline).
4472
- expiresAt: null
4484
+ // Disappearing T10: the surfaced deadline reflects the message's effective expiry
4485
+ // (explicit `expiresIn` OR the chat default stamped at compose time). null only when
4486
+ // this send is non-disappearing. armPurge re-derives the durable monotonic deadline;
4487
+ // this is the immediate UI countdown baseline (own sender and receiver are symmetric).
4488
+ expiresAt: this.deadlineFor(expiry ?? null)
4473
4489
  });
4474
4490
  this.messageList.sort((a, b) => a.serverSeq - b.serverSeq);
4475
4491
  this.emit();
@@ -7048,9 +7064,9 @@ var MessagingCoordinator = class {
7048
7064
  });
7049
7065
  return group;
7050
7066
  }
7051
- async sendText(group, text, replyTo, bodyRanges) {
7067
+ async sendText(group, text, replyTo, bodyRanges, expiry) {
7052
7068
  const r = await this.resolve();
7053
- return r.groups.sendText(group, text, replyTo, bodyRanges);
7069
+ return r.groups.sendText(group, text, replyTo, bodyRanges, expiry);
7054
7070
  }
7055
7071
  async sendReaction(group, args) {
7056
7072
  const r = await this.resolve();
@@ -8090,7 +8106,7 @@ function defaultSessionStorage(key) {
8090
8106
  }
8091
8107
 
8092
8108
  // src/version.ts
8093
- var VERSION = "1.6.0";
8109
+ var VERSION = "1.6.2";
8094
8110
 
8095
8111
  // src/runtime.ts
8096
8112
  function buildRuntime(config) {