@frak-labs/components 1.0.3 → 1.0.4-beta.f27f8229
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cdn/Banner.CIxY6tCU.js +178 -0
- package/cdn/{ButtonShare.FHUOd26e.js → ButtonShare.DNELNwqD.js} +1 -1
- package/cdn/{ButtonWallet.CN2iHSTB.js → ButtonWallet.BUUPX0gO.js} +1 -1
- package/cdn/GiftIcon.eRNTGQ_r.js +1 -0
- package/cdn/OpenInAppButton.Dgb-qhM8.js +1 -0
- package/cdn/PostPurchase.C3IH-LUy.js +89 -0
- package/cdn/components.js +1 -1
- package/cdn/formatReward.B1ZyoceC.js +1 -0
- package/cdn/loader.js +154 -14
- package/cdn/replay-V6FXES7X.CNozpSRg.js +1 -0
- package/cdn/sharingPage.Dt8QZhlR.js +1 -0
- package/cdn/useGlobalComponents.TG9kIYSc.js +1 -0
- package/cdn/useLightDomStyles.tjNBKcOr.js +1 -0
- package/cdn/usePlacement.BgMXY5CX.js +58 -0
- package/cdn/useReward.B530suzR.js +1 -0
- package/dist/GiftIcon-BIp9FTJs.js +338 -0
- package/dist/banner.d.ts +25 -1
- package/dist/banner.js +77 -45
- package/dist/buttonShare.js +6 -6
- package/dist/buttonWallet.js +2 -2
- package/dist/{formatReward-Bub6Z6eY.js → formatReward-Cf2KpA3x.js} +1 -1
- package/dist/openInApp.js +9 -26
- package/dist/postPurchase.d.ts +9 -1
- package/dist/postPurchase.js +93 -1382
- package/dist/{sharingPage-DFvQbviS.js → sharingPage-D6fQEXV9.js} +1 -1
- package/dist/useLightDomStyles-DVe5UDg6.js +48 -0
- package/dist/{usePlacement-V7NrKoub.js → usePlacement-DzEuVg_u.js} +7 -7
- package/dist/{useReward-DU3_yP8Q.js → useReward-ClVShg45.js} +1 -1
- package/package.json +4 -4
- package/cdn/Banner.BTj-CQM6.js +0 -162
- package/cdn/OpenInAppButton.C1Yipwka.js +0 -1
- package/cdn/PostPurchase.u0s94KFf.js +0 -52
- package/cdn/formatReward.C7mU9_cV.js +0 -1
- package/cdn/sharingPage.CvUkxEML.js +0 -1
- package/cdn/sprinkles.css.ts.vanilla.06k5OzG1.js +0 -1175
- package/cdn/useGlobalComponents.UJmjUUxk.js +0 -1
- package/cdn/useLightDomStyles.Gt7YUMDl.js +0 -1
- package/cdn/usePlacement.BJ7qe-pw.js +0 -58
- package/cdn/useReward.QsQc2c1D.js +0 -1
- package/dist/GiftIcon-c28NnqJ7.js +0 -1502
- package/dist/useLightDomStyles-gbuSWvRx.js +0 -89
- /package/dist/{useGlobalComponents-Cmfszr7v.js → useGlobalComponents-mSs9unyN.js} +0 -0
|
@@ -0,0 +1,338 @@
|
|
|
1
|
+
import "preact/hooks";
|
|
2
|
+
import { jsx, jsxs } from "preact/jsx-runtime";
|
|
3
|
+
import { Component, Fragment as Fragment$1, createElement, options, toChildArray } from "preact";
|
|
4
|
+
//#region ../../node_modules/.bun/preact@10.29.0/node_modules/preact/compat/dist/compat.module.js
|
|
5
|
+
function g(n, t) {
|
|
6
|
+
for (var e in t) n[e] = t[e];
|
|
7
|
+
return n;
|
|
8
|
+
}
|
|
9
|
+
function E(n, t) {
|
|
10
|
+
for (var e in n) if ("__source" !== e && !(e in t)) return !0;
|
|
11
|
+
for (var r in t) if ("__source" !== r && n[r] !== t[r]) return !0;
|
|
12
|
+
return !1;
|
|
13
|
+
}
|
|
14
|
+
function M(n, t) {
|
|
15
|
+
this.props = n, this.context = t;
|
|
16
|
+
}
|
|
17
|
+
(M.prototype = new Component()).isPureReactComponent = !0, M.prototype.shouldComponentUpdate = function(n, t) {
|
|
18
|
+
return E(this.props, n) || E(this.state, t);
|
|
19
|
+
};
|
|
20
|
+
var T = options.__b;
|
|
21
|
+
options.__b = function(n) {
|
|
22
|
+
n.type && n.type.__f && n.ref && (n.props.ref = n.ref, n.ref = null), T && T(n);
|
|
23
|
+
};
|
|
24
|
+
"undefined" != typeof Symbol && Symbol.for;
|
|
25
|
+
var O = options.__e;
|
|
26
|
+
options.__e = function(n, t, e, r) {
|
|
27
|
+
if (n.then) {
|
|
28
|
+
for (var u, o = t; o = o.__;) if ((u = o.__c) && u.__c) return t.__e ?? (t.__e = e.__e, t.__k = e.__k), u.__c(n, t);
|
|
29
|
+
}
|
|
30
|
+
O(n, t, e, r);
|
|
31
|
+
};
|
|
32
|
+
var U = options.unmount;
|
|
33
|
+
function V(n, t, e) {
|
|
34
|
+
return n && (n.__c && n.__c.__H && (n.__c.__H.__.forEach(function(n) {
|
|
35
|
+
"function" == typeof n.__c && n.__c();
|
|
36
|
+
}), n.__c.__H = null), null != (n = g({}, n)).__c && (n.__c.__P === e && (n.__c.__P = t), n.__c.__e = !0, n.__c = null), n.__k = n.__k && n.__k.map(function(n) {
|
|
37
|
+
return V(n, t, e);
|
|
38
|
+
})), n;
|
|
39
|
+
}
|
|
40
|
+
function W(n, t, e) {
|
|
41
|
+
return n && e && (n.__v = null, n.__k = n.__k && n.__k.map(function(n) {
|
|
42
|
+
return W(n, t, e);
|
|
43
|
+
}), n.__c && n.__c.__P === t && (n.__e && e.appendChild(n.__e), n.__c.__e = !0, n.__c.__P = e)), n;
|
|
44
|
+
}
|
|
45
|
+
function P() {
|
|
46
|
+
this.__u = 0, this.o = null, this.__b = null;
|
|
47
|
+
}
|
|
48
|
+
function j(n) {
|
|
49
|
+
var t = n.__ && n.__.__c;
|
|
50
|
+
return t && t.__a && t.__a(n);
|
|
51
|
+
}
|
|
52
|
+
function B() {
|
|
53
|
+
this.i = null, this.l = null;
|
|
54
|
+
}
|
|
55
|
+
options.unmount = function(n) {
|
|
56
|
+
var t = n.__c;
|
|
57
|
+
t && (t.__z = !0), t && t.__R && t.__R(), t && 32 & n.__u && (n.type = null), U && U(n);
|
|
58
|
+
}, (P.prototype = new Component()).__c = function(n, t) {
|
|
59
|
+
var e = t.__c, r = this;
|
|
60
|
+
r.o ??= [], r.o.push(e);
|
|
61
|
+
var u = j(r.__v), o = !1, i = function() {
|
|
62
|
+
o || r.__z || (o = !0, e.__R = null, u ? u(c) : c());
|
|
63
|
+
};
|
|
64
|
+
e.__R = i;
|
|
65
|
+
var l = e.__P;
|
|
66
|
+
e.__P = null;
|
|
67
|
+
var c = function() {
|
|
68
|
+
if (!--r.__u) {
|
|
69
|
+
if (r.state.__a) {
|
|
70
|
+
var n = r.state.__a;
|
|
71
|
+
r.__v.__k[0] = W(n, n.__c.__P, n.__c.__O);
|
|
72
|
+
}
|
|
73
|
+
var t;
|
|
74
|
+
for (r.setState({ __a: r.__b = null }); t = r.o.pop();) t.__P = l, t.forceUpdate();
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
r.__u++ || 32 & t.__u || r.setState({ __a: r.__b = r.__v.__k[0] }), n.then(i, i);
|
|
78
|
+
}, P.prototype.componentWillUnmount = function() {
|
|
79
|
+
this.o = [];
|
|
80
|
+
}, P.prototype.render = function(n, e) {
|
|
81
|
+
if (this.__b) {
|
|
82
|
+
if (this.__v.__k) {
|
|
83
|
+
var r = document.createElement("div"), o = this.__v.__k[0].__c;
|
|
84
|
+
this.__v.__k[0] = V(this.__b, r, o.__O = o.__P);
|
|
85
|
+
}
|
|
86
|
+
this.__b = null;
|
|
87
|
+
}
|
|
88
|
+
var i = e.__a && createElement(Fragment$1, null, n.fallback);
|
|
89
|
+
return i && (i.__u &= -33), [createElement(Fragment$1, null, e.__a ? null : n.children), i];
|
|
90
|
+
};
|
|
91
|
+
var H = function(n, t, e) {
|
|
92
|
+
if (++e[1] === e[0] && n.l.delete(t), n.props.revealOrder && ("t" !== n.props.revealOrder[0] || !n.l.size)) for (e = n.i; e;) {
|
|
93
|
+
for (; e.length > 3;) e.pop()();
|
|
94
|
+
if (e[1] < e[0]) break;
|
|
95
|
+
n.i = e = e[2];
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
(B.prototype = new Component()).__a = function(n) {
|
|
99
|
+
var t = this, e = j(t.__v), r = t.l.get(n);
|
|
100
|
+
return r[0]++, function(u) {
|
|
101
|
+
var o = function() {
|
|
102
|
+
t.props.revealOrder ? (r.push(u), H(t, n, r)) : u();
|
|
103
|
+
};
|
|
104
|
+
e ? e(o) : o();
|
|
105
|
+
};
|
|
106
|
+
}, B.prototype.render = function(n) {
|
|
107
|
+
this.i = null, this.l = /* @__PURE__ */ new Map();
|
|
108
|
+
var t = toChildArray(n.children);
|
|
109
|
+
n.revealOrder && "b" === n.revealOrder[0] && t.reverse();
|
|
110
|
+
for (var e = t.length; e--;) this.l.set(t[e], this.i = [
|
|
111
|
+
1,
|
|
112
|
+
0,
|
|
113
|
+
this.i
|
|
114
|
+
]);
|
|
115
|
+
return n.children;
|
|
116
|
+
}, B.prototype.componentDidUpdate = B.prototype.componentDidMount = function() {
|
|
117
|
+
var n = this;
|
|
118
|
+
this.l.forEach(function(t, e) {
|
|
119
|
+
H(n, e, t);
|
|
120
|
+
});
|
|
121
|
+
};
|
|
122
|
+
var q = "undefined" != typeof Symbol && Symbol.for && Symbol.for("react.element") || 60103, G = /^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/, J = /^on(Ani|Tra|Tou|BeforeInp|Compo)/, K = /[A-Z0-9]/g, Q = "undefined" != typeof document, X = function(n) {
|
|
123
|
+
return ("undefined" != typeof Symbol && "symbol" == typeof Symbol() ? /fil|che|rad/ : /fil|che|ra/).test(n);
|
|
124
|
+
};
|
|
125
|
+
Component.prototype.isReactComponent = !0, [
|
|
126
|
+
"componentWillMount",
|
|
127
|
+
"componentWillReceiveProps",
|
|
128
|
+
"componentWillUpdate"
|
|
129
|
+
].forEach(function(t) {
|
|
130
|
+
Object.defineProperty(Component.prototype, t, {
|
|
131
|
+
configurable: !0,
|
|
132
|
+
get: function() {
|
|
133
|
+
return this["UNSAFE_" + t];
|
|
134
|
+
},
|
|
135
|
+
set: function(n) {
|
|
136
|
+
Object.defineProperty(this, t, {
|
|
137
|
+
configurable: !0,
|
|
138
|
+
writable: !0,
|
|
139
|
+
value: n
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
});
|
|
143
|
+
});
|
|
144
|
+
var en = options.event;
|
|
145
|
+
options.event = function(n) {
|
|
146
|
+
return en && (n = en(n)), n.persist = function() {}, n.isPropagationStopped = function() {
|
|
147
|
+
return this.cancelBubble;
|
|
148
|
+
}, n.isDefaultPrevented = function() {
|
|
149
|
+
return this.defaultPrevented;
|
|
150
|
+
}, n.nativeEvent = n;
|
|
151
|
+
};
|
|
152
|
+
var un = {
|
|
153
|
+
configurable: !0,
|
|
154
|
+
get: function() {
|
|
155
|
+
return this.class;
|
|
156
|
+
}
|
|
157
|
+
}, on = options.vnode;
|
|
158
|
+
options.vnode = function(n) {
|
|
159
|
+
"string" == typeof n.type && function(n) {
|
|
160
|
+
var t = n.props, e = n.type, u = {}, o = -1 == e.indexOf("-");
|
|
161
|
+
for (var i in t) {
|
|
162
|
+
var l = t[i];
|
|
163
|
+
if (!("value" === i && "defaultValue" in t && null == l || Q && "children" === i && "noscript" === e || "class" === i || "className" === i)) {
|
|
164
|
+
var c = i.toLowerCase();
|
|
165
|
+
"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;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
"select" == e && (u.multiple && Array.isArray(u.value) && (u.value = toChildArray(t.children).forEach(function(n) {
|
|
169
|
+
n.props.selected = -1 != u.value.indexOf(n.props.value);
|
|
170
|
+
})), null != u.defaultValue && (u.value = toChildArray(t.children).forEach(function(n) {
|
|
171
|
+
n.props.selected = u.multiple ? -1 != u.defaultValue.indexOf(n.props.value) : u.defaultValue == n.props.value;
|
|
172
|
+
}))), t.class && !t.className ? (u.class = t.class, Object.defineProperty(u, "className", un)) : t.className && (u.class = u.className = t.className), n.props = u;
|
|
173
|
+
}(n), n.$$typeof = q, on && on(n);
|
|
174
|
+
};
|
|
175
|
+
var ln = options.__r;
|
|
176
|
+
options.__r = function(n) {
|
|
177
|
+
ln && ln(n), n.__c;
|
|
178
|
+
};
|
|
179
|
+
var cn = options.diffed;
|
|
180
|
+
options.diffed = function(n) {
|
|
181
|
+
cn && cn(n);
|
|
182
|
+
var t = n.props, e = n.__e;
|
|
183
|
+
null != e && "textarea" === n.type && "value" in t && t.value !== e.value && (e.value = null == t.value ? "" : t.value);
|
|
184
|
+
};
|
|
185
|
+
//#endregion
|
|
186
|
+
//#region ../../packages/design-system/src/icons/CloseCircleIcon.tsx
|
|
187
|
+
function CloseCircleIcon(props) {
|
|
188
|
+
return /* @__PURE__ */ jsx("svg", {
|
|
189
|
+
width: "15",
|
|
190
|
+
height: "15",
|
|
191
|
+
viewBox: "0 0 15 15",
|
|
192
|
+
fill: "none",
|
|
193
|
+
"aria-hidden": "true",
|
|
194
|
+
...props,
|
|
195
|
+
children: /* @__PURE__ */ jsx("path", {
|
|
196
|
+
d: "M7.33301 0C11.383 0 14.6668 3.28307 14.667 7.33301C14.667 11.3831 11.3831 14.667 7.33301 14.667C3.28307 14.6668 0 11.383 0 7.33301C0.000175746 3.28318 3.28318 0.000175742 7.33301 0ZM10.3896 4.27734C10.151 4.0388 9.76303 4.03775 9.52441 4.27637L7.33301 6.46777L5.14258 4.27637C4.90397 4.03776 4.51601 4.03882 4.27734 4.27734C4.03869 4.516 4.03771 4.90392 4.27637 5.14258L6.4668 7.33398L4.27637 9.52441C4.03807 9.76306 4.03891 10.1511 4.27734 10.3896C4.51589 10.6282 4.9039 10.629 5.14258 10.3906L7.33301 8.2002L9.52344 10.3906C9.76198 10.629 10.15 10.6279 10.3887 10.3896C10.6273 10.151 10.6283 9.76209 10.3896 9.52344L8.2002 7.33398L10.3906 5.14258C10.6293 4.90392 10.6283 4.516 10.3896 4.27734Z",
|
|
197
|
+
fill: "currentColor"
|
|
198
|
+
})
|
|
199
|
+
});
|
|
200
|
+
}
|
|
201
|
+
//#endregion
|
|
202
|
+
//#region ../../packages/design-system/src/icons/ExternalLinkIcon.tsx
|
|
203
|
+
function ExternalLinkIcon(props) {
|
|
204
|
+
return /* @__PURE__ */ jsx("svg", {
|
|
205
|
+
width: "12",
|
|
206
|
+
height: "12",
|
|
207
|
+
viewBox: "0 0 12 12",
|
|
208
|
+
fill: "none",
|
|
209
|
+
"aria-hidden": "true",
|
|
210
|
+
...props,
|
|
211
|
+
children: /* @__PURE__ */ jsx("path", {
|
|
212
|
+
d: "M5.45508 0C5.75614 0.000209333 6 0.244788 6 0.545898C5.99979 0.846831 5.75601 1.09159 5.45508 1.0918H4.36426C3.05445 1.0918 2.27964 1.35707 1.81836 1.81836C1.35714 2.27966 1.0918 3.05454 1.0918 4.36426V7.63672C1.09186 8.94625 1.35713 9.72139 1.81836 10.1826C2.2797 10.6436 3.05488 10.9092 4.36426 10.9092H7.63672C8.94628 10.9091 9.72135 10.6438 10.1826 10.1826C10.6438 9.72139 10.9091 8.94625 10.9092 7.63672V6.5459C10.9092 6.24466 11.1538 6 11.4551 6C11.7561 6.00028 12 6.24483 12 6.5459V7.63672C11.9999 9.05391 11.72 10.1882 10.9541 10.9541C10.1882 11.7199 9.05394 12 7.63672 12H4.36426C2.94714 12 1.81283 11.7197 1.04688 10.9541C0.280997 10.1882 6.04321e-05 9.05391 0 7.63672V4.36426C0 2.94692 0.28099 1.81283 1.04688 1.04688C1.81284 0.280915 2.94686 0 4.36426 0H5.45508ZM11.4541 0C11.7553 2.20143e-05 11.999 0.244672 11.999 0.545898V3.16406C11.9988 3.46509 11.7552 3.70896 11.4541 3.70898C11.1532 3.70873 10.9084 3.46495 10.9082 3.16406V1.8623L6.93066 5.83984C6.71766 6.05283 6.37218 6.05283 6.15918 5.83984C5.94657 5.62681 5.94632 5.28124 6.15918 5.06836L10.1357 1.0918H8.83594C8.53504 1.09154 8.29025 0.846803 8.29004 0.545898C8.29004 0.244816 8.53491 0.000254588 8.83594 0H11.4541Z",
|
|
213
|
+
fill: "currentColor"
|
|
214
|
+
})
|
|
215
|
+
});
|
|
216
|
+
}
|
|
217
|
+
//#endregion
|
|
218
|
+
//#region ../../packages/design-system/src/icons/LogoFrakWithName.tsx
|
|
219
|
+
/**
|
|
220
|
+
* Frak wordmark — blue rounded-square badge with the white F glyph,
|
|
221
|
+
* followed by the "frak" text.
|
|
222
|
+
*
|
|
223
|
+
* Asset traces the Figma export (viewBox 0 0 63 24). The badge keeps the
|
|
224
|
+
* canonical brand colors baked in; the text fill follows `currentColor`
|
|
225
|
+
* so the parent's CSS `color` drives it (black on light surfaces, white
|
|
226
|
+
* on dark overlays like the listener modal). For the standalone badge
|
|
227
|
+
* without text, use {@link LogoFrakBadge}.
|
|
228
|
+
*/
|
|
229
|
+
function LogoFrakWithName(props) {
|
|
230
|
+
return /* @__PURE__ */ jsxs("svg", {
|
|
231
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
232
|
+
width: props.width ?? "63",
|
|
233
|
+
height: props.height ?? "24",
|
|
234
|
+
fill: "none",
|
|
235
|
+
viewBox: "0 0 63 24",
|
|
236
|
+
...props,
|
|
237
|
+
children: [
|
|
238
|
+
/* @__PURE__ */ jsx("title", { children: "Frak" }),
|
|
239
|
+
/* @__PURE__ */ jsx("rect", {
|
|
240
|
+
width: "24",
|
|
241
|
+
height: "24",
|
|
242
|
+
rx: "6",
|
|
243
|
+
fill: "#0043EF"
|
|
244
|
+
}),
|
|
245
|
+
/* @__PURE__ */ jsx("path", {
|
|
246
|
+
fill: "white",
|
|
247
|
+
d: "M9.76941 15.9093L5.1481 14.3453C5.06012 14.3155 4.96875 14.3811 4.96875 14.474V17.3274C4.96875 17.3857 5.00584 17.4373 5.06103 17.4561L9.68234 19.02C9.77032 19.0499 9.86169 18.9843 9.86169 18.8913V16.038C9.86169 15.9796 9.8246 15.9281 9.76941 15.9093ZM14.5764 10.4374L9.95396 12.0013C9.89878 12.0201 9.86169 12.0717 9.86169 12.13V14.9833C9.86169 15.0763 9.95306 15.1419 10.041 15.112L14.6635 13.5481C14.7187 13.5293 14.7558 13.4777 14.7558 13.4194V10.566C14.7558 10.4731 14.6646 10.4075 14.5764 10.4374ZM18.9173 5.01993L11.1787 7.51231C11.1226 7.53041 11.0846 7.58265 11.0846 7.64168V10.5651C11.0846 10.6233 11.1423 10.6644 11.1983 10.6463L18.9369 8.15396C18.993 8.13586 19.0312 8.08362 19.0312 8.02459V5.10113C19.031 5.043 18.9734 5.00184 18.9173 5.01993Z"
|
|
248
|
+
}),
|
|
249
|
+
/* @__PURE__ */ jsx("path", {
|
|
250
|
+
fill: "currentColor",
|
|
251
|
+
d: "M52.7211 9.5114C52.8254 9.51159 52.9095 9.59651 52.9096 9.70085L52.8383 18.2057C52.8383 18.3069 52.7575 18.3891 52.6577 18.3893L52.6411 18.3864H51.3022C51.1512 18.3861 50.7795 18.2504 50.3901 18.0007C49.8574 18.2487 49.2664 18.3893 48.644 18.3893H48.3901C47.2354 18.3893 46.1869 17.9123 45.4272 17.1442C44.667 16.3763 44.1958 15.316 44.1957 14.1481C44.1957 12.98 44.6675 11.9191 45.4272 11.151C46.1587 10.4118 47.1591 9.94381 48.2631 9.90983C49.1702 9.85599 49.9861 9.98778 50.4887 10.4967V9.70085C50.4888 9.5964 50.5737 9.51141 50.6782 9.5114H52.7211ZM35.352 5.61686H36.9623C37.0879 5.61703 37.1896 5.71855 37.1909 5.84538V7.81022C37.1909 7.93652 37.088 8.03874 36.9623 8.03874H34.9203C34.3151 8.03874 33.6274 8.63552 33.6274 9.25163V10.6149C34.2626 9.97905 34.9289 9.65371 35.352 9.63054H36.4604C36.5867 9.63054 36.6889 9.73339 36.6889 9.85905V11.8239C36.6889 11.9502 36.586 12.0524 36.4604 12.0524H34.9194C34.3143 12.0525 33.6276 12.6493 33.6274 13.2653V18.1999C33.6272 18.3042 33.5423 18.3883 33.4379 18.3883H31.395C31.2907 18.3882 31.2066 18.3042 31.2065 18.1999V9.93815C31.2065 9.86969 31.1975 9.80188 31.2006 9.73405C31.2397 8.87625 31.1516 5.44451 35.352 5.61686ZM39.933 9.63054C40.0375 9.63055 40.1224 9.71555 40.1225 9.81999V10.6149C40.7578 9.97909 41.5843 9.63054 41.8471 9.63054H43.4565C43.5821 9.63054 43.6844 9.73339 43.685 9.85905V11.8239C43.6848 11.95 43.5829 12.0513 43.4575 12.0514H41.4145C40.8093 12.0515 40.1225 12.6492 40.1225 13.2653V18.1999C40.1223 18.3042 40.0374 18.3883 39.933 18.3883H37.8901C37.7859 18.3882 37.7018 18.3041 37.7016 18.1999V9.81999C37.7017 9.71565 37.7858 9.63072 37.8901 9.63054H39.933ZM56.1967 7.00651C56.3021 7.00678 56.3879 7.09283 56.3881 7.1989V13.4479L59.8295 10.1891C59.8654 10.1552 59.912 10.1364 59.9614 10.1364H62.2797C62.4501 10.1364 62.5363 10.3414 62.4174 10.4626L59.3022 13.6325L62.7993 18.0749C62.8986 18.2012 62.8091 18.3864 62.6489 18.3864H60.2387C60.1804 18.3864 60.1258 18.3596 60.0893 18.3141L57.6723 15.3161C57.5998 15.2283 57.4679 15.2203 57.3871 15.3005L56.3881 16.2858V18.194C56.3881 18.2996 56.3029 18.3861 56.1967 18.3864H54.1879C54.0823 18.3862 53.9955 18.3003 53.9955 18.194V7.1989C53.9958 7.09341 54.0818 7.00669 54.1879 7.00651H56.1967ZM48.3705 11.9606C47.7802 11.9607 47.2427 12.2054 46.853 12.6003C46.4626 12.9952 46.2202 13.5386 46.2202 14.1354C46.2202 14.7323 46.4626 15.2763 46.853 15.6706C47.2427 16.0654 47.7802 16.3102 48.3705 16.3102H48.6616C49.2513 16.3102 49.7894 16.0654 50.1791 15.6706C50.5696 15.2763 50.8119 14.7323 50.8119 14.1354C50.8119 13.5386 50.5695 12.9945 50.1791 12.6003C49.7894 12.2055 49.2512 11.9606 48.6616 11.9606H48.3705Z"
|
|
252
|
+
})
|
|
253
|
+
]
|
|
254
|
+
});
|
|
255
|
+
}
|
|
256
|
+
2 * Math.PI * 11;
|
|
257
|
+
//#endregion
|
|
258
|
+
//#region ../../packages/design-system/src/icons/WarningIcon.tsx
|
|
259
|
+
function WarningIcon(props) {
|
|
260
|
+
return /* @__PURE__ */ jsx("svg", {
|
|
261
|
+
width: "16",
|
|
262
|
+
height: "16",
|
|
263
|
+
viewBox: "0 0 16 16",
|
|
264
|
+
fill: "none",
|
|
265
|
+
"aria-hidden": "true",
|
|
266
|
+
...props,
|
|
267
|
+
children: /* @__PURE__ */ jsx("path", {
|
|
268
|
+
d: "M8 0C12.4183 0 16 3.58172 16 8C16 12.4183 12.4183 16 8 16C3.58172 16 0 12.4183 0 8C0 3.58172 3.58172 0 8 0ZM8 1.5C4.41015 1.5 1.5 4.41015 1.5 8C1.5 11.5899 4.41015 14.5 8 14.5C11.5899 14.5 14.5 11.5899 14.5 8C14.5 4.41015 11.5899 1.5 8 1.5ZM8.10352 10.207C8.82025 10.2071 9.23531 10.6346 9.23535 11.3262C9.23535 12.0304 8.82028 12.4579 8.10352 12.458C7.36167 12.4579 6.97168 12.0304 6.97168 11.3262C6.97172 10.6346 7.36171 10.2072 8.10352 10.207ZM8.84766 3.54102C9.01311 3.54121 9.14736 3.67535 9.14746 3.84082V4.74805L8.84375 8.37012C8.83069 8.52552 8.6999 8.64551 8.54395 8.64551H7.62891C7.47133 8.64523 7.34074 8.52251 7.33008 8.36523L7.08496 4.74805V3.84082C7.08507 3.67533 7.2193 3.54119 7.38477 3.54102H8.84766Z",
|
|
269
|
+
fill: "currentColor"
|
|
270
|
+
})
|
|
271
|
+
});
|
|
272
|
+
}
|
|
273
|
+
//#endregion
|
|
274
|
+
//#region src/styles/sharedBaseCss.css.ts
|
|
275
|
+
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}";
|
|
276
|
+
//#endregion
|
|
277
|
+
//#region src/components/icons/GiftIcon.tsx
|
|
278
|
+
/**
|
|
279
|
+
* Gift icon with yellow accent circle and present box.
|
|
280
|
+
* Used by the referral banner and the post-purchase card.
|
|
281
|
+
*/
|
|
282
|
+
function GiftIcon(props) {
|
|
283
|
+
return /* @__PURE__ */ jsxs("svg", {
|
|
284
|
+
viewBox: "0 0 100 100",
|
|
285
|
+
fill: "none",
|
|
286
|
+
"aria-hidden": "true",
|
|
287
|
+
...props,
|
|
288
|
+
children: [
|
|
289
|
+
/* @__PURE__ */ jsx("circle", {
|
|
290
|
+
cx: "38",
|
|
291
|
+
cy: "28",
|
|
292
|
+
r: "23",
|
|
293
|
+
fill: "#FFF533"
|
|
294
|
+
}),
|
|
295
|
+
/* @__PURE__ */ jsx("path", {
|
|
296
|
+
d: "M50 38C30 10 12 30 50 38Z",
|
|
297
|
+
stroke: "#222222",
|
|
298
|
+
"stroke-width": "4",
|
|
299
|
+
"stroke-linecap": "round",
|
|
300
|
+
"stroke-linejoin": "round"
|
|
301
|
+
}),
|
|
302
|
+
/* @__PURE__ */ jsx("path", {
|
|
303
|
+
d: "M50 38C70 10 88 30 50 38Z",
|
|
304
|
+
stroke: "#222222",
|
|
305
|
+
"stroke-width": "4",
|
|
306
|
+
"stroke-linecap": "round",
|
|
307
|
+
"stroke-linejoin": "round"
|
|
308
|
+
}),
|
|
309
|
+
/* @__PURE__ */ jsx("rect", {
|
|
310
|
+
x: "10",
|
|
311
|
+
y: "38",
|
|
312
|
+
width: "80",
|
|
313
|
+
height: "16",
|
|
314
|
+
rx: "2",
|
|
315
|
+
stroke: "#222222",
|
|
316
|
+
"stroke-width": "4"
|
|
317
|
+
}),
|
|
318
|
+
/* @__PURE__ */ jsx("path", {
|
|
319
|
+
d: "M15 54V89C15 90.6 16.4 92 18 92H82C83.6 92 85 90.6 85 89V54",
|
|
320
|
+
stroke: "#222222",
|
|
321
|
+
"stroke-width": "4",
|
|
322
|
+
"stroke-linecap": "round",
|
|
323
|
+
"stroke-linejoin": "round"
|
|
324
|
+
}),
|
|
325
|
+
/* @__PURE__ */ jsx("line", {
|
|
326
|
+
x1: "50",
|
|
327
|
+
y1: "54",
|
|
328
|
+
x2: "50",
|
|
329
|
+
y2: "92",
|
|
330
|
+
stroke: "#222222",
|
|
331
|
+
"stroke-width": "4",
|
|
332
|
+
"stroke-linecap": "round"
|
|
333
|
+
})
|
|
334
|
+
]
|
|
335
|
+
});
|
|
336
|
+
}
|
|
337
|
+
//#endregion
|
|
338
|
+
export { ExternalLinkIcon as a, LogoFrakWithName as i, cssSource as n, CloseCircleIcon as o, WarningIcon as r, GiftIcon as t };
|
package/dist/banner.d.ts
CHANGED
|
@@ -44,6 +44,13 @@ type BannerProps = {
|
|
|
44
44
|
* Override the in-app browser banner CTA button text.
|
|
45
45
|
*/
|
|
46
46
|
inappCta?: string;
|
|
47
|
+
/**
|
|
48
|
+
* Override the image displayed on the left of the referral banner.
|
|
49
|
+
* Accepts an image URL. Falls back to the built-in gift icon when omitted.
|
|
50
|
+
* The image is constrained to the icon slot via `object-fit: contain`,
|
|
51
|
+
* so any aspect ratio renders correctly.
|
|
52
|
+
*/
|
|
53
|
+
imageUrl?: string;
|
|
47
54
|
/**
|
|
48
55
|
* When set, forces the banner to render in preview mode (e.g. in Shopify theme editor).
|
|
49
56
|
* Bypasses normal event/browser detection and shows static content.
|
|
@@ -54,6 +61,21 @@ type BannerProps = {
|
|
|
54
61
|
* Only used when {@link preview} is set. Defaults to "referral".
|
|
55
62
|
*/
|
|
56
63
|
previewMode?: "referral" | "inapp";
|
|
64
|
+
/**
|
|
65
|
+
* When `true` (default `false`), the banner is allowed to switch to
|
|
66
|
+
* in-app browser mode (Instagram / Facebook WebView) and prompt the
|
|
67
|
+
* user to escape to the system browser.
|
|
68
|
+
*
|
|
69
|
+
* Most flows now work inside in-app browsers via the anonymous-id
|
|
70
|
+
* flow, so the redirect is opt-in. Enable it only on surfaces that
|
|
71
|
+
* actually drive users into a WebAuthn-bound action (login,
|
|
72
|
+
* sendTransaction, SIWE authenticate).
|
|
73
|
+
*
|
|
74
|
+
* Accepts the boolean `true` (TS/JSX) or the string `"true"` (HTML
|
|
75
|
+
* attribute). Any other value — including `false`, `"false"`, the
|
|
76
|
+
* empty string, or attribute absence — keeps the redirect disabled.
|
|
77
|
+
*/
|
|
78
|
+
allowInappRedirect?: boolean | "true" | "false";
|
|
57
79
|
};
|
|
58
80
|
//#endregion
|
|
59
81
|
//#region src/components/Banner/Banner.d.ts
|
|
@@ -97,8 +119,10 @@ declare function Banner({
|
|
|
97
119
|
inappTitle: propInappTitle,
|
|
98
120
|
inappDescription: propInappDescription,
|
|
99
121
|
inappCta: propInappCta,
|
|
122
|
+
imageUrl,
|
|
100
123
|
preview,
|
|
101
|
-
previewMode
|
|
124
|
+
previewMode,
|
|
125
|
+
allowInappRedirect
|
|
102
126
|
}: BannerProps): _$preact.JSX.Element | null;
|
|
103
127
|
//#endregion
|
|
104
128
|
//#region src/components/Banner/index.d.ts
|
package/dist/banner.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { a as registerWebComponent, i as useClientReady, t as usePlacement } from "./usePlacement-
|
|
2
|
-
import { t as useGlobalComponents } from "./useGlobalComponents-
|
|
3
|
-
import { t as useLightDomStyles } from "./useLightDomStyles-
|
|
4
|
-
import { t as useReward } from "./useReward-
|
|
5
|
-
import { a as
|
|
1
|
+
import { a as registerWebComponent, i as useClientReady, t as usePlacement } from "./usePlacement-DzEuVg_u.js";
|
|
2
|
+
import { t as useGlobalComponents } from "./useGlobalComponents-mSs9unyN.js";
|
|
3
|
+
import { t as useLightDomStyles } from "./useLightDomStyles-DVe5UDg6.js";
|
|
4
|
+
import { t as useReward } from "./useReward-ClVShg45.js";
|
|
5
|
+
import { a as ExternalLinkIcon, i as LogoFrakWithName, n as cssSource$3, o as CloseCircleIcon, r as WarningIcon, t as GiftIcon } from "./GiftIcon-BIp9FTJs.js";
|
|
6
6
|
import { isInAppBrowser, redirectToExternalBrowser, trackEvent } from "@frak-labs/core-sdk";
|
|
7
7
|
import { REFERRAL_SUCCESS_EVENT, getMergeToken } from "@frak-labs/core-sdk/actions";
|
|
8
8
|
import { useCallback, useEffect, useMemo, useRef, useState } from "preact/hooks";
|
|
9
9
|
import { jsx, jsxs } from "preact/jsx-runtime";
|
|
10
10
|
//#region \0ve-inline:../../packages/design-system/src/styles/inAppBanner.css.ts.vanilla.js
|
|
11
|
-
const cssSource$
|
|
11
|
+
const cssSource$2 = `@keyframes inAppBanner_fadeIn__1ibpiy70 {
|
|
12
12
|
from {
|
|
13
13
|
opacity: 0;
|
|
14
14
|
transform: translateY(-4px);
|
|
@@ -117,7 +117,6 @@ var description = "inAppBanner_description__1ibpiy76";
|
|
|
117
117
|
var header = "inAppBanner_header__1ibpiy72";
|
|
118
118
|
var iconWrapper = "inAppBanner_iconWrapper__1ibpiy73";
|
|
119
119
|
var title = "inAppBanner_title__1ibpiy74";
|
|
120
|
-
cssSource$4 + cssSource$3;
|
|
121
120
|
//#endregion
|
|
122
121
|
//#region ../../packages/design-system/src/components/InAppBanner/index.tsx
|
|
123
122
|
function InAppBanner({ title: title$1, description: description$1, cta: cta$1, dismissLabel, onAction, onDismiss, className, classNames }) {
|
|
@@ -194,30 +193,44 @@ const cssSource$1 = `@keyframes Banner_fadeIn__1gnumzi0 {
|
|
|
194
193
|
padding: 16px;
|
|
195
194
|
background-color: #ffffff;
|
|
196
195
|
color: var(--text-primary__pbq4ak0);
|
|
196
|
+
border: 1px solid var(--border-default__pbq4akv);
|
|
197
|
+
border-radius: 12px;
|
|
197
198
|
}
|
|
198
199
|
.Banner_referralIconWrapper__1gnumzi4 {
|
|
199
200
|
flex-shrink: 0;
|
|
200
201
|
align-self: flex-start;
|
|
202
|
+
display: flex;
|
|
203
|
+
align-items: center;
|
|
204
|
+
justify-content: center;
|
|
201
205
|
width: 40px;
|
|
202
206
|
height: 40px;
|
|
207
|
+
overflow: hidden;
|
|
208
|
+
}
|
|
209
|
+
.Banner_referralImage__1gnumzi5 {
|
|
210
|
+
max-width: 100%;
|
|
211
|
+
max-height: 100%;
|
|
212
|
+
width: auto;
|
|
213
|
+
height: auto;
|
|
214
|
+
object-fit: contain;
|
|
215
|
+
display: block;
|
|
203
216
|
}
|
|
204
|
-
.
|
|
217
|
+
.Banner_referralBody__1gnumzi6 {
|
|
205
218
|
flex: 1;
|
|
206
219
|
min-width: 0;
|
|
207
220
|
}
|
|
208
|
-
.
|
|
221
|
+
.Banner_referralTitle__1gnumzi7 {
|
|
209
222
|
font-size: 16px;
|
|
210
223
|
font-weight: 600;
|
|
211
224
|
color: var(--text-primary__pbq4ak0);
|
|
212
225
|
line-height: 22px;
|
|
213
226
|
}
|
|
214
|
-
.
|
|
227
|
+
.Banner_referralDescription__1gnumzi8 {
|
|
215
228
|
margin-bottom: 8px;
|
|
216
229
|
font-size: 14px;
|
|
217
230
|
color: #979797;
|
|
218
231
|
line-height: 22px;
|
|
219
232
|
}
|
|
220
|
-
.
|
|
233
|
+
.Banner_referralCta__1gnumzi9 {
|
|
221
234
|
display: inline-block;
|
|
222
235
|
padding: 8px 16px;
|
|
223
236
|
border: 1px solid #000000;
|
|
@@ -228,20 +241,24 @@ const cssSource$1 = `@keyframes Banner_fadeIn__1gnumzi0 {
|
|
|
228
241
|
line-height: 12px;
|
|
229
242
|
text-transform: uppercase;
|
|
230
243
|
}
|
|
231
|
-
.
|
|
232
|
-
|
|
233
|
-
|
|
244
|
+
.Banner_frakLogo__1gnumzia {
|
|
245
|
+
position: absolute;
|
|
246
|
+
right: 16px;
|
|
247
|
+
bottom: 12px;
|
|
248
|
+
pointer-events: none;
|
|
234
249
|
}`;
|
|
235
250
|
//#endregion
|
|
236
251
|
//#region src/components/Banner/Banner.css.ts
|
|
252
|
+
var frakLogo = "Banner_frakLogo__1gnumzia";
|
|
237
253
|
var iconSvg = "Banner_iconSvg__1gnumzi2";
|
|
238
254
|
var referral = "Banner_referral__1gnumzi3 reset_base__1831jhd0 Banner_rootBase__1gnumzi1";
|
|
239
|
-
var referralBody = "
|
|
240
|
-
var referralCta = "
|
|
241
|
-
var referralDescription = "
|
|
255
|
+
var referralBody = "Banner_referralBody__1gnumzi6";
|
|
256
|
+
var referralCta = "Banner_referralCta__1gnumzi9 sharedBaseCss_buttonReset__7cswil0";
|
|
257
|
+
var referralDescription = "Banner_referralDescription__1gnumzi8 reset_base__1831jhd0";
|
|
242
258
|
var referralIconWrapper = "Banner_referralIconWrapper__1gnumzi4";
|
|
243
|
-
var
|
|
244
|
-
|
|
259
|
+
var referralImage = "Banner_referralImage__1gnumzi5";
|
|
260
|
+
var referralTitle = "Banner_referralTitle__1gnumzi7 reset_base__1831jhd0";
|
|
261
|
+
const cssSource = cssSource$2 + cssSource$1;
|
|
245
262
|
//#endregion
|
|
246
263
|
//#region src/components/Banner/Banner.tsx
|
|
247
264
|
/**
|
|
@@ -274,16 +291,17 @@ const cssSource = cssSource$5 + cssSource$4 + cssSource$6 + cssSource$3 + cssSou
|
|
|
274
291
|
* <frak-banner classname="my-custom-banner"></frak-banner>
|
|
275
292
|
* ```
|
|
276
293
|
*/
|
|
277
|
-
function Banner({ placement: placementId, classname = "", interaction, referralTitle: propReferralTitle, referralDescription: propReferralDescription, referralCta: propReferralCta, inappTitle: propInappTitle, inappDescription: propInappDescription, inappCta: propInappCta, preview, previewMode }) {
|
|
294
|
+
function Banner({ placement: placementId, classname = "", interaction, referralTitle: propReferralTitle, referralDescription: propReferralDescription, referralCta: propReferralCta, inappTitle: propInappTitle, inappDescription: propInappDescription, inappCta: propInappCta, imageUrl, preview, previewMode, allowInappRedirect }) {
|
|
278
295
|
const isPreview = !!preview;
|
|
279
296
|
const resolvedPreviewMode = previewMode === "inapp" ? "inapp" : "referral";
|
|
297
|
+
const isInappRedirectAllowed = allowInappRedirect === true || allowInappRedirect === "true";
|
|
280
298
|
const placement = usePlacement(placementId);
|
|
281
299
|
const { shouldRender, isHidden, isClientReady } = useClientReady();
|
|
282
|
-
useLightDomStyles("frak-banner", placementId, placement?.components?.banner?.css, cssSource);
|
|
300
|
+
useLightDomStyles("frak-banner", placementId, placement?.components?.banner?.css, cssSource, cssSource$3);
|
|
283
301
|
const [dismissed, setDismissed] = useState(false);
|
|
284
302
|
const [mode, setMode] = useState(() => {
|
|
285
303
|
if (isPreview) return resolvedPreviewMode;
|
|
286
|
-
return isInAppBrowser ? "inapp" : null;
|
|
304
|
+
return isInappRedirectAllowed && isInAppBrowser ? "inapp" : null;
|
|
287
305
|
});
|
|
288
306
|
const trackedImpressionModeRef = useRef(null);
|
|
289
307
|
useEffect(() => {
|
|
@@ -421,28 +439,40 @@ function Banner({ placement: placementId, classname = "", interaction, referralT
|
|
|
421
439
|
return /* @__PURE__ */ jsxs("div", {
|
|
422
440
|
class: bannerClass,
|
|
423
441
|
role: "alert",
|
|
424
|
-
children: [
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
442
|
+
children: [
|
|
443
|
+
/* @__PURE__ */ jsx("div", {
|
|
444
|
+
class: `${referralIconWrapper} frak-banner__icon`,
|
|
445
|
+
children: imageUrl ? /* @__PURE__ */ jsx("img", {
|
|
446
|
+
src: imageUrl,
|
|
447
|
+
alt: "",
|
|
448
|
+
class: referralImage
|
|
449
|
+
}) : /* @__PURE__ */ jsx(GiftIcon, { class: iconSvg })
|
|
450
|
+
}),
|
|
451
|
+
/* @__PURE__ */ jsxs("div", {
|
|
452
|
+
class: `${referralBody} frak-banner__text`,
|
|
453
|
+
children: [
|
|
454
|
+
/* @__PURE__ */ jsx("p", {
|
|
455
|
+
class: `${referralTitle} frak-banner__title`,
|
|
456
|
+
children: texts.title
|
|
457
|
+
}),
|
|
458
|
+
/* @__PURE__ */ jsx("p", {
|
|
459
|
+
class: `${referralDescription} frak-banner__description`,
|
|
460
|
+
children: texts.description
|
|
461
|
+
}),
|
|
462
|
+
/* @__PURE__ */ jsx("button", {
|
|
463
|
+
type: "button",
|
|
464
|
+
class: `${referralCta} frak-banner__cta`,
|
|
465
|
+
onClick: handleAction,
|
|
466
|
+
children: texts.cta
|
|
467
|
+
})
|
|
468
|
+
]
|
|
469
|
+
}),
|
|
470
|
+
/* @__PURE__ */ jsx(LogoFrakWithName, {
|
|
471
|
+
class: `${frakLogo} frak-banner__logo`,
|
|
472
|
+
width: 42,
|
|
473
|
+
height: 24
|
|
474
|
+
})
|
|
475
|
+
]
|
|
446
476
|
});
|
|
447
477
|
}
|
|
448
478
|
//#endregion
|
|
@@ -458,7 +488,9 @@ registerWebComponent(Banner, "frak-banner", [
|
|
|
458
488
|
"inappDescription",
|
|
459
489
|
"inappCta",
|
|
460
490
|
"preview",
|
|
461
|
-
"previewMode"
|
|
491
|
+
"previewMode",
|
|
492
|
+
"imageUrl",
|
|
493
|
+
"allowInappRedirect"
|
|
462
494
|
], { shadow: false });
|
|
463
495
|
//#endregion
|
|
464
496
|
export { Banner };
|
package/dist/buttonShare.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { a as registerWebComponent, i as useClientReady, s as openEmbeddedWallet, t as usePlacement } from "./usePlacement-
|
|
2
|
-
import { t as
|
|
3
|
-
import { t as
|
|
4
|
-
import { t as
|
|
5
|
-
import { t as
|
|
6
|
-
import { t as
|
|
1
|
+
import { a as registerWebComponent, i as useClientReady, s as openEmbeddedWallet, t as usePlacement } from "./usePlacement-DzEuVg_u.js";
|
|
2
|
+
import { t as openSharingPage } from "./sharingPage-D6fQEXV9.js";
|
|
3
|
+
import { t as useGlobalComponents } from "./useGlobalComponents-mSs9unyN.js";
|
|
4
|
+
import { t as useLightDomStyles } from "./useLightDomStyles-DVe5UDg6.js";
|
|
5
|
+
import { t as applyRewardPlaceholder } from "./formatReward-Cf2KpA3x.js";
|
|
6
|
+
import { t as useReward } from "./useReward-ClVShg45.js";
|
|
7
7
|
import { trackEvent } from "@frak-labs/core-sdk";
|
|
8
8
|
import { useCallback, useMemo } from "preact/hooks";
|
|
9
9
|
import { jsx } from "preact/jsx-runtime";
|
package/dist/buttonWallet.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as registerWebComponent, i as useClientReady, n as buildStyleContent, o as openWalletModal, t as usePlacement } from "./usePlacement-
|
|
2
|
-
import { t as useReward } from "./useReward-
|
|
1
|
+
import { a as registerWebComponent, i as useClientReady, n as buildStyleContent, o as openWalletModal, t as usePlacement } from "./usePlacement-DzEuVg_u.js";
|
|
2
|
+
import { t as useReward } from "./useReward-ClVShg45.js";
|
|
3
3
|
import { useEffect, useMemo, useState } from "preact/hooks";
|
|
4
4
|
import { Fragment, jsx, jsxs } from "preact/jsx-runtime";
|
|
5
5
|
//#region src/components/ButtonWallet/assets/GiftIcon.tsx
|