@unifold/ui-web 0.1.72 → 0.1.73
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.js +2 -41
- package/dist/index.mjs +2 -41
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -39769,7 +39769,7 @@ function generateKSUID() {
|
|
|
39769
39769
|
function generatePrefixedKSUID(prefix) {
|
|
39770
39770
|
return `${prefix}_${generateKSUID()}`;
|
|
39771
39771
|
}
|
|
39772
|
-
var SDK_VERSION = true ? "0.1.
|
|
39772
|
+
var SDK_VERSION = true ? "0.1.73" : "0.0.0-dev";
|
|
39773
39773
|
var CLIENT_VERSION_HEADER = "x-unifold-client-version";
|
|
39774
39774
|
var CLIENT_USER_AGENT_HEADER = "x-unifold-client-user-agent";
|
|
39775
39775
|
function detectRuntime() {
|
|
@@ -47725,7 +47725,7 @@ function generateKSUID2() {
|
|
|
47725
47725
|
function generatePrefixedKSUID2(prefix) {
|
|
47726
47726
|
return `${prefix}_${generateKSUID2()}`;
|
|
47727
47727
|
}
|
|
47728
|
-
var PACKAGE_VERSION = "0.1.
|
|
47728
|
+
var PACKAGE_VERSION = "0.1.73";
|
|
47729
47729
|
var LIBRARY_NAME = "@unifold/analytics";
|
|
47730
47730
|
var DEFAULT_DEDUP_MS = 500;
|
|
47731
47731
|
var SESSION_PREFIX = "asess";
|
|
@@ -66976,15 +66976,10 @@ function useStripeOnramp(stripePublishableKey, isDark = false) {
|
|
|
66976
66976
|
setIsLoading(true);
|
|
66977
66977
|
setError(null);
|
|
66978
66978
|
try {
|
|
66979
|
-
console.log("[PayWithStripeLink] Importing @stripe/crypto...");
|
|
66980
66979
|
const { loadCryptoOnrampAndInitialize } = await import(
|
|
66981
66980
|
/* @vite-ignore */
|
|
66982
66981
|
"@stripe/crypto"
|
|
66983
66982
|
);
|
|
66984
|
-
console.log(
|
|
66985
|
-
"[PayWithStripeLink] @stripe/crypto imported, initializing with key:",
|
|
66986
|
-
stripePublishableKey?.slice(0, 12) + "..."
|
|
66987
|
-
);
|
|
66988
66983
|
const initPromise = loadCryptoOnrampAndInitialize(stripePublishableKey, {
|
|
66989
66984
|
theme: theme ? "night" : "stripe"
|
|
66990
66985
|
});
|
|
@@ -67002,7 +66997,6 @@ function useStripeOnramp(stripePublishableKey, isDark = false) {
|
|
|
67002
66997
|
if (!instance) {
|
|
67003
66998
|
throw new Error("Stripe SDK returned null.");
|
|
67004
66999
|
}
|
|
67005
|
-
console.log("[PayWithStripeLink] Stripe SDK initialized successfully");
|
|
67006
67000
|
coordinatorRef.current = instance;
|
|
67007
67001
|
coordinatorThemeRef.current = theme;
|
|
67008
67002
|
setCoordinator(instance);
|
|
@@ -67271,12 +67265,7 @@ function PayWithStripeLink({
|
|
|
67271
67265
|
let active = true;
|
|
67272
67266
|
const fetchConfig = async () => {
|
|
67273
67267
|
try {
|
|
67274
|
-
console.log("[PayWithStripeLink] Fetching Stripe config...");
|
|
67275
67268
|
const cfg = await stripeGetConfig(publishableKey);
|
|
67276
|
-
console.log(
|
|
67277
|
-
"[PayWithStripeLink] Got Stripe config:",
|
|
67278
|
-
cfg.publishable_key?.slice(0, 15) + "..."
|
|
67279
|
-
);
|
|
67280
67269
|
if (active && cfg.publishable_key) setResolvedStripeKey(cfg.publishable_key);
|
|
67281
67270
|
else if (active) {
|
|
67282
67271
|
console.error("[PayWithStripeLink] Config response missing publishable_key");
|
|
@@ -67298,12 +67287,7 @@ function PayWithStripeLink({
|
|
|
67298
67287
|
let active = true;
|
|
67299
67288
|
const retryConfig = async () => {
|
|
67300
67289
|
try {
|
|
67301
|
-
console.log("[PayWithStripeLink] Retrying Stripe config fetch...");
|
|
67302
67290
|
const cfg = await stripeGetConfig(publishableKey);
|
|
67303
|
-
console.log(
|
|
67304
|
-
"[PayWithStripeLink] Retry got Stripe config:",
|
|
67305
|
-
cfg.publishable_key?.slice(0, 15) + "..."
|
|
67306
|
-
);
|
|
67307
67291
|
if (active && cfg.publishable_key) setResolvedStripeKey(cfg.publishable_key);
|
|
67308
67292
|
} catch (err) {
|
|
67309
67293
|
const msg = err instanceof Error ? err.message : t.formErrors.configLoadFailed;
|
|
@@ -67322,17 +67306,6 @@ function PayWithStripeLink({
|
|
|
67322
67306
|
error: sdkError,
|
|
67323
67307
|
initialize
|
|
67324
67308
|
} = useStripeOnramp(resolvedStripeKey, isDark);
|
|
67325
|
-
(0, import_react23.useEffect)(() => {
|
|
67326
|
-
if (step === "auth") {
|
|
67327
|
-
console.log("[PayWithStripeLink] Auth step state:", {
|
|
67328
|
-
resolvedStripeKey: resolvedStripeKey ? resolvedStripeKey.slice(0, 15) + "..." : void 0,
|
|
67329
|
-
coordinator: !!coordinator,
|
|
67330
|
-
sdkLoading,
|
|
67331
|
-
sdkError,
|
|
67332
|
-
configError
|
|
67333
|
-
});
|
|
67334
|
-
}
|
|
67335
|
-
}, [step, resolvedStripeKey, coordinator, sdkLoading, sdkError, configError]);
|
|
67336
67309
|
const [email, setEmail] = (0, import_react23.useState)(emailProp ?? "");
|
|
67337
67310
|
const [phone, setPhone] = (0, import_react23.useState)("");
|
|
67338
67311
|
const [country, setCountry] = (0, import_react23.useState)("US");
|
|
@@ -67434,13 +67407,6 @@ function PayWithStripeLink({
|
|
|
67434
67407
|
);
|
|
67435
67408
|
(0, import_react23.useEffect)(() => {
|
|
67436
67409
|
const stored = getStoredStripeSession(userId);
|
|
67437
|
-
console.log("[PayWithStripeLink] Restore check:", {
|
|
67438
|
-
hasStored: !!stored,
|
|
67439
|
-
hasAccessToken: !!stored?.accessToken,
|
|
67440
|
-
hasRefreshToken: !!stored?.refreshToken,
|
|
67441
|
-
expired: stored ? isTokenExpired(stored) : null,
|
|
67442
|
-
expiresAt: stored?.expiresAt ? new Date(stored.expiresAt).toISOString() : null
|
|
67443
|
-
});
|
|
67444
67410
|
if (!stored || !stored.accessToken) {
|
|
67445
67411
|
setRestoring(false);
|
|
67446
67412
|
return;
|
|
@@ -67451,13 +67417,11 @@ function PayWithStripeLink({
|
|
|
67451
67417
|
let refresh = stored.refreshToken;
|
|
67452
67418
|
if (isTokenExpired(stored)) {
|
|
67453
67419
|
if (!stored.refreshToken) {
|
|
67454
|
-
console.log("[PayWithStripeLink] Token expired, no refresh token \u2014 clearing session");
|
|
67455
67420
|
clearStripeSession(userId);
|
|
67456
67421
|
if (!cancelled) setRestoring(false);
|
|
67457
67422
|
return;
|
|
67458
67423
|
}
|
|
67459
67424
|
try {
|
|
67460
|
-
console.log("[PayWithStripeLink] Token expired, refreshing...");
|
|
67461
67425
|
const res = await stripeRefreshToken(stored.refreshToken, publishableKey);
|
|
67462
67426
|
if (cancelled) return;
|
|
67463
67427
|
token = res.access_token;
|
|
@@ -67636,9 +67600,6 @@ function PayWithStripeLink({
|
|
|
67636
67600
|
}
|
|
67637
67601
|
}, [customerId]);
|
|
67638
67602
|
const [amount, setAmount] = (0, import_react23.useState)("");
|
|
67639
|
-
(0, import_react23.useEffect)(() => {
|
|
67640
|
-
console.log("[PayWithStripeLink] Component mounted/remounted. Amount:", amount, "Step:", step);
|
|
67641
|
-
}, []);
|
|
67642
67603
|
const sourceCurrency = "usd";
|
|
67643
67604
|
const { data: fiatCurrencies } = useFiatCurrencies({ publishableKey });
|
|
67644
67605
|
const minAmount = fiatCurrencies?.data.find((entry) => entry.currency_code.toLowerCase() === sourceCurrency)?.minimum_amount ?? FALLBACK_MIN_USD2;
|
package/dist/index.mjs
CHANGED
|
@@ -39756,7 +39756,7 @@ function generateKSUID() {
|
|
|
39756
39756
|
function generatePrefixedKSUID(prefix) {
|
|
39757
39757
|
return `${prefix}_${generateKSUID()}`;
|
|
39758
39758
|
}
|
|
39759
|
-
var SDK_VERSION = true ? "0.1.
|
|
39759
|
+
var SDK_VERSION = true ? "0.1.73" : "0.0.0-dev";
|
|
39760
39760
|
var CLIENT_VERSION_HEADER = "x-unifold-client-version";
|
|
39761
39761
|
var CLIENT_USER_AGENT_HEADER = "x-unifold-client-user-agent";
|
|
39762
39762
|
function detectRuntime() {
|
|
@@ -47712,7 +47712,7 @@ function generateKSUID2() {
|
|
|
47712
47712
|
function generatePrefixedKSUID2(prefix) {
|
|
47713
47713
|
return `${prefix}_${generateKSUID2()}`;
|
|
47714
47714
|
}
|
|
47715
|
-
var PACKAGE_VERSION = "0.1.
|
|
47715
|
+
var PACKAGE_VERSION = "0.1.73";
|
|
47716
47716
|
var LIBRARY_NAME = "@unifold/analytics";
|
|
47717
47717
|
var DEFAULT_DEDUP_MS = 500;
|
|
47718
47718
|
var SESSION_PREFIX = "asess";
|
|
@@ -66963,15 +66963,10 @@ function useStripeOnramp(stripePublishableKey, isDark = false) {
|
|
|
66963
66963
|
setIsLoading(true);
|
|
66964
66964
|
setError(null);
|
|
66965
66965
|
try {
|
|
66966
|
-
console.log("[PayWithStripeLink] Importing @stripe/crypto...");
|
|
66967
66966
|
const { loadCryptoOnrampAndInitialize } = await import(
|
|
66968
66967
|
/* @vite-ignore */
|
|
66969
66968
|
"@stripe/crypto"
|
|
66970
66969
|
);
|
|
66971
|
-
console.log(
|
|
66972
|
-
"[PayWithStripeLink] @stripe/crypto imported, initializing with key:",
|
|
66973
|
-
stripePublishableKey?.slice(0, 12) + "..."
|
|
66974
|
-
);
|
|
66975
66970
|
const initPromise = loadCryptoOnrampAndInitialize(stripePublishableKey, {
|
|
66976
66971
|
theme: theme ? "night" : "stripe"
|
|
66977
66972
|
});
|
|
@@ -66989,7 +66984,6 @@ function useStripeOnramp(stripePublishableKey, isDark = false) {
|
|
|
66989
66984
|
if (!instance) {
|
|
66990
66985
|
throw new Error("Stripe SDK returned null.");
|
|
66991
66986
|
}
|
|
66992
|
-
console.log("[PayWithStripeLink] Stripe SDK initialized successfully");
|
|
66993
66987
|
coordinatorRef.current = instance;
|
|
66994
66988
|
coordinatorThemeRef.current = theme;
|
|
66995
66989
|
setCoordinator(instance);
|
|
@@ -67258,12 +67252,7 @@ function PayWithStripeLink({
|
|
|
67258
67252
|
let active = true;
|
|
67259
67253
|
const fetchConfig = async () => {
|
|
67260
67254
|
try {
|
|
67261
|
-
console.log("[PayWithStripeLink] Fetching Stripe config...");
|
|
67262
67255
|
const cfg = await stripeGetConfig(publishableKey);
|
|
67263
|
-
console.log(
|
|
67264
|
-
"[PayWithStripeLink] Got Stripe config:",
|
|
67265
|
-
cfg.publishable_key?.slice(0, 15) + "..."
|
|
67266
|
-
);
|
|
67267
67256
|
if (active && cfg.publishable_key) setResolvedStripeKey(cfg.publishable_key);
|
|
67268
67257
|
else if (active) {
|
|
67269
67258
|
console.error("[PayWithStripeLink] Config response missing publishable_key");
|
|
@@ -67285,12 +67274,7 @@ function PayWithStripeLink({
|
|
|
67285
67274
|
let active = true;
|
|
67286
67275
|
const retryConfig = async () => {
|
|
67287
67276
|
try {
|
|
67288
|
-
console.log("[PayWithStripeLink] Retrying Stripe config fetch...");
|
|
67289
67277
|
const cfg = await stripeGetConfig(publishableKey);
|
|
67290
|
-
console.log(
|
|
67291
|
-
"[PayWithStripeLink] Retry got Stripe config:",
|
|
67292
|
-
cfg.publishable_key?.slice(0, 15) + "..."
|
|
67293
|
-
);
|
|
67294
67278
|
if (active && cfg.publishable_key) setResolvedStripeKey(cfg.publishable_key);
|
|
67295
67279
|
} catch (err) {
|
|
67296
67280
|
const msg = err instanceof Error ? err.message : t.formErrors.configLoadFailed;
|
|
@@ -67309,17 +67293,6 @@ function PayWithStripeLink({
|
|
|
67309
67293
|
error: sdkError,
|
|
67310
67294
|
initialize
|
|
67311
67295
|
} = useStripeOnramp(resolvedStripeKey, isDark);
|
|
67312
|
-
(0, import_react23.useEffect)(() => {
|
|
67313
|
-
if (step === "auth") {
|
|
67314
|
-
console.log("[PayWithStripeLink] Auth step state:", {
|
|
67315
|
-
resolvedStripeKey: resolvedStripeKey ? resolvedStripeKey.slice(0, 15) + "..." : void 0,
|
|
67316
|
-
coordinator: !!coordinator,
|
|
67317
|
-
sdkLoading,
|
|
67318
|
-
sdkError,
|
|
67319
|
-
configError
|
|
67320
|
-
});
|
|
67321
|
-
}
|
|
67322
|
-
}, [step, resolvedStripeKey, coordinator, sdkLoading, sdkError, configError]);
|
|
67323
67296
|
const [email, setEmail] = (0, import_react23.useState)(emailProp ?? "");
|
|
67324
67297
|
const [phone, setPhone] = (0, import_react23.useState)("");
|
|
67325
67298
|
const [country, setCountry] = (0, import_react23.useState)("US");
|
|
@@ -67421,13 +67394,6 @@ function PayWithStripeLink({
|
|
|
67421
67394
|
);
|
|
67422
67395
|
(0, import_react23.useEffect)(() => {
|
|
67423
67396
|
const stored = getStoredStripeSession(userId);
|
|
67424
|
-
console.log("[PayWithStripeLink] Restore check:", {
|
|
67425
|
-
hasStored: !!stored,
|
|
67426
|
-
hasAccessToken: !!stored?.accessToken,
|
|
67427
|
-
hasRefreshToken: !!stored?.refreshToken,
|
|
67428
|
-
expired: stored ? isTokenExpired(stored) : null,
|
|
67429
|
-
expiresAt: stored?.expiresAt ? new Date(stored.expiresAt).toISOString() : null
|
|
67430
|
-
});
|
|
67431
67397
|
if (!stored || !stored.accessToken) {
|
|
67432
67398
|
setRestoring(false);
|
|
67433
67399
|
return;
|
|
@@ -67438,13 +67404,11 @@ function PayWithStripeLink({
|
|
|
67438
67404
|
let refresh = stored.refreshToken;
|
|
67439
67405
|
if (isTokenExpired(stored)) {
|
|
67440
67406
|
if (!stored.refreshToken) {
|
|
67441
|
-
console.log("[PayWithStripeLink] Token expired, no refresh token \u2014 clearing session");
|
|
67442
67407
|
clearStripeSession(userId);
|
|
67443
67408
|
if (!cancelled) setRestoring(false);
|
|
67444
67409
|
return;
|
|
67445
67410
|
}
|
|
67446
67411
|
try {
|
|
67447
|
-
console.log("[PayWithStripeLink] Token expired, refreshing...");
|
|
67448
67412
|
const res = await stripeRefreshToken(stored.refreshToken, publishableKey);
|
|
67449
67413
|
if (cancelled) return;
|
|
67450
67414
|
token = res.access_token;
|
|
@@ -67623,9 +67587,6 @@ function PayWithStripeLink({
|
|
|
67623
67587
|
}
|
|
67624
67588
|
}, [customerId]);
|
|
67625
67589
|
const [amount, setAmount] = (0, import_react23.useState)("");
|
|
67626
|
-
(0, import_react23.useEffect)(() => {
|
|
67627
|
-
console.log("[PayWithStripeLink] Component mounted/remounted. Amount:", amount, "Step:", step);
|
|
67628
|
-
}, []);
|
|
67629
67590
|
const sourceCurrency = "usd";
|
|
67630
67591
|
const { data: fiatCurrencies } = useFiatCurrencies({ publishableKey });
|
|
67631
67592
|
const minAmount = fiatCurrencies?.data.find((entry) => entry.currency_code.toLowerCase() === sourceCurrency)?.minimum_amount ?? FALLBACK_MIN_USD2;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unifold/ui-web",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.73",
|
|
4
4
|
"description": "Unifold UI Web - Framework-agnostic deposit widget",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -44,10 +44,10 @@
|
|
|
44
44
|
"prettier": "^3.2.5",
|
|
45
45
|
"tsup": "^8.0.0",
|
|
46
46
|
"typescript": "^5.0.0",
|
|
47
|
-
"@unifold/connect-react": "0.1.
|
|
48
|
-
"@unifold/
|
|
49
|
-
"@unifold/
|
|
50
|
-
"@unifold/react-provider": "0.1.
|
|
47
|
+
"@unifold/connect-react": "0.1.73",
|
|
48
|
+
"@unifold/ui-react": "0.1.73",
|
|
49
|
+
"@unifold/core": "0.1.73",
|
|
50
|
+
"@unifold/react-provider": "0.1.73"
|
|
51
51
|
},
|
|
52
52
|
"keywords": [
|
|
53
53
|
"unifold",
|