pwa-auth 3.2.5 → 3.3.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 +10 -1
- package/{THIRD_PARTY_LICENSES.txt → LICENSES.txt} +57 -57
- package/README.md +88 -65
- package/base/export/pwa-auth.d.ts +2 -0
- package/base/export/pwa-auth.js +2 -0
- package/base/export/pwa-auth.js.map +1 -1
- package/base/lazy-loader.d.ts +11 -0
- package/base/lazy-loader.js +23 -0
- package/base/lazy-loader.js.map +1 -0
- package/base/redux/frontend.d.ts +41 -14
- package/base/redux/frontend.js +25 -6
- package/base/redux/frontend.js.map +1 -1
- package/base/store.d.ts +4 -2
- package/base/webcomponents/css/animation.d.ts +2 -0
- package/base/webcomponents/css/animation.js +68 -0
- package/base/webcomponents/css/animation.js.map +1 -0
- package/base/webcomponents/css/svg.js.map +1 -0
- package/base/{css → webcomponents/css}/toggle.js +0 -1
- package/base/webcomponents/css/toggle.js.map +1 -0
- package/base/webcomponents/drawer/css/drawer.js +7 -10
- package/base/webcomponents/drawer/css/drawer.js.map +1 -1
- package/base/webcomponents/drawer/drawer.d.ts +7 -6
- package/base/webcomponents/drawer/drawer.js +46 -31
- package/base/webcomponents/drawer/drawer.js.map +1 -1
- package/base/{css/form → webcomponents/form/css}/button.js +1 -2
- package/base/webcomponents/form/css/button.js.map +1 -0
- package/base/{css/form → webcomponents/form/css}/input.js +0 -1
- package/base/webcomponents/form/css/input.js.map +1 -0
- package/base/webcomponents/form/css/label.js.map +1 -0
- package/base/{css/form → webcomponents/form/css}/list.js +1 -2
- package/base/webcomponents/form/css/list.js.map +1 -0
- package/base/webcomponents/{drawer → form}/css/toggle.js +0 -1
- package/base/webcomponents/form/css/toggle.js.map +1 -0
- package/base/webcomponents/form/forgot.d.ts +15 -0
- package/base/webcomponents/form/forgot.js +66 -0
- package/base/webcomponents/form/forgot.js.map +1 -0
- package/base/webcomponents/{drawer/input → form}/login.d.ts +3 -2
- package/base/webcomponents/form/login.js +158 -0
- package/base/webcomponents/form/login.js.map +1 -0
- package/base/webcomponents/{drawer/input/sign-up.d.ts → form/signup.d.ts} +3 -2
- package/base/webcomponents/{drawer/input/sign-up.js → form/signup.js} +75 -49
- package/base/webcomponents/form/signup.js.map +1 -0
- package/base/webcomponents/icon/css/icon.js +0 -5
- package/base/webcomponents/icon/css/icon.js.map +1 -1
- package/base/webcomponents/icon/icon.d.ts +2 -1
- package/base/webcomponents/icon/icon.js +7 -5
- package/base/webcomponents/icon/icon.js.map +1 -1
- package/base/webcomponents/login/css/auth.d.ts +2 -0
- package/base/webcomponents/login/css/auth.js +37 -0
- package/base/webcomponents/login/css/auth.js.map +1 -0
- package/base/webcomponents/login/css/link.d.ts +2 -0
- package/base/webcomponents/login/css/link.js +13 -0
- package/base/webcomponents/login/css/link.js.map +1 -0
- package/base/webcomponents/login/css/paragraph.d.ts +2 -0
- package/base/webcomponents/login/css/paragraph.js +11 -0
- package/base/webcomponents/login/css/paragraph.js.map +1 -0
- package/base/webcomponents/login/page.d.ts +55 -0
- package/base/webcomponents/login/page.js +114 -0
- package/base/webcomponents/login/page.js.map +1 -0
- package/base/webcomponents/settings/css/navigation.js +6 -7
- package/base/webcomponents/settings/css/navigation.js.map +1 -1
- package/base/webcomponents/settings/input/delete.d.ts +2 -1
- package/base/webcomponents/settings/input/delete.js +15 -13
- package/base/webcomponents/settings/input/delete.js.map +1 -1
- package/base/webcomponents/settings/input/email.d.ts +2 -1
- package/base/webcomponents/settings/input/email.js +37 -35
- package/base/webcomponents/settings/input/email.js.map +1 -1
- package/base/webcomponents/settings/input/name.d.ts +2 -1
- package/base/webcomponents/settings/input/name.js +24 -20
- package/base/webcomponents/settings/input/name.js.map +1 -1
- package/base/webcomponents/settings/input/password.d.ts +2 -1
- package/base/webcomponents/settings/input/password.js +53 -39
- package/base/webcomponents/settings/input/password.js.map +1 -1
- package/base/webcomponents/settings/input/uploader.d.ts +2 -1
- package/base/webcomponents/settings/input/uploader.js +14 -14
- package/base/webcomponents/settings/input/uploader.js.map +1 -1
- package/base/webcomponents/settings/settings.d.ts +2 -1
- package/base/webcomponents/settings/settings.js +53 -44
- package/base/webcomponents/settings/settings.js.map +1 -1
- package/demonstration/index.html +53 -77
- package/demonstration/styles.css +76 -0
- package/export/pwa-auth.ts +0 -1
- package/package.json +32 -23
- package/source/production/pwa-auth.js +1109 -0
- package/source/pwa-styles.css +2 -0
- package/base/css/form/button.js.map +0 -1
- package/base/css/form/input.js.map +0 -1
- package/base/css/form/label.js.map +0 -1
- package/base/css/form/list.js.map +0 -1
- package/base/css/svg.js.map +0 -1
- package/base/css/toggle.js.map +0 -1
- package/base/webcomponents/drawer/css/toggle.js.map +0 -1
- package/base/webcomponents/drawer/input/login.js +0 -133
- package/base/webcomponents/drawer/input/login.js.map +0 -1
- package/base/webcomponents/drawer/input/sign-up.js.map +0 -1
- package/source/esm/pwa-auth.js +0 -881
- package/source/esm/pwa-auth.js.map +0 -1
- /package/base/{css → webcomponents/css}/svg.d.ts +0 -0
- /package/base/{css → webcomponents/css}/svg.js +0 -0
- /package/base/{css → webcomponents/css}/toggle.d.ts +0 -0
- /package/base/{css/form → webcomponents/form/css}/button.d.ts +0 -0
- /package/base/{css/form → webcomponents/form/css}/input.d.ts +0 -0
- /package/base/{css/form → webcomponents/form/css}/label.d.ts +0 -0
- /package/base/{css/form → webcomponents/form/css}/label.js +0 -0
- /package/base/{css/form → webcomponents/form/css}/list.d.ts +0 -0
- /package/base/webcomponents/{drawer → form}/css/toggle.d.ts +0 -0
|
@@ -0,0 +1,158 @@
|
|
|
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
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
+
};
|
|
10
|
+
import { html, LitElement, css } from 'lit';
|
|
11
|
+
import { customElement, property, state } from 'lit/decorators.js';
|
|
12
|
+
import { EmailAuthProvider, signInWithCredential } from 'firebase/auth';
|
|
13
|
+
import { auth } from '../../firebase/authentication';
|
|
14
|
+
import { buttonStyle } from './css/button';
|
|
15
|
+
import { labelStyle } from './css/label';
|
|
16
|
+
import { inputStyle } from './css/input';
|
|
17
|
+
import { listStyle } from './css/list';
|
|
18
|
+
import { toggleStyle } from './css/toggle';
|
|
19
|
+
import store from '../../store';
|
|
20
|
+
import { universalToggle } from '../../redux/frontend';
|
|
21
|
+
let FormLogin = class FormLogin extends LitElement {
|
|
22
|
+
constructor() {
|
|
23
|
+
super();
|
|
24
|
+
this.source = '';
|
|
25
|
+
this.email = '';
|
|
26
|
+
this.password = '';
|
|
27
|
+
this.signIn = async (email, password) => {
|
|
28
|
+
const authCredential = EmailAuthProvider.credential(email, password);
|
|
29
|
+
await signInWithCredential(auth, authCredential).catch((error) => { console.log(error); });
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
static get styles() {
|
|
33
|
+
return [
|
|
34
|
+
listStyle,
|
|
35
|
+
labelStyle,
|
|
36
|
+
inputStyle,
|
|
37
|
+
buttonStyle,
|
|
38
|
+
toggleStyle,
|
|
39
|
+
css `
|
|
40
|
+
|
|
41
|
+
:host {
|
|
42
|
+
background-color: white;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.double {
|
|
46
|
+
display: grid;
|
|
47
|
+
grid-template-columns: 1fr auto;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
`
|
|
51
|
+
];
|
|
52
|
+
}
|
|
53
|
+
;
|
|
54
|
+
render() {
|
|
55
|
+
return html `
|
|
56
|
+
|
|
57
|
+
<!-- Log-in State -->
|
|
58
|
+
<form
|
|
59
|
+
@submit= ${this._handleSubmit}
|
|
60
|
+
autocomplete= "on">
|
|
61
|
+
|
|
62
|
+
<ul>
|
|
63
|
+
|
|
64
|
+
<li>
|
|
65
|
+
|
|
66
|
+
<label>Email
|
|
67
|
+
|
|
68
|
+
<input
|
|
69
|
+
id= "${this.source}-login-email"
|
|
70
|
+
type= "email"
|
|
71
|
+
@change= "${this.handleEmail}">
|
|
72
|
+
|
|
73
|
+
</label>
|
|
74
|
+
|
|
75
|
+
</li>
|
|
76
|
+
|
|
77
|
+
<li>
|
|
78
|
+
|
|
79
|
+
<label>Password
|
|
80
|
+
|
|
81
|
+
<input
|
|
82
|
+
id= "${this.source}-login-pass"
|
|
83
|
+
type= "password"
|
|
84
|
+
@change= "${this.handlePassword}">
|
|
85
|
+
|
|
86
|
+
</label>
|
|
87
|
+
|
|
88
|
+
</li>
|
|
89
|
+
|
|
90
|
+
<li>
|
|
91
|
+
|
|
92
|
+
<button
|
|
93
|
+
class= "login action-button"
|
|
94
|
+
@click= "${this.login}">Sign in</button>
|
|
95
|
+
|
|
96
|
+
</li>
|
|
97
|
+
|
|
98
|
+
<!-- Change State -->
|
|
99
|
+
<li>
|
|
100
|
+
|
|
101
|
+
<p class= "divider">Or</p>
|
|
102
|
+
|
|
103
|
+
<button
|
|
104
|
+
class= "new"
|
|
105
|
+
@click= "${this.change}">create a new account</button>
|
|
106
|
+
|
|
107
|
+
</li>
|
|
108
|
+
|
|
109
|
+
</ul>
|
|
110
|
+
|
|
111
|
+
</form>
|
|
112
|
+
|
|
113
|
+
`;
|
|
114
|
+
}
|
|
115
|
+
change() {
|
|
116
|
+
store.dispatch(universalToggle(this.source));
|
|
117
|
+
}
|
|
118
|
+
handleEmail(event) {
|
|
119
|
+
const input = event.target;
|
|
120
|
+
this.email = input.value;
|
|
121
|
+
}
|
|
122
|
+
handlePassword(event) {
|
|
123
|
+
const input = event.target;
|
|
124
|
+
this.password = input.value;
|
|
125
|
+
}
|
|
126
|
+
_handleSubmit(event) {
|
|
127
|
+
event.preventDefault();
|
|
128
|
+
}
|
|
129
|
+
login() {
|
|
130
|
+
if (this.email.length < 4) {
|
|
131
|
+
alert('Please enter an email address.');
|
|
132
|
+
return;
|
|
133
|
+
}
|
|
134
|
+
if (this.password.length < 4) {
|
|
135
|
+
alert('Please enter a password.');
|
|
136
|
+
return;
|
|
137
|
+
}
|
|
138
|
+
this.signIn(this.email, this.password);
|
|
139
|
+
}
|
|
140
|
+
};
|
|
141
|
+
__decorate([
|
|
142
|
+
property({ type: String }),
|
|
143
|
+
__metadata("design:type", Object)
|
|
144
|
+
], FormLogin.prototype, "source", void 0);
|
|
145
|
+
__decorate([
|
|
146
|
+
state(),
|
|
147
|
+
__metadata("design:type", Object)
|
|
148
|
+
], FormLogin.prototype, "email", void 0);
|
|
149
|
+
__decorate([
|
|
150
|
+
state(),
|
|
151
|
+
__metadata("design:type", Object)
|
|
152
|
+
], FormLogin.prototype, "password", void 0);
|
|
153
|
+
FormLogin = __decorate([
|
|
154
|
+
customElement('form-login'),
|
|
155
|
+
__metadata("design:paramtypes", [])
|
|
156
|
+
], FormLogin);
|
|
157
|
+
export { FormLogin };
|
|
158
|
+
//# sourceMappingURL=login.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"login.js","sourceRoot":"","sources":["../../../typescript/webcomponents/form/login.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EACL,IAAI,EACJ,UAAU,EACV,GAAG,EACJ,MAA8B,KAAK,CAAC;AAErC,OAAO,EACL,aAAa,EACb,QAAQ,EACR,KAAK,EACN,MAA8B,mBAAmB,CAAC;AAEnD,OAAO,EACL,iBAAiB,EACjB,oBAAoB,EACrB,MAA8B,eAAe,CAAC;AAE/C,OAAO,EAAE,I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|
2
|
+
export declare class FormSignup extends LitElement {
|
|
3
|
+
source: string;
|
|
3
4
|
private email;
|
|
4
5
|
private password;
|
|
5
6
|
constructor();
|
|
@@ -14,6 +15,6 @@ export declare class UserSignUp extends LitElement {
|
|
|
14
15
|
}
|
|
15
16
|
declare global {
|
|
16
17
|
interface HTMLElementTagNameMap {
|
|
17
|
-
'
|
|
18
|
+
'form-signup': FormSignup;
|
|
18
19
|
}
|
|
19
20
|
}
|
|
@@ -8,21 +8,34 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
8
8
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
9
|
};
|
|
10
10
|
import { css, html, LitElement } from 'lit';
|
|
11
|
-
import { customElement, state } from 'lit/decorators.js';
|
|
11
|
+
import { customElement, property, state } from 'lit/decorators.js';
|
|
12
12
|
import { createUserWithEmailAndPassword, sendEmailVerification } from 'firebase/auth';
|
|
13
|
-
import { auth } from '
|
|
14
|
-
import { logAccount } from '
|
|
15
|
-
import { buttonStyle } from '
|
|
16
|
-
import { labelStyle } from '
|
|
17
|
-
import { inputStyle } from '
|
|
18
|
-
import { listStyle } from '
|
|
19
|
-
import { toggleStyle } from '
|
|
20
|
-
import store from '
|
|
21
|
-
import {
|
|
22
|
-
let
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
13
|
+
import { auth } from '../../firebase/authentication';
|
|
14
|
+
import { logAccount } from '../../firebase/interface';
|
|
15
|
+
import { buttonStyle } from './css/button';
|
|
16
|
+
import { labelStyle } from './css/label';
|
|
17
|
+
import { inputStyle } from './css/input';
|
|
18
|
+
import { listStyle } from './css/list';
|
|
19
|
+
import { toggleStyle } from './css/toggle';
|
|
20
|
+
import store from '../../store';
|
|
21
|
+
import { universalToggle } from '../../redux/frontend';
|
|
22
|
+
let FormSignup = class FormSignup extends LitElement {
|
|
23
|
+
constructor() {
|
|
24
|
+
super();
|
|
25
|
+
this.source = '';
|
|
26
|
+
this.email = '';
|
|
27
|
+
this.password = '';
|
|
28
|
+
this.newAccount = async (email, password) => {
|
|
29
|
+
await createUserWithEmailAndPassword(auth, email, password)
|
|
30
|
+
.then((userCredential) => {
|
|
31
|
+
const user = userCredential.user;
|
|
32
|
+
sendEmailVerification(user)
|
|
33
|
+
.then(() => {
|
|
34
|
+
console.log("Verification email sent.");
|
|
35
|
+
});
|
|
36
|
+
}).then(() => { logAccount(); });
|
|
37
|
+
};
|
|
38
|
+
}
|
|
26
39
|
static get styles() {
|
|
27
40
|
return [
|
|
28
41
|
listStyle,
|
|
@@ -31,6 +44,10 @@ let UserSignUp = class UserSignUp extends LitElement {
|
|
|
31
44
|
buttonStyle,
|
|
32
45
|
toggleStyle,
|
|
33
46
|
css `
|
|
47
|
+
|
|
48
|
+
:host {
|
|
49
|
+
background-color: white;
|
|
50
|
+
}
|
|
34
51
|
|
|
35
52
|
.double {
|
|
36
53
|
display: grid;
|
|
@@ -46,43 +63,58 @@ let UserSignUp = class UserSignUp extends LitElement {
|
|
|
46
63
|
|
|
47
64
|
<!-- Sign Up State-->
|
|
48
65
|
<form
|
|
49
|
-
@submit
|
|
50
|
-
autocomplete="on">
|
|
66
|
+
@submit= ${this._handleSubmit}
|
|
67
|
+
autocomplete= "on">
|
|
51
68
|
|
|
52
69
|
<ul>
|
|
53
70
|
|
|
54
71
|
<li>
|
|
55
|
-
|
|
56
|
-
<
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
72
|
+
|
|
73
|
+
<label>Email
|
|
74
|
+
|
|
75
|
+
<input
|
|
76
|
+
id= "${this.source}-signup-email"
|
|
77
|
+
type= "email"
|
|
78
|
+
@change= "${this.handleEmail}">
|
|
79
|
+
|
|
80
|
+
</label>
|
|
81
|
+
|
|
60
82
|
</li>
|
|
61
83
|
|
|
62
84
|
<!-- <label><input id="verifyEmail" type="email" >Verify Email</label> -->
|
|
63
85
|
|
|
64
86
|
<li>
|
|
65
|
-
|
|
66
|
-
<
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
87
|
+
|
|
88
|
+
<label>Password
|
|
89
|
+
|
|
90
|
+
<input
|
|
91
|
+
id= "${this.source}-signup-pass"
|
|
92
|
+
type= "password"
|
|
93
|
+
@change= "${this.handlePassword}">
|
|
94
|
+
|
|
95
|
+
</label>
|
|
96
|
+
|
|
70
97
|
</li>
|
|
71
98
|
|
|
72
99
|
<li>
|
|
100
|
+
|
|
73
101
|
<button
|
|
74
|
-
class="newUser action-button"
|
|
75
|
-
@click="${this.signUp}">Sign up</button>
|
|
102
|
+
class= "newUser action-button"
|
|
103
|
+
@click= "${this.signUp}">Sign up</button>
|
|
104
|
+
|
|
76
105
|
</li>
|
|
77
106
|
|
|
78
107
|
<!-- <label><input id="veriftPassword" type="password" >Verify Password</label> -->
|
|
79
108
|
|
|
80
109
|
<!-- Change State -->
|
|
81
110
|
<li>
|
|
82
|
-
|
|
111
|
+
|
|
112
|
+
<p class= "divider">Or</p>
|
|
113
|
+
|
|
83
114
|
<button
|
|
84
|
-
class="new"
|
|
85
|
-
@click="${this.change}">login with existing email</button>
|
|
115
|
+
class= "new"
|
|
116
|
+
@click= "${this.change}">login with existing email</button>
|
|
117
|
+
|
|
86
118
|
</li>
|
|
87
119
|
|
|
88
120
|
</ul>
|
|
@@ -92,7 +124,7 @@ let UserSignUp = class UserSignUp extends LitElement {
|
|
|
92
124
|
`;
|
|
93
125
|
}
|
|
94
126
|
change() {
|
|
95
|
-
store.dispatch(
|
|
127
|
+
store.dispatch(universalToggle(this.source));
|
|
96
128
|
}
|
|
97
129
|
_handleSubmit(event) {
|
|
98
130
|
event.preventDefault();
|
|
@@ -116,28 +148,22 @@ let UserSignUp = class UserSignUp extends LitElement {
|
|
|
116
148
|
}
|
|
117
149
|
this.newAccount(this.email, this.password);
|
|
118
150
|
}
|
|
119
|
-
newAccount = async (email, password) => {
|
|
120
|
-
await createUserWithEmailAndPassword(auth, email, password)
|
|
121
|
-
.then((userCredential) => {
|
|
122
|
-
const user = userCredential.user;
|
|
123
|
-
sendEmailVerification(user)
|
|
124
|
-
.then(() => {
|
|
125
|
-
console.log("Verification email sent.");
|
|
126
|
-
});
|
|
127
|
-
}).then(() => { logAccount(); });
|
|
128
|
-
};
|
|
129
151
|
};
|
|
152
|
+
__decorate([
|
|
153
|
+
property({ type: String }),
|
|
154
|
+
__metadata("design:type", Object)
|
|
155
|
+
], FormSignup.prototype, "source", void 0);
|
|
130
156
|
__decorate([
|
|
131
157
|
state(),
|
|
132
158
|
__metadata("design:type", Object)
|
|
133
|
-
],
|
|
159
|
+
], FormSignup.prototype, "email", void 0);
|
|
134
160
|
__decorate([
|
|
135
161
|
state(),
|
|
136
162
|
__metadata("design:type", Object)
|
|
137
|
-
],
|
|
138
|
-
|
|
139
|
-
customElement('
|
|
163
|
+
], FormSignup.prototype, "password", void 0);
|
|
164
|
+
FormSignup = __decorate([
|
|
165
|
+
customElement('form-signup'),
|
|
140
166
|
__metadata("design:paramtypes", [])
|
|
141
|
-
],
|
|
142
|
-
export {
|
|
143
|
-
//# sourceMappingURL=
|
|
167
|
+
], FormSignup);
|
|
168
|
+
export { FormSignup };
|
|
169
|
+
//# sourceMappingURL=signup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"signup.js","sourceRoot":"","sources":["../../../typescript/webcomponents/form/signup.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EACL,GAAG,EACH,IAAI,EACJ,UAAU,EACX,MAA8B,KAAK,CAAC;AAErC,OAAO,EACL,aAAa,EACb,QAAQ,EACR,KAAK,EACN,MAA8B,mBAAmB,CAAC;AAEnD,OAAO,EACL,8BAA8B,EAC9B,qBAAqB,EACtB,MAA8B,eAAe,CAAC;AAE/C,OAAO,EAAE,IAAI,EAAE,MAAgB,+BAA+B,CAAC;AAC/D,OAAO,EAAE,UAAU,EAAE,MAAU,0BAA0B,CAAC;AAE1D,OAAO,EAAE,WAAW,EAAE,MAAS,cAAc,CAAC;AAC9C,OAAO,EA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6,6 @@ export const iconStyles = css `
|
|
|
6
6
|
display: grid;
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
-
/* Shared Styles */
|
|
10
9
|
.icon, .login {
|
|
11
10
|
cursor: pointer;
|
|
12
11
|
margin: auto;
|
|
@@ -19,13 +18,11 @@ export const iconStyles = css `
|
|
|
19
18
|
transition-duration: 2s;
|
|
20
19
|
}
|
|
21
20
|
|
|
22
|
-
/* Hover Styles */
|
|
23
21
|
.icon:hover,
|
|
24
22
|
.login:hover {
|
|
25
23
|
background-color: var(--pwa_icon_hover, lightgrey);
|
|
26
24
|
}
|
|
27
25
|
|
|
28
|
-
/* Logged-in State: The Icon Button */
|
|
29
26
|
.icon {
|
|
30
27
|
height: var(--pwa_icon_diameter, 32px);
|
|
31
28
|
width: var(--pwa_icon_diameter, 32px);
|
|
@@ -33,7 +30,6 @@ export const iconStyles = css `
|
|
|
33
30
|
padding: 0;
|
|
34
31
|
}
|
|
35
32
|
|
|
36
|
-
/* The Login Button */
|
|
37
33
|
.login {
|
|
38
34
|
width: auto;
|
|
39
35
|
border-radius: var(--pwa_icon_radius, 6px);
|
|
@@ -44,7 +40,6 @@ export const iconStyles = css `
|
|
|
44
40
|
text-align: center;
|
|
45
41
|
}
|
|
46
42
|
|
|
47
|
-
/* Icon Artwork */
|
|
48
43
|
.userImage {
|
|
49
44
|
object-fit: cover;
|
|
50
45
|
transition-property: all;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icon.js","sourceRoot":"","sources":["../../../../typescript/webcomponents/icon/css/icon.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,UAAU,GAAG,GAAG,CAAA
|
|
1
|
+
{"version":3,"file":"icon.js","sourceRoot":"","sources":["../../../../typescript/webcomponents/icon/css/icon.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,UAAU,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoD5B,CAAC"}
|
|
@@ -14,11 +14,13 @@ import { store } from '../../store';
|
|
|
14
14
|
import { iconStyles } from './css/icon';
|
|
15
15
|
import { toggleSign } from '../../redux/frontend';
|
|
16
16
|
let UserIcon = class UserIcon extends connect(store)(LitElement) {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
17
|
+
constructor() {
|
|
18
|
+
super();
|
|
19
|
+
this.subscribe = false;
|
|
20
|
+
this.empty = '';
|
|
21
|
+
this._user = false;
|
|
22
|
+
this._photoURL = '';
|
|
23
|
+
}
|
|
22
24
|
firstUpdated() {
|
|
23
25
|
this.shadowRoot.querySelector('.toggles').addEventListener('click', () => {
|
|
24
26
|
store.dispatch(toggleSign());
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icon.js","sourceRoot":"","sources":["../../../typescript/webcomponents/icon/icon.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAkB,IAAI,EAAE,UAAU,EAAE,MAAQ,KAAK,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAU,mBAAmB,CAAC;AACvE,OAAO,EAAE,OAAO,EAAE,MAAiC,8BAA8B,CAAC;AAClF,OAAO,EAAE,KAAK,EAAY,MAAyB,aAAa,CAAC;AACjE,OAAO,EAAE,UAAU,EAAE,MAA8B,YAAY,CAAC;AAChE,OAAO,EAAE,UAAU,EAAE,MAA8B,sBAAsB,CAAC;AAInE,IAAM,QAAQ,GAAd,MAAM,QAAS,SAAQ,OAAO,CAAC,KAAK,CAAC,CAAC,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"icon.js","sourceRoot":"","sources":["../../../typescript/webcomponents/icon/icon.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAkB,IAA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CAAA;;;;;;;;;2BASD,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK;;WAE5D,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,OAAQ;;;;KAIhD,CAAC;IACJ,CAAC;CACF,CAAA;AApDC;IAAC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;;2CAA0B;AAGnE;IAAC,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;;uCAAmB;AAE3D;IAAC,KAAK,EAAE;;uCAAuB;AAC/B;IAAC,KAAK,EAAE;;2CAAwB;AATrB,QAAQ;IADpB,aAAa,CAAC,WAAW,CAAC;;GACd,QAAQ,CAuDpB;SAvDY,QAAQ"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { css } from "lit";
|
|
2
|
+
export const authStyles = css `
|
|
3
|
+
|
|
4
|
+
:host {
|
|
5
|
+
transition: max-height 1.4s ease-out;
|
|
6
|
+
overflow: hidden;
|
|
7
|
+
display: grid;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.spec[on] {
|
|
11
|
+
display: grid;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.spec {
|
|
15
|
+
display: none;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.service {
|
|
19
|
+
overflow: hidden;
|
|
20
|
+
color: var(--pwa_drawer_text_color, #303030);
|
|
21
|
+
background-color: var(--section_background, white);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
:host([animation]) {
|
|
25
|
+
transition-duration: 1.4s;
|
|
26
|
+
max-height: 100%;
|
|
27
|
+
transition: max-height 1.4s ease-out;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
h3 {
|
|
31
|
+
margin: 16px;
|
|
32
|
+
padding-bottom: 16px;
|
|
33
|
+
border-bottom: 2px solid black;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
`;
|
|
37
|
+
//# sourceMappingURL=auth.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth.js","sourceRoot":"","sources":["../../../../typescript/webcomponents/login/css/auth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAa,MAAM,KAAK,CAAC;AAErC,MAAM,CAAC,MAAM,UAAU,GAAc,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkCvC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"link.js","sourceRoot":"","sources":["../../../../typescript/webcomponents/login/css/link.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,GAAG,EAAa,MAAM,KAAK,CAAC;AAErC,MAAM,CAAC,MAAM,SAAS,GAAc,GAAG,CAAA;;;;;;;;;;CAUtC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paragraph.js","sourceRoot":"","sources":["../../../../typescript/webcomponents/login/css/paragraph.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAa,MAAM,KAAK,CAAC;AAErC,MAAM,CAAC,MAAM,SAAS,GAAc,GAAG,CAAA;;;;;;;;CAQtC,CAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { CSSResultArray, LitElement } from 'lit';
|
|
2
|
+
import { AppState } from '../../store';
|
|
3
|
+
import '../form/login';
|
|
4
|
+
import '../form/signup';
|
|
5
|
+
declare const UserLogin_base: (new (...args: any[]) => {
|
|
6
|
+
_storeUnsubscribe: import("redux").Unsubscribe;
|
|
7
|
+
connectedCallback(): void;
|
|
8
|
+
disconnectedCallback(): void;
|
|
9
|
+
stateChanged(_state: {
|
|
10
|
+
frontend: {
|
|
11
|
+
settings: string;
|
|
12
|
+
login: boolean;
|
|
13
|
+
drawer: boolean;
|
|
14
|
+
registerOne: boolean;
|
|
15
|
+
registerTwo: boolean;
|
|
16
|
+
userId: string;
|
|
17
|
+
customer: string;
|
|
18
|
+
profileChoice: string;
|
|
19
|
+
name: string;
|
|
20
|
+
photoURL: string;
|
|
21
|
+
phone: string;
|
|
22
|
+
email: string;
|
|
23
|
+
};
|
|
24
|
+
drawer: {
|
|
25
|
+
drawer: boolean;
|
|
26
|
+
};
|
|
27
|
+
backend: {
|
|
28
|
+
verified: boolean;
|
|
29
|
+
anon: boolean;
|
|
30
|
+
userId: string;
|
|
31
|
+
name: string;
|
|
32
|
+
email: string;
|
|
33
|
+
photoURL: string;
|
|
34
|
+
phone: string;
|
|
35
|
+
msgToken: string;
|
|
36
|
+
};
|
|
37
|
+
}): void;
|
|
38
|
+
readonly isConnected: boolean;
|
|
39
|
+
}) & typeof LitElement;
|
|
40
|
+
export declare class UserLogin extends UserLogin_base {
|
|
41
|
+
subscribe: boolean;
|
|
42
|
+
private _name;
|
|
43
|
+
private _log;
|
|
44
|
+
private _sign;
|
|
45
|
+
constructor();
|
|
46
|
+
stateChanged(state: AppState): void;
|
|
47
|
+
static get styles(): CSSResultArray;
|
|
48
|
+
protected render(): import("lit-html").TemplateResult<1>;
|
|
49
|
+
}
|
|
50
|
+
declare global {
|
|
51
|
+
interface HTMLElementTagNameMap {
|
|
52
|
+
'user-login': UserLogin;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
export {};
|