@frak-labs/components 1.3.3-beta.e9b6b7db → 1.3.4
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/Ambassador.tWpfYThv.js +392 -0
- package/cdn/Banner.RSZt2Kn_.js +208 -0
- package/cdn/ButtonShare.Buy6qEfW.js +1 -0
- package/cdn/ButtonWallet.CIesaq0l.js +40 -0
- package/cdn/{GiftIcon.NTATj1WE.js → GiftIcon.CX0gLPUJ.js} +1 -1
- package/cdn/OpenInAppButton.BtXknsxK.js +1 -0
- package/cdn/PostPurchase.Btgp2kLc.js +102 -0
- package/cdn/components.js +1 -1
- package/cdn/{jsxRuntime.module.C5UTjP_H.js → jsxRuntime.module.CUZaa90V.js} +1 -1
- package/cdn/loader.js +14 -14
- package/cdn/replay-V6FXES7X.efKsNT6s.js +1 -0
- package/cdn/useGlobalComponents.CXuceSQ0.js +1 -0
- package/cdn/useLightDomStyles.CpiH8nO2.js +31 -0
- package/cdn/{usePlacement.B5JX9OU-.js → usePlacement.Cq64cZ9Q.js} +1 -1
- package/cdn/useReward.B9ibElG0.js +1 -0
- package/dist/{GiftIcon-JVhSFEhP.js → GiftIcon-B9k_syq6.js} +6 -12
- package/dist/ambassador.d.ts +0 -6
- package/dist/ambassador.js +13 -20
- package/dist/banner.d.ts +0 -6
- package/dist/banner.js +20 -29
- package/dist/buttonShare.d.ts +0 -6
- package/dist/buttonShare.js +8 -10
- package/dist/buttonWallet.d.ts +0 -6
- package/dist/buttonWallet.js +7 -11
- package/dist/i18n/defaults.d.ts +0 -2
- package/dist/i18n/defaults.js +1 -2
- package/dist/openInApp.d.ts +0 -6
- package/dist/openInApp.js +7 -11
- package/dist/postPurchase.d.ts +0 -6
- package/dist/postPurchase.js +10 -13
- package/dist/{rewards-HJlTkTcY.js → rewards-CfGynCt6.js} +2 -4
- package/dist/{sharedBaseCss.css-BkMpQeRx.js → sharedBaseCss.css-nYy9vlzH.js} +1 -3
- package/dist/{sharedCss-CPNmnpXA.js → sharedCss-SKmJGZgN.js} +10 -20
- package/dist/{useGlobalComponents-B3s2UQFk.js → useGlobalComponents-BF47jsBt.js} +2 -3
- package/dist/{useLightDomStyles-BQ5FvCPi.js → useLightDomStyles-wGaNXHqN.js} +4 -6
- package/dist/{usePlacement-BpaIbzun.js → usePlacement-Dd7itnCf.js} +2 -3
- package/dist/{useReward-WmsNOFlz.js → useReward-DmukZKoh.js} +2 -3
- package/package.json +13 -13
- package/cdn/Ambassador.BtZXbHrE.js +0 -392
- package/cdn/Banner.BaMe3Y_o.js +0 -208
- package/cdn/ButtonShare.DBG3qW4U.js +0 -1
- package/cdn/ButtonWallet.CibSy_fI.js +0 -40
- package/cdn/OpenInAppButton.Dv7oAwl1.js +0 -1
- package/cdn/PostPurchase.4VD_vKnI.js +0 -102
- package/cdn/replay-V6FXES7X.CgBxdfNp.js +0 -1
- package/cdn/useGlobalComponents.DoG1wfeq.js +0 -1
- package/cdn/useLightDomStyles.B0_CS0Kq.js +0 -1
- package/cdn/useReward.Cl4hkDZp.js +0 -1
|
@@ -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
|
-
|
|
4
|
+
// ../../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;
|
|
@@ -188,8 +188,7 @@ options.diffed = function(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
|
};
|
|
191
|
-
|
|
192
|
-
//#region ../../packages/design-system/src/icons/CloseCircleIcon.tsx
|
|
191
|
+
// ../../packages/design-system/src/icons/CloseCircleIcon.tsx
|
|
193
192
|
function CloseCircleIcon(props) {
|
|
194
193
|
return /* @__PURE__ */ jsx("svg", {
|
|
195
194
|
width: "15",
|
|
@@ -204,8 +203,7 @@ function CloseCircleIcon(props) {
|
|
|
204
203
|
})
|
|
205
204
|
});
|
|
206
205
|
}
|
|
207
|
-
|
|
208
|
-
//#region ../../packages/design-system/src/icons/ExternalLinkIcon.tsx
|
|
206
|
+
// ../../packages/design-system/src/icons/ExternalLinkIcon.tsx
|
|
209
207
|
function ExternalLinkIcon(props) {
|
|
210
208
|
return /* @__PURE__ */ jsx("svg", {
|
|
211
209
|
width: "12",
|
|
@@ -220,8 +218,7 @@ function ExternalLinkIcon(props) {
|
|
|
220
218
|
})
|
|
221
219
|
});
|
|
222
220
|
}
|
|
223
|
-
|
|
224
|
-
//#region ../../packages/design-system/src/icons/LogoFrakWithName.tsx
|
|
221
|
+
// ../../packages/design-system/src/icons/LogoFrakWithName.tsx
|
|
225
222
|
/**
|
|
226
223
|
* Frak wordmark — blue rounded-square badge with the white F glyph,
|
|
227
224
|
* followed by the "frak" text.
|
|
@@ -259,8 +256,7 @@ function LogoFrakWithName(props) {
|
|
|
259
256
|
]
|
|
260
257
|
});
|
|
261
258
|
}
|
|
262
|
-
|
|
263
|
-
//#region ../../packages/design-system/src/icons/WarningIcon.tsx
|
|
259
|
+
// ../../packages/design-system/src/icons/WarningIcon.tsx
|
|
264
260
|
function WarningIcon(props) {
|
|
265
261
|
return /* @__PURE__ */ jsx("svg", {
|
|
266
262
|
width: "16",
|
|
@@ -275,8 +271,7 @@ function WarningIcon(props) {
|
|
|
275
271
|
})
|
|
276
272
|
});
|
|
277
273
|
}
|
|
278
|
-
|
|
279
|
-
//#region src/components/icons/GiftIcon.tsx
|
|
274
|
+
// src/components/icons/GiftIcon.tsx
|
|
280
275
|
/**
|
|
281
276
|
* Gift icon with yellow accent circle and present box.
|
|
282
277
|
* Used by the referral banner and the post-purchase card.
|
|
@@ -336,5 +331,4 @@ function GiftIcon(props) {
|
|
|
336
331
|
]
|
|
337
332
|
});
|
|
338
333
|
}
|
|
339
|
-
//#endregion
|
|
340
334
|
export { CloseCircleIcon as a, ExternalLinkIcon as i, WarningIcon as n, LogoFrakWithName as r, GiftIcon as t };
|
package/dist/ambassador.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/components/Ambassador/types.d.ts
|
|
2
1
|
/**
|
|
3
2
|
* Props for the {@link Ambassador} component.
|
|
4
3
|
* @inline
|
|
@@ -139,8 +138,6 @@ type AmbassadorProps = {
|
|
|
139
138
|
/** Override the attribution anchor's text. */
|
|
140
139
|
attributionLinkText?: string;
|
|
141
140
|
};
|
|
142
|
-
//#endregion
|
|
143
|
-
//#region src/components/Ambassador/Ambassador.d.ts
|
|
144
141
|
/**
|
|
145
142
|
* Full-page ambassador: hero, reward, explainer, win-win, referral, store, FAQ;
|
|
146
143
|
* `isHidden` alone suppresses it. Theme it with the twenty-two `--frak-amb-*`
|
|
@@ -150,8 +147,6 @@ type AmbassadorProps = {
|
|
|
150
147
|
* @example `<frak-ambassador></frak-ambassador>`
|
|
151
148
|
*/
|
|
152
149
|
export declare function Ambassador(props: AmbassadorProps): import("preact").JSX.Element;
|
|
153
|
-
//#endregion
|
|
154
|
-
//#region src/components/Ambassador/index.d.ts
|
|
155
150
|
/**
|
|
156
151
|
* Custom element interface for `<frak-ambassador>`.
|
|
157
152
|
* Combines standard {@link HTMLElement} with {@link AmbassadorProps}.
|
|
@@ -162,5 +157,4 @@ declare global {
|
|
|
162
157
|
"frak-ambassador": AmbassadorElement;
|
|
163
158
|
}
|
|
164
159
|
}
|
|
165
|
-
//#endregion
|
|
166
160
|
export {};
|
package/dist/ambassador.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { a as useClientReady, o as registerWebComponent, r as useLang, s as openSharingPage } from "./sharedCss-
|
|
2
|
-
import { i as w } from "./rewards-
|
|
3
|
-
import { t as useGlobalComponents } from "./useGlobalComponents-
|
|
4
|
-
import { t as useLightDomStyles } from "./useLightDomStyles-
|
|
5
|
-
import { t as useReward } from "./useReward-
|
|
1
|
+
import { a as useClientReady, o as registerWebComponent, r as useLang, s as openSharingPage } from "./sharedCss-SKmJGZgN.js";
|
|
2
|
+
import { i as w } from "./rewards-CfGynCt6.js";
|
|
3
|
+
import { t as useGlobalComponents } from "./useGlobalComponents-BF47jsBt.js";
|
|
4
|
+
import { t as useLightDomStyles } from "./useLightDomStyles-wGaNXHqN.js";
|
|
5
|
+
import { t as useReward } from "./useReward-DmukZKoh.js";
|
|
6
6
|
import { componentDefaults } from "./i18n/defaults.js";
|
|
7
|
-
import { t as cssSource$2 } from "./sharedBaseCss.css-
|
|
7
|
+
import { t as cssSource$2 } from "./sharedBaseCss.css-nYy9vlzH.js";
|
|
8
8
|
import { trackEvent } from "@frak-labs/core-sdk";
|
|
9
9
|
import { getInstallUrl } from "@frak-labs/core-sdk/actions";
|
|
10
10
|
import { useCallback, useEffect, useMemo, useRef, useState } from "preact/hooks";
|
|
11
11
|
import { Fragment, jsx, jsxs } from "preact/jsx-runtime";
|
|
12
|
-
|
|
12
|
+
// src/hooks/useHostTheme.ts
|
|
13
13
|
const QUIET_BORDER_DISTANCE = 120;
|
|
14
14
|
const FLAT_FILL_DISTANCE = 30;
|
|
15
15
|
const READABLE_CONTRAST = 3;
|
|
@@ -328,8 +328,7 @@ function useHostTheme(target) {
|
|
|
328
328
|
};
|
|
329
329
|
}, [target]);
|
|
330
330
|
}
|
|
331
|
-
|
|
332
|
-
//#region \0ve-inline:src/components/Ambassador/Ambassador.css.ts.vanilla.js
|
|
331
|
+
// \0ve-inline:src/components/Ambassador/Ambassador.css.ts.vanilla.js
|
|
333
332
|
const cssSource$1 = `.Ambassador_panel__awpcg00 {
|
|
334
333
|
background-color: var(--frak-amb-surface, #1111110a);
|
|
335
334
|
border: 1px solid var(--frak-amb-border, #11111126);
|
|
@@ -722,8 +721,7 @@ const cssSource$1 = `.Ambassador_panel__awpcg00 {
|
|
|
722
721
|
}
|
|
723
722
|
}
|
|
724
723
|
`;
|
|
725
|
-
|
|
726
|
-
//#region src/components/Ambassador/Ambassador.css.ts
|
|
724
|
+
// src/components/Ambassador/Ambassador.css.ts
|
|
727
725
|
var amountUnit = "Ambassador_amountUnit__awpcg0a";
|
|
728
726
|
var amountWords = "Ambassador_amountWords__awpcg0b";
|
|
729
727
|
var faq = "Ambassador_region__awpcg03";
|
|
@@ -789,8 +787,7 @@ var winWinCards = "Ambassador_winWinCards__awpcg0v";
|
|
|
789
787
|
var winWinLede = "Ambassador_lede__awpcg06";
|
|
790
788
|
var winWinTitle = "Ambassador_regionTitle__awpcg05";
|
|
791
789
|
const cssSource = cssSource$1;
|
|
792
|
-
|
|
793
|
-
//#region src/components/Ambassador/InstallQr.tsx
|
|
790
|
+
// src/components/Ambassador/InstallQr.tsx
|
|
794
791
|
const WIDE_QUERY = "(min-width: 768px)";
|
|
795
792
|
const QUIET_ZONE = 4;
|
|
796
793
|
const ECC = "low";
|
|
@@ -857,8 +854,7 @@ function modulesPath(grid) {
|
|
|
857
854
|
}
|
|
858
855
|
return path;
|
|
859
856
|
}
|
|
860
|
-
|
|
861
|
-
//#region src/components/Ambassador/storeBadges.tsx
|
|
857
|
+
// src/components/Ambassador/storeBadges.tsx
|
|
862
858
|
function AppStoreBadgeArtFr(props) {
|
|
863
859
|
return /* @__PURE__ */ jsx("svg", {
|
|
864
860
|
"aria-hidden": "true",
|
|
@@ -1113,8 +1109,7 @@ function PlayStoreBadgeArt({ lang, ...props }) {
|
|
|
1113
1109
|
...props
|
|
1114
1110
|
});
|
|
1115
1111
|
}
|
|
1116
|
-
|
|
1117
|
-
//#region src/components/Ambassador/Ambassador.tsx
|
|
1112
|
+
// src/components/Ambassador/Ambassador.tsx
|
|
1118
1113
|
const FRAK_URL = "https://frak.id";
|
|
1119
1114
|
/**
|
|
1120
1115
|
* SDK config name first, then `og:site_name`, then the bare hostname with a
|
|
@@ -1743,8 +1738,7 @@ function AmbassadorPage({ merchantId: propMerchantId, classname = "", heroTitle:
|
|
|
1743
1738
|
]
|
|
1744
1739
|
});
|
|
1745
1740
|
}
|
|
1746
|
-
|
|
1747
|
-
//#region src/components/Ambassador/index.ts
|
|
1741
|
+
// src/components/Ambassador/index.ts
|
|
1748
1742
|
registerWebComponent(Ambassador, "frak-ambassador", [...[
|
|
1749
1743
|
"merchantId",
|
|
1750
1744
|
"classname",
|
|
@@ -1810,5 +1804,4 @@ registerWebComponent(Ambassador, "frak-ambassador", [...[
|
|
|
1810
1804
|
"attributionBeforeLink",
|
|
1811
1805
|
"attributionLinkText"
|
|
1812
1806
|
]], { shadow: false });
|
|
1813
|
-
//#endregion
|
|
1814
1807
|
export { Ambassador };
|
package/dist/banner.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { InteractionTypeKey, ProductDetails } from "@frak-labs/core-sdk";
|
|
2
|
-
//#region src/components/Banner/types.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* The props type for {@link Banner}.
|
|
5
4
|
* @inline
|
|
@@ -83,8 +82,6 @@ type BannerProps = {
|
|
|
83
82
|
*/
|
|
84
83
|
allowInappRedirect?: boolean | "true" | "false";
|
|
85
84
|
};
|
|
86
|
-
//#endregion
|
|
87
|
-
//#region src/components/Banner/Banner.d.ts
|
|
88
85
|
/**
|
|
89
86
|
* Auto-detecting notification banner component.
|
|
90
87
|
*
|
|
@@ -116,8 +113,6 @@ type BannerProps = {
|
|
|
116
113
|
* ```
|
|
117
114
|
*/
|
|
118
115
|
export declare function Banner({ placement: placementId, classname, interaction, products, referralTitle: propReferralTitle, referralDescription: propReferralDescription, referralCta: propReferralCta, inappTitle: propInappTitle, inappDescription: propInappDescription, inappCta: propInappCta, imageUrl: propImageUrl, preview, previewMode, allowInappRedirect }: BannerProps): import("preact").JSX.Element | null;
|
|
119
|
-
//#endregion
|
|
120
|
-
//#region src/components/Banner/index.d.ts
|
|
121
116
|
/**
|
|
122
117
|
* Custom element interface for `<frak-banner>`.
|
|
123
118
|
* Combines standard {@link HTMLElement} with {@link BannerProps}.
|
|
@@ -128,5 +123,4 @@ declare global {
|
|
|
128
123
|
"frak-banner": BannerElement;
|
|
129
124
|
}
|
|
130
125
|
}
|
|
131
|
-
//#endregion
|
|
132
126
|
export {};
|
package/dist/banner.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { a as useClientReady, o as registerWebComponent, r as useLang } from "./sharedCss-
|
|
2
|
-
import { i as w } from "./rewards-
|
|
3
|
-
import { t as
|
|
4
|
-
import { t as
|
|
5
|
-
import { t as
|
|
1
|
+
import { a as useClientReady, o as registerWebComponent, r as useLang } from "./sharedCss-SKmJGZgN.js";
|
|
2
|
+
import { i as w } from "./rewards-CfGynCt6.js";
|
|
3
|
+
import { a as CloseCircleIcon, i as ExternalLinkIcon, n as WarningIcon, r as LogoFrakWithName, t as GiftIcon } from "./GiftIcon-B9k_syq6.js";
|
|
4
|
+
import { t as useGlobalComponents } from "./useGlobalComponents-BF47jsBt.js";
|
|
5
|
+
import { t as useLightDomStyles } from "./useLightDomStyles-wGaNXHqN.js";
|
|
6
|
+
import { t as usePlacement } from "./usePlacement-Dd7itnCf.js";
|
|
7
|
+
import { t as useReward } from "./useReward-DmukZKoh.js";
|
|
6
8
|
import { componentDefaults } from "./i18n/defaults.js";
|
|
7
|
-
import { t as cssSource$
|
|
8
|
-
import { t as usePlacement } from "./usePlacement-BpaIbzun.js";
|
|
9
|
-
import { a as CloseCircleIcon, i as ExternalLinkIcon, n as WarningIcon, r as LogoFrakWithName, t as GiftIcon } from "./GiftIcon-JVhSFEhP.js";
|
|
9
|
+
import { t as cssSource$4 } from "./sharedBaseCss.css-nYy9vlzH.js";
|
|
10
10
|
import { isInAppBrowser, redirectToExternalBrowser, sanitizeProductDetailsList, trackEvent } from "@frak-labs/core-sdk";
|
|
11
11
|
import { REFERRAL_SUCCESS_EVENT, getMergeToken } from "@frak-labs/core-sdk/actions";
|
|
12
12
|
import { useCallback, useEffect, useMemo, useRef, useState } from "preact/hooks";
|
|
13
13
|
import { jsx, jsxs } from "preact/jsx-runtime";
|
|
14
|
-
|
|
15
|
-
const cssSource$
|
|
14
|
+
// \0ve-inline:../../packages/design-system/src/keyframes.css.ts.vanilla.js
|
|
15
|
+
const cssSource$3 = `@keyframes keyframes_fadeIn__mnqmlt0 {
|
|
16
16
|
from {
|
|
17
17
|
opacity: 0;
|
|
18
18
|
}
|
|
@@ -44,9 +44,8 @@ const cssSource$4 = `@keyframes keyframes_fadeIn__mnqmlt0 {
|
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
46
|
`;
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
const cssSource$3 = `.inAppBanner_container__1ibpiy70 {
|
|
47
|
+
// \0ve-inline:../../packages/design-system/src/styles/inAppBanner.css.ts.vanilla.js
|
|
48
|
+
const cssSource$2 = `.inAppBanner_container__1ibpiy70 {
|
|
50
49
|
top: max(8px, var(--safe-area-inset-top, env(safe-area-inset-top, 0px)));
|
|
51
50
|
z-index: 1000;
|
|
52
51
|
-webkit-backdrop-filter: blur(12px);
|
|
@@ -144,8 +143,7 @@ const cssSource$3 = `.inAppBanner_container__1ibpiy70 {
|
|
|
144
143
|
outline-offset: 2px;
|
|
145
144
|
}
|
|
146
145
|
`;
|
|
147
|
-
|
|
148
|
-
//#region ../../packages/design-system/src/styles/inAppBanner.css.ts
|
|
146
|
+
// ../../packages/design-system/src/styles/inAppBanner.css.ts
|
|
149
147
|
var body = "inAppBanner_body__1ibpiy74";
|
|
150
148
|
var closeButton = "inAppBanner_closeButton__1ibpiy77";
|
|
151
149
|
var container = "inAppBanner_container__1ibpiy70";
|
|
@@ -154,9 +152,7 @@ var description = "inAppBanner_description__1ibpiy75";
|
|
|
154
152
|
var header = "inAppBanner_header__1ibpiy71";
|
|
155
153
|
var iconWrapper = "inAppBanner_iconWrapper__1ibpiy72";
|
|
156
154
|
var title = "inAppBanner_title__1ibpiy73";
|
|
157
|
-
|
|
158
|
-
//#endregion
|
|
159
|
-
//#region ../../packages/design-system/src/components/InAppBanner/index.tsx
|
|
155
|
+
// ../../packages/design-system/src/components/InAppBanner/index.tsx
|
|
160
156
|
function InAppBanner({ title: title$1, description: description$1, cta: cta$1, dismissLabel, onAction, onDismiss, className, classNames }) {
|
|
161
157
|
return /* @__PURE__ */ jsxs("div", {
|
|
162
158
|
className: `${container}${className ? ` ${className}` : ""}`,
|
|
@@ -203,8 +199,7 @@ function InAppBanner({ title: title$1, description: description$1, cta: cta$1, d
|
|
|
203
199
|
]
|
|
204
200
|
});
|
|
205
201
|
}
|
|
206
|
-
|
|
207
|
-
//#region \0ve-inline:src/components/Banner/Banner.css.ts.vanilla.js
|
|
202
|
+
// \0ve-inline:src/components/Banner/Banner.css.ts.vanilla.js
|
|
208
203
|
const cssSource$1 = `.Banner_rootBase__1gnumzi0 {
|
|
209
204
|
animation: .3s ease-out keyframes_fadeInDown__mnqmlt2;
|
|
210
205
|
display: flex;
|
|
@@ -285,8 +280,7 @@ const cssSource$1 = `.Banner_rootBase__1gnumzi0 {
|
|
|
285
280
|
right: 16px;
|
|
286
281
|
}
|
|
287
282
|
`;
|
|
288
|
-
|
|
289
|
-
//#region src/components/Banner/Banner.css.ts
|
|
283
|
+
// src/components/Banner/Banner.css.ts
|
|
290
284
|
var frakLogo = "Banner_frakLogo__1gnumzi9";
|
|
291
285
|
var iconSvg = "Banner_iconSvg__1gnumzi1";
|
|
292
286
|
var referral = "Banner_referral__1gnumzi2 reset_base__1831jhd0 Banner_rootBase__1gnumzi0";
|
|
@@ -296,9 +290,8 @@ var referralDescription = "Banner_referralDescription__1gnumzi7 reset_base__1831
|
|
|
296
290
|
var referralIconWrapper = "Banner_referralIconWrapper__1gnumzi3";
|
|
297
291
|
var referralImage = "Banner_referralImage__1gnumzi4";
|
|
298
292
|
var referralTitle = "Banner_referralTitle__1gnumzi6 reset_base__1831jhd0";
|
|
299
|
-
const cssSource = cssSource$
|
|
300
|
-
|
|
301
|
-
//#region src/components/Banner/Banner.tsx
|
|
293
|
+
const cssSource = cssSource$3 + cssSource$2 + cssSource$1;
|
|
294
|
+
// src/components/Banner/Banner.tsx
|
|
302
295
|
/**
|
|
303
296
|
* Auto-detecting notification banner component.
|
|
304
297
|
*
|
|
@@ -336,7 +329,7 @@ function Banner({ placement: placementId, classname = "", interaction, products,
|
|
|
336
329
|
const isInappRedirectAllowed = allowInappRedirect === true || allowInappRedirect === "true";
|
|
337
330
|
const placement = usePlacement(placementId);
|
|
338
331
|
const { shouldRender, isHidden, isClientReady } = useClientReady();
|
|
339
|
-
useLightDomStyles("frak-banner", placementId, placement?.components?.banner?.css, cssSource, cssSource$
|
|
332
|
+
useLightDomStyles("frak-banner", placementId, placement?.components?.banner?.css, cssSource, cssSource$4);
|
|
340
333
|
const [dismissed, setDismissed] = useState(false);
|
|
341
334
|
const [mode, setMode] = useState(() => {
|
|
342
335
|
if (isPreview) return resolvedPreviewMode;
|
|
@@ -518,8 +511,7 @@ function Banner({ placement: placementId, classname = "", interaction, products,
|
|
|
518
511
|
]
|
|
519
512
|
});
|
|
520
513
|
}
|
|
521
|
-
|
|
522
|
-
//#region src/components/Banner/index.ts
|
|
514
|
+
// src/components/Banner/index.ts
|
|
523
515
|
registerWebComponent(Banner, "frak-banner", [
|
|
524
516
|
"placement",
|
|
525
517
|
"classname",
|
|
@@ -536,5 +528,4 @@ registerWebComponent(Banner, "frak-banner", [
|
|
|
536
528
|
"imageUrl",
|
|
537
529
|
"allowInappRedirect"
|
|
538
530
|
], { shadow: false });
|
|
539
|
-
//#endregion
|
|
540
531
|
export { Banner };
|
package/dist/buttonShare.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { InteractionTypeKey, SharingPageProduct } from "@frak-labs/core-sdk";
|
|
2
|
-
//#region src/components/ButtonShare/types.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* The props type for {@link ButtonShare}.
|
|
5
4
|
* @inline
|
|
@@ -62,8 +61,6 @@ type ButtonShareProps = {
|
|
|
62
61
|
*/
|
|
63
62
|
preview?: string;
|
|
64
63
|
};
|
|
65
|
-
//#endregion
|
|
66
|
-
//#region src/components/ButtonShare/ButtonShare.d.ts
|
|
67
64
|
/**
|
|
68
65
|
* Button to share the current page
|
|
69
66
|
*
|
|
@@ -117,8 +114,6 @@ type ButtonShareProps = {
|
|
|
117
114
|
* @see {@link @frak-labs/core-sdk!actions.getMerchantInformation | `getMerchantInformation()`} for more info about the estimated reward fetching
|
|
118
115
|
*/
|
|
119
116
|
export declare function ButtonShare({ placement: placementId, text, classname, noRewardText, targetInteraction, products, clickAction: rawClickAction, preview }: ButtonShareProps): import("preact").JSX.Element | null;
|
|
120
|
-
//#endregion
|
|
121
|
-
//#region src/components/ButtonShare/index.d.ts
|
|
122
117
|
/**
|
|
123
118
|
* Custom element interface for `<frak-button-share>`.
|
|
124
119
|
* Combines standard {@link HTMLElement} with {@link ButtonShareProps}.
|
|
@@ -129,5 +124,4 @@ declare global {
|
|
|
129
124
|
"frak-button-share": ButtonShareElement;
|
|
130
125
|
}
|
|
131
126
|
}
|
|
132
|
-
//#endregion
|
|
133
127
|
export {};
|
package/dist/buttonShare.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { a as useClientReady, o as registerWebComponent, r as useLang, s as openSharingPage } from "./sharedCss-
|
|
2
|
-
import { i as w } from "./rewards-
|
|
3
|
-
import { t as useGlobalComponents } from "./useGlobalComponents-
|
|
4
|
-
import { t as useLightDomStyles } from "./useLightDomStyles-
|
|
5
|
-
import { t as
|
|
1
|
+
import { a as useClientReady, o as registerWebComponent, r as useLang, s as openSharingPage } from "./sharedCss-SKmJGZgN.js";
|
|
2
|
+
import { i as w } from "./rewards-CfGynCt6.js";
|
|
3
|
+
import { t as useGlobalComponents } from "./useGlobalComponents-BF47jsBt.js";
|
|
4
|
+
import { t as useLightDomStyles } from "./useLightDomStyles-wGaNXHqN.js";
|
|
5
|
+
import { t as usePlacement } from "./usePlacement-Dd7itnCf.js";
|
|
6
|
+
import { t as useReward } from "./useReward-DmukZKoh.js";
|
|
6
7
|
import { componentDefaults } from "./i18n/defaults.js";
|
|
7
|
-
import { t as usePlacement } from "./usePlacement-BpaIbzun.js";
|
|
8
8
|
import { sanitizeSharingProducts, trackEvent } from "@frak-labs/core-sdk";
|
|
9
9
|
import { useCallback, useEffect, useMemo, useRef } from "preact/hooks";
|
|
10
10
|
import { jsx } from "preact/jsx-runtime";
|
|
11
|
-
|
|
11
|
+
// src/components/ButtonShare/ButtonShare.tsx
|
|
12
12
|
/**
|
|
13
13
|
* Button to share the current page
|
|
14
14
|
*
|
|
@@ -135,8 +135,7 @@ function ButtonShare({ placement: placementId, text, classname = "", noRewardTex
|
|
|
135
135
|
children: btnText
|
|
136
136
|
});
|
|
137
137
|
}
|
|
138
|
-
|
|
139
|
-
//#region src/components/ButtonShare/index.ts
|
|
138
|
+
// src/components/ButtonShare/index.ts
|
|
140
139
|
registerWebComponent(ButtonShare, "frak-button-share", [
|
|
141
140
|
"text",
|
|
142
141
|
"placement",
|
|
@@ -147,5 +146,4 @@ registerWebComponent(ButtonShare, "frak-button-share", [
|
|
|
147
146
|
"products",
|
|
148
147
|
"preview"
|
|
149
148
|
], { shadow: false });
|
|
150
|
-
//#endregion
|
|
151
149
|
export { ButtonShare };
|
package/dist/buttonWallet.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { InteractionTypeKey } from "@frak-labs/core-sdk";
|
|
2
|
-
//#region src/components/ButtonWallet/types.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* The props type for {@link ButtonWallet}.
|
|
5
4
|
* @inline
|
|
@@ -20,8 +19,6 @@ type ButtonWalletProps = {
|
|
|
20
19
|
*/
|
|
21
20
|
targetInteraction?: InteractionTypeKey;
|
|
22
21
|
};
|
|
23
|
-
//#endregion
|
|
24
|
-
//#region src/components/ButtonWallet/ButtonWallet.d.ts
|
|
25
22
|
/**
|
|
26
23
|
* Floating circular button that opens the Frak sharing page. The
|
|
27
24
|
* `frak-button-wallet` tag name is public API (merchant markup, Magento
|
|
@@ -66,8 +63,6 @@ type ButtonWalletProps = {
|
|
|
66
63
|
* @see {@link @frak-labs/core-sdk!actions.getMerchantInformation | `getMerchantInformation()`} for more info about the estimated reward fetching
|
|
67
64
|
*/
|
|
68
65
|
export declare function ButtonWallet({ placement: placementId, classname, useReward: rawUseReward, targetInteraction }: ButtonWalletProps): import("preact").JSX.Element | null;
|
|
69
|
-
//#endregion
|
|
70
|
-
//#region src/components/ButtonWallet/index.d.ts
|
|
71
66
|
/**
|
|
72
67
|
* Custom element interface for `<frak-button-wallet>`.
|
|
73
68
|
* Combines standard {@link HTMLElement} with {@link ButtonWalletProps}.
|
|
@@ -78,5 +73,4 @@ declare global {
|
|
|
78
73
|
"frak-button-wallet": ButtonWalletElement;
|
|
79
74
|
}
|
|
80
75
|
}
|
|
81
|
-
//#endregion
|
|
82
76
|
export {};
|
package/dist/buttonWallet.js
CHANGED
|
@@ -1,19 +1,18 @@
|
|
|
1
|
-
import { a as useClientReady, o as registerWebComponent, r as useLang, s as openSharingPage, t as buildStyleContent } from "./sharedCss-
|
|
2
|
-
import { t as
|
|
1
|
+
import { a as useClientReady, o as registerWebComponent, r as useLang, s as openSharingPage, t as buildStyleContent } from "./sharedCss-SKmJGZgN.js";
|
|
2
|
+
import { t as usePlacement } from "./usePlacement-Dd7itnCf.js";
|
|
3
|
+
import { t as useReward } from "./useReward-DmukZKoh.js";
|
|
3
4
|
import { componentDefaults } from "./i18n/defaults.js";
|
|
4
|
-
import { t as usePlacement } from "./usePlacement-BpaIbzun.js";
|
|
5
5
|
import { trackEvent } from "@frak-labs/core-sdk";
|
|
6
6
|
import { useCallback, useEffect, useRef } from "preact/hooks";
|
|
7
7
|
import { Fragment, jsx, jsxs } from "preact/jsx-runtime";
|
|
8
|
-
|
|
8
|
+
// src/utils/browser/safeVibrate.ts
|
|
9
9
|
/**
|
|
10
10
|
* Attempt to vibrate the device
|
|
11
11
|
*/
|
|
12
12
|
function safeVibrate() {
|
|
13
13
|
if ("vibrate" in navigator) navigator.vibrate(10);
|
|
14
14
|
}
|
|
15
|
-
|
|
16
|
-
//#region src/components/ButtonWallet/assets/WalletGiftIcon.tsx
|
|
15
|
+
// src/components/ButtonWallet/assets/WalletGiftIcon.tsx
|
|
17
16
|
function WalletGiftIcon(props) {
|
|
18
17
|
return /* @__PURE__ */ jsxs("svg", {
|
|
19
18
|
fill: "none",
|
|
@@ -30,8 +29,7 @@ function WalletGiftIcon(props) {
|
|
|
30
29
|
})]
|
|
31
30
|
});
|
|
32
31
|
}
|
|
33
|
-
|
|
34
|
-
//#region src/components/ButtonWallet/ButtonWallet.tsx
|
|
32
|
+
// src/components/ButtonWallet/ButtonWallet.tsx
|
|
35
33
|
const componentCss = `
|
|
36
34
|
.button {
|
|
37
35
|
all: unset;
|
|
@@ -174,13 +172,11 @@ function ButtonWallet({ placement: placementId, classname = "", useReward: rawUs
|
|
|
174
172
|
})]
|
|
175
173
|
})] });
|
|
176
174
|
}
|
|
177
|
-
|
|
178
|
-
//#region src/components/ButtonWallet/index.ts
|
|
175
|
+
// src/components/ButtonWallet/index.ts
|
|
179
176
|
registerWebComponent(ButtonWallet, "frak-button-wallet", [
|
|
180
177
|
"placement",
|
|
181
178
|
"classname",
|
|
182
179
|
"useReward",
|
|
183
180
|
"targetInteraction"
|
|
184
181
|
], { shadow: true });
|
|
185
|
-
//#endregion
|
|
186
182
|
export { ButtonWallet };
|
package/dist/i18n/defaults.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Language } from "@frak-labs/core-sdk";
|
|
2
|
-
//#region src/i18n/defaults.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* Shape of the built-in copy for every SDK Web Component. Declared explicitly
|
|
5
4
|
* so each supported {@link Language} is forced to provide the exact same set
|
|
@@ -112,5 +111,4 @@ type ComponentCopy = {
|
|
|
112
111
|
* keyed by the active language keeps an i18n runtime out of the CDN bundle.
|
|
113
112
|
*/
|
|
114
113
|
export declare const componentDefaults: Record<Language, ComponentCopy>;
|
|
115
|
-
//#endregion
|
|
116
114
|
export {};
|
package/dist/i18n/defaults.js
CHANGED
package/dist/openInApp.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/components/OpenInAppButton/types.d.ts
|
|
2
1
|
/**
|
|
3
2
|
* The props type for {@link OpenInAppButton}.
|
|
4
3
|
* @inline
|
|
@@ -17,8 +16,6 @@ type OpenInAppButtonProps = {
|
|
|
17
16
|
*/
|
|
18
17
|
classname?: string;
|
|
19
18
|
};
|
|
20
|
-
//#endregion
|
|
21
|
-
//#region src/components/OpenInAppButton/OpenInAppButton.d.ts
|
|
22
19
|
/**
|
|
23
20
|
* Button to open the Frak Wallet mobile app via deep link
|
|
24
21
|
*
|
|
@@ -46,8 +43,6 @@ type OpenInAppButtonProps = {
|
|
|
46
43
|
* ```
|
|
47
44
|
*/
|
|
48
45
|
export declare function OpenInAppButton({ placement: placementId, text, classname }: OpenInAppButtonProps): import("preact").JSX.Element | null;
|
|
49
|
-
//#endregion
|
|
50
|
-
//#region src/components/OpenInAppButton/index.d.ts
|
|
51
46
|
/**
|
|
52
47
|
* Custom element interface for `<frak-open-in-app>`.
|
|
53
48
|
* Combines standard {@link HTMLElement} with {@link OpenInAppButtonProps}.
|
|
@@ -58,5 +53,4 @@ declare global {
|
|
|
58
53
|
"frak-open-in-app": OpenInAppButtonElement;
|
|
59
54
|
}
|
|
60
55
|
}
|
|
61
|
-
//#endregion
|
|
62
56
|
export {};
|
package/dist/openInApp.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { a as useClientReady, o as registerWebComponent, r as useLang } from "./sharedCss-
|
|
2
|
-
import { t as useLightDomStyles } from "./useLightDomStyles-
|
|
1
|
+
import { a as useClientReady, o as registerWebComponent, r as useLang } from "./sharedCss-SKmJGZgN.js";
|
|
2
|
+
import { t as useLightDomStyles } from "./useLightDomStyles-wGaNXHqN.js";
|
|
3
|
+
import { t as usePlacement } from "./usePlacement-Dd7itnCf.js";
|
|
3
4
|
import { componentDefaults } from "./i18n/defaults.js";
|
|
4
|
-
import { t as usePlacement } from "./usePlacement-BpaIbzun.js";
|
|
5
5
|
import { DEEP_LINK_SCHEME, isMobile, trackEvent, triggerDeepLinkWithFallback } from "@frak-labs/core-sdk";
|
|
6
6
|
import { jsx } from "preact/jsx-runtime";
|
|
7
|
-
|
|
7
|
+
// src/actions/openInApp.ts
|
|
8
8
|
const DEFAULT_PATH = "wallet";
|
|
9
9
|
/**
|
|
10
10
|
* Open the Frak Wallet mobile app via deep link with fallback detection.
|
|
@@ -27,13 +27,11 @@ function openFrakWalletApp(path = DEFAULT_PATH, placement) {
|
|
|
27
27
|
});
|
|
28
28
|
} });
|
|
29
29
|
}
|
|
30
|
-
|
|
31
|
-
//#region src/hooks/useIsMobile.ts
|
|
30
|
+
// src/hooks/useIsMobile.ts
|
|
32
31
|
function useIsMobile() {
|
|
33
32
|
return { isMobile: isMobile() };
|
|
34
33
|
}
|
|
35
|
-
|
|
36
|
-
//#region src/components/OpenInAppButton/OpenInAppButton.tsx
|
|
34
|
+
// src/components/OpenInAppButton/OpenInAppButton.tsx
|
|
37
35
|
/**
|
|
38
36
|
* Button to open the Frak Wallet mobile app via deep link
|
|
39
37
|
*
|
|
@@ -85,12 +83,10 @@ function OpenInAppButton({ placement: placementId, text, classname = "" }) {
|
|
|
85
83
|
children: resolvedText
|
|
86
84
|
});
|
|
87
85
|
}
|
|
88
|
-
|
|
89
|
-
//#region src/components/OpenInAppButton/index.ts
|
|
86
|
+
// src/components/OpenInAppButton/index.ts
|
|
90
87
|
registerWebComponent(OpenInAppButton, "frak-open-in-app", [
|
|
91
88
|
"text",
|
|
92
89
|
"placement",
|
|
93
90
|
"classname"
|
|
94
91
|
], { shadow: false });
|
|
95
|
-
//#endregion
|
|
96
92
|
export { OpenInAppButton };
|
package/dist/postPurchase.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { SharingPageProduct } from "@frak-labs/core-sdk";
|
|
2
|
-
//#region src/components/PostPurchase/types.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* Props for the {@link PostPurchase} component.
|
|
5
4
|
* @inline
|
|
@@ -91,8 +90,6 @@ type PostPurchaseProps = {
|
|
|
91
90
|
*/
|
|
92
91
|
previewVariant?: "referrer" | "referee";
|
|
93
92
|
};
|
|
94
|
-
//#endregion
|
|
95
|
-
//#region src/components/PostPurchase/PostPurchase.d.ts
|
|
96
93
|
/**
|
|
97
94
|
* Post-purchase card component.
|
|
98
95
|
*
|
|
@@ -122,8 +119,6 @@ type PostPurchaseProps = {
|
|
|
122
119
|
* ```
|
|
123
120
|
*/
|
|
124
121
|
export 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;
|
|
125
|
-
//#endregion
|
|
126
|
-
//#region src/components/PostPurchase/index.d.ts
|
|
127
122
|
/**
|
|
128
123
|
* Custom element interface for `<frak-post-purchase>`.
|
|
129
124
|
* Combines standard {@link HTMLElement} with {@link PostPurchaseProps}.
|
|
@@ -134,5 +129,4 @@ declare global {
|
|
|
134
129
|
"frak-post-purchase": PostPurchaseElement;
|
|
135
130
|
}
|
|
136
131
|
}
|
|
137
|
-
//#endregion
|
|
138
132
|
export {};
|
package/dist/postPurchase.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { a as useClientReady, o as registerWebComponent, r as useLang, s as openSharingPage } from "./sharedCss-
|
|
2
|
-
import { i as w, n as K, t as C } from "./rewards-
|
|
3
|
-
import { t as
|
|
4
|
-
import { t as
|
|
1
|
+
import { a as useClientReady, o as registerWebComponent, r as useLang, s as openSharingPage } from "./sharedCss-SKmJGZgN.js";
|
|
2
|
+
import { i as w, n as K, t as C } from "./rewards-CfGynCt6.js";
|
|
3
|
+
import { r as LogoFrakWithName, t as GiftIcon } from "./GiftIcon-B9k_syq6.js";
|
|
4
|
+
import { t as useGlobalComponents } from "./useGlobalComponents-BF47jsBt.js";
|
|
5
|
+
import { t as useLightDomStyles } from "./useLightDomStyles-wGaNXHqN.js";
|
|
6
|
+
import { t as usePlacement } from "./usePlacement-Dd7itnCf.js";
|
|
5
7
|
import { componentDefaults } from "./i18n/defaults.js";
|
|
6
|
-
import { t as cssSource$2 } from "./sharedBaseCss.css-
|
|
7
|
-
import { t as usePlacement } from "./usePlacement-BpaIbzun.js";
|
|
8
|
-
import { r as LogoFrakWithName, t as GiftIcon } from "./GiftIcon-JVhSFEhP.js";
|
|
8
|
+
import { t as cssSource$2 } from "./sharedBaseCss.css-nYy9vlzH.js";
|
|
9
9
|
import { sanitizeSharingProducts, trackEvent } from "@frak-labs/core-sdk";
|
|
10
10
|
import { getMerchantInformation, getUserReferralStatus, trackPurchaseStatus } from "@frak-labs/core-sdk/actions";
|
|
11
11
|
import { useCallback, useEffect, useMemo, useRef, useState } from "preact/hooks";
|
|
12
12
|
import { jsx, jsxs } from "preact/jsx-runtime";
|
|
13
13
|
import { FrakRpcError, RpcErrorCodes } from "@frak-labs/frame-connector";
|
|
14
|
-
|
|
14
|
+
// \0ve-inline:src/components/PostPurchase/PostPurchase.css.ts.vanilla.js
|
|
15
15
|
const cssSource$1 = `.PostPurchase_card__5fv5lh0 {
|
|
16
16
|
background-color: var(--surface-background__pbq4akc);
|
|
17
17
|
border: 1px solid var(--border-default__pbq4akv);
|
|
@@ -126,8 +126,7 @@ var icon = "PostPurchase_icon__5fv5lh7";
|
|
|
126
126
|
var imageWrapper = "PostPurchase_imageWrapper__5fv5lh9";
|
|
127
127
|
var message = "PostPurchase_message__5fv5lh5";
|
|
128
128
|
const cssSource = cssSource$1;
|
|
129
|
-
|
|
130
|
-
//#region src/components/PostPurchase/PostPurchase.tsx
|
|
129
|
+
// src/components/PostPurchase/PostPurchase.tsx
|
|
131
130
|
/**
|
|
132
131
|
* `onChainMetadata.domain` is a bare host and `sharing-url` defaults to `""` in
|
|
133
132
|
* the WordPress shortcode; both would throw inside `FrakContextManager.update`.
|
|
@@ -368,8 +367,7 @@ function PostPurchase({ customerId, orderId, token, sharingUrl, merchantId, plac
|
|
|
368
367
|
})
|
|
369
368
|
});
|
|
370
369
|
}
|
|
371
|
-
|
|
372
|
-
//#region src/components/PostPurchase/index.ts
|
|
370
|
+
// src/components/PostPurchase/index.ts
|
|
373
371
|
registerWebComponent(PostPurchase, "frak-post-purchase", [
|
|
374
372
|
"customerId",
|
|
375
373
|
"orderId",
|
|
@@ -388,5 +386,4 @@ registerWebComponent(PostPurchase, "frak-post-purchase", [
|
|
|
388
386
|
"previewVariant",
|
|
389
387
|
"imageUrl"
|
|
390
388
|
], { shadow: false });
|
|
391
|
-
//#endregion
|
|
392
389
|
export { PostPurchase };
|