accessibility-plugin-react 2.16.0 → 2.18.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/style.css CHANGED
@@ -12,9 +12,18 @@
12
12
  color-scheme: light;
13
13
  font:
14
14
  15px/1.5 system-ui,
15
+ -apple-system,
16
+ BlinkMacSystemFont,
17
+ "Segoe UI",
18
+ Roboto,
19
+ "Noto Sans Sinhala",
20
+ "Iskoola Pota",
21
+ "Noto Sans Tamil",
22
+ "Latha",
23
+ "Nirmala UI",
15
24
  sans-serif;
16
25
  color: var(--arap-text);
17
- text-align: left;
26
+ text-align: start;
18
27
  letter-spacing: normal;
19
28
  }
20
29
  .arap-root *,
@@ -1487,3 +1496,361 @@
1487
1496
  padding: 10px 16px;
1488
1497
  font-size: 14px;
1489
1498
  }
1499
+
1500
+ /* RTL and Bidirectional Writing Infrastructure (A11Y-306) */
1501
+ .arap-root[dir="rtl"],
1502
+ .arap-panel[dir="rtl"] {
1503
+ direction: rtl;
1504
+ text-align: right;
1505
+ }
1506
+
1507
+ .arap-panel[dir="rtl"] .arap-heading {
1508
+ flex-direction: row-reverse;
1509
+ }
1510
+
1511
+ .arap-panel[dir="rtl"] .arap-position-arrows {
1512
+ direction: ltr; /* retain physical spatial geometry for navigation arrows */
1513
+ }
1514
+
1515
+ .arap-search-input {
1516
+ width: 100%;
1517
+ box-sizing: border-box;
1518
+ padding: 6px 28px 6px 10px;
1519
+ font-size: 12px;
1520
+ border: 1px solid var(--arap-border, #cbd5e1);
1521
+ border-radius: 6px;
1522
+ background: var(--arap-surface, #ffffff);
1523
+ color: var(--arap-text, #0f172a);
1524
+ }
1525
+
1526
+ .arap-panel[dir="rtl"] .arap-search-input {
1527
+ padding: 6px 10px 6px 28px;
1528
+ }
1529
+
1530
+ .arap-search-clear {
1531
+ position: absolute;
1532
+ inset-inline-end: 8px;
1533
+ top: 50%;
1534
+ transform: translateY(-50%);
1535
+ border: none;
1536
+ background: transparent;
1537
+ cursor: pointer;
1538
+ padding: 2px 6px;
1539
+ font-size: 14px;
1540
+ color: var(--arap-muted, #64748b);
1541
+ border-radius: 4px;
1542
+ }
1543
+
1544
+ .arap-search-clear:hover {
1545
+ background: var(--arap-selected, #eff6ff);
1546
+ color: var(--arap-text, #0f172a);
1547
+ }
1548
+
1549
+ /* Reading Mode Overlay & Dialog (A11Y-307) */
1550
+ .arap-reading-mode-backdrop {
1551
+ position: fixed;
1552
+ inset: 0;
1553
+ z-index: 2147483646;
1554
+ overflow-y: auto;
1555
+ display: flex;
1556
+ justify-content: center;
1557
+ align-items: flex-start;
1558
+ padding: 24px 16px;
1559
+ background: rgba(15, 23, 42, 0.45);
1560
+ backdrop-filter: blur(4px);
1561
+ -webkit-backdrop-filter: blur(4px);
1562
+ box-sizing: border-box;
1563
+ }
1564
+
1565
+ .arap-reading-mode-backdrop[data-theme="sepia"] {
1566
+ background: rgba(68, 51, 34, 0.45);
1567
+ }
1568
+
1569
+ .arap-reading-mode-backdrop[data-theme="dark"] {
1570
+ background: rgba(0, 0, 0, 0.75);
1571
+ }
1572
+
1573
+ .arap-reading-mode-dialog {
1574
+ position: relative;
1575
+ width: 100%;
1576
+ max-width: 760px;
1577
+ min-height: 50vh;
1578
+ margin: 16px auto;
1579
+ border-radius: 12px;
1580
+ box-shadow:
1581
+ 0 20px 25px -5px rgba(0, 0, 0, 0.15),
1582
+ 0 10px 10px -5px rgba(0, 0, 0, 0.05);
1583
+ display: flex;
1584
+ flex-direction: column;
1585
+ outline: none;
1586
+ box-sizing: border-box;
1587
+ font-family:
1588
+ system-ui,
1589
+ -apple-system,
1590
+ BlinkMacSystemFont,
1591
+ "Segoe UI",
1592
+ Roboto,
1593
+ "Noto Sans Sinhala",
1594
+ "Noto Sans Tamil",
1595
+ sans-serif;
1596
+ transition:
1597
+ background-color 0.2s ease,
1598
+ color 0.2s ease;
1599
+ }
1600
+
1601
+ /* Theme color schemes */
1602
+ .arap-reading-mode-backdrop[data-theme="light"] .arap-reading-mode-dialog {
1603
+ background: #ffffff;
1604
+ color: #1e293b;
1605
+ border: 1px solid #e2e8f0;
1606
+ }
1607
+
1608
+ .arap-reading-mode-backdrop[data-theme="sepia"] .arap-reading-mode-dialog {
1609
+ background: #fbf0d9;
1610
+ color: #5f4b32;
1611
+ border: 1px solid #ebd5b3;
1612
+ }
1613
+
1614
+ .arap-reading-mode-backdrop[data-theme="dark"] .arap-reading-mode-dialog {
1615
+ background: #18181b;
1616
+ color: #f4f4f5;
1617
+ border: 1px solid #27272a;
1618
+ }
1619
+
1620
+ .arap-reading-mode-header {
1621
+ display: flex;
1622
+ justify-content: space-between;
1623
+ align-items: center;
1624
+ flex-wrap: wrap;
1625
+ gap: 12px;
1626
+ padding: 16px 24px;
1627
+ border-bottom: 1px solid rgba(148, 163, 184, 0.2);
1628
+ }
1629
+
1630
+ .arap-reading-mode-meta {
1631
+ display: flex;
1632
+ align-items: center;
1633
+ gap: 8px;
1634
+ font-size: 0.875rem;
1635
+ opacity: 0.85;
1636
+ }
1637
+
1638
+ .arap-reading-mode-badge {
1639
+ font-weight: 600;
1640
+ text-transform: uppercase;
1641
+ font-size: 0.75rem;
1642
+ letter-spacing: 0.05em;
1643
+ padding: 2px 8px;
1644
+ border-radius: 4px;
1645
+ background: rgba(148, 163, 184, 0.15);
1646
+ }
1647
+
1648
+ .arap-reading-mode-toolbar {
1649
+ display: flex;
1650
+ align-items: center;
1651
+ gap: 12px;
1652
+ }
1653
+
1654
+ .arap-reading-mode-theme-group,
1655
+ .arap-reading-mode-zoom-group {
1656
+ display: inline-flex;
1657
+ border-radius: 6px;
1658
+ border: 1px solid rgba(148, 163, 184, 0.25);
1659
+ overflow: hidden;
1660
+ }
1661
+
1662
+ .arap-reader-theme-btn,
1663
+ .arap-reader-zoom-btn {
1664
+ min-height: 36px;
1665
+ min-width: 44px;
1666
+ padding: 4px 10px;
1667
+ border: none;
1668
+ background: transparent;
1669
+ color: inherit;
1670
+ font-size: 0.8125rem;
1671
+ font-weight: 500;
1672
+ cursor: pointer;
1673
+ transition: background-color 0.15s ease;
1674
+ }
1675
+
1676
+ .arap-reader-theme-btn:not(:last-child),
1677
+ .arap-reader-zoom-btn:not(:last-child) {
1678
+ border-right: 1px solid rgba(148, 163, 184, 0.25);
1679
+ }
1680
+
1681
+ .arap-reader-theme-btn.arap-active {
1682
+ background: rgba(148, 163, 184, 0.25);
1683
+ font-weight: 600;
1684
+ }
1685
+
1686
+ .arap-reader-zoom-btn:disabled {
1687
+ opacity: 0.4;
1688
+ cursor: not-allowed;
1689
+ }
1690
+
1691
+ .arap-reading-mode-close {
1692
+ min-width: 44px;
1693
+ min-height: 44px;
1694
+ display: inline-flex;
1695
+ align-items: center;
1696
+ justify-content: center;
1697
+ background: transparent;
1698
+ border: none;
1699
+ font-size: 1.5rem;
1700
+ line-height: 1;
1701
+ color: inherit;
1702
+ cursor: pointer;
1703
+ border-radius: 6px;
1704
+ }
1705
+
1706
+ .arap-reading-mode-close:hover,
1707
+ .arap-reader-theme-btn:hover:not(:disabled),
1708
+ .arap-reader-zoom-btn:hover:not(:disabled) {
1709
+ background: rgba(148, 163, 184, 0.15);
1710
+ }
1711
+
1712
+ .arap-reading-mode-content {
1713
+ padding: 32px 36px;
1714
+ flex: 1 1 auto;
1715
+ }
1716
+
1717
+ .arap-reading-mode-title {
1718
+ margin: 0 0 12px 0;
1719
+ font-size: 2.125rem;
1720
+ line-height: 1.25;
1721
+ font-weight: 700;
1722
+ }
1723
+
1724
+ .arap-reading-mode-byline {
1725
+ margin: 0 0 24px 0;
1726
+ font-size: 0.9375rem;
1727
+ opacity: 0.75;
1728
+ font-style: italic;
1729
+ }
1730
+
1731
+ .arap-reading-mode-body {
1732
+ line-height: 1.8;
1733
+ font-size: 1.0625rem;
1734
+ }
1735
+
1736
+ .arap-reading-mode-body p {
1737
+ margin: 0 0 1.5em 0;
1738
+ }
1739
+
1740
+ .arap-reading-mode-body h2 {
1741
+ font-size: 1.5rem;
1742
+ margin: 1.75em 0 0.75em 0;
1743
+ font-weight: 600;
1744
+ }
1745
+
1746
+ .arap-reading-mode-body h3 {
1747
+ font-size: 1.25rem;
1748
+ margin: 1.5em 0 0.5em 0;
1749
+ font-weight: 600;
1750
+ }
1751
+
1752
+ .arap-reading-mode-body ul,
1753
+ .arap-reading-mode-body ol {
1754
+ margin: 0 0 1.5em 0;
1755
+ padding-left: 1.75em;
1756
+ }
1757
+
1758
+ .arap-reading-mode-body li {
1759
+ margin-bottom: 0.5em;
1760
+ }
1761
+
1762
+ .arap-reading-mode-body a {
1763
+ color: #0284c7;
1764
+ text-decoration: underline;
1765
+ text-underline-offset: 3px;
1766
+ }
1767
+
1768
+ .arap-reading-mode-backdrop[data-theme="dark"] .arap-reading-mode-body a {
1769
+ color: #38bdf8;
1770
+ }
1771
+
1772
+ .arap-reading-mode-backdrop[data-theme="sepia"] .arap-reading-mode-body a {
1773
+ color: #8c5b00;
1774
+ }
1775
+
1776
+ .arap-reading-mode-body img {
1777
+ max-width: 100%;
1778
+ height: auto;
1779
+ border-radius: 8px;
1780
+ margin: 1.5em 0;
1781
+ display: block;
1782
+ }
1783
+
1784
+ .arap-reading-mode-body figure {
1785
+ margin: 1.5em 0;
1786
+ }
1787
+
1788
+ .arap-reading-mode-body figcaption {
1789
+ font-size: 0.875rem;
1790
+ opacity: 0.75;
1791
+ text-align: center;
1792
+ margin-top: 6px;
1793
+ }
1794
+
1795
+ .arap-reading-mode-body blockquote {
1796
+ margin: 1.5em 0;
1797
+ padding: 12px 20px;
1798
+ border-left: 4px solid currentColor;
1799
+ opacity: 0.9;
1800
+ font-style: italic;
1801
+ }
1802
+
1803
+ .arap-reading-mode-body pre {
1804
+ margin: 1.5em 0;
1805
+ padding: 16px;
1806
+ border-radius: 8px;
1807
+ background: rgba(148, 163, 184, 0.15);
1808
+ overflow-x: auto;
1809
+ font-size: 0.9rem;
1810
+ }
1811
+
1812
+ .arap-reading-mode-body code {
1813
+ font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
1814
+ }
1815
+
1816
+ .arap-reading-mode-footer {
1817
+ padding: 16px 24px;
1818
+ border-top: 1px solid rgba(148, 163, 184, 0.2);
1819
+ display: flex;
1820
+ justify-content: center;
1821
+ }
1822
+
1823
+ .arap-reading-mode-exit-btn {
1824
+ min-height: 44px;
1825
+ padding: 8px 24px;
1826
+ border-radius: 6px;
1827
+ border: 1px solid rgba(148, 163, 184, 0.35);
1828
+ background: transparent;
1829
+ color: inherit;
1830
+ font-size: 0.9375rem;
1831
+ font-weight: 500;
1832
+ cursor: pointer;
1833
+ transition: background-color 0.15s ease;
1834
+ }
1835
+
1836
+ .arap-reading-mode-exit-btn:hover {
1837
+ background: rgba(148, 163, 184, 0.15);
1838
+ }
1839
+
1840
+ @media (max-width: 640px) {
1841
+ .arap-reading-mode-backdrop {
1842
+ padding: 0;
1843
+ }
1844
+ .arap-reading-mode-dialog {
1845
+ margin: 0;
1846
+ min-height: 100vh;
1847
+ border-radius: 0;
1848
+ border: none;
1849
+ }
1850
+ .arap-reading-mode-content {
1851
+ padding: 20px 16px;
1852
+ }
1853
+ .arap-reading-mode-title {
1854
+ font-size: 1.75rem;
1855
+ }
1856
+ }
package/docs/API.md CHANGED
@@ -51,15 +51,15 @@ Definitions/defaults are immutable for the provider lifetime; the first register
51
51
 
52
52
  `FeatureRegistration` is `FeatureOptions<unknown>` plus `defaultValue: unknown`. Use the generic hook instead of manually casting callbacks. Legacy `registerReset(key, fn)` / `unregisterReset(key)` remain available; callbacks run before global state is cleared. They are not the primary effect lifecycle API. Callback owners must unregister their callback on teardown.
53
53
 
54
- Exported types: `AccessibilityPluginProps`, `AccessibilityButtonProps`, `AccessibilityListProps`, `AccessibilityState`, `AccessibilityContextValue`, `PluginPosition`, `WidgetPlacement`, `FeatureOptions<T>`, `FeatureRegistration`, `ToggleControlProps`, `ChoiceControlProps`, `ChoiceOption<T>`, `ChoiceGroup<T>`, `StepperControlProps`, `FeatureCardProps`, `FeatureStatus`, `SearchCountProps`, `EmptyStateProps`, `ErrorStateProps`, `ProfilePreviewCardProps`, `FontSizeControllerProps`, `TextScaleControllerProps`, `TextScaleStep`, `FontFamilyPreset`, `ContrastModeValue`, `ContrastPalette`, `LineHeightControllerProps`, `LetterSpacingControllerProps`, `WordSpacingControllerProps`, `ParagraphSpacingControllerProps`, `ScriptSpacingConstraints`, `SkipToMainLinkProps`, `HideImagesControllerProps`, `BigCursorControllerProps`, `ReadingMaskControllerProps`, `ReadingGuideControllerProps`, `TooltipsControllerProps`, `PageNavigatorControllerProps`, `HeadingItem`, `LandmarkItem`, `ProfilesControllerProps`, `ActiveProfileState`, `UseProfilesResult`, `AccessibilityPreferences`, `ContrastMode`, `CursorSizePreference`, `FontFamilyPreference`, `ProfileDefinition`, `ProfilePresetId`, `ReaderMode`, `SaturationPreference`, `StorageMode`, `TextAlignPreference`, `LocaleStrings`, `PresetsControllerProps`, `CustomPreset`, `PresetsExportV1`, `ImportResult`, `UsePresetsResult`.
54
+ Exported types: `AccessibilityPluginProps`, `AccessibilityButtonProps`, `AccessibilityListProps`, `AccessibilityState`, `AccessibilityContextValue`, `PluginPosition`, `WidgetPlacement`, `FeatureOptions<T>`, `FeatureRegistration`, `ToggleControlProps`, `ChoiceControlProps`, `ChoiceOption<T>`, `ChoiceGroup<T>`, `StepperControlProps`, `FeatureCardProps`, `FeatureStatus`, `SearchCountProps`, `EmptyStateProps`, `ErrorStateProps`, `ProfilePreviewCardProps`, `FontSizeControllerProps`, `TextScaleControllerProps`, `TextScaleStep`, `FontFamilyPreset`, `ContrastModeValue`, `ContrastPalette`, `LineHeightControllerProps`, `LetterSpacingControllerProps`, `WordSpacingControllerProps`, `ParagraphSpacingControllerProps`, `ScriptSpacingConstraints`, `SkipToMainLinkProps`, `HideImagesControllerProps`, `BigCursorControllerProps`, `ReadingMaskControllerProps`, `ReadingGuideControllerProps`, `TooltipsControllerProps`, `PageNavigatorControllerProps`, `HeadingItem`, `LandmarkItem`, `ProfilesControllerProps`, `ActiveProfileState`, `UseProfilesResult`, `AccessibilityPreferences`, `ContrastMode`, `CursorSizePreference`, `FontFamilyPreference`, `ProfileDefinition`, `ProfilePresetId`, `ReaderMode`, `SaturationPreference`, `StorageMode`, `TextAlignPreference`, `LocaleStrings`, `SupportedLocale`, `FeatureLocaleLabels`, `PresetsControllerProps`, `CustomPreset`, `PresetsExportV1`, `ImportResult`, `UsePresetsResult`, `ReadingModeControllerProps`, `ArticleContent`.
55
55
 
56
- Exported control components: `ToggleControl`, `ChoiceControl`, `StepperControl`, `FeatureCard`, `SearchCount`, `EmptyState`, `ErrorState`, `ProfilePreviewCard`, `FontSizeController`, `TextScaleController`, `LineHeightController`, `LetterSpacingController`, `WordSpacingController`, `ParagraphSpacingController`, `FontFamilyController`, `TextAlignController`, `ContrastController`, `ContrastModeController`, `LinkHighlightController`, `HighlightFocusController`, `FocusHighlightController`, `ReduceMotionController`, `HideImagesController`, `HideDecorativeImagesController`, `BigCursorController`, `ReadingMaskController`, `ReadingGuideController`, `TooltipsController`, `AccessibleTooltipsController`, `PageNavigatorController`, `HeadingsNavigatorController`, `PageStructureController`, `ProfilesController`, `ProfileController`, `AccessibilityProfilesController`, `PresetsController`, `CustomPresetsController`, `SettingsImportExportController`, `PresetsBackupController`, `SkipToMainLink`.
56
+ Exported control components: `ToggleControl`, `ChoiceControl`, `StepperControl`, `FeatureCard`, `SearchCount`, `EmptyState`, `ErrorState`, `ProfilePreviewCard`, `FontSizeController`, `TextScaleController`, `LineHeightController`, `LetterSpacingController`, `WordSpacingController`, `ParagraphSpacingController`, `FontFamilyController`, `TextAlignController`, `ContrastController`, `ContrastModeController`, `LinkHighlightController`, `HighlightFocusController`, `FocusHighlightController`, `ReduceMotionController`, `HideImagesController`, `HideDecorativeImagesController`, `BigCursorController`, `ReadingMaskController`, `ReadingGuideController`, `TooltipsController`, `AccessibleTooltipsController`, `PageNavigatorController`, `HeadingsNavigatorController`, `PageStructureController`, `ProfilesController`, `ProfileController`, `AccessibilityProfilesController`, `PresetsController`, `CustomPresetsController`, `SettingsImportExportController`, `PresetsBackupController`, `ReadingModeController`, `SkipToMainLink`.
57
57
 
58
- Exported typography, contrast, reading aids, tooltips, and reflow utilities: `TEXT_SCALE_STEPS`, `TEXT_SCALE_PROTECTED_SELECTOR`, `isProtectedFromTextScale`, `LINE_HEIGHT_STEPS`, `LINE_HEIGHT_RATIOS`, `TEXT_SPACING_EXCLUDED_SELECTOR`, `isProtectedFromTextSpacing`, `getScriptSpacingConstraints`, `FONT_FAMILY_PRESETS`, `LEGIBLE_FONT_STACK`, `DYSLEXIA_FONT_STACK`, `FONT_FAMILY_PROTECTED_SELECTOR`, `isProtectedFromFontFamily`, `TEXT_ALIGN_BLOCK_SELECTOR`, `isProtectedFromTextAlign`, `CONTRAST_MODES`, `isForcedColorsActive`, `subscribeForcedColors`, `isReducedMotionActive`, `subscribeReducedMotion`, `isEligibleDecorativeImage`, `isFunctionalOrMeaningfulImage`, `hasFinePointer`, `subscribeFinePointer`, `nudgeReadingAid`, `DEFAULT_READING_MASK_HEIGHT`, `MIN_READING_MASK_HEIGHT`, `MAX_READING_MASK_HEIGHT`, `READING_MASK_HEIGHT_PRESETS`, `getAuthoredDescription`, `positionTooltip`, `enableAccessibleTooltips`, `scanHeadings`, `scanLandmarks`, `navigateToElement`, `subscribePageStructure`, `useProfiles`, `ALL_PROFILE_IDS`, `getProfileDefinition`, `mapProfileSettingsToFeatures`, `mapFeaturesToProfileSettings`, `applyProfileToStore`, `revertProfileFromStore`, `recordProfileOverride`, `usePresets`, `createCustomPreset`, `isValidCustomPreset`, `exportPresetsToJson`, `downloadJsonFile`, `validateAndParseImport`, `applyCustomPresetToStore`, `sanitizePreferences`, `ALLOWED_PREFERENCE_KEYS`, `CONTRAST_PROTECTED_SELECTOR`, `isProtectedFromContrast`, `CONTRAST_PALETTES`, `findMainLandmark`.
58
+ Exported typography, contrast, reading aids, tooltips, reading mode, and reflow utilities: `TEXT_SCALE_STEPS`, `TEXT_SCALE_PROTECTED_SELECTOR`, `isProtectedFromTextScale`, `LINE_HEIGHT_STEPS`, `LINE_HEIGHT_RATIOS`, `TEXT_SPACING_EXCLUDED_SELECTOR`, `isProtectedFromTextSpacing`, `getScriptSpacingConstraints`, `FONT_FAMILY_PRESETS`, `LEGIBLE_FONT_STACK`, `DYSLEXIA_FONT_STACK`, `FONT_FAMILY_PROTECTED_SELECTOR`, `isProtectedFromFontFamily`, `TEXT_ALIGN_BLOCK_SELECTOR`, `isProtectedFromTextAlign`, `CONTRAST_MODES`, `isForcedColorsActive`, `subscribeForcedColors`, `isReducedMotionActive`, `subscribeReducedMotion`, `isEligibleDecorativeImage`, `isFunctionalOrMeaningfulImage`, `hasFinePointer`, `subscribeFinePointer`, `nudgeReadingAid`, `DEFAULT_READING_MASK_HEIGHT`, `MIN_READING_MASK_HEIGHT`, `MAX_READING_MASK_HEIGHT`, `READING_MASK_HEIGHT_PRESETS`, `getAuthoredDescription`, `positionTooltip`, `enableAccessibleTooltips`, `scanHeadings`, `scanLandmarks`, `navigateToElement`, `subscribePageStructure`, `useProfiles`, `ALL_PROFILE_IDS`, `getProfileDefinition`, `mapProfileSettingsToFeatures`, `mapFeaturesToProfileSettings`, `applyProfileToStore`, `revertProfileFromStore`, `recordProfileOverride`, `usePresets`, `createCustomPreset`, `isValidCustomPreset`, `exportPresetsToJson`, `downloadJsonFile`, `validateAndParseImport`, `applyCustomPresetToStore`, `sanitizePreferences`, `ALLOWED_PREFERENCE_KEYS`, `extractArticleContent`, `findArticleCandidate`, `countWords`, `estimateReadingTime`, `CONTRAST_PROTECTED_SELECTOR`, `isProtectedFromContrast`, `CONTRAST_PALETTES`, `findMainLandmark`.
59
59
 
60
60
  Exported preference and profile utilities: `DEFAULT_PREFERENCES`, `PROFILE_DEFINITIONS`, `normalizePreferences`, `normalizePreferenceValue`, `resolveEffectivePreferences`, `preferencesReducer`, `createInitialPreferencesState`.
61
61
 
62
- Exported localization utilities: `enLocale`, `registerLocale`, `resolveLocaleStrings`, `isRtlLocale`.
62
+ Exported localization utilities: `enLocale`, `siLocale`, `taLocale`, `registerLocale`, `resolveLocaleStrings`, `isRtlLocale`.
63
63
 
64
64
  ## Styling and labels
65
65
 
@@ -98,8 +98,8 @@ completed. Closing a child issue does not replace the milestone exit review.
98
98
  - [x] [A11Y-303 — Page headings and landmarks navigator #51](https://github.com/prabothcharith/accessibility-react/issues/51) — Build a read-only headings/landmarks navigator that scrolls and focuses safely, updates dynamic routes and never invents semantics.
99
99
  - [x] [A11Y-304 — Eight profiles and deterministic override model #52](https://github.com/prabothcharith/accessibility-react/issues/52) — Implement eight neutral editable profiles with previews, atomic application, explicit override layering and no implicit speech or microphone activation.
100
100
  - [x] [A11Y-305 — Custom saved presets and settings import/export #53](https://github.com/prabothcharith/accessibility-react/issues/53) — Add named custom presets and validated versioned JSON import/export that excludes personal content and handles malformed data clearly.
101
- - [ ] [A11Y-306 — Sinhala and Tamil locale packs with accessibility review #54](https://github.com/prabothcharith/accessibility-react/issues/54) — Add reviewed Sinhala and Tamil widget locale packs and verify glyphs, long labels, search, announcements, fallback and assistive use.
102
- - [ ] [A11Y-307 — Non-destructive reading mode proof of concept #55](https://github.com/prabothcharith/accessibility-react/issues/55) — Prototype safe article-focused reading mode without rewriting host DOM, losing content, breaking focus or sending content externally.
101
+ - [x] [A11Y-306 — Sinhala and Tamil locale packs with accessibility review #54](https://github.com/prabothcharith/accessibility-react/issues/54) — Add reviewed Sinhala and Tamil widget locale packs and verify glyphs, long labels, search, announcements, fallback and assistive use.
102
+ - [x] [A11Y-307 — Non-destructive reading mode proof of concept #55](https://github.com/prabothcharith/accessibility-react/issues/55) — Prototype safe article-focused reading mode without rewriting host DOM, losing content, breaking focus or sending content externally.
103
103
  - [ ] [A11Y-308 — Keyboard shortcut help, remapping and link explorer #56](https://github.com/prabothcharith/accessibility-react/issues/56) — Add discoverable shortcut and heading-navigation help, collision-safe remapping and link exploration without hijacking browser or host commands.
104
104
 
105
105
  ### M4 — Advanced and experimental controls
package/docs/FEATURES.md CHANGED
@@ -30,6 +30,8 @@ All features are opt-in via controllers, use native buttons, support Enter/Space
30
30
  | PageNavigatorController / HeadingsNavigatorController / PageStructureController | Action dialog; no persistent preference | Scans real DOM headings (`h1`–`h6`) and named landmarks (`banner`, `navigation`, `main`, `region`, etc.). Safe scroll and focus with temporary tabindex cleanup, live mutation updates without loops, and search filtering. See docs/PAGE_NAVIGATOR.md. |
31
31
  | ProfilesController / ProfileController / AccessibilityProfilesController | activeProfile; ProfilePresetId / null | Previews, applies, and reverts eight neutral presets (Motor, Blind, Color Blind, Dyslexia, Low Vision, Cognitive, Seizure, ADHD). Follows deterministic override model where user explicit choices survive reversal. Zero implicit audio/mic. See docs/PROFILES.md. |
32
32
  | PresetsController / CustomPresetsController / SettingsImportExportController | customPresets; CustomPreset[] | Saves named user presets, 1-click apply/delete, and versioned JSON backup and transfer. Strict privacy exclusions discard private data, transcripts, and credentials. Saved presets library survives display reset. See docs/PRESETS.md. |
33
+ | Locales & i18n (`en`, `si`, `si-LK`, `ta`, `ta-LK`) | LocaleStrings / `locale` prop | Reviewed English, Sinhala, and Tamil locale packs with typography fallbacks and full RTL infrastructure. Automatic `document.documentElement.lang` resolution; host content is never translated. See docs/LOCALES.md. |
34
+ | ReadingModeController / readingMode | false; boolean | Non-destructive article extraction into an accessible overlay dialog. Preserves headings, links, images, and alt text while stripping forms, navigation, and sensitive fields. Supports Light/Sepia/Dark themes and zoom. See docs/READING_MODE.md. |
33
35
  | ResetController | No feature state | Clears display settings including custom/unmounted controls, preserves widget placement; runs legacy reset callbacks; keeps panel open. |
34
36
 
35
37
  ## Accessible control primitives and UI states
@@ -0,0 +1,149 @@
1
+ # Internationalization and Locale Packs
2
+
3
+ The `accessibility-plugin-react` library includes built-in, native-speaker and accessibility-reviewed localization packs for English (`en`), Sinhala (`si`, `si-LK`), and Tamil (`ta`, `ta-LK`), along with full infrastructure for Right-to-Left (RTL) writing directions and custom locale registrations.
4
+
5
+ ## Guiding Principles & Privacy
6
+
7
+ 1. **Widget Scope Only**: The library's localization only translates the accessibility plugin's own widget controls, headings, hints, options, and live announcements.
8
+ 2. **Untranslated Host Content**: Author host content (article paragraphs, site navigation, headings, form inputs) is **never** translated or modified by the plugin.
9
+ 3. **No External Network Dependencies**: All locale strings are bundled statically. No remote dictionary APIs, external translation calls, or telemetry exist.
10
+ 4. **HTML `lang` Auto-Detection**: When the `locale` prop is omitted, the widget automatically detects `document.documentElement.lang` (e.g. `<html lang="si-LK">` or `<html lang="ta-LK">`) and applies the appropriate dictionary, falling back to English.
11
+ 5. **No Google Translate Mangling**: The root panel is tagged with `translate="no"`, preventing browser auto-translators from altering widget ARIA states or numeric steppers.
12
+
13
+ ---
14
+
15
+ ## Supported Built-in Locales
16
+
17
+ | Locale Code | Language | Variant Codes | Script / Writing Direction | Script Fallback Fonts |
18
+ | ----------- | --------------- | ---------------------------- | -------------------------- | ------------------------------------------------------------------- |
19
+ | `en` | English | `en`, `en-US`, `en-GB`, etc. | Latin / LTR | system-ui, sans-serif |
20
+ | `si` | Sinhala (සිංහල) | `si`, `si-LK` | Sinhala / LTR | `"Noto Sans Sinhala"`, `"Iskoola Pota"`, `"Nirmala UI"`, sans-serif |
21
+ | `ta` | Tamil (தமிழ்) | `ta`, `ta-LK`, `ta-IN` | Tamil / LTR | `"Noto Sans Tamil"`, `"Latha"`, `"Nirmala UI"`, sans-serif |
22
+
23
+ ---
24
+
25
+ ## Typography & Script Fallbacks
26
+
27
+ Sinhala and Tamil are complex Brahmi scripts containing consonant conjuncts, touching characters, and dependent vowel signs. To ensure complex glyphs never clip or render with missing glpyh boxes ("tofu"), the plugin includes typography fallbacks in its scoped styling and typography features:
28
+
29
+ ```css
30
+ /* Scoped fallback stack in .arap-root */
31
+ font:
32
+ 15px/1.5 system-ui,
33
+ -apple-system,
34
+ BlinkMacSystemFont,
35
+ "Segoe UI",
36
+ Roboto,
37
+ "Noto Sans Sinhala",
38
+ "Iskoola Pota",
39
+ "Noto Sans Tamil",
40
+ "Latha",
41
+ "Nirmala UI",
42
+ sans-serif;
43
+ ```
44
+
45
+ When users activate legible font features (via `FontFamilyController`), these scripts are protected and prioritized with verified open-license fonts (Noto Sans Sinhala / Noto Sans Tamil).
46
+
47
+ ---
48
+
49
+ ## Right-to-Left (RTL) Infrastructure
50
+
51
+ While Sinhala and Tamil are Left-to-Right (LTR) languages, the library includes complete RTL support for bidirectional locales (such as Arabic `ar`, Hebrew `he`, Persian `fa`, Urdu `ur`):
52
+
53
+ - **Automatic Direction Assignment**: When an RTL locale is detected via `isRtlLocale(locale)`, the panel element receives `dir="rtl"`.
54
+ - **Bidirectional Alignment**: The widget defaults to `text-align: start`, naturally aligning right in RTL and left in LTR.
55
+ - **Header Alignment**: Close button and heading automatically align in accordance with reading direction.
56
+ - **Spatial Controls Protection**: Movement arrow keys (`arap-position-arrows`) maintain spatial geometry (`← ↑ ↓ →`) regardless of writing direction.
57
+
58
+ ---
59
+
60
+ ## Usage Examples
61
+
62
+ ### 1. Specifying Locale on the Provider
63
+
64
+ ```tsx
65
+ import {
66
+ AccessibilityPlugin,
67
+ AccessibilityButton,
68
+ AccessibilityList,
69
+ TextScaleController,
70
+ ResetController,
71
+ } from "accessibility-plugin-react";
72
+
73
+ export function App() {
74
+ return (
75
+ <AccessibilityPlugin locale="si-LK">
76
+ <AccessibilityButton />
77
+ <AccessibilityList>
78
+ <TextScaleController />
79
+ <ResetController />
80
+ </AccessibilityList>
81
+ </AccessibilityPlugin>
82
+ );
83
+ }
84
+ ```
85
+
86
+ ### 2. Automatic Detection via Document Lang
87
+
88
+ If your application sets `<html lang="ta-LK">`, simply render the plugin without the `locale` prop:
89
+
90
+ ```tsx
91
+ // Document: <html lang="ta-LK">
92
+ <AccessibilityPlugin>
93
+ <AccessibilityButton />
94
+ <AccessibilityList>
95
+ <TextScaleController />
96
+ <ResetController />
97
+ </AccessibilityList>
98
+ </AccessibilityPlugin>
99
+ // Automatically renders in Tamil ("அணுகல்தன்மை அமைப்புகள்", "பெரிய உரை", "அனைத்தையும் மீட்டமை")
100
+ ```
101
+
102
+ ### 3. Registering a Custom Locale
103
+
104
+ You can register custom language packs using `registerLocale`:
105
+
106
+ ```tsx
107
+ import {
108
+ registerLocale,
109
+ enLocale,
110
+ type LocaleStrings,
111
+ } from "accessibility-plugin-react";
112
+
113
+ const frenchLocale: LocaleStrings = {
114
+ ...enLocale,
115
+ title: "Paramètres d'accessibilité",
116
+ description: "Ajustez votre expérience de lecture",
117
+ closeLabel: "Fermer les paramètres d'accessibilité",
118
+ resetAll: "Tout réinitialiser",
119
+ buttonTitle: "Accessibilité",
120
+ };
121
+
122
+ registerLocale("fr", frenchLocale);
123
+
124
+ // Now <AccessibilityPlugin locale="fr-FR"> resolves frenchLocale!
125
+ ```
126
+
127
+ ---
128
+
129
+ ## Reviewed Vocabulary Summary
130
+
131
+ ### Sinhala (`si-LK`)
132
+
133
+ - **Title**: ප්‍රවේශ්‍යතා සැකසුම් (Accessibility settings)
134
+ - **Description**: ඔබේ කියවීමේ අත්දැකීම සකසා ගන්න (Adjust your reading experience)
135
+ - **Close**: ප්‍රවේශ්‍යතා සැකසුම් වසන්න (Close accessibility settings)
136
+ - **Reset All**: සියල්ල යළි සකසන්න (Reset All)
137
+ - **Move button**: බොත්තම ගෙනයන්න (Move button)
138
+ - **Button position**: බොත්තමේ පිහිටීම (Button position)
139
+ - **Statement**: ප්‍රවේශ්‍යතා ප්‍රකාශය (Accessibility Statement)
140
+
141
+ ### Tamil (`ta-LK`)
142
+
143
+ - **Title**: அணுகல்தன்மை அமைப்புகள் (Accessibility settings)
144
+ - **Description**: உங்கள் வாசிப்பு அனுபவத்தை மாற்றியமைக்கவும் (Adjust your reading experience)
145
+ - **Close**: அணுகல்தன்மை அமைப்புகளை மூடுக (Close accessibility settings)
146
+ - **Reset All**: அனைத்தையும் மீட்டமை (Reset All)
147
+ - **Move button**: பொத்தானை நகர்த்து (Move button)
148
+ - **Button position**: பொத்தான் அமைவிடம் (Button position)
149
+ - **Statement**: அணுகல்தன்மை அறிக்கை (Accessibility Statement)