qcobjectsnewapp 2.4.11 → 2.4.13

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 (49) hide show
  1. package/.dockerignore +98 -1
  2. package/.eslintignore +2 -1
  3. package/.eslintrc.cjs +3 -19
  4. package/.gitlab-ci.yml +6 -7
  5. package/.gitpod.yml +21 -0
  6. package/.prettierignore +2 -1
  7. package/Dockerfile +5 -5
  8. package/README.md +38 -35
  9. package/VERSION +1 -1
  10. package/_redirects +3 -1
  11. package/config.json +1 -0
  12. package/package.json +44 -17
  13. package/src/css/desktop/components/deploy-grid.css +4 -0
  14. package/src/css/index.css +1 -1
  15. package/src/css/mobile/components/deploy-grid.css +5 -0
  16. package/src/css/modern-base.css +1 -1
  17. package/src/index-fallback.html +47 -0
  18. package/src/js/config.d.ts +1 -0
  19. package/src/js/config.ts +2 -5
  20. package/src/js/customWidgets.d.ts +1 -0
  21. package/src/js/customWidgets.ts +4 -0
  22. package/src/js/init.d.ts +27 -0
  23. package/src/js/init.ts +1 -0
  24. package/src/js/packages/com.qcobjects.installer.d.ts +1 -0
  25. package/src/js/packages/com.qcobjects.installer.ts +12 -13
  26. package/src/js/packages/com.qcobjects.services.github.d.ts +1 -0
  27. package/src/js/packages/com.qcobjects.services.github.ts +30 -40
  28. package/src/js/packages/org.quickcorp.custom.components.d.ts +1 -0
  29. package/src/js/packages/org.quickcorp.custom.components.ts +14 -13
  30. package/src/js/packages/org.quickcorp.custom.controllers.d.ts +1 -0
  31. package/src/js/packages/org.quickcorp.custom.controllers.ts +18 -18
  32. package/src/js/packages/org.quickcorp.custom.d.ts +7 -0
  33. package/src/js/packages/org.quickcorp.custom.effects.d.ts +1 -0
  34. package/src/js/packages/org.quickcorp.custom.effects.ts +0 -1
  35. package/src/js/packages/org.quickcorp.custom.models.d.ts +1 -0
  36. package/src/js/packages/org.quickcorp.custom.views.d.ts +1 -0
  37. package/src/js/packages/org.quickcorp.custom.views.ts +2 -4
  38. package/src/manifest.json +19 -5
  39. package/src/pwabuilder-sw.js +55 -0
  40. package/src/sw.js +2 -0
  41. package/src/templates/components/gitpod-button.tpl.html +38 -0
  42. package/src/templates/components/header.tpl.html +17 -10
  43. package/src/templates/components/netlify-button.tpl.html +4 -0
  44. package/tsconfig.d.json +5 -0
  45. package/tsconfig.json +2 -15
  46. package/src/js/types/global.d.ts +0 -26
  47. package/src/js/types/init.d.ts +0 -0
  48. /package/src/css/{components/github-grid-landscape.css → desktop/components/github-grid.css} +0 -0
  49. /package/src/css/{components/github-grid-portrait.css → mobile/components/github-grid.css} +0 -0
@@ -4,7 +4,7 @@ import global, { InheritClass, Package, logger } from "qcobjects";
4
4
  import { NotificationComponent } from "qcobjects-sdk";
5
5
 
