uploadcare / blocks

Stack-agnostic library for uploading, processing, and editing images on-the-fly
https://uploadcare.com/docs/file-uploader/
MIT License
61 stars 13 forks source link

feat(a11y): added support in the CloudImageEditor #671

Closed egordidenko closed 2 weeks ago

egordidenko commented 1 month ago

Description

Checklist

Summary by CodeRabbit

coderabbitai[bot] commented 1 month ago

Walkthrough

This update includes several significant changes to improve accessibility, localization, and user interface components across the codebase. Notable adjustments include implementing accessibility features for various elements, enhancing button interactions, updating the localization keys for several languages, and refining styles and templates for user interfaces to improve functionality and user experience.

Changes

Files Change Summary
.stylelintrc.cjs Removed configuration setting appName: 'lr' for the plugin/stylelint-force-app-name-prefix plugin.
abstract/Block.js Introduced A11y import and added conditional checks to instantiate A11y within the Block class if it does not exist.
abstract/a11y.js Introduced a new file with the A11y class to manage accessibility features using keyux.
blocks/CloudImageEditor/src/EditorButtonControl.js Changed to set the tabIndex attribute of the first child element to 0 and wrapped content in a <button> element.
blocks/CloudImageEditor/src/EditorFilterControl.js Updated template to wrap its content inside a <button> element.
blocks/CloudImageEditor/src/EditorToolbar.js Added attributes like aria-role, aria-controls, and role in renderTabToggle and renderTabContent functions.
blocks/CloudImageEditor/src/css/buttons.css Introduced styling changes for buttons.
blocks/CloudImageEditor/src/css/common.css Added buttons.css import and modified various button controls and icon positioning styles.
blocks/CloudImageEditor/src/elements/button/LrBtnUi.js Added aria-role and aria-controls properties, modified active accessor behavior, and updated template to use <button>.
blocks/DropArea/DropArea.js Updated _onAreaClicked method to handle click and keydown events, added keydown event listener, and removal in destroy method.
blocks/FileItem/FileItem.js Added localization attributes (l10n) to buttons for editing and removing files.
blocks/FileItem/file-item.css Set pointer-events to none for svg elements within buttons.
blocks/Select/Select.js Removed the button element, displaying only a select dropdown element.
blocks/Select/select.css Updated styles to reflect changes in the Select class.
blocks/SourceBtn/SourceBtn.js Updated template to wrap content inside a <button> element.
blocks/SourceBtn/source-btn.css Applied styles to the button element within the lr-source-btn class.
demo/cloud-image-editor.html, demo/raw-inline.html, demo/... Added import statements for the keyux module.
locales/file-uploader/ar.js, locales/file-uploader/az.js, ... Added new localization keys for file item edit and remove buttons in various languages.

Poem

In code's vast and shifting sea,
We add accessibility, accessibility, and glee,
Buttons now with tabs refined,
Localization, enhancements combined,
A rabbit cheers with joyful zest,
For code that's clear, and at its best! 🐰✨


Tips ### Chat There are 3 ways to chat with [CodeRabbit](https://coderabbit.ai): - Review comments: Directly reply to a review comment made by CodeRabbit. Example: - `I pushed a fix in commit .` - `Generate unit testing code for this file.` - `Open a follow-up GitHub issue for this discussion.` - Files and specific lines of code (under the "Files changed" tab): Tag `@coderabbitai` in a new review comment at the desired location with your query. Examples: - `@coderabbitai generate unit testing code for this file.` - `@coderabbitai modularize this function.` - PR comments: Tag `@coderabbitai` in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples: - `@coderabbitai generate interesting stats about this repository and render them as a table.` - `@coderabbitai show all the console.log statements in this repository.` - `@coderabbitai read src/utils.ts and generate unit testing code.` - `@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.` - `@coderabbitai help me debug CodeRabbit configuration file.` Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. ### CodeRabbit Commands (invoked as PR comments) - `@coderabbitai pause` to pause the reviews on a PR. - `@coderabbitai resume` to resume the paused reviews. - `@coderabbitai review` to trigger an incremental review. This is useful when automatic reviews are disabled for the repository. - `@coderabbitai full review` to do a full review from scratch and review all the files again. - `@coderabbitai summary` to regenerate the summary of the PR. - `@coderabbitai resolve` resolve all the CodeRabbit review comments. - `@coderabbitai configuration` to show the current CodeRabbit configuration for the repository. - `@coderabbitai help` to get help. Additionally, you can add `@coderabbitai ignore` anywhere in the PR description to prevent this PR from being reviewed. ### CodeRabbit Configration File (`.coderabbit.yaml`) - You can programmatically configure CodeRabbit by adding a `.coderabbit.yaml` file to the root of your repository. - Please see the [configuration documentation](https://docs.coderabbit.ai/guides/configure-coderabbit) for more information. - If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: `# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json` ### Documentation and Community - Visit our [Documentation](https://coderabbit.ai/docs) for detailed information on how to use CodeRabbit. - Join our [Discord Community](https://discord.com/invite/GsXnASn26c) to get help, request features, and share feedback. - Follow us on [X/Twitter](https://twitter.com/coderabbitai) for updates and announcements.
nd0ut commented 3 weeks ago