maidr 1.7.1__py3-none-any.whl → 1.7.2__py3-none-any.whl

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.
maidr/__init__.py CHANGED
@@ -1,4 +1,4 @@
1
- __version__ = "1.7.1"
1
+ __version__ = "1.7.2"
2
2
 
3
3
  from .api import close, render, save_html, show, stacked
4
4
  from .core import Maidr
maidr/core/maidr.py CHANGED
@@ -366,16 +366,29 @@ class Maidr:
366
366
  iframe.contentWindow.document
367
367
  ) {{
368
368
  let iframeDocument = iframe.contentWindow.document;
369
- let brailleContainer =
370
- iframeDocument.getElementById('braille-input');
369
+ // Detect braille textarea by dynamic id prefix
370
+ let brailleContainer = iframeDocument.querySelector('[id^="maidr-braille-textarea"]');
371
+ // Detect review input container by class name
372
+ let reviewInputContainer = iframeDocument.querySelector('.maidr-review-input');
371
373
  iframe.style.height = 'auto';
372
374
  let height = iframeDocument.body.scrollHeight;
373
- if (brailleContainer &&
374
- brailleContainer === iframeDocument.activeElement
375
- ) {{
375
+ // Consider braille active if it or any descendant has focus
376
+ let isBrailleActive = brailleContainer && (
377
+ brailleContainer === iframeDocument.activeElement ||
378
+ (typeof brailleContainer.contains === 'function' && brailleContainer.contains(iframeDocument.activeElement))
379
+ );
380
+ // Consider review input active if it or any descendant has focus
381
+ let isReviewInputActive = reviewInputContainer && (
382
+ reviewInputContainer === iframeDocument.activeElement ||
383
+ (typeof reviewInputContainer.contains === 'function' && reviewInputContainer.contains(iframeDocument.activeElement))
384
+ );
385
+ // (logs removed)
386
+ if (isBrailleActive) {{
376
387
  height += 100;
377
- }}else{{
378
- height += 50
388
+ }} else if (isReviewInputActive) {{
389
+ height += 50;
390
+ }} else {{
391
+ height += 50;
379
392
  }}
380
393
  iframe.style.height = (height) + 'px';
381
394
  iframe.style.width = iframeDocument.body.scrollWidth + 'px';
@@ -387,12 +400,32 @@ class Maidr:
387
400
  resizeIframe();
388
401
  iframe.contentWindow.addEventListener('resize', resizeIframe);
389
402
  }};
390
- iframe.contentWindow.document.addEventListener('focusin', () => {{
391
- resizeIframe();
392
- }});
393
- iframe.contentWindow.document.addEventListener('focusout', () => {{
394
- resizeIframe();
395
- }});
403
+ // Delegate focus events for braille textarea (by id prefix)
404
+ iframe.contentWindow.document.addEventListener('focusin', (e) => {{
405
+ try {{
406
+ const t = e && e.target ? e.target : null;
407
+ if (t && typeof t.id === 'string' && t.id.startsWith('maidr-braille-textarea')) resizeIframe();
408
+ }} catch (_) {{ resizeIframe(); }}
409
+ }}, true);
410
+ iframe.contentWindow.document.addEventListener('focusout', (e) => {{
411
+ try {{
412
+ const t = e && e.target ? e.target : null;
413
+ if (t && typeof t.id === 'string' && t.id.startsWith('maidr-braille-textarea')) resizeIframe();
414
+ }} catch (_) {{ resizeIframe(); }}
415
+ }}, true);
416
+ // Delegate focus events for review input container (by class name)
417
+ iframe.contentWindow.document.addEventListener('focusin', (e) => {{
418
+ try {{
419
+ const t = e && e.target ? e.target : null;
420
+ if (t && t.classList && t.classList.contains('maidr-review-input')) resizeIframe();
421
+ }} catch (_) {{ resizeIframe(); }}
422
+ }}, true);
423
+ iframe.contentWindow.document.addEventListener('focusout', (e) => {{
424
+ try {{
425
+ const t = e && e.target ? e.target : null;
426
+ if (t && t.classList && t.classList.contains('maidr-review-input')) resizeIframe();
427
+ }} catch (_) {{ resizeIframe(); }}
428
+ }}, true);
396
429
  """
397
430
  return resizing_script
398
431
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: maidr
3
- Version: 1.7.1
3
+ Version: 1.7.2
4
4
  Summary: Multimodal Access and Interactive Data Representations
5
5
  Project-URL: Homepage, https://xability.github.io/py-maidr
6
6
  Project-URL: Repository, https://github.com/xability/py-maidr
@@ -1,9 +1,9 @@
1
- maidr/__init__.py,sha256=5pE1kfXuUom-1WcK9Z4Dl8PFegDww1BeKyscUSWJ4Rg,415
1
+ maidr/__init__.py,sha256=X3vZu1thIgth4Y8f6nQ4R_DeyWdCRvj_ukKAZ_7bPT0,415
2
2
  maidr/api.py,sha256=gRNLXqUWpFGdD-I7Nu6J0_LeEni9KRAr0TBHwHaDAsc,1928
3
3
  maidr/core/__init__.py,sha256=WgxLpSEYMc4k3OyEOf1shOxfEq0ASzppEIZYmE91ThQ,25
4
4
  maidr/core/context_manager.py,sha256=6cT7ZGOApSpC-SLD2XZWWU_H08i-nfv-JUlzXOtvWYw,3374
5
5
  maidr/core/figure_manager.py,sha256=jXs-Prkeru1Pahj21hjh8BAwXM9ZFUZ3GFfKUfIRX_M,4117
6
- maidr/core/maidr.py,sha256=1f3H6E2gXTWTdO_vNmiGmPq1dDn-Q96wjirkosxIgPg,15802
6
+ maidr/core/maidr.py,sha256=cXSE3Cymd6XQVk77KmQhWRtuvAX3nPzV2ZxpolsPr7w,18408
7
7
  maidr/core/enum/__init__.py,sha256=9ee78L0dlxEx4ulUGVlD-J23UcUZmrGu0rXms54up3c,93
8
8
  maidr/core/enum/library.py,sha256=e8ujT_L-McJWfoVJd1ty9K_2bwITnf1j0GPLsnAcHes,104
9
9
  maidr/core/enum/maidr_key.py,sha256=ljG0omqzd8K8Yk213N7i7PXGvG-IOlnE5v7o6RoGJzc,795
@@ -52,7 +52,7 @@ maidr/util/mixin/extractor_mixin.py,sha256=l1DQTqZiVeZ18qXrz-rKCh8ETFofucBfwjIjO
52
52
  maidr/util/mixin/merger_mixin.py,sha256=V0qLw_6DUB7X6CQ3BCMpsCQX_ZuwAhoSTm_E4xAJFKM,712
53
53
  maidr/widget/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
54
54
  maidr/widget/shiny.py,sha256=wrrw2KAIpE_A6CNQGBtNHauR1DjenA_n47qlFXX9_rk,745
55
- maidr-1.7.1.dist-info/METADATA,sha256=WjKqqdKOwH8ZkI00md0BINyrpZv_hpD3WL5ZL1_iXkM,3154
56
- maidr-1.7.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
57
- maidr-1.7.1.dist-info/licenses/LICENSE,sha256=IwGE9guuL-ryRPEKi6wFPI_zOhg7zDZbTYuHbSt_SAk,35823
58
- maidr-1.7.1.dist-info/RECORD,,
55
+ maidr-1.7.2.dist-info/METADATA,sha256=8oaTlEpNVa5w8tBjKYofiFVj1h6Tn1fOAy54SyNZyz0,3154
56
+ maidr-1.7.2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
57
+ maidr-1.7.2.dist-info/licenses/LICENSE,sha256=IwGE9guuL-ryRPEKi6wFPI_zOhg7zDZbTYuHbSt_SAk,35823
58
+ maidr-1.7.2.dist-info/RECORD,,
File without changes