@palbase/web 1.8.0 → 1.9.0
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/{analytics-facade-DfJ420F5.d.cts → analytics-facade-DFd5LB3_.d.cts} +17 -4
- package/dist/{analytics-facade-CgURkjpP.d.ts → analytics-facade-DsvKx5A5.d.ts} +17 -4
- package/dist/{chunk-AWVNDAMG.js → chunk-I3ZMB7XM.js} +33 -6
- package/dist/chunk-I3ZMB7XM.js.map +1 -0
- package/dist/index.cjs +31 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +1 -1
- package/dist/internal.cjs +32 -5
- package/dist/internal.cjs.map +1 -1
- package/dist/internal.d.cts +3 -3
- package/dist/internal.d.ts +3 -3
- package/dist/internal.js +1 -1
- package/dist/next/client.cjs +32 -5
- package/dist/next/client.cjs.map +1 -1
- package/dist/next/client.js +1 -1
- package/dist/next/index.cjs +32 -5
- package/dist/next/index.cjs.map +1 -1
- package/dist/next/index.d.cts +2 -2
- package/dist/next/index.d.ts +2 -2
- package/dist/next/index.js +1 -1
- package/dist/{pb-C1v9ErPy.d.ts → pb-CDVMy1l1.d.ts} +1 -1
- package/dist/{pb-BwQwp411.d.cts → pb-D_fuhafL.d.cts} +1 -1
- package/dist/react/index.cjs +1 -1
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.d.cts +1 -1
- package/dist/react/index.d.ts +1 -1
- package/dist/react/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-AWVNDAMG.js.map +0 -1
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, N as NotifyScope, 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 UnreadView, Q as Unsubscribe } from './analytics-facade-
|
|
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, N as NotifyScope, 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 UnreadView, Q as Unsubscribe } from './analytics-facade-DFd5LB3_.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-
|
|
3
|
+
export { C as CallOptions, P as PB, U as UploadOptions, a as UploadProgress, p as pb } from './pb-D_fuhafL.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.
|
|
210
|
+
declare const VERSION = "1.9.0";
|
|
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, N as NotifyScope, 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 UnreadView, Q as Unsubscribe } from './analytics-facade-
|
|
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, N as NotifyScope, 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 UnreadView, Q as Unsubscribe } from './analytics-facade-DsvKx5A5.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-
|
|
3
|
+
export { C as CallOptions, P as PB, U as UploadOptions, a as UploadProgress, p as pb } from './pb-CDVMy1l1.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.
|
|
210
|
+
declare const VERSION = "1.9.0";
|
|
211
211
|
|
|
212
212
|
export { VERSION, initMls };
|
package/dist/index.js
CHANGED
package/dist/internal.cjs
CHANGED
|
@@ -1512,6 +1512,8 @@ var PalbeAuth = class {
|
|
|
1512
1512
|
// suppresses AuthClient's TOKEN_REFRESHED during re-signIn
|
|
1513
1513
|
signedInState = false;
|
|
1514
1514
|
// dedupes AuthClient's repeated SIGNED_OUT events
|
|
1515
|
+
hydratingUser = false;
|
|
1516
|
+
// guards hydrateUser() to a single boot fetch
|
|
1515
1517
|
stateListeners = /* @__PURE__ */ new Set();
|
|
1516
1518
|
eventListeners = /* @__PURE__ */ new Set();
|
|
1517
1519
|
userListeners = /* @__PURE__ */ new Set();
|
|
@@ -1564,13 +1566,37 @@ var PalbeAuth = class {
|
|
|
1564
1566
|
if (changed) for (const cb of this.userListeners) this.safeInvoke(() => cb(user));
|
|
1565
1567
|
return user;
|
|
1566
1568
|
}
|
|
1569
|
+
/**
|
|
1570
|
+
* Restore the user after a session was rehydrated from storage (page reload).
|
|
1571
|
+
* Hydration in buildRuntime restores the TOKENS synchronously, but the access
|
|
1572
|
+
* token JWT does not carry emailVerified/createdAt, so the full AuthUser can't
|
|
1573
|
+
* be reconstructed offline — this fetches GET /auth/user once and announces
|
|
1574
|
+
* `signedIn`, so the app no longer has to `await pb.auth.refreshUser()` itself
|
|
1575
|
+
* on boot. Idempotent (runs once), browser-safe (no-op when not signed in or
|
|
1576
|
+
* a user is already cached), and never throws (a boot-time network failure
|
|
1577
|
+
* must not break app startup — isSignedIn stays true, the app can retry).
|
|
1578
|
+
*/
|
|
1579
|
+
hydrateUser() {
|
|
1580
|
+
if (this.hydratingUser || this.cachedUser || !this.isSignedIn) return;
|
|
1581
|
+
this.hydratingUser = true;
|
|
1582
|
+
void this.refreshUser().then((user) => {
|
|
1583
|
+
if (this.isSignedIn) {
|
|
1584
|
+
this.signedInState = true;
|
|
1585
|
+
this.emitState({ status: "signedIn", user });
|
|
1586
|
+
}
|
|
1587
|
+
}).catch(() => {
|
|
1588
|
+
}).finally(() => {
|
|
1589
|
+
this.hydratingUser = false;
|
|
1590
|
+
});
|
|
1591
|
+
}
|
|
1567
1592
|
// ── listeners ──────────────────────────────────────────
|
|
1568
1593
|
/**
|
|
1569
1594
|
* Subscribe to signed-in/signed-out state. Fires immediately with the
|
|
1570
|
-
* current snapshot (iOS parity).
|
|
1571
|
-
*
|
|
1572
|
-
*
|
|
1573
|
-
*
|
|
1595
|
+
* current snapshot (iOS parity). A restored session (page reload) hydrates
|
|
1596
|
+
* the user asynchronously via `hydrateUser()` (fired once at boot), so the
|
|
1597
|
+
* FIRST snapshot may report signedOut for a tick even when `isSignedIn` is
|
|
1598
|
+
* true; the listener then fires again with `signedIn` once the user lands.
|
|
1599
|
+
* Rely on `isSignedIn` for the session truth if you need it synchronously.
|
|
1574
1600
|
*/
|
|
1575
1601
|
onAuthStateChange(callback) {
|
|
1576
1602
|
this.stateListeners.add(callback);
|
|
@@ -8924,7 +8950,7 @@ function defaultSessionStorage(key) {
|
|
|
8924
8950
|
}
|
|
8925
8951
|
|
|
8926
8952
|
// src/version.ts
|
|
8927
|
-
var VERSION = "1.
|
|
8953
|
+
var VERSION = "1.9.0";
|
|
8928
8954
|
|
|
8929
8955
|
// src/runtime.ts
|
|
8930
8956
|
function buildRuntime(config) {
|
|
@@ -9042,6 +9068,7 @@ function buildRuntime(config) {
|
|
|
9042
9068
|
void rt.perf;
|
|
9043
9069
|
if (typeof document !== "undefined") {
|
|
9044
9070
|
void new PerfConfigClient().fetchConfig(rt, rt.perf);
|
|
9071
|
+
rt.auth.hydrateUser();
|
|
9045
9072
|
}
|
|
9046
9073
|
recordColdStart(rt);
|
|
9047
9074
|
observeWebVitals((item) => rt.perf.record(item));
|