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.
Files changed (244) hide show
  1. package/LICENSES.txt +18 -23
  2. package/README.md +540 -326
  3. package/base/api/drawer.d.ts +4 -0
  4. package/base/api/drawer.d.ts.map +1 -0
  5. package/base/api/drawer.js +12 -0
  6. package/base/api/drawer.js.map +1 -0
  7. package/base/api/user.d.ts +4 -0
  8. package/base/api/user.d.ts.map +1 -0
  9. package/base/api/user.js +25 -0
  10. package/base/api/user.js.map +1 -0
  11. package/base/api/verify.d.ts +4 -0
  12. package/base/api/verify.d.ts.map +1 -0
  13. package/base/api/verify.js +113 -0
  14. package/base/api/verify.js.map +1 -0
  15. package/base/deprecated/email-changed.d.ts +5 -0
  16. package/base/deprecated/email-changed.d.ts.map +1 -0
  17. package/base/deprecated/email-changed.js +9 -0
  18. package/base/deprecated/email-changed.js.map +1 -0
  19. package/base/events/emit.d.ts +12 -0
  20. package/base/events/emit.d.ts.map +1 -0
  21. package/base/events/emit.js +30 -0
  22. package/base/events/emit.js.map +1 -0
  23. package/base/events/names.d.ts +31 -0
  24. package/base/events/names.d.ts.map +1 -0
  25. package/base/events/names.js +31 -0
  26. package/base/events/names.js.map +1 -0
  27. package/base/events/types.d.ts +71 -0
  28. package/base/events/types.d.ts.map +1 -0
  29. package/base/events/types.js +2 -0
  30. package/base/events/types.js.map +1 -0
  31. package/base/export/pwa-auth.d.ts +17 -7
  32. package/base/export/pwa-auth.d.ts.map +1 -0
  33. package/base/export/pwa-auth.js +13 -7
  34. package/base/export/pwa-auth.js.map +1 -1
  35. package/base/firebase/attribute.d.ts +2 -0
  36. package/base/firebase/attribute.d.ts.map +1 -0
  37. package/base/firebase/attribute.js +17 -0
  38. package/base/firebase/attribute.js.map +1 -0
  39. package/base/firebase/authentication.d.ts +21 -10
  40. package/base/firebase/authentication.d.ts.map +1 -0
  41. package/base/firebase/authentication.js +65 -8
  42. package/base/firebase/authentication.js.map +1 -1
  43. package/base/firebase/google.d.ts +9 -0
  44. package/base/firebase/google.d.ts.map +1 -0
  45. package/base/firebase/google.js +56 -0
  46. package/base/firebase/google.js.map +1 -0
  47. package/base/firebase/interface.d.ts +7 -1
  48. package/base/firebase/interface.d.ts.map +1 -0
  49. package/base/firebase/interface.js +101 -68
  50. package/base/firebase/interface.js.map +1 -1
  51. package/base/firebase/message.d.ts +2 -0
  52. package/base/firebase/message.d.ts.map +1 -0
  53. package/base/firebase/message.js +35 -0
  54. package/base/firebase/message.js.map +1 -0
  55. package/base/firebase/password.d.ts +11 -0
  56. package/base/firebase/password.d.ts.map +1 -0
  57. package/base/firebase/password.js +16 -0
  58. package/base/firebase/password.js.map +1 -0
  59. package/base/lazyLoader.d.ts +1 -0
  60. package/base/lazyLoader.d.ts.map +1 -0
  61. package/base/redux/backend.d.ts +1 -0
  62. package/base/redux/backend.d.ts.map +1 -0
  63. package/base/redux/backend.js +1 -1
  64. package/base/redux/backend.js.map +1 -1
  65. package/base/redux/frontend.d.ts +16 -1
  66. package/base/redux/frontend.d.ts.map +1 -0
  67. package/base/redux/frontend.js +6 -3
  68. package/base/redux/frontend.js.map +1 -1
  69. package/base/store.d.ts +1 -6
  70. package/base/store.d.ts.map +1 -0
  71. package/base/store.js +2 -4
  72. package/base/store.js.map +1 -1
  73. package/base/webcomponents/css/animation.d.ts +3 -0
  74. package/base/webcomponents/css/animation.d.ts.map +1 -0
  75. package/base/webcomponents/css/animation.js +145 -67
  76. package/base/webcomponents/css/animation.js.map +1 -1
  77. package/base/webcomponents/css/svg.d.ts +1 -2
  78. package/base/webcomponents/css/svg.d.ts.map +1 -0
  79. package/base/webcomponents/css/svg.js +2 -4
  80. package/base/webcomponents/css/svg.js.map +1 -1
  81. package/base/webcomponents/css/tap.d.ts +3 -0
  82. package/base/webcomponents/css/tap.d.ts.map +1 -0
  83. package/base/webcomponents/css/tap.js +9 -0
  84. package/base/webcomponents/css/tap.js.map +1 -0
  85. package/base/webcomponents/css/toggle.d.ts +1 -0
  86. package/base/webcomponents/css/toggle.d.ts.map +1 -0
  87. package/base/webcomponents/css/toggle.js +5 -5
  88. package/base/webcomponents/drawer/css/drawer.d.ts +1 -0
  89. package/base/webcomponents/drawer/css/drawer.d.ts.map +1 -0
  90. package/base/webcomponents/drawer/css/drawer.js +53 -74
  91. package/base/webcomponents/drawer/css/drawer.js.map +1 -1
  92. package/base/webcomponents/drawer/css/exit.d.ts +1 -0
  93. package/base/webcomponents/drawer/css/exit.d.ts.map +1 -0
  94. package/base/webcomponents/drawer/css/exit.js +58 -52
  95. package/base/webcomponents/drawer/css/exit.js.map +1 -1
  96. package/base/webcomponents/drawer/css/link.d.ts +1 -0
  97. package/base/webcomponents/drawer/css/link.d.ts.map +1 -0
  98. package/base/webcomponents/drawer/css/link.js +9 -10
  99. package/base/webcomponents/drawer/css/link.js.map +1 -1
  100. package/base/webcomponents/drawer/css/paragraph.d.ts +1 -0
  101. package/base/webcomponents/drawer/css/paragraph.d.ts.map +1 -0
  102. package/base/webcomponents/drawer/css/paragraph.js +37 -20
  103. package/base/webcomponents/drawer/css/paragraph.js.map +1 -1
  104. package/base/webcomponents/drawer/drawer.d.ts +22 -7
  105. package/base/webcomponents/drawer/drawer.d.ts.map +1 -0
  106. package/base/webcomponents/drawer/drawer.js +300 -90
  107. package/base/webcomponents/drawer/drawer.js.map +1 -1
  108. package/base/webcomponents/drawer/keys.d.ts +4 -0
  109. package/base/webcomponents/drawer/keys.d.ts.map +1 -0
  110. package/base/webcomponents/drawer/keys.js +57 -0
  111. package/base/webcomponents/drawer/keys.js.map +1 -0
  112. package/base/webcomponents/form/css/button.d.ts +1 -0
  113. package/base/webcomponents/form/css/button.d.ts.map +1 -0
  114. package/base/webcomponents/form/css/button.js +108 -51
  115. package/base/webcomponents/form/css/button.js.map +1 -1
  116. package/base/webcomponents/form/css/input.d.ts +1 -0
  117. package/base/webcomponents/form/css/input.d.ts.map +1 -0
  118. package/base/webcomponents/form/css/input.js +22 -21
  119. package/base/webcomponents/form/css/input.js.map +1 -1
  120. package/base/webcomponents/form/css/label.d.ts +1 -0
  121. package/base/webcomponents/form/css/label.d.ts.map +1 -0
  122. package/base/webcomponents/form/css/label.js +22 -21
  123. package/base/webcomponents/form/css/label.js.map +1 -1
  124. package/base/webcomponents/form/css/list.d.ts +1 -0
  125. package/base/webcomponents/form/css/list.d.ts.map +1 -0
  126. package/base/webcomponents/form/css/list.js +19 -19
  127. package/base/webcomponents/form/css/notice.d.ts +3 -0
  128. package/base/webcomponents/form/css/notice.d.ts.map +1 -0
  129. package/base/webcomponents/form/css/notice.js +20 -0
  130. package/base/webcomponents/form/css/notice.js.map +1 -0
  131. package/base/webcomponents/form/css/status.d.ts +4 -0
  132. package/base/webcomponents/form/css/status.d.ts.map +1 -0
  133. package/base/webcomponents/form/css/status.js +44 -0
  134. package/base/webcomponents/form/css/status.js.map +1 -0
  135. package/base/webcomponents/form/css/toggle.d.ts +1 -0
  136. package/base/webcomponents/form/css/toggle.d.ts.map +1 -0
  137. package/base/webcomponents/form/css/toggle.js +43 -17
  138. package/base/webcomponents/form/css/toggle.js.map +1 -1
  139. package/base/webcomponents/form/draft.d.ts +5 -0
  140. package/base/webcomponents/form/draft.d.ts.map +1 -0
  141. package/base/webcomponents/form/draft.js +22 -0
  142. package/base/webcomponents/form/draft.js.map +1 -0
  143. package/base/webcomponents/form/forgot.d.ts +26 -3
  144. package/base/webcomponents/form/forgot.d.ts.map +1 -0
  145. package/base/webcomponents/form/forgot.js +297 -30
  146. package/base/webcomponents/form/forgot.js.map +1 -1
  147. package/base/webcomponents/form/google-button.d.ts +3 -0
  148. package/base/webcomponents/form/google-button.d.ts.map +1 -0
  149. package/base/webcomponents/form/google-button.js +23 -0
  150. package/base/webcomponents/form/google-button.js.map +1 -0
  151. package/base/webcomponents/form/letters.d.ts +3 -0
  152. package/base/webcomponents/form/letters.d.ts.map +1 -0
  153. package/base/webcomponents/form/letters.js +21 -0
  154. package/base/webcomponents/form/letters.js.map +1 -0
  155. package/base/webcomponents/form/login.d.ts +15 -0
  156. package/base/webcomponents/form/login.d.ts.map +1 -0
  157. package/base/webcomponents/form/login.js +261 -89
  158. package/base/webcomponents/form/login.js.map +1 -1
  159. package/base/webcomponents/form/notice.d.ts +4 -0
  160. package/base/webcomponents/form/notice.d.ts.map +1 -0
  161. package/base/webcomponents/form/notice.js +14 -0
  162. package/base/webcomponents/form/notice.js.map +1 -0
  163. package/base/webcomponents/form/reveal.d.ts +3 -0
  164. package/base/webcomponents/form/reveal.d.ts.map +1 -0
  165. package/base/webcomponents/form/reveal.js +14 -0
  166. package/base/webcomponents/form/reveal.js.map +1 -0
  167. package/base/webcomponents/form/signup.d.ts +13 -0
  168. package/base/webcomponents/form/signup.d.ts.map +1 -0
  169. package/base/webcomponents/form/signup.js +241 -100
  170. package/base/webcomponents/form/signup.js.map +1 -1
  171. package/base/webcomponents/form/verified.d.ts +3 -0
  172. package/base/webcomponents/form/verified.d.ts.map +1 -0
  173. package/base/webcomponents/form/verified.js +45 -0
  174. package/base/webcomponents/form/verified.js.map +1 -0
  175. package/base/webcomponents/icon/css/icon.d.ts +1 -0
  176. package/base/webcomponents/icon/css/icon.d.ts.map +1 -0
  177. package/base/webcomponents/icon/css/icon.js +63 -49
  178. package/base/webcomponents/icon/css/icon.js.map +1 -1
  179. package/base/webcomponents/icon/icon.d.ts +6 -4
  180. package/base/webcomponents/icon/icon.d.ts.map +1 -0
  181. package/base/webcomponents/icon/icon.js +48 -27
  182. package/base/webcomponents/icon/icon.js.map +1 -1
  183. package/base/webcomponents/login/css/auth.d.ts +3 -2
  184. package/base/webcomponents/login/css/auth.d.ts.map +1 -0
  185. package/base/webcomponents/login/css/auth.js +32 -37
  186. package/base/webcomponents/login/css/auth.js.map +1 -1
  187. package/base/webcomponents/login/css/link.d.ts +1 -0
  188. package/base/webcomponents/login/css/link.d.ts.map +1 -0
  189. package/base/webcomponents/login/css/link.js +9 -10
  190. package/base/webcomponents/login/css/link.js.map +1 -1
  191. package/base/webcomponents/login/css/paragraph.d.ts +1 -0
  192. package/base/webcomponents/login/css/paragraph.d.ts.map +1 -0
  193. package/base/webcomponents/login/css/paragraph.js +8 -8
  194. package/base/webcomponents/login/page.d.ts +11 -6
  195. package/base/webcomponents/login/page.d.ts.map +1 -0
  196. package/base/webcomponents/login/page.js +103 -55
  197. package/base/webcomponents/login/page.js.map +1 -1
  198. package/base/webcomponents/settings/css/navigation.d.ts +1 -0
  199. package/base/webcomponents/settings/css/navigation.d.ts.map +1 -0
  200. package/base/webcomponents/settings/css/navigation.js +78 -68
  201. package/base/webcomponents/settings/css/navigation.js.map +1 -1
  202. package/base/webcomponents/settings/input/delete.d.ts +7 -6
  203. package/base/webcomponents/settings/input/delete.d.ts.map +1 -0
  204. package/base/webcomponents/settings/input/delete.js +135 -48
  205. package/base/webcomponents/settings/input/delete.js.map +1 -1
  206. package/base/webcomponents/settings/input/email.d.ts +7 -5
  207. package/base/webcomponents/settings/input/email.d.ts.map +1 -0
  208. package/base/webcomponents/settings/input/email.js +155 -50
  209. package/base/webcomponents/settings/input/email.js.map +1 -1
  210. package/base/webcomponents/settings/input/name.d.ts +8 -5
  211. package/base/webcomponents/settings/input/name.d.ts.map +1 -0
  212. package/base/webcomponents/settings/input/name.js +116 -53
  213. package/base/webcomponents/settings/input/name.js.map +1 -1
  214. package/base/webcomponents/settings/input/password.d.ts +8 -5
  215. package/base/webcomponents/settings/input/password.d.ts.map +1 -0
  216. package/base/webcomponents/settings/input/password.js +200 -103
  217. package/base/webcomponents/settings/input/password.js.map +1 -1
  218. package/base/webcomponents/settings/input/uploader.d.ts +8 -6
  219. package/base/webcomponents/settings/input/uploader.d.ts.map +1 -0
  220. package/base/webcomponents/settings/input/uploader.js +209 -170
  221. package/base/webcomponents/settings/input/uploader.js.map +1 -1
  222. package/base/webcomponents/settings/input/verify.d.ts +64 -0
  223. package/base/webcomponents/settings/input/verify.d.ts.map +1 -0
  224. package/base/webcomponents/settings/input/verify.js +272 -0
  225. package/base/webcomponents/settings/input/verify.js.map +1 -0
  226. package/base/webcomponents/settings/settings.d.ts +15 -10
  227. package/base/webcomponents/settings/settings.d.ts.map +1 -0
  228. package/base/webcomponents/settings/settings.js +226 -147
  229. package/base/webcomponents/settings/settings.js.map +1 -1
  230. package/docs/sliders.md +66 -0
  231. package/firebase.md +125 -0
  232. package/intro.md +19 -0
  233. package/license +21 -21
  234. package/package.json +117 -71
  235. package/source/pwa-auth.js +1233 -469
  236. package/source/pwa-styles.css +50 -68
  237. package/base/redux/drawer.d.ts +0 -17
  238. package/base/redux/drawer.js +0 -22
  239. package/base/redux/drawer.js.map +0 -1
  240. package/demonstration/index.html +0 -99
  241. package/demonstration/pwa-styles.css +0 -77
  242. package/demonstration/styles.css +0 -77
  243. package/notes.md +0 -11
  244. package/source/THIRD_PARTY_LICENSES.txt +0 -303
