@crossmint/client-sdk-react-ui 0.1.4-alpha.2 → 0.1.4
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/lib/index.cjs +1 -1
- package/lib/index.js +1 -1
- package/package.json +3 -3
- package/src/CrossmintPayButton.tsx +10 -7
- package/src/CrossmintStatusButton.tsx +5 -3
- package/src/version.ts +1 -1
package/lib/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var rt=Object.create;var C=Object.defineProperty;var it=Object.getOwnPropertyDescriptor;var at=Object.getOwnPropertyNames,P=Object.getOwnPropertySymbols,mt=Object.getPrototypeOf,L=Object.prototype.hasOwnProperty,W=Object.prototype.propertyIsEnumerable;var G=(t,o,s)=>o in t?C(t,o,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[o]=s,c=(t,o)=>{for(var s in o||(o={}))L.call(o,s)&&G(t,s,o[s]);if(P)for(var s of P(o))W.call(o,s)&&G(t,s,o[s]);return t};var N=(t,o)=>{var s={};for(var e in t)L.call(t,e)&&o.indexOf(e)<0&&(s[e]=t[e]);if(t!=null&&P)for(var e of P(t))o.indexOf(e)<0&&W.call(t,e)&&(s[e]=t[e]);return s};var ut=(t,o)=>{for(var s in o)C(t,s,{get:o[s],enumerable:!0})},q=(t,o,s,e)=>{if(o&&typeof o=="object"||typeof o=="function")for(let a of at(o))!L.call(t,a)&&a!==s&&C(t,a,{get:()=>o[a],enumerable:!(e=it(o,a))||e.enumerable});return t};var D=(t,o,s)=>(s=t!=null?rt(mt(t)):{},q(o||!t||!t.__esModule?C(s,"default",{value:t,enumerable:!0}):s,t)),lt=t=>q(C({},"__esModule",{value:!0}),t);var dt={};ut(dt,{CrossmintPayButton:()=>gt,CrossmintStatusButton:()=>ft});module.exports=lt(dt);var r=D(require("react"),1),V=require("react"),i=require("@crossmint/client-sdk-base");var K=require("react-jss"),ct="#1e1e1e",j=t=>t==="light",w=t=>({buttonBgColor:j(t)?"white":ct,paragraphColor:j(t)?"black":"white"}),M=(0,K.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 E=typeof window<"u";var I="0.1.4-alpha.2";var pt={type:i.mintingContractTypes.CANDY_MACHINE},gt=F=>{var l=F,{className:t,disabled:o,onClick:s,style:e,tabIndex:a,theme:v="dark",collectionTitle:p,collectionDescription:g,collectionPhoto:f,mintTo:k,emailTo:O,listingId:T,clientId:_,auctionId:y,hideMintOnInactiveClient:m=!1,showOverlay:H=!0,mintConfig:B=pt,whPassThroughArgs:h,environment:x}=l,U=N(l,["className","disabled","onClick","style","tabIndex","theme","collectionTitle","collectionDescription","collectionPhoto","mintTo","emailTo","listingId","clientId","auctionId","hideMintOnInactiveClient","showOverlay","mintConfig","whPassThroughArgs","environment"]);let[d,S]=(0,V.useState)(!1),[R,Y]=(0,V.useState)(i.onboardingRequestStatusResponse.WAITING_SUBMISSION),{fetchClientIntegration:z}=(0,i.crossmintStatusService)({libVersion:I,clientId:_,environment:x,auctionId:y,mintConfig:B,setStatus:Y}),{connect:J}=(0,i.crossmintModalService)({clientId:_,showOverlay:H,setConnecting:S,libVersion:I,environment:x}),{checkProps:Q,getButtonText:X,shouldHideButton:Z}=(0,i.crossmintPayButtonService)(),[tt,st,ot]=Q({collectionTitle:p,collectionPhoto:f,collectionDescription:g});p=tt,g=st,f=ot,(0,r.useEffect)(()=>{m&&z()},[R]);let et=$=>{s&&s($),!d&&($.defaultPrevented||J(B,p,g,f,k,O,T,h))},A=M(w(v)),nt=(0,r.useMemo)(()=>r.default.createElement("p",{className:A.crossmintParagraph},X(d)),[d]);return Z({hideMintOnInactiveClient:m,status:R})?null:r.default.createElement(r.default.Fragment,null,E&&r.default.createElement("button",c({className:`${A.crossmintButton} ${t||""}`,disabled:o,onClick:et,style:c({},e),tabIndex:a},U),r.default.createElement("img",{className:A.crossmintImg,src:"https://www.crossmint.io/assets/crossmint/logo.png",alt:"Crossmint logo"}),nt))};var n=D(require("react"),1),u=require("@crossmint/client-sdk-base");var ft=_=>{var y=_,{className:t,disabled:o,onClick:s,style:e,tabIndex:a,theme:v="dark",clientId:p,auctionId:g,platformId:f,mintConfig:k,environment:O}=y,T=N(y,["className","disabled","onClick","style","tabIndex","theme","clientId","auctionId","platformId","mintConfig","environment"]);let[m,H]=(0,n.useState)(u.onboardingRequestStatusResponse.WAITING_SUBMISSION),{goToOnboarding:B,fetchClientIntegration:h,getButtonText:x,isButtonDisabled:U}=(0,u.crossmintStatusService)({libVersion:I,clientId:p,environment:O,platformId:f,auctionId:g,mintConfig:k,setStatus:H}),F=(0,n.useCallback)(S=>{if(s&&s(S),m===u.onboardingRequestStatusResponse.WAITING_SUBMISSION){B();return}},[m]);(0,n.useEffect)(()=>{h();let S=setInterval(()=>{h()},60*1e3);return()=>clearInterval(S)},[]);let l=M(w(v)),d=(0,n.useMemo)(()=>n.default.createElement("p",{className:l.crossmintParagraph},x(m)),[m]);return n.default.createElement(n.default.Fragment,null,E&&n.default.createElement("button",c({className:`${l.crossmintButton} ${t||""}`,disabled:U(m),onClick:F,style:c({},e),tabIndex:a},T),n.default.createElement("img",{className:l.crossmintImg,src:`${u.baseUrls.prod}/assets/crossmint/logo.png`,alt:"Crossmint logo"}),d))};0&&(module.exports={CrossmintPayButton,CrossmintStatusButton});
|
package/lib/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var st=Object.defineProperty;var B=Object.getOwnPropertySymbols;var F=Object.prototype.hasOwnProperty,R=Object.prototype.propertyIsEnumerable;var V=(t,o,s)=>o in t?st(t,o,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[o]=s,i=(t,o)=>{for(var s in o||(o={}))F.call(o,s)&&V(t,s,o[s]);if(B)for(var s of B(o))R.call(o,s)&&V(t,s,o[s]);return t};var h=(t,o)=>{var s={};for(var e in t)F.call(t,e)&&o.indexOf(e)<0&&(s[e]=t[e]);if(t!=null&&B)for(var e of B(t))o.indexOf(e)<0&&R.call(t,e)&&(s[e]=t[e]);return s};import{
|
|
1
|
+
var st=Object.defineProperty;var B=Object.getOwnPropertySymbols;var F=Object.prototype.hasOwnProperty,R=Object.prototype.propertyIsEnumerable;var V=(t,o,s)=>o in t?st(t,o,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[o]=s,i=(t,o)=>{for(var s in o||(o={}))F.call(o,s)&&V(t,s,o[s]);if(B)for(var s of B(o))R.call(o,s)&&V(t,s,o[s]);return t};var h=(t,o)=>{var s={};for(var e in t)F.call(t,e)&&o.indexOf(e)<0&&(s[e]=t[e]);if(t!=null&&B)for(var e of B(t))o.indexOf(e)<0&&R.call(t,e)&&(s[e]=t[e]);return s};import d,{useEffect as nt,useMemo as rt}from"react";import{useState as G}from"react";import{crossmintModalService as it,crossmintPayButtonService as at,crossmintStatusService as mt,mintingContractTypes as ut,onboardingRequestStatusResponse as lt}from"@crossmint/client-sdk-base";import{createUseStyles as ot}from"react-jss";var et="#1e1e1e",$=t=>t==="light",x=t=>({buttonBgColor:$(t)?"white":et,paragraphColor:$(t)?"black":"white"}),P=ot({"@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 N=typeof window<"u";var f="0.1.4-alpha.2";var ct={type:ut.CANDY_MACHINE},Ot=U=>{var r=U,{className:t,disabled:o,onClick:s,style:e,tabIndex:w,theme:M="dark",collectionTitle:a,collectionDescription:m,collectionPhoto:u,mintTo:E,emailTo:v,listingId:k,clientId:O,auctionId:C,hideMintOnInactiveClient:n=!1,showOverlay:T=!0,mintConfig:b=ct,whPassThroughArgs:I,environment:y}=r,_=h(r,["className","disabled","onClick","style","tabIndex","theme","collectionTitle","collectionDescription","collectionPhoto","mintTo","emailTo","listingId","clientId","auctionId","hideMintOnInactiveClient","showOverlay","mintConfig","whPassThroughArgs","environment"]);let[l,c]=G(!1),[A,q]=G(lt.WAITING_SUBMISSION),{fetchClientIntegration:D}=mt({libVersion:f,clientId:O,environment:y,auctionId:C,mintConfig:b,setStatus:q}),{connect:j}=it({clientId:O,showOverlay:T,setConnecting:c,libVersion:f,environment:y}),{checkProps:K,getButtonText:Y,shouldHideButton:z}=at(),[J,Q,X]=K({collectionTitle:a,collectionPhoto:u,collectionDescription:m});a=J,m=Q,u=X,nt(()=>{n&&D()},[A]);let Z=L=>{s&&s(L),!l&&(L.defaultPrevented||j(b,a,m,u,E,v,k,I))},H=P(x(M)),tt=rt(()=>d.createElement("p",{className:H.crossmintParagraph},Y(l)),[l]);return z({hideMintOnInactiveClient:n,status:A})?null:d.createElement(d.Fragment,null,N&&d.createElement("button",i({className:`${H.crossmintButton} ${t||""}`,disabled:o,onClick:Z,style:i({},e),tabIndex:w},_),d.createElement("img",{className:H.crossmintImg,src:"https://www.crossmint.io/assets/crossmint/logo.png",alt:"Crossmint logo"}),tt))};import S,{useCallback as pt,useEffect as gt,useMemo as ft,useState as dt}from"react";import{baseUrls as St,crossmintStatusService as Ct,onboardingRequestStatusResponse as W}from"@crossmint/client-sdk-base";var Rt=O=>{var C=O,{className:t,disabled:o,onClick:s,style:e,tabIndex:w,theme:M="dark",clientId:a,auctionId:m,platformId:u,mintConfig:E,environment:v}=C,k=h(C,["className","disabled","onClick","style","tabIndex","theme","clientId","auctionId","platformId","mintConfig","environment"]);let[n,T]=dt(W.WAITING_SUBMISSION),{goToOnboarding:b,fetchClientIntegration:I,getButtonText:y,isButtonDisabled:_}=Ct({libVersion:f,clientId:a,environment:v,platformId:u,auctionId:m,mintConfig:E,setStatus:T}),U=pt(c=>{if(s&&s(c),n===W.WAITING_SUBMISSION){b();return}},[n]);gt(()=>{I();let c=setInterval(()=>{I()},60*1e3);return()=>clearInterval(c)},[]);let r=P(x(M)),l=ft(()=>S.createElement("p",{className:r.crossmintParagraph},y(n)),[n]);return S.createElement(S.Fragment,null,N&&S.createElement("button",i({className:`${r.crossmintButton} ${t||""}`,disabled:_(n),onClick:U,style:i({},e),tabIndex:w},k),S.createElement("img",{className:r.crossmintImg,src:`${St.prod}/assets/crossmint/logo.png`,alt:"Crossmint logo"}),l))};export{Ot as CrossmintPayButton,Rt as CrossmintStatusButton};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@crossmint/client-sdk-react-ui",
|
|
3
|
-
"version": "0.1.4
|
|
3
|
+
"version": "0.1.4",
|
|
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.0
|
|
35
|
+
"@crossmint/client-sdk-base": "^0.1.0",
|
|
36
36
|
"react": "^17.0.2",
|
|
37
37
|
"react-dom": "^17.0.2",
|
|
38
38
|
"react-jss": "^10.9.0",
|
|
@@ -50,5 +50,5 @@
|
|
|
50
50
|
"ts-jest": "^27.1.3",
|
|
51
51
|
"ts-node-dev": "^1.1.8"
|
|
52
52
|
},
|
|
53
|
-
"gitHead": "
|
|
53
|
+
"gitHead": "e66aa4bd223b2c4a5879a2db51488c9ac1dbaec1"
|
|
54
54
|
}
|
|
@@ -1,14 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
import { isClientSide } from "./utils";
|
|
5
|
-
import { CrossmintPayButtonReactProps } from "./types";
|
|
1
|
+
import React, { FC, MouseEvent, useEffect, useMemo } from "react";
|
|
2
|
+
import { useState } from "react";
|
|
3
|
+
|
|
6
4
|
import {
|
|
7
5
|
crossmintModalService,
|
|
8
|
-
|
|
6
|
+
crossmintPayButtonService,
|
|
9
7
|
crossmintStatusService,
|
|
8
|
+
mintingContractTypes,
|
|
9
|
+
onboardingRequestStatusResponse,
|
|
10
10
|
} from "@crossmint/client-sdk-base";
|
|
11
|
-
|
|
11
|
+
|
|
12
|
+
import { formatProps, useStyles } from "./styles";
|
|
13
|
+
import { CrossmintPayButtonReactProps } from "./types";
|
|
14
|
+
import { isClientSide } from "./utils";
|
|
12
15
|
import { LIB_VERSION } from "./version";
|
|
13
16
|
|
|
14
17
|
const defaultMintConfig: any = {
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import React, { FC, MouseEventHandler,
|
|
2
|
-
|
|
1
|
+
import React, { FC, MouseEventHandler, useCallback, useEffect, useMemo, useState } from "react";
|
|
2
|
+
|
|
3
|
+
import { baseUrls, crossmintStatusService, onboardingRequestStatusResponse } from "@crossmint/client-sdk-base";
|
|
4
|
+
|
|
5
|
+
import { formatProps, useStyles } from "./styles";
|
|
3
6
|
import { CrossmintStatusButtonReactProps } from "./types";
|
|
4
7
|
import { isClientSide } from "./utils";
|
|
5
|
-
import { baseUrls, onboardingRequestStatusResponse, crossmintStatusService } from "@crossmint/client-sdk-base";
|
|
6
8
|
import { LIB_VERSION } from "./version";
|
|
7
9
|
|
|
8
10
|
export const CrossmintStatusButton: FC<CrossmintStatusButtonReactProps> = ({
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const LIB_VERSION = "0.1.4
|
|
1
|
+
export const LIB_VERSION = "0.1.4";
|