@flowsta/login-button 0.1.0 → 0.1.1
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/qwik.js +36 -36
- package/dist/react.js +30 -30
- package/dist/vanilla.js +21 -21
- package/package.json +7 -4
- /package/dist/{style.css → login-button.css} +0 -0
package/dist/qwik.js
CHANGED
|
@@ -1,59 +1,59 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as n } from "@builder.io/qwik/jsx-runtime";
|
|
2
2
|
import { component$ as m, useSignal as h, $ as w } from "@builder.io/qwik";
|
|
3
3
|
import { b } from "./oauth-DEOZXwxb.js";
|
|
4
|
-
import { h as
|
|
5
|
-
const
|
|
4
|
+
import { h as S, p as F } from "./oauth-DEOZXwxb.js";
|
|
5
|
+
const C = m((e) => {
|
|
6
6
|
const {
|
|
7
|
-
clientId:
|
|
8
|
-
redirectUri:
|
|
9
|
-
scopes:
|
|
10
|
-
variant:
|
|
11
|
-
loginUrl:
|
|
12
|
-
className:
|
|
13
|
-
disabled:
|
|
14
|
-
onSuccess$:
|
|
15
|
-
onError$:
|
|
16
|
-
onClick$:
|
|
17
|
-
} =
|
|
18
|
-
if (!(
|
|
7
|
+
clientId: r,
|
|
8
|
+
redirectUri: i,
|
|
9
|
+
scopes: l = ["profile"],
|
|
10
|
+
variant: s = "dark-pill",
|
|
11
|
+
loginUrl: c,
|
|
12
|
+
className: d = "",
|
|
13
|
+
disabled: t = !1,
|
|
14
|
+
onSuccess$: k,
|
|
15
|
+
onError$: u,
|
|
16
|
+
onClick$: g
|
|
17
|
+
} = e, a = h(!1), f = w(async () => {
|
|
18
|
+
if (!(t || a.value)) {
|
|
19
19
|
a.value = !0;
|
|
20
20
|
try {
|
|
21
|
-
|
|
22
|
-
const { url:
|
|
23
|
-
clientId:
|
|
24
|
-
redirectUri:
|
|
25
|
-
scopes:
|
|
26
|
-
loginUrl:
|
|
21
|
+
g?.();
|
|
22
|
+
const { url: o } = await b({
|
|
23
|
+
clientId: r,
|
|
24
|
+
redirectUri: i,
|
|
25
|
+
scopes: l,
|
|
26
|
+
loginUrl: c
|
|
27
27
|
});
|
|
28
|
-
typeof window < "u" && (window.location.href =
|
|
29
|
-
} catch (
|
|
30
|
-
a.value = !1,
|
|
28
|
+
typeof window < "u" && (window.location.href = o);
|
|
29
|
+
} catch (o) {
|
|
30
|
+
a.value = !1, u?.({
|
|
31
31
|
error: "authorization_failed",
|
|
32
|
-
errorDescription:
|
|
32
|
+
errorDescription: o instanceof Error ? o.message : "Unknown error"
|
|
33
33
|
});
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
|
-
}), p = (
|
|
37
|
-
return /* @__PURE__ */
|
|
36
|
+
}), p = (o) => `/node_modules/@flowsta/login-button/assets/svg/${`flowsta_signin_web_${o.replace("-", "_")}`}.svg`;
|
|
37
|
+
return /* @__PURE__ */ n(
|
|
38
38
|
"button",
|
|
39
39
|
{
|
|
40
40
|
type: "button",
|
|
41
41
|
onClick$: f,
|
|
42
|
-
disabled:
|
|
43
|
-
class: `flowsta-login-button ${
|
|
42
|
+
disabled: t || a.value,
|
|
43
|
+
class: `flowsta-login-button ${d || e.class || ""}`,
|
|
44
44
|
"aria-label": "Sign in with Flowsta",
|
|
45
45
|
style: {
|
|
46
46
|
border: "none",
|
|
47
47
|
background: "transparent",
|
|
48
48
|
padding: "0",
|
|
49
|
-
cursor:
|
|
50
|
-
opacity:
|
|
49
|
+
cursor: t || a.value ? "not-allowed" : "pointer",
|
|
50
|
+
opacity: t || a.value ? "0.6" : "1",
|
|
51
51
|
transition: "opacity 0.2s ease"
|
|
52
52
|
},
|
|
53
|
-
children: /* @__PURE__ */
|
|
53
|
+
children: /* @__PURE__ */ n(
|
|
54
54
|
"img",
|
|
55
55
|
{
|
|
56
|
-
src: p(
|
|
56
|
+
src: p(s),
|
|
57
57
|
alt: "Sign in with Flowsta",
|
|
58
58
|
width: 175,
|
|
59
59
|
height: 40,
|
|
@@ -68,9 +68,9 @@ const $ = m((n) => {
|
|
|
68
68
|
);
|
|
69
69
|
});
|
|
70
70
|
export {
|
|
71
|
-
|
|
71
|
+
C as FlowstaLoginButton,
|
|
72
72
|
b as buildAuthorizationUrl,
|
|
73
|
-
|
|
74
|
-
|
|
73
|
+
C as default,
|
|
74
|
+
S as handleCallback,
|
|
75
75
|
F as parseCallbackUrl
|
|
76
76
|
};
|
package/dist/react.js
CHANGED
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as u } from "react/jsx-runtime";
|
|
2
2
|
import { useState as b, useCallback as y } from "react";
|
|
3
3
|
import { b as k } from "./oauth-DEOZXwxb.js";
|
|
4
|
-
import { h as
|
|
4
|
+
import { h as j, p as A } from "./oauth-DEOZXwxb.js";
|
|
5
5
|
import { getButtonUrl as x } from "./index.js";
|
|
6
|
-
function
|
|
7
|
-
clientId:
|
|
8
|
-
redirectUri:
|
|
9
|
-
scopes:
|
|
10
|
-
variant:
|
|
11
|
-
loginUrl:
|
|
6
|
+
function z({
|
|
7
|
+
clientId: r,
|
|
8
|
+
redirectUri: n,
|
|
9
|
+
scopes: e = ["openid", "email", "display_name"],
|
|
10
|
+
variant: p = "dark-pill",
|
|
11
|
+
loginUrl: i,
|
|
12
12
|
className: h = "",
|
|
13
13
|
disabled: t = !1,
|
|
14
|
-
onSuccess:
|
|
15
|
-
onError:
|
|
16
|
-
onClick:
|
|
14
|
+
onSuccess: C,
|
|
15
|
+
onError: s,
|
|
16
|
+
onClick: l,
|
|
17
17
|
children: m
|
|
18
18
|
}) {
|
|
19
|
-
const [a,
|
|
19
|
+
const [a, c] = b(!1), f = y(async () => {
|
|
20
20
|
if (!(t || a)) {
|
|
21
|
-
|
|
21
|
+
c(!0);
|
|
22
22
|
try {
|
|
23
|
-
|
|
24
|
-
const { url:
|
|
25
|
-
clientId:
|
|
26
|
-
redirectUri:
|
|
27
|
-
scopes:
|
|
28
|
-
loginUrl:
|
|
23
|
+
l?.();
|
|
24
|
+
const { url: o } = await k({
|
|
25
|
+
clientId: r,
|
|
26
|
+
redirectUri: n,
|
|
27
|
+
scopes: e,
|
|
28
|
+
loginUrl: i
|
|
29
29
|
});
|
|
30
|
-
window.location.href =
|
|
31
|
-
} catch (
|
|
32
|
-
|
|
30
|
+
window.location.href = o;
|
|
31
|
+
} catch (o) {
|
|
32
|
+
c(!1), s?.({
|
|
33
33
|
error: "authorization_failed",
|
|
34
|
-
errorDescription:
|
|
34
|
+
errorDescription: o instanceof Error ? o.message : "Unknown error"
|
|
35
35
|
});
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
|
-
}, [
|
|
39
|
-
return /* @__PURE__ */
|
|
38
|
+
}, [r, n, e, i, t, a, l, s]), [g, d] = p.split("-"), w = x(g, d);
|
|
39
|
+
return /* @__PURE__ */ u(
|
|
40
40
|
"button",
|
|
41
41
|
{
|
|
42
42
|
type: "button",
|
|
@@ -52,7 +52,7 @@ function B({
|
|
|
52
52
|
opacity: t || a ? 0.6 : 1,
|
|
53
53
|
transition: "opacity 0.2s ease"
|
|
54
54
|
},
|
|
55
|
-
children: m || /* @__PURE__ */
|
|
55
|
+
children: m || /* @__PURE__ */ u(
|
|
56
56
|
"img",
|
|
57
57
|
{
|
|
58
58
|
src: w,
|
|
@@ -70,9 +70,9 @@ function B({
|
|
|
70
70
|
);
|
|
71
71
|
}
|
|
72
72
|
export {
|
|
73
|
-
|
|
73
|
+
z as FlowstaLoginButton,
|
|
74
74
|
k as buildAuthorizationUrl,
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
75
|
+
z as default,
|
|
76
|
+
j as handleCallback,
|
|
77
|
+
A as parseCallbackUrl
|
|
78
78
|
};
|
package/dist/vanilla.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { b as w } from "./oauth-DEOZXwxb.js";
|
|
2
|
-
import { a as
|
|
3
|
-
function
|
|
2
|
+
import { a as S, g as E, c as _, d as F, h as L, p as U, r as V, f as $, s as x, e as B, v as N } from "./oauth-DEOZXwxb.js";
|
|
3
|
+
function c(e) {
|
|
4
4
|
const {
|
|
5
5
|
clientId: s,
|
|
6
6
|
redirectUri: n,
|
|
7
7
|
scopes: r = ["profile"],
|
|
8
|
-
variant:
|
|
9
|
-
loginUrl:
|
|
10
|
-
className:
|
|
8
|
+
variant: d = "dark-pill",
|
|
9
|
+
loginUrl: u,
|
|
10
|
+
className: g = "",
|
|
11
11
|
disabled: o = !1,
|
|
12
12
|
onSuccess: m,
|
|
13
|
-
onError:
|
|
14
|
-
onClick:
|
|
13
|
+
onError: p,
|
|
14
|
+
onClick: f
|
|
15
15
|
} = e, t = document.createElement("button");
|
|
16
|
-
t.type = "button", t.className = `flowsta-login-button ${
|
|
16
|
+
t.type = "button", t.className = `flowsta-login-button ${g}`.trim(), t.setAttribute("aria-label", "Sign in with Flowsta"), t.disabled = o, Object.assign(t.style, {
|
|
17
17
|
border: "none",
|
|
18
18
|
background: "transparent",
|
|
19
19
|
padding: "0",
|
|
@@ -21,27 +21,27 @@ function u(e) {
|
|
|
21
21
|
opacity: o ? "0.6" : "1",
|
|
22
22
|
transition: "opacity 0.2s ease"
|
|
23
23
|
});
|
|
24
|
-
const a = document.createElement("img"), b = `flowsta_signin_web_${
|
|
24
|
+
const a = document.createElement("img"), b = `flowsta_signin_web_${d.replace("-", "_")}`;
|
|
25
25
|
a.src = `/node_modules/@flowsta/login-button/assets/svg/${b}.svg`, a.alt = "Sign in with Flowsta", a.width = 175, a.height = 40, Object.assign(a.style, {
|
|
26
26
|
display: "block",
|
|
27
27
|
maxWidth: "100%",
|
|
28
28
|
height: "auto"
|
|
29
29
|
}), t.appendChild(a);
|
|
30
|
-
let
|
|
30
|
+
let l = !1;
|
|
31
31
|
return t.addEventListener("click", async () => {
|
|
32
|
-
if (!(t.disabled ||
|
|
33
|
-
|
|
32
|
+
if (!(t.disabled || l)) {
|
|
33
|
+
l = !0, t.style.opacity = "0.6", t.style.cursor = "not-allowed";
|
|
34
34
|
try {
|
|
35
|
-
|
|
35
|
+
f?.();
|
|
36
36
|
const { url: i } = await w({
|
|
37
37
|
clientId: s,
|
|
38
38
|
redirectUri: n,
|
|
39
39
|
scopes: r,
|
|
40
|
-
loginUrl:
|
|
40
|
+
loginUrl: u
|
|
41
41
|
});
|
|
42
42
|
window.location.href = i;
|
|
43
43
|
} catch (i) {
|
|
44
|
-
|
|
44
|
+
l = !1, t.style.opacity = o ? "0.6" : "1", t.style.cursor = o ? "not-allowed" : "pointer", p?.({
|
|
45
45
|
error: "authorization_failed",
|
|
46
46
|
errorDescription: i instanceof Error ? i.message : "Unknown error"
|
|
47
47
|
});
|
|
@@ -53,20 +53,20 @@ function h(e, s) {
|
|
|
53
53
|
const n = typeof e == "string" ? document.querySelector(e) : e;
|
|
54
54
|
if (!n)
|
|
55
55
|
throw new Error(`Container not found: ${e}`);
|
|
56
|
-
const r =
|
|
56
|
+
const r = c(s);
|
|
57
57
|
return n.appendChild(r), r;
|
|
58
58
|
}
|
|
59
59
|
const C = {
|
|
60
|
-
createFlowstaLoginButton:
|
|
60
|
+
createFlowstaLoginButton: c,
|
|
61
61
|
initFlowstaLoginButton: h
|
|
62
62
|
};
|
|
63
63
|
export {
|
|
64
64
|
w as buildAuthorizationUrl,
|
|
65
|
-
|
|
65
|
+
c as createFlowstaLoginButton,
|
|
66
66
|
C as default,
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
67
|
+
S as generateCodeChallenge,
|
|
68
|
+
E as generateCodeVerifier,
|
|
69
|
+
_ as generatePKCEPair,
|
|
70
70
|
F as generateState,
|
|
71
71
|
L as handleCallback,
|
|
72
72
|
h as initFlowstaLoginButton,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flowsta/login-button",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "Login with Flowsta button components for React, Vue, Qwik, and vanilla JavaScript",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -58,9 +58,9 @@
|
|
|
58
58
|
"directory": "packages/login-button"
|
|
59
59
|
},
|
|
60
60
|
"peerDependencies": {
|
|
61
|
+
"@builder.io/qwik": "^1.0.0",
|
|
61
62
|
"react": "^18.0.0 || ^19.0.0",
|
|
62
|
-
"vue": "^3.0.0"
|
|
63
|
-
"@builder.io/qwik": "^1.0.0"
|
|
63
|
+
"vue": "^3.0.0"
|
|
64
64
|
},
|
|
65
65
|
"peerDependenciesMeta": {
|
|
66
66
|
"react": {
|
|
@@ -79,10 +79,13 @@
|
|
|
79
79
|
"@vitejs/plugin-vue": "^6.0.1",
|
|
80
80
|
"react": "^18.3.1",
|
|
81
81
|
"typescript": "^5.5.4",
|
|
82
|
-
"vite": "^
|
|
82
|
+
"vite": "^7.3.1",
|
|
83
83
|
"vue": "^3.4.0"
|
|
84
84
|
},
|
|
85
85
|
"engines": {
|
|
86
86
|
"node": ">=18.0.0"
|
|
87
|
+
},
|
|
88
|
+
"dependencies": {
|
|
89
|
+
"happy-dom": "20.5.0"
|
|
87
90
|
}
|
|
88
91
|
}
|
|
File without changes
|