pwa-auth 3.3.1 → 3.3.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/README.md +123 -117
- package/base/store.js.map +1 -1
- package/base/webcomponents/form/css/input.js +1 -1
- package/base/webcomponents/icon/css/icon.js +2 -2
- package/base/webcomponents/login/css/auth.js +1 -1
- package/base/webcomponents/settings/css/navigation.js +3 -3
- package/base/webcomponents/settings/settings.js +3 -3
- package/package.json +8 -1
- package/source/development/pwa-auth.js +1110 -0
- package/source/development/pwa-auth.js.map +1 -0
- package/source/{production → esm}/pwa-auth.js +10 -10
- package/CHANGELOG.md +0 -240
- package/export/pwa-auth.ts +0 -4
package/README.md
CHANGED
|
@@ -4,15 +4,37 @@ Jack's Publishing maintains Custom HTML Elements where developers can focus on U
|
|
|
4
4
|
|
|
5
5
|
Visit the [Live Demo](https://pwa-authentic.firebaseapp.com)
|
|
6
6
|
|
|
7
|
-
pwa-auth.js is a bundle of
|
|
7
|
+
pwa-auth.js is a bundle of 5 Custom HTML Elements for Firebase (IAM) Authenication using email and password, with the ability to change username, icon, email, password, or delete your own account and it's content all together.
|
|
8
8
|
|
|
9
9
|
pwa-auth.js (Authentication Webcomponents) are for anyone who is looking for a quick and simple way to sign-up, log-in, log-out, modify, or delete a firebase account information from thier own personal domain.
|
|
10
10
|
|
|
11
11
|
You will learn how to place 5 Custom HTML Tags, reference CSS, and How to Initialize an Firebase Instance. By either <b>Standard</b> or <b>Modular</b> ECMA Script.
|
|
12
12
|
|
|
13
|
-
Continue reading to understand how to install
|
|
13
|
+
Continue reading to understand how to install this project:
|
|
14
14
|
|
|
15
|
-
##
|
|
15
|
+
## Prerequisites
|
|
16
|
+
- Google:
|
|
17
|
+
- Google Analytics
|
|
18
|
+
- Firebase Project
|
|
19
|
+
- Firebase:
|
|
20
|
+
- Authentication - email login
|
|
21
|
+
- Cloud Storage - storage bucket
|
|
22
|
+
|
|
23
|
+
## Technical Summary
|
|
24
|
+
- Type Strong with [TypeScript](https://www.typescriptlang.org)
|
|
25
|
+
- Stylable with [CSS Custom Properties](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_cascading_variables/Using_CSS_custom_properties)
|
|
26
|
+
- State Management with [ReduxJS](https://redux.js.org/)
|
|
27
|
+
- Authentication Google's [Firebase](https://www.firebase.com)
|
|
28
|
+
- Firebase Initialization Object: `window.process = { env: { FIREBASE_CONFIG: `
|
|
29
|
+
|
|
30
|
+
## Prototypes
|
|
31
|
+
- `<user-icon>`
|
|
32
|
+
- `<user-drawer>`
|
|
33
|
+
- `<user-login>`
|
|
34
|
+
- `<user-settings>`
|
|
35
|
+
- `<email-reset>`
|
|
36
|
+
|
|
37
|
+
## Features: Library Logical States
|
|
16
38
|
- Register through Email and Password
|
|
17
39
|
- Log-in
|
|
18
40
|
- Log-out
|
|
@@ -21,95 +43,91 @@ Continue reading to understand how to install the project:
|
|
|
21
43
|
- Change Password
|
|
22
44
|
- Upload Profile Picture
|
|
23
45
|
- Delete Account
|
|
24
|
-
-
|
|
25
|
-
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
-
|
|
46
|
+
- Development:
|
|
47
|
+
- Global Functions
|
|
48
|
+
- Redux State Connection
|
|
49
|
+
|
|
50
|
+
## Elements
|
|
51
|
+
- Button:
|
|
52
|
+
- Email Log-in / Email Subscribe / Icon
|
|
53
|
+
- Drop-down Drawer:
|
|
54
|
+
- Email Log-in / Email Subscribe / Menu with Log-out
|
|
30
55
|
- Pages:
|
|
31
56
|
- Account Settings
|
|
32
57
|
- Auth: Email Log-in / email Subscribe
|
|
33
58
|
- Password Reset
|
|
34
59
|
|
|
35
|
-
##
|
|
36
|
-
|
|
37
|
-
ECMA Script Modules
|
|
60
|
+
## Project Type: ECMA Script Modules
|
|
61
|
+
Eports: classes and objects
|
|
38
62
|
```javascript
|
|
39
63
|
// Custom HTML Elements
|
|
40
64
|
import 'pwa-auth';
|
|
65
|
+
// <user-icon subscribe emptyArtwork="./images/empty.jpg"></user-icon>
|
|
66
|
+
// <user-drawer subscribe settingsURL="./settings"></user-drawer>
|
|
67
|
+
// <user-settings emptyArtwork="./images/empty.jpg"></user-settings>
|
|
41
68
|
|
|
42
69
|
// Firebase Objects
|
|
43
70
|
import { db, storage, auth, user } from 'pwa-auth';
|
|
71
|
+
// db - firestore database reference
|
|
72
|
+
// storage - firebase storage reference
|
|
73
|
+
// auth - user object reference
|
|
74
|
+
// user - active user boolean reference
|
|
75
|
+
|
|
76
|
+
// Firebase-Redux States
|
|
77
|
+
import { store } from 'pwa-auth';
|
|
78
|
+
// store.verified
|
|
79
|
+
// store.userId
|
|
80
|
+
// store.name
|
|
81
|
+
// store.email
|
|
82
|
+
// store.photoURL
|
|
44
83
|
```
|
|
45
84
|
|
|
46
|
-
Global
|
|
85
|
+
## Project Type: Global Namespaces
|
|
47
86
|
```html
|
|
48
87
|
<!-- Optional: Copy the Project Files from 'src' Folder -->
|
|
49
88
|
<script type="module" src="./pwa-auth.js"></script>
|
|
50
89
|
```
|
|
51
90
|
|
|
52
|
-
## Library
|
|
53
|
-
- 5 Tag Placement
|
|
54
|
-
- Color Scheme: CSS Custom Properties
|
|
55
|
-
- Firebase Initialization `window` Object
|
|
56
|
-
|
|
57
91
|
## HTML Webcomponents
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
92
|
+
```html
|
|
93
|
+
<user-icon>
|
|
94
|
+
<!-- property: subscribe: (Initial State): Subscribe -->
|
|
95
|
+
<!-- property: subscribe: else (Initial State): Login -->
|
|
96
|
+
<!-- property; empty: location of empty image -->
|
|
97
|
+
<!-- state: Logged-out: txt: Login Button -->
|
|
98
|
+
<!-- state: Logged-out: txt: Subscribe Button -->
|
|
99
|
+
<!-- state: Logged-in: photo: Icon Button -->
|
|
100
|
+
<user-drawer>
|
|
101
|
+
<!-- feature: Top-down drawer: 1.4 seconds -->
|
|
102
|
+
<!-- property: url: location of <pwa-settings> Tag -->
|
|
103
|
+
<!-- property: subscribe: (Initial State): Subscribe -->
|
|
104
|
+
<!-- property: subscribe: else (Initial State): Login -->
|
|
105
|
+
<!-- state: logged-out: Sign-up by Email Addresses and Password -->
|
|
106
|
+
<!-- state: logged-out: Sign-in by Email Addresses and Password -->
|
|
107
|
+
<!-- state: logged-in: Settings Page Link, Log-out Button -->
|
|
108
|
+
<user-login>
|
|
109
|
+
<!-- feature: regular visible page component -->
|
|
110
|
+
<!-- state: logged-out: Sign-up by Email Addresses and Password -->
|
|
111
|
+
<!-- state: logged-out: Sign-in by Email Addresses and Password -->
|
|
112
|
+
<!-- state: logged-in: content: <slot></slot> -->
|
|
113
|
+
<user-settings>
|
|
114
|
+
<!-- 1 Photo Upload Feature, view uploaded bucket of photos, photo ediotr -->
|
|
115
|
+
<!-- empty property: location of empty image -->
|
|
116
|
+
<!-- Unavailable Photo -->
|
|
117
|
+
<!-- Update Username -->
|
|
118
|
+
<!-- Update Email / Verify -->
|
|
119
|
+
<!-- Update Password -->
|
|
120
|
+
<!-- Delete Account, Photos, Information -->
|
|
121
|
+
<email-reset>
|
|
122
|
+
<!-- Coming Soon -->
|
|
123
|
+
```
|
|
124
|
+
```css
|
|
125
|
+
:root() { --pwa_design_settings: ... ; }
|
|
88
126
|
- Optional: Custom CSS Properties
|
|
127
|
+
```
|
|
89
128
|
|
|
90
|
-
##
|
|
91
|
-
|
|
92
|
-
- verified, userId, name, email, photoURL
|
|
93
|
-
- db - firestore database reference
|
|
94
|
-
- getFirestore(pwa-env)
|
|
95
|
-
- storage - firebase storage reference
|
|
96
|
-
- getStorage(pwa-env)
|
|
97
|
-
- auth - user object reference
|
|
98
|
-
- getAuth(pwa-env)
|
|
99
|
-
- user - active user boolean reference
|
|
100
|
-
- auth.currentUser
|
|
101
|
-
|
|
102
|
-
## Prerequisites
|
|
103
|
-
- Google:
|
|
104
|
-
- Google Analytics
|
|
105
|
-
- Firebase Project
|
|
106
|
-
|
|
107
|
-
- Firebase:
|
|
108
|
-
- Authentication - email login
|
|
109
|
-
- Cloud Storage - storage bucket
|
|
110
|
-
|
|
111
|
-
## Boilerplate JavaScript
|
|
112
|
-
For simple projects, copy project bundle to disk
|
|
129
|
+
## Boilerplate
|
|
130
|
+
For HTML projects, copy js bundle to disk
|
|
113
131
|
- source/esm/
|
|
114
132
|
- pwa-auth.js
|
|
115
133
|
- pwa-auth.js.map
|
|
@@ -144,19 +162,6 @@ For simple projects, copy project bundle to disk
|
|
|
144
162
|
|
|
145
163
|
</head>
|
|
146
164
|
```
|
|
147
|
-
## Modular Library for Bundlers
|
|
148
|
-
pwa-auth.js exports: classes and objects
|
|
149
|
-
```javascript
|
|
150
|
-
import 'pwa-auth';
|
|
151
|
-
// <user-icon subscribe emptyArtwork="./images/empty.jpg"></user-icon>
|
|
152
|
-
// <user-drawer subscribe settingsURL="./settings"></user-drawer>
|
|
153
|
-
// <user-settings emptyArtwork="./images/empty.jpg"></user-settings>
|
|
154
|
-
import { db, storage, auth, user } from 'pwa-auth';
|
|
155
|
-
// db - firestore database reference
|
|
156
|
-
// storage - firebase storage reference
|
|
157
|
-
// auth - user object reference
|
|
158
|
-
// user - active user boolean reference
|
|
159
|
-
```
|
|
160
165
|
|
|
161
166
|
## Implementation - Drawer
|
|
162
167
|
```html
|
|
@@ -193,49 +198,44 @@ import { db, storage, auth, user } from 'pwa-auth';
|
|
|
193
198
|
|
|
194
199
|
## CSS Custom Properties
|
|
195
200
|
```css
|
|
201
|
+
/* <user-icon> --> <button> */
|
|
196
202
|
:root {
|
|
197
|
-
|
|
198
|
-
--
|
|
199
|
-
--pwa_icon_hover: lightgrey;
|
|
203
|
+
--pwa_icon_background_color: #6cc04a;
|
|
204
|
+
--pwa_icon_radius: 6px;
|
|
200
205
|
--pwa_icon_border: 2px solid black;
|
|
201
206
|
--pwa_icon_padding: 0px 16px;
|
|
202
|
-
--
|
|
207
|
+
--pwa_icon_hover_color: lightgrey;
|
|
203
208
|
--pwa_icon_font: 'Arial', sans-serif;
|
|
209
|
+
--pwa_icon_height: 32px; /* state: Logged-out (sync) */
|
|
210
|
+
--pwa_icon_diameter: 32px; /* state: Logged-in (sync) */
|
|
211
|
+
}
|
|
204
212
|
|
|
205
|
-
/* <user-
|
|
206
|
-
|
|
207
|
-
--
|
|
208
|
-
|
|
209
|
-
/* <user-drawer> - Drawer Design */
|
|
213
|
+
/* <user-drawer> */
|
|
214
|
+
:root {
|
|
215
|
+
--pwa_drawer_background_color: #fff;
|
|
216
|
+
--pwa_drawer_border-radius: 20px;
|
|
210
217
|
--pwa_drawer_border: 3px #303030 solid;
|
|
211
218
|
--pwa_drawer_z-index: 2;
|
|
212
|
-
--
|
|
213
|
-
|
|
214
|
-
/* <user-drawer> - Input Design */
|
|
215
|
-
--pwa_drawer_text_color: #303030;
|
|
216
|
-
--pwa_drawer_background_color: #fff;
|
|
217
|
-
|
|
218
|
-
/* <user-settings> - Page Design */
|
|
219
|
-
--section_background: white;
|
|
220
|
-
|
|
221
|
-
/* <user-settings> - Navigation Design */
|
|
222
|
-
--pwa_settings_background: grey;
|
|
223
|
-
--pwa_nav_button: grey;
|
|
224
|
-
--pwa_nav_select: black;
|
|
225
|
-
--pwa_divider: grey;
|
|
226
|
-
--pwa_section_header: black;
|
|
219
|
+
--pwa_drawer_text_color: #303030;
|
|
220
|
+
}
|
|
227
221
|
|
|
228
|
-
/* <user-settings>
|
|
229
|
-
|
|
222
|
+
/* <user-settings> */
|
|
223
|
+
:root {
|
|
224
|
+
--pwa_settings_background_color: grey;
|
|
225
|
+
--pwa_nav_button_color: grey;
|
|
226
|
+
--pwa_nav_highlight_color: black;
|
|
227
|
+
--pwa_divider_color: grey;
|
|
228
|
+
--pwa_header_color: black;
|
|
229
|
+
--pwa_input_background_color: #E1E5EB;
|
|
230
230
|
--pwa_label_text_color: black;
|
|
231
|
+
--pwa_button_text_color: #fff;
|
|
232
|
+
--pwa_button_background_color: #6cc04a;
|
|
233
|
+
--pwa_button_border_color: #60b23e;
|
|
234
|
+
}
|
|
231
235
|
|
|
232
|
-
/*
|
|
233
|
-
|
|
234
|
-
--
|
|
235
|
-
--pwa_action_border_color: #60b23e;
|
|
236
|
-
|
|
237
|
-
/* Section */
|
|
238
|
-
--section_background: white;
|
|
236
|
+
/* shared core elements */
|
|
237
|
+
:root {
|
|
238
|
+
--section_background_color: white;
|
|
239
239
|
}
|
|
240
240
|
```
|
|
241
241
|
|
|
@@ -243,6 +243,12 @@ import { db, storage, auth, user } from 'pwa-auth';
|
|
|
243
243
|
pwa-auth.js is built upon the Firebase SDK (Software Development Kit).
|
|
244
244
|
The entire bundle is one instance of firebase that takes in the configuration information, internally.
|
|
245
245
|
|
|
246
|
+
## Project Bundles
|
|
247
|
+
```javascript
|
|
248
|
+
import './pwa-auth/source/development/pwa-auth';
|
|
249
|
+
import './pwa-auth/source/esm/pwa-auth';
|
|
250
|
+
```
|
|
251
|
+
|
|
246
252
|
## Technological Engineering
|
|
247
253
|
- Development (Server-side) Environment: [Node JavaScript](https://nodejs.org)
|
|
248
254
|
- Backend: Google Cloud: [Firebase](https://firebase.google.com/)
|
package/base/store.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store.js","sourceRoot":"","sources":["../typescript/store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAU,kBAAkB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAe,kBAAkB,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAa,gBAAgB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAY,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"store.js","sourceRoot":"","sources":["../typescript/store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAU,kBAAkB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAe,kBAAkB,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAa,gBAAgB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAY,iBAAiB,CAAC;AAErD,MAAM,CAAC,MAAM,KAAK,GAAG,cAAc,CAAC;IAClC,OAAO,EAAE;QACP,QAAQ,EAAI,SAAS,CAAC,OAAO;QAC7B,MAAM,EAAM,WAAW,CAAC,OAAO;QAC/B,OAAO,EAAK,YAAY,CAAC,OAAO;KACjC;IACD,QAAQ,EAAE,IAAI;CACf,CAAC,CAAC;AAKH,eAAe,KAAK,CAAC"}
|
|
@@ -10,7 +10,7 @@ export const inputStyle = css `
|
|
|
10
10
|
height: 50px;
|
|
11
11
|
text-align: left;
|
|
12
12
|
padding: 8px 16px;
|
|
13
|
-
background-color: var(--
|
|
13
|
+
background-color: var(--pwa_input_background_color, #E1E5EB);
|
|
14
14
|
border: 0;
|
|
15
15
|
border-radius: 4px;
|
|
16
16
|
-webkit-border-radius: 4px;
|
|
@@ -11,7 +11,7 @@ export const iconStyles = css `
|
|
|
11
11
|
margin: auto;
|
|
12
12
|
overflow: hidden;
|
|
13
13
|
border: var(--pwa_icon_border, 2px solid black);
|
|
14
|
-
background-color: var(--
|
|
14
|
+
background-color: var(--pwa_icon_background_color, #6cc04a);
|
|
15
15
|
color: white;
|
|
16
16
|
font-size: 15px;
|
|
17
17
|
text-decoration: none;
|
|
@@ -20,7 +20,7 @@ export const iconStyles = css `
|
|
|
20
20
|
|
|
21
21
|
.icon:hover,
|
|
22
22
|
.login:hover {
|
|
23
|
-
background-color: var(--
|
|
23
|
+
background-color: var(--pwa_icon_hover_color, lightgrey);
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
.icon {
|
|
@@ -18,7 +18,7 @@ export const authStyles = css `
|
|
|
18
18
|
.service {
|
|
19
19
|
overflow: hidden;
|
|
20
20
|
color: var(--pwa_drawer_text_color, #303030);
|
|
21
|
-
background-color: var(--
|
|
21
|
+
background-color: var(--section_background_color, white);
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
:host([animation]) {
|
|
@@ -16,7 +16,7 @@ export const navigation = css `
|
|
|
16
16
|
|
|
17
17
|
nav > ul > li > button {
|
|
18
18
|
|
|
19
|
-
color: var(--
|
|
19
|
+
color: var(--pwa_nav_button_color, grey);
|
|
20
20
|
border: 0;
|
|
21
21
|
width: 100%;
|
|
22
22
|
height: 36px;
|
|
@@ -31,7 +31,7 @@ export const navigation = css `
|
|
|
31
31
|
|
|
32
32
|
nav > ul > li > button[on] {
|
|
33
33
|
|
|
34
|
-
color: var(--
|
|
34
|
+
color: var(--pwa_nav_highlight_color, black);
|
|
35
35
|
|
|
36
36
|
}
|
|
37
37
|
|
|
@@ -44,7 +44,7 @@ export const navigation = css `
|
|
|
44
44
|
|
|
45
45
|
section {
|
|
46
46
|
grid-template-rows: auto 1fr;
|
|
47
|
-
background-color: var( --
|
|
47
|
+
background-color: var( --section_background_color, white);
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
`;
|
|
@@ -58,7 +58,7 @@ let UserSettings = class UserSettings extends connect(store)(LitElement) {
|
|
|
58
58
|
|
|
59
59
|
:host {
|
|
60
60
|
display: grid;
|
|
61
|
-
background-color: var(--
|
|
61
|
+
background-color: var(--pwa_settings_background_color, white);
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
form {
|
|
@@ -70,11 +70,11 @@ let UserSettings = class UserSettings extends connect(store)(LitElement) {
|
|
|
70
70
|
.pageTitle { margin: 0; }
|
|
71
71
|
|
|
72
72
|
h2 {
|
|
73
|
-
color: var(--
|
|
73
|
+
color: var(--pwa_header_color, black);
|
|
74
74
|
text-align: center;
|
|
75
75
|
text-shadow: 1px 1px 2px black, 0 0 15px grey, 0 0 5px #fff;
|
|
76
76
|
|
|
77
|
-
border-bottom: 2px solid var(--
|
|
77
|
+
border-bottom: 2px solid var(--pwa_divider_color, black);
|
|
78
78
|
|
|
79
79
|
margin: 0;
|
|
80
80
|
padding: 16px 0;
|
package/package.json
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"url": "https://www.jackspublishing.com",
|
|
7
7
|
"email": "jack.solutionbox@gmail.com"
|
|
8
8
|
},
|
|
9
|
-
"version": "3.3.
|
|
9
|
+
"version": "3.3.3",
|
|
10
10
|
"description": "pwa-auth is a collection of four HTML webomponents for User Management to display a login button with icon picture state once logged in. Sign up and login within a drawer and optionally a static for a page. Being able to log out, change account details, and delete account.",
|
|
11
11
|
"homepage": "https://pwa-authentic.firebaseapp.com",
|
|
12
12
|
"repository": {
|
|
@@ -38,6 +38,13 @@
|
|
|
38
38
|
".": {
|
|
39
39
|
"default": "./base/export/pwa-auth.js",
|
|
40
40
|
"types": "./base/export/pwa-auth.d.ts"
|
|
41
|
+
},
|
|
42
|
+
"./source/development/pwa-auth": {
|
|
43
|
+
"default": "./source/esm/pwa-auth.js",
|
|
44
|
+
"types": "./source/esm/pwa-auth.d.ts"
|
|
45
|
+
},
|
|
46
|
+
"./source/esm/pwa-auth": {
|
|
47
|
+
"default": "./source/esm/pwa-auth.js"
|
|
41
48
|
}
|
|
42
49
|
},
|
|
43
50
|
"license": "SEE LICENSES.txt",
|