@frak-labs/components 1.1.0-beta.594d023c → 1.1.0-beta.85cbc66e
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.DGYexiiS.js → Banner.CSBuxvnZ.js} +3 -3
- package/cdn/ButtonShare.BMW4Spt5.js +1 -0
- package/cdn/ButtonWallet.oZj_GoNS.js +40 -0
- package/cdn/{GiftIcon.C1uAOx7A.js → GiftIcon.CPyeWQNR.js} +1 -1
- package/cdn/OpenInAppButton.DYfr8q7L.js +1 -0
- package/cdn/PostPurchase.CQJhhgRX.js +89 -0
- package/cdn/components.js +1 -1
- package/cdn/defaults.CmUvOlLQ.js +58 -0
- package/cdn/loader.js +10 -50
- package/cdn/rewards.0JylBHNY.js +1 -0
- package/cdn/useGlobalComponents.C7wnXWOg.js +1 -0
- package/cdn/useLightDomStyles.BLyrWEBn.js +1 -0
- package/cdn/{useReward.CXgeQcsH.js → useReward.CaBorN5T.js} +1 -1
- package/dist/{GiftIcon-BhL0bhVu.js → GiftIcon-BmGGodb2.js} +8 -8
- package/dist/banner.js +7 -7
- package/dist/buttonShare.d.ts +7 -5
- package/dist/buttonShare.js +5 -10
- package/dist/buttonWallet.d.ts +7 -2
- package/dist/buttonWallet.js +34 -10
- package/dist/i18n/defaults.js +2 -2
- package/dist/openInApp.js +4 -3
- package/dist/postPurchase.d.ts +3 -1
- package/dist/postPurchase.js +26 -9
- package/dist/{rewards-Cxn-bgzC.js → rewards-DoVY1pWr.js} +7 -10
- package/dist/{useGlobalComponents-CeTO2xYs.js → useGlobalComponents-DFv33ujB.js} +1 -1
- package/dist/{useLightDomStyles-B2U96tzU.js → useLightDomStyles-B_IbOqJZ.js} +1 -1
- package/dist/{usePlacement-Bpo25qjA.js → usePlacement-DtwWaLHO.js} +3 -1
- package/dist/{useReward-BMYSGY-o.js → useReward-k7RF3DhH.js} +1 -1
- package/package.json +4 -4
- package/cdn/ButtonShare.DFg0XCDd.js +0 -1
- package/cdn/ButtonWallet.sGDvcAXt.js +0 -40
- package/cdn/OpenInAppButton.CxLPpqFO.js +0 -1
- package/cdn/PostPurchase.D6Mzbjtu.js +0 -89
- package/cdn/defaults.BEvoSiy5.js +0 -58
- package/cdn/embeddedWallet.BjQSXLkP.js +0 -1
- package/cdn/rewards.B2smvfIs.js +0 -1
- package/cdn/useGlobalComponents.CqTI84Mw.js +0 -1
- package/cdn/useLightDomStyles.CKtA4k-_.js +0 -1
- package/dist/embeddedWallet-CxgyuwtP.js +0 -18
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "preact/hooks";
|
|
2
2
|
import { jsx, jsxs } from "preact/jsx-runtime";
|
|
3
3
|
import { Component, Fragment as Fragment$1, createElement, options, toChildArray } from "preact";
|
|
4
|
-
//#region ../../node_modules/.bun/preact@10.29.
|
|
4
|
+
//#region ../../node_modules/.bun/preact@10.29.8/node_modules/preact/compat/dist/compat.module.js
|
|
5
5
|
function g(n, t) {
|
|
6
6
|
for (var e in t) n[e] = t[e];
|
|
7
7
|
return n;
|
|
@@ -59,12 +59,12 @@ options.unmount = function(n) {
|
|
|
59
59
|
var e = t.__c, r = this;
|
|
60
60
|
r.o ??= [], r.o.push(e);
|
|
61
61
|
var u = j(r.__v), o = !1, i = function() {
|
|
62
|
-
o || r.__z || (o = !0, e.__R = null, u ? u(
|
|
62
|
+
o || r.__z || (o = !0, e.__R = null, u ? u(f) : f());
|
|
63
63
|
};
|
|
64
64
|
e.__R = i;
|
|
65
65
|
var l = e.__P;
|
|
66
66
|
e.__P = null;
|
|
67
|
-
var
|
|
67
|
+
var f = function() {
|
|
68
68
|
if (!--r.__u) {
|
|
69
69
|
if (r.state.__a) {
|
|
70
70
|
var n = r.state.__a;
|
|
@@ -167,8 +167,8 @@ options.vnode = function(n) {
|
|
|
167
167
|
for (var i in t) {
|
|
168
168
|
var l = t[i];
|
|
169
169
|
if (!("value" === i && "defaultValue" in t && null == l || Q && "children" === i && "noscript" === e || "class" === i || "className" === i)) {
|
|
170
|
-
var
|
|
171
|
-
"defaultValue" === i && "value" in t && null == t.value ? i = "value" : "download" === i && !0 === l ? l = "" : "translate" ===
|
|
170
|
+
var f = i.toLowerCase();
|
|
171
|
+
"defaultValue" === i && "value" in t && null == t.value ? i = "value" : "download" === i && !0 === l ? l = "" : "translate" === f && "no" === l ? l = !1 : "o" === f[0] && "n" === f[1] ? "ondoubleclick" === f ? i = "ondblclick" : "onchange" !== f || "input" !== e && "textarea" !== e || X(t.type) ? "onfocus" === f ? i = "onfocusin" : "onblur" === f ? i = "onfocusout" : J.test(i) && (i = f) : f = i = "oninput" : o && G.test(i) ? i = i.replace(K, "-$&").toLowerCase() : null === l && (l = void 0), "oninput" === f && u[i = f] && (i = "oninputCapture"), u[i] = l;
|
|
172
172
|
}
|
|
173
173
|
}
|
|
174
174
|
"select" == e && (u.multiple && Array.isArray(u.value) && (u.value = toChildArray(t.children).forEach(function(n) {
|
|
@@ -182,9 +182,9 @@ var ln = options.__r;
|
|
|
182
182
|
options.__r = function(n) {
|
|
183
183
|
ln && ln(n), n.__c;
|
|
184
184
|
};
|
|
185
|
-
var
|
|
185
|
+
var fn = options.diffed;
|
|
186
186
|
options.diffed = function(n) {
|
|
187
|
-
|
|
187
|
+
fn && fn(n);
|
|
188
188
|
var t = n.props, e = n.__e;
|
|
189
189
|
null != e && "textarea" === n.type && "value" in t && t.value !== e.value && (e.value = null == t.value ? "" : t.value);
|
|
190
190
|
};
|
|
@@ -278,7 +278,7 @@ function WarningIcon(props) {
|
|
|
278
278
|
}
|
|
279
279
|
//#endregion
|
|
280
280
|
//#region src/styles/sharedBaseCss.css.ts
|
|
281
|
-
const cssSource = ".reset_base__1831jhd0 {\n margin: 0;\n padding: 0;\n border: 0;\n box-sizing: border-box;\n font-size: 100%;\n font: inherit;\n vertical-align: baseline;\n -webkit-tap-highlight-color: transparent;\n}\n.reset_focusRing__1831jhd1 {\n outline: 2px solid transparent;\n outline-offset: 2px;\n}\n.reset_focusRing__1831jhd1:focus-visible {\n outline-color: currentColor;\n}\n.reset_fieldAppearance__1831jhd2 {\n appearance: none;\n background-color: transparent;\n}\n.reset_visuallyHidden__1831jhd3 {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border-width: 0;\n}\n.reset_element_ul__1831jhd4 {\n list-style: none;\n}\n.reset_element_ol__1831jhd5 {\n list-style: none;\n}\n.reset_element_button__1831jhd6 {\n cursor: pointer;\n}\n.reset_element_a__1831jhd7 {\n text-decoration: none;\n color: inherit;\n}\n.reset_element_table__1831jhdb {\n border-collapse: collapse;\n border-spacing: 0;\n}\n.reset_element_img__1831jhdc {\n display: block;\n max-width: 100%;\n}:root {\n --text-primary__pbq4ak0: #000000;\n --text-secondary__pbq4ak1: #525252;\n --text-tertiary__pbq4ak2: #a3a3a3;\n --text-disabled__pbq4ak3: #a3a3a3;\n --text-action__pbq4ak4: #0043ef;\n --text-actionHover__pbq4ak5: #0036bf;\n --text-onAction__pbq4ak6: #ffffff;\n --text-error__pbq4ak7: #e31c31;\n --text-success__pbq4ak8: #09be67;\n --text-warning__pbq4ak9: #ec7e00;\n --surface-primary__pbq4aka: #0043ef;\n --surface-secondary__pbq4akb: #f2f6fe;\n --surface-background__pbq4akc: #ffffff;\n --surface-background2__pbq4akd: #f9fafb;\n --surface-elevated__pbq4ake: #ffffff;\n --surface-muted__pbq4akf: #f7f7f7;\n --surface-tertiary__pbq4akg: #f7f7f7;\n --surface-overlay__pbq4akh: #000000b2;\n --surface-disabled__pbq4aki: #e2e2e2;\n --surface-primaryHover__pbq4akj: #0036bf;\n --surface-primaryPressed__pbq4akk: #00288f;\n --surface-secondaryHover__pbq4akl: #e5ecfd;\n --surface-secondaryPressed__pbq4akm: #ccd9fc;\n --surface-error__pbq4akn: #fce8ea;\n --surface-success__pbq4ako: #f3fcf7;\n --surface-warning__pbq4akp: #fef9f2;\n --border-subtle__pbq4akq: #f5f5f5;\n --border-focus__pbq4akr: #a3a3a3;\n --border-error__pbq4aks: #e31c31;\n --border-success__pbq4akt: #09be67;\n --border-warning__pbq4aku: #ec7e00;\n --border-default__pbq4akv: #e2e2e2;\n --icon-primary__pbq4akw: #000000;\n --icon-secondary__pbq4akx: #525252;\n --icon-tertiary__pbq4aky: #a3a3a3;\n --icon-disabled__pbq4akz: #a3a3a3;\n --icon-action__pbq4ak10: #0043ef;\n --icon-actionHover__pbq4ak11: #0036bf;\n --icon-onAction__pbq4ak12: #ffffff;\n --icon-error__pbq4ak13: #e31c31;\n --icon-success__pbq4ak14: #09be67;\n --icon-warning__pbq4ak15: #ec7e00;\n}
|
|
281
|
+
const cssSource = ".reset_base__1831jhd0 {\n margin: 0;\n padding: 0;\n border: 0;\n box-sizing: border-box;\n font-size: 100%;\n font: inherit;\n vertical-align: baseline;\n -webkit-tap-highlight-color: transparent;\n}\n.reset_focusRing__1831jhd1 {\n outline: 2px solid transparent;\n outline-offset: 2px;\n}\n.reset_focusRing__1831jhd1:focus-visible {\n outline-color: currentColor;\n}\n.reset_fieldAppearance__1831jhd2 {\n appearance: none;\n background-color: transparent;\n}\n.reset_visuallyHidden__1831jhd3 {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border-width: 0;\n}\n.reset_element_ul__1831jhd4 {\n list-style: none;\n}\n.reset_element_ol__1831jhd5 {\n list-style: none;\n}\n.reset_element_button__1831jhd6 {\n cursor: pointer;\n}\n.reset_element_a__1831jhd7 {\n text-decoration: none;\n color: inherit;\n}\n.reset_element_table__1831jhdb {\n border-collapse: collapse;\n border-spacing: 0;\n}\n.reset_element_img__1831jhdc {\n display: block;\n max-width: 100%;\n}:root {\n --text-primary__pbq4ak0: #000000;\n --text-secondary__pbq4ak1: #525252;\n --text-tertiary__pbq4ak2: #a3a3a3;\n --text-disabled__pbq4ak3: #a3a3a3;\n --text-action__pbq4ak4: #0043ef;\n --text-actionHover__pbq4ak5: #0036bf;\n --text-onAction__pbq4ak6: #ffffff;\n --text-error__pbq4ak7: #e31c31;\n --text-success__pbq4ak8: #09be67;\n --text-warning__pbq4ak9: #ec7e00;\n --surface-primary__pbq4aka: #0043ef;\n --surface-secondary__pbq4akb: #f2f6fe;\n --surface-background__pbq4akc: #ffffff;\n --surface-background2__pbq4akd: #f9fafb;\n --surface-elevated__pbq4ake: #ffffff;\n --surface-muted__pbq4akf: #f7f7f7;\n --surface-tertiary__pbq4akg: #f7f7f7;\n --surface-overlay__pbq4akh: #000000b2;\n --surface-disabled__pbq4aki: #e2e2e2;\n --surface-primaryHover__pbq4akj: #0036bf;\n --surface-primaryPressed__pbq4akk: #00288f;\n --surface-secondaryHover__pbq4akl: #e5ecfd;\n --surface-secondaryPressed__pbq4akm: #ccd9fc;\n --surface-error__pbq4akn: #fce8ea;\n --surface-success__pbq4ako: #f3fcf7;\n --surface-warning__pbq4akp: #fef9f2;\n --border-subtle__pbq4akq: #f5f5f5;\n --border-focus__pbq4akr: #a3a3a3;\n --border-error__pbq4aks: #e31c31;\n --border-success__pbq4akt: #09be67;\n --border-warning__pbq4aku: #ec7e00;\n --border-default__pbq4akv: #e2e2e2;\n --icon-primary__pbq4akw: #000000;\n --icon-secondary__pbq4akx: #525252;\n --icon-tertiary__pbq4aky: #a3a3a3;\n --icon-disabled__pbq4akz: #a3a3a3;\n --icon-action__pbq4ak10: #0043ef;\n --icon-actionHover__pbq4ak11: #0036bf;\n --icon-onAction__pbq4ak12: #ffffff;\n --icon-error__pbq4ak13: #e31c31;\n --icon-success__pbq4ak14: #09be67;\n --icon-warning__pbq4ak15: #ec7e00;\n}.sharedBaseCss_buttonReset__7cswil0 {\n margin: 0;\n border: 0;\n appearance: none;\n background-color: transparent;\n box-sizing: border-box;\n font-family: inherit;\n -webkit-tap-highlight-color: transparent;\n cursor: pointer;\n outline: 2px solid transparent;\n outline-offset: 2px;\n}\n.sharedBaseCss_buttonReset__7cswil0:focus-visible {\n outline-color: currentColor;\n}";
|
|
282
282
|
//#endregion
|
|
283
283
|
//#region src/components/icons/GiftIcon.tsx
|
|
284
284
|
/**
|
package/dist/banner.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
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 { i as w } 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-DtwWaLHO.js";
|
|
2
|
+
import { t as useGlobalComponents } from "./useGlobalComponents-DFv33ujB.js";
|
|
3
|
+
import { t as useLightDomStyles } from "./useLightDomStyles-B_IbOqJZ.js";
|
|
4
|
+
import { i as w } from "./rewards-DoVY1pWr.js";
|
|
5
|
+
import { t as useReward } from "./useReward-k7RF3DhH.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-BmGGodb2.js";
|
|
8
8
|
import { isInAppBrowser, redirectToExternalBrowser, sanitizeProductDetailsList, 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";
|
|
@@ -40,7 +40,7 @@ const cssSource$4 = `@keyframes keyframes_fadeIn__mnqmlt0 {
|
|
|
40
40
|
//#region \0ve-inline:../../packages/design-system/src/styles/inAppBanner.css.ts.vanilla.js
|
|
41
41
|
const cssSource$3 = `.inAppBanner_container__1ibpiy70 {
|
|
42
42
|
position: fixed;
|
|
43
|
-
top: max(8px, env(safe-area-inset-top));
|
|
43
|
+
top: max(8px, var(--safe-area-inset-top, env(safe-area-inset-top, 0px)));
|
|
44
44
|
left: 16px;
|
|
45
45
|
right: 16px;
|
|
46
46
|
z-index: 1000;
|
package/dist/buttonShare.d.ts
CHANGED
|
@@ -43,15 +43,17 @@ type ButtonShareProps = {
|
|
|
43
43
|
*/
|
|
44
44
|
products?: SharingPageProduct[] | string;
|
|
45
45
|
/**
|
|
46
|
-
*
|
|
46
|
+
* Reported on the `share_button_clicked` event.
|
|
47
47
|
*
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
*
|
|
48
|
+
* It no longer selects anything: every click opens the full-page sharing
|
|
49
|
+
* UI. Retired values (`"share-modal"`, `"embedded-wallet"`) stay accepted
|
|
50
|
+
* because merchant configs and saved plugin markup still carry them, and
|
|
51
|
+
* the resolved value is reported as-is so a legacy config stays visible in
|
|
52
|
+
* analytics.
|
|
51
53
|
*
|
|
52
54
|
* @defaultValue `"sharing-page"`
|
|
53
55
|
*/
|
|
54
|
-
clickAction?: "
|
|
56
|
+
clickAction?: "sharing-page" | (string & {});
|
|
55
57
|
/**
|
|
56
58
|
* When set, renders the button in preview mode (e.g. Shopify/WP editor).
|
|
57
59
|
* Skips the client-ready gating so the button is always enabled visually,
|
package/dist/buttonShare.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { c as openSharingPage, i as useLang, o as useClientReady, s as registerWebComponent, t as usePlacement } from "./usePlacement-
|
|
2
|
-
import { t as
|
|
3
|
-
import { t as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { t as useReward } from "./useReward-BMYSGY-o.js";
|
|
1
|
+
import { c as openSharingPage, i as useLang, o as useClientReady, s as registerWebComponent, t as usePlacement } from "./usePlacement-DtwWaLHO.js";
|
|
2
|
+
import { t as useGlobalComponents } from "./useGlobalComponents-DFv33ujB.js";
|
|
3
|
+
import { t as useLightDomStyles } from "./useLightDomStyles-B_IbOqJZ.js";
|
|
4
|
+
import { i as w } from "./rewards-DoVY1pWr.js";
|
|
5
|
+
import { t as useReward } from "./useReward-k7RF3DhH.js";
|
|
7
6
|
import { componentDefaults } from "./i18n/defaults.js";
|
|
8
7
|
import { sanitizeSharingProducts, trackEvent } from "@frak-labs/core-sdk";
|
|
9
8
|
import { useCallback, useMemo } from "preact/hooks";
|
|
@@ -94,10 +93,6 @@ function ButtonShare({ placement: placementId, text, classname = "", noRewardTex
|
|
|
94
93
|
has_reward: Boolean(reward),
|
|
95
94
|
click_action: resolvedClickAction
|
|
96
95
|
});
|
|
97
|
-
if (resolvedClickAction === "embedded-wallet") {
|
|
98
|
-
openEmbeddedWallet(resolvedTargetInteraction, placementId);
|
|
99
|
-
return;
|
|
100
|
-
}
|
|
101
96
|
openSharingPage(resolvedTargetInteraction, placementId, { products: parsedProducts });
|
|
102
97
|
}, [
|
|
103
98
|
isPreview,
|
package/dist/buttonWallet.d.ts
CHANGED
|
@@ -23,7 +23,12 @@ type ButtonWalletProps = {
|
|
|
23
23
|
//#endregion
|
|
24
24
|
//#region src/components/ButtonWallet/ButtonWallet.d.ts
|
|
25
25
|
/**
|
|
26
|
-
*
|
|
26
|
+
* Floating circular button that opens the Frak sharing page.
|
|
27
|
+
*
|
|
28
|
+
* Historically this opened the embedded wallet drawer; that surface was
|
|
29
|
+
* retired, so the button now routes to the full-page sharing UI like every
|
|
30
|
+
* other share CTA. The `frak-button-wallet` tag name is kept because it is
|
|
31
|
+
* public API (merchant markup, Magento template).
|
|
27
32
|
*
|
|
28
33
|
* @param args
|
|
29
34
|
* @returns The wallet button with `<button>` tag
|
|
@@ -60,7 +65,7 @@ type ButtonWalletProps = {
|
|
|
60
65
|
* <frak-button-wallet placement="hero-wallet"></frak-button-wallet>
|
|
61
66
|
* ```
|
|
62
67
|
*
|
|
63
|
-
* @see {@link @frak-labs/core-sdk!actions.
|
|
68
|
+
* @see {@link @frak-labs/core-sdk!actions.displaySharingPage | `displaySharingPage()`} for more info about the sharing page
|
|
64
69
|
* @see {@link @frak-labs/core-sdk!actions.getMerchantInformation | `getMerchantInformation()`} for more info about the estimated reward fetching
|
|
65
70
|
*/
|
|
66
71
|
declare function ButtonWallet({ placement: placementId, classname, useReward: rawUseReward, targetInteraction }: ButtonWalletProps): import("preact").JSX.Element | null;
|
package/dist/buttonWallet.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { i as useLang, n as buildStyleContent, o as useClientReady, s as registerWebComponent, t as usePlacement } from "./usePlacement-
|
|
2
|
-
import { t as
|
|
3
|
-
import { t as useReward } from "./useReward-BMYSGY-o.js";
|
|
1
|
+
import { c as openSharingPage, i as useLang, n as buildStyleContent, o as useClientReady, s as registerWebComponent, t as usePlacement } from "./usePlacement-DtwWaLHO.js";
|
|
2
|
+
import { t as useReward } from "./useReward-k7RF3DhH.js";
|
|
4
3
|
import { componentDefaults } from "./i18n/defaults.js";
|
|
5
|
-
import {
|
|
4
|
+
import { trackEvent } from "@frak-labs/core-sdk";
|
|
5
|
+
import { useCallback, useEffect, useMemo, useState } from "preact/hooks";
|
|
6
6
|
import { Fragment, jsx, jsxs } from "preact/jsx-runtime";
|
|
7
7
|
//#region src/components/ButtonWallet/assets/GiftIcon.tsx
|
|
8
8
|
function GiftIcon(props) {
|
|
@@ -32,9 +32,17 @@ function safeVibrate() {
|
|
|
32
32
|
}
|
|
33
33
|
//#endregion
|
|
34
34
|
//#region src/components/ButtonWallet/utils.ts
|
|
35
|
+
/**
|
|
36
|
+
* Open the sharing surface behind `<frak-button-wallet>`.
|
|
37
|
+
*
|
|
38
|
+
* The button used to open the embedded wallet drawer; that surface was
|
|
39
|
+
* retired in favour of the full-page sharing UI, so the tag now routes
|
|
40
|
+
* there like every other share CTA. The tag name is kept because it is
|
|
41
|
+
* public API (merchant markup, Magento template).
|
|
42
|
+
*/
|
|
35
43
|
function openWalletModal(targetInteraction, placement) {
|
|
36
44
|
safeVibrate();
|
|
37
|
-
|
|
45
|
+
openSharingPage(targetInteraction, placement);
|
|
38
46
|
}
|
|
39
47
|
//#endregion
|
|
40
48
|
//#region src/components/ButtonWallet/ButtonWallet.tsx
|
|
@@ -79,7 +87,12 @@ const componentCss = `
|
|
|
79
87
|
}
|
|
80
88
|
`;
|
|
81
89
|
/**
|
|
82
|
-
*
|
|
90
|
+
* Floating circular button that opens the Frak sharing page.
|
|
91
|
+
*
|
|
92
|
+
* Historically this opened the embedded wallet drawer; that surface was
|
|
93
|
+
* retired, so the button now routes to the full-page sharing UI like every
|
|
94
|
+
* other share CTA. The `frak-button-wallet` tag name is kept because it is
|
|
95
|
+
* public API (merchant markup, Magento template).
|
|
83
96
|
*
|
|
84
97
|
* @param args
|
|
85
98
|
* @returns The wallet button with `<button>` tag
|
|
@@ -116,7 +129,7 @@ const componentCss = `
|
|
|
116
129
|
* <frak-button-wallet placement="hero-wallet"></frak-button-wallet>
|
|
117
130
|
* ```
|
|
118
131
|
*
|
|
119
|
-
* @see {@link @frak-labs/core-sdk!actions.
|
|
132
|
+
* @see {@link @frak-labs/core-sdk!actions.displaySharingPage | `displaySharingPage()`} for more info about the sharing page
|
|
120
133
|
* @see {@link @frak-labs/core-sdk!actions.getMerchantInformation | `getMerchantInformation()`} for more info about the estimated reward fetching
|
|
121
134
|
*/
|
|
122
135
|
function ButtonWallet({ placement: placementId, classname = "", useReward: rawUseReward, targetInteraction }) {
|
|
@@ -127,6 +140,19 @@ function ButtonWallet({ placement: placementId, classname = "", useReward: rawUs
|
|
|
127
140
|
const { shouldRender, isHidden, isClientReady } = useClientReady();
|
|
128
141
|
const { reward } = useReward(shouldUseReward && isClientReady, resolvedTargetInteraction);
|
|
129
142
|
const [position, setPosition] = useState("right");
|
|
143
|
+
const onClick = useCallback(() => {
|
|
144
|
+
trackEvent(window.FrakSetup.client, "share_button_clicked", {
|
|
145
|
+
placement: placementId,
|
|
146
|
+
target_interaction: resolvedTargetInteraction,
|
|
147
|
+
has_reward: Boolean(reward),
|
|
148
|
+
click_action: "sharing-page"
|
|
149
|
+
});
|
|
150
|
+
openWalletModal(resolvedTargetInteraction, placementId);
|
|
151
|
+
}, [
|
|
152
|
+
placementId,
|
|
153
|
+
resolvedTargetInteraction,
|
|
154
|
+
reward
|
|
155
|
+
]);
|
|
130
156
|
useEffect(() => {
|
|
131
157
|
const placementPosition = placement?.components?.buttonWallet?.position;
|
|
132
158
|
const configPosition = window.FrakSetup?.modalWalletConfig?.metadata?.position;
|
|
@@ -145,9 +171,7 @@ function ButtonWallet({ placement: placementId, classname = "", useReward: rawUs
|
|
|
145
171
|
part: "button",
|
|
146
172
|
disabled: !isClientReady,
|
|
147
173
|
class: buttonClass,
|
|
148
|
-
onClick
|
|
149
|
-
openWalletModal(resolvedTargetInteraction, placementId);
|
|
150
|
-
},
|
|
174
|
+
onClick,
|
|
151
175
|
children: [/* @__PURE__ */ jsx(GiftIcon, {}), reward && /* @__PURE__ */ jsx("span", {
|
|
152
176
|
class: "reward",
|
|
153
177
|
children: reward
|
package/dist/i18n/defaults.js
CHANGED
|
@@ -27,7 +27,7 @@ const componentDefaults = {
|
|
|
27
27
|
text: "Open in App",
|
|
28
28
|
ariaLabel: "Open in Frak Wallet app"
|
|
29
29
|
},
|
|
30
|
-
buttonWallet: { ariaLabel: "
|
|
30
|
+
buttonWallet: { ariaLabel: "Share and earn rewards" },
|
|
31
31
|
banner: {
|
|
32
32
|
referralTitleReward: "Earn {REWARD} on purchases",
|
|
33
33
|
referralTitle: "You've been referred!",
|
|
@@ -53,7 +53,7 @@ const componentDefaults = {
|
|
|
53
53
|
text: "Ouvrir dans l'app",
|
|
54
54
|
ariaLabel: "Ouvrir dans l'app Frak Wallet"
|
|
55
55
|
},
|
|
56
|
-
buttonWallet: { ariaLabel: "
|
|
56
|
+
buttonWallet: { ariaLabel: "Partagez et gagnez des récompenses" },
|
|
57
57
|
banner: {
|
|
58
58
|
referralTitleReward: "Gagnez {REWARD} sur vos achats",
|
|
59
59
|
referralTitle: "Vous avez été parrainé !",
|
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-DtwWaLHO.js";
|
|
2
|
+
import { t as useLightDomStyles } from "./useLightDomStyles-B_IbOqJZ.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";
|
|
@@ -19,7 +19,8 @@ function openFrakWalletApp(path = DEFAULT_PATH, placement) {
|
|
|
19
19
|
path,
|
|
20
20
|
placement
|
|
21
21
|
});
|
|
22
|
-
|
|
22
|
+
const deepLink = `${DEEP_LINK_SCHEME}${path}`;
|
|
23
|
+
triggerDeepLinkWithFallback(deepLink, { onFallback: () => {
|
|
23
24
|
if (client) trackEvent(client, "app_not_installed", {
|
|
24
25
|
path,
|
|
25
26
|
placement
|
package/dist/postPurchase.d.ts
CHANGED
|
@@ -16,7 +16,9 @@ type PostPurchaseProps = {
|
|
|
16
16
|
*/
|
|
17
17
|
orderId?: string;
|
|
18
18
|
/**
|
|
19
|
-
*
|
|
19
|
+
* Opaque per-order token. Feeds purchase tracking, and travels to the
|
|
20
|
+
* sharing page so the install CTA still carries a credential when the
|
|
21
|
+
* anonymous id is unavailable.
|
|
20
22
|
*/
|
|
21
23
|
token?: string;
|
|
22
24
|
/**
|
package/dist/postPurchase.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { c as openSharingPage, 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 { i as w, n as K, t as C } from "./rewards-
|
|
1
|
+
import { c as openSharingPage, i as useLang, o as useClientReady, s as registerWebComponent, t as usePlacement } from "./usePlacement-DtwWaLHO.js";
|
|
2
|
+
import { t as useGlobalComponents } from "./useGlobalComponents-DFv33ujB.js";
|
|
3
|
+
import { t as useLightDomStyles } from "./useLightDomStyles-B_IbOqJZ.js";
|
|
4
|
+
import { i as w, n as K, t as C } from "./rewards-DoVY1pWr.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-BmGGodb2.js";
|
|
7
7
|
import { sanitizeSharingProducts, 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";
|
|
@@ -114,6 +114,20 @@ const cssSource = cssSource$1;
|
|
|
114
114
|
//#endregion
|
|
115
115
|
//#region src/components/PostPurchase/PostPurchase.tsx
|
|
116
116
|
/**
|
|
117
|
+
* `onChainMetadata.domain` is a bare host and `sharing-url` defaults to `""` in
|
|
118
|
+
* the WordPress shortcode; both would throw inside `FrakContextManager.update`.
|
|
119
|
+
*/
|
|
120
|
+
function resolveShareBaseUrl(value) {
|
|
121
|
+
const trimmed = value?.trim();
|
|
122
|
+
if (!trimmed) return void 0;
|
|
123
|
+
const candidate = /^https?:\/\//i.test(trimmed) ? trimmed : `https://${trimmed}`;
|
|
124
|
+
try {
|
|
125
|
+
return new URL(candidate).toString();
|
|
126
|
+
} catch {
|
|
127
|
+
return;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
117
131
|
* Given referral status and merchant info, compute the display variant
|
|
118
132
|
* and pick the appropriate purchase reward.
|
|
119
133
|
*/
|
|
@@ -217,7 +231,7 @@ function PostPurchase({ customerId, orderId, token, sharingUrl, merchantId, plac
|
|
|
217
231
|
}, [fetched, parsedProducts]);
|
|
218
232
|
const trackedImpressionVariantRef = useRef(null);
|
|
219
233
|
const resolvedVariant = forcedVariant ?? context?.variant ?? (isPreview ? previewVariant ?? "referrer" : void 0);
|
|
220
|
-
const resolvedSharingUrl = sharingUrl ?? context?.merchantDomain;
|
|
234
|
+
const resolvedSharingUrl = resolveShareBaseUrl(sharingUrl ?? context?.merchantDomain);
|
|
221
235
|
const rewardText = useMemo(() => {
|
|
222
236
|
if (!context?.reward) return void 0;
|
|
223
237
|
const currency = window.FrakSetup?.client?.config?.metadata?.currency;
|
|
@@ -270,18 +284,21 @@ function PostPurchase({ customerId, orderId, token, sharingUrl, merchantId, plac
|
|
|
270
284
|
});
|
|
271
285
|
openSharingPage(void 0, placementId, {
|
|
272
286
|
link: resolvedSharingUrl,
|
|
273
|
-
products: parsedProducts
|
|
287
|
+
products: parsedProducts,
|
|
288
|
+
checkoutToken: token
|
|
274
289
|
});
|
|
275
290
|
}, [
|
|
276
291
|
resolvedVariant,
|
|
277
292
|
placementId,
|
|
278
293
|
resolvedSharingUrl,
|
|
279
|
-
parsedProducts
|
|
294
|
+
parsedProducts,
|
|
295
|
+
token
|
|
280
296
|
]);
|
|
281
297
|
if (!resolvedVariant) return null;
|
|
282
298
|
if (!isPreview && (!shouldRender || isHidden || !context)) return null;
|
|
299
|
+
const cardClass = [card, classname].filter(Boolean).join(" ");
|
|
283
300
|
return /* @__PURE__ */ jsx("div", {
|
|
284
|
-
className:
|
|
301
|
+
className: cardClass,
|
|
285
302
|
children: /* @__PURE__ */ jsxs("div", {
|
|
286
303
|
class: cardLayout,
|
|
287
304
|
children: [/* @__PURE__ */ jsxs("div", {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//#region ../core/dist/getCurrencyAmountKey-
|
|
1
|
+
//#region ../core/dist/getCurrencyAmountKey-mJ3_Eamt.js
|
|
2
2
|
const e = {
|
|
3
3
|
eur: `fr-FR`,
|
|
4
4
|
usd: `en-US`,
|
|
@@ -38,10 +38,7 @@ function a$1(e, r) {
|
|
|
38
38
|
case `fraction`:
|
|
39
39
|
u += e.value;
|
|
40
40
|
break;
|
|
41
|
-
case `currency`:
|
|
42
|
-
d = e.value, f = p ? `suffix` : `prefix`;
|
|
43
|
-
break;
|
|
44
|
-
default: break;
|
|
41
|
+
case `currency`: d = e.value, f = p ? `suffix` : `prefix`;
|
|
45
42
|
}
|
|
46
43
|
return {
|
|
47
44
|
integer: l,
|
|
@@ -141,7 +138,7 @@ function S(t$1, a) {
|
|
|
141
138
|
}
|
|
142
139
|
}
|
|
143
140
|
function C(t$2, n) {
|
|
144
|
-
if (t$2
|
|
141
|
+
if (!(!t$2 || y(t$2, s$1(t(n))) <= 0)) return x(t$2, n);
|
|
145
142
|
}
|
|
146
143
|
function w(e, t) {
|
|
147
144
|
return t ? e.replaceAll(`{REWARD}`, t) : e.replaceAll(`{REWARD}`, ``);
|
|
@@ -179,7 +176,7 @@ function N(e, t) {
|
|
|
179
176
|
}
|
|
180
177
|
function P(e, t, n) {
|
|
181
178
|
if (!Array.isArray(n)) return e === `not_in`;
|
|
182
|
-
if (t
|
|
179
|
+
if (t == null) return;
|
|
183
180
|
let r = n.includes(t);
|
|
184
181
|
return e === `in` ? r : !r;
|
|
185
182
|
}
|
|
@@ -199,10 +196,10 @@ function I(e, t, n) {
|
|
|
199
196
|
}
|
|
200
197
|
function L(e, t) {
|
|
201
198
|
let n = j(t, e.field), { operator: r, value: i, valueTo: a } = e;
|
|
202
|
-
if (r === `exists`) return n
|
|
203
|
-
if (r === `not_exists`) return n
|
|
199
|
+
if (r === `exists`) return n != null;
|
|
200
|
+
if (r === `not_exists`) return n == null;
|
|
204
201
|
if (r === `in` || r === `not_in`) return P(r, n, i);
|
|
205
|
-
if (!(Array.isArray(i) || n
|
|
202
|
+
if (!(Array.isArray(i) || n == null || i == null)) {
|
|
206
203
|
if (T.has(r)) return F(r, n, i, a);
|
|
207
204
|
if (D.has(r)) return I(r, n, i);
|
|
208
205
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as subscribeSdkConfig } from "./usePlacement-
|
|
1
|
+
import { a as subscribeSdkConfig } from "./usePlacement-DtwWaLHO.js";
|
|
2
2
|
import { sdkConfigStore } from "@frak-labs/core-sdk";
|
|
3
3
|
import { useSyncExternalStore } from "preact/compat";
|
|
4
4
|
//#region src/hooks/useGlobalComponents.ts
|
|
@@ -14,6 +14,7 @@ async function openSharingPage(targetInteraction, placement, options) {
|
|
|
14
14
|
await displaySharingPage(window.FrakSetup.client, {
|
|
15
15
|
...options?.link && { link: options.link },
|
|
16
16
|
...options?.products?.length && { products: options.products },
|
|
17
|
+
...options?.checkoutToken && { checkoutToken: options.checkoutToken },
|
|
17
18
|
...targetInteraction && { metadata: { targetInteraction } }
|
|
18
19
|
}, placement);
|
|
19
20
|
}
|
|
@@ -347,7 +348,8 @@ function getPlacement(id) {
|
|
|
347
348
|
* only re-renders when that placement actually changes.
|
|
348
349
|
*/
|
|
349
350
|
function usePlacement(placementId) {
|
|
350
|
-
|
|
351
|
+
const getSnapshot = useCallback(() => placementId ? getPlacement(placementId) : void 0, [placementId]);
|
|
352
|
+
return useSyncExternalStore(subscribeSdkConfig, getSnapshot);
|
|
351
353
|
}
|
|
352
354
|
//#endregion
|
|
353
355
|
export { subscribeSdkConfig as a, openSharingPage as c, useLang as i, buildStyleContent as n, useClientReady as o, lightDomBaseCss as r, registerWebComponent as s, usePlacement as t };
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"url": "https://twitter.com/QNivelais"
|
|
12
12
|
}
|
|
13
13
|
],
|
|
14
|
-
"version": "1.1.0-beta.
|
|
14
|
+
"version": "1.1.0-beta.85cbc66e",
|
|
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",
|
|
@@ -103,13 +103,13 @@
|
|
|
103
103
|
"publish": "echo 'Publishing components...'"
|
|
104
104
|
},
|
|
105
105
|
"dependencies": {
|
|
106
|
-
"@frak-labs/core-sdk": "1.3.0-beta.
|
|
107
|
-
"@frak-labs/
|
|
108
|
-
"@frak-labs/frame-connector": "1.3.0-beta.594d023c",
|
|
106
|
+
"@frak-labs/core-sdk": "1.3.0-beta.85cbc66e",
|
|
107
|
+
"@frak-labs/frame-connector": "1.3.0-beta.85cbc66e",
|
|
109
108
|
"preact": "^10.29.7",
|
|
110
109
|
"preact-custom-element": "^4.6.0"
|
|
111
110
|
},
|
|
112
111
|
"devDependencies": {
|
|
112
|
+
"@frak-labs/design-system": "0.0.0",
|
|
113
113
|
"@frak-labs/test-foundation": "0.1.0",
|
|
114
114
|
"@preact/preset-vite": "^2.10.6",
|
|
115
115
|
"@rolldown/plugin-node-polyfills": "^1.0.3",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e,u as t,w as n}from"./loader.js";import{a as r,h as i,m as a,n as o,p as s,s as c,t as l,u}from"./defaults.BEvoSiy5.js";import{t as d}from"./useGlobalComponents.CqTI84Mw.js";import{t as f}from"./useLightDomStyles.CKtA4k-_.js";import{i as p}from"./rewards.B2smvfIs.js";import{t as m}from"./useReward.CXgeQcsH.js";import{t as h}from"./embeddedWallet.BjQSXLkP.js";function g({placement:i,text:g,classname:_=``,noRewardText:v,targetInteraction:y,products:b,clickAction:x,preview:S}){let C=!!S,w=r(),T=o(i),E=d(),D=T?.components?.buttonShare??E?.buttonShare;f(`frak-button-share`,i,D?.css);let O=u(()=>T?.targetInteraction===void 0?y:T.targetInteraction,[T?.targetInteraction,y]),k=D?.text??g??l[w].buttonShare.text,A=D?.noRewardText??v,j=u(()=>k.includes(`{REWARD}`),[k]),M=u(()=>D?.clickAction??x??`sharing-page`,[D?.clickAction,x]),{shouldRender:N,isHidden:P,isClientReady:F}=c(),I=u(()=>t(b),[b]),{reward:L}=m(j&&F,O,void 0,I),R=u(()=>j?L?p(k,L):A??p(k,void 0):k,[j,k,A,L]),z=s(()=>{if(!C){if(n(window.FrakSetup.client,`share_button_clicked`,{placement:i,target_interaction:O,has_reward:!!L,click_action:M}),M===`embedded-wallet`){h(O,i);return}e(O,i,{products:I})}},[C,M,O,i,L,I]);if(!C&&(!N||P))return null;let B=[`button`,`button__fadeIn`,_].filter(Boolean).join(` `);return a(`button`,{type:`button`,disabled:!C&&!F,class:B,onClick:z,children:R})}i(g,`frak-button-share`,[`text`,`placement`,`classname`,`clickAction`,`noRewardText`,`targetInteraction`,`products`,`preview`],{shadow:!1});export{g as ButtonShare};
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import{a as e,d as t,f as n,g as r,h as i,m as a,n as o,r as s,s as c,t as l,u}from"./defaults.BEvoSiy5.js";import{t as d}from"./useReward.CXgeQcsH.js";import{t as f}from"./embeddedWallet.BjQSXLkP.js";function p(e){return a(`svg`,{fill:`none`,height:`1em`,viewBox:`0 0 28 28`,width:`1em`,xmlns:`http://www.w3.org/2000/svg`,...e,children:[a(`title`,{children:`Gift icon`}),a(`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):console.log(`Vibration not supported`)}function h(e,t){m(),f(e,t)}function g({placement:i,classname:f=``,useReward:m,targetInteraction:g}){let _=e(),v=o(i),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(n(()=>{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 a(r,{children:[a(`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)}),a(`button`,{type:`button`,"aria-label":l[_].buttonWallet.ariaLabel,part:`button`,disabled:!C,class:D,onClick:()=>{h(y,i)},children:[a(p,{}),w&&a(`span`,{class:`reward`,children:w})]})]})}i(g,`frak-button-wallet`,[`placement`,`classname`,`useReward`,`targetInteraction`],{shadow:!0});export{g as ButtonWallet};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{f as e,g as t,h as n,w 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.BEvoSiy5.js";import{t as d}from"./useLightDomStyles.CKtA4k-_.js";function f(n=`wallet`,i){let a=window.FrakSetup?.client;a&&r(a,`open_in_app_clicked`,{path:n,placement:i}),t(`${e}${n}`,{onFallback:()=>{a&&r(a,`app_not_installed`,{path:n,placement:i})}})}function p(){return{isMobile:u(()=>n(),[])}}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};
|