pwa-auth 2.0.6 → 2.0.7

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 CHANGED
@@ -6,6 +6,18 @@ All notable changes to pwa-auth.js will be documented in this file.
6
6
  - Social Login Flow
7
7
  - animated login and data
8
8
 
9
+ # [2.0.7] - 2025-09-07
10
+
11
+ ## Changed
12
+ - CSS Custom Properties Default
13
+
14
+ ## Notes
15
+ * Both - Client-side and Server-side - Object - Libraries
16
+ - in browser: window
17
+ - in node.js: global
18
+ - in web workers: self
19
+ - ECMA Script 2020+: globalThis
20
+
9
21
  # [2.0.6] - 2025-09-07
10
22
 
11
23
  ## Changed
package/README.md CHANGED
@@ -2,7 +2,6 @@ Progressive Website Application - Authentication
2
2
  ======================
3
3
  Jack's Publishing maintains Custom HTML Elements where developers can focus on UX rather than low-level API calls.
4
4
 
5
-
6
5
  pwa-auth.js is a bundle of 3 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.
7
6
 
8
7
  pwa-auth.js (Authentication Components) 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.
@@ -12,15 +11,8 @@ pwa-auth.js meets basic user needs with the interplay of:
12
11
  - Drop-down Drawer
13
12
  - Settings Page
14
13
 
15
-
16
-
17
14
  You will learn how to place 3 Custom HTML Tags, reference CSS, and How to Initialize an Firebase Instance. By either <b>Standard</b> or <b>Modular</b> ECMA Script.
18
15
 
19
- <!--
20
- Jack's Publishing is dedicated to maintaining components for this project.
21
-
22
- pwa-auth.js is designed to be simple, by meeting basic user needs with the interplay of an Icon Button, Drop-down Drawer, and a Settings Page.
23
- -->
24
16
  Continue reading to start installing the bundle:
25
17
  - Pick the JavaScript File Type to Reference
26
18
  - Understand the Library Features