6
6
  Package("com.qcobjects.installer", [
7
- class Installer extends InheritClass{
7
+ class Installer extends InheritClass {
8
8
  root: Element;
9
9
  promptEvent!: HTMLElement;
10
10
 
@@ -15,15 +15,15 @@ Package("com.qcobjects.installer", [
15
15
  * @constructor
16
16
  * @param {HTMLElement} root
17
17
  */
18
- constructor(root:HTMLElement) {
18
+ constructor (root: HTMLElement) {
19
19
  super();
20
20
 
21
21
  this.root = root;
22
- window.addEventListener("beforeinstallprompt", ()=>this.beforeinstallprompt.bind(this), false);
23
- window.addEventListener("appinstalled", ()=>this.installed.bind(this), false);
22
+ window.addEventListener("beforeinstallprompt", () => this.beforeinstallprompt.bind(this), false);
23
+ window.addEventListener("appinstalled", () => this.installed.bind(this), false);
24
24
 
25
- root.addEventListener("click", ()=>this.install.bind(this));
26
- root.addEventListener("touchend", ()=>this.install.bind(this));
25
+ root.addEventListener("click", () => this.install.bind(this));
26
+ root.addEventListener("touchend", () => this.install.bind(this));
27
27
 
28
28
  window.matchMedia("(display-mode: standalone)").addEventListener("change", (evt) => {
29
29
  let displayMode = "browser";
@@ -42,7 +42,7 @@ Package("com.qcobjects.installer", [
42
42
  * @param {Event} e
43
43
  * @returns {boolean}
44
44
  */
45
- beforeinstallprompt(e:Event) {
45
+ beforeinstallprompt (e: Event) {
46
46
  logger.debug("registering installer event");
47
47
  e.preventDefault();
48
48
  global.set("promptEvent", e);
@@ -54,7 +54,7 @@ Package("com.qcobjects.installer", [
54
54
  * it works after the install event
55
55
  * @date 18/04/2023 - 22:28:36
56
56
  */
57
- installed() {
57
+ installed () {
58
58
  logger.debug("app is already installed");
59
59
  global.set("promptEvent", null);
60
60
  // This fires after onbeforinstallprompt OR after manual add to homescreen.
@@ -65,7 +65,7 @@ Package("com.qcobjects.installer", [
65
65
  * it executes the install after the button click
66
66
  * @date 18/04/2023 - 22:29:11
67
67
  */
68
- install() {
68
+ install () {
69
69
  const root = this.root;
70
70
  logger.debug("installer actioned");
71
71
  let promptEvent = global.get("promptEvent", null);
@@ -74,7 +74,7 @@ Package("com.qcobjects.installer", [
74
74
 
75
75
  promptEvent.prompt();
76
76
  promptEvent.userChoice
77
- .then(function (choiceResult: { outcome: string; }) {
77
+ .then(function (choiceResult: { outcome: string }) {
78
78
  if (choiceResult.outcome === "accepted") {
79
79
  // The user actioned the prompt (good or bad).
80
80
  // good is handled in
@@ -84,16 +84,15 @@ Package("com.qcobjects.installer", [
84
84
  }
85
85
  promptEvent = null;
86
86
  })
87
- .catch(function (installError: { toString: () => any; }) {
87
+ .catch(function (installError: { toString: () => string }) {
88
88
  // Boo. update the UI.
89
89
  promptEvent = null;
90
90
  root.classList.remove("available");
91
91
  logger.warn(`Error during install: ${installError.toString()}`);
92
92
  });
93
93
  } else {
94
- logger.debug("not asking for install");
94
+ logger.debug("It is not possible to get the prompt event for install ");
95
95
  }
96
96
  }
97
97
  }
98
98
  ]);
99
-
@@ -0,0 +1 @@
1
+ export {};
@@ -1,10 +1,9 @@
1
1
  /* eslint-disable prefer-rest-params */
2
2
  "use strict";
3
- import { Package, JSONService, Service, logger, Class } from "qcobjects";
3
+ import { Package, JSONService, Service, logger } from "qcobjects";
4
4
 
5
5
  Package("com.qcobjects.services.github", [
6
6
  class GitHubService extends JSONService {
7
-
8
7
  /**
9
8
  * Name of the service
10
9
  * @date 18/04/2023 - 22:30:07
@@ -13,7 +12,6 @@ Package("com.qcobjects.services.github", [
13
12
  */
14
13
  name = "myservice";
15
14
 
16
-
17
15
  /**
18
16
  * It specifies if the service has a external url. If true, you can pass absolute urls in url property
19
17
  * @date 18/04/2023 - 22:30:37
@@ -22,7 +20,6 @@ Package("com.qcobjects.services.github", [
22
20
  */
23
21
  external = true;
24
22
 
25
-
26
23
  /**
27
24
  * If it is true, the service call will be cached
28
25
  * @date 18/04/2023 - 22:31:41
@@ -31,7 +28,6 @@ Package("com.qcobjects.services.github", [
31
28
  */
32
29
  cached = false;
33
30
 
34
-
35
31
  /**
36
32
  * It can be GET, POST, PUT
37
33
  * @date 18/04/2023 - 22:32:29
@@ -40,7 +36,6 @@ Package("com.qcobjects.services.github", [
40
36
  */
41
37
  method = "GET";
42
38
 
43
-
44
39
  /**
45
40
  * You can add special headers using this property
46
41
  * @date 18/04/2023 - 22:33:20
@@ -49,7 +44,6 @@ Package("com.qcobjects.services.github", [
49
44
  */
50
45
  headers = { "Content-Type": "application/json" };
51
46
 
52
-
53
47
  /**
54
48
  * URL for the service call
55
49
  * @date 18/04/2023 - 22:34:09
@@ -58,7 +52,6 @@ Package("com.qcobjects.services.github", [
58
52
  */
59
53
  url = "https://api.github.com/orgs/QuickCorp/repos";
60
54
 
61
-
62
55
  /**
63
56
  * This is used internally for XHR requests. Default value is false.
64
57
  * @date 18/04/2023 - 22:34:29
@@ -67,15 +60,14 @@ Package("com.qcobjects.services.github", [
67
60
  */
68
61
  withCredentials = false;
69
62
 
70
-
71
63
  /**
72
64
  * It is called once the service call is done
73
65
  * @param param0 this param has two properties, one is the native request call (XHR or Fetch object). The second property is the service object.
74
66
  * @returns Promise
75
67
  */
76
- done({ request, service }: { request: XMLHttpRequest, service: Service }) {
68
+ done ({ request, service }: { request: XMLHttpRequest, service: Service }) {
77
69
  logger.debug(request);
78
- const result = JSON.parse(service.template).reverse().map(function (project: { id: string; description: string; name: string; html_url: string; }) {
70
+ const result = JSON.parse(service.template).reverse().map(function (project: { id: string, description: string, name: string, html_url: string }) {
79
71
  return {
80
72
  id: project.id,
81
73
  description: project.description,
@@ -101,9 +93,9 @@ Package("com.qcobjects.services.github", [
101
93
  url = "https://api.github.com/search/repositories?q=qcobjects";
102
94
  withCredentials = false;
103
95
 
104
- done({ request, service }: { request: XMLHttpRequest, service: Service }) {
96
+ done ({ request, service }: { request: XMLHttpRequest, service: Service }) {
105
97
  logger.debug(request);
106
- const result = JSON.parse(service.template).items.map(function (project: { id: string; description: string; name: string; html_url: string; }) {
98
+ const result = JSON.parse(service.template).items.map(function (project: { id: string, description: string, name: string, html_url: string }) {
107
99
  return {
108
100
  id: project.id,
109
101
  description: project.description,
@@ -120,37 +112,34 @@ Package("com.qcobjects.services.github", [
120
112
  }
121
113
  },
122
114
 
123
- Class("QCObjectsVersionService", Service, {
124
- name: "qcobjects_version_service",
125
- external: true,
126
- cached: false,
127
- method: "GET",
128
- headers: { "Content-Type": "application/json" },
129
- url: "https://api.github.com/repos/QuickCorp/QCObjects/tags",
130
- withCredentials: false,
131
- _new_: () => {
132
- // service instantiated
133
- },
134
- done: ({ service }: { service: Service }) => {
115
+ class QCObjectsVersionService extends Service {
116
+ name= "qcobjects_version_service";
117
+ external= true;
118
+ cached= false;
119
+ method= "GET";
120
+ headers= { "Content-Type": "application/json" };
121
+ url= "https://api.github.com/repos/QuickCorp/QCObjects/tags";
122
+ withCredentials= false;
123
+
124
+ done ({ service }: { service: Service }) {
135
125
  const latest = JSON.parse(service.template)[0];
136
126
  service.template = {
137
127
  version: latest.name
138
128
  };
139
129
  }
140
- }),
141
-
142
- Class("QCObjectsStarsForksService", Service, {
143
- name: "qcobjects_stars_forks_service",
144
- external: true,
145
- cached: false,
146
- method: "GET",
147
- headers: { "Content-Type": "application/json" },
148
- url: "https://api.github.com/repos/QuickCorp/QCObjects",
149
- withCredentials: false,
150
- _new_: () => {
151
- // service instantiated
152
- },
153
- done: ({ service }: { service: Service }) => {
130
+
131
+ },
132
+
133
+ class QCObjectsStarsForksService extends Service {
134
+ name= "qcobjects_stars_forks_service";
135
+ external= true;
136
+ cached= false;
137
+ method= "GET";
138
+ headers= { "Content-Type": "application/json" };
139
+ url= "https://api.github.com/repos/QuickCorp/QCObjects";
140
+ withCredentials= false;
141
+
142
+ done ({ service }: { service: Service }) {
154
143
  const repo = JSON.parse(service.template);
155
144
  service.template = {
156
145
  forks: repo.forks_count,
@@ -159,6 +148,7 @@ Package("com.qcobjects.services.github", [
159
148
  size: Math.round(repo.size / 1000)
160
149
  };
161
150
  }
162
- })
151
+
152
+ }
163
153
 
164
154
  ]);
@@ -2,15 +2,14 @@
2
2
 
3
3
  import { Package, Component } from "qcobjects";
4
4
 
5
-
6
5
  Package("org.quickcorp.custom.components", [
7
6
  class GitHubGrid extends Component {
8
7
  name = "github-grid";
9
8
  tplsource = "inline";
10
9
  template = `
11
10
  <style>
12
- $layout(landscape,css/components/github-grid-landscape.css)
13
- $layout(portrait,css/components/github-grid-portrait.css)
11
+ $layout(landscape,css/desktop/components/github-grid.css)
12
+ $layout(portrait,css/mobile/components/github-grid.css)
14
13
 
15
14
  :host {
16
15
  margin:0 auto;
@@ -22,16 +21,18 @@ Package("org.quickcorp.custom.components", [
22
21
  `;
23
22
  },
24
23
 
25
- class Component1 extends Component {
26
- name = "main";
27
- cached = false;
28
- controller = null;
29
- view = null;
30
- },
31
-
32
- class Component2 extends Component {
33
- name = "component-two";
34
- propertyName2 = "propertyValue2";
24
+ class DeployGrid extends Component {
25
+ name = "deploygrid";
26
+ template = `
27
+ <style>
28
+ $layout(landscape,css/desktop/components/deploy-grid.css)
29
+ $layout(portrait,css/mobile/components/deploy-grid.css)
30
+ </style>
31
+ <div class="deploy-grid">
32
+ <netlify-button></netlify-button>
33
+ <gitpod-button></gitpod-button>
34
+ </div>
35
+ `;
35
36
  }
36
37
 
37
38
  ]);
@@ -3,17 +3,17 @@
3
3
  /* eslint-disable no-unused-vars */
4
4
  "use strict";
5
5
 
6
- import global, { Package, Controller, logger, _DOMCreateElement, Effect, New, ClassFactory, QCObjectsElement, QCObjectsShadowedElement, Component } from "qcobjects";
6
+ import global, { Package, Controller, logger, _DOMCreateElement, type Effect, New, ClassFactory, type QCObjectsElement, type QCObjectsShadowedElement, type Component } from "qcobjects";
7
7
 
8
8
  Package("org.quickcorp.custom.controllers", [
9
9
  class MainController extends Controller {
10
10
  static loaded: boolean;
11
- constructor ({component}:{component:Component}) {
11
+ constructor ({ component }: { component: Component }) {
12
12
  logger.debug("Initializing MainController...");
13
- super({component});
13
+ super({ component });
14
14
  }
15
15
 
16
- done (...args:Array<never>) {
16
+ done (...args: never[]) {
17
17
  const _ret_ = super.done(args);
18
18
  if (!MainController.loaded) {
19
19
  const s = _DOMCreateElement("style");
@@ -29,31 +29,31 @@ Package("org.quickcorp.custom.controllers", [
29
29
  class SideNavController extends Controller {
30
30
  effect!: Effect;
31
31
  visibility!: boolean;
32
- constructor ({component}:{component:Component}) {
32
+ constructor ({ component }: { component: Component }) {
33
33
  logger.debug("Initializing SideNavController...");
34
- super({component});
34
+ super({ component });
35
35
  (global as any).sideNavController = this;
36
36
  }
37
37
 
38
- done (...args:Array<any>){
38
+ done (...args: any[]) {
39
39
  super.done(args);
40
- this.effect = New(ClassFactory("Fade"),{
40
+ this.effect = New(ClassFactory("Fade"), {
41
41
  duration: 300
42
42
  });
43
43
  this.close();
44
44
  }
45
45
 
46
46
  open () {
47
- const componentRoot = (this.component.shadowed) ? (this.component.shadowRoot) : (this.component.body);
47
+ const componentRoot = (this.component.shadowed != null) ? (this.component.shadowRoot) : (this.component.body);
48
48
  if (this.effect != null) {
49
49
  this.effect.apply(componentRoot, 0, 1);
50
50
  }
51
- if (componentRoot !== undefined){
51
+ if (componentRoot !== undefined) {
52
52
  componentRoot.style.width = "100%";
53
53
  componentRoot.style.overflowX = "visible";
54
54
  if (Object.hasOwnProperty.call(componentRoot, "parentElement") && typeof componentRoot.parentElement !== "undefined") {
55
55
  const parentElement = componentRoot.parentElement as QCObjectsElement;
56
- if (parentElement !== null){
56
+ if (parentElement !== null) {
57
57
  parentElement.subelements(".navbtn")[0].style.display = "none";
58
58
  parentElement.subelements(".closebtn")[0].style.display = "block";
59
59
  }
@@ -64,18 +64,18 @@ Package("org.quickcorp.custom.controllers", [
64
64
  }
65
65
 
66
66
  close () {
67
- const componentRoot = (this.component.shadowed) ? (this.component.shadowRoot) : (this.component.body);
67
+ const componentRoot = (this.component.shadowed != null) ? (this.component.shadowRoot) : (this.component.body);
68
68
  if (this.effect != null) {
69
69
  this.effect.apply(componentRoot, 1, 0);
70
70
  }
71
- if (componentRoot !== undefined){
71
+ if (componentRoot !== undefined) {
72
72
  componentRoot.style.width = "0px";
73
73
  componentRoot.style.overflowX = "hidden";
74
74
  if (Object.hasOwnProperty.call(componentRoot, "parentElement") && typeof componentRoot.parentElement !== "undefined") {
75
75
  const parentElement = componentRoot.parentElement as QCObjectsElement;
76
76
  parentElement.subelements(".navbtn")[0].style.display = "block";
77
77
  parentElement.subelements(".closebtn")[0].style.display = "none";
78
- }
78
+ }
79
79
  }
80
80
  this.visibility = false;
81
81
  return this.visibility;
@@ -91,19 +91,19 @@ Package("org.quickcorp.custom.controllers", [
91
91
  },
92
92
 
93
93
  class HeaderController extends Controller {
94
- installer:any;
94
+ installer: any;
95
95
 
96
96
  loadInstallerButton () {
97
- const componentRoot = (this.component.shadowed) ? (this.component.shadowRoot as QCObjectsShadowedElement) : (this.component.body as QCObjectsElement);
97
+ const componentRoot = (this.component.shadowed != null) ? (this.component.shadowRoot as QCObjectsShadowedElement) : (this.component.body as QCObjectsElement);
98
98
  componentRoot.subelements("#installerbutton").map(
99
- (element)=>{
99
+ (element) => {
100
100
  this.installer = New(ClassFactory("Installer"), element);
101
101
  return element;
102
102
  }
103
103
  );
104
104
  }
105
105
 
106
- done (...args:Array<never>) {
106
+ done (...args: never[]) {
107
107
  const _ret_ = super.done(args);
108
108
  this.loadInstallerButton();
109
109
  return _ret_;
@@ -0,0 +1,7 @@
1
+ import "./com.qcobjects.installer";
2
+ import "./org.quickcorp.custom.effects";
3
+ import "./org.quickcorp.custom.models";
4
+ import "./org.quickcorp.custom.components";
5
+ import "./org.quickcorp.custom.controllers";
6
+ import "./org.quickcorp.custom.views";
7
+ import "./com.qcobjects.services.github";
@@ -0,0 +1 @@
1
+ export {};
@@ -2,7 +2,6 @@
2
2
 
3
3
  import { Package, TransitionEffect } from "qcobjects";
4
4
 
5
-
6
5
  Package("org.quickcorp.custom.effects", [
7
6
 
8
7
  class MainTransitionEffect extends TransitionEffect {
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -5,11 +5,10 @@ import { Package, View } from "qcobjects";
5
5
  Package("org.quickcorp.custom.views", [
6
6
 
7
7
  class CardView extends View {
8
-
9
- done (...args:Array<never>) {
8
+ done (...args: never[]) {
10
9
  const _ret_ = super.done(args);
11
10
  const component = this.component;
12
- if (component !== undefined && component.body !== undefined){
11
+ if (component !== undefined && component.body !== undefined) {
13
12
  component.body.style.display = "block";
14
13
  component.body.style.width = "100px";
15
14
  component.body.style.height = "100px";
@@ -18,4 +17,3 @@ Package("org.quickcorp.custom.views", [
18
17
  }
19
18
  }
20
19
  ]);
21
-
package/src/manifest.json CHANGED
@@ -9,9 +9,11 @@
9
9
  "short_name": "qcobjectsnewapp",
10
10
  "start_url": "/",
11
11
  "theme_color": "#000000",
12
- "shortcuts": [],
12
+ "shortcuts": [],
13
13
  "lang": "en-US",
14
- "categories": ["utilities"],
14
+ "categories": [
15
+ "utilities"
16
+ ],
15
17
  "icons": [
16
18
  {
17
19
  "src": "./favicon.ico",
@@ -57,9 +59,16 @@
57
59
  "src": "img/icons/icon-512x512.png",
58
60
  "sizes": "512x512",
59
61
  "type": "image/png"
62
+ },
63
+ {
64
+ "src": "img/icons/icon-512x512.png",
65
+ "sizes": "any",
66
+ "purpose":"any maskable",
67
+ "type": "image/png"
60
68
  }
69
+
61
70
  ],
62
- "screenshots" : [
71
+ "screenshots": [
63
72
  {
64
73
  "src": "img/screenshots/screenshot1.webp",
65
74
  "sizes": "1280x720",
@@ -73,7 +82,8 @@
73
82
  ],
74
83
  "splash_pages": null,
75
84
  "prefer_related_applications": false,
76
- "related_applications": [{
85
+ "related_applications": [
86
+ {
77
87
  "platform": "play",
78
88
  "url": "https://play.google.com/store/apps/details?id=com.example.qcobjects_newapp",
79
89
  "id": "com.example.qcobjects_newapp"
@@ -82,5 +92,9 @@
82
92
  "platform": "itunes",
83
93
  "url": "https://itunes.apple.com/app/qcobjects_newapp/id123456789"
84
94
  }
95
+ ],
96
+ "display_override": [
97
+ "standalone",
98
+ "minimal-ui"
85
99
  ]
86
- }
100
+ }
@@ -0,0 +1,55 @@
1
+ /* eslint-disable no-undef */
2
+ // This is the service worker with the combined offline experience (Offline page + Offline copy of pages)
3
+
4
+ const CACHE = "qcobjectsnewapp-offline-page";
5
+
6
+ importScripts("https://storage.googleapis.com/workbox-cdn/releases/5.1.2/workbox-sw.js");
7
+
8
+ const offlineFallbackPage = "index-fallback.html";
9
+
10
+ self.addEventListener("message", (event) => {
11
+ if (event.data && event.data.type === "SKIP_WAITING") {
12
+ self.skipWaiting();
13
+ }
14
+ });
15
+
16
+ self.addEventListener("install", async (event) => {
17
+ event.waitUntil(
18
+ caches.open(CACHE)
19
+ .then((cache) => cache.add(offlineFallbackPage))
20
+ );
21
+ });
22
+
23
+ if (workbox.navigationPreload.isSupported()) {
24
+ workbox.navigationPreload.enable();
25
+ }
26
+
27
+ workbox.routing.registerRoute(
28
+ // eslint-disable-next-line prefer-regex-literals
29
+ new RegExp("/*"),
30
+ new workbox.strategies.StaleWhileRevalidate({
31
+ cacheName: CACHE
32
+ })
33
+ );
34
+
35
+ self.addEventListener("fetch", (event) => {
36
+ if (event.request.mode === "navigate") {
37
+ event.respondWith((async () => {
38
+ try {
39
+ const preloadResp = await event.preloadResponse;
40
+
41
+ if (preloadResp) {
42
+ return preloadResp;
43
+ }
44
+
45
+ const networkResp = await fetch(event.request);
46
+ return networkResp;
47
+ } catch (error) {
48
+
49
+ const cache = await caches.open(CACHE);
50
+ const cachedResp = await cache.match(offlineFallbackPage);
51
+ return cachedResp;
52
+ }
53
+ })());
54
+ }
55
+ });
package/src/sw.js CHANGED
@@ -23,6 +23,8 @@
23
23
  * license document, but changing it is not allowed.
24
24
  */
25
25
  "use strict";
26
+ // eslint-disable-next-line no-undef
27
+ importScripts("./pwabuilder-sw.js");
26
28
  const version = "1.2.93";
27
29
  const appName = "qcobjectsnewapp";
28
30
  const cacheSufix = (Math.round(Date.now() / (1000 * 3600))).toString(); // 1 hour
@@ -0,0 +1,38 @@
1
+ <style>
2
+ .gitpod-button {
3
+ background-color: #191712;
4
+ padding: 0.4em;
5
+ max-width: 192px;
6
+ max-height: 51px;
7
+ margin: 0 auto;
8
+ border: 1px solid #2d2828;
9
+ border-radius: 0.7em;
10
+ }
11
+ .text-white{
12
+ color: white;
13
+ }
14
+ </style>
15
+ <div class="gitpod-button">
16
+ <a href="https://gitpod.io#https://github.com/QuickCorp/qcobjects-new-app"
17
+ target="_blank"
18
+ class="text-white inline-flex stroked after:dark:hover:bg-light-black after:!filter-none py-3 px-4 items-center justify-center bg-bg dark:bg-card rounded-2xl text-important dark:text-white shadow-light dark:shadow-none font-semibold hover:bg-card focus:bg-card dark:hover:bg-light-black dark:focus:bg-light-black svelte-1bcz8bs"
19
+ rel="noopener noreferrer" data-analytics="{&quot;variant&quot;:&quot;open_in_gitpod&quot;}"><span>
20
+ <svg
21
+ viewBox="0 0 24 24" height="24" width="24" fill="none" xmlns="http://www.w3.org/2000/svg">
22
+ <g clip-path="url(#clip0-textless-renderedOn)">
23
+ <path fill-rule="evenodd" clip-rule="evenodd"
24
+ d="M14.07 1.195a2.364 2.364 0 01-.887 3.236l-7.11 4.04a.6.6 0 00-.304.52v6.343a.6.6 0 00.304.52l5.628 3.199a.605.605 0 00.598 0l5.628-3.198a.6.6 0 00.304-.521V11.39l-5.06 2.838a2.392 2.392 0 01-3.248-.9 2.364 2.364 0 01.905-3.23l7.239-4.062C20.272 4.8 23 6.383 23 8.901v6.914c0 1.62-.873 3.115-2.287 3.919l-6.461 3.671a4.56 4.56 0 01-4.504 0l-6.461-3.671A4.509 4.509 0 011 15.815V8.51c0-1.62.873-3.115 2.287-3.918l7.53-4.28a2.392 2.392 0 013.253.883z"
25
+ fill="url(#paint0_linear-textless=desktop)"></path>
26
+ </g>
27
+ <defs>
28
+ <linearGradient id="paint0_linear-textless=desktop" x1="17.558" y1="3.629" x2="6.356" y2="21.34"
29
+ gradientUnits="userSpaceOnUse">
30
+ <stop stop-color="#FFB45B"></stop>
31
+ <stop offset="1" stop-color="#FF8A00"></stop>
32
+ </linearGradient>
33
+ <clipPath id="clip0-textless-renderedOn">
34
+ <path fill="#fff" d="M0 0h24v24H0z"></path>
35
+ </clipPath>
36
+ </defs>
37
+ </svg></span> <span class="ml-3">Edit in Gitpod</span></a>
38
+ </div>
@@ -1,14 +1,21 @@
1
1
  <style>
2
- @import url("./css/components/button.css");
3
- :host{
4
- place-items: center;
5
- margin:-30px;
6
- }
2
+ @import url("./css/components/button.css");
3
+
4
+ :host {
5
+ place-items: center;
6
+ margin: -30px;
7
+ }
8
+ .header-logo {
9
+ min-height:300px;
10
+ margin-top: 30px;
11
+ }
12
+
7
13
 
8
14
  </style>
9
- <div >
10
- <div style="min-height:300px">
11
- <img alt="logo" src="img/logo-qcobjects-white.svg" width="320px"/>
15
+ <div>
16
+ <div class="header-logo">
17
+ <img alt="logo" src="img/logo-qcobjects-white.svg" width="320px" />
12
18
  </div>
13
- <button id="installerbutton">INSTALL</button>
14
- </div>
19
+ <deploy-grid componentClass="DeployGrid">
20
+ </deploy-grid>
21
+ </div>
@@ -0,0 +1,4 @@
1
+ <a style="margin:0 auto;"
2
+ href="https://app.netlify.com/start/deploy?repository=https://github.com/QuickCorp/qcobjects-new-app">
3
+ <img src="https://www.netlify.com/img/deploy/button.svg" title="Deploy to Netlify">
4
+ </a>
@@ -0,0 +1,5 @@
1
+ {
2
+ "extends": "qcobjects-tsconfig/tsconfig.d.json",
3
+ "include": ["src/**/*.ts"],
4
+ "exclude": ["src/**/*.spec.js", "src/*.js"]
5
+ }