@frak-labs/components 0.0.26-beta.1c24fe7c → 0.0.26-beta.4b98158f
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.BV0CYYyJ.js +132 -0
- package/cdn/ButtonShare.BfQyNjgk.js +1 -0
- package/cdn/{ButtonWallet.B7UmJcbb.js → ButtonWallet.DHrL4faA.js} +2 -2
- package/cdn/OpenInAppButton.BuQXYJth.js +1 -0
- package/cdn/PostPurchase.CpkvA80k.js +47 -0
- package/cdn/components.js +1 -1
- package/cdn/jsxRuntime.module.Cw8k9d3Z.js +58 -0
- package/cdn/loader.js +25 -25
- package/cdn/sprinkles.css.ts.vanilla.BKH7Z6IK.js +1175 -0
- package/cdn/useLightDomStyles.ICOW93sC.js +1 -0
- package/cdn/{useReward.DEU0AF3P.js → useReward.CtWbol8A.js} +1 -1
- package/cdn/{useShareModal.CN9_P7Sl.js → useShareModal.DBb9gEAh.js} +1 -1
- package/dist/GiftIcon-BrNVWoWm.js +1246 -0
- package/dist/banner.d.ts +54 -11
- package/dist/banner.js +306 -99
- 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 +27 -3
- package/dist/postPurchase.js +1633 -29
- 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 +10 -5
- package/cdn/Banner.D-DB7VwI.js +0 -1
- package/cdn/ButtonShare.BM9Inhmf.js +0 -1
- package/cdn/OpenInAppButton.B4mrsz6L.js +0 -1
- package/cdn/PostPurchase.CMa-59qR.js +0 -1
- package/cdn/jsxRuntime.module.5UNmmhNi.js +0 -138
- package/cdn/useLightDomStyles.D895e4W1.js +0 -1
- /package/cdn/{formatReward.C8hlSKRj.js → formatReward.DXMr8a-D.js} +0 -0
package/dist/buttonWallet.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
import { t as useReward } from "./useReward-
|
|
1
|
+
import { a as registerWebComponent, i as useClientReady, n as buildStyleContent, o as openWalletModal, t as usePlacement } from "./usePlacement-LqYjZLX_.js";
|
|
2
|
+
import { t as useReward } from "./useReward-XF2hB_C_.js";
|
|
3
3
|
import { trackEvent } from "@frak-labs/core-sdk";
|
|
4
4
|
import { useEffect, useMemo, useState } from "preact/hooks";
|
|
5
5
|
import { Fragment, jsx, jsxs } from "preact/jsx-runtime";
|
|
6
|
-
|
|
7
6
|
//#region src/components/ButtonWallet/assets/GiftIcon.tsx
|
|
8
7
|
function GiftIcon(props) {
|
|
9
8
|
return /* @__PURE__ */ jsxs("svg", {
|
|
@@ -21,7 +20,6 @@ function GiftIcon(props) {
|
|
|
21
20
|
})]
|
|
22
21
|
});
|
|
23
22
|
}
|
|
24
|
-
|
|
25
23
|
//#endregion
|
|
26
24
|
//#region src/components/ButtonWallet/ButtonWallet.tsx
|
|
27
25
|
const componentCss = `
|
|
@@ -140,7 +138,6 @@ function ButtonWallet({ placement: placementId, classname = "", useReward: rawUs
|
|
|
140
138
|
})]
|
|
141
139
|
})] });
|
|
142
140
|
}
|
|
143
|
-
|
|
144
141
|
//#endregion
|
|
145
142
|
//#region src/components/ButtonWallet/index.ts
|
|
146
143
|
registerWebComponent(ButtonWallet, "frak-button-wallet", [
|
|
@@ -149,6 +146,5 @@ registerWebComponent(ButtonWallet, "frak-button-wallet", [
|
|
|
149
146
|
"useReward",
|
|
150
147
|
"targetInteraction"
|
|
151
148
|
], { shadow: true });
|
|
152
|
-
|
|
153
149
|
//#endregion
|
|
154
|
-
export { ButtonWallet };
|
|
150
|
+
export { ButtonWallet };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { formatAmount, getCurrencyAmountKey, getSupportedCurrency } from "@frak-labs/core-sdk";
|
|
2
|
-
|
|
3
2
|
//#region src/utils/formatReward.ts
|
|
4
3
|
/**
|
|
5
4
|
* Format an {@link EstimatedReward} into a human-readable string.
|
|
@@ -23,6 +22,5 @@ function formatEstimatedReward(reward, currency, basketAmount) {
|
|
|
23
22
|
}
|
|
24
23
|
}
|
|
25
24
|
}
|
|
26
|
-
|
|
27
25
|
//#endregion
|
|
28
|
-
export { formatEstimatedReward as t };
|
|
26
|
+
export { formatEstimatedReward as t };
|
package/dist/openInApp.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as preact from "preact";
|
|
1
|
+
import * as _$preact from "preact";
|
|
2
2
|
|
|
3
3
|
//#region src/components/OpenInAppButton/types.d.ts
|
|
4
4
|
/**
|
|
@@ -49,7 +49,7 @@ declare function OpenInAppButton({
|
|
|
49
49
|
placement: placementId,
|
|
50
50
|
text,
|
|
51
51
|
classname
|
|
52
|
-
}: OpenInAppButtonProps): preact.JSX.Element | null;
|
|
52
|
+
}: OpenInAppButtonProps): _$preact.JSX.Element | null;
|
|
53
53
|
//#endregion
|
|
54
54
|
//#region src/components/OpenInAppButton/index.d.ts
|
|
55
55
|
/**
|
package/dist/openInApp.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
import { t as useLightDomStyles } from "./useLightDomStyles-
|
|
1
|
+
import { a as registerWebComponent, i as useClientReady, t as usePlacement } from "./usePlacement-LqYjZLX_.js";
|
|
2
|
+
import { t as useLightDomStyles } from "./useLightDomStyles-Cjpf0MnX.js";
|
|
3
3
|
import { DEEP_LINK_SCHEME, trackEvent, triggerDeepLinkWithFallback } from "@frak-labs/core-sdk";
|
|
4
4
|
import { useMemo } from "preact/hooks";
|
|
5
5
|
import { jsx } from "preact/jsx-runtime";
|
|
6
|
-
|
|
7
6
|
//#region src/utils/isMobile.ts
|
|
8
7
|
/**
|
|
9
8
|
* Check if the current device is a mobile device
|
|
@@ -20,13 +19,11 @@ function isMobile() {
|
|
|
20
19
|
if (/Macintosh/i.test(navigator.userAgent) && navigator.maxTouchPoints > 1) return true;
|
|
21
20
|
return false;
|
|
22
21
|
}
|
|
23
|
-
|
|
24
22
|
//#endregion
|
|
25
23
|
//#region src/hooks/useIsMobile.ts
|
|
26
24
|
function useIsMobile() {
|
|
27
25
|
return { isMobile: useMemo(() => isMobile(), []) };
|
|
28
26
|
}
|
|
29
|
-
|
|
30
27
|
//#endregion
|
|
31
28
|
//#region src/utils/openInApp.ts
|
|
32
29
|
const DEFAULT_PATH = "wallet";
|
|
@@ -46,7 +43,6 @@ function openFrakWalletApp(path = DEFAULT_PATH) {
|
|
|
46
43
|
if (client) trackEvent(client, "app_not_installed");
|
|
47
44
|
} });
|
|
48
45
|
}
|
|
49
|
-
|
|
50
46
|
//#endregion
|
|
51
47
|
//#region src/components/OpenInAppButton/OpenInAppButton.tsx
|
|
52
48
|
/**
|
|
@@ -99,7 +95,6 @@ function OpenInAppButton({ placement: placementId, text = "Open in App", classna
|
|
|
99
95
|
children: resolvedText
|
|
100
96
|
});
|
|
101
97
|
}
|
|
102
|
-
|
|
103
98
|
//#endregion
|
|
104
99
|
//#region src/components/OpenInAppButton/index.ts
|
|
105
100
|
registerWebComponent(OpenInAppButton, "frak-open-in-app", [
|
|
@@ -107,6 +102,5 @@ registerWebComponent(OpenInAppButton, "frak-open-in-app", [
|
|
|
107
102
|
"placement",
|
|
108
103
|
"classname"
|
|
109
104
|
], { shadow: false });
|
|
110
|
-
|
|
111
105
|
//#endregion
|
|
112
|
-
export { OpenInAppButton };
|
|
106
|
+
export { OpenInAppButton };
|
package/dist/postPurchase.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as preact from "preact";
|
|
1
|
+
import * as _$preact from "preact";
|
|
2
2
|
|
|
3
3
|
//#region src/components/PostPurchase/types.d.ts
|
|
4
4
|
/**
|
|
@@ -41,6 +41,26 @@ type PostPurchaseProps = {
|
|
|
41
41
|
* Force a display variant instead of relying on the backend evaluation.
|
|
42
42
|
*/
|
|
43
43
|
variant?: "referrer" | "referee";
|
|
44
|
+
/**
|
|
45
|
+
* Label for the pill badge displayed above the message.
|
|
46
|
+
* When omitted (and no placement config provides one), the badge is hidden.
|
|
47
|
+
*/
|
|
48
|
+
badgeText?: string;
|
|
49
|
+
/**
|
|
50
|
+
* Override the message shown to referrers.
|
|
51
|
+
* Use `{REWARD}` as placeholder for the reward amount.
|
|
52
|
+
*/
|
|
53
|
+
referrerText?: string;
|
|
54
|
+
/**
|
|
55
|
+
* Override the message shown to referees.
|
|
56
|
+
* Use `{REWARD}` as placeholder for the reward amount.
|
|
57
|
+
*/
|
|
58
|
+
refereeText?: string;
|
|
59
|
+
/**
|
|
60
|
+
* Override the CTA button text.
|
|
61
|
+
* Use `{REWARD}` as placeholder for the reward amount.
|
|
62
|
+
*/
|
|
63
|
+
ctaText?: string;
|
|
44
64
|
};
|
|
45
65
|
//#endregion
|
|
46
66
|
//#region src/components/PostPurchase/PostPurchase.d.ts
|
|
@@ -80,8 +100,12 @@ declare function PostPurchase({
|
|
|
80
100
|
merchantId,
|
|
81
101
|
placement: placementId,
|
|
82
102
|
classname,
|
|
83
|
-
variant: forcedVariant
|
|
84
|
-
|
|
103
|
+
variant: forcedVariant,
|
|
104
|
+
badgeText: propBadgeText,
|
|
105
|
+
referrerText: propReferrerText,
|
|
106
|
+
refereeText: propRefereeText,
|
|
107
|
+
ctaText: propCtaText
|
|
108
|
+
}: PostPurchaseProps): _$preact.JSX.Element | null;
|
|
85
109
|
//#endregion
|
|
86
110
|
//#region src/components/PostPurchase/index.d.ts
|
|
87
111
|
/**
|