@moonpay/platform-sdk-react-native 1.29.0 → 1.30.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/README.md +11 -1
- package/dist/index.cjs +7 -2
- 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 +7 -2
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
|
@@ -34,7 +34,7 @@ export { Event as GooglePayEvent, SetupError as SetupGooglePayError } from '@moo
|
|
|
34
34
|
import * as WidgetSdk from '@moonpay/platform-protocol/sdks/widget';
|
|
35
35
|
export { SetupError as SetupWidgetError, Event as WidgetEvent } from '@moonpay/platform-protocol/sdks/widget';
|
|
36
36
|
import { FrameTransport, FrameOptions, PresentationMode, ThemeOptions, Credentials, GetCredentialsError, GetPaymentMethodsParams, ListAssetsParams, ListTransactionsParams } from '@moonpay/platform-sdk-core';
|
|
37
|
-
export { Credentials, GetCredentialsError, GetPaymentMethodsParams, ListAssetsParams, ThemeOptions } from '@moonpay/platform-sdk-core';
|
|
37
|
+
export { Credentials, CustomTheme, GetCredentialsError, GetPaymentMethodsParams, HexColor, ListAssetsParams, ThemeOptions } from '@moonpay/platform-sdk-core';
|
|
38
38
|
import { GetPaymentMethodsError, GetQuoteError, GetAssetsError, GetTransactionsError, SimulateBankTransferError, DevPlatformApiError, GetCustomerError, SubmitCustomerKycError, GetCustomerUploadUrlError, SubmitCustomerFilesError, CreateIdentityError, GetIdentityError, UpdateIdentityError, VerifyIdentityError, GetIdentityUploadUrlError, SubmitIdentityFilesError } from '@moonpay/platform-protocol/api/errors';
|
|
39
39
|
import { UpdateIdentityRequestBody, IdentityFileUploadUrlRequestBody, IdentityFileUploadUrl, SubmitIdentityFilesRequestBody, CreateIdentityRequestBody, Identity, IdentityVerificationResponse } from '@moonpay/platform-protocol/api/identity';
|
|
40
40
|
import { ResetConnectionError } from '@moonpay/platform-protocol/sdks/reset';
|
|
@@ -183,7 +183,7 @@ interface ChallengeFrame {
|
|
|
183
183
|
}
|
|
184
184
|
|
|
185
185
|
interface ConnectOptions {
|
|
186
|
-
/** Theme for this connect frame.
|
|
186
|
+
/** Theme for this connect frame. Each option set here overrides the same option on the provider-level `theme`. */
|
|
187
187
|
theme?: ThemeOptions;
|
|
188
188
|
/** Frame chrome. Defaults to the frame's own default (bare) when omitted. */
|
|
189
189
|
presentation?: PresentationMode;
|
|
@@ -483,7 +483,7 @@ interface MoonPayChallengeProps {
|
|
|
483
483
|
declare function MoonPayChallenge({ url, resume, onEvent, style, webViewProps, }: MoonPayChallengeProps): JSX.Element;
|
|
484
484
|
|
|
485
485
|
interface MoonPayConnectProps {
|
|
486
|
-
/** Theme for this connect frame.
|
|
486
|
+
/** Theme for this connect frame. Each option set here overrides the same option on the provider-level `theme`. Mount-time only. */
|
|
487
487
|
theme?: ThemeOptions;
|
|
488
488
|
/** Callback for connect lifecycle events. */
|
|
489
489
|
onEvent?: (event: ConnectSdk.Event) => void;
|
package/dist/index.d.ts
CHANGED
|
@@ -34,7 +34,7 @@ export { Event as GooglePayEvent, SetupError as SetupGooglePayError } from '@moo
|
|
|
34
34
|
import * as WidgetSdk from '@moonpay/platform-protocol/sdks/widget';
|
|
35
35
|
export { SetupError as SetupWidgetError, Event as WidgetEvent } from '@moonpay/platform-protocol/sdks/widget';
|
|
36
36
|
import { FrameTransport, FrameOptions, PresentationMode, ThemeOptions, Credentials, GetCredentialsError, GetPaymentMethodsParams, ListAssetsParams, ListTransactionsParams } from '@moonpay/platform-sdk-core';
|
|
37
|
-
export { Credentials, GetCredentialsError, GetPaymentMethodsParams, ListAssetsParams, ThemeOptions } from '@moonpay/platform-sdk-core';
|
|
37
|
+
export { Credentials, CustomTheme, GetCredentialsError, GetPaymentMethodsParams, HexColor, ListAssetsParams, ThemeOptions } from '@moonpay/platform-sdk-core';
|
|
38
38
|
import { GetPaymentMethodsError, GetQuoteError, GetAssetsError, GetTransactionsError, SimulateBankTransferError, DevPlatformApiError, GetCustomerError, SubmitCustomerKycError, GetCustomerUploadUrlError, SubmitCustomerFilesError, CreateIdentityError, GetIdentityError, UpdateIdentityError, VerifyIdentityError, GetIdentityUploadUrlError, SubmitIdentityFilesError } from '@moonpay/platform-protocol/api/errors';
|
|
39
39
|
import { UpdateIdentityRequestBody, IdentityFileUploadUrlRequestBody, IdentityFileUploadUrl, SubmitIdentityFilesRequestBody, CreateIdentityRequestBody, Identity, IdentityVerificationResponse } from '@moonpay/platform-protocol/api/identity';
|
|
40
40
|
import { ResetConnectionError } from '@moonpay/platform-protocol/sdks/reset';
|
|
@@ -183,7 +183,7 @@ interface ChallengeFrame {
|
|
|
183
183
|
}
|
|
184
184
|
|
|
185
185
|
interface ConnectOptions {
|
|
186
|
-
/** Theme for this connect frame.
|
|
186
|
+
/** Theme for this connect frame. Each option set here overrides the same option on the provider-level `theme`. */
|
|
187
187
|
theme?: ThemeOptions;
|
|
188
188
|
/** Frame chrome. Defaults to the frame's own default (bare) when omitted. */
|
|
189
189
|
presentation?: PresentationMode;
|
|
@@ -483,7 +483,7 @@ interface MoonPayChallengeProps {
|
|
|
483
483
|
declare function MoonPayChallenge({ url, resume, onEvent, style, webViewProps, }: MoonPayChallengeProps): JSX.Element;
|
|
484
484
|
|
|
485
485
|
interface MoonPayConnectProps {
|
|
486
|
-
/** Theme for this connect frame.
|
|
486
|
+
/** Theme for this connect frame. Each option set here overrides the same option on the provider-level `theme`. Mount-time only. */
|
|
487
487
|
theme?: ThemeOptions;
|
|
488
488
|
/** Callback for connect lifecycle events. */
|
|
489
489
|
onEvent?: (event: ConnectSdk.Event) => void;
|
package/dist/index.js
CHANGED
|
@@ -1343,6 +1343,9 @@ function FrameSlots({
|
|
|
1343
1343
|
))
|
|
1344
1344
|
] });
|
|
1345
1345
|
}
|
|
1346
|
+
function themeDependencyKey(theme) {
|
|
1347
|
+
return theme ? JSON.stringify(theme) : void 0;
|
|
1348
|
+
}
|
|
1346
1349
|
function MoonPayProvider({
|
|
1347
1350
|
sessionToken: sessionTokenProp,
|
|
1348
1351
|
apiBaseUrl,
|
|
@@ -1362,9 +1365,10 @@ function MoonPayProvider({
|
|
|
1362
1365
|
},
|
|
1363
1366
|
[core]
|
|
1364
1367
|
);
|
|
1368
|
+
const themeKey = themeDependencyKey(theme);
|
|
1365
1369
|
const specCtx = useMemo2(
|
|
1366
1370
|
() => ({ sessionToken, core, frameBaseUrl, theme }),
|
|
1367
|
-
[sessionToken, core, frameBaseUrl,
|
|
1371
|
+
[sessionToken, core, frameBaseUrl, themeKey]
|
|
1368
1372
|
);
|
|
1369
1373
|
const client = useMemo2(
|
|
1370
1374
|
() => createRNClient({
|
|
@@ -1388,9 +1392,10 @@ function MoonPayEnterpriseProvider({
|
|
|
1388
1392
|
const { frameSlots, addSlot, removeSlot } = useFrameSlots();
|
|
1389
1393
|
const core = useCore(void 0, frameBaseUrl);
|
|
1390
1394
|
core.context.setClientToken(clientToken);
|
|
1395
|
+
const themeKey = themeDependencyKey(theme);
|
|
1391
1396
|
const specCtx = useMemo2(
|
|
1392
1397
|
() => ({ core, frameBaseUrl, theme, enterpriseClientToken: clientToken }),
|
|
1393
|
-
[clientToken, core, frameBaseUrl,
|
|
1398
|
+
[clientToken, core, frameBaseUrl, themeKey]
|
|
1394
1399
|
);
|
|
1395
1400
|
const value = useMemo2(
|
|
1396
1401
|
() => ({
|