@crossmint/client-sdk-react-native-ui 0.9.1 → 0.9.3

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.
Files changed (39) hide show
  1. package/dist/chunk-3MAEL2N6.js +1 -0
  2. package/dist/chunk-42ZZVPG3.js +1 -0
  3. package/dist/{chunk-BSVURJWU.cjs → chunk-5YGDF4J6.cjs} +1 -1
  4. package/dist/{chunk-3TT23DR6.js → chunk-754ES3NA.js} +1 -1
  5. package/dist/chunk-ATELCOA4.cjs +1 -0
  6. package/dist/{chunk-NF4APVKJ.js → chunk-BCY3V6PF.js} +1 -1
  7. package/dist/{chunk-3B247CA6.cjs → chunk-CLYPWR5G.cjs} +1 -1
  8. package/dist/chunk-HPOB3Q3F.cjs +1 -0
  9. package/dist/components/embed/index.cjs +1 -1
  10. package/dist/components/embed/index.js +1 -1
  11. package/dist/components/embed/v3/CrossmintEmbeddedCheckoutV3.cjs +1 -1
  12. package/dist/components/embed/v3/CrossmintEmbeddedCheckoutV3.js +1 -1
  13. package/dist/components/embed/v3/EmbeddedCheckoutV3WebView.cjs +1 -1
  14. package/dist/components/embed/v3/EmbeddedCheckoutV3WebView.js +1 -1
  15. package/dist/components/embed/v3/index.cjs +1 -1
  16. package/dist/components/embed/v3/index.js +1 -1
  17. package/dist/components/index.cjs +1 -1
  18. package/dist/components/index.js +1 -1
  19. package/dist/hooks/useCrossmintCheckout.cjs +1 -0
  20. package/dist/hooks/useCrossmintCheckout.d.cts +14 -0
  21. package/dist/hooks/useCrossmintCheckout.d.ts +14 -0
  22. package/dist/hooks/useCrossmintCheckout.js +1 -0
  23. package/dist/index.cjs +1 -1
  24. package/dist/index.js +1 -1
  25. package/dist/providers/index.cjs +1 -1
  26. package/dist/providers/index.js +1 -1
  27. package/dist/utils/createCrossmintApiClient.cjs +1 -1
  28. package/dist/utils/createCrossmintApiClient.js +1 -1
  29. package/dist/utils/eventEmitter.cjs +1 -0
  30. package/dist/utils/eventEmitter.d.cts +12 -0
  31. package/dist/utils/eventEmitter.d.ts +12 -0
  32. package/dist/utils/eventEmitter.js +1 -0
  33. package/package.json +10 -8
  34. package/dist/chunk-E67DZZ6I.js +0 -1
  35. package/dist/chunk-HZRRLBAX.cjs +0 -1
  36. package/dist/testUtils.cjs +0 -1
  37. package/dist/testUtils.d.cts +0 -4
  38. package/dist/testUtils.d.ts +0 -4
  39. package/dist/testUtils.js +0 -1
