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.
Files changed (235) hide show
  1. package/LICENSES.txt +18 -23
  2. package/README.md +547 -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/interface.d.ts +7 -1
  44. package/base/firebase/interface.d.ts.map +1 -0
  45. package/base/firebase/interface.js +99 -68
  46. package/base/firebase/interface.js.map +1 -1
  47. package/base/firebase/message.d.ts +2 -0
  48. package/base/firebase/message.d.ts.map +1 -0
  49. package/base/firebase/message.js +34 -0
  50. package/base/firebase/message.js.map +1 -0
  51. package/base/firebase/password.d.ts +11 -0
  52. package/base/firebase/password.d.ts.map +1 -0
  53. package/base/firebase/password.js +16 -0
  54. package/base/firebase/password.js.map +1 -0
  55. package/base/lazyLoader.d.ts +1 -0
  56. package/base/lazyLoader.d.ts.map +1 -0
  57. package/base/redux/backend.d.ts +1 -0
  58. package/base/redux/backend.d.ts.map +1 -0
  59. package/base/redux/backend.js +1 -1
  60. package/base/redux/backend.js.map +1 -1
  61. package/base/redux/frontend.d.ts +16 -1
  62. package/base/redux/frontend.d.ts.map +1 -0
  63. package/base/redux/frontend.js +6 -3
  64. package/base/redux/frontend.js.map +1 -1
  65. package/base/store.d.ts +1 -6
  66. package/base/store.d.ts.map +1 -0
  67. package/base/store.js +2 -4
  68. package/base/store.js.map +1 -1
  69. package/base/webcomponents/css/animation.d.ts +1 -0
  70. package/base/webcomponents/css/animation.d.ts.map +1 -0
  71. package/base/webcomponents/css/animation.js +79 -67
  72. package/base/webcomponents/css/animation.js.map +1 -1
  73. package/base/webcomponents/css/svg.d.ts +1 -2
  74. package/base/webcomponents/css/svg.d.ts.map +1 -0
  75. package/base/webcomponents/css/svg.js +2 -4
  76. package/base/webcomponents/css/svg.js.map +1 -1
  77. package/base/webcomponents/css/tap.d.ts +3 -0
  78. package/base/webcomponents/css/tap.d.ts.map +1 -0
  79. package/base/webcomponents/css/tap.js +9 -0
  80. package/base/webcomponents/css/tap.js.map +1 -0
  81. package/base/webcomponents/css/toggle.d.ts +1 -0
  82. package/base/webcomponents/css/toggle.d.ts.map +1 -0
  83. package/base/webcomponents/css/toggle.js +5 -5
  84. package/base/webcomponents/drawer/css/drawer.d.ts +1 -0
  85. package/base/webcomponents/drawer/css/drawer.d.ts.map +1 -0
  86. package/base/webcomponents/drawer/css/drawer.js +101 -74
  87. package/base/webcomponents/drawer/css/drawer.js.map +1 -1
  88. package/base/webcomponents/drawer/css/exit.d.ts +1 -0
  89. package/base/webcomponents/drawer/css/exit.d.ts.map +1 -0
  90. package/base/webcomponents/drawer/css/exit.js +58 -52
  91. package/base/webcomponents/drawer/css/exit.js.map +1 -1
  92. package/base/webcomponents/drawer/css/link.d.ts +1 -0
  93. package/base/webcomponents/drawer/css/link.d.ts.map +1 -0
  94. package/base/webcomponents/drawer/css/link.js +9 -10
  95. package/base/webcomponents/drawer/css/link.js.map +1 -1
  96. package/base/webcomponents/drawer/css/paragraph.d.ts +1 -0
  97. package/base/webcomponents/drawer/css/paragraph.d.ts.map +1 -0
  98. package/base/webcomponents/drawer/css/paragraph.js +37 -20
  99. package/base/webcomponents/drawer/css/paragraph.js.map +1 -1
  100. package/base/webcomponents/drawer/drawer.d.ts +21 -7
  101. package/base/webcomponents/drawer/drawer.d.ts.map +1 -0
  102. package/base/webcomponents/drawer/drawer.js +292 -90
  103. package/base/webcomponents/drawer/drawer.js.map +1 -1
  104. package/base/webcomponents/drawer/keys.d.ts +4 -0
  105. package/base/webcomponents/drawer/keys.d.ts.map +1 -0
  106. package/base/webcomponents/drawer/keys.js +57 -0
  107. package/base/webcomponents/drawer/keys.js.map +1 -0
  108. package/base/webcomponents/form/css/button.d.ts +1 -0
  109. package/base/webcomponents/form/css/button.d.ts.map +1 -0
  110. package/base/webcomponents/form/css/button.js +69 -51
  111. package/base/webcomponents/form/css/button.js.map +1 -1
  112. package/base/webcomponents/form/css/input.d.ts +1 -0
  113. package/base/webcomponents/form/css/input.d.ts.map +1 -0
  114. package/base/webcomponents/form/css/input.js +22 -21
  115. package/base/webcomponents/form/css/input.js.map +1 -1
  116. package/base/webcomponents/form/css/label.d.ts +1 -0
  117. package/base/webcomponents/form/css/label.d.ts.map +1 -0
  118. package/base/webcomponents/form/css/label.js +22 -21
  119. package/base/webcomponents/form/css/label.js.map +1 -1
  120. package/base/webcomponents/form/css/list.d.ts +1 -0
  121. package/base/webcomponents/form/css/list.d.ts.map +1 -0
  122. package/base/webcomponents/form/css/list.js +19 -19
  123. package/base/webcomponents/form/css/notice.d.ts +3 -0
  124. package/base/webcomponents/form/css/notice.d.ts.map +1 -0
  125. package/base/webcomponents/form/css/notice.js +20 -0
  126. package/base/webcomponents/form/css/notice.js.map +1 -0
  127. package/base/webcomponents/form/css/status.d.ts +4 -0
  128. package/base/webcomponents/form/css/status.d.ts.map +1 -0
  129. package/base/webcomponents/form/css/status.js +44 -0
  130. package/base/webcomponents/form/css/status.js.map +1 -0
  131. package/base/webcomponents/form/css/toggle.d.ts +1 -0
  132. package/base/webcomponents/form/css/toggle.d.ts.map +1 -0
  133. package/base/webcomponents/form/css/toggle.js +43 -17
  134. package/base/webcomponents/form/css/toggle.js.map +1 -1
  135. package/base/webcomponents/form/draft.d.ts +5 -0
  136. package/base/webcomponents/form/draft.d.ts.map +1 -0
  137. package/base/webcomponents/form/draft.js +22 -0
  138. package/base/webcomponents/form/draft.js.map +1 -0
  139. package/base/webcomponents/form/forgot.d.ts +26 -3
  140. package/base/webcomponents/form/forgot.d.ts.map +1 -0
  141. package/base/webcomponents/form/forgot.js +297 -30
  142. package/base/webcomponents/form/forgot.js.map +1 -1
  143. package/base/webcomponents/form/letters.d.ts +3 -0
  144. package/base/webcomponents/form/letters.d.ts.map +1 -0
  145. package/base/webcomponents/form/letters.js +21 -0
  146. package/base/webcomponents/form/letters.js.map +1 -0
  147. package/base/webcomponents/form/login.d.ts +10 -0
  148. package/base/webcomponents/form/login.d.ts.map +1 -0
  149. package/base/webcomponents/form/login.js +221 -89
  150. package/base/webcomponents/form/login.js.map +1 -1
  151. package/base/webcomponents/form/notice.d.ts +4 -0
  152. package/base/webcomponents/form/notice.d.ts.map +1 -0
  153. package/base/webcomponents/form/notice.js +14 -0
  154. package/base/webcomponents/form/notice.js.map +1 -0
  155. package/base/webcomponents/form/reveal.d.ts +3 -0
  156. package/base/webcomponents/form/reveal.d.ts.map +1 -0
  157. package/base/webcomponents/form/reveal.js +14 -0
  158. package/base/webcomponents/form/reveal.js.map +1 -0
  159. package/base/webcomponents/form/signup.d.ts +8 -0
  160. package/base/webcomponents/form/signup.d.ts.map +1 -0
  161. package/base/webcomponents/form/signup.js +201 -100
  162. package/base/webcomponents/form/signup.js.map +1 -1
  163. package/base/webcomponents/form/verified.d.ts +3 -0
  164. package/base/webcomponents/form/verified.d.ts.map +1 -0
  165. package/base/webcomponents/form/verified.js +45 -0
  166. package/base/webcomponents/form/verified.js.map +1 -0
  167. package/base/webcomponents/icon/css/icon.d.ts +1 -0
  168. package/base/webcomponents/icon/css/icon.d.ts.map +1 -0
  169. package/base/webcomponents/icon/css/icon.js +63 -49
  170. package/base/webcomponents/icon/css/icon.js.map +1 -1
  171. package/base/webcomponents/icon/icon.d.ts +6 -4
  172. package/base/webcomponents/icon/icon.d.ts.map +1 -0
  173. package/base/webcomponents/icon/icon.js +48 -27
  174. package/base/webcomponents/icon/icon.js.map +1 -1
  175. package/base/webcomponents/login/css/auth.d.ts +1 -0
  176. package/base/webcomponents/login/css/auth.d.ts.map +1 -0
  177. package/base/webcomponents/login/css/auth.js +37 -36
  178. package/base/webcomponents/login/css/auth.js.map +1 -1
  179. package/base/webcomponents/login/css/link.d.ts +1 -0
  180. package/base/webcomponents/login/css/link.d.ts.map +1 -0
  181. package/base/webcomponents/login/css/link.js +9 -10
  182. package/base/webcomponents/login/css/link.js.map +1 -1
  183. package/base/webcomponents/login/css/paragraph.d.ts +1 -0
  184. package/base/webcomponents/login/css/paragraph.d.ts.map +1 -0
  185. package/base/webcomponents/login/css/paragraph.js +8 -8
  186. package/base/webcomponents/login/page.d.ts +10 -6
  187. package/base/webcomponents/login/page.d.ts.map +1 -0
  188. package/base/webcomponents/login/page.js +96 -55
  189. package/base/webcomponents/login/page.js.map +1 -1
  190. package/base/webcomponents/settings/css/navigation.d.ts +1 -0
  191. package/base/webcomponents/settings/css/navigation.d.ts.map +1 -0
  192. package/base/webcomponents/settings/css/navigation.js +78 -68
  193. package/base/webcomponents/settings/css/navigation.js.map +1 -1
  194. package/base/webcomponents/settings/input/delete.d.ts +7 -6
  195. package/base/webcomponents/settings/input/delete.d.ts.map +1 -0
  196. package/base/webcomponents/settings/input/delete.js +135 -48
  197. package/base/webcomponents/settings/input/delete.js.map +1 -1
  198. package/base/webcomponents/settings/input/email.d.ts +7 -5
  199. package/base/webcomponents/settings/input/email.d.ts.map +1 -0
  200. package/base/webcomponents/settings/input/email.js +155 -50
  201. package/base/webcomponents/settings/input/email.js.map +1 -1
  202. package/base/webcomponents/settings/input/name.d.ts +8 -5
  203. package/base/webcomponents/settings/input/name.d.ts.map +1 -0
  204. package/base/webcomponents/settings/input/name.js +116 -53
  205. package/base/webcomponents/settings/input/name.js.map +1 -1
  206. package/base/webcomponents/settings/input/password.d.ts +8 -5
  207. package/base/webcomponents/settings/input/password.d.ts.map +1 -0
  208. package/base/webcomponents/settings/input/password.js +200 -103
  209. package/base/webcomponents/settings/input/password.js.map +1 -1
  210. package/base/webcomponents/settings/input/uploader.d.ts +8 -6
  211. package/base/webcomponents/settings/input/uploader.d.ts.map +1 -0
  212. package/base/webcomponents/settings/input/uploader.js +209 -170
  213. package/base/webcomponents/settings/input/uploader.js.map +1 -1
  214. package/base/webcomponents/settings/input/verify.d.ts +64 -0
  215. package/base/webcomponents/settings/input/verify.d.ts.map +1 -0
  216. package/base/webcomponents/settings/input/verify.js +272 -0
  217. package/base/webcomponents/settings/input/verify.js.map +1 -0
  218. package/base/webcomponents/settings/settings.d.ts +15 -10
  219. package/base/webcomponents/settings/settings.d.ts.map +1 -0
  220. package/base/webcomponents/settings/settings.js +226 -147
  221. package/base/webcomponents/settings/settings.js.map +1 -1
  222. package/firebase.md +107 -0
  223. package/intro.md +19 -0
  224. package/license +21 -21
  225. package/package.json +116 -71
  226. package/source/pwa-auth.js +1098 -407
  227. package/source/pwa-styles.css +50 -68
  228. package/base/redux/drawer.d.ts +0 -17
  229. package/base/redux/drawer.js +0 -22
  230. package/base/redux/drawer.js.map +0 -1
  231. package/demonstration/index.html +0 -99
  232. package/demonstration/pwa-styles.css +0 -77
  233. package/demonstration/styles.css +0 -77
  234. package/notes.md +0 -11
  235. package/source/THIRD_PARTY_LICENSES.txt +0 -303
