accessibility-plugin-react 2.9.0 → 2.10.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/README.md +21 -21
- package/dist/index.d.mts +18 -2
- package/dist/index.d.ts +18 -2
- package/dist/index.js +128 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +125 -6
- package/dist/index.mjs.map +1 -1
- package/docs/API.md +3 -3
- package/docs/BUILD_AND_RELEASE_PLAN.md +1 -1
- package/docs/DECORATIVE_IMAGES.md +176 -0
- package/docs/FEATURES.md +25 -25
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -88,27 +88,27 @@ export function App() {
|
|
|
88
88
|
Every controller is opt-in. Add only the controls that make sense for your
|
|
89
89
|
site, and choose their order in JSX.
|
|
90
90
|
|
|
91
|
-
| Controller
|
|
92
|
-
|
|
|
93
|
-
| `TextScaleController`
|
|
94
|
-
| `FontSizeController`
|
|
95
|
-
| `LineHeightController`
|
|
96
|
-
| `LetterSpacingController`
|
|
97
|
-
| `WordSpacingController`
|
|
98
|
-
| `ContrastController`
|
|
99
|
-
| `ContrastModeController`
|
|
100
|
-
| `SaturationController`
|
|
101
|
-
| `InvertColorsController`
|
|
102
|
-
| `GrayscaleController`
|
|
103
|
-
| `LinkHighlightController`
|
|
104
|
-
| `TextAlignController`
|
|
105
|
-
| `FontFamilyController`
|
|
106
|
-
| `HideImagesController`
|
|
107
|
-
| `HideVideosController`
|
|
108
|
-
| `BigCursorController`
|
|
109
|
-
| `ReadingMaskController`
|
|
110
|
-
| `ReadingGuideController`
|
|
111
|
-
| `ResetController`
|
|
91
|
+
| Controller | Effect |
|
|
92
|
+
| --------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- |
|
|
93
|
+
| `TextScaleController` | Stepwise reflow-safe text enlargement (1.0x, 1.125x, 1.25x, 1.5x, 2.0x) protecting forms, code, and icons. |
|
|
94
|
+
| `FontSizeController` | Scales eligible HTML text from 50% to 200%; supports continuous 10% steps or `stepScale` mode. |
|
|
95
|
+
| `LineHeightController` | Scales computed line height (50%–200%, step 10); supports `stepPresets` (100%, 150%, 175%, 200%). |
|
|
96
|
+
| `LetterSpacingController` | Applies 0–10px letter spacing with automatic cursive (Arabic/RTL) and Indic (Sinhala/Tamil) protection. |
|
|
97
|
+
| `WordSpacingController` | Applies 0–10px word spacing while protecting tables, code, forms, and widget internals. |
|
|
98
|
+
| `ContrastController` | Adjusts contrast levels, palettes, or semantic modes while preserving images, video, charts, and validation. |
|
|
99
|
+
| `ContrastModeController` | Applies light, dark, high contrast, or media-safe invert tokens with native forced-colors protection. |
|
|
100
|
+
| `SaturationController` | Reduces or increases saturation. |
|
|
101
|
+
| `InvertColorsController` | Inverts eligible page content. |
|
|
102
|
+
| `GrayscaleController` | Removes color while preserving the selected saturation value for later. |
|
|
103
|
+
| `LinkHighlightController` | Highlights links or selects a link palette. |
|
|
104
|
+
| `TextAlignController` | Scopes left, center, right, or justified alignment to text blocks; warns about justification. |
|
|
105
|
+
| `FontFamilyController` | Applies clean system-ui or OpenDyslexic with Sinhala/Tamil fallbacks while protecting code and icons. |
|
|
106
|
+
| `HideImagesController` / `HideDecorativeImagesController` | Hides only eligible decorative images while preserving controls, CAPTCHA, charts, maps, and informative graphics. |
|
|
107
|
+
| `HideVideosController` | Hides video elements and recognized YouTube/Vimeo embeds visually. |
|
|
108
|
+
| `BigCursorController` | Applies a larger high-contrast cursor where supported. |
|
|
109
|
+
| `ReadingMaskController` | Dims the page around a transparent reading window. |
|
|
110
|
+
| `ReadingGuideController` | Follows pointer/focus with a reading guide line. |
|
|
111
|
+
| `ResetController` | Resets display features and custom registered features without moving the widget. |
|
|
112
112
|
|
|
113
113
|
Effects compose where appropriate. For example, contrast, saturation, invert,
|
|
114
114
|
and grayscale are applied in a deterministic order. Defaults leave host styles
|
package/dist/index.d.mts
CHANGED
|
@@ -437,6 +437,18 @@ interface ScriptSpacingConstraints {
|
|
|
437
437
|
script: "cursive" | "indic" | "standard";
|
|
438
438
|
}
|
|
439
439
|
declare function getScriptSpacingConstraints(element: HTMLElement): ScriptSpacingConstraints;
|
|
440
|
+
/**
|
|
441
|
+
* Determines whether an element represents functional, informative, or protected visual content
|
|
442
|
+
* (e.g., interactive controls, CAPTCHA, charts, graphs, maps, QR codes, or images with meaningful alt/names).
|
|
443
|
+
* Such content must NEVER be hidden by decorative image preferences.
|
|
444
|
+
*/
|
|
445
|
+
declare function isFunctionalOrMeaningfulImage(el: Element): boolean;
|
|
446
|
+
/**
|
|
447
|
+
* Determines whether an element represents an eligible decorative image that is safe to hide.
|
|
448
|
+
* An image is eligible if it is not functional or meaningful, and meets standard decorative cues
|
|
449
|
+
* (empty alt="", role="presentation", role="none", aria-hidden="true", or decorative class/attribute).
|
|
450
|
+
*/
|
|
451
|
+
declare function isEligibleDecorativeImage(el: Element): boolean;
|
|
440
452
|
|
|
441
453
|
interface LineHeightControllerProps {
|
|
442
454
|
/**
|
|
@@ -491,7 +503,11 @@ declare function TextAlignController(): react.JSX.Element;
|
|
|
491
503
|
|
|
492
504
|
declare function FontFamilyController(): react.JSX.Element;
|
|
493
505
|
|
|
494
|
-
|
|
506
|
+
interface HideImagesControllerProps {
|
|
507
|
+
label?: string;
|
|
508
|
+
}
|
|
509
|
+
declare function HideImagesController({ label, }?: HideImagesControllerProps): react.JSX.Element;
|
|
510
|
+
declare const HideDecorativeImagesController: typeof HideImagesController;
|
|
495
511
|
|
|
496
512
|
declare function HideVideosController(): react.JSX.Element;
|
|
497
513
|
|
|
@@ -518,4 +534,4 @@ declare function ReduceMotionController(): react.JSX.Element;
|
|
|
518
534
|
|
|
519
535
|
declare function ResetController(): react.JSX.Element;
|
|
520
536
|
|
|
521
|
-
export { AccessibilityButton, type AccessibilityButtonProps, AccessibilityContext, type AccessibilityContextValue, AccessibilityList, type AccessibilityListProps, AccessibilityPlugin, type AccessibilityPluginProps, type AccessibilityPreferences, type AccessibilityState, BigCursorController, CONTRAST_MODES, CONTRAST_PALETTES, CONTRAST_PROTECTED_SELECTOR, ChoiceControl, type ChoiceControlProps, type ChoiceGroup, type ChoiceOption, ContrastController, type ContrastMode, ContrastModeController, type ContrastModeValue, type ContrastPalette, type CursorSizePreference, DEFAULT_PREFERENCES, DYSLEXIA_FONT_STACK, EmptyState, type EmptyStateProps, ErrorState, type ErrorStateProps, FONT_FAMILY_PRESETS, FONT_FAMILY_PROTECTED_SELECTOR, FeatureCard, type FeatureCardProps, type FeatureOptions, type FeatureRegistration, type FeatureStatus, FocusHighlightController, FontFamilyController, type FontFamilyPreference, type FontFamilyPreset, FontSizeController, type FontSizeControllerProps, GrayscaleController, HideImagesController, HideVideosController, HighlightFocusController, InvertColorsController, LEGIBLE_FONT_STACK, LINE_HEIGHT_RATIOS, LINE_HEIGHT_STEPS, LetterSpacingController, type LetterSpacingControllerProps, LineHeightController, type LineHeightControllerProps, LinkHighlightController, type LocaleStrings, PROFILE_DEFINITIONS, ParagraphSpacingController, type ParagraphSpacingControllerProps, type PluginPosition, type ProfileDefinition, type ProfilePresetId, ProfilePreviewCard, type ProfilePreviewCardProps, type ReaderMode, ReadingGuideController, ReadingMaskController, ReduceMotionController, ResetController, SaturationController, type SaturationPreference, type ScriptSpacingConstraints, SearchCount, type SearchCountProps, SkipToMainLink, type SkipToMainLinkProps, StepperControl, type StepperControlProps, type StorageMode, type SupportedLocale, TEXT_ALIGN_BLOCK_SELECTOR, TEXT_SCALE_PROTECTED_SELECTOR, TEXT_SCALE_STEPS, TEXT_SPACING_EXCLUDED_SELECTOR, TextAlignController, type TextAlignPreference, TextScaleController, type TextScaleControllerProps, type TextScaleStep, ToggleControl, type ToggleControlProps, type WidgetPlacement, WordSpacingController, type WordSpacingControllerProps, createInitialPreferencesState, enLocale, findMainLandmark, getScriptSpacingConstraints, isForcedColorsActive, isProtectedFromContrast, isProtectedFromFontFamily, isProtectedFromTextAlign, isProtectedFromTextScale, isProtectedFromTextSpacing, isReducedMotionActive, isRtlLocale, normalizePreferenceValue, normalizePreferences, preferencesReducer, registerLocale, resolveEffectivePreferences, resolveLocaleStrings, subscribeForcedColors, subscribeReducedMotion, useAccessibility };
|
|
537
|
+
export { AccessibilityButton, type AccessibilityButtonProps, AccessibilityContext, type AccessibilityContextValue, AccessibilityList, type AccessibilityListProps, AccessibilityPlugin, type AccessibilityPluginProps, type AccessibilityPreferences, type AccessibilityState, BigCursorController, CONTRAST_MODES, CONTRAST_PALETTES, CONTRAST_PROTECTED_SELECTOR, ChoiceControl, type ChoiceControlProps, type ChoiceGroup, type ChoiceOption, ContrastController, type ContrastMode, ContrastModeController, type ContrastModeValue, type ContrastPalette, type CursorSizePreference, DEFAULT_PREFERENCES, DYSLEXIA_FONT_STACK, EmptyState, type EmptyStateProps, ErrorState, type ErrorStateProps, FONT_FAMILY_PRESETS, FONT_FAMILY_PROTECTED_SELECTOR, FeatureCard, type FeatureCardProps, type FeatureOptions, type FeatureRegistration, type FeatureStatus, FocusHighlightController, FontFamilyController, type FontFamilyPreference, type FontFamilyPreset, FontSizeController, type FontSizeControllerProps, GrayscaleController, HideDecorativeImagesController, HideImagesController, type HideImagesControllerProps, HideVideosController, HighlightFocusController, InvertColorsController, LEGIBLE_FONT_STACK, LINE_HEIGHT_RATIOS, LINE_HEIGHT_STEPS, LetterSpacingController, type LetterSpacingControllerProps, LineHeightController, type LineHeightControllerProps, LinkHighlightController, type LocaleStrings, PROFILE_DEFINITIONS, ParagraphSpacingController, type ParagraphSpacingControllerProps, type PluginPosition, type ProfileDefinition, type ProfilePresetId, ProfilePreviewCard, type ProfilePreviewCardProps, type ReaderMode, ReadingGuideController, ReadingMaskController, ReduceMotionController, ResetController, SaturationController, type SaturationPreference, type ScriptSpacingConstraints, SearchCount, type SearchCountProps, SkipToMainLink, type SkipToMainLinkProps, StepperControl, type StepperControlProps, type StorageMode, type SupportedLocale, TEXT_ALIGN_BLOCK_SELECTOR, TEXT_SCALE_PROTECTED_SELECTOR, TEXT_SCALE_STEPS, TEXT_SPACING_EXCLUDED_SELECTOR, TextAlignController, type TextAlignPreference, TextScaleController, type TextScaleControllerProps, type TextScaleStep, ToggleControl, type ToggleControlProps, type WidgetPlacement, WordSpacingController, type WordSpacingControllerProps, createInitialPreferencesState, enLocale, findMainLandmark, getScriptSpacingConstraints, isEligibleDecorativeImage, isForcedColorsActive, isFunctionalOrMeaningfulImage, isProtectedFromContrast, isProtectedFromFontFamily, isProtectedFromTextAlign, isProtectedFromTextScale, isProtectedFromTextSpacing, isReducedMotionActive, isRtlLocale, normalizePreferenceValue, normalizePreferences, preferencesReducer, registerLocale, resolveEffectivePreferences, resolveLocaleStrings, subscribeForcedColors, subscribeReducedMotion, useAccessibility };
|
package/dist/index.d.ts
CHANGED
|
@@ -437,6 +437,18 @@ interface ScriptSpacingConstraints {
|
|
|
437
437
|
script: "cursive" | "indic" | "standard";
|
|
438
438
|
}
|
|
439
439
|
declare function getScriptSpacingConstraints(element: HTMLElement): ScriptSpacingConstraints;
|
|
440
|
+
/**
|
|
441
|
+
* Determines whether an element represents functional, informative, or protected visual content
|
|
442
|
+
* (e.g., interactive controls, CAPTCHA, charts, graphs, maps, QR codes, or images with meaningful alt/names).
|
|
443
|
+
* Such content must NEVER be hidden by decorative image preferences.
|
|
444
|
+
*/
|
|
445
|
+
declare function isFunctionalOrMeaningfulImage(el: Element): boolean;
|
|
446
|
+
/**
|
|
447
|
+
* Determines whether an element represents an eligible decorative image that is safe to hide.
|
|
448
|
+
* An image is eligible if it is not functional or meaningful, and meets standard decorative cues
|
|
449
|
+
* (empty alt="", role="presentation", role="none", aria-hidden="true", or decorative class/attribute).
|
|
450
|
+
*/
|
|
451
|
+
declare function isEligibleDecorativeImage(el: Element): boolean;
|
|
440
452
|
|
|
441
453
|
interface LineHeightControllerProps {
|
|
442
454
|
/**
|
|
@@ -491,7 +503,11 @@ declare function TextAlignController(): react.JSX.Element;
|
|
|
491
503
|
|
|
492
504
|
declare function FontFamilyController(): react.JSX.Element;
|
|
493
505
|
|
|
494
|
-
|
|
506
|
+
interface HideImagesControllerProps {
|
|
507
|
+
label?: string;
|
|
508
|
+
}
|
|
509
|
+
declare function HideImagesController({ label, }?: HideImagesControllerProps): react.JSX.Element;
|
|
510
|
+
declare const HideDecorativeImagesController: typeof HideImagesController;
|
|
495
511
|
|
|
496
512
|
declare function HideVideosController(): react.JSX.Element;
|
|
497
513
|
|
|
@@ -518,4 +534,4 @@ declare function ReduceMotionController(): react.JSX.Element;
|
|
|
518
534
|
|
|
519
535
|
declare function ResetController(): react.JSX.Element;
|
|
520
536
|
|
|
521
|
-
export { AccessibilityButton, type AccessibilityButtonProps, AccessibilityContext, type AccessibilityContextValue, AccessibilityList, type AccessibilityListProps, AccessibilityPlugin, type AccessibilityPluginProps, type AccessibilityPreferences, type AccessibilityState, BigCursorController, CONTRAST_MODES, CONTRAST_PALETTES, CONTRAST_PROTECTED_SELECTOR, ChoiceControl, type ChoiceControlProps, type ChoiceGroup, type ChoiceOption, ContrastController, type ContrastMode, ContrastModeController, type ContrastModeValue, type ContrastPalette, type CursorSizePreference, DEFAULT_PREFERENCES, DYSLEXIA_FONT_STACK, EmptyState, type EmptyStateProps, ErrorState, type ErrorStateProps, FONT_FAMILY_PRESETS, FONT_FAMILY_PROTECTED_SELECTOR, FeatureCard, type FeatureCardProps, type FeatureOptions, type FeatureRegistration, type FeatureStatus, FocusHighlightController, FontFamilyController, type FontFamilyPreference, type FontFamilyPreset, FontSizeController, type FontSizeControllerProps, GrayscaleController, HideImagesController, HideVideosController, HighlightFocusController, InvertColorsController, LEGIBLE_FONT_STACK, LINE_HEIGHT_RATIOS, LINE_HEIGHT_STEPS, LetterSpacingController, type LetterSpacingControllerProps, LineHeightController, type LineHeightControllerProps, LinkHighlightController, type LocaleStrings, PROFILE_DEFINITIONS, ParagraphSpacingController, type ParagraphSpacingControllerProps, type PluginPosition, type ProfileDefinition, type ProfilePresetId, ProfilePreviewCard, type ProfilePreviewCardProps, type ReaderMode, ReadingGuideController, ReadingMaskController, ReduceMotionController, ResetController, SaturationController, type SaturationPreference, type ScriptSpacingConstraints, SearchCount, type SearchCountProps, SkipToMainLink, type SkipToMainLinkProps, StepperControl, type StepperControlProps, type StorageMode, type SupportedLocale, TEXT_ALIGN_BLOCK_SELECTOR, TEXT_SCALE_PROTECTED_SELECTOR, TEXT_SCALE_STEPS, TEXT_SPACING_EXCLUDED_SELECTOR, TextAlignController, type TextAlignPreference, TextScaleController, type TextScaleControllerProps, type TextScaleStep, ToggleControl, type ToggleControlProps, type WidgetPlacement, WordSpacingController, type WordSpacingControllerProps, createInitialPreferencesState, enLocale, findMainLandmark, getScriptSpacingConstraints, isForcedColorsActive, isProtectedFromContrast, isProtectedFromFontFamily, isProtectedFromTextAlign, isProtectedFromTextScale, isProtectedFromTextSpacing, isReducedMotionActive, isRtlLocale, normalizePreferenceValue, normalizePreferences, preferencesReducer, registerLocale, resolveEffectivePreferences, resolveLocaleStrings, subscribeForcedColors, subscribeReducedMotion, useAccessibility };
|
|
537
|
+
export { AccessibilityButton, type AccessibilityButtonProps, AccessibilityContext, type AccessibilityContextValue, AccessibilityList, type AccessibilityListProps, AccessibilityPlugin, type AccessibilityPluginProps, type AccessibilityPreferences, type AccessibilityState, BigCursorController, CONTRAST_MODES, CONTRAST_PALETTES, CONTRAST_PROTECTED_SELECTOR, ChoiceControl, type ChoiceControlProps, type ChoiceGroup, type ChoiceOption, ContrastController, type ContrastMode, ContrastModeController, type ContrastModeValue, type ContrastPalette, type CursorSizePreference, DEFAULT_PREFERENCES, DYSLEXIA_FONT_STACK, EmptyState, type EmptyStateProps, ErrorState, type ErrorStateProps, FONT_FAMILY_PRESETS, FONT_FAMILY_PROTECTED_SELECTOR, FeatureCard, type FeatureCardProps, type FeatureOptions, type FeatureRegistration, type FeatureStatus, FocusHighlightController, FontFamilyController, type FontFamilyPreference, type FontFamilyPreset, FontSizeController, type FontSizeControllerProps, GrayscaleController, HideDecorativeImagesController, HideImagesController, type HideImagesControllerProps, HideVideosController, HighlightFocusController, InvertColorsController, LEGIBLE_FONT_STACK, LINE_HEIGHT_RATIOS, LINE_HEIGHT_STEPS, LetterSpacingController, type LetterSpacingControllerProps, LineHeightController, type LineHeightControllerProps, LinkHighlightController, type LocaleStrings, PROFILE_DEFINITIONS, ParagraphSpacingController, type ParagraphSpacingControllerProps, type PluginPosition, type ProfileDefinition, type ProfilePresetId, ProfilePreviewCard, type ProfilePreviewCardProps, type ReaderMode, ReadingGuideController, ReadingMaskController, ReduceMotionController, ResetController, SaturationController, type SaturationPreference, type ScriptSpacingConstraints, SearchCount, type SearchCountProps, SkipToMainLink, type SkipToMainLinkProps, StepperControl, type StepperControlProps, type StorageMode, type SupportedLocale, TEXT_ALIGN_BLOCK_SELECTOR, TEXT_SCALE_PROTECTED_SELECTOR, TEXT_SCALE_STEPS, TEXT_SPACING_EXCLUDED_SELECTOR, TextAlignController, type TextAlignPreference, TextScaleController, type TextScaleControllerProps, type TextScaleStep, ToggleControl, type ToggleControlProps, type WidgetPlacement, WordSpacingController, type WordSpacingControllerProps, createInitialPreferencesState, enLocale, findMainLandmark, getScriptSpacingConstraints, isEligibleDecorativeImage, isForcedColorsActive, isFunctionalOrMeaningfulImage, isProtectedFromContrast, isProtectedFromFontFamily, isProtectedFromTextAlign, isProtectedFromTextScale, isProtectedFromTextSpacing, isReducedMotionActive, isRtlLocale, normalizePreferenceValue, normalizePreferences, preferencesReducer, registerLocale, resolveEffectivePreferences, resolveLocaleStrings, subscribeForcedColors, subscribeReducedMotion, useAccessibility };
|
package/dist/index.js
CHANGED
|
@@ -44,6 +44,7 @@ __export(index_exports, {
|
|
|
44
44
|
FontFamilyController: () => FontFamilyController,
|
|
45
45
|
FontSizeController: () => FontSizeController,
|
|
46
46
|
GrayscaleController: () => GrayscaleController,
|
|
47
|
+
HideDecorativeImagesController: () => HideDecorativeImagesController,
|
|
47
48
|
HideImagesController: () => HideImagesController,
|
|
48
49
|
HideVideosController: () => HideVideosController,
|
|
49
50
|
HighlightFocusController: () => HighlightFocusController,
|
|
@@ -77,7 +78,9 @@ __export(index_exports, {
|
|
|
77
78
|
enLocale: () => enLocale,
|
|
78
79
|
findMainLandmark: () => findMainLandmark,
|
|
79
80
|
getScriptSpacingConstraints: () => getScriptSpacingConstraints,
|
|
81
|
+
isEligibleDecorativeImage: () => isEligibleDecorativeImage,
|
|
80
82
|
isForcedColorsActive: () => isForcedColorsActive,
|
|
83
|
+
isFunctionalOrMeaningfulImage: () => isFunctionalOrMeaningfulImage,
|
|
81
84
|
isProtectedFromContrast: () => isProtectedFromContrast,
|
|
82
85
|
isProtectedFromFontFamily: () => isProtectedFromFontFamily,
|
|
83
86
|
isProtectedFromTextAlign: () => isProtectedFromTextAlign,
|
|
@@ -906,6 +909,104 @@ function getScriptSpacingConstraints(element) {
|
|
|
906
909
|
script: "standard"
|
|
907
910
|
};
|
|
908
911
|
}
|
|
912
|
+
function isFunctionalOrMeaningfulImage(el) {
|
|
913
|
+
try {
|
|
914
|
+
if (el.closest(
|
|
915
|
+
"a, button, [role='button'], [role='link'], [role='menuitem'], [role='tab'], input, select, textarea, summary"
|
|
916
|
+
)) {
|
|
917
|
+
return true;
|
|
918
|
+
}
|
|
919
|
+
if (el.closest(
|
|
920
|
+
"[id*='captcha' i], [class*='captcha' i], [aria-label*='captcha' i], [data-captcha]"
|
|
921
|
+
) || el.matches(
|
|
922
|
+
"[src*='captcha' i], [alt*='captcha' i], [title*='captcha' i], [id*='captcha' i], [class*='captcha' i]"
|
|
923
|
+
)) {
|
|
924
|
+
return true;
|
|
925
|
+
}
|
|
926
|
+
if (el.closest(
|
|
927
|
+
"[role='graphics-document'], [role='graphics-symbol'], [role='figure'], figure, [class*='chart' i], [id*='chart' i], [class*='graph' i], [id*='graph' i], [class*='diagram' i], [id*='diagram' i]"
|
|
928
|
+
) || el.matches(
|
|
929
|
+
"[role='graphics-document'], [role='graphics-symbol'], [aria-roledescription*='chart' i]"
|
|
930
|
+
)) {
|
|
931
|
+
return true;
|
|
932
|
+
}
|
|
933
|
+
if (el.closest(
|
|
934
|
+
"[role='region'][aria-label*='map' i], [class*='map' i], [id*='map' i], [data-map]"
|
|
935
|
+
) || el.matches(
|
|
936
|
+
"[src*='maps' i], [src*='tiles' i], [src*='openstreetmap' i], [src*='mapbox' i]"
|
|
937
|
+
)) {
|
|
938
|
+
return true;
|
|
939
|
+
}
|
|
940
|
+
if (el.closest(
|
|
941
|
+
"[class*='qr' i], [id*='qr' i], [class*='barcode' i], [id*='barcode' i]"
|
|
942
|
+
) || el.matches(
|
|
943
|
+
"[src*='qr' i], [alt*='qr' i], [src*='barcode' i], [alt*='barcode' i]"
|
|
944
|
+
)) {
|
|
945
|
+
return true;
|
|
946
|
+
}
|
|
947
|
+
if (el.closest("[role='math'], math, [class*='math' i]")) {
|
|
948
|
+
return true;
|
|
949
|
+
}
|
|
950
|
+
if (el.hasAttribute("alt")) {
|
|
951
|
+
const alt = el.getAttribute("alt")?.trim();
|
|
952
|
+
if (alt && alt.length > 0) return true;
|
|
953
|
+
}
|
|
954
|
+
if (el.hasAttribute("aria-label")) {
|
|
955
|
+
const label = el.getAttribute("aria-label")?.trim();
|
|
956
|
+
if (label && label.length > 0) return true;
|
|
957
|
+
}
|
|
958
|
+
if (el.hasAttribute("aria-labelledby")) {
|
|
959
|
+
const labelledby = el.getAttribute("aria-labelledby")?.trim();
|
|
960
|
+
if (labelledby && labelledby.length > 0) return true;
|
|
961
|
+
}
|
|
962
|
+
if (el.hasAttribute("title")) {
|
|
963
|
+
const title = el.getAttribute("title")?.trim();
|
|
964
|
+
if (title && title.length > 0) return true;
|
|
965
|
+
}
|
|
966
|
+
const role = el.getAttribute("role");
|
|
967
|
+
if (role && role !== "presentation" && role !== "none" && role !== "img") {
|
|
968
|
+
return true;
|
|
969
|
+
}
|
|
970
|
+
if (role === "img" && (el.hasAttribute("aria-label") || el.hasAttribute("aria-labelledby") || el.hasAttribute("title") || el.hasAttribute("alt") && el.getAttribute("alt")?.trim() !== "")) {
|
|
971
|
+
return true;
|
|
972
|
+
}
|
|
973
|
+
} catch {
|
|
974
|
+
return false;
|
|
975
|
+
}
|
|
976
|
+
return false;
|
|
977
|
+
}
|
|
978
|
+
function isEligibleDecorativeImage(el) {
|
|
979
|
+
try {
|
|
980
|
+
if (isFunctionalOrMeaningfulImage(el)) {
|
|
981
|
+
return false;
|
|
982
|
+
}
|
|
983
|
+
if (el.matches("img, picture")) {
|
|
984
|
+
if (el.hasAttribute("alt") && el.getAttribute("alt")?.trim() === "") {
|
|
985
|
+
return true;
|
|
986
|
+
}
|
|
987
|
+
const role = el.getAttribute("role");
|
|
988
|
+
if (role === "presentation" || role === "none") {
|
|
989
|
+
return true;
|
|
990
|
+
}
|
|
991
|
+
if (el.getAttribute("aria-hidden") === "true") {
|
|
992
|
+
return true;
|
|
993
|
+
}
|
|
994
|
+
if (el.hasAttribute("data-decorative") || el.classList.contains("decorative") || el.classList.contains("deco")) {
|
|
995
|
+
return true;
|
|
996
|
+
}
|
|
997
|
+
if (el.matches("picture")) {
|
|
998
|
+
const childImg = el.querySelector("img");
|
|
999
|
+
if (childImg && isEligibleDecorativeImage(childImg)) {
|
|
1000
|
+
return true;
|
|
1001
|
+
}
|
|
1002
|
+
}
|
|
1003
|
+
return false;
|
|
1004
|
+
}
|
|
1005
|
+
} catch {
|
|
1006
|
+
return false;
|
|
1007
|
+
}
|
|
1008
|
+
return false;
|
|
1009
|
+
}
|
|
909
1010
|
function applyPage(values) {
|
|
910
1011
|
const undo = [];
|
|
911
1012
|
function set(element, property, value) {
|
|
@@ -1216,8 +1317,23 @@ function applyPage(values) {
|
|
|
1216
1317
|
for (const el of elements) {
|
|
1217
1318
|
if (values.bigCursor) set(el, "cursor", cursor);
|
|
1218
1319
|
if (values.hideImages) {
|
|
1219
|
-
if (el
|
|
1220
|
-
|
|
1320
|
+
if (isEligibleDecorativeImage(el)) {
|
|
1321
|
+
set(el, "visibility", "hidden");
|
|
1322
|
+
}
|
|
1323
|
+
if (!isFunctionalOrMeaningfulImage(el)) {
|
|
1324
|
+
const inlineBg = el.style.backgroundImage;
|
|
1325
|
+
if (inlineBg && inlineBg !== "none") {
|
|
1326
|
+
set(el, "background-image", "none");
|
|
1327
|
+
} else {
|
|
1328
|
+
try {
|
|
1329
|
+
const computedBg = getComputedStyle(el).backgroundImage;
|
|
1330
|
+
if (computedBg && computedBg !== "none") {
|
|
1331
|
+
set(el, "background-image", "none");
|
|
1332
|
+
}
|
|
1333
|
+
} catch {
|
|
1334
|
+
}
|
|
1335
|
+
}
|
|
1336
|
+
}
|
|
1221
1337
|
}
|
|
1222
1338
|
if (values.hideVideos && el.matches(
|
|
1223
1339
|
'video, iframe[src*="youtube.com/embed/"], iframe[src*="youtube-nocookie.com/embed/"], iframe[src*="player.vimeo.com/video/"]'
|
|
@@ -3401,22 +3517,24 @@ function FontFamilyController() {
|
|
|
3401
3517
|
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
3402
3518
|
var FEATURE_KEY15 = "hideImages";
|
|
3403
3519
|
var DEFAULT_VALUE15 = false;
|
|
3404
|
-
function HideImagesController(
|
|
3520
|
+
function HideImagesController({
|
|
3521
|
+
label = "Hide Images"
|
|
3522
|
+
} = {}) {
|
|
3405
3523
|
const { value, setValue } = useAccessibility(
|
|
3406
3524
|
FEATURE_KEY15,
|
|
3407
3525
|
DEFAULT_VALUE15
|
|
3408
3526
|
);
|
|
3409
|
-
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "arap-feature", role: "group", "aria-label":
|
|
3527
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "arap-feature", role: "group", "aria-label": label, children: [
|
|
3410
3528
|
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("span", { className: "arap-label", children: [
|
|
3411
3529
|
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(FeatureIcon, { name: FEATURE_KEY15 }),
|
|
3412
|
-
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { children:
|
|
3530
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { children: label })
|
|
3413
3531
|
] }),
|
|
3414
3532
|
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
3415
3533
|
"button",
|
|
3416
3534
|
{
|
|
3417
3535
|
className: `arap-toggle ${value ? "arap-toggle-active" : ""}`,
|
|
3418
3536
|
onClick: () => setValue(!value),
|
|
3419
|
-
"aria-label":
|
|
3537
|
+
"aria-label": label,
|
|
3420
3538
|
"aria-pressed": value,
|
|
3421
3539
|
type: "button",
|
|
3422
3540
|
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "arap-toggle-knob", "aria-hidden": "true" })
|
|
@@ -3424,6 +3542,7 @@ function HideImagesController() {
|
|
|
3424
3542
|
)
|
|
3425
3543
|
] });
|
|
3426
3544
|
}
|
|
3545
|
+
var HideDecorativeImagesController = HideImagesController;
|
|
3427
3546
|
|
|
3428
3547
|
// src/features/HideVideosController.tsx
|
|
3429
3548
|
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
@@ -4144,6 +4263,7 @@ function ProfilePreviewCard({
|
|
|
4144
4263
|
FontFamilyController,
|
|
4145
4264
|
FontSizeController,
|
|
4146
4265
|
GrayscaleController,
|
|
4266
|
+
HideDecorativeImagesController,
|
|
4147
4267
|
HideImagesController,
|
|
4148
4268
|
HideVideosController,
|
|
4149
4269
|
HighlightFocusController,
|
|
@@ -4177,7 +4297,9 @@ function ProfilePreviewCard({
|
|
|
4177
4297
|
enLocale,
|
|
4178
4298
|
findMainLandmark,
|
|
4179
4299
|
getScriptSpacingConstraints,
|
|
4300
|
+
isEligibleDecorativeImage,
|
|
4180
4301
|
isForcedColorsActive,
|
|
4302
|
+
isFunctionalOrMeaningfulImage,
|
|
4181
4303
|
isProtectedFromContrast,
|
|
4182
4304
|
isProtectedFromFontFamily,
|
|
4183
4305
|
isProtectedFromTextAlign,
|