@@ -0,0 +1 @@
1
+ import t from"mitt";var i=t();export{i as a};
@@ -0,0 +1 @@
1
+ import{a as h}from"./chunk-Z2IVCF7R.js";import{a as p}from"./chunk-754ES3NA.js";import{c as f}from"./chunk-ACAYDFCT.js";import{a as y}from"./chunk-3MAEL2N6.js";import{a as d,b as m}from"./chunk-PXDN3KFO.js";import{useCrossmint as S}from"@crossmint/client-sdk-react-base";import{useEffect as b,useRef as l,useState as g}from"react";import{View as W}from"react-native";import{crossmintEmbeddedCheckoutV3Service as I}from"@crossmint/client-sdk-base";import{RNWebView as A,WebViewParent as M}from"@crossmint/client-sdk-rn-window";import{embeddedCheckoutV3IncomingEvents as O,embeddedCheckoutV3OutgoingEvents as R}from"@crossmint/client-sdk-base";import{jsx as c,jsxs as L}from"react/jsx-runtime";function Y(t){var u;let[e,w]=g(null),[C,v]=g(0),E=l((u=t.payment.crypto.payer)==null?void 0:u.initialChain),n=l(t);if(U(t,n.current)){let r=d({},t),o=F(t,E.current);o.shouldPreserve&&(r.payment.crypto.payer=o.updatedPayer),n.current=r}let{crossmint:i}=S(),V=p(i,{usageOrigin:"client"}),P=I({apiClient:V}),s=l(null);b(()=>{let r=s.current;if(!r||e)return;let o=new M({current:r},{incomingEvents:O,outgoingEvents:R});w(o)},[s.current,e]),b(()=>{if(e==null)return;let r=a=>v(a.height);e.on("ui:height.changed",r);let o=a=>{y.emit("order:updated",a)};return e.on("order:updated",o),()=>{e.off("ui:height.changed"),e.off("order:updated")}},[e]);let k=r=>{e&&e.handleMessage(r)};return L(W,{style:{flex:1},children:[c(A,{ref:s,globals:i.appId?{crossmintAppId:i.appId}:void 0,source:{uri:P.iframe.getUrl(n.current)},onMessage:k,style:{width:"100%",minWidth:"100%",height:C,backgroundColor:"transparent",overflow:"hidden",opacity:1,padding:0,boxShadow:"none",borderWidth:0,transform:[{translateX:0}]},allowsInlineMediaPlayback:!0,mediaPlaybackRequiresUserAction:!1,allowsBackForwardNavigationGestures:!1,allowsLinkPreview:!1,scrollEnabled:!1,bounces:!1,showsHorizontalScrollIndicator:!1,showsVerticalScrollIndicator:!1,domStorageEnabled:!0,mixedContentMode:"always",allowFileAccess:!0,allowUniversalAccessFromFileURLs:!0,geolocationEnabled:!0,userAgent:f}),n.current.payment.crypto.enabled?n.current.payment.crypto.payer!=null?c(h,{payer:n.current.payment.crypto.payer,webViewClient:e}):c(H,{message:"If 'payment.crypto.enabled' is true, 'payment.crypto.payer' must be provided. Support for not providing a payer is not yet implemented."}):null]})}function U(t,e){return JSON.stringify(t)!==JSON.stringify(e)}function F(t,e){return t.payment.crypto.payer&&e!=null?{shouldPreserve:!0,updatedPayer:m(d({},t.payment.crypto.payer),{initialChain:e})}:{shouldPreserve:!1}}function H({message:t}){throw new Error(t)}export{Y as a};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _commonsdkbase = require('@crossmint/common-sdk-base');var e={name:"@crossmint/client-sdk-react-native-ui",version:"0.9.1",repository:"https://github.com/Crossmint/crossmint-sdk",license:"Apache-2.0",author:"Paella Labs Inc",sideEffects:!1,type:"module",exports:{import:"./dist/index.js",require:"./dist/index.cjs"},main:"./dist/index.cjs",module:"./dist/index.js",types:"./dist/index.d.ts",files:["dist","LICENSE"],scripts:{build:"cross-env NODE_OPTIONS='--max-old-space-size=8192' tsup",dev:"cross-env NODE_OPTIONS='--max-old-space-size=8192' tsup --watch"},dependencies:{"@crossmint/client-sdk-auth":"workspace:*","@crossmint/client-sdk-base":"workspace:*","@crossmint/client-sdk-react-base":"workspace:*","@crossmint/client-sdk-rn-window":"workspace:*","@crossmint/client-signers":"workspace:*","@crossmint/common-sdk-auth":"workspace:*","@crossmint/common-sdk-base":"workspace:*","@crossmint/wallets-sdk":"workspace:*","@solana/web3.js":"1.98.0",bs58:"^5.0.0","expo-constants":"~17.0.8","expo-device":"~7.1.4","expo-secure-store":"~14.0.0","expo-web-browser":"~14.0.2","react-native-webview":"13.12.5"},devDependencies:{"@types/react":"19.0.12"},peerDependencies:{react:">=17.0.2","react-native":">=0.74.3"}};function p(s,t){return new (0, _commonsdkbase.CrossmintApiClient)(s,{internalConfig:{sdkMetadata:{name:"@crossmint/client-sdk-react-native-ui",version:e.version},apiKeyExpectations:t}})}exports.a = p;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _commonsdkbase = require('@crossmint/common-sdk-base');var e={name:"@crossmint/client-sdk-react-native-ui",version:"0.9.3",repository:"https://github.com/Crossmint/crossmint-sdk",license:"Apache-2.0",author:"Paella Labs Inc",sideEffects:!1,type:"module",exports:{import:"./dist/index.js",require:"./dist/index.cjs"},main:"./dist/index.cjs",module:"./dist/index.js",types:"./dist/index.d.ts",files:["dist","LICENSE"],scripts:{build:"cross-env NODE_OPTIONS='--max-old-space-size=8192' tsup",dev:"cross-env NODE_OPTIONS='--max-old-space-size=8192' tsup --watch"},dependencies:{"@crossmint/client-sdk-auth":"workspace:*","@crossmint/client-sdk-base":"workspace:*","@crossmint/client-sdk-react-base":"workspace:*","@crossmint/client-sdk-rn-window":"workspace:*","@crossmint/client-signers":"workspace:*","@crossmint/common-sdk-auth":"workspace:*","@crossmint/common-sdk-base":"workspace:*","@crossmint/wallets-sdk":"workspace:*","@solana/web3.js":"1.98.0",bs58:"^5.0.0","expo-constants":"~17.0.8","expo-device":"~7.1.4","expo-secure-store":"~14.0.0","expo-web-browser":"~14.0.2",mitt:"3.0.1","react-native-webview":"13.12.5",zod:"3.22.4"},devDependencies:{"@types/react":"19.0.12"},peerDependencies:{react:">=17.0.2","react-native":">=0.74.3"}};function p(s,t){return new (0, _commonsdkbase.CrossmintApiClient)(s,{internalConfig:{sdkMetadata:{name:"@crossmint/client-sdk-react-native-ui",version:e.version},apiKeyExpectations:t}})}exports.a = p;
@@ -1 +1 @@
1
- import{CrossmintApiClient as n}from"@crossmint/common-sdk-base";var e={name:"@crossmint/client-sdk-react-native-ui",version:"0.9.1",repository:"https://github.com/Crossmint/crossmint-sdk",license:"Apache-2.0",author:"Paella Labs Inc",sideEffects:!1,type:"module",exports:{import:"./dist/index.js",require:"./dist/index.cjs"},main:"./dist/index.cjs",module:"./dist/index.js",types:"./dist/index.d.ts",files:["dist","LICENSE"],scripts:{build:"cross-env NODE_OPTIONS='--max-old-space-size=8192' tsup",dev:"cross-env NODE_OPTIONS='--max-old-space-size=8192' tsup --watch"},dependencies:{"@crossmint/client-sdk-auth":"workspace:*","@crossmint/client-sdk-base":"workspace:*","@crossmint/client-sdk-react-base":"workspace:*","@crossmint/client-sdk-rn-window":"workspace:*","@crossmint/client-signers":"workspace:*","@crossmint/common-sdk-auth":"workspace:*","@crossmint/common-sdk-base":"workspace:*","@crossmint/wallets-sdk":"workspace:*","@solana/web3.js":"1.98.0",bs58:"^5.0.0","expo-constants":"~17.0.8","expo-device":"~7.1.4","expo-secure-store":"~14.0.0","expo-web-browser":"~14.0.2","react-native-webview":"13.12.5"},devDependencies:{"@types/react":"19.0.12"},peerDependencies:{react:">=17.0.2","react-native":">=0.74.3"}};function d(s,t){return new n(s,{internalConfig:{sdkMetadata:{name:"@crossmint/client-sdk-react-native-ui",version:e.version},apiKeyExpectations:t}})}export{d as a};
1
+ import{CrossmintApiClient as n}from"@crossmint/common-sdk-base";var e={name:"@crossmint/client-sdk-react-native-ui",version:"0.9.3",repository:"https://github.com/Crossmint/crossmint-sdk",license:"Apache-2.0",author:"Paella Labs Inc",sideEffects:!1,type:"module",exports:{import:"./dist/index.js",require:"./dist/index.cjs"},main:"./dist/index.cjs",module:"./dist/index.js",types:"./dist/index.d.ts",files:["dist","LICENSE"],scripts:{build:"cross-env NODE_OPTIONS='--max-old-space-size=8192' tsup",dev:"cross-env NODE_OPTIONS='--max-old-space-size=8192' tsup --watch"},dependencies:{"@crossmint/client-sdk-auth":"workspace:*","@crossmint/client-sdk-base":"workspace:*","@crossmint/client-sdk-react-base":"workspace:*","@crossmint/client-sdk-rn-window":"workspace:*","@crossmint/client-signers":"workspace:*","@crossmint/common-sdk-auth":"workspace:*","@crossmint/common-sdk-base":"workspace:*","@crossmint/wallets-sdk":"workspace:*","@solana/web3.js":"1.98.0",bs58:"^5.0.0","expo-constants":"~17.0.8","expo-device":"~7.1.4","expo-secure-store":"~14.0.0","expo-web-browser":"~14.0.2",mitt:"3.0.1","react-native-webview":"13.12.5",zod:"3.22.4"},devDependencies:{"@types/react":"19.0.12"},peerDependencies:{react:">=17.0.2","react-native":">=0.74.3"}};function d(s,t){return new n(s,{internalConfig:{sdkMetadata:{name:"@crossmint/client-sdk-react-native-ui",version:e.version},apiKeyExpectations:t}})}export{d as a};
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _mitt = require('mitt'); var _mitt2 = _interopRequireDefault(_mitt);var o=_mitt2.default.call(void 0, );exports.a = o;
@@ -1 +1 @@
1
- import{a as o}from"./chunk-E67DZZ6I.js";import{a as e}from"./chunk-PXDN3KFO.js";import{jsx as t}from"react/jsx-runtime";function i(d){return t(o,e({},d))}export{i as a};
1
+ import{a as o}from"./chunk-42ZZVPG3.js";import{a as e}from"./chunk-PXDN3KFO.js";import{jsx as t}from"react/jsx-runtime";function i(d){return t(o,e({},d))}export{i as a};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkHZRRLBAXcjs = require('./chunk-HZRRLBAX.cjs');var _chunk2WSEHVNPcjs = require('./chunk-2WSEHVNP.cjs');var _jsxruntime = require('react/jsx-runtime');function s(d){return _jsxruntime.jsx.call(void 0, _chunkHZRRLBAXcjs.a,_chunk2WSEHVNPcjs.a.call(void 0, {},d))}exports.a = s;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkHPOB3Q3Fcjs = require('./chunk-HPOB3Q3F.cjs');var _chunk2WSEHVNPcjs = require('./chunk-2WSEHVNP.cjs');var _jsxruntime = require('react/jsx-runtime');function s(d){return _jsxruntime.jsx.call(void 0, _chunkHPOB3Q3Fcjs.a,_chunk2WSEHVNPcjs.a.call(void 0, {},d))}exports.a = s;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkWUK4Q4HGcjs = require('./chunk-WUK4Q4HG.cjs');var _chunk5YGDF4J6cjs = require('./chunk-5YGDF4J6.cjs');var _chunkEML72AUFcjs = require('./chunk-EML72AUF.cjs');var _chunkATELCOA4cjs = require('./chunk-ATELCOA4.cjs');var _chunk2WSEHVNPcjs = require('./chunk-2WSEHVNP.cjs');var _clientsdkreactbase = require('@crossmint/client-sdk-react-base');var _react = require('react');var _reactnative = require('react-native');var _clientsdkbase = require('@crossmint/client-sdk-base');var _clientsdkrnwindow = require('@crossmint/client-sdk-rn-window');var _jsxruntime = require('react/jsx-runtime');function Q(t){var u;let[e,w]=_react.useState.call(void 0, null),[C,v]=_react.useState.call(void 0, 0),E=_react.useRef.call(void 0, (u=t.payment.crypto.payer)==null?void 0:u.initialChain),n=_react.useRef.call(void 0, t);if(U(t,n.current)){let r=_chunk2WSEHVNPcjs.a.call(void 0, {},t),o=F(t,E.current);o.shouldPreserve&&(r.payment.crypto.payer=o.updatedPayer),n.current=r}let{crossmint:i}=_clientsdkreactbase.useCrossmint.call(void 0, ),V=_chunk5YGDF4J6cjs.a.call(void 0, i,{usageOrigin:"client"}),P=_clientsdkbase.crossmintEmbeddedCheckoutV3Service.call(void 0, {apiClient:V}),s=_react.useRef.call(void 0, null);_react.useEffect.call(void 0, ()=>{let r=s.current;if(!r||e)return;let o=new (0, _clientsdkrnwindow.WebViewParent)({current:r},{incomingEvents:_clientsdkbase.embeddedCheckoutV3IncomingEvents,outgoingEvents:_clientsdkbase.embeddedCheckoutV3OutgoingEvents});w(o)},[s.current,e]),_react.useEffect.call(void 0, ()=>{if(e==null)return;let r=a=>v(a.height);e.on("ui:height.changed",r);let o=a=>{_chunkATELCOA4cjs.a.emit("order:updated",a)};return e.on("order:updated",o),()=>{e.off("ui:height.changed"),e.off("order:updated")}},[e]);let k=r=>{e&&e.handleMessage(r)};return _jsxruntime.jsxs.call(void 0, _reactnative.View,{style:{flex:1},children:[_jsxruntime.jsx.call(void 0, _clientsdkrnwindow.RNWebView,{ref:s,globals:i.appId?{crossmintAppId:i.appId}:void 0,source:{uri:P.iframe.getUrl(n.current)},onMessage:k,style:{width:"100%",minWidth:"100%",height:C,backgroundColor:"transparent",overflow:"hidden",opacity:1,padding:0,boxShadow:"none",borderWidth:0,transform:[{translateX:0}]},allowsInlineMediaPlayback:!0,mediaPlaybackRequiresUserAction:!1,allowsBackForwardNavigationGestures:!1,allowsLinkPreview:!1,scrollEnabled:!1,bounces:!1,showsHorizontalScrollIndicator:!1,showsVerticalScrollIndicator:!1,domStorageEnabled:!0,mixedContentMode:"always",allowFileAccess:!0,allowUniversalAccessFromFileURLs:!0,geolocationEnabled:!0,userAgent:_chunkEML72AUFcjs.c}),n.current.payment.crypto.enabled?n.current.payment.crypto.payer!=null?_jsxruntime.jsx.call(void 0, _chunkWUK4Q4HGcjs.a,{payer:n.current.payment.crypto.payer,webViewClient:e}):_jsxruntime.jsx.call(void 0, H,{message:"If 'payment.crypto.enabled' is true, 'payment.crypto.payer' must be provided. Support for not providing a payer is not yet implemented."}):null]})}function U(t,e){return JSON.stringify(t)!==JSON.stringify(e)}function F(t,e){return t.payment.crypto.payer&&e!=null?{shouldPreserve:!0,updatedPayer:_chunk2WSEHVNPcjs.b.call(void 0, _chunk2WSEHVNPcjs.a.call(void 0, {},t.payment.crypto.payer),{initialChain:e})}:{shouldPreserve:!1}}function H({message:t}){throw new Error(t)}exports.a = Q;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../../chunk-GMML4EMB.cjs');require('../../chunk-2VQLMU5A.cjs');var _chunk3B247CA6cjs = require('../../chunk-3B247CA6.cjs');require('../../chunk-HZRRLBAX.cjs');require('../../chunk-WUK4Q4HG.cjs');require('../../chunk-EML72AUF.cjs');require('../../chunk-BSVURJWU.cjs');require('../../chunk-2WSEHVNP.cjs');exports.CrossmintEmbeddedCheckout = _chunk3B247CA6cjs.a;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../../chunk-GMML4EMB.cjs');require('../../chunk-2VQLMU5A.cjs');var _chunkCLYPWR5Gcjs = require('../../chunk-CLYPWR5G.cjs');require('../../chunk-HPOB3Q3F.cjs');require('../../chunk-WUK4Q4HG.cjs');require('../../chunk-5YGDF4J6.cjs');require('../../chunk-EML72AUF.cjs');require('../../chunk-ATELCOA4.cjs');require('../../chunk-2WSEHVNP.cjs');exports.CrossmintEmbeddedCheckout = _chunkCLYPWR5Gcjs.a;
@@ -1 +1 @@
1
- import"../../chunk-DKQZSNOO.js";import"../../chunk-72MMCJ2E.js";import{a}from"../../chunk-NF4APVKJ.js";import"../../chunk-E67DZZ6I.js";import"../../chunk-Z2IVCF7R.js";import"../../chunk-ACAYDFCT.js";import"../../chunk-3TT23DR6.js";import"../../chunk-PXDN3KFO.js";export{a as CrossmintEmbeddedCheckout};
1
+ import"../../chunk-DKQZSNOO.js";import"../../chunk-72MMCJ2E.js";import{a}from"../../chunk-BCY3V6PF.js";import"../../chunk-42ZZVPG3.js";import"../../chunk-Z2IVCF7R.js";import"../../chunk-754ES3NA.js";import"../../chunk-ACAYDFCT.js";import"../../chunk-3MAEL2N6.js";import"../../chunk-PXDN3KFO.js";export{a as CrossmintEmbeddedCheckout};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk3B247CA6cjs = require('../../../chunk-3B247CA6.cjs');require('../../../chunk-HZRRLBAX.cjs');require('../../../chunk-WUK4Q4HG.cjs');require('../../../chunk-EML72AUF.cjs');require('../../../chunk-BSVURJWU.cjs');require('../../../chunk-2WSEHVNP.cjs');exports.CrossmintEmbeddedCheckout = _chunk3B247CA6cjs.a;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkCLYPWR5Gcjs = require('../../../chunk-CLYPWR5G.cjs');require('../../../chunk-HPOB3Q3F.cjs');require('../../../chunk-WUK4Q4HG.cjs');require('../../../chunk-5YGDF4J6.cjs');require('../../../chunk-EML72AUF.cjs');require('../../../chunk-ATELCOA4.cjs');require('../../../chunk-2WSEHVNP.cjs');exports.CrossmintEmbeddedCheckout = _chunkCLYPWR5Gcjs.a;
@@ -1 +1 @@
1
- import{a}from"../../../chunk-NF4APVKJ.js";import"../../../chunk-E67DZZ6I.js";import"../../../chunk-Z2IVCF7R.js";import"../../../chunk-ACAYDFCT.js";import"../../../chunk-3TT23DR6.js";import"../../../chunk-PXDN3KFO.js";export{a as CrossmintEmbeddedCheckout};
1
+ import{a}from"../../../chunk-BCY3V6PF.js";import"../../../chunk-42ZZVPG3.js";import"../../../chunk-Z2IVCF7R.js";import"../../../chunk-754ES3NA.js";import"../../../chunk-ACAYDFCT.js";import"../../../chunk-3MAEL2N6.js";import"../../../chunk-PXDN3KFO.js";export{a as CrossmintEmbeddedCheckout};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkHZRRLBAXcjs = require('../../../chunk-HZRRLBAX.cjs');require('../../../chunk-WUK4Q4HG.cjs');require('../../../chunk-EML72AUF.cjs');require('../../../chunk-BSVURJWU.cjs');require('../../../chunk-2WSEHVNP.cjs');exports.EmbeddedCheckoutV3WebView = _chunkHZRRLBAXcjs.a;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkHPOB3Q3Fcjs = require('../../../chunk-HPOB3Q3F.cjs');require('../../../chunk-WUK4Q4HG.cjs');require('../../../chunk-5YGDF4J6.cjs');require('../../../chunk-EML72AUF.cjs');require('../../../chunk-ATELCOA4.cjs');require('../../../chunk-2WSEHVNP.cjs');exports.EmbeddedCheckoutV3WebView = _chunkHPOB3Q3Fcjs.a;
@@ -1 +1 @@
1
- import{a}from"../../../chunk-E67DZZ6I.js";import"../../../chunk-Z2IVCF7R.js";import"../../../chunk-ACAYDFCT.js";import"../../../chunk-3TT23DR6.js";import"../../../chunk-PXDN3KFO.js";export{a as EmbeddedCheckoutV3WebView};
1
+ import{a}from"../../../chunk-42ZZVPG3.js";import"../../../chunk-Z2IVCF7R.js";import"../../../chunk-754ES3NA.js";import"../../../chunk-ACAYDFCT.js";import"../../../chunk-3MAEL2N6.js";import"../../../chunk-PXDN3KFO.js";export{a as EmbeddedCheckoutV3WebView};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../../../chunk-2VQLMU5A.cjs');var _chunk3B247CA6cjs = require('../../../chunk-3B247CA6.cjs');require('../../../chunk-HZRRLBAX.cjs');require('../../../chunk-WUK4Q4HG.cjs');require('../../../chunk-EML72AUF.cjs');require('../../../chunk-BSVURJWU.cjs');require('../../../chunk-2WSEHVNP.cjs');exports.CrossmintEmbeddedCheckout = _chunk3B247CA6cjs.a;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../../../chunk-2VQLMU5A.cjs');var _chunkCLYPWR5Gcjs = require('../../../chunk-CLYPWR5G.cjs');require('../../../chunk-HPOB3Q3F.cjs');require('../../../chunk-WUK4Q4HG.cjs');require('../../../chunk-5YGDF4J6.cjs');require('../../../chunk-EML72AUF.cjs');require('../../../chunk-ATELCOA4.cjs');require('../../../chunk-2WSEHVNP.cjs');exports.CrossmintEmbeddedCheckout = _chunkCLYPWR5Gcjs.a;
@@ -1 +1 @@
1
- import"../../../chunk-72MMCJ2E.js";import{a}from"../../../chunk-NF4APVKJ.js";import"../../../chunk-E67DZZ6I.js";import"../../../chunk-Z2IVCF7R.js";import"../../../chunk-ACAYDFCT.js";import"../../../chunk-3TT23DR6.js";import"../../../chunk-PXDN3KFO.js";export{a as CrossmintEmbeddedCheckout};
1
+ import"../../../chunk-72MMCJ2E.js";import{a}from"../../../chunk-BCY3V6PF.js";import"../../../chunk-42ZZVPG3.js";import"../../../chunk-Z2IVCF7R.js";import"../../../chunk-754ES3NA.js";import"../../../chunk-ACAYDFCT.js";import"../../../chunk-3MAEL2N6.js";import"../../../chunk-PXDN3KFO.js";export{a as CrossmintEmbeddedCheckout};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../chunk-XHW5MUJ6.cjs');require('../chunk-GMML4EMB.cjs');require('../chunk-2VQLMU5A.cjs');var _chunk3B247CA6cjs = require('../chunk-3B247CA6.cjs');require('../chunk-HZRRLBAX.cjs');require('../chunk-WUK4Q4HG.cjs');require('../chunk-EML72AUF.cjs');require('../chunk-BSVURJWU.cjs');require('../chunk-2WSEHVNP.cjs');exports.CrossmintEmbeddedCheckout = _chunk3B247CA6cjs.a;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../chunk-XHW5MUJ6.cjs');require('../chunk-GMML4EMB.cjs');require('../chunk-2VQLMU5A.cjs');var _chunkCLYPWR5Gcjs = require('../chunk-CLYPWR5G.cjs');require('../chunk-HPOB3Q3F.cjs');require('../chunk-WUK4Q4HG.cjs');require('../chunk-5YGDF4J6.cjs');require('../chunk-EML72AUF.cjs');require('../chunk-ATELCOA4.cjs');require('../chunk-2WSEHVNP.cjs');exports.CrossmintEmbeddedCheckout = _chunkCLYPWR5Gcjs.a;
@@ -1 +1 @@
1
- import"../chunk-4E5HWFBN.js";import"../chunk-DKQZSNOO.js";import"../chunk-72MMCJ2E.js";import{a}from"../chunk-NF4APVKJ.js";import"../chunk-E67DZZ6I.js";import"../chunk-Z2IVCF7R.js";import"../chunk-ACAYDFCT.js";import"../chunk-3TT23DR6.js";import"../chunk-PXDN3KFO.js";export{a as CrossmintEmbeddedCheckout};
1
+ import"../chunk-4E5HWFBN.js";import"../chunk-DKQZSNOO.js";import"../chunk-72MMCJ2E.js";import{a}from"../chunk-BCY3V6PF.js";import"../chunk-42ZZVPG3.js";import"../chunk-Z2IVCF7R.js";import"../chunk-754ES3NA.js";import"../chunk-ACAYDFCT.js";import"../chunk-3MAEL2N6.js";import"../chunk-PXDN3KFO.js";export{a as CrossmintEmbeddedCheckout};
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkATELCOA4cjs = require('../chunk-ATELCOA4.cjs');require('../chunk-2WSEHVNP.cjs');var _react = require('react');var _jsxruntime = require('react/jsx-runtime');var d=_react.createContext.call(void 0, void 0);function v({children:e}){let[i,s]=_react.useState.call(void 0, void 0),[c,u]=_react.useState.call(void 0, void 0);return _react.useEffect.call(void 0, ()=>{let r=o=>{s(o.order),u(o.orderClientSecret)};return _chunkATELCOA4cjs.a.on("order:updated",r),()=>{_chunkATELCOA4cjs.a.off("order:updated",r)}},[]),_jsxruntime.jsx.call(void 0, d.Provider,{value:{order:i,orderClientSecret:c},children:e})}function E(){let e=_react.useContext.call(void 0, d);if(!e)throw new Error("useCrossmintCheckout must be used within a CrossmintCheckoutProvider");return e}exports.CrossmintCheckoutProvider = v; exports.useCrossmintCheckout = E;
@@ -0,0 +1,14 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { ReactNode } from 'react';
3
+ import { Order } from '@crossmint/client-sdk-base';
4
+
5
+ interface CrossmintCheckoutContext {
6
+ order?: Order;
7
+ orderClientSecret?: string;
8
+ }
9
+ declare function CrossmintCheckoutProvider({ children }: {
10
+ children: ReactNode;
11
+ }): react_jsx_runtime.JSX.Element;
12
+ declare function useCrossmintCheckout(): CrossmintCheckoutContext;
13
+
14
+ export { type CrossmintCheckoutContext, CrossmintCheckoutProvider, useCrossmintCheckout };
@@ -0,0 +1,14 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { ReactNode } from 'react';
3
+ import { Order } from '@crossmint/client-sdk-base';
4
+
5
+ interface CrossmintCheckoutContext {
6
+ order?: Order;
7
+ orderClientSecret?: string;
8
+ }
9
+ declare function CrossmintCheckoutProvider({ children }: {
10
+ children: ReactNode;
11
+ }): react_jsx_runtime.JSX.Element;
12
+ declare function useCrossmintCheckout(): CrossmintCheckoutContext;
13
+
14
+ export { type CrossmintCheckoutContext, CrossmintCheckoutProvider, useCrossmintCheckout };
@@ -0,0 +1 @@
1
+ import{a as t}from"../chunk-3MAEL2N6.js";import"../chunk-PXDN3KFO.js";import{createContext as C,useContext as m,useEffect as f,useState as n}from"react";import{jsx as a}from"react/jsx-runtime";var d=C(void 0);function E({children:e}){let[i,s]=n(void 0),[c,u]=n(void 0);return f(()=>{let r=o=>{s(o.order),u(o.orderClientSecret)};return t.on("order:updated",r),()=>{t.off("order:updated",r)}},[]),a(d.Provider,{value:{order:i,orderClientSecret:c},children:e})}function k(){let e=m(d);if(!e)throw new Error("useCrossmintCheckout must be used within a CrossmintCheckoutProvider");return e}export{E as CrossmintCheckoutProvider,k as useCrossmintCheckout};
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});require('./chunk-ZR6BLDCD.cjs');var _chunkA25HRFHYcjs = require('./chunk-A25HRFHY.cjs');var _chunkYBYUZ7SKcjs = require('./chunk-YBYUZ7SK.cjs');require('./chunk-XHW5MUJ6.cjs');require('./chunk-GMML4EMB.cjs');require('./chunk-2VQLMU5A.cjs');var _chunk3B247CA6cjs = require('./chunk-3B247CA6.cjs');require('./chunk-HZRRLBAX.cjs');require('./chunk-WUK4Q4HG.cjs');require('./chunk-EML72AUF.cjs');var _chunkVM537MIDcjs = require('./chunk-VM537MID.cjs');require('./chunk-K754GXKD.cjs');require('./chunk-BSVURJWU.cjs');require('./chunk-2WSEHVNP.cjs');var _walletssdk = require('@crossmint/wallets-sdk');exports.CrossmintAuthProvider = _chunkA25HRFHYcjs.a; exports.CrossmintEmbeddedCheckout = _chunk3B247CA6cjs.a; exports.CrossmintProvider = _chunkYBYUZ7SKcjs.a; exports.CrossmintWalletProvider = _chunkVM537MIDcjs.f; exports.EVMWallet = _walletssdk.EVMWallet; exports.SolanaWallet = _walletssdk.SolanaWallet; exports.Wallet = _walletssdk.Wallet; exports.useAuth = _chunkVM537MIDcjs.d; exports.useCrossmint = _chunkVM537MIDcjs.h; exports.useCrossmintAuth = _chunkVM537MIDcjs.c; exports.useWallet = _chunkVM537MIDcjs.i; exports.useWalletEmailSigner = _chunkVM537MIDcjs.g;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});require('./chunk-ZR6BLDCD.cjs');var _chunkYBYUZ7SKcjs = require('./chunk-YBYUZ7SK.cjs');require('./chunk-XHW5MUJ6.cjs');require('./chunk-GMML4EMB.cjs');require('./chunk-2VQLMU5A.cjs');var _chunkCLYPWR5Gcjs = require('./chunk-CLYPWR5G.cjs');require('./chunk-HPOB3Q3F.cjs');require('./chunk-WUK4Q4HG.cjs');require('./chunk-5YGDF4J6.cjs');require('./chunk-EML72AUF.cjs');require('./chunk-ATELCOA4.cjs');var _chunkA25HRFHYcjs = require('./chunk-A25HRFHY.cjs');var _chunkVM537MIDcjs = require('./chunk-VM537MID.cjs');require('./chunk-K754GXKD.cjs');require('./chunk-2WSEHVNP.cjs');var _walletssdk = require('@crossmint/wallets-sdk');exports.CrossmintAuthProvider = _chunkA25HRFHYcjs.a; exports.CrossmintEmbeddedCheckout = _chunkCLYPWR5Gcjs.a; exports.CrossmintProvider = _chunkYBYUZ7SKcjs.a; exports.CrossmintWalletProvider = _chunkVM537MIDcjs.f; exports.EVMWallet = _walletssdk.EVMWallet; exports.SolanaWallet = _walletssdk.SolanaWallet; exports.Wallet = _walletssdk.Wallet; exports.useAuth = _chunkVM537MIDcjs.d; exports.useCrossmint = _chunkVM537MIDcjs.h; exports.useCrossmintAuth = _chunkVM537MIDcjs.c; exports.useWallet = _chunkVM537MIDcjs.i; exports.useWalletEmailSigner = _chunkVM537MIDcjs.g;
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- import"./chunk-C62HRWJA.js";import{a as s}from"./chunk-QLLHMYXA.js";import{a as p}from"./chunk-ZENPJSBN.js";import"./chunk-4E5HWFBN.js";import"./chunk-DKQZSNOO.js";import"./chunk-72MMCJ2E.js";import{a as m}from"./chunk-NF4APVKJ.js";import"./chunk-E67DZZ6I.js";import"./chunk-Z2IVCF7R.js";import"./chunk-ACAYDFCT.js";import{c as t,d as e,f as r,g as o,h as a,i as n}from"./chunk-BAJCJQCD.js";import"./chunk-GDMV4TA2.js";import"./chunk-3TT23DR6.js";import"./chunk-PXDN3KFO.js";import{EVMWallet as E,SolanaWallet as h,Wallet as C}from"@crossmint/wallets-sdk";export{s as CrossmintAuthProvider,m as CrossmintEmbeddedCheckout,p as CrossmintProvider,r as CrossmintWalletProvider,E as EVMWallet,h as SolanaWallet,C as Wallet,e as useAuth,a as useCrossmint,t as useCrossmintAuth,n as useWallet,o as useWalletEmailSigner};
1
+ import"./chunk-C62HRWJA.js";import{a as p}from"./chunk-ZENPJSBN.js";import"./chunk-4E5HWFBN.js";import"./chunk-DKQZSNOO.js";import"./chunk-72MMCJ2E.js";import{a as m}from"./chunk-BCY3V6PF.js";import"./chunk-42ZZVPG3.js";import"./chunk-Z2IVCF7R.js";import"./chunk-754ES3NA.js";import"./chunk-ACAYDFCT.js";import"./chunk-3MAEL2N6.js";import{a as s}from"./chunk-QLLHMYXA.js";import{c as t,d as e,f as r,g as o,h as a,i as n}from"./chunk-BAJCJQCD.js";import"./chunk-GDMV4TA2.js";import"./chunk-PXDN3KFO.js";import{EVMWallet as E,SolanaWallet as h,Wallet as C}from"@crossmint/wallets-sdk";export{s as CrossmintAuthProvider,m as CrossmintEmbeddedCheckout,p as CrossmintProvider,r as CrossmintWalletProvider,E as EVMWallet,h as SolanaWallet,C as Wallet,e as useAuth,a as useCrossmint,t as useCrossmintAuth,n as useWallet,o as useWalletEmailSigner};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../chunk-ZR6BLDCD.cjs');var _chunkA25HRFHYcjs = require('../chunk-A25HRFHY.cjs');var _chunkYBYUZ7SKcjs = require('../chunk-YBYUZ7SK.cjs');var _chunkVM537MIDcjs = require('../chunk-VM537MID.cjs');require('../chunk-K754GXKD.cjs');require('../chunk-2WSEHVNP.cjs');exports.CrossmintAuthProvider = _chunkA25HRFHYcjs.a; exports.CrossmintProvider = _chunkYBYUZ7SKcjs.a; exports.CrossmintWalletProvider = _chunkVM537MIDcjs.f;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../chunk-ZR6BLDCD.cjs');var _chunkYBYUZ7SKcjs = require('../chunk-YBYUZ7SK.cjs');var _chunkA25HRFHYcjs = require('../chunk-A25HRFHY.cjs');var _chunkVM537MIDcjs = require('../chunk-VM537MID.cjs');require('../chunk-K754GXKD.cjs');require('../chunk-2WSEHVNP.cjs');exports.CrossmintAuthProvider = _chunkA25HRFHYcjs.a; exports.CrossmintProvider = _chunkYBYUZ7SKcjs.a; exports.CrossmintWalletProvider = _chunkVM537MIDcjs.f;
@@ -1 +1 @@
1
- import"../chunk-C62HRWJA.js";import{a as c}from"../chunk-QLLHMYXA.js";import{a as b}from"../chunk-ZENPJSBN.js";import{f as a}from"../chunk-BAJCJQCD.js";import"../chunk-GDMV4TA2.js";import"../chunk-PXDN3KFO.js";export{c as CrossmintAuthProvider,b as CrossmintProvider,a as CrossmintWalletProvider};
1
+ import"../chunk-C62HRWJA.js";import{a as b}from"../chunk-ZENPJSBN.js";import{a as c}from"../chunk-QLLHMYXA.js";import{f as a}from"../chunk-BAJCJQCD.js";import"../chunk-GDMV4TA2.js";import"../chunk-PXDN3KFO.js";export{c as CrossmintAuthProvider,b as CrossmintProvider,a as CrossmintWalletProvider};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkBSVURJWUcjs = require('../chunk-BSVURJWU.cjs');require('../chunk-2WSEHVNP.cjs');exports.createCrossmintApiClient = _chunkBSVURJWUcjs.a;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk5YGDF4J6cjs = require('../chunk-5YGDF4J6.cjs');require('../chunk-2WSEHVNP.cjs');exports.createCrossmintApiClient = _chunk5YGDF4J6cjs.a;
@@ -1 +1 @@
1
- import{a}from"../chunk-3TT23DR6.js";import"../chunk-PXDN3KFO.js";export{a as createCrossmintApiClient};
1
+ import{a}from"../chunk-754ES3NA.js";import"../chunk-PXDN3KFO.js";export{a as createCrossmintApiClient};
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkATELCOA4cjs = require('../chunk-ATELCOA4.cjs');require('../chunk-2WSEHVNP.cjs');exports.localEventEmitter = _chunkATELCOA4cjs.a;
@@ -0,0 +1,12 @@
1
+ import * as mitt from 'mitt';
2
+ import { Order } from '@crossmint/client-sdk-base';
3
+
4
+ type LocalEventEmitterEvents = {
5
+ "order:updated": {
6
+ order?: Order;
7
+ orderClientSecret?: string;
8
+ };
9
+ };
10
+ declare const localEventEmitter: mitt.Emitter<LocalEventEmitterEvents>;
11
+
12
+ export { type LocalEventEmitterEvents, localEventEmitter };
@@ -0,0 +1,12 @@
1
+ import * as mitt from 'mitt';
2
+ import { Order } from '@crossmint/client-sdk-base';
3
+
4
+ type LocalEventEmitterEvents = {
5
+ "order:updated": {
6
+ order?: Order;
7
+ orderClientSecret?: string;
8
+ };
9
+ };
10
+ declare const localEventEmitter: mitt.Emitter<LocalEventEmitterEvents>;
11
+
12
+ export { type LocalEventEmitterEvents, localEventEmitter };
@@ -0,0 +1 @@
1
+ import{a}from"../chunk-3MAEL2N6.js";import"../chunk-PXDN3KFO.js";export{a as localEventEmitter};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crossmint/client-sdk-react-native-ui",
3
- "version": "0.9.1",
3
+ "version": "0.9.3",
4
4
  "repository": "https://github.com/Crossmint/crossmint-sdk",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Paella Labs Inc",
