pwa-auth 3.4.9 → 3.6.0
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 +540 -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/google.d.ts +9 -0
- package/base/firebase/google.d.ts.map +1 -0
- package/base/firebase/google.js +56 -0
- package/base/firebase/google.js.map +1 -0
- package/base/firebase/interface.d.ts +7 -1
- package/base/firebase/interface.d.ts.map +1 -0
- package/base/firebase/interface.js +101 -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 +35 -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 +3 -0
- package/base/webcomponents/css/animation.d.ts.map +1 -0
- package/base/webcomponents/css/animation.js +145 -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 +53 -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 +22 -7
- package/base/webcomponents/drawer/drawer.d.ts.map +1 -0
- package/base/webcomponents/drawer/drawer.js +300 -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 +108 -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/google-button.d.ts +3 -0
- package/base/webcomponents/form/google-button.d.ts.map +1 -0
- package/base/webcomponents/form/google-button.js +23 -0
- package/base/webcomponents/form/google-button.js.map +1 -0
- 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 +15 -0
- package/base/webcomponents/form/login.d.ts.map +1 -0
- package/base/webcomponents/form/login.js +261 -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 +13 -0
- package/base/webcomponents/form/signup.d.ts.map +1 -0
- package/base/webcomponents/form/signup.js +241 -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 +3 -2
- package/base/webcomponents/login/css/auth.d.ts.map +1 -0
- package/base/webcomponents/login/css/auth.js +32 -37
- 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 +11 -6
- package/base/webcomponents/login/page.d.ts.map +1 -0
- package/base/webcomponents/login/page.js +103 -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/docs/sliders.md +66 -0
- package/firebase.md +125 -0
- package/intro.md +19 -0
- package/license +21 -21
- package/package.json +117 -71
- package/source/pwa-auth.js +1233 -469
- 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,15 +1,38 @@
|
|
|
1
1
|
import { TemplateResult } from 'lit';
|
|
2
|
-
import { LazyLoader } from '../../lazyLoader';
|
|
2
|
+
import { LazyLoader } from '../../lazyLoader.js';
|
|
3
3
|
export declare class EmailReset extends LazyLoader {
|
|
4
4
|
private userEmail;
|
|
5
|
+
private status;
|
|
6
|
+
private tone;
|
|
7
|
+
private invalid;
|
|
8
|
+
private busy;
|
|
9
|
+
private cooldown;
|
|
10
|
+
private touched;
|
|
11
|
+
private timer;
|
|
12
|
+
private stopDraft;
|
|
5
13
|
constructor();
|
|
6
|
-
|
|
14
|
+
static styles: import("lit").CSSResult[];
|
|
15
|
+
connectedCallback(): void;
|
|
16
|
+
disconnectedCallback(): void;
|
|
17
|
+
protected updated(): void;
|
|
18
|
+
private prefill;
|
|
19
|
+
private paintEmail;
|
|
7
20
|
private handleEmail;
|
|
21
|
+
private buttonLabel;
|
|
8
22
|
protected render(): TemplateResult;
|
|
9
|
-
private
|
|
23
|
+
private resetPassword;
|
|
24
|
+
private showSent;
|
|
25
|
+
private showError;
|
|
26
|
+
private showFirebase;
|
|
27
|
+
private focusAfter;
|
|
28
|
+
private focusEmail;
|
|
29
|
+
private focusStatus;
|
|
30
|
+
private armCooldown;
|
|
31
|
+
private backToSignIn;
|
|
10
32
|
}
|
|
11
33
|
declare global {
|
|
12
34
|
interface HTMLElementTagNameMap {
|
|
13
35
|
'email-reset': EmailReset;
|
|
14
36
|
}
|
|
15
37
|
}
|
|
38
|
+
//# sourceMappingURL=forgot.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"forgot.d.ts","sourceRoot":"","sources":["../../../typescript/webcomponents/form/forgot.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,cAAc,EAAO,MAAM,KAAK,CAAC;AAEhD,OAAO,EAAE,UAAU,EAAE,MAAsB,qBAAqB,CAAC;AAyCjE,qBACa,UAAW,SAAQ,UAAU;IAE/B,OAAO,CAAC,SAAS,CAAc;IAC/B,OAAO,CAAC,MAAM,CAAiB;IAC/B,OAAO,CAAC,IAAI,CAAmB;IAC/B,OAAO,CAAC,OAAO,CAAoB;IACnC,OAAO,CAAC,IAAI,CAAuB;IACnC,OAAO,CAAC,QAAQ,CAAc;IAEvC,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,KAAK,CAAK;IAClB,OAAO,CAAC,SAAS,CAA6B;;IAI9C,MAAM,CAAC,MAAM,4BAgDX;IAEO,iBAAiB,IAAI,IAAI;IAMzB,oBAAoB,IAAI,IAAI;IAQrC,SAAS,CAAC,OAAO,IAAI,IAAI;IAKzB,OAAO,CAAC,OAAO;IAcf,OAAO,CAAC,UAAU;IAYlB,OAAO,CAAC,WAAW;IAOnB,OAAO,CAAC,WAAW;IAMnB,SAAS,CAAC,MAAM,IAAI,cAAc;IAwDlC,OAAO,CAAC,aAAa,CAgCpB;IAGD,OAAO,CAAC,QAAQ;IAahB,OAAO,CAAC,SAAS;IAWjB,OAAO,CAAC,YAAY;IAapB,OAAO,CAAC,UAAU;IAKlB,OAAO,CAAC,UAAU;IAKlB,OAAO,CAAC,WAAW;IAKnB,OAAO,CAAC,WAAW;IAoBnB,OAAO,CAAC,YAAY,CAqBnB;CAEF;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,aAAa,EAAE,UAAU,CAAC;KAC3B;CACF"}
|
|
@@ -7,57 +7,324 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
8
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
9
|
};
|
|
10
|
-
import { html, } from 'lit';
|
|
10
|
+
import { html, css } from 'lit';
|
|
11
11
|
import { customElement, state } from "lit/decorators.js";
|
|
12
|
-
import { LazyLoader } from '../../lazyLoader';
|
|
13
|
-
import { auth } from '../../firebase/authentication';
|
|
12
|
+
import { LazyLoader } from '../../lazyLoader.js';
|
|
13
|
+
import { auth } from '../../firebase/authentication.js';
|
|
14
14
|
import { sendPasswordResetEmail } from 'firebase/auth';
|
|
15
|
+
import { pwaAuthError, pwaResetSent } from '../../events/names.js';
|
|
16
|
+
import { emitWindow, toAuthError } from '../../events/emit.js';
|
|
17
|
+
import { userMessage } from '../../firebase/message.js';
|
|
18
|
+
import { openDrawer } from '../../api/drawer.js';
|
|
19
|
+
import store from '../../store.js';
|
|
20
|
+
import { universalToggle } from '../../redux/frontend.js';
|
|
21
|
+
import { draftedEmail, onDraftEmail } from './draft.js';
|
|
22
|
+
import { labelStyle } from './css/label.js';
|
|
23
|
+
import { inputStyle } from './css/input.js';
|
|
24
|
+
import { buttonStyle } from './css/button.js';
|
|
25
|
+
import { toggleStyle } from './css/toggle.js';
|
|
26
|
+
const resetWait = 45;
|
|
27
|
+
const sentMessage = 'If an account uses that email, a reset link is on its way.';
|
|
28
|
+
function emailProblem(value) {
|
|
29
|
+
if (value.length < 4) {
|
|
30
|
+
return { code: 'pwa/missing-email', message: 'Enter an email address.' };
|
|
31
|
+
}
|
|
32
|
+
if (!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(value)) {
|
|
33
|
+
return { code: 'pwa/invalid-email', message: 'Enter a valid email address.' };
|
|
34
|
+
}
|
|
35
|
+
return null;
|
|
36
|
+
}
|
|
37
|
+
function missingAccount(error) {
|
|
38
|
+
return toAuthError(error).code === 'auth/user-not-found';
|
|
39
|
+
}
|
|
15
40
|
let EmailReset = class EmailReset extends LazyLoader {
|
|
16
41
|
constructor() {
|
|
17
42
|
super();
|
|
18
43
|
this.userEmail = '';
|
|
19
|
-
this.
|
|
20
|
-
|
|
21
|
-
|
|
44
|
+
this.status = '';
|
|
45
|
+
this.tone = '';
|
|
46
|
+
this.invalid = false;
|
|
47
|
+
this.busy = false;
|
|
48
|
+
this.cooldown = 0;
|
|
49
|
+
this.touched = false;
|
|
50
|
+
this.timer = 0;
|
|
51
|
+
this.stopDraft = null;
|
|
52
|
+
this.resetPassword = async (event) => {
|
|
53
|
+
event.preventDefault();
|
|
54
|
+
if (this.busy || this.cooldown > 0)
|
|
55
|
+
return;
|
|
56
|
+
const input = this.renderRoot.querySelector('.email');
|
|
57
|
+
this.userEmail = (input ? input.value : this.userEmail).trim();
|
|
58
|
+
if (input && input.value !== this.userEmail)
|
|
59
|
+
input.value = this.userEmail;
|
|
60
|
+
const problem = emailProblem(this.userEmail);
|
|
61
|
+
if (problem) {
|
|
62
|
+
this.showError(problem, 'email');
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
this.busy = true;
|
|
66
|
+
this.tone = '';
|
|
67
|
+
this.status = '';
|
|
68
|
+
try {
|
|
69
|
+
await sendPasswordResetEmail(auth, this.userEmail);
|
|
70
|
+
this.showSent();
|
|
71
|
+
}
|
|
72
|
+
catch (error) {
|
|
73
|
+
if (missingAccount(error))
|
|
74
|
+
this.showSent();
|
|
75
|
+
else
|
|
76
|
+
this.showFirebase(error);
|
|
77
|
+
}
|
|
78
|
+
finally {
|
|
79
|
+
this.busy = false;
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
this.backToSignIn = () => {
|
|
83
|
+
const drawer = document.querySelector('user-drawer');
|
|
84
|
+
if (drawer) {
|
|
85
|
+
const subscribe = drawer.hasAttribute('subscribe');
|
|
86
|
+
const signup = Boolean(store.getState().frontend?.registerOne);
|
|
87
|
+
if (signup !== subscribe)
|
|
88
|
+
store.dispatch(universalToggle('drawer'));
|
|
89
|
+
openDrawer();
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
const page = document.querySelector('user-login');
|
|
93
|
+
if (!page)
|
|
94
|
+
return;
|
|
95
|
+
const subscribe = page.hasAttribute('subscribe');
|
|
96
|
+
const signup = Boolean(store.getState().frontend?.registerTwo);
|
|
97
|
+
if (signup !== subscribe)
|
|
98
|
+
store.dispatch(universalToggle('page'));
|
|
99
|
+
page.scrollIntoView({ block: 'nearest' });
|
|
22
100
|
};
|
|
23
101
|
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
102
|
+
static { this.styles = [
|
|
103
|
+
labelStyle,
|
|
104
|
+
inputStyle,
|
|
105
|
+
buttonStyle,
|
|
106
|
+
toggleStyle,
|
|
107
|
+
css `
|
|
108
|
+
:host { display: block; }
|
|
109
|
+
|
|
110
|
+
/* Required - live region stays in the tree. Idle layout stays put. */
|
|
111
|
+
.status {
|
|
112
|
+
margin: 0 16px 8px;
|
|
113
|
+
color: var(--pwa_label_text_color, #1c2430);
|
|
114
|
+
font-size: 0.95rem;
|
|
115
|
+
line-height: 1.4;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.status:not(.on) {
|
|
119
|
+
position: absolute;
|
|
120
|
+
width: 1px;
|
|
121
|
+
height: 1px;
|
|
122
|
+
padding: 0;
|
|
123
|
+
margin: -1px;
|
|
124
|
+
overflow: hidden;
|
|
125
|
+
clip: rect(0, 0, 0, 0);
|
|
126
|
+
white-space: nowrap;
|
|
127
|
+
border: 0;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.status.error { color: var(--pwa_close_color, #9a3b32); }
|
|
131
|
+
|
|
132
|
+
.status:focus { outline: 0; }
|
|
133
|
+
|
|
134
|
+
.status:focus-visible {
|
|
135
|
+
outline: 2px solid var(--pwa_action_border_color, #214f34);
|
|
136
|
+
outline-offset: 2px;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
button.reset:disabled {
|
|
140
|
+
cursor: default;
|
|
141
|
+
opacity: 0.72;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
button.new {
|
|
145
|
+
display: block;
|
|
146
|
+
width: 100%;
|
|
147
|
+
box-sizing: border-box;
|
|
148
|
+
}
|
|
149
|
+
`
|
|
150
|
+
]; }
|
|
151
|
+
connectedCallback() {
|
|
152
|
+
super.connectedCallback();
|
|
153
|
+
this.stopDraft = onDraftEmail(() => { this.prefill(); });
|
|
154
|
+
this.prefill();
|
|
155
|
+
}
|
|
156
|
+
disconnectedCallback() {
|
|
157
|
+
window.clearInterval(this.timer);
|
|
158
|
+
this.timer = 0;
|
|
159
|
+
this.stopDraft?.();
|
|
160
|
+
this.stopDraft = null;
|
|
161
|
+
super.disconnectedCallback();
|
|
162
|
+
}
|
|
163
|
+
updated() {
|
|
164
|
+
this.paintEmail();
|
|
165
|
+
}
|
|
166
|
+
prefill() {
|
|
167
|
+
if (this.touched)
|
|
168
|
+
return;
|
|
169
|
+
const draft = draftedEmail();
|
|
170
|
+
if (!draft || draft === this.userEmail)
|
|
171
|
+
return;
|
|
172
|
+
this.userEmail = draft;
|
|
173
|
+
this.paintEmail();
|
|
174
|
+
}
|
|
175
|
+
paintEmail() {
|
|
176
|
+
if (this.touched)
|
|
177
|
+
return;
|
|
178
|
+
const input = this.renderRoot.querySelector('.email');
|
|
179
|
+
if (!input || input.value || !this.userEmail)
|
|
180
|
+
return;
|
|
181
|
+
input.value = this.userEmail;
|
|
28
182
|
}
|
|
29
183
|
handleEmail(event) {
|
|
30
184
|
const input = event.target;
|
|
185
|
+
this.touched = true;
|
|
31
186
|
this.userEmail = input.value;
|
|
187
|
+
if (this.invalid)
|
|
188
|
+
this.invalid = false;
|
|
189
|
+
}
|
|
190
|
+
buttonLabel() {
|
|
191
|
+
if (this.busy)
|
|
192
|
+
return 'Sending…';
|
|
193
|
+
if (this.cooldown > 0)
|
|
194
|
+
return `Send again in ${this.cooldown}s`;
|
|
195
|
+
return 'Send reset email';
|
|
32
196
|
}
|
|
33
197
|
render() {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
198
|
+
const described = 'pwa-reset-status';
|
|
199
|
+
return html `
|
|
200
|
+
|
|
201
|
+
<form
|
|
202
|
+
class="resetPass"
|
|
203
|
+
novalidate
|
|
204
|
+
aria-busy="${this.busy ? 'true' : 'false'}"
|
|
205
|
+
@submit="${this.resetPassword}">
|
|
206
|
+
|
|
207
|
+
<label for="pwa-reset-email">Email
|
|
208
|
+
|
|
209
|
+
<input
|
|
210
|
+
id = "pwa-reset-email"
|
|
211
|
+
class = "email"
|
|
212
|
+
part = "email"
|
|
213
|
+
name = "email"
|
|
214
|
+
type = "email"
|
|
215
|
+
autocomplete = "email"
|
|
216
|
+
required
|
|
217
|
+
aria-invalid = "${this.invalid ? 'true' : 'false'}"
|
|
218
|
+
aria-describedby = "${described}"
|
|
219
|
+
@input = "${this.handleEmail}"
|
|
220
|
+
@change = "${this.handleEmail}">
|
|
221
|
+
|
|
222
|
+
</label>
|
|
223
|
+
|
|
224
|
+
<p
|
|
225
|
+
id = "pwa-reset-status"
|
|
226
|
+
part = "status"
|
|
227
|
+
class = "status ${this.status ? 'on' : ''} ${this.tone}"
|
|
228
|
+
role = "status"
|
|
229
|
+
aria-live = "polite"
|
|
230
|
+
aria-atomic = "true"
|
|
231
|
+
tabindex = "-1">${this.status}</p>
|
|
232
|
+
|
|
233
|
+
<button
|
|
234
|
+
type = "submit"
|
|
235
|
+
part = "submit"
|
|
236
|
+
class = "reset action-button"
|
|
237
|
+
aria-describedby = "${described}"
|
|
238
|
+
aria-busy = "${this.busy ? 'true' : 'false'}"
|
|
239
|
+
?disabled = "${this.busy || this.cooldown > 0}">${this.buttonLabel()}</button>
|
|
240
|
+
|
|
241
|
+
<button
|
|
242
|
+
type = "button"
|
|
243
|
+
part = "back"
|
|
244
|
+
class = "new"
|
|
245
|
+
@click = "${this.backToSignIn}">back to sign in</button>
|
|
246
|
+
|
|
247
|
+
</form>
|
|
248
|
+
|
|
54
249
|
`;
|
|
55
250
|
}
|
|
251
|
+
showSent() {
|
|
252
|
+
this.tone = '';
|
|
253
|
+
this.status = sentMessage;
|
|
254
|
+
this.invalid = false;
|
|
255
|
+
this.cooldown = resetWait;
|
|
256
|
+
this.armCooldown();
|
|
257
|
+
emitWindow(pwaResetSent, { email: this.userEmail });
|
|
258
|
+
void this.updateComplete.then(() => { this.focusStatus(); });
|
|
259
|
+
}
|
|
260
|
+
showError(detail, focus) {
|
|
261
|
+
this.tone = 'error';
|
|
262
|
+
this.status = userMessage(detail);
|
|
263
|
+
this.invalid = focus === 'email';
|
|
264
|
+
emitWindow(pwaAuthError, detail);
|
|
265
|
+
void this.updateComplete.then(() => { this.focusAfter(focus); });
|
|
266
|
+
}
|
|
267
|
+
showFirebase(error) {
|
|
268
|
+
const detail = toAuthError(error);
|
|
269
|
+
this.tone = 'error';
|
|
270
|
+
this.status = userMessage(error);
|
|
271
|
+
this.invalid = detail.code === 'auth/invalid-email';
|
|
272
|
+
emitWindow(pwaAuthError, detail);
|
|
273
|
+
void this.updateComplete.then(() => {
|
|
274
|
+
this.focusAfter(this.invalid ? 'email' : 'status');
|
|
275
|
+
});
|
|
276
|
+
}
|
|
277
|
+
focusAfter(focus) {
|
|
278
|
+
if (focus === 'email')
|
|
279
|
+
this.focusEmail();
|
|
280
|
+
else
|
|
281
|
+
this.focusStatus();
|
|
282
|
+
}
|
|
283
|
+
focusEmail() {
|
|
284
|
+
const input = this.renderRoot.querySelector('.email');
|
|
285
|
+
input?.focus();
|
|
286
|
+
}
|
|
287
|
+
focusStatus() {
|
|
288
|
+
const status = this.renderRoot.querySelector('#pwa-reset-status');
|
|
289
|
+
status?.focus();
|
|
290
|
+
}
|
|
291
|
+
armCooldown() {
|
|
292
|
+
window.clearInterval(this.timer);
|
|
293
|
+
this.timer = window.setInterval(() => {
|
|
294
|
+
if (this.cooldown <= 1) {
|
|
295
|
+
this.cooldown = 0;
|
|
296
|
+
window.clearInterval(this.timer);
|
|
297
|
+
this.timer = 0;
|
|
298
|
+
return;
|
|
299
|
+
}
|
|
300
|
+
this.cooldown -= 1;
|
|
301
|
+
}, 1000);
|
|
302
|
+
}
|
|
56
303
|
};
|
|
57
304
|
__decorate([
|
|
58
305
|
state(),
|
|
59
306
|
__metadata("design:type", String)
|
|
60
307
|
], EmailReset.prototype, "userEmail", void 0);
|
|
308
|
+
__decorate([
|
|
309
|
+
state(),
|
|
310
|
+
__metadata("design:type", String)
|
|
311
|
+
], EmailReset.prototype, "status", void 0);
|
|
312
|
+
__decorate([
|
|
313
|
+
state(),
|
|
314
|
+
__metadata("design:type", String)
|
|
315
|
+
], EmailReset.prototype, "tone", void 0);
|
|
316
|
+
__decorate([
|
|
317
|
+
state(),
|
|
318
|
+
__metadata("design:type", Boolean)
|
|
319
|
+
], EmailReset.prototype, "invalid", void 0);
|
|
320
|
+
__decorate([
|
|
321
|
+
state(),
|
|
322
|
+
__metadata("design:type", Boolean)
|
|
323
|
+
], EmailReset.prototype, "busy", void 0);
|
|
324
|
+
__decorate([
|
|
325
|
+
state(),
|
|
326
|
+
__metadata("design:type", Number)
|
|
327
|
+
], EmailReset.prototype, "cooldown", void 0);
|
|
61
328
|
EmailReset = __decorate([
|
|
62
329
|
customElement('email-reset'),
|
|
63
330
|
__metadata("design:paramtypes", [])
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"forgot.js","sourceRoot":"","sources":["../../../typescript/webcomponents/form/forgot.ts"],"names":[],"mappings":";;;;;;;;;
|
|
1
|
+
{"version":3,"file":"forgot.js","sourceRoot":"","sources":["../../../typescript/webcomponents/form/forgot.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,IAAI,EAAkB,GAAG,EAAE,MAAM,KAAK,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,MAAY,mBAAmB,CAAA;AAC9D,OAAO,EAAE,UAAU,EAAE,MAAsB,qBAAqB,CAAC;AACjE,OAAO,EAAE,IAAI,EAAE,MAA4B,kCAAkC,CAAC;AAC9E,OAAO,EAAE,sBAAsB,EAAE,MAAU,eAAe,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACnE,OAAO,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,cAAc,EAAE,MAAM,KAAK,CAAC;AAa3C,wBAAgB,YAAY,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,IAAI,GAAG,cAAc,CAY/E"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { html } from 'lit';
|
|
2
|
+
const googleMark = html `
|
|
3
|
+
<svg class="g" viewBox="0 0 48 48" aria-hidden="true">
|
|
4
|
+
<path fill="#EA4335" d="M24 9.5c3.54 0 6.71 1.22 9.21 3.6l6.85-6.85C35.9 2.38 30.47 0 24 0 14.62 0 6.51 5.38 2.56 13.22l7.98 6.19C12.43 13.72 17.74 9.5 24 9.5z"></path>
|
|
5
|
+
<path fill="#4285F4" d="M46.98 24.55c0-1.57-.15-3.09-.38-4.55H24v9.02h12.94c-.58 2.96-2.26 5.48-4.78 7.18l7.73 6c4.51-4.18 7.09-10.36 7.09-17.65z"></path>
|
|
6
|
+
<path fill="#FBBC05" d="M10.53 28.59c-.48-1.45-.76-2.99-.76-4.59s.27-3.14.76-4.59l-7.98-6.19C.92 16.46 0 20.12 0 24c0 3.88.92 7.54 2.56 10.78l7.97-6.19z"></path>
|
|
7
|
+
<path fill="#34A853" d="M24 48c6.48 0 11.93-2.13 15.89-5.81l-7.73-6c-2.15 1.45-4.92 2.3-8.16 2.3-6.26 0-11.57-4.22-13.47-9.91l-7.98 6.19C6.51 42.62 14.62 48 24 48z"></path>
|
|
8
|
+
</svg>
|
|
9
|
+
`;
|
|
10
|
+
export function googleButton(busy, onClick) {
|
|
11
|
+
return html `
|
|
12
|
+
<button
|
|
13
|
+
type="button"
|
|
14
|
+
part="google"
|
|
15
|
+
class="google"
|
|
16
|
+
?disabled="${busy}"
|
|
17
|
+
@click="${onClick}">
|
|
18
|
+
${googleMark}
|
|
19
|
+
Continue with Google
|
|
20
|
+
</button>
|
|
21
|
+
`;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=google-button.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"google-button.js","sourceRoot":"","sources":["../../../typescript/webcomponents/form/google-button.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAkB,MAAM,KAAK,CAAC;AAG3C,MAAM,UAAU,GAAG,IAAI,CAAA;;;;;;;CAOtB,CAAC;AAGF,MAAM,UAAU,YAAY,CAAC,IAAa,EAAE,OAAmB;IAC7D,OAAO,IAAI,CAAA;;;;;mBAKM,IAAI;gBACP,OAAO;QACf,UAAU;;;GAGf,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"letters.d.ts","sourceRoot":"","sources":["../../../typescript/webcomponents/form/letters.ts"],"names":[],"mappings":"AACA,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAa9D;AAGD,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAUhE"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export function lettersFor(name, email) {
|
|
2
|
+
const trimmed = name.trim();
|
|
3
|
+
if (trimmed) {
|
|
4
|
+
const parts = trimmed.split(/\s+/).slice(0, 2);
|
|
5
|
+
return parts.map((part) => part.charAt(0)).join('').toUpperCase();
|
|
6
|
+
}
|
|
7
|
+
const mail = email.trim();
|
|
8
|
+
if (!mail)
|
|
9
|
+
return '';
|
|
10
|
+
return mail.charAt(0).toUpperCase();
|
|
11
|
+
}
|
|
12
|
+
export function accountTitle(name, email) {
|
|
13
|
+
const trimmed = name.trim();
|
|
14
|
+
if (trimmed)
|
|
15
|
+
return trimmed;
|
|
16
|
+
const mail = email.trim();
|
|
17
|
+
if (mail)
|
|
18
|
+
return mail;
|
|
19
|
+
return 'Account';
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=letters.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"letters.js","sourceRoot":"","sources":["../../../typescript/webcomponents/form/letters.ts"],"names":[],"mappings":"AACA,MAAM,UAAU,UAAU,CAAC,IAAY,EAAE,KAAa;IAEpD,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC;IAE5B,IAAI,OAAO,EAAE,CAAC;QACZ,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QAC/C,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC;IACpE,CAAC;IAED,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;IAC1B,IAAI,CAAC,IAAI;QAAE,OAAO,EAAE,CAAC;IACrB,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;AAEtC,CAAC;AAGD,MAAM,UAAU,YAAY,CAAC,IAAY,EAAE,KAAa;IAEtD,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC;IAC5B,IAAI,OAAO;QAAE,OAAO,OAAO,CAAC;IAE5B,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;IAC1B,IAAI,IAAI;QAAE,OAAO,IAAI,CAAC;IAEtB,OAAO,SAAS,CAAC;AAEnB,CAAC"}
|
|
@@ -1,20 +1,35 @@
|
|
|
1
1
|
import { LitElement } from 'lit';
|
|
2
2
|
export declare class FormLogin extends LitElement {
|
|
3
3
|
source: string;
|
|
4
|
+
hideGoogle: boolean;
|
|
4
5
|
private email;
|
|
5
6
|
private password;
|
|
7
|
+
private status;
|
|
8
|
+
private tone;
|
|
9
|
+
private busy;
|
|
10
|
+
private resetBusy;
|
|
11
|
+
private showPassword;
|
|
6
12
|
constructor();
|
|
13
|
+
connectedCallback(): void;
|
|
14
|
+
protected updated(): void;
|
|
15
|
+
private adoptRedirect;
|
|
7
16
|
static get styles(): import("lit").CSSResult[];
|
|
8
17
|
protected render(): import("lit-html").TemplateResult<1>;
|
|
9
18
|
private change;
|
|
19
|
+
private google;
|
|
20
|
+
private show;
|
|
10
21
|
private handleEmail;
|
|
11
22
|
private handlePassword;
|
|
23
|
+
private readFields;
|
|
12
24
|
private _handleSubmit;
|
|
13
25
|
private login;
|
|
14
26
|
private signIn;
|
|
27
|
+
private forgot;
|
|
28
|
+
private sent;
|
|
15
29
|
}
|
|
16
30
|
declare global {
|
|
17
31
|
interface HTMLElementTagNameMap {
|
|
18
32
|
'form-login': FormLogin;
|
|
19
33
|
}
|
|
20
34
|
}
|
|
35
|
+
//# sourceMappingURL=login.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"login.d.ts","sourceRoot":"","sources":["../../../typescript/webcomponents/form/login.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,UAAU,EAEX,MAA8B,KAAK,CAAC;AAkCrC,qBACa,SAAU,SAAQ,UAAU;IAEN,MAAM,SAAW;IAGyB,UAAU,UAAS;IACrF,OAAO,CAAC,KAAK,CAAa;IAC1B,OAAO,CAAC,QAAQ,CAAU;IAC1B,OAAO,CAAC,MAAM,CAAY;IAC1B,OAAO,CAAC,IAAI,CAAc;IAC1B,OAAO,CAAC,IAAI,CAAiB;IAC7B,OAAO,CAAC,SAAS,CAAY;IAC7B,OAAO,CAAC,YAAY,CAAS;;IAI7B,iBAAiB,IAAI,IAAI;IAKlC,SAAS,CAAC,OAAO,IAAI,IAAI;IAIzB,OAAO,CAAC,aAAa;IAOrB,MAAM,KAAK,MAAM,8BAsBd;IAEH,SAAS,CAAC,MAAM;IAiGhB,OAAO,CAAC,MAAM;YAIA,MAAM;IAcpB,OAAO,CAAC,IAAI;IAOZ,OAAO,CAAC,WAAW;IAOnB,OAAO,CAAC,cAAc;IAMtB,OAAO,CAAC,UAAU;IASlB,OAAO,CAAC,aAAa;YAMP,KAAK;IAgBnB,OAAO,CAAC,MAAM,CAgBb;IAGD,OAAO,CAAC,MAAM,CA+Bb;IAED,OAAO,CAAC,IAAI;CAMb;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC3B,YAAY,EAAE,SAAS,CAAC;KAC3B;CACF"}
|