@opendata-ai/openchart-vanilla 2.11.0 → 2.12.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opendata-ai/openchart-vanilla",
3
- "version": "2.11.0",
3
+ "version": "2.12.1",
4
4
  "description": "Vanilla JS renderer for openchart: SVG charts, HTML tables, force-directed graphs",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Riley Hilliard",
@@ -50,8 +50,8 @@
50
50
  },
51
51
  "dependencies": {
52
52
  "@floating-ui/dom": "^1.7.6",
53
- "@opendata-ai/openchart-core": "2.11.0",
54
- "@opendata-ai/openchart-engine": "2.11.0",
53
+ "@opendata-ai/openchart-core": "2.12.1",
54
+ "@opendata-ai/openchart-engine": "2.12.1",
55
55
  "d3-force": "^3.0.0",
56
56
  "d3-quadtree": "^3.0.1"
57
57
  },
package/src/mount.ts CHANGED
@@ -1297,6 +1297,17 @@ function createScreenReaderTable(
1297
1297
 
1298
1298
  const table = document.createElement('table');
1299
1299
  table.className = 'viz-sr-only';
1300
+ // Inline critical SR-only styles so the table stays hidden even when the
1301
+ // external stylesheet isn't loaded (e.g. CDN / esm.sh usage).
1302
+ table.style.position = 'absolute';
1303
+ table.style.width = '1px';
1304
+ table.style.height = '1px';
1305
+ table.style.padding = '0';
1306
+ table.style.margin = '-1px';
1307
+ table.style.overflow = 'hidden';
1308
+ table.style.clipPath = 'inset(50%)';
1309
+ table.style.whiteSpace = 'nowrap';
1310
+ table.style.borderWidth = '0';
1300
1311
  table.setAttribute('role', 'table');
1301
1312
  table.setAttribute('aria-label', `Data table: ${layout.a11y.altText}`);
1302
1313
 
@@ -316,9 +316,19 @@ export function renderTable(layout: TableLayout, container: HTMLElement): HTMLEl
316
316
  table.classList.add('viz-table--sticky');
317
317
  }
318
318
 
319
- // Caption (screen reader only)
319
+ // Caption (screen reader only – inline styles ensure hiding even without
320
+ // the external stylesheet, e.g. CDN / esm.sh usage)
320
321
  const caption = document.createElement('caption');
321
322
  caption.className = 'viz-sr-only';
323
+ caption.style.position = 'absolute';
324
+ caption.style.width = '1px';
325
+ caption.style.height = '1px';
326
+ caption.style.padding = '0';
327
+ caption.style.margin = '-1px';
328
+ caption.style.overflow = 'hidden';
329
+ caption.style.clipPath = 'inset(50%)';
330
+ caption.style.whiteSpace = 'nowrap';
331
+ caption.style.borderWidth = '0';
322
332
  caption.textContent = layout.a11y.summary;
323
333
  table.appendChild(caption);
324
334
 
@@ -347,6 +357,15 @@ export function renderTable(layout: TableLayout, container: HTMLElement): HTMLEl
347
357
  // Live region for screen reader announcements (sort changes, search results)
348
358
  const liveRegion = document.createElement('div');
349
359
  liveRegion.className = 'viz-table-live-region viz-sr-only';
360
+ liveRegion.style.position = 'absolute';
361
+ liveRegion.style.width = '1px';
362
+ liveRegion.style.height = '1px';
363
+ liveRegion.style.padding = '0';
364
+ liveRegion.style.margin = '-1px';
365
+ liveRegion.style.overflow = 'hidden';
366
+ liveRegion.style.clipPath = 'inset(50%)';
367
+ liveRegion.style.whiteSpace = 'nowrap';
368
+ liveRegion.style.borderWidth = '0';
350
369
  liveRegion.setAttribute('aria-live', 'polite');
351
370
  liveRegion.setAttribute('aria-atomic', 'true');
352
371
  liveRegion.setAttribute('role', 'status');