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.
Files changed (50) hide show
  1. package/CHANGELOG.md +76 -4
  2. package/README.md +113 -83
  3. package/demo/index.html +93 -101
  4. package/demo/styles.css +52 -0
  5. package/images/empty.jpg +0 -0
  6. package/images/favicon.ico +0 -0
  7. package/images/manifest/logo-144.png +0 -0
  8. package/images/manifest/logo-192.png +0 -0
  9. package/images/manifest/logo-48.png +0 -0
  10. package/images/manifest/logo-512.png +0 -0
  11. package/images/manifest/logo-72.png +0 -0
  12. package/images/manifest/logo-96.png +0 -0
  13. package/images/manifest/maskable_icon_x128.png +0 -0
  14. package/images/manifest/maskable_icon_x192.png +0 -0
  15. package/images/manifest/maskable_icon_x384.png +0 -0
  16. package/images/manifest/maskable_icon_x48.png +0 -0
  17. package/images/manifest/maskable_icon_x512.png +0 -0
  18. package/images/manifest/maskable_icon_x72.png +0 -0
  19. package/images/manifest/maskable_icon_x96.png +0 -0
  20. package/images/npm.svg +85 -85
  21. package/license +21 -21
  22. package/manifest.json +47 -44
  23. package/npm/pwa-auth.js +3163 -0
  24. package/npm/pwa-auth.js.map +1 -0
  25. package/package.json +50 -38
  26. package/deploy/store.js +0 -18
  27. package/deploy/styles-drawer.js +0 -139
  28. package/deploy/styles-settings.js +0 -57
  29. package/deploy/styles.js +0 -88
  30. package/deploy/user-action.js +0 -69
  31. package/deploy/user-drawer.js +0 -163
  32. package/deploy/user-functions.js +0 -175
  33. package/deploy/user-icon.js +0 -107
  34. package/deploy/user-reducer.js +0 -41
  35. package/deploy/user-settings.js +0 -418
  36. package/polymer.json +0 -24
  37. package/pwa-auth.js +0 -16
  38. package/robots.txt +0 -2
  39. package/src/store.ts +0 -52
  40. package/src/styles-drawer.ts +0 -143
  41. package/src/styles-settings.ts +0 -61
  42. package/src/styles.ts +0 -95
  43. package/src/user-action.ts +0 -91
  44. package/src/user-drawer.ts +0 -162
  45. package/src/user-functions.ts +0 -173
  46. package/src/user-icon.ts +0 -106
  47. package/src/user-reducer.ts +0 -91
  48. package/src/user-settings.ts +0 -402
  49. package/tsconfig.json +0 -19
  50. package/webpack.config.js +0 -72
