@bounded-sh/client 0.0.112-ux-audit.1 → 0.0.112
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/auth/bounded-widget-modal.d.ts +24 -2
- package/dist/auth/oidc-auth.d.ts +1 -1
- package/dist/{email-auth-provider-eyi3Wpnx.mjs → email-auth-provider-BV1Iea4A.mjs} +2 -2
- package/dist/{email-auth-provider-BfCH7K6N.mjs.map → email-auth-provider-BV1Iea4A.mjs.map} +1 -1
- package/dist/{email-auth-provider-CG5cxOj0.js → email-auth-provider-CyFsnSzx.js} +2 -2
- package/dist/{email-auth-provider-CG5cxOj0.js.map → email-auth-provider-CyFsnSzx.js.map} +1 -1
- package/dist/{email-auth-provider-BfCH7K6N.mjs → email-auth-provider-D0_iXVYk.mjs} +2 -2
- package/dist/{email-auth-provider-eyi3Wpnx.mjs.map → email-auth-provider-D0_iXVYk.mjs.map} +1 -1
- package/dist/{email-auth-provider-DTrCfOJd.js → email-auth-provider-OVzQ63dn.js} +2 -2
- package/dist/{email-auth-provider-DTrCfOJd.js.map → email-auth-provider-OVzQ63dn.js.map} +1 -1
- package/dist/{guest-auth-provider-Tndt6tzJ.js → guest-auth-provider-0WlOutqU.js} +2 -2
- package/dist/{guest-auth-provider-Tndt6tzJ.js.map → guest-auth-provider-0WlOutqU.js.map} +1 -1
- package/dist/{guest-auth-provider-DjOFjtnk.mjs → guest-auth-provider-AP80a700.mjs} +2 -2
- package/dist/{guest-auth-provider-BsW56oJg.mjs.map → guest-auth-provider-AP80a700.mjs.map} +1 -1
- package/dist/{guest-auth-provider-Dtl1J-2F.js → guest-auth-provider-B4WIWOjV.js} +2 -2
- package/dist/{guest-auth-provider-Dtl1J-2F.js.map → guest-auth-provider-B4WIWOjV.js.map} +1 -1
- package/dist/{guest-auth-provider-BsW56oJg.mjs → guest-auth-provider-Cqx1zH23.mjs} +2 -2
- package/dist/{guest-auth-provider-DjOFjtnk.mjs.map → guest-auth-provider-Cqx1zH23.mjs.map} +1 -1
- package/dist/{index-Brdwqgqs.js → index-BmNNZlTl.js} +226 -67
- package/dist/index-BmNNZlTl.js.map +1 -0
- package/dist/{index-CRxls8Qc.mjs → index-D76-cZcD.mjs} +226 -67
- package/dist/index-D76-cZcD.mjs.map +1 -0
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/{index.native-ingNhWPw.js → index.native-C5glqiTU.js} +59 -14
- package/dist/index.native-C5glqiTU.js.map +1 -0
- package/dist/{index.native-CAH_ks0s.mjs → index.native-DyR93n8K.mjs} +59 -14
- package/dist/index.native-DyR93n8K.mjs.map +1 -0
- package/dist/index.native.js +1 -1
- package/dist/index.native.mjs +1 -1
- package/dist/{injected-evm-wallet-provider-Cao1U0NZ.js → injected-evm-wallet-provider-4ICYUEU4.js} +2 -2
- package/dist/{injected-evm-wallet-provider-Cao1U0NZ.js.map → injected-evm-wallet-provider-4ICYUEU4.js.map} +1 -1
- package/dist/{injected-evm-wallet-provider-CwOGXCDt.js → injected-evm-wallet-provider-C8YItSiB.js} +2 -2
- package/dist/{injected-evm-wallet-provider-CwOGXCDt.js.map → injected-evm-wallet-provider-C8YItSiB.js.map} +1 -1
- package/dist/{injected-evm-wallet-provider-DXjwPjLW.mjs → injected-evm-wallet-provider-CS4R8c51.mjs} +2 -2
- package/dist/{injected-evm-wallet-provider-DXjwPjLW.mjs.map → injected-evm-wallet-provider-CS4R8c51.mjs.map} +1 -1
- package/dist/{injected-evm-wallet-provider-BjkCeRBL.mjs → injected-evm-wallet-provider-WxUbyMZL.mjs} +2 -2
- package/dist/{injected-evm-wallet-provider-BjkCeRBL.mjs.map → injected-evm-wallet-provider-WxUbyMZL.mjs.map} +1 -1
- package/dist/{injected-wallet-provider-CfYNIIHd.mjs → injected-wallet-provider-D1ygndjX.mjs} +2 -2
- package/dist/{injected-wallet-provider-CfYNIIHd.mjs.map → injected-wallet-provider-D1ygndjX.mjs.map} +1 -1
- package/dist/{injected-wallet-provider-LTnqoaYD.js → injected-wallet-provider-D8vIsUHf.js} +2 -2
- package/dist/{injected-wallet-provider-LTnqoaYD.js.map → injected-wallet-provider-D8vIsUHf.js.map} +1 -1
- package/dist/{injected-wallet-provider-BG6gGNch.mjs → injected-wallet-provider-UuGrzdNW.mjs} +2 -2
- package/dist/{injected-wallet-provider-BG6gGNch.mjs.map → injected-wallet-provider-UuGrzdNW.mjs.map} +1 -1
- package/dist/{injected-wallet-provider-DSlHfgMU.js → injected-wallet-provider-nwd3ialR.js} +2 -2
- package/dist/{injected-wallet-provider-DSlHfgMU.js.map → injected-wallet-provider-nwd3ialR.js.map} +1 -1
- package/package.json +2 -2
- package/dist/index-Brdwqgqs.js.map +0 -1
- package/dist/index-CRxls8Qc.mjs.map +0 -1
- package/dist/index.native-CAH_ks0s.mjs.map +0 -1
- package/dist/index.native-ingNhWPw.js.map +0 -1
package/dist/index.js
CHANGED
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { ag as BUILD_DELEGATED_REVIEW_CAPABILITY_SCHEMA, af as BUILD_REVIEW_CAPABILITY_REFRESH_SCHEMA, ae as BUILD_REVIEW_CAPABILITY_SCHEMA, a7 as BuildsApiError, ad as FAILURE_REASONS, a9 as NON_TERMINAL_STATES, a1 as OffchainAuthProvider, ac as PARK_REASONS, a2 as PrivyExpoProvider, ab as RUN_STATES, aa as TERMINAL_STATES, W as WalletConfigError, Q as apps, a6 as builds, I as completeLoginFromRedirect, a4 as connectBroadcast, a5 as connectServiceSession, o as defaultInjectedEvmProvider, f as defaultInjectedProvider, F as ensureSharedWalletLoginReady, M as ensureSignedIn, E as ensureWalletLoginReady, w as getAuthLoading, A as getAuthProvider, q as getCurrentUser, Y as getIdToken, J as getLoginReturnError, S as getOrCreateTurnkeyWallet, g as getPlatform, V as getTurnkeyWalletRecoveryUrl, U as getTurnkeyWalletSessionState, p as init, y as login, K as loginWithPopup, C as loginWithPrivy, H as loginWithRedirect, D as loginWithWallet, z as logout, a8 as mediaAgentTools, v as onAuthLoadingChanged, u as onAuthStateChanged, Z as onramp, _ as onrampQuote, $ as onrampStatus, L as openBoundedWidget, T as openTurnkeyKeyExport, G as preloadWalletLogin, a3 as requestEip6963Providers, a0 as setPlatform, B as signInAnonymously, R as signSolanaMessageViaTurnkey, X as startTurnkeyEmailLogin, N as useAuth, P as useBuildRun, O as useQuery, x as waitForAuthReady } from './index-
|
|
1
|
+
export { ag as BUILD_DELEGATED_REVIEW_CAPABILITY_SCHEMA, af as BUILD_REVIEW_CAPABILITY_REFRESH_SCHEMA, ae as BUILD_REVIEW_CAPABILITY_SCHEMA, a7 as BuildsApiError, ad as FAILURE_REASONS, a9 as NON_TERMINAL_STATES, a1 as OffchainAuthProvider, ac as PARK_REASONS, a2 as PrivyExpoProvider, ab as RUN_STATES, aa as TERMINAL_STATES, W as WalletConfigError, Q as apps, a6 as builds, I as completeLoginFromRedirect, a4 as connectBroadcast, a5 as connectServiceSession, o as defaultInjectedEvmProvider, f as defaultInjectedProvider, F as ensureSharedWalletLoginReady, M as ensureSignedIn, E as ensureWalletLoginReady, w as getAuthLoading, A as getAuthProvider, q as getCurrentUser, Y as getIdToken, J as getLoginReturnError, S as getOrCreateTurnkeyWallet, g as getPlatform, V as getTurnkeyWalletRecoveryUrl, U as getTurnkeyWalletSessionState, p as init, y as login, K as loginWithPopup, C as loginWithPrivy, H as loginWithRedirect, D as loginWithWallet, z as logout, a8 as mediaAgentTools, v as onAuthLoadingChanged, u as onAuthStateChanged, Z as onramp, _ as onrampQuote, $ as onrampStatus, L as openBoundedWidget, T as openTurnkeyKeyExport, G as preloadWalletLogin, a3 as requestEip6963Providers, a0 as setPlatform, B as signInAnonymously, R as signSolanaMessageViaTurnkey, X as startTurnkeyEmailLogin, N as useAuth, P as useBuildRun, O as useQuery, x as waitForAuthReady } from './index-D76-cZcD.mjs';
|
|
2
2
|
export * from '@bounded-sh/core';
|
|
3
3
|
export { AppTokenExchangeError, BoundedDeclineError, DECLINE_EVENT_NAME, RATE_LIMIT_EVENT_NAME, ScopedClientReadOnlyError, aggregate, clearAppTokenCache, count, createAppTokenAuthHeaders, createClient, deriveDecline, dispatchDeclineEvent, dispatchRateLimitEvent, docId, exchangeAppToken, get, getConfig, getFiles, getMany, queryAggregate, reconcileSetResult, runExpression, runExpressionMany, runQuery, runQueryMany, search, set, setFile, setMany, signAndSubmitTransaction, signMessage, signTransaction, subscribe, waitForSetResult } from '@bounded-sh/core';
|
|
4
4
|
import 'react';
|
|
@@ -3840,9 +3840,13 @@ async function ensureSolanaMobileWalletRegistered(config, network) {
|
|
|
3840
3840
|
}
|
|
3841
3841
|
catch (_e) {
|
|
3842
3842
|
throw new WalletConfigError(`Bounded: Solana Mobile wallet support needs the optional peer dependency ` +
|
|
3843
|
-
`'@solana-mobile/wallet-standard-mobile', which is not installed.
|
|
3844
|
-
`
|
|
3845
|
-
`
|
|
3843
|
+
`'@solana-mobile/wallet-standard-mobile', which is not installed. Until it is, ` +
|
|
3844
|
+
`Android users (Seeker, Saga, any phone browser) get NO wallet to connect: ` +
|
|
3845
|
+
`installed wallet apps are never injected into a page there, the mobile adapter ` +
|
|
3846
|
+
`is the only route. Fix: npm install @solana-mobile/wallet-standard-mobile ` +
|
|
3847
|
+
`(a web app also needs legacy-peer-deps=true in its .npmrc, because the adapter's ` +
|
|
3848
|
+
`protocol package declares react-native as a peer). Or leave the Solana Mobile ` +
|
|
3849
|
+
`wallet out of this app's wallet configuration on purpose.`);
|
|
3846
3850
|
}
|
|
3847
3851
|
const { registerMwa, createDefaultChainSelector, SolanaMobileWalletAdapterWalletName, SolanaMobileWalletAdapterRemoteWalletName, } = mwa;
|
|
3848
3852
|
const before = new Set(getWallets().get());
|
|
@@ -3929,7 +3933,7 @@ const OVERLAY_CSS = `
|
|
|
3929
3933
|
:host{all:initial}
|
|
3930
3934
|
*{box-sizing:border-box}
|
|
3931
3935
|
.bw-ov{position:fixed;inset:0;z-index:2147483647;display:none;
|
|
3932
|
-
font-family:"Schibsted Grotesk","Helvetica Neue",Arial,sans-serif}
|
|
3936
|
+
font-family:"Bounded Schibsted Grotesk","Schibsted Grotesk","Helvetica Neue",Arial,sans-serif}
|
|
3933
3937
|
.bw-ov.mounted{display:block}
|
|
3934
3938
|
.bw-back{position:fixed;inset:0;background:rgba(4,4,5,.62);opacity:0;
|
|
3935
3939
|
transition:opacity .24s ease;-webkit-backdrop-filter:blur(5px);backdrop-filter:blur(5px)}
|
|
@@ -3962,6 +3966,29 @@ const OVERLAY_CSS = `
|
|
|
3962
3966
|
}
|
|
3963
3967
|
@media(prefers-reduced-motion:reduce){.bw-back,.bw-panel{transition:opacity .12s linear!important}}
|
|
3964
3968
|
`;
|
|
3969
|
+
/**
|
|
3970
|
+
* Style the shadow tree with `css` as constructed stylesheets, and say whether it could. A host
|
|
3971
|
+
* CSP whose style-src lacks 'unsafe-inline' refuses an inline <style> even inside a shadow root,
|
|
3972
|
+
* which left the widget unstyled (the Bounded router compiles exactly `style-src 'self'` for an
|
|
3973
|
+
* app that declares browser boundaries and names no style sources); CSP does not govern
|
|
3974
|
+
* constructed sheets. A browser without them (they shipped with adoptedStyleSheets everywhere)
|
|
3975
|
+
* gets <style> elements instead (styleTag).
|
|
3976
|
+
*/
|
|
3977
|
+
function adoptStyles(shadow, css) {
|
|
3978
|
+
if (!("adoptedStyleSheets" in shadow))
|
|
3979
|
+
return false;
|
|
3980
|
+
shadow.adoptedStyleSheets = css.map((text) => {
|
|
3981
|
+
const sheet = new CSSStyleSheet();
|
|
3982
|
+
sheet.replaceSync(text);
|
|
3983
|
+
return sheet;
|
|
3984
|
+
});
|
|
3985
|
+
return true;
|
|
3986
|
+
}
|
|
3987
|
+
function styleTag(css) {
|
|
3988
|
+
const style = document.createElement("style");
|
|
3989
|
+
style.textContent = css;
|
|
3990
|
+
return style;
|
|
3991
|
+
}
|
|
3965
3992
|
let modal = null;
|
|
3966
3993
|
function getModal() {
|
|
3967
3994
|
if (modal)
|
|
@@ -3969,9 +3996,8 @@ function getModal() {
|
|
|
3969
3996
|
const root = document.createElement("div");
|
|
3970
3997
|
root.setAttribute("data-bounded-widget", "");
|
|
3971
3998
|
const shadow = root.attachShadow({ mode: "open" });
|
|
3972
|
-
|
|
3973
|
-
|
|
3974
|
-
shadow.appendChild(style);
|
|
3999
|
+
if (!adoptStyles(shadow, [OVERLAY_CSS]))
|
|
4000
|
+
shadow.appendChild(styleTag(OVERLAY_CSS));
|
|
3975
4001
|
const overlay = document.createElement("div");
|
|
3976
4002
|
overlay.className = "bw-ov";
|
|
3977
4003
|
const back = document.createElement("div");
|
|
@@ -5970,7 +5996,7 @@ async function getAuthProvider(config, fromStorage = false) {
|
|
|
5970
5996
|
// manager as legacy email sessions. Human login should be started
|
|
5971
5997
|
// with loginWithRedirect(); this provider is kept as the restore and
|
|
5972
5998
|
// logout surface for those sessions.
|
|
5973
|
-
currentAuthProvider = new (await Promise.resolve().then(function () { return require('./email-auth-provider-
|
|
5999
|
+
currentAuthProvider = new (await Promise.resolve().then(function () { return require('./email-auth-provider-OVzQ63dn.js'); })).EmailAuthProvider();
|
|
5974
6000
|
break;
|
|
5975
6001
|
case "phantom": {
|
|
5976
6002
|
// First-class Solana WALLET LOGIN (the poof/TaroBase-style "connect
|
|
@@ -6012,7 +6038,7 @@ async function getAuthProvider(config, fromStorage = false) {
|
|
|
6012
6038
|
// (bounded-login-widget.ts), so registration never counts as
|
|
6013
6039
|
// evidence the user has a wallet.
|
|
6014
6040
|
await ensureSolanaMobileWalletRegistered(config, configuredNetwork);
|
|
6015
|
-
const { InjectedWalletProvider } = await Promise.resolve().then(function () { return require('./injected-wallet-provider-
|
|
6041
|
+
const { InjectedWalletProvider } = await Promise.resolve().then(function () { return require('./injected-wallet-provider-nwd3ialR.js'); });
|
|
6016
6042
|
currentAuthProvider = new InjectedWalletProvider(resolveInjectedWalletConfig(config), rpcUrl, configuredNetwork);
|
|
6017
6043
|
break;
|
|
6018
6044
|
}
|
|
@@ -6025,7 +6051,7 @@ async function getAuthProvider(config, fromStorage = false) {
|
|
|
6025
6051
|
// Selecting authMethod:'evm-wallet' IS the opt-in — pass evmWalletConfig
|
|
6026
6052
|
// to point at a specific wallet or set chainId/domain.
|
|
6027
6053
|
const evmWalletConfig = ((_a = config.evmWalletConfig) !== null && _a !== void 0 ? _a : {});
|
|
6028
|
-
const { InjectedEvmWalletProvider } = await Promise.resolve().then(function () { return require('./injected-evm-wallet-provider-
|
|
6054
|
+
const { InjectedEvmWalletProvider } = await Promise.resolve().then(function () { return require('./injected-evm-wallet-provider-4ICYUEU4.js'); });
|
|
6029
6055
|
currentAuthProvider = new InjectedEvmWalletProvider(evmWalletConfig);
|
|
6030
6056
|
break;
|
|
6031
6057
|
}
|
|
@@ -6050,7 +6076,7 @@ async function getAuthProvider(config, fromStorage = false) {
|
|
|
6050
6076
|
break;
|
|
6051
6077
|
case "guest":
|
|
6052
6078
|
// Anonymous auth: a device-local ed25519 keypair signs the challenge.
|
|
6053
|
-
currentAuthProvider = new (await Promise.resolve().then(function () { return require('./guest-auth-provider-
|
|
6079
|
+
currentAuthProvider = new (await Promise.resolve().then(function () { return require('./guest-auth-provider-0WlOutqU.js'); })).GuestAuthProvider();
|
|
6054
6080
|
break;
|
|
6055
6081
|
}
|
|
6056
6082
|
if (!currentAuthProvider) {
|
|
@@ -6112,7 +6138,7 @@ async function signInAnonymously() {
|
|
|
6112
6138
|
// Lazy-load the guest provider so its ed25519/web3 dependencies stay out of
|
|
6113
6139
|
// the main bundle for data-only apps. Specifier is a static string literal
|
|
6114
6140
|
// so bundle-splitting can see it.
|
|
6115
|
-
const provider = new (await Promise.resolve().then(function () { return require('./guest-auth-provider-
|
|
6141
|
+
const provider = new (await Promise.resolve().then(function () { return require('./guest-auth-provider-0WlOutqU.js'); })).GuestAuthProvider();
|
|
6116
6142
|
setAuthLoading(true); // reflect "signing in…" while the guest keypair session is minted
|
|
6117
6143
|
// adoptSessionProvider awaits only getConfig() (already resolved here) and then
|
|
6118
6144
|
// runs every write - provider/method/config/marker/user - in one synchronous
|
|
@@ -6283,7 +6309,7 @@ function ensureSharedWalletLoginReady() {
|
|
|
6283
6309
|
if (!sharedWalletReady) {
|
|
6284
6310
|
sharedWalletReady = (async () => {
|
|
6285
6311
|
await core.getConfig();
|
|
6286
|
-
await Promise.resolve().then(function () { return require('./injected-wallet-provider-
|
|
6312
|
+
await Promise.resolve().then(function () { return require('./injected-wallet-provider-nwd3ialR.js'); });
|
|
6287
6313
|
})().catch((error) => {
|
|
6288
6314
|
sharedWalletReady = null;
|
|
6289
6315
|
throw error;
|
|
@@ -6595,6 +6621,13 @@ function registerStorageBridge() {
|
|
|
6595
6621
|
void syncStoredSession().catch((error) => console.warn('Bounded session synchronization failed:', error));
|
|
6596
6622
|
});
|
|
6597
6623
|
}
|
|
6624
|
+
function sameSessionIdentity(next, previous) {
|
|
6625
|
+
if (!next || !previous)
|
|
6626
|
+
return false;
|
|
6627
|
+
const a = core.deriveUserIdentityFromIdToken(next);
|
|
6628
|
+
const b = core.deriveUserIdentityFromIdToken(previous);
|
|
6629
|
+
return !!a.id && a.id === b.id && a.address === b.address && a.email === b.email && a.evmAddress === b.evmAddress;
|
|
6630
|
+
}
|
|
6598
6631
|
async function syncStoredSession() {
|
|
6599
6632
|
const config = initializedConfig;
|
|
6600
6633
|
if (!config)
|
|
@@ -6603,6 +6636,18 @@ async function syncStoredSession() {
|
|
|
6603
6636
|
const issuer = core.WebSessionManager.getIssuer();
|
|
6604
6637
|
if (token === observedIdToken && issuer === observedIssuer)
|
|
6605
6638
|
return;
|
|
6639
|
+
// Another tab refreshed this same session (tokens rotate every few minutes):
|
|
6640
|
+
// who is signed in did not change, so keep the user and its live reads, whose
|
|
6641
|
+
// sockets take the new token on their own, instead of hiding and restoring it.
|
|
6642
|
+
if (currentUser && issuer === observedIssuer && sameSessionIdentity(token, observedIdToken)) {
|
|
6643
|
+
const record = await core.WebSessionManager.readSessionWithGeneration();
|
|
6644
|
+
if (config !== initializedConfig || core.WebSessionManager.getIdToken() !== token)
|
|
6645
|
+
return;
|
|
6646
|
+
if ((record === null || record === void 0 ? void 0 : record.idToken) === token && (!record.appId || record.appId === config.appId)) {
|
|
6647
|
+
observedIdToken = token;
|
|
6648
|
+
return;
|
|
6649
|
+
}
|
|
6650
|
+
}
|
|
6606
6651
|
observedIdToken = token;
|
|
6607
6652
|
observedIssuer = issuer;
|
|
6608
6653
|
const generation = ++initializationGeneration;
|
|
@@ -8818,4 +8863,4 @@ exports.useAuth = useAuth;
|
|
|
8818
8863
|
exports.useBuildRun = useBuildRun;
|
|
8819
8864
|
exports.useQuery = useQuery;
|
|
8820
8865
|
exports.waitForAuthReady = waitForAuthReady;
|
|
8821
|
-
//# sourceMappingURL=index.native-
|
|
8866
|
+
//# sourceMappingURL=index.native-C5glqiTU.js.map
|