From f9efb4d9920ff76b4b22bec8443ee2049a05cf26 Mon Sep 17 00:00:00 2001 From: Ben McCann <322311+benmccann@users.noreply.github.com> Date: Wed, 8 Mar 2023 09:56:24 -0800 Subject: [PATCH 01/23] chore: upgrade aria-query (#8353) --- package-lock.json | 28 +++++++++++++-------------- package.json | 4 ++-- src/compiler/compile/nodes/Element.ts | 10 +++++----- src/compiler/compile/utils/a11y.ts | 10 +++++----- 4 files changed, 26 insertions(+), 26 deletions(-) diff --git a/package-lock.json b/package-lock.json index a374ae9b32..66cfe635fe 100644 --- a/package-lock.json +++ b/package-lock.json @@ -19,14 +19,14 @@ "@rollup/plugin-typescript": "^2.0.1", "@rollup/plugin-virtual": "^3.0.1", "@sveltejs/eslint-config": "github:sveltejs/eslint-config#v5.8.0", - "@types/aria-query": "^5.0.0", + "@types/aria-query": "^5.0.1", "@types/mocha": "^7.0.0", "@types/node": "^8.10.53", "@typescript-eslint/eslint-plugin": "^5.29.0", "@typescript-eslint/parser": "^5.29.0", "acorn": "^8.8.1", "agadoo": "^3.0.0", - "aria-query": "^5.1.1", + "aria-query": "^5.1.3", "axobject-query": "^3.1.1", "code-red": "^1.0.0", "css-tree": "^2.3.1", @@ -505,9 +505,9 @@ "dev": true }, "node_modules/@types/aria-query": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/@types/aria-query/-/aria-query-5.0.0.tgz", - "integrity": "sha512-P+dkdFu0n08PDIvw+9nT9ByQnd+Udc8DaWPb9HKfaPwCvWvQpC5XaMRx2xLWECm9x1VKNps6vEAlirjA6+uNrQ==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/@types/aria-query/-/aria-query-5.0.1.tgz", + "integrity": "sha512-XTIieEY+gvJ39ChLcB4If5zHtPxt3Syj5rgZR+e1ctpmK8NjPf0zFqsz4JpLJT0xla9GFDKjy8Cpu331nrmE1Q==", "dev": true }, "node_modules/@types/estree": { @@ -955,9 +955,9 @@ } }, "node_modules/aria-query": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/aria-query/-/aria-query-5.1.1.tgz", - "integrity": "sha512-4cPQjOYM2mqq7mZG8CSxkUvL2Yv/x29VhGq5LKehTsxRnoVQps1YGt9NyjcNQsznEsD4rr8a6zGxqeNTqJWjpA==", + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/aria-query/-/aria-query-5.1.3.tgz", + "integrity": "sha512-R5iJ5lkuHybztUfuOAznmboyjWq8O6sqNqtK7CLOqdydi54VNbORp49mb14KbWgG1QD3JFO9hJdZ+y4KutfdOQ==", "dev": true, "dependencies": { "deep-equal": "^2.0.5" @@ -5736,9 +5736,9 @@ "from": "@sveltejs/eslint-config@github:sveltejs/eslint-config#v5.8.0" }, "@types/aria-query": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/@types/aria-query/-/aria-query-5.0.0.tgz", - "integrity": "sha512-P+dkdFu0n08PDIvw+9nT9ByQnd+Udc8DaWPb9HKfaPwCvWvQpC5XaMRx2xLWECm9x1VKNps6vEAlirjA6+uNrQ==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/@types/aria-query/-/aria-query-5.0.1.tgz", + "integrity": "sha512-XTIieEY+gvJ39ChLcB4If5zHtPxt3Syj5rgZR+e1ctpmK8NjPf0zFqsz4JpLJT0xla9GFDKjy8Cpu331nrmE1Q==", "dev": true }, "@types/estree": { @@ -6042,9 +6042,9 @@ } }, "aria-query": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/aria-query/-/aria-query-5.1.1.tgz", - "integrity": "sha512-4cPQjOYM2mqq7mZG8CSxkUvL2Yv/x29VhGq5LKehTsxRnoVQps1YGt9NyjcNQsznEsD4rr8a6zGxqeNTqJWjpA==", + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/aria-query/-/aria-query-5.1.3.tgz", + "integrity": "sha512-R5iJ5lkuHybztUfuOAznmboyjWq8O6sqNqtK7CLOqdydi54VNbORp49mb14KbWgG1QD3JFO9hJdZ+y4KutfdOQ==", "dev": true, "requires": { "deep-equal": "^2.0.5" diff --git a/package.json b/package.json index 1c8d3bceab..b7a62f91c6 100644 --- a/package.json +++ b/package.json @@ -129,14 +129,14 @@ "@rollup/plugin-typescript": "^2.0.1", "@rollup/plugin-virtual": "^3.0.1", "@sveltejs/eslint-config": "github:sveltejs/eslint-config#v5.8.0", - "@types/aria-query": "^5.0.0", + "@types/aria-query": "^5.0.1", "@types/mocha": "^7.0.0", "@types/node": "^8.10.53", "@typescript-eslint/eslint-plugin": "^5.29.0", "@typescript-eslint/parser": "^5.29.0", "acorn": "^8.8.1", "agadoo": "^3.0.0", - "aria-query": "^5.1.1", + "aria-query": "^5.1.3", "axobject-query": "^3.1.1", "code-red": "^1.0.0", "css-tree": "^2.3.1", diff --git a/src/compiler/compile/nodes/Element.ts b/src/compiler/compile/nodes/Element.ts index 416f1d7b31..0fdea77c16 100644 --- a/src/compiler/compile/nodes/Element.ts +++ b/src/compiler/compile/nodes/Element.ts @@ -23,7 +23,7 @@ import { string_literal } from '../utils/stringify'; import { Literal } from 'estree'; import compiler_warnings from '../compiler_warnings'; import compiler_errors from '../compiler_errors'; -import { ARIARoleDefintionKey, roles, aria, ARIAPropertyDefinition, ARIAProperty } from 'aria-query'; +import { ARIARoleDefinitionKey, roles, aria, ARIAPropertyDefinition, ARIAProperty } from 'aria-query'; import { is_interactive_element, is_non_interactive_roles, is_presentation_role, is_interactive_roles, is_hidden_from_screen_reader, is_semantic_role_element } from '../utils/a11y'; const aria_attributes = 'activedescendant atomic autocomplete busy checked colcount colindex colspan controls current describedby description details disabled dropeffect errormessage expanded flowto grabbed haspopup hidden invalid keyshortcuts label labelledby level live modal multiline multiselectable orientation owns placeholder posinset pressed readonly relevant required roledescription rowcount rowindex rowspan selected setsize sort valuemax valuemin valuenow valuetext'.split(' '); @@ -566,7 +566,7 @@ export default class Element extends Node { const value = attribute.get_static_value(); if (typeof value === 'string') { - value.split(regex_any_repeated_whitespaces).forEach((current_role: ARIARoleDefintionKey) => { + value.split(regex_any_repeated_whitespaces).forEach((current_role: ARIARoleDefinitionKey) => { if (current_role && aria_role_abstract_set.has(current_role)) { component.warn(attribute, compiler_warnings.a11y_no_abstract_role(current_role)); } else if (current_role && !aria_role_set.has(current_role)) { @@ -640,7 +640,7 @@ export default class Element extends Node { // click-events-have-key-events if (handlers_map.has('click')) { const role = attribute_map.get('role'); - const is_non_presentation_role = role?.is_static && !is_presentation_role(role.get_static_value() as ARIARoleDefintionKey); + const is_non_presentation_role = role?.is_static && !is_presentation_role(role.get_static_value() as ARIARoleDefinitionKey); if ( !this.is_dynamic_element && @@ -664,7 +664,7 @@ export default class Element extends Node { } // no-noninteractive-tabindex - if (!this.is_dynamic_element && !is_interactive_element(this.name, attribute_map) && !is_interactive_roles(attribute_map.get('role')?.get_static_value() as ARIARoleDefintionKey)) { + if (!this.is_dynamic_element && !is_interactive_element(this.name, attribute_map) && !is_interactive_roles(attribute_map.get('role')?.get_static_value() as ARIARoleDefinitionKey)) { const tab_index = attribute_map.get('tabindex'); if (tab_index && (!tab_index.is_static || Number(tab_index.get_static_value()) >= 0)) { component.warn(this, compiler_warnings.a11y_no_noninteractive_tabindex); @@ -673,7 +673,7 @@ export default class Element extends Node { // role-supports-aria-props const role = attribute_map.get('role'); - const role_value = (role ? role.get_static_value() : get_implicit_role(this.name, attribute_map)) as ARIARoleDefintionKey; + const role_value = (role ? role.get_static_value() : get_implicit_role(this.name, attribute_map)) as ARIARoleDefinitionKey; if (typeof role_value === 'string' && roles.has(role_value)) { const { props } = roles.get(role_value); const invalid_aria_props = new Set(aria.keys().filter(attribute => !(attribute in props))); diff --git a/src/compiler/compile/utils/a11y.ts b/src/compiler/compile/utils/a11y.ts index d51125fa92..60cb31c663 100644 --- a/src/compiler/compile/utils/a11y.ts +++ b/src/compiler/compile/utils/a11y.ts @@ -1,5 +1,5 @@ import { - ARIARoleDefintionKey, + ARIARoleDefinitionKey, roles as roles_map, elementRoles, ARIARoleRelationConcept @@ -32,17 +32,17 @@ const interactive_roles = new Set( non_abstract_roles.filter((name) => !non_interactive_roles.has(name)) ); -export function is_non_interactive_roles(role: ARIARoleDefintionKey) { +export function is_non_interactive_roles(role: ARIARoleDefinitionKey) { return non_interactive_roles.has(role); } -export function is_interactive_roles(role: ARIARoleDefintionKey) { +export function is_interactive_roles(role: ARIARoleDefinitionKey) { return interactive_roles.has(role); } const presentation_roles = new Set(['presentation', 'none']); -export function is_presentation_role(role: ARIARoleDefintionKey) { +export function is_presentation_role(role: ARIARoleDefinitionKey) { return presentation_roles.has(role); } @@ -141,7 +141,7 @@ export function is_interactive_element( return false; } -export function is_semantic_role_element(role: ARIARoleDefintionKey, tag_name: string, attribute_map: Map) { +export function is_semantic_role_element(role: ARIARoleDefinitionKey, tag_name: string, attribute_map: Map) { for (const [schema, ax_object] of elementAXObjects.entries()) { if (schema.name === tag_name && (!schema.attributes || schema.attributes.every( (attr) => attribute_map.has(attr.name) && attribute_map.get(attr.name).get_static_value() === attr.value From 80e6e2820408bdd1752cc1b866d106ad6c1d8824 Mon Sep 17 00:00:00 2001 From: Conduitry Date: Thu, 9 Mar 2023 05:04:38 -0500 Subject: [PATCH 02/23] chore: mark Promise.resolve() as pure to appease Agadoo (#8366) --- src/runtime/internal/scheduler.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/runtime/internal/scheduler.ts b/src/runtime/internal/scheduler.ts index 5327e7b5b5..c910ba1039 100644 --- a/src/runtime/internal/scheduler.ts +++ b/src/runtime/internal/scheduler.ts @@ -8,7 +8,7 @@ export const binding_callbacks = []; let render_callbacks = []; const flush_callbacks = []; -const resolved_promise = Promise.resolve(); +const resolved_promise = /* @__PURE__ */ Promise.resolve(); let update_scheduled = false; export function schedule_update() { From e2fe8ab46966a7c3a6702e7e5f71ac316c553288 Mon Sep 17 00:00:00 2001 From: Conduitry Date: Thu, 9 Mar 2023 19:31:19 -0500 Subject: [PATCH 03/23] -> v3.56.0 --- CHANGELOG.md | 65 ++++++++++++++++++++++++----------------------- package-lock.json | 4 +-- package.json | 2 +- 3 files changed, 36 insertions(+), 35 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ede7feaf22..dbc87cdb0e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,44 +1,45 @@ # Svelte changelog -## Unreleased +## 3.56.0 +* Add `|stopImmediatePropagation` event modifier ([#5085](https://github.com/sveltejs/svelte/issues/5085)) +* Add `axis` parameter to `slide` transition ([#6182](https://github.com/sveltejs/svelte/issues/6182)) +* Add `readonly` utility to convert `writable` store to readonly ([#6518](https://github.com/sveltejs/svelte/pull/6518)) +* Add `readyState` binding for media elements ([#6666](https://github.com/sveltejs/svelte/issues/6666)) +* Generate valid automatic component names when the filename contains only special characters ([#7143](https://github.com/sveltejs/svelte/issues/7143)) +* Add `naturalWidth` and `naturalHeight` bindings ([#7771](https://github.com/sveltejs/svelte/issues/7771)) +* Support `` on components ([#8082](https://github.com/sveltejs/svelte/issues/8082)) * Add a11y warnings: - * `aria-activedescendant-has-tabindex`: elements with `aria-activedescendant` need to have a `tabindex` ([#8172](https://github.com/sveltejs/svelte/pull/8172)) + * `aria-activedescendant-has-tabindex`: checks that elements with `aria-activedescendant` have a `tabindex` ([#8172](https://github.com/sveltejs/svelte/pull/8172)) * `role-supports-aria-props`: checks that the (implicit) element role supports the given aria attributes ([#8195](https://github.com/sveltejs/svelte/pull/8195)) -* Omit a11y warning on `