@pontive/pontkit-loader 1.9.0 → 1.11.0
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/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p="1.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p="1.58.0",_=["/__pontive/auth/v1/runtime-config","/auth/v1/runtime-config"],g=1500,E=/^\d+\.\d+\.\d+$/;function w(t){return typeof t=="string"&&E.test(t)}function f(t){return typeof t=="string"&&/^https?:\/\//.test(t)}function u(t){return typeof t=="string"&&/^sha(256|384|512)-[A-Za-z0-9+/]+=*$/.test(t)}async function h(t={}){const e=t.fetchImpl??globalThis.fetch;if(typeof e!="function")return null;const i=t.urls??C(),s=t.timeoutMs??g;for(const o of i){const r=await S(e,o,s);if(r)return r}return null}function C(){return typeof window<"u"&&typeof window.__pontRuntimeConfigUrl=="string"?[window.__pontRuntimeConfigUrl]:_}async function S(t,e,i){const s=typeof AbortController=="function"?new AbortController:null,o=s?setTimeout(()=>s.abort(),i):null;try{const r=await t(e,{headers:{accept:"application/json"},signal:s?.signal});if(!r.ok)return null;const n=await r.json();if(!n||!w(n.core_elements_version))return null;const c={core_elements_version:n.core_elements_version,source:typeof n.source=="string"?n.source:void 0,catalog_revision:typeof n.catalog_revision=="number"?n.catalog_revision:void 0};return n.assets&&f(n.assets.js)&&f(n.assets.css)&&(c.assets={js:n.assets.js,css:n.assets.css}),n.integrity&&u(n.integrity.js)&&u(n.integrity.css)&&(c.integrity={js:n.integrity.js,css:n.integrity.css}),c}catch{return null}finally{o&&clearTimeout(o)}}let m=null,d=null;const l="@pontive/pontkit-core",T=[t=>`https://cdn.jsdelivr.net/npm/${l}@${t}/dist/index.mjs`,t=>`https://unpkg.com/${l}@${t}/dist/index.mjs`,t=>`https://esm.sh/${l}@${t}/dist/index.mjs`],N=[t=>`https://cdn.jsdelivr.net/npm/${l}@${t}/dist/styles.css`,t=>`https://unpkg.com/${l}@${t}/dist/styles.css`,t=>`https://esm.sh/${l}@${t}/dist/styles.css`],O=p;function M(t,e){return new Promise((i,s)=>{const o=document.createElement("link");o.rel="stylesheet",o.href=t,e&&(o.integrity=e,o.crossOrigin="anonymous"),o.onload=()=>i(),o.onerror=r=>s(r),document.head.appendChild(o)})}function $(t,e){return new Promise((i,s)=>{const o=document.createElement("script");o.type="module",o.src=t,o.integrity=e,o.crossOrigin="anonymous",o.onload=()=>i(),o.onerror=()=>s(new Error(`core-elements module at ${t} failed to load or did not match its integrity hash`)),document.head.appendChild(o)}).then(()=>import(t))}async function j(){return typeof window>"u"||typeof document>"u"?null:window.__pontLoaded?window.__pontCore:window.__pontLoading?window.__pontLoading:(d||(d=v().catch(t=>{throw d=null,window.__pontLoading=void 0,t}),window.__pontLoading=d),d)}async function v(){const t=await h(),e=t?.core_elements_version??O,i=T.map(n=>n(e)),s=N.map(n=>n(e));t?.assets&&(i.unshift(t.assets.js),s.unshift(t.assets.css));const o=t?.integrity;let r=null;for(let n=0;n<i.length;n++){const c=i[n],y=s[n];try{await M(y,o?.css);const a=o?await $(c,o.js):await import(c);return window.__pontCore=a,m=a,window.__pontLoaded=!0,window.__pontLoading=void 0,console.log(`PontKit Web Components loaded (${e}) from:`,c),m}catch(a){console.error(`Failed loading from ${c}`,a),r=a}}throw console.error("❌ Failed to load PontKit web components from all CDNs.",r),r}exports.CORE_ELEMENTS_VERSION=p;exports.RUNTIME_CONFIG_PATHS=_;exports.RUNTIME_CONFIG_TIMEOUT_MS=g;exports.fetchRuntimeConfig=h;exports.isExactVersion=w;exports.isSriHash=u;exports.loadWebComponents=j;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pontive/pontkit-loader",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.11.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Loads @pontive/pontkit-core from the CDN at the release the platform decides.",
|
|
6
6
|
"type": "module",
|
|
@@ -32,6 +32,6 @@
|
|
|
32
32
|
"access": "public"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
|
-
"@pontive/pontkit-core": "1.
|
|
35
|
+
"@pontive/pontkit-core": "1.58.0"
|
|
36
36
|
}
|
|
37
37
|
}
|