@@ -1,71 +1,81 @@
1
1
  import { css } from 'lit';
2
- export const navigation = css `
3
-
4
- nav {
5
- overflow: hidden;
6
- /* box-shadow: 0 0 6px 0;*/
7
- z-index: 3;
8
- }
9
-
10
- nav > ul {
11
-
12
- list-style-type: none;
13
- margin: 0px;
14
- padding: 0px;
15
- display: grid;
16
- grid-template-columns: 1fr 1fr 1fr 1fr;
17
- grid-gap: 8px;
18
-
19
- }
20
-
21
- nav > ul > li > button {
22
-
23
- color: var(--pwa_nav_button_color, grey);
24
- border: 0;
25
- width: 100%;
26
- height: 36px;
27
- margin: auto;
28
- padding: 0px;
29
- font-weight: 800;
30
- font-size: .8em;
31
- border-radius: 6px 6px 0 0;
32
- background-color: transparent;
33
-
34
- }
35
-
36
- nav > ul > li > button[on] {
37
-
38
- color: var(--pwa_nav_highlight_color, black);
39
- background-color: lightgrey;
40
-
41
- }
42
-
43
-
44
- nav > ul > li > button:hover {
45
-
46
- cursor: pointer;
47
-
48
- }
49
-
50
- section {
51
- grid-template-rows: auto 1fr;
52
- background-color: var( --section_background_color, white);
53
- }
54
-
55
-
56
- h2 {
57
- color: var(--pwa_header_color, black);
58
- text-align: center;
59
- text-shadow: 1px 1px 2px black, 0 0 15px grey, 0 0 5px #fff;
60
-
61
- /* border-bottom: 2px solid var(--pwa_divider_color, black); */
62
- /* border-top: 2px solid var(--pwa_divider_color, black); */
63
-
64
- margin: 6px 0 0 0;
65
- padding: 16px 0;
66
-
67
- box-shadow: 0px 6px 6px -6px;
68
- }
69
-
2
+ export const navigation = css `
3
+
4
+ nav {
5
+ overflow: hidden;
6
+ z-index: 3;
7
+ padding: 8px 8px 0; /* Required - space around the tabs */
8
+ }
9
+
10
+ nav > ul {
11
+
12
+ list-style-type: none;
13
+ margin: 0px;
14
+ padding: 0px;
15
+ display: grid;
16
+ grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr);
17
+ grid-gap: 8px;
18
+
19
+ }
20
+
21
+ nav > ul > li > button {
22
+
23
+ color: var(--pwa_nav_button_color, #4e5b6a);
24
+ border: 0;
25
+ width: 100%;
26
+ margin: auto;
27
+ padding: 0px;
28
+ font-weight: 600;
29
+ font-size: 0.85rem;
30
+ min-height: var(--pwa_tap, 44px); /* Required - minimum tap target */
31
+ height: auto;
32
+ border-radius: 6px 6px 0 0;
33
+ background-color: transparent;
34
+
35
+ }
36
+
37
+ nav > ul > li > button[on] {
38
+
39
+ color: var(--pwa_nav_highlight_color, #1c2430);
40
+ background-color: var(--pwa_nav_on_background, #f3efe6);
41
+
42
+ }
43
+
44
+
45
+ nav > ul > li > button:hover {
46
+
47
+ cursor: pointer;
48
+
49
+ }
50
+
51
+ /* Required - fit 320px */
52
+ @media (max-width: 320px) {
53
+
54
+ nav > ul {
55
+ grid-gap: 4px;
56
+ }
57
+
58
+ nav > ul > li > button {
59
+ white-space: normal;
60
+ font-size: .7em;
61
+ }
62
+
63
+ }
64
+
65
+ section {
66
+ align-content: start; /* Required - tabs keep each button under its fields */
67
+ background-color: var(--section_background_color, #fffdf8);
68
+ }
69
+
70
+
71
+ h2 {
72
+ color: var(--pwa_header_color, #1c2430);
73
+ text-align: center;
74
+ font-weight: 600;
75
+ font-size: 1.35rem;
76
+ margin: 0;
77
+ padding: 20px 16px 4px;
78
+ }
79
+
70
80
  `;
71
81
  //# sourceMappingURL=navigation.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"navigation.js","sourceRoot":"","sources":["../../../../typescript/webcomponents/settings/css/navigation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,UAAU,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoE5B,CAAC"}
1
+ {"version":3,"file":"navigation.js","sourceRoot":"","sources":["../../../../typescript/webcomponents/settings/css/navigation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,UAAU,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8E5B,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import { CSSResultArray, LitElement } from "lit";
2
- import { AppState } from "../../../store";
2
+ import { AppState } from "../../../store.js";
3
3
  declare const DeleteUser_base: (new (...args: any[]) => {
4
4
  _storeUnsubscribe: import("redux").Unsubscribe;
5
5
  connectedCallback(): void;
@@ -19,9 +19,6 @@ declare const DeleteUser_base: (new (...args: any[]) => {
19
19
  phone: string;
20
20
  email: string;
21
21
  };
22
- drawer: {
23
- drawer: boolean;
24
- };
25
22
  backend: {
26
23
  verified: boolean;
27
24
  anon: boolean;
@@ -38,13 +35,16 @@ declare const DeleteUser_base: (new (...args: any[]) => {
38
35
  export declare class DeleteUser extends DeleteUser_base {
39
36
  private login;
40
37
  private email;
38
+ private busy;
39
+ private status;
40
+ private tone;
41
+ private showPassword;
41
42
  constructor();
42
- protected firstUpdated(): void;
43
43
  stateChanged(state: AppState): void;
44
44
  static get styles(): CSSResultArray;
45
45
  render(): import("lit-html").TemplateResult<1>;
46
+ private show;
46
47
  private alertDelete;
47
- private deleteUser;
48
48
  private officialDelete;
49
49
  }
50
50
  declare global {
@@ -53,3 +53,4 @@ declare global {
53
53
  }
54
54
  }
55
55
  export {};
56
+ //# sourceMappingURL=delete.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delete.d.ts","sourceRoot":"","sources":["../../../../typescript/webcomponents/settings/input/delete.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,UAAU,EAAa,MAAM,KAAK,CAAC;AAG5D,OAAc,EAAE,QAAQ,EAAE,MAAS,mBAAmB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAavD,qBAAa,UAAW,SAAQ,eAA0B;IAE/C,OAAO,CAAC,KAAK,CAAmB;IAChC,OAAO,CAAC,KAAK,CAAc;IAC3B,OAAO,CAAC,IAAI,CAAS;IACrB,OAAO,CAAC,MAAM,CAAM;IACpB,OAAO,CAAC,IAAI,CAAM;IAClB,OAAO,CAAC,YAAY,CAAS;;IAItC,YAAY,CAAC,KAAK,EAAE,QAAQ;IAK5B,MAAM,KAAK,MAAM,IAAI,cAAc,CAqB3B;IAER,MAAM;IAmCN,OAAO,CAAC,IAAI;IAOZ,OAAO,CAAC,WAAW,CAgBlB;IAGD,OAAO,CAAC,cAAc,CAyCpB;CAEH;AAID,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,aAAa,EAAE,UAAU,CAAC;KAC3B;CACF"}
@@ -10,27 +10,79 @@ var __metadata = (this && this.__metadata) || function (k, v) {
10
10
  import { LitElement, css, html } from "lit";
11
11
  import { state } from "lit/decorators.js";
12
12
  import { connect } from "pwa-helpers";
13
- import store from "../../../store";
14
- import { buttonStyle } from "../../form/css/button";
15
- import { auth } from '../../../firebase/authentication';
13
+ import store from "../../../store.js";
14
+ import { buttonStyle } from "../../form/css/button.js";
15
+ import { labelStyle } from "../../form/css/label.js";
16
+ import { inputStyle } from "../../form/css/input.js";
17
+ import { toggleStyle } from "../../form/css/toggle.js";
18
+ import { statusStyle, liveStatus } from "../../form/css/status.js";
19
+ import { revealControl } from "../../form/reveal.js";
20
+ import { auth } from '../../../firebase/authentication.js';
21
+ import { deleteUserFiles, logAccountDelete, reauthenticate, takeAuthFailure } from '../../../firebase/interface.js';
22
+ import { pwaAccountDeleted, pwaAuthError } from '../../../events/names.js';
23
+ import { emitWindow, toAuthError } from '../../../events/emit.js';
24
+ import { userMessage } from '../../../firebase/message.js';
16
25
  export class DeleteUser extends connect(store)(LitElement) {
17
26
  constructor() {
18
27
  super();
19
28
  this.login = false;
20
29
  this.email = '';
21
- this.officialDelete = async () => {
22
- if (auth.currentUser) {
23
- return auth.currentUser.delete().then(() => { }).catch(() => { });
30
+ this.busy = false;
31
+ this.status = '';
32
+ this.tone = '';
33
+ this.showPassword = false;
34
+ this.alertDelete = () => {
35
+ if (this.busy)
36
+ return;
37
+ const current = auth.currentUser;
38
+ if (!current) {
39
+ this.show({ code: 'pwa/signed-out', message: 'Sign in first.' });
40
+ return;
24
41
  }
25
- else {
26
- alert('Please Sign-in');
42
+ const password = this.shadowRoot.querySelector('#pwa-delete-password').value;
43
+ if (password.length < 6) {
44
+ this.show({ code: 'pwa/current-password', message: 'Enter your current password.' });
45
+ return;
46
+ }
47
+ const d = confirm("Delete Account?");
48
+ if (d == true)
49
+ void this.officialDelete(password);
50
+ };
51
+ this.officialDelete = async (password) => {
52
+ this.busy = true;
53
+ this.tone = '';
54
+ this.status = '';
55
+ const ok = await reauthenticate(password);
56
+ if (!ok) {
57
+ const detail = takeAuthFailure();
58
+ this.tone = 'error';
59
+ this.status = userMessage(detail ?? { code: 'pwa/unknown', message: 'Something went wrong. Try again.' });
60
+ this.busy = false;
61
+ return;
62
+ }
63
+ const current = auth.currentUser;
64
+ if (!current) {
65
+ this.show({ code: 'pwa/signed-out', message: 'Sign in first.' });
66
+ this.busy = false;
67
+ return;
68
+ }
69
+ try {
70
+ const uid = current.uid;
71
+ await deleteUserFiles(uid);
72
+ await logAccountDelete();
73
+ await current.delete();
74
+ emitWindow(pwaAccountDeleted, { uid });
75
+ }
76
+ catch (error) {
77
+ const detail = toAuthError(error);
78
+ this.tone = 'error';
79
+ this.status = userMessage(error);
80
+ emitWindow(pwaAuthError, detail);
81
+ }
82
+ finally {
83
+ this.busy = false;
27
84
  }
28
85
  };
29
- }
30
- firstUpdated() {
31
- this.shadowRoot.querySelector('.deleteUser').addEventListener('click', () => {
32
- this.alertDelete();
33
- });
34
86
  }
35
87
  stateChanged(state) {
36
88
  this.login = state.frontend.login;
@@ -39,47 +91,66 @@ export class DeleteUser extends connect(store)(LitElement) {
39
91
  static get styles() {
40
92
  return [
41
93
  buttonStyle,
42
- css `
43
-
44
- :host {
45
- display: grid;
46
- grid-template-rows: 1fr auto;
47
- }
48
-
49
- p {
50
- padding: 0 16px;
51
- color: black;
52
- }
53
-
94
+ labelStyle,
95
+ inputStyle,
96
+ toggleStyle,
97
+ statusStyle,
98
+ css `
99
+
100
+ :host {
101
+ display: grid;
102
+ grid-template-rows: auto auto auto auto;
103
+ align-content: start;
104
+ }
105
+
106
+ p.lead {
107
+ margin: 0;
108
+ padding: 4px 20px 0;
109
+ line-height: 1.5;
110
+ color: var(--pwa_label_text_color, #1c2430);
111
+ }
112
+
54
113
  `
55
114
  ];
56
115
  }
57
116
  render() {
58
- return html `
59
-
60
- <p>Permanently delete the user account and data related to: ${this.email}</p>
61
-
62
- <button
63
- class="action-button deleteUser"
64
- ?disabled="${this.login === false}">Delete</button>
65
-
117
+ return html `
118
+
119
+ <p class="lead">Permanently delete the user account and data related to: ${this.email}</p>
120
+
121
+ <label for="pwa-delete-password">Current password
122
+
123
+ <span class="pair">
124
+
125
+ <input
126
+ id="pwa-delete-password"
127
+ name="current_password"
128
+ type="${this.showPassword ? 'text' : 'password'}"
129
+ autocomplete="current-password"
130
+ aria-describedby="pwa-delete-status"/>
131
+
132
+ ${revealControl(this.showPassword, () => { this.showPassword = !this.showPassword; })}
133
+
134
+ </span>
135
+
136
+ </label>
137
+
138
+ ${liveStatus('pwa-delete-status', this.status, this.tone)}
139
+
140
+ <button
141
+ type="button"
142
+ part="submit"
143
+ class="action-button deleteUser"
144
+ aria-busy="${this.busy ? 'true' : 'false'}"
145
+ ?disabled="${this.login === false || this.busy}"
146
+ @click="${this.alertDelete}">${this.busy ? 'Deleting…' : 'Delete'}</button>
147
+
66
148
  `;
67
149
  }
68
- alertDelete() { if (auth.currentUser) {
69
- this.deleteUser();
70
- }
71
- else {
72
- alert('Please Login');
73
- } }
74
- deleteUser() {
75
- const d = confirm("Delete Account?");
76
- if (d == true) {
77
- this.officialDelete();
78
- console.log("user gone");
79
- }
80
- else {
81
- console.log("user here");
82
- }
150
+ show(detail) {
151
+ this.tone = 'error';
152
+ this.status = userMessage(detail);
153
+ emitWindow(pwaAuthError, detail);
83
154
  }
84
155
  }
85
156
  __decorate([
@@ -90,5 +161,21 @@ __decorate([
90
161
  state(),
91
162
  __metadata("design:type", String)
92
163
  ], DeleteUser.prototype, "email", void 0);
164
+ __decorate([
165
+ state(),
166
+ __metadata("design:type", Object)
167
+ ], DeleteUser.prototype, "busy", void 0);
168
+ __decorate([
169
+ state(),
170
+ __metadata("design:type", Object)
171
+ ], DeleteUser.prototype, "status", void 0);
172
+ __decorate([
173
+ state(),
174
+ __metadata("design:type", Object)
175
+ ], DeleteUser.prototype, "tone", void 0);
176
+ __decorate([
177
+ state(),
178
+ __metadata("design:type", Object)
179
+ ], DeleteUser.prototype, "showPassword", void 0);
93
180
  customElements.define('delete-user', DeleteUser);
94
181
  //# sourceMappingURL=delete.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"delete.js","sourceRoot":"","sources":["../../../../typescript/webcomponents/settings/input/delete.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAkB,UAAU,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAC5D,OAAO,EAAE,KAAK,EAAE,MAAmB,mBAAmB,CAAC;AACvD,OAAO,EAAE,OAAO,EAAE,MAAiB,aAAa,CAAC;AACjD,OAAO,KAAmB,MAAS,gBAAgB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAa,uBAAuB,CAAC;AAC3D,OAAO,EAAE,IAAI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C;QACpB,IAAI,CAAC,MAAM,GAAG,WAAW,CAAC,MAAM,CAAC,CAAC;QAClC,UAAU,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC;IACnC,CAAC;CAiEF;AA7IkB;IAAhB,KAAK,EAAE;;yCAAiC;AACxB;IAAhB,KAAK,EAAE;;yCAA4B;AACnB;IAAhB,KAAK,EAAE;;wCAAsB;AACb;IAAhB,KAAK,EAAE;;0CAAqB;AACZ;IAAhB,KAAK,EAAE;;wCAAmB;AACV;IAAhB,KAAK,EAAE;;gDAA8B;AA0IxC,cAAc,CAAC,MAAM,CAAC,aAAa,EAAE,UAAU,CAAC,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import { CSSResultArray, LitElement } from "lit";
2
- import { AppState } from "../../../store";
2
+ import { AppState } from "../../../store.js";
3
3
  declare const ContactEmail_base: (new (...args: any[]) => {
4
4
  _storeUnsubscribe: import("redux").Unsubscribe;
5
5
  connectedCallback(): void;
@@ -19,9 +19,6 @@ declare const ContactEmail_base: (new (...args: any[]) => {
19
19
  phone: string;
20
20
  email: string;
21
21
  };
22
- drawer: {
23
- drawer: boolean;
24
- };
25
22
  backend: {
26
23
  verified: boolean;
27
24
  anon: boolean;
@@ -39,12 +36,16 @@ export declare class ContactEmail extends ContactEmail_base {
39
36
  email: string;
40
37
  private login;
41
38
  private mail;
39
+ private busy;
40
+ private status;
41
+ private tone;
42
+ private showPassword;
42
43
  constructor();
43
44
  stateChanged(state: AppState): void;
44
45
  private handleEmail;
45
46
  static get styles(): CSSResultArray;
46
47
  render(): import("lit-html").TemplateResult<1>;
47
- private default;
48
+ private show;
48
49
  private saveEmail;
49
50
  }
50
51
  declare global {
@@ -53,3 +54,4 @@ declare global {
53
54
  }
54
55
  }
55
56
  export {};
57
+ //# sourceMappingURL=email.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"email.d.ts","sourceRoot":"","sources":["../../../../typescript/webcomponents/settings/input/email.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,UAAU,EAAa,MAAM,KAAK,CAAC;AAG5D,OAAc,EAAE,QAAQ,EAAE,MAAO,mBAAmB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiBrD,qBAAa,YAAa,SAAQ,iBAA0B;IAGhB,KAAK,SAAM;IAE5C,OAAO,CAAC,KAAK,CAA0B;IACvC,OAAO,CAAC,IAAI,CAAwB;IACpC,OAAO,CAAC,IAAI,CAAe;IAC3B,OAAO,CAAC,MAAM,CAAU;IACxB,OAAO,CAAC,IAAI,CAAY;IACxB,OAAO,CAAC,YAAY,CAAS;;IAItC,YAAY,CAAC,KAAK,EAAE,QAAQ;IAK5B,OAAO,CAAC,WAAW;IAKnB,MAAM,KAAK,MAAM,IAAI,cAAc,CAW7B;IAEN,MAAM;IAyDN,OAAO,CAAC,IAAI;IAMZ,OAAO,CAAC,SAAS,CA6DhB;CAEF;AAID,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,eAAe,EAAE,YAAY,CAAC;KAC/B;CACF"}