tia-gpc-widget 1.1.6 → 1.1.7

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/loader.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * TIA GPC Widget Loader
3
- * @version 1.1.6
3
+ * @version 1.1.7
4
4
  */
5
5
 
6
6
  (function() {
@@ -12,7 +12,7 @@
12
12
  timeout: 15000,
13
13
  maxRetries: 3,
14
14
  retryDelay: 2000,
15
- fallbackVersion: '1.1.6',
15
+ fallbackVersion: '1.1.7',
16
16
  fallbackCdn: 'https://cdn.jsdelivr.net/npm/tia-gpc-widget'
17
17
  };
18
18
 
@@ -265,7 +265,7 @@
265
265
  }
266
266
 
267
267
  window.TiaGPCLoader = {
268
- version: '1.1.6',
268
+ version: '1.1.7',
269
269
  reload: init,
270
270
  config: CONFIG
271
271
  };
@@ -1,3 +1,3 @@
1
- /*! TIA GPC Widget Loader v1.0.0 | (c) 2025 TIA | UNLICENSED */
2
- !function(){"use strict";const e={versionUrl:"https://cdn.jsdelivr.net/npm/tia-gpc-widget@latest/dist/version.json",defaultChannel:"stable",timeout:15e3,maxRetries:3,retryDelay:2e3,fallbackVersion:"1.1.6",fallbackCdn:"https://cdn.jsdelivr.net/npm/tia-gpc-widget"};let t=0,n=Date.now();const o=function(e,t){console.log("[TIA GPC Loader]",e,t||"")},i=function(e,t){console.warn("[TIA GPC Loader]",e,t||"")},a=function(e,t){console.error("[TIA GPC Loader]",e,t||"")};function r(e,t){window.dispatchEvent(new CustomEvent(e,{detail:t}))}function s(t){const n=e.fallbackCdn;return{version:t,js:`${n}@${t}/dist/tia-gpc-widget.standalone.js`,css:`${n}@${t}/dist/tia-gpc-widget.standalone.css`,timestamp:null}}async function d(s,c){t++;try{if(o(`Loading widget v${s.version} (attempt ${t}/${e.maxRetries})...`),(l=s.css,new Promise((e,t)=>{if(document.querySelector(`link[href*="${l}"]`))return void e();const n=document.createElement("link");n.rel="stylesheet",n.href=l,n.crossOrigin="anonymous",n.onload=e,n.onerror=()=>t(new Error(`Failed to load CSS: ${l}`)),document.head.appendChild(n)})).catch(e=>{i("CSS loading failed, continuing anyway",e)}),await function(t,n){return new Promise((o,i)=>{const a=document.createElement("script");let r;a.src=t,a.async=!0,a.crossOrigin="anonymous",a.onload=function(){clearTimeout(r),o()},a.onerror=function(){clearTimeout(r),i(new Error(`Failed to load script: ${t}`))},r=setTimeout(()=>{i(new Error(`Timeout loading script: ${t}`))},n||e.timeout),document.head.appendChild(a)})}(s.js,e.timeout),!window.TiaGPC)throw new Error("Widget loaded but TiaGPC global not found");const a=Date.now()-n;return o(`Widget v${s.version} loaded successfully in ${a}ms`),window.TiaGPCWidgetLoaded=!0,window.TiaGPCWidgetVersion=s.version,r("tia-gpc-loader-ready",{version:s.version,loadTime:a,attempts:t,channel:c.channel}),c.apiUrl&&function(e,t){try{fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}).catch(()=>{})}catch(e){}}(c.apiUrl,{event:"widget_loaded",version:s.version,loadTime:a,url:window.location.href}),!0}catch(n){if(a(`Failed to load widget (attempt ${t})`,n.message),t<e.maxRetries)return o(`Retrying in ${e.retryDelay}ms...`),await new Promise(t=>setTimeout(t,e.retryDelay)),d(s,c);throw r("tia-gpc-loader-error",{error:n.message,attempts:t,version:s.version}),new Error(`Failed to load widget after ${t} attempts: ${n.message}`)}var l}async function c(){try{if(!0===window.TiaGPCWidgetLoaded||void 0!==window.TiaGPC)return void i("Widget already loaded, skipping");o("Initializing TIA GPC Widget Loader...");const t=function(){const t=document.currentScript||document.querySelector('script[src*="loader"]');return t?{channel:t.getAttribute("data-channel")||e.defaultChannel,version:t.getAttribute("data-version")||null,debug:"true"===t.getAttribute("data-debug"),apiUrl:t.getAttribute("data-api-url")||null}:{}}();t.debug&&o("Loader config:",t);const n=await async function(t){try{if(t.version)return s(t.version);const n=Date.now(),o=`${e.versionUrl}?_=${n}`,i=await fetch(o,{cache:"no-cache",headers:{"Cache-Control":"no-cache, no-store, must-revalidate",Pragma:"no-cache"}});if(!i.ok)throw new Error(`HTTP ${i.status}: ${i.statusText}`);const a=await i.json(),r=a[t.channel]||a.stable;return{version:a.version,js:r.js,css:r.css,timestamp:a.timestamp}}catch(t){return i("Failed to fetch version info, using fallback",t.message),s(e.fallbackVersion)}}(t);t.debug&&o("Version info:",n),await d(n,t)}catch(e){a("Fatal error initializing widget",e);const t=document.querySelectorAll("tia-gpc-widget");t.length>0&&t.forEach(t=>{t.innerHTML=`\n <div style="padding: 20px; background: #fee; border: 2px solid #c00; border-radius: 8px; font-family: sans-serif;">\n <strong>Error loading TIA GPC Widget</strong>\n <p style="margin: 10px 0 0 0; font-size: 14px;">${e.message}</p>\n </div>\n `})}}"loading"===document.readyState?document.addEventListener("DOMContentLoaded",c):c(),window.TiaGPCLoader={version:"1.1.6",reload:c,config:e}}();
1
+ /*! TIA GPC Widget Loader v1.1.7 | (c) 2025 TIA | UNLICENSED */
2
+ !function(){"use strict";const e={versionUrl:"https://cdn.jsdelivr.net/npm/tia-gpc-widget@latest/dist/version.json",defaultChannel:"stable",timeout:15e3,maxRetries:3,retryDelay:2e3,fallbackVersion:"1.1.7",fallbackCdn:"https://cdn.jsdelivr.net/npm/tia-gpc-widget"};let t=0,n=Date.now();const o=function(e,t){console.log("[TIA GPC Loader]",e,t||"")},i=function(e,t){console.warn("[TIA GPC Loader]",e,t||"")},a=function(e,t){console.error("[TIA GPC Loader]",e,t||"")};function r(e,t){window.dispatchEvent(new CustomEvent(e,{detail:t}))}function s(t){const n=e.fallbackCdn;return{version:t,js:`${n}@${t}/dist/tia-gpc-widget.standalone.js`,css:`${n}@${t}/dist/tia-gpc-widget.standalone.css`,timestamp:null}}async function d(s,c){t++;try{if(o(`Loading widget v${s.version} (attempt ${t}/${e.maxRetries})...`),(l=s.css,new Promise((e,t)=>{if(document.querySelector(`link[href*="${l}"]`))return void e();const n=document.createElement("link");n.rel="stylesheet",n.href=l,n.crossOrigin="anonymous",n.onload=e,n.onerror=()=>t(new Error(`Failed to load CSS: ${l}`)),document.head.appendChild(n)})).catch(e=>{i("CSS loading failed, continuing anyway",e)}),await function(t,n){return new Promise((o,i)=>{const a=document.createElement("script");let r;a.src=t,a.async=!0,a.crossOrigin="anonymous",a.onload=function(){clearTimeout(r),o()},a.onerror=function(){clearTimeout(r),i(new Error(`Failed to load script: ${t}`))},r=setTimeout(()=>{i(new Error(`Timeout loading script: ${t}`))},n||e.timeout),document.head.appendChild(a)})}(s.js,e.timeout),!window.TiaGPC)throw new Error("Widget loaded but TiaGPC global not found");const a=Date.now()-n;return o(`Widget v${s.version} loaded successfully in ${a}ms`),window.TiaGPCWidgetLoaded=!0,window.TiaGPCWidgetVersion=s.version,r("tia-gpc-loader-ready",{version:s.version,loadTime:a,attempts:t,channel:c.channel}),c.apiUrl&&function(e,t){try{fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}).catch(()=>{})}catch(e){}}(c.apiUrl,{event:"widget_loaded",version:s.version,loadTime:a,url:window.location.href}),!0}catch(n){if(a(`Failed to load widget (attempt ${t})`,n.message),t<e.maxRetries)return o(`Retrying in ${e.retryDelay}ms...`),await new Promise(t=>setTimeout(t,e.retryDelay)),d(s,c);throw r("tia-gpc-loader-error",{error:n.message,attempts:t,version:s.version}),new Error(`Failed to load widget after ${t} attempts: ${n.message}`)}var l}async function c(){try{if(!0===window.TiaGPCWidgetLoaded||void 0!==window.TiaGPC)return void i("Widget already loaded, skipping");o("Initializing TIA GPC Widget Loader...");const t=function(){const t=document.currentScript||document.querySelector('script[src*="loader"]');return t?{channel:t.getAttribute("data-channel")||e.defaultChannel,version:t.getAttribute("data-version")||null,debug:"true"===t.getAttribute("data-debug"),apiUrl:t.getAttribute("data-api-url")||null}:{}}();t.debug&&o("Loader config:",t);const n=await async function(t){try{if(t.version)return s(t.version);const n=Date.now(),o=`${e.versionUrl}?_=${n}`,i=await fetch(o,{cache:"no-cache",headers:{"Cache-Control":"no-cache, no-store, must-revalidate",Pragma:"no-cache"}});if(!i.ok)throw new Error(`HTTP ${i.status}: ${i.statusText}`);const a=await i.json(),r=a[t.channel]||a.stable;return{version:a.version,js:r.js,css:r.css,timestamp:a.timestamp}}catch(t){return i("Failed to fetch version info, using fallback",t.message),s(e.fallbackVersion)}}(t);t.debug&&o("Version info:",n),await d(n,t)}catch(e){a("Fatal error initializing widget",e);const t=document.querySelectorAll("tia-gpc-widget");t.length>0&&t.forEach(t=>{t.innerHTML=`\n <div style="padding: 20px; background: #fee; border: 2px solid #c00; border-radius: 8px; font-family: sans-serif;">\n <strong>Error loading TIA GPC Widget</strong>\n <p style="margin: 10px 0 0 0; font-size: 14px;">${e.message}</p>\n </div>\n `})}}"loading"===document.readyState?document.addEventListener("DOMContentLoaded",c):c(),window.TiaGPCLoader={version:"1.1.7",reload:c,config:e}}();
3
3
  //# sourceMappingURL=loader.min.js.map
