@frak-labs/components 1.0.3 → 1.0.4-beta.f27f8229

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 (42) hide show
  1. package/cdn/Banner.CIxY6tCU.js +178 -0
  2. package/cdn/{ButtonShare.FHUOd26e.js → ButtonShare.DNELNwqD.js} +1 -1
  3. package/cdn/{ButtonWallet.CN2iHSTB.js → ButtonWallet.BUUPX0gO.js} +1 -1
  4. package/cdn/GiftIcon.eRNTGQ_r.js +1 -0
  5. package/cdn/OpenInAppButton.Dgb-qhM8.js +1 -0
  6. package/cdn/PostPurchase.C3IH-LUy.js +89 -0
  7. package/cdn/components.js +1 -1
  8. package/cdn/formatReward.B1ZyoceC.js +1 -0
  9. package/cdn/loader.js +154 -14
  10. package/cdn/replay-V6FXES7X.CNozpSRg.js +1 -0
  11. package/cdn/sharingPage.Dt8QZhlR.js +1 -0
  12. package/cdn/useGlobalComponents.TG9kIYSc.js +1 -0
  13. package/cdn/useLightDomStyles.tjNBKcOr.js +1 -0
  14. package/cdn/usePlacement.BgMXY5CX.js +58 -0
  15. package/cdn/useReward.B530suzR.js +1 -0
  16. package/dist/GiftIcon-BIp9FTJs.js +338 -0
  17. package/dist/banner.d.ts +25 -1
  18. package/dist/banner.js +77 -45
  19. package/dist/buttonShare.js +6 -6
  20. package/dist/buttonWallet.js +2 -2
  21. package/dist/{formatReward-Bub6Z6eY.js → formatReward-Cf2KpA3x.js} +1 -1
  22. package/dist/openInApp.js +9 -26
  23. package/dist/postPurchase.d.ts +9 -1
  24. package/dist/postPurchase.js +93 -1382
  25. package/dist/{sharingPage-DFvQbviS.js → sharingPage-D6fQEXV9.js} +1 -1
  26. package/dist/useLightDomStyles-DVe5UDg6.js +48 -0
  27. package/dist/{usePlacement-V7NrKoub.js → usePlacement-DzEuVg_u.js} +7 -7
  28. package/dist/{useReward-DU3_yP8Q.js → useReward-ClVShg45.js} +1 -1
  29. package/package.json +4 -4
  30. package/cdn/Banner.BTj-CQM6.js +0 -162
  31. package/cdn/OpenInAppButton.C1Yipwka.js +0 -1
  32. package/cdn/PostPurchase.u0s94KFf.js +0 -52
  33. package/cdn/formatReward.C7mU9_cV.js +0 -1
  34. package/cdn/sharingPage.CvUkxEML.js +0 -1
  35. package/cdn/sprinkles.css.ts.vanilla.06k5OzG1.js +0 -1175
  36. package/cdn/useGlobalComponents.UJmjUUxk.js +0 -1
  37. package/cdn/useLightDomStyles.Gt7YUMDl.js +0 -1
  38. package/cdn/usePlacement.BJ7qe-pw.js +0 -58
  39. package/cdn/useReward.QsQc2c1D.js +0 -1
  40. package/dist/GiftIcon-c28NnqJ7.js +0 -1502
  41. package/dist/useLightDomStyles-gbuSWvRx.js +0 -89
  42. /package/dist/{useGlobalComponents-Cmfszr7v.js → useGlobalComponents-mSs9unyN.js} +0 -0
package/dist/openInApp.js CHANGED
@@ -1,31 +1,9 @@
1
- import { a as registerWebComponent, i as useClientReady, t as usePlacement } from "./usePlacement-V7NrKoub.js";
2
- import { t as useLightDomStyles } from "./useLightDomStyles-gbuSWvRx.js";
3
- import { DEEP_LINK_SCHEME, trackEvent, triggerDeepLinkWithFallback } from "@frak-labs/core-sdk";
1
+ import { a as registerWebComponent, i as useClientReady, t as usePlacement } from "./usePlacement-DzEuVg_u.js";
2
+ import { t as useLightDomStyles } from "./useLightDomStyles-DVe5UDg6.js";
3
+ import { DEEP_LINK_SCHEME, isMobile, trackEvent, triggerDeepLinkWithFallback } from "@frak-labs/core-sdk";
4
4
  import { useMemo } from "preact/hooks";
5
5
  import { jsx } from "preact/jsx-runtime";
6
- //#region src/utils/isMobile.ts
7
- /**
8
- * Check if the current device is a mobile device
9
- * Uses UA regex + iPad desktop mode heuristic (maxTouchPoints)
10
- *
11
- * iPadOS 13+ sends a Macintosh UA in desktop mode, so the regex alone
12
- * misses it. The maxTouchPoints check catches iPads reporting as Mac.
13
- *
14
- * @returns True if the device is mobile (iOS, Android, iPadOS, etc.)
15
- */
16
- function isMobile() {
17
- if (typeof navigator === "undefined") return false;
18
- if (/iPhone|iPad|iPod|Android|webOS|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) return true;
19
- if (/Macintosh/i.test(navigator.userAgent) && navigator.maxTouchPoints > 1) return true;
20
- return false;
21
- }
22
- //#endregion
23
- //#region src/hooks/useIsMobile.ts
24
- function useIsMobile() {
25
- return { isMobile: useMemo(() => isMobile(), []) };
26
- }
27
- //#endregion
28
- //#region src/utils/openInApp.ts
6
+ //#region src/actions/openInApp.ts
29
7
  const DEFAULT_PATH = "wallet";
30
8
  /**
31
9
  * Open the Frak Wallet mobile app via deep link with fallback detection.
@@ -48,6 +26,11 @@ function openFrakWalletApp(path = DEFAULT_PATH, placement) {
48
26
  } });
49
27
  }
50
28
  //#endregion
29
+ //#region src/hooks/useIsMobile.ts
30
+ function useIsMobile() {
31
+ return { isMobile: useMemo(() => isMobile(), []) };
32
+ }
33
+ //#endregion
51
34
  //#region src/components/OpenInAppButton/OpenInAppButton.tsx
52
35
  /**
53
36
  * Button to open the Frak Wallet mobile app via deep link
@@ -62,6 +62,13 @@ type PostPurchaseProps = {
62
62
  * Use `{REWARD}` as placeholder for the reward amount.
63
63
  */
64
64
  ctaText?: string;
65
+ /**
66
+ * Override the image displayed on the left of the post-purchase card.
67
+ * Accepts an image URL. Falls back to the built-in gift icon when omitted.
68
+ * The image is constrained to the icon slot via `object-fit: contain`,
69
+ * so any aspect ratio renders correctly.
70
+ */
71
+ imageUrl?: string;
65
72
  /**
66
73
  * Optional product cards forwarded to the sharing page when the user
67
74
  * clicks the CTA. Accepts either a real {@link SharingPageProduct}
@@ -134,7 +141,8 @@ declare function PostPurchase({
134
141
  ctaText: propCtaText,
135
142
  preview,
136
143
  previewVariant,
137
- products
144
+ products,
145
+ imageUrl
138
146
  }: PostPurchaseProps): _$preact.JSX.Element | null;
139
147
  //#endregion
140
148
  //#region src/components/PostPurchase/index.d.ts