nexabase-report 0.28.49 → 0.30.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.
@@ -1,4 +1,4 @@
1
- import { c as rt, d as $t } from "./index-CNxyint1.js";
1
+ import { c as rt, d as $t } from "./index-C7gnc9e6.js";
2
2
  function nt(e) {
3
3
  throw new Error('Could not dynamically require "' + e + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
4
4
  }
@@ -33,26 +33,33 @@
33
33
  </div>
34
34
 
35
35
  <script>
36
+ function loadFrom(baseUrl) {
37
+ var css = document.createElement('link');
38
+ css.rel = 'stylesheet';
39
+ css.href = baseUrl + '/dist/style.css';
40
+ var cssReady = new Promise(function(resolve) { css.onload = resolve; css.onerror = resolve; });
41
+ document.head.appendChild(css);
42
+
43
+ var js = document.createElement('script');
44
+ js.src = baseUrl + '/dist/nexabase-report.umd.js';
45
+ var jsReady = new Promise(function(resolve, reject) { js.onload = resolve; js.onerror = reject; });
46
+ document.head.appendChild(js);
47
+
48
+ // Espera los DOS recursos, no solo el JS: si el visor arranca antes de que
49
+ // el CSS esté aplicado, la paginación puede medir mal y salir con menos páginas.
50
+ return Promise.all([cssReady, jsReady]);
51
+ }
52
+
36
53
  // Resuelve la última versión publicada y la carga por versión exacta, para
37
54
  // que el navegador no quede sirviendo una copia vieja cacheada tras un fix.
38
55
  fetch('https://data.jsdelivr.com/v1/packages/npm/nexabase-report/resolved?specifier=latest')
39
56
  .then(function(r) { return r.json(); })
40
- .then(function(resolved) {
41
- var css = document.createElement('link');
42
- css.rel = 'stylesheet';
43
- css.href = 'https://cdn.jsdelivr.net/npm/nexabase-report@' + resolved.version + '/dist/style.css';
44
- var cssReady = new Promise(function(resolve) { css.onload = resolve; css.onerror = resolve; });
45
- document.head.appendChild(css);
46
-
47
- var js = document.createElement('script');
48
- js.src = 'https://cdn.jsdelivr.net/npm/nexabase-report@' + resolved.version + '/dist/nexabase-report.umd.js';
49
- var jsReady = new Promise(function(resolve) { js.onload = resolve; });
50
- document.head.appendChild(js);
51
-
52
- // Espera los DOS recursos, no solo el JS: si el visor arranca antes de que
53
- // el CSS esté aplicado, la paginación puede medir mal y salir con menos páginas.
54
- Promise.all([cssReady, jsReady]).then(initReport);
55
- });
57
+ .then(function(resolved) { return loadFrom('https://cdn.jsdelivr.net/npm/nexabase-report@' + resolved.version); })
58
+ // La resolución de versión vive en otro dominio (data.jsdelivr.com) que el CDN
59
+ // mismo — si un proxy/CSP/adblocker bloquea justo esa llamada, cae a @latest.
60
+ .catch(function() { return loadFrom('https://cdn.jsdelivr.net/npm/nexabase-report@latest'); })
61
+ .then(initReport)
62
+ .catch(function(err) { console.error('No se pudo cargar NexaReport:', err); });
56
63
 
57
64
  function initReport() {
58
65
  $(function() {
@@ -29,16 +29,33 @@
29
29
 
30
30
  <script src="https://code.jquery.com/jquery-3.7.1.min.js"></script>
31
31
  <script>
32
+ function loadFrom(baseUrl) {
33
+ var css = document.createElement('link');
34
+ css.rel = 'stylesheet';
35
+ css.href = baseUrl + '/dist/style.css';
36
+ var cssReady = new Promise(function(resolve) { css.onload = resolve; css.onerror = resolve; });
37
+ document.head.appendChild(css);
38
+
39
+ var js = document.createElement('script');
40
+ js.src = baseUrl + '/dist/nexabase-report.umd.js';
41
+ var jsReady = new Promise(function(resolve, reject) { js.onload = resolve; js.onerror = reject; });
42
+ document.head.appendChild(js);
43
+
44
+ // Espera los DOS recursos, no solo el JS: si el visor arranca antes de que
45
+ // el CSS esté aplicado, la paginación puede medir mal y salir con menos páginas.
46
+ return Promise.all([cssReady, jsReady]);
47
+ }
48
+
32
49
  // Resuelve la última versión publicada y la carga por versión exacta, para
33
50
  // que el navegador no quede sirviendo una copia vieja cacheada tras un fix.
34
51
  fetch('https://data.jsdelivr.com/v1/packages/npm/nexabase-report/resolved?specifier=latest')
35
52
  .then(function(r) { return r.json(); })
36
- .then(function(resolved) {
37
- var js = document.createElement('script');
38
- js.src = 'https://cdn.jsdelivr.net/npm/nexabase-report@' + resolved.version + '/dist/nexabase-report.umd.js';
39
- js.onload = initViewer;
40
- document.head.appendChild(js);
41
- });
53
+ .then(function(resolved) { return loadFrom('https://cdn.jsdelivr.net/npm/nexabase-report@' + resolved.version); })
54
+ // La resolución de versión vive en otro dominio (data.jsdelivr.com) que el CDN
55
+ // mismo — si un proxy/CSP/adblocker bloquea justo esa llamada, cae a @latest.
56
+ .catch(function() { return loadFrom('https://cdn.jsdelivr.net/npm/nexabase-report@latest'); })
57
+ .then(initViewer)
58
+ .catch(function(err) { console.error('No se pudo cargar NexaReport:', err); });
42
59
 
43
60
  function initViewer() {
44
61
  $(function() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nexabase-report",
3
- "version": "0.28.49",
3
+ "version": "0.30.0",
4
4
  "description": "Professional report designer and viewer for NexaBase — drag & drop designer, PDF/Excel export, charts, crosstabs, subreports.",
5
5
  "license": "MIT",
6
6
  "author": "NexaBase Team",