package/dist/version.json CHANGED
@@ -1,32 +1,32 @@
1
1
  {
2
- "version": "1.1.6",
2
+ "version": "1.1.7",
3
3
  "stable": {
4
- "version": "1.1.6",
5
- "js": "https://cdn.jsdelivr.net/npm/tia-gpc-widget@1.1.6/dist/tia-gpc-widget.standalone.js",
6
- "css": "https://cdn.jsdelivr.net/npm/tia-gpc-widget@1.1.6/dist/tia-gpc-widget.standalone.css",
4
+ "version": "1.1.7",
5
+ "js": "https://cdn.jsdelivr.net/npm/tia-gpc-widget@1.1.7/dist/tia-gpc-widget.standalone.js",
6
+ "css": "https://cdn.jsdelivr.net/npm/tia-gpc-widget@1.1.7/dist/tia-gpc-widget.standalone.css",
7
7
  "cdn": "jsdelivr"
8
8
  },
9
9
  "beta": {
10
- "version": "1.1.6",
11
- "js": "https://cdn.jsdelivr.net/npm/tia-gpc-widget@1.1.6/dist/tia-gpc-widget.standalone.js",
12
- "css": "https://cdn.jsdelivr.net/npm/tia-gpc-widget@1.1.6/dist/tia-gpc-widget.standalone.css",
10
+ "version": "1.1.7",
11
+ "js": "https://cdn.jsdelivr.net/npm/tia-gpc-widget@1.1.7/dist/tia-gpc-widget.standalone.js",
12
+ "css": "https://cdn.jsdelivr.net/npm/tia-gpc-widget@1.1.7/dist/tia-gpc-widget.standalone.css",
13
13
  "cdn": "jsdelivr"
14
14
  },
15
15
  "cdn": {
16
16
  "jsdelivr": {
17
- "js": "https://cdn.jsdelivr.net/npm/tia-gpc-widget@1.1.6/dist/tia-gpc-widget.standalone.js",
18
- "css": "https://cdn.jsdelivr.net/npm/tia-gpc-widget@1.1.6/dist/tia-gpc-widget.standalone.css"
17
+ "js": "https://cdn.jsdelivr.net/npm/tia-gpc-widget@1.1.7/dist/tia-gpc-widget.standalone.js",
18
+ "css": "https://cdn.jsdelivr.net/npm/tia-gpc-widget@1.1.7/dist/tia-gpc-widget.standalone.css"
19
19
  },
20
20
  "unpkg": {
21
- "js": "https://unpkg.com/tia-gpc-widget@1.1.6/dist/tia-gpc-widget.standalone.js",
22
- "css": "https://unpkg.com/tia-gpc-widget@1.1.6/dist/tia-gpc-widget.standalone.css"
21
+ "js": "https://unpkg.com/tia-gpc-widget@1.1.7/dist/tia-gpc-widget.standalone.js",
22
+ "css": "https://unpkg.com/tia-gpc-widget@1.1.7/dist/tia-gpc-widget.standalone.css"
23
23
  }
24
24
  },
25
25
  "metadata": {
26
- "buildDate": "2025-11-17T19:53:30.000Z",
27
- "timestamp": 1763409210000,
26
+ "buildDate": "2025-11-17T20:16:11.609Z",
27
+ "timestamp": 1763410571610,
28
28
  "nodeVersion": "v20.19.4",
29
- "cacheBuster": "mi3kbamo"
29
+ "cacheBuster": "mi3l4h96"
30
30
  },
31
31
  "minVersion": "1.0.0",
32
32
  "rollout": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tia-gpc-widget",
3
- "version": "1.1.6",
3
+ "version": "1.1.7",
4
4
  "description": "Widget TIA GPC - Compatible con React, HTML puro, Angular, ASP.NET y cualquier framework",
5
5
  "type": "module",
6
6
  "main": "./dist/tia-gpc.cjs.js",