@@ -1,91 +0,0 @@
1
-
2
-
3
- /**
4
- @license
5
- Copyright (c) 2018 The Polymer Project Authors. All rights reserved.
6
- This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
7
- The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
8
- The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
9
- Code distributed by Google as part of the polymer project is also
10
- subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
11
- */
12
-
13
- import { Reducer } from 'redux';
14
- import { RootAction } from './store';
15
- import {
16
- OPEN_SIGN,
17
- CLOSE_SIGN,
18
-
19
- SIGN_UP_OPEN,
20
- SIGN_UP_CLOSE,
21
-
22
- LOGGED_IN,
23
- SETTINGS_PAGE,
24
-
25
- SET_USER,
26
- SET_IMAGE,
27
- SET_NAME
28
-
29
- // PROFILE_TYPE,
30
- } from './user-action';
31
-
32
- export interface AppState {
33
- snackState: boolean,
34
- // logged: boolean
35
- register: boolean,
36
- settings: string,
37
-
38
- currentUser: boolean,
39
- setUser: string,
40
- customer: string
41
-
42
- name: string,
43
- photoURL: string,
44
- phone: string,
45
- email: string
46
-
47
- // profileChoice: string,
48
- }
49
-
50
- const start: AppState = {
51
- snackState: false,
52
- // logged: false,
53
- register: true,
54
- settings: 'profile',
55
-
56
- currentUser: false,
57
- setUser: "user",
58
- customer: "someone",
59
-
60
- name: 'Simon',
61
- photoURL: 'demo.png',
62
- phone: '(555) 555-5555',
63
- email: 'lorium@ipsum.com',
64
-
65
- // profileChoice: 'unChosen',
66
- };
67
-
68
- const user: Reducer<AppState, RootAction> = ( state = start, action ) => {
69
- switch ( action.type ) {
70
-
71
- case OPEN_SIGN: return { ...state, snackState: true };
72
- case CLOSE_SIGN: return { ...state, snackState: false };
73
-
74
- case SIGN_UP_OPEN: return { ...state, register: true };
75
- case SIGN_UP_CLOSE: return { ...state, register: false };
76
-
77
- case LOGGED_IN: return { ...state, currentUser: action.currentUser };
78
- case SETTINGS_PAGE: return { ...state, settings: action.option };
79
-
80
- case SET_USER: return { ...state, setUser: action.user };
81
- case SET_IMAGE: return { ...state, photoURL: action.image };
82
- case SET_NAME: return { ...state, customer: action.name };
83
-
84
- // case PROFILE_TYPE: return { ...state, profileChoice: action.profileType};
85
-
86
- default: return state;
87
-
88
- }
89
- }
90
-
91
- export default user;
@@ -1,402 +0,0 @@
1
-
2
- /**
3
- @license
4
- Copyright (c) 2018 The Polymer Project Authors. All rights reserved.
5
- This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
6
- The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
7
- The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
8
- Code distributed by Google as part of the polymer project is also
9
- subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
10
- */
11
-
12
- // @ts-check
13
-
14
- import { html, LitElement, css, customElement, property } from 'lit-element';
15
- import { connect } from 'pwa-helpers/connect-mixin.js';
16
- import { store, RootState } from './store';
17
- import { navigate, setName } from './user-action.js';
18
- import { userStyles } from './styles';
19
- import { Settings } from './styles-settings';
20
- import { firebaseUser, deleteUser, runFirebase, userName, profileURL, userEmail } from './user-functions'; // runFirebase
21
-
22
- export const faceIcon = html`<svg viewBox="0 0 24 24" height="175px" width="175px"><path d="M9 11.75c-.69 0-1.25.56-1.25 1.25s.56 1.25 1.25 1.25 1.25-.56 1.25-1.25-.56-1.25-1.25-1.25zm6 0c-.69 0-1.25.56-1.25 1.25s.56 1.25 1.25 1.25 1.25-.56 1.25-1.25-.56-1.25-1.25-1.25zM12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8 0-.29.02-.58.05-.86 2.36-1.05 4.23-2.98 5.21-5.37C11.07 8.33 14.05 10 17.42 10c.78 0 1.53-.09 2.25-.26.21.71.33 1.47.33 2.26 0 4.41-3.59 8-8 8z"></path></svg>`;
23
-
24
- @customElement('user-settings')
25
- export class UserSettings extends connect(store)(LitElement) {
26
-
27
- @property({type: String})
28
- private profileTopic = '';
29
-
30
- @property({type: Boolean})
31
- private _user = false;
32
-
33
- @property({type: String})
34
- private _name = '';
35
-
36
- @property({type: String})
37
- private _person = '';
38
-
39
- @property({type: Number})
40
- private _phone = '';
41
-
42
- @property({type: String})
43
- private _userMail = '';
44
-
45
- @property({type: String})
46
- private _photoURL = '';
47
-
48
- @property({type: String})
49
- private _imagePath = '';
50
-
51
- constructor() {
52
- super();
53
- }
54
-
55
- protected firstUpdated() {
56
- const a = this.shadowRoot.getElementById('settings');
57
- a.addEventListener('click', e => { e.preventDefault(); });
58
- const b = this.shadowRoot.getElementById('emailForm');
59
- b.addEventListener('click', e => { e.preventDefault(); });
60
- const c = this.shadowRoot.getElementById('passwordForm');
61
- c.addEventListener('click', e => { e.preventDefault(); });
62
- const d = this.shadowRoot.getElementById('deleteForm');
63
- d.addEventListener('click', e => { e.preventDefault(); });
64
-
65
- this.shadowRoot.getElementById('profile') .addEventListener('click', () => { store.dispatch(navigate('profile')); } );
66
- this.shadowRoot.getElementById('email') .addEventListener('click', () => { store.dispatch(navigate('email')); } );
67
- this.shadowRoot.getElementById('password') .addEventListener('click', () => { store.dispatch(navigate('password')); } );
68
- this.shadowRoot.getElementById('account') .addEventListener('click', () => { store.dispatch(navigate('delete')); } );
69
-
70
- this.shadowRoot.getElementById('save') .addEventListener('click', () => { this.alertProfile(); } );
71
- this.shadowRoot.getElementById('update') .addEventListener('click', () => { this.alertEmail(); } );
72
- this.shadowRoot.getElementById('pass') .addEventListener('click', () => { this.alertPassword(); } );
73
- this.shadowRoot.getElementById('deleteUser').addEventListener('click', () => { this.alertDelete(); } );
74
-
75
- this.shadowRoot.getElementById("fileupload").addEventListener('change', () => { this._handleFiles(); }, false);
76
-
77
- runFirebase();
78
-
79
- // @ts-ignore
80
- firebase.auth().onAuthStateChanged( (firebaseUser) => {
81
- if (firebaseUser) { /* INCLUDE */
82
- this._person = userName();
83
- this._userMail = userEmail();
84
- this._photoURL = profileURL();
85
- store.dispatch( setName( this._person ) );
86
- }
87
- else { /* EXCLUDE */ }
88
- store.dispatch( setName( this._person ) );
89
- });
90
- }
91
-
92
- stateChanged(state: RootState) {
93
- this.profileTopic = state.user!.settings;
94
- this._user = state.user!.currentUser;
95
- this._person = state.user!.customer;
96
- this._name = state.user!.name;
97
- this._phone = state.user!.phone;
98
- this._userMail = state.user!.email;
99
- this._photoURL = state.user!.photoURL;
100
- }
101
-
102
- private alertProfile() { if (this._user) { this.updateProfile() } else { alert('Please Login'); } }
103
- private updateProfile() {
104
- const person = firebaseUser();
105
- const contractor = this.shadowRoot.getElementById('contractor').value;
106
- const phone = this.shadowRoot.getElementById('phoneNumber').value;
107
- const list = this.shadowRoot.getElementById('list').checked;
108
- if( contractor === null ) { contractor === this._person }
109
- // const photo = this.shadowRoot.getElementById('');
110
- // const company = this.shadowRoot.getElementById('company').value;
111
- // const enroll = this.shadowRoot.getElementById('who').value;
112
- if (firebaseUser) {
113
- person.updateProfile({
114
- displayName: contractor,
115
- phoneNumber: phone
116
- // photoURL: ""
117
- })
118
- .then( () => {
119
- alert(
120
- 'updated name:' + contractor +
121
- 'updated phone:' + phone +
122
- 'Public Profile:' + list
123
- );
124
- })
125
- .catch( (error: object) =>{ console.error('Error writing new message to Firebase Database', error); });
126
- /*
127
- firestore.collection("users").doc(user.id).set({
128
- company: user.id,
129
- enrollment: list
130
- // location: this.location,
131
- })
132
- .then( () => { console.log("Document successfully written!"); })
133
- .catch( (error) => { console.error('Error writing new message to Firebase Database', error); }); */
134
- }
135
- // location.reload();
136
- }
137
-
138
- /* Update email */
139
- private alertEmail() { if (this._user) { this.updateEmail(); } else { alert('Please Login'); } }
140
- private updateEmail() {
141
- const user = firebaseUser();
142
- const email = this.shadowRoot.getElementById('email').value;
143
- user.updateEmail(email)
144
- .then( () => { console.log("Email update successful!" ); })
145
- .catch( (error: object) => { console.error('Error writing new message to Firebase Database', error); });
146
- user.sendEmailVerification()
147
- .then( () => { console.log("Email Verification successful!");})
148
- .catch( (error: object) => { console.error('Error writing new message to Firebase Database', error); });
149
- }
150
-
151
- /* Update Password */
152
- private alertPassword() { if (this._user) { this.updatePassword(); } else { alert('Please Login'); } }
153
- private updatePassword() {
154
- const user = firebaseUser();
155
- const newPassword = this.shadowRoot.getElementById('newPass').value;
156
- user.updatePassword(newPassword)
157
- .then( () => { console.log("Password successful!"); })
158
- .catch( (error: object) => { console.error('Error writing new message to Firebase Database', error); });
159
- }
160
-
161
- /* Delete Account */
162
- private alertDelete() { if (this._user) { this.deleteUser(); } else { alert('Please Login'); } }
163
- private deleteUser() {
164
- const d = confirm("Delete Account?");
165
- if ( d == true ) { deleteUser(); console.log("user gone"); }
166
- else { console.log("user here"); }
167
- }
168
-
169
- private _handleFiles() {
170
- const uploader = this.shadowRoot.getElementById('uploader');
171
- const file = this.shadowRoot.getElementById('fileupload').files[0];
172
- const now = storageRef.child('/images/' + file.name );
173
- const task = now.put(file);
174
- task.on('state_changed',
175
- function progress(snapshot: object) { const percentage = ( snapshot.bytesTransferred / snapshot.totalBytes ) * 100; uploader.value = percentage },
176
- function error(error: object) { error },
177
- function complete() { }
178
- )
179
- this._imagePath = file.name;
180
- console.log(this._imagePath);
181
- }
182
-
183
- /*
184
- // Handle email address change revocations
185
- _handleRecoverEmail(auth, actionCode, lang) {
186
- // Localize the UI to the selected language as determined by the lang parameter.
187
- const restoredEmail = null;
188
- // Confirm the action code is valid.
189
- auth.checkActionCode(actionCode)
190
- // Get the restored email address.
191
- .then( (info) => { restoredEmail = info['data']['email'];
192
- // Revert to the old email.
193
- return auth.applyActionCode(actionCode);
194
- }).then( () => {
195
- // Account email reverted to restoredEmail
196
- // TODO: Display a confirmation message to the user.
197
- // You might also want to give the user the option to reset their password
198
- auth.sendPasswordResetEmail(restoredEmail).then( () => {
199
- // Password reset confirmation sent. Ask user to check their email.
200
- }).catch( (error) => {
201
- // Error encountered while sending password reset code.
202
- });
203
- }).catch( (error) => {
204
- // Invalid code.
205
- });
206
- }
207
-
208
- _handleResetPassword(auth, actionCode, continueUrl, lang) {
209
- // Localize the UI to the selected language as determined by the lang parameter.
210
- // const accountEmail;
211
- // Verify the password reset code is valid.
212
- auth.verifyPasswordResetCode(actionCode).then( (email) => {
213
- const accountEmail = email;
214
- // TODO: Show the reset screen with the user's email and ask the user for the new password.
215
- // Save the new password.
216
- auth.confirmPasswordReset(actionCode, newPassword).then( (resp) => {
217
- // Password reset has been confirmed and new password updated.
218
-
219
- // TODO: Display a link back to the app, or sign-in the user directly
220
- // if the page belongs to the same domain as the app:
221
- // auth.signInWithEmailAndPassword(accountEmail, newPassword);
222
-
223
- // TODO: If a continue URL is available,
224
- // display a button which on click redirects the user back to the app
225
- // via continueUrl with additional state determined from that URL's parameters.
226
- }).catch( (error) => {
227
- // Error occurred during confirmation. The code might have expired or the password is too weak.
228
- });
229
- }).catch( (error) => {
230
- // Invalid or expired action code. Ask user to try to reset the password again.
231
- });
232
- }
233
- */
234
- static get styles() {
235
- return [
236
- Settings,
237
- userStyles,
238
- css`
239
-
240
- button:focus { outline: none; }
241
-
242
- #uploader {
243
- position: absolute;
244
- right: 0;
245
- width: 28px;
246
- height: 28px;
247
- border: 2px solid #303030;
248
- border-radius: 50%;
249
- transform: rotateZ(90deg);
250
- overflow: hidden;
251
- box-shadow: 1px 1px 2px black, 0 0 25px grey, 0 0 5px #fff;
252
- }
253
-
254
- .profile {
255
- width: 200px;
256
- margin: auto;
257
- }
258
-
259
- .userImage {
260
- border-radius: 50%;
261
- overflow: hidden;
262
- margin: auto;
263
- border: 2px solid #303030;
264
- box-shadow: 1px 1px 2px black, 0 0 25px grey, 0 0 5px #fff;
265
- }
266
-
267
- .file-container {
268
-
269
- }
270
-
271
- .trigger {
272
- position: relative;
273
- width: 200px;
274
- display: block;
275
- text-shadow: 1px 1px 12px black, 0 0 35px grey, 0 0 15px #fff;
276
- font-size: 1em;
277
- transition: all .4s;
278
- cursor: pointer;
279
- text-align: center;
280
- }
281
-
282
- #fileupload {
283
-
284
-
285
- width: 200px;
286
- height: 100%;
287
- /* background: #39D2B4; */
288
- position: absolute;
289
- top: 0; left: 0;
290
- opacity: 0;
291
-
292
- cursor: pointer;
293
- }
294
-
295
- .max {
296
- max-width: 600px;
297
- margin: auto;
298
- }
299
-
300
- .welcome {
301
- text-align: center;
302
- text-shadow: 1px 1px 2px black, 0 0 15px grey, 0 0 5px #fff;
303
- }
304
-
305
- @media (max-width: 460px) {
306
- #profile, #email { text-align: left; }
307
- #account, #password { text-align: right; }
308
- }
309
- /*
310
- @media (min-width: 640px) {
311
- :host{ display: grid; grid-template-columns: 50% 50%; }
312
- }
313
- */
314
- `
315
- ];
316
- }
317
-
318
- protected render() {
319
- return html`
320
- <!-- Page Menu -->
321
- <div>
322
- <ul class="setMenu">
323
- <li><button id="profile" value="profile" class="topButton" ?on="${ this.profileTopic === 'profile'}" ><p>Profile</p> </button></li>
324
- <li><button id="email" value="email" class="topButton" ?on="${ this.profileTopic === 'email'}" ><p>Email</p> </button></li>
325
- <li><button id="password" value="password" class="topButton" ?on="${ this.profileTopic === 'password'}" ><p>Password</p> </button></li>
326
- <li><button id="account" value="delete" class="topButton" ?on="${ this.profileTopic === 'delete'}" ><p>Delete</p> </button></li>
327
- </ul>
328
- </div>
329
-
330
- <!-- Page Body -->
331
- <div class="spec" ?on="${ this.profileTopic === 'profile' }">
332
- <div class="profile">
333
-
334
- <h2 class="welcome">${this._person}</h2>
335
-
336
- <label for="fileupload" class="trigger">
337
- <input type="file" name="fileupload" id="fileupload" accept="image/*">
338
- ${this._user
339
- ? html`
340
- <progress value="0" max="100" id="uploader"></progress>
341
- <input
342
- type="image"
343
- class="userImage"
344
- id="image"
345
- alt="user"
346
- height="171px"
347
- width="171px"
348
- src="${this._photoURL}">
349
- `
350
- : html`${faceIcon}` }
351
- upload a photo
352
- </label>
353
-
354
- </div>
355
- <form id="settings">
356
- <ul>
357
- <li><p><label><h3 class="pageTitle">Username</h3><input id="contractor" type="text" ></label></p></li>
358
- <li><p><label><h3 class="pageTitle">Telephone: ${this._phone}</h3><input id="phoneNumber" type="text" ></label></p></li>
359
- </ul>
360
- </form>
361
-
362
- <ul class="max">
363
- <li><p><label><input type="checkbox" id="list" placeholder="true">Public Profile</label></p></li>
364
- <li><button id="save" class="action-button" >save</button></li>
365
- </ul>
366
-
367
- </div>
368
-
369
- <form class="spec" ?on="${ this.profileTopic === 'email' }" id="emailForm">
370
- <ul>
371
- <li><h3 class="pageTitle">Change Email ${this._userMail}</h3></li>
372
- <li><p><label>Email<input type="email" id="email"></label></p></li>
373
- <li><p><label>Verify Email<input type="email" id="emailVerify"></label></p></li>
374
- <li><p><button id="update" class="action-button" >update</button></p></li>
375
- <li><div class="verified"></div></li>
376
- </ul>
377
- </form>
378
-
379
- <form class="spec" ?on="${ this.profileTopic === 'password' }" id="passwordForm">
380
- <ul>
381
- <li><h3 class="pageTitle">Update Password</h3></li>
382
- <li><p><label>New Password <input type="Password" id="newPass"></label></p></li>
383
- <li><p><label>Verify Password <input type="Password" id="passVerify"></label></p></li>
384
- <li><p><button id="pass" class="action-button">create</button></p></li>
385
- </ul>
386
- </form>
387
-
388
- <form class="spec" ?on="${ this.profileTopic === 'delete' }" id="deleteForm">
389
- <ul>
390
- <li><h3 class="pageTitle">Delete Account</h3></li>
391
- <li><p>Permanently delete the user account and data related to:</p></li>
392
- <!-- <li><p>\${this.userMail}</p></li> -->
393
- <li><p><button id="deleteUser" class="action-button">Delete</button></p></li>
394
- </ul>
395
- </form>
396
- </form>
397
-
398
- `
399
- }
400
- }
401
-
402
-
package/tsconfig.json DELETED
@@ -1,19 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "target": "es2017",
4
- "module": "esnext",
5
- "moduleResolution": "node",
6
- "lib": ["es2017", "dom"],
7
- "strict": true,
8
- "noUnusedLocals": true,
9
- "noUnusedParameters": true,
10
- "noImplicitReturns": true,
11
- "noFallthroughCasesInSwitch": true,
12
- "experimentalDecorators": true,
13
- "outDir": "deploy"
14
- },
15
- "include": [
16
- "src/**/*.ts"
17
- ],
18
- "exclude": [],
19
- }
package/webpack.config.js DELETED
@@ -1,72 +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
-
11
- const CopyWebpackPlugin = require('copy-webpack-plugin');
12
- const HtmlWebpackPlugin = require('html-webpack-plugin');
13
- const WorkboxWebpackPlugin = require('workbox-webpack-plugin');
14
-
15
- module.exports = {
16
- devServer: {
17
- historyApiFallback: true
18
- },
19
- mode: 'production',
20
- module: {
21
- rules: [
22
- {
23
- test: /\.(ts|js)x?$/,
24
- use: {
25
- loader: 'babel-loader',
26
- options: {
27
- presets: [
28
- ['@babel/preset-env', {targets: {ie: '11'}}]
29
- ],
30
- plugins: ['@babel/plugin-syntax-dynamic-import']
31
- }
32
- }
33
- },
34
- {
35
- test: /\.tsx?$/,
36
- use: 'ts-loader'
37
- }
38
- ]
39
- },
40
- resolve: {
41
- extensions: ['.js', '.ts']
42
- },
43
- plugins: [
44
- new CopyWebpackPlugin([
45
- 'images/**',
46
- 'node_modules/@webcomponents/webcomponentsjs/**',
47
- 'manifest.json'
48
- ]),
49
- new HtmlWebpackPlugin({
50
- chunksSortMode: 'none',
51
- template: 'index.html'
52
- }),
53
- new WorkboxWebpackPlugin.GenerateSW({
54
- include: ['index.html', 'manifest.json', /\.js$/],
55
- exclude: [/\/@webcomponents\/webcomponentsjs\//],
56
- navigateFallback: 'index.html',
57
- swDest: 'service-worker.js',
58
- clientsClaim: true,
59
- skipWaiting: true,
60
- runtimeCaching: [
61
- {
62
- urlPattern: /\/@webcomponents\/webcomponentsjs\//,
63
- handler: 'staleWhileRevalidate'
64
- },
65
- {
66
- urlPattern: /^https:\/\/fonts.gstatic.com\//,
67
- handler: 'staleWhileRevalidate'
68
- }
69
- ]
70
- })
71
- ]
72
- };