@@ -9,25 +9,99 @@ var __metadata = (this && this.__metadata) || function (k, v) {
9
9
  };
10
10
  import { html, LitElement, css } from 'lit';
11
11
  import { customElement, property, state } from 'lit/decorators.js';
12
- import { EmailAuthProvider, signInWithCredential } from 'firebase/auth';
13
- import { auth } from '../../firebase/authentication';
14
- import { buttonStyle } from './css/button';
15
- import { labelStyle } from './css/label';
16
- import { inputStyle } from './css/input';
17
- import { listStyle } from './css/list';
18
- import { toggleStyle } from './css/toggle';
19
- import store from '../../store';
20
- import { universalToggle } from '../../redux/frontend';
12
+ import { sendPasswordResetEmail, signInWithEmailAndPassword } from 'firebase/auth';
13
+ import { signInWithGoogle, takeGoogleNotice } from '../../firebase/google.js';
14
+ import { auth } from '../../firebase/authentication.js';
15
+ import { pwaAuthError, pwaLogin, pwaResetSent } from '../../events/names.js';
16
+ import { emitWindow, toAuthError, toPwaUser } from '../../events/emit.js';
17
+ import { userMessage } from '../../firebase/message.js';
18
+ import { buttonStyle } from './css/button.js';
19
+ import { labelStyle } from './css/label.js';
20
+ import { inputStyle } from './css/input.js';
21
+ import { listStyle } from './css/list.js';
22
+ import { toggleStyle } from './css/toggle.js';
23
+ import { statusStyle, liveStatus } from './css/status.js';
24
+ import { tapStyle } from '../css/tap.js';
25
+ import { revealControl } from './reveal.js';
26
+ import { googleButton } from './google-button.js';
27
+ import store from '../../store.js';
28
+ import { universalToggle } from '../../redux/frontend.js';
29
+ import { rememberEmail } from './draft.js';
30
+ const sentMessage = 'If an account uses that email, a reset link is on its way.';
21
31
  let FormLogin = class FormLogin extends LitElement {
22
32
  constructor() {
23
33
  super();
24
34
  this.source = '';
35
+ this.hideGoogle = false;
25
36
  this.email = '';
26
37
  this.password = '';
38
+ this.status = '';
39
+ this.tone = '';
40
+ this.busy = false;
41
+ this.resetBusy = false;
42
+ this.showPassword = false;
27
43
  this.signIn = async (email, password) => {
28
- const authCredential = EmailAuthProvider.credential(email, password);
29
- await signInWithCredential(auth, authCredential).catch((error) => { console.log(error); });
44
+ this.busy = true;
45
+ this.tone = '';
46
+ this.status = '';
47
+ try {
48
+ const signed = await signInWithEmailAndPassword(auth, email, password);
49
+ const person = toPwaUser(signed.user);
50
+ if (person)
51
+ emitWindow(pwaLogin, { user: person });
52
+ }
53
+ catch (error) {
54
+ this.show(toAuthError(error));
55
+ }
56
+ finally {
57
+ this.busy = false;
58
+ }
30
59
  };
60
+ this.forgot = async () => {
61
+ if (this.busy || this.resetBusy)
62
+ return;
63
+ this.readFields();
64
+ const email = this.email.trim();
65
+ if (email.length < 4) {
66
+ this.show({ code: 'pwa/missing-email', message: 'Enter an email address.' });
67
+ return;
68
+ }
69
+ if (!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(email)) {
70
+ this.show({ code: 'pwa/invalid-email', message: 'Enter a valid email address.' });
71
+ return;
72
+ }
73
+ this.resetBusy = true;
74
+ this.tone = '';
75
+ this.status = '';
76
+ try {
77
+ await sendPasswordResetEmail(auth, email);
78
+ this.sent(email);
79
+ }
80
+ catch (error) {
81
+ if (toAuthError(error).code === 'auth/user-not-found')
82
+ this.sent(email);
83
+ else
84
+ this.show(toAuthError(error));
85
+ }
86
+ finally {
87
+ this.resetBusy = false;
88
+ }
89
+ };
90
+ }
91
+ connectedCallback() {
92
+ super.connectedCallback();
93
+ this.adoptRedirect();
94
+ }
95
+ updated() {
96
+ this.adoptRedirect();
97
+ }
98
+ adoptRedirect() {
99
+ if (!this.classList.contains('opened'))
100
+ return;
101
+ const pending = takeGoogleNotice();
102
+ if (!pending)
103
+ return;
104
+ this.show(pending);
31
105
  }
32
106
  static get styles() {
33
107
  return [
@@ -36,116 +110,194 @@ let FormLogin = class FormLogin extends LitElement {
36
110
  inputStyle,
37
111
  buttonStyle,
38
112
  toggleStyle,
39
- css `
40
-
41
- :host {
42
- background-color: white;
43
- }
44
-
45
- .double {
46
- display: grid;
47
- grid-template-columns: 1fr auto;
48
- }
49
-
50
- form { display: grid; }
51
-
113
+ statusStyle,
114
+ tapStyle,
115
+ css `
116
+
117
+ :host {
118
+ background-color: var(--section_background_color, #fffdf8);
119
+ }
120
+
121
+ .double {
122
+ display: grid;
123
+ grid-template-columns: 1fr auto;
124
+ }
125
+
126
+ form { display: grid; }
127
+
52
128
  `
53
129
  ];
54
130
  }
55
131
  ;
56
132
  render() {
57
- return html `
58
-
59
- <!-- Log-in State -->
60
- <form
61
- @submit= ${this._handleSubmit}
62
- autocomplete= "on">
63
-
64
- <ul>
65
-
66
- <li>
67
-
68
- <label>Email
69
-
70
- <input
71
- id= "${this.source}-login-email"
72
- type= "email"
73
- @change= "${this.handleEmail}">
74
-
75
- </label>
76
-
77
- </li>
78
-
79
- <li>
80
-
81
- <label>Password
82
-
83
- <input
84
- id= "${this.source}-login-pass"
85
- type= "password"
86
- @change= "${this.handlePassword}">
87
-
88
- </label>
89
-
90
- </li>
91
-
92
- <li>
93
-
94
- <button
95
- class= "login action-button"
96
- @click= "${this.login}">Sign in</button>
97
-
98
- </li>
99
-
100
- <!-- Change State
101
- <li>
102
-
103
- <p class= "divider">Or</p>
104
-
105
-
106
-
107
- </li> -->
108
-
109
- </ul>
110
-
111
- <button
112
- class="new"
113
- @click="${this.change}">create a new account</button>
114
-
115
- </form>
116
-
133
+ const emailId = `${this.source}-login-email`;
134
+ const passId = `${this.source}-login-pass`;
135
+ const statusId = `${this.source || 'page'}-login-status`;
136
+ return html `
137
+
138
+ <!-- Log-in State -->
139
+ <form
140
+ @submit= ${this._handleSubmit}
141
+ autocomplete= "on"
142
+ aria-busy= "${this.busy || this.resetBusy ? 'true' : 'false'}"
143
+ novalidate>
144
+
145
+ <ul>
146
+
147
+ <li>
148
+
149
+ <label for="${emailId}">Email
150
+
151
+ <input
152
+ id= "${emailId}"
153
+ name= "email"
154
+ part= "email"
155
+ type= "email"
156
+ autocomplete= "username"
157
+ inputmode= "email"
158
+ autocapitalize= "off"
159
+ spellcheck= "false"
160
+ aria-invalid= "${this.tone === 'error' ? 'true' : 'false'}"
161
+ aria-describedby="${statusId}"
162
+ @input= "${this.handleEmail}"
163
+ @change= "${this.handleEmail}">
164
+
165
+ </label>
166
+
167
+ </li>
168
+
169
+ <li>
170
+
171
+ <label for="${passId}">Password
172
+
173
+ <span class="pair">
174
+
175
+ <input
176
+ id= "${passId}"
177
+ name= "password"
178
+ part= "password"
179
+ type= "${this.showPassword ? 'text' : 'password'}"
180
+ autocomplete= "current-password"
181
+ aria-invalid= "${this.tone === 'error' ? 'true' : 'false'}"
182
+ aria-describedby="${statusId}"
183
+ @input= "${this.handlePassword}"
184
+ @change= "${this.handlePassword}">
185
+
186
+ ${revealControl(this.showPassword, () => { this.showPassword = !this.showPassword; })}
187
+
188
+ </span>
189
+
190
+ </label>
191
+
192
+ </li>
193
+
194
+ <li>
195
+
196
+ ${liveStatus(statusId, this.status, this.tone)}
197
+
198
+ ${this.hideGoogle ? '' : googleButton(this.busy || this.resetBusy, () => { void this.google(); })}
199
+
200
+ <button
201
+ type= "submit"
202
+ part= "submit"
203
+ class= "login action-button"
204
+ aria-busy= "${this.busy ? 'true' : 'false'}"
205
+ ?disabled= "${this.busy || this.resetBusy}">${this.busy ? 'Signing in…' : 'Sign in'}</button>
206
+
207
+ </li>
208
+
209
+ </ul>
210
+
211
+ <button
212
+ type="button"
213
+ part="forgot"
214
+ class="new"
215
+ ?disabled="${this.busy || this.resetBusy}"
216
+ @click="${this.forgot}">${this.resetBusy ? 'Sending…' : 'Forgot password?'}</button>
217
+
218
+ <button
219
+ type="button"
220
+ part="switch"
221
+ class="new"
222
+ @click="${this.change}">create a new account</button>
223
+
224
+ </form>
225
+
117
226
  `;
118
227
  }
119
228
  change() {
120
229
  store.dispatch(universalToggle(this.source));
121
230
  }
231
+ async google() {
232
+ if (this.busy || this.resetBusy)
233
+ return;
234
+ this.busy = true;
235
+ this.tone = '';
236
+ this.status = '';
237
+ try {
238
+ await signInWithGoogle();
239
+ }
240
+ catch (error) {
241
+ this.show(toAuthError(error));
242
+ }
243
+ finally {
244
+ this.busy = false;
245
+ }
246
+ }
247
+ show(detail, error = true) {
248
+ this.tone = error ? 'error' : '';
249
+ this.status = userMessage(detail);
250
+ if (error)
251
+ emitWindow(pwaAuthError, detail);
252
+ }
122
253
  handleEmail(event) {
123
254
  const input = event.target;
124
255
  this.email = input.value;
256
+ rememberEmail(this.email);
125
257
  }
126
258
  handlePassword(event) {
127
259
  const input = event.target;
128
260
  this.password = input.value;
129
261
  }
262
+ readFields() {
263
+ const email = this.renderRoot.querySelector('input[type="email"]');
264
+ const password = this.renderRoot.querySelector('input[name="password"]');
265
+ this.email = email?.value ?? '';
266
+ this.password = password?.value ?? '';
267
+ rememberEmail(this.email);
268
+ }
130
269
  _handleSubmit(event) {
131
270
  event.preventDefault();
271
+ void this.login();
132
272
  }
133
- login() {
273
+ async login() {
274
+ if (this.busy)
275
+ return;
276
+ this.readFields();
134
277
  if (this.email.length < 4) {
135
- alert('Please enter an email address.');
278
+ this.show({ code: 'pwa/missing-email', message: 'Enter an email address.' });
136
279
  return;
137
280
  }
138
- if (this.password.length < 4) {
139
- alert('Please enter a password.');
281
+ if (!this.password) {
282
+ this.show({ code: 'pwa/missing-password', message: 'Enter a password.' });
140
283
  return;
141
284
  }
142
- this.signIn(this.email, this.password);
285
+ await this.signIn(this.email, this.password);
286
+ }
287
+ sent(email) {
288
+ this.tone = '';
289
+ this.status = sentMessage;
290
+ emitWindow(pwaResetSent, { email });
143
291
  }
144
292
  };
145
293
  __decorate([
146
294
  property({ type: String }),
147
295
  __metadata("design:type", Object)
148
296
  ], FormLogin.prototype, "source", void 0);
297
+ __decorate([
298
+ property({ type: Boolean, attribute: 'hide-google', reflect: true }),
299
+ __metadata("design:type", Object)
300
+ ], FormLogin.prototype, "hideGoogle", void 0);
149
301
  __decorate([
150
302
  state(),
151
303
  __metadata("design:type", Object)
@@ -154,6 +306,26 @@ __decorate([
154
306
  state(),
155
307
  __metadata("design:type", Object)
156
308
  ], FormLogin.prototype, "password", void 0);
309
+ __decorate([
310
+ state(),
311
+ __metadata("design:type", Object)
312
+ ], FormLogin.prototype, "status", void 0);
313
+ __decorate([
314
+ state(),
315
+ __metadata("design:type", Object)
316
+ ], FormLogin.prototype, "tone", void 0);
317
+ __decorate([
318
+ state(),
319
+ __metadata("design:type", Object)
320
+ ], FormLogin.prototype, "busy", void 0);
321
+ __decorate([
322
+ state(),
323
+ __metadata("design:type", Object)
324
+ ], FormLogin.prototype, "resetBusy", void 0);
325
+ __decorate([
326
+ state(),
327
+ __metadata("design:type", Object)
328
+ ], FormLogin.prototype, "showPassword", void 0);
157
329
  FormLogin = __decorate([
158
330
  customElement('form-login'),
159
331
  __metadata("design:paramtypes", [])
@@ -1 +1 @@
1
- {"version":3,"file":"login.js","sourceRoot":"","sources":["../../../typescript/webcomponents/form/login.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EACL,IAAI,EACJ,UAAU,EACV,GAAG,EACJ,MAA8B,KAAK,CAAC;AAErC,OAAO,EACL,aAAa,EACb,QAAQ,EACR,KAAK,EACN,MAA8B,mBAAmB,CAAC;AAEnD,OAAO,EACL,iBAAiB,EACjB,oBAAoB,EACrB,MAA8B,eAAe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CAwRrB"}
@@ -0,0 +1,4 @@
1
+ export declare function markVerificationNotice(email: string): void;
2
+ export declare function verificationNotice(): string;
3
+ export declare function onVerificationNotice(fn: () => void): () => void;
4
+ //# sourceMappingURL=notice.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notice.d.ts","sourceRoot":"","sources":["../../../typescript/webcomponents/form/notice.ts"],"names":[],"mappings":"AAKA,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAG1D;AAED,wBAAgB,kBAAkB,IAAI,MAAM,CAE3C;AAED,wBAAgB,oBAAoB,CAAC,EAAE,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI,CAG/D"}
@@ -0,0 +1,14 @@
1
+ let sentEmail = '';
2
+ const listeners = new Set();
3
+ export function markVerificationNotice(email) {
4
+ sentEmail = email;
5
+ listeners.forEach((fn) => fn());
6
+ }
7
+ export function verificationNotice() {
8
+ return sentEmail;
9
+ }
10
+ export function onVerificationNotice(fn) {
11
+ listeners.add(fn);
12
+ return () => { listeners.delete(fn); };
13
+ }
14
+ //# sourceMappingURL=notice.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notice.js","sourceRoot":"","sources":["../../../typescript/webcomponents/form/notice.ts"],"names":[],"mappings":"AACA,IAAI,SAAS,GAAG,EAAE,CAAC;AAEnB,MAAM,SAAS,GAAG,IAAI,GAAG,EAAc,CAAC;AAExC,MAAM,UAAU,sBAAsB,CAAC,KAAa;IAClD,SAAS,GAAG,KAAK,CAAC;IAClB,SAAS,CAAC,OAAO,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;AAClC,CAAC;AAED,MAAM,UAAU,kBAAkB;IAChC,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,MAAM,UAAU,oBAAoB,CAAC,EAAc;IACjD,SAAS,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAClB,OAAO,GAAG,EAAE,GAAG,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;AACzC,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { TemplateResult } from 'lit';
2
+ export declare function revealControl(showing: boolean, onClick: (event: Event) => void): TemplateResult;
3
+ //# sourceMappingURL=reveal.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reveal.d.ts","sourceRoot":"","sources":["../../../typescript/webcomponents/form/reveal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,cAAc,EAAE,MAAM,KAAK,CAAC;AAG3C,wBAAgB,aAAa,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,GAAG,cAAc,CAc/F"}
@@ -0,0 +1,14 @@
1
+ import { html } from 'lit';
2
+ export function revealControl(showing, onClick) {
3
+ const label = showing ? 'Hide password' : 'Show password';
4
+ return html `
5
+ <button
6
+ type="button"
7
+ class="reveal"
8
+ part="reveal"
9
+ aria-pressed="${showing ? 'true' : 'false'}"
10
+ aria-label="${label}"
11
+ @click="${onClick}">${showing ? 'Hide' : 'Show'}</button>
12
+ `;
13
+ }
14
+ //# sourceMappingURL=reveal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reveal.js","sourceRoot":"","sources":["../../../typescript/webcomponents/form/reveal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAkB,MAAM,KAAK,CAAC;AAG3C,MAAM,UAAU,aAAa,CAAC,OAAgB,EAAE,OAA+B;IAE7E,MAAM,KAAK,GAAG,OAAO,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,eAAe,CAAC;IAE1D,OAAO,IAAI,CAAA;;;;;sBAKS,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO;oBAC5B,KAAK;gBACT,OAAO,KAAK,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM;GAClD,CAAC;AAEJ,CAAC"}
@@ -1,12 +1,24 @@
1
1
  import { LitElement } from 'lit';
2
2
  export declare class FormSignup 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 showPassword;
11
+ private notice;
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;
21
+ private readFields;
10
22
  private _handleSubmit;
11
23
  private handleEmail;
12
24
  private handlePassword;
@@ -18,3 +30,4 @@ declare global {
18
30
  'form-signup': FormSignup;
19
31
  }
20
32
  }
33
+ //# sourceMappingURL=signup.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"signup.d.ts","sourceRoot":"","sources":["../../../typescript/webcomponents/form/signup.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,UAAU,EACX,MAA8B,KAAK,CAAC;AAwCrC,qBACa,UAAW,SAAQ,UAAU;IAGP,MAAM,SAAa;IAGuB,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,YAAY,CAAS;IAC7B,OAAO,CAAC,MAAM,CAAY;;IAI1B,iBAAiB,IAAI,IAAI;IAKlC,SAAS,CAAC,OAAO,IAAI,IAAI;IAIzB,OAAO,CAAC,aAAa;IAOrB,MAAM,KAAK,MAAM,8BAuBd;IAEH,SAAS,CAAC,MAAM;IAmGhB,OAAO,CAAC,MAAM;YAIA,MAAM;IAcpB,OAAO,CAAC,IAAI;IAOZ,OAAO,CAAC,UAAU;IAQlB,OAAO,CAAC,aAAa;IAMrB,OAAO,CAAC,WAAW;IAMnB,OAAO,CAAC,cAAc;YAMR,MAAM;IAgBpB,OAAO,CAAC,UAAU,CAgCjB;CAEF;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC3B,aAAa,EAAE,UAAU,CAAC;KAC7B;CACF"}