pwa-auth 1.1.6 → 1.2.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 (35) hide show
  1. package/README.md +70 -34
  2. package/demo/index.html +1 -1
  3. package/deploy/css/form/button.js +1 -1
  4. package/deploy/css/form/input.js +1 -1
  5. package/deploy/css/form/label.d.ts.map +1 -1
  6. package/deploy/css/form/label.js +2 -1
  7. package/deploy/custom-elements/drawer/css/drawer.d.ts.map +1 -1
  8. package/deploy/custom-elements/drawer/css/drawer.js +0 -1
  9. package/deploy/custom-elements/drawer/css/exit.d.ts.map +1 -1
  10. package/deploy/custom-elements/drawer/css/exit.js +3 -2
  11. package/deploy/custom-elements/drawer/drawer.d.ts +2 -1
  12. package/deploy/custom-elements/drawer/drawer.d.ts.map +1 -1
  13. package/deploy/custom-elements/drawer/drawer.js +17 -12
  14. package/deploy/custom-elements/drawer/input/login.js +1 -1
  15. package/deploy/custom-elements/drawer/input/sign-up.d.ts.map +1 -1
  16. package/deploy/custom-elements/drawer/input/sign-up.js +0 -1
  17. package/deploy/custom-elements/icon/css/icon.js +1 -1
  18. package/deploy/custom-elements/icon/icon.js +0 -1
  19. package/deploy/custom-elements/settings/css/navigation.js +2 -2
  20. package/deploy/custom-elements/settings/input/delete.d.ts +1 -0
  21. package/deploy/custom-elements/settings/input/delete.d.ts.map +1 -1
  22. package/deploy/custom-elements/settings/input/delete.js +10 -1
  23. package/deploy/custom-elements/settings/input/name.js +1 -1
  24. package/deploy/custom-elements/settings/input/uploader.d.ts +4 -0
  25. package/deploy/custom-elements/settings/input/uploader.d.ts.map +1 -1
  26. package/deploy/custom-elements/settings/input/uploader.js +41 -1
  27. package/deploy/custom-elements/settings/settings.d.ts.map +1 -1
  28. package/deploy/custom-elements/settings/settings.js +7 -0
  29. package/deploy/redux/frontend.d.ts.map +1 -1
  30. package/deploy/start.js +0 -1
  31. package/npm/pwa-auth.js +306 -0
  32. package/package.json +1 -1
  33. package/deploy/custom-elements/settings/css/uploader.d.ts +0 -2
  34. package/deploy/custom-elements/settings/css/uploader.d.ts.map +0 -1
  35. package/deploy/custom-elements/settings/css/uploader.js +0 -40
package/README.md CHANGED
@@ -9,7 +9,6 @@ This library provides Identity Access Managementy to securely store user's data.
9
9
 
10
10
  ## Module JavaScript
11
11
  ```javascript
12
- /* To do: Bare Module Specifiers - Currently: Absolute / Relative */
13
12
  import 'pwa-auth';
14
13
  ```
15
14
 
@@ -53,18 +52,23 @@ import 'pwa-auth';
53
52
  ### `<user-settings>`
54
53
  - 1 Photo Upload
55
54
  - Unavailable Photo
55
+ - Update Username
56
+ - Update Email / Verify
57
+ - Update Password
56
58
  - Delete Account
57
59
 
58
60
  # Website Setup:
59
61
  ```html
60
62
  <header>
61
- <!-- Indicate the 'register' boolean for 'subscribe state' -->
62
- <!-- else 'login state' -->
63
+ <!-- register: Indicate the 'register' boolean for 'subscribe state' -->
64
+ <!-- register: else 'login state' -->
63
65
  <user-icon register></user-icon>
64
66
  </header>
65
67
 
66
- <!-- Indicate where the <pwa-settings> Tag will be Paged-->
67
- <user-drawer url="/settings"></user-drawer>
68
+ <!-- url: Indicate where the <pwa-settings> Tag will be Paged-->
69
+ <!-- register: Indicate the 'register' boolean for 'subscribe state' -->
70
+ <!-- register: else 'login state' -->
71
+ <user-drawer register url="/settings"></user-drawer>
68
72
 
69
73
  <main>
70
74
  <user-settings></user-settings>
@@ -75,31 +79,6 @@ import 'pwa-auth';
75
79
  <script src="pwa-auth.js"></script>
76
80
  ```
77
81
 
78
- ## Google Setup
79
- - Google Analytics
80
- - Firebase Project
81
-
82
- ## Firebase Setup
83
- - Authentication - email
84
- - Cloud Firestore - database
85
- - Cloud Storage
86
-
87
- ```javascript
88
- // Initialize Firebase
89
- let connect = {
90
- apiKey: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
91
- authDomain: "xxxxxxx.xxxxxxx.xxx",
92
- databaseURL: "https://xxxxxxx.xxxxxxx.xxx",
93
- projectId: "xxxxxxx",
94
- storageBucket: "xxxxxxx.xxxxxxx.xxx",
95
- messagingSenderId: "xxxxxxxxxxx",
96
- appId: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
97
- measurementId: "xxxxxxxxxxx"
98
- };
99
-
100
- if (lolalhost) { connect = { /* etc. */ } }
101
- ```
102
-
103
82
  ## CSS Default Custom Properties
