@frak-labs/components 1.0.12 → 1.0.13-beta.349e6102
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.CPfY5JKI.js +183 -0
- package/cdn/ButtonShare.DMwS3SV_.js +1 -0
- package/cdn/ButtonWallet.BCkfhtjS.js +40 -0
- package/cdn/{GiftIcon.DT1i36Fm.js → GiftIcon.S_PCRRWc.js} +1 -1
- package/cdn/OpenInAppButton.CzfepCTf.js +1 -0
- package/cdn/PostPurchase.C5s1IFlL.js +89 -0
- package/cdn/actions-C2MhMidX.DwPAFQBK.js +1 -0
- package/cdn/clientReady.CnuMZs-Q.js +11 -0
- package/cdn/components.js +1 -1
- package/cdn/defaults.8QO14l_n.js +58 -0
- package/cdn/embeddedWallet.GFBOECmv.js +1 -0
- package/cdn/loader.js +1 -154
- package/cdn/replay-V6FXES7X.CgBxdfNp.js +1 -0
- package/cdn/rewards.C5fLEHQ9.js +1 -0
- package/cdn/sharedBaseCss.css.BDzFcWnD.js +154 -0
- package/cdn/sharingPage.yTFaTklh.js +1 -0
- package/cdn/sharingPageProducts.DwoFd3Rz.js +1 -0
- package/cdn/styleManager.Cun1-fKi.js +1 -0
- package/cdn/useGlobalComponents.Chb50YVY.js +1 -0
- package/cdn/useLightDomStyles.w1gAoBeL.js +1 -0
- package/cdn/useReward.D4ldCSt1.js +1 -0
- package/dist/{GiftIcon-BEzYdiux.js → GiftIcon-BhL0bhVu.js} +10 -4
- package/dist/banner.d.ts +1 -16
- package/dist/banner.js +24 -8
- package/dist/buttonShare.d.ts +3 -11
- package/dist/buttonShare.js +6 -6
- package/dist/buttonWallet.d.ts +1 -7
- package/dist/buttonWallet.js +3 -3
- package/dist/i18n/defaults.d.ts +3 -2
- package/dist/i18n/defaults.js +5 -5
- package/dist/openInApp.d.ts +1 -5
- package/dist/openInApp.js +2 -2
- package/dist/postPurchase.d.ts +1 -19
- package/dist/postPurchase.js +5 -5
- package/dist/{rewards-VoZGH2Ko.js → rewards-BtPHdGcI.js} +4 -3
- package/dist/{useGlobalComponents-CZ7Sh2tZ.js → useGlobalComponents-Da9LDlRy.js} +1 -1
- package/dist/{useLightDomStyles-DphuQhvx.js → useLightDomStyles-DRkTVy4s.js} +1 -1
- package/dist/{usePlacement-4PoDbn2X.js → usePlacement-NZOjZ6IR.js} +6 -14
- package/dist/{useReward-BGgymGoH.js → useReward-B-yZ7nhY.js} +1 -1
- package/package.json +21 -20
- package/cdn/Banner.CgCiMrqn.js +0 -167
- package/cdn/ButtonShare.BiOpzkRY.js +0 -1
- package/cdn/ButtonWallet.Mmrku6ws.js +0 -40
- package/cdn/OpenInAppButton.D1UzTuHx.js +0 -1
- package/cdn/PostPurchase.Cvx1TI64.js +0 -89
- package/cdn/defaults.kWEdCyGS.js +0 -58
- package/cdn/embeddedWallet.BS-9u4Be.js +0 -1
- package/cdn/replay-V6FXES7X.BoL9fAjx.js +0 -1
- package/cdn/rewards.CIu9qbmI.js +0 -1
- package/cdn/useGlobalComponents.BC6Jgzg5.js +0 -1
- package/cdn/useLightDomStyles.imPXuAtf.js +0 -1
- package/cdn/useReward.BAmvPaVu.js +0 -1
- /package/dist/{embeddedWallet-By3_p5Xc.js → embeddedWallet-CxgyuwtP.js} +0 -0
package/dist/banner.js
CHANGED
|
@@ -1,16 +1,32 @@
|
|
|
1
|
-
import { i as useLang, o as useClientReady, s as registerWebComponent, t as usePlacement } from "./usePlacement-
|
|
2
|
-
import { t as useGlobalComponents } from "./useGlobalComponents-
|
|
3
|
-
import { t as useLightDomStyles } from "./useLightDomStyles-
|
|
4
|
-
import { r as b } from "./rewards-
|
|
5
|
-
import { t as useReward } from "./useReward-
|
|
1
|
+
import { i as useLang, o as useClientReady, s as registerWebComponent, t as usePlacement } from "./usePlacement-NZOjZ6IR.js";
|
|
2
|
+
import { t as useGlobalComponents } from "./useGlobalComponents-Da9LDlRy.js";
|
|
3
|
+
import { t as useLightDomStyles } from "./useLightDomStyles-DRkTVy4s.js";
|
|
4
|
+
import { r as b } from "./rewards-BtPHdGcI.js";
|
|
5
|
+
import { t as useReward } from "./useReward-B-yZ7nhY.js";
|
|
6
6
|
import { componentDefaults } from "./i18n/defaults.js";
|
|
7
|
-
import { a as ExternalLinkIcon, i as LogoFrakWithName, n as cssSource$5, o as CloseCircleIcon, r as WarningIcon, t as GiftIcon } from "./GiftIcon-
|
|
7
|
+
import { a as ExternalLinkIcon, i as LogoFrakWithName, n as cssSource$5, o as CloseCircleIcon, r as WarningIcon, t as GiftIcon } from "./GiftIcon-BhL0bhVu.js";
|
|
8
8
|
import { isInAppBrowser, redirectToExternalBrowser, trackEvent } from "@frak-labs/core-sdk";
|
|
9
9
|
import { REFERRAL_SUCCESS_EVENT, getMergeToken } from "@frak-labs/core-sdk/actions";
|
|
10
10
|
import { useCallback, useEffect, useMemo, useRef, useState } from "preact/hooks";
|
|
11
11
|
import { jsx, jsxs } from "preact/jsx-runtime";
|
|
12
12
|
//#region \0ve-inline:../../packages/design-system/src/keyframes.css.ts.vanilla.js
|
|
13
13
|
const cssSource$4 = `@keyframes keyframes_fadeIn__mnqmlt0 {
|
|
14
|
+
from {
|
|
15
|
+
opacity: 0;
|
|
16
|
+
}
|
|
17
|
+
to {
|
|
18
|
+
opacity: 1;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
@keyframes keyframes_fadeOut__mnqmlt1 {
|
|
22
|
+
from {
|
|
23
|
+
opacity: 1;
|
|
24
|
+
}
|
|
25
|
+
to {
|
|
26
|
+
opacity: 0;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
@keyframes keyframes_fadeInDown__mnqmlt2 {
|
|
14
30
|
from {
|
|
15
31
|
opacity: 0;
|
|
16
32
|
transform: translateY(-4px);
|
|
@@ -38,7 +54,7 @@ const cssSource$3 = `.inAppBanner_container__1ibpiy70 {
|
|
|
38
54
|
backdrop-filter: blur(12px);
|
|
39
55
|
-webkit-backdrop-filter: blur(12px);
|
|
40
56
|
color: var(--text-onAction__pbq4ak6);
|
|
41
|
-
animation:
|
|
57
|
+
animation: keyframes_fadeInDown__mnqmlt2 300ms ease-out;
|
|
42
58
|
}
|
|
43
59
|
.inAppBanner_header__1ibpiy71 {
|
|
44
60
|
display: flex;
|
|
@@ -175,7 +191,7 @@ function InAppBanner({ title: title$1, description: description$1, cta: cta$1, d
|
|
|
175
191
|
const cssSource$1 = `.Banner_rootBase__1gnumzi0 {
|
|
176
192
|
position: relative;
|
|
177
193
|
display: flex;
|
|
178
|
-
animation:
|
|
194
|
+
animation: keyframes_fadeInDown__mnqmlt2 300ms ease-out;
|
|
179
195
|
}
|
|
180
196
|
.Banner_iconSvg__1gnumzi1 {
|
|
181
197
|
width: 100%;
|
package/dist/buttonShare.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { InteractionTypeKey } from "@frak-labs/core-sdk";
|
|
2
|
-
|
|
3
2
|
//#region src/components/ButtonShare/types.d.ts
|
|
4
3
|
/**
|
|
5
4
|
* The props type for {@link ButtonShare}.
|
|
@@ -17,7 +16,8 @@ type ButtonShareProps = {
|
|
|
17
16
|
* stripped if no fallback is provided).
|
|
18
17
|
*
|
|
19
18
|
* When omitted, a built-in localized default is used based on the
|
|
20
|
-
* resolved language (`"Share
|
|
19
|
+
* resolved language (`"Share & earn {REWARD}!"` / `"Partagez et gagnez
|
|
20
|
+
* {REWARD} !"`) — mirroring the dashboard's first wording preset.
|
|
21
21
|
*/
|
|
22
22
|
text?: string;
|
|
23
23
|
/**
|
|
@@ -97,15 +97,7 @@ type ButtonShareProps = {
|
|
|
97
97
|
* @see {@link @frak-labs/core-sdk!actions.displaySharingPage | `displaySharingPage()`} for more info about the sharing-page flow
|
|
98
98
|
* @see {@link @frak-labs/core-sdk!actions.getMerchantInformation | `getMerchantInformation()`} for more info about the estimated reward fetching
|
|
99
99
|
*/
|
|
100
|
-
declare function ButtonShare({
|
|
101
|
-
placement: placementId,
|
|
102
|
-
text,
|
|
103
|
-
classname,
|
|
104
|
-
noRewardText,
|
|
105
|
-
targetInteraction,
|
|
106
|
-
clickAction: rawClickAction,
|
|
107
|
-
preview
|
|
108
|
-
}: ButtonShareProps): import("preact").JSX.Element | null;
|
|
100
|
+
declare function ButtonShare({ placement: placementId, text, classname, noRewardText, targetInteraction, clickAction: rawClickAction, preview }: ButtonShareProps): import("preact").JSX.Element | null;
|
|
109
101
|
//#endregion
|
|
110
102
|
//#region src/components/ButtonShare/index.d.ts
|
|
111
103
|
/**
|
package/dist/buttonShare.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { i as useLang, l as openSharingPage, o as useClientReady, s as registerWebComponent, t as usePlacement } from "./usePlacement-
|
|
2
|
-
import { t as openEmbeddedWallet } from "./embeddedWallet-
|
|
3
|
-
import { t as useGlobalComponents } from "./useGlobalComponents-
|
|
4
|
-
import { t as useLightDomStyles } from "./useLightDomStyles-
|
|
5
|
-
import { r as b } from "./rewards-
|
|
6
|
-
import { t as useReward } from "./useReward-
|
|
1
|
+
import { i as useLang, l as openSharingPage, o as useClientReady, s as registerWebComponent, t as usePlacement } from "./usePlacement-NZOjZ6IR.js";
|
|
2
|
+
import { t as openEmbeddedWallet } from "./embeddedWallet-CxgyuwtP.js";
|
|
3
|
+
import { t as useGlobalComponents } from "./useGlobalComponents-Da9LDlRy.js";
|
|
4
|
+
import { t as useLightDomStyles } from "./useLightDomStyles-DRkTVy4s.js";
|
|
5
|
+
import { r as b } from "./rewards-BtPHdGcI.js";
|
|
6
|
+
import { t as useReward } from "./useReward-B-yZ7nhY.js";
|
|
7
7
|
import { componentDefaults } from "./i18n/defaults.js";
|
|
8
8
|
import { trackEvent } from "@frak-labs/core-sdk";
|
|
9
9
|
import { useCallback, useMemo } from "preact/hooks";
|
package/dist/buttonWallet.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { InteractionTypeKey } from "@frak-labs/core-sdk";
|
|
2
|
-
|
|
3
2
|
//#region src/components/ButtonWallet/types.d.ts
|
|
4
3
|
/**
|
|
5
4
|
* The props type for {@link ButtonWallet}.
|
|
@@ -64,12 +63,7 @@ type ButtonWalletProps = {
|
|
|
64
63
|
* @see {@link @frak-labs/core-sdk!actions.modalBuilder | `modalBuilder()`} for more info about the modal display
|
|
65
64
|
* @see {@link @frak-labs/core-sdk!actions.getMerchantInformation | `getMerchantInformation()`} for more info about the estimated reward fetching
|
|
66
65
|
*/
|
|
67
|
-
declare function ButtonWallet({
|
|
68
|
-
placement: placementId,
|
|
69
|
-
classname,
|
|
70
|
-
useReward: rawUseReward,
|
|
71
|
-
targetInteraction
|
|
72
|
-
}: ButtonWalletProps): import("preact").JSX.Element | null;
|
|
66
|
+
declare function ButtonWallet({ placement: placementId, classname, useReward: rawUseReward, targetInteraction }: ButtonWalletProps): import("preact").JSX.Element | null;
|
|
73
67
|
//#endregion
|
|
74
68
|
//#region src/components/ButtonWallet/index.d.ts
|
|
75
69
|
/**
|
package/dist/buttonWallet.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { i as useLang, n as buildStyleContent, o as useClientReady, s as registerWebComponent, t as usePlacement } from "./usePlacement-
|
|
2
|
-
import { t as openEmbeddedWallet } from "./embeddedWallet-
|
|
3
|
-
import { t as useReward } from "./useReward-
|
|
1
|
+
import { i as useLang, n as buildStyleContent, o as useClientReady, s as registerWebComponent, t as usePlacement } from "./usePlacement-NZOjZ6IR.js";
|
|
2
|
+
import { t as openEmbeddedWallet } from "./embeddedWallet-CxgyuwtP.js";
|
|
3
|
+
import { t as useReward } from "./useReward-B-yZ7nhY.js";
|
|
4
4
|
import { componentDefaults } from "./i18n/defaults.js";
|
|
5
5
|
import { useEffect, useMemo, useState } from "preact/hooks";
|
|
6
6
|
import { Fragment, jsx, jsxs } from "preact/jsx-runtime";
|
package/dist/i18n/defaults.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Language } from "@frak-labs/core-sdk";
|
|
2
|
-
|
|
3
2
|
//#region src/i18n/defaults.d.ts
|
|
4
3
|
/**
|
|
5
4
|
* Shape of the built-in copy for every SDK Web Component. Declared explicitly
|
|
@@ -26,7 +25,9 @@ type ComponentCopy = {
|
|
|
26
25
|
ariaLabel: string;
|
|
27
26
|
};
|
|
28
27
|
banner: {
|
|
29
|
-
/** Referral title used when an estimated reward is available (carries the `{REWARD}` token). */
|
|
28
|
+
/** Referral title used when an estimated reward is available (carries the `{REWARD}` token). */
|
|
29
|
+
referralTitleReward: string;
|
|
30
|
+
/** Referral title used when no reward could be resolved. */
|
|
30
31
|
referralTitle: string;
|
|
31
32
|
referralDescription: string;
|
|
32
33
|
referralCta: string;
|
package/dist/i18n/defaults.js
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
*/
|
|
15
15
|
const componentDefaults = {
|
|
16
16
|
en: {
|
|
17
|
-
buttonShare: { text: "Share
|
|
17
|
+
buttonShare: { text: "Share & earn {REWARD}!" },
|
|
18
18
|
postPurchase: {
|
|
19
19
|
refereeText: "You just earned {REWARD}! Share with friends to earn even more.",
|
|
20
20
|
refereeNoRewardText: "You just earned a reward! Share with friends to earn even more.",
|
|
@@ -29,7 +29,7 @@ const componentDefaults = {
|
|
|
29
29
|
},
|
|
30
30
|
buttonWallet: { ariaLabel: "Open wallet" },
|
|
31
31
|
banner: {
|
|
32
|
-
referralTitleReward: "Earn {REWARD} on purchases
|
|
32
|
+
referralTitleReward: "Earn {REWARD} on purchases",
|
|
33
33
|
referralTitle: "You've been referred!",
|
|
34
34
|
referralDescription: "Earn rewards after your purchase via the Frak partner app.",
|
|
35
35
|
referralCta: "Got it",
|
|
@@ -40,7 +40,7 @@ const componentDefaults = {
|
|
|
40
40
|
}
|
|
41
41
|
},
|
|
42
42
|
fr: {
|
|
43
|
-
buttonShare: { text: "Partagez et gagnez !" },
|
|
43
|
+
buttonShare: { text: "Partagez et gagnez {REWARD} !" },
|
|
44
44
|
postPurchase: {
|
|
45
45
|
refereeText: "Vous venez de gagner {REWARD} ! Partagez avec vos amis pour gagner encore plus.",
|
|
46
46
|
refereeNoRewardText: "Vous venez de gagner une récompense ! Partagez avec vos amis pour gagner encore plus.",
|
|
@@ -53,9 +53,9 @@ const componentDefaults = {
|
|
|
53
53
|
text: "Ouvrir dans l'app",
|
|
54
54
|
ariaLabel: "Ouvrir dans l'app Frak Wallet"
|
|
55
55
|
},
|
|
56
|
-
buttonWallet: { ariaLabel: "Ouvrir le
|
|
56
|
+
buttonWallet: { ariaLabel: "Ouvrir le porte-monnaie" },
|
|
57
57
|
banner: {
|
|
58
|
-
referralTitleReward: "Gagnez {REWARD} sur vos achats
|
|
58
|
+
referralTitleReward: "Gagnez {REWARD} sur vos achats",
|
|
59
59
|
referralTitle: "Vous avez été parrainé !",
|
|
60
60
|
referralDescription: "Gagnez des récompenses après votre achat via l'application partenaire Frak.",
|
|
61
61
|
referralCta: "J'ai compris",
|
package/dist/openInApp.d.ts
CHANGED
|
@@ -45,11 +45,7 @@ type OpenInAppButtonProps = {
|
|
|
45
45
|
* <frak-open-in-app classname="button button-primary"></frak-open-in-app>
|
|
46
46
|
* ```
|
|
47
47
|
*/
|
|
48
|
-
declare function OpenInAppButton({
|
|
49
|
-
placement: placementId,
|
|
50
|
-
text,
|
|
51
|
-
classname
|
|
52
|
-
}: OpenInAppButtonProps): import("preact").JSX.Element | null;
|
|
48
|
+
declare function OpenInAppButton({ placement: placementId, text, classname }: OpenInAppButtonProps): import("preact").JSX.Element | null;
|
|
53
49
|
//#endregion
|
|
54
50
|
//#region src/components/OpenInAppButton/index.d.ts
|
|
55
51
|
/**
|
package/dist/openInApp.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { i as useLang, o as useClientReady, s as registerWebComponent, t as usePlacement } from "./usePlacement-
|
|
2
|
-
import { t as useLightDomStyles } from "./useLightDomStyles-
|
|
1
|
+
import { i as useLang, o as useClientReady, s as registerWebComponent, t as usePlacement } from "./usePlacement-NZOjZ6IR.js";
|
|
2
|
+
import { t as useLightDomStyles } from "./useLightDomStyles-DRkTVy4s.js";
|
|
3
3
|
import { componentDefaults } from "./i18n/defaults.js";
|
|
4
4
|
import { DEEP_LINK_SCHEME, isMobile, trackEvent, triggerDeepLinkWithFallback } from "@frak-labs/core-sdk";
|
|
5
5
|
import { useMemo } from "preact/hooks";
|
package/dist/postPurchase.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { SharingPageProduct } from "@frak-labs/core-sdk";
|
|
2
|
-
|
|
3
2
|
//#region src/components/PostPurchase/types.d.ts
|
|
4
3
|
/**
|
|
5
4
|
* Props for the {@link PostPurchase} component.
|
|
@@ -125,24 +124,7 @@ type PostPurchaseProps = {
|
|
|
125
124
|
* ></frak-post-purchase>
|
|
126
125
|
* ```
|
|
127
126
|
*/
|
|
128
|
-
declare function PostPurchase({
|
|
129
|
-
customerId,
|
|
130
|
-
orderId,
|
|
131
|
-
token,
|
|
132
|
-
sharingUrl,
|
|
133
|
-
merchantId,
|
|
134
|
-
placement: placementId,
|
|
135
|
-
classname,
|
|
136
|
-
variant: forcedVariant,
|
|
137
|
-
badgeText: propBadgeText,
|
|
138
|
-
referrerText: propReferrerText,
|
|
139
|
-
refereeText: propRefereeText,
|
|
140
|
-
ctaText: propCtaText,
|
|
141
|
-
preview,
|
|
142
|
-
previewVariant,
|
|
143
|
-
products,
|
|
144
|
-
imageUrl: propImageUrl
|
|
145
|
-
}: PostPurchaseProps): import("preact").JSX.Element | null;
|
|
127
|
+
declare function PostPurchase({ customerId, orderId, token, sharingUrl, merchantId, placement: placementId, classname, variant: forcedVariant, badgeText: propBadgeText, referrerText: propReferrerText, refereeText: propRefereeText, ctaText: propCtaText, preview, previewVariant, products, imageUrl: propImageUrl }: PostPurchaseProps): import("preact").JSX.Element | null;
|
|
146
128
|
//#endregion
|
|
147
129
|
//#region src/components/PostPurchase/index.d.ts
|
|
148
130
|
/**
|
package/dist/postPurchase.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { c as sanitizeProductList, i as useLang, l as openSharingPage, o as useClientReady, s as registerWebComponent, t as usePlacement } from "./usePlacement-
|
|
2
|
-
import { t as useGlobalComponents } from "./useGlobalComponents-
|
|
3
|
-
import { t as useLightDomStyles } from "./useLightDomStyles-
|
|
4
|
-
import { i as y, n as T, r as b } from "./rewards-
|
|
1
|
+
import { c as sanitizeProductList, i as useLang, l as openSharingPage, o as useClientReady, s as registerWebComponent, t as usePlacement } from "./usePlacement-NZOjZ6IR.js";
|
|
2
|
+
import { t as useGlobalComponents } from "./useGlobalComponents-Da9LDlRy.js";
|
|
3
|
+
import { t as useLightDomStyles } from "./useLightDomStyles-DRkTVy4s.js";
|
|
4
|
+
import { i as y, n as T, r as b } from "./rewards-BtPHdGcI.js";
|
|
5
5
|
import { componentDefaults } from "./i18n/defaults.js";
|
|
6
|
-
import { i as LogoFrakWithName, n as cssSource$2, t as GiftIcon } from "./GiftIcon-
|
|
6
|
+
import { i as LogoFrakWithName, n as cssSource$2, t as GiftIcon } from "./GiftIcon-BhL0bhVu.js";
|
|
7
7
|
import { trackEvent } from "@frak-labs/core-sdk";
|
|
8
8
|
import { getMerchantInformation, getUserReferralStatus, trackPurchaseStatus } from "@frak-labs/core-sdk/actions";
|
|
9
9
|
import { useCallback, useEffect, useMemo, useRef, useState } from "preact/hooks";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//#region ../core/dist/getCurrencyAmountKey-
|
|
1
|
+
//#region ../core/dist/getCurrencyAmountKey-C-1W-BRg.js
|
|
2
2
|
const e = {
|
|
3
3
|
eur: `fr-FR`,
|
|
4
4
|
usd: `en-US`,
|
|
@@ -48,11 +48,12 @@ function a(e, t, n) {
|
|
|
48
48
|
}
|
|
49
49
|
return o;
|
|
50
50
|
}
|
|
51
|
-
const o = new Set([
|
|
51
|
+
const o = /* @__PURE__ */ new Set([
|
|
52
52
|
`gt`,
|
|
53
53
|
`gte`,
|
|
54
54
|
`between`
|
|
55
|
-
])
|
|
55
|
+
]);
|
|
56
|
+
const s = /* @__PURE__ */ new Set([`gt`, `gte`]);
|
|
56
57
|
function c(e) {
|
|
57
58
|
let t = a(e, `purchase.amount`, o);
|
|
58
59
|
return t.length > 0 ? Math.min(...t) : void 0;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as subscribeSdkConfig } from "./usePlacement-
|
|
1
|
+
import { a as subscribeSdkConfig } from "./usePlacement-NZOjZ6IR.js";
|
|
2
2
|
import { sdkConfigStore } from "@frak-labs/core-sdk";
|
|
3
3
|
import { useSyncExternalStore } from "preact/compat";
|
|
4
4
|
//#region src/hooks/useGlobalComponents.ts
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import register from "preact-custom-element";
|
|
2
2
|
import * as coreSdkIndex from "@frak-labs/core-sdk";
|
|
3
|
-
import { decompressJsonFromB64, deleteQueryParamCaseInsensitive, getQueryParamCaseInsensitive, sdkConfigStore, setupClient, trackEvent, withCache } from "@frak-labs/core-sdk";
|
|
3
|
+
import { decompressJsonFromB64, deleteQueryParamCaseInsensitive, detectPageLanguage, getQueryParamCaseInsensitive, sdkConfigStore, setupClient, trackEvent, withCache } from "@frak-labs/core-sdk";
|
|
4
4
|
import * as coreSdkActions from "@frak-labs/core-sdk/actions";
|
|
5
5
|
import { displaySharingPage } from "@frak-labs/core-sdk/actions";
|
|
6
6
|
import { useCallback, useEffect, useState } from "preact/hooks";
|
|
@@ -365,24 +365,16 @@ function subscribeSdkConfig(onStoreChange) {
|
|
|
365
365
|
//#endregion
|
|
366
366
|
//#region src/hooks/useLang.ts
|
|
367
367
|
/**
|
|
368
|
-
* Detect a supported language from the browser, defaulting to English.
|
|
369
|
-
* Only `en` / `fr` are recognised — anything else falls back to `en`.
|
|
370
|
-
*/
|
|
371
|
-
function detectBrowserLang() {
|
|
372
|
-
if (typeof navigator === "undefined") return "en";
|
|
373
|
-
return navigator.language?.split("-")[0] === "fr" ? "fr" : "en";
|
|
374
|
-
}
|
|
375
|
-
/**
|
|
376
368
|
* Resolve the active display language for the Web Components.
|
|
377
369
|
*
|
|
378
370
|
* Precedence: resolved SDK/backend config `lang` (driven by `metadata.lang`
|
|
379
|
-
* or the backend `/resolve` response) →
|
|
380
|
-
* `useSyncExternalStore` with a bare-string
|
|
381
|
-
* dispatch only re-renders the component when
|
|
382
|
-
* changes (see `@/i18n/defaults`).
|
|
371
|
+
* or the backend `/resolve` response) → page `<html lang>` → browser
|
|
372
|
+
* language → `en`. Backed by `useSyncExternalStore` with a bare-string
|
|
373
|
+
* snapshot, so a `frak:config` dispatch only re-renders the component when
|
|
374
|
+
* the resolved language actually changes (see `@/i18n/defaults`).
|
|
383
375
|
*/
|
|
384
376
|
function useLang() {
|
|
385
|
-
return useSyncExternalStore(subscribeSdkConfig, () => sdkConfigStore.getConfig().lang ??
|
|
377
|
+
return useSyncExternalStore(subscribeSdkConfig, () => sdkConfigStore.getConfig().lang ?? detectPageLanguage() ?? "en");
|
|
386
378
|
}
|
|
387
379
|
//#endregion
|
|
388
380
|
//#region src/styles/sharedCss.ts
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"url": "https://twitter.com/QNivelais"
|
|
12
12
|
}
|
|
13
13
|
],
|
|
14
|
-
"version": "1.0.
|
|
14
|
+
"version": "1.0.13-beta.349e6102",
|
|
15
15
|
"description": "Frak Wallet components, helping any person to interact with the Frak wallet.",
|
|
16
16
|
"repository": {
|
|
17
17
|
"url": "https://github.com/frak-id/wallet",
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
"clean": "rimraf cdn dist",
|
|
85
85
|
"build": "tsdown",
|
|
86
86
|
"build:watch": "tsdown --watch",
|
|
87
|
-
"typecheck": "
|
|
87
|
+
"typecheck": "tsc --noEmit",
|
|
88
88
|
"test": "vitest",
|
|
89
89
|
"test:ui": "vitest --ui",
|
|
90
90
|
"test:coverage": "vitest --coverage",
|
|
@@ -92,31 +92,32 @@
|
|
|
92
92
|
"publish": "echo 'Publishing components...'"
|
|
93
93
|
},
|
|
94
94
|
"dependencies": {
|
|
95
|
-
"@frak-labs/core-sdk": "1.2.
|
|
96
|
-
"@frak-labs/
|
|
97
|
-
"
|
|
98
|
-
"preact
|
|
99
|
-
"
|
|
95
|
+
"@frak-labs/core-sdk": "1.2.1-beta.349e6102",
|
|
96
|
+
"@frak-labs/design-system": "0.0.0",
|
|
97
|
+
"@frak-labs/frame-connector": "0.2.0-beta.349e6102",
|
|
98
|
+
"preact": "^10.29.7",
|
|
99
|
+
"preact-custom-element": "^4.6.0"
|
|
100
100
|
},
|
|
101
101
|
"devDependencies": {
|
|
102
102
|
"@frak-labs/test-foundation": "0.1.0",
|
|
103
|
-
"@preact/preset-vite": "^2.10.
|
|
103
|
+
"@preact/preset-vite": "^2.10.6",
|
|
104
104
|
"@rolldown/plugin-node-polyfills": "^1.0.3",
|
|
105
|
-
"@testing-library/jest-dom": "^
|
|
105
|
+
"@testing-library/jest-dom": "^7.0.0",
|
|
106
106
|
"@testing-library/preact": "^3.2.4",
|
|
107
107
|
"@testing-library/user-event": "^14.6.1",
|
|
108
|
-
"@types/jsdom": "^28.0.
|
|
109
|
-
"@types/node": "^25.
|
|
108
|
+
"@types/jsdom": "^28.0.3",
|
|
109
|
+
"@types/node": "^25.9.5",
|
|
110
110
|
"@types/preact-custom-element": "^4.0.4",
|
|
111
|
-
"@
|
|
111
|
+
"@typescript/native": "npm:typescript@^7.0.2",
|
|
112
|
+
"@vanilla-extract/css": "^1.21.2",
|
|
112
113
|
"@vanilla-extract/integration": "^8.0.10",
|
|
113
|
-
"@vanilla-extract/
|
|
114
|
-
"@vanilla-extract/
|
|
115
|
-
"@vitest/coverage-v8": "^4.1.
|
|
116
|
-
"@vitest/ui": "^4.1.
|
|
117
|
-
"jsdom": "^29.
|
|
118
|
-
"tsdown": "^0.22.
|
|
119
|
-
"typescript": "^6.0.
|
|
120
|
-
"vitest": "^4.1.
|
|
114
|
+
"@vanilla-extract/sprinkles": "^1.7.0",
|
|
115
|
+
"@vanilla-extract/vite-plugin": "^5.2.6",
|
|
116
|
+
"@vitest/coverage-v8": "^4.1.10",
|
|
117
|
+
"@vitest/ui": "^4.1.10",
|
|
118
|
+
"jsdom": "^29.1.1",
|
|
119
|
+
"tsdown": "^0.22.14",
|
|
120
|
+
"typescript": "^6.0.3",
|
|
121
|
+
"vitest": "^4.1.10"
|
|
121
122
|
}
|
|
122
123
|
}
|
package/cdn/Banner.CgCiMrqn.js
DELETED
|
@@ -1,167 +0,0 @@
|
|
|
1
|
-
import{T as e,b as t,f as n,h as r,s as i,u as a}from"./loader.js";import{a as o,d as s,f as c,h as l,l as u,m as d,n as ee,p as f,s as te,t as p,u as m}from"./defaults.kWEdCyGS.js";import{a as h,i as g,n as _,r as v,t as y}from"./GiftIcon.DT1i36Fm.js";import{t as b}from"./useGlobalComponents.BC6Jgzg5.js";import{t as ne}from"./useLightDomStyles.imPXuAtf.js";import{r as x}from"./rewards.CIu9qbmI.js";import{t as re}from"./useReward.BAmvPaVu.js";const S=`@keyframes keyframes_fadeIn__mnqmlt0 {
|
|
2
|
-
from {
|
|
3
|
-
opacity: 0;
|
|
4
|
-
transform: translateY(-4px);
|
|
5
|
-
}
|
|
6
|
-
to {
|
|
7
|
-
opacity: 1;
|
|
8
|
-
transform: translateY(0);
|
|
9
|
-
}
|
|
10
|
-
}`,C=`.inAppBanner_container__1ibpiy70 {
|
|
11
|
-
position: fixed;
|
|
12
|
-
top: max(8px, env(safe-area-inset-top));
|
|
13
|
-
left: 16px;
|
|
14
|
-
right: 16px;
|
|
15
|
-
z-index: 1000;
|
|
16
|
-
display: flex;
|
|
17
|
-
flex-direction: column;
|
|
18
|
-
gap: 4px;
|
|
19
|
-
padding: 12px 16px;
|
|
20
|
-
padding-right: 32px;
|
|
21
|
-
border-radius: 12px;
|
|
22
|
-
background-color: #000000cc;
|
|
23
|
-
backdrop-filter: blur(12px);
|
|
24
|
-
-webkit-backdrop-filter: blur(12px);
|
|
25
|
-
color: var(--text-onAction__pbq4ak6);
|
|
26
|
-
animation: keyframes_fadeIn__mnqmlt0 300ms ease-out;
|
|
27
|
-
}
|
|
28
|
-
.inAppBanner_header__1ibpiy71 {
|
|
29
|
-
display: flex;
|
|
30
|
-
align-items: center;
|
|
31
|
-
gap: 8px;
|
|
32
|
-
}
|
|
33
|
-
.inAppBanner_iconWrapper__1ibpiy72 {
|
|
34
|
-
flex-shrink: 0;
|
|
35
|
-
width: 20px;
|
|
36
|
-
height: 20px;
|
|
37
|
-
display: flex;
|
|
38
|
-
align-items: center;
|
|
39
|
-
justify-content: center;
|
|
40
|
-
color: var(--text-onAction__pbq4ak6);
|
|
41
|
-
}
|
|
42
|
-
.inAppBanner_title__1ibpiy73 {
|
|
43
|
-
margin: 0;
|
|
44
|
-
padding: 0;
|
|
45
|
-
font-size: 16px;
|
|
46
|
-
font-weight: 500;
|
|
47
|
-
line-height: 26px;
|
|
48
|
-
color: var(--text-onAction__pbq4ak6);
|
|
49
|
-
}
|
|
50
|
-
.inAppBanner_body__1ibpiy74 {
|
|
51
|
-
display: flex;
|
|
52
|
-
flex-wrap: wrap;
|
|
53
|
-
align-items: baseline;
|
|
54
|
-
gap: 0 4px;
|
|
55
|
-
}
|
|
56
|
-
.inAppBanner_description__1ibpiy75 {
|
|
57
|
-
margin: 0;
|
|
58
|
-
padding: 0;
|
|
59
|
-
font-size: 14px;
|
|
60
|
-
color: var(--text-onAction__pbq4ak6);
|
|
61
|
-
line-height: 22px;
|
|
62
|
-
opacity: 0.96;
|
|
63
|
-
}
|
|
64
|
-
.inAppBanner_cta__1ibpiy76 {
|
|
65
|
-
all: unset;
|
|
66
|
-
display: inline-flex;
|
|
67
|
-
align-items: center;
|
|
68
|
-
gap: 4px;
|
|
69
|
-
color: #2bb2ff;
|
|
70
|
-
font-size: 14px;
|
|
71
|
-
font-weight: 600;
|
|
72
|
-
text-decoration: underline;
|
|
73
|
-
text-underline-offset: 2px;
|
|
74
|
-
cursor: pointer;
|
|
75
|
-
}
|
|
76
|
-
.inAppBanner_cta__1ibpiy76:focus-visible {
|
|
77
|
-
outline: 2px solid #2bb2ff;
|
|
78
|
-
outline-offset: 2px;
|
|
79
|
-
border-radius: 4px;
|
|
80
|
-
}
|
|
81
|
-
.inAppBanner_closeButton__1ibpiy77 {
|
|
82
|
-
all: unset;
|
|
83
|
-
position: absolute;
|
|
84
|
-
top: 8px;
|
|
85
|
-
right: 8px;
|
|
86
|
-
width: 28px;
|
|
87
|
-
height: 28px;
|
|
88
|
-
display: flex;
|
|
89
|
-
align-items: center;
|
|
90
|
-
justify-content: center;
|
|
91
|
-
border-radius: 9999px;
|
|
92
|
-
color: #ffffff99;
|
|
93
|
-
cursor: pointer;
|
|
94
|
-
}
|
|
95
|
-
.inAppBanner_closeButton__1ibpiy77:focus-visible {
|
|
96
|
-
outline: 2px solid var(--text-onAction__pbq4ak6);
|
|
97
|
-
outline-offset: 2px;
|
|
98
|
-
}`;var w=`inAppBanner_body__1ibpiy74`,T=`inAppBanner_closeButton__1ibpiy77`,E=`inAppBanner_container__1ibpiy70`,D=`inAppBanner_cta__1ibpiy76`,O=`inAppBanner_description__1ibpiy75`,k=`inAppBanner_header__1ibpiy71`,A=`inAppBanner_iconWrapper__1ibpiy72`,j=`inAppBanner_title__1ibpiy73`;S+C;function M({title:e,description:t,cta:n,dismissLabel:r,onAction:i,onDismiss:a,className:o,classNames:s}){return d(`div`,{className:`${E}${o?` ${o}`:``}`,role:`alert`,children:[d(`div`,{className:k,children:[d(`span`,{className:`${A}${s?.icon?` ${s.icon}`:``}`,children:d(_,{width:20,height:20})}),d(`p`,{className:`${j}${s?.title?` ${s.title}`:``}`,children:e})]}),d(`div`,{className:w,children:[d(`p`,{className:`${O}${s?.description?` ${s.description}`:``}`,children:t}),d(`button`,{type:`button`,className:`${D}${s?.cta?` ${s.cta}`:``}`,onClick:i,children:[n,d(g,{width:14,height:14})]})]}),d(`button`,{type:`button`,className:`${T}${s?.close?` ${s.close}`:``}`,onClick:a,"aria-label":r,children:d(h,{width:16,height:16})})]})}var ie=`Banner_frakLogo__1gnumzi9`,ae=`Banner_iconSvg__1gnumzi1`,oe=`Banner_referral__1gnumzi2 reset_base__1831jhd0 Banner_rootBase__1gnumzi0`,se=`Banner_referralBody__1gnumzi5`,ce=`Banner_referralCta__1gnumzi8 sharedBaseCss_buttonReset__7cswil0`,le=`Banner_referralDescription__1gnumzi7 reset_base__1831jhd0`,ue=`Banner_referralIconWrapper__1gnumzi3`,N=`Banner_referralImage__1gnumzi4`,P=`Banner_referralTitle__1gnumzi6 reset_base__1831jhd0`;const F=S+C+`.Banner_rootBase__1gnumzi0 {
|
|
99
|
-
position: relative;
|
|
100
|
-
display: flex;
|
|
101
|
-
animation: keyframes_fadeIn__mnqmlt0 300ms ease-out;
|
|
102
|
-
}
|
|
103
|
-
.Banner_iconSvg__1gnumzi1 {
|
|
104
|
-
width: 100%;
|
|
105
|
-
height: 100%;
|
|
106
|
-
}
|
|
107
|
-
.Banner_referral__1gnumzi2 {
|
|
108
|
-
flex-direction: row;
|
|
109
|
-
align-items: center;
|
|
110
|
-
gap: 16px;
|
|
111
|
-
padding: 16px;
|
|
112
|
-
background-color: #ffffff;
|
|
113
|
-
color: var(--text-primary__pbq4ak0);
|
|
114
|
-
border: 1px solid var(--border-default__pbq4akv);
|
|
115
|
-
border-radius: 12px;
|
|
116
|
-
}
|
|
117
|
-
.Banner_referralIconWrapper__1gnumzi3 {
|
|
118
|
-
flex-shrink: 0;
|
|
119
|
-
align-self: flex-start;
|
|
120
|
-
display: flex;
|
|
121
|
-
align-items: center;
|
|
122
|
-
justify-content: center;
|
|
123
|
-
width: 40px;
|
|
124
|
-
height: 40px;
|
|
125
|
-
overflow: hidden;
|
|
126
|
-
}
|
|
127
|
-
.Banner_referralImage__1gnumzi4 {
|
|
128
|
-
max-width: 100%;
|
|
129
|
-
max-height: 100%;
|
|
130
|
-
width: auto;
|
|
131
|
-
height: auto;
|
|
132
|
-
object-fit: contain;
|
|
133
|
-
display: block;
|
|
134
|
-
}
|
|
135
|
-
.Banner_referralBody__1gnumzi5 {
|
|
136
|
-
flex: 1;
|
|
137
|
-
min-width: 0;
|
|
138
|
-
}
|
|
139
|
-
.Banner_referralTitle__1gnumzi6 {
|
|
140
|
-
font-size: 16px;
|
|
141
|
-
font-weight: 600;
|
|
142
|
-
color: var(--text-primary__pbq4ak0);
|
|
143
|
-
line-height: 22px;
|
|
144
|
-
}
|
|
145
|
-
.Banner_referralDescription__1gnumzi7 {
|
|
146
|
-
margin-bottom: 8px;
|
|
147
|
-
font-size: 14px;
|
|
148
|
-
color: #979797;
|
|
149
|
-
line-height: 22px;
|
|
150
|
-
}
|
|
151
|
-
.Banner_referralCta__1gnumzi8 {
|
|
152
|
-
display: inline-block;
|
|
153
|
-
padding: 8px 16px;
|
|
154
|
-
border: 1px solid #000000;
|
|
155
|
-
border-radius: 9999px;
|
|
156
|
-
color: var(--text-primary__pbq4ak0);
|
|
157
|
-
font-size: 10px;
|
|
158
|
-
font-weight: 700;
|
|
159
|
-
line-height: 12px;
|
|
160
|
-
text-transform: uppercase;
|
|
161
|
-
}
|
|
162
|
-
.Banner_frakLogo__1gnumzi9 {
|
|
163
|
-
position: absolute;
|
|
164
|
-
right: 16px;
|
|
165
|
-
bottom: 12px;
|
|
166
|
-
pointer-events: none;
|
|
167
|
-
}`;function I({placement:l,classname:h=``,interaction:g,referralTitle:_,referralDescription:S,referralCta:C,inappTitle:w,inappDescription:T,inappCta:E,imageUrl:D,preview:O,previewMode:k,allowInappRedirect:A}){let j=!!O,I=o(),L=k===`inapp`?`inapp`:`referral`,R=A===!0||A===`true`,z=ee(l),{shouldRender:B,isHidden:V,isClientReady:H}=te();ne(`frak-banner`,l,z?.components?.banner?.css,F,e);let[U,W]=s(!1),[G,K]=s(()=>j?L:R&&r?`inapp`:null),q=u(null);f(()=>{j&&K(L)},[j,L]);let{reward:J}=re(G===`referral`&&H,g,`referee`),[Y,de]=s(null);f(()=>{let e=window.FrakSetup?.client;G!==`inapp`||j||!H||!e||i(e).then(e=>de(e)).catch(()=>{})},[G,j,H]),f(()=>{j||!G||U||q.current!==G&&H&&(t(window.FrakSetup?.client,`banner_impression`,{placement:l,variant:G,has_reward:G===`referral`?!!J:void 0}),q.current=G)},[G,U,H,j,l]),f(()=>{if(j||G===`inapp`)return;let e=()=>K(`referral`);return window.addEventListener(a,e),()=>window.removeEventListener(a,e)},[j,G]);let X=c(async()=>{if(j)return;if(t(window.FrakSetup?.client,`banner_resolved`,{placement:l,variant:G??`referral`,outcome:`clicked`}),G===`referral`){W(!0);return}let e=Y;if(!e&&window.FrakSetup?.client)try{e=await i(window.FrakSetup?.client)}catch{}let r=window.location.href;if(e){let t=new URL(r);t.searchParams.set(`fmt`,e),r=t.toString()}n(r)},[j,G,Y,l]),fe=c(()=>{j||(t(window.FrakSetup?.client,`banner_resolved`,{placement:l,variant:G??`referral`,outcome:`dismissed`}),W(!0))},[j,G,l]),pe=b(),Z=z?.components?.banner??pe?.banner,Q=D??Z?.imageUrl,$=m(()=>{let e=p[I].banner;if(G===`referral`){let t=J?e.referralTitleReward:e.referralTitle;return{title:x(_??Z?.referralTitle??t,J),description:x(S??Z?.referralDescription??e.referralDescription,J),cta:C??Z?.referralCta??e.referralCta}}return{title:x(w??Z?.inappTitle??e.inappTitle,void 0),description:x(T??Z?.inappDescription??e.inappDescription,void 0),cta:E??Z?.inappCta??e.inappCta}},[I,G,J,Z,_,S,C,w,T,E]);if(!G||!j&&(!B||V||U))return null;let me=[oe,`frak-banner`,`frak-banner--${G}`,h].filter(Boolean).join(` `);return G===`inapp`?d(M,{title:$.title,description:$.description,cta:$.cta,dismissLabel:p[I].banner.dismissLabel,onAction:X,onDismiss:fe,className:[`frak-banner`,`frak-banner--inapp`,h].filter(Boolean).join(` `),classNames:{icon:`frak-banner__icon`,title:`frak-banner__title`,description:`frak-banner__description`,cta:`frak-banner__cta`,close:`frak-banner__close`}}):d(`div`,{class:me,role:`alert`,children:[d(`div`,{class:`${ue} frak-banner__icon`,children:Q?d(`img`,{src:Q,alt:``,class:N}):d(y,{class:ae})}),d(`div`,{class:`${se} frak-banner__text`,children:[d(`p`,{class:`${P} frak-banner__title`,children:$.title}),d(`p`,{class:`${le} frak-banner__description`,children:$.description}),d(`button`,{type:`button`,class:`${ce} frak-banner__cta`,onClick:X,children:$.cta})]}),d(v,{class:`${ie} frak-banner__logo`,width:42,height:24})]})}l(I,`frak-banner`,[`placement`,`classname`,`interaction`,`referralTitle`,`referralDescription`,`referralCta`,`inappTitle`,`inappDescription`,`inappCta`,`preview`,`previewMode`,`imageUrl`,`allowInappRedirect`],{shadow:!1});export{I as Banner};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b as e,i as t}from"./loader.js";import{a as n,f as r,h as i,m as a,n as o,s,t as c,u as l}from"./defaults.kWEdCyGS.js";import{t as u}from"./useGlobalComponents.BC6Jgzg5.js";import{t as d}from"./useLightDomStyles.imPXuAtf.js";import{r as f}from"./rewards.CIu9qbmI.js";import{t as p}from"./useReward.BAmvPaVu.js";import{t as m}from"./embeddedWallet.BS-9u4Be.js";function h({placement:i,text:h,classname:g=``,noRewardText:_,targetInteraction:v,clickAction:y,preview:b}){let x=!!b,S=n(),C=o(i),w=u(),T=C?.components?.buttonShare??w?.buttonShare;d(`frak-button-share`,i,T?.css);let E=l(()=>C?.targetInteraction===void 0?v:C.targetInteraction,[C?.targetInteraction,v]),D=T?.text??h??c[S].buttonShare.text,O=T?.noRewardText??_,k=l(()=>D.includes(`{REWARD}`),[D]),A=l(()=>T?.clickAction??y??`sharing-page`,[T?.clickAction,y]),{shouldRender:j,isHidden:M,isClientReady:N}=s(),{reward:P}=p(k&&N,E),F=l(()=>k?P?f(D,P):O??f(D,void 0):D,[k,D,O,P]),I=r(()=>{if(!x){if(e(window.FrakSetup.client,`share_button_clicked`,{placement:i,target_interaction:E,has_reward:!!P,click_action:A}),A===`embedded-wallet`){m(E,i);return}t(E,i)}},[x,A,E,i,P]);if(!x&&(!j||M))return null;let L=[`button`,`button__fadeIn`,g].filter(Boolean).join(` `);return a(`button`,{type:`button`,disabled:!x&&!N,class:L,onClick:I,children:F})}i(h,`frak-button-share`,[`text`,`placement`,`classname`,`clickAction`,`noRewardText`,`targetInteraction`,`preview`],{shadow:!1});export{h as ButtonShare};
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import{a as e,d as t,g as n,h as r,m as i,n as a,p as o,r as s,s as c,t as l,u}from"./defaults.kWEdCyGS.js";import{t as d}from"./useReward.BAmvPaVu.js";import{t as f}from"./embeddedWallet.BS-9u4Be.js";function p(e){return i(`svg`,{fill:`none`,height:`1em`,viewBox:`0 0 28 28`,width:`1em`,xmlns:`http://www.w3.org/2000/svg`,...e,children:[i(`title`,{children:`Gift icon`}),i(`path`,{d:`m23.14 14v11.43h-18.29v-11.43m9.14 11.43v-17.14m0 0h-5.14c-0.76 0-1.48-0.3-2.02-0.84s-0.84-1.26-0.84-2.020.3-1.480.84-2.02 1.26-0.84 2.02-0.84c4 0 5.14 5.71 5.14 5.71zm0 0h5.14c0.76 0 1.48-0.3 2.02-0.84s0.84-1.260.84-2.02-0.3-1.48-0.84-2.02-1.26-0.84-2.02-0.84c-4 0-5.14 5.71-5.14 5.71zm-11.43 0h22.86v5.71h-22.86z`,stroke:`#fff`,"stroke-linecap":`round`,"stroke-linejoin":`round`})]})}function m(){`vibrate`in navigator&&navigator.vibrate(10)}function h(e,t){m(),f(e,t)}function g({placement:r,classname:f=``,useReward:m,targetInteraction:g}){let _=e(),v=a(r),y=u(()=>v?.targetInteraction===void 0?g:v.targetInteraction,[v?.targetInteraction,g]),b=u(()=>m===!0,[m]),{shouldRender:x,isHidden:S,isClientReady:C}=c(),{reward:w}=d(b&&C,y),[T,E]=t(`right`);if(o(()=>{let e=v?.components?.buttonWallet?.position,t=window.FrakSetup?.modalWalletConfig?.metadata?.position;E(e??t??`right`)},[v?.components?.buttonWallet?.position]),!x||S)return null;let D=[`button`,`button__fadeIn`,T===`left`?`button__left`:`button__right`,f].filter(Boolean).join(` `);return i(n,{children:[i(`style`,{children:s(`
|
|
2
|
-
.button {
|
|
3
|
-
all: unset;
|
|
4
|
-
position: fixed;
|
|
5
|
-
bottom: 20px;
|
|
6
|
-
z-index: 2000000;
|
|
7
|
-
display: flex;
|
|
8
|
-
justify-content: center;
|
|
9
|
-
align-items: center;
|
|
10
|
-
background-color: #3e557e;
|
|
11
|
-
width: 45px;
|
|
12
|
-
height: 45px;
|
|
13
|
-
border-radius: 50%;
|
|
14
|
-
cursor: pointer;
|
|
15
|
-
text-align: center;
|
|
16
|
-
font-size: 24px;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
.button__left {
|
|
20
|
-
left: 20px;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
.button__right {
|
|
24
|
-
right: 20px;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
.reward {
|
|
28
|
-
position: absolute;
|
|
29
|
-
top: -4px;
|
|
30
|
-
right: 27px;
|
|
31
|
-
padding: 2px 3px;
|
|
32
|
-
border-radius: 5px;
|
|
33
|
-
background: #ff3f3f;
|
|
34
|
-
font-size: 9px;
|
|
35
|
-
color: #fff;
|
|
36
|
-
font-weight: 600;
|
|
37
|
-
white-space: nowrap;
|
|
38
|
-
line-height: 9px;
|
|
39
|
-
}
|
|
40
|
-
`,v?.components?.buttonWallet?.css)}),i(`button`,{type:`button`,"aria-label":l[_].buttonWallet.ariaLabel,part:`button`,disabled:!C,class:D,onClick:()=>{h(y,r)},children:[i(p,{}),w&&i(`span`,{class:`reward`,children:w})]})]})}r(g,`frak-button-wallet`,[`placement`,`classname`,`useReward`,`targetInteraction`],{shadow:!0});export{g as ButtonWallet};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b as e,d as t,m as n,p as r}from"./loader.js";import{a as i,h as a,m as o,n as s,s as c,t as l,u}from"./defaults.kWEdCyGS.js";import{t as d}from"./useLightDomStyles.imPXuAtf.js";function f(t=`wallet`,i){let a=window.FrakSetup?.client;a&&e(a,`open_in_app_clicked`,{path:t,placement:i}),n(`${r}${t}`,{onFallback:()=>{a&&e(a,`app_not_installed`,{path:t,placement:i})}})}function p(){return{isMobile:u(()=>t(),[])}}function m({placement:e,text:t,classname:n=``}){let r=i(),a=s(e),{shouldRender:u,isHidden:m,isClientReady:h}=c(),{isMobile:g}=p();d(`frak-open-in-app`,e,a?.components?.openInApp?.css);let _=a?.components?.openInApp?.text??t??l[r].openInApp.text;if(!g||!u||m)return null;let v=()=>{f(void 0,e)},y=[`button`,`button__fadeIn`,n].filter(Boolean).join(` `);return o(`button`,{type:`button`,"aria-label":l[r].openInApp.ariaLabel,disabled:!h,class:y,onClick:v,children:_})}a(m,`frak-open-in-app`,[`text`,`placement`,`classname`],{shadow:!1});export{m as OpenInAppButton};
|