@frak-labs/components 0.0.26-beta.53dfa7b2 → 0.0.26-beta.61feeff8

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 (35) hide show
  1. package/cdn/Banner.BfA_VDsk.js +132 -0
  2. package/cdn/ButtonShare.Dl8hptWq.js +1 -0
  3. package/cdn/ButtonWallet.Boy4WanE.js +40 -0
  4. package/cdn/OpenInAppButton.BBj09SVF.js +1 -0
  5. package/cdn/PostPurchase.Dm7hQC-m.js +47 -0
  6. package/cdn/components.js +1 -1
  7. package/cdn/formatReward.D0OKqV7x.js +1 -0
  8. package/cdn/jsxRuntime.module.D7jbXhdY.js +58 -0
  9. package/cdn/loader.js +4 -4
  10. package/cdn/sprinkles.css.ts.vanilla.BtNHSSRm.js +1175 -0
  11. package/cdn/useLightDomStyles.x0mCz8nV.js +1 -0
  12. package/cdn/useReward.BnRGyYMM.js +1 -0
  13. package/cdn/useShareModal.DsoI-v9u.js +1 -0
  14. package/dist/GiftIcon-BrNVWoWm.js +1246 -0
  15. package/dist/banner.d.ts +9 -8
  16. package/dist/banner.js +297 -87
  17. package/dist/buttonShare.js +6 -5
  18. package/dist/buttonWallet.js +2 -2
  19. package/dist/{formatReward-_UYA3aHE.js → formatReward-DglcX-Xj.js} +8 -1
  20. package/dist/openInApp.js +2 -2
  21. package/dist/postPurchase.js +16 -1265
  22. package/dist/{useLightDomStyles-B5Y_fH4K.js → useLightDomStyles-Cjpf0MnX.js} +1 -1
  23. package/dist/{usePlacement-CHEgrdvN.js → usePlacement-LqYjZLX_.js} +1 -82
  24. package/dist/{useReward-XF2hB_C_.js → useReward-Cup3DU1-.js} +1 -1
  25. package/package.json +8 -8
  26. package/cdn/Banner.BrITmwhY.js +0 -1
  27. package/cdn/ButtonShare.Byvhu5Tc.js +0 -1
  28. package/cdn/ButtonWallet.C_GtjZpW.js +0 -40
  29. package/cdn/OpenInAppButton.CZBmQT_a.js +0 -1
  30. package/cdn/PostPurchase.BNSQonvO.js +0 -2362
  31. package/cdn/formatReward.DXMr8a-D.js +0 -1
  32. package/cdn/jsxRuntime.module.GTd8MQxp.js +0 -138
  33. package/cdn/useLightDomStyles.B33IA3q5.js +0 -1
  34. package/cdn/useReward.CvZWCurW.js +0 -1
  35. package/cdn/useShareModal.BJBvkHbY.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{n as a}from"./formatReward.D0OKqV7x.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};