@stridge/kit 0.1.0-alpha.35 → 0.1.0-alpha.36
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/package.js +1 -1
- package/dist/shared/merchant-link/MerchantLink.d.ts +1 -0
- package/dist/shared/merchant-link/MerchantLink.js +1 -0
- package/dist/shared/merchant-link/MerchantLinkButton.js +1 -0
- package/dist/shared/merchant-link/index.js +1 -0
- package/dist/shared/{terms/resolveTerms.js → merchant-link/resolveMerchantLink.js} +1 -1
- package/dist/shared/support/SupportLink.d.ts +1 -1
- package/dist/shared/support/SupportLink.js +1 -1
- package/dist/shared/support/index.js +1 -1
- package/dist/shared/terms/TermsLink.d.ts +1 -1
- package/dist/shared/terms/TermsLink.js +1 -1
- package/dist/shared/terms/index.js +1 -1
- package/dist/shared/ui/ExternalLink/ExternalLink.js +1 -1
- package/dist/stridge/StridgeProvider.js +1 -1
- package/package.json +1 -1
- package/dist/shared/support/SupportButton.js +0 -1
- package/dist/shared/support/resolveSupport.js +0 -1
- package/dist/shared/terms/TermsButton.d.ts +0 -1
- package/dist/shared/terms/TermsButton.js +0 -1
- package/dist/shared/terms/resolveTerms.d.ts +0 -1
- /package/dist/shared/{support/SupportButton.d.ts → merchant-link/MerchantLinkButton.d.ts} +0 -0
- /package/dist/shared/{support/resolveSupport.d.ts → merchant-link/index.d.ts} +0 -0
package/dist/package.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var e=`0.1.0-alpha.
|
|
1
|
+
var e=`0.1.0-alpha.36`;export{e as version};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import { CSSProperties, MouseEvent, MouseEventHandler, ReactNode } from "react";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{ExternalLink as e}from"../ui/ExternalLink/ExternalLink.js";import"../ui/ExternalLink/index.js";import{MerchantLinkButton as t}from"./MerchantLinkButton.js";import{resolveMerchantLink as n}from"./resolveMerchantLink.js";import{useCallback as r}from"react";import{jsx as i}from"react/jsx-runtime";function a({config:e,defaultRenderer:t,buildContext:r,emit:a,buttonSlotName:c,...l}){let u=n(e);return u.kind===`default`?t({...l,buildContext:r,emit:a}):u.kind===`url`?i(o,{...l,url:u.url,buildContext:r,emit:a}):i(s,{...l,url:u.url,onSelect:u.onSelect,buildContext:r,emit:a,buttonSlotName:c})}function o({url:t,buildContext:n,emit:a,suffix:o,children:s,onClick:c,...l}){let u=r(e=>{a(n(e)),c?.(e)},[n,a,c]);return i(e,{...l,href:t,suffix:o,onClick:u,children:s})}function s({url:n,onSelect:a,buildContext:o,emit:s,buttonSlotName:c,suffix:l,children:u,onClick:d,...f}){let p=r(e=>{if(d?.(e),e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey)return;e.preventDefault();let t=o(e);s(t),a(t)},[o,s,d,a]),m=r(e=>{if(d?.(e),e.defaultPrevented)return;let t=o(e);s(t),a(t)},[o,s,d,a]);return n?i(e,{...f,href:n,suffix:l,onClick:p,children:u}):i(t,{...f,suffix:l,slotName:c,onClick:m,children:u})}export{a as MerchantLink};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{joinClassNames as e}from"../utils/joinClassNames.js";import{styles as t}from"../ui/ExternalLink/ExternalLink.styles.js";import{cloneElement as n,isValidElement as r}from"react";import{jsx as i,jsxs as a}from"react/jsx-runtime";import*as o from"@stylexjs/stylex";function s({slotName:n,children:r,suffix:s,className:u,style:d,...f}){let p=s!=null&&s!==!1,m=o.props(t.root,l.button),h=e(m.className,u),g=o.props(t.iconSlot,t.suffixSpacing);return a(`button`,{"data-stridge-slot":n,type:`button`,...f,className:h,style:{...m.style,...d},children:[r,p?i(`span`,{"data-icon":`inline-end`,...g,children:c(s)}):null]})}function c(e){if(!r(e))return e;let i=o.props(t.iconSvg);return n(e,{className:[e.props.className,i.className].filter(Boolean).join(` `),style:{...e.props.style,...i.style}})}const l={button:{"MerchantLinkButton__styles.button":`MerchantLinkButton__styles.button`,"appearance-kysU6D":`xjyslct`,"padding-kmVPX3":`x1717udv`,"font-kVVagm":`xln7xf2`,"color-kMwMTN":`x1heor9g`,"cursor-kkrTdU":`x1ypdohk`,"textAlign-k9WMMc":`x16tdsg8`,$$css:`@stridge/kit:src/shared/merchant-link/MerchantLinkButton.tsx:56`}};export{s as MerchantLinkButton};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./MerchantLinkButton.js";import"./resolveMerchantLink.js";import"./MerchantLink.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function e(e){return e?.onSelect?e.url?{kind:`custom`,onSelect:e.onSelect,url:e.url}:{kind:`custom`,onSelect:e.onSelect}:e?.url?{kind:`url`,url:e.url}:{kind:`
|
|
1
|
+
function e(e){return e?.onSelect?e.url?{kind:`custom`,onSelect:e.onSelect,url:e.url}:{kind:`custom`,onSelect:e.onSelect}:e?.url?{kind:`url`,url:e.url}:{kind:`default`}}export{e as resolveMerchantLink};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
export { };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{useSupportConfig as e}from"./SupportConfigContext.js";import{
|
|
1
|
+
"use client";import{useSupportConfig as e}from"./SupportConfigContext.js";import{ExternalLink as t}from"../ui/ExternalLink/ExternalLink.js";import"../ui/ExternalLink/index.js";import{MerchantLink as n}from"../merchant-link/MerchantLink.js";import"../merchant-link/index.js";import{useKitEmitter as r}from"../../events/emit/useKitEmitter.js";import"../../events/emit/index.js";import{BRAND_LINKS as i}from"../constants/brand-links.js";import{SupportSpinner as a}from"./SupportSpinner.js";import{useSupportTrigger as o}from"./useSupportTrigger.js";import{useCallback as s}from"react";import{jsx as c}from"react/jsx-runtime";const l={cursor:`not-allowed`,opacity:.6,pointerEvents:`none`};function u(t){let{config:i,merchantContext:a}=e(),o=r(),l=i?{url:i.url,onSelect:i.onOpen}:void 0,u=s(e=>({event:e,...p(a)}),[a]),f=s(e=>{o({type:`kit.support.clicked`,flow:`kit`,tier:`ui`,payload:{context:e}})},[o]);return c(n,{...t,config:l,buildContext:u,emit:f,buttonSlotName:`support-button`,defaultRenderer:d})}function d(e){return c(f,{...e})}function f({buildContext:e,emit:n,onClick:r,suffix:u,children:d,style:f,...p}){let m=o(),h=m.status===`loading`,g=s(t=>{r?.(t),!t.defaultPrevented&&t.button===0&&(t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||(t.preventDefault(),n(e(t)),m.open()))},[e,n,m,r]),_=h?{...f,...l}:f;return c(t,{...p,href:i.support,suffix:h?c(a,{}):u,onClick:g,"aria-busy":h||void 0,"aria-disabled":h||void 0,style:_,children:d})}function p(e){return e??{gatewayKey:``,environment:``,assetChain:``,assetSymbol:``}}export{u as SupportLink};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./SupportConfigContext.js";import"./intercom-loader.js";import"./
|
|
1
|
+
import"./SupportConfigContext.js";import"./intercom-loader.js";import"./SupportSpinner.js";import"./useSupportTrigger.js";import"./SupportLink.js";import"./useIntercomMerchantContext.js";import"./useIntercomShutdownOnUnmount.js";import"./useMerchantContext.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
export { };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{useTermsConfig as e}from"./TermsConfigContext.js";import{
|
|
1
|
+
"use client";import{useTermsConfig as e}from"./TermsConfigContext.js";import{ExternalLink as t}from"../ui/ExternalLink/ExternalLink.js";import"../ui/ExternalLink/index.js";import{MerchantLink as n}from"../merchant-link/MerchantLink.js";import"../merchant-link/index.js";import{useKitEmitter as r}from"../../events/emit/useKitEmitter.js";import"../../events/emit/index.js";import{BRAND_LINKS as i}from"../constants/brand-links.js";import{useCallback as a}from"react";import{jsx as o}from"react/jsx-runtime";function s(t){let{config:i}=e(),s=r(),l=a(e=>({event:e}),[]),u=a(e=>{s({type:`kit.terms.clicked`,flow:`kit`,tier:`ui`,payload:{context:e}})},[s]);return o(n,{...t,config:i,buildContext:l,emit:u,buttonSlotName:`terms-button`,defaultRenderer:c})}function c(e){return o(l,{...e})}function l({buildContext:e,emit:n,onClick:r,suffix:s,children:c,...l}){let u=a(t=>{n(e(t)),r?.(t)},[e,n,r]);return o(t,{...l,href:i.terms,suffix:s,onClick:u,children:c})}export{s as TermsLink};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./TermsConfigContext.js";import"./
|
|
1
|
+
import"./TermsConfigContext.js";import"./TermsLink.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{
|
|
1
|
+
"use client";import{joinClassNames as e}from"../../utils/joinClassNames.js";import{EXTERNAL_LINK_SLOTS as t}from"./ExternalLink.slots.js";import{styles as n}from"./ExternalLink.styles.js";import{toSafeHref as r}from"./toSafeHref.js";import{cloneElement as i,isValidElement as a}from"react";import{jsx as o,jsxs as s}from"react/jsx-runtime";import*as c from"@stylexjs/stylex";function l({href:i,suffix:a,className:l,style:d,children:f,...p}){let m=r(i)??`#`,h=a!=null&&a!==!1,g=c.props(n.root),_=e(g.className,l),v=c.props(n.iconSlot,n.suffixSpacing);return s(`a`,{"data-stridge-slot":t.root,...p,href:m,target:`_blank`,rel:`noreferrer noopener`,className:_,style:{...g.style,...d},children:[f,h?o(`span`,{"data-icon":`inline-end`,...v,children:u(a)}):null]})}function u(e){if(!a(e))return e;let t=c.props(n.iconSvg);return i(e,{className:[e.props.className,t.className].filter(Boolean).join(` `),style:{...e.props.style,...t.style}})}export{l as ExternalLink};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{StridgeEventsContext as e}from"../events/context.js";import{createKitI18n as t}from"../shared/i18n/createKitI18n.js";import"../i18n/index.js";import{StridgeContext as n}from"./StridgeContext.js";import{createStridgeDepositDriver as r}from"../drivers/stridge/createStridgeDepositDriver.js";import{createStridgeWithdrawDriver as i}from"../drivers/stridge/createStridgeWithdrawDriver.js";import"../_internal/drivers/stridge/index.js";import{createBus as a}from"../events/bus/createBus.js";import{createFlowIdRegistry as o}from"../events/bus/flowIdRegistry.js";import{createMetadataStore as s}from"../events/bus/metadata.js";import"../events/bus/index.js";import{KitProvider as c}from"../KitProvider.js";import{
|
|
1
|
+
"use client";import{StridgeEventsContext as e}from"../events/context.js";import{createKitI18n as t}from"../shared/i18n/createKitI18n.js";import"../i18n/index.js";import{StridgeContext as n}from"./StridgeContext.js";import{createStridgeDepositDriver as r}from"../drivers/stridge/createStridgeDepositDriver.js";import{createStridgeWithdrawDriver as i}from"../drivers/stridge/createStridgeWithdrawDriver.js";import"../_internal/drivers/stridge/index.js";import{createBus as a}from"../events/bus/createBus.js";import{createFlowIdRegistry as o}from"../events/bus/flowIdRegistry.js";import{createMetadataStore as s}from"../events/bus/metadata.js";import"../events/bus/index.js";import{KitProvider as c}from"../KitProvider.js";import{resolveMerchantLink as l}from"../shared/merchant-link/resolveMerchantLink.js";import"../shared/merchant-link/index.js";import{useIntercomMerchantContext as u}from"../shared/support/useIntercomMerchantContext.js";import{useMerchantContext as d}from"../shared/support/useMerchantContext.js";import"../shared/support/index.js";import{useOptionalWagmi as f}from"./optionalWagmi.js";import{createStubDepositDriver as p,createStubWithdrawDriver as m}from"./stubs.js";import{useMemo as h,useRef as g,useSyncExternalStore as _}from"react";import{jsx as v}from"react/jsx-runtime";function y({gatewayKey:y,environment:b,asset:x,flows:S,appearance:C,i18n:w,storage:T,dev:E,support:D,terms:O,className:k,children:A}){if(!S.deposit&&!S.withdraw)throw Error("<StridgeProvider /> requires at least one of `flows.deposit` or `flows.withdraw`.");if(!x)throw Error("<StridgeProvider /> requires `asset: { networkId, symbol }`.");let{config:j,address:M}=f(),N=h(()=>t(w??{}),[w?.locale,w?.messages]),P=g(N);P.current=N;let F=x.networkId,I=x.symbol,L=S.deposit,R=S.withdraw,z=L?.owner?.address??M??E?.userAddressOverride,B=R?.owner.address,V=h(()=>{if(!(!L||!z))return r({userAddress:z,projectKey:y,destination:{network_id:F,asset_symbol:I,to_address:L.destination.address},wagmiConfig:j,getI18n:()=>P.current,...b?{environment:b}:{},...L.minAmountUsd===void 0?{}:{minAmountUsd:L.minAmountUsd},...L.maxAmountUsd===void 0?{}:{maxAmountUsd:L.maxAmountUsd},...L.metadata?{metadata:L.metadata}:{}})},[L,z,y,b,F,I,j]),H=h(()=>p(),[]),U=L?V??H:void 0,W=h(()=>{if(!(!R||!B))return i({userAddress:B,projectKey:y,currency:{networkId:F,assetSymbol:I},wagmiConfig:j,getI18n:()=>P.current,...b?{environment:b}:{},...R.minAmountUsd===void 0?{}:{minAmountUsd:R.minAmountUsd},...R.maxAmountUsd===void 0?{}:{maxAmountUsd:R.maxAmountUsd},...R.metadata?{metadata:R.metadata}:{}})},[R,B,y,b,F,I,j]),G=h(()=>m(),[]),K=R?W??G:void 0,q=V??W,J=_(e=>q?.subscribe(e)??(()=>{}),()=>{if(V){let e=V.getSnapshot();return e.brand.status===`ready`&&e.target.status===`ready`}return W?W.getSnapshot().receiveOptions.status===`ready`:!1},()=>!1),Y=z??B,X=d({gatewayKey:y,environment:b??`production`,assetChain:F,assetSymbol:I,...Y?{userAddress:Y}:{},...V?{depositDriver:V}:{}});u(l(D?{url:D.url,onSelect:D.onOpen}:void 0).kind===`default`?X:null);let Z=h(()=>({isReady:J,driver:V}),[J,V]);return v(e,{value:h(()=>({bus:a(),flowIds:o(),metadata:s()}),[]),children:v(n,{value:Z,children:v(c,{theme:C?.theme,accent:C?.accent,radius:C?.radius,direction:C?.direction,attribution:C?.attribution,i18n:w,storage:T?.driver,storageNamespace:T?.namespace,className:k,support:D,merchantContext:X,terms:O,...U?{deposit:U}:{},...L?.methods?{depositMethods:L.methods}:{},...K?{withdraw:K}:{},children:A})})})}export{y as StridgeProvider};
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use client";import{styles as e}from"../ui/ExternalLink/ExternalLink.styles.js";import{joinClassNames as t}from"../utils/joinClassNames.js";import{cloneElement as n,isValidElement as r}from"react";import{jsx as i,jsxs as a}from"react/jsx-runtime";import*as o from"@stylexjs/stylex";function s({children:n,suffix:r,className:s,style:d,...f}){let p=r!=null&&r!==!1,m=o.props(e.root,l.button),h=t(m.className,s),g=o.props(e.iconSlot,e.suffixSpacing);return a(`button`,{"data-stridge-slot":u.root,type:`button`,...f,className:h,style:{...m.style,...d},children:[n,p?i(`span`,{"data-icon":`inline-end`,...g,children:c(r)}):null]})}function c(t){if(!r(t))return t;let i=o.props(e.iconSvg);return n(t,{className:[t.props.className,i.className].filter(Boolean).join(` `),style:{...t.props.style,...i.style}})}const l={button:{"SupportButton__supportButtonStyles.button":`SupportButton__supportButtonStyles.button`,"appearance-kysU6D":`xjyslct`,"padding-kmVPX3":`x1717udv`,"font-kVVagm":`xln7xf2`,"color-kMwMTN":`x1heor9g`,"cursor-kkrTdU":`x1ypdohk`,"textAlign-k9WMMc":`x16tdsg8`,$$css:`@stridge/kit:src/shared/support/SupportButton.tsx:52`}},u={root:`support-button`};export{s as SupportButton};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function e(e){return e?.onOpen?e.url?{kind:`custom`,onOpen:e.onOpen,url:e.url}:{kind:`custom`,onOpen:e.onOpen}:e?.url?{kind:`url`,url:e.url}:{kind:`stridge`}}export{e as resolveSupport};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import { ComponentProps, ReactNode } from "react";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use client";import{styles as e}from"../ui/ExternalLink/ExternalLink.styles.js";import{joinClassNames as t}from"../utils/joinClassNames.js";import{jsx as n}from"react/jsx-runtime";import*as r from"@stylexjs/stylex";function i({children:i,className:s,style:c,...l}){let u=r.props(e.root,a.button),d=t(u.className,s);return n(`button`,{"data-stridge-slot":o.root,type:`button`,...l,className:d,style:{...u.style,...c},children:i})}const a={button:{"TermsButton__termsButtonStyles.button":`TermsButton__termsButtonStyles.button`,"appearance-kysU6D":`xjyslct`,"padding-kmVPX3":`x1717udv`,"font-kVVagm":`xln7xf2`,"color-kMwMTN":`x1heor9g`,"cursor-kkrTdU":`x1ypdohk`,"textAlign-k9WMMc":`x16tdsg8`,$$css:`@stridge/kit:src/shared/terms/TermsButton.tsx:28`}},o={root:`terms-button`};export{i as TermsButton};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { };
|
|
File without changes
|
|
File without changes
|