@getauthui/core 0.1.13 → 0.1.15
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/README.md +3 -3
- package/dist/{authui-user-button-BSOjgJ6h.js → authui-user-button-CV2B_0j5.js} +295 -253
- package/dist/authui.cdn.js +161 -122
- package/dist/authui.cdn.mjs +739 -697
- package/dist/authui.js +2 -2
- package/dist/components/authui-sign-in.d.ts.map +1 -1
- package/dist/react/index.d.ts +6 -2
- package/dist/react/index.d.ts.map +1 -1
- package/dist/react.js +61 -44
- package/dist/styles/base.d.ts.map +1 -1
- package/dist/styles/tokens.d.ts.map +1 -1
- package/dist/types.d.ts +1 -1
- package/package.json +1 -1
package/dist/authui.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as t, c as r, o } from "./authui-user-button-
|
|
2
|
-
import { A as U, b as C, d as v, e as w, f as E, g as O, h as M, i as P, j as b, C as L, E as x, F as T, P as F, k as _, l as y, m as B, n as j, p as k, q, r as R, s as z, t as D, u as G, v as H, w as J, x as K, y as N } from "./authui-user-button-
|
|
1
|
+
import { a as t, c as r, o } from "./authui-user-button-CV2B_0j5.js";
|
|
2
|
+
import { A as U, b as C, d as v, e as w, f as E, g as O, h as M, i as P, j as b, C as L, E as x, F as T, P as F, k as _, l as y, m as B, n as j, p as k, q, r as R, s as z, t as D, u as G, v as H, w as J, x as K, y as N } from "./authui-user-button-CV2B_0j5.js";
|
|
3
3
|
import * as l from "appwrite";
|
|
4
4
|
function s(e) {
|
|
5
5
|
return t.configure(e), I;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authui-sign-in.d.ts","sourceRoot":"","sources":["../../src/components/authui-sign-in.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,KAAK,cAAc,EAAE,MAAM,KAAK,CAAC;AAGzD,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAM7C,OAAO,KAAK,EAAE,UAAU,EA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OAAO,CAAC,gBAAgB;IAqBxB,OAAO,CAAC,QAAQ;IAQhB,OAAO,CAAC,UAAU;IAsClB,OAAO,CAAC,cAAc;IA4CtB,OAAO,CAAC,eAAe;IA8HvB,OAAO,CAAC,YAAY;IA8FpB,OAAO,CAAC,YAAY;IAyCpB,OAAO,CAAC,YAAY;IAWpB,OAAO,CAAC,WAAW;IA8CnB,OAAO,CAAC,SAAS;IAWjB,OAAO,CAAC,cAAc;YAoBR,YAAY;IAsB1B,OAAO,CAAC,eAAe;IAoCvB,OAAO,CAAC,cAAc;IAYtB,OAAO,CAAC,WAAW;IA2BnB,OAAO,CAAC,SAAS;CAgGlB;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,gBAAgB,EAAE,YAAY,CAAC;KAChC;CACF"}
|
package/dist/react/index.d.ts
CHANGED
|
@@ -19,8 +19,12 @@ export declare function useAuthUI(): {
|
|
|
19
19
|
*
|
|
20
20
|
* Configuration runs during render (not in an effect) so the first paint already
|
|
21
21
|
* sees `configured: true` and a non-null `getClient()` when `endpoint` and
|
|
22
|
-
* `project` are present.
|
|
23
|
-
*
|
|
22
|
+
* `project` are present. Incomplete config (empty endpoint or project) mirrors
|
|
23
|
+
* `<authui-config>`: it does not mark configured, and surfaces `configError`.
|
|
24
|
+
* Changing any config field reconfigures the store. Passing a new object with
|
|
25
|
+
* the same values is fine; the fingerprint sorts keys so insertion order does
|
|
26
|
+
* not matter. `configure()` is idempotent, so React Strict Mode double-invoke
|
|
27
|
+
* is safe.
|
|
24
28
|
*/
|
|
25
29
|
export declare function AuthUIProvider({ config, children, }: {
|
|
26
30
|
config: AuthUIConfig;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/react/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAML,KAAK,YAAY,EACjB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAEf,OAAO,EAAE,SAAS,EAAE,UAA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,wBAAgB,YAAY,CAAC,KAAK,EAAE;IAClC,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,OAAO,CAAC,EAAE,SAAS,GAAG,OAAO,GAAG,SAAS,GAAG,WAAW,GAAG,OAAO,GAAG,MAAM,CAAC;IAC3E,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAC1B,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB,GAAG,YAAY,CAMf;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE;IAClC,IAAI,CAAC,EAAE,OAAO,CAAC,UAAU,EAAE,SAAS,CAAC,CAAC;IACtC,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;CACxB,GAAG,YAAY,CAEf;AAgBD,wBAAgB,aAAa,CAAC,KAAK,EAAE;IACnC,GAAG,CAAC,EAAE,SAAS,GAAG,UAAU,GAAG,UAAU,GAAG,aAAa,GAAG,UAAU,CAAC;CACxE,GAAG,YAAY,CAEf;AAOD,wBAAgB,gBAAgB,CAAC,KAAK,EAAE;IACtC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,SAAS,CAAC,EAAE,cAAc,EAAE,CAAC;IAC7B,YAAY,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB,GAAG,YAAY,CA6Bf;AAED;;;;;;;GAOG;AACH,wBAAgB,IAAI,CAAC,KAAK,EAAE;IAC1B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB,GAAG,YAAY,GAAG,IAAI,CAItB"}
|
package/dist/react.js
CHANGED
|
@@ -1,73 +1,90 @@
|
|
|
1
|
-
import { createElement as
|
|
2
|
-
import { a as
|
|
1
|
+
import { createElement as i, useState as r, useEffect as c, useRef as h, Fragment as f } from "react";
|
|
2
|
+
import { a as o, z as m, c as d, o as S } from "./authui-user-button-CV2B_0j5.js";
|
|
3
3
|
function v() {
|
|
4
|
-
const [e, n] =
|
|
5
|
-
return
|
|
4
|
+
const [e, n] = r(() => o.getState());
|
|
5
|
+
return c(() => o.on("change", n), []), {
|
|
6
6
|
...e,
|
|
7
|
-
open:
|
|
8
|
-
close:
|
|
9
|
-
signOut: () =>
|
|
10
|
-
store:
|
|
7
|
+
open: S,
|
|
8
|
+
close: d,
|
|
9
|
+
signOut: () => o.signOut(),
|
|
10
|
+
store: o
|
|
11
11
|
};
|
|
12
12
|
}
|
|
13
|
-
function
|
|
14
|
-
|
|
13
|
+
function l(e) {
|
|
14
|
+
if (e === null || typeof e != "object") return e;
|
|
15
|
+
if (Array.isArray(e)) return e.map(l);
|
|
16
|
+
const n = e, t = {};
|
|
17
|
+
for (const u of Object.keys(n).sort())
|
|
18
|
+
t[u] = l(n[u]);
|
|
19
|
+
return t;
|
|
15
20
|
}
|
|
16
|
-
function
|
|
21
|
+
function I(e) {
|
|
22
|
+
return JSON.stringify(l(e));
|
|
23
|
+
}
|
|
24
|
+
function O({
|
|
17
25
|
config: e,
|
|
18
26
|
children: n
|
|
19
27
|
}) {
|
|
20
|
-
const t =
|
|
21
|
-
|
|
28
|
+
const t = I(e), u = h(null);
|
|
29
|
+
if (u.current !== t) {
|
|
30
|
+
u.current = t;
|
|
31
|
+
const a = e.endpoint?.trim() ?? "", s = e.project?.trim() ?? "";
|
|
32
|
+
!a || !s ? o.notifyConfigIncomplete() : o.configure(e);
|
|
33
|
+
}
|
|
34
|
+
return i(f, null, n);
|
|
22
35
|
}
|
|
23
36
|
function E(e) {
|
|
24
|
-
const [n, t] =
|
|
25
|
-
return
|
|
37
|
+
const [n, t] = r(null);
|
|
38
|
+
return c(() => {
|
|
26
39
|
!n || e.closeOnSuccess === void 0 || (n.closeOnSuccess = e.closeOnSuccess);
|
|
27
|
-
}, [n, e.closeOnSuccess]), c(
|
|
40
|
+
}, [n, e.closeOnSuccess]), c(() => {
|
|
41
|
+
!n || typeof e.open != "boolean" || (n.open = e.open);
|
|
42
|
+
}, [n, e.open]), i("authui-modal", {
|
|
28
43
|
ref: t,
|
|
29
44
|
view: e.view,
|
|
30
|
-
|
|
45
|
+
// Preserve boolean false; `props.open || undefined` would drop it and leave
|
|
46
|
+
// the dialog open. Controlled writes also go through the effect above.
|
|
47
|
+
open: e.open === void 0 ? void 0 : e.open,
|
|
31
48
|
// Lit boolean attrs treat presence as true; write the string "false" so HTML
|
|
32
49
|
// and React can turn the default off. Also set the JS property above.
|
|
33
50
|
"close-on-success": e.closeOnSuccess === !1 ? "false" : e.closeOnSuccess === !0 ? "" : void 0
|
|
34
51
|
});
|
|
35
52
|
}
|
|
36
|
-
function
|
|
37
|
-
return
|
|
53
|
+
function b(e) {
|
|
54
|
+
return i(
|
|
38
55
|
"authui-button",
|
|
39
56
|
{ view: e.view, variant: e.variant, size: e.size },
|
|
40
57
|
e.children
|
|
41
58
|
);
|
|
42
59
|
}
|
|
43
|
-
function
|
|
44
|
-
return
|
|
60
|
+
function y(e) {
|
|
61
|
+
return i(w, e);
|
|
45
62
|
}
|
|
46
|
-
function
|
|
47
|
-
const [n, t] =
|
|
48
|
-
return
|
|
63
|
+
function w(e) {
|
|
64
|
+
const [n, t] = r(null);
|
|
65
|
+
return c(() => {
|
|
49
66
|
if (!n || !e.onSuccess) return;
|
|
50
67
|
const u = () => e.onSuccess?.();
|
|
51
68
|
return n.addEventListener("authui-success", u), () => n.removeEventListener("authui-success", u);
|
|
52
|
-
}, [n, e.onSuccess]),
|
|
69
|
+
}, [n, e.onSuccess]), i("authui-sign-in", { ref: t, view: e.view });
|
|
53
70
|
}
|
|
54
|
-
function
|
|
55
|
-
return
|
|
71
|
+
function U(e) {
|
|
72
|
+
return i("authui-account", { tab: e.tab });
|
|
56
73
|
}
|
|
57
|
-
function
|
|
58
|
-
const [n, t] =
|
|
59
|
-
return
|
|
74
|
+
function M(e) {
|
|
75
|
+
const [n, t] = r(null);
|
|
76
|
+
return c(() => {
|
|
60
77
|
!n || e.showTeams === void 0 || (n.showTeams = e.showTeams);
|
|
61
|
-
}, [n, e.showTeams]),
|
|
78
|
+
}, [n, e.showTeams]), c(() => {
|
|
62
79
|
n && (n.menuItems = e.menuItems ?? []);
|
|
63
|
-
}, [n, e.menuItems]),
|
|
80
|
+
}, [n, e.menuItems]), c(() => {
|
|
64
81
|
if (!n || !e.onMenuAction) return;
|
|
65
|
-
const u = (
|
|
66
|
-
const
|
|
67
|
-
|
|
82
|
+
const u = (a) => {
|
|
83
|
+
const s = a.detail?.actionId;
|
|
84
|
+
s && e.onMenuAction?.(s);
|
|
68
85
|
};
|
|
69
86
|
return n.addEventListener("authui-menu-action", u), () => n.removeEventListener("authui-menu-action", u);
|
|
70
|
-
}, [n, e.onMenuAction]),
|
|
87
|
+
}, [n, e.onMenuAction]), i(
|
|
71
88
|
"authui-user-button",
|
|
72
89
|
{
|
|
73
90
|
ref: t,
|
|
@@ -78,17 +95,17 @@ function T(e) {
|
|
|
78
95
|
e.children
|
|
79
96
|
);
|
|
80
97
|
}
|
|
81
|
-
function
|
|
98
|
+
function j(e) {
|
|
82
99
|
const { status: n } = v();
|
|
83
|
-
return
|
|
100
|
+
return m(n, e.when, e.unless) ? i(f, null, e.children) : null;
|
|
84
101
|
}
|
|
85
102
|
export {
|
|
86
|
-
|
|
87
|
-
|
|
103
|
+
U as AuthUIAccount,
|
|
104
|
+
b as AuthUIButton,
|
|
88
105
|
E as AuthUIModal,
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
106
|
+
O as AuthUIProvider,
|
|
107
|
+
y as AuthUISignIn,
|
|
108
|
+
M as AuthUIUserButton,
|
|
109
|
+
j as Show,
|
|
93
110
|
v as useAuthUI
|
|
94
111
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../src/styles/base.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,eAAO,MAAM,IAAI,
|
|
1
|
+
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../src/styles/base.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,eAAO,MAAM,IAAI,yBA4hChB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tokens.d.ts","sourceRoot":"","sources":["../../src/styles/tokens.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,eAAO,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"tokens.d.ts","sourceRoot":"","sources":["../../src/styles/tokens.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,eAAO,MAAM,MAAM,yBAgFlB,CAAC"}
|
package/dist/types.d.ts
CHANGED
|
@@ -121,7 +121,7 @@ export interface AuthUIState {
|
|
|
121
121
|
configured: boolean;
|
|
122
122
|
/**
|
|
123
123
|
* Developer-facing configuration problem (wrong project, origin, endpoint, or
|
|
124
|
-
* incomplete
|
|
124
|
+
* incomplete config). When set, sign-in shows this instead of a form.
|
|
125
125
|
*/
|
|
126
126
|
configError: string | null;
|
|
127
127
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@getauthui/core",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.15",
|
|
4
4
|
"description": "Drop-in authentication UI for Appwrite. One script tag, every sign-in method, MFA, sessions and account management as web components.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/authui.js",
|