pwa-auth 0.0.15 → 1.1.3
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 +113 -83
- package/demo/index.html +93 -101
- package/demo/styles.css +52 -0
- package/images/empty.jpg +0 -0
- package/images/favicon.ico +0 -0
- package/images/manifest/logo-144.png +0 -0
- package/images/manifest/logo-192.png +0 -0
- package/images/manifest/logo-48.png +0 -0
- package/images/manifest/logo-512.png +0 -0
- package/images/manifest/logo-72.png +0 -0
- package/images/manifest/logo-96.png +0 -0
- package/images/manifest/maskable_icon_x128.png +0 -0
- package/images/manifest/maskable_icon_x192.png +0 -0
- package/images/manifest/maskable_icon_x384.png +0 -0
- package/images/manifest/maskable_icon_x48.png +0 -0
- package/images/manifest/maskable_icon_x512.png +0 -0
- package/images/manifest/maskable_icon_x72.png +0 -0
- package/images/manifest/maskable_icon_x96.png +0 -0
- package/images/npm.svg +85 -85
- package/license +21 -21
- package/manifest.json +47 -44
- package/npm/pwa-auth.js +3163 -0
- package/npm/pwa-auth.js.map +1 -0
- package/package.json +50 -38
- 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 -163
- package/deploy/user-functions.js +0 -175
- package/deploy/user-icon.js +0 -107
- package/deploy/user-reducer.js +0 -41
- package/deploy/user-settings.js +0 -418
- package/polymer.json +0 -24
- package/pwa-auth.js +0 -16
- package/robots.txt +0 -2
- 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 -162
- package/src/user-functions.ts +0 -173
- package/src/user-icon.ts +0 -106
- package/src/user-reducer.ts +0 -91
- package/src/user-settings.ts +0 -402
- package/tsconfig.json +0 -19
- package/webpack.config.js +0 -72
package/package.json
CHANGED
|
@@ -1,38 +1,50 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "pwa-auth",
|
|
3
|
-
"author": "Modern Projects <jack.solutionbox@gmail.com>(https://www.contractorscentre.com)",
|
|
4
|
-
"version": "
|
|
5
|
-
"description": "User Management Component with 3 HTML Tags, and 1 Boilerplate Function to display user icon, sign up, login, log out, change account details, delete account.",
|
|
6
|
-
"homepage": "https://
|
|
7
|
-
"main": "pwa-auth.js",
|
|
8
|
-
"repository": {
|
|
9
|
-
"type": "git",
|
|
10
|
-
"url": "https://github.com/busynest/user"
|
|
11
|
-
},
|
|
12
|
-
"keywords": [
|
|
13
|
-
"lit
|
|
14
|
-
"redux",
|
|
15
|
-
"firebase",
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
],
|
|
22
|
-
"license": "BSD-3-Clause",
|
|
23
|
-
"flat": true,
|
|
24
|
-
"scripts": {
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
"
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
"
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
|
|
38
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "pwa-auth",
|
|
3
|
+
"author": "Modern Projects <jack.solutionbox@gmail.com>(https://www.contractorscentre.com)",
|
|
4
|
+
"version": "1.1.3",
|
|
5
|
+
"description": "User Management Component with 3 HTML Tags, and 1 Boilerplate Function to display user icon, sign up, login, log out, change account details, delete account.",
|
|
6
|
+
"homepage": "https://pwa-authentic.firebaseapp.com",
|
|
7
|
+
"main": "npm/pwa-auth.js",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "https://github.com/busynest/user"
|
|
11
|
+
},
|
|
12
|
+
"keywords": [
|
|
13
|
+
"lit",
|
|
14
|
+
"redux",
|
|
15
|
+
"firebase",
|
|
16
|
+
"authentication",
|
|
17
|
+
"drawer",
|
|
18
|
+
"settings",
|
|
19
|
+
"icon",
|
|
20
|
+
"username"
|
|
21
|
+
],
|
|
22
|
+
"license": "BSD-3-Clause",
|
|
23
|
+
"flat": true,
|
|
24
|
+
"scripts": {
|
|
25
|
+
"server": "web-dev-server --node-resolve --watch --open --app-index demo/index.html",
|
|
26
|
+
"rollup": "rollup -c"
|
|
27
|
+
},
|
|
28
|
+
"dependencies": {
|
|
29
|
+
"lit": "^3.2.1",
|
|
30
|
+
"pwa-helpers": "^0.9.1",
|
|
31
|
+
"redux": "^5.0.1",
|
|
32
|
+
"redux-thunk": "^3.1.0"
|
|
33
|
+
},
|
|
34
|
+
"devDependencies": {
|
|
35
|
+
"@babel/preset-env": "^7.28.3",
|
|
36
|
+
"@lit-labs/rollup-plugin-minify-html-literals": "^0.1.0",
|
|
37
|
+
"@reduxjs/toolkit": "^2.5.0",
|
|
38
|
+
"@rollup/plugin-babel": "^6.0.4",
|
|
39
|
+
"@rollup/plugin-commonjs": "^28.0.6",
|
|
40
|
+
"@rollup/plugin-replace": "^6.0.2",
|
|
41
|
+
"@rollup/plugin-terser": "^0.4.4",
|
|
42
|
+
"@web/dev-server": "^0.4.6",
|
|
43
|
+
"@web/rollup-plugin-copy": "^0.5.1",
|
|
44
|
+
"babel-plugin-template-html-minifier": "^4.1.0",
|
|
45
|
+
"firebase": "^12.1.0",
|
|
46
|
+
"rollup": "^4.46.3",
|
|
47
|
+
"rollup-plugin-html-literals": "^2.0.0",
|
|
48
|
+
"rollup-plugin-summary": "^3.0.1"
|
|
49
|
+
}
|
|
50
|
+
}
|
package/deploy/store.js
DELETED
|
@@ -1,18 +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
|
-
import { createStore, compose, applyMiddleware, combineReducers } from 'redux';
|
|
11
|
-
import thunk from 'redux-thunk';
|
|
12
|
-
import { lazyReducerEnhancer } from 'pwa-helpers/lazy-reducer-enhancer.js';
|
|
13
|
-
import user from './user-reducer';
|
|
14
|
-
// Sets up a Chrome extension for time travel debugging.
|
|
15
|
-
// See https://github.com/zalmoxisus/redux-devtools-extension for more information.
|
|
16
|
-
const devCompose = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose;
|
|
17
|
-
export const store = createStore(state => state, devCompose(lazyReducerEnhancer(combineReducers), applyMiddleware(thunk)));
|
|
18
|
-
store.addReducers({ user });
|
package/deploy/styles-drawer.js
DELETED
|
@@ -1,139 +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
|
-
// @ts-check
|
|
11
|
-
import { css } from 'lit-element';
|
|
12
|
-
export const User = css `
|
|
13
|
-
|
|
14
|
-
/* Google Icon Load */
|
|
15
|
-
.icon {
|
|
16
|
-
background: url('https://upload.wikimedia.org/wikipedia/commons/thumb/5/53/Google_%22G%22_Logo.svg/28px-Google_%22G%22_Logo.svg.png') transparent 5px 50% no-repeat;
|
|
17
|
-
display: inline-block;
|
|
18
|
-
vertical-align: middle;
|
|
19
|
-
width: 42px;
|
|
20
|
-
height: 42px;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
.visibility[on] {
|
|
24
|
-
visibility: visible;
|
|
25
|
-
transform: translate3d(0, 0, 0);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
.visibility {
|
|
29
|
-
position: fixed;
|
|
30
|
-
right: 0;
|
|
31
|
-
visibility: hidden;
|
|
32
|
-
will-change: transform;
|
|
33
|
-
transform: translate3d(0, -150%, 0);
|
|
34
|
-
transition-property: visibility, transform;
|
|
35
|
-
transition-duration: 1.4s;
|
|
36
|
-
display: block;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
.userDrawer {
|
|
40
|
-
z-index: 1;
|
|
41
|
-
max-width: 600px;
|
|
42
|
-
margin: auto;
|
|
43
|
-
background-color: #fff;
|
|
44
|
-
color: #303030;
|
|
45
|
-
padding: 8px 18px;
|
|
46
|
-
box-sizing: border-box;
|
|
47
|
-
border: 3px #303030 solid;
|
|
48
|
-
border-radius: 20px;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
.exit {
|
|
52
|
-
display: grid;
|
|
53
|
-
grid-template-columns: 80px 1fr 80px;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
.exit > h3 {
|
|
57
|
-
font-weight: 800;
|
|
58
|
-
font-size: .9em;
|
|
59
|
-
margin: 0px auto;
|
|
60
|
-
opacity: .8;
|
|
61
|
-
line-height: 36px;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
.exit > .remove {
|
|
65
|
-
background-color: transparent;
|
|
66
|
-
border: 0px;
|
|
67
|
-
color: red;
|
|
68
|
-
font-weight: 800;
|
|
69
|
-
font-size: .7em;
|
|
70
|
-
text-transform: uppercase;
|
|
71
|
-
opacity: .6;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
.exit > .refresh {
|
|
75
|
-
background-color: transparent;
|
|
76
|
-
border: 0px;
|
|
77
|
-
fill: blue;
|
|
78
|
-
height: 36px;
|
|
79
|
-
width: 36px;
|
|
80
|
-
padding: 0px;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
.sign-right {
|
|
84
|
-
height: 36px;
|
|
85
|
-
width: 36px;
|
|
86
|
-
margin: auto;
|
|
87
|
-
background-color: transparent;
|
|
88
|
-
border: 0px;
|
|
89
|
-
fill: red;
|
|
90
|
-
opacity: .8;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
.google {
|
|
94
|
-
margin: auto;
|
|
95
|
-
color: #444;
|
|
96
|
-
width: 210px;
|
|
97
|
-
border-radius: 5px;
|
|
98
|
-
border: thin solid #888;
|
|
99
|
-
box-shadow: 1px 1px 1px grey;
|
|
100
|
-
white-space: nowrap;
|
|
101
|
-
|
|
102
|
-
background-color: #ffffff;
|
|
103
|
-
size: 14px;
|
|
104
|
-
font: Roboto-Medium;
|
|
105
|
-
line-height: 26px;
|
|
106
|
-
padding: 8dp;
|
|
107
|
-
border-color: #4267b2;
|
|
108
|
-
border-radius: 10px;
|
|
109
|
-
-webkit-font-smoothing: antialiased;
|
|
110
|
-
font-weight: bold;
|
|
111
|
-
justify-content: center;
|
|
112
|
-
text-align: center;
|
|
113
|
-
text-shadow: none;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
.google:hover {
|
|
117
|
-
cursor: pointer;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
.imageGoogle { height: 18dp; width: 18xp; }
|
|
121
|
-
label { font-size: .9em; }
|
|
122
|
-
.setLog > p { margin: 12px; box-sizing: border-box; }
|
|
123
|
-
.divide { border: 2px solid #606060; margin: 6px 0 0 0; border-radius: 50%; }
|
|
124
|
-
@media (max-width: 460px) { .google, label, #bat { font-size: .8em; } }
|
|
125
|
-
|
|
126
|
-
input {
|
|
127
|
-
box-sizing: border-box;
|
|
128
|
-
width: 100%;
|
|
129
|
-
padding: 12px 20px;
|
|
130
|
-
margin: 8px 0 0 0;
|
|
131
|
-
display: inline-block;
|
|
132
|
-
border: 1px solid #ccc;
|
|
133
|
-
border-radius: 4px;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
a { text-transform: uppercase; font-size: .6em; color: rgb(105,105,105); font-weight: 800; text-decoration: none; }
|
|
137
|
-
p {text-align: center;}
|
|
138
|
-
.inpat { display:grid; grid-template-columns: 60% 40%;}
|
|
139
|
-
`;
|
|
@@ -1,57 +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
|
-
// @ts-check
|
|
11
|
-
import { css } from 'lit-element';
|
|
12
|
-
export const Settings = css `
|
|
13
|
-
|
|
14
|
-
form { box-sizing: border-box; }
|
|
15
|
-
.pageTitle { margin: 0; }
|
|
16
|
-
|
|
17
|
-
form {
|
|
18
|
-
max-width: 600px;
|
|
19
|
-
margin: auto;
|
|
20
|
-
border: 0;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
.setMenu {
|
|
24
|
-
display: grid;
|
|
25
|
-
grid-template-columns: 1fr 1fr 1fr 1fr;
|
|
26
|
-
grid-gap: 8px;
|
|
27
|
-
margin: 0px;
|
|
28
|
-
padding: 0px;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
.topButton {
|
|
32
|
-
color: grey;
|
|
33
|
-
border: 0;
|
|
34
|
-
width: 100%;
|
|
35
|
-
height: 36px;
|
|
36
|
-
margin: auto;
|
|
37
|
-
padding: 0px;
|
|
38
|
-
font-weight: 800;
|
|
39
|
-
font-size: .8em;
|
|
40
|
-
border-radius: 5px;
|
|
41
|
-
background-color: transparent;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
.topButton[on] {
|
|
45
|
-
/* background-color: rgba(0,0,0, .1); */
|
|
46
|
-
color: var(--app-black-color);
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
.topButton:hover {
|
|
50
|
-
cursor: pointer;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
.topButton > p {
|
|
54
|
-
margin: 0px;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
`;
|
package/deploy/styles.js
DELETED
|
@@ -1,88 +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
|
-
// @ts-check
|
|
11
|
-
import { html, css } from 'lit-element';
|
|
12
|
-
export const userStyles = css `
|
|
13
|
-
|
|
14
|
-
.spec[on] { display: block; }
|
|
15
|
-
.spec { display: none; }
|
|
16
|
-
|
|
17
|
-
.x-font {
|
|
18
|
-
font-family: Roboto, Arial, sans-serif; /* 'Montserrat' */
|
|
19
|
-
line-height: 1.1;
|
|
20
|
-
letter-spacing: .007em;
|
|
21
|
-
font-size: 14px;
|
|
22
|
-
font-weight: 500;
|
|
23
|
-
text-align: center;
|
|
24
|
-
text-decoration-style: solid;
|
|
25
|
-
text-transform: uppercase;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
ul {
|
|
29
|
-
list-style-type: none;
|
|
30
|
-
padding: 0;
|
|
31
|
-
margin: 0;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
input[type=submit]:hover { background-color: #45a049; }
|
|
35
|
-
input[type=submit] {
|
|
36
|
-
box-sizing: border-box;
|
|
37
|
-
width: 100%;
|
|
38
|
-
background-color: #4CAF50;
|
|
39
|
-
color: white;
|
|
40
|
-
padding: 14px 20px;
|
|
41
|
-
margin: 8px 0;
|
|
42
|
-
border: none;
|
|
43
|
-
border-radius: 4px;
|
|
44
|
-
cursor: pointer;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
input.invalid { background-color: #ffdddd; }
|
|
48
|
-
input[type=text],
|
|
49
|
-
input[type=email],
|
|
50
|
-
input[type=password], select {
|
|
51
|
-
box-sizing: border-box;
|
|
52
|
-
width: 100%;
|
|
53
|
-
padding: 8px 16px;
|
|
54
|
-
border-radius: 4px;
|
|
55
|
-
background-color: rgba(228, 241, 254, 1);
|
|
56
|
-
border: 1px #ccc solid;
|
|
57
|
-
border-bottom: 2px var(--app-black-color) solid;
|
|
58
|
-
border-radius: 5px;
|
|
59
|
-
text-align: center;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
.action-button:focus, .topButton:focus {outline:0;}
|
|
63
|
-
.action-button {
|
|
64
|
-
display: inline-block;
|
|
65
|
-
box-sizing: border-box;
|
|
66
|
-
white-space: nowrap;
|
|
67
|
-
margin: 10px 0 10px 0;
|
|
68
|
-
font-weight: 400;
|
|
69
|
-
text-align: center;
|
|
70
|
-
vertical-align: middle;
|
|
71
|
-
touch-action: manipulation;
|
|
72
|
-
-webkit-appearance: button;
|
|
73
|
-
cursor: pointer;
|
|
74
|
-
font-size: 16px;
|
|
75
|
-
height: 38px;
|
|
76
|
-
line-height: 16px;
|
|
77
|
-
width: 100%;
|
|
78
|
-
padding: 10px 16px;
|
|
79
|
-
border-radius: 6px;
|
|
80
|
-
color: #fff;
|
|
81
|
-
background-color: #6cc04a;
|
|
82
|
-
border-color: #60b23e;
|
|
83
|
-
box-shadow: 1px 1px 1px grey;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
`;
|
|
87
|
-
export const settings = html `<svg viewBox="0 0 24 24"><path d="M19.43 12.98c.04-.32.07-.64.07-.98s-.03-.66-.07-.98l2.11-1.65c.19-.15.24-.42.12-.64l-2-3.46c-.12-.22-.39-.3-.61-.22l-2.49 1c-.52-.4-1.08-.73-1.69-.98l-.38-2.65C14.46 2.18 14.25 2 14 2h-4c-.25 0-.46.18-.49.42l-.38 2.65c-.61.25-1.17.59-1.69.98l-2.49-1c-.23-.09-.49 0-.61.22l-2 3.46c-.13.22-.07.49.12.64l2.11 1.65c-.04.32-.07.65-.07.98s.03.66.07.98l-2.11 1.65c-.19.15-.24.42-.12.64l2 3.46c.12.22.39.3.61.22l2.49-1c.52.4 1.08.73 1.69.98l.38 2.65c.03.24.24.42.49.42h4c.25 0 .46-.18.49-.42l.38-2.65c.61-.25 1.17-.59 1.69-.98l2.49 1c.23.09.49 0 .61-.22l2-3.46c.12-.22.07-.49-.12-.64l-2.11-1.65zM12 15.5c-1.93 0-3.5-1.57-3.5-3.5s1.57-3.5 3.5-3.5 3.5 1.57 3.5 3.5-1.57 3.5-3.5 3.5z"></path></svg>`;
|
|
88
|
-
export const close = html `<svg viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"></path></svg>`;
|
package/deploy/user-action.js
DELETED
|
@@ -1,69 +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
|
-
export const LOGGED_IN = 'LOGGED_IN';
|
|
11
|
-
export const SETTINGS_PAGE = 'SETTINGS_PAGE';
|
|
12
|
-
export const PROFILE_TYPE = 'PROFILE_TYPE';
|
|
13
|
-
export const SIGN_IN = 'SIGN_IN';
|
|
14
|
-
export const SET_USER = 'SET_USER';
|
|
15
|
-
export const SET_IMAGE = 'SET_IMAGE';
|
|
16
|
-
export const SET_NAME = 'SET_NAME';
|
|
17
|
-
export const OPEN_SIGN = 'OPEN_SIGN';
|
|
18
|
-
export const CLOSE_SIGN = 'CLOSE_SIGN';
|
|
19
|
-
export const SIGN_UP_OPEN = "SIGN_UP_OPEN";
|
|
20
|
-
export const SIGN_UP_CLOSE = "SIGN_UP_CLOSE";
|
|
21
|
-
;
|
|
22
|
-
;
|
|
23
|
-
;
|
|
24
|
-
;
|
|
25
|
-
;
|
|
26
|
-
;
|
|
27
|
-
;
|
|
28
|
-
;
|
|
29
|
-
;
|
|
30
|
-
;
|
|
31
|
-
// NAVIGATION
|
|
32
|
-
export const navigate = (option) => {
|
|
33
|
-
switch (option) {
|
|
34
|
-
case 'profile':
|
|
35
|
-
break;
|
|
36
|
-
case 'email':
|
|
37
|
-
break;
|
|
38
|
-
case 'password':
|
|
39
|
-
break;
|
|
40
|
-
case 'delete':
|
|
41
|
-
break;
|
|
42
|
-
default: option = 'profile';
|
|
43
|
-
}
|
|
44
|
-
return { type: SETTINGS_PAGE, option };
|
|
45
|
-
};
|
|
46
|
-
export const openSign = (snackState) => (dispatch, getState) => {
|
|
47
|
-
if (getState().user.snackState === true) {
|
|
48
|
-
dispatch({ type: CLOSE_SIGN, snackState });
|
|
49
|
-
}
|
|
50
|
-
else {
|
|
51
|
-
dispatch({ type: OPEN_SIGN, snackState });
|
|
52
|
-
}
|
|
53
|
-
};
|
|
54
|
-
export const signUp = (register) => (dispatch, getState) => {
|
|
55
|
-
if (getState().user.register === false) {
|
|
56
|
-
dispatch({ type: SIGN_UP_OPEN, register });
|
|
57
|
-
}
|
|
58
|
-
else {
|
|
59
|
-
dispatch({ type: SIGN_UP_CLOSE, register });
|
|
60
|
-
}
|
|
61
|
-
};
|
|
62
|
-
// export const updateLogin: ActionCreator<updateLoginX> = ( logged: boolean ) => { return { type: LOGGED_IN, logged }; };
|
|
63
|
-
export const setAuth = (currentUser) => { return { type: LOGGED_IN, currentUser }; };
|
|
64
|
-
export const setUser = (user) => { return { type: SET_USER, user }; };
|
|
65
|
-
export const setImage = (image) => { return { type: SET_IMAGE, image }; };
|
|
66
|
-
export const setName = (name) => { return { type: SET_NAME, name }; };
|
|
67
|
-
export const closeSign = (closeLogIN) => { return { type: CLOSE_SIGN, closeLogIN }; };
|
|
68
|
-
// export const profile: ActionCreator<profileX> = ( profileType: string ) => { return { type: PROFILE_TYPE, profileType } };
|
|
69
|
-
// export const signUp = (register) => { return { type: IN_UP, register }; }
|
package/deploy/user-drawer.js
DELETED
|
@@ -1,163 +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 { userStyles, close } from './styles';
|
|
21
|
-
import { User } from './styles-drawer';
|
|
22
|
-
import { closeSign, signUp } from './user-action';
|
|
23
|
-
import { logOut, anon, google } from './user-functions';
|
|
24
|
-
let UserDrawer = class UserDrawer extends connect(store)(LitElement) {
|
|
25
|
-
constructor() {
|
|
26
|
-
super();
|
|
27
|
-
this._log = false;
|
|
28
|
-
this._subscribe = false;
|
|
29
|
-
this._sign = false;
|
|
30
|
-
}
|
|
31
|
-
firstUpdated() {
|
|
32
|
-
this.shadowRoot.getElementById('close').addEventListener('click', () => { store.dispatch(closeSign(false)); });
|
|
33
|
-
this.shadowRoot.getElementById('or').addEventListener('click', () => { anon(); });
|
|
34
|
-
this.shadowRoot.getElementById('googleSignIn').addEventListener('click', () => { google(); });
|
|
35
|
-
this.shadowRoot.getElementById('leave').addEventListener('click', () => { logOut(); });
|
|
36
|
-
this.shadowRoot.getElementById('log').addEventListener('click', () => { this._signIn(); });
|
|
37
|
-
this.shadowRoot.getElementById('newUser').addEventListener('click', () => { this._signUp(); });
|
|
38
|
-
this.shadowRoot.getElementById('new').addEventListener('click', () => { store.dispatch(signUp()); });
|
|
39
|
-
}
|
|
40
|
-
stateChanged(state) {
|
|
41
|
-
this._subscribe = state.user.snackState;
|
|
42
|
-
this._log = state.user.currentUser;
|
|
43
|
-
this._sign = state.user.register;
|
|
44
|
-
// this.welcome = state.user.welcome;
|
|
45
|
-
}
|
|
46
|
-
_signIn() {
|
|
47
|
-
const a = this.shadowRoot.getElementById('logs');
|
|
48
|
-
a.addEventListener('click', e => { e.preventDefault(); });
|
|
49
|
-
// Prevent Form's Page Refresh
|
|
50
|
-
const email = this.shadowRoot.getElementById('txtEmail').value;
|
|
51
|
-
const password = this.shadowRoot.getElementById('txtPassword').value;
|
|
52
|
-
// @ts-ignore
|
|
53
|
-
firebase.auth().signInWithEmailAndPassword(email, password).catch((error) => {
|
|
54
|
-
const errorCode = error.code;
|
|
55
|
-
const errorMessage = error.message;
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
_signUp() {
|
|
59
|
-
const email = this.shadowRoot.getElementById('newtEmail').value;
|
|
60
|
-
const pass = this.shadowRoot.getElementById('newPassword').value;
|
|
61
|
-
if (email.length < 4) {
|
|
62
|
-
alert('Please enter an email address.');
|
|
63
|
-
return;
|
|
64
|
-
}
|
|
65
|
-
if (pass.length < 4) {
|
|
66
|
-
alert('Please enter a password.');
|
|
67
|
-
return;
|
|
68
|
-
}
|
|
69
|
-
// @ts-ignore
|
|
70
|
-
firebase.auth().createUserWithEmailAndPassword(email, pass).catch((error) => {
|
|
71
|
-
const errorCode = error.code;
|
|
72
|
-
const errorMessage = error.message;
|
|
73
|
-
// [START_EXCLUDE]
|
|
74
|
-
if (errorCode == 'auth/weak-password') {
|
|
75
|
-
alert('The password is too weak.');
|
|
76
|
-
}
|
|
77
|
-
else {
|
|
78
|
-
alert(errorMessage);
|
|
79
|
-
}
|
|
80
|
-
console.log(error);
|
|
81
|
-
});
|
|
82
|
-
}
|
|
83
|
-
static get styles() {
|
|
84
|
-
return [
|
|
85
|
-
userStyles,
|
|
86
|
-
User,
|
|
87
|
-
css `
|
|
88
|
-
:host {
|
|
89
|
-
|
|
90
|
-
}
|
|
91
|
-
`
|
|
92
|
-
];
|
|
93
|
-
}
|
|
94
|
-
render() {
|
|
95
|
-
return html `
|
|
96
|
-
|
|
97
|
-
<!-- Login Wrapper -->
|
|
98
|
-
<div class="visibility userDrawer" ?on="${this._subscribe === true}">
|
|
99
|
-
|
|
100
|
-
<div class="exit">
|
|
101
|
-
<div></div>
|
|
102
|
-
<h3 id="or">${this._log ? html `ACCOUNT` : html `SUBSCRIBE`}</h3>
|
|
103
|
-
<button id="close" class="sign-right">${close}</button>
|
|
104
|
-
</div>
|
|
105
|
-
|
|
106
|
-
<div class="spec" ?on="${this._log === false}">
|
|
107
|
-
|
|
108
|
-
<p><button id="new">create a new account</button></p>
|
|
109
|
-
|
|
110
|
-
<p><button id="googleSignIn" class="google">
|
|
111
|
-
<span class="icon"></span>
|
|
112
|
-
<span class="buttonText">Sign in with Google</span>
|
|
113
|
-
</button></p>
|
|
114
|
-
|
|
115
|
-
<form id="logs" autocomplete="on" class="spec" ?on="${this._sign === true}">
|
|
116
|
-
<ul>
|
|
117
|
-
<li class="inpat">
|
|
118
|
-
<label><input id="txtEmail" type="email" >Email</label>
|
|
119
|
-
<label><input id="txtPassword" type="Password" >Password</label>
|
|
120
|
-
</li>
|
|
121
|
-
<li><button id="log" class="action-button">Sign in</button></li>
|
|
122
|
-
</ul>
|
|
123
|
-
</form>
|
|
124
|
-
|
|
125
|
-
<!-- Sign UP -->
|
|
126
|
-
<form id="signup" autocomplete="on" class="spec" ?on="${this._sign === false}">
|
|
127
|
-
<ul>
|
|
128
|
-
<li class="inpat">
|
|
129
|
-
<label><input id="newEmail" type="email" >Email</label>
|
|
130
|
-
<label><input id="newPassword" type="Password" >Password</label>
|
|
131
|
-
<label><input id="verifyEmail" type="email" >Verify Email</label>
|
|
132
|
-
<label><input id="veriftPassword" type="Password" >Verify Password</label>
|
|
133
|
-
</li>
|
|
134
|
-
<li><button id="newUser" class="action-button">Sign up</button></li>
|
|
135
|
-
</ul>
|
|
136
|
-
</form>
|
|
137
|
-
|
|
138
|
-
</div>
|
|
139
|
-
|
|
140
|
-
<!-- Logged IN -->
|
|
141
|
-
<div class="spec setLog" ?on="${this._log === true}">
|
|
142
|
-
<slot></slot>
|
|
143
|
-
<p><a href="/settings">Settings</a></p>
|
|
144
|
-
<p><a id="leave" aria-label="log out">log out</a></p>
|
|
145
|
-
</div>
|
|
146
|
-
|
|
147
|
-
</div>
|
|
148
|
-
`;
|
|
149
|
-
}
|
|
150
|
-
};
|
|
151
|
-
__decorate([
|
|
152
|
-
property({ type: Boolean })
|
|
153
|
-
], UserDrawer.prototype, "_log", void 0);
|
|
154
|
-
__decorate([
|
|
155
|
-
property({ type: Boolean })
|
|
156
|
-
], UserDrawer.prototype, "_subscribe", void 0);
|
|
157
|
-
__decorate([
|
|
158
|
-
property({ type: Boolean })
|
|
159
|
-
], UserDrawer.prototype, "_sign", void 0);
|
|
160
|
-
UserDrawer = __decorate([
|
|
161
|
-
customElement('user-drawer')
|
|
162
|
-
], UserDrawer);
|
|
163
|
-
export { UserDrawer };
|