fansunited-widgets-cdn 0.0.86-RC7 → 0.0.86-RC8
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/fu-widgets-loader.es.js +19 -20
- package/fu-widgets-loader.js +1 -1
- package/manifest.json +2 -6
- package/package.json +1 -1
package/fu-widgets-loader.es.js
CHANGED
|
@@ -1,28 +1,27 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
1
|
+
var w = Object.defineProperty;
|
|
2
|
+
var E = (o, t, e) => t in o ? w(o, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : o[t] = e;
|
|
3
|
+
var n = (o, t, e) => E(o, typeof t != "symbol" ? t + "" : t, e);
|
|
4
4
|
class d {
|
|
5
5
|
/**
|
|
6
6
|
* Load the FuWidget library
|
|
7
7
|
*/
|
|
8
8
|
static load(t = {}) {
|
|
9
|
-
const { onReady: e, onError: i, _cdnBase:
|
|
10
|
-
this.fetchManifest(
|
|
11
|
-
console.log(`📦 FuWidget v${
|
|
12
|
-
const
|
|
13
|
-
console.log(`🚀 Loading ${
|
|
14
|
-
src: `${
|
|
15
|
-
type:
|
|
16
|
-
integrity: g && n.integrity ? n.integrity[c] : void 0,
|
|
9
|
+
const { onReady: e, onError: i, _cdnBase: u } = t, r = u || this.CDN_BASE;
|
|
10
|
+
this.fetchManifest(r).then((s) => {
|
|
11
|
+
console.log(`📦 FuWidget v${s.version} (${s.buildDate})`);
|
|
12
|
+
const c = this.detectESMSupport(), a = this.PREFER_ESM && c, l = a ? "esm" : "iife", f = s.files[l];
|
|
13
|
+
console.log(`🚀 Loading ${l.toUpperCase()} build: ${f}`), this.loadScript({
|
|
14
|
+
src: `${r}/${f}`,
|
|
15
|
+
type: a ? "module" : void 0,
|
|
17
16
|
onLoad: () => {
|
|
18
|
-
console.log("✅ FuWidget loaded successfully"), e && window.FuWidget && e(window.FuWidget,
|
|
17
|
+
console.log("✅ FuWidget loaded successfully"), e && window.FuWidget && e(window.FuWidget, s);
|
|
19
18
|
},
|
|
20
|
-
onError: (
|
|
21
|
-
console.error("❌ Failed to load FuWidget from manifest"), i && i(
|
|
19
|
+
onError: (p) => {
|
|
20
|
+
console.error("❌ Failed to load FuWidget from manifest"), i && i(p);
|
|
22
21
|
}
|
|
23
22
|
});
|
|
24
|
-
}).catch((
|
|
25
|
-
console.warn("⚠️ Manifest fetch failed, using fallback version",
|
|
23
|
+
}).catch((s) => {
|
|
24
|
+
console.warn("⚠️ Manifest fetch failed, using fallback version", s), this.loadScript({
|
|
26
25
|
src: `https://cdn.jsdelivr.net/npm/fansunited-widgets-cdn@${this.FALLBACK_VERSION}/fu-widgets.iife.js`,
|
|
27
26
|
onLoad: () => {
|
|
28
27
|
console.log(`✅ FuWidget loaded (fallback v${this.FALLBACK_VERSION})`), e && window.FuWidget && e(window.FuWidget, {
|
|
@@ -32,8 +31,8 @@ class d {
|
|
|
32
31
|
files: { iife: "fu-widgets.iife.js", esm: "fu-widgets.es.js" }
|
|
33
32
|
});
|
|
34
33
|
},
|
|
35
|
-
onError: (
|
|
36
|
-
console.error("❌ Failed to load FuWidget (fallback)"), i && i(
|
|
34
|
+
onError: (c) => {
|
|
35
|
+
console.error("❌ Failed to load FuWidget (fallback)"), i && i(c);
|
|
37
36
|
}
|
|
38
37
|
});
|
|
39
38
|
});
|
|
@@ -60,11 +59,11 @@ class d {
|
|
|
60
59
|
*/
|
|
61
60
|
static loadScript(t) {
|
|
62
61
|
const e = document.createElement("script");
|
|
63
|
-
e.src = t.src, t.type && (e.type = t.type),
|
|
62
|
+
e.src = t.src, t.type && (e.type = t.type), e.onload = t.onLoad, e.onerror = () => t.onError(new Error(`Failed to load script: ${t.src}`)), document.head.appendChild(e);
|
|
64
63
|
}
|
|
65
64
|
}
|
|
66
65
|
// Internal configuration - not exposed to users
|
|
67
|
-
|
|
66
|
+
n(d, "CDN_BASE", "https://cdn.jsdelivr.net/npm/fansunited-widgets-cdn@latest"), n(d, "FALLBACK_VERSION", "0.0.85"), n(d, "PREFER_ESM", !0);
|
|
68
67
|
typeof window < "u" && (window.FuWidgetLoader = d);
|
|
69
68
|
export {
|
|
70
69
|
d as default
|
package/fu-widgets-loader.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var E=Object.defineProperty;var p=(i,o,t)=>o in i?E(i,o,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[o]=t;var d=(i,o,t)=>p(i,typeof o!="symbol"?o+"":o,t);var FuWidgetLoader=(function(){"use strict";class i{static load(t={}){const{onReady:e,onError:s,_cdnBase:f}=t,c=f||this.CDN_BASE;this.fetchManifest(c).then(n=>{console.log(`📦 FuWidget v${n.version} (${n.buildDate})`);const r=this.detectESMSupport(),a=this.PREFER_ESM&&r,l=a?"esm":"iife",u=n.files[l];console.log(`🚀 Loading ${l.toUpperCase()} build: ${u}`),this.loadScript({src:`${c}/${u}`,type:a?"module":void 0,onLoad:()=>{console.log("✅ FuWidget loaded successfully"),e&&window.FuWidget&&e(window.FuWidget,n)},onError:w=>{console.error("❌ Failed to load FuWidget from manifest"),s&&s(w)}})}).catch(n=>{console.warn("⚠️ Manifest fetch failed, using fallback version",n),this.loadScript({src:`https://cdn.jsdelivr.net/npm/fansunited-widgets-cdn@${this.FALLBACK_VERSION}/fu-widgets.iife.js`,onLoad:()=>{console.log(`✅ FuWidget loaded (fallback v${this.FALLBACK_VERSION})`),e&&window.FuWidget&&e(window.FuWidget,{name:"fansunited-widgets-cdn",version:this.FALLBACK_VERSION,buildDate:"unknown",files:{iife:"fu-widgets.iife.js",esm:"fu-widgets.es.js"}})},onError:r=>{console.error("❌ Failed to load FuWidget (fallback)"),s&&s(r)}})})}static fetchManifest(t){const e=`${t}/manifest.json?t=${Date.now()}`;return fetch(e).then(s=>{if(!s.ok)throw new Error(`Failed to fetch manifest: ${s.statusText}`);return s.json()})}static detectESMSupport(){return"noModule"in HTMLScriptElement.prototype}static loadScript(t){const e=document.createElement("script");e.src=t.src,t.type&&(e.type=t.type),e.onload=t.onLoad,e.onerror=()=>t.onError(new Error(`Failed to load script: ${t.src}`)),document.head.appendChild(e)}}return d(i,"CDN_BASE","https://cdn.jsdelivr.net/npm/fansunited-widgets-cdn@latest"),d(i,"FALLBACK_VERSION","0.0.85"),d(i,"PREFER_ESM",!0),typeof window<"u"&&(window.FuWidgetLoader=i),i})();
|
package/manifest.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fansunited-widgets-cdn",
|
|
3
|
-
"version": "0.0.86-
|
|
4
|
-
"buildDate": "2026-01-
|
|
3
|
+
"version": "0.0.86-RC8",
|
|
4
|
+
"buildDate": "2026-01-19T15:52:54.363Z",
|
|
5
5
|
"files": {
|
|
6
6
|
"iife": "fu-widgets.iife.js",
|
|
7
7
|
"esm": "fu-widgets.es.js"
|
|
@@ -60,9 +60,5 @@
|
|
|
60
60
|
"main-Bh6iw92_.js": "chunks/main-Bh6iw92_.js",
|
|
61
61
|
"resolveProps-Bgg0H6c2.js": "chunks/resolveProps-Bgg0H6c2.js",
|
|
62
62
|
"users-CXdzg3DM.js": "chunks/users-CXdzg3DM.js"
|
|
63
|
-
},
|
|
64
|
-
"integrity": {
|
|
65
|
-
"iife": "sha384-ogRPvH3AD0K6llhb0Zl1pTKxV+e3tREmhkWJ/BlJgZ2tMRBUvBKzjLFEQ941YUe4",
|
|
66
|
-
"esm": "sha384-COXlPo1YuIFpQxXe41WuuL3OPhun4WA7vM5aZB78/vd+tefz9uIBZNoOZSRFG28y"
|
|
67
63
|
}
|
|
68
64
|
}
|