@saasquatch/vanilla-components 1.2.4-20 → 1.2.4-23

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.
@@ -0,0 +1,34 @@
1
+ // NOTE(johan): This is a custom loader which will inject script tags for both the ES Modules and non-ES Modules
2
+ // builds. We use this instead of dist/widget-components.js as that is deprecated and actually doesn't work because of
3
+ // its name causing lazy loaded scripts to be loaded from the wrong path in /dist
4
+ (function (doc) {
5
+ var isSafari10 =
6
+ window.navigator.userAgent.indexOf("Safari") > 0 &&
7
+ window.navigator.userAgent.indexOf("Version/10") > 0;
8
+ var scriptElm = Array.from(doc.scripts).find((script) =>
9
+ script.src.includes("widget-components")
10
+ );
11
+
12
+ var parts = scriptElm.src.split("/");
13
+ parts.pop();
14
+ var url = parts.join("/");
15
+
16
+ // NOTE(johan): Safari 10 supports type="module" but the build is too new for it, so we only want the ES5 build but
17
+ // without the "nomodule" attribute
18
+ // This may not be necessary in Stencil 1.8.x - https://github.com/ionic-team/stencil/issues/1900
19
+ if (!isSafari10) {
20
+ var scriptElm = doc.createElement("script");
21
+ scriptElm.setAttribute("type", "module");
22
+ scriptElm.src = url + "/widget-components.esm.js";
23
+ scriptElm.setAttribute("data-stencil-namespace", "widget-components");
24
+ doc.head.appendChild(scriptElm);
25
+ }
26
+
27
+ var scriptElm = doc.createElement("script");
28
+ if (!isSafari10) {
29
+ scriptElm.setAttribute("nomodule", "");
30
+ }
31
+ scriptElm.src = url + "/widget-components.js";
32
+ scriptElm.setAttribute("data-stencil-namespace", "widget-components");
33
+ doc.head.appendChild(scriptElm);
34
+ })(document);
@@ -0,0 +1,34 @@
1
+ // NOTE(johan): This is a custom loader which will inject script tags for both the ES Modules and non-ES Modules
2
+ // builds. We use this instead of dist/widget-components.js as that is deprecated and actually doesn't work because of
3
+ // its name causing lazy loaded scripts to be loaded from the wrong path in /dist
4
+ (function (doc) {
5
+ var isSafari10 =
6
+ window.navigator.userAgent.indexOf("Safari") > 0 &&
7
+ window.navigator.userAgent.indexOf("Version/10") > 0;
8
+ var scriptElm = Array.from(doc.scripts).find((script) =>
9
+ script.src.includes("widget-components")
10
+ );
11
+
12
+ var parts = scriptElm.src.split("/");
13
+ parts.pop();
14
+ var url = parts.join("/");
15
+
16
+ // NOTE(johan): Safari 10 supports type="module" but the build is too new for it, so we only want the ES5 build but
17
+ // without the "nomodule" attribute
18
+ // This may not be necessary in Stencil 1.8.x - https://github.com/ionic-team/stencil/issues/1900
19
+ if (!isSafari10) {
20
+ var scriptElm = doc.createElement("script");
21
+ scriptElm.setAttribute("type", "module");
22
+ scriptElm.src = url + "/widget-components.esm.js";
23
+ scriptElm.setAttribute("data-stencil-namespace", "widget-components");
24
+ doc.head.appendChild(scriptElm);
25
+ }
26
+
27
+ var scriptElm = doc.createElement("script");
28
+ if (!isSafari10) {
29
+ scriptElm.setAttribute("nomodule", "");
30
+ }
31
+ scriptElm.src = url + "/widget-components.js";
32
+ scriptElm.setAttribute("data-stencil-namespace", "widget-components");
33
+ doc.head.appendChild(scriptElm);
34
+ })(document);
@@ -116,7 +116,7 @@ var StyleNode=function(){this.start=0,this.end=0,this.previous=null,this.parent=
116
116
 
117
117
  var resourcesUrl = scriptElm ? scriptElm.getAttribute('data-resources-url') || scriptElm.src : '';
118
118
  var start = function() {
119
- var url = new URL('./p-e82def83.system.js', new URL(resourcesUrl));
119
+ var url = new URL('./p-e82def83.system.js', new URL(resourcesUrl, window.location.origin));
120
120
  System.import(url.href);
121
121
  };
122
122
 
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@saasquatch/vanilla-components",
3
3
  "title": "Vanilla Components",
4
- "version": "1.2.4-20",
4
+ "version": "1.2.4-23",
5
5
  "description": "A minimal design library with components for referral and loyalty experiences.",
6
6
  "icon": "https://res.cloudinary.com/saasquatch/image/upload/v1652219900/squatch-assets/For_Vanilla.svg",
7
7
  "raisins": "docs/raisins.json",
8
8
  "main": "dist/index.js",
9
- "unpkg": "dist/widget-components/widget-components.js",
10
- "module": "dist/widget-components/widget-components.esm.js",
9
+ "unpkg": "dist/widget-components/entrypoint.js",
10
+ "module": "dist/widget-components/entrypoint.js",
11
11
  "es2015": "dist/esm/index.mjs",
12
12
  "es2017": "dist/esm/index.mjs",
13
13
  "types": "dist/types/components.d.ts",