@frak-labs/components 1.1.0-beta.ea6cff28 → 1.2.0-beta.44424a2f

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/README.md +24 -2
  2. package/cdn/{Banner.DGYexiiS.js → Banner.Zaqy93tl.js} +3 -3
  3. package/cdn/ButtonShare.rG47WQjf.js +1 -0
  4. package/cdn/ButtonWallet.C13UfI2G.js +40 -0
  5. package/cdn/{GiftIcon.C1uAOx7A.js → GiftIcon.CPyeWQNR.js} +1 -1
  6. package/cdn/OpenInAppButton.d-omgD0k.js +1 -0
  7. package/cdn/PostPurchase._3t6CtvV.js +89 -0
  8. package/cdn/components.js +1 -1
  9. package/cdn/defaults.CmUvOlLQ.js +58 -0
  10. package/cdn/loader.js +10 -50
  11. package/cdn/rewards.0JylBHNY.js +1 -0
  12. package/cdn/useGlobalComponents.C7wnXWOg.js +1 -0
  13. package/cdn/useLightDomStyles.B7MVlVVJ.js +1 -0
  14. package/cdn/{useReward.CXgeQcsH.js → useReward.CaBorN5T.js} +1 -1
  15. package/dist/{GiftIcon-BhL0bhVu.js → GiftIcon-BmGGodb2.js} +8 -8
  16. package/dist/banner.d.ts +3 -4
  17. package/dist/banner.js +7 -7
  18. package/dist/buttonShare.d.ts +10 -9
  19. package/dist/buttonShare.js +27 -14
  20. package/dist/buttonWallet.d.ts +7 -6
  21. package/dist/buttonWallet.js +53 -34
  22. package/dist/i18n/defaults.d.ts +2 -3
  23. package/dist/i18n/defaults.js +2 -2
  24. package/dist/openInApp.d.ts +4 -5
  25. package/dist/openInApp.js +6 -6
  26. package/dist/postPurchase.d.ts +6 -5
  27. package/dist/postPurchase.js +26 -9
  28. package/dist/{rewards-Cxn-bgzC.js → rewards-DoVY1pWr.js} +7 -10
  29. package/dist/{useGlobalComponents-CeTO2xYs.js → useGlobalComponents-Cj7uGBwD.js} +1 -1
  30. package/dist/{useLightDomStyles-B2U96tzU.js → useLightDomStyles-BW6DY5sC.js} +1 -1
  31. package/dist/{usePlacement-Bpo25qjA.js → usePlacement-iFDQqtJn.js} +17 -40
  32. package/dist/{useReward-BMYSGY-o.js → useReward-k7RF3DhH.js} +1 -1
  33. package/package.json +14 -14
  34. package/cdn/ButtonShare.DFg0XCDd.js +0 -1
  35. package/cdn/ButtonWallet.sGDvcAXt.js +0 -40
  36. package/cdn/OpenInAppButton.CxLPpqFO.js +0 -1
  37. package/cdn/PostPurchase.D6Mzbjtu.js +0 -89
  38. package/cdn/defaults.BEvoSiy5.js +0 -58
  39. package/cdn/embeddedWallet.BjQSXLkP.js +0 -1
  40. package/cdn/rewards.B2smvfIs.js +0 -1
  41. package/cdn/useGlobalComponents.CqTI84Mw.js +0 -1
  42. package/cdn/useLightDomStyles.CKtA4k-_.js +0 -1
  43. 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.7/node_modules/preact/compat/dist/compat.module.js
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(c) : c());
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 c = function() {
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 c = i.toLowerCase();
171
- "defaultValue" === i && "value" in t && null == t.value ? i = "value" : "download" === i && !0 === l ? l = "" : "translate" === c && "no" === l ? l = !1 : "o" === c[0] && "n" === c[1] ? "ondoubleclick" === c ? i = "ondblclick" : "onchange" !== c || "input" !== e && "textarea" !== e || X(t.type) ? "onfocus" === c ? i = "onfocusin" : "onblur" === c ? i = "onfocusout" : J.test(i) && (i = c) : c = i = "oninput" : o && G.test(i) ? i = i.replace(K, "-$&").toLowerCase() : null === l && (l = void 0), "oninput" === c && u[i = c] && (i = "oninputCapture"), u[i] = l;
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 cn = options.diffed;
185
+ var fn = options.diffed;
186
186
  options.diffed = function(n) {
187
- cn && cn(n);
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}\n[data-theme='dark'] {\n --text-primary__pbq4ak0: #ffffff;\n --text-secondary__pbq4ak1: #f7f7f7;\n --text-tertiary__pbq4ak2: #f5f5f5;\n --text-disabled__pbq4ak3: #a3a3a3;\n --text-action__pbq4ak4: #668ef5;\n --text-actionHover__pbq4ak5: #0036bf;\n --text-onAction__pbq4ak6: #ffffff;\n --text-error__pbq4ak7: #e9495a;\n --text-success__pbq4ak8: #09be67;\n --text-warning__pbq4ak9: #ec7e00;\n --surface-primary__pbq4aka: #0043ef;\n --surface-secondary__pbq4akb: #00288f;\n --surface-background__pbq4akc: #000000;\n --surface-background2__pbq4akd: #000000;\n --surface-elevated__pbq4ake: #262626;\n --surface-muted__pbq4akf: #525252;\n --surface-tertiary__pbq4akg: #737373;\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: #b61627;\n --surface-success__pbq4ako: #05723e;\n --surface-warning__pbq4akp: #8e4c00;\n --border-subtle__pbq4akq: #737373;\n --border-focus__pbq4akr: #a3a3a3;\n --border-error__pbq4aks: #e31c31;\n --border-success__pbq4akt: #09be67;\n --border-warning__pbq4aku: #ec7e00;\n --border-default__pbq4akv: #525252;\n --icon-primary__pbq4akw: #ffffff;\n --icon-secondary__pbq4akx: #f7f7f7;\n --icon-tertiary__pbq4aky: #f7f7f7;\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}";
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.d.ts CHANGED
@@ -115,18 +115,17 @@ type BannerProps = {
115
115
  * <frak-banner classname="my-custom-banner"></frak-banner>
116
116
  * ```
117
117
  */
118
- 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;
118
+ 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
119
  //#endregion
120
120
  //#region src/components/Banner/index.d.ts
121
121
  /**
122
122
  * Custom element interface for `<frak-banner>`.
123
123
  * Combines standard {@link HTMLElement} with {@link BannerProps}.
124
124
  */
125
- interface BannerElement extends HTMLElement, BannerProps {}
125
+ export interface BannerElement extends HTMLElement, BannerProps {}
126
126
  declare global {
127
127
  interface HTMLElementTagNameMap {
128
128
  "frak-banner": BannerElement;
129
129
  }
130
130
  }
131
- //#endregion
132
- export { Banner, BannerElement };
131
+ //#endregion
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-Bpo25qjA.js";
2
- import { t as useGlobalComponents } from "./useGlobalComponents-CeTO2xYs.js";
3
- import { t as useLightDomStyles } from "./useLightDomStyles-B2U96tzU.js";
4
- import { i as w } from "./rewards-Cxn-bgzC.js";
5
- import { t as useReward } from "./useReward-BMYSGY-o.js";
1
+ import { i as useLang, o as useClientReady, s as registerWebComponent, t as usePlacement } from "./usePlacement-iFDQqtJn.js";
2
+ import { i as w } from "./rewards-DoVY1pWr.js";
3
+ import { t as useGlobalComponents } from "./useGlobalComponents-Cj7uGBwD.js";
4
+ import { t as useLightDomStyles } from "./useLightDomStyles-BW6DY5sC.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-BhL0bhVu.js";
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;
@@ -43,15 +43,17 @@ type ButtonShareProps = {
43
43
  */
44
44
  products?: SharingPageProduct[] | string;
45
45
  /**
46
- * Which UI to open on click.
46
+ * Reported on the `share_button_clicked` event.
47
47
  *
48
- * Legacy values (e.g. `"share-modal"`) are accepted at runtime and
49
- * gracefully route to the full-page sharing UI — the modal-flow
50
- * share path was retired in favour of `displaySharingPage`.
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?: "embedded-wallet" | "sharing-page";
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,
@@ -114,18 +116,17 @@ type ButtonShareProps = {
114
116
  * @see {@link @frak-labs/core-sdk!actions.displaySharingPage | `displaySharingPage()`} for more info about the sharing-page flow
115
117
  * @see {@link @frak-labs/core-sdk!actions.getMerchantInformation | `getMerchantInformation()`} for more info about the estimated reward fetching
116
118
  */
117
- declare function ButtonShare({ placement: placementId, text, classname, noRewardText, targetInteraction, products, clickAction: rawClickAction, preview }: ButtonShareProps): import("preact").JSX.Element | null;
119
+ export declare function ButtonShare({ placement: placementId, text, classname, noRewardText, targetInteraction, products, clickAction: rawClickAction, preview }: ButtonShareProps): import("preact").JSX.Element | null;
118
120
  //#endregion
119
121
  //#region src/components/ButtonShare/index.d.ts
120
122
  /**
121
123
  * Custom element interface for `<frak-button-share>`.
122
124
  * Combines standard {@link HTMLElement} with {@link ButtonShareProps}.
123
125
  */
124
- interface ButtonShareElement extends HTMLElement, ButtonShareProps {}
126
+ export interface ButtonShareElement extends HTMLElement, ButtonShareProps {}
125
127
  declare global {
126
128
  interface HTMLElementTagNameMap {
127
129
  "frak-button-share": ButtonShareElement;
128
130
  }
129
131
  }
130
- //#endregion
131
- export { ButtonShare, ButtonShareElement };
132
+ //#endregion
@@ -1,12 +1,11 @@
1
- import { c as openSharingPage, i as useLang, o as useClientReady, s as registerWebComponent, t as usePlacement } from "./usePlacement-Bpo25qjA.js";
2
- import { t as openEmbeddedWallet } from "./embeddedWallet-CxgyuwtP.js";
3
- import { t as useGlobalComponents } from "./useGlobalComponents-CeTO2xYs.js";
4
- import { t as useLightDomStyles } from "./useLightDomStyles-B2U96tzU.js";
5
- import { i as w } from "./rewards-Cxn-bgzC.js";
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-iFDQqtJn.js";
2
+ import { i as w } from "./rewards-DoVY1pWr.js";
3
+ import { t as useGlobalComponents } from "./useGlobalComponents-Cj7uGBwD.js";
4
+ import { t as useLightDomStyles } from "./useLightDomStyles-BW6DY5sC.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
- import { useCallback, useMemo } from "preact/hooks";
8
+ import { useCallback, useEffect, useMemo, useRef } from "preact/hooks";
10
9
  import { jsx } from "preact/jsx-runtime";
11
10
  //#region src/components/ButtonShare/ButtonShare.tsx
12
11
  /**
@@ -68,11 +67,11 @@ function ButtonShare({ placement: placementId, text, classname = "", noRewardTex
68
67
  const globalComponents = useGlobalComponents();
69
68
  const componentConfig = placement?.components?.buttonShare ?? globalComponents?.buttonShare;
70
69
  useLightDomStyles("frak-button-share", placementId, componentConfig?.css);
71
- const resolvedTargetInteraction = useMemo(() => placement?.targetInteraction !== void 0 ? placement.targetInteraction : targetInteraction, [placement?.targetInteraction, targetInteraction]);
70
+ const resolvedTargetInteraction = placement?.targetInteraction !== void 0 ? placement.targetInteraction : targetInteraction;
72
71
  const resolvedText = componentConfig?.text ?? text ?? componentDefaults[lang].buttonShare.text;
73
72
  const resolvedNoRewardText = componentConfig?.noRewardText ?? noRewardText;
74
- const wantsReward = useMemo(() => resolvedText.includes("{REWARD}"), [resolvedText]);
75
- const resolvedClickAction = useMemo(() => componentConfig?.clickAction ?? rawClickAction ?? "sharing-page", [componentConfig?.clickAction, rawClickAction]);
73
+ const wantsReward = resolvedText.includes("{REWARD}");
74
+ const resolvedClickAction = componentConfig?.clickAction ?? rawClickAction ?? "sharing-page";
76
75
  const { shouldRender, isHidden, isClientReady } = useClientReady();
77
76
  const parsedProducts = useMemo(() => sanitizeSharingProducts(products), [products]);
78
77
  const { reward } = useReward(wantsReward && isClientReady, resolvedTargetInteraction, void 0, parsedProducts);
@@ -86,6 +85,24 @@ function ButtonShare({ placement: placementId, text, classname = "", noRewardTex
86
85
  resolvedNoRewardText,
87
86
  reward
88
87
  ]);
88
+ const trackedImpressionRef = useRef(false);
89
+ useEffect(() => {
90
+ if (isPreview || trackedImpressionRef.current) return;
91
+ if (!isClientReady || !shouldRender || isHidden) return;
92
+ trackEvent(window.FrakSetup?.client, "share_button_impression", {
93
+ placement: placementId,
94
+ target_interaction: resolvedTargetInteraction,
95
+ has_reward: Boolean(reward)
96
+ });
97
+ trackedImpressionRef.current = true;
98
+ }, [
99
+ isPreview,
100
+ isClientReady,
101
+ shouldRender,
102
+ isHidden,
103
+ placementId,
104
+ resolvedTargetInteraction
105
+ ]);
89
106
  const onClick = useCallback(() => {
90
107
  if (isPreview) return;
91
108
  trackEvent(window.FrakSetup.client, "share_button_clicked", {
@@ -94,10 +111,6 @@ function ButtonShare({ placement: placementId, text, classname = "", noRewardTex
94
111
  has_reward: Boolean(reward),
95
112
  click_action: resolvedClickAction
96
113
  });
97
- if (resolvedClickAction === "embedded-wallet") {
98
- openEmbeddedWallet(resolvedTargetInteraction, placementId);
99
- return;
100
- }
101
114
  openSharingPage(resolvedTargetInteraction, placementId, { products: parsedProducts });
102
115
  }, [
103
116
  isPreview,
@@ -23,7 +23,9 @@ type ButtonWalletProps = {
23
23
  //#endregion
24
24
  //#region src/components/ButtonWallet/ButtonWallet.d.ts
25
25
  /**
26
- * Button to open wallet modal
26
+ * Floating circular button that opens the Frak sharing page. The
27
+ * `frak-button-wallet` tag name is public API (merchant markup, Magento
28
+ * template), so it stays even though it no longer names the surface.
27
29
  *
28
30
  * @param args
29
31
  * @returns The wallet button with `<button>` tag
@@ -60,21 +62,20 @@ type ButtonWalletProps = {
60
62
  * <frak-button-wallet placement="hero-wallet"></frak-button-wallet>
61
63
  * ```
62
64
  *
63
- * @see {@link @frak-labs/core-sdk!actions.modalBuilder | `modalBuilder()`} for more info about the modal display
65
+ * @see {@link @frak-labs/core-sdk!actions.displaySharingPage | `displaySharingPage()`} for more info about the sharing page
64
66
  * @see {@link @frak-labs/core-sdk!actions.getMerchantInformation | `getMerchantInformation()`} for more info about the estimated reward fetching
65
67
  */
66
- declare function ButtonWallet({ placement: placementId, classname, useReward: rawUseReward, targetInteraction }: ButtonWalletProps): import("preact").JSX.Element | null;
68
+ export declare function ButtonWallet({ placement: placementId, classname, useReward: rawUseReward, targetInteraction }: ButtonWalletProps): import("preact").JSX.Element | null;
67
69
  //#endregion
68
70
  //#region src/components/ButtonWallet/index.d.ts
69
71
  /**
70
72
  * Custom element interface for `<frak-button-wallet>`.
71
73
  * Combines standard {@link HTMLElement} with {@link ButtonWalletProps}.
72
74
  */
73
- interface ButtonWalletElement extends HTMLElement, ButtonWalletProps {}
75
+ export interface ButtonWalletElement extends HTMLElement, ButtonWalletProps {}
74
76
  declare global {
75
77
  interface HTMLElementTagNameMap {
76
78
  "frak-button-wallet": ButtonWalletElement;
77
79
  }
78
80
  }
79
- //#endregion
80
- export { ButtonWallet, ButtonWalletElement };
81
+ //#endregion
@@ -1,11 +1,19 @@
1
- import { i as useLang, n as buildStyleContent, o as useClientReady, s as registerWebComponent, t as usePlacement } from "./usePlacement-Bpo25qjA.js";
2
- import { t as openEmbeddedWallet } from "./embeddedWallet-CxgyuwtP.js";
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-iFDQqtJn.js";
2
+ import { t as useReward } from "./useReward-k7RF3DhH.js";
4
3
  import { componentDefaults } from "./i18n/defaults.js";
5
- import { useEffect, useMemo, useState } from "preact/hooks";
4
+ import { trackEvent } from "@frak-labs/core-sdk";
5
+ import { useCallback, useEffect, useRef } from "preact/hooks";
6
6
  import { Fragment, jsx, jsxs } from "preact/jsx-runtime";
7
- //#region src/components/ButtonWallet/assets/GiftIcon.tsx
8
- function GiftIcon(props) {
7
+ //#region src/utils/browser/safeVibrate.ts
8
+ /**
9
+ * Attempt to vibrate the device
10
+ */
11
+ function safeVibrate() {
12
+ if ("vibrate" in navigator) navigator.vibrate(10);
13
+ }
14
+ //#endregion
15
+ //#region src/components/ButtonWallet/assets/WalletGiftIcon.tsx
16
+ function WalletGiftIcon(props) {
9
17
  return /* @__PURE__ */ jsxs("svg", {
10
18
  fill: "none",
11
19
  height: "1em",
@@ -22,21 +30,6 @@ function GiftIcon(props) {
22
30
  });
23
31
  }
24
32
  //#endregion
25
- //#region src/utils/browser/safeVibrate.ts
26
- /**
27
- * Attempt to vibrate the device
28
- */
29
- function safeVibrate() {
30
- if ("vibrate" in navigator) navigator.vibrate(10);
31
- else console.log("Vibration not supported");
32
- }
33
- //#endregion
34
- //#region src/components/ButtonWallet/utils.ts
35
- function openWalletModal(targetInteraction, placement) {
36
- safeVibrate();
37
- openEmbeddedWallet(targetInteraction, placement);
38
- }
39
- //#endregion
40
33
  //#region src/components/ButtonWallet/ButtonWallet.tsx
41
34
  const componentCss = `
42
35
  .button {
@@ -79,7 +72,9 @@ const componentCss = `
79
72
  }
80
73
  `;
81
74
  /**
82
- * Button to open wallet modal
75
+ * Floating circular button that opens the Frak sharing page. The
76
+ * `frak-button-wallet` tag name is public API (merchant markup, Magento
77
+ * template), so it stays even though it no longer names the surface.
83
78
  *
84
79
  * @param args
85
80
  * @returns The wallet button with `<button>` tag
@@ -116,22 +111,48 @@ const componentCss = `
116
111
  * <frak-button-wallet placement="hero-wallet"></frak-button-wallet>
117
112
  * ```
118
113
  *
119
- * @see {@link @frak-labs/core-sdk!actions.modalBuilder | `modalBuilder()`} for more info about the modal display
114
+ * @see {@link @frak-labs/core-sdk!actions.displaySharingPage | `displaySharingPage()`} for more info about the sharing page
120
115
  * @see {@link @frak-labs/core-sdk!actions.getMerchantInformation | `getMerchantInformation()`} for more info about the estimated reward fetching
121
116
  */
122
117
  function ButtonWallet({ placement: placementId, classname = "", useReward: rawUseReward, targetInteraction }) {
123
118
  const lang = useLang();
124
119
  const placement = usePlacement(placementId);
125
- const resolvedTargetInteraction = useMemo(() => placement?.targetInteraction !== void 0 ? placement.targetInteraction : targetInteraction, [placement?.targetInteraction, targetInteraction]);
126
- const shouldUseReward = useMemo(() => rawUseReward === true, [rawUseReward]);
120
+ const resolvedTargetInteraction = placement?.targetInteraction !== void 0 ? placement.targetInteraction : targetInteraction;
121
+ const shouldUseReward = rawUseReward === true;
127
122
  const { shouldRender, isHidden, isClientReady } = useClientReady();
128
123
  const { reward } = useReward(shouldUseReward && isClientReady, resolvedTargetInteraction);
129
- const [position, setPosition] = useState("right");
124
+ const position = placement?.components?.buttonWallet?.position ?? window.FrakSetup?.modalWalletConfig?.metadata?.position ?? "right";
125
+ const trackedImpressionRef = useRef(false);
130
126
  useEffect(() => {
131
- const placementPosition = placement?.components?.buttonWallet?.position;
132
- const configPosition = window.FrakSetup?.modalWalletConfig?.metadata?.position;
133
- setPosition(placementPosition ?? configPosition ?? "right");
134
- }, [placement?.components?.buttonWallet?.position]);
127
+ if (trackedImpressionRef.current) return;
128
+ if (!isClientReady || !shouldRender || isHidden) return;
129
+ trackEvent(window.FrakSetup?.client, "share_button_impression", {
130
+ placement: placementId,
131
+ target_interaction: resolvedTargetInteraction,
132
+ has_reward: Boolean(reward)
133
+ });
134
+ trackedImpressionRef.current = true;
135
+ }, [
136
+ isClientReady,
137
+ shouldRender,
138
+ isHidden,
139
+ placementId,
140
+ resolvedTargetInteraction
141
+ ]);
142
+ const onClick = useCallback(() => {
143
+ trackEvent(window.FrakSetup.client, "share_button_clicked", {
144
+ placement: placementId,
145
+ target_interaction: resolvedTargetInteraction,
146
+ has_reward: Boolean(reward),
147
+ click_action: "sharing-page"
148
+ });
149
+ safeVibrate();
150
+ openSharingPage(resolvedTargetInteraction, placementId);
151
+ }, [
152
+ placementId,
153
+ resolvedTargetInteraction,
154
+ reward
155
+ ]);
135
156
  if (!shouldRender || isHidden) return null;
136
157
  const buttonClass = [
137
158
  "button",
@@ -145,10 +166,8 @@ function ButtonWallet({ placement: placementId, classname = "", useReward: rawUs
145
166
  part: "button",
146
167
  disabled: !isClientReady,
147
168
  class: buttonClass,
148
- onClick: () => {
149
- openWalletModal(resolvedTargetInteraction, placementId);
150
- },
151
- children: [/* @__PURE__ */ jsx(GiftIcon, {}), reward && /* @__PURE__ */ jsx("span", {
169
+ onClick,
170
+ children: [/* @__PURE__ */ jsx(WalletGiftIcon, {}), reward && /* @__PURE__ */ jsx("span", {
152
171
  class: "reward",
153
172
  children: reward
154
173
  })]
@@ -50,6 +50,5 @@ type ComponentCopy = {
50
50
  * the `Language` union in `@frak-labs/core-sdk` — no new dependency, no
51
51
  * merchant action, no SDK API change.
52
52
  */
53
- declare const componentDefaults: Record<Language, ComponentCopy>;
54
- //#endregion
55
- export { componentDefaults };
53
+ export declare const componentDefaults: Record<Language, ComponentCopy>;
54
+ //#endregion
@@ -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: "Open wallet" },
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: "Ouvrir le porte-monnaie" },
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é !",
@@ -40,23 +40,22 @@ type OpenInAppButtonProps = {
40
40
  * ```
41
41
  *
42
42
  * @example
43
- * With login action:
43
+ * Using a custom class:
44
44
  * ```html
45
45
  * <frak-open-in-app classname="button button-primary"></frak-open-in-app>
46
46
  * ```
47
47
  */
48
- declare function OpenInAppButton({ placement: placementId, text, classname }: OpenInAppButtonProps): import("preact").JSX.Element | null;
48
+ export declare function OpenInAppButton({ placement: placementId, text, classname }: OpenInAppButtonProps): import("preact").JSX.Element | null;
49
49
  //#endregion
50
50
  //#region src/components/OpenInAppButton/index.d.ts
51
51
  /**
52
52
  * Custom element interface for `<frak-open-in-app>`.
53
53
  * Combines standard {@link HTMLElement} with {@link OpenInAppButtonProps}.
54
54
  */
55
- interface OpenInAppButtonElement extends HTMLElement, OpenInAppButtonProps {}
55
+ export interface OpenInAppButtonElement extends HTMLElement, OpenInAppButtonProps {}
56
56
  declare global {
57
57
  interface HTMLElementTagNameMap {
58
58
  "frak-open-in-app": OpenInAppButtonElement;
59
59
  }
60
60
  }
61
- //#endregion
62
- export { OpenInAppButton, OpenInAppButtonElement };
61
+ //#endregion
package/dist/openInApp.js CHANGED
@@ -1,8 +1,7 @@
1
- import { i as useLang, o as useClientReady, s as registerWebComponent, t as usePlacement } from "./usePlacement-Bpo25qjA.js";
2
- import { t as useLightDomStyles } from "./useLightDomStyles-B2U96tzU.js";
1
+ import { i as useLang, o as useClientReady, s as registerWebComponent, t as usePlacement } from "./usePlacement-iFDQqtJn.js";
2
+ import { t as useLightDomStyles } from "./useLightDomStyles-BW6DY5sC.js";
3
3
  import { componentDefaults } from "./i18n/defaults.js";
4
4
  import { DEEP_LINK_SCHEME, isMobile, trackEvent, triggerDeepLinkWithFallback } from "@frak-labs/core-sdk";
5
- import { useMemo } from "preact/hooks";
6
5
  import { jsx } from "preact/jsx-runtime";
7
6
  //#region src/actions/openInApp.ts
8
7
  const DEFAULT_PATH = "wallet";
@@ -19,7 +18,8 @@ function openFrakWalletApp(path = DEFAULT_PATH, placement) {
19
18
  path,
20
19
  placement
21
20
  });
22
- triggerDeepLinkWithFallback(`${DEEP_LINK_SCHEME}${path}`, { onFallback: () => {
21
+ const deepLink = `${DEEP_LINK_SCHEME}${path}`;
22
+ triggerDeepLinkWithFallback(deepLink, { onFallback: () => {
23
23
  if (client) trackEvent(client, "app_not_installed", {
24
24
  path,
25
25
  placement
@@ -29,7 +29,7 @@ function openFrakWalletApp(path = DEFAULT_PATH, placement) {
29
29
  //#endregion
30
30
  //#region src/hooks/useIsMobile.ts
31
31
  function useIsMobile() {
32
- return { isMobile: useMemo(() => isMobile(), []) };
32
+ return { isMobile: isMobile() };
33
33
  }
34
34
  //#endregion
35
35
  //#region src/components/OpenInAppButton/OpenInAppButton.tsx
@@ -54,7 +54,7 @@ function useIsMobile() {
54
54
  * ```
55
55
  *
56
56
  * @example
57
- * With login action:
57
+ * Using a custom class:
58
58
  * ```html
59
59
  * <frak-open-in-app classname="button button-primary"></frak-open-in-app>
60
60
  * ```
@@ -16,7 +16,9 @@ type PostPurchaseProps = {
16
16
  */
17
17
  orderId?: string;
18
18
  /**
19
- * Checkout token for purchase tracking fallback.
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
  /**
@@ -119,18 +121,17 @@ type PostPurchaseProps = {
119
121
  * ></frak-post-purchase>
120
122
  * ```
121
123
  */
122
- 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;
124
+ 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;
123
125
  //#endregion
124
126
  //#region src/components/PostPurchase/index.d.ts
125
127
  /**
126
128
  * Custom element interface for `<frak-post-purchase>`.
127
129
  * Combines standard {@link HTMLElement} with {@link PostPurchaseProps}.
128
130
  */
129
- interface PostPurchaseElement extends HTMLElement, PostPurchaseProps {}
131
+ export interface PostPurchaseElement extends HTMLElement, PostPurchaseProps {}
130
132
  declare global {
131
133
  interface HTMLElementTagNameMap {
132
134
  "frak-post-purchase": PostPurchaseElement;
133
135
  }
134
136
  }
135
- //#endregion
136
- export { PostPurchase, PostPurchaseElement };
137
+ //#endregion
@@ -1,9 +1,9 @@
1
- import { c as openSharingPage, i as useLang, o as useClientReady, s as registerWebComponent, t as usePlacement } from "./usePlacement-Bpo25qjA.js";
2
- import { t as useGlobalComponents } from "./useGlobalComponents-CeTO2xYs.js";
3
- import { t as useLightDomStyles } from "./useLightDomStyles-B2U96tzU.js";
4
- import { i as w, n as K, t as C } from "./rewards-Cxn-bgzC.js";
1
+ import { c as openSharingPage, i as useLang, o as useClientReady, s as registerWebComponent, t as usePlacement } from "./usePlacement-iFDQqtJn.js";
2
+ import { i as w, n as K, t as C } from "./rewards-DoVY1pWr.js";
3
+ import { t as useGlobalComponents } from "./useGlobalComponents-Cj7uGBwD.js";
4
+ import { t as useLightDomStyles } from "./useLightDomStyles-BW6DY5sC.js";
5
5
  import { componentDefaults } from "./i18n/defaults.js";
6
- import { i as LogoFrakWithName, n as cssSource$2, t as GiftIcon } from "./GiftIcon-BhL0bhVu.js";
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: [card, classname].filter(Boolean).join(" "),
301
+ className: cardClass,
285
302
  children: /* @__PURE__ */ jsxs("div", {
286
303
  class: cardLayout,
287
304
  children: [/* @__PURE__ */ jsxs("div", {