mirror of
https://gh.wpcy.net/https://github.com/elementor/one-click-accessibility.git
synced 2026-04-24 10:16:43 +08:00
159 lines
4.2 KiB
JavaScript
159 lines
4.2 KiB
JavaScript
import { __ } from '@wordpress/i18n';
|
|
|
|
export const TOP_BAR_LINK = document.querySelector(
|
|
'#wp-admin-bar-ea11y-scanner-wizard a',
|
|
);
|
|
|
|
export const ROOT_ID = 'ea11y-scanner-wizard-widget';
|
|
|
|
export const CURRENT_ELEMENT_CLASS = 'ea11y-scanner-current-element';
|
|
|
|
export const BLOCKS = {
|
|
main: 'main',
|
|
altText: 'altText',
|
|
dynamicContent: 'dynamicContent',
|
|
formsInputsError: 'formsInputsError',
|
|
keyboardAssistiveTech: 'keyboardAssistiveTech',
|
|
pageStructureNav: 'pageStructureNav',
|
|
other: 'other',
|
|
};
|
|
|
|
export const BLOCK_TITLES = {
|
|
altText: __('Alternative Text', 'pojo-accessibility'),
|
|
dynamicContent: __('ARIA roles & attributes', 'pojo-accessibility'),
|
|
formsInputsError: __('Forms & labels', 'pojo-accessibility'),
|
|
keyboardAssistiveTech: __('Keyboard & focus', 'pojo-accessibility'),
|
|
pageStructureNav: __('Responsive & zoom', 'pojo-accessibility'),
|
|
other: __('Uncategorized issues', 'pojo-accessibility'),
|
|
};
|
|
|
|
export const BLOCK_INFO = {
|
|
altText: __(
|
|
'Alt text helps visually impaired visitors using screen readers know what images show.',
|
|
'pojo-accessibility',
|
|
),
|
|
dynamicContent: __('Dynamic Content & ARIA', 'pojo-accessibility'),
|
|
formsInputsError: __('Forms & Input Errors', 'pojo-accessibility'),
|
|
keyboardAssistiveTech: __(
|
|
'Keyboard and Assistive Technologies',
|
|
'pojo-accessibility',
|
|
),
|
|
pageStructureNav: __('Page Structure & Navigation', 'pojo-accessibility'),
|
|
other: __('Other Accessibility Issues', 'pojo-accessibility'),
|
|
};
|
|
|
|
export const INITIAL_SORTED_VIOLATIONS = {
|
|
altText: [],
|
|
dynamicContent: [],
|
|
formsInputsError: [],
|
|
keyboardAssistiveTech: [],
|
|
pageStructureNav: [],
|
|
other: [],
|
|
};
|
|
|
|
export const VIOLATION_TYPES = {
|
|
altText: [
|
|
'applet_alt_exists',
|
|
'applet_alt_exists',
|
|
'img_alt_redundant',
|
|
'img_alt_redundant',
|
|
'img_alt_redundant',
|
|
'img_alt_valid',
|
|
'img_alt_valid',
|
|
'img_alt_valid',
|
|
'img_alt_null',
|
|
'area_alt_exists',
|
|
'imagebutton_alt_exists',
|
|
'imagemap_alt_exists',
|
|
'img_alt_decorative',
|
|
'object_text_exists',
|
|
'svg_graphics_labelled',
|
|
],
|
|
dynamicContent: [
|
|
'aria_parent_required',
|
|
'combobox_popup_reference',
|
|
'aria_activedescendant_valid',
|
|
'combobox_active_descendant',
|
|
'aria_role_valid',
|
|
'combobox_autocomplete_valid',
|
|
'combobox_focusable_elements',
|
|
'combobox_haspopup_valid',
|
|
'aria_descendant_valid',
|
|
'aria_role_allowed',
|
|
'aria_attribute_allowed',
|
|
'aria_attribute_conflict',
|
|
'aria_attribute_exists',
|
|
'aria_attribute_required',
|
|
'aria_attribute_value_valid',
|
|
'aria_eventhandler_role_valid',
|
|
'aria_id_unique',
|
|
'aria_widget_labelled',
|
|
'combobox_design_valid',
|
|
'element_id_unique',
|
|
'element_accesskey_unique',
|
|
'aria_attribute_valid',
|
|
],
|
|
formsInputsError: [
|
|
'input_checkboxes_grouped',
|
|
'fieldset_label_valid',
|
|
'form_label_unique',
|
|
'label_ref_valid',
|
|
'input_autocomplete_valid',
|
|
'error_message_exists',
|
|
'input_label_after',
|
|
'input_label_before',
|
|
'input_label_exists',
|
|
],
|
|
keyboardAssistiveTech: [
|
|
'aria_hidden_nontabbable',
|
|
'aria_activedescendant_tabindex_valid',
|
|
'aria_child_tabbable',
|
|
'element_scrollable_tabbable',
|
|
'iframe_interactive_tabbable',
|
|
'a_text_purpose',
|
|
'label_name_visible',
|
|
'html_lang_exists',
|
|
'html_lang_valid',
|
|
'element_lang_valid',
|
|
'input_haspopup_conflict',
|
|
'element_tabbable_role_valid',
|
|
],
|
|
pageStructureNav: [
|
|
'table_headers_ref_valid',
|
|
'table_scope_valid',
|
|
'table_headers_exists',
|
|
'table_headers_related',
|
|
'table_structure_misuse',
|
|
'dir_attribute_valid',
|
|
'aria_application_label_unique',
|
|
'aria_application_labelled',
|
|
'aria_article_label_unique',
|
|
'aria_banner_label_unique',
|
|
'aria_banner_single',
|
|
'aria_complementary_label_unique',
|
|
'aria_complementary_labelled',
|
|
'aria_content_in_landmark',
|
|
'aria_contentinfo_label_unique',
|
|
'aria_contentinfo_single',
|
|
'aria_document_label_unique',
|
|
'aria_form_label_unique',
|
|
'aria_landmark_name_unique',
|
|
'aria_main_label_unique',
|
|
'aria_navigation_label_unique',
|
|
'aria_region_label_unique',
|
|
'aria_region_labelled',
|
|
'aria_search_label_unique',
|
|
'aria_toolbar_label_unique',
|
|
'skip_main_exists',
|
|
'page_title_exists',
|
|
'frame_title_exists',
|
|
'list_children_valid',
|
|
'table_aria_descendants',
|
|
],
|
|
other: [
|
|
'element_orientation_unlocked',
|
|
'meta_redirect_optional',
|
|
'blink_elem_deprecated',
|
|
'marquee_elem_avoid',
|
|
],
|
|
};
|