104
83
  | CSS Custom Property | Description | Default | Custom Element |
105
84
  | :--- | ---: | :---: | :--- |
@@ -119,12 +98,43 @@ if (lolalhost) { connect = { /* etc. */ } }
119
98
  | --pwa_icon_hover | Input | lightgrey | Icon |
120
99
 
121
100
  ```html
122
- <!-- CSS: Custom Variables: <head> tag -->
101
+ <!-- CSS: Custom Variables -->
102
+ <!-- Place this txt into your document -->
123
103
  <style>
124
104
 
125
105
  :root {
126
- --pwa_divider: grey;
127
- /* etc. */
106
+
107
+ --pwa_settings_background: white;
108
+
109
+ /* Top Border Color */
110
+ --pwa_divider: grey;
111
+
112
+ /* Section Header Color */
113
+ --pwa_section_header: black;
114
+
115
+ /* Navigation Colors */
116
+ --pwa_nav_button: grey;
117
+ --pwa_nav_select: black;
118
+
119
+ /* Label Color */
120
+ --pwa_label_text_color: black;
121
+
122
+ /* Input Colors */
123
+ --pwa_input_background: #E1E5EB;
124
+
125
+ /* Button Colors */
126
+ --pwa_action_text_color: #fff;
127
+ --pwa_action_background_color: #6cc04a;
128
+ --pwa_action_border_color: #60b23e;
129
+
130
+ /* Drawer Colors */
131
+ --pwa_drawer_text_color: #303030;
132
+ --pwa_drawer_background_color: #fff;
133
+
134
+ /* Icon Colors */
135
+ --pwa_icon_background: #6cc04a;
136
+ --pwa_icon_hover: lightgrey;
137
+
128
138
  }
129
139
 
130
140
  /* Dark Theme */
@@ -136,7 +146,33 @@ if (lolalhost) { connect = { /* etc. */ } }
136
146
  </style>
137
147
  ```
138
148
 
149
+ ## Google Setup
150
+ - Google Analytics
151
+ - Firebase Project
152
+
153
+ ## Firebase Setup
154
+ - Authentication - email
155
+ - Cloud Firestore - database
156
+ - Cloud Storage
157
+
158
+ ```javascript
159
+ // Initialize Firebase
160
+ let connect = {
161
+ apiKey: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
162
+ authDomain: "xxxxxxx.xxxxxxx.xxx",
163
+ databaseURL: "https://xxxxxxx.xxxxxxx.xxx",
164
+ projectId: "xxxxxxx",
165
+ storageBucket: "xxxxxxx.xxxxxxx.xxx",
166
+ messagingSenderId: "xxxxxxxxxxx",
167
+ appId: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
168
+ measurementId: "xxxxxxxxxxx"
169
+ };
170
+
171
+ if (lolalhost) { connect = { /* etc. */ } }
172
+ ```
173
+
139
174
  # Feedback
140
175
  All feedback, comments, bugs, and requests are welcome.
