pwa-auth 2.0.8 → 3.0.2
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 +6 -0
- package/README.md +37 -18
- package/demonstration/compiled/pwa-auth.js +880 -0
- package/{demo → demonstration}/index.html +1 -1
- package/package.json +8 -7
- package/pwa-auth.js +4 -3
- package/{website → src}/THIRD_PARTY_LICENSES.txt +56 -56
- package/src/compiled/pwa-auth.js +871 -0
- 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 +2 -2
- 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 +1 -1
- package/{source/custom-elements → src-typescript/webcomponents}/settings/settings.ts +2 -2
- 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 -22
- 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 -225
- 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/css/styles.css +0 -48
- 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 -69
- package/website/js/images/empty.jpg +0 -0
- 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}/css/styles.css +0 -0
- /package/{demo → demonstration}/images/empty.jpg +0 -0
- /package/{npm → 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/label.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,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;YA8FF,SAAS;IA0IvB,OAAO,CAAC,aAAa,CAYpB;CAEF;AAID,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC3B,eAAe,EAAE,YAAY,CAAC;KACjC;CACF"}
|
|
@@ -1,225 +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 { html, css, LitElement } from 'lit';
|
|
8
|
-
import { property, state } from 'lit/decorators.js';
|
|
9
|
-
import { store } from '../../../store';
|
|
10
|
-
import { connect } from 'pwa-helpers';
|
|
11
|
-
import { auth, storage, user } from '../../../firebase/start';
|
|
12
|
-
import { updateProfile } from 'firebase/auth';
|
|
13
|
-
import { accImage } from '../../../redux/backend';
|
|
14
|
-
import { ref, updateMetadata, getDownloadURL, uploadBytesResumable } from "@firebase/storage";
|
|
15
|
-
import { labelStyle } from '../../../css/form/label';
|
|
16
|
-
export class ContactPhoto extends connect(store)(LitElement) {
|
|
17
|
-
constructor() {
|
|
18
|
-
super();
|
|
19
|
-
this.photo = '';
|
|
20
|
-
this.emptyArtwork = '';
|
|
21
|
-
this.user = '';
|
|
22
|
-
this.login = false;
|
|
23
|
-
this.progress = 0;
|
|
24
|
-
this.error = '';
|
|
25
|
-
this.status = '';
|
|
26
|
-
this.dispatchPhoto = async (url) => {
|
|
27
|
-
if (auth.currentUser) {
|
|
28
|
-
await updateProfile(auth.currentUser, { photoURL: url }).catch((error) => { console.log(error); });
|
|
29
|
-
store.dispatch(accImage(url));
|
|
30
|
-
}
|
|
31
|
-
};
|
|
32
|
-
this.progress = 0;
|
|
33
|
-
this.error = '';
|
|
34
|
-
this.status = '';
|
|
35
|
-
}
|
|
36
|
-
stateChanged(state) {
|
|
37
|
-
this.login = state.frontend.login;
|
|
38
|
-
this.user = state.backend.userId;
|
|
39
|
-
this.photo = state.backend.photoURL;
|
|
40
|
-
}
|
|
41
|
-
static get styles() {
|
|
42
|
-
return [
|
|
43
|
-
labelStyle,
|
|
44
|
-
css `
|
|
45
|
-
|
|
46
|
-
:host {
|
|
47
|
-
box-sizing: border-box;
|
|
48
|
-
-webkit-box-sizing: border-box;
|
|
49
|
-
display: grid;
|
|
50
|
-
grid-template-columns: 1fr;
|
|
51
|
-
grid-gap: 4px;
|
|
52
|
-
width: 100%;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
input[type=file] {
|
|
56
|
-
border-radius: 50%;
|
|
57
|
-
overflow: hidden;
|
|
58
|
-
margin: auto;
|
|
59
|
-
border: 2px solid #303030;
|
|
60
|
-
box-shadow: 1px 1px 2px black, 0 0 25px grey, 0 0 5px #fff;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
`
|
|
64
|
-
];
|
|
65
|
-
}
|
|
66
|
-
render() {
|
|
67
|
-
return html `
|
|
68
|
-
<label
|
|
69
|
-
for="pwa-uploader"
|
|
70
|
-
style="
|
|
71
|
-
grid-template-columns: auto 1fr;
|
|
72
|
-
grid-gap:16px;
|
|
73
|
-
padding: 0 16px;
|
|
74
|
-
">Upload:
|
|
75
|
-
<progress
|
|
76
|
-
id ="pwa-uploader"
|
|
77
|
-
class ="uploader"
|
|
78
|
-
value ="0"
|
|
79
|
-
max ="100"
|
|
80
|
-
style="
|
|
81
|
-
height: 24px;
|
|
82
|
-
width: 100%;
|
|
83
|
-
margin: auto;
|
|
84
|
-
"></label>
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
<!-- Input - Upload Image -->
|
|
89
|
-
<input
|
|
90
|
-
id ="photoURL"
|
|
91
|
-
type ="file"
|
|
92
|
-
name ="photoURL"
|
|
93
|
-
class ="contractorPhoto"
|
|
94
|
-
accept ="image/*"
|
|
95
|
-
@change ="${this.saveImage}"
|
|
96
|
-
?disabled="${this.login === false}"
|
|
97
|
-
style ="
|
|
98
|
-
display: none;
|
|
99
|
-
cursor: pointer;
|
|
100
|
-
position: absolute;
|
|
101
|
-
z-index: -1;
|
|
102
|
-
"/></progress>
|
|
103
|
-
|
|
104
|
-
<label
|
|
105
|
-
style="
|
|
106
|
-
border: 2px dashed;
|
|
107
|
-
border-radius: 6px;
|
|
108
|
-
overflow: hidden;
|
|
109
|
-
margin: 0 16px;
|
|
110
|
-
padding: 0 16px 16px 16px;
|
|
111
|
-
"
|
|
112
|
-
for ="photoURL">Photo:
|
|
113
|
-
|
|
114
|
-
<!-- Output - Retrieved Image -->
|
|
115
|
-
<canvas
|
|
116
|
-
style="
|
|
117
|
-
margin: auto;
|
|
118
|
-
height: 200px;
|
|
119
|
-
width: 100%;
|
|
120
|
-
background-image: url(${this.photo ? this.photo : this.emptyArtwork});
|
|
121
|
-
background-size: contain;
|
|
122
|
-
background-repeat: no-repeat;
|
|
123
|
-
background-position: center;
|
|
124
|
-
cursor: pointer;
|
|
125
|
-
overflow: hidden;
|
|
126
|
-
box-sizing: border-box;
|
|
127
|
-
">
|
|
128
|
-
</canvas>
|
|
129
|
-
|
|
130
|
-
</label>
|
|
131
|
-
|
|
132
|
-
<p style="text-align:center;">${this.status}${this.error}</p>
|
|
133
|
-
`;
|
|
134
|
-
}
|
|
135
|
-
async saveImage() {
|
|
136
|
-
const uploader = this.shadowRoot.querySelector('.uploader');
|
|
137
|
-
if (auth.currentUser) {
|
|
138
|
-
this.error = '';
|
|
139
|
-
this.status = 'Uploading...';
|
|
140
|
-
const file = this.shadowRoot.querySelector('#photoURL');
|
|
141
|
-
if (!file) {
|
|
142
|
-
console.error('No file selected');
|
|
143
|
-
return;
|
|
144
|
-
}
|
|
145
|
-
const location = ref(storage, "/" +
|
|
146
|
-
"pwa-auth" +
|
|
147
|
-
"/" +
|
|
148
|
-
this.user +
|
|
149
|
-
"/" +
|
|
150
|
-
file.files[0].name);
|
|
151
|
-
const newMetadata = {
|
|
152
|
-
cacheControl: 'public,max-age=300',
|
|
153
|
-
contentType: file.files[0].type
|
|
154
|
-
};
|
|
155
|
-
const uploadTask = uploadBytesResumable(location, file.files[0], newMetadata);
|
|
156
|
-
uploadTask.on('state_changed', (snapshot) => {
|
|
157
|
-
this.progress = (snapshot.bytesTransferred / snapshot.totalBytes) * 100;
|
|
158
|
-
this.status = `Upload is ${Math.round(this.progress)}% done`;
|
|
159
|
-
switch (snapshot.state) {
|
|
160
|
-
case 'paused':
|
|
161
|
-
this.status = 'Upload is paused';
|
|
162
|
-
break;
|
|
163
|
-
case 'running':
|
|
164
|
-
this.status = `Upload is running (${Math.round(this.progress)}%)`;
|
|
165
|
-
break;
|
|
166
|
-
}
|
|
167
|
-
let progress = 0;
|
|
168
|
-
if (snapshot.totalBytes > 0) {
|
|
169
|
-
progress = (snapshot.bytesTransferred / snapshot.totalBytes) * 100;
|
|
170
|
-
}
|
|
171
|
-
if (isFinite(progress)) {
|
|
172
|
-
uploader.value = progress;
|
|
173
|
-
uploader.textContent = `${Math.round(progress)}%`;
|
|
174
|
-
}
|
|
175
|
-
else {
|
|
176
|
-
uploader.value = 0;
|
|
177
|
-
uploader.textContent = '0%';
|
|
178
|
-
}
|
|
179
|
-
}, (error) => {
|
|
180
|
-
this.error = `Upload failed: ${error.message}`;
|
|
181
|
-
this.status = '';
|
|
182
|
-
console.error('Upload failed:', error);
|
|
183
|
-
uploader.value = 0;
|
|
184
|
-
uploader.textContent = 'Error';
|
|
185
|
-
}, async () => {
|
|
186
|
-
await getDownloadURL(uploadTask.snapshot.ref)
|
|
187
|
-
.then((url) => {
|
|
188
|
-
updateMetadata(location, newMetadata)
|
|
189
|
-
.then(() => { }).catch((error) => { console.log("error: ", error); });
|
|
190
|
-
if (user) {
|
|
191
|
-
updateProfile(user, { photoURL: url })
|
|
192
|
-
.then(() => {
|
|
193
|
-
uploader.value = 100;
|
|
194
|
-
uploader.textContent = 'Complete';
|
|
195
|
-
});
|
|
196
|
-
this.status = 'User profile updated successfully!';
|
|
197
|
-
this.dispatchPhoto(url);
|
|
198
|
-
}
|
|
199
|
-
}).catch(() => { });
|
|
200
|
-
});
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
|
-
__decorate([
|
|
205
|
-
property()
|
|
206
|
-
], ContactPhoto.prototype, "photo", void 0);
|
|
207
|
-
__decorate([
|
|
208
|
-
property({ type: String, reflect: true })
|
|
209
|
-
], ContactPhoto.prototype, "emptyArtwork", void 0);
|
|
210
|
-
__decorate([
|
|
211
|
-
state()
|
|
212
|
-
], ContactPhoto.prototype, "user", void 0);
|
|
213
|
-
__decorate([
|
|
214
|
-
state()
|
|
215
|
-
], ContactPhoto.prototype, "login", void 0);
|
|
216
|
-
__decorate([
|
|
217
|
-
state()
|
|
218
|
-
], ContactPhoto.prototype, "progress", void 0);
|
|
219
|
-
__decorate([
|
|
220
|
-
state()
|
|
221
|
-
], ContactPhoto.prototype, "error", void 0);
|
|
222
|
-
__decorate([
|
|
223
|
-
state()
|
|
224
|
-
], ContactPhoto.prototype, "status", void 0);
|
|
225
|
-
customElements.define('contact-photo', ContactPhoto);
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { LitElement } from 'lit';
|
|
2
|
-
import { AppState } from '../../store';
|
|
3
|
-
import './input/uploader';
|
|
4
|
-
import './input/name';
|
|
5
|
-
import './input/email';
|
|
6
|
-
import './input/password';
|
|
7
|
-
import './input/delete';
|
|
8
|
-
declare const UserSettings_base: (new (...args: any[]) => {
|
|
9
|
-
_storeUnsubscribe: import("redux").Unsubscribe;
|
|
10
|
-
connectedCallback(): void;
|
|
11
|
-
disconnectedCallback(): void;
|
|
12
|
-
stateChanged(_state: {
|
|
13
|
-
frontend: import("../../redux/object").frontendAuth;
|
|
14
|
-
drawer: {
|
|
15
|
-
drawer: boolean;
|
|
16
|
-
};
|
|
17
|
-
backend: import("../../redux/object").backendAuth;
|
|
18
|
-
}): void;
|
|
19
|
-
readonly isConnected: boolean;
|
|
20
|
-
}) & typeof LitElement;
|
|
21
|
-
export declare class UserSettings extends UserSettings_base {
|
|
22
|
-
emptyArtwork: string;
|
|
23
|
-
private profileTopic;
|
|
24
|
-
private name;
|
|
25
|
-
constructor();
|
|
26
|
-
protected firstUpdated(): void;
|
|
27
|
-
stateChanged(state: AppState): void;
|
|
28
|
-
static get styles(): import("lit").CSSResult[];
|
|
29
|
-
protected render(): import("lit-html").TemplateResult<1>;
|
|
30
|
-
}
|
|
31
|
-
declare global {
|
|
32
|
-
interface HTMLElementTagNameMap {
|
|
33
|
-
'user-settings': UserSettings;
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
export {};
|
|
37
|
-
//# sourceMappingURL=settings.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"settings.d.ts","sourceRoot":"","sources":["../../../source/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;IAGV,YAAY,SAAM;IAEzD,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"}
|