@@ -24,15 +24,17 @@
24
24
  "expo-device": "~7.1.4",
25
25
  "expo-secure-store": "~14.0.0",
26
26
  "expo-web-browser": "~14.0.2",
27
+ "mitt": "3.0.1",
27
28
  "react-native-webview": "13.12.5",
28
- "@crossmint/client-sdk-base": "1.5.13",
29
- "@crossmint/client-sdk-react-base": "0.5.16",
30
- "@crossmint/client-sdk-rn-window": "0.3.3",
29
+ "zod": "3.22.4",
30
+ "@crossmint/client-sdk-auth": "1.2.24",
31
+ "@crossmint/client-sdk-base": "1.5.15",
32
+ "@crossmint/client-sdk-react-base": "0.5.18",
33
+ "@crossmint/client-sdk-rn-window": "0.3.4",
31
34
  "@crossmint/client-signers": "0.0.18",
32
- "@crossmint/common-sdk-auth": "1.0.44",
33
- "@crossmint/common-sdk-base": "0.8.5",
34
- "@crossmint/wallets-sdk": "0.10.16",
35
- "@crossmint/client-sdk-auth": "1.2.22"
35
+ "@crossmint/common-sdk-auth": "1.0.46",
36
+ "@crossmint/common-sdk-base": "0.9.0",
37
+ "@crossmint/wallets-sdk": "0.11.0"
36
38
  },
