pwa-auth 2.0.7 → 3.0.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.
- package/CHANGELOG.md +15 -0
- package/README.md +65 -54
- package/demonstration/compiled/pwa-auth.js +880 -0
- package/{website → demonstration}/css/styles.css +4 -2
- package/{demo → demonstration}/index.html +7 -4
- package/package.json +12 -10
- package/pwa-auth.js +4 -3
- package/{website → src}/THIRD_PARTY_LICENSES.txt +56 -56
- package/src/compiled/pwa-auth.js +880 -0
- package/{source → src-typescript}/css/form/label.ts +0 -2
- package/src-typescript/css/toggle.ts +9 -0
- package/src-typescript/development/junk/firebase-object.ts +49 -0
- package/src-typescript/development/junk/notes.md +96 -0
- package/src-typescript/development/junk/phone.ts +146 -0
- package/src-typescript/development/junk/photo.ts +440 -0
- package/src-typescript/development/junk/telephone.ts +282 -0
- package/{source/firebase/firebase-login.ts → src-typescript/development/login.ts} +1 -1
- package/{source/firebase/firebase.ts → src-typescript/development/object.ts} +1 -1
- package/src-typescript/firebase/authentication.ts +11 -0
- package/{source/firebase/start.ts → src-typescript/firebase/interface.ts} +35 -64
- package/{source/custom-elements → src-typescript/webcomponents}/drawer/drawer.ts +1 -1
- package/{source/custom-elements → src-typescript/webcomponents}/drawer/input/forgot.ts +1 -1
- package/{source/custom-elements → src-typescript/webcomponents}/drawer/input/login.ts +1 -1
- package/{source/custom-elements → src-typescript/webcomponents}/drawer/input/sign-up.ts +2 -1
- package/{deploy/custom-elements/icon/css/icon.js → src-typescript/webcomponents/icon/css/icon.ts} +4 -3
- package/{source/custom-elements → src-typescript/webcomponents}/icon/icon.ts +2 -21
- package/{source/custom-elements → src-typescript/webcomponents}/settings/input/delete.ts +1 -1
- package/{source/custom-elements → src-typescript/webcomponents}/settings/input/email.ts +1 -1
- package/{source/custom-elements → src-typescript/webcomponents}/settings/input/images.ts +1 -1
- package/{source/custom-elements → src-typescript/webcomponents}/settings/input/name.ts +1 -1
- package/{source/custom-elements → src-typescript/webcomponents}/settings/input/password.ts +1 -1
- package/{source/custom-elements → src-typescript/webcomponents}/settings/input/uploader.ts +2 -1
- package/{source/custom-elements → src-typescript/webcomponents}/settings/settings.ts +2 -2
- package/demo/css/styles.css +0 -67
- package/deploy/css/default.d.ts +0 -5
- package/deploy/css/default.d.ts.map +0 -1
- package/deploy/css/default.js +0 -99
- package/deploy/css/font.d.ts +0 -2
- package/deploy/css/font.d.ts.map +0 -1
- package/deploy/css/font.js +0 -16
- package/deploy/css/form/button.d.ts +0 -3
- package/deploy/css/form/button.d.ts.map +0 -1
- package/deploy/css/form/button.js +0 -54
- package/deploy/css/form/input.d.ts +0 -3
- package/deploy/css/form/input.d.ts.map +0 -1
- package/deploy/css/form/input.js +0 -24
- package/deploy/css/form/label.d.ts +0 -3
- package/deploy/css/form/label.d.ts.map +0 -1
- package/deploy/css/form/label.js +0 -24
- package/deploy/css/form/list.d.ts +0 -3
- package/deploy/css/form/list.d.ts.map +0 -1
- package/deploy/css/form/list.js +0 -22
- package/deploy/css/svg.d.ts +0 -4
- package/deploy/css/svg.d.ts.map +0 -1
- package/deploy/css/svg.js +0 -4
- package/deploy/css/toggle.d.ts +0 -2
- package/deploy/css/toggle.d.ts.map +0 -1
- package/deploy/css/toggle.js +0 -8
- package/deploy/custom-elements/drawer/css/drawer.d.ts +0 -3
- package/deploy/custom-elements/drawer/css/drawer.d.ts.map +0 -1
- package/deploy/custom-elements/drawer/css/drawer.js +0 -55
- package/deploy/custom-elements/drawer/css/exit.d.ts +0 -3
- package/deploy/custom-elements/drawer/css/exit.d.ts.map +0 -1
- package/deploy/custom-elements/drawer/css/exit.js +0 -48
- package/deploy/custom-elements/drawer/css/link.d.ts +0 -3
- package/deploy/custom-elements/drawer/css/link.d.ts.map +0 -1
- package/deploy/custom-elements/drawer/css/link.js +0 -12
- package/deploy/custom-elements/drawer/css/paragraph.d.ts +0 -3
- package/deploy/custom-elements/drawer/css/paragraph.d.ts.map +0 -1
- package/deploy/custom-elements/drawer/css/paragraph.js +0 -10
- package/deploy/custom-elements/drawer/css/toggle.d.ts +0 -3
- package/deploy/custom-elements/drawer/css/toggle.d.ts.map +0 -1
- package/deploy/custom-elements/drawer/css/toggle.js +0 -18
- package/deploy/custom-elements/drawer/drawer.d.ts +0 -37
- package/deploy/custom-elements/drawer/drawer.d.ts.map +0 -1
- package/deploy/custom-elements/drawer/drawer.js +0 -128
- package/deploy/custom-elements/drawer/input/forgot.d.ts +0 -16
- package/deploy/custom-elements/drawer/input/forgot.d.ts.map +0 -1
- package/deploy/custom-elements/drawer/input/forgot.js +0 -60
- package/deploy/custom-elements/drawer/input/login.d.ts +0 -20
- package/deploy/custom-elements/drawer/input/login.d.ts.map +0 -1
- package/deploy/custom-elements/drawer/input/login.js +0 -128
- package/deploy/custom-elements/drawer/input/sign-up.d.ts +0 -20
- package/deploy/custom-elements/drawer/input/sign-up.d.ts.map +0 -1
- package/deploy/custom-elements/drawer/input/sign-up.js +0 -137
- package/deploy/custom-elements/icon/css/icon.d.ts +0 -2
- package/deploy/custom-elements/icon/css/icon.d.ts.map +0 -1
- package/deploy/custom-elements/icon/icon.d.ts +0 -33
- package/deploy/custom-elements/icon/icon.d.ts.map +0 -1
- package/deploy/custom-elements/icon/icon.js +0 -72
- package/deploy/custom-elements/settings/css/navigation.d.ts +0 -2
- package/deploy/custom-elements/settings/css/navigation.d.ts.map +0 -1
- package/deploy/custom-elements/settings/css/navigation.js +0 -51
- package/deploy/custom-elements/settings/input/delete.d.ts +0 -34
- package/deploy/custom-elements/settings/input/delete.d.ts.map +0 -1
- package/deploy/custom-elements/settings/input/delete.js +0 -87
- package/deploy/custom-elements/settings/input/email.d.ts +0 -34
- package/deploy/custom-elements/settings/input/email.d.ts.map +0 -1
- package/deploy/custom-elements/settings/input/email.js +0 -98
- package/deploy/custom-elements/settings/input/images.d.ts +0 -2
- package/deploy/custom-elements/settings/input/images.d.ts.map +0 -1
- package/deploy/custom-elements/settings/input/images.js +0 -22
- package/deploy/custom-elements/settings/input/name.d.ts +0 -33
- package/deploy/custom-elements/settings/input/name.d.ts.map +0 -1
- package/deploy/custom-elements/settings/input/name.js +0 -90
- package/deploy/custom-elements/settings/input/password.d.ts +0 -36
- package/deploy/custom-elements/settings/input/password.d.ts.map +0 -1
- package/deploy/custom-elements/settings/input/password.js +0 -145
- package/deploy/custom-elements/settings/input/uploader.d.ts +0 -37
- package/deploy/custom-elements/settings/input/uploader.d.ts.map +0 -1
- package/deploy/custom-elements/settings/input/uploader.js +0 -224
- package/deploy/custom-elements/settings/settings.d.ts +0 -37
- package/deploy/custom-elements/settings/settings.d.ts.map +0 -1
- package/deploy/custom-elements/settings/settings.js +0 -197
- package/deploy/firebase/firebase-login.d.ts +0 -21
- package/deploy/firebase/firebase-login.d.ts.map +0 -1
- package/deploy/firebase/firebase-login.js +0 -85
- package/deploy/firebase/firebase.d.ts +0 -20
- package/deploy/firebase/firebase.d.ts.map +0 -1
- package/deploy/firebase/firebase.js +0 -76
- package/deploy/firebase/start.d.ts +0 -14
- package/deploy/firebase/start.d.ts.map +0 -1
- package/deploy/firebase/start.js +0 -86
- package/deploy/lazy-loader.d.ts +0 -11
- package/deploy/lazy-loader.d.ts.map +0 -1
- package/deploy/lazy-loader.js +0 -20
- package/deploy/redux/backend.d.ts +0 -16
- package/deploy/redux/backend.d.ts.map +0 -1
- package/deploy/redux/backend.js +0 -43
- package/deploy/redux/drawer.d.ts +0 -18
- package/deploy/redux/drawer.d.ts.map +0 -1
- package/deploy/redux/drawer.js +0 -21
- package/deploy/redux/frontend.d.ts +0 -17
- package/deploy/redux/frontend.d.ts.map +0 -1
- package/deploy/redux/frontend.js +0 -67
- package/deploy/redux/object.d.ts +0 -24
- package/deploy/redux/object.d.ts.map +0 -1
- package/deploy/redux/object.js +0 -1
- package/deploy/store.d.ts +0 -19
- package/deploy/store.d.ts.map +0 -1
- package/deploy/store.js +0 -13
- package/npm/THIRD_PARTY_LICENSES.txt +0 -303
- package/npm/pwa-auth.js +0 -306
- package/source/css/toggle.ts +0 -9
- package/source/custom-elements/icon/css/icon.ts +0 -70
- package/website/404.html +0 -33
- package/website/css/pwa-styles.css +0 -36
- package/website/images/empty.jpg +0 -0
- package/website/images/favicon.ico +0 -0
- package/website/images/manifest/logo-144.png +0 -0
- package/website/images/manifest/logo-192.png +0 -0
- package/website/images/manifest/logo-48.png +0 -0
- package/website/images/manifest/logo-512.png +0 -0
- package/website/images/manifest/logo-72.png +0 -0
- package/website/images/manifest/logo-96.png +0 -0
- package/website/images/manifest/maskable_icon_x128.png +0 -0
- package/website/images/manifest/maskable_icon_x192.png +0 -0
- package/website/images/manifest/maskable_icon_x384.png +0 -0
- package/website/images/manifest/maskable_icon_x48.png +0 -0
- package/website/images/manifest/maskable_icon_x512.png +0 -0
- package/website/images/manifest/maskable_icon_x72.png +0 -0
- package/website/images/manifest/maskable_icon_x96.png +0 -0
- package/website/index.html +0 -72
- package/website/js/pwa-auth.js +0 -306
- package/website/sitemap.xml +0 -11
- /package/{demo → demonstration}/css/pwa-styles.css +0 -0
- /package/{demo → demonstration}/images/empty.jpg +0 -0
- /package/{npm/images → src}/empty.jpg +0 -0
- /package/{npm → src}/pwa-styles.css +0 -0
- /package/{source → src-typescript}/css/default.ts +0 -0
- /package/{source → src-typescript}/css/font.ts +0 -0
- /package/{source → src-typescript}/css/form/button.ts +0 -0
- /package/{source → src-typescript}/css/form/input.ts +0 -0
- /package/{source → src-typescript}/css/form/list.ts +0 -0
- /package/{source → src-typescript}/css/svg.ts +0 -0
- /package/{source → src-typescript}/lazy-loader.ts +0 -0
- /package/{source → src-typescript}/redux/backend.ts +0 -0
- /package/{source → src-typescript}/redux/drawer.ts +0 -0
- /package/{source → src-typescript}/redux/frontend.ts +0 -0
- /package/{source → src-typescript}/redux/object.ts +0 -0
- /package/{source → src-typescript}/store.ts +0 -0
- /package/{source/custom-elements → src-typescript/webcomponents}/drawer/css/drawer.ts +0 -0
- /package/{source/custom-elements → src-typescript/webcomponents}/drawer/css/exit.ts +0 -0
- /package/{source/custom-elements → src-typescript/webcomponents}/drawer/css/link.ts +0 -0
- /package/{source/custom-elements → src-typescript/webcomponents}/drawer/css/paragraph.ts +0 -0
- /package/{source/custom-elements → src-typescript/webcomponents}/drawer/css/toggle.ts +0 -0
- /package/{source/custom-elements → src-typescript/webcomponents}/settings/css/navigation.ts +0 -0
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
-
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;
|
|
5
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
-
};
|
|
7
|
-
import { LitElement, css, html } from "lit";
|
|
8
|
-
import { property, state } from "lit/decorators.js";
|
|
9
|
-
import { connect } from "pwa-helpers";
|
|
10
|
-
import store from "../../../store";
|
|
11
|
-
import { auth } from "../../../firebase/start";
|
|
12
|
-
import { labelStyle } from "../../../css/form/label";
|
|
13
|
-
import { inputStyle } from "../../../css/form/input";
|
|
14
|
-
import { buttonStyle } from "../../../css/form/button";
|
|
15
|
-
import { updateEmail } from "firebase/auth";
|
|
16
|
-
export class ContactEmail extends connect(store)(LitElement) {
|
|
17
|
-
constructor() {
|
|
18
|
-
super();
|
|
19
|
-
this.email = '';
|
|
20
|
-
this.login = false;
|
|
21
|
-
this.mail = "";
|
|
22
|
-
this.default = (e) => {
|
|
23
|
-
e.preventDefault();
|
|
24
|
-
};
|
|
25
|
-
this.saveEmail = async () => {
|
|
26
|
-
if (auth.currentUser) {
|
|
27
|
-
let contactMail = this.shadowRoot?.querySelector('#pwa-email');
|
|
28
|
-
await updateEmail(auth.currentUser, contactMail.value).catch((error) => { console.log(error); });
|
|
29
|
-
const emailChangedEvent = new CustomEvent("userEmailChanged", {
|
|
30
|
-
detail: { email: contactMail.value }
|
|
31
|
-
});
|
|
32
|
-
window.dispatchEvent(emailChangedEvent);
|
|
33
|
-
alert('Email Updated');
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
stateChanged(state) {
|
|
38
|
-
this.login = state.frontend.login;
|
|
39
|
-
this.mail = state.backend.email;
|
|
40
|
-
}
|
|
41
|
-
handleEmail(event) {
|
|
42
|
-
const input = event.target;
|
|
43
|
-
this.mail = input.value;
|
|
44
|
-
}
|
|
45
|
-
static get styles() {
|
|
46
|
-
return [
|
|
47
|
-
labelStyle,
|
|
48
|
-
inputStyle,
|
|
49
|
-
buttonStyle,
|
|
50
|
-
css `
|
|
51
|
-
|
|
52
|
-
:host {
|
|
53
|
-
display: grid;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
form { display: grid; }
|
|
57
|
-
|
|
58
|
-
`
|
|
59
|
-
];
|
|
60
|
-
}
|
|
61
|
-
render() {
|
|
62
|
-
return html `
|
|
63
|
-
|
|
64
|
-
<form
|
|
65
|
-
autocomplete="off"
|
|
66
|
-
@submit="${this.default}">
|
|
67
|
-
|
|
68
|
-
<label for="pwa-email" >E-mail:</label>
|
|
69
|
-
|
|
70
|
-
<input
|
|
71
|
-
id = "pwa-email"
|
|
72
|
-
name = "email"
|
|
73
|
-
type = "email"
|
|
74
|
-
class = "email"
|
|
75
|
-
data-label = "Account Email"
|
|
76
|
-
@input = "${this.handleEmail}"
|
|
77
|
-
.value = "${this.mail}"/>
|
|
78
|
-
|
|
79
|
-
<button
|
|
80
|
-
class = "action-button"
|
|
81
|
-
@click = "${this.saveEmail}"
|
|
82
|
-
?disabled = "${this.login === false}">Update</button>
|
|
83
|
-
|
|
84
|
-
</form>
|
|
85
|
-
|
|
86
|
-
`;
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
__decorate([
|
|
90
|
-
property({ type: String, reflect: true })
|
|
91
|
-
], ContactEmail.prototype, "email", void 0);
|
|
92
|
-
__decorate([
|
|
93
|
-
state()
|
|
94
|
-
], ContactEmail.prototype, "login", void 0);
|
|
95
|
-
__decorate([
|
|
96
|
-
state()
|
|
97
|
-
], ContactEmail.prototype, "mail", void 0);
|
|
98
|
-
customElements.define('contact-email', ContactEmail);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"images.d.ts","sourceRoot":"","sources":["../../../../source/custom-elements/settings/input/images.ts"],"names":[],"mappings":"AAwBA,eAAO,MAAM,WAAW,YA6BrB,CAAA"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { ref } from "@firebase/storage";
|
|
2
|
-
import { storage } from "../../../firebase/start";
|
|
3
|
-
export const _listImages = () => {
|
|
4
|
-
const storageRef = ref(storage);
|
|
5
|
-
const listRef = storageRef
|
|
6
|
-
.child('images/');
|
|
7
|
-
listRef
|
|
8
|
-
.listAll()
|
|
9
|
-
.then((res) => {
|
|
10
|
-
console.log('res:', res);
|
|
11
|
-
res
|
|
12
|
-
.prefixes
|
|
13
|
-
.forEach((folderRef) => {
|
|
14
|
-
console.log('folderRef: ', folderRef);
|
|
15
|
-
});
|
|
16
|
-
res
|
|
17
|
-
.items
|
|
18
|
-
.forEach((itemRef) => {
|
|
19
|
-
console.log('itemRef: ', itemRef);
|
|
20
|
-
});
|
|
21
|
-
}).catch((error) => { console.log("Could not get storage items: ", error); });
|
|
22
|
-
};
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { CSSResultArray, LitElement } from "lit";
|
|
2
|
-
import { AppState } from "../../../store";
|
|
3
|
-
declare const InputName_base: (new (...args: any[]) => {
|
|
4
|
-
_storeUnsubscribe: import("redux").Unsubscribe;
|
|
5
|
-
connectedCallback(): void;
|
|
6
|
-
disconnectedCallback(): void;
|
|
7
|
-
stateChanged(_state: {
|
|
8
|
-
frontend: import("../../../redux/object").frontendAuth;
|
|
9
|
-
drawer: {
|
|
10
|
-
drawer: boolean;
|
|
11
|
-
};
|
|
12
|
-
backend: import("../../../redux/object").backendAuth;
|
|
13
|
-
}): void;
|
|
14
|
-
readonly isConnected: boolean;
|
|
15
|
-
}) & typeof LitElement;
|
|
16
|
-
export declare class InputName extends InputName_base {
|
|
17
|
-
value: string;
|
|
18
|
-
private login;
|
|
19
|
-
constructor();
|
|
20
|
-
stateChanged(state: AppState): void;
|
|
21
|
-
static get styles(): CSSResultArray;
|
|
22
|
-
render(): import("lit-html").TemplateResult<1>;
|
|
23
|
-
private default;
|
|
24
|
-
private handleInput;
|
|
25
|
-
private alertProfile;
|
|
26
|
-
}
|
|
27
|
-
declare global {
|
|
28
|
-
interface HTMLElementTagNameMap {
|
|
29
|
-
'input-name': InputName;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
export {};
|
|
33
|
-
//# sourceMappingURL=name.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"name.d.ts","sourceRoot":"","sources":["../../../../source/custom-elements/settings/input/name.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,UAAU,EAAa,MAAM,KAAK,CAAC;AAG5D,OAAO,EAAS,QAAQ,EAAE,MAAS,gBAAgB,CAAC;;;;;;;;;;;;;;AAQpD,qBAAa,SAAU,SAAQ,cAA0B;IAGN,KAAK,SAAM;IAEnD,OAAO,CAAC,KAAK,CAAmB;;IAIzC,YAAY,CAAC,KAAK,EAAE,QAAQ;IAK5B,MAAM,KAAK,MAAM,IAAI,cAAc,CAQ3B;IAER,MAAM;IA6BN,OAAO,CAAC,OAAO,CAEd;IAGD,OAAO,CAAC,WAAW;IAKnB,OAAO,CAAC,YAAY,CAWnB;CAKF;AAID,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,YAAY,EAAE,SAAS,CAAC;KACzB;CACF"}
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
-
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;
|
|
5
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
-
};
|
|
7
|
-
import { LitElement, css, html } from "lit";
|
|
8
|
-
import { property, state } from "lit/decorators.js";
|
|
9
|
-
import { connect } from "pwa-helpers";
|
|
10
|
-
import { store } from "../../../store";
|
|
11
|
-
import { updateProfile } from "firebase/auth";
|
|
12
|
-
import { accName } from "../../../redux/backend";
|
|
13
|
-
import { auth } from "../../../firebase/start";
|
|
14
|
-
import { labelStyle } from "../../../css/form/label";
|
|
15
|
-
import { inputStyle } from "../../../css/form/input";
|
|
16
|
-
import { buttonStyle } from "../../../css/form/button";
|
|
17
|
-
export class InputName extends connect(store)(LitElement) {
|
|
18
|
-
constructor() {
|
|
19
|
-
super();
|
|
20
|
-
this.value = '';
|
|
21
|
-
this.login = false;
|
|
22
|
-
this.default = (e) => {
|
|
23
|
-
e.preventDefault();
|
|
24
|
-
};
|
|
25
|
-
this.alertProfile = async () => {
|
|
26
|
-
if (auth.currentUser) {
|
|
27
|
-
await updateProfile(auth.currentUser, { displayName: this.value })
|
|
28
|
-
.then(() => { store.dispatch(accName(this.value)); })
|
|
29
|
-
.then(() => { alert('updated name:' + this.value); });
|
|
30
|
-
}
|
|
31
|
-
else {
|
|
32
|
-
alert('Please Login');
|
|
33
|
-
}
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
stateChanged(state) {
|
|
37
|
-
this.login = state.frontend.login;
|
|
38
|
-
this.value = state.backend.name;
|
|
39
|
-
}
|
|
40
|
-
static get styles() {
|
|
41
|
-
return [
|
|
42
|
-
labelStyle,
|
|
43
|
-
inputStyle,
|
|
44
|
-
buttonStyle,
|
|
45
|
-
css `
|
|
46
|
-
|
|
47
|
-
:host, form { display: grid; }
|
|
48
|
-
|
|
49
|
-
`
|
|
50
|
-
];
|
|
51
|
-
}
|
|
52
|
-
render() {
|
|
53
|
-
return html `
|
|
54
|
-
|
|
55
|
-
<form
|
|
56
|
-
@submit="${this.default}">
|
|
57
|
-
|
|
58
|
-
<label
|
|
59
|
-
for="pwa-name"><span>Name:</span></label>
|
|
60
|
-
|
|
61
|
-
<input
|
|
62
|
-
id = "pwa-name"
|
|
63
|
-
name = "username"
|
|
64
|
-
type = "text"
|
|
65
|
-
data-label = "Contact Name"
|
|
66
|
-
@input = "${this.handleInput}"
|
|
67
|
-
.value = "${this.value}" />
|
|
68
|
-
|
|
69
|
-
<!-- Save to Database -->
|
|
70
|
-
<button
|
|
71
|
-
class="action-button save"
|
|
72
|
-
@click="${this.alertProfile}"
|
|
73
|
-
?disabled="${this.login === false}">Update</button>
|
|
74
|
-
|
|
75
|
-
</form>
|
|
76
|
-
|
|
77
|
-
`;
|
|
78
|
-
}
|
|
79
|
-
handleInput(event) {
|
|
80
|
-
const input = event.target;
|
|
81
|
-
this.value = input.value;
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
__decorate([
|
|
85
|
-
property({ type: String, reflect: true })
|
|
86
|
-
], InputName.prototype, "value", void 0);
|
|
87
|
-
__decorate([
|
|
88
|
-
state()
|
|
89
|
-
], InputName.prototype, "login", void 0);
|
|
90
|
-
customElements.define('input-name', InputName);
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { CSSResultArray, LitElement } from "lit";
|
|
2
|
-
import { AppState } from "../../../store";
|
|
3
|
-
declare const InputPassword_base: (new (...args: any[]) => {
|
|
4
|
-
_storeUnsubscribe: import("redux").Unsubscribe;
|
|
5
|
-
connectedCallback(): void;
|
|
6
|
-
disconnectedCallback(): void;
|
|
7
|
-
stateChanged(_state: {
|
|
8
|
-
frontend: import("../../../redux/object").frontendAuth;
|
|
9
|
-
drawer: {
|
|
10
|
-
drawer: boolean;
|
|
11
|
-
};
|
|
12
|
-
backend: import("../../../redux/object").backendAuth;
|
|
13
|
-
}): void;
|
|
14
|
-
readonly isConnected: boolean;
|
|
15
|
-
}) & typeof LitElement;
|
|
16
|
-
export declare class InputPassword extends InputPassword_base {
|
|
17
|
-
private message;
|
|
18
|
-
private password;
|
|
19
|
-
private login;
|
|
20
|
-
constructor();
|
|
21
|
-
protected firstUpdated(): void;
|
|
22
|
-
stateChanged(state: AppState): void;
|
|
23
|
-
private handleInputChange;
|
|
24
|
-
static get styles(): CSSResultArray;
|
|
25
|
-
render(): import("lit-html").TemplateResult<1>;
|
|
26
|
-
private default;
|
|
27
|
-
private alertPassword;
|
|
28
|
-
private updatePass;
|
|
29
|
-
}
|
|
30
|
-
declare global {
|
|
31
|
-
interface HTMLElementTagNameMap {
|
|
32
|
-
'input-password': InputPassword;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
export {};
|
|
36
|
-
//# sourceMappingURL=password.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"password.d.ts","sourceRoot":"","sources":["../../../../source/custom-elements/settings/input/password.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,UAAU,EAAa,MAAM,KAAK,CAAC;AAG5D,OAAc,EAAE,QAAQ,EAAE,MAAO,gBAAgB,CAAC;;;;;;;;;;;;;;AAOlD,qBAAa,aAAc,SAAQ,kBAA0B;IAElD,OAAO,CAAC,OAAO,CAAqB;IACpC,OAAO,CAAC,QAAQ,CAAoB;IACpC,OAAO,CAAC,KAAK,CAA0B;;IAIhD,SAAS,CAAC,YAAY;IAQrB,YAAY,CAAC,KAAK,EAAE,QAAQ;IAK7B,OAAO,CAAC,iBAAiB;IAKzB,MAAM,KAAK,MAAM,IAAI,cAAc,CAc3B;IAER,MAAM;IAkDN,OAAO,CAAC,OAAO,CAEd;IAGD,OAAO,CAAC,aAAa;IAuBrB,OAAO,CAAC,UAAU,CAWjB;CAEF;AAID,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,gBAAgB,EAAE,aAAa,CAAC;KACjC;CACF"}
|
|
@@ -1,145 +0,0 @@
|
|
|
1
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
-
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;
|
|
5
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
-
};
|
|
7
|
-
import { LitElement, css, html } from "lit";
|
|
8
|
-
import { state } from "lit/decorators.js";
|
|
9
|
-
import { connect } from "pwa-helpers";
|
|
10
|
-
import store from "../../../store";
|
|
11
|
-
import { auth } from "../../../firebase/start";
|
|
12
|
-
import { labelStyle } from "../../../css/form/label";
|
|
13
|
-
import { inputStyle } from "../../../css/form/input";
|
|
14
|
-
import { buttonStyle } from "../../../css/form/button";
|
|
15
|
-
import { updatePassword } from "firebase/auth";
|
|
16
|
-
export class InputPassword extends connect(store)(LitElement) {
|
|
17
|
-
constructor() {
|
|
18
|
-
super();
|
|
19
|
-
this.message = '';
|
|
20
|
-
this.password = '';
|
|
21
|
-
this.login = false;
|
|
22
|
-
this.default = (e) => {
|
|
23
|
-
e.preventDefault();
|
|
24
|
-
};
|
|
25
|
-
this.updatePass = async (newPassword) => {
|
|
26
|
-
if (auth.currentUser) {
|
|
27
|
-
await updatePassword(auth.currentUser, newPassword)
|
|
28
|
-
.then(() => { console.log("Password successful!"); })
|
|
29
|
-
.catch((error) => { console.log("Problem: " + error.messge); });
|
|
30
|
-
}
|
|
31
|
-
else {
|
|
32
|
-
alert('Please Login');
|
|
33
|
-
}
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
firstUpdated() {
|
|
37
|
-
this.shadowRoot.querySelector('.pass').addEventListener('click', () => {
|
|
38
|
-
this.alertPassword();
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
stateChanged(state) {
|
|
42
|
-
this.login = state.frontend.login;
|
|
43
|
-
}
|
|
44
|
-
handleInputChange(event) {
|
|
45
|
-
const input = event.target;
|
|
46
|
-
this.password = input.value;
|
|
47
|
-
}
|
|
48
|
-
static get styles() {
|
|
49
|
-
return [
|
|
50
|
-
labelStyle,
|
|
51
|
-
inputStyle,
|
|
52
|
-
buttonStyle,
|
|
53
|
-
css `
|
|
54
|
-
|
|
55
|
-
:host{
|
|
56
|
-
display: grid;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
form { display: grid; }
|
|
60
|
-
|
|
61
|
-
p.error { color: red; }
|
|
62
|
-
|
|
63
|
-
`
|
|
64
|
-
];
|
|
65
|
-
}
|
|
66
|
-
render() {
|
|
67
|
-
return html `
|
|
68
|
-
|
|
69
|
-
<form
|
|
70
|
-
autocomplete="off"
|
|
71
|
-
@submit="${this.default}">
|
|
72
|
-
|
|
73
|
-
<!-- Input - 1 -->
|
|
74
|
-
<label for="pwa-new-password">New Password</label>
|
|
75
|
-
|
|
76
|
-
<input
|
|
77
|
-
id = "pwa-new-password"
|
|
78
|
-
name = "new_password"
|
|
79
|
-
type = "password"
|
|
80
|
-
.value = "${this.password}"
|
|
81
|
-
@input = "${this.handleInputChange}"
|
|
82
|
-
aria-describedby = "password-help">
|
|
83
|
-
|
|
84
|
-
<!-- Input - 2 -->
|
|
85
|
-
<label for="pwa-verify-password">Verify Password</label>
|
|
86
|
-
|
|
87
|
-
<input
|
|
88
|
-
id = "pwa-verify-password"
|
|
89
|
-
name = "verify_password"
|
|
90
|
-
type = "password">
|
|
91
|
-
|
|
92
|
-
<!-- Submit -->
|
|
93
|
-
<button
|
|
94
|
-
class="action-button pass"
|
|
95
|
-
?disabled="${this.login === false}">Update</button>
|
|
96
|
-
|
|
97
|
-
${this.message ? html `
|
|
98
|
-
|
|
99
|
-
<p
|
|
100
|
-
class=${this.message.includes('Password entered') ? '' : 'error'}
|
|
101
|
-
aria-live="polite">
|
|
102
|
-
|
|
103
|
-
${this.message}
|
|
104
|
-
|
|
105
|
-
</p>
|
|
106
|
-
|
|
107
|
-
` : ''}
|
|
108
|
-
|
|
109
|
-
</form>
|
|
110
|
-
|
|
111
|
-
`;
|
|
112
|
-
}
|
|
113
|
-
alertPassword() {
|
|
114
|
-
if (!this.password) {
|
|
115
|
-
this.message = 'Please enter a password';
|
|
116
|
-
}
|
|
117
|
-
else if (this.password.length < 8) {
|
|
118
|
-
this.message = 'Password must be at least 8 characters long';
|
|
119
|
-
}
|
|
120
|
-
else {
|
|
121
|
-
this.message = `Password entered:`;
|
|
122
|
-
if (!/^(?=.*[A-Za-z])(?=.*\d)[A-Za-z\d]{8,}$/.test(this.password)) {
|
|
123
|
-
this.message = 'Password must include letters, numbers, and be 8+ characters';
|
|
124
|
-
}
|
|
125
|
-
else {
|
|
126
|
-
if (auth.currentUser) {
|
|
127
|
-
this.updatePass(this.password);
|
|
128
|
-
}
|
|
129
|
-
else {
|
|
130
|
-
alert('Please Login');
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
__decorate([
|
|
137
|
-
state()
|
|
138
|
-
], InputPassword.prototype, "message", void 0);
|
|
139
|
-
__decorate([
|
|
140
|
-
state()
|
|
141
|
-
], InputPassword.prototype, "password", void 0);
|
|
142
|
-
__decorate([
|
|
143
|
-
state()
|
|
144
|
-
], InputPassword.prototype, "login", void 0);
|
|
145
|
-
customElements.define('input-password', InputPassword);
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { LitElement, CSSResultArray } from 'lit';
|
|
2
|
-
import { AppState } from '../../../store';
|
|
3
|
-
declare const ContactPhoto_base: (new (...args: any[]) => {
|
|
4
|
-
_storeUnsubscribe: import("redux").Unsubscribe;
|
|
5
|
-
connectedCallback(): void;
|
|
6
|
-
disconnectedCallback(): void;
|
|
7
|
-
stateChanged(_state: {
|
|
8
|
-
frontend: import("../../../redux/object").frontendAuth;
|
|
9
|
-
drawer: {
|
|
10
|
-
drawer: boolean;
|
|
11
|
-
};
|
|
12
|
-
backend: import("../../../redux/object").backendAuth;
|
|
13
|
-
}): void;
|
|
14
|
-
readonly isConnected: boolean;
|
|
15
|
-
}) & typeof LitElement;
|
|
16
|
-
export declare class ContactPhoto extends ContactPhoto_base {
|
|
17
|
-
photo: string | void | any;
|
|
18
|
-
emptyArtwork: string;
|
|
19
|
-
private user;
|
|
20
|
-
private login;
|
|
21
|
-
private progress;
|
|
22
|
-
private error;
|
|
23
|
-
private status;
|
|
24
|
-
constructor();
|
|
25
|
-
stateChanged(state: AppState): void;
|
|
26
|
-
static get styles(): CSSResultArray;
|
|
27
|
-
protected render(): import("lit-html").TemplateResult<1>;
|
|
28
|
-
private saveImage;
|
|
29
|
-
private dispatchPhoto;
|
|
30
|
-
}
|
|
31
|
-
declare global {
|
|
32
|
-
interface HTMLElementTagNameMap {
|
|
33
|
-
'contact-photo': ContactPhoto;
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
export {};
|
|
37
|
-
//# sourceMappingURL=uploader.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"uploader.d.ts","sourceRoot":"","sources":["../../../../source/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;IAGJ,YAAY,SAAM;IAEzD,OAAO,CAAC,IAAI,CAAsB;IAClC,OAAO,CAAC,KAAK,CAAmB;IAIhC,OAAO,CAAC,QAAQ,CAAa;IAE7B,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;YA6FF,SAAS;IA0IvB,OAAO,CAAC,aAAa,CAYpB;CAEF;AAID,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC3B,eAAe,EAAE,YAAY,CAAC;KACjC;CACF"}
|