@crossmint/client-sdk-react-ui 0.1.8-alpha.0 → 0.2.1-alpha.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 +5 -1
- package/lib/index.cjs +1 -1
- package/lib/index.js +1 -1
- package/package.json +3 -3
- package/src/CrossmintPayButton.tsx +5 -18
- package/src/CrossmintStatusButton.tsx +1 -1
- package/src/version.ts +1 -1
package/README.md
CHANGED
|
@@ -20,4 +20,8 @@ The next steps depend on which chain you're using for your project. For detailed
|
|
|
20
20
|
|
|
21
21
|
Version 0.1.0 introduces breaking changes. To learn how to migrate from a version lower than 0.1.0, [check out the migration guide](https://docs.google.com/document/d/14IKpjrij7kU7Dr0I7rZkf0PyDNbXiklx2v4GuzUrFbw/edit?usp=sharing).
|
|
22
22
|
|
|
23
|
-
## [Changelog](https://docs.google.com/document/d/e/2PACX-1vR5NzVS2msrCMZxlcfBgAT-Y8kAypeKqH_WBeNiwVTmyEzLZvJBWrKrz_966-d3jumwIBi94IXGT6Wp/pub)
|
|
23
|
+
## [Changelog](https://docs.google.com/document/d/e/2PACX-1vR5NzVS2msrCMZxlcfBgAT-Y8kAypeKqH_WBeNiwVTmyEzLZvJBWrKrz_966-d3jumwIBi94IXGT6Wp/pub)
|
|
24
|
+
|
|
25
|
+
## Migration guide to 0.2.X versions
|
|
26
|
+
|
|
27
|
+
Version 0.2.0 introduces breaking changes. To learn how to migrate from a version lower than 0.2.0, [check out the migration guide](https://docs.google.com/document/d/1mA0W-iAs0nHHW0ANX0TfZ5qrzxPGxNchPj13W6cHc-Y/edit?usp=sharing).
|
package/lib/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var rt=Object.create;var f=Object.defineProperty;var it=Object.getOwnPropertyDescriptor;var at=Object.getOwnPropertyNames,x=Object.getOwnPropertySymbols,ct=Object.getPrototypeOf,A=Object.prototype.hasOwnProperty,q=Object.prototype.propertyIsEnumerable;var G=(t,s,o)=>s in t?f(t,s,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[s]=o,p=(t,s)=>{for(var o in s||(s={}))A.call(s,o)&&G(t,o,s[o]);if(x)for(var o of x(s))q.call(s,o)&&G(t,o,s[o]);return t};var N=(t,s)=>{var o={};for(var e in t)A.call(t,e)&&s.indexOf(e)<0&&(o[e]=t[e]);if(t!=null&&x)for(var e of x(t))s.indexOf(e)<0&&q.call(t,e)&&(o[e]=t[e]);return o};var mt=(t,s)=>{for(var o in s)f(t,o,{get:s[o],enumerable:!0})},W=(t,s,o,e)=>{if(s&&typeof s=="object"||typeof s=="function")for(let c of at(s))!A.call(t,c)&&c!==o&&f(t,c,{get:()=>s[c],enumerable:!(e=it(s,c))||e.enumerable});return t};var j=(t,s,o)=>(o=t!=null?rt(ct(t)):{},W(s||!t||!t.__esModule?f(o,"default",{value:t,enumerable:!0}):o,t)),lt=t=>W(f({},"__esModule",{value:!0}),t);var St={};mt(St,{CrossmintPayButton:()=>gt,CrossmintStatusButton:()=>ft});module.exports=lt(St);var i=j(require("react"),1),F=require("react"),n=require("@crossmint/client-sdk-base");var Y=require("react-jss"),ut="#1e1e1e",K=t=>t==="light",P=t=>({buttonBgColor:K(t)?"white":ut,paragraphColor:K(t)?"black":"white"}),E=(0,Y.createUseStyles)({"@global":{"@import":"url('https://fonts.googleapis.com/css2?family=Inter:wght@100;200;300;400;500;600;700;800;900&display=swap')"},crossmintButton:{display:"flex","flex-direction":"row","align-items":"center",padding:"0.875rem 0.875rem","font-weight":"900",transition:"opacity ease-in-out 0.25s","border-radius":"0.5rem","font-family":'"Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif',outline:"none",border:"none","box-shadow":"0px 8px 15px rgba(0, 0, 0, 0.1)","justify-content":"center",background:({buttonBgColor:t})=>t,"&:hover:enabled":{opacity:"0.6",cursor:"pointer"}},crossmintImg:{width:"21px",height:"21px","margin-right":"0.875rem"},crossmintParagraph:{color:({paragraphColor:t})=>t,margin:"0"}});var k=require("react");function d(){let[t,s]=(0,k.useState)(!0);return(0,k.useEffect)(()=>{s(!1)},[]),{isServerSideRendering:t}}var C="0.2.1-alpha.0";var pt={type:n.mintingContractTypes.CANDY_MACHINE},gt=D=>{var v=D,{className:t,disabled:s,onClick:o,style:e,tabIndex:c,theme:M="dark",mintTo:w,emailTo:R,listingId:U,clientId:b,auctionId:_,hideMintOnInactiveClient:I=!1,showOverlay:$=!0,mintConfig:g=pt,whPassThroughArgs:l,environment:h,paymentMethod:y,preferredSigninMethod:T,dismissOverlayOnClick:B,prepay:H}=v,O=N(v,["className","disabled","onClick","style","tabIndex","theme","mintTo","emailTo","listingId","clientId","auctionId","hideMintOnInactiveClient","showOverlay","mintConfig","whPassThroughArgs","environment","paymentMethod","preferredSigninMethod","dismissOverlayOnClick","prepay"]);let[m,L]=(0,F.useState)(!1),[u,z]=(0,F.useState)(n.onboardingRequestStatusResponse.WAITING_SUBMISSION),{isServerSideRendering:J}=d(),{fetchClientIntegration:Q}=(0,n.crossmintStatusService)({libVersion:C,clientId:b,environment:h,auctionId:_,mintConfig:g,setStatus:z,clientName:n.clientNames.reactUi}),{connect:X}=(0,n.crossmintModalService)({clientId:b,showOverlay:$,dismissOverlayOnClick:B,setConnecting:L,libVersion:C,environment:h,clientName:n.clientNames.reactUi}),{getButtonText:Z,shouldHideButton:tt,handleClick:st}=(0,n.crossmintPayButtonService)({onClick:o,connecting:m,paymentMethod:y});(0,i.useEffect)(()=>{I&&Q()},[u]);let ot=nt=>st(nt,()=>{X(g,w,R,U,l,y,T,H)}),V=E(P(M)),et=(0,i.useMemo)(()=>i.default.createElement("span",{className:V.crossmintParagraph,role:"button-paragraph"},Z(m)),[m]);return tt({hideMintOnInactiveClient:I,status:u})?null:i.default.createElement(i.default.Fragment,null,!J&&i.default.createElement("button",p({className:`${V.crossmintButton} ${t||""}`,disabled:s,onClick:ot,style:p({},e),tabIndex:c},O),i.default.createElement("img",{className:V.crossmintImg,src:"https://www.crossmint.io/assets/crossmint/logo.svg",alt:"Crossmint logo"}),et))};var r=j(require("react"),1),a=require("@crossmint/client-sdk-base");var ft=$=>{var g=$,{className:t,disabled:s,onClick:o,style:e,tabIndex:c,theme:M="dark",clientId:w,auctionId:R,platformId:U,mintConfig:b,environment:_}=g,I=N(g,["className","disabled","onClick","style","tabIndex","theme","clientId","auctionId","platformId","mintConfig","environment"]);let[l,h]=(0,r.useState)(a.onboardingRequestStatusResponse.WAITING_SUBMISSION),{isServerSideRendering:y}=d(),{goToOnboarding:T,fetchClientIntegration:B}=(0,a.crossmintStatusService)({libVersion:C,clientId:w,environment:_,platformId:U,auctionId:R,mintConfig:b,setStatus:h,clientName:a.clientNames.reactUi}),{getButtonText:H,isButtonDisabled:O,handleClick:D}=(0,a.crossmintStatusButtonService)({onClick:o}),v=u=>D(u,l,T);(0,r.useEffect)(()=>{B();let u=setInterval(()=>{B()},60*1e3);return()=>clearInterval(u)},[]);let m=E(P(M)),L=(0,r.useMemo)(()=>r.default.createElement("span",{className:m.crossmintParagraph},H(l)),[l]);return r.default.createElement(r.default.Fragment,null,!y&&r.default.createElement("button",p({className:`${m.crossmintButton} ${t||""}`,disabled:O(l),onClick:v,style:p({},e),tabIndex:c},I),r.default.createElement("img",{className:m.crossmintImg,src:`${a.baseUrls.prod}/assets/crossmint/logo.svg`,alt:"Crossmint logo"}),L))};0&&(module.exports={CrossmintPayButton,CrossmintStatusButton});
|
package/lib/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var tt=Object.defineProperty;var y=Object.getOwnPropertySymbols;var A=Object.prototype.hasOwnProperty,F=Object.prototype.propertyIsEnumerable;var V=(t,s,o)=>s in t?tt(t,s,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[s]=o,a=(t,s)=>{for(var o in s||(s={}))A.call(s,o)&&V(t,o,s[o]);if(y)for(var o of y(s))F.call(s,o)&&V(t,o,s[o]);return t};var B=(t,s)=>{var o={};for(var e in t)A.call(t,e)&&s.indexOf(e)<0&&(o[e]=t[e]);if(t!=null&&y)for(var e of y(t))s.indexOf(e)<0&&F.call(t,e)&&(o[e]=t[e]);return o};import g,{useEffect as rt,useMemo as it}from"react";import{useState as D}from"react";import{clientNames as G,crossmintModalService as at,crossmintPayButtonService as ct,crossmintStatusService as mt,mintingContractTypes as lt,onboardingRequestStatusResponse as ut}from"@crossmint/client-sdk-base";import{createUseStyles as st}from"react-jss";var ot="#1e1e1e",$=t=>t==="light",v=t=>({buttonBgColor:$(t)?"white":ot,paragraphColor:$(t)?"black":"white"}),x=st({"@global":{"@import":"url('https://fonts.googleapis.com/css2?family=Inter:wght@100;200;300;400;500;600;700;800;900&display=swap')"},crossmintButton:{display:"flex","flex-direction":"row","align-items":"center",padding:"0.875rem 0.875rem","font-weight":"900",transition:"opacity ease-in-out 0.25s","border-radius":"0.5rem","font-family":'"Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif',outline:"none",border:"none","box-shadow":"0px 8px 15px rgba(0, 0, 0, 0.1)","justify-content":"center",background:({buttonBgColor:t})=>t,"&:hover:enabled":{opacity:"0.6",cursor:"pointer"}},crossmintImg:{width:"21px",height:"21px","margin-right":"0.875rem"},crossmintParagraph:{color:({paragraphColor:t})=>t,margin:"0"}});import{useEffect as et,useState as nt}from"react";function u(){let[t,s]=nt(!0);return et(()=>{s(!1)},[]),{isServerSideRendering:t}}var p="0.2.1-alpha.0";var pt={type:lt.CANDY_MACHINE},Ht=L=>{var h=L,{className:t,disabled:s,onClick:o,style:e,tabIndex:N,theme:P="dark",mintTo:E,emailTo:k,listingId:M,clientId:S,auctionId:w,hideMintOnInactiveClient:d=!1,showOverlay:O=!0,mintConfig:c=pt,whPassThroughArgs:r,environment:C,paymentMethod:b,preferredSigninMethod:R,dismissOverlayOnClick:I,prepay:U}=h,_=B(h,["className","disabled","onClick","style","tabIndex","theme","mintTo","emailTo","listingId","clientId","auctionId","hideMintOnInactiveClient","showOverlay","mintConfig","whPassThroughArgs","environment","paymentMethod","preferredSigninMethod","dismissOverlayOnClick","prepay"]);let[n,T]=D(!1),[i,q]=D(ut.WAITING_SUBMISSION),{isServerSideRendering:W}=u(),{fetchClientIntegration:j}=mt({libVersion:p,clientId:S,environment:C,auctionId:w,mintConfig:c,setStatus:q,clientName:G.reactUi}),{connect:K}=at({clientId:S,showOverlay:O,dismissOverlayOnClick:I,setConnecting:T,libVersion:p,environment:C,clientName:G.reactUi}),{getButtonText:Y,shouldHideButton:z,handleClick:J}=ct({onClick:o,connecting:n,paymentMethod:b});rt(()=>{d&&j()},[i]);let Q=Z=>J(Z,()=>{K(c,E,k,M,r,b,R,U)}),H=x(v(P)),X=it(()=>g.createElement("span",{className:H.crossmintParagraph,role:"button-paragraph"},Y(n)),[n]);return z({hideMintOnInactiveClient:d,status:i})?null:g.createElement(g.Fragment,null,!W&&g.createElement("button",a({className:`${H.crossmintButton} ${t||""}`,disabled:s,onClick:Q,style:a({},e),tabIndex:N},_),g.createElement("img",{className:H.crossmintImg,src:"https://www.crossmint.io/assets/crossmint/logo.svg",alt:"Crossmint logo"}),X))};import f,{useEffect as gt,useMemo as ft,useState as St}from"react";import{baseUrls as dt,clientNames as Ct,crossmintStatusButtonService as bt,crossmintStatusService as It,onboardingRequestStatusResponse as ht}from"@crossmint/client-sdk-base";var Wt=O=>{var c=O,{className:t,disabled:s,onClick:o,style:e,tabIndex:N,theme:P="dark",clientId:E,auctionId:k,platformId:M,mintConfig:S,environment:w}=c,d=B(c,["className","disabled","onClick","style","tabIndex","theme","clientId","auctionId","platformId","mintConfig","environment"]);let[r,C]=St(ht.WAITING_SUBMISSION),{isServerSideRendering:b}=u(),{goToOnboarding:R,fetchClientIntegration:I}=It({libVersion:p,clientId:E,environment:w,platformId:M,auctionId:k,mintConfig:S,setStatus:C,clientName:Ct.reactUi}),{getButtonText:U,isButtonDisabled:_,handleClick:L}=bt({onClick:o}),h=i=>L(i,r,R);gt(()=>{I();let i=setInterval(()=>{I()},60*1e3);return()=>clearInterval(i)},[]);let n=x(v(P)),T=ft(()=>f.createElement("span",{className:n.crossmintParagraph},U(r)),[r]);return f.createElement(f.Fragment,null,!b&&f.createElement("button",a({className:`${n.crossmintButton} ${t||""}`,disabled:_(r),onClick:h,style:a({},e),tabIndex:N},d),f.createElement("img",{className:n.crossmintImg,src:`${dt.prod}/assets/crossmint/logo.svg`,alt:"Crossmint logo"}),T))};export{Ht as CrossmintPayButton,Wt as CrossmintStatusButton};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@crossmint/client-sdk-react-ui",
|
|
3
|
-
"version": "0.1
|
|
3
|
+
"version": "0.2.1-alpha.0",
|
|
4
4
|
"author": "Paella Labs Inc",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": "https://github.com/CrossMint/crossmint-client-sdk",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"test": "jest"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@crossmint/client-sdk-base": "^0.1
|
|
35
|
+
"@crossmint/client-sdk-base": "^0.2.1-alpha.0",
|
|
36
36
|
"react-jss": "10.9.2",
|
|
37
37
|
"uuid": "^8.3.2"
|
|
38
38
|
},
|
|
@@ -49,5 +49,5 @@
|
|
|
49
49
|
"ts-jest": "^27.1.3",
|
|
50
50
|
"ts-node-dev": "^1.1.8"
|
|
51
51
|
},
|
|
52
|
-
"gitHead": "
|
|
52
|
+
"gitHead": "d910a4e44b10a7287d444efbffb9a8824cf5a889"
|
|
53
53
|
}
|
|
@@ -26,9 +26,6 @@ export const CrossmintPayButton: FC<CrossmintPayButtonReactProps> = ({
|
|
|
26
26
|
style,
|
|
27
27
|
tabIndex,
|
|
28
28
|
theme = "dark",
|
|
29
|
-
collectionTitle,
|
|
30
|
-
collectionDescription,
|
|
31
|
-
collectionPhoto,
|
|
32
29
|
mintTo,
|
|
33
30
|
emailTo,
|
|
34
31
|
listingId,
|
|
@@ -42,6 +39,7 @@ export const CrossmintPayButton: FC<CrossmintPayButtonReactProps> = ({
|
|
|
42
39
|
paymentMethod,
|
|
43
40
|
preferredSigninMethod,
|
|
44
41
|
dismissOverlayOnClick,
|
|
42
|
+
prepay,
|
|
45
43
|
...props
|
|
46
44
|
}) => {
|
|
47
45
|
const [connecting, setConnecting] = useState(false);
|
|
@@ -68,21 +66,12 @@ export const CrossmintPayButton: FC<CrossmintPayButtonReactProps> = ({
|
|
|
68
66
|
clientName: clientNames.reactUi,
|
|
69
67
|
});
|
|
70
68
|
|
|
71
|
-
const {
|
|
69
|
+
const { getButtonText, shouldHideButton, handleClick } = crossmintPayButtonService({
|
|
72
70
|
onClick,
|
|
73
71
|
connecting,
|
|
74
72
|
paymentMethod,
|
|
75
73
|
});
|
|
76
74
|
|
|
77
|
-
const [newCollectionTitle, newCollectionDescription, newCollectionPhoto] = checkProps({
|
|
78
|
-
collectionTitle,
|
|
79
|
-
collectionPhoto,
|
|
80
|
-
collectionDescription,
|
|
81
|
-
});
|
|
82
|
-
collectionTitle = newCollectionTitle;
|
|
83
|
-
collectionDescription = newCollectionDescription;
|
|
84
|
-
collectionPhoto = newCollectionPhoto;
|
|
85
|
-
|
|
86
75
|
useEffect(() => {
|
|
87
76
|
if (hideMintOnInactiveClient) {
|
|
88
77
|
fetchClientIntegration();
|
|
@@ -93,15 +82,13 @@ export const CrossmintPayButton: FC<CrossmintPayButtonReactProps> = ({
|
|
|
93
82
|
handleClick(event, () => {
|
|
94
83
|
connect(
|
|
95
84
|
mintConfig,
|
|
96
|
-
collectionTitle,
|
|
97
|
-
collectionDescription,
|
|
98
|
-
collectionPhoto,
|
|
99
85
|
mintTo,
|
|
100
86
|
emailTo,
|
|
101
87
|
listingId,
|
|
102
88
|
whPassThroughArgs,
|
|
103
89
|
paymentMethod,
|
|
104
|
-
preferredSigninMethod
|
|
90
|
+
preferredSigninMethod,
|
|
91
|
+
prepay
|
|
105
92
|
);
|
|
106
93
|
});
|
|
107
94
|
|
|
@@ -132,7 +119,7 @@ export const CrossmintPayButton: FC<CrossmintPayButtonReactProps> = ({
|
|
|
132
119
|
>
|
|
133
120
|
<img
|
|
134
121
|
className={classes.crossmintImg}
|
|
135
|
-
src="https://www.crossmint.io/assets/crossmint/logo.
|
|
122
|
+
src="https://www.crossmint.io/assets/crossmint/logo.svg"
|
|
136
123
|
alt="Crossmint logo"
|
|
137
124
|
/>
|
|
138
125
|
{content}
|
|
@@ -73,7 +73,7 @@ export const CrossmintStatusButton: FC<CrossmintStatusButtonReactProps> = ({
|
|
|
73
73
|
>
|
|
74
74
|
<img
|
|
75
75
|
className={classes.crossmintImg}
|
|
76
|
-
src={`${baseUrls.prod}/assets/crossmint/logo.
|
|
76
|
+
src={`${baseUrls.prod}/assets/crossmint/logo.svg`}
|
|
77
77
|
alt="Crossmint logo"
|
|
78
78
|
/>
|
|
79
79
|
{content}
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const LIB_VERSION = "0.1
|
|
1
|
+
export const LIB_VERSION = "0.2.1-alpha.0";
|