37
39
  "devDependencies": {
38
40
  "@types/react": "19.0.12"
@@ -1 +0,0 @@
1
- import{a as h}from"./chunk-Z2IVCF7R.js";import{c as p}from"./chunk-ACAYDFCT.js";import{a as m}from"./chunk-3TT23DR6.js";import{a,b as u}from"./chunk-PXDN3KFO.js";import{useCrossmint as E}from"@crossmint/client-sdk-react-base";import{useEffect as f,useRef as d,useState as y}from"react";import{View as k}from"react-native";import{crossmintEmbeddedCheckoutV3Service as S}from"@crossmint/client-sdk-base";import{RNWebView as W,WebViewParent as I}from"@crossmint/client-sdk-rn-window";import{embeddedCheckoutV3IncomingEvents as A,embeddedCheckoutV3OutgoingEvents as M}from"@crossmint/client-sdk-base";import{jsx as c,jsxs as H}from"react/jsx-runtime";function D(t){var l;let[e,b]=y(null),[g,w]=y(0),C=d((l=t.payment.crypto.payer)==null?void 0:l.initialChain),n=d(t);if(R(t,n.current)){let r=a({},t),o=O(t,C.current);o.shouldPreserve&&(r.payment.crypto.payer=o.updatedPayer),n.current=r}let{crossmint:i}=E(),V=m(i,{usageOrigin:"client"}),v=S({apiClient:V}),s=d(null);f(()=>{let r=s.current;if(!r||e)return;let o=new I({current:r},{incomingEvents:A,outgoingEvents:M});b(o)},[s.current,e]),f(()=>{if(e==null)return;let r=o=>w(o.height);return e.on("ui:height.changed",r),()=>{e.off("ui:height.changed")}},[e]);let P=r=>{e&&e.handleMessage(r)};return H(k,{style:{flex:1},children:[c(W,{ref:s,globals:i.appId?{crossmintAppId:i.appId}:void 0,source:{uri:v.iframe.getUrl(n.current)},onMessage:P,style:{width:"100%",minWidth:"100%",height:g,backgroundColor:"transparent",overflow:"hidden",opacity:1,padding:0,boxShadow:"none",borderWidth:0,transform:[{translateX:0}]},allowsInlineMediaPlayback:!0,mediaPlaybackRequiresUserAction:!1,allowsBackForwardNavigationGestures:!1,allowsLinkPreview:!1,scrollEnabled:!1,bounces:!1,showsHorizontalScrollIndicator:!1,showsVerticalScrollIndicator:!1,domStorageEnabled:!0,mixedContentMode:"always",allowFileAccess:!0,allowUniversalAccessFromFileURLs:!0,geolocationEnabled:!0,userAgent:p}),n.current.payment.crypto.enabled?n.current.payment.crypto.payer!=null?c(h,{payer:n.current.payment.crypto.payer,webViewClient:e}):c(F,{message:"If 'payment.crypto.enabled' is true, 'payment.crypto.payer' must be provided. Support for not providing a payer is not yet implemented."}):null]})}function R(t,e){return JSON.stringify(t)!==JSON.stringify(e)}function O(t,e){return t.payment.crypto.payer&&e!=null?{shouldPreserve:!0,updatedPayer:u(a({},t.payment.crypto.payer),{initialChain:e})}:{shouldPreserve:!1}}function F({message:t}){throw new Error(t)}export{D as a};
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkWUK4Q4HGcjs = require('./chunk-WUK4Q4HG.cjs');var _chunkEML72AUFcjs = require('./chunk-EML72AUF.cjs');var _chunkBSVURJWUcjs = require('./chunk-BSVURJWU.cjs');var _chunk2WSEHVNPcjs = require('./chunk-2WSEHVNP.cjs');var _clientsdkreactbase = require('@crossmint/client-sdk-react-base');var _react = require('react');var _reactnative = require('react-native');var _clientsdkbase = require('@crossmint/client-sdk-base');var _clientsdkrnwindow = require('@crossmint/client-sdk-rn-window');var _jsxruntime = require('react/jsx-runtime');function X(t){var l;let[e,b]=_react.useState.call(void 0, null),[g,w]=_react.useState.call(void 0, 0),C=_react.useRef.call(void 0, (l=t.payment.crypto.payer)==null?void 0:l.initialChain),n=_react.useRef.call(void 0, t);if(R(t,n.current)){let r=_chunk2WSEHVNPcjs.a.call(void 0, {},t),o=O(t,C.current);o.shouldPreserve&&(r.payment.crypto.payer=o.updatedPayer),n.current=r}let{crossmint:i}=_clientsdkreactbase.useCrossmint.call(void 0, ),V=_chunkBSVURJWUcjs.a.call(void 0, i,{usageOrigin:"client"}),v=_clientsdkbase.crossmintEmbeddedCheckoutV3Service.call(void 0, {apiClient:V}),s=_react.useRef.call(void 0, null);_react.useEffect.call(void 0, ()=>{let r=s.current;if(!r||e)return;let o=new (0, _clientsdkrnwindow.WebViewParent)({current:r},{incomingEvents:_clientsdkbase.embeddedCheckoutV3IncomingEvents,outgoingEvents:_clientsdkbase.embeddedCheckoutV3OutgoingEvents});b(o)},[s.current,e]),_react.useEffect.call(void 0, ()=>{if(e==null)return;let r=o=>w(o.height);return e.on("ui:height.changed",r),()=>{e.off("ui:height.changed")}},[e]);let P=r=>{e&&e.handleMessage(r)};return _jsxruntime.jsxs.call(void 0, _reactnative.View,{style:{flex:1},children:[_jsxruntime.jsx.call(void 0, _clientsdkrnwindow.RNWebView,{ref:s,globals:i.appId?{crossmintAppId:i.appId}:void 0,source:{uri:v.iframe.getUrl(n.current)},onMessage:P,style:{width:"100%",minWidth:"100%",height:g,backgroundColor:"transparent",overflow:"hidden",opacity:1,padding:0,boxShadow:"none",borderWidth:0,transform:[{translateX:0}]},allowsInlineMediaPlayback:!0,mediaPlaybackRequiresUserAction:!1,allowsBackForwardNavigationGestures:!1,allowsLinkPreview:!1,scrollEnabled:!1,bounces:!1,showsHorizontalScrollIndicator:!1,showsVerticalScrollIndicator:!1,domStorageEnabled:!0,mixedContentMode:"always",allowFileAccess:!0,allowUniversalAccessFromFileURLs:!0,geolocationEnabled:!0,userAgent:_chunkEML72AUFcjs.c}),n.current.payment.crypto.enabled?n.current.payment.crypto.payer!=null?_jsxruntime.jsx.call(void 0, _chunkWUK4Q4HGcjs.a,{payer:n.current.payment.crypto.payer,webViewClient:e}):_jsxruntime.jsx.call(void 0, F,{message:"If 'payment.crypto.enabled' is true, 'payment.crypto.payer' must be provided. Support for not providing a payer is not yet implemented."}):null]})}function R(t,e){return JSON.stringify(t)!==JSON.stringify(e)}function O(t,e){return t.payment.crypto.payer&&e!=null?{shouldPreserve:!0,updatedPayer:_chunk2WSEHVNPcjs.b.call(void 0, _chunk2WSEHVNPcjs.a.call(void 0, {},t.payment.crypto.payer),{initialChain:e})}:{shouldPreserve:!1}}function F({message:t}){throw new Error(t)}exports.a = X;
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});require('./chunk-2WSEHVNP.cjs');var _="sk_development_12341234",e= exports.MOCK_APP_ID ="com.app.id";exports.MOCK_API_KEY = _; exports.MOCK_APP_ID = e;
@@ -1,4 +0,0 @@
1
- declare const MOCK_API_KEY = "sk_development_12341234";
2
- declare const MOCK_APP_ID = "com.app.id";
3
-
4
- export { MOCK_API_KEY, MOCK_APP_ID };
@@ -1,4 +0,0 @@
1
- declare const MOCK_API_KEY = "sk_development_12341234";
2
- declare const MOCK_APP_ID = "com.app.id";
3
-
4
- export { MOCK_API_KEY, MOCK_APP_ID };
package/dist/testUtils.js DELETED
@@ -1 +0,0 @@
1
- import"./chunk-PXDN3KFO.js";var e="sk_development_12341234",p="com.app.id";export{e as MOCK_API_KEY,p as MOCK_APP_ID};