pwa-auth 0.0.16 → 1.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +76 -4
- package/README.md +133 -84
- package/demo/index.html +118 -0
- package/demo/styles.css +52 -0
- package/images/empty.jpg +0 -0
- package/license +21 -21
- package/npm/THIRD_PARTY_LICENSES.txt +303 -0
- package/npm/pwa-auth.js +306 -0
- package/package.json +51 -39
- package/deploy/store.js +0 -18
- package/deploy/styles-drawer.js +0 -139
- package/deploy/styles-settings.js +0 -57
- package/deploy/styles.js +0 -88
- package/deploy/user-action.js +0 -69
- package/deploy/user-drawer.js +0 -168
- package/deploy/user-functions.js +0 -191
- package/deploy/user-icon.js +0 -106
- package/deploy/user-reducer.js +0 -41
- package/deploy/user-settings.js +0 -427
- package/images/background.svg +0 -23
- package/images/icon-48x48.png +0 -0
- package/images/npm.svg +0 -85
- package/images/npm007.png +0 -0
- package/index.html +0 -111
- package/launch/application-shell.js +0 -95
- package/launch/package-lock.json +0 -3198
- package/launch/package.json +0 -17
- package/manifest.json +0 -44
- package/polymer.json +0 -24
- package/pwa-auth.js +0 -16
- package/src/store.ts +0 -52
- package/src/styles-drawer.ts +0 -143
- package/src/styles-settings.ts +0 -61
- package/src/styles.ts +0 -95
- package/src/user-action.ts +0 -91
- package/src/user-drawer.ts +0 -168
- package/src/user-functions.ts +0 -190
- package/src/user-icon.ts +0 -104
- package/src/user-reducer.ts +0 -91
- package/src/user-settings.ts +0 -421
- package/tsconfig.json +0 -19
package/deploy/user-settings.js
DELETED
|
@@ -1,427 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
@license
|
|
3
|
-
Copyright (c) 2018 The Polymer Project Authors. All rights reserved.
|
|
4
|
-
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
|
|
5
|
-
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
|
|
6
|
-
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
|
7
|
-
Code distributed by Google as part of the polymer project is also
|
|
8
|
-
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
|
9
|
-
*/
|
|
10
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
11
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
12
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
13
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
14
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
15
|
-
};
|
|
16
|
-
// @ts-check
|
|
17
|
-
import { html, LitElement, css, customElement, property } from 'lit-element';
|
|
18
|
-
import { connect } from 'pwa-helpers/connect-mixin.js';
|
|
19
|
-
import { store } from './store';
|
|
20
|
-
import { navigate, setName } from './user-action.js';
|
|
21
|
-
import { userStyles } from './styles';
|
|
22
|
-
import { Settings } from './styles-settings';
|
|
23
|
-
import { firebaseUser, deleteUser, runFirebase, userName, profileURL, userEmail } from './user-functions'; // runFirebase
|
|
24
|
-
export class Student {
|
|
25
|
-
constructor(firstName, middleInitial, lastName) {
|
|
26
|
-
this.firstName = firstName;
|
|
27
|
-
this.middleInitial = middleInitial;
|
|
28
|
-
this.lastName = lastName;
|
|
29
|
-
this.fullName = firstName + " " + middleInitial + " " + lastName;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
export const faceIcon = html `<svg viewBox="0 0 24 24" height="175px" width="175px"><path d="M9 11.75c-.69 0-1.25.56-1.25 1.25s.56 1.25 1.25 1.25 1.25-.56 1.25-1.25-.56-1.25-1.25-1.25zm6 0c-.69 0-1.25.56-1.25 1.25s.56 1.25 1.25 1.25 1.25-.56 1.25-1.25-.56-1.25-1.25-1.25zM12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8 0-.29.02-.58.05-.86 2.36-1.05 4.23-2.98 5.21-5.37C11.07 8.33 14.05 10 17.42 10c.78 0 1.53-.09 2.25-.26.21.71.33 1.47.33 2.26 0 4.41-3.59 8-8 8z"></path></svg>`;
|
|
33
|
-
let UserSettings = class UserSettings extends connect(store)(LitElement) {
|
|
34
|
-
constructor() {
|
|
35
|
-
super();
|
|
36
|
-
this.profileTopic = '';
|
|
37
|
-
this._user = false;
|
|
38
|
-
this._name = '';
|
|
39
|
-
this._person = '';
|
|
40
|
-
this._phone = '';
|
|
41
|
-
this._userMail = '';
|
|
42
|
-
this._photoURL = '';
|
|
43
|
-
this._imagePath = '';
|
|
44
|
-
this.onChange = (e) => this.dispatchEvent(new CustomEvent('name-changed', { detail: e.target.value }));
|
|
45
|
-
}
|
|
46
|
-
firstUpdated() {
|
|
47
|
-
const a = this.shadowRoot.getElementById('settings');
|
|
48
|
-
a.addEventListener('click', e => { e.preventDefault(); });
|
|
49
|
-
const b = this.shadowRoot.getElementById('emailForm');
|
|
50
|
-
b.addEventListener('click', e => { e.preventDefault(); });
|
|
51
|
-
const c = this.shadowRoot.getElementById('passwordForm');
|
|
52
|
-
c.addEventListener('click', e => { e.preventDefault(); });
|
|
53
|
-
const d = this.shadowRoot.getElementById('deleteForm');
|
|
54
|
-
d.addEventListener('click', e => { e.preventDefault(); });
|
|
55
|
-
this.shadowRoot.getElementById('profile').addEventListener('click', () => { store.dispatch(navigate('profile')); });
|
|
56
|
-
this.shadowRoot.getElementById('email').addEventListener('click', () => { store.dispatch(navigate('email')); });
|
|
57
|
-
this.shadowRoot.getElementById('password').addEventListener('click', () => { store.dispatch(navigate('password')); });
|
|
58
|
-
this.shadowRoot.getElementById('account').addEventListener('click', () => { store.dispatch(navigate('delete')); });
|
|
59
|
-
this.shadowRoot.getElementById('save').addEventListener('click', () => { this.alertProfile(); });
|
|
60
|
-
this.shadowRoot.getElementById('update').addEventListener('click', () => { this.alertEmail(); });
|
|
61
|
-
this.shadowRoot.getElementById('pass').addEventListener('click', () => { this.alertPassword(); });
|
|
62
|
-
this.shadowRoot.getElementById('deleteUser').addEventListener('click', () => { this.alertDelete(); });
|
|
63
|
-
this.shadowRoot.getElementById("fileupload").addEventListener('change', () => { this._handleFiles(); }, false);
|
|
64
|
-
runFirebase();
|
|
65
|
-
// @ts-ignore
|
|
66
|
-
firebase.auth().onAuthStateChanged((firebaseUser) => {
|
|
67
|
-
if (firebaseUser) { /* INCLUDE */
|
|
68
|
-
this._person = userName();
|
|
69
|
-
this._userMail = userEmail();
|
|
70
|
-
this._photoURL = profileURL();
|
|
71
|
-
store.dispatch(setName(this._person));
|
|
72
|
-
}
|
|
73
|
-
else { /* EXCLUDE */ }
|
|
74
|
-
store.dispatch(setName(this._person));
|
|
75
|
-
});
|
|
76
|
-
}
|
|
77
|
-
stateChanged(state) {
|
|
78
|
-
this.profileTopic = state.user.settings;
|
|
79
|
-
this._user = state.user.currentUser;
|
|
80
|
-
this._person = state.user.customer;
|
|
81
|
-
this._name = state.user.name;
|
|
82
|
-
this._phone = state.user.phone;
|
|
83
|
-
this._userMail = state.user.email;
|
|
84
|
-
this._photoURL = state.user.photoURL;
|
|
85
|
-
}
|
|
86
|
-
alertProfile() { if (this._user) {
|
|
87
|
-
this.updateProfile();
|
|
88
|
-
}
|
|
89
|
-
else {
|
|
90
|
-
alert('Please Login');
|
|
91
|
-
} }
|
|
92
|
-
updateProfile() {
|
|
93
|
-
const person = firebaseUser();
|
|
94
|
-
const contractor = this.shadowRoot.getElementById('contractor').value;
|
|
95
|
-
const phone = this.shadowRoot.getElementById('phoneNumber').value;
|
|
96
|
-
const list = this.shadowRoot.getElementById('list').checked;
|
|
97
|
-
if (contractor === null) {
|
|
98
|
-
contractor === this._person;
|
|
99
|
-
}
|
|
100
|
-
// const photo = this.shadowRoot.getElementById('');
|
|
101
|
-
// const company = this.shadowRoot.getElementById('company').value;
|
|
102
|
-
// const enroll = this.shadowRoot.getElementById('who').value;
|
|
103
|
-
if (firebaseUser) {
|
|
104
|
-
person.updateProfile({
|
|
105
|
-
displayName: contractor,
|
|
106
|
-
phoneNumber: phone
|
|
107
|
-
// photoURL: ""
|
|
108
|
-
})
|
|
109
|
-
.then(() => {
|
|
110
|
-
alert('updated name:' + contractor +
|
|
111
|
-
'updated phone:' + phone +
|
|
112
|
-
'Public Profile:' + list);
|
|
113
|
-
})
|
|
114
|
-
.catch((error) => { console.error('Error writing new message to Firebase Database', error); });
|
|
115
|
-
/*
|
|
116
|
-
firestore.collection("users").doc(user.id).set({
|
|
117
|
-
company: user.id,
|
|
118
|
-
enrollment: list
|
|
119
|
-
// location: this.location,
|
|
120
|
-
})
|
|
121
|
-
.then( () => { console.log("Document successfully written!"); })
|
|
122
|
-
.catch( (error) => { console.error('Error writing new message to Firebase Database', error); }); */
|
|
123
|
-
}
|
|
124
|
-
// location.reload();
|
|
125
|
-
}
|
|
126
|
-
/* Update email */
|
|
127
|
-
alertEmail() { if (this._user) {
|
|
128
|
-
this.updateEmail();
|
|
129
|
-
}
|
|
130
|
-
else {
|
|
131
|
-
alert('Please Login');
|
|
132
|
-
} }
|
|
133
|
-
updateEmail() {
|
|
134
|
-
const user = firebaseUser();
|
|
135
|
-
const email = this.shadowRoot.getElementById('email').value;
|
|
136
|
-
user.updateEmail(email)
|
|
137
|
-
.then(() => { console.log("Email update successful!"); })
|
|
138
|
-
.catch((error) => { console.error('Error writing new message to Firebase Database', error); });
|
|
139
|
-
user.sendEmailVerification()
|
|
140
|
-
.then(() => { console.log("Email Verification successful!"); })
|
|
141
|
-
.catch((error) => { console.error('Error writing new message to Firebase Database', error); });
|
|
142
|
-
}
|
|
143
|
-
/* Update Password */
|
|
144
|
-
alertPassword() { if (this._user) {
|
|
145
|
-
this.updatePassword();
|
|
146
|
-
}
|
|
147
|
-
else {
|
|
148
|
-
alert('Please Login');
|
|
149
|
-
} }
|
|
150
|
-
updatePassword() {
|
|
151
|
-
const user = firebaseUser();
|
|
152
|
-
const newPassword = this.shadowRoot.getElementById('newPass').value;
|
|
153
|
-
user.updatePassword(newPassword)
|
|
154
|
-
.then(() => { console.log("Password successful!"); })
|
|
155
|
-
.catch((error) => { console.error('Error writing new message to Firebase Database', error); });
|
|
156
|
-
}
|
|
157
|
-
/* Delete Account */
|
|
158
|
-
alertDelete() { if (this._user) {
|
|
159
|
-
this.deleteUser();
|
|
160
|
-
}
|
|
161
|
-
else {
|
|
162
|
-
alert('Please Login');
|
|
163
|
-
} }
|
|
164
|
-
deleteUser() {
|
|
165
|
-
const d = confirm("Delete Account?");
|
|
166
|
-
if (d == true) {
|
|
167
|
-
deleteUser();
|
|
168
|
-
console.log("user gone");
|
|
169
|
-
}
|
|
170
|
-
else {
|
|
171
|
-
console.log("user here");
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
_handleFiles() {
|
|
175
|
-
const uploader = this.shadowRoot.getElementById('uploader');
|
|
176
|
-
const file = this.shadowRoot.getElementById('fileupload').files[0];
|
|
177
|
-
const now = storageRef.child('/images/' + file.name);
|
|
178
|
-
const task = now.put(file);
|
|
179
|
-
task.on('state_changed', function progress(snapshot) { const percentage = (snapshot.bytesTransferred / snapshot.totalBytes) * 100; uploader.value = percentage; }, function error(error) { error; }, function complete() { });
|
|
180
|
-
this._imagePath = file.name;
|
|
181
|
-
console.log(this._imagePath);
|
|
182
|
-
}
|
|
183
|
-
/*
|
|
184
|
-
// Handle email address change revocations
|
|
185
|
-
_handleRecoverEmail(auth, actionCode, lang) {
|
|
186
|
-
// Localize the UI to the selected language as determined by the lang parameter.
|
|
187
|
-
const restoredEmail = null;
|
|
188
|
-
// Confirm the action code is valid.
|
|
189
|
-
auth.checkActionCode(actionCode)
|
|
190
|
-
// Get the restored email address.
|
|
191
|
-
.then( (info) => { restoredEmail = info['data']['email'];
|
|
192
|
-
// Revert to the old email.
|
|
193
|
-
return auth.applyActionCode(actionCode);
|
|
194
|
-
}).then( () => {
|
|
195
|
-
// Account email reverted to restoredEmail
|
|
196
|
-
// TODO: Display a confirmation message to the user.
|
|
197
|
-
// You might also want to give the user the option to reset their password
|
|
198
|
-
auth.sendPasswordResetEmail(restoredEmail).then( () => {
|
|
199
|
-
// Password reset confirmation sent. Ask user to check their email.
|
|
200
|
-
}).catch( (error) => {
|
|
201
|
-
// Error encountered while sending password reset code.
|
|
202
|
-
});
|
|
203
|
-
}).catch( (error) => {
|
|
204
|
-
// Invalid code.
|
|
205
|
-
});
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
_handleResetPassword(auth, actionCode, continueUrl, lang) {
|
|
209
|
-
// Localize the UI to the selected language as determined by the lang parameter.
|
|
210
|
-
// const accountEmail;
|
|
211
|
-
// Verify the password reset code is valid.
|
|
212
|
-
auth.verifyPasswordResetCode(actionCode).then( (email) => {
|
|
213
|
-
const accountEmail = email;
|
|
214
|
-
// TODO: Show the reset screen with the user's email and ask the user for the new password.
|
|
215
|
-
// Save the new password.
|
|
216
|
-
auth.confirmPasswordReset(actionCode, newPassword).then( (resp) => {
|
|
217
|
-
// Password reset has been confirmed and new password updated.
|
|
218
|
-
|
|
219
|
-
// TODO: Display a link back to the app, or sign-in the user directly
|
|
220
|
-
// if the page belongs to the same domain as the app:
|
|
221
|
-
// auth.signInWithEmailAndPassword(accountEmail, newPassword);
|
|
222
|
-
|
|
223
|
-
// TODO: If a continue URL is available,
|
|
224
|
-
// display a button which on click redirects the user back to the app
|
|
225
|
-
// via continueUrl with additional state determined from that URL's parameters.
|
|
226
|
-
}).catch( (error) => {
|
|
227
|
-
// Error occurred during confirmation. The code might have expired or the password is too weak.
|
|
228
|
-
});
|
|
229
|
-
}).catch( (error) => {
|
|
230
|
-
// Invalid or expired action code. Ask user to try to reset the password again.
|
|
231
|
-
});
|
|
232
|
-
}
|
|
233
|
-
*/
|
|
234
|
-
static get styles() {
|
|
235
|
-
return [
|
|
236
|
-
Settings,
|
|
237
|
-
userStyles,
|
|
238
|
-
css `
|
|
239
|
-
|
|
240
|
-
button:focus { outline: none; }
|
|
241
|
-
|
|
242
|
-
#uploader {
|
|
243
|
-
position: absolute;
|
|
244
|
-
right: 0;
|
|
245
|
-
width: 28px;
|
|
246
|
-
height: 28px;
|
|
247
|
-
border: 2px solid #303030;
|
|
248
|
-
border-radius: 50%;
|
|
249
|
-
transform: rotateZ(90deg);
|
|
250
|
-
overflow: hidden;
|
|
251
|
-
box-shadow: 1px 1px 2px black, 0 0 25px grey, 0 0 5px #fff;
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
.profile {
|
|
255
|
-
width: 200px;
|
|
256
|
-
margin: auto;
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
.userImage {
|
|
260
|
-
border-radius: 50%;
|
|
261
|
-
overflow: hidden;
|
|
262
|
-
margin: auto;
|
|
263
|
-
border: 2px solid #303030;
|
|
264
|
-
box-shadow: 1px 1px 2px black, 0 0 25px grey, 0 0 5px #fff;
|
|
265
|
-
}
|
|
266
|
-
|
|
267
|
-
.file-container {
|
|
268
|
-
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
.trigger {
|
|
272
|
-
position: relative;
|
|
273
|
-
width: 200px;
|
|
274
|
-
display: block;
|
|
275
|
-
text-shadow: 1px 1px 12px black, 0 0 35px grey, 0 0 15px #fff;
|
|
276
|
-
font-size: 1em;
|
|
277
|
-
transition: all .4s;
|
|
278
|
-
cursor: pointer;
|
|
279
|
-
text-align: center;
|
|
280
|
-
}
|
|
281
|
-
|
|
282
|
-
#fileupload {
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
width: 200px;
|
|
286
|
-
height: 100%;
|
|
287
|
-
/* background: #39D2B4; */
|
|
288
|
-
position: absolute;
|
|
289
|
-
top: 0; left: 0;
|
|
290
|
-
opacity: 0;
|
|
291
|
-
|
|
292
|
-
cursor: pointer;
|
|
293
|
-
}
|
|
294
|
-
|
|
295
|
-
.max {
|
|
296
|
-
max-width: 600px;
|
|
297
|
-
margin: auto;
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
.welcome {
|
|
301
|
-
text-align: center;
|
|
302
|
-
text-shadow: 1px 1px 2px black, 0 0 15px grey, 0 0 5px #fff;
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
@media (max-width: 460px) {
|
|
306
|
-
#profile, #email { text-align: left; }
|
|
307
|
-
#account, #password { text-align: right; }
|
|
308
|
-
}
|
|
309
|
-
/*
|
|
310
|
-
@media (min-width: 640px) {
|
|
311
|
-
:host{ display: grid; grid-template-columns: 50% 50%; }
|
|
312
|
-
}
|
|
313
|
-
*/
|
|
314
|
-
`
|
|
315
|
-
];
|
|
316
|
-
}
|
|
317
|
-
render() {
|
|
318
|
-
return html `
|
|
319
|
-
<!-- Page Menu -->
|
|
320
|
-
<div>
|
|
321
|
-
<ul class="setMenu">
|
|
322
|
-
<li><button id="profile" value="profile" class="topButton" ?on="${this.profileTopic === 'profile'}" ><p>Profile</p> </button></li>
|
|
323
|
-
<li><button id="email" value="email" class="topButton" ?on="${this.profileTopic === 'email'}" ><p>Email</p> </button></li>
|
|
324
|
-
<li><button id="password" value="password" class="topButton" ?on="${this.profileTopic === 'password'}" ><p>Password</p> </button></li>
|
|
325
|
-
<li><button id="account" value="delete" class="topButton" ?on="${this.profileTopic === 'delete'}" ><p>Delete</p> </button></li>
|
|
326
|
-
</ul>
|
|
327
|
-
</div>
|
|
328
|
-
|
|
329
|
-
<!-- Page Body -->
|
|
330
|
-
<div class="spec" ?on="${this.profileTopic === 'profile'}">
|
|
331
|
-
<div class="profile">
|
|
332
|
-
|
|
333
|
-
<h2 class="welcome">${this._person}</h2>
|
|
334
|
-
|
|
335
|
-
<label for="fileupload" class="trigger">
|
|
336
|
-
<input type="file" name="fileupload" id="fileupload" accept="image/*">
|
|
337
|
-
${this._user
|
|
338
|
-
? html `
|
|
339
|
-
<progress value="0" max="100" id="uploader"></progress>
|
|
340
|
-
<input
|
|
341
|
-
type="image"
|
|
342
|
-
class="userImage"
|
|
343
|
-
id="image"
|
|
344
|
-
alt="user"
|
|
345
|
-
height="171px"
|
|
346
|
-
width="171px"
|
|
347
|
-
src="${this._photoURL}">
|
|
348
|
-
`
|
|
349
|
-
: html `${faceIcon}`}
|
|
350
|
-
upload a photo
|
|
351
|
-
</label>
|
|
352
|
-
|
|
353
|
-
</div>
|
|
354
|
-
<form id="settings">
|
|
355
|
-
<ul>
|
|
356
|
-
<li><p><label><h3 class="pageTitle">Username</h3><input id="contractor" type="text" ></label></p></li>
|
|
357
|
-
<li><p><label><h3 class="pageTitle">Telephone: ${this._phone}</h3><input id="phoneNumber" type="text" ></label></p></li>
|
|
358
|
-
</ul>
|
|
359
|
-
</form>
|
|
360
|
-
|
|
361
|
-
<ul class="max">
|
|
362
|
-
<li><p><label><input type="checkbox" id="list" placeholder="true">Public Profile</label></p></li>
|
|
363
|
-
<li><button id="save" class="action-button" >save</button></li>
|
|
364
|
-
</ul>
|
|
365
|
-
|
|
366
|
-
</div>
|
|
367
|
-
|
|
368
|
-
<form class="spec" ?on="${this.profileTopic === 'email'}" id="emailForm">
|
|
369
|
-
<ul>
|
|
370
|
-
<li><h3 class="pageTitle">Change Email ${this._userMail}</h3></li>
|
|
371
|
-
<li><p><label>Email<input type="email" id="email"></label></p></li>
|
|
372
|
-
<li><p><label>Verify Email<input type="email" id="emailVerify"></label></p></li>
|
|
373
|
-
<li><p><button id="update" class="action-button" >update</button></p></li>
|
|
374
|
-
<li><div class="verified"></div></li>
|
|
375
|
-
</ul>
|
|
376
|
-
</form>
|
|
377
|
-
|
|
378
|
-
<form class="spec" ?on="${this.profileTopic === 'password'}" id="passwordForm">
|
|
379
|
-
<ul>
|
|
380
|
-
<li><h3 class="pageTitle">Update Password</h3></li>
|
|
381
|
-
<li><p><label>New Password <input type="Password" id="newPass"></label></p></li>
|
|
382
|
-
<li><p><label>Verify Password <input type="Password" id="passVerify"></label></p></li>
|
|
383
|
-
<li><p><button id="pass" class="action-button">create</button></p></li>
|
|
384
|
-
</ul>
|
|
385
|
-
</form>
|
|
386
|
-
|
|
387
|
-
<form class="spec" ?on="${this.profileTopic === 'delete'}" id="deleteForm">
|
|
388
|
-
<ul>
|
|
389
|
-
<li><h3 class="pageTitle">Delete Account</h3></li>
|
|
390
|
-
<li><p>Permanently delete the user account and data related to:</p></li>
|
|
391
|
-
<!-- <li><p>\${this.userMail}</p></li> -->
|
|
392
|
-
<li><p><button id="deleteUser" class="action-button">Delete</button></p></li>
|
|
393
|
-
</ul>
|
|
394
|
-
</form>
|
|
395
|
-
</form>
|
|
396
|
-
|
|
397
|
-
`;
|
|
398
|
-
}
|
|
399
|
-
};
|
|
400
|
-
__decorate([
|
|
401
|
-
property({ type: String })
|
|
402
|
-
], UserSettings.prototype, "profileTopic", void 0);
|
|
403
|
-
__decorate([
|
|
404
|
-
property({ type: Boolean })
|
|
405
|
-
], UserSettings.prototype, "_user", void 0);
|
|
406
|
-
__decorate([
|
|
407
|
-
property({ type: String })
|
|
408
|
-
], UserSettings.prototype, "_name", void 0);
|
|
409
|
-
__decorate([
|
|
410
|
-
property({ type: String })
|
|
411
|
-
], UserSettings.prototype, "_person", void 0);
|
|
412
|
-
__decorate([
|
|
413
|
-
property({ type: Number })
|
|
414
|
-
], UserSettings.prototype, "_phone", void 0);
|
|
415
|
-
__decorate([
|
|
416
|
-
property({ type: String })
|
|
417
|
-
], UserSettings.prototype, "_userMail", void 0);
|
|
418
|
-
__decorate([
|
|
419
|
-
property({ type: String })
|
|
420
|
-
], UserSettings.prototype, "_photoURL", void 0);
|
|
421
|
-
__decorate([
|
|
422
|
-
property({ type: String })
|
|
423
|
-
], UserSettings.prototype, "_imagePath", void 0);
|
|
424
|
-
UserSettings = __decorate([
|
|
425
|
-
customElement('user-settings')
|
|
426
|
-
], UserSettings);
|
|
427
|
-
export { UserSettings };
|
package/images/background.svg
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
<svg
|
|
2
|
-
width="1440"
|
|
3
|
-
height="4573"
|
|
4
|
-
viewBox="0 0 1440 4573"
|
|
5
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
6
|
-
style="background:#f5f7f8">
|
|
7
|
-
|
|
8
|
-
<g
|
|
9
|
-
fill="none"
|
|
10
|
-
fill-rule="evenodd">
|
|
11
|
-
<!--
|
|
12
|
-
<path fill="#FF8A65" d="M1440 4573H0V3477h1440z"/>
|
|
13
|
-
<path fill="#F57C00" d="M1440 4164.177V2139H0v1384.048l1440 641.129z"/>
|
|
14
|
-
<path fill="#FFCA28" d="M0 2707.578V1143h1440v1143.498z"/>
|
|
15
|
-
-->
|
|
16
|
-
<path fill="#F57C00" d="M1440 2011.976L0 1402.131V0h1440z"/>
|
|
17
|
-
<path fill="#FF8A65" d="M1440 76.88L0 544.776V-829h1440V76.88z"/>
|
|
18
|
-
</g>
|
|
19
|
-
<!--
|
|
20
|
-
<clipPath id="myClip">
|
|
21
|
-
<circle cx="40" cy="35" r="35" />
|
|
22
|
-
</clipPath> -->
|
|
23
|
-
</svg>
|
package/images/icon-48x48.png
DELETED
|
Binary file
|
package/images/npm.svg
DELETED
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|
2
|
-
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
|
3
|
-
|
|
4
|
-
<svg
|
|
5
|
-
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
|
6
|
-
xmlns:cc="http://creativecommons.org/ns#"
|
|
7
|
-
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
|
8
|
-
xmlns:svg="http://www.w3.org/2000/svg"
|
|
9
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
10
|
-
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
|
11
|
-
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
|
12
|
-
width="210mm"
|
|
13
|
-
height="297mm"
|
|
14
|
-
viewBox="0 0 210 297"
|
|
15
|
-
version="1.1"
|
|
16
|
-
id="svg8"
|
|
17
|
-
inkscape:version="0.92.3 (2405546, 2018-03-11)"
|
|
18
|
-
sodipodi:docname="npm.svg">
|
|
19
|
-
<defs
|
|
20
|
-
id="defs2" />
|
|
21
|
-
<sodipodi:namedview
|
|
22
|
-
id="base"
|
|
23
|
-
pagecolor="#ffffff"
|
|
24
|
-
bordercolor="#666666"
|
|
25
|
-
borderopacity="1.0"
|
|
26
|
-
inkscape:pageopacity="0.0"
|
|
27
|
-
inkscape:pageshadow="2"
|
|
28
|
-
inkscape:zoom="2"
|
|
29
|
-
inkscape:cx="217.97484"
|
|
30
|
-
inkscape:cy="680"
|
|
31
|
-
inkscape:document-units="mm"
|
|
32
|
-
inkscape:current-layer="layer1"
|
|
33
|
-
showgrid="false"
|
|
34
|
-
inkscape:window-width="1440"
|
|
35
|
-
inkscape:window-height="837"
|
|
36
|
-
inkscape:window-x="-8"
|
|
37
|
-
inkscape:window-y="-8"
|
|
38
|
-
inkscape:window-maximized="1" />
|
|
39
|
-
<metadata
|
|
40
|
-
id="metadata5">
|
|
41
|
-
<rdf:RDF>
|
|
42
|
-
<cc:Work
|
|
43
|
-
rdf:about="">
|
|
44
|
-
<dc:format>image/svg+xml</dc:format>
|
|
45
|
-
<dc:type
|
|
46
|
-
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
|
47
|
-
<dc:title></dc:title>
|
|
48
|
-
</cc:Work>
|
|
49
|
-
</rdf:RDF>
|
|
50
|
-
</metadata>
|
|
51
|
-
<g
|
|
52
|
-
inkscape:label="Layer 1"
|
|
53
|
-
inkscape:groupmode="layer"
|
|
54
|
-
id="layer1">
|
|
55
|
-
<rect
|
|
56
|
-
id="rect10"
|
|
57
|
-
width="18.25625"
|
|
58
|
-
height="3.8364582"
|
|
59
|
-
x="48.947918"
|
|
60
|
-
y="97.239578"
|
|
61
|
-
style="fill:#ff6600;stroke-width:0.25187582" />
|
|
62
|
-
<text
|
|
63
|
-
xml:space="preserve"
|
|
64
|
-
style="font-style:normal;font-weight:normal;font-size:2.82222223px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332"
|
|
65
|
-
x="51.461456"
|
|
66
|
-
y="99.091667"
|
|
67
|
-
id="text22"><tspan
|
|
68
|
-
sodipodi:role="line"
|
|
69
|
-
id="tspan20"
|
|
70
|
-
x="51.461456"
|
|
71
|
-
y="101.66647"
|
|
72
|
-
style="stroke-width:0.26458332" /></text>
|
|
73
|
-
<text
|
|
74
|
-
xml:space="preserve"
|
|
75
|
-
style="font-style:normal;font-weight:normal;font-size:2.82222223px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#f9f9f9;fill-opacity:1;stroke:none;stroke-width:0.26458332;"
|
|
76
|
-
x="49.741669"
|
|
77
|
-
y="100.01771"
|
|
78
|
-
id="text26"><tspan
|
|
79
|
-
sodipodi:role="line"
|
|
80
|
-
id="tspan24"
|
|
81
|
-
x="49.741669"
|
|
82
|
-
y="100.01771"
|
|
83
|
-
style="stroke-width:0.26458332;fill:#f9f9f9;">npm v0.0.7</tspan></text>
|
|
84
|
-
</g>
|
|
85
|
-
</svg>
|
package/images/npm007.png
DELETED
|
Binary file
|
package/index.html
DELETED
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
@license
|
|
3
|
-
Copyright (c) 2018 The Polymer Project Authors. All rights reserved.
|
|
4
|
-
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
|
|
5
|
-
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
|
|
6
|
-
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
|
7
|
-
Code distributed by Google as part of the polymer project is also
|
|
8
|
-
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
|
9
|
-
-->
|
|
10
|
-
|
|
11
|
-
<!DOCTYPE html>
|
|
12
|
-
<html lang="en">
|
|
13
|
-
<head>
|
|
14
|
-
<meta charset="UTF-8">
|
|
15
|
-
<!-- TITILE -->
|
|
16
|
-
<title>pwa-auth</title>
|
|
17
|
-
<!-- VIEWPORT -->
|
|
18
|
-
<meta name="viewport" content="width=device-width, minimum-scale=1, initial-scale=1" />
|
|
19
|
-
<!-- BASE -->
|
|
20
|
-
<base href="/">
|
|
21
|
-
<!-- PRECONNECT -->
|
|
22
|
-
<link rel="preconnect" href="https://www.googletagmanager.com">
|
|
23
|
-
<link rel="preconnect" href="https://www.gstatic.com">
|
|
24
|
-
<link rel="preconnect" href="https://www.google-analytics.com">
|
|
25
|
-
<!-- STYLES -->
|
|
26
|
-
<style>
|
|
27
|
-
body { margin: 0; background-color: #303030; }
|
|
28
|
-
header { height: 64px; display: grid; grid-template-columns: 1fr 64px ; background-color: #303030; }
|
|
29
|
-
main { margin: 0 16px 0 16px; background-color: #fff; border-radius: 8px; padding: 8px;}
|
|
30
|
-
footer { background-color: #303030; height: 100%; color: #e8e8e8; }
|
|
31
|
-
.links { margin: auto; text-decoration: none; font-size: 1em; color: red; font-weight: 800; }
|
|
32
|
-
.link { margin: auto; text-decoration: none; font-size: 1em; color: #e8e8e8; font-weight: 800; }
|
|
33
|
-
p { margin: 16px; background-color: #fff; color: black; border-radius: 8px; padding: 16px; font-size: 1em; }
|
|
34
|
-
h1, h2 { text-align: center; }
|
|
35
|
-
h3 { text-align: center; color: #e8e8e8; padding-left: 64px; text-transform: uppercase; font-size: 1em; }
|
|
36
|
-
</style>
|
|
37
|
-
<!-- https://github.com/reactjs/redux/issues/2907 -->
|
|
38
|
-
<script>
|
|
39
|
-
if ('serviceWorker' in navigator) { window.addEventListener('load', () => {
|
|
40
|
-
navigator.serviceWorker.register('service-worker.js', {
|
|
41
|
-
scope: '/',
|
|
42
|
-
});
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
window.process = { env: { NODE_ENV: 'production' } };
|
|
46
|
-
</script>
|
|
47
|
-
<!-- MANIFEST -->
|
|
48
|
-
<link rel="manifest" href="manifest.json" />
|
|
49
|
-
<!-- FAVICON -->
|
|
50
|
-
<link rel="icon" href="images/favicon.ico">
|
|
51
|
-
<!-- THEME COLOR -->
|
|
52
|
-
<meta name="theme-color" content="#272931" />
|
|
53
|
-
<!-- AUTHOR -->
|
|
54
|
-
<meta name="author" content="Modern Projects" />
|
|
55
|
-
<!-- CANONICAL -->
|
|
56
|
-
<link rel="canonical" href="https://inmostfire.com" />
|
|
57
|
-
<!-- DESCRIPTION -->
|
|
58
|
-
<meta name="description" content="To provide a personalized experience, Apps need to know the identity of a user to securely store data in the cloud. pwa-auth is powered by The Firebase Authentication backend, consistently providing a centralized and predictable state behaviour with Redux, and declaratively rendering straight into the DOM with Google Polymer's fast and light Lit-Element. This Component includes 3 HTML Tags, and 1 Boilerplate Function to display the user icon, sign up, login, log out, change account details, and delete the user's account." />
|
|
59
|
-
<!-- KEYWORDS -->
|
|
60
|
-
<meta name="keywords" content="lit-html, redux, firebase, user, management, drawer, settings, icon" />
|
|
61
|
-
|
|
62
|
-
</head>
|
|
63
|
-
|
|
64
|
-
<body>
|
|
65
|
-
|
|
66
|
-
<!-- LOAD ANY POLYFILLS YOUR BROWSER NEEDS -->
|
|
67
|
-
<script src="node_modules/@webcomponents/webcomponentsjs/webcomponents-loader.js" async ></script>
|
|
68
|
-
|
|
69
|
-
<!-- APPLICATION-SHELL -->
|
|
70
|
-
<application-shell appTitle="pwa-auth"></application-shell>
|
|
71
|
-
|
|
72
|
-
<!-- Global site tag (gtag.js) - Google Analytics -->
|
|
73
|
-
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-73943527-19"></script>
|
|
74
|
-
<script>
|
|
75
|
-
window.dataLayer = window.dataLayer || [];
|
|
76
|
-
function gtag(){dataLayer.push(arguments);}
|
|
77
|
-
gtag('js', new Date());
|
|
78
|
-
gtag('config', 'UA-73943527-19');
|
|
79
|
-
</script>
|
|
80
|
-
|
|
81
|
-
<!-- FIREBASE -->
|
|
82
|
-
<script src="https://www.gstatic.com/firebasejs/5.9.0/firebase-app.js" ></script>
|
|
83
|
-
<script src="https://www.gstatic.com/firebasejs/5.9.0/firebase-auth.js" ></script>
|
|
84
|
-
<script src="https://www.gstatic.com/firebasejs/5.9.0/firebase-firestore.js" ></script>
|
|
85
|
-
<script src="https://www.gstatic.com/firebasejs/5.9.0/firebase-storage.js" ></script>
|
|
86
|
-
|
|
87
|
-
<script>
|
|
88
|
-
document.addEventListener("DOMContentLoaded", (event) => { });
|
|
89
|
-
// Initialize Firebase
|
|
90
|
-
const admin = {
|
|
91
|
-
apiKey: "AIzaSyAJfm5MahdHr4HzwRLWN7IBhVYXMjP65lQ",
|
|
92
|
-
authDomain: "inmostfire.firebaseapp.com",
|
|
93
|
-
databaseURL: "https://inmostfire.firebaseio.com",
|
|
94
|
-
projectId: "inmostfire",
|
|
95
|
-
storageBucket: "inmostfire.appspot.com",
|
|
96
|
-
messagingSenderId: "937289126032"
|
|
97
|
-
};
|
|
98
|
-
|
|
99
|
-
// REFERENCE TO SERVICES
|
|
100
|
-
const application = firebase.initializeApp(admin);
|
|
101
|
-
const firestore = application.firestore();
|
|
102
|
-
const storage = firebase.storage();
|
|
103
|
-
const storageRef = storage.ref();
|
|
104
|
-
|
|
105
|
-
</script>
|
|
106
|
-
|
|
107
|
-
<!-- APPLICATION-SHELL -->
|
|
108
|
-
<script type="module" src="/launch/application-shell.js" async></script>
|
|
109
|
-
|
|
110
|
-
</body>
|
|
111
|
-
</html>
|