@frak-labs/components 1.1.0-beta.b32fc3eb → 1.1.0-beta.d4c586d8

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 (42) hide show
  1. package/cdn/{Banner.DGYexiiS.js → Banner.Du-5pBTw.js} +3 -3
  2. package/cdn/ButtonShare.BC5qtW2x.js +1 -0
  3. package/cdn/ButtonWallet.oZj_GoNS.js +40 -0
  4. package/cdn/{GiftIcon.C1uAOx7A.js → GiftIcon.CPyeWQNR.js} +1 -1
  5. package/cdn/OpenInAppButton.OtCY_hYH.js +1 -0
  6. package/cdn/PostPurchase.Dg7qWPR_.js +89 -0
  7. package/cdn/components.js +1 -1
  8. package/cdn/defaults.CmUvOlLQ.js +58 -0
  9. package/cdn/loader.js +10 -50
  10. package/cdn/rewards.0JylBHNY.js +1 -0
  11. package/cdn/useGlobalComponents.C7wnXWOg.js +1 -0
  12. package/cdn/useLightDomStyles.B7MVlVVJ.js +1 -0
  13. package/cdn/{useReward.CXgeQcsH.js → useReward.CaBorN5T.js} +1 -1
  14. package/dist/{GiftIcon-BhL0bhVu.js → GiftIcon-BmGGodb2.js} +8 -8
  15. package/dist/banner.d.ts +3 -4
  16. package/dist/banner.js +7 -7
  17. package/dist/buttonShare.d.ts +10 -9
  18. package/dist/buttonShare.js +5 -10
  19. package/dist/buttonWallet.d.ts +10 -6
  20. package/dist/buttonWallet.js +34 -10
  21. package/dist/i18n/defaults.d.ts +2 -3
  22. package/dist/i18n/defaults.js +2 -2
  23. package/dist/openInApp.d.ts +3 -4
  24. package/dist/openInApp.js +4 -3
  25. package/dist/postPurchase.d.ts +6 -5
  26. package/dist/postPurchase.js +26 -9
  27. package/dist/{rewards-Cxn-bgzC.js → rewards-DoVY1pWr.js} +7 -10
  28. package/dist/{useGlobalComponents-CeTO2xYs.js → useGlobalComponents-DFv33ujB.js} +1 -1
  29. package/dist/{useLightDomStyles-B2U96tzU.js → useLightDomStyles-B_IbOqJZ.js} +1 -1
  30. package/dist/{usePlacement-Bpo25qjA.js → usePlacement-DtwWaLHO.js} +3 -1
  31. package/dist/{useReward-BMYSGY-o.js → useReward-k7RF3DhH.js} +1 -1
  32. package/package.json +14 -14
  33. package/cdn/ButtonShare.DFg0XCDd.js +0 -1
  34. package/cdn/ButtonWallet.sGDvcAXt.js +0 -40
  35. package/cdn/OpenInAppButton.CxLPpqFO.js +0 -1
  36. package/cdn/PostPurchase.D6Mzbjtu.js +0 -89
  37. package/cdn/defaults.BEvoSiy5.js +0 -58
  38. package/cdn/embeddedWallet.BjQSXLkP.js +0 -1
  39. package/cdn/rewards.B2smvfIs.js +0 -1
  40. package/cdn/useGlobalComponents.CqTI84Mw.js +0 -1
  41. package/cdn/useLightDomStyles.CKtA4k-_.js +0 -1
  42. 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-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-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,9 +1,8 @@
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-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,
@@ -23,7 +23,12 @@ 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.
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,21 +65,20 @@ 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.modalBuilder | `modalBuilder()`} for more info about the modal display
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
- declare function ButtonWallet({ placement: placementId, classname, useReward: rawUseReward, targetInteraction }: ButtonWalletProps): import("preact").JSX.Element | null;
71
+ export declare function ButtonWallet({ placement: placementId, classname, useReward: rawUseReward, targetInteraction }: ButtonWalletProps): import("preact").JSX.Element | null;
67
72
  //#endregion
68
73
  //#region src/components/ButtonWallet/index.d.ts
69
74
  /**
70
75
  * Custom element interface for `<frak-button-wallet>`.
71
76
  * Combines standard {@link HTMLElement} with {@link ButtonWalletProps}.
72
77
  */
73
- interface ButtonWalletElement extends HTMLElement, ButtonWalletProps {}
78
+ export interface ButtonWalletElement extends HTMLElement, ButtonWalletProps {}
74
79
  declare global {
75
80
  interface HTMLElementTagNameMap {
76
81
  "frak-button-wallet": ButtonWalletElement;
77
82
  }
78
83
  }
79
- //#endregion
80
- export { ButtonWallet, ButtonWalletElement };
84
+ //#endregion
@@ -1,8 +1,8 @@
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-DtwWaLHO.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, 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
- openEmbeddedWallet(targetInteraction, placement);
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
- * Button to open wallet modal
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.modalBuilder | `modalBuilder()`} for more info about the modal display
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
@@ -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é !",
@@ -45,18 +45,17 @@ type OpenInAppButtonProps = {
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,5 +1,5 @@
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-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
- triggerDeepLinkWithFallback(`${DEEP_LINK_SCHEME}${path}`, { onFallback: () => {
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
@@ -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-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-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", {
@@ -1,4 +1,4 @@
1
- //#region ../core/dist/getCurrencyAmountKey-hkn17KxN.js
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 && !(y(t$2, s$1(t(n))) <= 0)) return x(t$2, n);
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 === void 0) return;
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 !== void 0;
203
- if (r === `not_exists`) return n === void 0;
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 === void 0 || i === null)) {
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-Bpo25qjA.js";
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
@@ -1,4 +1,4 @@
1
- import { r as lightDomBaseCss } from "./usePlacement-Bpo25qjA.js";
1
+ import { r as lightDomBaseCss } from "./usePlacement-DtwWaLHO.js";
2
2
  import { useEffect } from "preact/hooks";
3
3
  //#region src/styles/styleManager.ts
4
4
  function ensureStyle(id, css) {
@@ -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
- return useSyncExternalStore(subscribeSdkConfig, useCallback(() => placementId ? getPlacement(placementId) : void 0, [placementId]));
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 };
@@ -1,4 +1,4 @@
1
- import { r as q } from "./rewards-Cxn-bgzC.js";
1
+ import { r as q } from "./rewards-DoVY1pWr.js";
2
2
  import { getMerchantInformation } from "@frak-labs/core-sdk/actions";
3
3
  import { useEffect, useState } from "preact/hooks";
4
4
  //#region src/hooks/useReward.ts