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
@@ -10,175 +10,246 @@ var __metadata = (this && this.__metadata) || function (k, v) {
10
10
  import { css, html, LitElement } from 'lit';
11
11
  import { state, customElement, property } from 'lit/decorators.js';
12
12
  import { connect } from 'pwa-helpers/connect-mixin.js';
13
- import { store } from '../../store';
14
- import { navigateAuth } from '../../redux/frontend';
15
- import { navigation } from './css/navigation';
16
- import './input/uploader';
17
- import './input/name';
18
- import './input/email';
19
- import './input/password';
20
- import './input/delete';
21
- import { listStyle } from '../form/css/list';
22
- import { animation } from '../css/animation';
13
+ import { store } from '../../store.js';
14
+ import { navigateAuth } from '../../redux/frontend.js';
15
+ import { navigation } from './css/navigation.js';
16
+ import './input/uploader.js';
17
+ import './input/name.js';
18
+ import './input/email.js';
19
+ import './input/password.js';
20
+ import './input/delete.js';
21
+ import './input/verify.js';
22
+ import { listStyle } from '../form/css/list.js';
23
+ import { animation } from '../css/animation.js';
24
+ import { tapStyle } from '../css/tap.js';
25
+ import { applyFirebaseConfig } from '../../firebase/attribute.js';
26
+ import { accountTitle } from '../form/letters.js';
23
27
  let UserSettings = class UserSettings extends connect(store)(LitElement) {
24
28
  constructor() {
25
29
  super();
26
30
  this.empty = '';
27
31
  this.profileTopic = '';
28
32
  this.name = '';
33
+ this.email = '';
34
+ this.login = false;
35
+ this.onSubmit = (event) => {
36
+ event.preventDefault();
37
+ };
29
38
  }
30
- firstUpdated() {
31
- const forms = this.querySelectorAll('form');
32
- forms.forEach(item => {
33
- item.preventDefault();
34
- });
35
- this.shadowRoot.querySelector('button[value=profile]').addEventListener('click', () => {
36
- store.dispatch(navigateAuth('profile'));
37
- });
38
- this.shadowRoot.querySelector('button[value=verification]').addEventListener('click', () => {
39
- store.dispatch(navigateAuth('verification'));
40
- });
41
- this.shadowRoot.querySelector('button[value=password]').addEventListener('click', () => {
42
- store.dispatch(navigateAuth('password'));
43
- });
44
- this.shadowRoot.querySelector('button[value=delete]').addEventListener('click', () => {
45
- store.dispatch(navigateAuth('delete'));
39
+ connectedCallback() {
40
+ applyFirebaseConfig(this);
41
+ super.connectedCallback();
42
+ this.addEventListener('submit', this.onSubmit);
43
+ }
44
+ disconnectedCallback() {
45
+ this.removeEventListener('submit', this.onSubmit);
46
+ super.disconnectedCallback();
47
+ }
48
+ onTabKey(event) {
49
+ if (event.key !== 'ArrowRight' && event.key !== 'ArrowLeft')
50
+ return;
51
+ const order = ['profile', 'verification', 'password', 'delete'];
52
+ const index = order.indexOf(this.profileTopic);
53
+ const step = event.key === 'ArrowRight' ? 1 : -1;
54
+ const next = order[(index + step + order.length) % order.length];
55
+ store.dispatch(navigateAuth(next));
56
+ this.updateComplete.then(() => {
57
+ this.shadowRoot?.querySelector(`button[value="${next}"]`)?.focus();
46
58
  });
47
59
  }
48
60
  stateChanged(state) {
49
61
  this.profileTopic = state.frontend.settings;
62
+ this.login = Boolean(state.frontend?.login);
50
63
  this.name = state.backend.name;
64
+ this.email = state.backend.email;
51
65
  }
52
66
  static get styles() {
53
67
  return [
54
68
  navigation,
55
69
  listStyle,
56
70
  animation,
57
- css `
58
-
59
- :host {
60
- display: grid;
61
- grid-template-rows: auto 1fr;
62
- background-color: var(--pwa_settings_background_color, white);
63
- }
64
-
65
- form {
66
- box-sizing: border-box;
67
- display: grid;
68
- border: 0;
69
- }
70
-
71
- .pageTitle { margin: 0; }
72
-
73
- /* up to 576 pixels */
74
- @media only screen and (max-width: 576px) {
75
- h2 {
76
- font-size: medium;
77
- }
78
- }
79
-
71
+ tapStyle,
72
+ css `
73
+
74
+ :host {
75
+ display: grid;
76
+ background-color: var(--pwa_settings_background_color, #fffdf8);
77
+ }
78
+
79
+ form {
80
+ box-sizing: border-box;
81
+ display: grid;
82
+ border: 0;
83
+ }
84
+
85
+ .pageTitle { margin: 0; }
86
+
87
+ .signed-out {
88
+ margin: 0;
89
+ padding: 20px 16px;
90
+ text-align: center;
91
+ color: var(--pwa_label_text_color, #1c2430);
92
+ font-size: 0.95rem;
93
+ line-height: 1.45;
94
+ }
95
+
96
+ /* up to 576 pixels */
97
+ @media only screen and (max-width: 576px) {
98
+ h2 {
99
+ font-size: medium;
100
+ }
101
+ }
102
+
80
103
  `
81
104
  ];
82
105
  }
106
+ openTab(name) {
107
+ store.dispatch(navigateAuth(name));
108
+ }
83
109
  render() {
84
- return html `
85
-
86
- <!-- Page Menu -->
87
- <nav>
88
-
89
- <ul>
90
-
91
- <li>
92
- <button
93
- value="profile"
94
- ?on="${this.profileTopic === 'profile'}">Icon
95
- </button>
96
- </li>
97
-
98
- <li>
99
- <button
100
- value="verification"
101
- ?on="${this.profileTopic === 'verification'}">Profile
102
- </button>
103
- </li>
104
-
105
- <li>
106
- <button
107
- value="password"
108
- ?on="${this.profileTopic === 'password'}">Password
109
- </button>
110
- </li>
111
-
112
- <li>
113
- <button
114
- value="delete"
115
- ?on="${this.profileTopic === 'delete'}">Delete
116
- </button>
117
- </li>
118
-
119
- </ul>
120
-
121
- </nav>
122
-
123
-
124
- <div class= "wrapper">
125
- <div class= "inner">
126
-
127
-
128
- <!-- Page 1: Profile -->
129
- <section
130
- class="content ${this.profileTopic === 'profile' ? 'opened' : 'closed'}">
131
-
132
- <!-- Display Username -->
133
- <h2>${this.name}</h2>
134
-
135
- <!-- Custom Image Element - Display / Upload -->
136
- <contact-photo emptyArtwork="${this.empty}"></contact-photo>
137
-
138
- </section>
139
-
140
- <!-- Page 2: Verification -->
141
- <section
142
- class="content ${this.profileTopic === 'verification' ? 'opened' : 'closed'}">
143
-
144
- <!-- Page Title -->
145
- <h2>Contact Information</h2>
146
-
147
- <!-- Custom - Username -->
148
- <input-name></input-name>
149
-
150
- <!-- Custom - Email -->
151
- <contact-email></contact-email>
152
-
153
- </section>
154
-
155
- <!-- Page 3: Password -->
156
- <section
157
- class="content ${this.profileTopic === 'password' ? 'opened' : 'closed'}">
158
-
159
- <!-- Page Title -->
160
- <h2>Password</h2>
161
-
162
- <!-- Custom - Password -->
163
- <input-password></input-password>
164
-
165
- </section>
166
-
167
- <!-- Page 4: Delete -->
168
- <section
169
- class="content ${this.profileTopic === 'delete' ? 'opened' : 'closed'}">
170
-
171
- <!-- Page Title -->
172
- <h2>Delete Account</h2>
173
-
174
- <!-- Custom - Delete -->
175
- <delete-user></delete-user>
176
-
177
- </section>
178
-
179
- </div>
180
- </div>
181
-
110
+ if (!this.login) {
111
+ return html `
112
+ <p class="signed-out" part="signed-out" role="status">Sign in to change the photo, name, email, or password.</p>
113
+ `;
114
+ }
115
+ const title = accountTitle(this.name, this.email);
116
+ return html `
117
+
118
+ <!-- Page Menu -->
119
+ <nav aria-label="Account" @keydown="${this.onTabKey}">
120
+
121
+ <ul role="tablist">
122
+
123
+ <li>
124
+ <button
125
+ type="button"
126
+ role="tab"
127
+ part="tab"
128
+ value="profile"
129
+ aria-selected="${this.profileTopic === 'profile'}"
130
+ ?on="${this.profileTopic === 'profile'}"
131
+ @click="${() => this.openTab('profile')}">Icon
132
+ </button>
133
+ </li>
134
+
135
+ <li>
136
+ <button
137
+ type="button"
138
+ role="tab"
139
+ part="tab"
140
+ value="verification"
141
+ aria-selected="${this.profileTopic === 'verification'}"
142
+ ?on="${this.profileTopic === 'verification'}"
143
+ @click="${() => this.openTab('verification')}">Profile
144
+ </button>
145
+ </li>
146
+
147
+ <li>
148
+ <button
149
+ type="button"
150
+ role="tab"
151
+ part="tab"
152
+ value="password"
153
+ aria-selected="${this.profileTopic === 'password'}"
154
+ ?on="${this.profileTopic === 'password'}"
155
+ @click="${() => this.openTab('password')}">Password
156
+ </button>
157
+ </li>
158
+
159
+ <li>
160
+ <button
161
+ type="button"
162
+ role="tab"
163
+ part="tab"
164
+ value="delete"
165
+ aria-selected="${this.profileTopic === 'delete'}"
166
+ ?on="${this.profileTopic === 'delete'}"
167
+ @click="${() => this.openTab('delete')}">Delete
168
+ </button>
169
+ </li>
170
+
171
+ </ul>
172
+
173
+ </nav>
174
+
175
+
176
+ <div class= "wrapper">
177
+ <div class= "inner">
178
+
179
+
180
+ <!-- Page 1: Profile -->
181
+ <section
182
+ part="panel"
183
+ role="tabpanel"
184
+ aria-hidden="${this.profileTopic === 'profile' ? 'false' : 'true'}"
185
+ ?inert="${this.profileTopic !== 'profile'}"
186
+ class="content ${this.profileTopic === 'profile' ? 'opened' : 'closed'}">
187
+
188
+ <!-- Display Username -->
189
+ <h2>${title}</h2>
190
+
191
+ <!-- Custom Image Element - Display / Upload -->
192
+ <contact-photo emptyArtwork="${this.empty}" exportparts="progress, file, preview"></contact-photo>
193
+
194
+ </section>
195
+
196
+ <!-- Page 2: Verification -->
197
+ <section
198
+ part="panel"
199
+ role="tabpanel"
200
+ aria-hidden="${this.profileTopic === 'verification' ? 'false' : 'true'}"
201
+ ?inert="${this.profileTopic !== 'verification'}"
202
+ class="content ${this.profileTopic === 'verification' ? 'opened' : 'closed'}">
203
+
204
+ <!-- Page Title -->
205
+ <h2>Contact Information</h2>
206
+
207
+ <!-- Required - unverified notice. Sign-in stays open. -->
208
+ <email-verify exportparts="notice, status: verify-status, submit: verify-submit, verified, unverified"></email-verify>
209
+
210
+ <!-- Custom - Username -->
211
+ <input-name exportparts="name, submit: name-submit"></input-name>
212
+
213
+ <!-- Custom - Email -->
214
+ <contact-email exportparts="email, submit: email-submit"></contact-email>
215
+
216
+ </section>
217
+
218
+ <!-- Page 3: Password -->
219
+ <section
220
+ part="panel"
221
+ role="tabpanel"
222
+ aria-hidden="${this.profileTopic === 'password' ? 'false' : 'true'}"
223
+ ?inert="${this.profileTopic !== 'password'}"
224
+ class="content ${this.profileTopic === 'password' ? 'opened' : 'closed'}">
225
+
226
+ <!-- Page Title -->
227
+ <h2>Password</h2>
228
+
229
+ <!-- Custom - Password -->
230
+ <input-password exportparts="password, verify, submit: password-submit"></input-password>
231
+
232
+ </section>
233
+
234
+ <!-- Page 4: Delete -->
235
+ <section
236
+ part="panel"
237
+ role="tabpanel"
238
+ aria-hidden="${this.profileTopic === 'delete' ? 'false' : 'true'}"
239
+ ?inert="${this.profileTopic !== 'delete'}"
240
+ class="content ${this.profileTopic === 'delete' ? 'opened' : 'closed'}">
241
+
242
+ <!-- Page Title -->
243
+ <h2>Delete Account</h2>
244
+
245
+ <!-- Custom - Delete -->
246
+ <delete-user exportparts="submit: delete"></delete-user>
247
+
248
+ </section>
249
+
250
+ </div>
251
+ </div>
252
+
182
253
  `;
183
254
  }
184
255
  };
@@ -194,6 +265,14 @@ __decorate([
194
265
  state(),
195
266
  __metadata("design:type", Object)
196
267
  ], UserSettings.prototype, "name", void 0);
268
+ __decorate([
269
+ state(),
270
+ __metadata("design:type", Object)
271
+ ], UserSettings.prototype, "email", void 0);
272
+ __decorate([
273
+ state(),
274
+ __metadata("design:type", Object)
275
+ ], UserSettings.prototype, "login", void 0);
197
276
  UserSettings = __decorate([
198
277
  customElement('user-settings'),
199
278
  __metadata("design:paramtypes", [])
@@ -1 +1 @@
1
- {"version":3,"file":"settings.js","sourceRoot":"","sources":["../../../typescript/webcomponents/settings/settings.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,GAAG,EAAkB,IAAI,EAAE,UAAU,EAAE,MAAe,KAAK,CAAC;AACrE,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAgB,mBAAmB,CAAC;AAC7E,OAAO,EAAE,OAAO,EAAE,MAA6B,8BAA8B,CAAC;AAC9E,OAAO,EAAE,KAAK,EAAY,MAAqB,aAAa,CAAC;AAC7D,OAAO,EAAE,YAAY,EAAE,MAAwB,sBAAsB,CAAC;AACtE,OAAO,EAAE,UAAU,EAAE,MAA0B,kBAAkB,CAAC;AAClE,OAAO,kBAAkB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QAAQ;6BACtB,IAAI,CAAC,YAAY,KAAK,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ;;;;;;;;;;;;;KAa7E,CAAA;IACH,CAAC;CAEF,CAAA;AA7OiD;IAA/C,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;;2CAAmB;AAE1C;IAAhB,KAAK,EAAE;;kDAA2B;AAClB;IAAhB,KAAK,EAAE;;0CAAmB;AACV;IAAhB,KAAK,EAAE;;2CAAoB;AACX;IAAhB,KAAK,EAAE;;2CAAuB;AARpB,YAAY;IADxB,aAAa,CAAC,eAAe,CAAC;;GAClB,YAAY,CAgPxB"}
package/firebase.md ADDED
@@ -0,0 +1,107 @@
1
+ # Firebase
2
+
3
+ ## Project
4
+
5
+ - Firebase Authentication with email and password
6
+ - Cloud Storage bucket
7
+ - Google Analytics, if you call `logAccount` or `logAccountDelete`
8
+
9
+ ## Storage rules
10
+
11
+ Storage rules must allow the signed-in user to read and write only `pwa-auth/{uid}/**`.
12
+
13
+ ## Firestore rules
14
+
15
+ Firestore rules allow `users/{uid}` and `contractors/{uid}`, and any other document `deleteDocument` removes, only when the signed-in uid is the document id or the `owner` field. Everything else is denied. The host owns those documents. See [Data ownership](README.md#data-ownership).
16
+
17
+ ## FIREBASE_CONFIG
18
+
19
+ Required. Call `initialize({ config })`, or set `window.process.env.FIREBASE_CONFIG` in a classic script before the module runs. One assignment. A second `window.process = …` replaces the first and drops keys you already set.
20
+
21
+ ```html
22
+ <script>
23
+ window.process = { env: { FIREBASE_CONFIG: JSON.stringify({
24
+ apiKey: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
25
+ authDomain: "xxxxxxx.xxxxxxx.xxx",
26
+ databaseURL: "https://xxxxxxx.xxxxxxx.xxx",
27
+ projectId: "xxxxxxx",
28
+ storageBucket: "xxxxxxx.xxxxxxx.xxx",
29
+ messagingSenderId: "xxxxxxxxxxx",
30
+ appId: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
31
+ measurementId: "xxxxxxxxxxx"
32
+ }) } };
33
+ </script>
34
+ ```
35
+
36
+ `authentication.ts` reads `process.env.FIREBASE_CONFIG` when `apiKey` is present and calls `initialize`. An empty config does not throw. Call `initialize` instead.
37
+
38
+ ## initialize
39
+
40
+ ```javascript
41
+ import { initialize } from 'pwa-auth';
42
+ import { getApp } from 'firebase/app';
43
+
44
+ // Optional - your config
45
+ initialize({
46
+ config: {
47
+ apiKey: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
48
+ authDomain: "xxxxxxx.xxxxxxx.xxx",
49
+ projectId: "xxxxxxx",
50
+ storageBucket: "xxxxxxx.xxxxxxx.xxx",
51
+ messagingSenderId: "xxxxxxxxxxx",
52
+ appId: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
53
+ }
54
+ });
55
+
56
+ // Optional - an app you already created. Omit FIREBASE_CONFIG when you do this.
57
+ initialize({ app: getApp() });
58
+ ```
59
+
60
+ | Export | |
61
+ |---|---|
62
+ | `initialize({ app, config, actionCodeSettings })` | Boot Firebase. `app` is a host app. `config` is a host config. `actionCodeSettings` is optional and is passed to the verification email. The legacy `FIREBASE_CONFIG` script still works. |
63
+
64
+ ## firebase-config attribute
65
+
66
+ Optional. A tag can carry the same JSON. The first element to connect wins, and only when the app is not up yet.
67
+
68
+ ```html
69
+ <user-icon firebase-config='{"apiKey":"...","authDomain":"...","projectId":"..."}'></user-icon>
70
+ ```
71
+
72
+ The first `initialize` wins. A later call with a different app throws.
73
+
74
+ ## actionCodeSettings
75
+
76
+ Optional. `actionCodeSettings` is passed to `sendEmailVerification`. Put the continue URL in `url`. A later `initialize({ actionCodeSettings })` still stores it after the app is up.
77
+
78
+ ```javascript
79
+ initialize({
80
+ config,
81
+ actionCodeSettings: { url: 'https://example.com/continue' }
82
+ });
83
+ ```
84
+
85
+ ## Auth, Firestore, and Storage
86
+
87
+ | Export | |
88
+ |---|---|
89
+ | `auth` | Firebase Auth for this app. Read `auth.currentUser` at call time. |
90
+ | `db` | Firestore. |
91
+ | `storage` | Cloud Storage. |
92
+ | `application` | The Firebase app from `initialize` or from `FIREBASE_CONFIG`. |
93
+ | `firebaseConfig` | The parsed config object. |
94
+
95
+ ## Password
96
+
97
+ Firebase Auth's own minimum is 6 characters. Sign-up and a password change in `<user-settings>` ask for 8 to 128. Spaces and other characters are allowed. There is no requirement for a number or a symbol. The sentence under the field is "At least 8 characters. A passphrase works well." A short password reads "Use at least 8 characters."
98
+
99
+ In the Firebase console, open Authentication and turn on the password policy. Set the minimum to 8 so the server uses the same rule. This package does not change that policy.
100
+
101
+ ## Emulators
102
+
103
+ ```bash
104
+ npm run test:emulator # Auth, Firestore, and Storage emulators, then the browser checks
105
+ ```
106
+
107
+ `npm run test:emulator` uses `firebase-tools` 14.24.0. Firestore and Storage need Java 21 or newer on `PATH`.
package/intro.md ADDED
@@ -0,0 +1,19 @@
1
+ # A short introduction
2
+
3
+ ## What it is
4
+
5
+ pwa-auth is the sign-in for your website. It stays on your site, in your own look. People use an email address and a password. There is one sign-in for the whole page.
6
+
7
+ ## What it does for you
8
+
9
+ Your visitors see a button. Before they sign in it says Login, or Subscribe if you prefer that word. After they sign in it shows their photo.
10
+
11
+ A panel drops down from the top. They can create an account or sign in. Once they are in, they see their name, a link to their settings, and a way to log out.
12
+
13
+ In settings they can change their photo, name, email, and password, or delete the account. Creating an account sends a verification email. They can still sign in before they open that email.
14
+
15
+ They look after that sign-in themselves. Your site keeps the records it creates. This sign-in does not write those records, and deleting an account does not remove them. The files stored for that sign-in are removed with the account.
16
+
17
+ ## How to get started
18
+
19
+ The person who adds this to your site follows the [Quick start](README.md#quick-start). There is also a [live demo](https://pwa-authentic.firebaseapp.com).
package/license CHANGED
@@ -1,21 +1,21 @@
1
- The MIT License (MIT)
2
-
3
- Copyright (c) Jacek Markiewicz <jack.solutionbox@gmail.com> (jackspublishing.com)
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in
13
- all copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
- THE SOFTWARE.
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) Jacek Markiewicz <jack.solutionbox@gmail.com> (jackspublishing.com)
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.