@frak-labs/components 0.0.26-beta.9d5371b4 → 0.0.26-beta.bbbb3d22
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/cdn/Banner.BrrxJ-YP.js +132 -0
- package/cdn/ButtonShare.D6sav-O3.js +1 -0
- package/cdn/{ButtonWallet.B7UmJcbb.js → ButtonWallet.DalZLwGv.js} +2 -2
- package/cdn/OpenInAppButton.BBj09SVF.js +1 -0
- package/cdn/PostPurchase.CXHETVu7.js +47 -0
- package/cdn/components.js +1 -1
- package/cdn/formatReward.CU8k_jx9.js +1 -0
- package/cdn/jsxRuntime.module.D7jbXhdY.js +58 -0
- package/cdn/loader.js +26 -26
- package/cdn/sprinkles.css.ts.vanilla.BtNHSSRm.js +1175 -0
- package/cdn/useLightDomStyles.x0mCz8nV.js +1 -0
- package/cdn/useReward.Cbh2WzQ3.js +1 -0
- package/cdn/useShareModal.DsoI-v9u.js +1 -0
- package/dist/GiftIcon-BrNVWoWm.js +1246 -0
- package/dist/banner.d.ts +24 -11
- package/dist/banner.js +314 -96
- package/dist/buttonShare.d.ts +2 -2
- package/dist/buttonShare.js +5 -11
- package/dist/buttonWallet.d.ts +2 -2
- package/dist/buttonWallet.js +3 -7
- package/dist/{formatReward-6JQldDEC.js → formatReward-_UYA3aHE.js} +1 -3
- package/dist/openInApp.d.ts +2 -2
- package/dist/openInApp.js +3 -9
- package/dist/postPurchase.d.ts +8 -2
- package/dist/postPurchase.js +1623 -25
- package/dist/{useLightDomStyles-DukxuNnJ.js → useLightDomStyles-Cjpf0MnX.js} +2 -5
- package/dist/{usePlacement-BbMuz8_A.js → usePlacement-LqYjZLX_.js} +1 -93
- package/dist/{useReward-CI2yRrCj.js → useReward-XF2hB_C_.js} +2 -4
- package/dist/{useShareModal-DHlayNqk.js → useShareModal-Bmlk3eBJ.js} +1 -3
- package/package.json +13 -9
- package/cdn/Banner.BfkMel9Q.js +0 -1
- package/cdn/ButtonShare.BM9Inhmf.js +0 -1
- package/cdn/OpenInAppButton.B4mrsz6L.js +0 -1
- package/cdn/PostPurchase.BIc0C4Ma.js +0 -1
- package/cdn/formatReward.C8hlSKRj.js +0 -1
- package/cdn/jsxRuntime.module.5UNmmhNi.js +0 -138
- package/cdn/useLightDomStyles.D895e4W1.js +0 -1
- package/cdn/useReward.DEU0AF3P.js +0 -1
- package/cdn/useShareModal.CN9_P7Sl.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./loader.js";import{i as t,l as n}from"./jsxRuntime.module.D7jbXhdY.js";function r(r,i,a,o){n(()=>{e.injectBase(r,o??t)},[r]),n(()=>{!i||!a||e.injectPlacement(r,i,a)},[r,i,a])}export{r as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{f as e,v as t,x as n}from"./loader.js";import{l as r,s as i}from"./jsxRuntime.module.D7jbXhdY.js";import{t as a}from"./formatReward.CU8k_jx9.js";function o(e,t){switch(e.payoutType){case`fixed`:return e.amount[t];case`tiered`:return e.tiers.reduce((e,n)=>Math.max(e,n.amount[t]),0);case`percentage`:return 0}}function s({rewards:e},r,i){let s=(i?e.filter(e=>e.interactionTypeKey===i):e).map(e=>e.referrer).filter(e=>e!==void 0);if(s.length===0)return;let c=n(t(r)),l=s[0],u=o(l,c);for(let e=1;e<s.length;e++){let t=o(s[e],c);t>u&&(l=s[e],u=t)}if(u<=0){let e=s.find(e=>e.payoutType===`percentage`);if(!e)return;l=e}return a(l,r)}function c(t,n){let[a,o]=i(void 0);return r(()=>{if(!t)return;let r=window.FrakSetup?.client;r&&e(r).then(e=>{let t=r.config.metadata?.currency,i=s(e,t,n);i&&o(i)}).catch(()=>{})},[t,n]),{reward:a}}export{c as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{C as e,T as t,s as n,w as r,y as i}from"./loader.js";import{c as a,s as o}from"./jsxRuntime.module.D7jbXhdY.js";function s(s,c,l){let[u,d]=o(void 0),[f,p]=o(!1);return{handleShare:a(async()=>{if(!window.FrakSetup?.client){console.error(`Frak client not found`),d(i.empty().formatDebugInfo(`Frak client not found`)),p(!0);return}let a=n(window.FrakSetup.client,{});try{await a.sharing(l?{link:l}:{}).display(e=>({...e,targetInteraction:s}),c)}catch(n){if(n instanceof t&&n.code===r.clientAborted){console.debug(`User aborted the modal`);return}let i=window.FrakSetup.client.debugInfo.formatDebugInfo(n);e(window.FrakSetup.client,`share_modal_error`,{error:n instanceof Object&&`message`in n?n.message:`Unknown error`,debugInfo:i}),d(i),p(!0),console.error(`Error while opening the modal`,n)}},[s,c,l]),isError:f,debugInfo:u}}export{s as t};
|