@levo-so/react 0.1.48 → 0.1.50

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 (65) hide show
  1. package/dist/components/Dialog.d.ts +2 -3
  2. package/dist/components/Tabs.d.ts +1 -1
  3. package/dist/components/Tooltip.d.ts +2 -1
  4. package/dist/components/button/buttonVariants.d.ts +2 -2
  5. package/dist/constants/fileUploadPresets.d.ts +1 -0
  6. package/dist/index.css +1 -1
  7. package/dist/index.d.ts +3 -3
  8. package/dist/index.js +1609 -91
  9. package/package.json +21 -43
  10. package/dist/Sonner-BzW9wsXf.js +0 -39
  11. package/dist/Spinner-DBvVyDMF.js +0 -119
  12. package/dist/Tooltip-BeY_STLA.js +0 -281
  13. package/dist/audience/components/block.d.ts.map +0 -1
  14. package/dist/audience/components/component.d.ts.map +0 -1
  15. package/dist/audience/components/page.d.ts.map +0 -1
  16. package/dist/audience/hooks/useBounce.d.ts.map +0 -1
  17. package/dist/audience/hooks/useCurrentTab.d.ts.map +0 -1
  18. package/dist/audience/hooks/useDownloadSpeed.d.ts.map +0 -1
  19. package/dist/audience/hooks/useIdentifyAudience.d.ts.map +0 -1
  20. package/dist/audience/hooks/useOpenTabs.d.ts.map +0 -1
  21. package/dist/audience/hooks/usePerformanceMetrics.d.ts.map +0 -1
  22. package/dist/audience/hooks/useScrollBehavior.d.ts.map +0 -1
  23. package/dist/audience/hooks/useTextSelection.d.ts.map +0 -1
  24. package/dist/audience/hooks/useTrackClicks.d.ts.map +0 -1
  25. package/dist/audience/index.d.ts.map +0 -1
  26. package/dist/audience/index.js +0 -6
  27. package/dist/audience/utils/autocapture.d.ts.map +0 -1
  28. package/dist/audience/utils/rageclick.d.ts.map +0 -1
  29. package/dist/cn-C9QoOYNG.js +0 -6
  30. package/dist/components/Dialog.d.ts.map +0 -1
  31. package/dist/components/DialogWrapper.d.ts.map +0 -1
  32. package/dist/components/Sonner.d.ts.map +0 -1
  33. package/dist/components/Spinner.d.ts.map +0 -1
  34. package/dist/components/Table.d.ts.map +0 -1
  35. package/dist/components/Tabs.d.ts.map +0 -1
  36. package/dist/components/Tooltip.d.ts.map +0 -1
  37. package/dist/components/button/Button.d.ts.map +0 -1
  38. package/dist/components/button/buttonVariants.d.ts.map +0 -1
  39. package/dist/components/button/index.d.ts.map +0 -1
  40. package/dist/components/index.d.ts.map +0 -1
  41. package/dist/components/index.js +0 -34
  42. package/dist/constants/fileUploadPresets.d.ts.map +0 -1
  43. package/dist/constants/index.d.ts.map +0 -1
  44. package/dist/isEmptyObject-BoIi0jMB.js +0 -21
  45. package/dist/jsx-runtime-D0AQ1Mn7.js +0 -633
  46. package/dist/membership/components/Button.d.ts.map +0 -1
  47. package/dist/membership/components/Container.d.ts.map +0 -1
  48. package/dist/membership/components/Core.d.ts.map +0 -1
  49. package/dist/membership/components/Popup.d.ts.map +0 -1
  50. package/dist/membership/index.d.ts.map +0 -1
  51. package/dist/membership/index.js +0 -221
  52. package/dist/membership/useLevoOAuth.d.ts.map +0 -1
  53. package/dist/page-DweUjn1K.js +0 -627
  54. package/dist/providers/LevoProvider.d.ts.map +0 -1
  55. package/dist/providers/index.d.ts +0 -2
  56. package/dist/providers/index.js +0 -13
  57. package/dist/utils/byteToSize.d.ts.map +0 -1
  58. package/dist/utils/cn.d.ts.map +0 -1
  59. package/dist/utils/errorHandler.d.ts.map +0 -1
  60. package/dist/utils/index.d.ts.map +0 -1
  61. package/dist/utils/index.js +0 -12
  62. package/dist/utils/isDateObject.d.ts.map +0 -1
  63. package/dist/utils/isEmptyObject.d.ts.map +0 -1
  64. package/dist/utils/isNullOrUndefined.d.ts.map +0 -1
  65. package/dist/utils/isObject.d.ts.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"Container.d.ts","sourceRoot":"","sources":["../../../src/membership/components/Container.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,KAAmD,MAAM,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E,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,IAAI,CAAC;IAClD,OAAO,EAAE,CACP,KAAK,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,KAC9D,IAAI,CAAC;IACV,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,QAAA,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,UAAU,CA+BnC,CAAC;AAEF,eAAe,SAAS,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"Popup.d.ts","sourceRoot":"","sources":["../../../src/membership/components/Popup.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,KAAK,YAAY,GAAG;IAClB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,KAAK,WAAW,GAAG,YAAY,GAAG;IAChC,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,eAAe,KAAK,IAAI,CAAC;IACxD,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,CAAC;AAaF,QAAA,MAAM,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CAiEhC,CAAC;AAEF,eAAe,KAAK,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/membership/index.ts"],"names":[],"mappings":"AAIA,qBAAa,SAAS;IACpB,MAAM,CAAC,SAAS,sEAAa;IAE7B,MAAM,CAAC,MAAM;;kBAIqB,MAAO,SAAS;OAJ3B;CACxB;AAED,cAAc,gBAAgB,CAAC"}
@@ -1,221 +0,0 @@
1
- "use client";
2
- var $ = Object.defineProperty;
3
- var I = (o, t, n) => t in o ? $(o, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : o[t] = n;
4
- var O = (o, t, n) => I(o, typeof t != "symbol" ? t + "" : t, n);
5
- import { j as g } from "../jsx-runtime-D0AQ1Mn7.js";
6
- import { S as N } from "../Spinner-DBvVyDMF.js";
7
- import S, { useState as x, useEffect as L, useMemo as W, useContext as _, useRef as b, useCallback as P } from "react";
8
- import { useLevo as E } from "../providers/index.js";
9
- const U = S.createContext({
10
- urls: null,
11
- title: "",
12
- isLoading: !1,
13
- onSuccess: () => {
14
- },
15
- onError: () => {
16
- }
17
- }), A = ({
18
- title: o,
19
- onSuccess: t,
20
- onError: n,
21
- children: c
22
- }) => {
23
- const i = E(), l = typeof window < "u" ? window.location.href : "", [s, e] = x(null), [h, f] = x(!1);
24
- L(() => {
25
- var r;
26
- i.membership && (f(!0), (r = i.membership) == null || r.getOAuthURL().then((p) => {
27
- e(p);
28
- }).catch(() => {
29
- n({
30
- code: "SOMETHING_WENT_WRONG",
31
- message: "We could not connect with our service for your sign-in."
32
- });
33
- }).finally(() => {
34
- f(!1);
35
- }));
36
- }, []);
37
- const d = W(
38
- () => ({ title: o, urls: s, isLoading: h, onSuccess: t, onError: n }),
39
- [o, s, t, n, h]
40
- );
41
- return L(() => {
42
- if (s && l) {
43
- const r = {}, p = Object.keys(s);
44
- for (const m of p)
45
- try {
46
- const w = s[m];
47
- if (w) {
48
- const v = new URL(w), y = v.searchParams;
49
- y.set("redirect_uri", l);
50
- const C = i.pageContext;
51
- C && y.set("page_context", JSON.stringify(C)), r[m] = v.toString();
52
- }
53
- } catch {
54
- }
55
- e(r);
56
- }
57
- }, [l]), /* @__PURE__ */ g.jsx(U.Provider, { value: d, children: c });
58
- }, k = () => _(U), T = ({ url: o, title: t, height: n, width: c }) => {
59
- const i = window.screenX + (window.outerWidth - c) / 2, l = window.screenY + (window.outerHeight - n) / 2.5;
60
- return window.open(
61
- o,
62
- t,
63
- `width=${c},height=${n},left=${i},top=${l}`
64
- );
65
- }, G = ({
66
- title: o = "",
67
- width: t = 500,
68
- height: n = 500,
69
- url: c,
70
- children: i,
71
- onCode: l,
72
- onClose: s
73
- }) => {
74
- const [e, h] = x(), f = b(), d = () => {
75
- window.clearInterval(f.current);
76
- }, r = () => {
77
- h(
78
- T({
79
- url: c,
80
- title: o,
81
- width: t,
82
- height: n
83
- })
84
- );
85
- };
86
- return L(() => (e && (f.current = window.setInterval(() => {
87
- try {
88
- const p = e.location.href, m = new URL(p).searchParams, w = m.get("code");
89
- if (!w)
90
- return;
91
- l(w, m), d(), e.close();
92
- } catch {
93
- } finally {
94
- (!e || e.closed) && (s(), d());
95
- }
96
- }, 700)), () => {
97
- e && e.close(), s && s();
98
- }), [e]), /* @__PURE__ */ g.jsx(
99
- "div",
100
- {
101
- onClick: () => {
102
- r();
103
- },
104
- children: i
105
- }
106
- );
107
- }, H = ({
108
- title: o = "Levo",
109
- url: t,
110
- children: n,
111
- onSuccess: c,
112
- onError: i,
113
- width: l = 500,
114
- height: s = 700
115
- }) => {
116
- const e = P((h, f) => {
117
- h.toLowerCase() === "success" ? c(f) : i(f);
118
- }, []);
119
- return /* @__PURE__ */ g.jsx(
120
- G,
121
- {
122
- title: o,
123
- width: l,
124
- height: s,
125
- onClose: () => {
126
- },
127
- url: t,
128
- onCode: e,
129
- children: n
130
- }
131
- );
132
- }, M = ({ children: o, provider: t }) => {
133
- const { title: n, urls: c, isLoading: i, onSuccess: l, onError: s } = k(), e = c == null ? void 0 : c[t];
134
- return e ? /* @__PURE__ */ g.jsx(
135
- H,
136
- {
137
- title: n,
138
- provider: t,
139
- url: e,
140
- onSuccess: l,
141
- onError: s,
142
- children: i ? /* @__PURE__ */ g.jsx("div", { className: "w-full items-center justify-center", children: /* @__PURE__ */ g.jsx(N, { className: "h-5 w-5 bg-brand" }) }) : o
143
- }
144
- ) : null;
145
- }, B = ({ url: o, title: t, height: n, width: c }) => {
146
- const i = window.screenX + (window.outerWidth - c) / 2, l = window.screenY + (window.outerHeight - n) / 2.5;
147
- return window.open(
148
- o,
149
- t,
150
- `width=${c},height=${n},left=${i},top=${l}`
151
- );
152
- }, D = ({
153
- title: o = "Levo",
154
- width: t = 500,
155
- height: n = 700,
156
- onSuccess: c
157
- }) => {
158
- const i = E(), [l, s] = x(!1), [e, h] = x(null), [f, d] = x(null), [r, p] = x(), m = b(), w = () => {
159
- window.clearInterval(m.current);
160
- }, v = P((a, u) => {
161
- a.toLowerCase() === "success" ? (d(null), c(u)) : d(u);
162
- }, []);
163
- L(() => {
164
- var a;
165
- i.membership && (s(!0), (a = i.membership) == null || a.getOAuthURL().then((u) => {
166
- if (u)
167
- return h(u), u;
168
- throw new Error();
169
- }).catch(() => {
170
- d({
171
- code: "SOMETHING_WENT_WRONG",
172
- message: "We could not connect with our service for your sign-in."
173
- });
174
- }).finally(() => {
175
- s(!1);
176
- }));
177
- }, []), L(() => (r && (m.current = window.setInterval(() => {
178
- try {
179
- const a = r.location.href, u = new URL(a).searchParams, R = u.get("code");
180
- if (!R)
181
- return;
182
- v(R, u), w(), r.close();
183
- } catch {
184
- } finally {
185
- (!r || r.closed) && (w(), d(null));
186
- }
187
- }, 700)), () => {
188
- r && r.close();
189
- }), [r]);
190
- const y = P(
191
- (a) => {
192
- if (a && e !== null) {
193
- const u = e == null ? void 0 : e[a];
194
- u && (r && r.close(), p(
195
- B({
196
- url: u,
197
- title: o,
198
- width: t,
199
- height: n
200
- })
201
- ));
202
- }
203
- },
204
- [e, r]
205
- );
206
- return {
207
- providers: W(() => e !== null ? Object.keys(e).filter(
208
- (a) => !!e[a]
209
- ) : [], [e]),
210
- isLoading: l,
211
- error: f,
212
- launchPopup: y
213
- };
214
- };
215
- class j {
216
- }
217
- O(j, "Container", A), O(j, "Button", M);
218
- export {
219
- j as LevoOAuth,
220
- D as useLevoOAuth
221
- };
@@ -1 +0,0 @@
1
- {"version":3,"file":"useLevoOAuth.d.ts","sourceRoot":"","sources":["../../src/membership/useLevoOAuth.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAsBrD,MAAM,WAAW,kBAAkB;IACjC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,IAAI,CAAC;IAClD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,eAAO,MAAM,YAAY,GAAI,sCAK1B,kBAAkB;;;;cAMX,MAAM;iBACH,MAAM;;4BA2EJ,eAAe,CAAC,gBAAgB;CAsC9C,CAAC"}