pwa-auth 3.4.9 → 3.5.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/LICENSES.txt +18 -23
- package/README.md +547 -326
- package/base/api/drawer.d.ts +4 -0
- package/base/api/drawer.d.ts.map +1 -0
- package/base/api/drawer.js +12 -0
- package/base/api/drawer.js.map +1 -0
- package/base/api/user.d.ts +4 -0
- package/base/api/user.d.ts.map +1 -0
- package/base/api/user.js +25 -0
- package/base/api/user.js.map +1 -0
- package/base/api/verify.d.ts +4 -0
- package/base/api/verify.d.ts.map +1 -0
- package/base/api/verify.js +113 -0
- package/base/api/verify.js.map +1 -0
- package/base/deprecated/email-changed.d.ts +5 -0
- package/base/deprecated/email-changed.d.ts.map +1 -0
- package/base/deprecated/email-changed.js +9 -0
- package/base/deprecated/email-changed.js.map +1 -0
- package/base/events/emit.d.ts +12 -0
- package/base/events/emit.d.ts.map +1 -0
- package/base/events/emit.js +30 -0
- package/base/events/emit.js.map +1 -0
- package/base/events/names.d.ts +31 -0
- package/base/events/names.d.ts.map +1 -0
- package/base/events/names.js +31 -0
- package/base/events/names.js.map +1 -0
- package/base/events/types.d.ts +71 -0
- package/base/events/types.d.ts.map +1 -0
- package/base/events/types.js +2 -0
- package/base/events/types.js.map +1 -0
- package/base/export/pwa-auth.d.ts +17 -7
- package/base/export/pwa-auth.d.ts.map +1 -0
- package/base/export/pwa-auth.js +13 -7
- package/base/export/pwa-auth.js.map +1 -1
- package/base/firebase/attribute.d.ts +2 -0
- package/base/firebase/attribute.d.ts.map +1 -0
- package/base/firebase/attribute.js +17 -0
- package/base/firebase/attribute.js.map +1 -0
- package/base/firebase/authentication.d.ts +21 -10
- package/base/firebase/authentication.d.ts.map +1 -0
- package/base/firebase/authentication.js +65 -8
- package/base/firebase/authentication.js.map +1 -1
- package/base/firebase/interface.d.ts +7 -1
- package/base/firebase/interface.d.ts.map +1 -0
- package/base/firebase/interface.js +99 -68
- package/base/firebase/interface.js.map +1 -1
- package/base/firebase/message.d.ts +2 -0
- package/base/firebase/message.d.ts.map +1 -0
- package/base/firebase/message.js +34 -0
- package/base/firebase/message.js.map +1 -0
- package/base/firebase/password.d.ts +11 -0
- package/base/firebase/password.d.ts.map +1 -0
- package/base/firebase/password.js +16 -0
- package/base/firebase/password.js.map +1 -0
- package/base/lazyLoader.d.ts +1 -0
- package/base/lazyLoader.d.ts.map +1 -0
- package/base/redux/backend.d.ts +1 -0
- package/base/redux/backend.d.ts.map +1 -0
- package/base/redux/backend.js +1 -1
- package/base/redux/backend.js.map +1 -1
- package/base/redux/frontend.d.ts +16 -1
- package/base/redux/frontend.d.ts.map +1 -0
- package/base/redux/frontend.js +6 -3
- package/base/redux/frontend.js.map +1 -1
- package/base/store.d.ts +1 -6
- package/base/store.d.ts.map +1 -0
- package/base/store.js +2 -4
- package/base/store.js.map +1 -1
- package/base/webcomponents/css/animation.d.ts +1 -0
- package/base/webcomponents/css/animation.d.ts.map +1 -0
- package/base/webcomponents/css/animation.js +79 -67
- package/base/webcomponents/css/animation.js.map +1 -1
- package/base/webcomponents/css/svg.d.ts +1 -2
- package/base/webcomponents/css/svg.d.ts.map +1 -0
- package/base/webcomponents/css/svg.js +2 -4
- package/base/webcomponents/css/svg.js.map +1 -1
- package/base/webcomponents/css/tap.d.ts +3 -0
- package/base/webcomponents/css/tap.d.ts.map +1 -0
- package/base/webcomponents/css/tap.js +9 -0
- package/base/webcomponents/css/tap.js.map +1 -0
- package/base/webcomponents/css/toggle.d.ts +1 -0
- package/base/webcomponents/css/toggle.d.ts.map +1 -0
- package/base/webcomponents/css/toggle.js +5 -5
- package/base/webcomponents/drawer/css/drawer.d.ts +1 -0
- package/base/webcomponents/drawer/css/drawer.d.ts.map +1 -0
- package/base/webcomponents/drawer/css/drawer.js +101 -74
- package/base/webcomponents/drawer/css/drawer.js.map +1 -1
- package/base/webcomponents/drawer/css/exit.d.ts +1 -0
- package/base/webcomponents/drawer/css/exit.d.ts.map +1 -0
- package/base/webcomponents/drawer/css/exit.js +58 -52
- package/base/webcomponents/drawer/css/exit.js.map +1 -1
- package/base/webcomponents/drawer/css/link.d.ts +1 -0
- package/base/webcomponents/drawer/css/link.d.ts.map +1 -0
- package/base/webcomponents/drawer/css/link.js +9 -10
- package/base/webcomponents/drawer/css/link.js.map +1 -1
- package/base/webcomponents/drawer/css/paragraph.d.ts +1 -0
- package/base/webcomponents/drawer/css/paragraph.d.ts.map +1 -0
- package/base/webcomponents/drawer/css/paragraph.js +37 -20
- package/base/webcomponents/drawer/css/paragraph.js.map +1 -1
- package/base/webcomponents/drawer/drawer.d.ts +21 -7
- package/base/webcomponents/drawer/drawer.d.ts.map +1 -0
- package/base/webcomponents/drawer/drawer.js +292 -90
- package/base/webcomponents/drawer/drawer.js.map +1 -1
- package/base/webcomponents/drawer/keys.d.ts +4 -0
- package/base/webcomponents/drawer/keys.d.ts.map +1 -0
- package/base/webcomponents/drawer/keys.js +57 -0
- package/base/webcomponents/drawer/keys.js.map +1 -0
- package/base/webcomponents/form/css/button.d.ts +1 -0
- package/base/webcomponents/form/css/button.d.ts.map +1 -0
- package/base/webcomponents/form/css/button.js +69 -51
- package/base/webcomponents/form/css/button.js.map +1 -1
- package/base/webcomponents/form/css/input.d.ts +1 -0
- package/base/webcomponents/form/css/input.d.ts.map +1 -0
- package/base/webcomponents/form/css/input.js +22 -21
- package/base/webcomponents/form/css/input.js.map +1 -1
- package/base/webcomponents/form/css/label.d.ts +1 -0
- package/base/webcomponents/form/css/label.d.ts.map +1 -0
- package/base/webcomponents/form/css/label.js +22 -21
- package/base/webcomponents/form/css/label.js.map +1 -1
- package/base/webcomponents/form/css/list.d.ts +1 -0
- package/base/webcomponents/form/css/list.d.ts.map +1 -0
- package/base/webcomponents/form/css/list.js +19 -19
- package/base/webcomponents/form/css/notice.d.ts +3 -0
- package/base/webcomponents/form/css/notice.d.ts.map +1 -0
- package/base/webcomponents/form/css/notice.js +20 -0
- package/base/webcomponents/form/css/notice.js.map +1 -0
- package/base/webcomponents/form/css/status.d.ts +4 -0
- package/base/webcomponents/form/css/status.d.ts.map +1 -0
- package/base/webcomponents/form/css/status.js +44 -0
- package/base/webcomponents/form/css/status.js.map +1 -0
- package/base/webcomponents/form/css/toggle.d.ts +1 -0
- package/base/webcomponents/form/css/toggle.d.ts.map +1 -0
- package/base/webcomponents/form/css/toggle.js +43 -17
- package/base/webcomponents/form/css/toggle.js.map +1 -1
- package/base/webcomponents/form/draft.d.ts +5 -0
- package/base/webcomponents/form/draft.d.ts.map +1 -0
- package/base/webcomponents/form/draft.js +22 -0
- package/base/webcomponents/form/draft.js.map +1 -0
- package/base/webcomponents/form/forgot.d.ts +26 -3
- package/base/webcomponents/form/forgot.d.ts.map +1 -0
- package/base/webcomponents/form/forgot.js +297 -30
- package/base/webcomponents/form/forgot.js.map +1 -1
- package/base/webcomponents/form/letters.d.ts +3 -0
- package/base/webcomponents/form/letters.d.ts.map +1 -0
- package/base/webcomponents/form/letters.js +21 -0
- package/base/webcomponents/form/letters.js.map +1 -0
- package/base/webcomponents/form/login.d.ts +10 -0
- package/base/webcomponents/form/login.d.ts.map +1 -0
- package/base/webcomponents/form/login.js +221 -89
- package/base/webcomponents/form/login.js.map +1 -1
- package/base/webcomponents/form/notice.d.ts +4 -0
- package/base/webcomponents/form/notice.d.ts.map +1 -0
- package/base/webcomponents/form/notice.js +14 -0
- package/base/webcomponents/form/notice.js.map +1 -0
- package/base/webcomponents/form/reveal.d.ts +3 -0
- package/base/webcomponents/form/reveal.d.ts.map +1 -0
- package/base/webcomponents/form/reveal.js +14 -0
- package/base/webcomponents/form/reveal.js.map +1 -0
- package/base/webcomponents/form/signup.d.ts +8 -0
- package/base/webcomponents/form/signup.d.ts.map +1 -0
- package/base/webcomponents/form/signup.js +201 -100
- package/base/webcomponents/form/signup.js.map +1 -1
- package/base/webcomponents/form/verified.d.ts +3 -0
- package/base/webcomponents/form/verified.d.ts.map +1 -0
- package/base/webcomponents/form/verified.js +45 -0
- package/base/webcomponents/form/verified.js.map +1 -0
- package/base/webcomponents/icon/css/icon.d.ts +1 -0
- package/base/webcomponents/icon/css/icon.d.ts.map +1 -0
- package/base/webcomponents/icon/css/icon.js +63 -49
- package/base/webcomponents/icon/css/icon.js.map +1 -1
- package/base/webcomponents/icon/icon.d.ts +6 -4
- package/base/webcomponents/icon/icon.d.ts.map +1 -0
- package/base/webcomponents/icon/icon.js +48 -27
- package/base/webcomponents/icon/icon.js.map +1 -1
- package/base/webcomponents/login/css/auth.d.ts +1 -0
- package/base/webcomponents/login/css/auth.d.ts.map +1 -0
- package/base/webcomponents/login/css/auth.js +37 -36
- package/base/webcomponents/login/css/auth.js.map +1 -1
- package/base/webcomponents/login/css/link.d.ts +1 -0
- package/base/webcomponents/login/css/link.d.ts.map +1 -0
- package/base/webcomponents/login/css/link.js +9 -10
- package/base/webcomponents/login/css/link.js.map +1 -1
- package/base/webcomponents/login/css/paragraph.d.ts +1 -0
- package/base/webcomponents/login/css/paragraph.d.ts.map +1 -0
- package/base/webcomponents/login/css/paragraph.js +8 -8
- package/base/webcomponents/login/page.d.ts +10 -6
- package/base/webcomponents/login/page.d.ts.map +1 -0
- package/base/webcomponents/login/page.js +96 -55
- package/base/webcomponents/login/page.js.map +1 -1
- package/base/webcomponents/settings/css/navigation.d.ts +1 -0
- package/base/webcomponents/settings/css/navigation.d.ts.map +1 -0
- package/base/webcomponents/settings/css/navigation.js +78 -68
- package/base/webcomponents/settings/css/navigation.js.map +1 -1
- package/base/webcomponents/settings/input/delete.d.ts +7 -6
- package/base/webcomponents/settings/input/delete.d.ts.map +1 -0
- package/base/webcomponents/settings/input/delete.js +135 -48
- package/base/webcomponents/settings/input/delete.js.map +1 -1
- package/base/webcomponents/settings/input/email.d.ts +7 -5
- package/base/webcomponents/settings/input/email.d.ts.map +1 -0
- package/base/webcomponents/settings/input/email.js +155 -50
- package/base/webcomponents/settings/input/email.js.map +1 -1
- package/base/webcomponents/settings/input/name.d.ts +8 -5
- package/base/webcomponents/settings/input/name.d.ts.map +1 -0
- package/base/webcomponents/settings/input/name.js +116 -53
- package/base/webcomponents/settings/input/name.js.map +1 -1
- package/base/webcomponents/settings/input/password.d.ts +8 -5
- package/base/webcomponents/settings/input/password.d.ts.map +1 -0
- package/base/webcomponents/settings/input/password.js +200 -103
- package/base/webcomponents/settings/input/password.js.map +1 -1
- package/base/webcomponents/settings/input/uploader.d.ts +8 -6
- package/base/webcomponents/settings/input/uploader.d.ts.map +1 -0
- package/base/webcomponents/settings/input/uploader.js +209 -170
- package/base/webcomponents/settings/input/uploader.js.map +1 -1
- package/base/webcomponents/settings/input/verify.d.ts +64 -0
- package/base/webcomponents/settings/input/verify.d.ts.map +1 -0
- package/base/webcomponents/settings/input/verify.js +272 -0
- package/base/webcomponents/settings/input/verify.js.map +1 -0
- package/base/webcomponents/settings/settings.d.ts +15 -10
- package/base/webcomponents/settings/settings.d.ts.map +1 -0
- package/base/webcomponents/settings/settings.js +226 -147
- package/base/webcomponents/settings/settings.js.map +1 -1
- package/firebase.md +107 -0
- package/intro.md +19 -0
- package/license +21 -21
- package/package.json +116 -71
- package/source/pwa-auth.js +1098 -407
- package/source/pwa-styles.css +50 -68
- package/base/redux/drawer.d.ts +0 -17
- package/base/redux/drawer.js +0 -22
- package/base/redux/drawer.js.map +0 -1
- package/demonstration/index.html +0 -99
- package/demonstration/pwa-styles.css +0 -77
- package/demonstration/styles.css +0 -77
- package/notes.md +0 -11
- package/source/THIRD_PARTY_LICENSES.txt +0 -303
|
@@ -1,23 +1,40 @@
|
|
|
1
1
|
import { css } from "lit";
|
|
2
|
-
export const lineStyle = css `
|
|
3
|
-
|
|
4
|
-
.setLog > a
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
border-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
2
|
+
export const lineStyle = css `
|
|
3
|
+
|
|
4
|
+
.setLog > a,
|
|
5
|
+
.setLog > button.settings {
|
|
6
|
+
min-height: var(--pwa_tap, 44px); /* Required - minimum tap target */
|
|
7
|
+
display: block;
|
|
8
|
+
box-sizing: border-box;
|
|
9
|
+
width: auto;
|
|
10
|
+
padding: 12px 16px;
|
|
11
|
+
margin: 12px 16px;
|
|
12
|
+
border: 1px solid var(--pwa_line_color, #e3daca);
|
|
13
|
+
border-radius: 10px;
|
|
14
|
+
color: var(--pwa_drawer_text_color, #1c2430);
|
|
15
|
+
background: transparent;
|
|
16
|
+
text-align: center;
|
|
17
|
+
text-decoration: none;
|
|
18
|
+
font: inherit;
|
|
19
|
+
font-weight: 600;
|
|
20
|
+
cursor: pointer;
|
|
21
|
+
appearance: none;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.setLog > button {
|
|
25
|
+
min-height: var(--pwa_tap, 44px); /* Required - minimum tap target */
|
|
26
|
+
display: block;
|
|
27
|
+
box-sizing: border-box;
|
|
28
|
+
cursor: pointer;
|
|
29
|
+
padding: 12px 16px;
|
|
30
|
+
margin: 8px 16px 16px;
|
|
31
|
+
border: 1px solid var(--pwa_line_color, #e3daca);
|
|
32
|
+
border-radius: 10px;
|
|
33
|
+
background: transparent;
|
|
34
|
+
color: inherit;
|
|
35
|
+
font: inherit;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
|
|
22
39
|
`;
|
|
23
40
|
//# sourceMappingURL=paragraph.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"paragraph.js","sourceRoot":"","sources":["../../../../typescript/webcomponents/drawer/css/paragraph.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAa,MAAM,KAAK,CAAC;AAErC,MAAM,CAAC,MAAM,SAAS,GAAc,GAAG,CAAA
|
|
1
|
+
{"version":3,"file":"paragraph.js","sourceRoot":"","sources":["../../../../typescript/webcomponents/drawer/css/paragraph.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAa,MAAM,KAAK,CAAC;AAErC,MAAM,CAAC,MAAM,SAAS,GAAc,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqCtC,CAAC"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { CSSResultArray, LitElement } from 'lit';
|
|
2
|
-
import { AppState } from '../../store';
|
|
3
|
-
import '../
|
|
4
|
-
import '../form/
|
|
1
|
+
import { CSSResultArray, LitElement, PropertyValues } from 'lit';
|
|
2
|
+
import { AppState } from '../../store.js';
|
|
3
|
+
import '../settings/input/verify.js';
|
|
4
|
+
import '../form/login.js';
|
|
5
|
+
import '../form/signup.js';
|
|
5
6
|
declare const UserDrawer_base: (new (...args: any[]) => {
|
|
6
7
|
_storeUnsubscribe: import("redux").Unsubscribe;
|
|
7
8
|
connectedCallback(): void;
|
|
@@ -21,9 +22,6 @@ declare const UserDrawer_base: (new (...args: any[]) => {
|
|
|
21
22
|
phone: string;
|
|
22
23
|
email: string;
|
|
23
24
|
};
|
|
24
|
-
drawer: {
|
|
25
|
-
drawer: boolean;
|
|
26
|
-
};
|
|
27
25
|
backend: {
|
|
28
26
|
verified: boolean;
|
|
29
27
|
anon: boolean;
|
|
@@ -42,13 +40,28 @@ export declare class UserDrawer extends UserDrawer_base {
|
|
|
42
40
|
drawer: boolean;
|
|
43
41
|
subscribe: boolean;
|
|
44
42
|
private name;
|
|
43
|
+
private email;
|
|
44
|
+
private verified;
|
|
45
|
+
private notice;
|
|
45
46
|
private user;
|
|
46
47
|
private signup;
|
|
48
|
+
private wasOpen;
|
|
49
|
+
private sawOpen;
|
|
50
|
+
private returnFocus;
|
|
51
|
+
private stopNotice;
|
|
47
52
|
constructor();
|
|
53
|
+
connectedCallback(): void;
|
|
54
|
+
disconnectedCallback(): void;
|
|
48
55
|
stateChanged(state: AppState): void;
|
|
56
|
+
protected updated(changed: PropertyValues): void;
|
|
57
|
+
private onKey;
|
|
58
|
+
private onLightClick;
|
|
49
59
|
protected firstUpdated(): void;
|
|
50
60
|
static get styles(): CSSResultArray;
|
|
51
61
|
protected render(): import("lit-html").TemplateResult<1>;
|
|
62
|
+
private destination;
|
|
63
|
+
private settingsControl;
|
|
64
|
+
private onSettings;
|
|
52
65
|
}
|
|
53
66
|
declare global {
|
|
54
67
|
interface HTMLElementTagNameMap {
|
|
@@ -56,3 +69,4 @@ declare global {
|
|
|
56
69
|
}
|
|
57
70
|
}
|
|
58
71
|
export {};
|
|
72
|
+
//# sourceMappingURL=drawer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"drawer.d.ts","sourceRoot":"","sources":["../../../typescript/webcomponents/drawer/drawer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,cAAc,EAAQ,UAAU,EAAE,cAAc,EAAE,MAAQ,KAAK,CAAC;AAI9E,OAAO,EAAS,QAAQ,EAAE,MAAO,gBAAgB,CAAC;AAwBlD,OAAO,6BAA6B,CAAC;AAErC,OAAO,kBAAkB,CAAC;AAC1B,OAAO,mBAAmB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAI3B,qBACa,UAAW,SAAQ,eAA0B;IAGR,GAAG,SAAM;IAGQ,MAAM,UAAS;IAGf,SAAS,UAAS;IAE1E,OAAO,CAAC,IAAI,CAAc;IAC1B,OAAO,CAAC,KAAK,CAAa;IAC1B,OAAO,CAAC,QAAQ,CAAa;IAC7B,OAAO,CAAC,MAAM,CAAY;IAC1B,OAAO,CAAC,IAAI,CAAiB;IAC7B,OAAO,CAAC,MAAM,CAAe;IAEtC,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,WAAW,CAA4B;IAC/C,OAAO,CAAC,UAAU,CAA6B;;IAItC,iBAAiB,IAAI,IAAI;IASzB,oBAAoB,IAAI,IAAI;IAQrC,YAAY,CAAC,KAAK,EAAE,QAAQ;IAkB5B,SAAS,CAAC,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,IAAI;IAchD,OAAO,CAAC,KAAK,CAyBX;IAGF,OAAO,CAAC,YAAY,CASlB;IAEF,SAAS,CAAC,YAAY;IAuBtB,MAAM,KAAK,MAAM,IAAI,cAAc,CA4DhC;IAEH,SAAS,CAAC,MAAM;IAqFhB,OAAO,CAAC,WAAW;IAInB,OAAO,CAAC,eAAe;IAQvB,OAAO,CAAC,UAAU,CAiBhB;CAEH;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC3B,aAAa,EAAE,UAAU,CAAC;KAC7B;CACF"}
|
|
@@ -9,20 +9,31 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
9
9
|
};
|
|
10
10
|
import { css, html, LitElement } from 'lit';
|
|
11
11
|
import { customElement, property, state } from 'lit/decorators.js';
|
|
12
|
-
import { connect } from 'pwa-helpers/connect-mixin';
|
|
13
|
-
import { store } from '../../store';
|
|
14
|
-
import { close } from '../css/svg';
|
|
15
|
-
import { show } from '../css/toggle';
|
|
16
|
-
import { listStyle } from '../form/css/list';
|
|
17
|
-
import { drawerStyle } from './css/drawer';
|
|
18
|
-
import { exitStyle } from './css/exit';
|
|
19
|
-
import { linkStyle } from './css/link';
|
|
20
|
-
import { lineStyle } from './css/paragraph';
|
|
21
|
-
import {
|
|
22
|
-
import { logOut } from '../../firebase/interface';
|
|
23
|
-
import '
|
|
24
|
-
import '
|
|
25
|
-
import {
|
|
12
|
+
import { connect } from 'pwa-helpers/connect-mixin.js';
|
|
13
|
+
import { store } from '../../store.js';
|
|
14
|
+
import { close } from '../css/svg.js';
|
|
15
|
+
import { show } from '../css/toggle.js';
|
|
16
|
+
import { listStyle } from '../form/css/list.js';
|
|
17
|
+
import { drawerStyle } from './css/drawer.js';
|
|
18
|
+
import { exitStyle } from './css/exit.js';
|
|
19
|
+
import { linkStyle } from './css/link.js';
|
|
20
|
+
import { lineStyle } from './css/paragraph.js';
|
|
21
|
+
import { closeSign } from '../../redux/frontend.js';
|
|
22
|
+
import { logOut } from '../../firebase/interface.js';
|
|
23
|
+
import { refreshEmailVerified } from '../../api/verify.js';
|
|
24
|
+
import { applyFirebaseConfig } from '../../firebase/attribute.js';
|
|
25
|
+
import { pwaDrawerToggleName, pwaSettings } from '../../events/names.js';
|
|
26
|
+
import { emitElement } from '../../events/emit.js';
|
|
27
|
+
import { deepActive, focusable } from './keys.js';
|
|
28
|
+
import { accountTitle } from '../form/letters.js';
|
|
29
|
+
import { noticeStyle } from '../form/css/notice.js';
|
|
30
|
+
import { onVerificationNotice, verificationNotice } from '../form/notice.js';
|
|
31
|
+
import { verifiedMark, verifiedStyle } from '../form/verified.js';
|
|
32
|
+
import '../settings/input/verify.js';
|
|
33
|
+
import '../form/login.js';
|
|
34
|
+
import '../form/signup.js';
|
|
35
|
+
import { animation } from '../css/animation.js';
|
|
36
|
+
import { tapStyle } from '../css/tap.js';
|
|
26
37
|
let UserDrawer = class UserDrawer extends connect(store)(LitElement) {
|
|
27
38
|
constructor() {
|
|
28
39
|
super();
|
|
@@ -30,29 +41,142 @@ let UserDrawer = class UserDrawer extends connect(store)(LitElement) {
|
|
|
30
41
|
this.drawer = false;
|
|
31
42
|
this.subscribe = false;
|
|
32
43
|
this.name = "";
|
|
44
|
+
this.email = "";
|
|
45
|
+
this.verified = false;
|
|
46
|
+
this.notice = "";
|
|
33
47
|
this.user = false;
|
|
34
48
|
this.signup = false;
|
|
49
|
+
this.wasOpen = false;
|
|
50
|
+
this.sawOpen = false;
|
|
51
|
+
this.returnFocus = null;
|
|
52
|
+
this.stopNotice = null;
|
|
53
|
+
this.onKey = (event) => {
|
|
54
|
+
if (!this.drawer)
|
|
55
|
+
return;
|
|
56
|
+
if (event.key === 'Escape') {
|
|
57
|
+
event.preventDefault();
|
|
58
|
+
store.dispatch(closeSign());
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
if (event.key !== 'Tab')
|
|
62
|
+
return;
|
|
63
|
+
const items = focusable(this);
|
|
64
|
+
if (!items.length)
|
|
65
|
+
return;
|
|
66
|
+
const first = items[0];
|
|
67
|
+
const last = items[items.length - 1];
|
|
68
|
+
const active = deepActive();
|
|
69
|
+
const inside = active ? items.includes(active) : false;
|
|
70
|
+
if (event.shiftKey) {
|
|
71
|
+
if (!inside || active === first) {
|
|
72
|
+
event.preventDefault();
|
|
73
|
+
last.focus();
|
|
74
|
+
}
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
if (!inside || active === last) {
|
|
78
|
+
event.preventDefault();
|
|
79
|
+
first.focus();
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
this.onLightClick = (event) => {
|
|
83
|
+
if (event.defaultPrevented)
|
|
84
|
+
return;
|
|
85
|
+
const target = event.target;
|
|
86
|
+
if (!(target instanceof Element))
|
|
87
|
+
return;
|
|
88
|
+
const control = target.closest('a, button');
|
|
89
|
+
if (!(control instanceof HTMLElement))
|
|
90
|
+
return;
|
|
91
|
+
if (!this.contains(control))
|
|
92
|
+
return;
|
|
93
|
+
if (this.shadowRoot?.contains(control))
|
|
94
|
+
return;
|
|
95
|
+
store.dispatch(closeSign());
|
|
96
|
+
};
|
|
97
|
+
this.onSettings = (event) => {
|
|
98
|
+
const url = this.destination();
|
|
99
|
+
const proceed = this.dispatchEvent(new CustomEvent(pwaSettings, {
|
|
100
|
+
bubbles: true,
|
|
101
|
+
composed: true,
|
|
102
|
+
cancelable: true,
|
|
103
|
+
detail: { url }
|
|
104
|
+
}));
|
|
105
|
+
if (!proceed) {
|
|
106
|
+
event.preventDefault();
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
store.dispatch(closeSign());
|
|
110
|
+
if (url)
|
|
111
|
+
return;
|
|
112
|
+
event.preventDefault();
|
|
113
|
+
const settings = document.querySelector('user-settings');
|
|
114
|
+
if (settings instanceof HTMLElement)
|
|
115
|
+
settings.scrollIntoView({ block: 'nearest' });
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
connectedCallback() {
|
|
119
|
+
applyFirebaseConfig(this);
|
|
120
|
+
super.connectedCallback();
|
|
121
|
+
this.addEventListener('keydown', this.onKey);
|
|
122
|
+
this.addEventListener('click', this.onLightClick);
|
|
123
|
+
this.notice = verificationNotice();
|
|
124
|
+
this.stopNotice = onVerificationNotice(() => { this.notice = verificationNotice(); });
|
|
125
|
+
}
|
|
126
|
+
disconnectedCallback() {
|
|
127
|
+
this.removeEventListener('keydown', this.onKey);
|
|
128
|
+
this.removeEventListener('click', this.onLightClick);
|
|
129
|
+
this.stopNotice?.();
|
|
130
|
+
this.stopNotice = null;
|
|
131
|
+
super.disconnectedCallback();
|
|
35
132
|
}
|
|
36
133
|
stateChanged(state) {
|
|
134
|
+
const open = state.frontend.drawer;
|
|
37
135
|
this.name = state.backend.name;
|
|
38
|
-
this.
|
|
136
|
+
this.email = state.backend.email;
|
|
137
|
+
this.verified = Boolean(state.backend?.verified);
|
|
138
|
+
this.drawer = open;
|
|
39
139
|
this.user = state.frontend.login;
|
|
40
140
|
this.signup = state.frontend.registerOne;
|
|
141
|
+
const changed = this.sawOpen ? open !== this.wasOpen : open;
|
|
142
|
+
if (changed) {
|
|
143
|
+
emitElement(this, pwaDrawerToggleName, { open });
|
|
144
|
+
}
|
|
145
|
+
this.wasOpen = open;
|
|
146
|
+
this.sawOpen = true;
|
|
147
|
+
}
|
|
148
|
+
updated(changed) {
|
|
149
|
+
if (!changed.has('drawer'))
|
|
150
|
+
return;
|
|
151
|
+
if (this.drawer) {
|
|
152
|
+
const active = deepActive();
|
|
153
|
+
this.returnFocus = active && !this.contains(active) ? active : this.returnFocus;
|
|
154
|
+
this.shadowRoot?.querySelector('.close')?.focus();
|
|
155
|
+
void refreshEmailVerified(false);
|
|
156
|
+
return;
|
|
157
|
+
}
|
|
158
|
+
this.returnFocus?.focus();
|
|
159
|
+
this.returnFocus = null;
|
|
41
160
|
}
|
|
42
161
|
firstUpdated() {
|
|
43
162
|
this.shadowRoot.querySelector('.close').addEventListener('click', () => {
|
|
44
|
-
store.dispatch(
|
|
163
|
+
store.dispatch(closeSign());
|
|
45
164
|
});
|
|
46
|
-
this.shadowRoot.querySelector('.leave').addEventListener('click', () => {
|
|
165
|
+
this.shadowRoot.querySelector('.leave').addEventListener('click', async () => {
|
|
47
166
|
if (this.user) {
|
|
48
|
-
|
|
167
|
+
try {
|
|
168
|
+
await logOut();
|
|
169
|
+
}
|
|
170
|
+
catch {
|
|
171
|
+
return;
|
|
172
|
+
}
|
|
49
173
|
}
|
|
50
|
-
store.dispatch(
|
|
174
|
+
store.dispatch(closeSign());
|
|
51
175
|
});
|
|
52
176
|
const link = this.shadowRoot.querySelectorAll('a');
|
|
53
177
|
link.forEach(item => {
|
|
54
178
|
item.addEventListener('click', () => {
|
|
55
|
-
store.dispatch(
|
|
179
|
+
store.dispatch(closeSign());
|
|
56
180
|
});
|
|
57
181
|
});
|
|
58
182
|
}
|
|
@@ -65,86 +189,152 @@ let UserDrawer = class UserDrawer extends connect(store)(LitElement) {
|
|
|
65
189
|
linkStyle,
|
|
66
190
|
lineStyle,
|
|
67
191
|
listStyle,
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
192
|
+
tapStyle,
|
|
193
|
+
noticeStyle,
|
|
194
|
+
verifiedStyle,
|
|
195
|
+
css `
|
|
196
|
+
.exit > h3 {
|
|
197
|
+
display: flex;
|
|
198
|
+
align-items: center;
|
|
199
|
+
justify-content: center;
|
|
200
|
+
gap: 8px;
|
|
201
|
+
flex-wrap: wrap;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
.close:focus-visible,
|
|
205
|
+
.leave:focus-visible,
|
|
206
|
+
.settings:focus-visible {
|
|
207
|
+
outline: 2px solid var(--pwa_action_border_color, #214f34);
|
|
208
|
+
outline-offset: 2px;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
.leave {
|
|
212
|
+
min-height: var(--pwa_tap, 44px); /* Required - minimum tap target */
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
::slotted(a),
|
|
216
|
+
::slotted(button),
|
|
217
|
+
slot > a,
|
|
218
|
+
slot > button {
|
|
219
|
+
font: inherit;
|
|
220
|
+
font-size: 0.95rem;
|
|
221
|
+
font-weight: 600;
|
|
222
|
+
color: var(--pwa_label_text_color, #1c2430);
|
|
223
|
+
background: transparent;
|
|
224
|
+
text-decoration: none;
|
|
225
|
+
appearance: none;
|
|
226
|
+
padding: 12px 16px;
|
|
227
|
+
margin: 12px 16px;
|
|
228
|
+
border: 1px solid var(--pwa_line_color, #e3daca);
|
|
229
|
+
border-radius: 10px;
|
|
230
|
+
box-sizing: border-box;
|
|
231
|
+
text-align: center;
|
|
232
|
+
cursor: pointer;
|
|
233
|
+
display: block;
|
|
234
|
+
width: auto;
|
|
235
|
+
min-height: var(--pwa_tap, 44px); /* Required - minimum tap target */
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
::slotted(a[aria-current]),
|
|
239
|
+
::slotted(button[aria-current]) {
|
|
240
|
+
color: var(--pwa_nav_highlight_color, #1c2430);
|
|
241
|
+
background: var(--pwa_nav_on_background, #f3efe6);
|
|
242
|
+
}
|
|
83
243
|
`
|
|
84
244
|
];
|
|
85
245
|
}
|
|
86
246
|
;
|
|
87
247
|
render() {
|
|
88
|
-
return html `
|
|
89
|
-
|
|
90
|
-
<!-- Drawer Wrapper -->
|
|
91
|
-
<section
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
248
|
+
return html `
|
|
249
|
+
|
|
250
|
+
<!-- Drawer Wrapper -->
|
|
251
|
+
<section
|
|
252
|
+
part="panel"
|
|
253
|
+
role="dialog"
|
|
254
|
+
aria-modal="true"
|
|
255
|
+
aria-labelledby="pwa-drawer-title"
|
|
256
|
+
aria-hidden="${this.drawer ? 'false' : 'true'}"
|
|
257
|
+
?inert="${!this.drawer}"
|
|
258
|
+
class="userDrawer ${this.drawer ? 'out' : 'in'}">
|
|
259
|
+
|
|
260
|
+
<!-- Exit Button -->
|
|
261
|
+
<header class="exit" part="header">
|
|
262
|
+
<div></div>
|
|
263
|
+
<h3 id="pwa-drawer-title" part="title">
|
|
264
|
+
<span class="who">${this.user === false ? this.signup === this.subscribe ? `Login` : `Subscribe` : accountTitle(this.name, this.email)}</span>
|
|
265
|
+
${this.user ? this.verified ? verifiedMark : html `<span class="unverified" part="unverified">Not verified</span>` : ''}
|
|
266
|
+
</h3>
|
|
267
|
+
<button class="close" part="close" type="button" aria-label="Close">${close}</button>
|
|
268
|
+
</header>
|
|
269
|
+
|
|
270
|
+
<!-- Logged-out State -->
|
|
271
|
+
<div
|
|
272
|
+
class="spec ${this.drawer ? 'spec-out' : 'spec-in'}"
|
|
273
|
+
?on="${this.user === false}">
|
|
274
|
+
|
|
275
|
+
<div class= "wrapper">
|
|
276
|
+
<div class= "inner">
|
|
277
|
+
|
|
278
|
+
<!-- Log-in State -->
|
|
279
|
+
<form-login
|
|
280
|
+
source="drawer"
|
|
281
|
+
exportparts="email: login-email, password: login-password, submit: login-submit, switch: login-switch, forgot: login-forgot, status: login-status, reveal: login-reveal"
|
|
282
|
+
?inert="${this.signup !== this.subscribe}"
|
|
112
283
|
class="content ${this.signup ===
|
|
113
284
|
this.subscribe ?
|
|
114
285
|
'opened' :
|
|
115
|
-
'closed'} ">
|
|
116
|
-
</form-login>
|
|
117
|
-
|
|
118
|
-
<!-- Sign-up State -->
|
|
119
|
-
<form-signup
|
|
120
|
-
source="drawer"
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
286
|
+
'closed'} ">
|
|
287
|
+
</form-login>
|
|
288
|
+
|
|
289
|
+
<!-- Sign-up State -->
|
|
290
|
+
<form-signup
|
|
291
|
+
source="drawer"
|
|
292
|
+
exportparts="email: signup-email, password: signup-password, submit: signup-submit, switch: signup-switch, status: signup-status, reveal: signup-reveal, notice: signup-notice"
|
|
293
|
+
?inert="${this.signup === this.subscribe}"
|
|
294
|
+
class="content ${!this.signup === this.subscribe ? 'opened' : 'closed'} ">
|
|
295
|
+
</form-signup>
|
|
296
|
+
|
|
297
|
+
</div>
|
|
298
|
+
</div>
|
|
299
|
+
|
|
300
|
+
</div>
|
|
301
|
+
|
|
302
|
+
<!-- Logged-in State -->
|
|
303
|
+
<div
|
|
304
|
+
class="spec setLog"
|
|
305
|
+
?on="${this.user === true}">
|
|
306
|
+
|
|
307
|
+
<!-- Required - Jack's markers. A host link replaces the fallback. -->
|
|
308
|
+
<slot name="before"><a href="/settings">slotted - before</a></slot>
|
|
309
|
+
|
|
310
|
+
${this.settingsControl()}
|
|
311
|
+
|
|
312
|
+
<slot><a href="/settings">slotted - default</a></slot>
|
|
313
|
+
|
|
314
|
+
${this.user && this.notice && !this.verified ? html `
|
|
315
|
+
<p class="notice" part="notice" role="status" aria-live="polite">Check your inbox for the verification email. You can still sign in.</p>
|
|
316
|
+
` : ''}
|
|
317
|
+
|
|
318
|
+
${this.user ? html `<email-verify exportparts="notice: verify-notice, status: verify-status, submit: verify-submit, verified: email-verified, unverified"></email-verify>` : ''}
|
|
319
|
+
|
|
320
|
+
<button class="leave" part="logout" type="button" aria-label="Log out">Log out</button>
|
|
321
|
+
|
|
322
|
+
</div>
|
|
323
|
+
|
|
324
|
+
</section>
|
|
325
|
+
|
|
146
326
|
`;
|
|
147
327
|
}
|
|
328
|
+
destination() {
|
|
329
|
+
return (this.url || '').trim();
|
|
330
|
+
}
|
|
331
|
+
settingsControl() {
|
|
332
|
+
const url = this.destination();
|
|
333
|
+
if (url) {
|
|
334
|
+
return html `<a href="${url}" part="settings" @click="${this.onSettings}">Settings</a>`;
|
|
335
|
+
}
|
|
336
|
+
return html `<button type="button" class="settings" part="settings" @click="${this.onSettings}">Settings</button>`;
|
|
337
|
+
}
|
|
148
338
|
};
|
|
149
339
|
__decorate([
|
|
150
340
|
property({ type: String, reflect: true }),
|
|
@@ -162,6 +352,18 @@ __decorate([
|
|
|
162
352
|
state(),
|
|
163
353
|
__metadata("design:type", Object)
|
|
164
354
|
], UserDrawer.prototype, "name", void 0);
|
|
355
|
+
__decorate([
|
|
356
|
+
state(),
|
|
357
|
+
__metadata("design:type", Object)
|
|
358
|
+
], UserDrawer.prototype, "email", void 0);
|
|
359
|
+
__decorate([
|
|
360
|
+
state(),
|
|
361
|
+
__metadata("design:type", Object)
|
|
362
|
+
], UserDrawer.prototype, "verified", void 0);
|
|
363
|
+
__decorate([
|
|
364
|
+
state(),
|
|
365
|
+
__metadata("design:type", Object)
|
|
366
|
+
], UserDrawer.prototype, "notice", void 0);
|
|
165
367
|
__decorate([
|
|
166
368
|
state(),
|
|
167
369
|
__metadata("design:type", Object)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"drawer.js","sourceRoot":"","sources":["../../../typescript/webcomponents/drawer/drawer.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,GAAG,EAAkB,IAAI,EAAE,UAAU,
|
|
1
|
+
{"version":3,"file":"drawer.js","sourceRoot":"","sources":["../../../typescript/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AE;;0CAA2B;AAClB;IAAhB,KAAK,EAAE;;wCAA8B;AACrB;IAAhB,KAAK,EAAE;;0CAA8B;AAhB3B,UAAU;IADtB,aAAa,CAAC,aAAa,CAAC;;GAChB,UAAU,CA0TtB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"keys.d.ts","sourceRoot":"","sources":["../../../typescript/webcomponents/drawer/keys.ts"],"names":[],"mappings":"AACA,wBAAgB,QAAQ,CAAC,EAAE,EAAE,WAAW,GAAG,OAAO,CAkCjD;AAGD,wBAAgB,SAAS,CAAC,IAAI,EAAE,WAAW,GAAG,WAAW,EAAE,CAyB1D;AAGD,wBAAgB,UAAU,IAAI,WAAW,GAAG,IAAI,CAU/C"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
export function isHidden(el) {
|
|
2
|
+
let current = el;
|
|
3
|
+
while (current) {
|
|
4
|
+
if (current instanceof HTMLElement) {
|
|
5
|
+
if (current.classList.contains('closed'))
|
|
6
|
+
return true;
|
|
7
|
+
if (current.classList.contains('spec') && !current.hasAttribute('on'))
|
|
8
|
+
return true;
|
|
9
|
+
}
|
|
10
|
+
if (current instanceof Element && current.assignedSlot && current.assignedSlot !== current) {
|
|
11
|
+
current = current.assignedSlot;
|
|
12
|
+
continue;
|
|
13
|
+
}
|
|
14
|
+
if (current.parentElement) {
|
|
15
|
+
current = current.parentElement;
|
|
16
|
+
continue;
|
|
17
|
+
}
|
|
18
|
+
const root = current.getRootNode();
|
|
19
|
+
if (root instanceof ShadowRoot) {
|
|
20
|
+
current = root.host;
|
|
21
|
+
continue;
|
|
22
|
+
}
|
|
23
|
+
break;
|
|
24
|
+
}
|
|
25
|
+
return false;
|
|
26
|
+
}
|
|
27
|
+
export function focusable(host) {
|
|
28
|
+
const found = [];
|
|
29
|
+
const selector = 'button, a[href], input, select, textarea';
|
|
30
|
+
const walk = (root) => {
|
|
31
|
+
root.querySelectorAll(selector).forEach((el) => {
|
|
32
|
+
if (el.hasAttribute('disabled'))
|
|
33
|
+
return;
|
|
34
|
+
if (el.tabIndex < 0)
|
|
35
|
+
return;
|
|
36
|
+
if (isHidden(el))
|
|
37
|
+
return;
|
|
38
|
+
found.push(el);
|
|
39
|
+
});
|
|
40
|
+
root.querySelectorAll('*').forEach((el) => {
|
|
41
|
+
if (el.shadowRoot)
|
|
42
|
+
walk(el.shadowRoot);
|
|
43
|
+
});
|
|
44
|
+
};
|
|
45
|
+
if (host.shadowRoot)
|
|
46
|
+
walk(host.shadowRoot);
|
|
47
|
+
walk(host);
|
|
48
|
+
return found.filter((el, index) => found.indexOf(el) === index);
|
|
49
|
+
}
|
|
50
|
+
export function deepActive() {
|
|
51
|
+
let node = document.activeElement;
|
|
52
|
+
while (node?.shadowRoot?.activeElement instanceof HTMLElement) {
|
|
53
|
+
node = node.shadowRoot.activeElement;
|
|
54
|
+
}
|
|
55
|
+
return node;
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=keys.js.map
|