@@ -51,21 +43,27 @@ Visit: [Live Demo](https://pwa-authentic.firebaseapp.com)
51
43
  ```javascript
52
44
  import 'pwa-auth';
53
45
  ```
54
-
55
- ## Boilerplate
56
- - 3 Tag Placements (HTML - Custom Elements)
46
+ ## HTML
47
+ - Custom Elements
57
48
  - user-icon
58
49
  - user-drawer
59
50
  - user-settings
60
- - Cascading Style Sheets (CSS - Custom Properties)
61
- - ECMA Script (JavaScript)
62
- - <base> tag consideration: Hyperlinks without base tag
63
51
 
64
- ## HTML Custom Elements
65
- ```html
52
+ ## CSS
53
+ - Custom Properties
54
+
55
+ ## JavaScript
56
+ - Google Prerequisites:
57
+ - Google Analytics
58
+ - Firebase Project
59
+ - Firebase Services:
60
+ - Authentication - email login
61
+ - Cloud Storage - storage bucket
66
62
 
63
+ ## Boilerplate
64
+ ```html
67
65
  <head>
68
- <!-- CSS Custom Properties - Choice 1: Link Tag -->
66
+ <!-- pwa-auth.js - CSS Custom Properties - Choice 1: Link Tag -->
69
67
  <link type="stylesheet" href="pwa-styles.css">
70
68
  </head>
71
69
 
@@ -101,8 +99,35 @@ import 'pwa-auth';
101
99
  <user-settings emptyArtwork="images/empty.jpg"></user-settings>
102
100
  </main>
103
101
 
104
- <script>/* Firebase Instance Configuration */</script>
105
- <style>/* CSS Custom Properties - Choice 2: Style Tag */</style>
102
+ <!-- pwa-auth.js - CSS Custom Variables - Choice 2: Style Tag -->
103
+ <style>
104
+ :root {
105
+ --pwa_icon_diameter: 32px;
106
+ /* copy all properties from css/pwa-styles.css */
107
+ }
108
+ </style>
109
+
110
+ <!-- pwa-auth.js - Firebase Instance -->
111
+ <script>
112
+ // Firebase Configuration Object
113
+ window.process = { env: { FIREBASE_CONFIG: JSON.stringify({
114
+ apiKey: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
115
+ authDomain: "xxxxxxx.xxxxxxx.xxx",
116
+ databaseURL: "https://xxxxxxx.xxxxxxx.xxx",
117
+ projectId: "xxxxxxx",
118
+ storageBucket: "xxxxxxx.xxxxxxx.xxx",
119
+ messagingSenderId: "xxxxxxxxxxx",
120
+ appId: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
121
+ measurementId: "xxxxxxxxxxx"
122
+ })
123
+ }
124
+ };
125
+
126
+ // Localhost - Firebase Configuratioon Object
127
+ if (lolalhost) { window.process = { env: { FIREBASE_CONFIG: 'etc.' } } }
128
+ </script>
129
+
130
+ <!-- pwa-auth.js - Webcomponent Library -->
106
131
  <script src="pwa-auth.js"></script>
107
132
 
108
133
  </body>
@@ -134,111 +159,6 @@ import 'pwa-auth';
134
159
  | --pwa_action_background_color | Button | #6cc04a | user-settings |
135
160
  | --pwa_action_border_color | Button | #60b23e | user-settings |
136
161
 
137
- ## CSS Design
138
- ```html
139
- <!-- CSS: Custom Variables -->
140
- <style>
141
-
142
- :root {
143
-
144
- /* WebComponent 1 : User Icon
145
- <user-icon>
146
- <button> */
147
- --pwa_icon_hover: lightgrey;
148
- --pwa_icon_background: #6cc04a;
149
- --pwa_icon_border: 2px solid black;
150
-
151
- /* WebComponent 1: logged-out
152
- <user-icon>
153
- <button class="login"> */
154
- --pwa_icon_height: 32px; /* sync to --pwa_icon_diameter */
155
- --pwa_icon_padding: 0px 16px;
156
- --pwa_icon_radius: 6px;
157
- --pwa_icon_font: 'Arial', sans-serif;
158
-
159
- /* WebComponent 1: logged-in
160
- <user-icon>
161
- <button class="icon"> */
162
- --pwa_icon_diameter: 32px; /* sync to --pwa_icon_height */
163
-
164
-
165
-
166
- /* WebComponent 2: Drop-down Drawer
167
- <user-drawer>
168
- <section>
169
- <header></header>
170
- <div class="spec"> */
171
- --pwa_drawer_border: 3px #303030 solid;
172
- --pwa_drawer_z-index: 2;
173
- --pwa_drawer_border-radius: 20px;
174
-
175
- /* WebComponent 2: Drop-down Drawer - logged-out
176
- <div class="spec"> */
177
- --pwa_drawer_text_color: #303030;
178
- --pwa_drawer_background_color: #fff;
179
-
180
-
181
-
182
- /* WebComponent 3: Settings Page
183
- <user-settings>
184
- <nav></nav>
185
- <section></section> */
186
- --pwa_settings_background: white;
187
- --pwa_divider: black;
188
-
189
- /* Navigation */
190
- --pwa_nav_button: grey;
191
- --pwa_nav_select: black;
192
-
193
- /* Section Header */
194
- --pwa_section_header: black;
195
-
196
- /* Label */
197
- --pwa_label_text_color: black;
198
-
199
- /* Input */
200
- --pwa_input_background: #E1E5EB;
201
-
202
- /* Button */
203
- --pwa_action_text_color: #fff;
204
- --pwa_action_background_color: #6cc04a;
205
- --pwa_action_border_color: #60b23e;
206
-
207
- }
208
-
209
- </style>
210
- ```
211
-
212
- ## Google Prerequisites
213
- - Google Analytics
214
- - Firebase Project
215
-
216
- ## Firebase Services
217
- - Authentication - email login
218
- - Cloud Storage - storage bucket
219
-
220
- ## JavaScript, Firebase Instance Configuration
221
- ```html
222
- <script>
223
- // Firebase configuration Object
224
- window.process = { env: { FIREBASE_CONFIG: JSON.stringify({
225
- apiKey: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
226
- authDomain: "xxxxxxx.xxxxxxx.xxx",
227
- databaseURL: "https://xxxxxxx.xxxxxxx.xxx",
228
- projectId: "xxxxxxx",
229
- storageBucket: "xxxxxxx.xxxxxxx.xxx",
230
- messagingSenderId: "xxxxxxxxxxx",
231
- appId: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
232
- measurementId: "xxxxxxxxxxx"
233
- })
234
- }
235
- };
236
-
237
- // Localhost - Firebase Configuratioon Object
238
- if (lolalhost) { window.process = { env: { FIREBASE_CONFIG: 'etc.' } } }
239
- </script>
240
- ```
241
-
242
162
  ## Global Namespaced Firebase Instance Configuration
243
163
  pwa-auth.js is built upon the Firebase SDK (Software Development Kit).
244
164
  The entire bundle is one instance of firebase that takes in the configuration information, internally.
@@ -251,15 +171,9 @@ If you are looking for a Namespaced Firebase Configuration, please send it as fe
251
171
  - Predicate State Behavior: [Redux](https://redux.js.org/)
252
172
  - Frontend (Client-side): [Lit](https://lit.dev)
253
173
 
254
- ### Both - Client-side and Server-side - Object - Libraries
255
- - in browser: window
256
- - in node.js: global
257
- - in web workers: self
258
- - ECMA Script 2020+: globalThis
259
-
260
174
  ## Feedback
261
175
  All feedback, comments, bugs, and requests are welcome.
262
176
  * [Jack's Publishing](https://www.jackspublishing.com)
263
177
  * [contractor's centre](https://www.contractorscentre.com)
264
178
  * [Node Package Manager](https://www.npmjs.com/package/pwa-auth)
265
- * [Sponsor Jacek Markiewicz](https://github.com/sponsors/busynest/button)
179
+ * [Sponsor Jacek Markiewicz](https://github.com/sponsors/busynest/button)
package/demo/index.html CHANGED
@@ -15,8 +15,8 @@
15
15
  <!-- Cascading Style Sheets -->
16
16
  <link rel="stylesheet" href="css/styles.css">
17
17
 
18
- <!-- pwa-auth.js - CSS Custom Variables -->
19
- <link rel="stylesheet" href="css/pwa-styles.css">
18
+ <!-- pwa-auth.js - CSS Custom Variables - Option 1
19
+ <link rel="stylesheet" href="css/pwa-styles.css"> -->
20
20
 
21
21
  <!-- pwa-auth.js - Module Configuration Objects -->
22
22
  <script>
@@ -0,0 +1,5 @@
1
+ export declare const iconRoot: import("lit").CSSResult;
2
+ export declare const drawerRoot: import("lit").CSSResult;
3
+ export declare const settingsRoot: import("lit").CSSResult;
4
+ export declare const themeRoot: import("lit").CSSResult;
5
+ //# sourceMappingURL=default.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"default.d.ts","sourceRoot":"","sources":["../../source/css/default.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,QAAQ,yBA4BpB,CAAC;AAEF,eAAO,MAAM,UAAU,yBAyBtB,CAAC;AAEF,eAAO,MAAM,YAAY,yBAiCxB,CAAC;AAUF,eAAO,MAAM,SAAS,yBAQrB,CAAC"}
@@ -0,0 +1,99 @@
1
+ import { css } from "lit";
2
+ export const iconRoot = css `
3
+
4
+ /* CSS: Custom Variables: <head> tag */
5
+
6
+ :root {
7
+
8
+ /* WebComponent 1 : User Icon
9
+ <user-icon>
10
+ <button> */
11
+ --pwa_icon_hover: lightgrey; /* custom-elements Folder > icon Folder > CSS Folder > icon.ts */
12
+ --pwa_icon_background: #6cc04a; /* custom-elements Folder > icon Folder > CSS Folder > icon.ts */
13
+ --pwa_icon_border: 2px solid black; /* custom-elements Folder > icon Folder > CSS Folder > icon.ts */
14
+
15
+ /* WebComponent 1: logged-out
16
+ <user-icon>
17
+ <button class="login"> */
18
+ --pwa_icon_height: 32px; /* sync to --pwa_icon_diameter */ /* custom-elements Folder > icon Folder > CSS Folder > icon.ts */
19
+ --pwa_icon_padding: 0px 16px; /* custom-elements Folder > icon Folder > CSS Folder > icon.ts */
20
+ --pwa_icon_radius: 6px; /* custom-elements Folder > icon Folder > CSS Folder > icon.ts */
21
+ --pwa_icon_font: 'Arial', sans-serif; /* custom-elements Folder > icon Folder > CSS Folder > icon.ts */
22
+
23
+ /* WebComponent 1: logged-in
24
+ <user-icon>
25
+ <button class="icon"> */
26
+ --pwa_icon_diameter: 32px; /* sync to --pwa_icon_height */ /* custom-elements Folder > icon Folder > CSS Folder > icon.ts */
27
+
28
+ }
29
+
30
+ `;
31
+ export const drawerRoot = css `
32
+
33
+ /* CSS: Custom Variables: <head> tag */
34
+
35
+ :root {
36
+
37
+ /* WebComponent 2: Drop-down Drawer
38
+ <user-drawer>
39
+ <section>
40
+ <header></header>
41
+ <div class="spec"> */
42
+ --pwa_drawer_border: 3px #303030 solid; /* custom-elements Folder > drawer Folder > CSS Folder > drawer.ts */
43
+ --pwa_drawer_z-index: 2; /* custom-elements Folder > drawer Folder > CSS Folder > drawer.ts */
44
+ --pwa_drawer_border-radius: 20px; /* custom-elements Folder > drawer Folder > CSS Folder > drawer.ts */
45
+
46
+ /* WebComponent 2: Drop-down Drawer - logged-out
47
+ <div class="spec"> */
48
+ --pwa_drawer_text_color: #303030; /* custom-elements Folder > drawer Folder > CSS Folder > drawer.ts */
49
+ --pwa_drawer_background_color: #fff; /* custom-elements Folder > drawer Folder > CSS Folder > drawer.ts */
50
+
51
+ /* WebComponent 2: Drop-down Drawer - logged-in
52
+ <div class="spec" on> */
53
+
54
+ }
55
+
56
+ `;
57
+ export const settingsRoot = css `
58
+
59
+ /* CSS: Custom Variables: <head> tag */
60
+
61
+ :root {
62
+
63
+ /* WebComponent 3: Settings Page
64
+ <user-settings>
65
+ <nav></nav>
66
+ <section></section> */
67
+ --pwa_settings_background: white; /* custom-elements Folder > settings Folder > settings.ts */
68
+ --pwa_divider: black; /* custom-elements Folder > settings Folder > settings.ts */
69
+
70
+ /* Navigation */
71
+ --pwa_nav_button: grey; /* custom-elements Folder > settings Folder > CSS Folder > navigation.ts */
72
+ --pwa_nav_select: black; /* custom-elements Folder > settings Folder > CSS Folder > navigation.ts */
73
+
74
+ /* Section Header */
75
+ --pwa_section_header: black; /* custom-elements Folder > settings Folder > settings.ts */
76
+
77
+ /* Label */
78
+ --pwa_label_text_color: black; /* Form Folder > label.ts */
79
+
80
+ /* Input */
81
+ --pwa_input_background: #E1E5EB; /* Form Folder > input.ts */
82
+
83
+ /* Button */
84
+ --pwa_action_text_color: #fff; /* Form Folder > button.ts */
85
+ --pwa_action_background_color: #6cc04a; /* Form Folder > button.ts */
86
+ --pwa_action_border_color: #60b23e; /* Form Folder > button.ts */
87
+
88
+ }
89
+
90
+ `;
91
+ export const themeRoot = css `
92
+
93
+ /* Dark Theme */
94
+ @media (prefers-color-scheme: dark) { }
95
+
96
+ /* Light Theme */
97
+ @media (prefers-color-scheme: light) { }
98
+
99
+ `;
@@ -19,9 +19,9 @@ export const buttonStyle = css `
19
19
  line-height: 16px;
20
20
  padding: 10px 16px;
21
21
  border-radius: 6px;
22
- color: var(--pwa_action_text_color);
23
- background-color: var(--pwa_action_background_color);
24
- border-color: var(--pwa_action_border_color);
22
+ color: var(--pwa_action_text_color, #fff);
23
+ background-color: var(--pwa_action_background_color, #6cc04a);
24
+ border-color: var(--pwa_action_border_color, #60b23e);
25
25
  box-shadow: 1px 1px 1px grey;
26
26
  }
27
27
 
@@ -11,7 +11,7 @@ export const inputStyle = css `
11
11
  text-align: left;
12
12
  margin: 0 16px 0 16px;
13
13
  padding: 8px 16px;
14
- background-color: var(--pwa_input_background);
14
+ background-color: var(--pwa_input_background, #E1E5EB);
15
15
  border: 0;
16
16
  border-radius: 4px;
17
17
  -webkit-border-radius: 4px;
@@ -4,7 +4,7 @@ export const labelStyle = css `
4
4
  label { font-size: .9em; }
5
5
  label {
6
6
  display: grid;
7
- color: var(--pwa_label_text_color);
7
+ color: var(--pwa_label_text_color, black);
8
8
  box-sizing: border-box;
9
9
  width: 100%;
10
10
  font-size: smaller;
@@ -25,13 +25,13 @@ export const drawerStyle = css `
25
25
  left: 0;
26
26
  right: 0;
27
27
  transition-duration: 1.4s;
28
- border: var(--pwa_drawer_border);
29
- z-index: var(--pwa_drawer_z-index);
28
+ border: var(--pwa_drawer_border, 3px #303030 solid);
29
+ z-index: var(--pwa_drawer_z-index, 2);
30
30
  overflow: hidden;
31
- background-color: var(--pwa_drawer_background_color);
32
- color: var(--pwa_drawer_text_color);
31
+ background-color: var(--pwa_drawer_background_color, #fff);
32
+ color: var(--pwa_drawer_text_color, #303030);
33
33
  box-sizing: border-box;
34
- border-radius: var(--pwa_drawer_border-radius);
34
+ border-radius: var(--pwa_drawer_border-radius, 20px);
35
35
  height: auto;
36
36
  transition-property: visibility, max-height;
37
37
  }
@@ -11,8 +11,8 @@ export const iconStyles = css `
11
11
  cursor: pointer;
12
12
  margin: auto;
13
13
  overflow: hidden;
14
- border: var(--pwa_icon_border);
15
- background-color: var(--pwa_icon_background);
14
+ border: var(--pwa_icon_border, 2px solid black);
15
+ background-color: var(--pwa_icon_background, #6cc04a);
16
16
  color: white;
17
17
  font-size: 15px;
18
18
  text-decoration: none;
@@ -22,13 +22,13 @@ export const iconStyles = css `
22
22
  /* Hover Styles */
23
23
  .icon:hover,
24
24
  .login:hover {
25
- background-color: var(--pwa_icon_hover);
25
+ background-color: var(--pwa_icon_hover, lightgrey);
26
26
  }
27
27
 
28
28
  /* Logged-in State: The Icon Button */
29
29
  .icon {
30
- height: var(--pwa_icon_diameter);
31
- width: var(--pwa_icon_diameter);
30
+ height: var(--pwa_icon_diameter, 32px);
31
+ width: var(--pwa_icon_diameter, 32px);
32
32
  border-radius: 50%;
33
33
  padding: 0;
34
34
  }
@@ -36,10 +36,10 @@ export const iconStyles = css `
36
36
  /* The Login Button */
37
37
  .login {
38
38
  width: auto;
39
- border-radius: var(--pwa_icon_radius);
40
- height: var(--pwa_icon_height);
41
- padding: var(--pwa_icon_padding);
42
- font-family: var(--pwa_icon_font);
39
+ border-radius: var(--pwa_icon_radius, 6px);
40
+ height: var(--pwa_icon_height, 32px);
41
+ padding: var(--pwa_icon_padding, 0px 16px);
42
+ font-family: var(--pwa_icon_font, 'Arial', sans-serif);
43
43
  font-weight: 500;
44
44
  text-align: center;
45
45
  }
@@ -51,8 +51,8 @@ export const iconStyles = css `
51
51
  transition-duration: 2s;
52
52
  clip-path: circle(50%);
53
53
  overflow: hidden;
54
- width: calc(var(--pwa_icon_diameter) - 2px);
55
- height: calc(var(--pwa_icon_diameter) - 2px);
54
+ width: calc(var(--pwa_icon_diameter, 32px) - 2px);
55
+ height: calc(var(--pwa_icon_diameter, 32px) - 2px);
56
56
  margin: auto;
57
57
  }
58
58
 
@@ -18,7 +18,7 @@ export const navigation = css `
18
18
  /* Navigation Button */
19
19
  nav > ul > li > button {
20
20
 
21
- color: var(--pwa_nav_button);
21
+ color: var(--pwa_nav_button, grey);
22
22
  border: 0;
23
23
  width: 100%;
24
24
  height: 36px;
@@ -34,7 +34,7 @@ export const navigation = css `
34
34
  /* Navigation Button - Active */
35
35
  nav > ul > li > button[on] {
36
36
 
37
- color: var(--pwa_nav_select);
37
+ color: var(--pwa_nav_select, black);
38
38
 
39
39
  }
40
40
 
@@ -54,7 +54,7 @@ let UserSettings = class UserSettings extends connect(store)(LitElement) {
54
54
  /* Button Padding for Border Outline */
55
55
  :host {
56
56
  display: grid;
57
- background-color: var(--pwa_settings_background);
57
+ background-color: var(--pwa_settings_background, white);
58
58
  }
59
59
 
60
60
  /* Page Form */
@@ -68,12 +68,12 @@ let UserSettings = class UserSettings extends connect(store)(LitElement) {
68
68
  .pageTitle { margin: 0; }
69
69
 
70
70
  h2 {
71
- color: var(--pwa_section_header);
71
+ color: var(--pwa_section_header, black);
72
72
  text-align: center;
73
73
  text-shadow: 1px 1px 2px black, 0 0 15px grey, 0 0 5px #fff;
74
74
 
75
- border-top: 2px solid var(--pwa_divider);
76
- border-bottom: 2px solid var(--pwa_divider);
75
+ border-top: 2px solid var(--pwa_divider, black);
76
+ border-bottom: 2px solid var(--pwa_divider, black);
77
77
 
78
78
  margin: 0;
79
79
  padding: 8px 0;