@levo-so/react 0.1.35 → 0.1.37
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/dist/{CheckboxWidget-BrVNbP0R.js → CheckboxWidget-BR6g2qCr.js} +1 -1
- package/dist/{CollectionFormBuilder-CkD8uVKZ.js → CollectionFormBuilder-KNHR7ngy.js} +18 -18
- package/dist/{CurrencyWidget-D_q2AYWu.js → CurrencyWidget-XHAkyPjV.js} +1 -1
- package/dist/{DateTimeWidget-CsuCisSs.js → DateTimeWidget-UaUunQAK.js} +1 -1
- package/dist/{DefaultFormVariant-rv38sBOZ.js → DefaultFormVariant-C8hqkuxx.js} +3 -3
- package/dist/{DropdownWidget-CsTQ0Ojo.js → DropdownWidget-DvObQQMp.js} +1 -1
- package/dist/{EmailWidget-Did2OUyB.js → EmailWidget-7L0S6tat.js} +2 -2
- package/dist/{FormCaptcha-C_DxR2za.js → FormCaptcha-CgYoGiya.js} +3 -3
- package/dist/{GeocoderWidget-CyzcaWxa.js → GeocoderWidget-DfghAiuD.js} +3 -3
- package/dist/{MultiGeocoderWidget-DgwiZ330.js → MultiGeocoderWidget-CqwjH855.js} +3 -3
- package/dist/{MultiTextWidget-Dic46WBU.js → MultiTextWidget-BMp9xdSv.js} +1 -1
- package/dist/{PhoneWidget-DKH-Wzgz.js → PhoneWidget-DFP4giY9.js} +1 -1
- package/dist/{RadioWidget-CTgWKCg2.js → RadioWidget-DMWMo2Mj.js} +2 -2
- package/dist/{RichTextWidget-C30H7mVF.js → RichTextWidget-DOCSDDib.js} +2 -2
- package/dist/{Spinner-BcBoT-J5.js → Spinner-B4CjY8aw.js} +20 -19
- package/dist/{StepsFormVariant-myT97AwJ.js → StepsFormVariant-CUFLCpGE.js} +3 -3
- package/dist/{SwitchWidget-BS-rmHiq.js → SwitchWidget-BjpxXOcZ.js} +1 -1
- package/dist/{TextWidget-aNB-0vc-.js → TextWidget-Cgk_TFqD.js} +1 -1
- package/dist/{TextareaWidget-CEH-97Oj.js → TextareaWidget-DGU_Xhrx.js} +1 -1
- package/dist/{ToggleCheckboxWidget-C0buyS29.js → ToggleCheckboxWidget-bhmeasG_.js} +1 -1
- package/dist/{URLWidget-DrZlRAD7.js → URLWidget-B20QysNc.js} +2 -2
- package/dist/{UploadWidget-Bw7urh-7.js → UploadWidget-SQ1MLpbO.js} +2 -2
- package/dist/audience/components/block.d.ts.map +1 -1
- package/dist/audience/components/component.d.ts +2 -2
- package/dist/audience/components/component.d.ts.map +1 -1
- package/dist/audience/components/page.d.ts +3 -4
- package/dist/audience/components/page.d.ts.map +1 -1
- package/dist/audience/hooks/useBounce.d.ts +4 -0
- package/dist/audience/hooks/useBounce.d.ts.map +1 -0
- package/dist/audience/hooks/useCurrentTab.d.ts.map +1 -1
- package/dist/audience/hooks/useIdentifyAudience.d.ts +7 -0
- package/dist/audience/hooks/useIdentifyAudience.d.ts.map +1 -0
- package/dist/audience/hooks/useOpenTabs.d.ts.map +1 -1
- package/dist/audience/index.js +1 -1
- package/dist/collection/index.js +1 -1
- package/dist/components/button/buttonVariants.d.ts +1 -1
- package/dist/components/button/buttonVariants.d.ts.map +1 -1
- package/dist/components/index.js +1 -1
- package/dist/index.css +1 -1
- package/dist/index.js +3 -3
- package/dist/membership/index.js +70 -69
- package/dist/page-BVVduzWl.js +626 -0
- package/dist/providers/LevoProvider.d.ts +4 -19
- package/dist/providers/LevoProvider.d.ts.map +1 -1
- package/dist/providers/index.js +8 -164
- package/package.json +4 -4
- package/dist/Checbox-sq-atGlJ.js.map +0 -1
- package/dist/CheckboxWidget-BrVNbP0R.js.map +0 -1
- package/dist/CollectionFormBuilder-CkD8uVKZ.js.map +0 -1
- package/dist/CurrencyWidget-D_q2AYWu.js.map +0 -1
- package/dist/DateTimeWidget-CsuCisSs.js.map +0 -1
- package/dist/DefaultFormVariant-rv38sBOZ.js.map +0 -1
- package/dist/DropdownWidget-CsTQ0Ojo.js.map +0 -1
- package/dist/EmailWidget-Did2OUyB.js.map +0 -1
- package/dist/FormCaptcha-C_DxR2za.js.map +0 -1
- package/dist/GeocoderWidget-CyzcaWxa.js.map +0 -1
- package/dist/Input-Vv7mKQFt.js.map +0 -1
- package/dist/MultiGeocoderWidget-DgwiZ330.js.map +0 -1
- package/dist/MultiTextWidget-Dic46WBU.js.map +0 -1
- package/dist/PhoneWidget-DKH-Wzgz.js.map +0 -1
- package/dist/RadioWidget-CTgWKCg2.js.map +0 -1
- package/dist/RichTextWidget-C30H7mVF.js.map +0 -1
- package/dist/Sonner-t6JVKA0a.js.map +0 -1
- package/dist/Spinner-BcBoT-J5.js.map +0 -1
- package/dist/StepsFormVariant-myT97AwJ.js.map +0 -1
- package/dist/SwitchWidget-BS-rmHiq.js.map +0 -1
- package/dist/TextWidget-aNB-0vc-.js.map +0 -1
- package/dist/TextareaWidget-CEH-97Oj.js.map +0 -1
- package/dist/ToggleCheckboxWidget-C0buyS29.js.map +0 -1
- package/dist/Tooltip-DoWyn3Ho.js.map +0 -1
- package/dist/URLWidget-DrZlRAD7.js.map +0 -1
- package/dist/UploadWidget-Bw7urh-7.js.map +0 -1
- package/dist/audience/index.js.map +0 -1
- package/dist/byteToSize-BFKZSBu1.js.map +0 -1
- package/dist/cn-C9QoOYNG.js.map +0 -1
- package/dist/collection/index.js.map +0 -1
- package/dist/components/index.js.map +0 -1
- package/dist/errorHandler-_34Yv8wA.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/isEmptyObject-C5s4GzLE.js.map +0 -1
- package/dist/jsx-runtime-B6kdoens.js.map +0 -1
- package/dist/membership/index.js.map +0 -1
- package/dist/page-t8PpNiSB.js +0 -567
- package/dist/page-t8PpNiSB.js.map +0 -1
- package/dist/providers/index.js.map +0 -1
- package/dist/utils/index.js.map +0 -1
package/dist/membership/index.js
CHANGED
|
@@ -1,146 +1,147 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
var
|
|
3
|
-
var R = (e, t, n) => t in e ?
|
|
4
|
-
var
|
|
5
|
-
import { j as
|
|
6
|
-
import j, { useState as
|
|
7
|
-
import { useLevo as
|
|
8
|
-
const
|
|
2
|
+
var O = Object.defineProperty;
|
|
3
|
+
var R = (e, t, n) => t in e ? O(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
4
|
+
var m = (e, t, n) => R(e, typeof t != "symbol" ? t + "" : t, n);
|
|
5
|
+
import { j as p } from "../jsx-runtime-B6kdoens.js";
|
|
6
|
+
import j, { useState as g, useEffect as x, useMemo as y, useContext as P, useRef as U, useCallback as W } from "react";
|
|
7
|
+
import { useLevo as _ } from "../providers/index.js";
|
|
8
|
+
const L = j.createContext({
|
|
9
9
|
urls: null,
|
|
10
10
|
title: "",
|
|
11
11
|
onSuccess: () => {
|
|
12
12
|
},
|
|
13
13
|
onError: () => {
|
|
14
14
|
}
|
|
15
|
-
}),
|
|
15
|
+
}), b = ({
|
|
16
16
|
title: e,
|
|
17
17
|
onSuccess: t,
|
|
18
18
|
onError: n,
|
|
19
|
-
children:
|
|
19
|
+
children: s
|
|
20
20
|
}) => {
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
const c = _(), i = typeof window < "u" ? window.location.href : "", [o, r] = g(null);
|
|
22
|
+
x(() => {
|
|
23
|
+
var u;
|
|
24
|
+
c.membership && ((u = c.membership) == null || u.getOAuthURL().then((a) => {
|
|
25
|
+
r(a);
|
|
25
26
|
}).catch(() => {
|
|
26
27
|
n({
|
|
27
28
|
code: "SOMETHING_WENT_WRONG",
|
|
28
29
|
message: "We could not connect with our service for your sign-in."
|
|
29
30
|
});
|
|
30
31
|
}));
|
|
31
|
-
}, [
|
|
32
|
-
const
|
|
32
|
+
}, []);
|
|
33
|
+
const f = y(
|
|
33
34
|
() => ({ title: e, urls: o, onSuccess: t, onError: n }),
|
|
34
35
|
[e, o, t, n]
|
|
35
36
|
);
|
|
36
|
-
return
|
|
37
|
-
if (o &&
|
|
38
|
-
const
|
|
39
|
-
for (const
|
|
37
|
+
return x(() => {
|
|
38
|
+
if (o && i) {
|
|
39
|
+
const u = {}, a = Object.keys(o);
|
|
40
|
+
for (const h of a)
|
|
40
41
|
try {
|
|
41
|
-
const
|
|
42
|
-
if (
|
|
43
|
-
const
|
|
44
|
-
|
|
45
|
-
const
|
|
46
|
-
|
|
42
|
+
const l = o[h];
|
|
43
|
+
if (l) {
|
|
44
|
+
const w = new URL(l), d = w.searchParams;
|
|
45
|
+
d.set("redirect_uri", i);
|
|
46
|
+
const C = c.pageContext;
|
|
47
|
+
C && d.set("page_context", JSON.stringify(C)), u[h] = w.toString();
|
|
47
48
|
}
|
|
48
49
|
} catch {
|
|
49
50
|
}
|
|
50
|
-
|
|
51
|
+
r(u);
|
|
51
52
|
}
|
|
52
|
-
}, [
|
|
53
|
-
},
|
|
54
|
-
const
|
|
53
|
+
}, [i]), /* @__PURE__ */ p.jsx(L.Provider, { value: f, children: s });
|
|
54
|
+
}, k = () => P(L), A = ({ url: e, title: t, height: n, width: s }) => {
|
|
55
|
+
const c = window.screenX + (window.outerWidth - s) / 2, i = window.screenY + (window.outerHeight - n) / 2.5;
|
|
55
56
|
return window.open(
|
|
56
57
|
e,
|
|
57
58
|
t,
|
|
58
|
-
`width=${
|
|
59
|
+
`width=${s},height=${n},left=${c},top=${i}`
|
|
59
60
|
);
|
|
60
|
-
},
|
|
61
|
+
}, E = ({
|
|
61
62
|
title: e = "",
|
|
62
63
|
width: t = 500,
|
|
63
64
|
height: n = 500,
|
|
64
|
-
url:
|
|
65
|
-
children:
|
|
66
|
-
onCode:
|
|
67
|
-
onClose:
|
|
65
|
+
url: s,
|
|
66
|
+
children: c,
|
|
67
|
+
onCode: i,
|
|
68
|
+
onClose: o
|
|
68
69
|
}) => {
|
|
69
|
-
const [
|
|
70
|
-
window.clearInterval(
|
|
71
|
-
},
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
url:
|
|
70
|
+
const [r, f] = g(), u = U(), a = () => {
|
|
71
|
+
window.clearInterval(u.current);
|
|
72
|
+
}, h = () => {
|
|
73
|
+
f(
|
|
74
|
+
A({
|
|
75
|
+
url: s,
|
|
75
76
|
title: e,
|
|
76
77
|
width: t,
|
|
77
78
|
height: n
|
|
78
79
|
})
|
|
79
80
|
);
|
|
80
81
|
};
|
|
81
|
-
return
|
|
82
|
+
return x(() => (r && (u.current = window.setInterval(() => {
|
|
82
83
|
try {
|
|
83
|
-
const
|
|
84
|
+
const l = r.location.href, w = new URL(l).searchParams, d = w.get("code");
|
|
84
85
|
if (!d)
|
|
85
86
|
return;
|
|
86
|
-
|
|
87
|
+
i(d, w), a(), r.close();
|
|
87
88
|
} catch {
|
|
88
89
|
} finally {
|
|
89
|
-
(!
|
|
90
|
+
(!r || r.closed) && (o(), a());
|
|
90
91
|
}
|
|
91
92
|
}, 700)), () => {
|
|
92
|
-
|
|
93
|
-
}), [
|
|
93
|
+
r && r.close(), o && o();
|
|
94
|
+
}), [r]), /* @__PURE__ */ p.jsx(
|
|
94
95
|
"div",
|
|
95
96
|
{
|
|
96
97
|
onClick: () => {
|
|
97
|
-
|
|
98
|
+
h();
|
|
98
99
|
},
|
|
99
|
-
children:
|
|
100
|
+
children: c
|
|
100
101
|
}
|
|
101
102
|
);
|
|
102
|
-
},
|
|
103
|
+
}, S = ({
|
|
103
104
|
title: e = "Levo",
|
|
104
105
|
url: t,
|
|
105
106
|
children: n,
|
|
106
|
-
onSuccess:
|
|
107
|
-
onError:
|
|
108
|
-
width:
|
|
109
|
-
height:
|
|
107
|
+
onSuccess: s,
|
|
108
|
+
onError: c,
|
|
109
|
+
width: i = 500,
|
|
110
|
+
height: o = 700
|
|
110
111
|
}) => {
|
|
111
|
-
const
|
|
112
|
-
|
|
112
|
+
const r = W((f, u) => {
|
|
113
|
+
f.toLowerCase() === "success" ? s(u) : c(u);
|
|
113
114
|
}, []);
|
|
114
|
-
return /* @__PURE__ */
|
|
115
|
-
|
|
115
|
+
return /* @__PURE__ */ p.jsx(
|
|
116
|
+
E,
|
|
116
117
|
{
|
|
117
118
|
title: e,
|
|
118
|
-
width:
|
|
119
|
-
height:
|
|
119
|
+
width: i,
|
|
120
|
+
height: o,
|
|
120
121
|
onClose: () => {
|
|
121
122
|
},
|
|
122
123
|
url: t,
|
|
123
|
-
onCode:
|
|
124
|
+
onCode: r,
|
|
124
125
|
children: n
|
|
125
126
|
}
|
|
126
127
|
);
|
|
127
|
-
},
|
|
128
|
-
const { title: n, urls:
|
|
129
|
-
return
|
|
130
|
-
|
|
128
|
+
}, N = ({ children: e, provider: t }) => {
|
|
129
|
+
const { title: n, urls: s, onSuccess: c, onError: i } = k(), o = s == null ? void 0 : s[t];
|
|
130
|
+
return o ? /* @__PURE__ */ p.jsx(
|
|
131
|
+
S,
|
|
131
132
|
{
|
|
132
133
|
title: n,
|
|
133
134
|
provider: t,
|
|
134
|
-
url:
|
|
135
|
-
onSuccess:
|
|
136
|
-
onError:
|
|
135
|
+
url: o,
|
|
136
|
+
onSuccess: c,
|
|
137
|
+
onError: i,
|
|
137
138
|
children: e
|
|
138
139
|
}
|
|
139
140
|
) : null;
|
|
140
141
|
};
|
|
141
142
|
class v {
|
|
142
143
|
}
|
|
143
|
-
|
|
144
|
+
m(v, "Container", b), m(v, "Button", N);
|
|
144
145
|
export {
|
|
145
146
|
v as LevoOAuth
|
|
146
147
|
};
|