141
176
  * [Jack's Publishing](https://www.jackspublishing.com)
142
- * [contractor's centre](https://www.contractorscentre.com)
177
+ * [contractor's centre](https://www.contractorscentre.com)
178
+ * [Node Package Manager](https://www.npmjs.com/package/pwa-auth)
package/demo/index.html CHANGED
@@ -45,7 +45,7 @@
45
45
  <header><user-icon register></user-icon></header>
46
46
 
47
47
  <!-- Drawer -->
48
- <user-drawer url="/demo/settings"></user-drawer>
48
+ <user-drawer register url="/demo/settings"></user-drawer>
49
49
 
50
50
  <!-- Settings -->
51
51
  <main><user-settings></user-settings></main>
@@ -7,7 +7,7 @@ export const buttonStyle = css `
7
7
  display: inline-block;
8
8
  box-sizing: border-box;
9
9
  white-space: nowrap;
10
- margin: 10px 3px 10px auto;
10
+ margin: 16px 16px 16px auto;
11
11
  font-weight: 400;
12
12
  text-align: center;
13
13
  vertical-align: middle;
@@ -9,7 +9,7 @@ export const inputStyle = css `
9
9
  -webkit-box-sizing: border-box;
10
10
  height: 50px;
11
11
  text-align: left;
12
- margin: 0 3px 0 3px;
12
+ margin: 0 16px 0 16px;
13
13
  padding: 8px 16px;
14
14
  background-color: var(--pwa_input_background);
15
15
  border: 0;
@@ -1 +1 @@
1
- {"version":3,"file":"label.d.ts","sourceRoot":"","sources":["../../../src/css/form/label.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,SAAS,EAAE,MAAM,KAAK,CAAC;AAErC,eAAO,MAAM,UAAU,EAAG,SAqBzB,CAAC"}
1
+ {"version":3,"file":"label.d.ts","sourceRoot":"","sources":["../../../src/css/form/label.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,SAAS,EAAE,MAAM,KAAK,CAAC;AAErC,eAAO,MAAM,UAAU,EAAG,SAsBzB,CAAC"}
@@ -11,7 +11,8 @@ export const labelStyle = css `
11
11
  margin: auto;
12
12
  margin-bottom: 0;
13
13
  font-weight: bold;
14
- line-height: 36px;
14
+ line-height: 36px;
15
+ padding: 0 16px;
15
16
  }
16
17
 
17
18
  @media (max-width: 460px) {
@@ -1 +1 @@
1
- {"version":3,"file":"drawer.d.ts","sourceRoot":"","sources":["../../../../src/custom-elements/drawer/css/drawer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,SAAS,EAAE,MAAM,KAAK,CAAC;AAErC,eAAO,MAAM,WAAW,EAAE,SAczB,CAAC"}
1
+ {"version":3,"file":"drawer.d.ts","sourceRoot":"","sources":["../../../../src/custom-elements/drawer/css/drawer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,SAAS,EAAE,MAAM,KAAK,CAAC;AAErC,eAAO,MAAM,WAAW,EAAE,SAazB,CAAC"}
@@ -7,7 +7,6 @@ export const drawerStyle = css `
7
7
  margin: 16px auto auto auto;
8
8
  background-color: var(--pwa_drawer_background_color);
9
9
  color: var(--pwa_drawer_text_color);
10
- padding: 8px 18px;
11
10
  box-sizing: border-box;
12
11
  border: 3px #303030 solid;
13
12
  border-radius: 20px;
@@ -1 +1 @@
1
- {"version":3,"file":"exit.d.ts","sourceRoot":"","sources":["../../../../src/custom-elements/drawer/css/exit.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,SAAS,EAAE,MAAM,KAAK,CAAC;AAErC,eAAO,MAAM,SAAS,EAAE,SA4CvB,CAAC"}
1
+ {"version":3,"file":"exit.d.ts","sourceRoot":"","sources":["../../../../src/custom-elements/drawer/css/exit.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,SAAS,EAAE,MAAM,KAAK,CAAC;AAErC,eAAO,MAAM,SAAS,EAAE,SA6CvB,CAAC"}
@@ -4,6 +4,7 @@ export const exitStyle = css `
4
4
  .exit {
5
5
  display: grid;
6
6
  grid-template-columns: 80px 1fr 80px;
7
+ padding: 16px;
7
8
  }
8
9
 
9
10
  .exit > h3 {
@@ -34,8 +35,8 @@ export const exitStyle = css `
34
35
  }
35
36
 
36
37
  .close {
37
- height: 36px;
38
- width: 36px;
38
+ height: 30px;
39
+ width: 42px;
39
40
  margin: auto;
40
41
  background-color: transparent;
41
42
  border: 0px;
@@ -18,12 +18,13 @@ declare const UserDrawer_base: (new (...args: any[]) => {
18
18
  export declare class UserDrawer extends UserDrawer_base {
19
19
  private url;
20
20
  drawer: boolean;
21
+ register: boolean;
21
22
  private _name;
22
23
  private _log;
23
24
  private _sign;
24
25
  constructor();
25
- protected firstUpdated(): void;
26
26
  stateChanged(state: AppState): void;
27
+ protected firstUpdated(): void;
27
28
  static get styles(): CSSResultArray;
28
29
  protected render(): import("lit-html").TemplateResult<1>;
29
30
  }
@@ -1 +1 @@
1
- {"version":3,"file":"drawer.d.ts","sourceRoot":"","sources":["../../../src/custom-elements/drawer/drawer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,cAAc,EAAQ,UAAU,EAAE,MAAoB,KAAK,CAAC;AAG1E,OAAO,EAAS,QAAQ,EAAE,MAAqB,aAAa,CAAC;AAc7D,OAAO,eAAe,CAAC;AACvB,OAAO,iBAAiB,CAAC;;;;;;;;;;;;;;AAEzB,qBACa,UAAW,SAAQ,eAA0B;IAGf,OAAO,CAAC,GAAG,CAAM;IAGO,MAAM,UAAS;IAEvE,OAAO,CAAC,KAAK,CAAa;IAC1B,OAAO,CAAC,IAAI,CAAiB;IAC7B,OAAO,CAAC,KAAK,CAAgB;;IAItC,SAAS,CAAC,YAAY;IAatB,YAAY,CAAC,KAAK,EAAE,QAAQ;IAO5B,MAAM,KAAK,MAAM,IAAI,cAAc,CA+BhC;IAEH,SAAS,CAAC,MAAM;CAgDjB;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC3B,aAAa,EAAE,UAAU,CAAC;KAC7B;CACF"}
1
+ {"version":3,"file":"drawer.d.ts","sourceRoot":"","sources":["../../../src/custom-elements/drawer/drawer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,cAAc,EAAQ,UAAU,EAAE,MAAoB,KAAK,CAAC;AAG1E,OAAO,EAAS,QAAQ,EAAE,MAAqB,aAAa,CAAC;AAc7D,OAAO,eAAe,CAAC;AACvB,OAAO,iBAAiB,CAAC;;;;;;;;;;;;;;AAEzB,qBACa,UAAW,SAAQ,eAA0B;IAGf,OAAO,CAAC,GAAG,CAAM;IAGO,MAAM,UAAS;IAGf,QAAQ,UAAS;IAEzE,OAAO,CAAC,KAAK,CAAa;IAC1B,OAAO,CAAC,IAAI,CAAiB;IAC7B,OAAO,CAAC,KAAK,CAAgB;;IAMtC,YAAY,CAAC,KAAK,EAAE,QAAQ;IAO5B,SAAS,CAAC,YAAY;IAatB,MAAM,KAAK,MAAM,IAAI,cAAc,CA+BhC;IAEH,SAAS,CAAC,MAAM;CAiDjB;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC3B,aAAa,EAAE,UAAU,CAAC;KAC7B;CACF"}
@@ -25,10 +25,17 @@ let UserDrawer = class UserDrawer extends connect(store)(LitElement) {
25
25
  super();
26
26
  this.url = '';
27
27
  this.drawer = false;
28
+ this.register = false;
28
29
  this._name = "";
29
30
  this._log = false;
30
31
  this._sign = false;
31
32
  }
33
+ stateChanged(state) {
34
+ this._name = state.backend.name;
35
+ this.drawer = state.frontend.drawer;
36
+ this._log = state.frontend.login;
37
+ this._sign = state.frontend.register;
38
+ }
32
39
  firstUpdated() {
33
40
  this.shadowRoot.querySelector('.close').addEventListener('click', () => {
34
41
  store.dispatch(toggleSign());
@@ -40,12 +47,6 @@ let UserDrawer = class UserDrawer extends connect(store)(LitElement) {
40
47
  store.dispatch(toggleSign());
41
48
  });
42
49
  }
43
- stateChanged(state) {
44
- this._name = state.backend.name;
45
- this.drawer = state.frontend.drawer;
46
- this._log = state.frontend.login;
47
- this._sign = state.frontend.register;
48
- }
49
50
  static get styles() {
50
51
  return [
51
52
  show,
@@ -84,16 +85,16 @@ let UserDrawer = class UserDrawer extends connect(store)(LitElement) {
84
85
  return html `
85
86
 
86
87
  <!-- Drawer Wrapper -->
87
- <div
88
+ <section
88
89
  class=" userDrawer"
89
90
  ?on="${this.drawer === true}">
90
91
 
91
92
  <!-- Exit Button -->
92
- <div class="exit">
93
+ <header class="exit">
93
94
  <div></div>
94
95
  <h3>${this._log ? this._name + " : Logged-in" : "SUBSCRIBE"}</h3>
95
96
  <button class="close">${close}</button>
96
- </div>
97
+ </header>
97
98
 
98
99
  <!-- Logged-out State -->
99
100
  <div
@@ -103,12 +104,13 @@ let UserDrawer = class UserDrawer extends connect(store)(LitElement) {
103
104
  <!-- Log-in State -->
104
105
  <user-log-in
105
106
  class="spec"
106
- ?on="${this._sign === true}"></user-log-in>
107
+
108
+ ?on="${true === this._sign ? !this.register : this.register}"></user-log-in>
107
109
 
108
110
  <!-- Sign-up State -->
109
111
  <user-sign-up
110
112
  class="spec"
111
- ?on="${this._sign === false}"></user-sign-up>
113
+ ?on="${false === this._sign ? !this.register : this.register}"></user-sign-up>
112
114
 
113
115
  </div>
114
116
 
@@ -123,7 +125,7 @@ let UserDrawer = class UserDrawer extends connect(store)(LitElement) {
123
125
 
124
126
  </div>
125
127
 
126
- </div>
128
+ </section>
127
129
 
128
130
  `;
129
131
  }
@@ -134,6 +136,9 @@ __decorate([
134
136
  __decorate([
135
137
  property({ type: Boolean, attribute: true, reflect: true })
136
138
  ], UserDrawer.prototype, "drawer", void 0);
139
+ __decorate([
140
+ property({ type: Boolean, attribute: true, reflect: true })
141
+ ], UserDrawer.prototype, "register", void 0);
137
142
  __decorate([
138
143
  state()
139
144
  ], UserDrawer.prototype, "_name", void 0);
@@ -21,7 +21,7 @@ let UserLogIn = class UserLogIn extends LitElement {
21
21
  this.password = '';
22
22
  this.signIn = async (email, password) => {
23
23
  const authCredential = EmailAuthProvider.credential(email, password);
24
- await signInWithCredential(auth, authCredential).then((credentials) => { console.log(credentials); }).catch((error) => { console.log(error); });
24
+ await signInWithCredential(auth, authCredential).catch((error) => { console.log(error); });
25
25
  };
26
26
  }
27
27
  static get styles() {
@@ -1 +1 @@
1
- {"version":3,"file":"sign-up.d.ts","sourceRoot":"","sources":["../../../../src/custom-elements/drawer/input/sign-up.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,UAAU,EAAE,MAAoB,KAAK,CAAC;AAa1D,qBACa,UAAW,SAAQ,UAAU;IAE/B,OAAO,CAAC,KAAK,CAAa;IAC1B,OAAO,CAAC,QAAQ,CAAU;;IAInC,MAAM,KAAK,MAAM,8BAad;IAEH,SAAS,CAAC,MAAM;IAkDhB,OAAO,CAAC,MAAM;IAKd,OAAO,CAAC,aAAa;IAKrB,OAAO,CAAC,WAAW;IAMnB,OAAO,CAAC,cAAc;IAMtB,OAAO,CAAC,MAAM;IAOd,OAAO,CAAC,UAAU,CAiBjB;CAeF;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC3B,cAAc,EAAE,UAAU,CAAC;KAC9B;CACF"}
1
+ {"version":3,"file":"sign-up.d.ts","sourceRoot":"","sources":["../../../../src/custom-elements/drawer/input/sign-up.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,UAAU,EAAE,MAAe,KAAK,CAAC;AAarD,qBACa,UAAW,SAAQ,UAAU;IAE/B,OAAO,CAAC,KAAK,CAAa;IAC1B,OAAO,CAAC,QAAQ,CAAU;;IAInC,MAAM,KAAK,MAAM,8BAad;IAEH,SAAS,CAAC,MAAM;IAkDhB,OAAO,CAAC,MAAM;IAKd,OAAO,CAAC,aAAa;IAKrB,OAAO,CAAC,WAAW;IAMnB,OAAO,CAAC,cAAc;IAMtB,OAAO,CAAC,MAAM;IAOd,OAAO,CAAC,UAAU,CAiBjB;CAeF;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC3B,cAAc,EAAE,UAAU,CAAC;KAC9B;CACF"}
@@ -22,7 +22,6 @@ let UserSignUp = class UserSignUp extends LitElement {
22
22
  this.newAccount = async (email, password) => {
23
23
  await createUserWithEmailAndPassword(auth, email, password)
24
24
  .then((userCredential) => {
25
- console.log("User created: ", userCredential.user);
26
25
  const user = userCredential.user;
27
26
  sendEmailVerification(user)
28
27
  .then(() => {
@@ -9,7 +9,6 @@ export const iconStyles = css `
9
9
 
10
10
  /* Shared Styles */
11
11
  .icon, .login {
12
- height: 40px;
13
12
  cursor: pointer;
14
13
  margin: auto;
15
14
  overflow: hidden;
@@ -25,6 +24,7 @@ export const iconStyles = css `
25
24
 
26
25
  /* The Icon Button */
27
26
  .icon {
27
+ height: 40px;
28
28
  width: 40px;
29
29
 
30
30
  border-radius: 50%;
@@ -19,7 +19,6 @@ let UserIcon = class UserIcon extends connect(store)(LitElement) {
19
19
  }
20
20
  firstUpdated() {
21
21
  this.shadowRoot.querySelector('button').addEventListener('click', () => {
22
- console.log('logged-in: ', this._user);
23
22
  store.dispatch(toggleSign());
24
23
  });
25
24
  }
@@ -47,13 +47,13 @@ export const navigation = css `
47
47
 
48
48
  }
49
49
 
50
- /* Navigation Button - Media Text Justification */
50
+ /* Navigation Button - Media Text Justification
51
51
  @media (max-width: 460px) {
52
52
 
53
53
  button[value=profile], button[value=email] { text-align: left; }
54
54
  button[value=delete], button[value=password] { text-align: right; }
55
55
 
56
- }
56
+ }*/
57
57
 
58
58
  section[on] { display: grid; }
59
59
  section { display: none; }
@@ -15,6 +15,7 @@ declare const DeleteUser_base: (new (...args: any[]) => {
15
15
  }) & typeof LitElement;
16
16
  export declare class DeleteUser extends DeleteUser_base {
17
17
  private login;
18
+ private email;
18
19
  constructor();
19
20
  protected firstUpdated(): void;
20
21
  stateChanged(state: AppState): void;
@@ -1 +1 @@
1
- {"version":3,"file":"delete.d.ts","sourceRoot":"","sources":["../../../../src/custom-elements/settings/input/delete.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,UAAU,EAAa,MAAM,KAAK,CAAC;AAG5D,OAAc,EAAE,QAAQ,EAAE,MAAS,gBAAgB,CAAC;;;;;;;;;;;;;;AAIpD,qBAAa,UAAW,SAAQ,eAA0B;IAE/C,OAAO,CAAC,KAAK,CAAmB;;IAIzC,SAAS,CAAC,YAAY;IAQtB,YAAY,CAAC,KAAK,EAAE,QAAQ;IAI5B,MAAM,KAAK,MAAM,IAAI,cAAc,CAS3B;IAER,MAAM;IAaN,OAAO,CAAC,WAAW;IACnB,OAAO,CAAC,UAAU;IAOlB,OAAO,CAAC,cAAc,CAQpB;CAEH;AAID,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,aAAa,EAAE,UAAU,CAAC;KAC3B;CACF"}
1
+ {"version":3,"file":"delete.d.ts","sourceRoot":"","sources":["../../../../src/custom-elements/settings/input/delete.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,UAAU,EAAa,MAAM,KAAK,CAAC;AAG5D,OAAc,EAAE,QAAQ,EAAE,MAAS,gBAAgB,CAAC;;;;;;;;;;;;;;AAIpD,qBAAa,UAAW,SAAQ,eAA0B;IAE/C,OAAO,CAAC,KAAK,CAAmB;IAChC,OAAO,CAAC,KAAK,CAAc;;IAIpC,SAAS,CAAC,YAAY;IAQtB,YAAY,CAAC,KAAK,EAAE,QAAQ;IAK5B,MAAM,KAAK,MAAM,IAAI,cAAc,CAa3B;IAER,MAAM;IAaN,OAAO,CAAC,WAAW;IACnB,OAAO,CAAC,UAAU;IAOlB,OAAO,CAAC,cAAc,CAQpB;CAEH;AAID,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,aAAa,EAAE,UAAU,CAAC;KAC3B;CACF"}
@@ -14,6 +14,7 @@ export class DeleteUser extends connect(store)(LitElement) {
14
14
  constructor() {
15
15
  super();
16
16
  this.login = false;
17
+ this.email = '';
17
18
  this.officialDelete = async () => {
18
19
  if (auth.currentUser) {
19
20
  return auth.currentUser.delete().then(() => { }).catch(() => { });
@@ -30,6 +31,7 @@ export class DeleteUser extends connect(store)(LitElement) {
30
31
  }
31
32
  stateChanged(state) {
32
33
  this.login = state.frontend.login;
34
+ this.email = state.backend.email;
33
35
  }
34
36
  static get styles() {
35
37
  return [
@@ -41,13 +43,17 @@ export class DeleteUser extends connect(store)(LitElement) {
41
43
  grid-template-rows: auto auto;
42
44
  }
43
45
 
46
+ p {
47
+ padding: 0 16px;
48
+ }
49
+
44
50
  `
45
51
  ];
46
52
  }
47
53
  render() {
48
54
  return html `
49
55
 
50
- <p>Permanently delete the user account and data related to:</p>
56
+ <p>Permanently delete the user account and data related to: ${this.email}</p>
51
57
 
52
58
  <button
53
59
  class="action-button deleteUser"
@@ -75,4 +81,7 @@ export class DeleteUser extends connect(store)(LitElement) {
75
81
  __decorate([
76
82
  state()
77
83
  ], DeleteUser.prototype, "login", void 0);
84
+ __decorate([
85
+ state()
86
+ ], DeleteUser.prototype, "email", void 0);
78
87
  customElements.define('delete-user', DeleteUser);
@@ -35,7 +35,7 @@ export class InputName extends connect(store)(LitElement) {
35
35
  }
36
36
  stateChanged(state) {
37
37
  this.login = state.frontend.login;
38
- this.value = state.frontend.name;
38
+ this.value = state.backend.name;
39
39
  }
40
40
  static get styles() {
41
41
  return [
@@ -17,6 +17,10 @@ export declare class ContactPhoto extends ContactPhoto_base {
17
17
  photo: string | void | any;
18
18
  private user;
19
19
  private login;
20
+ private progress;
21
+ private downloadURL;
22
+ private error;
23
+ private status;
20
24
  constructor();
21
25
  stateChanged(state: AppState): void;
22
26
  static get styles(): CSSResultArray;
@@ -1 +1 @@
1
- {"version":3,"file":"uploader.d.ts","sourceRoot":"","sources":["../../../../src/custom-elements/settings/input/uploader.ts"],"names":[],"mappings":"AACA,OAAO,EAAa,UAAU,EAAE,cAAc,EAAE,MAAQ,KAAK,CAAC;AAE9D,OAAO,EAAS,QAAQ,EAAE,MAAe,gBAAgB,CAAC;;;;;;;;;;;;;;AAQ1D,qBAAa,YAAa,SAAQ,iBAA0B;IAGvC,KAAK,EAAG,MAAM,GAAG,IAAI,GAAG,GAAG,CAAM;IAE3C,OAAO,CAAC,IAAI,CAAsB;IAClC,OAAO,CAAC,KAAK,CAAmB;;IAMzC,YAAY,CAAC,KAAK,EAAE,QAAQ;IAU5B,MAAM,KAAK,MAAM,IAAG,cAAc,CAwBjC;IAED,SAAS,CAAC,MAAM;IAsEhB,OAAO,CAAC,oBAAoB;YAed,SAAS;IAmHvB,OAAO,CAAC,aAAa,CAYpB;CAEF;AAID,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC3B,eAAe,EAAE,YAAY,CAAC;KACjC;CACF"}
1
+ {"version":3,"file":"uploader.d.ts","sourceRoot":"","sources":["../../../../src/custom-elements/settings/input/uploader.ts"],"names":[],"mappings":"AACA,OAAO,EAAa,UAAU,EAAE,cAAc,EAAE,MAAQ,KAAK,CAAC;AAE9D,OAAO,EAAS,QAAQ,EAAE,MAAe,gBAAgB,CAAC;;;;;;;;;;;;;;AAQ1D,qBAAa,YAAa,SAAQ,iBAA0B;IAGvC,KAAK,EAAG,MAAM,GAAG,IAAI,GAAG,GAAG,CAAM;IAE3C,OAAO,CAAC,IAAI,CAAsB;IAClC,OAAO,CAAC,KAAK,CAAmB;IAIhC,OAAO,CAAC,QAAQ,CAAa;IAC7B,OAAO,CAAC,WAAW,CAAc;IACjC,OAAO,CAAC,KAAK,CAAc;IAC3B,OAAO,CAAC,MAAM,CAAc;;IAWrC,YAAY,CAAC,KAAK,EAAE,QAAQ;IAU5B,MAAM,KAAK,MAAM,IAAG,cAAc,CAwBjC;IAED,SAAS,CAAC,MAAM;IA2EhB,OAAO,CAAC,oBAAoB;YAed,SAAS;IAsIvB,OAAO,CAAC,aAAa,CAYpB;CAEF;AAID,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC3B,eAAe,EAAE,YAAY,CAAC;KACjC;CACF"}
@@ -19,12 +19,20 @@ export class ContactPhoto extends connect(store)(LitElement) {
19
19
  this.photo = '';
20
20
  this.user = '';
21
21
  this.login = false;
22
+ this.progress = 0;
23
+ this.downloadURL = '';
24
+ this.error = '';
25
+ this.status = '';
22
26
  this.dispatchPhoto = async (url) => {
23
27
  if (auth.currentUser) {
24
28
  await updateProfile(auth.currentUser, { photoURL: url }).catch((error) => { console.log(error); });
25
29
  store.dispatch(accImage(url));
26
30
  }
27
31
  };
32
+ this.progress = 0;
33
+ this.downloadURL = '';
34
+ this.error = '';
35
+ this.status = '';
28
36
  }
29
37
  stateChanged(state) {
30
38
  this.login = state.frontend.login;
@@ -76,6 +84,8 @@ export class ContactPhoto extends connect(store)(LitElement) {
76
84
  margin: auto;
77
85
  "></label>
78
86
 
87
+
88
+
79
89
  <!-- Input - Upload Image -->
80
90
  <input
81
91
  id ="photoURL"
@@ -96,6 +106,7 @@ export class ContactPhoto extends connect(store)(LitElement) {
96
106
  style="
97
107
  border: 2px dashed;
98
108
  border-radius: 6px;
109
+ overflow: hidden;
99
110
  padding: 0 16px 16px 16px;
100
111
  "
101
112
  for ="photoURL">Photo:
@@ -117,6 +128,8 @@ export class ContactPhoto extends connect(store)(LitElement) {
117
128
  </canvas>
118
129
 
119
130
  </label>
131
+
132
+ <p style="text-align:center;">${this.status}</p>
120
133
  `;
121
134
  }
122
135
  appendToFileLocation(filePath, appendString) {
@@ -130,6 +143,8 @@ export class ContactPhoto extends connect(store)(LitElement) {
130
143
  async saveImage() {
131
144
  const uploader = this.shadowRoot.querySelector('.uploader');
132
145
  if (auth.currentUser) {
146
+ this.error = '';
147
+ this.status = 'Uploading...';
133
148
  const file = this.shadowRoot.querySelector('#photoURL');
134
149
  if (!file) {
135
150
  console.error('No file selected');
@@ -147,6 +162,16 @@ export class ContactPhoto extends connect(store)(LitElement) {
147
162
  };
148
163
  const uploadTask = uploadBytesResumable(location, file.files[0], newMetadata);
149
164
  uploadTask.on('state_changed', (snapshot) => {
165
+ this.progress = (snapshot.bytesTransferred / snapshot.totalBytes) * 100;
166
+ this.status = `Upload is ${Math.round(this.progress)}% done`;
167
+ switch (snapshot.state) {
168
+ case 'paused':
169
+ this.status = 'Upload is paused';
170
+ break;
171
+ case 'running':
172
+ this.status = `Upload is running (${Math.round(this.progress)}%)`;
173
+ break;
174
+ }
150
175
  let progress = 0;
151
176
  if (snapshot.totalBytes > 0) {
152
177
  progress = (snapshot.bytesTransferred / snapshot.totalBytes) * 100;
@@ -160,11 +185,13 @@ export class ContactPhoto extends connect(store)(LitElement) {
160
185
  uploader.textContent = '0%';
161
186
  }
162
187
  }, (error) => {
188
+ this.error = `Upload failed: ${error.message}`;
189
+ this.status = '';
163
190
  console.error('Upload failed:', error);
164
191
  uploader.value = 0;
165
192
  uploader.textContent = 'Error';
166
193
  }, async () => {
167
- getDownloadURL(uploadTask.snapshot.ref)
194
+ await getDownloadURL(uploadTask.snapshot.ref)
168
195
  .then((url) => {
169
196
  updateMetadata(location, newMetadata)
170
197
  .then(() => { }).catch((error) => { console.log("error: ", error); });
@@ -173,6 +200,7 @@ export class ContactPhoto extends connect(store)(LitElement) {
173
200
  uploader.value = 100;
174
201
  uploader.textContent = 'Complete';
175
202
  });
203
+ this.status = 'User profile updated successfully!';
176
204
  this.dispatchPhoto(url);
177
205
  }).catch(() => { });
178
206
  });
@@ -188,4 +216,16 @@ __decorate([
188
216
  __decorate([
189
217
  state()
190
218
  ], ContactPhoto.prototype, "login", void 0);
219
+ __decorate([
220
+ state()
221
+ ], ContactPhoto.prototype, "progress", void 0);
222
+ __decorate([
223
+ state()
224
+ ], ContactPhoto.prototype, "downloadURL", void 0);
225
+ __decorate([
226
+ state()
227
+ ], ContactPhoto.prototype, "error", void 0);
228
+ __decorate([
229
+ state()
230
+ ], ContactPhoto.prototype, "status", void 0);
191
231
  customElements.define('contact-photo', ContactPhoto);
@@ -1 +1 @@
1
- {"version":3,"file":"settings.d.ts","sourceRoot":"","sources":["../../../src/custom-elements/settings/settings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,UAAU,EAAE,MAAe,KAAK,CAAC;AAGrD,OAAO,EAAS,QAAQ,EAAE,MAAqB,aAAa,CAAC;AAG7D,OAAO,kBAAkB,CAAC;AAC1B,OAAO,cAAc,CAAC;AACtB,OAAO,eAAe,CAAC;AACvB,OAAO,kBAAkB,CAAC;AAC1B,OAAO,gBAAgB,CAAC;;;;;;;;;;;;;;AAGxB,qBACa,YAAa,SAAQ,iBAA0B;IAEjD,OAAO,CAAC,YAAY,CAAM;IAC1B,OAAO,CAAC,IAAI,CAAM;;IAI3B,SAAS,CAAC,YAAY;IA8BtB,YAAY,CAAC,KAAK,EAAE,QAAQ;IAK5B,MAAM,KAAK,MAAM,8BAkCX;IAEN,SAAS,CAAC,MAAM;CA6FjB;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC3B,eAAe,EAAE,YAAY,CAAC;KACjC;CACF"}
1
+ {"version":3,"file":"settings.d.ts","sourceRoot":"","sources":["../../../src/custom-elements/settings/settings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,UAAU,EAAE,MAAe,KAAK,CAAC;AAGrD,OAAO,EAAS,QAAQ,EAAE,MAAqB,aAAa,CAAC;AAG7D,OAAO,kBAAkB,CAAC;AAC1B,OAAO,cAAc,CAAC;AACtB,OAAO,eAAe,CAAC;AACvB,OAAO,kBAAkB,CAAC;AAC1B,OAAO,gBAAgB,CAAC;;;;;;;;;;;;;;AAGxB,qBACa,YAAa,SAAQ,iBAA0B;IAEjD,OAAO,CAAC,YAAY,CAAM;IAC1B,OAAO,CAAC,IAAI,CAAM;;IAI3B,SAAS,CAAC,YAAY;IA8BtB,YAAY,CAAC,KAAK,EAAE,QAAQ;IAK5B,MAAM,KAAK,MAAM,8BAyCX;IAEN,SAAS,CAAC,MAAM;CA6FjB;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC3B,eAAe,EAAE,YAAY,CAAC;KACjC;CACF"}
@@ -78,6 +78,13 @@ let UserSettings = class UserSettings extends connect(store)(LitElement) {
78
78
  padding: 8px 0;
79
79
  }
80
80
 
81
+ /* up to 576 pixels */
82
+ @media only screen and (max-width: 576px) {
83
+ h2 {
84
+ font-size: medium;
85
+ }
86
+ }
87
+
81
88
  `
82
89
  ];
83
90
  }
@@ -1 +1 @@
1
- {"version":3,"file":"frontend.d.ts","sourceRoot":"","sources":["../../src/redux/frontend.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAe,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAGxC,eAAO,MAAM,YAAY,EAAE,YA0B1B,CAAA;AAGD,eAAO,MAAM,SAAS;+EAKkB,aAAa,CAAC,MAAM,CAAC;2EAsBxB,aAAa,CAAC,OAAO,CAAC;;;;8EAoBvB,aAAa,CAAC,OAAO,CAAC;2EAKtB,aAAa,CAAC,MAAM,CAAC;2EAKpB,aAAa,CAAC,MAAM,CAAC;2EAKxD,CAAC;AAEH,eAAO,MAAQ,YAAY,oFAAE,QAAQ,gFAAE,QAAQ,gFAAE,QAAQ,iFAAE,UAAU,6EAAE,SAAS,4EAAE,YAAY,+EAAE,WAAW,kFAAsB,CAAC;;AAElI,wBAAiC"}
1
+ {"version":3,"file":"frontend.d.ts","sourceRoot":"","sources":["../../src/redux/frontend.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAe,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAGxC,eAAO,MAAM,YAAY,EAAE,YA0B1B,CAAA;AAGD,eAAO,MAAM,SAAS;+EAKkB,aAAa,CAAC,MAAM,CAAC;2EAsBxB,aAAa,CAAC,OAAO,CAAC;;;;8EA0CvB,aAAa,CAAC,OAAO,CAAC;2EAKtB,aAAa,CAAC,MAAM,CAAC;2EAKpB,aAAa,CAAC,MAAM,CAAC;2EAKxD,CAAC;AAEH,eAAO,MAAQ,YAAY,oFAAE,QAAQ,gFAAE,QAAQ,gFAAE,QAAQ,iFAAE,UAAU,6EAAE,SAAS,4EAAE,YAAY,+EAAE,WAAW,kFAAsB,CAAC;;AAElI,wBAAiC"}
package/deploy/start.js CHANGED
@@ -68,7 +68,6 @@ onAuthStateChanged(auth, (user) => {
68
68
  }
69
69
  }
70
70
  else {
71
- console.log('logged out');
72
71
  store.dispatch(userAuth(false));
73
72
  store.dispatch(accID(''));
74
73
  store.dispatch(accName('John Doe'));